Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-69033

Assignment: Error deleting reopened file submission

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.7.6, 3.8.3, 3.9, 4.0
    • Fix Version/s: None
    • Component/s: Assignment
    • Labels:
    • Testing Instructions:
      Hide
      1. As manager create an assignment with Submission types -> File submissions checked and Submission settings -> Attempts reopened set to Manually.
      2. As student A submit a file.
      3. As manager go to View all submissions.
      4. For student A click Edit -> Allow another attempt.
      5. For student A click Edit.
        ==> There should be no option called Remove submission.
      6. For student A check the Select checkbox in the leftmost column.
      7. Below the table in the "With selected ..." field select Remove submission.
      8. Click Start.
      9. Confirm.
        ==> No error message appears. The file submitted in the previous attempt is still displayed as student A's submission.
      Show
      As manager create an assignment with Submission types -> File submissions checked and Submission settings -> Attempts reopened set to Manually. As student A submit a file. As manager go to View all submissions. For student A click Edit -> Allow another attempt. For student A click Edit. ==> There should be no option called Remove submission. For student A check the Select checkbox in the leftmost column. Below the table in the "With selected ..." field select Remove submission. Click Start. Confirm. ==> No error message appears. The file submitted in the previous attempt is still displayed as student A's submission.
    • Affected Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE, MOODLE_40_STABLE
    • Pull 3.8 Branch:
    • Pull Master Branch:
      MDL-69033_master

      Description

      When the teacher tries to remove a file submission with status "Reopened" the following error is displayed:

      Coding error detected, it must be fixed by a programmer: moodle_database::update_record_raw() id field must be specified.

      That's because removing a submission always tries to remove the latest attempt's files. In this case the latest attempt has no files. There's also no entry in the table `assignsubmission_file` for the latest attempt. This is what's causing the error because Moodle does this with $submissionid being the latest attempt's ID from the table `assign_submission`:

      $currentsubmission = $DB->get_record('assignsubmission_file', array('submission'=>$submissionid));
      $currentsubmission->numfiles = 0;
      $DB->update_record('assignsubmission_file', $currentsubmission);

      Since the entry in `assignsubmission_file` is missing the $DB->get_record call returns false.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tschroeder Tim Schroeder
              Reporter:
              tschroeder Tim Schroeder
              Peer reviewer:
              Jake Dallimore
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 6 minutes
                  6m