[Update] Updated the help files to support regular expressions in short answer
This commit is contained in:
@@ -1,24 +1,28 @@
|
||||
<p align="center"><b>Question Option</b></p>
|
||||
|
||||
<p>A few of the Question Types have an option which is activated by clicking on
|
||||
the checkbox. The question types and the meaning of the options are
|
||||
detailed below.</p>
|
||||
|
||||
<ol>
|
||||
<li><p><b>Multichoice</b> There is variant of Multichoice questions called
|
||||
<b>"Multichoice Multianswer"</b> questions. If the Question
|
||||
Option is selected then the student is required to select all the
|
||||
correct answers from the set of answers. The question may or may not tell
|
||||
the student <i>how many</i> correct answers there are. For example "Which of the
|
||||
following were US Presidents?" does not, while "Select the two US
|
||||
presidents from the following list." does. The actual number of correct
|
||||
answers can be from <b>one</b> up to the number of choices. (A Multichoice
|
||||
Multianswer question with one correct answer <b>is</b> different from a
|
||||
Multichoice question as the former allows the student the possibility of
|
||||
choosing more than one answer while the latter does not.)</p></li>
|
||||
|
||||
<li><p><b>Short Answer</b> By default the comparisons ignore the case of the
|
||||
text. If the Question Option is selected then the comparisons are case
|
||||
sensitive.</p></li>
|
||||
|
||||
<p>The other Question Types does not use the Question Option.</p>
|
||||
<p align="center"><b>Question Option</b></p>
|
||||
|
||||
<p>A few of the Question Types have an option which is activated by clicking on
|
||||
the checkbox. The question types and the meaning of the options are
|
||||
detailed below.</p>
|
||||
|
||||
<ol>
|
||||
<li><p><b>Multichoice</b> There is variant of Multichoice questions called
|
||||
<b>"Multichoice Multianswer"</b> questions. If the Question
|
||||
Option is selected then the student is required to select all the
|
||||
correct answers from the set of answers. The question may or may not tell
|
||||
the student <i>how many</i> correct answers there are. For example "Which of the
|
||||
following were US Presidents?" does not, while "Select the two US
|
||||
presidents from the following list." does. The actual number of correct
|
||||
answers can be from <b>one</b> up to the number of choices. (A Multichoice
|
||||
Multianswer question with one correct answer <b>is</b> different from a
|
||||
Multichoice question as the former allows the student the possibility of
|
||||
choosing more than one answer while the latter does not.)</p></li>
|
||||
|
||||
<li>
|
||||
<p><b>Short Answer</b> There are two different comparison systems available
|
||||
for the Short Answer type of question: the simple system is used by default;
|
||||
the "Regular Expressions" system is used if the "Use Regular
|
||||
Expressions" option box is checked. For more information, please read
|
||||
the Lesson question types help file.</p>
|
||||
</li>
|
||||
</ol>
|
||||
<p>The other Question Types do not use the Question Option.</p>
|
||||
|
||||
@@ -1,135 +1,225 @@
|
||||
<p align="center"><b>Question Types</b></p>
|
||||
|
||||
<p>The types of Questions currently supported by the Lesson module are:
|
||||
|
||||
<ol>
|
||||
<li><p><b>Multichoice</b> This is the default question type. Multichoice questions
|
||||
are popular questions where the student is asked to choose one answer from a
|
||||
set of alternatives. The correct answer takes the student further into the
|
||||
lesson, the wrong answers do not. The wrong answers are sometimes called the
|
||||
"distractors" and the utility of these questions often rely more
|
||||
on the quality of the distractors than either the questions themselves or their
|
||||
correct answers.</p>
|
||||
|
||||
<p> Each answer can optionally have a response. If no response is
|
||||
entered for an answer then the default response "That's the Correct
|
||||
Answer" or "That's the Wrong Answer" is shown to the student.
|
||||
</p>
|
||||
|
||||
<p>It is possible to have more than one correct answer to a multichoice question.
|
||||
The different correct answers may give the student different responses and
|
||||
jump to different (forward) pages in the lesson but
|
||||
do not vary in their grades, (that is, some answers are <b>not</b> more correct
|
||||
than others, at least in terms of grade.) It is possible for all the answers
|
||||
to be correct and they might take the student to different (forward) parts of
|
||||
the lesson depending on which one is chosen.</p>
|
||||
|
||||
<p>There is variant of Multichoice questions called <b>"Multichoice
|
||||
Multianswer"</b> questions. These require the student to select all the
|
||||
correct answers from the set of answers. The question may or may not tell
|
||||
the student how many correct answers there are. For example "Which of the
|
||||
following were US Presidents?" does not, while "Select the two US
|
||||
presidents from the following list." does. The actual number of correct
|
||||
answers can be from <b>one</b> up to the number of choices. (A Multichoice
|
||||
Multianswer question with one correct answer <b>is</b> different from a
|
||||
Multichoice question as the former allows the student the possibility of
|
||||
choosing more than one answer while the latter does not.)</p>
|
||||
|
||||
<p>Again the correct answers are flagged using forward jumps, the wrong answers
|
||||
by same page or backward jumps. When there is more than one correct answer
|
||||
the jumps should all go to the same page, similarly with the wrong answers.
|
||||
If that is <b>not</b> the case a warning is given on the teacher's view of
|
||||
the lesson. The correct response, if required, should be given on the first
|
||||
correct answer and the wrong response, if required, should be on the first
|
||||
wrong answer. Responses on the other answers are ignored (without warning).
|
||||
</p></li>
|
||||
|
||||
<li><p><b>Short Answer</b> The student is prompted for a short piece of text.
|
||||
This is checked against one or more answers. Answers can be either correct
|
||||
or wrong. Each answer can optionally have a response. If no response is
|
||||
entered for an answer then the default response "That's the Correct
|
||||
Answer" or "That's the Wrong Answer" is shown to the student.
|
||||
If the text entered does not match any of the answers the question is wrong
|
||||
and the student is shown the default wrong response.
|
||||
</p>
|
||||
|
||||
<p>By default the comparisons ignore the case of the text. There is an option
|
||||
to make the comparisons case sensitive.</p>
|
||||
|
||||
<p>The asterisk (*) character can be used in answers as a "wild card"
|
||||
character. It stands for any number of characters (including no characters
|
||||
at all). For example, the answer "Long*" will match
|
||||
"longer", "longest" and "long". If one of
|
||||
the answers is just "*" (a single *) this answer will match
|
||||
anything, it is normally used as the last "catch-all" answer. The
|
||||
matching process goes through the answers in the order they appear on the
|
||||
screen. Once a match is found the process stops and the corresponding
|
||||
result (and response, if present) is returned. So, if for example the
|
||||
answers are Longest, Long* and * (in that order), the input
|
||||
"longer" will match the second answer and, in this case, the
|
||||
third answer, although a match, is ignored.</p>
|
||||
|
||||
<p> If an asterisk (*) is actually needed in an answer, it should be entered as
|
||||
\*, backslash asterisk.</p></li>
|
||||
|
||||
<li><p><b>True/False</b> The answer to this type of question only has two options,
|
||||
true or false. The student is prompted to choose which is the correct
|
||||
option. This type of question is basically a Multichoice question with just
|
||||
two choices.</p></li>
|
||||
|
||||
<li><p><b>Matching</b> These are quite powerful and flexible questions. They
|
||||
consist of a list of names or statements which must be correctly matched
|
||||
against other list of names or statements. For example "Match the
|
||||
Capital with the Country" with the two lists Japan, Canada, Italy and
|
||||
Tokyo, Ottawa, Rome. It is possible to have repeated entries in one of the
|
||||
lists but care should be taken to make the repeats identical. For example
|
||||
"Identify the type of these creatures" with the lists Sparrow,
|
||||
Cow, Ant, Dog and Bird, Animal, Insect, Animal. </p>
|
||||
|
||||
<p>When creating this type of question the items for the first list go into the
|
||||
Answer boxes and items for the second list go into the Response boxes. Once
|
||||
created a more sensible labeling scheme is shown. When the student
|
||||
successfully matches the items the jump on the first answer is used. An
|
||||
unsuccessful answer jumps to the page on the second answer. The question does
|
||||
<b>not</b> support custom responses, the student is told how many matches
|
||||
are correct or if all the matches are correct.</p>
|
||||
|
||||
<p>Unlike the Multichoice question where the choices are shown in a random
|
||||
order, the first list of items is <b>not</b> shuffled but shown in the same
|
||||
order as entered. This allows for <b>"Ordered"</b> questions to be
|
||||
constructed. Consider the question " Put the following into the order
|
||||
they were born, the earliest first" with the lists 1., 2., 3., 4. and
|
||||
Longfellow, Lawrence, Lowell, Larkin. The second list is shuffed before
|
||||
being used in the question, of course.</p></li>
|
||||
|
||||
<li><p><b>Numerical</b> This type of question requires a number as the answer.
|
||||
In it's simplest form it requires just one answer to be specified. For
|
||||
example "What is 2 plus 2?" with the answer 4 given a forward
|
||||
jump. However, it is better to specify a range because the internal rounding
|
||||
of numerical values can make single numeric comparisons rather hit or miss.
|
||||
Thus, if the question were "What is 10 divided by 3" it would be
|
||||
necessary to give the answer as <b>"Minimum:Maximum"</b>, that
|
||||
is <b>two</b> values separated by a colon (:). Thus if 3.33:3.34 is given as the
|
||||
acceptable range for the answer, then the answers 3.33, 3.333, 3.3333...
|
||||
would all be taken as correct answers. "Wrong" answers would
|
||||
include 3.3 (less than the minimum) and 3.4 (greater than the maximum).</p>
|
||||
|
||||
<p>More than one correct answer is allowed and the answers can be either single
|
||||
or pair of values. Note that the order in which the answers are tested is
|
||||
Answer 1, Answer 2... so some care needs to taken if the desired response
|
||||
is to appear. For example the question "When was Larkin born?"
|
||||
could have the single value of 1922, the exact answer, and the pair of
|
||||
values 1920:1929, the 20's, as the less exact answer.The order in which
|
||||
these values should be tested is, obviously, 1922 then 1920:1929. The
|
||||
first answer might have the response "That's exactly right"
|
||||
while the other answer's response might be "That's close, you've got
|
||||
the right decade"</p>
|
||||
|
||||
<p>Wrong answers can be given but depending on their actual range, care should
|
||||
be taken to place them after the correct answers. For example in adding the
|
||||
wrong answer 3:4 to the "10 divided by 3" question it needs to come
|
||||
after the correct answer. That is the answers are ordered 3.33:3.34 (the
|
||||
"correct" answer) then 3:4 (the "wrong" answer, but
|
||||
not wildly wrong answer!).</p></li>
|
||||
</ul>
|
||||
|
||||
<p align="center"><b>Question Types</b></p>
|
||||
|
||||
<p>The types of Questions currently supported by the Lesson module are:
|
||||
|
||||
<ol>
|
||||
<li><p><b>Multichoice</b> This is the default question type. Multichoice questions
|
||||
are popular questions where the student is asked to choose one answer from a
|
||||
set of alternatives. The correct answer takes the student further into the
|
||||
lesson, the wrong answers do not. The wrong answers are sometimes called the
|
||||
"distractors" and the utility of these questions often rely more
|
||||
on the quality of the distractors than either the questions themselves or their
|
||||
correct answers.</p>
|
||||
|
||||
<p> Each answer can optionally have a response. If no response is
|
||||
entered for an answer then the default response "That's the Correct
|
||||
Answer" or "That's the Wrong Answer" is shown to the student. </p>
|
||||
|
||||
<p>It is possible to have more than one correct answer to a multichoice question.
|
||||
The different correct answers may give the student different responses and
|
||||
jump to different (forward) pages in the lesson but
|
||||
do not vary in their grades, (that is, some answers are <b>not</b> more correct
|
||||
than others, at least in terms of grade.) It is possible for all the answers
|
||||
to be correct and they might take the student to different (forward) parts of
|
||||
the lesson depending on which one is chosen.</p>
|
||||
|
||||
<p>There is variant of Multichoice questions called <b>"Multichoice
|
||||
Multianswer"</b> questions. These require the student to select all the
|
||||
correct answers from the set of answers. The question may or may not tell
|
||||
the student how many correct answers there are. For example "Which of the
|
||||
following were US Presidents?" does not, while "Select the two US
|
||||
presidents from the following list." does. The actual number of correct
|
||||
answers can be from <b>one</b> up to the number of choices. (A Multichoice
|
||||
Multianswer question with one correct answer <b>is</b> different from a
|
||||
Multichoice question as the former allows the student the possibility of
|
||||
choosing more than one answer while the latter does not.)</p>
|
||||
|
||||
<p>Again the correct answers are flagged using forward jumps, the wrong answers
|
||||
by same page or backward jumps. When there is more than one correct answer
|
||||
the jumps should all go to the same page, similarly with the wrong answers.
|
||||
If that is <b>not</b> the case a warning is given on the teacher's view of
|
||||
the lesson. The correct response, if required, should be given on the first
|
||||
correct answer and the wrong response, if required, should be on the first
|
||||
wrong answer. Responses on the other answers are ignored (without warning). </p></li>
|
||||
|
||||
<li><p><b>Short Answer</b> </p>
|
||||
<p>The student is prompted for a short piece of text.
|
||||
This is checked against one or more answers. Answers can be either correct
|
||||
or wrong. Each answer can optionally have a response. If no response is
|
||||
entered for an answer then the default response "That's the Correct
|
||||
Answer" or "That's the Wrong Answer" is shown to the student.
|
||||
If the text entered does not match any of the answers the question is wrong
|
||||
and the student is shown the default wrong response.</p>
|
||||
<p><strong>There are two different comparison systems</strong> available for the
|
||||
Short Answer type of question: the simple system is used by default; the
|
||||
"Regular Expressions" system is used if the "Use Regular
|
||||
Expressions" option box is checked. </p>
|
||||
<ul>
|
||||
<li><strong>Simple analysis</strong>
|
||||
<p>In this (default) system of analysis, the comparisons ignore the case of the text. The
|
||||
asterisk (*) character can be used in answers as a "wild card"
|
||||
character. It stands for any number of characters (including no characters
|
||||
at all). For example, the answer "Long*" will match
|
||||
"longer", "longest" and "long". If one of
|
||||
the answers is just "*" (a single *) this answer will match
|
||||
anything, it is normally used as the last "catch-all" answer. The
|
||||
matching process goes through the answers in the order they appear on the
|
||||
screen. Once a match is found the process stops and the corresponding
|
||||
result (and response, if present) is returned. So, if for example the
|
||||
answers are Longest, Long* and * (in that order), the input
|
||||
"longer" will match the second answer and, in this case, the
|
||||
third answer, although a match, is ignored.</p>
|
||||
<p> If an asterisk (*) is actually needed in an answer, it should be entered as
|
||||
\*, backslash asterisk.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><strong>Regular Expressions analysis</strong>
|
||||
<p>This system gives you access to a more powerful but more complicated system for
|
||||
analysing the student's answers. For a complete introduction to Regular Expressions,
|
||||
see these sites <a href="http://www.zend.com/zend/tut/tutorial-delin2.php" target="_blank">regular-expressions
|
||||
tutorial</a> or <a href="http://perso.wanadoo.fr/joseph.rezeau/eao/developpement/expandRegexpToString.htm#"
|
||||
target="_blank">rezeau.org</a>. </p>
|
||||
<h3>Correct answer matching a regular expression pattern </h3>
|
||||
<p>It is not possible to give complete examples of the vast possibilities offered
|
||||
by this system, and the following are just some possibilities. </p>
|
||||
<p><strong>Example 1.</strong> Suppose your question is "What are the colors
|
||||
of the French flag?". In the Answer 1 frame you type this regular
|
||||
expression: "<span class="c_computeroutput">it’s blue, white(,| and)
|
||||
red</span>/i". This will match any of those four student answers:</p>
|
||||
<ul>
|
||||
<li>it’s blue, white, red</li>
|
||||
<li>it’s blue, white and red</li>
|
||||
<li>It’s blue, white, red</li>
|
||||
<li>It’s blue, white and red </li>
|
||||
</ul>
|
||||
<p>Please note that by default a regular expression match is case sensitive; to
|
||||
make the match case insensitive you must add the <strong>/i</strong> parameter
|
||||
right at the end of your expression.</p>
|
||||
<p><strong>Example 2</strong>. Question: "What is blue, or red, or yellow?".
|
||||
Answer: "(|it's )a colou?r". This will match:</p>
|
||||
<ul>
|
||||
<li>a colour</li>
|
||||
<li> a color</li>
|
||||
<li>it's a colour</li>
|
||||
<li>it's a color</li>
|
||||
</ul>
|
||||
<p>Notes.- The beginning of this regular expression "(|it's )" will
|
||||
match either nothing or "it's " (i.e. "it's" followed by
|
||||
a space). The ? (question-mark) means: preceding character zero or one time;
|
||||
it is used here to match British English as well as US spelling.</p>
|
||||
<p><strong>Example 3.</strong> Question: "Name an animal whose name is made
|
||||
of 3 letters and the middle letter is the vowel <em>a</em>". Anwer:
|
||||
"[bcr]at". This will match: bat, cat and rat. </p>
|
||||
<h3>Detecting missing required words or character strings</h3>
|
||||
<p>Regular expressions alone cannot detect absent character strings, so you have to
|
||||
add a little code in your Answer to take care of this. Any Teacher Answer which
|
||||
begins with a double hyphen will analyse the student’s answer to find out
|
||||
whether the following string is present or absent. If present, the analysis
|
||||
continues to the next question; if absent, the analysis stops and the relevant
|
||||
Response message is displayed.</p>
|
||||
<p><strong>Example 4. </strong></p>
|
||||
<ul>
|
||||
<li>Answer 2: <span class="c_computeroutput">--.*blue.*</span>/i</li>
|
||||
<li>student answer: "it's red and white" </li>
|
||||
<li>Response 2: <span class="c_computeroutput">The color of the sky is missing!</span></li>
|
||||
<li>Jump 2: <span class="c_computeroutput">this page</span></li>
|
||||
</ul>
|
||||
<p>Here, the . (dot) stands for “any character” and the * (asterisk)
|
||||
means “preceding special character repeated any number of times”.
|
||||
The Answer2 regular expression above means: check whether the character string
|
||||
"blue", preceded with anything and followed by anything is absent
|
||||
from the student's answer. Please note that the use of the asterisk is different
|
||||
in the Simple analysis system and in the Regular Expressions system.</p>
|
||||
<p><strong>Example 5.</strong> Question: "Name an animal whose name is made of
|
||||
3 letters and the middle letter is the vowel <em>a</em>". Teacher Answer: "--[b|c|r]". Response: "Your answer should start with one of these letters: b, c or r" </p>
|
||||
<h3>Detecting unwanted (incorrect) words or character strings</h3>
|
||||
<p>You may want to detect, in the student's answer, the presence of one or several
|
||||
words which should be <strong>not</strong> be there (because they are wrong) and
|
||||
to single them out with a specific response. Just start your teacher Answer by a
|
||||
double plus sign (++). </p>
|
||||
<p><strong>Example 6. </strong></p>
|
||||
<ul>
|
||||
<li>Answer 3: ++(yellow|black|orange|green|black|pink)/i</li>
|
||||
<li>student answer: "it's blue, orange and white" </li>
|
||||
<li>Response 3: One or more colors are wrong!</li>
|
||||
<li>Jump 3: this page</li></ul>
|
||||
<p>If any of these (wrong) colors is detected in the student’s answer,
|
||||
then the negative feedback message (Response 3) will be displayed and the
|
||||
wrong strings will be colored red (or the color of the .incorrect class if
|
||||
it exists in a CSS stylesheet of your active theme).</p>
|
||||
<p><strong>Example 7</strong>. Question: "Name an animal whose name is made
|
||||
of 3 letters and the middle letter is the vowel <em>a</em>". Teacher
|
||||
Answer: "++hat". Response: "You might wear one made of an
|
||||
animal's skin, but a hat can't be considered as an animal." </p>
|
||||
<h3>Escaping special characters </h3>
|
||||
<p>If you need to use characters which are part of the regular expressions set
|
||||
of <em>special characters</em>, you need to "escape" them (i.e. precede
|
||||
them with a backslash). E.g. if you want to accept the answer "My computer
|
||||
cost 1000$", you must write the regular expression as "My computer cost
|
||||
1000\$". The special characters which must be escaped are .^$*()[]+?|</p>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li><p><b>True/False</b> The answer to this type of question only has two options,
|
||||
true or false. The student is prompted to choose which is the correct
|
||||
option. This type of question is basically a Multichoice question with just
|
||||
two choices.</p></li>
|
||||
|
||||
<li><p><b>Matching</b> These are quite powerful and flexible questions. They
|
||||
consist of a list of names or statements which must be correctly matched
|
||||
against other list of names or statements. For example "Match the
|
||||
Capital with the Country" with the two lists Japan, Canada, Italy and
|
||||
Tokyo, Ottawa, Rome. It is possible to have repeated entries in one of the
|
||||
lists but care should be taken to make the repeats identical. For example
|
||||
"Identify the type of these creatures" with the lists Sparrow,
|
||||
Cow, Ant, Dog and Bird, Animal, Insect, Animal. </p>
|
||||
|
||||
<p>When creating this type of question the items for the first list go into the
|
||||
Answer boxes and items for the second list go into the Response boxes. Once
|
||||
created a more sensible labeling scheme is shown. When the student
|
||||
successfully matches the items the jump on the first answer is used. An
|
||||
unsuccessful answer jumps to the page on the second answer. The question does
|
||||
<b>not</b> support custom responses, the student is told how many matches
|
||||
are correct or if all the matches are correct.</p>
|
||||
|
||||
<p>Unlike the Multichoice question where the choices are shown in a random
|
||||
order, the first list of items is <b>not</b> shuffled but shown in the same
|
||||
order as entered. This allows for <b>"Ordered"</b> questions to be
|
||||
constructed. Consider the question " Put the following into the order
|
||||
they were born, the earliest first" with the lists 1., 2., 3., 4. and
|
||||
Longfellow, Lawrence, Lowell, Larkin. The second list is shuffed before
|
||||
being used in the question, of course.</p></li>
|
||||
|
||||
<li><p><b>Numerical</b> This type of question requires a number as the answer.
|
||||
In it's simplest form it requires just one answer to be specified. For
|
||||
example "What is 2 plus 2?" with the answer 4 given a forward
|
||||
jump. However, it is better to specify a range because the internal rounding
|
||||
of numerical values can make single numeric comparisons rather hit or miss.
|
||||
Thus, if the question were "What is 10 divided by 3" it would be
|
||||
necessary to give the answer as <b>"Minimum:Maximum"</b>, that
|
||||
is <b>two</b> values separated by a colon (:). Thus if 3.33:3.34 is given as the
|
||||
acceptable range for the answer, then the answers 3.33, 3.333, 3.3333...
|
||||
would all be taken as correct answers. "Wrong" answers would
|
||||
include 3.3 (less than the minimum) and 3.4 (greater than the maximum).</p>
|
||||
|
||||
<p>More than one correct answer is allowed and the answers can be either single
|
||||
or pair of values. Note that the order in which the answers are tested is
|
||||
Answer 1, Answer 2... so some care needs to taken if the desired response
|
||||
is to appear. For example the question "When was Larkin born?"
|
||||
could have the single value of 1922, the exact answer, and the pair of
|
||||
values 1920:1929, the 20's, as the less exact answer.The order in which
|
||||
these values should be tested is, obviously, 1922 then 1920:1929. The
|
||||
first answer might have the response "That's exactly right"
|
||||
while the other answer's response might be "That's close, you've got
|
||||
the right decade"</p>
|
||||
|
||||
<p>Wrong answers can be given but depending on their actual range, care should
|
||||
be taken to place them after the correct answers. For example in adding the
|
||||
wrong answer 3:4 to the "10 divided by 3" question it needs to come
|
||||
after the correct answer. That is the answers are ordered 3.33:3.34 (the
|
||||
"correct" answer) then 3:4 (the "wrong" answer, but
|
||||
not wildly wrong answer!).</p></li>
|
||||
</ul>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user