*/ public function export() { $js = ''; // prepare list of right proposition to allow // - easiest display // - easiest randomisation if needed one day // (here I use array_values to change array keys from $code1 $code2 ... to 0 1 ...) // get max length of displayed array $nbrAnswers = $this->selectNbrAnswers(); $counter = 1; $questionId = $this->questionJSId; $jstmpw = 'questions_answers_ponderation['.$questionId.'] = new Array();'."\n"; $jstmpw .= 'questions_answers_ponderation['.$questionId.'][0] = 0;'."\n"; // Options (A, B, C, ...) that will be put into the list-box $options = []; $letter = 'A'; for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) { $answerCorrect = $this->isCorrect($answerId); $answer = $this->selectAnswer($answerId); $realAnswerId = $this->selectAutoId($answerId); if (!$answerCorrect) { $options[$realAnswerId]['Lettre'] = $letter; // answers that will be shown at the right side $options[$realAnswerId]['Reponse'] = $answer; $letter++; } } $html = []; $jstmp = ''; $jstmpc = ''; // Answers for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) { $identifier = 'question_'.$questionId.'_matching_'; $answer = $this->selectAnswer($answerId); $answerCorrect = $this->isCorrect($answerId); $weight = $this->selectWeighting($answerId); $jstmp .= $answerId.','; if ($answerCorrect) { $html[] = '