Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Minor improvements to match and multianswer.

  • Loading branch information...
commit 11cbf773ea5bfc277aa8fdca0ebf77a4a0b3950b 1 parent 1ae1e84
mindforge authored
View
5 mod/quiz/questiontypes/match/questiontype.php
@@ -216,7 +216,8 @@ function print_question_formulation_and_controls(&$question, &$state, $quiz, $op
///// Print the input controls //////
echo '<table border="0" cellpadding="10" align="right">';
- foreach ($subquestions as $key => $subquestion) {
+ foreach ($state->options->order as $key) {
+ $subquestion = $subquestions[$key];
/// Subquestion text:
echo '<tr><td align="left" valign="top">';
@@ -268,7 +269,7 @@ function grade_responses(&$question, &$state, $quiz) {
$sumgrade = 0;
foreach ($subquestions as $key => $sub) {
- if (isset($responses[$key]) and isset($sub->options->answers[$responses[$key]])) {
+ if (isset($sub->options->answers[$responses[$key]])) {
$sumgrade += $sub->options->answers[$responses[$key]]->fraction;
}
}
View
3  mod/quiz/questiontypes/multianswer/questiontype.php
@@ -457,7 +457,8 @@ function quiz_qtype_multianswer_extract_question($text) {
$wrapped->answer = array();
$wrapped->fraction = array();
$wrapped->feedback = array();
- $wrapped->questiontext = $answerregs[0]; //addslashes($answerregs[0]);
+ $wrapped->questiontext = addslashes(str_replace('&\#', '&#',
+ $answerregs[0]));
$wrapped->questiontextformat = 0;
$remainingalts = $answerregs[ANSWER_REGEX_ALTERNATIVES];
Please sign in to comment.
Something went wrong with that request. Please try again.