Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403]

(no description)

File Size: 611 lines (25 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: grades_external_test  - X-Ref

Grades functions unit tests

Unit tests for the grade API at /lib/classes/grades_external.php

load_test_data($assignmentname, $student1rawgrade, $student2rawgrade)   X-Ref
Load initial test information

param: string $assignmentname   Assignment name
param: int $student1rawgrade    Student 1 grade
param: int $student2rawgrade    Student 2 grade
return: array                    Array of vars with test information

test_get_grades()   X-Ref
Test get_grades()


get_activity($grades, $cmid)   X-Ref
Get an activity

param: array $grades    Array of grades
param: int $cmid        Activity course module id
return: strdClass        Activity object

get_activity_student_grade($grades, $cmid, $studentid)   X-Ref
Get a grade for an activity

param: array $grades    Array of grades
param: int $cmid        Activity course module id
param: int $studentid   Student it
return: stdClass         Activity Object

get_outcome($grades, $cmid)   X-Ref
Get an ouctome

param: array $grades    Array of grades
param: int $cmid        Activity course module id
return: stdClass         Outcome object

get_outcome_student_grade($grades, $cmid, $studentid)   X-Ref
Get a grade from an outcome

param: array $grades    Array of grades
param: int $cmid        Activity course module id
param: int $studentid   Student id
return: stdClass         Outcome object

test_update_grades()   X-Ref
Test update_grades()


test_create_gradecategory()   X-Ref
Test create_gradecategory.

return: void