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 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

(no description)

File Size: 233 lines (10 kb)
Included or required:0 times
Referenced: 4 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