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

Allow assignment subplugins to back up configuration-related files

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.2
    • Component/s: Assignment
    • Labels:
    • Testing Instructions:
      Hide

      Prerequisites:

      • Two courses, called C1 and C2.
      • Additional plugin "assignfeedback_solutionsheet" installed, as attached to this ticket. Unzip "solutionsheet.zip" into mod/assign/feedback within your Moodle installation. Log in to Moodle as administrator, navigate to admin/index.php and follow the process to install the plugin.
      • a PDF file (or other local file) for testing, content does not matter.

      Test script:

      • Log in as admin and navigate to C1.
      • Create an assignment activity. Choose the following settings in section "Feedback types" :
        • Tick the box "Solution sheets"
        • Upload the PDF file into the field "Upload solution sheet".
      • Click "Save and display".
      • Click "Assignment administration -> Backup" and perform the backup. (Click "Jump to final step", then "Continue".)
      • Download the resulting .mbz file to your local computer and open it. (This may need renaming it to .tgz first.)
      • VERIFY: The .mbz archive contains a folder "files" with exactly one file in it (in a subfolder).
      • Navigate to C2.
      • Click Course administration -> Restore.
      • Under "Import a backup file", upload the .mbz file from earlier, and click "Restore".
      • Follow the process to restore the assignment. Choose C2 as the course to restore into.
      • VERIFY: Assignment is now visible in C2.
      • Open the assignment in C2.
      • VERIFY: One file name is displayed under the "Solution sheet" heading.
      • Click on the file name.
      • VERIFY: File opens / downloads OK.

      Also, run acceptance tests for mod_assign.

      Show
      Prerequisites: Two courses, called C1 and C2. Additional plugin "assignfeedback_solutionsheet" installed, as attached to this ticket. Unzip "solutionsheet.zip" into mod/assign/feedback within your Moodle installation. Log in to Moodle as administrator, navigate to admin/index.php and follow the process to install the plugin. a PDF file (or other local file) for testing, content does not matter. Test script: Log in as admin and navigate to C1. Create an assignment activity. Choose the following settings in section "Feedback types" : Tick the box "Solution sheets" Upload the PDF file into the field "Upload solution sheet". Click "Save and display". Click "Assignment administration -> Backup" and perform the backup. (Click "Jump to final step", then "Continue".) Download the resulting .mbz file to your local computer and open it. (This may need renaming it to .tgz first.) VERIFY: The .mbz archive contains a folder "files" with exactly one file in it (in a subfolder). Navigate to C2. Click Course administration -> Restore. Under "Import a backup file", upload the .mbz file from earlier, and click "Restore". Follow the process to restore the assignment. Choose C2 as the course to restore into. VERIFY: Assignment is now visible in C2. Open the assignment in C2. VERIFY: One file name is displayed under the "Solution sheet" heading. Click on the file name. VERIFY: File opens / downloads OK. Also, run acceptance tests for mod_assign.
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      This issue is about the backup/restore procedures for assignment subplugins ("submission" or "feedback" type).

      These subplugins are included in the Moodle backup system in the usual way (with code in backup/moodle2). However, this applies to user-related data only. Configuration data is stored in a separate table (assign_plugin_config) instead, and backed up and restored from there.

      This creates a problem if the plugin wants to attach files to its configuration data (e.g., via an upload field). These cannot be backed up properly, since the subplugin backup code is run only if user data is included.

      For more details of the use case: https://moodle.org/mod/forum/discuss.php?d=276881

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                5/Dec/16