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]

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()

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

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