/** * Returns the XML flow corresponding to one question * * @param int $questionId * @param bool $standalone (ie including XML tag, DTD declaration, etc) */ function export_question_qti($questionId, $standalone = true) { $question = new Ims2Question(); $qst = $question->read($questionId); if (!$qst or $qst->type == FREE_ANSWER) { return ''; } $question->id = $qst->id; $question->type = $qst->type; $question->question = $qst->question; $question->description = $qst->description; $question->weighting = $qst->weighting; $question->position = $qst->position; $question->picture = $qst->picture; $ims = new ImsAssessmentItem($question); return $ims->export($standalone); }