Moodle
  1. Moodle
  2. MDL-35411

Imported/Restored assignments have no submission/feedback plugins enabled/settings lost

    Details

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

      You need two courses (A and B), B needs to have at least one student.

      1. In course A, create an assignment with default settings.
      2. In course B, select import. Find course A and import only the create assignment.
      3. Become one of the students in course B and enter the assignment. You should see "Nothing has been submitted for this assignment" and a Add Submission button.
      Show
      You need two courses (A and B), B needs to have at least one student. In course A, create an assignment with default settings. In course B, select import. Find course A and import only the create assignment. Become one of the students in course B and enter the assignment. You should see "Nothing has been submitted for this assignment" and a Add Submission button.
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
    • Rank:
      44090

      Description

      If you take a assignment and import (or restore it) in into a new course, students cannot submit to it. After more research, mdl_assign_plugin_config is not populated, meaning no submission/feedback plugins are enabled, and will reset to defaults once the assign is edited and saved.

      To reproduce:
      You need two courses (A and B), B needs to have at least one student.

      1. In course A, create an assignment with default settings.
      2. In course B, select import. Find course A and import only the create assignment.
      3. Become one of the students in course B and enter the assignment. You will see "This assignment does not require you to submit anything online"
      4. Become an admin or teach in B again.
      5. Edit the imported assignment, make no changes, but go down to the bottom and click Save.
      6. Become one of the students in course B and enter the assignment. You will be able to submit.

      Note that the settings are not preserved at all, all of the lost settings are reset to their defaults, regardless of what was set.

        Activity

        Hide
        Michael de Raadt added a comment -

        Thanks for reporting that.

        Show
        Michael de Raadt added a comment - Thanks for reporting that.
        Hide
        Eric Merrill added a comment -

        I discovered that the settings are actually completely lost during the process. Because of this I have raised the priority of this to a blocker and updated the description.

        Show
        Eric Merrill added a comment - I discovered that the settings are actually completely lost during the process. Because of this I have raised the priority of this to a blocker and updated the description.
        Hide
        Eric Merrill added a comment -

        Adding more - after dissecting a backup file, it appears that this data is not included in the backups at all.

        Show
        Eric Merrill added a comment - Adding more - after dissecting a backup file, it appears that this data is not included in the backups at all.
        Hide
        Eric Merrill added a comment -

        Turns out the problem is that the assign_plugin_config structure was only included in backups if include user info was set. I've moved that particular segment out of the if statement to always be included along with the basic assign structure.

        Damyon - could you please have a look at this.

        Show
        Eric Merrill added a comment - Turns out the problem is that the assign_plugin_config structure was only included in backups if include user info was set. I've moved that particular segment out of the if statement to always be included along with the basic assign structure. Damyon - could you please have a look at this.
        Hide
        Damyon Wiese added a comment -

        Thanks for the patch Eric, taking a look now

        Show
        Damyon Wiese added a comment - Thanks for the patch Eric, taking a look now
        Hide
        Damyon Wiese added a comment -

        This looks like the correct fix to me and the patch is fine.

        Show
        Damyon Wiese added a comment - This looks like the correct fix to me and the patch is fine.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

        TIA and ciao

        Show
        Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
        Hide
        Dan Poltawski added a comment -

        Integrated to 2.3 & master, thanks guys.

        Show
        Dan Poltawski added a comment - Integrated to 2.3 & master, thanks guys.
        Hide
        David Monllaó added a comment -

        It passes, I've been able to reproduce the problem reverting the patch and check that the patch solves the problem

        Tested in master

        Show
        David Monllaó added a comment - It passes, I've been able to reproduce the problem reverting the patch and check that the patch solves the problem Tested in master
        Hide
        Dan Poltawski added a comment -

        Congratulations, you've done it!

        Thanks, this change is now in the latest weekly release!

        Join the crowds of people tomorrow from 8am and download this Moodle release from your local apple store!

        Show
        Dan Poltawski added a comment - Congratulations, you've done it! Thanks, this change is now in the latest weekly release! Join the crowds of people tomorrow from 8am and download this Moodle release from your local apple store!
        Hide
        Richard van Iwaarden added a comment -

        We have about 400 assignments with this problem. We are currently running Moodle 2.4.1+ (Build: 20130214).

        Is there a way we can restore this in one go? Perhaps some database/sql statement?

        Show
        Richard van Iwaarden added a comment - We have about 400 assignments with this problem. We are currently running Moodle 2.4.1+ (Build: 20130214). Is there a way we can restore this in one go? Perhaps some database/sql statement?

          People

          • Votes:
            15 Vote for this issue
            Watchers:
            12 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: