Changed Special Characters section: new code for escaping control characters with backslash.

This commit is contained in:
thetrinity
2004-02-27 09:07:36 +00:00
parent 8ec4b43554
commit 337b9e6fbc
+30 -8
View File
@@ -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 &quot;0&quot; to &quot;1&quot; in the following line:<br />
<tt>$question-&gt;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 &quot;General Import Format Technology&quot; or something like that,
but it's too long for a simple filter like this, so it just GIFT.</p>
~ &amp;#126;
<p><font size="-1">GIFT filter and documentation by Paul Tsuchido Shew http://ac.shew.jp. Last updated 27 Feb 2004.</font></p>