mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 00:42:54 +02:00
updategrade now cleans params correctly now (i hope)
This commit is contained in:
parent
801697d170
commit
d0b8bcdc8b
@ -1669,9 +1669,9 @@
|
||||
|
||||
confirm_sesskey();
|
||||
|
||||
$form = lesson_clean_data_submitted();
|
||||
$form = data_submitted();
|
||||
|
||||
if (!$essay = get_record("lesson_attempts", "id", $form->attemptid)) {
|
||||
if (!$essay = get_record("lesson_attempts", "id", clean_param($form->attemptid, PARAM_INT))) {
|
||||
error("Error: could not find essay");
|
||||
}
|
||||
|
||||
@ -1682,11 +1682,11 @@
|
||||
$essayinfo = new stdClass;
|
||||
$essayinfo = unserialize($essay->useranswer);
|
||||
|
||||
$essayinfo->graded = 1;
|
||||
$essayinfo->score = $form->score;
|
||||
$essayinfo->response = stripslashes_safe($form->response);
|
||||
$essayinfo->graded = 1;
|
||||
$essayinfo->score = clean_param($form->score, PARAM_INT);
|
||||
$essayinfo->response = clean_param(stripslashes_safe($form->response), PARAM_CLEANHTML);
|
||||
$essayinfo->sent = 0;
|
||||
if (!$lesson->custom && $form->score == 1) {
|
||||
if (!$lesson->custom && $essayinfo->score == 1) {
|
||||
$essay->correct = 1;
|
||||
} else {
|
||||
$essay->correct = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user