diff --git a/actions/upload_grading_sheet.php b/actions/upload_grading_sheet.php
index 9a43230f..1dbae1e1 100644
--- a/actions/upload_grading_sheet.php
+++ b/actions/upload_grading_sheet.php
@@ -69,7 +69,7 @@
$csvimport = new \mod_coursework\export\import($coursework, false, false);
- // $csv_cells = $csvimport->csv_columns(); //all columns from spreadsheet
+ // $csv_cells = $csvimport->csv_columns(); //all columns from spreadsheet
$procsessingresults = $csvimport->validate_csv($content, $data->encoding, $data->delimiter_name, $csv_cells);
diff --git a/backup/moodle2/backup_coursework_activity_task.class.php b/backup/moodle2/backup_coursework_activity_task.class.php
index 78a19a15..c3654be1 100644
--- a/backup/moodle2/backup_coursework_activity_task.class.php
+++ b/backup/moodle2/backup_coursework_activity_task.class.php
@@ -24,25 +24,25 @@
class backup_coursework_activity_task extends backup_activity_task {
- static public function encode_content_links($content) {
- global $CFG;
+ static public function encode_content_links($content) {
+ global $CFG;
- $base = preg_quote($CFG->wwwroot, "/");
+ $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);
+ // 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\/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;
- }
+ return $content;
+ }
- protected function define_my_settings() {
- }
+ protected function define_my_settings() {
+ }
- protected function define_my_steps() {
- $this->add_step(new backup_coursework_activity_structure_step('coursework_structure', 'coursework.xml'));
- }
+ protected function define_my_steps() {
+ $this->add_step(new backup_coursework_activity_structure_step('coursework_structure', 'coursework.xml'));
+ }
}
diff --git a/classes/ability.php b/classes/ability.php
index c24ad60e..681e8a98 100644
--- a/classes/ability.php
+++ b/classes/ability.php
@@ -152,7 +152,7 @@ function (coursework $coursework) {
// New feedback
$this->prevent_new_feedback_with_no_submission();
- $this->prevent_new_feedback_when_submission_not_finalised();
+ $this->prevent_new_feedback_when_submission_not_finalised();
$this->prevent_new_feedback_when_prerequisite_stages_have_no_feedback();
$this->prevent_new_feedback_with_empty_stage();
$this->prevent_new_feedback_when_allocatable_already_has_feedback_for_this_stage();
@@ -163,7 +163,7 @@ function (coursework $coursework) {
$this->prevent_new_feedback_when_not_assessor_for_stage();
$this->prevent_new_feedback_from_non_allocated_assessors();
$this->allow_new_feedback_by_allocated_assessor();
- $this->allow_new_feedback_from_any_assessor_when_allocation_is_disabled_for_stage_or_instance();
+ $this->allow_new_feedback_from_any_assessor_when_allocation_is_disabled_for_stage_or_instance();
$this->allow_new_feedback_if_agreed_feedback_and_user_can_add_agreed_feedback();
// Create feedback
@@ -230,7 +230,7 @@ function (coursework $coursework) {
// Plagiarism flagging rules for Plagiarism Alert
// New
- // $this->prevent_new_plagiarism_flag_if_already_exists();
+ // $this->prevent_new_plagiarism_flag_if_already_exists();
$this->allow_new_plagiarism_flag_with_capability();
// Edit
@@ -425,7 +425,7 @@ function (submission $submission) {
}
protected function allow_show_submission_to_graders_after_feedback_release() {
-// Show to graders after release
+ // Show to graders after release
$this->allow('show',
'mod_coursework\models\submission',
function (submission $submission) {
@@ -485,8 +485,8 @@ function (submission $submission) {
// take into account courseworks with personal deadlines
if ($submission->get_coursework()->personal_deadlines_enabled()) {
$deadline_passed = (bool)$submission->submission_personal_deadline() < time();
- } else {
- $deadline_passed = $submission->get_coursework()->deadline_has_passed();
+ } else {
+ $deadline_passed = $submission->get_coursework()->deadline_has_passed();
}
$ok_to_submit_late = $submission->get_coursework()->allow_late_submissions();
$coursework = $submission->get_coursework();
@@ -1202,7 +1202,7 @@ private function allow_show_grading_table_row_if_user_can_grant_extension_and_no
'mod_coursework\grading_table_row_base',
function (grading_table_row_base $row) {
- return (!$row->get_coursework()->allocation_enabled() && has_capability('mod/coursework:grantextensions',
+ return (!$row->get_coursework()->allocation_enabled() && has_capability('mod/coursework:grantextensions',
$row->get_coursework()
->get_context()));
diff --git a/classes/allocation/manager.php b/classes/allocation/manager.php
index e25b57af..b4dd472f 100644
--- a/classes/allocation/manager.php
+++ b/classes/allocation/manager.php
@@ -344,18 +344,18 @@ public function auto_generate_sample_set() {
// Save sample set
if (!empty($auto_sample_set)) {
- foreach ($auto_sample_set as $allocatable) {
- $sample = new \stdClass();
- $sample->courseworkid = $this->coursework->id;
- $sample->allocatableid = $allocatable->id;
- $sample->allocatabletype = ($this->coursework->is_configured_to_have_group_submissions()) ? "group" : "user";
- $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
- $DB->insert_record("coursework_sample_set_mbrs", $sample);
-
- }
+ foreach ($auto_sample_set as $allocatable) {
+ $sample = new \stdClass();
+ $sample->courseworkid = $this->coursework->id;
+ $sample->allocatableid = $allocatable->id;
+ $sample->allocatabletype = ($this->coursework->is_configured_to_have_group_submissions()) ? "group" : "user";
+ $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
+ $DB->insert_record("coursework_sample_set_mbrs", $sample);
+
+ }
}
}
}
diff --git a/classes/allocation/table/cell/builder.php b/classes/allocation/table/cell/builder.php
index 859cb3e6..6ffeb3a3 100644
--- a/classes/allocation/table/cell/builder.php
+++ b/classes/allocation/table/cell/builder.php
@@ -191,9 +191,9 @@ private function prepare_allocation_table_cell() {
}
$contents .= '
';
- if ($this->coursework->allocation_enabled()) {
- $assessor_dropdown = $this->get_potential_marker_dropdown();
- }
+ if ($this->coursework->allocation_enabled()) {
+ $assessor_dropdown = $this->get_potential_marker_dropdown();
+ }
$assessor_name = '';
if ($this->has_feedback()) {
$class .= ' has-assessor-feedback ';
@@ -210,7 +210,7 @@ private function prepare_allocation_table_cell() {
}
if ($assessor_name) {
- if ($this->get_stage()->uses_sampling() && !$this->get_feedback() && !$this->has_automatic_sampling()) {
+ if ($this->get_stage()->uses_sampling() && !$this->get_feedback() && !$this->has_automatic_sampling()) {
$contents .= '
';
}
$contents .= "{$assessor_name}";
@@ -437,15 +437,15 @@ private function has_final_feedback() {
[$this->allocatable->id(), $this->allocatable->type()]
);
if ($submission) {
- $feedbacks = isset(feedback::$pool[$this->coursework->id]['submissionid'][$submission->id]) ?
+ $feedbacks = isset(feedback::$pool[$this->coursework->id]['submissionid'][$submission->id]) ?
feedback::$pool[$this->coursework->id]['submissionid'][$submission->id] : [];
- foreach ($feedbacks as $feedback) {
- if ($feedback->stage_identifier == 'final_agreed_1') {
- return true;
+ foreach ($feedbacks as $feedback) {
+ if ($feedback->stage_identifier == 'final_agreed_1') {
+ return true;
+ }
}
}
- }
return false;
}
diff --git a/classes/allocation/table/processor.php b/classes/allocation/table/processor.php
index 7b6c5f85..fd329886 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 = [];
foreach ($raw_data as $allocatable_id => $datarrays) {
@@ -117,7 +117,7 @@ private function clean_data($raw_data) {
$clean_data[$allocatable_id][$stage->identifier()] = $stage_data;
}
}
- /* if (array_key_exists('moderator', $datarrays)) {
+ /* if (array_key_exists('moderator', $datarrays)) {
$moderator_data = $datarrays['moderator'];
$clean_data[$allocatable_id]['moderator'] = $moderator_data;
}*/
diff --git a/classes/assessor_feedback_row.php b/classes/assessor_feedback_row.php
index d24932d6..be98e9b5 100644
--- a/classes/assessor_feedback_row.php
+++ b/classes/assessor_feedback_row.php
@@ -128,7 +128,7 @@ public function get_graded_by() {
* @return string
*/
public function get_graders_name() {
- return $this->get_graded_by()->profile_link();
+ return $this->get_graded_by()->profile_link();
}
/**
diff --git a/classes/controllers/feedback_controller.php b/classes/controllers/feedback_controller.php
index 86410e7f..92c95d2b 100644
--- a/classes/controllers/feedback_controller.php
+++ b/classes/controllers/feedback_controller.php
@@ -591,7 +591,7 @@ private function next_available_stage($feedback) {
* @param $submission
*/
protected function try_auto_feedback_creation($submission) {
-// automatic agreement if necessary
+ // automatic agreement if necessary
$auto_feedback_classname = '\mod_coursework\auto_grader\\' . $this->coursework->automaticagreementstrategy;
/**
* @var auto_grader $auto_grader
diff --git a/classes/controllers/personal_deadlines_controller.php b/classes/controllers/personal_deadlines_controller.php
index 6774813b..ab60f0e3 100644
--- a/classes/controllers/personal_deadlines_controller.php
+++ b/classes/controllers/personal_deadlines_controller.php
@@ -87,33 +87,33 @@ protected function new_personal_deadline() {
$allocatables = unserialize($data->allocatableid);
- foreach ($allocatables as $allocatableid) {
- $data->allocatableid = $allocatableid;
- $data->id = '';
- //$data->id = '';
- $findparams = array(
- 'allocatableid' => $allocatableid,
- 'allocatabletype' => $data->allocatabletype,
- 'courseworkid' => $data->courseworkid,
- );
- $this->personal_deadline = personal_deadline::find_or_build($findparams);
-
- if (empty($this->personal_deadline->personal_deadline)) { // personal deadline doesnt exist
- // add new
- $data->createdbyid = $USER->id;
- $this->personal_deadline = personal_deadline::build($data);
- $this->personal_deadline->save();
-
- } else {
- // update
- $data->id = $this->personal_deadline->id;
- $data->lastmodifiedbyid = $USER->id;
- $data->timemodified = time();
- $this->personal_deadline->update_attributes($data);
- }
-
+ foreach ($allocatables as $allocatableid) {
+ $data->allocatableid = $allocatableid;
+ $data->id = '';
+ //$data->id = '';
+ $findparams = array(
+ 'allocatableid' => $allocatableid,
+ 'allocatabletype' => $data->allocatabletype,
+ 'courseworkid' => $data->courseworkid,
+ );
+ $this->personal_deadline = personal_deadline::find_or_build($findparams);
+
+ if (empty($this->personal_deadline->personal_deadline)) { // personal deadline doesnt exist
+ // add new
+ $data->createdbyid = $USER->id;
+ $this->personal_deadline = personal_deadline::build($data);
+ $this->personal_deadline->save();
+
+ } else {
+ // update
+ $data->id = $this->personal_deadline->id;
+ $data->lastmodifiedbyid = $USER->id;
+ $data->timemodified = time();
+ $this->personal_deadline->update_attributes($data);
}
+ }
+
}
redirect($coursework_page_url);
}
@@ -143,10 +143,10 @@ protected function set_default_current_deadline() {
// 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;
+ 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;
- }
+ }
return $params;
}
diff --git a/classes/controllers/submissions_controller.php b/classes/controllers/submissions_controller.php
index b2320ea2..c26a4011 100644
--- a/classes/controllers/submissions_controller.php
+++ b/classes/controllers/submissions_controller.php
@@ -116,12 +116,12 @@ 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
+ // 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
- if (!$this->has_valid_personal_deadline($submission) && !$this->has_valid_extension($submission)) {
- $submission->finalised = 1;
- }
+ if (!$this->has_valid_personal_deadline($submission) && !$this->has_valid_extension($submission)) {
+ $submission->finalised = 1;
+ }
} else if ($this->coursework->deadline_has_passed() && !$this->has_valid_extension($submission)) {
$submission->finalised = 1;
}
@@ -167,7 +167,7 @@ protected function create_submission() {
}
}
- if ($submission->finalised) {
+ if ($submission->finalised) {
if (!$submission->get_coursework()->has_deadline()) {
$userids = explode(',', $submission->get_coursework()->get_submission_notification_users());
@@ -221,11 +221,11 @@ protected function edit_submission() {
$submit_form->set_data($submission);
- if ($validation != true) {
+ if ($validation != true) {
$this->get_page_renderer()->edit_submission_page($submit_form, $submission);
return true;
- }
- }
+ }
+ }
/**
*
@@ -399,11 +399,11 @@ 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()) {
- $deadline_has_passed = !$this->has_valid_personal_deadline($submission);
- } else {
- $deadline_has_passed = $this->coursework->deadline_has_passed();
- }
+ if ($this->coursework->personal_deadlines_enabled()) {
+ $deadline_has_passed = !$this->has_valid_personal_deadline($submission);
+ } else {
+ $deadline_has_passed = $this->coursework->deadline_has_passed();
+ }
if ($could_have_submitted && $deadline_has_passed && !$this->has_valid_extension($submission) && !$this->coursework->allow_late_submissions()) {
throw new late_submission($this->coursework);
diff --git a/classes/cron.php b/classes/cron.php
index 894cfa51..b04ee7df 100644
--- a/classes/cron.php
+++ b/classes/cron.php
@@ -51,7 +51,7 @@ public static function run() {
echo "Starting coursework cron functions...\n";
self::finalise_any_submissions_where_the_deadline_has_passed();
self::send_reminders_to_students();
- // self::send_first_reminders_to_admins(); #90211934
+ // self::send_first_reminders_to_admins(); #90211934
self::autorelease_feedbacks_where_the_release_date_has_passed();
return true;
}
@@ -109,7 +109,7 @@ private static function send_reminders_to_students() {
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) &&
+ if ($coursework->due_to_send_first_reminders($individual_extension->extended_deadline) &&
$student->has_not_been_sent_reminder($coursework, 1, $individual_extension->extended_deadline)) {
$student->deadline = $individual_extension->extended_deadline;
$student->extension = $individual_extension->extended_deadline;
@@ -117,15 +117,15 @@ private static function send_reminders_to_students() {
$student->nextremindernumber = 1;
$userswhoneedreminding[$student->id().'_'.$coursework->id] = $student;
- // check if 2nd reminder is due to be sent but has not been sent yet
- } else if ($coursework->due_to_send_second_reminders($individual_extension->extended_deadline) &&
+ // check if 2nd reminder is due to be sent but has not been sent yet
+ } else if ($coursework->due_to_send_second_reminders($individual_extension->extended_deadline) &&
$student->has_not_been_sent_reminder($coursework, 2, $individual_extension->extended_deadline)) {
$student->deadline = $individual_extension->extended_deadline;
$student->extension = $individual_extension->extended_deadline;
$student->coursework_id = $coursework->id;
$student->nextremindernumber = 2;
$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
@@ -386,7 +386,7 @@ 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 *
+ $sql = "SELECT *
FROM {coursework} c
JOIN {coursework_submissions} cs
ON c.id = cs.courseworkid
diff --git a/classes/export/csv.php b/classes/export/csv.php
index c0db544a..704f9498 100644
--- a/classes/export/csv.php
+++ b/classes/export/csv.php
@@ -128,11 +128,11 @@ public function add_cells_to_array($submission, $student, $csv_cells) {
}
} 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);
- } else {
- $row[] = $cell;
- }
+ if (is_array($cell)) {
+ $row = array_merge($row, $cell);
+ } else {
+ $row[] = $cell;
+ }
} else {
$stages = $cell->get_cell($submission, $student, false);
@@ -147,50 +147,50 @@ public function add_cells_to_array($submission, $student, $csv_cells) {
* create headers for CSV
* @param $csv_headers
*/
- public function add_headers($csv_headers) {
- $headers = [];
- foreach ($csv_headers as $header) {
- if (substr($header, 0, 8) == 'assessor') {
- $stage = (substr($header, -1));
- $header = substr($header, 0, -1);
+ public function add_headers($csv_headers) {
+ $headers = [];
+ foreach ($csv_headers as $header) {
+ 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') {
+ $head = $cell->get_header($stage);
+ if (is_array($head)) {
+ $headers = array_merge($headers, $head);
+ } else {
+ $headers[$header.$stage] = $head;
}
- $class = "mod_coursework\\export\\csv\\cells\\".$header."_cell";
- $cell = new $class($this->coursework);
- if (substr($header, 0, 8) == 'assessor') {
- $head = $cell->get_header($stage);
- if (is_array($head)) {
- $headers = array_merge($headers, $head);
- } else {
- $headers[$header.$stage] = $head;
- }
-
- } else if ($header != 'stages' && $header != 'moderationagreement' && $header != 'otherassessors' ) {
- $head = $cell->get_header(false);
- if (is_array($head)) {
- $headers = array_merge($headers, $head);
- } else {
- $headers[$header] = $head;
- }
+
+ } else if ($header != 'stages' && $header != 'moderationagreement' && $header != 'otherassessors' ) {
+ $head = $cell->get_header(false);
+ if (is_array($head)) {
+ $headers = array_merge($headers, $head);
} else {
- $array_headers = $cell->get_header(false);
- $headers = array_merge($headers, $array_headers);
+ $headers[$header] = $head;
}
+ } else {
+ $array_headers = $cell->get_header(false);
+ $headers = array_merge($headers, $array_headers);
}
+ }
- $this->csvexport->add_data($headers);
+ $this->csvexport->add_data($headers);
- }
+ }
/**
* Add filename to the CSV
* @param $filename
* @return string
*/
- public function add_filename($filename) {
+ public function add_filename($filename) {
- $filename = clean_filename($filename);
- return $this->csvexport->filename = $filename.'.csv';
- }
+ $filename = clean_filename($filename);
+ return $this->csvexport->filename = $filename.'.csv';
+ }
/**
* Function to sort array in order of submission's lastname
@@ -264,9 +264,9 @@ 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
- }
+ 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/assessorfeedback_cell.php b/classes/export/csv/cells/assessorfeedback_cell.php
index e3062990..d1be9117 100644
--- a/classes/export/csv/cells/assessorfeedback_cell.php
+++ b/classes/export/csv/cells/assessorfeedback_cell.php
@@ -125,7 +125,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
+ // 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', $modulecontext) )
return get_string('nopermissiontogradesubmission', 'coursework');
diff --git a/classes/export/csv/cells/assessorgrade_cell.php b/classes/export/csv/cells/assessorgrade_cell.php
index 081148f0..ef991bbb 100644
--- a/classes/export/csv/cells/assessorgrade_cell.php
+++ b/classes/export/csv/cells/assessorgrade_cell.php
@@ -205,7 +205,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
+ // 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');
@@ -246,9 +246,9 @@ 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
- return true;
+ // 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 {
return get_string('nopermissiontoimportgrade', 'coursework');
diff --git a/classes/export/csv/cells/cell_base.php b/classes/export/csv/cells/cell_base.php
index 563f8484..ff72d309 100644
--- a/classes/export/csv/cells/cell_base.php
+++ b/classes/export/csv/cells/cell_base.php
@@ -230,7 +230,7 @@ public function get_stage_identifier_for_assessor($submission, $student) {
} else if ($this->coursework->get_max_markers() > 1) {
// get existing feedback
- $sql = "SELECT * FROM {coursework_feedbacks}
+ $sql = "SELECT * FROM {coursework_feedbacks}
WHERE submissionid= $submission->id
AND assessorid = $USER->id
AND stage_identifier <> 'final_agreed_1'";
diff --git a/classes/export/csv/cells/moderationagreement_cell.php b/classes/export/csv/cells/moderationagreement_cell.php
index a989a1e2..12795ed6 100644
--- a/classes/export/csv/cells/moderationagreement_cell.php
+++ b/classes/export/csv/cells/moderationagreement_cell.php
@@ -62,12 +62,12 @@ public function get_cell($submission, $student, $stage_identifier) {
$data[] = $this->get_assessor_name($moderation_agreement->moderatorid);
$data[] = $this->get_assessor_username($moderation_agreement->moderatorid);
$data[] = userdate($moderation_agreement->timemodified, $this->dateformat);
- } else {
- $data[] = '';
- $data[] = '';
- $data[] = '';
- $data[] = '';
- }
+ } else {
+ $data[] = '';
+ $data[] = '';
+ $data[] = '';
+ $data[] = '';
+ }
return $data;
}
diff --git a/classes/export/csv/cells/otherassessors_cell.php b/classes/export/csv/cells/otherassessors_cell.php
index 66caf981..5b6bffda 100644
--- a/classes/export/csv/cells/otherassessors_cell.php
+++ b/classes/export/csv/cells/otherassessors_cell.php
@@ -42,8 +42,8 @@ public function get_cell($submission, $student, $stage_identifier) {
global $DB, $USER;
// find out current user stage identifier
- // $stage_identifier =
- // retrieve all feedbacks without currents user feedback
+ // $stage_identifier =
+ // retrieve all feedbacks without currents user feedback
$params = array(
'submissionid' => $submission->id,
@@ -59,7 +59,7 @@ public function get_cell($submission, $student, $stage_identifier) {
$feedbacks = $DB->get_records_sql($sql, $params);
$gradedata = [];
- // $stage_identifier = ($this->coursework->get_max_markers() == 1) ? "assessor_1" : $this->get_stage_identifier_for_assessor($submission, $student);
+ // $stage_identifier = ($this->coursework->get_max_markers() == 1) ? "assessor_1" : $this->get_stage_identifier_for_assessor($submission, $student);
foreach ($feedbacks as $feedback) {
$grade = $submission->get_assessor_feedback_by_stage($feedback->stage_identifier);
@@ -146,7 +146,7 @@ public function get_header($stage) {
}
$fields['otherassessorfeedback' . $i] = get_string('otherassessorfeedback', 'coursework', $i);
}
- return $fields;
+ return $fields;
}
}
diff --git a/classes/export/csv/cells/singlegrade_cell.php b/classes/export/csv/cells/singlegrade_cell.php
index 22c2d721..d56da8f4 100644
--- a/classes/export/csv/cells/singlegrade_cell.php
+++ b/classes/export/csv/cells/singlegrade_cell.php
@@ -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');
@@ -253,7 +253,7 @@ function get_rubrics($coursework, $csv_cells) {
// 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);
+ // $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);
diff --git a/classes/export/csv/cells/submissiontime_cell.php b/classes/export/csv/cells/submissiontime_cell.php
index a7452bdf..205c186d 100644
--- a/classes/export/csv/cells/submissiontime_cell.php
+++ b/classes/export/csv/cells/submissiontime_cell.php
@@ -34,7 +34,7 @@ class submissiontime_cell extends cell_base {
* @return string
*/
public function get_cell($submission, $student, $stage_identifier) {
- return $this->submission_time($submission);
+ return $this->submission_time($submission);
}
/**
diff --git a/classes/export/grading_sheet.php b/classes/export/grading_sheet.php
index 1c8ea7aa..e3166847 100644
--- a/classes/export/grading_sheet.php
+++ b/classes/export/grading_sheet.php
@@ -35,7 +35,7 @@ public function get_submissions($groupid = null, $selected_submission_ids = '')
'courseworkid' => $this->coursework->id,
);
- $submissions = submission::find_all($params);
+ $submissions = submission::find_all($params);
// remove unfinalised submissions
foreach ($submissions as $submission) {
@@ -55,44 +55,44 @@ public function get_submissions($groupid = null, $selected_submission_ids = '')
/**
* @var submission[] $submissions
*/
- foreach ($submissions as $submission) {
- $stage_identifiers = [];
- // remove all submissions that a user is not supposed to see
-
- // double marking not allocated
- $stages = $this->coursework->get_max_markers();
- if ($stages > 1 && !$this->coursework->allocation_enabled() && !has_capability('mod/coursework:addagreedgrade', $PAGE->context)) {
- // if samplings enabled, work out how many per submission
- if ($this->coursework->sampling_enabled()) {
- $stage_identifiers[] = 'assessor_1'; // always have at least one assessor
- // check how many other assessors for this submission
- $in_sample = $submission->get_submissions_in_sample();
- foreach ($in_sample as $i) {
- $stage_identifiers[] = $i->stage_identifier;
- }
- } else { // if sampling not enabled, everyone is marked in all stages
- for ($i = 1; $i <= $stages; $i++) {
- $stage_identifiers[] = 'assessor_' . $i;
- }
- }
- // check if any of the submissions still requires marking
- for ($i = 0; $i < count($stage_identifiers); $i++) {
- $feedback = $submission->get_assessor_feedback_by_stage($stage_identifiers[$i]);
- // if no feedback or feedback belongs to current user don't remove submission
- if (!$feedback || $feedback->assessorid == $USER->id) {
- break;
- } else if ($i + 1 < count($stage_identifiers)) {
- continue;
- }
- // if the last submission was already marked remove it from the array
- unset($submissions[$submission->id]);
- }
- }
-
- // 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)
+ foreach ($submissions as $submission) {
+ $stage_identifiers = [];
+ // remove all submissions that a user is not supposed to see
+
+ // double marking not allocated
+ $stages = $this->coursework->get_max_markers();
+ if ($stages > 1 && !$this->coursework->allocation_enabled() && !has_capability('mod/coursework:addagreedgrade', $PAGE->context)) {
+ // if samplings enabled, work out how many per submission
+ if ($this->coursework->sampling_enabled()) {
+ $stage_identifiers[] = 'assessor_1'; // always have at least one assessor
+ // check how many other assessors for this submission
+ $in_sample = $submission->get_submissions_in_sample();
+ foreach ($in_sample as $i) {
+ $stage_identifiers[] = $i->stage_identifier;
+ }
+ } else { // if sampling not enabled, everyone is marked in all stages
+ for ($i = 1; $i <= $stages; $i++) {
+ $stage_identifiers[] = 'assessor_' . $i;
+ }
+ }
+ // check if any of the submissions still requires marking
+ for ($i = 0; $i < count($stage_identifiers); $i++) {
+ $feedback = $submission->get_assessor_feedback_by_stage($stage_identifiers[$i]);
+ // if no feedback or feedback belongs to current user don't remove submission
+ if (!$feedback || $feedback->assessorid == $USER->id) {
+ break;
+ } else if ($i + 1 < count($stage_identifiers)) {
+ continue;
+ }
+ // if the last submission was already marked remove it from the array
+ unset($submissions[$submission->id]);
+ }
+ }
+
+ // 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))
|| ($this->coursework->allocation_enabled() && !$this->coursework
->assessor_has_any_allocation_for_student($submission->reload()->get_allocatable())
@@ -105,12 +105,12 @@ public function get_submissions($groupid = null, $selected_submission_ids = '')
&& (has_capability('mod/coursework:addagreedgrade', $PAGE->context)
|| has_capability('mod/coursework:editagreedgrade', $PAGE->context)))
|| ((has_capability('mod/coursework:addagreedgrade', $PAGE->context) && $submission->get_state() < submission::FULLY_GRADED ))
- ) {
- unset($submissions[$submission->id]);
- continue;
- }
- }
- }
+ ) {
+ unset($submissions[$submission->id]);
+ continue;
+ }
+ }
+ }
return $submissions;
}
@@ -166,15 +166,15 @@ 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++) {
- // extra column with allocated assessor name
- if ($coursework->allocation_enabled() && $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
&& (has_capability('mod/coursework:addinitialgrade', $PAGE->context)
|| has_capability('mod/coursework:editinitialgrade', $PAGE->context))) {
- $csv_cells[] = 'assessor' . $i;
- }
- $csv_cells[] = 'assessorgrade'.$i;
- $csv_cells[] = 'assessorfeedback'.$i;
+ $csv_cells[] = 'assessor' . $i;
+ }
+ $csv_cells[] = 'assessorgrade'.$i;
+ $csv_cells[] = 'assessorfeedback'.$i;
}
$csv_cells[] = 'agreedgrade';
$csv_cells[] = 'agreedfeedback';
@@ -192,9 +192,9 @@ 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 {
+ /* } else {
$criterias = $coursework->get_rubric_criteria();
@@ -204,7 +204,7 @@ public static function cells_array($coursework) {
}
}
- */
+ */
$csv_cells[] = 'feedbackcomments';
}
diff --git a/classes/export/import.php b/classes/export/import.php
index 5a8c87a5..05eab201 100644
--- a/classes/export/import.php
+++ b/classes/export/import.php
@@ -141,15 +141,15 @@ 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
- } else if ($cells[$i] == "singlegrade" || $cells[$i] == "assessorgrade" || $cells[$i] == "agreedgrade" && !empty($value)) {
+ if ($result !== true) {
+ $errors[$s] = $result;
+ break; // Go to next line on error
+ } else if ($cells[$i] == "singlegrade" || $cells[$i] == "assessorgrade" || $cells[$i] == "agreedgrade" && !empty($value)) {
- $uploadedgradecells[] = $stage_identifier;
+ $uploadedgradecells[] = $stage_identifier;
- }
- $i++;
+ }
+ $i++;
}
$s++;
}
@@ -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)count($csvheader);
$actualsize = (int)count($linefromimportedcsv);
@@ -344,9 +344,9 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
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);
+ $stages[$k] = $this->get_stage_identifier($csvline['submissionid'], $k);
} else if (substr($k, 0, 11) == 'agreedgrade') {
- $stages[$k] = 'final_agreed_1';
+ $stages[$k] = 'final_agreed_1';
}
}
}
@@ -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;
@@ -438,29 +438,29 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
$arrayvalues = array_filter($rubricdata);
- if (!empty($arrayvalues)) {
+ if (!empty($arrayvalues)) {
- //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 = [];
+ //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 = [];
- // 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]);
+ $levelid = $this->get_value_rubric_levelid($c, $rubricdata[$critidx]);
- $criteriagrade['levelid'] = $levelid;
- $criteriagrade['remark'] = $rubricdata[$critidx + 1];
+ $criteriagrade['levelid'] = $levelid;
+ $criteriagrade['remark'] = $rubricdata[$critidx + 1];
- $criteriagradedata['criteria'][$c['id']] = $criteriagrade;
+ $criteriagradedata['criteria'][$c['id']] = $criteriagrade;
- $critidx = $critidx + 2;
+ $critidx = $critidx + 2;
- }
- } else {
- $criteriagradedata = false;
}
+ } else {
+ $criteriagradedata = false;
+ }
// Need to decide where the grade instance submit and get grade should be put as in order
@@ -469,29 +469,29 @@ 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)) {
+ } else if ($coursework->is_using_rubric() && ($stage == 'final_agreed_1' && $this->coursework->finalstagegrading == 1)) {
- if (!isset($numberofrubrics)) {
+ if (!isset($numberofrubrics)) {
- $criterias = $this->coursework->get_rubric_criteria();
+ $criterias = $this->coursework->get_rubric_criteria();
- $numberofrubrics = count($criterias) * 2;
+ $numberofrubrics = count($criterias) * 2;
- }
- $stagemultiplier = $numberofstages - 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);
+ $rubricoffset = $rubricoffsetstart + $stagemultiplier + ($numberofrubrics * $stagemultiplier);
- if ($coursework->allocation_enabled()) $rubricoffset += 1;
+ if ($coursework->allocation_enabled()) $rubricoffset += 1;
- $gradearrvalue = array_slice($line, $rubricoffset, 2);
+ $gradearrvalue = array_slice($line, $rubricoffset, 2);
- $csvline[$gradepointer] = $gradearrvalue[0];
- $csvline[$feedbackpointer] = $gradearrvalue[1];
+ $csvline[$gradepointer] = $gradearrvalue[0];
+ $csvline[$feedbackpointer] = $gradearrvalue[1];
- }
+ }
// don't create/update feedback if grade is empty
if (!empty($csvline[$gradepointer])) {
@@ -566,7 +566,7 @@ public function add_grade($submissionid, $grade, $feedback, $stage_identifier, $
// workout markernumber
if ($stage_identifier == 'assessor_1') {
- // assessor_1 is always marker 1
+ // assessor_1 is always marker 1
$markernumber = 1;
} else {
// get all feedbacks and add 1
@@ -670,9 +670,9 @@ public function edit_grade($cwfeedbackid, $grade, $feedback, $uses_rubric=false)
$update = $DB->update_record('coursework_feedbacks', $edit_grade);
// if record updated and coursework has automatic grading enabled update agreedgrade
- if ($update && $this->coursework->automaticagreement_enabled()) {
- $this->auto_agreement($cwfeedbackid);
- }
+ if ($update && $this->coursework->automaticagreement_enabled()) {
+ $this->auto_agreement($cwfeedbackid);
+ }
}
return $update;
@@ -741,19 +741,19 @@ public function get_stage_identifier($submissionid, $cell_identifier) {
'stage_identifier' => 'assessor_1'));
// no sample or no feedback for sample yet
if (!$in_sample || ($in_sample && !$feedback)) {
- $stage_identifier = 'assessor_1';
+ $stage_identifier = 'assessor_1';
} else { // find out which sample wasn't graded yet
- $samples = $submission->get_submissions_in_sample();
- foreach ($samples as $sample) {
- $feedback = $DB->record_exists('coursework_feedbacks', array('submissionid' => $submissionid,
+ $samples = $submission->get_submissions_in_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) {
- $stage_identifier = $sample->stage_identifier;
- break;
- }
- }
- }
+ // if feedback doesn't exist, we'll use this stage identifier for a new feedback
+ if (!$feedback) {
+ $stage_identifier = $sample->stage_identifier;
+ break;
+ }
+ }
+ }
}
}
@@ -791,9 +791,9 @@ 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;
+ $otherassessors = false;
if (in_array('otherassessors', $csv_cells)) {
// find position of otherassesors so we know from which key to unset
@@ -820,7 +820,7 @@ public function remove_other_assessors_grade($csv_cells, &$line) {
}
- return $csv_cells;
+ return $csv_cells;
}
}
diff --git a/classes/file_importer.php b/classes/file_importer.php
index d41f4b5c..b73413ee 100644
--- a/classes/file_importer.php
+++ b/classes/file_importer.php
@@ -177,7 +177,7 @@ public function import_zip_files($coursework, $feedbackstage, $overwritecurrent)
$results[$filename] = get_string('feedbacksubmissionpublished', 'mod_coursework');
}
- } else {
+ } else {
$results[$filename] = get_string('feedbacknotfound', 'mod_coursework');
}
}
diff --git a/classes/forms/deadline_extension_form.php b/classes/forms/deadline_extension_form.php
index b6083172..5ea0553d 100644
--- a/classes/forms/deadline_extension_form.php
+++ b/classes/forms/deadline_extension_form.php
@@ -124,7 +124,7 @@ public function personal_deadline() {
'courseworkid' => $courseworkid,
);
- return $personal_deadline = $DB->get_record('coursework_person_deadlines', $params);
+ return $personal_deadline = $DB->get_record('coursework_person_deadlines', $params);
}
}
diff --git a/classes/forms/student_submission_form.php b/classes/forms/student_submission_form.php
index ff5bca7f..3c4695ac 100644
--- a/classes/forms/student_submission_form.php
+++ b/classes/forms/student_submission_form.php
@@ -183,7 +183,7 @@ public function handle() {
$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 795d2847..be524829 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/grading_table_row_base.php b/classes/grading_table_row_base.php
index 1752b4ee..6c9a71c1 100644
--- a/classes/grading_table_row_base.php
+++ b/classes/grading_table_row_base.php
@@ -255,7 +255,7 @@ public function get_submission() {
*/
public function get_plagiarism_flag() {
- $submission = $this->get_submission();
+ $submission = $this->get_submission();
$params = array(
'submissionid' => $submission->id,
);
diff --git a/classes/models/coursework.php b/classes/models/coursework.php
index fd57d41e..98adf7ef 100644
--- a/classes/models/coursework.php
+++ b/classes/models/coursework.php
@@ -954,7 +954,7 @@ public function pack_files() {
$fs = get_file_storage();
$grading_sheet = new \mod_coursework\export\grading_sheet($this, null, null);
- // get only submissions that user can grade
+ // get only submissions that user can grade
$submissions = $grading_sheet->get_submissions();
foreach ($submissions as $submission) {
@@ -1298,7 +1298,7 @@ public function get_submissions_needing_grading() {
$needsgrading[] = $submission;
}
- }
+ }
return $needsgrading;
@@ -1368,7 +1368,7 @@ public function get_published_submissions() {
WHERE courseworkid = :courseworkid
AND firstpublished IS NOT NULL";
- $submissions = $DB->get_records_sql($sql, array('courseworkid' => $this->id));
+ $submissions = $DB->get_records_sql($sql, array('courseworkid' => $this->id));
foreach ($submissions as &$submission) {
$submission = submission::find($submission);
}
@@ -1928,7 +1928,7 @@ public function get_students() {
$users = [];
$raw_users = get_enrolled_users($this->get_context(), 'mod/coursework:submit');
- // filter students who are restricted from the coursework
+ // filter students who are restricted from the coursework
$cm = $this->get_course_module();
$cmobject = $this->cm_object($cm);
@@ -2066,7 +2066,7 @@ public function student_is_in_any_group($student) {
* @return bool
*/
public function sampling_enabled() {
- return (bool)$this->samplingenabled;
+ return (bool)$this->samplingenabled;
}
/**
@@ -2480,7 +2480,7 @@ public static function extension_reasons() {
$extension_reasons = explode("\n", $extension_reasons);
$extension_reasons = array_map(function ($i) {
return trim($i);
- },
+ },
$extension_reasons);
$extension_reasons = array_merge(array('' => 'Not specified'), $extension_reasons);
}
@@ -2496,8 +2496,8 @@ public function extensions_enabled() {
}
/*
-* @return bool
-*/
+ * @return bool
+ */
public function extension_exists() {
global $DB;
diff --git a/classes/models/feedback.php b/classes/models/feedback.php
index afec6ea0..4502acec 100644
--- a/classes/models/feedback.php
+++ b/classes/models/feedback.php
@@ -312,7 +312,7 @@ public static function get_teacher_feedback(submission $submission,
* @return bool
*/
public function is_assessor_allocated() {
- return $this->get_stage()->assessor_has_allocation($this->get_allocatable());
+ return $this->get_stage()->assessor_has_allocation($this->get_allocatable());
}
/**
diff --git a/classes/models/moderation.php b/classes/models/moderation.php
index ca7808cd..db962a11 100644
--- a/classes/models/moderation.php
+++ b/classes/models/moderation.php
@@ -48,7 +48,7 @@ class moderation extends table_base {
/**
* @var int
*/
- public $feedbackid;
+ public $feedbackid;
/**
* @var int
@@ -113,8 +113,8 @@ public function get_agreement() {
* @return bool|submission
*/
public function get_submission() {
- $feedback = $this->get_feedback();
- $this->submission = submission::find($feedback->submissionid);
+ $feedback = $this->get_feedback();
+ $this->submission = submission::find($feedback->submissionid);
return $this->submission;
}
diff --git a/classes/models/outstanding_marking.php b/classes/models/outstanding_marking.php
index f6bc8fac..2d7d8a93 100644
--- a/classes/models/outstanding_marking.php
+++ b/classes/models/outstanding_marking.php
@@ -73,13 +73,13 @@ 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 (!$coursework->sampling_enabled()) {
- $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);
- }
+ 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());
+ } else {
+ $agreedsubmissions = $this->get_to_grade_agreed_grade_sampled_submissions($coursework->id);
}
+ }
return (!empty($agreedsubmissions)) ? count($agreedsubmissions) : 0;
}
diff --git a/classes/models/submission.php b/classes/models/submission.php
index f2dfd0e9..c132f7d6 100644
--- a/classes/models/submission.php
+++ b/classes/models/submission.php
@@ -761,20 +761,20 @@ public function get_author_id() {
// 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()) {
- if ( $this->get_coursework()->is_configured_to_have_group_submissions()) {
- $members = groups_get_members($this->allocatableid, 'u.id', 'id');
- if ($members) {
- $id = reset($members)->id;
- }
+ if ($this->is_submission_on_behalf()) {
+ if ( $this->get_coursework()->is_configured_to_have_group_submissions()) {
+ $members = groups_get_members($this->allocatableid, 'u.id', 'id');
+ if ($members) {
+ $id = reset($members)->id;
+ }
- if ($this->get_coursework()->plagiarism_enbled()) {
- $groupmember = $this->get_tii_group_member_with_eula($this->allocatableid);
- if (!empty($groupmember)) $id = $groupmember->id;
- }
- } else {
- $id = $this->allocatableid;
+ if ($this->get_coursework()->plagiarism_enbled()) {
+ $groupmember = $this->get_tii_group_member_with_eula($this->allocatableid);
+ if (!empty($groupmember)) $id = $groupmember->id;
}
+ } else {
+ $id = $this->allocatableid;
+ }
}
return $id;
@@ -786,7 +786,7 @@ public function get_author_id() {
* @param $groupid
* @return array
*/
- public function get_tii_group_member_with_eula($groupid) {
+ public function get_tii_group_member_with_eula($groupid) {
global $DB;
@@ -1143,7 +1143,7 @@ public function max_number_of_feedbacks() {
global $DB;
if ($this->get_coursework()->sampling_enabled()) {
- // calculate how many stages(markers) are enabled for this submission
+ // calculate how many stages(markers) are enabled for this submission
$parameters = array('courseworkid' => $this->coursework->id,
'allocatableid' => $this->get_allocatable()->id(),
'allocatabletype' => $this->get_allocatable()->type());
@@ -1398,9 +1398,9 @@ public function final_draft_feedbacks_exist() {
return (empty($editablefeedbacks)) ? false : $editablefeedbacks;
}
-/*
- * Determines whether the current user is able to add a turnitin grademark to this submission
- */
+ /*
+ * Determines whether the current user is able to add a turnitin grademark to this submission
+ */
function can_add_tii_grademark() {
$canadd = false;
diff --git a/classes/render_helpers/grading_report/cells/_user_cell.php b/classes/render_helpers/grading_report/cells/_user_cell.php
index def69931..213a3428 100644
--- a/classes/render_helpers/grading_report/cells/_user_cell.php
+++ b/classes/render_helpers/grading_report/cells/_user_cell.php
@@ -48,7 +48,7 @@ public function get_table_cell($rowobject) {
*/
$user = $rowobject->get_allocatable();
- /* if ($rowobject->can_view_username()) {
+ /* if ($rowobject->can_view_username()) {
$content .= $OUTPUT->user_picture($user->get_raw_record());
} else {
$renderer = $PAGE->get_renderer('core');
@@ -69,28 +69,28 @@ public function get_table_cell($rowobject) {
*/
public function get_table_header($options = []) {
- $viewanonymous = has_capability('mod/coursework:viewanonymous', $this->coursework->get_context());
+ $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
$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
- if ($viewanonymous || !$this->coursework->blindmarking) {
- $sort_by_first_name = $this->helper_sortable_heading(get_string('firstname'),
+ // 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_by_first_name = $this->helper_sortable_heading(get_string('firstname'),
'firstname',
$options['sorthow'],
$options['sortby'],
$tablename);
- $sort_by_last_name = $this->helper_sortable_heading(get_string('lastname'),
+ $sort_by_last_name = $this->helper_sortable_heading(get_string('lastname'),
'lastname',
$options['sorthow'],
$options['sortby'],
$tablename);
- } else { // otherwise display header without sorting
- $sort_by_first_name = get_string('firstname');
- $sort_by_last_name =get_string('lastname');
- }
+ } else { // otherwise display header without sorting
+ $sort_by_first_name = get_string('firstname');
+ $sort_by_last_name =get_string('lastname');
+ }
if ($this->fullname_format() == 'lf') {
$sort_by_name = $sort_by_last_name . ' / ' . $sort_by_first_name;
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 07b72e25..1ab3ac31 100644
--- a/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php
+++ b/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php
@@ -162,7 +162,7 @@ private function new_moderation_button($rowobject, $assessor) {
// moderation only done for single marking courseworks
$feedback = $rowobject->get_submission()->get_assessor_feedback_by_stage('assessor_1');
- $moderation_params = array(
+ $moderation_params = array(
'submission' => $rowobject->get_submission(),
'assessor' => $assessor,
'stage' => $this->stage,
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 3b01688b..d0dc6ed4 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
@@ -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
@@ -150,13 +150,13 @@ public function get_content($rowobject) {
if ($finalfeedback !== false) {
$content .= html_writer::empty_tag('br');
- if ((!$this->coursework->sampling_enabled() || $rowobject->get_submission()->sampled_feedback_exists()) && ($finalfeedback->get_feedbacks_assessorid() == 0
+ 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
- $content .= "(".get_string('automaticagreement', 'coursework').")";
- } else {
- $content .= ' by: ' . $finalfeedback->get_assesor_username();
- }
+ $content .= "(".get_string('automaticagreement', 'coursework').")";
+ } else {
+ $content .= ' by: ' . $finalfeedback->get_assesor_username();
+ }
}
return $content;
}
diff --git a/classes/render_helpers/grading_report/cells/user_cell.php b/classes/render_helpers/grading_report/cells/user_cell.php
index 6eddeab0..acf601fd 100644
--- a/classes/render_helpers/grading_report/cells/user_cell.php
+++ b/classes/render_helpers/grading_report/cells/user_cell.php
@@ -43,7 +43,7 @@ public function get_table_cell($rowobject) {
$content = '';
- /* if ($rowobject->can_view_username()) {
+ /* if ($rowobject->can_view_username()) {
$content .= $OUTPUT->user_picture($user->get_raw_record());
} else {
$renderer = $PAGE->get_renderer('core');
@@ -56,7 +56,7 @@ public function get_table_cell($rowobject) {
$content .= ' ' . $rowobject->get_user_name(true);
$content .= "
".$rowobject->get_email();
$user = $rowobject->get_allocatable();
-/*
+ /*
$candidatenumber = $user->candidate_number();
if (!empty($candidatenumber)) {
@@ -65,7 +65,7 @@ public function get_table_cell($rowobject) {
}
-*/
+ */
return $this->get_new_cell_with_class($content);
}
@@ -76,35 +76,35 @@ public function get_table_cell($rowobject) {
*/
public function get_table_header($options = []) {
- $viewanonymous = has_capability('mod/coursework:viewanonymous', $this->coursework->get_context());
+ $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
$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
- if ($viewanonymous || !$this->coursework->blindmarking) {
- $sort_by_first_name = $this->helper_sortable_heading(get_string('firstname'),
+ // 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_by_first_name = $this->helper_sortable_heading(get_string('firstname'),
'firstname',
$options['sorthow'],
$options['sortby'],
$tablename);
- $sort_by_last_name = $this->helper_sortable_heading(get_string('lastname'),
+ $sort_by_last_name = $this->helper_sortable_heading(get_string('lastname'),
'lastname',
$options['sorthow'],
$options['sortby'],
$tablename);
- $sort_by_email = $this->helper_sortable_heading(get_string('email', 'mod_coursework'),
+ $sort_by_email = $this->helper_sortable_heading(get_string('email', 'mod_coursework'),
'email',
$options['sorthow'],
$options['sortby'],
$tablename);
- } else { // otherwise display header without sorting
- $sort_by_first_name = get_string('firstname');
- $sort_by_last_name = get_string('lastname');
- $sort_by_email = get_string('email', 'mod_coursework');
- }
+ } else { // otherwise display header without sorting
+ $sort_by_first_name = get_string('firstname');
+ $sort_by_last_name = get_string('lastname');
+ $sort_by_email = get_string('email', 'mod_coursework');
+ }
if ($this->fullname_format() == 'lf') {
$sort_by_first_name = ' / ' . $sort_by_first_name;
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 35646de9..ebdd57c8 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
@@ -118,7 +118,7 @@ protected function render_assessor_feedback_table(assessor_feedback_table $asses
// Don't show empty rows with nothing in them
// As a part of Release 1 we decided to show all rows to apply styling correctly,
// this is expected to be rewritten for Release 2
- /* if (!$feedback_row->get_assessor()->id() && (!$feedback_row->get_submission() ||
+ /* if (!$feedback_row->get_assessor()->id() && (!$feedback_row->get_submission() ||
!$feedback_row->get_submission()->ready_to_grade() ||
$this->already_shown_a_new_buton)) {
continue;
@@ -149,7 +149,7 @@ protected function render_assessor_feedback_table(assessor_feedback_table $asses
$allocation_string = ($coursework->allocation_enabled())
? get_string('allocatedtoassessor', 'mod_coursework')
: get_string('assessor', 'mod_coursework');
-/*
+ /*
$table_html = '