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

Workshop: Allow teacher to specify submission types

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Upgrade testing

      1. Before applying the patch, create a new workshop called "With files", and all other settings left as default.
      2. Create a second workshop called "Without files", and Maximum number of submission attachments set to 0.
      3. Create a backup containing the two workshops.
      4. Apply the patch and run the upgrade script.
      5. View the Edit settings form for "With Files".
        • Online text should be checked and have Required unchecked.
        • File attachment should be checked and have Required unchecked.
      6. View the Edit settings form for "Without Files"
        • Online text should be checked and have Required checked. (This is changed from the default as at least 1 submission type must be required).
        • File attachment should neither be checked nor have Required checked.
        • Maximum number of submission attachments should be disabled and have 1 as the default value, Submission attachment allowed file types and
          Maximum submission attachment size should also be disabled.
      7. Restore the backup to a new course and check the settings forms for the workshops
        • The settings should be as described for 5. and 6.

      Workshop settings form testing

      1. Create a new workshop called "Test workshop"
      2. Under the Submission types heading, uncheck the Online text checkbox.
        • The Required checkbox for Online text should be empty and disabled.
        • The Required checkbox for File attachment should be checked and disabled.
      3. Check the Online text checkbox and uncheck the File attachment checkbox.
        • The Required checkbox for Online text should be checked and disabled.
        • The Required checkbox for File attachment should be empty and disabled.
      4. Uncheck both of the Online text and File attachment checkboxes and submit the form.
        • The error message "At least one submission type must be available" should be displayed.
      5. Check the File attachment checkbox.
        • The Maximum number of submission attachments, Submission attachment allowed file types and Maximum submission attachment size fields should be enabled.
      6. Uncheck the File attachment checkbox.
        • The Maximum number of submission attachments, Submission attachment allowed file types and Maximum submission attachment size fields should be disabled.
      7. Check all 4 checkboxes and submit the form
        • The form should submit successfully.  Other valid combinations are covered in the next section.

      Submission form testing

      1. Create 5 workshop activities with the following settings:
        1. "Both required": All submission type checkboxes checked
        2. "Optional text": Uncheck the Required checkbox for Online text
        3. "Optional file": Uncheck the Required checkbox for File attachment
        4. "No text": Uncheck the Online text checkbox
        5. "No file": Uncheck the File attachment checkbox
        6. "Either required": Check the Online text and File attachment checkboxes, but neither Required checkboxes (default)
      2. Navigate into each workshop and follow "Switch to the submission phase", then click "Start preparing my submission"
        1. For the "Both required" workshop, you should see both Submission content and Attachment fields with Required indicators.  You should not be able to submit the form without both completed.
        2. For the "Optional text" workshop, you should see both fields, with a Required indicator next to the Attachment field.  You should be able to submit the form with no text, but not without a file.
        3. For the "Optional file" workshop, you should see both inputs, with a Required indicator next to the Submission content field.  You should be able to submit the form with no file, but not without text.
        4. For the "No text" workshop, you should see only the Attachment field, with a Required indicator.  You should not be able to submit the form without uploading a file.
        5. For the "No file" workshop, you should see only the Submission content field, with a Required indicator.  You should not be able to submit the form without entering text.
        6. For the "Either required" workshop, you should see both fields, with no Required indicator on either. If you try to submit the form with no text or file entered, an error message should be displayed for both fields. If you submit either text or a file (or both), you should be able to submit the form successfully.

       

      Show
      Upgrade testing Before applying the patch, create a new workshop called "With files", and all other settings left as default. Create a second workshop called "Without files", and Maximum number of submission attachments set to 0 . Create a backup containing the two workshops. Apply the patch and run the upgrade script. View the Edit settings form for "With Files". Online text should be checked and have Required unchecked. File attachment should be checked and have Required unchecked. View the Edit settings form for "Without Files" Online text should be checked and have Required checked. (This is changed from the default as at least 1 submission type must be required). File attachment should neither be checked nor have Required checked. Maximum number of submission attachments should be disabled and have 1 as the default value, Submission attachment allowed file types and Maximum submission attachment size should also be disabled. Restore the backup to a new course and check the settings forms for the workshops The settings should be as described for 5. and 6. Workshop settings form testing Create a new workshop called "Test workshop" Under the Submission types heading, uncheck the Online text checkbox. The Required checkbox for Online text should be empty and disabled. The Required checkbox for File attachment should be checked and disabled. Check the Online text checkbox and uncheck the File attachment checkbox. The Required checkbox for Online text should be checked and disabled. The Required checkbox for File attachment should be empty and disabled. Uncheck both of the Online text and File attachment checkboxes and submit the form. The error message "At least one submission type must be available" should be displayed. Check the File attachment checkbox. The Maximum number of submission attachments , Submission attachment allowed file types and Maximum submission attachment size fields should be enabled. Uncheck the File attachment checkbox. The Maximum number of submission attachments , Submission attachment allowed file types and Maximum submission attachment size fields should be disabled. Check all 4 checkboxes and submit the form The form should submit successfully.  Other valid combinations are covered in the next section. Submission form testing Create 5 workshop activities with the following settings: "Both required": All submission type checkboxes checked "Optional text": Uncheck the Required checkbox for Online text "Optional file": Uncheck the Required checkbox for File attachment "No text": Uncheck the Online text checkbox "No file": Uncheck the File attachment checkbox "Either required": Check the Online text and File attachment checkboxes, but neither Required checkboxes (default) Navigate into each workshop and follow "Switch to the submission phase", then click "Start preparing my submission" For the "Both required" workshop, you should see both Submission content and Attachment fields with Required indicators.  You should not be able to submit the form without both completed. For the "Optional text" workshop, you should see both fields, with a Required indicator next to the Attachment field.  You should be able to submit the form with no text, but not without a file. For the "Optional file" workshop, you should see both inputs, with a Required indicator next to the Submission content field.  You should be able to submit the form with no file, but not without text. For the "No text" workshop, you should see only the Attachment field, with a Required indicator.  You should not be able to submit the form without uploading a file. For the "No file" workshop, you should see only the Submission content field, with a Required indicator.  You should not be able to submit the form without entering text. For the "Either required" workshop, you should see both fields, with no Required indicator on either. If you try to submit the form with no text or file entered, an error message should be displayed for both fields. If you submit either text or a file (or both), you should be able to submit the form successfully.  
    • Affected Branches:
      MOODLE_34_STABLE, MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-60820-master-workshopsubmissiontypes

      Description

      Currently, the Workshop allows a teacher to specify a number of file attachments allowed, including 0.  If file attachments are allowed, the student's submission form contains a "Submission content" editor field, and an "Attachment" file manager field.  Neither of these fields are marked as required, but if a student doesn't enter data in either, they see a message that either one of the fields is required.  A student may submit the form with just some text, even if the task requires a file to be uploaded, or vice versa.  We have had feedback from our staff that students have been making this mistake.

      The proposed fix:

      • On the submissions settings form;
        • Add a new field to the “Submission settings” section called “Type of materials accepted”.
        • This has the options “Attachment only”, “Submission text area only”, and “Attachment and submission text area” (it could be a Select or Radio buttons).
        • The default option is “Attachment and submission text area”.
        • If “Submission text area only” is selected, all of the fields relating to file attachments are disabled.
        • Remove the “0” option from the number of file attachments.
      • On the Submission form itself;
        • Only display the text field if “Submission text area only” or “Attachment and submission text area” was selected. 
        • Only display the file attachment field if “Attachment only” or “Attachment and submission text area” was selected.
        • If displayed, each of these fields is marked Required using the standard moodleform method.  The current validation to check one of them is set is removed from the validation() method.

       

       

        Attachments

        1. form-themes.png
          form-themes.png
          23 kB
        2. screenshot-1.png
          screenshot-1.png
          36 kB
        3. screenshot-2.png
          screenshot-2.png
          15 kB
        4. Verified MDL-60820.xlsx
          284 kB

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  3/Dec/18

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 30 minutes
                  1h 30m