Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402]

(no description)

File Size: 235 lines (10 kb)
Included or required:0 times
Referenced: 2 times
Includes or requires: 0 files

Defines 4 functions


Functions that are not part of a class:

get_new_importcode()   X-Ref
Returns new improtcode for current user

return: int importcode

grade_import_commit($courseid, $importcode, $importfeedback=true, $verbose=true)   X-Ref
given an import code, commits all entries in buffer tables
(grade_import_value and grade_import_newitem)
If this function is called, we assume that all data collected
up to this point is fine and we can go ahead and commit

param: int $courseid - ID of the course.
param: int $importcode - Import batch identifier.
param: bool $importfeedback - Whether to import feedback as well.
param: bool $verbose - Print feedback and continue button.
return: bool success

get_unenrolled_users_in_import($importcode, $courseid)   X-Ref
This function returns an array of grades that were included in the import,
but where the user does not currently have a graded role on the course. These grades
are still stored in the database, but will not be visible in the gradebook unless
this user subsequently enrols on the course in a graded roles.

The returned objects have fields useridnumber and gradeidnumber, plus enough user name fields to pass to {@see fullname}

param: integer $importcode import batch identifier
param: integer $courseid the course we are importing to.
return: mixed and array of user objects, or false if none.

import_cleanup($importcode)   X-Ref
removes entries from grade import buffer tables grade_import_value and grade_import_newitem
after a successful import, or during an import abort

param: string importcode - import batch identifier