Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 39 and 401]

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