From 425d616a1e370f69ed44ff6504cccd1b1fb0f8a2 Mon Sep 17 00:00:00 2001 From: thepurpleblob Date: Thu, 17 Feb 2005 13:37:49 +0000 Subject: [PATCH] Smarty templates used for new qti export feature. --- mod/quiz/format/qti/templates/choice.tpl | 70 ++++++++++++ .../format/qti/templates/choiceMultiple.tpl | 64 +++++++++++ mod/quiz/format/qti/templates/composite.tpl | 101 ++++++++++++++++++ .../format/qti/templates/extendedText.tpl | 17 +++ .../templates/extendedText_simpleEssay.tpl | 27 +++++ .../format/qti/templates/graphicGapMatch.tpl | 33 ++++++ mod/quiz/format/qti/templates/imsmanifest.tpl | 85 +++++++++++++++ mod/quiz/format/qti/templates/match.tpl | 62 +++++++++++ .../format/qti/templates/mmchoiceMultiple.tpl | 88 +++++++++++++++ .../format/qti/templates/notimplemented.tpl | 20 ++++ mod/quiz/format/qti/templates/numerical.tpl | 65 +++++++++++ mod/quiz/format/qti/templates/textEntry.tpl | 50 +++++++++ 12 files changed, 682 insertions(+) create mode 100755 mod/quiz/format/qti/templates/choice.tpl create mode 100755 mod/quiz/format/qti/templates/choiceMultiple.tpl create mode 100755 mod/quiz/format/qti/templates/composite.tpl create mode 100755 mod/quiz/format/qti/templates/extendedText.tpl create mode 100755 mod/quiz/format/qti/templates/extendedText_simpleEssay.tpl create mode 100644 mod/quiz/format/qti/templates/graphicGapMatch.tpl create mode 100755 mod/quiz/format/qti/templates/imsmanifest.tpl create mode 100644 mod/quiz/format/qti/templates/match.tpl create mode 100755 mod/quiz/format/qti/templates/mmchoiceMultiple.tpl create mode 100755 mod/quiz/format/qti/templates/notimplemented.tpl create mode 100755 mod/quiz/format/qti/templates/numerical.tpl create mode 100755 mod/quiz/format/qti/templates/textEntry.tpl diff --git a/mod/quiz/format/qti/templates/choice.tpl b/mod/quiz/format/qti/templates/choice.tpl new file mode 100755 index 00000000000..3a06d3378e0 --- /dev/null +++ b/mod/quiz/format/qti/templates/choice.tpl @@ -0,0 +1,70 @@ +{if $courselevelexport}{/if} + + + + {$correctresponse.id} + + + + + + + + + 0 + + + +

{$questionText}

+
+ + {section name=answer loop=$answers} + {$answers[answer].answer} + {if $answers[answer].feedback != ''} + {if $answers[answer].answer != $correctresponse.answer} + {$answers[answer].feedback} + {/if} + {/if} + + {/section} + + {if $question_has_image == 1} +
+ {if $hassize == 1} + + {else} + + {/if} + + {/if} + + + + + + + + + + + + 1 + + + + + + 0 + + + + + + + + {section name=answer loop=$answers} + {if $answers[answer].feedback != ''} + {$answers[answer].feedback} + {/if} + {/section} + diff --git a/mod/quiz/format/qti/templates/choiceMultiple.tpl b/mod/quiz/format/qti/templates/choiceMultiple.tpl new file mode 100755 index 00000000000..1746330774c --- /dev/null +++ b/mod/quiz/format/qti/templates/choiceMultiple.tpl @@ -0,0 +1,64 @@ +{if $courselevelexport}{/if} + + + + {section name=answer loop=$correctresponses} + {$correctresponses[answer].id} + {/section} + + + {section name=answer loop=$answers} + {if $answers[answer].fraction != 0} + + {/if} + {/section} + + + + +
+

{$questionText}

+
+
+ + {section name=answer loop=$answers} + {$answers[answer].answer} + {/section} + +
+ {if $question_has_image == 1} +
+ {if $hassize == 1} + + {else} + + {/if} + + {/if} + + + + + + + + + 0 + + + + + + + + + + + + + {section name=answer loop=$answers} + {if $answers[answer].feedback != ''} + {$answers[answer].feedback} + {/if} + {/section} + diff --git a/mod/quiz/format/qti/templates/composite.tpl b/mod/quiz/format/qti/templates/composite.tpl new file mode 100755 index 00000000000..802cd08a57d --- /dev/null +++ b/mod/quiz/format/qti/templates/composite.tpl @@ -0,0 +1,101 @@ +{if $courselevelexport}{/if} + + {section name=aid loop=$answers} + {if $answers[aid].answertype == 3} + + + {section name=subanswer loop=$answers[aid].subanswers} + {if $answers[aid].subanswers[subanswer].fraction > 0} + {$answers[aid].subanswers[subanswer].id} + {/if} + {/section} + + + {section name=subanswer loop=$answers[aid].subanswers} + {if $answers[aid].subanswers[subanswer].fraction != 0} + + {/if} + {/section} + + + {elseif $answers[aid].answertype == 1} + + + {section name=subanswer loop=$answers[aid].subanswers} + {if $answers[aid].subanswers[subanswer].fraction > 0} + {$answers[aid].subanswers[subanswer].answer} + {/if} + {/section} + + + {section name=subanswer loop=$answers[aid].subanswers} + {if $answers[aid].subanswers[subanswer].fraction != 0} + + {/if} + {/section} + + + {/if} + {/section} + + + {if $questionText != ''} +
+

