Changed Special Characters section: new code for escaping control characters with backslash.
This commit is contained in:
@@ -171,13 +171,35 @@
|
||||
~%-50%No one
|
||||
~%50%Grant
|
||||
~%50%Grant's wife
|
||||
~%-50%Grant's father }</pre>
|
||||
|
||||
<p><u>Special Characters ~ = { } :</u><br>
|
||||
These symbols <b> ~ = { } </b> control the operation of this filter and cannot be used as normal text within questions.
|
||||
Since these symbols have a special role in determining the operation of this filter, they are called "control characters."
|
||||
But sometimes you may want to use one of these characters, for example to show a mathematical formula in a question.
|
||||
The way to get around this problem is by using "HTML entities."
|
||||
~%-50%Grant's father }</pre>
|
||||
|
||||
<p><u>Special Characters ~ = # { } :</u><br />
|
||||
These symbols <b> ~ = # { } </b> control the operation of this filter and cannot be used as normal text within questions.
|
||||
Since these symbols have a special role in determining the operation of this filter, they are called "control characters."
|
||||
But sometimes you may want to use one of these characters, for example to show a mathematical formula in a question.
|
||||
The way to get around this problem is "escaping" the control characters.
|
||||
This means simply putting a backslash (\) before a control character so the filter will know that you want to use
|
||||
it as a literal character instead of as a control character.
|
||||
For example:</p>
|
||||
<pre> Which answer equals 5? {
|
||||
~ \= 2 + 2
|
||||
= \= 2 + 3
|
||||
~ \= 2 + 4 }
|
||||
|
||||
::GIFT Control Characters::
|
||||
Which of the following is NOT a control character for the GIFT import format? {
|
||||
~ \~ # \~ is a control character.
|
||||
~ \= # \= is a control character.
|
||||
~ \# # \# is a control character.
|
||||
~ \{ # \{ is a control character.
|
||||
~ \} # \} is a control character.
|
||||
= \\ # Correct! \\ (backslash) is not a control character. BUT,
|
||||
it is used to escape the control characters. So, to specify
|
||||
a literal backslash, you must escape it with a backslash
|
||||
(as shown in this example).
|
||||
}</pre>
|
||||
<p>When the question is processed, the backslash is removed and is not saved in Moodle.</p>
|
||||
|
||||
<p><u>Other Options:</u><br />
|
||||
Short Answer questions can be made case sensitive by changing "0" to "1" in the following line:<br />
|
||||
<tt>$question->usecase = 0; // Ignore case</tt></p>
|
||||
@@ -190,4 +212,4 @@
|
||||
Paul Tsuchido Shew wrote this filter in December 2003 incorporating community suggestions for a more robust question format.
|
||||
The name was conceived as an acronym for "General Import Format Technology" or something like that,
|
||||
but it's too long for a simple filter like this, so it just GIFT.</p>
|
||||
~ &#126;
|
||||
<p><font size="-1">GIFT filter and documentation by Paul Tsuchido Shew http://ac.shew.jp. Last updated 27 Feb 2004.</font></p>
|
||||
Reference in New Issue
Block a user