Moodle
  1. Moodle
  2. MDL-38732

Graded course activity while editing gradebook causes unintentional overrides

    Details

    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • Rank:
      41

      Description

      If an instructor goes into the gradebook and starts editing mode, and while the instructor is in that mode, someone does either a automatically graded activity, or someone edits the grades from something, when the instructor saves, but the individual grades and the course total grades will become overridden.

      Steps to reproduce:

      1. As teacher, go into course grade book and turn editing on.
      2. In another browser, go in as student and complete a quiz.
      3. Back in first browser, submit grade book edit. Quiz grade for attempt will be overridden with a dash grade.

        Issue Links

          Activity

          Hide
          Andrew Davis added a comment -

          Hi Barbara. Are you able to provide any additional information? Is there anything suspicious in the PHP error logs? It's difficult for me to investigate without some more clues.

          Show
          Andrew Davis added a comment - Hi Barbara. Are you able to provide any additional information? Is there anything suspicious in the PHP error logs? It's difficult for me to investigate without some more clues.
          Hide
          Barbara Taylor added a comment -

          Hi Andrew,

          This is the information I received from our server admin.

          There is nothing written to the error_log that would relate to this issue. In the database, the mdl_grade_grades table has the data set to a timestamp for items in the “overridden” column (as expected for overrides, otherwise they have a value of “0” when not locked/overridden). There is no unusual values there. Basically, it is performing as if this is a feature instead of a bug and we just need to find out if it is happening to others and, if so, what is the repeatable scenario to cause it. Our MySQL database was switched to InnoDB and it did not resolve the issue.

          Barbara

          Show
          Barbara Taylor added a comment - Hi Andrew, This is the information I received from our server admin. There is nothing written to the error_log that would relate to this issue. In the database, the mdl_grade_grades table has the data set to a timestamp for items in the “overridden” column (as expected for overrides, otherwise they have a value of “0” when not locked/overridden). There is no unusual values there. Basically, it is performing as if this is a feature instead of a bug and we just need to find out if it is happening to others and, if so, what is the repeatable scenario to cause it. Our MySQL database was switched to InnoDB and it did not resolve the issue. Barbara
          Hide
          Andrew Davis added a comment -

          This issue was assigned to me automatically, however I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue.

          For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment

          Show
          Andrew Davis added a comment - This issue was assigned to me automatically, however I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue. For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment
          Hide
          Barbara Taylor added a comment -

          I hope that someone can pick this up. We have this happening with many of our courses. We have figured out how we can unlock it from the database but only if the scores were not entered manually. Any manually entered scores are erased. We haven't been able to determine any patterns as to why the course total column is overridden. It doesn't always happen to every student. There are times when it happens for every student.

          Show
          Barbara Taylor added a comment - I hope that someone can pick this up. We have this happening with many of our courses. We have figured out how we can unlock it from the database but only if the scores were not entered manually. Any manually entered scores are erased. We haven't been able to determine any patterns as to why the course total column is overridden. It doesn't always happen to every student. There are times when it happens for every student.
          Hide
          Sam Anderson added a comment -

          Staff at my institution (UMass Amherst) tested this extensively, and were able to reproduce this problem consistently.

          The issue seems to be around having multiple editing windows open, then updating each window in succession.

          We took the following steps:

          1. Logging in to a course gradebook as a TA in one browser, and as teacher in another browser.
          2. As the TA, we edited a grade in one gradebook and updated it while the instructor's window was still open and had editing turned on.
          3. Then clicked "update" on the instructor's gradebook without changing anything.

          This resulted in the cell that the TA had changed being empty (meaning that the TA's grade did not stick) and overridden, the category total column being overridden for that student, as well as the Course Total grade being overridden for that student.

          We also tried:

          1. Logging in to a course gradebook as a TA. In the same browser, the TA opened an assignment submission grading page (i.e., not even in the gradebook proper).
          2. As the TA, we edited a grade in the assignment submission page and saved the page.
          3. We clicked "update" on the TA's gradebook without changing anything.

          This resulted in the cell that the TA had changed in the assignment grading page being empty (meaning that the grade did not stick) and overridden, the category total column being overridden for that student, as well as the Course Total grade being overridden for that student.

          We tried this with categories that have different aggregation methods (it is not an error that only occurs with a certain type of aggregation) and in different courses, with consistent results. Also tried columns with scale drop-downs instead of numeric entry boxes. Same thing occurred.

          Show
          Sam Anderson added a comment - Staff at my institution (UMass Amherst) tested this extensively, and were able to reproduce this problem consistently. The issue seems to be around having multiple editing windows open, then updating each window in succession. We took the following steps: 1. Logging in to a course gradebook as a TA in one browser, and as teacher in another browser. 2. As the TA, we edited a grade in one gradebook and updated it while the instructor's window was still open and had editing turned on. 3. Then clicked "update" on the instructor's gradebook without changing anything. This resulted in the cell that the TA had changed being empty (meaning that the TA's grade did not stick) and overridden, the category total column being overridden for that student, as well as the Course Total grade being overridden for that student. We also tried: 1. Logging in to a course gradebook as a TA. In the same browser, the TA opened an assignment submission grading page (i.e., not even in the gradebook proper). 2. As the TA, we edited a grade in the assignment submission page and saved the page. 3. We clicked "update" on the TA's gradebook without changing anything. This resulted in the cell that the TA had changed in the assignment grading page being empty (meaning that the grade did not stick) and overridden, the category total column being overridden for that student, as well as the Course Total grade being overridden for that student. We tried this with categories that have different aggregation methods (it is not an error that only occurs with a certain type of aggregation) and in different courses, with consistent results. Also tried columns with scale drop-downs instead of numeric entry boxes. Same thing occurred.
          Hide
          Debbie Unterseher added a comment -

          THANK YOU!!! We had this problem last semester, called a couple other institutions that use Moodle, and they said "it must be the teachers who are doing it!". But if you follow the steps above, the course totals get overridden (along with other totals!)... Why hasn't this been fixed?? Is it just a specific version of SQL or something? I would like to see other places try doing this and see if it gives the same error...

          Show
          Debbie Unterseher added a comment - THANK YOU!!! We had this problem last semester, called a couple other institutions that use Moodle, and they said "it must be the teachers who are doing it!". But if you follow the steps above, the course totals get overridden (along with other totals!)... Why hasn't this been fixed?? Is it just a specific version of SQL or something? I would like to see other places try doing this and see if it gives the same error...
          Hide
          Sam Anderson added a comment -

          Since I posted that last set of information, we've had a realization:

          With gradebooks set up with aggregation methods that calculate category or course totals automatically, the first person to save their changes to a particular grade cell would also, necessarily, be saving the automatically calculated changes made to any categories that grade cell is included in, including the overall course total.

          If another browser window with some out-of-date grade information is saved after this (as might be the case with multiple instructors and TAs or any other instance with multiple browser windows that have been left open), it means that the old values in the category/course totals would now not match the newly calculated values, and the old values would save over the new ones, which would, "appropriately," flag the category totals as overridden.

          So, everything here makes a strange kind of sense. The big issue is that the Moodle gradebook makes no allowances for having multiple graders working in it in the same time, which is a big problem for large classes at our university, where we can see classes with 10+ TAs. That's a different project that could be solved in any number of ways.

          Show
          Sam Anderson added a comment - Since I posted that last set of information, we've had a realization: With gradebooks set up with aggregation methods that calculate category or course totals automatically, the first person to save their changes to a particular grade cell would also, necessarily, be saving the automatically calculated changes made to any categories that grade cell is included in, including the overall course total. If another browser window with some out-of-date grade information is saved after this (as might be the case with multiple instructors and TAs or any other instance with multiple browser windows that have been left open), it means that the old values in the category/course totals would now not match the newly calculated values, and the old values would save over the new ones, which would, "appropriately," flag the category totals as overridden. So, everything here makes a strange kind of sense. The big issue is that the Moodle gradebook makes no allowances for having multiple graders working in it in the same time, which is a big problem for large classes at our university, where we can see classes with 10+ TAs. That's a different project that could be solved in any number of ways.
          Hide
          Debbie Unterseher added a comment -

          Is this only an issue for those that have the Ajax turned off for the grader report? We turned it off because it was causing other issues in the past. Maybe we need to turn it on again?

          Show
          Debbie Unterseher added a comment - Is this only an issue for those that have the Ajax turned off for the grader report? We turned it off because it was causing other issues in the past. Maybe we need to turn it on again?
          Hide
          Sam Anderson added a comment -

          We were finding that users with AJAX turned on were having, if anything, more problems with overrides than before we turned off AJAX functionality system-wide because they were unintentionally editing (and overriding) cells just by mousing around.

          We ended up working with programmers to apply a code change to prevent changes to grades from being saved if they include out-of-date data. We'll work with the programmers to see if those code changes can be posted here.

          Show
          Sam Anderson added a comment - We were finding that users with AJAX turned on were having, if anything, more problems with overrides than before we turned off AJAX functionality system-wide because they were unintentionally editing (and overriding) cells just by mousing around. We ended up working with programmers to apply a code change to prevent changes to grades from being saved if they include out-of-date data. We'll work with the programmers to see if those code changes can be posted here.
          Hide
          Longfei Yu added a comment -

          This is one of the admins from UMass Amherst. Here are our local fixed. If you have any questions, feel free to put comments here.

          1) grade/report/grader/lib.php [With some other local fixes, the line numbers maybe not exact.]
          public function process_data($data) {
          ........
          199 foreach ($students as $userid => $items) {
          200 $userid = clean_param($userid, PARAM_INT);
          201 foreach ($items as $itemid => $postedvalue) {
          202 $itemid = clean_param($itemid, PARAM_INT);
          203 // Was change requested?
          204 $oldvalue = $this->grades[$userid][$itemid];
          205 if ($datatype === 'grade') {
          206 //Local fix starts--------------------------------------------------------------
          207 if($data->currenttime < $oldvalue->timemodified) //compare the current user's page loading time again the last modified time in DB
          208

          { 209 $warnings[] = get_string('errorsavegradestaled', 'grades'); 210 return $warnings; 211 }

          212 //Local fix ends-------------------------------------------------------------------------------
          213 // If there was no grade and there still isn't
          214 if (is_null($oldvalue->finalgrade) && $postedvalue == -1)

          { 215 // -1 means no grade 216 continue; 217 }

          ......
          2) lang/en/grades.php (just add a new string) [With some other local fixes, the line numbers maybe not exact.]
          //Local fix starts--------------------------------------------------------------
          $string['errorsavegradestaled'] = 'ALERT: Your changes have not been saved because the gradebook was updated in another browser window by you or another user while this page was open. Your browser may allow you to view or print your changes if you hit the back button now.';
          ///Local fix ends--------------------------------------------------------------
          3) grade/report/grader/index.php [With some other local fixes, the line numbers maybe not exact.]
          165 echo '<div>';
          166 //Local fix starts-------------------------------------------------------
          167 $time = time(); //mark the page loading time
          168 echo '<input type="hidden" value="'.$time.'" name="currenttime" />';
          169 //Local fix ends--------------------------------------------------------------
          170 echo '<input type="hidden" value="'.s($courseid).'" name="id" />';
          171 echo '<input type="hidden" value="'.sesskey().'" name="sesskey" />';

          Show
          Longfei Yu added a comment - This is one of the admins from UMass Amherst. Here are our local fixed. If you have any questions, feel free to put comments here. 1) grade/report/grader/lib.php [With some other local fixes, the line numbers maybe not exact.] public function process_data($data) { ........ 199 foreach ($students as $userid => $items) { 200 $userid = clean_param($userid, PARAM_INT); 201 foreach ($items as $itemid => $postedvalue) { 202 $itemid = clean_param($itemid, PARAM_INT); 203 // Was change requested? 204 $oldvalue = $this->grades [$userid] [$itemid] ; 205 if ($datatype === 'grade') { 206 //Local fix starts-------------------------------------------------------------- 207 if($data->currenttime < $oldvalue->timemodified) //compare the current user's page loading time again the last modified time in DB 208 { 209 $warnings[] = get_string('errorsavegradestaled', 'grades'); 210 return $warnings; 211 } 212 //Local fix ends------------------------------------------------------------------------------- 213 // If there was no grade and there still isn't 214 if (is_null($oldvalue->finalgrade) && $postedvalue == -1) { 215 // -1 means no grade 216 continue; 217 } ...... 2) lang/en/grades.php (just add a new string) [With some other local fixes, the line numbers maybe not exact.] //Local fix starts-------------------------------------------------------------- $string ['errorsavegradestaled'] = 'ALERT: Your changes have not been saved because the gradebook was updated in another browser window by you or another user while this page was open. Your browser may allow you to view or print your changes if you hit the back button now.'; ///Local fix ends-------------------------------------------------------------- 3) grade/report/grader/index.php [With some other local fixes, the line numbers maybe not exact.] 165 echo '<div>'; 166 //Local fix starts------------------------------------------------------- 167 $time = time(); //mark the page loading time 168 echo '<input type="hidden" value="'.$time.'" name="currenttime" />'; 169 //Local fix ends-------------------------------------------------------------- 170 echo '<input type="hidden" value="'.s($courseid).'" name="id" />'; 171 echo '<input type="hidden" value="'.sesskey().'" name="sesskey" />';
          Hide
          Barbara Taylor added a comment -

          Will any of this code make its way into Moodle core? Today we have instructors who many changed a score that was for a quiz and the course total locked up.

          Show
          Barbara Taylor added a comment - Will any of this code make its way into Moodle core? Today we have instructors who many changed a score that was for a quiz and the course total locked up.
          Hide
          Justin Litalien added a comment -

          Same here Barbara! I've fielded a few calls on this issue within the last couple of weeks. Some of our classes have large enrollments, so this is a pain to do individually. And, I've found no way to recreate the issue. Every time I think I know what is causing it, I'm back to square one.

          In my opinion this needs to be addressed immediately.

          Show
          Justin Litalien added a comment - Same here Barbara! I've fielded a few calls on this issue within the last couple of weeks. Some of our classes have large enrollments, so this is a pain to do individually. And, I've found no way to recreate the issue. Every time I think I know what is causing it, I'm back to square one. In my opinion this needs to be addressed immediately.
          Hide
          Debbie Unterseher added a comment -

          Me too! This is a huge problem for us as well.

          Show
          Debbie Unterseher added a comment - Me too! This is a huge problem for us as well.
          Hide
          Justin Litalien added a comment -

          Barbara, this is affecting us here on 2.3.9 as well...

          Show
          Justin Litalien added a comment - Barbara, this is affecting us here on 2.3.9 as well...
          Hide
          Debbie Unterseher added a comment -

          We are on 2.4.5 and it is affect us also. One note though - I had a teacher who does all of the grading, and she had the problem as well...

          Show
          Debbie Unterseher added a comment - We are on 2.4.5 and it is affect us also. One note though - I had a teacher who does all of the grading, and she had the problem as well...
          Hide
          mikehas added a comment -

          If the problem occurs when gradebook values loaded in the browser are not the same as what's in the Moodle DB, I wonder if this problem could also arise when a new grade is submitted from an activity like a quiz during a grading session.

          For example: (untested)
          1. Instructor opens gradebook.
          2. Instructor makes a change to an activity grade.
          3. Student(s) submits a graded quiz.
          4. Instructor submits the changes on the gradebook.

          Theory: The category containing the overridden quiz would now be overridden.

          I may be missing something here, but it sounds like there may be a number of ways this could occur, I don't have time to test the scenario above, but I am interested if this could cause the same problem.

          We are very interested in a solution.

          Show
          mikehas added a comment - If the problem occurs when gradebook values loaded in the browser are not the same as what's in the Moodle DB, I wonder if this problem could also arise when a new grade is submitted from an activity like a quiz during a grading session. For example: (untested) 1. Instructor opens gradebook. 2. Instructor makes a change to an activity grade. 3. Student(s) submits a graded quiz. 4. Instructor submits the changes on the gradebook. Theory: The category containing the overridden quiz would now be overridden. I may be missing something here, but it sounds like there may be a number of ways this could occur, I don't have time to test the scenario above, but I am interested if this could cause the same problem. We are very interested in a solution.
          Hide
          Debbie Unterseher added a comment -

          What does "STABLE backlog, BACKEND" mean? I am ready to do an end of the semester update, but if this is somewhere in the process of being fixed, maybe I should wait!

          Show
          Debbie Unterseher added a comment - What does "STABLE backlog, BACKEND" mean? I am ready to do an end of the semester update, but if this is somewhere in the process of being fixed, maybe I should wait!
          Hide
          Debbie Unterseher added a comment -

          The problem does occur like mikehas mentioned above - if you are grading in the gradebook, and a student takes a quiz, and then you submit the your changes to the gradebook, it gives overrides. I also tested the fix that Longfei Yu gave, and this stops the overrides, but it is such a small "Alert" at the top, that the teacher might not even notice there was a problem entering grades. There also is another tracker issue on this https://tracker.moodle.org/browse/MDL-42106. Funny that it hasn't been solved. Maybe everyone just blames the teachers... or no one catches it.

          Show
          Debbie Unterseher added a comment - The problem does occur like mikehas mentioned above - if you are grading in the gradebook, and a student takes a quiz, and then you submit the your changes to the gradebook, it gives overrides. I also tested the fix that Longfei Yu gave, and this stops the overrides, but it is such a small "Alert" at the top, that the teacher might not even notice there was a problem entering grades. There also is another tracker issue on this https://tracker.moodle.org/browse/MDL-42106 . Funny that it hasn't been solved. Maybe everyone just blames the teachers... or no one catches it.
          Hide
          Gloria Doherty added a comment -

          We can confirm that if a student submits in quiz while the grader is working in grade book the override occurs. We can replicate this in Moodle 2.4.7

          Example:
          The student, makes a submission in a quiz, which reports correctly in the grade book. At the same time the grader is performing transactions in the grade book, which are not related to the quiz. There is an apparent conflict between the grader's transactions and the student's quiz submission. The student's quiz score no longer displays in the grade book, the quiz category total is overridden, and the Course Total is overridden.

          Show
          Gloria Doherty added a comment - We can confirm that if a student submits in quiz while the grader is working in grade book the override occurs. We can replicate this in Moodle 2.4.7 Example: The student, makes a submission in a quiz, which reports correctly in the grade book. At the same time the grader is performing transactions in the grade book, which are not related to the quiz. There is an apparent conflict between the grader's transactions and the student's quiz submission. The student's quiz score no longer displays in the grade book, the quiz category total is overridden, and the Course Total is overridden.
          Hide
          Jason Bennett added a comment -

          We are having the same problem on Moodle 2.4.5, but only sporadically. One instructor has reported this a couple times this semester. She has assignments and grade items in her gradebook and only enters grades in the gradebook, never from the assignments interface. She finds category and course totals having been overriden. She also confirms that she never works with Moodle open in two windows so that scenario doesn't seem to be in play here.

          I have been able to replicate the multiple windows scenario like this:
          I have the same gradebook open in two windows. I change a grade in one window and save my changes. Then I go to the other window, which now has out of date information, and hit save with (or without) changing anything and the category and course total gets overriden.

          That's kind of understandable, as was noted above, but I myself may have done this inadvertently yesterday while helping an instructor understand how the gradebook works. I noticed overrides on a category in which I just graded an assignment and the course total. I did have multiple windows open so I could imagine I switched to the wrong (duplicate) tab and made a change that locked things up.

          Show
          Jason Bennett added a comment - We are having the same problem on Moodle 2.4.5, but only sporadically. One instructor has reported this a couple times this semester. She has assignments and grade items in her gradebook and only enters grades in the gradebook, never from the assignments interface. She finds category and course totals having been overriden. She also confirms that she never works with Moodle open in two windows so that scenario doesn't seem to be in play here. I have been able to replicate the multiple windows scenario like this: I have the same gradebook open in two windows. I change a grade in one window and save my changes. Then I go to the other window, which now has out of date information, and hit save with (or without) changing anything and the category and course total gets overriden. That's kind of understandable, as was noted above, but I myself may have done this inadvertently yesterday while helping an instructor understand how the gradebook works. I noticed overrides on a category in which I just graded an assignment and the course total. I did have multiple windows open so I could imagine I switched to the wrong (duplicate) tab and made a change that locked things up.
          Hide
          Gloria Doherty added a comment -

          We can consistently replicate the problem. In 2.5.4. we created a new course site with no categories. While a Teacher was editing in the grader report a Student submitted a quiz. The override occurred in the Course Total.

          Show
          Gloria Doherty added a comment - We can consistently replicate the problem. In 2.5.4. we created a new course site with no categories. While a Teacher was editing in the grader report a Student submitted a quiz. The override occurred in the Course Total.
          Hide
          Eric Merrill added a comment -

          I've reworded this ticket to make it clear what we now know. I'm going to try an work on this some in the next week or so and see if we can get somewhere with solving this.

          Show
          Eric Merrill added a comment - I've reworded this ticket to make it clear what we now know. I'm going to try an work on this some in the next week or so and see if we can get somewhere with solving this.
          Hide
          Tonia Malone added a comment -

          Each quarter we have many faculty who report having grade columns overriden and having no idea how it happened. Courses with 100 +/- students can be overwhelming to clear each override one-by-one.

          If it is not possible to fix this error quickly, could it be possible to create a tool that would allow either an Admin or Editing Instructor to clear a whole column's overrides at once? Allowing all overrides in a column to be cleared would appease the concerned faculty until the bug can be fixed.

          Tonia (Cal Poly, SLO, Moodle 2.5)

          Show
          Tonia Malone added a comment - Each quarter we have many faculty who report having grade columns overriden and having no idea how it happened. Courses with 100 +/- students can be overwhelming to clear each override one-by-one. If it is not possible to fix this error quickly, could it be possible to create a tool that would allow either an Admin or Editing Instructor to clear a whole column's overrides at once? Allowing all overrides in a column to be cleared would appease the concerned faculty until the bug can be fixed. Tonia (Cal Poly, SLO, Moodle 2.5)

            People

            • Votes:
              27 Vote for this issue
              Watchers:
              22 Start watching this issue

              Dates

              • Created:
                Updated: