protected function add_questions(ImsQtiWriter $writer, $quizz, $questions) { foreach ($questions as $path => $question) { $filename = basename($path); $ref = $writer->add_assessmentItemRef('ID_' . $question->id, $filename, '', $required = true); $weight = $this->get_grade($quizz->id, $question->id); $ref->add_weight(null, $weight); } }