Merge commit 'catalyst/MOODLE_19_STABLE' into mdl19-linuxchix
[moodle-linuxchix.git] / question / format / qti2 / templates / choiceMultiple.tpl
blob9b6ac0d8ae4506c22b5ba2e99faeaa854071c7de
1 {if $courselevelexport}<?xml version="1.0" encoding="UTF-8"?>{/if}
2 <assessmentItem xmlns="http://www.imsglobal.org/xsd/imsqti_v2p0"
3                                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4                                 xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p0 imsqti_v2p0.xsd"
5                                 identifier="{$assessmentitemidentifier}" title="{$assessmentitemtitle}" adaptive="false" timeDependent="false">
6         <responseDeclaration identifier="{$questionid}" cardinality="{$responsedeclarationcardinality}" baseType="identifier">
7                 <correctResponse>
8                 {section name=answer loop=$correctresponses}
9                         <value>{$correctresponses[answer].id}</value>
10                 {/section}
11                 </correctResponse>
12         </responseDeclaration>
13         <outcomeDeclaration identifier="SCORE" cardinality="single" baseType="float">
14                 <defaultValue>
15                         <value>0</value>
16                 </defaultValue>
17         </outcomeDeclaration>
18         <outcomeDeclaration identifier="FEEDBACK" cardinality="{$responsedeclarationcardinality}" baseType="identifier"/>
19         <outcomeDeclaration identifier="FEEDBACK2" cardinality="single" baseType="identifier"/>
20         <itemBody>
21            <div class="assesmentItemBody">
22                 <p>{$questionText}</p>
23        </div>
24         {if $question_has_image == 1}
25                 <div class="media">
26             {if $hassize == 1}
27                         <object type="{$question->mediamimetype}" data="{$question->mediaurl}" width="{$question->mediax}" height="{$question->mediay}" />
28                 {else}
29                         <object type="{$question->mediamimetype}" data="{$question->mediaurl}" />     
30                 {/if}
31                 </div>
32         {/if}
33                 <div class="interactive.choiceMultiple">
34                         <choiceInteraction responseIdentifier="{$questionid}" shuffle="{$shuffle}" maxChoices="{$maxChoices}">
35                 {section name=answer loop=$answers}
36                                 <simpleChoice identifier="i{$answers[answer].id}">{$answers[answer].answer}                
37                                 {if $answers[answer].feedback != ''}
38                                 {if $answers[answer].answer != $correctresponse.answer}
39                                     <feedbackInline identifier="i{$answers[answer].id}" outcomeIdentifier="FEEDBACK" showHide="show">{$answers[answer].feedback}</feedbackInline>
40                     {/if}
41                 {/if}
42                                 </simpleChoice>
43                 {/section}
44                         </choiceInteraction>
45                 </div>
46         </itemBody>
47         <responseProcessing> 
48                 {section name=answer loop=$answers}
49                 <responseCondition>
50                         <responseIf>
51                                 <{$operator}>
52                                         <baseValue baseType="identifier">i{$answers[answer].id}</baseValue>
53                                         <variable identifier="{$questionid}"/>
54                                 </{$operator}>
55                                 <setOutcomeValue identifier="SCORE">
56                                         <sum>
57                                                 <variable identifier="SCORE"/>
58                                                 <baseValue baseType="float">{$answers[answer].fraction}</baseValue>
59                                         </sum>
60                                 </setOutcomeValue>
61                         </responseIf>
62                 </responseCondition>
63                 {/section}
64                 <responseCondition>
65                         <responseIf>
66                                 <lte>
67                                         <variable identifier="SCORE"/>
68                                         <baseValue baseType="float">0</baseValue>
69                                 </lte>
70                                 <setOutcomeValue identifier="SCORE">
71                                         <baseValue baseType="float">0</baseValue>
72                                 </setOutcomeValue>
73                                 <setOutcomeValue identifier="FEEDBACK2">
74                                         <baseValue baseType="identifier">INCORRECT</baseValue>
75                                 </setOutcomeValue>
76                         </responseIf>
77                         <responseElseIf>
78                                 <gte>
79                                         <variable identifier="SCORE"/>
80                                         <baseValue baseType="float">0.99</baseValue>
81                                 </gte>
82                                 <setOutcomeValue identifier="SCORE">
83                                         <baseValue baseType="float">1</baseValue>
84                                 </setOutcomeValue>
85                                 <setOutcomeValue identifier="FEEDBACK2">
86                                         <baseValue baseType="identifier">CORRECT</baseValue>
87                                 </setOutcomeValue>
88                         </responseElseIf>
89                         <responseElse>
90                                 <setOutcomeValue identifier="FEEDBACK2">
91                                         <baseValue baseType="identifier">PARTIAL</baseValue>
92                                 </setOutcomeValue>
93                         </responseElse>
94                 </responseCondition>
95         <setOutcomeValue identifier="FEEDBACK">
96             <variable identifier="{$questionid}"/>
97         </setOutcomeValue>              
98         </responseProcessing>
99     {if $correctfeedback != ''}
100         <modalFeedback outcomeIdentifier="FEEDBACK2" identifier="CORRECT" showHide="show">{$correctfeedback}</modalFeedback>
101         {/if}
102     {if $partiallycorrectfeedback != ''}
103         <modalFeedback outcomeIdentifier="FEEDBACK2" identifier="PARTIAL" showHide="show">{$partiallycorrectfeedback}</modalFeedback>
104         {/if}
105     {if $incorrectfeedback != ''}
106         <modalFeedback outcomeIdentifier="FEEDBACK2" identifier="INCORRECT" showHide="show">{$incorrectfeedback}</modalFeedback>
107         {/if}
108     {if $generalfeedback != ''}
109         <modalFeedback outcomeIdentifier="completionStatus" identifier="not_attempted" showHide="hide">{$generalfeedback}</modalFeedback>
110         {/if}
111 </assessmentItem>