Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-34738 load sample dat file in tests

  • Loading branch information...
commit 735702f62c2643196dfc038215b07b166be740d1 1 parent 17ab0e7
Jean-Michel Vedrine jmvedrine authored
145 question/format/blackboard/tests/blackboardformat_test.php
@@ -41,151 +41,10 @@
41 41 class qformat_blackboard_test extends question_testcase {
42 42
43 43 public function make_test_xml() {
44   - $xml = "<?xml version='1.0' encoding='utf-8'?>
45   -<POOL>
46   - <TITLE value='exam 3 2008-9'/>
47   - <QUESTIONLIST>
48   - <QUESTION id='q1' class='QUESTION_TRUEFALSE' points='1'/>
49   - <QUESTION id='q7' class='QUESTION_MULTIPLECHOICE' points='1'/>
50   - <QUESTION id='q8' class='QUESTION_MULTIPLEANSWER' points='1'/>
51   - <QUESTION id='q39-44' class='QUESTION_MATCH' points='2'/>
52   - <QUESTION id='q9' class='QUESTION_ESSAY' points='1'/>
53   - <QUESTION id='q27' class='QUESTION_FILLINBLANK' points='1'/>
54   - </QUESTIONLIST>
55   - <QUESTION_TRUEFALSE id='q1'>
56   - <BODY>
57   - <TEXT><![CDATA[<span style=\"font-size:12pt\">42 is the Absolute Answer to everything.</span>]]></TEXT>
58   - <FLAGS>
59   - <ISHTML value='true'/>
60   - <ISNEWLINELITERAL value='false'/>
61   - </FLAGS>
62   - </BODY>
63   - <ANSWER id='q1_a1'>
64   - <TEXT>False</TEXT>
65   - </ANSWER>
66   - <ANSWER id='q1_a2'>
67   - <TEXT>True</TEXT>
68   - </ANSWER>
69   - <GRADABLE>
70   - <CORRECTANSWER answer_id='q1_a2'/>
71   - <FEEDBACK_WHEN_CORRECT><![CDATA[You gave the right answer.]]></FEEDBACK_WHEN_CORRECT>
72   - <FEEDBACK_WHEN_INCORRECT><![CDATA[42 is the Ultimate Answer.]]></FEEDBACK_WHEN_INCORRECT>
73   - </GRADABLE>
74   - </QUESTION_TRUEFALSE>
75   - <QUESTION_MULTIPLECHOICE id='q7'>
76   - <BODY>
77   - <TEXT><![CDATA[<span style=\"font-size:12pt\">What's between orange and green in the spectrum?</span>]]></TEXT>
78   - <FLAGS>
79   - <ISHTML value='true'/>
80   - <ISNEWLINELITERAL value='false'/>
81   - </FLAGS>
82   - </BODY>
83   - <ANSWER id='q7_a1' position='1'>
84   - <TEXT><![CDATA[<span style=\"font-size:12pt\">red</span>]]></TEXT>
85   - </ANSWER>
86   - <ANSWER id='q7_a2' position='2'>
87   - <TEXT><![CDATA[<span style=\"font-size:12pt\">yellow</span>]]></TEXT>
88   - </ANSWER>
89   - <ANSWER id='q7_a3' position='3'>
90   - <TEXT><![CDATA[<span style=\"font-size:12pt\">blue</span>]]></TEXT>
91   - </ANSWER>
92   - <GRADABLE>
93   - <CORRECTANSWER answer_id='q7_a2'/>
94   - <FEEDBACK_WHEN_CORRECT><![CDATA[You gave the right answer.]]></FEEDBACK_WHEN_CORRECT>
95   - <FEEDBACK_WHEN_INCORRECT><![CDATA[Only yellow is between orange and green in the spectrum.]]></FEEDBACK_WHEN_INCORRECT>
96   - </GRADABLE>
97   - </QUESTION_MULTIPLECHOICE>
98   - <QUESTION_MULTIPLEANSWER id='q8'>
99   - <BODY>
100   - <TEXT><![CDATA[<span style=\"font-size:12pt\">What's between orange and green in the spectrum?</span>]]></TEXT>
101   - <FLAGS>
102   - <ISHTML value='true'/>
103   - <ISNEWLINELITERAL value='false'/>
104   - </FLAGS>
105   - </BODY>
106   - <ANSWER id='q8_a1' position='1'>
107   - <TEXT><![CDATA[<span style=\"font-size:12pt\">yellow</span>]]></TEXT>
108   - </ANSWER>
109   - <ANSWER id='q8_a2' position='2'>
110   - <TEXT><![CDATA[<span style=\"font-size:12pt\">red</span>]]></TEXT>
111   - </ANSWER>
112   - <ANSWER id='q8_a3' position='3'>
113   - <TEXT><![CDATA[<span style=\"font-size:12pt\">off-beige</span>]]></TEXT>
114   - </ANSWER>
115   - <ANSWER id='q8_a4' position='4'>
116   - <TEXT><![CDATA[<span style=\"font-size:12pt\">blue</span>]]></TEXT>
117   - </ANSWER>
118   - <GRADABLE>
119   - <CORRECTANSWER answer_id='q8_a1'/>
120   - <CORRECTANSWER answer_id='q8_a3'/>
121   - <FEEDBACK_WHEN_CORRECT><![CDATA[You gave the right answer.]]></FEEDBACK_WHEN_CORRECT>
122   - <FEEDBACK_WHEN_INCORRECT>
123   - <![CDATA[Only yellow and off-beige are between orange and green in the spectrum.]]>
124   - </FEEDBACK_WHEN_INCORRECT>
125   - </GRADABLE>
126   - </QUESTION_MULTIPLEANSWER>
127   - <QUESTION_MATCH id='q39-44'>
128   - <BODY>
129   - <TEXT><![CDATA[<i>Classify the animals.</i>]]></TEXT>
130   - <FLAGS>
131   - <ISHTML value='true'/>
132   - <ISNEWLINELITERAL value='false'/>
133   - </FLAGS>
134   - </BODY>
135   - <ANSWER id='q39-44_a1' position='1'>
136   - <TEXT><![CDATA[frog]]></TEXT>
137   - </ANSWER>
138   - <ANSWER id='q39-44_a2' position='2'>
139   - <TEXT><![CDATA[cat]]></TEXT>
140   - </ANSWER>
141   - <ANSWER id='q39-44_a3' position='3'>
142   - <TEXT><![CDATA[newt]]></TEXT>
143   - </ANSWER>
144   - <CHOICE id='q39-44_c1' position='1'>
145   - <TEXT><![CDATA[mammal]]></TEXT>
146   - </CHOICE>
147   - <CHOICE id='q39-44_c2' position='2'>
148   - <TEXT><![CDATA[insect]]></TEXT>
149   - </CHOICE>
150   - <CHOICE id='q39-44_c3' position='3'>
151   - <TEXT><![CDATA[amphibian]]></TEXT>
152   - </CHOICE>
153   - <GRADABLE>
154   - <CORRECTANSWER answer_id='q39-44_a1' choice_id='q39-44_c3'/>
155   - <CORRECTANSWER answer_id='q39-44_a2' choice_id='q39-44_c1'/>
156   - <CORRECTANSWER answer_id='q39-44_a3' choice_id='q39-44_c3'/>
157   - </GRADABLE>
158   - </QUESTION_MATCH>
159   - <QUESTION_ESSAY id='q9'>
160   - <BODY>
161   - <TEXT><![CDATA[How are you?]]></TEXT>
162   - <FLAGS>
163   - <ISHTML value='true'/>
164   - <ISNEWLINELITERAL value='false'/>
165   - </FLAGS>
166   - </BODY>
167   - <ANSWER id='q9_a1'>
168   - <TEXT><![CDATA[Blackboard answer for essay questions will be imported as informations for graders.]]></TEXT>
169   - </ANSWER>
170   - <GRADABLE>
171   - </GRADABLE>
172   - </QUESTION_ESSAY>
173   - <QUESTION_FILLINBLANK id='q27'>
174   - <BODY>
175   - <TEXT><![CDATA[<span style=\"font-size:12pt\">Name an amphibian: __________.</span>]]></TEXT>
176   - <FLAGS>
177   - <ISHTML value='true'/>
178   - <ISNEWLINELITERAL value='false'/>
179   - </FLAGS>
180   - </BODY>
181   - <ANSWER id='q27_a1' position='1'>
182   - <TEXT>frog</TEXT>
183   - </ANSWER>
184   - <GRADABLE>
185   - </GRADABLE>
186   - </QUESTION_FILLINBLANK></POOL>";
  44 + $xml = file_get_contents(__DIR__ . '/fixtures/sample_blackboard.dat');
187 45 return $xml;
188 46 }
  47 +
189 48 public function test_import_match() {
190 49
191 50 $xmldata = xmlize($this->make_test_xml());
2  question/format/blackboard/tests/fixtures/sample_blackboard.dat
@@ -127,7 +127,7 @@
127 127 </QUESTION_ESSAY>
128 128 <QUESTION_FILLINBLANK id='q27'>
129 129 <BODY>
130   - <TEXT><![CDATA[Name an amphibian: __________.]]></TEXT>
  130 + <TEXT><![CDATA[<span style="font-size:12pt">Name an amphibian: __________.</span>]]></TEXT>
131 131 <FLAGS>
132 132 <ISHTML value='true'/>
133 133 <ISNEWLINELITERAL value='false'/>

0 comments on commit 735702f

Please sign in to comment.
Something went wrong with that request. Please try again.