{$questionText}

+
+ {/if} +

+ {section name=qid loop=$questions.question} + {$questions.text[qid]} + {if $questions.question[qid].id != $cloze_trailing_text_id} + {if $questions.question[qid].answertype == 3} + + {section name=aid loop=$questions.question[qid].subanswers} + {$questions.question[qid].subanswers[aid].answer} + {/section} + + {elseif $questions.question[qid].answertype == 1} + + {/if} + {/if} + {/section}

+ {if $question_has_image == 1} +
+ {if $hassize == 1} + + {else} + + {/if} + + {/if} + + +{section name=answer loop=$answers}{if $answers[answer].answertype == 1 || $answers[answer].answertype == 3} + + + + + + + 0 + + + + + + + + + + + +{/if}{/section} + +{section name=answer loop=$answers}{if $answers[answer].answertype == 1 || $answers[answer].answertype == 3} + {section name=subanswer loop=$answers[answer].subanswers} + {if $answers[answer].subanswers[subanswer].feedback != ''} + {$answers[answer].subanswers[subanswer].feedback} +{/if}{/section} + {/if} + {/section} + diff --git a/mod/quiz/format/qti/templates/extendedText.tpl b/mod/quiz/format/qti/templates/extendedText.tpl new file mode 100755 index 00000000000..52d2bd94ed0 --- /dev/null +++ b/mod/quiz/format/qti/templates/extendedText.tpl @@ -0,0 +1,17 @@ +{if $courselevelexport}{/if} + + + + +

{$questionText}

+ {if $question_has_image == 1} +
+ {if $hassize == 1} + + {else} + + {/if} + + {/if} + + diff --git a/mod/quiz/format/qti/templates/extendedText_simpleEssay.tpl b/mod/quiz/format/qti/templates/extendedText_simpleEssay.tpl new file mode 100755 index 00000000000..76d7d23ee26 --- /dev/null +++ b/mod/quiz/format/qti/templates/extendedText_simpleEssay.tpl @@ -0,0 +1,27 @@ +{if $courselevelexport}{/if} + + + + +
+

{$questionText}

+
+
+ + +
+ {if $question_has_image == 1} +
+ {if $hassize == 1} + + {else} + + {/if} + + {/if} + +{if $question->feedback != ''} + {$question->feedback} + {$question->feedback} +{/if} + diff --git a/mod/quiz/format/qti/templates/graphicGapMatch.tpl b/mod/quiz/format/qti/templates/graphicGapMatch.tpl new file mode 100644 index 00000000000..e2b5d06ea53 --- /dev/null +++ b/mod/quiz/format/qti/templates/graphicGapMatch.tpl @@ -0,0 +1,33 @@ +{if $courselevelexport}{/if} + + + + {section name=item loop=$gapitems} + {$gapitems[item].id} {$gapitems[item].id} + {/section} + + + {section name=item loop=$gapitems} + + {/section} + + + + +

{$questionText}

+
+ + + {section name=item loop=$gapitems} + + + + {/section} + {section name=item loop=$gapitems} + + {/section} + + + + + \ No newline at end of file diff --git a/mod/quiz/format/qti/templates/imsmanifest.tpl b/mod/quiz/format/qti/templates/imsmanifest.tpl new file mode 100755 index 00000000000..570d35a7cf6 --- /dev/null +++ b/mod/quiz/format/qti/templates/imsmanifest.tpl @@ -0,0 +1,85 @@ + + + + ADL SCORM + 1.2 + + + <langstring xml:lang="{$lang}">{$quiztitle}</langstring> + {$quizinfo} + {$quizkeywords} + + + {if $quiz_level_export == 1} + {$submiturl} + {$userid} + {$username} + {$quiz->id} + {$quiz->course} + {$quiztimeopen} + {$quiztimeclose} + {$quiz->timelimit} + {$quiz->shufflequestions} + {$quiz->shuffleanswers} + {$quiz->attempts} + {$quiz->attemptonlast} + {$grademethod} + {$quiz->feedback} + {$quiz->correctanswers} + {$quiz->grade} + {$quiz->sumgrades} + {$quiz->password} + {$quiz->subnet} + {$course->fullname} + {$course->shortname} + {/if} + + + + {section name=question loop=$questions} + + + IMS QTI Item + 2.0 + + + category{$questions[question].category}-question{$questions[question].id} + + {$questions[question].name} + + + Question {$questions[question].id} from category {$questions[question].category} + + + + + 1.0 + + + + LOMv1.0 + + + Draft + + + + + + false + {$questions[question].qtiinteractiontype} + {$questions[question].qtiscoreable} + nonadaptive + {$questions[question].qtisolutionavailable} + + + {if $questions[question].image != ''} + + {/if} + {$questions[question].exporttext} + + {/section} + + \ No newline at end of file diff --git a/mod/quiz/format/qti/templates/match.tpl b/mod/quiz/format/qti/templates/match.tpl new file mode 100644 index 00000000000..e1246320115 --- /dev/null +++ b/mod/quiz/format/qti/templates/match.tpl @@ -0,0 +1,62 @@ + + + + {section name=set loop=$matchsets} + q{$matchsets[set].id} a{$matchsets[set].id} + {/section} + + + + {section name=set loop=$matchsets} + + {/section} + + + + + +

