From d60350ddac0a5923fd997c25c0144383445c2fad Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Thu, 13 Aug 2015 13:36:40 -0700 Subject: [PATCH] MDL-50516 mod_lesson: prevented deletion of previous attempts The 'startlastseen' flag was removing any previous attempts the user had from the DB. This meant that the user could simply re-answer the question, regardless of the number of attempts allowed. --- mod/lesson/view.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/mod/lesson/view.php b/mod/lesson/view.php index 1f384f0b25e..50a2bd27272 100644 --- a/mod/lesson/view.php +++ b/mod/lesson/view.php @@ -297,12 +297,6 @@ $timer = null; if ($pageid != LESSON_EOL) { /// This is the code updates the lessontime for a timed test $startlastseen = optional_param('startlastseen', '', PARAM_ALPHA); - if ($startlastseen == 'no') { - // this deletes old records not totally sure if this is necessary anymore - $retries = $DB->count_records('lesson_grades', array('lessonid'=>$lesson->id, 'userid'=>$USER->id)); - $DB->delete_records('lesson_attempts', array('userid' => $USER->id, 'lessonid' => $lesson->id, 'retry' => $retries)); - $DB->delete_records('lesson_branch', array('userid' => $USER->id, 'lessonid' => $lesson->id, 'retry' => $retries)); - } $page = $lesson->load_page($pageid); // Check if the page is of a special type and if so take any nessecary action -- 2.11.4.GIT