Skip to content
Vess Popov edited this page Nov 19, 2021 · 12 revisions

Sometimes it can be useful to show theta, sem or other item parameters during the assessment itself.

You can do so using the "Item Template Params" module in the 'Modules' tab of the assessment node. Setting this module tells the assessment node to run a separate R test which exposes the parameters you are interested in, so that you can then call them from your test template.

Here is an example of how to make current theta and current sem visible on your test template.

  1. Create a new test of type 'code'. Since your test will just be two lines of R code, there's no need to use the flowchart method:

  1. On the 'test inputs' dialog, add two input parameters called 'theta' and 'sem':

  1. In test logic, add the following R code:
params$theta = theta
params$sem = sem

Then, under the 'test outputs' dialog, add an output parameter called 'params' and Save.

  1. Go to the assessment node that's running the test where you want to show these properties. Find the 'Item Template Params' setting in the 'Modules' tab and set it to use the 'itemParams' test you just created:

  1. Now, you can call these item parameters through curly brackets from your test template (i.e. whichever template you are using to show your items).

  1. The end result looks like this:

You can extend this example to show any of the following item parameters:

  • items
  • itemsAdministered
  • params
  • scores
  • sem
  • settings
  • theta
  • traitScores

Do so by adding each additional parameter as a test input to your itemParams test, and adding corresponding lines to your R code. For example you could add a test input parameter called traitScores and then add this line to your R code: params$traitScores = traitScores.

You can also use this method to expose any custom variables, for example if you want to perform queries to your database and expose the obtained variable in your test template.

Clone this wiki locally