Moodle
  1. Moodle
  2. MDL-42494

Workshop throws coding exceptions if all assessments have zero weight

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.11, 2.3.9, 2.4.6, 2.5.2
    • Fix Version/s: 2.4.7, 2.5.3
    • Component/s: Workshop
    • Labels:
    • Testing Instructions:
      Hide

      Testing difficulty: EASY

      Testing environment: A course with a workshop and at least two students enrolled.

      1. Prepare a workshop with a simple assessment form of any strategy.
      2. Switch the workshop to the submission phase and let students submit their work.
      3. Allocate the submissions so that each submission is assessed by just one peer-reviewer.
      4. For at least one submission, set the assessment weight to zero for all allocated assessments (that means the only one in our case).
      5. Switch the workshop to the assessment phase and let students assess allocated submissions.
      6. Switch the workshop to the grading evaluation phase and make sure the grading evaluation method is set to the "Comparison with the best assessment". Click the "Re-calculate grades" button.
      7. TEST: Make sure no coding exception is thrown. The reviewer does not get any grade for their zero-weighted assessment.
      8. As a teacher, provide additional assessment for the submission beside the one with zero grade. Keep the weight of this teacher's assessment higher than zero. Re-calculate the grades again.
      9. TEST: The grading grade (grade for assessment) for the assessment with the zero weight should now be calculated (and will probably be very low or zero).
      Show
      Testing difficulty: EASY Testing environment: A course with a workshop and at least two students enrolled. Prepare a workshop with a simple assessment form of any strategy. Switch the workshop to the submission phase and let students submit their work. Allocate the submissions so that each submission is assessed by just one peer-reviewer. For at least one submission, set the assessment weight to zero for all allocated assessments (that means the only one in our case). Switch the workshop to the assessment phase and let students assess allocated submissions. Switch the workshop to the grading evaluation phase and make sure the grading evaluation method is set to the "Comparison with the best assessment". Click the "Re-calculate grades" button. TEST: Make sure no coding exception is thrown. The reviewer does not get any grade for their zero-weighted assessment. As a teacher, provide additional assessment for the submission beside the one with zero grade. Keep the weight of this teacher's assessment higher than zero. Re-calculate the grades again. TEST: The grading grade (grade for assessment) for the assessment with the zero weight should now be calculated (and will probably be very low or zero).
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull from Repository:
    • Pull 2.4 Branch:
      MDL-42494-workshop-exception_24
    • Pull 2.5 Branch:
      MDL-42494-workshop-exception_25
    • Pull Master Branch:
      MDL-42494-workshop-exception
    • Rank:
      54298

      Description

      When executed, the Workshop grading evaluation plugin "Comparison with the best assessment" throws coding exception

      Coding error detected, it must be fixed by a programmer: PHP catchable fatal error
      
      More information about this error
      Debug info: Argument 2 passed to workshop_best_evaluation::assessments_distance() must be an instance of stdClass, null given, called in [dirroot]/mod/workshop/eval/best/lib.php on line 175 and defined
      Error code: codingerror
      Stack trace:
      
          line 393 of /lib/setuplib.php: coding_exception thrown
          line 378 of /mod/workshop/eval/best/lib.php: call to default_error_handler()
          line 175 of /mod/workshop/eval/best/lib.php: call to workshop_best_evaluation->assessments_distance()
          line 100 of /mod/workshop/eval/best/lib.php: call to workshop_best_evaluation->process_assessments()
          line 54 of /mod/workshop/aggregate.php: call to workshop_best_evaluation->update_grading_grades()
      

      if all allocated assessments have zero weight.

      This has been kindly reported by Hiram Bollaert at https://moodle.org/mod/forum/discuss.php?d=242318

      Affects all Moodle 2.x versions.

        Activity

        Hide
        David Mudrak added a comment -

        Submitting for integration.

        DEAR INTEGRATORS, note there is no unit test for this attached. All individual steps and expected values are covered by existing unit tests though.

        Show
        David Mudrak added a comment - Submitting for integration. DEAR INTEGRATORS, note there is no unit test for this attached. All individual steps and expected values are covered by existing unit tests though.
        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 master, 25 and 24 - thanks David.

        Gentle reminder that we now ask that issues are sent for peer review before integration:
        http://docs.moodle.org/dev/Process#Submit_your_code_for_peer_review

        Show
        Dan Poltawski added a comment - Integrated to master, 25 and 24 - thanks David. Gentle reminder that we now ask that issues are sent for peer review before integration: http://docs.moodle.org/dev/Process#Submit_your_code_for_peer_review
        Hide
        Andrew Nicols added a comment -

        Tests all passed as expected.

        Thanks David.

        Show
        Andrew Nicols added a comment - Tests all passed as expected. Thanks David.
        Hide
        Damyon Wiese added a comment -

        Here lies 52 bugs.
        All fixed or swept under a rug.
        If they come back one day,
        To our dismay,
        We all will feel quite un-smug.

        Thanks for the reporting/fixing/testing on this issue. It has been sent upstream.

        Show
        Damyon Wiese added a comment - Here lies 52 bugs. All fixed or swept under a rug. If they come back one day, To our dismay, We all will feel quite un-smug. Thanks for the reporting/fixing/testing on this issue. It has been sent upstream.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: