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

@ -349,7 +349,7 @@ abstract class assign_plugin {
} }
/** /**
* Given a field name and value should update this plugins submission or grade * Given a field name and value should update the text for this field in the plugins submission or grade
* *
* @param string $name Name of the field. * @param string $name Name of the field.
* @param string $value Updated text * @param string $value Updated text
@ -361,14 +361,14 @@ abstract class assign_plugin {
} }
/** /**
* Given a field name and value should update this plugins submission or grade * Given a field name and value should update the format for this field in the plugins submission or grade
* *
* @param string $name Name of the field. * @param string $name Name of the field.
* @param int $format Updated format * @param int $format Updated format.
* @param int $submissionorgradeid The id of the submission or grade * @param int $submissionorgradeid The id of the submission or grade.
* @return bool - true if the value was updated * @return bool - true if the value was updated
*/ */
public function set_editor_format($name, $value, $submissionorgradeid) { public function set_editor_format($name, $format, $submissionorgradeid) {
return false; return false;
} }
@ -404,7 +404,7 @@ abstract class assign_plugin {
return array(); return array();
} }
/** /**
* Given a field name, should return the format of an editor field that is part of * Given a field name, should return the format of an editor field that is part of
* this plugin. This is used when exporting to portfolio. * this plugin. This is used when exporting to portfolio.
* *
@ -416,7 +416,7 @@ abstract class assign_plugin {
return 0; return 0;
} }
/** /**
* Return true if this plugin can upgrade an old Moodle 2.2 assignment of this type * Return true if this plugin can upgrade an old Moodle 2.2 assignment of this type
* and version. * and version.
* *
@ -428,7 +428,7 @@ abstract class assign_plugin {
return false; return false;
} }
/** /**
* Upgrade the settings from the old assignment to the new one * Upgrade the settings from the old assignment to the new one
* *
* @param context $oldcontext The context for the old assignment module * @param context $oldcontext The context for the old assignment module

View file

@ -114,7 +114,7 @@ class assign_feedback_comments extends assign_feedback_plugin {
* Get the saved text content from the editor * Get the saved text content from the editor
* *
* @param string $name * @param string $name
* @param int $submissionid * @param int $gradeid
* @return string * @return string
*/ */
public function get_editor_text($name, $gradeid) { public function get_editor_text($name, $gradeid) {
@ -132,7 +132,7 @@ class assign_feedback_comments extends assign_feedback_plugin {
* Get the saved text content from the editor * Get the saved text content from the editor
* *
* @param string $name * @param string $name
* @param int $submissionid * @param int $gradeid
* @return string * @return string
*/ */
public function set_editor_text($name, $value, $gradeid) { public function set_editor_text($name, $value, $gradeid) {

View file

@ -17,7 +17,7 @@
/** /**
* This file contains the forms to create and edit an instance of this module * This file contains the forms to create and edit an instance of this module
* *
* @package mod_assign * @package assignfeedback_file
* @copyright 2012 NetSpot {@link http://www.netspot.com.au} * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
@ -30,7 +30,7 @@ require_once($CFG->dirroot . '/mod/assign/feedback/file/locallib.php');
/** /**
* Assignment grading options form * Assignment grading options form
* *
* @package mod_assign * @package assignfeedback_file
* @copyright 2012 NetSpot {@link http://www.netspot.com.au} * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
@ -38,7 +38,7 @@ class assignfeedback_file_batch_upload_files_form extends moodleform {
/** /**
* Define this form - called by the parent constructor * Define this form - called by the parent constructor
*/ */
function definition() { public function definition() {
global $COURSE, $USER; global $COURSE, $USER;
$mform = $this->_form; $mform = $this->_form;
@ -53,7 +53,12 @@ class assignfeedback_file_batch_upload_files_form extends moodleform {
'accepted_types'=>'*', 'accepted_types'=>'*',
'return_types'=>FILE_INTERNAL); 'return_types'=>FILE_INTERNAL);
$data = file_prepare_standard_filemanager($data, 'files', $fileoptions, $params['context'], 'assignfeedback_file', ASSIGNFEEDBACK_BATCHFILE_FILEAREA, $USER->id); $data = file_prepare_standard_filemanager($data,
'files',
$fileoptions,
$params['context'],
'assignfeedback_file',
ASSIGNFEEDBACK_BATCHFILE_FILEAREA, $USER->id);
$mform->addElement('filemanager', 'files_filemanager', '', null, $fileoptions); $mform->addElement('filemanager', 'files_filemanager', '', null, $fileoptions);

View file

@ -1,5 +1,4 @@
<?php <?php
// This file is part of Moodle - http://moodle.org/ // This file is part of Moodle - http://moodle.org/
// //
// Moodle is free software: you can redistribute it and/or modify // 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->libdir.'/formslib.php');
require_once($CFG->dirroot.'/mod/assign/feedback/file/importziplib.php'); require_once($CFG->dirroot.'/mod/assign/feedback/file/importziplib.php');
/* /**
* Import zip form * Import zip form
* *
* @package assignfeedback_file * @package assignfeedback_file
@ -59,7 +58,6 @@ class assignfeedback_file_import_zip_form extends moodleform implements renderab
return; return;
} }
$files = $importer->get_import_files($contextid); $files = $importer->get_import_files($contextid);
$mform->addElement('header', 'uploadzip', get_string('confirmuploadzip', 'assignfeedback_file')); $mform->addElement('header', 'uploadzip', get_string('confirmuploadzip', 'assignfeedback_file'));
@ -110,7 +108,6 @@ class assignfeedback_file_import_zip_form extends moodleform implements renderab
} }
} }
if (count($updates)) { if (count($updates)) {
$mform->addElement('html', $renderer->list_block_contents(array(), $updates)); $mform->addElement('html', $renderer->list_block_contents(array(), $updates));
} else { } else {

View file

@ -28,7 +28,7 @@ defined('MOODLE_INTERNAL') || die();
/** /**
* library class for importing feedback files from a zip * library class for importing feedback files from a zip
* *
* @package asignfeedback_file * @package assignfeedback_file
* @copyright 2012 NetSpot {@link http://www.netspot.com.au} * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
@ -41,6 +41,7 @@ class assignfeedback_file_zip_importer {
* @param stored_file $fileinfo - The fileinfo * @param stored_file $fileinfo - The fileinfo
* @param array $participants - A list of valid participants for this module indexed by unique_id * @param array $participants - A list of valid participants for this module indexed by unique_id
* @param stdClass $user - Set to the user that matches by participant id * @param stdClass $user - Set to the user that matches by participant id
* @param assign_plugin $plugin - Set to the plugin that exported the file
* @param string $filename - Set to truncated filename (prefix stripped) * @param string $filename - Set to truncated filename (prefix stripped)
* @return true If the participant Id can be extracted and this is a valid user * @return true If the participant Id can be extracted and this is a valid user
*/ */
@ -270,7 +271,6 @@ class assignfeedback_file_zip_importer {
} }
} }
require_once($CFG->dirroot . '/mod/assign/feedback/file/renderable.php'); require_once($CFG->dirroot . '/mod/assign/feedback/file/renderable.php');
$importsummary = new assignfeedback_file_import_summary($assignment->get_course_module()->id, $importsummary = new assignfeedback_file_import_summary($assignment->get_course_module()->id,
count($userswithnewfeedback), count($userswithnewfeedback),

View file

@ -79,14 +79,15 @@ class assign_feedback_file extends assign_feedback_plugin {
/** /**
* Copy all the files from one file area to another * Copy all the files from one file area to another
* *
* @param int fromcontextid - The source context id * @param file_storage $fs - The source context id
* @param string fromcomponent - The source component * @param int $fromcontextid - The source context id
* @param string fromfilearea - The source filearea * @param string $fromcomponent - The source component
* @param int fromitemid - The source item id * @param string $fromfilearea - The source filearea
* @param int tocontextid - The destination context id * @param int $fromitemid - The source item id
* @param string tocomponent - The destination component * @param int $tocontextid - The destination context id
* @param string tofilearea - The destination filearea * @param string $tocomponent - The destination component
* @param int toitemid - The destination item id * @param string $tofilearea - The destination filearea
* @param int $toitemid - The destination item id
* @return boolean * @return boolean
*/ */
private function copy_area_files(file_storage $fs, private function copy_area_files(file_storage $fs,
@ -186,7 +187,13 @@ class assign_feedback_file extends assign_feedback_plugin {
public function save(stdClass $grade, stdClass $data) { public function save(stdClass $grade, stdClass $data) {
$fileoptions = $this->get_file_options(); $fileoptions = $this->get_file_options();
$data = file_postupdate_standard_filemanager($data, 'files', $fileoptions, $this->assignment->get_context(), 'assignfeedback_file', ASSIGNFEEDBACK_FILE_FILEAREA, $grade->id); $data = file_postupdate_standard_filemanager($data,
'files',
$fileoptions,
$this->assignment->get_context(),
'assignfeedback_file',
ASSIGNFEEDBACK_FILE_FILEAREA,
$grade->id);
return $this->update_file_count($grade); return $this->update_file_count($grade);
} }
@ -393,7 +400,6 @@ class assign_feedback_file extends assign_feedback_plugin {
ASSIGNFEEDBACK_FILE_FILEAREA, ASSIGNFEEDBACK_FILE_FILEAREA,
$grade->id); $grade->id);
$filefeedback = $this->get_file_feedback($grade->id); $filefeedback = $this->get_file_feedback($grade->id);
if ($filefeedback) { if ($filefeedback) {
$filefeedback->numfiles = $this->count_files($grade->id, ASSIGNFEEDBACK_FILE_FILEAREA); $filefeedback->numfiles = $this->count_files($grade->id, ASSIGNFEEDBACK_FILE_FILEAREA);
@ -452,7 +458,7 @@ class assign_feedback_file extends assign_feedback_plugin {
* *
* @return string - The html response * @return string - The html response
*/ */
function view_upload_zip() { public function view_upload_zip() {
global $CFG, $USER; global $CFG, $USER;
require_capability('mod/assign:grade', $this->assignment->get_context()); require_capability('mod/assign:grade', $this->assignment->get_context());

View file

@ -45,7 +45,7 @@ class assignfeedback_file_import_summary implements renderable {
* Constructor for this renderable class * Constructor for this renderable class
* *
* @param int $cmid - The course module id for navigation * @param int $cmid - The course module id for navigation
* @param int $userswithnewfeedbac - The number of users with new feedback * @param int $userswithnewfeedback - The number of users with new feedback
* @param int $feedbackfilesadded - The number of feedback files added * @param int $feedbackfilesadded - The number of feedback files added
* @param int $feedbackfilesupdated - The number of feedback files updated * @param int $feedbackfilesupdated - The number of feedback files updated
*/ */

View file

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

View file

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

View file

@ -1,5 +1,4 @@
<?php <?php
// This file is part of Moodle - http://moodle.org/ // This file is part of Moodle - http://moodle.org/
// //
// Moodle is free software: you can redistribute it and/or modify // 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.'); defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
/* /**
* CSV Grade importer * CSV Grade importer
* *
* @package assignfeedback_offline * @package assignfeedback_offline
@ -34,7 +33,7 @@ defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
*/ */
class assignfeedback_offline_grade_importer { 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; public $importid;
/** @var csv_import_reader $csvreader - the csv importer class */ /** @var csv_import_reader $csvreader - the csv importer class */
@ -61,9 +60,10 @@ class assignfeedback_offline_grade_importer {
/** /**
* Constructor * 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->importid = $importid;
$this->assignment = $assignment; $this->assignment = $assignment;
} }
@ -72,9 +72,10 @@ class assignfeedback_offline_grade_importer {
* Parse a csv file and save the content to a temp file * Parse a csv file and save the content to a temp file
* Should be called before init() * Should be called before init()
* *
* @param string $csvdata The csv data
* @return bool false is a failed import * @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 = new csv_import_reader($this->importid, 'assignfeedback_offline');
$this->csvreader->load_csv_content($csvdata, 'utf-8', 'comma'); $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 * @return bool false is a failed import
*/ */
function init() { public function init() {
if ($this->csvreader == null) { if ($this->csvreader == null) {
$this->csvreader = new csv_import_reader($this->importid, 'assignfeedback_offline'); $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) * 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 * @return stdClass or false The stdClass is an object containing user, grade and lastmodified
*/ */
function next() { public function next() {
global $DB; global $DB;
$result = new stdClass(); $result = new stdClass();
@ -178,7 +178,7 @@ class assignfeedback_offline_grade_importer {
* *
* @param bool $delete * @param bool $delete
*/ */
function close($delete) { public function close($delete) {
$this->csvreader->close(); $this->csvreader->close();
if ($delete) { if ($delete) {
$this->csvreader->cleanup(); $this->csvreader->cleanup();

View file

@ -15,9 +15,9 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // 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} * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @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['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['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'] = '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['nochanges'] = 'No modified grades found in uploaded worksheet';
$string['offlinegradingworksheet'] = 'Grades'; $string['offlinegradingworksheet'] = 'Grades';
$string['pluginname'] = 'Offline grading worksheet'; $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 * 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} * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @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 $draftid - The unique draft item id for this import
* @param int $importid - The unique import ID for this csv import operation * @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 * @return string - The html response
*/ */
public function process_import_grades($draftid, $importid, $ignoremodified) { 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_course()->shortname . '-' .
$this->assignment->get_instance()->name . '-' . $this->assignment->get_instance()->name . '-' .
$groupname . $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); $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.'); 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 * Upload modified grading worksheet
@ -37,7 +37,7 @@ class assignfeedback_offline_upload_grades_form extends moodleform {
/** /**
* Define this form - called by the parent constructor * Define this form - called by the parent constructor
*/ */
function definition() { public function definition() {
global $COURSE, $USER; global $COURSE, $USER;
$mform = $this->_form; $mform = $this->_form;

View file

@ -15,9 +15,9 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // 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} * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */

View file

@ -145,15 +145,18 @@ abstract class assign_feedback_plugin extends assign_plugin {
/** /**
* Show a grading action form * Show a grading action form
* *
* @param string $gradingaction The action chosen from the grading actions menu
* @return string The page containing the form * @return string The page containing the form
*/ */
public function grading_action($action) { public function grading_action($gradingaction) {
return ''; return '';
} }
/** /**
* Show a batch operations form * Show a batch operations form
* *
* @param string $action The action chosen from the batch operations menu
* @param array $users The list of selected userids
* @return string The page containing the form * @return string The page containing the form
*/ */
public function grading_batch_operation($action, $users) { public function grading_batch_operation($action, $users) {

View file

@ -72,7 +72,7 @@ class assign_grading_table extends table_sql implements renderable {
* @param int $rowoffset For showing a subsequent page of results * @param int $rowoffset For showing a subsequent page of results
* @param bool $quickgrading Is this table wrapped in a quickgrading form? * @param bool $quickgrading Is this table wrapped in a quickgrading form?
*/ */
function __construct(assign $assignment, $perpage, $filter, $rowoffset, $quickgrading, $downloadfilename = null) { public function __construct(assign $assignment, $perpage, $filter, $rowoffset, $quickgrading, $downloadfilename = null) {
global $CFG, $PAGE, $DB; global $CFG, $PAGE, $DB;
parent::__construct('mod_assign_grading'); parent::__construct('mod_assign_grading');
$this->assignment = $assignment; $this->assignment = $assignment;
@ -339,7 +339,7 @@ class assign_grading_table extends table_sql implements renderable {
* @param stdClass $row - The row of data * @param stdClass $row - The row of data
* @return string A list of valid options for the current scale * @return string A list of valid options for the current scale
*/ */
function col_scale($row) { public function col_scale($row) {
global $DB; global $DB;
if (empty($this->scale)) { if (empty($this->scale)) {
@ -535,8 +535,8 @@ class assign_grading_table extends table_sql implements renderable {
* @param stdClass $row * @param stdClass $row
* @return string * @return string
*/ */
function col_grademax(stdClass $row) { public function col_grademax(stdClass $row) {
return format_float($this->assignment->get_instance()->grade,2); return format_float($this->assignment->get_instance()->grade, 2);
} }
/** /**

View file

@ -423,7 +423,7 @@ class assign {
$o .= $this->view_reveal_identities_confirm($mform); $o .= $this->view_reveal_identities_confirm($mform);
} else if ($action == 'plugingradingbatchoperation') { } else if ($action == 'plugingradingbatchoperation') {
$o .= $this->view_plugin_grading_batch_operation($mform); $o .= $this->view_plugin_grading_batch_operation($mform);
} else if ($action == 'viewpluginpage') { } else if ($action == 'viewpluginpage') {
$o .= $this->view_plugin_page(); $o .= $this->view_plugin_page();
} else { } else {
$o .= $this->view_submission_page(); $o .= $this->view_submission_page();
@ -1807,7 +1807,7 @@ class assign {
foreach ($students as $student) { foreach ($students as $student) {
$userid = $student->id; $userid = $student->id;
if ((groups_is_member($groupid,$userid) or !$groupmode or !$groupid)) { if ((groups_is_member($groupid, $userid) or !$groupmode or !$groupid)) {
// Get the plugins to add their own files to the zip. // Get the plugins to add their own files to the zip.
$submissiongroup = false; $submissiongroup = false;
@ -1833,7 +1833,9 @@ class assign {
if ($plugin->is_enabled() && $plugin->is_visible()) { if ($plugin->is_enabled() && $plugin->is_visible()) {
$pluginfiles = $plugin->get_files($submission); $pluginfiles = $plugin->get_files($submission);
foreach ($pluginfiles as $zipfilename => $file) { foreach ($pluginfiles as $zipfilename => $file) {
$prefixedfilename = $prefix . $plugin->get_subtype() . '_' . $plugin->get_type() . '_' . $zipfilename; $subtype = $plugin->get_subtype();
$type = $plugin->get_type();
$prefixedfilename = $prefix . $subtype . '_' . $type . '_' . $zipfilename;
$filesforzipping[$prefixedfilename] = $file; $filesforzipping[$prefixedfilename] = $file;
} }
} }
@ -2431,9 +2433,9 @@ class assign {
print_error('invalidformdata', ''); print_error('invalidformdata', '');
} }
/** /**
* Ask the user to confirm they want to perform this batch operation * Ask the user to confirm they want to perform this batch operation
* @param moodleform $mform Set to a grading batch operations form
* @return string - the page to view after processing these actions * @return string - the page to view after processing these actions
*/ */
private function process_grading_batch_operation(& $mform) { private function process_grading_batch_operation(& $mform) {
@ -4415,6 +4417,7 @@ class assign {
/** /**
* Lookup this unique id and return the user id for this assignment * Lookup this unique id and return the user id for this assignment
* *
* @param int $assignid The id of the assignment this user mapping is in
* @param int $uniqueid The uniqueid to lookup * @param int $uniqueid The uniqueid to lookup
* @return int The user id or false if they don't exist * @return int The user id or false if they don't exist
*/ */