Merged in changes from MOODLE_17_STABLE for bug MDL-2006

This commit is contained in:
mark-nielsen 2006-12-06 02:04:37 +00:00
parent fed13a5e88
commit 15d2933a00
3 changed files with 6 additions and 6 deletions

View File

@ -88,7 +88,7 @@
$noanswer = true;
break;
}
$useranswer = stripslashes(clean_param($useranswer, PARAM_CLEAN));
$useranswer = stripslashes(clean_param($useranswer, PARAM_RAW));
$userresponse = addslashes($useranswer);
if (!$answers = get_records("lesson_answers", "pageid", $pageid, "id")) {
error("Continue: No answers found");
@ -184,7 +184,7 @@
break; // quit answer analysis immediately after a match has been found
}
}
$studentanswer = $useranswer;
$studentanswer = s($useranswer);
break;
case LESSON_TRUEFALSE :

View File

@ -616,7 +616,7 @@
$total = $stats["total"];
unset($stats["total"]);
foreach ($stats as $valentered => $ntimes) {
$data = "<input type=\"text\" size=\"50\" disabled=\"disabled\" readonly=\"readonly\" value=\"$valentered\">";
$data = '<input type="text" size="50" disabled="disabled" readonly="readonly" value="'.s($valentered).'" />';
$percent = $ntimes / $total * 100;
$percent = round($percent, 2);
$percent .= "% ".get_string("enteredthis", "lesson");
@ -628,7 +628,7 @@
$i++;
} else if ($useranswer != NULL and $answer->id == $useranswer->answerid) {
// get in here when a user answer matches one of the answers to the page
$data = "<input type=\"text\" size=\"50\" disabled=\"disabled\" readonly=\"readonly\" value=\"$useranswer->useranswer\">";
$data = '<input type="text" size="50" disabled="disabled" readonly="readonly" value="'.s($useranswer->useranswer).'">';
if (isset($pagestats[$page->id][$useranswer->useranswer])) {
$percent = $pagestats[$page->id][$useranswer->useranswer] / $pagestats[$page->id]["total"] * 100;
$percent = round($percent, 2);
@ -656,7 +656,7 @@
}
} elseif ($answer == end($answers) && empty($answerdata) && $useranswer != NULL) {
// get in here when what the user entered is not one of the answers
$data = "<input type=\"text\" size=\"50\" disabled=\"disabled\" readonly=\"readonly\" value=\"$useranswer->useranswer\">";
$data = '<input type="text" size="50" disabled="disabled" readonly="readonly" value="'.s($useranswer->useranswer).'">';
if (isset($pagestats[$page->id][$useranswer->useranswer])) {
$percent = $pagestats[$page->id][$useranswer->useranswer] / $pagestats[$page->id]["total"] * 100;
$percent = round($percent, 2);

View File

@ -556,7 +556,7 @@
case LESSON_SHORTANSWER :
case LESSON_NUMERICAL :
if (isset($USER->modattempts[$lesson->id])) {
$value = "value=\"$attempt->useranswer\"";
$value = 'value="'.s($attempt->useranswer).'"';
} else {
$value = "";
}