Good morning. I am trying to insert a repeat page code in case the question (WB02) is not answered correctly. The correct answer should be: 3. I have created an internal variable $rPG2, and have inserted this code at the top of page 3 (WB02 is listed at the end of page 2):
// only checked if $repeatedPG2 is not yet set
if (!isset($rPG2)) {
// check, if the answer is missing (code 3) in the selection WB02
$failWB02 = (value('WB02') == 3);
// check, if items in scale WB02 are unanswered
$failWB02 = (count(getItems('WB02', 'missing')) > 0);
if ($failWB02 || $failWB02) {
// be aware that page 2 repeats/was repeated
$rPG2 = true;
registerVariable('rPG2');
// show previous page again
repeatPage('error_missing');
}
}
Do you have any idea why the code is not working? Thank you very much in advance!