function testEvaluateConditions() {
  var items = setUpTestQuestionnaire();

  // Evaluate string-defined conditions (new format).
  item.conditions = 'radio1_id'; assert(item.evaluateConditions(items));
  item.conditions = 'radio2_id'; assert(!item.evaluateConditions(items));
  item.conditions = '!radio1_id'; assert(!item.evaluateConditions(items));
  item.conditions = '!radio2_id'; assert(item.evaluateConditions(items));
  item.conditions = 'checkgroup1_id'; assert(item.evaluateConditions(items));
  item.conditions = 'checkchoice1_id'; assert(item.evaluateConditions(items));
  item.conditions = '!checkchoice2_id'; assert(item.evaluateConditions(items));
  item.conditions = '!radiogroup1_id'; assert(item.evaluateConditions(items));
  item.conditions = '!radiochoice1_id'; assert(item.evaluateConditions(items));
  item.conditions = '!radiochoice2_id'; assert(item.evaluateConditions(items));

  item.conditions = 'radio1_id && yesno1_id/yes';
  assert(item.evaluateConditions(items));
  item.conditions = 'radio1_id && yesno1_id/no';
  assert(!item.evaluateConditions(items));
  item.conditions = 'radio2_id && yesno1_id/yes';
  assert(!item.evaluateConditions(items));
  item.conditions = 'radio2_id || yesno1_id/yes';
  assert(item.evaluateConditions(items));
  item.conditions = '!radiogroup1_id && yesno1_id/yes';
  assert(item.evaluateConditions(items));
  item.conditions = 'checkgroup1_id && yesno1_id/yes';
  assert(item.evaluateConditions(items));
}
/**
 * Tests evaluation of a group of conditions.
 */
Tests evaluation of a group of conditions.
Tests evaluation of a group of conditions .
function testEvaluateConditions() {
  var items = setUpTestQuestionnaire();
  item.conditions = 'radio1_id'; assert(item.evaluateConditions(items));
  item.conditions = 'radio2_id'; assert(!item.evaluateConditions(items));
  item.conditions = '!radio1_id'; assert(!item.evaluateConditions(items));
  item.conditions = '!radio2_id'; assert(item.evaluateConditions(items));
  item.conditions = 'checkgroup1_id'; assert(item.evaluateConditions(items));
  item.conditions = 'checkchoice1_id'; assert(item.evaluateConditions(items));
  item.conditions = '!checkchoice2_id'; assert(item.evaluateConditions(items));
  item.conditions = '!radiogroup1_id'; assert(item.evaluateConditions(items));
  item.conditions = '!radiochoice1_id'; assert(item.evaluateConditions(items));
  item.conditions = '!radiochoice2_id'; assert(item.evaluateConditions(items));
  item.conditions = 'radio1_id && yesno1_id/yes';
  assert(item.evaluateConditions(items));
  item.conditions = 'radio1_id && yesno1_id/no';
  assert(!item.evaluateConditions(items));
  item.conditions = 'radio2_id && yesno1_id/yes';
  assert(!item.evaluateConditions(items));
  item.conditions = 'radio2_id || yesno1_id/yes';
  assert(item.evaluateConditions(items));
  item.conditions = '!radiogroup1_id && yesno1_id/yes';
  assert(item.evaluateConditions(items));
  item.conditions = 'checkgroup1_id && yesno1_id/yes';
  assert(item.evaluateConditions(items));
}
function testEvaluateConditions ( ) { var items = setUpTestQuestionnaire ( ) ; item . conditions = 'radio1_id' ; assert ( item . evaluateConditions ( items ) ) ; item . conditions = 'radio2_id' ; assert ( ! item . evaluateConditions ( items ) ) ; item . conditions = '!radio1_id' ; assert ( ! item . evaluateConditions ( items ) ) ; item . conditions = '!radio2_id' ; assert ( item . evaluateConditions ( items ) ) ; item . conditions = 'checkgroup1_id' ; assert ( item . evaluateConditions ( items ) ) ; item . conditions = 'checkchoice1_id' ; assert ( item . evaluateConditions ( items ) ) ; item . conditions = '!checkchoice2_id' ; assert ( item . evaluateConditions ( items ) ) ; item . conditions = '!radiogroup1_id' ; assert ( item . evaluateConditions ( items ) ) ; item . conditions = '!radiochoice1_id' ; assert ( item . evaluateConditions ( items ) ) ; item . conditions = '!radiochoice2_id' ; assert ( item . evaluateConditions ( items ) ) ; item . conditions = 'radio1_id && yesno1_id/yes' ; assert ( item . evaluateConditions ( items ) ) ; item . conditions = 'radio1_id && yesno1_id/no' ; assert ( ! item . evaluateConditions ( items ) ) ; item . conditions = 'radio2_id && yesno1_id/yes' ; assert ( ! item . evaluateConditions ( items ) ) ; item . conditions = 'radio2_id || yesno1_id/yes' ; assert ( item . evaluateConditions ( items ) ) ; item . conditions = '!radiogroup1_id && yesno1_id/yes' ; assert ( item . evaluateConditions ( items ) ) ; item . conditions = 'checkgroup1_id && yesno1_id/yes' ; assert ( item . evaluateConditions ( items ) ) ; }
Tests evaluation of a group of conditions.
Tests evaluation of a group of conditions .
// Evaluate string-defined conditions (new format).