Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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

(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

return: bool success
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.

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}

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

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