' . get_string('gradereleasedtostudent', 'coursework') . '
';
}
@@ -641,7 +641,7 @@ public function teacher_grading_page($coursework, $page, $perpage, $sortby, $sor
}
// reset table preferences
- if($firstnamealpha || $lastnamealpha || $groupnamealpha) {
+ if ($firstnamealpha || $lastnamealpha || $groupnamealpha) {
$url = new moodle_url('/mod/coursework/view.php', array('id' => $coursework->get_course_module()->id, 'treset' => 1));
$html .= html_writer::start_div('mdl-right');
@@ -692,7 +692,7 @@ public function teacher_grading_page($coursework, $page, $perpage, $sortby, $sor
$html .= $this->render($gradingactions);;
}
- if($firstnamealpha || $lastnamealpha || $groupnamealpha || $group != -1) {
+ if ($firstnamealpha || $lastnamealpha || $groupnamealpha || $group != -1) {
$html .= $warnings->filters_warning();
}
@@ -1439,7 +1439,7 @@ function view_course_index($courseid) {
if ($coursework->can_grade()) { // teachers
$submitted = count($coursework->get_all_submissions());
} else if ($coursework->can_submit()) { //students
- if($coursework->use_groups){
+ if ($coursework->use_groups){
$allocatable = $coursework->get_student_group($USER);
} else {
$allocatable = $USER;
diff --git a/view.php b/view.php
index f2cfd454..f8780b63 100644
--- a/view.php
+++ b/view.php
@@ -529,13 +529,13 @@
}
} else {
- if($resettable){
+ if ($resettable){
$coursework_firstname_alpha = $SESSION->coursework_firstname_alpha[$course_module_id] = "";
$coursework_lastname_alpha = $SESSION->coursework_lastname_alpha[$course_module_id] = "";
$coursework_groupname_alpha = $SESSION->coursework_groupname_alpha[$course_module_id] = "";
}
- if($allresettable){
+ if ($allresettable){
$viewallstudents_firstname_alpha = $SESSION->viewallstudents_firstname_alpha[$course_module_id] = "";
$viewallstudents_lastname_alpha = $SESSION->viewallstudents_lastname_alpha[$course_module_id] = "";
$viewallstudents_groupname_alpha = $SESSION->viewallstudents_groupname_alpha[$course_module_id] = "";
From c0a3d4885dc1080dd470908f649aba95f94d727a Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Mon, 12 Aug 2024 12:05:14 +0100
Subject: [PATCH 09/51] CTP-3558 coding std insert space after comma
---
actions/allocate.php | 6 +-
actions/finalgrade.php | 2 +-
actions/personal_deadline.php | 4 +-
actions/upload_feedback.php | 8 +-
actions/upload_grading_sheet.php | 2 +-
backup/moodle2/backup_coursework_stepslib.php | 56 ++++++-------
.../moodle2/restore_coursework_stepslib.php | 68 ++++++++--------
classes/ability.php | 2 +-
classes/allocation/manager.php | 18 ++---
classes/allocation/strategy/none.php | 2 +-
classes/allocation/table/cell/builder.php | 8 +-
classes/allocation/table/cell/processor.php | 2 +-
classes/allocation/upload.php | 4 +-
classes/controllers/feedback_controller.php | 24 +++---
.../controllers/submissions_controller.php | 8 +-
classes/cron.php | 2 +-
classes/export/csv.php | 14 ++--
.../export/csv/cells/agreedfeedback_cell.php | 10 +--
classes/export/csv/cells/agreedgrade_cell.php | 24 +++---
.../csv/cells/assessorfeedback_cell.php | 12 +--
.../export/csv/cells/assessorgrade_cell.php | 14 ++--
classes/export/csv/cells/cell_base.php | 18 ++---
classes/export/csv/cells/cell_interface.php | 4 +-
.../csv/cells/feedbackcomments_cell.php | 8 +-
classes/export/csv/cells/singlegrade_cell.php | 24 +++---
.../csv/cells/submissionfileid_cell.php | 2 +-
.../export/csv/cells/submissionid_cell.php | 2 +-
classes/export/grading_sheet.php | 2 +-
classes/export/import.php | 36 ++++-----
classes/file_importer.php | 18 ++---
classes/forms/student_submission_form.php | 4 +-
classes/forms/upload_allocations_form.php | 8 +-
classes/forms/upload_feedback_form.php | 20 ++---
classes/forms/upload_grading_sheet_form.php | 8 +-
classes/forms/view_all_students_mform.php | 2 +-
classes/grade_judge.php | 4 +-
classes/mailer.php | 2 +-
classes/models/coursework.php | 12 +--
classes/models/outstanding_marking.php | 34 ++++----
classes/models/submission.php | 6 +-
.../grading_report/cells/cell_base.php | 2 +-
.../cells/multiple_agreed_grade_cell.php | 2 +-
.../cells/time_submitted_cell.php | 2 +-
.../renderers/personal_deadline_renderer.php | 2 +-
classes/router.php | 2 +-
classes/sample_set_rule/range_sample_type.php | 24 +++---
classes/sample_set_rule/total_sample_type.php | 18 ++---
classes/stages/base.php | 2 +-
classes/task/enrol_task.php | 2 +-
classes/task/unenrol_task.php | 2 +-
db/install.php | 4 +-
db/upgrade.php | 10 +--
lang/en/coursework.php | 2 +-
lib.php | 16 ++--
mod_form.php | 78 +++++++++----------
renderers/object_renderer.php | 76 +++++++++---------
renderers/page_renderer.php | 50 ++++++------
settings.php | 38 ++++-----
tests/behat/behat_mod_coursework.php | 12 +--
tests/behat/pages/allocations_page.php | 6 +-
tests/classes/export/csv_test.php | 46 +++++------
.../export/grading_sheet_download_test.php | 14 ++--
view.php | 20 ++---
63 files changed, 467 insertions(+), 467 deletions(-)
diff --git a/actions/allocate.php b/actions/allocate.php
index ad66a3fc..db9dadee 100644
--- a/actions/allocate.php
+++ b/actions/allocate.php
@@ -73,7 +73,7 @@
// SQL sort for allocation table.
$sortby = optional_param('sortby', '', PARAM_ALPHA);
$sorthow = optional_param('sorthow', '', PARAM_ALPHA);
-$options = compact('sortby', 'sorthow','perpage','page');
+$options = compact('sortby', 'sorthow', 'perpage', 'page');
// $_POST['allocatables'] comes as array of arrays which is not supported by optional_param_array, however we clean this later in process_data() function
$formdataarray = isset($_POST['allocatables']) ? $_POST['allocatables'] : array();
@@ -101,7 +101,7 @@
'node-base')
);
$PAGE->requires->js_init_call('M.mod_coursework.init_allocate_page',
- array('wwwroot' => $CFG->wwwroot,'coursemoduleid' => $coursemoduleid),
+ array('wwwroot' => $CFG->wwwroot, 'coursemoduleid' => $coursemoduleid),
false,
$jsmodule);
@@ -192,7 +192,7 @@
}
if ($formsavebutton && $percentage_allocation_not_complete == '' && $manual_allocation_not_complete == ''){
- redirect($CFG->wwwroot.'/mod/coursework/view.php?id='.$coursemoduleid, get_string('changessaved','mod_coursework'));
+ redirect($CFG->wwwroot.'/mod/coursework/view.php?id='.$coursemoduleid, get_string('changessaved', 'mod_coursework'));
} elseif ($formsavebutton) {
redirect($PAGE->url);
}
diff --git a/actions/finalgrade.php b/actions/finalgrade.php
index 5971f31d..13663641 100644
--- a/actions/finalgrade.php
+++ b/actions/finalgrade.php
@@ -145,7 +145,7 @@
}
$details = new stdClass();
$details->name = fullname($editor);
- $details->time = userdate($teacherfeedback->timemodified,'%a, %d %b %Y, %H:%M');
+ $details->time = userdate($teacherfeedback->timemodified, '%a, %d %b %Y, %H:%M');
echo html_writer::tag('p', get_string('lastedited', 'coursework', $details));
}
diff --git a/actions/personal_deadline.php b/actions/personal_deadline.php
index 3ac7861a..e5e52428 100644
--- a/actions/personal_deadline.php
+++ b/actions/personal_deadline.php
@@ -33,7 +33,7 @@
$allocatabletype = optional_param('allocatabletype', $USER->id, PARAM_ALPHANUMEXT);
$setpersonaldeadlinespage = optional_param('setpersonaldeadlinespage', 0, PARAM_INT);
$multipleuserdeadlines = optional_param('multipleuserdeadlines', 0, PARAM_INT);
-$selectedtype = optional_param('selectedtype','date', PARAM_RAW);
+$selectedtype = optional_param('selectedtype', 'date', PARAM_RAW);
$personal_deadline_time = optional_param('personal_deadline_time',null,PARAM_RAW);
$allocatableid = (!empty($allocatableid_arr)) ? $allocatableid_arr : $allocatableid ;
@@ -43,7 +43,7 @@
$coursework = \mod_coursework\models\coursework::find($coursework_db);
-require_login($coursework->get_course(),false,$coursework->get_course_module());
+require_login($coursework->get_course(),false, $coursework->get_course_module());
$params = array(
'courseworkid' => $courseworkid,
diff --git a/actions/upload_feedback.php b/actions/upload_feedback.php
index 649a78d2..ed16bc4b 100644
--- a/actions/upload_feedback.php
+++ b/actions/upload_feedback.php
@@ -54,7 +54,7 @@
$PAGE->set_title($title);
$PAGE->set_heading($title);
-$grading_sheet_capabilities = array('mod/coursework:addinitialgrade','mod/coursework:addagreedgrade','mod/coursework:administergrades');
+$grading_sheet_capabilities = array('mod/coursework:addinitialgrade', 'mod/coursework:addagreedgrade', 'mod/coursework:administergrades');
// Bounce anyone who shouldn't be here.
@@ -65,7 +65,7 @@
-$feedbackform = new upload_feedback_form($coursework,$coursemoduleid);
+$feedbackform = new upload_feedback_form($coursework, $coursemoduleid);
if ($feedbackform->is_cancelled()) {
redirect(new moodle_url("$CFG->wwwroot/mod/coursework/view.php", array('id' => $coursemoduleid)));
@@ -93,9 +93,9 @@
- $fileimporter->extract_zip_file($filepath,$coursework->get_context_id());
+ $fileimporter->extract_zip_file($filepath, $coursework->get_context_id());
- $updateresults = $fileimporter->import_zip_files($coursework,$stageidentifier,$data->overwrite);
+ $updateresults = $fileimporter->import_zip_files($coursework, $stageidentifier, $data->overwrite);
$page_renderer = $PAGE->get_renderer('mod_coursework', 'page');
echo $page_renderer->process_feedback_upload($updateresults);
diff --git a/actions/upload_grading_sheet.php b/actions/upload_grading_sheet.php
index ae3fa232..9266898c 100644
--- a/actions/upload_grading_sheet.php
+++ b/actions/upload_grading_sheet.php
@@ -56,7 +56,7 @@
$PAGE->set_url(new moodle_url('/mod/coursework/actions/upload_grading_sheet.php'));
$PAGE->set_title($title);
$PAGE->set_heading($title);
-$grading_sheet_capabilities = array('mod/coursework:addinitialgrade','mod/coursework:addagreedgrade','mod/coursework:administergrades');
+$grading_sheet_capabilities = array('mod/coursework:addinitialgrade', 'mod/coursework:addagreedgrade', 'mod/coursework:administergrades');
// Bounce anyone who shouldn't be here.
diff --git a/backup/moodle2/backup_coursework_stepslib.php b/backup/moodle2/backup_coursework_stepslib.php
index 641d5bcc..8d08fa92 100644
--- a/backup/moodle2/backup_coursework_stepslib.php
+++ b/backup/moodle2/backup_coursework_stepslib.php
@@ -398,48 +398,48 @@ protected function define_structure() {
array('courseworkid' => backup::VAR_PARENTID));
//Mark important foreign keys
- $feedback->annotate_ids('user','assessorid');
- $feedback->annotate_ids('user','lasteditedbyuser');
- $feedback->annotate_ids('user','markernumber');
+ $feedback->annotate_ids('user', 'assessorid');
+ $feedback->annotate_ids('user', 'lasteditedbyuser');
+ $feedback->annotate_ids('user', 'markernumber');
- $submission->annotate_ids('user','userid');
- $submission->annotate_ids('user','createdby');
- $submission->annotate_ids('user','lastupdatedby');
- $submission->annotate_ids('user','allocatableuser');
- $submission->annotate_ids('group','allocatablegroup');
+ $submission->annotate_ids('user', 'userid');
+ $submission->annotate_ids('user', 'createdby');
+ $submission->annotate_ids('user', 'lastupdatedby');
+ $submission->annotate_ids('user', 'allocatableuser');
+ $submission->annotate_ids('group', 'allocatablegroup');
- $reminder->annotate_ids('user','userid');
+ $reminder->annotate_ids('user', 'userid');
- $pair->annotate_ids('user','assessorid');
- $pair->annotate_ids('user','allocatableuser');
- $pair->annotate_ids('group','allocatablegroup');
+ $pair->annotate_ids('user', 'assessorid');
+ $pair->annotate_ids('user', 'allocatableuser');
+ $pair->annotate_ids('group', 'allocatablegroup');
- $allocation_config->annotate_ids('user','assessorid');
+ $allocation_config->annotate_ids('user', 'assessorid');
- $modsetmember->annotate_ids('user','allocatableuser');
- $modsetmember->annotate_ids('group','allocatablegroup');
+ $modsetmember->annotate_ids('user', 'allocatableuser');
+ $modsetmember->annotate_ids('group', 'allocatablegroup');
- $extension->annotate_ids('user','allocatableuser');
- $extension->annotate_ids('group','allocatablegroup');
+ $extension->annotate_ids('user', 'allocatableuser');
+ $extension->annotate_ids('group', 'allocatablegroup');
- $personal_deadline->annotate_ids('user','allocatableuser');
- $personal_deadline->annotate_ids('group','allocatablegroup');
+ $personal_deadline->annotate_ids('user', 'allocatableuser');
+ $personal_deadline->annotate_ids('group', 'allocatablegroup');
- $sample_member->annotate_ids('user','allocatableuser');
- $sample_member->annotate_ids('group','allocatablegroup');
+ $sample_member->annotate_ids('user', 'allocatableuser');
+ $sample_member->annotate_ids('group', 'allocatablegroup');
- $moderation_agreement->annotate_ids('user','moderatorid');
- $moderation_agreement->annotate_ids('user','lasteditedby');
+ $moderation_agreement->annotate_ids('user', 'moderatorid');
+ $moderation_agreement->annotate_ids('user', 'lasteditedby');
- $plagiarism_flag->annotate_ids('user','createdby');
- $plagiarism_flag->annotate_ids('user','lastmodifiedby');
+ $plagiarism_flag->annotate_ids('user', 'createdby');
+ $plagiarism_flag->annotate_ids('user', 'lastmodifiedby');
- $coursework->annotate_files('mod_coursework','feedback',null);
- $coursework->annotate_files('mod_coursework','submission',null);
+ $coursework->annotate_files('mod_coursework', 'feedback',null);
+ $coursework->annotate_files('mod_coursework', 'submission',null);
}
- $coursework->annotate_ids('grouping','grouping_id');
+ $coursework->annotate_ids('grouping', 'grouping_id');
$coursework->set_source_table('coursework',array('id' => backup::VAR_ACTIVITYID));
diff --git a/backup/moodle2/restore_coursework_stepslib.php b/backup/moodle2/restore_coursework_stepslib.php
index f3cf7321..39101c3f 100644
--- a/backup/moodle2/restore_coursework_stepslib.php
+++ b/backup/moodle2/restore_coursework_stepslib.php
@@ -26,12 +26,12 @@
class restore_coursework_activity_structure_step extends restore_activity_structure_step
{
// Just a handy way to spit out debugging info while in the bowels of restore
- static function cheaplog($thing,$append=true) {
+ static function cheaplog($thing, $append=true) {
if ($append) {
$append=FILE_APPEND;
}
- file_put_contents('/tmp/cheap.log',print_r($thing,true)."\n---------------\n",$append);
+ file_put_contents('/tmp/cheap.log',print_r($thing,true)."\n---------------\n", $append);
}
/**
@@ -79,12 +79,12 @@ protected function define_structure() {
protected function fixallocatable(&$data) {
if (!empty($data->allocatableuser)) {
- $data->allocatableid=$this->get_mappingid('user',$data->allocatableuser);
+ $data->allocatableid=$this->get_mappingid('user', $data->allocatableuser);
$data->allocatabletype='user';
}
else
{
- $data->allocatableid=$this->get_mappingid('group',$data->allocatablegroup);
+ $data->allocatableid=$this->get_mappingid('group', $data->allocatablegroup);
$data->allocatabletype='group';
}
}
@@ -105,7 +105,7 @@ protected function process_coursework_submission($data) {
'timecreated',
'timesubmitted',
'firstpublished',
- 'lastpublished',),$data);
+ 'lastpublished',), $data);
$now=time();
$this->set_defaults(array('timecreated' => $now,
@@ -134,17 +134,17 @@ protected function process_coursework_feedback($data) {
$data=(object)$data;
$oldid=$data->id;
- $data->submissionid=$this->get_mappingid('coursework_submission',$data->submissionid);
- $data->assessorid=$this->get_mappingid('user',$data->assessorid);
- $data->lasteditedbyuser=$this->get_mappingid('user',$data->lasteditedbyuser);
- $data->markernumber=$this->get_mappingid('user',$data->markernumber);
+ $data->submissionid=$this->get_mappingid('coursework_submission', $data->submissionid);
+ $data->assessorid=$this->get_mappingid('user', $data->assessorid);
+ $data->lasteditedbyuser=$this->get_mappingid('user', $data->lasteditedbyuser);
+ $data->markernumber=$this->get_mappingid('user', $data->markernumber);
$this->updatedate(array('timemodified',
'timecreated',
- 'timepublished'),$data);
+ 'timepublished'), $data);
- $this->check_grade('grade',$data);
- $this->check_grade('cappedgrade',$data);
+ $this->check_grade('grade', $data);
+ $this->check_grade('cappedgrade', $data);
$now=time();
$this->set_defaults(array('assessorid' => 0,
@@ -161,7 +161,7 @@ protected function process_coursework_feedback($data) {
'entry_id' => 0,
'markernumber' => 0,
'stage_identifier' => '',
- 'finalised' => 0),$data);
+ 'finalised' => 0), $data);
$newitemid = $DB->insert_record('coursework_feedbacks', $data);
@@ -175,7 +175,7 @@ protected function process_coursework_reminder($data) {
$data->coursework_id=$this->get_new_parentid('coursework');
$data->userid = $this->get_mappingid('user', $data->userid);
- $this->set_defaults(array('remindernumber' => 0),$data);
+ $this->set_defaults(array('remindernumber' => 0), $data);
global $DB;
$newitemid = $DB->insert_record('coursework_reminder', $data);
@@ -187,7 +187,7 @@ protected function process_coursework_allocation_pair($data) {
$data->courseworkid=$this->get_new_parentid('coursework');
$data->assessorid = $this->get_mappingid('user', $data->assessorid);
- $this->updatedate(array('timelocked'),$data);
+ $this->updatedate(array('timelocked'), $data);
$this->fixallocatable($data);
@@ -195,7 +195,7 @@ protected function process_coursework_allocation_pair($data) {
'manual' => 0,
'moderator' => 0,
'timelocked' => time(),
- 'stage_identifier' => ''),$data);
+ 'stage_identifier' => ''), $data);
global $DB;
$newitemid = $DB->insert_record('coursework_allocation_pairs', $data);
@@ -211,7 +211,7 @@ protected function process_coursework_mod_set_rule($data) {
'ruleorder' => 0,
'upperlimit' => 0,
'lowerlimit' => 0,
- 'minimum' => 0),$data);
+ 'minimum' => 0), $data);
global $DB;
$newitemid = $DB->insert_record('coursework_mod_set_members', $data);
@@ -228,7 +228,7 @@ protected function process_coursework_sample_set_rule($data) {
'upperlimit' => 0,
'lowerlimit' => 0,
'sample_set_plugin_id' => 0,
- 'stage_identifier' => ''),$data);
+ 'stage_identifier' => ''), $data);
global $DB;
$newitemid = $DB->insert_record('coursework_sample_set_rules', $data);
@@ -257,7 +257,7 @@ protected function process_coursework_mod_set_member($data) {
$this->fixallocatable($data);
- $this->set_defaults(array('stage_identifier' => ''),$data);
+ $this->set_defaults(array('stage_identifier' => ''), $data);
global $DB;
$newitemid = $DB->insert_record('coursework_mod_set_members', $data);
@@ -275,7 +275,7 @@ protected function process_coursework_sample_set_mbr($data) {
'allocatableuser' => 0,
'allocatablegroup' => 0,
'stage_identifier' => '',
- 'selectiontype' => ''),$data);
+ 'selectiontype' => ''), $data);
global $DB;
$newitemid = $DB->insert_record('coursework_sample_set_mbrs', $data);
@@ -289,13 +289,13 @@ protected function process_coursework_extension($data) {
$this->fixallocatable($data);
- $this->updatedate(array('extended_deadline'),$data);
+ $this->updatedate(array('extended_deadline'), $data);
$this->set_defaults(array('extended_deadline' => 0,
'pre_defined_reason' => '',
'extra_information_text' => '',
'extra_information_format' => FORMAT_HTML)
- ,$data);
+ , $data);
global $DB;
$newitemid = $DB->insert_record('coursework_extensions', $data);
@@ -307,19 +307,19 @@ protected function process_coursework_person_deadline($data) {
$data->courseworkid=$this->get_new_parentid('coursework');
$data->createdbyid = $this->get_mappingid('user', $data->createdbyid);
- $data->lastmodifiedbyid=$this->get_mappingid('user',$data->lastmodifiedbyid);
+ $data->lastmodifiedbyid=$this->get_mappingid('user', $data->lastmodifiedbyid);
$this->fixallocatable($data);
$this->updatedate(array('personal_deadline',
'timecreated',
- 'timemodified'),$data);
+ 'timemodified'), $data);
$now=time();
$this->set_defaults(array('personal_deadline' => 0,
'timecreated' => $now,
'timemodified' => 0,
- 'lastmodifiedbyid' => 0),$data);
+ 'lastmodifiedbyid' => 0), $data);
global $DB;
$newitemid = $DB->insert_record('coursework_person_deadlines', $data);
@@ -334,19 +334,19 @@ protected function process_coursework_mod_agreement($data) {
$data->feedbackid=$this->get_new_parentid('coursework_feedback');
$data->moderatorid = $this->get_mappingid('user', $data->moderatorid);
- $data->lastmodifiedby=$this->get_mappingid('user',$data->lastmodifiedby);
+ $data->lastmodifiedby=$this->get_mappingid('user', $data->lastmodifiedby);
$this->fixallocatable($data);
$this->updatedate(array('timecreated',
- 'timemodified'),$data);
+ 'timemodified'), $data);
$now=time();
$this->set_defaults(array('timecreated' => $now,
'timemodified' => $now,
'lasteditedby' => 0,
'modcomment' => '',
- 'modcommentformat' => 1),$data);
+ 'modcommentformat' => 1), $data);
global $DB;
$newitemid = $DB->insert_record('coursework_mod_agreements', $data);
@@ -358,19 +358,19 @@ protected function process_coursework_plagiarism_flag($data) {
$data->submissionid=$this->get_new_parentid('coursework_submission');
$data->createdby = $this->get_mappingid('user', $data->createdby);
- $data->lastmodifiedby=$this->get_mappingid('user',$data->lastmodifiedby);
+ $data->lastmodifiedby=$this->get_mappingid('user', $data->lastmodifiedby);
$this->fixallocatable($data);
$this->updatedate(array('timecreated',
- 'timemodified'),$data);
+ 'timemodified'), $data);
$now=time();
$this->set_defaults(array('timecreated' => $now,
'timemodified' => $now,
'lastmodifieddby' => 0,
'comment' => '',
- 'comment_format' => 1),$data);
+ 'comment_format' => 1), $data);
global $DB;
$newitemid = $DB->insert_record('coursework_plagiarism_flags', $data);
@@ -393,7 +393,7 @@ protected function process_coursework($data) {
'timecreated',
'startdate',
'generalfeedbacktimepublished',
- 'deadline'),$data);
+ 'deadline'), $data);
$now=time();
//Taken from install.xml
@@ -466,7 +466,7 @@ protected function process_coursework($data) {
'plagiarismflagenabled' => 0,
'processunenrol' => 0), $data);
- $this->check_grade('grade',$data);
+ $this->check_grade('grade', $data);
$newitemid = $DB->insert_record('coursework', $data);
@@ -504,7 +504,7 @@ protected function after_execute() {
$fs=get_file_storage();
$ctx=context::instance_by_id($this->task->get_contextid());
- $files=$fs->get_area_files($ctx->id,'mod_coursework','submission'); //Array of stored_file
+ $files=$fs->get_area_files($ctx->id, 'mod_coursework', 'submission'); //Array of stored_file
foreach($files as $file) {
if (!$file->is_directory()) {
diff --git a/classes/ability.php b/classes/ability.php
index 640dbcd4..cac4802c 100644
--- a/classes/ability.php
+++ b/classes/ability.php
@@ -501,7 +501,7 @@ function (submission $submission) {
$ok_to_submit_late = $submission->get_coursework()->allow_late_submissions();
$coursework = $submission->get_coursework();
$submitting_allocatable = $coursework->submiting_allocatable_for_student($this->get_user());
- if ($deadline_passed && !deadline_extension::allocatable_extension_allows_submission($submitting_allocatable,$coursework)) {
+ if ($deadline_passed && !deadline_extension::allocatable_extension_allows_submission($submitting_allocatable, $coursework)) {
if (!$ok_to_submit_late) {
$this->set_message('Cannot submit past the deadline');
return true;
diff --git a/classes/allocation/manager.php b/classes/allocation/manager.php
index a91b8d4f..7579eca9 100644
--- a/classes/allocation/manager.php
+++ b/classes/allocation/manager.php
@@ -194,8 +194,8 @@ public function auto_generate_moderation_set() {
* @return array
*/
public function get_sampling_options() {
- return array('0' => get_string('manual','mod_coursework'),
- '1' => get_string('automatic','mod_coursework'));
+ return array('0' => get_string('manual', 'mod_coursework'),
+ '1' => get_string('automatic', 'mod_coursework'));
}
@@ -255,7 +255,7 @@ public function save_sample_set_rule($assessor_number) {
global $CFG, $DB;
- $sampleplugins = $DB->get_records('coursework_sample_set_plugin',null,'pluginorder');
+ $sampleplugins = $DB->get_records('coursework_sample_set_plugin',null, 'pluginorder');
$order = 0;
foreach ($sampleplugins as $plugin) {
@@ -263,7 +263,7 @@ public function save_sample_set_rule($assessor_number) {
$rule = new $classname($this->coursework);
- $rule->save_form_data($assessor_number,$order);
+ $rule->save_form_data($assessor_number, $order);
}
@@ -297,7 +297,7 @@ private function get_coursework() {
public function auto_generate_sample_set() {
global $DB;
- $sampleplugins = $DB->get_records('coursework_sample_set_plugin',null,'pluginorder');
+ $sampleplugins = $DB->get_records('coursework_sample_set_plugin',null, 'pluginorder');
$order = 0;
@@ -329,7 +329,7 @@ public function auto_generate_sample_set() {
ORDER BY ruleorder)a";
- if ($sampleplugins = $DB->get_records_sql($sql,array('courseworkid' => $this->coursework->id,'stage' => $stage))) {
+ if ($sampleplugins = $DB->get_records_sql($sql,array('courseworkid' => $this->coursework->id, 'stage' => $stage))) {
//$allocatables = $this->get_coursework()->get_allocatables_with_feedback();
$allocatables = $this->get_coursework()->get_allocatables();
@@ -356,7 +356,7 @@ public function auto_generate_sample_set() {
$rule = new $classname($this->coursework);
- $rule->adjust_sample_set($stage_number,$allocatables,$manual_sample_set,$auto_sample_set);
+ $rule->adjust_sample_set($stage_number, $allocatables, $manual_sample_set, $auto_sample_set);
}
@@ -398,7 +398,7 @@ public function get_include_in_sample_set($stage_number) {
//get all users in manually selected for stage in coursework
return $DB->get_records_sql($sql,
- array('courseworkid' => $this->coursework->id,'stage_identifier' => $stage));
+ array('courseworkid' => $this->coursework->id, 'stage_identifier' => $stage));
}
@@ -419,7 +419,7 @@ public function get_automatic_with_feedback($stage) {
AND f.stage_identifier = m.stage_identifier
";
- return $DB->get_records_sql($sql,array('courseworkid' => $this->coursework->id,'stage' => $stage));
+ return $DB->get_records_sql($sql,array('courseworkid' => $this->coursework->id, 'stage' => $stage));
}
diff --git a/classes/allocation/strategy/none.php b/classes/allocation/strategy/none.php
index 0ca51bc1..471a78b7 100644
--- a/classes/allocation/strategy/none.php
+++ b/classes/allocation/strategy/none.php
@@ -48,7 +48,7 @@ public function autoallocation_enabled() {
* @return string
*/
public function add_form_elements($strategypurpose = 'assessor') {
- global $PAGE,$CFG;
+ global $PAGE, $CFG;
$url = "$CFG->wwwroot/mod/coursework/actions/upload_allocations.php?cmid={$PAGE->cm->id}";
$html = html_writer::link($url,get_string('uploadallocations', 'mod_coursework'));
diff --git a/classes/allocation/table/cell/builder.php b/classes/allocation/table/cell/builder.php
index 7f739c12..7adf7836 100644
--- a/classes/allocation/table/cell/builder.php
+++ b/classes/allocation/table/cell/builder.php
@@ -304,7 +304,7 @@ private function sampling_set_checkbox() {
$checkbox_checked = 1;
}
- $checkbox_checked = $this->checkbox_checked_in_session($checkbox_name,$checkbox_checked);
+ $checkbox_checked = $this->checkbox_checked_in_session($checkbox_name, $checkbox_checked);
$checkbox_title = 'Included in sample';
@@ -359,7 +359,7 @@ private function has_automatic_sampling() {
- return $DB->record_exists('coursework_sample_set_mbrs',$params);
+ return $DB->record_exists('coursework_sample_set_mbrs', $params);
}
/**
@@ -378,7 +378,7 @@ private function pinned_checkbox() {
}
}
- $checkbox_checked = $this->checkbox_checked_in_session($checkbox_name,$checkbox_checked);
+ $checkbox_checked = $this->checkbox_checked_in_session($checkbox_name, $checkbox_checked);
$stage = substr($this->get_stage()->identifier(), -1);
$checkbox_title = 'Pinned (auto allocations will not alter this)';
@@ -392,7 +392,7 @@ private function pinned_checkbox() {
- private function checkbox_checked_in_session($checkboxname,$checkboxstate) {
+ private function checkbox_checked_in_session($checkboxname, $checkboxstate) {
global $SESSION;
diff --git a/classes/allocation/table/cell/processor.php b/classes/allocation/table/cell/processor.php
index e8a76dc0..a6e08a43 100644
--- a/classes/allocation/table/cell/processor.php
+++ b/classes/allocation/table/cell/processor.php
@@ -183,7 +183,7 @@ private function has_automatic_sampling() {
'stage_identifier' => $this->get_stage()->identifier(),
'selectiontype' => 'automatic');
- return $DB->record_exists('coursework_sample_set_mbrs',$params);
+ return $DB->record_exists('coursework_sample_set_mbrs', $params);
}
}
diff --git a/classes/allocation/upload.php b/classes/allocation/upload.php
index dfa681fc..d50e7009 100644
--- a/classes/allocation/upload.php
+++ b/classes/allocation/upload.php
@@ -45,7 +45,7 @@ public function __construct($coursework) {
* @return array|bool
* @throws \moodle_exception
*/
- public function validate_csv($content,$encoding,$delimeter){
+ public function validate_csv($content, $encoding, $delimeter){
global $CFG, $DB;
$assessor_identifier = $CFG->coursework_allocation_identifier;
@@ -196,7 +196,7 @@ public function process_csv($content, $encoding, $delimiter, $processingresults)
while ($line = $csvreader->next()) {
//we will not process the content of any line that has been flagged up with an error
- if ( is_array($processingresults) && array_key_exists($s,$processingresults) ) {
+ if ( is_array($processingresults) && array_key_exists($s, $processingresults) ) {
$s++;
continue;
}
diff --git a/classes/controllers/feedback_controller.php b/classes/controllers/feedback_controller.php
index cf5982e0..c6a88c30 100644
--- a/classes/controllers/feedback_controller.php
+++ b/classes/controllers/feedback_controller.php
@@ -79,7 +79,7 @@ protected function show_feedback() {
$ability->require_can('show', $teacherfeedback);
$renderer = $this->get_page_renderer();
- $html = $renderer->show_feedback_page($teacherfeedback,$ajax);
+ $html = $renderer->show_feedback_page($teacherfeedback, $ajax);
@@ -264,7 +264,7 @@ protected function create_feedback() {
if ($teacherfeedback->stage_identifier == 'assessor_1' || $teacherfeedback->stage_identifier == 'assessor_2') {
$jsonarray['assessorname'] = (empty($feedback_row->get_assessor()->id()) && $coursework->allocation_enabled()) ?
- get_string('assessornotallocated','mod_coursework') : $cell_object->profile_link($feedback_row);
+ get_string('assessornotallocated', 'mod_coursework') : $cell_object->profile_link($feedback_row);
$jsonarray['assessdate'] = $cell_object->date_for_column($feedback_row);
if ($teacherfeedback->stage_identifier == 'assessor_1') {
@@ -272,7 +272,7 @@ protected function create_feedback() {
$stage = new assessor($coursework, 'assessor_2');
$assessor_feedback_row = new assessor_feedback_row($stage, $feedback_row->get_allocatable(), $coursework);
- $assessortwocell = $cell_object->get_grade_cell_content($assessor_feedback_row,$coursework,$ability);
+ $assessortwocell = $cell_object->get_grade_cell_content($assessor_feedback_row, $coursework, $ability);
//$jsonarray['assessortwo'] =$assessortwocell;
if (strpos($assessortwocell, 'new_feedback') !== false) $jsonarray['assessortwo'] = $assessortwocell;
@@ -285,7 +285,7 @@ protected function create_feedback() {
if ($coursework->automaticagreementrange != 'none' && !empty($finalfeedback) && $finalsubmission->all_inital_graded()) {
$finalstage = new assessor($coursework, "final_agreed_1");
$finalfeedback_row = new assessor_feedback_row($finalstage, $participant, $coursework);
- $agreed_grade_object = new multiple_agreed_grade_cell(array('coursework' => $coursework,'stage' => $finalstage));
+ $agreed_grade_object = new multiple_agreed_grade_cell(array('coursework' => $coursework, 'stage' => $finalstage));
$jsonarray['finalhtml'] = $agreed_grade_object->get_table_cell($finalfeedback_row);
$jsonarray['allocatableid'] = $submission->get_allocatable()->id();
}
@@ -348,7 +348,7 @@ protected function update_feedback() {
if (!$this->params['confirm']) {
$urlparams = array('confirm' => $this->params['confirm'],
- 'remove' => $this->params['remove'],'feedbackid' => $this->params['feedbackid'],'finalised' => $this->params['finalised']);
+ 'remove' => $this->params['remove'], 'feedbackid' => $this->params['feedbackid'], 'finalised' => $this->params['finalised']);
$PAGE->set_url('/mod/coursework/actions/feedbacks/edit.php', $urlparams);
@@ -356,15 +356,15 @@ protected function update_feedback() {
$confirmurl = new \moodle_url('/mod/coursework/actions/feedbacks/update.php');
$confirmurl->param('confirm', 1);
$confirmurl->param('removefeedbackbutton', 1);
- $confirmurl->param('feedbackid',$this->params['feedbackid']);
- $confirmurl->param('finalised',$this->params['finalised']);
+ $confirmurl->param('feedbackid', $this->params['feedbackid']);
+ $confirmurl->param('finalised', $this->params['finalised']);
$cancelurl = clone $PAGE->url;
$cancelurl->param('removefeedbackbutton', 0);
- $cancelurl->param('feedbackid',$this->params['feedbackid']);
- $cancelurl->param('finalised',$this->params['finalised']);
+ $cancelurl->param('feedbackid', $this->params['feedbackid']);
+ $cancelurl->param('finalised', $this->params['finalised']);
$renderer = $this->get_page_renderer();
- return $renderer->confirm_feedback_removal_page($teacherfeedback,$confirmurl,$cancelurl);
+ return $renderer->confirm_feedback_removal_page($teacherfeedback, $confirmurl, $cancelurl);
//$OUTPUT->confirm(get_string('confirmremovefeedback', 'mod_coursework'), $confirmurl, $PAGE->url);
@@ -458,7 +458,7 @@ protected function update_feedback() {
if ($teacherfeedback->stage_identifier == 'assessor_1' || $teacherfeedback->stage_identifier == 'assessor_2') {
$jsonarray['assessorname'] = (empty($feedback_row->get_assessor()->id()) && $coursework->allocation_enabled()) ?
- get_string('assessornotallocated','mod_coursework') : $cell_object->profile_link($feedback_row);
+ get_string('assessornotallocated', 'mod_coursework') : $cell_object->profile_link($feedback_row);
$jsonarray['assessdate'] = $cell_object->date_for_column($feedback_row);
if ($teacherfeedback->stage_identifier == 'assessor_1') {
@@ -466,7 +466,7 @@ protected function update_feedback() {
$stage = new assessor($coursework, 'assessor_2');
$assessor_feedback_row = new assessor_feedback_row($stage, $feedback_row->get_allocatable(), $coursework);
- $assessortwocell = $cell_object->get_grade_cell_content($assessor_feedback_row,$coursework,$ability);
+ $assessortwocell = $cell_object->get_grade_cell_content($assessor_feedback_row, $coursework, $ability);
//$jsonarray['assessortwo'] =$assessortwocell;
if (strpos($assessortwocell, 'new_feedback') !== false) $jsonarray['assessortwo'] = $assessortwocell;
diff --git a/classes/controllers/submissions_controller.php b/classes/controllers/submissions_controller.php
index 96d64536..5372d30b 100644
--- a/classes/controllers/submissions_controller.php
+++ b/classes/controllers/submissions_controller.php
@@ -172,7 +172,7 @@ protected function create_submission() {
if ($submission->finalised) {
if (!$submission->get_coursework()->has_deadline()) {
- $userids = explode(',',$submission->get_coursework()->get_submission_notification_users());
+ $userids = explode(',', $submission->get_coursework()->get_submission_notification_users());
if (!empty($userids)) {
foreach($userids as $u) {
@@ -339,8 +339,8 @@ protected function unfinalise_submission() {
$allocatableids = (!is_array($this->params['allocatableid'])) ? array($this->params['allocatableid']) : $this->params['allocatableid'] ;
$personaldeadline_page_url = new \moodle_url('/mod/coursework/actions/personal_deadline.php',
- array('id' => $this->coursework->get_coursemodule_id(),'multipleuserdeadlines' => 1,'setpersonaldeadlinespage' => 1,
- 'courseworkid' => $this->params['courseworkid'],'allocatabletype' => $this->params['allocatabletype']));
+ array('id' => $this->coursework->get_coursemodule_id(), 'multipleuserdeadlines' => 1, 'setpersonaldeadlinespage' => 1,
+ 'courseworkid' => $this->params['courseworkid'], 'allocatabletype' => $this->params['allocatabletype']));
$changedeadlines = false;
@@ -354,7 +354,7 @@ protected function unfinalise_submission() {
if ($submission->can_be_unfinalised()) {
$submission->finalised = 0;
$submission->save();
- $personaldeadline_page_url->param("allocatableid_arr[$aid]",$aid);
+ $personaldeadline_page_url->param("allocatableid_arr[$aid]", $aid);
$changedeadlines = true;
}
}
diff --git a/classes/cron.php b/classes/cron.php
index 127b4c5b..46e104bc 100644
--- a/classes/cron.php
+++ b/classes/cron.php
@@ -240,7 +240,7 @@ private static function send_first_reminders_to_admins() {
}
$user->coursework_name = $coursework_instance->name;
- $user->deadline = userdate($coursework_instance->get_deadline(),'%a, %d %b %Y, %H:%M');
+ $user->deadline = userdate($coursework_instance->get_deadline(), '%a, %d %b %Y, %H:%M');
$user->day_hour = coursework_seconds_to_string($coursework_instance->get_deadline() - time());
$subject = get_string('cron_email_subject_admin', 'mod_coursework', $user);
diff --git a/classes/export/csv.php b/classes/export/csv.php
index 3a8a2a5c..915aae2f 100644
--- a/classes/export/csv.php
+++ b/classes/export/csv.php
@@ -105,7 +105,7 @@ public function export(){
* @param $csv_cells
* @return array
*/
- public function add_cells_to_array($submission,$student,$csv_cells){
+ public function add_cells_to_array($submission, $student, $csv_cells){
$row = array();
foreach($csv_cells as $csv_cell) {
if (substr($csv_cell,0,8) == 'assessor'){
@@ -117,21 +117,21 @@ public function add_cells_to_array($submission,$student,$csv_cells){
if (substr($csv_cell,0,8) == 'assessor'){
$cell = $cell->get_cell($submission, $student, $stage_dentifier);
if (is_array($cell)){
- $row = array_merge($row,$cell);
+ $row = array_merge($row, $cell);
} else {
$row[] = $cell;
}
} else if ($csv_cell != 'stages' && $csv_cell != 'moderationagreement' && $csv_cell != 'otherassessors'){
$cell = $cell->get_cell($submission, $student, false);
if (is_array($cell)){
- $row = array_merge($row,$cell);
+ $row = array_merge($row, $cell);
} else{
$row[] = $cell;
}
} else {
$stages = $cell->get_cell($submission, $student, false);
- $row = array_merge($row,$stages);
+ $row = array_merge($row, $stages);
}
}
@@ -155,7 +155,7 @@ public function add_headers($csv_headers){
if (substr($header,0,8) == 'assessor'){
$head = $cell->get_header($stage);
if (is_array($head)){
- $headers = array_merge($headers,$head);
+ $headers = array_merge($headers, $head);
} else{
$headers[$header.$stage] = $head;
}
@@ -163,13 +163,13 @@ public function add_headers($csv_headers){
} else if ($header != 'stages' && $header != 'moderationagreement' && $header != 'otherassessors' ) {
$head = $cell->get_header(false);
if (is_array($head)){
- $headers = array_merge($headers,$head);
+ $headers = array_merge($headers, $head);
} else{
$headers[$header] = $head;
}
} else {
$array_headers = $cell->get_header(false);
- $headers = array_merge($headers,$array_headers);
+ $headers = array_merge($headers, $array_headers);
}
}
diff --git a/classes/export/csv/cells/agreedfeedback_cell.php b/classes/export/csv/cells/agreedfeedback_cell.php
index 667bb397..3455db58 100644
--- a/classes/export/csv/cells/agreedfeedback_cell.php
+++ b/classes/export/csv/cells/agreedfeedback_cell.php
@@ -55,15 +55,15 @@ public function get_header($stage){
- public function validate_cell($value,$submissionid,$stage_identifier='',$uploadedgradecells = array()) {
+ public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = array()) {
- global $DB,$PAGE,$USER;
+ global $DB, $PAGE, $USER;
$stage_identifier = 'final_agreed_1';
$agreedgradecap = array('mod/coursework:addagreedgrade','mod/coursework:editagreedgrade',
'mod/coursework:addallocatedagreedgrade','mod/coursework:editallocatedagreedgrade');
- if (has_any_capability($agreedgradecap,$PAGE->context)
+ if (has_any_capability($agreedgradecap, $PAGE->context)
|| has_capability('mod/coursework:administergrades', $PAGE->context)) {
$subdbrecord = $DB->get_record('coursework_submissions',array('id' => $submissionid));
@@ -98,10 +98,10 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade
$new_feedback = feedback::build($feedback_params);
//this is a new feedback check it against the new ability checks
- if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !has_capability('mod/coursework:addallocatedagreedgrade', $PAGE->context) && !$ability->can('new',$new_feedback)) return get_string('nopermissiontogradesubmission','coursework');
+ if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !has_capability('mod/coursework:addallocatedagreedgrade', $PAGE->context) && !$ability->can('new', $new_feedback)) return get_string('nopermissiontogradesubmission','coursework');
} else {
//this is a new feedback check it against the edit ability checks
- if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('edit',$feedback)) return get_string('nopermissiontoeditgrade','coursework');
+ if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade','coursework');
}
} else {
diff --git a/classes/export/csv/cells/agreedgrade_cell.php b/classes/export/csv/cells/agreedgrade_cell.php
index ae065e39..0d89f2fc 100644
--- a/classes/export/csv/cells/agreedgrade_cell.php
+++ b/classes/export/csv/cells/agreedgrade_cell.php
@@ -74,17 +74,17 @@ public function get_header($stage){
return $strings;
}
- public function validate_cell($value,$submissionid,$stage_identifier='', $uploadedgradecells = array()) {
+ public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = array()) {
- global $DB,$PAGE,$USER;
+ global $DB, $PAGE, $USER;
$stage_identifier = 'final_agreed_1';
- $agreedgradecap = array('mod/coursework:addagreedgrade','mod/coursework:editagreedgrade',
+ $agreedgradecap = array('mod/coursework:addagreedgrade', 'mod/coursework:editagreedgrade',
'mod/coursework:addallocatedagreedgrade','mod/coursework:editallocatedagreedgrade');
if (empty($value)) return true;
- if (has_any_capability($agreedgradecap,$PAGE->context)
+ if (has_any_capability($agreedgradecap, $PAGE->context)
|| has_capability('mod/coursework:administergrades', $PAGE->context)) {
$errormsg = '';
@@ -185,10 +185,10 @@ public function validate_cell($value,$submissionid,$stage_identifier='', $upload
//this is a new feedback check it against the new ability checks
- if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !has_capability('mod/coursework:addallocatedagreedgrade', $PAGE->context) && !$ability->can('new',$new_feedback)) return get_string('nopermissiontogradesubmission','coursework');
+ if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !has_capability('mod/coursework:addallocatedagreedgrade', $PAGE->context) && !$ability->can('new', $new_feedback)) return get_string('nopermissiontogradesubmission','coursework');
} else {
//this is a new feedback check it against the edit ability checks
- if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('edit',$feedback)) return get_string('nopermissiontoeditgrade','coursework');
+ if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade','coursework');
}
@@ -242,7 +242,7 @@ function value_in_rubric($criteria, $value) {
* @param $csv_cells
*
*/
- function get_rubrics($coursework,$csv_cells) {
+ function get_rubrics($coursework, $csv_cells) {
if ($coursework->is_using_rubric() && $this->coursework->finalstagegrading != 1) {
@@ -258,17 +258,17 @@ function get_rubrics($coursework,$csv_cells) {
//find out the position of singlegrade
- $position = array_search('singlegrade',$csv_cells);
+ $position = array_search('singlegrade', $csv_cells);
//get all data from the position of the singlegrade to the length of rubricheaders
// $csv_cells = array_splice($csv_cells,5, 1, $rubricheaders);
- $start_cells = array_slice($csv_cells,0,$position,true);
- $end_cells = array_slice($csv_cells,$position+1,count($csv_cells),true);
+ $start_cells = array_slice($csv_cells,0, $position,true);
+ $end_cells = array_slice($csv_cells, $position+1,count($csv_cells),true);
- $cells = array_merge($start_cells,$rubricheaders);
+ $cells = array_merge($start_cells, $rubricheaders);
- $cells = array_merge($cells,$end_cells);
+ $cells = array_merge($cells, $end_cells);
diff --git a/classes/export/csv/cells/assessorfeedback_cell.php b/classes/export/csv/cells/assessorfeedback_cell.php
index ae8a76df..493501ed 100644
--- a/classes/export/csv/cells/assessorfeedback_cell.php
+++ b/classes/export/csv/cells/assessorfeedback_cell.php
@@ -76,15 +76,15 @@ public function get_header($stage){
return get_string('assessorfeedbackcsv', 'coursework', $stage);
}
- public function validate_cell($value,$submissionid,$stage_identifier='',$uploadedgradecells = array()) {
- global $DB,$PAGE,$USER;
+ public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = array()) {
+ global $DB, $PAGE, $USER;
$agreedgradecap = array('mod/coursework:addagreedgrade','mod/coursework:editagreedgrade');
$initialgradecap = array('mod/coursework:addinitialgrade','mod/coursework:editinitialgrade');
$subdbrecord = $DB->get_record('coursework_submissions',array('id' => $submissionid));
$submission = \mod_coursework\models\submission::find($subdbrecord);
- if (has_any_capability($agreedgradecap,$PAGE->context) && has_any_capability($initialgradecap,$PAGE->context)
+ if (has_any_capability($agreedgradecap, $PAGE->context) && has_any_capability($initialgradecap, $PAGE->context)
|| has_capability('mod/coursework:administergrades', $PAGE->context)) {
@@ -109,12 +109,12 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade
//does a feedback exist for this stage
if (!empty($feedback)) {
//this is a new feedback check it against the new ability checks
- if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('new',$feedback)) return get_string('nopermissiontoeditgrade','coursework');
+ if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('new', $feedback)) return get_string('nopermissiontoeditgrade','coursework');
} else {
//this is a new feedback check it against the edit ability checks
- if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('edit',$feedback)) return get_string('nopermissiontoeditgrade','coursework');
+ if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade','coursework');
}
@@ -136,7 +136,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade
);
if (!has_capability('mod/coursework:administergrades', $PAGE->context)
- && !$DB->get_record('coursework_allocation_pairs',$allocation_params)) return get_string('nopermissiontogradesubmission','coursework');
+ && !$DB->get_record('coursework_allocation_pairs', $allocation_params)) return get_string('nopermissiontogradesubmission','coursework');
}
diff --git a/classes/export/csv/cells/assessorgrade_cell.php b/classes/export/csv/cells/assessorgrade_cell.php
index d97dac2a..526c4262 100644
--- a/classes/export/csv/cells/assessorgrade_cell.php
+++ b/classes/export/csv/cells/assessorgrade_cell.php
@@ -105,7 +105,7 @@ public function get_header($stage){
}
- public function validate_cell($value,$submissionid,$stage_identifier='', $uploadedgradecells = array()) {
+ public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = array()) {
global $DB, $PAGE, $USER;
if (empty($value)) return true;
@@ -301,7 +301,7 @@ function value_in_rubric($criteria, $value) {
* @param $csv_cells
*
*/
- function get_rubrics($coursework,$csv_cells) {
+ function get_rubrics($coursework, $csv_cells) {
if ($coursework->is_using_rubric()) {
@@ -317,17 +317,17 @@ function get_rubrics($coursework,$csv_cells) {
//find out the position of singlegrade
- $position = array_search('singlegrade',$csv_cells);
+ $position = array_search('singlegrade', $csv_cells);
//get all data from the position of the singlegrade to the length of rubricheaders
// $csv_cells = array_splice($csv_cells,5, 1, $rubricheaders);
- $start_cells = array_slice($csv_cells,0,$position,true);
- $end_cells = array_slice($csv_cells,$position+1,count($csv_cells),true);
+ $start_cells = array_slice($csv_cells,0, $position,true);
+ $end_cells = array_slice($csv_cells, $position+1,count($csv_cells),true);
- $cells = array_merge($start_cells,$rubricheaders);
+ $cells = array_merge($start_cells, $rubricheaders);
- $cells = array_merge($cells,$end_cells);
+ $cells = array_merge($cells, $end_cells);
diff --git a/classes/export/csv/cells/cell_base.php b/classes/export/csv/cells/cell_base.php
index 6d0e4488..657c96c7 100644
--- a/classes/export/csv/cells/cell_base.php
+++ b/classes/export/csv/cells/cell_base.php
@@ -64,8 +64,8 @@ public function __construct($coursework) {
*/
public function can_view_hidden() {
- $viewanonymous = has_capability('mod/coursework:viewanonymous',$this->coursework->get_context());
- $exportgrade = has_capability('mod/coursework:canexportfinalgrades',$this->coursework->get_context());
+ $viewanonymous = has_capability('mod/coursework:viewanonymous', $this->coursework->get_context());
+ $exportgrade = has_capability('mod/coursework:canexportfinalgrades', $this->coursework->get_context());
return (!$this->coursework->blindmarking || $viewanonymous || $exportgrade);
}
@@ -78,7 +78,7 @@ public function can_view_hidden() {
*/
public function extension_exists($student){
- $extension = $this->extension->get_extension_for_student($student,$this->coursework);
+ $extension = $this->extension->get_extension_for_student($student, $this->coursework);
return ($this->coursework->extensions_enabled() && !empty($extension));
}
@@ -91,7 +91,7 @@ public function extension_exists($student){
*/
public function get_extension_date_for_csv($student){
- $extension = $this->extension->get_extension_for_student($student,$this->coursework);
+ $extension = $this->extension->get_extension_for_student($student, $this->coursework);
return userdate($extension->extended_deadline, $this->dateformat);
}
@@ -104,7 +104,7 @@ public function get_extension_date_for_csv($student){
*/
public function get_extension_extra_info_for_csv($student){
- $extension = $this->extension->get_extension_for_student($student,$this->coursework);
+ $extension = $this->extension->get_extension_for_student($student, $this->coursework);
return strip_tags($extension->extra_information_text);
}
@@ -117,7 +117,7 @@ public function get_extension_extra_info_for_csv($student){
*/
public function get_extension_reason_for_csv($student){
- $extension = $this->extension->get_extension_for_student($student,$this->coursework);
+ $extension = $this->extension->get_extension_for_student($student, $this->coursework);
$extension_reasons = $this->get_extension_predefined_reasons();
return (!empty($extension_reasons[$extension->pre_defined_reason])) ?
@@ -193,7 +193,7 @@ public function get_actual_grade($grade){
public function get_assessor_name($assessorid){
global $DB;
- $assessor = $DB->get_record('user',array('id' => $assessorid),'firstname, lastname');
+ $assessor = $DB->get_record('user',array('id' => $assessorid), 'firstname, lastname');
return $assessor->lastname .' '. $assessor->firstname;
}
@@ -207,7 +207,7 @@ public function get_assessor_name($assessorid){
public function get_assessor_username($assessorid) {
global $DB;
- $assessor = $DB->get_record('user',array('id' => $assessorid),'username');
+ $assessor = $DB->get_record('user',array('id' => $assessorid), 'username');
return $assessor->username;
}
@@ -263,7 +263,7 @@ public function get_stage_identifier_for_assessor($submission, $student){
* Function to validate cell for the file upload
* @return mixed
*/
- public function validate_cell($value,$submissions,$stage_dentifier='', $uploadedgradecells = array()){
+ public function validate_cell($value, $submissions, $stage_dentifier='', $uploadedgradecells = array()){
return true;
}
diff --git a/classes/export/csv/cells/cell_interface.php b/classes/export/csv/cells/cell_interface.php
index a32e0262..50536f5a 100644
--- a/classes/export/csv/cells/cell_interface.php
+++ b/classes/export/csv/cells/cell_interface.php
@@ -36,7 +36,7 @@ interface cell_interface {
* @param $stage_identifier
* @return mixed
*/
- public function get_cell($submission,$student,$stage_identifier);
+ public function get_cell($submission, $student, $stage_identifier);
/**
* @param $stage
@@ -50,7 +50,7 @@ public function get_header($stage);
* @param $stage_dentifier
* @return mixed
*/
- public function validate_cell($value,$submissions,$stage_dentifier='');
+ public function validate_cell($value, $submissions, $stage_dentifier='');
}
diff --git a/classes/export/csv/cells/feedbackcomments_cell.php b/classes/export/csv/cells/feedbackcomments_cell.php
index 45a3a1cf..88c7d7ad 100644
--- a/classes/export/csv/cells/feedbackcomments_cell.php
+++ b/classes/export/csv/cells/feedbackcomments_cell.php
@@ -57,7 +57,7 @@ public function get_header($stage){
}
- public function validate_cell($value, $submissionid, $stage_identifier='',$uploadedgradecells = array()) {
+ public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = array()) {
global $PAGE, $DB, $USER;
@@ -75,7 +75,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='',$uploa
if (has_capability('mod/coursework:administergrades', $PAGE->context)) return true;
//is the current user an assessor at any of this submissions grading stages or do they have administer grades
- if (!$this->coursework->is_assessor($USER) && !has_capability('mod/coursework:administergrades',$PAGE->context))
+ if (!$this->coursework->is_assessor($USER) && !has_capability('mod/coursework:administergrades', $PAGE->context))
return get_string('nopermissiontogradesubmission','coursework');
$ability = new ability(user::find($USER), $this->coursework);
@@ -98,10 +98,10 @@ public function validate_cell($value, $submissionid, $stage_identifier='',$uploa
//this is a new feedback check it against the new ability checks
- if (!$ability->can('new',$new_feedback)) return get_string('nopermissiontogradesubmission','coursework');
+ if (!$ability->can('new', $new_feedback)) return get_string('nopermissiontogradesubmission','coursework');
} else {
//this is a new feedback check it against the edit ability checks
- if (!$ability->can('edit',$feedback)) return get_string('nopermissiontoeditgrade','coursework');
+ if (!$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade','coursework');
}
} else {
return get_string('nopermissiontoimportgrade', 'coursework');
diff --git a/classes/export/csv/cells/singlegrade_cell.php b/classes/export/csv/cells/singlegrade_cell.php
index d66ff78c..14dfee8d 100644
--- a/classes/export/csv/cells/singlegrade_cell.php
+++ b/classes/export/csv/cells/singlegrade_cell.php
@@ -76,7 +76,7 @@ public function get_header($stage){
}
- public function validate_cell($value,$submissionid,$stage_identifier='',$uploadedgradecells = array()) {
+ public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = array()) {
global $PAGE, $DB, $USER;
@@ -146,13 +146,13 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade
$submission = \mod_coursework\models\submission::find($dbrecord);
//is this submission ready to be graded
- if (!$submission->ready_to_grade() && $submission->get_state() < \mod_coursework\models\submission::FULLY_GRADED) return get_string('submissionnotreadytograde','coursework');
+ if (!$submission->ready_to_grade() && $submission->get_state() < \mod_coursework\models\submission::FULLY_GRADED) return get_string('submissionnotreadytograde', 'coursework');
//if you have administer grades you can grade anything
if (has_capability('mod/coursework:administergrades', $PAGE->context)) return true;
//is the current user an assessor at any of this submissions grading stages or do they have administer grades
- if ($this->coursework->allocation_enabled() && !$this->coursework->is_assessor($USER) && !has_capability('mod/coursework:administergrades',$PAGE->context))
+ if ($this->coursework->allocation_enabled() && !$this->coursework->is_assessor($USER) && !has_capability('mod/coursework:administergrades', $PAGE->context))
return get_string('nopermissiontogradesubmission','coursework');
//has the submission been published if yes then no further grades are allowed
@@ -183,7 +183,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade
);
$feedback = feedback::find($feedback_params);
- //if (!$ability->can('edit',$feedback)) return get_string('nopermissiontoeditgrade','coursework');
+ //if (!$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade','coursework');
//does a feedback exist for this stage
if (empty($feedback)) {
@@ -197,10 +197,10 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade
//this is a new feedback check it against the new ability checks
- if (!$ability->can('new',$new_feedback)) return get_string('nopermissiontogradesubmission','coursework');
+ if (!$ability->can('new', $new_feedback)) return get_string('nopermissiontogradesubmission','coursework');
} else {
//this is a new feedback check it against the edit ability checks
- if (!$ability->can('edit',$feedback)) return get_string('nopermissiontoeditgrade','coursework');
+ if (!$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade','coursework');
}
} else {
@@ -248,7 +248,7 @@ function value_in_rubric($criteria, $value) {
* @param $csv_cells
*
*/
- function get_rubrics($coursework,$csv_cells) {
+ function get_rubrics($coursework, $csv_cells) {
if ($coursework->is_using_rubric()) {
@@ -264,17 +264,17 @@ function get_rubrics($coursework,$csv_cells) {
//find out the position of singlegrade
- $position = array_search('singlegrade',$csv_cells);
+ $position = array_search('singlegrade', $csv_cells);
//get all data from the position of the singlegrade to the length of rubricheaders
// $csv_cells = array_splice($csv_cells,5, 1, $rubricheaders);
- $start_cells = array_slice($csv_cells,0,$position,true);
- $end_cells = array_slice($csv_cells,$position+1,count($csv_cells),true);
+ $start_cells = array_slice($csv_cells,0, $position,true);
+ $end_cells = array_slice($csv_cells, $position+1,count($csv_cells),true);
- $cells = array_merge($start_cells,$rubricheaders);
+ $cells = array_merge($start_cells, $rubricheaders);
- $cells = array_merge($cells,$end_cells);
+ $cells = array_merge($cells, $end_cells);
diff --git a/classes/export/csv/cells/submissionfileid_cell.php b/classes/export/csv/cells/submissionfileid_cell.php
index a3d36766..af4ff1c8 100644
--- a/classes/export/csv/cells/submissionfileid_cell.php
+++ b/classes/export/csv/cells/submissionfileid_cell.php
@@ -47,7 +47,7 @@ public function get_header($stage){
return get_string('submissionfileid', 'coursework');
}
- public function validate_cell($value,$submissionid,$stage_dentifier='',$uploadedgradecells = array()) {
+ public function validate_cell($value, $submissionid, $stage_dentifier='', $uploadedgradecells = array()) {
global $DB;
if (empty($value)) {
diff --git a/classes/export/csv/cells/submissionid_cell.php b/classes/export/csv/cells/submissionid_cell.php
index 8be85e9d..f2713f27 100644
--- a/classes/export/csv/cells/submissionid_cell.php
+++ b/classes/export/csv/cells/submissionid_cell.php
@@ -47,7 +47,7 @@ public function get_header($stage){
return get_string('submissionid', 'coursework');
}
- public function validate_cell($value,$submissionid,$stage_dentifier='',$uploadedgradecells = array()) {
+ public function validate_cell($value, $submissionid, $stage_dentifier='', $uploadedgradecells = array()) {
global $DB;
return ($DB->record_exists('coursework_submissions',array('id' => $submissionid,'courseworkid' => $this->coursework->id()))) ? true: get_string('submissionnotfoundincoursework','coursework');
}
diff --git a/classes/export/grading_sheet.php b/classes/export/grading_sheet.php
index 8fee305a..1779712a 100644
--- a/classes/export/grading_sheet.php
+++ b/classes/export/grading_sheet.php
@@ -150,7 +150,7 @@ public static function cells_array($coursework){
global $PAGE;
// headers and data for csv
- $csv_cells = array('submissionid','submissionfileid');
+ $csv_cells = array('submissionid', 'submissionfileid');
if ($coursework->is_configured_to_have_group_submissions()){
$csv_cells[] = 'group';
diff --git a/classes/export/import.php b/classes/export/import.php
index 988a5045..ccef728d 100644
--- a/classes/export/import.php
+++ b/classes/export/import.php
@@ -57,7 +57,7 @@ public function validate_submissionfileid(){
* @throws \coding_exception
* @throws \moodle_exception
*/
- public function validate_csv($content,$encoding,$delimeter,$csv_cells) {
+ public function validate_csv($content, $encoding, $delimeter, $csv_cells) {
global $DB, $USER;
@@ -104,7 +104,7 @@ public function validate_csv($content,$encoding,$delimeter,$csv_cells) {
// if the csv headers count is different than expected return error
- if ((!$this->coursework->is_using_rubric() && sizeof($line) != sizeof($cells)) || ($this->coursework->is_using_rubric() && !$this->rubric_count_correct($cells,$line))) {$errors = get_string('incorrectfileformat', 'coursework'); break;}
+ if ((!$this->coursework->is_using_rubric() && sizeof($line) != sizeof($cells)) || ($this->coursework->is_using_rubric() && !$this->rubric_count_correct($cells, $line))) {$errors = get_string('incorrectfileformat', 'coursework'); break;}
$offset = 0;
@@ -115,7 +115,7 @@ public function validate_csv($content,$encoding,$delimeter,$csv_cells) {
for($z = 0; $z < count($line); $z++) {
$value = $line[$z];
- $stage_identifier = $this->get_stage_identifier($submissionid,$cells[$i]);
+ $stage_identifier = $this->get_stage_identifier($submissionid, $cells[$i]);
// remove numbers from cell names so they can be dynamically validated
if (substr($cells[$i],0,8) == 'assessor'){
@@ -130,7 +130,7 @@ public function validate_csv($content,$encoding,$delimeter,$csv_cells) {
$submissionid = $value;
}
- if (empty($submissionid)) $errors[$s][] = get_string('emptysubmissionid','coursework');
+ if (empty($submissionid)) $errors[$s][] = get_string('emptysubmissionid', 'coursework');
//offsets the position of that we extract the data from $line based on data that has been extracted before
@@ -146,7 +146,7 @@ public function validate_csv($content,$encoding,$delimeter,$csv_cells) {
$position = $i;
//get all data from the position of the grade to the length of rubricheaders
- $rubriclinedata = array_slice($line,$position + $offset, count($rubricheaders), true);
+ $rubriclinedata = array_slice($line, $position + $offset, count($rubricheaders), true);
//pass the rubric data in
$result = $cell->validate_cell($rubriclinedata, $submissionid, $stage_identifier, $uploadedgradecells);
@@ -176,7 +176,7 @@ public function validate_csv($content,$encoding,$delimeter,$csv_cells) {
}
- function rubric_count_correct($csvheader,$linefromimportedcsv) {
+ function rubric_count_correct($csvheader, $linefromimportedcsv) {
// get criteria of rubrics and match it to grade cells
if ($this->coursework->is_using_rubric()) {
@@ -196,7 +196,7 @@ function rubric_count_correct($csvheader,$linefromimportedcsv) {
foreach($csvheader as $ch) {
- if (strpos($ch,$type) !== false) {
+ if (strpos($ch, $type) !== false) {
if (empty($typepositions)) $typepositions = array();
@@ -214,7 +214,7 @@ function rubric_count_correct($csvheader,$linefromimportedcsv) {
$offset = 0;
foreach($typepositions as $position) {
- //if ($position = array_search($type,$csvheader)) {
+ //if ($position = array_search($type, $csvheader)) {
$class = "mod_coursework\\export\\csv\\cells\\{$type}_cell";
$cell = new $class($this->coursework);
@@ -315,7 +315,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
while ($line = $csvreader->next()) {
//we will not process the content of any line that has been flagged up with an error
- if ( is_array($processingresults) && array_key_exists($s,$processingresults) ) {
+ if ( is_array($processingresults) && array_key_exists($s, $processingresults) ) {
$s++;
continue;
}
@@ -332,9 +332,9 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
$csvline = array();
- //if ((!$this->coursework->is_using_rubric() && sizeof($line) != sizeof($cells)) || ($this->coursework->is_using_rubric() && !$this->rubric_count_correct($csv,$line))) {
+ //if ((!$this->coursework->is_using_rubric() && sizeof($line) != sizeof($cells)) || ($this->coursework->is_using_rubric() && !$this->rubric_count_correct($csv, $line))) {
//if (sizeof($line) != sizeof($cells)) {
- if ((!$this->coursework->is_using_rubric() && sizeof($line) != sizeof($cells)) || ($this->coursework->is_using_rubric() && !$this->rubric_count_correct($csv,$line))) {
+ if ((!$this->coursework->is_using_rubric() && sizeof($line) != sizeof($cells)) || ($this->coursework->is_using_rubric() && !$this->rubric_count_correct($csv, $line))) {
$errors = get_string('incorrectfileformat', 'coursework');
break;
@@ -368,7 +368,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
if (!$coursework->has_multiple_markers()) {
$stages['singlegrade'] = $this->get_stage_identifier($csvline['submissionid'], 'singlegrade');
- if (array_key_exists('agreedgrade',$csvline)) {
+ if (array_key_exists('agreedgrade', $csvline)) {
$stages['agreedgrade'] = 'final_agreed_1';
}
} else {
@@ -553,7 +553,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
&& !($stage == 'final_agreed_1' && $this->coursework->finalstagegrading)) ? true : false;
if (empty($grade)) {
- $cwfeedbackid = $this->add_grade($csvline['submissionid'], $csvline[$k], $csvline[$feedbackpointer], $stage,$stageusesrubric);
+ $cwfeedbackid = $this->add_grade($csvline['submissionid'], $csvline[$k], $csvline[$feedbackpointer], $stage, $stageusesrubric);
} else {
$cwfeedbackid = $this->get_coursework_feedback_id($csvline['submissionid'], $stage);
@@ -619,7 +619,7 @@ function get_value_rubric_levelid($criteria, $value) {
* @param $stage_identifier
* @return bool|int
*/
- public function add_grade($submissionid, $grade, $feedback, $stage_identifier,$uses_rubric=false){
+ public function add_grade($submissionid, $grade, $feedback, $stage_identifier, $uses_rubric=false){
global $DB, $USER;
// workout markernumber
@@ -657,7 +657,7 @@ public function add_grade($submissionid, $grade, $feedback, $stage_identifier,$u
if ($uses_rubric) {
$controller = $this->coursework->get_advanced_grading_active_controller();
//find out how many criteria there are
- $gradinginstance = $controller->get_or_create_instance(0, $USER->id,$feedbackid);
+ $gradinginstance = $controller->get_or_create_instance(0, $USER->id, $feedbackid);
$rubricgrade = $gradinginstance->submit_and_get_grade($grade, $feedbackid);
$add_grade->id = $feedbackid;
@@ -697,7 +697,7 @@ public function get_coursework_feedback_id($submissionid, $stage_identifier){
* @param $feedback
* @return bool]
*/
- public function edit_grade($cwfeedbackid, $grade, $feedback,$uses_rubric=false){
+ public function edit_grade($cwfeedbackid, $grade, $feedback, $uses_rubric=false){
global $DB, $USER;
if (!$uses_rubric) {
@@ -706,7 +706,7 @@ public function edit_grade($cwfeedbackid, $grade, $feedback,$uses_rubric=false){
} else {
$controller = $this->coursework->get_advanced_grading_active_controller();
//find out how many criteria there are
- $gradinginstance = $controller->get_or_create_instance(0, $USER->id,$cwfeedbackid);
+ $gradinginstance = $controller->get_or_create_instance(0, $USER->id, $cwfeedbackid);
$rubricgrade = $gradinginstance->submit_and_get_grade($grade, $cwfeedbackid);
$grade = $rubricgrade;
@@ -748,7 +748,7 @@ public function edit_grade($cwfeedbackid, $grade, $feedback,$uses_rubric=false){
* @throws \dml_missing_record_exception
* @throws \dml_multiple_records_exception
*/
- public function get_stage_identifier($submissionid,$cell_identifier) {
+ public function get_stage_identifier($submissionid, $cell_identifier) {
global $DB, $USER;
$submission = $DB->get_record('coursework_submissions', array('id' => $submissionid));
diff --git a/classes/file_importer.php b/classes/file_importer.php
index d48e618b..dcf96e88 100644
--- a/classes/file_importer.php
+++ b/classes/file_importer.php
@@ -33,7 +33,7 @@ class coursework_file_zip_importer {
- public function extract_zip_file($filename,$contextid) {
+ public function extract_zip_file($filename, $contextid) {
global $USER;
@@ -99,7 +99,7 @@ public function delete_import_files($contextid) {
* @param coursework $coursework
* @return string - The html response
*/
- public function import_zip_files($coursework,$feedbackstage,$overwritecurrent) {
+ public function import_zip_files($coursework, $feedbackstage, $overwritecurrent) {
global $CFG, $PAGE, $DB, $USER;
@set_time_limit(ASSIGNFEEDBACK_FILE_MAXFILEUNZIPTIME);
@@ -123,7 +123,7 @@ public function import_zip_files($coursework,$feedbackstage,$overwritecurrent) {
if ($allocatableid = $this->is_valid_feedback_file_filename($coursework, $file, $participants) ) {
- $subdbrecord = $DB->get_record('coursework_submissions',array('courseworkid' => $coursework->id(),'allocatableid' => $allocatableid,'allocatabletype' => $coursework->get_allocatable_type()));
+ $subdbrecord = $DB->get_record('coursework_submissions',array('courseworkid' => $coursework->id(), 'allocatableid' => $allocatableid, 'allocatabletype' => $coursework->get_allocatable_type()));
$submission = \mod_coursework\models\submission::find($subdbrecord);
@@ -185,7 +185,7 @@ public function import_zip_files($coursework,$feedbackstage,$overwritecurrent) {
}
} else {
- $results[$filename] = get_string('feedbacknotfound','mod_coursework');
+ $results[$filename] = get_string('feedbacknotfound', 'mod_coursework');
}
}
@@ -198,12 +198,12 @@ public function import_zip_files($coursework,$feedbackstage,$overwritecurrent) {
}
- public function is_valid_feedback_file_filename($coursework,$feedbackfile,$participants) {
+ public function is_valid_feedback_file_filename($coursework, $feedbackfile, $participants) {
$result = false;
- $filename = explode('.',$feedbackfile->get_filename());
+ $filename = explode('.', $feedbackfile->get_filename());
$filename = $filename[0];
if ($feedbackfile->is_directory()) {
@@ -232,7 +232,7 @@ public function is_valid_feedback_file_filename($coursework,$feedbackfile,$parti
}
- public function feedback_exists($coursework,$submission,$stageidentifier) {
+ public function feedback_exists($coursework, $submission, $stageidentifier) {
global $DB, $USER;
@@ -245,13 +245,13 @@ public function feedback_exists($coursework,$submission,$stageidentifier) {
$params = array('submissionid' => $submission->id,
'stage' => $stageidentifier);
- if (!has_capability('mod/coursework:administergrades',$coursework->get_context())) {
+ if (!has_capability('mod/coursework:administergrades', $coursework->get_context())) {
$sql .= "AND (assessorid = :assessorid || lasteditedbyuser = :lasteditedbyuser)";
$params['assessorid'] = $USER->id;
$params['lasteditedbyuser'] = $USER->id;
}
- return $DB->get_record_sql($sql,$params);
+ return $DB->get_record_sql($sql, $params);
}
diff --git a/classes/forms/student_submission_form.php b/classes/forms/student_submission_form.php
index 30fb0315..2b28c3fd 100644
--- a/classes/forms/student_submission_form.php
+++ b/classes/forms/student_submission_form.php
@@ -175,7 +175,7 @@ public function handle() {
if (!$submission->get_coursework()->has_deadline()) {
- $userids = explode(',',$submission->get_coursework()->get_submission_notification_users());
+ $userids = explode(',', $submission->get_coursework()->get_submission_notification_users());
if (!empty($userids)) {
foreach($userids as $u) {
@@ -358,7 +358,7 @@ protected function add_file_manager_to_form() {
$uploadfilestring,
null,
$this->get_file_manager_options());
- $this->_form->addRule('submission_manager', 'You must upload file(s) into the box below before you can save', 'required', null,'server',false,true);
+ $this->_form->addRule('submission_manager', 'You must upload file(s) into the box below before you can save', 'required', null, 'server',false,true);
}
diff --git a/classes/forms/upload_allocations_form.php b/classes/forms/upload_allocations_form.php
index cdd9faed..43b09d5b 100644
--- a/classes/forms/upload_allocations_form.php
+++ b/classes/forms/upload_allocations_form.php
@@ -38,11 +38,11 @@ function __construct($cmid) {
function definition() {
$mform =& $this->_form;
- $mform->addElement('filepicker', 'allocationsdata', get_string('allocationsfile','coursework'), null, array( 'accepted_types' => '*.csv'));
+ $mform->addElement('filepicker', 'allocationsdata', get_string('allocationsfile', 'coursework'), null, array( 'accepted_types' => '*.csv'));
$mform->addRule('allocationsdata', null, 'required');
- // $mform->addElement('checkbox','overwrite','',get_string('overwritegrades','coursework'));
- $mform->addElement('hidden','cmid',$this->cmid);
+ // $mform->addElement('checkbox', 'overwrite', '',get_string('overwritegrades', 'coursework'));
+ $mform->addElement('hidden', 'cmid', $this->cmid);
$mform->setType('cmid',PARAM_RAW);
@@ -61,7 +61,7 @@ function definition() {
$mform->setDefault('encoding', 'UTF-8');
- $this->add_action_buttons(true,get_string('uploadallocations','coursework'));
+ $this->add_action_buttons(true,get_string('uploadallocations', 'coursework'));
}
function display() {
diff --git a/classes/forms/upload_feedback_form.php b/classes/forms/upload_feedback_form.php
index b68634d4..910a58d9 100644
--- a/classes/forms/upload_feedback_form.php
+++ b/classes/forms/upload_feedback_form.php
@@ -48,12 +48,12 @@ function __construct($coursework, $cmid) {
function definition() {
$mform =& $this->_form;
- $mform->addElement('filepicker', 'feedbackzip', get_string('feedbackzipfile','coursework'), null, array( 'accepted_types' => '*.zip'));
+ $mform->addElement('filepicker', 'feedbackzip', get_string('feedbackzipfile', 'coursework'), null, array( 'accepted_types' => '*.zip'));
$mform->addRule('feedbackzip', null, 'required');
- $mform->addHelpButton('feedbackzip', 'feedbackzipfile','coursework');
+ $mform->addHelpButton('feedbackzip', 'feedbackzipfile', 'coursework');
- $mform->addElement('advcheckbox','overwrite','',get_string('overwritefeedback','coursework'),null,array(0,1));
- $mform->addElement('hidden','cmid',$this->cmid);
+ $mform->addElement('advcheckbox', 'overwrite', '',get_string('overwritefeedback', 'coursework'),null,array(0,1));
+ $mform->addElement('hidden', 'cmid', $this->cmid);
$mform->setType('cmid',PARAM_RAW);
$options = array();
@@ -61,10 +61,10 @@ function definition() {
if ($this->coursework->get_max_markers() > 1) {
$capability = array('mod/coursework:addinitialgrade', 'mod/coursework:editinitialgrade');
- if (has_any_capability($capability, $this->coursework->get_context()) && !has_capability('mod/coursework:administergrades',$this->coursework->get_context())) {
+ if (has_any_capability($capability, $this->coursework->get_context()) && !has_capability('mod/coursework:administergrades', $this->coursework->get_context())) {
$options['initialassessor'] = get_string('initialassessor', 'coursework');
- } else if (has_capability('mod/coursework:administergrades',$this->coursework->get_context())){
+ } else if (has_capability('mod/coursework:administergrades', $this->coursework->get_context())){
$options['assessor_1'] = get_string('assessorupload', 'coursework', '1');
if ($this->coursework->get_max_markers() >= 2) $options['assessor_2'] = get_string('assessorupload', 'coursework', '2');
if ($this->coursework->get_max_markers() >= 3) $options['assessor_3'] = get_string('assessorupload', 'coursework', '3');
@@ -75,21 +75,21 @@ function definition() {
$mform->addElement('select', 'feedbackstage', get_string('feedbackstage', 'coursework'), $options);
} else {
- $mform->addElement('hidden','feedbackstage','assessor_1');
+ $mform->addElement('hidden', 'feedbackstage', 'assessor_1');
$mform->setType('feedbackstage',PARAM_RAW);
}
// Disable overwrite current feedback files checkbox if user doesn't have edit capability
- if (!has_capability('mod/coursework:editinitialgrade',$this->coursework->get_context())) {
+ if (!has_capability('mod/coursework:editinitialgrade', $this->coursework->get_context())) {
$mform->disabledIf('overwrite', 'feedbackstage', 'eq', 'initialassessor');
}
- if (!has_capability('mod/coursework:editagreedgrade',$this->coursework->get_context()) && !has_capability('mod/coursework:administergrades',$this->coursework->get_context()) ) {
+ if (!has_capability('mod/coursework:editagreedgrade', $this->coursework->get_context()) && !has_capability('mod/coursework:administergrades', $this->coursework->get_context()) ) {
$mform->disabledIf('overwrite', 'feedbackstage', 'eq', 'final_agreed_1');
}
- $this->add_action_buttons(true,get_string('uploadfeedbackzip','coursework'));
+ $this->add_action_buttons(true,get_string('uploadfeedbackzip', 'coursework'));
}
function display() {
diff --git a/classes/forms/upload_grading_sheet_form.php b/classes/forms/upload_grading_sheet_form.php
index fc48e025..38d38bc0 100644
--- a/classes/forms/upload_grading_sheet_form.php
+++ b/classes/forms/upload_grading_sheet_form.php
@@ -46,11 +46,11 @@ function __construct($cmid) {
function definition() {
$mform =& $this->_form;
- $mform->addElement('filepicker', 'gradingdata', get_string('gradingsheetfile','coursework'), null, array( 'accepted_types' => '*.csv'));
+ $mform->addElement('filepicker', 'gradingdata', get_string('gradingsheetfile', 'coursework'), null, array( 'accepted_types' => '*.csv'));
$mform->addRule('gradingdata', null, 'required');
- $mform->addElement('checkbox','overwrite','',get_string('overwritegrades','coursework'));
- $mform->addElement('hidden','cmid',$this->cmid);
+ $mform->addElement('checkbox', 'overwrite', '',get_string('overwritegrades', 'coursework'));
+ $mform->addElement('hidden', 'cmid', $this->cmid);
$mform->setType('cmid',PARAM_RAW);
@@ -69,7 +69,7 @@ function definition() {
$mform->setDefault('encoding', 'UTF-8');
- $this->add_action_buttons(true,get_string('uploadgradingworksheet','coursework'));
+ $this->add_action_buttons(true,get_string('uploadgradingworksheet', 'coursework'));
}
function display() {
diff --git a/classes/forms/view_all_students_mform.php b/classes/forms/view_all_students_mform.php
index 9fbd97c9..74cfffde 100644
--- a/classes/forms/view_all_students_mform.php
+++ b/classes/forms/view_all_students_mform.php
@@ -37,7 +37,7 @@ function definition() {
$this->_form->setType('id', PARAM_INT);
- $buttontext = (empty($this->_customdata['displayallstudents'])) ? get_string('viewallstudents', 'coursework') : get_string('hideallstudents','coursework');
+ $buttontext = (empty($this->_customdata['displayallstudents'])) ? get_string('viewallstudents', 'coursework') : get_string('hideallstudents', 'coursework');
$hiddenvalue = (empty($this->_customdata['displayallstudents'])) ? 1 : 0;
$this->_form->addElement('submit', 'displayallstudentbutton', $buttontext);
$this->_form->addElement('hidden', 'displayallstudents', $hiddenvalue);
diff --git a/classes/grade_judge.php b/classes/grade_judge.php
index 3b630637..3b165aa7 100644
--- a/classes/grade_judge.php
+++ b/classes/grade_judge.php
@@ -193,7 +193,7 @@ public function grade_in_scale($value) {
// Scale
$scale = \grade_scale::fetch(array('id' => abs($this->coursework->grade)));
$scale->load_items();
- return in_array($value,$scale->scale_items);
+ return in_array($value, $scale->scale_items);
}
}
@@ -209,7 +209,7 @@ public function get_grade($value) {
// Scale
$scale = \grade_scale::fetch(array('id' => abs($this->coursework->grade)));
$scale->load_items();
- return array_search($value,$scale->scale_items)+1;
+ return array_search($value, $scale->scale_items)+1;
} else {
return $value;
}
diff --git a/classes/mailer.php b/classes/mailer.php
index cd22fa9a..021c05fa 100644
--- a/classes/mailer.php
+++ b/classes/mailer.php
@@ -196,7 +196,7 @@ public function send_student_deadline_reminder($user) {
$email_data->coursework_name = $this->coursework->name;
$email_data->coursework_name_with_link = \html_writer::link($CFG->wwwroot . '/mod/coursework/view.php?id=' . $this->coursework->get_coursemodule_id(), $this->coursework->name);
$email_data->deadline = $user->deadline;
- $email_data->human_deadline = userdate($user->deadline,'%a, %d %b %Y, %H:%M');
+ $email_data->human_deadline = userdate($user->deadline, '%a, %d %b %Y, %H:%M');
$secondstodeadline = $user->deadline - time();
$days = floor($secondstodeadline / 86400);
diff --git a/classes/models/coursework.php b/classes/models/coursework.php
index 70d52a6b..a36519c4 100644
--- a/classes/models/coursework.php
+++ b/classes/models/coursework.php
@@ -981,7 +981,7 @@ public function pack_files() {
$foldername = '';
- if ($this->blindmarking == 0 || has_capability('mod/coursework:viewanonymous',$this->get_context())) {
+ if ($this->blindmarking == 0 || has_capability('mod/coursework:viewanonymous', $this->get_context())) {
$submissionuser = $submission->get_allocatable();
if ($this->is_configured_to_have_group_submissions() && $submissionuser->name) {
$foldername = $submissionuser->name . '_';
@@ -1407,7 +1407,7 @@ public function get_published_submissions(){
* @param int $userid
* @return string
*/
- static function get_name_hash($id,$userid,$time=1440000609) {
+ static function get_name_hash($id, $userid, $time=1440000609) {
if ($id < 1) {
return '';
}
@@ -1424,7 +1424,7 @@ static function get_name_hash($id,$userid,$time=1440000609) {
}
public function get_username_hash($userid) {
- return static::get_name_hash($this->id,$userid,$this->timecreated);
+ return static::get_name_hash($this->id, $userid, $this->timecreated);
}
/**
@@ -2468,7 +2468,7 @@ public function finalise_all() {
// build exclude sql
if (!empty($excludesubmissions)){
$excludesql = ' AND id NOT IN(';
- $excludesql .= implode(',',$excludesubmissions);
+ $excludesql .= implode(',', $excludesubmissions);
$excludesql .= ')';
}
}
@@ -2589,7 +2589,7 @@ public function get_coursework_submission_personal_deadlines(){
public function has_automatic_sampling_at_stage($stage) {
global $DB;
- return $DB->record_exists('coursework_sample_set_rules',array('courseworkid' => $this->id,'stage_identifier' => $stage));
+ return $DB->record_exists('coursework_sample_set_rules',array('courseworkid' => $this->id, 'stage_identifier' => $stage));
}
@@ -3010,7 +3010,7 @@ private function get_allocatable_extension($allocatable) {
if ($this->extensions_enabled() ) {
- $extensionrecord = $DB->get_record('coursework_extensions', array('courseworkid' => $this->id,'allocatableid' => $allocatable->id));
+ $extensionrecord = $DB->get_record('coursework_extensions', array('courseworkid' => $this->id, 'allocatableid' => $allocatable->id));
if (!empty($extensionrecord)) {
$extension = $extensionrecord->extended_deadline;
diff --git a/classes/models/outstanding_marking.php b/classes/models/outstanding_marking.php
index 3e4b4110..43b9bb87 100644
--- a/classes/models/outstanding_marking.php
+++ b/classes/models/outstanding_marking.php
@@ -38,23 +38,23 @@ public function __construct() {
* @param $userid
* @return int
*/
- public function get_to_grade_initial_count($cwkrecord,$userid){
+ public function get_to_grade_initial_count($cwkrecord, $userid){
$coursework = new \mod_coursework\models\coursework($cwkrecord);
$initialsubmissions = array();
- if ($this->should_get_to_mark_initial_grade_info($coursework->id,$userid)){
+ if ($this->should_get_to_mark_initial_grade_info($coursework->id, $userid)){
if (!$coursework->has_multiple_markers()) {
- $initialsubmissions = $this->get_single_marker_initial_grade_submissions_to_mark($coursework->id, $userid,$coursework->allocation_enabled());
+ $initialsubmissions = $this->get_single_marker_initial_grade_submissions_to_mark($coursework->id, $userid, $coursework->allocation_enabled());
} else if ($coursework->sampling_enabled() && !$coursework->allocation_enabled()) { //
- $initialsubmissions = $this->get_multiple_to_mark_sampled_initial_grade_submissions($coursework->id,$userid);
+ $initialsubmissions = $this->get_multiple_to_mark_sampled_initial_grade_submissions($coursework->id, $userid);
} else {
- $initialsubmissions = $this->get_multiple_to_mark_initial_grade_submissions($coursework->id,$userid,$coursework->get_max_markers(),$coursework->allocation_enabled());
+ $initialsubmissions = $this->get_multiple_to_mark_initial_grade_submissions($coursework->id, $userid, $coursework->get_max_markers(), $coursework->allocation_enabled());
}
}
@@ -68,7 +68,7 @@ public function get_to_grade_initial_count($cwkrecord,$userid){
* @param $userid
* @return int
*/
- public function get_to_grade_agreed_count($cwkrecord,$userid) {
+ public function get_to_grade_agreed_count($cwkrecord, $userid) {
$coursework = new \mod_coursework\models\coursework($cwkrecord);
@@ -76,9 +76,9 @@ public function get_to_grade_agreed_count($cwkrecord,$userid) {
//AGREED GRADE INFORMATION
- if ($this->should_get_to_mark_agreed_grade_info($coursework->id,$userid) && $coursework->has_multiple_markers()) {
+ if ($this->should_get_to_mark_agreed_grade_info($coursework->id, $userid) && $coursework->has_multiple_markers()) {
if (!$coursework->sampling_enabled()) {
- $agreedsubmissions = $this->get_to_grade_agreed_grade_submissions($coursework->id,$coursework->get_max_markers());
+ $agreedsubmissions = $this->get_to_grade_agreed_grade_submissions($coursework->id, $coursework->get_max_markers());
} else {
$agreedsubmissions = $this->get_to_grade_agreed_grade_sampled_submissions($coursework->id);
}
@@ -137,7 +137,7 @@ private function get_single_marker_initial_grade_submissions_to_mark($coursework
* @param $userid
* @return array
*/
- private function get_multiple_to_mark_sampled_initial_grade_submissions($courseworkid,$userid) {
+ private function get_multiple_to_mark_sampled_initial_grade_submissions($courseworkid, $userid) {
global $DB;
@@ -179,7 +179,7 @@ private function get_multiple_to_mark_sampled_initial_grade_submissions($coursew
* @param $allocationenabled
* @return array
*/
- private function get_multiple_to_mark_initial_grade_submissions($courseworkid,$userid,$numberofmarkers,$allocationenabled) {
+ private function get_multiple_to_mark_initial_grade_submissions($courseworkid, $userid, $numberofmarkers, $allocationenabled) {
global $DB;
@@ -233,7 +233,7 @@ private function get_multiple_to_mark_initial_grade_submissions($courseworkid,$u
* @param $numberofmarkers
* @return array
*/
- private function get_to_grade_agreed_grade_submissions($courseworkid,$numberofmarkers){
+ private function get_to_grade_agreed_grade_submissions($courseworkid, $numberofmarkers){
global $DB;
@@ -290,11 +290,11 @@ private function get_to_grade_agreed_grade_sampled_submissions($courseworkid) {
* @param $user_id
* @return bool
*/
- private function has_agreed_grade($course_id,$user_id) {
+ private function has_agreed_grade($course_id, $user_id) {
$coursecontext = \context_course::instance($course_id);
- return has_capability('mod/coursework:addagreedgrade',$coursecontext,$user_id) || has_capability('mod/coursework:addallocatedagreedgrade',$coursecontext,$user_id);
+ return has_capability('mod/coursework:addagreedgrade', $coursecontext, $user_id) || has_capability('mod/coursework:addallocatedagreedgrade', $coursecontext, $user_id);
}
@@ -303,11 +303,11 @@ private function has_agreed_grade($course_id,$user_id) {
* @param $user_id
* @return bool
*/
- private function has_initial_grade($course_id,$user_id) {
+ private function has_initial_grade($course_id, $user_id) {
$coursecontext = \context_course::instance($course_id);
- return has_capability('mod/coursework:addinitialgrade',$coursecontext,$user_id);
+ return has_capability('mod/coursework:addinitialgrade', $coursecontext, $user_id);
}
@@ -316,7 +316,7 @@ private function has_initial_grade($course_id,$user_id) {
* @param $userid
* @return bool
*/
- private function should_get_to_mark_initial_grade_info($courseworkid,$userid) {
+ private function should_get_to_mark_initial_grade_info($courseworkid, $userid) {
$coursework = new \mod_coursework\models\coursework($courseworkid);
@@ -331,7 +331,7 @@ private function should_get_to_mark_initial_grade_info($courseworkid,$userid) {
* @param $userid
* @return bool
*/
- private function should_get_to_mark_agreed_grade_info($courseworkid,$userid) {
+ private function should_get_to_mark_agreed_grade_info($courseworkid, $userid) {
$coursework = new \mod_coursework\models\coursework($courseworkid);
diff --git a/classes/models/submission.php b/classes/models/submission.php
index 2247f82a..49cc02c0 100644
--- a/classes/models/submission.php
+++ b/classes/models/submission.php
@@ -1414,7 +1414,7 @@ public function final_draft_feedbacks_exist() {
AND cf.timecreated + c.gradeeditingtime > :time
";
- $editablefeedbacks = $DB->get_records_sql($sql,array('submissionid' => $this->id,'time' => time()));
+ $editablefeedbacks = $DB->get_records_sql($sql,array('submissionid' => $this->id, 'time' => time()));
return (empty($editablefeedbacks)) ? false : $editablefeedbacks;
}
@@ -1426,9 +1426,9 @@ function can_add_tii_grademark() {
$canadd = false;
if ($this->get_coursework()->get_max_markers() == 1) {
- $canadd = (has_any_capability(array('mod/coursework:addinitialgrade','mod/coursework:addministergrades'),$this->get_context()) && $this->ready_to_grade()) ;
+ $canadd = (has_any_capability(array('mod/coursework:addinitialgrade', 'mod/coursework:addministergrades'), $this->get_context()) && $this->ready_to_grade()) ;
} else {
- $canadd = (has_any_capability(array('mod/coursework:addagreedgrade','mod/coursework:addallocatedagreedgrade','mod/coursework:addministergrades'),$this->get_context()) && $this->all_inital_graded()) ;
+ $canadd = (has_any_capability(array('mod/coursework:addagreedgrade', 'mod/coursework:addallocatedagreedgrade', 'mod/coursework:addministergrades'), $this->get_context()) && $this->all_inital_graded()) ;
}
return $canadd;
diff --git a/classes/render_helpers/grading_report/cells/cell_base.php b/classes/render_helpers/grading_report/cells/cell_base.php
index 78079969..7c9c97d8 100644
--- a/classes/render_helpers/grading_report/cells/cell_base.php
+++ b/classes/render_helpers/grading_report/cells/cell_base.php
@@ -55,7 +55,7 @@ public function __construct($items = array()) {
* @param string $sortby The current sort from the URL.
* @return string
*/
- protected function helper_sortable_heading($display_name, $field, $sort_how, $sortby = '',$tablename='') {
+ protected function helper_sortable_heading($display_name, $field, $sort_how, $sortby = '', $tablename='') {
global $PAGE;
diff --git a/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php b/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
index 80d05c98..661db2be 100644
--- a/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
+++ b/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
@@ -177,7 +177,7 @@ public function get_table_header($options = array()) {
$tablename = (isset($options['tablename'])) ? $options['tablename'] : '' ;
$column_name = get_string('agreedgrade', 'coursework');
- return $this->helper_sortable_heading($column_name, 'finalgrade', $options['sorthow'], $options['sortby'],$tablename);
+ return $this->helper_sortable_heading($column_name, 'finalgrade', $options['sorthow'], $options['sortby'], $tablename);
}
/**
diff --git a/classes/render_helpers/grading_report/cells/time_submitted_cell.php b/classes/render_helpers/grading_report/cells/time_submitted_cell.php
index 82a50987..cf84cfc5 100644
--- a/classes/render_helpers/grading_report/cells/time_submitted_cell.php
+++ b/classes/render_helpers/grading_report/cells/time_submitted_cell.php
@@ -145,7 +145,7 @@ public function prepare_content_cell($row_object) {
$deadline = $deadline ?? $coursework->deadline;
$content_time = [
- 'time' => date('d-m-Y H:i',$deadline),
+ 'time' => date('d-m-Y H:i', $deadline),
'time_content' => userdate($deadline),
'is_have_deadline' => ($coursework->deadline > 0)? 1 : 0,
];
diff --git a/classes/renderers/personal_deadline_renderer.php b/classes/renderers/personal_deadline_renderer.php
index 2c4b20be..6aafdff6 100644
--- a/classes/renderers/personal_deadline_renderer.php
+++ b/classes/renderers/personal_deadline_renderer.php
@@ -65,7 +65,7 @@ public function new_page($vars) {
$html .= '';
}
} else {
- $html = 'We wish to remind you that Student assignments for {$a->coursework_name} are due on {$a->deadline}. '. 'They have {$a->day_hour} to complete it
');
- $moodle_form->addElement('html', get_string('submissionsdeadlineinfo','mod_coursework'));
+ $moodle_form->addElement('html', get_string('submissionsdeadlineinfo', 'mod_coursework'));
$moodle_form->addElement('html', '
');
@@ -478,17 +478,17 @@ protected function add_initial_marking_deadline_field() {
if ($CFG->coursework_marking_deadline == 7 ) {
- $default_timestamp = strtotime('+1 weeks',$submission_deadline_timestamp);
+ $default_timestamp = strtotime('+1 weeks', $submission_deadline_timestamp);
} else if ($CFG->coursework_marking_deadline == 14 ) {
- $default_timestamp = strtotime('+2 weeks',$submission_deadline_timestamp);
+ $default_timestamp = strtotime('+2 weeks', $submission_deadline_timestamp);
} else if ($CFG->coursework_marking_deadline == 21 ) {
- $default_timestamp = strtotime('+3 weeks',$submission_deadline_timestamp);
+ $default_timestamp = strtotime('+3 weeks', $submission_deadline_timestamp);
}else if ($CFG->coursework_marking_deadline == 28 ) {
- $default_timestamp = strtotime('+4 weeks',$submission_deadline_timestamp);
+ $default_timestamp = strtotime('+4 weeks', $submission_deadline_timestamp);
} else if ($CFG->coursework_marking_deadline == 35 ) {
- $default_timestamp = strtotime('+5 weeks',$submission_deadline_timestamp);
+ $default_timestamp = strtotime('+5 weeks', $submission_deadline_timestamp);
} else if ($CFG->coursework_marking_deadline == 42 ) {
- $default_timestamp = strtotime('+6 weeks',$submission_deadline_timestamp);
+ $default_timestamp = strtotime('+6 weeks', $submission_deadline_timestamp);
}
}
@@ -530,17 +530,17 @@ protected function add_agreed_grade_marking_deadline_field() {
if (!empty($CFG->coursework_agreed_marking_deadline)) {
$disabled = false;
if ($CFG->coursework_agreed_marking_deadline == 7 ) {
- $default_timestamp = strtotime('+1 weeks',$submission_deadline_timestamp);
+ $default_timestamp = strtotime('+1 weeks', $submission_deadline_timestamp);
} else if ($CFG->coursework_agreed_marking_deadline == 14 ) {
- $default_timestamp = strtotime('+2 weeks',$submission_deadline_timestamp);
+ $default_timestamp = strtotime('+2 weeks', $submission_deadline_timestamp);
} else if ($CFG->coursework_agreed_marking_deadline == 21 ) {
- $default_timestamp = strtotime('+3 weeks',$submission_deadline_timestamp);
+ $default_timestamp = strtotime('+3 weeks', $submission_deadline_timestamp);
} else if ($CFG->coursework_agreed_marking_deadline == 28 ) {
- $default_timestamp = strtotime('+4 weeks',$submission_deadline_timestamp);
+ $default_timestamp = strtotime('+4 weeks', $submission_deadline_timestamp);
} else if ($CFG->coursework_agreed_marking_deadline == 35 ) {
- $default_timestamp = strtotime('+5 weeks',$submission_deadline_timestamp);
+ $default_timestamp = strtotime('+5 weeks', $submission_deadline_timestamp);
} else if ($CFG->coursework_agreed_marking_deadline == 42 ) {
- $default_timestamp = strtotime('+6 weeks',$submission_deadline_timestamp);
+ $default_timestamp = strtotime('+6 weeks', $submission_deadline_timestamp);
}
}
@@ -651,7 +651,7 @@ protected function add_allow_early_finalisation_field() {
$options = array( 0 => get_string('no'), 1 => get_string('yes'));
$moodle_form->addElement('select',
'allowearlyfinalisation',
- get_string('allowearlyfinalisation', 'mod_coursework'),$options);
+ get_string('allowearlyfinalisation', 'mod_coursework'), $options);
$moodle_form->setType('allowearlyfinalisation', PARAM_INT);
$moodle_form->disabledIf('allowearlyfinalisation', 'deadline[enabled]', 'notchecked');
}
@@ -678,7 +678,7 @@ protected function add_use_groups_field() {
$moodle_form =& $this->_form;
$options = array( 0 => get_string('no'), 1 => get_string('yes'));
- $moodle_form->addElement('select', 'use_groups', get_string('use_groups', 'mod_coursework'),$options);
+ $moodle_form->addElement('select', 'use_groups', get_string('use_groups', 'mod_coursework'), $options);
$moodle_form->addHelpButton('use_groups', 'use_groups', 'mod_coursework');
}
@@ -754,7 +754,7 @@ protected function add_max_file_size_field() {
'maxbyteslabel',
'',
get_string('maximumsizelabel', 'coursework'));*/
- $moodle_form->addHelpButton('maxbytes','maximumsize','mod_coursework');
+ $moodle_form->addHelpButton('maxbytes', 'maximumsize', 'mod_coursework');
$moodle_form->disabledIf('maxbytes', 'use_turnitin', 'eq', '1');
$moodle_form->closeHeaderBefore('submissiontype');
@@ -785,7 +785,7 @@ protected function add_number_of_files_field() {
$choices);
$moodle_form->setDefault('maxfiles', 1);
$moodle_form->setType('maxfiles', PARAM_INT);
- $moodle_form->addHelpButton('maxfiles','maxfiles','mod_coursework');
+ $moodle_form->addHelpButton('maxfiles', 'maxfiles', 'mod_coursework');
}
@@ -796,7 +796,7 @@ protected function add_rename_file_field() {
$moodle_form =& $this->_form;
- $choices = array('0' => get_string('no'),'1' => get_string('yes'));
+ $choices = array('0' => get_string('no'), '1' => get_string('yes'));
$courseworkid = $this->get_coursework_id();
$courseworkhassubmissions = (!empty($courseworkid)) ?
$courseworkhassubmissions = $DB->get_records('coursework_submissions', array('courseworkid' => $courseworkid))
@@ -807,7 +807,7 @@ protected function add_rename_file_field() {
$moodle_form->addElement('select', 'renamefiles',
get_string('renamefiles', 'mod_coursework'), $choices);
- $moodle_form->addHelpButton('renamefiles','renamefiles','mod_coursework');
+ $moodle_form->addHelpButton('renamefiles', 'renamefiles', 'mod_coursework');
$moodle_form->disabledIf('renamefiles', 'blindmarking', 'eq', '1');
@@ -833,7 +833,7 @@ protected function add_rename_file_field() {
AND renamefiles = 1";
- $settingvalue = ($DB->get_records_sql($sql,array('courseworkid' => $courseworkid))) ? get_string('yesrenamefile','mod_coursework') : get_string('norenamefile','mod_coursework') ;
+ $settingvalue = ($DB->get_records_sql($sql,array('courseworkid' => $courseworkid))) ? get_string('yesrenamefile', 'mod_coursework') : get_string('norenamefile', 'mod_coursework') ;
$moodle_form->addElement('static', 'renamefilesdescription', get_string('renamefiles', 'mod_coursework'),
$settingvalue);
@@ -891,7 +891,7 @@ protected function add_enable_moderation_agreement_field(){
$moodle_form =& $this->_form;
$options = array(0 => get_string('no'), 1 => get_string('yes'));
- $moodle_form->addElement('select', 'moderationagreementenabled', get_string('moderationagreementenabled', 'mod_coursework'),$options);
+ $moodle_form->addElement('select', 'moderationagreementenabled', get_string('moderationagreementenabled', 'mod_coursework'), $options);
$moodle_form->addHelpButton('moderationagreementenabled', 'moderationagreementenabled', 'mod_coursework');
$moodle_form->setDefault('moderationagreementenabled', 0);
$moodle_form->disabledIf('moderationagreementenabled', 'numberofmarkers', 'neq', 1);
@@ -920,7 +920,7 @@ protected function add_enable_allocation_field() {
$moodle_form =& $this->_form;
$options = array( 0 => get_string('no'), 1 => get_string('yes'));
- $moodle_form->addElement('select', 'allocationenabled', get_string('allocationenabled', 'mod_coursework'),$options);
+ $moodle_form->addElement('select', 'allocationenabled', get_string('allocationenabled', 'mod_coursework'), $options);
$moodle_form->addHelpButton('allocationenabled', 'allocationenabled', 'mod_coursework');
}
@@ -936,7 +936,7 @@ protected function add_assessor_allocation_strategy_field_rdb() {
$keys = array_keys($options);
foreach ($keys as $key) {
- $radioarray[] =& $moodle_form->createElement('radio', 'assessorallocationstrategy', '',$options[$key], $key, '');
+ $radioarray[] =& $moodle_form->createElement('radio', 'assessorallocationstrategy', '', $options[$key], $key, '');
}
$moodle_form->addGroup($radioarray, 'radioarray', get_string('assessorallocationstrategy', 'mod_coursework'), array(' '), false);
$moodle_form->addHelpButton('radioarray', 'assessorallocationstrategy', 'mod_coursework');
@@ -948,7 +948,7 @@ protected function add_assessor_allocation_strategy_field() {
$options = mod_coursework\allocation\manager::get_allocation_classnames();
- $moodle_form->addElement('select', 'assessorallocationstrategy', get_string('assessorallocationstrategy', 'mod_coursework'),$options);
+ $moodle_form->addElement('select', 'assessorallocationstrategy', get_string('assessorallocationstrategy', 'mod_coursework'), $options);
$moodle_form->addHelpButton('assessorallocationstrategy', 'assessorallocationstrategy', 'mod_coursework');
$moodle_form->disabledIf('assessorallocationstrategy', 'allocationenabled', 'eq', 0);
}
@@ -990,7 +990,7 @@ protected function add_enable_blind_marking_field() {
$moodle_form =& $this->_form;
$options = array( 0 => get_string('no'), 1 => get_string('yes'));
- $moodle_form->addElement('select', 'blindmarking', get_string('blindmarking', 'mod_coursework'),$options);
+ $moodle_form->addElement('select', 'blindmarking', get_string('blindmarking', 'mod_coursework'), $options);
$moodle_form->addHelpButton('blindmarking', 'blindmarking', 'mod_coursework');
$moodle_form->setDefault('blindmarking', $CFG->coursework_blindmarking);
@@ -1001,13 +1001,13 @@ protected function add_enable_blind_marking_field() {
$submission_exists = 1;
}
- $moodle_form->addElement('hidden','submission_exists', $submission_exists);
+ $moodle_form->addElement('hidden', 'submission_exists', $submission_exists);
$moodle_form->setType('submission_exists', PARAM_INT);
$moodle_form->disabledIf('blindmarking', 'submission_exists', 'eq', 1);
//disable blindmarking if forceblindmarking is enabled, process data for DB in get_data()
if ($this->forceblindmarking() == 1) {
- $moodle_form->addElement('hidden','forceblindmarking', $this->forceblindmarking());
+ $moodle_form->addElement('hidden', 'forceblindmarking', $this->forceblindmarking());
$moodle_form->setType('forceblindmarking', PARAM_INT);
$moodle_form->disabledIf('blindmarking', 'forceblindmarking', 'eq', 1);
$moodle_form->addElement('static', 'forceblindmarking_explanation', '', get_string('forcedglobalsetting', 'mod_coursework'));
@@ -1022,7 +1022,7 @@ protected function add_enable_assessor_anonymity_field(){
$moodle_form =& $this->_form;
$options = array(0 => get_string('no'), 1 => get_string('yes'));
- $moodle_form->addElement('select', 'assessoranonymity', get_string('assessoranonymity', 'mod_coursework'),$options);
+ $moodle_form->addElement('select', 'assessoranonymity', get_string('assessoranonymity', 'mod_coursework'), $options);
$moodle_form->addHelpButton('assessoranonymity', 'assessoranonymity', 'mod_coursework');
$moodle_form->setDefault('assessoranonymity', $CFG->coursework_assessoranonymity);
@@ -1077,7 +1077,7 @@ protected function add_individual_feedback_release_date_field() {
$moodle_form->addHelpButton('individualfeedback', 'individualfeedback', 'mod_coursework');
if ($this->forceautorelease() == 1 && $CFG->coursework_auto_release_individual_feedback == 0) {
- $moodle_form->addElement('hidden','forceautorelease', $this->forceautorelease());
+ $moodle_form->addElement('hidden', 'forceautorelease', $this->forceautorelease());
$moodle_form->setType('forceautorelease', PARAM_INT);
$moodle_form->disabledIf('individualfeedback', 'forceautorelease', 'eq', 1);
}
@@ -1093,7 +1093,7 @@ protected function add_email_individual_feedback_notification_field(){
$moodle_form =& $this->_form;
$options = array(0 => get_string('no'), 1 => get_string('yes'));
- $moodle_form->addElement('select', 'feedbackreleaseemail', get_string('feedbackreleaseemail', 'mod_coursework'),$options);
+ $moodle_form->addElement('select', 'feedbackreleaseemail', get_string('feedbackreleaseemail', 'mod_coursework'), $options);
$moodle_form->addHelpButton('feedbackreleaseemail', 'feedbackreleaseemail', 'mod_coursework');
$moodle_form->setDefault('feedbackreleaseemail', $CFG->coursework_feedbackreleaseemail);
}
@@ -1152,14 +1152,14 @@ protected function add_tweaks_to_standard_grading_form_elements() {
$feedbackexists = 1;
}
- $moodle_form->addElement('hidden','feedbackexists', $feedbackexists);
+ $moodle_form->addElement('hidden', 'feedbackexists', $feedbackexists);
$moodle_form->setType('feedbackexists', PARAM_INT);
$moodle_form->disabledIf('finalstagegrading', 'feedbackexists', 'eq', 1);
// Don't think this belongs here...
// $options = array(0 => get_string('no'), 1 => get_string('yes'));
-// $moodle_form->addElement('select', 'automaticagreement', get_string('automaticagreement', 'mod_coursework'),$options);
+// $moodle_form->addElement('select', 'automaticagreement', get_string('automaticagreement', 'mod_coursework'), $options);
// $moodle_form->addHelpButton('automaticagreement', 'automaticagreement', 'mod_coursework');
// $moodle_form->setDefault('automaticagreement',0);
// $moodle_form->disabledIf('automaticagreement', 'numberofmarkers', 'eq', '1');
@@ -1192,7 +1192,7 @@ private function add_allow_late_submissions_field() {
$options = array( 0 => get_string('no'), 1 => get_string('yes'));
$moodle_form->addElement('select',
'allowlatesubmissions',
- get_string('allowlatesubmissions', 'mod_coursework'),$options);
+ get_string('allowlatesubmissions', 'mod_coursework'), $options);
$moodle_form->setType('allowlatesubmissions', PARAM_INT);
$moodle_form->setDefault('allowlatesubmissions', $CFG->coursework_allowlatesubmissions);
$moodle_form->disabledIf('allowlatesubmissions', 'deadline[enabled]', 'notchecked');
@@ -1207,7 +1207,7 @@ protected function add_all_feedbacks_field(){
$options = array( 0 => get_string('no'), 1 => get_string('yes'));
$moodle_form->addElement('select',
'showallfeedbacks',
- get_string('showallfeedbacks', 'mod_coursework'),$options);
+ get_string('showallfeedbacks', 'mod_coursework'), $options);
$moodle_form->setDefault('showallfeedbacks', 0);
$moodle_form->disabledIf('showallfeedbacks', 'numberofmarkers', 'eq', 1);
$moodle_form->addHelpButton('showallfeedbacks', 'showallfeedbacks', 'mod_coursework');
@@ -1253,11 +1253,11 @@ private function add_enable_agreed_grade_delay() {
$moodle_form =& $this->_form;
$options = array('0' => get_string('disabled', 'mod_coursework'));
- $options['1800'] = get_string('timedminutes', 'mod_coursework','30');
- $options['3600'] = get_string('timedhour', 'mod_coursework','1');
- $options['7200'] = get_string('timedhours', 'mod_coursework','2');
- $options['18000'] = get_string('timedhours', 'mod_coursework','5');
- $options['43200'] = get_string('timedhours', 'mod_coursework','12');
+ $options['1800'] = get_string('timedminutes', 'mod_coursework', '30');
+ $options['3600'] = get_string('timedhour', 'mod_coursework', '1');
+ $options['7200'] = get_string('timedhours', 'mod_coursework', '2');
+ $options['18000'] = get_string('timedhours', 'mod_coursework', '5');
+ $options['43200'] = get_string('timedhours', 'mod_coursework', '12');
$options['86400'] = get_string('aday', 'mod_coursework');
$moodle_form->addElement('select', 'gradeeditingtime', get_string('gradeeditingtime', 'mod_coursework'), $options);
diff --git a/renderers/object_renderer.php b/renderers/object_renderer.php
index 4bc87b83..8919dfd5 100644
--- a/renderers/object_renderer.php
+++ b/renderers/object_renderer.php
@@ -364,7 +364,7 @@ protected function render_mod_coursework_assessor_feedback_row(mod_coursework_as
$cell = new html_table_cell();
if ($feedbackrow->has_feedback()) {
- $cell->text = $feedbackrow ? userdate($feedbackrow->get_time_modified(),'%a, %d %b %Y, %H:%M') : '';
+ $cell->text = $feedbackrow ? userdate($feedbackrow->get_time_modified(), '%a, %d %b %Y, %H:%M') : '';
}
$row->cells['timemodified'] = $cell;
@@ -533,7 +533,7 @@ protected function render_mod_coursework_coursework(mod_coursework_coursework $c
// Show general feedback if it's there and the deadline has passed or general feedback's date is not enabled which means it should be displayed automatically
if (($coursework->is_general_feedback_enabled() && $allowed_to_add_general_feedback && (time() > $coursework->generalfeedback || $cangrade || $canpublish || $is_published)) || !$coursework->is_general_feedback_enabled()) {
$out .= html_writer::tag('h3', get_string('generalfeedback', 'coursework'));
- $out .= $coursework->feedbackcomment ? html_writer::tag('p',$coursework->feedbackcomment)
+ $out .= $coursework->feedbackcomment ? html_writer::tag('p', $coursework->feedbackcomment)
: html_writer::tag('p',get_string('nofeedbackyet', 'coursework'));
// General feedback Add edit link.
@@ -718,7 +718,7 @@ public function render_mod_coursework_allocation_widget(mod_coursework_allocatio
$html .= 'get_coursework()->get_max_markers(); $i++) {
- $assessorheaders[] = get_string('assessorheading','mod_coursework',$i+1);
+ $assessorheaders[] = get_string('assessorheading', 'mod_coursework', $i+1);
}
$scale = "";
@@ -830,7 +830,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$table->head = $assessorheaders;
$assessor1cell = html_writer::start_tag('div',array('class' => 'samples_strategy'));
- $assessor1cell .= get_string('assessoronedefault','mod_coursework');
+ $assessor1cell .= get_string('assessoronedefault', 'mod_coursework');
$assessor1cell .= html_writer::end_tag('div');
$columndata = array(new html_table_cell($assessor1cell));
@@ -847,8 +847,8 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
//create the secon
- $sampling_strategies = array('0' => get_string('sampling_manual','mod_coursework'),
- '1' => get_string('sampling_automatic','mod_coursework'));
+ $sampling_strategies = array('0' => get_string('sampling_manual', 'mod_coursework'),
+ '1' => get_string('sampling_automatic', 'mod_coursework'));
//check whether any rules have been saved for this stage
$selected = ($samplingwidget->get_coursework()->has_automatic_sampling_at_stage('assessor_'.$i)) ? '1' : false;
@@ -860,7 +860,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
"assessor_{$i}_samplingstrategy",
$selected,
false,
- array('id' => "assessor_{$i}_samplingstrategy",'class' => "assessor_sampling_strategy sampling_strategy_detail"));
+ array('id' => "assessor_{$i}_samplingstrategy", 'class' => "assessor_sampling_strategy sampling_strategy_detail"));
$sampling_cell .= html_writer::end_tag('div');
@@ -873,17 +873,17 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$graderules .= html_writer::end_tag('h4');
- $graderules .= $this->get_sampling_strategy_form_elements($samplingwidget->get_coursework(),$i,$javascript);
+ $graderules .= $this->get_sampling_strategy_form_elements($samplingwidget->get_coursework(), $i, $javascript);
- $sampling_cell .= html_writer::div($graderules,'', array('id' => "assessor_{$i}_automatic_rules"));
+ $sampling_cell .= html_writer::div($graderules, '', array('id' => "assessor_{$i}_automatic_rules"));
$columndata[] = new html_table_cell($sampling_cell);
}
$table->data[] = $columndata;
- //= array($asessoronecell,$asessortwocell);
+ //= array($asessoronecell, $asessortwocell);
$html .= html_writer::table($table);
@@ -932,7 +932,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
}
- private function sampling_strategy_column($samplingwidget,$suffix = '') {
+ private function sampling_strategy_column($samplingwidget, $suffix = '') {
$percentage_options = array();
@@ -942,11 +942,11 @@ private function sampling_strategy_column($samplingwidget,$suffix = '') {
//hidden input containing scale values
$scale = array();
- $sampling_column = "
";
+ $sampling_column = "
";
- $sampling_column .= html_writer::tag('br','');
- $sampling_column .= html_writer::tag('strong',get_string('selectrules','mod_coursework'));
- $sampling_column .= html_writer::tag('br','');
+ $sampling_column .= html_writer::tag('br', '');
+ $sampling_column .= html_writer::tag('strong',get_string('selectrules', 'mod_coursework'));
+ $sampling_column .= html_writer::tag('br', '');
$sampling_column .= html_writer::start_tag('div');
@@ -990,12 +990,12 @@ private function sampling_strategy_column($samplingwidget,$suffix = '') {
$sampling_column .= html_writer::end_tag('div');
- $sampling_column .= html_writer::link('#',get_string('addgraderule','mod_coursework'),array('id' => "assessor_{$suffix}_addgradderule", 'class' => 'addgradderule sampling_strategy_detail'));
- $sampling_column .= html_writer::link('#',get_string('removegraderule','mod_coursework'),array('id' => "assessor_{$suffix}_removegradderule", 'class' => 'removegradderule sampling_strategy_detail'));
+ $sampling_column .= html_writer::link('#',get_string('addgraderule', 'mod_coursework'),array('id' => "assessor_{$suffix}_addgradderule", 'class' => 'addgradderule sampling_strategy_detail'));
+ $sampling_column .= html_writer::link('#',get_string('removegraderule', 'mod_coursework'),array('id' => "assessor_{$suffix}_removegradderule", 'class' => 'removegradderule sampling_strategy_detail'));
- $sampling_column .= html_writer::checkbox("assessor_{$suffix}_samplertopup",1,false,get_string('topupto','mod_coursework'),
- array('id' => "assessor_{$suffix}_samplerules[]",'class' => "assessor_{$suffix} sampling_strategy_detail"));
+ $sampling_column .= html_writer::checkbox("assessor_{$suffix}_samplertopup",1,false,get_string('topupto', 'mod_coursework'),
+ array('id' => "assessor_{$suffix}_samplerules[]", 'class' => "assessor_{$suffix} sampling_strategy_detail"));
@@ -1004,7 +1004,7 @@ private function sampling_strategy_column($samplingwidget,$suffix = '') {
$samplingwidget->get_sampling_strategy(),
false,
array('id' => "assessor_{$suffix}_sampletopup", 'class' => "assessor_{$suffix} sampling_strategy_detail"));
- $sampling_column .= html_writer::label(get_string('ofallstudents', 'mod_coursework'),'assessortwo_sampleto[]');
+ $sampling_column .= html_writer::label(get_string('ofallstudents', 'mod_coursework'), 'assessortwo_sampleto[]');
return $sampling_column ;
@@ -1125,7 +1125,7 @@ protected function get_allocation_strategy_form_elements($coursework) {
}
- protected function get_sampling_strategy_form_elements($coursework,$assessor_number,$load_javascript=false) {
+ protected function get_sampling_strategy_form_elements($coursework, $assessor_number, $load_javascript=false) {
global $CFG, $DB;
@@ -1133,7 +1133,7 @@ protected function get_sampling_strategy_form_elements($coursework,$assessor_num
$javascript = '';
$classdir = $CFG->dirroot . '/mod/coursework/classes/sample_set_rule/';
- $sampleplugins = $DB->get_records('coursework_sample_set_plugin',null,'pluginorder');
+ $sampleplugins = $DB->get_records('coursework_sample_set_plugin',null, 'pluginorder');
@@ -1284,7 +1284,7 @@ protected function coursework_deadlines_table(mod_coursework_coursework $coursew
$deadline_date .= userdate($normaldeadline, '%a, %d %b %Y, %H:%M');
$deadline_date .= '';
} else if ($coursework->has_deadline()) {
- $deadline_date .= userdate($normaldeadline,'%a, %d %b %Y, %H:%M');
+ $deadline_date .= userdate($normaldeadline, '%a, %d %b %Y, %H:%M');
} else {
$deadline_date .= get_string('nocourseworkdeadline', 'mod_coursework');
}
@@ -1335,7 +1335,7 @@ protected function coursework_deadlines_table(mod_coursework_coursework $coursew
if ($coursework->is_general_feedback_enabled() && $coursework->generalfeedback) {
$general_feedback_header = get_string('generalfeedbackdeadline', 'coursework') . ': ';
$general_feedback_deadline = $coursework->get_general_feedback_deadline();
- $general_feedback_deadline_message = $general_feedback_deadline ? userdate($general_feedback_deadline,'%a, %d %b %Y, %H:%M')
+ $general_feedback_deadline_message = $general_feedback_deadline ? userdate($general_feedback_deadline, '%a, %d %b %Y, %H:%M')
: get_string('notset', 'coursework');
$table_html .= '
@@ -1351,7 +1351,7 @@ protected function coursework_deadlines_table(mod_coursework_coursework $coursew
$individual_feedback_header = get_string('individualfeedback', 'coursework');
$individual_feedback_deadline = $coursework->get_individual_feedback_deadline();
- $indivisual_feedback_message = $individual_feedback_deadline ? userdate($individual_feedback_deadline,'%a, %d %b %Y, %H:%M')
+ $indivisual_feedback_message = $individual_feedback_deadline ? userdate($individual_feedback_deadline, '%a, %d %b %Y, %H:%M')
: get_string('notset', 'coursework');
$table_html .= '
@@ -1410,15 +1410,15 @@ protected function render_mod_coursework_personal_deadlines_table(mod_coursework
global $PAGE;
$coursework_page_url = $this->get_router()->get_path('coursework', array('coursework' => $personal_deadlines_table->get_coursework())) ;
- $table_html = '
'.html_writer::link($coursework_page_url,get_string('returntocourseworkpage','mod_coursework')).'
';
+ $table_html = '
'.html_writer::link($coursework_page_url,get_string('returntocourseworkpage', 'mod_coursework')).'
';
- $table_html .= '
'.get_string('nopersonaldeadlineforextensionwarning','mod_coursework').'
';
+ $table_html .= '
'.get_string('nopersonaldeadlineforextensionwarning', 'mod_coursework').'
';
$usergroups = $personal_deadlines_table->get_coursework()->get_allocatable_type();
- $table_html .= '
'.html_writer::link('#', get_string('setdateforselected','mod_coursework',$personal_deadlines_table->get_coursework()->get_allocatable_type()), array('id' => 'selected_dates')).'
';
+ $table_html .= '
'.html_writer::link('#', get_string('setdateforselected', 'mod_coursework', $personal_deadlines_table->get_coursework()->get_allocatable_type()), array('id' => 'selected_dates')).'
';
if (has_capability('mod/coursework:revertfinalised', $PAGE->context)) {
@@ -1457,7 +1457,7 @@ protected function render_mod_coursework_personal_deadlines_table(mod_coursework
$table_html .= $personaldeadlines_cell_helper->get_table_header($personal_deadlines_table->get_options());
$table_html .= '';
$table_html .= '
';
- $table_html .= get_string('tableheadstatus','mod_coursework');
+ $table_html .= get_string('tableheadstatus', 'mod_coursework');
$table_html .= ' ';
@@ -1565,8 +1565,8 @@ protected function coursework_grading_summary_table(mod_coursework_coursework $c
$published = 0;
- if (!$coursework->has_multiple_markers() && !$coursework->allocation_enabled() && !has_capability('mod/coursework:addinitialgrade',$coursework->get_context())
- && has_capability('mod/coursework:addagreedgrade',$coursework->get_context())){
+ if (!$coursework->has_multiple_markers() && !$coursework->allocation_enabled() && !has_capability('mod/coursework:addinitialgrade', $coursework->get_context())
+ && has_capability('mod/coursework:addagreedgrade', $coursework->get_context())){
$warning_message = "
You don't have a capability to grade anyone in this Coursework ";
@@ -1634,11 +1634,11 @@ protected function coursework_grading_summary_table(mod_coursework_coursework $c
$table_html = '
';
$table_html .= $warning_message;
// participants row
- $table_html .= ''.get_string('participants','mod_coursework').' '.$participants.' ';
+ $table_html .= ''.get_string('participants', 'mod_coursework').' '.$participants.' ';
// number of submission row
- $table_html .= ''.get_string('submitted','mod_coursework').' '.$submitted.' ';
+ $table_html .= ''.get_string('submitted', 'mod_coursework').' '.$submitted.' ';
// submissions needs grading row
- $table_html .= ''.get_string('needsgrading','mod_coursework').' '.$needsgrading.' ';
+ $table_html .= ''.get_string('needsgrading', 'mod_coursework').' '.$needsgrading.' ';
// submissions graded
if (has_capability('mod/coursework:addinitialgrade', $coursework->get_context()) && !is_siteadmin($USER)){
$table_html .= '' . get_string('graded', 'mod_coursework') . $stagename . $gradedHeader . ' ' . $graded . ' ';
@@ -1646,7 +1646,7 @@ protected function coursework_grading_summary_table(mod_coursework_coursework $c
$table_html .= '' . get_string('graded', 'mod_coursework') . $stagename . $gradedHeader . ' ' . $finalgrade . ' ';
}
// submissions graded and published
- $table_html .= ''.get_string('gradedandpublished','mod_coursework').' '.$published.' ';
+ $table_html .= ''.get_string('gradedandpublished', 'mod_coursework').' '.$published.' ';
$table_html .= '
';
@@ -1753,7 +1753,7 @@ public function remove_ungradable_submissions($submissions) {
$submission = submission::find($sub);
- if (has_capability('mod/coursework:addallocatedagreedgrade',$submission->get_coursework()->get_context()) && !$submission->is_assessor_initial_grader() && $submission->all_inital_graded()) {
+ if (has_capability('mod/coursework:addallocatedagreedgrade', $submission->get_coursework()->get_context()) && !$submission->is_assessor_initial_grader() && $submission->all_inital_graded()) {
unset($submissions[$sub->id]);
}
}
@@ -1796,7 +1796,7 @@ public function get_assessor_initial_graded_submissions($submissions) {
$submission = submission::find($sub);
if (count($submission->get_assessor_feedbacks()) >= $submission->max_number_of_feedbacks() || $submission->is_assessor_initial_grader()
- && (!has_capability('mod/coursework:administergrades',$submission->get_coursework()->get_context()) && !is_siteadmin($USER->id))) {
+ && (!has_capability('mod/coursework:administergrades', $submission->get_coursework()->get_context()) && !is_siteadmin($USER->id))) {
//is this submission assessable by this user at an inital gradig stage
unset($submissions[$sub->id]);
diff --git a/renderers/page_renderer.php b/renderers/page_renderer.php
index 02eb5967..55735ec2 100644
--- a/renderers/page_renderer.php
+++ b/renderers/page_renderer.php
@@ -43,7 +43,7 @@ class mod_coursework_page_renderer extends plugin_renderer_base {
/**
* @param feedback $feedback
*/
- public function show_feedback_page($feedback,$ajax) {
+ public function show_feedback_page($feedback, $ajax) {
global $OUTPUT;
$html = '';
@@ -637,7 +637,7 @@ public function teacher_grading_page($coursework, $page, $perpage, $sortby, $sor
$currenturl = new moodle_url('/mod/coursework/view.php', array('id' => $coursework->get_course_module()->id));
$html .= groups_print_activity_menu($coursework->get_course_module(), $currenturl->out(), true);
if (groups_get_activity_groupmode($coursework->get_course_module()) != 0 && $group != 0) {
- $html .= '
'.get_string('groupmodechosenalert','mod_coursework').'
';
+ $html .= '
'.get_string('groupmodechosenalert', 'mod_coursework').'
';
}
// reset table preferences
@@ -675,13 +675,13 @@ public function teacher_grading_page($coursework, $page, $perpage, $sortby, $sor
&& $coursework->get_finalised_submissions()){
//export grading sheet
$url = $pageurl.'&export_grading_sheet=1';
- $links[$url] = get_string('exportgradingsheets','mod_coursework');
+ $links[$url] = get_string('exportgradingsheets', 'mod_coursework');
//import grading sheet
$url = '/mod/coursework/actions/upload_grading_sheet.php?cmid='.$PAGE->cm->id;
- $links[$url] = get_string('uploadgradingworksheet','mod_coursework');
+ $links[$url] = get_string('uploadgradingworksheet', 'mod_coursework');
//import annotated submissions
$url = '/mod/coursework/actions/upload_feedback.php?cmid='.$PAGE->cm->id;
- $links[$url] = get_string('uploadfeedbackfiles','mod_coursework');
+ $links[$url] = get_string('uploadfeedbackfiles', 'mod_coursework');
}
@@ -733,7 +733,7 @@ public function teacher_grading_page($coursework, $page, $perpage, $sortby, $sor
* @throws coding_exception
* @throws moodle_exception
*/
- public function non_teacher_allocated_grading_page($coursework,$viewallstudents_page,$viewallstudents_perpage,$viewallstudents_sortby,$viewallstudents_sorthow,$group,$displayallstudents,$firstnamealpha,$lastnamealpha,$groupnamealpha) {
+ public function non_teacher_allocated_grading_page($coursework, $viewallstudents_page, $viewallstudents_perpage, $viewallstudents_sortby, $viewallstudents_sorthow, $group, $displayallstudents, $firstnamealpha, $lastnamealpha, $groupnamealpha) {
global $PAGE, $OUTPUT;
@@ -787,7 +787,7 @@ public function non_teacher_allocated_grading_page($coursework,$viewallstudents_
*/
$html .= html_writer::start_tag('div', array('class' => 'wrapper_table_submissions'));
- $html .= $grading_report_renderer->render_grading_report($grading_report,$coursework->has_multiple_markers(),true);
+ $html .= $grading_report_renderer->render_grading_report($grading_report, $coursework->has_multiple_markers(),true);
$html .= html_writer::end_tag('div');
@@ -1281,7 +1281,7 @@ function csv_upload($uploadform, $csvtype) {
* @return string
* @throws coding_exception
*/
- function process_csv_upload($processingresults,$csvcontent, $csvtype) {
+ function process_csv_upload($processingresults, $csvcontent, $csvtype) {
global $OUTPUT, $PAGE;
@@ -1348,7 +1348,7 @@ function feedback_upload($form) {
function process_feedback_upload($processingresults) {
- global $OUTPUT, $PAGE,$OUTPUT;
+ global $OUTPUT, $PAGE, $OUTPUT;
$title = get_string('feedbackuploadresults', 'mod_coursework');
@@ -1375,7 +1375,7 @@ function process_feedback_upload($processingresults) {
$html .= get_string('fileuploadresults', 'mod_coursework')."
";
foreach ($processingresults as $file => $result) {
- $html .= get_string('fileuploadresult', 'mod_coursework',array('filename' => $file,'result' => $result)). "
";
+ $html .= get_string('fileuploadresult', 'mod_coursework',array('filename' => $file, 'result' => $result)). "
";
}
$html .= html_writer::end_tag('p');
} else {
@@ -1499,7 +1499,7 @@ public function datatables_render($coursework){
'alert_feedback_draft_save_successful' => str_replace(' ', '_', get_string('alert_feedback_draft_save_successful', 'mod_coursework'))
];
- $modal_header = html_writer::tag('h5','new Extension', array(
+ $modal_header = html_writer::tag('h5', 'new Extension', array(
'class' => 'modal-title',
'id' => 'extension-modal-title',
));
@@ -1509,7 +1509,7 @@ public function datatables_render($coursework){
'aria-label' => 'Close',
'data-dismiss' => 'modal'
));
- $modal_header .= html_writer::span('×','',array('aria-hidden' => 'true'));
+ $modal_header .= html_writer::span('×', '',array('aria-hidden' => 'true'));
$modal_header .= html_writer::end_tag('button');
$modal_body = html_writer::start_tag('form', array('id' => 'form-extension'));
@@ -1555,43 +1555,43 @@ public function datatables_render($coursework){
'value' => '',
'id' => 'button-id'
));
- $modal_body .= html_writer::div($content,'display-none');
+ $modal_body .= html_writer::div($content, 'display-none');
if ($coursework->deadline) {
$content_default_deadline = 'Default deadline: ' . userdate($coursework->deadline);
- $content_default_deadline = html_writer::div($content_default_deadline,'col-md-12', array('id' => 'extension-time-content'));
- $modal_body .= html_writer::div($content_default_deadline,'form-group row fitem');
+ $content_default_deadline = html_writer::div($content_default_deadline, 'col-md-12', array('id' => 'extension-time-content'));
+ $modal_body .= html_writer::div($content_default_deadline, 'form-group row fitem');
$content_extended_deadline = html_writer::tag('label',get_string('extended_deadline', 'mod_coursework'));
- $content_extended_deadline_div = html_writer::div($content_extended_deadline,'col-md-3');
+ $content_extended_deadline_div = html_writer::div($content_extended_deadline, 'col-md-3');
$input = '
';
- $content_extended_deadline_div .= html_writer::div($input,'col-md-6');
- $modal_body .= html_writer::div($content_extended_deadline_div,'form-group row fitem');
+ $content_extended_deadline_div .= html_writer::div($input, 'col-md-6');
+ $modal_body .= html_writer::div($content_extended_deadline_div, 'form-group row fitem');
$extension_reasons = coursework::extension_reasons();
if (!empty($extension_reasons)) {
$select_extension_reasons = html_writer::tag('label',get_string('extension_reason', 'mod_coursework'));
- $select_extension_reasons_div = html_writer::div($select_extension_reasons,'col-md-3');
- $select_extension_reasons = html_writer::select($extension_reasons,'','',false, array(
+ $select_extension_reasons_div = html_writer::div($select_extension_reasons, 'col-md-3');
+ $select_extension_reasons = html_writer::select($extension_reasons, '', '',false, array(
'id' => 'extension-reason-select',
'class' => 'form-control'
));
- $select_extension_reasons_div .= html_writer::div($select_extension_reasons,'col-md-9 form-inline felement', array('data-fieldtype' => 'select'));
- $modal_body .= html_writer::div($select_extension_reasons_div,'form-group row fitem');
+ $select_extension_reasons_div .= html_writer::div($select_extension_reasons, 'col-md-9 form-inline felement', array('data-fieldtype' => 'select'));
+ $modal_body .= html_writer::div($select_extension_reasons_div, 'form-group row fitem');
}
$content_extra_information = html_writer::tag('label',get_string('extra_information', 'mod_coursework'), array(
'class' => 'col-form-label d-inline', 'for' => 'id_extra_information'
));
- $content_extra_information_div = html_writer::div($content_extra_information,'col-md-3');
+ $content_extra_information_div = html_writer::div($content_extra_information, 'col-md-3');
$content_extra_information = html_writer::tag('textarea', '', array(
'class' => 'form-control',
'rows' => '8',
'spellcheck' => 'true',
'id' => 'id_extra_information'
));
- $content_extra_information_div .= html_writer::div($content_extra_information,'col-md-9 form-inline felement', array('data-fieldtype' => 'editor'));
- $modal_body .= html_writer::div($content_extra_information_div,'form-group row fitem', array('id' => 'fitem_id_extra_information'));
+ $content_extra_information_div .= html_writer::div($content_extra_information, 'col-md-9 form-inline felement', array('data-fieldtype' => 'editor'));
+ $modal_body .= html_writer::div($content_extra_information_div, 'form-group row fitem', array('id' => 'fitem_id_extra_information'));
}
$modal_body .= html_writer::end_tag('form');
diff --git a/settings.php b/settings.php
index eb267121..7237afc5 100644
--- a/settings.php
+++ b/settings.php
@@ -27,22 +27,22 @@
if ($ADMIN->fulltree) {
require_once($CFG->dirroot.'/mod/coursework/lib.php');
- $settings_header = new admin_setting_heading('settings_header','' ,get_string('settings_header', 'mod_coursework'));
+ $settings_header = new admin_setting_heading('settings_header', '' ,get_string('settings_header', 'mod_coursework'));
$settings->add($settings_header);
// Set site-wide option for late submission
- $availability_header = new admin_setting_heading('availability_header', get_string('availability', 'mod_coursework'),'');
+ $availability_header = new admin_setting_heading('availability_header', get_string('availability', 'mod_coursework'), '');
$settings->add($availability_header);
$allow_late_submission_name = get_string('allowlatesubmissions', 'coursework');
$allow_late_submission_description = get_string('allowlatesubmissions_desc', 'coursework');
$options = array( 0 => get_string('no'), 1 => get_string('yes'));
$settings->add(new admin_setting_configselect('coursework_allowlatesubmissions',
- $allow_late_submission_name, $allow_late_submission_description, 0,$options));
+ $allow_late_submission_name, $allow_late_submission_description, 0, $options));
// Set site-wide limit on submissions sizes.
if (isset($CFG->maxbytes)) {
- $submissions_header = new admin_setting_heading('submissions_header', get_string('submissions', 'mod_coursework'),'');
+ $submissions_header = new admin_setting_heading('submissions_header', get_string('submissions', 'mod_coursework'), '');
$settings->add($submissions_header);
$configmaxbytesstring = get_string('configmaxbytes', 'coursework');
$maximumsizestring = get_string('maximumsize', 'coursework');
@@ -56,14 +56,14 @@
// Submissions
- $submissions_header = new admin_setting_heading('submissions_header', get_string('submissions', 'mod_coursework'),'');
+ $submissions_header = new admin_setting_heading('submissions_header', get_string('submissions', 'mod_coursework'), '');
$settings->add($submissions_header);
$options = array( 0 => get_string('no'), 1 => get_string('yes'));
$settings->add(new admin_setting_configselect('coursework_plagiarismflag', get_string('plagiarism_flag_enable', 'mod_coursework'), get_string('plagiarism_flag_enable_desc', 'mod_coursework'), 0, $options));
// Submission receipt
- $submissionreceipt_header = new admin_setting_heading('submissionreceipt_header', get_string('submissionreceipt', 'mod_coursework'),'');
+ $submissionreceipt_header = new admin_setting_heading('submissionreceipt_header', get_string('submissionreceipt', 'mod_coursework'), '');
$settings->add($submissionreceipt_header);
$options = array( 0 => get_string('no'), 1 => get_string('yes'));
$settings->add(new admin_setting_configselect('coursework_allsubmissionreceipt', get_string('allsubmission', 'mod_coursework'), get_string('allsubmission_desc', 'mod_coursework'), 0, $options));
@@ -71,7 +71,7 @@
// Blind marking
- $blindmarking_header = new admin_setting_heading('blindmarking_header', get_string('blindmarking', 'mod_coursework'),'');
+ $blindmarking_header = new admin_setting_heading('blindmarking_header', get_string('blindmarking', 'mod_coursework'), '');
$settings->add($blindmarking_header);
$blind_marking_name = get_string('blindmarking', 'coursework');
$blind_marking_description = get_string('blindmarking_desc', 'coursework');
@@ -80,7 +80,7 @@
$settings->add(new admin_setting_configcheckbox('coursework_forceblindmarking', get_string('forceblindmarking', 'mod_coursework'), get_string('forceblindmarking_desc', 'mod_coursework'), 0));
// Assessor anonymity
- $assessoranonymity_header = new admin_setting_heading('assessoranonymity_header', get_string('assessoranonymity', 'mod_coursework'),'');
+ $assessoranonymity_header = new admin_setting_heading('assessoranonymity_header', get_string('assessoranonymity', 'mod_coursework'), '');
$settings->add($assessoranonymity_header);
$assessor_anonymity_name = get_string('assessoranonymity', 'coursework');
$assessor_anonymity_description = get_string('assessoranonymity_desc', 'coursework');
@@ -92,7 +92,7 @@
for ($i = 1; $i <= 10; $i++) {
$weeks[$i] = $i;
}
- $feedbacktypes_header = new admin_setting_heading('feedbacktypes_header', get_string('feedbacktypes', 'mod_coursework'),'');
+ $feedbacktypes_header = new admin_setting_heading('feedbacktypes_header', get_string('feedbacktypes', 'mod_coursework'), '');
$settings->add($feedbacktypes_header);
$generalfeedbackstring = get_string('generalfeedback', 'coursework');
$configgeneralfeedbackstring = get_string('configgeneralfeedback', 'coursework');
@@ -130,7 +130,7 @@
for ($i = 2; $i <= 7; $i++) {
$day_reminder[$i] = $i;
}
- $studentreminder_header = new admin_setting_heading('studentreminder_header', get_string('studentreminder', 'mod_coursework'),'');
+ $studentreminder_header = new admin_setting_heading('studentreminder_header', get_string('studentreminder', 'mod_coursework'), '');
$settings->add($studentreminder_header);
$reminderstring = get_string('coursework_reminder', 'coursework');
$confreminderstring = get_string('config_coursework_reminder', 'coursework');
@@ -144,13 +144,13 @@
// Sitewide message that students will see and agree to before submitting or editing.
- $termsagreement_header = new admin_setting_heading('termsagreement_header', get_string('termsagreement', 'mod_coursework'),'');
+ $termsagreement_header = new admin_setting_heading('termsagreement_header', get_string('termsagreement', 'mod_coursework'), '');
$settings->add($termsagreement_header);
$agree_terms_name = get_string('agreeterms', 'coursework');
$agree_terms_description = get_string('agreetermsdescription', 'coursework');
$options = array( 0 => get_string('no'), 1 => get_string('yes'));
$settings->add(new admin_setting_configselect('coursework_agree_terms',
- $agree_terms_name, $agree_terms_description, 0,$options));
+ $agree_terms_name, $agree_terms_description, 0, $options));
$agree_terms_text = get_string('agreetermstext', 'coursework');
$settings->add(new admin_setting_confightmleditor('coursework_agree_terms_text',
@@ -185,7 +185,7 @@
$options = array('3' => '3', '10' => '10', '20' => '20', '30' => '30', '40' => '40', '50' => '50', '100' => '100');
- $grading_page_header = new admin_setting_heading('grading_page_header', get_string('grading_page', 'mod_coursework'),'');
+ $grading_page_header = new admin_setting_heading('grading_page_header', get_string('grading_page', 'mod_coursework'), '');
$settings->add($grading_page_header);
$per_page = get_string('per_page', 'coursework');
@@ -195,15 +195,15 @@
//automatic agreement delay
$options = array('0' => get_string('disabled', 'mod_coursework'));
- $options['1800'] = get_string('timedminutes', 'mod_coursework','30');
- $options['3600'] = get_string('timedhour', 'mod_coursework','1');
- $options['7200'] = get_string('timedhours', 'mod_coursework','2');
- $options['18000'] = get_string('timedhours', 'mod_coursework','5');
- $options['43200'] = get_string('timedhours', 'mod_coursework','12');
+ $options['1800'] = get_string('timedminutes', 'mod_coursework', '30');
+ $options['3600'] = get_string('timedhour', 'mod_coursework', '1');
+ $options['7200'] = get_string('timedhours', 'mod_coursework', '2');
+ $options['18000'] = get_string('timedhours', 'mod_coursework', '5');
+ $options['43200'] = get_string('timedhours', 'mod_coursework', '12');
$options['86400'] = get_string('aday', 'mod_coursework');
- $grade_editing_header = new admin_setting_heading('grade_editing_header', get_string('grade_editing', 'mod_coursework'),'');
+ $grade_editing_header = new admin_setting_heading('grade_editing_header', get_string('grade_editing', 'mod_coursework'), '');
$settings->add($grade_editing_header);
$grade_editing_name = get_string('grade_editing_enabled', 'coursework');
diff --git a/tests/behat/behat_mod_coursework.php b/tests/behat/behat_mod_coursework.php
index 9d833a52..e0ec21cf 100644
--- a/tests/behat/behat_mod_coursework.php
+++ b/tests/behat/behat_mod_coursework.php
@@ -228,7 +228,7 @@ public function theCronRuns() {
* @Then /^I should( not)? see( the)? (.*)'s name on the page$/
* @param bool $negate
*/
- public function iShouldSeeTheStudentSNameOnThePage($negate = false,$negate2=false,$studentrole) {
+ public function iShouldSeeTheStudentSNameOnThePage($negate = false, $negate2=false, $studentrole) {
$page = $this->get_page('coursework page');
$student = ($studentrole == "another student") ? $this->other_student : $this->student;
@@ -926,7 +926,7 @@ public function theManagerHasACapabilityToAllocateStudentsInSamplings() {
/**
* @Given /^I (de)?select (a|another) student as a part of the sample for the second stage$/
*/
- public function iSelectTheStudentAsAPartOfTheSample($negate = false,$other) {
+ public function iSelectTheStudentAsAPartOfTheSample($negate = false, $other) {
/**
* @var mod_coursework_behat_allocations_page $page
*/
@@ -2880,9 +2880,9 @@ public function ISelectGradeLimitTypeForGradeRangeRuleInStageAs($range, $ruleno,
* @param $stage
* @throws coding_exception
*/
- public function ISelectTotalSubmissionsInStage($percentage,$stage) {
+ public function ISelectTotalSubmissionsInStage($percentage, $stage) {
$page = $this->get_page('allocations page');
- $page->select_total_percentage_for_stage($percentage,$stage);
+ $page->select_total_percentage_for_stage($percentage, $stage);
}
/**
@@ -2891,13 +2891,13 @@ public function ISelectTotalSubmissionsInStage($percentage,$stage) {
* @param $stage
* @throws coding_exception
*/
- public function StudentAutomaticallyIncludedInSampleForStage($other,$another,$negate,$stage) {
+ public function StudentAutomaticallyIncludedInSampleForStage($other, $another, $negate, $stage) {
$page = $this->get_page('allocations page');
$another = (!empty($another))? $this->other_student: '';
$other = ($other == 'another');
$student = $other ? 'other_student' : 'student';
- $page->automatically_included_in_sample($this->coursework,$this->$student,$another,$stage,$negate);
+ $page->automatically_included_in_sample($this->coursework, $this->$student, $another, $stage, $negate);
}
diff --git a/tests/behat/pages/allocations_page.php b/tests/behat/pages/allocations_page.php
index 8a62aa9c..e91634f5 100644
--- a/tests/behat/pages/allocations_page.php
+++ b/tests/behat/pages/allocations_page.php
@@ -229,7 +229,7 @@ public function select_range_for_grade_range_rule_for_stage($range, $stage, $rul
* @param $stage
* @throws \Behat\Mink\Exception\ElementNotFoundException
*/
- public function select_total_percentage_for_stage($percentage,$stage) {
+ public function select_total_percentage_for_stage($percentage, $stage) {
//increment stage as the this will match the id of the element;
$stage++;
@@ -245,7 +245,7 @@ public function select_total_percentage_for_stage($percentage,$stage) {
* @param $user
* @param $stage_number
*/
- public function automatically_included_in_sample($coursework,$user,$other_user,$stage_number,$negate) {
+ public function automatically_included_in_sample($coursework, $user, $other_user, $stage_number, $negate) {
global $DB;
$other_sql = (!empty($other_user))? "OR allocatableid = $other_user->id" : '';
@@ -264,7 +264,7 @@ public function automatically_included_in_sample($coursework,$user,$other_user,$
'stage' => $stage);
if (empty($negate)){
- assertTrue($DB->record_exists_sql($sql,$params));
+ assertTrue($DB->record_exists_sql($sql, $params));
} else {
assertFalse($DB->record_exists_sql($sql, $params));
}
diff --git a/tests/classes/export/csv_test.php b/tests/classes/export/csv_test.php
index ef200413..0d0ec475 100644
--- a/tests/classes/export/csv_test.php
+++ b/tests/classes/export/csv_test.php
@@ -114,7 +114,7 @@ public function test_one_stage(){
// headers and data for csv
- $csv_cells = array('name','username','submissiondate','submissiontime',
+ $csv_cells = array('name', 'username', 'submissiondate', 'submissiontime',
'submissionfileid');
if ($this->coursework->extensions_enabled()){
@@ -129,7 +129,7 @@ public function test_one_stage(){
$timestamp = date('d_m_y @ H-i');
$filename = get_string('finalgradesfor', 'coursework'). $this->coursework->name .' '.$timestamp;
$csv = new \mod_coursework\export\csv($this->coursework, $csv_cells, $filename);
- $csv_grades = $csv->add_cells_to_array($submission,$student,$csv_cells);
+ $csv_grades = $csv->add_cells_to_array($submission, $student, $csv_cells);
// build an array
$studentname = $student->lastname .' '.$student->firstname;
@@ -139,7 +139,7 @@ public function test_one_stage(){
$one_assessor_grades = array('0' => $studentname,
'1' => $student->username,
- '2' => userdate(time(),$dateformat),
+ '2' => userdate(time(), $dateformat),
'3' => 'On time',
'4' => $this->coursework->get_username_hash($submission->allocatableid),
'5' => userdate($extension->extended_deadline, $dateformat),
@@ -148,7 +148,7 @@ public function test_one_stage(){
'8' => $feedback->grade,
'9' => $assessorname,
'10' => $assessorusername,
- '11' => userdate(time(),$dateformat),
+ '11' => userdate(time(), $dateformat),
'12' => $feedback->grade);
$this->assertEquals($one_assessor_grades, $csv_grades);
@@ -204,7 +204,7 @@ public function test_two_stages(){
$feedback3 = $generator->create_feedback($feedback_data3);
// headers and data for csv
- $csv_cells = array('name','username','submissiondate','submissiontime',
+ $csv_cells = array('name', 'username', 'submissiondate', 'submissiontime',
'submissionfileid');
if ($this->coursework->extensions_enabled()){
@@ -219,7 +219,7 @@ public function test_two_stages(){
$timestamp = date('d_m_y @ H-i');
$filename = get_string('finalgradesfor', 'coursework'). $this->coursework->name .' '.$timestamp;
$csv = new \mod_coursework\export\csv($this->coursework, $csv_cells, $filename);
- $csv_grades = $csv->add_cells_to_array($submission,$student,$csv_cells);
+ $csv_grades = $csv->add_cells_to_array($submission, $student, $csv_cells);
// build an array
$studentname = $student->lastname .' '.$student->firstname;
@@ -231,21 +231,21 @@ public function test_two_stages(){
$two_assessors_grades = array('0' => $studentname,
'1' => $student->username,
- '2' => userdate(time(),$dateformat),
+ '2' => userdate(time(), $dateformat),
'3' => 'Late',
'4' => $this->coursework->get_username_hash($submission->allocatableid),
'5' => $feedback1->grade,
'6' => $assessorname1,
'7' => $assessorusername1,
- '8' => userdate(time(),$dateformat),
+ '8' => userdate(time(), $dateformat),
'9' => $feedback2->grade,
'10' => $assessorname2,
'11' => $assessorusername2,
- '12' => userdate(time(),$dateformat),
+ '12' => userdate(time(), $dateformat),
'13' => $feedback3->grade,
'14' => $assessorname1,
'15' => $assessorusername1,
- '16' => userdate(time(),$dateformat),
+ '16' => userdate(time(), $dateformat),
'17' => $feedback3->grade);
$this->assertEquals($two_assessors_grades, $csv_grades);
@@ -283,7 +283,7 @@ public function test_student_not_in_sample(){
$feedback = $generator->create_feedback($feedback_data);
// headers and data for csv
- $csv_cells = array('name','username','submissiondate','submissiontime',
+ $csv_cells = array('name', 'username', 'submissiondate', 'submissiontime',
'submissionfileid');
if ($this->coursework->extensions_enabled()){
@@ -298,7 +298,7 @@ public function test_student_not_in_sample(){
$timestamp = date('d_m_y @ H-i');
$filename = get_string('finalgradesfor', 'coursework'). $this->coursework->name .' '.$timestamp;
$csv = new \mod_coursework\export\csv($this->coursework, $csv_cells, $filename);
- $csv_grades = $csv->add_cells_to_array($submission,$student,$csv_cells);
+ $csv_grades = $csv->add_cells_to_array($submission, $student, $csv_cells);
// build an array
$studentname = $student->lastname .' '.$student->firstname;
@@ -309,13 +309,13 @@ public function test_student_not_in_sample(){
$grades = array('0' => $studentname,
'1' => $student->username,
- '2' => userdate(time(),$dateformat),
+ '2' => userdate(time(), $dateformat),
'3' => 'On time',
'4' => $this->coursework->get_username_hash($submission->allocatableid),
'5' => $feedback->grade,
'6' => $assessorname1,
'7' => $assessorusername1,
- '8' => userdate(time(),$dateformat),
+ '8' => userdate(time(), $dateformat),
'9' => '',
'10' => '',
'11' => '',
@@ -404,7 +404,7 @@ public function test_two_students_one_in_sample(){
$feedback4 = $generator->create_feedback($feedback_data4);
// headers and data for csv
- $csv_cells = array('name','username','submissiondate','submissiontime',
+ $csv_cells = array('name', 'username', 'submissiondate', 'submissiontime',
'submissionfileid');
if ($this->coursework->extensions_enabled()){
@@ -419,8 +419,8 @@ public function test_two_students_one_in_sample(){
$timestamp = date('d_m_y @ H-i');
$filename = get_string('finalgradesfor', 'coursework'). $this->coursework->name .' '.$timestamp;
$csv = new \mod_coursework\export\csv($this->coursework, $csv_cells, $filename);
- $array1 = $csv->add_cells_to_array($submission1,$student1,$csv_cells);
- $array2 = $csv->add_cells_to_array($submission2,$student2,$csv_cells);
+ $array1 = $csv->add_cells_to_array($submission1, $student1, $csv_cells);
+ $array2 = $csv->add_cells_to_array($submission2, $student2, $csv_cells);
$csv_grades = array_merge($array1, $array2);
@@ -435,13 +435,13 @@ public function test_two_students_one_in_sample(){
$assessors_grades = array('0' => $studentname1,
'1' => $student1->username,
- '2' => userdate(time(),$dateformat),
+ '2' => userdate(time(), $dateformat),
'3' => 'On time',
'4' => $this->coursework->get_username_hash($submission1->allocatableid),
'5' => $feedback1->grade,
'6' => $assessorname1,
'7' => $assessorusername1,
- '8' => userdate(time(),$dateformat),
+ '8' => userdate(time(), $dateformat),
'9' => '',
'10' => '',
'11' => '',
@@ -453,21 +453,21 @@ public function test_two_students_one_in_sample(){
'17' => $feedback1->grade,
'18' => $studentname2,
'19' => $student2->username,
- '20' => userdate(time(),$dateformat),
+ '20' => userdate(time(), $dateformat),
'21' => 'On time',
'22' => $this->coursework->get_username_hash($submission2->allocatableid),
'23' => $feedback2->grade,
'24' => $assessorname1,
'25' => $assessorusername1,
- '26' => userdate(time(),$dateformat),
+ '26' => userdate(time(), $dateformat),
'27' => $feedback3->grade,
'28' => $assessorname2,
'29' => $assessorusername2,
- '30' => userdate(time(),$dateformat),
+ '30' => userdate(time(), $dateformat),
'31' => $feedback4->grade,
'32' => $assessorname2,
'33' => $assessorusername2,
- '34' => userdate(time(),$dateformat),
+ '34' => userdate(time(), $dateformat),
'35' => $feedback4->grade);
$this->assertEquals($assessors_grades, $csv_grades);
diff --git a/tests/classes/export/grading_sheet_download_test.php b/tests/classes/export/grading_sheet_download_test.php
index c9753cad..769e8cb2 100644
--- a/tests/classes/export/grading_sheet_download_test.php
+++ b/tests/classes/export/grading_sheet_download_test.php
@@ -75,12 +75,12 @@ public function test_one_stage_no_allocations(){
$submission = $this->submission;
// headers and data for csv
- $csv_cells = array('submissionid','submissionfileid','name','username','submissiontime','singlegrade','feedbackcomments');
+ $csv_cells = array('submissionid', 'submissionfileid', 'name', 'username', 'submissiontime', 'singlegrade', 'feedbackcomments');
$timestamp = date('d_m_y @ H-i');
$filename = get_string('gradingsheetfor', 'coursework'). $this->coursework->name .' '.$timestamp;
$grading_sheet = new \mod_coursework\export\grading_sheet($this->coursework, $csv_cells, $filename);
- $actual_submission = $grading_sheet->add_cells_to_array($submission,$student,$csv_cells);
+ $actual_submission = $grading_sheet->add_cells_to_array($submission, $student, $csv_cells);
$studentname = $student->lastname .' '.$student->firstname;
@@ -171,15 +171,15 @@ public function test_two_stages_with_allocations(){
// headers and data for csv
- $csv_cells = array('submissionid','submissionfileid','name','username','submissiontime',
- 'assessor1','assessorgrade1','assessorfeedback1','assessor2','assessorgrade2','assessorfeedback2',
- 'agreedgrade','agreedfeedback');
+ $csv_cells = array('submissionid', 'submissionfileid', 'name', 'username', 'submissiontime',
+ 'assessor1', 'assessorgrade1', 'assessorfeedback1', 'assessor2', 'assessorgrade2', 'assessorfeedback2',
+ 'agreedgrade', 'agreedfeedback');
$timestamp = date('d_m_y @ H-i');
$filename = get_string('gradingsheetfor', 'coursework'). $this->coursework->name .' '.$timestamp;
$grading_sheet = new \mod_coursework\export\grading_sheet($this->coursework, $csv_cells, $filename);
- $actual_submission1 = $grading_sheet->add_cells_to_array($submission1,$student1,$csv_cells);
- $actual_submission2 = $grading_sheet->add_cells_to_array($submission2,$student2,$csv_cells);
+ $actual_submission1 = $grading_sheet->add_cells_to_array($submission1, $student1, $csv_cells);
+ $actual_submission2 = $grading_sheet->add_cells_to_array($submission2, $student2, $csv_cells);
$actual_submission = array_merge($actual_submission1, $actual_submission2);
$studentname1 = $student1->lastname .' '.$student1->firstname;
diff --git a/view.php b/view.php
index f8780b63..0eacd486 100644
--- a/view.php
+++ b/view.php
@@ -127,7 +127,7 @@
// first name alpha
if (!(isset($SESSION->coursework_firstname_alpha[$course_module_id]))) {
- $SESSION->coursework_firstname_alpha[$course_module_id] = optional_param('coursework_firstname_alpha','',PARAM_ALPHA);
+ $SESSION->coursework_firstname_alpha[$course_module_id] = optional_param('coursework_firstname_alpha', '',PARAM_ALPHA);
$coursework_firstname_alpha = $SESSION->coursework_firstname_alpha[$course_module_id];
} else {
$coursework_firstname_alpha = optional_param('coursework_firstname_alpha', $SESSION->coursework_firstname_alpha[$course_module_id],PARAM_ALPHA);
@@ -136,7 +136,7 @@
// last name alpha
if (!(isset($SESSION->coursework_lastname_alpha[$course_module_id]))) {
- $SESSION->coursework_lastname_alpha[$course_module_id] = optional_param('coursework_lastname_alpha','', PARAM_ALPHA);
+ $SESSION->coursework_lastname_alpha[$course_module_id] = optional_param('coursework_lastname_alpha', '', PARAM_ALPHA);
$coursework_lastname_alpha= $SESSION->coursework_lastname_alpha[$course_module_id];
} else {
$coursework_lastname_alpha = optional_param('coursework_lastname_alpha', $SESSION->coursework_lastname_alpha[$course_module_id],PARAM_ALPHA);
@@ -145,7 +145,7 @@
// group name alpha
if (!(isset($SESSION->coursework_groupname_alpha[$course_module_id]))) {
- $SESSION->coursework_groupname_alpha[$course_module_id] = optional_param('coursework_groupname_alpha','', PARAM_ALPHA);
+ $SESSION->coursework_groupname_alpha[$course_module_id] = optional_param('coursework_groupname_alpha', '', PARAM_ALPHA);
$coursework_groupname_alpha = $SESSION->coursework_groupname_alpha[$course_module_id];
} else {
$coursework_groupname_alpha= optional_param('coursework_groupname_alpha', $SESSION->coursework_groupname_alpha[$course_module_id],PARAM_ALPHA);
@@ -196,7 +196,7 @@
// first name alpha
if (!(isset($SESSION->viewallstudents_firstname_alpha[$course_module_id]))) {
- $SESSION->viewallstudents_firstname_alpha[$course_module_id] = optional_param('viewallstudents_firstname_alpha','',PARAM_ALPHA);
+ $SESSION->viewallstudents_firstname_alpha[$course_module_id] = optional_param('viewallstudents_firstname_alpha', '',PARAM_ALPHA);
$viewallstudents_firstname_alpha = $SESSION->coursework_firstname_alpha[$course_module_id];
} else {
$viewallstudents_firstname_alpha = optional_param('viewallstudents_firstname_alpha', $SESSION->viewallstudents_firstname_alpha[$course_module_id],PARAM_ALPHA);
@@ -205,7 +205,7 @@
// last name alpha
if (!(isset($SESSION->viewallstudents_lastname_alpha[$course_module_id]))) {
- $SESSION->viewallstudents_lastname_alpha[$course_module_id] = optional_param('viewallstudents_lastname_alpha','', PARAM_ALPHA);
+ $SESSION->viewallstudents_lastname_alpha[$course_module_id] = optional_param('viewallstudents_lastname_alpha', '', PARAM_ALPHA);
$viewallstudents_lastname_alpha = $SESSION->viewallstudents_lastname_alpha[$course_module_id];
} else {
$viewallstudents_lastname_alpha = optional_param('viewallstudents_lastname_alpha', $SESSION->viewallstudents_lastname_alpha[$course_module_id],PARAM_ALPHA);
@@ -214,7 +214,7 @@
// group name alpha
if (!(isset($SESSION->viewallstudents_groupname_alpha[$course_module_id]))) {
- $SESSION->viewallstudents_groupname_alpha[$course_module_id] = optional_param('viewallstudents_groupname_alpha','', PARAM_ALPHA);
+ $SESSION->viewallstudents_groupname_alpha[$course_module_id] = optional_param('viewallstudents_groupname_alpha', '', PARAM_ALPHA);
$viewallstudents_groupname_alpha = $SESSION->viewallstudents_groupname_alpha[$course_module_id];
} else {
$viewallstudents_groupname_alpha= optional_param('viewallstudents_groupname_alpha', $SESSION->viewallstudents_groupname_alpha[$course_module_id],PARAM_ALPHA);
@@ -285,7 +285,7 @@
$redirectdetail->percentage = $percentage_allocation_not_complete;
$redirectdetail->manual = $manual_allocation_not_complete;
- redirect($CFG->wwwroot.'/mod/coursework/actions/allocate.php?id='.$course_module_id,get_string('configuration_needed','coursework',$redirectdetail));
+ redirect($CFG->wwwroot.'/mod/coursework/actions/allocate.php?id='.$course_module_id,get_string('configuration_needed', 'coursework', $redirectdetail));
}
}*/
@@ -313,7 +313,7 @@
if ($export_grades){
// headers and data for csv
- $csv_cells = array('name','username','idnumber','email');
+ $csv_cells = array('name', 'username', 'idnumber', 'email');
if ($coursework->personal_deadlines_enabled()){
$csv_cells[] = 'personaldeadline';
@@ -541,8 +541,8 @@
$viewallstudents_groupname_alpha = $SESSION->viewallstudents_groupname_alpha[$course_module_id] = "";
}
- $html .= $page_renderer->teacher_grading_page($coursework, $page, $perpage, $sortby, $sorthow, $group,$coursework_firstname_alpha,$coursework_lastname_alpha,$coursework_groupname_alpha, $resettable);
- $html .= $page_renderer->non_teacher_allocated_grading_page($coursework,$viewallstudents_page,$viewallstudents_perpage,$viewallstudents_sortby,$viewallstudents_sorthow,$group,$displayallstudents,$viewallstudents_firstname_alpha,$viewallstudents_lastname_alpha,$viewallstudents_groupname_alpha);
+ $html .= $page_renderer->teacher_grading_page($coursework, $page, $perpage, $sortby, $sorthow, $group, $coursework_firstname_alpha, $coursework_lastname_alpha, $coursework_groupname_alpha, $resettable);
+ $html .= $page_renderer->non_teacher_allocated_grading_page($coursework, $viewallstudents_page, $viewallstudents_perpage, $viewallstudents_sortby, $viewallstudents_sorthow, $group, $displayallstudents, $viewallstudents_firstname_alpha, $viewallstudents_lastname_alpha, $viewallstudents_groupname_alpha);
$html .= $page_renderer->datatables_render($coursework);
$html .= $page_renderer->render_modal();
}
From 190e6964b1a117cfef03661bc1563178638e9e29 Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Mon, 12 Aug 2024 12:16:28 +0100
Subject: [PATCH 10/51] CTP-3558 coding std remove excess newlines
---
actions/ajax/deadline_extension/edit.php | 1 -
actions/ajax/deadline_extension/new.php | 1 -
actions/ajax/deadline_extension/submit.php | 1 -
actions/allocate.php | 21 ------
actions/allocationsession.php | 3 -
actions/deadline_extensions/create.php | 1 -
actions/deadline_extensions/edit.php | 1 -
actions/deadline_extensions/new.php | 1 -
actions/deadline_extensions/show.php | 1 -
actions/deadline_extensions/update.php | 1 -
actions/feedbacks/create.php | 2 -
actions/feedbacks/edit.php | 1 -
actions/feedbacks/update.php | 2 -
actions/finalgrade.php | 1 -
actions/general_feedback.php | 1 -
actions/moderations/create.php | 2 -
actions/moderations/update.php | 2 -
actions/personal_deadline.php | 4 --
actions/plagiarism_flagging/create.php | 1 -
actions/plagiarism_flagging/update.php | 1 -
actions/processallocation.php | 5 --
actions/revert.php | 1 -
actions/selectallallocatables.php | 8 ---
actions/set_personal_deadlines.php | 2 -
actions/submissions/create.php | 2 -
actions/submissions/edit.php | 1 -
actions/submissions/finalise.php | 1 -
actions/submissions/new.php | 1 -
actions/submissions/update.php | 1 -
actions/submitonbehalfofstudent.php | 2 -
actions/upload_allocations.php | 7 --
actions/upload_feedback.php | 10 ---
actions/upload_grading_sheet.php | 17 -----
.../backup_coursework_activity_task.class.php | 1 -
backup/moodle2/backup_coursework_stepslib.php | 10 ---
...restore_coursework_activity_task.class.php | 1 -
.../moodle2/restore_coursework_stepslib.php | 7 --
classes/ability.php | 33 ---------
classes/ability/rule.php | 1 -
classes/allocation/allocatable.php | 1 -
classes/allocation/auto_allocator.php | 1 -
classes/allocation/manager.php | 25 -------
classes/allocation/moderatable.php | 3 -
classes/allocation/strategy/base.php | 2 -
classes/allocation/strategy/equal.php | 1 -
classes/allocation/strategy/percentages.php | 1 -
classes/allocation/table/builder.php | 7 --
classes/allocation/table/cell/builder.php | 16 -----
classes/allocation/table/cell/data.php | 1 -
classes/allocation/table/cell/processor.php | 5 --
classes/allocation/table/processor.php | 1 -
classes/allocation/table/row/builder.php | 2 -
classes/allocation/table/row/processor.php | 2 -
classes/allocation/upload.php | 5 --
classes/allocation/widget.php | 1 -
classes/assessor_feedback_row.php | 1 -
classes/assessor_feedback_table.php | 1 -
classes/auto_grader/auto_grader.php | 1 -
classes/auto_grader/average_grade.php | 10 ---
classes/auto_grader/none.php | 1 -
classes/auto_grader/percentage_distance.php | 5 --
.../controllers/allocations_controller.php | 3 -
classes/controllers/controller_base.php | 2 -
.../deadline_extensions_controller.php | 7 --
classes/controllers/feedback_controller.php | 15 ----
classes/controllers/grading_controller.php | 1 -
.../controllers/moderations_controller.php | 6 --
.../personal_deadlines_controller.php | 12 ----
.../plagiarism_flagging_controller.php | 8 ---
.../controllers/submissions_controller.php | 12 ----
classes/cron.php | 10 ---
.../coursework_groups_decorator.php | 3 -
.../submission_groups_decorator.php | 1 -
classes/event/assessable_submitted.php | 1 -
classes/event/assessable_uploaded.php | 3 -
.../course_module_instance_list_viewed.php | 2 -
classes/event/course_module_viewed.php | 2 -
classes/event/coursework_deadline_changed.php | 2 -
.../coursework_plagiarism_flag_updated.php | 1 -
classes/event/feedback_changed.php | 6 --
classes/exceptions/access_denied.php | 1 -
classes/exceptions/late_submission.php | 1 -
classes/export/csv.php | 9 ---
.../export/csv/cells/agreedfeedback_cell.php | 4 --
classes/export/csv/cells/agreedgrade_cell.php | 17 -----
classes/export/csv/cells/assessor_cell.php | 4 --
.../csv/cells/assessorfeedback_cell.php | 5 --
.../export/csv/cells/assessorgrade_cell.php | 16 -----
classes/export/csv/cells/cell_base.php | 15 ----
classes/export/csv/cells/cell_interface.php | 4 --
classes/export/csv/cells/email_cell.php | 1 -
.../csv/cells/extensiondeadline_cell.php | 1 -
.../csv/cells/extensionextrainfo_cell.php | 2 -
.../export/csv/cells/extensionreason_cell.php | 1 -
.../csv/cells/feedbackcomments_cell.php | 4 --
classes/export/csv/cells/finalgrade_cell.php | 1 -
classes/export/csv/cells/group_cell.php | 1 -
classes/export/csv/cells/idnumber_cell.php | 1 -
.../csv/cells/moderationagreement_cell.php | 1 -
classes/export/csv/cells/name_cell.php | 1 -
.../export/csv/cells/otherassessors_cell.php | 6 --
.../csv/cells/personaldeadline_cell.php | 1 -
.../csv/cells/plagiarismflagcomment_cell.php | 1 -
.../csv/cells/plagiarismflagstatus_cell.php | 1 -
classes/export/csv/cells/singlegrade_cell.php | 17 -----
classes/export/csv/cells/stages_cell.php | 10 ---
.../export/csv/cells/submissiondate_cell.php | 2 -
.../csv/cells/submissionfileid_cell.php | 1 -
.../export/csv/cells/submissionid_cell.php | 1 -
.../export/csv/cells/submissiontime_cell.php | 3 -
classes/export/csv/cells/username_cell.php | 1 -
classes/export/grading_sheet.php | 6 --
classes/export/import.php | 66 ------------------
classes/feedback_files.php | 1 -
classes/file_importer.php | 13 ----
classes/forms/assessor_feedback_mform.php | 5 --
classes/forms/deadline_extension_form.php | 7 --
classes/forms/moderator_agreement_mform.php | 5 --
classes/forms/personal_deadline_form.php | 4 --
classes/forms/plagiarism_flagging_mform.php | 1 -
classes/forms/student_submission_form.php | 4 --
classes/forms/upload_allocations_form.php | 3 -
classes/forms/upload_feedback_form.php | 5 --
classes/forms/upload_grading_sheet_form.php | 8 ---
classes/forms/view_all_students_mform.php | 3 -
classes/framework/ability.php | 2 -
classes/framework/decorator.php | 2 -
classes/framework/table_base.php | 3 -
classes/framework/test/classes/user_table.php | 1 -
classes/framework/test/table_base_test.php | 2 -
classes/grade_judge.php | 8 ---
classes/grades/gradeitems.php | 1 -
classes/grading_report.php | 6 --
classes/grading_table_row_base.php | 6 --
classes/grading_table_row_multi.php | 3 -
classes/grading_table_row_single.php | 2 -
classes/mailer.php | 5 --
classes/models/assessment_set_membership.php | 1 -
classes/models/coursework.php | 58 ----------------
classes/models/deadline_extension.php | 1 -
classes/models/feedback.php | 5 --
classes/models/group.php | 1 -
classes/models/moderation.php | 9 ---
classes/models/moderation_set_rule.php | 2 -
classes/models/null_feedback.php | 1 -
classes/models/null_user.php | 4 --
classes/models/outstanding_marking.php | 17 -----
classes/models/personal_deadline.php | 2 -
classes/models/plagiarism_flag.php | 3 -
classes/models/reminder.php | 1 -
classes/models/sample_set_rule.php | 2 -
classes/models/submission.php | 18 -----
classes/models/user.php | 3 -
.../minimum_range_grade_percent.php | 3 -
.../minimum_range_grade_raw.php | 2 -
.../range_grade_percent.php | 1 -
.../moderation_set_rule/range_grade_raw.php | 2 -
.../range_total_percent.php | 1 -
classes/observer.php | 7 --
classes/personal_deadline/allocatable.php | 1 -
classes/personal_deadline/table/builder.php | 3 -
.../personal_deadline/table/row/builder.php | 3 -
classes/plagiarism_helpers/base.php | 1 -
classes/plagiarism_helpers/turnitin.php | 1 -
classes/privacy/provider.php | 1 -
.../grading_report/base_renderer.php | 1 -
.../grading_report/cells/_user_cell.php | 1 -
.../grading_report/cells/allocatable_cell.php | 1 -
.../grading_report/cells/cell_base.php | 5 --
.../grading_report/cells/cell_interface.php | 3 -
.../grading_report/cells/email_cell.php | 1 -
.../grading_report/cells/first_name_cell.php | 1 -
.../cells/first_name_letter_cell.php | 1 -
.../cells/grade_for_gradebook_cell.php | 1 -
.../grading_report/cells/group_cell.php | 2 -
.../grading_report/cells/idnumber_cell.php | 1 -
.../grading_report/cells/last_name_cell.php | 1 -
.../cells/last_name_letter_cell.php | 1 -
.../cells/moderation_agreement_cell.php | 10 ---
.../grading_report/cells/moderation_cell.php | 2 -
.../cells/multiple_agreed_grade_cell.php | 5 --
.../cells/personal_deadline_cell.php | 1 -
.../grading_report/cells/plagiarism_cell.php | 1 -
.../cells/plagiarism_flag_cell.php | 3 -
.../cells/single_assessor_feedback_cell.php | 5 --
.../grading_report/cells/status_cell.php | 1 -
.../grading_report/cells/submission_cell.php | 2 -
.../cells/time_submitted_cell.php | 3 -
.../grading_report/cells/user_cell.php | 1 -
.../component_factory_interface.php | 2 -
.../grading_report/multi_renderer.php | 1 -
.../grading_report/single_renderer.php | 1 -
.../multi_marker_feedback_sub_rows.php | 4 --
.../grading_report/sub_rows/no_sub_rows.php | 1 -
.../sub_rows/sub_rows_interface.php | 1 -
.../renderers/deadline_extension_renderer.php | 2 -
.../renderers/personal_deadline_renderer.php | 3 -
classes/router.php | 1 -
classes/sample_set_rule/range_sample_type.php | 34 ---------
classes/sample_set_rule/sample_base.php | 10 ---
classes/sample_set_rule/total_sample_type.php | 23 -------
classes/stages/assessor.php | 1 -
classes/stages/base.php | 19 -----
classes/stages/final_agreed.php | 1 -
classes/stages/moderator.php | 1 -
classes/submission_files.php | 1 -
classes/task/enrol_task.php | 1 -
classes/task/unenrol_task.php | 1 -
classes/test_helpers/factory_mixin.php | 1 -
classes/traits/allocatable_functions.php | 3 -
classes/warnings.php | 1 -
db/access.php | 1 -
db/caches.php | 1 -
db/events.php | 3 -
db/install.php | 1 -
db/upgrade.php | 48 -------------
index.php | 1 -
lang/en/coursework.php | 4 --
lib.php | 16 -----
mod_form.php | 54 ---------------
renderable.php | 2 -
renderers/grading_report_renderer.php | 5 --
renderers/object_renderer.php | 69 -------------------
renderers/page_renderer.php | 48 -------------
settings.php | 16 -----
tests/behat/behat_mod_coursework.php | 36 ----------
tests/behat/pages/allocations_page.php | 6 --
tests/behat/pages/coursework_page.php | 3 -
tests/behat/pages/edit_extension_page.php | 1 -
tests/behat/pages/gradebook_page.php | 2 -
tests/behat/pages/login_page.php | 2 -
.../pages/multiple_grading_interface.php | 11 ---
tests/behat/pages/new_extension_page.php | 2 -
tests/behat/pages/show_feedback_page.php | 1 -
.../behat/pages/single_grading_interface.php | 1 -
tests/behat/pages/student_page.php | 1 -
tests/behat/pages/student_submission_form.php | 2 -
tests/classes/ability_test.php | 2 -
.../allocation/auto_allocator_test.php | 4 --
.../allocation/form/table_processor_test.php | 2 -
.../allocation/strategy/percentages_test.php | 2 -
tests/classes/allocation/strategy_test.php | 2 -
.../auto_grader/percentage_distance_test.php | 1 -
.../deadline_extensions_controller_test.php | 2 -
tests/classes/cron_test.php | 3 -
tests/classes/export/csv_test.php | 21 ------
.../export/grading_sheet_download_test.php | 9 ---
tests/classes/grade_judge_test.php | 5 --
tests/classes/models/coursework_test.php | 1 -
.../models/moderation_set_membership_test.php | 1 -
tests/classes/models/submission_test.php | 2 -
tests/classes/models/user_test.php | 2 -
tests/classes/rule_test.php | 1 -
tests/classes/stages/assessor_test.php | 1 -
tests/classes/stages/final_agreed_test.php | 1 -
tests/cron_tester.php | 1 -
tests/generator/lib.php | 3 -
tests/generator_test.php | 1 -
version.php | 1 -
view.php | 16 -----
260 files changed, 1398 deletions(-)
diff --git a/actions/ajax/deadline_extension/edit.php b/actions/ajax/deadline_extension/edit.php
index 2b144889..9c66ace6 100644
--- a/actions/ajax/deadline_extension/edit.php
+++ b/actions/ajax/deadline_extension/edit.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
require_once(dirname(__FILE__) . '/../../../../../config.php');
global $CFG, $USER;
diff --git a/actions/ajax/deadline_extension/new.php b/actions/ajax/deadline_extension/new.php
index 8999dfcb..162f851b 100644
--- a/actions/ajax/deadline_extension/new.php
+++ b/actions/ajax/deadline_extension/new.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
require_once(dirname(__FILE__) . '/../../../../../config.php');
global $CFG, $USER;
diff --git a/actions/ajax/deadline_extension/submit.php b/actions/ajax/deadline_extension/submit.php
index b9b0509f..c4461592 100644
--- a/actions/ajax/deadline_extension/submit.php
+++ b/actions/ajax/deadline_extension/submit.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
require_once(dirname(__FILE__) . '/../../../../../config.php');
global $CFG, $USER;
diff --git a/actions/allocate.php b/actions/allocate.php
index db9dadee..9c3b47b2 100644
--- a/actions/allocate.php
+++ b/actions/allocate.php
@@ -107,8 +107,6 @@
$PAGE->requires->string_for_js('sameassessorerror', 'coursework');
-
-
$allocationsmanager = $coursework->get_allocation_manager();
$allocationtable = new mod_coursework\allocation\table\builder($coursework, $options);
$allocationtable = new mod_coursework_allocation_table($allocationtable);
@@ -128,7 +126,6 @@
$coursework->save();
}
-
if ($samplingformsavebutton) {
if ($coursework->sampling_enabled()) {
$allocationsmanager->save_sample();
@@ -146,8 +143,6 @@
}
}
-
-
// 2. Process the manual allocations
// Did we just get the form submitted to us?
@@ -158,13 +153,8 @@
$allocationsmanager->auto_generate_sample_set();
}
-
// 3. Process the auto allocations to fill in the gaps.
-
-
-
-
// Get the data to render as a moderation set widget.
$allocationwidget = new widget($coursework);
$allocationwidget = new \mod_coursework_allocation_widget($allocationwidget);
@@ -178,7 +168,6 @@
*/
$page_renderer = $PAGE->get_renderer('mod_coursework', 'page');
-
$warnings = new \mod_coursework\warnings($coursework);
$percentage_allocation_not_complete = $warnings->percentage_allocations_not_complete();
@@ -207,8 +196,6 @@
// Add coursework id etc.
echo \html_writer::input_hidden_params($PAGE->url);
-
-
if ($coursework->sampling_enabled()) { // Do not delete yet - refactoring...
echo \html_writer::start_tag('form', array('id' => 'sampling_form',
'method' => 'post'));
@@ -217,16 +204,11 @@
echo html_writer::end_tag('form');
}
-
-
-
-
// Start form. The page has now been broken into two forms sampling section and allocation section
// Open form tag.
echo \html_writer::start_tag('form', array('id' => 'allocation_form',
'method' => 'post'));
-
if ($coursework->allocation_enabled()) {
echo $object_renderer->render($allocationwidget);
}
@@ -238,7 +220,6 @@
echo html_writer::start_tag('div', $attributes);
echo html_writer::end_tag('div');
-
echo html_writer::tag('h3', get_string('assessormoderatorgrades', 'mod_coursework'));
echo html_writer::tag('div', get_string('pininfo', 'mod_coursework'), array('class' => 'pininfo'));
@@ -255,6 +236,4 @@
echo html_writer::end_tag('form');
-
-
echo $OUTPUT->footer();
diff --git a/actions/allocationsession.php b/actions/allocationsession.php
index bb1d5b88..f51edecd 100644
--- a/actions/allocationsession.php
+++ b/actions/allocationsession.php
@@ -24,7 +24,6 @@
global $SESSION;
-
$assesorselect = required_param_array('assesorselect',PARAM_RAW);
$assesorselectvalue = required_param_array('assesorselectvalue',PARAM_RAW);
$pinnedchk = optional_param_array('pinned',array(),PARAM_RAW);
@@ -43,8 +42,6 @@
$SESSION->coursework_allocationsessions[$coursemoduleid] = array();
}
-
-
for($i = 0; $i < count($assesorselect); $i++) {
$SESSION->coursework_allocationsessions[$coursemoduleid][$assesorselect[$i]] = $assesorselectvalue[$i];
}
diff --git a/actions/deadline_extensions/create.php b/actions/deadline_extensions/create.php
index 0037e9f5..25eb856f 100644
--- a/actions/deadline_extensions/create.php
+++ b/actions/deadline_extensions/create.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
require_once(dirname(__FILE__) . '/../../../../config.php');
global $CFG, $PAGE, $USER;
diff --git a/actions/deadline_extensions/edit.php b/actions/deadline_extensions/edit.php
index 5fd903c3..947d01dc 100644
--- a/actions/deadline_extensions/edit.php
+++ b/actions/deadline_extensions/edit.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
require_once(dirname(__FILE__) . '/../../../../config.php');
global $CFG, $USER;
diff --git a/actions/deadline_extensions/new.php b/actions/deadline_extensions/new.php
index 4b8ae125..aa55f47d 100644
--- a/actions/deadline_extensions/new.php
+++ b/actions/deadline_extensions/new.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
require_once(dirname(__FILE__) . '/../../../../config.php');
global $CFG, $USER;
diff --git a/actions/deadline_extensions/show.php b/actions/deadline_extensions/show.php
index deb8f2f5..8a872a0a 100644
--- a/actions/deadline_extensions/show.php
+++ b/actions/deadline_extensions/show.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
require_once(dirname(__FILE__) . '/../../../../config.php');
global $CFG, $USER;
diff --git a/actions/deadline_extensions/update.php b/actions/deadline_extensions/update.php
index d4dbba71..c25265ad 100644
--- a/actions/deadline_extensions/update.php
+++ b/actions/deadline_extensions/update.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
require_once(dirname(__FILE__) . '/../../../../config.php');
global $CFG, $PAGE, $USER;
diff --git a/actions/feedbacks/create.php b/actions/feedbacks/create.php
index 142b07b0..045f9f51 100644
--- a/actions/feedbacks/create.php
+++ b/actions/feedbacks/create.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* Creates a feedback instance and redirects to the coursework page.
*/
@@ -29,7 +28,6 @@
global $CFG, $USER;
-
$submissionid = required_param('submissionid', PARAM_INT);
$isfinalgrade = optional_param('isfinalgrade', 0, PARAM_INT);
$assessorid = optional_param('assessorid', $USER->id, PARAM_INT);
diff --git a/actions/feedbacks/edit.php b/actions/feedbacks/edit.php
index 5786513d..57ebd485 100644
--- a/actions/feedbacks/edit.php
+++ b/actions/feedbacks/edit.php
@@ -24,7 +24,6 @@
global $CFG, $USER;
-
$feedbackid = optional_param('feedbackid', 0, PARAM_INT);
$ajax = optional_param('ajax', 0, PARAM_INT);
diff --git a/actions/feedbacks/update.php b/actions/feedbacks/update.php
index 11004490..ab1bafad 100644
--- a/actions/feedbacks/update.php
+++ b/actions/feedbacks/update.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* Creates a feedback instance and redirects to the coursework page.
*/
@@ -29,7 +28,6 @@
global $CFG, $USER;
-
$feedbackid = required_param('feedbackid', PARAM_INT);
$finalised = !!optional_param('submitbutton', 0, PARAM_TEXT);
$ajax = optional_param('ajax', 0, PARAM_INT);
diff --git a/actions/finalgrade.php b/actions/finalgrade.php
index 13663641..4df8234c 100644
--- a/actions/finalgrade.php
+++ b/actions/finalgrade.php
@@ -167,4 +167,3 @@
echo $OUTPUT->footer();
-
diff --git a/actions/general_feedback.php b/actions/general_feedback.php
index 70562f2f..9c96d3d2 100644
--- a/actions/general_feedback.php
+++ b/actions/general_feedback.php
@@ -24,7 +24,6 @@
require_once(dirname(__FILE__) . '/../../../config.php');
-
global $CFG, $PAGE, $DB, $OUTPUT;
$course_module_id = required_param('cmid', PARAM_INT);
diff --git a/actions/moderations/create.php b/actions/moderations/create.php
index 81bd28d8..9b11c938 100644
--- a/actions/moderations/create.php
+++ b/actions/moderations/create.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* Creates a moderation agreement instance and redirects to the coursework page.
*/
@@ -29,7 +28,6 @@
global $CFG, $USER;
-
$submissionid = required_param('submissionid', PARAM_INT);
$feedbackid = required_param('feedbackid', PARAM_INT);
$moderatorid = optional_param('moderatorid', $USER->id, PARAM_INT);
diff --git a/actions/moderations/update.php b/actions/moderations/update.php
index 05287a0f..627e82ba 100644
--- a/actions/moderations/update.php
+++ b/actions/moderations/update.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* Creates a moderation instance and redirects to the coursework page.
*/
@@ -29,7 +28,6 @@
global $CFG, $USER;
-
$moderationid = required_param('moderationid', PARAM_INT);
$params = array(
diff --git a/actions/personal_deadline.php b/actions/personal_deadline.php
index e5e52428..885f1a77 100644
--- a/actions/personal_deadline.php
+++ b/actions/personal_deadline.php
@@ -20,13 +20,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
require_once(dirname(__FILE__) . '/../../../config.php');
global $CFG, $USER, $PAGE, $DB;
-
-
$courseworkid = required_param('courseworkid', PARAM_INT);
$allocatableid_arr = optional_param_array('allocatableid_arr', false, PARAM_RAW);
$allocatableid = optional_param('allocatableid', $USER->id, PARAM_RAW);
@@ -38,7 +35,6 @@
$allocatableid = (!empty($allocatableid_arr)) ? $allocatableid_arr : $allocatableid ;
-
$coursework_db = $DB->get_record('coursework',array('id' => $courseworkid));
$coursework = \mod_coursework\models\coursework::find($coursework_db);
diff --git a/actions/plagiarism_flagging/create.php b/actions/plagiarism_flagging/create.php
index 4270196d..1afc831c 100644
--- a/actions/plagiarism_flagging/create.php
+++ b/actions/plagiarism_flagging/create.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* Creates a plagiarism flagging instance and redirects to the coursework page.
*/
diff --git a/actions/plagiarism_flagging/update.php b/actions/plagiarism_flagging/update.php
index 22f764d2..903d7245 100644
--- a/actions/plagiarism_flagging/update.php
+++ b/actions/plagiarism_flagging/update.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* Updates a plagiarism flag instance and redirects to the coursework page.
*/
diff --git a/actions/processallocation.php b/actions/processallocation.php
index e0396a9a..8bcaa224 100644
--- a/actions/processallocation.php
+++ b/actions/processallocation.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
//this stops the page from aborting when an ajax call disconnects
ignore_user_abort(true);
@@ -32,8 +31,6 @@
require_once(dirname(__FILE__).'/../../../config.php');
-
-
global $CFG, $OUTPUT, $DB, $PAGE;
require_once($CFG->dirroot.'/mod/coursework/lib.php');
@@ -45,7 +42,6 @@
$coursework = coursework::find($coursework);
$assessorallocationstrategy = optional_param('assessorallocationstrategy', false, PARAM_TEXT);
-
require_login($course, true, $coursemodule);
require_capability('mod/coursework:allocate', $PAGE->context, null, true, "Can't allocate here - permission denied.");
@@ -62,5 +58,4 @@
$allocator = new \mod_coursework\allocation\auto_allocator($coursework);
$allocator->process_allocations();
-
echo $coursework->name. "re-allocated";
diff --git a/actions/revert.php b/actions/revert.php
index b46b0420..78aff861 100644
--- a/actions/revert.php
+++ b/actions/revert.php
@@ -30,7 +30,6 @@
global $DB, $PAGE, $CFG;
-
$cmid = required_param('cmid', PARAM_INT);
$submission_id = required_param('submissionid', PARAM_INT);
diff --git a/actions/selectallallocatables.php b/actions/selectallallocatables.php
index f92b313a..e241d770 100644
--- a/actions/selectallallocatables.php
+++ b/actions/selectallallocatables.php
@@ -20,15 +20,11 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
-
use mod_coursework\models\coursework;
use mod_coursework\allocation\widget;
require_once(dirname(__FILE__).'/../../../config.php');
-
-
global $CFG, $OUTPUT, $DB, $PAGE;
require_once($CFG->dirroot.'/mod/coursework/lib.php');
@@ -41,9 +37,6 @@
$coursework = coursework::find($coursework);
$assessorallocationstrategy = optional_param('assessorallocationstrategy', false, PARAM_TEXT);
-
-
-
if ($stagenumber > 0) {
if (!isset($SESSION->allocate_page_selectentirestage[$coursework->id()]['assessor_'.$stagenumber])) {
@@ -62,4 +55,3 @@
$SESSION->allocate_page_selectentirestage[$coursework->id()]['moderator'] = !$SESSION->allocate_page_selectentirestage[$coursework->id()]['moderator'];
}
-
diff --git a/actions/set_personal_deadlines.php b/actions/set_personal_deadlines.php
index 7bdff01d..042e2fdf 100644
--- a/actions/set_personal_deadlines.php
+++ b/actions/set_personal_deadlines.php
@@ -42,7 +42,6 @@
$sorthow = optional_param('sorthow', '', PARAM_ALPHA);
$options = compact('sortby', 'sorthow');
-
require_login($course, true, $coursemodule);
require_capability('mod/coursework:editpersonaldeadline', $PAGE->context, null, true, "Can't change personal deadlines here - permission denied.");
@@ -77,5 +76,4 @@
echo $object_renderer->render($personal_deadlines_table);
-
echo $OUTPUT->footer();
diff --git a/actions/submissions/create.php b/actions/submissions/create.php
index 00295aec..336fbf68 100644
--- a/actions/submissions/create.php
+++ b/actions/submissions/create.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* Creates a submission instance and redirects to the coursework page.
*/
@@ -35,7 +34,6 @@
$submissionid = optional_param('submissionid', 0, PARAM_INT);
$finalised = !!optional_param('finalisebutton', 0, PARAM_TEXT);
-
if (!in_array($allocatabletype, array('user', 'group'))) {
throw new \mod_coursework\exceptions\access_denied(\mod_coursework\models\coursework::find($courseworkid),
'Bad alloctable type');
diff --git a/actions/submissions/edit.php b/actions/submissions/edit.php
index 56671e9d..061d591c 100644
--- a/actions/submissions/edit.php
+++ b/actions/submissions/edit.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* Creates a submission instance and redirects to the coursework page.
*/
diff --git a/actions/submissions/finalise.php b/actions/submissions/finalise.php
index 395b8017..0695511b 100644
--- a/actions/submissions/finalise.php
+++ b/actions/submissions/finalise.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* Creates a submission instance and redirects to the coursework page.
*/
diff --git a/actions/submissions/new.php b/actions/submissions/new.php
index 54e4cbfa..20a33ba6 100644
--- a/actions/submissions/new.php
+++ b/actions/submissions/new.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* Creates a submission instance and redirects to the coursework page.
*/
diff --git a/actions/submissions/update.php b/actions/submissions/update.php
index f41aa223..02bc61b3 100644
--- a/actions/submissions/update.php
+++ b/actions/submissions/update.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* Creates a submission instance and redirects to the coursework page.
*/
diff --git a/actions/submitonbehalfofstudent.php b/actions/submitonbehalfofstudent.php
index ea764066..39d23809 100644
--- a/actions/submitonbehalfofstudent.php
+++ b/actions/submitonbehalfofstudent.php
@@ -30,7 +30,6 @@
global $CFG, $DB, $PAGE, $OUTPUT;
-
$coursemoduleid = required_param('cmid', PARAM_INT);
$coursemodule = $DB->get_record('course_modules', array('id' => $coursemoduleid));
$coursework = coursework::find($coursemodule->instance);
@@ -91,7 +90,6 @@
$submitform->set_data($submission);
}
-
/**
* @var mod_coursework_page_renderer $page_renderer
*/
diff --git a/actions/upload_allocations.php b/actions/upload_allocations.php
index a7ce3cae..0e03db81 100644
--- a/actions/upload_allocations.php
+++ b/actions/upload_allocations.php
@@ -23,7 +23,6 @@
use mod_coursework\models\coursework;
use mod_coursework\allocation;
-
require_once(dirname(__FILE__).'/../../../config.php');
global $CFG, $DB, $PAGE, $OUTPUT;
@@ -32,7 +31,6 @@
require_once($CFG->libdir.'/csvlib.class.php');
-
$coursemoduleid = required_param('cmid', PARAM_INT);
$coursemodule = $DB->get_record('course_modules', array('id' => $coursemoduleid));
@@ -48,23 +46,18 @@
$grading_sheet_capabilities = array('mod/coursework:allocate');
-
// Bounce anyone who shouldn't be here.
if (!has_any_capability($grading_sheet_capabilities, $PAGE->context)) {
$message = 'You do not have permission to upload allocations';
redirect(new moodle_url('mod/coursework/view.php'), $message);
}
-
-
$allocationsuploadform = new upload_allocations_form($coursemoduleid);
if ($allocationsuploadform->is_cancelled()) {
redirect("$CFG->wwwroot/mod/coursework/view.php?id=$coursemoduleid");
}
-
-
if ($data = $allocationsuploadform->get_data()) {
//perform checks on data
diff --git a/actions/upload_feedback.php b/actions/upload_feedback.php
index ed16bc4b..0b3ebb21 100644
--- a/actions/upload_feedback.php
+++ b/actions/upload_feedback.php
@@ -27,12 +27,9 @@
* Time: 11:32
*/
-
use mod_coursework\models\coursework;
use mod_coursework\export;
-
-
require_once(dirname(__FILE__).'/../../../config.php');
global $CFG, $DB, $PAGE, $OUTPUT;
@@ -56,23 +53,18 @@
$grading_sheet_capabilities = array('mod/coursework:addinitialgrade', 'mod/coursework:addagreedgrade', 'mod/coursework:administergrades');
-
// Bounce anyone who shouldn't be here.
if (!has_any_capability($grading_sheet_capabilities, $PAGE->context)) {
$message = 'You do not have permission to upload feedback sheets';
redirect(new moodle_url('mod/coursework/view.php'), $message);
}
-
-
$feedbackform = new upload_feedback_form($coursework, $coursemoduleid);
if ($feedbackform->is_cancelled()) {
redirect(new moodle_url("$CFG->wwwroot/mod/coursework/view.php", array('id' => $coursemoduleid)));
}
-
-
if ($data = $feedbackform->get_data()) {
//perform checks on data
@@ -91,8 +83,6 @@
$fileimporter = new mod_coursework\coursework_file_zip_importer();
-
-
$fileimporter->extract_zip_file($filepath, $coursework->get_context_id());
$updateresults = $fileimporter->import_zip_files($coursework, $stageidentifier, $data->overwrite);
diff --git a/actions/upload_grading_sheet.php b/actions/upload_grading_sheet.php
index 9266898c..b90647b5 100644
--- a/actions/upload_grading_sheet.php
+++ b/actions/upload_grading_sheet.php
@@ -27,12 +27,9 @@
* Time: 11:32
*/
-
use mod_coursework\models\coursework;
use mod_coursework\export;
-
-
require_once(dirname(__FILE__).'/../../../config.php');
global $CFG, $DB, $PAGE, $OUTPUT;
@@ -41,7 +38,6 @@
require_once($CFG->libdir.'/csvlib.class.php');
-
$coursemoduleid = required_param('cmid', PARAM_INT);
$coursemodule = $DB->get_record('course_modules', array('id' => $coursemoduleid));
@@ -58,23 +54,18 @@
$PAGE->set_heading($title);
$grading_sheet_capabilities = array('mod/coursework:addinitialgrade', 'mod/coursework:addagreedgrade', 'mod/coursework:administergrades');
-
// Bounce anyone who shouldn't be here.
if (!has_any_capability($grading_sheet_capabilities, $PAGE->context)) {
$message = 'You do not have permission to upload grading sheets';
redirect(new moodle_url('mod/coursework/view.php'), $message);
}
-
-
$gradinguploadform = new upload_grading_sheet_form($coursemoduleid);
if ($gradinguploadform->is_cancelled()) {
redirect("$CFG->wwwroot/mod/coursework/view.php?id=$coursemoduleid");
}
-
-
if ($data = $gradinguploadform->get_data()) {
//perform checks on data
@@ -99,14 +90,6 @@
//
//}
-
-
-
-
-
-
-
-
} else {
$page_renderer = $PAGE->get_renderer('mod_coursework', 'page');
echo $page_renderer->csv_upload($gradinguploadform, $csvtype);
diff --git a/backup/moodle2/backup_coursework_activity_task.class.php b/backup/moodle2/backup_coursework_activity_task.class.php
index 321b57ae..483d6912 100644
--- a/backup/moodle2/backup_coursework_activity_task.class.php
+++ b/backup/moodle2/backup_coursework_activity_task.class.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
require_once($CFG->dirroot . '/mod/coursework/backup/moodle2/backup_coursework_stepslib.php');
class backup_coursework_activity_task extends backup_activity_task
diff --git a/backup/moodle2/backup_coursework_stepslib.php b/backup/moodle2/backup_coursework_stepslib.php
index 8d08fa92..6c0b66d7 100644
--- a/backup/moodle2/backup_coursework_stepslib.php
+++ b/backup/moodle2/backup_coursework_stepslib.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
class backup_coursework_activity_structure_step extends backup_activity_structure_step
{
protected function define_structure() {
@@ -110,7 +109,6 @@ protected function define_structure() {
'plagiarismflagenabled'
));
-
$sample_strategies =new backup_nested_element('coursework_sample_set_rules');
$sample_strategy = new backup_nested_element('coursework_sample_set_rule',array('id'),
@@ -131,7 +129,6 @@ protected function define_structure() {
if ($userinfo) {
-
$plagiarism_flags = new backup_nested_element('coursework_plagiarism_flags');
$plagiarism_flag = new backup_nested_element('coursework_plagiarism_flag', array('id'),
@@ -147,8 +144,6 @@ protected function define_structure() {
"timemodified"
));
-
-
$moderation_agreements = new backup_nested_element('coursework_mod_agreements');
$moderation_agreement = new backup_nested_element('coursework_mod_agreement', array('id'),
@@ -163,8 +158,6 @@ protected function define_structure() {
"modecommentformat"
));
-
-
$feedbacks=new backup_nested_element('coursework_feedbacks');
$feedback= new backup_nested_element('coursework_feedback',array('id'),
@@ -285,7 +278,6 @@ protected function define_structure() {
"extra_information_format"
));
-
$personal_deadlines=new backup_nested_element('coursework_person_deadlines');
$personal_deadline=new backup_nested_element('coursework_person_deadline', array('id'),
@@ -302,7 +294,6 @@ protected function define_structure() {
"lastmodifiedbyid"
));
-
$sample_members = new backup_nested_element('coursework_sample_set_mbrs');
$sample_member = new backup_nested_element('coursework_sample_set_mbr', array('id'),
@@ -316,7 +307,6 @@ protected function define_structure() {
"selectiontype"
));
-
//A coursework instance has submissions.
$coursework->add_child($submissions);
//Each coursework may have reminders
diff --git a/backup/moodle2/restore_coursework_activity_task.class.php b/backup/moodle2/restore_coursework_activity_task.class.php
index 1ca2d82b..d95685c3 100644
--- a/backup/moodle2/restore_coursework_activity_task.class.php
+++ b/backup/moodle2/restore_coursework_activity_task.class.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/mod/coursework/backup/moodle2/restore_coursework_stepslib.php');
diff --git a/backup/moodle2/restore_coursework_stepslib.php b/backup/moodle2/restore_coursework_stepslib.php
index 39101c3f..6df8dc99 100644
--- a/backup/moodle2/restore_coursework_stepslib.php
+++ b/backup/moodle2/restore_coursework_stepslib.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
defined('MOODLE_INTERNAL') || die();
class restore_coursework_activity_structure_step extends restore_activity_structure_step
@@ -67,7 +66,6 @@ protected function define_structure() {
'mod_agreement' => 'coursework_submissions/coursework_submission/coursework_feedbacks/coursework_feedback/coursework_mod_agreements',
'plagiarism_flag' => 'coursework_submissions/coursework_submission/coursework_plagiarism_flags');
-
foreach($bits as $bit=> $bitpath) {
$p=new restore_path_element("coursework_$bit","/activity/coursework/{$bitpath}/coursework_$bit");
$paths[]=$p;
@@ -325,10 +323,6 @@ protected function process_coursework_person_deadline($data) {
$newitemid = $DB->insert_record('coursework_person_deadlines', $data);
}
-
-
-
-
protected function process_coursework_mod_agreement($data) {
$data=(object)$data;
@@ -352,7 +346,6 @@ protected function process_coursework_mod_agreement($data) {
$newitemid = $DB->insert_record('coursework_mod_agreements', $data);
}
-
protected function process_coursework_plagiarism_flag($data) {
$data=(object)$data;
diff --git a/classes/ability.php b/classes/ability.php
index cac4802c..b662b408 100644
--- a/classes/ability.php
+++ b/classes/ability.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework;
use mod_coursework\exceptions\access_denied;
@@ -80,7 +79,6 @@ function (coursework $coursework) {
return has_capability('mod/coursework:view', $coursework->get_context(), $this->get_user());
});
-
// Submission rules
// New submission
@@ -92,7 +90,6 @@ function (coursework $coursework) {
$this->allow_new_submissions_if_late_submissions_allowed();
$this->allow_new_submissions_if_there_is_an_active_extension();
-
// Create submission
$this->allow_create_submission_if_can_new_submission();
@@ -108,7 +105,6 @@ function (coursework $coursework) {
$this->allow_show_submission_if_user_can_administer_grades();
$this->allow_show_submission_if_user_can_view_all_grades_at_all_times();
-
// Edit submission
$this->prevent_edit_submission_for_unsaved_records();
$this->allow_edit_submissions_if_can_submit_on_behalf_of();
@@ -128,7 +124,6 @@ function (coursework $coursework) {
// Finalise submission
$this->allow_finalisation_when_has_permission_and_settings_allow();
-
// Resubmit to plagiarism submission
$this->allow_resubmit_to_plagiarism_submission_if_user_is_assessor_for_any_stage();
@@ -153,8 +148,6 @@ function (coursework $coursework) {
//show moderation
$this->allow_show_moderation_if_user_can_view_grades_at_all_times();
-
-
// Feedback rules
// New feedback
@@ -234,7 +227,6 @@ function (coursework $coursework) {
// Update
$this->allow_update_deadline_extension_if_can_edit();
-
// Plagiarism flagging rules for Plagiarism Alert
// New
@@ -245,7 +237,6 @@ function (coursework $coursework) {
$this->prevent_edit_plagiarism_flag_if_not_persisted();
$this->allow_edit_plagiarism_flag_with_capability();
-
// Personal deadlines rules
$this->prevent_edit_personal_deadline_if_extension_given();
$this->allow_edit_personal_deadline_with_capability();
@@ -449,7 +440,6 @@ function (submission $submission) {
});
}
-
protected function allow_show_submission_if_user_is_agreed_grade_assessor_and_submission_is_ready() {
$this->allow('show',
'mod_coursework\models\submission',
@@ -586,13 +576,10 @@ function (submission $submission) {
$coursework_has_no_deadline = !$submission->get_coursework()->has_deadline();
$allowed_to = $this->can('new', $submission) || $this->can('edit', $submission);
-
return $allowed_to && $not_already_finalised && ($early_finalisation_allowed or $coursework_has_no_deadline) ;
});
}
-
-
protected function allow_resubmit_to_plagiarism_submission_if_user_is_assessor_for_any_stage() {
$this->allow('resubmit_to_plagiarism',
'mod_coursework\models\submission',
@@ -664,7 +651,6 @@ function (moderation $moderation) {
});
}
-
protected function prevent_new_moderation_if_user_is_not_allocated_to_moderate() {
$this->prevent('new',
'mod_coursework\models\moderation',
@@ -677,8 +663,6 @@ function (moderation $moderation) {
});
}
-
-
protected function allow_edit_moderation_if_user_created_moderation_and_can_edit() {
$this->allow('edit',
'mod_coursework\models\moderation',
@@ -719,9 +703,6 @@ function (moderation $moderation) {
});
}
-
-
-
protected function prevent_new_feedback_with_no_submission() {
$this->prevent('new',
'mod_coursework\models\feedback',
@@ -983,7 +964,6 @@ function (feedback $feedback) {
});
}
-
protected function allow_show_feedback_to_other_assessors_when_view_initial_grade_is_enabled() {
$this->allow('show',
'mod_coursework\models\feedback',
@@ -1150,10 +1130,6 @@ function (grading_table_row_base $grading_table_row) {
});
}
-
-
-
-
protected function allow_show_grading_table_row_if_user_can_export_final_grades() {
$this->allow('show',
'mod_coursework\grading_table_row_base',
@@ -1191,7 +1167,6 @@ function (feedback $feedback) {
}
-
return $feedback->is_agreed_grade() && !$has_editable_feedbacks && (has_capability('mod/coursework:addagreedgrade',
$feedback->get_coursework()
->get_context())
@@ -1222,9 +1197,6 @@ function (grading_table_row_base $row) {
});
}
-
-
-
private function allow_show_grading_table_row_if_user_can_grant_extension_and_no_allocation() {
$this->allow('show',
'mod_coursework\grading_table_row_base',
@@ -1237,8 +1209,6 @@ function (grading_table_row_base $row) {
});
}
-
-
private function allow_edit_feedback_if_user_can_administer_grades() {
$this->allow('edit',
'mod_coursework\models\feedback',
@@ -1353,7 +1323,6 @@ function (personal_deadline $personal_deadline) {
});
}
-
private function allow_new_plagiarism_flag_with_capability() {
$this->allow('new',
'mod_coursework\models\plagiarism_flag',
@@ -1362,7 +1331,6 @@ function (plagiarism_flag $plagiarism_flag) {
});
}
-
private function allow_edit_plagiarism_flag_with_capability() {
$this->allow('edit',
'mod_coursework\models\plagiarism_flag',
@@ -1373,7 +1341,6 @@ function (plagiarism_flag $plagiarism_flag) {
});
}
-
private function prevent_edit_plagiarism_flag_if_not_persisted() {
$this->prevent('edit',
'mod_coursework\models\plagiarism_flag',
diff --git a/classes/ability/rule.php b/classes/ability/rule.php
index 571cbe43..15272a7e 100644
--- a/classes/ability/rule.php
+++ b/classes/ability/rule.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\ability;
/**
diff --git a/classes/allocation/allocatable.php b/classes/allocation/allocatable.php
index 86e29be6..7a215d7c 100644
--- a/classes/allocation/allocatable.php
+++ b/classes/allocation/allocatable.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\allocation;
use mod_coursework\models\coursework;
use mod_coursework\models\feedback;
diff --git a/classes/allocation/auto_allocator.php b/classes/allocation/auto_allocator.php
index 3475ac91..c90d70a6 100644
--- a/classes/allocation/auto_allocator.php
+++ b/classes/allocation/auto_allocator.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\allocation;
use mod_coursework\models\allocation;
diff --git a/classes/allocation/manager.php b/classes/allocation/manager.php
index 7579eca9..d5e8f0f7 100644
--- a/classes/allocation/manager.php
+++ b/classes/allocation/manager.php
@@ -36,7 +36,6 @@
defined('MOODLE_INTERNAL') || die();
-
/**
* This takes responsibility for managing the allocations of markers to students, both manually and
* automatically. Specifically, it processes user input from the allocation screen and performs the allocation
@@ -84,7 +83,6 @@ public function __construct(coursework $coursework) {
$classname = !empty($coursework->$propertyname) ?
'\\mod_coursework\allocation\strategy\\'.$coursework->$propertyname : '';
-
if (class_exists($classname)) {
$this->$propertyname = new $classname($coursework);
if (!($this->$propertyname instanceof strategy\base)) {
@@ -186,7 +184,6 @@ public function auto_generate_moderation_set() {
}
-
/**
* Returns array of sampling options. This function should be looked upon as a placeholder
* in case more complex functionality is defined
@@ -232,19 +229,13 @@ public function get_sampling_set_rules() {
*/
public function get_sampling_set_widget($requestedrule = false) {
-
-
$rules = $this->get_sampling_set_rules();
-
-
$widget = new sampling_set_widget($rules, $this->coursework, $requestedrule);
return new \mod_coursework_sampling_set_widget($widget);
}
-
-
/**
* We know a rule came in, so we save it by delegating to the class, which will know what the form submitted.
*
@@ -281,7 +272,6 @@ public function save_sample() {
$this->save_sample_set_rule($i);
}
-
}
$this->auto_generate_sample_set();
}
@@ -293,14 +283,12 @@ private function get_coursework() {
return $this->coursework;
}
-
public function auto_generate_sample_set() {
global $DB;
$sampleplugins = $DB->get_records('coursework_sample_set_plugin',null, 'pluginorder');
$order = 0;
-
$sample_set = array();
$allocatables = $this->get_coursework()->get_allocatables();
@@ -314,7 +302,6 @@ public function auto_generate_sample_set() {
for($stage_number = 2; $stage_number <= $this->get_coursework()->get_max_markers(); $stage_number++) {
-
$stage = "assessor_{$stage_number}";
$this->remove_unmarked_automatic_allocatables($stage);
@@ -328,7 +315,6 @@ public function auto_generate_sample_set() {
AND stage_identifier = :stage
ORDER BY ruleorder)a";
-
if ($sampleplugins = $DB->get_records_sql($sql,array('courseworkid' => $this->coursework->id, 'stage' => $stage))) {
//$allocatables = $this->get_coursework()->get_allocatables_with_feedback();
@@ -337,9 +323,6 @@ public function auto_generate_sample_set() {
$auto_with_feedback = $this->get_automatic_with_feedback($stage);
-
-
-
//ok this array merge is being carried out using an foreach rather than array_merge as we want to preserve keys
//I am also not using add the two arrays as using the overloaded + can produce dubious results when a key exists
//in both arrays
@@ -348,7 +331,6 @@ public function auto_generate_sample_set() {
if (!isset($manual_sample_set[$k])) $manual_sample_set[$k] = $v;
}
-
$auto_sample_set = array();
foreach ($sampleplugins as $plugin) {
@@ -395,7 +377,6 @@ public function get_include_in_sample_set($stage_number) {
AND stage_identifier = :stage_identifier
AND selectiontype = 'manual'";
-
//get all users in manually selected for stage in coursework
return $DB->get_records_sql($sql,
array('courseworkid' => $this->coursework->id, 'stage_identifier' => $stage));
@@ -422,7 +403,6 @@ public function get_automatic_with_feedback($stage) {
return $DB->get_records_sql($sql,array('courseworkid' => $this->coursework->id, 'stage' => $stage));
}
-
public function remove_unmarked_automatic_allocatables($stage) {
global $DB;
@@ -443,8 +423,6 @@ public function remove_unmarked_automatic_allocatables($stage) {
return $DB->execute($sql);
-
-
}
public function get_allocatables_with_final_agreed() {
@@ -462,7 +440,4 @@ public function get_allocatables_with_final_agreed() {
}
-
-
-
}
diff --git a/classes/allocation/moderatable.php b/classes/allocation/moderatable.php
index 9a6faa64..5428d896 100644
--- a/classes/allocation/moderatable.php
+++ b/classes/allocation/moderatable.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\allocation;
/**
@@ -30,6 +29,4 @@
*/
interface moderatable {
-
-
}
diff --git a/classes/allocation/strategy/base.php b/classes/allocation/strategy/base.php
index 1f4a1875..a345ac3b 100644
--- a/classes/allocation/strategy/base.php
+++ b/classes/allocation/strategy/base.php
@@ -22,10 +22,8 @@
use mod_coursework\models\user;
use mod_coursework\stages\base as stage_base;
-
defined('MOODLE_INTERNAL') || die();
-
/**
* This base class is extended to make specific allocation strategies, which when run, will
* allocated teachers to mark student work in specific ways.
diff --git a/classes/allocation/strategy/equal.php b/classes/allocation/strategy/equal.php
index 69531cba..b1efbf91 100644
--- a/classes/allocation/strategy/equal.php
+++ b/classes/allocation/strategy/equal.php
@@ -28,7 +28,6 @@
defined('MOODLE_INTERNAL') || die();
-
/**
* Allocates all students equally between teachers.
*/
diff --git a/classes/allocation/strategy/percentages.php b/classes/allocation/strategy/percentages.php
index 60dd9cfd..c1c8915c 100644
--- a/classes/allocation/strategy/percentages.php
+++ b/classes/allocation/strategy/percentages.php
@@ -34,7 +34,6 @@
defined('MOODLE_INTERNAL') || die();
-
/**
* Allocates all students equally between teachers.
*/
diff --git a/classes/allocation/table/builder.php b/classes/allocation/table/builder.php
index 45669fe5..e5155c34 100644
--- a/classes/allocation/table/builder.php
+++ b/classes/allocation/table/builder.php
@@ -61,7 +61,6 @@ public function __construct($coursework, array $options) {
$this->options = $options;
}
-
/**
* Takes the raw data, instantiates each row as a new renderable object and returns the whole lot.
*
@@ -85,12 +84,10 @@ public function get_rows() {
$method_name));
}
-
return $rows;
}
-
/**
* Counts the total number of students that the current user can see.
*
@@ -116,7 +113,6 @@ public function get_table_rows_for_page() {
$rows[] = new row_builder($this, $allocatable);
}
-
// Sort the rows.
$sorting = new mod_coursework\grading_report($this->options, $this->coursework);
$method_name = 'sort_by_' . $this->options['sortby'];
@@ -148,12 +144,10 @@ public function get_table_rows_for_page() {
$this->totalrows = $rows;
$this->totalcount = $counter;
-
return $this->totalrows;
}
-
/**
* Getter for the coursework instance
*
@@ -216,6 +210,5 @@ public function get_hidden_elements() {
return $elements;
-
}
}
diff --git a/classes/allocation/table/cell/builder.php b/classes/allocation/table/cell/builder.php
index 7adf7836..8a84b3bc 100644
--- a/classes/allocation/table/cell/builder.php
+++ b/classes/allocation/table/cell/builder.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\allocation\table\cell;
use mod_coursework\models\allocation;
use mod_coursework\models\coursework;
@@ -65,7 +64,6 @@ public function __construct($coursework, $allocatable, $stage, $data_array = arr
$this->stage = $stage;
}
-
/**
* @return \html_table_cell
*/
@@ -96,7 +94,6 @@ private function get_potential_marker_dropdown() {
return $this->get_stage()->potential_marker_dropdown($this->get_allocatable());
-
}
/**
@@ -139,7 +136,6 @@ private function get_feedback() {
return $this->get_stage()->get_feedback_for_allocatable($this->get_allocatable());
}
-
/**
* @return bool|\mod_coursework\models\moderation
*/
@@ -213,7 +209,6 @@ private function prepare_allocation_table_cell() {
$assessor_name .= $this->get_stage()->get_allocated_assessor_name($this->get_allocatable());
}
-
if ($assessor_name) {
if ($this->get_stage()->uses_sampling() && !$this->get_feedback() && !$this->has_automatic_sampling()) {
$contents .= '
';
@@ -260,13 +255,11 @@ private function prepare_moderation_table_cell(){
$moderator_name .= $this->get_stage()->get_allocated_assessor_name($this->get_allocatable());
}
-
if ($moderator_name) {
$contents .= '
';
$contents .= "
{$moderator_name} ";
}
-
if ($moderator_dropdown) {
$contents .= '
';
$contents .= $moderator_dropdown;
@@ -278,7 +271,6 @@ private function prepare_moderation_table_cell(){
';
}
-
/**
* @return allocatable
*/
@@ -357,8 +349,6 @@ private function has_automatic_sampling() {
'stage_identifier' => $this->get_stage()->identifier(),
'selectiontype' => 'automatic');
-
-
return $DB->record_exists('coursework_sample_set_mbrs', $params);
}
@@ -367,8 +357,6 @@ private function has_automatic_sampling() {
*/
private function pinned_checkbox() {
-
-
$checkbox_name =
'allocatables[' . $this->get_allocatable()->id . '][' . $this->get_stage()->identifier() . '][pinned]';
$checkbox_checked = 0;
@@ -390,8 +378,6 @@ private function pinned_checkbox() {
'title' => $checkbox_title));
}
-
-
private function checkbox_checked_in_session($checkboxname, $checkboxstate) {
global $SESSION;
@@ -403,8 +389,6 @@ private function checkbox_checked_in_session($checkboxname, $checkboxstate) {
return $SESSION->coursework_allocationsessions[$cm->id][$checkboxname];
}
-
-
}
return $checkboxstate;
diff --git a/classes/allocation/table/cell/data.php b/classes/allocation/table/cell/data.php
index 5914d27f..62a25d6c 100644
--- a/classes/allocation/table/cell/data.php
+++ b/classes/allocation/table/cell/data.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\allocation\table\cell;
use mod_coursework\models\user;
use mod_coursework\stages\base as stage_base;
diff --git a/classes/allocation/table/cell/processor.php b/classes/allocation/table/cell/processor.php
index a6e08a43..768ac3a0 100644
--- a/classes/allocation/table/cell/processor.php
+++ b/classes/allocation/table/cell/processor.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\allocation\table\cell;
use mod_coursework\models\allocation;
use mod_coursework\models\coursework;
@@ -79,7 +78,6 @@ public function process($cell_data) {
}
}
-
/**
* @param data $data
*/
@@ -116,8 +114,6 @@ private function get_allocation() {
return $this->get_stage()->get_allocation($this->get_allocatable());
}
-
-
/**
* @param data $data
*/
@@ -167,7 +163,6 @@ private function process_pin($cell_data) {
}
}
-
/**
* returns whether the current record was automatically included in the sample set at the current stage
*
diff --git a/classes/allocation/table/processor.php b/classes/allocation/table/processor.php
index 4cb43a41..716753c6 100644
--- a/classes/allocation/table/processor.php
+++ b/classes/allocation/table/processor.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* This class is here to take the data from the table on the allocation page and process each
* of the rows. It's job is to know which other classes need to be called to process each rom
diff --git a/classes/allocation/table/row/builder.php b/classes/allocation/table/row/builder.php
index cc9e5969..0fa49e30 100644
--- a/classes/allocation/table/row/builder.php
+++ b/classes/allocation/table/row/builder.php
@@ -154,7 +154,6 @@ public function get_idnumber() {
return $this->get_allocatable()->idnumber;
}
-
/**
* @return string
*/
@@ -170,5 +169,4 @@ public function get_email() {
return $this->get_allocatable()->email;
}
-
}
diff --git a/classes/allocation/table/row/processor.php b/classes/allocation/table/row/processor.php
index e2047f45..ef6ce9ec 100644
--- a/classes/allocation/table/row/processor.php
+++ b/classes/allocation/table/row/processor.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\allocation\table\row;
use mod_coursework\allocation\allocatable;
use mod_coursework\models\coursework;
@@ -68,5 +67,4 @@ public function process($data) {
}
}
-
}
diff --git a/classes/allocation/upload.php b/classes/allocation/upload.php
index d50e7009..8ae8663a 100644
--- a/classes/allocation/upload.php
+++ b/classes/allocation/upload.php
@@ -26,7 +26,6 @@
defined('MOODLE_INTERNAL') || die();
-
/**
* Class to manage assessor allocations upload
*/
@@ -119,7 +118,6 @@ public function validate_csv($content, $encoding, $delimeter){
$allocatablesinfile[] = $allocatable->id;
}
-
// validate assessor if exists in the coursework and has one of the capabilities allowing them to grade
// in initial stage
if (substr($cells[$keynum],0,8) == 'assessor'){
@@ -146,7 +144,6 @@ public function validate_csv($content, $encoding, $delimeter){
return (!empty($errors)) ? $errors : false ;
}
-
/**
* Process csv and add records to the DB
*
@@ -260,7 +257,6 @@ public function process_csv($content, $encoding, $delimiter, $processingresults)
}
-
/**
* Add allocation pair
*
@@ -288,7 +284,6 @@ public function add_allocation($assessorid, $stage_identifier, $allocatable){
}
-
/**
* Update allocation pair
*
diff --git a/classes/allocation/widget.php b/classes/allocation/widget.php
index daae43a2..9b3d41a3 100644
--- a/classes/allocation/widget.php
+++ b/classes/allocation/widget.php
@@ -28,7 +28,6 @@
defined('MOODLE_INTERNAL') || die();
-
/**
* Just a placeholder for the renderer really.
*/
diff --git a/classes/assessor_feedback_row.php b/classes/assessor_feedback_row.php
index 2d39a623..114078ae 100644
--- a/classes/assessor_feedback_row.php
+++ b/classes/assessor_feedback_row.php
@@ -24,7 +24,6 @@
defined('MOODLE_INTERNAL') || die();
-
/**
* Class that exists to tell the renderer to use a different function. This one will make the
* feedback into a row in the assessor feedbacks table of the grading report.
diff --git a/classes/assessor_feedback_table.php b/classes/assessor_feedback_table.php
index b0fc867c..0d30597c 100644
--- a/classes/assessor_feedback_table.php
+++ b/classes/assessor_feedback_table.php
@@ -21,7 +21,6 @@
defined('MOODLE_INTERNAL') || die();
-
/**
* Renderable class to represent a table containing assessor feedbacks for a single student submission.
* Used in the grading report for multiple assessor courseworks.
diff --git a/classes/auto_grader/auto_grader.php b/classes/auto_grader/auto_grader.php
index 643fcb1d..0bfd7d62 100644
--- a/classes/auto_grader/auto_grader.php
+++ b/classes/auto_grader/auto_grader.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\auto_grader;
/**
diff --git a/classes/auto_grader/average_grade.php b/classes/auto_grader/average_grade.php
index 796894aa..8641f5b6 100644
--- a/classes/auto_grader/average_grade.php
+++ b/classes/auto_grader/average_grade.php
@@ -20,8 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
-
namespace mod_coursework\auto_grader;
use mod_coursework\allocation\allocatable;
@@ -76,8 +74,6 @@ public function create_auto_grade_if_rules_match(){
return;
}
-
-
if (!$this->get_allocatable()->has_agreed_feedback($this->get_coursework())) {
$this->create_final_feedback();
} else {
@@ -88,8 +84,6 @@ public function create_auto_grade_if_rules_match(){
}
}
-
-
// trigger events?
}
@@ -124,11 +118,9 @@ private function automatic_grade(){
break;
}
-
return $avggrade;
}
-
/**
* @return allocatable
*/
@@ -148,7 +140,6 @@ private function create_final_feedback() {
));
}
-
/**
*
*/
@@ -164,7 +155,6 @@ private function update_final_feedback($feedback){
}
-
/**
* @return array
*/
diff --git a/classes/auto_grader/none.php b/classes/auto_grader/none.php
index 45b63979..882353d2 100644
--- a/classes/auto_grader/none.php
+++ b/classes/auto_grader/none.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\auto_grader;
/**
diff --git a/classes/auto_grader/percentage_distance.php b/classes/auto_grader/percentage_distance.php
index f9589e26..5d4d763e 100644
--- a/classes/auto_grader/percentage_distance.php
+++ b/classes/auto_grader/percentage_distance.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\auto_grader;
use mod_coursework\allocation\allocatable;
@@ -76,7 +75,6 @@ public function create_auto_grade_if_rules_match() {
return;
}
-
if ($this->grades_are_close_enough() ) {
if (!$this->get_allocatable()->has_agreed_feedback($this->get_coursework())) {
$this->create_final_feedback();
@@ -140,7 +138,6 @@ private function create_final_feedback() {
));
}
-
/**
*
*/
@@ -156,8 +153,6 @@ private function update_final_feedback($feedback) {
}
-
-
/**
* @return array
*/
diff --git a/classes/controllers/allocations_controller.php b/classes/controllers/allocations_controller.php
index fd357513..c89703e8 100644
--- a/classes/controllers/allocations_controller.php
+++ b/classes/controllers/allocations_controller.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\controllers;
/**
@@ -29,6 +28,4 @@
*/
class allocations_controller extends controller_base {
-
-
}
diff --git a/classes/controllers/controller_base.php b/classes/controllers/controller_base.php
index 3165fd21..a5c4f745 100644
--- a/classes/controllers/controller_base.php
+++ b/classes/controllers/controller_base.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\controllers;
use coding_exception;
@@ -162,7 +161,6 @@ protected function prepare_environment() {
}
-
/**
* Single accessible method that look for a private method and uses it if its there, after preparing the environment.
*
diff --git a/classes/controllers/deadline_extensions_controller.php b/classes/controllers/deadline_extensions_controller.php
index 8d563836..9a395338 100644
--- a/classes/controllers/deadline_extensions_controller.php
+++ b/classes/controllers/deadline_extensions_controller.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\controllers;
use mod_coursework\ability;
use mod_coursework\allocation\allocatable;
@@ -177,8 +176,6 @@ protected function set_default_current_deadline() {
return $params;
}
-
-
/**
* Begin Ajax functions
*/
@@ -227,14 +224,12 @@ public function validation($data){
global $CFG;
$max_deadline = $CFG->coursework_max_extension_deadline;
-
if ($this->coursework->personaldeadlineenabled && $personal_deadline = $this->personal_deadline()) {
$deadline = $personal_deadline->personal_deadline;
} else {
$deadline = $this->coursework->deadline;
}
-
if ( $data['extended_deadline'] <= $deadline) {
return $errors = 'The new deadline must be later than the current deadline';
}
@@ -375,7 +370,6 @@ public function ajax_new_mitigation($data_params){
echo json_encode($response);
}
-
/**
* function table_cell_response
* @param array $data_params
@@ -401,5 +395,4 @@ public function table_cell_response($data_params) {
return $content;
}
-
}
diff --git a/classes/controllers/feedback_controller.php b/classes/controllers/feedback_controller.php
index c6a88c30..5a0c3abd 100644
--- a/classes/controllers/feedback_controller.php
+++ b/classes/controllers/feedback_controller.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\controllers;
use mod_coursework\ability;
@@ -81,8 +80,6 @@ protected function show_feedback() {
$renderer = $this->get_page_renderer();
$html = $renderer->show_feedback_page($teacherfeedback, $ajax);
-
-
if (empty($ajax)) {
echo $html;
} else {
@@ -142,7 +139,6 @@ protected function edit_feedback() {
global $DB, $PAGE, $USER;
-
$teacherfeedback = new feedback($this->params['feedbackid']);
$this->check_stage_permissions($teacherfeedback->stage_identifier);
@@ -226,13 +222,11 @@ protected function create_feedback() {
$form->save_feedback_files($teacherfeedback);
-
if ($submission->is_published()) { // Keep the gradebook updated
$this->coursework->grade_changed_event();
$submission->publish();
}
-
//only implement auto feedback (automatic agreement) if the settings is set to disabled otherwise
//we will do this in the cron
//only implement auto feedback (automatic agreement) if the settings is set to disabled otherwise
@@ -281,7 +275,6 @@ protected function create_feedback() {
$finalfeedback = $feedback_row->get_submission()->get_final_feedback();
$finalsubmission = $feedback_row->get_submission();
-
if ($coursework->automaticagreementrange != 'none' && !empty($finalfeedback) && $finalsubmission->all_inital_graded()) {
$finalstage = new assessor($coursework, "final_agreed_1");
$finalfeedback_row = new assessor_feedback_row($finalstage, $participant, $coursework);
@@ -304,10 +297,6 @@ protected function create_feedback() {
$html = $cell_object->get_content($row_object);
$jsonarray['extrahtml'] = $provisional->get_table_cell($row_object);
-
-
-
-
}
$jsonarray['html'] = $html;
@@ -325,7 +314,6 @@ protected function create_feedback() {
}
}
-
}
/**
@@ -374,7 +362,6 @@ protected function update_feedback() {
$fs = get_file_storage();
$fs->delete_area_files($teacherfeedback->get_coursework()->get_context()->id, 'mod_coursework', 'feedback', $teacherfeedback->id());
-
$ajax = !empty($this->params['ajax']);
if ($ajax) {
@@ -425,8 +412,6 @@ protected function update_feedback() {
$teacherfeedback->save();
$form->save_feedback_files($teacherfeedback);
-
-
if (empty($gradeeditingtime) || time() > $teacherfeedback->timecreated + $gradeeditingtime) {
$this->try_auto_feedback_creation($teacherfeedback->get_submission());
}
diff --git a/classes/controllers/grading_controller.php b/classes/controllers/grading_controller.php
index 28d60019..a7a57aab 100644
--- a/classes/controllers/grading_controller.php
+++ b/classes/controllers/grading_controller.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\controllers;
use mod_coursework\models\coursework;
diff --git a/classes/controllers/moderations_controller.php b/classes/controllers/moderations_controller.php
index 19d75912..38dd520f 100644
--- a/classes/controllers/moderations_controller.php
+++ b/classes/controllers/moderations_controller.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\controllers;
use mod_coursework\ability;
@@ -54,7 +53,6 @@ class moderations_controller extends controller_base {
*/
protected $moderation;
-
/**
* This deals with the page that the assessors see when they want to add component feedbacks.
*
@@ -71,7 +69,6 @@ protected function new_moderation() {
$moderator_agreement->courseworkid = $this->params['courseworkid'];
$moderator_agreement->feedbackid = $this->params['feedbackid'];
-
$ability = new ability(user::find($USER), $this->coursework);
$ability->require_can('new', $moderator_agreement);
@@ -98,7 +95,6 @@ protected function edit_moderation() {
global $DB, $PAGE, $USER;
-
$moderation = new moderation($this->params['moderationid']);
$this->check_stage_permissions($moderation->stage_identifier);
@@ -144,7 +140,6 @@ protected function create_moderation() {
$url = $this->get_router()->get_path('new moderation', $path_params, true);
$PAGE->set_url($url);
-
$ability = new ability(user::find($USER), $this->coursework);
$ability->require_can('new', $moderatoragreement);
@@ -217,7 +212,6 @@ protected function show_moderation() {
$renderer->show_moderation_page($moderation);
}
-
/**
* Get any feedback-specific stuff.
*/
diff --git a/classes/controllers/personal_deadlines_controller.php b/classes/controllers/personal_deadlines_controller.php
index cdead02a..cd499491 100644
--- a/classes/controllers/personal_deadlines_controller.php
+++ b/classes/controllers/personal_deadlines_controller.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\controllers;
use mod_coursework\ability;
use mod_coursework\allocation\allocatable;
@@ -40,18 +39,12 @@
*/
class personal_deadlines_controller extends controller_base{
-
-
-
protected function new_personal_deadline() {
global $USER, $PAGE;
-
-
$coursework_page_url = (empty($this->params['setpersonaldeadlinespage'])) ? $this->get_path('coursework', array('coursework' => $this->coursework)) :
$this->get_path('set personal deadlines', array('coursework' => $this->coursework));
-
$params = $this->set_default_current_deadline();
$ability = new ability(user::find($USER), $this->coursework);
@@ -95,7 +88,6 @@ protected function new_personal_deadline() {
}
} else {
-
$allocatables = unserialize($data->allocatableid);
foreach($allocatables as $allocatableid) {
@@ -115,7 +107,6 @@ protected function new_personal_deadline() {
$this->personal_deadline = personal_deadline::build($data);
$this->personal_deadline->save();
-
} else {
// update
$data->id = $this->personal_deadline->id;
@@ -126,8 +117,6 @@ protected function new_personal_deadline() {
}
-
-
}
redirect($coursework_page_url);
}
@@ -136,7 +125,6 @@ protected function new_personal_deadline() {
}
-
/**
* Set the deadline to default coursework deadline if the personal deadline was never given before
* @return array
diff --git a/classes/controllers/plagiarism_flagging_controller.php b/classes/controllers/plagiarism_flagging_controller.php
index 782e2636..a0aab984 100644
--- a/classes/controllers/plagiarism_flagging_controller.php
+++ b/classes/controllers/plagiarism_flagging_controller.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\controllers;
use mod_coursework\ability;
@@ -54,7 +53,6 @@ class plagiarism_flagging_controller extends controller_base {
*/
protected $plagiarism_flag;
-
/**
* This deals with the page that the assessors see when they want to add component feedbacks.
*
@@ -68,11 +66,9 @@ protected function new_plagiarism_flag() {
$plagiarismflag->submissionid = $this->params['submissionid'];
$plagiarismflag->courseworkid = $this->coursework->id;
-
$ability = new ability(user::find($USER), $this->coursework);
$ability->require_can('new', $plagiarismflag);
-
$urlparams = array();
$urlparams['submissionid'] = $plagiarismflag->submissionid;
@@ -111,7 +107,6 @@ protected function edit_plagiarism_flag() {
$renderer->edit_plagiarism_flag_page($plagiarism_flag, $creator, $editor);
}
-
/**
* Saves the new plagiarism flag for the first time.
*/
@@ -152,7 +147,6 @@ protected function create_plagiarism_flag() {
}
}
-
/**
* Updates plagiarism flag
*/
@@ -199,8 +193,6 @@ protected function update_plagiarism_flag() {
redirect($coursework_page_url);
}
-
-
/**
* Get any plagiarism flag-specific stuff.
*/
diff --git a/classes/controllers/submissions_controller.php b/classes/controllers/submissions_controller.php
index 5372d30b..8d151b81 100644
--- a/classes/controllers/submissions_controller.php
+++ b/classes/controllers/submissions_controller.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\controllers;
use mod_coursework\ability;
@@ -117,7 +116,6 @@ protected function create_submission() {
$submission->authorid = $submission->get_author_id(); //create new function to get the author id depending on whether the current user is submitting on behalf
$submission->timesubmitted = time();
-
// Automatically finalise any submissions that's past the deadline/personal deadline and doesn't have valid extension
if ($this->coursework->personal_deadlines_enabled()){
// Check is submission has a valid personal deadline or a valid extension
@@ -182,8 +180,6 @@ protected function create_submission() {
}
}
-
-
}
}
@@ -231,7 +227,6 @@ protected function edit_submission() {
}
}
-
/**
*
*/
@@ -284,7 +279,6 @@ protected function update_submission() {
$event = assessable_submitted::create($params);
$event->trigger();
-
$submission->submit_plagiarism();
if ($CFG->coursework_allsubmissionreceipt || $notify_about_finalisation) {
@@ -329,13 +323,10 @@ protected function finalise_submission() {
redirect($coursework_page_url);
}
-
protected function unfinalise_submission() {
global $USER, $DB;
-
-
$allocatableids = (!is_array($this->params['allocatableid'])) ? array($this->params['allocatableid']) : $this->params['allocatableid'] ;
$personaldeadline_page_url = new \moodle_url('/mod/coursework/actions/personal_deadline.php',
@@ -361,8 +352,6 @@ protected function unfinalise_submission() {
}
-
-
if (!empty($changedeadlines)) {
redirect($personaldeadline_page_url, get_string('unfinalisedchangesubmissiondate', 'mod_coursework'));
} else {
@@ -436,7 +425,6 @@ protected function submissions_exists($submission){
return $sub_exists;
}
-
/**
* @param $submission
* @return bool
diff --git a/classes/cron.php b/classes/cron.php
index 46e104bc..6f8fa469 100644
--- a/classes/cron.php
+++ b/classes/cron.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework;
use context;
use mod_coursework\models\coursework;
@@ -93,7 +92,6 @@ private static function send_reminders_to_students() {
continue;
}
-
$students = $coursework->get_students_who_have_not_yet_submitted();
foreach ($students as $student) {
@@ -109,7 +107,6 @@ private static function send_reminders_to_students() {
$deadline = $personal_deadline ? $personal_deadline->personal_deadline : $coursework->deadline;
-
if ($individual_extension){
// check if 1st reminder is due to be sent but has not been sent yet
if ($coursework->due_to_send_first_reminders($individual_extension->extended_deadline) &&
@@ -130,8 +127,6 @@ private static function send_reminders_to_students() {
$userswhoneedreminding[$student->id().'_'.$coursework->id] = $student;
}
-
-
} else if ($deadline > time()) { // coursework or personal deadline hasn't passed
// check if 1st reminder is due to be sent but has not been sent yet
if ($coursework->due_to_send_first_reminders($deadline) && $student->has_not_been_sent_reminder($coursework, 1)) {
@@ -391,7 +386,6 @@ private static function autorelease_feedbacks_where_the_release_date_has_passed(
global $DB;
echo 'Auto releasing feedbacks for courseworks where the release date have passed...';
-
$sql = "SELECT *
FROM {coursework} c
JOIN {coursework_submissions} cs
@@ -425,7 +419,6 @@ private static function autorelease_feedbacks_where_the_release_date_has_passed(
*/
public static function get_admins_and_teachers($context){
-
$graders = get_enrolled_users($context, 'mod/coursework:addinitialgrade');
$managers = get_enrolled_users($context, 'mod/coursework:addagreedgrade');
@@ -440,8 +433,5 @@ public static function get_admins_and_teachers($context){
}
-
-
-
}
diff --git a/classes/decorators/coursework_groups_decorator.php b/classes/decorators/coursework_groups_decorator.php
index 229dac7e..2ba104be 100644
--- a/classes/decorators/coursework_groups_decorator.php
+++ b/classes/decorators/coursework_groups_decorator.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\decorators;
use mod_coursework\framework\decorator;
use mod_coursework\models\coursework;
@@ -34,6 +33,4 @@
*/
class coursework_groups_decorator extends decorator {
-
-
}
diff --git a/classes/decorators/submission_groups_decorator.php b/classes/decorators/submission_groups_decorator.php
index 88dd494c..c67e4db1 100644
--- a/classes/decorators/submission_groups_decorator.php
+++ b/classes/decorators/submission_groups_decorator.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\decorators;
use mod_coursework\framework\decorator;
diff --git a/classes/event/assessable_submitted.php b/classes/event/assessable_submitted.php
index a0cdeac7..d32319d3 100644
--- a/classes/event/assessable_submitted.php
+++ b/classes/event/assessable_submitted.php
@@ -33,7 +33,6 @@
*/
class assessable_submitted extends \core\event\assessable_submitted {
-
/**
* Init method.
*
diff --git a/classes/event/assessable_uploaded.php b/classes/event/assessable_uploaded.php
index e29adab5..419b0ab4 100644
--- a/classes/event/assessable_uploaded.php
+++ b/classes/event/assessable_uploaded.php
@@ -14,13 +14,10 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see
.
-
-
namespace mod_coursework\event;
use mod_coursework\models\submission;
defined('MOODLE_INTERNAL') || die();
-
class assessable_uploaded extends \core\event\assessable_uploaded {
/**
diff --git a/classes/event/course_module_instance_list_viewed.php b/classes/event/course_module_instance_list_viewed.php
index afabf843..eddc7c46 100644
--- a/classes/event/course_module_instance_list_viewed.php
+++ b/classes/event/course_module_instance_list_viewed.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
// This file is part of the Certificate module for Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
@@ -36,7 +35,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see
.
-
namespace mod_coursework\event;
defined('MOODLE_INTERNAL') || die();
diff --git a/classes/event/course_module_viewed.php b/classes/event/course_module_viewed.php
index 31bfdfe3..185374ee 100644
--- a/classes/event/course_module_viewed.php
+++ b/classes/event/course_module_viewed.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\event;
defined('MOODLE_INTERNAL') || die();
@@ -45,4 +44,3 @@ public function get_url() {
// You might need to override get_url() and get_legacy_log_data() if view mode needs to be stored as well.
}
-
diff --git a/classes/event/coursework_deadline_changed.php b/classes/event/coursework_deadline_changed.php
index ab12d49a..858a42f7 100644
--- a/classes/event/coursework_deadline_changed.php
+++ b/classes/event/coursework_deadline_changed.php
@@ -26,10 +26,8 @@
defined('MOODLE_INTERNAL') || die();
-
class coursework_deadline_changed extends \core\event\base {
-
/**
* Init method.
*
diff --git a/classes/event/coursework_plagiarism_flag_updated.php b/classes/event/coursework_plagiarism_flag_updated.php
index f01adbda..37b49c63 100644
--- a/classes/event/coursework_plagiarism_flag_updated.php
+++ b/classes/event/coursework_plagiarism_flag_updated.php
@@ -26,7 +26,6 @@
defined('MOODLE_INTERNAL') || die();
-
class coursework_plagiarism_flag_updated extends \core\event\base {
/**
diff --git a/classes/event/feedback_changed.php b/classes/event/feedback_changed.php
index b51ae671..4a0766e3 100644
--- a/classes/event/feedback_changed.php
+++ b/classes/event/feedback_changed.php
@@ -20,9 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
-
-
namespace mod_coursework\event;
/**
@@ -53,7 +50,4 @@ protected function init() {
$this->data['objecttable'] = 'coursework_feedbacks';
}
-
-
-
}
diff --git a/classes/exceptions/access_denied.php b/classes/exceptions/access_denied.php
index d85f983e..2c8c0620 100644
--- a/classes/exceptions/access_denied.php
+++ b/classes/exceptions/access_denied.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\exceptions;
use mod_coursework\models\coursework;
diff --git a/classes/exceptions/late_submission.php b/classes/exceptions/late_submission.php
index 53fb67d1..07291198 100644
--- a/classes/exceptions/late_submission.php
+++ b/classes/exceptions/late_submission.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\exceptions;
use mod_coursework\models\coursework;
diff --git a/classes/export/csv.php b/classes/export/csv.php
index 915aae2f..4f53ae72 100644
--- a/classes/export/csv.php
+++ b/classes/export/csv.php
@@ -21,7 +21,6 @@
use mod_coursework\models\coursework;
use mod_coursework\models\submission;
-
defined('MOODLE_INTERNAL') || die();
global $CFG;
@@ -138,7 +137,6 @@ public function add_cells_to_array($submission, $student, $csv_cells){
return $row;
}
-
/**
* create headers for CSV
* @param $csv_headers
@@ -260,19 +258,12 @@ public function other_assessors_cells(){
$increment = 2;
}
-
for ($i = 1; $i < $this->coursework->get_max_markers(); $i++) {
$cells = $cells + $increment; // one for grade, one for feedback
}
-
-
-
-
-
return $cells;
-
}
}
diff --git a/classes/export/csv/cells/agreedfeedback_cell.php b/classes/export/csv/cells/agreedfeedback_cell.php
index 3455db58..6f3750fa 100644
--- a/classes/export/csv/cells/agreedfeedback_cell.php
+++ b/classes/export/csv/cells/agreedfeedback_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
use mod_coursework\models\submission;
use mod_coursework\ability;
@@ -32,7 +31,6 @@
*/
class agreedfeedback_cell extends cell_base{
-
/**
* @param submission$submission
* @param $student
@@ -53,8 +51,6 @@ public function get_header($stage){
return get_string('agreedgradefeedback', 'coursework');
}
-
-
public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = array()) {
global $DB, $PAGE, $USER;
diff --git a/classes/export/csv/cells/agreedgrade_cell.php b/classes/export/csv/cells/agreedgrade_cell.php
index 0d89f2fc..dac0b988 100644
--- a/classes/export/csv/cells/agreedgrade_cell.php
+++ b/classes/export/csv/cells/agreedgrade_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
use mod_coursework\models\submission;
use mod_coursework\ability;
@@ -32,7 +31,6 @@
*/
class agreedgrade_cell extends cell_base{
-
/**
* @param $submission
* @param $student
@@ -153,7 +151,6 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
$subdbrecord = $DB->get_record('coursework_submissions',array('id' => $submissionid));
$submission = \mod_coursework\models\submission::find($subdbrecord);
-
//is the submission in question ready to grade?
if (!$submission->all_inital_graded() && !empty($value) && count($uploadedgradecells) < $submission->max_number_of_feedbacks()) return get_string('submissionnotreadyforagreedgrade','coursework');
@@ -183,7 +180,6 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
);
$new_feedback = feedback::build($feedback_params);
-
//this is a new feedback check it against the new ability checks
if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !has_capability('mod/coursework:addallocatedagreedgrade', $PAGE->context) && !$ability->can('new', $new_feedback)) return get_string('nopermissiontogradesubmission','coursework');
} else {
@@ -191,10 +187,6 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade','coursework');
}
-
-
-
-
} else {
return get_string('nopermissiontoimportgrade', 'coursework');
}
@@ -203,7 +195,6 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
}
-
/***
* Check that the given value is within the values that can be excepted by the given rubric criteria
*
@@ -231,7 +222,6 @@ function value_in_rubric($criteria, $value) {
}
}
-
return $valuefound;
}
@@ -244,7 +234,6 @@ function value_in_rubric($criteria, $value) {
*/
function get_rubrics($coursework, $csv_cells) {
-
if ($coursework->is_using_rubric() && $this->coursework->finalstagegrading != 1) {
$rubricheaders = array();
@@ -256,13 +245,11 @@ function get_rubrics($coursework, $csv_cells) {
$rubricheaders[] = $criteria['description']." comment";
}
-
//find out the position of singlegrade
$position = array_search('singlegrade', $csv_cells);
//get all data from the position of the singlegrade to the length of rubricheaders
// $csv_cells = array_splice($csv_cells,5, 1, $rubricheaders);
-
$start_cells = array_slice($csv_cells,0, $position,true);
$end_cells = array_slice($csv_cells, $position+1,count($csv_cells),true);
@@ -270,13 +257,9 @@ function get_rubrics($coursework, $csv_cells) {
$cells = array_merge($cells, $end_cells);
-
-
}
-
return $cells;
}
-
}
diff --git a/classes/export/csv/cells/assessor_cell.php b/classes/export/csv/cells/assessor_cell.php
index a1d1c78c..3f1ee19c 100644
--- a/classes/export/csv/cells/assessor_cell.php
+++ b/classes/export/csv/cells/assessor_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
use mod_coursework\models\submission;
@@ -29,7 +28,6 @@
*/
class assessor_cell extends cell_base{
-
/**
* @param $submission
* @param $student
@@ -58,6 +56,4 @@ public function get_header($stage){
return get_string('assessorcsv', 'coursework', $stage);
}
-
-
}
diff --git a/classes/export/csv/cells/assessorfeedback_cell.php b/classes/export/csv/cells/assessorfeedback_cell.php
index 493501ed..d8bdebb7 100644
--- a/classes/export/csv/cells/assessorfeedback_cell.php
+++ b/classes/export/csv/cells/assessorfeedback_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
use mod_coursework\models\submission;
use mod_coursework\ability;
@@ -31,7 +30,6 @@
*/
class assessorfeedback_cell extends cell_base{
-
/**
* @param submission$submission
* @param $student
@@ -87,7 +85,6 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
if (has_any_capability($agreedgradecap, $PAGE->context) && has_any_capability($initialgradecap, $PAGE->context)
|| has_capability('mod/coursework:administergrades', $PAGE->context)) {
-
//is the submission in question ready to grade?
if (!$submission->ready_to_grade()) return get_string('submissionnotreadytograde','coursework');
@@ -118,7 +115,6 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
}
-
if (!$this->coursework->allocation_enabled() && !empty($feedback)) {
//was this user the one who last graded this submission if not then user cannot grade
if ($feedback->assessorid != $USER->id || !has_capability('mod/coursework:editinitialgrade', $PAGE->context) )
@@ -139,7 +135,6 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
&& !$DB->get_record('coursework_allocation_pairs', $allocation_params)) return get_string('nopermissiontogradesubmission','coursework');
}
-
//check for coursework without allocations - with/without samplings
if (has_capability('mod/coursework:addinitialgrade', $PAGE->context) && !has_capability('mod/coursework:editinitialgrade', $PAGE->context)
&& $this->coursework->get_max_markers() > 1 && !$this->coursework->allocation_enabled()){
diff --git a/classes/export/csv/cells/assessorgrade_cell.php b/classes/export/csv/cells/assessorgrade_cell.php
index 526c4262..4e450e49 100644
--- a/classes/export/csv/cells/assessorgrade_cell.php
+++ b/classes/export/csv/cells/assessorgrade_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
use mod_coursework\models\submission;
use mod_coursework\ability;
@@ -33,7 +32,6 @@
*/
class assessorgrade_cell extends cell_base{
-
/**
* @param submission$submission
* @param $student
@@ -119,7 +117,6 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
|| has_capability('mod/coursework:administergrades', $PAGE->context)
) {
-
$errormsg = '';
if (!$this->coursework->is_using_rubric()) {
@@ -177,11 +174,9 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
if (!empty($errormsg)) return $errormsg;
-
//is the submission in question ready to grade?
if (!$submission->ready_to_grade()) return get_string('submissionnotreadytograde', 'coursework');
-
//has the submission been published if yes then no further grades are allowed
if ($submission->get_state() >= submission::PUBLISHED) return $submission->get_status_text();
@@ -209,7 +204,6 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
}
-
if (!$this->coursework->allocation_enabled() && !empty($feedback)) {
//was this user the one who last graded this submission if not then user cannot grade
if ($feedback->assessorid != $USER->id || !has_capability('mod/coursework:editinitialgrade', $PAGE->context))
@@ -231,7 +225,6 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
) return get_string('nopermissiontogradesubmission', 'coursework');
}
-
//check for coursework without allocations - with/without samplings
if (has_capability('mod/coursework:addinitialgrade', $PAGE->context) && !has_capability('mod/coursework:editinitialgrade', $PAGE->context)
&& $this->coursework->get_max_markers() > 1 && !$this->coursework->allocation_enabled()
@@ -251,7 +244,6 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
if ($assessors == $feedbacks) return get_string('gradealreadyexists', 'coursework');
}
-
} else if (has_any_capability($agreedgradecap, $PAGE->context)) {
//if you have the add agreed or edit agreed grades capabilities then you may have the grades on your export sheet
@@ -290,7 +282,6 @@ function value_in_rubric($criteria, $value) {
}
}
-
return $valuefound;
}
@@ -303,7 +294,6 @@ function value_in_rubric($criteria, $value) {
*/
function get_rubrics($coursework, $csv_cells) {
-
if ($coursework->is_using_rubric()) {
$rubricheaders = array();
@@ -315,13 +305,11 @@ function get_rubrics($coursework, $csv_cells) {
$rubricheaders[] = $criteria['description']." comment";
}
-
//find out the position of singlegrade
$position = array_search('singlegrade', $csv_cells);
//get all data from the position of the singlegrade to the length of rubricheaders
// $csv_cells = array_splice($csv_cells,5, 1, $rubricheaders);
-
$start_cells = array_slice($csv_cells,0, $position,true);
$end_cells = array_slice($csv_cells, $position+1,count($csv_cells),true);
@@ -329,13 +317,9 @@ function get_rubrics($coursework, $csv_cells) {
$cells = array_merge($cells, $end_cells);
-
-
}
-
return $cells;
}
-
}
diff --git a/classes/export/csv/cells/cell_base.php b/classes/export/csv/cells/cell_base.php
index 657c96c7..86626086 100644
--- a/classes/export/csv/cells/cell_base.php
+++ b/classes/export/csv/cells/cell_base.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
use mod_coursework\models\coursework;
use mod_coursework\models\deadline_extension;
@@ -56,7 +55,6 @@ public function __construct($coursework) {
}
-
/**
* Function to check if a user can see real names/usernames even if blind marking is enabled
* @return bool
@@ -70,7 +68,6 @@ public function can_view_hidden() {
return (!$this->coursework->blindmarking || $viewanonymous || $exportgrade);
}
-
/**
* Function to check if the student was given an extension
* @param $student
@@ -83,7 +80,6 @@ public function extension_exists($student){
return ($this->coursework->extensions_enabled() && !empty($extension));
}
-
/**
* Function to get student's extension date
* @param $student
@@ -96,7 +92,6 @@ public function get_extension_date_for_csv($student){
return userdate($extension->extended_deadline, $this->dateformat);
}
-
/**
* Function to get extra information about student's extension
* @param $student
@@ -109,7 +104,6 @@ public function get_extension_extra_info_for_csv($student){
return strip_tags($extension->extra_information_text);
}
-
/**
* Function to get student's extension pre-defined reason
* @param $student
@@ -124,7 +118,6 @@ public function get_extension_reason_for_csv($student){
strip_tags($extension_reasons[$extension->pre_defined_reason]) : "";
}
-
/**
* Function to get all pre-defined extension reasons
* @return array
@@ -133,8 +126,6 @@ public function get_extension_predefined_reasons(){
return $this->coursework->extension_reasons();
}
-
-
/**
* Function to check if the plagiarism has been flagged for the given submission
* @param $submission
@@ -171,7 +162,6 @@ public function get_plagiarism_flag_comment_for_csv($submission){
return strip_tags($flag->comment);
}
-
/**
* Function to get a grade that should be displayed
* @param $grade
@@ -184,7 +174,6 @@ public function get_actual_grade($grade){
return $judge->grade_to_display($grade);
}
-
/**
* Function to get assessor's full name
* @param $assessorid
@@ -198,7 +187,6 @@ public function get_assessor_name($assessorid){
return $assessor->lastname .' '. $assessor->firstname;
}
-
/**
* Function to get assessor's username
* @param $assessorid
@@ -212,7 +200,6 @@ public function get_assessor_username($assessorid) {
return $assessor->username;
}
-
/**
* Function to get a message if submission was made withihn the deadline
* @param submission $submission
@@ -267,7 +254,6 @@ public function validate_cell($value, $submissions, $stage_dentifier='', $upload
return true;
}
-
/**
* @param $grade
* @param $gradedata
@@ -297,5 +283,4 @@ public function get_rubric_scores_gradedata($grade, &$gradedata){
}
}
-
}
diff --git a/classes/export/csv/cells/cell_interface.php b/classes/export/csv/cells/cell_interface.php
index 50536f5a..5df28a06 100644
--- a/classes/export/csv/cells/cell_interface.php
+++ b/classes/export/csv/cells/cell_interface.php
@@ -20,11 +20,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
-
-
/**
* Interface cell_interface makes sure that all of the grading report cells are the same.
*/
@@ -52,5 +49,4 @@ public function get_header($stage);
*/
public function validate_cell($value, $submissions, $stage_dentifier='');
-
}
diff --git a/classes/export/csv/cells/email_cell.php b/classes/export/csv/cells/email_cell.php
index f0e7c885..79d31770 100644
--- a/classes/export/csv/cells/email_cell.php
+++ b/classes/export/csv/cells/email_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
use mod_coursework\models\submission;
diff --git a/classes/export/csv/cells/extensiondeadline_cell.php b/classes/export/csv/cells/extensiondeadline_cell.php
index 3b8c57fc..cd181265 100644
--- a/classes/export/csv/cells/extensiondeadline_cell.php
+++ b/classes/export/csv/cells/extensiondeadline_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
/**
diff --git a/classes/export/csv/cells/extensionextrainfo_cell.php b/classes/export/csv/cells/extensionextrainfo_cell.php
index 57a11077..bed161d4 100644
--- a/classes/export/csv/cells/extensionextrainfo_cell.php
+++ b/classes/export/csv/cells/extensionextrainfo_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
/**
@@ -28,7 +27,6 @@
*/
class extensionextrainfo_cell extends cell_base {
-
/**
* @param $submission
* @param $student
diff --git a/classes/export/csv/cells/extensionreason_cell.php b/classes/export/csv/cells/extensionreason_cell.php
index 32e78ec0..4696d891 100644
--- a/classes/export/csv/cells/extensionreason_cell.php
+++ b/classes/export/csv/cells/extensionreason_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
/**
diff --git a/classes/export/csv/cells/feedbackcomments_cell.php b/classes/export/csv/cells/feedbackcomments_cell.php
index 88c7d7ad..d88dd04b 100644
--- a/classes/export/csv/cells/feedbackcomments_cell.php
+++ b/classes/export/csv/cells/feedbackcomments_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
use mod_coursework\models\submission;
use mod_coursework\ability;
@@ -33,7 +32,6 @@
*/
class feedbackcomments_cell extends cell_base {
-
/**
* @param submission $submission
* @param $student
@@ -56,7 +54,6 @@ public function get_header($stage){
return get_string('feedbackcomment', 'coursework');
}
-
public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = array()) {
global $PAGE, $DB, $USER;
@@ -96,7 +93,6 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
);
$new_feedback = feedback::build($feedback_params);
-
//this is a new feedback check it against the new ability checks
if (!$ability->can('new', $new_feedback)) return get_string('nopermissiontogradesubmission','coursework');
} else {
diff --git a/classes/export/csv/cells/finalgrade_cell.php b/classes/export/csv/cells/finalgrade_cell.php
index 05cee364..23dfac7b 100644
--- a/classes/export/csv/cells/finalgrade_cell.php
+++ b/classes/export/csv/cells/finalgrade_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
use mod_coursework\models\submission;
diff --git a/classes/export/csv/cells/group_cell.php b/classes/export/csv/cells/group_cell.php
index f860067e..8f653dc4 100644
--- a/classes/export/csv/cells/group_cell.php
+++ b/classes/export/csv/cells/group_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
/**
diff --git a/classes/export/csv/cells/idnumber_cell.php b/classes/export/csv/cells/idnumber_cell.php
index 76c54eff..8ed7a328 100644
--- a/classes/export/csv/cells/idnumber_cell.php
+++ b/classes/export/csv/cells/idnumber_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
use mod_coursework\models\submission;
diff --git a/classes/export/csv/cells/moderationagreement_cell.php b/classes/export/csv/cells/moderationagreement_cell.php
index d9a015b2..4272fa12 100644
--- a/classes/export/csv/cells/moderationagreement_cell.php
+++ b/classes/export/csv/cells/moderationagreement_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
use mod_coursework\models\submission;
use mod_coursework\models\moderation;
diff --git a/classes/export/csv/cells/name_cell.php b/classes/export/csv/cells/name_cell.php
index 7e60fa5f..290ae3db 100644
--- a/classes/export/csv/cells/name_cell.php
+++ b/classes/export/csv/cells/name_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
use mod_coursework\models\submission;
diff --git a/classes/export/csv/cells/otherassessors_cell.php b/classes/export/csv/cells/otherassessors_cell.php
index abead9f9..e8f976c1 100644
--- a/classes/export/csv/cells/otherassessors_cell.php
+++ b/classes/export/csv/cells/otherassessors_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
use mod_coursework\models\submission;
use mod_coursework\grade_judge;
@@ -33,7 +32,6 @@
*/
class otherassessors_cell extends cell_base{
-
/**
* @param submission $submission
* @param $student
@@ -47,7 +45,6 @@ public function get_cell($submission, $student, $stage_identifier){
// $stage_identifier =
// retrieve all feedbacks without currents user feedback
-
$params = array(
'submissionid' => $submission->id,
'assessorid' => $USER->id,
@@ -87,7 +84,6 @@ public function get_cell($submission, $student, $stage_identifier){
$gradedata[] = '';
}
-
} else {
if ($this->coursework->is_using_rubric()){
@@ -153,6 +149,4 @@ public function get_header($stage){
return $fields;
}
-
-
}
diff --git a/classes/export/csv/cells/personaldeadline_cell.php b/classes/export/csv/cells/personaldeadline_cell.php
index c6c6fcd0..88ebb34d 100644
--- a/classes/export/csv/cells/personaldeadline_cell.php
+++ b/classes/export/csv/cells/personaldeadline_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
use mod_coursework\models\submission;
/**
diff --git a/classes/export/csv/cells/plagiarismflagcomment_cell.php b/classes/export/csv/cells/plagiarismflagcomment_cell.php
index 09d66601..5397f6df 100644
--- a/classes/export/csv/cells/plagiarismflagcomment_cell.php
+++ b/classes/export/csv/cells/plagiarismflagcomment_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
/**
diff --git a/classes/export/csv/cells/plagiarismflagstatus_cell.php b/classes/export/csv/cells/plagiarismflagstatus_cell.php
index 50111673..f6f8c504 100644
--- a/classes/export/csv/cells/plagiarismflagstatus_cell.php
+++ b/classes/export/csv/cells/plagiarismflagstatus_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
/**
diff --git a/classes/export/csv/cells/singlegrade_cell.php b/classes/export/csv/cells/singlegrade_cell.php
index 14dfee8d..5aa68ccd 100644
--- a/classes/export/csv/cells/singlegrade_cell.php
+++ b/classes/export/csv/cells/singlegrade_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
use mod_coursework\models\submission;
use mod_coursework\grade_judge;
@@ -33,7 +32,6 @@
*/
class singlegrade_cell extends cell_base{
-
/**
* @param $submission
* @param $student
@@ -75,7 +73,6 @@ public function get_header($stage){
return $strings;
}
-
public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = array()) {
global $PAGE, $DB, $USER;
@@ -96,7 +93,6 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
}
} else {
-
//we won't be processing this line if it has no values, empty wont tell us this as it thinks that an array with
//keys isnt. We will use array_filter whhich will return all values from the array if this is empty then we have
//nothing to do
@@ -137,10 +133,8 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
}
-
if (!empty($errormsg)) return $errormsg;
-
$dbrecord = $DB->get_record('coursework_submissions', array('id' => $submissionid));
$submission = \mod_coursework\models\submission::find($dbrecord);
@@ -172,9 +166,6 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
}
-
-
-
$ability = new ability(user::find($USER), $this->coursework);
$feedback_params = array(
@@ -195,7 +186,6 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
);
$new_feedback = feedback::build($feedback_params);
-
//this is a new feedback check it against the new ability checks
if (!$ability->can('new', $new_feedback)) return get_string('nopermissiontogradesubmission','coursework');
} else {
@@ -237,7 +227,6 @@ function value_in_rubric($criteria, $value) {
}
}
-
return $valuefound;
}
@@ -250,7 +239,6 @@ function value_in_rubric($criteria, $value) {
*/
function get_rubrics($coursework, $csv_cells) {
-
if ($coursework->is_using_rubric()) {
$rubricheaders = array();
@@ -262,13 +250,11 @@ function get_rubrics($coursework, $csv_cells) {
$rubricheaders[] = $criteria['description']." comment";
}
-
//find out the position of singlegrade
$position = array_search('singlegrade', $csv_cells);
//get all data from the position of the singlegrade to the length of rubricheaders
// $csv_cells = array_splice($csv_cells,5, 1, $rubricheaders);
-
$start_cells = array_slice($csv_cells,0, $position,true);
$end_cells = array_slice($csv_cells, $position+1,count($csv_cells),true);
@@ -276,11 +262,8 @@ function get_rubrics($coursework, $csv_cells) {
$cells = array_merge($cells, $end_cells);
-
-
}
-
return $cells;
}
diff --git a/classes/export/csv/cells/stages_cell.php b/classes/export/csv/cells/stages_cell.php
index 0fd23d09..348e93f6 100644
--- a/classes/export/csv/cells/stages_cell.php
+++ b/classes/export/csv/cells/stages_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
use mod_coursework\models\submission;
@@ -47,8 +46,6 @@ public function get_cell($submission, $student, $stage_identifier){
$timemodified = $feedback->timemodified;
}
-
-
$gradedata = array();
// go through each stage and get a grade, if grade not present then put a placeholder
for ($i = 1; $i <= $this->stages; $i++){
@@ -104,7 +101,6 @@ public function get_cell($submission, $student, $stage_identifier){
$gradedata[] = $submission->get_agreed_grade() == false ? '' : $this->get_assessor_username($submission->get_agreed_grade()->lasteditedbyuser);
}
-
$gradedata[] = $submission->get_agreed_grade() == false ? '' : userdate($submission->get_agreed_grade()->timemodified, $this->dateformat);
}
@@ -158,10 +154,4 @@ public function get_header($stage){
return $fields;
}
-
-
-
-
-
-
}
diff --git a/classes/export/csv/cells/submissiondate_cell.php b/classes/export/csv/cells/submissiondate_cell.php
index 73a0204d..55e0d21a 100644
--- a/classes/export/csv/cells/submissiondate_cell.php
+++ b/classes/export/csv/cells/submissiondate_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
use mod_coursework\models\submission;
@@ -29,7 +28,6 @@
*/
class submissiondate_cell extends cell_base {
-
/**
* @param submission $submission
* @param $student
diff --git a/classes/export/csv/cells/submissionfileid_cell.php b/classes/export/csv/cells/submissionfileid_cell.php
index af4ff1c8..7dc44eed 100644
--- a/classes/export/csv/cells/submissionfileid_cell.php
+++ b/classes/export/csv/cells/submissionfileid_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
/**
diff --git a/classes/export/csv/cells/submissionid_cell.php b/classes/export/csv/cells/submissionid_cell.php
index f2713f27..d88ece98 100644
--- a/classes/export/csv/cells/submissionid_cell.php
+++ b/classes/export/csv/cells/submissionid_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
/**
diff --git a/classes/export/csv/cells/submissiontime_cell.php b/classes/export/csv/cells/submissiontime_cell.php
index e1e003d7..58cc4b41 100644
--- a/classes/export/csv/cells/submissiontime_cell.php
+++ b/classes/export/csv/cells/submissiontime_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
/**
@@ -28,7 +27,6 @@
*/
class submissiontime_cell extends cell_base {
-
/**
* @param $submission
* @param $student
@@ -49,5 +47,4 @@ public function get_header($stage){
}
-
}
diff --git a/classes/export/csv/cells/username_cell.php b/classes/export/csv/cells/username_cell.php
index 9406c6e9..21125011 100644
--- a/classes/export/csv/cells/username_cell.php
+++ b/classes/export/csv/cells/username_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\export\csv\cells;
use mod_coursework\models\submission;
diff --git a/classes/export/grading_sheet.php b/classes/export/grading_sheet.php
index 1779712a..8e71ada4 100644
--- a/classes/export/grading_sheet.php
+++ b/classes/export/grading_sheet.php
@@ -14,7 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see
.
-
namespace mod_coursework\export;
use mod_coursework\export\csv;
use mod_coursework\models\submission;
@@ -24,8 +23,6 @@
class grading_sheet extends csv{
-
-
public function get_submissions($groupid = null, $selected_submission_ids = ''){
global $PAGE, $USER;
$params = array(
@@ -47,7 +44,6 @@ public function get_submissions($groupid = null, $selected_submission_ids = ''){
$ability = new ability(user::find($USER), $this->coursework);
-
if (!has_capability('mod/coursework:administergrades', $PAGE->context)) {
/**
@@ -139,7 +135,6 @@ public function add_csv_data($submission){
return $csv_data;
}
-
/**
* Put together cells that will be used in the csv file
* @param coursework $coursework
@@ -202,7 +197,6 @@ public static function cells_array($coursework){
$csv_cells[] = $criteria['description']." comment";
}
-
}
*/
$csv_cells[] = 'feedbackcomments';
diff --git a/classes/export/import.php b/classes/export/import.php
index ccef728d..3ce8a8d7 100644
--- a/classes/export/import.php
+++ b/classes/export/import.php
@@ -30,20 +30,12 @@
global $CFG;
require_once($CFG->libdir . '/csvlib.class.php');
-
-
-
-
class import extends grading_sheet{
-
public function validate_submissionfileid(){
-
$submissions = $this->get_submissions();
-
-
}
/**
@@ -71,7 +63,6 @@ public function validate_csv($content, $encoding, $delimeter, $csv_cells) {
print_error('csvloaderror', '', 'returnurl', $csvloaderror);
}
-
$columns = $csvreader->get_columns();
if (empty($columns)) {
@@ -87,9 +78,6 @@ public function validate_csv($content, $encoding, $delimeter, $csv_cells) {
$submissions = $this->get_submissions();
-
-
-
while ($line = $csvreader->next()) {
$csv = $this->remove_other_assessors_grade($csv_cells, $line);
@@ -98,11 +86,9 @@ public function validate_csv($content, $encoding, $delimeter, $csv_cells) {
$i = 0;
-
$id = false;
$submissionid = false;
-
// if the csv headers count is different than expected return error
if ((!$this->coursework->is_using_rubric() && sizeof($line) != sizeof($cells)) || ($this->coursework->is_using_rubric() && !$this->rubric_count_correct($cells, $line))) {$errors = get_string('incorrectfileformat', 'coursework'); break;}
@@ -111,7 +97,6 @@ public function validate_csv($content, $encoding, $delimeter, $csv_cells) {
//holds details on grades that have been successfully uploaded for the current line
$uploadedgradecells = array();
-
for($z = 0; $z < count($line); $z++) {
$value = $line[$z];
@@ -132,10 +117,8 @@ public function validate_csv($content, $encoding, $delimeter, $csv_cells) {
if (empty($submissionid)) $errors[$s][] = get_string('emptysubmissionid', 'coursework');
-
//offsets the position of that we extract the data from $line based on data that has been extracted before
-
if (($cells[$i] == "singlegrade" || $cells[$i] == "assessorgrade" || $cells[$i] == "agreedgrade")
&& $this->coursework->is_using_rubric() && !($cells[$i] == "agreedgrade" && $this->coursework->finalstagegrading == 1)) {
@@ -158,7 +141,6 @@ public function validate_csv($content, $encoding, $delimeter, $csv_cells) {
$result = $cell->validate_cell($value, $submissionid, $stage_identifier, $uploadedgradecells);
}
-
if ($result !== true) {
$errors[$s] = $result;
break; //go to next line on error
@@ -175,7 +157,6 @@ public function validate_csv($content, $encoding, $delimeter, $csv_cells) {
return (!empty($errors)) ? $errors : false ;
}
-
function rubric_count_correct($csvheader, $linefromimportedcsv) {
// get criteria of rubrics and match it to grade cells
@@ -230,7 +211,6 @@ function rubric_count_correct($csvheader, $linefromimportedcsv) {
$expectedsize = (int)sizeof($csvheader);
$actualsize = (int)sizeof($linefromimportedcsv);
-
}
}
@@ -238,7 +218,6 @@ function rubric_count_correct($csvheader, $linefromimportedcsv) {
return $expectedsize != $actualsize ? false : true;
-
}
}
@@ -264,13 +243,11 @@ function get_rubric_headers($csvheader) {
}
}
-
}
return $csvheader;
}
-
/**
* Process csv and add records to the DB
*
@@ -296,7 +273,6 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
print_error('csvloaderror', '', 'returnurl', $csvloaderror);
}
-
$columns = $csvreader->get_columns();
if (empty($columns)) {
@@ -309,7 +285,6 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
$s = 0;
-
$submissionid = false;
while ($line = $csvreader->next()) {
@@ -320,9 +295,6 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
continue;
}
-
-
-
$csv = $this->remove_other_assessors_grade($csv_cells, $line);
//gets the headers that should be being used in the uploaded csv
//$cells = $this->get_rubric_headers($csv);
@@ -331,7 +303,6 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
$csvline = array();
-
//if ((!$this->coursework->is_using_rubric() && sizeof($line) != sizeof($cells)) || ($this->coursework->is_using_rubric() && !$this->rubric_count_correct($csv, $line))) {
//if (sizeof($line) != sizeof($cells)) {
if ((!$this->coursework->is_using_rubric() && sizeof($line) != sizeof($cells)) || ($this->coursework->is_using_rubric() && !$this->rubric_count_correct($csv, $line))) {
@@ -358,10 +329,8 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
$subdbrecord = $DB->get_record('coursework_submissions', array('id' => $submissionid));
$submission = \mod_coursework\models\submission::find($subdbrecord);
-
//is this submission graded? if yes did this user grade it?
-
$coursework = $submission->get_coursework();
$stages = array();
@@ -382,7 +351,6 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
}
}
-
$a = 1;
//defines the start offest to be used when searching for a rubric in a uploaded csv, if the format of upload
@@ -390,8 +358,6 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
$rubricoffset = $rubricoffsetstart = ($coursework->is_configured_to_have_group_submissions()) ? 4 : 5;
-
-
$numberofstages = count($stages);
foreach($stages as $k => $stage) {
@@ -431,11 +397,8 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
//if yes then we may need to generate the grade for the grade pointer as
//they dont have grades
-
-
if ($coursework->is_using_rubric() && !($stage == 'final_agreed_1' && $this->coursework->finalstagegrading == 1)) {
-
//array that will hold the advanced grade data
$criteriagradedata = array();
$criteriagradedata['criteria'] = array();
@@ -453,10 +416,8 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
//the calculation below finds the position of the agreed grades in the uploaded csv
-
$rubricoffset = $rubricoffsetstart + $stagemultiplier + ($numberofrubrics * $stagemultiplier);
-
if ($coursework->allocation_enabled()) $rubricoffset += 1;
$rubricdata = array_slice($line, $rubricoffset, $numberofrubrics);
@@ -475,9 +436,6 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
$rubricoffset = $rubricoffset + $numberofrubrics + 1;
}
-
-
-
$arrayvalues = array_filter($rubricdata);
if (!empty($arrayvalues)) {
@@ -493,11 +451,9 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
$levelid = $this->get_value_rubric_levelid($c, $rubricdata[$critidx]);
-
$criteriagrade['levelid'] = $levelid;
$criteriagrade['remark'] = $rubricdata[$critidx + 1];
-
$criteriagradedata['criteria'][$c['id']] = $criteriagrade;
$critidx = $critidx + 2;
@@ -507,7 +463,6 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
$criteriagradedata = false;
}
-
//need to decide where the grade instance submit and get grade should be put as in order
//pass the criteria data into the csvline position for the grade data so we can generate a grade
@@ -515,11 +470,8 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
//in case there is another rubric to be extracted from the csv set the new value of the rubric offset
-
-
} else if ($coursework->is_using_rubric() && ($stage == 'final_agreed_1' && $this->coursework->finalstagegrading == 1)) {
-
if (!isset($numberofrubrics)) {
$criterias = $this->coursework->get_rubric_criteria();
@@ -532,10 +484,8 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
//the calculation below finds the position of the agreed grades in the uploaded csv
-
$rubricoffset = $rubricoffsetstart + $stagemultiplier + ($numberofrubrics * $stagemultiplier);
-
if ($coursework->allocation_enabled()) $rubricoffset += 1;
$gradearrvalue = array_slice($line, $rubricoffset, 2);
@@ -545,7 +495,6 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
}
-
// don't create/update feedback if grade is empty
if (!empty($csvline[$gradepointer])) {
@@ -573,11 +522,8 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
return (!empty($errors)) ? $errors : false ;
-
-
}
-
/***
* Returns the levelid for the given rubric value
*
@@ -605,11 +551,9 @@ function get_value_rubric_levelid($criteria, $value) {
}
}
-
return $idfound;
}
-
/**
* Add grade and feedback record
*
@@ -667,11 +611,9 @@ public function add_grade($submissionid, $grade, $feedback, $stage_identifier, $
}
-
return $feedbackid;
}
-
/**
* Get feedbackid of existing feedback
*
@@ -753,13 +695,11 @@ public function get_stage_identifier($submissionid, $cell_identifier) {
global $DB, $USER;
$submission = $DB->get_record('coursework_submissions', array('id' => $submissionid));
-
$submission = \mod_coursework\models\submission::find($submission);
// single marked - singlegrade - allocated/notallocated
$stage_identifier = 'assessor_1';
-
//double marked - singlegrade - allocated
if ($this->coursework->get_max_markers()>1 && ($cell_identifier == 'singlegrade' || $cell_identifier == 'feedbackcomments')
&& $this->coursework->allocation_enabled()){
@@ -773,7 +713,6 @@ public function get_stage_identifier($submissionid, $cell_identifier) {
$stage_identifier = $dbrecord->stage_identifier;
}
-
//double marked - singlegrade - notallocated
if ($this->coursework->get_max_markers()>1 && ($cell_identifier == 'singlegrade' || $cell_identifier == 'feedbackcomments')
&& !$this->coursework->allocation_enabled()){
@@ -821,7 +760,6 @@ public function get_stage_identifier($submissionid, $cell_identifier) {
}
-
// double marked - multiplegrade - allocated/notallocated
if ($this->coursework->get_max_markers()>1 && ($cell_identifier != 'singlegrade' && $cell_identifier != 'feedbackcomments')) {
if (substr($cell_identifier, 0, 8) == 'assessor') {
@@ -832,11 +770,9 @@ public function get_stage_identifier($submissionid, $cell_identifier) {
}
}
-
return $stage_identifier;
}
-
/**
* Create agreed grade if all initial grade are present
* @param $cwfeedbackid
@@ -857,7 +793,6 @@ public function auto_agreement($cwfeedbackid){
$auto_grader->create_auto_grade_if_rules_match();
}
-
public function remove_other_assessors_grade($csv_cells, &$line){
$otherassessors = false;
@@ -889,6 +824,5 @@ public function remove_other_assessors_grade($csv_cells, &$line){
return $csv_cells;
-
}
}
diff --git a/classes/feedback_files.php b/classes/feedback_files.php
index f620e7b2..87b09a87 100644
--- a/classes/feedback_files.php
+++ b/classes/feedback_files.php
@@ -28,7 +28,6 @@
defined('MOODLE_INTERNAL') || die();
-
/**
* Represents the files a student has submitted.
*/
diff --git a/classes/file_importer.php b/classes/file_importer.php
index dcf96e88..d53ddcbe 100644
--- a/classes/file_importer.php
+++ b/classes/file_importer.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework;
use mod_coursework\models\coursework;
@@ -31,8 +30,6 @@
class coursework_file_zip_importer {
-
-
public function extract_zip_file($filename, $contextid) {
global $USER;
@@ -92,7 +89,6 @@ public function delete_import_files($contextid) {
$USER->id);
}
-
/**
* Process an uploaded zip file
*
@@ -116,7 +112,6 @@ public function import_zip_files($coursework, $feedbackstage, $overwritecurrent)
$participants = $coursework->get_allocatables();
-
foreach ($feedbackfiles as $file) {
$filename = $file->get_filename();
@@ -142,7 +137,6 @@ public function import_zip_files($coursework, $feedbackstage, $overwritecurrent)
}
}
-
if ($feedback = $this->feedback_exists($coursework, $submission, $feedbackstage)) {
if ($oldfile = $fs->get_file($contextid,
@@ -176,7 +170,6 @@ public function import_zip_files($coursework, $feedbackstage, $overwritecurrent)
$results[$filename] = get_string('feedbackfilecreated', 'mod_coursework');
}
-
} else {
$results[$filename] = get_string('assessorfeedbacknotfound', 'mod_coursework');
}
@@ -194,13 +187,10 @@ public function import_zip_files($coursework, $feedbackstage, $overwritecurrent)
return $results;
-
}
-
public function is_valid_feedback_file_filename($coursework, $feedbackfile, $participants) {
-
$result = false;
$filename = explode('.', $feedbackfile->get_filename());
@@ -226,12 +216,10 @@ public function is_valid_feedback_file_filename($coursework, $feedbackfile, $par
}
}
-
return $result;
}
-
public function feedback_exists($coursework, $submission, $stageidentifier) {
global $DB, $USER;
@@ -255,5 +243,4 @@ public function feedback_exists($coursework, $submission, $stageidentifier) {
}
-
}
diff --git a/classes/forms/assessor_feedback_mform.php b/classes/forms/assessor_feedback_mform.php
index 59c3e869..982fc6a4 100644
--- a/classes/forms/assessor_feedback_mform.php
+++ b/classes/forms/assessor_feedback_mform.php
@@ -118,7 +118,6 @@ public function definition() {
null,
$file_manager_options);
-
$this->add_submit_buttons($coursework->draft_feedback_enabled(), $feedback->id);
}
@@ -130,7 +129,6 @@ public function get_grading_controller() {
return $this->_grading_controller;
}
-
/**
* @param $draftenabled
*/
@@ -142,13 +140,11 @@ public function add_submit_buttons($draftenabled, $feedbackid){
$button_array[] = $this->_form->createElement('submit', 'submitfeedbackbutton', get_string('saveasdraft', 'coursework'));
}
-
$button_array[] =
$this->_form->createElement('submit', 'submitbutton', get_string('saveandfinalise', 'coursework'));
$feedback = $this->_customdata['feedback'];
-
$is_published = $feedback->get_submission()->is_published();
if ($feedbackid && !$is_published) {
@@ -198,7 +194,6 @@ public function process_data(feedback $feedback) {
$feedback->feedbackcomment = $formdata->feedbackcomment['text'];
$feedback->feedbackcommentformat = $formdata->feedbackcomment['format'];
-
return $feedback;
}
diff --git a/classes/forms/deadline_extension_form.php b/classes/forms/deadline_extension_form.php
index 205e6bd3..3b1adef3 100644
--- a/classes/forms/deadline_extension_form.php
+++ b/classes/forms/deadline_extension_form.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\forms;
use mod_coursework\models\coursework;
@@ -45,7 +44,6 @@ protected function definition() {
$this->_form->addElement('hidden', 'id');
$this->_form->settype('id', PARAM_INT);
-
if ($this->get_coursework()->personaldeadlineenabled && $personal_deadline = $this->personal_deadline()){
$this->_form->addElement('html', '
Personal deadline: '. userdate($personal_deadline->personal_deadline).'
');
} else {
@@ -53,8 +51,6 @@ protected function definition() {
$this->_form->addElement('html', '
Default deadline: ' . userdate($this->get_coursework()->deadline) . '
');
}
-
-
// Date and time picker
$this->_form->addElement('date_time_selector', 'extended_deadline', get_string('extended_deadline',
'mod_coursework'));
@@ -88,14 +84,12 @@ public function validation($data, $files) {
global $CFG;
$max_deadline = $CFG->coursework_max_extension_deadline;
-
if ($this->get_coursework()->personaldeadlineenabled && $personal_deadline = $this->personal_deadline()){
$deadline = $personal_deadline->personal_deadline;
} else {
$deadline = $this->get_coursework()->deadline;
}
-
$errors = array();
if ($data['extended_deadline'] <= $deadline) {
$errors['extended_deadline'] = 'The new deadline must be later than the current deadline';
@@ -133,5 +127,4 @@ public function personal_deadline(){
return $personal_deadline = $DB->get_record('coursework_person_deadlines', $params);
}
-
}
diff --git a/classes/forms/moderator_agreement_mform.php b/classes/forms/moderator_agreement_mform.php
index 9a14be61..9cc67b75 100644
--- a/classes/forms/moderator_agreement_mform.php
+++ b/classes/forms/moderator_agreement_mform.php
@@ -65,7 +65,6 @@ public function definition() {
$mform->addElement('hidden', 'submissionid', $moderation->get_submission()->id);
$mform->setType('submissionid', PARAM_INT);
-
$mform->addElement('hidden', 'moderatorid', $moderation->moderatorid);
$mform->setType('moderatorid', PARAM_INT);
@@ -81,7 +80,6 @@ public function definition() {
$mform->addElement('hidden', 'courseworkid', $coursework->id);
$mform->setType('courseworkid', PARAM_INT);
-
// moderator agreement
$options = array('agreed' => get_string('agreed', 'coursework'), 'disagreed' => get_string('disagreed', 'coursework'));
$mform->addElement('select', 'agreement',
@@ -89,11 +87,9 @@ public function definition() {
$options,
array('id' => 'moderation_agreement'));
-
$mform->addElement('editor', 'modcomment', get_string('comment', 'mod_coursework'), array('id' => 'moderation_comment'));
$mform->setType('editor', PARAM_RAW);
-
$this->add_action_buttons();
}
@@ -113,7 +109,6 @@ public function process_data(moderation $moderation) {
$moderation->modcomment = $formdata->modcomment['text'];
$moderation->modcommentformat = $formdata->modcomment['format'];
-
return $moderation;
}
}
diff --git a/classes/forms/personal_deadline_form.php b/classes/forms/personal_deadline_form.php
index 1d1c8155..c09d5576 100644
--- a/classes/forms/personal_deadline_form.php
+++ b/classes/forms/personal_deadline_form.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\forms;
use mod_coursework\models\coursework;
@@ -49,14 +48,12 @@ protected function definition() {
$this->_form->addElement('hidden', 'multipleuserdeadlines');
$this->_form->settype('multipleuserdeadlines', PARAM_INT);
-
// Current deadline for comparison
$this->_form->addElement('html', '
Default deadline: '. userdate($this->get_coursework()->deadline).'
');
// Date and time picker
$this->_form->addElement('date_time_selector', 'personal_deadline', get_string('personal_deadline', 'mod_coursework'));
-
// Submit button
$this->add_action_buttons();
}
@@ -65,7 +62,6 @@ private function get_coursework() {
return $this->_customdata['coursework'];
}
-
/**
* @param array $data
* @param array $files
diff --git a/classes/forms/plagiarism_flagging_mform.php b/classes/forms/plagiarism_flagging_mform.php
index fd001861..9611d0b5 100644
--- a/classes/forms/plagiarism_flagging_mform.php
+++ b/classes/forms/plagiarism_flagging_mform.php
@@ -43,7 +43,6 @@ class plagiarism_flagging_mform extends moodleform {
*/
public $submission_id;
-
/**
* Makes the form elements.
*/
diff --git a/classes/forms/student_submission_form.php b/classes/forms/student_submission_form.php
index 2b28c3fd..121205a4 100644
--- a/classes/forms/student_submission_form.php
+++ b/classes/forms/student_submission_form.php
@@ -186,8 +186,6 @@ public function handle() {
}
}
-
-
}
// Must happen AFTER file attributes have been fiddled with, otherwise we get
@@ -229,7 +227,6 @@ public function handle() {
}
}
-
/**
* Sets the data, tweaking the submission to conform to the form's field names
*
@@ -263,7 +260,6 @@ public function set_data($submission) {
}
-
/**
* @return coursework
*/
diff --git a/classes/forms/upload_allocations_form.php b/classes/forms/upload_allocations_form.php
index 43b09d5b..56b96df7 100644
--- a/classes/forms/upload_allocations_form.php
+++ b/classes/forms/upload_allocations_form.php
@@ -23,8 +23,6 @@
require_once($CFG->libdir.'/formslib.php');
-
-
class upload_allocations_form extends moodleform {
private $cmid;
@@ -60,7 +58,6 @@ function definition() {
$mform->addElement('select', 'encoding', get_string('encoding', 'tool_uploaduser'), $choices);
$mform->setDefault('encoding', 'UTF-8');
-
$this->add_action_buttons(true,get_string('uploadallocations', 'coursework'));
}
diff --git a/classes/forms/upload_feedback_form.php b/classes/forms/upload_feedback_form.php
index 910a58d9..8047cc55 100644
--- a/classes/forms/upload_feedback_form.php
+++ b/classes/forms/upload_feedback_form.php
@@ -27,12 +27,8 @@
* Time: 18:27
*/
-
-
require_once($CFG->libdir.'/formslib.php');
-
-
class upload_feedback_form extends moodleform {
private $cmid;
@@ -88,7 +84,6 @@ function definition() {
$mform->disabledIf('overwrite', 'feedbackstage', 'eq', 'final_agreed_1');
}
-
$this->add_action_buttons(true,get_string('uploadfeedbackzip', 'coursework'));
}
diff --git a/classes/forms/upload_grading_sheet_form.php b/classes/forms/upload_grading_sheet_form.php
index 38d38bc0..723d8c07 100644
--- a/classes/forms/upload_grading_sheet_form.php
+++ b/classes/forms/upload_grading_sheet_form.php
@@ -27,12 +27,8 @@
* Time: 18:27
*/
-
-
require_once($CFG->libdir.'/formslib.php');
-
-
class upload_grading_sheet_form extends moodleform {
private $cmid;
@@ -68,7 +64,6 @@ function definition() {
$mform->addElement('select', 'encoding', get_string('encoding', 'tool_uploaduser'), $choices);
$mform->setDefault('encoding', 'UTF-8');
-
$this->add_action_buttons(true,get_string('uploadgradingworksheet', 'coursework'));
}
@@ -76,7 +71,4 @@ function display() {
return $this->_form->toHtml();
}
-
-
-
}
diff --git a/classes/forms/view_all_students_mform.php b/classes/forms/view_all_students_mform.php
index 74cfffde..684f56e4 100644
--- a/classes/forms/view_all_students_mform.php
+++ b/classes/forms/view_all_students_mform.php
@@ -36,14 +36,12 @@ function definition() {
$this->_form->addElement('hidden', 'id', $this->_customdata['cmid']);
$this->_form->setType('id', PARAM_INT);
-
$buttontext = (empty($this->_customdata['displayallstudents'])) ? get_string('viewallstudents', 'coursework') : get_string('hideallstudents', 'coursework');
$hiddenvalue = (empty($this->_customdata['displayallstudents'])) ? 1 : 0;
$this->_form->addElement('submit', 'displayallstudentbutton', $buttontext);
$this->_form->addElement('hidden', 'displayallstudents', $hiddenvalue);
$this->_form->setType('displayallstudents', PARAM_INT);
-
}
/**
@@ -55,5 +53,4 @@ public function display() {
return $this->_form->toHtml();
}
-
}
diff --git a/classes/framework/ability.php b/classes/framework/ability.php
index 0fd32278..7712ca3a 100644
--- a/classes/framework/ability.php
+++ b/classes/framework/ability.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\framework;
use mod_coursework\ability\rule;
@@ -213,5 +212,4 @@ protected function prevent($action, $class, $function) {
$this->rules[] = $rule;
}
-
}
diff --git a/classes/framework/decorator.php b/classes/framework/decorator.php
index 05cb833e..ec9eb67e 100644
--- a/classes/framework/decorator.php
+++ b/classes/framework/decorator.php
@@ -20,10 +20,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\framework;
-
/**
* Class decorator
*
diff --git a/classes/framework/table_base.php b/classes/framework/table_base.php
index c79becab..66381853 100644
--- a/classes/framework/table_base.php
+++ b/classes/framework/table_base.php
@@ -16,7 +16,6 @@
namespace mod_coursework\framework;;
-
use moodle_database;
use stdClass;
@@ -119,7 +118,6 @@ public static function find_all($params = array()) {
return self::instantiate_objects($params);
}
-
/**
* Makes a new object ready to save
*
@@ -149,7 +147,6 @@ public static function create($params) {
return $item;
}
-
/**
* Takes the supplied DB record (one row of the table) and applies it to this object. If it's a
* number, change it to a DB row and then do it.
diff --git a/classes/framework/test/classes/user_table.php b/classes/framework/test/classes/user_table.php
index 06b5065a..afc21545 100644
--- a/classes/framework/test/classes/user_table.php
+++ b/classes/framework/test/classes/user_table.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* Class framework_user_table allows us to test the table_base class on a reasonably stable table
* with known columns.
diff --git a/classes/framework/test/table_base_test.php b/classes/framework/test/table_base_test.php
index 93c12362..90fad0b3 100644
--- a/classes/framework/test/table_base_test.php
+++ b/classes/framework/test/table_base_test.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
defined('MOODLE_INTERNAL') || die();
global $CFG;
@@ -93,7 +92,6 @@ public function test_find_when_false_and_zero_supplied() {
$this->assertFalse(framework_user_table::find(0));
}
-
public function test_exists_when_true() {
$generator = testing_util::get_data_generator();
diff --git a/classes/grade_judge.php b/classes/grade_judge.php
index 3b165aa7..2501f5a2 100644
--- a/classes/grade_judge.php
+++ b/classes/grade_judge.php
@@ -20,8 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
-
namespace mod_coursework;
use mod_coursework\allocation\allocatable;
@@ -162,7 +160,6 @@ public function is_feedback_that_is_promoted_to_gradebook(feedback $feedback) {
return $gradebook_feedback && $gradebook_feedback->id == $feedback->id;
}
-
/**
* @param allocatable $allocatable
* @return bool
@@ -177,7 +174,6 @@ public function allocatable_needs_more_than_one_feedback ($allocatable){
return $this->coursework->has_multiple_markers();
}
-
}
public function grade_in_scale($value) {
@@ -214,10 +210,6 @@ public function get_grade($value) {
return $value;
}
-
}
-
-
-
}
diff --git a/classes/grades/gradeitems.php b/classes/grades/gradeitems.php
index f3c93d34..ef05f002 100644
--- a/classes/grades/gradeitems.php
+++ b/classes/grades/gradeitems.php
@@ -58,4 +58,3 @@ public static function get_advancedgrading_itemnames(): array {
}
}
-
diff --git a/classes/grading_report.php b/classes/grading_report.php
index 2952608c..6badadb2 100644
--- a/classes/grading_report.php
+++ b/classes/grading_report.php
@@ -114,7 +114,6 @@ public function get_coursework() {
return $this->coursework;
}
-
/**
* @param $options
* @return string
@@ -199,7 +198,6 @@ public function sort_by_firstname($a, $b) {
return $sort;
}
-
/**
* For use with usort.
* Method called dynamically, so don't delete if unused. See construct_sort_function_name().
@@ -251,7 +249,6 @@ public function sort_by_lastname($a, $b) {
return $this->sort_by_stringfield($a->get_student_lastname(), $b->get_student_lastname());
}
-
/**
* For use with usort.
* Method called dynamically, so don't delete if unused. See construct_sort_function_name().
@@ -264,8 +261,6 @@ public function sort_by_groupname($a, $b) {
return $this->sort_by_stringfield($a->get_allocatable()->name, $b->get_allocatable()->name);
}
-
-
/**
* For use with usort.
* Method called dynamically, so don't delete if unused. See construct_sort_function_name().
@@ -426,5 +421,4 @@ public function get_options() {
return $this->options;
}
-
}
diff --git a/classes/grading_table_row_base.php b/classes/grading_table_row_base.php
index 1b846495..8a8cd126 100644
--- a/classes/grading_table_row_base.php
+++ b/classes/grading_table_row_base.php
@@ -26,7 +26,6 @@
defined('MOODLE_INTERNAL') || die();
-
/**
* Refactoring the grading table to clarify the logic. There will be two subclasses of this -
* one for single row tables and one for multi-row tables. These classes contain all the business
@@ -205,8 +204,6 @@ public function get_personal_deadlines() {
return $personal_deadline;
}
-
-
/**
* Returns the hash used to name files anonymously for this user/coursework combination
*/
@@ -260,7 +257,6 @@ public function get_plagiarism_flag() {
return plagiarism_flag::find($params);
}
-
/**
* Chained getter to prevent tight coupling.
*
@@ -394,7 +390,6 @@ public function get_single_feedback(){
return $this->get_submission()->get_assessor_feedback_by_stage('assessor_1');
}
-
/**
* Check if the extension is given to this row
*
@@ -410,7 +405,6 @@ public function has_extension() {
}
-
/**
* Getter for row extension
*
diff --git a/classes/grading_table_row_multi.php b/classes/grading_table_row_multi.php
index a03c6ec4..232865d8 100644
--- a/classes/grading_table_row_multi.php
+++ b/classes/grading_table_row_multi.php
@@ -18,13 +18,11 @@
defined('MOODLE_INTERNAL') || die();
-
/**
* Single row of the grading table for when there are multiple markers.
*/
class grading_table_row_multi extends grading_table_row_base {
-
/**
* Returns a new table object using the attached submission as a constructor.
*
@@ -35,5 +33,4 @@ public function get_assessor_feedback_table() {
return $table;
}
-
}
diff --git a/classes/grading_table_row_single.php b/classes/grading_table_row_single.php
index b5c889e4..adc8d561 100644
--- a/classes/grading_table_row_single.php
+++ b/classes/grading_table_row_single.php
@@ -20,11 +20,9 @@
defined('MOODLE_INTERNAL') || die();
-
/**
* Single row of the grading table for when there is just one marker
*/
class grading_table_row_single extends grading_table_row_base {
-
}
diff --git a/classes/mailer.php b/classes/mailer.php
index 021c05fa..7d9dee85 100644
--- a/classes/mailer.php
+++ b/classes/mailer.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework;
use mod_coursework\models\submission;
use mod_coursework\models\user;
@@ -131,7 +130,6 @@ public function send_late_submission_notification($submission) {
}
}
-
/**
* Send feedback notifications to users whose feedback was released
*
@@ -234,8 +232,6 @@ public function send_student_deadline_reminder($user) {
return message_send($eventdata);
}
-
-
public function send_submission_notification($userstonotify) {
global $CFG;
@@ -271,6 +267,5 @@ public function send_submission_notification($userstonotify) {
message_send($eventdata);
}
-
}
}
diff --git a/classes/models/assessment_set_membership.php b/classes/models/assessment_set_membership.php
index f317953f..d5f179f9 100644
--- a/classes/models/assessment_set_membership.php
+++ b/classes/models/assessment_set_membership.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* This class allows us to add functionality to the users, despite the fact that Moodle has no
* core user class. Initially, it is using the active record approach, but this may need to change to
diff --git a/classes/models/coursework.php b/classes/models/coursework.php
index a36519c4..7bc2e361 100644
--- a/classes/models/coursework.php
+++ b/classes/models/coursework.php
@@ -25,7 +25,6 @@
namespace mod_coursework\models;
-
use coding_exception;
use context_course;
@@ -380,7 +379,6 @@ class coursework extends table_base {
*/
public $extensionsenabled;
-
public $gradeeditingtime;
/**
@@ -388,13 +386,11 @@ class coursework extends table_base {
*/
public $markingdeadlineenabled;
-
/**
* @var int
*/
public $initialmarkingdeadline;
-
/**
* @var int
*/
@@ -461,7 +457,6 @@ public function get_course_module() {
public function cm_object($coursemodule){
-
$modinfo = get_fast_modinfo($this->get_course_id());
return $this->coursemodule = $modinfo->get_cm($coursemodule->id);
@@ -494,7 +489,6 @@ public function get_coursemodule_idnumber() {
return (int)$coursemodule->idnumber;
}
-
/**
* Getter function for the coursework's course object.
*
@@ -658,7 +652,6 @@ public function get_context_id() {
return $this->get_context()->id;
}
-
function get_grade_editing_time() {
return $this->gradeeditingtime;
}
@@ -672,7 +665,6 @@ function get_initial_marking_deadline() {
return (!empty($this->initialmarkingdeadline)) ? $this->initialmarkingdeadline : 0;
}
-
/**
* Returns the initial marking deadline timestamp
*
@@ -869,7 +861,6 @@ public function plagiarism_enbled() {
return false;
}
-
/**
* @return bool
*/
@@ -884,7 +875,6 @@ public function early_finalisation_allowed() {
return !!$this->allowearlyfinalisation;
}
-
/**
* Pushes all grades form the coursework into the gradebook. Will overwrite any older grades.
*
@@ -972,7 +962,6 @@ public function pack_files() {
// If allocations are in use, then we don't supply files that are not allocated.
$submission = submission::find($submission);
-
$files = $fs->get_area_files($context->id, 'mod_coursework', 'submission',
$submission->id, "id", false);
foreach ($files as $f) {
@@ -999,8 +988,6 @@ public function pack_files() {
}
}
-
-
// Create path for new zip file.
$temp_zip = tempnam($CFG->dataroot.'/temp/', 'ocm_');
// Zip files.
@@ -1011,10 +998,6 @@ public function pack_files() {
return false;
}
-
-
-
-
/**
* Makes code cleaner than writing MATHS all over the place!!
* @return bool
@@ -1235,7 +1218,6 @@ public function assessor_has_any_allocation_for_student($allocatable, $userid=fa
return $DB->record_exists('coursework_allocation_pairs', $params);
}
-
/**
* Check if current assessor is not already allocated for this submission in different stage
*
@@ -1261,7 +1243,6 @@ public function assessor_has_allocation_for_student_not_in_current_stage($alloca
return false;
}
-
/**
* Checks whether the current user is an assessor allocated to mark this submission.
*
@@ -1319,7 +1300,6 @@ public function get_submissions_needing_grading(){
}
-
return $needsgrading;
}
@@ -1374,7 +1354,6 @@ public function get_assessor_graded_submissions($assessorid){
return $graded;
}
-
/**
* Get all published submissions in the coursework
*
@@ -1396,7 +1375,6 @@ public function get_published_submissions(){
return $submissions;
}
-
/**
* Returns a hash of this user's id. Not username as this would be non-unique across
* different courseworks, compromising anonymity.
@@ -1419,7 +1397,6 @@ static function get_name_hash($id, $userid, $time=1440000609) {
$uhash = substr(md5($uhash), 0, 8);
$uhash = 'X' . $uhash;
-
return $uhash;
}
@@ -1480,7 +1457,6 @@ public function get_assessor_allocation($allocatable, $stage_identifier) {
return $allocation;
}
-
public function get_assessors_stage_identifier($allocatable_id, $assessor_id){
global $DB;
@@ -1495,7 +1471,6 @@ public function get_assessors_stage_identifier($allocatable_id, $assessor_id){
return $stage_identifier->stage_identifier;
}
-
/**
* Checks settings to see whether the current user (who we assume is a student) can
* view their feedback.
@@ -1824,7 +1799,6 @@ public function build_own_submission($user) {
return submission::build($own_submission_params);
}
-
/**
* Uses the knowledge of the Coursework settings to compose the object which the renderer can deal with.
* This is the messy wiring for the nice, reusable components in the grading report :)
@@ -1842,7 +1816,6 @@ public function renderable_grading_report_factory($report_options) {
'coursework' => $this,
);
-
// Add the cell objects. These are used to generate the table headers and to render each row.
if ($this->is_configured_to_have_group_submissions()) {
$report->add_cell(new group_cell($cell_items));
@@ -2261,7 +2234,6 @@ public function get_submission_notification_users() {
return $this->submissionnotification;
}
-
/**
* Utility method that returns an image icon.
*
@@ -2491,8 +2463,6 @@ public function finalise_all() {
$excludesql .= ')';
}
-
-
$DB->execute("UPDATE {coursework_submissions}
SET finalised = 1
WHERE courseworkid = ? $excludesql", array($this->id));
@@ -2574,12 +2544,6 @@ public function get_coursework_submission_personal_deadlines(){
return $submissions;
}
-
-
-
-
-
-
/**
* Has the given stage got a an automatic sampling rule
*
@@ -2592,8 +2556,6 @@ public function has_automatic_sampling_at_stage($stage) {
return $DB->record_exists('coursework_sample_set_rules',array('courseworkid' => $this->id, 'stage_identifier' => $stage));
}
-
-
/**
* Returns all allocatables in the current coursework that have feedback
*
@@ -2609,8 +2571,6 @@ public function get_allocatables_with_feedback($stage, $random = false) {
AND cwrsub.courseworkid = :coursework_id
AND stage_identifier = :stage";
-
-
if ($random) {
$sql .= ($CFG->dbtype == 'pgsql') ? " ORDER BY RANDOM() " : " ORDER BY RAND() ";
}
@@ -2620,7 +2580,6 @@ public function get_allocatables_with_feedback($stage, $random = false) {
}
-
/*
* Creates automatic feedback
*
@@ -2672,10 +2631,8 @@ public function create_automatic_feedback() {
unset($SESSION->keep_cache_data);
feedback::remove_cache($this->id);
-
}
-
/** Function to check it Turnitin is enabled for the particular coursework
* @return bool
* @throws \dml_exception
@@ -2703,11 +2660,6 @@ public function tii_enabled(){
return self::$pool[$this->id]['tii_enabled'][$this->id];
}
-
-
-
-
-
/**
* Lets us know if personal deadlines are enabled in the coursework.
* @return bool
@@ -2716,7 +2668,6 @@ public function personal_deadlines_enabled(){
return (bool)$this->personaldeadlineenabled;
}
-
/**
* Lets us know if draft feedback is enabled in the coursework.
* @return bool
@@ -2725,7 +2676,6 @@ public function draft_feedback_enabled(){
return (bool)$this->draftfeedbackenabled;
}
-
/**
* Return all allocatables and the allocatables deadline
* Note! allocatables are returned irrespective of whether they have submitted.
@@ -2806,7 +2756,6 @@ public function can_grade(){
return false;
}
-
/**
* @return bool
*/
@@ -2944,7 +2893,6 @@ public function remove_deadline_extensions_by_coursework(){
$DB->execute('DELETE FROM {coursework_extensions} WHERE allocatabletype = ? AND courseworkid = ? ', array('user', $this->id));
}
-
/**
* Function to check if Coursework has any final feedback
*
@@ -2978,7 +2926,6 @@ public function get_allocatable_deadline($allocatableid) {
$allocatable = user::find($allocatableid);
}
-
if ($this->personal_deadlines_enabled()){
// find personal deadline for a user if this option enabled
$personal = $this->get_allocatable_personal_deadline($allocatable);
@@ -3008,7 +2955,6 @@ private function get_allocatable_extension($allocatable) {
global $DB;
$extension = false;
-
if ($this->extensions_enabled() ) {
$extensionrecord = $DB->get_record('coursework_extensions', array('courseworkid' => $this->id, 'allocatableid' => $allocatable->id));
@@ -3020,7 +2966,6 @@ private function get_allocatable_extension($allocatable) {
return $extension;
}
-
/**
* Function to Remove all plagiarisms by a submission
*
@@ -3032,7 +2977,6 @@ public function remove_plagiarisms_by_submission($submission_id) {
$DB->delete_records('coursework_plagiarism_flags', ['submissionid' => $submission_id]);
}
-
/**
* Function to check if Coursework has any submission
*
@@ -3049,7 +2993,6 @@ public function has_any_submission(){
return $DB->record_exists_sql($sql, array('courseworkid' => $this->id));
}
-
/**
* Function to check if coursework or course that a coursework belongs to is hidden
*
@@ -3079,7 +3022,6 @@ public function clear_stage($stage_index = null) {
}
}
-
/**
* cache array
*
diff --git a/classes/models/deadline_extension.php b/classes/models/deadline_extension.php
index bae838f4..1d10e361 100644
--- a/classes/models/deadline_extension.php
+++ b/classes/models/deadline_extension.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\models;
use mod_coursework\framework\table_base;
diff --git a/classes/models/feedback.php b/classes/models/feedback.php
index 24a3b765..7938d812 100644
--- a/classes/models/feedback.php
+++ b/classes/models/feedback.php
@@ -200,7 +200,6 @@ public function display_assessor_name(){
return $assessor_name;
}
-
/**
* Real name for display. Allows us to defer the DB call to retrieve first and last name
* in case we don't need it.
@@ -267,7 +266,6 @@ public function get_coursemodule_id() {
return $this->get_submission()->get_course_module_id();
}
-
/**
* Returns a feedback instance
* @todo get rid of this.
@@ -346,8 +344,6 @@ public function get_feedback_files() {
return false;
}
-
-
/**
* @return mixed
*/
@@ -439,7 +435,6 @@ public function get_context() {
return $this->get_coursework()->get_context();
}
-
/**
* Is this feedback one of the component grades in a multiple marking scenario?
*
diff --git a/classes/models/group.php b/classes/models/group.php
index 1fec42df..2a639a6d 100644
--- a/classes/models/group.php
+++ b/classes/models/group.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* This class allows us to add functionality to the users, despite the fact that Moodle has no
* core user class. Initially, it is using the active record approach, but this may need to change to
diff --git a/classes/models/moderation.php b/classes/models/moderation.php
index 5e73decd..315a4862 100644
--- a/classes/models/moderation.php
+++ b/classes/models/moderation.php
@@ -34,7 +34,6 @@
*/
class moderation extends table_base{
-
/**
* @var int
*/
@@ -45,7 +44,6 @@ class moderation extends table_base{
*/
public $feedbackid;
-
/**
* @var int
*/
@@ -76,7 +74,6 @@ class moderation extends table_base{
*/
public $modcommentformat;
-
/**
* Chained getter for loose coupling.
*
@@ -86,7 +83,6 @@ public function get_coursework() {
return $this->get_submission()->get_coursework();
}
-
/**
*
*/
@@ -103,10 +99,8 @@ public function get_feedback(){
public function get_agreement(){
return $this->agreement;
-
}
-
/**
* Memoized getter
*
@@ -119,8 +113,6 @@ public function get_submission() {
return $this->submission;
}
-
-
/**
* @return user
*/
@@ -145,7 +137,6 @@ public function get_moderator_id(){
return $this->moderator->id;
}
-
/**
* Check if assessor is allocated to the user in this stage
* @return bool
diff --git a/classes/models/moderation_set_rule.php b/classes/models/moderation_set_rule.php
index 3a6b8b06..11d44550 100644
--- a/classes/models/moderation_set_rule.php
+++ b/classes/models/moderation_set_rule.php
@@ -40,7 +40,6 @@
defined('MOODLE_INTERNAL') || die();
-
/**
* Forms a base for the moderation set rules, which determine various sets of students which
* need to be included in the set e.g. lowest 40%.
@@ -100,7 +99,6 @@ abstract class moderation_set_rule extends table_base implements renderable {
'minimum'
);
-
/**
* @param bool|int|stdClass $dbrecord
*/
diff --git a/classes/models/null_feedback.php b/classes/models/null_feedback.php
index 09c3e6f9..f63faf74 100644
--- a/classes/models/null_feedback.php
+++ b/classes/models/null_feedback.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\models;
/**
diff --git a/classes/models/null_user.php b/classes/models/null_user.php
index 8c292ffb..bb537f6c 100644
--- a/classes/models/null_user.php
+++ b/classes/models/null_user.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\models;
/**
@@ -88,7 +87,6 @@ public function get_initial_feedbacks($coursework) {
return array();
}
-
/**
* @param coursework $coursework
* @return bool
@@ -97,7 +95,6 @@ public function has_all_initial_feedbacks($coursework) {
return false;
}
-
/**
* @param coursework $coursework
* @return bool
@@ -106,7 +103,6 @@ public function get_agreed_feedback($coursework){
return false;
}
-
/**
* @param coursework $coursework
* @return submission
diff --git a/classes/models/outstanding_marking.php b/classes/models/outstanding_marking.php
index 43b9bb87..9948370a 100644
--- a/classes/models/outstanding_marking.php
+++ b/classes/models/outstanding_marking.php
@@ -26,13 +26,11 @@ class outstanding_marking {
private $day_in_secs;
-
public function __construct() {
$this->day_in_secs = 86400;
}
-
/**
* @param $cwkrecord
* @param $userid
@@ -62,7 +60,6 @@ public function get_to_grade_initial_count($cwkrecord, $userid){
return (!empty($initialsubmissions)) ? count($initialsubmissions) : 0 ;
}
-
/**
* @param $cwkrecord
* @param $userid
@@ -87,7 +84,6 @@ public function get_to_grade_agreed_count($cwkrecord, $userid) {
return (!empty($agreedsubmissions)) ? count($agreedsubmissions) : 0;
}
-
/**
* @param $courseworkid
* @param bool $userid
@@ -131,7 +127,6 @@ private function get_single_marker_initial_grade_submissions_to_mark($coursework
return $DB->get_records_sql($sql, $sqlparams);
}
-
/**
* @param $courseworkid
* @param $userid
@@ -167,11 +162,9 @@ private function get_multiple_to_mark_sampled_initial_grade_submissions($coursew
$sqlparams['subcourseworkid'] = $courseworkid;
$sqlparams['courseworkid'] = $courseworkid;
-
return $DB->get_records_sql($sql, $sqlparams);
}
-
/**
* @param $courseworkid
* @param $userid
@@ -200,7 +193,6 @@ private function get_multiple_to_mark_initial_grade_submissions($courseworkid, $
$sqlparams['assessorid2'] = $userid;
}
-
$sql = "SELECT cs.id AS submissionid, COUNT(f.id) AS count_feedback
FROM {coursework_submissions} cs LEFT JOIN
{coursework_feedbacks} f ON cs.id = f.submissionid
@@ -216,18 +208,15 @@ private function get_multiple_to_mark_initial_grade_submissions($courseworkid, $
GROUP BY cs.id, f.id
HAVING (COUNT(f.id) < :numofmarkers)";
-
$sqlparams['subassessorid'] = $userid;
$sqlparams['subcourseworkid'] = $courseworkid;
$sqlparams['courseworkid'] = $courseworkid;
$sqlparams['numofmarkers'] = $numberofmarkers;
$sqlparams['assessorid'] = $userid;
-
return $DB->get_records_sql($sql, $sqlparams);
}
-
/**
* @param $courseworkid
* @param $numberofmarkers
@@ -246,15 +235,12 @@ private function get_to_grade_agreed_grade_submissions($courseworkid, $numberofm
GROUP BY cs.id
HAVING (COUNT(cs.id) = :numofmarkers)";
-
$sqlparams['numofmarkers'] = $numberofmarkers;
$sqlparams['courseworkid'] = $courseworkid;
-
return $DB->get_records_sql($sql, $sqlparams);
}
-
/**
* @param $courseworkid
* @return array
@@ -284,7 +270,6 @@ private function get_to_grade_agreed_grade_sampled_submissions($courseworkid) {
return $DB->get_records_sql($sql, $sqlparams);
}
-
/**
* @param $course_id
* @param $user_id
@@ -297,7 +282,6 @@ private function has_agreed_grade($course_id, $user_id) {
return has_capability('mod/coursework:addagreedgrade', $coursecontext, $user_id) || has_capability('mod/coursework:addallocatedagreedgrade', $coursecontext, $user_id);
}
-
/**
* @param $course_id
* @param $user_id
@@ -310,7 +294,6 @@ private function has_initial_grade($course_id, $user_id) {
return has_capability('mod/coursework:addinitialgrade', $coursecontext, $user_id);
}
-
/**
* @param $courseworkid
* @param $userid
diff --git a/classes/models/personal_deadline.php b/classes/models/personal_deadline.php
index 5fb970ea..59a6b8ff 100644
--- a/classes/models/personal_deadline.php
+++ b/classes/models/personal_deadline.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\models;
use mod_coursework\framework\table_base;
@@ -97,7 +96,6 @@ public static function get_personal_deadline_for_student($student, $coursework)
}
}
-
/**
* cache array
*
diff --git a/classes/models/plagiarism_flag.php b/classes/models/plagiarism_flag.php
index 33209032..1ff1850d 100644
--- a/classes/models/plagiarism_flag.php
+++ b/classes/models/plagiarism_flag.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\models;
use mod_coursework\framework\table_base;
@@ -92,7 +91,6 @@ public static function get_plagiarism_flag($submission) {
return $result;
}
-
/**
* @return bool
*/
@@ -168,5 +166,4 @@ protected function after_destroy() {
self::remove_cache($this->courseworkid);
}
-
}
diff --git a/classes/models/reminder.php b/classes/models/reminder.php
index bda8b692..c15c74ab 100644
--- a/classes/models/reminder.php
+++ b/classes/models/reminder.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\models;
use mod_coursework\framework\table_base;
diff --git a/classes/models/sample_set_rule.php b/classes/models/sample_set_rule.php
index 60905a4f..9933104b 100644
--- a/classes/models/sample_set_rule.php
+++ b/classes/models/sample_set_rule.php
@@ -40,7 +40,6 @@
defined('MOODLE_INTERNAL') || die();
-
/**
* Forms a base for the moderation set rules, which determine various sets of students which
* need to be included in the set e.g. lowest 40%.
@@ -100,7 +99,6 @@ abstract class sample_set_rule extends table_base implements renderable {
'minimum'
);
-
/**
* @param bool|int|stdClass $dbrecord
*/
diff --git a/classes/models/submission.php b/classes/models/submission.php
index 49cc02c0..4cb20ce9 100644
--- a/classes/models/submission.php
+++ b/classes/models/submission.php
@@ -347,7 +347,6 @@ public function submit_plagiarism($type = null) {
$files = $fs->get_area_files($this->get_context_id(), 'mod_coursework', 'submission',
$this->id, "id", false);
-
$params = array(
'context' => \context_module::instance($this->get_coursework()->get_course_module()->id),
'courseid' => $this->get_course_id(),
@@ -360,7 +359,6 @@ public function submit_plagiarism($type = null) {
)
);
-
$event = \mod_coursework\event\assessable_uploaded::create($params);
//$event->set_legacy_files($files);
$event->trigger();
@@ -505,7 +503,6 @@ public function get_assessor_allocation_by_stage($stage_identifier) {
}
-
/**
* @return mixed|feedback|string
* @throws \dml_missing_record_exception
@@ -608,8 +605,6 @@ public function get_state() {
$hasfinalfeedback = (bool)$this->get_final_feedback();
$maxfeedbacksreached = count($assessor_feedbacks) >= $this->max_number_of_feedbacks();
-
-
if ($hasfinalfeedback) {
return self::FINAL_GRADED;
}
@@ -759,7 +754,6 @@ public function user_has_submitted_feedback($userid = 0) {
return false;
}
-
/*
* As with the author id field this function was created to verify that coursework will work correctly with Turnitin
* Plagiarism plugin that requires the author of a submission to
@@ -905,8 +899,6 @@ public function already_published() {
return $this->get_state() >= submission::PUBLISHED;
}
-
-
/**
* @return bool
*/
@@ -918,7 +910,6 @@ public function is_finalised() {
return $this->get_state() == submission::FINALISED;
}
-
/**
* @return bool
*/
@@ -1230,7 +1221,6 @@ public function get_submissions_in_sample() {
return $records;
}
-
/**
* Function to get samplings for the submission
* @return array
@@ -1247,7 +1237,6 @@ public function get_submissions_in_sample_by_stage($stage_identifier) {
return $record;
}
-
/**
* Check if submission has an extension
*
@@ -1293,8 +1282,6 @@ public function submission_personal_deadline(){
}
-
-
/**
* Check if submission was submitted within the extension time
*
@@ -1329,9 +1316,6 @@ public function is_assessor_initial_grader() {
return false;
}
-
-
-
/**
* Tells us whether any initial feedbacks for this submission are editable
* This is only for double marked courseworks
@@ -1362,7 +1346,6 @@ public function editable_feedbacks_exist() {
return (empty($editablefeedbacks)) ? false : $editablefeedbacks;
}
-
/**
* Tells us whether any final feedback for this submission is editable
*
@@ -1461,7 +1444,6 @@ function has_valid_extension(){
return $valid_extension;
}
-
function can_be_unfinalised() {
return ($this->get_state() == submission::FINALISED);
}
diff --git a/classes/models/user.php b/classes/models/user.php
index 3e1ae278..c1a40e83 100644
--- a/classes/models/user.php
+++ b/classes/models/user.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* This class allows us to add functionality to the users, despite the fact that Moodle has no
* core user class. Initially, it is using the active record approach, but this may need to change to
@@ -132,7 +131,6 @@ public function __toString() {
return $this->id;
}
-
/**
* cache array
*
@@ -211,5 +209,4 @@ public static function get_object($id) {
return self::$pool['id'][$id];
}
-
}
diff --git a/classes/moderation_set_rule/minimum_range_grade_percent.php b/classes/moderation_set_rule/minimum_range_grade_percent.php
index 174db463..888b48b3 100644
--- a/classes/moderation_set_rule/minimum_range_grade_percent.php
+++ b/classes/moderation_set_rule/minimum_range_grade_percent.php
@@ -31,7 +31,6 @@
defined('MOODLE_INTERNAL') || die();
-
/**
* Defines a rule that will include all students above or below a particular percentage of
* the total grade.
@@ -57,7 +56,6 @@ public function adjust_set(array &$moderation_set, array &$potential_allocatable
// Convert percentages to raw grades for comparison.
global $DB;
-
$params = array('id' => $this->courseworkid);
$maxgrade = $DB->get_field('coursework', 'grade', $params);
// Convert percentages to raw grades for comparison.
@@ -173,5 +171,4 @@ protected function grade_is_above_lower_limit($grade, $lowerlimit) {
return $grade >= $lowerlimit;
}
-
}
diff --git a/classes/moderation_set_rule/minimum_range_grade_raw.php b/classes/moderation_set_rule/minimum_range_grade_raw.php
index 0e5d8828..76985030 100644
--- a/classes/moderation_set_rule/minimum_range_grade_raw.php
+++ b/classes/moderation_set_rule/minimum_range_grade_raw.php
@@ -30,8 +30,6 @@
defined('MOODLE_INTERNAL') || die();
-
-
/**
* Defines a rule that will include all students above or below a particular percentage of
* the total grade.
diff --git a/classes/moderation_set_rule/range_grade_percent.php b/classes/moderation_set_rule/range_grade_percent.php
index 6c36ff95..25cfff42 100644
--- a/classes/moderation_set_rule/range_grade_percent.php
+++ b/classes/moderation_set_rule/range_grade_percent.php
@@ -31,7 +31,6 @@
defined('MOODLE_INTERNAL') || die();
-
/**
* Defines a rule that will include all students above or below a particular percentage of
* the total grade.
diff --git a/classes/moderation_set_rule/range_grade_raw.php b/classes/moderation_set_rule/range_grade_raw.php
index 9d08d0bf..7e4502cf 100644
--- a/classes/moderation_set_rule/range_grade_raw.php
+++ b/classes/moderation_set_rule/range_grade_raw.php
@@ -31,7 +31,6 @@
defined('MOODLE_INTERNAL') || die();
-
/**
* Defines a rule that will include all students between to raw grade marks.
*/
@@ -127,5 +126,4 @@ public function get_form_elements() {
return $html;
}
-
}
diff --git a/classes/moderation_set_rule/range_total_percent.php b/classes/moderation_set_rule/range_total_percent.php
index 85931376..825ed812 100644
--- a/classes/moderation_set_rule/range_total_percent.php
+++ b/classes/moderation_set_rule/range_total_percent.php
@@ -32,7 +32,6 @@
defined('MOODLE_INTERNAL') || die();
-
/**
* Defines a rule that will include all students between an upper and lower percentage of the total
* number. Only really makes sense with lowerlimit as 0.
diff --git a/classes/observer.php b/classes/observer.php
index 1580713e..56877e9d 100644
--- a/classes/observer.php
+++ b/classes/observer.php
@@ -22,15 +22,11 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
-
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot.'/mod/coursework/lib.php');
class mod_coursework_observer {
-
-
public static function autoallocate_when_user_added(core\event\role_assigned $event){
coursework_role_assigned_event_handler($event);
@@ -55,8 +51,6 @@ public static function process_allocation_after_update(core\event\course_module_
}
-
-
public static function process_allocation_after_creation(core\event\course_module_created $event){
coursework_mod_updated($event);
@@ -94,5 +88,4 @@ public static function remove_teacher_from_dropdown_when_unenrolled(core\event\r
}
-
}
diff --git a/classes/personal_deadline/allocatable.php b/classes/personal_deadline/allocatable.php
index 41d84f36..b1e0441f 100644
--- a/classes/personal_deadline/allocatable.php
+++ b/classes/personal_deadline/allocatable.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\personal_deadline;
use mod_coursework\models\coursework;
use mod_coursework\models\feedback;
diff --git a/classes/personal_deadline/table/builder.php b/classes/personal_deadline/table/builder.php
index 1cba2d41..8e783c2a 100644
--- a/classes/personal_deadline/table/builder.php
+++ b/classes/personal_deadline/table/builder.php
@@ -63,7 +63,6 @@ public function __construct($coursework, array $options) {
$this->options = $options;
}
-
/**
* Takes the raw data, instantiates each row as a new renderable object and returns the whole lot.
*
@@ -86,7 +85,6 @@ public function get_rows() {
$method_name));
}
-
return $rows;
}
@@ -123,7 +121,6 @@ public function get_allocatable_cell() {
return new user_cell($items);
}
-
/**
* @return personal_deadline_cell
*/
diff --git a/classes/personal_deadline/table/row/builder.php b/classes/personal_deadline/table/row/builder.php
index 2daebff3..c4439f7a 100644
--- a/classes/personal_deadline/table/row/builder.php
+++ b/classes/personal_deadline/table/row/builder.php
@@ -59,7 +59,6 @@ public function __construct($personal_deadline_table, $allocatable) {
$this->allocatable = $allocatable;
}
-
/**
* @return allocatable
*/
@@ -156,7 +155,6 @@ public function get_idnumber() {
return $this->get_allocatable()->idnumber;
}
-
/**
* @return string
*/
@@ -199,7 +197,6 @@ public function get_personal_deadlines() {
return $personal_deadline;
}
-
public function get_submission_status() {
global $DB;
diff --git a/classes/plagiarism_helpers/base.php b/classes/plagiarism_helpers/base.php
index 717024db..60c2ce80 100644
--- a/classes/plagiarism_helpers/base.php
+++ b/classes/plagiarism_helpers/base.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\plagiarism_helpers;
use mod_coursework\models\coursework;
diff --git a/classes/plagiarism_helpers/turnitin.php b/classes/plagiarism_helpers/turnitin.php
index 0f75653a..ec2c23b8 100644
--- a/classes/plagiarism_helpers/turnitin.php
+++ b/classes/plagiarism_helpers/turnitin.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\plagiarism_helpers;
/**
diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php
index 33a375f0..33cdc707 100644
--- a/classes/privacy/provider.php
+++ b/classes/privacy/provider.php
@@ -167,7 +167,6 @@ public static function get_users_in_context(userlist $userlist) {
WHERE ctx.id = :contextid AND ctx.contextlevel = :contextlevel";
$userlist->add_from_sql('createdby', $sql, $params);
-
}
/**
* Returns all of the contexts that has information relating to the userid.
diff --git a/classes/render_helpers/grading_report/base_renderer.php b/classes/render_helpers/grading_report/base_renderer.php
index b0e44a5e..bce70543 100644
--- a/classes/render_helpers/grading_report/base_renderer.php
+++ b/classes/render_helpers/grading_report/base_renderer.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report;
/**
diff --git a/classes/render_helpers/grading_report/cells/_user_cell.php b/classes/render_helpers/grading_report/cells/_user_cell.php
index 7d723151..f928dd5f 100644
--- a/classes/render_helpers/grading_report/cells/_user_cell.php
+++ b/classes/render_helpers/grading_report/cells/_user_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
use core_user;
use html_table_cell;
diff --git a/classes/render_helpers/grading_report/cells/allocatable_cell.php b/classes/render_helpers/grading_report/cells/allocatable_cell.php
index d62f0515..2e801f75 100644
--- a/classes/render_helpers/grading_report/cells/allocatable_cell.php
+++ b/classes/render_helpers/grading_report/cells/allocatable_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
/**
diff --git a/classes/render_helpers/grading_report/cells/cell_base.php b/classes/render_helpers/grading_report/cells/cell_base.php
index 7c9c97d8..1a74f723 100644
--- a/classes/render_helpers/grading_report/cells/cell_base.php
+++ b/classes/render_helpers/grading_report/cells/cell_base.php
@@ -20,10 +20,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
-
use html_writer;
use mod_coursework\models\coursework;
use mod_coursework\router;
@@ -74,8 +72,6 @@ protected function helper_sortable_heading($display_name, $field, $sort_how, $so
$params[$tablename.'sorthow'] = 'ASC';
}
-
-
// $url = clone($PAGE->url);
// $url->params($params);
@@ -150,5 +146,4 @@ public function get_table_header_help_icon(){
}
-
}
diff --git a/classes/render_helpers/grading_report/cells/cell_interface.php b/classes/render_helpers/grading_report/cells/cell_interface.php
index 53409676..234589ec 100644
--- a/classes/render_helpers/grading_report/cells/cell_interface.php
+++ b/classes/render_helpers/grading_report/cells/cell_interface.php
@@ -20,10 +20,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
-
use html_table_cell;
use mod_coursework\grading_table_row_base;
use mod_coursework\user_row;
@@ -45,7 +43,6 @@ public function get_table_cell($rowobject);
*/
public function get_table_header($options = array());
-
/**
* @return string
*/
diff --git a/classes/render_helpers/grading_report/cells/email_cell.php b/classes/render_helpers/grading_report/cells/email_cell.php
index 9e8855f8..85ef93e4 100644
--- a/classes/render_helpers/grading_report/cells/email_cell.php
+++ b/classes/render_helpers/grading_report/cells/email_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
use core_user;
use html_table_cell;
diff --git a/classes/render_helpers/grading_report/cells/first_name_cell.php b/classes/render_helpers/grading_report/cells/first_name_cell.php
index d9c08586..6751d6a2 100644
--- a/classes/render_helpers/grading_report/cells/first_name_cell.php
+++ b/classes/render_helpers/grading_report/cells/first_name_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
use core_user;
use html_table_cell;
diff --git a/classes/render_helpers/grading_report/cells/first_name_letter_cell.php b/classes/render_helpers/grading_report/cells/first_name_letter_cell.php
index 3ef4e218..a6d0db1c 100644
--- a/classes/render_helpers/grading_report/cells/first_name_letter_cell.php
+++ b/classes/render_helpers/grading_report/cells/first_name_letter_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
use core_user;
use html_table_cell;
diff --git a/classes/render_helpers/grading_report/cells/grade_for_gradebook_cell.php b/classes/render_helpers/grading_report/cells/grade_for_gradebook_cell.php
index 6e3aaaf6..d6535f49 100644
--- a/classes/render_helpers/grading_report/cells/grade_for_gradebook_cell.php
+++ b/classes/render_helpers/grading_report/cells/grade_for_gradebook_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
use coding_exception;
use html_table_cell;
diff --git a/classes/render_helpers/grading_report/cells/group_cell.php b/classes/render_helpers/grading_report/cells/group_cell.php
index fc9e9464..c76138e9 100644
--- a/classes/render_helpers/grading_report/cells/group_cell.php
+++ b/classes/render_helpers/grading_report/cells/group_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
use coding_exception;
use html_table_cell;
@@ -49,7 +48,6 @@ public function get_table_cell($row_object) {
$content .= '
';
$content .= '';
-
if ($this->coursework->blindmarking_enabled() && !has_capability('mod/coursework:viewanonymous', $this->coursework->get_context()) && !$row_object->is_published()){
$content .= ''.get_string('membershidden','coursework').' ';
} else{
diff --git a/classes/render_helpers/grading_report/cells/idnumber_cell.php b/classes/render_helpers/grading_report/cells/idnumber_cell.php
index 78743b16..9c8a9269 100644
--- a/classes/render_helpers/grading_report/cells/idnumber_cell.php
+++ b/classes/render_helpers/grading_report/cells/idnumber_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
use mod_coursework\models\user;
use mod_coursework\user_row;
diff --git a/classes/render_helpers/grading_report/cells/last_name_cell.php b/classes/render_helpers/grading_report/cells/last_name_cell.php
index 65b5f0d4..99bbf5cd 100644
--- a/classes/render_helpers/grading_report/cells/last_name_cell.php
+++ b/classes/render_helpers/grading_report/cells/last_name_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
use core_user;
use html_table_cell;
diff --git a/classes/render_helpers/grading_report/cells/last_name_letter_cell.php b/classes/render_helpers/grading_report/cells/last_name_letter_cell.php
index 7b7770d2..13dc6b63 100644
--- a/classes/render_helpers/grading_report/cells/last_name_letter_cell.php
+++ b/classes/render_helpers/grading_report/cells/last_name_letter_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
use core_user;
use html_table_cell;
diff --git a/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php b/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php
index 24504efa..e9101150 100644
--- a/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php
+++ b/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
use coding_exception;
use html_table_cell;
@@ -38,7 +37,6 @@
*/
class moderation_agreement_cell extends cell_base {
-
/**
* @var allocatable
*/
@@ -49,8 +47,6 @@ class moderation_agreement_cell extends cell_base {
*/
private $stage;
-
-
/**
* @param array $items
*/
@@ -58,8 +54,6 @@ protected function after_initialisation($items) {
$this->stage = $items['stage'];
}
-
-
/**
* @param grading_table_row_base $rowobject
* @return string
@@ -80,7 +74,6 @@ public function get_table_cell($rowobject) {
$rowobject->get_submission()->final_grade_agreed() &&
($this->stage->user_is_moderator($USER))) {
-
$moderation_params = array(
'submissionid' => $rowobject->get_submission()->id,
'moderatorid' => $USER->id,
@@ -158,7 +151,6 @@ public function get_table_header_help_icon(){
return ($OUTPUT->help_icon('moderationagreement', 'coursework'));
}
-
/**
* @param grading_table_row_base $rowobject
* @param user $assessor
@@ -189,7 +181,6 @@ private function new_moderation_button($rowobject, $assessor) {
array('class' => 'new_moderation','id' => $link_id));
}
-
/**
* @param $rowobject
* @return array
@@ -210,7 +201,6 @@ private function edit_moderation_button($rowobject) {
$title = get_string('editmoderation', 'coursework');
$icon = new pix_icon('edit', $title, 'coursework');
-
return $OUTPUT->action_icon($link,
$icon,
null,
diff --git a/classes/render_helpers/grading_report/cells/moderation_cell.php b/classes/render_helpers/grading_report/cells/moderation_cell.php
index 1ae0331a..d7bb6843 100644
--- a/classes/render_helpers/grading_report/cells/moderation_cell.php
+++ b/classes/render_helpers/grading_report/cells/moderation_cell.php
@@ -20,10 +20,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
-
use coding_exception;
use html_table_cell;
use mod_coursework\ability;
diff --git a/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php b/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
index 661db2be..c0466931 100644
--- a/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
+++ b/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
@@ -20,10 +20,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
-
use html_writer;
use mod_coursework\ability;
use mod_coursework\grade_judge;
@@ -67,7 +65,6 @@ public function get_content($rowobject) {
global $USER, $OUTPUT;
-
//if coursework uses sampling check if any enabled for this submission, otherwise there is no agreed grade
if ($rowobject->get_coursework()->sampling_enabled() && $rowobject->get_submission() && !$rowobject->get_submission()->sampled_feedback_exists()){
$content = get_string('singlemarker', 'coursework');
@@ -116,7 +113,6 @@ public function get_content($rowobject) {
);
$new_feedback = feedback::build($feedback_params);
-
//if the user is a site admin then they can add final feedback
if ($ability->can('new', $new_feedback) || is_siteadmin()) {
$title = get_string('addfinalfeedback', 'coursework');
@@ -187,7 +183,6 @@ public function get_table_header_class(){
return 'agreedgrade';
}
-
/**
* @return string
*/
diff --git a/classes/render_helpers/grading_report/cells/personal_deadline_cell.php b/classes/render_helpers/grading_report/cells/personal_deadline_cell.php
index d2bcb167..40e20663 100644
--- a/classes/render_helpers/grading_report/cells/personal_deadline_cell.php
+++ b/classes/render_helpers/grading_report/cells/personal_deadline_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
use coding_exception;
use mod_coursework\ability;
diff --git a/classes/render_helpers/grading_report/cells/plagiarism_cell.php b/classes/render_helpers/grading_report/cells/plagiarism_cell.php
index aca3e7e2..1a694a9a 100644
--- a/classes/render_helpers/grading_report/cells/plagiarism_cell.php
+++ b/classes/render_helpers/grading_report/cells/plagiarism_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
use coding_exception;
use html_table_cell;
diff --git a/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php b/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php
index 46e249df..7d5d69eb 100644
--- a/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php
+++ b/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
use coding_exception;
use html_writer;
@@ -101,7 +100,6 @@ public function header_group() {
return 'submission';
}
-
/**
* @param grading_table_row_base $rowobject
* @param $row_object
@@ -126,7 +124,6 @@ private function new_flag_plagiarism_button($row_object) {
return $OUTPUT->action_link($link, $title, null, $html_attributes);
}
-
/**
* @param grading_table_row_base $rowobject
* @param $row_object
diff --git a/classes/render_helpers/grading_report/cells/single_assessor_feedback_cell.php b/classes/render_helpers/grading_report/cells/single_assessor_feedback_cell.php
index 1840154a..ec62d7d5 100644
--- a/classes/render_helpers/grading_report/cells/single_assessor_feedback_cell.php
+++ b/classes/render_helpers/grading_report/cells/single_assessor_feedback_cell.php
@@ -20,10 +20,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
-
use coding_exception;
use html_table_cell;
use html_writer;
@@ -180,7 +178,6 @@ private function edit_feedback_button($rowobject) {
$title = get_string('editfinalgrade', 'coursework');
$icon = new pix_icon('edit', $title, 'coursework');
-
return $OUTPUT->action_icon($link,
$icon,
null,
@@ -206,11 +203,9 @@ private function show_feedback_button($rowobject) {
null,
array('class' => 'show_feedback','id' => $link_id));
-
return $iconlink;
}
-
/**
* @param grading_table_row_base $rowobject
* @param user $assessor
diff --git a/classes/render_helpers/grading_report/cells/status_cell.php b/classes/render_helpers/grading_report/cells/status_cell.php
index 9279ff98..9a0a0536 100644
--- a/classes/render_helpers/grading_report/cells/status_cell.php
+++ b/classes/render_helpers/grading_report/cells/status_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
use html_table_cell;
use mod_coursework\grading_table_row_base;
diff --git a/classes/render_helpers/grading_report/cells/submission_cell.php b/classes/render_helpers/grading_report/cells/submission_cell.php
index 01bc85c1..27742bfb 100644
--- a/classes/render_helpers/grading_report/cells/submission_cell.php
+++ b/classes/render_helpers/grading_report/cells/submission_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
use coding_exception;
use html_writer;
@@ -80,7 +79,6 @@ public function get_table_cell($rowobject) {
'createdby' => $USER->id,
));
-
if (($rowobject->get_submission()&& !$rowobject->get_submission()->finalised)
|| !$rowobject->get_submission()) {
diff --git a/classes/render_helpers/grading_report/cells/time_submitted_cell.php b/classes/render_helpers/grading_report/cells/time_submitted_cell.php
index cf84cfc5..dd4d8e41 100644
--- a/classes/render_helpers/grading_report/cells/time_submitted_cell.php
+++ b/classes/render_helpers/grading_report/cells/time_submitted_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
use coding_exception;
use core_user;
@@ -135,7 +134,6 @@ public function prepare_content_cell($row_object) {
$displayeddeadline = $extension->extended_deadline;
}
-
if ($extension->id) {
$new_extension_params['id'] = $extension->id;
}
@@ -168,7 +166,6 @@ public function prepare_content_cell($row_object) {
array('class' => 'edit_deadline_extension', 'data-name' => $row_object->get_allocatable()->name(), 'data-params' => json_encode($new_extension_params), 'data-time' => json_encode($content_time)));
}
-
$content .= '
';
return ['display' => $content, '@data-order' => $this->standardize_time_for_compare($time_submitted) . '|' . $this->standardize_time_for_compare($displayeddeadline)];
diff --git a/classes/render_helpers/grading_report/cells/user_cell.php b/classes/render_helpers/grading_report/cells/user_cell.php
index dfb8d0d3..783079f3 100644
--- a/classes/render_helpers/grading_report/cells/user_cell.php
+++ b/classes/render_helpers/grading_report/cells/user_cell.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\cells;
use core_user;
use html_table_cell;
diff --git a/classes/render_helpers/grading_report/component_factory_interface.php b/classes/render_helpers/grading_report/component_factory_interface.php
index d9e9618d..4962fe9b 100644
--- a/classes/render_helpers/grading_report/component_factory_interface.php
+++ b/classes/render_helpers/grading_report/component_factory_interface.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report;
/**
@@ -32,7 +31,6 @@
*/
interface component_factory_interface {
-
public function get_cells();
public function get_sub_rows();
diff --git a/classes/render_helpers/grading_report/multi_renderer.php b/classes/render_helpers/grading_report/multi_renderer.php
index 6ef00021..3e086a8a 100644
--- a/classes/render_helpers/grading_report/multi_renderer.php
+++ b/classes/render_helpers/grading_report/multi_renderer.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report;
/**
diff --git a/classes/render_helpers/grading_report/single_renderer.php b/classes/render_helpers/grading_report/single_renderer.php
index 3666e391..14f94766 100644
--- a/classes/render_helpers/grading_report/single_renderer.php
+++ b/classes/render_helpers/grading_report/single_renderer.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report;
/**
diff --git a/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php b/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php
index d5bb812d..d23ec9d5 100644
--- a/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php
+++ b/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\sub_rows;
use html_table_row;
@@ -105,7 +104,6 @@ protected function render_assessor_feedback_table(assessor_feedback_table $asses
$ability = new ability(user::find($USER, false), $coursework);
$feedbackrows = $assessor_feedback_table->get_renderable_feedback_rows();
-
$allocatable = $assessor_feedback_table->get_allocatable();
$output_rows = '';
@@ -126,7 +124,6 @@ protected function render_assessor_feedback_table(assessor_feedback_table $asses
continue;
}*/
-
$output_rows .= '
';
if ($coursework->sampling_enabled() && $stage->uses_sampling() && !$stage->allocatable_is_in_sample($allocatable)) {
@@ -353,7 +350,6 @@ protected function comment_for_row($feedback_row, $ability) {
$grade_editing = get_config('mod_coursework','coursework_grade_editing');
-
if ($ability->can('edit', $feedback_row->get_feedback()) && !$submission->already_published()) {
$html .= $this->edit_existing_feedback_link($feedback_row);
} else if ($ability->can('show', $feedback_row->get_feedback())) {
diff --git a/classes/render_helpers/grading_report/sub_rows/no_sub_rows.php b/classes/render_helpers/grading_report/sub_rows/no_sub_rows.php
index 43af3210..bd94f12c 100644
--- a/classes/render_helpers/grading_report/sub_rows/no_sub_rows.php
+++ b/classes/render_helpers/grading_report/sub_rows/no_sub_rows.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\sub_rows;
/**
diff --git a/classes/render_helpers/grading_report/sub_rows/sub_rows_interface.php b/classes/render_helpers/grading_report/sub_rows/sub_rows_interface.php
index 8ddbbafa..c324b303 100644
--- a/classes/render_helpers/grading_report/sub_rows/sub_rows_interface.php
+++ b/classes/render_helpers/grading_report/sub_rows/sub_rows_interface.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\render_helpers\grading_report\sub_rows;
use mod_coursework\grading_table_row_base;
diff --git a/classes/renderers/deadline_extension_renderer.php b/classes/renderers/deadline_extension_renderer.php
index 2dad353d..b516c31f 100644
--- a/classes/renderers/deadline_extension_renderer.php
+++ b/classes/renderers/deadline_extension_renderer.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\renderers;
use mod_coursework\allocation\allocatable;
@@ -52,7 +51,6 @@ public function show_page($vars) {
$PAGE->set_title($SITE->fullname);
$PAGE->set_heading($heading);
-
$html = '';
echo $OUTPUT->header();
diff --git a/classes/renderers/personal_deadline_renderer.php b/classes/renderers/personal_deadline_renderer.php
index 6aafdff6..9b9ffcea 100644
--- a/classes/renderers/personal_deadline_renderer.php
+++ b/classes/renderers/personal_deadline_renderer.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\renderers;
/**
@@ -31,7 +30,6 @@
*/
class personal_deadline_renderer {
-
/**
* @param array $vars
* @throws \coding_exception
@@ -68,7 +66,6 @@ public function new_page($vars) {
$html = ' Edit personal deadline for ' . get_string('multipleusers', 'mod_coursework') . ' ';
}
-
echo $OUTPUT->header();
echo $html;
$vars['form']->display();
diff --git a/classes/router.php b/classes/router.php
index fac7577d..4989ad0a 100644
--- a/classes/router.php
+++ b/classes/router.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework;
use coding_exception;
use moodle_url;
diff --git a/classes/sample_set_rule/range_sample_type.php b/classes/sample_set_rule/range_sample_type.php
index cd0cf608..63b39e50 100644
--- a/classes/sample_set_rule/range_sample_type.php
+++ b/classes/sample_set_rule/range_sample_type.php
@@ -29,10 +29,8 @@
use mod_coursework\allocation\allocatable;
use mod_coursework\models\coursework;
-
defined('MOODLE_INTERNAL') || die();
-
/**
* Defines a rule that will include all students above or below a particular percentage of
* the total grade.
@@ -43,7 +41,6 @@ public function adjust_set(array &$moderation_set, array &$potential_allocatable
}
-
public function get_numeric_boundaries() {
}
@@ -80,21 +77,15 @@ public function add_form_elements($assessor_number=0) {
$html .= $this->range_elements($assessor_number,0,false);
}
-
-
$html .= html_writer::link('#',get_string('addgraderule', 'mod_coursework'),array('id' => "assessor_{$assessor_number}_addgradderule", 'class' => 'addgradderule sample_set_rule'));
$html .= " ";
$html .= html_writer::link('#',get_string('removegraderule', 'mod_coursework'),array('id' => "assessor_{$assessor_number}_removegradderule", 'class' => 'removegradderule sample_set_rule'));
-
-
-
return $html;
}
public function range_elements($assessor_number, $sequence, $dbrecord=false) {
-
$percentage_options = array();
for($i = 0;$i < 110; $i = $i + 10) {
@@ -127,13 +118,11 @@ public function range_elements($assessor_number, $sequence, $dbrecord=false) {
$rules_checked = false;
}
-
$html = html_writer::start_tag('div', array('class' => "assessor_{$assessor_number}_grade_rules", 'id' => "assessor_{$assessor_number}_grade_rules_{$sequence}"));
$html .= html_writer::checkbox("assessor_{$assessor_number}_samplerules[]", 1, $rules_checked, '',
array('id' => "assessor_{$assessor_number}_samplerules_{$sequence}", 'class' => "assessor_{$assessor_number} range_grade_checkbox sample_set_rule"));
-
$grade_scale_text = ($this->coursework->grade < 0) ? get_string('scale', 'mod_coursework') : get_string('grade', 'mod_coursework') ;
$grade_scale_val = ($this->coursework->grade < 0) ? 'scale' : 'grade';
@@ -164,15 +153,12 @@ public function range_elements($assessor_number, $sequence, $dbrecord=false) {
$selected_to,
array('id' => "assessor_{$assessor_number}_sampleto_{$sequence}", 'class' => " sample_set_rule range_drop_down"));
-
$html .= html_writer::end_tag('div', '');
return $html;
}
-
-
public function add_form_elements_js($assessor_number=0) {
$js_script = "
@@ -224,7 +210,6 @@ public function add_form_elements_js($assessor_number=0) {
});
})
-
//remove grade rule buttons
$('.removegradderule').each(function(e,element) {
@@ -233,7 +218,6 @@ public function add_form_elements_js($assessor_number=0) {
var linkid = $(this).attr('id').split('_');
-
var spanclass = 'div.'+linkid[0] + '_' + linkid[1] +'_grade_rules';
if ($('#'+linkid[0] + '_' + linkid[1] + '_samplingstrategy').val() == AUTOMATIC_SAMPLING) {
@@ -249,8 +233,6 @@ public function add_form_elements_js($assessor_number=0) {
});
-
-
$('.range_grade_checkbox').each(function(e,element) {
var ele_id = $(this).attr('id').split('_');
@@ -264,7 +246,6 @@ public function add_form_elements_js($assessor_number=0) {
$(samplefromid).attr('disabled',disabled);
$(sampletoid).attr('disabled',disabled);
-
$(element).on('change',function() {
var ele_id = $(this).attr('id').split('_');
@@ -291,7 +272,6 @@ public function add_form_elements_js($assessor_number=0) {
});
-
function change_options(element) {
var PERCENT = 'percentage';
@@ -300,7 +280,6 @@ function change_options(element) {
var samplefromid = '#'+ele_id[0]+'_'+ele_id[1]+'_samplefrom_'+ele_id[3];
var sampletoid = '#'+ele_id[0]+'_'+ele_id[1]+'_sampleto_'+ele_id[3];
-
//remove the contents from the grade rule from and to drop downs
$(samplefromid).find('option').remove();
$(sampletoid).find('option').remove();
@@ -336,21 +315,17 @@ function change_options(element) {
});
-
$(sampletoid).append($(sampletoid).children().toArray().reverse());
$(sampletoid).children().first().prop('selected',true);
$(samplefromid).children().first().prop('selected',true);
}
-
-
";
return html_writer::script($js_script,null);
}
-
public function save_form_data($assessor_number=0,&$order=0) {
global $DB;
@@ -380,18 +355,14 @@ public function save_form_data($assessor_number=0,&$order=0) {
}
}
-
-
}
-
public function adjust_sample_set($stage_number,&$allocatables,&$manual_sample_set,&$auto_sample_set) {
global $DB;
$stage = "assessor_".$stage_number;
-
$sql = "SELECT r.*,p.rulename
FROM {coursework_sample_set_plugin} p,
{coursework_sample_set_rules} r
@@ -430,7 +401,6 @@ private function rationalise($ruletype, $limit1, $limit2) {
$limits = array();
-
$limits[0] = ($limit1>$limit2) ? $limit2 : $limit1;
$limits[1] = ($limit1>$limit2) ? $limit1 : $limit2;
@@ -454,7 +424,6 @@ private function rationalise($ruletype, $limit1, $limit2) {
$weighting = 100 / $number_of_items; // shall we round it????
-
$limits[0] = ceil($limits[0]/$weighting); // element of array
$limits[1] = ceil($limits[1]/$weighting); // element of array
@@ -465,8 +434,6 @@ private function rationalise($ruletype, $limit1, $limit2) {
}
}
-
-
return $limits;
}
@@ -486,7 +453,6 @@ private function get_allocatables_in_range($stage, $limit1, $limit2) {
//note as things stand limit1 and limit2 can not be params as the type of the grade field (varchar)
//means the values are cast as strings
-
return $DB->get_records_sql($sql, array('courseworkid' => $this->coursework->id,
'stage' => $stage));
diff --git a/classes/sample_set_rule/sample_base.php b/classes/sample_set_rule/sample_base.php
index e9b40d7a..914de116 100644
--- a/classes/sample_set_rule/sample_base.php
+++ b/classes/sample_set_rule/sample_base.php
@@ -28,16 +28,13 @@
use mod_coursework\allocation\allocatable;
use mod_coursework\models\coursework;
-
defined('MOODLE_INTERNAL') || die();
-
/**
* This base class is extended to make specific sampling rules strategies
*/
abstract class sample_base {
-
/**
* @var string DB table this class relates to.
*/
@@ -53,7 +50,6 @@ abstract class sample_base {
*/
public $courseworkid;
-
protected $coursework;
/**
@@ -94,13 +90,10 @@ abstract class sample_base {
'minimum'
);
-
-
function __construct($coursework) {
$this->coursework = $coursework;
}
-
/**
* Returns the name of the class without the 'coursework_moderation_set_rule_' prefix.
*/
@@ -144,7 +137,6 @@ public static function allow_multiple() {
return true;
}
-
/**
* Each rule may have different form elements that we need to add in order for a new one to be
* @abstract
@@ -175,7 +167,6 @@ protected function finalised_submissions(){
return $DB->get_records_sql($sql, array('courseworkid' => $this->coursework->id));
}
-
/**
*
* @return array
@@ -191,5 +182,4 @@ protected function released_submissions(){
return $DB->get_records_sql($sql, array('courseworkid' => $this->coursework->id));
}
-
}
diff --git a/classes/sample_set_rule/total_sample_type.php b/classes/sample_set_rule/total_sample_type.php
index 43baf40c..8c8cb3ae 100644
--- a/classes/sample_set_rule/total_sample_type.php
+++ b/classes/sample_set_rule/total_sample_type.php
@@ -31,7 +31,6 @@
defined('MOODLE_INTERNAL') || die();
-
/**
* Defines a rule that will include all students above or below a particular percentage of
* the total grade.
@@ -42,7 +41,6 @@ public function adjust_set(array &$moderation_set, array &$potential_allocatable
}
-
public function get_numeric_boundaries() {
}
@@ -66,8 +64,6 @@ public function add_form_elements($assessor_number=0) {
$selected = ($record = $DB->get_record_sql($sql)) ? array($record->upperlimit=> $record->upperlimit) : false;
$checked = ($selected) ? true : false;
-
-
$percentage_options = array();
for($i = 5;$i <= 100; $i = $i + 5) {
@@ -79,8 +75,6 @@ public function add_form_elements($assessor_number=0) {
$html .= html_writer::checkbox("assessor_{$assessor_number}_sampletotal_checkbox",1, $checked,get_string('topupto', 'mod_coursework'),
array('id' => "assessor_{$assessor_number}_sampletotal_checkbox", 'class' => "assessor_{$assessor_number} total_checkbox sample_set_rule"));
-
-
$html .= html_writer::select($percentage_options,
"assessor_{$assessor_number}_sampletotal",
"",
@@ -90,12 +84,9 @@ public function add_form_elements($assessor_number=0) {
$html .= html_writer::end_div();
-
-
return $html;
}
-
public function add_form_elements_js($assessor_number=0) {
$js_script = "
@@ -107,7 +98,6 @@ public function add_form_elements_js($assessor_number=0) {
var disabled = !$(this).prop('checked');
$(sampletotal).attr('disabled',disabled);
-
$(element).on('change',function() {
var ele_id = $(this).attr('id').split('_');
var sampletotal = '#'+ele_id[0]+'_'+ele_id[1]+'_sampletotal';
@@ -131,7 +121,6 @@ function save_form_data($assessor_number=0,&$order=0) {
if ($total_checkbox) {
-
$dbrecord = new \stdClass();
$dbrecord->ruletype = "";
$dbrecord->lowerlimit = 0;
@@ -144,10 +133,8 @@ function save_form_data($assessor_number=0,&$order=0) {
$DB->insert_record('coursework_sample_set_rules', $dbrecord);
}
-
}
-
static function compare_key($a, $b) {
if ($a === $b) return 0;
return ($a > $b)? 1:-1;
@@ -188,14 +175,11 @@ public function adjust_sample_set($stage_number,&$allocatables,&$manual_sample_s
//use array chunk to split auto sample set into chunks we will only use the first chunk
if ($chunked_array = array_chunk($auto_sample_set, $total_to_return, true)) $auto_sample_set = $chunked_array[0];
-
-
//if the number in the sample set is less than the total to return
if (count($auto_sample_set) < $total_to_return) {
//we need to top up the sample set with other allocatables
-
//graded at the previous stage take precedence
$previous_stage_number = $stage_number - 1;
@@ -215,7 +199,6 @@ public function adjust_sample_set($stage_number,&$allocatables,&$manual_sample_s
}
}
-
//if this is not enough select anyone (which should == the ungraded as all graded should have been added)
if (count($auto_sample_set) < $total_to_return) {
@@ -252,14 +235,8 @@ public function adjust_sample_set($stage_number,&$allocatables,&$manual_sample_s
$auto_sample_set = array();
}
-
}
}
-
-
-
-
-
}
diff --git a/classes/stages/assessor.php b/classes/stages/assessor.php
index e8d32324..3d3da04b 100644
--- a/classes/stages/assessor.php
+++ b/classes/stages/assessor.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\stages;
use mod_coursework\models\user;
diff --git a/classes/stages/base.php b/classes/stages/base.php
index 41f48a1c..6797cce6 100644
--- a/classes/stages/base.php
+++ b/classes/stages/base.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\stages;
use mod_coursework\allocation\allocatable;
@@ -70,7 +69,6 @@ abstract class base {
'user_is_assessor' => []
];
-
/**
* @param coursework $coursework
* @param int $stage_identifier
@@ -80,7 +78,6 @@ public function __construct($coursework, $stage_identifier) {
$this->stage_identifier = $stage_identifier;
}
-
/**
* @return strategy_base
*/
@@ -107,7 +104,6 @@ public function make_auto_allocation_if_necessary($allocatable) {
$teacher = $this->get_next_teacher($allocatable);
}
-
if ($teacher) {
$this->make_auto_allocation($allocatable, $teacher);
}
@@ -203,7 +199,6 @@ public function get_allocation_table_cell($allocatable) {
return $cell_helper->get_renderable_allocation_table_cell();
}
-
/**
* @param $allocatable
* @return \html_table_cell
@@ -361,7 +356,6 @@ public function has_moderation($submission) {
}
}
-
/**
* @param $moderation
* @return bool|moderation
@@ -417,7 +411,6 @@ public function has_allocation($allocatable) {
return in_array($allocatable->id, $this->allocatables_with_allocations);
}
-
/**
* Check if current marking stage has any allocation
*
@@ -431,7 +424,6 @@ public function stage_has_allocation(){
return !empty($record);
}
-
/**
* @param $allocatable
* @throws \coding_exception
@@ -587,7 +579,6 @@ public function user_is_moderator($moderator) {
return $enrolled || is_primary_admin($moderator->id);
}
-
/**
* Check if a user has any allocation in this stage
* @param allocatable $allocatable
@@ -731,7 +722,6 @@ public function get_moderation_for_feedback($feedback) {
return moderation::find($moderation_params);
}
-
/**
* return bool
*/
@@ -769,7 +759,6 @@ public function is_initial_assesor_stage() {
*/
public function potential_marker_dropdown($allocatable) {
-
// This gets called a lot on the allocations page, but does not change.
if (!isset($this->assessor_dropdown_options)) {
@@ -801,12 +790,10 @@ public function potential_marker_dropdown($allocatable) {
$option_for_nothing_chosen_yet = array('' => get_string($identifier, 'mod_coursework'));
-
$dropdown_name = $this->assessor_dropdown_name($allocatable);
$selected = $this->selected_allocation_in_session($dropdown_name);
-
$assessor_dropdown = \html_writer::select($this->assessor_dropdown_options,
$dropdown_name,
$selected,
@@ -814,7 +801,6 @@ public function potential_marker_dropdown($allocatable) {
$html_attributes
);
-
return $assessor_dropdown;
}
@@ -914,7 +900,6 @@ private function currently_allocated_assessor($allocatable) {
return false;
}
-
/**
* @param $allocatable
*/
@@ -934,12 +919,10 @@ private function in_editable_period($allocatable) {
$result += $feedback->timecreated;
}
-
return $result > time();
}
-
private function selected_allocation_in_session($dropdownname) {
global $SESSION;
@@ -951,8 +934,6 @@ private function selected_allocation_in_session($dropdownname) {
return $SESSION->coursework_allocationsessions[$cm->id][$dropdownname];
}
-
-
}
return '';
diff --git a/classes/stages/final_agreed.php b/classes/stages/final_agreed.php
index f31ebc02..fc562c98 100644
--- a/classes/stages/final_agreed.php
+++ b/classes/stages/final_agreed.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\stages;
use mod_coursework\models\user;
diff --git a/classes/stages/moderator.php b/classes/stages/moderator.php
index 0f467844..fcfc559a 100644
--- a/classes/stages/moderator.php
+++ b/classes/stages/moderator.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\stages;
use mod_coursework\models\user;
diff --git a/classes/submission_files.php b/classes/submission_files.php
index 7ac536ae..dbe6b6fa 100644
--- a/classes/submission_files.php
+++ b/classes/submission_files.php
@@ -30,7 +30,6 @@
defined('MOODLE_INTERNAL') || die();
-
/**
* Represents the files a student has submitted.
*/
diff --git a/classes/task/enrol_task.php b/classes/task/enrol_task.php
index 5bdefb5f..4deb8625 100644
--- a/classes/task/enrol_task.php
+++ b/classes/task/enrol_task.php
@@ -17,7 +17,6 @@
namespace mod_coursework;
namespace mod_coursework\task;
-
/**
* A scheduled task for the coursework module cron.
*
diff --git a/classes/task/unenrol_task.php b/classes/task/unenrol_task.php
index 46172498..eac12f87 100644
--- a/classes/task/unenrol_task.php
+++ b/classes/task/unenrol_task.php
@@ -17,7 +17,6 @@
namespace mod_coursework\models;
namespace mod_coursework\task;
-
/**
* A scheduled task for the coursework module cron.
*
diff --git a/classes/test_helpers/factory_mixin.php b/classes/test_helpers/factory_mixin.php
index 845c0011..fc844ad9 100644
--- a/classes/test_helpers/factory_mixin.php
+++ b/classes/test_helpers/factory_mixin.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\test_helpers;
use coding_exception;
diff --git a/classes/traits/allocatable_functions.php b/classes/traits/allocatable_functions.php
index f4c327b7..ccbf9a43 100644
--- a/classes/traits/allocatable_functions.php
+++ b/classes/traits/allocatable_functions.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\traits;
use mod_coursework\models\assessment_set_membership;
use mod_coursework\models\coursework;
@@ -84,7 +83,6 @@ public function has_agreed_feedback($coursework) {
return !empty($result);
}
-
/**
* @param coursework $coursework
* @return bool
@@ -103,7 +101,6 @@ public function get_agreed_feedback($coursework) {
return $DB->get_record_sql($sql, array('id' => $this->id(), 'courseworkid' => $coursework->id()));
}
-
/**
* @param coursework $coursework
* @return bool
diff --git a/classes/warnings.php b/classes/warnings.php
index dd001298..9aec362c 100644
--- a/classes/warnings.php
+++ b/classes/warnings.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework;
use mod_coursework\models\coursework;
diff --git a/db/access.php b/db/access.php
index bf75b398..07e8c4b2 100644
--- a/db/access.php
+++ b/db/access.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* Capability definitions for the coursework module
*
diff --git a/db/caches.php b/db/caches.php
index cf5fdefc..b097c831 100644
--- a/db/caches.php
+++ b/db/caches.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
$definitions = array(
'courseworkdata' => array(
'mode' => cache_store::MODE_APPLICATION
diff --git a/db/events.php b/db/events.php
index a08a2052..31627dd3 100644
--- a/db/events.php
+++ b/db/events.php
@@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
-
$observers = array(
array(
@@ -65,4 +63,3 @@
),
);
-
diff --git a/db/install.php b/db/install.php
index b9e76833..888837d6 100644
--- a/db/install.php
+++ b/db/install.php
@@ -32,7 +32,6 @@
function xmldb_coursework_install() {
global $DB;
-
//install the plugins used by sampling in the correct order
$plugins = array('range_sample_type', 'total_sample_type');
diff --git a/db/upgrade.php b/db/upgrade.php
index 3e545928..4d61148e 100644
--- a/db/upgrade.php
+++ b/db/upgrade.php
@@ -1056,7 +1056,6 @@ function xmldb_coursework_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2013011400, 'coursework');
}
-
if ($oldversion < 2014031800) {
// Define field mitigationenabled to be added to coursework.
@@ -1180,7 +1179,6 @@ function xmldb_coursework_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2014071400, 'coursework');
}
-
if ($oldversion < 2014071404) {
// Add stage identifier to all allocations.
@@ -1242,7 +1240,6 @@ function xmldb_coursework_upgrade($oldversion) {
$dbman->drop_table($table);
}
-
// Coursework savepoint reached.
upgrade_mod_savepoint(true, 2014071500, 'coursework');
}
@@ -1309,7 +1306,6 @@ function xmldb_coursework_upgrade($oldversion) {
AND isfinalgrade = 1
");
-
upgrade_mod_savepoint(true, 2014071502, 'coursework');
}
@@ -1604,7 +1600,6 @@ function xmldb_coursework_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2014072500, 'coursework');
}
-
if ($oldversion < 2014072502) {
// Define field showallfeedbacks to be added to coursework.
@@ -1627,7 +1622,6 @@ function xmldb_coursework_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2014072502, 'coursework');
}
-
if ($oldversion < 2014082600) {
// Define table coursework_mitigation_codes to be dropped.
@@ -1657,8 +1651,6 @@ function xmldb_coursework_upgrade($oldversion) {
$DB->execute("UPDATE {coursework} SET moderationenabled = 0");
}
-
-
if ($oldversion < 2014090801) {
// Define field timesubmitted to be added to coursework_submissions.
@@ -1689,7 +1681,6 @@ function xmldb_coursework_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2014091000, 'coursework');
}
-
if ($oldversion < 2014111700) {
// Define field samplingenabled to be added to coursework.
@@ -1855,7 +1846,6 @@ function xmldb_coursework_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2014121203, 'coursework');
}
-
if ($oldversion < 2014122200) {
// Define field extensionsenabled to be added to coursework.
@@ -1961,7 +1951,6 @@ function xmldb_coursework_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2015082402, 'coursework');
}
-
if ($oldversion < 2015082409) {
// Define table coursework_sample_set_rules to be created.
$table = new xmldb_table('coursework_sample_set_rules');
@@ -1981,13 +1970,11 @@ function xmldb_coursework_upgrade($oldversion) {
// Adding keys to table coursework_moderation_set_ru.
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
-
// Conditionally launch create table for coursework_moderation_set_ru.
if (!$dbman->table_exists($table)) {
$dbman->create_table($table);
}
-
$table = new xmldb_table('coursework_sample_set_plugin');
// Adding fields to table coursework_sample_set_rules.
@@ -1999,11 +1986,9 @@ function xmldb_coursework_upgrade($oldversion) {
// Adding keys to table coursework_moderation_set_ru.
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
-
if (!$dbman->table_exists($table)) {
$dbman->create_table($table);
-
//now create plugin records for sample set plugins
$plugins = array('range_sample_type', 'total_sample_type');
@@ -2025,7 +2010,6 @@ function xmldb_coursework_upgrade($oldversion) {
}
-
if ($oldversion < 2015082410) {
// Define table coursework_sample_set_mbrs to be created.
@@ -2052,14 +2036,12 @@ function xmldb_coursework_upgrade($oldversion) {
}
-
$allocatabletables=array('coursework_submissions',
'coursework_allocation_pairs',
'coursework_mod_set_members',
'coursework_extensions',
'coursework_sample_set_mbrs');
-
if ($oldversion < 2015110303) {
$fields = array();
//Add fields to assist backup annotation
@@ -2083,8 +2065,6 @@ function xmldb_coursework_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2015110303, 'coursework');
}
-
-
if ($oldversion < 2015121401) {
$fields = array();
//Add fields to assist backup annotation
@@ -2094,7 +2074,6 @@ function xmldb_coursework_upgrade($oldversion) {
$table = new xmldb_table('coursework');
-
if (!$dbman->field_exists($table, $fieldeditingtime)) {
$dbman->add_field($table, $fieldeditingtime);
}
@@ -2109,7 +2088,6 @@ function xmldb_coursework_upgrade($oldversion) {
$table = new xmldb_table('coursework_submissions');
-
if (!$dbman->field_exists($table, $fieldeditingtime)) {
$dbman->add_field($table, $fieldeditingtime);
}
@@ -2126,7 +2104,6 @@ function xmldb_coursework_upgrade($oldversion) {
$table = new xmldb_table('coursework');
-
if (!$dbman->field_exists($table, $upgradefield)) {
$dbman->add_field($table, $upgradefield);
}
@@ -2143,7 +2120,6 @@ function xmldb_coursework_upgrade($oldversion) {
$table = new xmldb_table('coursework');
-
if (!$dbman->field_exists($table, $upgradefield)) {
$dbman->add_field($table, $upgradefield);
}
@@ -2155,7 +2131,6 @@ function xmldb_coursework_upgrade($oldversion) {
$table = new xmldb_table('coursework');
-
if (!$dbman->field_exists($table, $upgradefield)) {
$dbman->add_field($table, $upgradefield);
}
@@ -2172,16 +2147,13 @@ function xmldb_coursework_upgrade($oldversion) {
$table = new xmldb_table('coursework');
-
if (!$dbman->field_exists($table, $upgradefield)) {
$dbman->add_field($table, $upgradefield);
}
-
upgrade_mod_savepoint(true, 2016110102, 'coursework');
}
-
if ($oldversion < 2016112300) {
//Add a field to hold extension value if granted
$fieldextension = new xmldb_field('extension', XMLDB_TYPE_INTEGER, '10', true, XMLDB_NOTNULL, null, '0', null);
@@ -2190,12 +2162,10 @@ function xmldb_coursework_upgrade($oldversion) {
$table = new xmldb_table('coursework_reminder');
-
if (!$dbman->field_exists($table, $fieldextension)) {
$dbman->add_field($table, $fieldextension);
}
-
upgrade_mod_savepoint(true, 2016112300, 'coursework');
}
@@ -2207,7 +2177,6 @@ function xmldb_coursework_upgrade($oldversion) {
$table = new xmldb_table('coursework');
-
if (!$dbman->field_exists($table, $upgradefield)) {
$dbman->add_field($table, $upgradefield);
}
@@ -2215,7 +2184,6 @@ function xmldb_coursework_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2016121500, 'coursework');
}
-
if ($oldversion < 2016121501) {
// Define table coursework_sample_set_mbrs to be created.
@@ -2262,7 +2230,6 @@ function xmldb_coursework_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2016121600, 'coursework');
}
-
if ($oldversion < 2017030801) {
// Define table coursework_sample_set_mbrs to be created.
@@ -2270,7 +2237,6 @@ function xmldb_coursework_upgrade($oldversion) {
$relativeinitial = new xmldb_field('relativeinitialmarkingdeadline', XMLDB_TYPE_INTEGER, '10', true, XMLDB_NOTNULL, null, '0', null);
-
if (!$dbman->field_exists($table, $relativeinitial)) {
$dbman->add_field($table, $relativeinitial);
}
@@ -2333,19 +2299,15 @@ function xmldb_coursework_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2017081102, 'coursework');
}
-
-
if ($oldversion < 2017081103) {
// Changing the default of field automaticagreementstrategy on table coursework
$table = new xmldb_table('coursework');
$field = new xmldb_field('automaticagreementstrategy', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, false, 'none');
-
// Launch change of default for field automaticagreementstrategy.
$dbman->change_field_default($table, $field);
-
// again update default value of automaticagreementstrategy field from NULL to none
$allcourseworks = $DB->get_records('coursework', array('automaticagreementstrategy' => 'NULL')); // get all courseworks with automaticagreementstrategy set to NULL
foreach ($allcourseworks as $coursework) {
@@ -2357,7 +2319,6 @@ function xmldb_coursework_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2017081103, 'coursework');
}
-
if ($oldversion < 2017091400) {
$table = new xmldb_table('coursework');
@@ -2371,8 +2332,6 @@ function xmldb_coursework_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2017091400, 'coursework');
}
-
-
if ($oldversion < 2017100300) {
// Define table coursework_person_deadlines to be created.
@@ -2427,7 +2386,6 @@ function xmldb_coursework_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2017100501, 'coursework');
}
-
if ($oldversion < 2018021501) {
$table = new xmldb_table('coursework');
@@ -2461,7 +2419,6 @@ function xmldb_coursework_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2018042401, 'coursework');
}
-
if ($oldversion < 2019071100) {
//Add fields for finalstagegrading
@@ -2476,7 +2433,6 @@ function xmldb_coursework_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2019071100, 'coursework');
}
-
if ($oldversion < 2019110700) {
// Define field plagiarismflagenabled to be added to coursework.
@@ -2509,7 +2465,6 @@ function xmldb_coursework_upgrade($oldversion) {
$table->add_field('lastmodifiedby', XMLDB_TYPE_INTEGER, '10', null, false, null, null);
$table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
-
// Adding keys to table coursework_plagiarism_flag.
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
@@ -2534,7 +2489,6 @@ function xmldb_coursework_upgrade($oldversion) {
$dbman->add_field($table, $field);
}
-
$courseworkinstances = $DB->get_records('coursework');
foreach($courseworkinstances as $cwk) {
@@ -2572,8 +2526,6 @@ function xmldb_coursework_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2020111602, 'coursework');
}
-
-
// Always needs to return true.
return true;
}
diff --git a/index.php b/index.php
index ad0baf12..765b7986 100644
--- a/index.php
+++ b/index.php
@@ -64,7 +64,6 @@
die();
}
-
echo $OUTPUT->heading(get_string('modulenameplural', 'coursework'), 2);
$page_renderer = $PAGE->get_renderer('mod_coursework', 'page');
echo $page_renderer->view_course_index($course->id);
diff --git a/lang/en/coursework.php b/lang/en/coursework.php
index 6b686dd6..791343c9 100644
--- a/lang/en/coursework.php
+++ b/lang/en/coursework.php
@@ -409,9 +409,6 @@
$string['grade_editing'] = 'Grade editing time';
$string['grading_page'] = 'Grading page';
-
-
-
$string['group'] = 'Group';
$string['grouping_id'] = 'Grouping';
$string['grouping_id_help'] = 'Grouping containing the groups wich are allowed to submit.';
@@ -544,7 +541,6 @@
$string['noerrorsfound'] = 'No errors were found in the grading sheet uploaded';
$string['noallocationerrorsfound'] = 'No errors were found in the allocation sheet uploaded';
-
$string['nofeedbackforms'] = 'At present no feedback forms have been created. At least one feedback form is required so that it may be selected when creating a OCM. Click url}\'>here to create a form';
$string['nofeedbacksyet'] = 'No feedbacks yet (Max: {$a})';
$string['nofeedbackyet'] = 'No feedback yet';
diff --git a/lib.php b/lib.php
index 97ee1186..14028828 100644
--- a/lib.php
+++ b/lib.php
@@ -222,8 +222,6 @@ function coursework_add_instance($formdata) {
return $returnid;
}
-
-
/**
* Is the event visible?
*
@@ -253,7 +251,6 @@ function mod_coursework_core_calendar_is_event_visible(calendar_event $event) {
return false;
}
-
/**
* This function receives a calendar event and returns the action associated with it, or null if there is none.
*
@@ -463,9 +460,6 @@ function coursework_update_instance($coursework) {
}
-
-
-
$oldsubmissiondeadline = $DB->get_field('coursework', 'deadline', array('id' => $coursework->id));
$oldgeneraldeadline = $DB->get_field('coursework', 'generalfeedback', array('id' => $coursework->id));
$oldindividualdeadline = $DB->get_field('coursework', 'individualfeedback', array('id' => $coursework->id));
@@ -478,7 +472,6 @@ function coursework_update_instance($coursework) {
$courseworkobj = coursework::find($coursework->id);
-
$params = array(
'context' => context_module::instance($courseworkobj->get_course_module()->id),
'courseid' => $courseworkobj->get_course()->id,
@@ -495,7 +488,6 @@ function coursework_update_instance($coursework) {
)
);
-
$event = \mod_coursework\event\coursework_deadline_changed::create($params);
$event->trigger();
@@ -588,7 +580,6 @@ function remove_event($coursework, $eventtype = false){
}
}
-
/**
* Given an ID of an instance of this module,
* this function will permanently delete the instance
@@ -776,7 +767,6 @@ function coursework_supports($feature) {
}
}
-
/**
* Checks whether the student with the given username has been flagged
* as having a disability
@@ -908,7 +898,6 @@ function coursework_extend_settings_navigation(settings_navigation $settings, na
}
-
/**
* Auto-allocates after a new student or teacher is added to a coursework.
*
@@ -1194,7 +1183,6 @@ function coursework_records_to_menu($records, $field1, $field2) {
}
-
/**
* Custom error handler for ADODB used by the sits class. Came with no docs so not sure what it's for.
* Set as error handler at top of sits class file. Suspect it suppresses errors.
@@ -1248,7 +1236,6 @@ function mod_coursework_supports($feature) {
}
}
-
/**
* @param $event_data
* @return bool
@@ -1336,7 +1323,6 @@ function course_group_member_added($event_data) {
return true;
}
-
/**
* * Function to process allocation of new group members (student/group - assign to a group assessor or assessor - assign to students/group) when a group member is deleted
*
@@ -1437,7 +1423,6 @@ function course_group_member_removed($event_data) {
return true;
}
-
/**
* Function to check the allocation if it is not pinned or its submission has not been marked yet
*
@@ -1598,7 +1583,6 @@ function teacher_allocation_cache_purge($event_data){
return true;
}
-
/**
* Function to remove teacher allocation (also if pinned), don't remove if teacher already graded
*
diff --git a/mod_form.php b/mod_form.php
index e0bcb3e7..ac40b491 100644
--- a/mod_form.php
+++ b/mod_form.php
@@ -63,7 +63,6 @@ public function definition() {
$this->add_name_field();
$this->standard_intro_elements(get_string('description', 'coursework'));
-
$this->add_availability_header();
$this->add_start_date_field();
@@ -82,7 +81,6 @@ public function definition() {
$this->add_allow_early_finalisation_field();
$this->add_allow_late_submissions_field();
-
if (coursework_is_ulcc_digest_coursework_plugin_installed()) {
$this->add_digest_header();
$this->add_marking_reminder_warning();
@@ -90,7 +88,6 @@ public function definition() {
}
-
$this->add_submissions_header();
$this->add_turnitin_files_settings_waring();
@@ -123,7 +120,6 @@ public function definition() {
$this->add_enable_assessor_anonymity_field();
-
$this->add_feedback_header();
$this->add_general_feedback_release_date_field();
@@ -131,7 +127,6 @@ public function definition() {
$this->add_email_individual_feedback_notification_field();
$this->add_all_feedbacks_field();
-
$this->add_extensions_header();
$this->add_enable_extensions_field();
@@ -141,7 +136,6 @@ public function definition() {
$this->add_use_groups_field();
$this->add_grouping_field();
-
$this->standard_grading_coursemodule_elements();
$this->add_tweaks_to_standard_grading_form_elements();
@@ -150,7 +144,6 @@ public function definition() {
}
-
/**
* Adds all default data to the form elements.
*
@@ -240,7 +233,6 @@ public function validation($data, $files) {
}
-
$courseworkid = $this->get_coursework_id();
if ($courseworkid) {
$coursework = mod_coursework\models\coursework::find($courseworkid);
@@ -253,16 +245,11 @@ public function validation($data, $files) {
$errors['numberofmarkers'] = get_string('not_enough_assessors_for_sampling', 'mod_coursework');
}
-
-
$parent_errors = parent::validation($data, $files);
return array_merge($errors, $parent_errors);
}
-
-
-
/**
* Get data from the form and manipulate it
* @return bool|object
@@ -360,26 +347,19 @@ protected function add_submission_deadline_field() {
}
}
-
$moodle_form->addElement('date_time_selector',
'deadline',
get_string('deadline', 'coursework'),
array('optional' => $optional, 'disabled' => $disabled));
-
-
$moodle_form->addElement('html', '');
$moodle_form->addElement('html', get_string('submissionsdeadlineinfo', 'mod_coursework'));
$moodle_form->addElement('html', '
');
-
-
-
if (!empty($CFG->coursework_submission_deadline)) $moodle_form->setDefault('deadline', $default_timestamp);
$moodle_form->addHelpButton('deadline', 'deadline', 'mod_coursework');
}
-
/**
* @throws coding_exception
*/
@@ -405,7 +385,6 @@ protected function add_personal_deadline_field(){
}
-
/**
* @throws coding_exception
*/
@@ -428,14 +407,10 @@ protected function add_start_date_field() {
array('optional' => true, 'disabled' => $disabled)
);
-
if (!empty($CFG->coursework_start_date)) $moodle_form->setDefault('startdate', $default_timestamp);
$moodle_form->addHelpButton('startdate', 'startdate', 'mod_coursework');
}
-
-
-
private function add_marking_deadline_field() {
global $CFG;
$moodle_form =& $this->_form;
@@ -476,7 +451,6 @@ protected function add_initial_marking_deadline_field() {
$disabled = false;
-
if ($CFG->coursework_marking_deadline == 7 ) {
$default_timestamp = strtotime('+1 weeks', $submission_deadline_timestamp);
} else if ($CFG->coursework_marking_deadline == 14 ) {
@@ -498,7 +472,6 @@ protected function add_initial_marking_deadline_field() {
array('optional' => true, 'disabled' => $disabled)
);
-
if (!empty($CFG->coursework_marking_deadline)) $moodle_form->setDefault('initialmarkingdeadline', $default_timestamp);
$moodle_form->addHelpButton('initialmarkingdeadline', 'initialmarkingdeadline', 'mod_coursework');
@@ -579,11 +552,8 @@ protected function add_relative_initial_marking_deadline_field() {
if (!empty($CFG->coursework_marking_deadline)) $moodle_form->setDefault('relativeinitialmarkingdeadline', $CFG->coursework_marking_deadline);
$moodle_form->addHelpButton('relativeinitialmarkingdeadline', 'agreedgrademarkingdeadline', 'mod_coursework');
-
-
}
-
/********
* Adds the relative agreed grade marking deadline fields to the settings
*/
@@ -620,7 +590,6 @@ protected function add_digest_header() {
$moodle_form->setExpanded('digest');
}
-
private function add_marking_reminder_field() {
global $CFG;
$moodle_form =& $this->_form;
@@ -642,7 +611,6 @@ protected function add_marking_reminder_warning() {
$this->_form->addElement('html', '');
}
-
/**
* @throws coding_exception
*/
@@ -656,7 +624,6 @@ protected function add_allow_early_finalisation_field() {
$moodle_form->disabledIf('allowearlyfinalisation', 'deadline[enabled]', 'notchecked');
}
-
/**
* @throws coding_exception
*/
@@ -668,7 +635,6 @@ protected function add_group_submission_header(){
// We want it expanded by default
$moodle_form->setExpanded('group_submission');
-
}
/**
@@ -789,7 +755,6 @@ protected function add_number_of_files_field() {
}
-
protected function add_rename_file_field() {
global $DB, $PAGE;
@@ -824,7 +789,6 @@ protected function add_rename_file_field() {
});
");
-
} else {
$sql = "SELECT *
@@ -832,7 +796,6 @@ protected function add_rename_file_field() {
WHERE id = :courseworkid
AND renamefiles = 1";
-
$settingvalue = ($DB->get_records_sql($sql,array('courseworkid' => $courseworkid))) ? get_string('yesrenamefile', 'mod_coursework') : get_string('norenamefile', 'mod_coursework') ;
$moodle_form->addElement('static', 'renamefilesdescription', get_string('renamefiles', 'mod_coursework'),
@@ -882,7 +845,6 @@ protected function add_number_of_initial_assessors_field() {
$moodle_form->setDefault('numberofmarkers', 1);
}
-
/**
* @param $moodle_form
* @throws coding_exception
@@ -897,7 +859,6 @@ protected function add_enable_moderation_agreement_field(){
$moodle_form->disabledIf('moderationagreementenabled', 'numberofmarkers', 'neq', 1);
}
-
/**
* @return int
* @throws coding_exception
@@ -1028,7 +989,6 @@ protected function add_enable_assessor_anonymity_field(){
}
-
/**
* @throws coding_exception
*/
@@ -1068,7 +1028,6 @@ protected function add_individual_feedback_release_date_field() {
$options['optional'] = false;
}
-
$moodle_form->addElement('date_time_selector',
'individualfeedback',
get_string('individualfeedback', 'coursework'),
@@ -1126,7 +1085,6 @@ protected function add_general_feedback_release_date_field() {
$moodle_form->disabledIf('generalfeedback', 'deadline[enabled]', 'notchecked');
}
-
/**
*/
protected function add_tweaks_to_standard_grading_form_elements() {
@@ -1144,7 +1102,6 @@ protected function add_tweaks_to_standard_grading_form_elements() {
$moodle_form->disabledIf('finalstagegrading', 'numberofmarkers', 'eq', 1);
$moodle_form->disabledIf('finalstagegrading', 'advancedgradingmethod_submissions', 'eq', "");
-
$feedbackexists = 0;
// disable the setting if at least one feedback exists
$courseworkid = $this->get_coursework_id();
@@ -1156,7 +1113,6 @@ protected function add_tweaks_to_standard_grading_form_elements() {
$moodle_form->setType('feedbackexists', PARAM_INT);
$moodle_form->disabledIf('finalstagegrading', 'feedbackexists', 'eq', 1);
-
// Don't think this belongs here...
// $options = array(0 => get_string('no'), 1 => get_string('yes'));
// $moodle_form->addElement('select', 'automaticagreement', get_string('automaticagreement', 'mod_coursework'), $options);
@@ -1199,7 +1155,6 @@ private function add_allow_late_submissions_field() {
}
-
protected function add_all_feedbacks_field(){
$moodle_form =& $this->_form;
@@ -1222,7 +1177,6 @@ private function add_enable_sampling_checkbox() {
$moodle_form->addElement('selectyesno', 'samplingenabled', get_string('samplingenabled', 'mod_coursework'));
$moodle_form->addHelpButton('samplingenabled', 'samplingenabled', 'mod_coursework');
-
$courseworkid = $this->get_coursework_id();
if (!$courseworkid || ($courseworkid && !mod_coursework\models\coursework::find($courseworkid)->has_samples()) ) {
$moodle_form->disabledIf('samplingenabled', 'numberofmarkers', 'eq', 1);
@@ -1245,7 +1199,6 @@ private function add_view_initial_assessors_grade(){
$moodle_form->disabledIf('viewinitialgradeenabled', 'numberofmarkers', 'eq', 1);
}
-
private function add_enable_agreed_grade_delay() {
global $CFG;
@@ -1264,8 +1217,6 @@ private function add_enable_agreed_grade_delay() {
$moodle_form->addHelpButton('gradeeditingtime', 'gradeeditingtime', 'mod_coursework');
$moodle_form->setDefault('gradeeditingtime', $CFG->coursework_grade_editing);
-
-
$moodle_form->disabledIf('gradeeditingtime', 'numberofmarkers', 'eq', 1);
}
@@ -1305,7 +1256,6 @@ private function forceblindmarking(){
}
-
private function forceautorelease(){
global $CFG;
return $CFG->coursework_forceauto_release_individual_feedback;
@@ -1328,14 +1278,12 @@ private function add_enable_extensions_field(){
$moodle_form->setDefault('extensionsenabled', $CFG->coursework_individual_extension);
}
-
private function add_submission_notification_field() {
global $COURSE;
$moodle_form =& $this->_form;
-
$selectableusers = array();
// capability for user allowed to receive submission notifications
@@ -1366,7 +1314,6 @@ private function add_automatic_agreement_enabled() {
$this->form()->disabledif('automaticagreementstrategy', 'numberofmarkers', 'eq', 1);
$this->form()->disabledIf('automaticagreementrange', 'automaticagreementstrategy', 'neq', 'percentage_distance');
-
$this->form()->addElement('select',
'automaticagreementrange',
get_string('automaticagreementrange', 'mod_coursework'),
@@ -1389,7 +1336,6 @@ private function add_automatic_agreement_enabled() {
$this->form()->setDefault('roundingrule', 'mid');
$this->form()->disabledIf('roundingrule', 'automaticagreementstrategy', 'neq', 'average_grade');
-
}
private function add_enable_plagiarism_flag_field(){
diff --git a/renderable.php b/renderable.php
index 03781525..22fe0943 100644
--- a/renderable.php
+++ b/renderable.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* This file contains all of the renderable class definitions. They are separate from the main
* autoloaded class definitions in /classes because the renderer cannot deal with namespaces.
@@ -79,7 +78,6 @@ class mod_coursework_assessor_feedback_table extends mod_coursework_renderable {
*/
class mod_coursework_coursework extends mod_coursework_renderable { }
-
/**
* @mixin \mod_coursework\grading_table_row_multi
*/
diff --git a/renderers/grading_report_renderer.php b/renderers/grading_report_renderer.php
index 360fdf47..5e7f5059 100644
--- a/renderers/grading_report_renderer.php
+++ b/renderers/grading_report_renderer.php
@@ -45,7 +45,6 @@ class mod_coursework_grading_report_renderer extends plugin_renderer_base {
*/
protected $is_multiple_markers;
-
/**
* @param grading_report $grading_report
* param $is_multiple_markers
@@ -78,7 +77,6 @@ public function render_grading_report($grading_report, $is_multiple_markers) {
return $langelement . $table_html;
}
-
/**
*
* @return mixed
@@ -101,7 +99,6 @@ private function generate_lang_element() {
return $result;
}
-
/**
* @param cell_interface $cell_helper
* @param array $options
@@ -139,7 +136,6 @@ protected function make_row_for_allocatable($row_object, $cell_helpers, $sub_row
$table_html .= ' ';
}
-
foreach ($cell_helpers as $cell_helper) {
$html_td = trim($cell_helper->get_table_cell($row_object));
@@ -289,5 +285,4 @@ public function grading_table_row_id(allocatable $allocatable, coursework $cours
return 'allocatable_' . $coursework->get_allocatable_identifier_hash($allocatable);
}
-
}
diff --git a/renderers/object_renderer.php b/renderers/object_renderer.php
index 8919dfd5..436abbfd 100644
--- a/renderers/object_renderer.php
+++ b/renderers/object_renderer.php
@@ -42,7 +42,6 @@
*/
class mod_coursework_object_renderer extends plugin_renderer_base {
-
/**
* Renders a coursework feedback as a row in a table. This is for the grading report when we have
* multiple markers and we want an AJAX pop up with details of the feedback. Also for the student view.
@@ -172,9 +171,6 @@ public function render_feedback(feedback $feedback) {
return $out;
}
-
-
-
/**
* Renders a coursework moderation as a row in a table.
*
@@ -183,7 +179,6 @@ public function render_feedback(feedback $feedback) {
*/
public function render_moderation(moderation $moderation){
-
$title =
get_string('moderationfor', 'coursework', $moderation->get_submission()->get_allocatable_name());
@@ -411,7 +406,6 @@ public function render_feedback_files(mod_coursework_feedback_files $files) {
return $out;
}
-
/**
* Outputs the files as a HTML list.
*
@@ -529,7 +523,6 @@ protected function render_mod_coursework_coursework(mod_coursework_coursework $c
$out .= html_writer::tag('h3', get_string('gradingsummary', 'coursework'));
$out .= $this->coursework_grading_summary_table($coursework);
-
// Show general feedback if it's there and the deadline has passed or general feedback's date is not enabled which means it should be displayed automatically
if (($coursework->is_general_feedback_enabled() && $allowed_to_add_general_feedback && (time() > $coursework->generalfeedback || $cangrade || $canpublish || $is_published)) || !$coursework->is_general_feedback_enabled()) {
$out .= html_writer::tag('h3', get_string('generalfeedback', 'coursework'));
@@ -575,7 +568,6 @@ protected function render_mod_coursework_allocation_table(mod_coursework_allocat
';
-
$options = $allocation_table->get_options();
$paging_bar = new paging_bar($allocation_table->get_participant_count(), $options['page'], $options['perpage'],
@@ -600,8 +592,6 @@ protected function render_mod_coursework_allocation_table(mod_coursework_allocat
$select->formid = 'sectionmenu';
$table_html .= $OUTPUT->render($select);
-
-
//get the hidden elements used for assessors and moderators selected on other pages;
$allocatable_cell_helper = $allocation_table->get_allocatable_cell();
@@ -660,8 +650,6 @@ protected function render_mod_coursework_allocation_table(mod_coursework_allocat
$table_html .= $OUTPUT->render($select);
-
-
$table_html .= $PAGE->get_renderer('mod_coursework', 'object')->render($paging_bar);
return $table_html;
@@ -694,7 +682,6 @@ protected function render_mod_coursework_allocation_table_row(mod_coursework_all
return $row;
}
-
/**
* Outputs the buttons etc to choose and trigger the auto allocation mechanism. Do this as part of the main form so we
* can choose some allocations, then click a button to auto-allocate the rest.
@@ -720,7 +707,6 @@ public function render_mod_coursework_allocation_widget(mod_coursework_allocatio
// Allow allocation method to be changed.
$html .= html_writer::label(get_string('allocationstrategy', 'mod_coursework'), 'assessorallocationstrategy');
-
$options = manager::get_allocation_classnames();
$html .= html_writer::select($options,
'assessorallocationstrategy',
@@ -739,9 +725,6 @@ public function render_mod_coursework_allocation_widget(mod_coursework_allocatio
$html .= html_writer::start_tag('div', $attributes);
$html .= html_writer::end_tag('div');
-
-
-
// Save button.
$attributes = array('name' => 'save',
'type' => 'submit',
@@ -770,14 +753,12 @@ protected function get_router() {
return router::instance();
}
-
public function render_mod_coursework_sampling_set_widget(mod_coursework_sampling_set_widget $samplingwidget) {
global $OUTPUT, $DB;
$html = html_writer::tag('h2',get_string('sampling', 'mod_coursework'));
-
$html .= html_writer::start_tag('div', array('class' => 'assessor-sampling-wrapper accordion'));
$html .= html_writer::start_tag('h3', array('id' => 'sampling_strategy_settings_header'));
@@ -786,10 +767,8 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$html .= html_writer::start_tag('div', array('class' => 'sampling-rules'));
-
// We want to allow the allocation strategy to add configuration options.
-
$html .= html_writer::start_tag('div',array('class' => 'sampling-select'));
$script = "
@@ -798,7 +777,6 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$html .= html_writer::script($script);
-
$table = new html_table();
$table->attributes['class'] = 'sampling';
$table->head = array('');
@@ -826,7 +804,6 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$html .= " ";
-
$table->head = $assessorheaders;
$assessor1cell = html_writer::start_tag('div',array('class' => 'samples_strategy'));
@@ -872,10 +849,8 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$graderules .= get_string('graderules', 'mod_coursework');
$graderules .= html_writer::end_tag('h4');
-
$graderules .= $this->get_sampling_strategy_form_elements($samplingwidget->get_coursework(), $i, $javascript);
-
$sampling_cell .= html_writer::div($graderules, '', array('id' => "assessor_{$i}_automatic_rules"));
$columndata[] = new html_table_cell($sampling_cell);
@@ -887,7 +862,6 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$html .= html_writer::table($table);
-
// End the form with save button.
$attributes = array('name' => 'save_sampling',
'type' => 'submit',
@@ -918,8 +892,6 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
";
-
-
$html .= html_writer::script($script);
$html .= html_writer::end_tag('div');
@@ -931,7 +903,6 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
return $html;
}
-
private function sampling_strategy_column($samplingwidget, $suffix = '') {
$percentage_options = array();
@@ -983,22 +954,17 @@ private function sampling_strategy_column($samplingwidget, $suffix = '') {
false,
array('id' => "assessor_{$suffix}_sampleto_{$i}", 'class' => "assessor_{$suffix} sampling_strategy_detail"));
-
$sampling_column .= html_writer::end_tag('span', '');
}
$sampling_column .= html_writer::end_tag('div');
-
$sampling_column .= html_writer::link('#',get_string('addgraderule', 'mod_coursework'),array('id' => "assessor_{$suffix}_addgradderule", 'class' => 'addgradderule sampling_strategy_detail'));
$sampling_column .= html_writer::link('#',get_string('removegraderule', 'mod_coursework'),array('id' => "assessor_{$suffix}_removegradderule", 'class' => 'removegradderule sampling_strategy_detail'));
-
$sampling_column .= html_writer::checkbox("assessor_{$suffix}_samplertopup",1,false,get_string('topupto', 'mod_coursework'),
array('id' => "assessor_{$suffix}_samplerules[]", 'class' => "assessor_{$suffix} sampling_strategy_detail"));
-
-
$sampling_column .= html_writer::select($percentage_options,
"assessor_{$suffix}_sampletopup",
$samplingwidget->get_sampling_strategy(),
@@ -1124,7 +1090,6 @@ protected function get_allocation_strategy_form_elements($coursework) {
return $html;
}
-
protected function get_sampling_strategy_form_elements($coursework, $assessor_number, $load_javascript=false) {
global $CFG, $DB;
@@ -1135,8 +1100,6 @@ protected function get_sampling_strategy_form_elements($coursework, $assessor_nu
$sampleplugins = $DB->get_records('coursework_sample_set_plugin',null, 'pluginorder');
-
-
//$fullclasspaths = glob($classdir . '/*.php');
foreach ($sampleplugins as $plugin) {
/* if (strpos($fullclassname, 'base') !== false) {
@@ -1152,14 +1115,12 @@ protected function get_sampling_strategy_form_elements($coursework, $assessor_nu
if ($load_javascript) $javascript .= $sampling_rule->add_form_elements_js($assessor_number);
-
}
return $html." ".$javascript;
}
-
/**
* @param coursework $coursework
* @param submission $submission
@@ -1320,7 +1281,6 @@ protected function coursework_deadlines_table(mod_coursework_coursework $coursew
$deadline_message .= html_writer::end_tag('div');
}
-
$table_html = '
@@ -1414,13 +1374,10 @@ protected function render_mod_coursework_personal_deadlines_table(mod_coursework
$table_html .= ''.get_string('nopersonaldeadlineforextensionwarning', 'mod_coursework').'
';
-
-
$usergroups = $personal_deadlines_table->get_coursework()->get_allocatable_type();
$table_html .= ''.html_writer::link('#', get_string('setdateforselected', 'mod_coursework', $personal_deadlines_table->get_coursework()->get_allocatable_type()), array('id' => 'selected_dates')).'
';
-
if (has_capability('mod/coursework:revertfinalised', $PAGE->context)) {
$table_html .= '' . html_writer::link('#', get_string('unfinaliseselected', 'mod_coursework', $personal_deadlines_table->get_coursework()->get_allocatable_type()), array('id' => 'selected_unfinalise')) . '
';
}
@@ -1435,7 +1392,6 @@ protected function render_mod_coursework_personal_deadlines_table(mod_coursework
$table_html .= ' ';
$table_html .= ' ';
-
$table_html .= '
@@ -1444,7 +1400,6 @@ protected function render_mod_coursework_personal_deadlines_table(mod_coursework
';
-
$allocatable_cell_helper = $personal_deadlines_table->get_allocatable_cell();
$personaldeadlines_cell_helper = $personal_deadlines_table->get_personal_deadline_cell();
$table_html .= '';
@@ -1460,8 +1415,6 @@ protected function render_mod_coursework_personal_deadlines_table(mod_coursework
$table_html .= get_string('tableheadstatus', 'mod_coursework');
$table_html .= ' ';
-
-
$table_html .= '
@@ -1482,7 +1435,6 @@ protected function render_mod_coursework_personal_deadlines_table(mod_coursework
return $table_html;
-
}
/**
@@ -1506,17 +1458,13 @@ private function render_personal_deadline_table_row($personal_deadline_row) {
$personal_deadline =
\mod_coursework\models\personal_deadline::get_personal_deadline_for_student(user::find($personal_deadline_row->get_allocatable()->id()), $coursework);
-
-
if (!$personal_deadline) {
$personal_deadline = \mod_coursework\models\personal_deadline::build($new_personal_deadline_params);
}
-
$ability = new ability(user::find($USER), $coursework);
$disabledelement = (!$personal_deadline ||($personal_deadline && $ability->can('edit', $personal_deadline)) ) ? "" : " disabled='disabled' ";
-
$row_html = '';
$row_html .= '';
$row_html .= ' ';
@@ -1530,7 +1478,6 @@ private function render_personal_deadline_table_row($personal_deadline_row) {
'setpersonaldeadlinespage' => '1'
);
-
$allocatable_cell_helper = $personal_deadline_row->get_allocatable_cell();
$personaldeadlines_cell_helper = $personal_deadline_row->get_personal_deadline_cell();
$row_html .= $allocatable_cell_helper->get_table_cell($personal_deadline_row);
@@ -1542,7 +1489,6 @@ private function render_personal_deadline_table_row($personal_deadline_row) {
return $row_html;
}
-
/**
* @param mod_coursework_coursework $coursework
* @return string
@@ -1556,7 +1502,6 @@ protected function coursework_grading_summary_table(mod_coursework_coursework $c
$warning_message = "";
$stagename = $coursework->has_multiple_markers()? ' (Agreed grade)' : '';
-
$participants = 0;
$submitted = 0;
$needsgrading = 0;
@@ -1564,7 +1509,6 @@ protected function coursework_grading_summary_table(mod_coursework_coursework $c
$finalgrade = 0;
$published = 0;
-
if (!$coursework->has_multiple_markers() && !$coursework->allocation_enabled() && !has_capability('mod/coursework:addinitialgrade', $coursework->get_context())
&& has_capability('mod/coursework:addagreedgrade', $coursework->get_context())){
@@ -1585,7 +1529,6 @@ protected function coursework_grading_summary_table(mod_coursework_coursework $c
//remove all submission with final grade
$assessable_submitted_submissions = $this->removed_final_graded_submissions($assessable_submitted_submissions);
-
//if has addagreedgrade or administergrade or addallocatedagreedgrade+initialgrade
if (has_any_capability(array('mod/coursework:addagreedgrade', 'mod/coursework:administergrades'), $coursework->get_context())
|| (has_capability('mod/coursework:addinitialgrade', $coursework->get_context()) && has_capability('mod/coursework:addallocatedagreedgrade', $coursework->get_context()))) {
@@ -1608,7 +1551,6 @@ protected function coursework_grading_summary_table(mod_coursework_coursework $c
$graded_submissions = $this->get_submissions_with_final_grade($this->get_submissions_for_assessor($coursework, $allsubmissions));
$graded = count($graded_submissions);
-
$finalgrade = $graded;
// display breakdown of marks for initial stages
if ($coursework->has_multiple_markers() && has_capability('mod/coursework:administergrades', $coursework->get_context())) {
@@ -1629,7 +1571,6 @@ protected function coursework_grading_summary_table(mod_coursework_coursework $c
}
-
// BUILD table
$table_html = '';
$table_html .= $warning_message;
@@ -1648,7 +1589,6 @@ protected function coursework_grading_summary_table(mod_coursework_coursework $c
// submissions graded and published
$table_html .= ''.get_string('gradedandpublished', 'mod_coursework').' '.$published.' ';
-
$table_html .= '
';
return $table_html;
@@ -1666,7 +1606,6 @@ public function get_allocatables_count_per_assessor($coursework){
if (!$coursework->has_multiple_markers() && has_capability('mod/coursework:addagreedgrade', $coursework->get_context()) &&
!has_capability('mod/coursework:addinitialgrade', $coursework->get_context()) ) {
-
$submissions = $coursework->get_all_submissions();
foreach($submissions as $sub) {
@@ -1698,7 +1637,6 @@ public function get_allocatables_count_per_assessor($coursework){
return $participant;
}
-
/**
* Remove submissions that have not been finalised
*
@@ -1739,7 +1677,6 @@ public function removed_final_graded_submissions($submissions) {
return $submissions;
}
-
/**
* Remove submissions that can't be graded
*
@@ -1806,7 +1743,6 @@ public function get_assessor_initial_graded_submissions($submissions) {
return $submissions;
}
-
/**
* Get submissions that have final feedback
*
@@ -1829,8 +1765,6 @@ public function get_submissions_with_final_grade($submissions){
return $submissions;
}
-
-
/**
* Get submissions an assessor can see on the grading page or will be able to mark
*
@@ -1847,7 +1781,6 @@ public function get_submissions_for_assessor($coursework, $submissions){
if (!$coursework->has_multiple_markers() && has_capability('mod/coursework:addagreedgrade', $coursework->get_context()) &&
!has_capability('mod/coursework:addinitialgrade', $coursework->get_context()) ) {
-
foreach($submissions as $sub) {
$submission = submission::find($sub);
if ( $submission->final_grade_agreed()){
@@ -1881,6 +1814,4 @@ public function get_submissions_for_assessor($coursework, $submissions){
return $gradeblesub;
}
-
-
}
diff --git a/renderers/page_renderer.php b/renderers/page_renderer.php
index 55735ec2..aae4149b 100644
--- a/renderers/page_renderer.php
+++ b/renderers/page_renderer.php
@@ -50,7 +50,6 @@ public function show_feedback_page($feedback, $ajax) {
$object_renderer = $this->get_object_renderer();
-
if (empty($ajax)) $html .= $OUTPUT->header();
$html .= $object_renderer->render_feedback($feedback);
if (empty($ajax)) $html .= $OUTPUT->header();
@@ -58,7 +57,6 @@ public function show_feedback_page($feedback, $ajax) {
return $html;
}
-
/**
* @param moderation $moderation
*/
@@ -75,7 +73,6 @@ public function show_moderation_page($moderation) {
echo $OUTPUT->footer();
}
-
/**
* Renders the HTML for the edit page
*
@@ -164,13 +161,11 @@ public function confirm_feedback_removal_page(feedback $teacher_feedback, $confi
$PAGE->set_title($SITE->fullname);
$PAGE->set_heading($SITE->fullname);
-
echo $OUTPUT->header();
echo $OUTPUT->confirm(get_string('confirmremovefeedback', 'mod_coursework'), $confirmurl, $PAGE->url);
echo $OUTPUT->footer();
}
-
/**
* Renders the HTML for the edit page
*
@@ -208,7 +203,6 @@ public function edit_moderation_page(moderation $moderator_agreement, $assessor,
$moderator_agreement->modcomment = array('text' => $moderator_agreement->modcomment,
'format' => $moderator_agreement->modcommentformat);
-
$simple_form->set_data($moderator_agreement);
echo $OUTPUT->header();
@@ -414,7 +408,6 @@ public function new_feedback_page($new_feedback , $ajax = false) {
$commentoptions = $this->get_comment_options($simple_form);
echo json_encode(['formhtml' => $html . $formhtml, 'filemanageroptions' => $filemanageroptions, 'editoroptions' => $editoroptions, 'commentoptions' => $commentoptions]);
-
} else {
$PAGE->set_pagelayout('standard');
$PAGE->navbar->add($grading_title);
@@ -427,8 +420,6 @@ public function new_feedback_page($new_feedback , $ajax = false) {
}
}
-
-
/**
*
* @param $simple_form
@@ -456,8 +447,6 @@ private function get_comment_options($simple_form) {
return $commentoptions;
}
-
-
/**
* @param moderation $new_moderation
* @throws coding_exception
@@ -490,8 +479,6 @@ public function new_moderation_page($new_moderation){
echo $OUTPUT->footer();
}
-
-
/**
* @param plagiarism_flag $new_plagiarism_flag
* @throws coding_exception
@@ -519,12 +506,8 @@ public function new_plagiarism_flag_page($new_plagiarism_flag){
$simple_form->display();
echo $OUTPUT->footer();
-
}
-
-
-
/**
* @param plagiarism_flag $plagiarism_flag
* @throws coding_exception
@@ -554,7 +537,6 @@ public function edit_plagiarism_flag_page(plagiarism_flag $plagiarism_flag, $cre
userdate($plagiarism_flag->timemodified, '%a, %d %b %Y, %H:%M') . ' ';
$html .= '
';
-
if ($submission->is_published()) {
$html .= '' . get_string('gradereleasedtostudent', 'coursework') . '
';
}
@@ -565,18 +547,14 @@ public function edit_plagiarism_flag_page(plagiarism_flag $plagiarism_flag, $cre
$plagiarism_flag->plagiarismcomment = array('text' => $plagiarism_flag->comment,
'format' => $plagiarism_flag->comment_format);
-
$simple_form->set_data($plagiarism_flag);
echo $OUTPUT->header();
echo $html;
$simple_form->display();
echo $OUTPUT->footer();
-
-
}
-
/**
* @param coursework $coursework
* @param $page
@@ -649,7 +627,6 @@ public function teacher_grading_page($coursework, $page, $perpage, $sortby, $sor
$html .= html_writer::end_div();
}
-
$finalised_submissions = submission::$pool[$coursework->id]['finalised'][1] ?? [];
if ($finalised_submissions && !empty($grading_report->get_table_rows_for_page())
&& !empty($submissions)) {
@@ -666,7 +643,6 @@ public function teacher_grading_page($coursework, $page, $perpage, $sortby, $sor
$links[$url] = get_string('exportfinalgrades', 'mod_coursework');
}
-
if (!empty($grading_report->get_table_rows_for_page()) && !empty($submissions)
&&(has_capability('mod/coursework:addinitialgrade', $PAGE->context)
|| has_capability('mod/coursework:addagreedgrade', $PAGE->context)
@@ -684,7 +660,6 @@ public function teacher_grading_page($coursework, $page, $perpage, $sortby, $sor
$links[$url] = get_string('uploadfeedbackfiles', 'mod_coursework');
}
-
// don't show dropdown if there are no submissions
if (!empty($submissions) && !empty($links)) {
$gradingactions = new url_select($links);
@@ -696,8 +671,6 @@ public function teacher_grading_page($coursework, $page, $perpage, $sortby, $sor
$html .= $warnings->filters_warning();
}
-
-
/**
* @var mod_coursework_grading_report_renderer $grading_report_renderer
*/
@@ -743,7 +716,6 @@ public function non_teacher_allocated_grading_page($coursework, $viewallstudents
if (has_capability('mod/coursework:viewallstudents', $PAGE->context)) {
-
$report_options = array();
$report_options['page'] = $viewallstudents_page;
$report_options['group'] = $group;
@@ -766,7 +738,6 @@ public function non_teacher_allocated_grading_page($coursework, $viewallstudents
$customdata = array('cmid' => $coursework->get_course_module()->id,
'displayallstudents' => $displayallstudents);
-
$displayvalue = (empty($displayallstudents)) ? 1 : 0;
$buttontext = (empty($displayallstudents)) ? get_string('showallstudents', 'coursework') : get_string('hideallstudents', 'coursework');
$buttontclass = (empty($displayallstudents)) ? 'show-students-btn' : 'hide-students-btn';
@@ -781,7 +752,6 @@ public function non_teacher_allocated_grading_page($coursework, $viewallstudents
$grading_report_renderer = $PAGE->get_renderer('mod_coursework', 'grading_report');
$html .= $grading_report_renderer->submissions_header(get_string('submissionnotallocatedtoassessor', 'coursework'));
-
/**
* @var mod_coursework_grading_report_renderer $grading_report_renderer
*/
@@ -790,11 +760,6 @@ public function non_teacher_allocated_grading_page($coursework, $viewallstudents
$html .= $grading_report_renderer->render_grading_report($grading_report, $coursework->has_multiple_markers(),true);
$html .= html_writer::end_tag('div');
-
-
-
-
-
/**
* @var mod_coursework_grading_report_renderer $grading_report_renderer
*/
@@ -804,8 +769,6 @@ public function non_teacher_allocated_grading_page($coursework, $viewallstudents
}
-
-
/**
* @param submission $submission
* @param student_submission_form $submit_form
@@ -971,8 +934,6 @@ protected function submission_as_readonly_table($submission) {
$row->cells[] = $submitted_time_cell;
$table->data[] = $row;
-
-
if ($submission->is_late() && (!$submission->has_extension() || !$submission->submitted_within_extension())) { // It was late.
// check if submission has personal deadline
@@ -1030,7 +991,6 @@ protected function submission_as_readonly_table($submission) {
}
-
/**
* @param student_submission_form $submit_form
* @param submission $own_submission
@@ -1093,7 +1053,6 @@ public function edit_submission_page($submit_form, $submission) {
$submit_form->display();
$html .= ob_get_clean();
-
echo $OUTPUT->header();
echo $html;
echo $OUTPUT->footer();
@@ -1262,7 +1221,6 @@ function csv_upload($uploadform, $csvtype) {
$html .= $title;
$html .= html_writer::end_tag('h3');
-
$html .= $uploadform->display();
$html .= $OUTPUT->footer();
@@ -1271,7 +1229,6 @@ function csv_upload($uploadform, $csvtype) {
}
-
/**
* Information about upload results, errors etc
*
@@ -1323,7 +1280,6 @@ function process_csv_upload($processingresults, $csvcontent, $csvtype) {
}
-
function feedback_upload($form) {
global $OUTPUT;
@@ -1337,7 +1293,6 @@ function feedback_upload($form) {
$html .= $title;
$html .= html_writer::end_tag('h3');
-
$html .= $form->display();
$html .= $OUTPUT->footer();
@@ -1355,12 +1310,10 @@ function process_feedback_upload($processingresults) {
$PAGE->set_pagelayout('standard');
$PAGE->navbar->add($title);
-
$html = '';
$html .= $OUTPUT->header($title);
-
$html .= html_writer::start_tag('h3');
$html .= $title;
$html .= html_writer::end_tag('h3');
@@ -1686,5 +1639,4 @@ public function modal_grading_render() {
return $html;
}
-
}
diff --git a/settings.php b/settings.php
index 7237afc5..f84c9f1c 100644
--- a/settings.php
+++ b/settings.php
@@ -39,7 +39,6 @@
$settings->add(new admin_setting_configselect('coursework_allowlatesubmissions',
$allow_late_submission_name, $allow_late_submission_description, 0, $options));
-
// Set site-wide limit on submissions sizes.
if (isset($CFG->maxbytes)) {
$submissions_header = new admin_setting_heading('submissions_header', get_string('submissions', 'mod_coursework'), '');
@@ -54,22 +53,18 @@
$settings->add($maxbytessetting);
}
-
// Submissions
$submissions_header = new admin_setting_heading('submissions_header', get_string('submissions', 'mod_coursework'), '');
$settings->add($submissions_header);
$options = array( 0 => get_string('no'), 1 => get_string('yes'));
$settings->add(new admin_setting_configselect('coursework_plagiarismflag', get_string('plagiarism_flag_enable', 'mod_coursework'), get_string('plagiarism_flag_enable_desc', 'mod_coursework'), 0, $options));
-
// Submission receipt
$submissionreceipt_header = new admin_setting_heading('submissionreceipt_header', get_string('submissionreceipt', 'mod_coursework'), '');
$settings->add($submissionreceipt_header);
$options = array( 0 => get_string('no'), 1 => get_string('yes'));
$settings->add(new admin_setting_configselect('coursework_allsubmissionreceipt', get_string('allsubmission', 'mod_coursework'), get_string('allsubmission_desc', 'mod_coursework'), 0, $options));
-
-
// Blind marking
$blindmarking_header = new admin_setting_heading('blindmarking_header', get_string('blindmarking', 'mod_coursework'), '');
$settings->add($blindmarking_header);
@@ -109,7 +104,6 @@
$settings->add(new admin_setting_configselect('coursework_auto_release_individual_feedback', $individual_feedback_auto_release_name, $individual_feedback_auto_release_name_description, 0, $options));
$settings->add(new admin_setting_configcheckbox('coursework_forceauto_release_individual_feedback', get_string('forceautoauto_release_individual_feedback', 'mod_coursework'), get_string('forceautoauto_release_individual_feedback_desc', 'mod_coursework'), 0));
-
$individualfeedbackstring = get_string('individualfeedback', 'coursework');
$configindfeedbackstring = get_string('configindividualfeedback', 'coursework');
$individualfeedbacksetting = new admin_setting_configselect('coursework_individualfeedback',
@@ -124,8 +118,6 @@
$options = array( 0 => get_string('no'), 1 => get_string('yes'));
$settings->add(new admin_setting_configselect('coursework_feedbackreleaseemail', $feedbackreleaseemail_name, $feedbackreleaseemail_description, 1, $options));
-
-
$day_reminder = array();
for ($i = 2; $i <= 7; $i++) {
$day_reminder[$i] = $i;
@@ -142,7 +134,6 @@
$settings->add(new admin_setting_configselect('coursework_day_second_reminder', $secondreminderstring,
$confsecondreminderstring, 3, $day_reminder));
-
// Sitewide message that students will see and agree to before submitting or editing.
$termsagreement_header = new admin_setting_heading('termsagreement_header', get_string('termsagreement', 'mod_coursework'), '');
$settings->add($termsagreement_header);
@@ -156,7 +147,6 @@
$settings->add(new admin_setting_confightmleditor('coursework_agree_terms_text',
$agree_terms_text, '', ''));
-
// Extensions
$extensions_header =
new admin_setting_heading('extensions_header', get_string('extensions', 'mod_coursework'), '');
@@ -168,7 +158,6 @@
$options = array( 0 => get_string('no'), 1 => get_string('yes'));
$settings->add(new admin_setting_configselect('coursework_individual_extension', $individual_extension_name, $individual_extension_description, 1, $options));
-
// Allow people to specify a list of extension reasons here so that they can be quickly chosen
$extension_list_label = get_string('extension_reasons', 'coursework');
$extension_list_description = get_string('extension_reasons_desc', 'coursework');
@@ -184,7 +173,6 @@
$options = array('3' => '3', '10' => '10', '20' => '20', '30' => '30', '40' => '40', '50' => '50', '100' => '100');
-
$grading_page_header = new admin_setting_heading('grading_page_header', get_string('grading_page', 'mod_coursework'), '');
$settings->add($grading_page_header);
@@ -202,7 +190,6 @@
$options['43200'] = get_string('timedhours', 'mod_coursework', '12');
$options['86400'] = get_string('aday', 'mod_coursework');
-
$grade_editing_header = new admin_setting_heading('grade_editing_header', get_string('grade_editing', 'mod_coursework'), '');
$settings->add($grade_editing_header);
@@ -210,12 +197,10 @@
$grade_editing_description = get_string('grade_editing_enabled_desc', 'coursework');
$settings->add(new admin_setting_configselect('coursework_grade_editing', $grade_editing_name, $grade_editing_description, '0', $options));
-
//deadline defaults
$deadline_defaults_header = new admin_setting_heading('deadline_defaults_header', get_string('deadline_defaults', 'mod_coursework'), '');
$settings->add($deadline_defaults_header);
-
//marking deadline
$options = array('0' => get_string('disabled', 'mod_coursework'));
$options['7'] = get_string('oneweekoption', 'mod_coursework');
@@ -241,7 +226,6 @@
$agreed_marking_deadline_description = get_string('agreed_marking_deadline_default_desc', 'coursework');
$settings->add(new admin_setting_configselect('coursework_agreed_marking_deadline', $agreed_marking_deadline_name, $agreed_marking_deadline_description, '0', $options));
-
//start date
$options = array('0' => get_string('disabled', 'mod_coursework'));
$options['1'] = get_string('today', 'mod_coursework');
diff --git a/tests/behat/behat_mod_coursework.php b/tests/behat/behat_mod_coursework.php
index e0ec21cf..eb0b9e06 100644
--- a/tests/behat/behat_mod_coursework.php
+++ b/tests/behat/behat_mod_coursework.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* Step definitions for the Coursework module Behat tests.
*/
@@ -266,7 +265,6 @@ private function get_first_assesor_stage() {
return reset($stages);
}
-
/**
*
*
@@ -736,8 +734,6 @@ public function iAmAllowedToViewAllStudents() {
$DB->set_field('role_capabilities', 'permission', $permission_setting, $params);
}
-
-
/**
* IMPORTANT: CI server borks if this is not done *before* the manager
* logs in!
@@ -818,7 +814,6 @@ public function iShouldNotSeeTheAddFinalFeedbackButton($negate = false) {
*/
$page = $this->get_page('multiple grading interface');
-
if ($negate) {
$page->should_not_have_add_button_for_final_feedback($this->student->id());
} else {
@@ -827,9 +822,6 @@ public function iShouldNotSeeTheAddFinalFeedbackButton($negate = false) {
}
-
-
-
/**
* @Then /^I should not see the edit final feedback button on the multiple marker page$/
*/
@@ -1068,7 +1060,6 @@ public function iAddANewExtensionForTheStudent() {
$multigrader_page = $this->get_page('multiple grading interface');
$multigrader_page->click_new_extension_button_for($this->student);
-
/**
* @var mod_coursework_behat_new_extension_page $new_extension_page
*/
@@ -1329,8 +1320,6 @@ public function running_javascript() {
return parent::running_javascript();
}
-
-
// Course steps
/**
@@ -1511,9 +1500,6 @@ public function theSitewideSettingIs($setting_name, $setting_value) {
set_config($setting_name, $setting_value);
}
-
-
-
// Allocation steps
/**
@@ -1725,7 +1711,6 @@ public function theStudentShouldBeAllocatedToAnAssessor() {
assertNotEmpty($result);
}
-
// Feedback steps
/**
@@ -2150,7 +2135,6 @@ public function iGradeTheSubmissionUsingTheSimpleForm($grade = 56, $withoutcomme
$nodeElement->selectOption($grade);
}
-
if (empty($withoutcomments)) {
$nodeElement1 = $this->find('css', '#feedback_comment');
if ($nodeElement1) {
@@ -2305,7 +2289,6 @@ public function iShouldNotSeeALinkToAddFeedback() {
$grading_interface->there_should_not_be_a_feedback_icon($this->student);
}
-
// General web steps
/**
@@ -2390,10 +2373,6 @@ public function dismiss() {
$this->find('css', ".moodle-dialogue-focused.filepicker .yui3-button.closebutton")->click();
}
-
-
-
-
// Submission steps
/**
@@ -2426,7 +2405,6 @@ public function anotherStudentHasAnotherSubmission() {
$this->other_submission = $generator->create_submission($submission, $this->coursework);
}
-
/**
* @Given /^the group has a submission$/
*/
@@ -2546,9 +2524,6 @@ public function iShouldSeeThatTheSubmissionWasMadeByTheOtherStudent($role_name)
$student_page->should_show_the_submitter_as($role_name);
}
-
-
-
// User steps
/**
@@ -2653,7 +2628,6 @@ public function iAmAMemberOfAGroup() {
$group = $generator->create_group($group);
$this->group = group::find($group);
-
$membership = new stdClass();
$membership->groupid = $this->group->id;
$membership->userid = $this->student->id;
@@ -2741,8 +2715,6 @@ public function iShouldSeeTheFirstInitialAssessorsGradeAndComment() {
$page->should_have_grade('67');
}
-
-
/**
* @return mixed
*/
@@ -2789,10 +2761,8 @@ public function iClickOnShowAllStudentsButton() {
$page->show_hide_non_allocated_students();
-
}
-
/**
*
* @When /^I enable automatic sampling for stage ([1-3])$/
@@ -2804,7 +2774,6 @@ public function IEnableAutomaticSamplingForStage($stage) {
$page->enable_atomatic_sampling_for($stage);
}
-
/**
* @Given /^I enable total rule for stage (\d+)$/
*
@@ -2816,7 +2785,6 @@ public function IEnableTotalRuleForStage($stage) {
$page->enable_total_rule_for_stage($stage);
}
-
/**
* @Given /^I add grade range rule for stage (\d+)$/
*
@@ -2841,7 +2809,6 @@ public function IEnableGradeRangeRuleForStage($ruleno, $stage) {
$page->enable_grade_range_rule_for_stage($stage, $ruleno);
}
-
/**
* @Then /^I select limit type for grade range rule (\d+) in stage (\d+) as "([\w]*)"$/
*
@@ -2856,7 +2823,6 @@ public function ISelectLimitTypeForGradeRangeRuleInStageAs($ruleno, $stage, $typ
$page->select_type_of_grade_range_rule_for_stage($stage, $ruleno, $type);
}
-
/**
* @Then /^I select "([\w]*)" grade limit for grade range rule (\d+) in stage (\d+) as "(\d+)"$/
*
@@ -2872,7 +2838,6 @@ public function ISelectGradeLimitTypeForGradeRangeRuleInStageAs($range, $ruleno,
$page->select_range_for_grade_range_rule_for_stage($range, $stage, $ruleno, $value);
}
-
/**
* @Given /^I select (\d+)% of total students in stage (\d+)$/
*
@@ -2900,7 +2865,6 @@ public function StudentAutomaticallyIncludedInSampleForStage($other, $another, $
$page->automatically_included_in_sample($this->coursework, $this->$student, $another, $stage, $negate);
}
-
/**
* @Given /^I save sampling strategy$/
*/
diff --git a/tests/behat/pages/allocations_page.php b/tests/behat/pages/allocations_page.php
index e91634f5..c9fe11f8 100644
--- a/tests/behat/pages/allocations_page.php
+++ b/tests/behat/pages/allocations_page.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
use mod_coursework\allocation\allocatable;
use mod_coursework\models\user;
@@ -30,7 +29,6 @@
require_once($CFG->dirroot . '/mod/coursework/tests/behat/pages/page_base.php');
-
/**
* Holds the functions that know about the HTML structure of the student page.
*
@@ -256,7 +254,6 @@ public function automatically_included_in_sample($coursework, $user, $other_user
AND stage_identifier = :stage
AND (allocatableid = :user $other_sql)";
-
$stage = "assessor_".$stage_number;
$params = array('courseworkid' => $coursework->id,
@@ -286,13 +283,10 @@ public function thereIsAnotherTeacher($other, $role_name) {
$this->$role_name_to_save = $this->create_user($role_name, $role_name_to_save);
}
-
public function save_sampling_strategy() {
$this->getPage()->pressButton('save_manual_sampling');
}
-
-
}
diff --git a/tests/behat/pages/coursework_page.php b/tests/behat/pages/coursework_page.php
index ceaca7d7..1e2ca213 100644
--- a/tests/behat/pages/coursework_page.php
+++ b/tests/behat/pages/coursework_page.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
use mod_coursework\allocation\allocatable;
use mod_coursework\models\user;
@@ -30,7 +29,6 @@
require_once($CFG->dirroot . '/mod/coursework/tests/behat/pages/page_base.php');
-
/**
* Holds the functions that know about the HTML structure of the student page.
*
@@ -64,7 +62,6 @@ public function confirm() {
}
}
-
public function show_hide_non_allocated_students() {
if ($this->getPage()->hasLink('Show submissions for other students')) {
$this->getPage()->clickLink('Show submissions for other students');
diff --git a/tests/behat/pages/edit_extension_page.php b/tests/behat/pages/edit_extension_page.php
index 1684b13f..95f749fa 100644
--- a/tests/behat/pages/edit_extension_page.php
+++ b/tests/behat/pages/edit_extension_page.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* Class mod_coursework_behat_new_extension_page is responsible for representing the new
* extension page and its operation for the steps in Behat tests. Any reference to the page
diff --git a/tests/behat/pages/gradebook_page.php b/tests/behat/pages/gradebook_page.php
index 0e70461a..0035ffd3 100644
--- a/tests/behat/pages/gradebook_page.php
+++ b/tests/behat/pages/gradebook_page.php
@@ -20,14 +20,12 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/mod/coursework/tests/behat/pages/page_base.php');
-
/**
* Holds the functions that know about the HTML structure of the student page.
*
diff --git a/tests/behat/pages/login_page.php b/tests/behat/pages/login_page.php
index 7fa74f3c..1cac2511 100644
--- a/tests/behat/pages/login_page.php
+++ b/tests/behat/pages/login_page.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
use Behat\Mink\Exception\ExpectationException;
defined('MOODLE_INTERNAL') || die();
@@ -29,7 +28,6 @@
require_once($CFG->dirroot . '/mod/coursework/tests/behat/pages/page_base.php');
-
/**
* Holds the functions that know about the HTML structure of the student page.
*
diff --git a/tests/behat/pages/multiple_grading_interface.php b/tests/behat/pages/multiple_grading_interface.php
index 644a501f..95e73d1b 100644
--- a/tests/behat/pages/multiple_grading_interface.php
+++ b/tests/behat/pages/multiple_grading_interface.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
use mod_coursework\allocation\allocatable;
use mod_coursework\models\coursework;
use mod_coursework\models\deadline_extension;
@@ -103,7 +102,6 @@ private function allocatable_row_id($allocatable) {
return '#allocatable_' . $this->allocatable_identifier_hash($allocatable);
}
-
/**
* @param allocatable $allocatable
* @return string
@@ -112,8 +110,6 @@ private function assessor_feedback_table_id($allocatable) {
return '#assessorfeedbacktable_' . $this->allocatable_identifier_hash($allocatable);
}
-
-
/**
* @param allocatable $allocatable
* @throws Behat\Mink\Exception\ElementException
@@ -192,15 +188,12 @@ public function press_publish_button() {
public function confirm_publish_action() {
-
-
if ($this->getPage()->hasButton('Continue')) {
$this->getPage()->pressButton('Continue');
} else {
echo "failed";
}
-
if ($this->getPage()->hasLink('Continue')) {
$this->getPage()->clickLink('Continue');
} else {
@@ -283,8 +276,6 @@ public function should_have_add_button_for_final_feedback($studentid) {
$this->should_have_css($identifier);
}
-
-
/**
* @param feedback $feedback
*/
@@ -293,7 +284,6 @@ public function should_not_have_edit_link_for_final_feedback($allocatable) {
$this->should_not_have_css($identifier);
}
-
/**
* @param submission $submission
*/
@@ -379,7 +369,6 @@ public function should_show_extension_reason_for_allocatable($student) {
$this->should_have_css($element_selector, $reasons[1]);
}
-
/**
* @param allocatable $allocatable
* @throws \Behat\Mink\Exception\ElementException
diff --git a/tests/behat/pages/new_extension_page.php b/tests/behat/pages/new_extension_page.php
index 5c968c89..55484c53 100644
--- a/tests/behat/pages/new_extension_page.php
+++ b/tests/behat/pages/new_extension_page.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* Class mod_coursework_behat_new_extension_page is responsible for representing the new
* extension page and its operation for the steps in Behat tests. Any reference to the page
@@ -50,7 +49,6 @@ public function add_active_extension($time) {
// Delegates to the field class.
$field->set_value('Extra info here');
-
$this->submit_form();
}
diff --git a/tests/behat/pages/show_feedback_page.php b/tests/behat/pages/show_feedback_page.php
index f0ae0881..1888447a 100644
--- a/tests/behat/pages/show_feedback_page.php
+++ b/tests/behat/pages/show_feedback_page.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
defined('MOODLE_INTERNAL') || die();
global $CFG;
diff --git a/tests/behat/pages/single_grading_interface.php b/tests/behat/pages/single_grading_interface.php
index 9bafa8ad..46c1db3a 100644
--- a/tests/behat/pages/single_grading_interface.php
+++ b/tests/behat/pages/single_grading_interface.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
use mod_coursework\allocation\allocatable;
use mod_coursework\models\coursework;
diff --git a/tests/behat/pages/student_page.php b/tests/behat/pages/student_page.php
index 04e1186b..77907b4e 100644
--- a/tests/behat/pages/student_page.php
+++ b/tests/behat/pages/student_page.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
defined('MOODLE_INTERNAL') || die();
global $CFG;
diff --git a/tests/behat/pages/student_submission_form.php b/tests/behat/pages/student_submission_form.php
index 36b137f0..35902fd0 100644
--- a/tests/behat/pages/student_submission_form.php
+++ b/tests/behat/pages/student_submission_form.php
@@ -20,14 +20,12 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/mod/coursework/tests/behat/pages/page_base.php');
-
/**
* Holds the functions that know about the HTML structure of the student page.
*
diff --git a/tests/classes/ability_test.php b/tests/classes/ability_test.php
index e6674e67..d105edec 100644
--- a/tests/classes/ability_test.php
+++ b/tests/classes/ability_test.php
@@ -20,8 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
-
use mod_coursework\ability;
/**
diff --git a/tests/classes/allocation/auto_allocator_test.php b/tests/classes/allocation/auto_allocator_test.php
index 91346ceb..f986409f 100644
--- a/tests/classes/allocation/auto_allocator_test.php
+++ b/tests/classes/allocation/auto_allocator_test.php
@@ -181,10 +181,6 @@ public function test_process_allocations_does_not_alter_non_manual_allocations_w
$this->assertTrue(\mod_coursework\models\allocation::exists($allocation_params));
}
-
-
-
-
private function set_coursework_to_single_marker() {
$this->coursework->update_attribute('numberofmarkers', 1);
}
diff --git a/tests/classes/allocation/form/table_processor_test.php b/tests/classes/allocation/form/table_processor_test.php
index 33d829c8..831332e7 100644
--- a/tests/classes/allocation/form/table_processor_test.php
+++ b/tests/classes/allocation/form/table_processor_test.php
@@ -25,7 +25,6 @@
global $CFG;
-
/**
* This class takes the manual data about the teachers who should be allocated to various
* students and saves it. We want to keep this separate from the processing of the auto allocations
@@ -66,7 +65,6 @@ public function setUp() {
$this->delete_all_auto_allocations_caused_by_enrol_hooks();
}
-
public function test_process_rows_makes_a_new_assessor_allocation() {
global $DB;
diff --git a/tests/classes/allocation/strategy/percentages_test.php b/tests/classes/allocation/strategy/percentages_test.php
index 3dde8599..df08c461 100644
--- a/tests/classes/allocation/strategy/percentages_test.php
+++ b/tests/classes/allocation/strategy/percentages_test.php
@@ -20,10 +20,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
global $CFG;
-
/**
* Class mod_coursework_allocation_strategy_percentages_test
* @property mixed other_teacher
diff --git a/tests/classes/allocation/strategy_test.php b/tests/classes/allocation/strategy_test.php
index 688c5574..add62025 100644
--- a/tests/classes/allocation/strategy_test.php
+++ b/tests/classes/allocation/strategy_test.php
@@ -18,7 +18,6 @@
global $CFG;
-
/**
* Unit tests for the base allocation strategy class.
* @group mod_coursework
@@ -76,5 +75,4 @@ public function test_allocate_all_ungraded() {
}
-
}
diff --git a/tests/classes/auto_grader/percentage_distance_test.php b/tests/classes/auto_grader/percentage_distance_test.php
index b5836647..bad3e472 100644
--- a/tests/classes/auto_grader/percentage_distance_test.php
+++ b/tests/classes/auto_grader/percentage_distance_test.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
namespace mod_coursework\auto_grader;
/**
diff --git a/tests/classes/controllers/deadline_extensions_controller_test.php b/tests/classes/controllers/deadline_extensions_controller_test.php
index 5cf92f82..239f5891 100644
--- a/tests/classes/controllers/deadline_extensions_controller_test.php
+++ b/tests/classes/controllers/deadline_extensions_controller_test.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* Class deadline_extensions_controller_test is responsible for testing the deadline_extensions controller
* class.
@@ -33,5 +32,4 @@ public function test_model_name() {
$this->assertEquals('deadline_extension', $controller->model_name());
}
-
}
diff --git a/tests/classes/cron_test.php b/tests/classes/cron_test.php
index 7a2f7a31..42827e22 100644
--- a/tests/classes/cron_test.php
+++ b/tests/classes/cron_test.php
@@ -96,7 +96,6 @@ public function test_admins_and_graders() {
$this->assertEquals(array($teacher), $cron_class->get_admins_and_teachers($this->coursework->get_context()));
}
-
public function test_auto_finalising_does_not_alter_time_submitted() {
$this->create_a_course();
$coursework = $this->create_a_coursework();
@@ -153,8 +152,6 @@ public function test_auto_releasing_happens_after_deadline() {
$this->assertNotEmpty($submission->reload()->firstpublished);
}
-
-
/**
* Was throwing an error when the allocatable could not be found.
*/
diff --git a/tests/classes/export/csv_test.php b/tests/classes/export/csv_test.php
index 0d0ec475..0e9247de 100644
--- a/tests/classes/export/csv_test.php
+++ b/tests/classes/export/csv_test.php
@@ -23,7 +23,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
use mod_coursework\export\csv;
use mod_coursework\models\submission;
use mod_coursework\models\deadline_extension;
@@ -39,12 +38,8 @@
*/
class csv_test extends advanced_testcase {
-
use mod_coursework\test_helpers\factory_mixin;
-
-
-
public function setUp() {
$this->resetAfterTest();
@@ -80,7 +75,6 @@ public function test_one_stage(){
$this->submission->allocatableid = $this->student->id;
$this->submission = $generator->create_submission($this->submission, $this->coursework);
-
$student = $this->student;
$assessor = $this->teacher;
$submission = $this->submission;
@@ -112,7 +106,6 @@ public function test_one_stage(){
}
-
// headers and data for csv
$csv_cells = array('name', 'username', 'submissiondate', 'submissiontime',
'submissionfileid');
@@ -125,7 +118,6 @@ public function test_one_stage(){
$csv_cells[] = 'stages';
$csv_cells[] = 'finalgrade';
-
$timestamp = date('d_m_y @ H-i');
$filename = get_string('finalgradesfor', 'coursework'). $this->coursework->name .' '.$timestamp;
$csv = new \mod_coursework\export\csv($this->coursework, $csv_cells, $filename);
@@ -136,7 +128,6 @@ public function test_one_stage(){
$assessorname = $assessor->lastname .' '. $assessor->firstname;
$assessorusername = $assessor->username;
-
$one_assessor_grades = array('0' => $studentname,
'1' => $student->username,
'2' => userdate(time(), $dateformat),
@@ -154,7 +145,6 @@ public function test_one_stage(){
$this->assertEquals($one_assessor_grades, $csv_grades);
}
-
/**
* Two stages with final agreed grade, extension not enabled
*/
@@ -172,7 +162,6 @@ public function test_two_stages(){
$this->submission->userid = $this->student->id;
$this->submission = $generator->create_submission($this->submission, $this->coursework);
-
$student = $this->student;
$assessor1 = $this->teacher;
$assessor2 = $this->other_teacher;
@@ -215,7 +204,6 @@ public function test_two_stages(){
$csv_cells[] = 'stages';
$csv_cells[] = 'finalgrade';
-
$timestamp = date('d_m_y @ H-i');
$filename = get_string('finalgradesfor', 'coursework'). $this->coursework->name .' '.$timestamp;
$csv = new \mod_coursework\export\csv($this->coursework, $csv_cells, $filename);
@@ -251,7 +239,6 @@ public function test_two_stages(){
$this->assertEquals($two_assessors_grades, $csv_grades);
}
-
/**
* Sampling enabled, student not in sample, extension not enabled
*/
@@ -294,7 +281,6 @@ public function test_student_not_in_sample(){
$csv_cells[] = 'stages';
$csv_cells[] = 'finalgrade';
-
$timestamp = date('d_m_y @ H-i');
$filename = get_string('finalgradesfor', 'coursework'). $this->coursework->name .' '.$timestamp;
$csv = new \mod_coursework\export\csv($this->coursework, $csv_cells, $filename);
@@ -306,7 +292,6 @@ public function test_student_not_in_sample(){
$assessorusername1 = $assessor1->username;
-
$grades = array('0' => $studentname,
'1' => $student->username,
'2' => userdate(time(), $dateformat),
@@ -351,14 +336,12 @@ public function test_two_students_one_in_sample(){
$submission1->allocatableid = $student1->id;
$submission1 = $generator->create_submission($submission1, $this->coursework);
-
$student2 = $this->create_a_student();
$submission2 = new stdClass();
$submission2->userid = $student2->id;
$submission2->allocatableid = $student2->id;
$submission2 = $generator->create_submission($submission2, $this->coursework);
-
// student 2 manual sampling enabled
$set_members_data = new stdClass();
$set_members_data->courseworkid = $this->coursework->id;
@@ -368,8 +351,6 @@ public function test_two_students_one_in_sample(){
$DB->insert_record('coursework_sample_set_mbrs', $set_members_data);
-
-
// Assessor one feedback for student 1
$feedback_data1 = new stdClass();
$feedback_data1->submissionid = $submission1->id;
@@ -415,7 +396,6 @@ public function test_two_students_one_in_sample(){
$csv_cells[] = 'stages';
$csv_cells[] = 'finalgrade';
-
$timestamp = date('d_m_y @ H-i');
$filename = get_string('finalgradesfor', 'coursework'). $this->coursework->name .' '.$timestamp;
$csv = new \mod_coursework\export\csv($this->coursework, $csv_cells, $filename);
@@ -474,4 +454,3 @@ public function test_two_students_one_in_sample(){
}
}
-
diff --git a/tests/classes/export/grading_sheet_download_test.php b/tests/classes/export/grading_sheet_download_test.php
index 769e8cb2..b63d5670 100644
--- a/tests/classes/export/grading_sheet_download_test.php
+++ b/tests/classes/export/grading_sheet_download_test.php
@@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
-
defined('MOODLE_INTERNAL') || die();
global $CFG;
@@ -35,7 +33,6 @@
*/
class grading_sheet_download_test extends advanced_testcase {
-
use mod_coursework\test_helpers\factory_mixin;
public function setUp() {
@@ -104,7 +101,6 @@ public function test_one_stage_no_allocations(){
public function test_two_stages_with_allocations(){
$generator = $this->getDataGenerator()->get_plugin_generator('mod_coursework');
-
/* @var mod_coursework_generator $generator */
$this->coursework = $generator->create_instance(array('course' => $this->course->id,
'grade' => 100,
@@ -130,8 +126,6 @@ public function test_two_stages_with_allocations(){
$submission2->allocatableid = $student2->id;
$submission2 = $generator->create_submission($submission2, $this->coursework);
-
-
// Assessor2 feedback for student1
$feedback_data1 = new stdClass();
$feedback_data1->submissionid = $submission1->id;
@@ -159,7 +153,6 @@ public function test_two_stages_with_allocations(){
$feedback_data3->stage_identifier = 'assessor_2';
$feedback3 = $generator->create_feedback($feedback_data3);
-
// Agreed grade feedback
$feedback_data4 = new stdClass();
$feedback_data4->submissionid = $submission2->id;
@@ -169,7 +162,6 @@ public function test_two_stages_with_allocations(){
$feedback_data4->stage_identifier = 'final_agreed_1';
$feedback4 = $generator->create_feedback($feedback_data4);
-
// headers and data for csv
$csv_cells = array('submissionid', 'submissionfileid', 'name', 'username', 'submissiontime',
'assessor1', 'assessorgrade1', 'assessorfeedback1', 'assessor2', 'assessorgrade2', 'assessorfeedback2',
@@ -221,4 +213,3 @@ public function test_two_stages_with_allocations(){
}
}
-
diff --git a/tests/classes/grade_judge_test.php b/tests/classes/grade_judge_test.php
index ec43d9a2..118b3d42 100644
--- a/tests/classes/grade_judge_test.php
+++ b/tests/classes/grade_judge_test.php
@@ -20,8 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
-
use mod_coursework\grade_judge;
/**
@@ -30,7 +28,6 @@
*/
class grade_judge_test extends advanced_testcase {
-
use mod_coursework\test_helpers\factory_mixin;
public function setUp() {
@@ -38,7 +35,6 @@ public function setUp() {
$this->resetAfterTest();
}
-
public function test_get_feedbck_that_is_promoted_to_gradebook_returns_initial_feedback() {
$coursework = $this->create_a_coursework();
$grade_judge = new grade_judge($coursework);
@@ -52,7 +48,6 @@ public function test_get_feedbck_that_is_promoted_to_gradebook_returns_initial_f
$this->assertEquals($feedback->id, $grade_judge->get_feedback_that_is_promoted_to_gradebook($submission)->id);
}
-
public function test_sampling_disabled_one_marker() {
$coursework = $this->create_a_coursework();
$grade_judge = new grade_judge($coursework);
diff --git a/tests/classes/models/coursework_test.php b/tests/classes/models/coursework_test.php
index d0d850d9..d6379574 100644
--- a/tests/classes/models/coursework_test.php
+++ b/tests/classes/models/coursework_test.php
@@ -29,7 +29,6 @@
global $CFG;
-
/**
* Class that will make sure the allocation_manager works.
*
diff --git a/tests/classes/models/moderation_set_membership_test.php b/tests/classes/models/moderation_set_membership_test.php
index 3216c8e4..6ff07bd3 100644
--- a/tests/classes/models/moderation_set_membership_test.php
+++ b/tests/classes/models/moderation_set_membership_test.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* Class coursework_user_test
* @group mod_coursework
diff --git a/tests/classes/models/submission_test.php b/tests/classes/models/submission_test.php
index afb26417..dd373995 100644
--- a/tests/classes/models/submission_test.php
+++ b/tests/classes/models/submission_test.php
@@ -29,7 +29,6 @@
global $CFG;
-
/**
* Class that will make sure the allocation_manager works.
* @group mod_coursework
@@ -180,7 +179,6 @@ public function test_publish_updates_grade_timemodified() {
$grade = $DB->get_record('grade_grades', array('itemid' => $grade_item->id, 'userid' => $student->id));
$grade_time_modified = $grade->timemodified;
-
$this->assertNotEquals($initial_time, $grade_time_modified);
}
diff --git a/tests/classes/models/user_test.php b/tests/classes/models/user_test.php
index c5ae8326..8f7d1811 100644
--- a/tests/classes/models/user_test.php
+++ b/tests/classes/models/user_test.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* Class coursework_user_test
* @group mod_coursework
@@ -103,5 +102,4 @@ public function test_has_all_initial_feedbacks_returns_false_when_all_are_presen
// get_initial_feedbacks()
-
}
diff --git a/tests/classes/rule_test.php b/tests/classes/rule_test.php
index ba58a661..c76dfb80 100644
--- a/tests/classes/rule_test.php
+++ b/tests/classes/rule_test.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
use mod_coursework\ability\rule;
/**
diff --git a/tests/classes/stages/assessor_test.php b/tests/classes/stages/assessor_test.php
index 5a313a89..d7ac0385 100644
--- a/tests/classes/stages/assessor_test.php
+++ b/tests/classes/stages/assessor_test.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* @group mod_coursework
*/
diff --git a/tests/classes/stages/final_agreed_test.php b/tests/classes/stages/final_agreed_test.php
index 8475f96b..b01e986a 100644
--- a/tests/classes/stages/final_agreed_test.php
+++ b/tests/classes/stages/final_agreed_test.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
/**
* @group mod_coursework
*/
diff --git a/tests/cron_tester.php b/tests/cron_tester.php
index 915c0aa2..2ea7a424 100644
--- a/tests/cron_tester.php
+++ b/tests/cron_tester.php
@@ -20,7 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
define('CLI_SCRIPT', true);
require_once(dirname(__FILE__).'/../../../config.php');
diff --git a/tests/generator/lib.php b/tests/generator/lib.php
index 2715bc6a..fe449eae 100644
--- a/tests/generator/lib.php
+++ b/tests/generator/lib.php
@@ -200,8 +200,6 @@ public function create_feedback($feedback) {
return $feedback;
}
-
-
/**
* Makes a submission for testing.
*
@@ -260,5 +258,4 @@ public function create_submission($submission, $coursework) {
return $submission;
}
-
}
diff --git a/tests/generator_test.php b/tests/generator_test.php
index ab34ebf4..c98e4bb8 100644
--- a/tests/generator_test.php
+++ b/tests/generator_test.php
@@ -186,5 +186,4 @@ public function test_create_submission() {
$this->assertEquals($user->id, $submission->userid);
}
-
}
diff --git a/version.php b/version.php
index f3b9fcfb..6c14b700 100644
--- a/version.php
+++ b/version.php
@@ -22,7 +22,6 @@
defined('MOODLE_INTERNAL') || die();
-
$plugin->component = 'mod_coursework';
$plugin->version = 2024080600; // If version == 0 then module will not be installed
diff --git a/view.php b/view.php
index 0eacd486..ac31d3a9 100644
--- a/view.php
+++ b/view.php
@@ -52,7 +52,6 @@
$PAGE->requires->yui_module('moodle-core-notification', 'notification_init');
-
// Course_module ID, or coursework instance ID - it should be named as the first character of the module.
$course_module_id = optional_param('id', 0, PARAM_INT);
$coursework_id = optional_param('e', 0, PARAM_INT);
@@ -72,8 +71,6 @@
$resettable = optional_param('treset', 0, PARAM_INT);
$allresettable = optional_param('alltreset', 0, PARAM_INT);
-
-
if (!isset($SESSION->displayallstudents[$course_module_id])) {
$SESSION->displayallstudents[$course_module_id] = optional_param('displayallstudents', false, PARAM_BOOL);
@@ -83,7 +80,6 @@
$SESSION->displayallstudents[$course_module_id] = $displayallstudents;
}
-
// If a session variable holding page preference for the specific coursework is not set, set default value (0).
if (isset($SESSION->perpage[$course_module_id]) && optional_param('per_page', 0, PARAM_INT) != $SESSION->perpage[$course_module_id]
&& optional_param('per_page', 0, PARAM_INT) != 0){ // prevent blank pages if not in correct page
@@ -106,7 +102,6 @@
$SESSION->perpage[$course_module_id] = $perpage;
}
-
// If a session variable holding sortby preference for the specific coursework is not set, set default value ('lastname').
if (!(isset($SESSION->sortby[$course_module_id]))) {
$SESSION->sortby[$course_module_id] = optional_param('sortby', 'lastname', PARAM_ALPHA);
@@ -152,8 +147,6 @@
$SESSION->coursework_groupname_alpha[$course_module_id] = $coursework_groupname_alpha;
}
-
-
//we will use the same defaults as page (above) defaulting to page setting if no specific viewallstudents_page has been set
if (isset($SESSION->viewallstudents_perpage[$course_module_id]) && optional_param('viewallstudents_per_page', 0, PARAM_INT) != $SESSION->viewallstudents_perpage[$course_module_id]
&& optional_param('viewallstudents_per_page', 0, PARAM_INT) != 0){ // prevent blank pages if not in correct page
@@ -221,8 +214,6 @@
$SESSION->viewallstudents_groupname_alpha[$course_module_id] = $viewallstudents_groupname_alpha;
}
-
-
if (!($sorthow === 'ASC' || $sorthow === 'DESC')) {
$sorthow = 'ASC';
}
@@ -278,7 +269,6 @@
$manual_allocation_not_complete = $warnings->manual_allocation_not_completed();
}
-
if (!empty($percentage_allocation_not_complete) || !empty($manual_allocation_not_complete)) {
$redirectdetail = new \stdClass();
@@ -309,7 +299,6 @@
send_temp_file($zip_file, $filename); // Send file and delete after sending.
}
-
if ($export_grades){
// headers and data for csv
@@ -341,13 +330,11 @@
}
$csv_cells[] = 'finalgrade';
-
$timestamp = date('d_m_y @ H-i');
$filename = get_string('finalgradesfor', 'coursework'). $coursework->name .' '.$timestamp;
$csv = new \mod_coursework\export\csv($coursework, $csv_cells, $filename);
$csv->export();
-
}
if ($download_grading_sheet){
@@ -425,7 +412,6 @@
$params['viewallstudents_per_page'] = $viewallstudents_perpage;
}
-
$PAGE->set_url('/mod/coursework/view.php', $params);
$PAGE->set_title($coursework->name);
$PAGE->set_heading($course->shortname);
@@ -441,8 +427,6 @@
$coursework->publish_grades();
}
-
-
//Create automatic feedback
if ($coursework->automaticagreement_enabled()) {
$coursework->create_automatic_feedback();
From 7b6cec1738206ee1849b42f4d210fb2a61e5aa0a Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Mon, 12 Aug 2024 12:22:10 +0100
Subject: [PATCH 11/51] CTP-3558 coding std insert space in ){
---
actions/allocate.php | 6 +-
classes/ability.php | 4 +-
classes/allocation/auto_allocator.php | 2 +-
classes/allocation/manager.php | 2 +-
classes/allocation/strategy/percentages.php | 2 +-
classes/allocation/table/cell/builder.php | 18 +--
classes/allocation/upload.php | 34 +++---
classes/assessor_feedback_row.php | 4 +-
classes/auto_grader/average_grade.php | 10 +-
.../deadline_extensions_controller.php | 12 +-
classes/controllers/feedback_controller.php | 4 +-
.../controllers/moderations_controller.php | 2 +-
.../personal_deadlines_controller.php | 4 +-
.../controllers/submissions_controller.php | 18 +--
classes/cron.php | 8 +-
classes/export/csv.php | 36 +++---
.../export/csv/cells/agreedfeedback_cell.php | 4 +-
classes/export/csv/cells/agreedgrade_cell.php | 8 +-
classes/export/csv/cells/assessor_cell.php | 6 +-
.../csv/cells/assessorfeedback_cell.php | 10 +-
.../export/csv/cells/assessorgrade_cell.php | 10 +-
classes/export/csv/cells/cell_base.php | 32 +++---
classes/export/csv/cells/email_cell.php | 6 +-
.../csv/cells/extensiondeadline_cell.php | 4 +-
.../csv/cells/extensionextrainfo_cell.php | 4 +-
.../export/csv/cells/extensionreason_cell.php | 4 +-
.../csv/cells/feedbackcomments_cell.php | 4 +-
classes/export/csv/cells/finalgrade_cell.php | 4 +-
classes/export/csv/cells/group_cell.php | 4 +-
classes/export/csv/cells/idnumber_cell.php | 6 +-
.../csv/cells/moderationagreement_cell.php | 6 +-
classes/export/csv/cells/name_cell.php | 6 +-
.../export/csv/cells/otherassessors_cell.php | 12 +-
.../csv/cells/personaldeadline_cell.php | 4 +-
.../csv/cells/plagiarismflagcomment_cell.php | 4 +-
.../csv/cells/plagiarismflagstatus_cell.php | 4 +-
classes/export/csv/cells/singlegrade_cell.php | 8 +-
classes/export/csv/cells/stages_cell.php | 24 ++--
.../export/csv/cells/submissiondate_cell.php | 4 +-
.../csv/cells/submissionfileid_cell.php | 4 +-
.../export/csv/cells/submissionid_cell.php | 4 +-
.../export/csv/cells/submissiontime_cell.php | 4 +-
classes/export/csv/cells/username_cell.php | 6 +-
classes/export/grading_sheet.php | 20 ++--
classes/export/import.php | 42 +++----
classes/file_importer.php | 4 +-
classes/forms/assessor_feedback_mform.php | 4 +-
classes/forms/deadline_extension_form.php | 8 +-
classes/forms/upload_feedback_form.php | 2 +-
classes/grade_judge.php | 2 +-
classes/grading_report.php | 4 +-
classes/grading_table_row_base.php | 4 +-
classes/models/coursework.php | 104 +++++++++---------
classes/models/feedback.php | 18 +--
classes/models/moderation.php | 8 +-
classes/models/null_user.php | 2 +-
classes/models/outstanding_marking.php | 6 +-
classes/models/personal_deadline.php | 2 +-
classes/models/plagiarism_flag.php | 4 +-
classes/models/submission.php | 44 ++++----
classes/observer.php | 18 +--
.../personal_deadline/table/row/builder.php | 2 +-
.../grading_report/cells/_user_cell.php | 2 +-
.../grading_report/cells/cell_base.php | 2 +-
.../grading_report/cells/email_cell.php | 2 +-
.../grading_report/cells/first_name_cell.php | 2 +-
.../cells/first_name_letter_cell.php | 2 +-
.../cells/grade_for_gradebook_cell.php | 4 +-
.../grading_report/cells/group_cell.php | 4 +-
.../grading_report/cells/idnumber_cell.php | 2 +-
.../grading_report/cells/last_name_cell.php | 2 +-
.../cells/last_name_letter_cell.php | 2 +-
.../cells/moderation_agreement_cell.php | 6 +-
.../grading_report/cells/moderation_cell.php | 2 +-
.../cells/multiple_agreed_grade_cell.php | 6 +-
.../cells/personal_deadline_cell.php | 4 +-
.../grading_report/cells/plagiarism_cell.php | 2 +-
.../cells/plagiarism_flag_cell.php | 6 +-
.../cells/single_assessor_feedback_cell.php | 2 +-
.../grading_report/cells/status_cell.php | 2 +-
.../grading_report/cells/submission_cell.php | 2 +-
.../cells/time_submitted_cell.php | 4 +-
.../grading_report/cells/user_cell.php | 2 +-
classes/sample_set_rule/sample_base.php | 4 +-
classes/stages/base.php | 20 ++--
classes/warnings.php | 6 +-
db/upgrade.php | 6 +-
lib.php | 66 +++++------
mod_form.php | 62 +++++------
renderers/object_renderer.php | 32 +++---
renderers/page_renderer.php | 18 +--
tests/behat/behat_mod_coursework.php | 2 +-
tests/behat/pages/allocations_page.php | 4 +-
.../pages/multiple_grading_interface.php | 2 +-
tests/classes/export/csv_test.php | 16 +--
.../export/grading_sheet_download_test.php | 4 +-
view.php | 26 ++---
97 files changed, 495 insertions(+), 495 deletions(-)
diff --git a/actions/allocate.php b/actions/allocate.php
index 9c3b47b2..f5178984 100644
--- a/actions/allocate.php
+++ b/actions/allocate.php
@@ -50,7 +50,7 @@
// options used for pagination
// If a session variable holding page preference for the specific coursework is not set, set default value (0).
if (isset($SESSION->allocate_perpage[$coursemoduleid]) && (isset($SESSION->perpage[$coursemoduleid]) && optional_param('per_page', 0, PARAM_INT) != $SESSION->perpage[$coursemoduleid])
- && optional_param('per_page', 0, PARAM_INT) != 0){ // prevent blank pages if not in correct page
+ && optional_param('per_page', 0, PARAM_INT) != 0) { // prevent blank pages if not in correct page
$page = 0;
$SESSION->allocate_page[$coursemoduleid] = $page;
} else if (!(isset($SESSION->allocate_page[$coursemoduleid]))) {
@@ -173,14 +173,14 @@
$percentage_allocation_not_complete = $warnings->percentage_allocations_not_complete();
$manual_allocation_not_complete = '';
$students_in_multiple_groups = '';
-if ($coursework->allocation_enabled()){
+if ($coursework->allocation_enabled()) {
$manual_allocation_not_complete = $warnings->manual_allocation_not_completed();
if ($coursework->use_groups == 1 || $coursework->assessorallocationstrategy == 'group_assessor') {
$students_in_multiple_groups = $warnings->students_in_mutiple_grouos();
}
}
-if ($formsavebutton && $percentage_allocation_not_complete == '' && $manual_allocation_not_complete == ''){
+if ($formsavebutton && $percentage_allocation_not_complete == '' && $manual_allocation_not_complete == '') {
redirect($CFG->wwwroot.'/mod/coursework/view.php?id='.$coursemoduleid, get_string('changessaved', 'mod_coursework'));
} elseif ($formsavebutton) {
redirect($PAGE->url);
diff --git a/classes/ability.php b/classes/ability.php
index b662b408..13dd9fcd 100644
--- a/classes/ability.php
+++ b/classes/ability.php
@@ -483,7 +483,7 @@ protected function prevent_edit_submission_past_deadline_and_no_extension() {
'mod_coursework\models\submission',
function (submission $submission) {
// take into account courseworks with personal deadlines
- if ($submission->get_coursework()->personal_deadlines_enabled()){
+ if ($submission->get_coursework()->personal_deadlines_enabled()) {
$deadline_passed = ($submission->submission_personal_deadline() < time())? true : false;
} else {
$deadline_passed = $submission->get_coursework()->deadline_has_passed();
@@ -683,7 +683,7 @@ function (moderation $moderation) {
});
}
- protected function allow_edit_moderation_if_user_can_administer_grades(){
+ protected function allow_edit_moderation_if_user_can_administer_grades() {
$this->allow('edit',
'mod_coursework\models\moderation',
function (moderation $moderation) {
diff --git a/classes/allocation/auto_allocator.php b/classes/allocation/auto_allocator.php
index c90d70a6..97b65961 100644
--- a/classes/allocation/auto_allocator.php
+++ b/classes/allocation/auto_allocator.php
@@ -49,7 +49,7 @@ public function process_allocations() {
$this->delete_all_ungraded_auto_allocations();
foreach ($this->marking_stages() as $stage) {
- if ($stage->group_assessor_enabled() && $stage->identifier() == 'assessor_1'){
+ if ($stage->group_assessor_enabled() && $stage->identifier() == 'assessor_1') {
// if allocation strategy 'group_assessor' then assign assessor from that group to stage1 and continue
// for the rest of stages with manual allocation
$allocatables = $this->get_allocatables();
diff --git a/classes/allocation/manager.php b/classes/allocation/manager.php
index d5e8f0f7..e57ba61f 100644
--- a/classes/allocation/manager.php
+++ b/classes/allocation/manager.php
@@ -122,7 +122,7 @@ public static function get_allocation_classnames($type = coursework::ASSESSOR) {
}
// move 'none' to be the first option
- if (array_key_exists('none', $options)){
+ if (array_key_exists('none', $options)) {
$new_value = array('none' => $options['none']);
unset($options['none']);
$options = $new_value + $options;
diff --git a/classes/allocation/strategy/percentages.php b/classes/allocation/strategy/percentages.php
index c1c8915c..3e957be5 100644
--- a/classes/allocation/strategy/percentages.php
+++ b/classes/allocation/strategy/percentages.php
@@ -198,7 +198,7 @@ public function save_allocation_strategy_options() {
* @param $teacher
* @return int|mixed
*/
- private function percentage_for_teacher($teacher){
+ private function percentage_for_teacher($teacher) {
global $DB;
diff --git a/classes/allocation/table/cell/builder.php b/classes/allocation/table/cell/builder.php
index 8a84b3bc..6ccc44c8 100644
--- a/classes/allocation/table/cell/builder.php
+++ b/classes/allocation/table/cell/builder.php
@@ -99,7 +99,7 @@ private function get_potential_marker_dropdown() {
/**
* @return string
*/
- private function get_potential_moderators_dropdown(){
+ private function get_potential_moderators_dropdown() {
if ($this->stage_does_not_use_allocation()) {
return '';
@@ -114,8 +114,8 @@ private function get_potential_moderators_dropdown(){
/**
* @return bool
*/
- private function has_moderation(){
- if ($this->get_submission()){
+ private function has_moderation() {
+ if ($this->get_submission()) {
return $this->get_stage()->has_moderation($this->get_submission());
} else {
return false;
@@ -140,7 +140,7 @@ private function get_feedback() {
* @return bool|\mod_coursework\models\moderation
*/
private function get_moderation() {
- if ($this->get_submission()){
+ if ($this->get_submission()) {
return $this->get_stage()->get_moderation($this->get_submission());
}
return false;
@@ -168,12 +168,12 @@ private function prepare_allocation_table_cell() {
$contents = '';
$assessor_dropdown = '';
- if ($this->coursework->sampling_enabled()){
- if ($class == 'final_agreed_1'){
+ if ($this->coursework->sampling_enabled()) {
+ if ($class == 'final_agreed_1') {
} else if ($this->get_stage()->uses_sampling()) {
- if ($this->has_automatic_sampling()){
+ if ($this->has_automatic_sampling()) {
$contents .= $this->get_automatically_in_sample_label();
$contents .= $this->sampling_hidden_checkbox();
} else {
@@ -230,7 +230,7 @@ private function prepare_allocation_table_cell() {
/**
* @return string
*/
- private function prepare_moderation_table_cell(){
+ private function prepare_moderation_table_cell() {
$contents = '';
$class = 'moderators';
@@ -436,7 +436,7 @@ private function has_final_feedback() {
'allocatableid-allocatabletype',
[$this->allocatable->id(), $this->allocatable->type()]
);
- if ($submission){
+ if ($submission) {
$feedbacks = isset(feedback::$pool[$this->coursework->id]['submissionid'][$submission->id]) ?
feedback::$pool[$this->coursework->id]['submissionid'][$submission->id] : [];
diff --git a/classes/allocation/upload.php b/classes/allocation/upload.php
index 8ae8663a..7ef9a6a5 100644
--- a/classes/allocation/upload.php
+++ b/classes/allocation/upload.php
@@ -44,7 +44,7 @@ public function __construct($coursework) {
* @return array|bool
* @throws \moodle_exception
*/
- public function validate_csv($content, $encoding, $delimeter){
+ public function validate_csv($content, $encoding, $delimeter) {
global $CFG, $DB;
$assessor_identifier = $CFG->coursework_allocation_identifier;
@@ -83,7 +83,7 @@ public function validate_csv($content, $encoding, $delimeter){
$csv_cells = array('allocatable');
$stages = $this->coursework->get_max_markers();
- for ($i=1; $i<=$stages; $i++){
+ for ($i=1; $i<=$stages; $i++) {
$csv_cells[] = 'assessor_'.$i;
}
@@ -98,9 +98,9 @@ public function validate_csv($content, $encoding, $delimeter){
// validate allocatable (user or group)
if ($cells[$keynum] == 'allocatable') {
// check if allocatable exists in the file
- if (empty($value)){$errors[$s] = get_string($allocatabletype .'namemissing', 'coursework'); break;}
+ if (empty($value)) {$errors[$s] = get_string($allocatabletype .'namemissing', 'coursework'); break;}
- if ($allocatabletype == 'user'){
+ if ($allocatabletype == 'user') {
// get user id
$suballocatable = $DB->get_record('user', array($assessor_identifier=> $value));
$allocatable = ($suballocatable)? \mod_coursework\models\user::find($suballocatable->id): '';
@@ -112,26 +112,26 @@ public function validate_csv($content, $encoding, $delimeter){
}
// check if allocatable exists in this coursework
- if (!$allocatable || !in_array($allocatable->id, $allocatables)){$errors[$s] = get_string($allocatabletype .'notincoursework', 'coursework'); break;}
+ if (!$allocatable || !in_array($allocatable->id, $allocatables)) {$errors[$s] = get_string($allocatabletype .'notincoursework', 'coursework'); break;}
// duplicate user or group
- if ($allocatable && in_array($allocatable->id, $allocatablesinfile)){$errors[$s] = get_string('duplicate'. $allocatabletype , 'coursework') ; break;}
+ if ($allocatable && in_array($allocatable->id, $allocatablesinfile)) {$errors[$s] = get_string('duplicate'. $allocatabletype , 'coursework') ; break;}
$allocatablesinfile[] = $allocatable->id;
}
// validate assessor if exists in the coursework and has one of the capabilities allowing them to grade
// in initial stage
- if (substr($cells[$keynum],0,8) == 'assessor'){
+ if (substr($cells[$keynum],0,8) == 'assessor') {
// skip empty assessors fields
- if (empty($value)){ continue;}
+ if (empty($value)) { continue;}
$assessor = $DB->get_record('user', array($assessor_identifier=> $value));
- if (!$assessor ||!in_array($assessor->id, $assessors)){$errors[$s] = get_string('assessornotincoursework', 'coursework', $keynum ); continue;}
+ if (!$assessor ||!in_array($assessor->id, $assessors)) {$errors[$s] = get_string('assessornotincoursework', 'coursework', $keynum ); continue;}
// check if current assessor is not already allocated for this allocatable in different stage
// or is not already in the file in previous stage
if ($assessor && ($this->coursework->assessor_has_allocation_for_student_not_in_current_stage($allocatable, $assessor->id, $cells[$keynum])
- || in_array($assessor->id, $assessorsinfile))){
+ || in_array($assessor->id, $assessorsinfile))) {
$errors[$s] = get_string('assessoralreadyallocated', 'coursework', $keynum); continue;
}
$assessorsinfile[] = $assessor->id;
@@ -155,7 +155,7 @@ public function validate_csv($content, $encoding, $delimeter){
* @return array|bool
* @throws \moodle_exception
*/
- public function process_csv($content, $encoding, $delimiter, $processingresults){
+ public function process_csv($content, $encoding, $delimiter, $processingresults) {
global $CFG, $DB, $PAGE;
@@ -186,7 +186,7 @@ public function process_csv($content, $encoding, $delimiter, $processingresults)
$s = 0;
$csv_cells = array('allocatable');
$stages = $this->coursework->get_max_markers();
- for ($i=1; $i<=$stages; $i++){
+ for ($i=1; $i<=$stages; $i++) {
$csv_cells[] = 'assessor_'.$i;
}
@@ -209,7 +209,7 @@ public function process_csv($content, $encoding, $delimiter, $processingresults)
// get allocatable
if ($cells[$keynum] == 'allocatable') {
- if ($allocatabletype == 'user'){
+ if ($allocatabletype == 'user') {
// get user id
$suballocatable = $DB->get_record('user', array($assessor_identifier=> $value));
$allocatable = ($suballocatable)? \mod_coursework\models\user::find($suballocatable->id): '';
@@ -220,7 +220,7 @@ public function process_csv($content, $encoding, $delimiter, $processingresults)
$allocatable = ($suballocatable)? \mod_coursework\models\group::find($suballocatable->id): '';
}
}
- if (substr($cells[$keynum],0,8) == 'assessor' && !(empty($value))){
+ if (substr($cells[$keynum],0,8) == 'assessor' && !(empty($value))) {
$assessor = $DB->get_record('user', array($assessor_identifier=> $value));
@@ -231,7 +231,7 @@ public function process_csv($content, $encoding, $delimiter, $processingresults)
$allocation = $DB->get_record('coursework_allocation_pairs', $params);
- if (!$allocation){
+ if (!$allocation) {
// create allocation
$this->add_allocation($assessor->id, $cells[$keynum], $allocatable);
@@ -266,7 +266,7 @@ public function process_csv($content, $encoding, $delimiter, $processingresults)
* @param $allocatabletype
* @return bool|int
*/
- public function add_allocation($assessorid, $stage_identifier, $allocatable){
+ public function add_allocation($assessorid, $stage_identifier, $allocatable) {
global $DB;
$add_allocation = new \stdClass();
@@ -291,7 +291,7 @@ public function add_allocation($assessorid, $stage_identifier, $allocatable){
* @param $assessorid
* @return bool
*/
- public function update_allocation($allocationid, $assessorid){
+ public function update_allocation($allocationid, $assessorid) {
global $DB;
$update_allocation = new \stdClass();
diff --git a/classes/assessor_feedback_row.php b/classes/assessor_feedback_row.php
index 114078ae..ab044f03 100644
--- a/classes/assessor_feedback_row.php
+++ b/classes/assessor_feedback_row.php
@@ -113,7 +113,7 @@ public function get_assessor() {
*
* @return user
*/
- public function get_graded_by(){
+ public function get_graded_by() {
return $this->get_feedback()->assessor();
}
@@ -121,7 +121,7 @@ public function get_graded_by(){
* Gets the grader's name and link to the profile
* @return string
*/
- public function get_graders_name(){
+ public function get_graders_name() {
return $this->get_graded_by()->profile_link();
}
diff --git a/classes/auto_grader/average_grade.php b/classes/auto_grader/average_grade.php
index 8641f5b6..149f166b 100644
--- a/classes/auto_grader/average_grade.php
+++ b/classes/auto_grader/average_grade.php
@@ -53,7 +53,7 @@ class average_grade implements auto_grader {
* @param coursework $coursework
* @param allocatable $allocatable
*/
- public function __construct($coursework, $allocatable){
+ public function __construct($coursework, $allocatable) {
$this->coursework = $coursework;
$this->roundingrule = $this->coursework->roundingrule;
$this->allocatable = $allocatable;
@@ -64,7 +64,7 @@ public function __construct($coursework, $allocatable){
* state of the initial assessor grades and make an automatic grade if they do.
*
*/
- public function create_auto_grade_if_rules_match(){
+ public function create_auto_grade_if_rules_match() {
// bounce out if conditions are not right/
if (!$this->get_allocatable()->has_all_initial_feedbacks($this->get_coursework())) {
@@ -98,7 +98,7 @@ private function get_coursework() {
/**
* @return int
*/
- private function automatic_grade(){
+ private function automatic_grade() {
$grades = $this->grades_as_percentages();
@@ -124,7 +124,7 @@ private function automatic_grade(){
/**
* @return allocatable
*/
- private function get_allocatable(){
+ private function get_allocatable() {
return $this->allocatable;
}
@@ -143,7 +143,7 @@ private function create_final_feedback() {
/**
*
*/
- private function update_final_feedback($feedback){
+ private function update_final_feedback($feedback) {
global $DB;
$updated_feedback = new \stdClass();
diff --git a/classes/controllers/deadline_extensions_controller.php b/classes/controllers/deadline_extensions_controller.php
index 9a395338..2f50d882 100644
--- a/classes/controllers/deadline_extensions_controller.php
+++ b/classes/controllers/deadline_extensions_controller.php
@@ -166,7 +166,7 @@ protected function set_default_current_deadline() {
$this->deadline_extension = deadline_extension::build($params);
// Default to current deadline
// check for personal deadline first o
- if ($this->coursework->personaldeadlineenabled){
+ if ($this->coursework->personaldeadlineenabled) {
$personal_deadline = $DB->get_record('coursework_person_deadlines', $params);
if ($personal_deadline) {
$this->coursework->deadline = $personal_deadline->personal_deadline;
@@ -220,7 +220,7 @@ public function ajax_submit_mitigation($data_params) {
}
}
- public function validation($data){
+ public function validation($data) {
global $CFG;
$max_deadline = $CFG->coursework_max_extension_deadline;
@@ -237,7 +237,7 @@ public function validation($data){
return false;
}
- public function submission_exists($data){
+ public function submission_exists($data) {
global $DB;
return $DB->record_exists('coursework_submissions', array(
@@ -247,7 +247,7 @@ public function submission_exists($data){
));
}
- public function personal_deadline(){
+ public function personal_deadline() {
global $DB;
$extensionid = optional_param('id', 0, PARAM_INT);
@@ -328,7 +328,7 @@ public function ajax_edit_mitigation($data_params) {
echo json_encode($response);
}
- public function ajax_new_mitigation($data_params){
+ public function ajax_new_mitigation($data_params) {
global $USER, $DB;
$response = [];
$this->coursework = coursework::find(['id' => $this->params['courseworkid']]);
@@ -345,7 +345,7 @@ public function ajax_new_mitigation($data_params){
$ability->require_can('new', $deadline_extension);
$time_content = '';
$time = '';
- if ($this->coursework->deadline){
+ if ($this->coursework->deadline) {
$personal_deadline = $DB->get_record('coursework_person_deadlines', $params);
if ($personal_deadline) {
$time_content = 'Personal deadline: ' . userdate($personal_deadline->personal_deadline);
diff --git a/classes/controllers/feedback_controller.php b/classes/controllers/feedback_controller.php
index 5a0c3abd..2e237c6a 100644
--- a/classes/controllers/feedback_controller.php
+++ b/classes/controllers/feedback_controller.php
@@ -332,7 +332,7 @@ protected function update_feedback() {
$coursework_page_url = $this->get_path('coursework', array('coursework' => $teacherfeedback->get_coursework()));
// remove feedback comments and associated feedback files if 'Remove feedback' button pressed
- if ($this->params['remove']){
+ if ($this->params['remove']) {
if (!$this->params['confirm']) {
$urlparams = array('confirm' => $this->params['confirm'],
@@ -535,7 +535,7 @@ protected function check_stage_permissions($identifier) {
$stage = $this->coursework->get_stage($identifier);
if (!$stage->user_is_assessor($USER)) {
if (!(has_capability('mod/coursework:administergrades', $this->coursework->get_context()) ||
- has_capability('mod/coursework:addallocatedagreedgrade', $this->coursework->get_context())) ){
+ has_capability('mod/coursework:addallocatedagreedgrade', $this->coursework->get_context())) ) {
throw new access_denied($this->coursework, 'You are not authorised to add feedback at this stage');
}
}
diff --git a/classes/controllers/moderations_controller.php b/classes/controllers/moderations_controller.php
index 38dd520f..16cfdbcf 100644
--- a/classes/controllers/moderations_controller.php
+++ b/classes/controllers/moderations_controller.php
@@ -257,7 +257,7 @@ protected function check_stage_permissions($identifier) {
$stage = $this->coursework->get_stage($identifier);
if (!$stage->user_is_moderator($USER)) {
- if (!(has_capability('mod/coursework:moderate', $this->coursework->get_context()) ) ){
+ if (!(has_capability('mod/coursework:moderate', $this->coursework->get_context()) ) ) {
throw new access_denied($this->coursework, 'You are not authorised to moderte this feedback');
}
}
diff --git a/classes/controllers/personal_deadlines_controller.php b/classes/controllers/personal_deadlines_controller.php
index cd499491..18db9b61 100644
--- a/classes/controllers/personal_deadlines_controller.php
+++ b/classes/controllers/personal_deadlines_controller.php
@@ -158,7 +158,7 @@ protected function set_default_current_deadline() {
* Get the personal deadline
* @return mixed
*/
- protected function get_personal_deadline(){
+ protected function get_personal_deadline() {
global $DB;
$params = array(
'allocatableid' => $this->params['allocatableid'],
@@ -177,7 +177,7 @@ protected function get_personal_deadline(){
* @throws \moodle_exception
* @throws \require_login_exception
*/
- public function insert_update($time){
+ public function insert_update($time) {
global $USER;
if (!$this->validated($time)) {
return [
diff --git a/classes/controllers/submissions_controller.php b/classes/controllers/submissions_controller.php
index 8d151b81..873d67c6 100644
--- a/classes/controllers/submissions_controller.php
+++ b/classes/controllers/submissions_controller.php
@@ -102,7 +102,7 @@ protected function create_submission() {
$validated = $this->new_submission();
- if ($validated == true){
+ if ($validated == true) {
return;
}
@@ -117,12 +117,12 @@ protected function create_submission() {
$submission->timesubmitted = time();
// Automatically finalise any submissions that's past the deadline/personal deadline and doesn't have valid extension
- if ($this->coursework->personal_deadlines_enabled()){
+ if ($this->coursework->personal_deadlines_enabled()) {
// Check is submission has a valid personal deadline or a valid extension
if (!$this->has_valid_personal_deadline($submission) && !$this->has_valid_extension($submission)) {
$submission->finalised = 1;
}
- } elseif ($this->coursework->deadline_has_passed() && !$this->has_valid_extension($submission)){
+ } elseif ($this->coursework->deadline_has_passed() && !$this->has_valid_extension($submission)) {
$submission->finalised = 1;
}
@@ -132,7 +132,7 @@ protected function create_submission() {
if (!$ability->can('create', $submission)) {
// if submission already exists, redirect user to cw instead of throwing an error
- if ($this->submissions_exists($submission)){
+ if ($this->submissions_exists($submission)) {
redirect($CFG->wwwroot.'/mod/coursework/view.php?id='.$this->coursemodule->id, $ability->get_last_message());
} else {
throw new access_denied($this->coursework, $ability->get_last_message());
@@ -241,7 +241,7 @@ protected function update_submission() {
$validated = $this->edit_submission();
- if ($validated == true){
+ if ($validated == true) {
return;
}
@@ -399,7 +399,7 @@ protected function check_coursework_is_open($coursework) {
*/
private function exception_if_late($submission) {
$could_have_submitted = has_capability('mod/coursework:submit', $this->coursework->get_context());
- if ($this->coursework->personal_deadlines_enabled()){
+ if ($this->coursework->personal_deadlines_enabled()) {
$deadline_has_passed = !$this->has_valid_personal_deadline($submission);
} else {
$deadline_has_passed = $this->coursework->deadline_has_passed();
@@ -414,7 +414,7 @@ private function exception_if_late($submission) {
* param submission $submission
* return bool true if a matching record exists, else false
*/
- protected function submissions_exists($submission){
+ protected function submissions_exists($submission) {
global $DB;
$sub_exists = $DB->record_exists('coursework_submissions',
@@ -429,7 +429,7 @@ protected function submissions_exists($submission){
* @param $submission
* @return bool
*/
- protected function has_valid_extension($submission){
+ protected function has_valid_extension($submission) {
global $DB;
$valid_extension = false;
@@ -451,7 +451,7 @@ protected function has_valid_extension($submission){
* @param $submission
* @return bool
*/
- protected function has_valid_personal_deadline($submission){
+ protected function has_valid_personal_deadline($submission) {
global $DB;
$valid_personal_deadline = false;
diff --git a/classes/cron.php b/classes/cron.php
index 6f8fa469..da6fd4d7 100644
--- a/classes/cron.php
+++ b/classes/cron.php
@@ -98,16 +98,16 @@ private static function send_reminders_to_students() {
$individual_extension = false;
$personal_deadline = false;
- if ($coursework->extensions_enabled()){
+ if ($coursework->extensions_enabled()) {
$individual_extension = \mod_coursework\models\deadline_extension::get_extension_for_student($student, $coursework);
}
- if ($coursework->personal_deadlines_enabled()){
+ if ($coursework->personal_deadlines_enabled()) {
$personal_deadline = \mod_coursework\models\personal_deadline::get_personal_deadline_for_student($student, $coursework);
}
$deadline = $personal_deadline ? $personal_deadline->personal_deadline : $coursework->deadline;
- if ($individual_extension){
+ if ($individual_extension) {
// check if 1st reminder is due to be sent but has not been sent yet
if ($coursework->due_to_send_first_reminders($individual_extension->extended_deadline) &&
$student->has_not_been_sent_reminder($coursework, 1, $individual_extension->extended_deadline)) {
@@ -417,7 +417,7 @@ private static function autorelease_feedbacks_where_the_release_date_has_passed(
* @param $context
* @return array
*/
- public static function get_admins_and_teachers($context){
+ public static function get_admins_and_teachers($context) {
$graders = get_enrolled_users($context, 'mod/coursework:addinitialgrade');
$managers = get_enrolled_users($context, 'mod/coursework:addagreedgrade');
diff --git a/classes/export/csv.php b/classes/export/csv.php
index 4f53ae72..147cc4fa 100644
--- a/classes/export/csv.php
+++ b/classes/export/csv.php
@@ -67,7 +67,7 @@ public function __construct($coursework, $csv_cells, $filename) {
/**
* @throws \coding_exception
*/
- public function export(){
+ public function export() {
$this->csvexport = new csv_export_writer();
$this->add_filename($this->filename);
@@ -85,7 +85,7 @@ public function export(){
usort($submissions, array($this, "sort_by_lastname"));
// loop through each submission in the coursework
- foreach ($submissions as $submission){
+ foreach ($submissions as $submission) {
// add data to cvs
$data = $this->add_csv_data($submission);
$csv_data = array_merge($csv_data, $data);
@@ -104,25 +104,25 @@ public function export(){
* @param $csv_cells
* @return array
*/
- public function add_cells_to_array($submission, $student, $csv_cells){
+ public function add_cells_to_array($submission, $student, $csv_cells) {
$row = array();
foreach($csv_cells as $csv_cell) {
- if (substr($csv_cell,0,8) == 'assessor'){
+ if (substr($csv_cell,0,8) == 'assessor') {
$stage_dentifier = 'assessor_'.(substr($csv_cell,-1));
$csv_cell = substr($csv_cell, 0, -1);
}
$class = "mod_coursework\\export\\csv\\cells\\".$csv_cell."_cell";
$cell = new $class($this->coursework);
- if (substr($csv_cell,0,8) == 'assessor'){
+ if (substr($csv_cell,0,8) == 'assessor') {
$cell = $cell->get_cell($submission, $student, $stage_dentifier);
- if (is_array($cell)){
+ if (is_array($cell)) {
$row = array_merge($row, $cell);
} else {
$row[] = $cell;
}
- } else if ($csv_cell != 'stages' && $csv_cell != 'moderationagreement' && $csv_cell != 'otherassessors'){
+ } else if ($csv_cell != 'stages' && $csv_cell != 'moderationagreement' && $csv_cell != 'otherassessors') {
$cell = $cell->get_cell($submission, $student, false);
- if (is_array($cell)){
+ if (is_array($cell)) {
$row = array_merge($row, $cell);
} else{
$row[] = $cell;
@@ -141,18 +141,18 @@ public function add_cells_to_array($submission, $student, $csv_cells){
* create headers for CSV
* @param $csv_headers
*/
- public function add_headers($csv_headers){
+ public function add_headers($csv_headers) {
$headers = array();
foreach($csv_headers as $header) {
- if (substr($header,0,8) == 'assessor'){
+ if (substr($header,0,8) == 'assessor') {
$stage = (substr($header,-1));
$header = substr($header, 0, -1);
}
$class = "mod_coursework\\export\\csv\\cells\\".$header."_cell";
$cell = new $class($this->coursework);
- if (substr($header,0,8) == 'assessor'){
+ if (substr($header,0,8) == 'assessor') {
$head = $cell->get_header($stage);
- if (is_array($head)){
+ if (is_array($head)) {
$headers = array_merge($headers, $head);
} else{
$headers[$header.$stage] = $head;
@@ -160,7 +160,7 @@ public function add_headers($csv_headers){
} else if ($header != 'stages' && $header != 'moderationagreement' && $header != 'otherassessors' ) {
$head = $cell->get_header(false);
- if (is_array($head)){
+ if (is_array($head)) {
$headers = array_merge($headers, $head);
} else{
$headers[$header] = $head;
@@ -180,7 +180,7 @@ public function add_headers($csv_headers){
* @param $filename
* @return string
*/
- public function add_filename($filename){
+ public function add_filename($filename) {
$filename = clean_filename($filename);
return $this->csvexport->filename = $filename.'.csv';
@@ -192,7 +192,7 @@ public function add_filename($filename){
* @param $b
* @return int
*/
- protected function sort_by_lastname($a, $b){
+ protected function sort_by_lastname($a, $b) {
return strcmp($a->lastname, $b->lastname);
@@ -202,7 +202,7 @@ protected function sort_by_lastname($a, $b){
* @param array $csv_data
*/
private function add_data_to_csv($csv_data) {
- foreach ($csv_data as $data){
+ foreach ($csv_data as $data) {
$this->csvexport->add_data($data);
}
}
@@ -233,7 +233,7 @@ public function get_submissions($groupid = null, $selected_submission_ids = '')
* @param submission $submission
* @return array
*/
- public function add_csv_data($submission){
+ public function add_csv_data($submission) {
$csv_data = array();
// retrieve all students (even if group coursework)
@@ -246,7 +246,7 @@ public function add_csv_data($submission){
return $csv_data;
}
- public function other_assessors_cells(){
+ public function other_assessors_cells() {
$cells = 0;
if ($this->coursework->is_using_rubric()) {
diff --git a/classes/export/csv/cells/agreedfeedback_cell.php b/classes/export/csv/cells/agreedfeedback_cell.php
index 6f3750fa..2830f565 100644
--- a/classes/export/csv/cells/agreedfeedback_cell.php
+++ b/classes/export/csv/cells/agreedfeedback_cell.php
@@ -38,7 +38,7 @@ class agreedfeedback_cell extends cell_base{
* @return string
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
return $gradedata[] = $submission->get_agreed_grade() == false ? '' : strip_tags($submission->get_agreed_grade()->feedbackcomment);
}
@@ -47,7 +47,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
return get_string('agreedgradefeedback', 'coursework');
}
diff --git a/classes/export/csv/cells/agreedgrade_cell.php b/classes/export/csv/cells/agreedgrade_cell.php
index dac0b988..d7ad1134 100644
--- a/classes/export/csv/cells/agreedgrade_cell.php
+++ b/classes/export/csv/cells/agreedgrade_cell.php
@@ -38,10 +38,10 @@ class agreedgrade_cell extends cell_base{
* @return array|mixed|null|string
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
$agreedgrade = $submission->get_agreed_grade();
- if ($this->coursework->is_using_rubric() && $this->coursework->finalstagegrading != 1){
+ if ($this->coursework->is_using_rubric() && $this->coursework->finalstagegrading != 1) {
$gradedata = array();
$this->get_rubric_scores_gradedata($agreedgrade, $gradedata); // multiple parts are handled here
} else {
@@ -56,7 +56,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return array|mixed|string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
if ($this->coursework->is_using_rubric() && $this->coursework->finalstagegrading != 1) {
$strings = array();
@@ -89,7 +89,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
if (!$this->coursework->is_using_rubric() || ($this->coursework->is_using_rubric() && $this->coursework->finalstagegrading == 1)) {
$gradejudge = new grade_judge($this->coursework);
- if (!$gradejudge->grade_in_scale($value)){
+ if (!$gradejudge->grade_in_scale($value)) {
$errormsg = get_string('valuenotincourseworkscale', 'coursework');
if (is_numeric($value)) {
// if scale is numeric get max allowed scale
diff --git a/classes/export/csv/cells/assessor_cell.php b/classes/export/csv/cells/assessor_cell.php
index 3f1ee19c..3438a781 100644
--- a/classes/export/csv/cells/assessor_cell.php
+++ b/classes/export/csv/cells/assessor_cell.php
@@ -35,13 +35,13 @@ class assessor_cell extends cell_base{
* @return string
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
$assessor = '';
$allocation = $this->coursework->get_assessor_allocation($submission, $stage_identifier );
if ($allocation) {
$assessor = $this->get_assessor_name($allocation->assessorid);
- } else if ($this->coursework->sampling_enabled()){
+ } else if ($this->coursework->sampling_enabled()) {
$assessor = 'Not in sample';
}
return $assessor;
@@ -52,7 +52,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
return get_string('assessorcsv', 'coursework', $stage);
}
diff --git a/classes/export/csv/cells/assessorfeedback_cell.php b/classes/export/csv/cells/assessorfeedback_cell.php
index d8bdebb7..1a15946f 100644
--- a/classes/export/csv/cells/assessorfeedback_cell.php
+++ b/classes/export/csv/cells/assessorfeedback_cell.php
@@ -37,12 +37,12 @@ class assessorfeedback_cell extends cell_base{
* @return string
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
global $USER;
$grade = $submission->get_assessor_feedback_by_stage($stage_identifier);
- if ($grade){
+ if ($grade) {
// check if user can see initial grades before all of them are completed
$ability = new ability(user::find($USER), $this->coursework);
@@ -70,7 +70,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
return get_string('assessorfeedbackcsv', 'coursework', $stage);
}
@@ -137,12 +137,12 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
//check for coursework without allocations - with/without samplings
if (has_capability('mod/coursework:addinitialgrade', $PAGE->context) && !has_capability('mod/coursework:editinitialgrade', $PAGE->context)
- && $this->coursework->get_max_markers() > 1 && !$this->coursework->allocation_enabled()){
+ && $this->coursework->get_max_markers() > 1 && !$this->coursework->allocation_enabled()) {
// check how many feedbacks for this submission
$feedbacks = $DB->count_records('coursework_feedbacks',array('submissionid' => $submissionid));
- if ($this->coursework->sampling_enabled()){
+ if ($this->coursework->sampling_enabled()) {
// check how many sample assessors + add 1 that is always in sample
$in_sample = $submission->get_submissions_in_sample();
$assessors = ($in_sample)? sizeof($in_sample) + 1 : 1;
diff --git a/classes/export/csv/cells/assessorgrade_cell.php b/classes/export/csv/cells/assessorgrade_cell.php
index 4e450e49..decc7d1d 100644
--- a/classes/export/csv/cells/assessorgrade_cell.php
+++ b/classes/export/csv/cells/assessorgrade_cell.php
@@ -39,7 +39,7 @@ class assessorgrade_cell extends cell_base{
* @return string
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
global $USER;
@@ -56,7 +56,7 @@ public function get_cell($submission, $student, $stage_identifier){
if (($submission->get_agreed_grade() || ($feedback && $ability->can('show', $feedback))) || !$submission->any_editable_feedback_exists() || is_siteadmin($USER->id)) {
- if ($this->coursework->is_using_rubric()){
+ if ($this->coursework->is_using_rubric()) {
$gradedata = array();
$this->get_rubric_scores_gradedata($grade, $gradedata); // multiple parts are handled here
} else{
@@ -66,7 +66,7 @@ public function get_cell($submission, $student, $stage_identifier){
} else {
- if ($this->coursework->is_using_rubric()){
+ if ($this->coursework->is_using_rubric()) {
$criterias = $this->coursework->get_rubric_criteria();
foreach ($criterias as $criteria) { // rubrics can have multiple parts, so let's create header for each of it
$gradedata['assessor'.$stage_identifier.'_'.$criteria['id']] = get_string('grade_hidden_manager', 'mod_coursework');
@@ -86,7 +86,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
if ($this->coursework->is_using_rubric() ) {
$strings = array();
@@ -121,7 +121,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
if (!$this->coursework->is_using_rubric()) {
$gradejudge = new grade_judge($this->coursework);
- if (!$gradejudge->grade_in_scale($value)){
+ if (!$gradejudge->grade_in_scale($value)) {
$errormsg = get_string('valuenotincourseworkscale', 'coursework');
if (is_numeric($value)) {
// if scale is numeric get max allowed scale
diff --git a/classes/export/csv/cells/cell_base.php b/classes/export/csv/cells/cell_base.php
index 86626086..c5f1e63e 100644
--- a/classes/export/csv/cells/cell_base.php
+++ b/classes/export/csv/cells/cell_base.php
@@ -73,7 +73,7 @@ public function can_view_hidden() {
* @param $student
* @return bool
*/
- public function extension_exists($student){
+ public function extension_exists($student) {
$extension = $this->extension->get_extension_for_student($student, $this->coursework);
@@ -85,7 +85,7 @@ public function extension_exists($student){
* @param $student
* @return string
*/
- public function get_extension_date_for_csv($student){
+ public function get_extension_date_for_csv($student) {
$extension = $this->extension->get_extension_for_student($student, $this->coursework);
@@ -97,7 +97,7 @@ public function get_extension_date_for_csv($student){
* @param $student
* @return string
*/
- public function get_extension_extra_info_for_csv($student){
+ public function get_extension_extra_info_for_csv($student) {
$extension = $this->extension->get_extension_for_student($student, $this->coursework);
@@ -109,7 +109,7 @@ public function get_extension_extra_info_for_csv($student){
* @param $student
* @return string
*/
- public function get_extension_reason_for_csv($student){
+ public function get_extension_reason_for_csv($student) {
$extension = $this->extension->get_extension_for_student($student, $this->coursework);
$extension_reasons = $this->get_extension_predefined_reasons();
@@ -122,7 +122,7 @@ public function get_extension_reason_for_csv($student){
* Function to get all pre-defined extension reasons
* @return array
*/
- public function get_extension_predefined_reasons(){
+ public function get_extension_predefined_reasons() {
return $this->coursework->extension_reasons();
}
@@ -131,7 +131,7 @@ public function get_extension_predefined_reasons(){
* @param $submission
* @return bool
*/
- public function plagiarism_flagged($submission){
+ public function plagiarism_flagged($submission) {
$flag = $this->plagiarismflag->get_plagiarism_flag($submission);
@@ -143,7 +143,7 @@ public function plagiarism_flagged($submission){
* @param $submission
* @return string
*/
- public function get_plagiarism_flag_status_for_csv($submission){
+ public function get_plagiarism_flag_status_for_csv($submission) {
$flag = $this->plagiarismflag->get_plagiarism_flag($submission);
@@ -155,7 +155,7 @@ public function get_plagiarism_flag_status_for_csv($submission){
* @param $submission
* @return string
*/
- public function get_plagiarism_flag_comment_for_csv($submission){
+ public function get_plagiarism_flag_comment_for_csv($submission) {
$flag = $this->plagiarismflag->get_plagiarism_flag($submission);
@@ -167,7 +167,7 @@ public function get_plagiarism_flag_comment_for_csv($submission){
* @param $grade
* @return null
*/
- public function get_actual_grade($grade){
+ public function get_actual_grade($grade) {
$judge = new grade_judge($this->coursework);
@@ -179,7 +179,7 @@ public function get_actual_grade($grade){
* @param $assessorid
* @return string
*/
- public function get_assessor_name($assessorid){
+ public function get_assessor_name($assessorid) {
global $DB;
$assessor = $DB->get_record('user',array('id' => $assessorid), 'firstname, lastname');
@@ -204,9 +204,9 @@ public function get_assessor_username($assessorid) {
* Function to get a message if submission was made withihn the deadline
* @param submission $submission
*/
- protected function submission_time($submission){
+ protected function submission_time($submission) {
- if ($submission->is_late() && (!$submission->has_extension() || !$submission->submitted_within_extension())){
+ if ($submission->is_late() && (!$submission->has_extension() || !$submission->submitted_within_extension())) {
$time = get_string('late', 'coursework');
} else {
$time = get_string('ontime', 'mod_coursework');
@@ -221,11 +221,11 @@ protected function submission_time($submission){
* @param $student
* @return string
*/
- public function get_stage_identifier_for_assessor($submission, $student){
+ public function get_stage_identifier_for_assessor($submission, $student) {
global $DB, $USER;
$stageidentifier = '';
- if ($this->coursework->allocation_enabled()){
+ if ($this->coursework->allocation_enabled()) {
$stageidentifier = $this->coursework->get_assessors_stage_identifier($student->id, $USER->id);
} else if ($this->coursework->get_max_markers()>1) {
// get existing feedback
@@ -250,7 +250,7 @@ public function get_stage_identifier_for_assessor($submission, $student){
* Function to validate cell for the file upload
* @return mixed
*/
- public function validate_cell($value, $submissions, $stage_dentifier='', $uploadedgradecells = array()){
+ public function validate_cell($value, $submissions, $stage_dentifier='', $uploadedgradecells = array()) {
return true;
}
@@ -258,7 +258,7 @@ public function validate_cell($value, $submissions, $stage_dentifier='', $upload
* @param $grade
* @param $gradedata
*/
- public function get_rubric_scores_gradedata($grade, &$gradedata){
+ public function get_rubric_scores_gradedata($grade, &$gradedata) {
if ($grade) {
diff --git a/classes/export/csv/cells/email_cell.php b/classes/export/csv/cells/email_cell.php
index 79d31770..f40ebeb8 100644
--- a/classes/export/csv/cells/email_cell.php
+++ b/classes/export/csv/cells/email_cell.php
@@ -35,9 +35,9 @@ class email_cell extends cell_base {
* @return string
* @throws \coding_exception
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
- if ($this->can_view_hidden() || $submission->is_published()){
+ if ($this->can_view_hidden() || $submission->is_published()) {
$name = $student->email;
} else {
$name = get_string('hidden', 'coursework');
@@ -51,7 +51,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
return get_string('email');
}
}
diff --git a/classes/export/csv/cells/extensiondeadline_cell.php b/classes/export/csv/cells/extensiondeadline_cell.php
index cd181265..c8644568 100644
--- a/classes/export/csv/cells/extensiondeadline_cell.php
+++ b/classes/export/csv/cells/extensiondeadline_cell.php
@@ -33,7 +33,7 @@ class extensiondeadline_cell extends cell_base {
* @param $stage_identifier
* @return string
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
if ($this->extension_exists($student)) {
$deadline = $this->get_extension_date_for_csv($student);
@@ -48,7 +48,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
return get_string('extensiondeadline', 'coursework');
}
diff --git a/classes/export/csv/cells/extensionextrainfo_cell.php b/classes/export/csv/cells/extensionextrainfo_cell.php
index bed161d4..bb57a8a1 100644
--- a/classes/export/csv/cells/extensionextrainfo_cell.php
+++ b/classes/export/csv/cells/extensionextrainfo_cell.php
@@ -33,7 +33,7 @@ class extensionextrainfo_cell extends cell_base {
* @param $stage_identifier
* @return string
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
if ($this->extension_exists($student)) {
$extra_info = $this->get_extension_extra_info_for_csv($student);
@@ -48,7 +48,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
return get_string('extensionextrainfo', 'coursework');
}
diff --git a/classes/export/csv/cells/extensionreason_cell.php b/classes/export/csv/cells/extensionreason_cell.php
index 4696d891..e7ca00a3 100644
--- a/classes/export/csv/cells/extensionreason_cell.php
+++ b/classes/export/csv/cells/extensionreason_cell.php
@@ -33,7 +33,7 @@ class extensionreason_cell extends cell_base {
* @param $stage_identifier
* @return string
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
if ($this->extension_exists($student)) {
$reason = $this->get_extension_reason_for_csv($student);
@@ -48,7 +48,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
return get_string('extensionreason', 'coursework');
}
diff --git a/classes/export/csv/cells/feedbackcomments_cell.php b/classes/export/csv/cells/feedbackcomments_cell.php
index d88dd04b..6742c3b4 100644
--- a/classes/export/csv/cells/feedbackcomments_cell.php
+++ b/classes/export/csv/cells/feedbackcomments_cell.php
@@ -38,7 +38,7 @@ class feedbackcomments_cell extends cell_base {
* @param $stage_identifier
* @return string
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
$stage_identifier = ($this->coursework->get_max_markers() == 1) ? "assessor_1" : $this->get_stage_identifier_for_assessor($submission, $student);
$grade = $submission->get_assessor_feedback_by_stage($stage_identifier);
@@ -50,7 +50,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
return get_string('feedbackcomment', 'coursework');
}
diff --git a/classes/export/csv/cells/finalgrade_cell.php b/classes/export/csv/cells/finalgrade_cell.php
index 23dfac7b..12588f77 100644
--- a/classes/export/csv/cells/finalgrade_cell.php
+++ b/classes/export/csv/cells/finalgrade_cell.php
@@ -34,7 +34,7 @@ class finalgrade_cell extends cell_base {
* @param $stage_identifier
* @return null|string
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
return $submission->get_final_grade() == false || $submission->editable_final_feedback_exist()? '' : $this->get_actual_grade($submission->get_final_grade());
@@ -45,7 +45,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
return get_string('provisionalgrade', 'coursework');
}
diff --git a/classes/export/csv/cells/group_cell.php b/classes/export/csv/cells/group_cell.php
index 8f653dc4..599f76a3 100644
--- a/classes/export/csv/cells/group_cell.php
+++ b/classes/export/csv/cells/group_cell.php
@@ -33,7 +33,7 @@ class group_cell extends cell_base {
* @param $stage_identifier
* @return mixed
*/
- public function get_cell($submission, $group, $stage_identifier){
+ public function get_cell($submission, $group, $stage_identifier) {
return $group->name;
}
@@ -42,7 +42,7 @@ public function get_cell($submission, $group, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
return get_string('group', 'coursework');
}
}
diff --git a/classes/export/csv/cells/idnumber_cell.php b/classes/export/csv/cells/idnumber_cell.php
index 8ed7a328..422cdfbb 100644
--- a/classes/export/csv/cells/idnumber_cell.php
+++ b/classes/export/csv/cells/idnumber_cell.php
@@ -35,9 +35,9 @@ class idnumber_cell extends cell_base {
* @return string
* @throws \coding_exception
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
- if ($this->can_view_hidden() || $submission->is_published()){
+ if ($this->can_view_hidden() || $submission->is_published()) {
$name = $student->idnumber;
} else {
$name = get_string('hidden', 'coursework');
@@ -51,7 +51,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
return get_string('idnumber');
}
}
diff --git a/classes/export/csv/cells/moderationagreement_cell.php b/classes/export/csv/cells/moderationagreement_cell.php
index 4272fa12..3ada6dfa 100644
--- a/classes/export/csv/cells/moderationagreement_cell.php
+++ b/classes/export/csv/cells/moderationagreement_cell.php
@@ -35,7 +35,7 @@ class moderationagreement_cell extends cell_base {
* @param $stage_identifier
* @return array
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
global $DB;
$data = array();
@@ -76,10 +76,10 @@ public function get_cell($submission, $student, $stage_identifier){
* @return array
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
$fields = array();
- if ($this->coursework->allocation_enabled()){
+ if ($this->coursework->allocation_enabled()) {
$fields['allocatedmoderatorname'] = 'Allocated moderator name';
$fields['allocatedmoderatorusername'] = 'Allocated moderator username';
}
diff --git a/classes/export/csv/cells/name_cell.php b/classes/export/csv/cells/name_cell.php
index 290ae3db..23b4b17a 100644
--- a/classes/export/csv/cells/name_cell.php
+++ b/classes/export/csv/cells/name_cell.php
@@ -35,9 +35,9 @@ class name_cell extends cell_base {
* @return string
* @throws \coding_exception
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
- if ($this->can_view_hidden() || $submission->is_published()){
+ if ($this->can_view_hidden() || $submission->is_published()) {
$name = $student->lastname . ' ' . $student->firstname;
} else {
$name = get_string('hidden', 'coursework');
@@ -51,7 +51,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
return get_string('studentname', 'coursework');
}
}
diff --git a/classes/export/csv/cells/otherassessors_cell.php b/classes/export/csv/cells/otherassessors_cell.php
index e8f976c1..330d2a16 100644
--- a/classes/export/csv/cells/otherassessors_cell.php
+++ b/classes/export/csv/cells/otherassessors_cell.php
@@ -38,7 +38,7 @@ class otherassessors_cell extends cell_base{
* @param $stage_identifier
* @return null|string
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
global $DB, $USER;
// find out current user stage identifier
@@ -60,10 +60,10 @@ public function get_cell($submission, $student, $stage_identifier){
$gradedata = array();
// $stage_identifier = ($this->coursework->get_max_markers() == 1) ? "assessor_1" : $this->get_stage_identifier_for_assessor($submission, $student);
- foreach($feedbacks as $feedback){
+ foreach($feedbacks as $feedback) {
$grade = $submission->get_assessor_feedback_by_stage($feedback->stage_identifier);
- if ($grade){
+ if ($grade) {
// skip if you are allocated but someone else graded it
$allocation = $submission->get_assessor_allocation_by_stage($feedback->stage_identifier);
if ($allocation && $allocation->assessorid == $USER->id) continue;
@@ -71,7 +71,7 @@ public function get_cell($submission, $student, $stage_identifier){
if ((($ability->can('show', $feedback) || has_capability('mod/coursework:addallocatedagreedgrade', $submission->get_coursework()->get_context())) &&
(!$submission->any_editable_feedback_exists() && count($submission->get_assessor_feedbacks()) <= $submission->max_number_of_feedbacks())) || is_siteadmin($USER->id)) {
- if ($this->coursework->is_using_rubric()){
+ if ($this->coursework->is_using_rubric()) {
$this->get_rubric_scores_gradedata($grade, $gradedata); // multiple parts are handled here
} else {
$gradedata[] = $this->get_actual_grade($grade->grade);
@@ -86,7 +86,7 @@ public function get_cell($submission, $student, $stage_identifier){
} else {
- if ($this->coursework->is_using_rubric()){
+ if ($this->coursework->is_using_rubric()) {
$criterias = $this->coursework->get_rubric_criteria();
foreach ($criterias as $criteria) { // rubrics can have multiple parts, so let's create header for each of it
$gradedata['assessor' . $stage_identifier . '_' . $criteria['id']] = get_string('grade_hidden_manager', 'mod_coursework');
@@ -130,7 +130,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
$fields = array();
diff --git a/classes/export/csv/cells/personaldeadline_cell.php b/classes/export/csv/cells/personaldeadline_cell.php
index 88ebb34d..f316a137 100644
--- a/classes/export/csv/cells/personaldeadline_cell.php
+++ b/classes/export/csv/cells/personaldeadline_cell.php
@@ -33,7 +33,7 @@ class personaldeadline_cell extends cell_base {
* @param $stage_identifier
* @return string
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
$personal_deadline = $submission->submission_personal_deadline();
@@ -45,7 +45,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
return get_string('personal_deadline', 'coursework');
}
diff --git a/classes/export/csv/cells/plagiarismflagcomment_cell.php b/classes/export/csv/cells/plagiarismflagcomment_cell.php
index 5397f6df..f7a93314 100644
--- a/classes/export/csv/cells/plagiarismflagcomment_cell.php
+++ b/classes/export/csv/cells/plagiarismflagcomment_cell.php
@@ -33,7 +33,7 @@ class plagiarismflagcomment_cell extends cell_base {
* @param $stage_identifier
* @return string
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
if ($this->plagiarism_flagged($submission)) {
$flag = $this->get_plagiarism_flag_comment_for_csv($submission);
@@ -48,7 +48,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
return get_string('plagiarismcomment', 'coursework');
}
diff --git a/classes/export/csv/cells/plagiarismflagstatus_cell.php b/classes/export/csv/cells/plagiarismflagstatus_cell.php
index f6f8c504..fdb399e7 100644
--- a/classes/export/csv/cells/plagiarismflagstatus_cell.php
+++ b/classes/export/csv/cells/plagiarismflagstatus_cell.php
@@ -33,7 +33,7 @@ class plagiarismflagstatus_cell extends cell_base {
* @param $stage_identifier
* @return string
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
if ($this->plagiarism_flagged($submission)) {
$flag = $this->get_plagiarism_flag_status_for_csv($submission);
@@ -48,7 +48,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
return get_string('plagiarismstatus', 'coursework');
}
diff --git a/classes/export/csv/cells/singlegrade_cell.php b/classes/export/csv/cells/singlegrade_cell.php
index 5aa68ccd..a087d9e8 100644
--- a/classes/export/csv/cells/singlegrade_cell.php
+++ b/classes/export/csv/cells/singlegrade_cell.php
@@ -38,12 +38,12 @@ class singlegrade_cell extends cell_base{
* @param $stage_identifier
* @return array|mixed|null|string
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
$stage_identifier = ($this->coursework->get_max_markers() == 1) ? "assessor_1" : $this->get_stage_identifier_for_assessor($submission, $student);
$grade = $submission->get_assessor_feedback_by_stage($stage_identifier);
- if ($this->coursework->is_using_rubric()){
+ if ($this->coursework->is_using_rubric()) {
$gradedata = array();
$this->get_rubric_scores_gradedata($grade, $gradedata); // multiple parts are handled here
} else {
@@ -58,7 +58,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return array|mixed|string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
if ($this->coursework->is_using_rubric()) {
$strings = array();
@@ -84,7 +84,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
if (!empty($value) && !$this->coursework->is_using_rubric()) {
$gradejudge = new grade_judge($this->coursework);
- if (!$gradejudge->grade_in_scale($value)){
+ if (!$gradejudge->grade_in_scale($value)) {
$errormsg = get_string('valuenotincourseworkscale', 'coursework');
if (is_numeric($value)) {
// if scale is numeric get max allowed scale
diff --git a/classes/export/csv/cells/stages_cell.php b/classes/export/csv/cells/stages_cell.php
index 348e93f6..21a4eeec 100644
--- a/classes/export/csv/cells/stages_cell.php
+++ b/classes/export/csv/cells/stages_cell.php
@@ -34,7 +34,7 @@ class stages_cell extends cell_base {
* @param $stage_identifier
* @return array
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
global $DB;
$timecreated = 0;
@@ -48,7 +48,7 @@ public function get_cell($submission, $student, $stage_identifier){
$gradedata = array();
// go through each stage and get a grade, if grade not present then put a placeholder
- for ($i = 1; $i <= $this->stages; $i++){
+ for ($i = 1; $i <= $this->stages; $i++) {
$stage_identifier = 'assessor_'.$i;
$grade = $submission->get_assessor_feedback_by_stage($stage_identifier);
@@ -57,7 +57,7 @@ public function get_cell($submission, $student, $stage_identifier){
if ($allocation) {
$gradedata[] = $this->get_assessor_name($allocation->assessorid);
$gradedata[] = $this->get_assessor_username($allocation->assessorid);
- } else if ($i != 1 && $this->coursework->sampling_enabled() && !$submission->sampled_feedback_exists()){
+ } else if ($i != 1 && $this->coursework->sampling_enabled() && !$submission->sampled_feedback_exists()) {
$gradedata[] = get_string('notincludedinsample', 'mod_coursework');
$gradedata[] = get_string('notincludedinsample', 'mod_coursework');
} else {
@@ -66,11 +66,11 @@ public function get_cell($submission, $student, $stage_identifier){
}
}
- if ($this->coursework->is_using_advanced_grading() && $this->coursework->is_using_rubric()){
+ if ($this->coursework->is_using_advanced_grading() && $this->coursework->is_using_rubric()) {
$this->get_rubric_scores_gradedata($grade, $gradedata);
}
- if ($grade){
+ if ($grade) {
$gradedata[] = $this->get_actual_grade($grade->grade);
$gradedata[] = $this->get_assessor_name($grade->assessorid);
$gradedata[] = $this->get_assessor_username($grade->assessorid);
@@ -85,8 +85,8 @@ public function get_cell($submission, $student, $stage_identifier){
if ($this->stages >= 2) { // if there are two or more stages for a submission, we will have agreed grade
$grade = $submission->get_assessor_feedback_by_stage('final_agreed_1');
- if ($this->coursework->is_using_advanced_grading() && $this->coursework->is_using_rubric()){
- if ($this->coursework->is_using_advanced_grading()){
+ if ($this->coursework->is_using_advanced_grading() && $this->coursework->is_using_rubric()) {
+ if ($this->coursework->is_using_advanced_grading()) {
$this->get_rubric_scores_gradedata($grade, $gradedata);
}
}
@@ -112,7 +112,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return array
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
$fields = array();
@@ -122,9 +122,9 @@ public function get_header($stage){
$fields['allocated' . $i . 'userame'] = 'Allocated assessor ' . $i . ' username';
}
- if ($this->coursework->is_using_advanced_grading() && $this->coursework->is_using_rubric()){
+ if ($this->coursework->is_using_advanced_grading() && $this->coursework->is_using_rubric()) {
$criteria = $this->coursework->get_rubric_criteria();
- foreach ($criteria as $id => $record){
+ foreach ($criteria as $id => $record) {
$fields['assessor' .$i. 'description' . $id] = 'Assessor '. $i . ' - '.$record['description'];
$fields['assessor' .$i. 'description' . $id . 'comment'] = 'Comment for: Assessor '. $i . ' - '.$record['description'];
}
@@ -137,9 +137,9 @@ public function get_header($stage){
}
if ($this->stages >= 2) { // if there are two or more stages for a submission, we will have agreed grade
- if ($this->coursework->is_using_advanced_grading() && $this->coursework->is_using_rubric()){
+ if ($this->coursework->is_using_advanced_grading() && $this->coursework->is_using_rubric()) {
$criteria = $this->coursework->get_rubric_criteria();
- foreach ($criteria as $id => $record){
+ foreach ($criteria as $id => $record) {
$fields['agreedgrade_description_' . $id] = 'Agreed grade - '.$record['description'];
$fields['agreedgrade_description_' . $id. 'comment'] = 'Comment for: Agreed grade - '.$record['description'];
}
diff --git a/classes/export/csv/cells/submissiondate_cell.php b/classes/export/csv/cells/submissiondate_cell.php
index 55e0d21a..cf173e10 100644
--- a/classes/export/csv/cells/submissiondate_cell.php
+++ b/classes/export/csv/cells/submissiondate_cell.php
@@ -34,7 +34,7 @@ class submissiondate_cell extends cell_base {
* @param $stage_identifier
* @return string
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
return userdate($submission->time_submitted(), $this->dateformat);
}
@@ -43,7 +43,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
return get_string('submissiondate', 'coursework');
}
diff --git a/classes/export/csv/cells/submissionfileid_cell.php b/classes/export/csv/cells/submissionfileid_cell.php
index 7dc44eed..c83462dd 100644
--- a/classes/export/csv/cells/submissionfileid_cell.php
+++ b/classes/export/csv/cells/submissionfileid_cell.php
@@ -33,7 +33,7 @@ class submissionfileid_cell extends cell_base {
* @param $stage_identifier
* @return string
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
return $this->coursework->get_username_hash($submission->allocatableid);
}
@@ -42,7 +42,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
return get_string('submissionfileid', 'coursework');
}
diff --git a/classes/export/csv/cells/submissionid_cell.php b/classes/export/csv/cells/submissionid_cell.php
index d88ece98..297887e8 100644
--- a/classes/export/csv/cells/submissionid_cell.php
+++ b/classes/export/csv/cells/submissionid_cell.php
@@ -33,7 +33,7 @@ class submissionid_cell extends cell_base {
* @param $stage_identifier
* @return mixed
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
return $submission->id;
}
@@ -42,7 +42,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
return get_string('submissionid', 'coursework');
}
diff --git a/classes/export/csv/cells/submissiontime_cell.php b/classes/export/csv/cells/submissiontime_cell.php
index 58cc4b41..a7452bdf 100644
--- a/classes/export/csv/cells/submissiontime_cell.php
+++ b/classes/export/csv/cells/submissiontime_cell.php
@@ -33,7 +33,7 @@ class submissiontime_cell extends cell_base {
* @param $stage_identifier
* @return string
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
return $this->submission_time($submission);
}
@@ -42,7 +42,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
return get_string('submissiontime', 'coursework');
}
diff --git a/classes/export/csv/cells/username_cell.php b/classes/export/csv/cells/username_cell.php
index 21125011..fa4ce0cc 100644
--- a/classes/export/csv/cells/username_cell.php
+++ b/classes/export/csv/cells/username_cell.php
@@ -35,9 +35,9 @@ class username_cell extends cell_base {
* @return string
* @throws \coding_exception
*/
- public function get_cell($submission, $student, $stage_identifier){
+ public function get_cell($submission, $student, $stage_identifier) {
- if ($this->can_view_hidden() || $submission->is_published()){
+ if ($this->can_view_hidden() || $submission->is_published()) {
$username = $student->username;
} else {
$username = get_string('hidden', 'coursework');
@@ -51,7 +51,7 @@ public function get_cell($submission, $student, $stage_identifier){
* @return string
* @throws \coding_exception
*/
- public function get_header($stage){
+ public function get_header($stage) {
return get_string('studentusername', 'coursework');
}
diff --git a/classes/export/grading_sheet.php b/classes/export/grading_sheet.php
index 8e71ada4..a65be569 100644
--- a/classes/export/grading_sheet.php
+++ b/classes/export/grading_sheet.php
@@ -23,7 +23,7 @@
class grading_sheet extends csv{
- public function get_submissions($groupid = null, $selected_submission_ids = ''){
+ public function get_submissions($groupid = null, $selected_submission_ids = '') {
global $PAGE, $USER;
$params = array(
'courseworkid' => $this->coursework->id
@@ -33,12 +33,12 @@ public function get_submissions($groupid = null, $selected_submission_ids = ''){
// remove unfinalised submissions
foreach ($submissions as $submission) {
- if ($submission->get_state() < $submission::FINALISED){
+ if ($submission->get_state() < $submission::FINALISED) {
unset($submissions[$submission->id]);
}
}
- if (is_siteadmin($USER->id)){
+ if (is_siteadmin($USER->id)) {
return $submissions;
}
@@ -114,11 +114,11 @@ public function get_submissions($groupid = null, $selected_submission_ids = ''){
* @param submission $submission
* @return array
*/
- public function add_csv_data($submission){
+ public function add_csv_data($submission) {
$csv_data = array();
// groups
- if ($this->coursework->is_configured_to_have_group_submissions()){
+ if ($this->coursework->is_configured_to_have_group_submissions()) {
$group = \mod_coursework\models\group::find($submission->allocatableid);
$csv_data[] = $this->add_cells_to_array($submission, $group, $this->csv_cells);
@@ -141,13 +141,13 @@ public function add_csv_data($submission){
* @return array
* @throws \coding_exception
*/
- public static function cells_array($coursework){
+ public static function cells_array($coursework) {
global $PAGE;
// headers and data for csv
$csv_cells = array('submissionid', 'submissionfileid');
- if ($coursework->is_configured_to_have_group_submissions()){
+ if ($coursework->is_configured_to_have_group_submissions()) {
$csv_cells[] = 'group';
} else {
$csv_cells[] = 'name';
@@ -159,7 +159,7 @@ public static function cells_array($coursework){
// based on capabilities decide what view display - singlegrade or multiplegrade
if ((has_capability('mod/coursework:addagreedgrade', $PAGE->context) || has_capability('mod/coursework:administergrades', $PAGE->context))
- && $coursework->get_max_markers()>1 ){
+ && $coursework->get_max_markers()>1 ) {
for($i = 1; $i <= $coursework->get_max_markers(); $i++) {
// extra column with allocated assessor name
if ($coursework->allocation_enabled() && $coursework->get_max_markers() > 1
@@ -173,7 +173,7 @@ public static function cells_array($coursework){
$csv_cells[] = 'agreedgrade';
$csv_cells[] = 'agreedfeedback';
- } else if (has_capability('mod/coursework:addallocatedagreedgrade', $PAGE->context) && $coursework->get_max_markers() >1){
+ } else if (has_capability('mod/coursework:addallocatedagreedgrade', $PAGE->context) && $coursework->get_max_markers() >1) {
$csv_cells[] = 'singlegrade';
$csv_cells[] = 'feedbackcomments';
@@ -184,7 +184,7 @@ public static function cells_array($coursework){
$csv_cells[] = 'agreedfeedback';
} else if (has_capability('mod/coursework:addinitialgrade', $PAGE->context)
- || has_capability('mod/coursework:administergrades', $PAGE->context)){
+ || has_capability('mod/coursework:administergrades', $PAGE->context)) {
// if (!$coursework->is_using_rubric()) {
$csv_cells[] = 'singlegrade';
diff --git a/classes/export/import.php b/classes/export/import.php
index 3ce8a8d7..6c15614a 100644
--- a/classes/export/import.php
+++ b/classes/export/import.php
@@ -32,7 +32,7 @@
class import extends grading_sheet{
- public function validate_submissionfileid(){
+ public function validate_submissionfileid() {
$submissions = $this->get_submissions();
@@ -103,7 +103,7 @@ public function validate_csv($content, $encoding, $delimeter, $csv_cells) {
$stage_identifier = $this->get_stage_identifier($submissionid, $cells[$i]);
// remove numbers from cell names so they can be dynamically validated
- if (substr($cells[$i],0,8) == 'assessor'){
+ if (substr($cells[$i],0,8) == 'assessor') {
$cells[$i] = substr($cells[$i], 0, -1);
}
@@ -259,7 +259,7 @@ function get_rubric_headers($csvheader) {
* @return array|bool
* @throws \moodle_exception
*/
- public function process_csv($content, $encoding, $delimiter, $csv_cells, $processingresults){
+ public function process_csv($content, $encoding, $delimiter, $csv_cells, $processingresults) {
global $DB, $PAGE, $USER;
@@ -369,7 +369,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
}
// check for initial grade capability otherwise ignore it
if ($stage != 'final_agreed_1' && (!has_capability('mod/coursework:addinitialgrade', $PAGE->context)) &&
- (!has_capability('mod/coursework:administergrades', $PAGE->context))){
+ (!has_capability('mod/coursework:administergrades', $PAGE->context))) {
continue;
}
@@ -386,9 +386,9 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
}
// if sampling enabled check if this grade should be included in sample
- if ($this->coursework->sampling_enabled() && $stage != 'final_agreed_1'){
+ if ($this->coursework->sampling_enabled() && $stage != 'final_agreed_1') {
$in_sample = $submission->get_submissions_in_sample_by_stage($stage);
- if (!$in_sample && $stage != 'assessor_1'){
+ if (!$in_sample && $stage != 'assessor_1') {
continue;
}
}
@@ -563,11 +563,11 @@ function get_value_rubric_levelid($criteria, $value) {
* @param $stage_identifier
* @return bool|int
*/
- public function add_grade($submissionid, $grade, $feedback, $stage_identifier, $uses_rubric=false){
+ public function add_grade($submissionid, $grade, $feedback, $stage_identifier, $uses_rubric=false) {
global $DB, $USER;
// workout markernumber
- if ($stage_identifier == 'assessor_1'){
+ if ($stage_identifier == 'assessor_1') {
// assessor_1 is always marker 1
$markernumber = 1;
} else {
@@ -621,7 +621,7 @@ public function add_grade($submissionid, $grade, $feedback, $stage_identifier, $
* @param $stage_identifier
* @return mixed
*/
- public function get_coursework_feedback_id($submissionid, $stage_identifier){
+ public function get_coursework_feedback_id($submissionid, $stage_identifier) {
global $DB;
$record = $DB->get_record('coursework_feedbacks', array('submissionid' => $submissionid,
@@ -639,7 +639,7 @@ public function get_coursework_feedback_id($submissionid, $stage_identifier){
* @param $feedback
* @return bool]
*/
- public function edit_grade($cwfeedbackid, $grade, $feedback, $uses_rubric=false){
+ public function edit_grade($cwfeedbackid, $grade, $feedback, $uses_rubric=false) {
global $DB, $USER;
if (!$uses_rubric) {
@@ -659,7 +659,7 @@ public function edit_grade($cwfeedbackid, $grade, $feedback, $uses_rubric=false)
// update record only if the value of grade or feedback is changed
$current_feedback = $DB->get_record('coursework_feedbacks', array('id' => $cwfeedbackid));
- if ($current_feedback->grade != $grade || strip_tags($current_feedback->feedbackcomment) != $feedback){
+ if ($current_feedback->grade != $grade || strip_tags($current_feedback->feedbackcomment) != $feedback) {
$edit_grade = new \stdClass();
$edit_grade->id = $cwfeedbackid;
@@ -702,7 +702,7 @@ public function get_stage_identifier($submissionid, $cell_identifier) {
//double marked - singlegrade - allocated
if ($this->coursework->get_max_markers()>1 && ($cell_identifier == 'singlegrade' || $cell_identifier == 'feedbackcomments')
- && $this->coursework->allocation_enabled()){
+ && $this->coursework->allocation_enabled()) {
$dbrecord = $DB->get_record('coursework_allocation_pairs',
array('courseworkid' => $this->coursework->id,
@@ -715,7 +715,7 @@ public function get_stage_identifier($submissionid, $cell_identifier) {
//double marked - singlegrade - notallocated
if ($this->coursework->get_max_markers()>1 && ($cell_identifier == 'singlegrade' || $cell_identifier == 'feedbackcomments')
- && !$this->coursework->allocation_enabled()){
+ && !$this->coursework->allocation_enabled()) {
// if any part of initial submission graded by the user then get stage_identifier from feedback
// else workout
@@ -726,7 +726,7 @@ public function get_stage_identifier($submissionid, $cell_identifier) {
$record = $DB->get_record_sql($sql);
if (!empty($record)) {
$stage_identifier = $record->stage_identifier;
- }else if (!$this->coursework->sampling_enabled()){ //samplings disabled
+ }else if (!$this->coursework->sampling_enabled()) { //samplings disabled
// workout if any stage is still available
$sql = "SELECT count(*) as graded FROM {coursework_feedbacks}
WHERE submissionid = $submissionid
@@ -737,20 +737,20 @@ public function get_stage_identifier($submissionid, $cell_identifier) {
$stage = $record->graded+1;
$stage_identifier = 'assessor_' . $stage;
}
- } else if ($this->coursework->sampling_enabled()){ // samplings enabled
+ } else if ($this->coursework->sampling_enabled()) { // samplings enabled
$in_sample = ($subs = $submission->get_submissions_in_sample()) ? sizeof($subs) : 0;
$feedback = $DB->record_exists('coursework_feedbacks', array('submissionid' => $submissionid,
'stage_identifier' => 'assessor_1'));
// no sample or no feedback for sample yet
- if (!$in_sample || ($in_sample && !$feedback)){
+ if (!$in_sample || ($in_sample && !$feedback)) {
$stage_identifier = 'assessor_1';
} else { // find out which sample wasn't graded yet
$samples = $submission->get_submissions_in_sample();
- foreach ($samples as $sample){
+ foreach ($samples as $sample) {
$feedback = $DB->record_exists('coursework_feedbacks', array('submissionid' => $submissionid,
'stage_identifier' => $sample->stage_identifier));
// if feedback doesn't exist, we'll use this stage identifier for a new feedback
- if (!$feedback){
+ if (!$feedback) {
$stage_identifier = $sample->stage_identifier;
break;
}
@@ -777,7 +777,7 @@ public function get_stage_identifier($submissionid, $cell_identifier) {
* Create agreed grade if all initial grade are present
* @param $cwfeedbackid
*/
- public function auto_agreement($cwfeedbackid){
+ public function auto_agreement($cwfeedbackid) {
global $DB;
$feedback = $DB->get_record('coursework_feedbacks', array('id' => $cwfeedbackid));
@@ -793,11 +793,11 @@ public function auto_agreement($cwfeedbackid){
$auto_grader->create_auto_grade_if_rules_match();
}
- public function remove_other_assessors_grade($csv_cells, &$line){
+ public function remove_other_assessors_grade($csv_cells, &$line) {
$otherassessors = false;
- if (in_array('otherassessors', $csv_cells)){
+ if (in_array('otherassessors', $csv_cells)) {
// find position of otherassesors so we know from which key to unset
$key = array_search('otherassessors', $csv_cells);
unset($csv_cells[$key]);
diff --git a/classes/file_importer.php b/classes/file_importer.php
index d53ddcbe..00bf0490 100644
--- a/classes/file_importer.php
+++ b/classes/file_importer.php
@@ -125,11 +125,11 @@ public function import_zip_files($coursework, $feedbackstage, $overwritecurrent)
if ($submission->get_state() < \mod_coursework\models\submission::PUBLISHED) {
//if only add/edit initial capability then workout stage identifier
- if ($feedbackstage == 'initialassessor'){
+ if ($feedbackstage == 'initialassessor') {
$feedback = $DB->get_record('coursework_feedbacks', array('submissionid' => $submission->id, 'assessorid' => $USER->id ));
- if ($feedback){
+ if ($feedback) {
$feedbackstage = $feedback->stage_identifier;
} else {
diff --git a/classes/forms/assessor_feedback_mform.php b/classes/forms/assessor_feedback_mform.php
index 982fc6a4..29303467 100644
--- a/classes/forms/assessor_feedback_mform.php
+++ b/classes/forms/assessor_feedback_mform.php
@@ -132,7 +132,7 @@ public function get_grading_controller() {
/**
* @param $draftenabled
*/
- public function add_submit_buttons($draftenabled, $feedbackid){
+ public function add_submit_buttons($draftenabled, $feedbackid) {
$button_array = array();
@@ -161,7 +161,7 @@ public function add_submit_buttons($draftenabled, $feedbackid){
* @param $data
* @return bool
*/
- public function validate_grade($data){
+ public function validate_grade($data) {
$result = true;
if (!empty($this->_grading_instance) && property_exists($data, 'advancedgrading')) {
$result = $this->_grading_instance->validate_grading_element($data->advancedgrading);
diff --git a/classes/forms/deadline_extension_form.php b/classes/forms/deadline_extension_form.php
index 3b1adef3..f2a3e04b 100644
--- a/classes/forms/deadline_extension_form.php
+++ b/classes/forms/deadline_extension_form.php
@@ -44,7 +44,7 @@ protected function definition() {
$this->_form->addElement('hidden', 'id');
$this->_form->settype('id', PARAM_INT);
- if ($this->get_coursework()->personaldeadlineenabled && $personal_deadline = $this->personal_deadline()){
+ if ($this->get_coursework()->personaldeadlineenabled && $personal_deadline = $this->personal_deadline()) {
$this->_form->addElement('html', 'Personal deadline: '. userdate($personal_deadline->personal_deadline).'
');
} else {
// Current deadline for comparison
@@ -84,7 +84,7 @@ public function validation($data, $files) {
global $CFG;
$max_deadline = $CFG->coursework_max_extension_deadline;
- if ($this->get_coursework()->personaldeadlineenabled && $personal_deadline = $this->personal_deadline()){
+ if ($this->get_coursework()->personaldeadlineenabled && $personal_deadline = $this->personal_deadline()) {
$deadline = $personal_deadline->personal_deadline;
} else {
$deadline = $this->get_coursework()->deadline;
@@ -100,12 +100,12 @@ public function validation($data, $files) {
return $errors;
}
- public function personal_deadline(){
+ public function personal_deadline() {
global $DB;
$extensionid = optional_param('id',0, PARAM_INT);
- if ($extensionid != 0){
+ if ($extensionid != 0) {
$ext = $DB->get_record('coursework_extensions', array('id' => $extensionid));
$allocatableid = $ext->allocatableid;
$allocatabletype = $ext->allocatabletype;
diff --git a/classes/forms/upload_feedback_form.php b/classes/forms/upload_feedback_form.php
index 8047cc55..d3f56ee5 100644
--- a/classes/forms/upload_feedback_form.php
+++ b/classes/forms/upload_feedback_form.php
@@ -60,7 +60,7 @@ function definition() {
if (has_any_capability($capability, $this->coursework->get_context()) && !has_capability('mod/coursework:administergrades', $this->coursework->get_context())) {
$options['initialassessor'] = get_string('initialassessor', 'coursework');
- } else if (has_capability('mod/coursework:administergrades', $this->coursework->get_context())){
+ } else if (has_capability('mod/coursework:administergrades', $this->coursework->get_context())) {
$options['assessor_1'] = get_string('assessorupload', 'coursework', '1');
if ($this->coursework->get_max_markers() >= 2) $options['assessor_2'] = get_string('assessorupload', 'coursework', '2');
if ($this->coursework->get_max_markers() >= 3) $options['assessor_3'] = get_string('assessorupload', 'coursework', '3');
diff --git a/classes/grade_judge.php b/classes/grade_judge.php
index 2501f5a2..cfe11e68 100644
--- a/classes/grade_judge.php
+++ b/classes/grade_judge.php
@@ -164,7 +164,7 @@ public function is_feedback_that_is_promoted_to_gradebook(feedback $feedback) {
* @param allocatable $allocatable
* @return bool
*/
- public function allocatable_needs_more_than_one_feedback ($allocatable){
+ public function allocatable_needs_more_than_one_feedback ($allocatable) {
if ($this->coursework->sampling_enabled()) {
assessment_set_membership::fill_pool_coursework($this->coursework->id);
diff --git a/classes/grading_report.php b/classes/grading_report.php
index 6badadb2..6e3c1f3f 100644
--- a/classes/grading_report.php
+++ b/classes/grading_report.php
@@ -354,8 +354,8 @@ public function get_table_rows_for_page($rowcount=false) {
foreach ($participants as $key => $participant) {
// handle 'Group mode' - unset groups/individuals thaat are not in the chosen group
- if (!empty($options['group']) && $options['group'] != -1){
- if ($this->coursework->is_configured_to_have_group_submissions()){
+ if (!empty($options['group']) && $options['group'] != -1) {
+ if ($this->coursework->is_configured_to_have_group_submissions()) {
if ($options['group'] != $participant->id) continue;
} else {
if (!$this->coursework->student_in_group($participant->id, $options['group']))continue;
diff --git a/classes/grading_table_row_base.php b/classes/grading_table_row_base.php
index 8a8cd126..47c2c2c4 100644
--- a/classes/grading_table_row_base.php
+++ b/classes/grading_table_row_base.php
@@ -195,7 +195,7 @@ public function get_personal_deadlines() {
array('courseworkid' => $this->get_coursework()->id,
'allocatableid' => $allocatable->id(),
'allocatabletype' => $allocatable->type()));
- if ($personal_deadline){
+ if ($personal_deadline) {
$personal_deadline = $personal_deadline->personal_deadline;
} else {
$personal_deadline = $this->get_coursework()->deadline;
@@ -386,7 +386,7 @@ public function has_feedback() {
/**
* @return models\feedback
*/
- public function get_single_feedback(){
+ public function get_single_feedback() {
return $this->get_submission()->get_assessor_feedback_by_stage('assessor_1');
}
diff --git a/classes/models/coursework.php b/classes/models/coursework.php
index 7bc2e361..702232f1 100644
--- a/classes/models/coursework.php
+++ b/classes/models/coursework.php
@@ -455,7 +455,7 @@ public function get_course_module() {
return $this->coursemodule;
}
- public function cm_object($coursemodule){
+ public function cm_object($coursemodule) {
$modinfo = get_fast_modinfo($this->get_course_id());
return $this->coursemodule = $modinfo->get_cm($coursemodule->id);
@@ -1205,7 +1205,7 @@ public function assessor_has_any_allocation_for_student($allocatable, $userid=fa
global $DB, $USER;
- if (!$userid){
+ if (!$userid) {
$userid = $USER->id;
}
$params = array(
@@ -1285,7 +1285,7 @@ public function get_all_submissions() {
* @throws \dml_missing_record_exception
* @throws \dml_multiple_records_exception
*/
- public function get_submissions_needing_grading(){
+ public function get_submissions_needing_grading() {
$needsgrading = array();
$submissions = $this->get_finalised_submissions();
@@ -1294,7 +1294,7 @@ public function get_submissions_needing_grading(){
$stage_identifier = ($this->has_multiple_markers())? 'final_agreed_1': 'assessor_1';
$submission = submission::find($submission);
- if (!$feedback = $submission->get_assessor_feedback_by_stage($stage_identifier)){
+ if (!$feedback = $submission->get_assessor_feedback_by_stage($stage_identifier)) {
$needsgrading[] = $submission;
}
@@ -1312,14 +1312,14 @@ public function get_submissions_needing_grading(){
* @throws \dml_missing_record_exception
* @throws \dml_multiple_records_exception
*/
- public function get_graded_submissions_by_stage($stage_identifier){
+ public function get_graded_submissions_by_stage($stage_identifier) {
$graded = array();
$submissions = $this->get_finalised_submissions();
foreach ($submissions as $submission) {
$submission = submission::find($submission);
- if ($feedback = $submission->get_assessor_feedback_by_stage($stage_identifier)){
+ if ($feedback = $submission->get_assessor_feedback_by_stage($stage_identifier)) {
$graded[$submission->id] = $submission;
}
}
@@ -1333,7 +1333,7 @@ public function get_graded_submissions_by_stage($stage_identifier){
* @return array
* @throws \dml_exception
*/
- public function get_assessor_graded_submissions($assessorid){
+ public function get_assessor_graded_submissions($assessorid) {
global $DB;
$graded = array();
@@ -1360,7 +1360,7 @@ public function get_assessor_graded_submissions($assessorid){
* @return array
* @throws \dml_exception
*/
- public function get_published_submissions(){
+ public function get_published_submissions() {
global $DB;
$sql = "SELECT *
@@ -1457,7 +1457,7 @@ public function get_assessor_allocation($allocatable, $stage_identifier) {
return $allocation;
}
- public function get_assessors_stage_identifier($allocatable_id, $assessor_id){
+ public function get_assessors_stage_identifier($allocatable_id, $assessor_id) {
global $DB;
$params = array(
@@ -1856,7 +1856,7 @@ public function renderable_grading_report_factory($report_options) {
);
$report->add_cell(new single_assessor_feedback_cell($items_with_stage));
}
- if ($this->moderation_agreement_enabled()){
+ if ($this->moderation_agreement_enabled()) {
$items_with_stage = array(
'stage' => $this->get_moderator_grade_stage(),
'coursework' => $this,
@@ -2072,14 +2072,14 @@ public function sampling_enabled() {
/**
* @return bool
*/
- public function automaticagreement_enabled(){
+ public function automaticagreement_enabled() {
return $this->automaticagreementstrategy != null;
}
/**
* @return bool
*/
- public function autopopulatefeedbackcomment_enabled(){
+ public function autopopulatefeedbackcomment_enabled() {
return (bool)$this->autopopulatefeedbackcomment;
}
@@ -2139,11 +2139,11 @@ protected function get_advanced_grading_manager() {
*
* @return bool
*/
- public function is_using_rubric(){
+ public function is_using_rubric() {
$grading_manager = $this->get_advanced_grading_manager();
$method = $grading_manager->get_active_method();
- if ($method == 'rubric'){
+ if ($method == 'rubric') {
return true;
}
return false;
@@ -2154,7 +2154,7 @@ public function is_using_rubric(){
*
* @return mixed
*/
- public function get_rubric_criteria(){
+ public function get_rubric_criteria() {
$controller = $this->get_advanced_grading_active_controller();
return $controller->get_definition()->rubric_criteria;
}
@@ -2178,7 +2178,7 @@ public function marking_stages() {
$this->stages[$identifier] = new final_agreed($this, $identifier);
}
- if ($this->moderation_agreement_enabled()){
+ if ($this->moderation_agreement_enabled()) {
$identifier = 'moderator';
$this->stages[$identifier] = new moderator($this, $identifier);
@@ -2199,7 +2199,7 @@ public function get_assessor_marking_stages() {
for ($i = 1; $i <= $this->get_max_markers(); $i++) {
$stages[] = new assessor($this, 'assessor_' . $i);
}
- if ($this->moderation_agreement_enabled()){
+ if ($this->moderation_agreement_enabled()) {
$stages[] = new moderator($this, 'moderator');
}
@@ -2295,7 +2295,7 @@ public function get_allocatables() {
* @var group $group
*/
$members = $group->get_members($this->get_context(), $cmobject);
- if (empty($members)){
+ if (empty($members)) {
continue;
}
$allocatables[$group->id] = $group;
@@ -2390,21 +2390,21 @@ public function has_stuff_to_publish() {
/**
* @return bool
*/
- public function is_general_feedback_enabled(){
+ public function is_general_feedback_enabled() {
return ($this->generalfeedback != 0);
}
/**
* @return bool
*/
- public function has_individual_autorelease_feedback_enabled(){
+ public function has_individual_autorelease_feedback_enabled() {
return ($this->individualfeedback != 0);
}
/**
* @return array
*/
- public function get_finalised_submissions(){
+ public function get_finalised_submissions() {
global $DB;
$submissions = $DB->get_records('coursework_submissions',
@@ -2429,16 +2429,16 @@ public function finalise_all() {
global $DB;
$excludesql = '';
// check if any extensions granted for this coursework
- if ($this->extensions_enabled() && $this->extension_exists()){
+ if ($this->extensions_enabled() && $this->extension_exists()) {
$submissions_with_extensions = $this->get_submissions_with_extensions();
- foreach ($submissions_with_extensions as $submission){
+ foreach ($submissions_with_extensions as $submission) {
// exclude submissions that are still within extended deadline
- if ($submission->extended_deadline > time()){
+ if ($submission->extended_deadline > time()) {
$excludesubmissions[$submission->submissionid] = $submission->submissionid;
}
}
// build exclude sql
- if (!empty($excludesubmissions)){
+ if (!empty($excludesubmissions)) {
$excludesql = ' AND id NOT IN(';
$excludesql .= implode(',', $excludesubmissions);
$excludesql .= ')';
@@ -2498,13 +2498,13 @@ public function extensions_enabled() {
/*
* @return bool
*/
- public function extension_exists(){
+ public function extension_exists() {
global $DB;
return $DB->record_exists('coursework_extensions',array('courseworkid' => $this->id));
}
- public function get_submissions_with_extensions(){
+ public function get_submissions_with_extensions() {
global $DB;
$sql = "SELECT *, cs.id as submissionid
@@ -2521,7 +2521,7 @@ public function get_submissions_with_extensions(){
/**
* Get all personal deadline in coursework, they can be coursework deadline-(default) or personal
*/
- public function get_coursework_submission_personal_deadlines(){
+ public function get_coursework_submission_personal_deadlines() {
global $DB;
$sql = "SELECT cs.id as submissionid, personal_deadline
@@ -2637,7 +2637,7 @@ public function create_automatic_feedback() {
* @return bool
* @throws \dml_exception
*/
- public function tii_enabled(){
+ public function tii_enabled() {
if (!isset(self::$pool[$this->id]['tii_enabled'][$this->id])) {
global $CFG, $DB;
@@ -2664,7 +2664,7 @@ public function tii_enabled(){
* Lets us know if personal deadlines are enabled in the coursework.
* @return bool
*/
- public function personal_deadlines_enabled(){
+ public function personal_deadlines_enabled() {
return (bool)$this->personaldeadlineenabled;
}
@@ -2672,7 +2672,7 @@ public function personal_deadlines_enabled(){
* Lets us know if draft feedback is enabled in the coursework.
* @return bool
*/
- public function draft_feedback_enabled(){
+ public function draft_feedback_enabled() {
return (bool)$this->draftfeedbackenabled;
}
@@ -2724,7 +2724,7 @@ private function get_allocatable_personal_deadline($allocatable) {
*
* @return bool
*/
- public function has_samples(){
+ public function has_samples() {
global $DB;
return $DB->record_exists('coursework_sample_set_mbrs', array('courseworkid' => $this->id));
@@ -2736,7 +2736,7 @@ public function has_samples(){
*
* @return bool
*/
- public function can_submit(){
+ public function can_submit() {
if (has_capability('mod/coursework:submit', $this->get_context())) {
return true;
}
@@ -2748,7 +2748,7 @@ public function can_submit(){
*
* @return bool
*/
- public function can_grade(){
+ public function can_grade() {
if (has_capability('mod/coursework:addinitialgrade', $this->get_context()) || has_capability('mod/coursework:addagreedgrade', $this->get_context())
|| has_capability('mod/coursework:addallocatedagreedgrade', $this->get_context())) {
return true;
@@ -2759,7 +2759,7 @@ public function can_grade(){
/**
* @return bool
*/
- public function marking_deadline_enabled(){
+ public function marking_deadline_enabled() {
return (bool)$this->markingdeadlineenabled ;
}
@@ -2771,7 +2771,7 @@ public function marking_deadline_enabled(){
* @return bool
* @throws \dml_exception
*/
- public function student_in_group($studentid, $groupid){
+ public function student_in_group($studentid, $groupid) {
global $DB;
$sql = "SELECT groups.*
FROM {groups} groups
@@ -2790,7 +2790,7 @@ public function student_in_group($studentid, $groupid){
*
* @return submissions
*/
- function retrieve_submissions_by_coursework(){
+ function retrieve_submissions_by_coursework() {
global $DB;
return $DB->get_records('coursework_submissions', ['courseworkid' => $this->id, 'allocatabletype' => 'user']);
}
@@ -2800,7 +2800,7 @@ function retrieve_submissions_by_coursework(){
* @param $user_id
* @return submissions
*/
- public function retrieve_submissions_by_user($user_id){
+ public function retrieve_submissions_by_user($user_id) {
global $DB;
return $DB->get_records('coursework_submissions', ['courseworkid' => $this->id, 'authorid' => $user_id, 'allocatabletype' => 'user']);
}
@@ -2821,7 +2821,7 @@ public function retrieve_feedbacks_by_submission($submission_id) {
*
* @param $user_id
*/
- public function remove_submissions_by_user($user_id){
+ public function remove_submissions_by_user($user_id) {
global $DB;
$DB->delete_records('coursework_submissions', ['courseworkid' => $this->id, 'authorid' => $user_id, 'allocatabletype' => 'user']);
}
@@ -2830,7 +2830,7 @@ public function remove_submissions_by_user($user_id){
*
* @return submissions
*/
- public function remove_submissions_by_coursework(){
+ public function remove_submissions_by_coursework() {
global $DB;
$DB->delete_records('coursework_submissions', ['courseworkid' => $this->id, 'allocatabletype' => 'user']);
}
@@ -2841,7 +2841,7 @@ public function remove_submissions_by_coursework(){
* @param $item_id
* @param $filearea
*/
- public function remove_corresponding_file($context_id, $item_id, $filearea){
+ public function remove_corresponding_file($context_id, $item_id, $filearea) {
global $DB;
$component = 'mod_coursework';
$fs = get_file_storage();
@@ -2852,7 +2852,7 @@ public function remove_corresponding_file($context_id, $item_id, $filearea){
*
* @param $submission_id
*/
- public function remove_feedbacks_by_submission($submission_id){
+ public function remove_feedbacks_by_submission($submission_id) {
global $DB;
$DB->delete_records('coursework_feedbacks', ['submissionid' => $submission_id]);
}
@@ -2861,7 +2861,7 @@ public function remove_feedbacks_by_submission($submission_id){
*
* @param $feedback_id
*/
- public function remove_agreements_by_feedback($feedback_id){
+ public function remove_agreements_by_feedback($feedback_id) {
global $DB;
$DB->delete_records('coursework_mod_agreements', ['feedbackid' => $feedback_id]);
}
@@ -2870,7 +2870,7 @@ public function remove_agreements_by_feedback($feedback_id){
*
* @param $user_id
*/
- public function remove_deadline_extensions_by_user($user_id){
+ public function remove_deadline_extensions_by_user($user_id) {
global $DB;
$DB->execute('DELETE FROM {coursework_extensions} WHERE allocatabletype = ? AND (allocatableid = ? OR allocatableuser = ? ) ', array('user', $user_id, $user_id));
}
@@ -2888,7 +2888,7 @@ public function remove_personal_deadlines_by_coursework() {
* Function to Remove all deadline extensions by coursework
*
*/
- public function remove_deadline_extensions_by_coursework(){
+ public function remove_deadline_extensions_by_coursework() {
global $DB;
$DB->execute('DELETE FROM {coursework_extensions} WHERE allocatabletype = ? AND courseworkid = ? ', array('user', $this->id));
}
@@ -2899,7 +2899,7 @@ public function remove_deadline_extensions_by_coursework(){
* @return bool
* @throws \dml_exception
*/
- public function has_any_final_feedback(){
+ public function has_any_final_feedback() {
global $DB;
$sql = "SELECT *
@@ -2920,13 +2920,13 @@ public function has_any_final_feedback(){
public function get_allocatable_deadline($allocatableid) {
$deadline = $this->deadline;
- if ($this->use_groups){
+ if ($this->use_groups) {
$allocatable = group::find($allocatableid);
} else {
$allocatable = user::find($allocatableid);
}
- if ($this->personal_deadlines_enabled()){
+ if ($this->personal_deadlines_enabled()) {
// find personal deadline for a user if this option enabled
$personal = $this->get_allocatable_personal_deadline($allocatable);
if (!empty($personal)) {
@@ -2934,7 +2934,7 @@ public function get_allocatable_deadline($allocatableid) {
}
}
- if ($this->extensions_enabled()){ // check if coursework allows extensions
+ if ($this->extensions_enabled()) { // check if coursework allows extensions
// check if extension for this user exists
$extension = $this->get_allocatable_extension($allocatable);
if (!empty($extension)) {
@@ -2983,7 +2983,7 @@ public function remove_plagiarisms_by_submission($submission_id) {
* @return bool
* @throws \dml_exception
*/
- public function has_any_submission(){
+ public function has_any_submission() {
global $DB;
$sql = "SELECT *
@@ -2999,10 +2999,10 @@ public function has_any_submission(){
* @return bool
* @throws moodle_exception
*/
- public function is_coursework_visible(){
+ public function is_coursework_visible() {
$visible = true;
- if ($this->get_course_module()->visible == 0 || $this->get_course()->visible == 0){
+ if ($this->get_course_module()->visible == 0 || $this->get_course()->visible == 0) {
$visible = false;
}
return $visible;
diff --git a/classes/models/feedback.php b/classes/models/feedback.php
index 7938d812..b3a5cc3a 100644
--- a/classes/models/feedback.php
+++ b/classes/models/feedback.php
@@ -188,10 +188,10 @@ class feedback extends table_base {
* @return string assessor's name
* @throws \coding_exception
*/
- public function display_assessor_name(){
+ public function display_assessor_name() {
// check if assessor's name in this CW is set to hidden
- if ($this->is_assessor_anonymity_enabled()){
+ if ($this->is_assessor_anonymity_enabled()) {
$assessor_name = get_string('hidden', 'mod_coursework');
} else {
$assessor_name = $this->get_assesor_username();
@@ -214,22 +214,22 @@ public function get_assesor_username() {
return $this->assessor->name();
}
- public function get_assessor_id(){
+ public function get_assessor_id() {
return $this->assessor->id;
}
/**
* @return string
*/
- public function get_assessor_stage_no(){
+ public function get_assessor_stage_no() {
$no = '';
- if (substr($this->stage_identifier,0,9 ) =='assessor_'){
+ if (substr($this->stage_identifier,0,9 ) =='assessor_') {
$no = substr($this->stage_identifier, -1);
}
return $no;
}
- public function get_feedbacks_assessorid(){
+ public function get_feedbacks_assessorid() {
return $this->assessorid;
}
/**
@@ -305,7 +305,7 @@ public static function get_teacher_feedback(submission $submission,
* Check if assessor is allocated to the user in this stage
* @return bool
*/
- public function is_assessor_allocated(){
+ public function is_assessor_allocated() {
return $this->get_stage()->assessor_has_allocation($this->get_allocatable());
}
@@ -336,7 +336,7 @@ public function set_feedback_files($context_id) {
public function get_feedback_files() {
$this->set_feedback_files($this->get_context_id());
- if ($this->feedbackfiles !=null){
+ if ($this->feedbackfiles !=null) {
$this->feedback_files = new feedback_files($this->feedbackfiles, $this);
return $this->feedback_files;
}
@@ -564,7 +564,7 @@ public function get_allocatable() {
return $this->get_submission()->get_allocatable();
}
- public function is_assessor_anonymity_enabled(){
+ public function is_assessor_anonymity_enabled() {
return $this->get_coursework()->assessoranonymity;
}
diff --git a/classes/models/moderation.php b/classes/models/moderation.php
index 315a4862..b260adbb 100644
--- a/classes/models/moderation.php
+++ b/classes/models/moderation.php
@@ -86,7 +86,7 @@ public function get_coursework() {
/**
*
*/
- public function get_feedback(){
+ public function get_feedback() {
global $DB;
//Moderation done only for single courseworks so submission id to retrieve feedback is enough
@@ -96,7 +96,7 @@ public function get_feedback(){
}
- public function get_agreement(){
+ public function get_agreement() {
return $this->agreement;
}
@@ -133,7 +133,7 @@ public function get_moderator_username() {
return fullname($this->moderator);
}
- public function get_moderator_id(){
+ public function get_moderator_id() {
return $this->moderator->id;
}
@@ -141,7 +141,7 @@ public function get_moderator_id(){
* Check if assessor is allocated to the user in this stage
* @return bool
*/
- public function is_moderator_allocated(){
+ public function is_moderator_allocated() {
return $this->get_stage()->assessor_has_allocation($this->get_allocatable());
}
diff --git a/classes/models/null_user.php b/classes/models/null_user.php
index bb537f6c..f58a6c91 100644
--- a/classes/models/null_user.php
+++ b/classes/models/null_user.php
@@ -99,7 +99,7 @@ public function has_all_initial_feedbacks($coursework) {
* @param coursework $coursework
* @return bool
*/
- public function get_agreed_feedback($coursework){
+ public function get_agreed_feedback($coursework) {
return false;
}
diff --git a/classes/models/outstanding_marking.php b/classes/models/outstanding_marking.php
index 9948370a..569ed462 100644
--- a/classes/models/outstanding_marking.php
+++ b/classes/models/outstanding_marking.php
@@ -36,13 +36,13 @@ public function __construct() {
* @param $userid
* @return int
*/
- public function get_to_grade_initial_count($cwkrecord, $userid){
+ public function get_to_grade_initial_count($cwkrecord, $userid) {
$coursework = new \mod_coursework\models\coursework($cwkrecord);
$initialsubmissions = array();
- if ($this->should_get_to_mark_initial_grade_info($coursework->id, $userid)){
+ if ($this->should_get_to_mark_initial_grade_info($coursework->id, $userid)) {
if (!$coursework->has_multiple_markers()) {
$initialsubmissions = $this->get_single_marker_initial_grade_submissions_to_mark($coursework->id, $userid, $coursework->allocation_enabled());
@@ -222,7 +222,7 @@ private function get_multiple_to_mark_initial_grade_submissions($courseworkid, $
* @param $numberofmarkers
* @return array
*/
- private function get_to_grade_agreed_grade_submissions($courseworkid, $numberofmarkers){
+ private function get_to_grade_agreed_grade_submissions($courseworkid, $numberofmarkers) {
global $DB;
diff --git a/classes/models/personal_deadline.php b/classes/models/personal_deadline.php
index 59a6b8ff..b02713bd 100644
--- a/classes/models/personal_deadline.php
+++ b/classes/models/personal_deadline.php
@@ -67,7 +67,7 @@ public function get_allocatable() {
* Function to check if extension for this personal deadline (alloctable) exists
* @return static
*/
- public function extension_exists(){
+ public function extension_exists() {
$coursework = $this->get_coursework();
$params = array('courseworkid' => $coursework->id,
diff --git a/classes/models/plagiarism_flag.php b/classes/models/plagiarism_flag.php
index 1ff1850d..ec51b741 100644
--- a/classes/models/plagiarism_flag.php
+++ b/classes/models/plagiarism_flag.php
@@ -94,9 +94,9 @@ public static function get_plagiarism_flag($submission) {
/**
* @return bool
*/
- public function can_release_grades(){
+ public function can_release_grades() {
- switch ($this->status){
+ switch ($this->status) {
case self::INVESTIGATION:
case self::NOTCLEARED:
diff --git a/classes/models/submission.php b/classes/models/submission.php
index 4cb20ce9..69074339 100644
--- a/classes/models/submission.php
+++ b/classes/models/submission.php
@@ -248,16 +248,16 @@ public static function unfinalised_past_deadline() {
$deadline = $submission->deadline;
$submission = static::find($submission);
- if ($submission->get_coursework()->personal_deadlines_enabled()){
+ if ($submission->get_coursework()->personal_deadlines_enabled()) {
$deadline = $submission->submission_personal_deadline();
}
- if ($deadline < time()){
+ if ($deadline < time()) {
// if deadline passed check if extension exists
- if ($submission->has_extension()){
+ if ($submission->has_extension()) {
//check if extension is valid
$extension = $submission->submission_extension();
- if ($extension->extended_deadline > time()){
+ if ($extension->extended_deadline > time()) {
//unset as it doesn't need to be autofinalise yet
unset($submissions[$submission->id]);
}
@@ -508,7 +508,7 @@ public function get_assessor_allocation_by_stage($stage_identifier) {
* @throws \dml_missing_record_exception
* @throws \dml_multiple_records_exception
*/
- public function get_agreed_grade(){
+ public function get_agreed_grade() {
global $DB;
if (!$this->id) {
@@ -836,7 +836,7 @@ public function get_status_text() {
case submission::PARTIALLY_GRADED:
$statustext = get_string('statuspartiallygraded', 'coursework');
- if ($this->any_editable_feedback_exists()){
+ if ($this->any_editable_feedback_exists()) {
$statustext = get_string('statusfullygraded', 'coursework'). " ";
$statustext .= get_string('stilleditable', 'coursework');
}
@@ -855,7 +855,7 @@ public function get_status_text() {
get_string('statusfinalgradedsingle', 'coursework'),
array('class' => 'highlight'));
$statustext = $this->has_multiple_markers() && $this->sampled_feedback_exists() ? $spanfinalgraded : $spanfinalgradedsingle;
- if ($this->editable_final_feedback_exist()){
+ if ($this->editable_final_feedback_exist()) {
$statustext .= " ". get_string('finalgradestilleditable', 'coursework');
}
break;
@@ -1043,7 +1043,7 @@ public function get_last_submitter() {
*/
public function is_late() {
// check if submission has personal deadline
- if ($this->get_coursework()->personaldeadlineenabled){
+ if ($this->get_coursework()->personaldeadlineenabled) {
$deadline = $this->submission_personal_deadline();
} else { // if not, use coursework default deadline
$deadline = $this->get_coursework()->get_deadline();
@@ -1112,7 +1112,7 @@ public function extract_extension_from_file_name($file_name) {
private function rename_file($file, $counter) {
// if a submission was made of behalf of student/group, we need to use owner's id, not the person who submitted it
- if ($this->is_submission_on_behalf()){
+ if ($this->is_submission_on_behalf()) {
$userid = $this->allocatableid;
} else {
$userid = $this->userid;
@@ -1136,7 +1136,7 @@ public function time_submitted() {
return $this->timesubmitted;
}
- public function sampled_feedback_exists(){
+ public function sampled_feedback_exists() {
global $DB;
return $DB->record_exists('coursework_sample_set_mbrs', array('courseworkid' => $this->courseworkid,
'allocatableid' => $this->get_allocatable()->id(),
@@ -1144,10 +1144,10 @@ public function sampled_feedback_exists(){
}
- public function max_number_of_feedbacks(){
+ public function max_number_of_feedbacks() {
global $DB;
- if ($this->get_coursework()->sampling_enabled()){
+ if ($this->get_coursework()->sampling_enabled()) {
// calculate how many stages(markers) are enabled for this submission
$parameters = array('courseworkid' => $this->coursework->id,
'allocatableid' => $this->get_allocatable()->id(),
@@ -1171,7 +1171,7 @@ public function max_number_of_feedbacks(){
* @return array|bool
* @throws \coding_exception
*/
- public function students_for_gradebook(){
+ public function students_for_gradebook() {
if ($this->get_coursework()->is_configured_to_have_group_submissions()) {
$students = groups_get_members($this->allocatableid);
return $students;
@@ -1198,10 +1198,10 @@ private function students_for_gradng() {
/**
* @return bool
*/
- private function is_submission_on_behalf(){
+ private function is_submission_on_behalf() {
global $USER;
- if (($this->allocatableid == $USER->id && $this->allocatabletype != 'group') || groups_is_member($this->allocatableid)){
+ if (($this->allocatableid == $USER->id && $this->allocatabletype != 'group') || groups_is_member($this->allocatableid)) {
return false;
} else {
return true;
@@ -1267,12 +1267,12 @@ public function submission_extension() {
* @return mixed
* @throws \coding_exception
*/
- public function submission_personal_deadline(){
+ public function submission_personal_deadline() {
$allocatableid = $this->get_allocatable()->id();
$allocatabletype = $this->get_allocatable()->type();
$personal_deadline = personal_deadline::get_object($this->courseworkid, 'allocatableid-allocatabletype', [$allocatableid, $allocatabletype]);
- if ($personal_deadline){
+ if ($personal_deadline) {
$personal_deadline = $personal_deadline->personal_deadline;
} else {
$personal_deadline = $this->get_coursework()->deadline;
@@ -1287,7 +1287,7 @@ public function submission_personal_deadline(){
*
* @return bool
*/
- public function submitted_within_extension(){
+ public function submitted_within_extension() {
return $this->time_submitted() < $this->extension_deadline();
}
@@ -1295,7 +1295,7 @@ public function submitted_within_extension(){
* Retrieve submission's extended deadline
* @return mixed
*/
- public function extension_deadline(){
+ public function extension_deadline() {
return $this->submission_extension()->extended_deadline;
}
@@ -1422,7 +1422,7 @@ function can_add_tii_grademark() {
*
* @return bool
*/
- function any_editable_feedback_exists(){
+ function any_editable_feedback_exists() {
return count($this->get_assessor_feedbacks()) >= $this->max_number_of_feedbacks() && $this->editable_feedbacks_exist();
}
@@ -1432,7 +1432,7 @@ function any_editable_feedback_exists(){
*
* @return bool
*/
- function has_valid_extension(){
+ function has_valid_extension() {
deadline_extension::fill_pool_coursework($this->courseworkid);
$extension = deadline_extension::get_object($this->courseworkid, 'allocatableid-allocatabletype', [$this->allocatableid, $this->allocatabletype]);
@@ -1455,7 +1455,7 @@ function can_be_unfinalised() {
* @return bool|false|mixed|stdClass
* @throws \dml_exception
*/
- function has_specific_assessor_feedback($assessorid){
+ function has_specific_assessor_feedback($assessorid) {
global $DB;
$feedback = $DB->get_record('coursework_feedbacks', array('submissionid' => $this->id,
diff --git a/classes/observer.php b/classes/observer.php
index 56877e9d..dba5bcef 100644
--- a/classes/observer.php
+++ b/classes/observer.php
@@ -27,31 +27,31 @@
class mod_coursework_observer {
- public static function autoallocate_when_user_added(core\event\role_assigned $event){
+ public static function autoallocate_when_user_added(core\event\role_assigned $event) {
coursework_role_assigned_event_handler($event);
}
- public static function autoallocate_when_user_removed(core\event\role_unassigned $event){
+ public static function autoallocate_when_user_removed(core\event\role_unassigned $event) {
coursework_role_unassigned_event_handler($event);
}
- public static function coursework_deadline_changed(mod_coursework\event\coursework_deadline_changed $event){
+ public static function coursework_deadline_changed(mod_coursework\event\coursework_deadline_changed $event) {
coursework_send_deadline_changed_emails($event);
}
- public static function process_allocation_after_update(core\event\course_module_updated $event){
+ public static function process_allocation_after_update(core\event\course_module_updated $event) {
coursework_mod_updated($event);
}
- public static function process_allocation_after_creation(core\event\course_module_created $event){
+ public static function process_allocation_after_creation(core\event\course_module_created $event) {
coursework_mod_updated($event);
@@ -60,21 +60,21 @@ public static function process_allocation_after_creation(core\event\course_modul
/**
* @param \core\event\group_member_added $event
*/
- public static function process_allocations_when_group_member_added(\core\event\group_member_added $event){
+ public static function process_allocations_when_group_member_added(\core\event\group_member_added $event) {
course_group_member_added($event);
}
/**
* @param \core\event\group_member_removed $event
*/
- public static function process_allocations_when_group_member_removed(\core\event\group_member_removed $event){
+ public static function process_allocations_when_group_member_removed(\core\event\group_member_removed $event) {
course_group_member_removed($event);
}
/**
* @param \core\event\role_assigned $event
*/
- public static function add_teacher_to_dropdown_when_enrolled(core\event\role_assigned$event){
+ public static function add_teacher_to_dropdown_when_enrolled(core\event\role_assigned$event) {
teacher_allocation_cache_purge($event);
}
@@ -82,7 +82,7 @@ public static function add_teacher_to_dropdown_when_enrolled(core\event\role_ass
/**
* @param \core\event\role_unassigned $event
*/
- public static function remove_teacher_from_dropdown_when_unenrolled(core\event\role_unassigned$event){
+ public static function remove_teacher_from_dropdown_when_unenrolled(core\event\role_unassigned$event) {
teacher_removed_allocated_not_graded($event);
teacher_allocation_cache_purge($event);
diff --git a/classes/personal_deadline/table/row/builder.php b/classes/personal_deadline/table/row/builder.php
index c4439f7a..59060380 100644
--- a/classes/personal_deadline/table/row/builder.php
+++ b/classes/personal_deadline/table/row/builder.php
@@ -188,7 +188,7 @@ public function get_personal_deadlines() {
array('courseworkid' => $this->get_coursework()->id,
'allocatableid' => $this->allocatable->id(),
'allocatabletype' => $this->allocatable->type()));
- if ($personal_deadline){
+ if ($personal_deadline) {
$personal_deadline = $personal_deadline->personal_deadline;
} else {
$personal_deadline = $this->get_coursework()->deadline;
diff --git a/classes/render_helpers/grading_report/cells/_user_cell.php b/classes/render_helpers/grading_report/cells/_user_cell.php
index f928dd5f..e3f251da 100644
--- a/classes/render_helpers/grading_report/cells/_user_cell.php
+++ b/classes/render_helpers/grading_report/cells/_user_cell.php
@@ -103,7 +103,7 @@ public function get_table_header($options = array()) {
/**
* @return string
*/
- public function get_table_header_class(){
+ public function get_table_header_class() {
return 'studentname';
}
diff --git a/classes/render_helpers/grading_report/cells/cell_base.php b/classes/render_helpers/grading_report/cells/cell_base.php
index 1a74f723..f7e481bc 100644
--- a/classes/render_helpers/grading_report/cells/cell_base.php
+++ b/classes/render_helpers/grading_report/cells/cell_base.php
@@ -142,7 +142,7 @@ protected function after_initialisation($items) {
/**
* Override for the header help message
*/
- public function get_table_header_help_icon(){
+ public function get_table_header_help_icon() {
}
diff --git a/classes/render_helpers/grading_report/cells/email_cell.php b/classes/render_helpers/grading_report/cells/email_cell.php
index 85ef93e4..34b68aab 100644
--- a/classes/render_helpers/grading_report/cells/email_cell.php
+++ b/classes/render_helpers/grading_report/cells/email_cell.php
@@ -57,7 +57,7 @@ public function get_table_header($options = array()) {
/**
* @return string
*/
- public function get_table_header_class(){
+ public function get_table_header_class() {
return 'email_cell';
}
diff --git a/classes/render_helpers/grading_report/cells/first_name_cell.php b/classes/render_helpers/grading_report/cells/first_name_cell.php
index 6751d6a2..68c41318 100644
--- a/classes/render_helpers/grading_report/cells/first_name_cell.php
+++ b/classes/render_helpers/grading_report/cells/first_name_cell.php
@@ -57,7 +57,7 @@ public function get_table_header($options = array()) {
/**
* @return string
*/
- public function get_table_header_class(){
+ public function get_table_header_class() {
return 'firstname_cell';
}
diff --git a/classes/render_helpers/grading_report/cells/first_name_letter_cell.php b/classes/render_helpers/grading_report/cells/first_name_letter_cell.php
index a6d0db1c..2403f4ad 100644
--- a/classes/render_helpers/grading_report/cells/first_name_letter_cell.php
+++ b/classes/render_helpers/grading_report/cells/first_name_letter_cell.php
@@ -65,7 +65,7 @@ public function get_table_header($options = array()) {
/**
* @return string
*/
- public function get_table_header_class(){
+ public function get_table_header_class() {
return 'firstname_letter_cell';
}
diff --git a/classes/render_helpers/grading_report/cells/grade_for_gradebook_cell.php b/classes/render_helpers/grading_report/cells/grade_for_gradebook_cell.php
index d6535f49..25088b0a 100644
--- a/classes/render_helpers/grading_report/cells/grade_for_gradebook_cell.php
+++ b/classes/render_helpers/grading_report/cells/grade_for_gradebook_cell.php
@@ -62,7 +62,7 @@ public function get_table_header($options = array()) {
/**
* @return string
*/
- public function get_table_header_class(){
+ public function get_table_header_class() {
return 'provisionalgrade';
}
@@ -76,7 +76,7 @@ public function header_group() {
/**
* @return string
*/
- public function get_table_header_help_icon(){
+ public function get_table_header_help_icon() {
global $OUTPUT;
return ($OUTPUT->help_icon('provisionalgrade', 'mod_coursework'));
}
diff --git a/classes/render_helpers/grading_report/cells/group_cell.php b/classes/render_helpers/grading_report/cells/group_cell.php
index c76138e9..98bd2a55 100644
--- a/classes/render_helpers/grading_report/cells/group_cell.php
+++ b/classes/render_helpers/grading_report/cells/group_cell.php
@@ -48,7 +48,7 @@ public function get_table_cell($row_object) {
$content .= '';
$content .= '
';
- if ($this->coursework->blindmarking_enabled() && !has_capability('mod/coursework:viewanonymous', $this->coursework->get_context()) && !$row_object->is_published()){
+ if ($this->coursework->blindmarking_enabled() && !has_capability('mod/coursework:viewanonymous', $this->coursework->get_context()) && !$row_object->is_published()) {
$content .= ''.get_string('membershidden','coursework').' ';
} else{
$content .= ''.get_string('viewmembers','coursework').' ';
@@ -86,7 +86,7 @@ public function get_table_header($options = array()) {
/**
* @return string
*/
- public function get_table_header_class(){
+ public function get_table_header_class() {
return 'tableheadgroups';
}
diff --git a/classes/render_helpers/grading_report/cells/idnumber_cell.php b/classes/render_helpers/grading_report/cells/idnumber_cell.php
index 9c8a9269..d4f71a11 100644
--- a/classes/render_helpers/grading_report/cells/idnumber_cell.php
+++ b/classes/render_helpers/grading_report/cells/idnumber_cell.php
@@ -73,7 +73,7 @@ public function get_table_header($options = array()) {
/**
* @return string
*/
- public function get_table_header_class(){
+ public function get_table_header_class() {
return 'tableheadidnumber';
}
diff --git a/classes/render_helpers/grading_report/cells/last_name_cell.php b/classes/render_helpers/grading_report/cells/last_name_cell.php
index 99bbf5cd..0b498948 100644
--- a/classes/render_helpers/grading_report/cells/last_name_cell.php
+++ b/classes/render_helpers/grading_report/cells/last_name_cell.php
@@ -57,7 +57,7 @@ public function get_table_header($options = array()) {
/**
* @return string
*/
- public function get_table_header_class(){
+ public function get_table_header_class() {
return 'lastname_cell';
}
diff --git a/classes/render_helpers/grading_report/cells/last_name_letter_cell.php b/classes/render_helpers/grading_report/cells/last_name_letter_cell.php
index 13dc6b63..392d79f3 100644
--- a/classes/render_helpers/grading_report/cells/last_name_letter_cell.php
+++ b/classes/render_helpers/grading_report/cells/last_name_letter_cell.php
@@ -65,7 +65,7 @@ public function get_table_header($options = array()) {
/**
* @return string
*/
- public function get_table_header_class(){
+ public function get_table_header_class() {
return 'lastname_letter_cell';
}
diff --git a/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php b/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php
index e9101150..4b136355 100644
--- a/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php
+++ b/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php
@@ -66,7 +66,7 @@ public function get_table_cell($rowobject) {
$content = '';
$moderation = '';
if ($rowobject->has_submission()) {
- if ($rowobject->get_single_feedback()){
+ if ($rowobject->get_single_feedback()) {
$moderation = $this->stage->get_moderation_for_feedback($rowobject->get_single_feedback());
}
// Add new moderations agreement
@@ -132,7 +132,7 @@ public function get_table_header($options = array()) {
/**
* @return string
*/
- public function get_table_header_class(){
+ public function get_table_header_class() {
return 'tableheadmoderationagreement';
}
@@ -146,7 +146,7 @@ public function header_group() {
/**
* @return string
*/
- public function get_table_header_help_icon(){
+ public function get_table_header_help_icon() {
global $OUTPUT;
return ($OUTPUT->help_icon('moderationagreement', 'coursework'));
}
diff --git a/classes/render_helpers/grading_report/cells/moderation_cell.php b/classes/render_helpers/grading_report/cells/moderation_cell.php
index d7bb6843..d9bc2b99 100644
--- a/classes/render_helpers/grading_report/cells/moderation_cell.php
+++ b/classes/render_helpers/grading_report/cells/moderation_cell.php
@@ -99,7 +99,7 @@ public function get_table_header($options = array()) {
/**
* @return string
*/
- public function get_table_header_class(){
+ public function get_table_header_class() {
return 'moderator';
}
diff --git a/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php b/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
index c0466931..882714c8 100644
--- a/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
+++ b/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
@@ -66,7 +66,7 @@ public function get_content($rowobject) {
global $USER, $OUTPUT;
//if coursework uses sampling check if any enabled for this submission, otherwise there is no agreed grade
- if ($rowobject->get_coursework()->sampling_enabled() && $rowobject->get_submission() && !$rowobject->get_submission()->sampled_feedback_exists()){
+ if ($rowobject->get_coursework()->sampling_enabled() && $rowobject->get_submission() && !$rowobject->get_submission()->sampled_feedback_exists()) {
$content = get_string('singlemarker', 'coursework');
return $content;
}
@@ -152,7 +152,7 @@ public function get_content($rowobject) {
$content .= html_writer::empty_tag('br');
if ((!$this->coursework->sampling_enabled() || $rowobject->get_submission()->sampled_feedback_exists()) && ($finalfeedback->get_feedbacks_assessorid() == 0
&& $finalfeedback->timecreated == $finalfeedback->timemodified)
- || $finalfeedback->lasteditedbyuser == 0){ // if the grade was automatically agreed
+ || $finalfeedback->lasteditedbyuser == 0) { // if the grade was automatically agreed
$content .= "(".get_string('automaticagreement', 'coursework').")";
} else {
$content .= ' by: ' . $finalfeedback->get_assesor_username();
@@ -179,7 +179,7 @@ public function get_table_header($options = array()) {
/**
* @return string
*/
- public function get_table_header_class(){
+ public function get_table_header_class() {
return 'agreedgrade';
}
diff --git a/classes/render_helpers/grading_report/cells/personal_deadline_cell.php b/classes/render_helpers/grading_report/cells/personal_deadline_cell.php
index 40e20663..d56675ff 100644
--- a/classes/render_helpers/grading_report/cells/personal_deadline_cell.php
+++ b/classes/render_helpers/grading_report/cells/personal_deadline_cell.php
@@ -52,7 +52,7 @@ public function get_table_cell($row_object) {
);
$personal_deadline = personal_deadline::find_or_build($new_personal_deadline_params);
- if ($personal_deadline->personal_deadline){
+ if ($personal_deadline->personal_deadline) {
$deadline = $personal_deadline->personal_deadline;
}
$date = userdate($deadline, '%a, %d %b %Y, %H:%M');
@@ -95,7 +95,7 @@ public function get_table_header($options = array()) {
/**
* @return string
*/
- public function get_table_header_class(){
+ public function get_table_header_class() {
return 'tableheadpersonaldeadline';
}
diff --git a/classes/render_helpers/grading_report/cells/plagiarism_cell.php b/classes/render_helpers/grading_report/cells/plagiarism_cell.php
index 1a694a9a..0a13d675 100644
--- a/classes/render_helpers/grading_report/cells/plagiarism_cell.php
+++ b/classes/render_helpers/grading_report/cells/plagiarism_cell.php
@@ -68,7 +68,7 @@ public function get_table_header($options = array()) {
/**
* @return string
*/
- public function get_table_header_class(){
+ public function get_table_header_class() {
return 'plagiarism';
}
diff --git a/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php b/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php
index 7d5d69eb..33312b45 100644
--- a/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php
+++ b/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php
@@ -49,13 +49,13 @@ public function get_table_cell($rowobject) {
$content = '';
$ability = new ability(user::find($USER), $rowobject->get_coursework());
- if ($rowobject->has_submission() && $rowobject->get_submission()->finalised){
+ if ($rowobject->has_submission() && $rowobject->get_submission()->finalised) {
$plagiarism_flag_params = array(
'submissionid' => $rowobject->get_submission()->id
);
$plagiarism_flag = plagiarism_flag::find($plagiarism_flag_params);
- if (!$plagiarism_flag){ // if plagiarism flag for this submission doesn't exist, we can create one
+ if (!$plagiarism_flag) { // if plagiarism flag for this submission doesn't exist, we can create one
$plagiarism_flag_params = array('courseworkid' => $rowobject->get_coursework()->id,
'submissionid' => $rowobject->get_submission()->id);
$new_plagiarism_flag = plagiarism_flag::build($plagiarism_flag_params);
@@ -89,7 +89,7 @@ public function get_table_header($options = array()) {
/**
* @return string
*/
- public function get_table_header_class(){
+ public function get_table_header_class() {
return 'tableheadplagiarismalert';
}
diff --git a/classes/render_helpers/grading_report/cells/single_assessor_feedback_cell.php b/classes/render_helpers/grading_report/cells/single_assessor_feedback_cell.php
index ec62d7d5..1ae44547 100644
--- a/classes/render_helpers/grading_report/cells/single_assessor_feedback_cell.php
+++ b/classes/render_helpers/grading_report/cells/single_assessor_feedback_cell.php
@@ -148,7 +148,7 @@ public function get_table_header($options = array()) {
/**
* @return string
*/
- public function get_table_header_class(){
+ public function get_table_header_class() {
return 'feedbackandgrading';
}
diff --git a/classes/render_helpers/grading_report/cells/status_cell.php b/classes/render_helpers/grading_report/cells/status_cell.php
index 9a0a0536..898d6941 100644
--- a/classes/render_helpers/grading_report/cells/status_cell.php
+++ b/classes/render_helpers/grading_report/cells/status_cell.php
@@ -54,7 +54,7 @@ public function get_table_header($options = array()) {
/**
* @return string
*/
- public function get_table_header_class(){
+ public function get_table_header_class() {
return 'tableheadstatus';
}
diff --git a/classes/render_helpers/grading_report/cells/submission_cell.php b/classes/render_helpers/grading_report/cells/submission_cell.php
index 27742bfb..7c467bbb 100644
--- a/classes/render_helpers/grading_report/cells/submission_cell.php
+++ b/classes/render_helpers/grading_report/cells/submission_cell.php
@@ -148,7 +148,7 @@ public function get_table_header($options = array()) {
/**
* @return string
*/
- public function get_table_header_class(){
+ public function get_table_header_class() {
return 'tableheadfilename';
}
diff --git a/classes/render_helpers/grading_report/cells/time_submitted_cell.php b/classes/render_helpers/grading_report/cells/time_submitted_cell.php
index dd4d8e41..ce6ff4b7 100644
--- a/classes/render_helpers/grading_report/cells/time_submitted_cell.php
+++ b/classes/render_helpers/grading_report/cells/time_submitted_cell.php
@@ -80,7 +80,7 @@ public function prepare_content_cell($row_object) {
if ($submission->is_late() && (!$submission->has_extension() || !$submission->submitted_within_extension())) {
// check if submission has personal deadline
- if ($coursework->personaldeadlineenabled ){
+ if ($coursework->personaldeadlineenabled ) {
$deadline = $submission->submission_personal_deadline();
} else { // if not, use coursework default deadline
$deadline = $coursework->deadline;
@@ -211,7 +211,7 @@ public function get_table_header($options = array()) {
/**
* @return string
*/
- public function get_table_header_class(){
+ public function get_table_header_class() {
return 'tableheaddate';
}
diff --git a/classes/render_helpers/grading_report/cells/user_cell.php b/classes/render_helpers/grading_report/cells/user_cell.php
index 783079f3..b8d09681 100644
--- a/classes/render_helpers/grading_report/cells/user_cell.php
+++ b/classes/render_helpers/grading_report/cells/user_cell.php
@@ -130,7 +130,7 @@ public function get_table_header($options = array()) {
/**
* @return string
*/
- public function get_table_header_class(){
+ public function get_table_header_class() {
return 'studentname';
}
diff --git a/classes/sample_set_rule/sample_base.php b/classes/sample_set_rule/sample_base.php
index 914de116..f016f9ba 100644
--- a/classes/sample_set_rule/sample_base.php
+++ b/classes/sample_set_rule/sample_base.php
@@ -154,7 +154,7 @@ abstract public function adjust_sample_set($rule_id,&$manual_sample_set,&$alloca
*
* @return array
*/
- protected function finalised_submissions(){
+ protected function finalised_submissions() {
global $DB;
$sql = "SELECT allocatableid
@@ -171,7 +171,7 @@ protected function finalised_submissions(){
*
* @return array
*/
- protected function released_submissions(){
+ protected function released_submissions() {
global $DB;
$sql = "SELECT allocatableid
diff --git a/classes/stages/base.php b/classes/stages/base.php
index 6797cce6..79a0247b 100644
--- a/classes/stages/base.php
+++ b/classes/stages/base.php
@@ -96,7 +96,7 @@ public function make_auto_allocation_if_necessary($allocatable) {
return;
}
- if ($this->get_coursework()->assessorallocationstrategy == 'group_assessor' && $this->identifier() == 'assessor_1' ){
+ if ($this->get_coursework()->assessorallocationstrategy == 'group_assessor' && $this->identifier() == 'assessor_1' ) {
// get teacher form the group
$teacher = $this->get_assessor_from_moodle_course_group($allocatable);
//$teacher = user::find(12);
@@ -234,7 +234,7 @@ protected function is_moderator() {
private function get_next_teacher($allocatable) {
// for percentage allocation use only those teachers that have percentage allocated
- if ($this->coursework->assessorallocationstrategy == 'percentages'){
+ if ($this->coursework->assessorallocationstrategy == 'percentages') {
$teachers = $this->get_percentage_allocated_teachers();
} else {
$teachers = $this->get_teachers();
@@ -247,7 +247,7 @@ private function get_next_teacher($allocatable) {
* Get ids of teachers who have percentage allocated to them
* @return array
*/
- private function get_percentage_allocated_teachers(){
+ private function get_percentage_allocated_teachers() {
global $DB;
return $DB->get_records('coursework_allocation_config', array('courseworkid' => $this->get_coursework_id()), '', 'assessorid as id');
@@ -388,7 +388,7 @@ public function get_feedback_for_allocatable($allocatable) {
* @param $submission
* @return feedback|bool
*/
- public function get_single_feedback($submission){
+ public function get_single_feedback($submission) {
feedback::fill_pool_coursework($submission->courseworkid);
$result = feedback::get_object($submission->courseworkid, 'submissionid-stage_identifier', [$submission->id, 'assessor_1']);
@@ -416,7 +416,7 @@ public function has_allocation($allocatable) {
*
* @return bool
*/
- public function stage_has_allocation(){
+ public function stage_has_allocation() {
$coursework_id = $this->get_coursework_id();
allocation::fill_pool_coursework($coursework_id);
$record = allocation::get_object($coursework_id, 'stage_identifier', [$this->stage_identifier]);
@@ -510,7 +510,7 @@ public function allocatable_is_in_sample($allocatable) {
return true;
}
- if ($this->stage_identifier == 'final_agreed_1'){
+ if ($this->stage_identifier == 'final_agreed_1') {
return true;
}
@@ -584,7 +584,7 @@ public function user_is_moderator($moderator) {
* @param allocatable $allocatable
* @return bool
*/
- public function assessor_has_allocation($allocatable){
+ public function assessor_has_allocation($allocatable) {
global $USER;
allocation::fill_pool_coursework($this->coursework->id);
$allocation = allocation::get_object(
@@ -658,7 +658,7 @@ public function prerequisite_stages_have_feedback($allocatable) {
$submission = submission::get_object($coursework_id, 'allocatableid-allocatabletype', [$allocatable->id(), $allocatable->type()]);
if (count($submission->get_assessor_feedbacks()) >= $submission->max_number_of_feedbacks()
- && $submission->sampled_feedback_exists()){
+ && $submission->sampled_feedback_exists()) {
break;
}
}
@@ -940,11 +940,11 @@ private function selected_allocation_in_session($dropdownname) {
}
- public function get_assessor_from_moodle_course_group($allocatable){
+ public function get_assessor_from_moodle_course_group($allocatable) {
$assessor = '';
// get allocatables group
- if ($this->coursework->is_configured_to_have_group_submissions()){
+ if ($this->coursework->is_configured_to_have_group_submissions()) {
$groupid = $allocatable->id;
} else {
$user = user::get_object($allocatable->id);
diff --git a/classes/warnings.php b/classes/warnings.php
index 9aec362c..952974f6 100644
--- a/classes/warnings.php
+++ b/classes/warnings.php
@@ -215,13 +215,13 @@ public function percentage_allocations_not_complete() {
* @return string
* @throws \coding_exception
*/
- public function manual_allocation_not_completed(){
+ public function manual_allocation_not_completed() {
global $DB;
$coursework = $this->coursework;
$coursework_stages = $coursework->numberofmarkers;
- for ($i = 1; $i <= $coursework_stages; $i++){
+ for ($i = 1; $i <= $coursework_stages; $i++) {
$assessor = 'assessor_'.$i;
if ($coursework->samplingenabled == 0 || $assessor == 'assessor_1') {
@@ -267,7 +267,7 @@ public function manual_allocation_not_completed(){
* @param $params
* @return array
*/
- public function check_existing_allocations($params){
+ public function check_existing_allocations($params) {
global $DB;
$sql = "SELECT 1
FROM {coursework_allocation_pairs}
diff --git a/db/upgrade.php b/db/upgrade.php
index 4d61148e..3cff0895 100644
--- a/db/upgrade.php
+++ b/db/upgrade.php
@@ -2285,12 +2285,12 @@ function xmldb_coursework_upgrade($oldversion) {
// coursework obejct
$coursework = coursework::find($coursework);
- if ($coursework->marking_deadline_enabled() && $coursework->initialmarkingdeadline){
+ if ($coursework->marking_deadline_enabled() && $coursework->initialmarkingdeadline) {
//create initialgradingdue event
coursework_update_events($coursework, 'initialgradingdue');
}
- if ($coursework->marking_deadline_enabled() && $coursework->agreedgrademarkingdeadline){
+ if ($coursework->marking_deadline_enabled() && $coursework->agreedgrademarkingdeadline) {
//create agreedgradegradingdue event
coursework_update_events($coursework, 'agreedgradingdue');
}
@@ -2406,7 +2406,7 @@ function xmldb_coursework_upgrade($oldversion) {
}
- if ($oldversion < 2018042401){
+ if ($oldversion < 2018042401) {
$table = new xmldb_table('coursework_mod_agreements');
$upgradefield = new xmldb_field('lasteditedbyid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
diff --git a/lib.php b/lib.php
index 14028828..5927f641 100644
--- a/lib.php
+++ b/lib.php
@@ -278,7 +278,7 @@ function mod_coursework_core_calendar_provide_event_action(calendar_event $event
$student = $coursework->can_submit();
$marker = $coursework->is_assessor($user);
- if ($marker){ // for markers
+ if ($marker) { // for markers
// check how many submissions to mark
$outstandingmarking = new outstanding_marking();
@@ -428,7 +428,7 @@ function coursework_update_instance($coursework) {
$coursework->timemodified = time();
$coursework->id = $coursework->instance;
- if ($coursework->finalstagegrading == 1){
+ if ($coursework->finalstagegrading == 1) {
$coursework->automaticagreementstrategy = 'none';
$coursework->automaticagreementrange = 10;
}
@@ -496,14 +496,14 @@ function coursework_update_instance($coursework) {
// update event for calendar(cw name/deadline) if a coursework has a deadline
if ($coursework->deadline) {
coursework_update_events($coursework, 'due'); //cw deadline
- if ($coursework->initialmarkingdeadline){
+ if ($coursework->initialmarkingdeadline) {
//update
coursework_update_events($coursework, 'initialgradingdue'); //cw initial grading deadine
} else {
//remove it
remove_event($coursework, 'initialgradingdue');
}
- if ($coursework->agreedgrademarkingdeadline && $coursework->numberofmarkers > 1){
+ if ($coursework->agreedgrademarkingdeadline && $coursework->numberofmarkers > 1) {
//update
coursework_update_events($coursework, 'agreedgradingdue'); //cw agreed grade deadine
} else {
@@ -523,13 +523,13 @@ function coursework_update_instance($coursework) {
*
* @param $coursework
*/
- function coursework_update_events($coursework, $eventtype){
+ function coursework_update_events($coursework, $eventtype) {
global $DB;
$event = "";
$eventid = $DB->get_record('event', array('modulename' => 'coursework', 'instance' => $coursework->id, 'eventtype' => $eventtype));
- if ($eventid){
+ if ($eventid) {
$event = calendar_event::load($eventid->id);
}
@@ -544,7 +544,7 @@ function coursework_update_events($coursework, $eventtype){
}
// update/create event for coursework initialmarking deadline [initialgradingdue]
- if ($eventtype == 'initialgradingdue'){
+ if ($eventtype == 'initialgradingdue') {
$data = coursework_event($coursework, $coursework->intro, $coursework->id, $eventtype, $coursework->initialmarkingdeadline);
if ($event) {
$event->update($data); //update if event exists
@@ -554,7 +554,7 @@ function coursework_update_events($coursework, $eventtype){
}
// update/create event for coursework agreedgrademarking deadline [agreedgradingdue]
- if ($eventtype == 'agreedgradingdue'){
+ if ($eventtype == 'agreedgradingdue') {
$data = coursework_event($coursework, $coursework->intro, $coursework->id, $eventtype, $coursework->agreedgrademarkingdeadline);
if ($event) {
$event->update($data); //update if event exists
@@ -564,12 +564,12 @@ function coursework_update_events($coursework, $eventtype){
}
}
-function remove_event($coursework, $eventtype = false){
+function remove_event($coursework, $eventtype = false) {
global $DB;
$params = array('modulename' => 'coursework', 'instance' => $coursework->id);
- if ($eventtype){
+ if ($eventtype) {
$params['eventtype'] = $eventtype;
}
@@ -1276,7 +1276,7 @@ function course_group_member_added($event_data) {
// get all courseworks with group_assessor allocation strategy
$courseworks = $DB->get_records('coursework', array('course' => $courseid, 'assessorallocationstrategy' => 'group_assessor'));
- foreach($courseworks as $coursework){
+ foreach($courseworks as $coursework) {
$coursework = coursework::find($coursework);
$stage = $coursework->marking_stages();
@@ -1285,19 +1285,19 @@ function course_group_member_added($event_data) {
$student = $coursework->can_submit(); // check if user is student in this course
$initial_stage_assessor = has_capability('mod/coursework:addinitialgrade', $coursework->get_context(), $addeduserid); // check if user is initial stage assessor in this course
- if ($initial_stage_assessor){
+ if ($initial_stage_assessor) {
// check if any assessor already exists in the group except currently added one
$assessors_in_group = get_enrolled_users($coursework->get_context(), 'mod/coursework:addinitialgrade', $groupid);
unset($assessors_in_group[$addeduserid]); //remove added assessor as at this point they will be already in the group
- if ($assessors_in_group){//yes - do nothing as other assessor is already assigned to group members, return true
+ if ($assessors_in_group) {//yes - do nothing as other assessor is already assigned to group members, return true
break;
} else{ //no - check if CW is a group coursework
- if ($coursework->is_configured_to_have_group_submissions()){// yes - assign the tutor to a allocatable group
+ if ($coursework->is_configured_to_have_group_submissions()) {// yes - assign the tutor to a allocatable group
$stage_1->make_auto_allocation_if_necessary(group::find($groupid));
} else { // no, check if group has any student members
$allocatables = $coursework->get_allocatables();
- if ($allocatables){
+ if ($allocatables) {
// yes - assign this assessor to every allocatable student in the appropriate course group - at this point assessor should already be a member
foreach($allocatables as $allocatable) {
// process students allocations
@@ -1341,7 +1341,7 @@ function course_group_member_removed($event_data) {
// get all courseworks with group_assessor allocation strategy
$courseworks = $DB->get_records('coursework', array('course' => $courseid, 'assessorallocationstrategy' => 'group_assessor'));
- foreach($courseworks as $coursework){
+ foreach($courseworks as $coursework) {
$coursework = coursework::find($coursework);
$stage = $coursework->marking_stages();
@@ -1350,7 +1350,7 @@ function course_group_member_removed($event_data) {
$student = $coursework->can_submit(); // check if user is student in this course
$initial_stage_assessor = has_capability('mod/coursework:addinitialgrade', $coursework->get_context(), $removeduserid); // check if user was initial stage assessor in this course
- if ($initial_stage_assessor){
+ if ($initial_stage_assessor) {
// remove all assessor allocations for this group
if ($coursework->is_configured_to_have_group_submissions()) {
if (can_delete_allocation($coursework->id(), $groupid)) {
@@ -1359,8 +1359,8 @@ function course_group_member_removed($event_data) {
} else {
// find all individual students in the group
$students = get_enrolled_users($coursework->get_context(), 'mod/coursework:submit', $groupid);
- if ($students){
- foreach($students as $student){
+ if ($students) {
+ foreach($students as $student) {
if (can_delete_allocation($coursework->id(), $student->id)) {
$DB->delete_records('coursework_allocation_pairs', array('courseworkid' => $coursework->id(), 'assessorid' => $removeduserid, 'allocatableid' => $student->id, 'stage_identifier' => 'assessor_1'));
}
@@ -1374,7 +1374,7 @@ function course_group_member_removed($event_data) {
$assessors_in_group = get_enrolled_users($coursework->get_context(), 'mod/coursework:addinitialgrade', $groupid);
if ($assessors_in_group) { // if another assessor found, assign all allocatables in this group to the other assessor
- if ($coursework->is_configured_to_have_group_submissions()){// yes - assign the assessor to a allocatable group
+ if ($coursework->is_configured_to_have_group_submissions()) {// yes - assign the assessor to a allocatable group
$stage_1->make_auto_allocation_if_necessary(group::find($groupid));
} else {
$allocatables = $coursework->get_allocatables();
@@ -1470,7 +1470,7 @@ function plagiarism_similarity_information($course_module) {
/**
* @return bool
*/
-function has_user_seen_tii_EULA_agreement(){
+function has_user_seen_tii_EULA_agreement() {
global $CFG, $DB, $USER;
// if TII plagiarism enabled check if user agreed/disagreed EULA
@@ -1479,7 +1479,7 @@ function has_user_seen_tii_EULA_agreement(){
$plagiarismsettings = (array)get_config('plagiarism_turnitin');
if (!empty($plagiarismsettings['enabled'])) {
- if ($DB->get_manager()->table_exists('plagiarism_turnitin_users')){
+ if ($DB->get_manager()->table_exists('plagiarism_turnitin_users')) {
$sql = "SELECT * FROM {plagiarism_turnitin_users}
WHERE userid = :userid
AND user_agreement_accepted <> 0";
@@ -1515,7 +1515,7 @@ function coursework_is_ulcc_digest_coursework_plugin_installed() {
* @param $courseworkid
* @return bool
*/
-function coursework_personal_deadline_passed($courseworkid){
+function coursework_personal_deadline_passed($courseworkid) {
global $DB;
$sql = "SELECT *
@@ -1535,7 +1535,7 @@ function coursework_personal_deadline_passed($courseworkid){
* @param $deadline
* @return stdClass
*/
-function coursework_event($coursework, $description, $instance, $eventtype, $deadline){
+function coursework_event($coursework, $description, $instance, $eventtype, $deadline) {
$event = new stdClass();
$event->type = CALENDAR_EVENT_TYPE_ACTION;
@@ -1553,7 +1553,7 @@ function coursework_event($coursework, $description, $instance, $eventtype, $dea
$event->timesort = $deadline;
$event->visible = instance_is_visible('coursework', $coursework);
- /* if ($eventtype == 'initialgradingdue'){
+ /* if ($eventtype == 'initialgradingdue') {
$event->name .= " (Initial stage)";
} else if ($eventtype == 'agreedgradingdue') {
$event->name .= " (Agreed Grade stage)";
@@ -1568,7 +1568,7 @@ function coursework_event($coursework, $description, $instance, $eventtype, $dea
* @param $event_data
* @return bool
*/
-function teacher_allocation_cache_purge($event_data){
+function teacher_allocation_cache_purge($event_data) {
global $DB;
$roleid = $event_data->objectid;
@@ -1590,20 +1590,20 @@ function teacher_allocation_cache_purge($event_data){
* @return bool
* @throws dml_exception
*/
-function teacher_removed_allocated_not_graded($event_data){
+function teacher_removed_allocated_not_graded($event_data) {
global $DB;
$userid = $event_data->relateduserid;
$courseid = $event_data->courseid;
$courseworks = coursework_get_courseworks_by_courseid($courseid);
- foreach($courseworks as $cw){
+ foreach($courseworks as $cw) {
$coursework = coursework::find($cw->id);
- if ($coursework->allocation_enabled()){
+ if ($coursework->allocation_enabled()) {
$assessor_allocations = $DB->get_records('coursework_allocation_pairs', array('courseworkid' => $coursework->id,
'assessorid' => $userid));
- foreach($assessor_allocations as $allocation){
- if ($allocation->allocatabletype == 'user'){
+ foreach($assessor_allocations as $allocation) {
+ if ($allocation->allocatabletype == 'user') {
$allocatable = user::find($allocation->allocatableid);
} else {
$allocatable = group::find($allocation->allocatableid);
@@ -1611,7 +1611,7 @@ function teacher_removed_allocated_not_graded($event_data){
$submission = $coursework->get_allocatable_submission($allocatable);
// if assessor grade the submission already, skip it
- if ($submission && $submission->has_specific_assessor_feedback($userid)){
+ if ($submission && $submission->has_specific_assessor_feedback($userid)) {
continue;
}
@@ -1632,7 +1632,7 @@ function teacher_removed_allocated_not_graded($event_data){
* @return array
* @throws dml_exception
*/
-function coursework_get_courseworks_by_courseid($courseid){
+function coursework_get_courseworks_by_courseid($courseid) {
global $DB;
return $DB->get_records('coursework', array('course' => $courseid));
diff --git a/mod_form.php b/mod_form.php
index ac40b491..5591b8fb 100644
--- a/mod_form.php
+++ b/mod_form.php
@@ -192,7 +192,7 @@ public function validation($data, $files) {
$errors = array();
- if ($data['startdate'] != 0 && !empty($data['deadline']) && $data['startdate'] > $data['deadline']){
+ if ($data['startdate'] != 0 && !empty($data['deadline']) && $data['startdate'] > $data['deadline']) {
$errors['startdate'] = get_string('must_be_before_dealdine', 'mod_coursework');
}
@@ -204,27 +204,27 @@ public function validation($data, $files) {
$errors['generalfeedback'] = get_string('must_be_after_dealdine', 'mod_coursework');
}
- if (isset($data['initialmarkingdeadline']) && $data['initialmarkingdeadline'] != 0 && !empty($data['deadline']) && $data['initialmarkingdeadline'] < $data['deadline']){
+ if (isset($data['initialmarkingdeadline']) && $data['initialmarkingdeadline'] != 0 && !empty($data['deadline']) && $data['initialmarkingdeadline'] < $data['deadline']) {
$errors['initialmarkingdeadline'] = get_string('must_be_after_dealdine', 'mod_coursework');
}
- if (isset($data['agreedgrademarkingdeadline']) && $data['agreedgrademarkingdeadline'] != 0 && !empty($data['deadline']) && $data['agreedgrademarkingdeadline'] < $data['deadline']){
+ if (isset($data['agreedgrademarkingdeadline']) && $data['agreedgrademarkingdeadline'] != 0 && !empty($data['deadline']) && $data['agreedgrademarkingdeadline'] < $data['deadline']) {
$errors['agreedgrademarkingdeadline'] = get_string('must_be_after_dealdine', 'mod_coursework');
}
- if (isset($data['agreedgrademarkingdeadline']) && $data['agreedgrademarkingdeadline'] != 0 && $data['agreedgrademarkingdeadline'] < $data['initialmarkingdeadline'] ){
+ if (isset($data['agreedgrademarkingdeadline']) && $data['agreedgrademarkingdeadline'] != 0 && $data['agreedgrademarkingdeadline'] < $data['initialmarkingdeadline'] ) {
$errors['agreedgrademarkingdeadline'] = get_string('must_be_after_initial_grade_dealdine', 'mod_coursework');
}
- if (isset($data['initialmarkingdeadline']) && $data['initialmarkingdeadline'] != 0 && !empty($data['deadline']) && $data['deadline'] && $data['initialmarkingdeadline'] < $data['deadline']){
+ if (isset($data['initialmarkingdeadline']) && $data['initialmarkingdeadline'] != 0 && !empty($data['deadline']) && $data['deadline'] && $data['initialmarkingdeadline'] < $data['deadline']) {
$errors['initialmarkingdeadline'] = get_string('must_be_after_dealdine', 'mod_coursework');
}
- if (isset($data['agreedgrademarkingdeadline']) && $data['agreedgrademarkingdeadline'] != 0 && !empty($data['deadline']) && $data['agreedgrademarkingdeadline'] < $data['deadline']){
+ if (isset($data['agreedgrademarkingdeadline']) && $data['agreedgrademarkingdeadline'] != 0 && !empty($data['deadline']) && $data['agreedgrademarkingdeadline'] < $data['deadline']) {
$errors['agreedgrademarkingdeadline'] = get_string('must_be_after_dealdine', 'mod_coursework');
}
- if (isset($data['agreedgrademarkingdeadline']) && $data['agreedgrademarkingdeadline'] != 0 && $data['agreedgrademarkingdeadline'] < $data['initialmarkingdeadline'] ){
+ if (isset($data['agreedgrademarkingdeadline']) && $data['agreedgrademarkingdeadline'] != 0 && $data['agreedgrademarkingdeadline'] < $data['initialmarkingdeadline'] ) {
$errors['agreedgrademarkingdeadline'] = get_string('must_be_after_initial_grade_dealdine', 'mod_coursework');
}
@@ -236,12 +236,12 @@ public function validation($data, $files) {
$courseworkid = $this->get_coursework_id();
if ($courseworkid) {
$coursework = mod_coursework\models\coursework::find($courseworkid);
- if ($coursework->has_samples() && isset($data['samplingenabled']) && $data['samplingenabled'] == 0){
+ if ($coursework->has_samples() && isset($data['samplingenabled']) && $data['samplingenabled'] == 0) {
$errors['samplingenabled'] = get_string('sampling_cant_be_disabled', 'mod_coursework');
}
}
- if ( isset($data['numberofmarkers']) && $data['numberofmarkers'] == 1 && isset($data['samplingenabled']) && $data['samplingenabled'] == 1){
+ if ( isset($data['numberofmarkers']) && $data['numberofmarkers'] == 1 && isset($data['samplingenabled']) && $data['samplingenabled'] == 1) {
$errors['numberofmarkers'] = get_string('not_enough_assessors_for_sampling', 'mod_coursework');
}
@@ -258,15 +258,15 @@ function get_data() {
global $CFG;
$data = parent::get_data();
- if (!$data){
+ if (!$data) {
return false;
}
- if ($this->forceblindmarking() == 1){
+ if ($this->forceblindmarking() == 1) {
$data->blindmarking = $CFG->coursework_blindmarking;
}
- if ($data->numberofmarkers >1){
+ if ($data->numberofmarkers >1) {
$data->moderationagreementenabled = 0;
}
@@ -340,9 +340,9 @@ protected function add_submission_deadline_field() {
$optional = true;
$courseworkid = $this->get_coursework_id();
- if ($courseworkid){
+ if ($courseworkid) {
$coursework = mod_coursework\models\coursework::find($courseworkid);
- if ($coursework->extension_exists()){
+ if ($coursework->extension_exists()) {
$optional = false;
}
}
@@ -363,14 +363,14 @@ protected function add_submission_deadline_field() {
/**
* @throws coding_exception
*/
- protected function add_personal_deadline_field(){
+ protected function add_personal_deadline_field() {
$moodle_form =& $this->_form;
$options = array(0 => get_string('no'), 1 => get_string('yes'));
$courseworkid = $this->get_coursework_id();
$disabled = array();
- if (coursework_personal_deadline_passed($courseworkid)){
+ if (coursework_personal_deadline_passed($courseworkid)) {
$moodle_form->disabledif('personaldeadlineenabled', 'deadline[enabled]', 'notchecked');
$disabled = array('disabled' => true);
}
@@ -627,7 +627,7 @@ protected function add_allow_early_finalisation_field() {
/**
* @throws coding_exception
*/
- protected function add_group_submission_header(){
+ protected function add_group_submission_header() {
$moodle_form =& $this->_form;
@@ -849,7 +849,7 @@ protected function add_number_of_initial_assessors_field() {
* @param $moodle_form
* @throws coding_exception
*/
- protected function add_enable_moderation_agreement_field(){
+ protected function add_enable_moderation_agreement_field() {
$moodle_form =& $this->_form;
$options = array(0 => get_string('no'), 1 => get_string('yes'));
@@ -932,7 +932,7 @@ protected function add_blind_marking_header() {
/**
* @throws coding_exception
*/
- protected function add_assessor_anonymity_header(){
+ protected function add_assessor_anonymity_header() {
$moodle_form =& $this->_form;
$moodle_form->addElement('header', 'assessoranonymityheader', get_string('assessoranonymity', 'mod_coursework'));
@@ -978,7 +978,7 @@ protected function add_enable_blind_marking_field() {
/**
* @throws coding_exception
*/
- protected function add_enable_assessor_anonymity_field(){
+ protected function add_enable_assessor_anonymity_field() {
global $CFG;
$moodle_form =& $this->_form;
@@ -1017,14 +1017,14 @@ protected function add_individual_feedback_release_date_field() {
'minute' => date('i', $timestamp),
);
$options = array('optional' => true);
- if ($CFG->coursework_auto_release_individual_feedback == 0){
+ if ($CFG->coursework_auto_release_individual_feedback == 0) {
$options['disabled'] = true;
} else{
$default['enabled'] = 1;
}
- if ($CFG->coursework_forceauto_release_individual_feedback == 1){
+ if ($CFG->coursework_forceauto_release_individual_feedback == 1) {
$options['optional'] = false;
}
@@ -1047,7 +1047,7 @@ protected function add_individual_feedback_release_date_field() {
/**
* @throws coding_exception
*/
- protected function add_email_individual_feedback_notification_field(){
+ protected function add_email_individual_feedback_notification_field() {
global $CFG;
$moodle_form =& $this->_form;
@@ -1155,7 +1155,7 @@ private function add_allow_late_submissions_field() {
}
- protected function add_all_feedbacks_field(){
+ protected function add_all_feedbacks_field() {
$moodle_form =& $this->_form;
@@ -1189,7 +1189,7 @@ private function add_enable_sampling_checkbox() {
/**
* @throws coding_exception
*/
- private function add_view_initial_assessors_grade(){
+ private function add_view_initial_assessors_grade() {
$moodle_form =& $this->_form;
@@ -1239,7 +1239,7 @@ private function add_save_feedback_as_draft() {
/**
* @throws coding_exception
*/
- private function add_auto_populate_agreed_feedback_comments(){
+ private function add_auto_populate_agreed_feedback_comments() {
$moodle_form =& $this->_form;
$moodle_form->addElement('selectyesno', 'autopopulatefeedbackcomment', get_string('autopopulatefeedbackcomment', 'mod_coursework'));
@@ -1250,25 +1250,25 @@ private function add_auto_populate_agreed_feedback_comments(){
}
- private function forceblindmarking(){
+ private function forceblindmarking() {
global $CFG;
return $CFG->coursework_forceblindmarking;
}
- private function forceautorelease(){
+ private function forceautorelease() {
global $CFG;
return $CFG->coursework_forceauto_release_individual_feedback;
}
- private function add_extensions_header(){
+ private function add_extensions_header() {
$moodle_form =& $this->_form;
$moodle_form->addElement('header', 'extensions', get_string('extensions', 'mod_coursework'));
}
- private function add_enable_extensions_field(){
+ private function add_enable_extensions_field() {
global $CFG;
$moodle_form =& $this->_form;
@@ -1338,7 +1338,7 @@ private function add_automatic_agreement_enabled() {
}
- private function add_enable_plagiarism_flag_field(){
+ private function add_enable_plagiarism_flag_field() {
global $CFG;
$moodle_form =& $this->_form;
diff --git a/renderers/object_renderer.php b/renderers/object_renderer.php
index 436abbfd..30d77408 100644
--- a/renderers/object_renderer.php
+++ b/renderers/object_renderer.php
@@ -83,7 +83,7 @@ public function render_feedback(feedback $feedback) {
$table_row = new html_table_row();
$table_row->cells['left'] = get_string('assessor', 'mod_coursework');
- if (!has_capability('mod/coursework:submit', $coursework->get_context()) || is_siteadmin($USER->id) ){
+ if (!has_capability('mod/coursework:submit', $coursework->get_context()) || is_siteadmin($USER->id) ) {
$table_row->cells['right'] = $feedback->get_assesor_username();
} else {
@@ -177,7 +177,7 @@ public function render_feedback(feedback $feedback) {
* @param moderation $moderation
* @return string
*/
- public function render_moderation(moderation $moderation){
+ public function render_moderation(moderation $moderation) {
$title =
get_string('moderationfor', 'coursework', $moderation->get_submission()->get_allocatable_name());
@@ -1231,11 +1231,11 @@ protected function coursework_deadlines_table(mod_coursework_coursework $coursew
$normaldeadline = $coursework->deadline;
- if ($personal_deadline){
+ if ($personal_deadline) {
$normaldeadline = $personal_deadline->personal_deadline;
}
$deadline_header_text = get_string('deadline', 'coursework');
- if ($coursework->personal_deadlines_enabled() && (!has_capability('mod/coursework:submit', $PAGE->context) || is_siteadmin($USER))){
+ if ($coursework->personal_deadlines_enabled() && (!has_capability('mod/coursework:submit', $PAGE->context) || is_siteadmin($USER))) {
$deadline_header_text .= " ". get_string('default_deadline', 'coursework');
}
$deadline_date = '';
@@ -1366,7 +1366,7 @@ private function render_allocation_table_row($allocation_row) {
* @param mod_coursework_personal_deadlines_table $personal_deadlines_table
* @return string
*/
- protected function render_mod_coursework_personal_deadlines_table(mod_coursework_personal_deadlines_table $personal_deadlines_table){
+ protected function render_mod_coursework_personal_deadlines_table(mod_coursework_personal_deadlines_table $personal_deadlines_table) {
global $PAGE;
$coursework_page_url = $this->get_router()->get_path('coursework', array('coursework' => $personal_deadlines_table->get_coursework())) ;
@@ -1510,7 +1510,7 @@ protected function coursework_grading_summary_table(mod_coursework_coursework $c
$published = 0;
if (!$coursework->has_multiple_markers() && !$coursework->allocation_enabled() && !has_capability('mod/coursework:addinitialgrade', $coursework->get_context())
- && has_capability('mod/coursework:addagreedgrade', $coursework->get_context())){
+ && has_capability('mod/coursework:addagreedgrade', $coursework->get_context())) {
$warning_message = "You don't have a capability to grade anyone in this Coursework ";
@@ -1581,7 +1581,7 @@ protected function coursework_grading_summary_table(mod_coursework_coursework $c
// submissions needs grading row
$table_html .= ''.get_string('needsgrading', 'mod_coursework').' '.$needsgrading.' ';
// submissions graded
- if (has_capability('mod/coursework:addinitialgrade', $coursework->get_context()) && !is_siteadmin($USER)){
+ if (has_capability('mod/coursework:addinitialgrade', $coursework->get_context()) && !is_siteadmin($USER)) {
$table_html .= '' . get_string('graded', 'mod_coursework') . $stagename . $gradedHeader . ' ' . $graded . ' ';
} else {
$table_html .= '' . get_string('graded', 'mod_coursework') . $stagename . $gradedHeader . ' ' . $finalgrade . ' ';
@@ -1598,7 +1598,7 @@ protected function coursework_grading_summary_table(mod_coursework_coursework $c
* Get number of participants assessor can see on the grading page
* @param coursework $coursework
*/
- public function get_allocatables_count_per_assessor($coursework){
+ public function get_allocatables_count_per_assessor($coursework) {
global $USER;
$participant = 0;
$allocatables = $coursework->get_allocatables();
@@ -1610,10 +1610,10 @@ public function get_allocatables_count_per_assessor($coursework){
foreach($submissions as $sub) {
$submission = submission::find($sub);
- if ( $submission->final_grade_agreed()){
+ if ( $submission->final_grade_agreed()) {
continue;
- } else if ( count($submission->get_assessor_feedbacks()) < $submission->max_number_of_feedbacks()){
+ } else if ( count($submission->get_assessor_feedbacks()) < $submission->max_number_of_feedbacks()) {
unset($submissions[$submission->id]);
}
}
@@ -1628,7 +1628,7 @@ public function get_allocatables_count_per_assessor($coursework){
if ($coursework->assessor_has_any_allocation_for_student($allocatable) || has_capability('mod/coursework:addagreedgrade', $coursework->get_context())
&& !empty($submission) && (($submission->all_inital_graded() && !$coursework->sampling_enabled())
- || ($coursework->sampling_enabled() && $submission->all_inital_graded() && $submission->max_number_of_feedbacks() >1 ))){
+ || ($coursework->sampling_enabled() && $submission->all_inital_graded() && $submission->max_number_of_feedbacks() >1 ))) {
$participant ++;
}
}
@@ -1750,13 +1750,13 @@ public function get_assessor_initial_graded_submissions($submissions) {
* @return mixed
* @throws exception
*/
- public function get_submissions_with_final_grade($submissions){
+ public function get_submissions_with_final_grade($submissions) {
foreach($submissions as $sub) {
$submission = submission::find($sub);
- if (!$submission->get_final_feedback()){
+ if (!$submission->get_final_feedback()) {
unset($submissions[$sub->id]);
}
@@ -1773,7 +1773,7 @@ public function get_submissions_with_final_grade($submissions){
* @return array
* @throws coding_exception
*/
- public function get_submissions_for_assessor($coursework, $submissions){
+ public function get_submissions_for_assessor($coursework, $submissions) {
global $USER;
$gradeblesub = array();
@@ -1783,7 +1783,7 @@ public function get_submissions_for_assessor($coursework, $submissions){
foreach($submissions as $sub) {
$submission = submission::find($sub);
- if ( $submission->final_grade_agreed()){
+ if ( $submission->final_grade_agreed()) {
continue;
} else if (count($submission->get_assessor_feedbacks()) < $submission->max_number_of_feedbacks()) {
unset($submissions[$submission->id]);
@@ -1804,7 +1804,7 @@ public function get_submissions_for_assessor($coursework, $submissions){
$submission = submission::find($sub);
if ($coursework->assessor_has_any_allocation_for_student($submission->reload()->get_allocatable()) || (has_capability('mod/coursework:addagreedgrade', $coursework->get_context()))
&& !empty($submission) && (($submission->all_inital_graded() && !$submission->get_coursework()->sampling_enabled())
- || ($submission->get_coursework()->sampling_enabled() && $submission->all_inital_graded() && $submission->max_number_of_feedbacks() >1))){
+ || ($submission->get_coursework()->sampling_enabled() && $submission->all_inital_graded() && $submission->max_number_of_feedbacks() >1))) {
$gradeblesub[$submission->id] = $submission;
}
diff --git a/renderers/page_renderer.php b/renderers/page_renderer.php
index aae4149b..d195c53c 100644
--- a/renderers/page_renderer.php
+++ b/renderers/page_renderer.php
@@ -387,7 +387,7 @@ public function new_feedback_page($new_feedback , $ajax = false) {
$teacher_feedback = new feedback();
$feedbackcomment = '';
$count = 1;
- foreach($initial_feedbacks as $initial_feedback){
+ foreach($initial_feedbacks as $initial_feedback) {
// put all initial feedbacks together for the comment field
$feedbackcomment .= get_string('assessorcomments', 'mod_coursework', $count);
$feedbackcomment .= $initial_feedback->feedbackcomment;
@@ -451,7 +451,7 @@ private function get_comment_options($simple_form) {
* @param moderation $new_moderation
* @throws coding_exception
*/
- public function new_moderation_page($new_moderation){
+ public function new_moderation_page($new_moderation) {
global $PAGE, $OUTPUT, $SITE, $DB;
@@ -483,7 +483,7 @@ public function new_moderation_page($new_moderation){
* @param plagiarism_flag $new_plagiarism_flag
* @throws coding_exception
*/
- public function new_plagiarism_flag_page($new_plagiarism_flag){
+ public function new_plagiarism_flag_page($new_plagiarism_flag) {
global $PAGE, $OUTPUT, $SITE, $DB;
@@ -512,7 +512,7 @@ public function new_plagiarism_flag_page($new_plagiarism_flag){
* @param plagiarism_flag $plagiarism_flag
* @throws coding_exception
*/
- public function edit_plagiarism_flag_page(plagiarism_flag $plagiarism_flag, $creator, $editor){
+ public function edit_plagiarism_flag_page(plagiarism_flag $plagiarism_flag, $creator, $editor) {
global $PAGE, $OUTPUT, $SITE, $DB;
@@ -648,7 +648,7 @@ public function teacher_grading_page($coursework, $page, $perpage, $sortby, $sor
|| has_capability('mod/coursework:addagreedgrade', $PAGE->context)
|| has_capability('mod/coursework:addallocatedagreedgrade', $PAGE->context)
|| has_capability('mod/coursework:administergrades', $PAGE->context))
- && $coursework->get_finalised_submissions()){
+ && $coursework->get_finalised_submissions()) {
//export grading sheet
$url = $pageurl.'&export_grading_sheet=1';
$links[$url] = get_string('exportgradingsheets', 'mod_coursework');
@@ -937,7 +937,7 @@ protected function submission_as_readonly_table($submission) {
if ($submission->is_late() && (!$submission->has_extension() || !$submission->submitted_within_extension())) { // It was late.
// check if submission has personal deadline
- if ($coursework->personaldeadlineenabled ){
+ if ($coursework->personaldeadlineenabled ) {
$deadline = $submission->submission_personal_deadline();
} else { // if not, use coursework default deadline
$deadline = $coursework->deadline;
@@ -1259,7 +1259,7 @@ function process_csv_upload($processingresults, $csvcontent, $csvtype) {
if (!empty($processingresults)) {
$html .= get_string('followingerrors', 'mod_coursework')." ";
- if (!is_array($processingresults)){
+ if (!is_array($processingresults)) {
$html .= $processingresults . " ";
} else {
foreach ($processingresults as $line => $error) {
@@ -1392,7 +1392,7 @@ function view_course_index($courseid) {
if ($coursework->can_grade()) { // teachers
$submitted = count($coursework->get_all_submissions());
} else if ($coursework->can_submit()) { //students
- if ($coursework->use_groups){
+ if ($coursework->use_groups) {
$allocatable = $coursework->get_student_group($USER);
} else {
$allocatable = $USER;
@@ -1431,7 +1431,7 @@ function view_course_index($courseid) {
return $o;
}
- public function datatables_render($coursework){
+ public function datatables_render($coursework) {
global $CFG;
$lang_messages = [
diff --git a/tests/behat/behat_mod_coursework.php b/tests/behat/behat_mod_coursework.php
index eb0b9e06..937341bb 100644
--- a/tests/behat/behat_mod_coursework.php
+++ b/tests/behat/behat_mod_coursework.php
@@ -926,7 +926,7 @@ public function iSelectTheStudentAsAPartOfTheSample($negate = false, $other) {
$student = $other ? 'other_student' : 'student';
$page = $this->get_page('allocations page');
- if ($negate){
+ if ($negate) {
$page->deselect_for_sample($this->$student, 'assessor_2');
} else {
$page->select_for_sample($this->$student, 'assessor_2');
diff --git a/tests/behat/pages/allocations_page.php b/tests/behat/pages/allocations_page.php
index c9fe11f8..ad8b9398 100644
--- a/tests/behat/pages/allocations_page.php
+++ b/tests/behat/pages/allocations_page.php
@@ -81,7 +81,7 @@ public function manually_allocate($allocatable, $assessor, $stage_identifier) {
* @param allocatable $student
* @param string $stage_identifier
*/
- public function select_for_sample($student, $stage_identifier){
+ public function select_for_sample($student, $stage_identifier) {
$elementid = $this->sampling_checkbox_id($student, $stage_identifier);
$node = $this->getPage()->find('css', $elementid);
$node->check();
@@ -260,7 +260,7 @@ public function automatically_included_in_sample($coursework, $user, $other_user
'user' => $user->id,
'stage' => $stage);
- if (empty($negate)){
+ if (empty($negate)) {
assertTrue($DB->record_exists_sql($sql, $params));
} else {
assertFalse($DB->record_exists_sql($sql, $params));
diff --git a/tests/behat/pages/multiple_grading_interface.php b/tests/behat/pages/multiple_grading_interface.php
index 95e73d1b..e359ed4c 100644
--- a/tests/behat/pages/multiple_grading_interface.php
+++ b/tests/behat/pages/multiple_grading_interface.php
@@ -326,7 +326,7 @@ public function get_provisional_grade_field($submission) {
* @param submission $submission
* @return string
*/
- public function get_grade_field($submission){
+ public function get_grade_field($submission) {
$elementid = '#assessorfeedbacktable_' . $submission->get_coursework()
->get_allocatable_identifier_hash($submission->get_allocatable()). ' .grade_for_gradebook_cell';
$grade_field = $this->getPage()->find('css', $elementid);
diff --git a/tests/classes/export/csv_test.php b/tests/classes/export/csv_test.php
index 0e9247de..2328d073 100644
--- a/tests/classes/export/csv_test.php
+++ b/tests/classes/export/csv_test.php
@@ -59,7 +59,7 @@ public function setUp() {
* One stage only, extension enabled
* @throws coding_exception
*/
- public function test_one_stage(){
+ public function test_one_stage() {
$dateformat = '%a, %d %b %Y, %H:%M';
$generator = $this->getDataGenerator()->get_plugin_generator('mod_coursework');
@@ -110,7 +110,7 @@ public function test_one_stage(){
$csv_cells = array('name', 'username', 'submissiondate', 'submissiontime',
'submissionfileid');
- if ($this->coursework->extensions_enabled()){
+ if ($this->coursework->extensions_enabled()) {
$csv_cells[] = 'extensiondeadline';
$csv_cells[] = 'extensionreason';
$csv_cells[] = 'extensionextrainfo';
@@ -148,7 +148,7 @@ public function test_one_stage(){
/**
* Two stages with final agreed grade, extension not enabled
*/
- public function test_two_stages(){
+ public function test_two_stages() {
$dateformat = '%a, %d %b %Y, %H:%M';
$generator = $this->getDataGenerator()->get_plugin_generator('mod_coursework');
@@ -196,7 +196,7 @@ public function test_two_stages(){
$csv_cells = array('name', 'username', 'submissiondate', 'submissiontime',
'submissionfileid');
- if ($this->coursework->extensions_enabled()){
+ if ($this->coursework->extensions_enabled()) {
$csv_cells[] = 'extensiondeadline';
$csv_cells[] = 'extensionreason';
$csv_cells[] = 'extensionextrainfo';
@@ -242,7 +242,7 @@ public function test_two_stages(){
/**
* Sampling enabled, student not in sample, extension not enabled
*/
- public function test_student_not_in_sample(){
+ public function test_student_not_in_sample() {
$dateformat = '%a, %d %b %Y, %H:%M';
$generator = $this->getDataGenerator()->get_plugin_generator('mod_coursework');
@@ -273,7 +273,7 @@ public function test_student_not_in_sample(){
$csv_cells = array('name', 'username', 'submissiondate', 'submissiontime',
'submissionfileid');
- if ($this->coursework->extensions_enabled()){
+ if ($this->coursework->extensions_enabled()) {
$csv_cells[] = 'extensiondeadline';
$csv_cells[] = 'extensionreason';
$csv_cells[] = 'extensionextrainfo';
@@ -317,7 +317,7 @@ public function test_student_not_in_sample(){
/**
* Two students but only one is double marked and should have agreed grade, extension not enabled
*/
- public function test_two_students_one_in_sample(){
+ public function test_two_students_one_in_sample() {
global $DB;
$dateformat = '%a, %d %b %Y, %H:%M';
$generator = $this->getDataGenerator()->get_plugin_generator('mod_coursework');
@@ -388,7 +388,7 @@ public function test_two_students_one_in_sample(){
$csv_cells = array('name', 'username', 'submissiondate', 'submissiontime',
'submissionfileid');
- if ($this->coursework->extensions_enabled()){
+ if ($this->coursework->extensions_enabled()) {
$csv_cells[] = 'extensiondeadline';
$csv_cells[] = 'extensionreason';
$csv_cells[] = 'extensionextrainfo';
diff --git a/tests/classes/export/grading_sheet_download_test.php b/tests/classes/export/grading_sheet_download_test.php
index b63d5670..01cf13b9 100644
--- a/tests/classes/export/grading_sheet_download_test.php
+++ b/tests/classes/export/grading_sheet_download_test.php
@@ -54,7 +54,7 @@ public function setUp() {
* One stage only, no allocation, one student, coursework submitted but not graded
* @throws coding_exception
*/
- public function test_one_stage_no_allocations(){
+ public function test_one_stage_no_allocations() {
$generator = $this->getDataGenerator()->get_plugin_generator('mod_coursework');
@@ -98,7 +98,7 @@ public function test_one_stage_no_allocations(){
* student1 graded by assessor2, student2 graded by assessor1 and assessor2
* @throws coding_exception
*/
- public function test_two_stages_with_allocations(){
+ public function test_two_stages_with_allocations() {
$generator = $this->getDataGenerator()->get_plugin_generator('mod_coursework');
/* @var mod_coursework_generator $generator */
diff --git a/view.php b/view.php
index ac31d3a9..3d3d4242 100644
--- a/view.php
+++ b/view.php
@@ -82,7 +82,7 @@
// If a session variable holding page preference for the specific coursework is not set, set default value (0).
if (isset($SESSION->perpage[$course_module_id]) && optional_param('per_page', 0, PARAM_INT) != $SESSION->perpage[$course_module_id]
- && optional_param('per_page', 0, PARAM_INT) != 0){ // prevent blank pages if not in correct page
+ && optional_param('per_page', 0, PARAM_INT) != 0) { // prevent blank pages if not in correct page
$page = 0;
$SESSION->page[$course_module_id] = $page;
} else if (!(isset($SESSION->page[$course_module_id]))) {
@@ -149,7 +149,7 @@
//we will use the same defaults as page (above) defaulting to page setting if no specific viewallstudents_page has been set
if (isset($SESSION->viewallstudents_perpage[$course_module_id]) && optional_param('viewallstudents_per_page', 0, PARAM_INT) != $SESSION->viewallstudents_perpage[$course_module_id]
- && optional_param('viewallstudents_per_page', 0, PARAM_INT) != 0){ // prevent blank pages if not in correct page
+ && optional_param('viewallstudents_per_page', 0, PARAM_INT) != 0) { // prevent blank pages if not in correct page
$viewallstudents_page = 0;
$SESSION->viewallstudents_page[$course_module_id] = $viewallstudents_page;
} else if (!(isset($SESSION->viewallstudents_page[$course_module_id]))) {
@@ -254,7 +254,7 @@
$coursework = mod_coursework\models\coursework::find($coursework_record);
// check if group is in session and use it no group available in url
-if (groups_get_activity_groupmode($coursework->get_course_module()) != 0 && $group == -1){
+if (groups_get_activity_groupmode($coursework->get_course_module()) != 0 && $group == -1) {
// check if a group is in SESSION
$group = groups_get_activity_group($coursework->get_course_module());
}
@@ -265,7 +265,7 @@
$percentage_allocation_not_complete = $warnings->percentage_allocations_not_complete();
$manual_allocation_not_complete = '';
- if ($coursework->allocation_enabled()){
+ if ($coursework->allocation_enabled()) {
$manual_allocation_not_complete = $warnings->manual_allocation_not_completed();
}
@@ -299,12 +299,12 @@
send_temp_file($zip_file, $filename); // Send file and delete after sending.
}
-if ($export_grades){
+if ($export_grades) {
// headers and data for csv
$csv_cells = array('name', 'username', 'idnumber', 'email');
- if ($coursework->personal_deadlines_enabled()){
+ if ($coursework->personal_deadlines_enabled()) {
$csv_cells[] = 'personaldeadline';
}
@@ -312,20 +312,20 @@
$csv_cells[] = 'submissiontime';
$csv_cells[] = 'submissionfileid';
- if ($coursework->extensions_enabled() && ($coursework->has_deadline()) || $coursework->personal_deadlines_enabled()){
+ if ($coursework->extensions_enabled() && ($coursework->has_deadline()) || $coursework->personal_deadlines_enabled()) {
$csv_cells[] = 'extensiondeadline';
$csv_cells[] = 'extensionreason';
$csv_cells[] = 'extensionextrainfo';
}
- if ($coursework->plagiarism_flagging_enbled()){
+ if ($coursework->plagiarism_flagging_enbled()) {
$csv_cells[] = 'plagiarismflagstatus';
$csv_cells[] = 'plagiarismflagcomment';
}
$csv_cells[] = 'stages';
- if ($coursework->moderation_agreement_enabled()){
+ if ($coursework->moderation_agreement_enabled()) {
$csv_cells[] = 'moderationagreement';
}
$csv_cells[] = 'finalgrade';
@@ -337,7 +337,7 @@
}
-if ($download_grading_sheet){
+if ($download_grading_sheet) {
$csv_cells = \mod_coursework\export\grading_sheet::cells_array($coursework);
@@ -395,7 +395,7 @@
// Print the page header.
// sort group by groupname (default)
-if ($coursework->is_configured_to_have_group_submissions()){
+if ($coursework->is_configured_to_have_group_submissions()) {
$sortby = optional_param('sortby', 'groupname', PARAM_ALPHA);
$viewallstudents_sortby = optional_param('viewallstudents_sortby', 'groupname', PARAM_ALPHA);
@@ -513,13 +513,13 @@
}
} else {
- if ($resettable){
+ if ($resettable) {
$coursework_firstname_alpha = $SESSION->coursework_firstname_alpha[$course_module_id] = "";
$coursework_lastname_alpha = $SESSION->coursework_lastname_alpha[$course_module_id] = "";
$coursework_groupname_alpha = $SESSION->coursework_groupname_alpha[$course_module_id] = "";
}
- if ($allresettable){
+ if ($allresettable) {
$viewallstudents_firstname_alpha = $SESSION->viewallstudents_firstname_alpha[$course_module_id] = "";
$viewallstudents_lastname_alpha = $SESSION->viewallstudents_lastname_alpha[$course_module_id] = "";
$viewallstudents_groupname_alpha = $SESSION->viewallstudents_groupname_alpha[$course_module_id] = "";
From 413fc13c0dce64252a808ca8b06a1562e0f7a15b Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Mon, 12 Aug 2024 12:23:31 +0100
Subject: [PATCH 12/51] CTP-3558 coding std insert space in for(
---
actions/allocationsession.php | 8 ++++----
classes/allocation/manager.php | 2 +-
classes/export/csv/cells/otherassessors_cell.php | 2 +-
classes/export/grading_sheet.php | 2 +-
classes/export/import.php | 2 +-
classes/sample_set_rule/range_sample_type.php | 6 +++---
classes/sample_set_rule/total_sample_type.php | 2 +-
renderers/object_renderer.php | 10 +++++-----
8 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/actions/allocationsession.php b/actions/allocationsession.php
index f51edecd..06e63d93 100644
--- a/actions/allocationsession.php
+++ b/actions/allocationsession.php
@@ -42,19 +42,19 @@
$SESSION->coursework_allocationsessions[$coursemoduleid] = array();
}
-for($i = 0; $i < count($assesorselect); $i++) {
+for ($i = 0; $i < count($assesorselect); $i++) {
$SESSION->coursework_allocationsessions[$coursemoduleid][$assesorselect[$i]] = $assesorselectvalue[$i];
}
-for($i = 0; $i < count($pinnedchk); $i++) {
+for ($i = 0; $i < count($pinnedchk); $i++) {
$SESSION->coursework_allocationsessions[$coursemoduleid][$pinnedchk[$i]] = $pinnedchkval[$i];
}
-for($i = 0; $i < count($moderatorselect); $i++) {
+for ($i = 0; $i < count($moderatorselect); $i++) {
$SESSION->coursework_allocationsessions[$coursemoduleid][$moderatorselect[$i]] = $moderatorselectvalue[$i];
}
-for($i = 0; $i < count($samplechk); $i++) {
+for ($i = 0; $i < count($samplechk); $i++) {
$SESSION->coursework_allocationsessions[$coursemoduleid][$samplechk[$i]] = $samplechkvalue[$i];
}
diff --git a/classes/allocation/manager.php b/classes/allocation/manager.php
index e57ba61f..950f8b3e 100644
--- a/classes/allocation/manager.php
+++ b/classes/allocation/manager.php
@@ -300,7 +300,7 @@ public function auto_generate_sample_set() {
if (isset($allocatables[$faa->allocatableid])) unset($allocatables[$faa->allocatableid]);
}
- for($stage_number = 2; $stage_number <= $this->get_coursework()->get_max_markers(); $stage_number++) {
+ for ($stage_number = 2; $stage_number <= $this->get_coursework()->get_max_markers(); $stage_number++) {
$stage = "assessor_{$stage_number}";
diff --git a/classes/export/csv/cells/otherassessors_cell.php b/classes/export/csv/cells/otherassessors_cell.php
index 330d2a16..9666ec2a 100644
--- a/classes/export/csv/cells/otherassessors_cell.php
+++ b/classes/export/csv/cells/otherassessors_cell.php
@@ -106,7 +106,7 @@ public function get_cell($submission, $student, $stage_identifier) {
$blankcolumns = $numothereassessorfeedbacks - count($feedbacks);
- for($i = 0; $i < $blankcolumns; $i++) {
+ for ($i = 0; $i < $blankcolumns; $i++) {
if ($this->coursework->is_using_rubric()) {
$criterias = $this->coursework->get_rubric_criteria();
foreach ($criterias as $criteria) { // rubrics can have multiple parts, so let's create header for each of it
diff --git a/classes/export/grading_sheet.php b/classes/export/grading_sheet.php
index a65be569..d0966612 100644
--- a/classes/export/grading_sheet.php
+++ b/classes/export/grading_sheet.php
@@ -160,7 +160,7 @@ public static function cells_array($coursework) {
// based on capabilities decide what view display - singlegrade or multiplegrade
if ((has_capability('mod/coursework:addagreedgrade', $PAGE->context) || has_capability('mod/coursework:administergrades', $PAGE->context))
&& $coursework->get_max_markers()>1 ) {
- for($i = 1; $i <= $coursework->get_max_markers(); $i++) {
+ for ($i = 1; $i <= $coursework->get_max_markers(); $i++) {
// extra column with allocated assessor name
if ($coursework->allocation_enabled() && $coursework->get_max_markers() > 1
&& (has_capability('mod/coursework:addinitialgrade', $PAGE->context)
diff --git a/classes/export/import.php b/classes/export/import.php
index 6c15614a..21515522 100644
--- a/classes/export/import.php
+++ b/classes/export/import.php
@@ -97,7 +97,7 @@ public function validate_csv($content, $encoding, $delimeter, $csv_cells) {
//holds details on grades that have been successfully uploaded for the current line
$uploadedgradecells = array();
- for($z = 0; $z < count($line); $z++) {
+ for ($z = 0; $z < count($line); $z++) {
$value = $line[$z];
$stage_identifier = $this->get_stage_identifier($submissionid, $cells[$i]);
diff --git a/classes/sample_set_rule/range_sample_type.php b/classes/sample_set_rule/range_sample_type.php
index 63b39e50..9f4e44fd 100644
--- a/classes/sample_set_rule/range_sample_type.php
+++ b/classes/sample_set_rule/range_sample_type.php
@@ -88,14 +88,14 @@ public function range_elements($assessor_number, $sequence, $dbrecord=false) {
$percentage_options = array();
- for($i = 0;$i < 110; $i = $i + 10) {
+ for ($i = 0;$i < 110; $i = $i + 10) {
$percentage_options[$i] = "{$i}";
}
$scale = array();
if ($this->coursework->grade > 0) {
- for($i=0;$i <= $this->coursework->grade; $i++) {
+ for ($i=0;$i <= $this->coursework->grade; $i++) {
$scale[] = $i;
}
} else {
@@ -289,7 +289,7 @@ function change_options(element) {
var type = PERCENT;
if ($(element).val() == PERCENT ) {
- for(var i = 0;i < 11; i++) {
+ for (var i = 0;i < 11; i++) {
selectValues[i] = (i*10);
}
} else {
diff --git a/classes/sample_set_rule/total_sample_type.php b/classes/sample_set_rule/total_sample_type.php
index 8c8cb3ae..865fa009 100644
--- a/classes/sample_set_rule/total_sample_type.php
+++ b/classes/sample_set_rule/total_sample_type.php
@@ -66,7 +66,7 @@ public function add_form_elements($assessor_number=0) {
$percentage_options = array();
- for($i = 5;$i <= 100; $i = $i + 5) {
+ for ($i = 5;$i <= 100; $i = $i + 5) {
$percentage_options[$i] = "{$i}";
}
diff --git a/renderers/object_renderer.php b/renderers/object_renderer.php
index 30d77408..8960aa75 100644
--- a/renderers/object_renderer.php
+++ b/renderers/object_renderer.php
@@ -783,7 +783,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$assessorheaders = array();
- for($i = 0; $i < $samplingwidget->get_coursework()->get_max_markers(); $i++) {
+ for ($i = 0; $i < $samplingwidget->get_coursework()->get_max_markers(); $i++) {
$assessorheaders[] = get_string('assessorheading', 'mod_coursework', $i+1);
}
@@ -793,7 +793,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$comma = "";
- for($i=0;$i <= $samplingwidget->get_coursework()->grade; $i++) {
+ for ($i=0;$i <= $samplingwidget->get_coursework()->grade; $i++) {
$scale .= $comma.$i;
$comma = ",";
}
@@ -814,7 +814,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$percentage_options = array();
- for($i = 0;$i < 110; $i = $i + 10) {
+ for ($i = 0;$i < 110; $i = $i + 10) {
$percentage_options[$i] = "{$i}%";
}
@@ -907,7 +907,7 @@ private function sampling_strategy_column($samplingwidget, $suffix = '') {
$percentage_options = array();
- for($i = 0;$i < 110; $i = $i + 10) {
+ for ($i = 0;$i < 110; $i = $i + 10) {
$percentage_options[$i] = "{$i}%";
}
@@ -921,7 +921,7 @@ private function sampling_strategy_column($samplingwidget, $suffix = '') {
$sampling_column .= html_writer::start_tag('div');
- for($i = 0; $i < 1; $i++) {
+ for ($i = 0; $i < 1; $i++) {
$sampling_column .= html_writer::start_tag('span', array('class' => "assessor_{$suffix}_grade_rules", 'id' => "assessor_{$suffix}_grade_rules"));
$sampling_column .= html_writer::checkbox("assessor_{$suffix}_samplerules[]", 1, false, get_string('grade', 'mod_coursework'),
From df2465744201717b06f0eb345f0d46bfe07c67bb Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Mon, 12 Aug 2024 12:23:53 +0100
Subject: [PATCH 13/51] CTP-3558 coding std insert space in foreach(
---
backup/moodle2/backup_coursework_stepslib.php | 2 +-
backup/moodle2/restore_coursework_stepslib.php | 8 ++++----
classes/allocation/manager.php | 6 +++---
classes/allocation/table/builder.php | 2 +-
.../personal_deadlines_controller.php | 2 +-
classes/controllers/submissions_controller.php | 4 ++--
classes/export/csv.php | 4 ++--
.../export/csv/cells/otherassessors_cell.php | 2 +-
classes/export/import.php | 12 ++++++------
classes/forms/student_submission_form.php | 2 +-
classes/framework/table_base.php | 2 +-
classes/models/submission.php | 2 +-
classes/models/user.php | 2 +-
classes/sample_set_rule/range_sample_type.php | 6 +++---
db/install.php | 2 +-
db/upgrade.php | 6 +++---
lib.php | 14 +++++++-------
renderers/object_renderer.php | 18 +++++++++---------
renderers/page_renderer.php | 2 +-
tests/behat/behat_mod_coursework.php | 2 +-
tests/behat/pages/page_base.php | 2 +-
21 files changed, 51 insertions(+), 51 deletions(-)
diff --git a/backup/moodle2/backup_coursework_stepslib.php b/backup/moodle2/backup_coursework_stepslib.php
index 6c0b66d7..d44277ed 100644
--- a/backup/moodle2/backup_coursework_stepslib.php
+++ b/backup/moodle2/backup_coursework_stepslib.php
@@ -25,7 +25,7 @@ class backup_coursework_activity_structure_step extends backup_activity_structur
protected function define_structure() {
global $DB;
- foreach(array('coursework_submissions',
+ foreach (array('coursework_submissions',
'coursework_allocation_pairs',
'coursework_mod_set_members',
'coursework_sample_set_mbrs',
diff --git a/backup/moodle2/restore_coursework_stepslib.php b/backup/moodle2/restore_coursework_stepslib.php
index 6df8dc99..1975b8c6 100644
--- a/backup/moodle2/restore_coursework_stepslib.php
+++ b/backup/moodle2/restore_coursework_stepslib.php
@@ -66,7 +66,7 @@ protected function define_structure() {
'mod_agreement' => 'coursework_submissions/coursework_submission/coursework_feedbacks/coursework_feedback/coursework_mod_agreements',
'plagiarism_flag' => 'coursework_submissions/coursework_submission/coursework_plagiarism_flags');
- foreach($bits as $bit=> $bitpath) {
+ foreach ($bits as $bit=> $bitpath) {
$p=new restore_path_element("coursework_$bit","/activity/coursework/{$bitpath}/coursework_$bit");
$paths[]=$p;
}
@@ -475,7 +475,7 @@ protected function check_grade($field,&$data) {
}
protected function set_defaults($fields,&$data) {
- foreach($fields as $name=> $default) {
+ foreach ($fields as $name=> $default) {
if (!isset($data->$name)) {
$data->$name=$default;
}
@@ -483,7 +483,7 @@ protected function set_defaults($fields,&$data) {
}
protected function updatedate($fields,&$data) {
- foreach($fields as $field) {
+ foreach ($fields as $field) {
$data->$field=$this->apply_date_offset($data->$field);
}
}
@@ -499,7 +499,7 @@ protected function after_execute() {
$files=$fs->get_area_files($ctx->id, 'mod_coursework', 'submission'); //Array of stored_file
- foreach($files as $file) {
+ foreach ($files as $file) {
if (!$file->is_directory()) {
$itemid=$file->get_itemid();
diff --git a/classes/allocation/manager.php b/classes/allocation/manager.php
index 950f8b3e..734df966 100644
--- a/classes/allocation/manager.php
+++ b/classes/allocation/manager.php
@@ -296,7 +296,7 @@ public function auto_generate_sample_set() {
$final_agreed_allocatables = $this->get_allocatables_with_final_agreed();
//remove any allocatables that have a status of final agreed as these can not be sampled
- foreach($final_agreed_allocatables as $faa) {
+ foreach ($final_agreed_allocatables as $faa) {
if (isset($allocatables[$faa->allocatableid])) unset($allocatables[$faa->allocatableid]);
}
@@ -327,7 +327,7 @@ public function auto_generate_sample_set() {
//I am also not using add the two arrays as using the overloaded + can produce dubious results when a key exists
//in both arrays
- foreach($auto_with_feedback as $k => $v) {
+ foreach ($auto_with_feedback as $k => $v) {
if (!isset($manual_sample_set[$k])) $manual_sample_set[$k] = $v;
}
@@ -344,7 +344,7 @@ public function auto_generate_sample_set() {
//save sample set
if (!empty($auto_sample_set)) {
- foreach($auto_sample_set as $allocatable) {
+ foreach ($auto_sample_set as $allocatable) {
$sample = new \stdClass();
$sample->courseworkid = $this->coursework->id;
$sample->allocatableid = $allocatable->id;
diff --git a/classes/allocation/table/builder.php b/classes/allocation/table/builder.php
index e5155c34..18f3cef0 100644
--- a/classes/allocation/table/builder.php
+++ b/classes/allocation/table/builder.php
@@ -196,7 +196,7 @@ public function get_hidden_elements() {
if (isset($SESSION->coursework_allocationsessions[$cm->id])) {
- foreach($SESSION->coursework_allocationsessions[$cm->id] as $name => $val) {
+ foreach ($SESSION->coursework_allocationsessions[$cm->id] as $name => $val) {
if (!is_array($val)) {
diff --git a/classes/controllers/personal_deadlines_controller.php b/classes/controllers/personal_deadlines_controller.php
index 18db9b61..424db0eb 100644
--- a/classes/controllers/personal_deadlines_controller.php
+++ b/classes/controllers/personal_deadlines_controller.php
@@ -90,7 +90,7 @@ protected function new_personal_deadline() {
$allocatables = unserialize($data->allocatableid);
- foreach($allocatables as $allocatableid) {
+ foreach ($allocatables as $allocatableid) {
$data->allocatableid = $allocatableid;
$data->id = '';
//$data->id = '';
diff --git a/classes/controllers/submissions_controller.php b/classes/controllers/submissions_controller.php
index 873d67c6..a3c260c9 100644
--- a/classes/controllers/submissions_controller.php
+++ b/classes/controllers/submissions_controller.php
@@ -173,7 +173,7 @@ protected function create_submission() {
$userids = explode(',', $submission->get_coursework()->get_submission_notification_users());
if (!empty($userids)) {
- foreach($userids as $u) {
+ foreach ($userids as $u) {
$notifyuser = $DB->get_record('user',array('id' => trim($u)));
if (!empty($notifyuser)) $mailer->send_submission_notification($notifyuser);
@@ -335,7 +335,7 @@ protected function unfinalise_submission() {
$changedeadlines = false;
- foreach($allocatableids as $aid) {
+ foreach ($allocatableids as $aid) {
$submission_db = $DB->get_record('coursework_submissions',
array('courseworkid' => $this->params['courseworkid'], 'allocatableid' => $aid, 'allocatabletype' => $this->params['allocatabletype']));
diff --git a/classes/export/csv.php b/classes/export/csv.php
index 147cc4fa..ac2fd4a6 100644
--- a/classes/export/csv.php
+++ b/classes/export/csv.php
@@ -106,7 +106,7 @@ public function export() {
*/
public function add_cells_to_array($submission, $student, $csv_cells) {
$row = array();
- foreach($csv_cells as $csv_cell) {
+ foreach ($csv_cells as $csv_cell) {
if (substr($csv_cell,0,8) == 'assessor') {
$stage_dentifier = 'assessor_'.(substr($csv_cell,-1));
$csv_cell = substr($csv_cell, 0, -1);
@@ -143,7 +143,7 @@ public function add_cells_to_array($submission, $student, $csv_cells) {
*/
public function add_headers($csv_headers) {
$headers = array();
- foreach($csv_headers as $header) {
+ foreach ($csv_headers as $header) {
if (substr($header,0,8) == 'assessor') {
$stage = (substr($header,-1));
$header = substr($header, 0, -1);
diff --git a/classes/export/csv/cells/otherassessors_cell.php b/classes/export/csv/cells/otherassessors_cell.php
index 9666ec2a..161d4141 100644
--- a/classes/export/csv/cells/otherassessors_cell.php
+++ b/classes/export/csv/cells/otherassessors_cell.php
@@ -60,7 +60,7 @@ public function get_cell($submission, $student, $stage_identifier) {
$gradedata = array();
// $stage_identifier = ($this->coursework->get_max_markers() == 1) ? "assessor_1" : $this->get_stage_identifier_for_assessor($submission, $student);
- foreach($feedbacks as $feedback) {
+ foreach ($feedbacks as $feedback) {
$grade = $submission->get_assessor_feedback_by_stage($feedback->stage_identifier);
if ($grade) {
diff --git a/classes/export/import.php b/classes/export/import.php
index 21515522..977e9a64 100644
--- a/classes/export/import.php
+++ b/classes/export/import.php
@@ -166,7 +166,7 @@ function rubric_count_correct($csvheader, $linefromimportedcsv) {
if ($this->coursework->finalstagegrading == 0 ) $types[] = "agreedgrade";
- foreach($types as $type) {
+ foreach ($types as $type) {
$typefound = false;
@@ -175,7 +175,7 @@ function rubric_count_correct($csvheader, $linefromimportedcsv) {
$typepositions = false;
$i = 0;
- foreach($csvheader as $ch) {
+ foreach ($csvheader as $ch) {
if (strpos($ch, $type) !== false) {
@@ -194,7 +194,7 @@ function rubric_count_correct($csvheader, $linefromimportedcsv) {
//are correct even after a splice and add is carried out
$offset = 0;
- foreach($typepositions as $position) {
+ foreach ($typepositions as $position) {
//if ($position = array_search($type, $csvheader)) {
$class = "mod_coursework\\export\\csv\\cells\\{$type}_cell";
$cell = new $class($this->coursework);
@@ -228,7 +228,7 @@ function get_rubric_headers($csvheader) {
$types = array("singlegrade","assessorgrade");
- foreach($types as $type) {
+ foreach ($types as $type) {
if ($position = array_search($type, $csvheader)) {
@@ -342,7 +342,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
}
} else {
- foreach($csvline as $k => $v) {
+ foreach ($csvline as $k => $v) {
if (substr($k,0,13) == 'assessorgrade' || substr($k,0,11) == 'singlegrade') {
$stages[$k] = $this->get_stage_identifier($csvline['submissionid'], $k);
} else if (substr($k,0,11) == 'agreedgrade') {
@@ -360,7 +360,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
$numberofstages = count($stages);
- foreach($stages as $k => $stage) {
+ foreach ($stages as $k => $stage) {
//when allocation is enabled
if (has_capability('mod/coursework:administergrades', $PAGE->context) && $coursework->allocation_enabled() && $stage != 'final_agreed_1' && $coursework->has_multiple_markers() == true) {
diff --git a/classes/forms/student_submission_form.php b/classes/forms/student_submission_form.php
index 121205a4..d2161809 100644
--- a/classes/forms/student_submission_form.php
+++ b/classes/forms/student_submission_form.php
@@ -178,7 +178,7 @@ public function handle() {
$userids = explode(',', $submission->get_coursework()->get_submission_notification_users());
if (!empty($userids)) {
- foreach($userids as $u) {
+ foreach ($userids as $u) {
$notifyuser = $DB->get_record('user',array('id' => trim($u)));
$mailer = new mailer($coursework);
diff --git a/classes/framework/table_base.php b/classes/framework/table_base.php
index 66381853..4f391d51 100644
--- a/classes/framework/table_base.php
+++ b/classes/framework/table_base.php
@@ -517,7 +517,7 @@ public static function exists($conditions = array()) {
$conditions = $conditions->to_array();
}
- foreach($conditions as $colname => $value) {
+ foreach ($conditions as $colname => $value) {
static::ensure_column_exists($colname);
}
return $DB->record_exists(static::get_table_name(), $conditions);
diff --git a/classes/models/submission.php b/classes/models/submission.php
index 69074339..61006c54 100644
--- a/classes/models/submission.php
+++ b/classes/models/submission.php
@@ -1020,7 +1020,7 @@ private function get_grades_to_update() {
// Only updating, not actually creating?
$grades = grade_get_grades($this->get_course_id(), 'mod', 'coursework', $this->get_coursework()->id, $student_ids);
$grades = $grades->items[0]->grades;
- foreach($student_ids as $userid) {
+ foreach ($student_ids as $userid) {
if (!array_key_exists($userid, $grades)) {
$grades[$userid] = new stdClass();
}
diff --git a/classes/models/user.php b/classes/models/user.php
index c1a40e83..d2fd6e47 100644
--- a/classes/models/user.php
+++ b/classes/models/user.php
@@ -51,7 +51,7 @@ class user extends table_base implements allocatable, moderatable {
*/
public function __construct($data = false) {
$allnames = \core_user\fields::get_name_fields();
- foreach($allnames as $namefield) {
+ foreach ($allnames as $namefield) {
$this->$namefield = '';
}
parent::__construct($data);
diff --git a/classes/sample_set_rule/range_sample_type.php b/classes/sample_set_rule/range_sample_type.php
index 9f4e44fd..a77fd16c 100644
--- a/classes/sample_set_rule/range_sample_type.php
+++ b/classes/sample_set_rule/range_sample_type.php
@@ -69,7 +69,7 @@ public function add_form_elements($assessor_number=0) {
if (!empty($samplerecords)) {
$seq = 0;
- foreach($samplerecords as $record) {
+ foreach ($samplerecords as $record) {
$html .= $this->range_elements($assessor_number, $seq, $record);
$seq++;
}
@@ -374,7 +374,7 @@ public function adjust_sample_set($stage_number,&$allocatables,&$manual_sample_s
$ruleinstance = $DB->get_records_sql($sql,array('courseworkid' => $this->coursework->id, 'stage' => $stage));
- foreach($ruleinstance as $ri) {
+ foreach ($ruleinstance as $ri) {
$limit = $this->rationalise($ri->ruletype, $ri->lowerlimit, $ri->upperlimit);
@@ -385,7 +385,7 @@ public function adjust_sample_set($stage_number,&$allocatables,&$manual_sample_s
$finalised = $this->finalised_submissions();
$published = $this->released_submissions();
- foreach($allocatables_in_range as $awf) {
+ foreach ($allocatables_in_range as $awf) {
if (!isset($published[$awf->allocatableid]) && !isset($finalised[$awf->allocatableid])
&& !isset($auto_sample_set[$awf->allocatableid]) && !isset($manual_sample_set[$awf->allocatableid])
&& isset($allocatables[$awf->allocatableid]))
diff --git a/db/install.php b/db/install.php
index 888837d6..dd92ddb0 100644
--- a/db/install.php
+++ b/db/install.php
@@ -37,7 +37,7 @@ function xmldb_coursework_install() {
$i = 1;
- foreach($plugins as $p) {
+ foreach ($plugins as $p) {
$dbrecord = new \stdClass();
$dbrecord->rulename = $p;
diff --git a/db/upgrade.php b/db/upgrade.php
index 3cff0895..a3cc8873 100644
--- a/db/upgrade.php
+++ b/db/upgrade.php
@@ -1184,7 +1184,7 @@ function xmldb_coursework_upgrade($oldversion) {
// Add stage identifier to all allocations.
$courseworks = $DB->get_records('coursework', null, '', 'id');
- foreach($courseworks as $coursework) {
+ foreach ($courseworks as $coursework) {
$coursework = \mod_coursework\models\coursework::find($coursework->id);
$students_with_assessor_allocations = $DB->get_records_sql('
SELECT DISTINCT studentid
@@ -1994,7 +1994,7 @@ function xmldb_coursework_upgrade($oldversion) {
$i = 1;
- foreach($plugins as $p) {
+ foreach ($plugins as $p) {
$dbrecord = new \stdClass();
$dbrecord->rulename = $p;
$dbrecord->pluginorder = $i;
@@ -2491,7 +2491,7 @@ function xmldb_coursework_upgrade($oldversion) {
$courseworkinstances = $DB->get_records('coursework');
- foreach($courseworkinstances as $cwk) {
+ foreach ($courseworkinstances as $cwk) {
$courseworkhassubmissions = ($DB->get_records('coursework_submissions', array('courseworkid' => $cwk->id)))
? true : false;
diff --git a/lib.php b/lib.php
index 5927f641..1c2b8f14 100644
--- a/lib.php
+++ b/lib.php
@@ -574,7 +574,7 @@ function remove_event($coursework, $eventtype = false) {
}
$events = $DB->get_records('event', $params);
- foreach($events as $eventid) {
+ foreach ($events as $eventid) {
$event = calendar_event::load($eventid->id);
$event->delete(); // delete events from mdl_event table
}
@@ -1276,7 +1276,7 @@ function course_group_member_added($event_data) {
// get all courseworks with group_assessor allocation strategy
$courseworks = $DB->get_records('coursework', array('course' => $courseid, 'assessorallocationstrategy' => 'group_assessor'));
- foreach($courseworks as $coursework) {
+ foreach ($courseworks as $coursework) {
$coursework = coursework::find($coursework);
$stage = $coursework->marking_stages();
@@ -1299,7 +1299,7 @@ function course_group_member_added($event_data) {
$allocatables = $coursework->get_allocatables();
if ($allocatables) {
// yes - assign this assessor to every allocatable student in the appropriate course group - at this point assessor should already be a member
- foreach($allocatables as $allocatable) {
+ foreach ($allocatables as $allocatable) {
// process students allocations
if ($coursework->student_is_in_any_group($allocatable)) { // student must belong to a group
$stage_1->make_auto_allocation_if_necessary($allocatable);
@@ -1341,7 +1341,7 @@ function course_group_member_removed($event_data) {
// get all courseworks with group_assessor allocation strategy
$courseworks = $DB->get_records('coursework', array('course' => $courseid, 'assessorallocationstrategy' => 'group_assessor'));
- foreach($courseworks as $coursework) {
+ foreach ($courseworks as $coursework) {
$coursework = coursework::find($coursework);
$stage = $coursework->marking_stages();
@@ -1360,7 +1360,7 @@ function course_group_member_removed($event_data) {
// find all individual students in the group
$students = get_enrolled_users($coursework->get_context(), 'mod/coursework:submit', $groupid);
if ($students) {
- foreach($students as $student) {
+ foreach ($students as $student) {
if (can_delete_allocation($coursework->id(), $student->id)) {
$DB->delete_records('coursework_allocation_pairs', array('courseworkid' => $coursework->id(), 'assessorid' => $removeduserid, 'allocatableid' => $student->id, 'stage_identifier' => 'assessor_1'));
}
@@ -1597,12 +1597,12 @@ function teacher_removed_allocated_not_graded($event_data) {
$courseid = $event_data->courseid;
$courseworks = coursework_get_courseworks_by_courseid($courseid);
- foreach($courseworks as $cw) {
+ foreach ($courseworks as $cw) {
$coursework = coursework::find($cw->id);
if ($coursework->allocation_enabled()) {
$assessor_allocations = $DB->get_records('coursework_allocation_pairs', array('courseworkid' => $coursework->id,
'assessorid' => $userid));
- foreach($assessor_allocations as $allocation) {
+ foreach ($assessor_allocations as $allocation) {
if ($allocation->allocatabletype == 'user') {
$allocatable = user::find($allocation->allocatableid);
} else {
diff --git a/renderers/object_renderer.php b/renderers/object_renderer.php
index 8960aa75..dac8bff7 100644
--- a/renderers/object_renderer.php
+++ b/renderers/object_renderer.php
@@ -1608,7 +1608,7 @@ public function get_allocatables_count_per_assessor($coursework) {
$submissions = $coursework->get_all_submissions();
- foreach($submissions as $sub) {
+ foreach ($submissions as $sub) {
$submission = submission::find($sub);
if ( $submission->final_grade_agreed()) {
@@ -1645,7 +1645,7 @@ public function get_allocatables_count_per_assessor($coursework) {
*/
public function remove_unfinalised_submissions($submissions) {
- foreach($submissions as $sub) {
+ foreach ($submissions as $sub) {
$submission = submission::find($sub);
@@ -1665,7 +1665,7 @@ public function remove_unfinalised_submissions($submissions) {
*/
public function removed_final_graded_submissions($submissions) {
- foreach($submissions as $sub) {
+ foreach ($submissions as $sub) {
$submission = submission::find($sub);
@@ -1686,7 +1686,7 @@ public function removed_final_graded_submissions($submissions) {
*/
public function remove_ungradable_submissions($submissions) {
- foreach($submissions as $sub) {
+ foreach ($submissions as $sub) {
$submission = submission::find($sub);
@@ -1706,7 +1706,7 @@ public function remove_ungradable_submissions($submissions) {
*/
public function remove_final_gradable_submissions($submissions) {
- foreach($submissions as $sub) {
+ foreach ($submissions as $sub) {
$submission = submission::find($sub);
if (!empty($submission->all_inital_graded()) ) {
@@ -1728,7 +1728,7 @@ public function remove_final_gradable_submissions($submissions) {
public function get_assessor_initial_graded_submissions($submissions) {
global $USER;
- foreach($submissions as $sub) {
+ foreach ($submissions as $sub) {
$submission = submission::find($sub);
@@ -1752,7 +1752,7 @@ public function get_assessor_initial_graded_submissions($submissions) {
*/
public function get_submissions_with_final_grade($submissions) {
- foreach($submissions as $sub) {
+ foreach ($submissions as $sub) {
$submission = submission::find($sub);
@@ -1781,7 +1781,7 @@ public function get_submissions_for_assessor($coursework, $submissions) {
if (!$coursework->has_multiple_markers() && has_capability('mod/coursework:addagreedgrade', $coursework->get_context()) &&
!has_capability('mod/coursework:addinitialgrade', $coursework->get_context()) ) {
- foreach($submissions as $sub) {
+ foreach ($submissions as $sub) {
$submission = submission::find($sub);
if ( $submission->final_grade_agreed()) {
continue;
@@ -1794,7 +1794,7 @@ public function get_submissions_for_assessor($coursework, $submissions) {
} else if (is_siteadmin($USER) || !$coursework->allocation_enabled() || has_any_capability(array('mod/coursework:administergrades'), $coursework->get_context())) {
- foreach($submissions as $sub) {
+ foreach ($submissions as $sub) {
$submission = submission::find($sub);
$gradeblesub[$submission->id] = $submission;
}
diff --git a/renderers/page_renderer.php b/renderers/page_renderer.php
index d195c53c..6e9f305f 100644
--- a/renderers/page_renderer.php
+++ b/renderers/page_renderer.php
@@ -387,7 +387,7 @@ public function new_feedback_page($new_feedback , $ajax = false) {
$teacher_feedback = new feedback();
$feedbackcomment = '';
$count = 1;
- foreach($initial_feedbacks as $initial_feedback) {
+ foreach ($initial_feedbacks as $initial_feedback) {
// put all initial feedbacks together for the comment field
$feedbackcomment .= get_string('assessorcomments', 'mod_coursework', $count);
$feedbackcomment .= $initial_feedback->feedbackcomment;
diff --git a/tests/behat/behat_mod_coursework.php b/tests/behat/behat_mod_coursework.php
index 937341bb..aca2497c 100644
--- a/tests/behat/behat_mod_coursework.php
+++ b/tests/behat/behat_mod_coursework.php
@@ -39,7 +39,7 @@
require_once(__DIR__ . '/../../../../vendor/phpunit/phpunit/src/Framework/Assert/Functions.php');
$files = glob(dirname(__FILE__) . '/steps/*.php');
-foreach($files as $filename) {
+foreach ($files as $filename) {
require_once($filename);
}
diff --git a/tests/behat/pages/page_base.php b/tests/behat/pages/page_base.php
index d09224b8..bcc9a2cb 100644
--- a/tests/behat/pages/page_base.php
+++ b/tests/behat/pages/page_base.php
@@ -128,7 +128,7 @@ protected function click_that_thing($thing_css, $text = '') {
* @var $things NodeElement[]
*/
$things = $this->getPage()->findAll('css', $thing_css);
- foreach($things as $thing) {
+ foreach ($things as $thing) {
if (empty($text) || $thing->getText() == $text || $thing->getValue() == $text) {
$thing->click();
$ok = true;
From 50a35e38797455b4e167c8b32165dc1d5a9b4e6b Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Mon, 12 Aug 2024 12:26:00 +0100
Subject: [PATCH 14/51] CTP-3558 coding std insert space after comma
---
actions/allocationsession.php | 16 +++++++--------
actions/personal_deadline.php | 4 ++--
backup/moodle2/backup_coursework_stepslib.php | 20 +++++++++----------
classes/allocation/manager.php | 8 ++++----
.../controllers/submissions_controller.php | 2 +-
.../export/csv/cells/agreedfeedback_cell.php | 2 +-
classes/export/csv/cells/agreedgrade_cell.php | 2 +-
.../csv/cells/assessorfeedback_cell.php | 4 ++--
classes/export/csv/cells/cell_base.php | 4 ++--
.../csv/cells/submissionfileid_cell.php | 2 +-
.../export/csv/cells/submissionid_cell.php | 2 +-
classes/export/import.php | 2 +-
classes/file_importer.php | 2 +-
classes/forms/student_submission_form.php | 2 +-
classes/forms/upload_allocations_form.php | 2 +-
classes/forms/upload_feedback_form.php | 6 +++---
classes/forms/upload_grading_sheet_form.php | 2 +-
classes/models/coursework.php | 8 ++++----
classes/models/submission.php | 4 ++--
classes/sample_set_rule/range_sample_type.php | 18 ++++++++---------
classes/sample_set_rule/total_sample_type.php | 14 ++++++-------
classes/task/enrol_task.php | 4 ++--
classes/task/unenrol_task.php | 4 ++--
lib.php | 10 +++++-----
mod_form.php | 4 ++--
renderers/grading_report_renderer.php | 2 +-
renderers/object_renderer.php | 10 +++++-----
renderers/page_renderer.php | 20 +++++++++----------
view.php | 16 +++++++--------
29 files changed, 98 insertions(+), 98 deletions(-)
diff --git a/actions/allocationsession.php b/actions/allocationsession.php
index 06e63d93..e5da9a24 100644
--- a/actions/allocationsession.php
+++ b/actions/allocationsession.php
@@ -24,14 +24,14 @@
global $SESSION;
-$assesorselect = required_param_array('assesorselect',PARAM_RAW);
-$assesorselectvalue = required_param_array('assesorselectvalue',PARAM_RAW);
-$pinnedchk = optional_param_array('pinned',array(),PARAM_RAW);
-$pinnedchkval = optional_param_array('pinnedvalue',array(),PARAM_RAW);
-$moderatorselect = optional_param_array('moderatorselect',array(),PARAM_RAW);
-$moderatorselectvalue = optional_param_array('moderatorselectvalue',array(),PARAM_RAW);
-$samplechk = optional_param_array('sample',array(),PARAM_RAW);
-$samplechkvalue = optional_param_array('samplevalue',array(),PARAM_RAW);
+$assesorselect = required_param_array('assesorselect', PARAM_RAW);
+$assesorselectvalue = required_param_array('assesorselectvalue', PARAM_RAW);
+$pinnedchk = optional_param_array('pinned', array(), PARAM_RAW);
+$pinnedchkval = optional_param_array('pinnedvalue', array(), PARAM_RAW);
+$moderatorselect = optional_param_array('moderatorselect', array(), PARAM_RAW);
+$moderatorselectvalue = optional_param_array('moderatorselectvalue', array(), PARAM_RAW);
+$samplechk = optional_param_array('sample', array(), PARAM_RAW);
+$samplechkvalue = optional_param_array('samplevalue', array(), PARAM_RAW);
$coursemoduleid = required_param('coursemoduleid', PARAM_INT);
if (!isset($SESSION->coursework_allocationsessions)) {
diff --git a/actions/personal_deadline.php b/actions/personal_deadline.php
index 885f1a77..d797b392 100644
--- a/actions/personal_deadline.php
+++ b/actions/personal_deadline.php
@@ -31,11 +31,11 @@
$setpersonaldeadlinespage = optional_param('setpersonaldeadlinespage', 0, PARAM_INT);
$multipleuserdeadlines = optional_param('multipleuserdeadlines', 0, PARAM_INT);
$selectedtype = optional_param('selectedtype', 'date', PARAM_RAW);
-$personal_deadline_time = optional_param('personal_deadline_time',null,PARAM_RAW);
+$personal_deadline_time = optional_param('personal_deadline_time',null, PARAM_RAW);
$allocatableid = (!empty($allocatableid_arr)) ? $allocatableid_arr : $allocatableid ;
-$coursework_db = $DB->get_record('coursework',array('id' => $courseworkid));
+$coursework_db = $DB->get_record('coursework', array('id' => $courseworkid));
$coursework = \mod_coursework\models\coursework::find($coursework_db);
diff --git a/backup/moodle2/backup_coursework_stepslib.php b/backup/moodle2/backup_coursework_stepslib.php
index d44277ed..6d04cf7c 100644
--- a/backup/moodle2/backup_coursework_stepslib.php
+++ b/backup/moodle2/backup_coursework_stepslib.php
@@ -38,7 +38,7 @@ protected function define_structure() {
$userinfo = $this->get_setting_value('userinfo');
- $coursework=new backup_nested_element('coursework',array('id'),
+ $coursework=new backup_nested_element('coursework', array('id'),
array('formid',
'course',
'name',
@@ -111,7 +111,7 @@ protected function define_structure() {
$sample_strategies =new backup_nested_element('coursework_sample_set_rules');
- $sample_strategy = new backup_nested_element('coursework_sample_set_rule',array('id'),
+ $sample_strategy = new backup_nested_element('coursework_sample_set_rule', array('id'),
array('courseworkid',
'sample_set_plugin_id',
'ruleorder',
@@ -160,7 +160,7 @@ protected function define_structure() {
$feedbacks=new backup_nested_element('coursework_feedbacks');
- $feedback= new backup_nested_element('coursework_feedback',array('id'),
+ $feedback= new backup_nested_element('coursework_feedback', array('id'),
array(
"submissionid",
"assessorid",
@@ -182,7 +182,7 @@ protected function define_structure() {
$submissions=new backup_nested_element('coursework_submissions');
- $submission=new backup_nested_element('coursework_submission',array('id'),
+ $submission=new backup_nested_element('coursework_submission', array('id'),
array(
"courseworkid",
"userid",
@@ -203,7 +203,7 @@ protected function define_structure() {
));
$reminders=new backup_nested_element('coursework_reminders');
- $reminder=new backup_nested_element('coursework_reminder',array('id'),
+ $reminder=new backup_nested_element('coursework_reminder', array('id'),
array(
"userid",
"coursework_id",
@@ -213,7 +213,7 @@ protected function define_structure() {
$pairs=new backup_nested_element('coursework_allocation_pairs');
- $pair=new backup_nested_element('coursework_allocation_pair',array('id'),
+ $pair=new backup_nested_element('coursework_allocation_pair', array('id'),
array(
"courseworkid",
"assessorid",
@@ -229,7 +229,7 @@ protected function define_structure() {
$modsetrules=new backup_nested_element('coursework_mod_set_rules');
- $modsetrule=new backup_nested_element('coursework_mod_set_rule',array('id'),
+ $modsetrule=new backup_nested_element('coursework_mod_set_rule', array('id'),
array(
"courseworkid",
"rulename",
@@ -241,7 +241,7 @@ protected function define_structure() {
$allocation_configs=new backup_nested_element('coursework_allocation_configs');
- $allocation_config=new backup_nested_element('coursework_allocation_config',array('id'),
+ $allocation_config=new backup_nested_element('coursework_allocation_config', array('id'),
array(
"courseworkid",
"allocationstrategy",
@@ -252,7 +252,7 @@ protected function define_structure() {
$modsetmembers= new backup_nested_element('coursework_mod_set_members');
- $modsetmember=new backup_nested_element('coursework_mod_set_member',array('id'),
+ $modsetmember=new backup_nested_element('coursework_mod_set_member', array('id'),
array(
"courseworkid",
"allocatableid",
@@ -431,7 +431,7 @@ protected function define_structure() {
$coursework->annotate_ids('grouping', 'grouping_id');
- $coursework->set_source_table('coursework',array('id' => backup::VAR_ACTIVITYID));
+ $coursework->set_source_table('coursework', array('id' => backup::VAR_ACTIVITYID));
return $this->prepare_activity_structure($coursework);
diff --git a/classes/allocation/manager.php b/classes/allocation/manager.php
index 734df966..6f080683 100644
--- a/classes/allocation/manager.php
+++ b/classes/allocation/manager.php
@@ -263,10 +263,10 @@ public function save_sample_set_rule($assessor_number) {
public function save_sample() {
global $DB;
- $DB->delete_records('coursework_sample_set_rules',array('courseworkid' => $this->coursework->id));
+ $DB->delete_records('coursework_sample_set_rules', array('courseworkid' => $this->coursework->id));
for ($i = 2; $i <= $this->coursework->get_max_markers(); $i++) {
- $sample_strategy = required_param("assessor_{$i}_samplingstrategy",PARAM_INT);
+ $sample_strategy = required_param("assessor_{$i}_samplingstrategy", PARAM_INT);
if ($sample_strategy) {
$this->save_sample_set_rule($i);
@@ -315,7 +315,7 @@ public function auto_generate_sample_set() {
AND stage_identifier = :stage
ORDER BY ruleorder)a";
- if ($sampleplugins = $DB->get_records_sql($sql,array('courseworkid' => $this->coursework->id, 'stage' => $stage))) {
+ if ($sampleplugins = $DB->get_records_sql($sql, array('courseworkid' => $this->coursework->id, 'stage' => $stage))) {
//$allocatables = $this->get_coursework()->get_allocatables_with_feedback();
$allocatables = $this->get_coursework()->get_allocatables();
@@ -400,7 +400,7 @@ public function get_automatic_with_feedback($stage) {
AND f.stage_identifier = m.stage_identifier
";
- return $DB->get_records_sql($sql,array('courseworkid' => $this->coursework->id, 'stage' => $stage));
+ return $DB->get_records_sql($sql, array('courseworkid' => $this->coursework->id, 'stage' => $stage));
}
public function remove_unmarked_automatic_allocatables($stage) {
diff --git a/classes/controllers/submissions_controller.php b/classes/controllers/submissions_controller.php
index a3c260c9..e3c96cf1 100644
--- a/classes/controllers/submissions_controller.php
+++ b/classes/controllers/submissions_controller.php
@@ -174,7 +174,7 @@ protected function create_submission() {
if (!empty($userids)) {
foreach ($userids as $u) {
- $notifyuser = $DB->get_record('user',array('id' => trim($u)));
+ $notifyuser = $DB->get_record('user', array('id' => trim($u)));
if (!empty($notifyuser)) $mailer->send_submission_notification($notifyuser);
}
diff --git a/classes/export/csv/cells/agreedfeedback_cell.php b/classes/export/csv/cells/agreedfeedback_cell.php
index 2830f565..1550d8dd 100644
--- a/classes/export/csv/cells/agreedfeedback_cell.php
+++ b/classes/export/csv/cells/agreedfeedback_cell.php
@@ -62,7 +62,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
if (has_any_capability($agreedgradecap, $PAGE->context)
|| has_capability('mod/coursework:administergrades', $PAGE->context)) {
- $subdbrecord = $DB->get_record('coursework_submissions',array('id' => $submissionid));
+ $subdbrecord = $DB->get_record('coursework_submissions', array('id' => $submissionid));
$submission = \mod_coursework\models\submission::find($subdbrecord);
//is the submission in question ready to grade?
diff --git a/classes/export/csv/cells/agreedgrade_cell.php b/classes/export/csv/cells/agreedgrade_cell.php
index d7ad1134..3cb40834 100644
--- a/classes/export/csv/cells/agreedgrade_cell.php
+++ b/classes/export/csv/cells/agreedgrade_cell.php
@@ -148,7 +148,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
if (!empty($errormsg)) return $errormsg;
- $subdbrecord = $DB->get_record('coursework_submissions',array('id' => $submissionid));
+ $subdbrecord = $DB->get_record('coursework_submissions', array('id' => $submissionid));
$submission = \mod_coursework\models\submission::find($subdbrecord);
//is the submission in question ready to grade?
diff --git a/classes/export/csv/cells/assessorfeedback_cell.php b/classes/export/csv/cells/assessorfeedback_cell.php
index 1a15946f..8976214e 100644
--- a/classes/export/csv/cells/assessorfeedback_cell.php
+++ b/classes/export/csv/cells/assessorfeedback_cell.php
@@ -80,7 +80,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
$agreedgradecap = array('mod/coursework:addagreedgrade','mod/coursework:editagreedgrade');
$initialgradecap = array('mod/coursework:addinitialgrade','mod/coursework:editinitialgrade');
- $subdbrecord = $DB->get_record('coursework_submissions',array('id' => $submissionid));
+ $subdbrecord = $DB->get_record('coursework_submissions', array('id' => $submissionid));
$submission = \mod_coursework\models\submission::find($subdbrecord);
if (has_any_capability($agreedgradecap, $PAGE->context) && has_any_capability($initialgradecap, $PAGE->context)
|| has_capability('mod/coursework:administergrades', $PAGE->context)) {
@@ -140,7 +140,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
&& $this->coursework->get_max_markers() > 1 && !$this->coursework->allocation_enabled()) {
// check how many feedbacks for this submission
- $feedbacks = $DB->count_records('coursework_feedbacks',array('submissionid' => $submissionid));
+ $feedbacks = $DB->count_records('coursework_feedbacks', array('submissionid' => $submissionid));
if ($this->coursework->sampling_enabled()) {
// check how many sample assessors + add 1 that is always in sample
diff --git a/classes/export/csv/cells/cell_base.php b/classes/export/csv/cells/cell_base.php
index c5f1e63e..462dacf6 100644
--- a/classes/export/csv/cells/cell_base.php
+++ b/classes/export/csv/cells/cell_base.php
@@ -182,7 +182,7 @@ public function get_actual_grade($grade) {
public function get_assessor_name($assessorid) {
global $DB;
- $assessor = $DB->get_record('user',array('id' => $assessorid), 'firstname, lastname');
+ $assessor = $DB->get_record('user', array('id' => $assessorid), 'firstname, lastname');
return $assessor->lastname .' '. $assessor->firstname;
}
@@ -195,7 +195,7 @@ public function get_assessor_name($assessorid) {
public function get_assessor_username($assessorid) {
global $DB;
- $assessor = $DB->get_record('user',array('id' => $assessorid), 'username');
+ $assessor = $DB->get_record('user', array('id' => $assessorid), 'username');
return $assessor->username;
}
diff --git a/classes/export/csv/cells/submissionfileid_cell.php b/classes/export/csv/cells/submissionfileid_cell.php
index c83462dd..8f3eb894 100644
--- a/classes/export/csv/cells/submissionfileid_cell.php
+++ b/classes/export/csv/cells/submissionfileid_cell.php
@@ -53,7 +53,7 @@ public function validate_cell($value, $submissionid, $stage_dentifier='', $uploa
return 'No submission hash value entered';
}
- $subdbrecord = $DB->get_record('coursework_submissions',array('id' => $submissionid));
+ $subdbrecord = $DB->get_record('coursework_submissions', array('id' => $submissionid));
$submission = \mod_coursework\models\submission::find($subdbrecord);
diff --git a/classes/export/csv/cells/submissionid_cell.php b/classes/export/csv/cells/submissionid_cell.php
index 297887e8..8fd6d5da 100644
--- a/classes/export/csv/cells/submissionid_cell.php
+++ b/classes/export/csv/cells/submissionid_cell.php
@@ -48,7 +48,7 @@ public function get_header($stage) {
public function validate_cell($value, $submissionid, $stage_dentifier='', $uploadedgradecells = array()) {
global $DB;
- return ($DB->record_exists('coursework_submissions',array('id' => $submissionid,'courseworkid' => $this->coursework->id()))) ? true: get_string('submissionnotfoundincoursework','coursework');
+ return ($DB->record_exists('coursework_submissions', array('id' => $submissionid,'courseworkid' => $this->coursework->id()))) ? true: get_string('submissionnotfoundincoursework','coursework');
}
}
diff --git a/classes/export/import.php b/classes/export/import.php
index 977e9a64..9b6f3604 100644
--- a/classes/export/import.php
+++ b/classes/export/import.php
@@ -572,7 +572,7 @@ public function add_grade($submissionid, $grade, $feedback, $stage_identifier, $
$markernumber = 1;
} else {
// get all feedbacks and add 1
- $feedbacks = $DB->count_records('coursework_feedbacks',array('submissionid' => $submissionid));
+ $feedbacks = $DB->count_records('coursework_feedbacks', array('submissionid' => $submissionid));
$markernumber = $feedbacks +1;
}
diff --git a/classes/file_importer.php b/classes/file_importer.php
index 00bf0490..7cd92add 100644
--- a/classes/file_importer.php
+++ b/classes/file_importer.php
@@ -118,7 +118,7 @@ public function import_zip_files($coursework, $feedbackstage, $overwritecurrent)
if ($allocatableid = $this->is_valid_feedback_file_filename($coursework, $file, $participants) ) {
- $subdbrecord = $DB->get_record('coursework_submissions',array('courseworkid' => $coursework->id(), 'allocatableid' => $allocatableid, 'allocatabletype' => $coursework->get_allocatable_type()));
+ $subdbrecord = $DB->get_record('coursework_submissions', array('courseworkid' => $coursework->id(), 'allocatableid' => $allocatableid, 'allocatabletype' => $coursework->get_allocatable_type()));
$submission = \mod_coursework\models\submission::find($subdbrecord);
diff --git a/classes/forms/student_submission_form.php b/classes/forms/student_submission_form.php
index d2161809..38a6ddcd 100644
--- a/classes/forms/student_submission_form.php
+++ b/classes/forms/student_submission_form.php
@@ -179,7 +179,7 @@ public function handle() {
if (!empty($userids)) {
foreach ($userids as $u) {
- $notifyuser = $DB->get_record('user',array('id' => trim($u)));
+ $notifyuser = $DB->get_record('user', array('id' => trim($u)));
$mailer = new mailer($coursework);
if (!empty($notifyuser)) $mailer->send_submission_notification($notifyuser);
diff --git a/classes/forms/upload_allocations_form.php b/classes/forms/upload_allocations_form.php
index 56b96df7..c6b95093 100644
--- a/classes/forms/upload_allocations_form.php
+++ b/classes/forms/upload_allocations_form.php
@@ -42,7 +42,7 @@ function definition() {
// $mform->addElement('checkbox', 'overwrite', '',get_string('overwritegrades', 'coursework'));
$mform->addElement('hidden', 'cmid', $this->cmid);
- $mform->setType('cmid',PARAM_RAW);
+ $mform->setType('cmid', PARAM_RAW);
$choices = csv_import_reader::get_delimiter_list();
$mform->addElement('select', 'delimiter_name', get_string('csvdelimiter', 'tool_uploaduser'), $choices);
diff --git a/classes/forms/upload_feedback_form.php b/classes/forms/upload_feedback_form.php
index d3f56ee5..d55602ad 100644
--- a/classes/forms/upload_feedback_form.php
+++ b/classes/forms/upload_feedback_form.php
@@ -48,9 +48,9 @@ function definition() {
$mform->addRule('feedbackzip', null, 'required');
$mform->addHelpButton('feedbackzip', 'feedbackzipfile', 'coursework');
- $mform->addElement('advcheckbox', 'overwrite', '',get_string('overwritefeedback', 'coursework'),null,array(0,1));
+ $mform->addElement('advcheckbox', 'overwrite', '',get_string('overwritefeedback', 'coursework'),null, array(0,1));
$mform->addElement('hidden', 'cmid', $this->cmid);
- $mform->setType('cmid',PARAM_RAW);
+ $mform->setType('cmid', PARAM_RAW);
$options = array();
@@ -72,7 +72,7 @@ function definition() {
$mform->addElement('select', 'feedbackstage', get_string('feedbackstage', 'coursework'), $options);
} else {
$mform->addElement('hidden', 'feedbackstage', 'assessor_1');
- $mform->setType('feedbackstage',PARAM_RAW);
+ $mform->setType('feedbackstage', PARAM_RAW);
}
// Disable overwrite current feedback files checkbox if user doesn't have edit capability
diff --git a/classes/forms/upload_grading_sheet_form.php b/classes/forms/upload_grading_sheet_form.php
index 723d8c07..cad6e884 100644
--- a/classes/forms/upload_grading_sheet_form.php
+++ b/classes/forms/upload_grading_sheet_form.php
@@ -48,7 +48,7 @@ function definition() {
$mform->addElement('checkbox', 'overwrite', '',get_string('overwritegrades', 'coursework'));
$mform->addElement('hidden', 'cmid', $this->cmid);
- $mform->setType('cmid',PARAM_RAW);
+ $mform->setType('cmid', PARAM_RAW);
$choices = csv_import_reader::get_delimiter_list();
$mform->addElement('select', 'delimiter_name', get_string('csvdelimiter', 'tool_uploaduser'), $choices);
diff --git a/classes/models/coursework.php b/classes/models/coursework.php
index 702232f1..c28d27a0 100644
--- a/classes/models/coursework.php
+++ b/classes/models/coursework.php
@@ -2501,7 +2501,7 @@ public function extensions_enabled() {
public function extension_exists() {
global $DB;
- return $DB->record_exists('coursework_extensions',array('courseworkid' => $this->id));
+ return $DB->record_exists('coursework_extensions', array('courseworkid' => $this->id));
}
public function get_submissions_with_extensions() {
@@ -2515,7 +2515,7 @@ public function get_submissions_with_extensions() {
AND ce.allocatabletype = cs.allocatabletype
AND cs.courseworkid = :courseworkid";
- return $DB->get_records_sql($sql,array('courseworkid' => $this->id));
+ return $DB->get_records_sql($sql, array('courseworkid' => $this->id));
}
/**
@@ -2531,7 +2531,7 @@ public function get_coursework_submission_personal_deadlines() {
AND pd.allocatabletype = cs.allocatabletype
WHERE cs.courseworkid = :courseworkid";
- $submissions = $DB->get_records_sql($sql,array('courseworkid' => $this->id));
+ $submissions = $DB->get_records_sql($sql, array('courseworkid' => $this->id));
// for submissions that don't have a set personal deadline give coursework's default deadline
if ($submissions) {
@@ -2553,7 +2553,7 @@ public function get_coursework_submission_personal_deadlines() {
public function has_automatic_sampling_at_stage($stage) {
global $DB;
- return $DB->record_exists('coursework_sample_set_rules',array('courseworkid' => $this->id, 'stage_identifier' => $stage));
+ return $DB->record_exists('coursework_sample_set_rules', array('courseworkid' => $this->id, 'stage_identifier' => $stage));
}
/**
diff --git a/classes/models/submission.php b/classes/models/submission.php
index 61006c54..e8fd8fd3 100644
--- a/classes/models/submission.php
+++ b/classes/models/submission.php
@@ -805,7 +805,7 @@ public function get_tii_group_member_with_eula($groupid) {
ORDER BY gm.userid
LIMIT 1";
- return $DB->get_record_sql($sql,array($groupid));
+ return $DB->get_record_sql($sql, array($groupid));
}
/**
@@ -1397,7 +1397,7 @@ public function final_draft_feedbacks_exist() {
AND cf.timecreated + c.gradeeditingtime > :time
";
- $editablefeedbacks = $DB->get_records_sql($sql,array('submissionid' => $this->id, 'time' => time()));
+ $editablefeedbacks = $DB->get_records_sql($sql, array('submissionid' => $this->id, 'time' => time()));
return (empty($editablefeedbacks)) ? false : $editablefeedbacks;
}
diff --git a/classes/sample_set_rule/range_sample_type.php b/classes/sample_set_rule/range_sample_type.php
index a77fd16c..49105f47 100644
--- a/classes/sample_set_rule/range_sample_type.php
+++ b/classes/sample_set_rule/range_sample_type.php
@@ -77,9 +77,9 @@ public function add_form_elements($assessor_number=0) {
$html .= $this->range_elements($assessor_number,0,false);
}
- $html .= html_writer::link('#',get_string('addgraderule', 'mod_coursework'),array('id' => "assessor_{$assessor_number}_addgradderule", 'class' => 'addgradderule sample_set_rule'));
+ $html .= html_writer::link('#',get_string('addgraderule', 'mod_coursework'), array('id' => "assessor_{$assessor_number}_addgradderule", 'class' => 'addgradderule sample_set_rule'));
$html .= " ";
- $html .= html_writer::link('#',get_string('removegraderule', 'mod_coursework'),array('id' => "assessor_{$assessor_number}_removegradderule", 'class' => 'removegradderule sample_set_rule'));
+ $html .= html_writer::link('#',get_string('removegraderule', 'mod_coursework'), array('id' => "assessor_{$assessor_number}_removegradderule", 'class' => 'removegradderule sample_set_rule'));
return $html;
}
@@ -330,12 +330,12 @@ public function save_form_data($assessor_number=0,&$order=0) {
global $DB;
- $sample_rules = optional_param_array("assessor_{$assessor_number}_samplerules",false,PARAM_RAW);
- $sample_type = optional_param_array("assessor_{$assessor_number}_sampletype",false,PARAM_RAW);
- $sample_from = optional_param_array("assessor_{$assessor_number}_samplefrom",false,PARAM_RAW);
- $sample_to = optional_param_array("assessor_{$assessor_number}_sampleto",false,PARAM_RAW);
+ $sample_rules = optional_param_array("assessor_{$assessor_number}_samplerules",false, PARAM_RAW);
+ $sample_type = optional_param_array("assessor_{$assessor_number}_sampletype",false, PARAM_RAW);
+ $sample_from = optional_param_array("assessor_{$assessor_number}_samplefrom",false, PARAM_RAW);
+ $sample_to = optional_param_array("assessor_{$assessor_number}_sampleto",false, PARAM_RAW);
- $sample_plugin = $DB->get_record('coursework_sample_set_plugin',array('rulename' => 'range_sample_type'));
+ $sample_plugin = $DB->get_record('coursework_sample_set_plugin', array('rulename' => 'range_sample_type'));
if ($sample_rules) {
foreach ($sample_rules as $i => $val) {
@@ -372,7 +372,7 @@ public function adjust_sample_set($stage_number,&$allocatables,&$manual_sample_s
AND stage_identifier = :stage
ORDER BY ruleorder";
- $ruleinstance = $DB->get_records_sql($sql,array('courseworkid' => $this->coursework->id, 'stage' => $stage));
+ $ruleinstance = $DB->get_records_sql($sql, array('courseworkid' => $this->coursework->id, 'stage' => $stage));
foreach ($ruleinstance as $ri) {
@@ -414,7 +414,7 @@ private function rationalise($ruletype, $limit1, $limit2) {
$limits[0] = $this->coursework->grade * $limits[0] / 100;
$limits[1] = $this->coursework->grade * $limits[1] / 100;
} else {
- $scale = $DB->get_record("scale",array('id' => abs($this->coursework->grade)));
+ $scale = $DB->get_record("scale", array('id' => abs($this->coursework->grade)));
if ($scale) {
diff --git a/classes/sample_set_rule/total_sample_type.php b/classes/sample_set_rule/total_sample_type.php
index 865fa009..7a2f5d8c 100644
--- a/classes/sample_set_rule/total_sample_type.php
+++ b/classes/sample_set_rule/total_sample_type.php
@@ -116,8 +116,8 @@ public function add_form_elements_js($assessor_number=0) {
function save_form_data($assessor_number=0,&$order=0) {
global $DB;
- $total_checkbox = optional_param("assessor_{$assessor_number}_sampletotal_checkbox",false,PARAM_INT);
- $sample_total = optional_param("assessor_{$assessor_number}_sampletotal",false,PARAM_INT);
+ $total_checkbox = optional_param("assessor_{$assessor_number}_sampletotal_checkbox",false, PARAM_INT);
+ $sample_total = optional_param("assessor_{$assessor_number}_sampletotal",false, PARAM_INT);
if ($total_checkbox) {
@@ -155,7 +155,7 @@ public function adjust_sample_set($stage_number,&$allocatables,&$manual_sample_s
AND stage_identifier = :stage
ORDER BY ruleorder";
- $rule = $DB->get_record_sql($sql,array('courseworkid' => $this->coursework->id, 'stage' => $stage));
+ $rule = $DB->get_record_sql($sql, array('courseworkid' => $this->coursework->id, 'stage' => $stage));
if ($rule) {
@@ -203,16 +203,16 @@ public function adjust_sample_set($stage_number,&$allocatables,&$manual_sample_s
if (count($auto_sample_set) < $total_to_return) {
//remove allocatables with published submissions
- $allocatable_sample_set = array_diff_ukey($allocatables, $published,array("mod_coursework\\sample_set_rule\\total_sample_type", "compare_key"));
+ $allocatable_sample_set = array_diff_ukey($allocatables, $published, array("mod_coursework\\sample_set_rule\\total_sample_type", "compare_key"));
//remove allocatables with finalised submissions
- $allocatable_sample_set = array_diff_ukey($allocatable_sample_set, $finalised,array("mod_coursework\\sample_set_rule\\total_sample_type", "compare_key"));
+ $allocatable_sample_set = array_diff_ukey($allocatable_sample_set, $finalised, array("mod_coursework\\sample_set_rule\\total_sample_type", "compare_key"));
//remove allocatables who have been manually selected
- $allocatable_sample_set = array_diff_ukey($allocatable_sample_set, $manual_sample_set,array("mod_coursework\\sample_set_rule\\total_sample_type", "compare_key"));
+ $allocatable_sample_set = array_diff_ukey($allocatable_sample_set, $manual_sample_set, array("mod_coursework\\sample_set_rule\\total_sample_type", "compare_key"));
//remove allocatables already in the sample set
- $allocatable_sample_set = array_diff_ukey($allocatable_sample_set, $auto_sample_set,array("mod_coursework\\sample_set_rule\\total_sample_type", "compare_key"));
+ $allocatable_sample_set = array_diff_ukey($allocatable_sample_set, $auto_sample_set, array("mod_coursework\\sample_set_rule\\total_sample_type", "compare_key"));
$array_keys = array_rand($allocatable_sample_set, $total_to_return - count($auto_sample_set));
diff --git a/classes/task/enrol_task.php b/classes/task/enrol_task.php
index 4deb8625..befa7663 100644
--- a/classes/task/enrol_task.php
+++ b/classes/task/enrol_task.php
@@ -43,7 +43,7 @@ public function execute() {
global $DB;
- $courseworkids = $DB->get_records('coursework',array('processenrol' => 1));
+ $courseworkids = $DB->get_records('coursework', array('processenrol' => 1));
if (!empty($courseworkids)) {
foreach ($courseworkids as $courseworkid) {
@@ -57,7 +57,7 @@ public function execute() {
$allocator = new \mod_coursework\allocation\auto_allocator($coursework);
$allocator->process_allocations();
- $DB->set_field('coursework', 'processenrol',0,array('id' => $coursework->id()));
+ $DB->set_field('coursework', 'processenrol',0, array('id' => $coursework->id()));
}
}
diff --git a/classes/task/unenrol_task.php b/classes/task/unenrol_task.php
index eac12f87..105c13aa 100644
--- a/classes/task/unenrol_task.php
+++ b/classes/task/unenrol_task.php
@@ -43,7 +43,7 @@ public function execute() {
global $DB;
- $courseworkids = $DB->get_records('coursework',array('processunenrol' => 1));
+ $courseworkids = $DB->get_records('coursework', array('processunenrol' => 1));
if (!empty($courseworkids)) {
foreach ($courseworkids as $courseworkid) {
@@ -55,7 +55,7 @@ public function execute() {
$allocator = new \mod_coursework\allocation\auto_allocator($coursework);
$allocator->process_allocations();
- $DB->set_field('coursework', 'processunenrol',0,array('id' => $coursework->id()));
+ $DB->set_field('coursework', 'processunenrol',0, array('id' => $coursework->id()));
}
}
diff --git a/lib.php b/lib.php
index 1c2b8f14..eeb6fc66 100644
--- a/lib.php
+++ b/lib.php
@@ -444,13 +444,13 @@ function coursework_update_instance($coursework) {
$coursework->submissionnotification = $subnotify;
- $courseworkhassubmissions = ($DB->get_records('coursework_submissions',array('courseworkid' => $coursework->id)))
+ $courseworkhassubmissions = ($DB->get_records('coursework_submissions', array('courseworkid' => $coursework->id)))
? true : false;
//if the coursework has submissions then we the renamefiles setting can't be changes
if ($courseworkhassubmissions) {
- $currentcoursework = $DB->get_record('coursework',array('id' => $coursework->id));
+ $currentcoursework = $DB->get_record('coursework', array('id' => $coursework->id));
$coursework->renamefiles = $currentcoursework->renamefiles;
@@ -912,7 +912,7 @@ function coursework_role_assigned_event_handler($roleassignment) {
$courseworkids = coursework_get_coursework_ids_from_context_id($roleassignment->contextid);
foreach ($courseworkids as $courseworkid) {
- $DB->set_field('coursework', 'processenrol',1,array('id' => $courseworkid));
+ $DB->set_field('coursework', 'processenrol',1, array('id' => $courseworkid));
}
return true;
@@ -933,7 +933,7 @@ function coursework_role_unassigned_event_handler($roleassignment) {
$courseworkids = coursework_get_coursework_ids_from_context_id($roleassignment->contextid);
foreach ($courseworkids as $courseworkid) {
- $DB->set_field('coursework', 'processunenrol',1,array('id' => $courseworkid));
+ $DB->set_field('coursework', 'processunenrol',1, array('id' => $courseworkid));
}
return true;
@@ -1505,7 +1505,7 @@ function coursework_is_ulcc_digest_coursework_plugin_installed() {
$disgestblockexists = $DB->record_exists_sql("SELECT id FROM {block} WHERE name = 'ulcc_digest' AND visible = 1");
if (!empty($disgestblockexists)) {
- $pluginexists = ($DB->get_records('block_ulcc_digest_plgs',array('module' => 'coursework', 'status' => 1))) ? true : false;
+ $pluginexists = ($DB->get_records('block_ulcc_digest_plgs', array('module' => 'coursework', 'status' => 1))) ? true : false;
}
return $pluginexists;
diff --git a/mod_form.php b/mod_form.php
index 5591b8fb..65ad4011 100644
--- a/mod_form.php
+++ b/mod_form.php
@@ -796,7 +796,7 @@ protected function add_rename_file_field() {
WHERE id = :courseworkid
AND renamefiles = 1";
- $settingvalue = ($DB->get_records_sql($sql,array('courseworkid' => $courseworkid))) ? get_string('yesrenamefile', 'mod_coursework') : get_string('norenamefile', 'mod_coursework') ;
+ $settingvalue = ($DB->get_records_sql($sql, array('courseworkid' => $courseworkid))) ? get_string('yesrenamefile', 'mod_coursework') : get_string('norenamefile', 'mod_coursework') ;
$moodle_form->addElement('static', 'renamefilesdescription', get_string('renamefiles', 'mod_coursework'),
$settingvalue);
@@ -1120,7 +1120,7 @@ protected function add_tweaks_to_standard_grading_form_elements() {
// $moodle_form->setDefault('automaticagreement',0);
// $moodle_form->disabledIf('automaticagreement', 'numberofmarkers', 'eq', '1');
//
-// $moodle_form->addElement('text', 'automaticagreementrange', get_string('automaticagreementrange', 'mod_coursework'),array('size' => 3));
+// $moodle_form->addElement('text', 'automaticagreementrange', get_string('automaticagreementrange', 'mod_coursework'), array('size' => 3));
// $moodle_form->addHelpButton('automaticagreementrange', 'automaticagreementrange', 'mod_coursework');
// $moodle_form->setDefault('automaticagreementrange',0);
// $moodle_form->disabledIf('automaticagreementrange', 'automaticagreement', 'eq', '0');
diff --git a/renderers/grading_report_renderer.php b/renderers/grading_report_renderer.php
index 5e7f5059..d450e64c 100644
--- a/renderers/grading_report_renderer.php
+++ b/renderers/grading_report_renderer.php
@@ -88,7 +88,7 @@ private function generate_lang_element() {
'exportgradingsheets' => get_string('exportgradingsheets', 'mod_coursework'),
'loadingpagination' => get_string('loadingpagination', 'mod_coursework')
];
- $result = html_writer::empty_tag('input',array(
+ $result = html_writer::empty_tag('input', array(
'name' => '',
'type' => 'hidden',
'data-lang' => json_encode($lang_messages),
diff --git a/renderers/object_renderer.php b/renderers/object_renderer.php
index dac8bff7..421a8d91 100644
--- a/renderers/object_renderer.php
+++ b/renderers/object_renderer.php
@@ -769,7 +769,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
// We want to allow the allocation strategy to add configuration options.
- $html .= html_writer::start_tag('div',array('class' => 'sampling-select'));
+ $html .= html_writer::start_tag('div', array('class' => 'sampling-select'));
$script = "
var samplingValidateHdl = Array();
@@ -806,7 +806,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$table->head = $assessorheaders;
- $assessor1cell = html_writer::start_tag('div',array('class' => 'samples_strategy'));
+ $assessor1cell = html_writer::start_tag('div', array('class' => 'samples_strategy'));
$assessor1cell .= get_string('assessoronedefault', 'mod_coursework');
$assessor1cell .= html_writer::end_tag('div');
@@ -830,7 +830,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
//check whether any rules have been saved for this stage
$selected = ($samplingwidget->get_coursework()->has_automatic_sampling_at_stage('assessor_'.$i)) ? '1' : false;
- $sampling_cell = html_writer::start_tag('div',array('class' => 'samples_strategy'));
+ $sampling_cell = html_writer::start_tag('div', array('class' => 'samples_strategy'));
$sampling_cell .= html_writer::label(get_string('sampletype', 'mod_coursework'), "assessor_{$i}_samplingstrategy");
$sampling_cell .= html_writer::select($sampling_strategies,
@@ -959,8 +959,8 @@ private function sampling_strategy_column($samplingwidget, $suffix = '') {
$sampling_column .= html_writer::end_tag('div');
- $sampling_column .= html_writer::link('#',get_string('addgraderule', 'mod_coursework'),array('id' => "assessor_{$suffix}_addgradderule", 'class' => 'addgradderule sampling_strategy_detail'));
- $sampling_column .= html_writer::link('#',get_string('removegraderule', 'mod_coursework'),array('id' => "assessor_{$suffix}_removegradderule", 'class' => 'removegradderule sampling_strategy_detail'));
+ $sampling_column .= html_writer::link('#',get_string('addgraderule', 'mod_coursework'), array('id' => "assessor_{$suffix}_addgradderule", 'class' => 'addgradderule sampling_strategy_detail'));
+ $sampling_column .= html_writer::link('#',get_string('removegraderule', 'mod_coursework'), array('id' => "assessor_{$suffix}_removegradderule", 'class' => 'removegradderule sampling_strategy_detail'));
$sampling_column .= html_writer::checkbox("assessor_{$suffix}_samplertopup",1,false,get_string('topupto', 'mod_coursework'),
array('id' => "assessor_{$suffix}_samplerules[]", 'class' => "assessor_{$suffix} sampling_strategy_detail"));
diff --git a/renderers/page_renderer.php b/renderers/page_renderer.php
index 6e9f305f..e07aab66 100644
--- a/renderers/page_renderer.php
+++ b/renderers/page_renderer.php
@@ -1328,7 +1328,7 @@ function process_feedback_upload($processingresults) {
$html .= get_string('fileuploadresults', 'mod_coursework')." ";
foreach ($processingresults as $file => $result) {
- $html .= get_string('fileuploadresult', 'mod_coursework',array('filename' => $file, 'result' => $result)). " ";
+ $html .= get_string('fileuploadresult', 'mod_coursework', array('filename' => $file, 'result' => $result)). " ";
}
$html .= html_writer::end_tag('p');
} else {
@@ -1462,47 +1462,47 @@ public function datatables_render($coursework) {
'aria-label' => 'Close',
'data-dismiss' => 'modal'
));
- $modal_header .= html_writer::span('×', '',array('aria-hidden' => 'true'));
+ $modal_header .= html_writer::span('×', '', array('aria-hidden' => 'true'));
$modal_header .= html_writer::end_tag('button');
$modal_body = html_writer::start_tag('form', array('id' => 'form-extension'));
- $content = html_writer::empty_tag('input',array(
+ $content = html_writer::empty_tag('input', array(
'name' => 'allocatabletype',
'type' => 'hidden',
'value' => '',
'id' => 'extension-allocatabletype'
));
- $content .= html_writer::empty_tag('input',array(
+ $content .= html_writer::empty_tag('input', array(
'name' => 'allocatableid',
'type' => 'hidden',
'value' => '',
'id' => 'extension-allocatableid'
));
- $content .= html_writer::empty_tag('input',array(
+ $content .= html_writer::empty_tag('input', array(
'name' => 'courseworkid',
'type' => 'hidden',
'value' => '',
'id' => 'extension-courseworkid'
));
- $content .= html_writer::empty_tag('input',array(
+ $content .= html_writer::empty_tag('input', array(
'name' => 'id',
'type' => 'hidden',
'value' => '',
'id' => 'extension-id'
));
- $content .= html_writer::empty_tag('input',array(
+ $content .= html_writer::empty_tag('input', array(
'name' => 'submissionid',
'type' => 'hidden',
'value' => '',
'id' => 'extension-submissionid'
));
- $content .= html_writer::empty_tag('input',array(
+ $content .= html_writer::empty_tag('input', array(
'name' => 'name',
'type' => 'hidden',
'id' => 'extension-name',
'value' => '',
));
- $content .= html_writer::empty_tag('input',array(
+ $content .= html_writer::empty_tag('input', array(
'name' => 'aid',
'type' => 'hidden',
'value' => '',
@@ -1590,7 +1590,7 @@ public function datatables_render($coursework) {
'aria-labelledby' => 'modelTitleId',
'aria-hidden' => 'true'
));
- $html .= html_writer::empty_tag('input',array(
+ $html .= html_writer::empty_tag('input', array(
'name' => '',
'type' => 'hidden',
'data-lang' => json_encode($lang_messages),
diff --git a/view.php b/view.php
index 3d3d4242..a22c7181 100644
--- a/view.php
+++ b/view.php
@@ -122,10 +122,10 @@
// first name alpha
if (!(isset($SESSION->coursework_firstname_alpha[$course_module_id]))) {
- $SESSION->coursework_firstname_alpha[$course_module_id] = optional_param('coursework_firstname_alpha', '',PARAM_ALPHA);
+ $SESSION->coursework_firstname_alpha[$course_module_id] = optional_param('coursework_firstname_alpha', '', PARAM_ALPHA);
$coursework_firstname_alpha = $SESSION->coursework_firstname_alpha[$course_module_id];
} else {
- $coursework_firstname_alpha = optional_param('coursework_firstname_alpha', $SESSION->coursework_firstname_alpha[$course_module_id],PARAM_ALPHA);
+ $coursework_firstname_alpha = optional_param('coursework_firstname_alpha', $SESSION->coursework_firstname_alpha[$course_module_id], PARAM_ALPHA);
$SESSION->coursework_firstname_alpha[$course_module_id] = $coursework_firstname_alpha;
}
@@ -134,7 +134,7 @@
$SESSION->coursework_lastname_alpha[$course_module_id] = optional_param('coursework_lastname_alpha', '', PARAM_ALPHA);
$coursework_lastname_alpha= $SESSION->coursework_lastname_alpha[$course_module_id];
} else {
- $coursework_lastname_alpha = optional_param('coursework_lastname_alpha', $SESSION->coursework_lastname_alpha[$course_module_id],PARAM_ALPHA);
+ $coursework_lastname_alpha = optional_param('coursework_lastname_alpha', $SESSION->coursework_lastname_alpha[$course_module_id], PARAM_ALPHA);
$SESSION->coursework_lastname_alpha[$course_module_id] = $coursework_lastname_alpha;
}
@@ -143,7 +143,7 @@
$SESSION->coursework_groupname_alpha[$course_module_id] = optional_param('coursework_groupname_alpha', '', PARAM_ALPHA);
$coursework_groupname_alpha = $SESSION->coursework_groupname_alpha[$course_module_id];
} else {
- $coursework_groupname_alpha= optional_param('coursework_groupname_alpha', $SESSION->coursework_groupname_alpha[$course_module_id],PARAM_ALPHA);
+ $coursework_groupname_alpha= optional_param('coursework_groupname_alpha', $SESSION->coursework_groupname_alpha[$course_module_id], PARAM_ALPHA);
$SESSION->coursework_groupname_alpha[$course_module_id] = $coursework_groupname_alpha;
}
@@ -189,10 +189,10 @@
// first name alpha
if (!(isset($SESSION->viewallstudents_firstname_alpha[$course_module_id]))) {
- $SESSION->viewallstudents_firstname_alpha[$course_module_id] = optional_param('viewallstudents_firstname_alpha', '',PARAM_ALPHA);
+ $SESSION->viewallstudents_firstname_alpha[$course_module_id] = optional_param('viewallstudents_firstname_alpha', '', PARAM_ALPHA);
$viewallstudents_firstname_alpha = $SESSION->coursework_firstname_alpha[$course_module_id];
} else {
- $viewallstudents_firstname_alpha = optional_param('viewallstudents_firstname_alpha', $SESSION->viewallstudents_firstname_alpha[$course_module_id],PARAM_ALPHA);
+ $viewallstudents_firstname_alpha = optional_param('viewallstudents_firstname_alpha', $SESSION->viewallstudents_firstname_alpha[$course_module_id], PARAM_ALPHA);
$SESSION->viewallstudents_firstname_alpha[$course_module_id] = $viewallstudents_firstname_alpha;
}
@@ -201,7 +201,7 @@
$SESSION->viewallstudents_lastname_alpha[$course_module_id] = optional_param('viewallstudents_lastname_alpha', '', PARAM_ALPHA);
$viewallstudents_lastname_alpha = $SESSION->viewallstudents_lastname_alpha[$course_module_id];
} else {
- $viewallstudents_lastname_alpha = optional_param('viewallstudents_lastname_alpha', $SESSION->viewallstudents_lastname_alpha[$course_module_id],PARAM_ALPHA);
+ $viewallstudents_lastname_alpha = optional_param('viewallstudents_lastname_alpha', $SESSION->viewallstudents_lastname_alpha[$course_module_id], PARAM_ALPHA);
$SESSION->viewallstudents_lastname_alpha[$course_module_id] = $viewallstudents_lastname_alpha;
}
@@ -210,7 +210,7 @@
$SESSION->viewallstudents_groupname_alpha[$course_module_id] = optional_param('viewallstudents_groupname_alpha', '', PARAM_ALPHA);
$viewallstudents_groupname_alpha = $SESSION->viewallstudents_groupname_alpha[$course_module_id];
} else {
- $viewallstudents_groupname_alpha= optional_param('viewallstudents_groupname_alpha', $SESSION->viewallstudents_groupname_alpha[$course_module_id],PARAM_ALPHA);
+ $viewallstudents_groupname_alpha= optional_param('viewallstudents_groupname_alpha', $SESSION->viewallstudents_groupname_alpha[$course_module_id], PARAM_ALPHA);
$SESSION->viewallstudents_groupname_alpha[$course_module_id] = $viewallstudents_groupname_alpha;
}
From 84f078ff78a014c9731333624dc97d6c3f5a62aa Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Mon, 12 Aug 2024 12:30:28 +0100
Subject: [PATCH 15/51] CTP-3558 coding std insert space around =
---
backup/moodle2/backup_coursework_stepslib.php | 40 +++++++++----------
.../moodle2/restore_coursework_stepslib.php | 2 +-
classes/cron.php | 2 +-
classes/grading_report.php | 2 +-
db/upgrade.php | 2 +-
mod_form.php | 4 +-
renderers/object_renderer.php | 2 +-
view.php | 6 +--
8 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/backup/moodle2/backup_coursework_stepslib.php b/backup/moodle2/backup_coursework_stepslib.php
index 6d04cf7c..b15af260 100644
--- a/backup/moodle2/backup_coursework_stepslib.php
+++ b/backup/moodle2/backup_coursework_stepslib.php
@@ -38,7 +38,7 @@ protected function define_structure() {
$userinfo = $this->get_setting_value('userinfo');
- $coursework=new backup_nested_element('coursework', array('id'),
+ $coursework = new backup_nested_element('coursework', array('id'),
array('formid',
'course',
'name',
@@ -109,7 +109,7 @@ protected function define_structure() {
'plagiarismflagenabled'
));
- $sample_strategies =new backup_nested_element('coursework_sample_set_rules');
+ $sample_strategies = new backup_nested_element('coursework_sample_set_rules');
$sample_strategy = new backup_nested_element('coursework_sample_set_rule', array('id'),
array('courseworkid',
@@ -158,9 +158,9 @@ protected function define_structure() {
"modecommentformat"
));
- $feedbacks=new backup_nested_element('coursework_feedbacks');
+ $feedbacks = new backup_nested_element('coursework_feedbacks');
- $feedback= new backup_nested_element('coursework_feedback', array('id'),
+ $feedback = new backup_nested_element('coursework_feedback', array('id'),
array(
"submissionid",
"assessorid",
@@ -180,9 +180,9 @@ protected function define_structure() {
"finalised"
));
- $submissions=new backup_nested_element('coursework_submissions');
+ $submissions = new backup_nested_element('coursework_submissions');
- $submission=new backup_nested_element('coursework_submission', array('id'),
+ $submission = new backup_nested_element('coursework_submission', array('id'),
array(
"courseworkid",
"userid",
@@ -201,9 +201,9 @@ protected function define_structure() {
"lastpublished",
"timesubmitted"
));
- $reminders=new backup_nested_element('coursework_reminders');
+ $reminders = new backup_nested_element('coursework_reminders');
- $reminder=new backup_nested_element('coursework_reminder', array('id'),
+ $reminder = new backup_nested_element('coursework_reminder', array('id'),
array(
"userid",
"coursework_id",
@@ -211,9 +211,9 @@ protected function define_structure() {
"extension"
));
- $pairs=new backup_nested_element('coursework_allocation_pairs');
+ $pairs = new backup_nested_element('coursework_allocation_pairs');
- $pair=new backup_nested_element('coursework_allocation_pair', array('id'),
+ $pair = new backup_nested_element('coursework_allocation_pair', array('id'),
array(
"courseworkid",
"assessorid",
@@ -227,9 +227,9 @@ protected function define_structure() {
'allocatablegroup'
));
- $modsetrules=new backup_nested_element('coursework_mod_set_rules');
+ $modsetrules = new backup_nested_element('coursework_mod_set_rules');
- $modsetrule=new backup_nested_element('coursework_mod_set_rule', array('id'),
+ $modsetrule = new backup_nested_element('coursework_mod_set_rule', array('id'),
array(
"courseworkid",
"rulename",
@@ -239,9 +239,9 @@ protected function define_structure() {
"minimum"
));
- $allocation_configs=new backup_nested_element('coursework_allocation_configs');
+ $allocation_configs = new backup_nested_element('coursework_allocation_configs');
- $allocation_config=new backup_nested_element('coursework_allocation_config', array('id'),
+ $allocation_config = new backup_nested_element('coursework_allocation_config', array('id'),
array(
"courseworkid",
"allocationstrategy",
@@ -250,9 +250,9 @@ protected function define_structure() {
"purpose"
));
- $modsetmembers= new backup_nested_element('coursework_mod_set_members');
+ $modsetmembers = new backup_nested_element('coursework_mod_set_members');
- $modsetmember=new backup_nested_element('coursework_mod_set_member', array('id'),
+ $modsetmember = new backup_nested_element('coursework_mod_set_member', array('id'),
array(
"courseworkid",
"allocatableid",
@@ -262,9 +262,9 @@ protected function define_structure() {
"stage_identifier"
));
- $extensions=new backup_nested_element('coursework_extensions');
+ $extensions = new backup_nested_element('coursework_extensions');
- $extension=new backup_nested_element('coursework_extension', array('id'),
+ $extension = new backup_nested_element('coursework_extension', array('id'),
array(
"allocatableid",
"allocatabletype",
@@ -278,9 +278,9 @@ protected function define_structure() {
"extra_information_format"
));
- $personal_deadlines=new backup_nested_element('coursework_person_deadlines');
+ $personal_deadlines = new backup_nested_element('coursework_person_deadlines');
- $personal_deadline=new backup_nested_element('coursework_person_deadline', array('id'),
+ $personal_deadline = new backup_nested_element('coursework_person_deadline', array('id'),
array(
"allocatableid",
'allocatableuser',
diff --git a/backup/moodle2/restore_coursework_stepslib.php b/backup/moodle2/restore_coursework_stepslib.php
index 1975b8c6..d21958c3 100644
--- a/backup/moodle2/restore_coursework_stepslib.php
+++ b/backup/moodle2/restore_coursework_stepslib.php
@@ -67,7 +67,7 @@ protected function define_structure() {
'plagiarism_flag' => 'coursework_submissions/coursework_submission/coursework_plagiarism_flags');
foreach ($bits as $bit=> $bitpath) {
- $p=new restore_path_element("coursework_$bit","/activity/coursework/{$bitpath}/coursework_$bit");
+ $p = new restore_path_element("coursework_$bit","/activity/coursework/{$bitpath}/coursework_$bit");
$paths[]=$p;
}
}
diff --git a/classes/cron.php b/classes/cron.php
index da6fd4d7..d5fb181a 100644
--- a/classes/cron.php
+++ b/classes/cron.php
@@ -123,7 +123,7 @@ private static function send_reminders_to_students() {
$student->deadline = $individual_extension->extended_deadline;
$student->extension = $individual_extension->extended_deadline;
$student->coursework_id = $coursework->id;
- $student->nextremindernumber= 2;
+ $student->nextremindernumber = 2;
$userswhoneedreminding[$student->id().'_'.$coursework->id] = $student;
}
diff --git a/classes/grading_report.php b/classes/grading_report.php
index 6e3c1f3f..2e87a6db 100644
--- a/classes/grading_report.php
+++ b/classes/grading_report.php
@@ -335,7 +335,7 @@ public function get_participant_count() {
*
* @return grading_table_row_base[] row objects
*/
- public function get_table_rows_for_page($rowcount=false) {
+ public function get_table_rows_for_page($rowcount = false) {
global $USER;
diff --git a/db/upgrade.php b/db/upgrade.php
index a3cc8873..a3835ccc 100644
--- a/db/upgrade.php
+++ b/db/upgrade.php
@@ -2036,7 +2036,7 @@ function xmldb_coursework_upgrade($oldversion) {
}
- $allocatabletables=array('coursework_submissions',
+ $allocatabletables = array('coursework_submissions',
'coursework_allocation_pairs',
'coursework_mod_set_members',
'coursework_extensions',
diff --git a/mod_form.php b/mod_form.php
index 65ad4011..d4cd65f5 100644
--- a/mod_form.php
+++ b/mod_form.php
@@ -1093,8 +1093,8 @@ protected function add_tweaks_to_standard_grading_form_elements() {
$moodle_form->addHelpButton('grade', 'grade', 'mod_coursework');
$moodle_form->setExpanded('modstandardgrade');
- $options = array(0=> get_string('sameforallstages', 'mod_coursework'),
- 1=> get_string('simpledirectgrading', 'mod_coursework'));
+ $options = array(0 => get_string('sameforallstages', 'mod_coursework'),
+ 1 => get_string('simpledirectgrading', 'mod_coursework'));
$moodle_form->addElement('select', 'finalstagegrading', get_string('finalstagegrading', 'mod_coursework'), $options);
$moodle_form->addHelpButton('finalstagegrading', 'finalstagegrading', 'mod_coursework');
diff --git a/renderers/object_renderer.php b/renderers/object_renderer.php
index 421a8d91..2ed2a85e 100644
--- a/renderers/object_renderer.php
+++ b/renderers/object_renderer.php
@@ -793,7 +793,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$comma = "";
- for ($i=0;$i <= $samplingwidget->get_coursework()->grade; $i++) {
+ for ($i = 0; $i <= $samplingwidget->get_coursework()->grade; $i++) {
$scale .= $comma.$i;
$comma = ",";
}
diff --git a/view.php b/view.php
index a22c7181..ce9914c3 100644
--- a/view.php
+++ b/view.php
@@ -132,7 +132,7 @@
// last name alpha
if (!(isset($SESSION->coursework_lastname_alpha[$course_module_id]))) {
$SESSION->coursework_lastname_alpha[$course_module_id] = optional_param('coursework_lastname_alpha', '', PARAM_ALPHA);
- $coursework_lastname_alpha= $SESSION->coursework_lastname_alpha[$course_module_id];
+ $coursework_lastname_alpha = $SESSION->coursework_lastname_alpha[$course_module_id];
} else {
$coursework_lastname_alpha = optional_param('coursework_lastname_alpha', $SESSION->coursework_lastname_alpha[$course_module_id], PARAM_ALPHA);
$SESSION->coursework_lastname_alpha[$course_module_id] = $coursework_lastname_alpha;
@@ -143,7 +143,7 @@
$SESSION->coursework_groupname_alpha[$course_module_id] = optional_param('coursework_groupname_alpha', '', PARAM_ALPHA);
$coursework_groupname_alpha = $SESSION->coursework_groupname_alpha[$course_module_id];
} else {
- $coursework_groupname_alpha= optional_param('coursework_groupname_alpha', $SESSION->coursework_groupname_alpha[$course_module_id], PARAM_ALPHA);
+ $coursework_groupname_alpha = optional_param('coursework_groupname_alpha', $SESSION->coursework_groupname_alpha[$course_module_id], PARAM_ALPHA);
$SESSION->coursework_groupname_alpha[$course_module_id] = $coursework_groupname_alpha;
}
@@ -210,7 +210,7 @@
$SESSION->viewallstudents_groupname_alpha[$course_module_id] = optional_param('viewallstudents_groupname_alpha', '', PARAM_ALPHA);
$viewallstudents_groupname_alpha = $SESSION->viewallstudents_groupname_alpha[$course_module_id];
} else {
- $viewallstudents_groupname_alpha= optional_param('viewallstudents_groupname_alpha', $SESSION->viewallstudents_groupname_alpha[$course_module_id], PARAM_ALPHA);
+ $viewallstudents_groupname_alpha = optional_param('viewallstudents_groupname_alpha', $SESSION->viewallstudents_groupname_alpha[$course_module_id], PARAM_ALPHA);
$SESSION->viewallstudents_groupname_alpha[$course_module_id] = $viewallstudents_groupname_alpha;
}
From 4f3eef55ebbdc41fb0429e3b57bc71adf771a19a Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Mon, 12 Aug 2024 12:36:51 +0100
Subject: [PATCH 16/51] CTP-3558 coding std remove EOL whitespace
---
.../backup_coursework_activity_task.class.php | 2 +-
.../restore_coursework_activity_task.class.php | 6 +++---
classes/ability.php | 4 ++--
classes/allocation/table/builder.php | 2 --
classes/allocation/table/cell/data.php | 1 -
.../personal_deadlines_controller.php | 7 +------
classes/controllers/submissions_controller.php | 4 ++--
.../export/csv/cells/personaldeadline_cell.php | 2 +-
classes/export/import.php | 1 -
classes/grading_table_row_base.php | 4 ++--
classes/models/coursework.php | 14 +++++++-------
classes/models/outstanding_marking.php | 16 ++++++++--------
classes/models/submission.php | 2 +-
classes/personal_deadline/table/row/builder.php | 2 --
.../cells/multiple_agreed_grade_cell.php | 3 +--
.../cells/single_assessor_feedback_cell.php | 1 -
.../component_factory_interface.php | 2 +-
.../sub_rows/multi_marker_feedback_sub_rows.php | 1 -
classes/stages/base.php | 2 +-
db/upgrade.php | 2 --
lib.php | 6 ++----
mod_form.php | 15 ++++-----------
renderers/page_renderer.php | 1 -
tests/classes/models/coursework_test.php | 2 +-
tests/classes/models/group_test.php | 1 -
tests/classes/rule_test.php | 4 +---
26 files changed, 39 insertions(+), 68 deletions(-)
diff --git a/backup/moodle2/backup_coursework_activity_task.class.php b/backup/moodle2/backup_coursework_activity_task.class.php
index 483d6912..dff99027 100644
--- a/backup/moodle2/backup_coursework_activity_task.class.php
+++ b/backup/moodle2/backup_coursework_activity_task.class.php
@@ -38,7 +38,7 @@ static public function encode_content_links($content) {
return $content;
}
-
+
protected function define_my_settings() {
}
diff --git a/backup/moodle2/restore_coursework_activity_task.class.php b/backup/moodle2/restore_coursework_activity_task.class.php
index d95685c3..21d954e8 100644
--- a/backup/moodle2/restore_coursework_activity_task.class.php
+++ b/backup/moodle2/restore_coursework_activity_task.class.php
@@ -59,14 +59,14 @@ static public function define_decode_contents() {
return $contents;
}
-
+
/**
* Define (add) particular settings this activity can have.
*/
protected function define_my_settings() {
// No particular settings for this activity.
}
-
+
/**
* Define (add) particular steps this activity can have.
*/
@@ -74,5 +74,5 @@ protected function define_my_steps() {
// Only has one structure step.
$this->add_step(new restore_coursework_activity_structure_step('coursework_structure', 'coursework.xml'));
}
-
+
}
diff --git a/classes/ability.php b/classes/ability.php
index 13dd9fcd..14626d04 100644
--- a/classes/ability.php
+++ b/classes/ability.php
@@ -468,7 +468,7 @@ function (submission $submission) {
$submission->get_coursework()->get_context());
});
}
-
+
protected function prevent_edit_submission_for_unsaved_records() {
$this->prevent('edit',
@@ -1307,7 +1307,7 @@ private function allow_edit_personal_deadline_with_capability() {
$this->allow('edit',
'mod_coursework\models\personal_deadline',
function (personal_deadline $personal_deadline) {
- return $personal_deadline->get_coursework()->personal_deadlines_enabled()
+ return $personal_deadline->get_coursework()->personal_deadlines_enabled()
&& has_capability('mod/coursework:editpersonaldeadline',
$personal_deadline->get_coursework()
->get_context());
diff --git a/classes/allocation/table/builder.php b/classes/allocation/table/builder.php
index 18f3cef0..38b59c48 100644
--- a/classes/allocation/table/builder.php
+++ b/classes/allocation/table/builder.php
@@ -73,8 +73,6 @@ public function get_rows() {
foreach ($allocatables as $allocatable) {
$rows[] = new row_builder($this, $allocatable);
}
-
-
// Sort the rows.
$sorting = new mod_coursework\grading_report($this->options, $this->coursework);
$method_name = 'sort_by_' . $this->options['sortby'];
diff --git a/classes/allocation/table/cell/data.php b/classes/allocation/table/cell/data.php
index 62a25d6c..9e24e9a1 100644
--- a/classes/allocation/table/cell/data.php
+++ b/classes/allocation/table/cell/data.php
@@ -64,7 +64,6 @@ protected function preprocess_data() {
$key = $this->assessor_id_key_name();
if (array_key_exists($key, $this->data) && !empty($this->data[$key])) {
$assessor = user::find($this->data[$key]);
-
if ($assessor && $this->stage->user_is_assessor($assessor)) {
$this->assessor = $assessor;
}
diff --git a/classes/controllers/personal_deadlines_controller.php b/classes/controllers/personal_deadlines_controller.php
index 424db0eb..6aae93ec 100644
--- a/classes/controllers/personal_deadlines_controller.php
+++ b/classes/controllers/personal_deadlines_controller.php
@@ -46,7 +46,6 @@ protected function new_personal_deadline() {
$this->get_path('set personal deadlines', array('coursework' => $this->coursework));
$params = $this->set_default_current_deadline();
-
$ability = new ability(user::find($USER), $this->coursework);
$ability->require_can('edit', $this->personal_deadline);
@@ -62,10 +61,7 @@ protected function new_personal_deadline() {
$this->personal_deadline->multipleuserdeadlines = $this->params['multipleuserdeadlines'];
$this->personal_deadline->allocatableid = $params['allocatableid'];
-
$this->form->set_data($this->personal_deadline);
-
-
if ($this->cancel_button_was_pressed()) {
redirect($coursework_page_url);
}
@@ -155,7 +151,7 @@ protected function set_default_current_deadline() {
}
/**
- * Get the personal deadline
+ * Get the personal deadline
* @return mixed
*/
protected function get_personal_deadline() {
@@ -257,4 +253,3 @@ protected function validated($time) {
return true;
}
}
-
diff --git a/classes/controllers/submissions_controller.php b/classes/controllers/submissions_controller.php
index e3c96cf1..aeedb1d0 100644
--- a/classes/controllers/submissions_controller.php
+++ b/classes/controllers/submissions_controller.php
@@ -161,7 +161,7 @@ protected function create_submission() {
$submission->submit_plagiarism();
$mailer = new mailer($this->coursework);
- if ($CFG->coursework_allsubmissionreceipt || $submission->finalised) {
+ if ($CFG->coursework_allsubmissionreceipt || $submission->finalised) {
foreach ($submission->get_students() as $student) {
$mailer->send_submission_receipt($student, $submission->finalised);
}
@@ -341,7 +341,7 @@ protected function unfinalise_submission() {
array('courseworkid' => $this->params['courseworkid'], 'allocatableid' => $aid, 'allocatabletype' => $this->params['allocatabletype']));
if (!empty($submission_db)) {
$submission = \mod_coursework\models\submission::find($submission_db);
-
+
if ($submission->can_be_unfinalised()) {
$submission->finalised = 0;
$submission->save();
diff --git a/classes/export/csv/cells/personaldeadline_cell.php b/classes/export/csv/cells/personaldeadline_cell.php
index f316a137..e77dc73d 100644
--- a/classes/export/csv/cells/personaldeadline_cell.php
+++ b/classes/export/csv/cells/personaldeadline_cell.php
@@ -36,7 +36,7 @@ class personaldeadline_cell extends cell_base {
public function get_cell($submission, $student, $stage_identifier) {
$personal_deadline = $submission->submission_personal_deadline();
-
+
return userdate($personal_deadline, $this->dateformat);
}
diff --git a/classes/export/import.php b/classes/export/import.php
index 9b6f3604..6c6fd1bb 100644
--- a/classes/export/import.php
+++ b/classes/export/import.php
@@ -442,7 +442,6 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
//for ( $critidx < $numberofrubrics; ) {
$critidx = 0;
-
//this assumes that the data in the csv is in the correct criteria order.....it should be
foreach ($criterias as $c) {
$criteriagrade = array();
diff --git a/classes/grading_table_row_base.php b/classes/grading_table_row_base.php
index 47c2c2c4..79d974af 100644
--- a/classes/grading_table_row_base.php
+++ b/classes/grading_table_row_base.php
@@ -179,7 +179,7 @@ public function get_time_submitted() {
/**
* Getter for personal deadline time
- *
+ *
* @return int|mixed|string
*/
public function get_personal_deadlines() {
@@ -200,7 +200,7 @@ public function get_personal_deadlines() {
} else {
$personal_deadline = $this->get_coursework()->deadline;
}
-
+
return $personal_deadline;
}
diff --git a/classes/models/coursework.php b/classes/models/coursework.php
index c28d27a0..9b5b4106 100644
--- a/classes/models/coursework.php
+++ b/classes/models/coursework.php
@@ -1339,10 +1339,10 @@ public function get_assessor_graded_submissions($assessorid) {
$graded = array();
$params = array('courseworkid' => $this->id, 'assessorid' => $assessorid);
$sql = "SELECT cs.id
- FROM {coursework_feedbacks} cf
- JOIN {coursework_submissions} cs
+ FROM {coursework_feedbacks} cf
+ JOIN {coursework_submissions} cs
ON cs.id = cf.submissionid
- WHERE cs.courseworkid = :courseworkid
+ WHERE cs.courseworkid = :courseworkid
AND assessorid = :assessorid";
$submissions = $DB->get_records_sql($sql, $params);
@@ -2902,8 +2902,8 @@ public function remove_deadline_extensions_by_coursework() {
public function has_any_final_feedback() {
global $DB;
- $sql = "SELECT *
- FROM {coursework_feedbacks} cf
+ $sql = "SELECT *
+ FROM {coursework_feedbacks} cf
JOIN {coursework_submissions} cs ON cs.id = cf.submissionid
WHERE cs.courseworkid = :courseworkid
AND cf.stage_identifier = 'final_agreed_1'";
@@ -2986,8 +2986,8 @@ public function remove_plagiarisms_by_submission($submission_id) {
public function has_any_submission() {
global $DB;
- $sql = "SELECT *
- FROM {coursework_submissions} cs
+ $sql = "SELECT *
+ FROM {coursework_submissions} cs
WHERE cs.courseworkid = :courseworkid";
return $DB->record_exists_sql($sql, array('courseworkid' => $this->id));
diff --git a/classes/models/outstanding_marking.php b/classes/models/outstanding_marking.php
index 569ed462..80273403 100644
--- a/classes/models/outstanding_marking.php
+++ b/classes/models/outstanding_marking.php
@@ -118,8 +118,8 @@ private function get_single_marker_initial_grade_submissions_to_mark($coursework
{$sqltable}
WHERE f.id IS NULL
AND cs.finalised = 1
- AND cs.courseworkid = :courseworkid
- {$sqlextra}
+ AND cs.courseworkid = :courseworkid
+ {$sqlextra}
";
$sqlparams['courseworkid'] = $courseworkid;
@@ -198,12 +198,12 @@ private function get_multiple_to_mark_initial_grade_submissions($courseworkid, $
{coursework_feedbacks} f ON cs.id = f.submissionid
{$sqltable}
WHERE cs.finalised = 1
- AND cs.courseworkid = :courseworkid
+ AND cs.courseworkid = :courseworkid
AND (f.assessorid != :assessorid OR f.assessorid IS NULL)
{$sqlextra}
- AND cs.id NOT IN (SELECT sub.id FROM
- {coursework_feedbacks} feed JOIN
- {coursework_submissions} sub ON sub.id = feed.submissionid
+ AND cs.id NOT IN (SELECT sub.id FROM
+ {coursework_feedbacks} feed
+ JOIN {coursework_submissions} sub ON sub.id = feed.submissionid
WHERE assessorid = :subassessorid AND sub.courseworkid= :subcourseworkid)
GROUP BY cs.id, f.id
HAVING (COUNT(f.id) < :numofmarkers)";
@@ -228,7 +228,7 @@ private function get_to_grade_agreed_grade_submissions($courseworkid, $numberofm
$sql = "SELECT cs.id as submissionid, COUNT(cs.id) AS count_feedback
FROM {coursework_submissions} cs ,
- {coursework_feedbacks} f
+ {coursework_feedbacks} f
WHERE f.submissionid= cs.id
AND cs.finalised = 1
AND cs.courseworkid = :courseworkid
@@ -263,7 +263,7 @@ private function get_to_grade_agreed_grade_sampled_submissions($courseworkid) {
GROUP BY cs.allocatableid, ssm.stage_identifier, f.id, cs.id, ssm.id
) a
GROUP BY a.allocatableid, a.csid, a.fid, a.id, a.count_feedback, a.courseworkid
- HAVING (count_feedback = $countsamples AND $countsamples > 1 );";
+ HAVING (count_feedback = $countsamples AND $countsamples > 1 );";
$sqlparams['courseworkid'] = $courseworkid;
diff --git a/classes/models/submission.php b/classes/models/submission.php
index e8fd8fd3..0ba15d58 100644
--- a/classes/models/submission.php
+++ b/classes/models/submission.php
@@ -251,7 +251,7 @@ public static function unfinalised_past_deadline() {
if ($submission->get_coursework()->personal_deadlines_enabled()) {
$deadline = $submission->submission_personal_deadline();
}
-
+
if ($deadline < time()) {
// if deadline passed check if extension exists
if ($submission->has_extension()) {
diff --git a/classes/personal_deadline/table/row/builder.php b/classes/personal_deadline/table/row/builder.php
index 59060380..a9c1ac17 100644
--- a/classes/personal_deadline/table/row/builder.php
+++ b/classes/personal_deadline/table/row/builder.php
@@ -217,6 +217,4 @@ public function get_submission_status() {
return $statustext;
}
-
-
}
diff --git a/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php b/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
index 882714c8..e6f0313a 100644
--- a/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
+++ b/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
@@ -52,7 +52,7 @@ protected function after_initialisation($items) {
* @param grading_table_row_base $rowobject
* @return string
*/
- public function get_table_cell($rowobject) {
+ public function get_table_cell($rowobject) {
$content = $this->get_content($rowobject);
return $this->get_new_cell_with_class($content);
}
@@ -158,7 +158,6 @@ public function get_content($rowobject) {
$content .= ' by: ' . $finalfeedback->get_assesor_username();
}
}
-
return $content;
}
diff --git a/classes/render_helpers/grading_report/cells/single_assessor_feedback_cell.php b/classes/render_helpers/grading_report/cells/single_assessor_feedback_cell.php
index 1ae44547..1349c300 100644
--- a/classes/render_helpers/grading_report/cells/single_assessor_feedback_cell.php
+++ b/classes/render_helpers/grading_report/cells/single_assessor_feedback_cell.php
@@ -68,7 +68,6 @@ public function get_table_cell($rowobject) {
$content = $this->get_content($rowobject);
return $this->get_new_cell_with_class($content);
}
-
public function get_content($rowobject) {
global $USER;
diff --git a/classes/render_helpers/grading_report/component_factory_interface.php b/classes/render_helpers/grading_report/component_factory_interface.php
index 4962fe9b..77cf65ec 100644
--- a/classes/render_helpers/grading_report/component_factory_interface.php
+++ b/classes/render_helpers/grading_report/component_factory_interface.php
@@ -25,7 +25,7 @@
/**
* Each variation on the grading report should provide an abstract factory that conforms to this interface.
* The renderer then uses a template method to assemble the pieces.
- *
+ *
* Interface component_factory_interface
* @package mod_coursework\render_helpers\grading_report
*/
diff --git a/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php b/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php
index d23ec9d5..83410b3a 100644
--- a/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php
+++ b/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php
@@ -135,7 +135,6 @@ protected function render_assessor_feedback_table(assessor_feedback_table $asses
$assessor_details = (empty($feedback_row->get_assessor()->id()) && $coursework->allocation_enabled()) ?
get_string('assessornotallocated','mod_coursework') : $this->profile_link($feedback_row);
-
$output_rows .=
'' . $assessor_details. '
' .
diff --git a/classes/stages/base.php b/classes/stages/base.php
index 79a0247b..6dd156e4 100644
--- a/classes/stages/base.php
+++ b/classes/stages/base.php
@@ -348,7 +348,7 @@ public function has_moderation($submission) {
if ($feedback) {
$sql = "SELECT *
- FROM {coursework_mod_agreements}
+ FROM {coursework_mod_agreements}
WHERE feedbackid = ?";
return $DB->record_exists_sql($sql, array($feedback->id));
} else {
diff --git a/db/upgrade.php b/db/upgrade.php
index a3835ccc..e65521c7 100644
--- a/db/upgrade.php
+++ b/db/upgrade.php
@@ -2198,8 +2198,6 @@ function xmldb_coursework_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2016121501, 'coursework');
}
-
-
if ($oldversion < 2016121600) {
// Define table coursework_person_deadlines to be created.
diff --git a/lib.php b/lib.php
index eeb6fc66..63fd0be1 100644
--- a/lib.php
+++ b/lib.php
@@ -889,7 +889,6 @@ function coursework_extend_settings_navigation(settings_navigation $settings, na
$navref->add(get_string($lang_str, 'mod_coursework'), $link, navigation_node::TYPE_SETTING);
}
-
// Link to personal deadlines screen
if (has_capability('mod/coursework:editpersonaldeadline', $context) && ($coursework->personal_deadlines_enabled())) {
$link = new moodle_url('/mod/coursework/actions/set_personal_deadlines.php', array('id' => $cm->id));
@@ -1281,7 +1280,6 @@ function course_group_member_added($event_data) {
$coursework = coursework::find($coursework);
$stage = $coursework->marking_stages();
$stage_1 = $stage['assessor_1']; // this allocation is only for 1st stage, we don't touch other stages
-
$student = $coursework->can_submit(); // check if user is student in this course
$initial_stage_assessor = has_capability('mod/coursework:addinitialgrade', $coursework->get_context(), $addeduserid); // check if user is initial stage assessor in this course
@@ -1438,7 +1436,7 @@ function can_delete_allocation($courseworkid, $allocatableid) {
$ungraded_allocations = $DB->get_record_sql("SELECT *
FROM {coursework_allocation_pairs} p
WHERE courseworkid = :courseworkid
- AND p.manual = 0
+ AND p.manual = 0
AND stage_identifier = 'assessor_1'
AND allocatableid = :allocatableid
AND NOT EXISTS (SELECT 1
@@ -1518,7 +1516,7 @@ function coursework_is_ulcc_digest_coursework_plugin_installed() {
function coursework_personal_deadline_passed($courseworkid) {
global $DB;
- $sql = "SELECT *
+ $sql = "SELECT *
FROM {coursework_person_deadlines}
WHERE courseworkid = :courseworkid
AND personal_deadline < :now";
diff --git a/mod_form.php b/mod_form.php
index d4cd65f5..934bd43c 100644
--- a/mod_form.php
+++ b/mod_form.php
@@ -69,7 +69,6 @@ public function definition() {
$this->add_submission_deadline_field();
$this->add_personal_deadline_field();
-
// if (coursework_is_ulcc_digest_coursework_plugin_installed()) {
$this->add_marking_deadline_field();
$this->add_initial_marking_deadline_field();
@@ -780,11 +779,11 @@ protected function add_rename_file_field() {
require(['jquery'], function() {
$('#id_blindmarking').change(function() {
console.log($(this).val());
-
+
if ($(this).val()== 1) {
$('#id_renamefiles').val(1);
- }
-
+ }
+
});
});
");
@@ -792,7 +791,7 @@ protected function add_rename_file_field() {
} else {
$sql = "SELECT *
- FROM {coursework}
+ FROM {coursework}
WHERE id = :courseworkid
AND renamefiles = 1";
@@ -1182,8 +1181,6 @@ private function add_enable_sampling_checkbox() {
$moodle_form->disabledIf('samplingenabled', 'numberofmarkers', 'eq', 1);
}
-
-
}
/**
@@ -1240,15 +1237,11 @@ private function add_save_feedback_as_draft() {
* @throws coding_exception
*/
private function add_auto_populate_agreed_feedback_comments() {
-
$moodle_form =& $this->_form;
$moodle_form->addElement('selectyesno', 'autopopulatefeedbackcomment', get_string('autopopulatefeedbackcomment', 'mod_coursework'));
$moodle_form->addHelpButton('autopopulatefeedbackcomment', 'autopopulatefeedbackcomment', 'mod_coursework');
-
$moodle_form->disabledIf('autopopulatefeedbackcomment', 'numberofmarkers', 'eq', 1);
-
}
-
private function forceblindmarking() {
global $CFG;
diff --git a/renderers/page_renderer.php b/renderers/page_renderer.php
index e07aab66..3dc1a18c 100644
--- a/renderers/page_renderer.php
+++ b/renderers/page_renderer.php
@@ -1631,7 +1631,6 @@ public function modal_grading_render() {
loading
-
diff --git a/tests/classes/models/coursework_test.php b/tests/classes/models/coursework_test.php
index d6379574..af7d2ab5 100644
--- a/tests/classes/models/coursework_test.php
+++ b/tests/classes/models/coursework_test.php
@@ -281,7 +281,7 @@ public function test_individual_feedback_deadline_has_passed_when_not_set() {
$coursework->update_attribute('individualfeedback', 0);
$this->assertTrue($coursework->individual_feedback_deadline_has_passed());
}
-
+
public function test_finalise_all_leaves_other_submissions_alone() {
$coursework = $this->get_coursework();
$submission = $this->create_a_submission_for_the_student();
diff --git a/tests/classes/models/group_test.php b/tests/classes/models/group_test.php
index 6c84bab3..77d9b5d3 100644
--- a/tests/classes/models/group_test.php
+++ b/tests/classes/models/group_test.php
@@ -44,5 +44,4 @@ public function test_find() {
$this->assertNotEmpty($group->name);
$this->assertEquals($group->name, group::find($group->id)->name);
}
-
}
diff --git a/tests/classes/rule_test.php b/tests/classes/rule_test.php
index c76dfb80..68fcd3b6 100644
--- a/tests/classes/rule_test.php
+++ b/tests/classes/rule_test.php
@@ -103,6 +103,4 @@ public function test_prevents_when_prevent_and_rule_returns_false() {
$rule = new rule('set on fire', 'mod_coursework\models\coursework', $rule_function, false);
$this->assertFalse($rule->prevents($coursework));
}
-
-
-}
+}
From 0725797756e9190c07c10021808fe164c741d7c4 Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Mon, 12 Aug 2024 14:06:41 +0100
Subject: [PATCH 17/51] CTP-3558 coding std avoid IDE doc error
---
classes/framework/decorator.php | 2 +-
classes/framework/test/table_base_test.php | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/classes/framework/decorator.php b/classes/framework/decorator.php
index ec9eb67e..7ebe0f7d 100644
--- a/classes/framework/decorator.php
+++ b/classes/framework/decorator.php
@@ -25,7 +25,7 @@
/**
* Class decorator
*
- * Acts as a decorator around a class. Remember to add the '@mixin' property so that PHPStorm will
+ * Acts as a decorator around a class. Remember to add the @ mixin property so that PHPStorm will
* provide autocompletion of methods and properties.
*/
class decorator {
diff --git a/classes/framework/test/table_base_test.php b/classes/framework/test/table_base_test.php
index 90fad0b3..2f16324e 100644
--- a/classes/framework/test/table_base_test.php
+++ b/classes/framework/test/table_base_test.php
@@ -31,7 +31,7 @@
*/
class framework_table_base_test extends advanced_testcase {
- public function SetUp() {
+ public function setUp(): void {
$this->resetAfterTest();
}
From ab2ddcbb5bc92f7387c50639dfa70e171da37eb7 Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Mon, 12 Aug 2024 14:24:38 +0100
Subject: [PATCH 18/51] CTP-3558 coding std remove excess spaces
---
classes/export/csv/cells/singlegrade_cell.php | 2 +-
classes/models/outstanding_marking.php | 5 ++---
renderable.php | 2 +-
3 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/classes/export/csv/cells/singlegrade_cell.php b/classes/export/csv/cells/singlegrade_cell.php
index a087d9e8..60e899b7 100644
--- a/classes/export/csv/cells/singlegrade_cell.php
+++ b/classes/export/csv/cells/singlegrade_cell.php
@@ -237,7 +237,7 @@ function value_in_rubric($criteria, $value) {
* @param $csv_cells
*
*/
- function get_rubrics($coursework, $csv_cells) {
+ function get_rubrics($coursework, $csv_cells) {
if ($coursework->is_using_rubric()) {
diff --git a/classes/models/outstanding_marking.php b/classes/models/outstanding_marking.php
index 80273403..95c082e1 100644
--- a/classes/models/outstanding_marking.php
+++ b/classes/models/outstanding_marking.php
@@ -102,8 +102,7 @@ private function get_single_marker_initial_grade_submissions_to_mark($coursework
//we only have to check for submissions allocated to this user
$sqltable = ", {coursework_allocation_pairs} cap ";
- $sqlextra = "
- AND cap.courseworkid = cs.courseworkid
+ $sqlextra = " AND cap.courseworkid = cs.courseworkid
AND cap.allocatableid = cs.allocatableid
AND cap.allocatabletype = cs.allocatabletype
AND cap.assessorid = :assessorid ";
@@ -111,7 +110,7 @@ private function get_single_marker_initial_grade_submissions_to_mark($coursework
$sqlparams['assessorid'] = $userid;
}
- $sql = "SELECT cs.id as submissionid
+ $sql = "SELECT cs.id as submissionid
FROM {coursework_submissions} cs
LEFT JOIN {coursework_feedbacks} f
ON cs.id = f.submissionid
diff --git a/renderable.php b/renderable.php
index 22fe0943..374f2fb2 100644
--- a/renderable.php
+++ b/renderable.php
@@ -33,7 +33,7 @@
/**
* Class mod_coursework_renderable
*
- * Acts as a decorator around a class. Remember to add the '@mixin' property so that PHPStorm will
+ * Acts as a decorator around a class. Remember to add the @ mixin property so that PHPStorm will
* provide autocompletion of methods and properties in the renderer. We only need this because feeding
* a namespaced class to the renderer borks it.
*/
From cbe073a1b684eb6981f236f8207d2e4a1b9374be Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Mon, 12 Aug 2024 14:31:24 +0100
Subject: [PATCH 19/51] CTP-3558 coding std licence docs
---
actions/upload_feedback.php | 7 -------
actions/upload_grading_sheet.php | 7 -------
classes/allocation/strategy/base.php | 6 ++++++
classes/assessor_feedback_row.php | 6 ++++++
classes/assessor_feedback_table.php | 6 ++++++
classes/event/assessable_uploaded.php | 5 +++++
classes/export/csv.php | 6 ++++++
classes/export/grading_sheet.php | 6 ++++++
classes/files.php | 6 ++++++
classes/forms/general_feedback_form.php | 6 ++++++
classes/forms/publish_form.php | 6 ++++++
classes/forms/upload_feedback_form.php | 7 -------
classes/forms/upload_grading_sheet_form.php | 7 -------
classes/forms/view_all_students_mform.php | 8 +++++---
classes/framework/table_base.php | 6 ++++++
classes/grades/gradeitems.php | 6 ++++++
classes/grading_report.php | 6 ++++++
classes/grading_table_row_base.php | 6 ++++++
classes/grading_table_row_multi.php | 6 ++++++
classes/grading_table_row_single.php | 6 ++++++
classes/models/allocation.php | 6 ++++++
classes/models/course_module.php | 6 ++++++
classes/models/feedback.php | 6 ++++++
classes/models/moderation.php | 6 ++++++
classes/models/module.php | 6 ++++++
classes/models/submission.php | 6 ++++++
classes/privacy/provider.php | 7 +++++++
classes/utils/cs_editor.php | 6 ++++++
db/install.php | 7 -------
tests/classes/allocation/strategy_test.php | 6 ++++++
30 files changed, 149 insertions(+), 38 deletions(-)
diff --git a/actions/upload_feedback.php b/actions/upload_feedback.php
index 0b3ebb21..d16d6edc 100644
--- a/actions/upload_feedback.php
+++ b/actions/upload_feedback.php
@@ -20,13 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-/**
- * Created by PhpStorm.
- * User: Nigel.Daley
- * Date: 11/08/2015
- * Time: 11:32
- */
-
use mod_coursework\models\coursework;
use mod_coursework\export;
diff --git a/actions/upload_grading_sheet.php b/actions/upload_grading_sheet.php
index b90647b5..1d96d4ce 100644
--- a/actions/upload_grading_sheet.php
+++ b/actions/upload_grading_sheet.php
@@ -20,13 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-/**
- * Created by PhpStorm.
- * User: Nigel.Daley
- * Date: 11/08/2015
- * Time: 11:32
- */
-
use mod_coursework\models\coursework;
use mod_coursework\export;
diff --git a/classes/allocation/strategy/base.php b/classes/allocation/strategy/base.php
index a345ac3b..1512bd61 100644
--- a/classes/allocation/strategy/base.php
+++ b/classes/allocation/strategy/base.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
namespace mod_coursework\allocation\strategy;
use mod_coursework\allocation\allocatable;
diff --git a/classes/assessor_feedback_row.php b/classes/assessor_feedback_row.php
index ab044f03..d24932d6 100644
--- a/classes/assessor_feedback_row.php
+++ b/classes/assessor_feedback_row.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
namespace mod_coursework;
use mod_coursework\allocation\allocatable;
diff --git a/classes/assessor_feedback_table.php b/classes/assessor_feedback_table.php
index 0d30597c..67745e8f 100644
--- a/classes/assessor_feedback_table.php
+++ b/classes/assessor_feedback_table.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
namespace mod_coursework;
use mod_coursework\allocation\allocatable;
diff --git a/classes/event/assessable_uploaded.php b/classes/event/assessable_uploaded.php
index 419b0ab4..fc777a59 100644
--- a/classes/event/assessable_uploaded.php
+++ b/classes/event/assessable_uploaded.php
@@ -13,6 +13,11 @@
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
namespace mod_coursework\event;
use mod_coursework\models\submission;
diff --git a/classes/export/csv.php b/classes/export/csv.php
index ac2fd4a6..be0d8501 100644
--- a/classes/export/csv.php
+++ b/classes/export/csv.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
namespace mod_coursework\export;
use csv_export_writer;
diff --git a/classes/export/grading_sheet.php b/classes/export/grading_sheet.php
index d0966612..8cc84566 100644
--- a/classes/export/grading_sheet.php
+++ b/classes/export/grading_sheet.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
namespace mod_coursework\export;
use mod_coursework\export\csv;
use mod_coursework\models\submission;
diff --git a/classes/files.php b/classes/files.php
index 6ab4dfe2..5c988cdf 100644
--- a/classes/files.php
+++ b/classes/files.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
namespace mod_coursework;
use Countable;
diff --git a/classes/forms/general_feedback_form.php b/classes/forms/general_feedback_form.php
index 7106ae21..8725a2a2 100644
--- a/classes/forms/general_feedback_form.php
+++ b/classes/forms/general_feedback_form.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
namespace mod_coursework\forms;
use moodleform;
diff --git a/classes/forms/publish_form.php b/classes/forms/publish_form.php
index 5adca749..dafc95d3 100644
--- a/classes/forms/publish_form.php
+++ b/classes/forms/publish_form.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
namespace mod_coursework\forms;
use mod_coursework\grading_report;
diff --git a/classes/forms/upload_feedback_form.php b/classes/forms/upload_feedback_form.php
index d55602ad..14823f6d 100644
--- a/classes/forms/upload_feedback_form.php
+++ b/classes/forms/upload_feedback_form.php
@@ -20,13 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-/**
- * Created by PhpStorm.
- * User: Nigel.Daley
- * Date: 10/08/2015
- * Time: 18:27
- */
-
require_once($CFG->libdir.'/formslib.php');
class upload_feedback_form extends moodleform {
diff --git a/classes/forms/upload_grading_sheet_form.php b/classes/forms/upload_grading_sheet_form.php
index cad6e884..dfbd71ae 100644
--- a/classes/forms/upload_grading_sheet_form.php
+++ b/classes/forms/upload_grading_sheet_form.php
@@ -20,13 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-/**
- * Created by PhpStorm.
- * User: Nigel.Daley
- * Date: 10/08/2015
- * Time: 18:27
- */
-
require_once($CFG->libdir.'/formslib.php');
class upload_grading_sheet_form extends moodleform {
diff --git a/classes/forms/view_all_students_mform.php b/classes/forms/view_all_students_mform.php
index 684f56e4..ec5692c1 100644
--- a/classes/forms/view_all_students_mform.php
+++ b/classes/forms/view_all_students_mform.php
@@ -14,9 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
-/*
- * this is a mform designed to allow the toggling of the displaying of students not allocated to the current user
- *
+/**
+ * This is a mform designed to allow the toggling of the displaying of students not allocated to the current user
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_coursework\forms;
diff --git a/classes/framework/table_base.php b/classes/framework/table_base.php
index 4f391d51..e104fffc 100644
--- a/classes/framework/table_base.php
+++ b/classes/framework/table_base.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
namespace mod_coursework\framework;;
use moodle_database;
diff --git a/classes/grades/gradeitems.php b/classes/grades/gradeitems.php
index ef05f002..dbc56d1b 100644
--- a/classes/grades/gradeitems.php
+++ b/classes/grades/gradeitems.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
/**
* Grade item mappings for the activity.
*
diff --git a/classes/grading_report.php b/classes/grading_report.php
index 2e87a6db..17a555d7 100644
--- a/classes/grading_report.php
+++ b/classes/grading_report.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
namespace mod_coursework;
use mod_coursework\models\allocation;
diff --git a/classes/grading_table_row_base.php b/classes/grading_table_row_base.php
index 79d974af..825f3d83 100644
--- a/classes/grading_table_row_base.php
+++ b/classes/grading_table_row_base.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
namespace mod_coursework;
use html_writer;
diff --git a/classes/grading_table_row_multi.php b/classes/grading_table_row_multi.php
index 232865d8..d2d1ece9 100644
--- a/classes/grading_table_row_multi.php
+++ b/classes/grading_table_row_multi.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
namespace mod_coursework;
defined('MOODLE_INTERNAL') || die();
diff --git a/classes/grading_table_row_single.php b/classes/grading_table_row_single.php
index adc8d561..4c43405c 100644
--- a/classes/grading_table_row_single.php
+++ b/classes/grading_table_row_single.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
namespace mod_coursework;
use coding_exception;
diff --git a/classes/models/allocation.php b/classes/models/allocation.php
index 73b50b53..3b019615 100644
--- a/classes/models/allocation.php
+++ b/classes/models/allocation.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
namespace mod_coursework\models;
use mod_coursework\framework\table_base;
diff --git a/classes/models/course_module.php b/classes/models/course_module.php
index 26742727..ec329270 100644
--- a/classes/models/course_module.php
+++ b/classes/models/course_module.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
namespace mod_coursework\models;
use mod_coursework\framework\table_base;
diff --git a/classes/models/feedback.php b/classes/models/feedback.php
index b3a5cc3a..688903f6 100644
--- a/classes/models/feedback.php
+++ b/classes/models/feedback.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
namespace mod_coursework\models;
use context;
diff --git a/classes/models/moderation.php b/classes/models/moderation.php
index b260adbb..78edbaf8 100644
--- a/classes/models/moderation.php
+++ b/classes/models/moderation.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
namespace mod_coursework\models;
use context;
diff --git a/classes/models/module.php b/classes/models/module.php
index 57739a73..c0f91448 100644
--- a/classes/models/module.php
+++ b/classes/models/module.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
namespace mod_coursework\models;
use mod_coursework\framework\table_base;
diff --git a/classes/models/submission.php b/classes/models/submission.php
index 0ba15d58..e08d8edf 100644
--- a/classes/models/submission.php
+++ b/classes/models/submission.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
namespace mod_coursework\models;
use context;
diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php
index 33cdc707..acc79b7a 100644
--- a/classes/privacy/provider.php
+++ b/classes/privacy/provider.php
@@ -13,6 +13,13 @@
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
namespace mod_coursework\privacy;
defined('MOODLE_INTERNAL') || die();
use core_privacy\local\metadata\collection;
diff --git a/classes/utils/cs_editor.php b/classes/utils/cs_editor.php
index 0e7590f6..fdd2ae41 100644
--- a/classes/utils/cs_editor.php
+++ b/classes/utils/cs_editor.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
namespace mod_coursework\utils;
/**
diff --git a/db/install.php b/db/install.php
index dd92ddb0..80822a03 100644
--- a/db/install.php
+++ b/db/install.php
@@ -20,13 +20,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-/**
- * Created by PhpStorm.
- * User: Nigel.Daley
- * Date: 08/10/2015
- * Time: 17:19
- */
-
defined('MOODLE_INTERNAL') || die();
function xmldb_coursework_install() {
diff --git a/tests/classes/allocation/strategy_test.php b/tests/classes/allocation/strategy_test.php
index add62025..1ad960c6 100644
--- a/tests/classes/allocation/strategy_test.php
+++ b/tests/classes/allocation/strategy_test.php
@@ -14,6 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * @package mod_coursework
+ * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
defined('MOODLE_INTERNAL') || die();
global $CFG;
From a3eb417d5ba91b21ad49a32bae0f100536c26636 Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Mon, 12 Aug 2024 15:05:05 +0100
Subject: [PATCH 20/51] CTP-3558 coding std insert space after comma
---
actions/personal_deadline.php | 4 +-
actions/upload_feedback.php | 2 +-
actions/upload_grading_sheet.php | 2 +-
.../backup_coursework_activity_task.class.php | 8 +-
backup/moodle2/backup_coursework_stepslib.php | 4 +-
.../moodle2/restore_coursework_stepslib.php | 136 +++++++++---------
classes/allocation/manager.php | 4 +-
classes/allocation/strategy/none.php | 2 +-
classes/allocation/upload.php | 18 +--
.../deadline_extensions_controller.php | 2 +-
classes/export/csv.php | 12 +-
.../export/csv/cells/agreedfeedback_cell.php | 10 +-
classes/export/csv/cells/agreedgrade_cell.php | 12 +-
.../csv/cells/assessorfeedback_cell.php | 18 +--
.../export/csv/cells/assessorgrade_cell.php | 4 +-
.../csv/cells/feedbackcomments_cell.php | 8 +-
classes/export/csv/cells/singlegrade_cell.php | 14 +-
.../csv/cells/submissionfileid_cell.php | 2 +-
.../export/csv/cells/submissionid_cell.php | 4 +-
classes/export/import.php | 10 +-
classes/forms/deadline_extension_form.php | 2 +-
classes/forms/plagiarism_flagging_mform.php | 2 +-
classes/forms/student_submission_form.php | 2 +-
classes/forms/upload_allocations_form.php | 4 +-
classes/forms/upload_feedback_form.php | 4 +-
classes/forms/upload_grading_sheet_form.php | 4 +-
classes/grading_report.php | 2 +-
classes/models/coursework.php | 2 +-
classes/models/feedback.php | 2 +-
classes/models/outstanding_marking.php | 6 +-
.../personal_deadline/table/row/builder.php | 4 +-
.../grading_report/cells/group_cell.php | 4 +-
.../grading_report/cells/idnumber_cell.php | 2 +-
.../cells/moderation_agreement_cell.php | 4 +-
.../cells/multiple_agreed_grade_cell.php | 2 +-
.../cells/single_assessor_feedback_cell.php | 4 +-
.../cells/time_submitted_cell.php | 2 +-
.../multi_marker_feedback_sub_rows.php | 8 +-
classes/sample_set_rule/range_sample_type.php | 34 ++---
classes/sample_set_rule/sample_base.php | 4 +-
classes/sample_set_rule/total_sample_type.php | 14 +-
classes/task/enrol_task.php | 2 +-
classes/task/unenrol_task.php | 2 +-
db/upgrade.php | 4 +-
lib.php | 6 +-
mod_form.php | 2 +-
renderers/grading_report_renderer.php | 6 +-
renderers/object_renderer.php | 18 +--
renderers/page_renderer.php | 12 +-
settings.php | 4 +-
tests/classes/export/csv_test.php | 2 +-
view.php | 2 +-
52 files changed, 224 insertions(+), 224 deletions(-)
diff --git a/actions/personal_deadline.php b/actions/personal_deadline.php
index d797b392..e05d54ad 100644
--- a/actions/personal_deadline.php
+++ b/actions/personal_deadline.php
@@ -31,7 +31,7 @@
$setpersonaldeadlinespage = optional_param('setpersonaldeadlinespage', 0, PARAM_INT);
$multipleuserdeadlines = optional_param('multipleuserdeadlines', 0, PARAM_INT);
$selectedtype = optional_param('selectedtype', 'date', PARAM_RAW);
-$personal_deadline_time = optional_param('personal_deadline_time',null, PARAM_RAW);
+$personal_deadline_time = optional_param('personal_deadline_time', null, PARAM_RAW);
$allocatableid = (!empty($allocatableid_arr)) ? $allocatableid_arr : $allocatableid ;
@@ -39,7 +39,7 @@
$coursework = \mod_coursework\models\coursework::find($coursework_db);
-require_login($coursework->get_course(),false, $coursework->get_course_module());
+require_login($coursework->get_course(), false, $coursework->get_course_module());
$params = array(
'courseworkid' => $courseworkid,
diff --git a/actions/upload_feedback.php b/actions/upload_feedback.php
index d16d6edc..7aa870d7 100644
--- a/actions/upload_feedback.php
+++ b/actions/upload_feedback.php
@@ -68,7 +68,7 @@
}
$filename = clean_param($feedbackform->get_new_filename('feedbackzip'), PARAM_FILE);
- $filename = md5(rand(0,1000000).$filename);
+ $filename = md5(rand(0, 1000000).$filename);
$filepath = $courseworktempdir.'/'.$filename.".zip";
$feedbackform->save_file('feedbackzip', $filepath);
diff --git a/actions/upload_grading_sheet.php b/actions/upload_grading_sheet.php
index 1d96d4ce..68c7975b 100644
--- a/actions/upload_grading_sheet.php
+++ b/actions/upload_grading_sheet.php
@@ -67,7 +67,7 @@
$csv_cells = \mod_coursework\export\grading_sheet::cells_array($coursework);
- $csvimport = new \mod_coursework\export\import($coursework,false,false);
+ $csvimport = new \mod_coursework\export\import($coursework, false, false);
// $csv_cells = $csvimport->csv_columns(); //all columns from spreadsheet
diff --git a/backup/moodle2/backup_coursework_activity_task.class.php b/backup/moodle2/backup_coursework_activity_task.class.php
index dff99027..3239a8ec 100644
--- a/backup/moodle2/backup_coursework_activity_task.class.php
+++ b/backup/moodle2/backup_coursework_activity_task.class.php
@@ -30,11 +30,11 @@ static public function encode_content_links($content) {
$base = preg_quote($CFG->wwwroot, "/");
//These have to be picked up by the restore code COURSEWORK... are arbitrary
- $search="/(".$base."\/mod\/coursework\/index.php\?id\=)([0-9]+)/";
- $content= preg_replace($search, '$@COURSEWORKINDEX*$2@$', $content);
+ $search = "/(".$base."\/mod\/coursework\/index.php\?id\=)([0-9]+)/";
+ $content = preg_replace($search, '$@COURSEWORKINDEX*$2@$', $content);
- $search="/(".$base."\/mod\/coursework\/view.php\?id\=)([0-9]+)/";
- $content= preg_replace($search, '$@COURSEWORKBYID*$2@$', $content);
+ $search = "/(".$base."\/mod\/coursework\/view.php\?id\=)([0-9]+)/";
+ $content = preg_replace($search, '$@COURSEWORKBYID*$2@$', $content);
return $content;
}
diff --git a/backup/moodle2/backup_coursework_stepslib.php b/backup/moodle2/backup_coursework_stepslib.php
index b15af260..1ff56647 100644
--- a/backup/moodle2/backup_coursework_stepslib.php
+++ b/backup/moodle2/backup_coursework_stepslib.php
@@ -424,8 +424,8 @@ protected function define_structure() {
$plagiarism_flag->annotate_ids('user', 'createdby');
$plagiarism_flag->annotate_ids('user', 'lastmodifiedby');
- $coursework->annotate_files('mod_coursework', 'feedback',null);
- $coursework->annotate_files('mod_coursework', 'submission',null);
+ $coursework->annotate_files('mod_coursework', 'feedback', null);
+ $coursework->annotate_files('mod_coursework', 'submission', null);
}
diff --git a/backup/moodle2/restore_coursework_stepslib.php b/backup/moodle2/restore_coursework_stepslib.php
index d21958c3..467e6b92 100644
--- a/backup/moodle2/restore_coursework_stepslib.php
+++ b/backup/moodle2/restore_coursework_stepslib.php
@@ -25,12 +25,12 @@
class restore_coursework_activity_structure_step extends restore_activity_structure_step
{
// Just a handy way to spit out debugging info while in the bowels of restore
- static function cheaplog($thing, $append=true) {
+ static function cheaplog($thing, $append = true) {
if ($append) {
- $append=FILE_APPEND;
+ $append = FILE_APPEND;
}
- file_put_contents('/tmp/cheap.log',print_r($thing,true)."\n---------------\n", $append);
+ file_put_contents('/tmp/cheap.log',print_r($thing, true)."\n---------------\n", $append);
}
/**
@@ -53,7 +53,7 @@ protected function define_structure() {
// and that the coursework_ prefix is not needed.
// It would be nice to go back and take these out here and in backup.
// But not essential
- $bits=array('submission' => 'coursework_submissions',
+ $bits = array('submission' => 'coursework_submissions',
'feedback' => 'coursework_submissions/coursework_submission/coursework_feedbacks',
'reminder' => 'coursework_reminders',
'allocation_pair' => 'coursework_allocation_pairs',
@@ -66,9 +66,9 @@ protected function define_structure() {
'mod_agreement' => 'coursework_submissions/coursework_submission/coursework_feedbacks/coursework_feedback/coursework_mod_agreements',
'plagiarism_flag' => 'coursework_submissions/coursework_submission/coursework_plagiarism_flags');
- foreach ($bits as $bit=> $bitpath) {
- $p = new restore_path_element("coursework_$bit","/activity/coursework/{$bitpath}/coursework_$bit");
- $paths[]=$p;
+ foreach ($bits as $bit => $bitpath) {
+ $p = new restore_path_element("coursework_$bit", "/activity/coursework/{$bitpath}/coursework_$bit");
+ $paths[] = $p;
}
}
@@ -77,22 +77,22 @@ protected function define_structure() {
protected function fixallocatable(&$data) {
if (!empty($data->allocatableuser)) {
- $data->allocatableid=$this->get_mappingid('user', $data->allocatableuser);
- $data->allocatabletype='user';
+ $data->allocatableid = $this->get_mappingid('user', $data->allocatableuser);
+ $data->allocatabletype = 'user';
}
else
{
- $data->allocatableid=$this->get_mappingid('group', $data->allocatablegroup);
- $data->allocatabletype='group';
+ $data->allocatableid = $this->get_mappingid('group', $data->allocatablegroup);
+ $data->allocatabletype = 'group';
}
}
protected function process_coursework_submission($data) {
global $DB;
- $data=(object)$data;
- $oldid=$data->id;
+ $data = (object)$data;
+ $oldid = $data->id;
- $data->courseworkid=$this->get_new_parentid('coursework');
+ $data->courseworkid = $this->get_new_parentid('coursework');
$data->userid = $this->get_mappingid('user', $data->userid);
$data->createdby = $this->get_mappingid('user', $data->createdby);
$data->lastupdatedby = $this->get_mappingid('user', $data->lastupdatedby);
@@ -103,9 +103,9 @@ protected function process_coursework_submission($data) {
'timecreated',
'timesubmitted',
'firstpublished',
- 'lastpublished',), $data);
+ 'lastpublished',), $data);
- $now=time();
+ $now = time();
$this->set_defaults(array('timecreated' => $now,
'timemodified' => $now,
'firstpublished' => null,
@@ -129,13 +129,13 @@ protected function process_coursework_submission($data) {
protected function process_coursework_feedback($data) {
global $DB;
- $data=(object)$data;
- $oldid=$data->id;
+ $data = (object)$data;
+ $oldid = $data->id;
- $data->submissionid=$this->get_mappingid('coursework_submission', $data->submissionid);
- $data->assessorid=$this->get_mappingid('user', $data->assessorid);
- $data->lasteditedbyuser=$this->get_mappingid('user', $data->lasteditedbyuser);
- $data->markernumber=$this->get_mappingid('user', $data->markernumber);
+ $data->submissionid = $this->get_mappingid('coursework_submission', $data->submissionid);
+ $data->assessorid = $this->get_mappingid('user', $data->assessorid);
+ $data->lasteditedbyuser = $this->get_mappingid('user', $data->lasteditedbyuser);
+ $data->markernumber = $this->get_mappingid('user', $data->markernumber);
$this->updatedate(array('timemodified',
'timecreated',
@@ -144,7 +144,7 @@ protected function process_coursework_feedback($data) {
$this->check_grade('grade', $data);
$this->check_grade('cappedgrade', $data);
- $now=time();
+ $now = time();
$this->set_defaults(array('assessorid' => 0,
'timecreated' => $now,
'timemodified' => $now,
@@ -167,10 +167,10 @@ protected function process_coursework_feedback($data) {
}
protected function process_coursework_reminder($data) {
- $data=(object)$data;
- $oldid=$data->id;
+ $data = (object)$data;
+ $oldid = $data->id;
- $data->coursework_id=$this->get_new_parentid('coursework');
+ $data->coursework_id = $this->get_new_parentid('coursework');
$data->userid = $this->get_mappingid('user', $data->userid);
$this->set_defaults(array('remindernumber' => 0), $data);
@@ -180,10 +180,10 @@ protected function process_coursework_reminder($data) {
}
protected function process_coursework_allocation_pair($data) {
- $data=(object)$data;
- $oldid=$data->id;
+ $data = (object)$data;
+ $oldid = $data->id;
- $data->courseworkid=$this->get_new_parentid('coursework');
+ $data->courseworkid = $this->get_new_parentid('coursework');
$data->assessorid = $this->get_mappingid('user', $data->assessorid);
$this->updatedate(array('timelocked'), $data);
@@ -200,10 +200,10 @@ protected function process_coursework_allocation_pair($data) {
}
protected function process_coursework_mod_set_rule($data) {
- $data=(object)$data;
- $oldid=$data->id;
+ $data = (object)$data;
+ $oldid = $data->id;
- $data->courseworkid=$this->get_new_parentid('coursework');
+ $data->courseworkid = $this->get_new_parentid('coursework');
$this->set_defaults(array('rulename' => '',
'ruleorder' => 0,
@@ -216,10 +216,10 @@ protected function process_coursework_mod_set_rule($data) {
}
protected function process_coursework_sample_set_rule($data) {
- $data=(object)$data;
- $oldid=$data->id;
+ $data = (object)$data;
+ $oldid = $data->id;
- $data->courseworkid=$this->get_new_parentid('coursework');
+ $data->courseworkid = $this->get_new_parentid('coursework');
$this->set_defaults(array('ruletype' => '',
'ruleorder' => 0,
@@ -233,10 +233,10 @@ protected function process_coursework_sample_set_rule($data) {
}
protected function process_coursework_allocation_config($data) {
- $data=(object)$data;
- $oldid=$data->id;
+ $data = (object)$data;
+ $oldid = $data->id;
- $data->courseworkid=$this->get_new_parentid('coursework');
+ $data->courseworkid = $this->get_new_parentid('coursework');
$data->assessorid = $this->get_mappingid('user', $data->assessorid);
$this->set_defaults(array('allocationstrategy' => '',
@@ -249,9 +249,9 @@ protected function process_coursework_allocation_config($data) {
}
protected function process_coursework_mod_set_member($data) {
- $data=(object)$data;
+ $data = (object)$data;
- $data->courseworkid=$this->get_new_parentid('coursework');
+ $data->courseworkid = $this->get_new_parentid('coursework');
$this->fixallocatable($data);
@@ -262,9 +262,9 @@ protected function process_coursework_mod_set_member($data) {
}
protected function process_coursework_sample_set_mbr($data) {
- $data=(object)$data;
+ $data = (object)$data;
- $data->courseworkid=$this->get_new_parentid('coursework');
+ $data->courseworkid = $this->get_new_parentid('coursework');
$this->fixallocatable($data);
@@ -280,9 +280,9 @@ protected function process_coursework_sample_set_mbr($data) {
}
protected function process_coursework_extension($data) {
- $data=(object)$data;
+ $data = (object)$data;
- $data->courseworkid=$this->get_new_parentid('coursework');
+ $data->courseworkid = $this->get_new_parentid('coursework');
$data->createdbyid = $this->get_mappingid('user', $data->createdbyid);
$this->fixallocatable($data);
@@ -301,11 +301,11 @@ protected function process_coursework_extension($data) {
}
protected function process_coursework_person_deadline($data) {
- $data=(object)$data;
+ $data = (object)$data;
- $data->courseworkid=$this->get_new_parentid('coursework');
+ $data->courseworkid = $this->get_new_parentid('coursework');
$data->createdbyid = $this->get_mappingid('user', $data->createdbyid);
- $data->lastmodifiedbyid=$this->get_mappingid('user', $data->lastmodifiedbyid);
+ $data->lastmodifiedbyid = $this->get_mappingid('user', $data->lastmodifiedbyid);
$this->fixallocatable($data);
@@ -313,7 +313,7 @@ protected function process_coursework_person_deadline($data) {
'timecreated',
'timemodified'), $data);
- $now=time();
+ $now = time();
$this->set_defaults(array('personal_deadline' => 0,
'timecreated' => $now,
'timemodified' => 0,
@@ -324,18 +324,18 @@ protected function process_coursework_person_deadline($data) {
}
protected function process_coursework_mod_agreement($data) {
- $data=(object)$data;
+ $data = (object)$data;
- $data->feedbackid=$this->get_new_parentid('coursework_feedback');
+ $data->feedbackid = $this->get_new_parentid('coursework_feedback');
$data->moderatorid = $this->get_mappingid('user', $data->moderatorid);
- $data->lastmodifiedby=$this->get_mappingid('user', $data->lastmodifiedby);
+ $data->lastmodifiedby = $this->get_mappingid('user', $data->lastmodifiedby);
$this->fixallocatable($data);
$this->updatedate(array('timecreated',
'timemodified'), $data);
- $now=time();
+ $now = time();
$this->set_defaults(array('timecreated' => $now,
'timemodified' => $now,
'lasteditedby' => 0,
@@ -347,18 +347,18 @@ protected function process_coursework_mod_agreement($data) {
}
protected function process_coursework_plagiarism_flag($data) {
- $data=(object)$data;
+ $data = (object)$data;
- $data->submissionid=$this->get_new_parentid('coursework_submission');
+ $data->submissionid = $this->get_new_parentid('coursework_submission');
$data->createdby = $this->get_mappingid('user', $data->createdby);
- $data->lastmodifiedby=$this->get_mappingid('user', $data->lastmodifiedby);
+ $data->lastmodifiedby = $this->get_mappingid('user', $data->lastmodifiedby);
$this->fixallocatable($data);
$this->updatedate(array('timecreated',
'timemodified'), $data);
- $now=time();
+ $now = time();
$this->set_defaults(array('timecreated' => $now,
'timemodified' => $now,
'lastmodifieddby' => 0,
@@ -388,7 +388,7 @@ protected function process_coursework($data) {
'generalfeedbacktimepublished',
'deadline'), $data);
- $now=time();
+ $now = time();
//Taken from install.xml
$this->set_defaults(array('formid' => 0,
'course' => 0,
@@ -467,24 +467,24 @@ protected function process_coursework($data) {
}
- protected function check_grade($field,&$data) {
+ protected function check_grade($field, &$data) {
if ($data->$field < 0) // Scale found, get mapping.
{
$data->$field = -($this->get_mappingid('scale', abs($data->$field)));
}
}
- protected function set_defaults($fields,&$data) {
- foreach ($fields as $name=> $default) {
+ protected function set_defaults($fields, &$data) {
+ foreach ($fields as $name => $default) {
if (!isset($data->$name)) {
- $data->$name=$default;
+ $data->$name = $default;
}
}
}
- protected function updatedate($fields,&$data) {
+ protected function updatedate($fields, &$data) {
foreach ($fields as $field) {
- $data->$field=$this->apply_date_offset($data->$field);
+ $data->$field = $this->apply_date_offset($data->$field);
}
}
@@ -494,16 +494,16 @@ protected function after_execute() {
$this->add_related_files('mod_coursework', 'feedback', 'coursework_feedback');
//Fixup names
- $fs=get_file_storage();
- $ctx=context::instance_by_id($this->task->get_contextid());
+ $fs = get_file_storage();
+ $ctx = context::instance_by_id($this->task->get_contextid());
- $files=$fs->get_area_files($ctx->id, 'mod_coursework', 'submission'); //Array of stored_file
+ $files = $fs->get_area_files($ctx->id, 'mod_coursework', 'submission'); //Array of stored_file
foreach ($files as $file) {
if (!$file->is_directory()) {
- $itemid=$file->get_itemid();
+ $itemid = $file->get_itemid();
- $entry=$DB->get_record('coursework_submissions',
+ $entry = $DB->get_record('coursework_submissions',
array('id' => $itemid));
$submission = \mod_coursework\models\submission::find($entry->id);
diff --git a/classes/allocation/manager.php b/classes/allocation/manager.php
index 6f080683..7098ecff 100644
--- a/classes/allocation/manager.php
+++ b/classes/allocation/manager.php
@@ -246,7 +246,7 @@ public function save_sample_set_rule($assessor_number) {
global $CFG, $DB;
- $sampleplugins = $DB->get_records('coursework_sample_set_plugin',null, 'pluginorder');
+ $sampleplugins = $DB->get_records('coursework_sample_set_plugin', null, 'pluginorder');
$order = 0;
foreach ($sampleplugins as $plugin) {
@@ -286,7 +286,7 @@ private function get_coursework() {
public function auto_generate_sample_set() {
global $DB;
- $sampleplugins = $DB->get_records('coursework_sample_set_plugin',null, 'pluginorder');
+ $sampleplugins = $DB->get_records('coursework_sample_set_plugin', null, 'pluginorder');
$order = 0;
$sample_set = array();
diff --git a/classes/allocation/strategy/none.php b/classes/allocation/strategy/none.php
index 471a78b7..4b4fdfc5 100644
--- a/classes/allocation/strategy/none.php
+++ b/classes/allocation/strategy/none.php
@@ -51,7 +51,7 @@ public function add_form_elements($strategypurpose = 'assessor') {
global $PAGE, $CFG;
$url = "$CFG->wwwroot/mod/coursework/actions/upload_allocations.php?cmid={$PAGE->cm->id}";
- $html = html_writer::link($url,get_string('uploadallocations', 'mod_coursework'));
+ $html = html_writer::link($url, get_string('uploadallocations', 'mod_coursework'));
return $html;
}
diff --git a/classes/allocation/upload.php b/classes/allocation/upload.php
index 7ef9a6a5..010130cc 100644
--- a/classes/allocation/upload.php
+++ b/classes/allocation/upload.php
@@ -83,7 +83,7 @@ public function validate_csv($content, $encoding, $delimeter) {
$csv_cells = array('allocatable');
$stages = $this->coursework->get_max_markers();
- for ($i=1; $i<=$stages; $i++) {
+ for ($i = 1; $i<=$stages; $i++) {
$csv_cells[] = 'assessor_'.$i;
}
@@ -102,7 +102,7 @@ public function validate_csv($content, $encoding, $delimeter) {
if ($allocatabletype == 'user') {
// get user id
- $suballocatable = $DB->get_record('user', array($assessor_identifier=> $value));
+ $suballocatable = $DB->get_record('user', array($assessor_identifier => $value));
$allocatable = ($suballocatable)? \mod_coursework\models\user::find($suballocatable->id): '';
} else {
// get group id
@@ -114,17 +114,17 @@ public function validate_csv($content, $encoding, $delimeter) {
// check if allocatable exists in this coursework
if (!$allocatable || !in_array($allocatable->id, $allocatables)) {$errors[$s] = get_string($allocatabletype .'notincoursework', 'coursework'); break;}
// duplicate user or group
- if ($allocatable && in_array($allocatable->id, $allocatablesinfile)) {$errors[$s] = get_string('duplicate'. $allocatabletype , 'coursework') ; break;}
+ if ($allocatable && in_array($allocatable->id, $allocatablesinfile)) {$errors[$s] = get_string('duplicate'. $allocatabletype, 'coursework') ; break;}
$allocatablesinfile[] = $allocatable->id;
}
// validate assessor if exists in the coursework and has one of the capabilities allowing them to grade
// in initial stage
- if (substr($cells[$keynum],0,8) == 'assessor') {
+ if (substr($cells[$keynum], 0, 8) == 'assessor') {
// skip empty assessors fields
if (empty($value)) { continue;}
- $assessor = $DB->get_record('user', array($assessor_identifier=> $value));
+ $assessor = $DB->get_record('user', array($assessor_identifier => $value));
if (!$assessor ||!in_array($assessor->id, $assessors)) {$errors[$s] = get_string('assessornotincoursework', 'coursework', $keynum ); continue;}
@@ -186,7 +186,7 @@ public function process_csv($content, $encoding, $delimiter, $processingresults)
$s = 0;
$csv_cells = array('allocatable');
$stages = $this->coursework->get_max_markers();
- for ($i=1; $i<=$stages; $i++) {
+ for ($i = 1; $i<=$stages; $i++) {
$csv_cells[] = 'assessor_'.$i;
}
@@ -211,7 +211,7 @@ public function process_csv($content, $encoding, $delimiter, $processingresults)
if ($cells[$keynum] == 'allocatable') {
if ($allocatabletype == 'user') {
// get user id
- $suballocatable = $DB->get_record('user', array($assessor_identifier=> $value));
+ $suballocatable = $DB->get_record('user', array($assessor_identifier => $value));
$allocatable = ($suballocatable)? \mod_coursework\models\user::find($suballocatable->id): '';
} else {
// get group id
@@ -220,9 +220,9 @@ public function process_csv($content, $encoding, $delimiter, $processingresults)
$allocatable = ($suballocatable)? \mod_coursework\models\group::find($suballocatable->id): '';
}
}
- if (substr($cells[$keynum],0,8) == 'assessor' && !(empty($value))) {
+ if (substr($cells[$keynum], 0, 8) == 'assessor' && !(empty($value))) {
- $assessor = $DB->get_record('user', array($assessor_identifier=> $value));
+ $assessor = $DB->get_record('user', array($assessor_identifier => $value));
$params = array('courseworkid' => $this->coursework->id,
'allocatableid' => $allocatable->id,
diff --git a/classes/controllers/deadline_extensions_controller.php b/classes/controllers/deadline_extensions_controller.php
index 2f50d882..b9b397c5 100644
--- a/classes/controllers/deadline_extensions_controller.php
+++ b/classes/controllers/deadline_extensions_controller.php
@@ -341,7 +341,7 @@ public function ajax_new_mitigation($data_params) {
);
$ability = new ability(user::find($USER), $this->coursework);
- $deadline_extension= deadline_extension::build($params);
+ $deadline_extension = deadline_extension::build($params);
$ability->require_can('new', $deadline_extension);
$time_content = '';
$time = '';
diff --git a/classes/export/csv.php b/classes/export/csv.php
index be0d8501..788d17be 100644
--- a/classes/export/csv.php
+++ b/classes/export/csv.php
@@ -113,13 +113,13 @@ public function export() {
public function add_cells_to_array($submission, $student, $csv_cells) {
$row = array();
foreach ($csv_cells as $csv_cell) {
- if (substr($csv_cell,0,8) == 'assessor') {
- $stage_dentifier = 'assessor_'.(substr($csv_cell,-1));
+ if (substr($csv_cell, 0, 8) == 'assessor') {
+ $stage_dentifier = 'assessor_'.(substr($csv_cell, -1));
$csv_cell = substr($csv_cell, 0, -1);
}
$class = "mod_coursework\\export\\csv\\cells\\".$csv_cell."_cell";
$cell = new $class($this->coursework);
- if (substr($csv_cell,0,8) == 'assessor') {
+ if (substr($csv_cell, 0, 8) == 'assessor') {
$cell = $cell->get_cell($submission, $student, $stage_dentifier);
if (is_array($cell)) {
$row = array_merge($row, $cell);
@@ -150,13 +150,13 @@ public function add_cells_to_array($submission, $student, $csv_cells) {
public function add_headers($csv_headers) {
$headers = array();
foreach ($csv_headers as $header) {
- if (substr($header,0,8) == 'assessor') {
- $stage = (substr($header,-1));
+ if (substr($header, 0, 8) == 'assessor') {
+ $stage = (substr($header, -1));
$header = substr($header, 0, -1);
}
$class = "mod_coursework\\export\\csv\\cells\\".$header."_cell";
$cell = new $class($this->coursework);
- if (substr($header,0,8) == 'assessor') {
+ if (substr($header, 0, 8) == 'assessor') {
$head = $cell->get_header($stage);
if (is_array($head)) {
$headers = array_merge($headers, $head);
diff --git a/classes/export/csv/cells/agreedfeedback_cell.php b/classes/export/csv/cells/agreedfeedback_cell.php
index 1550d8dd..5ed7a8fa 100644
--- a/classes/export/csv/cells/agreedfeedback_cell.php
+++ b/classes/export/csv/cells/agreedfeedback_cell.php
@@ -56,8 +56,8 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
global $DB, $PAGE, $USER;
$stage_identifier = 'final_agreed_1';
- $agreedgradecap = array('mod/coursework:addagreedgrade','mod/coursework:editagreedgrade',
- 'mod/coursework:addallocatedagreedgrade','mod/coursework:editallocatedagreedgrade');
+ $agreedgradecap = array('mod/coursework:addagreedgrade', 'mod/coursework:editagreedgrade',
+ 'mod/coursework:addallocatedagreedgrade', 'mod/coursework:editallocatedagreedgrade');
if (has_any_capability($agreedgradecap, $PAGE->context)
|| has_capability('mod/coursework:administergrades', $PAGE->context)) {
@@ -66,7 +66,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
$submission = \mod_coursework\models\submission::find($subdbrecord);
//is the submission in question ready to grade?
- if (!$submission->all_inital_graded() && !empty($value)) return get_string('submissionnotreadyforagreedgrade','coursework');
+ if (!$submission->all_inital_graded() && !empty($value)) return get_string('submissionnotreadyforagreedgrade', 'coursework');
//has the submission been published if yes then no further grades are allowed
if ($submission->get_state() >= submission::PUBLISHED) return $submission->get_status_text();
@@ -94,10 +94,10 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
$new_feedback = feedback::build($feedback_params);
//this is a new feedback check it against the new ability checks
- if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !has_capability('mod/coursework:addallocatedagreedgrade', $PAGE->context) && !$ability->can('new', $new_feedback)) return get_string('nopermissiontogradesubmission','coursework');
+ if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !has_capability('mod/coursework:addallocatedagreedgrade', $PAGE->context) && !$ability->can('new', $new_feedback)) return get_string('nopermissiontogradesubmission', 'coursework');
} else {
//this is a new feedback check it against the edit ability checks
- if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade','coursework');
+ if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade', 'coursework');
}
} else {
diff --git a/classes/export/csv/cells/agreedgrade_cell.php b/classes/export/csv/cells/agreedgrade_cell.php
index 3cb40834..a86e624b 100644
--- a/classes/export/csv/cells/agreedgrade_cell.php
+++ b/classes/export/csv/cells/agreedgrade_cell.php
@@ -78,7 +78,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
$stage_identifier = 'final_agreed_1';
$agreedgradecap = array('mod/coursework:addagreedgrade', 'mod/coursework:editagreedgrade',
- 'mod/coursework:addallocatedagreedgrade','mod/coursework:editallocatedagreedgrade');
+ 'mod/coursework:addallocatedagreedgrade', 'mod/coursework:editallocatedagreedgrade');
if (empty($value)) return true;
@@ -152,7 +152,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
$submission = \mod_coursework\models\submission::find($subdbrecord);
//is the submission in question ready to grade?
- if (!$submission->all_inital_graded() && !empty($value) && count($uploadedgradecells) < $submission->max_number_of_feedbacks()) return get_string('submissionnotreadyforagreedgrade','coursework');
+ if (!$submission->all_inital_graded() && !empty($value) && count($uploadedgradecells) < $submission->max_number_of_feedbacks()) return get_string('submissionnotreadyforagreedgrade', 'coursework');
//has the submission been published if yes then no further grades are allowed
if ($submission->get_state() >= submission::PUBLISHED) return $submission->get_status_text();
@@ -181,10 +181,10 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
$new_feedback = feedback::build($feedback_params);
//this is a new feedback check it against the new ability checks
- if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !has_capability('mod/coursework:addallocatedagreedgrade', $PAGE->context) && !$ability->can('new', $new_feedback)) return get_string('nopermissiontogradesubmission','coursework');
+ if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !has_capability('mod/coursework:addallocatedagreedgrade', $PAGE->context) && !$ability->can('new', $new_feedback)) return get_string('nopermissiontogradesubmission', 'coursework');
} else {
//this is a new feedback check it against the edit ability checks
- if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade','coursework');
+ if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade', 'coursework');
}
} else {
@@ -250,8 +250,8 @@ function get_rubrics($coursework, $csv_cells) {
//get all data from the position of the singlegrade to the length of rubricheaders
// $csv_cells = array_splice($csv_cells,5, 1, $rubricheaders);
- $start_cells = array_slice($csv_cells,0, $position,true);
- $end_cells = array_slice($csv_cells, $position+1,count($csv_cells),true);
+ $start_cells = array_slice($csv_cells, 0, $position, true);
+ $end_cells = array_slice($csv_cells, $position+1, count($csv_cells), true);
$cells = array_merge($start_cells, $rubricheaders);
diff --git a/classes/export/csv/cells/assessorfeedback_cell.php b/classes/export/csv/cells/assessorfeedback_cell.php
index 8976214e..836e1aea 100644
--- a/classes/export/csv/cells/assessorfeedback_cell.php
+++ b/classes/export/csv/cells/assessorfeedback_cell.php
@@ -59,7 +59,7 @@ public function get_cell($submission, $student, $stage_identifier) {
}
} else {
- $grade= '';
+ $grade = '';
}
return $grade;
@@ -77,8 +77,8 @@ public function get_header($stage) {
public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = array()) {
global $DB, $PAGE, $USER;
- $agreedgradecap = array('mod/coursework:addagreedgrade','mod/coursework:editagreedgrade');
- $initialgradecap = array('mod/coursework:addinitialgrade','mod/coursework:editinitialgrade');
+ $agreedgradecap = array('mod/coursework:addagreedgrade', 'mod/coursework:editagreedgrade');
+ $initialgradecap = array('mod/coursework:addinitialgrade', 'mod/coursework:editinitialgrade');
$subdbrecord = $DB->get_record('coursework_submissions', array('id' => $submissionid));
$submission = \mod_coursework\models\submission::find($subdbrecord);
@@ -86,7 +86,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
|| has_capability('mod/coursework:administergrades', $PAGE->context)) {
//is the submission in question ready to grade?
- if (!$submission->ready_to_grade()) return get_string('submissionnotreadytograde','coursework');
+ if (!$submission->ready_to_grade()) return get_string('submissionnotreadytograde', 'coursework');
//has the submission been published if yes then no further grades are allowed
if ($submission->get_state() >= submission::PUBLISHED) return $submission->get_status_text();
@@ -106,19 +106,19 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
//does a feedback exist for this stage
if (!empty($feedback)) {
//this is a new feedback check it against the new ability checks
- if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('new', $feedback)) return get_string('nopermissiontoeditgrade','coursework');
+ if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('new', $feedback)) return get_string('nopermissiontoeditgrade', 'coursework');
} else {
//this is a new feedback check it against the edit ability checks
- if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade','coursework');
+ if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade', 'coursework');
}
if (!$this->coursework->allocation_enabled() && !empty($feedback)) {
//was this user the one who last graded this submission if not then user cannot grade
if ($feedback->assessorid != $USER->id || !has_capability('mod/coursework:editinitialgrade', $PAGE->context) )
- return get_string('nopermissiontogradesubmission','coursework');
+ return get_string('nopermissiontogradesubmission', 'coursework');
}
@@ -132,7 +132,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
);
if (!has_capability('mod/coursework:administergrades', $PAGE->context)
- && !$DB->get_record('coursework_allocation_pairs', $allocation_params)) return get_string('nopermissiontogradesubmission','coursework');
+ && !$DB->get_record('coursework_allocation_pairs', $allocation_params)) return get_string('nopermissiontogradesubmission', 'coursework');
}
//check for coursework without allocations - with/without samplings
@@ -150,7 +150,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
//check how many assessors for this coursework
$assessors = $this->coursework->get_max_markers();
}
- if ($assessors == $feedbacks) return get_string('gradealreadyexists','coursework');
+ if ($assessors == $feedbacks) return get_string('gradealreadyexists', 'coursework');
}
} else if (has_any_capability($agreedgradecap, $PAGE->context)) {
diff --git a/classes/export/csv/cells/assessorgrade_cell.php b/classes/export/csv/cells/assessorgrade_cell.php
index decc7d1d..7a51d082 100644
--- a/classes/export/csv/cells/assessorgrade_cell.php
+++ b/classes/export/csv/cells/assessorgrade_cell.php
@@ -310,8 +310,8 @@ function get_rubrics($coursework, $csv_cells) {
//get all data from the position of the singlegrade to the length of rubricheaders
// $csv_cells = array_splice($csv_cells,5, 1, $rubricheaders);
- $start_cells = array_slice($csv_cells,0, $position,true);
- $end_cells = array_slice($csv_cells, $position+1,count($csv_cells),true);
+ $start_cells = array_slice($csv_cells, 0, $position, true);
+ $end_cells = array_slice($csv_cells, $position + 1, count($csv_cells), true);
$cells = array_merge($start_cells, $rubricheaders);
diff --git a/classes/export/csv/cells/feedbackcomments_cell.php b/classes/export/csv/cells/feedbackcomments_cell.php
index 6742c3b4..b865069d 100644
--- a/classes/export/csv/cells/feedbackcomments_cell.php
+++ b/classes/export/csv/cells/feedbackcomments_cell.php
@@ -66,14 +66,14 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
$submission = \mod_coursework\models\submission::find($dbrecord);
//is this submission ready to be graded
- if (!$submission->ready_to_grade()) return get_string('submissionnotreadytograde','coursework');
+ if (!$submission->ready_to_grade()) return get_string('submissionnotreadytograde', 'coursework');
//if you have administer grades you can grade anything
if (has_capability('mod/coursework:administergrades', $PAGE->context)) return true;
//is the current user an assessor at any of this submissions grading stages or do they have administer grades
if (!$this->coursework->is_assessor($USER) && !has_capability('mod/coursework:administergrades', $PAGE->context))
- return get_string('nopermissiontogradesubmission','coursework');
+ return get_string('nopermissiontogradesubmission', 'coursework');
$ability = new ability(user::find($USER), $this->coursework);
@@ -94,10 +94,10 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
$new_feedback = feedback::build($feedback_params);
//this is a new feedback check it against the new ability checks
- if (!$ability->can('new', $new_feedback)) return get_string('nopermissiontogradesubmission','coursework');
+ if (!$ability->can('new', $new_feedback)) return get_string('nopermissiontogradesubmission', 'coursework');
} else {
//this is a new feedback check it against the edit ability checks
- if (!$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade','coursework');
+ if (!$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade', 'coursework');
}
} else {
return get_string('nopermissiontoimportgrade', 'coursework');
diff --git a/classes/export/csv/cells/singlegrade_cell.php b/classes/export/csv/cells/singlegrade_cell.php
index 60e899b7..5c6d2da4 100644
--- a/classes/export/csv/cells/singlegrade_cell.php
+++ b/classes/export/csv/cells/singlegrade_cell.php
@@ -147,7 +147,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
//is the current user an assessor at any of this submissions grading stages or do they have administer grades
if ($this->coursework->allocation_enabled() && !$this->coursework->is_assessor($USER) && !has_capability('mod/coursework:administergrades', $PAGE->context))
- return get_string('nopermissiontogradesubmission','coursework');
+ return get_string('nopermissiontogradesubmission', 'coursework');
//has the submission been published if yes then no further grades are allowed
if ($submission->get_state() >= submission::PUBLISHED) return $submission->get_status_text();
@@ -162,7 +162,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
if (!$this->coursework->allocation_enabled() && !empty($feedback)) {
//was this user the one who last graded this submission if not then user cannot grade
if ($feedback->assessorid != $USER->id || !has_capability('mod/coursework:editinitialgrade', $PAGE->context) && !has_capability('mod/coursework:administergrades', $PAGE->context))
- return get_string('nopermissiontoeditgrade','coursework');
+ return get_string('nopermissiontoeditgrade', 'coursework');
}
@@ -174,7 +174,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
);
$feedback = feedback::find($feedback_params);
- //if (!$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade','coursework');
+ //if (!$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade', 'coursework');
//does a feedback exist for this stage
if (empty($feedback)) {
@@ -187,10 +187,10 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
$new_feedback = feedback::build($feedback_params);
//this is a new feedback check it against the new ability checks
- if (!$ability->can('new', $new_feedback)) return get_string('nopermissiontogradesubmission','coursework');
+ if (!$ability->can('new', $new_feedback)) return get_string('nopermissiontogradesubmission', 'coursework');
} else {
//this is a new feedback check it against the edit ability checks
- if (!$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade','coursework');
+ if (!$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade', 'coursework');
}
} else {
@@ -255,8 +255,8 @@ function get_rubrics($coursework, $csv_cells) {
//get all data from the position of the singlegrade to the length of rubricheaders
// $csv_cells = array_splice($csv_cells,5, 1, $rubricheaders);
- $start_cells = array_slice($csv_cells,0, $position,true);
- $end_cells = array_slice($csv_cells, $position+1,count($csv_cells),true);
+ $start_cells = array_slice($csv_cells, 0, $position, true);
+ $end_cells = array_slice($csv_cells, $position+1, count($csv_cells), true);
$cells = array_merge($start_cells, $rubricheaders);
diff --git a/classes/export/csv/cells/submissionfileid_cell.php b/classes/export/csv/cells/submissionfileid_cell.php
index 8f3eb894..b5278a46 100644
--- a/classes/export/csv/cells/submissionfileid_cell.php
+++ b/classes/export/csv/cells/submissionfileid_cell.php
@@ -59,7 +59,7 @@ public function validate_cell($value, $submissionid, $stage_dentifier='', $uploa
$hash = $this->coursework->get_username_hash($submission->allocatableid);
- return ($value == $hash) ? true : get_string('submissionnotfound','coursework');
+ return ($value == $hash) ? true : get_string('submissionnotfound', 'coursework');
}
}
diff --git a/classes/export/csv/cells/submissionid_cell.php b/classes/export/csv/cells/submissionid_cell.php
index 8fd6d5da..4f7c1e7f 100644
--- a/classes/export/csv/cells/submissionid_cell.php
+++ b/classes/export/csv/cells/submissionid_cell.php
@@ -46,9 +46,9 @@ public function get_header($stage) {
return get_string('submissionid', 'coursework');
}
- public function validate_cell($value, $submissionid, $stage_dentifier='', $uploadedgradecells = array()) {
+ public function validate_cell($value, $submissionid, $stage_dentifier = '', $uploadedgradecells = array()) {
global $DB;
- return ($DB->record_exists('coursework_submissions', array('id' => $submissionid,'courseworkid' => $this->coursework->id()))) ? true: get_string('submissionnotfoundincoursework','coursework');
+ return ($DB->record_exists('coursework_submissions', array('id' => $submissionid, 'courseworkid' => $this->coursework->id()))) ? true: get_string('submissionnotfoundincoursework', 'coursework');
}
}
diff --git a/classes/export/import.php b/classes/export/import.php
index 6c6fd1bb..d66d9ffe 100644
--- a/classes/export/import.php
+++ b/classes/export/import.php
@@ -103,7 +103,7 @@ public function validate_csv($content, $encoding, $delimeter, $csv_cells) {
$stage_identifier = $this->get_stage_identifier($submissionid, $cells[$i]);
// remove numbers from cell names so they can be dynamically validated
- if (substr($cells[$i],0,8) == 'assessor') {
+ if (substr($cells[$i], 0, 8) == 'assessor') {
$cells[$i] = substr($cells[$i], 0, -1);
}
@@ -162,7 +162,7 @@ function rubric_count_correct($csvheader, $linefromimportedcsv) {
// get criteria of rubrics and match it to grade cells
if ($this->coursework->is_using_rubric()) {
- $types = array("singlegrade","assessorgrade");
+ $types = array("singlegrade", "assessorgrade");
if ($this->coursework->finalstagegrading == 0 ) $types[] = "agreedgrade";
@@ -226,7 +226,7 @@ function get_rubric_headers($csvheader) {
// get criteria of rubrics and match it to grade cells
if ($this->coursework->is_using_rubric()) {
- $types = array("singlegrade","assessorgrade");
+ $types = array("singlegrade", "assessorgrade");
foreach ($types as $type) {
@@ -343,9 +343,9 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
} else {
foreach ($csvline as $k => $v) {
- if (substr($k,0,13) == 'assessorgrade' || substr($k,0,11) == 'singlegrade') {
+ if (substr($k, 0, 13) == 'assessorgrade' || substr($k, 0, 11) == 'singlegrade') {
$stages[$k] = $this->get_stage_identifier($csvline['submissionid'], $k);
- } else if (substr($k,0,11) == 'agreedgrade') {
+ } else if (substr($k, 0, 11) == 'agreedgrade') {
$stages[$k] = 'final_agreed_1';
}
}
diff --git a/classes/forms/deadline_extension_form.php b/classes/forms/deadline_extension_form.php
index f2a3e04b..08a16636 100644
--- a/classes/forms/deadline_extension_form.php
+++ b/classes/forms/deadline_extension_form.php
@@ -103,7 +103,7 @@ public function validation($data, $files) {
public function personal_deadline() {
global $DB;
- $extensionid = optional_param('id',0, PARAM_INT);
+ $extensionid = optional_param('id', 0, PARAM_INT);
if ($extensionid != 0) {
$ext = $DB->get_record('coursework_extensions', array('id' => $extensionid));
diff --git a/classes/forms/plagiarism_flagging_mform.php b/classes/forms/plagiarism_flagging_mform.php
index 9611d0b5..b66e8940 100644
--- a/classes/forms/plagiarism_flagging_mform.php
+++ b/classes/forms/plagiarism_flagging_mform.php
@@ -59,7 +59,7 @@ public function definition() {
$mform->setType('submissionid', PARAM_INT);
// plagiarism status
- $options = array(plagiarism_flag::INVESTIGATION => get_string('plagiarism_'.plagiarism_flag::INVESTIGATION , 'coursework'),
+ $options = array(plagiarism_flag::INVESTIGATION => get_string('plagiarism_'.plagiarism_flag::INVESTIGATION, 'coursework'),
plagiarism_flag::RELEASED => get_string('plagiarism_'.plagiarism_flag::RELEASED, 'coursework'),
plagiarism_flag::CLEARED => get_string('plagiarism_'.plagiarism_flag::CLEARED, 'coursework'),
plagiarism_flag::NOTCLEARED => get_string('plagiarism_'.plagiarism_flag::NOTCLEARED, 'coursework'));
diff --git a/classes/forms/student_submission_form.php b/classes/forms/student_submission_form.php
index 38a6ddcd..e60d65e7 100644
--- a/classes/forms/student_submission_form.php
+++ b/classes/forms/student_submission_form.php
@@ -354,7 +354,7 @@ protected function add_file_manager_to_form() {
$uploadfilestring,
null,
$this->get_file_manager_options());
- $this->_form->addRule('submission_manager', 'You must upload file(s) into the box below before you can save', 'required', null, 'server',false,true);
+ $this->_form->addRule('submission_manager', 'You must upload file(s) into the box below before you can save', 'required', null, 'server', false, true);
}
diff --git a/classes/forms/upload_allocations_form.php b/classes/forms/upload_allocations_form.php
index c6b95093..04f86cb2 100644
--- a/classes/forms/upload_allocations_form.php
+++ b/classes/forms/upload_allocations_form.php
@@ -39,7 +39,7 @@ function definition() {
$mform->addElement('filepicker', 'allocationsdata', get_string('allocationsfile', 'coursework'), null, array( 'accepted_types' => '*.csv'));
$mform->addRule('allocationsdata', null, 'required');
- // $mform->addElement('checkbox', 'overwrite', '',get_string('overwritegrades', 'coursework'));
+ // $mform->addElement('checkbox', 'overwrite', '', get_string('overwritegrades', 'coursework'));
$mform->addElement('hidden', 'cmid', $this->cmid);
$mform->setType('cmid', PARAM_RAW);
@@ -58,7 +58,7 @@ function definition() {
$mform->addElement('select', 'encoding', get_string('encoding', 'tool_uploaduser'), $choices);
$mform->setDefault('encoding', 'UTF-8');
- $this->add_action_buttons(true,get_string('uploadallocations', 'coursework'));
+ $this->add_action_buttons(true, get_string('uploadallocations', 'coursework'));
}
function display() {
diff --git a/classes/forms/upload_feedback_form.php b/classes/forms/upload_feedback_form.php
index 14823f6d..4436ba17 100644
--- a/classes/forms/upload_feedback_form.php
+++ b/classes/forms/upload_feedback_form.php
@@ -41,7 +41,7 @@ function definition() {
$mform->addRule('feedbackzip', null, 'required');
$mform->addHelpButton('feedbackzip', 'feedbackzipfile', 'coursework');
- $mform->addElement('advcheckbox', 'overwrite', '',get_string('overwritefeedback', 'coursework'),null, array(0,1));
+ $mform->addElement('advcheckbox', 'overwrite', '', get_string('overwritefeedback', 'coursework'), null, array(0, 1));
$mform->addElement('hidden', 'cmid', $this->cmid);
$mform->setType('cmid', PARAM_RAW);
@@ -77,7 +77,7 @@ function definition() {
$mform->disabledIf('overwrite', 'feedbackstage', 'eq', 'final_agreed_1');
}
- $this->add_action_buttons(true,get_string('uploadfeedbackzip', 'coursework'));
+ $this->add_action_buttons(true, get_string('uploadfeedbackzip', 'coursework'));
}
function display() {
diff --git a/classes/forms/upload_grading_sheet_form.php b/classes/forms/upload_grading_sheet_form.php
index dfbd71ae..fd396742 100644
--- a/classes/forms/upload_grading_sheet_form.php
+++ b/classes/forms/upload_grading_sheet_form.php
@@ -38,7 +38,7 @@ function definition() {
$mform->addElement('filepicker', 'gradingdata', get_string('gradingsheetfile', 'coursework'), null, array( 'accepted_types' => '*.csv'));
$mform->addRule('gradingdata', null, 'required');
- $mform->addElement('checkbox', 'overwrite', '',get_string('overwritegrades', 'coursework'));
+ $mform->addElement('checkbox', 'overwrite', '', get_string('overwritegrades', 'coursework'));
$mform->addElement('hidden', 'cmid', $this->cmid);
$mform->setType('cmid', PARAM_RAW);
@@ -57,7 +57,7 @@ function definition() {
$mform->addElement('select', 'encoding', get_string('encoding', 'tool_uploaduser'), $choices);
$mform->setDefault('encoding', 'UTF-8');
- $this->add_action_buttons(true,get_string('uploadgradingworksheet', 'coursework'));
+ $this->add_action_buttons(true, get_string('uploadgradingworksheet', 'coursework'));
}
function display() {
diff --git a/classes/grading_report.php b/classes/grading_report.php
index 17a555d7..4bc457c3 100644
--- a/classes/grading_report.php
+++ b/classes/grading_report.php
@@ -82,7 +82,7 @@ class grading_report {
/**
* Grades in $data must be already rounded to the set number of decimals or must be null
- * (in which later case, the [mod_workshop,nullgrade] string shall be displayed)
+ * (in which later case, the [mod_workshop, nullgrade] string shall be displayed)
*
* @param array $options
* @param coursework $coursework
diff --git a/classes/models/coursework.php b/classes/models/coursework.php
index 9b5b4106..b1da7eea 100644
--- a/classes/models/coursework.php
+++ b/classes/models/coursework.php
@@ -2687,7 +2687,7 @@ public function get_allocatables_and_deadline() {
$allocatables = $this->get_allocatables();
if (!empty($allocatables)) {
- $allocatables = array_map(array($this,"get_allocatable_personal_deadline"), $allocatables);
+ $allocatables = array_map(array($this, "get_allocatable_personal_deadline"), $allocatables);
}
return $allocatables;
diff --git a/classes/models/feedback.php b/classes/models/feedback.php
index 688903f6..14a07aae 100644
--- a/classes/models/feedback.php
+++ b/classes/models/feedback.php
@@ -229,7 +229,7 @@ public function get_assessor_id() {
*/
public function get_assessor_stage_no() {
$no = '';
- if (substr($this->stage_identifier,0,9 ) =='assessor_') {
+ if (substr($this->stage_identifier, 0, 9 ) == 'assessor_') {
$no = substr($this->stage_identifier, -1);
}
return $no;
diff --git a/classes/models/outstanding_marking.php b/classes/models/outstanding_marking.php
index 95c082e1..0ef787f8 100644
--- a/classes/models/outstanding_marking.php
+++ b/classes/models/outstanding_marking.php
@@ -139,7 +139,7 @@ private function get_multiple_to_mark_sampled_initial_grade_submissions($coursew
$sql = " SELECT *,
$countsamples AS count_samples,
COUNT(a.id) AS ssmID FROM(
- SELECT cs.id AS csid, f.id AS fid, cs.allocatableid ,ssm.id, COUNT(f.id) AS count_feedback,
+ SELECT cs.id AS csid, f.id AS fid, cs.allocatableid, ssm.id, COUNT(f.id) AS count_feedback,
cs.courseworkid
FROM {coursework_submissions} cs LEFT JOIN
{coursework_feedbacks} f ON f.submissionid= cs.id
@@ -226,7 +226,7 @@ private function get_to_grade_agreed_grade_submissions($courseworkid, $numberofm
global $DB;
$sql = "SELECT cs.id as submissionid, COUNT(cs.id) AS count_feedback
- FROM {coursework_submissions} cs ,
+ FROM {coursework_submissions} cs ,
{coursework_feedbacks} f
WHERE f.submissionid= cs.id
AND cs.finalised = 1
@@ -252,7 +252,7 @@ private function get_to_grade_agreed_grade_sampled_submissions($courseworkid) {
$sql = "SELECT *,
$countsamples AS count_samples,
COUNT(a.id) AS ssmID FROM(
- SELECT f.id AS fid, cs.id AS csid, cs.allocatableid ,ssm.id, COUNT(f.id) AS count_feedback,
+ SELECT f.id AS fid, cs.id AS csid, cs.allocatableid, ssm.id, COUNT(f.id) AS count_feedback,
cs.courseworkid
FROM {coursework_submissions} cs LEFT JOIN
{coursework_feedbacks} f ON f.submissionid= cs.id
diff --git a/classes/personal_deadline/table/row/builder.php b/classes/personal_deadline/table/row/builder.php
index a9c1ac17..81210b21 100644
--- a/classes/personal_deadline/table/row/builder.php
+++ b/classes/personal_deadline/table/row/builder.php
@@ -207,10 +207,10 @@ public function get_submission_status() {
$submission = \mod_coursework\models\submission::find($submission_db);
- $statustext = get_string('statusnotsubmitted','mod_coursework');
+ $statustext = get_string('statusnotsubmitted', 'mod_coursework');
if (!empty($submission) && $submission->is_finalised()) {
- $statustext = get_string('finalisedsubmission','mod_coursework');
+ $statustext = get_string('finalisedsubmission', 'mod_coursework');
} else if (!empty($submission)) {
$statustext = $submission->get_status_text();
}
diff --git a/classes/render_helpers/grading_report/cells/group_cell.php b/classes/render_helpers/grading_report/cells/group_cell.php
index 98bd2a55..443f2406 100644
--- a/classes/render_helpers/grading_report/cells/group_cell.php
+++ b/classes/render_helpers/grading_report/cells/group_cell.php
@@ -49,9 +49,9 @@ public function get_table_cell($row_object) {
$content .= '';
if ($this->coursework->blindmarking_enabled() && !has_capability('mod/coursework:viewanonymous', $this->coursework->get_context()) && !$row_object->is_published()) {
- $content .= ''.get_string('membershidden','coursework').' ';
+ $content .= ''.get_string('membershidden', 'coursework').' ';
} else{
- $content .= ''.get_string('viewmembers','coursework').' ';
+ $content .= ''.get_string('viewmembers', 'coursework').' ';
}
$cm = $this->coursework->get_course_module();
diff --git a/classes/render_helpers/grading_report/cells/idnumber_cell.php b/classes/render_helpers/grading_report/cells/idnumber_cell.php
index d4f71a11..132e983d 100644
--- a/classes/render_helpers/grading_report/cells/idnumber_cell.php
+++ b/classes/render_helpers/grading_report/cells/idnumber_cell.php
@@ -57,7 +57,7 @@ public function get_table_header($options = array()) {
// allow to sort users only if CW is not set to blind marking or a user has capability to view anonymous
if ($viewanonymous || !$this->coursework->blindmarking) {
- $sort_header= $this->helper_sortable_heading(get_string('idnumber'),
+ $sort_header = $this->helper_sortable_heading(get_string('idnumber'),
'idnumber',
$options['sorthow'],
$options['sortby'],
diff --git a/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php b/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php
index 4b136355..b87398e4 100644
--- a/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php
+++ b/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php
@@ -178,7 +178,7 @@ private function new_moderation_button($rowobject, $assessor) {
return $OUTPUT->action_link($link,
$title,
null,
- array('class' => 'new_moderation','id' => $link_id));
+ array('class' => 'new_moderation', 'id' => $link_id));
}
/**
@@ -229,6 +229,6 @@ private function show_moderation_button($rowobject) {
return $OUTPUT->action_link($link,
$linktitle,
null,
- array('class' => 'show_moderation','id' => $link_id));
+ array('class' => 'show_moderation', 'id' => $link_id));
}
}
diff --git a/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php b/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
index e6f0313a..2d947ef8 100644
--- a/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
+++ b/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
@@ -140,7 +140,7 @@ public function get_content($rowobject) {
$iconlink = $OUTPUT->action_link($link,
$linktitle,
null,
- array('class' => 'show_feedback','id' => $link_id));
+ array('class' => 'show_feedback', 'id' => $link_id));
}
}
diff --git a/classes/render_helpers/grading_report/cells/single_assessor_feedback_cell.php b/classes/render_helpers/grading_report/cells/single_assessor_feedback_cell.php
index 1349c300..79c88627 100644
--- a/classes/render_helpers/grading_report/cells/single_assessor_feedback_cell.php
+++ b/classes/render_helpers/grading_report/cells/single_assessor_feedback_cell.php
@@ -200,7 +200,7 @@ private function show_feedback_button($rowobject) {
$iconlink = $OUTPUT->action_link($link,
$linktitle,
null,
- array('class' => 'show_feedback','id' => $link_id));
+ array('class' => 'show_feedback', 'id' => $link_id));
return $iconlink;
}
@@ -229,7 +229,7 @@ private function new_feedback_button($rowobject, $assessor) {
return $OUTPUT->action_link($link,
$title,
null,
- array('class' => 'new_final_feedback','id' => $link_id));
+ array('class' => 'new_final_feedback', 'id' => $link_id));
}
}
diff --git a/classes/render_helpers/grading_report/cells/time_submitted_cell.php b/classes/render_helpers/grading_report/cells/time_submitted_cell.php
index ce6ff4b7..88460882 100644
--- a/classes/render_helpers/grading_report/cells/time_submitted_cell.php
+++ b/classes/render_helpers/grading_report/cells/time_submitted_cell.php
@@ -104,7 +104,7 @@ public function prepare_content_cell($row_object) {
$content .= html_writer::end_span();
} else {
- $content .= html_writer::span('(' . get_string('ontime', 'mod_coursework') . ')','ontime_submission');
+ $content .= html_writer::span('(' . get_string('ontime', 'mod_coursework') . ')', 'ontime_submission');
}
if ($submission->get_allocatable()->type() == 'group') {
diff --git a/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php b/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php
index 83410b3a..5627bb08 100644
--- a/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php
+++ b/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php
@@ -129,12 +129,12 @@ protected function render_assessor_feedback_table(assessor_feedback_table $asses
if ($coursework->sampling_enabled() && $stage->uses_sampling() && !$stage->allocatable_is_in_sample($allocatable)) {
$output_rows .= '
- '.get_string('notincludedinsample','mod_coursework').'
+ '.get_string('notincludedinsample', 'mod_coursework').'
';
} else {
$assessor_details = (empty($feedback_row->get_assessor()->id()) && $coursework->allocation_enabled()) ?
- get_string('assessornotallocated','mod_coursework') : $this->profile_link($feedback_row);
+ get_string('assessornotallocated', 'mod_coursework') : $this->profile_link($feedback_row);
$output_rows .=
'' . $assessor_details. '
' .
@@ -255,7 +255,7 @@ private function show_feedback_link($feedback_row) {
$iconlink = $OUTPUT->action_link($link,
$linktitle,
null,
- array('class' => 'show_feedback','id' => $link_id));
+ array('class' => 'show_feedback', 'id' => $link_id));
return $iconlink;
}
@@ -347,7 +347,7 @@ protected function comment_for_row($feedback_row, $ability) {
}
}
- $grade_editing = get_config('mod_coursework','coursework_grade_editing');
+ $grade_editing = get_config('mod_coursework', 'coursework_grade_editing');
if ($ability->can('edit', $feedback_row->get_feedback()) && !$submission->already_published()) {
$html .= $this->edit_existing_feedback_link($feedback_row);
diff --git a/classes/sample_set_rule/range_sample_type.php b/classes/sample_set_rule/range_sample_type.php
index 49105f47..112c30ef 100644
--- a/classes/sample_set_rule/range_sample_type.php
+++ b/classes/sample_set_rule/range_sample_type.php
@@ -74,12 +74,12 @@ public function add_form_elements($assessor_number=0) {
$seq++;
}
} else {
- $html .= $this->range_elements($assessor_number,0,false);
+ $html .= $this->range_elements($assessor_number, 0, false);
}
- $html .= html_writer::link('#',get_string('addgraderule', 'mod_coursework'), array('id' => "assessor_{$assessor_number}_addgradderule", 'class' => 'addgradderule sample_set_rule'));
+ $html .= html_writer::link('#', get_string('addgraderule', 'mod_coursework'), array('id' => "assessor_{$assessor_number}_addgradderule", 'class' => 'addgradderule sample_set_rule'));
$html .= " ";
- $html .= html_writer::link('#',get_string('removegraderule', 'mod_coursework'), array('id' => "assessor_{$assessor_number}_removegradderule", 'class' => 'removegradderule sample_set_rule'));
+ $html .= html_writer::link('#', get_string('removegraderule', 'mod_coursework'), array('id' => "assessor_{$assessor_number}_removegradderule", 'class' => 'removegradderule sample_set_rule'));
return $html;
}
@@ -95,7 +95,7 @@ public function range_elements($assessor_number, $sequence, $dbrecord=false) {
$scale = array();
if ($this->coursework->grade > 0) {
- for ($i=0;$i <= $this->coursework->grade; $i++) {
+ for ($i = 0;$i <= $this->coursework->grade; $i++) {
$scale[] = $i;
}
} else {
@@ -104,10 +104,10 @@ public function range_elements($assessor_number, $sequence, $dbrecord=false) {
}
if ($dbrecord) {
- $selected_type = array($dbrecord->ruletype=> get_string($dbrecord->ruletype, 'mod_coursework'));
- $selected_to = ($dbrecord->ruletype == 'scale') ? array($dbrecord->upperlimit=> $scale[$dbrecord->upperlimit]) : array($dbrecord->upperlimit=> $dbrecord->upperlimit);
+ $selected_type = array($dbrecord->ruletype => get_string($dbrecord->ruletype, 'mod_coursework'));
+ $selected_to = ($dbrecord->ruletype == 'scale') ? array($dbrecord->upperlimit => $scale[$dbrecord->upperlimit]) : array($dbrecord->upperlimit => $dbrecord->upperlimit);
- $selected_from = ($dbrecord->ruletype == 'scale') ? array($dbrecord->lowerlimit=> $scale[$dbrecord->lowerlimit]) : array($dbrecord->lowerlimit=> $dbrecord->lowerlimit);
+ $selected_from = ($dbrecord->ruletype == 'scale') ? array($dbrecord->lowerlimit => $scale[$dbrecord->lowerlimit]) : array($dbrecord->lowerlimit => $dbrecord->lowerlimit);
$rules_checked = ($dbrecord) ? true : false;
@@ -147,7 +147,7 @@ public function range_elements($assessor_number, $sequence, $dbrecord=false) {
$html .= html_writer::label(get_string('to', 'mod_coursework'), "assessor_{$assessor_number}_sampleto[0]");
- $html .= html_writer::select(array_reverse($rule_options,true),
+ $html .= html_writer::select(array_reverse($rule_options, true),
"assessor_{$assessor_number}_sampleto[]",
"",
$selected_to,
@@ -316,24 +316,24 @@ function change_options(element) {
});
$(sampletoid).append($(sampletoid).children().toArray().reverse());
- $(sampletoid).children().first().prop('selected',true);
- $(samplefromid).children().first().prop('selected',true);
+ $(sampletoid).children().first().prop('selected', true);
+ $(samplefromid).children().first().prop('selected', true);
}
";
- return html_writer::script($js_script,null);
+ return html_writer::script($js_script, null);
}
- public function save_form_data($assessor_number=0,&$order=0) {
+ public function save_form_data($assessor_number=0, &$order=0) {
global $DB;
- $sample_rules = optional_param_array("assessor_{$assessor_number}_samplerules",false, PARAM_RAW);
- $sample_type = optional_param_array("assessor_{$assessor_number}_sampletype",false, PARAM_RAW);
- $sample_from = optional_param_array("assessor_{$assessor_number}_samplefrom",false, PARAM_RAW);
- $sample_to = optional_param_array("assessor_{$assessor_number}_sampleto",false, PARAM_RAW);
+ $sample_rules = optional_param_array("assessor_{$assessor_number}_samplerules", false, PARAM_RAW);
+ $sample_type = optional_param_array("assessor_{$assessor_number}_sampletype", false, PARAM_RAW);
+ $sample_from = optional_param_array("assessor_{$assessor_number}_samplefrom", false, PARAM_RAW);
+ $sample_to = optional_param_array("assessor_{$assessor_number}_sampleto", false, PARAM_RAW);
$sample_plugin = $DB->get_record('coursework_sample_set_plugin', array('rulename' => 'range_sample_type'));
@@ -357,7 +357,7 @@ public function save_form_data($assessor_number=0,&$order=0) {
}
- public function adjust_sample_set($stage_number,&$allocatables,&$manual_sample_set,&$auto_sample_set) {
+ public function adjust_sample_set($stage_number, &$allocatables, &$manual_sample_set, &$auto_sample_set) {
global $DB;
diff --git a/classes/sample_set_rule/sample_base.php b/classes/sample_set_rule/sample_base.php
index f016f9ba..e4a25d12 100644
--- a/classes/sample_set_rule/sample_base.php
+++ b/classes/sample_set_rule/sample_base.php
@@ -146,9 +146,9 @@ abstract public function add_form_elements($assessor_number);
abstract public function add_form_elements_js($assessor_number);
- abstract public function save_form_data($assessor_number=0,&$order=0);
+ abstract public function save_form_data($assessor_number=0, &$order=0);
- abstract public function adjust_sample_set($rule_id,&$manual_sample_set,&$allocatables,&$auto_sample_set);
+ abstract public function adjust_sample_set($rule_id, &$manual_sample_set, &$allocatables, &$auto_sample_set);
/**
*
diff --git a/classes/sample_set_rule/total_sample_type.php b/classes/sample_set_rule/total_sample_type.php
index 7a2f5d8c..819fb623 100644
--- a/classes/sample_set_rule/total_sample_type.php
+++ b/classes/sample_set_rule/total_sample_type.php
@@ -61,7 +61,7 @@ public function add_form_elements($assessor_number=0) {
AND sr.stage_identifier = 'assessor_{$assessor_number}'
AND sp.rulename = 'total_sample_type'";
- $selected = ($record = $DB->get_record_sql($sql)) ? array($record->upperlimit=> $record->upperlimit) : false;
+ $selected = ($record = $DB->get_record_sql($sql)) ? array($record->upperlimit => $record->upperlimit) : false;
$checked = ($selected) ? true : false;
$percentage_options = array();
@@ -72,7 +72,7 @@ public function add_form_elements($assessor_number=0) {
$html = html_writer::start_div('sampletotal');
- $html .= html_writer::checkbox("assessor_{$assessor_number}_sampletotal_checkbox",1, $checked,get_string('topupto', 'mod_coursework'),
+ $html .= html_writer::checkbox("assessor_{$assessor_number}_sampletotal_checkbox", 1, $checked, get_string('topupto', 'mod_coursework'),
array('id' => "assessor_{$assessor_number}_sampletotal_checkbox", 'class' => "assessor_{$assessor_number} total_checkbox sample_set_rule"));
$html .= html_writer::select($percentage_options,
@@ -109,15 +109,15 @@ public function add_form_elements_js($assessor_number=0) {
";
- return html_writer::script($js_script,null);
+ return html_writer::script($js_script, null);
}
- function save_form_data($assessor_number=0,&$order=0) {
+ function save_form_data($assessor_number=0, &$order=0) {
global $DB;
- $total_checkbox = optional_param("assessor_{$assessor_number}_sampletotal_checkbox",false, PARAM_INT);
- $sample_total = optional_param("assessor_{$assessor_number}_sampletotal",false, PARAM_INT);
+ $total_checkbox = optional_param("assessor_{$assessor_number}_sampletotal_checkbox", false, PARAM_INT);
+ $sample_total = optional_param("assessor_{$assessor_number}_sampletotal", false, PARAM_INT);
if ($total_checkbox) {
@@ -140,7 +140,7 @@ static function compare_key($a, $b) {
return ($a > $b)? 1:-1;
}
- public function adjust_sample_set($stage_number,&$allocatables,&$manual_sample_set,&$auto_sample_set) {
+ public function adjust_sample_set($stage_number, &$allocatables, &$manual_sample_set, &$auto_sample_set) {
global $DB;
diff --git a/classes/task/enrol_task.php b/classes/task/enrol_task.php
index befa7663..0de5827b 100644
--- a/classes/task/enrol_task.php
+++ b/classes/task/enrol_task.php
@@ -57,7 +57,7 @@ public function execute() {
$allocator = new \mod_coursework\allocation\auto_allocator($coursework);
$allocator->process_allocations();
- $DB->set_field('coursework', 'processenrol',0, array('id' => $coursework->id()));
+ $DB->set_field('coursework', 'processenrol', 0, array('id' => $coursework->id()));
}
}
diff --git a/classes/task/unenrol_task.php b/classes/task/unenrol_task.php
index 105c13aa..acdc1d96 100644
--- a/classes/task/unenrol_task.php
+++ b/classes/task/unenrol_task.php
@@ -55,7 +55,7 @@ public function execute() {
$allocator = new \mod_coursework\allocation\auto_allocator($coursework);
$allocator->process_allocations();
- $DB->set_field('coursework', 'processunenrol',0, array('id' => $coursework->id()));
+ $DB->set_field('coursework', 'processunenrol', 0, array('id' => $coursework->id()));
}
}
diff --git a/db/upgrade.php b/db/upgrade.php
index e65521c7..e0919aeb 100644
--- a/db/upgrade.php
+++ b/db/upgrade.php
@@ -2457,7 +2457,7 @@ function xmldb_coursework_upgrade($oldversion) {
$table->add_field('submissionid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null);
$table->add_field('status', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);
$table->add_field('comment', XMLDB_TYPE_TEXT, null, null, null, null, null);
- $table->add_field('comment_format',XMLDB_TYPE_INTEGER, '2',null,null,null,null);
+ $table->add_field('comment_format',XMLDB_TYPE_INTEGER, '2', null, null, null, null);
$table->add_field('createdby', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
$table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
$table->add_field('lastmodifiedby', XMLDB_TYPE_INTEGER, '10', null, false, null, null);
@@ -2480,7 +2480,7 @@ function xmldb_coursework_upgrade($oldversion) {
// Define table coursework_plagiarism_flag to be created.
$table = new xmldb_table('coursework');
- $field = $table->add_field('renamefiles',XMLDB_TYPE_INTEGER, '1',null,null,null,null);
+ $field = $table->add_field('renamefiles',XMLDB_TYPE_INTEGER, '1', null, null, null, null);
// Conditionally launch add field.
if (!$dbman->field_exists($table, $field)) {
diff --git a/lib.php b/lib.php
index 63fd0be1..d0a23f5c 100644
--- a/lib.php
+++ b/lib.php
@@ -911,7 +911,7 @@ function coursework_role_assigned_event_handler($roleassignment) {
$courseworkids = coursework_get_coursework_ids_from_context_id($roleassignment->contextid);
foreach ($courseworkids as $courseworkid) {
- $DB->set_field('coursework', 'processenrol',1, array('id' => $courseworkid));
+ $DB->set_field('coursework', 'processenrol', 1, array('id' => $courseworkid));
}
return true;
@@ -932,7 +932,7 @@ function coursework_role_unassigned_event_handler($roleassignment) {
$courseworkids = coursework_get_coursework_ids_from_context_id($roleassignment->contextid);
foreach ($courseworkids as $courseworkid) {
- $DB->set_field('coursework', 'processunenrol',1, array('id' => $courseworkid));
+ $DB->set_field('coursework', 'processunenrol', 1, array('id' => $courseworkid));
}
return true;
@@ -1521,7 +1521,7 @@ function coursework_personal_deadline_passed($courseworkid) {
WHERE courseworkid = :courseworkid
AND personal_deadline < :now";
- return $DB->record_exists_sql($sql, array('courseworkid' => $courseworkid , 'now' => time()));
+ return $DB->record_exists_sql($sql, array('courseworkid' => $courseworkid, 'now' => time()));
}
diff --git a/mod_form.php b/mod_form.php
index 934bd43c..2d4d91b8 100644
--- a/mod_form.php
+++ b/mod_form.php
@@ -1097,7 +1097,7 @@ protected function add_tweaks_to_standard_grading_form_elements() {
$moodle_form->addElement('select', 'finalstagegrading', get_string('finalstagegrading', 'mod_coursework'), $options);
$moodle_form->addHelpButton('finalstagegrading', 'finalstagegrading', 'mod_coursework');
- $moodle_form->setDefault('finalstagegrading',0);
+ $moodle_form->setDefault('finalstagegrading', 0);
$moodle_form->disabledIf('finalstagegrading', 'numberofmarkers', 'eq', 1);
$moodle_form->disabledIf('finalstagegrading', 'advancedgradingmethod_submissions', 'eq', "");
diff --git a/renderers/grading_report_renderer.php b/renderers/grading_report_renderer.php
index d450e64c..bc731ec0 100644
--- a/renderers/grading_report_renderer.php
+++ b/renderers/grading_report_renderer.php
@@ -143,7 +143,7 @@ protected function make_row_for_allocatable($row_object, $cell_helpers, $sub_row
($cell_helper instanceof \mod_coursework\render_helpers\grading_report\cells\user_cell ||
$cell_helper instanceof \mod_coursework\render_helpers\grading_report\cells\group_cell)
) {
- $html_td = str_replace(' ' , $tbl_assessor_feedbacks.' ', $html_td);
+ $html_td = str_replace('', $tbl_assessor_feedbacks.'', $html_td);
}
$table_html .= $html_td;
@@ -160,7 +160,7 @@ protected function make_row_for_allocatable($row_object, $cell_helpers, $sub_row
/**
* @return string
*/
- public function submissions_header($header_text='') {
+ public function submissions_header($header_text = '') {
$submisions = (!empty($header_text)) ? $header_text : get_string('submissions', 'mod_coursework');
return html_writer::tag('h3', $submisions);
@@ -193,7 +193,7 @@ protected function make_table_headers($cell_helpers, $options, $is_multiple_mark
/**
* @return string
*/
- protected function start_table($options=array()) {
+ protected function start_table($options = array()) {
$options['width'] = '100%';
$options['class'] = (!empty($options['class'])) ? $options['class'] : '';
$options['class'] .= ' submissions datatabletest display compact';
diff --git a/renderers/object_renderer.php b/renderers/object_renderer.php
index 2ed2a85e..71ecbf8c 100644
--- a/renderers/object_renderer.php
+++ b/renderers/object_renderer.php
@@ -527,7 +527,7 @@ protected function render_mod_coursework_coursework(mod_coursework_coursework $c
if (($coursework->is_general_feedback_enabled() && $allowed_to_add_general_feedback && (time() > $coursework->generalfeedback || $cangrade || $canpublish || $is_published)) || !$coursework->is_general_feedback_enabled()) {
$out .= html_writer::tag('h3', get_string('generalfeedback', 'coursework'));
$out .= $coursework->feedbackcomment ? html_writer::tag('p', $coursework->feedbackcomment)
- : html_writer::tag('p',get_string('nofeedbackyet', 'coursework'));
+ : html_writer::tag('p', get_string('nofeedbackyet', 'coursework'));
// General feedback Add edit link.
if ($canaddgeneralfeedback) {
@@ -694,7 +694,7 @@ public function render_mod_coursework_allocation_widget(mod_coursework_allocatio
global $OUTPUT;
$lang_str = ($allocationwidget->get_coursework()->moderation_agreement_enabled())? 'allocateassessorsandmoderators':'allocateassessors';
- $html = html_writer::tag('h2',get_string($lang_str, 'mod_coursework'));
+ $html = html_writer::tag('h2', get_string($lang_str, 'mod_coursework'));
$html .= '';
@@ -757,7 +757,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
global $OUTPUT, $DB;
- $html = html_writer::tag('h2',get_string('sampling', 'mod_coursework'));
+ $html = html_writer::tag('h2', get_string('sampling', 'mod_coursework'));
$html .= html_writer::start_tag('div', array('class' => 'assessor-sampling-wrapper accordion'));
@@ -916,7 +916,7 @@ private function sampling_strategy_column($samplingwidget, $suffix = '') {
$sampling_column = "
";
$sampling_column .= html_writer::tag('br', '');
- $sampling_column .= html_writer::tag('strong',get_string('selectrules', 'mod_coursework'));
+ $sampling_column .= html_writer::tag('strong', get_string('selectrules', 'mod_coursework'));
$sampling_column .= html_writer::tag('br', '');
$sampling_column .= html_writer::start_tag('div');
@@ -959,10 +959,10 @@ private function sampling_strategy_column($samplingwidget, $suffix = '') {
$sampling_column .= html_writer::end_tag('div');
- $sampling_column .= html_writer::link('#',get_string('addgraderule', 'mod_coursework'), array('id' => "assessor_{$suffix}_addgradderule", 'class' => 'addgradderule sampling_strategy_detail'));
- $sampling_column .= html_writer::link('#',get_string('removegraderule', 'mod_coursework'), array('id' => "assessor_{$suffix}_removegradderule", 'class' => 'removegradderule sampling_strategy_detail'));
+ $sampling_column .= html_writer::link('#', get_string('addgraderule', 'mod_coursework'), array('id' => "assessor_{$suffix}_addgradderule", 'class' => 'addgradderule sampling_strategy_detail'));
+ $sampling_column .= html_writer::link('#', get_string('removegraderule', 'mod_coursework'), array('id' => "assessor_{$suffix}_removegradderule", 'class' => 'removegradderule sampling_strategy_detail'));
- $sampling_column .= html_writer::checkbox("assessor_{$suffix}_samplertopup",1,false,get_string('topupto', 'mod_coursework'),
+ $sampling_column .= html_writer::checkbox("assessor_{$suffix}_samplertopup", 1, false, get_string('topupto', 'mod_coursework'),
array('id' => "assessor_{$suffix}_samplerules[]", 'class' => "assessor_{$suffix} sampling_strategy_detail"));
$sampling_column .= html_writer::select($percentage_options,
@@ -1098,7 +1098,7 @@ protected function get_sampling_strategy_form_elements($coursework, $assessor_nu
$javascript = '';
$classdir = $CFG->dirroot . '/mod/coursework/classes/sample_set_rule/';
- $sampleplugins = $DB->get_records('coursework_sample_set_plugin',null, 'pluginorder');
+ $sampleplugins = $DB->get_records('coursework_sample_set_plugin', null, 'pluginorder');
//$fullclasspaths = glob($classdir . '/*.php');
foreach ($sampleplugins as $plugin) {
@@ -1370,7 +1370,7 @@ protected function render_mod_coursework_personal_deadlines_table(mod_coursework
global $PAGE;
$coursework_page_url = $this->get_router()->get_path('coursework', array('coursework' => $personal_deadlines_table->get_coursework())) ;
- $table_html = '
'.html_writer::link($coursework_page_url,get_string('returntocourseworkpage', 'mod_coursework')).'
';
+ $table_html = '
'.html_writer::link($coursework_page_url, get_string('returntocourseworkpage', 'mod_coursework')).'
';
$table_html .= '
'.get_string('nopersonaldeadlineforextensionwarning', 'mod_coursework').'
';
diff --git a/renderers/page_renderer.php b/renderers/page_renderer.php
index 3dc1a18c..c8159dd6 100644
--- a/renderers/page_renderer.php
+++ b/renderers/page_renderer.php
@@ -341,7 +341,7 @@ public function choose_student_to_submit_for($coursemoduleid, $chooseform) {
* @param bool $ajax
* @throws coding_exception
*/
- public function new_feedback_page($new_feedback , $ajax = false) {
+ public function new_feedback_page($new_feedback, $ajax = false) {
global $PAGE, $OUTPUT, $SITE, $DB;
$submission = $new_feedback->get_submission();
@@ -757,7 +757,7 @@ public function non_teacher_allocated_grading_page($coursework, $viewallstudents
*/
$html .= html_writer::start_tag('div', array('class' => 'wrapper_table_submissions'));
- $html .= $grading_report_renderer->render_grading_report($grading_report, $coursework->has_multiple_markers(),true);
+ $html .= $grading_report_renderer->render_grading_report($grading_report, $coursework->has_multiple_markers(), true);
$html .= html_writer::end_tag('div');
/**
@@ -1515,7 +1515,7 @@ public function datatables_render($coursework) {
$content_default_deadline = html_writer::div($content_default_deadline, 'col-md-12', array('id' => 'extension-time-content'));
$modal_body .= html_writer::div($content_default_deadline, 'form-group row fitem');
- $content_extended_deadline = html_writer::tag('label',get_string('extended_deadline', 'mod_coursework'));
+ $content_extended_deadline = html_writer::tag('label', get_string('extended_deadline', 'mod_coursework'));
$content_extended_deadline_div = html_writer::div($content_extended_deadline, 'col-md-3');
$input = '
';
$content_extended_deadline_div .= html_writer::div($input, 'col-md-6');
@@ -1523,9 +1523,9 @@ public function datatables_render($coursework) {
$extension_reasons = coursework::extension_reasons();
if (!empty($extension_reasons)) {
- $select_extension_reasons = html_writer::tag('label',get_string('extension_reason', 'mod_coursework'));
+ $select_extension_reasons = html_writer::tag('label', get_string('extension_reason', 'mod_coursework'));
$select_extension_reasons_div = html_writer::div($select_extension_reasons, 'col-md-3');
- $select_extension_reasons = html_writer::select($extension_reasons, '', '',false, array(
+ $select_extension_reasons = html_writer::select($extension_reasons, '', '', false, array(
'id' => 'extension-reason-select',
'class' => 'form-control'
));
@@ -1533,7 +1533,7 @@ public function datatables_render($coursework) {
$modal_body .= html_writer::div($select_extension_reasons_div, 'form-group row fitem');
}
- $content_extra_information = html_writer::tag('label',get_string('extra_information', 'mod_coursework'), array(
+ $content_extra_information = html_writer::tag('label', get_string('extra_information', 'mod_coursework'), array(
'class' => 'col-form-label d-inline', 'for' => 'id_extra_information'
));
$content_extra_information_div = html_writer::div($content_extra_information, 'col-md-3');
diff --git a/settings.php b/settings.php
index f84c9f1c..07415683 100644
--- a/settings.php
+++ b/settings.php
@@ -27,7 +27,7 @@
if ($ADMIN->fulltree) {
require_once($CFG->dirroot.'/mod/coursework/lib.php');
- $settings_header = new admin_setting_heading('settings_header', '' ,get_string('settings_header', 'mod_coursework'));
+ $settings_header = new admin_setting_heading('settings_header', '', get_string('settings_header', 'mod_coursework'));
$settings->add($settings_header);
// Set site-wide option for late submission
@@ -165,7 +165,7 @@
$extension_list_label, $extension_list_description, ''));
// maximum extension deadline
- $settings->add(new admin_setting_configtext('coursework_max_extension_deadline',get_string('maximum_extension_deadline', 'coursework'),
+ $settings->add(new admin_setting_configtext('coursework_max_extension_deadline', get_string('maximum_extension_deadline', 'coursework'),
get_string('maximum_extension_deadline_desc', 'coursework'),
18, PARAM_INT, 2));
diff --git a/tests/classes/export/csv_test.php b/tests/classes/export/csv_test.php
index 2328d073..5beda892 100644
--- a/tests/classes/export/csv_test.php
+++ b/tests/classes/export/csv_test.php
@@ -101,7 +101,7 @@ public function test_one_stage() {
if (empty($extension_reasons)) {
- set_config('coursework_extension_reasons_list',"coursework extension \n sick leave");
+ set_config('coursework_extension_reasons_list', "coursework extension \n sick leave");
$extension_reasons = $this->coursework->extension_reasons();
}
diff --git a/view.php b/view.php
index ce9914c3..38864f3e 100644
--- a/view.php
+++ b/view.php
@@ -275,7 +275,7 @@
$redirectdetail->percentage = $percentage_allocation_not_complete;
$redirectdetail->manual = $manual_allocation_not_complete;
- redirect($CFG->wwwroot.'/mod/coursework/actions/allocate.php?id='.$course_module_id,get_string('configuration_needed', 'coursework', $redirectdetail));
+ redirect($CFG->wwwroot.'/mod/coursework/actions/allocate.php?id='.$course_module_id, get_string('configuration_needed', 'coursework', $redirectdetail));
}
}*/
From c11a298e6b4fbbf61c2b1695d60d1e4e831385c9 Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Mon, 12 Aug 2024 15:25:43 +0100
Subject: [PATCH 21/51] CTP-3558 coding std insert spaces in comments
---
actions/allocate.php | 2 +-
actions/processallocation.php | 4 +-
actions/upload_allocations.php | 4 +-
actions/upload_feedback.php | 2 +-
actions/upload_grading_sheet.php | 6 +-
.../backup_coursework_activity_task.class.php | 2 +-
backup/moodle2/backup_coursework_stepslib.php | 28 +++----
.../moodle2/restore_coursework_stepslib.php | 12 +--
classes/ability.php | 2 +-
classes/allocation/manager.php | 18 ++---
classes/allocation/table/processor.php | 26 +++----
classes/allocation/upload.php | 2 +-
classes/controllers/feedback_controller.php | 10 +--
.../personal_deadlines_controller.php | 6 +-
.../plagiarism_flagging_controller.php | 2 +-
.../controllers/submissions_controller.php | 2 +-
.../coursework_plagiarism_flag_updated.php | 2 +-
classes/export/csv.php | 2 +-
.../export/csv/cells/agreedfeedback_cell.php | 12 +--
classes/export/csv/cells/agreedgrade_cell.php | 32 ++++----
.../csv/cells/assessorfeedback_cell.php | 24 +++---
.../export/csv/cells/assessorgrade_cell.php | 42 +++++------
.../csv/cells/feedbackcomments_cell.php | 10 +--
.../export/csv/cells/otherassessors_cell.php | 2 +-
classes/export/csv/cells/singlegrade_cell.php | 34 ++++-----
classes/export/grading_sheet.php | 8 +-
classes/export/import.php | 74 +++++++++----------
classes/file_importer.php | 6 +-
classes/forms/upload_allocations_form.php | 2 +-
classes/forms/upload_feedback_form.php | 4 +-
classes/grading_report.php | 2 +-
classes/models/coursework.php | 6 +-
classes/models/outstanding_marking.php | 10 +--
classes/models/sample_set_rule.php | 2 +-
classes/models/submission.php | 6 +-
.../grading_report/cells/_user_cell.php | 2 +-
.../grading_report/cells/cell_base.php | 4 +-
.../grading_report/cells/group_cell.php | 2 +-
.../grading_report/cells/idnumber_cell.php | 2 +-
.../grading_report/cells/moderation_cell.php | 2 +-
.../cells/multiple_agreed_grade_cell.php | 10 +--
.../cells/time_submitted_cell.php | 2 +-
.../grading_report/cells/user_cell.php | 2 +-
.../renderers/personal_deadline_renderer.php | 2 +-
classes/sample_set_rule/range_sample_type.php | 22 +++---
classes/sample_set_rule/total_sample_type.php | 22 +++---
classes/stages/base.php | 6 +-
classes/warnings.php | 2 +-
db/install.php | 2 +-
db/upgrade.php | 6 +-
index.php | 2 +-
lib.php | 69 +++++++++--------
mod_form.php | 20 ++---
renderers/object_renderer.php | 20 ++---
renderers/page_renderer.php | 8 +-
settings.php | 12 +--
tests/behat/behat_mod_coursework.php | 62 ++++++++--------
tests/behat/pages/allocations_page.php | 2 +-
view.php | 40 +++++-----
59 files changed, 365 insertions(+), 366 deletions(-)
diff --git a/actions/allocate.php b/actions/allocate.php
index f5178984..cc4afb5c 100644
--- a/actions/allocate.php
+++ b/actions/allocate.php
@@ -196,7 +196,7 @@
// Add coursework id etc.
echo \html_writer::input_hidden_params($PAGE->url);
-if ($coursework->sampling_enabled()) { // Do not delete yet - refactoring...
+if ($coursework->sampling_enabled()) { // Do not delete yet - refactoring...
echo \html_writer::start_tag('form', array('id' => 'sampling_form',
'method' => 'post'));
$samplesetwidget = $allocationsmanager->get_sampling_set_widget();
diff --git a/actions/processallocation.php b/actions/processallocation.php
index 8bcaa224..bbed5f0d 100644
--- a/actions/processallocation.php
+++ b/actions/processallocation.php
@@ -20,10 +20,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-//this stops the page from aborting when an ajax call disconnects
+// This stops the page from aborting when an ajax call disconnects
ignore_user_abort(true);
-//we have to set the time limit to 0 as depending on
+// We have to set the time limit to 0 as depending on
set_time_limit ( 0 );
use mod_coursework\models\coursework;
diff --git a/actions/upload_allocations.php b/actions/upload_allocations.php
index 0e03db81..20842086 100644
--- a/actions/upload_allocations.php
+++ b/actions/upload_allocations.php
@@ -60,7 +60,7 @@
if ($data = $allocationsuploadform->get_data()) {
- //perform checks on data
+ // Perform checks on data
$content = $allocationsuploadform->get_file_content('allocationsdata');
@@ -68,7 +68,7 @@
$procsessingresults = $csvimport->validate_csv($content, $data->encoding, $data->delimiter_name);
- //process
+ // Process
$csvimport->process_csv($content, $data->encoding, $data->delimiter_name, $procsessingresults);
$page_renderer = $PAGE->get_renderer('mod_coursework', 'page');
echo $page_renderer->process_csv_upload($procsessingresults, $content, $csvtype);
diff --git a/actions/upload_feedback.php b/actions/upload_feedback.php
index 7aa870d7..fd59f960 100644
--- a/actions/upload_feedback.php
+++ b/actions/upload_feedback.php
@@ -60,7 +60,7 @@
if ($data = $feedbackform->get_data()) {
- //perform checks on data
+ // Perform checks on data
$courseworktempdir = $CFG->dataroot."/temp/coursework/";
if (!is_dir($courseworktempdir)) {
diff --git a/actions/upload_grading_sheet.php b/actions/upload_grading_sheet.php
index 68c7975b..9a43230f 100644
--- a/actions/upload_grading_sheet.php
+++ b/actions/upload_grading_sheet.php
@@ -61,7 +61,7 @@
if ($data = $gradinguploadform->get_data()) {
- //perform checks on data
+ // Perform checks on data
$content = $gradinguploadform->get_file_content('gradingdata');
@@ -73,9 +73,9 @@
$procsessingresults = $csvimport->validate_csv($content, $data->encoding, $data->delimiter_name, $csv_cells);
- //process
+ // Process
- //if (!empty($procsessingresults)) {
+ // If (!empty($procsessingresults)) {
$csvimport->process_csv($content, $data->encoding, $data->delimiter_name, $csv_cells, $procsessingresults);
$page_renderer = $PAGE->get_renderer('mod_coursework', 'page');
echo $page_renderer->process_csv_upload($procsessingresults, $content, $csvtype);
diff --git a/backup/moodle2/backup_coursework_activity_task.class.php b/backup/moodle2/backup_coursework_activity_task.class.php
index 3239a8ec..79a514a2 100644
--- a/backup/moodle2/backup_coursework_activity_task.class.php
+++ b/backup/moodle2/backup_coursework_activity_task.class.php
@@ -29,7 +29,7 @@ static public function encode_content_links($content) {
$base = preg_quote($CFG->wwwroot, "/");
- //These have to be picked up by the restore code COURSEWORK... are arbitrary
+ // These have to be picked up by the restore code COURSEWORK... are arbitrary
$search = "/(".$base."\/mod\/coursework\/index.php\?id\=)([0-9]+)/";
$content = preg_replace($search, '$@COURSEWORKINDEX*$2@$', $content);
diff --git a/backup/moodle2/backup_coursework_stepslib.php b/backup/moodle2/backup_coursework_stepslib.php
index 1ff56647..d0da81b9 100644
--- a/backup/moodle2/backup_coursework_stepslib.php
+++ b/backup/moodle2/backup_coursework_stepslib.php
@@ -307,31 +307,31 @@ protected function define_structure() {
"selectiontype"
));
- //A coursework instance has submissions.
+ // A coursework instance has submissions.
$coursework->add_child($submissions);
- //Each coursework may have reminders
+ // Each coursework may have reminders
$coursework->add_child($reminders);
- //And allocations pairs
+ // And allocations pairs
$coursework->add_child($pairs);
- //And moderation sets
+ // And moderation sets
$coursework->add_child($modsetrules);
- //And a set of extensionsenabled
+ // And a set of extensionsenabled
$coursework->add_child($extensions);
- //And a set of personaldeadlines
+ // And a set of personaldeadlines
$coursework->add_child($personal_deadlines);
- //And a set of moderation rule sets
+ // And a set of moderation rule sets
$coursework->add_child($modsetmembers);
- //And allocation configs
+ // And allocation configs
$coursework->add_child($allocation_configs);
- //And sample members
+ // And sample members
$coursework->add_child($sample_members);
- //And submissions are made up from individual submission instances
+ // And submissions are made up from individual submission instances
$submissions->add_child($submission);
- //Submissions have multiple feedback items
+ // Submissions have multiple feedback items
$submission->add_child($feedbacks);
- //Feedbacks is a set of individual items
+ // Feedbacks is a set of individual items
$feedbacks->add_child($feedback);
$feedback->add_child($moderation_agreements);
@@ -340,7 +340,7 @@ protected function define_structure() {
$submission->add_child($plagiarism_flags);
$plagiarism_flags->add_child($plagiarism_flag);
- //as are reminders, pairs, extensions, modsets and modsetrules,
+ // as are reminders, pairs, extensions, modsets and modsetrules,
// and allocation configs
$reminders->add_child($reminder);
$pairs->add_child($pair);
@@ -387,7 +387,7 @@ protected function define_structure() {
$allocation_config->set_source_table('coursework_allocation_config',
array('courseworkid' => backup::VAR_PARENTID));
- //Mark important foreign keys
+ // Mark important foreign keys
$feedback->annotate_ids('user', 'assessorid');
$feedback->annotate_ids('user', 'lasteditedbyuser');
$feedback->annotate_ids('user', 'markernumber');
diff --git a/backup/moodle2/restore_coursework_stepslib.php b/backup/moodle2/restore_coursework_stepslib.php
index 467e6b92..e072e1fe 100644
--- a/backup/moodle2/restore_coursework_stepslib.php
+++ b/backup/moodle2/restore_coursework_stepslib.php
@@ -50,9 +50,9 @@ protected function define_structure() {
if ($userinfo) {
// Define each element separated.
// Note: when I started the code I didn't realise that the names were arbitrary
- // and that the coursework_ prefix is not needed.
- // It would be nice to go back and take these out here and in backup.
- // But not essential
+ // and that the coursework_ prefix is not needed.
+ // It would be nice to go back and take these out here and in backup.
+ // But not essential
$bits = array('submission' => 'coursework_submissions',
'feedback' => 'coursework_submissions/coursework_submission/coursework_feedbacks',
'reminder' => 'coursework_reminders',
@@ -120,7 +120,7 @@ protected function process_coursework_submission($data) {
$newitemid = $DB->insert_record('coursework_submissions', $data);
$this->set_mapping('coursework_submission', $oldid, $newitemid);
- //Tell system how to map the old submission id to its new one.
+ // Tell system how to map the old submission id to its new one.
$this->set_mapping('coursework_submission', $oldid, $newitemid, false, null, $this->task->get_old_contextid());
}
@@ -389,7 +389,7 @@ protected function process_coursework($data) {
'deadline'), $data);
$now = time();
- //Taken from install.xml
+ // Taken from install.xml
$this->set_defaults(array('formid' => 0,
'course' => 0,
'name' => '',
@@ -493,7 +493,7 @@ protected function after_execute() {
$this->add_related_files('mod_coursework', 'submission', 'coursework_submission');
$this->add_related_files('mod_coursework', 'feedback', 'coursework_feedback');
- //Fixup names
+ // Fixup names
$fs = get_file_storage();
$ctx = context::instance_by_id($this->task->get_contextid());
diff --git a/classes/ability.php b/classes/ability.php
index 14626d04..eaa78f77 100644
--- a/classes/ability.php
+++ b/classes/ability.php
@@ -145,7 +145,7 @@ function (coursework $coursework) {
$this->allow_edit_moderation_if_user_is_allocated_to_moderate();
$this->allow_edit_moderation_if_user_can_administer_grades();
- //show moderation
+ // Show moderation
$this->allow_show_moderation_if_user_can_view_grades_at_all_times();
// Feedback rules
diff --git a/classes/allocation/manager.php b/classes/allocation/manager.php
index 7098ecff..766ba509 100644
--- a/classes/allocation/manager.php
+++ b/classes/allocation/manager.php
@@ -51,12 +51,12 @@ class manager {
/**
* @var strategy\base
*/
- private $assessorallocationstrategy;
+ private $assessorallocationstrategy;
/**
* @var strategy\base
*/
- private $moderatorallocationstrategy;
+ private $moderatorallocationstrategy;
/**
* New instance created with references to the coursework stored.
@@ -295,7 +295,7 @@ public function auto_generate_sample_set() {
$final_agreed_allocatables = $this->get_allocatables_with_final_agreed();
- //remove any allocatables that have a status of final agreed as these can not be sampled
+ // Remove any allocatables that have a status of final agreed as these can not be sampled
foreach ($final_agreed_allocatables as $faa) {
if (isset($allocatables[$faa->allocatableid])) unset($allocatables[$faa->allocatableid]);
}
@@ -323,9 +323,9 @@ public function auto_generate_sample_set() {
$auto_with_feedback = $this->get_automatic_with_feedback($stage);
- //ok this array merge is being carried out using an foreach rather than array_merge as we want to preserve keys
- //I am also not using add the two arrays as using the overloaded + can produce dubious results when a key exists
- //in both arrays
+ // Ok this array merge is being carried out using an foreach rather than array_merge as we want to preserve keys
+ // I am also not using add the two arrays as using the overloaded + can produce dubious results when a key exists
+ // In both arrays
foreach ($auto_with_feedback as $k => $v) {
if (!isset($manual_sample_set[$k])) $manual_sample_set[$k] = $v;
@@ -342,7 +342,7 @@ public function auto_generate_sample_set() {
}
- //save sample set
+ // Save sample set
if (!empty($auto_sample_set)) {
foreach ($auto_sample_set as $allocatable) {
$sample = new \stdClass();
@@ -352,7 +352,7 @@ public function auto_generate_sample_set() {
$sample->stage_identifier = "assessor_{$stage_number}";
$sample->selectiontype = "automatic";
- //if this a manually selected allocatable check to see if the allocatable is already in the table
+ // If this a manually selected allocatable check to see if the allocatable is already in the table
$DB->insert_record("coursework_sample_set_mbrs", $sample);
}
@@ -377,7 +377,7 @@ public function get_include_in_sample_set($stage_number) {
AND stage_identifier = :stage_identifier
AND selectiontype = 'manual'";
- //get all users in manually selected for stage in coursework
+ // Get all users in manually selected for stage in coursework
return $DB->get_records_sql($sql,
array('courseworkid' => $this->coursework->id, 'stage_identifier' => $stage));
diff --git a/classes/allocation/table/processor.php b/classes/allocation/table/processor.php
index 716753c6..c0a143c9 100644
--- a/classes/allocation/table/processor.php
+++ b/classes/allocation/table/processor.php
@@ -87,19 +87,19 @@ private function get_row($allocatable) {
private function clean_data($raw_data) {
// Data looks like this:
-// $example_data = array(
-// 4543 => array( // Student id
-// 'assessor_1' => array(
-// 'allocation_id' => 43,
-// 'assessor_id' => 232,
-// ),
-// 'moderator_1' => array(
-// 'allocation_id' => 46,
-// 'assessor_id' => 235,
-// 'in_set' => 1,
-// )
-// )
-// );
+// $example_data = array(
+// 4543 => array( // Student id
+// 'assessor_1' => array(
+// 'allocation_id' => 43,
+// 'assessor_id' => 232,
+// ),
+// 'moderator_1' => array(
+// 'allocation_id' => 46,
+// 'assessor_id' => 235,
+// 'in_set' => 1,
+// )
+// )
+// );
$clean_data = array();
foreach ($raw_data as $allocatable_id => $datarrays) {
diff --git a/classes/allocation/upload.php b/classes/allocation/upload.php
index 010130cc..f201ebc1 100644
--- a/classes/allocation/upload.php
+++ b/classes/allocation/upload.php
@@ -192,7 +192,7 @@ public function process_csv($content, $encoding, $delimiter, $processingresults)
while ($line = $csvreader->next()) {
- //we will not process the content of any line that has been flagged up with an error
+ // We will not process the content of any line that has been flagged up with an error
if ( is_array($processingresults) && array_key_exists($s, $processingresults) ) {
$s++;
continue;
diff --git a/classes/controllers/feedback_controller.php b/classes/controllers/feedback_controller.php
index 2e237c6a..a6fe97d1 100644
--- a/classes/controllers/feedback_controller.php
+++ b/classes/controllers/feedback_controller.php
@@ -227,10 +227,10 @@ protected function create_feedback() {
$submission->publish();
}
- //only implement auto feedback (automatic agreement) if the settings is set to disabled otherwise
- //we will do this in the cron
- //only implement auto feedback (automatic agreement) if the settings is set to disabled otherwise
- //we will do this in the cron
+ // Only implement auto feedback (automatic agreement) if the settings is set to disabled otherwise
+ // We will do this in the cron
+ // Only implement auto feedback (automatic agreement) if the settings is set to disabled otherwise
+ // We will do this in the cron
$gradeeditingtime = $teacherfeedback->get_coursework()->get_grade_editing_time();
if (empty($gradeeditingtime) || time() > $teacherfeedback->timecreated + $gradeeditingtime) {
@@ -358,7 +358,7 @@ protected function update_feedback() {
} else {
$teacherfeedback->destroy();
- //remove associated files
+ // Remove associated files
$fs = get_file_storage();
$fs->delete_area_files($teacherfeedback->get_coursework()->get_context()->id, 'mod_coursework', 'feedback', $teacherfeedback->id());
diff --git a/classes/controllers/personal_deadlines_controller.php b/classes/controllers/personal_deadlines_controller.php
index 6aae93ec..475852e8 100644
--- a/classes/controllers/personal_deadlines_controller.php
+++ b/classes/controllers/personal_deadlines_controller.php
@@ -132,15 +132,15 @@ protected function set_default_current_deadline() {
'courseworkid' => $this->params['courseworkid'],
);
- //if the allocatableid is an array then the current page will probably be setting multiple the personal deadlines
- //we use the first element in the array to setup the personal deadline object
+ // If the allocatableid is an array then the current page will probably be setting multiple the personal deadlines
+ // We use the first element in the array to setup the personal deadline object
$params['allocatableid'] = (is_array($this->params['allocatableid'])) ? current($this->params['allocatableid']) : $this->params['allocatableid'] ;
$this->personal_deadline = personal_deadline::find_or_build($params);
$params['allocatableid'] = $this->params['allocatableid'];
- //if the allocatableid is an array then the current page will probably be setting multiple the personal deadlines
+ // If the allocatableid is an array then the current page will probably be setting multiple the personal deadlines
// of multiple allocatable ids in which case set the personal deadline to the coursework default
if (is_array($this->params['allocatableid']) || !$this->get_personal_deadline()) { // if no personal deadline then use coursework deadline
$this->personal_deadline->personal_deadline = $this->coursework->deadline;
diff --git a/classes/controllers/plagiarism_flagging_controller.php b/classes/controllers/plagiarism_flagging_controller.php
index a0aab984..a5326d87 100644
--- a/classes/controllers/plagiarism_flagging_controller.php
+++ b/classes/controllers/plagiarism_flagging_controller.php
@@ -171,7 +171,7 @@ protected function update_plagiarism_flag() {
$plagiarismflag = $form->process_data($plagiarismflag);
// add to log here
- $oldstatus = $DB->get_field(plagiarism_flag::get_table_name(), 'status', array('id' => $flagid)); //retrieve old status before saving new
+ $oldstatus = $DB->get_field(plagiarism_flag::get_table_name(), 'status', array('id' => $flagid)); // Retrieve old status before saving new
$params = array(
'context' => \context_module::instance($this->coursework->get_course_module()->id),
'courseid' => $this->coursework->get_course()->id,
diff --git a/classes/controllers/submissions_controller.php b/classes/controllers/submissions_controller.php
index aeedb1d0..f8e672ee 100644
--- a/classes/controllers/submissions_controller.php
+++ b/classes/controllers/submissions_controller.php
@@ -113,7 +113,7 @@ protected function create_submission() {
$submission->createdby = $USER->id;
$submission->lastupdatedby = $USER->id;
$submission->allocatabletype = $this->params['allocatabletype'];
- $submission->authorid = $submission->get_author_id(); //create new function to get the author id depending on whether the current user is submitting on behalf
+ $submission->authorid = $submission->get_author_id(); // Create new function to get the author id depending on whether the current user is submitting on behalf
$submission->timesubmitted = time();
// Automatically finalise any submissions that's past the deadline/personal deadline and doesn't have valid extension
diff --git a/classes/event/coursework_plagiarism_flag_updated.php b/classes/event/coursework_plagiarism_flag_updated.php
index 37b49c63..613afc93 100644
--- a/classes/event/coursework_plagiarism_flag_updated.php
+++ b/classes/event/coursework_plagiarism_flag_updated.php
@@ -35,7 +35,7 @@ class coursework_plagiarism_flag_updated extends \core\event\base {
*/
protected function init() {
- $this->data['crud'] = 'u'; //One of [crud] letters - indicating 'c'reate, 'r'ead, 'u'pdate or 'd'elete operation. Statically declared in the event class method init().
+ $this->data['crud'] = 'u'; // One of [crud] letters - indicating 'c'reate, 'r'ead, 'u'pdate or 'd'elete operation. Statically declared in the event class method init().
$this->data['edulevel'] = self::LEVEL_TEACHING;
$this->data['objecttable'] = 'coursework';
}
diff --git a/classes/export/csv.php b/classes/export/csv.php
index 788d17be..fc7c7949 100644
--- a/classes/export/csv.php
+++ b/classes/export/csv.php
@@ -257,7 +257,7 @@ public function other_assessors_cells() {
$cells = 0;
if ($this->coursework->is_using_rubric()) {
$criterias = $this->coursework->get_rubric_criteria();
- //we will increment by the number of criterias plus 1 for feedback
+ // We will increment by the number of criterias plus 1 for feedback
$increment = (count($criterias) * 2) +1;
} else {
diff --git a/classes/export/csv/cells/agreedfeedback_cell.php b/classes/export/csv/cells/agreedfeedback_cell.php
index 5ed7a8fa..0bae12bd 100644
--- a/classes/export/csv/cells/agreedfeedback_cell.php
+++ b/classes/export/csv/cells/agreedfeedback_cell.php
@@ -65,16 +65,16 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
$subdbrecord = $DB->get_record('coursework_submissions', array('id' => $submissionid));
$submission = \mod_coursework\models\submission::find($subdbrecord);
- //is the submission in question ready to grade?
+ // Is the submission in question ready to grade?
if (!$submission->all_inital_graded() && !empty($value)) return get_string('submissionnotreadyforagreedgrade', 'coursework');
- //has the submission been published if yes then no further grades are allowed
+ // Has the submission been published if yes then no further grades are allowed
if ($submission->get_state() >= submission::PUBLISHED) return $submission->get_status_text();
- //if you have administer grades you can grade anything
+ // If you have administer grades you can grade anything
if (has_capability('mod/coursework:administergrades', $PAGE->context)) return true;
- //has this submission been graded if yes then check if the current user graded it (only if allocation is not enabled).
+ // Has this submission been graded if yes then check if the current user graded it (only if allocation is not enabled).
$feedback_params = array(
'submissionid' => $submission->id,
'stage_identifier' => $stage_identifier,
@@ -93,10 +93,10 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
);
$new_feedback = feedback::build($feedback_params);
- //this is a new feedback check it against the new ability checks
+ // This is a new feedback check it against the new ability checks
if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !has_capability('mod/coursework:addallocatedagreedgrade', $PAGE->context) && !$ability->can('new', $new_feedback)) return get_string('nopermissiontogradesubmission', 'coursework');
} else {
- //this is a new feedback check it against the edit ability checks
+ // This is a new feedback check it against the edit ability checks
if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade', 'coursework');
}
diff --git a/classes/export/csv/cells/agreedgrade_cell.php b/classes/export/csv/cells/agreedgrade_cell.php
index a86e624b..c158425c 100644
--- a/classes/export/csv/cells/agreedgrade_cell.php
+++ b/classes/export/csv/cells/agreedgrade_cell.php
@@ -99,13 +99,13 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
}
} else {
- //we won't be processing this line if it has no values, empty wont tell us this as it thinks that an array with
- //keys isnt. We will use array_filter whhich will return all values from the array if this is empty then we have
- //nothing to do
+ // We won't be processing this line if it has no values, empty wont tell us this as it thinks that an array with
+ // Keys isnt. We will use array_filter whhich will return all values from the array if this is empty then we have
+ // Nothing to do
$arrayvalues = array_filter($value);
- //if there are no values we don't need to do anything
+ // If there are no values we don't need to do anything
if (!empty($arrayvalues)) {
$i = 0;
@@ -115,17 +115,17 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
foreach ($value as $data) {
- //check if the value is empty however it can be 0
+ // Check if the value is empty however it can be 0
if (empty($data) && $data != 0) {
$errormsg .= ' ' . get_string('rubric_grade_cannot_be_empty', 'coursework');
}
- //only check grades fields that will be even numbered
+ // Only check grades fields that will be even numbered
if ($i % 2 == 0) {
- //get the current criteria
+ // Get the current criteria
$criteria = array_shift($criterias);
//lets check if the value given is valid for the current rubric criteria
@@ -139,7 +139,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
}
} else {
- //set value to false so that a submission not ready to grade message isn't returned
+ // Set value to false so that a submission not ready to grade message isn't returned
$value = false;
}
@@ -151,16 +151,16 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
$subdbrecord = $DB->get_record('coursework_submissions', array('id' => $submissionid));
$submission = \mod_coursework\models\submission::find($subdbrecord);
- //is the submission in question ready to grade?
+ // Is the submission in question ready to grade?
if (!$submission->all_inital_graded() && !empty($value) && count($uploadedgradecells) < $submission->max_number_of_feedbacks()) return get_string('submissionnotreadyforagreedgrade', 'coursework');
- //has the submission been published if yes then no further grades are allowed
+ // Has the submission been published if yes then no further grades are allowed
if ($submission->get_state() >= submission::PUBLISHED) return $submission->get_status_text();
- //if you have administer grades you can grade anything
+ // If you have administer grades you can grade anything
if (has_capability('mod/coursework:administergrades', $PAGE->context)) return true;
- //has this submission been graded if yes then check if the current user graded it (only if allocation is not enabled).
+ // Has this submission been graded if yes then check if the current user graded it (only if allocation is not enabled).
$feedback_params = array(
'submissionid' => $submission->id,
'stage_identifier' => $stage_identifier,
@@ -180,10 +180,10 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
);
$new_feedback = feedback::build($feedback_params);
- //this is a new feedback check it against the new ability checks
+ // This is a new feedback check it against the new ability checks
if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !has_capability('mod/coursework:addallocatedagreedgrade', $PAGE->context) && !$ability->can('new', $new_feedback)) return get_string('nopermissiontogradesubmission', 'coursework');
} else {
- //this is a new feedback check it against the edit ability checks
+ // This is a new feedback check it against the edit ability checks
if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade', 'coursework');
}
@@ -245,9 +245,9 @@ function get_rubrics($coursework, $csv_cells) {
$rubricheaders[] = $criteria['description']." comment";
}
- //find out the position of singlegrade
+ // Find out the position of singlegrade
$position = array_search('singlegrade', $csv_cells);
- //get all data from the position of the singlegrade to the length of rubricheaders
+ // Get all data from the position of the singlegrade to the length of rubricheaders
// $csv_cells = array_splice($csv_cells,5, 1, $rubricheaders);
$start_cells = array_slice($csv_cells, 0, $position, true);
diff --git a/classes/export/csv/cells/assessorfeedback_cell.php b/classes/export/csv/cells/assessorfeedback_cell.php
index 836e1aea..a694a77c 100644
--- a/classes/export/csv/cells/assessorfeedback_cell.php
+++ b/classes/export/csv/cells/assessorfeedback_cell.php
@@ -85,16 +85,16 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
if (has_any_capability($agreedgradecap, $PAGE->context) && has_any_capability($initialgradecap, $PAGE->context)
|| has_capability('mod/coursework:administergrades', $PAGE->context)) {
- //is the submission in question ready to grade?
+ // Is the submission in question ready to grade?
if (!$submission->ready_to_grade()) return get_string('submissionnotreadytograde', 'coursework');
- //has the submission been published if yes then no further grades are allowed
+ // Has the submission been published if yes then no further grades are allowed
if ($submission->get_state() >= submission::PUBLISHED) return $submission->get_status_text();
- //if you have administer grades you can grade anything
+ // If you have administer grades you can grade anything
if (has_capability('mod/coursework:administergrades', $PAGE->context)) return true;
- //has this submission been graded if yes then check if the current user graded it (only if allocation is not enabled).
+ // Has this submission been graded if yes then check if the current user graded it (only if allocation is not enabled).
$feedback_params = array(
'submissionid' => $submission->id,
'stage_identifier' => $stage_identifier,
@@ -105,25 +105,25 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
//does a feedback exist for this stage
if (!empty($feedback)) {
- //this is a new feedback check it against the new ability checks
+ // This is a new feedback check it against the new ability checks
if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('new', $feedback)) return get_string('nopermissiontoeditgrade', 'coursework');
} else {
- //this is a new feedback check it against the edit ability checks
+ // This is a new feedback check it against the edit ability checks
if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade', 'coursework');
}
if (!$this->coursework->allocation_enabled() && !empty($feedback)) {
- //was this user the one who last graded this submission if not then user cannot grade
+ // Was this user the one who last graded this submission if not then user cannot grade
if ($feedback->assessorid != $USER->id || !has_capability('mod/coursework:editinitialgrade', $PAGE->context) )
return get_string('nopermissiontogradesubmission', 'coursework');
}
if ($this->coursework->allocation_enabled()) {
- //check that the user is allocated to the author of the submission
+ // Check that the user is allocated to the author of the submission
$allocation_params = array(
'courseworkid' => $this->coursework->id,
'allocatableid' => $submission->allocatableid,
@@ -135,7 +135,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
&& !$DB->get_record('coursework_allocation_pairs', $allocation_params)) return get_string('nopermissiontogradesubmission', 'coursework');
}
- //check for coursework without allocations - with/without samplings
+ // Check for coursework without allocations - with/without samplings
if (has_capability('mod/coursework:addinitialgrade', $PAGE->context) && !has_capability('mod/coursework:editinitialgrade', $PAGE->context)
&& $this->coursework->get_max_markers() > 1 && !$this->coursework->allocation_enabled()) {
@@ -147,7 +147,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
$in_sample = $submission->get_submissions_in_sample();
$assessors = ($in_sample)? sizeof($in_sample) + 1 : 1;
} else {
- //check how many assessors for this coursework
+ // Check how many assessors for this coursework
$assessors = $this->coursework->get_max_markers();
}
if ($assessors == $feedbacks) return get_string('gradealreadyexists', 'coursework');
@@ -155,8 +155,8 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
} else if (has_any_capability($agreedgradecap, $PAGE->context)) {
- //if you have the add agreed or edit agreed grades capabilities then you may have the grades on your export sheet
- //we will return true as we will ignore them
+ // If you have the add agreed or edit agreed grades capabilities then you may have the grades on your export sheet
+ // We will return true as we will ignore them
return true;
} else {
diff --git a/classes/export/csv/cells/assessorgrade_cell.php b/classes/export/csv/cells/assessorgrade_cell.php
index 7a51d082..02c0f548 100644
--- a/classes/export/csv/cells/assessorgrade_cell.php
+++ b/classes/export/csv/cells/assessorgrade_cell.php
@@ -130,13 +130,13 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
}
} else {
- //we won't be processing this line if it has no values, empty wont tell us this as it thinks that an array with
- //keys isnt. We will use array_filter whhich will return all values from the array if this is empty then we have
- //nothing to do
+ // We won't be processing this line if it has no values, empty wont tell us this as it thinks that an array with
+ // Keys isnt. We will use array_filter whhich will return all values from the array if this is empty then we have
+ // Nothing to do
$arrayvalues = array_filter($value);
- //if there are no values we don't need to do anything
+ // If there are no values we don't need to do anything
if (!empty($arrayvalues)) {
$i = 0;
@@ -146,17 +146,17 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
foreach ($value as $data) {
- //check if the value is empty however it can be 0
+ // Check if the value is empty however it can be 0
if (empty($data) && $data != 0) {
$errormsg .= ' ' . get_string('rubric_grade_cannot_be_empty', 'coursework');
}
- //only check grades fields that will be even numbered
+ // Only check grades fields that will be even numbered
if ($i % 2 == 0) {
- //get the current criteria
+ // Get the current criteria
$criteria = array_shift($criterias);
//lets check if the value given is valid for the current rubric criteria
@@ -174,16 +174,16 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
if (!empty($errormsg)) return $errormsg;
- //is the submission in question ready to grade?
+ // Is the submission in question ready to grade?
if (!$submission->ready_to_grade()) return get_string('submissionnotreadytograde', 'coursework');
- //has the submission been published if yes then no further grades are allowed
+ // Has the submission been published if yes then no further grades are allowed
if ($submission->get_state() >= submission::PUBLISHED) return $submission->get_status_text();
- //if you have administer grades you can grade anything
+ // If you have administer grades you can grade anything
if (has_capability('mod/coursework:administergrades', $PAGE->context)) return true;
- //has this submission been graded if yes then check if the current user graded it (only if allocation is not enabled).
+ // Has this submission been graded if yes then check if the current user graded it (only if allocation is not enabled).
$feedback_params = array(
'submissionid' => $submission->id,
'stage_identifier' => $stage_identifier,
@@ -194,25 +194,25 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
//does a feedback exist for this stage
if (!empty($feedback)) {
- //this is a new feedback check it against the new ability checks
+ // This is a new feedback check it against the new ability checks
if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('new', $feedback)) return get_string('nopermissiontoeditgrade', 'coursework');
} else {
- //this is a new feedback check it against the edit ability checks
+ // This is a new feedback check it against the edit ability checks
if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade', 'coursework');
}
if (!$this->coursework->allocation_enabled() && !empty($feedback)) {
- //was this user the one who last graded this submission if not then user cannot grade
+ // Was this user the one who last graded this submission if not then user cannot grade
if ($feedback->assessorid != $USER->id || !has_capability('mod/coursework:editinitialgrade', $PAGE->context))
return get_string('nopermissiontogradesubmission', 'coursework');
}
if ($this->coursework->allocation_enabled()) {
- //check that the user is allocated to the author of the submission
+ // Check that the user is allocated to the author of the submission
$allocation_params = array(
'courseworkid' => $this->coursework->id,
'allocatableid' => $submission->allocatableid,
@@ -225,7 +225,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
) return get_string('nopermissiontogradesubmission', 'coursework');
}
- //check for coursework without allocations - with/without samplings
+ // Check for coursework without allocations - with/without samplings
if (has_capability('mod/coursework:addinitialgrade', $PAGE->context) && !has_capability('mod/coursework:editinitialgrade', $PAGE->context)
&& $this->coursework->get_max_markers() > 1 && !$this->coursework->allocation_enabled()
) {
@@ -238,7 +238,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
$in_sample = $submission->get_submissions_in_sample();
$assessors = ($in_sample) ? sizeof($in_sample) + 1 : 1;
} else {
- //check how many assessors for this coursework
+ // Check how many assessors for this coursework
$assessors = $this->coursework->get_max_markers();
}
if ($assessors == $feedbacks) return get_string('gradealreadyexists', 'coursework');
@@ -246,8 +246,8 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
} else if (has_any_capability($agreedgradecap, $PAGE->context)) {
- //if you have the add agreed or edit agreed grades capabilities then you may have the grades on your export sheet
- //we will return true as we will ignore them
+ // If you have the add agreed or edit agreed grades capabilities then you may have the grades on your export sheet
+ // We will return true as we will ignore them
return true;
} else {
@@ -305,9 +305,9 @@ function get_rubrics($coursework, $csv_cells) {
$rubricheaders[] = $criteria['description']." comment";
}
- //find out the position of singlegrade
+ // Find out the position of singlegrade
$position = array_search('singlegrade', $csv_cells);
- //get all data from the position of the singlegrade to the length of rubricheaders
+ // Get all data from the position of the singlegrade to the length of rubricheaders
// $csv_cells = array_splice($csv_cells,5, 1, $rubricheaders);
$start_cells = array_slice($csv_cells, 0, $position, true);
diff --git a/classes/export/csv/cells/feedbackcomments_cell.php b/classes/export/csv/cells/feedbackcomments_cell.php
index b865069d..72c8fb78 100644
--- a/classes/export/csv/cells/feedbackcomments_cell.php
+++ b/classes/export/csv/cells/feedbackcomments_cell.php
@@ -65,13 +65,13 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
$submission = \mod_coursework\models\submission::find($dbrecord);
- //is this submission ready to be graded
+ // Is this submission ready to be graded
if (!$submission->ready_to_grade()) return get_string('submissionnotreadytograde', 'coursework');
- //if you have administer grades you can grade anything
+ // If you have administer grades you can grade anything
if (has_capability('mod/coursework:administergrades', $PAGE->context)) return true;
- //is the current user an assessor at any of this submissions grading stages or do they have administer grades
+ // Is the current user an assessor at any of this submissions grading stages or do they have administer grades
if (!$this->coursework->is_assessor($USER) && !has_capability('mod/coursework:administergrades', $PAGE->context))
return get_string('nopermissiontogradesubmission', 'coursework');
@@ -93,10 +93,10 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
);
$new_feedback = feedback::build($feedback_params);
- //this is a new feedback check it against the new ability checks
+ // This is a new feedback check it against the new ability checks
if (!$ability->can('new', $new_feedback)) return get_string('nopermissiontogradesubmission', 'coursework');
} else {
- //this is a new feedback check it against the edit ability checks
+ // This is a new feedback check it against the edit ability checks
if (!$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade', 'coursework');
}
} else {
diff --git a/classes/export/csv/cells/otherassessors_cell.php b/classes/export/csv/cells/otherassessors_cell.php
index 161d4141..7c2ff991 100644
--- a/classes/export/csv/cells/otherassessors_cell.php
+++ b/classes/export/csv/cells/otherassessors_cell.php
@@ -42,7 +42,7 @@ public function get_cell($submission, $student, $stage_identifier) {
global $DB, $USER;
// find out current user stage identifier
- // $stage_identifier =
+ // $stage_identifier =
// retrieve all feedbacks without currents user feedback
$params = array(
diff --git a/classes/export/csv/cells/singlegrade_cell.php b/classes/export/csv/cells/singlegrade_cell.php
index 5c6d2da4..ff7e23ff 100644
--- a/classes/export/csv/cells/singlegrade_cell.php
+++ b/classes/export/csv/cells/singlegrade_cell.php
@@ -93,13 +93,13 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
}
} else {
- //we won't be processing this line if it has no values, empty wont tell us this as it thinks that an array with
- //keys isnt. We will use array_filter whhich will return all values from the array if this is empty then we have
- //nothing to do
+ // We won't be processing this line if it has no values, empty wont tell us this as it thinks that an array with
+ // Keys isnt. We will use array_filter whhich will return all values from the array if this is empty then we have
+ // Nothing to do
$arrayvalues = array_filter($value);
- //if there are no values we don't need to do anything
+ // If there are no values we don't need to do anything
if (!empty($arrayvalues)) {
$i = 0;
@@ -109,15 +109,15 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
foreach ($value as $data) {
- //check if the value is empty however it can be 0
+ // Check if the value is empty however it can be 0
if (empty($data) && $data != 0) {
$errormsg .= ' ' . get_string('rubric_grade_cannot_be_empty', 'coursework');
}
- //only check grades fields that will be even numbered
+ // Only check grades fields that will be even numbered
if ($i % 2 == 0) {
- //get the current criteria
+ // Get the current criteria
$criteria = array_shift($criterias);
//lets check if the value given is valid for the current rubric criteria
@@ -139,20 +139,20 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
$submission = \mod_coursework\models\submission::find($dbrecord);
- //is this submission ready to be graded
+ // Is this submission ready to be graded
if (!$submission->ready_to_grade() && $submission->get_state() < \mod_coursework\models\submission::FULLY_GRADED) return get_string('submissionnotreadytograde', 'coursework');
- //if you have administer grades you can grade anything
+ // If you have administer grades you can grade anything
if (has_capability('mod/coursework:administergrades', $PAGE->context)) return true;
- //is the current user an assessor at any of this submissions grading stages or do they have administer grades
+ // Is the current user an assessor at any of this submissions grading stages or do they have administer grades
if ($this->coursework->allocation_enabled() && !$this->coursework->is_assessor($USER) && !has_capability('mod/coursework:administergrades', $PAGE->context))
return get_string('nopermissiontogradesubmission', 'coursework');
- //has the submission been published if yes then no further grades are allowed
+ // Has the submission been published if yes then no further grades are allowed
if ($submission->get_state() >= submission::PUBLISHED) return $submission->get_status_text();
- //has this submission been graded if yes then check if the current user graded it (only if allocation is not enabled).
+ // Has this submission been graded if yes then check if the current user graded it (only if allocation is not enabled).
$feedback_params = array(
'submissionid' => $submission->id,
'stage_identifier' => $stage_identifier,
@@ -160,7 +160,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
$feedback = feedback::find($feedback_params);
if (!$this->coursework->allocation_enabled() && !empty($feedback)) {
- //was this user the one who last graded this submission if not then user cannot grade
+ // Was this user the one who last graded this submission if not then user cannot grade
if ($feedback->assessorid != $USER->id || !has_capability('mod/coursework:editinitialgrade', $PAGE->context) && !has_capability('mod/coursework:administergrades', $PAGE->context))
return get_string('nopermissiontoeditgrade', 'coursework');
@@ -186,10 +186,10 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
);
$new_feedback = feedback::build($feedback_params);
- //this is a new feedback check it against the new ability checks
+ // This is a new feedback check it against the new ability checks
if (!$ability->can('new', $new_feedback)) return get_string('nopermissiontogradesubmission', 'coursework');
} else {
- //this is a new feedback check it against the edit ability checks
+ // This is a new feedback check it against the edit ability checks
if (!$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade', 'coursework');
}
@@ -250,9 +250,9 @@ function get_rubrics($coursework, $csv_cells) {
$rubricheaders[] = $criteria['description']." comment";
}
- //find out the position of singlegrade
+ // Find out the position of singlegrade
$position = array_search('singlegrade', $csv_cells);
- //get all data from the position of the singlegrade to the length of rubricheaders
+ // Get all data from the position of the singlegrade to the length of rubricheaders
// $csv_cells = array_splice($csv_cells,5, 1, $rubricheaders);
$start_cells = array_slice($csv_cells, 0, $position, true);
diff --git a/classes/export/grading_sheet.php b/classes/export/grading_sheet.php
index 8cc84566..262daa91 100644
--- a/classes/export/grading_sheet.php
+++ b/classes/export/grading_sheet.php
@@ -89,8 +89,8 @@ public function get_submissions($groupid = null, $selected_submission_ids = '')
}
}
- //TODO - decide if already marked submissions should be displayed in single marking
- // if not marked by a user than dont display it as it would allow them to edit it??
+ // TODO - decide if already marked submissions should be displayed in single marking
+ // if not marked by a user than dont display it as it would allow them to edit it??
// || $submission->get_state() == submission::FINAL_GRADED
if (!$ability->can('show', $submission)
|| ($stages == 1 && !has_capability('mod/coursework:addinitialgrade', $PAGE->context))
@@ -183,7 +183,7 @@ public static function cells_array($coursework) {
$csv_cells[] = 'singlegrade';
$csv_cells[] = 'feedbackcomments';
- //other grades
+ // Other grades
$csv_cells[] = 'otherassessors';
$csv_cells[] = 'agreedgrade';
@@ -192,7 +192,7 @@ public static function cells_array($coursework) {
} else if (has_capability('mod/coursework:addinitialgrade', $PAGE->context)
|| has_capability('mod/coursework:administergrades', $PAGE->context)) {
- // if (!$coursework->is_using_rubric()) {
+ // if (!$coursework->is_using_rubric()) {
$csv_cells[] = 'singlegrade';
/* } else {
diff --git a/classes/export/import.php b/classes/export/import.php
index d66d9ffe..5e96256c 100644
--- a/classes/export/import.php
+++ b/classes/export/import.php
@@ -94,7 +94,7 @@ public function validate_csv($content, $encoding, $delimeter, $csv_cells) {
$offset = 0;
- //holds details on grades that have been successfully uploaded for the current line
+ // Holds details on grades that have been successfully uploaded for the current line
$uploadedgradecells = array();
for ($z = 0; $z < count($line); $z++) {
@@ -109,7 +109,7 @@ public function validate_csv($content, $encoding, $delimeter, $csv_cells) {
$class = "mod_coursework\\export\\csv\\cells\\".$cells[$i]."_cell";
$cell = new $class($this->coursework);
- //submission id field should always be first in the csv_cells array
+ // Submission id field should always be first in the csv_cells array
//
if ($cells[$i] == 'submissionid') {
$submissionid = $value;
@@ -117,21 +117,21 @@ public function validate_csv($content, $encoding, $delimeter, $csv_cells) {
if (empty($submissionid)) $errors[$s][] = get_string('emptysubmissionid', 'coursework');
- //offsets the position of that we extract the data from $line based on data that has been extracted before
+ // Offsets the position of that we extract the data from $line based on data that has been extracted before
if (($cells[$i] == "singlegrade" || $cells[$i] == "assessorgrade" || $cells[$i] == "agreedgrade")
&& $this->coursework->is_using_rubric() && !($cells[$i] == "agreedgrade" && $this->coursework->finalstagegrading == 1)) {
- //get the headers that would contain the rubric grade data
+ // Get the headers that would contain the rubric grade data
$rubricheaders = $cell->get_header(null);
- //find out the position of singlegrade
+ // Find out the position of singlegrade
$position = $i;
- //get all data from the position of the grade to the length of rubricheaders
+ // Get all data from the position of the grade to the length of rubricheaders
$rubriclinedata = array_slice($line, $position + $offset, count($rubricheaders), true);
- //pass the rubric data in
+ // Pass the rubric data in
$result = $cell->validate_cell($rubriclinedata, $submissionid, $stage_identifier, $uploadedgradecells);
$z = $z + count($rubricheaders)-1;
@@ -143,7 +143,7 @@ public function validate_csv($content, $encoding, $delimeter, $csv_cells) {
if ($result !== true) {
$errors[$s] = $result;
- break; //go to next line on error
+ break; // Go to next line on error
} else if ($cells[$i] == "singlegrade" || $cells[$i] == "assessorgrade" || $cells[$i] == "agreedgrade" && !empty($value)) {
$uploadedgradecells[] = $stage_identifier;
@@ -170,8 +170,8 @@ function rubric_count_correct($csvheader, $linefromimportedcsv) {
$typefound = false;
- //$typepositions holds the places in the array of all vcolumns with headers that
- //match the type e.g a column named singlegrade1 will match a singlegrade type
+ // $typepositions holds the places in the array of all vcolumns with headers that
+ // Match the type e.g a column named singlegrade1 will match a singlegrade type
$typepositions = false;
$i = 0;
@@ -190,7 +190,7 @@ function rubric_count_correct($csvheader, $linefromimportedcsv) {
if (!empty($typefound)) {
- //this var is needed to provide an offset so the positions in the array we are looking for
+ // This var is needed to provide an offset so the positions in the array we are looking for
//are correct even after a splice and add is carried out
$offset = 0;
@@ -203,10 +203,10 @@ function rubric_count_correct($csvheader, $linefromimportedcsv) {
unset($csvheader[$position + $offset]);
unset($linefromimportedcsv[$position + $offset]);
-// if ($type == 'agreedgrade' && $this->coursework->finalstagegrading == 0) {
+// if ($type == 'agreedgrade' && $this->coursework->finalstagegrading == 0) {
array_splice($csvheader, $position + $offset, 0, array_keys($headers));
array_splice($linefromimportedcsv, $position + $offset, 0, array(''));
-// }
+// }
$offset = $offset + count($headers) - 1;
$expectedsize = (int)sizeof($csvheader);
$actualsize = (int)sizeof($linefromimportedcsv);
@@ -289,14 +289,14 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
while ($line = $csvreader->next()) {
- //we will not process the content of any line that has been flagged up with an error
+ // We will not process the content of any line that has been flagged up with an error
if ( is_array($processingresults) && array_key_exists($s, $processingresults) ) {
$s++;
continue;
}
$csv = $this->remove_other_assessors_grade($csv_cells, $line);
- //gets the headers that should be being used in the uploaded csv
+ // Gets the headers that should be being used in the uploaded csv
//$cells = $this->get_rubric_headers($csv);
$cells = $csv;
$i = 0;
@@ -320,7 +320,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
$idfound = true;
}
- //save the value into the csvline with the relevant pointer
+ // Save the value into the csvline with the relevant pointer
if (isset($cells[$i])) $csvline[$cells[$i]] = $value;
$i++;
@@ -329,7 +329,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
$subdbrecord = $DB->get_record('coursework_submissions', array('id' => $submissionid));
$submission = \mod_coursework\models\submission::find($subdbrecord);
- //is this submission graded? if yes did this user grade it?
+ // Is this submission graded? if yes did this user grade it?
$coursework = $submission->get_coursework();
@@ -354,7 +354,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
$a = 1;
//defines the start offest to be used when searching for a rubric in a uploaded csv, if the format of upload
- //csv is changed this will require changing
+ // Csv is changed this will require changing
$rubricoffset = $rubricoffsetstart = ($coursework->is_configured_to_have_group_submissions()) ? 4 : 5;
@@ -362,7 +362,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
foreach ($stages as $k => $stage) {
- //when allocation is enabled
+ // When allocation is enabled
if (has_capability('mod/coursework:administergrades', $PAGE->context) && $coursework->allocation_enabled() && $stage != 'final_agreed_1' && $coursework->has_multiple_markers() == true) {
$rubricoffset += 1;
if ($a == 1) $rubricoffsetstart += 1;
@@ -393,9 +393,9 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
}
}
- //we need to carry out a further check to see if the coursework is using advanced grades.
- //if yes then we may need to generate the grade for the grade pointer as
- //they dont have grades
+ // We need to carry out a further check to see if the coursework is using advanced grades.
+ // If yes then we may need to generate the grade for the grade pointer as
+ // They dont have grades
if ($coursework->is_using_rubric() && !($stage == 'final_agreed_1' && $this->coursework->finalstagegrading == 1)) {
@@ -409,12 +409,12 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
$numberofrubrics = count($criterias) * 2;
- //if the stage is final agrade we need to make sure the offset is set to the position of the
+ // If the stage is final agrade we need to make sure the offset is set to the position of the
//agreed grades in the csv, this is needed as some users will only have agreed grade capability
if ($stage == 'final_agreed_1') {
$stagemultiplier = $numberofstages -1;
- //the calculation below finds the position of the agreed grades in the uploaded csv
+ // The calculation below finds the position of the agreed grades in the uploaded csv
$rubricoffset = $rubricoffsetstart + $stagemultiplier + ($numberofrubrics * $stagemultiplier);
@@ -442,11 +442,11 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
//for ( $critidx < $numberofrubrics; ) {
$critidx = 0;
- //this assumes that the data in the csv is in the correct criteria order.....it should be
+ // This assumes that the data in the csv is in the correct criteria order.....it should be
foreach ($criterias as $c) {
$criteriagrade = array();
- //we need to get the levelid for the value that the criteria has been given
+ // We need to get the levelid for the value that the criteria has been given
$levelid = $this->get_value_rubric_levelid($c, $rubricdata[$critidx]);
@@ -462,12 +462,12 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
$criteriagradedata = false;
}
- //need to decide where the grade instance submit and get grade should be put as in order
+ // Need to decide where the grade instance submit and get grade should be put as in order
- //pass the criteria data into the csvline position for the grade data so we can generate a grade
+ // Pass the criteria data into the csvline position for the grade data so we can generate a grade
$csvline[$gradepointer] = $criteriagradedata;
- //in case there is another rubric to be extracted from the csv set the new value of the rubric offset
+ // In case there is another rubric to be extracted from the csv set the new value of the rubric offset
} else if ($coursework->is_using_rubric() && ($stage == 'final_agreed_1' && $this->coursework->finalstagegrading == 1)) {
@@ -481,7 +481,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
$stagemultiplier = $numberofstages -1;
- //the calculation below finds the position of the agreed grades in the uploaded csv
+ // The calculation below finds the position of the agreed grades in the uploaded csv
$rubricoffset = $rubricoffsetstart + $stagemultiplier + ($numberofrubrics * $stagemultiplier);
@@ -570,7 +570,7 @@ public function add_grade($submissionid, $grade, $feedback, $stage_identifier, $
// assessor_1 is always marker 1
$markernumber = 1;
} else {
- // get all feedbacks and add 1
+ // get all feedbacks and add 1
$feedbacks = $DB->count_records('coursework_feedbacks', array('submissionid' => $submissionid));
$markernumber = $feedbacks +1;
}
@@ -585,9 +585,9 @@ public function add_grade($submissionid, $grade, $feedback, $stage_identifier, $
$add_grade->timecreated = time();
$add_grade->timemodified = time();
- //we cant save the grade if this coursework uses rubrics as the grade has not been generated and the grade var contains
- //criteria that will be used to genenrate the grade. We need the feedback id to do this so we need to make the feedback
- //first
+ // We cant save the grade if this coursework uses rubrics as the grade has not been generated and the grade var contains
+ // Criteria that will be used to genenrate the grade. We need the feedback id to do this so we need to make the feedback
+ // First
$add_grade->grade = (!$uses_rubric) ? $grade : null;
$add_grade->feedbackcomment = $feedback;
$add_grade->lasteditedbyuser = $USER->id;
@@ -599,7 +599,7 @@ public function add_grade($submissionid, $grade, $feedback, $stage_identifier, $
if ($uses_rubric) {
$controller = $this->coursework->get_advanced_grading_active_controller();
- //find out how many criteria there are
+ // Find out how many criteria there are
$gradinginstance = $controller->get_or_create_instance(0, $USER->id, $feedbackid);
$rubricgrade = $gradinginstance->submit_and_get_grade($grade, $feedbackid);
@@ -646,7 +646,7 @@ public function edit_grade($cwfeedbackid, $grade, $feedback, $uses_rubric=false)
$grade = $gradejudge->get_grade($grade);
} else {
$controller = $this->coursework->get_advanced_grading_active_controller();
- //find out how many criteria there are
+ // Find out how many criteria there are
$gradinginstance = $controller->get_or_create_instance(0, $USER->id, $cwfeedbackid);
$rubricgrade = $gradinginstance->submit_and_get_grade($grade, $cwfeedbackid);
$grade = $rubricgrade;
@@ -725,7 +725,7 @@ public function get_stage_identifier($submissionid, $cell_identifier) {
$record = $DB->get_record_sql($sql);
if (!empty($record)) {
$stage_identifier = $record->stage_identifier;
- }else if (!$this->coursework->sampling_enabled()) { //samplings disabled
+ }else if (!$this->coursework->sampling_enabled()) { // Samplings disabled
// workout if any stage is still available
$sql = "SELECT count(*) as graded FROM {coursework_feedbacks}
WHERE submissionid = $submissionid
diff --git a/classes/file_importer.php b/classes/file_importer.php
index 7cd92add..b85d0263 100644
--- a/classes/file_importer.php
+++ b/classes/file_importer.php
@@ -34,7 +34,7 @@ public function extract_zip_file($filename, $contextid) {
global $USER;
- //raise_memory_limit(MEMORY_EXTRA);
+ // Raise_memory_limit(MEMORY_EXTRA);
//@set_time_limit(ASSIGNFEEDBACK_FILE_MAXFILEUNZIPTIME);
$packer = get_file_packer('application/zip');
@@ -124,7 +124,7 @@ public function import_zip_files($coursework, $feedbackstage, $overwritecurrent)
if ($submission->get_state() < \mod_coursework\models\submission::PUBLISHED) {
- //if only add/edit initial capability then workout stage identifier
+ // If only add/edit initial capability then workout stage identifier
if ($feedbackstage == 'initialassessor') {
$feedback = $DB->get_record('coursework_feedbacks', array('submissionid' => $submission->id, 'assessorid' => $USER->id ));
@@ -182,7 +182,7 @@ public function import_zip_files($coursework, $feedbackstage, $overwritecurrent)
}
}
- //clear up the files that have not been moved to the mod_coursework area
+ // Clear up the files that have not been moved to the mod_coursework area
$this->delete_import_files($contextid);
return $results;
diff --git a/classes/forms/upload_allocations_form.php b/classes/forms/upload_allocations_form.php
index 04f86cb2..795d2847 100644
--- a/classes/forms/upload_allocations_form.php
+++ b/classes/forms/upload_allocations_form.php
@@ -39,7 +39,7 @@ function definition() {
$mform->addElement('filepicker', 'allocationsdata', get_string('allocationsfile', 'coursework'), null, array( 'accepted_types' => '*.csv'));
$mform->addRule('allocationsdata', null, 'required');
- // $mform->addElement('checkbox', 'overwrite', '', get_string('overwritegrades', 'coursework'));
+ // $mform->addElement('checkbox', 'overwrite', '', get_string('overwritegrades', 'coursework'));
$mform->addElement('hidden', 'cmid', $this->cmid);
$mform->setType('cmid', PARAM_RAW);
diff --git a/classes/forms/upload_feedback_form.php b/classes/forms/upload_feedback_form.php
index 4436ba17..bde45e63 100644
--- a/classes/forms/upload_feedback_form.php
+++ b/classes/forms/upload_feedback_form.php
@@ -24,8 +24,8 @@
class upload_feedback_form extends moodleform {
- private $cmid;
- private $coursework;
+ private $cmid;
+ private $coursework;
function __construct($coursework, $cmid) {
$this->cmid = $cmid;
diff --git a/classes/grading_report.php b/classes/grading_report.php
index 4bc457c3..4aa19275 100644
--- a/classes/grading_report.php
+++ b/classes/grading_report.php
@@ -78,7 +78,7 @@ class grading_report {
/**
* @var cell_interface[]
*/
- private $cells;
+ private $cells;
/**
* Grades in $data must be already rounded to the set number of decimals or must be null
diff --git a/classes/models/coursework.php b/classes/models/coursework.php
index b1da7eea..7e70851e 100644
--- a/classes/models/coursework.php
+++ b/classes/models/coursework.php
@@ -1392,8 +1392,8 @@ static function get_name_hash($id, $userid, $time=1440000609) {
$uhash = $id . $userid;
- //hash with zero have the potential to become changed in outside programs
- //so we generate a hash without a leading zero
+ // Hash with zero have the potential to become changed in outside programs
+ // So we generate a hash without a leading zero
$uhash = substr(md5($uhash), 0, 8);
$uhash = 'X' . $uhash;
@@ -2288,7 +2288,7 @@ public function get_allocatables() {
$groups = $DB->get_records_sql($sql, $params);
foreach ($groups as $group) {
$group = group::find($group);
- //find out if members of this group can access this coursework, if group is left without members then remove it
+ // Find out if members of this group can access this coursework, if group is left without members then remove it
$cm = $this->get_course_module();
$cmobject = $this->cm_object($cm);
/**
diff --git a/classes/models/outstanding_marking.php b/classes/models/outstanding_marking.php
index 0ef787f8..eeed8442 100644
--- a/classes/models/outstanding_marking.php
+++ b/classes/models/outstanding_marking.php
@@ -24,7 +24,7 @@
class outstanding_marking {
- private $day_in_secs;
+ private $day_in_secs;
public function __construct() {
@@ -99,7 +99,7 @@ private function get_single_marker_initial_grade_submissions_to_mark($coursework
$sqlextra = "";
if ($allocationenabled) {
- //we only have to check for submissions allocated to this user
+ // We only have to check for submissions allocated to this user
$sqltable = ", {coursework_allocation_pairs} cap ";
$sqlextra = " AND cap.courseworkid = cs.courseworkid
@@ -180,7 +180,7 @@ private function get_multiple_to_mark_initial_grade_submissions($courseworkid, $
$sqlextra = '';
if ($allocationenabled) {
- //we only have to check for submissions allocated to this user
+ // We only have to check for submissions allocated to this user
$sqltable = ", {coursework_allocation_pairs} cap ";
$sqlextra = "
@@ -302,7 +302,7 @@ private function should_get_to_mark_initial_grade_info($courseworkid, $userid) {
$coursework = new \mod_coursework\models\coursework($courseworkid);
- //findout if the user can create an initial grade
+ // Findout if the user can create an initial grade
$user_has_initial_grade_capability = $this->has_initial_grade($coursework->get_course()->id, $userid);
return $user_has_initial_grade_capability;
@@ -317,7 +317,7 @@ private function should_get_to_mark_agreed_grade_info($courseworkid, $userid) {
$coursework = new \mod_coursework\models\coursework($courseworkid);
- //findout if the user can create an initial grade
+ // Findout if the user can create an initial grade
$user_has_agreed_grade_capability = $this->has_agreed_grade($coursework->get_course()->id, $userid);
return $user_has_agreed_grade_capability;
diff --git a/classes/models/sample_set_rule.php b/classes/models/sample_set_rule.php
index 9933104b..4d4097f0 100644
--- a/classes/models/sample_set_rule.php
+++ b/classes/models/sample_set_rule.php
@@ -106,7 +106,7 @@ public function __construct($coursework) {
$this->coursework = $coursework;
- //parent::__construct($dbrecord);
+ // Parent::__construct($dbrecord);
// We cannot set this from outside if we are making a new one.
if (!isset($this->ruleorder)) {
diff --git a/classes/models/submission.php b/classes/models/submission.php
index e08d8edf..de410876 100644
--- a/classes/models/submission.php
+++ b/classes/models/submission.php
@@ -261,7 +261,7 @@ public static function unfinalised_past_deadline() {
if ($deadline < time()) {
// if deadline passed check if extension exists
if ($submission->has_extension()) {
- //check if extension is valid
+ // Check if extension is valid
$extension = $submission->submission_extension();
if ($extension->extended_deadline > time()) {
//unset as it doesn't need to be autofinalise yet
@@ -769,7 +769,7 @@ public function get_author_id() {
$id = $USER->id;
- //if this is a submission on behalf of the student and it is a group submission we have to make sure
+ // If this is a submission on behalf of the student and it is a group submission we have to make sure
// the author is the first member of the group
if ($this->is_submission_on_behalf()) {
@@ -1470,7 +1470,7 @@ function has_specific_assessor_feedback($assessorid) {
return (empty($feedback)) ? false : $feedback;
}
- //caching
+ // Caching
/**
* cache array
diff --git a/classes/render_helpers/grading_report/cells/_user_cell.php b/classes/render_helpers/grading_report/cells/_user_cell.php
index e3f251da..a87135ed 100644
--- a/classes/render_helpers/grading_report/cells/_user_cell.php
+++ b/classes/render_helpers/grading_report/cells/_user_cell.php
@@ -72,7 +72,7 @@ public function get_table_header($options = array()) {
$viewanonymous = has_capability('mod/coursework:viewanonymous', $this->coursework->get_context());
//adding this line so that the sortable heading function will make a sortable link unique to the table
- //if tablename is set
+ // If tablename is set
$tablename = (!empty($options['tablename'])) ? $options['tablename'] : '' ;
// allow to sort users only if CW is not set to blind marking or a user has capability to view anonymous
diff --git a/classes/render_helpers/grading_report/cells/cell_base.php b/classes/render_helpers/grading_report/cells/cell_base.php
index f7e481bc..7fb04a8b 100644
--- a/classes/render_helpers/grading_report/cells/cell_base.php
+++ b/classes/render_helpers/grading_report/cells/cell_base.php
@@ -77,8 +77,8 @@ protected function helper_sortable_heading($display_name, $field, $sort_how, $so
// Need a little icon to show ASC or DESC.
// if ($field == $sortby) {
- // $display_name .= ' '; // Keep them on the same line.
- // $display_name .= $sort_how == 'ASC' ? '▲' : '▼'; // Small unicode triangles.
+ // $display_name .= ' '; // Keep them on the same line.
+ // $display_name .= $sort_how == 'ASC' ? '▲' : '▼'; // Small unicode triangles.
// }
// return html_writer::link($url, $display_name);
diff --git a/classes/render_helpers/grading_report/cells/group_cell.php b/classes/render_helpers/grading_report/cells/group_cell.php
index 443f2406..c9ae602b 100644
--- a/classes/render_helpers/grading_report/cells/group_cell.php
+++ b/classes/render_helpers/grading_report/cells/group_cell.php
@@ -73,7 +73,7 @@ public function get_table_cell($row_object) {
public function get_table_header($options = array()) {
//adding this line so that the sortable heading function will make a sortable link unique to the table
- //if tablename is set
+ // If tablename is set
$tablename = (isset($options['tablename'])) ? $options['tablename'] : '' ;
return $this->helper_sortable_heading(get_string('tableheadgroups', 'coursework'),
diff --git a/classes/render_helpers/grading_report/cells/idnumber_cell.php b/classes/render_helpers/grading_report/cells/idnumber_cell.php
index 132e983d..593d2d66 100644
--- a/classes/render_helpers/grading_report/cells/idnumber_cell.php
+++ b/classes/render_helpers/grading_report/cells/idnumber_cell.php
@@ -52,7 +52,7 @@ public function get_table_header($options = array()) {
$viewanonymous = has_capability('mod/coursework:viewanonymous', $this->coursework->get_context());
//adding this line so that the sortable heading function will make a sortable link unique to the table
- //if tablename is set
+ // If tablename is set
$tablename = (!empty($options['tablename'])) ? $options['tablename'] : '' ;
// allow to sort users only if CW is not set to blind marking or a user has capability to view anonymous
diff --git a/classes/render_helpers/grading_report/cells/moderation_cell.php b/classes/render_helpers/grading_report/cells/moderation_cell.php
index d9bc2b99..eafb4f70 100644
--- a/classes/render_helpers/grading_report/cells/moderation_cell.php
+++ b/classes/render_helpers/grading_report/cells/moderation_cell.php
@@ -86,7 +86,7 @@ public function get_table_cell($row_object) {
public function get_table_header($options = array()) {
//adding this line so that the sortable heading function will make a sortable link unique to the table
- //if tablename is set
+ // If tablename is set
$tablename = (!empty($options['tablename'])) ? $options['tablename'] : '' ;
return $this->helper_sortable_heading(get_string('moderator', 'coursework'),
diff --git a/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php b/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
index 2d947ef8..b5e50755 100644
--- a/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
+++ b/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
@@ -65,7 +65,7 @@ public function get_content($rowobject) {
global $USER, $OUTPUT;
- //if coursework uses sampling check if any enabled for this submission, otherwise there is no agreed grade
+ // If coursework uses sampling check if any enabled for this submission, otherwise there is no agreed grade
if ($rowobject->get_coursework()->sampling_enabled() && $rowobject->get_submission() && !$rowobject->get_submission()->sampled_feedback_exists()) {
$content = get_string('singlemarker', 'coursework');
return $content;
@@ -79,8 +79,8 @@ public function get_content($rowobject) {
if ($finalfeedback !== false) {
$grade_judge = new grade_judge($this->coursework);
$content .= $grade_judge->grade_to_display($finalfeedback->get_grade());
- // $content .= html_writer::empty_tag('br');
- // $content .= ' by: ' . $finalfeedback->get_assesor_username();
+ // $content .= html_writer::empty_tag('br');
+ // $content .= ' by: ' . $finalfeedback->get_assesor_username();
}
// Edit/new link
@@ -113,7 +113,7 @@ public function get_content($rowobject) {
);
$new_feedback = feedback::build($feedback_params);
- //if the user is a site admin then they can add final feedback
+ // If the user is a site admin then they can add final feedback
if ($ability->can('new', $new_feedback) || is_siteadmin()) {
$title = get_string('addfinalfeedback', 'coursework');
$feedback_route_params = array(
@@ -168,7 +168,7 @@ public function get_content($rowobject) {
public function get_table_header($options = array()) {
//adding this line so that the sortable heading function will make a sortable link unique to the table
- //if tablename is set
+ // If tablename is set
$tablename = (isset($options['tablename'])) ? $options['tablename'] : '' ;
$column_name = get_string('agreedgrade', 'coursework');
diff --git a/classes/render_helpers/grading_report/cells/time_submitted_cell.php b/classes/render_helpers/grading_report/cells/time_submitted_cell.php
index 88460882..158559d2 100644
--- a/classes/render_helpers/grading_report/cells/time_submitted_cell.php
+++ b/classes/render_helpers/grading_report/cells/time_submitted_cell.php
@@ -198,7 +198,7 @@ private function standardize_time_for_compare($time) {
public function get_table_header($options = array()) {
//adding this line so that the sortable heading function will make a sortable link unique to the table
- //if tablename is set
+ // If tablename is set
$tablename = (!empty($options['tablename'])) ? $options['tablename'] : '' ;
return $this->helper_sortable_heading(get_string('tableheadsubmissiondate', 'coursework'),
diff --git a/classes/render_helpers/grading_report/cells/user_cell.php b/classes/render_helpers/grading_report/cells/user_cell.php
index b8d09681..b9b0d95b 100644
--- a/classes/render_helpers/grading_report/cells/user_cell.php
+++ b/classes/render_helpers/grading_report/cells/user_cell.php
@@ -79,7 +79,7 @@ public function get_table_header($options = array()) {
$viewanonymous = has_capability('mod/coursework:viewanonymous', $this->coursework->get_context());
//adding this line so that the sortable heading function will make a sortable link unique to the table
- //if tablename is set
+ // If tablename is set
$tablename = (!empty($options['tablename'])) ? $options['tablename'] : '' ;
// allow to sort users only if CW is not set to blind marking or a user has capability to view anonymous
diff --git a/classes/renderers/personal_deadline_renderer.php b/classes/renderers/personal_deadline_renderer.php
index 9b9ffcea..c0f81d59 100644
--- a/classes/renderers/personal_deadline_renderer.php
+++ b/classes/renderers/personal_deadline_renderer.php
@@ -44,7 +44,7 @@ public function new_page($vars) {
$html = '';
- //if page has been accessed via the set personal deadline page then we dont want to say who set the last personal
+ // If page has been accessed via the set personal deadline page then we dont want to say who set the last personal
//deadline
if (empty($vars['params']['multipleuserdeadlines'])) {
$allocatable = $vars['personal_deadline']->get_allocatable();
diff --git a/classes/sample_set_rule/range_sample_type.php b/classes/sample_set_rule/range_sample_type.php
index 112c30ef..63e9a3ea 100644
--- a/classes/sample_set_rule/range_sample_type.php
+++ b/classes/sample_set_rule/range_sample_type.php
@@ -177,19 +177,19 @@ public function add_form_elements_js($assessor_number=0) {
var spanClone = $('div.'+linkid[0] + '_' + linkid[1] +'_grade_rules').first().clone(true);
- //find out how many rule spans exist
+ // Find out how many rule spans exist
var gradeSpans = $('div.'+linkid[0] + '_' + linkid[1] +'_grade_rules');
if (gradeSpans.length < 5) {
- //put a new line in
+ // Put a new line in
- //rename the select box ids
+ // Rename the select box ids
spanClone.find('select').each(function (n, ele) {
var elename = $(ele).attr('id').split('_');
$(ele).attr('id', elename[0] + '_' + elename[1] + '_' + elename[2] + '_' + gradeSpans.length);
});
- //rename the checkbox
+ // Rename the checkbox
spanClone.find('input').each(function (n, ele) {
var elename = $(ele).attr('id').split('_');
$(ele).attr('id', elename[0] + '_' + elename[1] + '_' + elename[2] + '_' + gradeSpans.length);
@@ -201,7 +201,7 @@ public function add_form_elements_js($assessor_number=0) {
//spanClone.appendTo($('#'+linkid[0] + '_' + linkid[1]+'_grade_rules_0').parent());
spanClone.insertAfter($('div.'+linkid[0] + '_' + linkid[1] +'_grade_rules').last());
- //make sure the from and to selects are set to the correct type
+ // Make sure the from and to selects are set to the correct type
change_options($('#'+linkid[0] + '_' + linkid[1] + '_sampletype_' + gradeSpans.length));
@@ -210,7 +210,7 @@ public function add_form_elements_js($assessor_number=0) {
});
})
- //remove grade rule buttons
+ // Remove grade rule buttons
$('.removegradderule').each(function(e,element) {
$(element).on('click',function (e) {
@@ -222,7 +222,7 @@ public function add_form_elements_js($assessor_number=0) {
if ($('#'+linkid[0] + '_' + linkid[1] + '_samplingstrategy').val() == AUTOMATIC_SAMPLING) {
- //find out how many rule spans exist
+ // Find out how many rule spans exist
var gradeSpans = $(spanclass);
if (gradeSpans.length > 1) {
$(spanclass).last().remove();
@@ -262,7 +262,7 @@ public function add_form_elements_js($assessor_number=0) {
})
});
- //grade rule drop downs
+ // Grade rule drop downs
$('.grade_type').each(function(e,element) {
$(element).on('change',function() {
@@ -280,7 +280,7 @@ function change_options(element) {
var samplefromid = '#'+ele_id[0]+'_'+ele_id[1]+'_samplefrom_'+ele_id[3];
var sampletoid = '#'+ele_id[0]+'_'+ele_id[1]+'_sampleto_'+ele_id[3];
- //remove the contents from the grade rule from and to drop downs
+ // Remove the contents from the grade rule from and to drop downs
$(samplefromid).find('option').remove();
$(sampletoid).find('option').remove();
@@ -427,7 +427,7 @@ private function rationalise($ruletype, $limit1, $limit2) {
$limits[0] = ceil($limits[0]/$weighting); // element of array
$limits[1] = ceil($limits[1]/$weighting); // element of array
- //note we have to add one as the values are not stored in there element positions
+ // Note we have to add one as the values are not stored in there element positions
}
@@ -450,7 +450,7 @@ private function get_allocatables_in_range($stage, $limit1, $limit2) {
AND stage_identifier = :stage
AND $gradesql BETWEEN {$limit1} AND {$limit2}";
- //note as things stand limit1 and limit2 can not be params as the type of the grade field (varchar)
+ // Note as things stand limit1 and limit2 can not be params as the type of the grade field (varchar)
//means the values are cast as strings
return $DB->get_records_sql($sql, array('courseworkid' => $this->coursework->id,
diff --git a/classes/sample_set_rule/total_sample_type.php b/classes/sample_set_rule/total_sample_type.php
index 819fb623..726acf8c 100644
--- a/classes/sample_set_rule/total_sample_type.php
+++ b/classes/sample_set_rule/total_sample_type.php
@@ -125,7 +125,7 @@ function save_form_data($assessor_number=0, &$order=0) {
$dbrecord->ruletype = "";
$dbrecord->lowerlimit = 0;
$dbrecord->upperlimit = $sample_total;
- $dbrecord->sample_set_plugin_id = 2; //TODO: THIS SHOULD NOT BE HARD CODED - AF
+ $dbrecord->sample_set_plugin_id = 2; // TODO: THIS SHOULD NOT BE HARD CODED - AF
$dbrecord->courseworkid = $this->coursework->id;
$dbrecord->ruleorder = $order;
$dbrecord->stage_identifier = "assessor_{$assessor_number}";
@@ -165,22 +165,22 @@ public function adjust_sample_set($stage_number, &$allocatables, &$manual_sample
$total_to_return = ceil(($rule->upperlimit/100) * $number_of_alloctables);
- //we include the manual sample set in the count
+ // We include the manual sample set in the count
// TODO: should we do this?
$total_to_return -= count($manual_sample_set);
- //if the resultant number isnt greater than 0 then no automatic sample allocatables will be used
+ // If the resultant number isnt greater than 0 then no automatic sample allocatables will be used
if ($total_to_return > 0) {
//use array chunk to split auto sample set into chunks we will only use the first chunk
if ($chunked_array = array_chunk($auto_sample_set, $total_to_return, true)) $auto_sample_set = $chunked_array[0];
- //if the number in the sample set is less than the total to return
+ // If the number in the sample set is less than the total to return
if (count($auto_sample_set) < $total_to_return) {
- //we need to top up the sample set with other allocatables
+ // We need to top up the sample set with other allocatables
- //graded at the previous stage take precedence
+ // Graded at the previous stage take precedence
$previous_stage_number = $stage_number - 1;
@@ -199,19 +199,19 @@ public function adjust_sample_set($stage_number, &$allocatables, &$manual_sample
}
}
- //if this is not enough select anyone (which should == the ungraded as all graded should have been added)
+ // If this is not enough select anyone (which should == the ungraded as all graded should have been added)
if (count($auto_sample_set) < $total_to_return) {
- //remove allocatables with published submissions
+ // Remove allocatables with published submissions
$allocatable_sample_set = array_diff_ukey($allocatables, $published, array("mod_coursework\\sample_set_rule\\total_sample_type", "compare_key"));
- //remove allocatables with finalised submissions
+ // Remove allocatables with finalised submissions
$allocatable_sample_set = array_diff_ukey($allocatable_sample_set, $finalised, array("mod_coursework\\sample_set_rule\\total_sample_type", "compare_key"));
- //remove allocatables who have been manually selected
+ // Remove allocatables who have been manually selected
$allocatable_sample_set = array_diff_ukey($allocatable_sample_set, $manual_sample_set, array("mod_coursework\\sample_set_rule\\total_sample_type", "compare_key"));
- //remove allocatables already in the sample set
+ // Remove allocatables already in the sample set
$allocatable_sample_set = array_diff_ukey($allocatable_sample_set, $auto_sample_set, array("mod_coursework\\sample_set_rule\\total_sample_type", "compare_key"));
$array_keys = array_rand($allocatable_sample_set, $total_to_return - count($auto_sample_set));
diff --git a/classes/stages/base.php b/classes/stages/base.php
index 6dd156e4..1ca1a8aa 100644
--- a/classes/stages/base.php
+++ b/classes/stages/base.php
@@ -296,8 +296,8 @@ public function get_teachers() {
$serialised_teachers = $cache->get($this->coursework->id()."_teachers");
- //there is a chance that when the teachers were initially cached the dataset was empty
- //so check again
+ // There is a chance that when the teachers were initially cached the dataset was empty
+ // So check again
if (empty($serialised_teachers) || empty(unserialize($serialised_teachers))) {
$teachers = get_enrolled_users($this->coursework->get_context(), $this->assessor_capability());
$teacher_users = array();
@@ -907,7 +907,7 @@ private function in_editable_period($allocatable) {
$result = $this->get_coursework()->get_grade_editing_time();
- //the feedback is not in the editable period if the editable setting is disabled
+ // The feedback is not in the editable period if the editable setting is disabled
if (empty($this->get_coursework()->get_grade_editing_time())) return false;
$coursework_id = $this->get_coursework_id();
diff --git a/classes/warnings.php b/classes/warnings.php
index 952974f6..e02e8de3 100644
--- a/classes/warnings.php
+++ b/classes/warnings.php
@@ -129,7 +129,7 @@ public function students_in_mutiple_grouos() {
if (!has_capability('mod/coursework:addinitialgrade', $this->coursework->get_context(), $student->userid)) {
$studentmessage .= '
' . $student->firstname . ' ' . $student->lastname;
- //get group ids of these students
+ // Get group ids of these students
if ($this->coursework->grouping_id) {
$sql = "SELECT groups.id,groups.name
diff --git a/db/install.php b/db/install.php
index 80822a03..3f8a2049 100644
--- a/db/install.php
+++ b/db/install.php
@@ -25,7 +25,7 @@
function xmldb_coursework_install() {
global $DB;
- //install the plugins used by sampling in the correct order
+ // Install the plugins used by sampling in the correct order
$plugins = array('range_sample_type', 'total_sample_type');
$i = 1;
diff --git a/db/upgrade.php b/db/upgrade.php
index e0919aeb..e98d9915 100644
--- a/db/upgrade.php
+++ b/db/upgrade.php
@@ -1989,7 +1989,7 @@ function xmldb_coursework_upgrade($oldversion) {
if (!$dbman->table_exists($table)) {
$dbman->create_table($table);
- //now create plugin records for sample set plugins
+ // Now create plugin records for sample set plugins
$plugins = array('range_sample_type', 'total_sample_type');
$i = 1;
@@ -2284,12 +2284,12 @@ function xmldb_coursework_upgrade($oldversion) {
$coursework = coursework::find($coursework);
if ($coursework->marking_deadline_enabled() && $coursework->initialmarkingdeadline) {
- //create initialgradingdue event
+ // Create initialgradingdue event
coursework_update_events($coursework, 'initialgradingdue');
}
if ($coursework->marking_deadline_enabled() && $coursework->agreedgrademarkingdeadline) {
- //create agreedgradegradingdue event
+ // Create agreedgradegradingdue event
coursework_update_events($coursework, 'agreedgradingdue');
}
}
diff --git a/index.php b/index.php
index 765b7986..ba70f2a5 100644
--- a/index.php
+++ b/index.php
@@ -20,7 +20,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-/// Replace coursework with the name of your module and remove this line
+// Replace coursework with the name of your module and remove this line
require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once(dirname(__FILE__).'/lib.php');
diff --git a/lib.php b/lib.php
index d0a23f5c..693c2907 100644
--- a/lib.php
+++ b/lib.php
@@ -159,8 +159,8 @@ function coursework_add_instance($formdata) {
// You may have to add extra stuff in here.
- //we have to check to see if this coursework has a deadline ifm it doesn't we need to set the
- //deadline to zero
+ // We have to check to see if this coursework has a deadline ifm it doesn't we need to set the
+ // Deadline to zero
$formdata->deadline = empty($formdata->deadline) ? 0 : $formdata->deadline;
$subnotify = '';
@@ -173,7 +173,7 @@ function coursework_add_instance($formdata) {
}
$formdata->submissionnotification = $subnotify;
- //if blindmarking is set we will rename files
+ // If blindmarking is set we will rename files
if ($formdata->blindmarking == 1) {
$formdata->renamefiles = 1;
@@ -184,17 +184,17 @@ function coursework_add_instance($formdata) {
$formdata->id = $returnid;
// IMPORTANT: at this point, the coursemodule will be in existence, but will
- // not have the coursework id saved, because we only just made it.
+ // Not have the coursework id saved, because we only just made it.
$coursemodule = $DB->get_record('course_modules', array('id' => $formdata->coursemodule));
$coursemodule->instance = $returnid;
// This is doing what will be done later by the core routines. Makes it simpler to use existing
- // code without special cases.
+ // Code without special cases.
$DB->update_record('course_modules', $coursemodule);
// Get all the other data e.g. coursemodule.
$coursework = coursework::find($returnid);
- //create event for coursework deadline [due]
+ // Create event for coursework deadline [due]
if ($coursework && $coursework->deadline) {
$event = coursework_event($coursework, format_module_intro('coursework', $coursework,
$coursemodule->id), $returnid, 'due', $coursework->deadline);
@@ -202,7 +202,7 @@ function coursework_add_instance($formdata) {
calendar_event::create($event);
}
- //create event for coursework initialmarking deadline [initialgradingdue]
+ // Create event for coursework initialmarking deadline [initialgradingdue]
if ($coursework && $coursework->marking_deadline_enabled() && $coursework->initialmarkingdeadline) {
$event = coursework_event($coursework, format_module_intro('coursework', $coursework,
$coursemodule->id), $returnid, 'initialgradingdue', $coursework->initialmarkingdeadline);
@@ -210,7 +210,7 @@ function coursework_add_instance($formdata) {
calendar_event::create($event);
}
- //create event for coursework agreedgrademarking deadline [agreedgradingdue]
+ // Create event for coursework agreedgrademarking deadline [agreedgradingdue]
if ($coursework && $coursework->marking_deadline_enabled() && $coursework->agreedgrademarkingdeadline && $coursework->has_multiple_markers()) {
$event = coursework_event($coursework, format_module_intro('coursework', $coursework,
$coursemodule->id), $returnid, 'agreedgradingdue', $coursework->agreedgrademarkingdeadline);
@@ -278,19 +278,19 @@ function mod_coursework_core_calendar_provide_event_action(calendar_event $event
$student = $coursework->can_submit();
$marker = $coursework->is_assessor($user);
- if ($marker) { // for markers
+ if ($marker) { // For markers
- // check how many submissions to mark
+ // Check how many submissions to mark
$outstandingmarking = new outstanding_marking();
if ($event->eventtype == 'initialgradingdue') {
- //initial grades
+ // Initial grades
$togradeinitialcount = $outstandingmarking->get_to_grade_initial_count($dbcoursework, $user->id());
$name = ($coursework->has_multiple_markers())? get_string('initialgrade', 'coursework') : get_string('grade', 'mod_coursework');
$itemcount = $togradeinitialcount ;
} else if ($event->eventtype == 'agreedgradingdue') {
- //agreed grades
+ // Agreed grades
$togradeagreedcount = $outstandingmarking->get_to_grade_agreed_count($dbcoursework, $user->id());
$name = get_string('agreedgrade', 'coursework');
$itemcount = $togradeagreedcount;
@@ -314,7 +314,7 @@ function mod_coursework_core_calendar_provide_event_action(calendar_event $event
if (!$submission) {
$submission = $new_submission;
}
- // check if user can still submit
+ // Check if user can still submit
$ability = new ability($user, $coursework);
if (!$submission || $ability->can('new', $submission)) {
$name = get_string('addsubmission', 'coursework');
@@ -447,7 +447,7 @@ function coursework_update_instance($coursework) {
$courseworkhassubmissions = ($DB->get_records('coursework_submissions', array('courseworkid' => $coursework->id)))
? true : false;
- //if the coursework has submissions then we the renamefiles setting can't be changes
+ // If the coursework has submissions then we the renamefiles setting can't be changes
if ($courseworkhassubmissions) {
$currentcoursework = $DB->get_record('coursework', array('id' => $coursework->id));
@@ -493,25 +493,25 @@ function coursework_update_instance($coursework) {
}
- // update event for calendar(cw name/deadline) if a coursework has a deadline
+ // Update event for calendar(cw name/deadline) if a coursework has a deadline
if ($coursework->deadline) {
- coursework_update_events($coursework, 'due'); //cw deadline
+ coursework_update_events($coursework, 'due'); // Cw deadline
if ($coursework->initialmarkingdeadline) {
- //update
- coursework_update_events($coursework, 'initialgradingdue'); //cw initial grading deadine
+ // Update
+ coursework_update_events($coursework, 'initialgradingdue'); // Cw initial grading deadine
} else {
- //remove it
+ // Remove it
remove_event($coursework, 'initialgradingdue');
}
if ($coursework->agreedgrademarkingdeadline && $coursework->numberofmarkers > 1) {
- //update
- coursework_update_events($coursework, 'agreedgradingdue'); //cw agreed grade deadine
+ // Update
+ coursework_update_events($coursework, 'agreedgradingdue'); // Cw agreed grade deadine
} else {
- //remove it
+ // Remove it
remove_event($coursework, 'agreedgradingdue' );
}
} else {
- // remove all deadline events for this coursework regardless the type
+ // Remove all deadline events for this coursework regardless the type
remove_event($coursework);
}
@@ -533,33 +533,33 @@ function coursework_update_events($coursework, $eventtype) {
$event = calendar_event::load($eventid->id);
}
- // update/create event for coursework deadline [due]
+ // Update/create event for coursework deadline [due]
if ($eventtype == 'due') {
$data = coursework_event($coursework, $coursework->intro, $coursework->id, $eventtype, $coursework->deadline);
if ($event) {
$event->update($data); //update if event exists
} else {
- calendar_event::create($data); //create new event as it doesn't exist
+ calendar_event::create($data); // Create new event as it doesn't exist
}
}
- // update/create event for coursework initialmarking deadline [initialgradingdue]
+ // Update/create event for coursework initialmarking deadline [initialgradingdue]
if ($eventtype == 'initialgradingdue') {
$data = coursework_event($coursework, $coursework->intro, $coursework->id, $eventtype, $coursework->initialmarkingdeadline);
if ($event) {
$event->update($data); //update if event exists
} else {
- calendar_event::create($data); //create new event as it doesn't exist
+ calendar_event::create($data); // Create new event as it doesn't exist
}
}
- // update/create event for coursework agreedgrademarking deadline [agreedgradingdue]
+ // Update/create event for coursework agreedgrademarking deadline [agreedgradingdue]
if ($eventtype == 'agreedgradingdue') {
$data = coursework_event($coursework, $coursework->intro, $coursework->id, $eventtype, $coursework->agreedgrademarkingdeadline);
if ($event) {
$event->update($data); //update if event exists
} else {
- calendar_event::create($data); //create new event as it doesn't exist
+ calendar_event::create($data); // Create new event as it doesn't exist
}
}
}
@@ -906,7 +906,7 @@ function coursework_extend_settings_navigation(settings_navigation $settings, na
function coursework_role_assigned_event_handler($roleassignment) {
global $DB;
-// return true; // Until we fix the auto allocator. The stuff below causes an infinite loop.
+// return true; // Until we fix the auto allocator. The stuff below causes an infinite loop.
$courseworkids = coursework_get_coursework_ids_from_context_id($roleassignment->contextid);
@@ -1108,8 +1108,7 @@ function coursework_send_deadline_changed_emails($eventdata) {
// Now we need a decent message that provides the relevant data and notifies what changed.
// - Submissions deadline if it's in the future and the user has not already submitted.
- // - Feedback deadline if it's in the future and the student's personal deadline for feedback has
- // not passed.
+ // - Feedback deadline if it's in the future and the student's personal deadline for feedback has not passed.
// - Link to get to the view.php page.
// - Change since last time.
@@ -1286,11 +1285,11 @@ function course_group_member_added($event_data) {
if ($initial_stage_assessor) {
// check if any assessor already exists in the group except currently added one
$assessors_in_group = get_enrolled_users($coursework->get_context(), 'mod/coursework:addinitialgrade', $groupid);
- unset($assessors_in_group[$addeduserid]); //remove added assessor as at this point they will be already in the group
+ unset($assessors_in_group[$addeduserid]); // Remove added assessor as at this point they will be already in the group
if ($assessors_in_group) {//yes - do nothing as other assessor is already assigned to group members, return true
break;
- } else{ //no - check if CW is a group coursework
+ } else{ // No - check if CW is a group coursework
if ($coursework->is_configured_to_have_group_submissions()) {// yes - assign the tutor to a allocatable group
$stage_1->make_auto_allocation_if_necessary(group::find($groupid));
} else { // no, check if group has any student members
@@ -1401,7 +1400,7 @@ function course_group_member_removed($event_data) {
}
} else {
- //if individual coursework
+ // If individual coursework
$allocatableid = $removeduserid;
}
diff --git a/mod_form.php b/mod_form.php
index 2d4d91b8..8e184b0d 100644
--- a/mod_form.php
+++ b/mod_form.php
@@ -1040,7 +1040,7 @@ protected function add_individual_feedback_release_date_field() {
$moodle_form->disabledIf('individualfeedback', 'forceautorelease', 'eq', 1);
}
$moodle_form->disabledIf('individualfeedback', 'deadline[enabled]', 'notchecked');
-// $moodle_form->addRule(array('individualfeedback', 'deadline'), get_string('must_be_after_dealdine', 'mod_coursework'), 'compare', 'gt');
+// $moodle_form->addRule(array('individualfeedback', 'deadline'), get_string('must_be_after_dealdine', 'mod_coursework'), 'compare', 'gt');
}
/**
@@ -1113,16 +1113,16 @@ protected function add_tweaks_to_standard_grading_form_elements() {
$moodle_form->disabledIf('finalstagegrading', 'feedbackexists', 'eq', 1);
// Don't think this belongs here...
-// $options = array(0 => get_string('no'), 1 => get_string('yes'));
-// $moodle_form->addElement('select', 'automaticagreement', get_string('automaticagreement', 'mod_coursework'), $options);
-// $moodle_form->addHelpButton('automaticagreement', 'automaticagreement', 'mod_coursework');
-// $moodle_form->setDefault('automaticagreement',0);
-// $moodle_form->disabledIf('automaticagreement', 'numberofmarkers', 'eq', '1');
+// $options = array(0 => get_string('no'), 1 => get_string('yes'));
+// $moodle_form->addElement('select', 'automaticagreement', get_string('automaticagreement', 'mod_coursework'), $options);
+// $moodle_form->addHelpButton('automaticagreement', 'automaticagreement', 'mod_coursework');
+// $moodle_form->setDefault('automaticagreement',0);
+// $moodle_form->disabledIf('automaticagreement', 'numberofmarkers', 'eq', '1');
//
-// $moodle_form->addElement('text', 'automaticagreementrange', get_string('automaticagreementrange', 'mod_coursework'), array('size' => 3));
-// $moodle_form->addHelpButton('automaticagreementrange', 'automaticagreementrange', 'mod_coursework');
-// $moodle_form->setDefault('automaticagreementrange',0);
-// $moodle_form->disabledIf('automaticagreementrange', 'automaticagreement', 'eq', '0');
+// $moodle_form->addElement('text', 'automaticagreementrange', get_string('automaticagreementrange', 'mod_coursework'), array('size' => 3));
+// $moodle_form->addHelpButton('automaticagreementrange', 'automaticagreementrange', 'mod_coursework');
+// $moodle_form->setDefault('automaticagreementrange',0);
+// $moodle_form->disabledIf('automaticagreementrange', 'automaticagreement', 'eq', '0');
}
diff --git a/renderers/object_renderer.php b/renderers/object_renderer.php
index 71ecbf8c..80e6cf04 100644
--- a/renderers/object_renderer.php
+++ b/renderers/object_renderer.php
@@ -592,7 +592,7 @@ protected function render_mod_coursework_allocation_table(mod_coursework_allocat
$select->formid = 'sectionmenu';
$table_html .= $OUTPUT->render($select);
- //get the hidden elements used for assessors and moderators selected on other pages;
+ // Get the hidden elements used for assessors and moderators selected on other pages;
$allocatable_cell_helper = $allocation_table->get_allocatable_cell();
$table_html .= '';
@@ -640,7 +640,7 @@ protected function render_mod_coursework_allocation_table(mod_coursework_allocat
';
- //form save button.
+ // Form save button.
$attributes = array('name' => 'save',
'type' => 'submit',
@@ -822,12 +822,12 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
for ($i = 2; $i <= $samplingwidget->get_coursework()->get_max_markers(); $i++) {
- //create the secon
+ // Create the secon
$sampling_strategies = array('0' => get_string('sampling_manual', 'mod_coursework'),
'1' => get_string('sampling_automatic', 'mod_coursework'));
- //check whether any rules have been saved for this stage
+ // Check whether any rules have been saved for this stage
$selected = ($samplingwidget->get_coursework()->has_automatic_sampling_at_stage('assessor_'.$i)) ? '1' : false;
$sampling_cell = html_writer::start_tag('div', array('class' => 'samples_strategy'));
@@ -911,7 +911,7 @@ private function sampling_strategy_column($samplingwidget, $suffix = '') {
$percentage_options[$i] = "{$i}%";
}
- //hidden input containing scale values
+ // Hidden input containing scale values
$scale = array();
$sampling_column = " ";
@@ -1526,14 +1526,14 @@ protected function coursework_grading_summary_table(mod_coursework_coursework $c
$assessable_submitted_submissions = $this->remove_ungradable_submissions($assessable_submitted_submissions);
- //remove all submission with final grade
+ // Remove all submission with final grade
$assessable_submitted_submissions = $this->removed_final_graded_submissions($assessable_submitted_submissions);
- //if has addagreedgrade or administergrade or addallocatedagreedgrade+initialgrade
+ // If has addagreedgrade or administergrade or addallocatedagreedgrade+initialgrade
if (has_any_capability(array('mod/coursework:addagreedgrade', 'mod/coursework:administergrades'), $coursework->get_context())
|| (has_capability('mod/coursework:addinitialgrade', $coursework->get_context()) && has_capability('mod/coursework:addallocatedagreedgrade', $coursework->get_context()))) {
- //count number of submissions at final grade stage
+ // Count number of submissions at final grade stage
$numberofassessable = count($assessable_submitted_submissions);
$assessable_submitted_submissions = $this->remove_final_gradable_submissions($assessable_submitted_submissions);
@@ -1541,7 +1541,7 @@ protected function coursework_grading_summary_table(mod_coursework_coursework $c
$needsgrading = $numberofassessable - count($assessable_submitted_submissions);
}
- //if has initialgrade
+ // If has initialgrade
if (has_any_capability(array('mod/coursework:addinitialgrade', 'mod/coursework:administergrades'), $coursework->get_context())) {
$assessable_submitted_submissions = $this->remove_final_gradable_submissions($assessable_submitted_submissions);
@@ -1735,7 +1735,7 @@ public function get_assessor_initial_graded_submissions($submissions) {
if (count($submission->get_assessor_feedbacks()) >= $submission->max_number_of_feedbacks() || $submission->is_assessor_initial_grader()
&& (!has_capability('mod/coursework:administergrades', $submission->get_coursework()->get_context()) && !is_siteadmin($USER->id))) {
- //is this submission assessable by this user at an inital gradig stage
+ // Is this submission assessable by this user at an inital gradig stage
unset($submissions[$sub->id]);
}
}
diff --git a/renderers/page_renderer.php b/renderers/page_renderer.php
index c8159dd6..7f279440 100644
--- a/renderers/page_renderer.php
+++ b/renderers/page_renderer.php
@@ -649,13 +649,13 @@ public function teacher_grading_page($coursework, $page, $perpage, $sortby, $sor
|| has_capability('mod/coursework:addallocatedagreedgrade', $PAGE->context)
|| has_capability('mod/coursework:administergrades', $PAGE->context))
&& $coursework->get_finalised_submissions()) {
- //export grading sheet
+ // Export grading sheet
$url = $pageurl.'&export_grading_sheet=1';
$links[$url] = get_string('exportgradingsheets', 'mod_coursework');
- //import grading sheet
+ // Import grading sheet
$url = '/mod/coursework/actions/upload_grading_sheet.php?cmid='.$PAGE->cm->id;
$links[$url] = get_string('uploadgradingworksheet', 'mod_coursework');
- //import annotated submissions
+ // Import annotated submissions
$url = '/mod/coursework/actions/upload_feedback.php?cmid='.$PAGE->cm->id;
$links[$url] = get_string('uploadfeedbackfiles', 'mod_coursework');
}
@@ -1391,7 +1391,7 @@ function view_course_index($courseid) {
$timedue = ($coursework->deadline)? date('l, d F Y, h:i A', $coursework->deadline) : "No deadline";
if ($coursework->can_grade()) { // teachers
$submitted = count($coursework->get_all_submissions());
- } else if ($coursework->can_submit()) { //students
+ } else if ($coursework->can_submit()) { // Students
if ($coursework->use_groups) {
$allocatable = $coursework->get_student_group($USER);
} else {
diff --git a/settings.php b/settings.php
index 07415683..66e68c2e 100644
--- a/settings.php
+++ b/settings.php
@@ -180,7 +180,7 @@
$per_page_description = get_string('per_page_desc', 'coursework');
$settings->add(new admin_setting_configselect('coursework_per_page', $per_page, $per_page_description, '10', $options));
- //automatic agreement delay
+ // Automatic agreement delay
$options = array('0' => get_string('disabled', 'mod_coursework'));
$options['1800'] = get_string('timedminutes', 'mod_coursework', '30');
@@ -197,11 +197,11 @@
$grade_editing_description = get_string('grade_editing_enabled_desc', 'coursework');
$settings->add(new admin_setting_configselect('coursework_grade_editing', $grade_editing_name, $grade_editing_description, '0', $options));
- //deadline defaults
+ // Deadline defaults
$deadline_defaults_header = new admin_setting_heading('deadline_defaults_header', get_string('deadline_defaults', 'mod_coursework'), '');
$settings->add($deadline_defaults_header);
- //marking deadline
+ // Marking deadline
$options = array('0' => get_string('disabled', 'mod_coursework'));
$options['7'] = get_string('oneweekoption', 'mod_coursework');
$options['14'] = get_string('twoweeksoption', 'mod_coursework');
@@ -213,7 +213,7 @@
$marking_deadline_description = get_string('marking_deadline_enabled_desc', 'coursework');
$settings->add(new admin_setting_configselect('coursework_marking_deadline', $marking_deadline_name, $marking_deadline_description, '0', $options));
- //marking deadline
+ // Marking deadline
$options = array('0' => get_string('disabled', 'mod_coursework'));
$options['7'] = get_string('oneweekoption', 'mod_coursework');
$options['14'] = get_string('twoweeksoption', 'mod_coursework');
@@ -226,7 +226,7 @@
$agreed_marking_deadline_description = get_string('agreed_marking_deadline_default_desc', 'coursework');
$settings->add(new admin_setting_configselect('coursework_agreed_marking_deadline', $agreed_marking_deadline_name, $agreed_marking_deadline_description, '0', $options));
- //start date
+ // Start date
$options = array('0' => get_string('disabled', 'mod_coursework'));
$options['1'] = get_string('today', 'mod_coursework');
@@ -234,7 +234,7 @@
$start_date_description = get_string('start_date_enabled_desc', 'coursework');
$settings->add(new admin_setting_configselect('coursework_start_date', $start_date_name, $start_date_description, '0', $options));
- //submission deadline
+ // Submission deadline
$options = array('0' => get_string('disabled', 'mod_coursework'));
$options['1'] = get_string('today', 'mod_coursework');
$options['7'] = get_string('sevendays', 'mod_coursework');
diff --git a/tests/behat/behat_mod_coursework.php b/tests/behat/behat_mod_coursework.php
index aca2497c..e9beda99 100644
--- a/tests/behat/behat_mod_coursework.php
+++ b/tests/behat/behat_mod_coursework.php
@@ -1935,9 +1935,9 @@ public function iShouldSeeTheModeratorGradeOnThePage() {
*/
$page = $this->get_page('multiple grading interface');
$page->should_have_moderator_grade_for($this->student, '56');
-// if (!$this->find('xpath', $this->xpath_tag_class_contains_text('td', 'moderated', '56'))) {
-// throw new ExpectationException('Could not find the moderated grade', $this->getSession());
-// }
+// if (!$this->find('xpath', $this->xpath_tag_class_contains_text('td', 'moderated', '56'))) {
+// throw new ExpectationException('Could not find the moderated grade', $this->getSession());
+// }
}
/**
@@ -2106,11 +2106,11 @@ public function iShouldSeeTheGradeOnThePage() {
*/
$page = $this->get_page('multiple grading interface');
$page->assessor_grade_should_be_present($this->student, 1, 56);
-// $xpath = $this->xpath_tag_class_contains_text('td', 'cfeedbackcomment', '56');
-// if (!$this->getSession()->getPage()->has('xpath', $xpath)) {
-// throw new ExpectationException('Should have seen the grade ("56"), but it was not there',
-// $this->getSession());
-// }
+// $xpath = $this->xpath_tag_class_contains_text('td', 'cfeedbackcomment', '56');
+// if (!$this->getSession()->getPage()->has('xpath', $xpath)) {
+// throw new ExpectationException('Should have seen the grade ("56"), but it was not there',
+// $this->getSession());
+// }
}
/**
@@ -2319,7 +2319,7 @@ public function i_should_be_on_the_page($page_name, $ignore_params = false) {
// possibly be a new id in there.
if ($ignore_params) {
$current_path = parse_url($currentUrl, PHP_URL_PATH);
-// $desired_path = parse_url($desirtedUrl, PHP_URL_PATH);
+// $desired_path = parse_url($desirtedUrl, PHP_URL_PATH);
$message = "Should be on the " . $desirtedUrl . " page but instead the url is " . $current_path;
assertEquals($current_path, $desirtedUrl, $message);
} else {
@@ -2368,7 +2368,7 @@ public function waitForSeconds($seconds) {
$this->getSession()->wait($seconds * 1000);
}
- // And I click on ".moodle-dialogue-focused.filepicker .yui3-button.closebutton" "css_element"
+ // And I click on ".moodle-dialogue-focused.filepicker .yui3-button.closebutton" "css_element"
public function dismiss() {
$this->find('css', ".moodle-dialogue-focused.filepicker .yui3-button.closebutton")->click();
}
@@ -2897,27 +2897,27 @@ public function teachersHavaACapabilityToAdministerGrades() {
* @AfterStep
* @param \Behat\Behat\Event\StepEvent $event
*/
-// public function takeScreenshotAfterFailedStep(Behat\Behat\Event\StepEvent $event) {
-// if ($event->getResult() === Behat\Behat\Event\StepEvent::FAILED) {
+// public function takeScreenshotAfterFailedStep(Behat\Behat\Event\StepEvent $event) {
+// if ($event->getResult() === Behat\Behat\Event\StepEvent::FAILED) {
//
-// $step = $event->getStep();
-// $path = array(
-// 'date' => date("Ymd-Hi"),
-// 'feature' => $step->getParent()->getFeature()->getTitle(),
-// 'scenario' => $step->getParent()->getTitle(),
-// 'step' => $step->getType() . ' ' . $step->getText(),
-// );
-// $path = preg_replace('/[^\-\.\w]/', '_', $path);
-// $filename = implode($path);
+// $step = $event->getStep();
+// $path = array(
+// 'date' => date("Ymd-Hi"),
+// 'feature' => $step->getParent()->getFeature()->getTitle(),
+// 'scenario' => $step->getParent()->getTitle(),
+// 'step' => $step->getType() . ' ' . $step->getText(),
+// );
+// $path = preg_replace('/[^\-\.\w]/', '_', $path);
+// $filename = implode($path);
//
-// $driver = $this->getSession()->getDriver();
-// if ($driver instanceof Behat\Mink\Driver\Selenium2Driver) {
-// $filename .= '_screenshot.jpg';
-// $this->show_me_a_screenshot($filename);
-// } else {
-// $filename .= '_page.html';
-// $this->show_me_the_page($filename);
-// }
-// }
-// }
+// $driver = $this->getSession()->getDriver();
+// if ($driver instanceof Behat\Mink\Driver\Selenium2Driver) {
+// $filename .= '_screenshot.jpg';
+// $this->show_me_a_screenshot($filename);
+// } else {
+// $filename .= '_page.html';
+// $this->show_me_the_page($filename);
+// }
+// }
+// }
}
diff --git a/tests/behat/pages/allocations_page.php b/tests/behat/pages/allocations_page.php
index ad8b9398..03375b27 100644
--- a/tests/behat/pages/allocations_page.php
+++ b/tests/behat/pages/allocations_page.php
@@ -229,7 +229,7 @@ public function select_range_for_grade_range_rule_for_stage($range, $stage, $rul
*/
public function select_total_percentage_for_stage($percentage, $stage) {
- //increment stage as the this will match the id of the element;
+ // Increment stage as the this will match the id of the element;
$stage++;
$elementid = '#assessor_'.$stage.'_sampletotal';
diff --git a/view.php b/view.php
index 38864f3e..1f78e0e6 100644
--- a/view.php
+++ b/view.php
@@ -120,7 +120,7 @@
$SESSION->sorthow[$course_module_id] = $sorthow;
}
-// first name alpha
+// First name alpha
if (!(isset($SESSION->coursework_firstname_alpha[$course_module_id]))) {
$SESSION->coursework_firstname_alpha[$course_module_id] = optional_param('coursework_firstname_alpha', '', PARAM_ALPHA);
$coursework_firstname_alpha = $SESSION->coursework_firstname_alpha[$course_module_id];
@@ -129,7 +129,7 @@
$SESSION->coursework_firstname_alpha[$course_module_id] = $coursework_firstname_alpha;
}
-// last name alpha
+// Last name alpha
if (!(isset($SESSION->coursework_lastname_alpha[$course_module_id]))) {
$SESSION->coursework_lastname_alpha[$course_module_id] = optional_param('coursework_lastname_alpha', '', PARAM_ALPHA);
$coursework_lastname_alpha = $SESSION->coursework_lastname_alpha[$course_module_id];
@@ -138,7 +138,7 @@
$SESSION->coursework_lastname_alpha[$course_module_id] = $coursework_lastname_alpha;
}
-// group name alpha
+// Group name alpha
if (!(isset($SESSION->coursework_groupname_alpha[$course_module_id]))) {
$SESSION->coursework_groupname_alpha[$course_module_id] = optional_param('coursework_groupname_alpha', '', PARAM_ALPHA);
$coursework_groupname_alpha = $SESSION->coursework_groupname_alpha[$course_module_id];
@@ -147,7 +147,7 @@
$SESSION->coursework_groupname_alpha[$course_module_id] = $coursework_groupname_alpha;
}
-//we will use the same defaults as page (above) defaulting to page setting if no specific viewallstudents_page has been set
+// We will use the same defaults as page (above) defaulting to page setting if no specific viewallstudents_page has been set
if (isset($SESSION->viewallstudents_perpage[$course_module_id]) && optional_param('viewallstudents_per_page', 0, PARAM_INT) != $SESSION->viewallstudents_perpage[$course_module_id]
&& optional_param('viewallstudents_per_page', 0, PARAM_INT) != 0) { // prevent blank pages if not in correct page
$viewallstudents_page = 0;
@@ -160,7 +160,7 @@
$SESSION->viewallstudents_page[$course_module_id] = $viewallstudents_page;
}
-//we will use the same defaults as perpage (above) defaulting to perpage setting if no specific viewallstudents_perpage has been set
+// We will use the same defaults as perpage (above) defaulting to perpage setting if no specific viewallstudents_perpage has been set
if (!(isset($SESSION->viewallstudents_perpage[$course_module_id]))) {
$SESSION->viewallstudents_perpage[$course_module_id] = optional_param('viewallstudents_per_page', $perpage, PARAM_INT);
$viewallstudents_perpage = $SESSION->viewallstudents_perpage[$course_module_id];
@@ -169,7 +169,7 @@
$SESSION->viewallstudents_perpage[$course_module_id] = $viewallstudents_perpage;
}
-//we will use the same defaults as sortby (above) defaulting to sortby setting if no specific viewallstudents_sortby has been set
+// We will use the same defaults as sortby (above) defaulting to sortby setting if no specific viewallstudents_sortby has been set
if (!(isset($SESSION->viewallstudents_sortby[$course_module_id]))) {
$SESSION->viewallstudents_sortby[$course_module_id] = optional_param('viewallstudents_sortby', $sortby, PARAM_ALPHA);
$viewallstudents_sortby = $SESSION->viewallstudents_sortby[$course_module_id];
@@ -178,7 +178,7 @@
$SESSION->viewallstudents_sortby[$course_module_id] = $viewallstudents_sortby;
}
-//we will use the same defaults as sorthow (above) defaulting to sorthow setting if no specific viewallstudents_sorthow has been set
+// We will use the same defaults as sorthow (above) defaulting to sorthow setting if no specific viewallstudents_sorthow has been set
if (!(isset($SESSION->viewallstudents_sorthow[$course_module_id]))) {
$SESSION->viewallstudents_sorthow[$course_module_id] = optional_param('viewallstudents_sorthow', $sorthow, PARAM_ALPHA);
$viewallstudents_sorthow = $SESSION->viewallstudents_sorthow[$course_module_id];
@@ -187,7 +187,7 @@
$SESSION->viewallstudents_sorthow[$course_module_id] = $viewallstudents_sorthow;
}
-// first name alpha
+// First name alpha
if (!(isset($SESSION->viewallstudents_firstname_alpha[$course_module_id]))) {
$SESSION->viewallstudents_firstname_alpha[$course_module_id] = optional_param('viewallstudents_firstname_alpha', '', PARAM_ALPHA);
$viewallstudents_firstname_alpha = $SESSION->coursework_firstname_alpha[$course_module_id];
@@ -196,7 +196,7 @@
$SESSION->viewallstudents_firstname_alpha[$course_module_id] = $viewallstudents_firstname_alpha;
}
-// last name alpha
+// Last name alpha
if (!(isset($SESSION->viewallstudents_lastname_alpha[$course_module_id]))) {
$SESSION->viewallstudents_lastname_alpha[$course_module_id] = optional_param('viewallstudents_lastname_alpha', '', PARAM_ALPHA);
$viewallstudents_lastname_alpha = $SESSION->viewallstudents_lastname_alpha[$course_module_id];
@@ -205,7 +205,7 @@
$SESSION->viewallstudents_lastname_alpha[$course_module_id] = $viewallstudents_lastname_alpha;
}
-// group name alpha
+// Group name alpha
if (!(isset($SESSION->viewallstudents_groupname_alpha[$course_module_id]))) {
$SESSION->viewallstudents_groupname_alpha[$course_module_id] = optional_param('viewallstudents_groupname_alpha', '', PARAM_ALPHA);
$viewallstudents_groupname_alpha = $SESSION->viewallstudents_groupname_alpha[$course_module_id];
@@ -253,13 +253,13 @@
$coursework = mod_coursework\models\coursework::find($coursework_record);
-// check if group is in session and use it no group available in url
+// Check if group is in session and use it no group available in url
if (groups_get_activity_groupmode($coursework->get_course_module()) != 0 && $group == -1) {
- // check if a group is in SESSION
+ // Check if a group is in SESSION
$group = groups_get_activity_group($coursework->get_course_module());
}
-// commented out the redirection for Release1 #108535552, this will be revisited for Release2
+// Commented out the redirection for Release1 #108535552, this will be revisited for Release2
/*if (has_capability('mod/coursework:allocate', $coursework->get_context())) {
$warnings = new \mod_coursework\warnings($coursework);
@@ -279,7 +279,7 @@
}
}*/
-// change default sortby to Date (timesubmitted) if CW is set to blind marking and a user doesn't have capability to view anonymous
+// Change default sortby to Date (timesubmitted) if CW is set to blind marking and a user doesn't have capability to view anonymous
$viewanonymous = has_capability('mod/coursework:viewanonymous', $coursework->get_context());
if (($coursework->blindmarking && !$viewanonymous )) {
$sortby = optional_param('sortby', 'timesubmitted', PARAM_ALPHA);
@@ -301,7 +301,7 @@
if ($export_grades) {
- // headers and data for csv
+ // Headers and data for csv
$csv_cells = array('name', 'username', 'idnumber', 'email');
if ($coursework->personal_deadlines_enabled()) {
@@ -394,7 +394,7 @@
// Print the page header.
-// sort group by groupname (default)
+// Sort group by groupname (default)
if ($coursework->is_configured_to_have_group_submissions()) {
$sortby = optional_param('sortby', 'groupname', PARAM_ALPHA);
$viewallstudents_sortby = optional_param('viewallstudents_sortby', 'groupname', PARAM_ALPHA);
@@ -416,7 +416,7 @@
$PAGE->set_title($coursework->name);
$PAGE->set_heading($course->shortname);
-//$PAGE->set_button($OUTPUT->update_module_button($course_module->id, 'coursework')); // deprecated from 3.2 (MDL-53765 core)
+// $PAGE->set_button($OUTPUT->update_module_button($course_module->id, 'coursework')); // deprecated from 3.2 (MDL-53765 core)
// Auto publish after the deadline
if ($coursework->has_individual_autorelease_feedback_enabled() &&
@@ -427,7 +427,7 @@
$coursework->publish_grades();
}
-//Create automatic feedback
+// Create automatic feedback
if ($coursework->automaticagreement_enabled()) {
$coursework->create_automatic_feedback();
@@ -543,8 +543,8 @@
';
-//$PAGE->requires->js('/mod/coursework/datatables/js/jquery-3.3.1.min.js');
-//$PAGE->requires->js('/mod/coursework/datatables/js/jquery.datatables.js');
+// $PAGE->requires->js('/mod/coursework/datatables/js/jquery-3.3.1.min.js');
+// $PAGE->requires->js('/mod/coursework/datatables/js/jquery.datatables.js');
// Finish the page.
echo $OUTPUT->footer();
From 90ea671c4867f102017737caecfcda259689f583 Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Mon, 12 Aug 2024 15:29:31 +0100
Subject: [PATCH 22/51] CTP-3558 coding std short array syntax
---
actions/ajax/datatable/grading.php | 2 +-
actions/allocate.php | 4 +--
actions/allocationsession.php | 16 ++++++------
actions/set_personal_deadlines.php | 2 +-
...restore_coursework_activity_task.class.php | 4 +--
.../moodle2/restore_coursework_stepslib.php | 2 +-
classes/allocation/manager.php | 10 +++----
classes/allocation/strategy/base.php | 2 +-
classes/allocation/strategy/equal.php | 2 +-
.../allocation/strategy/group_assessor.php | 2 +-
classes/allocation/strategy/none.php | 2 +-
classes/allocation/strategy/percentages.php | 4 +--
classes/allocation/table/builder.php | 4 +--
classes/allocation/table/cell/builder.php | 2 +-
classes/allocation/table/cell/data.php | 2 +-
classes/allocation/table/cell/processor.php | 2 +-
classes/allocation/table/processor.php | 8 +++---
classes/allocation/upload.php | 6 ++---
classes/assessor_feedback_table.php | 2 +-
classes/controllers/feedback_controller.php | 2 +-
.../controllers/moderations_controller.php | 2 +-
.../plagiarism_flagging_controller.php | 2 +-
classes/cron.php | 6 ++---
classes/event/assessable_uploaded.php | 2 +-
classes/export/csv.php | 8 +++---
.../export/csv/cells/agreedfeedback_cell.php | 2 +-
classes/export/csv/cells/agreedgrade_cell.php | 8 +++---
.../csv/cells/assessorfeedback_cell.php | 2 +-
.../export/csv/cells/assessorgrade_cell.php | 8 +++---
classes/export/csv/cells/cell_base.php | 2 +-
.../csv/cells/feedbackcomments_cell.php | 2 +-
.../csv/cells/moderationagreement_cell.php | 4 +--
.../export/csv/cells/otherassessors_cell.php | 4 +--
classes/export/csv/cells/singlegrade_cell.php | 8 +++---
classes/export/csv/cells/stages_cell.php | 4 +--
.../csv/cells/submissionfileid_cell.php | 2 +-
.../export/csv/cells/submissionid_cell.php | 2 +-
classes/export/grading_sheet.php | 4 +--
classes/export/import.php | 16 ++++++------
classes/file_importer.php | 4 +--
classes/files.php | 2 +-
classes/forms/advance_plugins_form.php | 2 +-
classes/forms/assessor_feedback_mform.php | 2 +-
.../choose_student_for_submission_mform.php | 2 +-
classes/forms/deadline_extension_form.php | 2 +-
classes/forms/personal_deadline_form.php | 2 +-
classes/forms/publish_form.php | 2 +-
classes/forms/student_submission_form.php | 4 +--
classes/forms/upload_feedback_form.php | 2 +-
classes/framework/ability.php | 4 +--
classes/framework/table_base.php | 10 +++----
classes/grading_report.php | 2 +-
classes/models/coursework.php | 24 ++++++++---------
classes/models/group.php | 2 +-
classes/models/null_user.php | 2 +-
classes/models/outstanding_marking.php | 10 +++----
classes/models/submission.php | 10 +++----
classes/personal_deadline/table/builder.php | 2 +-
.../grading_report/cells/_user_cell.php | 2 +-
.../grading_report/cells/cell_base.php | 2 +-
.../grading_report/cells/cell_interface.php | 2 +-
.../grading_report/cells/email_cell.php | 2 +-
.../grading_report/cells/first_name_cell.php | 2 +-
.../cells/first_name_letter_cell.php | 2 +-
.../cells/grade_for_gradebook_cell.php | 2 +-
.../grading_report/cells/group_cell.php | 2 +-
.../grading_report/cells/idnumber_cell.php | 2 +-
.../grading_report/cells/last_name_cell.php | 2 +-
.../cells/last_name_letter_cell.php | 2 +-
.../cells/moderation_agreement_cell.php | 2 +-
.../grading_report/cells/moderation_cell.php | 2 +-
.../cells/multiple_agreed_grade_cell.php | 2 +-
.../cells/personal_deadline_cell.php | 2 +-
.../grading_report/cells/plagiarism_cell.php | 2 +-
.../cells/plagiarism_flag_cell.php | 2 +-
.../cells/single_assessor_feedback_cell.php | 2 +-
.../grading_report/cells/status_cell.php | 2 +-
.../grading_report/cells/submission_cell.php | 2 +-
.../cells/time_submitted_cell.php | 2 +-
.../grading_report/cells/user_cell.php | 2 +-
classes/router.php | 4 +--
classes/sample_set_rule/range_sample_type.php | 8 +++---
classes/sample_set_rule/total_sample_type.php | 4 +--
classes/sampling_set_widget.php | 6 ++---
classes/stages/base.php | 6 ++---
db/upgrade.php | 14 +++++-----
lib.php | 10 +++----
mod_form.php | 12 ++++-----
renderers/grading_report_renderer.php | 4 +--
renderers/object_renderer.php | 26 +++++++++----------
renderers/page_renderer.php | 6 ++---
settings.php | 4 +--
.../allocation/form/table_processor_test.php | 2 +-
.../auto_grader/percentage_distance_test.php | 2 +-
.../deadline_extensions_controller_test.php | 2 +-
view.php | 2 +-
96 files changed, 207 insertions(+), 207 deletions(-)
diff --git a/actions/ajax/datatable/grading.php b/actions/ajax/datatable/grading.php
index c1ad9542..f2b25973 100644
--- a/actions/ajax/datatable/grading.php
+++ b/actions/ajax/datatable/grading.php
@@ -35,7 +35,7 @@
$unallocated = optional_param('unallocated', false, PARAM_BOOL);
// Grading report display options.
-$report_options = array();
+$report_options = [];
if ($unallocated) {
$report_options['unallocated'] = true;
}
diff --git a/actions/allocate.php b/actions/allocate.php
index cc4afb5c..e20fbf2c 100644
--- a/actions/allocate.php
+++ b/actions/allocate.php
@@ -45,7 +45,7 @@
$assessorallocationstrategy = optional_param('assessorallocationstrategy', false, PARAM_TEXT);
$moderationruletype = optional_param('addmodsetruletype', 0, PARAM_ALPHAEXT);
-$deletemodsetrule = optional_param('delete-mod-set-rule', array(), PARAM_RAW) ;
+$deletemodsetrule = optional_param('delete-mod-set-rule', [], PARAM_RAW) ;
// options used for pagination
// If a session variable holding page preference for the specific coursework is not set, set default value (0).
@@ -76,7 +76,7 @@
$options = compact('sortby', 'sorthow', 'perpage', 'page');
// $_POST['allocatables'] comes as array of arrays which is not supported by optional_param_array, however we clean this later in process_data() function
-$formdataarray = isset($_POST['allocatables']) ? $_POST['allocatables'] : array();
+$formdataarray = isset($_POST['allocatables']) ? $_POST['allocatables'] : = [];
require_login($course, true, $coursemodule);
diff --git a/actions/allocationsession.php b/actions/allocationsession.php
index e5da9a24..8e29a1b1 100644
--- a/actions/allocationsession.php
+++ b/actions/allocationsession.php
@@ -26,20 +26,20 @@
$assesorselect = required_param_array('assesorselect', PARAM_RAW);
$assesorselectvalue = required_param_array('assesorselectvalue', PARAM_RAW);
-$pinnedchk = optional_param_array('pinned', array(), PARAM_RAW);
-$pinnedchkval = optional_param_array('pinnedvalue', array(), PARAM_RAW);
-$moderatorselect = optional_param_array('moderatorselect', array(), PARAM_RAW);
-$moderatorselectvalue = optional_param_array('moderatorselectvalue', array(), PARAM_RAW);
-$samplechk = optional_param_array('sample', array(), PARAM_RAW);
-$samplechkvalue = optional_param_array('samplevalue', array(), PARAM_RAW);
+$pinnedchk = optional_param_array('pinned', [], PARAM_RAW);
+$pinnedchkval = optional_param_array('pinnedvalue', [], PARAM_RAW);
+$moderatorselect = optional_param_array('moderatorselect', [], PARAM_RAW);
+$moderatorselectvalue = optional_param_array('moderatorselectvalue', [], PARAM_RAW);
+$samplechk = optional_param_array('sample', [], PARAM_RAW);
+$samplechkvalue = optional_param_array('samplevalue', [], PARAM_RAW);
$coursemoduleid = required_param('coursemoduleid', PARAM_INT);
if (!isset($SESSION->coursework_allocationsessions)) {
- $SESSION->coursework_allocationsessions = array();
+ $SESSION->coursework_allocationsessions = [];
}
if (!isset($SESSION->coursework_allocationsessions[$coursemoduleid])) {
- $SESSION->coursework_allocationsessions[$coursemoduleid] = array();
+ $SESSION->coursework_allocationsessions[$coursemoduleid] = [];
}
for ($i = 0; $i < count($assesorselect); $i++) {
diff --git a/actions/set_personal_deadlines.php b/actions/set_personal_deadlines.php
index 042e2fdf..c6d42bf4 100644
--- a/actions/set_personal_deadlines.php
+++ b/actions/set_personal_deadlines.php
@@ -62,7 +62,7 @@
'node-base')
);
$PAGE->requires->js_init_call('M.mod_coursework.init_personal_deadlines_page',
- array(),
+ [],
false,
$jsmodule);
diff --git a/backup/moodle2/restore_coursework_activity_task.class.php b/backup/moodle2/restore_coursework_activity_task.class.php
index 21d954e8..1e98ecdb 100644
--- a/backup/moodle2/restore_coursework_activity_task.class.php
+++ b/backup/moodle2/restore_coursework_activity_task.class.php
@@ -33,7 +33,7 @@ class restore_coursework_activity_task extends restore_activity_task
* @return array of restore_decode_rule
*/
static public function define_decode_rules() {
- $rules = array();
+ $rules = [];
$rules[] = new restore_decode_rule('COURSEWORKBYID',
'/mod/coursework/view.php?id=$1',
@@ -53,7 +53,7 @@ static public function define_decode_rules() {
* @return array
*/
static public function define_decode_contents() {
- $contents = array();
+ $contents = [];
$contents[] = new restore_decode_content('coursework', array('intro'), 'assign');
diff --git a/backup/moodle2/restore_coursework_stepslib.php b/backup/moodle2/restore_coursework_stepslib.php
index e072e1fe..4dece12d 100644
--- a/backup/moodle2/restore_coursework_stepslib.php
+++ b/backup/moodle2/restore_coursework_stepslib.php
@@ -39,7 +39,7 @@ static function cheaplog($thing, $append = true) {
* @return restore_path_element $structure
*/
protected function define_structure() {
- $paths = array();
+ $paths = [];
$paths[] = new restore_path_element('coursework', '/activity/coursework');
$paths[] = new restore_path_element('coursework_sample_set_rule', '/activity/coursework/coursework_sample_set_rules/coursework_sample_set_rule');
diff --git a/classes/allocation/manager.php b/classes/allocation/manager.php
index 766ba509..ce3f8dce 100644
--- a/classes/allocation/manager.php
+++ b/classes/allocation/manager.php
@@ -69,7 +69,7 @@ public function __construct(coursework $coursework) {
$this->coursework = $coursework;
// Instantiate the allocation strategies so we can use them.
- $strategytypes = array();
+ $strategytypes = [];
if (!empty($this->coursework->assessorallocationstrategy)) {
$strategytypes[] = coursework::ASSESSOR;
}
@@ -110,7 +110,7 @@ public static function get_allocation_classnames($type = coursework::ASSESSOR) {
$classdir = $CFG->dirroot . '/mod/coursework/classes/allocation/strategy';
$fullclassnames = glob($classdir . '/*.php');
- $options = array();
+ $options = [];
foreach ($fullclassnames as $fullclassname) {
if (strpos($fullclassname, 'base') !== false) {
continue;
@@ -169,7 +169,7 @@ public function auto_generate_moderation_set() {
}
// These are the ones we will actually moderate (or which have already been moderated).
- $moderation_set = array();
+ $moderation_set = [];
// Move all the already marked ones into the set. These have to stay in it and ought to
// be taken into account so that the other rules just add to them.
@@ -289,7 +289,7 @@ public function auto_generate_sample_set() {
$sampleplugins = $DB->get_records('coursework_sample_set_plugin', null, 'pluginorder');
$order = 0;
- $sample_set = array();
+ $sample_set = [];
$allocatables = $this->get_coursework()->get_allocatables();
@@ -331,7 +331,7 @@ public function auto_generate_sample_set() {
if (!isset($manual_sample_set[$k])) $manual_sample_set[$k] = $v;
}
- $auto_sample_set = array();
+ $auto_sample_set = [];
foreach ($sampleplugins as $plugin) {
$classname = '\mod_coursework\sample_set_rule\\' . $plugin->rulename;
diff --git a/classes/allocation/strategy/base.php b/classes/allocation/strategy/base.php
index 1512bd61..4069fa15 100644
--- a/classes/allocation/strategy/base.php
+++ b/classes/allocation/strategy/base.php
@@ -64,7 +64,7 @@ abstract class base {
*
* @var array
*/
- private $settings = array();
+ private $settings = [];
/**
* @var stage_base
diff --git a/classes/allocation/strategy/equal.php b/classes/allocation/strategy/equal.php
index b1efbf91..114391e4 100644
--- a/classes/allocation/strategy/equal.php
+++ b/classes/allocation/strategy/equal.php
@@ -86,7 +86,7 @@ public function save_allocation_strategy_options() {
* @return mixed
*/
protected function list_of_allocatable_teachers_and_their_current_number_of_allocations($teachers, $student) {
- $teacherids = array();
+ $teacherids = [];
foreach ($teachers as $id => $teacher) {
if ($this->teacher_already_has_an_allocation_for_this_allocatable($student, $teacher)) {
diff --git a/classes/allocation/strategy/group_assessor.php b/classes/allocation/strategy/group_assessor.php
index 307e2a04..e4550630 100644
--- a/classes/allocation/strategy/group_assessor.php
+++ b/classes/allocation/strategy/group_assessor.php
@@ -66,6 +66,6 @@ public function save_allocation_strategy_options() {
* @return mixed
*/
protected function list_of_allocatable_teachers_and_their_current_number_of_allocations($teachers, $student) {
- return array();
+ return = [];
}
}
diff --git a/classes/allocation/strategy/none.php b/classes/allocation/strategy/none.php
index 4b4fdfc5..81a2e2ab 100644
--- a/classes/allocation/strategy/none.php
+++ b/classes/allocation/strategy/none.php
@@ -72,6 +72,6 @@ public function save_allocation_strategy_options() {
* @return mixed
*/
protected function list_of_allocatable_teachers_and_their_current_number_of_allocations($teachers, $student) {
- return array();
+ return = [];
}
}
diff --git a/classes/allocation/strategy/percentages.php b/classes/allocation/strategy/percentages.php
index 3e957be5..a6fc2064 100644
--- a/classes/allocation/strategy/percentages.php
+++ b/classes/allocation/strategy/percentages.php
@@ -139,7 +139,7 @@ public function save_allocation_strategy_options() {
// Get the data from the form.
$name = $this->get_name();
- $data = optional_param_array('assessorstrategy'.$name, array(), PARAM_RAW); // Array[teacherid] => value.
+ $data = optional_param_array('assessorstrategy'.$name, [], PARAM_RAW); // Array[teacherid] => value.
if (!is_array($data)) {
return true;
@@ -244,7 +244,7 @@ private function teacher_already_has_maximum_allocations($teacher) {
* @return array
*/
protected function list_of_allocatable_teachers_and_their_current_number_of_allocations($teachers, $student) {
- $teacherids = array();
+ $teacherids = [];
foreach ($teachers as $teacher) {
if ($this->teacher_already_has_an_allocation_for_this_allocatable($student, $teacher)) {
diff --git a/classes/allocation/table/builder.php b/classes/allocation/table/builder.php
index 38b59c48..f31c9087 100644
--- a/classes/allocation/table/builder.php
+++ b/classes/allocation/table/builder.php
@@ -69,7 +69,7 @@ public function __construct($coursework, array $options) {
public function get_rows() {
$allocatables = $this->get_coursework()->get_allocatables();
- $rows = array();
+ $rows = [];
foreach ($allocatables as $allocatable) {
$rows[] = new row_builder($this, $allocatable);
}
@@ -106,7 +106,7 @@ public function get_table_rows_for_page() {
$allocatables = $this->get_coursework()->get_allocatables();
- $rows = array();
+ $rows = [];
foreach ($allocatables as $allocatable) {
$rows[] = new row_builder($this, $allocatable);
}
diff --git a/classes/allocation/table/cell/builder.php b/classes/allocation/table/cell/builder.php
index 6ccc44c8..9061d6f0 100644
--- a/classes/allocation/table/cell/builder.php
+++ b/classes/allocation/table/cell/builder.php
@@ -58,7 +58,7 @@ class builder {
* @param stage_base $stage
* @param array $data_array incoming data from the allocation form
*/
- public function __construct($coursework, $allocatable, $stage, $data_array = array()) {
+ public function __construct($coursework, $allocatable, $stage, $data_array = []) {
$this->coursework = $coursework;
$this->allocatable = $allocatable;
$this->stage = $stage;
diff --git a/classes/allocation/table/cell/data.php b/classes/allocation/table/cell/data.php
index 9e24e9a1..e86f01a1 100644
--- a/classes/allocation/table/cell/data.php
+++ b/classes/allocation/table/cell/data.php
@@ -50,7 +50,7 @@ class data {
* @param stage_base $stage
* @param array $data
*/
- public function __construct($stage, $data = array()) {
+ public function __construct($stage, $data = []) {
$this->data = $data;
$this->stage = $stage;
$this->preprocess_data();
diff --git a/classes/allocation/table/cell/processor.php b/classes/allocation/table/cell/processor.php
index 768ac3a0..f009d81a 100644
--- a/classes/allocation/table/cell/processor.php
+++ b/classes/allocation/table/cell/processor.php
@@ -56,7 +56,7 @@ class processor {
* @param stage_base $stage
* @param array $data_array incoming data from the allocation form
*/
- public function __construct($coursework, $allocatable, $stage, $data_array = array()) {
+ public function __construct($coursework, $allocatable, $stage, $data_array = []) {
$this->coursework = $coursework;
$this->allocatable = $allocatable;
$this->stage = $stage;
diff --git a/classes/allocation/table/processor.php b/classes/allocation/table/processor.php
index c0a143c9..7b6c5f85 100644
--- a/classes/allocation/table/processor.php
+++ b/classes/allocation/table/processor.php
@@ -52,7 +52,7 @@ public function __construct($coursework) {
/**
* @param array $table_data
*/
- public function process_data($table_data = array()) {
+ public function process_data($table_data = []) {
$clean_data = $this->clean_data($table_data);
$allocatables = $this->coursework->get_allocatables();
@@ -60,7 +60,7 @@ public function process_data($table_data = array()) {
if (array_key_exists($allocatable->id(), $clean_data)) {
$row_data = $clean_data[$allocatable->id()];
} else {
- $row_data = array();
+ $row_data = [];
}
$allocatable = $this->get_allocatable_from_id($allocatable->id());
@@ -101,14 +101,14 @@ private function clean_data($raw_data) {
// )
// );
- $clean_data = array();
+ $clean_data = [];
foreach ($raw_data as $allocatable_id => $datarrays) {
if (!$this->allocatable_id_is_valid($allocatable_id)) { // Should be the id of a student.
continue;
}
- $clean_data[$allocatable_id] = array();
+ $clean_data[$allocatable_id] = [];
foreach ($this->coursework->marking_stages() as $stage) {
diff --git a/classes/allocation/upload.php b/classes/allocation/upload.php
index f201ebc1..125447cc 100644
--- a/classes/allocation/upload.php
+++ b/classes/allocation/upload.php
@@ -69,7 +69,7 @@ public function validate_csv($content, $encoding, $delimeter) {
$csvreader->init();
- $errors = array();
+ $errors = [];
$s = 0;
// find out if this is a group or individual coursework
$allocatabletype = $this->coursework->get_allocatable_type();
@@ -79,7 +79,7 @@ public function validate_csv($content, $encoding, $delimeter) {
// find all assessors for this coursework
$assessors = get_enrolled_users($this->coursework->get_context(), 'mod/coursework:addinitialgrade');
$assessors = array_keys($assessors); // keep only assessors' ids
- $allocatablesinfile = array();
+ $allocatablesinfile = [];
$csv_cells = array('allocatable');
$stages = $this->coursework->get_max_markers();
@@ -90,7 +90,7 @@ public function validate_csv($content, $encoding, $delimeter) {
while ($line = $csvreader->next()) {
$cells = $csv_cells;
- $assessorsinfile = array();
+ $assessorsinfile = [];
if (sizeof($line) != sizeof($csv_cells)) {$errors = get_string('incorrectfileformat', 'coursework'); break;}
foreach ($line as $keynum => $value) {
diff --git a/classes/assessor_feedback_table.php b/classes/assessor_feedback_table.php
index 67745e8f..2676e3f3 100644
--- a/classes/assessor_feedback_table.php
+++ b/classes/assessor_feedback_table.php
@@ -78,7 +78,7 @@ public function get_renderable_feedback_rows() {
// Makes a new result set every time, so we can modify this array without worrying about
// messing up the cache.
- $feedbackobjects = array();
+ $feedbackobjects = [];
foreach ($this->coursework->get_assessor_marking_stages() as $stage) {
$renderable_row = new assessor_feedback_row($stage, $this->get_allocatable(), $this->coursework);
$feedbackobjects[] = $renderable_row;
diff --git a/classes/controllers/feedback_controller.php b/classes/controllers/feedback_controller.php
index a6fe97d1..1ac3062c 100644
--- a/classes/controllers/feedback_controller.php
+++ b/classes/controllers/feedback_controller.php
@@ -117,7 +117,7 @@ protected function new_feedback() {
$this->check_stage_permissions($this->params['stage_identifier']);
- $urlparams = array();
+ $urlparams = [];
$urlparams['submissionid'] = $teacherfeedback->submissionid;
$urlparams['assessorid'] = $teacherfeedback->assessorid;
$urlparams['isfinalgrade'] = $teacherfeedback->isfinalgrade;
diff --git a/classes/controllers/moderations_controller.php b/classes/controllers/moderations_controller.php
index 16cfdbcf..d80c822c 100644
--- a/classes/controllers/moderations_controller.php
+++ b/classes/controllers/moderations_controller.php
@@ -74,7 +74,7 @@ protected function new_moderation() {
$this->check_stage_permissions($this->params['stage_identifier']);
- $urlparams = array();
+ $urlparams = [];
$urlparams['submissionid'] = $moderator_agreement->submissionid;
$urlparams['moderatorid'] = $moderator_agreement->moderatorid;
$urlparams['stage_identifier'] = $moderator_agreement->stage_identifier;
diff --git a/classes/controllers/plagiarism_flagging_controller.php b/classes/controllers/plagiarism_flagging_controller.php
index a5326d87..e73f66c4 100644
--- a/classes/controllers/plagiarism_flagging_controller.php
+++ b/classes/controllers/plagiarism_flagging_controller.php
@@ -69,7 +69,7 @@ protected function new_plagiarism_flag() {
$ability = new ability(user::find($USER), $this->coursework);
$ability->require_can('new', $plagiarismflag);
- $urlparams = array();
+ $urlparams = [];
$urlparams['submissionid'] = $plagiarismflag->submissionid;
$PAGE->set_url('/mod/coursework/actions/moderations/new.php', $urlparams);
diff --git a/classes/cron.php b/classes/cron.php
index d5fb181a..6fec6342 100644
--- a/classes/cron.php
+++ b/classes/cron.php
@@ -74,7 +74,7 @@ private static function send_reminders_to_students() {
'users' => 0
);
- $userswhoneedreminding = array();
+ $userswhoneedreminding = [];
$raw_courseworks = $DB->get_records('coursework');
foreach ($raw_courseworks as $raw_coursework) {
@@ -278,7 +278,7 @@ private static function send_first_reminders_to_admins() {
* @global $CFG
* @return string
*/
- public static function coursework_debuggable_query($query, $params = array()) {
+ public static function coursework_debuggable_query($query, $params = []) {
global $CFG;
@@ -310,7 +310,7 @@ private static function send_email_reminders_to_students(array $users, array &$c
global $DB;
$emailcounter = 0;
- $usercounter = array();
+ $usercounter = [];
foreach ($users as $user) {
diff --git a/classes/event/assessable_uploaded.php b/classes/event/assessable_uploaded.php
index fc777a59..7b3a4cc9 100644
--- a/classes/event/assessable_uploaded.php
+++ b/classes/event/assessable_uploaded.php
@@ -30,7 +30,7 @@ class assessable_uploaded extends \core\event\assessable_uploaded {
*
* @var array
*/
- protected $legacyfiles = array();
+ protected $legacyfiles = [];
/**
* Returns description of what happened.
diff --git a/classes/export/csv.php b/classes/export/csv.php
index fc7c7949..81d7999b 100644
--- a/classes/export/csv.php
+++ b/classes/export/csv.php
@@ -78,7 +78,7 @@ public function export() {
$this->csvexport = new csv_export_writer();
$this->add_filename($this->filename);
- $csv_data = array();
+ $csv_data = [];
// headers
$this->add_headers($this->csv_cells);
@@ -111,7 +111,7 @@ public function export() {
* @return array
*/
public function add_cells_to_array($submission, $student, $csv_cells) {
- $row = array();
+ $row = [];
foreach ($csv_cells as $csv_cell) {
if (substr($csv_cell, 0, 8) == 'assessor') {
$stage_dentifier = 'assessor_'.(substr($csv_cell, -1));
@@ -148,7 +148,7 @@ public function add_cells_to_array($submission, $student, $csv_cells) {
* @param $csv_headers
*/
public function add_headers($csv_headers) {
- $headers = array();
+ $headers = [];
foreach ($csv_headers as $header) {
if (substr($header, 0, 8) == 'assessor') {
$stage = (substr($header, -1));
@@ -241,7 +241,7 @@ public function get_submissions($groupid = null, $selected_submission_ids = '')
*/
public function add_csv_data($submission) {
- $csv_data = array();
+ $csv_data = [];
// retrieve all students (even if group coursework)
$students = $submission->get_students();
diff --git a/classes/export/csv/cells/agreedfeedback_cell.php b/classes/export/csv/cells/agreedfeedback_cell.php
index 0bae12bd..3551f7c7 100644
--- a/classes/export/csv/cells/agreedfeedback_cell.php
+++ b/classes/export/csv/cells/agreedfeedback_cell.php
@@ -51,7 +51,7 @@ public function get_header($stage) {
return get_string('agreedgradefeedback', 'coursework');
}
- public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = array()) {
+ public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = []) {
global $DB, $PAGE, $USER;
diff --git a/classes/export/csv/cells/agreedgrade_cell.php b/classes/export/csv/cells/agreedgrade_cell.php
index c158425c..51a54d81 100644
--- a/classes/export/csv/cells/agreedgrade_cell.php
+++ b/classes/export/csv/cells/agreedgrade_cell.php
@@ -42,7 +42,7 @@ public function get_cell($submission, $student, $stage_identifier) {
$agreedgrade = $submission->get_agreed_grade();
if ($this->coursework->is_using_rubric() && $this->coursework->finalstagegrading != 1) {
- $gradedata = array();
+ $gradedata = [];
$this->get_rubric_scores_gradedata($agreedgrade, $gradedata); // multiple parts are handled here
} else {
$gradedata = (!$agreedgrade)? '': $this->get_actual_grade($agreedgrade->grade);
@@ -59,7 +59,7 @@ public function get_cell($submission, $student, $stage_identifier) {
public function get_header($stage) {
if ($this->coursework->is_using_rubric() && $this->coursework->finalstagegrading != 1) {
- $strings = array();
+ $strings = [];
$criterias = $this->coursework->get_rubric_criteria();
foreach ($criterias as $criteria) { // rubrics can have multiple parts, so let's create header for each of it
$strings['agreedgrade'.$criteria['id']] = 'Agreed grade - '.$criteria['description'];
@@ -72,7 +72,7 @@ public function get_header($stage) {
return $strings;
}
- public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = array()) {
+ public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = []) {
global $DB, $PAGE, $USER;
@@ -236,7 +236,7 @@ function get_rubrics($coursework, $csv_cells) {
if ($coursework->is_using_rubric() && $this->coursework->finalstagegrading != 1) {
- $rubricheaders = array();
+ $rubricheaders = [];
$criterias = $coursework->get_rubric_criteria();
diff --git a/classes/export/csv/cells/assessorfeedback_cell.php b/classes/export/csv/cells/assessorfeedback_cell.php
index a694a77c..709fe509 100644
--- a/classes/export/csv/cells/assessorfeedback_cell.php
+++ b/classes/export/csv/cells/assessorfeedback_cell.php
@@ -74,7 +74,7 @@ public function get_header($stage) {
return get_string('assessorfeedbackcsv', 'coursework', $stage);
}
- public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = array()) {
+ public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = []) {
global $DB, $PAGE, $USER;
$agreedgradecap = array('mod/coursework:addagreedgrade', 'mod/coursework:editagreedgrade');
diff --git a/classes/export/csv/cells/assessorgrade_cell.php b/classes/export/csv/cells/assessorgrade_cell.php
index 02c0f548..5b7ce118 100644
--- a/classes/export/csv/cells/assessorgrade_cell.php
+++ b/classes/export/csv/cells/assessorgrade_cell.php
@@ -57,7 +57,7 @@ public function get_cell($submission, $student, $stage_identifier) {
if (($submission->get_agreed_grade() || ($feedback && $ability->can('show', $feedback))) || !$submission->any_editable_feedback_exists() || is_siteadmin($USER->id)) {
if ($this->coursework->is_using_rubric()) {
- $gradedata = array();
+ $gradedata = [];
$this->get_rubric_scores_gradedata($grade, $gradedata); // multiple parts are handled here
} else{
$gradedata = (!$grade)? '': $this->get_actual_grade($grade->grade);
@@ -89,7 +89,7 @@ public function get_cell($submission, $student, $stage_identifier) {
public function get_header($stage) {
if ($this->coursework->is_using_rubric() ) {
- $strings = array();
+ $strings = [];
$criterias = $this->coursework->get_rubric_criteria();
foreach ($criterias as $criteria) { // rubrics can have multiple parts, so let's create header for each of it
$strings['assessorgrade'.$stage.'_'.$criteria['id']] = 'Assessor '.$stage.' - '.$criteria['description'];
@@ -103,7 +103,7 @@ public function get_header($stage) {
}
- public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = array()) {
+ public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = []) {
global $DB, $PAGE, $USER;
if (empty($value)) return true;
@@ -296,7 +296,7 @@ function get_rubrics($coursework, $csv_cells) {
if ($coursework->is_using_rubric()) {
- $rubricheaders = array();
+ $rubricheaders = [];
$criterias = $coursework->get_rubric_criteria();
diff --git a/classes/export/csv/cells/cell_base.php b/classes/export/csv/cells/cell_base.php
index 462dacf6..dfd9e4b4 100644
--- a/classes/export/csv/cells/cell_base.php
+++ b/classes/export/csv/cells/cell_base.php
@@ -250,7 +250,7 @@ public function get_stage_identifier_for_assessor($submission, $student) {
* Function to validate cell for the file upload
* @return mixed
*/
- public function validate_cell($value, $submissions, $stage_dentifier='', $uploadedgradecells = array()) {
+ public function validate_cell($value, $submissions, $stage_dentifier='', $uploadedgradecells = []) {
return true;
}
diff --git a/classes/export/csv/cells/feedbackcomments_cell.php b/classes/export/csv/cells/feedbackcomments_cell.php
index 72c8fb78..0d68e21f 100644
--- a/classes/export/csv/cells/feedbackcomments_cell.php
+++ b/classes/export/csv/cells/feedbackcomments_cell.php
@@ -54,7 +54,7 @@ public function get_header($stage) {
return get_string('feedbackcomment', 'coursework');
}
- public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = array()) {
+ public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = []) {
global $PAGE, $DB, $USER;
diff --git a/classes/export/csv/cells/moderationagreement_cell.php b/classes/export/csv/cells/moderationagreement_cell.php
index 3ada6dfa..a989a1e2 100644
--- a/classes/export/csv/cells/moderationagreement_cell.php
+++ b/classes/export/csv/cells/moderationagreement_cell.php
@@ -38,7 +38,7 @@ class moderationagreement_cell extends cell_base {
public function get_cell($submission, $student, $stage_identifier) {
global $DB;
- $data = array();
+ $data = [];
$moderation_agreement = '';
$moderation = '';
@@ -78,7 +78,7 @@ public function get_cell($submission, $student, $stage_identifier) {
*/
public function get_header($stage) {
- $fields = array();
+ $fields = [];
if ($this->coursework->allocation_enabled()) {
$fields['allocatedmoderatorname'] = 'Allocated moderator name';
$fields['allocatedmoderatorusername'] = 'Allocated moderator username';
diff --git a/classes/export/csv/cells/otherassessors_cell.php b/classes/export/csv/cells/otherassessors_cell.php
index 7c2ff991..f853cfa6 100644
--- a/classes/export/csv/cells/otherassessors_cell.php
+++ b/classes/export/csv/cells/otherassessors_cell.php
@@ -57,7 +57,7 @@ public function get_cell($submission, $student, $stage_identifier) {
AND stage_identifier <> 'final_agreed_1'";
$feedbacks = $DB->get_records_sql($sql, $params);
- $gradedata = array();
+ $gradedata = [];
// $stage_identifier = ($this->coursework->get_max_markers() == 1) ? "assessor_1" : $this->get_stage_identifier_for_assessor($submission, $student);
foreach ($feedbacks as $feedback) {
@@ -132,7 +132,7 @@ public function get_cell($submission, $student, $stage_identifier) {
*/
public function get_header($stage) {
- $fields = array();
+ $fields = [];
for ($i = 1; $i < $this->stages ; $i++) {
if ($this->coursework->is_using_rubric()) {
diff --git a/classes/export/csv/cells/singlegrade_cell.php b/classes/export/csv/cells/singlegrade_cell.php
index ff7e23ff..b190eb5d 100644
--- a/classes/export/csv/cells/singlegrade_cell.php
+++ b/classes/export/csv/cells/singlegrade_cell.php
@@ -44,7 +44,7 @@ public function get_cell($submission, $student, $stage_identifier) {
$grade = $submission->get_assessor_feedback_by_stage($stage_identifier);
if ($this->coursework->is_using_rubric()) {
- $gradedata = array();
+ $gradedata = [];
$this->get_rubric_scores_gradedata($grade, $gradedata); // multiple parts are handled here
} else {
$gradedata = (!$grade)? '': $this->get_actual_grade($grade->grade);
@@ -61,7 +61,7 @@ public function get_cell($submission, $student, $stage_identifier) {
public function get_header($stage) {
if ($this->coursework->is_using_rubric()) {
- $strings = array();
+ $strings = [];
$criterias = $this->coursework->get_rubric_criteria();
foreach ($criterias as $criteria) { // rubrics can have multiple parts, so let's create header for each of it
$strings['singlegrade'.$criteria['id']] = $criteria['description'];
@@ -73,7 +73,7 @@ public function get_header($stage) {
return $strings;
}
- public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = array()) {
+ public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = []) {
global $PAGE, $DB, $USER;
@@ -241,7 +241,7 @@ function get_rubrics($coursework, $csv_cells) {
if ($coursework->is_using_rubric()) {
- $rubricheaders = array();
+ $rubricheaders = [];
$criterias = $coursework->get_rubric_criteria();
diff --git a/classes/export/csv/cells/stages_cell.php b/classes/export/csv/cells/stages_cell.php
index 21a4eeec..aa595648 100644
--- a/classes/export/csv/cells/stages_cell.php
+++ b/classes/export/csv/cells/stages_cell.php
@@ -46,7 +46,7 @@ public function get_cell($submission, $student, $stage_identifier) {
$timemodified = $feedback->timemodified;
}
- $gradedata = array();
+ $gradedata = [];
// go through each stage and get a grade, if grade not present then put a placeholder
for ($i = 1; $i <= $this->stages; $i++) {
$stage_identifier = 'assessor_'.$i;
@@ -114,7 +114,7 @@ public function get_cell($submission, $student, $stage_identifier) {
*/
public function get_header($stage) {
- $fields = array();
+ $fields = [];
for ($i = 1; $i <= $this->stages; $i++) {
if ($this->coursework->allocation_enabled()) {
diff --git a/classes/export/csv/cells/submissionfileid_cell.php b/classes/export/csv/cells/submissionfileid_cell.php
index b5278a46..36b014b2 100644
--- a/classes/export/csv/cells/submissionfileid_cell.php
+++ b/classes/export/csv/cells/submissionfileid_cell.php
@@ -46,7 +46,7 @@ public function get_header($stage) {
return get_string('submissionfileid', 'coursework');
}
- public function validate_cell($value, $submissionid, $stage_dentifier='', $uploadedgradecells = array()) {
+ public function validate_cell($value, $submissionid, $stage_dentifier='', $uploadedgradecells = []) {
global $DB;
if (empty($value)) {
diff --git a/classes/export/csv/cells/submissionid_cell.php b/classes/export/csv/cells/submissionid_cell.php
index 4f7c1e7f..1b3685c2 100644
--- a/classes/export/csv/cells/submissionid_cell.php
+++ b/classes/export/csv/cells/submissionid_cell.php
@@ -46,7 +46,7 @@ public function get_header($stage) {
return get_string('submissionid', 'coursework');
}
- public function validate_cell($value, $submissionid, $stage_dentifier = '', $uploadedgradecells = array()) {
+ public function validate_cell($value, $submissionid, $stage_dentifier = '', $uploadedgradecells = []) {
global $DB;
return ($DB->record_exists('coursework_submissions', array('id' => $submissionid, 'courseworkid' => $this->coursework->id()))) ? true: get_string('submissionnotfoundincoursework', 'coursework');
}
diff --git a/classes/export/grading_sheet.php b/classes/export/grading_sheet.php
index 262daa91..799103b1 100644
--- a/classes/export/grading_sheet.php
+++ b/classes/export/grading_sheet.php
@@ -56,7 +56,7 @@ public function get_submissions($groupid = null, $selected_submission_ids = '')
* @var submission[] $submissions
*/
foreach ($submissions as $submission) {
- $stage_identifiers = array();
+ $stage_identifiers = [];
// remove all submissions that a user is not supposed to see
// double marking not allocated
@@ -122,7 +122,7 @@ public function get_submissions($groupid = null, $selected_submission_ids = '')
*/
public function add_csv_data($submission) {
- $csv_data = array();
+ $csv_data = [];
// groups
if ($this->coursework->is_configured_to_have_group_submissions()) {
$group = \mod_coursework\models\group::find($submission->allocatableid);
diff --git a/classes/export/import.php b/classes/export/import.php
index 5e96256c..40a608d2 100644
--- a/classes/export/import.php
+++ b/classes/export/import.php
@@ -73,7 +73,7 @@ public function validate_csv($content, $encoding, $delimeter, $csv_cells) {
$csvreader->init();
- $errors = array();
+ $errors = [];
$s = 0;
$submissions = $this->get_submissions();
@@ -95,7 +95,7 @@ public function validate_csv($content, $encoding, $delimeter, $csv_cells) {
$offset = 0;
// Holds details on grades that have been successfully uploaded for the current line
- $uploadedgradecells = array();
+ $uploadedgradecells = [];
for ($z = 0; $z < count($line); $z++) {
@@ -179,7 +179,7 @@ function rubric_count_correct($csvheader, $linefromimportedcsv) {
if (strpos($ch, $type) !== false) {
- if (empty($typepositions)) $typepositions = array();
+ if (empty($typepositions)) $typepositions = [];
$typefound = true;
$typepositions[] = $i;
@@ -301,7 +301,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
$cells = $csv;
$i = 0;
- $csvline = array();
+ $csvline = [];
//if ((!$this->coursework->is_using_rubric() && sizeof($line) != sizeof($cells)) || ($this->coursework->is_using_rubric() && !$this->rubric_count_correct($csv, $line))) {
//if (sizeof($line) != sizeof($cells)) {
@@ -333,7 +333,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
$coursework = $submission->get_coursework();
- $stages = array();
+ $stages = [];
if (!$coursework->has_multiple_markers()) {
$stages['singlegrade'] = $this->get_stage_identifier($csvline['submissionid'], 'singlegrade');
@@ -400,8 +400,8 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
if ($coursework->is_using_rubric() && !($stage == 'final_agreed_1' && $this->coursework->finalstagegrading == 1)) {
//array that will hold the advanced grade data
- $criteriagradedata = array();
- $criteriagradedata['criteria'] = array();
+ $criteriagradedata = [];
+ $criteriagradedata['criteria'] = [];
$criterias = $this->coursework->get_rubric_criteria();
@@ -444,7 +444,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
$critidx = 0;
// This assumes that the data in the csv is in the correct criteria order.....it should be
foreach ($criterias as $c) {
- $criteriagrade = array();
+ $criteriagrade = [];
// We need to get the levelid for the value that the criteria has been given
diff --git a/classes/file_importer.php b/classes/file_importer.php
index b85d0263..5839e832 100644
--- a/classes/file_importer.php
+++ b/classes/file_importer.php
@@ -100,11 +100,11 @@ public function import_zip_files($coursework, $feedbackstage, $overwritecurrent)
@set_time_limit(ASSIGNFEEDBACK_FILE_MAXFILEUNZIPTIME);
- $results = array();
+ $results = [];
$feedbackfilesupdated = 0;
$feedbackfilesadded = 0;
- $userswithnewfeedback = array();
+ $userswithnewfeedback = [];
$contextid = $coursework->get_context_id();
$fs = get_file_storage();
diff --git a/classes/files.php b/classes/files.php
index 5c988cdf..d1504677 100644
--- a/classes/files.php
+++ b/classes/files.php
@@ -44,7 +44,7 @@ abstract class files implements countable {
/**
* @param array $files
*/
- public function __construct($files = array()) {
+ public function __construct($files = []) {
$this->files = $files;
}
diff --git a/classes/forms/advance_plugins_form.php b/classes/forms/advance_plugins_form.php
index d52bd57e..9c2d4932 100644
--- a/classes/forms/advance_plugins_form.php
+++ b/classes/forms/advance_plugins_form.php
@@ -47,7 +47,7 @@ public function definition() {
$mform =& $this->_form;
- $mform->addElement('editor', 'text_element', get_string('comment', 'mod_coursework'), array());
+ $mform->addElement('editor', 'text_element', get_string('comment', 'mod_coursework'), []);
$mform->setType('editor', PARAM_RAW);
$file_manager_options = array(
diff --git a/classes/forms/assessor_feedback_mform.php b/classes/forms/assessor_feedback_mform.php
index 29303467..fb419e14 100644
--- a/classes/forms/assessor_feedback_mform.php
+++ b/classes/forms/assessor_feedback_mform.php
@@ -134,7 +134,7 @@ public function get_grading_controller() {
*/
public function add_submit_buttons($draftenabled, $feedbackid) {
- $button_array = array();
+ $button_array = [];
if ($draftenabled) {
$button_array[] = $this->_form->createElement('submit', 'submitfeedbackbutton', get_string('saveasdraft', 'coursework'));
diff --git a/classes/forms/choose_student_for_submission_mform.php b/classes/forms/choose_student_for_submission_mform.php
index 44427fb8..78936938 100644
--- a/classes/forms/choose_student_for_submission_mform.php
+++ b/classes/forms/choose_student_for_submission_mform.php
@@ -54,7 +54,7 @@ protected function definition() {
return;
}
- $options = array();
+ $options = [];
$allnames = \core_user\fields::get_name_fields();
foreach ($students as $student) {
diff --git a/classes/forms/deadline_extension_form.php b/classes/forms/deadline_extension_form.php
index 08a16636..b6083172 100644
--- a/classes/forms/deadline_extension_form.php
+++ b/classes/forms/deadline_extension_form.php
@@ -90,7 +90,7 @@ public function validation($data, $files) {
$deadline = $this->get_coursework()->deadline;
}
- $errors = array();
+ $errors = [];
if ($data['extended_deadline'] <= $deadline) {
$errors['extended_deadline'] = 'The new deadline must be later than the current deadline';
}
diff --git a/classes/forms/personal_deadline_form.php b/classes/forms/personal_deadline_form.php
index c09d5576..73ef6471 100644
--- a/classes/forms/personal_deadline_form.php
+++ b/classes/forms/personal_deadline_form.php
@@ -68,7 +68,7 @@ private function get_coursework() {
* @return array
*/
public function validation($data, $files) {
- $errors = array();
+ $errors = [];
if ($data['personal_deadline'] <= time()) {
$errors['personal_deadline'] = 'The new deadline you chose has already passed. Please select appropriate deadline';
}
diff --git a/classes/forms/publish_form.php b/classes/forms/publish_form.php
index dafc95d3..d97383f0 100644
--- a/classes/forms/publish_form.php
+++ b/classes/forms/publish_form.php
@@ -44,7 +44,7 @@ public function definition() {
$this->_form->addElement('hidden', 'id', $this->_customdata['cmid']);
$this->_form->setType('id', PARAM_INT);
- $attributes = array();
+ $attributes = [];
$explaintext = false;
$should_release = true;
diff --git a/classes/forms/student_submission_form.php b/classes/forms/student_submission_form.php
index e60d65e7..b37d2dc8 100644
--- a/classes/forms/student_submission_form.php
+++ b/classes/forms/student_submission_form.php
@@ -299,7 +299,7 @@ protected function add_submit_buttons_to_form() {
$ability = new ability(user::find($USER), $this->get_coursework());
- $button_array = array();
+ $button_array = [];
// If submitting on behalf of someone else, we want to make sure that we don't have people leaving it in a draft
// state because the reason for doing submit on behalf of in the first place is that the student cannot use the
// interface themselves, so they are unable to come back later to finalise it themselves.
@@ -403,7 +403,7 @@ protected function get_file_manager_options() {
*/
protected function make_plagiarism_instructions() {
$plagiarism_helpers = $this->get_coursework()->get_plagiarism_helpers();
- $plagiarism_instructions = array();
+ $plagiarism_instructions = [];
foreach ($plagiarism_helpers as $helper) {
if ($helper->file_submission_instructions()) {
$plagiarism_instructions[] = $helper->file_submission_instructions();
diff --git a/classes/forms/upload_feedback_form.php b/classes/forms/upload_feedback_form.php
index bde45e63..7f49a791 100644
--- a/classes/forms/upload_feedback_form.php
+++ b/classes/forms/upload_feedback_form.php
@@ -45,7 +45,7 @@ function definition() {
$mform->addElement('hidden', 'cmid', $this->cmid);
$mform->setType('cmid', PARAM_RAW);
- $options = array();
+ $options = [];
if ($this->coursework->get_max_markers() > 1) {
diff --git a/classes/framework/ability.php b/classes/framework/ability.php
index 7712ca3a..de2bc22c 100644
--- a/classes/framework/ability.php
+++ b/classes/framework/ability.php
@@ -54,7 +54,7 @@ abstract class ability {
/**
* @var rule[]
*/
- protected $rules = array();
+ protected $rules = [];
/**
* We use a different instance of the class for each user. This makes it a bit cleaner.
@@ -158,7 +158,7 @@ protected function get_rule($action, $type) {
* @return array
*/
protected function classname_mappings() {
- return array();
+ return = [];
}
/**
diff --git a/classes/framework/table_base.php b/classes/framework/table_base.php
index e104fffc..06b93d57 100644
--- a/classes/framework/table_base.php
+++ b/classes/framework/table_base.php
@@ -113,7 +113,7 @@ public static function find($db_record, $reload = true) {
* @return array
* @throws \coding_exception
*/
- public static function find_all($params = array()) {
+ public static function find_all($params = []) {
if (!is_array($params)) {
throw new \coding_exception('::all() require an array of parameters');
@@ -182,7 +182,7 @@ protected static function instantiate_objects($params) {
global $DB;
$raw_records = $DB->get_records(static::get_table_name(), $params);
- $objects = array();
+ $objects = [];
$klass = get_called_class();
foreach ($raw_records as $raw_record) {
$objects[$raw_record->id] = new $klass($raw_record);
@@ -513,7 +513,7 @@ private function build_data_object_to_save($sneakily = false) {
* @param array|table_base $conditions key value pairs of DB columns
* @return bool
*/
- public static function exists($conditions = array()) {
+ public static function exists($conditions = []) {
global $DB;
if (is_number($conditions)) {
@@ -533,7 +533,7 @@ public static function exists($conditions = array()) {
* @param array $conditions
* @return int
*/
- public static function count($conditions = array()) {
+ public static function count($conditions = []) {
global $DB;
foreach ($conditions as $colname => $value) {
@@ -597,7 +597,7 @@ public function __toString() {
* @return array
*/
public function to_array() {
- $data = array();
+ $data = [];
// Only save the non-null fields.
foreach (static::get_column_names() as $column_name) {
diff --git a/classes/grading_report.php b/classes/grading_report.php
index 4aa19275..b806f21b 100644
--- a/classes/grading_report.php
+++ b/classes/grading_report.php
@@ -351,7 +351,7 @@ public function get_table_rows_for_page($rowcount = false) {
$participants = $this->coursework->get_allocatables();
// Make tablerow objects so we can use the methods to check permissions and set things.
- $rows = array();
+ $rows = [];
$row_class = $this->coursework->has_multiple_markers() ? 'mod_coursework\grading_table_row_multi' : 'mod_coursework\grading_table_row_single';
$ability = new ability(user::find($USER, false), $this->get_coursework());
diff --git a/classes/models/coursework.php b/classes/models/coursework.php
index 7e70851e..6712f23f 100644
--- a/classes/models/coursework.php
+++ b/classes/models/coursework.php
@@ -237,7 +237,7 @@ class coursework extends table_base {
/**
* @var array
*/
- protected $stages = array();
+ protected $stages = [];
/**
* @var \context Instance of a moodle context, i.e. that of the coursemodule for this coursework.
@@ -611,7 +611,7 @@ public function get_participants($groups = array(0)) {
// Fetch the list of ids of all participants - this may get really long so fetch just id.
$groups = (array)$groups;
- $allusers = array();
+ $allusers = [];
foreach ($groups as $groupdid) {
$allusers = array_merge($allusers, get_enrolled_users($this->get_context(), 'mod/coursework:submit', $groupdid, 'u.id'));
}
@@ -819,7 +819,7 @@ public function get_allocatable_identifier_hash($allocatable) {
*/
public function get_plagiarism_helpers() {
$enabled_plagiarism_plugins = array_keys(\core_component::get_plugin_list('plagiarism'));
- $objects = array();
+ $objects = [];
foreach ($enabled_plagiarism_plugins as $plugin_name) {
$class_name = "\\mod_coursework\\plagiarism_helpers\\{$plugin_name}";
if (class_exists($class_name)) {
@@ -950,7 +950,7 @@ public function pack_files() {
if (!$submissions) {
return false;
}
- $files_for_zipping = array();
+ $files_for_zipping = [];
$fs = get_file_storage();
$grading_sheet = new \mod_coursework\export\grading_sheet($this, null, null);
@@ -1287,7 +1287,7 @@ public function get_all_submissions() {
*/
public function get_submissions_needing_grading() {
- $needsgrading = array();
+ $needsgrading = [];
$submissions = $this->get_finalised_submissions();
foreach ($submissions as $submission) {
@@ -1314,7 +1314,7 @@ public function get_submissions_needing_grading() {
*/
public function get_graded_submissions_by_stage($stage_identifier) {
- $graded = array();
+ $graded = [];
$submissions = $this->get_finalised_submissions();
foreach ($submissions as $submission) {
@@ -1336,7 +1336,7 @@ public function get_graded_submissions_by_stage($stage_identifier) {
public function get_assessor_graded_submissions($assessorid) {
global $DB;
- $graded = array();
+ $graded = [];
$params = array('courseworkid' => $this->id, 'assessorid' => $assessorid);
$sql = "SELECT cs.id
FROM {coursework_feedbacks} cf
@@ -1925,7 +1925,7 @@ public function due_to_send_second_reminders($deadline) {
* @return user[]
*/
public function get_students() {
- $users = array();
+ $users = [];
$raw_users = get_enrolled_users($this->get_context(), 'mod/coursework:submit');
// filter students who are restricted from the coursework
@@ -1967,7 +1967,7 @@ public function get_students_who_have_not_yet_submitted() {
* @return user[]
*/
public function initial_assessors($student) {
- $assessors = array();
+ $assessors = [];
$stages = $this->get_assessor_marking_stages();
// If allocations, send the allocated teachers.
// Otherwise send everyone.
@@ -2194,7 +2194,7 @@ public function marking_stages() {
* @return stage_base[]
*/
public function get_assessor_marking_stages() {
- $stages = array();
+ $stages = [];
for ($i = 1; $i <= $this->get_max_markers(); $i++) {
$stages[] = new assessor($this, 'assessor_' . $i);
@@ -2258,7 +2258,7 @@ public final static function get_image($text, $image_name) {
public function get_allocatables() {
global $DB;
- $allocatables = array();
+ $allocatables = [];
if ($this->is_configured_to_have_group_submissions()) {
if ($this->grouping_id) {
@@ -2474,7 +2474,7 @@ public function finalise_all() {
public static function extension_reasons() {
global $CFG;
- $extension_reasons = array();
+ $extension_reasons = [];
if (!empty($CFG->coursework_extension_reasons_list)) {
$extension_reasons = $CFG->coursework_extension_reasons_list;
$extension_reasons = explode("\n", $extension_reasons);
diff --git a/classes/models/group.php b/classes/models/group.php
index 2a639a6d..418d8979 100644
--- a/classes/models/group.php
+++ b/classes/models/group.php
@@ -86,7 +86,7 @@ public function get_members($context, $cm) {
$info = new \core_availability\info_module(\cm_info::create($cm));
$members = $info->filter_user_list($members);
- $member_objects = array();
+ $member_objects = [];
foreach ($members as $member) {
// check is member has capability to submit in this coursework (to get rid of assessors if they are placed in the group)
if (has_capability('mod/coursework:submit', $context, $member)) {
diff --git a/classes/models/null_user.php b/classes/models/null_user.php
index f58a6c91..a60bc4c2 100644
--- a/classes/models/null_user.php
+++ b/classes/models/null_user.php
@@ -84,7 +84,7 @@ public function has_agreed_feedback($coursework) {
* @return feedback[]
*/
public function get_initial_feedbacks($coursework) {
- return array();
+ return = [];
}
/**
diff --git a/classes/models/outstanding_marking.php b/classes/models/outstanding_marking.php
index eeed8442..e39ae6cf 100644
--- a/classes/models/outstanding_marking.php
+++ b/classes/models/outstanding_marking.php
@@ -40,7 +40,7 @@ public function get_to_grade_initial_count($cwkrecord, $userid) {
$coursework = new \mod_coursework\models\coursework($cwkrecord);
- $initialsubmissions = array();
+ $initialsubmissions = [];
if ($this->should_get_to_mark_initial_grade_info($coursework->id, $userid)) {
@@ -69,7 +69,7 @@ public function get_to_grade_agreed_count($cwkrecord, $userid) {
$coursework = new \mod_coursework\models\coursework($cwkrecord);
- $agreedsubmissions = array();
+ $agreedsubmissions = [];
//AGREED GRADE INFORMATION
@@ -94,7 +94,7 @@ private function get_single_marker_initial_grade_submissions_to_mark($coursework
global $DB;
- $sqlparams = array();
+ $sqlparams = [];
$sqltable = "";
$sqlextra = "";
@@ -156,7 +156,7 @@ private function get_multiple_to_mark_sampled_initial_grade_submissions($coursew
GROUP BY a.allocatableid, a.csid, a.fid, a.id, a.count_feedback, a.courseworkid
HAVING (count_feedback < $countsamples )";
- $sqlparams = array();
+ $sqlparams = [];
$sqlparams['subassessorid'] = $userid;
$sqlparams['subcourseworkid'] = $courseworkid;
$sqlparams['courseworkid'] = $courseworkid;
@@ -175,7 +175,7 @@ private function get_multiple_to_mark_initial_grade_submissions($courseworkid, $
global $DB;
- $sqlparams = array();
+ $sqlparams = [];
$sqltable = '';
$sqlextra = '';
diff --git a/classes/models/submission.php b/classes/models/submission.php
index de410876..11599e52 100644
--- a/classes/models/submission.php
+++ b/classes/models/submission.php
@@ -384,7 +384,7 @@ public function get_submission_files($reset = false) {
}
if ($this->id < 1 || $this->get_context_id() < 1) {
- return new submission_files(array(), $this);
+ return new submission_files([], $this);
}
$submission_files = $this->get_files();
@@ -395,7 +395,7 @@ public function get_submission_files($reset = false) {
return $this->submission_files;
}
- $files = new submission_files(array(), $this);
+ $files = new submission_files([], $this);
return $files;
}
@@ -461,7 +461,7 @@ public function get_first_feedback() {
public function get_assessor_feedbacks() {
if (!$this->id) {
// No submission - empty placeholder.
- return array();
+ return = [];
}
if (!isset(feedback::$pool[$this->courseworkid]['submissionid-stage_identifier_index'])) {
@@ -519,7 +519,7 @@ public function get_agreed_grade() {
if (!$this->id) {
// No submission - empty placeholder.
- return array();
+ return = [];
}
$params = [
@@ -938,7 +938,7 @@ public function get_allocatable() {
* @return user[]
*/
public function get_students() {
- $allocatables = array();
+ $allocatables = [];
if ($this->get_coursework()->is_configured_to_have_group_submissions() && $this->allocatabletype == 'group') {
/**
* @var group $group
diff --git a/classes/personal_deadline/table/builder.php b/classes/personal_deadline/table/builder.php
index 8e783c2a..ec6d52e2 100644
--- a/classes/personal_deadline/table/builder.php
+++ b/classes/personal_deadline/table/builder.php
@@ -71,7 +71,7 @@ public function __construct($coursework, array $options) {
public function get_rows() {
$allocatables = $this->get_coursework()->get_allocatables();
- $rows = array();
+ $rows = [];
foreach ($allocatables as $allocatable) {
$rows[] = new row_builder($this, $allocatable);
}
diff --git a/classes/render_helpers/grading_report/cells/_user_cell.php b/classes/render_helpers/grading_report/cells/_user_cell.php
index a87135ed..015e3f2e 100644
--- a/classes/render_helpers/grading_report/cells/_user_cell.php
+++ b/classes/render_helpers/grading_report/cells/_user_cell.php
@@ -67,7 +67,7 @@ public function get_table_cell($rowobject) {
* @param array $options
* @return string
*/
- public function get_table_header($options = array()) {
+ public function get_table_header($options = []) {
$viewanonymous = has_capability('mod/coursework:viewanonymous', $this->coursework->get_context());
diff --git a/classes/render_helpers/grading_report/cells/cell_base.php b/classes/render_helpers/grading_report/cells/cell_base.php
index 7fb04a8b..7b031e7e 100644
--- a/classes/render_helpers/grading_report/cells/cell_base.php
+++ b/classes/render_helpers/grading_report/cells/cell_base.php
@@ -39,7 +39,7 @@ abstract class cell_base implements cell_interface {
/**
* @param array $items
*/
- public function __construct($items = array()) {
+ public function __construct($items = []) {
$this->coursework = $items['coursework'];
$this->after_initialisation($items);
}
diff --git a/classes/render_helpers/grading_report/cells/cell_interface.php b/classes/render_helpers/grading_report/cells/cell_interface.php
index 234589ec..0dd5bb2d 100644
--- a/classes/render_helpers/grading_report/cells/cell_interface.php
+++ b/classes/render_helpers/grading_report/cells/cell_interface.php
@@ -41,7 +41,7 @@ public function get_table_cell($rowobject);
* @param array $options
* @return string
*/
- public function get_table_header($options = array());
+ public function get_table_header($options = []);
/**
* @return string
diff --git a/classes/render_helpers/grading_report/cells/email_cell.php b/classes/render_helpers/grading_report/cells/email_cell.php
index 34b68aab..2615fceb 100644
--- a/classes/render_helpers/grading_report/cells/email_cell.php
+++ b/classes/render_helpers/grading_report/cells/email_cell.php
@@ -50,7 +50,7 @@ public function get_table_cell($rowobject) {
* @param array $options
* @return string
*/
- public function get_table_header($options = array()) {
+ public function get_table_header($options = []) {
return "Email";
}
diff --git a/classes/render_helpers/grading_report/cells/first_name_cell.php b/classes/render_helpers/grading_report/cells/first_name_cell.php
index 68c41318..3528de99 100644
--- a/classes/render_helpers/grading_report/cells/first_name_cell.php
+++ b/classes/render_helpers/grading_report/cells/first_name_cell.php
@@ -50,7 +50,7 @@ public function get_table_cell($rowobject) {
* @param array $options
* @return string
*/
- public function get_table_header($options = array()) {
+ public function get_table_header($options = []) {
return "First Name";
}
diff --git a/classes/render_helpers/grading_report/cells/first_name_letter_cell.php b/classes/render_helpers/grading_report/cells/first_name_letter_cell.php
index 2403f4ad..b6145057 100644
--- a/classes/render_helpers/grading_report/cells/first_name_letter_cell.php
+++ b/classes/render_helpers/grading_report/cells/first_name_letter_cell.php
@@ -58,7 +58,7 @@ public function get_table_cell($rowobject) {
* @param array $options
* @return string
*/
- public function get_table_header($options = array()) {
+ public function get_table_header($options = []) {
return "First Letter - First Name";
}
diff --git a/classes/render_helpers/grading_report/cells/grade_for_gradebook_cell.php b/classes/render_helpers/grading_report/cells/grade_for_gradebook_cell.php
index 25088b0a..d11947e2 100644
--- a/classes/render_helpers/grading_report/cells/grade_for_gradebook_cell.php
+++ b/classes/render_helpers/grading_report/cells/grade_for_gradebook_cell.php
@@ -55,7 +55,7 @@ public function get_table_cell($row_object) {
* @throws coding_exception
* @return string
*/
- public function get_table_header($options = array()) {
+ public function get_table_header($options = []) {
return get_string('provisionalgrade', 'mod_coursework');
}
diff --git a/classes/render_helpers/grading_report/cells/group_cell.php b/classes/render_helpers/grading_report/cells/group_cell.php
index c9ae602b..4a0bfd52 100644
--- a/classes/render_helpers/grading_report/cells/group_cell.php
+++ b/classes/render_helpers/grading_report/cells/group_cell.php
@@ -70,7 +70,7 @@ public function get_table_cell($row_object) {
* @param array $options
* @return string
*/
- public function get_table_header($options = array()) {
+ public function get_table_header($options = []) {
//adding this line so that the sortable heading function will make a sortable link unique to the table
// If tablename is set
diff --git a/classes/render_helpers/grading_report/cells/idnumber_cell.php b/classes/render_helpers/grading_report/cells/idnumber_cell.php
index 593d2d66..7043b205 100644
--- a/classes/render_helpers/grading_report/cells/idnumber_cell.php
+++ b/classes/render_helpers/grading_report/cells/idnumber_cell.php
@@ -47,7 +47,7 @@ public function get_table_cell($rowobject) {
* @param array $options
* @return string
*/
- public function get_table_header($options = array()) {
+ public function get_table_header($options = []) {
$viewanonymous = has_capability('mod/coursework:viewanonymous', $this->coursework->get_context());
diff --git a/classes/render_helpers/grading_report/cells/last_name_cell.php b/classes/render_helpers/grading_report/cells/last_name_cell.php
index 0b498948..d423ab55 100644
--- a/classes/render_helpers/grading_report/cells/last_name_cell.php
+++ b/classes/render_helpers/grading_report/cells/last_name_cell.php
@@ -50,7 +50,7 @@ public function get_table_cell($rowobject) {
* @param array $options
* @return string
*/
- public function get_table_header($options = array()) {
+ public function get_table_header($options = []) {
return "Last Name";
}
diff --git a/classes/render_helpers/grading_report/cells/last_name_letter_cell.php b/classes/render_helpers/grading_report/cells/last_name_letter_cell.php
index 392d79f3..f0e59a40 100644
--- a/classes/render_helpers/grading_report/cells/last_name_letter_cell.php
+++ b/classes/render_helpers/grading_report/cells/last_name_letter_cell.php
@@ -58,7 +58,7 @@ public function get_table_cell($rowobject) {
* @param array $options
* @return string
*/
- public function get_table_header($options = array()) {
+ public function get_table_header($options = []) {
return "Last Name Letter";
}
diff --git a/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php b/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php
index b87398e4..a7d65c7d 100644
--- a/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php
+++ b/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php
@@ -125,7 +125,7 @@ public function get_table_cell($rowobject) {
* @param array $options
* @return string
*/
- public function get_table_header($options = array()) {
+ public function get_table_header($options = []) {
return get_string('tableheadmoderationagreement', 'coursework');
}
diff --git a/classes/render_helpers/grading_report/cells/moderation_cell.php b/classes/render_helpers/grading_report/cells/moderation_cell.php
index eafb4f70..43182223 100644
--- a/classes/render_helpers/grading_report/cells/moderation_cell.php
+++ b/classes/render_helpers/grading_report/cells/moderation_cell.php
@@ -83,7 +83,7 @@ public function get_table_cell($row_object) {
* @param array $options
* @return string
*/
- public function get_table_header($options = array()) {
+ public function get_table_header($options = []) {
//adding this line so that the sortable heading function will make a sortable link unique to the table
// If tablename is set
diff --git a/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php b/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
index b5e50755..3a3d1a2f 100644
--- a/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
+++ b/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
@@ -165,7 +165,7 @@ public function get_content($rowobject) {
* @param array $options
* @return string
*/
- public function get_table_header($options = array()) {
+ public function get_table_header($options = []) {
//adding this line so that the sortable heading function will make a sortable link unique to the table
// If tablename is set
diff --git a/classes/render_helpers/grading_report/cells/personal_deadline_cell.php b/classes/render_helpers/grading_report/cells/personal_deadline_cell.php
index d56675ff..c4f42b85 100644
--- a/classes/render_helpers/grading_report/cells/personal_deadline_cell.php
+++ b/classes/render_helpers/grading_report/cells/personal_deadline_cell.php
@@ -81,7 +81,7 @@ public function get_table_cell($row_object) {
* @param array $options
* @return string
*/
- public function get_table_header($options = array()) {
+ public function get_table_header($options = []) {
$tablename = (!empty($options['tablename'])) ? $options['tablename'] : '' ;
diff --git a/classes/render_helpers/grading_report/cells/plagiarism_cell.php b/classes/render_helpers/grading_report/cells/plagiarism_cell.php
index 0a13d675..c5040102 100644
--- a/classes/render_helpers/grading_report/cells/plagiarism_cell.php
+++ b/classes/render_helpers/grading_report/cells/plagiarism_cell.php
@@ -61,7 +61,7 @@ public function get_table_cell($rowobject) {
* @param array $options
* @return string
*/
- public function get_table_header($options = array()) {
+ public function get_table_header($options = []) {
return get_string('plagiarism', 'mod_coursework');
}
diff --git a/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php b/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php
index 33312b45..170629cf 100644
--- a/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php
+++ b/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php
@@ -82,7 +82,7 @@ public function get_table_cell($rowobject) {
* @param array $options
* @return string
*/
- public function get_table_header($options = array()) {
+ public function get_table_header($options = []) {
return (get_string('tableheadplagiarismalert', 'coursework'));
}
diff --git a/classes/render_helpers/grading_report/cells/single_assessor_feedback_cell.php b/classes/render_helpers/grading_report/cells/single_assessor_feedback_cell.php
index 79c88627..13b0845d 100644
--- a/classes/render_helpers/grading_report/cells/single_assessor_feedback_cell.php
+++ b/classes/render_helpers/grading_report/cells/single_assessor_feedback_cell.php
@@ -140,7 +140,7 @@ public function get_content($rowobject) {
* @param array $options
* @return string
*/
- public function get_table_header($options = array()) {
+ public function get_table_header($options = []) {
return get_string('feedbackandgrading', 'coursework');
}
diff --git a/classes/render_helpers/grading_report/cells/status_cell.php b/classes/render_helpers/grading_report/cells/status_cell.php
index 898d6941..348ed3e2 100644
--- a/classes/render_helpers/grading_report/cells/status_cell.php
+++ b/classes/render_helpers/grading_report/cells/status_cell.php
@@ -47,7 +47,7 @@ public function get_table_cell($rowobject) {
* @param array $options
* @return string
*/
- public function get_table_header($options = array()) {
+ public function get_table_header($options = []) {
return get_string('tableheadstatus', 'coursework');
}
diff --git a/classes/render_helpers/grading_report/cells/submission_cell.php b/classes/render_helpers/grading_report/cells/submission_cell.php
index 7c467bbb..27589956 100644
--- a/classes/render_helpers/grading_report/cells/submission_cell.php
+++ b/classes/render_helpers/grading_report/cells/submission_cell.php
@@ -132,7 +132,7 @@ public function get_table_cell($rowobject) {
* @param array $options
* @return string
*/
- public function get_table_header($options = array()) {
+ public function get_table_header($options = []) {
$tablename = (isset($options['tablename'])) ? $options['tablename'] : '' ;
diff --git a/classes/render_helpers/grading_report/cells/time_submitted_cell.php b/classes/render_helpers/grading_report/cells/time_submitted_cell.php
index 158559d2..0a071889 100644
--- a/classes/render_helpers/grading_report/cells/time_submitted_cell.php
+++ b/classes/render_helpers/grading_report/cells/time_submitted_cell.php
@@ -195,7 +195,7 @@ private function standardize_time_for_compare($time) {
* @param array $options
* @return string
*/
- public function get_table_header($options = array()) {
+ public function get_table_header($options = []) {
//adding this line so that the sortable heading function will make a sortable link unique to the table
// If tablename is set
diff --git a/classes/render_helpers/grading_report/cells/user_cell.php b/classes/render_helpers/grading_report/cells/user_cell.php
index b9b0d95b..a99ad0b5 100644
--- a/classes/render_helpers/grading_report/cells/user_cell.php
+++ b/classes/render_helpers/grading_report/cells/user_cell.php
@@ -74,7 +74,7 @@ public function get_table_cell($rowobject) {
* @param array $options
* @return string
*/
- public function get_table_header($options = array()) {
+ public function get_table_header($options = []) {
$viewanonymous = has_capability('mod/coursework:viewanonymous', $this->coursework->get_context());
diff --git a/classes/router.php b/classes/router.php
index 4989ad0a..8077e876 100644
--- a/classes/router.php
+++ b/classes/router.php
@@ -68,7 +68,7 @@ public static function instance() {
* @throws \coding_exception
* @return moodle_url|string url
*/
- public function get_path($path_name, $items = array(), $as_url_object = false, $escaped = true) {
+ public function get_path($path_name, $items = [], $as_url_object = false, $escaped = true) {
global $CFG;
@@ -263,7 +263,7 @@ public function get_path($path_name, $items = array(), $as_url_object = false, $
$auto_path = '/mod/coursework/actions/' . $this->pluralise($type) . '/' . $action . '.php';
if (file_exists($CFG->dirroot . $auto_path)) {
- $params = array();
+ $params = [];
if (array_key_exists($type, $items)) {
$params[$type.'id'] = $items[$type]->id;
} else if (array_key_exists('coursework', $items)) {
diff --git a/classes/sample_set_rule/range_sample_type.php b/classes/sample_set_rule/range_sample_type.php
index 63e9a3ea..d841c1de 100644
--- a/classes/sample_set_rule/range_sample_type.php
+++ b/classes/sample_set_rule/range_sample_type.php
@@ -86,13 +86,13 @@ public function add_form_elements($assessor_number=0) {
public function range_elements($assessor_number, $sequence, $dbrecord=false) {
- $percentage_options = array();
+ $percentage_options = [];
for ($i = 0;$i < 110; $i = $i + 10) {
$percentage_options[$i] = "{$i}";
}
- $scale = array();
+ $scale = [];
if ($this->coursework->grade > 0) {
for ($i = 0;$i <= $this->coursework->grade; $i++) {
@@ -284,7 +284,7 @@ function change_options(element) {
$(samplefromid).find('option').remove();
$(sampletoid).find('option').remove();
- var selectValues = Array();
+ var selectValues = [];
var type = PERCENT;
@@ -399,7 +399,7 @@ private function rationalise($ruletype, $limit1, $limit2) {
global $DB;
- $limits = array();
+ $limits = [];
$limits[0] = ($limit1>$limit2) ? $limit2 : $limit1;
$limits[1] = ($limit1>$limit2) ? $limit1 : $limit2;
diff --git a/classes/sample_set_rule/total_sample_type.php b/classes/sample_set_rule/total_sample_type.php
index 726acf8c..aee8e44f 100644
--- a/classes/sample_set_rule/total_sample_type.php
+++ b/classes/sample_set_rule/total_sample_type.php
@@ -64,7 +64,7 @@ public function add_form_elements($assessor_number=0) {
$selected = ($record = $DB->get_record_sql($sql)) ? array($record->upperlimit => $record->upperlimit) : false;
$checked = ($selected) ? true : false;
- $percentage_options = array();
+ $percentage_options = [];
for ($i = 5;$i <= 100; $i = $i + 5) {
$percentage_options[$i] = "{$i}";
@@ -232,7 +232,7 @@ public function adjust_sample_set($stage_number, &$allocatables, &$manual_sample
}
} else {
- $auto_sample_set = array();
+ $auto_sample_set = [];
}
}
diff --git a/classes/sampling_set_widget.php b/classes/sampling_set_widget.php
index a31c2947..f1d7bbc2 100644
--- a/classes/sampling_set_widget.php
+++ b/classes/sampling_set_widget.php
@@ -91,7 +91,7 @@ public function get_potential_rules() {
$classes = $this->get_potential_rule_class_names();
- $suffixes = array();
+ $suffixes = [];
foreach ($classes as $shortname => $classname) {
$label = get_string($shortname, 'mod_coursework');
@@ -114,10 +114,10 @@ public function get_potential_rule_class_names() {
$dirname = $CFG->dirroot.'/mod/coursework/classes/sample_set_rule/*.php';
$files = glob($dirname);
- $classes = array();
+ $classes = [];
foreach ($files as $file) {
- $matches = array(); // In case we have stuff left over.
+ $matches = []; // In case we have stuff left over.
preg_match('/([^\/]+)\.php/', $file, $matches);
/* @var models\moderation_set_rule $fullclassname */
$rulename = $matches[1];
diff --git a/classes/stages/base.php b/classes/stages/base.php
index 1ca1a8aa..1a701e6c 100644
--- a/classes/stages/base.php
+++ b/classes/stages/base.php
@@ -300,7 +300,7 @@ public function get_teachers() {
// So check again
if (empty($serialised_teachers) || empty(unserialize($serialised_teachers))) {
$teachers = get_enrolled_users($this->coursework->get_context(), $this->assessor_capability());
- $teacher_users = array();
+ $teacher_users = [];
foreach ($teachers as $teacher) {
$teacher_users[] = user::build($teacher);
}
@@ -832,7 +832,7 @@ public function potential_moderator_dropdown($allocatable) {
*/
private function potential_markers_as_options_array() {
$potentialmarkers = $this->get_teachers();
- $options = array();
+ $options = [];
foreach ($potentialmarkers as $marker) {
$options[$marker->id] = $marker->name();
}
@@ -845,7 +845,7 @@ private function potential_markers_as_options_array() {
*/
private function potential_moderators_as_options_array() {
$potentialmoderators = get_enrolled_users($this->coursework->get_course_context(), 'mod/coursework:moderate');
- $options = array();
+ $options = [];
foreach ($potentialmoderators as $moderator) {
$options[$moderator->id] = fullname($moderator);
}
diff --git a/db/upgrade.php b/db/upgrade.php
index e98d9915..9f7f3b84 100644
--- a/db/upgrade.php
+++ b/db/upgrade.php
@@ -103,7 +103,7 @@ function xmldb_coursework_upgrade($oldversion) {
// Alter the comments and write them to the DB.
foreach ($olddata as $datarow) {
$oldcomment = unserialize($datarow->feedbackcomment);
- $newcomment = array();
+ $newcomment = [];
if ($oldcomment) { // Some were blank - probably an earlier experiment.
foreach ($oldcomment as $componentarray) {
$newcomment[] = $componentarray['id'];
@@ -126,7 +126,7 @@ function xmldb_coursework_upgrade($oldversion) {
// Will have to subtract component values from the string one at a time, recording their
// ids if we find the value.
foreach ($olddata as $datarow) {
- $newcomment = array();
+ $newcomment = [];
$oldcomment = $datarow->feedbackcomment; // Comma separated, with lots of extra commas.
$components = $DB->get_records('coursework_form_component',
array('fieldid' => $datarow->fieldid));
@@ -2043,7 +2043,7 @@ function xmldb_coursework_upgrade($oldversion) {
'coursework_sample_set_mbrs');
if ($oldversion < 2015110303) {
- $fields = array();
+ $fields = [];
//Add fields to assist backup annotation
$fielduser = new xmldb_field('allocatableuser', XMLDB_TYPE_INTEGER, '10', true, XMLDB_NOTNULL, null, '0', 'allocatabletype');
$fieldgroup = new xmldb_field('allocatablegroup', XMLDB_TYPE_INTEGER, '10', true, XMLDB_NOTNULL, null, '0', 'allocatableuser');
@@ -2066,7 +2066,7 @@ function xmldb_coursework_upgrade($oldversion) {
}
if ($oldversion < 2015121401) {
- $fields = array();
+ $fields = [];
//Add fields to assist backup annotation
$fieldeditingtime = new xmldb_field('gradeeditingtime', XMLDB_TYPE_INTEGER, '10', true, XMLDB_NOTNULL, null, '0', null);
@@ -2096,7 +2096,7 @@ function xmldb_coursework_upgrade($oldversion) {
}
if ($oldversion < 2016110100) {
- $fields = array();
+ $fields = [];
//Add fields to hold marking deadline enabled
$upgradefield = new xmldb_field('markingdeadlineenabled', XMLDB_TYPE_INTEGER, '1', true, XMLDB_NOTNULL, null, '0', null);
@@ -2112,7 +2112,7 @@ function xmldb_coursework_upgrade($oldversion) {
}
if ($oldversion < 2016110101) {
- $fields = array();
+ $fields = [];
//Add fields to hold intial marking deadline
$upgradefield = new xmldb_field('initialmarkingdeadline', XMLDB_TYPE_INTEGER, '10', true, XMLDB_NOTNULL, null, '0', null);
@@ -2139,7 +2139,7 @@ function xmldb_coursework_upgrade($oldversion) {
}
if ($oldversion < 2016110102) {
- $fields = array();
+ $fields = [];
//Add fields to hold intial marking deadline
$upgradefield = new xmldb_field('markingreminderenabled', XMLDB_TYPE_INTEGER, '1', true, XMLDB_NOTNULL, null, '0', null);
diff --git a/lib.php b/lib.php
index 693c2907..61a948c6 100644
--- a/lib.php
+++ b/lib.php
@@ -49,7 +49,7 @@
* @return array
*/
function coursework_get_file_areas($course, $cm, $context) {
- $areas = array();
+ $areas = [];
if (has_capability('mod/coursework:submit', $context)) {
$areas['submission'] = get_string('submissionfiles', 'coursework');
@@ -949,7 +949,7 @@ function coursework_get_coursework_ids_from_context_id($contextid) {
global $DB;
- $courseworkids = array();
+ $courseworkids = [];
// Is this a coursework?
$context = context::instance_by_id($contextid);
@@ -999,7 +999,7 @@ function coursework_seconds_to_string($seconds) {
get_string('seconds', 'mod_coursework'))
);
- $result = array();
+ $result = [];
foreach ($units as $divisor => $unitame) {
$units = intval($seconds / $divisor);
if ($units) {
@@ -1112,7 +1112,7 @@ function coursework_send_deadline_changed_emails($eventdata) {
// - Link to get to the view.php page.
// - Change since last time.
- $deadlinechangedmessage = array();
+ $deadlinechangedmessage = [];
$strings = new stdClass();
$strings->courseworkname = $coursework->name;
@@ -1170,7 +1170,7 @@ function coursework_plugin_exists($plugintype, $pluginname) {
*/
function coursework_records_to_menu($records, $field1, $field2) {
- $menu = array();
+ $menu = [];
if (!empty($records)) {
foreach ($records as $record) {
diff --git a/mod_form.php b/mod_form.php
index 8e184b0d..1cd06c71 100644
--- a/mod_form.php
+++ b/mod_form.php
@@ -54,7 +54,7 @@ public function definition() {
'ajax'
));
- $PAGE->requires->js_init_call('M.mod_coursework.init', array(), true, $module);
+ $PAGE->requires->js_init_call('M.mod_coursework.init', [], true, $module);
$this->set_form_attributes();
@@ -189,7 +189,7 @@ public function set_data($default_values) {
*/
public function validation($data, $files) {
- $errors = array();
+ $errors = [];
if ($data['startdate'] != 0 && !empty($data['deadline']) && $data['startdate'] > $data['deadline']) {
$errors['startdate'] = get_string('must_be_before_dealdine', 'mod_coursework');
@@ -368,7 +368,7 @@ protected function add_personal_deadline_field() {
$options = array(0 => get_string('no'), 1 => get_string('yes'));
$courseworkid = $this->get_coursework_id();
- $disabled = array();
+ $disabled = [];
if (coursework_personal_deadline_passed($courseworkid)) {
$moodle_form->disabledif('personaldeadlineenabled', 'deadline[enabled]', 'notchecked');
$disabled = array('disabled' => true);
@@ -656,7 +656,7 @@ protected function add_grouping_field() {
$moodle_form =& $this->_form;
$groups_options_result = $DB->get_records('groupings', array('courseid' => $COURSE->id), 'name', 'id, name');
- $groups_options = array();
+ $groups_options = [];
if ($groups_options_result !== false) {
foreach ($groups_options_result as $result) {
$groups_options[$result->id] = $result->name;
@@ -892,7 +892,7 @@ protected function add_assessor_allocation_strategy_field_rdb() {
$options = mod_coursework\allocation\manager::get_allocation_classnames();
- $radioarray = array();
+ $radioarray = [];
$keys = array_keys($options);
foreach ($keys as $key) {
@@ -1277,7 +1277,7 @@ private function add_submission_notification_field() {
$moodle_form =& $this->_form;
- $selectableusers = array();
+ $selectableusers = [];
// capability for user allowed to receive submission notifications
$enrolledusers = get_enrolled_users(context_course::instance($COURSE->id), 'mod/coursework:receivesubmissionnotifications');
diff --git a/renderers/grading_report_renderer.php b/renderers/grading_report_renderer.php
index bc731ec0..517b3f43 100644
--- a/renderers/grading_report_renderer.php
+++ b/renderers/grading_report_renderer.php
@@ -193,7 +193,7 @@ protected function make_table_headers($cell_helpers, $options, $is_multiple_mark
/**
* @return string
*/
- protected function start_table($options = array()) {
+ protected function start_table($options = []) {
$options['width'] = '100%';
$options['class'] = (!empty($options['class'])) ? $options['class'] : '';
$options['class'] .= ' submissions datatabletest display compact';
@@ -264,7 +264,7 @@ private function make_upper_headers($cell_helpers, $is_multiple_markers) {
* @return mixed
*/
private function upper_header_names_and_colspans($cell_helpers) {
- $headers = array();
+ $headers = [];
foreach ($cell_helpers as $helper) {
if (!array_key_exists($helper->header_group(), $headers)) {
diff --git a/renderers/object_renderer.php b/renderers/object_renderer.php
index 80e6cf04..b74a2592 100644
--- a/renderers/object_renderer.php
+++ b/renderers/object_renderer.php
@@ -375,7 +375,7 @@ protected function render_mod_coursework_assessor_feedback_row(mod_coursework_as
public function render_submission_files(mod_coursework_submission_files $files) {
$submission_files = $files->get_files();
- $files_array = array();
+ $files_array = [];
foreach ($submission_files as $file) {
$files_array[] = $this->make_file_link($files, $file);
@@ -394,7 +394,7 @@ public function render_submission_files(mod_coursework_submission_files $files)
public function render_feedback_files(mod_coursework_feedback_files $files) {
- $files_array = array();
+ $files_array = [];
$submission_files = $files->get_files();
foreach ($submission_files as $file) {
$files_array[] = $this->make_file_link($files, $file, 'feedbackfile');
@@ -422,7 +422,7 @@ public function render_submission_files_with_plagiarism_links(mod_coursework_sub
$coursework = $files->get_coursework();
$submission_files = $files->get_files();
$submission = $files->get_submission();
- $files_array = array();
+ $files_array = [];
foreach ($submission_files as $file) {
@@ -461,7 +461,7 @@ public function render_plagiarism_links($files) {
$coursework = $files->get_coursework();
$submission_files = $files->get_files();
$submission = $files->get_submission();
- $files_array = array();
+ $files_array = [];
foreach ($submission_files as $file) {
@@ -772,7 +772,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$html .= html_writer::start_tag('div', array('class' => 'sampling-select'));
$script = "
- var samplingValidateHdl = Array();
+ var samplingValidateHdl = [];
";
$html .= html_writer::script($script);
@@ -781,7 +781,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$table->attributes['class'] = 'sampling';
$table->head = array('');
- $assessorheaders = array();
+ $assessorheaders = [];
for ($i = 0; $i < $samplingwidget->get_coursework()->get_max_markers(); $i++) {
$assessorheaders[] = get_string('assessorheading', 'mod_coursework', $i+1);
@@ -812,7 +812,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$columndata = array(new html_table_cell($assessor1cell));
- $percentage_options = array();
+ $percentage_options = [];
for ($i = 0;$i < 110; $i = $i + 10) {
$percentage_options[$i] = "{$i}%";
@@ -881,7 +881,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$('#save_manual_sampling').on('click', function (e) {
- validationresults = Array();
+ validationresults = [];
$.each(samplingValidateHdl, function(i,functionname) {
validationresults.push(eval(functionname+'()'));
@@ -905,14 +905,14 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
private function sampling_strategy_column($samplingwidget, $suffix = '') {
- $percentage_options = array();
+ $percentage_options = [];
for ($i = 0;$i < 110; $i = $i + 10) {
$percentage_options[$i] = "{$i}%";
}
// Hidden input containing scale values
- $scale = array();
+ $scale = [];
$sampling_column = " ";
$sampling_column .= html_writer::tag('br', '');
@@ -1141,7 +1141,7 @@ protected function resubmit_to_plagiarism_button($coursework, $submission) {
array('type' => 'hidden',
'name' => 'id',
'value' => $coursework->get_coursemodule_id()));
- $plagiarism_plugin_names = array();
+ $plagiarism_plugin_names = [];
foreach ($coursework->get_plagiarism_helpers() as $helper) {
$plagiarism_plugin_names[] = $helper->human_readable_name();
}
@@ -1382,7 +1382,7 @@ protected function render_mod_coursework_personal_deadlines_table(mod_coursework
$table_html .= '' . html_writer::link('#', get_string('unfinaliseselected', 'mod_coursework', $personal_deadlines_table->get_coursework()->get_allocatable_type()), array('id' => 'selected_unfinalise')) . '
';
}
$table_html .= ' ';
- $url = $this->get_router()->get_path('edit personal deadline', array());
+ $url = $this->get_router()->get_path('edit personal deadline', []);
$table_html .= '