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

Grade-to-pass bug when an activity has a grade AND an outcome

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9.3, 3.0.1
    • Fix Version/s: 2.9.4, 3.0.2
    • Component/s: Gradebook
    • Labels:
    • Testing Instructions:
      Hide
      1. Enable outcomes on your site by visiting 'Site administration' > 'Advanced features'.
      2. Create a course.
      3. Create an assignment.
      4. Visit 'Course administration' > 'Outcomes'.
      5. Click on 'Edit outcomes' then 'Add a new outcome'.
      6. Fill in the required fields and save.
      7. Go back to the course page.
      8. Click on 'Course administration' > 'Grades'.
      9. Click on 'Grade administration' > 'Setup' > 'Gradebook setup' (called 'Categories and items' in 2.9).
      10. Click on 'Add outcome item'.
      11. Fill in the required fields and link it to the assignment you created earlier and save.
      12. Check that the order of the outcome is below the assignment.
      13. Go back to the course page.
      14. Edit the assignment and set the 'Grade to pass' value to '10' and save.
      15. Re-edit the assignment and confirm that this value is displayed correctly.
      16. Click on 'Course administration' > 'Grades'.
      17. Click on 'Grade administration' > 'Setup' > 'Gradebook setup' (called 'Categories and items' in 2.9).
      18. Click 'Edit settings' next to the assignment.
      19. Check that the 'Grade to pass' is '10'.
      Show
      Enable outcomes on your site by visiting 'Site administration' > 'Advanced features'. Create a course. Create an assignment. Visit 'Course administration' > 'Outcomes'. Click on 'Edit outcomes' then 'Add a new outcome'. Fill in the required fields and save. Go back to the course page. Click on 'Course administration' > 'Grades'. Click on 'Grade administration' > 'Setup' > 'Gradebook setup' (called 'Categories and items' in 2.9). Click on 'Add outcome item'. Fill in the required fields and link it to the assignment you created earlier and save. Check that the order of the outcome is below the assignment. Go back to the course page. Edit the assignment and set the 'Grade to pass' value to '10' and save. Re-edit the assignment and confirm that this value is displayed correctly. Click on 'Course administration' > 'Grades'. Click on 'Grade administration' > 'Setup' > 'Gradebook setup' (called 'Categories and items' in 2.9). Click 'Edit settings' next to the assignment. Check that the 'Grade to pass' is '10'.
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-52275_master

      Description

      When an activity has an outcome attached it has (at least) 2 gradeitems both having the same iteminstance.
      In course/modedit.php it will however set the $data->gradepass to whichever gradeitem comes last in foreach ($items as $item) on line #190. When trying to set the gradepass from the activity settings it will show a passing grade of 0,00 even though in the gradebook it was set to an actual grade.
      The foreach loop should not iterate both gradeitems and then only set $data->gradepass tro the last. I think this should resolve it (line #192)

      if (!empty($item->outcomeid)) {
          $data->{'outcome_'.$item->outcomeid} = 1;
      } else if (!empty($item->gradepass)) {
          $decimalpoints = $item->get_decimals();
          $data->gradepass = format_float($item->gradepass, $decimalpoints);
      }
      

      instead of:

      if (!empty($item->gradepass)) {
          $decimalpoints = $item->get_decimals();
          $data->gradepass = format_float($item->gradepass, $decimalpoints);
      }
      if (!empty($item->outcomeid)) {
          $data->{'outcome_'.$item->outcomeid} = 1;
      }
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Jan/16