Moodle
  1. Moodle
  2. MDL-26445

quiz unit penalty doesn't work with 'penalty based on response grade' option.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.0.3
    • Component/s: Quiz
    • Labels:
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      16156

      Description

      This was discovered while testing PULL-270

      replicate test:
      "When you create a numerical question in the quiz, there are some options about how the correctness of the unit alters the score.

      You need to create two test questions with each value of this settings, and then verify that they behave the way the setting says when you preview them."

      problem seen:

      testing fine for the penalty based on question grade:
      Marks for this submission: 90.00/100.00. These marks include a penalty of 0.10 for bad unit. This submission attracted a penalty of 10.00.

      penalties based on answer grade can't be seen to taking effect. the answers themselves aren't being given any grade except 0.
      i get: "Incorrect
      Marks for this submission: 0.00/100.00. These marks include a penalty of 10.00 for bad unit. This submission attracted a penalty of 10.00."
      for an answer grade worth 90%.

      please see attached

        Activity

        Hide
        Tim Hunt added a comment -

        Reassigning to Pierre for now, since he knows this code better than me.

        Show
        Tim Hunt added a comment - Reassigning to Pierre for now, since he knows this code better than me.
        Hide
        Pierre Pichet added a comment -

        I cannot reproduce.
        Could you attach the numerical/questiontype.php and the numerical/edit_numercial_form.php so I can see if the code is identical.

        Show
        Pierre Pichet added a comment - I cannot reproduce. Could you attach the numerical/questiontype.php and the numerical/edit_numercial_form.php so I can see if the code is identical.
        Hide
        Pierre Pichet added a comment -

        After some testing I can reproduce your results.
        More news later

        Show
        Pierre Pichet added a comment - After some testing I can reproduce your results. More news later
        Hide
        Pierre Pichet added a comment -

        Some time later, the problem and its solution are found.
        more testings tonight and a new commit should be issue tomorrow.

        I did some of my tests using the default 1 value for question grade and a confusion was created in the code between $question->maxgrade (100 in Aparup tests) and the rawgrade maximun which is 1.

        I will also optimize the grading display.

        Show
        Pierre Pichet added a comment - Some time later, the problem and its solution are found. more testings tonight and a new commit should be issue tomorrow. I did some of my tests using the default 1 value for question grade and a confusion was created in the code between $question->maxgrade (100 in Aparup tests) and the rawgrade maximun which is 1. I will also optimize the grading display.
        Hide
        Pierre Pichet added a comment -

        This should solve the problem and display correctly the unit penalty .
        https://github.com/ppichet/moodle/commit/1c6cae290c3a1020c0d9d5b22f44d275fc123e2e

        Show
        Pierre Pichet added a comment - This should solve the problem and display correctly the unit penalty . https://github.com/ppichet/moodle/commit/1c6cae290c3a1020c0d9d5b22f44d275fc123e2e
        Hide
        Pierre Pichet added a comment -

        The 1,9 grade was 90 to which a 10% of 90 i.e 9 unit penalty was applied and an additional 10 (0.1) standard penalty for a non perfect response was applied to a final 81/100 grade

        Show
        Pierre Pichet added a comment - The 1,9 grade was 90 to which a 10% of 90 i.e 9 unit penalty was applied and an additional 10 (0.1) standard penalty for a non perfect response was applied to a final 81/100 grade
        Hide
        Pierre Pichet added a comment -

        The additional attachment shows one of the test done.
        Thanks Tim.

        Show
        Pierre Pichet added a comment - The additional attachment shows one of the test done. Thanks Tim.
        Hide
        Aparup Banerjee added a comment -

        Thanks Pierre! (btw , the test was done on checkout from git://git.moodle.org/integration.git but anyway glad you've squashed this one!)

        Show
        Aparup Banerjee added a comment - Thanks Pierre! (btw , the test was done on checkout from git://git.moodle.org/integration.git but anyway glad you've squashed this one!)
        Hide
        Tim Hunt added a comment -

        Note that I rebased Pierre's fix (linked to above) onto the latest master before creating the PULL request in order to make things easier for the reviewers. There were no merge conflicts.

        There should be sufficient information about how to test in the information above.

        Thanks for fixing this Pierre. Sorry it took me so long to get around to reviewing it.

        Show
        Tim Hunt added a comment - Note that I rebased Pierre's fix (linked to above) onto the latest master before creating the PULL request in order to make things easier for the reviewers. There were no merge conflicts. There should be sufficient information about how to test in the information above. Thanks for fixing this Pierre. Sorry it took me so long to get around to reviewing it.
        Hide
        Helen Foster added a comment -

        This issue is fixed in the latest 2.0.2+. Thanks Pierre and Tim.

        Show
        Helen Foster added a comment - This issue is fixed in the latest 2.0.2+. Thanks Pierre and Tim.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: