Moodle
  1. Moodle
  2. MDL-14022

Moodle casts scale name into an integer number and may consider it as points

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.4
    • Fix Version/s: 1.8.6
    • Component/s: Gradebook
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE
    • Rank:
      30391

      Description

      Steps to reproduce
      ============

      0. create a new empty course
      1. create a new scale and name it e.g. "3 Nuts for Cinderella" (put an integer as a first part of the name)
      2. create two new assignments - let us call them A and B
      3. set maximum grade for the assignment A to 10 points
      4. set the scale "3 Nuts for Cinderella" as a grading method of the assignment B
      5. grade some submissions in both assignments
      4. go to the grade book and see the total number of points in the header

      What I expected to see
      ==============

      Total points is 10 - because of assignment A. Scale grades are displayed but do not influence the total points.

      What actually happened
      ===============

      Total points is 13. Assignment A has maximum grade 10 points. Assignment B is considered to have maximum grade 3 points. Even students with 10 points from assignment 10 and the best scale item from assignment B can not reach 100% of points; they still have only 10 points of 13.

      This happens always when the scale name may be casted into non-zero integer number.

        Activity

        Hide
        Anthony Borrow added a comment -

        David - Here is a patch that seems to address this issue. I've done some preliminary testing and I think it should help you out. The issue was that maxgrade was being used to store the name of the scale and if it contained a number it was being treated like a number. By adding an if statement to check that the value of the maxgrade string is in fact a number and not just contains one we should be able to differentiate enough to keep the total correct. If you could test it and let me know if this resolves the issue I will go ahead and commit it. Peace - Anthony

        Show
        Anthony Borrow added a comment - David - Here is a patch that seems to address this issue. I've done some preliminary testing and I think it should help you out. The issue was that maxgrade was being used to store the name of the scale and if it contained a number it was being treated like a number. By adding an if statement to check that the value of the maxgrade string is in fact a number and not just contains one we should be able to differentiate enough to keep the total correct. If you could test it and let me know if this resolves the issue I will go ahead and commit it. Peace - Anthony
        Hide
        Anthony Borrow added a comment -

        The commited patch checks to make sure that maxgrade is in fact a number (and not the name of a scale which begins with a number) before adding grade_against to totalpoints - initial testing looks good, but an extra set of more experienced eyes is always appreciated. Peace - Anthony

        Show
        Anthony Borrow added a comment - The commited patch checks to make sure that maxgrade is in fact a number (and not the name of a scale which begins with a number) before adding grade_against to totalpoints - initial testing looks good, but an extra set of more experienced eyes is always appreciated. Peace - Anthony
        Hide
        Anthony Borrow added a comment -

        Petr - I'm assigning you as QA just to verify that this is in no way an issue for 1.9. I am not sure what the anticipate behavior is in Moodle 1.9. If the expectation is that a scale grade is not to be considered into the grade then something is wrong with Moodle 1.9 gradebook. It looks like it takes the percentage of the grade so that if option 4 is chosen it calculates it as being 100%. Regardless, this is not exactly related to this issue as the behavior is independent of the scale name which was the issue with this bug. Let me know if you have questions or need anything. Peace - Anthony

        Show
        Anthony Borrow added a comment - Petr - I'm assigning you as QA just to verify that this is in no way an issue for 1.9. I am not sure what the anticipate behavior is in Moodle 1.9. If the expectation is that a scale grade is not to be considered into the grade then something is wrong with Moodle 1.9 gradebook. It looks like it takes the percentage of the grade so that if option 4 is chosen it calculates it as being 100%. Regardless, this is not exactly related to this issue as the behavior is independent of the scale name which was the issue with this bug. Let me know if you have questions or need anything. Peace - Anthony

          People

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

            Dates

            • Created:
              Updated:
              Resolved: