Moodle
  1. Moodle
  2. MDL-36679

Cannot revert to draft in Assignment 2.4

    Details

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

      1. Create an assignment as a teacher and require students to click submit button
      2. As a student, submit an assignment
      3. As a teacher, go to the grading screen. The submission status column for the student will show "submitted for grading"
      4. Click the Edit column and click "revert to draft".
      5. The submission status column for the student should change to "Draft (not submitted)"

      Show
      1. Create an assignment as a teacher and require students to click submit button 2. As a student, submit an assignment 3. As a teacher, go to the grading screen. The submission status column for the student will show "submitted for grading" 4. Click the Edit column and click "revert to draft". 5. The submission status column for the student should change to "Draft (not submitted)"
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull from Repository:
      git@github.com:damyon/moodle.git
    • Pull Master Branch:
      MDL-36679-master
    • Rank:
      46180

      Description

      While testing 2.4 assignments on my local host and also the QA Moodle, I have been unable to get the "revert to draft" feature to work. I saw a related issue http://tracker.moodle.org/browse/MDL-36064 had been fixed but I have not been able to get it working so I am creating a new issue.
      Steps to reproduce:
      1. Create an assignment as a teacher and require students to click submit button
      2. As a student, submit an assignment
      3. As a teacher, go to the grading screen. You will see "submitted for grading"
      4. Click the Edit column and click "revert to draft". It will not change
      5. Select the student and in the dropdown under the student list, choose "with selected...revert to draft status" It still shows "submitted for grading".

        Issue Links

          Activity

          Hide
          Mary Cooch added a comment -

          Copying this post from Al Rachels on the forum thread linked to above:

          As part of my testing of this, I just now happened to do it in one class where I have just one student and one teacher enrolled and got an error. On my site it includes a bunch of stack info. At qa.moodle.net it is repeatable but only gives the same first line as I get here at home: Notice: Undefined variable: type in /html/lib/pear/HTML/QuickForm/group.php on line 277

          If I add just one more student on my 2.4 site or the test site, the error goes away. Repeatable with any of the three grading methods selected, rubric, marking guide, or simple direct.

          Show
          Mary Cooch added a comment - Copying this post from Al Rachels on the forum thread linked to above: As part of my testing of this, I just now happened to do it in one class where I have just one student and one teacher enrolled and got an error. On my site it includes a bunch of stack info. At qa.moodle.net it is repeatable but only gives the same first line as I get here at home: Notice: Undefined variable: type in /html/lib/pear/HTML/QuickForm/group.php on line 277 If I add just one more student on my 2.4 site or the test site, the error goes away. Repeatable with any of the three grading methods selected, rubric, marking guide, or simple direct.
          Hide
          Michael Dikih added a comment -

          I came across this issue as well. I think it is due to:

          File: mod/assign/locallib.php 
          Function: process_revert_to_draft
          Line 4002: $this->update_submission($submission, $USER->id, true, $this->get_instance()->teamsubmission);
          

          Update_submission is receiving the currently logged in user and not the selected user. So when it searches for the assignment to update it is against the wrong user. The update_submission should be receiving $userid instead.

          I can create a branch/commit for this if you would like?

          Show
          Michael Dikih added a comment - I came across this issue as well. I think it is due to: File: mod/assign/locallib.php Function: process_revert_to_draft Line 4002: $this->update_submission($submission, $USER->id, true, $this->get_instance()->teamsubmission); Update_submission is receiving the currently logged in user and not the selected user. So when it searches for the assignment to update it is against the wrong user. The update_submission should be receiving $userid instead. I can create a branch/commit for this if you would like?
          Hide
          Damyon Wiese added a comment -

          Hi Mary,

          The issue you mentioned in the comment has been reported and a fix is available in MDL-36655.

          Show
          Damyon Wiese added a comment - Hi Mary, The issue you mentioned in the comment has been reported and a fix is available in MDL-36655 .
          Hide
          Damyon Wiese added a comment -

          Thanks Michael, - I had a look and this is a regression caused by MDL-36064 - it's only on 2.4dev. I'll add a quick patch.

          Show
          Damyon Wiese added a comment - Thanks Michael, - I had a look and this is a regression caused by MDL-36064 - it's only on 2.4dev. I'll add a quick patch.
          Hide
          Dan Poltawski added a comment -

          Integrated, thanks Damyon.

          Show
          Dan Poltawski added a comment - Integrated, thanks Damyon.
          Hide
          Petr Škoda added a comment -

          works fine, thanks

          Show
          Petr Škoda added a comment - works fine, thanks
          Hide
          Dan Poltawski added a comment -

          Congratulations! Another bug solved.. only another 7330 to go, thanks for contributing to contributing to 0.8% of all bugs being fixed this week!

          ciao
          Dan

          Show
          Dan Poltawski added a comment - Congratulations! Another bug solved.. only another 7330 to go, thanks for contributing to contributing to 0.8% of all bugs being fixed this week! ciao Dan

            People

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

              Dates

              • Created:
                Updated:
                Resolved: