mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Merged in changes from MOODLE_17_STABLE for bug MDL-2006
This commit is contained in:
parent
fed13a5e88
commit
15d2933a00
@ -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 :
|
||||
|
@ -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);
|
||||
|
@ -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 = "";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user