Merge commit 'catalyst/MOODLE_19_STABLE' into mdl19-linuxchix
[moodle-linuxchix.git] / question / format / qti2 / templates / composite.tpl
blob802cd08a57dac559fcca817e90677315469ee1ee
1 {if $courselevelexport}<?xml version="1.0" encoding="UTF-8"?>{/if}
2 <assessmentItem xmlns="http://www.imsglobal.org/xsd/imsqti_item_v2p0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_item_v2p0 ./imsqti_item_v2p0.xsd" identifier="{$assessmentitemidentifier}" title="{$assessmentitemtitle}" adaptive="false" timeDependent="false">
3         {section name=aid loop=$answers}
4         {if $answers[aid].answertype == 3}
5         <responseDeclaration identifier="{$questionid}{$answers[aid].id}" cardinality="single" baseType="identifier">
6                 <correctResponse>
7             {section name=subanswer loop=$answers[aid].subanswers}
8             {if $answers[aid].subanswers[subanswer].fraction > 0}
9                         <value>{$answers[aid].subanswers[subanswer].id}</value>
10                 {/if}
11                 {/section}
12                 </correctResponse>
13                 <mapping defaultValue="0">
14             {section name=subanswer loop=$answers[aid].subanswers}
15             {if $answers[aid].subanswers[subanswer].fraction != 0}
16                         <mapEntry mapKey="{$answers[aid].subanswers[subanswer].id}" mappedValue="{$answers[aid].subanswers[subanswer].fraction}"/>
17                 {/if}
18                 {/section}
19                 </mapping>
20         </responseDeclaration>
21     {elseif $answers[aid].answertype == 1}
22         <responseDeclaration identifier="{$questionid}{$answers[aid].id}" cardinality="single" baseType="string">
23                 <correctResponse>
24                 {section name=subanswer loop=$answers[aid].subanswers}
25                 {if $answers[aid].subanswers[subanswer].fraction > 0}
26                         <value>{$answers[aid].subanswers[subanswer].answer}</value>
27                 {/if}
28                 {/section}
29                 </correctResponse>
30                 <mapping lowerBound="0" upperBound="1" defaultValue="0">
31                 {section name=subanswer loop=$answers[aid].subanswers}
32                     {if $answers[aid].subanswers[subanswer].fraction != 0}
33                         <mapEntry mapKey="{$answers[aid].subanswers[subanswer].answer}" mappedValue="{$answers[aid].subanswers[subanswer].fraction}" />
34                         {/if}
35                 {/section}
36                 </mapping>
37         </responseDeclaration>
38         {/if}
39         {/section}
40         <outcomeDeclaration identifier="SCORE" cardinality="single" baseType="float"/>
41         <itemBody>
42         {if $questionText != ''}
43             <div class="assesmentItemBody">
44                 <p>{$questionText}</p>
45                 </div>
46         {/if}
47         <div class="interactive.cloze"><p>
48         {section name=qid loop=$questions.question}
49             {$questions.text[qid]}
50             {if $questions.question[qid].id != $cloze_trailing_text_id}
51                 {if $questions.question[qid].answertype == 3}
52                         <inlineChoiceInteraction responseIdentifier="{$questionid}{$questions.question[qid].id}" shuffle="false">
53                     {section name=aid loop=$questions.question[qid].subanswers}
54                                            <inlineChoice identifier="{$questions.question[qid].subanswers[aid].id}">{$questions.question[qid].subanswers[aid].answer}</inlineChoice>
55                                         {/section}
56                                 </inlineChoiceInteraction>
57                 {elseif $questions.question[qid].answertype == 1}
58                 <textEntryInteraction responseIdentifier="{$questionid}{$questions.question[qid].id}" expectedLength="15"/>
59                 {/if}
60         {/if}
61         {/section}</p></div>
62         {if $question_has_image == 1}
63                 <div class="media">
64             {if $hassize == 1}
65                         <object type="{$question->mediamimetype}" data="{$question->mediaurl}" width="{$question->mediax}" height="{$question->mediay}" />
66                 {else}
67                         <object type="{$question->mediamimetype}" data="{$question->mediaurl}" />     
68                 {/if}
69                 </div>
70         {/if}
71         </itemBody>
72         <responseProcessing xmlns="http://www.imsglobal.org/xsd/imsqti_item_v2p0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_item_v2p0 ../imsqti_item_v2p0.xsd">
73 {section name=answer loop=$answers}{if $answers[answer].answertype == 1 || $answers[answer].answertype == 3}
74                 <responseCondition>
75                         <responseIf>
76                                 <isNull>
77                                         <variable identifier="{$questionid}{$answers[answer].id}"/>
78                                 </isNull>
79                                 <setOutcomeValue identifier="SCORE{$questionid}{$answers[answer].id}">
80                                         <baseValue baseType="float">0</baseValue>
81                                 </setOutcomeValue>
82                         </responseIf>
83                         <responseElse>
84                                 <setOutcomeValue identifier="SCORE{$questionid}{$answers[answer].id}">
85                                         <mapResponse identifier="{$questionid}{$answers[answer].id}"/>
86                                 </setOutcomeValue>
87                         </responseElse>
88                 </responseCondition>
89         <setOutcomeValue identifier="FEEDBACK">
90             <variable identifier="{$questionid}{$answers[answer].id}"/>
91         </setOutcomeValue>              
92 {/if}{/section}
93         </responseProcessing>
94 {section name=answer loop=$answers}{if $answers[answer].answertype == 1 || $answers[answer].answertype == 3}
95            {section name=subanswer loop=$answers[answer].subanswers}
96        {if $answers[answer].subanswers[subanswer].feedback != ''}
97         <modalFeedback outcomeIdentifier="FEEDBACK" identifier="{$answers[answer].subanswers[subanswer].id}" showHide="show">{$answers[answer].subanswers[subanswer].feedback}</modalFeedback>
98 {/if}{/section}
99     {/if}   
100         {/section}
101 </assessmentItem>