continue;
}
$qtype = ($quizquestions[$i]->qtype=='random') ? $states[$i]->options->question->qtype : $quizquestions[$i]->qtype;
+ if($quizquestions[$i]->qtype =='randomsamatch'){
+ $quizquestions[$i]->options =$states[$i]->options ;
+ }
$q = get_question_responses($quizquestions[$i], $states[$i]);
if (empty($q)){
continue;
"AND hidden = '0'" .
"AND id NOT IN ($questionsinuse)");
}
+ function get_all_responses($question, $state) {
+ $answers = array();
+ if (is_array($question->options->subquestions)) {
+ foreach ($question->options->subquestions as $aid => $answer) {
+ if ($answer->questiontext) {
+ foreach($answer->options->answers as $ans ){
+ $answer->answertext = $ans->answer ;
+ }
+ $r = new stdClass;
+ $r->answer = $answer->questiontext . ": " . $answer->answertext;
+ $r->credit = 1;
+ $answers[$aid] = $r;
+ }
+ }
+ }
+ $result = new stdClass;
+ $result->id = $question->id;
+ $result->responses = $answers;
+ return $result;
+ }
/// BACKUP FUNCTIONS ////////////////////////////