MDL-31276: Phpdocs cleanup for offline grading feature

This commit is contained in:
Damyon Wiese 2012-09-11 15:48:19 +08:00
parent d0d4796b4a
commit 7a2b911c6b
17 changed files with 79 additions and 65 deletions

View file

@ -1,5 +1,4 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
@ -28,7 +27,7 @@ defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
require_once($CFG->libdir.'/formslib.php');
require_once($CFG->dirroot.'/mod/assign/feedback/offline/importgradeslib.php');
/*
/**
* Import grades form
*
* @package assignfeedback_offline
@ -40,7 +39,7 @@ class assignfeedback_offline_import_grades_form extends moodleform implements re
/**
* Create this grade import form
*/
function definition() {
public function definition() {
global $CFG, $PAGE, $DB;
$mform = $this->_form;

View file

@ -1,5 +1,4 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
@ -25,7 +24,7 @@
defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
/*
/**
* CSV Grade importer
*
* @package assignfeedback_offline
@ -34,7 +33,7 @@ defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
*/
class assignfeedback_offline_grade_importer {
/** var string $importid - unique id for this import operation - must be passed between requests */
/** @var string $importid - unique id for this import operation - must be passed between requests */
public $importid;
/** @var csv_import_reader $csvreader - the csv importer class */
@ -61,9 +60,10 @@ class assignfeedback_offline_grade_importer {
/**
* Constructor
*
* @param string importid
* @param string $importid A unique id for this import
* @param assign $assignment The current assignment
*/
function __construct($importid, assign $assignment) {
public function __construct($importid, assign $assignment) {
$this->importid = $importid;
$this->assignment = $assignment;
}
@ -72,9 +72,10 @@ class assignfeedback_offline_grade_importer {
* 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
*/
function parsecsv($csvdata) {
public function parsecsv($csvdata) {
$this->csvreader = new csv_import_reader($this->importid, 'assignfeedback_offline');
$this->csvreader->load_csv_content($csvdata, 'utf-8', 'comma');
}
@ -84,7 +85,7 @@ class assignfeedback_offline_grade_importer {
*
* @return bool false is a failed import
*/
function init() {
public function init() {
if ($this->csvreader == null) {
$this->csvreader = new csv_import_reader($this->importid, 'assignfeedback_offline');
}
@ -142,10 +143,9 @@ class assignfeedback_offline_grade_importer {
/**
* Get the next row of data from the csv file (only the columns we care about)
*
* @global moodle_database $DB
* @return stdClass or false The stdClass is an object containing user, grade and lastmodified
*/
function next() {
public function next() {
global $DB;
$result = new stdClass();
@ -178,7 +178,7 @@ class assignfeedback_offline_grade_importer {
*
* @param bool $delete
*/
function close($delete) {
public function close($delete) {
$this->csvreader->close();
if ($delete) {
$this->csvreader->cleanup();

View file

@ -15,9 +15,9 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Strings for component 'feedback_file', language 'en'
* Strings for component 'feedback_offline', language 'en'
*
* @package assignfeedback_file
* @package assignfeedback_offline
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@ -37,7 +37,7 @@ $string['ignoremodified_help'] = 'When the grading worksheet is downloaded from
$string['importgrades'] = 'Confirm changes in grading worksheet';
$string['invalidgradeimport'] = 'Moodle could not read the uploaded worksheet. Make sure it is saved in comma separated value format (.csv) and try again.';
$string['gradesfile'] = 'Grading worksheet (csv format)';
$string['gradesfile_help'] = 'Grading worksheet with modified grades. This file must be a csv file that has been downloaded form this assignment and must contain columns for the student grade, and identifier.';
$string['gradesfile_help'] = 'Grading worksheet with modified grades. This file must be a csv file that has been downloaded from this assignment and must contain columns for the student grade, and identifier. The encoding for the file must be &quot;UTF-8&quot;';
$string['nochanges'] = 'No modified grades found in uploaded worksheet';
$string['offlinegradingworksheet'] = 'Grades';
$string['pluginname'] = 'Offline grading worksheet';

View file

@ -30,7 +30,7 @@ require_once($CFG->dirroot.'/grade/grading/lib.php');
/**
* library class for file feedback plugin extending feedback plugin base class
*
* @package asignfeedback_offline
* @package assignfeedback_offline
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@ -69,6 +69,7 @@ class assign_feedback_offline extends assign_feedback_plugin {
*
* @param int $draftid - The unique draft item id for this import
* @param int $importid - The unique import ID for this csv import operation
* @param bool $ignoremodified - Ignore the last modified date when checking fields
* @return string - The html response
*/
public function process_import_grades($draftid, $importid, $ignoremodified) {
@ -324,7 +325,7 @@ class assign_feedback_offline extends assign_feedback_plugin {
$this->assignment->get_course()->shortname . '-' .
$this->assignment->get_instance()->name . '-' .
$groupname .
$this->assignment->get_course_module()->id); //name of new zip file.
$this->assignment->get_course_module()->id);
$table = new assign_grading_table($this->assignment, 0, '', 0, false, $filename);

View file

@ -24,7 +24,7 @@
defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
require_once ($CFG->libdir.'/formslib.php');
require_once($CFG->libdir.'/formslib.php');
/**
* Upload modified grading worksheet
@ -37,7 +37,7 @@ class assignfeedback_offline_upload_grades_form extends moodleform {
/**
* Define this form - called by the parent constructor
*/
function definition() {
public function definition() {
global $COURSE, $USER;
$mform = $this->_form;

View file

@ -15,9 +15,9 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains the version information for the comments feedback plugin
* This file contains the version information for the offline feedback plugin
*
* @package assignfeedback_file
* @package assignfeedback_offline
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/