{$questionText}

+
+ + + {section name=set loop=$matchsets} + {$matchsets[set].questiontext} + {/section} + + + {section name=set loop=$matchsets} + {$matchsets[set].answertext} + {/section} + + +
+ {if $question_has_image == 1} +
+ {if $hassize == 1} + + {else} + + {/if} + + {/if} + + + + + + + + + + 0 + + + + + + + + + + + diff --git a/mod/quiz/format/qti/templates/mmchoiceMultiple.tpl b/mod/quiz/format/qti/templates/mmchoiceMultiple.tpl new file mode 100755 index 00000000000..558e0774145 --- /dev/null +++ b/mod/quiz/format/qti/templates/mmchoiceMultiple.tpl @@ -0,0 +1,88 @@ +{if $courselevelexport}{/if} + + + + {section name=answer loop=$correctresponses} + {$correctresponses[answer].id} + {/section} + + + {section name=answer loop=$answers} + {if $answers[answer].fraction != 0} + + {/if} + {/section} + + + + +
+

{$questionText}

+
+
+ + {section name=answer loop=$answers} +

{$answers[answer].choice} + {if $answers[answer].media != ''} + + {/if}

+ {if $answers[answer].feedback != ''} + {$answers[answer].feedback} + {/if} + {if $answers[answer].altfeedback != ''} + {$answers[answer].altfeedback} + {/if} + + {/section} + + + {if $question_has_image == 1} +
+ {if $hassize == 1} + + {else} + + {/if} + + {/if} + + + + + + + + + 0 + + + + + + + + + + + + + {$question->feedbackfraction} + + + + + + + + + + + + +{if $question->feedbackok != ''} + {$question->feedbackok} +{/if} +{if $question->feedbackmissed != ''} + {$question->feedbackmissed} +{/if} + diff --git a/mod/quiz/format/qti/templates/notimplemented.tpl b/mod/quiz/format/qti/templates/notimplemented.tpl new file mode 100755 index 00000000000..e431354f25b --- /dev/null +++ b/mod/quiz/format/qti/templates/notimplemented.tpl @@ -0,0 +1,20 @@ +{if $courselevelexport}{/if} + + + + +

{$questionText}

+
+ +
+ {if $question_has_image == 1} +
+ {if $hassize == 1} + + {else} + + {/if} + + {/if} + + diff --git a/mod/quiz/format/qti/templates/numerical.tpl b/mod/quiz/format/qti/templates/numerical.tpl new file mode 100755 index 00000000000..d15992ecd06 --- /dev/null +++ b/mod/quiz/format/qti/templates/numerical.tpl @@ -0,0 +1,65 @@ +{if $courselevelexport}{/if} + + + + {$answer->answer} + + + + + + + +

{$questionText}

+
+ +
+ {if $question_has_image == 1} +
+ {if $hassize == 1} + + {else} + + {/if} + + {/if} + + + + + + + + + + + + {$lowerbound} + + + + {$upperbound} + + + + + 1 + + + + + 0 + + + + + + + +{if $answer->feedback != ''} + {$answer->feedback} +{/if} +{if $answer->altfeedback != ''} + {$answer->altfeedback} +{/if} + diff --git a/mod/quiz/format/qti/templates/textEntry.tpl b/mod/quiz/format/qti/templates/textEntry.tpl new file mode 100755 index 00000000000..6c03937998b --- /dev/null +++ b/mod/quiz/format/qti/templates/textEntry.tpl @@ -0,0 +1,50 @@ +{if $courselevelexport}{/if} + + + + {section name=answer loop=$correctresponses} + {$correctresponses[answer].answer} + {/section} + + + {section name=answer loop=$answers} + {if $answers[answer].fraction != 0} + + {/if} + {/section} + + + + +

{$questionText}

+
+ +
+ {if $question_has_image == 1} +
+ {if $hassize == 1} + + {else} + + {/if} + + {/if} + + + + + + + + + 0 + + + + + + + + + +