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

Reattempts not working with blind marking assignments

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.5
    • Component/s: Assignment
    • Labels:
    • Testing Instructions:
      Hide

      Test 1

      1. Create an assignment with "blind marking" enabled, "attempts reopened" set to "Manually" and file submissions enabled.
      2. Login as a student and add a submission
      3. Login as a teacher and add a grade for the student, allowing a reattempt.
      4. Login as a student and verify that the previous submission appears in the history.
      5. Add a new submission
      6. Login as a teacher and add a grade the student again, verify that the previous submission appears on the single grading page.

      Test 2

      1. Create an assignment with attempts reopened set to manually and file submissions enabled.
      2. Login as a student and add a submission
      3. Login as a teacher and grade the submission, allowing another attempt
      4. Verify on the grading table, the status is "Reopened" and the submission file for the first submission is listed in the table.
      5. Login as a student and add a different submission
      6. Login as a teacher and grade the submission, allowing another attempt
      7. Verify on the grading table, that the submission file for the second submission is listed in the table

      Test 3

      1. Repeat test 2 for a new assignment with "Students submit in teams" enabled.
      Show
      Test 1 Create an assignment with "blind marking" enabled, "attempts reopened" set to "Manually" and file submissions enabled. Login as a student and add a submission Login as a teacher and add a grade for the student, allowing a reattempt. Login as a student and verify that the previous submission appears in the history. Add a new submission Login as a teacher and add a grade the student again, verify that the previous submission appears on the single grading page. Test 2 Create an assignment with attempts reopened set to manually and file submissions enabled. Login as a student and add a submission Login as a teacher and grade the submission, allowing another attempt Verify on the grading table, the status is "Reopened" and the submission file for the first submission is listed in the table. Login as a student and add a different submission Login as a teacher and grade the submission, allowing another attempt Verify on the grading table, that the submission file for the second submission is listed in the table Test 3 Repeat test 2 for a new assignment with "Students submit in teams" enabled.
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-38973-master

      Description

      I found that past attempts were not appearing when blind marking was turned on in an assignment.

      Replication steps:

      1. Set up a new assignment
        • File submissions on
        • Attempts reopened set to Manually
        • Blind marking set to Yes
      2. Log in as a student and submit
      3. Log in as a teacher and grade the submission and allow a reattempt

      Expected result:

      • The previous attempt should appear for the student
      • The grade on the previous attempt should appear to the student
      • The previous attempt should appear for the teacher on the grading sheet

      Actual result: Negate the above

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            poltawski Dan Poltawski added a comment -

            Doh, i'd integrated this but not updated the status.

            Show
            poltawski Dan Poltawski added a comment - Doh, i'd integrated this but not updated the status.
            Hide
            poltawski Dan Poltawski added a comment -

            Mark, giving you this one, in return for taking MDL-38750 off you.

            Show
            poltawski Dan Poltawski added a comment - Mark, giving you this one, in return for taking MDL-38750 off you.
            Hide
            poltawski Dan Poltawski added a comment -

            Mark has tested it and says its working. Yay.

            Show
            poltawski Dan Poltawski added a comment - Mark has tested it and says its working. Yay.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Your awesome contributions are now part of Moodle, your fav LMS out there.

            Closing this as fixed.

            Many thanks for all the hard work, ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Your awesome contributions are now part of Moodle, your fav LMS out there. Closing this as fixed. Many thanks for all the hard work, ciao
            Hide
            danielneis Daniel Neis added a comment -

            Hello,

            this commit introduces a bug when you have a submission with status ASSIGN_SUBMISSION_STATUS_REOPENED and just one attempt.
            Here is the code that fails mod/assign/gradingtable.php:

             976                         if ($submission->status == ASSIGN_SUBMISSION_STATUS_REOPENED) {
             977                             // For a newly reopened submission - we want to show the previous submission in the table.
             978                             $this->get_group_and_submission($row->id, $group, $submission, $submission->attemptnumber-1);
             979                         }

            Here is the $row variable record that causes the bug:

            stdClass Object
            (
                [id] => 2267
                [picture] => 103145
                [firstname] => Foo bar
                [lastname] => (-----)
                [imagealt] => 
                [email] => mmmm@mmm.com
                [userid] => 2267
                [status] => reopened
                [submissionid] => 3877
                [firstsubmission] => 1379348815
                [timesubmitted] => 1379348815
                [attemptnumber] => 1
                [gradeid] => 2401
                [grade] => 
                [timemarked] => 1379348810
                [firstmarked] => 1379348810
                [mailed] => 1
                [locked] => 0
                [extensionduedate] => 0
            )

            Here is the obvius (but not exactly the best) fix:

            --- a/mod/assign/gradingtable.php
            +++ b/mod/assign/gradingtable.php
            @@ -988,7 +988,11 @@ class assign_grading_table extends table_sql implements renderable {
                             } else if ($row->submissionid) {
                                 if ($row->status == ASSIGN_SUBMISSION_STATUS_REOPENED) {
                                     // For a newly reopened submission - we want to show the previous submission in the table.
            -                        $submission = $this->assignment->get_user_submission($row->userid, false, $row->attemptnumber - 1);
            +                        if ($row->attemptnumber > 1) {
            +                            $submission = $this->assignment->get_user_submission($row->userid, false, $row->attemptnumber - 1)
            +                        } else {
            +                            $submission = $this->assignment->get_user_submission($row->userid, false, $row->attemptnumber);
            +                        }
                                 } else {
                                     $submission = new stdClass();
                                     $submission->id = $row->submissionid;
             

            Would appreciate very much if someone could take a look.

            Kind regards,
            Daniel

            Show
            danielneis Daniel Neis added a comment - Hello, this commit introduces a bug when you have a submission with status ASSIGN_SUBMISSION_STATUS_REOPENED and just one attempt. Here is the code that fails mod/assign/gradingtable.php: 976 if ($submission->status == ASSIGN_SUBMISSION_STATUS_REOPENED) { 977 // For a newly reopened submission - we want to show the previous submission in the table. 978 $this->get_group_and_submission($row->id, $group, $submission, $submission->attemptnumber-1); 979 } Here is the $row variable record that causes the bug: stdClass Object ( [id] => 2267 [picture] => 103145 [firstname] => Foo bar [lastname] => (-----) [imagealt] => [email] => mmmm@mmm.com [userid] => 2267 [status] => reopened [submissionid] => 3877 [firstsubmission] => 1379348815 [timesubmitted] => 1379348815 [attemptnumber] => 1 [gradeid] => 2401 [grade] => [timemarked] => 1379348810 [firstmarked] => 1379348810 [mailed] => 1 [locked] => 0 [extensionduedate] => 0 ) Here is the obvius (but not exactly the best) fix: --- a/mod/assign/gradingtable.php +++ b/mod/assign/gradingtable.php @@ -988,7 +988,11 @@ class assign_grading_table extends table_sql implements renderable { } else if ($row->submissionid) { if ($row->status == ASSIGN_SUBMISSION_STATUS_REOPENED) { // For a newly reopened submission - we want to show the previous submission in the table. - $submission = $this->assignment->get_user_submission($row->userid, false, $row->attemptnumber - 1); + if ($row->attemptnumber > 1) { + $submission = $this->assignment->get_user_submission($row->userid, false, $row->attemptnumber - 1) + } else { + $submission = $this->assignment->get_user_submission($row->userid, false, $row->attemptnumber); + } } else { $submission = new stdClass(); $submission->id = $row->submissionid;   Would appreciate very much if someone could take a look. Kind regards, Daniel
            Hide
            markn Mark Nelson added a comment -

            Hi Daniel,

            Thanks for investigating this.

            If you could create a separate issue to resolve this and link it here that would be very much appreciated.

            Regards,

            Mark

            Show
            markn Mark Nelson added a comment - Hi Daniel, Thanks for investigating this. If you could create a separate issue to resolve this and link it here that would be very much appreciated. Regards, Mark

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/May/13