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

grade_get_course_grades() on a new course

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • 3.11.10
    • Grading methods
    • MOODLE_311_STABLE

      When the grade_get_course_grades() function is called on a newly created course that has students but no activity, the function calls grade_regrade_final_grades($courseid); to initialize the grade item but does not store the initialized object and returns a badly constructed one instead
       
      Exemples : 

      • Return value without storing the constructed object from grade_regrade_final_grades($courseid);
         
                    

        object(stdClass)#175 (8) {
          ["scaleid"]=>
          int(0)
          ["name"]=>
          string(14) "Total du cours" 
          ["grademin"]=>
          string(7) "0.00000" 
          ["grademax"]=>
          string(9) "100.00000" 
          ["gradepass"]=>
          string(7) "0.00000" 
          ["locked"]=>
          bool(false)
          ["hidden"]=>
          bool(false)
          ["grades"]=>
          array(1) {
            [4]=>
            object(stdClass)#174 (12) {
              ["grade"]=>
              bool(false)
              ["locked"]=>
              bool(false)
              ["hidden"]=>
              bool(false)
              ["overridden"]=>
              int(0)
              ["feedback"]=>
              NULL
              ["feedbackformat"]=>
              int(0)
              ["usermodified"]=>
              NULL
              ["dategraded"]=>
              NULL
              ["datesubmitted"]=>
              NULL
              ["str_grade"]=>
              string(6) "Erreur" 
              ["str_long_grade"]=>
              string(6) "Erreur" 
              ["str_feedback"]=>
              string(0) "" 
            }
          }
        }

      • Return value with the correctly built object : 

        object(stdClass)#176 (8) {
          ["scaleid"]=>
          int(0)
          ["name"]=>
          string(14) "Total du cours" 
          ["grademin"]=>
          string(7) "0.00000" 
          ["grademax"]=>
          string(7) "0.00000" 
          ["gradepass"]=>
          string(7) "0.00000" 
          ["locked"]=>
          bool(false)
          ["hidden"]=>
          bool(false)
          ["grades"]=>
          array(1) {
            [4]=>
            object(stdClass)#467 (12) {
              ["grade"]=>
              NULL
              ["locked"]=>
              bool(false)
              ["hidden"]=>
              bool(false)
              ["overridden"]=>
              int(0)
              ["feedback"]=>
              NULL
              ["feedbackformat"]=>
              int(0)
              ["usermodified"]=>
              NULL
              ["dategraded"]=>
              NULL
              ["datesubmitted"]=>
              NULL
              ["str_grade"]=>
              string(1) "-" 
              ["str_long_grade"]=>
              string(1) "-" 
              ["str_feedback"]=>
              string(0) "" 
            }
          }
        }

            Unassigned Unassigned
            RDelvaux RDelvaux
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.