[Output] settings

Applies to the following products: 
Questionmark OnDemand
Questionmark Perception
Questionmark OnPremise
Applies to the following Perception versions: 
Perception 5.7
Perception 5.4
Perception 5.2
Perception 5.1

This section defines what parameters you wish to be passed to the URL which is to be notified at assessment end. The name of the parameter to be passed is on the left and the value to be given to the parameter is on the right. The parameter value can be:

  • The name of any of the original parameters passed to session.php
  • Any Questionmark parameters that have been mapped to in the [Input] section
  • Any quoted text, in which case the parameter will be given the value of the text, without the quotes
  • Any of the server variables that can be used as output parameters
  • Any of the demographic data values

Here are some examples of possible settings.

Setting Description
LESSON_SCORE=%SESSION.PERCENT% Will output the parameter LESSON_SCORE as the score for the assessment as a percentage
LESSON_TAG="123" Will output the parameter LESSON_TAG as 123
If session.php is called with the parameter LESSON_ID=1234 The setting LESSON_ID=LESSON_ID will pass on the parameter as LESSON_ID=1234. This means that session.php will pass through external parameters (see output parameter mapping).

Server variables that can be used as output parameters

Server variables can be used as output parameters. For example, the following table provides a list of useful server variables you may want to use as output parameters.

Server variable Description
%SESSION.DATE% The current date
%SESSION.GROUP% The current group name, or blank if not set
%SESSION.ID% The numeric ID of the assessment
%SESSION.MAX% The maximum score in points for the assessment
%SESSION.PERCENT% The percentage score
%SESSION.RESULT% The index of the record created for this session in the A_Result table of the repository database; this is particularly useful as it allows a program to get all the details for the assessment including all answers by the participant by reading the repository database.
%SESSION.SCORE% The score in points for the assessment
%SESSION.SCOREBAND% The title of the end block or assessment outcome reached at the end of the assessment
%SESSION.TIME% The current time
%SESSION.TIMEELAPSED% The number of seconds since the start of the assessment (only if a time limit is set). This is not 100% accurate within PIP, but is roughly correct.
%SESSION.TITLE% The name of the assessment in the repository
%SESSION.URL% The full URL of session.php
%SESSION.USER% The current participant name, or blank if not set
%SESSION.USERDETAILS% The current participant details, or blank if not set

Demographic data

You can include demographic data (special fields) in the PIP output by using the variables %SPECIAL.n% (where n has a value between 1 and 10), for example:

DemographicData1=%SPECIAL.1%

An assessment might generate this output parameter if the above setting is used:

?DemographicData1=Mid%20Year%20Assessment

Output parameter mapping

PIP will map output parameters so that of the parameters that have been passed in or mapped can then be assigned to any parameter to be passed out. For example:

EXAM=SESSION

means that at the end of the assessment PIP will set EXAM to whatever the value of SESSION is and send it to the URL is defined in the notify URL (specified in the [Settings] section). If this mapping is also made in the [Input] section:

SESSION=TEST_ID

Then the call:

session.php?pip=mypip&TEST_ID=9266402345738501

...means that at the end of the assessment PIP will send:

EXAM=9266402345738501

...to the notify URL.

To pass through a parameter you just need to declare it in the [Output] section, as in the example above. If the parameter isn't used internally, you can leave out the input parameter mapping and just echo the parameter in the [Output] section, for example:

TEST_ID=TEST_ID

So if we use this setting and no input setting and call:

session.php?pip=mypip&TEST_ID=9266402345738501

...at the end of the assessment, PIP will send TEST_ID=hello to the notify URL.