Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401]

(no description)

File Size: 123 lines (5 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class


Class: phpunit_gradeimport_csv_load_data  - X-Ref

Class to open up private methods in gradeimport_csv_load_data().

test_insert_grade_record($record, $studentid, grade_item $gradeitem)   X-Ref
Method to open up the appropriate method for unit testing.

param: object $record
param: int $studentid
param: grade_item $gradeitem

get_importcode()   X-Ref
Method to open up the appropriate method for unit testing.


test_import_new_grade_item($header, $key, $value)   X-Ref
Method to open up the appropriate method for unit testing.

param: array $header The column headers from the CSV file.
param: int $key Current row identifier.
param: string $value The value for this row (final grade).
return: array new grades that are ready for commiting to the gradebook.

test_check_user_exists($value, $userfields)   X-Ref
Method to open up the appropriate method for unit testing.

param: string $value The value, from the csv file, being mapped to identify the user.
param: array $userfields Contains the field and label being mapped from.
return: int Returns the user ID if it exists, otherwise null.

test_create_feedback($courseid, $itemid, $value)   X-Ref
Method to open up the appropriate method for unit testing.

param: int $courseid The course ID.
param: int $itemid The ID of the grade item that the feedback relates to.
param: string $value The actual feedback being imported.
return: object Creates a feedback object with the item ID and the feedback value.

test_update_grade_item($courseid, $map, $key, $verbosescales, $value)   X-Ref
Method to open up the appropriate method for unit testing.


test_map_user_data_with_value($mappingidentifier, $value, $header, $map, $key, $courseid, $feedbackgradeid,$verbosescales)   X-Ref
Method to open up the appropriate method for unit testing.

param: int $courseid The course ID.
param: array $map Mapping information provided by the user.
param: int $key The line that we are currently working on.
param: bool $verbosescales Form setting for grading with scales.
param: string $value The grade value .
return: array grades to be updated.