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 39 and 400]

This file contains the forms to create and edit an instance of this module

Copyright: 2012 NetSpot {@link http://www.netspot.com.au}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 216 lines (8 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class

assignfeedback_offline_grade_importer:: (7 methods):
  __construct()
  parsecsv()
  init()
  get_encoding()
  get_separator()
  next()
  close()


Class: assignfeedback_offline_grade_importer  - X-Ref

CSV Grade importer

__construct($importid, assign $assignment, $encoding = 'utf-8', $separator = 'comma')   X-Ref
Constructor

param: string $importid A unique id for this import
param: assign $assignment The current assignment

parsecsv($csvdata)   X-Ref
Parse a csv file and save the content to a temp file
Should be called before init()

return: bool false is a failed import
param: string $csvdata The csv data

init()   X-Ref
Initialise the import reader and locate the column indexes.

return: bool false is a failed import

get_encoding()   X-Ref
Return the encoding for this csv import.

return: string The encoding for this csv import.

get_separator()   X-Ref
Return the separator for this csv import.

return: string The separator for this csv import.

next()   X-Ref
Get the next row of data from the csv file (only the columns we care about)

return: stdClass or false The stdClass is an object containing user, grade and lastmodified

close($delete)   X-Ref
Close the grade importer file and optionally delete any temp files

param: bool $delete