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

Comments chooser in marking guide emits php notice if there are no entries

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.4, 3.2.1, 3.3
    • Fix Version/s: 3.1.5, 3.2.2
    • Component/s: Grading methods
    • Labels:
    • Testing Instructions:
      Hide

      Ensure you have debugging mode at the developer level and display errors on (or watch the error log for your webserver).

      Then follow the steps from MDL-54056 - you should not see a php notice about $commentchooser not being set during any of it:

      1. Create an assignment.
      2. Set its grading method to Marking guide.
      3. Define the marking guide, but do not define any item for the frequently used comments.
      4. Save the marking guide and make it ready.
      5. Go back to the assignment and grade it.
      6. On the grading page, check the marking guide section.
        • Confirm that the Insert frequently used comment button is not being rendered below the criterion's comment text area.
        • Confirm that there are no JS errors or warnings in your console
      7. Edit the assignment's marking guide definition and define some comments and save the marking guide definition.
      8. Go back to the assignment's grading page and check the marking guide section.
        • Confirm that the Insert frequently used comment button is being rendered below the criterion's comment text area.
        • Confirm that there are no JS errors or warnings in your console
      9. Click on a criterion's Insert frequently used comment button.
        • Confirm that the Frequently used comments dialogue is being shown.
        • Confirm that the previously defined frequently used comments are listed in the dialogue.
      10. Click on a frequently-used comment.
        • Confirm that the dialogue closes and the selected comment is reflected in the comment text area of the chosen criterion.
      Show
      Ensure you have debugging mode at the developer level and display errors on (or watch the error log for your webserver). Then follow the steps from MDL-54056 - you should not see a php notice about $commentchooser not being set during any of it: Create an assignment. Set its grading method to Marking guide. Define the marking guide, but do not define any item for the frequently used comments. Save the marking guide and make it ready. Go back to the assignment and grade it. On the grading page, check the marking guide section. Confirm that the Insert frequently used comment button is not being rendered below the criterion's comment text area. Confirm that there are no JS errors or warnings in your console Edit the assignment's marking guide definition and define some comments and save the marking guide definition. Go back to the assignment's grading page and check the marking guide section. Confirm that the Insert frequently used comment button is being rendered below the criterion's comment text area. Confirm that there are no JS errors or warnings in your console Click on a criterion's Insert frequently used comment button. Confirm that the Frequently used comments dialogue is being shown. Confirm that the previously defined frequently used comments are listed in the dialogue. Click on a frequently-used comment. Confirm that the dialogue closes and the selected comment is reflected in the comment text area of the chosen criterion.
    • Affected Branches:
      MOODLE_31_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE, MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      MDL-54056 moved the initialisation of $commentschooser into an IF condition, whilst still using it outside of that IF conditions scope. As such, if there are no comments to choose from, the variable is never init'd but it still goes to use it, emitting a PHP notice.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Mar/17