| @@ 32-50 (lines=19) @@ | ||
| 29 | * questions in the generated JavaScript. |
|
| 30 | * @param integer $js_id |
|
| 31 | */ |
|
| 32 | public static function export_question($questionId, $standalone = true, $js_id) |
|
| 33 | { |
|
| 34 | $question = new ScormQuestion(); |
|
| 35 | $qst = $question->read($questionId); |
|
| 36 | if( !$qst ) { |
|
| 37 | return ''; |
|
| 38 | } |
|
| 39 | $question->id = $qst->id; |
|
| 40 | $question->js_id = $js_id; |
|
| 41 | $question->type = $qst->type; |
|
| 42 | $question->question = $qst->question; |
|
| 43 | $question->description = $qst->description; |
|
| 44 | $question->weighting=$qst->weighting; |
|
| 45 | $question->position=$qst->position; |
|
| 46 | $question->picture=$qst->picture; |
|
| 47 | $assessmentItem = new ScormAssessmentItem($question, $standalone); |
|
| 48 | //echo "<pre>".print_r($scorm,1)."</pre>";exit; |
|
| 49 | return $assessmentItem->export(); |
|
| 50 | } |
|
| 51 | ||
| 52 | /** |
|
| 53 | * Include the correct answer class and create answer |
|
| @@ 442-459 (lines=18) @@ | ||
| 439 | * @param bool $standalone (ie including XML tag, DTD declaration, etc) |
|
| 440 | * @return string |
|
| 441 | */ |
|
| 442 | function export_question_qti($questionId, $standalone = true) |
|
| 443 | { |
|
| 444 | $question = new Ims2Question(); |
|
| 445 | $qst = $question->read($questionId); |
|
| 446 | if (!$qst or $qst->type == FREE_ANSWER) { |
|
| 447 | return ''; |
|
| 448 | } |
|
| 449 | $question->id = $qst->id; |
|
| 450 | $question->type = $qst->type; |
|
| 451 | $question->question = $qst->question; |
|
| 452 | $question->description = $qst->description; |
|
| 453 | $question->weighting=$qst->weighting; |
|
| 454 | $question->position=$qst->position; |
|
| 455 | $question->picture=$qst->picture; |
|
| 456 | $ims = new ImsAssessmentItem($question); |
|
| 457 | ||
| 458 | return $ims->export($standalone); |
|
| 459 | } |
|
| 460 | ||
| 461 | /** |
|
| 462 | * Clean text like a description |
|