Say I have several scales being looped on the same page using the following php code:
if (!isset($questions)) {
$questions = getQuestions('AA');
$questions_to_remove = ['AA08', 'AA10'];
$questions = array_values(array_diff($questions, $questions_to_remove));
if (value('SD10') == 10001) {
debug("UNEMPLOYED");
$questions_to_remove = ['AA03', 'AA04', 'AA13'];
$questions = array_values(array_diff($questions, $questions_to_remove));
}
shuffle($questions);
debug($questions);
registerVariable($questions);
}
$questions = loopPage($questions);
question($questions);
I can't figure out how to change the code to implement the 2 attention checks (PR01) and 3 bogus items (PR02) such that they are shown seamlessly as regular items of the 'AA' scales. They already have the same question type (all questions are fully labelled scales) and the same Likert point labels etc.. I would really appreciate any tips on how to do this.
As a bonus, I also want to implement a data quality related open ended question (PR03) at the end of the page of a randomly chosen AA scale. If that's too difficult I'll just append it to one of the scales since their order in the loop will be shuffled anyway.