function testUnansweredCount() {
  var q = new vsaq.Questionnaire(root);
  q.setTemplate(QUESTIONNAIRE);

  // should be 4: box, radio, line, yesno
  assertEquals(4, q.rootBlock_.getUnansweredCount());
  q.setValues({'yesno_id': 'yes'});
  assertEquals(3, q.rootBlock_.getUnansweredCount());
  q.setValues({'yesno_id': 'yes', 'line_id': 'blah'});
  assertEquals(2, q.rootBlock_.getUnansweredCount());
  q.setValues({'line_id': '', 'radio_id': 'checked'});
  assertEquals(2, q.rootBlock_.getUnansweredCount());
  q.setValues({'box_id': 'blah2'});
  assertEquals(1, q.rootBlock_.getUnansweredCount());
  q.setValues({'yesno_id': 'yes', 'radio_id': 'checked'});
  assertEquals(1, q.rootBlock_.getUnansweredCount());
}
/**
 * Tests how many questions are unanswered in a block.
 * This test should probably really be in blockitems_test.js, but since we
 * already have a full questionnaire defined here, it's convenient.
 */
Tests how many questions are unanswered in a block.
This test should probably really be in blockitems_test.js, but since we
already have a full questionnaire defined here, it's convenient.
Tests how many questions are unanswered in a block . This test should probably really be in blockitems_test . js but since we already have a full questionnaire defined here it ' s convenient .
function testUnansweredCount() {
  var q = new vsaq.Questionnaire(root);
  q.setTemplate(QUESTIONNAIRE);
  assertEquals(4, q.rootBlock_.getUnansweredCount());
  q.setValues({'yesno_id': 'yes'});
  assertEquals(3, q.rootBlock_.getUnansweredCount());
  q.setValues({'yesno_id': 'yes', 'line_id': 'blah'});
  assertEquals(2, q.rootBlock_.getUnansweredCount());
  q.setValues({'line_id': '', 'radio_id': 'checked'});
  assertEquals(2, q.rootBlock_.getUnansweredCount());
  q.setValues({'box_id': 'blah2'});
  assertEquals(1, q.rootBlock_.getUnansweredCount());
  q.setValues({'yesno_id': 'yes', 'radio_id': 'checked'});
  assertEquals(1, q.rootBlock_.getUnansweredCount());
}
function testUnansweredCount ( ) { var q = new vsaq . Questionnaire ( root ) ; q . setTemplate ( QUESTIONNAIRE ) ; assertEquals ( 4 , q . rootBlock_ . getUnansweredCount ( ) ) ; q . setValues ( { 'yesno_id' : 'yes' } ) ; assertEquals ( 3 , q . rootBlock_ . getUnansweredCount ( ) ) ; q . setValues ( { 'yesno_id' : 'yes' , 'line_id' : 'blah' } ) ; assertEquals ( 2 , q . rootBlock_ . getUnansweredCount ( ) ) ; q . setValues ( { 'line_id' : '' , 'radio_id' : 'checked' } ) ; assertEquals ( 2 , q . rootBlock_ . getUnansweredCount ( ) ) ; q . setValues ( { 'box_id' : 'blah2' } ) ; assertEquals ( 1 , q . rootBlock_ . getUnansweredCount ( ) ) ; q . setValues ( { 'yesno_id' : 'yes' , 'radio_id' : 'checked' } ) ; assertEquals ( 1 , q . rootBlock_ . getUnansweredCount ( ) ) ; }
Tests how many questions are unanswered in a block.
Tests how many questions are unanswered in a block .
// should be 4: box, radio, line, yesno