Branching and Custom Objectives

In this example we demonstrate how to

  1. Branch to different questions in the same test based upon the response of the current question
  2. Compute test objective scores for any set of specified custom objectives

The example shows how different 3 questions are delivered based upon the response to the first question. Once those three questions are delivered the last question would be common to all branches.

How the test works

Question 1 throws a multiple choice (Single Response) question to the user

     If the user selects choice 1 then

         the 2nd question is shown followed by question 3 and question 4

     If the user selects choice 2 then

         the 5th question is shown followed by question 6 and question 7

     If the user selects choice 3 then

         the 8th question is shown followed by question 9 and question 10

In each branch, the user is given 3 questions to take sequentially, and then all the branches terminate and meet at question number 11. Question 4, 7, 10 therefore have a jump to the last question (available as TQN variable)

 

To determine the choice selected by the user, we have used an HGR question format for the first question which allows us to put any weight for each choice in the question. We have assigned 4 points to the question and then weights of 25%, 50% and 75% to the choices 1, 2 and 3 which would result in score in this question as 1 (25% of 4), 2 (50% of 4) and 3 (75% of 4). Here is how the first question looks like

 

Computing the Objective Scores

This test also demonstrates how we can measure Test Objectives and their scores by our own custom criteria. In this test there are three objectives to be measured - 

JAVA, SQL and HTML. These objectives are measured by answers to their related questions in the test.

 

Objective Question Datatype Min Score Max Score
HTML 2, 3, 4  Number 0 10
Java 5, 6, 7  Number 0 10
SQL 8, 9, 10  Number 0 10

To create objectives in the test, add following text in the Test Objectives property while authoring the test

 

To map every question to their respective objective enter following in the Customization (notice this is just one way to map question to objective , you can create anything in the customizations and use that in your rules). Customizations are entered as Name=Value on each line.

 

Test Rules

Test Rule

Questions on which it is applied

if(parseInt(LS) == 1){return '2'}else if(parseInt(LS) == 2){return '5'}else if(parseInt(LS) == 3){return '8'}

1

if(parseInt(LQN) < parseInt(TQN) && LAC=='true'){var objId = UI_PROP.get('Q.'+LQN);OBJ.put(objId, parseInt(OBJ.get(objId)==null?'0':OBJ.get(objId)) + parseInt(LS));}  var ret = parseInt(LQN)+1; return (ret+'');

2,3,5,6,8,9

if(parseInt(LQN) < parseInt(TQN) && LAC=='true'){var objId = UI_PROP.get('Q.'+LQN);OBJ.put(objId, parseInt(OBJ.get(objId)==null?'0':OBJ.get(objId)) + parseInt(LS));}  return TQN;

4,7,10

 


Rating: