Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

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

(no description)

File Size: 231 lines (10 kb)
Included or required:0 times
Referenced: 3 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 user firstname, lastname and useridnumber, and gradeidnumber.

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