adding some strings
[moodle-linuxchix.git] / lang / en_utf8 / help / quiz / formatgift.html
blob574550070adafe86f775495b6963d53dc87b3492
1 <h1>Importing "GIFT" format files</h1>
2 <p>GIFT is the most comprehensive import format available for importing
3 Moodle quiz questions from a text file. It supports Multiple-Choice,
4 True-False, Short Answer, Matching and Numerical questions, as well as insertion
5 of a _____ for the Missing Word format. Various question-types can be
6 mixed in a single text file, and the format also supports line comments,
7 question names, feedback and percentage-weight grades.</p>
9 <p>The text encoding of your text file must be utf-8 (unless you only use ascii characters).
10 An example questions text file can be found here: <a href="<?php echo $CFG->wwwroot; ?>/question/format/gift/examples.txt">gift/examples.txt</a>.</p>
12 <h3>Basics</h3>
14 <p>Each individual question in the GIFT file must not contain any blank lines. Each question is delimited by
15 at least one blank line. If you need to represent a blank line in your question you can use
16 the entity <b>\n</b>. You can use comments wherever you wish but they must start with two forward
17 slashes (<b>//</b>) at the start of the line.</p>
19 <h3>QUESTION TYPES</h3>
21 <p><u>Multiple Choice:</u><br />
22 For multiple choice questions, wrong answers are prefixed with a tilde (~)
23 and the correct answer is prefixed with an equal sign (=).</p>
24 <pre> Who's buried in Grant's tomb?{~Grant ~Jefferson =no one}</pre>
25 <p>The <b>Missing Word</b> format automatically inserts a fill-in-the-blank line (like this _____) in the middle of the sentence.
26 To use the Missing Word format, place the answers where you want the line to appear in the sentence.</p>
27 <pre> Grant is {~buried =entombed ~living} in Grant's tomb.</pre>
28 <p>If the answers come before the closing punctuation mark, a fill-in-the-blank line will be inserted
29 for the &quot;missing word&quot; format. All question types can be written in the Missing Word format.</p>
30 <p>There must be a blank line (double carriage return) separating questions.
31 For clarity, the answers can be written on separate lines and even indented. For example:</p>
32 <pre> The American holiday of Thanksgiving is celebrated on the {
33 ~second
34 ~third
35 =fourth
36 } Thursday of November.
38 Japanese characters originally came from what country? {
39 ~India
40 =China
41 ~Korea
42 ~Egypt}</pre>
44 <p><u>Short Answer:</u><br />
45 Answers in Short Answer question-type are all prefixed by an equal sign (=),
46 indicating that they are all correct answers. The answers must not contain a tilde.</p>
47 <pre> Who's buried in Grant's tomb?{=no one =nobody}
49 Two plus two equals {=four =4}.</pre>
50 <p>If there is only <u>one</u> correct Short Answer, it may be written without the equal sign prefix,
51 as long as it cannot be confused as True-False.</p>
53 <p><u>True-False:</u><br />
54 In this question-type the answer indicates whether the statement is true or false.
55 The answer should be written as {TRUE} or {FALSE}, or abbreviated to {T} or {F}.</p>
56 <pre> Grant is buried in Grant's tomb.{F}
58 The sun rises in the east.{T}</pre>
60 <p><u>Matching:</u><br />
61 Matching pairs begin with an equal sign (=) and are separated by this symbol "->". There must be at least three matching pairs.</p>
62 <pre> Matching Question. {
63 =subquestion1 -> subanswer1
64 =subquestion2 -> subanswer2
65 =subquestion3 -> subanswer3
68 Match the following countries with their corresponding capitals. {
69 =Canada -> Ottawa
70 =Italy -> Rome
71 =Japan -> Tokyo
72 =India -> New Delhi
73 }</pre>
74 <p>Matching questions do not support feedback or percentage answer weights.</p>
76 <p><u>Numerical:</u><br />
77 The answer section for Numerical questions must start with a number sign (#).
78 Numerical answers can include an error margin, which is written following the correct answer, separated by a colon.
79 So for example, if the correct answer is anything between 1.5 and 2.5, then it would be written as follows <u>{#2:0.5}</u>.
80 This indicates that 2 with an error margin of 0.5 is correct (i.e., the span from 1.5 to 2.5).
81 If no error margin is specified, it will be assumed to be zero.</p>
82 <pre> When was Ulysses S. Grant born? {#1822}
84 What is the value of pi (to 3 decimal places)? {#3.1415:0.0005}.</pre>
85 <p>Optionally, numerical answers can be written as a span in the following format {#<i>MinimumValue</i>..<i>MaximumValue</i>}.</p>
86 <pre> What is the value of pi (to 3 decimal places)? {#3.141..3.142}.</pre>
87 <p>Moodle's browser interface does not support multiple numerical answers, but Moodle's code can and so does GIFT.
88 This can be used to specify numerical multiple spans, and can be particularly usefully when combined with percentage weight grades.
89 If multiple answers are used, they must be separated by an equal sign, like short answer questions.</p>
90 <pre> When was Ulysses S. Grant born? {#
91 =1822:0
92 =%50%1822:2}</pre>
93 <p>Note that since Moodle's browser GUI doesn't support multiple answers for Numerical questions,
94 there's no way to see them or edit them through Moodle.
95 The only way to change a numerical answer beyond the first, is to delete the question
96 and re-import it (or use something like phpMyAdmin).</p>
98 <p><u>Essay:</u><br />
99 An essay question is simply a question with an empty answer field. Nothing is permitted
100 between the curly braces at all.</p>
101 <pre> Write a short biography of Ulysses S. Grant {}</pre>
103 <p><u>Description:</u><br />
104 A description "question" has no answer part at all</p>
105 <pre> The next set of questions will concern arithmatic</pre>
108 <h3>OPTIONS</h3>
109 <p>In addition to these basic question types, this filter offers the following options:
110 line comments, question name, feedback and percentage answer weight.</p>
112 <p><u>Line Comments:</u><br />
113 Comments that will not be imported into Moodle can be included in the text file.
114 This can be used to provide headers or more information about questions.
115 All lines that start with a double backslash (not counting tabs or spaces) will be ignored by the filter.</p>
116 <pre> // Subheading: Numerical questions below
117 What's 2 plus 2? {#4}</pre>
119 <p><u>Question Name:</u><br />
120 A question name can be specified by placing it first and enclosing it within double colons.</p>
121 <pre> ::Kanji Origins::Japanese characters originally
122 came from what country? {=China}
124 ::Thanksgiving Date::The American holiday of Thanksgiving is
125 celebrated on the {~second ~third =fourth} Thursday of November.</pre>
126 <p>If no question name is specified, the entire question will be used as the name by default.</p>
128 <p><u>Feedback:</u><br />
129 Feedback can be included for each answer by following the answer with a number sign (# also known as a hash mark) and the feedback.</p>
130 <pre> What's the answer to this multiple-choice question?{
131 ~wrong answer#feedback comment on the wrong answer
132 ~another wrong answer#feedback comment on this wrong answer
133 =right answer#Very good!}
135 Who's buried in Grant's tomb?{
136 =no one#excellent answer!
137 =nobody#excellent answer!}
139 Grant is buried in Grant's tomb.{FALSE#Wrong, No one is buried in Grant's tomb.#Right, well done.}</pre>
140 <p>For Multiple Choice questions, feedback is displayed only for the answer the student selected.
141 For short answer, feedback is shown only when students input the corresponding correct answer.
142 For true-false questions, there can be one or two feedback strings. The first is shown if the
143 student gives the wrong answer. The second if the student gives the right answer.</p>
145 <p><u>Percentage Answer Weights:</u><br />
146 Percentage answer weights are available for both Multiple Choice and Short Answer questions.
147 Percentage answer weights can be included by following the tilde (for Multiple Choice) or
148 equal sign (for Short Answer) with the desired percent enclosed within percent signs (e.g., %50%).
149 This option can be combined with feedback comments.</p>
150 <pre> Difficult question.{~wrong answer ~%50%half credit answer =full credit answer}
152 ::Jesus' hometown::Jesus Christ was from {
153 ~Jerusalem#This was an important city, but the wrong answer.
154 ~%25%Bethlehem#He was born here, but not raised here.
155 ~%50%Galilee#You need to be more specific.
156 =Nazareth#Yes! That's right!}.
158 ::Jesus' hometown:: Jesus Christ was from {
159 =Nazareth#Yes! That's right!
160 =%75%Nazereth#Right, but misspelled.
161 =%25%Bethlehem#He was born here, but not raised here.}</pre>
162 <p>Note that the last two examples are essentially the same question, first as multiple choice and then as short answer.</p>
164 <p><font size="-1">Note that it is possible to specify percentage answer weights that are NOT
165 available through the browser interface. The <b>Match Grades</b> drop-down on the import
166 page determines how these are handled. You can either request that an error be reported
167 or that the answer weight be adjusted to the nearest valid answer weight.</font></p>
169 <p><u>Specify text-formatting for the question</u><br />
170 The question text (only) may have an optional text format specified. Currently the available formats are
171 <b>moodle</b> (Moodle Auto-Format), <b>html</b> (HTML format), <b>plain</b> (Plain text format) and
172 <b>markdown</b> (Markdown format). The format is specified in square brackets immediately before the
173 question text. <a href="help.php?file=textformat.html">More information on text formats in Moodle.</a></p>
175 <pre>[markdown]The *American holiday of Thanksgiving* is celebrated on the {
176 ~second
177 ~third
178 =fourth
179 } Thursday of November. </pre>
182 <p><u>Multiple Answers:</u><br />
183 The Multiple Answers option is used for multiple choice questions when two or more answers must
184 be selected in order to obtain full credit. The multiple answers option is enabled by assigning
185 partial answer weight to multiple answers, while allowing no single answer to receive full credit.</p>
186 <pre> What two people are entombed in Grant's tomb? {
187 ~No one
188 ~%50%Grant
189 ~%50%Grant's wife
190 ~Grant's father }</pre>
191 <p>Note that there is no equal sign (=) in any answer and the answers should total no more than 100%,
192 otherwise Moodle will return an error.
193 To avoid the problem of students automatically getting 100% by simply checking all of the answers,
194 it is best to include negative answer weights for wrong answers.</p>
195 <pre> What two people are entombed in Grant's tomb? {
196 ~%-50%No one
197 ~%50%Grant
198 ~%50%Grant's wife
199 ~%-50%Grant's father }</pre>
201 <p><u>Special Characters ~ = # { } :</u><br />
202 These symbols <b> ~ = # { } : </b> control the operation of this filter and cannot be used as normal text within questions.
203 Since these symbols have a special role in determining the operation of this filter, they are called "control characters."
204 But sometimes you may want to use one of these characters, for example to show a mathematical formula in a question.
205 The way to get around this problem is "escaping" the control characters.
206 This means simply putting a backslash (\) before a control character so the filter will know that you want to use
207 it as a literal character instead of as a control character.
208 For example:</p>
209 <pre> Which answer equals 5? {
210 ~ \= 2 + 2
211 = \= 2 + 3
212 ~ \= 2 + 4 }
214 ::GIFT Control Characters::
215 Which of the following is NOT a control character for the GIFT import format? {
216 ~ \~ # \~ is a control character.
217 ~ \= # \= is a control character.
218 ~ \# # \# is a control character.
219 ~ \{ # \{ is a control character.
220 ~ \} # \} is a control character.
221 = \ # Correct! \ (backslash) is not a control character. BUT,
222 it is used to escape the control characters.
223 }</pre>
224 <p>When the question is processed, the backslash is removed and is not saved in Moodle.</p>
226 <h3>Specifying Categories</h3>
228 <p>It is possible to change the category into which the questions are added within the GIFT file.
229 You can change the category as many times as you wish within the file. All questions after the modifier
230 up to the next modifier or the end of the file will be added to the specified category. Up to the first
231 category modifier the category specified on the import screen will be used. Note that for this to work
232 the <b>from file:</b> box must be ticked on the import screen.</p>
234 <p>To include a category modifier include a line like this (with a blank line before and after):
236 <pre>
237 $CATEGORY: tom/dick/harry
238 </pre>
240 or simply
242 <pre>
243 $CATEGORY: mycategory
244 </pre>
246 ...the first example specifies a path of nested categories. In this cae the questions will go into <i>harry</i>. The
247 categories are created if they do not exist.</p>
249 <p><u>Other Options:</u><br />
250 Short Answer questions can be made case sensitive by changing &quot;0&quot; to &quot;1&quot; in the following line:<br />
251 <tt>$question-&gt;usecase = 0; // Ignore case</tt></p>
252 <p></p>