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

Assignment: Error deleting reopened file submission

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 3.7.6, 3.8.3, 3.9, 3.10
    • Assignment
    • MOODLE_310_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • MDL-69033_master
    • 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.

      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.

            tschroeder Tim Schroeder
            tschroeder Tim Schroeder
            Jake Dallimore Jake Dallimore
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.