');
$moodle_form->addElement('html', get_string('submissionsdeadlineinfo', 'mod_coursework'));
@@ -367,13 +367,13 @@ protected function add_submission_deadline_field() {
protected function add_personal_deadline_field() {
$moodle_form =& $this->_form;
- $options = array(0 => get_string('no'), 1 => get_string('yes'));
+ $options = [0 => get_string('no'), 1 => get_string('yes')];
$courseworkid = $this->get_coursework_id();
$disabled = [];
if (coursework_personal_deadline_passed($courseworkid)) {
$moodle_form->disabledIf('personaldeadlineenabled', 'deadline[enabled]', 'notchecked');
- $disabled = array('disabled' => true);
+ $disabled = ['disabled' => true];
}
$moodle_form->addElement('select',
'personaldeadlineenabled',
@@ -405,7 +405,7 @@ protected function add_start_date_field() {
$moodle_form->addElement('date_time_selector',
'startdate',
get_string('startdate', 'coursework'),
- array('optional' => true, 'disabled' => $disabled)
+ ['optional' => true, 'disabled' => $disabled]
);
if (!empty($CFG->coursework_start_date)) {
@@ -417,7 +417,7 @@ protected function add_start_date_field() {
private function add_marking_deadline_field() {
global $CFG;
$moodle_form =& $this->_form;
- $options = array(0 => get_string('no'), 1 => get_string('yes'));
+ $options = [0 => get_string('no'), 1 => get_string('yes')];
$moodle_form->addElement('select',
'markingdeadlineenabled',
get_string('usemarkingdeadline', 'mod_coursework'), $options);
@@ -472,7 +472,7 @@ protected function add_initial_marking_deadline_field() {
$moodle_form->addElement('date_time_selector',
'initialmarkingdeadline',
get_string('initialmarkingdeadline', 'coursework'),
- array('optional' => true, 'disabled' => $disabled)
+ ['optional' => true, 'disabled' => $disabled]
);
if (!empty($CFG->coursework_marking_deadline)) {
@@ -525,7 +525,7 @@ protected function add_agreed_grade_marking_deadline_field() {
$moodle_form->addElement('date_time_selector',
'agreedgrademarkingdeadline',
get_string('agreedgrademarkingdeadline', 'coursework'),
- array('optional' => true, 'disabled' => $disabled)
+ ['optional' => true, 'disabled' => $disabled]
);
// $moodle_form->disabledIf('agreedgrademarkingdeadline', 'numberofmarkers', 'eq', '1');
@@ -544,7 +544,7 @@ protected function add_relative_initial_marking_deadline_field() {
$moodle_form =& $this->_form;
- $options = array('0' => get_string('disabled', 'mod_coursework'));
+ $options = ['0' => get_string('disabled', 'mod_coursework')];
$options['7'] = get_string('oneweekoption', 'mod_coursework');
$options['14'] = get_string('twoweeksoption', 'mod_coursework');
$options['21'] = get_string('threeweeksoption', 'mod_coursework');
@@ -571,7 +571,7 @@ protected function add_relative_agreed_grade_marking_deadline_field() {
$moodle_form =& $this->_form;
- $options = array('0' => get_string('disabled', 'mod_coursework'));
+ $options = ['0' => get_string('disabled', 'mod_coursework')];
$options['7'] = get_string('oneweekoption', 'mod_coursework');
$options['14'] = get_string('twoweeksoption', 'mod_coursework');
$options['21'] = get_string('threeweeksoption', 'mod_coursework');
@@ -604,7 +604,7 @@ protected function add_digest_header() {
private function add_marking_reminder_field() {
global $CFG;
$moodle_form =& $this->_form;
- $options = array(0 => get_string('no'), 1 => get_string('yes'));
+ $options = [0 => get_string('no'), 1 => get_string('yes')];
$moodle_form->addElement('select',
'markingreminderenabled',
get_string('sendmarkingreminder', 'mod_coursework'), $options);
@@ -627,7 +627,7 @@ protected function add_marking_reminder_warning() {
*/
protected function add_allow_early_finalisation_field() {
$moodle_form =& $this->_form;
- $options = array( 0 => get_string('no'), 1 => get_string('yes'));
+ $options = [ 0 => get_string('no'), 1 => get_string('yes')];
$moodle_form->addElement('select',
'allowearlyfinalisation',
get_string('allowearlyfinalisation', 'mod_coursework'), $options);
@@ -654,7 +654,7 @@ protected function add_group_submission_header() {
protected function add_use_groups_field() {
$moodle_form =& $this->_form;
- $options = array( 0 => get_string('no'), 1 => get_string('yes'));
+ $options = [ 0 => get_string('no'), 1 => get_string('yes')];
$moodle_form->addElement('select', 'use_groups', get_string('use_groups', 'mod_coursework'), $options);
$moodle_form->addHelpButton('use_groups', 'use_groups', 'mod_coursework');
}
@@ -667,7 +667,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_result = $DB->get_records('groupings', ['courseid' => $COURSE->id], 'name', 'id, name');
$groups_options = [];
if ($groups_options_result !== false) {
foreach ($groups_options_result as $result) {
@@ -677,7 +677,7 @@ protected function add_grouping_field() {
// Not calling it groupingid as this conflicts with the groupingid field in the common module
// settings.
- $default_groups_options = array(0 => 'Use all groups');
+ $default_groups_options = [0 => 'Use all groups'];
$groups_options = $default_groups_options + $groups_options;
$moodle_form->addElement('select',
'grouping_id',
@@ -705,7 +705,7 @@ protected function add_file_types_field() {
$moodle_form->addElement('text',
'filetypes',
get_string('filetypes', 'coursework'),
- array('placeholder' => 'e.g. doc, docx, txt, rtf'));
+ ['placeholder' => 'e.g. doc, docx, txt, rtf']);
$moodle_form->addHelpButton('filetypes', 'filetypes', 'mod_coursework');
$moodle_form->setType('filetypes', PARAM_TEXT);
$moodle_form->disabledIf('filetypes', 'use_turnitin', 'eq', '1');
@@ -746,7 +746,7 @@ protected function add_number_of_files_field() {
$moodle_form =& $this->_form;
// Maximum number of files:
- $choices = array(1 => 1,
+ $choices = [1 => 1,
2 => 2,
3 => 3,
4 => 4,
@@ -755,7 +755,7 @@ protected function add_number_of_files_field() {
7 => 7,
8 => 8,
9 => 9,
- 10 => 10);
+ 10 => 10];
$moodle_form->addElement('select',
'maxfiles',
get_string('maxfiles', 'coursework'),
@@ -772,10 +772,10 @@ protected function add_rename_file_field() {
$moodle_form =& $this->_form;
- $choices = array('0' => get_string('no'), '1' => get_string('yes'));
+ $choices = ['0' => get_string('no'), '1' => get_string('yes')];
$courseworkid = $this->get_coursework_id();
$courseworkhassubmissions = !empty($courseworkid)
- && $DB->record_exists('coursework_submissions', array('courseworkid' => $courseworkid));
+ && $DB->record_exists('coursework_submissions', ['courseworkid' => $courseworkid]);
if (empty($courseworkid) || empty($courseworkhassubmissions)) {
@@ -806,7 +806,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, ['courseworkid' => $courseworkid])) ? get_string('yesrenamefile', 'mod_coursework') : get_string('norenamefile', 'mod_coursework');
$moodle_form->addElement('static', 'renamefilesdescription', get_string('renamefiles', 'mod_coursework'),
$settingvalue);
@@ -832,12 +832,12 @@ protected function add_number_of_initial_assessors_field() {
$moodle_form =& $this->_form;
$courseworkid = $this->get_coursework_id();
- $multi_options = array(
+ $multi_options = [
// Don't want to give the option for 0!
1 => 1,
2 => 2,
3 => 3,
- );
+ ];
// Remove all options lower than the current maximum number of feedbacks that any student has.
$currentmaxfeedbacks = coursework_get_current_max_feedbacks($courseworkid);
if ($currentmaxfeedbacks) {
@@ -862,7 +862,7 @@ protected function add_number_of_initial_assessors_field() {
protected function add_enable_moderation_agreement_field() {
$moodle_form =& $this->_form;
- $options = array(0 => get_string('no'), 1 => get_string('yes'));
+ $options = [0 => get_string('no'), 1 => get_string('yes')];
$moodle_form->addElement('select', 'moderationagreementenabled', get_string('moderationagreementenabled', 'mod_coursework'), $options);
$moodle_form->addHelpButton('moderationagreementenabled', 'moderationagreementenabled', 'mod_coursework');
$moodle_form->setDefault('moderationagreementenabled', 0);
@@ -890,7 +890,7 @@ protected function get_coursework_id() {
protected function add_enable_allocation_field() {
$moodle_form =& $this->_form;
- $options = array( 0 => get_string('no'), 1 => get_string('yes'));
+ $options = [ 0 => get_string('no'), 1 => get_string('yes')];
$moodle_form->addElement('select', 'allocationenabled', get_string('allocationenabled', 'mod_coursework'), $options);
$moodle_form->addHelpButton('allocationenabled', 'allocationenabled', 'mod_coursework');
}
@@ -909,7 +909,7 @@ protected function add_assessor_allocation_strategy_field_rdb() {
foreach ($keys as $key) {
$radioarray[] =& $moodle_form->createElement('radio', 'assessorallocationstrategy', '', $options[$key], $key, '');
}
- $moodle_form->addGroup($radioarray, 'radioarray', get_string('assessorallocationstrategy', 'mod_coursework'), array(' '), false);
+ $moodle_form->addGroup($radioarray, 'radioarray', get_string('assessorallocationstrategy', 'mod_coursework'), [' '], false);
$moodle_form->addHelpButton('radioarray', 'assessorallocationstrategy', 'mod_coursework');
$moodle_form->disabledIf('radioarray', 'allocationenabled', 'eq', 0);
}
@@ -960,7 +960,7 @@ protected function add_enable_blind_marking_field() {
$moodle_form =& $this->_form;
- $options = array( 0 => get_string('no'), 1 => get_string('yes'));
+ $options = [ 0 => get_string('no'), 1 => get_string('yes')];
$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);
@@ -992,7 +992,7 @@ protected function add_enable_assessor_anonymity_field() {
global $CFG;
$moodle_form =& $this->_form;
- $options = array(0 => get_string('no'), 1 => get_string('yes'));
+ $options = [0 => get_string('no'), 1 => get_string('yes')];
$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);
@@ -1019,14 +1019,14 @@ protected function add_individual_feedback_release_date_field() {
$timestamp = strtotime('+' . $CFG->coursework_individualfeedback . ' weeks');
- $default = array(
+ $default = [
'day' => date('j', $timestamp),
'month' => date('n', $timestamp),
'year' => date('Y', $timestamp),
'hour' => date('G', $timestamp),
'minute' => date('i', $timestamp),
- );
- $options = array('optional' => true);
+ ];
+ $options = ['optional' => true];
if ($CFG->coursework_auto_release_individual_feedback == 0) {
$options['disabled'] = true;
@@ -1061,7 +1061,7 @@ protected function add_email_individual_feedback_notification_field() {
global $CFG;
$moodle_form =& $this->_form;
- $options = array(0 => get_string('no'), 1 => get_string('yes'));
+ $options = [0 => get_string('no'), 1 => get_string('yes')];
$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);
@@ -1078,18 +1078,18 @@ protected function add_general_feedback_release_date_field() {
$moodle_form->addElement('date_time_selector',
'generalfeedback',
get_string('generalfeedbackreleasedate', 'coursework'),
- array('optional' => true, 'disabled' => true));
+ ['optional' => true, 'disabled' => true]);
// We have a field which is sometimes disabled. Disabled fields are not sent back to the
// server, so the default is used.
$timestamp = strtotime('+' . $CFG->coursework_generalfeedback . ' weeks');
- $default = array(
+ $default = [
'day' => date('j', $timestamp),
'month' => date('n', $timestamp),
'year' => date('Y', $timestamp),
'hour' => date('G', $timestamp),
'minute' => date('i', $timestamp),
- );
+ ];
$moodle_form->setDefault('generalfeedback', $default);
$moodle_form->addHelpButton('generalfeedback', 'generalfeedback', 'mod_coursework');
$moodle_form->disabledIf('generalfeedback', 'deadline[enabled]', 'notchecked');
@@ -1103,8 +1103,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 = [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');
@@ -1155,7 +1155,7 @@ protected function add_turnitin_files_settings_waring() {
private function add_allow_late_submissions_field() {
global $CFG;
$moodle_form =& $this->_form;
- $options = array( 0 => get_string('no'), 1 => get_string('yes'));
+ $options = [ 0 => get_string('no'), 1 => get_string('yes')];
$moodle_form->addElement('select',
'allowlatesubmissions',
get_string('allowlatesubmissions', 'mod_coursework'), $options);
@@ -1169,7 +1169,7 @@ protected function add_all_feedbacks_field() {
$moodle_form =& $this->_form;
- $options = array( 0 => get_string('no'), 1 => get_string('yes'));
+ $options = [ 0 => get_string('no'), 1 => get_string('yes')];
$moodle_form->addElement('select',
'showallfeedbacks',
get_string('showallfeedbacks', 'mod_coursework'), $options);
@@ -1213,7 +1213,7 @@ private function add_enable_agreed_grade_delay() {
$moodle_form =& $this->_form;
- $options = array('0' => get_string('disabled', 'mod_coursework'));
+ $options = ['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');
@@ -1236,7 +1236,7 @@ private function add_save_feedback_as_draft() {
$moodle_form =& $this->_form;
- $options = array(0 => get_string('no'), 1 => get_string('yes'));
+ $options = [0 => get_string('no'), 1 => get_string('yes')];
$moodle_form->addElement('select', 'draftfeedbackenabled', get_string('savefeedbackasdraft', 'mod_coursework'), $options);
$moodle_form->addHelpButton('draftfeedbackenabled', 'savefeedbackasdraft', 'mod_coursework');
@@ -1276,7 +1276,7 @@ private function add_enable_extensions_field() {
global $CFG;
$moodle_form =& $this->_form;
- $options = array( 0 => get_string('no'), 1 => get_string('yes'));
+ $options = [ 0 => get_string('no'), 1 => get_string('yes')];
$moodle_form->addElement('select', 'extensionsenabled', get_string('individual_extension', 'mod_coursework'), $options);
$moodle_form->addHelpButton('extensionsenabled', 'individual_extension', 'mod_coursework');
$moodle_form->setDefault('extensionsenabled', $CFG->coursework_individual_extension);
@@ -1305,9 +1305,9 @@ private function add_submission_notification_field() {
}
private function add_automatic_agreement_enabled() {
- $options = array('none' => 'none',
+ $options = ['none' => 'none',
'percentage_distance' => 'percentage distance',
- 'average_grade' => 'average grade');
+ 'average_grade' => 'average grade'];
$this->form()->addelement('select',
'automaticagreementstrategy',
get_string('automaticagreementofgrades', 'mod_coursework'),
@@ -1326,9 +1326,9 @@ private function add_automatic_agreement_enabled() {
$this->form()->setDefault('automaticagreementrange', 10);
// rounding of the average grade
- $roundingoptions = array('mid' => get_string('roundmid', 'mod_coursework'),
+ $roundingoptions = ['mid' => get_string('roundmid', 'mod_coursework'),
'up' => get_string('roundup', 'mod_coursework'),
- 'down' => get_string('rounddown', 'mod_coursework'));
+ 'down' => get_string('rounddown', 'mod_coursework')];
$this->form()->addElement('select',
'roundingrule',
@@ -1346,7 +1346,7 @@ private function add_enable_plagiarism_flag_field() {
global $CFG;
$moodle_form =& $this->_form;
- $options = array( 0 => get_string('no'), 1 => get_string('yes'));
+ $options = [ 0 => get_string('no'), 1 => get_string('yes')];
$moodle_form->addElement('select', 'plagiarismflagenabled', get_string('plagiarism_flag_enable', 'mod_coursework'), $options);
$moodle_form->addHelpButton('plagiarismflagenabled', 'plagiarism_flag_enable', 'mod_coursework');
$moodle_form->setDefault('plagiarismflagenabled', $CFG->coursework_plagiarismflag);
diff --git a/renderers/grading_report_renderer.php b/renderers/grading_report_renderer.php
index b37197aa..7cdd17c3 100644
--- a/renderers/grading_report_renderer.php
+++ b/renderers/grading_report_renderer.php
@@ -88,12 +88,12 @@ 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', [
'name' => '',
'type' => 'hidden',
'data-lang' => json_encode($lang_messages),
'id' => 'element_lang_messages',
- ));
+ ]);
$result = html_writer::div($result);
return $result;
diff --git a/renderers/object_renderer.php b/renderers/object_renderer.php
index 4bcf74be..110b7461 100644
--- a/renderers/object_renderer.php
+++ b/renderers/object_renderer.php
@@ -285,8 +285,8 @@ protected function render_mod_coursework_assessor_feedback_row(mod_coursework_as
$cell->text = $assessor->picture();
$cell->text .= ' ';
- $profilelinkurl = new moodle_url('/user/profile.php', array('id' => $assessor->id(),
- 'course' => $COURSE->id));
+ $profilelinkurl = new moodle_url('/user/profile.php', ['id' => $assessor->id(),
+ 'course' => $COURSE->id]);
$cell->text .= html_writer::link($profilelinkurl, $assessor->name());
$row->cells['assessor'] = $cell;
@@ -299,10 +299,10 @@ protected function render_mod_coursework_assessor_feedback_row(mod_coursework_as
$submission = $feedbackrow->get_submission();
$new_feedback = false;
if (empty($existing_feedback)) {
- $params = array(
+ $params = [
'assessorid' => $assessor->id(),
'stage_identifier' => $feedbackrow->get_stage()->identifier(),
- );
+ ];
if ($submission) {
$params['submissionid'] = $submission->id;
}
@@ -314,34 +314,34 @@ protected function render_mod_coursework_assessor_feedback_row(mod_coursework_as
if ($existing_feedback && $ability->can('edit', $existing_feedback)) {
$linktitle = get_string('edit');
- $icon = new pix_icon('edit', $linktitle, 'coursework', array('width' => '20px'));
+ $icon = new pix_icon('edit', $linktitle, 'coursework', ['width' => '20px']);
$link_id = "edit_feedback_" . $feedbackrow->get_feedback()->id;
- $link = $this->get_router()->get_path('edit feedback', array('feedback' => $feedbackrow->get_feedback()));
- $iconlink = $this->output->action_icon($link, $icon, null, array('id' => $link_id));
+ $link = $this->get_router()->get_path('edit feedback', ['feedback' => $feedbackrow->get_feedback()]);
+ $iconlink = $this->output->action_icon($link, $icon, null, ['id' => $link_id]);
$cell->text .= $iconlink;
} else if ($new_feedback && $ability->can('new', $new_feedback)) {
// New
$linktitle = "new_feedback";
- $icon = new pix_icon('edit', $linktitle, 'coursework', array('width' => '20px'));
+ $icon = new pix_icon('edit', $linktitle, 'coursework', ['width' => '20px']);
- $new_feedback_params = array(
+ $new_feedback_params = [
'submission' => $feedbackrow->get_submission(),
'assessor' => $feedbackrow->get_assessor(),
'stage' => $feedbackrow->get_stage(),
- );
+ ];
$link = $this->get_router()->get_path('new feedback', $new_feedback_params);
- $iconlink = $this->output->action_icon($link, $icon, null, array('class' => "new_feedback"));
+ $iconlink = $this->output->action_icon($link, $icon, null, ['class' => "new_feedback"]);
$cell->text .= $iconlink;
} else if ($existing_feedback && $ability->can('show', $existing_feedback)) {
// Show - for managers and others who are reviewing the grades but who should
// not be able to change them.
$linktitle = get_string('viewfeedback', 'mod_coursework');
- $icon = new pix_icon('show', $linktitle, 'coursework', array('width' => '20px'));
+ $icon = new pix_icon('show', $linktitle, 'coursework', ['width' => '20px']);
$link_id = "show_feedback_" . $feedbackrow->get_feedback()->id;
- $link = $this->get_router()->get_path('show feedback', array('feedback' => $feedbackrow->get_feedback()));
- $iconlink = $this->output->action_icon($link, $icon, null, array('id' => $link_id));
+ $link = $this->get_router()->get_path('show feedback', ['feedback' => $feedbackrow->get_feedback()]);
+ $iconlink = $this->output->action_icon($link, $icon, null, ['id' => $link_id]);
$cell->text .= $iconlink;
}
@@ -534,12 +534,12 @@ protected function render_mod_coursework_coursework(mod_coursework_coursework $c
if ($canaddgeneralfeedback) {
$title = ($coursework->feedbackcomment) ? get_string('editgeneralfeedback', 'coursework') : get_string('addgeneralfeedback', 'coursework');
$class = ($coursework->feedbackcomment) ? 'edit-btn' : 'add-general_feedback-btn';
- $out .= html_writer::tag('p', '', array('id' => 'feedback_text'));
+ $out .= html_writer::tag('p', '', ['id' => 'feedback_text']);
$link = new moodle_url('/mod/coursework/actions/general_feedback.php',
- array('cmid' => $coursework->get_coursemodule_id()));
+ ['cmid' => $coursework->get_coursemodule_id()]);
$out .= html_writer::link($link,
$title,
- array('class' => $class));
+ ['class' => $class]);
$out .= html_writer::empty_tag('br');
$out .= html_writer::empty_tag('br');
}
@@ -575,14 +575,14 @@ protected function render_mod_coursework_allocation_table(mod_coursework_allocat
$all = count($allocation_table->get_coursework()->get_allocatables());
- $records_per_page = array(3 => 3,
+ $records_per_page = [3 => 3,
10 => 10,
20 => 20,
30 => 30,
40 => 40,
50 => 50,
100 => 100,
- $all => get_string('all', 'mod_coursework')); // for boost themes instead of 'all' we can put 0, however currently it is a bug
+ $all => get_string('all', 'mod_coursework')]; // for boost themes instead of 'all' we can put 0, however currently it is a bug
// Commenting these out as they appear unused and are causing exception in behat test.
// $single_select_params = compact('sortby', 'sorthow', 'page');
@@ -643,10 +643,10 @@ protected function render_mod_coursework_allocation_table(mod_coursework_allocat
';
// Form save button.
- $attributes = array('name' => 'save',
+ $attributes = ['name' => 'save',
'type' => 'submit',
'id' => 'save_manual_allocations_1',
- 'value' => get_string('save', 'mod_coursework'));
+ 'value' => get_string('save', 'mod_coursework')];
$table_html .= html_writer::empty_tag('input', $attributes);
$table_html .= $this->output->render($select);
@@ -696,7 +696,7 @@ public function render_mod_coursework_allocation_widget(mod_coursework_allocatio
$html .= '
';
- $html .= html_writer::start_tag('h3', array('id' => 'assessor_allocation_settings_header'));
+ $html .= html_writer::start_tag('h3', ['id' => 'assessor_allocation_settings_header']);
$html .= get_string('assessorallocationstrategy', 'mod_coursework');
//$html .= $this->output->help_icon('allocationstrategy', 'mod_coursework');
$html .= html_writer::end_tag('h3');
@@ -712,30 +712,30 @@ public function render_mod_coursework_allocation_widget(mod_coursework_allocatio
'');
// We want to allow the allocation strategy to add configuration options.
- $html .= html_writer::start_tag('div', array('class' => 'assessor-strategy-options-configs'));
+ $html .= html_writer::start_tag('div', ['class' => 'assessor-strategy-options-configs']);
$html .= $this->get_allocation_strategy_form_elements($allocationwidget->get_coursework());
$html .= html_writer::end_tag('div');
$html .= "
";
- $attributes = array('id' => 'coursework_input_buttons');
+ $attributes = ['id' => 'coursework_input_buttons'];
$html .= html_writer::start_tag('div', $attributes);
// Spacer so we get the button underneath the form stuff.
- $attributes = array('class' => 'coursework_spacer');
+ $attributes = ['class' => 'coursework_spacer'];
$html .= html_writer::start_tag('div', $attributes);
$html .= html_writer::end_tag('div');
// Save button.
- $attributes = array('name' => 'save',
+ $attributes = ['name' => 'save',
'type' => 'submit',
'id' => 'save_assessor_allocation_strategy',
'class' => 'coursework_assessor_allocation',
- 'value' => get_string('apply', 'mod_coursework'));
+ 'value' => get_string('apply', 'mod_coursework')];
$html .= html_writer::empty_tag('input', $attributes);
- $attributes = array('name' => 'saveandexit',
+ $attributes = ['name' => 'saveandexit',
'type' => 'submit',
'id' => 'save_and_exit_assessor_allocation_strategy',
'class' => 'coursework_assessor_allocation',
- 'value' => get_string('save_and_exit', 'mod_coursework'));
+ 'value' => get_string('save_and_exit', 'mod_coursework')];
$html .= html_writer::empty_tag('input', $attributes);
$html .= html_writer::end_tag('div');
$html .= '
';
@@ -757,17 +757,17 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$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('div', ['class' => 'assessor-sampling-wrapper accordion']);
- $html .= html_writer::start_tag('h3', array('id' => 'sampling_strategy_settings_header'));
+ $html .= html_writer::start_tag('h3', ['id' => 'sampling_strategy_settings_header']);
$html .= get_string('samplingstrategy', 'mod_coursework');
$html .= html_writer::end_tag('h3');
- $html .= html_writer::start_tag('div', array('class' => 'sampling-rules'));
+ $html .= html_writer::start_tag('div', ['class' => 'sampling-rules']);
// 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', ['class' => 'sampling-select']);
$script = "
var samplingValidateHdl = [];
@@ -777,7 +777,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$table = new html_table();
$table->attributes['class'] = 'sampling';
- $table->head = array('');
+ $table->head = [''];
$assessorheaders = [];
@@ -796,7 +796,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$comma = ",";
}
} else {
- $grade_scale = \grade_scale::fetch(array('id' => abs($samplingwidget->get_coursework()->grade)));
+ $grade_scale = \grade_scale::fetch(['id' => abs($samplingwidget->get_coursework()->grade)]);
$scale = $grade_scale->scale;
}
@@ -804,11 +804,11 @@ 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', ['class' => 'samples_strategy']);
$assessor1cell .= get_string('assessoronedefault', 'mod_coursework');
$assessor1cell .= html_writer::end_tag('div');
- $columndata = array(new html_table_cell($assessor1cell));
+ $columndata = [new html_table_cell($assessor1cell)];
$percentage_options = [];
@@ -822,20 +822,20 @@ 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 = ['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;
- $sampling_cell = html_writer::start_tag('div', array('class' => 'samples_strategy'));
+ $sampling_cell = html_writer::start_tag('div', ['class' => 'samples_strategy']);
$sampling_cell .= html_writer::label(get_string('sampletype', 'mod_coursework'), "assessor_{$i}_samplingstrategy");
$sampling_cell .= html_writer::select($sampling_strategies,
"assessor_{$i}_samplingstrategy",
$selected,
false,
- array('id' => "assessor_{$i}_samplingstrategy", 'class' => "assessor_sampling_strategy sampling_strategy_detail"));
+ ['id' => "assessor_{$i}_samplingstrategy", 'class' => "assessor_sampling_strategy sampling_strategy_detail"]);
$sampling_cell .= html_writer::end_tag('div');
@@ -851,7 +851,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$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, '', ['id' => "assessor_{$i}_automatic_rules"]);
$columndata[] = new html_table_cell($sampling_cell);
}
@@ -863,10 +863,10 @@ 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',
+ $attributes = ['name' => 'save_sampling',
'type' => 'submit',
'id' => 'save_manual_sampling',
- 'value' => get_string('save', 'mod_coursework'));
+ 'value' => get_string('save', 'mod_coursework')];
$html .= html_writer::empty_tag('input', $attributes);
/**
@@ -922,19 +922,19 @@ private function sampling_strategy_column($samplingwidget, $suffix = '') {
$sampling_column .= html_writer::start_tag('div');
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::start_tag('span', ['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'),
- array('id' => "assessor_{$suffix}_samplerules_{$i}", 'class' => "assessor_{$suffix} sampling_strategy_detail"));
+ ['id' => "assessor_{$suffix}_samplerules_{$i}", 'class' => "assessor_{$suffix} sampling_strategy_detail"]);
- $options = array('0' => get_string('percentagesign', 'mod_coursework'),
- '1' => get_string('gradescale', 'mod_coursework'));
+ $options = ['0' => get_string('percentagesign', 'mod_coursework'),
+ '1' => get_string('gradescale', 'mod_coursework')];
$sampling_column .= html_writer::select($options,
"assessor_{$suffix}_sampletype[]",
$samplingwidget->get_sampling_strategy(),
false,
- array('id' => "assessor_{$suffix}_sampletype_{$i}", 'class' => "grade_type assessor_{$suffix} sampling_strategy_detail"));
+ ['id' => "assessor_{$suffix}_sampletype_{$i}", 'class' => "grade_type assessor_{$suffix} sampling_strategy_detail"]);
$sampling_column .= html_writer::label(get_string('from', 'mod_coursework'), 'assessortwo_samplefrom[0]');
@@ -944,7 +944,7 @@ private function sampling_strategy_column($samplingwidget, $suffix = '') {
"assessor_{$suffix}_samplefrom[]",
$samplingwidget->get_sampling_strategy(),
false,
- array('id' => "assessor_{$suffix}_samplefrom_{$i}", 'class' => "assessor_{$suffix} sampling_strategy_detail"));
+ ['id' => "assessor_{$suffix}_samplefrom_{$i}", 'class' => "assessor_{$suffix} sampling_strategy_detail"]);
$sampling_column .= html_writer::label(get_string('to', 'mod_coursework'), "assessor_{$suffix}_sampleto[0]");
@@ -952,24 +952,24 @@ private function sampling_strategy_column($samplingwidget, $suffix = '') {
"assessor_{$suffix}_sampleto[]",
$samplingwidget->get_sampling_strategy(),
false,
- array('id' => "assessor_{$suffix}_sampleto_{$i}", 'class' => "assessor_{$suffix} sampling_strategy_detail"));
+ ['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::link('#', get_string('addgraderule', 'mod_coursework'), ['id' => "assessor_{$suffix}_addgradderule", 'class' => 'addgradderule sampling_strategy_detail']);
+ $sampling_column .= html_writer::link('#', get_string('removegraderule', 'mod_coursework'), ['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"));
+ ['id' => "assessor_{$suffix}_samplerules[]", 'class' => "assessor_{$suffix} sampling_strategy_detail"]);
$sampling_column .= html_writer::select($percentage_options,
"assessor_{$suffix}_sampletopup",
$samplingwidget->get_sampling_strategy(),
false,
- array('id' => "assessor_{$suffix}_sampletopup", 'class' => "assessor_{$suffix} sampling_strategy_detail"));
+ ['id' => "assessor_{$suffix}_sampletopup", 'class' => "assessor_{$suffix} sampling_strategy_detail"]);
$sampling_column .= html_writer::label(get_string('ofallstudents', 'mod_coursework'), 'assessortwo_sampleto[]');
return $sampling_column;
@@ -993,7 +993,7 @@ private function output_grade_as_string($grade, $maxgrade) {
if ($maxgrade < -1) { // Coursework is graded with a scale.
// TODO cache these.
$scalegrade = -$maxgrade;
- $scale = $DB->get_record('scale', array('id' => ($scalegrade)));
+ $scale = $DB->get_record('scale', ['id' => ($scalegrade)]);
if ($scale) {
$items = explode(',', $scale->scale);
@@ -1037,11 +1037,11 @@ protected function make_moderation_set_rule_row(moderation_set_rule $rule) {
// Can intercept with AJAX later if needs be.
$linktitle = get_string('delete');
- $attributes = array(
+ $attributes = [
'type' => 'submit',
'name' => 'delete-mod-set-rule[' . $rule->id . ']',
'value' => $linktitle,
- );
+ ];
$controlscell->text .= html_writer::empty_tag('input', $attributes);
$row->cells[] = $controlscell;
@@ -1073,10 +1073,10 @@ protected function get_allocation_strategy_form_elements($coursework) {
/* @var \mod_coursework\allocation\strategy\base $strategy */
$strategy = new $full_class_name($coursework);
- $attributes = array(
+ $attributes = [
'class' => 'assessor-strategy-options',
'id' => 'assessor-strategy-' . $classname,
- );
+ ];
// Hide this if it's not currently selected.
$strategytype = 'assessorallocationstrategy';
if ($classname !== $coursework->$strategytype) {
@@ -1132,16 +1132,16 @@ protected function get_sampling_strategy_form_elements($coursework, $assessor_nu
protected function resubmit_to_plagiarism_button($coursework, $submission) {
$html = '';
$html .= html_writer::start_tag('form',
- array('action' => $this->page->url,
- 'method' => 'POST'));
+ ['action' => $this->page->url,
+ 'method' => 'POST']);
$html .= html_writer::empty_tag('input',
- array('type' => 'hidden',
+ ['type' => 'hidden',
'name' => 'submissionid',
- 'value' => $submission->id));
+ 'value' => $submission->id]);
$html .= html_writer::empty_tag('input',
- array('type' => 'hidden',
+ ['type' => 'hidden',
'name' => 'id',
- 'value' => $coursework->get_coursemodule_id()));
+ 'value' => $coursework->get_coursemodule_id()]);
$plagiarism_plugin_names = [];
foreach ($coursework->get_plagiarism_helpers() as $helper) {
$plagiarism_plugin_names[] = $helper->human_readable_name();
@@ -1150,9 +1150,9 @@ protected function resubmit_to_plagiarism_button($coursework, $submission) {
$resubmit = get_string('resubmit', 'coursework', $plagiarism_plugin_names);
$html .= html_writer::empty_tag('input',
- array('type' => 'submit',
+ ['type' => 'submit',
'value' => $resubmit,
- 'name' => 'resubmit'));
+ 'name' => 'resubmit']);
$html .= html_writer::end_tag('form');
return $html;
}
@@ -1164,14 +1164,14 @@ protected function resubmit_to_plagiarism_button($coursework, $submission) {
*/
protected function render_file_plagiarism_information($file, $coursework) {
- $plagiarism_links_params = array(
+ $plagiarism_links_params = [
'userid' => $file->get_userid(),
'file' => $file,
'cmid' => $coursework->get_coursemodule_id(),
'course' => $coursework->get_course(),
'coursework' => $coursework->id,
'modname' => 'coursework',
- );
+ ];
$plagiarsmlinks = plagiarism_get_links($plagiarism_links_params);
return $plagiarsmlinks;
@@ -1193,10 +1193,10 @@ protected function make_file_link($files, $file, $class_name = 'submissionfile')
$image = $this->output->pix_icon(file_file_icon($file),
$filename,
'moodle',
- array('class' => 'submissionfileicon'));
+ ['class' => 'submissionfileicon']);
$fileurl = $url . $file->get_filepath() . $file->get_itemid() . '/' . rawurlencode($filename);
- return html_writer::link($fileurl, $image.$filename, array('class' => $class_name));
+ return html_writer::link($fileurl, $image.$filename, ['class' => $class_name]);
}
/**
@@ -1261,7 +1261,7 @@ protected function coursework_deadlines_table(mod_coursework_coursework $coursew
$lateclass = $coursework->deadline_has_passed() ? 'text-error' : 'text-warning';
}
$latemessage .= ' ';
- $deadline_message = html_writer::start_tag('span', array('class' => $lateclass));
+ $deadline_message = html_writer::start_tag('span', ['class' => $lateclass]);
$deadline_message .= $latemessage;
$deadline_message .= html_writer::end_tag('span');
}
@@ -1277,7 +1277,7 @@ protected function coursework_deadlines_table(mod_coursework_coursework $coursew
}
if ($coursework->has_deadline()) {
- $deadline_message .= html_writer::start_tag('div', array('class' => 'autofinalise_info'));
+ $deadline_message .= html_writer::start_tag('div', ['class' => 'autofinalise_info']);
$deadline_message .= ($coursework->personal_deadlines_enabled() && (!has_capability('mod/coursework:submit', $this->page->context) || is_siteadmin($USER)))
? get_string('personal_deadline_warning', 'mod_coursework') : get_string('deadline_warning', 'mod_coursework');
$deadline_message .= html_writer::end_tag('div');
@@ -1371,17 +1371,17 @@ private function render_allocation_table_row($allocation_row) {
* @return string
*/
protected function render_mod_coursework_personal_deadlines_table(mod_coursework_personal_deadlines_table $personal_deadlines_table) {
- $coursework_page_url = $this->get_router()->get_path('coursework', array('coursework' => $personal_deadlines_table->get_coursework()));
+ $coursework_page_url = $this->get_router()->get_path('coursework', ['coursework' => $personal_deadlines_table->get_coursework()]);
$table_html = '
'.html_writer::link($coursework_page_url, get_string('returntocourseworkpage', '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()), ['id' => 'selected_dates']).'
';
if (has_capability('mod/coursework:revertfinalised', $this->page->context)) {
- $table_html .= '
' . html_writer::link('#', get_string('unfinaliseselected', 'mod_coursework', $personal_deadlines_table->get_coursework()->get_allocatable_type()), array('id' => 'selected_unfinalise')) . '
';
+ $table_html .= '
' . html_writer::link('#', get_string('unfinaliseselected', 'mod_coursework', $personal_deadlines_table->get_coursework()->get_allocatable_type()), ['id' => 'selected_unfinalise']) . '
';
}
$table_html .= '
';
$url = $this->get_router()->get_path('edit personal deadline', []);
@@ -1449,11 +1449,11 @@ private function render_personal_deadline_table_row($personal_deadline_row) {
$coursework = $personal_deadline_row->get_coursework();
- $new_personal_deadline_params = array(
+ $new_personal_deadline_params = [
'allocatableid' => $personal_deadline_row->get_allocatable()->id(),
'allocatabletype' => $personal_deadline_row->get_allocatable()->type(),
'courseworkid' => $personal_deadline_row->get_coursework()->id,
- );
+ ];
//$personal_deadline = \mod_coursework\models\personal_deadline::find($new_personal_deadline_params);
@@ -1473,12 +1473,12 @@ private function render_personal_deadline_table_row($personal_deadline_row) {
$row_html .= '
';
$row_html .= '';
- $new_personal_deadline_params = array(
+ $new_personal_deadline_params = [
'allocatableid' => $personal_deadline_row->get_allocatable()->id(),
'allocatabletype' => $personal_deadline_row->get_allocatable()->type(),
'courseworkid' => $personal_deadline_row->get_coursework()->id,
'setpersonaldeadlinespage' => '1',
- );
+ ];
$allocatable_cell_helper = $personal_deadline_row->get_allocatable_cell();
$personaldeadlines_cell_helper = $personal_deadline_row->get_personal_deadline_cell();
@@ -1532,7 +1532,7 @@ protected function coursework_grading_summary_table(mod_coursework_coursework $c
$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())
+ if (has_any_capability(['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
@@ -1544,7 +1544,7 @@ protected function coursework_grading_summary_table(mod_coursework_coursework $c
}
// If has initialgrade
- if (has_any_capability(array('mod/coursework:addinitialgrade', 'mod/coursework:administergrades'), $coursework->get_context())) {
+ if (has_any_capability(['mod/coursework:addinitialgrade', 'mod/coursework:administergrades'], $coursework->get_context())) {
$assessable_submitted_submissions = $this->remove_final_gradable_submissions($assessable_submitted_submissions);
$needsgrading += count($this->get_assessor_initial_graded_submissions($assessable_submitted_submissions));
@@ -1622,7 +1622,7 @@ public function get_allocatables_count_per_assessor($coursework) {
$participant = count($submissions);
- } else if (is_siteadmin($USER) || !$coursework->allocation_enabled() || has_any_capability(array('mod/coursework:administergrades'), $coursework->get_context())) {
+ } else if (is_siteadmin($USER) || !$coursework->allocation_enabled() || has_any_capability(['mod/coursework:administergrades'], $coursework->get_context())) {
$participant = count($allocatables);
} else {
foreach ($allocatables as $allocatable) {
@@ -1794,7 +1794,7 @@ public function get_submissions_for_assessor($coursework, $submissions) {
$gradeblesub = $submissions;
- } else if (is_siteadmin($USER) || !$coursework->allocation_enabled() || has_any_capability(array('mod/coursework:administergrades'), $coursework->get_context())) {
+ } else if (is_siteadmin($USER) || !$coursework->allocation_enabled() || has_any_capability(['mod/coursework:administergrades'], $coursework->get_context())) {
foreach ($submissions as $sub) {
$submission = submission::find($sub);
diff --git a/settings.php b/settings.php
index 996c28b1..c4504533 100644
--- a/settings.php
+++ b/settings.php
@@ -35,7 +35,7 @@
$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'));
+ $options = [ 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));
@@ -56,13 +56,13 @@
// 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'));
+ $options = [ 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'));
+ $options = [ 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
@@ -70,7 +70,7 @@
$settings->add($blindmarking_header);
$blind_marking_name = get_string('blindmarking', 'coursework');
$blind_marking_description = get_string('blindmarking_desc', 'coursework');
- $options = array( 0 => get_string('no'), 1 => get_string('yes'));
+ $options = [ 0 => get_string('no'), 1 => get_string('yes')];
$settings->add(new admin_setting_configselect('coursework_blindmarking', $blind_marking_name, $blind_marking_description, 0, $options));
$settings->add(new admin_setting_configcheckbox('coursework_forceblindmarking', get_string('forceblindmarking', 'mod_coursework'), get_string('forceblindmarking_desc', 'mod_coursework'), 0));
@@ -79,7 +79,7 @@
$settings->add($assessoranonymity_header);
$assessor_anonymity_name = get_string('assessoranonymity', 'coursework');
$assessor_anonymity_description = get_string('assessoranonymity_desc', 'coursework');
- $options = array( 0 => get_string('no'), 1 => get_string('yes'));
+ $options = [ 0 => get_string('no'), 1 => get_string('yes')];
$settings->add(new admin_setting_configselect('coursework_assessoranonymity', $assessor_anonymity_name, $assessor_anonymity_description, 0, $options));
// Set site-wide options for when feedback is due.
@@ -100,7 +100,7 @@
// enable auto-release of individual feedback
$individual_feedback_auto_release_name = get_string('individual_feedback_auto_release', 'coursework');
$individual_feedback_auto_release_name_description = get_string('individual_feedback_auto_release_desc', 'coursework');
- $options = array( 0 => get_string('no'), 1 => get_string('yes'));
+ $options = [ 0 => get_string('no'), 1 => get_string('yes')];
$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));
@@ -115,7 +115,7 @@
// Feedback release email
$feedbackreleaseemail_name = get_string('feedbackreleaseemail', 'coursework');
$feedbackreleaseemail_description = get_string('feedbackreleaseemail_help', 'coursework');
- $options = array( 0 => get_string('no'), 1 => get_string('yes'));
+ $options = [ 0 => get_string('no'), 1 => get_string('yes')];
$settings->add(new admin_setting_configselect('coursework_feedbackreleaseemail', $feedbackreleaseemail_name, $feedbackreleaseemail_description, 1, $options));
$day_reminder = [];
@@ -139,7 +139,7 @@
$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'));
+ $options = [ 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));
@@ -155,7 +155,7 @@
// Enable coursework individual extensions
$individual_extension_name = get_string('individual_extension', 'coursework');
$individual_extension_description = get_string('individual_extension_desc', 'coursework');
- $options = array( 0 => get_string('no'), 1 => get_string('yes'));
+ $options = [ 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
@@ -171,7 +171,7 @@
// Default per page
- $options = array('3' => '3', '10' => '10', '20' => '20', '30' => '30', '40' => '40', '50' => '50', '100' => '100');
+ $options = ['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);
@@ -182,7 +182,7 @@
// Automatic agreement delay
- $options = array('0' => get_string('disabled', 'mod_coursework'));
+ $options = ['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');
@@ -202,7 +202,7 @@
$settings->add($deadline_defaults_header);
// Marking deadline
- $options = array('0' => get_string('disabled', 'mod_coursework'));
+ $options = ['0' => get_string('disabled', 'mod_coursework')];
$options['7'] = get_string('oneweekoption', 'mod_coursework');
$options['14'] = get_string('twoweeksoption', 'mod_coursework');
$options['21'] = get_string('threeweeksoption', 'mod_coursework');
@@ -214,7 +214,7 @@
$settings->add(new admin_setting_configselect('coursework_marking_deadline', $marking_deadline_name, $marking_deadline_description, '0', $options));
// Marking deadline
- $options = array('0' => get_string('disabled', 'mod_coursework'));
+ $options = ['0' => get_string('disabled', 'mod_coursework')];
$options['7'] = get_string('oneweekoption', 'mod_coursework');
$options['14'] = get_string('twoweeksoption', 'mod_coursework');
$options['21'] = get_string('threeweeksoption', 'mod_coursework');
@@ -227,7 +227,7 @@
$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 = ['0' => get_string('disabled', 'mod_coursework')];
$options['1'] = get_string('today', 'mod_coursework');
$start_date_name = get_string('startdate', 'coursework');
@@ -235,7 +235,7 @@
$settings->add(new admin_setting_configselect('coursework_start_date', $start_date_name, $start_date_description, '0', $options));
// Submission deadline
- $options = array('0' => get_string('disabled', 'mod_coursework'));
+ $options = ['0' => get_string('disabled', 'mod_coursework')];
$options['1'] = get_string('today', 'mod_coursework');
$options['7'] = get_string('sevendays', 'mod_coursework');
$options['14'] = get_string('fourteendays', 'mod_coursework');
@@ -249,7 +249,7 @@
$assessor_allocations_header = new admin_setting_heading('assessor_allocations_header_header', get_string('assessorallocations', 'mod_coursework'), '');
$settings->add($assessor_allocations_header);
- $options = array( 'username' => get_string('username'), 'email' => get_string('email'));
+ $options = [ 'username' => get_string('username'), 'email' => get_string('email')];
$settings->add(new admin_setting_configselect('coursework_allocation_identifier', get_string('allocationidentifier', 'coursework'), get_string('allocationidentifier_desc', 'coursework'), 'username', $options));
}
diff --git a/tests/generator/lib.php b/tests/generator/lib.php
index fe449eae..12a56be1 100644
--- a/tests/generator/lib.php
+++ b/tests/generator/lib.php
@@ -240,7 +240,7 @@ public function create_submission($submission, $coursework) {
$fs = get_file_storage();
// Prepare file record object
- $fileinfo = array(
+ $fileinfo = [
'contextid' => $coursework->get_context_id(),
// ID of context
'component' => 'mod_coursework',
@@ -251,7 +251,7 @@ public function create_submission($submission, $coursework) {
// usually = ID of row in table
'filepath' => '/',
// any path beginning and ending in /
- 'filename' => 'myfile.txt'); // any filename
+ 'filename' => 'myfile.txt']; // any filename
// Create file containing text 'hello world'
$fs->create_file_from_string($fileinfo, 'hello world');
diff --git a/view.php b/view.php
index af5a7c82..c20919aa 100644
--- a/view.php
+++ b/view.php
@@ -42,13 +42,13 @@
require_once($CFG->dirroot . '/mod/coursework/classes/export/csv.php');
// TODO move all js to renderer.
-$jsmodule = array(
+$jsmodule = [
'name' => 'mod_coursework',
'fullpath' => '/mod/coursework/module.js',
- 'requires' => array('base',
- 'node-base'),
+ 'requires' => ['base',
+ 'node-base'],
'strings' => [],
-);
+];
$PAGE->requires->yui_module('moodle-core-notification', 'notification_init');
@@ -226,19 +226,19 @@
0,
false,
MUST_EXIST);
- $course = $DB->get_record('course', array('id' => $course_module->course), '*', MUST_EXIST);
+ $course = $DB->get_record('course', ['id' => $course_module->course], '*', MUST_EXIST);
$coursework_record = $DB->get_record('coursework',
- array('id' => $course_module->instance),
+ ['id' => $course_module->instance],
'*',
MUST_EXIST);
} else {
if ($coursework_id) {
$coursework_record = $DB->get_record('coursework',
- array('id' => $coursework_id),
+ ['id' => $coursework_id],
'*',
MUST_EXIST);
$course = $DB->get_record('course',
- array('id' => $coursework_record->course),
+ ['id' => $coursework_record->course],
'*',
MUST_EXIST);
$course_module = get_coursemodule_from_instance('coursework',
@@ -302,7 +302,7 @@
if ($export_grades) {
// Headers and data for csv
- $csv_cells = array('name', 'username', 'idnumber', 'email');
+ $csv_cells = ['name', 'username', 'idnumber', 'email'];
if ($coursework->personal_deadlines_enabled()) {
$csv_cells[] = 'personaldeadline';
@@ -352,7 +352,7 @@
$can_view_students = false;
// TODO this is awful.
-$capabilities = array('addinstance',
+$capabilities = ['addinstance',
'submitonbehalfof',
'addinitialgrade',
'editinitialgrade',
@@ -367,7 +367,7 @@
'grantextensions',
'canexportfinalgrades',
'viewextensions',
- 'grade');
+ 'grade'];
foreach ($capabilities as $capability) {
@@ -378,10 +378,10 @@
}
if ((float)substr($CFG->release, 0, 5) > 2.6) { // 2.8 > 2.6
- $event = \mod_coursework\event\course_module_viewed::create(array(
+ $event = \mod_coursework\event\course_module_viewed::create([
'objectid' => $coursework->id,
'context' => $coursework->get_context(),
- ));
+ ]);
$event->trigger();
} else {
add_to_log($course->id,
@@ -400,11 +400,11 @@
$viewallstudents_sortby = optional_param('viewallstudents_sortby', 'groupname', PARAM_ALPHA);
}
-$params = array('id' => $course_module->id,
+$params = ['id' => $course_module->id,
'sortby' => $sortby,
'sorthow' => $sorthow,
'per_page' => $perpage,
- 'group' => $group);
+ 'group' => $group];
if (!empty($SESSION->displayallstudents[$course_module_id])) {
$params['viewallstudents_sorthow'] = $viewallstudents_sorthow;
@@ -465,10 +465,10 @@
*/
$submission = submission::find($submissionid);
- $params = array(
+ $params = [
'cm' => $course_module->id,
'userid' => $submission->get_author_id(),
- );
+ ];
// Get the hash so we can retrieve the file and update timemodified.
$filehash = $DB->get_field('plagiarism_turnitin_files', 'identifier', $params);
@@ -480,9 +480,9 @@
// to be now and rely on the submission timemodified date to tell us when the student finalised their
// work.
if ($filehash) {
- $params = array(
+ $params = [
'pathnamehash' => $filehash,
- );
+ ];
$file = $DB->get_record('files', $params);
$file->timemodified = time();
$DB->update_record('files', $file);
@@ -505,8 +505,8 @@
// Already confirmed. Publish and redirect.
$coursework->publish_grades();
$url = clone($PAGE->url);
- $url->remove_params(array('confirm',
- 'publishbutton'));
+ $url->remove_params(['confirm',
+ 'publishbutton']);
redirect($url, get_string('gradespublished', 'mod_coursework'));
}
} else {
From 16f5fa2c6eb16341deacc5cd02a97c7ff0307a68 Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Tue, 3 Sep 2024 10:32:12 +0100
Subject: [PATCH 15/25] CTP-3690 var underscores
---
actions/ajax/datatable/grading.php | 24 +-
actions/ajax/deadline_extension/edit.php | 16 +-
actions/ajax/deadline_extension/new.php | 16 +-
actions/ajax/deadline_extension/submit.php | 16 +-
actions/allocate.php | 28 +-
actions/feedbacks/create.php | 4 +-
actions/feedbacks/new.php | 4 +-
actions/finalgrade.php | 20 +-
actions/moderations/create.php | 4 +-
actions/moderations/new.php | 4 +-
actions/personal_deadline.php | 14 +-
actions/revert.php | 6 +-
actions/set_personal_deadlines.php | 8 +-
actions/submitonbehalfofstudent.php | 6 +-
actions/upload_allocations.php | 12 +-
actions/upload_feedback.php | 12 +-
actions/upload_grading_sheet.php | 18 +-
backup/moodle2/backup_coursework_stepslib.php | 78 +-
classes/ability.php | 238 +++---
classes/ability/rule.php | 10 +-
classes/allocation/allocatable.php | 2 +-
classes/allocation/auto_allocator.php | 8 +-
classes/allocation/manager.php | 58 +-
classes/allocation/strategy/base.php | 12 +-
classes/allocation/strategy/percentages.php | 4 +-
classes/allocation/table/cell/builder.php | 94 +--
classes/allocation/table/cell/processor.php | 16 +-
classes/allocation/table/processor.php | 40 +-
classes/allocation/table/row/builder.php | 4 +-
classes/allocation/upload.php | 58 +-
classes/assessor_feedback_table.php | 4 +-
classes/auto_grader/average_grade.php | 20 +-
classes/auto_grader/percentage_distance.php | 26 +-
classes/controllers/controller_base.php | 44 +-
.../deadline_extensions_controller.php | 134 ++--
classes/controllers/grading_controller.php | 18 +-
.../controllers/moderations_controller.php | 40 +-
.../personal_deadlines_controller.php | 10 +-
.../plagiarism_flagging_controller.php | 34 +-
.../controllers/submissions_controller.php | 106 +--
classes/cron.php | 88 +--
classes/export/csv.php | 54 +-
.../export/csv/cells/agreedfeedback_cell.php | 20 +-
classes/export/csv/cells/agreedgrade_cell.php | 32 +-
classes/export/csv/cells/assessor_cell.php | 4 +-
.../csv/cells/assessorfeedback_cell.php | 28 +-
.../export/csv/cells/assessorgrade_cell.php | 44 +-
classes/export/csv/cells/cell_base.php | 12 +-
classes/export/csv/cells/cell_interface.php | 4 +-
classes/export/csv/cells/email_cell.php | 2 +-
.../csv/cells/extensiondeadline_cell.php | 2 +-
.../csv/cells/extensionextrainfo_cell.php | 8 +-
.../export/csv/cells/extensionreason_cell.php | 2 +-
classes/export/csv/cells/finalgrade_cell.php | 2 +-
classes/export/csv/cells/group_cell.php | 2 +-
classes/export/csv/cells/idnumber_cell.php | 2 +-
.../csv/cells/moderationagreement_cell.php | 16 +-
classes/export/csv/cells/name_cell.php | 2 +-
.../export/csv/cells/otherassessors_cell.php | 12 +-
.../csv/cells/personaldeadline_cell.php | 6 +-
.../csv/cells/plagiarismflagcomment_cell.php | 2 +-
.../csv/cells/plagiarismflagstatus_cell.php | 2 +-
classes/export/csv/cells/singlegrade_cell.php | 40 +-
classes/export/csv/cells/stages_cell.php | 8 +-
.../export/csv/cells/submissiondate_cell.php | 2 +-
.../csv/cells/submissionfileid_cell.php | 4 +-
.../export/csv/cells/submissionid_cell.php | 4 +-
.../export/csv/cells/submissiontime_cell.php | 2 +-
classes/export/csv/cells/username_cell.php | 2 +-
classes/export/grading_sheet.php | 68 +-
classes/export/import.php | 142 ++--
classes/forms/advance_plugins_form.php | 4 +-
classes/forms/assessor_feedback_mform.php | 22 +-
classes/forms/deadline_extension_form.php | 22 +-
classes/forms/moderator_agreement_mform.php | 2 +-
classes/forms/plagiarism_flagging_mform.php | 6 +-
classes/forms/publish_form.php | 8 +-
classes/forms/student_submission_form.php | 80 +-
classes/framework/ability.php | 4 +-
classes/framework/decorator.php | 6 +-
classes/framework/test/classes/user_table.php | 2 +-
classes/grading_report.php | 48 +-
classes/grading_table_row_base.php | 10 +-
classes/mailer.php | 104 +--
classes/models/course_module.php | 2 +-
classes/models/moderation.php | 4 +-
classes/models/moderation_set_rule.php | 4 +-
classes/models/null_user.php | 2 +-
classes/models/outstanding_marking.php | 22 +-
classes/models/personal_deadline.php | 20 +-
classes/models/reminder.php | 2 +-
classes/models/sample_set_rule.php | 6 +-
.../minimum_range_grade_percent.php | 8 +-
.../minimum_range_grade_raw.php | 8 +-
.../range_grade_percent.php | 8 +-
.../moderation_set_rule/range_grade_raw.php | 8 +-
.../range_total_percent.php | 16 +-
classes/personal_deadline/allocatable.php | 2 +-
classes/personal_deadline/table/builder.php | 6 +-
.../personal_deadline/table/row/builder.php | 18 +-
classes/privacy/provider.php | 124 +--
.../grading_report/cells/_user_cell.php | 14 +-
.../grading_report/cells/cell_base.php | 10 +-
.../cells/grade_for_gradebook_cell.php | 8 +-
.../grading_report/cells/group_cell.php | 16 +-
.../grading_report/cells/idnumber_cell.php | 6 +-
.../cells/moderation_agreement_cell.php | 30 +-
.../grading_report/cells/moderation_cell.php | 52 +-
.../cells/multiple_agreed_grade_cell.php | 32 +-
.../cells/personal_deadline_cell.php | 28 +-
.../grading_report/cells/plagiarism_cell.php | 6 +-
.../cells/plagiarism_flag_cell.php | 42 +-
.../cells/single_assessor_feedback_cell.php | 26 +-
.../grading_report/cells/submission_cell.php | 12 +-
.../cells/time_submitted_cell.php | 52 +-
.../grading_report/cells/user_cell.php | 28 +-
.../grading_report/sub_rows/no_sub_rows.php | 2 +-
.../sub_rows/sub_rows_interface.php | 2 +-
classes/router.php | 32 +-
classes/sample_set_rule/range_sample_type.php | 130 ++--
classes/sample_set_rule/sample_base.php | 12 +-
classes/sample_set_rule/total_sample_type.php | 96 +--
classes/stages/base.php | 204 ++---
classes/traits/allocatable_functions.php | 12 +-
classes/warnings.php | 60 +-
db/upgrade.php | 12 +-
index.php | 8 +-
lib.php | 116 +--
mod_form.php | 534 ++++++-------
renderers/grading_report_renderer.php | 156 ++--
renderers/object_renderer.php | 718 +++++++++---------
settings.php | 156 ++--
tests/behat/pages/coursework_page.php | 28 +-
tests/classes/rule_test.php | 32 +-
view.php | 302 ++++----
135 files changed, 2720 insertions(+), 2720 deletions(-)
diff --git a/actions/ajax/datatable/grading.php b/actions/ajax/datatable/grading.php
index f2b25973..2d874bd2 100644
--- a/actions/ajax/datatable/grading.php
+++ b/actions/ajax/datatable/grading.php
@@ -35,26 +35,26 @@
$unallocated = optional_param('unallocated', false, PARAM_BOOL);
// Grading report display options.
-$report_options = [];
+$reportoptions = [];
if ($unallocated) {
- $report_options['unallocated'] = true;
+ $reportoptions['unallocated'] = true;
}
-$report_options['group'] = $group;
-$report_options['perpage'] = $perpage;
-$report_options['sortby'] = $sortby;
-$report_options['sorthow'] = $sorthow;
-$report_options['showsubmissiongrade'] = false;
-$report_options['showgradinggrade'] = false;
-$report_options['courseworkid'] = $courseworkid;
-$report_options['mode'] = \mod_coursework\grading_report::$MODE_GET_REMAIN_RECORDS;
+$reportoptions['group'] = $group;
+$reportoptions['perpage'] = $perpage;
+$reportoptions['sortby'] = $sortby;
+$reportoptions['sorthow'] = $sorthow;
+$reportoptions['showsubmissiongrade'] = false;
+$reportoptions['showgradinggrade'] = false;
+$reportoptions['courseworkid'] = $courseworkid;
+$reportoptions['mode'] = \mod_coursework\grading_report::$modegetremainrecords;
//$controller = new mod_coursework\controllers\grading_controller(['courseworkid' => $report_options, 'allocatableid' => $USER->id, 'allocatabletype' => $USER->id]);
$controller = new mod_coursework\controllers\grading_controller([]);
sleep(10);
-$table_html = $controller->get_remain_rows_grading_table($report_options);
+$tablehtml = $controller->get_remain_rows_grading_table($reportoptions);
if (ob_get_contents()) {
ob_end_clean();
}
-echo $table_html;
+echo $tablehtml;
diff --git a/actions/ajax/deadline_extension/edit.php b/actions/ajax/deadline_extension/edit.php
index 69baed75..8d652ce6 100644
--- a/actions/ajax/deadline_extension/edit.php
+++ b/actions/ajax/deadline_extension/edit.php
@@ -28,10 +28,10 @@
$allocatabletype = optional_param('allocatabletype', $USER->id, PARAM_ALPHANUMEXT);
$requesttype = optional_param('requesttype', 'new', PARAM_ALPHANUMEXT);
$id = optional_param('id', 0, PARAM_INT);
-$extra_information_text = optional_param('text', '', PARAM_RAW);
-$extra_information_format = optional_param('format', 1, PARAM_ALPHANUMEXT);
-$extended_deadline = optional_param('extended_deadline', 0, PARAM_ALPHANUMEXT);
-$pre_defined_reason = optional_param('pre_defined_reason', null, PARAM_ALPHANUMEXT);
+$extrainformationtext = optional_param('text', '', PARAM_RAW);
+$extrainformationformat = optional_param('format', 1, PARAM_ALPHANUMEXT);
+$extendeddeadline = optional_param('extended_deadline', 0, PARAM_ALPHANUMEXT);
+$predefinedreason = optional_param('pre_defined_reason', null, PARAM_ALPHANUMEXT);
$submissionid = optional_param('submissionid', 0, PARAM_INT);
$name = optional_param('name', 0, PARAM_ALPHANUMEXT);
$params = [
@@ -42,10 +42,10 @@
$controller = new mod_coursework\controllers\deadline_extensions_controller($params);
$params['id'] = $id;
-$params['extra_information_text'] = $extra_information_text;
-$params['extra_information_format'] = $extra_information_format;
-$params['extended_deadline'] = strtotime($extended_deadline);
-$params['pre_defined_reason'] = $pre_defined_reason;
+$params['extra_information_text'] = $extrainformationtext;
+$params['extra_information_format'] = $extrainformationformat;
+$params['extended_deadline'] = strtotime($extendeddeadline);
+$params['pre_defined_reason'] = $predefinedreason;
$params['submissionid'] = $submissionid;
$params['name'] = $name;
diff --git a/actions/ajax/deadline_extension/new.php b/actions/ajax/deadline_extension/new.php
index db3b9439..5b8add38 100644
--- a/actions/ajax/deadline_extension/new.php
+++ b/actions/ajax/deadline_extension/new.php
@@ -28,10 +28,10 @@
$allocatabletype = optional_param('allocatabletype', $USER->id, PARAM_ALPHANUMEXT);
$requesttype = optional_param('requesttype', 'new', PARAM_ALPHANUMEXT);
$id = optional_param('id', 0, PARAM_INT);
-$extra_information_text = optional_param('text', '', PARAM_RAW);
-$extra_information_format = optional_param('format', 1, PARAM_ALPHANUMEXT);
-$extended_deadline = optional_param('extended_deadline', 0, PARAM_ALPHANUMEXT);
-$pre_defined_reason = optional_param('pre_defined_reason', null, PARAM_ALPHANUMEXT);
+$extrainformationtext = optional_param('text', '', PARAM_RAW);
+$extrainformationformat = optional_param('format', 1, PARAM_ALPHANUMEXT);
+$extendeddeadline = optional_param('extended_deadline', 0, PARAM_ALPHANUMEXT);
+$predefinedreason = optional_param('pre_defined_reason', null, PARAM_ALPHANUMEXT);
$submissionid = optional_param('submissionid', 0, PARAM_INT);
$name = optional_param('name', 0, PARAM_ALPHANUMEXT);
$params = [
@@ -42,10 +42,10 @@
$controller = new mod_coursework\controllers\deadline_extensions_controller($params);
$params['id'] = $id;
-$params['extra_information_text'] = $extra_information_text;
-$params['extra_information_format'] = $extra_information_format;
-$params['extended_deadline'] = strtotime($extended_deadline);
-$params['pre_defined_reason'] = $pre_defined_reason;
+$params['extra_information_text'] = $extrainformationtext;
+$params['extra_information_format'] = $extrainformationformat;
+$params['extended_deadline'] = strtotime($extendeddeadline);
+$params['pre_defined_reason'] = $predefinedreason;
$params['submissionid'] = $submissionid;
$params['name'] = $name;
diff --git a/actions/ajax/deadline_extension/submit.php b/actions/ajax/deadline_extension/submit.php
index e8635744..579901a4 100644
--- a/actions/ajax/deadline_extension/submit.php
+++ b/actions/ajax/deadline_extension/submit.php
@@ -28,10 +28,10 @@
$allocatabletype = optional_param('allocatabletype', $USER->id, PARAM_ALPHANUMEXT);
$requesttype = optional_param('requesttype', 'new', PARAM_ALPHANUMEXT);
$id = optional_param('id', 0, PARAM_INT);
-$extra_information_text = optional_param('text', '', PARAM_RAW);
-$extra_information_format = optional_param('format', 1, PARAM_ALPHANUMEXT);
-$extended_deadline = optional_param('extended_deadline', 0, PARAM_ALPHANUMEXT);
-$pre_defined_reason = optional_param('pre_defined_reason', null, PARAM_ALPHANUMEXT);
+$extrainformationtext = optional_param('text', '', PARAM_RAW);
+$extrainformationformat = optional_param('format', 1, PARAM_ALPHANUMEXT);
+$extendeddeadline = optional_param('extended_deadline', 0, PARAM_ALPHANUMEXT);
+$predefinedreason = optional_param('pre_defined_reason', null, PARAM_ALPHANUMEXT);
$submissionid = optional_param('submissionid', 0, PARAM_INT);
$name = optional_param('name', 0, PARAM_ALPHANUMEXT);
$params = [
@@ -42,10 +42,10 @@
$controller = new mod_coursework\controllers\deadline_extensions_controller($params);
$params['id'] = $id;
-$params['extra_information_text'] = $extra_information_text;
-$params['extra_information_format'] = $extra_information_format;
-$params['extended_deadline'] = strtotime($extended_deadline);
-$params['pre_defined_reason'] = $pre_defined_reason;
+$params['extra_information_text'] = $extrainformationtext;
+$params['extra_information_format'] = $extrainformationformat;
+$params['extended_deadline'] = strtotime($extendeddeadline);
+$params['pre_defined_reason'] = $predefinedreason;
$params['submissionid'] = $submissionid;
$params['name'] = $name;
diff --git a/actions/allocate.php b/actions/allocate.php
index 921739cd..1f9180aa 100644
--- a/actions/allocate.php
+++ b/actions/allocate.php
@@ -162,35 +162,35 @@
/**
* @var mod_coursework_object_renderer $object_renderer
*/
-$object_renderer = $PAGE->get_renderer('mod_coursework', 'object');
+$objectrenderer = $PAGE->get_renderer('mod_coursework', 'object');
/**
* @var mod_coursework_page_renderer $page_renderer
*/
-$page_renderer = $PAGE->get_renderer('mod_coursework', 'page');
+$pagerenderer = $PAGE->get_renderer('mod_coursework', 'page');
$warnings = new \mod_coursework\warnings($coursework);
-$percentage_allocation_not_complete = $warnings->percentage_allocations_not_complete();
-$manual_allocation_not_complete = '';
-$students_in_multiple_groups = '';
+$percentageallocationnotcomplete = $warnings->percentage_allocations_not_complete();
+$manualallocationnotcomplete = '';
+$studentsinmultiplegroups = '';
if ($coursework->allocation_enabled()) {
- $manual_allocation_not_complete = $warnings->manual_allocation_not_completed();
+ $manualallocationnotcomplete = $warnings->manual_allocation_not_completed();
if ($coursework->use_groups == 1 || $coursework->assessorallocationstrategy == 'group_assessor') {
- $students_in_multiple_groups = $warnings->students_in_mutiple_grouos();
+ $studentsinmultiplegroups = $warnings->students_in_mutiple_grouos();
}
}
-if ($formsavebutton && $percentage_allocation_not_complete == '' && $manual_allocation_not_complete == '') {
+if ($formsavebutton && $percentageallocationnotcomplete == '' && $manualallocationnotcomplete == '') {
redirect($CFG->wwwroot.'/mod/coursework/view.php?id='.$coursemoduleid, get_string('changessaved', 'mod_coursework'));
} else if ($formsavebutton) {
redirect($PAGE->url);
}
echo $OUTPUT->header();
-echo $percentage_allocation_not_complete;
+echo $percentageallocationnotcomplete;
if ($coursework->allocation_enabled()) {
- echo $manual_allocation_not_complete;
- echo $students_in_multiple_groups;
+ echo $manualallocationnotcomplete;
+ echo $studentsinmultiplegroups;
}
// Add coursework id etc.
@@ -200,7 +200,7 @@
echo \html_writer::start_tag('form', ['id' => 'sampling_form',
'method' => 'post']);
$samplesetwidget = $allocationsmanager->get_sampling_set_widget();
- echo $object_renderer->render($samplesetwidget);
+ echo $objectrenderer->render($samplesetwidget);
echo html_writer::end_tag('form');
}
@@ -210,7 +210,7 @@
'method' => 'post']);
if ($coursework->allocation_enabled()) {
- echo $object_renderer->render($allocationwidget);
+ echo $objectrenderer->render($allocationwidget);
}
// Spacer so that we can float the headers next to each other.
@@ -232,7 +232,7 @@
echo html_writer::empty_tag('input', $attributes);
echo $OUTPUT->help_icon('savemanualallocations', 'mod_coursework');
*/
-echo $object_renderer->render($allocationtable);
+echo $objectrenderer->render($allocationtable);
echo html_writer::end_tag('form');
diff --git a/actions/feedbacks/create.php b/actions/feedbacks/create.php
index 4fca2246..b6f91502 100644
--- a/actions/feedbacks/create.php
+++ b/actions/feedbacks/create.php
@@ -31,7 +31,7 @@
$submissionid = required_param('submissionid', PARAM_INT);
$isfinalgrade = optional_param('isfinalgrade', 0, PARAM_INT);
$assessorid = optional_param('assessorid', $USER->id, PARAM_INT);
-$stage_identifier = optional_param('stage_identifier', '', PARAM_ALPHANUMEXT);
+$stageidentifier = optional_param('stage_identifier', '', PARAM_ALPHANUMEXT);
$finalised = !!optional_param('submitbutton', 0, PARAM_TEXT);
$ajax = optional_param('ajax', 0, PARAM_INT);
@@ -39,7 +39,7 @@
'submissionid' => $submissionid,
'isfinalgrade' => $isfinalgrade,
'assessorid' => $assessorid,
- 'stage_identifier' => $stage_identifier,
+ 'stage_identifier' => $stageidentifier,
'finalised' => $finalised,
'ajax' => $ajax,
];
diff --git a/actions/feedbacks/new.php b/actions/feedbacks/new.php
index 4082a496..529a3114 100644
--- a/actions/feedbacks/new.php
+++ b/actions/feedbacks/new.php
@@ -28,7 +28,7 @@
$cmid = optional_param('cmid', 0, PARAM_INT);
$feedbackid = optional_param('feedbackid', 0, PARAM_INT);
$assessorid = optional_param('assessorid', $USER->id, PARAM_INT);
-$stage_identifier = optional_param('stage_identifier', 'uh-oh', PARAM_RAW);
+$stageidentifier = optional_param('stage_identifier', 'uh-oh', PARAM_RAW);
$ajax = optional_param('ajax', 0, PARAM_INT);
$params = [
@@ -36,7 +36,7 @@
'cmid' => $cmid,
'feedbackid' => $feedbackid,
'assessorid' => $assessorid,
- 'stage_identifier' => $stage_identifier,
+ 'stage_identifier' => $stageidentifier,
'ajax' => $ajax,
];
$controller = new mod_coursework\controllers\feedback_controller($params);
diff --git a/actions/finalgrade.php b/actions/finalgrade.php
index 9160da49..7440d862 100644
--- a/actions/finalgrade.php
+++ b/actions/finalgrade.php
@@ -33,7 +33,7 @@
require_once($CFG->dirroot.'/lib/formslib.php');
require_once($CFG->dirroot.'/mod/coursework/renderer.php');
-$submission_id = optional_param('submissionid', 0, PARAM_INT);
+$submissionid = optional_param('submissionid', 0, PARAM_INT);
$assessorid = optional_param('assessorid', $USER->id, PARAM_INT);
$feedbackid = optional_param('feedbackid', 0, PARAM_INT);
$cmid = optional_param('cmid', 0, PARAM_INT);
@@ -47,7 +47,7 @@
require_login($course, false, $coursemodule);
$coursework = mod_coursework\models\coursework::find($coursemodule->instance);
-$submission = submission::find($submission_id);
+$submission = submission::find($submissionid);
$teacherfeedback = $DB->get_record('coursework_feedbacks', ['id' => $feedbackid]);
// This is where stuff used to construct the dynamic form is fed in.
@@ -56,7 +56,7 @@
$canfinalgrade = has_capability('mod/coursework:addagreedgrade', $PAGE->context);
// TODO shift into custom data and set via somewhere else.
-$coursework->submissionid = $submission_id;
+$coursework->submissionid = $submissionid;
$coursework->cmid = $cmid;
$gradeform = new assessor_feedback_mform();
@@ -90,7 +90,7 @@
}
}
-$params = ['submissionid' => $submission_id,
+$params = ['submissionid' => $submissionid,
'assessorid' => $assessorid,
'isfinalgrade' => $isfinalgrade];
$oldfinalgrade = $DB->get_record('coursework_feedbacks', $params);
@@ -99,7 +99,7 @@
// a final grade.
if (empty($oldfinalgrade) && $canfinalgrade) {
- $params = ['submissionid' => $submission_id,
+ $params = ['submissionid' => $submissionid,
'isfinalgrade' => $isfinalgrade];
$oldfinalgrade = $DB->get_record('coursework_feedbacks', $params);
if ($oldfinalgrade) {
@@ -138,7 +138,7 @@
// In case we have an editor come along, we want to show that this has happened.
if (!empty($teacherfeedback)) { // May not have been marked yet.
- if ($submission_id && !empty($teacherfeedback->lasteditedbyuser)) {
+ if ($submissionid && !empty($teacherfeedback->lasteditedbyuser)) {
$editor = $DB->get_record('user', ['id' => $teacherfeedback->lasteditedbyuser]);
} else {
$editor = $assessor;
@@ -150,18 +150,18 @@
}
$files = $submission->get_submission_files();
-$files_string = $files->has_multiple_files() ? 'submissionfiles' : 'submissionfile';
+$filesstring = $files->has_multiple_files() ? 'submissionfiles' : 'submissionfile';
echo html_writer::start_tag('h1');
-echo get_string($files_string, 'coursework');
+echo get_string($filesstring, 'coursework');
echo html_writer::end_tag('h1');
/**
* @var mod_coursework_object_renderer $object_renderer
*/
-$object_renderer = $PAGE->get_renderer('mod_coursework', 'object');
+$objectrenderer = $PAGE->get_renderer('mod_coursework', 'object');
-echo $object_renderer->render_submission_files_with_plagiarism_links(new mod_coursework_submission_files($files));
+echo $objectrenderer->render_submission_files_with_plagiarism_links(new mod_coursework_submission_files($files));
$gradeform->display();
diff --git a/actions/moderations/create.php b/actions/moderations/create.php
index 2227a523..8245f251 100644
--- a/actions/moderations/create.php
+++ b/actions/moderations/create.php
@@ -31,13 +31,13 @@
$submissionid = required_param('submissionid', PARAM_INT);
$feedbackid = required_param('feedbackid', PARAM_INT);
$moderatorid = optional_param('moderatorid', $USER->id, PARAM_INT);
-$stage_identifier = optional_param('stage_identifier', '', PARAM_ALPHANUMEXT);
+$stageidentifier = optional_param('stage_identifier', '', PARAM_ALPHANUMEXT);
$params = [
'submissionid' => $submissionid,
'feedbackid' => $feedbackid,
'moderatorid' => $moderatorid,
- 'stage_identifier' => $stage_identifier,
+ 'stage_identifier' => $stageidentifier,
];
$controller = new mod_coursework\controllers\moderations_controller($params);
$controller->create_moderation();
diff --git a/actions/moderations/new.php b/actions/moderations/new.php
index 7a8cf85f..67da180e 100644
--- a/actions/moderations/new.php
+++ b/actions/moderations/new.php
@@ -28,14 +28,14 @@
$cmid = optional_param('cmid', 0, PARAM_INT);
$feedbackid = required_param('feedbackid', PARAM_INT);
$moderatorid = optional_param('moderatorid', $USER->id, PARAM_INT);
-$stage_identifier = optional_param('stage_identifier', 'uh-oh', PARAM_RAW);
+$stageidentifier = optional_param('stage_identifier', 'uh-oh', PARAM_RAW);
$params = [
'submissionid' => $submissionid,
'cmid' => $cmid,
'feedbackid' => $feedbackid,
'moderatorid' => $moderatorid,
- 'stage_identifier' => $stage_identifier,
+ 'stage_identifier' => $stageidentifier,
];
$controller = new mod_coursework\controllers\moderations_controller($params);
$controller->new_moderation();
diff --git a/actions/personal_deadline.php b/actions/personal_deadline.php
index a6bbb06a..11240661 100644
--- a/actions/personal_deadline.php
+++ b/actions/personal_deadline.php
@@ -25,19 +25,19 @@
global $CFG, $USER, $PAGE, $DB;
$courseworkid = required_param('courseworkid', PARAM_INT);
-$allocatableid_arr = optional_param_array('allocatableid_arr', false, PARAM_RAW);
+$allocatableidarr = optional_param_array('allocatableid_arr', false, PARAM_RAW);
$allocatableid = optional_param('allocatableid', $USER->id, PARAM_RAW);
$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);
-$personal_deadline_time = optional_param('personal_deadline_time', null, PARAM_RAW);
+$personaldeadlinetime = optional_param('personal_deadline_time', null, PARAM_RAW);
-$allocatableid = (!empty($allocatableid_arr)) ? $allocatableid_arr : $allocatableid;
+$allocatableid = (!empty($allocatableidarr)) ? $allocatableidarr : $allocatableid;
-$coursework_db = $DB->get_record('coursework', ['id' => $courseworkid]);
+$courseworkdb = $DB->get_record('coursework', ['id' => $courseworkid]);
-$coursework = \mod_coursework\models\coursework::find($coursework_db);
+$coursework = \mod_coursework\models\coursework::find($courseworkdb);
require_login($coursework->get_course(), false, $coursework->get_course_module());
@@ -52,8 +52,8 @@
if ($selectedtype != 'unfinalise') {
$controller = new mod_coursework\controllers\personal_deadlines_controller($params);
- if (!empty($personal_deadline_time)) {
- $result = $controller->insert_update($personal_deadline_time);
+ if (!empty($personaldeadlinetime)) {
+ $result = $controller->insert_update($personaldeadlinetime);
echo json_encode($result);
} else {
$controller->new_personal_deadline();
diff --git a/actions/revert.php b/actions/revert.php
index 38d26e97..ea71ff12 100644
--- a/actions/revert.php
+++ b/actions/revert.php
@@ -31,13 +31,13 @@
global $DB, $PAGE, $CFG;
$cmid = required_param('cmid', PARAM_INT);
-$submission_id = required_param('submissionid', PARAM_INT);
+$submissionid = required_param('submissionid', PARAM_INT);
$cm = $DB->get_record('course_modules', ['id' => $cmid]);
$coursework = coursework::find($cm->instance);
$course = $DB->get_record('course', ['id' => $cm->course]);
-$submission_db = $DB->get_record('coursework_submissions', ['id' => $submission_id]);
-$submission = submission::find($submission_db);
+$submissiondb = $DB->get_record('coursework_submissions', ['id' => $submissionid]);
+$submission = submission::find($submissiondb);
require_login($course, false, $cm);
$url = new moodle_url('/mod/coursework/view.php', ['id' => $cm->id]);
diff --git a/actions/set_personal_deadlines.php b/actions/set_personal_deadlines.php
index 6f712c91..20df84e1 100644
--- a/actions/set_personal_deadlines.php
+++ b/actions/set_personal_deadlines.php
@@ -69,11 +69,11 @@
/**
* @var mod_coursework_object_renderer $object_renderer
*/
-$object_renderer = $PAGE->get_renderer('mod_coursework', 'object');
-$personal_deadlines_table = new mod_coursework\personal_deadline\table\builder($coursework, $options);
-$personal_deadlines_table = new mod_coursework_personal_deadlines_table($personal_deadlines_table);
+$objectrenderer = $PAGE->get_renderer('mod_coursework', 'object');
+$personaldeadlinestable = new mod_coursework\personal_deadline\table\builder($coursework, $options);
+$personaldeadlinestable = new mod_coursework_personal_deadlines_table($personaldeadlinestable);
echo $OUTPUT->header();
-echo $object_renderer->render($personal_deadlines_table);
+echo $objectrenderer->render($personaldeadlinestable);
echo $OUTPUT->footer();
diff --git a/actions/submitonbehalfofstudent.php b/actions/submitonbehalfofstudent.php
index b9c0a794..198f8c44 100644
--- a/actions/submitonbehalfofstudent.php
+++ b/actions/submitonbehalfofstudent.php
@@ -93,10 +93,10 @@
/**
* @var mod_coursework_page_renderer $page_renderer
*/
-$page_renderer = $PAGE->get_renderer('mod_coursework', 'page');
+$pagerenderer = $PAGE->get_renderer('mod_coursework', 'page');
if (!$studentid) {
- echo $page_renderer->choose_student_to_submit_for($coursemoduleid, $chooseform);
+ echo $pagerenderer->choose_student_to_submit_for($coursemoduleid, $chooseform);
} else {
- echo $page_renderer->submit_on_behalf_of_student_interface($student, $submitform);
+ echo $pagerenderer->submit_on_behalf_of_student_interface($student, $submitform);
}
diff --git a/actions/upload_allocations.php b/actions/upload_allocations.php
index 572d87a8..96f156dc 100644
--- a/actions/upload_allocations.php
+++ b/actions/upload_allocations.php
@@ -44,10 +44,10 @@
$PAGE->set_title($title);
$PAGE->set_heading($title);
-$grading_sheet_capabilities = ['mod/coursework:allocate'];
+$gradingsheetcapabilities = ['mod/coursework:allocate'];
// Bounce anyone who shouldn't be here.
-if (!has_any_capability($grading_sheet_capabilities, $PAGE->context)) {
+if (!has_any_capability($gradingsheetcapabilities, $PAGE->context)) {
$message = 'You do not have permission to upload allocations';
redirect(new moodle_url('mod/coursework/view.php'), $message);
}
@@ -70,13 +70,13 @@
// 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);
+ $pagerenderer = $PAGE->get_renderer('mod_coursework', 'page');
+ echo $pagerenderer->process_csv_upload($procsessingresults, $content, $csvtype);
$cache = \cache::make('mod_coursework', 'courseworkdata', ['id' => $coursework->id]);
$cache->purge();
} else {
- $page_renderer = $PAGE->get_renderer('mod_coursework', 'page');
- echo $page_renderer->csv_upload($allocationsuploadform, $csvtype);
+ $pagerenderer = $PAGE->get_renderer('mod_coursework', 'page');
+ echo $pagerenderer->csv_upload($allocationsuploadform, $csvtype);
}
diff --git a/actions/upload_feedback.php b/actions/upload_feedback.php
index bb37fc39..37983df8 100644
--- a/actions/upload_feedback.php
+++ b/actions/upload_feedback.php
@@ -44,10 +44,10 @@
$PAGE->set_title($title);
$PAGE->set_heading($title);
-$grading_sheet_capabilities = ['mod/coursework:addinitialgrade', 'mod/coursework:addagreedgrade', 'mod/coursework:administergrades'];
+$gradingsheetcapabilities = ['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)) {
+if (!has_any_capability($gradingsheetcapabilities, $PAGE->context)) {
$message = 'You do not have permission to upload feedback sheets';
redirect(new moodle_url('mod/coursework/view.php'), $message);
}
@@ -80,10 +80,10 @@
$updateresults = $fileimporter->import_zip_files($coursework, $stageidentifier, $data->overwrite);
- $page_renderer = $PAGE->get_renderer('mod_coursework', 'page');
- echo $page_renderer->process_feedback_upload($updateresults);
+ $pagerenderer = $PAGE->get_renderer('mod_coursework', 'page');
+ echo $pagerenderer->process_feedback_upload($updateresults);
} else {
- $page_renderer = $PAGE->get_renderer('mod_coursework', 'page');
- echo $page_renderer->feedback_upload($feedbackform);
+ $pagerenderer = $PAGE->get_renderer('mod_coursework', 'page');
+ echo $pagerenderer->feedback_upload($feedbackform);
}
diff --git a/actions/upload_grading_sheet.php b/actions/upload_grading_sheet.php
index 08ed1318..d4a8a959 100644
--- a/actions/upload_grading_sheet.php
+++ b/actions/upload_grading_sheet.php
@@ -45,10 +45,10 @@
$PAGE->set_url(new moodle_url('/mod/coursework/actions/upload_grading_sheet.php'));
$PAGE->set_title($title);
$PAGE->set_heading($title);
-$grading_sheet_capabilities = ['mod/coursework:addinitialgrade', 'mod/coursework:addagreedgrade', 'mod/coursework:administergrades'];
+$gradingsheetcapabilities = ['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)) {
+if (!has_any_capability($gradingsheetcapabilities, $PAGE->context)) {
$message = 'You do not have permission to upload grading sheets';
redirect(new moodle_url('mod/coursework/view.php'), $message);
}
@@ -65,25 +65,25 @@
$content = $gradinguploadform->get_file_content('gradingdata');
- $csv_cells = \mod_coursework\export\grading_sheet::cells_array($coursework);
+ $csvcells = \mod_coursework\export\grading_sheet::cells_array($coursework);
$csvimport = new \mod_coursework\export\import($coursework, false, false);
// $csv_cells = $csvimport->csv_columns(); //all columns from spreadsheet
- $procsessingresults = $csvimport->validate_csv($content, $data->encoding, $data->delimiter_name, $csv_cells);
+ $procsessingresults = $csvimport->validate_csv($content, $data->encoding, $data->delimiter_name, $csvcells);
// Process
// 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);
+ $csvimport->process_csv($content, $data->encoding, $data->delimiter_name, $csvcells, $procsessingresults);
+ $pagerenderer = $PAGE->get_renderer('mod_coursework', 'page');
+ echo $pagerenderer->process_csv_upload($procsessingresults, $content, $csvtype);
//} else {
//
//}
} else {
- $page_renderer = $PAGE->get_renderer('mod_coursework', 'page');
- echo $page_renderer->csv_upload($gradinguploadform, $csvtype);
+ $pagerenderer = $PAGE->get_renderer('mod_coursework', 'page');
+ echo $pagerenderer->csv_upload($gradinguploadform, $csvtype);
}
diff --git a/backup/moodle2/backup_coursework_stepslib.php b/backup/moodle2/backup_coursework_stepslib.php
index 6eb53e1c..e2a1eb9d 100644
--- a/backup/moodle2/backup_coursework_stepslib.php
+++ b/backup/moodle2/backup_coursework_stepslib.php
@@ -108,9 +108,9 @@ protected function define_structure() {
'plagiarismflagenabled',
]);
- $sample_strategies = new backup_nested_element('coursework_sample_set_rules');
+ $samplestrategies = new backup_nested_element('coursework_sample_set_rules');
- $sample_strategy = new backup_nested_element('coursework_sample_set_rule', ['id'],
+ $samplestrategy = new backup_nested_element('coursework_sample_set_rule', ['id'],
['courseworkid',
'sample_set_plugin_id',
'ruleorder',
@@ -119,18 +119,18 @@ protected function define_structure() {
'lowerlimit',
'stage_identifier']);
- $coursework->add_child($sample_strategies);
+ $coursework->add_child($samplestrategies);
- $sample_strategies->add_child($sample_strategy);
+ $samplestrategies->add_child($samplestrategy);
- $sample_strategy->set_source_table('coursework_sample_set_rules',
+ $samplestrategy->set_source_table('coursework_sample_set_rules',
['courseworkid' => backup::VAR_PARENTID]);
if ($userinfo) {
- $plagiarism_flags = new backup_nested_element('coursework_plagiarism_flags');
+ $plagiarismflags = new backup_nested_element('coursework_plagiarism_flags');
- $plagiarism_flag = new backup_nested_element('coursework_plagiarism_flag', ['id'],
+ $plagiarismflag = new backup_nested_element('coursework_plagiarism_flag', ['id'],
[
"courseworkid",
"submissiond",
@@ -143,9 +143,9 @@ protected function define_structure() {
"timemodified",
]);
- $moderation_agreements = new backup_nested_element('coursework_mod_agreements');
+ $moderationagreements = new backup_nested_element('coursework_mod_agreements');
- $moderation_agreement = new backup_nested_element('coursework_mod_agreement', ['id'],
+ $moderationagreement = new backup_nested_element('coursework_mod_agreement', ['id'],
[
"feedbackid",
"moderatorid",
@@ -238,9 +238,9 @@ protected function define_structure() {
"minimum",
]);
- $allocation_configs = new backup_nested_element('coursework_allocation_configs');
+ $allocationconfigs = new backup_nested_element('coursework_allocation_configs');
- $allocation_config = new backup_nested_element('coursework_allocation_config', ['id'],
+ $allocationconfig = new backup_nested_element('coursework_allocation_config', ['id'],
[
"courseworkid",
"allocationstrategy",
@@ -277,9 +277,9 @@ protected function define_structure() {
"extra_information_format",
]);
- $personal_deadlines = new backup_nested_element('coursework_person_deadlines');
+ $personaldeadlines = new backup_nested_element('coursework_person_deadlines');
- $personal_deadline = new backup_nested_element('coursework_person_deadline', ['id'],
+ $personaldeadline = new backup_nested_element('coursework_person_deadline', ['id'],
[
"allocatableid",
'allocatableuser',
@@ -293,9 +293,9 @@ protected function define_structure() {
"lastmodifiedbyid",
]);
- $sample_members = new backup_nested_element('coursework_sample_set_mbrs');
+ $samplemembers = new backup_nested_element('coursework_sample_set_mbrs');
- $sample_member = new backup_nested_element('coursework_sample_set_mbr', ['id'],
+ $samplemember = new backup_nested_element('coursework_sample_set_mbr', ['id'],
[
"courseworkid",
"allocatableid",
@@ -317,13 +317,13 @@ protected function define_structure() {
// And a set of extensionsenabled
$coursework->add_child($extensions);
// And a set of personaldeadlines
- $coursework->add_child($personal_deadlines);
+ $coursework->add_child($personaldeadlines);
// And a set of moderation rule sets
$coursework->add_child($modsetmembers);
// And allocation configs
- $coursework->add_child($allocation_configs);
+ $coursework->add_child($allocationconfigs);
// And sample members
- $coursework->add_child($sample_members);
+ $coursework->add_child($samplemembers);
// And submissions are made up from individual submission instances
$submissions->add_child($submission);
@@ -333,22 +333,22 @@ protected function define_structure() {
// Feedbacks is a set of individual items
$feedbacks->add_child($feedback);
- $feedback->add_child($moderation_agreements);
- $moderation_agreements->add_child($moderation_agreement);
+ $feedback->add_child($moderationagreements);
+ $moderationagreements->add_child($moderationagreement);
- $submission->add_child($plagiarism_flags);
- $plagiarism_flags->add_child($plagiarism_flag);
+ $submission->add_child($plagiarismflags);
+ $plagiarismflags->add_child($plagiarismflag);
// as are reminders, pairs, extensions, modsets and modsetrules,
// and allocation configs
$reminders->add_child($reminder);
$pairs->add_child($pair);
$extensions->add_child($extension);
- $personal_deadlines->add_child($personal_deadline);
+ $personaldeadlines->add_child($personaldeadline);
$modsetrules->add_child($modsetrule);
$modsetmembers->add_child($modsetmember);
- $sample_members->add_child($sample_member);
- $allocation_configs->add_child($allocation_config);
+ $samplemembers->add_child($samplemember);
+ $allocationconfigs->add_child($allocationconfig);
$submission->set_source_table('coursework_submissions',
['courseworkid' => backup::VAR_PARENTID]);
@@ -356,10 +356,10 @@ protected function define_structure() {
$feedback->set_source_table('coursework_feedbacks',
['submissionid' => backup::VAR_PARENTID]);
- $plagiarism_flag->set_source_table('coursework_plagiarism_flags',
+ $plagiarismflag->set_source_table('coursework_plagiarism_flags',
['submissionid' => backup::VAR_PARENTID]);
- $moderation_agreement->set_source_table('coursework_mod_agreements',
+ $moderationagreement->set_source_table('coursework_mod_agreements',
['feedbackid' => backup::VAR_PARENTID]);
$reminder->set_source_table('coursework_reminder',
@@ -374,16 +374,16 @@ protected function define_structure() {
$extension->set_source_table('coursework_extensions',
['courseworkid' => backup::VAR_PARENTID]);
- $personal_deadline->set_source_table('coursework_person_deadlines',
+ $personaldeadline->set_source_table('coursework_person_deadlines',
['courseworkid' => backup::VAR_PARENTID]);
$modsetmember->set_source_table('coursework_mod_set_members',
['courseworkid' => backup::VAR_PARENTID]);
- $sample_member->set_source_table('coursework_sample_set_mbrs',
+ $samplemember->set_source_table('coursework_sample_set_mbrs',
['courseworkid' => backup::VAR_PARENTID]);
- $allocation_config->set_source_table('coursework_allocation_config',
+ $allocationconfig->set_source_table('coursework_allocation_config',
['courseworkid' => backup::VAR_PARENTID]);
// Mark important foreign keys
@@ -403,7 +403,7 @@ protected function define_structure() {
$pair->annotate_ids('user', 'allocatableuser');
$pair->annotate_ids('group', 'allocatablegroup');
- $allocation_config->annotate_ids('user', 'assessorid');
+ $allocationconfig->annotate_ids('user', 'assessorid');
$modsetmember->annotate_ids('user', 'allocatableuser');
$modsetmember->annotate_ids('group', 'allocatablegroup');
@@ -411,17 +411,17 @@ protected function define_structure() {
$extension->annotate_ids('user', 'allocatableuser');
$extension->annotate_ids('group', 'allocatablegroup');
- $personal_deadline->annotate_ids('user', 'allocatableuser');
- $personal_deadline->annotate_ids('group', 'allocatablegroup');
+ $personaldeadline->annotate_ids('user', 'allocatableuser');
+ $personaldeadline->annotate_ids('group', 'allocatablegroup');
- $sample_member->annotate_ids('user', 'allocatableuser');
- $sample_member->annotate_ids('group', 'allocatablegroup');
+ $samplemember->annotate_ids('user', 'allocatableuser');
+ $samplemember->annotate_ids('group', 'allocatablegroup');
- $moderation_agreement->annotate_ids('user', 'moderatorid');
- $moderation_agreement->annotate_ids('user', 'lasteditedby');
+ $moderationagreement->annotate_ids('user', 'moderatorid');
+ $moderationagreement->annotate_ids('user', 'lasteditedby');
- $plagiarism_flag->annotate_ids('user', 'createdby');
- $plagiarism_flag->annotate_ids('user', 'lastmodifiedby');
+ $plagiarismflag->annotate_ids('user', 'createdby');
+ $plagiarismflag->annotate_ids('user', 'lastmodifiedby');
$coursework->annotate_files('mod_coursework', 'feedback', null);
$coursework->annotate_files('mod_coursework', 'submission', null);
diff --git a/classes/ability.php b/classes/ability.php
index 52d7992d..a13a2aeb 100644
--- a/classes/ability.php
+++ b/classes/ability.php
@@ -309,12 +309,12 @@ protected function prevent_new_submissions_if_one_already_exists() {
$this->prevent('new',
'mod_coursework\models\submission',
function (submission $submission) {
- $exists_params = [
+ $existsparams = [
'courseworkid' => $submission->courseworkid,
'allocatableid' => $submission->allocatableid,
'allocatabletype' => $submission->allocatabletype,
];
- if (submission::exists($exists_params)) {
+ if (submission::exists($existsparams)) {
$this->set_message('Submission already exists');
return true;
}
@@ -349,8 +349,8 @@ protected function allow_new_submissions_if_there_is_an_active_extension() {
'mod_coursework\models\submission',
function (submission $submission) {
$coursework = $submission->get_coursework();
- $submitting_allocatable = $coursework->submiting_allocatable_for_student($this->get_user());
- return deadline_extension::allocatable_extension_allows_submission($submitting_allocatable,
+ $submittingallocatable = $coursework->submiting_allocatable_for_student($this->get_user());
+ return deadline_extension::allocatable_extension_allows_submission($submittingallocatable,
$coursework);
});
}
@@ -402,10 +402,10 @@ protected function allow_show_submission_if_user_has_an_allocation_for_any_stage
function (submission $submission) {
// Should be visible to those who are OK to mark it.
- $allocation_enabled = $submission->get_coursework()->allocation_enabled();
- $user_has_any_allocation = $submission->get_coursework()
+ $allocationenabled = $submission->get_coursework()->allocation_enabled();
+ $userhasanyallocation = $submission->get_coursework()
->assessor_has_any_allocation_for_student($submission->reload()->get_allocatable());
- return $allocation_enabled && $user_has_any_allocation;
+ return $allocationenabled && $userhasanyallocation;
});
}
@@ -415,12 +415,12 @@ protected function allow_show_submission_to_graders_when_allocations_are_disable
function (submission $submission) {
// Should be visible to those who are OK to mark it.
- $allocation_disabled = !$submission->get_coursework()->allocation_enabled();
- $allowed_to_grade = has_capability('mod/coursework:addinitialgrade',
+ $allocationdisabled = !$submission->get_coursework()->allocation_enabled();
+ $allowedtograde = has_capability('mod/coursework:addinitialgrade',
$submission->get_coursework()->get_context());
- $allowed_to_agree_grades = has_capability('mod/coursework:addagreedgrade',
+ $allowedtoagreegrades = has_capability('mod/coursework:addagreedgrade',
$submission->get_coursework()->get_context());
- return $allocation_disabled && ($allowed_to_grade || $allowed_to_agree_grades);
+ return $allocationdisabled && ($allowedtograde || $allowedtoagreegrades);
});
}
@@ -430,13 +430,13 @@ protected function allow_show_submission_to_graders_after_feedback_release() {
'mod_coursework\models\submission',
function (submission $submission) {
- $allowed_to_grade = has_capability('mod/coursework:addinitialgrade',
+ $allowedtograde = has_capability('mod/coursework:addinitialgrade',
$submission->get_coursework()->get_context());
- $allowed_to_agree_grades = has_capability('mod/coursework:addagreedgrade',
+ $allowedtoagreegrades = has_capability('mod/coursework:addagreedgrade',
$submission->get_coursework()->get_context());
- $allocation_disabled = !$submission->get_coursework()->allocation_enabled();
+ $allocationdisabled = !$submission->get_coursework()->allocation_enabled();
- return $allocation_disabled && $submission->is_published() && ($allowed_to_grade || $allowed_to_agree_grades);
+ return $allocationdisabled && $submission->is_published() && ($allowedtograde || $allowedtoagreegrades);
});
}
@@ -445,9 +445,9 @@ protected function allow_show_submission_if_user_is_agreed_grade_assessor_and_su
'mod_coursework\models\submission',
function (submission $submission) {
$state = $submission->get_state();
- $allowed_to_agree_grades = has_capability('mod/coursework:addagreedgrade', $submission->get_coursework()->get_context());
- $allowed_to_edit_agree_grades = has_capability('mod/coursework:editagreedgrade', $submission->get_coursework()->get_context());
- return (($allowed_to_agree_grades && $state == submission::FULLY_GRADED) || ($allowed_to_edit_agree_grades && $state >= submission::FULLY_GRADED));
+ $allowedtoagreegrades = has_capability('mod/coursework:addagreedgrade', $submission->get_coursework()->get_context());
+ $allowedtoeditagreegrades = has_capability('mod/coursework:editagreedgrade', $submission->get_coursework()->get_context());
+ return (($allowedtoagreegrades && $state == submission::FULLY_GRADED) || ($allowedtoeditagreegrades && $state >= submission::FULLY_GRADED));
});
}
@@ -484,15 +484,15 @@ protected function prevent_edit_submission_past_deadline_and_no_extension() {
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();
+ $deadlinepassed = (bool)$submission->submission_personal_deadline() < time();
} else {
- $deadline_passed = $submission->get_coursework()->deadline_has_passed();
+ $deadlinepassed = $submission->get_coursework()->deadline_has_passed();
}
- $ok_to_submit_late = $submission->get_coursework()->allow_late_submissions();
+ $oktosubmitlate = $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 (!$ok_to_submit_late) {
+ $submittingallocatable = $coursework->submiting_allocatable_for_student($this->get_user());
+ if ($deadlinepassed && !deadline_extension::allocatable_extension_allows_submission($submittingallocatable, $coursework)) {
+ if (!$oktosubmitlate) {
$this->set_message('Cannot submit past the deadline');
return true;
} else {
@@ -518,8 +518,8 @@ protected function allow_edit_submission_when_permitted_and_own_submission() {
$this->allow('edit',
'mod_coursework\models\submission',
function (submission $submission) {
- $can_submit = has_capability('mod/coursework:submit', $submission->get_context(), $this->get_user());
- return $can_submit && $submission->belongs_to_user($this->get_user());
+ $cansubmit = has_capability('mod/coursework:submit', $submission->get_context(), $this->get_user());
+ return $cansubmit && $submission->belongs_to_user($this->get_user());
});
}
@@ -571,12 +571,12 @@ function (submission $submission) {
/**
* @var submission $submission
*/
- $not_already_finalised = !$submission->ready_to_grade();
- $early_finalisation_allowed = $submission->get_coursework()->early_finalisation_allowed();
- $coursework_has_no_deadline = !$submission->get_coursework()->has_deadline();
- $allowed_to = $this->can('new', $submission) || $this->can('edit', $submission);
+ $notalreadyfinalised = !$submission->ready_to_grade();
+ $earlyfinalisationallowed = $submission->get_coursework()->early_finalisation_allowed();
+ $courseworkhasnodeadline = !$submission->get_coursework()->has_deadline();
+ $allowedto = $this->can('new', $submission) || $this->can('edit', $submission);
- return $allowed_to && $not_already_finalised && ($early_finalisation_allowed || $coursework_has_no_deadline);
+ return $allowedto && $notalreadyfinalised && ($earlyfinalisationallowed || $courseworkhasnodeadline);
});
}
@@ -643,11 +643,11 @@ protected function allow_new_moderation_if_user_is_allocated_to_moderate() {
$this->allow('new',
'mod_coursework\models\moderation',
function (moderation $moderation) {
- $is_allocated = false;
+ $isallocated = false;
if ($moderation->get_coursework()->allocation_enabled()) {
- $is_allocated = $moderation->is_moderator_allocated();
+ $isallocated = $moderation->is_moderator_allocated();
}
- return $is_allocated;
+ return $isallocated;
});
}
@@ -655,11 +655,11 @@ protected function prevent_new_moderation_if_user_is_not_allocated_to_moderate()
$this->prevent('new',
'mod_coursework\models\moderation',
function (moderation $moderation) {
- $is_allocated = false;
+ $isallocated = false;
if ($moderation->get_coursework()->allocation_enabled() && !is_siteadmin()) {
- $is_allocated = !$moderation->is_moderator_allocated();
+ $isallocated = !$moderation->is_moderator_allocated();
}
- return $is_allocated;
+ return $isallocated;
});
}
@@ -667,10 +667,10 @@ protected function allow_edit_moderation_if_user_created_moderation_and_can_edit
$this->allow('edit',
'mod_coursework\models\moderation',
function (moderation $moderation) {
- $has_capability = has_capability('mod/coursework:moderate', $moderation->get_coursework()
+ $hascapability = has_capability('mod/coursework:moderate', $moderation->get_coursework()
->get_context());
- $is_creator = $moderation->moderatorid == $this->get_user()->id;
- return $has_capability && ($is_creator || is_siteadmin());
+ $iscreator = $moderation->moderatorid == $this->get_user()->id;
+ return $hascapability && ($iscreator || is_siteadmin());
});
}
@@ -678,8 +678,8 @@ protected function allow_edit_moderation_if_user_is_allocated_to_moderate() {
$this->allow('edit',
'mod_coursework\models\moderation',
function (moderation $moderation) {
- $is_allocated = $moderation->is_moderator_allocated();
- return $is_allocated;
+ $isallocated = $moderation->is_moderator_allocated();
+ return $isallocated;
});
}
@@ -803,9 +803,9 @@ function (feedback $feedback) {
$allocatable = $feedback->get_submission()->get_allocatable();
if ($stage->uses_allocation() && $feedback->get_coursework()->allocation_enabled()) {
- $allocated_teacher = $stage->allocated_teacher_for($allocatable);
- if ($allocated_teacher) {
- if ($allocated_teacher->id == $this->user->id) {
+ $allocatedteacher = $stage->allocated_teacher_for($allocatable);
+ if ($allocatedteacher) {
+ if ($allocatedteacher->id == $this->user->id) {
return true;
}
}
@@ -823,9 +823,9 @@ function (feedback $feedback) {
$allocatable = $feedback->get_submission()->get_allocatable();
if ($stage->uses_allocation() && $feedback->get_coursework()->allocation_enabled()) {
- $allocated_teacher = $stage->allocated_teacher_for($allocatable);
- if ($allocated_teacher) {
- if ($allocated_teacher->id() != $this->get_user()->id()) {
+ $allocatedteacher = $stage->allocated_teacher_for($allocatable);
+ if ($allocatedteacher) {
+ if ($allocatedteacher->id() != $this->get_user()->id()) {
return true;
}
}
@@ -839,14 +839,14 @@ protected function allow_new_feedback_from_any_assessor_when_allocation_is_disab
'mod_coursework\models\feedback',
function (feedback $feedback) {
- $has_editable_feedbacks = false;
+ $haseditablefeedbacks = false;
// find out if the previous grades are editable
if ($feedback->is_agreed_grade()) {
- $has_editable_feedbacks = $feedback->get_submission()->editable_feedbacks_exist();
+ $haseditablefeedbacks = $feedback->get_submission()->editable_feedbacks_exist();
}
- if ((!$feedback->get_coursework()->allocation_enabled() || !$feedback->get_stage()->uses_allocation()) && !$has_editable_feedbacks ) {
+ if ((!$feedback->get_coursework()->allocation_enabled() || !$feedback->get_stage()->uses_allocation()) && !$haseditablefeedbacks ) {
return true;
}
return false;
@@ -896,16 +896,16 @@ protected function allow_edit_feedback_if_user_created_feedback_and_is_initial_f
function (feedback $feedback) {
global $CFG;
- $is_initial_grade = $feedback->is_initial_assessor_feedback();
- $has_capability = has_capability('mod/coursework:editinitialgrade', $feedback->get_context());
- $is_creator = $feedback->assessorid == $this->get_user()->id;
- $is_allocated = $feedback->is_assessor_allocated();
+ $isinitialgrade = $feedback->is_initial_assessor_feedback();
+ $hascapability = has_capability('mod/coursework:editinitialgrade', $feedback->get_context());
+ $iscreator = $feedback->assessorid == $this->get_user()->id;
+ $isallocated = $feedback->is_assessor_allocated();
$submission = $feedback->get_submission();
- $in_editable_period = (!empty($feedback->get_coursework()->get_grade_editing_time()) && $feedback->timecreated + $feedback->get_coursework()->get_grade_editing_time() > time());
+ $ineditableperiod = (!empty($feedback->get_coursework()->get_grade_editing_time()) && $feedback->timecreated + $feedback->get_coursework()->get_grade_editing_time() > time());
- return $is_initial_grade && ($has_capability || $in_editable_period) && ($is_creator || $is_allocated);
+ return $isinitialgrade && ($hascapability || $ineditableperiod) && ($iscreator || $isallocated);
});
}
@@ -933,9 +933,9 @@ protected function allow_edit_own_feedback_if_in_draft() {
$this->allow('edit',
'mod_coursework\models\feedback',
function (feedback $feedback) {
- $is_creator = $feedback->assessorid == $this->get_user()->id;
+ $iscreator = $feedback->assessorid == $this->get_user()->id;
$stage = $feedback->get_stage();
- return $is_creator && ($feedback->get_submission()->editable_feedbacks_exist() || $feedback->get_submission()->editable_final_feedback_exist()
+ return $iscreator && ($feedback->get_submission()->editable_feedbacks_exist() || $feedback->get_submission()->editable_final_feedback_exist()
&& ((!$feedback->get_coursework()->has_multiple_markers() && $stage->is_initial_assesor_stage() ) || !$stage->is_initial_assesor_stage()));
});
}
@@ -998,10 +998,10 @@ protected function allow_show_feedback_to_initial_assessors_once_agreed_grade_is
$this->allow('show',
'mod_coursework\models\feedback',
function (feedback $feedback) {
- $is_assessor =
+ $isassessor =
has_capability('mod/coursework:addinitialgrade', $feedback->get_coursework()->get_context());
- $agreed_grade_done = $feedback->get_submission()->final_grade_agreed();
- return $is_assessor && $agreed_grade_done;
+ $agreedgradedone = $feedback->get_submission()->final_grade_agreed();
+ return $isassessor && $agreedgradedone;
});
}
@@ -1045,11 +1045,11 @@ function (allocation $allocation) {
protected function allow_show_grading_table_row_if_allocation_enabled_and_user_has_any_allocation() {
$this->allow('show',
'mod_coursework\grading_table_row_base',
- function (grading_table_row_base $grading_table_row) {
- $allocatable = $grading_table_row->get_allocatable();
+ function (grading_table_row_base $gradingtablerow) {
+ $allocatable = $gradingtablerow->get_allocatable();
- if ($grading_table_row->get_coursework()->allocation_enabled()) {
- if ($grading_table_row->get_coursework()->assessor_has_any_allocation_for_student($allocatable)) {
+ if ($gradingtablerow->get_coursework()->allocation_enabled()) {
+ if ($gradingtablerow->get_coursework()->assessor_has_any_allocation_for_student($allocatable)) {
return true;
}
}
@@ -1060,22 +1060,22 @@ function (grading_table_row_base $grading_table_row) {
protected function allow_show_grading_table_row_if_allocation_enabled_and_all_initial_feedback_done_and_user_can_do_agreed_grades() {
$this->allow('show',
'mod_coursework\grading_table_row_base',
- function (grading_table_row_base $grading_table_row) {
- $can_add_agreed_grade = has_capability('mod/coursework:addagreedgrade',
- $grading_table_row->get_coursework()
+ function (grading_table_row_base $gradingtablerow) {
+ $canaddagreedgrade = has_capability('mod/coursework:addagreedgrade',
+ $gradingtablerow->get_coursework()
->get_context());
- if ($grading_table_row->get_coursework()
- ->allocation_enabled() && $grading_table_row->has_submission()
+ if ($gradingtablerow->get_coursework()
+ ->allocation_enabled() && $gradingtablerow->has_submission()
) {
- $submission_has_all_initial_assessor_feedbacks = $grading_table_row->get_submission()
+ $submissionhasallinitialassessorfeedbacks = $gradingtablerow->get_submission()
->get_state() >= submission::FULLY_GRADED;
- if ($can_add_agreed_grade &&
- $submission_has_all_initial_assessor_feedbacks
+ if ($canaddagreedgrade &&
+ $submissionhasallinitialassessorfeedbacks
) {
- $submission_in_sample = $grading_table_row->get_submission()->sampled_feedback_exists();
- return (!$grading_table_row->get_coursework()->sampling_enabled() || $submission_in_sample) ? true : false;
+ $submissioninsample = $gradingtablerow->get_submission()->sampled_feedback_exists();
+ return (!$gradingtablerow->get_coursework()->sampling_enabled() || $submissioninsample) ? true : false;
}
}
return false;
@@ -1085,9 +1085,9 @@ function (grading_table_row_base $grading_table_row) {
protected function allow_show_grading_table_row_if_allocation_not_enabled_and_user_is_assessor_of_any_stage() {
$this->allow('show',
'mod_coursework\grading_table_row_base',
- function (grading_table_row_base $grading_table_row) {
- if (!$grading_table_row->get_coursework()->allocation_enabled()) {
- foreach ($grading_table_row->get_coursework()->marking_stages() as $stage) {
+ function (grading_table_row_base $gradingtablerow) {
+ if (!$gradingtablerow->get_coursework()->allocation_enabled()) {
+ foreach ($gradingtablerow->get_coursework()->marking_stages() as $stage) {
if ($stage->user_is_assessor($this->get_user())) {
return true;
}
@@ -1100,9 +1100,9 @@ function (grading_table_row_base $grading_table_row) {
protected function allow_show_grading_table_row_if_user_has_added_feedback_for_this_submission() {
$this->allow('show',
'mod_coursework\grading_table_row_base',
- function (grading_table_row_base $grading_table_row) {
- if ($grading_table_row->has_submission()) {
- if (feedback::exists(['submissionid' => $grading_table_row->get_submission()->id,
+ function (grading_table_row_base $gradingtablerow) {
+ if ($gradingtablerow->has_submission()) {
+ if (feedback::exists(['submissionid' => $gradingtablerow->get_submission()->id,
'assessorid' => $this->get_user()->id()])
) {
return true;
@@ -1115,27 +1115,27 @@ function (grading_table_row_base $grading_table_row) {
protected function allow_show_grading_table_row_if_user_can_view_grades_at_all_times() {
$this->allow('show',
'mod_coursework\grading_table_row_base',
- function (grading_table_row_base $grading_table_row) {
+ function (grading_table_row_base $gradingtablerow) {
return has_capability('mod/coursework:viewallgradesatalltimes',
- $grading_table_row->get_coursework()->get_context());
+ $gradingtablerow->get_coursework()->get_context());
});
}
protected function allow_show_grading_table_row_if_user_can_submit_on_behalf_of() {
$this->allow('show',
'mod_coursework\grading_table_row_base',
- function (grading_table_row_base $grading_table_row) {
+ function (grading_table_row_base $gradingtablerow) {
return has_capability('mod/coursework:submitonbehalfof',
- $grading_table_row->get_coursework()->get_context());
+ $gradingtablerow->get_coursework()->get_context());
});
}
protected function allow_show_grading_table_row_if_user_can_export_final_grades() {
$this->allow('show',
'mod_coursework\grading_table_row_base',
- function (grading_table_row_base $grading_table_row) {
+ function (grading_table_row_base $gradingtablerow) {
return has_capability('mod/coursework:canexportfinalgrades',
- $grading_table_row->get_coursework()->get_context());
+ $gradingtablerow->get_coursework()->get_context());
});
}
@@ -1158,16 +1158,16 @@ private function allow_new_feedback_if_agreed_feedback_and_user_can_add_agreed_f
function (feedback $feedback) {
$this->set_message('User can not add new agreed feedback.');
- $has_editable_feedbacks = false;
+ $haseditablefeedbacks = false;
// find out if the previous grades are editable
if ($feedback->is_agreed_grade()) {
- $has_editable_feedbacks = $feedback->get_submission()->editable_feedbacks_exist();
+ $haseditablefeedbacks = $feedback->get_submission()->editable_feedbacks_exist();
}
- return $feedback->is_agreed_grade() && !$has_editable_feedbacks && (has_capability('mod/coursework:addagreedgrade',
+ return $feedback->is_agreed_grade() && !$haseditablefeedbacks && (has_capability('mod/coursework:addagreedgrade',
$feedback->get_coursework()
->get_context())
|| has_capability('mod/coursework:addallocatedagreedgrade',
@@ -1222,9 +1222,9 @@ function (feedback $feedback) {
private function allow_new_deadline_extension_with_capability() {
$this->allow('new',
'mod_coursework\models\deadline_extension',
- function (deadline_extension $deadline_extension) {
- return $deadline_extension->get_coursework()->has_deadline() && has_capability('mod/coursework:grantextensions',
- $deadline_extension->get_coursework()
+ function (deadline_extension $deadlineextension) {
+ return $deadlineextension->get_coursework()->has_deadline() && has_capability('mod/coursework:grantextensions',
+ $deadlineextension->get_coursework()
->get_context());
});
}
@@ -1232,9 +1232,9 @@ function (deadline_extension $deadline_extension) {
private function allow_show_deadline_extension_with_capability() {
$this->allow('show',
'mod_coursework\models\deadline_extension',
- function (deadline_extension $deadline_extension) {
+ function (deadline_extension $deadlineextension) {
return has_capability('mod/coursework:viewextensions',
- $deadline_extension->get_coursework()
+ $deadlineextension->get_coursework()
->get_context());
});
}
@@ -1242,9 +1242,9 @@ function (deadline_extension $deadline_extension) {
private function allow_edit_deadline_extension_with_capability() {
$this->allow('edit',
'mod_coursework\models\deadline_extension',
- function (deadline_extension $deadline_extension) {
+ function (deadline_extension $deadlineextension) {
return has_capability('mod/coursework:grantextensions',
- $deadline_extension->get_coursework()
+ $deadlineextension->get_coursework()
->get_context());
});
}
@@ -1252,11 +1252,11 @@ function (deadline_extension $deadline_extension) {
private function prevent_new_deadline_extension_if_already_exists() {
$this->prevent('new',
'mod_coursework\models\deadline_extension',
- function (deadline_extension $deadline_extension) {
+ function (deadline_extension $deadlineextension) {
$conditions = [
- 'allocatableid' => $deadline_extension->allocatableid,
- 'allocatabletype' => $deadline_extension->allocatabletype,
- 'courseworkid' => $deadline_extension->courseworkid,
+ 'allocatableid' => $deadlineextension->allocatableid,
+ 'allocatabletype' => $deadlineextension->allocatabletype,
+ 'courseworkid' => $deadlineextension->courseworkid,
];
return deadline_extension::exists($conditions);
});
@@ -1265,24 +1265,24 @@ function (deadline_extension $deadline_extension) {
private function prevent_edit_deadline_extension_if_not_persisted() {
$this->prevent('edit',
'mod_coursework\models\deadline_extension',
- function (deadline_extension $deadline_extension) {
- return !$deadline_extension->persisted();
+ function (deadline_extension $deadlineextension) {
+ return !$deadlineextension->persisted();
});
}
private function allow_create_deadline_extension_if_can_new() {
$this->allow('create',
'mod_coursework\models\deadline_extension',
- function (deadline_extension $deadline_extension) {
- return $this->can('new', $deadline_extension);
+ function (deadline_extension $deadlineextension) {
+ return $this->can('new', $deadlineextension);
});
}
private function allow_update_deadline_extension_if_can_edit() {
$this->allow('update',
'mod_coursework\models\deadline_extension',
- function (deadline_extension $deadline_extension) {
- return $this->can('edit', $deadline_extension);
+ function (deadline_extension $deadlineextension) {
+ return $this->can('edit', $deadlineextension);
});
}
@@ -1306,10 +1306,10 @@ function (submission $submission) {
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()
+ function (personal_deadline $personaldeadline) {
+ return $personaldeadline->get_coursework()->personal_deadlines_enabled()
&& has_capability('mod/coursework:editpersonaldeadline',
- $personal_deadline->get_coursework()
+ $personaldeadline->get_coursework()
->get_context());
});
}
@@ -1317,26 +1317,26 @@ function (personal_deadline $personal_deadline) {
private function prevent_edit_personal_deadline_if_extension_given() {
$this->prevent('edit',
'mod_coursework\models\personal_deadline',
- function (personal_deadline $personal_deadline) {
+ function (personal_deadline $personaldeadline) {
// check if extension for this PD exists
- return $personal_deadline->extension_exists();
+ return $personaldeadline->extension_exists();
});
}
private function allow_new_plagiarism_flag_with_capability() {
$this->allow('new',
'mod_coursework\models\plagiarism_flag',
- function (plagiarism_flag $plagiarism_flag) {
- return has_capability('mod/coursework:addplagiarismflag', $plagiarism_flag->get_coursework()->get_context());
+ function (plagiarism_flag $plagiarismflag) {
+ return has_capability('mod/coursework:addplagiarismflag', $plagiarismflag->get_coursework()->get_context());
});
}
private function allow_edit_plagiarism_flag_with_capability() {
$this->allow('edit',
'mod_coursework\models\plagiarism_flag',
- function (plagiarism_flag $plagiarism_flag) {
+ function (plagiarism_flag $plagiarismflag) {
return has_capability('mod/coursework:updateplagiarismflag',
- $plagiarism_flag->get_coursework()
+ $plagiarismflag->get_coursework()
->get_context());
});
}
@@ -1344,8 +1344,8 @@ function (plagiarism_flag $plagiarism_flag) {
private function prevent_edit_plagiarism_flag_if_not_persisted() {
$this->prevent('edit',
'mod_coursework\models\plagiarism_flag',
- function (plagiarism_flag $plagiarism_flag) {
- return !$plagiarism_flag->persisted();
+ function (plagiarism_flag $plagiarismflag) {
+ return !$plagiarismflag->persisted();
});
}
diff --git a/classes/ability/rule.php b/classes/ability/rule.php
index 15272a7e..f29490c3 100644
--- a/classes/ability/rule.php
+++ b/classes/ability/rule.php
@@ -38,12 +38,12 @@ class rule {
/**
* @var string
*/
- protected $class_name;
+ protected $classname;
/**
* @var callable
*/
- protected $rule_function;
+ protected $rulefunction;
/**
* @var bool
@@ -56,10 +56,10 @@ class rule {
* @param $rule_function
* @param bool $allow
*/
- public function __construct($action, $class_name, $rule_function, $allow = true) {
+ public function __construct($action, $classname, $rulefunction, $allow = true) {
$this->action = $action;
- $this->class_name = $class_name;
- $this->rule_function = $rule_function;
+ $this->class_name = $classname;
+ $this->rule_function = $rulefunction;
$this->allow = $allow;
}
diff --git a/classes/allocation/allocatable.php b/classes/allocation/allocatable.php
index 7a215d7c..c772a6e4 100644
--- a/classes/allocation/allocatable.php
+++ b/classes/allocation/allocatable.php
@@ -58,7 +58,7 @@ public function picture();
* @param bool $with_picture
* @return string
*/
- public function profile_link($with_picture = false);
+ public function profile_link($withpicture = false);
/**
* @param \stdClass $course
diff --git a/classes/allocation/auto_allocator.php b/classes/allocation/auto_allocator.php
index 72b62169..461b7a39 100644
--- a/classes/allocation/auto_allocator.php
+++ b/classes/allocation/auto_allocator.php
@@ -105,7 +105,7 @@ private function get_allocatables() {
private function delete_all_ungraded_auto_allocations() {
global $DB;
- $ungraded_allocations = $DB->get_records_sql('
+ $ungradedallocations = $DB->get_records_sql('
SELECT *
FROM {coursework_allocation_pairs} p
WHERE courseworkid = ?
@@ -122,12 +122,12 @@ private function delete_all_ungraded_auto_allocations() {
)
', ['courseworkid' => $this->get_coursework()->id]);
- foreach ($ungraded_allocations as &$allocation) {
+ foreach ($ungradedallocations as &$allocation) {
/**
* @var allocation $allocation_object
*/
- $allocation_object = allocation::find($allocation);
- $allocation_object->destroy();
+ $allocationobject = allocation::find($allocation);
+ $allocationobject->destroy();
}
}
diff --git a/classes/allocation/manager.php b/classes/allocation/manager.php
index cb31d5f0..2ec4f19f 100644
--- a/classes/allocation/manager.php
+++ b/classes/allocation/manager.php
@@ -123,9 +123,9 @@ public static function get_allocation_classnames($type = coursework::ASSESSOR) {
// move 'none' to be the first option
if (array_key_exists('none', $options)) {
- $new_value = ['none' => $options['none']];
+ $newvalue = ['none' => $options['none']];
unset($options['none']);
- $options = $new_value + $options;
+ $options = $newvalue + $options;
}
return $options;
@@ -161,25 +161,25 @@ public function auto_generate_moderation_set() {
$allocatables = $this->get_coursework()->get_allocatables();
$stage = $this->get_coursework()->get_moderator_marking_stage();
- $set_rules = $this->get_moderation_set_rules();
+ $setrules = $this->get_moderation_set_rules();
// No set to make.
- if (empty($set_rules)) {
+ if (empty($setrules)) {
return;
}
// These are the ones we will actually moderate (or which have already been moderated).
- $moderation_set = [];
+ $moderationset = [];
// 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.
- $moderation_set = $this->add_already_moderated_allocatables_to_set($allocatables, $stage, $moderation_set);
+ $moderationset = $this->add_already_moderated_allocatables_to_set($allocatables, $stage, $moderationset);
// Now, we loop over the set repeatedly, once for each rule, and add those we want to the set.
- foreach ($set_rules as $rule) {
+ foreach ($setrules as $rule) {
// The rule will separate out those students that ought to be included, leaving
// the arrays altered.
- $rule->adjust_set($moderation_set, $allocatables, $stage);
+ $rule->adjust_set($moderationset, $allocatables, $stage);
}
}
@@ -242,7 +242,7 @@ public function get_sampling_set_widget($requestedrule = false) {
* @param string $rule_name
* @throws moodle_exception
*/
- public function save_sample_set_rule($assessor_number) {
+ public function save_sample_set_rule($assessornumber) {
global $CFG, $DB;
@@ -254,7 +254,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($assessornumber, $order);
}
@@ -266,9 +266,9 @@ public function save_sample() {
$DB->delete_records('coursework_sample_set_rules', ['courseworkid' => $this->coursework->id]);
for ($i = 2; $i <= $this->coursework->get_max_markers(); $i++) {
- $sample_strategy = required_param("assessor_{$i}_samplingstrategy", PARAM_INT);
+ $samplestrategy = required_param("assessor_{$i}_samplingstrategy", PARAM_INT);
- if ($sample_strategy) {
+ if ($samplestrategy) {
$this->save_sample_set_rule($i);
}
@@ -289,22 +289,22 @@ public function auto_generate_sample_set() {
$sampleplugins = $DB->get_records('coursework_sample_set_plugin', null, 'pluginorder');
$order = 0;
- $sample_set = [];
+ $sampleset = [];
$allocatables = $this->get_coursework()->get_allocatables();
- $final_agreed_allocatables = $this->get_allocatables_with_final_agreed();
+ $finalagreedallocatables = $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 ($finalagreedallocatables as $faa) {
if (isset($allocatables[$faa->allocatableid])) {
unset($allocatables[$faa->allocatableid]);
}
}
- for ($stage_number = 2; $stage_number <= $this->get_coursework()->get_max_markers(); $stage_number++) {
+ for ($stagenumber = 2; $stagenumber <= $this->get_coursework()->get_max_markers(); $stagenumber++) {
- $stage = "assessor_{$stage_number}";
+ $stage = "assessor{$stagenumber}";
$this->remove_unmarked_automatic_allocatables($stage);
@@ -321,39 +321,39 @@ public function auto_generate_sample_set() {
//$allocatables = $this->get_coursework()->get_allocatables_with_feedback();
$allocatables = $this->get_coursework()->get_allocatables();
- $manual_sample_set = $this->get_include_in_sample_set($stage_number);
+ $manualsampleset = $this->get_include_in_sample_set($stagenumber);
- $auto_with_feedback = $this->get_automatic_with_feedback($stage);
+ $autowithfeedback = $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
- foreach ($auto_with_feedback as $k => $v) {
- if (!isset($manual_sample_set[$k])) {
- $manual_sample_set[$k] = $v;
+ foreach ($autowithfeedback as $k => $v) {
+ if (!isset($manualsampleset[$k])) {
+ $manualsampleset[$k] = $v;
}
}
- $auto_sample_set = [];
+ $autosampleset = [];
foreach ($sampleplugins as $plugin) {
$classname = '\mod_coursework\sample_set_rule\\' . $plugin->rulename;
$rule = new $classname($this->coursework);
- $rule->adjust_sample_set($stage_number, $allocatables, $manual_sample_set, $auto_sample_set);
+ $rule->adjust_sample_set($stagenumber, $allocatables, $manualsampleset, $autosampleset);
}
// Save sample set
- if (!empty($auto_sample_set)) {
- foreach ($auto_sample_set as $allocatable) {
+ if (!empty($autosampleset)) {
+ foreach ($autosampleset 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->stage_identifier = "assessor{$stagenumber}";
$sample->selectiontype = "automatic";
// If this a manually selected allocatable check to see if the allocatable is already in the table
@@ -365,11 +365,11 @@ public function auto_generate_sample_set() {
}
}
- public function get_include_in_sample_set($stage_number) {
+ public function get_include_in_sample_set($stagenumber) {
global $DB;
- $stage = "assessor_{$stage_number}";
+ $stage = "assessor{$stagenumber}";
$sql = "SELECT allocatableid,
courseworkid,
diff --git a/classes/allocation/strategy/base.php b/classes/allocation/strategy/base.php
index 3bc982c8..ea6e4386 100644
--- a/classes/allocation/strategy/base.php
+++ b/classes/allocation/strategy/base.php
@@ -159,8 +159,8 @@ final protected function get_existing_config_data($type = 'assessor', $reset = f
* @return string
*/
protected function get_type() {
- $exploded_class_name = explode('\\', get_class($this->stage));
- return array_pop($exploded_class_name);
+ $explodedclassname = explode('\\', get_class($this->stage));
+ return array_pop($explodedclassname);
}
/**
@@ -194,17 +194,17 @@ protected function number_of_existing_allocations_teacher_has($teacher) {
* @param array $teacher_counts teacherid => number_of_allocations_so_far
* @return user|bool
*/
- protected function get_teacher_with_smallest_number_of_current_allocations($teacher_counts) {
+ protected function get_teacher_with_smallest_number_of_current_allocations($teachercounts) {
// What if there aren't any e.g. only one teacher, but two are needed?
- if (empty($teacher_counts)) {
+ if (empty($teachercounts)) {
return false;
}
// Which is the best one? Whichever has the fewest. Might be several with the same number, so we
// get the allocations count value that's lowest (may represent multiple teachers), then get the first array
// key (teacher id) that has that number of allocations.
- $smallestcount = min($teacher_counts);
- return user::find(array_search($smallestcount, $teacher_counts));
+ $smallestcount = min($teachercounts);
+ return user::find(array_search($smallestcount, $teachercounts));
}
/**
diff --git a/classes/allocation/strategy/percentages.php b/classes/allocation/strategy/percentages.php
index b9db109b..172dec05 100644
--- a/classes/allocation/strategy/percentages.php
+++ b/classes/allocation/strategy/percentages.php
@@ -233,9 +233,9 @@ private function number_of_total_allocations_this_teacher_should_have($teacher)
*/
private function teacher_already_has_maximum_allocations($teacher) {
$targetnumber = $this->number_of_total_allocations_this_teacher_should_have($teacher);
- $number_of_exisiting_allocations = $this->number_of_existing_allocations_teacher_has($teacher);
+ $numberofexisitingallocations = $this->number_of_existing_allocations_teacher_has($teacher);
- return $number_of_exisiting_allocations >= $targetnumber;
+ return $numberofexisitingallocations >= $targetnumber;
}
/**
diff --git a/classes/allocation/table/cell/builder.php b/classes/allocation/table/cell/builder.php
index ff446a63..df5b8ec9 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 = []) {
+ public function __construct($coursework, $allocatable, $stage, $dataarray = []) {
$this->coursework = $coursework;
$this->allocatable = $allocatable;
$this->stage = $stage;
@@ -166,7 +166,7 @@ private function prepare_allocation_table_cell() {
$class = $this->get_stage()->identifier();
$contents = '';
- $assessor_dropdown = '';
+ $assessordropdown = '';
if ($this->coursework->sampling_enabled()) {
if ($class == 'final_agreed_1') {
@@ -192,32 +192,32 @@ private function prepare_allocation_table_cell() {
$contents .= '
';
if ($this->coursework->allocation_enabled()) {
- $assessor_dropdown = $this->get_potential_marker_dropdown();
+ $assessordropdown = $this->get_potential_marker_dropdown();
}
- $assessor_name = '';
+ $assessorname = '';
if ($this->has_feedback()) {
$class .= ' has-assessor-feedback ';
$feedback = $this->get_feedback();
$assessor = $feedback->assessor();
- $assessor_name = $assessor->profile_link();
- $assessor_name .= '
';
- $assessor_name .= 'Grade: ';
- $assessor_name .= $this->get_feedback()->get_grade();
+ $assessorname = $assessor->profile_link();
+ $assessorname .= '
';
+ $assessorname .= 'Grade: ';
+ $assessorname .= $this->get_feedback()->get_grade();
} else if ($this->has_allocation()) {
- $assessor_name .= ' '.$this->pinned_checkbox($assessor_dropdown);
- $assessor_name .= $this->get_stage()->get_allocated_assessor_name($this->get_allocatable());
+ $assessorname .= ' '.$this->pinned_checkbox($assessordropdown);
+ $assessorname .= $this->get_stage()->get_allocated_assessor_name($this->get_allocatable());
}
- if ($assessor_name) {
+ if ($assessorname) {
if ($this->get_stage()->uses_sampling() && !$this->get_feedback() && !$this->has_automatic_sampling()) {
$contents .= '
';
}
- $contents .= "
{$assessor_name}";
+ $contents .= "
{$assessorname}";
}
- if ($assessor_dropdown) {
- $contents .= $assessor_dropdown;
+ if ($assessordropdown) {
+ $contents .= $assessordropdown;
}
return '
@@ -234,35 +234,35 @@ private function prepare_moderation_table_cell() {
$contents = '';
$class = 'moderators';
- $moderator_dropdown = '';
+ $moderatordropdown = '';
if ($this->coursework->allocation_enabled()) {
- $moderator_dropdown = $this->get_potential_moderators_dropdown();
+ $moderatordropdown = $this->get_potential_moderators_dropdown();
}
- $moderator_name = '';
+ $moderatorname = '';
if ($this->has_moderation()) {
$class .= ' has-moderation-agreement ';
$moderation = $this->get_moderation();
$moderator = $moderation->moderator();
- $moderator_name = $moderator->profile_link();
- $moderator_name .= '
';
- $moderator_name .= 'Agreement: ';
- $moderator_name .= get_string($this->get_moderation()->agreement, 'coursework');
+ $moderatorname = $moderator->profile_link();
+ $moderatorname .= '
';
+ $moderatorname .= 'Agreement: ';
+ $moderatorname .= get_string($this->get_moderation()->agreement, 'coursework');
} else if ($this->has_allocation()) {
- $moderator_name = ' ' . $this->pinned_checkbox($moderator_dropdown);
- $moderator_name .= $this->get_stage()->get_allocated_assessor_name($this->get_allocatable());
+ $moderatorname = ' ' . $this->pinned_checkbox($moderatordropdown);
+ $moderatorname .= $this->get_stage()->get_allocated_assessor_name($this->get_allocatable());
}
- if ($moderator_name) {
+ if ($moderatorname) {
$contents .= '
';
- $contents .= "
{$moderator_name}";
+ $contents .= "
{$moderatorname}";
}
- if ($moderator_dropdown) {
+ if ($moderatordropdown) {
$contents .= '
';
- $contents .= $moderator_dropdown;
+ $contents .= $moderatordropdown;
}
return '
@@ -289,20 +289,20 @@ private function get_stage() {
* @throws \coding_exception
*/
private function sampling_set_checkbox() {
- $checkbox_name =
+ $checkboxname =
'allocatables[' . $this->get_allocatable()->id . '][' . $this->get_stage()->identifier() . '][in_set]';
- $checkbox_checked = 0;
+ $checkboxchecked = 0;
if ($this->get_stage()->allocatable_is_in_sample($this->get_allocatable()) || $this->get_stage()->identifier() == 'assessor_1') {
- $checkbox_checked = 1;
+ $checkboxchecked = 1;
}
- $checkbox_checked = $this->checkbox_checked_in_session($checkbox_name, $checkbox_checked);
+ $checkboxchecked = $this->checkbox_checked_in_session($checkboxname, $checkboxchecked);
- $checkbox_title = 'Included in sample';
+ $checkboxtitle = 'Included in sample';
$attributes = ['class' => 'sampling_set_checkbox',
'id' => $this->get_allocatable()->type().'_' . $this->get_allocatable()->id() . '_'.$this->get_stage()->identifier() .'_samplecheckbox',
- 'title' => $checkbox_title];
+ 'title' => $checkboxtitle];
// if agreed grade given or grade published to students disable remaining sampling checkbox
$submission = $this->get_submission();
@@ -310,9 +310,9 @@ private function sampling_set_checkbox() {
$attributes['disabled'] = 'true';
}
- return \html_writer::checkbox($checkbox_name,
+ return \html_writer::checkbox($checkboxname,
1,
- $checkbox_checked,
+ $checkboxchecked,
get_string('includedinsample', 'mod_coursework'),
$attributes);
}
@@ -321,17 +321,17 @@ private function sampling_set_checkbox() {
* @return string
*/
private function sampling_hidden_checkbox() {
- $checkbox_name =
+ $checkboxname =
'allocatables[' . $this->get_allocatable()->id . '][' . $this->get_stage()->identifier() . '][in_set]';
- $checkbox_title = 'Included in sample';
+ $checkboxtitle = 'Included in sample';
- return \html_writer::checkbox($checkbox_name,
+ return \html_writer::checkbox($checkboxname,
1,
1,
'',
['class' => 'sampling_set_checkbox',
'id' => $this->get_allocatable()->type().'_' . $this->get_allocatable()->id() . '_'.$this->get_stage()->identifier() .'_samplecheckbox',
- 'title' => $checkbox_title, 'hidden' => true]);
+ 'title' => $checkboxtitle, 'hidden' => true]);
}
/**
@@ -357,25 +357,25 @@ private function has_automatic_sampling() {
*/
private function pinned_checkbox() {
- $checkbox_name =
+ $checkboxname =
'allocatables[' . $this->get_allocatable()->id . '][' . $this->get_stage()->identifier() . '][pinned]';
- $checkbox_checked = 0;
+ $checkboxchecked = 0;
if ($this->get_stage()->has_allocation($this->get_allocatable())) {
if ($this->get_stage()->get_allocation($this->get_allocatable())->is_pinned()) {
- $checkbox_checked = 1;
+ $checkboxchecked = 1;
}
}
- $checkbox_checked = $this->checkbox_checked_in_session($checkbox_name, $checkbox_checked);
+ $checkboxchecked = $this->checkbox_checked_in_session($checkboxname, $checkboxchecked);
$stage = substr($this->get_stage()->identifier(), -1);
- $checkbox_title = 'Pinned (auto allocations will not alter this)';
- return \html_writer::checkbox($checkbox_name,
+ $checkboxtitle = 'Pinned (auto allocations will not alter this)';
+ return \html_writer::checkbox($checkboxname,
1,
- $checkbox_checked,
+ $checkboxchecked,
'',
['class' => "pinned pin_$stage",
- 'title' => $checkbox_title]);
+ 'title' => $checkboxtitle]);
}
private function checkbox_checked_in_session($checkboxname, $checkboxstate) {
diff --git a/classes/allocation/table/cell/processor.php b/classes/allocation/table/cell/processor.php
index 48d45d52..73a35b0d 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 = []) {
+ public function __construct($coursework, $allocatable, $stage, $dataarray = []) {
$this->coursework = $coursework;
$this->allocatable = $allocatable;
$this->stage = $stage;
@@ -65,16 +65,16 @@ public function __construct($coursework, $allocatable, $stage, $data_array = []
/**
* @param data $cell_data
*/
- public function process($cell_data) {
+ public function process($celldata) {
if ($this->get_stage()->uses_sampling()) {
- $this->process_sampling_membership($cell_data);
+ $this->process_sampling_membership($celldata);
} else if ($this->get_stage()->has_allocation($this->get_allocatable())) {
- $this->process_pin($cell_data);
+ $this->process_pin($celldata);
}
- if ($cell_data->has_assessor() && $this->get_stage()->allocatable_is_in_sample($this->get_allocatable())) {
- $this->save_assessor_allocation($cell_data);
+ if ($celldata->has_assessor() && $this->get_stage()->allocatable_is_in_sample($this->get_allocatable())) {
+ $this->save_assessor_allocation($celldata);
}
}
@@ -153,10 +153,10 @@ private function get_stage() {
/**
* @param data $cell_data
*/
- private function process_pin($cell_data) {
+ private function process_pin($celldata) {
$allocation = $this->get_allocation();
- if ($cell_data->is_pinned()) {
+ if ($celldata->is_pinned()) {
$allocation->pin();
} else {
$allocation->unpin();
diff --git a/classes/allocation/table/processor.php b/classes/allocation/table/processor.php
index fd329886..e47d16ce 100644
--- a/classes/allocation/table/processor.php
+++ b/classes/allocation/table/processor.php
@@ -52,20 +52,20 @@ public function __construct($coursework) {
/**
* @param array $table_data
*/
- public function process_data($table_data = []) {
- $clean_data = $this->clean_data($table_data);
+ public function process_data($tabledata = []) {
+ $cleandata = $this->clean_data($tabledata);
$allocatables = $this->coursework->get_allocatables();
foreach ($allocatables as $allocatable) {
- if (array_key_exists($allocatable->id(), $clean_data)) {
- $row_data = $clean_data[$allocatable->id()];
+ if (array_key_exists($allocatable->id(), $cleandata)) {
+ $rowdata = $cleandata[$allocatable->id()];
} else {
- $row_data = [];
+ $rowdata = [];
}
$allocatable = $this->get_allocatable_from_id($allocatable->id());
- $row_object = $this->get_row($allocatable);
- $row_object->process($row_data);
+ $rowobject = $this->get_row($allocatable);
+ $rowobject->process($rowdata);
}
}
@@ -84,7 +84,7 @@ private function get_row($allocatable) {
* @param array $raw_data
* @return array
*/
- private function clean_data($raw_data) {
+ private function clean_data($rawdata) {
// Data looks like this:
// $example_data = array(
@@ -101,20 +101,20 @@ private function clean_data($raw_data) {
// )
// );
- $clean_data = [];
- foreach ($raw_data as $allocatable_id => $datarrays) {
+ $cleandata = [];
+ foreach ($rawdata as $allocatableid => $datarrays) {
- if (!$this->allocatable_id_is_valid($allocatable_id)) { // Should be the id of a student.
+ if (!$this->allocatable_id_is_valid($allocatableid)) { // Should be the id of a student.
continue;
}
- $clean_data[$allocatable_id] = [];
+ $cleandata[$allocatableid] = [];
foreach ($this->coursework->marking_stages() as $stage) {
if (array_key_exists($stage->identifier(), $datarrays)) {
- $stage_data = $datarrays[$stage->identifier()];
- $clean_data[$allocatable_id][$stage->identifier()] = $stage_data;
+ $stagedata = $datarrays[$stage->identifier()];
+ $cleandata[$allocatableid][$stage->identifier()] = $stagedata;
}
}
/* if (array_key_exists('moderator', $datarrays)) {
@@ -122,15 +122,15 @@ private function clean_data($raw_data) {
$clean_data[$allocatable_id]['moderator'] = $moderator_data;
}*/
}
- return $clean_data;
+ return $cleandata;
}
/**
* @param int $student_id
* @return bool
*/
- private function allocatable_id_is_valid($student_id) {
- $allocatable = $this->get_allocatable_from_id($student_id);
+ private function allocatable_id_is_valid($studentid) {
+ $allocatable = $this->get_allocatable_from_id($studentid);
return $allocatable && $allocatable->is_valid_for_course($this->coursework->get_course());
}
@@ -138,11 +138,11 @@ private function allocatable_id_is_valid($student_id) {
* @param int $allocatable_id
* @return allocatable
*/
- private function get_allocatable_from_id($allocatable_id) {
+ private function get_allocatable_from_id($allocatableid) {
if ($this->coursework->is_configured_to_have_group_submissions()) {
- return group::find($allocatable_id);
+ return group::find($allocatableid);
} else {
- return user::find($allocatable_id);
+ return user::find($allocatableid);
}
}
}
diff --git a/classes/allocation/table/row/builder.php b/classes/allocation/table/row/builder.php
index 0fa49e30..284ddfcc 100644
--- a/classes/allocation/table/row/builder.php
+++ b/classes/allocation/table/row/builder.php
@@ -54,8 +54,8 @@ class builder implements user_row {
* @param table_builder $allocation_table
* @param allocatable $allocatable
*/
- public function __construct($allocation_table, $allocatable) {
- $this->allocationtable = $allocation_table;
+ public function __construct($allocationtable, $allocatable) {
+ $this->allocationtable = $allocationtable;
$this->allocatable = $allocatable;
}
diff --git a/classes/allocation/upload.php b/classes/allocation/upload.php
index e7422523..04cff697 100644
--- a/classes/allocation/upload.php
+++ b/classes/allocation/upload.php
@@ -47,7 +47,7 @@ public function __construct($coursework) {
public function validate_csv($content, $encoding, $delimeter) {
global $CFG, $DB;
- $assessor_identifier = $CFG->coursework_allocation_identifier;
+ $assessoridentifier = $CFG->coursework_allocation_identifier;
$iid = \csv_import_reader::get_new_iid('courseworkallocationsdata');
$csvreader = new \csv_import_reader($iid, 'courseworkallocationsdata');
@@ -81,18 +81,18 @@ public function validate_csv($content, $encoding, $delimeter) {
$assessors = array_keys($assessors); // keep only assessors' ids
$allocatablesinfile = [];
- $csv_cells = ['allocatable'];
+ $csvcells = ['allocatable'];
$stages = $this->coursework->get_max_markers();
for ($i = 1; $i <= $stages; $i++) {
- $csv_cells[] = 'assessor_'.$i;
+ $csvcells[] = 'assessor_'.$i;
}
while ($line = $csvreader->next()) {
- $cells = $csv_cells;
+ $cells = $csvcells;
$assessorsinfile = [];
- if (count($line) != count($csv_cells)) {
+ if (count($line) != count($csvcells)) {
$errors = get_string('incorrectfileformat', 'coursework'); break;
}
foreach ($line as $keynum => $value) {
@@ -106,7 +106,7 @@ public function validate_csv($content, $encoding, $delimeter) {
if ($allocatabletype == 'user') {
// get user id
- $suballocatable = $DB->get_record('user', [$assessor_identifier => $value]);
+ $suballocatable = $DB->get_record('user', [$assessoridentifier => $value]);
$allocatable = ($suballocatable) ? \mod_coursework\models\user::find($suballocatable->id) : '';
} else {
// get group id
@@ -134,7 +134,7 @@ public function validate_csv($content, $encoding, $delimeter) {
continue;
}
- $assessor = $DB->get_record('user', [$assessor_identifier => $value]);
+ $assessor = $DB->get_record('user', [$assessoridentifier => $value]);
if (!$assessor ||!in_array($assessor->id, $assessors)) {
$errors[$s] = get_string('assessornotincoursework', 'coursework', $keynum ); continue;
@@ -171,7 +171,7 @@ public function process_csv($content, $encoding, $delimiter, $processingresults)
global $CFG, $DB, $PAGE;
- $assessor_identifier = $CFG->coursework_allocation_identifier;
+ $assessoridentifier = $CFG->coursework_allocation_identifier;
$iid = \csv_import_reader::get_new_iid('courseworkallocationsdata');
$csvreader = new \csv_import_reader($iid, 'courseworkallocationsdata');
@@ -196,10 +196,10 @@ public function process_csv($content, $encoding, $delimiter, $processingresults)
$csvreader->init();
$s = 0;
- $csv_cells = ['allocatable'];
+ $csvcells = ['allocatable'];
$stages = $this->coursework->get_max_markers();
for ($i = 1; $i <= $stages; $i++) {
- $csv_cells[] = 'assessor_'.$i;
+ $csvcells[] = 'assessor_'.$i;
}
while ($line = $csvreader->next()) {
@@ -210,9 +210,9 @@ public function process_csv($content, $encoding, $delimiter, $processingresults)
continue;
}
- $cells = $csv_cells;
+ $cells = $csvcells;
- if (count($line) != count($csv_cells)) {
+ if (count($line) != count($csvcells)) {
$errors = get_string('incorrectfileformat', 'coursework'); break;
}
@@ -225,7 +225,7 @@ public function process_csv($content, $encoding, $delimiter, $processingresults)
if ($cells[$keynum] == 'allocatable') {
if ($allocatabletype == 'user') {
// get user id
- $suballocatable = $DB->get_record('user', [$assessor_identifier => $value]);
+ $suballocatable = $DB->get_record('user', [$assessoridentifier => $value]);
$allocatable = ($suballocatable) ? \mod_coursework\models\user::find($suballocatable->id) : '';
} else {
// get group id
@@ -236,7 +236,7 @@ public function process_csv($content, $encoding, $delimiter, $processingresults)
}
if (substr($cells[$keynum], 0, 8) == 'assessor' && !(empty($value))) {
- $assessor = $DB->get_record('user', [$assessor_identifier => $value]);
+ $assessor = $DB->get_record('user', [$assessoridentifier => $value]);
$params = ['courseworkid' => $this->coursework->id,
'allocatableid' => $allocatable->id,
@@ -280,19 +280,19 @@ 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, $stageidentifier, $allocatable) {
global $DB;
- $add_allocation = new \stdClass();
- $add_allocation->id = '';
- $add_allocation->courseworkid = $this->coursework->id;
- $add_allocation->assessorid = $assessorid;
- $add_allocation->manual = 1;
- $add_allocation->stage_identifier = $stage_identifier;
- $add_allocation->allocatableid = $allocatable->id();
- $add_allocation->allocatabletype = $allocatable->type();
+ $addallocation = new \stdClass();
+ $addallocation->id = '';
+ $addallocation->courseworkid = $this->coursework->id;
+ $addallocation->assessorid = $assessorid;
+ $addallocation->manual = 1;
+ $addallocation->stage_identifier = $stageidentifier;
+ $addallocation->allocatableid = $allocatable->id();
+ $addallocation->allocatabletype = $allocatable->type();
- $allocationid = $DB->insert_record('coursework_allocation_pairs', $add_allocation, true);
+ $allocationid = $DB->insert_record('coursework_allocation_pairs', $addallocation, true);
return $allocationid;
@@ -308,12 +308,12 @@ public function add_allocation($assessorid, $stage_identifier, $allocatable) {
public function update_allocation($allocationid, $assessorid) {
global $DB;
- $update_allocation = new \stdClass();
- $update_allocation->id = $allocationid;
- $update_allocation->manual = 1;
- $update_allocation->assessorid = $assessorid;
+ $updateallocation = new \stdClass();
+ $updateallocation->id = $allocationid;
+ $updateallocation->manual = 1;
+ $updateallocation->assessorid = $assessorid;
- $update = $DB->update_record('coursework_allocation_pairs', $update_allocation);
+ $update = $DB->update_record('coursework_allocation_pairs', $updateallocation);
return $update;
}
diff --git a/classes/assessor_feedback_table.php b/classes/assessor_feedback_table.php
index 2676e3f3..936ed26f 100644
--- a/classes/assessor_feedback_table.php
+++ b/classes/assessor_feedback_table.php
@@ -80,8 +80,8 @@ public function get_renderable_feedback_rows() {
$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;
+ $renderablerow = new assessor_feedback_row($stage, $this->get_allocatable(), $this->coursework);
+ $feedbackobjects[] = $renderablerow;
}
return $feedbackobjects;
diff --git a/classes/auto_grader/average_grade.php b/classes/auto_grader/average_grade.php
index 1b309537..7645a998 100644
--- a/classes/auto_grader/average_grade.php
+++ b/classes/auto_grader/average_grade.php
@@ -78,9 +78,9 @@ public function create_auto_grade_if_rules_match() {
$this->create_final_feedback();
} else {
// update only if AgreedGrade has been automatic
- $agreed_feedback = $this->get_allocatable()->get_agreed_feedback($this->get_coursework());
- if ($agreed_feedback->timecreated == $agreed_feedback->timemodified || $agreed_feedback->lasteditedbyuser == 0) {
- $this->update_final_feedback($agreed_feedback);
+ $agreedfeedback = $this->get_allocatable()->get_agreed_feedback($this->get_coursework());
+ if ($agreedfeedback->timecreated == $agreedfeedback->timemodified || $agreedfeedback->lasteditedbyuser == 0) {
+ $this->update_final_feedback($agreedfeedback);
}
}
@@ -146,12 +146,12 @@ private function create_final_feedback() {
private function update_final_feedback($feedback) {
global $DB;
- $updated_feedback = new \stdClass();
- $updated_feedback->id = $feedback->id;
- $updated_feedback->grade = $this->automatic_grade();
- $updated_feedback->lasteditedbyuser = 0;
+ $updatedfeedback = new \stdClass();
+ $updatedfeedback->id = $feedback->id;
+ $updatedfeedback->grade = $this->automatic_grade();
+ $updatedfeedback->lasteditedbyuser = 0;
- $DB->update_record('coursework_feedbacks', $updated_feedback);
+ $DB->update_record('coursework_feedbacks', $updatedfeedback);
}
@@ -159,11 +159,11 @@ private function update_final_feedback($feedback) {
* @return array
*/
private function grades_as_percentages() {
- $initial_feedbacks = $this->get_allocatable()->get_initial_feedbacks($this->get_coursework());
+ $initialfeedbacks = $this->get_allocatable()->get_initial_feedbacks($this->get_coursework());
$grades = array_map(function ($feedback) {
return ($feedback->get_grade() / $this->get_coursework()->get_max_grade()) * 100;
},
- $initial_feedbacks);
+ $initialfeedbacks);
return $grades;
}
}
diff --git a/classes/auto_grader/percentage_distance.php b/classes/auto_grader/percentage_distance.php
index ab4645d5..850823a3 100644
--- a/classes/auto_grader/percentage_distance.php
+++ b/classes/auto_grader/percentage_distance.php
@@ -80,9 +80,9 @@ public function create_auto_grade_if_rules_match() {
$this->create_final_feedback();
} else {
// update only if AgreedGrade has been automatic
- $agreed_feedback = $this->get_allocatable()->get_agreed_feedback($this->get_coursework());
- if ($agreed_feedback->timecreated == $agreed_feedback->timemodified || $agreed_feedback->lasteditedbyuser == 0) {
- $this->update_final_feedback($agreed_feedback);
+ $agreedfeedback = $this->get_allocatable()->get_agreed_feedback($this->get_coursework());
+ if ($agreedfeedback->timecreated == $agreedfeedback->timemodified || $agreedfeedback->lasteditedbyuser == 0) {
+ $this->update_final_feedback($agreedfeedback);
}
}
@@ -113,10 +113,10 @@ private function automatic_grade() {
private function grades_are_close_enough() {
// test if the rules apply
$grades = $this->grades_as_percentages();
- $max_grade = max($grades);
- $min_grade = min($grades);
+ $maxgrade = max($grades);
+ $mingrade = min($grades);
- return ($max_grade - $min_grade) <= $this->percentage;
+ return ($maxgrade - $mingrade) <= $this->percentage;
}
/**
@@ -144,12 +144,12 @@ private function create_final_feedback() {
private function update_final_feedback($feedback) {
global $DB;
- $updated_feedback = new \stdClass();
- $updated_feedback->id = $feedback->id;
- $updated_feedback->grade = $this->automatic_grade();
- $updated_feedback->lasteditedbyuser = 0;
+ $updatedfeedback = new \stdClass();
+ $updatedfeedback->id = $feedback->id;
+ $updatedfeedback->grade = $this->automatic_grade();
+ $updatedfeedback->lasteditedbyuser = 0;
- $DB->update_record('coursework_feedbacks', $updated_feedback);
+ $DB->update_record('coursework_feedbacks', $updatedfeedback);
}
@@ -157,11 +157,11 @@ private function update_final_feedback($feedback) {
* @return array
*/
private function grades_as_percentages() {
- $initial_feedbacks = $this->get_allocatable()->get_initial_feedbacks($this->get_coursework());
+ $initialfeedbacks = $this->get_allocatable()->get_initial_feedbacks($this->get_coursework());
$grades = array_map(function ($feedback) {
return ($feedback->get_grade() / $this->get_coursework()->get_max_grade()) * 100;
},
- $initial_feedbacks);
+ $initialfeedbacks);
return $grades;
}
}
diff --git a/classes/controllers/controller_base.php b/classes/controllers/controller_base.php
index 5aa00a96..2eb8e0eb 100644
--- a/classes/controllers/controller_base.php
+++ b/classes/controllers/controller_base.php
@@ -104,10 +104,10 @@ protected function prepare_environment() {
// if there's an id, lets's assume it's an edit or update and we should just get the main model
if (!empty($this->params['id'])) {
- $model_class = $this->model_class();
- $model_name = $this->model_name();
- $this->$model_name = $model_class::find($this->params['id']);
- $this->coursework = $this->$model_name->get_coursework();
+ $modelclass = $this->model_class();
+ $modelname = $this->model_name();
+ $this->$modelname = $modelclass::find($this->params['id']);
+ $this->coursework = $this->$modelname->get_coursework();
}
if (!empty($this->params['courseworkid'])) {
@@ -168,14 +168,14 @@ protected function prepare_environment() {
* @param $arguments
* @throws coding_exception
*/
- public function __call($method_name, $arguments) {
+ public function __call($methodname, $arguments) {
- if (method_exists($this, $method_name)) {
+ if (method_exists($this, $methodname)) {
$this->prepare_environment();
call_user_func([$this,
- $method_name]);
+ $methodname]);
} else {
- throw new coding_exception('No page defined in the controller called "'.$method_name.'"');
+ throw new coding_exception('No page defined in the controller called "'.$methodname.'"');
}
}
@@ -193,7 +193,7 @@ protected function get_context() {
* @param $items
* @return string
*/
- protected function get_path($path_name, $items) {
+ protected function get_path($pathname, $items) {
return call_user_func_array([$this->get_router(), 'get_path'], func_get_args());
@@ -228,11 +228,11 @@ protected function get_page_renderer() {
/**
* @param string $page_name
*/
- protected function render_page($page_name) {
- $renderer_class = $this->renderer_class();
- $renderer = new $renderer_class;
- $function_name = $page_name . '_page';
- $renderer->$function_name(get_object_vars($this));
+ protected function render_page($pagename) {
+ $rendererclass = $this->renderer_class();
+ $renderer = new $rendererclass;
+ $functionname = $pagename . '_page';
+ $renderer->$functionname(get_object_vars($this));
$this->page_rendered = true;
}
@@ -240,10 +240,10 @@ protected function render_page($page_name) {
* @return string
*/
public function model_name() {
- $class_name = get_class($this);
- $bits = explode('\\', $class_name);
- $controller_name = end($bits);
- return str_replace('s_controller', '', $controller_name);
+ $classname = get_class($this);
+ $bits = explode('\\', $classname);
+ $controllername = end($bits);
+ return str_replace('s_controller', '', $controllername);
}
/**
@@ -260,15 +260,15 @@ protected function cancel_button_was_pressed() {
* @return table_base
*/
protected function model_class() {
- $renderer_class_name = "\\mod_coursework\\models\\{$this->model_name()}";
- return $renderer_class_name;
+ $rendererclassname = "\\mod_coursework\\models\\{$this->model_name()}";
+ return $rendererclassname;
}
/**
* @return string
*/
protected function renderer_class() {
- $renderer_class_name = "\\mod_coursework\\renderers\\{$this->model_name()}_renderer";
- return $renderer_class_name;
+ $rendererclassname = "\\mod_coursework\\renderers\\{$this->model_name()}_renderer";
+ return $rendererclassname;
}
}
diff --git a/classes/controllers/deadline_extensions_controller.php b/classes/controllers/deadline_extensions_controller.php
index 19ddd679..cf3634b0 100644
--- a/classes/controllers/deadline_extensions_controller.php
+++ b/classes/controllers/deadline_extensions_controller.php
@@ -61,9 +61,9 @@ protected function new_deadline_extension() {
$ability->require_can('new', $this->deadline_extension);
$PAGE->set_url('/mod/coursework/actions/deadline_extensions/new.php', $params);
- $create_url = $this->get_router()->get_path('create deadline extension');
+ $createurl = $this->get_router()->get_path('create deadline extension');
- $this->form = new deadline_extension_form($create_url, ['coursework' => $this->coursework]);
+ $this->form = new deadline_extension_form($createurl, ['coursework' => $this->coursework]);
$this->form->set_data($this->deadline_extension);
$this->render_page('new');
@@ -73,11 +73,11 @@ protected function new_deadline_extension() {
protected function create_deadline_extension() {
global $USER;
- $create_url = $this->get_router()->get_path('create deadline extension');
- $this->form = new deadline_extension_form($create_url, ['coursework' => $this->coursework]);
- $coursework_page_url = $this->get_path('coursework', ['coursework' => $this->coursework]);
+ $createurl = $this->get_router()->get_path('create deadline extension');
+ $this->form = new deadline_extension_form($createurl, ['coursework' => $this->coursework]);
+ $courseworkpageurl = $this->get_path('coursework', ['coursework' => $this->coursework]);
if ($this->cancel_button_was_pressed()) {
- redirect($coursework_page_url);
+ redirect($courseworkpageurl);
}
/**
* @var deadline_extension $deadline_extension
@@ -92,7 +92,7 @@ protected function create_deadline_extension() {
$ability->require_can('create', $this->deadline_extension);
$this->deadline_extension->save();
- redirect($coursework_page_url);
+ redirect($courseworkpageurl);
} else {
$this->set_default_current_deadline();
$this->render_page('new');
@@ -112,9 +112,9 @@ protected function edit_deadline_extension() {
$ability->require_can('edit', $this->deadline_extension);
$PAGE->set_url('/mod/coursework/actions/deadline_extensions/edit.php', $params);
- $update_url = $this->get_router()->get_path('update deadline extension');
+ $updateurl = $this->get_router()->get_path('update deadline extension');
- $this->form = new deadline_extension_form($update_url, ['coursework' => $this->coursework]);
+ $this->form = new deadline_extension_form($updateurl, ['coursework' => $this->coursework]);
$this->deadline_extension->extra_information = [
'text' => $this->deadline_extension->extra_information_text,
'format' => $this->deadline_extension->extra_information_format,
@@ -127,11 +127,11 @@ protected function edit_deadline_extension() {
protected function update_deadline_extension() {
global $USER;
- $update_url = $this->get_router()->get_path('update deadline extension');
- $this->form = new deadline_extension_form($update_url, ['coursework' => $this->coursework]);
- $coursework_page_url = $this->get_path('coursework', ['coursework' => $this->coursework]);
+ $updateurl = $this->get_router()->get_path('update deadline extension');
+ $this->form = new deadline_extension_form($updateurl, ['coursework' => $this->coursework]);
+ $courseworkpageurl = $this->get_path('coursework', ['coursework' => $this->coursework]);
if ($this->cancel_button_was_pressed()) {
- redirect($coursework_page_url);
+ redirect($courseworkpageurl);
}
/**
* @var deadline_extension $deadline_extension
@@ -145,7 +145,7 @@ protected function update_deadline_extension() {
$values->extra_information_text = $values->extra_information['text'];
$values->extra_information_format = $values->extra_information['format'];
$this->deadline_extension->update_attributes($values);
- redirect($coursework_page_url);
+ redirect($courseworkpageurl);
} else {
$this->render_page('edit');
}
@@ -167,9 +167,9 @@ protected function set_default_current_deadline() {
// Default to current deadline
// check for personal deadline first o
if ($this->coursework->personaldeadlineenabled) {
- $personal_deadline = $DB->get_record('coursework_person_deadlines', $params);
- if ($personal_deadline) {
- $this->coursework->deadline = $personal_deadline->personal_deadline;
+ $personaldeadline = $DB->get_record('coursework_person_deadlines', $params);
+ if ($personaldeadline) {
+ $this->coursework->deadline = $personaldeadline->personal_deadline;
}
}
$this->deadline_extension->extended_deadline = $this->coursework->deadline;
@@ -179,9 +179,9 @@ protected function set_default_current_deadline() {
/**
* Begin Ajax functions
*/
- public function ajax_submit_mitigation($data_params) {
+ public function ajax_submit_mitigation($dataparams) {
global $USER, $OUTPUT;
- $extended_deadline = false;
+ $extendeddeadline = false;
$response = [];
$this->coursework = coursework::find(['id' => $this->params['courseworkid']]);
$cm = get_coursemodule_from_instance(
@@ -190,8 +190,8 @@ public function ajax_submit_mitigation($data_params) {
require_login($this->coursework->course, false, $cm);
$params = $this->set_default_current_deadline();
$ability = new ability(user::find($USER), $this->coursework);
- $errors = $this->validation($data_params);
- $data = (object) $data_params;
+ $errors = $this->validation($dataparams);
+ $data = (object) $dataparams;
if (!$errors) {
if ($data->id > 0) {
$this->deadline_extension = deadline_extension::find(['id' => $data->id]);
@@ -202,14 +202,14 @@ public function ajax_submit_mitigation($data_params) {
$this->deadline_extension = deadline_extension::build($data);
$ability->require_can('new', $this->deadline_extension);
$this->deadline_extension->save();
- $data_params['id'] = $this->deadline_extension->id;
+ $dataparams['id'] = $this->deadline_extension->id;
}
- $content = $this->table_cell_response($data_params);
+ $content = $this->table_cell_response($dataparams);
$response = [
'error' => 0,
- 'data' => $data_params,
+ 'data' => $dataparams,
'content' => $content,
];
echo json_encode($response);
@@ -225,10 +225,10 @@ public function ajax_submit_mitigation($data_params) {
public function validation($data) {
global $CFG;
- $max_deadline = $CFG->coursework_max_extension_deadline;
+ $maxdeadline = $CFG->coursework_max_extension_deadline;
- if ($this->coursework->personaldeadlineenabled && $personal_deadline = $this->personal_deadline()) {
- $deadline = $personal_deadline->personal_deadline;
+ if ($this->coursework->personaldeadlineenabled && $personaldeadline = $this->personal_deadline()) {
+ $deadline = $personaldeadline->personal_deadline;
} else {
$deadline = $this->coursework->deadline;
}
@@ -273,13 +273,13 @@ public function personal_deadline() {
'courseworkid' => $courseworkid ?? 0,
];
- return $personal_deadline = $DB->get_record('coursework_person_deadlines', $params);
+ return $personaldeadline = $DB->get_record('coursework_person_deadlines', $params);
}
- public function ajax_edit_mitigation($data_params) {
+ public function ajax_edit_mitigation($dataparams) {
global $USER;
$response = [];
- if ($data_params['id'] > 0) {
+ if ($dataparams['id'] > 0) {
$this->coursework = coursework::find(['id' => $this->params['courseworkid']]);
$cm = get_coursemodule_from_instance(
'coursework', $this->coursework->id, 0, false, MUST_EXIST
@@ -287,42 +287,42 @@ public function ajax_edit_mitigation($data_params) {
require_login($this->coursework->course, false, $cm);
$ability = new ability(user::find($USER), $this->coursework);
- $deadline_extension = deadline_extension::find(['id' => $data_params['id']]);
- if (empty($deadline_extension)) {
+ $deadlineextension = deadline_extension::find(['id' => $dataparams['id']]);
+ if (empty($deadlineextension)) {
$response = [
'error' => 1,
'message' => 'This Deadline Extension does not exist!',
];
} else {
- $ability->require_can('edit', $deadline_extension);
- $time_content = '';
+ $ability->require_can('edit', $deadlineextension);
+ $timecontent = '';
$time = '';
- if ($this->coursework->personaldeadlineenabled && $personal_deadline = $this->personal_deadline()) {
- $time_content = 'Personal deadline: ' . userdate($personal_deadline->personal_deadline);
- $time = date('d-m-Y H:i', $personal_deadline->personal_deadline);
+ if ($this->coursework->personaldeadlineenabled && $personaldeadline = $this->personal_deadline()) {
+ $timecontent = 'Personal deadline: ' . userdate($personaldeadline->personal_deadline);
+ $time = date('d-m-Y H:i', $personaldeadline->personal_deadline);
} else if ($this->coursework->deadline) {
// Current deadline for comparison
- $time_content = 'Default deadline: ' . userdate($this->coursework->deadline);
+ $timecontent = 'Default deadline: ' . userdate($this->coursework->deadline);
$time = date('d-m-Y H:i', $this->coursework->deadline);
}
- if (!empty($deadline_extension->extended_deadline) && $deadline_extension->extended_deadline > 0) {
- $time = date('d-m-Y H:i', $deadline_extension->extended_deadline);
+ if (!empty($deadlineextension->extended_deadline) && $deadlineextension->extended_deadline > 0) {
+ $time = date('d-m-Y H:i', $deadlineextension->extended_deadline);
}
- $deadline_extension_transform = [
- 'time_content' => $time_content,
+ $deadlineextensiontransform = [
+ 'time_content' => $timecontent,
'time' => $time,
- 'text' => $deadline_extension->extra_information_text,
- 'allocatableid' => $deadline_extension->allocatableid,
- 'allocatabletype' => $deadline_extension->allocatabletype,
- 'courseworkid' => $deadline_extension->courseworkid,
- 'id' => $deadline_extension->id,
- 'pre_defined_reason' => $deadline_extension->pre_defined_reason,
+ 'text' => $deadlineextension->extra_information_text,
+ 'allocatableid' => $deadlineextension->allocatableid,
+ 'allocatabletype' => $deadlineextension->allocatabletype,
+ 'courseworkid' => $deadlineextension->courseworkid,
+ 'id' => $deadlineextension->id,
+ 'pre_defined_reason' => $deadlineextension->pre_defined_reason,
];
$response = [
'error' => 0,
- 'data' => $deadline_extension_transform,
+ 'data' => $deadlineextensiontransform,
];
}
} else {
@@ -334,7 +334,7 @@ public function ajax_edit_mitigation($data_params) {
echo json_encode($response);
}
- public function ajax_new_mitigation($data_params) {
+ public function ajax_new_mitigation($dataparams) {
global $USER, $DB;
$response = [];
$this->coursework = coursework::find(['id' => $this->params['courseworkid']]);
@@ -350,30 +350,30 @@ public function ajax_new_mitigation($data_params) {
];
$ability = new ability(user::find($USER), $this->coursework);
- $deadline_extension = deadline_extension::build($params);
- $ability->require_can('new', $deadline_extension);
- $time_content = '';
+ $deadlineextension = deadline_extension::build($params);
+ $ability->require_can('new', $deadlineextension);
+ $timecontent = '';
$time = '';
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);
+ $personaldeadline = $DB->get_record('coursework_person_deadlines', $params);
+ if ($personaldeadline) {
+ $timecontent = 'Personal deadline: ' . userdate($personaldeadline->personal_deadline);
// $this->coursework->deadline = $personal_deadline->personal_deadline;
- $time = date('d-m-Y H:i', $personal_deadline->personal_deadline);
+ $time = date('d-m-Y H:i', $personaldeadline->personal_deadline);
} else {
- $time_content = 'Default deadline: ' . userdate($this->coursework->deadline);
+ $timecontent = 'Default deadline: ' . userdate($this->coursework->deadline);
$time = date('d-m-Y H:i', $this->coursework->deadline);
}
}
- $deadline_extension_transform = [
- 'time_content' => $time_content,
+ $deadlineextensiontransform = [
+ 'time_content' => $timecontent,
'time' => $time,
];
$response = [
'error' => 0,
- 'data' => $deadline_extension_transform,
+ 'data' => $deadlineextensiontransform,
];
echo json_encode($response);
@@ -388,18 +388,18 @@ public function ajax_new_mitigation($data_params) {
*
*/
- public function table_cell_response($data_params) {
- $participant = ($data_params['allocatabletype'] && $data_params['allocatabletype'] == 'group') ? group::find($data_params['allocatableid']) : user::find($data_params['allocatableid']);
+ public function table_cell_response($dataparams) {
+ $participant = ($dataparams['allocatabletype'] && $dataparams['allocatabletype'] == 'group') ? group::find($dataparams['allocatableid']) : user::find($dataparams['allocatableid']);
$coursework = ($this->coursework instanceof coursework_groups_decorator) ? $this->coursework->wrapped_object() : $this->coursework;
if ($this->coursework->has_multiple_markers()) {
- $row_object = new \mod_coursework\grading_table_row_multi($coursework, $participant);
+ $rowobject = new \mod_coursework\grading_table_row_multi($coursework, $participant);
} else {
- $row_object = new \mod_coursework\grading_table_row_single($coursework, $participant);
+ $rowobject = new \mod_coursework\grading_table_row_single($coursework, $participant);
}
- $time_submitted_cell = new \mod_coursework\render_helpers\grading_report\cells\time_submitted_cell(['coursework' => $this->coursework]);
+ $timesubmittedcell = new \mod_coursework\render_helpers\grading_report\cells\time_submitted_cell(['coursework' => $this->coursework]);
- $content = $time_submitted_cell->prepare_content_cell($row_object);
+ $content = $timesubmittedcell->prepare_content_cell($rowobject);
return $content;
}
diff --git a/classes/controllers/grading_controller.php b/classes/controllers/grading_controller.php
index b3a39bf5..481e4c39 100644
--- a/classes/controllers/grading_controller.php
+++ b/classes/controllers/grading_controller.php
@@ -33,21 +33,21 @@ class grading_controller extends controller_base {
public function get_remain_rows_grading_table($options) {
global $DB, $PAGE;
- $coursework_record = $DB->get_record('coursework', ['id' => $options['courseworkid']], '*', MUST_EXIST);
+ $courseworkrecord = $DB->get_record('coursework', ['id' => $options['courseworkid']], '*', MUST_EXIST);
//$coursework = mod_coursework\models\coursework::find($coursework_record);
- $coursework = coursework::find($coursework_record, false);
+ $coursework = coursework::find($courseworkrecord, false);
$coursework->coursemodule = get_coursemodule_from_instance('coursework', $coursework->id, $coursework->course, false, MUST_EXIST);
require_login($coursework->course, false, $coursework->coursemodule);
- $grading_report = $coursework->renderable_grading_report_factory($options);
+ $gradingreport = $coursework->renderable_grading_report_factory($options);
- $tablerows = $grading_report->get_table_rows_for_page();
- $cell_helpers = $grading_report->get_cells_helpers();
- $sub_row_helper = $grading_report->get_sub_row_helper();
+ $tablerows = $gradingreport->get_table_rows_for_page();
+ $cellhelpers = $gradingreport->get_cells_helpers();
+ $subrowhelper = $gradingreport->get_sub_row_helper();
- $grading_report_renderer = $PAGE->get_renderer('mod_coursework', 'grading_report');
- $table_html = $grading_report_renderer->make_rows($tablerows, $cell_helpers, $sub_row_helper, $coursework->has_multiple_markers());
- return $table_html;
+ $gradingreportrenderer = $PAGE->get_renderer('mod_coursework', 'grading_report');
+ $tablehtml = $gradingreportrenderer->make_rows($tablerows, $cellhelpers, $subrowhelper, $coursework->has_multiple_markers());
+ return $tablehtml;
}
}
diff --git a/classes/controllers/moderations_controller.php b/classes/controllers/moderations_controller.php
index 18f771ce..da151a93 100644
--- a/classes/controllers/moderations_controller.php
+++ b/classes/controllers/moderations_controller.php
@@ -62,27 +62,27 @@ protected function new_moderation() {
global $PAGE, $USER;
- $moderator_agreement = new moderation();
- $moderator_agreement->submissionid = $this->params['submissionid'];
- $moderator_agreement->moderatorid = $this->params['moderatorid'];
- $moderator_agreement->stage_identifier = $this->params['stage_identifier'];
- $moderator_agreement->courseworkid = $this->params['courseworkid'];
- $moderator_agreement->feedbackid = $this->params['feedbackid'];
+ $moderatoragreement = new moderation();
+ $moderatoragreement->submissionid = $this->params['submissionid'];
+ $moderatoragreement->moderatorid = $this->params['moderatorid'];
+ $moderatoragreement->stage_identifier = $this->params['stage_identifier'];
+ $moderatoragreement->courseworkid = $this->params['courseworkid'];
+ $moderatoragreement->feedbackid = $this->params['feedbackid'];
$ability = new ability(user::find($USER), $this->coursework);
- $ability->require_can('new', $moderator_agreement);
+ $ability->require_can('new', $moderatoragreement);
$this->check_stage_permissions($this->params['stage_identifier']);
$urlparams = [];
- $urlparams['submissionid'] = $moderator_agreement->submissionid;
- $urlparams['moderatorid'] = $moderator_agreement->moderatorid;
- $urlparams['stage_identifier'] = $moderator_agreement->stage_identifier;
- $urlparams['feedbackid'] = $moderator_agreement->feedbackid;
+ $urlparams['submissionid'] = $moderatoragreement->submissionid;
+ $urlparams['moderatorid'] = $moderatoragreement->moderatorid;
+ $urlparams['stage_identifier'] = $moderatoragreement->stage_identifier;
+ $urlparams['feedbackid'] = $moderatoragreement->feedbackid;
$PAGE->set_url('/mod/coursework/actions/moderations/new.php', $urlparams);
$renderer = $this->get_page_renderer();
- $renderer->new_moderation_page($moderator_agreement);
+ $renderer->new_moderation_page($moderatoragreement);
}
@@ -132,12 +132,12 @@ protected function create_moderation() {
$moderatoragreement->feedbackid = $this->params['feedbackid'];
$submission = submission::find($this->params['submissionid']);
- $path_params = [
+ $pathparams = [
'submission' => $submission,
'moderator' => \core_user::get_user($this->params['moderatorid']),
'stage' => 'moderator',
];
- $url = $this->get_router()->get_path('new moderation', $path_params, true);
+ $url = $this->get_router()->get_path('new moderation', $pathparams, true);
$PAGE->set_url($url);
$ability = new ability(user::find($USER), $this->coursework);
@@ -145,9 +145,9 @@ protected function create_moderation() {
$form = new moderator_agreement_mform(null, ['moderation' => $moderatoragreement]);
- $coursework_page_url = $this->get_path('coursework', ['coursework' => $moderatoragreement->get_coursework()]);
+ $courseworkpageurl = $this->get_path('coursework', ['coursework' => $moderatoragreement->get_coursework()]);
if ($form->is_cancelled()) {
- redirect($coursework_page_url);
+ redirect($courseworkpageurl);
}
$data = $form->get_data();
@@ -156,7 +156,7 @@ protected function create_moderation() {
$moderatoragreement = $form->process_data($moderatoragreement);
$moderatoragreement->save();
- redirect($coursework_page_url);
+ redirect($courseworkpageurl);
} else {
$renderer = $this->get_page_renderer();
$renderer->new_moderation_page($moderatoragreement);
@@ -180,15 +180,15 @@ protected function update_moderation() {
$form = new moderator_agreement_mform(null, ['moderation' => $moderatoragreement]);
- $coursework_page_url = $this->get_path('coursework', ['coursework' => $moderatoragreement->get_coursework()]);
+ $courseworkpageurl = $this->get_path('coursework', ['coursework' => $moderatoragreement->get_coursework()]);
if ($form->is_cancelled()) {
- redirect($coursework_page_url);
+ redirect($courseworkpageurl);
}
$moderatoragreement = $form->process_data($moderatoragreement);
$moderatoragreement->save();
- redirect($coursework_page_url);
+ redirect($courseworkpageurl);
}
/**
diff --git a/classes/controllers/personal_deadlines_controller.php b/classes/controllers/personal_deadlines_controller.php
index 63842e27..969556e2 100644
--- a/classes/controllers/personal_deadlines_controller.php
+++ b/classes/controllers/personal_deadlines_controller.php
@@ -42,7 +42,7 @@ 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', ['coursework' => $this->coursework]) :
+ $courseworkpageurl = (empty($this->params['setpersonaldeadlinespage'])) ? $this->get_path('coursework', ['coursework' => $this->coursework]) :
$this->get_path('set personal deadlines', ['coursework' => $this->coursework]);
$params = $this->set_default_current_deadline();
@@ -54,9 +54,9 @@ protected function new_personal_deadline() {
: serialize($params['allocatableid']);
$PAGE->set_url('/mod/coursework/actions/personal_deadline/new.php', $params);
- $create_url = $this->get_router()->get_path('edit personal deadline');
+ $createurl = $this->get_router()->get_path('edit personal deadline');
- $this->form = new personal_deadline_form($create_url, ['coursework' => $this->coursework]);
+ $this->form = new personal_deadline_form($createurl, ['coursework' => $this->coursework]);
$this->personal_deadline->setpersonaldeadlinespage = $this->params['setpersonaldeadlinespage'];
$this->personal_deadline->multipleuserdeadlines = $this->params['multipleuserdeadlines'];
@@ -64,7 +64,7 @@ protected function new_personal_deadline() {
$this->personal_deadline->allocatableid = $params['allocatableid'];
$this->form->set_data($this->personal_deadline);
if ($this->cancel_button_was_pressed()) {
- redirect($coursework_page_url);
+ redirect($courseworkpageurl);
}
if ($this->form->is_validated()) {
@@ -113,7 +113,7 @@ protected function new_personal_deadline() {
}
}
- redirect($coursework_page_url);
+ redirect($courseworkpageurl);
}
$this->render_page('new');
diff --git a/classes/controllers/plagiarism_flagging_controller.php b/classes/controllers/plagiarism_flagging_controller.php
index 6253f195..06641e3b 100644
--- a/classes/controllers/plagiarism_flagging_controller.php
+++ b/classes/controllers/plagiarism_flagging_controller.php
@@ -51,7 +51,7 @@ class plagiarism_flagging_controller extends controller_base {
/**
* @var plagiarism_flag
*/
- protected $plagiarism_flag;
+ protected $plagiarismflag;
/**
* This deals with the page that the assessors see when they want to add component feedbacks.
@@ -88,23 +88,23 @@ protected function edit_plagiarism_flag() {
global $DB, $PAGE, $USER;
- $plagiarism_flag = new plagiarism_flag($this->params['flagid']);
+ $plagiarismflag = new plagiarism_flag($this->params['flagid']);
$ability = new ability(user::find($USER), $this->coursework);
- $ability->require_can('edit', $plagiarism_flag);
+ $ability->require_can('edit', $plagiarismflag);
$urlparams = ['flagid' => $this->params['flagid']];
$PAGE->set_url('/mod/coursework/actions/plagiarism_flagging/edit.php', $urlparams);
- $creator = $DB->get_record('user', ['id' => $plagiarism_flag->createdby]);
- if (!empty($plagiarism_flag->lastmodifiedby)) {
- $editor = $DB->get_record('user', ['id' => $plagiarism_flag->lastmodifiedby]);
+ $creator = $DB->get_record('user', ['id' => $plagiarismflag->createdby]);
+ if (!empty($plagiarismflag->lastmodifiedby)) {
+ $editor = $DB->get_record('user', ['id' => $plagiarismflag->lastmodifiedby]);
} else {
$editor = $creator;
}
$renderer = $this->get_page_renderer();
- $renderer->edit_plagiarism_flag_page($plagiarism_flag, $creator, $editor);
+ $renderer->edit_plagiarism_flag_page($plagiarismflag, $creator, $editor);
}
/**
@@ -120,8 +120,8 @@ protected function create_plagiarism_flag() {
$plagiarismflag->createdby = $USER->id;
$submission = submission::find($this->params['submissionid']);
- $path_params = ['submission' => $submission];
- $url = $this->get_router()->get_path('new plagiarism flag', $path_params, true);
+ $pathparams = ['submission' => $submission];
+ $url = $this->get_router()->get_path('new plagiarism flag', $pathparams, true);
$PAGE->set_url($url);
$ability = new ability(user::find($USER), $this->coursework);
@@ -129,9 +129,9 @@ protected function create_plagiarism_flag() {
$form = new plagiarism_flagging_mform(null, ['plagiarism_flag' => $plagiarismflag]);
- $coursework_page_url = $this->get_path('coursework', ['coursework' => $plagiarismflag->get_coursework()]);
+ $courseworkpageurl = $this->get_path('coursework', ['coursework' => $plagiarismflag->get_coursework()]);
if ($form->is_cancelled()) {
- redirect($coursework_page_url);
+ redirect($courseworkpageurl);
}
$data = $form->get_data();
@@ -140,7 +140,7 @@ protected function create_plagiarism_flag() {
$plagiarismflag = $form->process_data($plagiarismflag);
$plagiarismflag->save();
- redirect($coursework_page_url);
+ redirect($courseworkpageurl);
} else {
$renderer = $this->get_page_renderer();
$renderer->new_plagiarism_flag_page($plagiarismflag);
@@ -163,9 +163,9 @@ protected function update_plagiarism_flag() {
$form = new plagiarism_flagging_mform(null, ['plagiarism_flag' => $plagiarismflag]);
- $coursework_page_url = $this->get_path('coursework', ['coursework' => $plagiarismflag->get_coursework()]);
+ $courseworkpageurl = $this->get_path('coursework', ['coursework' => $plagiarismflag->get_coursework()]);
if ($form->is_cancelled()) {
- redirect($coursework_page_url);
+ redirect($courseworkpageurl);
}
$plagiarismflag = $form->process_data($plagiarismflag);
@@ -190,7 +190,7 @@ protected function update_plagiarism_flag() {
$plagiarismflag->save();
- redirect($coursework_page_url);
+ redirect($courseworkpageurl);
}
/**
@@ -200,11 +200,11 @@ protected function prepare_environment() {
global $DB;
if (!empty($this->params['flagid'])) {
- $plagiarism_flag = $DB->get_record('coursework_plagiarism_flags',
+ $plagiarismflag = $DB->get_record('coursework_plagiarism_flags',
['id' => $this->params['flagid']],
'*',
MUST_EXIST);
- $this->flag = new plagiarism_flag($plagiarism_flag);
+ $this->flag = new plagiarism_flag($plagiarismflag);
$this->params['courseworkid'] = $this->flag->get_coursework()->id;
}
diff --git a/classes/controllers/submissions_controller.php b/classes/controllers/submissions_controller.php
index 11a300bf..2d367e75 100644
--- a/classes/controllers/submissions_controller.php
+++ b/classes/controllers/submissions_controller.php
@@ -74,16 +74,16 @@ protected function new_submission() {
$PAGE->set_url('/mod/coursework/actions/submissions/new.php', $urlparams);
$path = $this->get_router()->get_path('create submission', ['coursework' => $this->coursework]);
- $submit_form = new student_submission_form($path,
+ $submitform = new student_submission_form($path,
[
'coursework' => $this->coursework,
'submission' => $submission,
]);
- if ($submit_form->is_submitted()) {
- $validation = $submit_form->validate_defined_fields();
+ if ($submitform->is_submitted()) {
+ $validation = $submitform->validate_defined_fields();
}
if ($validation != true) {
- $this->get_page_renderer()->new_submission_page($submit_form, $submission);
+ $this->get_page_renderer()->new_submission_page($submitform, $submission);
return true;
}
@@ -95,9 +95,9 @@ protected function new_submission() {
protected function create_submission() {
global $USER, $CFG, $DB;
- $coursework_page_url = $this->get_path('coursework', ['coursework' => $this->coursework]);
+ $courseworkpageurl = $this->get_path('coursework', ['coursework' => $this->coursework]);
if ($this->cancel_button_was_pressed()) {
- redirect($coursework_page_url);
+ redirect($courseworkpageurl);
}
$validated = $this->new_submission();
@@ -143,8 +143,8 @@ protected function create_submission() {
$submission->save();
- $files_id = file_get_submitted_draft_itemid('submission_manager');
- $submission->save_files($files_id);
+ $filesid = file_get_submitted_draft_itemid('submission_manager');
+ $submission->save_files($filesid);
$context = \context_module::instance($this->coursemodule->id);
// Trigger assessable_submitted event to show files are complete.
@@ -186,7 +186,7 @@ protected function create_submission() {
}
- redirect($coursework_page_url);
+ redirect($courseworkpageurl);
}
/**
@@ -212,19 +212,19 @@ protected function edit_submission() {
$PAGE->set_url('/mod/coursework/actions/submissions/edit.php', $urlparams);
$path = $this->get_router()->get_path('update submission', ['submission' => $submission]);
- $submit_form = new student_submission_form($path,
+ $submitform = new student_submission_form($path,
[
'coursework' => $this->coursework,
'submission' => $submission,
]);
- if ($submit_form->is_submitted()) {
- $validation = $submit_form->validate_defined_fields();
+ if ($submitform->is_submitted()) {
+ $validation = $submitform->validate_defined_fields();
}
- $submit_form->set_data($submission);
+ $submitform->set_data($submission);
if ($validation != true) {
- $this->get_page_renderer()->edit_submission_page($submit_form, $submission);
+ $this->get_page_renderer()->edit_submission_page($submitform, $submission);
return true;
}
}
@@ -236,9 +236,9 @@ protected function update_submission() {
global $USER, $CFG;
- $coursework_page_url = $this->get_path('coursework', ['coursework' => $this->coursework]);
+ $courseworkpageurl = $this->get_path('coursework', ['coursework' => $this->coursework]);
if ($this->cancel_button_was_pressed()) {
- redirect($coursework_page_url);
+ redirect($courseworkpageurl);
}
$validated = $this->edit_submission();
@@ -255,19 +255,19 @@ protected function update_submission() {
throw new access_denied($this->coursework, $ability->get_last_message());
}
- $notify_about_finalisation = false;
- $incoming_finalised_setting = $this->params['finalised'] ? 1 : 0;
- if ($incoming_finalised_setting == 1 && $submission->finalised == 0) {
- $notify_about_finalisation = true;
+ $notifyaboutfinalisation = false;
+ $incomingfinalisedsetting = $this->params['finalised'] ? 1 : 0;
+ if ($incomingfinalisedsetting == 1 && $submission->finalised == 0) {
+ $notifyaboutfinalisation = true;
}
- $submission->finalised = $incoming_finalised_setting;
+ $submission->finalised = $incomingfinalisedsetting;
$submission->lastupdatedby = $USER->id;
$submission->timesubmitted = time();
$submission->save();
- $files_id = file_get_submitted_draft_itemid('submission_manager');
- $submission->save_files($files_id);
+ $filesid = file_get_submitted_draft_itemid('submission_manager');
+ $submission->save_files($filesid);
$context = \context_module::instance($this->coursemodule->id);
// Trigger assessable_submitted event to show files are complete.
@@ -283,14 +283,14 @@ protected function update_submission() {
$submission->submit_plagiarism();
- if ($CFG->coursework_allsubmissionreceipt || $notify_about_finalisation) {
+ if ($CFG->coursework_allsubmissionreceipt || $notifyaboutfinalisation) {
$mailer = new mailer($this->coursework);
foreach ($submission->get_students() as $student) {
- $mailer->send_submission_receipt($student, $notify_about_finalisation);
+ $mailer->send_submission_receipt($student, $notifyaboutfinalisation);
}
}
- redirect($coursework_page_url);
+ redirect($courseworkpageurl);
}
@@ -301,9 +301,9 @@ protected function finalise_submission() {
global $USER;
- $coursework_page_url = $this->get_path('coursework', ['coursework' => $this->coursework]);
+ $courseworkpageurl = $this->get_path('coursework', ['coursework' => $this->coursework]);
if ($this->cancel_button_was_pressed()) {
- redirect($coursework_page_url);
+ redirect($courseworkpageurl);
}
$submission = submission::find($this->params['submissionid']);
@@ -322,7 +322,7 @@ protected function finalise_submission() {
$mailer->send_submission_receipt($student, true);
}
- redirect($coursework_page_url);
+ redirect($courseworkpageurl);
}
protected function unfinalise_submission() {
@@ -331,7 +331,7 @@ protected function unfinalise_submission() {
$allocatableids = (!is_array($this->params['allocatableid'])) ? [$this->params['allocatableid']] : $this->params['allocatableid'];
- $personaldeadline_page_url = new \moodle_url('/mod/coursework/actions/personal_deadline.php',
+ $personaldeadlinepageurl = new \moodle_url('/mod/coursework/actions/personal_deadline.php',
['id' => $this->coursework->get_coursemodule_id(), 'multipleuserdeadlines' => 1, 'setpersonaldeadlinespage' => 1,
'courseworkid' => $this->params['courseworkid'], 'allocatabletype' => $this->params['allocatabletype']]);
@@ -339,15 +339,15 @@ protected function unfinalise_submission() {
foreach ($allocatableids as $aid) {
- $submission_db = $DB->get_record('coursework_submissions',
+ $submissiondb = $DB->get_record('coursework_submissions',
['courseworkid' => $this->params['courseworkid'], 'allocatableid' => $aid, 'allocatabletype' => $this->params['allocatabletype']]);
- if (!empty($submission_db)) {
- $submission = \mod_coursework\models\submission::find($submission_db);
+ if (!empty($submissiondb)) {
+ $submission = \mod_coursework\models\submission::find($submissiondb);
if ($submission->can_be_unfinalised()) {
$submission->finalised = 0;
$submission->save();
- $personaldeadline_page_url->param("allocatableid_arr[$aid]", $aid);
+ $personaldeadlinepageurl->param("allocatableid_arr[$aid]", $aid);
$changedeadlines = true;
}
}
@@ -355,11 +355,11 @@ protected function unfinalise_submission() {
}
if (!empty($changedeadlines)) {
- redirect($personaldeadline_page_url, get_string('unfinalisedchangesubmissiondate', 'mod_coursework'));
+ redirect($personaldeadlinepageurl, get_string('unfinalisedchangesubmissiondate', 'mod_coursework'));
} else {
- $setpersonaldeadline_page_url = new \moodle_url('/mod/coursework/actions/set_personal_deadlines.php',
+ $setpersonaldeadlinepageurl = new \moodle_url('/mod/coursework/actions/set_personal_deadlines.php',
['id' => $this->coursework->get_coursemodule_id()]);
- redirect($setpersonaldeadline_page_url);
+ redirect($setpersonaldeadlinepageurl);
}
}
@@ -400,14 +400,14 @@ protected function check_coursework_is_open($coursework) {
* @throws late_submission
*/
private function exception_if_late($submission) {
- $could_have_submitted = has_capability('mod/coursework:submit', $this->coursework->get_context());
+ $couldhavesubmitted = has_capability('mod/coursework:submit', $this->coursework->get_context());
if ($this->coursework->personal_deadlines_enabled()) {
- $deadline_has_passed = !$this->has_valid_personal_deadline($submission);
+ $deadlinehaspassed = !$this->has_valid_personal_deadline($submission);
} else {
- $deadline_has_passed = $this->coursework->deadline_has_passed();
+ $deadlinehaspassed = $this->coursework->deadline_has_passed();
}
- if ($could_have_submitted && $deadline_has_passed && !$this->has_valid_extension($submission) && !$this->coursework->allow_late_submissions()) {
+ if ($couldhavesubmitted && $deadlinehaspassed && !$this->has_valid_extension($submission) && !$this->coursework->allow_late_submissions()) {
throw new late_submission($this->coursework);
}
}
@@ -419,12 +419,12 @@ private function exception_if_late($submission) {
protected function submissions_exists($submission) {
global $DB;
- $sub_exists = $DB->record_exists('coursework_submissions',
+ $subexists = $DB->record_exists('coursework_submissions',
['courseworkid' => $submission->courseworkid,
'allocatableid' => $submission->allocatableid,
'allocatabletype' => $submission->allocatabletype]);
- return $sub_exists;
+ return $subexists;
}
/**
@@ -434,7 +434,7 @@ protected function submissions_exists($submission) {
protected function has_valid_extension($submission) {
global $DB;
- $valid_extension = false;
+ $validextension = false;
$extension = $DB->get_record('coursework_extensions',
['courseworkid' => $submission->courseworkid,
'allocatableid' => $submission->allocatableid,
@@ -442,11 +442,11 @@ protected function has_valid_extension($submission) {
if ($extension) {
if ($extension->extended_deadline > time()) {
- $valid_extension = true;
+ $validextension = true;
}
}
- return $valid_extension;
+ return $validextension;
}
/**
@@ -456,18 +456,18 @@ protected function has_valid_extension($submission) {
protected function has_valid_personal_deadline($submission) {
global $DB;
- $valid_personal_deadline = false;
- $personal_deadline = $DB->get_record('coursework_person_deadlines',
+ $validpersonaldeadline = false;
+ $personaldeadline = $DB->get_record('coursework_person_deadlines',
['courseworkid' => $submission->courseworkid,
'allocatableid' => $submission->allocatableid,
'allocatabletype' => $submission->allocatabletype]);
- if ($personal_deadline) {
- if ($personal_deadline->personal_deadline > time()) {
- $valid_personal_deadline = true;
+ if ($personaldeadline) {
+ if ($personaldeadline->personal_deadline > time()) {
+ $validpersonaldeadline = true;
}
} else {
- $valid_personal_deadline = !$this->coursework->deadline_has_passed();
+ $validpersonaldeadline = !$this->coursework->deadline_has_passed();
}
- return $valid_personal_deadline;
+ return $validpersonaldeadline;
}
}
diff --git a/classes/cron.php b/classes/cron.php
index 049ade3f..c2ff9588 100644
--- a/classes/cron.php
+++ b/classes/cron.php
@@ -76,12 +76,12 @@ private static function send_reminders_to_students() {
$userswhoneedreminding = [];
- $raw_courseworks = $DB->get_records('coursework');
- foreach ($raw_courseworks as $raw_coursework) {
+ $rawcourseworks = $DB->get_records('coursework');
+ foreach ($rawcourseworks as $rawcoursework) {
/**
* @var coursework $coursework
*/
- $coursework = coursework::find($raw_coursework);
+ $coursework = coursework::find($rawcoursework);
if (!$coursework || !$coursework->is_coursework_visible()) {// check if coursework exists and is not hidden
continue;
}
@@ -95,33 +95,33 @@ private static function send_reminders_to_students() {
$students = $coursework->get_students_who_have_not_yet_submitted();
foreach ($students as $student) {
- $individual_extension = false;
- $personal_deadline = false;
+ $individualextension = false;
+ $personaldeadline = false;
if ($coursework->extensions_enabled()) {
- $individual_extension = \mod_coursework\models\deadline_extension::get_extension_for_student($student, $coursework);
+ $individualextension = \mod_coursework\models\deadline_extension::get_extension_for_student($student, $coursework);
}
if ($coursework->personal_deadlines_enabled()) {
- $personal_deadline = \mod_coursework\models\personal_deadline::get_personal_deadline_for_student($student, $coursework);
+ $personaldeadline = \mod_coursework\models\personal_deadline::get_personal_deadline_for_student($student, $coursework);
}
- $deadline = $personal_deadline ? $personal_deadline->personal_deadline : $coursework->deadline;
+ $deadline = $personaldeadline ? $personaldeadline->personal_deadline : $coursework->deadline;
- if ($individual_extension) {
+ if ($individualextension) {
// 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)) {
- $student->deadline = $individual_extension->extended_deadline;
- $student->extension = $individual_extension->extended_deadline;
+ if ($coursework->due_to_send_first_reminders($individualextension->extended_deadline) &&
+ $student->has_not_been_sent_reminder($coursework, 1, $individualextension->extended_deadline)) {
+ $student->deadline = $individualextension->extended_deadline;
+ $student->extension = $individualextension->extended_deadline;
$student->coursework_id = $coursework->id;
$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) &&
- $student->has_not_been_sent_reminder($coursework, 2, $individual_extension->extended_deadline)) {
- $student->deadline = $individual_extension->extended_deadline;
- $student->extension = $individual_extension->extended_deadline;
+ } else if ($coursework->due_to_send_second_reminders($individualextension->extended_deadline) &&
+ $student->has_not_been_sent_reminder($coursework, 2, $individualextension->extended_deadline)) {
+ $student->deadline = $individualextension->extended_deadline;
+ $student->extension = $individualextension->extended_deadline;
$student->coursework_id = $coursework->id;
$student->nextremindernumber = 2;
$userswhoneedreminding[$student->id().'_'.$coursework->id] = $student;
@@ -214,29 +214,29 @@ private static function send_first_reminders_to_admins() {
foreach ($courseworks as $coursework) {
/* @var coursework $coursework_instance */
- $coursework_instance = coursework::find($coursework->coursework_id);
+ $courseworkinstance = coursework::find($coursework->coursework_id);
if (empty($coursework)) {
continue;
}
- $context = context::instance_by_id($coursework_instance->get_context_id());
+ $context = context::instance_by_id($courseworkinstance->get_context_id());
$users = self::get_admins_and_teachers($context);
foreach ($users as $user) {
if ($DB->record_exists('coursework_reminder', [
- 'coursework_id' => $coursework_instance->id,
+ 'coursework_id' => $courseworkinstance->id,
'userid' => $user->id,
'remindernumber' => 1,
])) {
continue;
}
- $user->coursework_name = $coursework_instance->name;
- $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());
+ $user->coursework_name = $courseworkinstance->name;
+ $user->deadline = userdate($courseworkinstance->get_deadline(), '%a, %d %b %Y, %H:%M');
+ $user->day_hour = coursework_seconds_to_string($courseworkinstance->get_deadline() - time());
$subject = get_string('cron_email_subject_admin', 'mod_coursework', $user);
$text = get_string('cron_email_text_admin', 'mod_coursework', $user);
@@ -248,13 +248,13 @@ private static function send_first_reminders_to_admins() {
$emailssent++;
// Need to record this so they don;t get another one.
- $number_of_existing_reminders = $DB->count_records('coursework_reminder', ['coursework_id' => $coursework_instance->id,
+ $numberofexistingreminders = $DB->count_records('coursework_reminder', ['coursework_id' => $courseworkinstance->id,
'userid' => $user->id,
]);
$reminder = new stdClass();
$reminder->userid = $user->id;
- $reminder->coursework_id = $coursework_instance->id;
- $reminder->remindernumber = $number_of_existing_reminders + 1;
+ $reminder->coursework_id = $courseworkinstance->id;
+ $reminder->remindernumber = $numberofexistingreminders + 1;
$DB->insert_record('coursework_reminder', $reminder);
}
@@ -289,8 +289,8 @@ public static function coursework_debuggable_query($query, $params = []) {
// Now put all the params in place.
foreach ($params as $name => $value) {
$pattern = '/:' . $name . '/';
- $replace_value = (is_numeric($value) ? $value : "'" . $value . "'");
- $query = preg_replace($pattern, $replace_value, $query);
+ $replacevalue = (is_numeric($value) ? $value : "'" . $value . "'");
+ $query = preg_replace($pattern, $replacevalue, $query);
}
return $query;
@@ -314,9 +314,9 @@ private static function send_email_reminders_to_students(array $users, array &$c
foreach ($users as $user) {
- $coursework_instance = coursework::find($user->coursework_id);
+ $courseworkinstance = coursework::find($user->coursework_id);
- $mailer = new mailer($coursework_instance);
+ $mailer = new mailer($courseworkinstance);
if ($mailer->send_student_deadline_reminder($user)) {
@@ -328,12 +328,12 @@ private static function send_email_reminders_to_students(array $users, array &$c
}
$extension = isset($user->extension) ? $user->extension : 0;
- $email_reminder = new stdClass();
- $email_reminder->userid = $user->id;
- $email_reminder->coursework_id = $user->coursework_id;
- $email_reminder->remindernumber = $user->nextremindernumber;
- $email_reminder->extension = $extension;
- $DB->insert_record('coursework_reminder', $email_reminder);
+ $emailreminder = new stdClass();
+ $emailreminder->userid = $user->id;
+ $emailreminder->coursework_id = $user->coursework_id;
+ $emailreminder->remindernumber = $user->nextremindernumber;
+ $emailreminder->extension = $extension;
+ $DB->insert_record('coursework_reminder', $emailreminder);
}
}
@@ -368,9 +368,9 @@ private static function finalise_any_submissions_where_the_deadline_has_passed()
* @return bool
*/
public static function in_test_environment() {
- $in_phpunit = defined('PHPUNIT_TEST') ? PHPUNIT_TEST : false;
- $in_behat = defined('BEHAT_TEST') ? BEHAT_TEST : false;
- if (!empty($in_phpunit) || !empty($in_behat)) {
+ $inphpunit = defined('PHPUNIT_TEST') ? PHPUNIT_TEST : false;
+ $inbehat = defined('BEHAT_TEST') ? BEHAT_TEST : false;
+ if (!empty($inphpunit) || !empty($inbehat)) {
return true;
}
return false;
@@ -395,18 +395,18 @@ private static function autorelease_feedbacks_where_the_release_date_has_passed(
AND c.individualfeedback IS NOT NULL
AND cs.firstpublished IS NULL";
- $coursework_submissions = $DB->get_records_sql($sql, ['now' => time()]);
+ $courseworksubmissions = $DB->get_records_sql($sql, ['now' => time()]);
- foreach ($coursework_submissions as $coursework_submission) {
+ foreach ($courseworksubmissions as $courseworksubmission) {
- $submission = submission::find($coursework_submission);
- $feedback_autorelease_deadline = $submission->get_coursework()->get_individual_feedback_deadline();
+ $submission = submission::find($courseworksubmission);
+ $feedbackautoreleasedeadline = $submission->get_coursework()->get_individual_feedback_deadline();
$allocatable = $submission->get_allocatable();
if (empty($allocatable)) {
continue;
}
- if ($feedback_autorelease_deadline < time() && $submission->ready_to_publish()) {
+ if ($feedbackautoreleasedeadline < time() && $submission->ready_to_publish()) {
$submission->publish();
}
}
diff --git a/classes/export/csv.php b/classes/export/csv.php
index e431f76b..5db099ce 100644
--- a/classes/export/csv.php
+++ b/classes/export/csv.php
@@ -52,7 +52,7 @@ class csv {
/**
* @var array
*/
- protected $csv_cells;
+ protected $csvcells;
/**
* @var string
*/
@@ -63,10 +63,10 @@ class csv {
* @param $csv_cells
* @param $filename
*/
- public function __construct($coursework, $csv_cells, $filename) {
+ public function __construct($coursework, $csvcells, $filename) {
$this->coursework = $coursework;
$this->dateformat = '%a, %d %b %Y, %H:%M';
- $this->csv_cells = $csv_cells;
+ $this->csv_cells = $csvcells;
$this->filename = $filename;
}
@@ -78,7 +78,7 @@ public function export() {
$this->csvexport = new csv_export_writer();
$this->add_filename($this->filename);
- $csv_data = [];
+ $csvdata = [];
// headers
$this->add_headers($this->csv_cells);
@@ -94,10 +94,10 @@ public function export() {
foreach ($submissions as $submission) {
// add data to cvs
$data = $this->add_csv_data($submission);
- $csv_data = array_merge($csv_data, $data);
+ $csvdata = array_merge($csvdata, $data);
}
- $this->add_data_to_csv($csv_data);
+ $this->add_data_to_csv($csvdata);
$this->csvexport->download_file();
die;
@@ -110,23 +110,23 @@ 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, $csvcells) {
$row = [];
- 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);
+ foreach ($csvcells as $csvcell) {
+ if (substr($csvcell, 0, 8) == 'assessor') {
+ $stagedentifier = 'assessor_'.(substr($csvcell, -1));
+ $csvcell = substr($csvcell, 0, -1);
}
- $class = "mod_coursework\\export\\csv\\cells\\".$csv_cell."_cell";
+ $class = "mod_coursework\\export\\csv\\cells\\".$csvcell."_cell";
$cell = new $class($this->coursework);
- if (substr($csv_cell, 0, 8) == 'assessor') {
- $cell = $cell->get_cell($submission, $student, $stage_dentifier);
+ if (substr($csvcell, 0, 8) == 'assessor') {
+ $cell = $cell->get_cell($submission, $student, $stagedentifier);
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 ($csvcell != 'stages' && $csvcell != 'moderationagreement' && $csvcell != 'otherassessors') {
$cell = $cell->get_cell($submission, $student, false);
if (is_array($cell)) {
$row = array_merge($row, $cell);
@@ -147,9 +147,9 @@ 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($csvheaders) {
$headers = [];
- foreach ($csv_headers as $header) {
+ foreach ($csvheaders as $header) {
if (substr($header, 0, 8) == 'assessor') {
$stage = (substr($header, -1));
$header = substr($header, 0, -1);
@@ -172,8 +172,8 @@ public function add_headers($csv_headers) {
$headers[$header] = $head;
}
} else {
- $array_headers = $cell->get_header(false);
- $headers = array_merge($headers, $array_headers);
+ $arrayheaders = $cell->get_header(false);
+ $headers = array_merge($headers, $arrayheaders);
}
}
@@ -207,8 +207,8 @@ protected function sort_by_lastname($a, $b) {
/**
* @param array $csv_data
*/
- private function add_data_to_csv($csv_data) {
- foreach ($csv_data as $data) {
+ private function add_data_to_csv($csvdata) {
+ foreach ($csvdata as $data) {
$this->csvexport->add_data($data);
}
}
@@ -219,11 +219,11 @@ private function add_data_to_csv($csv_data) {
* @return array
* @throws \coding_exception
*/
- public function get_submissions($groupid = null, $selected_submission_ids = '') {
+ public function get_submissions($groupid = null, $selectedsubmissionids = '') {
$submissions = submission::$pool[$this->coursework->id]['id'] ?? submission::find_all(['courseworkid' => $this->coursework->id]);
- if ($selected_submission_ids && $selected_submission_ids = json_decode($selected_submission_ids)) {
- $result = array_flip($selected_submission_ids);
+ if ($selectedsubmissionids && $selectedsubmissionids = json_decode($selectedsubmissionids)) {
+ $result = array_flip($selectedsubmissionids);
foreach ($submissions as $submission) {
if (array_key_exists($submission->id, $result)) {
$result[$submission->id] = $submission;
@@ -241,15 +241,15 @@ public function get_submissions($groupid = null, $selected_submission_ids = '')
*/
public function add_csv_data($submission) {
- $csv_data = [];
+ $csvdata = [];
// retrieve all students (even if group coursework)
$students = $submission->get_students();
foreach ($students as $student) {
- $csv_data[] = $this->add_cells_to_array($submission, $student, $this->csv_cells);
+ $csvdata[] = $this->add_cells_to_array($submission, $student, $this->csv_cells);
}
- return $csv_data;
+ return $csvdata;
}
public function other_assessors_cells() {
diff --git a/classes/export/csv/cells/agreedfeedback_cell.php b/classes/export/csv/cells/agreedfeedback_cell.php
index ed452c3a..ee3d6903 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, $stageidentifier) {
return $gradedata[] = $submission->get_agreed_grade() == false ? '' : strip_tags($submission->get_agreed_grade()->feedbackcomment);
}
@@ -51,11 +51,11 @@ public function get_header($stage) {
return get_string('agreedgradefeedback', 'coursework');
}
- public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = []) {
+ public function validate_cell($value, $submissionid, $stageidentifier='', $uploadedgradecells = []) {
global $DB, $PAGE, $USER;
- $stage_identifier = 'final_agreed_1';
+ $stageidentifier = 'final_agreed_1';
$agreedgradecap = ['mod/coursework:addagreedgrade', 'mod/coursework:editagreedgrade',
'mod/coursework:addallocatedagreedgrade', 'mod/coursework:editallocatedagreedgrade'];
@@ -81,26 +81,26 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
}
// Has this submission been graded if yes then check if the current user graded it (only if allocation is not enabled).
- $feedback_params = [
+ $feedbackparams = [
'submissionid' => $submission->id,
- 'stage_identifier' => $stage_identifier,
+ 'stage_identifier' => $stageidentifier,
];
- $feedback = feedback::find($feedback_params);
+ $feedback = feedback::find($feedbackparams);
$ability = new ability(user::find($USER), $this->coursework);
//does a feedback exist for this stage
if (empty($feedback)) {
- $feedback_params = [
+ $feedbackparams = [
'submissionid' => $submissionid,
'assessorid' => $USER->id,
- 'stage_identifier' => $stage_identifier,
+ 'stage_identifier' => $stageidentifier,
];
- $new_feedback = feedback::build($feedback_params);
+ $newfeedback = feedback::build($feedbackparams);
// 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)) {
+ if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !has_capability('mod/coursework:addallocatedagreedgrade', $PAGE->context) && !$ability->can('new', $newfeedback)) {
return get_string('nopermissiontogradesubmission', 'coursework');
}
} else {
diff --git a/classes/export/csv/cells/agreedgrade_cell.php b/classes/export/csv/cells/agreedgrade_cell.php
index c8fb3971..c662d8cf 100644
--- a/classes/export/csv/cells/agreedgrade_cell.php
+++ b/classes/export/csv/cells/agreedgrade_cell.php
@@ -38,7 +38,7 @@ 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, $stageidentifier) {
$agreedgrade = $submission->get_agreed_grade();
if ($this->coursework->is_using_rubric() && $this->coursework->finalstagegrading != 1) {
@@ -72,11 +72,11 @@ public function get_header($stage) {
return $strings;
}
- public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = []) {
+ public function validate_cell($value, $submissionid, $stageidentifier='', $uploadedgradecells = []) {
global $DB, $PAGE, $USER;
- $stage_identifier = 'final_agreed_1';
+ $stageidentifier = 'final_agreed_1';
$agreedgradecap = ['mod/coursework:addagreedgrade', 'mod/coursework:editagreedgrade',
'mod/coursework:addallocatedagreedgrade', 'mod/coursework:editallocatedagreedgrade'];
@@ -170,27 +170,27 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
}
// Has this submission been graded if yes then check if the current user graded it (only if allocation is not enabled).
- $feedback_params = [
+ $feedbackparams = [
'submissionid' => $submission->id,
- 'stage_identifier' => $stage_identifier,
+ 'stage_identifier' => $stageidentifier,
];
- $feedback = feedback::find($feedback_params);
+ $feedback = feedback::find($feedbackparams);
$ability = new ability(user::find($USER), $this->coursework);
//does a feedback exist for this stage
if (empty($feedback)) {
- $feedback_params = [
+ $feedbackparams = [
'submissionid' => $submissionid,
'assessorid' => $USER->id,
- 'stage_identifier' => $stage_identifier,
+ 'stage_identifier' => $stageidentifier,
];
- $new_feedback = feedback::build($feedback_params);
+ $newfeedback = feedback::build($feedbackparams);
// 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)) {
+ if (!has_capability('mod/coursework:administergrades', $PAGE->context) && !has_capability('mod/coursework:addallocatedagreedgrade', $PAGE->context) && !$ability->can('new', $newfeedback)) {
return get_string('nopermissiontogradesubmission', 'coursework');
}
} else {
@@ -246,7 +246,7 @@ function value_in_rubric($criteria, $value) {
* @param $csv_cells
* @return array
*/
- function get_rubrics($coursework, $csv_cells) {
+ function get_rubrics($coursework, $csvcells) {
if ($coursework->is_using_rubric() && $this->coursework->finalstagegrading != 1) {
@@ -260,16 +260,16 @@ function get_rubrics($coursework, $csv_cells) {
}
// Find out the position of singlegrade
- $position = array_search('singlegrade', $csv_cells);
+ $position = array_search('singlegrade', $csvcells);
// 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);
+ $startcells = array_slice($csvcells, 0, $position, true);
+ $endcells = array_slice($csvcells, $position + 1, count($csvcells), true);
- $cells = array_merge($start_cells, $rubricheaders);
+ $cells = array_merge($startcells, $rubricheaders);
- $cells = array_merge($cells, $end_cells);
+ $cells = array_merge($cells, $endcells);
}
diff --git a/classes/export/csv/cells/assessor_cell.php b/classes/export/csv/cells/assessor_cell.php
index ad34049f..f28eb1d5 100644
--- a/classes/export/csv/cells/assessor_cell.php
+++ b/classes/export/csv/cells/assessor_cell.php
@@ -35,10 +35,10 @@ class assessor_cell extends cell_base {
* @return string
*/
- public function get_cell($submission, $student, $stage_identifier) {
+ public function get_cell($submission, $student, $stageidentifier) {
$assessor = '';
- $allocation = $this->coursework->get_assessor_allocation($submission, $stage_identifier );
+ $allocation = $this->coursework->get_assessor_allocation($submission, $stageidentifier );
if ($allocation) {
$assessor = $this->get_assessor_name($allocation->assessorid);
} else if ($this->coursework->sampling_enabled()) {
diff --git a/classes/export/csv/cells/assessorfeedback_cell.php b/classes/export/csv/cells/assessorfeedback_cell.php
index aac4b4ba..726b3928 100644
--- a/classes/export/csv/cells/assessorfeedback_cell.php
+++ b/classes/export/csv/cells/assessorfeedback_cell.php
@@ -37,20 +37,20 @@ class assessorfeedback_cell extends cell_base {
* @return string
*/
- public function get_cell($submission, $student, $stage_identifier) {
+ public function get_cell($submission, $student, $stageidentifier) {
global $USER;
- $grade = $submission->get_assessor_feedback_by_stage($stage_identifier);
+ $grade = $submission->get_assessor_feedback_by_stage($stageidentifier);
if ($grade) {
// check if user can see initial grades before all of them are completed
$ability = new ability(user::find($USER), $this->coursework);
- $feedback_params = [
+ $feedbackparams = [
'submissionid' => $submission->id,
- 'stage_identifier' => $stage_identifier,
+ 'stage_identifier' => $stageidentifier,
];
- $feedback = feedback::find($feedback_params);
+ $feedback = feedback::find($feedbackparams);
if ($submission->get_agreed_grade() || $ability->can('show', $feedback) || is_siteadmin($USER->id)) {
$grade = strip_tags($grade->feedbackcomment);
@@ -74,7 +74,7 @@ public function get_header($stage) {
return get_string('assessorfeedbackcsv', 'coursework', $stage);
}
- public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = []) {
+ public function validate_cell($value, $submissionid, $stageidentifier='', $uploadedgradecells = []) {
global $DB, $PAGE, $USER;
$modulecontext = $PAGE->context;
@@ -110,11 +110,11 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
}
// Has this submission been graded if yes then check if the current user graded it (only if allocation is not enabled).
- $feedback_params = [
+ $feedbackparams = [
'submissionid' => $submission->id,
- 'stage_identifier' => $stage_identifier,
+ 'stage_identifier' => $stageidentifier,
];
- $feedback = feedback::find($feedback_params);
+ $feedback = feedback::find($feedbackparams);
$ability = new ability(user::find($USER), $this->coursework);
@@ -144,15 +144,15 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
if ($this->coursework->allocation_enabled()) {
// Check that the user is allocated to the author of the submission
- $allocation_params = [
+ $allocationparams = [
'courseworkid' => $this->coursework->id,
'allocatableid' => $submission->allocatableid,
'allocatabletype' => $submission->allocatabletype,
- 'stage_identifier' => $stage_identifier,
+ 'stage_identifier' => $stageidentifier,
];
if (!has_capability('mod/coursework:administergrades', $modulecontext)
- && !$DB->get_record('coursework_allocation_pairs', $allocation_params)) {
+ && !$DB->get_record('coursework_allocation_pairs', $allocationparams)) {
return get_string('nopermissiontogradesubmission', 'coursework');
}
}
@@ -166,8 +166,8 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
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) ? count($in_sample) + 1 : 1;
+ $insample = $submission->get_submissions_in_sample();
+ $assessors = ($insample) ? count($insample) + 1 : 1;
} else {
// Check how many assessors for this coursework
$assessors = $this->coursework->get_max_markers();
diff --git a/classes/export/csv/cells/assessorgrade_cell.php b/classes/export/csv/cells/assessorgrade_cell.php
index a1ee3d5a..40a22d96 100644
--- a/classes/export/csv/cells/assessorgrade_cell.php
+++ b/classes/export/csv/cells/assessorgrade_cell.php
@@ -39,20 +39,20 @@ class assessorgrade_cell extends cell_base {
* @return string
*/
- public function get_cell($submission, $student, $stage_identifier) {
+ public function get_cell($submission, $student, $stageidentifier) {
global $USER;
- $grade = $submission->get_assessor_feedback_by_stage($stage_identifier);
+ $grade = $submission->get_assessor_feedback_by_stage($stageidentifier);
// check if user can see initial grades before all of them are completed
$ability = new ability(user::find($USER), $this->coursework);
- $feedback_params = [
+ $feedbackparams = [
'submissionid' => $submission->id,
- 'stage_identifier' => $stage_identifier,
+ 'stage_identifier' => $stageidentifier,
];
- $feedback = feedback::find($feedback_params);
+ $feedback = feedback::find($feedbackparams);
if (($submission->get_agreed_grade() || ($feedback && $ability->can('show', $feedback))) || !$submission->any_editable_feedback_exists() || is_siteadmin($USER->id)) {
@@ -69,8 +69,8 @@ public function get_cell($submission, $student, $stage_identifier) {
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');
- $gradedata['assessor'.$stage_identifier.'_'.$criteria['id']. 'comment'] = '';
+ $gradedata['assessor'.$stageidentifier.'_'.$criteria['id']] = get_string('grade_hidden_manager', 'mod_coursework');
+ $gradedata['assessor'.$stageidentifier.'_'.$criteria['id']. 'comment'] = '';
}
} else {
$gradedata = get_string('grade_hidden_manager', 'mod_coursework');
@@ -103,7 +103,7 @@ public function get_header($stage) {
}
- public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = []) {
+ public function validate_cell($value, $submissionid, $stageidentifier='', $uploadedgradecells = []) {
global $DB, $PAGE, $USER;
if (empty($value)) {
@@ -194,11 +194,11 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
}
// Has this submission been graded if yes then check if the current user graded it (only if allocation is not enabled).
- $feedback_params = [
+ $feedbackparams = [
'submissionid' => $submission->id,
- 'stage_identifier' => $stage_identifier,
+ 'stage_identifier' => $stageidentifier,
];
- $feedback = feedback::find($feedback_params);
+ $feedback = feedback::find($feedbackparams);
$ability = new ability(user::find($USER), $this->coursework);
@@ -228,15 +228,15 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
if ($this->coursework->allocation_enabled()) {
// Check that the user is allocated to the author of the submission
- $allocation_params = [
+ $allocationparams = [
'courseworkid' => $this->coursework->id,
'allocatableid' => $submission->allocatableid,
'allocatabletype' => $submission->allocatabletype,
- 'stage_identifier' => $stage_identifier,
+ 'stage_identifier' => $stageidentifier,
];
if (!has_capability('mod/coursework:administergrades', $PAGE->context)
- && !$DB->get_record('coursework_allocation_pairs', $allocation_params)
+ && !$DB->get_record('coursework_allocation_pairs', $allocationparams)
) {
return get_string('nopermissiontogradesubmission', 'coursework');
}
@@ -252,8 +252,8 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
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) ? count($in_sample) + 1 : 1;
+ $insample = $submission->get_submissions_in_sample();
+ $assessors = ($insample) ? count($insample) + 1 : 1;
} else {
// Check how many assessors for this coursework
$assessors = $this->coursework->get_max_markers();
@@ -311,7 +311,7 @@ function value_in_rubric($criteria, $value) {
* @param $csv_cells
*
*/
- function get_rubrics($coursework, $csv_cells) {
+ function get_rubrics($coursework, $csvcells) {
if ($coursework->is_using_rubric()) {
@@ -325,16 +325,16 @@ function get_rubrics($coursework, $csv_cells) {
}
// Find out the position of singlegrade
- $position = array_search('singlegrade', $csv_cells);
+ $position = array_search('singlegrade', $csvcells);
// 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);
+ $startcells = array_slice($csvcells, 0, $position, true);
+ $endcells = array_slice($csvcells, $position + 1, count($csvcells), true);
- $cells = array_merge($start_cells, $rubricheaders);
+ $cells = array_merge($startcells, $rubricheaders);
- $cells = array_merge($cells, $end_cells);
+ $cells = array_merge($cells, $endcells);
}
diff --git a/classes/export/csv/cells/cell_base.php b/classes/export/csv/cells/cell_base.php
index 9a61b19a..bbdb2d65 100644
--- a/classes/export/csv/cells/cell_base.php
+++ b/classes/export/csv/cells/cell_base.php
@@ -112,10 +112,10 @@ 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_reasons = $this->get_extension_predefined_reasons();
+ $extensionreasons = $this->get_extension_predefined_reasons();
- return (!empty($extension_reasons[$extension->pre_defined_reason])) ?
- strip_tags($extension_reasons[$extension->pre_defined_reason]) : "";
+ return (!empty($extensionreasons[$extension->pre_defined_reason])) ?
+ strip_tags($extensionreasons[$extension->pre_defined_reason]) : "";
}
/**
@@ -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 = []) {
+ public function validate_cell($value, $submissions, $stagedentifier='', $uploadedgradecells = []) {
return true;
}
@@ -267,9 +267,9 @@ public function get_rubric_scores_gradedata($grade, &$gradedata) {
/**
* @var gradingform_rubric_instance $grade
*/
- $rubric_marks = $gradinginstance->get_rubric_filling();
+ $rubricmarks = $gradinginstance->get_rubric_filling();
- foreach ($rubric_marks['criteria'] as $id => $record) {
+ foreach ($rubricmarks['criteria'] as $id => $record) {
$gradedata[] = $controller->get_definition()->rubric_criteria[$id]['levels'][$record['levelid']]['score'];
$gradedata[] = $record['remark'];
diff --git a/classes/export/csv/cells/cell_interface.php b/classes/export/csv/cells/cell_interface.php
index 5df28a06..0d8e1859 100644
--- a/classes/export/csv/cells/cell_interface.php
+++ b/classes/export/csv/cells/cell_interface.php
@@ -33,7 +33,7 @@ interface cell_interface {
* @param $stage_identifier
* @return mixed
*/
- public function get_cell($submission, $student, $stage_identifier);
+ public function get_cell($submission, $student, $stageidentifier);
/**
* @param $stage
@@ -47,6 +47,6 @@ public function get_header($stage);
* @param $stage_dentifier
* @return mixed
*/
- public function validate_cell($value, $submissions, $stage_dentifier='');
+ public function validate_cell($value, $submissions, $stagedentifier='');
}
diff --git a/classes/export/csv/cells/email_cell.php b/classes/export/csv/cells/email_cell.php
index f40ebeb8..14698ee9 100644
--- a/classes/export/csv/cells/email_cell.php
+++ b/classes/export/csv/cells/email_cell.php
@@ -35,7 +35,7 @@ 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, $stageidentifier) {
if ($this->can_view_hidden() || $submission->is_published()) {
$name = $student->email;
diff --git a/classes/export/csv/cells/extensiondeadline_cell.php b/classes/export/csv/cells/extensiondeadline_cell.php
index c8644568..e7c7e766 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, $stageidentifier) {
if ($this->extension_exists($student)) {
$deadline = $this->get_extension_date_for_csv($student);
diff --git a/classes/export/csv/cells/extensionextrainfo_cell.php b/classes/export/csv/cells/extensionextrainfo_cell.php
index bb57a8a1..8eb8773f 100644
--- a/classes/export/csv/cells/extensionextrainfo_cell.php
+++ b/classes/export/csv/cells/extensionextrainfo_cell.php
@@ -33,14 +33,14 @@ 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, $stageidentifier) {
if ($this->extension_exists($student)) {
- $extra_info = $this->get_extension_extra_info_for_csv($student);
+ $extrainfo = $this->get_extension_extra_info_for_csv($student);
} else {
- $extra_info = '';
+ $extrainfo = '';
}
- return $extra_info;
+ return $extrainfo;
}
/**
diff --git a/classes/export/csv/cells/extensionreason_cell.php b/classes/export/csv/cells/extensionreason_cell.php
index e7ca00a3..4815678a 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, $stageidentifier) {
if ($this->extension_exists($student)) {
$reason = $this->get_extension_reason_for_csv($student);
diff --git a/classes/export/csv/cells/finalgrade_cell.php b/classes/export/csv/cells/finalgrade_cell.php
index 6c2926f4..6cb989ef 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, $stageidentifier) {
return $submission->get_final_grade() == false || $submission->editable_final_feedback_exist() ? '' : $this->get_actual_grade($submission->get_final_grade());
diff --git a/classes/export/csv/cells/group_cell.php b/classes/export/csv/cells/group_cell.php
index 599f76a3..b37083b8 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, $stageidentifier) {
return $group->name;
}
diff --git a/classes/export/csv/cells/idnumber_cell.php b/classes/export/csv/cells/idnumber_cell.php
index 422cdfbb..b7cac9ca 100644
--- a/classes/export/csv/cells/idnumber_cell.php
+++ b/classes/export/csv/cells/idnumber_cell.php
@@ -35,7 +35,7 @@ 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, $stageidentifier) {
if ($this->can_view_hidden() || $submission->is_published()) {
$name = $student->idnumber;
diff --git a/classes/export/csv/cells/moderationagreement_cell.php b/classes/export/csv/cells/moderationagreement_cell.php
index 0852b6c0..62d20a9a 100644
--- a/classes/export/csv/cells/moderationagreement_cell.php
+++ b/classes/export/csv/cells/moderationagreement_cell.php
@@ -35,11 +35,11 @@ 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, $stageidentifier) {
global $DB;
$data = [];
- $moderation_agreement = '';
+ $moderationagreement = '';
$moderation = '';
if ($this->coursework->allocation_enabled()) {
@@ -58,14 +58,14 @@ public function get_cell($submission, $student, $stage_identifier) {
}
if ($moderation) {
- $moderation_agreement = $moderation->get_moderator_agreement($feedback);
+ $moderationagreement = $moderation->get_moderator_agreement($feedback);
}
- if ($moderation_agreement) {
- $data[] = $moderation_agreement->agreement;
- $data[] = $this->get_assessor_name($moderation_agreement->moderatorid);
- $data[] = $this->get_assessor_username($moderation_agreement->moderatorid);
- $data[] = userdate($moderation_agreement->timemodified, $this->dateformat);
+ if ($moderationagreement) {
+ $data[] = $moderationagreement->agreement;
+ $data[] = $this->get_assessor_name($moderationagreement->moderatorid);
+ $data[] = $this->get_assessor_username($moderationagreement->moderatorid);
+ $data[] = userdate($moderationagreement->timemodified, $this->dateformat);
} else {
$data[] = '';
$data[] = '';
diff --git a/classes/export/csv/cells/name_cell.php b/classes/export/csv/cells/name_cell.php
index 23b4b17a..9123ebfd 100644
--- a/classes/export/csv/cells/name_cell.php
+++ b/classes/export/csv/cells/name_cell.php
@@ -35,7 +35,7 @@ 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, $stageidentifier) {
if ($this->can_view_hidden() || $submission->is_published()) {
$name = $student->lastname . ' ' . $student->firstname;
diff --git a/classes/export/csv/cells/otherassessors_cell.php b/classes/export/csv/cells/otherassessors_cell.php
index dbbc894b..4549af12 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, $stageidentifier) {
global $DB, $USER;
// find out current user stage identifier
@@ -48,7 +48,7 @@ public function get_cell($submission, $student, $stage_identifier) {
$params = [
'submissionid' => $submission->id,
'assessorid' => $USER->id,
- 'stageidentifier' => $stage_identifier,
+ 'stageidentifier' => $stageidentifier,
];
$sql = "SELECT * FROM {coursework_feedbacks}
@@ -91,8 +91,8 @@ public function get_cell($submission, $student, $stage_identifier) {
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');
- $gradedata['assessor' . $stage_identifier . '_' . $criteria['id'] . 'comment'] = '';
+ $gradedata['assessor' . $stageidentifier . '_' . $criteria['id']] = get_string('grade_hidden_manager', 'mod_coursework');
+ $gradedata['assessor' . $stageidentifier . '_' . $criteria['id'] . 'comment'] = '';
}
} else {
$gradedata[] = '';
@@ -112,8 +112,8 @@ public function get_cell($submission, $student, $stage_identifier) {
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.$i. '_' . $criteria['id']] = '';
- $gradedata['assessor' . $stage_identifier.$i. '_' . $criteria['id'] . 'comment'] = '';
+ $gradedata['assessor' . $stageidentifier.$i. '_' . $criteria['id']] = '';
+ $gradedata['assessor' . $stageidentifier.$i. '_' . $criteria['id'] . 'comment'] = '';
}
} else {
$gradedata[] = '';
diff --git a/classes/export/csv/cells/personaldeadline_cell.php b/classes/export/csv/cells/personaldeadline_cell.php
index e77dc73d..50a39552 100644
--- a/classes/export/csv/cells/personaldeadline_cell.php
+++ b/classes/export/csv/cells/personaldeadline_cell.php
@@ -33,11 +33,11 @@ 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, $stageidentifier) {
- $personal_deadline = $submission->submission_personal_deadline();
+ $personaldeadline = $submission->submission_personal_deadline();
- return userdate($personal_deadline, $this->dateformat);
+ return userdate($personaldeadline, $this->dateformat);
}
/**
diff --git a/classes/export/csv/cells/plagiarismflagcomment_cell.php b/classes/export/csv/cells/plagiarismflagcomment_cell.php
index f7a93314..70b0f225 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, $stageidentifier) {
if ($this->plagiarism_flagged($submission)) {
$flag = $this->get_plagiarism_flag_comment_for_csv($submission);
diff --git a/classes/export/csv/cells/plagiarismflagstatus_cell.php b/classes/export/csv/cells/plagiarismflagstatus_cell.php
index fdb399e7..bf467448 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, $stageidentifier) {
if ($this->plagiarism_flagged($submission)) {
$flag = $this->get_plagiarism_flag_status_for_csv($submission);
diff --git a/classes/export/csv/cells/singlegrade_cell.php b/classes/export/csv/cells/singlegrade_cell.php
index 5ac3c02a..0d1ccfe6 100644
--- a/classes/export/csv/cells/singlegrade_cell.php
+++ b/classes/export/csv/cells/singlegrade_cell.php
@@ -38,11 +38,11 @@ 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, $stageidentifier) {
- $stage_identifier = ($this->coursework->get_max_markers() == 1) ? "assessor_1" : $this->get_stage_identifier_for_assessor($submission, $student);
+ $stageidentifier = ($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);
+ $grade = $submission->get_assessor_feedback_by_stage($stageidentifier);
if ($this->coursework->is_using_rubric()) {
$gradedata = [];
$this->get_rubric_scores_gradedata($grade, $gradedata); // multiple parts are handled here
@@ -73,7 +73,7 @@ public function get_header($stage) {
return $strings;
}
- public function validate_cell($value, $submissionid, $stage_identifier='', $uploadedgradecells = []) {
+ public function validate_cell($value, $submissionid, $stageidentifier='', $uploadedgradecells = []) {
global $PAGE, $DB, $USER;
@@ -162,11 +162,11 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
}
// Has this submission been graded if yes then check if the current user graded it (only if allocation is not enabled).
- $feedback_params = [
+ $feedbackparams = [
'submissionid' => $submission->id,
- 'stage_identifier' => $stage_identifier,
+ 'stage_identifier' => $stageidentifier,
];
- $feedback = feedback::find($feedback_params);
+ $feedback = feedback::find($feedbackparams);
if (!$this->coursework->allocation_enabled() && !empty($feedback)) {
// Was this user the one who last graded this submission if not then user cannot grade
@@ -178,26 +178,26 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
$ability = new ability(user::find($USER), $this->coursework);
- $feedback_params = [
+ $feedbackparams = [
'submissionid' => $submission->id,
- 'stage_identifier' => $stage_identifier,
+ 'stage_identifier' => $stageidentifier,
];
- $feedback = feedback::find($feedback_params);
+ $feedback = feedback::find($feedbackparams);
//if (!$ability->can('edit', $feedback)) return get_string('nopermissiontoeditgrade', 'coursework');
//does a feedback exist for this stage
if (empty($feedback)) {
- $feedback_params = [
+ $feedbackparams = [
'submissionid' => $submissionid,
'assessorid' => $USER->id,
- 'stage_identifier' => $stage_identifier,
+ 'stage_identifier' => $stageidentifier,
];
- $new_feedback = feedback::build($feedback_params);
+ $newfeedback = feedback::build($feedbackparams);
// This is a new feedback check it against the new ability checks
- if (!$ability->can('new', $new_feedback)) {
+ if (!$ability->can('new', $newfeedback)) {
return get_string('nopermissiontogradesubmission', 'coursework');
}
} else {
@@ -251,7 +251,7 @@ function value_in_rubric($criteria, $value) {
* @param $csv_cells
*
*/
- function get_rubrics($coursework, $csv_cells) {
+ function get_rubrics($coursework, $csvcells) {
if ($coursework->is_using_rubric()) {
@@ -265,16 +265,16 @@ function get_rubrics($coursework, $csv_cells) {
}
// Find out the position of singlegrade
- $position = array_search('singlegrade', $csv_cells);
+ $position = array_search('singlegrade', $csvcells);
// 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);
+ $startcells = array_slice($csvcells, 0, $position, true);
+ $endcells = array_slice($csvcells, $position + 1, count($csvcells), true);
- $cells = array_merge($start_cells, $rubricheaders);
+ $cells = array_merge($startcells, $rubricheaders);
- $cells = array_merge($cells, $end_cells);
+ $cells = array_merge($cells, $endcells);
}
diff --git a/classes/export/csv/cells/stages_cell.php b/classes/export/csv/cells/stages_cell.php
index 3b89f517..b444e357 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, $stageidentifier) {
global $DB;
$timecreated = 0;
@@ -49,11 +49,11 @@ public function get_cell($submission, $student, $stage_identifier) {
$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;
- $grade = $submission->get_assessor_feedback_by_stage($stage_identifier);
+ $stageidentifier = 'assessor_'.$i;
+ $grade = $submission->get_assessor_feedback_by_stage($stageidentifier);
if ($this->coursework->allocation_enabled()) {
- $allocation = $submission->get_assessor_allocation_by_stage($stage_identifier);
+ $allocation = $submission->get_assessor_allocation_by_stage($stageidentifier);
if ($allocation) {
$gradedata[] = $this->get_assessor_name($allocation->assessorid);
$gradedata[] = $this->get_assessor_username($allocation->assessorid);
diff --git a/classes/export/csv/cells/submissiondate_cell.php b/classes/export/csv/cells/submissiondate_cell.php
index cf173e10..a047e656 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, $stageidentifier) {
return userdate($submission->time_submitted(), $this->dateformat);
}
diff --git a/classes/export/csv/cells/submissionfileid_cell.php b/classes/export/csv/cells/submissionfileid_cell.php
index 39d5615d..ca4230e2 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, $stageidentifier) {
return $this->coursework->get_username_hash($submission->allocatableid);
}
@@ -46,7 +46,7 @@ public function get_header($stage) {
return get_string('submissionfileid', 'coursework');
}
- public function validate_cell($value, $submissionid, $stage_dentifier='', $uploadedgradecells = []) {
+ public function validate_cell($value, $submissionid, $stagedentifier='', $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 75537f60..916c29de 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, $stageidentifier) {
return $submission->id;
}
@@ -46,7 +46,7 @@ public function get_header($stage) {
return get_string('submissionid', 'coursework');
}
- public function validate_cell($value, $submissionid, $stage_dentifier = '', $uploadedgradecells = []) {
+ public function validate_cell($value, $submissionid, $stagedentifier = '', $uploadedgradecells = []) {
global $DB;
return $DB->record_exists('coursework_submissions', ['id' => $submissionid, 'courseworkid' => $this->coursework->id()])
? true
diff --git a/classes/export/csv/cells/submissiontime_cell.php b/classes/export/csv/cells/submissiontime_cell.php
index 205c186d..c30e93fb 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, $stageidentifier) {
return $this->submission_time($submission);
}
diff --git a/classes/export/csv/cells/username_cell.php b/classes/export/csv/cells/username_cell.php
index fa4ce0cc..c444c7b2 100644
--- a/classes/export/csv/cells/username_cell.php
+++ b/classes/export/csv/cells/username_cell.php
@@ -35,7 +35,7 @@ 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, $stageidentifier) {
if ($this->can_view_hidden() || $submission->is_published()) {
$username = $student->username;
diff --git a/classes/export/grading_sheet.php b/classes/export/grading_sheet.php
index f6fc91e2..c4302413 100644
--- a/classes/export/grading_sheet.php
+++ b/classes/export/grading_sheet.php
@@ -29,7 +29,7 @@
class grading_sheet extends csv {
- public function get_submissions($groupid = null, $selected_submission_ids = '') {
+ public function get_submissions($groupid = null, $selectedsubmissionids = '') {
global $PAGE, $USER;
$params = [
'courseworkid' => $this->coursework->id,
@@ -56,7 +56,7 @@ public function get_submissions($groupid = null, $selected_submission_ids = '')
* @var submission[] $submissions
*/
foreach ($submissions as $submission) {
- $stage_identifiers = [];
+ $stageidentifiers = [];
// remove all submissions that a user is not supposed to see
// double marking not allocated
@@ -64,24 +64,24 @@ public function get_submissions($groupid = null, $selected_submission_ids = '')
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
+ $stageidentifiers[] = '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;
+ $insample = $submission->get_submissions_in_sample();
+ foreach ($insample as $i) {
+ $stageidentifiers[] = $i->stage_identifier;
}
} else { // if sampling not enabled, everyone is marked in all stages
for ($i = 1; $i <= $stages; $i++) {
- $stage_identifiers[] = 'assessor_' . $i;
+ $stageidentifiers[] = '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]);
+ for ($i = 0; $i < count($stageidentifiers); $i++) {
+ $feedback = $submission->get_assessor_feedback_by_stage($stageidentifiers[$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)) {
+ } else if ($i + 1 < count($stageidentifiers)) {
continue;
}
// if the last submission was already marked remove it from the array
@@ -122,11 +122,11 @@ public function get_submissions($groupid = null, $selected_submission_ids = '')
*/
public function add_csv_data($submission) {
- $csv_data = [];
+ $csvdata = [];
// groups
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);
+ $csvdata[] = $this->add_cells_to_array($submission, $group, $this->csv_cells);
} else {
// students
@@ -134,11 +134,11 @@ public function add_csv_data($submission) {
foreach ($students as $student) {
$student = \mod_coursework\models\user::find($student);
- $csv_data[] = $this->add_cells_to_array($submission, $student, $this->csv_cells);
+ $csvdata[] = $this->add_cells_to_array($submission, $student, $this->csv_cells);
}
}
- return $csv_data;
+ return $csvdata;
}
/**
@@ -151,17 +151,17 @@ public static function cells_array($coursework) {
global $PAGE;
// headers and data for csv
- $csv_cells = ['submissionid', 'submissionfileid'];
+ $csvcells = ['submissionid', 'submissionfileid'];
if ($coursework->is_configured_to_have_group_submissions()) {
- $csv_cells[] = 'group';
+ $csvcells[] = 'group';
} else {
- $csv_cells[] = 'name';
- $csv_cells[] = 'username';
- $csv_cells[] = 'idnumber';
- $csv_cells[] = 'email';
+ $csvcells[] = 'name';
+ $csvcells[] = 'username';
+ $csvcells[] = 'idnumber';
+ $csvcells[] = 'email';
}
- $csv_cells[] = 'submissiontime';
+ $csvcells[] = 'submissiontime';
// 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))
@@ -171,29 +171,29 @@ public static function cells_array($coursework) {
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;
+ $csvcells[] = 'assessor' . $i;
}
- $csv_cells[] = 'assessorgrade'.$i;
- $csv_cells[] = 'assessorfeedback'.$i;
+ $csvcells[] = 'assessorgrade'.$i;
+ $csvcells[] = 'assessorfeedback'.$i;
}
- $csv_cells[] = 'agreedgrade';
- $csv_cells[] = 'agreedfeedback';
+ $csvcells[] = 'agreedgrade';
+ $csvcells[] = 'agreedfeedback';
} else if (has_capability('mod/coursework:addallocatedagreedgrade', $PAGE->context) && $coursework->get_max_markers() > 1) {
- $csv_cells[] = 'singlegrade';
- $csv_cells[] = 'feedbackcomments';
+ $csvcells[] = 'singlegrade';
+ $csvcells[] = 'feedbackcomments';
// Other grades
- $csv_cells[] = 'otherassessors';
+ $csvcells[] = 'otherassessors';
- $csv_cells[] = 'agreedgrade';
- $csv_cells[] = 'agreedfeedback';
+ $csvcells[] = 'agreedgrade';
+ $csvcells[] = 'agreedfeedback';
} else if (has_capability('mod/coursework:addinitialgrade', $PAGE->context)
|| has_capability('mod/coursework:administergrades', $PAGE->context)) {
// if (!$coursework->is_using_rubric()) {
- $csv_cells[] = 'singlegrade';
+ $csvcells[] = 'singlegrade';
/* } else {
$criterias = $coursework->get_rubric_criteria();
@@ -205,10 +205,10 @@ public static function cells_array($coursework) {
}
*/
- $csv_cells[] = 'feedbackcomments';
+ $csvcells[] = 'feedbackcomments';
}
- return $csv_cells;
+ return $csvcells;
}
}
diff --git a/classes/export/import.php b/classes/export/import.php
index 5ab84d9c..2fe4d52d 100644
--- a/classes/export/import.php
+++ b/classes/export/import.php
@@ -49,7 +49,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, $csvcells) {
global $DB, $USER;
@@ -80,7 +80,7 @@ public function validate_csv($content, $encoding, $delimeter, $csv_cells) {
while ($line = $csvreader->next()) {
- $csv = $this->remove_other_assessors_grade($csv_cells, $line);
+ $csv = $this->remove_other_assessors_grade($csvcells, $line);
$cells = $csv;
@@ -102,7 +102,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]);
+ $stageidentifier = $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') {
@@ -136,13 +136,13 @@ public function validate_csv($content, $encoding, $delimeter, $csv_cells) {
$rubriclinedata = array_slice($line, $position + $offset, count($rubricheaders), true);
// Pass the rubric data in
- $result = $cell->validate_cell($rubriclinedata, $submissionid, $stage_identifier, $uploadedgradecells);
+ $result = $cell->validate_cell($rubriclinedata, $submissionid, $stageidentifier, $uploadedgradecells);
$z = $z + count($rubricheaders) - 1;
$offset = $offset + count($rubricheaders) - 1;
} else {
- $result = $cell->validate_cell($value, $submissionid, $stage_identifier, $uploadedgradecells);
+ $result = $cell->validate_cell($value, $submissionid, $stageidentifier, $uploadedgradecells);
}
if ($result !== true) {
@@ -150,7 +150,7 @@ public function validate_csv($content, $encoding, $delimeter, $csv_cells) {
break; // Go to next line on error
} else if ($cells[$i] == "singlegrade" || $cells[$i] == "assessorgrade" || $cells[$i] == "agreedgrade" && !empty($value)) {
- $uploadedgradecells[] = $stage_identifier;
+ $uploadedgradecells[] = $stageidentifier;
}
$i++;
@@ -266,7 +266,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, $csvcells, $processingresults) {
global $DB, $PAGE, $USER;
@@ -302,7 +302,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
continue;
}
- $csv = $this->remove_other_assessors_grade($csv_cells, $line);
+ $csv = $this->remove_other_assessors_grade($csvcells, $line);
// Gets the headers that should be being used in the uploaded csv
//$cells = $this->get_rubric_headers($csv);
$cells = $csv;
@@ -398,8 +398,8 @@ 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') {
- $in_sample = $submission->get_submissions_in_sample_by_stage($stage);
- if (!$in_sample && $stage != 'assessor_1') {
+ $insample = $submission->get_submissions_in_sample_by_stage($stage);
+ if (!$insample && $stage != 'assessor_1') {
continue;
}
}
@@ -576,11 +576,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, $stageidentifier, $usesrubric=false) {
global $DB, $USER;
// workout markernumber
- if ($stage_identifier == 'assessor_1') {
+ if ($stageidentifier == 'assessor_1') {
// assessor_1 is always marker 1
$markernumber = 1;
} else {
@@ -592,35 +592,35 @@ public function add_grade($submissionid, $grade, $feedback, $stage_identifier, $
$gradejudge = new grade_judge($this->coursework);
$grade = $gradejudge->get_grade($grade);
- $add_grade = new \stdClass();
- $add_grade->id = '';
- $add_grade->submissionid = $submissionid;
- $add_grade->assessorid = $USER->id;
- $add_grade->timecreated = time();
- $add_grade->timemodified = time();
+ $addgrade = new \stdClass();
+ $addgrade->id = '';
+ $addgrade->submissionid = $submissionid;
+ $addgrade->assessorid = $USER->id;
+ $addgrade->timecreated = time();
+ $addgrade->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
- $add_grade->grade = (!$uses_rubric) ? $grade : null;
- $add_grade->feedbackcomment = $feedback;
- $add_grade->lasteditedbyuser = $USER->id;
- $add_grade->markernumber = $markernumber;
- $add_grade->stage_identifier = $stage_identifier;
- $add_grade->finalised = 1;
+ $addgrade->grade = (!$usesrubric) ? $grade : null;
+ $addgrade->feedbackcomment = $feedback;
+ $addgrade->lasteditedbyuser = $USER->id;
+ $addgrade->markernumber = $markernumber;
+ $addgrade->stage_identifier = $stageidentifier;
+ $addgrade->finalised = 1;
- $feedbackid = $DB->insert_record('coursework_feedbacks', $add_grade, true);
+ $feedbackid = $DB->insert_record('coursework_feedbacks', $addgrade, true);
- if ($uses_rubric) {
+ if ($usesrubric) {
$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);
$rubricgrade = $gradinginstance->submit_and_get_grade($grade, $feedbackid);
- $add_grade->id = $feedbackid;
- $add_grade->grade = $rubricgrade;
+ $addgrade->id = $feedbackid;
+ $addgrade->grade = $rubricgrade;
- $DB->update_record('coursework_feedbacks', $add_grade);
+ $DB->update_record('coursework_feedbacks', $addgrade);
}
@@ -634,11 +634,11 @@ 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, $stageidentifier) {
global $DB;
$record = $DB->get_record('coursework_feedbacks', ['submissionid' => $submissionid,
- 'stage_identifier' => $stage_identifier],
+ 'stage_identifier' => $stageidentifier],
'id');
return $record->id;
@@ -652,10 +652,10 @@ 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, $usesrubric=false) {
global $DB, $USER;
- if (!$uses_rubric) {
+ if (!$usesrubric) {
$gradejudge = new grade_judge($this->coursework);
$grade = $gradejudge->get_grade($grade);
} else {
@@ -670,19 +670,19 @@ public function edit_grade($cwfeedbackid, $grade, $feedback, $uses_rubric=false)
$update = false;
// update record only if the value of grade or feedback is changed
- $current_feedback = $DB->get_record('coursework_feedbacks', ['id' => $cwfeedbackid]);
+ $currentfeedback = $DB->get_record('coursework_feedbacks', ['id' => $cwfeedbackid]);
- if ($current_feedback->grade != $grade || strip_tags($current_feedback->feedbackcomment) != $feedback) {
+ if ($currentfeedback->grade != $grade || strip_tags($currentfeedback->feedbackcomment) != $feedback) {
- $edit_grade = new \stdClass();
- $edit_grade->id = $cwfeedbackid;
- $edit_grade->timemodified = time();
- $edit_grade->grade = $grade;
- $edit_grade->feedbackcomment = $feedback;
- $edit_grade->lasteditedbyuser = $USER->id;
- $edit_grade->finalised = 1;
+ $editgrade = new \stdClass();
+ $editgrade->id = $cwfeedbackid;
+ $editgrade->timemodified = time();
+ $editgrade->grade = $grade;
+ $editgrade->feedbackcomment = $feedback;
+ $editgrade->lasteditedbyuser = $USER->id;
+ $editgrade->finalised = 1;
- $update = $DB->update_record('coursework_feedbacks', $edit_grade);
+ $update = $DB->update_record('coursework_feedbacks', $editgrade);
// if record updated and coursework has automatic grading enabled update agreedgrade
if ($update && $this->coursework->automaticagreement_enabled()) {
@@ -703,7 +703,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, $cellidentifier) {
global $DB, $USER;
$submission = $DB->get_record('coursework_submissions', ['id' => $submissionid]);
@@ -711,10 +711,10 @@ public function get_stage_identifier($submissionid, $cell_identifier) {
$submission = \mod_coursework\models\submission::find($submission);
// single marked - singlegrade - allocated/notallocated
- $stage_identifier = 'assessor_1';
+ $stageidentifier = 'assessor_1';
//double marked - singlegrade - allocated
- if ($this->coursework->get_max_markers() > 1 && ($cell_identifier == 'singlegrade' || $cell_identifier == 'feedbackcomments')
+ if ($this->coursework->get_max_markers() > 1 && ($cellidentifier == 'singlegrade' || $cellidentifier == 'feedbackcomments')
&& $this->coursework->allocation_enabled()) {
$dbrecord = $DB->get_record('coursework_allocation_pairs',
@@ -723,11 +723,11 @@ public function get_stage_identifier($submissionid, $cell_identifier) {
'allocatabletype' => $submission->allocatabletype,
'assessorid' => $USER->id,
]);
- $stage_identifier = $dbrecord->stage_identifier;
+ $stageidentifier = $dbrecord->stage_identifier;
}
//double marked - singlegrade - notallocated
- if ($this->coursework->get_max_markers() > 1 && ($cell_identifier == 'singlegrade' || $cell_identifier == 'feedbackcomments')
+ if ($this->coursework->get_max_markers() > 1 && ($cellidentifier == 'singlegrade' || $cellidentifier == 'feedbackcomments')
&& !$this->coursework->allocation_enabled()) {
// if any part of initial submission graded by the user then get stage_identifier from feedback
@@ -738,7 +738,7 @@ public function get_stage_identifier($submissionid, $cell_identifier) {
AND stage_identifier <> 'final_agreed_1'";
$record = $DB->get_record_sql($sql);
if (!empty($record)) {
- $stage_identifier = $record->stage_identifier;
+ $stageidentifier = $record->stage_identifier;
} else if (!$this->coursework->sampling_enabled()) { // Samplings disabled
// workout if any stage is still available
$sql = "SELECT count(*) as graded FROM {coursework_feedbacks}
@@ -748,15 +748,15 @@ public function get_stage_identifier($submissionid, $cell_identifier) {
if ($this->coursework->get_max_markers() > $record->graded) {
$stage = $record->graded + 1;
- $stage_identifier = 'assessor_' . $stage;
+ $stageidentifier = 'assessor_' . $stage;
}
} else if ($this->coursework->sampling_enabled()) { // samplings enabled
- $in_sample = ($subs = $submission->get_submissions_in_sample()) ? count($subs) : 0;
+ $insample = ($subs = $submission->get_submissions_in_sample()) ? count($subs) : 0;
$feedback = $DB->record_exists('coursework_feedbacks', ['submissionid' => $submissionid,
'stage_identifier' => 'assessor_1']);
// no sample or no feedback for sample yet
- if (!$in_sample || ($in_sample && !$feedback)) {
- $stage_identifier = 'assessor_1';
+ if (!$insample || ($insample && !$feedback)) {
+ $stageidentifier = 'assessor_1';
} else { // find out which sample wasn't graded yet
$samples = $submission->get_submissions_in_sample();
foreach ($samples as $sample) {
@@ -764,7 +764,7 @@ public function get_stage_identifier($submissionid, $cell_identifier) {
'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;
+ $stageidentifier = $sample->stage_identifier;
break;
}
}
@@ -774,16 +774,16 @@ 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') {
- $stage_identifier = 'assessor_' . (substr($cell_identifier, -1));
+ if ($this->coursework->get_max_markers() > 1 && ($cellidentifier != 'singlegrade' && $cellidentifier != 'feedbackcomments')) {
+ if (substr($cellidentifier, 0, 8) == 'assessor') {
+ $stageidentifier = 'assessor_' . (substr($cellidentifier, -1));
//$cells[$i] = substr($cells[$i], 0, -1);
- } else if (substr($cell_identifier, 0, 6) == 'agreed') {
- $stage_identifier = 'final_agreed_1';
+ } else if (substr($cellidentifier, 0, 6) == 'agreed') {
+ $stageidentifier = 'final_agreed_1';
}
}
- return $stage_identifier;
+ return $stageidentifier;
}
/**
@@ -796,46 +796,46 @@ public function auto_agreement($cwfeedbackid) {
$feedback = $DB->get_record('coursework_feedbacks', ['id' => $cwfeedbackid]);
$feedback = \mod_coursework\models\feedback::find($feedback);
- $auto_feedback_classname = '\mod_coursework\auto_grader\\' . $this->coursework->automaticagreementstrategy;
+ $autofeedbackclassname = '\mod_coursework\auto_grader\\' . $this->coursework->automaticagreementstrategy;
/**
* @var auto_grader $auto_grader
*/
- $auto_grader = new $auto_feedback_classname($this->coursework,
+ $autograder = new $autofeedbackclassname($this->coursework,
$feedback->get_submission()->get_allocatable(),
$this->coursework->automaticagreementrange);
- $auto_grader->create_auto_grade_if_rules_match();
+ $autograder->create_auto_grade_if_rules_match();
}
- public function remove_other_assessors_grade($csv_cells, &$line) {
+ public function remove_other_assessors_grade($csvcells, &$line) {
$otherassessors = false;
- if (in_array('otherassessors', $csv_cells)) {
+ if (in_array('otherassessors', $csvcells)) {
// find position of otherassesors so we know from which key to unset
- $key = array_search('otherassessors', $csv_cells);
- unset($csv_cells[$key]);
+ $key = array_search('otherassessors', $csvcells);
+ unset($csvcells[$key]);
$othercells = $this->other_assessors_cells();
if ($this->coursework->is_using_rubric()) {
- $singlegradeposition = array_search('singlegrade', $csv_cells);
+ $singlegradeposition = array_search('singlegrade', $csvcells);
$criterias = $this->coursework->get_rubric_criteria();
$startposition = $singlegradeposition + ((count($criterias) * 2) + 1);
} else {
- $startposition = array_search('otherassessors', $csv_cells);
+ $startposition = array_search('otherassessors', $csvcells);
}
for ($i = $startposition; $i < $startposition + $othercells; $i++) {
unset($line[$i]);
}
- $csv_cells = array_values($csv_cells);
+ $csvcells = array_values($csvcells);
$line = array_values($line);
}
- return $csv_cells;
+ return $csvcells;
}
}
diff --git a/classes/forms/advance_plugins_form.php b/classes/forms/advance_plugins_form.php
index f95b9acf..50879023 100644
--- a/classes/forms/advance_plugins_form.php
+++ b/classes/forms/advance_plugins_form.php
@@ -50,7 +50,7 @@ public function definition() {
$mform->addElement('editor', 'text_element', get_string('comment', 'mod_coursework'), []);
$mform->setType('editor', PARAM_RAW);
- $file_manager_options = [
+ $filemanageroptions = [
'subdirs' => false,
'accepted_types' => '*',
'return_types' => FILE_INTERNAL,
@@ -59,7 +59,7 @@ public function definition() {
'file_element',
'',
null,
- $file_manager_options);
+ $filemanageroptions);
}
}
diff --git a/classes/forms/assessor_feedback_mform.php b/classes/forms/assessor_feedback_mform.php
index 1ee7b250..00a60679 100644
--- a/classes/forms/assessor_feedback_mform.php
+++ b/classes/forms/assessor_feedback_mform.php
@@ -44,7 +44,7 @@ class assessor_feedback_mform extends moodleform {
/**
* @var int the id of the submission that the grade pertains to
*/
- public $submission_id;
+ public $submissionid;
/**
* @var int
@@ -105,7 +105,7 @@ public function definition() {
$mform->addElement('editor', 'feedbackcomment', get_string('comment', 'mod_coursework'));
$mform->setType('editor', PARAM_RAW);
- $file_manager_options = [
+ $filemanageroptions = [
'subdirs' => false,
'accepted_types' => '*',
'return_types' => FILE_INTERNAL,
@@ -116,7 +116,7 @@ public function definition() {
'feedback_manager',
$uploadfilestring,
null,
- $file_manager_options);
+ $filemanageroptions);
$this->add_submit_buttons($coursework->draft_feedback_enabled(), $feedback->id);
@@ -134,24 +134,24 @@ public function get_grading_controller() {
*/
public function add_submit_buttons($draftenabled, $feedbackid) {
- $button_array = [];
+ $buttonarray = [];
if ($draftenabled) {
- $button_array[] = $this->_form->createElement('submit', 'submitfeedbackbutton', get_string('saveasdraft', 'coursework'));
+ $buttonarray[] = $this->_form->createElement('submit', 'submitfeedbackbutton', get_string('saveasdraft', 'coursework'));
}
- $button_array[] =
+ $buttonarray[] =
$this->_form->createElement('submit', 'submitbutton', get_string('saveandfinalise', 'coursework'));
$feedback = $this->_customdata['feedback'];
- $is_published = $feedback->get_submission()->is_published();
+ $ispublished = $feedback->get_submission()->is_published();
- if ($feedbackid && !$is_published) {
- $button_array[] = $this->_form->createElement('submit', 'removefeedbackbutton', get_string('removefeedback', 'coursework'));
+ if ($feedbackid && !$ispublished) {
+ $buttonarray[] = $this->_form->createElement('submit', 'removefeedbackbutton', get_string('removefeedback', 'coursework'));
}
- $button_array[] = $this->_form->createElement('cancel');
- $this->_form->addGroup($button_array, 'buttonar', '', [' '], false);
+ $buttonarray[] = $this->_form->createElement('cancel');
+ $this->_form->addGroup($buttonarray, 'buttonar', '', [' '], false);
$this->_form->closeHeaderBefore('buttonar');
}
diff --git a/classes/forms/deadline_extension_form.php b/classes/forms/deadline_extension_form.php
index 163b82e4..5471952f 100644
--- a/classes/forms/deadline_extension_form.php
+++ b/classes/forms/deadline_extension_form.php
@@ -44,8 +44,8 @@ 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).' ');
+ if ($this->get_coursework()->personaldeadlineenabled && $personaldeadline = $this->personal_deadline()) {
+ $this->_form->addElement('html', 'Personal deadline: '. userdate($personaldeadline->personal_deadline).' ');
} else {
// Current deadline for comparison
$this->_form->addElement('html', 'Default deadline: ' . userdate($this->get_coursework()->deadline) . ' ');
@@ -55,13 +55,13 @@ protected function definition() {
$this->_form->addElement('date_time_selector', 'extended_deadline', get_string('extended_deadline',
'mod_coursework'));
- $extension_reasons = coursework::extension_reasons();
- if (!empty($extension_reasons)) {
+ $extensionreasons = coursework::extension_reasons();
+ if (!empty($extensionreasons)) {
$this->_form->addElement('select',
'pre_defined_reason',
get_string('extension_reason',
'mod_coursework'),
- $extension_reasons);
+ $extensionreasons);
}
$this->_form->addElement('editor', 'extra_information', get_string('extra_information', 'mod_coursework'));
@@ -82,10 +82,10 @@ private function get_coursework() {
*/
public function validation($data, $files) {
global $CFG;
- $max_deadline = $CFG->coursework_max_extension_deadline;
+ $maxdeadline = $CFG->coursework_max_extension_deadline;
- if ($this->get_coursework()->personaldeadlineenabled && $personal_deadline = $this->personal_deadline()) {
- $deadline = $personal_deadline->personal_deadline;
+ if ($this->get_coursework()->personaldeadlineenabled && $personaldeadline = $this->personal_deadline()) {
+ $deadline = $personaldeadline->personal_deadline;
} else {
$deadline = $this->get_coursework()->deadline;
}
@@ -94,8 +94,8 @@ public function validation($data, $files) {
if ($data['extended_deadline'] <= $deadline) {
$errors['extended_deadline'] = 'The new deadline must be later than the current deadline';
}
- if ($data['extended_deadline'] >= strtotime("+$max_deadline months", $deadline)) {
- $errors['extended_deadline'] = "The new deadline must not be later than $max_deadline months after the current deadline";
+ if ($data['extended_deadline'] >= strtotime("+$maxdeadline months", $deadline)) {
+ $errors['extended_deadline'] = "The new deadline must not be later than $maxdeadline months after the current deadline";
}
return $errors;
}
@@ -124,7 +124,7 @@ public function personal_deadline() {
'courseworkid' => $courseworkid,
];
- return $personal_deadline = $DB->get_record('coursework_person_deadlines', $params);
+ return $personaldeadline = $DB->get_record('coursework_person_deadlines', $params);
}
}
diff --git a/classes/forms/moderator_agreement_mform.php b/classes/forms/moderator_agreement_mform.php
index 899cc172..ff99e574 100644
--- a/classes/forms/moderator_agreement_mform.php
+++ b/classes/forms/moderator_agreement_mform.php
@@ -41,7 +41,7 @@ class moderator_agreement_mform extends moodleform {
/**
* @var int the id of the submission that the grade pertains to
*/
- public $submission_id;
+ public $submissionid;
/**
* @var int
diff --git a/classes/forms/plagiarism_flagging_mform.php b/classes/forms/plagiarism_flagging_mform.php
index 99cf4c5b..7176f738 100644
--- a/classes/forms/plagiarism_flagging_mform.php
+++ b/classes/forms/plagiarism_flagging_mform.php
@@ -41,7 +41,7 @@ class plagiarism_flagging_mform extends moodleform {
/**
* @var int the id of the submission that the grade pertains to
*/
- public $submission_id;
+ public $submissionid;
/**
* Makes the form elements.
@@ -53,9 +53,9 @@ public function definition() {
/**
* @var $plagiarism_flag plagiarism_flag
*/
- $plagiarism_flag = $this->_customdata['plagiarism_flag'];
+ $plagiarismflag = $this->_customdata['plagiarism_flag'];
- $mform->addElement('hidden', 'submissionid', $plagiarism_flag->get_submission()->id);
+ $mform->addElement('hidden', 'submissionid', $plagiarismflag->get_submission()->id);
$mform->setType('submissionid', PARAM_INT);
// plagiarism status
diff --git a/classes/forms/publish_form.php b/classes/forms/publish_form.php
index 8be01f98..a799bf29 100644
--- a/classes/forms/publish_form.php
+++ b/classes/forms/publish_form.php
@@ -46,11 +46,11 @@ public function definition() {
$attributes = [];
$explaintext = false;
- $should_release = true;
+ $shouldrelease = true;
if (!$coursework->has_stuff_to_publish()) {
- $should_release = false;
+ $shouldrelease = false;
$explaintext = get_string('nofinalgradedworkyet', 'mod_coursework');
} else if ($coursework->blindmarking_enabled() && $coursework->has_stuff_to_publish()) {
@@ -62,12 +62,12 @@ public function definition() {
$coursework->moderation_enabled() &&
$coursework->unmoderated_work_exists()) {
- $should_release = false;
+ $shouldrelease = false;
$explaintext = get_string('unmoderatedworkexists', 'mod_coursework');
}
// Confusing to show them the button with nothing to release.
- if ($coursework->has_stuff_to_publish() && $should_release) {
+ if ($coursework->has_stuff_to_publish() && $shouldrelease) {
$buttontext = get_string('publish', 'coursework');
$this->_form->addElement('submit', 'publishbutton', $buttontext, $attributes);
}
diff --git a/classes/forms/student_submission_form.php b/classes/forms/student_submission_form.php
index c95d483a..934bb78e 100644
--- a/classes/forms/student_submission_form.php
+++ b/classes/forms/student_submission_form.php
@@ -145,8 +145,8 @@ public function handle() {
$file = $submission->get_first_submitted_file();
$file->get_id();
- $file_information = new stdClass();
- $file_information->id = $file->get_id();
+ $fileinformation = new stdClass();
+ $fileinformation->id = $file->get_id();
// Some files may have more thn one dot in the name. This makes sure we get the chunk after
// the last dot.
@@ -156,18 +156,18 @@ public function handle() {
if (!empty($extension)) {
$extension = '.'.$extension;
}
- $file_information->filename = $coursework->get_username_hash($submission->userid).$extension;
+ $fileinformation->filename = $coursework->get_username_hash($submission->userid).$extension;
$pathnamehash = file_storage::get_pathname_hash($file->get_contextid(),
$file->get_component(),
$file->get_filearea(),
$file->get_itemid(),
$file->get_filepath(),
- $file_information->filename);
+ $fileinformation->filename);
- $file_information->pathnamehash = $pathnamehash;
+ $fileinformation->pathnamehash = $pathnamehash;
- $DB->update_record('files', $file_information);
+ $DB->update_record('files', $fileinformation);
// Force submission to update file record.
$submission->submission_files = null;
@@ -209,10 +209,10 @@ public function handle() {
if ($CFG->coursework_allsubmissionreceipt || $data->finalisebutton) {
// send the receipts to students
- $students_who_need_a_receipt = $submission->get_students();
+ $studentswhoneedareceipt = $submission->get_students();
$mailer = new mailer($coursework);
- foreach ($students_who_need_a_receipt as $student) {
+ foreach ($studentswhoneedareceipt as $student) {
$mailer->send_submission_receipt($student, $data->finalisebutton);
}
}
@@ -241,19 +241,19 @@ public function set_data($submission) {
// Get any files that were previously submitted. This fetches an itemid from the $_GET
// params.
- $draft_item_id = file_get_submitted_draft_itemid('submission_manager');
+ $draftitemid = file_get_submitted_draft_itemid('submission_manager');
// Put them into a draft area.
- file_prepare_draft_area($draft_item_id,
+ file_prepare_draft_area($draftitemid,
$this->get_coursework()->get_context_id(),
'mod_coursework',
'submission',
$this->get_submission()->id,
$this->get_coursework()->get_file_options());
// Load that area into the form.
- $submission->submission_manager = $draft_item_id;
+ $submission->submission_manager = $draftitemid;
$data = new stdClass();
- $data->submission_manager = $draft_item_id;
+ $data->submission_manager = $draftitemid;
$data->courseworkid = $this->get_coursework()->id;
$data->userid = $submission->userid;
$data->submissionid = $this->get_submission()->id;
@@ -282,12 +282,12 @@ protected function get_submission() {
protected function add_agree_terms_elements_to_form() {
global $CFG;
- $terms_html = '';
- $terms_html .= html_writer::start_tag('h4');
- $terms_html .= get_string('youmustagreetotheterms', 'mod_coursework');
- $terms_html .= html_writer::end_tag('h4');
- $terms_html .= $CFG->coursework_agree_terms_text;
- $this->_form->addElement('html', $terms_html);
+ $termshtml = '';
+ $termshtml .= html_writer::start_tag('h4');
+ $termshtml .= get_string('youmustagreetotheterms', 'mod_coursework');
+ $termshtml .= html_writer::end_tag('h4');
+ $termshtml .= $CFG->coursework_agree_terms_text;
+ $this->_form->addElement('html', $termshtml);
$this->_form->addElement('checkbox', 'termsagreed', get_string('iagreetotheterms', 'mod_coursework'));
$this->_form->setType('termsagreed', PARAM_INT);
$this->_form->addRule('termsagreed', null, 'required');
@@ -301,20 +301,20 @@ protected function add_submit_buttons_to_form() {
$ability = new ability(user::find($USER), $this->get_coursework());
- $button_array = [];
+ $buttonarray = [];
// 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.
if (($ability->can('create', $this->get_submission()) || $ability->can('update', $this->get_submission()))
&& $this->get_submission()->get_coursework()->has_deadline() ) {
- $button_array[] = $this->_form->createElement('submit', 'submitbutton', get_string('submit'));
+ $buttonarray[] = $this->_form->createElement('submit', 'submitbutton', get_string('submit'));
}
if ($ability->can('finalise', $this->get_submission())) {
- $button_array[] =
+ $buttonarray[] =
$this->_form->createElement('submit', 'finalisebutton', get_string('submitandfinalise', 'coursework'));
}
- $button_array[] = $this->_form->createElement('cancel');
- $this->_form->addGroup($button_array, 'buttonar', '', [' '], false);
+ $buttonarray[] = $this->_form->createElement('cancel');
+ $this->_form->addGroup($buttonarray, 'buttonar', '', [' '], false);
$this->_form->closeHeaderBefore('buttonar');
}
@@ -364,14 +364,14 @@ protected function add_file_manager_to_form() {
* @throws \coding_exception
*/
protected function add_instructions_to_form() {
- $file_manager_options = $this->get_file_manager_options();
+ $filemanageroptions = $this->get_file_manager_options();
$usernamehash = $this->get_coursework()->get_username_hash($this->get_submission()->userid);
$filerenamestring = ($this->get_coursework()->renamefiles == 1) ? get_string('file_rename', 'coursework', $usernamehash) : "";
$filerenamestring .= $this->make_plagiarism_instructions();
$filerenamestring .= html_writer::empty_tag('br');
- if ($file_manager_options['accepted_types'] != '*') {
- $filerenamestring .= 'Allowed file types: ' . implode(' ', $file_manager_options['accepted_types']);
+ if ($filemanageroptions['accepted_types'] != '*') {
+ $filerenamestring .= 'Allowed file types: ' . implode(' ', $filemanageroptions['accepted_types']);
} else {
$filerenamestring .= 'All file types are allowed.';
}
@@ -383,11 +383,11 @@ protected function add_instructions_to_form() {
* @throws \coding_exception
*/
protected function add_header_to_form() {
- $file_manager_options = $this->get_file_manager_options();
- $files_string = ($file_manager_options['maxfiles'] == 1) ? 'yoursubmissionfile' : 'yoursubmissionfiles';
+ $filemanageroptions = $this->get_file_manager_options();
+ $filesstring = ($filemanageroptions['maxfiles'] == 1) ? 'yoursubmissionfile' : 'yoursubmissionfiles';
$renamed = ($this->get_coursework()->renamefiles == 1) ? get_string('yoursubmissionfile_renamed', 'coursework') : "";
- $this->_form->addElement('header', 'submitform', get_string($files_string, 'coursework'). $renamed);
+ $this->_form->addElement('header', 'submitform', get_string($filesstring, 'coursework'). $renamed);
}
@@ -395,26 +395,26 @@ protected function add_header_to_form() {
* @return array
*/
protected function get_file_manager_options() {
- $file_manager_options = $this->get_coursework()->get_file_options();
- return $file_manager_options;
+ $filemanageroptions = $this->get_coursework()->get_file_options();
+ return $filemanageroptions;
}
/**
* @return string
*/
protected function make_plagiarism_instructions() {
- $plagiarism_helpers = $this->get_coursework()->get_plagiarism_helpers();
- $plagiarism_instructions = [];
- foreach ($plagiarism_helpers as $helper) {
+ $plagiarismhelpers = $this->get_coursework()->get_plagiarism_helpers();
+ $plagiarisminstructions = [];
+ foreach ($plagiarismhelpers as $helper) {
if ($helper->file_submission_instructions()) {
- $plagiarism_instructions[] = $helper->file_submission_instructions();
+ $plagiarisminstructions[] = $helper->file_submission_instructions();
}
}
- $plagiarism_instructions = implode(' ', $plagiarism_instructions);
- if ($plagiarism_instructions) {
- $plagiarism_instructions = ' ' . $plagiarism_instructions;
- return $plagiarism_instructions;
+ $plagiarisminstructions = implode(' ', $plagiarisminstructions);
+ if ($plagiarisminstructions) {
+ $plagiarisminstructions = ' ' . $plagiarisminstructions;
+ return $plagiarisminstructions;
}
- return $plagiarism_instructions;
+ return $plagiarisminstructions;
}
}
diff --git a/classes/framework/ability.php b/classes/framework/ability.php
index edf38364..b7ef2ec9 100644
--- a/classes/framework/ability.php
+++ b/classes/framework/ability.php
@@ -120,8 +120,8 @@ protected function get_action_type($thing) {
return $thing;
}
- $class_name_with_namespace = get_class($thing);
- $bits = explode('\\', $class_name_with_namespace); // 'mod_coursework\models\submission'
+ $classnamewithnamespace = get_class($thing);
+ $bits = explode('\\', $classnamewithnamespace); // 'mod_coursework\models\submission'
$classname = end($bits); // 'submission'
// For non-standard things like decorated classes:
diff --git a/classes/framework/decorator.php b/classes/framework/decorator.php
index c4baa925..1f137f98 100644
--- a/classes/framework/decorator.php
+++ b/classes/framework/decorator.php
@@ -33,13 +33,13 @@ class decorator {
/**
* @var
*/
- protected $wrapped_object;
+ protected $wrappedobject;
/**
* @param $wrapped_object
*/
- public function __construct($wrapped_object) {
- $this->wrapped_object = $wrapped_object;
+ public function __construct($wrappedobject) {
+ $this->wrapped_object = $wrappedobject;
}
/**
diff --git a/classes/framework/test/classes/user_table.php b/classes/framework/test/classes/user_table.php
index afc21545..7deb3c15 100644
--- a/classes/framework/test/classes/user_table.php
+++ b/classes/framework/test/classes/user_table.php
@@ -31,6 +31,6 @@ class framework_user_table extends \mod_coursework\framework\table_base {
/**
* @var string
*/
- protected static $table_name = 'user';
+ protected static $tablename = 'user';
}
diff --git a/classes/grading_report.php b/classes/grading_report.php
index 0a6960ff..a39d2044 100644
--- a/classes/grading_report.php
+++ b/classes/grading_report.php
@@ -40,9 +40,9 @@
class grading_report {
//added static vars to determine in what manner the report is loaded
- public static $MODE_GET_ALL = 1;
- public static $MODE_GET_FIRST_RECORDS = 2;
- public static $MODE_GET_REMAIN_RECORDS = 3;
+ public static $modegetall = 1;
+ public static $modegetfirstrecords = 2;
+ public static $modegetremainrecords = 3;
/**
* @var array rendering options
@@ -73,7 +73,7 @@ class grading_report {
/**
* @var
*/
- private $sub_rows;
+ private $subrows;
/**
* @var cell_interface[]
@@ -102,13 +102,13 @@ public function __construct(array $options, $coursework) {
protected function fill_pool() {
global $DB;
- $coursework_id = $this->coursework->id;
- submission::fill_pool_coursework($coursework_id);
+ $courseworkid = $this->coursework->id;
+ submission::fill_pool_coursework($courseworkid);
coursework::fill_pool([$this->coursework]);
course_module::fill_pool([$this->coursework->get_course_module()]);
module::fill_pool($DB->get_records('modules', ['name' => 'coursework']));
- feedback::fill_pool_submissions($coursework_id, array_keys(submission::$pool[$coursework_id]['id']));
- allocation::fill_pool_coursework($coursework_id);
+ feedback::fill_pool_submissions($courseworkid, array_keys(submission::$pool[$courseworkid]['id']));
+ allocation::fill_pool_coursework($courseworkid);
}
/**
@@ -125,8 +125,8 @@ public function get_coursework() {
* @return string
*/
protected function construct_sort_function_name($options) {
- $method_name = 'sort_by_' . $options['sortby'];
- return $method_name;
+ $methodname = 'sort_by_' . $options['sortby'];
+ return $methodname;
}
/**
@@ -319,8 +319,8 @@ public function get_sub_row_helper() {
/**
* @param $rows_strategy
*/
- public function add_sub_rows($rows_strategy) {
- $this->sub_rows = $rows_strategy;
+ public function add_sub_rows($rowsstrategy) {
+ $this->sub_rows = $rowsstrategy;
}
/**
@@ -352,7 +352,7 @@ public function get_table_rows_for_page($rowcount = false) {
// Make tablerow objects so we can use the methods to check permissions and set things.
$rows = [];
- $row_class = $this->coursework->has_multiple_markers() ? 'mod_coursework\grading_table_row_multi' : 'mod_coursework\grading_table_row_single';
+ $rowclass = $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());
$participantsfound = 0;
@@ -372,15 +372,15 @@ public function get_table_rows_for_page($rowcount = false) {
}
}
- $row = new $row_class($this->coursework, $participant);
+ $row = new $rowclass($this->coursework, $participant);
// Now, we skip the ones who should not be visible on this page.
- $can_show = $ability->can('show', $row);
- if (!$can_show && !isset($options['unallocated'])) {
+ $canshow = $ability->can('show', $row);
+ if (!$canshow && !isset($options['unallocated'])) {
unset($participants[$key]);
continue;
}
- if ($can_show && isset($options['unallocated'])) {
+ if ($canshow && isset($options['unallocated'])) {
unset($participants[$key]);
continue;
}
@@ -394,11 +394,11 @@ public function get_table_rows_for_page($rowcount = false) {
}
// Sort the rows.
- $method_name = 'sort_by_' . $options['sortby'];
- if (method_exists($this, $method_name)) {
+ $methodname = 'sort_by_' . $options['sortby'];
+ if (method_exists($this, $methodname)) {
usort($rows,
[$this,
- $method_name]);
+ $methodname]);
}
// Some will have submissions and therefore data fields. Others will have those fields null.
@@ -406,13 +406,13 @@ public function get_table_rows_for_page($rowcount = false) {
$counter = count($rows);
$this->realtotalrows = $counter;
- $mode = empty($this->options['mode']) ? self::$MODE_GET_ALL : $this->options['mode'];
- if ($mode != self::$MODE_GET_ALL) {
+ $mode = empty($this->options['mode']) ? self::$modegetall : $this->options['mode'];
+ if ($mode != self::$modegetall) {
$perpage = $this->options['perpage'] ?? 10;
if ($counter > $perpage) {
- if ($mode == self::$MODE_GET_FIRST_RECORDS) {
+ if ($mode == self::$modegetfirstrecords) {
$rows = array_slice($rows, 0, $perpage);
- } else if ($mode == self::$MODE_GET_REMAIN_RECORDS) {
+ } else if ($mode == self::$modegetremainrecords) {
$rows = array_slice($rows, $perpage);
}
}
diff --git a/classes/grading_table_row_base.php b/classes/grading_table_row_base.php
index 7a08b2f4..ae8b88fc 100644
--- a/classes/grading_table_row_base.php
+++ b/classes/grading_table_row_base.php
@@ -197,17 +197,17 @@ public function get_personal_deadlines() {
return '';
}
- $personal_deadline = $DB->get_record('coursework_person_deadlines',
+ $personaldeadline = $DB->get_record('coursework_person_deadlines',
['courseworkid' => $this->get_coursework()->id,
'allocatableid' => $allocatable->id(),
'allocatabletype' => $allocatable->type()]);
- if ($personal_deadline) {
- $personal_deadline = $personal_deadline->personal_deadline;
+ if ($personaldeadline) {
+ $personaldeadline = $personaldeadline->personal_deadline;
} else {
- $personal_deadline = $this->get_coursework()->deadline;
+ $personaldeadline = $this->get_coursework()->deadline;
}
- return $personal_deadline;
+ return $personaldeadline;
}
/**
diff --git a/classes/mailer.php b/classes/mailer.php
index 7d9dee85..eb9fd1ee 100644
--- a/classes/mailer.php
+++ b/classes/mailer.php
@@ -59,21 +59,21 @@ public function send_submission_receipt($user, $finalised = false) {
if ($this->coursework && $this->coursework->is_coursework_visible()) {// check if coursework exists and is not hidden
- $email_data = new \stdClass();
- $email_data->name = $user->name();
+ $emaildata = new \stdClass();
+ $emaildata->name = $user->name();
$dateformat = '%a, %d %b %Y, %H:%M';
- $email_data->submittedtime = userdate($submission->time_submitted(), $dateformat);
- $email_data->coursework_name = $this->coursework->name;
- $email_data->submissionid = $submission->id;
+ $emaildata->submittedtime = userdate($submission->time_submitted(), $dateformat);
+ $emaildata->coursework_name = $this->coursework->name;
+ $emaildata->submissionid = $submission->id;
if ($finalised) {
- $email_data->finalised = get_string('save_email_finalised', 'coursework');
+ $emaildata->finalised = get_string('save_email_finalised', 'coursework');
} else {
- $email_data->finalised = '';
+ $emaildata->finalised = '';
}
$subject = get_string('save_email_subject', 'coursework');
- $text_body = get_string('save_email_text', 'coursework', $email_data);
- $html_body = get_string('save_email_html', 'coursework', $email_data);
+ $textbody = get_string('save_email_text', 'coursework', $emaildata);
+ $htmlbody = get_string('save_email_html', 'coursework', $emaildata);
// New approach.
$eventdata = new \core\message\message();
@@ -82,10 +82,10 @@ public function send_submission_receipt($user, $finalised = false) {
$eventdata->userfrom = \core_user::get_noreply_user();
$eventdata->userto = $user->get_raw_record();
$eventdata->subject = $subject;
- $eventdata->fullmessage = $text_body;
+ $eventdata->fullmessage = $textbody;
$eventdata->fullmessageformat = FORMAT_PLAIN;
- $eventdata->fullmessagehtml = $html_body;
- $eventdata->smallmessage = $text_body;
+ $eventdata->fullmessagehtml = $htmlbody;
+ $eventdata->smallmessage = $textbody;
$eventdata->notification = 1;
$eventdata->contexturl = $CFG->wwwroot . '/mod/coursework/view.php?id=' . $submission->get_coursework()->get_coursemodule_id();
$eventdata->contexturlname = 'View your submission here';
@@ -103,8 +103,8 @@ public function send_late_submission_notification($submission) {
global $CFG;
$coursework = $submission->get_coursework();
- $student_or_group = $submission->get_allocatable();
- $recipients = $coursework->initial_assessors($student_or_group);
+ $studentorgroup = $submission->get_allocatable();
+ $recipients = $coursework->initial_assessors($studentorgroup);
foreach ($recipients as $recipient) {
// New approach.
@@ -114,12 +114,12 @@ public function send_late_submission_notification($submission) {
$eventdata->userfrom = \core_user::get_noreply_user();
$eventdata->userto = $recipient;
$eventdata->subject = 'Late submission for '.$coursework->name;
- $message_text =
- 'A late submission was just submitted for ' . $student_or_group->type() . ' ' . $student_or_group->name();
- $eventdata->fullmessage = $message_text;
+ $messagetext =
+ 'A late submission was just submitted for ' . $studentorgroup->type() . ' ' . $studentorgroup->name();
+ $eventdata->fullmessage = $messagetext;
$eventdata->fullmessageformat = FORMAT_PLAIN;
- $eventdata->fullmessagehtml = $message_text;
- $eventdata->smallmessage = $message_text;
+ $eventdata->fullmessagehtml = $messagetext;
+ $eventdata->smallmessage = $messagetext;
$eventdata->notification = 1;
$eventdata->contexturl =
$CFG->wwwroot . '/mod/coursework/view.php?id=' . $coursework->get_coursemodule_id();
@@ -141,8 +141,8 @@ public function send_feedback_notification($submission) {
if ($this->coursework && $this->coursework->is_coursework_visible()) {// check if coursework exists and is not hidden
- $email_data = new \stdClass();
- $email_data->coursework_name = $this->coursework->name;
+ $emaildata = new \stdClass();
+ $emaildata->coursework_name = $this->coursework->name;
$subject = get_string('feedback_released_email_subject', 'coursework');
@@ -152,9 +152,9 @@ public function send_feedback_notification($submission) {
foreach ($students as $student) {
$student = \mod_coursework\models\user::find($student);
- $email_data->name = $student->name();
- $text_body = get_string('feedback_released_email_text', 'coursework', $email_data);
- $html_body = get_string('feedback_released_email_html', 'coursework', $email_data);
+ $emaildata->name = $student->name();
+ $textbody = get_string('feedback_released_email_text', 'coursework', $emaildata);
+ $htmlbody = get_string('feedback_released_email_html', 'coursework', $emaildata);
$eventdata = new \core\message\message();
$eventdata->component = 'mod_coursework';
@@ -162,10 +162,10 @@ public function send_feedback_notification($submission) {
$eventdata->userfrom = \core_user::get_noreply_user();
$eventdata->userto = $student->get_raw_record();
$eventdata->subject = $subject;
- $eventdata->fullmessage = $text_body;
+ $eventdata->fullmessage = $textbody;
$eventdata->fullmessageformat = FORMAT_PLAIN;
- $eventdata->fullmessagehtml = $html_body;
- $eventdata->smallmessage = $text_body;
+ $eventdata->fullmessagehtml = $htmlbody;
+ $eventdata->smallmessage = $textbody;
$eventdata->notification = 1;
$eventdata->contexturl = $CFG->wwwroot . '/mod/coursework/view.php?id=' . $submission->get_coursework()->get_coursemodule_id();
$eventdata->contexturlname = 'View your submission here';
@@ -190,29 +190,29 @@ public function send_student_deadline_reminder($user) {
if (!$this->coursework || !$this->coursework->is_coursework_visible()) {// check if coursework exists and is not hidden
return false;
}
- $email_data = new \stdClass();
- $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');
+ $emaildata = new \stdClass();
+ $emaildata->coursework_name = $this->coursework->name;
+ $emaildata->coursework_name_with_link = \html_writer::link($CFG->wwwroot . '/mod/coursework/view.php?id=' . $this->coursework->get_coursemodule_id(), $this->coursework->name);
+ $emaildata->deadline = $user->deadline;
+ $emaildata->human_deadline = userdate($user->deadline, '%a, %d %b %Y, %H:%M');
$secondstodeadline = $user->deadline - time();
$days = floor($secondstodeadline / 86400);
$hours = floor($secondstodeadline / 3600) % 24;
- $days_to_deadline = '';
+ $daystodeadline = '';
if ($days > 0) {
- $days_to_deadline = $days . ' days and ';
+ $daystodeadline = $days . ' days and ';
}
- $days_to_deadline .= $hours . ' hours';
- $email_data->day_hour = $days_to_deadline;
+ $daystodeadline .= $hours . ' hours';
+ $emaildata->day_hour = $daystodeadline;
- $subject = get_string('cron_email_subject', 'mod_coursework', $email_data);
+ $subject = get_string('cron_email_subject', 'mod_coursework', $emaildata);
$student = \mod_coursework\models\user::find($user);
- $email_data->name = $student->name();
- $text_body = get_string('cron_email_text', 'mod_coursework', $email_data);
- $html_body = get_string('cron_email_html', 'mod_coursework', $email_data);
+ $emaildata->name = $student->name();
+ $textbody = get_string('cron_email_text', 'mod_coursework', $emaildata);
+ $htmlbody = get_string('cron_email_html', 'mod_coursework', $emaildata);
$eventdata = new \core\message\message();
$eventdata->component = 'mod_coursework';
@@ -220,10 +220,10 @@ public function send_student_deadline_reminder($user) {
$eventdata->userfrom = \core_user::get_noreply_user();
$eventdata->userto = $student->get_raw_record();
$eventdata->subject = $subject;
- $eventdata->fullmessage = $text_body;
+ $eventdata->fullmessage = $textbody;
$eventdata->fullmessageformat = FORMAT_PLAIN;
- $eventdata->fullmessagehtml = $html_body;
- $eventdata->smallmessage = $text_body;
+ $eventdata->fullmessagehtml = $htmlbody;
+ $eventdata->smallmessage = $textbody;
$eventdata->notification = 1;
$eventdata->contexturl = $CFG->wwwroot . '/mod/coursework/view.php?id=' . $this->coursework->get_coursemodule_id();
$eventdata->contexturlname = 'View the coursework here';
@@ -238,16 +238,16 @@ public function send_submission_notification($userstonotify) {
if ($this->coursework && $this->coursework->is_coursework_visible()) {// check if coursework exists and is not hidden
- $email_data = new \stdClass();
- $email_data->coursework_name = $this->coursework->name;
+ $emaildata = new \stdClass();
+ $emaildata->coursework_name = $this->coursework->name;
- $subject = get_string('submission_notification_subject', 'coursework', $email_data->coursework_name);
+ $subject = get_string('submission_notification_subject', 'coursework', $emaildata->coursework_name);
$userstonotify = \mod_coursework\models\user::find($userstonotify);
- $email_data->name = $userstonotify->name();
- $text_body = get_string('submission_notification_text', 'coursework', $email_data);
- $html_body = get_string('submission_notification_html', 'coursework', $email_data);
+ $emaildata->name = $userstonotify->name();
+ $textbody = get_string('submission_notification_text', 'coursework', $emaildata);
+ $htmlbody = get_string('submission_notification_html', 'coursework', $emaildata);
$eventdata = new \core\message\message();
$eventdata->component = 'mod_coursework';
@@ -255,10 +255,10 @@ public function send_submission_notification($userstonotify) {
$eventdata->userfrom = \core_user::get_noreply_user();
$eventdata->userto = $userstonotify->get_raw_record();
$eventdata->subject = $subject;
- $eventdata->fullmessage = $text_body;
+ $eventdata->fullmessage = $textbody;
$eventdata->fullmessageformat = FORMAT_PLAIN;
- $eventdata->fullmessagehtml = $html_body;
- $eventdata->smallmessage = $text_body;
+ $eventdata->fullmessagehtml = $htmlbody;
+ $eventdata->smallmessage = $textbody;
$eventdata->notification = 1;
$eventdata->contexturl = $CFG->wwwroot . '/mod/coursework/view.php?id=' . $this->coursework->id();
$eventdata->contexturlname = 'coursework submission';
diff --git a/classes/models/course_module.php b/classes/models/course_module.php
index 392ffb0d..33f0b63a 100644
--- a/classes/models/course_module.php
+++ b/classes/models/course_module.php
@@ -35,7 +35,7 @@ class course_module extends table_base {
/**
* @var string
*/
- protected static $table_name = 'course_modules';
+ protected static $tablename = 'course_modules';
/**
* @var int
diff --git a/classes/models/moderation.php b/classes/models/moderation.php
index 86614f88..5d72bb5c 100644
--- a/classes/models/moderation.php
+++ b/classes/models/moderation.php
@@ -58,7 +58,7 @@ class moderation extends table_base {
/**
* @var int
*/
- public $stage_identifier = 'moderator';
+ public $stageidentifier = 'moderator';
/**
* @var string
*/
@@ -68,7 +68,7 @@ class moderation extends table_base {
/**
* @var string
*/
- protected static $table_name = 'coursework_mod_agreements';
+ protected static $tablename = 'coursework_mod_agreements';
/**
* @var string
diff --git a/classes/models/moderation_set_rule.php b/classes/models/moderation_set_rule.php
index 5242553d..e1935aa4 100644
--- a/classes/models/moderation_set_rule.php
+++ b/classes/models/moderation_set_rule.php
@@ -49,7 +49,7 @@ abstract class moderation_set_rule extends table_base implements renderable {
/**
* @var string DB table this class relates to.
*/
- protected static $table_name = 'coursework_mod_set_rules';
+ protected static $tablename = 'coursework_mod_set_rules';
/**
* @var int
@@ -123,7 +123,7 @@ public function __construct($dbrecord = false) {
* @param stage_base $stage
* @return mixed
*/
- abstract public function adjust_set(array &$moderationset, array &$potential_allocatables, $stage);
+ abstract public function adjust_set(array &$moderationset, array &$potentialallocatables, $stage);
/**
* Returns the name of the class without the 'coursework_moderation_set_rule_' prefix.
diff --git a/classes/models/null_user.php b/classes/models/null_user.php
index 4a694371..597c2336 100644
--- a/classes/models/null_user.php
+++ b/classes/models/null_user.php
@@ -59,7 +59,7 @@ public function type() {
* @param bool $with_picture
* @return string
*/
- public function profile_link($with_picture = false) {
+ public function profile_link($withpicture = false) {
return '';
}
diff --git a/classes/models/outstanding_marking.php b/classes/models/outstanding_marking.php
index 2d7d8a93..67f89094 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 $dayinsecs;
public function __construct() {
@@ -274,11 +274,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($courseid, $userid) {
- $coursecontext = \context_course::instance($course_id);
+ $coursecontext = \context_course::instance($courseid);
- return has_capability('mod/coursework:addagreedgrade', $coursecontext, $user_id) || has_capability('mod/coursework:addallocatedagreedgrade', $coursecontext, $user_id);
+ return has_capability('mod/coursework:addagreedgrade', $coursecontext, $userid) || has_capability('mod/coursework:addallocatedagreedgrade', $coursecontext, $userid);
}
/**
@@ -286,11 +286,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($courseid, $userid) {
- $coursecontext = \context_course::instance($course_id);
+ $coursecontext = \context_course::instance($courseid);
- return has_capability('mod/coursework:addinitialgrade', $coursecontext, $user_id);
+ return has_capability('mod/coursework:addinitialgrade', $coursecontext, $userid);
}
/**
@@ -303,9 +303,9 @@ 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
- $user_has_initial_grade_capability = $this->has_initial_grade($coursework->get_course()->id, $userid);
+ $userhasinitialgradecapability = $this->has_initial_grade($coursework->get_course()->id, $userid);
- return $user_has_initial_grade_capability;
+ return $userhasinitialgradecapability;
}
/**
@@ -318,9 +318,9 @@ 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
- $user_has_agreed_grade_capability = $this->has_agreed_grade($coursework->get_course()->id, $userid);
+ $userhasagreedgradecapability = $this->has_agreed_grade($coursework->get_course()->id, $userid);
- return $user_has_agreed_grade_capability;
+ return $userhasagreedgradecapability;
}
}
diff --git a/classes/models/personal_deadline.php b/classes/models/personal_deadline.php
index f9afd807..1a60c83c 100644
--- a/classes/models/personal_deadline.php
+++ b/classes/models/personal_deadline.php
@@ -44,7 +44,7 @@ class personal_deadline extends table_base {
/**
* @var string
*/
- protected static $table_name = 'coursework_person_deadlines';
+ protected static $tablename = 'coursework_person_deadlines';
/**
* @return mixed|\mod_coursework_coursework
@@ -59,8 +59,8 @@ public function get_coursework() {
}
public function get_allocatable() {
- $class_name = "\\mod_coursework\\models\\{$this->allocatabletype}";
- return $class_name::find($this->allocatableid);
+ $classname = "\\mod_coursework\\models\\{$this->allocatabletype}";
+ return $classname::find($this->allocatableid);
}
/**
@@ -108,9 +108,9 @@ public static function get_personal_deadline_for_student($student, $coursework)
* @param $coursework_id
* @return array
*/
- protected static function get_cache_array($coursework_id) {
+ protected static function get_cache_array($courseworkid) {
global $DB;
- $records = $DB->get_records(static::$table_name, ['courseworkid' => $coursework_id]);
+ $records = $DB->get_records(static::$tablename, ['courseworkid' => $courseworkid]);
$result = [
'allocatableid-allocatabletype' => [],
];
@@ -130,12 +130,12 @@ protected static function get_cache_array($coursework_id) {
* @param $params
* @return bool
*/
- public static function get_object($coursework_id, $key, $params) {
- if (!isset(self::$pool[$coursework_id])) {
- self::fill_pool_coursework($coursework_id);
+ public static function get_object($courseworkid, $key, $params) {
+ if (!isset(self::$pool[$courseworkid])) {
+ self::fill_pool_coursework($courseworkid);
}
- $value_key = implode('-', $params);
- return self::$pool[$coursework_id][$key][$value_key][0] ?? false;
+ $valuekey = implode('-', $params);
+ return self::$pool[$courseworkid][$key][$valuekey][0] ?? false;
}
/**
diff --git a/classes/models/reminder.php b/classes/models/reminder.php
index c15c74ab..0c964a5f 100644
--- a/classes/models/reminder.php
+++ b/classes/models/reminder.php
@@ -30,6 +30,6 @@
*/
class reminder extends table_base {
- protected static $table_name = 'coursework_reminder';
+ protected static $tablename = 'coursework_reminder';
}
diff --git a/classes/models/sample_set_rule.php b/classes/models/sample_set_rule.php
index 88f5227d..011551bb 100644
--- a/classes/models/sample_set_rule.php
+++ b/classes/models/sample_set_rule.php
@@ -49,7 +49,7 @@ abstract class sample_set_rule extends table_base implements renderable {
/**
* @var string DB table this class relates to.
*/
- protected static $table_name = 'coursework_mod_set_rules';
+ protected static $tablename = 'coursework_mod_set_rules';
/**
* @var int
@@ -126,7 +126,7 @@ public function __construct($coursework) {
* @param stage_base $stage
* @return mixed
*/
- abstract public function adjust_set(array &$moderationset, array &$potential_allocatables, $stage);
+ abstract public function adjust_set(array &$moderationset, array &$potentialallocatables, $stage);
/**
* Returns the name of the class without the 'coursework_moderation_set_rule_' prefix.
@@ -168,7 +168,7 @@ public static function allow_multiple() {
* @abstract
* @return mixed
*/
- abstract public function add_form_elements(coursework $coursework, $assessor_number);
+ abstract public function add_form_elements(coursework $coursework, $assessornumber);
/**
* Validates and saves data from the form elements defined by {@link get_form_elements()}.
diff --git a/classes/moderation_set_rule/minimum_range_grade_percent.php b/classes/moderation_set_rule/minimum_range_grade_percent.php
index e0b503f1..541a43a8 100644
--- a/classes/moderation_set_rule/minimum_range_grade_percent.php
+++ b/classes/moderation_set_rule/minimum_range_grade_percent.php
@@ -51,7 +51,7 @@ class minimum_range_grade_percent extends moderation_set_rule {
* @param \mod_coursework\stages\base $stage
* @return mixed
*/
- public function adjust_set(array &$moderation_set, array &$potential_allocatables, $stage) {
+ public function adjust_set(array &$moderationset, array &$potentialallocatables, $stage) {
// Convert percentages to raw grades for comparison.
global $DB;
@@ -62,7 +62,7 @@ public function adjust_set(array &$moderation_set, array &$potential_allocatable
$upperlimit = ($this->upperlimit / 100) * $maxgrade;
$lowerlimit = ($this->lowerlimit / 100) * $maxgrade;
- foreach ($potential_allocatables as $id => $allocatable) {
+ foreach ($potentialallocatables as $id => $allocatable) {
if ($this->allocatable_is_not_yet_graded($allocatable)) {
continue;
@@ -74,8 +74,8 @@ public function adjust_set(array &$moderation_set, array &$potential_allocatable
$this->grade_is_above_lower_limit($grade, $lowerlimit) &&
($this->counter < $this->minimum)) {
- $moderation_set[$id] = $allocatable;
- unset ($potential_allocatables[$id]);
+ $moderationset[$id] = $allocatable;
+ unset ($potentialallocatables[$id]);
$this->counter++;
}
}
diff --git a/classes/moderation_set_rule/minimum_range_grade_raw.php b/classes/moderation_set_rule/minimum_range_grade_raw.php
index cc4083e0..efa078ae 100644
--- a/classes/moderation_set_rule/minimum_range_grade_raw.php
+++ b/classes/moderation_set_rule/minimum_range_grade_raw.php
@@ -50,13 +50,13 @@ class minimum_range_grade_raw extends moderation_set_rule {
* @param \mod_coursework\stages\base $stage
* @return mixed
*/
- public function adjust_set(array &$moderation_set, array &$potential_allocatables, $stage) {
+ public function adjust_set(array &$moderationset, array &$potentialallocatables, $stage) {
// Convert percentages to raw grades for comparison.
$upperlimit = $this->upperlimit;
$lowerlimit = $this->lowerlimit;
- foreach ($potential_allocatables as $id => $allocatable) {
+ foreach ($potentialallocatables as $id => $allocatable) {
if ($this->allocatable_is_not_yet_graded($allocatable)) {
continue;
@@ -68,8 +68,8 @@ public function adjust_set(array &$moderation_set, array &$potential_allocatable
$grade >= $lowerlimit &&
($this->counter < $this->minimum)) {
- $moderation_set[$id] = $allocatable;
- unset ($potential_allocatables[$id]);
+ $moderationset[$id] = $allocatable;
+ unset ($potentialallocatables[$id]);
$this->counter++;
}
}
diff --git a/classes/moderation_set_rule/range_grade_percent.php b/classes/moderation_set_rule/range_grade_percent.php
index 5a5b7544..5e6763e1 100644
--- a/classes/moderation_set_rule/range_grade_percent.php
+++ b/classes/moderation_set_rule/range_grade_percent.php
@@ -48,14 +48,14 @@ class range_grade_percent extends moderation_set_rule {
* @param \mod_coursework\stages\base $stage
* @return mixed
*/
- public function adjust_set(array &$moderation_set, array &$potential_allocatables, $stage) {
+ public function adjust_set(array &$moderationset, array &$potentialallocatables, $stage) {
$maxgrade = $this->get_coursework()->get_max_grade();
// Convert percentages to raw grades for comparison.
$upperlimit = ($this->upperlimit / 100) * $maxgrade;
$lowerlimit = ($this->lowerlimit / 100) * $maxgrade;
- foreach ($potential_allocatables as $id => $allocatable) {
+ foreach ($potentialallocatables as $id => $allocatable) {
if ($this->allocatable_is_not_yet_graded($allocatable)) {
continue;
@@ -66,8 +66,8 @@ public function adjust_set(array &$moderation_set, array &$potential_allocatable
if ($grade <= $upperlimit &&
$grade >= $lowerlimit) {
- $moderation_set[$id] = $allocatable;
- unset ($potential_allocatables[$id]);
+ $moderationset[$id] = $allocatable;
+ unset ($potentialallocatables[$id]);
}
}
}
diff --git a/classes/moderation_set_rule/range_grade_raw.php b/classes/moderation_set_rule/range_grade_raw.php
index eae805ad..c2edac70 100644
--- a/classes/moderation_set_rule/range_grade_raw.php
+++ b/classes/moderation_set_rule/range_grade_raw.php
@@ -47,9 +47,9 @@ class range_grade_raw extends moderation_set_rule {
* @param \mod_coursework\stages\base $stage
* @return mixed
*/
- public function adjust_set(array &$moderation_set, array &$potential_allocatables, $stage) {
+ public function adjust_set(array &$moderationset, array &$potentialallocatables, $stage) {
- foreach ($potential_allocatables as $id => $allocatable) {
+ foreach ($potentialallocatables as $id => $allocatable) {
if ($this->allocatable_is_not_yet_graded($allocatable)) {
continue;
@@ -59,8 +59,8 @@ public function adjust_set(array &$moderation_set, array &$potential_allocatable
if ($grade <= $this->upperlimit && $grade >= $this->lowerlimit) {
- $moderation_set[$id] = $allocatable;
- unset ($potential_allocatables[$id]);
+ $moderationset[$id] = $allocatable;
+ unset ($potentialallocatables[$id]);
}
}
}
diff --git a/classes/moderation_set_rule/range_total_percent.php b/classes/moderation_set_rule/range_total_percent.php
index fa44c7cc..f1038f1e 100644
--- a/classes/moderation_set_rule/range_total_percent.php
+++ b/classes/moderation_set_rule/range_total_percent.php
@@ -65,23 +65,23 @@ public function __construct($dbrecord = false) {
* @param \mod_coursework\stages\base $stage
* @return mixed
*/
- public function adjust_set(array &$moderation_set, array &$potential_allocatables, $stage) {
+ public function adjust_set(array &$moderationset, array &$potentialallocatables, $stage) {
- $total_number = count($moderation_set) + count($potential_allocatables);
+ $totalnumber = count($moderationset) + count($potentialallocatables);
// We need to round up as we may have small numbers of students and e.g. 25% of 10 students ought to
// equate to 3.
- $number_needed = ceil($total_number * ($this->upperlimit / 100));
+ $numberneeded = ceil($totalnumber * ($this->upperlimit / 100));
- while (count($moderation_set) < $number_needed) {
+ while (count($moderationset) < $numberneeded) {
// Add random ones till we have enough.
- $id = array_rand($potential_allocatables);
+ $id = array_rand($potentialallocatables);
- $moderation_set[$id] = $potential_allocatables[$id];
- unset ($potential_allocatables[$id]);
+ $moderationset[$id] = $potentialallocatables[$id];
+ unset ($potentialallocatables[$id]);
- $number_needed--;
+ $numberneeded--;
}
}
diff --git a/classes/personal_deadline/allocatable.php b/classes/personal_deadline/allocatable.php
index b1e0441f..53b9df49 100644
--- a/classes/personal_deadline/allocatable.php
+++ b/classes/personal_deadline/allocatable.php
@@ -58,7 +58,7 @@ public function picture();
* @param bool $with_picture
* @return string
*/
- public function profile_link($with_picture = false);
+ public function profile_link($withpicture = false);
/**
* @param \stdClass $course
diff --git a/classes/personal_deadline/table/builder.php b/classes/personal_deadline/table/builder.php
index 2da72880..3201b202 100644
--- a/classes/personal_deadline/table/builder.php
+++ b/classes/personal_deadline/table/builder.php
@@ -78,11 +78,11 @@ public function get_rows() {
// Sort the rows.
$sorting = new mod_coursework\grading_report($this->options, $this->coursework);
- $method_name = 'sort_by_' . $this->options['sortby'];
- if (method_exists($sorting, $method_name)) {
+ $methodname = 'sort_by_' . $this->options['sortby'];
+ if (method_exists($sorting, $methodname)) {
usort($rows,
[$sorting,
- $method_name]);
+ $methodname]);
}
return $rows;
diff --git a/classes/personal_deadline/table/row/builder.php b/classes/personal_deadline/table/row/builder.php
index be671094..ddd3a4fc 100644
--- a/classes/personal_deadline/table/row/builder.php
+++ b/classes/personal_deadline/table/row/builder.php
@@ -54,8 +54,8 @@ class builder implements user_row {
* @param table_builder $personal_deadline_table
* @param allocatable $allocatable
*/
- public function __construct($personal_deadline_table, $allocatable) {
- $this->personaldeadlinetable = $personal_deadline_table;
+ public function __construct($personaldeadlinetable, $allocatable) {
+ $this->personaldeadlinetable = $personaldeadlinetable;
$this->allocatable = $allocatable;
}
@@ -184,28 +184,28 @@ public function get_personal_deadlines() {
return '';
}
- $personal_deadline = $DB->get_record('coursework_person_deadlines',
+ $personaldeadline = $DB->get_record('coursework_person_deadlines',
['courseworkid' => $this->get_coursework()->id,
'allocatableid' => $this->allocatable->id(),
'allocatabletype' => $this->allocatable->type()]);
- if ($personal_deadline) {
- $personal_deadline = $personal_deadline->personal_deadline;
+ if ($personaldeadline) {
+ $personaldeadline = $personaldeadline->personal_deadline;
} else {
- $personal_deadline = $this->get_coursework()->deadline;
+ $personaldeadline = $this->get_coursework()->deadline;
}
- return $personal_deadline;
+ return $personaldeadline;
}
public function get_submission_status() {
global $DB;
- $submission_db = $DB->get_record('coursework_submissions',
+ $submissiondb = $DB->get_record('coursework_submissions',
['courseworkid' => $this->get_coursework()->id,
'allocatableid' => $this->allocatable->id(),
'allocatabletype' => $this->allocatable->type()]);
- $submission = \mod_coursework\models\submission::find($submission_db);
+ $submission = \mod_coursework\models\submission::find($submissiondb);
$statustext = get_string('statusnotsubmitted', 'mod_coursework');
diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php
index c70e9b14..7405770a 100644
--- a/classes/privacy/provider.php
+++ b/classes/privacy/provider.php
@@ -345,11 +345,11 @@ public static function delete_data_for_users(approved_userlist $userlist) {
// Get the coursework related to this context.
$coursework = self::get_coursework_instance($context);
$userids = $userlist->get_userids();
- foreach ($userids as $user_id) {
+ foreach ($userids as $userid) {
// Get the coursework related to this context.
$coursework = self::get_coursework_instance($context);
// Retrieve all submissions by user-id to remove relating data
- $submissions = $coursework->retrieve_submissions_by_user($user_id);
+ $submissions = $coursework->retrieve_submissions_by_user($userid);
foreach ($submissions as $submission) {
// Remove all plagiarisms of the current submission
$coursework->remove_plagiarisms_by_submission($submission->id);
@@ -367,21 +367,21 @@ public static function delete_data_for_users(approved_userlist $userlist) {
$coursework->remove_feedbacks_by_submission($submission->id);
}
// Remove all submissions submitted by this user
- $coursework->remove_submissions_by_user($user_id);
+ $coursework->remove_submissions_by_user($userid);
// Remove all deadline extensions
- $coursework->remove_deadline_extensions_by_user($user_id);
+ $coursework->remove_deadline_extensions_by_user($userid);
// Remove all personal deadlines
- $coursework->remove_personal_deadlines_by_user($user_id);
+ $coursework->remove_personal_deadlines_by_user($userid);
}
}
protected static function get_coursework_instance(\context $context) {
global $DB;
- $courseId = ['id' => $context->get_course_context()->instanceid];
- $course = $DB->get_record('course', $courseId, '*', MUST_EXIST);
+ $courseid = ['id' => $context->get_course_context()->instanceid];
+ $course = $DB->get_record('course', $courseid, '*', MUST_EXIST);
$modinfo = get_fast_modinfo($course);
$coursemodule = $modinfo->get_cm($context->instanceid);
- $courseworkId = ['id' => $coursemodule->instance];
- $coursework = new \mod_coursework\models\coursework($courseworkId);
+ $courseworkid = ['id' => $coursemodule->instance];
+ $coursework = new \mod_coursework\models\coursework($courseworkid);
return $coursework;
}
/**
@@ -408,9 +408,9 @@ protected static function export_coursework_submissions($coursework, $user, $con
}
}
}
- protected static function export_submission_files($context, $submissionId, $currentpath) {
+ protected static function export_submission_files($context, $submissionid, $currentpath) {
$fs = get_file_storage();
- $files = $fs->get_area_files($context->id, 'mod_coursework', 'submission', $submissionId);
+ $files = $fs->get_area_files($context->id, 'mod_coursework', 'submission', $submissionid);
if (!empty($files)) {
foreach ($files as $file) {
writer::with_context($context)->export_file($currentpath, $file);
@@ -438,7 +438,7 @@ protected static function get_user_submissions($userid, $courseworkid) {
*/
protected static function export_coursework_submission(\stdClass $submission, \context $context, array $currentpath) {
$status = self::get_submissions_status($submission->id);
- $submissionData = (object)[
+ $submissiondata = (object)[
'userid' => $submission->userid,
'status' => $status ? $status : '',
'timecreated' => transform::datetime($submission->timecreated),
@@ -448,7 +448,7 @@ protected static function export_coursework_submission(\stdClass $submission, \c
'finalised' => transform::yesno($submission->finalised),
];
writer::with_context($context)
- ->export_data(array_merge($currentpath, [get_string('privacy:submissionpath', 'mod_coursework')]), $submissionData);
+ ->export_data(array_merge($currentpath, [get_string('privacy:submissionpath', 'mod_coursework')]), $submissiondata);
}
protected static function get_submissions_status($submissionid) {
$submission = new \mod_coursework\models\submission($submissionid);
@@ -464,11 +464,11 @@ protected static function get_submission_feedbacks($submissionid) {
return $feedbacks;
}
protected static function export_submissions_feedbacks($feedbacks, $context, $path) {
- $feedbacksData = [];
+ $feedbacksdata = [];
foreach ($feedbacks as $feedback) {
- $feedbackDataFormatted = self::format_submissions_feedback($feedback);
- if ($feedbackDataFormatted) {
- array_push($feedbacksData, $feedbackDataFormatted);
+ $feedbackdataformatted = self::format_submissions_feedback($feedback);
+ if ($feedbackdataformatted) {
+ array_push($feedbacksdata, $feedbackdataformatted);
}
if ($feedback->ismoderation) {
self::export_mod_agreements($feedback->id, $context, $path);
@@ -476,14 +476,14 @@ protected static function export_submissions_feedbacks($feedbacks, $context, $pa
self::export_feedback_files($context, $feedback->id, $path);
}
// coursework_feedbacks table contains all grading information
- if (!empty($feedbacksData)) {
+ if (!empty($feedbacksdata)) {
writer::with_context($context)
- ->export_data(array_merge($path, [get_string('privacy:feedbackspath', 'mod_coursework')]), (object) $feedbacksData);
+ ->export_data(array_merge($path, [get_string('privacy:feedbackspath', 'mod_coursework')]), (object) $feedbacksdata);
}
}
- protected static function export_feedback_files($context, $feedbackId, $currentpath) {
+ protected static function export_feedback_files($context, $feedbackid, $currentpath) {
$fs = get_file_storage();
- $files = $fs->get_area_files($context->id, 'mod_coursework', 'feedback', $feedbackId);
+ $files = $fs->get_area_files($context->id, 'mod_coursework', 'feedback', $feedbackid);
if (!empty($files)) {
foreach ($files as $file) {
writer::with_context($context)->export_file($currentpath, $file);
@@ -496,7 +496,7 @@ protected static function export_feedback_files($context, $feedbackId, $currentp
* @param \stdClass $feedback The coursework submission grade object
*/
protected static function format_submissions_feedback(\stdClass $feedback) {
- $feedbackData = [
+ $feedbackdata = [
'assessorid' => $feedback->assessorid,
'timecreated' => transform::datetime($feedback->timecreated),
'timemodified' => transform::datetime($feedback->timemodified),
@@ -505,63 +505,63 @@ protected static function format_submissions_feedback(\stdClass $feedback) {
'stage_identifier' => $feedback->stage_identifier,
'finalised' => transform::yesno($feedback->finalised),
];
- return $feedbackData;
+ return $feedbackdata;
}
- protected static function export_coursework_extension($courseworkId, $userId, $context, $path) {
- $extension = self::get_coursework_extension($courseworkId, $userId);
+ protected static function export_coursework_extension($courseworkid, $userid, $context, $path) {
+ $extension = self::get_coursework_extension($courseworkid, $userid);
if ($extension) {
self::export_coursework_extension_data($extension, $context, $path);
}
}
- protected static function get_coursework_extension($courseworkId, $userId) {
+ protected static function get_coursework_extension($courseworkid, $userid) {
global $DB;
- $params = ['courseworkid' => $courseworkId, 'allocatableid' => $userId];
+ $params = ['courseworkid' => $courseworkid, 'allocatableid' => $userid];
$extension = $DB->get_record('coursework_extensions', $params);
return $extension;
}
protected static function export_coursework_extension_data($extension, $context, $path) {
- $extensionData = [
+ $extensiondata = [
'extended_deadline' => transform::datetime($extension->extended_deadline),
'extra_information_text' => $extension->extra_information_text,
'createdbyid' => $extension->createdbyid,
];
writer::with_context($context)
- ->export_data(array_merge($path, [get_string('privacy:extensionpath', 'mod_coursework')]), (object) $extensionData);
+ ->export_data(array_merge($path, [get_string('privacy:extensionpath', 'mod_coursework')]), (object) $extensiondata);
}
- protected static function export_person_deadlines($courseworkId, $userId, $context, $path) {
- $personDeadline = self::get_person_deadline($courseworkId, $userId);
- if ($personDeadline) {
- self::export_person_deadline_data($personDeadline, $context, $path);
+ protected static function export_person_deadlines($courseworkid, $userid, $context, $path) {
+ $persondeadline = self::get_person_deadline($courseworkid, $userid);
+ if ($persondeadline) {
+ self::export_person_deadline_data($persondeadline, $context, $path);
}
}
- protected static function get_person_deadline($courseworkId, $userId) {
+ protected static function get_person_deadline($courseworkid, $userid) {
global $DB;
- $params = ['courseworkid' => $courseworkId, 'allocatableid' => $userId];
- $personDeadline = $DB->get_record('coursework_person_deadlines', $params);
- return $personDeadline;
+ $params = ['courseworkid' => $courseworkid, 'allocatableid' => $userid];
+ $persondeadline = $DB->get_record('coursework_person_deadlines', $params);
+ return $persondeadline;
}
- protected static function export_person_deadline_data($personDeadline, $context, $path) {
- $personDeadlineData = [
- 'personal_deadline' => transform::datetime($personDeadline->personal_deadline),
- 'timecreated' => transform::datetime($personDeadline->timecreated),
- 'timemodified' => transform::datetime($personDeadline->timemodified),
- 'createdbyid' => $personDeadline->createdbyid,
+ protected static function export_person_deadline_data($persondeadline, $context, $path) {
+ $persondeadlinedata = [
+ 'personal_deadline' => transform::datetime($persondeadline->personal_deadline),
+ 'timecreated' => transform::datetime($persondeadline->timecreated),
+ 'timemodified' => transform::datetime($persondeadline->timemodified),
+ 'createdbyid' => $persondeadline->createdbyid,
];
writer::with_context($context)
- ->export_data(array_merge($path, [get_string('privacy:person_deadlines', 'mod_coursework')]), (object) $personDeadlineData);
+ ->export_data(array_merge($path, [get_string('privacy:person_deadlines', 'mod_coursework')]), (object) $persondeadlinedata);
}
- protected static function export_plagiarism_flags($courseworkId, $context, $path) {
- $plagiarism = self::get_plagiarism_flags($courseworkId);
+ protected static function export_plagiarism_flags($courseworkid, $context, $path) {
+ $plagiarism = self::get_plagiarism_flags($courseworkid);
if ($plagiarism) {
self::export_plagiarism_flags_data($plagiarism, $context, $path);
}
}
- protected static function get_plagiarism_flags($courseworkId) {
+ protected static function get_plagiarism_flags($courseworkid) {
global $DB;
- $param = ['courseworkid' => $courseworkId];
+ $param = ['courseworkid' => $courseworkid];
$plagiarism = $DB->get_record('coursework_plagiarism_flags', $param);
@@ -572,7 +572,7 @@ protected static function export_plagiarism_flags_data($plagiarism, $context, $p
$status = self::format_plagiarism_status($plagiarism->status);
- $plagiarismData = [
+ $plagiarismdata = [
'comment' => transform::datetime($plagiarism->comment),
'status' => $status,
'timecreated' => transform::datetime($plagiarism->timecreated),
@@ -581,45 +581,45 @@ protected static function export_plagiarism_flags_data($plagiarism, $context, $p
];
writer::with_context($context)
- ->export_data(array_merge($path, [get_string('privacy:plagiarism_alert', 'mod_coursework')]), (object) $plagiarismData);
+ ->export_data(array_merge($path, [get_string('privacy:plagiarism_alert', 'mod_coursework')]), (object) $plagiarismdata);
}
protected static function format_plagiarism_status($status) {
switch ($status) {
case 0:
- $statusString = get_string('plagiarism_0', 'mod_coursework');
+ $statusstring = get_string('plagiarism_0', 'mod_coursework');
break;
case 1:
- $statusString = get_string('plagiarism_1', 'mod_coursework');
+ $statusstring = get_string('plagiarism_1', 'mod_coursework');
break;
case 2:
- $statusString = get_string('plagiarism_2', 'mod_coursework');
+ $statusstring = get_string('plagiarism_2', 'mod_coursework');
break;
case 3:
- $statusString = get_string('plagiarism_3', 'mod_coursework');
+ $statusstring = get_string('plagiarism_3', 'mod_coursework');
break;
default:
- $statusString = '';
+ $statusstring = '';
break;
}
- return $statusString;
+ return $statusstring;
}
- protected static function export_mod_agreements($feedbackId, $context, $path) {
- $agreement = self::get_mod_agreement($feedbackId);
+ protected static function export_mod_agreements($feedbackid, $context, $path) {
+ $agreement = self::get_mod_agreement($feedbackid);
if ($agreement) {
self::export_mod_agreement_data($agreement, $context, $path);
}
}
- protected static function get_mod_agreement($feedbackId) {
+ protected static function get_mod_agreement($feedbackid) {
global $DB;
- $param = ['feedbackid' => $feedbackId];
+ $param = ['feedbackid' => $feedbackid];
$agreement = $DB->get_record('coursework_mod_agreements', $param);
return $agreement;
}
protected static function export_mod_agreement_data($agreement, $context, $path) {
- $agreementData = [
+ $agreementdata = [
'moderatorid' => $agreement->moderatorid,
'agreement' => $agreement->agreement,
'modcomment' => $agreement->modcomment,
@@ -627,6 +627,6 @@ protected static function export_mod_agreement_data($agreement, $context, $path)
'timemodified' => transform::datetime($agreement->timemodified),
];
writer::with_context($context)
- ->export_data(array_merge($path, [get_string('privacy:moderator', 'mod_coursework')]), (object) $agreementData);
+ ->export_data(array_merge($path, [get_string('privacy:moderator', 'mod_coursework')]), (object) $agreementdata);
}
}
diff --git a/classes/render_helpers/grading_report/cells/_user_cell.php b/classes/render_helpers/grading_report/cells/_user_cell.php
index be96b582..e3a7e8ea 100644
--- a/classes/render_helpers/grading_report/cells/_user_cell.php
+++ b/classes/render_helpers/grading_report/cells/_user_cell.php
@@ -77,27 +77,27 @@ public function get_table_header($options = []) {
// 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'),
+ $sortbyfirstname = $this->helper_sortable_heading(get_string('firstname'),
'firstname',
$options['sorthow'],
$options['sortby'],
$tablename);
- $sort_by_last_name = $this->helper_sortable_heading(get_string('lastname'),
+ $sortbylastname = $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');
+ $sortbyfirstname = get_string('firstname');
+ $sortbylastname = get_string('lastname');
}
if ($this->fullname_format() == 'lf') {
- $sort_by_name = $sort_by_last_name . ' / ' . $sort_by_first_name;
+ $sortbyname = $sortbylastname . ' / ' . $sortbyfirstname;
} else {
- $sort_by_name = $sort_by_first_name . ' / ' . $sort_by_last_name;
+ $sortbyname = $sortbyfirstname . ' / ' . $sortbylastname;
}
- return $sort_by_name;
+ return $sortbyname;
}
/**
diff --git a/classes/render_helpers/grading_report/cells/cell_base.php b/classes/render_helpers/grading_report/cells/cell_base.php
index 7e6af525..7b187644 100644
--- a/classes/render_helpers/grading_report/cells/cell_base.php
+++ b/classes/render_helpers/grading_report/cells/cell_base.php
@@ -53,7 +53,7 @@ public function __construct($items = []) {
* @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($displayname, $field, $sorthow, $sortby = '', $tablename='') {
global $PAGE;
@@ -66,7 +66,7 @@ protected function helper_sortable_heading($display_name, $field, $sort_how, $so
}
$params[$tablename.'sortby'] = $field;
if ($field == $sortby) {
- $params[$tablename.'sorthow'] = $sort_how == 'ASC' ? 'DESC' : 'ASC';
+ $params[$tablename.'sorthow'] = $sorthow == 'ASC' ? 'DESC' : 'ASC';
} else {
// Default for columns not currently being sorted.
$params[$tablename.'sorthow'] = 'ASC';
@@ -82,7 +82,7 @@ protected function helper_sortable_heading($display_name, $field, $sort_how, $so
// }
// return html_writer::link($url, $display_name);
- return $display_name;
+ return $displayname;
}
/**
@@ -105,8 +105,8 @@ protected function get_renderer() {
* @return string|void
*/
public function cell_name() {
- $namespaced_class = get_class($this);
- $bits = explode('\\', $namespaced_class);
+ $namespacedclass = get_class($this);
+ $bits = explode('\\', $namespacedclass);
return end($bits);
}
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 d11947e2..9f1fecec 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
@@ -37,14 +37,14 @@ class grade_for_gradebook_cell extends cell_base {
* @param grading_table_row_base $row_object
* @return string
*/
- public function get_table_cell($row_object) {
+ public function get_table_cell($rowobject) {
global $USER;
$content = '';
- $ability = new ability(user::find($USER), $row_object->get_coursework());
+ $ability = new ability(user::find($USER), $rowobject->get_coursework());
$judge = new grade_judge($this->coursework);
- if ($ability->can('show', $judge->get_feedback_that_is_promoted_to_gradebook($row_object->get_submission())) && !$row_object->get_submission()->editable_final_feedback_exist()) {
- $grade = $judge->get_grade_capped_by_submission_time($row_object->get_submission());
+ if ($ability->can('show', $judge->get_feedback_that_is_promoted_to_gradebook($rowobject->get_submission())) && !$rowobject->get_submission()->editable_final_feedback_exist()) {
+ $grade = $judge->get_grade_capped_by_submission_time($rowobject->get_submission());
$content .= $judge->grade_to_display($grade);
}
return $this->get_new_cell_with_class($content);
diff --git a/classes/render_helpers/grading_report/cells/group_cell.php b/classes/render_helpers/grading_report/cells/group_cell.php
index 93fb8e2b..1ae59bc5 100644
--- a/classes/render_helpers/grading_report/cells/group_cell.php
+++ b/classes/render_helpers/grading_report/cells/group_cell.php
@@ -37,27 +37,27 @@ class group_cell extends cell_base implements allocatable_cell {
* @throws coding_exception
* @return string
*/
- public function get_table_cell($row_object) {
+ public function get_table_cell($rowobject) {
$content = '';
/**
* @var group $group
*/
- $group = $row_object->get_allocatable();
+ $group = $rowobject->get_allocatable();
$content .= ''.$group->name().'';
$content .= ' ';
$content .= '';
$content .= '';
$content .= ' ';
@@ -95,12 +95,12 @@ public function get_table_header_class() {
* @param user $group_member
* @return string
*/
- protected function add_group_member_name($group_member, $row_object) {
+ protected function add_group_member_name($groupmember, $rowobject) {
$text = '';
return $text;
diff --git a/classes/render_helpers/grading_report/cells/idnumber_cell.php b/classes/render_helpers/grading_report/cells/idnumber_cell.php
index b9f74155..046c0609 100644
--- a/classes/render_helpers/grading_report/cells/idnumber_cell.php
+++ b/classes/render_helpers/grading_report/cells/idnumber_cell.php
@@ -57,17 +57,17 @@ public function get_table_header($options = []) {
// 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'),
+ $sortheader = $this->helper_sortable_heading(get_string('idnumber'),
'idnumber',
$options['sorthow'],
$options['sortby'],
$tablename);
} else { // otherwise display header without sorting
- $sort_header = get_string('idnumber');
+ $sortheader = get_string('idnumber');
}
- return $sort_header;
+ return $sortheader;
}
/**
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 c3a994c1..dff7b8be 100644
--- a/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php
+++ b/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php
@@ -74,15 +74,15 @@ public function get_table_cell($rowobject) {
$rowobject->get_submission()->final_grade_agreed() &&
($this->stage->user_is_moderator($USER))) {
- $moderation_params = [
+ $moderationparams = [
'submissionid' => $rowobject->get_submission()->id,
'moderatorid' => $USER->id,
'stage_identifier' => $this->stage->identifier(),
'feedbackid' => $rowobject->get_single_feedback()->id,
];
// allow moderations if feedback exists
- $new_moderation = moderation::build($moderation_params);
- if ($ability->can('new', $new_moderation) && ($rowobject->get_single_feedback()->finalised || is_siteadmin($USER->id))) {
+ $newmoderation = moderation::build($moderationparams);
+ if ($ability->can('new', $newmoderation) && ($rowobject->get_single_feedback()->finalised || is_siteadmin($USER->id))) {
$content .= $this->new_moderation_button($rowobject, user::find($USER));
$content .= html_writer::empty_tag('br');
}
@@ -162,15 +162,15 @@ 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 = [
+ $moderationparams = [
'submission' => $rowobject->get_submission(),
'assessor' => $assessor,
'stage' => $this->stage,
'feedbackid' => $feedback->id,
];
- $link = $this->get_router()->get_path('new moderations', $moderation_params);
+ $link = $this->get_router()->get_path('new moderations', $moderationparams);
- $link_id = 'new_moderation_' . $rowobject->get_coursework()
+ $linkid = 'new_moderation_' . $rowobject->get_coursework()
->get_allocatable_identifier_hash($rowobject->get_allocatable());
$title = get_string('moderate', 'coursework');
@@ -178,7 +178,7 @@ private function new_moderation_button($rowobject, $assessor) {
return $OUTPUT->action_link($link,
$title,
null,
- ['class' => 'new_moderation', 'id' => $link_id]);
+ ['class' => 'new_moderation', 'id' => $linkid]);
}
/**
@@ -190,12 +190,12 @@ private function edit_moderation_button($rowobject) {
global $OUTPUT;
$feedback = $rowobject->get_submission()->get_assessor_feedback_by_stage('assessor_1');
- $feedback_params = [
+ $feedbackparams = [
'moderation' => $this->stage->get_moderation_for_feedback($feedback),
];
- $link = $this->get_router()->get_path('edit moderation', $feedback_params);
+ $link = $this->get_router()->get_path('edit moderation', $feedbackparams);
- $link_id = 'edit_moderation_' . $rowobject->get_coursework()
+ $linkid = 'edit_moderation_' . $rowobject->get_coursework()
->get_allocatable_identifier_hash($rowobject->get_allocatable());
$title = get_string('editmoderation', 'coursework');
@@ -204,7 +204,7 @@ private function edit_moderation_button($rowobject) {
return $OUTPUT->action_icon($link,
$icon,
null,
- ['id' => $link_id]);
+ ['id' => $linkid]);
}
@@ -217,18 +217,18 @@ private function show_moderation_button($rowobject) {
global $OUTPUT;
$feedback = $rowobject->get_submission()->get_assessor_feedback_by_stage('assessor_1');
- $moderation_params = [
+ $moderationparams = [
'moderation' => $this->stage->get_moderation_for_feedback($feedback),
];
$linktitle = get_string('viewmoderation', 'mod_coursework');
- $link_id = "show_moderation_" . $rowobject->get_coursework()
+ $linkid = "show_moderation_" . $rowobject->get_coursework()
->get_allocatable_identifier_hash($rowobject->get_allocatable());
- $link = $this->get_router()->get_path('show moderation', $moderation_params);
+ $link = $this->get_router()->get_path('show moderation', $moderationparams);
return $OUTPUT->action_link($link,
$linktitle,
null,
- ['class' => 'show_moderation', 'id' => $link_id]);
+ ['class' => 'show_moderation', 'id' => $linkid]);
}
}
diff --git a/classes/render_helpers/grading_report/cells/moderation_cell.php b/classes/render_helpers/grading_report/cells/moderation_cell.php
index c7962bbf..ccceb0a1 100644
--- a/classes/render_helpers/grading_report/cells/moderation_cell.php
+++ b/classes/render_helpers/grading_report/cells/moderation_cell.php
@@ -53,27 +53,27 @@ protected function after_initialisation($items) {
* @throws coding_exception
* @return string
*/
- public function get_table_cell($row_object) {
+ public function get_table_cell($rowobject) {
global $USER;
$content = '';
- if ($this->stage->has_feedback($row_object->get_allocatable())) {
- $content .= $this->add_existing_moderator_feedback_details_to_cell($row_object);
+ if ($this->stage->has_feedback($rowobject->get_allocatable())) {
+ $content .= $this->add_existing_moderator_feedback_details_to_cell($rowobject);
}
- $ability = new ability(user::find($USER), $row_object->get_coursework());
- $existing_feedback = $this->stage->get_feedback_for_allocatable($row_object->get_allocatable());
- $new_feedback = feedback::build([
- 'submissionid' => $row_object->get_submission_id(),
+ $ability = new ability(user::find($USER), $rowobject->get_coursework());
+ $existingfeedback = $this->stage->get_feedback_for_allocatable($rowobject->get_allocatable());
+ $newfeedback = feedback::build([
+ 'submissionid' => $rowobject->get_submission_id(),
'stage_identifier' => $this->stage->identifier(),
'assessorid' => $USER->id,
]);
// New or edit for moderators
- if ($existing_feedback && $ability->can('edit', $existing_feedback)) { // Edit
- $content .= $this->add_edit_feedback_link_to_cell($row_object, $existing_feedback);
- } else if ($ability->can('new', $new_feedback)) { // New
- $content .= $this->add_new_feedback_link_to_cell($row_object);
+ if ($existingfeedback && $ability->can('edit', $existingfeedback)) { // Edit
+ $content .= $this->add_edit_feedback_link_to_cell($rowobject, $existingfeedback);
+ } else if ($ability->can('new', $newfeedback)) { // New
+ $content .= $this->add_new_feedback_link_to_cell($rowobject);
}
return $this->get_new_cell_with_class($content);
@@ -107,8 +107,8 @@ public function get_table_header_class() {
* @param grading_table_row_base $row_object
* @return string
*/
- protected function add_existing_moderator_feedback_details_to_cell($row_object) {
- $feedback = $this->stage->get_feedback_for_allocatable($row_object->get_allocatable());
+ protected function add_existing_moderator_feedback_details_to_cell($rowobject) {
+ $feedback = $this->stage->get_feedback_for_allocatable($rowobject->get_allocatable());
$html = '';
$html .= $feedback->assessor()->profile_link();
$html .= ' ';
@@ -122,21 +122,21 @@ protected function add_existing_moderator_feedback_details_to_cell($row_object)
* @return string
* @throws \coding_exception
*/
- protected function add_edit_feedback_link_to_cell($row_object, $feedback) {
+ protected function add_edit_feedback_link_to_cell($rowobject, $feedback) {
global $OUTPUT;
$title = get_string('moderatethis', 'coursework');
$icon = new pix_icon('moderate', $title, 'coursework', ['width' => '20px']);
- $feedback_params = [
+ $feedbackparams = [
'feedback' => $feedback,
];
- $link = $this->get_router()->get_path('edit feedback', $feedback_params);
- $html_attributes = [
- 'id' => 'edit_moderator_feedback_' . $row_object->get_filename_hash(),
+ $link = $this->get_router()->get_path('edit feedback', $feedbackparams);
+ $htmlattributes = [
+ 'id' => 'edit_moderator_feedback_' . $rowobject->get_filename_hash(),
'class' => 'edit_feedback',
];
- $iconlink = $OUTPUT->action_icon($link, $icon, null, $html_attributes);
+ $iconlink = $OUTPUT->action_icon($link, $icon, null, $htmlattributes);
return ' ' . $iconlink;
}
@@ -146,23 +146,23 @@ protected function add_edit_feedback_link_to_cell($row_object, $feedback) {
* @return string
* @throws \coding_exception
*/
- protected function add_new_feedback_link_to_cell($row_object) {
+ protected function add_new_feedback_link_to_cell($rowobject) {
global $OUTPUT;
$title = get_string('moderatethis', 'coursework');
$icon = new pix_icon('moderate', $title, 'coursework', ['width' => '20px']);
- $feedback_params = [
- 'submission' => $row_object->get_submission(),
+ $feedbackparams = [
+ 'submission' => $rowobject->get_submission(),
'stage' => $this->stage,
];
- $link = $this->get_router()->get_path('new moderator feedback', $feedback_params);
+ $link = $this->get_router()->get_path('new moderator feedback', $feedbackparams);
- $html_attributes = [
- 'id' => 'new_moderator_feedback_' . $row_object->get_coursework()->get_allocatable_identifier_hash($row_object->get_allocatable()),
+ $htmlattributes = [
+ 'id' => 'new_moderator_feedback_' . $rowobject->get_coursework()->get_allocatable_identifier_hash($rowobject->get_allocatable()),
'class' => 'new_feedback',
];
- $iconlink = $OUTPUT->action_icon($link, $icon, null, $html_attributes);
+ $iconlink = $OUTPUT->action_icon($link, $icon, null, $htmlattributes);
return ' ' . $iconlink;
}
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 de94579c..84107692 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
@@ -77,24 +77,24 @@ public function get_content($rowobject) {
$finalfeedback = $this->stage->get_feedback_for_allocatable($rowobject->get_allocatable());
if ($finalfeedback !== false) {
- $grade_judge = new grade_judge($this->coursework);
- $content .= $grade_judge->grade_to_display($finalfeedback->get_grade());
+ $gradejudge = new grade_judge($this->coursework);
+ $content .= $gradejudge->grade_to_display($finalfeedback->get_grade());
// $content .= html_writer::empty_tag('br');
// $content .= ' by: ' . $finalfeedback->get_assesor_username();
}
// Edit/new link
- $existing_feedback = $this->stage->get_feedback_for_allocatable($rowobject->get_allocatable());
+ $existingfeedback = $this->stage->get_feedback_for_allocatable($rowobject->get_allocatable());
$title = get_string('editfinalgrade', 'coursework');
$icon = new pix_icon('edit', $title, 'coursework');
$iconlink = '';
- if ($existing_feedback && $ability->can('edit', $existing_feedback)) {
+ if ($existingfeedback && $ability->can('edit', $existingfeedback)) {
- $feedback_route_params = [
+ $feedbackrouteparams = [
'feedback' => $finalfeedback,
];
- $link = $this->get_router()->get_path('ajax edit feedback', $feedback_route_params);
+ $link = $this->get_router()->get_path('ajax edit feedback', $feedbackrouteparams);
$iconlink = $OUTPUT->action_icon($link,
$icon,
@@ -106,22 +106,22 @@ public function get_content($rowobject) {
} else if ($rowobject->has_submission()) { // New
- $feedback_params = [
+ $feedbackparams = [
'submissionid' => $rowobject->get_submission()->id,
'assessorid' => $USER->id,
'stage_identifier' => $this->stage->identifier(),
];
- $new_feedback = feedback::build($feedback_params);
+ $newfeedback = feedback::build($feedbackparams);
// If the user is a site admin then they can add final feedback
- if ($ability->can('new', $new_feedback) || is_siteadmin()) {
+ if ($ability->can('new', $newfeedback) || is_siteadmin()) {
$title = get_string('addfinalfeedback', 'coursework');
- $feedback_route_params = [
+ $feedbackrouteparams = [
'submission' => $rowobject->get_submission(),
'assessor' => $USER,
'stage' => $this->stage,
];
- $link = $this->get_router()->get_path('ajax new final feedback', $feedback_route_params);
+ $link = $this->get_router()->get_path('ajax new final feedback', $feedbackrouteparams);
$iconlink = $OUTPUT->action_link($link,
$title,
@@ -130,17 +130,17 @@ public function get_content($rowobject) {
'id' => 'new_final_feedback_' . $rowobject->get_coursework()
->get_allocatable_identifier_hash($rowobject->get_allocatable())]);
- } else if ($existing_feedback && $ability->can('show', $existing_feedback)) {
+ } else if ($existingfeedback && $ability->can('show', $existingfeedback)) {
$linktitle = get_string('viewfeedback', 'mod_coursework');
- $link_id = "show_feedback_" . $rowobject->get_coursework()
+ $linkid = "show_feedback_" . $rowobject->get_coursework()
->get_allocatable_identifier_hash($rowobject->get_allocatable());
$link = $this->get_router()
->get_path('show feedback', ['feedback' => $this->stage->get_feedback_for_allocatable($rowobject->get_allocatable())]);
$iconlink = $OUTPUT->action_link($link,
$linktitle,
null,
- ['class' => 'show_feedback', 'id' => $link_id]);
+ ['class' => 'show_feedback', 'id' => $linkid]);
}
}
@@ -171,8 +171,8 @@ public function get_table_header($options = []) {
// If tablename is set
$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);
+ $columnname = get_string('agreedgrade', 'coursework');
+ return $this->helper_sortable_heading($columnname, 'finalgrade', $options['sorthow'], $options['sortby'], $tablename);
}
/**
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 6ef94aa5..e15c3e70 100644
--- a/classes/render_helpers/grading_report/cells/personal_deadline_cell.php
+++ b/classes/render_helpers/grading_report/cells/personal_deadline_cell.php
@@ -38,40 +38,40 @@ class personal_deadline_cell extends cell_base {
* @throws coding_exception
* @return string
*/
- public function get_table_cell($row_object) {
+ public function get_table_cell($rowobject) {
global $OUTPUT, $USER;
- $coursework = $row_object->get_coursework();
+ $coursework = $rowobject->get_coursework();
$deadline = $coursework->get_deadline();
$content = '';
- $new_personal_deadline_params = [
- 'allocatableid' => $row_object->get_allocatable()->id(),
- 'allocatabletype' => $row_object->get_allocatable()->type(),
- 'courseworkid' => $row_object->get_coursework()->id,
+ $newpersonaldeadlineparams = [
+ 'allocatableid' => $rowobject->get_allocatable()->id(),
+ 'allocatabletype' => $rowobject->get_allocatable()->type(),
+ 'courseworkid' => $rowobject->get_coursework()->id,
];
- $personal_deadline = personal_deadline::find_or_build($new_personal_deadline_params);
- if ($personal_deadline->personal_deadline) {
- $deadline = $personal_deadline->personal_deadline;
+ $personaldeadline = personal_deadline::find_or_build($newpersonaldeadlineparams);
+ if ($personaldeadline->personal_deadline) {
+ $deadline = $personaldeadline->personal_deadline;
}
$date = userdate($deadline, '%a, %d %b %Y, %H:%M');
$content .= ' '.$date.' ';
- $ability = new ability(user::find($USER, false), $row_object->get_coursework());
+ $ability = new ability(user::find($USER, false), $rowobject->get_coursework());
$class = 'edit_personal_deadline';
- if (!$ability->can('edit', $personal_deadline)) {
+ if (!$ability->can('edit', $personaldeadline)) {
$class .= ' display-none';
}
- $link = $this->get_router()->get_path('edit personal deadline', $new_personal_deadline_params);
+ $link = $this->get_router()->get_path('edit personal deadline', $newpersonaldeadlineparams);
// $link = '/';
$icon = new pix_icon('edit', 'Edit personal deadline', 'coursework');
- $new_personal_deadline_params['multipleuserdeadlines'] = 0;
+ $newpersonaldeadlineparams['multipleuserdeadlines'] = 0;
$content .= $OUTPUT->action_icon($link,
$icon,
null,
- ['class' => $class, 'data-get' => json_encode($new_personal_deadline_params), 'data-time' => date('d-m-Y H:i', $deadline) ]);
+ ['class' => $class, 'data-get' => json_encode($newpersonaldeadlineparams), 'data-time' => date('d-m-Y H:i', $deadline) ]);
$content .= ' ';
return $this->get_new_cell_with_order_data(['display' => $content, '@data-order' => $deadline]);
diff --git a/classes/render_helpers/grading_report/cells/plagiarism_cell.php b/classes/render_helpers/grading_report/cells/plagiarism_cell.php
index c5040102..d20b35ef 100644
--- a/classes/render_helpers/grading_report/cells/plagiarism_cell.php
+++ b/classes/render_helpers/grading_report/cells/plagiarism_cell.php
@@ -48,9 +48,9 @@ public function get_table_cell($rowobject) {
if ($rowobject->has_submission() && $ability->can('show', $rowobject->get_submission())) {
// The files and the form to resubmit them.
- $submission_files = $rowobject->get_submission_files();
- if ($submission_files) {
- $content .= $this->get_renderer()->render_plagiarism_links(new mod_coursework_submission_files($submission_files));
+ $submissionfiles = $rowobject->get_submission_files();
+ if ($submissionfiles) {
+ $content .= $this->get_renderer()->render_plagiarism_links(new mod_coursework_submission_files($submissionfiles));
}
}
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 c5f7657d..7f07aab2 100644
--- a/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php
+++ b/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php
@@ -50,25 +50,25 @@ public function get_table_cell($rowobject) {
$ability = new ability(user::find($USER), $rowobject->get_coursework());
if ($rowobject->has_submission() && $rowobject->get_submission()->finalised) {
- $plagiarism_flag_params = [
+ $plagiarismflagparams = [
'submissionid' => $rowobject->get_submission()->id,
];
- $plagiarism_flag = plagiarism_flag::find($plagiarism_flag_params);
+ $plagiarismflag = plagiarism_flag::find($plagiarismflagparams);
- if (!$plagiarism_flag) { // if plagiarism flag for this submission doesn't exist, we can create one
- $plagiarism_flag_params = ['courseworkid' => $rowobject->get_coursework()->id,
+ if (!$plagiarismflag) { // if plagiarism flag for this submission doesn't exist, we can create one
+ $plagiarismflagparams = ['courseworkid' => $rowobject->get_coursework()->id,
'submissionid' => $rowobject->get_submission()->id];
- $new_plagiarism_flag = plagiarism_flag::build($plagiarism_flag_params);
+ $newplagiarismflag = plagiarism_flag::build($plagiarismflagparams);
- if ($ability->can('new', $new_plagiarism_flag)) {
+ if ($ability->can('new', $newplagiarismflag)) {
$content .= $this->new_flag_plagiarism_button($rowobject); // new button
$content .= html_writer::empty_tag('br');
}
} else {
- $content .= "status.">".get_string('plagiarism_' . $plagiarism_flag->status, 'coursework')." ";
+ $content .= " status.">".get_string('plagiarism_' . $plagiarismflag->status, 'coursework')." ";
- if ($ability->can('edit', $plagiarism_flag)) { // Edit
+ if ($ability->can('edit', $plagiarismflag)) { // Edit
$content .= $this->edit_flag_plagiarism_button($rowobject); // edit button
}
$content .= " ";
@@ -105,22 +105,22 @@ public function header_group() {
* @return string
* @throws \coding_exception
*/
- private function new_flag_plagiarism_button($row_object) {
+ private function new_flag_plagiarism_button($rowobject) {
global $OUTPUT;
$title = get_string('flagplagiarism', 'coursework');
- $feedback_params = [
- 'submission' => $row_object->get_submission(),
+ $feedbackparams = [
+ 'submission' => $rowobject->get_submission(),
];
- $link = $this->get_router()->get_path('new plagiarism flag', $feedback_params);
+ $link = $this->get_router()->get_path('new plagiarism flag', $feedbackparams);
- $html_attributes = [
- 'id' => 'new_plagiarism_flag_' . $row_object->get_coursework()->get_allocatable_identifier_hash($row_object->get_allocatable()),
+ $htmlattributes = [
+ 'id' => 'new_plagiarism_flag_' . $rowobject->get_coursework()->get_allocatable_identifier_hash($rowobject->get_allocatable()),
'class' => 'new_plagiarism_flag',
];
- return $OUTPUT->action_link($link, $title, null, $html_attributes);
+ return $OUTPUT->action_link($link, $title, null, $htmlattributes);
}
/**
@@ -128,19 +128,19 @@ private function new_flag_plagiarism_button($row_object) {
* @return string
* @throws \coding_exception
*/
- private function edit_flag_plagiarism_button($row_object) {
+ private function edit_flag_plagiarism_button($rowobject) {
global $OUTPUT;
$title = get_string('editflagplagiarism', 'coursework');
- $feedback_params = [
- 'flag' => $row_object->get_plagiarism_flag(),
+ $feedbackparams = [
+ 'flag' => $rowobject->get_plagiarism_flag(),
];
- $link = $this->get_router()->get_path('edit plagiarism flag', $feedback_params);
+ $link = $this->get_router()->get_path('edit plagiarism flag', $feedbackparams);
- $link_id = 'edit_plagiarism_flag_' . $row_object->get_coursework()->get_allocatable_identifier_hash($row_object->get_allocatable());
+ $linkid = 'edit_plagiarism_flag_' . $rowobject->get_coursework()->get_allocatable_identifier_hash($rowobject->get_allocatable());
$icon = new pix_icon('edit', $title, 'coursework');
- return $OUTPUT->action_icon($link, $icon, null, ['id' => $link_id]);
+ return $OUTPUT->action_icon($link, $icon, null, ['id' => $linkid]);
}
}
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 6c96accf..5474c86d 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
@@ -87,13 +87,13 @@ public function get_content($rowobject) {
($this->stage->user_is_assessor($USER) ||
has_capability('mod/coursework:administergrades', $this->coursework->get_context()))) {
- $feedback_params = [
+ $feedbackparams = [
'submissionid' => $rowobject->get_submission()->id,
'assessorid' => $USER->id,
'stage_identifier' => $this->stage->identifier(),
];
- $new_feedback = feedback::build($feedback_params);
- if ($ability->can('new', $new_feedback)) {
+ $newfeedback = feedback::build($feedbackparams);
+ if ($ability->can('new', $newfeedback)) {
$content .= $this->new_feedback_button($rowobject, user::find($USER));
$content .= html_writer::empty_tag('br');
}
@@ -166,12 +166,12 @@ public function header_group() {
private function edit_feedback_button($rowobject) {
global $OUTPUT;
- $feedback_params = [
+ $feedbackparams = [
'feedback' => $this->stage->get_feedback_for_allocatable($rowobject->get_allocatable()),
];
- $link = $this->get_router()->get_path('edit feedback', $feedback_params);
+ $link = $this->get_router()->get_path('edit feedback', $feedbackparams);
- $link_id = 'edit_final_feedback_' . $rowobject->get_coursework()
+ $linkid = 'edit_final_feedback_' . $rowobject->get_coursework()
->get_allocatable_identifier_hash($rowobject->get_allocatable());
$title = get_string('editfinalgrade', 'coursework');
@@ -180,7 +180,7 @@ private function edit_feedback_button($rowobject) {
return $OUTPUT->action_icon($link,
$icon,
null,
- ['id' => $link_id, 'class' => 'edit_final_feedback']);
+ ['id' => $linkid, 'class' => 'edit_final_feedback']);
}
@@ -193,14 +193,14 @@ private function show_feedback_button($rowobject) {
global $OUTPUT;
$linktitle = get_string('viewfeedback', 'mod_coursework');
- $link_id = "show_feedback_" . $rowobject->get_coursework()
+ $linkid = "show_feedback_" . $rowobject->get_coursework()
->get_allocatable_identifier_hash($rowobject->get_allocatable());
$link = $this->get_router()
->get_path('show feedback', ['feedback' => $this->stage->get_feedback_for_allocatable($rowobject->get_allocatable())]);
$iconlink = $OUTPUT->action_link($link,
$linktitle,
null,
- ['class' => 'show_feedback', 'id' => $link_id]);
+ ['class' => 'show_feedback', 'id' => $linkid]);
return $iconlink;
}
@@ -214,14 +214,14 @@ private function show_feedback_button($rowobject) {
private function new_feedback_button($rowobject, $assessor) {
global $OUTPUT;
- $feedback_params = [
+ $feedbackparams = [
'submission' => $rowobject->get_submission(),
'assessor' => $assessor,
'stage' => $this->stage,
];
- $link = $this->get_router()->get_path('ajax new final feedback', $feedback_params);
+ $link = $this->get_router()->get_path('ajax new final feedback', $feedbackparams);
- $link_id = 'new_final_feedback_' . $rowobject->get_coursework()
+ $linkid = 'new_final_feedback_' . $rowobject->get_coursework()
->get_allocatable_identifier_hash($rowobject->get_allocatable());
$title = get_string('addfinalfeedback', 'coursework');
@@ -229,7 +229,7 @@ private function new_feedback_button($rowobject, $assessor) {
return $OUTPUT->action_link($link,
$title,
null,
- ['class' => 'new_final_feedback', 'id' => $link_id]);
+ ['class' => 'new_final_feedback', 'id' => $linkid]);
}
}
diff --git a/classes/render_helpers/grading_report/cells/submission_cell.php b/classes/render_helpers/grading_report/cells/submission_cell.php
index d105fafa..975ebbc3 100644
--- a/classes/render_helpers/grading_report/cells/submission_cell.php
+++ b/classes/render_helpers/grading_report/cells/submission_cell.php
@@ -51,9 +51,9 @@ public function get_table_cell($rowobject) {
if ($rowobject->has_submission() && $ability->can('show', $rowobject->get_submission())) {
// The files and the form to resubmit them.
- $submission_files = $rowobject->get_submission_files();
- if ($submission_files) {
- $content .= $this->get_renderer()->render_submission_files(new mod_coursework_submission_files($submission_files));
+ $submissionfiles = $rowobject->get_submission_files();
+ if ($submissionfiles) {
+ $content .= $this->get_renderer()->render_submission_files(new mod_coursework_submission_files($submissionfiles));
}
if ($ability->can('revert', $rowobject->get_submission())) {
@@ -70,7 +70,7 @@ public function get_table_cell($rowobject) {
$ability = new ability(user::find($USER), $rowobject->get_coursework());
- $submission_on_behalf_of_allocatable = submission::build([
+ $submissiononbehalfofallocatable = submission::build([
'allocatableid' => $rowobject->get_allocatable()
->id(),
'allocatabletype' => $rowobject->get_allocatable()
@@ -82,13 +82,13 @@ public function get_table_cell($rowobject) {
if (($rowobject->get_submission()&& !$rowobject->get_submission()->finalised)
|| !$rowobject->get_submission()) {
- if ($ability->can('new', $submission_on_behalf_of_allocatable) && (!$rowobject->get_coursework()->has_deadline()
+ if ($ability->can('new', $submissiononbehalfofallocatable) && (!$rowobject->get_coursework()->has_deadline()
|| $rowobject->get_coursework()->allow_late_submissions() || ($rowobject->get_personal_deadlines() >= time() || ($rowobject->has_extension() && $rowobject->get_extension()->extended_deadline > time())))) {
// New submission on behalf of button
$url = $this->get_router()
- ->get_path('new submission', ['submission' => $submission_on_behalf_of_allocatable], true);
+ ->get_path('new submission', ['submission' => $submissiononbehalfofallocatable], true);
$label =
'Submit on behalf';
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 f2af78ef..1e65963d 100644
--- a/classes/render_helpers/grading_report/cells/time_submitted_cell.php
+++ b/classes/render_helpers/grading_report/cells/time_submitted_cell.php
@@ -40,41 +40,41 @@ class time_submitted_cell extends cell_base {
* @throws coding_exception
* @return string
*/
- public function get_table_cell($row_object) {
+ public function get_table_cell($rowobject) {
- $data = $this->prepare_content_cell($row_object);
+ $data = $this->prepare_content_cell($rowobject);
return $this->get_new_cell_with_order_data($data);
}
- public function prepare_content_cell($row_object) {
+ public function prepare_content_cell($rowobject) {
global $OUTPUT, $USER;
$content = '';
- $time_submitted = $displayeddeadline = 0;
+ $timesubmitted = $displayeddeadline = 0;
- $coursework = $row_object->get_coursework();
- $submission = $row_object->get_submission();
+ $coursework = $rowobject->get_coursework();
+ $submission = $rowobject->get_submission();
if ($submission) {
// If we have groups enabled and this is not the student who submitted the
// group files, show who did.
- if ($coursework->is_configured_to_have_group_submissions() && !$row_object->has_submission()) {
+ if ($coursework->is_configured_to_have_group_submissions() && !$rowobject->has_submission()) {
$user = user::get_object($submission->userid);
- if ($row_object->can_view_username()) {
+ if ($rowobject->can_view_username()) {
$content .= "Submitted by";
$content .= html_writer::empty_tag('br');
$content .= $OUTPUT->user_picture($user);
- $content .= $row_object->get_user_name(true);
+ $content .= $rowobject->get_user_name(true);
}
$content .= html_writer::empty_tag('br');
}
- $time_submitted = $submission->time_submitted();
+ $timesubmitted = $submission->time_submitted();
- $content .= userdate($time_submitted, '%a, %d %b %Y, %H:%M');
+ $content .= userdate($timesubmitted, '%a, %d %b %Y, %H:%M');
$content .= html_writer::empty_tag('br');
if ($submission->is_late() && (!$submission->has_extension() || !$submission->submitted_within_extension())) {
@@ -88,7 +88,7 @@ public function prepare_content_cell($row_object) {
$deadline = ($submission->has_extension()) ? $submission->extension_deadline() : $deadline;
- $lateseconds = $time_submitted - $deadline;
+ $lateseconds = $timesubmitted - $deadline;
$days = floor($lateseconds / 86400);
$hours = floor($lateseconds / 3600) % 24;
@@ -108,7 +108,7 @@ public function prepare_content_cell($row_object) {
}
if ($submission->get_allocatable()->type() == 'group') {
- if ($row_object->can_view_username() || $row_object->is_published()) {
+ if ($rowobject->can_view_username() || $rowobject->is_published()) {
$content .= ' by ' . $submission->get_last_submitter()->profile_link();
}
}
@@ -117,17 +117,17 @@ public function prepare_content_cell($row_object) {
}
$content .= ' ';
- $allocatableid = $row_object->get_allocatable()->id();
- $allocatabletype = $row_object->get_allocatable()->type();
- $coursework = $row_object->get_coursework();
- $new_extension_params = [
+ $allocatableid = $rowobject->get_allocatable()->id();
+ $allocatabletype = $rowobject->get_allocatable()->type();
+ $coursework = $rowobject->get_coursework();
+ $newextensionparams = [
'allocatableid' => $allocatableid,
'allocatabletype' => $allocatabletype,
'courseworkid' => $coursework->id,
];
- $extension = deadline_extension::find_or_build($new_extension_params);
- $ability = new ability(user::find($USER), $row_object->get_coursework());
+ $extension = deadline_extension::find_or_build($newextensionparams);
+ $ability = new ability(user::find($USER), $rowobject->get_coursework());
if ($extension->persisted()) {
$content .= 'Extension: '.userdate($extension->extended_deadline, '%a, %d %b %Y, %H:%M');
@@ -135,26 +135,26 @@ public function prepare_content_cell($row_object) {
}
if ($extension->id) {
- $new_extension_params['id'] = $extension->id;
+ $newextensionparams['id'] = $extension->id;
}
if ($submission) {
- $new_extension_params['submissionid'] = $submission->id;
+ $newextensionparams['submissionid'] = $submission->id;
}
$deadline = $deadline ?? $coursework->deadline;
- $content_time = [
+ $contenttime = [
'time' => date('d-m-Y H:i', $deadline),
'time_content' => userdate($deadline),
'is_have_deadline' => ($coursework->deadline > 0) ? 1 : 0,
];
if ($ability->can('new', $extension) && $coursework->extensions_enabled()) {
- $link = $this->get_router()->get_path('new deadline extension', $new_extension_params);
+ $link = $this->get_router()->get_path('new deadline extension', $newextensionparams);
$title = 'New extension';
$content .= $OUTPUT->action_link($link,
$title,
null,
- ['class' => 'new_deadline_extension', 'data-name' => $row_object->get_allocatable()->name(), 'data-params' => json_encode($new_extension_params), 'data-time' => json_encode($content_time) ]);
+ ['class' => 'new_deadline_extension', 'data-name' => $rowobject->get_allocatable()->name(), 'data-params' => json_encode($newextensionparams), 'data-time' => json_encode($contenttime) ]);
} else if ($ability->can('edit', $extension) && $coursework->extensions_enabled()) {
$link = $this->get_router()->get_path('edit deadline extension', ['id' => $extension->id]);
@@ -163,12 +163,12 @@ public function prepare_content_cell($row_object) {
$content .= $OUTPUT->action_icon($link,
$icon,
null,
- ['class' => 'edit_deadline_extension', 'data-name' => $row_object->get_allocatable()->name(), 'data-params' => json_encode($new_extension_params), 'data-time' => json_encode($content_time)]);
+ ['class' => 'edit_deadline_extension', 'data-name' => $rowobject->get_allocatable()->name(), 'data-params' => json_encode($newextensionparams), 'data-time' => json_encode($contenttime)]);
}
$content .= ' ';
- return ['display' => $content, '@data-order' => $this->standardize_time_for_compare($time_submitted) . '|' . $this->standardize_time_for_compare($displayeddeadline)];
+ return ['display' => $content, '@data-order' => $this->standardize_time_for_compare($timesubmitted) . '|' . $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 acf601fd..80768b79 100644
--- a/classes/render_helpers/grading_report/cells/user_cell.php
+++ b/classes/render_helpers/grading_report/cells/user_cell.php
@@ -84,46 +84,46 @@ public function get_table_header($options = []) {
// 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'),
+ $sortbyfirstname = $this->helper_sortable_heading(get_string('firstname'),
'firstname',
$options['sorthow'],
$options['sortby'],
$tablename);
- $sort_by_last_name = $this->helper_sortable_heading(get_string('lastname'),
+ $sortbylastname = $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'),
+ $sortbyemail = $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');
+ $sortbyfirstname = get_string('firstname');
+ $sortbylastname = get_string('lastname');
+ $sortbyemail = get_string('email', 'mod_coursework');
}
if ($this->fullname_format() == 'lf') {
- $sort_by_first_name = ' / ' . $sort_by_first_name;
+ $sortbyfirstname = ' / ' . $sortbyfirstname;
} else {
- $sort_by_last_name = ' / ' . $sort_by_last_name;
+ $sortbylastname = ' / ' . $sortbylastname;
}
- $sort_by_first_name = ' '.$sort_by_first_name.'';
+ $sortbyfirstname = ' '.$sortbyfirstname.'';
- $sort_by_last_name = ' '.$sort_by_last_name.'';
+ $sortbylastname = ' '.$sortbylastname.'';
- $sort_by_email = ' '.$sort_by_email.'';
+ $sortbyemail = ' '.$sortbyemail.'';
if ($this->fullname_format() == 'lf') {
- $sort_by_name = $sort_by_last_name . $sort_by_first_name;
+ $sortbyname = $sortbylastname . $sortbyfirstname;
} else {
- $sort_by_name = $sort_by_first_name . $sort_by_last_name;
+ $sortbyname = $sortbyfirstname . $sortbylastname;
}
- $sort = $sort_by_name ." " .$sort_by_email;
+ $sort = $sortbyname ." " .$sortbyemail;
return $sort;
}
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 bd94f12c..15bc93d7 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
@@ -32,7 +32,7 @@ class no_sub_rows implements sub_rows_interface {
* @param int $column_width
* @return mixed
*/
- public function get_row_with_assessor_feedback_table($row_object, $column_width) {
+ public function get_row_with_assessor_feedback_table($rowobject, $columnwidth) {
return '';
}
}
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 c324b303..9933a3a8 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
@@ -34,6 +34,6 @@ interface sub_rows_interface {
* @param int $column_width
* @return mixed
*/
- public function get_row_with_assessor_feedback_table($row_object, $column_width);
+ public function get_row_with_assessor_feedback_table($rowobject, $columnwidth);
}
diff --git a/classes/router.php b/classes/router.php
index 07a75233..9175b84c 100644
--- a/classes/router.php
+++ b/classes/router.php
@@ -69,25 +69,25 @@ public static function instance() {
* @throws \coding_exception
* @return moodle_url|string url
*/
- public function get_path($path_name, $items = [], $as_url_object = false, $escaped = true) {
+ public function get_path($pathname, $items = [], $asurlobject = false, $escaped = true) {
global $CFG;
- $context_id = false;
- $coursemodule_id = false;
+ $contextid = false;
+ $coursemoduleid = false;
if (array_key_exists('coursework', $items)) {
/**
* @var coursework $coursework
*/
$coursework = $items['coursework'];
- $context_id = $coursework->get_context_id();
- $coursemodule_id = $coursework->get_coursemodule_id();
+ $contextid = $coursework->get_context_id();
+ $coursemoduleid = $coursework->get_coursemodule_id();
}
$url = false;
- switch ($path_name) {
+ switch ($pathname) {
case 'create feedback':
$url = new moodle_url('/mod/coursework/actions/feedbacks/create.php');
@@ -102,16 +102,16 @@ public function get_path($path_name, $items = [], $as_url_object = false, $escap
break;
case 'coursework settings':
- $url = new moodle_url('/course/modedit.php', ['update' => $coursemodule_id]);
+ $url = new moodle_url('/course/modedit.php', ['update' => $coursemoduleid]);
break;
case 'coursework':
- $url = new moodle_url('/mod/coursework/view.php', ['id' => $coursemodule_id]);
+ $url = new moodle_url('/mod/coursework/view.php', ['id' => $coursemoduleid]);
break;
case 'allocations':
$url = new moodle_url('/mod/coursework/actions/allocate.php',
- ['id' => $coursemodule_id]);
+ ['id' => $coursemoduleid]);
break;
case 'assessor grading':
@@ -199,7 +199,7 @@ public function get_path($path_name, $items = [], $as_url_object = false, $escap
case 'set personal deadlines':
$url = new moodle_url('/mod/coursework/actions/set_personal_deadlines.php',
- ['id' => $coursemodule_id]);
+ ['id' => $coursemoduleid]);
break;
case 'new moderations':
@@ -257,12 +257,12 @@ public function get_path($path_name, $items = [], $as_url_object = false, $escap
if (!$url) {
// Try to auto construct it.
- $bits = explode(' ', $path_name);
+ $bits = explode(' ', $pathname);
$action = array_shift($bits);
$type = implode('_', $bits);
- $auto_path = '/mod/coursework/actions/' . $this->pluralise($type) . '/' . $action . '.php';
- if (file_exists($CFG->dirroot . $auto_path)) {
+ $autopath = '/mod/coursework/actions/' . $this->pluralise($type) . '/' . $action . '.php';
+ if (file_exists($CFG->dirroot . $autopath)) {
$params = [];
if (array_key_exists($type, $items)) {
@@ -273,15 +273,15 @@ public function get_path($path_name, $items = [], $as_url_object = false, $escap
$params['courseworkid'] = $items['courseworkid'];
}
- $url = new moodle_url($auto_path, $params);
+ $url = new moodle_url($autopath, $params);
}
}
if (!$url) {
- throw new coding_exception("No target file for path: '{$path_name}'");
+ throw new coding_exception("No target file for path: '{$pathname}'");
}
- return $as_url_object ? $url : $url->out($escaped);
+ return $asurlobject ? $url : $url->out($escaped);
}
/**
diff --git a/classes/sample_set_rule/range_sample_type.php b/classes/sample_set_rule/range_sample_type.php
index 8861142b..1de88567 100644
--- a/classes/sample_set_rule/range_sample_type.php
+++ b/classes/sample_set_rule/range_sample_type.php
@@ -37,7 +37,7 @@
*/
class range_sample_type extends \mod_coursework\sample_set_rule\sample_base {
- public function adjust_set(array &$moderation_set, array &$potential_allocatables, $stage) {
+ public function adjust_set(array &$moderationset, array &$potentialallocatables, $stage) {
}
@@ -49,7 +49,7 @@ public function get_default_rule_order() {
}
- public function add_form_elements($assessor_number=0) {
+ public function add_form_elements($assessornumber=0) {
global $DB;
@@ -60,7 +60,7 @@ public function add_form_elements($assessor_number=0) {
{coursework_sample_set_plugin} sp
WHERE sr.sample_set_plugin_id = sp.id
AND sr.courseworkid = {$this->coursework->id}
- AND sr.stage_identifier = 'assessor_{$assessor_number}'
+ AND sr.stageidentifier = 'assessor{$assessornumber}'
AND sp.rulename = 'range_sample_type'";
$rulesfound = false;
@@ -70,26 +70,26 @@ public function add_form_elements($assessor_number=0) {
if (!empty($samplerecords)) {
$seq = 0;
foreach ($samplerecords as $record) {
- $html .= $this->range_elements($assessor_number, $seq, $record);
+ $html .= $this->range_elements($assessornumber, $seq, $record);
$seq++;
}
} else {
- $html .= $this->range_elements($assessor_number, 0, false);
+ $html .= $this->range_elements($assessornumber, 0, false);
}
- $html .= html_writer::link('#', get_string('addgraderule', 'mod_coursework'), ['id' => "assessor_{$assessor_number}_addgradderule", 'class' => 'addgradderule sample_set_rule']);
+ $html .= html_writer::link('#', get_string('addgraderule', 'mod_coursework'), ['id' => "assessor{$assessornumber}addgradderule", 'class' => 'addgradderule sample_set_rule']);
$html .= " ";
- $html .= html_writer::link('#', get_string('removegraderule', 'mod_coursework'), ['id' => "assessor_{$assessor_number}_removegradderule", 'class' => 'removegradderule sample_set_rule']);
+ $html .= html_writer::link('#', get_string('removegraderule', 'mod_coursework'), ['id' => "assessor{$assessornumber}removegradderule", 'class' => 'removegradderule sample_set_rule']);
return $html;
}
- public function range_elements($assessor_number, $sequence, $dbrecord=false) {
+ public function range_elements($assessornumber, $sequence, $dbrecord=false) {
- $percentage_options = [];
+ $percentageoptions = [];
for ($i = 0; $i < 110; $i = $i + 10) {
- $percentage_options[$i] = "{$i}";
+ $percentageoptions[$i] = "{$i}";
}
$scale = [];
@@ -99,59 +99,59 @@ public function range_elements($assessor_number, $sequence, $dbrecord=false) {
$scale[] = $i;
}
} else {
- $grade_scale = \grade_scale::fetch(['id' => abs($this->coursework->grade)]);
- $scale = explode(",", $grade_scale->scale);
+ $gradescale = \grade_scale::fetch(['id' => abs($this->coursework->grade)]);
+ $scale = explode(",", $gradescale->scale);
}
if ($dbrecord) {
- $selected_type = [$dbrecord->ruletype => get_string($dbrecord->ruletype, 'mod_coursework')];
- $selected_to = ($dbrecord->ruletype == 'scale') ? [$dbrecord->upperlimit => $scale[$dbrecord->upperlimit]] : [$dbrecord->upperlimit => $dbrecord->upperlimit];
+ $selectedtype = [$dbrecord->ruletype => get_string($dbrecord->ruletype, 'mod_coursework')];
+ $selectedto = ($dbrecord->ruletype == 'scale') ? [$dbrecord->upperlimit => $scale[$dbrecord->upperlimit]] : [$dbrecord->upperlimit => $dbrecord->upperlimit];
- $selected_from = ($dbrecord->ruletype == 'scale') ? [$dbrecord->lowerlimit => $scale[$dbrecord->lowerlimit]] : [$dbrecord->lowerlimit => $dbrecord->lowerlimit];
+ $selectedfrom = ($dbrecord->ruletype == 'scale') ? [$dbrecord->lowerlimit => $scale[$dbrecord->lowerlimit]] : [$dbrecord->lowerlimit => $dbrecord->lowerlimit];
- $rules_checked = ($dbrecord) ? true : false;
+ $ruleschecked = ($dbrecord) ? true : false;
} else {
- $selected_type = ['percentage' => get_string('percentage', 'mod_coursework')];
- $selected_to = ['100' => '100'];
- $selected_from = ['0' => '0'];;
- $rules_checked = false;
+ $selectedtype = ['percentage' => get_string('percentage', 'mod_coursework')];
+ $selectedto = ['100' => '100'];
+ $selectedfrom = ['0' => '0'];;
+ $ruleschecked = false;
}
- $html = html_writer::start_tag('div', ['class' => "assessor_{$assessor_number}_grade_rules", 'id' => "assessor_{$assessor_number}_grade_rules_{$sequence}"]);
+ $html = html_writer::start_tag('div', ['class' => "assessor{$assessornumber}graderules", 'id' => "assessor{$assessornumber}graderules{$sequence}"]);
- $html .= html_writer::checkbox("assessor_{$assessor_number}_samplerules[]", 1, $rules_checked, '',
- ['id' => "assessor_{$assessor_number}_samplerules_{$sequence}", 'class' => "assessor_{$assessor_number} range_grade_checkbox sample_set_rule"]);
+ $html .= html_writer::checkbox("assessor{$assessornumber}samplerules[]", 1, $ruleschecked, '',
+ ['id' => "assessor{$assessornumber}samplerules{$sequence}", 'class' => "assessor{$assessornumber} rangegradecheckbox samplesetrule"]);
- $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';
+ $gradescaletext = ($this->coursework->grade < 0) ? get_string('scale', 'mod_coursework') : get_string('grade', 'mod_coursework');
+ $gradescaleval = ($this->coursework->grade < 0) ? 'scale' : 'grade';
$options = ['percentage' => get_string('percentage', 'mod_coursework'),
- $grade_scale_val => $grade_scale_text];
+ $gradescaleval => $gradescaletext];
$html .= html_writer::select($options,
- "assessor_{$assessor_number}_sampletype[]",
+ "assessor{$assessornumber}sampletype[]",
"",
- $selected_type,
- ['id' => "assessor_{$assessor_number}_sampletype_{$sequence}", 'class' => "grade_type sample_set_rule"]);
+ $selectedtype,
+ ['id' => "assessor{$assessornumber}sampletype{$sequence}", 'class' => "grade_type sample_set_rule"]);
$html .= html_writer::label(get_string('from', 'mod_coursework'), 'assessortwo_samplefrom[0]');
- $rule_options = (!empty($selected_type) && array_key_exists('percentage', $selected_type)) ? $percentage_options : $scale; //change this into a ternary statement that
+ $ruleoptions = (!empty($selectedtype) && array_key_exists('percentage', $selectedtype)) ? $percentageoptions : $scale; //change this into a ternary statement that
- $html .= html_writer::select($rule_options,
- "assessor_{$assessor_number}_samplefrom[]",
+ $html .= html_writer::select($ruleoptions,
+ "assessor{$assessornumber}samplefrom[]",
"",
- $selected_from,
- ['id' => "assessor_{$assessor_number}_samplefrom_{$sequence}", 'class' => " sample_set_rule range_drop_down range_samp_from"]);
+ $selectedfrom,
+ ['id' => "assessor{$assessornumber}samplefrom{$sequence}", 'class' => " sample_set_rule range_drop_down range_samp_from"]);
- $html .= html_writer::label(get_string('to', 'mod_coursework'), "assessor_{$assessor_number}_sampleto[0]");
+ $html .= html_writer::label(get_string('to', 'mod_coursework'), "assessor{$assessornumber}sampleto[0]");
- $html .= html_writer::select(array_reverse($rule_options, true),
- "assessor_{$assessor_number}_sampleto[]",
+ $html .= html_writer::select(array_reverse($ruleoptions, true),
+ "assessor{$assessornumber}sampleto[]",
"",
- $selected_to,
- ['id' => "assessor_{$assessor_number}_sampleto_{$sequence}", 'class' => " sample_set_rule range_drop_down"]);
+ $selectedto,
+ ['id' => "assessor{$assessornumber}sampleto{$sequence}", 'class' => " sample_set_rule range_drop_down"]);
$html .= html_writer::end_tag('div', '');
@@ -159,9 +159,9 @@ public function range_elements($assessor_number, $sequence, $dbrecord=false) {
}
- public function add_form_elements_js($assessor_number=0) {
+ public function add_form_elements_js($assessornumber=0) {
- $js_script = "
+ $jsscript = "
var AUTOMATIC_SAMPLING = 1;
@@ -323,32 +323,32 @@ function change_options(element) {
";
- return html_writer::script($js_script, null);
+ return html_writer::script($jsscript, null);
}
- public function save_form_data($assessor_number=0, &$order=0) {
+ public function save_form_data($assessornumber=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);
+ $samplerules = optional_param_array("assessor{$assessornumber}samplerules", false, PARAM_RAW);
+ $sampletype = optional_param_array("assessor{$assessornumber}sampletype", false, PARAM_RAW);
+ $samplefrom = optional_param_array("assessor{$assessornumber}samplefrom", false, PARAM_RAW);
+ $sampleto = optional_param_array("assessor{$assessornumber}sampleto", false, PARAM_RAW);
- $sample_plugin = $DB->get_record('coursework_sample_set_plugin', ['rulename' => 'range_sample_type']);
+ $sampleplugin = $DB->get_record('coursework_sample_set_plugin', ['rulename' => 'range_sample_type']);
- if ($sample_rules) {
- foreach ($sample_rules as $i => $val) {
+ if ($samplerules) {
+ foreach ($samplerules as $i => $val) {
$dbrecord = new \stdClass();
- $dbrecord->ruletype = $sample_type[$i];
- $dbrecord->lowerlimit = $sample_from[$i];
- $dbrecord->upperlimit = $sample_to[$i];
- $dbrecord->sample_set_plugin_id = $sample_plugin->id;
+ $dbrecord->ruletype = $sampletype[$i];
+ $dbrecord->lowerlimit = $samplefrom[$i];
+ $dbrecord->upperlimit = $sampleto[$i];
+ $dbrecord->sample_set_plugin_id = $sampleplugin->id;
$dbrecord->courseworkid = $this->coursework->id;
$dbrecord->ruleorder = $order;
- $dbrecord->stage_identifier = "assessor_{$assessor_number}";
+ $dbrecord->stage_identifier = "assessor{$assessornumber}";
$DB->insert_record("coursework_sample_set_rules", $dbrecord);
$order++;
@@ -357,11 +357,11 @@ 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($stagenumber, &$allocatables, &$manualsampleset, &$autosampleset) {
global $DB;
- $stage = "assessor_".$stage_number;
+ $stage = "assessor_".$stagenumber;
$sql = "SELECT r.*,p.rulename
FROM {coursework_sample_set_plugin} p,
@@ -379,17 +379,17 @@ public function adjust_sample_set($stage_number, &$allocatables, &$manual_sample
$limit = $this->rationalise($ri->ruletype, $ri->lowerlimit, $ri->upperlimit);
// all allocatables that are within specified range based on previous stage
- $previous_stage = $stage_number - 1;
- $allocatables_in_range = $this->get_allocatables_in_range("assessor_".$previous_stage, $limit[0], $limit[1]);
+ $previousstage = $stagenumber - 1;
+ $allocatablesinrange = $this->get_allocatables_in_range("assessor_".$previousstage, $limit[0], $limit[1]);
$finalised = $this->finalised_submissions();
$published = $this->released_submissions();
- foreach ($allocatables_in_range as $awf) {
+ foreach ($allocatablesinrange as $awf) {
if (!isset($published[$awf->allocatableid]) && !isset($finalised[$awf->allocatableid])
- && !isset($auto_sample_set[$awf->allocatableid]) && !isset($manual_sample_set[$awf->allocatableid])
+ && !isset($autosampleset[$awf->allocatableid]) && !isset($manualsampleset[$awf->allocatableid])
&& isset($allocatables[$awf->allocatableid])) {
- $auto_sample_set[$awf->allocatableid] = $allocatables[$awf->allocatableid];
+ $autosampleset[$awf->allocatableid] = $allocatables[$awf->allocatableid];
}
}
@@ -419,11 +419,11 @@ private function rationalise($ruletype, $limit1, $limit2) {
if ($scale) {
- $coursework_scale = explode(",", $scale->scale);
+ $courseworkscale = explode(",", $scale->scale);
- $number_of_items = count($coursework_scale);
+ $numberofitems = count($courseworkscale);
- $weighting = 100 / $number_of_items; // shall we round it????
+ $weighting = 100 / $numberofitems; // shall we round it????
$limits[0] = ceil($limits[0] / $weighting); // element of array
$limits[1] = ceil($limits[1] / $weighting); // element of array
diff --git a/classes/sample_set_rule/sample_base.php b/classes/sample_set_rule/sample_base.php
index 03d38d0d..3fa9a482 100644
--- a/classes/sample_set_rule/sample_base.php
+++ b/classes/sample_set_rule/sample_base.php
@@ -38,7 +38,7 @@ abstract class sample_base {
/**
* @var string DB table this class relates to.
*/
- protected static $table_name = 'coursework_mod_set_rules';
+ protected static $tablename = 'coursework_mod_set_rules';
/**
* @var int
@@ -115,7 +115,7 @@ final public function get_name() {
* @param stage_base $stage
* @return mixed
*/
- abstract public function adjust_set(array &$moderationset, array &$potential_allocatables, $stage);
+ abstract public function adjust_set(array &$moderationset, array &$potentialallocatables, $stage);
/**
* Tells us where this ought to be in relation to other rules. The one for percent of total must happen last,
@@ -142,13 +142,13 @@ public static function allow_multiple() {
* @abstract
* @return mixed
*/
- abstract public function add_form_elements($assessor_number);
+ abstract public function add_form_elements($assessornumber);
- abstract public function add_form_elements_js($assessor_number);
+ abstract public function add_form_elements_js($assessornumber);
- abstract public function save_form_data($assessor_number=0, &$order=0);
+ abstract public function save_form_data($assessornumber=0, &$order=0);
- abstract public function adjust_sample_set($rule_id, &$manual_sample_set, &$allocatables, &$auto_sample_set);
+ abstract public function adjust_sample_set($ruleid, &$manualsampleset, &$allocatables, &$autosampleset);
/**
*
diff --git a/classes/sample_set_rule/total_sample_type.php b/classes/sample_set_rule/total_sample_type.php
index 81cc9019..0aec7c3c 100644
--- a/classes/sample_set_rule/total_sample_type.php
+++ b/classes/sample_set_rule/total_sample_type.php
@@ -37,7 +37,7 @@
*/
class total_sample_type extends \mod_coursework\sample_set_rule\sample_base {
- public function adjust_set(array &$moderation_set, array &$potential_allocatables, $stage) {
+ public function adjust_set(array &$moderationset, array &$potentialallocatables, $stage) {
}
@@ -49,7 +49,7 @@ public function get_default_rule_order() {
}
- public function add_form_elements($assessor_number=0) {
+ public function add_form_elements($assessornumber=0) {
global $DB;
@@ -58,28 +58,28 @@ public function add_form_elements($assessor_number=0) {
{coursework_sample_set_plugin} sp
WHERE sr.sample_set_plugin_id = sp.id
AND sr.courseworkid = {$this->coursework->id}
- AND sr.stage_identifier = 'assessor_{$assessor_number}'
+ AND sr.stageidentifier = 'assessor{$assessornumber}'
AND sp.rulename = 'total_sample_type'";
$selected = ($record = $DB->get_record_sql($sql)) ? [$record->upperlimit => $record->upperlimit] : false;
$checked = ($selected) ? true : false;
- $percentage_options = [];
+ $percentageoptions = [];
for ($i = 5; $i <= 100; $i = $i + 5) {
- $percentage_options[$i] = "{$i}";
+ $percentageoptions[$i] = "{$i}";
}
$html = html_writer::start_div('sampletotal');
- $html .= html_writer::checkbox("assessor_{$assessor_number}_sampletotal_checkbox", 1, $checked, get_string('topupto', 'mod_coursework'),
- ['id' => "assessor_{$assessor_number}_sampletotal_checkbox", 'class' => "assessor_{$assessor_number} total_checkbox sample_set_rule"]);
+ $html .= html_writer::checkbox("assessor{$assessornumber}sampletotalcheckbox", 1, $checked, get_string('topupto', 'mod_coursework'),
+ ['id' => "assessor{$assessornumber}sampletotalcheckbox", 'class' => "assessor{$assessornumber} totalcheckbox samplesetrule"]);
- $html .= html_writer::select($percentage_options,
- "assessor_{$assessor_number}_sampletotal",
+ $html .= html_writer::select($percentageoptions,
+ "assessor{$assessornumber}sampletotal",
"",
$selected,
- ['id' => "assessor_{$assessor_number}_sampletotal", 'class' => " sample_set_rule"]);
+ ['id' => "assessor{$assessornumber}sampletotal", 'class' => " sample_set_rule"]);
$html .= html_writer::label(get_string('ofallstudents', 'mod_coursework'), 'assessortwo_sampletotal[]');
$html .= html_writer::end_div();
@@ -87,9 +87,9 @@ public function add_form_elements($assessor_number=0) {
return $html;
}
- public function add_form_elements_js($assessor_number=0) {
+ public function add_form_elements_js($assessornumber=0) {
- $js_script = "
+ $jsscript = "
$('.total_checkbox').each(function(e,element) {
@@ -109,26 +109,26 @@ public function add_form_elements_js($assessor_number=0) {
";
- return html_writer::script($js_script, null);
+ return html_writer::script($jsscript, null);
}
- function save_form_data($assessor_number=0, &$order=0) {
+ function save_form_data($assessornumber=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);
+ $totalcheckbox = optional_param("assessor{$assessornumber}sampletotalcheckbox", false, PARAM_INT);
+ $sampletotal = optional_param("assessor{$assessornumber}sampletotal", false, PARAM_INT);
- if ($total_checkbox) {
+ if ($totalcheckbox) {
$dbrecord = new \stdClass();
$dbrecord->ruletype = "";
$dbrecord->lowerlimit = 0;
- $dbrecord->upperlimit = $sample_total;
+ $dbrecord->upperlimit = $sampletotal;
$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}";
+ $dbrecord->stage_identifier = "assessor{$assessornumber}";
$DB->insert_record('coursework_sample_set_rules', $dbrecord);
}
@@ -142,11 +142,11 @@ 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($stagenumber, &$allocatables, &$manualsampleset, &$autosampleset) {
global $DB;
- $stage = "assessor_".$stage_number;
+ $stage = "assessor_".$stagenumber;
$sql = "SELECT r.*,p.rulename
FROM {coursework_sample_set_plugin} p,
@@ -163,43 +163,43 @@ public function adjust_sample_set($stage_number, &$allocatables, &$manual_sample
$finalised = $this->finalised_submissions();
$published = $this->released_submissions();
- $number_of_alloctables = count($allocatables);
+ $numberofalloctables = count($allocatables);
- $total_to_return = ceil(($rule->upperlimit / 100) * $number_of_alloctables);
+ $totaltoreturn = ceil(($rule->upperlimit / 100) * $numberofalloctables);
// We include the manual sample set in the count
// TODO: should we do this?
- $total_to_return -= count($manual_sample_set);
+ $totaltoreturn -= count($manualsampleset);
// If the resultant number isnt greater than 0 then no automatic sample allocatables will be used
- if ($total_to_return > 0) {
+ if ($totaltoreturn > 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 ($chunkedarray = array_chunk($autosampleset, $totaltoreturn, true)) {
+ $autosampleset = $chunkedarray[0];
}
// If the number in the sample set is less than the total to return
- if (count($auto_sample_set) < $total_to_return) {
+ if (count($autosampleset) < $totaltoreturn) {
// We need to top up the sample set with other allocatables
// Graded at the previous stage take precedence
- $previous_stage_number = $stage_number - 1;
+ $previousstagenumber = $stagenumber - 1;
- $previous_stage = 'assessor_' . $previous_stage_number;
+ $previousstage = 'assessor_' . $previousstagenumber;
- $allocatables_feedback = $this->coursework->get_allocatables_with_feedback($previous_stage, true);
+ $allocatablesfeedback = $this->coursework->get_allocatables_with_feedback($previousstage, true);
- foreach ($allocatables_feedback as $af) {
+ foreach ($allocatablesfeedback as $af) {
if (!isset($published[$af->allocatableid]) && !isset($finalised[$af->allocatableid])
- && !isset($auto_sample_set[$af->allocatableid]) && !isset($manual_sample_set[$af->allocatableid])) {
- $auto_sample_set[$af->allocatableid] = $allocatables[$af->allocatableid];
+ && !isset($autosampleset[$af->allocatableid]) && !isset($manualsampleset[$af->allocatableid])) {
+ $autosampleset[$af->allocatableid] = $allocatables[$af->allocatableid];
}
- if (count($auto_sample_set) == $total_to_return) {
+ if (count($autosampleset) == $totaltoreturn) {
break;
}
@@ -207,36 +207,36 @@ 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 (count($auto_sample_set) < $total_to_return) {
+ if (count($autosampleset) < $totaltoreturn) {
// Remove allocatables with published submissions
- $allocatable_sample_set = array_diff_ukey($allocatables, $published, ["mod_coursework\\sample_set_rule\\total_sample_type", "compare_key"]);
+ $allocatablesampleset = array_diff_ukey($allocatables, $published, ["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, ["mod_coursework\\sample_set_rule\\total_sample_type", "compare_key"]);
+ $allocatablesampleset = array_diff_ukey($allocatablesampleset, $finalised, ["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, ["mod_coursework\\sample_set_rule\\total_sample_type", "compare_key"]);
+ $allocatablesampleset = array_diff_ukey($allocatablesampleset, $manualsampleset, ["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, ["mod_coursework\\sample_set_rule\\total_sample_type", "compare_key"]);
+ $allocatablesampleset = array_diff_ukey($allocatablesampleset, $autosampleset, ["mod_coursework\\sample_set_rule\\total_sample_type", "compare_key"]);
- $array_keys = array_rand($allocatable_sample_set, $total_to_return - count($auto_sample_set));
+ $arraykeys = array_rand($allocatablesampleset, $totaltoreturn - count($autosampleset));
- if (!is_array($array_keys)) {
- $array_keys = [$array_keys];
+ if (!is_array($arraykeys)) {
+ $arraykeys = [$arraykeys];
}
//use the allocatables array to get other ungraded allocatables
- foreach ($array_keys as $id) {
+ foreach ($arraykeys as $id) {
if (!isset($published[$id]) && !isset($finalised[$id])
- && !isset($auto_sample_set[$id]) && !isset($manual_sample_set[$id])
+ && !isset($autosampleset[$id]) && !isset($manualsampleset[$id])
) {
- $auto_sample_set[$id] = $allocatables[$id];
+ $autosampleset[$id] = $allocatables[$id];
}
- if (count($auto_sample_set) == $total_to_return) {
+ if (count($autosampleset) == $totaltoreturn) {
break;
}
}
@@ -244,7 +244,7 @@ public function adjust_sample_set($stage_number, &$allocatables, &$manual_sample
}
} else {
- $auto_sample_set = [];
+ $autosampleset = [];
}
}
diff --git a/classes/stages/base.php b/classes/stages/base.php
index 4f2362a1..2eeb39e4 100644
--- a/classes/stages/base.php
+++ b/classes/stages/base.php
@@ -50,22 +50,22 @@ abstract class base {
/**
* @var string
*/
- protected $stage_identifier;
+ protected $stageidentifier;
/**
* @var array|null
*/
- protected $allocatables_with_feedback;
+ protected $allocatableswithfeedback;
/**
* @var array|null
*/
- protected $allocatables_with_moderation;
+ protected $allocatableswithmoderation;
/**
* @var array
*/
- private static $self_cache = [
+ private static $selfcache = [
'user_is_assessor' => [],
];
@@ -73,18 +73,18 @@ abstract class base {
* @param coursework $coursework
* @param int $stage_identifier
*/
- public function __construct($coursework, $stage_identifier) {
+ public function __construct($coursework, $stageidentifier) {
$this->coursework = $coursework;
- $this->stage_identifier = $stage_identifier;
+ $this->stage_identifier = $stageidentifier;
}
/**
* @return strategy_base
*/
private function get_allocation_strategy() {
- $strategy_name = $this->strategy_name();
- $class_name = "\\mod_coursework\\allocation\\strategy\\{$strategy_name}";
- return new $class_name($this->get_coursework(), $this);
+ $strategyname = $this->strategy_name();
+ $classname = "\\modcoursework\\allocation\\strategy\\{$strategyname}";
+ return new $classname($this->get_coursework(), $this);
}
/**
@@ -121,10 +121,10 @@ protected function get_coursework() {
* @return bool
*/
private function already_allocated($allocatable) {
- $coursework_id = $this->get_coursework_id();
- allocation::fill_pool_coursework($coursework_id);
+ $courseworkid = $this->get_coursework_id();
+ allocation::fill_pool_coursework($courseworkid);
$record = allocation::get_object(
- $coursework_id,
+ $courseworkid,
'allocatableid-allocatabletype-stage_identifier',
[$allocatable->id(), $allocatable->type(), $this->identifier()]
);
@@ -139,10 +139,10 @@ private function already_allocated($allocatable) {
public function assessor_already_allocated_for_this_submission($allocatable, $assessor) {
if (!empty($assessor)) {
- $coursework_id = $this->get_coursework_id();
- allocation::fill_pool_coursework($coursework_id);
+ $courseworkid = $this->get_coursework_id();
+ allocation::fill_pool_coursework($courseworkid);
$record = allocation::get_object(
- $coursework_id,
+ $courseworkid,
'allocatableid-allocatabletype-assessorid',
[$allocatable->id(), $allocatable->type(), $assessor->id]
);
@@ -194,9 +194,9 @@ public function make_manual_allocation($allocatable, $teacher) {
* @return \html_table_cell
*/
public function get_allocation_table_cell($allocatable) {
- $cell_helper = $this->get_cell_helper($allocatable);
+ $cellhelper = $this->get_cell_helper($allocatable);
- return $cell_helper->get_renderable_allocation_table_cell();
+ return $cellhelper->get_renderable_allocation_table_cell();
}
/**
@@ -204,9 +204,9 @@ public function get_allocation_table_cell($allocatable) {
* @return \html_table_cell
*/
public function get_moderation_table_cell($allocatable) {
- $cell_helper = $this->get_cell_helper($allocatable);
+ $cellhelper = $this->get_cell_helper($allocatable);
- return $cell_helper->get_renderable_moderation_table_cell();
+ return $cellhelper->get_renderable_moderation_table_cell();
}
/**
@@ -275,10 +275,10 @@ private function prepare_allocation_to_save($allocatable, $teacher) {
*/
public function allocation_is_manual($allocatable) {
- $coursework_id = $this->get_coursework_id();
- allocation::fill_pool_coursework($coursework_id);
+ $courseworkid = $this->get_coursework_id();
+ allocation::fill_pool_coursework($courseworkid);
$record = allocation::get_object(
- $coursework_id,
+ $courseworkid,
'allocatableid-allocatabletype-stage_identifier',
[$allocatable->id(), $allocatable->type(), $this->identifier()]
);
@@ -294,24 +294,24 @@ public function allocation_is_manual($allocatable) {
public function get_teachers() {
$cache = \cache::make('mod_coursework', 'courseworkdata');
- $serialised_teachers = $cache->get($this->coursework->id()."_teachers");
+ $serialisedteachers = $cache->get($this->coursework->id()."_teachers");
// 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))) {
+ if (empty($serialisedteachers) || empty(unserialize($serialisedteachers))) {
$users = get_enrolled_users($this->coursework->get_context());
- $teacher_users = [];
+ $teacherusers = [];
$modcontext = $this->coursework->get_context();
foreach ($users as $user) {
if (has_capability($this->assessor_capability(), $modcontext, $user)) {
- $teacher_users[] = user::build($user);
+ $teacherusers[] = user::build($user);
}
}
- $cache->set($this->coursework->id()."_teachers", serialize($teacher_users));
+ $cache->set($this->coursework->id()."_teachers", serialize($teacherusers));
} else {
- $teacher_users = unserialize($serialised_teachers);
+ $teacherusers = unserialize($serialisedteachers);
}
- return $teacher_users;
+ return $teacherusers;
}
/**
@@ -327,12 +327,12 @@ abstract protected function assessor_capability();
*/
public function has_feedback($allocatable) {
$feedback = null;
- $coursework_id = $this->get_coursework_id();
- submission::fill_pool_coursework($coursework_id);
- $submission = submission::get_object($coursework_id, 'allocatableid', [$allocatable->id]);
+ $courseworkid = $this->get_coursework_id();
+ submission::fill_pool_coursework($courseworkid);
+ $submission = submission::get_object($courseworkid, 'allocatableid', [$allocatable->id]);
if ($submission) {
- feedback::fill_pool_coursework($coursework_id);
- $feedback = feedback::get_object($coursework_id, 'submissionid-stage_identifier', [$submission->id, $this->identifier()]);
+ feedback::fill_pool_coursework($courseworkid);
+ $feedback = feedback::get_object($courseworkid, 'submissionid-stage_identifier', [$submission->id, $this->identifier()]);
}
return !empty($feedback);
}
@@ -363,8 +363,8 @@ public function has_moderation($submission) {
public function get_moderation($submission) {
$feedback = $this->get_single_feedback($submission);
if ($feedback) {
- $moderation_params = ['feedbackid' => $feedback->id];
- return moderation::find($moderation_params);
+ $moderationparams = ['feedbackid' => $feedback->id];
+ return moderation::find($moderationparams);
} else {
return false;
}
@@ -401,11 +401,11 @@ public function get_single_feedback($submission) {
*/
public function has_allocation($allocatable) {
if (!isset($this->allocatables_with_allocations)) {
- $coursework_id = $this->get_coursework()->id;
- if (!isset(allocation::$pool[$coursework_id]['stage_identifier'])) {
- allocation::fill_pool_coursework($coursework_id);
+ $courseworkid = $this->get_coursework()->id;
+ if (!isset(allocation::$pool[$courseworkid]['stage_identifier'])) {
+ allocation::fill_pool_coursework($courseworkid);
}
- $this->allocatables_with_allocations = array_column(allocation::$pool[$coursework_id]['stage_identifier'][$this->stage_identifier] ?? [], 'allocatableid');
+ $this->allocatables_with_allocations = array_column(allocation::$pool[$courseworkid]['stage_identifier'][$this->stage_identifier] ?? [], 'allocatableid');
}
return in_array($allocatable->id, $this->allocatables_with_allocations);
@@ -417,9 +417,9 @@ public function has_allocation($allocatable) {
* @return bool
*/
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]);
+ $courseworkid = $this->get_coursework_id();
+ allocation::fill_pool_coursework($courseworkid);
+ $record = allocation::get_object($courseworkid, 'stage_identifier', [$this->stage_identifier]);
return !empty($record);
}
@@ -448,10 +448,10 @@ public function get_allocation($allocatable) {
* @return user
*/
public function allocated_teacher_for($allocatable) {
- $coursework_id = $this->get_coursework_id();
- allocation::fill_pool_coursework($coursework_id);
+ $courseworkid = $this->get_coursework_id();
+ allocation::fill_pool_coursework($courseworkid);
$allocation = allocation::get_object(
- $coursework_id,
+ $courseworkid,
'allocatableid-allocatabletype-stage_identifier',
[$allocatable->id(), $allocatable->type(), $this->identifier()]
);
@@ -468,19 +468,19 @@ public function allocated_teacher_for($allocatable) {
* @param array $row_data
* @return void
*/
- public function process_allocation_form_row_data($allocatable, $row_data) {
- $cell_helper = $this->get_cell_processor($allocatable);
- $cell_data = $this->get_cell_data($row_data);
- $cell_helper->process($cell_data);
+ public function process_allocation_form_row_data($allocatable, $rowdata) {
+ $cellhelper = $this->get_cell_processor($allocatable);
+ $celldata = $this->get_cell_data($rowdata);
+ $cellhelper->process($celldata);
}
/**
* @param array $row_data
* @return mixed
*/
- private function get_cell_data($row_data) {
- if (array_key_exists($this->identifier(), $row_data)) {
- return new data($this, $row_data[$this->identifier()]);
+ private function get_cell_data($rowdata) {
+ if (array_key_exists($this->identifier(), $rowdata)) {
+ return new data($this, $rowdata[$this->identifier()]);
}
return new data($this);
}
@@ -534,12 +534,12 @@ public function allocatable_is_not_in_sampling($allocatable) {
* @param allocatable $allocatable
*/
public function add_allocatable_to_sampling($allocatable) {
- $moderation_set_membership = new assessment_set_membership();
- $moderation_set_membership->courseworkid = $this->coursework->id;
- $moderation_set_membership->allocatableid = $allocatable->id();
- $moderation_set_membership->allocatabletype = $allocatable->type();
- $moderation_set_membership->stage_identifier = $this->stage_identifier;
- $moderation_set_membership->save();
+ $moderationsetmembership = new assessment_set_membership();
+ $moderationsetmembership->courseworkid = $this->coursework->id;
+ $moderationsetmembership->allocatableid = $allocatable->id();
+ $moderationsetmembership->allocatabletype = $allocatable->type();
+ $moderationsetmembership->stage_identifier = $this->stage_identifier;
+ $moderationsetmembership->save();
}
/**
@@ -562,14 +562,14 @@ public function remove_allocatable_from_sampling($allocatable) {
* @return bool
*/
public function user_is_assessor($assessor) {
- if (!isset(self::$self_cache['user_is_assessor'][$this->coursework->id][$assessor->id])) {
+ if (!isset(self::$selfcache['user_is_assessor'][$this->coursework->id][$assessor->id])) {
$enrolled = is_enrolled($this->coursework->get_course_context(), $assessor);
$hasmoduleassessorcapability =
($enrolled && has_capability($this->assessor_capability(), $this->coursework->get_context(), $assessor))
|| is_primary_admin($assessor->id);
- self::$self_cache['user_is_assessor'][$this->coursework->id][$assessor->id] = $hasmoduleassessorcapability;
+ self::$selfcache['user_is_assessor'][$this->coursework->id][$assessor->id] = $hasmoduleassessorcapability;
}
- return self::$self_cache['user_is_assessor'][$this->coursework->id][$assessor->id];
+ return self::$selfcache['user_is_assessor'][$this->coursework->id][$assessor->id];
}
/**
@@ -643,21 +643,21 @@ abstract public function allocation_table_header();
* @return bool
*/
public function prerequisite_stages_have_feedback($allocatable) {
- $all_stages = $this->get_coursework()->marking_stages();
+ $allstages = $this->get_coursework()->marking_stages();
// Some stages are parallel, so we ignore them being partially complete.
- $previous_stage_ok = true;
- $current_stage = false;
- $current_stage_ok = true;
- $coursework_id = $this->get_coursework_id();
- submission::fill_pool_coursework($coursework_id);
+ $previousstageok = true;
+ $currentstage = false;
+ $currentstageok = true;
+ $courseworkid = $this->get_coursework_id();
+ submission::fill_pool_coursework($courseworkid);
- foreach ($all_stages as $stage) {
+ foreach ($allstages as $stage) {
// if coursework has sampling enabled, each stage must be checked if it uses sampling
if ($this->get_coursework()->sampling_enabled()) {
- $submission = submission::get_object($coursework_id, 'allocatableid-allocatabletype', [$allocatable->id(), $allocatable->type()]);
+ $submission = submission::get_object($courseworkid, 'allocatableid-allocatabletype', [$allocatable->id(), $allocatable->type()]);
if (count($submission->get_assessor_feedbacks()) >= $submission->max_number_of_feedbacks()
&& $submission->sampled_feedback_exists()) {
@@ -669,16 +669,16 @@ public function prerequisite_stages_have_feedback($allocatable) {
break;
}
$class = get_class($stage);
- if ($class != $current_stage) { // New stage type
- $current_stage = $class;
- $previous_stage_ok = $current_stage_ok;
- $current_stage_ok = $stage->has_feedback($allocatable) && !$stage->in_editable_period($allocatable);
+ if ($class != $currentstage) { // New stage type
+ $currentstage = $class;
+ $previousstageok = $currentstageok;
+ $currentstageok = $stage->has_feedback($allocatable) && !$stage->in_editable_period($allocatable);
} else { // Same stage (parallel)
- $current_stage_ok = $current_stage_ok && $stage->has_feedback($allocatable) && !$stage->in_editable_period($allocatable);
+ $currentstageok = $currentstageok && $stage->has_feedback($allocatable) && !$stage->in_editable_period($allocatable);
}
}
- return $this->is_parallell() ? $previous_stage_ok : $current_stage_ok;
+ return $this->is_parallell() ? $previousstageok : $currentstageok;
}
/**
@@ -708,8 +708,8 @@ public function group_assessor_enabled() {
* @return feedback|bool
*/
public function get_feedback_for_submission($submission) {
- $stage_identifier = $this->identifier();
- $feedback = feedback::get_object($submission->courseworkid, 'submissionid-stage_identifier', [$submission->id, $stage_identifier]);
+ $stageidentifier = $this->identifier();
+ $feedback = feedback::get_object($submission->courseworkid, 'submissionid-stage_identifier', [$submission->id, $stageidentifier]);
return $feedback;
}
@@ -718,10 +718,10 @@ public function get_feedback_for_submission($submission) {
* @return moderation|bool
*/
public function get_moderation_for_feedback($feedback) {
- $moderation_params = [
+ $moderationparams = [
'feedbackid' => $feedback->id,
];
- return moderation::find($moderation_params);
+ return moderation::find($moderationparams);
}
/**
@@ -772,7 +772,7 @@ public function potential_marker_dropdown($allocatable) {
return ' ' . get_string('nomarkers', 'mod_coursework');
}
- $html_attributes = [
+ $htmlattributes = [
'id' => $this->assessor_dropdown_id($allocatable),
'class' => 'assessor_id_dropdown',
];
@@ -780,7 +780,7 @@ public function potential_marker_dropdown($allocatable) {
if ($this->identifier() != 'assessor_1' && !$this->currently_allocated_assessor($allocatable)
&& $this->coursework->sampling_enabled() && !$this->allocatable_is_in_sample($allocatable)
) {
- $html_attributes['disabled'] = 'disabled';
+ $htmlattributes['disabled'] = 'disabled';
}
$grader = substr($this->identifier(), 0, -2);
@@ -790,20 +790,20 @@ public function potential_marker_dropdown($allocatable) {
$identifier = 'change' . $grader;
}
- $option_for_nothing_chosen_yet = ['' => get_string($identifier, 'mod_coursework')];
+ $optionfornothingchosenyet = ['' => get_string($identifier, 'mod_coursework')];
- $dropdown_name = $this->assessor_dropdown_name($allocatable);
+ $dropdownname = $this->assessor_dropdown_name($allocatable);
- $selected = $this->selected_allocation_in_session($dropdown_name);
+ $selected = $this->selected_allocation_in_session($dropdownname);
- $assessor_dropdown = \html_writer::select($this->assessor_dropdown_options,
- $dropdown_name,
+ $assessordropdown = \html_writer::select($this->assessor_dropdown_options,
+ $dropdownname,
$selected,
- $option_for_nothing_chosen_yet,
- $html_attributes
+ $optionfornothingchosenyet,
+ $htmlattributes
);
- return $assessor_dropdown;
+ return $assessordropdown;
}
/**
@@ -812,21 +812,21 @@ public function potential_marker_dropdown($allocatable) {
*/
public function potential_moderator_dropdown($allocatable) {
- $option_for_nothing_chosen_yet = ['' => 'Choose Moderator'];
- $html_attributes = [
+ $optionfornothingchosenyet = ['' => 'Choose Moderator'];
+ $htmlattributes = [
'id' => $this->moderator_dropdown_id($allocatable),
'class' => 'moderator_id_dropdown',
];
- $dropdown_name = $this->assessor_dropdown_name($allocatable);
+ $dropdownname = $this->assessor_dropdown_name($allocatable);
- $selected = $this->selected_allocation_in_session($dropdown_name);
+ $selected = $this->selected_allocation_in_session($dropdownname);
- return $moderator_dropdown = \html_writer::select($this->potential_moderators_as_options_array(),
+ return $moderatordropdown = \html_writer::select($this->potential_moderators_as_options_array(),
'allocatables[' . $allocatable->id . '][moderator][assessor_id]',
$selected,
- $option_for_nothing_chosen_yet,
- $html_attributes);
+ $optionfornothingchosenyet,
+ $htmlattributes);
}
/**
@@ -886,9 +886,9 @@ private function moderator_dropdown_id($allocatable) {
* @return string
*/
private function assessor_dropdown_name($allocatable) {
- $input_name =
+ $inputname =
'allocatables[' . $allocatable->id . '][' . $this->identifier() . '][assessor_id]';
- return $input_name;
+ return $inputname;
}
/**
@@ -914,9 +914,9 @@ private function in_editable_period($allocatable) {
return false;
}
- $coursework_id = $this->get_coursework_id();
- submission::fill_pool_coursework($coursework_id);
- $submission = submission::get_object($coursework_id, 'allocatableid-allocatabletype', [$allocatable->id(), $allocatable->type()]);
+ $courseworkid = $this->get_coursework_id();
+ submission::fill_pool_coursework($courseworkid);
+ $submission = submission::get_object($courseworkid, 'allocatableid-allocatabletype', [$allocatable->id(), $allocatable->type()]);
$feedback = $this->get_feedback_for_submission($submission);
if ($feedback) {
diff --git a/classes/traits/allocatable_functions.php b/classes/traits/allocatable_functions.php
index 94d939cf..83bfdc7f 100644
--- a/classes/traits/allocatable_functions.php
+++ b/classes/traits/allocatable_functions.php
@@ -108,7 +108,7 @@ public function get_agreed_feedback($coursework) {
public function has_all_initial_feedbacks($coursework) {
global $DB;
- $expected_markers = $coursework->numberofmarkers;
+ $expectedmarkers = $coursework->numberofmarkers;
$sql = "
SELECT COUNT(*)
@@ -137,10 +137,10 @@ public function has_all_initial_feedbacks($coursework) {
'allocatableid' => $this->id(),
'allocatabletype' => $this->type()]);
- $expected_markers = $markers + 1; // there is always a marker for stage 1
+ $expectedmarkers = $markers + 1; // there is always a marker for stage 1
}
- return $feedbacks == $expected_markers;
+ return $feedbacks == $expectedmarkers;
}
/**
@@ -173,8 +173,8 @@ public function get_submission($coursework) {
* @param $coursework
*/
private function fill_submission_and_feedback($coursework) {
- $coursework_id = $coursework->id;
- submission::fill_pool_coursework($coursework_id);
- feedback::fill_pool_coursework($coursework_id);
+ $courseworkid = $coursework->id;
+ submission::fill_pool_coursework($courseworkid);
+ feedback::fill_pool_coursework($courseworkid);
}
}
diff --git a/classes/warnings.php b/classes/warnings.php
index ae412286..d344de17 100644
--- a/classes/warnings.php
+++ b/classes/warnings.php
@@ -52,15 +52,15 @@ public function __construct($coursework) {
public function not_enough_assessors() {
$html = '';
- $first_stage = $this->coursework->get_stage('assessor_1');
- $actual_number = count($first_stage->get_teachers());
- $number_of_initial_assessors = $actual_number;
+ $firststage = $this->coursework->get_stage('assessor_1');
+ $actualnumber = count($firststage->get_teachers());
+ $numberofinitialassessors = $actualnumber;
- if ($number_of_initial_assessors < $this->coursework->numberofmarkers) {
+ if ($numberofinitialassessors < $this->coursework->numberofmarkers) {
// Problem!
$strings = new \stdClass();
- $strings->actual_number = $actual_number;
+ $strings->actual_number = $actualnumber;
$strings->required_number = $this->coursework->numberofmarkers;
$html .= get_string('not_enough_teachers', 'mod_coursework', $strings);
@@ -201,10 +201,10 @@ public function percentage_allocations_not_complete() {
WHERE courseworkid = ?
AND allocationstrategy = 'percentages'
";
- $total_percentages = $DB->count_records_sql($sql, [$this->coursework->id]);
+ $totalpercentages = $DB->count_records_sql($sql, [$this->coursework->id]);
- if ($total_percentages < 100) {
- return $this->alert_div(get_string('percentages_do_not_add_up', 'mod_coursework', $total_percentages));
+ if ($totalpercentages < 100) {
+ return $this->alert_div(get_string('percentages_do_not_add_up', 'mod_coursework', $totalpercentages));
}
}
@@ -220,8 +220,8 @@ public function manual_allocation_not_completed() {
$coursework = $this->coursework;
- $coursework_stages = $coursework->numberofmarkers;
- for ($i = 1; $i <= $coursework_stages; $i++) {
+ $courseworkstages = $coursework->numberofmarkers;
+ for ($i = 1; $i <= $courseworkstages; $i++) {
$assessor = 'assessor_'.$i;
if ($coursework->samplingenabled == 0 || $assessor == 'assessor_1') {
@@ -233,9 +233,9 @@ public function manual_allocation_not_completed() {
'stageidentifier' => $assessor,
'allocatableid' => $allocatable->id];
- $existing_allocations = $this->check_existing_allocations($params);
+ $existingallocations = $this->check_existing_allocations($params);
- if ($existing_allocations == false) {
+ if ($existingallocations == false) {
return $this->alert_div(get_string('assessors_no_allocated_warning', 'mod_coursework'));
}
}
@@ -246,15 +246,15 @@ public function manual_allocation_not_completed() {
FROM {coursework_sample_set_mbrs}
WHERE courseworkid = :courseworkid";
- $stage_identifiers = $DB->get_records_sql($sql, $params);
- foreach ($stage_identifiers as $stage_identifier) {
+ $stageidentifiers = $DB->get_records_sql($sql, $params);
+ foreach ($stageidentifiers as $stageidentifier) {
$params = ['courseworkid' => $coursework->id,
- 'stageidentifier' => $stage_identifier->stage_identifier,
- 'allocatableid' => $stage_identifier->allocatableid];
+ 'stageidentifier' => $stageidentifier->stage_identifier,
+ 'allocatableid' => $stageidentifier->allocatableid];
- $existing_allocations = $this->check_existing_allocations($params);
+ $existingallocations = $this->check_existing_allocations($params);
- if ($existing_allocations == false) {
+ if ($existingallocations == false) {
return $this->alert_div(get_string('assessors_no_allocated_warning', 'mod_coursework'));
}
}
@@ -275,7 +275,7 @@ public function check_existing_allocations($params) {
AND stage_identifier = :stageidentifier
AND allocatableid = :allocatableid";
- return $existing_allocations = $DB->get_records_sql($sql, $params);
+ return $existingallocations = $DB->get_records_sql($sql, $params);
}
@@ -292,24 +292,24 @@ public function student_in_no_group() {
return '';
}
- $student_ids = array_keys(get_enrolled_users($this->coursework->get_context(), 'mod/coursework:submit'));
+ $studentids = array_keys(get_enrolled_users($this->coursework->get_context(), 'mod/coursework:submit'));
- if (empty($student_ids)) {
+ if (empty($studentids)) {
return '';
}
- list($student_sql, $student_params) = $DB->get_in_or_equal($student_ids, SQL_PARAMS_NAMED);
+ list($studentsql, $studentparams) = $DB->get_in_or_equal($studentids, SQL_PARAMS_NAMED);
if ($this->coursework->grouping_id != 0) {
$students =
- $this->students_who_are_not_in_any_grouping_group($student_sql, $student_params);
+ $this->students_who_are_not_in_any_grouping_group($studentsql, $studentparams);
if ($students) {
$names = $this->make_list_of_student_names($students);
return $this->alert_div(get_string('students_in_no_group_warning', 'mod_coursework').$names);
}
} else {
- $students = $this->students_who_are_not_in_any_group($student_sql, $student_params);
+ $students = $this->students_who_are_not_in_any_group($studentsql, $studentparams);
if ($students) {
$names = $this->make_list_of_student_names($students);
@@ -352,7 +352,7 @@ protected function make_list_of_student_names($students) {
* @param $student_params
* @return mixed
*/
- private function students_who_are_not_in_any_group($student_sql, $student_params) {
+ private function students_who_are_not_in_any_group($studentsql, $studentparams) {
global $DB;
$sql = "SELECT u.*
@@ -365,11 +365,11 @@ private function students_who_are_not_in_any_group($student_sql, $student_params
WHERE m.userid = u.id
AND g.courseid = :courseid
)
- AND u.id $student_sql
+ AND u.id $studentsql
";
- $params = array_merge($student_params,
+ $params = array_merge($studentparams,
[
'courseid' => $this->coursework->get_course()->id,
]);
@@ -382,7 +382,7 @@ private function students_who_are_not_in_any_group($student_sql, $student_params
* @param $student_params
* @return mixed
*/
- private function students_who_are_not_in_any_grouping_group($student_sql, $student_params) {
+ private function students_who_are_not_in_any_grouping_group($studentsql, $studentparams) {
global $DB;
$sql = "SELECT u.*
@@ -398,10 +398,10 @@ private function students_who_are_not_in_any_grouping_group($student_sql, $stude
AND g.courseid = :courseid
AND gr.groupingid = :groupingid
)
- AND u.id $student_sql
+ AND u.id $studentsql
";
- $params = array_merge($student_params,
+ $params = array_merge($studentparams,
[
'courseid' => $this->coursework->get_course()->id,
'groupingid' => $this->coursework->grouping_id,
diff --git a/db/upgrade.php b/db/upgrade.php
index 28e22a70..1c069ee8 100644
--- a/db/upgrade.php
+++ b/db/upgrade.php
@@ -1186,14 +1186,14 @@ function xmldb_coursework_upgrade($oldversion) {
$courseworks = $DB->get_records('coursework', null, '', 'id');
foreach ($courseworks as $coursework) {
$coursework = \mod_coursework\models\coursework::find($coursework->id);
- $students_with_assessor_allocations = $DB->get_records_sql('
+ $studentswithassessorallocations = $DB->get_records_sql('
SELECT DISTINCT studentid
FROM {coursework_allocation_pairs} ap
WHERE ap.courseworkid = :courseworkid
AND ap.moderator = 0
', ['courseworkid' => $coursework->id]);
- foreach ($students_with_assessor_allocations as $student) {
+ foreach ($studentswithassessorallocations as $student) {
$params = [
'studentid' => $student->studentid,
'courseworkid' => $coursework->id,
@@ -1266,7 +1266,7 @@ function xmldb_coursework_upgrade($oldversion) {
foreach ($courseworks as $coursework) {
$coursework = \mod_coursework\models\coursework::find($coursework->id);
- $submissions_with_feedbacks = $DB->get_records_sql('
+ $submissionswithfeedbacks = $DB->get_records_sql('
SELECT DISTINCT s.id
FROM {coursework_feedbacks} f
INNER JOIN {coursework_submissions} s
@@ -1276,7 +1276,7 @@ function xmldb_coursework_upgrade($oldversion) {
AND f.ismoderation = 0
', ['courseworkid' => $coursework->id]);
- foreach ($submissions_with_feedbacks as $submission) {
+ foreach ($submissionswithfeedbacks as $submission) {
$params = [
'submissionid' => $submission->id,
'isfinalgrade' => 0,
@@ -1451,9 +1451,9 @@ function xmldb_coursework_upgrade($oldversion) {
// Set group submission allocatables
- $courseworks_with_groups = $DB->get_records('coursework', ['use_groups' => 1]);
+ $courseworkswithgroups = $DB->get_records('coursework', ['use_groups' => 1]);
- foreach ($courseworks_with_groups as $coursework) {
+ foreach ($courseworkswithgroups as $coursework) {
$coursework = \mod_coursework\models\coursework::find($coursework);
$params = [
diff --git a/index.php b/index.php
index c9e87cda..818a5180 100644
--- a/index.php
+++ b/index.php
@@ -42,9 +42,9 @@
add_to_log($course->id,
'coursework',
'view',
- "view.php?id=$course_module->id",
+ "view.php?id=$coursemodule->id",
$coursework->name,
- $course_module->id);
+ $coursemodule->id);
}
// Print the header.
@@ -65,6 +65,6 @@
}
echo $OUTPUT->heading(get_string('modulenameplural', 'coursework'), 2);
-$page_renderer = $PAGE->get_renderer('mod_coursework', 'page');
-echo $page_renderer->view_course_index($course->id);
+$pagerenderer = $PAGE->get_renderer('mod_coursework', 'page');
+echo $pagerenderer->view_course_index($course->id);
echo $OUTPUT->footer();
diff --git a/lib.php b/lib.php
index 73a75954..7a2bd109 100644
--- a/lib.php
+++ b/lib.php
@@ -262,7 +262,7 @@ function mod_coursework_core_calendar_provide_event_action(calendar_event $event
global $DB, $USER;
$cm = get_fast_modinfo($event->courseid)->instances['coursework'][$event->instance];
- $submission_url = new \moodle_url('/mod/coursework/view.php', ['id' => $cm->id]);
+ $submissionurl = new \moodle_url('/mod/coursework/view.php', ['id' => $cm->id]);
$name = '';
$itemcount = 0;
@@ -292,22 +292,22 @@ function mod_coursework_core_calendar_provide_event_action(calendar_event $event
}
- $submission_url = new \moodle_url('/mod/coursework/view.php', ['id' => $cm->id]);
+ $submissionurl = new \moodle_url('/mod/coursework/view.php', ['id' => $cm->id]);
} else if ($student) { // for students
// if group cw check if student is in group, if not then don't display 'Add submission' link
if ($coursework->is_configured_to_have_group_submissions() && !$coursework->get_student_group($user)) {
// return null;
- $submission_url = new \moodle_url('/mod/coursework/view.php', ['id' => $cm->id]);
+ $submissionurl = new \moodle_url('/mod/coursework/view.php', ['id' => $cm->id]);
$itemcount = 1;
} else {
$submission = $coursework->get_user_submission($user);
- $new_submission = $coursework->build_own_submission($user);
+ $newsubmission = $coursework->build_own_submission($user);
if (!$submission) {
- $submission = $new_submission;
+ $submission = $newsubmission;
}
// Check if user can still submit
$ability = new ability($user, $coursework);
@@ -317,7 +317,7 @@ function mod_coursework_core_calendar_provide_event_action(calendar_event $event
$allocatableid = $submission->get_allocatable()->id();
$allocatabletype = $submission->get_allocatable()->type();
- $submission_url = new \moodle_url('/mod/coursework/actions/submissions/new.php', ['allocatableid' => $allocatableid,
+ $submissionurl = new \moodle_url('/mod/coursework/actions/submissions/new.php', ['allocatableid' => $allocatableid,
'allocatabletype' => $allocatabletype,
'courseworkid' => $coursework->id]);
@@ -328,7 +328,7 @@ function mod_coursework_core_calendar_provide_event_action(calendar_event $event
}
return $factory->create_instance($name,
- $submission_url,
+ $submissionurl,
$itemcount,
true);
}
@@ -367,7 +367,7 @@ function coursework_grade_item_update($coursework, $grades = null) {
require_once($CFG->dirroot.'/lib/gradelib.php');
- $course_id = $coursework->get_course_id();
+ $courseid = $coursework->get_course_id();
$params = ['itemname' => $coursework->name,
'idnumber' => $coursework->get_coursemodule_idnumber()];
@@ -390,7 +390,7 @@ function coursework_grade_item_update($coursework, $grades = null) {
$grades = null;
}
- return grade_update('mod/coursework', $course_id, 'mod', 'coursework', $coursework->id, 0,
+ return grade_update('mod/coursework', $courseid, 'mod', 'coursework', $coursework->id, 0,
$grades, $params);
}
@@ -780,11 +780,11 @@ function coursework_plagiarism_dates($cmid) {
$cm = get_coursemodule_from_id('coursework', $cmid);
$coursework = coursework::find($cm->instance);
- $dates_array = ['timeavailable' => $coursework->timecreated];
- $dates_array['timedue'] = $coursework->deadline;
- $dates_array['feedback'] = (string)$coursework->get_individual_feedback_deadline();
+ $datesarray = ['timeavailable' => $coursework->timecreated];
+ $datesarray['timedue'] = $coursework->deadline;
+ $datesarray['feedback'] = (string)$coursework->get_individual_feedback_deadline();
- return $dates_array;
+ return $datesarray;
}
/**
@@ -816,8 +816,8 @@ function coursework_extend_settings_navigation(settings_navigation $settings, na
($coursework->allocation_enabled() || $coursework->sampling_enabled())) {
$link = new moodle_url('/mod/coursework/actions/allocate.php', ['id' => $cm->id]);
- $lang_str = ($coursework->moderation_agreement_enabled()) ? 'allocateassessorsandmoderators' : 'allocateassessors';
- $navref->add(get_string($lang_str, 'mod_coursework'), $link, navigation_node::TYPE_SETTING);
+ $langstr = ($coursework->moderation_agreement_enabled()) ? 'allocateassessorsandmoderators' : 'allocateassessors';
+ $navref->add(get_string($langstr, 'mod_coursework'), $link, navigation_node::TYPE_SETTING);
}
// Link to personal deadlines screen
@@ -1169,12 +1169,12 @@ function mod_coursework_supports($feature) {
* @param $event_data
* @return bool
*/
-function coursework_mod_updated($event_data) {
+function coursework_mod_updated($eventdata) {
global $DB;
- if ($event_data->other['modulename'] == 'coursework') {
+ if ($eventdata->other['modulename'] == 'coursework') {
- $coursework = coursework::find($event_data->other['instanceid']);
+ $coursework = coursework::find($eventdata->other['instanceid']);
/**
* @var coursework $coursework
*/
@@ -1195,12 +1195,12 @@ function coursework_mod_updated($event_data) {
* @throws dml_exception
*/
-function course_group_member_added($event_data) {
+function course_group_member_added($eventdata) {
global $DB;
- $groupid = $event_data->objectid;
- $courseid = $event_data->courseid;
- $addeduserid = $event_data->relateduserid;
+ $groupid = $eventdata->objectid;
+ $courseid = $eventdata->courseid;
+ $addeduserid = $eventdata->relateduserid;
// get all courseworks with group_assessor allocation strategy
$courseworks = $DB->get_records('coursework', ['course' => $courseid, 'assessorallocationstrategy' => 'group_assessor']);
@@ -1209,20 +1209,20 @@ 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
+ $stage1 = $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
+ $initialstageassessor = has_capability('mod/coursework:addinitialgrade', $coursework->get_context(), $addeduserid); // check if user is initial stage assessor in this course
- if ($initial_stage_assessor) {
+ if ($initialstageassessor) {
// 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
+ $assessorsingroup = get_enrolled_users($coursework->get_context(), 'mod/coursework:addinitialgrade', $groupid);
+ unset($assessorsingroup[$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 ($assessorsingroup) {//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
- $stage_1->make_auto_allocation_if_necessary(group::find($groupid));
+ $stage1->make_auto_allocation_if_necessary(group::find($groupid));
} else { // no, check if group has any student members
$allocatables = $coursework->get_allocatables();
if ($allocatables) {
@@ -1230,7 +1230,7 @@ function course_group_member_added($event_data) {
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);
+ $stage1->make_auto_allocation_if_necessary($allocatable);
}
}
} else {// no - do nothing, return true
@@ -1245,7 +1245,7 @@ function course_group_member_added($event_data) {
$allocatable = user::find($addeduserid);
}
// process allocatables (group or student) allocation
- $stage_1->make_auto_allocation_if_necessary($allocatable);
+ $stage1->make_auto_allocation_if_necessary($allocatable);
}
}
return true;
@@ -1259,12 +1259,12 @@ function course_group_member_added($event_data) {
* @throws coding_exception
* @throws dml_exception
*/
-function course_group_member_removed($event_data) {
+function course_group_member_removed($eventdata) {
global $DB;
- $groupid = $event_data->objectid;
- $courseid = $event_data->courseid;
- $removeduserid = $event_data->relateduserid;
+ $groupid = $eventdata->objectid;
+ $courseid = $eventdata->courseid;
+ $removeduserid = $eventdata->relateduserid;
// get all courseworks with group_assessor allocation strategy
$courseworks = $DB->get_records('coursework', ['course' => $courseid, 'assessorallocationstrategy' => 'group_assessor']);
@@ -1273,12 +1273,12 @@ function course_group_member_removed($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
+ $stage1 = $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(), $removeduserid); // check if user was initial stage assessor in this course
+ $initialstageassessor = has_capability('mod/coursework:addinitialgrade', $coursework->get_context(), $removeduserid); // check if user was initial stage assessor in this course
- if ($initial_stage_assessor) {
+ if ($initialstageassessor) {
// remove all assessor allocations for this group
if ($coursework->is_configured_to_have_group_submissions()) {
if (can_delete_allocation($coursework->id(), $groupid)) {
@@ -1299,18 +1299,18 @@ function course_group_member_removed($event_data) {
}
// check if there are any other assessor in the group, at this point the removed member should no longer be in the group
- $assessors_in_group = get_enrolled_users($coursework->get_context(), 'mod/coursework:addinitialgrade', $groupid);
+ $assessorsingroup = 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 ($assessorsingroup) { // 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
- $stage_1->make_auto_allocation_if_necessary(group::find($groupid));
+ $stage1->make_auto_allocation_if_necessary(group::find($groupid));
} else {
$allocatables = $coursework->get_allocatables();
if ($allocatables) {
// yes - assign this assessor to every allocatable student in the appropriate course group
foreach ($allocatables as $allocatable) {
// process students allocations
- $stage_1->make_auto_allocation_if_necessary($allocatable);
+ $stage1->make_auto_allocation_if_necessary($allocatable);
}
} else {// no - do nothing, return true
continue;
@@ -1343,7 +1343,7 @@ function course_group_member_removed($event_data) {
if (!$coursework->is_configured_to_have_group_submissions()) {
$allocatable = user::find($allocatableid);
if ($coursework->student_is_in_any_group($allocatable)) {
- $stage_1->make_auto_allocation_if_necessary($allocatable);
+ $stage1->make_auto_allocation_if_necessary($allocatable);
}
}
}
@@ -1363,7 +1363,7 @@ function can_delete_allocation($courseworkid, $allocatableid) {
global $DB;
// check if allocation is pinned or already graded by an assessor / 1st stage only!
- $ungraded_allocations = $DB->get_record_sql("SELECT *
+ $ungradedallocations = $DB->get_record_sql("SELECT *
FROM {coursework_allocation_pairs} p
WHERE courseworkid = :courseworkid
AND p.manual = 0
@@ -1378,18 +1378,18 @@ function can_delete_allocation($courseworkid, $allocatableid) {
AND f.stage_identifier = p.stage_identifier)",
['courseworkid' => $courseworkid, 'allocatableid' => $allocatableid]);
- return $ungraded_allocations;
+ return $ungradedallocations;
}
/**
* @param $course_module_id
* @return string
*/
-function plagiarism_similarity_information($course_module) {
+function plagiarism_similarity_information($coursemodule) {
$html = '';
ob_start();
- echo plagiarism_print_disclosure($course_module->id);
+ echo plagiarism_print_disclosure($coursemodule->id);
$html .= ob_get_clean();
return $html;
@@ -1402,7 +1402,7 @@ function has_user_seen_tii_EULA_agreement() {
global $CFG, $DB, $USER;
// if TII plagiarism enabled check if user agreed/disagreed EULA
- $shouldseeEULA = false;
+ $shouldseeeula = false;
if ($CFG->enableplagiarism) {
$plagiarismsettings = (array)get_config('plagiarism_turnitin');
if (!empty($plagiarismsettings['enabled'])) {
@@ -1417,12 +1417,12 @@ function has_user_seen_tii_EULA_agreement() {
AND user_agreement_accepted <> 0";
}
- $shouldseeEULA = $DB->record_exists_sql($sql, ['userid' => $USER->id]);
+ $shouldseeeula = $DB->record_exists_sql($sql, ['userid' => $USER->id]);
}
} else {
- $shouldseeEULA = true;
+ $shouldseeeula = true;
}
- return $shouldseeEULA;
+ return $shouldseeeula;
}
function coursework_is_ulcc_digest_coursework_plugin_installed() {
@@ -1461,10 +1461,10 @@ function coursework_personal_deadline_passed($courseworkid) {
* @param $event_data
* @return bool
*/
-function teacher_allocation_cache_purge($event_data) {
+function teacher_allocation_cache_purge($eventdata) {
global $DB;
- $roleid = $event_data->objectid;
+ $roleid = $eventdata->objectid;
// get roles with a specific capability
$roles = get_roles_with_capability('mod/coursework:addinitialgrade');
@@ -1483,19 +1483,19 @@ 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($eventdata) {
global $DB;
- $userid = $event_data->relateduserid;
- $courseid = $event_data->courseid;
+ $userid = $eventdata->relateduserid;
+ $courseid = $eventdata->courseid;
$courseworks = coursework_get_courseworks_by_courseid($courseid);
foreach ($courseworks as $cw) {
$coursework = coursework::find($cw->id);
if ($coursework->allocation_enabled()) {
- $assessor_allocations = $DB->get_records('coursework_allocation_pairs', ['courseworkid' => $coursework->id,
+ $assessorallocations = $DB->get_records('coursework_allocation_pairs', ['courseworkid' => $coursework->id,
'assessorid' => $userid]);
- foreach ($assessor_allocations as $allocation) {
+ foreach ($assessorallocations as $allocation) {
if ($allocation->allocatabletype == 'user') {
$allocatable = user::find($allocation->allocatableid);
} else {
diff --git a/mod_form.php b/mod_form.php
index 7fa1bf03..2bccc639 100644
--- a/mod_form.php
+++ b/mod_form.php
@@ -150,8 +150,8 @@ public function definition() {
* @param $default_values
* @return void
*/
- public function set_data($default_values) {
- $default_values = (array)$default_values;
+ public function set_data($defaultvalues) {
+ $defaultvalues = (array)$defaultvalues;
foreach ($this->_form->_elements as $element) {
@@ -169,13 +169,13 @@ public function set_data($default_values) {
if (isset($element->_attributes['name']) && substr($element->_attributes['name'], -6) == 'static') {
// TODO this is using private attributes directly. Need to switch to proper
// Getters and setters.
- if (isset($default_values[substr($element->_attributes['name'], 0, -6)])) {
- $default = $default_values[substr($element->_attributes['name'], 0, -6)];
- $default_values[$element->_attributes['name']] = $default;
+ if (isset($defaultvalues[substr($element->_attributes['name'], 0, -6)])) {
+ $default = $defaultvalues[substr($element->_attributes['name'], 0, -6)];
+ $defaultvalues[$element->_attributes['name']] = $default;
}
}
}
- parent::set_data($default_values);
+ parent::set_data($defaultvalues);
}
/**
@@ -244,8 +244,8 @@ 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);
+ $parenterrors = parent::validation($data, $files);
+ return array_merge($errors, $parenterrors);
}
@@ -276,41 +276,41 @@ function get_data() {
* @throws coding_exception
*/
protected function add_submissions_header() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $moodle_form->addElement('header', 'submissions', get_string('submissions', 'mod_coursework'));
+ $moodleform->addElement('header', 'submissions', get_string('submissions', 'mod_coursework'));
// We want it expanded by default
- $moodle_form->setExpanded('submissions');
+ $moodleform->setExpanded('submissions');
}
/**
* @throws coding_exception
*/
protected function add_availability_header() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $moodle_form->addElement('header', 'availability', get_string('availability', 'mod_coursework'));
+ $moodleform->addElement('header', 'availability', get_string('availability', 'mod_coursework'));
// We want it expanded by default
- $moodle_form->setExpanded('availability');
+ $moodleform->setExpanded('availability');
}
/**
* @throws coding_exception
*/
protected function add_name_field() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $moodle_form->addElement('text',
+ $moodleform->addElement('text',
'name',
get_string('courseworkname', 'coursework'),
['size' => '64']);
- $moodle_form->addRule('name', null, 'required', null, 'client');
- $moodle_form->addRule('name',
+ $moodleform->addRule('name', null, 'required', null, 'client');
+ $moodleform->addRule('name',
get_string('maximumchars', '', 255),
'maxlength',
255,
'client');
- $moodle_form->setType('name', PARAM_TEXT);
+ $moodleform->setType('name', PARAM_TEXT);
}
/**
@@ -319,21 +319,21 @@ protected function add_name_field() {
protected function add_submission_deadline_field() {
global $CFG;
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $default_timestamp = strtotime('+2 weeks');
+ $defaulttimestamp = strtotime('+2 weeks');
$disabled = true;
if (!empty($CFG->coursework_submission_deadline)) {
$disabled = false;
- $default_timestamp = strtotime('today');
+ $defaulttimestamp = strtotime('today');
if ($CFG->coursework_submission_deadline == 7 ) {
- $default_timestamp = strtotime('+1 weeks');
+ $defaulttimestamp = strtotime('+1 weeks');
} else if ($CFG->coursework_submission_deadline == 14 ) {
- $default_timestamp = strtotime('+2 weeks');
+ $defaulttimestamp = strtotime('+2 weeks');
} else if ($CFG->coursework_submission_deadline == 31 ) {
- $default_timestamp = strtotime('+1 month');
+ $defaulttimestamp = strtotime('+1 month');
}
}
@@ -346,19 +346,19 @@ protected function add_submission_deadline_field() {
}
}
- $moodle_form->addElement('date_time_selector',
+ $moodleform->addElement('date_time_selector',
'deadline',
get_string('deadline', 'coursework'),
['optional' => $optional, 'disabled' => $disabled]);
- $moodle_form->addElement('html', ' ');
- $moodle_form->addElement('html', get_string('submissionsdeadlineinfo', 'mod_coursework'));
- $moodle_form->addElement('html', ' ');
+ $moodleform->addElement('html', ' ');
+ $moodleform->addElement('html', get_string('submissionsdeadlineinfo', 'mod_coursework'));
+ $moodleform->addElement('html', ' ');
if (!empty($CFG->coursework_submission_deadline)) {
- $moodle_form->setDefault('deadline', $default_timestamp);
+ $moodleform->setDefault('deadline', $defaulttimestamp);
}
- $moodle_form->addHelpButton('deadline', 'deadline', 'mod_coursework');
+ $moodleform->addHelpButton('deadline', 'deadline', 'mod_coursework');
}
/**
@@ -366,22 +366,22 @@ protected function add_submission_deadline_field() {
*/
protected function add_personal_deadline_field() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$options = [0 => get_string('no'), 1 => get_string('yes')];
$courseworkid = $this->get_coursework_id();
$disabled = [];
if (coursework_personal_deadline_passed($courseworkid)) {
- $moodle_form->disabledIf('personaldeadlineenabled', 'deadline[enabled]', 'notchecked');
+ $moodleform->disabledIf('personaldeadlineenabled', 'deadline[enabled]', 'notchecked');
$disabled = ['disabled' => true];
}
- $moodle_form->addElement('select',
+ $moodleform->addElement('select',
'personaldeadlineenabled',
get_string('usepersonaldeadline', 'mod_coursework'), $options, $disabled);
- $moodle_form->setType('personaldeadlineenabled', PARAM_INT);
- $moodle_form->addHelpButton('personaldeadlineenabled', 'personaldeadlineenabled', 'mod_coursework');
+ $moodleform->setType('personaldeadlineenabled', PARAM_INT);
+ $moodleform->addHelpButton('personaldeadlineenabled', 'personaldeadlineenabled', 'mod_coursework');
- $moodle_form->setDefault('personaldeadlineenabled', 0);
+ $moodleform->setDefault('personaldeadlineenabled', 0);
//$moodle_form->disabledIf('personaldeadlineenabled', 'deadline[enabled]', 'notchecked');
}
@@ -392,39 +392,39 @@ protected function add_personal_deadline_field() {
protected function add_start_date_field() {
global $CFG;
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $default_timestamp = strtotime('+2 weeks');
+ $defaulttimestamp = strtotime('+2 weeks');
$disabled = true;
if (!empty($CFG->coursework_start_date)) {
$disabled = false;
- $default_timestamp = strtotime('today');
+ $defaulttimestamp = strtotime('today');
}
- $moodle_form->addElement('date_time_selector',
+ $moodleform->addElement('date_time_selector',
'startdate',
get_string('startdate', 'coursework'),
['optional' => true, 'disabled' => $disabled]
);
if (!empty($CFG->coursework_start_date)) {
- $moodle_form->setDefault('startdate', $default_timestamp);
+ $moodleform->setDefault('startdate', $defaulttimestamp);
}
- $moodle_form->addHelpButton('startdate', 'startdate', 'mod_coursework');
+ $moodleform->addHelpButton('startdate', 'startdate', 'mod_coursework');
}
private function add_marking_deadline_field() {
global $CFG;
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$options = [0 => get_string('no'), 1 => get_string('yes')];
- $moodle_form->addElement('select',
+ $moodleform->addElement('select',
'markingdeadlineenabled',
get_string('usemarkingdeadline', 'mod_coursework'), $options);
- $moodle_form->setType('markingdeadlineenabled', PARAM_INT);
+ $moodleform->setType('markingdeadlineenabled', PARAM_INT);
$settingdefault = (empty($CFG->coursework_marking_deadline) && empty($CFG->coursework_agreed_marking_deadline)) ? 0 : 1;
- $moodle_form->setDefault('markingdeadlineenabled', $settingdefault);
+ $moodleform->setDefault('markingdeadlineenabled', $settingdefault);
}
/**
@@ -433,20 +433,20 @@ private function add_marking_deadline_field() {
protected function add_initial_marking_deadline_field() {
global $CFG;
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $default_timestamp = strtotime('today');
+ $defaulttimestamp = strtotime('today');
$disabled = true;
- $submission_deadline_timestamp = strtotime('today');
+ $submissiondeadlinetimestamp = strtotime('today');
if (!empty($CFG->coursework_submission_deadline)) {
if ($CFG->coursework_submission_deadline == 7 ) {
- $submission_deadline_timestamp = strtotime('+1 weeks');
+ $submissiondeadlinetimestamp = strtotime('+1 weeks');
} else if ($CFG->coursework_submission_deadline == 14 ) {
- $submission_deadline_timestamp = strtotime('+2 weeks');
+ $submissiondeadlinetimestamp = strtotime('+2 weeks');
} else if ($CFG->coursework_submission_deadline == 31 ) {
- $submission_deadline_timestamp = strtotime('+1 month');
+ $submissiondeadlinetimestamp = strtotime('+1 month');
}
}
@@ -455,31 +455,31 @@ protected function add_initial_marking_deadline_field() {
$disabled = false;
if ($CFG->coursework_marking_deadline == 7 ) {
- $default_timestamp = strtotime('+1 weeks', $submission_deadline_timestamp);
+ $defaulttimestamp = strtotime('+1 weeks', $submissiondeadlinetimestamp);
} else if ($CFG->coursework_marking_deadline == 14 ) {
- $default_timestamp = strtotime('+2 weeks', $submission_deadline_timestamp);
+ $defaulttimestamp = strtotime('+2 weeks', $submissiondeadlinetimestamp);
} else if ($CFG->coursework_marking_deadline == 21 ) {
- $default_timestamp = strtotime('+3 weeks', $submission_deadline_timestamp);
+ $defaulttimestamp = strtotime('+3 weeks', $submissiondeadlinetimestamp);
} else if ($CFG->coursework_marking_deadline == 28 ) {
- $default_timestamp = strtotime('+4 weeks', $submission_deadline_timestamp);
+ $defaulttimestamp = strtotime('+4 weeks', $submissiondeadlinetimestamp);
} else if ($CFG->coursework_marking_deadline == 35 ) {
- $default_timestamp = strtotime('+5 weeks', $submission_deadline_timestamp);
+ $defaulttimestamp = strtotime('+5 weeks', $submissiondeadlinetimestamp);
} else if ($CFG->coursework_marking_deadline == 42 ) {
- $default_timestamp = strtotime('+6 weeks', $submission_deadline_timestamp);
+ $defaulttimestamp = strtotime('+6 weeks', $submissiondeadlinetimestamp);
}
}
- $moodle_form->addElement('date_time_selector',
+ $moodleform->addElement('date_time_selector',
'initialmarkingdeadline',
get_string('initialmarkingdeadline', 'coursework'),
['optional' => true, 'disabled' => $disabled]
);
if (!empty($CFG->coursework_marking_deadline)) {
- $moodle_form->setDefault('initialmarkingdeadline', $default_timestamp);
+ $moodleform->setDefault('initialmarkingdeadline', $defaulttimestamp);
}
- $moodle_form->addHelpButton('initialmarkingdeadline', 'initialmarkingdeadline', 'mod_coursework');
+ $moodleform->addHelpButton('initialmarkingdeadline', 'initialmarkingdeadline', 'mod_coursework');
}
/**
@@ -488,41 +488,41 @@ protected function add_initial_marking_deadline_field() {
protected function add_agreed_grade_marking_deadline_field() {
global $CFG;
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $default_timestamp = strtotime('today');
+ $defaulttimestamp = strtotime('today');
$disabled = true;
- $submission_deadline_timestamp = strtotime('today');
+ $submissiondeadlinetimestamp = strtotime('today');
if (!empty($CFG->coursework_submission_deadline)) {
if ($CFG->coursework_submission_deadline == 7 ) {
- $submission_deadline_timestamp = strtotime('+1 weeks');
+ $submissiondeadlinetimestamp = strtotime('+1 weeks');
} else if ($CFG->coursework_submission_deadline == 14 ) {
- $submission_deadline_timestamp = strtotime('+2 weeks');
+ $submissiondeadlinetimestamp = strtotime('+2 weeks');
} else if ($CFG->coursework_submission_deadline == 31 ) {
- $submission_deadline_timestamp = strtotime('+1 month');
+ $submissiondeadlinetimestamp = strtotime('+1 month');
}
}
if (!empty($CFG->coursework_agreed_marking_deadline)) {
$disabled = false;
if ($CFG->coursework_agreed_marking_deadline == 7 ) {
- $default_timestamp = strtotime('+1 weeks', $submission_deadline_timestamp);
+ $defaulttimestamp = strtotime('+1 weeks', $submissiondeadlinetimestamp);
} else if ($CFG->coursework_agreed_marking_deadline == 14 ) {
- $default_timestamp = strtotime('+2 weeks', $submission_deadline_timestamp);
+ $defaulttimestamp = strtotime('+2 weeks', $submissiondeadlinetimestamp);
} else if ($CFG->coursework_agreed_marking_deadline == 21 ) {
- $default_timestamp = strtotime('+3 weeks', $submission_deadline_timestamp);
+ $defaulttimestamp = strtotime('+3 weeks', $submissiondeadlinetimestamp);
} else if ($CFG->coursework_agreed_marking_deadline == 28 ) {
- $default_timestamp = strtotime('+4 weeks', $submission_deadline_timestamp);
+ $defaulttimestamp = strtotime('+4 weeks', $submissiondeadlinetimestamp);
} else if ($CFG->coursework_agreed_marking_deadline == 35 ) {
- $default_timestamp = strtotime('+5 weeks', $submission_deadline_timestamp);
+ $defaulttimestamp = strtotime('+5 weeks', $submissiondeadlinetimestamp);
} else if ($CFG->coursework_agreed_marking_deadline == 42 ) {
- $default_timestamp = strtotime('+6 weeks', $submission_deadline_timestamp);
+ $defaulttimestamp = strtotime('+6 weeks', $submissiondeadlinetimestamp);
}
}
- $moodle_form->addElement('date_time_selector',
+ $moodleform->addElement('date_time_selector',
'agreedgrademarkingdeadline',
get_string('agreedgrademarkingdeadline', 'coursework'),
['optional' => true, 'disabled' => $disabled]
@@ -531,9 +531,9 @@ protected function add_agreed_grade_marking_deadline_field() {
// $moodle_form->disabledIf('agreedgrademarkingdeadline', 'numberofmarkers', 'eq', '1');
if (!empty($CFG->coursework_agreed_marking_deadline)) {
- $moodle_form->setDefault('agreedgrademarkingdeadline', $default_timestamp);
+ $moodleform->setDefault('agreedgrademarkingdeadline', $defaulttimestamp);
}
- $moodle_form->addHelpButton('agreedgrademarkingdeadline', 'agreedgrademarkingdeadline', 'mod_coursework');
+ $moodleform->addHelpButton('agreedgrademarkingdeadline', 'agreedgrademarkingdeadline', 'mod_coursework');
}
/********
@@ -542,7 +542,7 @@ protected function add_agreed_grade_marking_deadline_field() {
protected function add_relative_initial_marking_deadline_field() {
global $CFG;
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$options = ['0' => get_string('disabled', 'mod_coursework')];
$options['7'] = get_string('oneweekoption', 'mod_coursework');
@@ -552,14 +552,14 @@ protected function add_relative_initial_marking_deadline_field() {
$options['35'] = get_string('fiveweeksoption', 'mod_coursework');
$options['42'] = get_string('sixweeksoption', 'mod_coursework');
- $moodle_form->addElement('select',
+ $moodleform->addElement('select',
'relativeinitialmarkingdeadline',
get_string('relativeinitialmarkingdeadline', 'mod_coursework'), $options);
if (!empty($CFG->coursework_marking_deadline)) {
- $moodle_form->setDefault('relativeinitialmarkingdeadline', $CFG->coursework_marking_deadline);
+ $moodleform->setDefault('relativeinitialmarkingdeadline', $CFG->coursework_marking_deadline);
}
- $moodle_form->addHelpButton('relativeinitialmarkingdeadline', 'agreedgrademarkingdeadline', 'mod_coursework');
+ $moodleform->addHelpButton('relativeinitialmarkingdeadline', 'agreedgrademarkingdeadline', 'mod_coursework');
}
@@ -569,7 +569,7 @@ protected function add_relative_initial_marking_deadline_field() {
protected function add_relative_agreed_grade_marking_deadline_field() {
global $CFG;
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$options = ['0' => get_string('disabled', 'mod_coursework')];
$options['7'] = get_string('oneweekoption', 'mod_coursework');
@@ -579,14 +579,14 @@ protected function add_relative_agreed_grade_marking_deadline_field() {
$options['35'] = get_string('fiveweeksoption', 'mod_coursework');
$options['42'] = get_string('sixweeksoption', 'mod_coursework');
- $moodle_form->addElement('select',
+ $moodleform->addElement('select',
'relativeagreedmarkingdeadline',
get_string('relativeagreedmarkingdeadline', 'mod_coursework'), $options);
if (!empty($CFG->coursework_agreed_marking_deadline)) {
- $moodle_form->setDefault('relativeagreedmarkingdeadline', $CFG->coursework_agreed_marking_deadline);
+ $moodleform->setDefault('relativeagreedmarkingdeadline', $CFG->coursework_agreed_marking_deadline);
}
- $moodle_form->addHelpButton('relativeagreedmarkingdeadline', 'agreedgrademarkingdeadline', 'mod_coursework');
+ $moodleform->addHelpButton('relativeagreedmarkingdeadline', 'agreedgrademarkingdeadline', 'mod_coursework');
}
@@ -594,24 +594,24 @@ protected function add_relative_agreed_grade_marking_deadline_field() {
* @throws coding_exception
*/
protected function add_digest_header() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $moodle_form->addElement('header', 'digest', get_string('digest', 'mod_coursework'));
+ $moodleform->addElement('header', 'digest', get_string('digest', 'mod_coursework'));
// We want it expanded by default
- $moodle_form->setExpanded('digest');
+ $moodleform->setExpanded('digest');
}
private function add_marking_reminder_field() {
global $CFG;
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$options = [0 => get_string('no'), 1 => get_string('yes')];
- $moodle_form->addElement('select',
+ $moodleform->addElement('select',
'markingreminderenabled',
get_string('sendmarkingreminder', 'mod_coursework'), $options);
- $moodle_form->setType('markingreminderenabled', PARAM_INT);
+ $moodleform->setType('markingreminderenabled', PARAM_INT);
$settingdefault = (empty($CFG->coursework_marking_deadline)) ? 0 : 1;
- $moodle_form->setDefault('markingreminderenabled', $settingdefault);
+ $moodleform->setDefault('markingreminderenabled', $settingdefault);
}
@@ -626,13 +626,13 @@ protected function add_marking_reminder_warning() {
* @throws coding_exception
*/
protected function add_allow_early_finalisation_field() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$options = [ 0 => get_string('no'), 1 => get_string('yes')];
- $moodle_form->addElement('select',
+ $moodleform->addElement('select',
'allowearlyfinalisation',
get_string('allowearlyfinalisation', 'mod_coursework'), $options);
- $moodle_form->setType('allowearlyfinalisation', PARAM_INT);
- $moodle_form->disabledIf('allowearlyfinalisation', 'deadline[enabled]', 'notchecked');
+ $moodleform->setType('allowearlyfinalisation', PARAM_INT);
+ $moodleform->disabledIf('allowearlyfinalisation', 'deadline[enabled]', 'notchecked');
}
/**
@@ -640,11 +640,11 @@ protected function add_allow_early_finalisation_field() {
*/
protected function add_group_submission_header() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $moodle_form->addElement('header', 'group_submission', get_string('groupsubmissionsettings', 'mod_coursework'));
+ $moodleform->addElement('header', 'group_submission', get_string('groupsubmissionsettings', 'mod_coursework'));
// We want it expanded by default
- $moodle_form->setExpanded('group_submission');
+ $moodleform->setExpanded('group_submission');
}
@@ -652,11 +652,11 @@ protected function add_group_submission_header() {
* @throws coding_exception
*/
protected function add_use_groups_field() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$options = [ 0 => get_string('no'), 1 => get_string('yes')];
- $moodle_form->addElement('select', 'use_groups', get_string('use_groups', 'mod_coursework'), $options);
- $moodle_form->addHelpButton('use_groups', 'use_groups', 'mod_coursework');
+ $moodleform->addElement('select', 'use_groups', get_string('use_groups', 'mod_coursework'), $options);
+ $moodleform->addHelpButton('use_groups', 'use_groups', 'mod_coursework');
}
/**
@@ -665,50 +665,50 @@ protected function add_use_groups_field() {
protected function add_grouping_field() {
global $COURSE, $DB;
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $groups_options_result = $DB->get_records('groupings', ['courseid' => $COURSE->id], 'name', 'id, name');
- $groups_options = [];
- if ($groups_options_result !== false) {
- foreach ($groups_options_result as $result) {
- $groups_options[$result->id] = $result->name;
+ $groupsoptionsresult = $DB->get_records('groupings', ['courseid' => $COURSE->id], 'name', 'id, name');
+ $groupsoptions = [];
+ if ($groupsoptionsresult !== false) {
+ foreach ($groupsoptionsresult as $result) {
+ $groupsoptions[$result->id] = $result->name;
}
}
// Not calling it groupingid as this conflicts with the groupingid field in the common module
// settings.
- $default_groups_options = [0 => 'Use all groups'];
- $groups_options = $default_groups_options + $groups_options;
- $moodle_form->addElement('select',
+ $defaultgroupsoptions = [0 => 'Use all groups'];
+ $groupsoptions = $defaultgroupsoptions + $groupsoptions;
+ $moodleform->addElement('select',
'grouping_id',
get_string('grouping_id', 'mod_coursework'),
- $groups_options);
- $moodle_form->addHelpButton('grouping_id', 'grouping_id', 'mod_coursework');
- $moodle_form->disabledIf('grouping_id', 'use_groups', 'eq', 0);
+ $groupsoptions);
+ $moodleform->addHelpButton('grouping_id', 'grouping_id', 'mod_coursework');
+ $moodleform->disabledIf('grouping_id', 'use_groups', 'eq', 0);
}
/**
* @throws coding_exception
*/
protected function add_general_header() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $moodle_form->addElement('header', 'generalstuff', get_string('general', 'form'));
+ $moodleform->addElement('header', 'generalstuff', get_string('general', 'form'));
}
/**
* @throws coding_exception
*/
protected function add_file_types_field() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $moodle_form->addElement('text',
+ $moodleform->addElement('text',
'filetypes',
get_string('filetypes', 'coursework'),
['placeholder' => 'e.g. doc, docx, txt, rtf']);
- $moodle_form->addHelpButton('filetypes', 'filetypes', 'mod_coursework');
- $moodle_form->setType('filetypes', PARAM_TEXT);
- $moodle_form->disabledIf('filetypes', 'use_turnitin', 'eq', '1');
+ $moodleform->addHelpButton('filetypes', 'filetypes', 'mod_coursework');
+ $moodleform->setType('filetypes', PARAM_TEXT);
+ $moodleform->disabledIf('filetypes', 'use_turnitin', 'eq', '1');
}
/**
@@ -717,24 +717,24 @@ protected function add_file_types_field() {
protected function add_max_file_size_field() {
global $CFG, $COURSE;
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$choices = get_max_upload_sizes($CFG->maxbytes, $COURSE->maxbytes);
//$choices[0] = get_string('maximumupload') . ' (' . display_size($COURSE->maxbytes) . ')';
$choices[0] = get_string('maximumupload'). ' set in course';
- $moodle_form->addElement('select',
+ $moodleform->addElement('select',
'maxbytes',
get_string('maximumsize', 'coursework'),
$choices);
- $moodle_form->setDefault('maxbytes', $CFG->coursework_maxbytes);
+ $moodleform->setDefault('maxbytes', $CFG->coursework_maxbytes);
/* $moodle_form->addElement('static',
'maxbyteslabel',
'',
get_string('maximumsizelabel', 'coursework'));*/
- $moodle_form->addHelpButton('maxbytes', 'maximumsize', 'mod_coursework');
- $moodle_form->disabledIf('maxbytes', 'use_turnitin', 'eq', '1');
+ $moodleform->addHelpButton('maxbytes', 'maximumsize', 'mod_coursework');
+ $moodleform->disabledIf('maxbytes', 'use_turnitin', 'eq', '1');
- $moodle_form->closeHeaderBefore('submissiontype');
+ $moodleform->closeHeaderBefore('submissiontype');
}
@@ -743,7 +743,7 @@ protected function add_max_file_size_field() {
*/
protected function add_number_of_files_field() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
// Maximum number of files:
$choices = [1 => 1,
@@ -756,13 +756,13 @@ protected function add_number_of_files_field() {
8 => 8,
9 => 9,
10 => 10];
- $moodle_form->addElement('select',
+ $moodleform->addElement('select',
'maxfiles',
get_string('maxfiles', 'coursework'),
$choices);
- $moodle_form->setDefault('maxfiles', 1);
- $moodle_form->setType('maxfiles', PARAM_INT);
- $moodle_form->addHelpButton('maxfiles', 'maxfiles', 'mod_coursework');
+ $moodleform->setDefault('maxfiles', 1);
+ $moodleform->setType('maxfiles', PARAM_INT);
+ $moodleform->addHelpButton('maxfiles', 'maxfiles', 'mod_coursework');
}
@@ -770,7 +770,7 @@ protected function add_rename_file_field() {
global $DB, $PAGE;
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$choices = ['0' => get_string('no'), '1' => get_string('yes')];
$courseworkid = $this->get_coursework_id();
@@ -779,12 +779,12 @@ protected function add_rename_file_field() {
if (empty($courseworkid) || empty($courseworkhassubmissions)) {
- $moodle_form->addElement('select', 'renamefiles',
+ $moodleform->addElement('select', 'renamefiles',
get_string('renamefiles', 'mod_coursework'), $choices);
- $moodle_form->addHelpButton('renamefiles', 'renamefiles', 'mod_coursework');
+ $moodleform->addHelpButton('renamefiles', 'renamefiles', 'mod_coursework');
- $moodle_form->disabledIf('renamefiles', 'blindmarking', 'eq', '1');
+ $moodleform->disabledIf('renamefiles', 'blindmarking', 'eq', '1');
$PAGE->requires->js_amd_inline("
require(['jquery'], function() {
@@ -808,7 +808,7 @@ protected function add_rename_file_field() {
$settingvalue = ($DB->get_records_sql($sql, ['courseworkid' => $courseworkid])) ? get_string('yesrenamefile', 'mod_coursework') : get_string('norenamefile', 'mod_coursework');
- $moodle_form->addElement('static', 'renamefilesdescription', get_string('renamefiles', 'mod_coursework'),
+ $moodleform->addElement('static', 'renamefilesdescription', get_string('renamefiles', 'mod_coursework'),
$settingvalue);
}
@@ -818,9 +818,9 @@ protected function add_rename_file_field() {
* @throws coding_exception
*/
protected function add_marking_workflow_header() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $moodle_form->addElement('header', 'markingworkflow', get_string('markingworkflow', 'mod_coursework'));
+ $moodleform->addElement('header', 'markingworkflow', get_string('markingworkflow', 'mod_coursework'));
}
/**
@@ -829,10 +829,10 @@ protected function add_marking_workflow_header() {
*/
protected function add_number_of_initial_assessors_field() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$courseworkid = $this->get_coursework_id();
- $multi_options = [
+ $multioptions = [
// Don't want to give the option for 0!
1 => 1,
2 => 2,
@@ -841,18 +841,18 @@ protected function add_number_of_initial_assessors_field() {
// Remove all options lower than the current maximum number of feedbacks that any student has.
$currentmaxfeedbacks = coursework_get_current_max_feedbacks($courseworkid);
if ($currentmaxfeedbacks) {
- foreach ($multi_options as $key => $option) {
+ foreach ($multioptions as $key => $option) {
if ($key < $currentmaxfeedbacks) {
- unset($multi_options[$key]);
+ unset($multioptions[$key]);
}
}
}
- $moodle_form->addElement('select',
+ $moodleform->addElement('select',
'numberofmarkers',
get_string('numberofmarkers', 'mod_coursework'),
- $multi_options);
- $moodle_form->addHelpButton('numberofmarkers', 'numberofmarkers', 'mod_coursework');
- $moodle_form->setDefault('numberofmarkers', 1);
+ $multioptions);
+ $moodleform->addHelpButton('numberofmarkers', 'numberofmarkers', 'mod_coursework');
+ $moodleform->setDefault('numberofmarkers', 1);
}
/**
@@ -860,13 +860,13 @@ protected function add_number_of_initial_assessors_field() {
* @throws coding_exception
*/
protected function add_enable_moderation_agreement_field() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$options = [0 => get_string('no'), 1 => get_string('yes')];
- $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);
+ $moodleform->addElement('select', 'moderationagreementenabled', get_string('moderationagreementenabled', 'mod_coursework'), $options);
+ $moodleform->addHelpButton('moderationagreementenabled', 'moderationagreementenabled', 'mod_coursework');
+ $moodleform->setDefault('moderationagreementenabled', 0);
+ $moodleform->disabledIf('moderationagreementenabled', 'numberofmarkers', 'neq', 1);
}
/**
@@ -888,18 +888,18 @@ protected function get_coursework_id() {
* @throws coding_exception
*/
protected function add_enable_allocation_field() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$options = [ 0 => get_string('no'), 1 => get_string('yes')];
- $moodle_form->addElement('select', 'allocationenabled', get_string('allocationenabled', 'mod_coursework'), $options);
- $moodle_form->addHelpButton('allocationenabled', 'allocationenabled', 'mod_coursework');
+ $moodleform->addElement('select', 'allocationenabled', get_string('allocationenabled', 'mod_coursework'), $options);
+ $moodleform->addHelpButton('allocationenabled', 'allocationenabled', 'mod_coursework');
}
/**
* @throws coding_exception
*/
protected function add_assessor_allocation_strategy_field_rdb() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$options = mod_coursework\allocation\manager::get_allocation_classnames();
@@ -907,21 +907,21 @@ 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[] =& $moodleform->createElement('radio', 'assessorallocationstrategy', '', $options[$key], $key, '');
}
- $moodle_form->addGroup($radioarray, 'radioarray', get_string('assessorallocationstrategy', 'mod_coursework'), [' '], false);
- $moodle_form->addHelpButton('radioarray', 'assessorallocationstrategy', 'mod_coursework');
- $moodle_form->disabledIf('radioarray', 'allocationenabled', 'eq', 0);
+ $moodleform->addGroup($radioarray, 'radioarray', get_string('assessorallocationstrategy', 'mod_coursework'), [' '], false);
+ $moodleform->addHelpButton('radioarray', 'assessorallocationstrategy', 'mod_coursework');
+ $moodleform->disabledIf('radioarray', 'allocationenabled', 'eq', 0);
}
protected function add_assessor_allocation_strategy_field() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$options = mod_coursework\allocation\manager::get_allocation_classnames();
- $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);
+ $moodleform->addElement('select', 'assessorallocationstrategy', get_string('assessorallocationstrategy', 'mod_coursework'), $options);
+ $moodleform->addHelpButton('assessorallocationstrategy', 'assessorallocationstrategy', 'mod_coursework');
+ $moodleform->disabledIf('assessorallocationstrategy', 'allocationenabled', 'eq', 0);
}
/**
@@ -929,13 +929,13 @@ protected function add_assessor_allocation_strategy_field() {
*/
protected function add_blind_marking_header() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $moodle_form->addElement('header', 'anonymity', get_string('blindmarking', 'mod_coursework'));
- $moodle_form->addElement('html', ' ');
- $moodle_form->addElement('html',
+ $moodleform->addElement('header', 'anonymity', get_string('blindmarking', 'mod_coursework'));
+ $moodleform->addElement('html', ' ');
+ $moodleform->addElement('html',
get_string('anonymitydescription', 'mod_coursework'));
- $moodle_form->addElement('html', ' ');
+ $moodleform->addElement('html', ' ');
}
@@ -943,13 +943,13 @@ protected function add_blind_marking_header() {
* @throws coding_exception
*/
protected function add_assessor_anonymity_header() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $moodle_form->addElement('header', 'assessoranonymityheader', get_string('assessoranonymity', 'mod_coursework'));
- $moodle_form->addElement('html', ' ');
- $moodle_form->addElement('html',
+ $moodleform->addElement('header', 'assessoranonymityheader', get_string('assessoranonymity', 'mod_coursework'));
+ $moodleform->addElement('html', ' ');
+ $moodleform->addElement('html',
get_string('assessoranonymity_desc', 'mod_coursework'));
- $moodle_form->addElement('html', ' ');
+ $moodleform->addElement('html', ' ');
}
/**
@@ -958,30 +958,30 @@ protected function add_assessor_anonymity_header() {
protected function add_enable_blind_marking_field() {
global $CFG;
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$options = [ 0 => get_string('no'), 1 => get_string('yes')];
- $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);
+ $moodleform->addElement('select', 'blindmarking', get_string('blindmarking', 'mod_coursework'), $options);
+ $moodleform->addHelpButton('blindmarking', 'blindmarking', 'mod_coursework');
+ $moodleform->setDefault('blindmarking', $CFG->coursework_blindmarking);
- $submission_exists = 0;
+ $submissionexists = 0;
// disable the setting if at least one submission exists
$courseworkid = $this->get_coursework_id();
if ($courseworkid && mod_coursework\models\coursework::find($courseworkid)->has_any_submission()) {
- $submission_exists = 1;
+ $submissionexists = 1;
}
- $moodle_form->addElement('hidden', 'submission_exists', $submission_exists);
- $moodle_form->setType('submission_exists', PARAM_INT);
- $moodle_form->disabledIf('blindmarking', 'submission_exists', 'eq', 1);
+ $moodleform->addElement('hidden', 'submission_exists', $submissionexists);
+ $moodleform->setType('submission_exists', PARAM_INT);
+ $moodleform->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->setType('forceblindmarking', PARAM_INT);
- $moodle_form->disabledIf('blindmarking', 'forceblindmarking', 'eq', 1);
- $moodle_form->addElement('static', 'forceblindmarking_explanation', '', get_string('forcedglobalsetting', 'mod_coursework'));
+ $moodleform->addElement('hidden', 'forceblindmarking', $this->forceblindmarking());
+ $moodleform->setType('forceblindmarking', PARAM_INT);
+ $moodleform->disabledIf('blindmarking', 'forceblindmarking', 'eq', 1);
+ $moodleform->addElement('static', 'forceblindmarking_explanation', '', get_string('forcedglobalsetting', 'mod_coursework'));
}
}
@@ -991,11 +991,11 @@ protected function add_enable_blind_marking_field() {
protected function add_enable_assessor_anonymity_field() {
global $CFG;
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$options = [0 => get_string('no'), 1 => get_string('yes')];
- $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);
+ $moodleform->addElement('select', 'assessoranonymity', get_string('assessoranonymity', 'mod_coursework'), $options);
+ $moodleform->addHelpButton('assessoranonymity', 'assessoranonymity', 'mod_coursework');
+ $moodleform->setDefault('assessoranonymity', $CFG->coursework_assessoranonymity);
}
@@ -1003,9 +1003,9 @@ protected function add_enable_assessor_anonymity_field() {
* @throws coding_exception
*/
protected function add_feedback_header() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $moodle_form->addElement('header', 'feedbacktypes', get_string('feedbacktypes', 'mod_coursework'));
+ $moodleform->addElement('header', 'feedbacktypes', get_string('feedbacktypes', 'mod_coursework'));
}
/**
@@ -1015,7 +1015,7 @@ protected function add_individual_feedback_release_date_field() {
global $CFG;
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$timestamp = strtotime('+' . $CFG->coursework_individualfeedback . ' weeks');
@@ -1038,19 +1038,19 @@ protected function add_individual_feedback_release_date_field() {
$options['optional'] = false;
}
- $moodle_form->addElement('date_time_selector',
+ $moodleform->addElement('date_time_selector',
'individualfeedback',
get_string('individualfeedback', 'coursework'),
$options);
- $moodle_form->setDefault('individualfeedback', $default);
- $moodle_form->addHelpButton('individualfeedback', 'individualfeedback', 'mod_coursework');
+ $moodleform->setDefault('individualfeedback', $default);
+ $moodleform->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->setType('forceautorelease', PARAM_INT);
- $moodle_form->disabledIf('individualfeedback', 'forceautorelease', 'eq', 1);
+ $moodleform->addElement('hidden', 'forceautorelease', $this->forceautorelease());
+ $moodleform->setType('forceautorelease', PARAM_INT);
+ $moodleform->disabledIf('individualfeedback', 'forceautorelease', 'eq', 1);
}
- $moodle_form->disabledIf('individualfeedback', 'deadline[enabled]', 'notchecked');
+ $moodleform->disabledIf('individualfeedback', 'deadline[enabled]', 'notchecked');
// $moodle_form->addRule(array('individualfeedback', 'deadline'), get_string('must_be_after_dealdine', 'mod_coursework'), 'compare', 'gt');
}
@@ -1060,11 +1060,11 @@ protected function add_individual_feedback_release_date_field() {
protected function add_email_individual_feedback_notification_field() {
global $CFG;
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$options = [0 => get_string('no'), 1 => get_string('yes')];
- $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);
+ $moodleform->addElement('select', 'feedbackreleaseemail', get_string('feedbackreleaseemail', 'mod_coursework'), $options);
+ $moodleform->addHelpButton('feedbackreleaseemail', 'feedbackreleaseemail', 'mod_coursework');
+ $moodleform->setDefault('feedbackreleaseemail', $CFG->coursework_feedbackreleaseemail);
}
/**
@@ -1073,9 +1073,9 @@ protected function add_email_individual_feedback_notification_field() {
protected function add_general_feedback_release_date_field() {
global $CFG;
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $moodle_form->addElement('date_time_selector',
+ $moodleform->addElement('date_time_selector',
'generalfeedback',
get_string('generalfeedbackreleasedate', 'coursework'),
['optional' => true, 'disabled' => true]);
@@ -1090,27 +1090,27 @@ protected function add_general_feedback_release_date_field() {
'hour' => date('G', $timestamp),
'minute' => date('i', $timestamp),
];
- $moodle_form->setDefault('generalfeedback', $default);
- $moodle_form->addHelpButton('generalfeedback', 'generalfeedback', 'mod_coursework');
- $moodle_form->disabledIf('generalfeedback', 'deadline[enabled]', 'notchecked');
+ $moodleform->setDefault('generalfeedback', $default);
+ $moodleform->addHelpButton('generalfeedback', 'generalfeedback', 'mod_coursework');
+ $moodleform->disabledIf('generalfeedback', 'deadline[enabled]', 'notchecked');
}
/**
*/
protected function add_tweaks_to_standard_grading_form_elements() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $moodle_form->addHelpButton('grade', 'grade', 'mod_coursework');
- $moodle_form->setExpanded('modstandardgrade');
+ $moodleform->addHelpButton('grade', 'grade', 'mod_coursework');
+ $moodleform->setExpanded('modstandardgrade');
$options = [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');
- $moodle_form->setDefault('finalstagegrading', 0);
- $moodle_form->disabledIf('finalstagegrading', 'numberofmarkers', 'eq', 1);
- $moodle_form->disabledIf('finalstagegrading', 'advancedgradingmethod_submissions', 'eq', "");
+ $moodleform->addElement('select', 'finalstagegrading', get_string('finalstagegrading', 'mod_coursework'), $options);
+ $moodleform->addHelpButton('finalstagegrading', 'finalstagegrading', 'mod_coursework');
+ $moodleform->setDefault('finalstagegrading', 0);
+ $moodleform->disabledIf('finalstagegrading', 'numberofmarkers', 'eq', 1);
+ $moodleform->disabledIf('finalstagegrading', 'advancedgradingmethod_submissions', 'eq', "");
$feedbackexists = 0;
// disable the setting if at least one feedback exists
@@ -1119,9 +1119,9 @@ protected function add_tweaks_to_standard_grading_form_elements() {
$feedbackexists = 1;
}
- $moodle_form->addElement('hidden', 'feedbackexists', $feedbackexists);
- $moodle_form->setType('feedbackexists', PARAM_INT);
- $moodle_form->disabledIf('finalstagegrading', 'feedbackexists', 'eq', 1);
+ $moodleform->addElement('hidden', 'feedbackexists', $feedbackexists);
+ $moodleform->setType('feedbackexists', PARAM_INT);
+ $moodleform->disabledIf('finalstagegrading', 'feedbackexists', 'eq', 1);
// Don't think this belongs here...
// $options = array(0 => get_string('no'), 1 => get_string('yes'));
@@ -1140,9 +1140,9 @@ protected function add_tweaks_to_standard_grading_form_elements() {
/**
*/
protected function set_form_attributes() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $moodle_form->_attributes['name'] = 'ocm_update_form';
+ $moodleform->_attributes['name'] = 'ocm_update_form';
}
protected function add_turnitin_files_settings_waring() {
@@ -1154,42 +1154,42 @@ protected function add_turnitin_files_settings_waring() {
private function add_allow_late_submissions_field() {
global $CFG;
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$options = [ 0 => get_string('no'), 1 => get_string('yes')];
- $moodle_form->addElement('select',
+ $moodleform->addElement('select',
'allowlatesubmissions',
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');
+ $moodleform->setType('allowlatesubmissions', PARAM_INT);
+ $moodleform->setDefault('allowlatesubmissions', $CFG->coursework_allowlatesubmissions);
+ $moodleform->disabledIf('allowlatesubmissions', 'deadline[enabled]', 'notchecked');
}
protected function add_all_feedbacks_field() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$options = [ 0 => get_string('no'), 1 => get_string('yes')];
- $moodle_form->addElement('select',
+ $moodleform->addElement('select',
'showallfeedbacks',
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');
+ $moodleform->setDefault('showallfeedbacks', 0);
+ $moodleform->disabledIf('showallfeedbacks', 'numberofmarkers', 'eq', 1);
+ $moodleform->addHelpButton('showallfeedbacks', 'showallfeedbacks', 'mod_coursework');
}
/**
* @throws coding_exception
*/
private function add_enable_sampling_checkbox() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $moodle_form->addElement('selectyesno', 'samplingenabled', get_string('samplingenabled', 'mod_coursework'));
- $moodle_form->addHelpButton('samplingenabled', 'samplingenabled', 'mod_coursework');
+ $moodleform->addElement('selectyesno', 'samplingenabled', get_string('samplingenabled', 'mod_coursework'));
+ $moodleform->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);
+ $moodleform->disabledIf('samplingenabled', 'numberofmarkers', 'eq', 1);
}
}
@@ -1199,19 +1199,19 @@ private function add_enable_sampling_checkbox() {
*/
private function add_view_initial_assessors_grade() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $moodle_form->addElement('selectyesno', 'viewinitialgradeenabled', get_string('viewinitialgradeenabled', 'mod_coursework'));
- $moodle_form->addHelpButton('viewinitialgradeenabled', 'viewinitialgradeenabled', 'mod_coursework');
+ $moodleform->addElement('selectyesno', 'viewinitialgradeenabled', get_string('viewinitialgradeenabled', 'mod_coursework'));
+ $moodleform->addHelpButton('viewinitialgradeenabled', 'viewinitialgradeenabled', 'mod_coursework');
- $moodle_form->disabledIf('viewinitialgradeenabled', 'numberofmarkers', 'eq', 1);
+ $moodleform->disabledIf('viewinitialgradeenabled', 'numberofmarkers', 'eq', 1);
}
private function add_enable_agreed_grade_delay() {
global $CFG;
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$options = ['0' => get_string('disabled', 'mod_coursework')];
$options['1800'] = get_string('timedminutes', 'mod_coursework', '30');
@@ -1221,11 +1221,11 @@ private function add_enable_agreed_grade_delay() {
$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);
- $moodle_form->addHelpButton('gradeeditingtime', 'gradeeditingtime', 'mod_coursework');
- $moodle_form->setDefault('gradeeditingtime', $CFG->coursework_grade_editing);
+ $moodleform->addElement('select', 'gradeeditingtime', get_string('gradeeditingtime', 'mod_coursework'), $options);
+ $moodleform->addHelpButton('gradeeditingtime', 'gradeeditingtime', 'mod_coursework');
+ $moodleform->setDefault('gradeeditingtime', $CFG->coursework_grade_editing);
- $moodle_form->disabledIf('gradeeditingtime', 'numberofmarkers', 'eq', 1);
+ $moodleform->disabledIf('gradeeditingtime', 'numberofmarkers', 'eq', 1);
}
@@ -1234,13 +1234,13 @@ private function add_enable_agreed_grade_delay() {
*/
private function add_save_feedback_as_draft() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$options = [0 => get_string('no'), 1 => get_string('yes')];
- $moodle_form->addElement('select', 'draftfeedbackenabled', get_string('savefeedbackasdraft', 'mod_coursework'), $options);
- $moodle_form->addHelpButton('draftfeedbackenabled', 'savefeedbackasdraft', 'mod_coursework');
- $moodle_form->setDefault('draftfeedbackenabled', 1);
+ $moodleform->addElement('select', 'draftfeedbackenabled', get_string('savefeedbackasdraft', 'mod_coursework'), $options);
+ $moodleform->addHelpButton('draftfeedbackenabled', 'savefeedbackasdraft', 'mod_coursework');
+ $moodleform->setDefault('draftfeedbackenabled', 1);
}
@@ -1248,10 +1248,10 @@ 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);
+ $moodleform =& $this->_form;
+ $moodleform->addElement('selectyesno', 'autopopulatefeedbackcomment', get_string('autopopulatefeedbackcomment', 'mod_coursework'));
+ $moodleform->addHelpButton('autopopulatefeedbackcomment', 'autopopulatefeedbackcomment', 'mod_coursework');
+ $moodleform->disabledIf('autopopulatefeedbackcomment', 'numberofmarkers', 'eq', 1);
}
private function forceblindmarking() {
@@ -1267,26 +1267,26 @@ private function forceautorelease() {
}
private function add_extensions_header() {
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
- $moodle_form->addElement('header', 'extensions', get_string('extensions', 'mod_coursework'));
+ $moodleform->addElement('header', 'extensions', get_string('extensions', 'mod_coursework'));
}
private function add_enable_extensions_field() {
global $CFG;
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$options = [ 0 => get_string('no'), 1 => get_string('yes')];
- $moodle_form->addElement('select', 'extensionsenabled', get_string('individual_extension', 'mod_coursework'), $options);
- $moodle_form->addHelpButton('extensionsenabled', 'individual_extension', 'mod_coursework');
- $moodle_form->setDefault('extensionsenabled', $CFG->coursework_individual_extension);
+ $moodleform->addElement('select', 'extensionsenabled', get_string('individual_extension', 'mod_coursework'), $options);
+ $moodleform->addHelpButton('extensionsenabled', 'individual_extension', 'mod_coursework');
+ $moodleform->setDefault('extensionsenabled', $CFG->coursework_individual_extension);
}
private function add_submission_notification_field() {
global $COURSE;
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$selectableusers = [];
@@ -1298,9 +1298,9 @@ private function add_submission_notification_field() {
}
}
- $select = $moodle_form->addElement('select', 'submissionnotification', get_string('submissionnotification', 'mod_coursework'), $selectableusers);
+ $select = $moodleform->addElement('select', 'submissionnotification', get_string('submissionnotification', 'mod_coursework'), $selectableusers);
$select->setMultiple(true);
- $moodle_form->disabledIf('submissionnotification', 'deadline[enabled]', 'checked');
+ $moodleform->disabledIf('submissionnotification', 'deadline[enabled]', 'checked');
}
@@ -1344,12 +1344,12 @@ private function add_automatic_agreement_enabled() {
private function add_enable_plagiarism_flag_field() {
global $CFG;
- $moodle_form =& $this->_form;
+ $moodleform =& $this->_form;
$options = [ 0 => get_string('no'), 1 => get_string('yes')];
- $moodle_form->addElement('select', 'plagiarismflagenabled', get_string('plagiarism_flag_enable', 'mod_coursework'), $options);
- $moodle_form->addHelpButton('plagiarismflagenabled', 'plagiarism_flag_enable', 'mod_coursework');
- $moodle_form->setDefault('plagiarismflagenabled', $CFG->coursework_plagiarismflag);
+ $moodleform->addElement('select', 'plagiarismflagenabled', get_string('plagiarism_flag_enable', 'mod_coursework'), $options);
+ $moodleform->addHelpButton('plagiarismflagenabled', 'plagiarism_flag_enable', 'mod_coursework');
+ $moodleform->setDefault('plagiarismflagenabled', $CFG->coursework_plagiarismflag);
}
}
diff --git a/renderers/grading_report_renderer.php b/renderers/grading_report_renderer.php
index 7cdd17c3..a0ddfb39 100644
--- a/renderers/grading_report_renderer.php
+++ b/renderers/grading_report_renderer.php
@@ -38,43 +38,43 @@ class mod_coursework_grading_report_renderer extends plugin_renderer_base {
/**
* @var
*/
- protected $row_class;
+ protected $rowclass;
/**
* @var
*/
- protected $is_multiple_markers;
+ protected $ismultiplemarkers;
/**
* @param grading_report $grading_report
* param $is_multiple_markers
* @return string
*/
- public function render_grading_report($grading_report, $is_multiple_markers) {
+ public function render_grading_report($gradingreport, $ismultiplemarkers) {
$langelement = $this->generate_lang_element();
- $options = $grading_report->get_options();
- $tablerows = $grading_report->get_table_rows_for_page();
- $cell_helpers = $grading_report->get_cells_helpers();
- $sub_row_helper = $grading_report->get_sub_row_helper();
- if (count($tablerows) == $grading_report->realtotalrows) {
+ $options = $gradingreport->get_options();
+ $tablerows = $gradingreport->get_table_rows_for_page();
+ $cellhelpers = $gradingreport->get_cells_helpers();
+ $subrowhelper = $gradingreport->get_sub_row_helper();
+ if (count($tablerows) == $gradingreport->realtotalrows) {
$options['class'] = 'full-loaded';
}
- $this->row_class = $is_multiple_markers ? 'submissionrowmulti' : 'submissionrowsingle';
+ $this->row_class = $ismultiplemarkers ? 'submissionrowmulti' : 'submissionrowsingle';
if (empty($tablerows)) {
return $langelement . ' '.get_string('nousers', 'coursework').' ';
}
- $table_html = $this->start_table($options);
- $table_html .= $this->make_table_headers($cell_helpers, $options, $is_multiple_markers);
- $table_html .= '';
- $table_html .= ' ';
- $table_html .= $this->make_rows($tablerows, $cell_helpers, $sub_row_helper, $is_multiple_markers, );
- $table_html .= '';
- $table_html .= $this->end_table();
+ $tablehtml = $this->start_table($options);
+ $tablehtml .= $this->make_table_headers($cellhelpers, $options, $ismultiplemarkers);
+ $tablehtml .= '';
+ $tablehtml .= ' ';
+ $tablehtml .= $this->make_rows($tablerows, $cellhelpers, $subrowhelper, $ismultiplemarkers, );
+ $tablehtml .= '';
+ $tablehtml .= $this->end_table();
- return $langelement . $table_html;
+ return $langelement . $tablehtml;
}
/**
@@ -82,7 +82,7 @@ public function render_grading_report($grading_report, $is_multiple_markers) {
* @return mixed
*/
private function generate_lang_element() {
- $lang_messages = [
+ $langmessages = [
'download_submitted_files' => get_string('download_submitted_files', 'mod_coursework'),
'exportfinalgrades' => get_string('exportfinalgrades', 'mod_coursework'),
'exportgradingsheets' => get_string('exportgradingsheets', 'mod_coursework'),
@@ -91,7 +91,7 @@ private function generate_lang_element() {
$result = html_writer::empty_tag('input', [
'name' => '',
'type' => 'hidden',
- 'data-lang' => json_encode($lang_messages),
+ 'data-lang' => json_encode($langmessages),
'id' => 'element_lang_messages',
]);
$result = html_writer::div($result);
@@ -104,15 +104,15 @@ private function generate_lang_element() {
* @param array $options
* @return string
*/
- protected function make_header_cell($cell_helper, $options) {
+ protected function make_header_cell($cellhelper, $options) {
$seq = empty($options['seq']) ? 0 : $options['seq'];
- $table_html = '';
- return $table_html;
+ $headername = $cellhelper->get_table_header($options);
+ $tablehtml .= $headername;
+ $tablehtml .= $cellhelper->get_table_header_help_icon();
+ $tablehtml .= '';
+ return $tablehtml;
}
/**
@@ -121,47 +121,47 @@ protected function make_header_cell($cell_helper, $options) {
* @param sub_rows_interface $sub_row_helper
* @return string
*/
- protected function make_row_for_allocatable($row_object, $cell_helpers, $sub_row_helper) {
+ protected function make_row_for_allocatable($rowobject, $cellhelpers, $subrowhelper) {
//$class = (!$row_object->get_coursework()->has_multiple_markers()) ? "submissionrowsingle": "submissionrowmulti";
$class = $this->row_class;
- $submission = $row_object->get_submission();
- $allocatable = $row_object->get_allocatable();
+ $submission = $rowobject->get_submission();
+ $allocatable = $rowobject->get_allocatable();
- $table_html = ' ';
- $is_multiple_markers = $this->is_multiple_markers;
- $tbl_assessor_feedbacks = $sub_row_helper->get_row_with_assessor_feedback_table($row_object, count($cell_helpers));
- if ($is_multiple_markers) {
- $table_html .= ' | ';
+ $tablehtml = ' ';
+ $ismultiplemarkers = $this->is_multiple_markers;
+ $tblassessorfeedbacks = $subrowhelper->get_row_with_assessor_feedback_table($rowobject, count($cellhelpers));
+ if ($ismultiplemarkers) {
+ $tablehtml .= ' | ';
}
- foreach ($cell_helpers as $cell_helper) {
- $html_td = trim($cell_helper->get_table_cell($row_object));
+ foreach ($cellhelpers as $cellhelper) {
+ $htmltd = trim($cellhelper->get_table_cell($rowobject));
- if ($is_multiple_markers &&
- ($cell_helper instanceof \mod_coursework\render_helpers\grading_report\cells\user_cell ||
- $cell_helper instanceof \mod_coursework\render_helpers\grading_report\cells\group_cell)
+ if ($ismultiplemarkers &&
+ ($cellhelper instanceof \mod_coursework\render_helpers\grading_report\cells\user_cell ||
+ $cellhelper instanceof \mod_coursework\render_helpers\grading_report\cells\group_cell)
) {
- $html_td = str_replace('', $tbl_assessor_feedbacks.'', $html_td);
+ $htmltd = str_replace('', $tblassessorfeedbacks.'', $htmltd);
}
- $table_html .= $html_td;
+ $tablehtml .= $htmltd;
}
- $table_html .= ' ';
+ $tablehtml .= '';
- if (!$is_multiple_markers) {
- $table_html .= $tbl_assessor_feedbacks;
+ if (!$ismultiplemarkers) {
+ $tablehtml .= $tblassessorfeedbacks;
}
- return $table_html;
+ return $tablehtml;
}
/**
* @return string
*/
- public function submissions_header($header_text = '') {
- $submisions = (!empty($header_text)) ? $header_text : get_string('submissions', 'mod_coursework');
+ public function submissions_header($headertext = '') {
+ $submisions = (!empty($headertext)) ? $headertext : get_string('submissions', 'mod_coursework');
return html_writer::tag('h3', $submisions);
}
@@ -171,23 +171,23 @@ public function submissions_header($header_text = '') {
* @param $options
* @return string
*/
- protected function make_table_headers($cell_helpers, $options, $is_multiple_markers) {
+ protected function make_table_headers($cellhelpers, $options, $ismultiplemarkers) {
- $table_html = $this->make_upper_headers($cell_helpers, $is_multiple_markers);
- $table_html .= ' ';
- $tr_html = '';
+ $tablehtml = $this->make_upper_headers($cellhelpers, $ismultiplemarkers);
+ $tablehtml .= ' ';
+ $trhtml = '';
$i = 0;
- if ($is_multiple_markers) {
- $tr_html .= ' | '; // This is for open or close buttons
+ if ($ismultiplemarkers) {
+ $trhtml .= ' | '; // This is for open or close buttons
++$i;
}
- foreach ($cell_helpers as $cell_helper) {
+ foreach ($cellhelpers as $cellhelper) {
$options['seq'] = $i++;
- $tr_html .= $this->make_header_cell($cell_helper, $options);
+ $trhtml .= $this->make_header_cell($cellhelper, $options);
}
- return $table_html . $tr_html . ' ';
+ return $tablehtml . $trhtml . '';
}
/**
@@ -198,9 +198,9 @@ protected function start_table($options = []) {
$options['class'] = (!empty($options['class'])) ? $options['class'] : '';
$options['class'] .= ' submissions datatabletest display compact';
$options['id'] = 'dt_table';
- $table_html = \html_writer::start_tag('table', $options);
- $table_html .= \html_writer::start_tag('thead');
- return $table_html;
+ $tablehtml = \html_writer::start_tag('table', $options);
+ $tablehtml .= \html_writer::start_tag('thead');
+ return $tablehtml;
}
/**
@@ -219,16 +219,16 @@ protected function end_table() {
* @param $is_multiple_markers
* @return string
*/
- public function make_rows($tablerows, $cell_helpers, $sub_row_helper, $is_multiple_markers) {
- $table_html = '';
+ public function make_rows($tablerows, $cellhelpers, $subrowhelper, $ismultiplemarkers) {
+ $tablehtml = '';
- $this->row_class = $is_multiple_markers ? 'submissionrowmulti' : 'submissionrowsingle';
- $this->is_multiple_markers = $is_multiple_markers;
+ $this->row_class = $ismultiplemarkers ? 'submissionrowmulti' : 'submissionrowsingle';
+ $this->is_multiple_markers = $ismultiplemarkers;
- foreach ($tablerows as $row_object) {
- $table_html .= $this->make_row_for_allocatable($row_object, $cell_helpers, $sub_row_helper);
+ foreach ($tablerows as $rowobject) {
+ $tablehtml .= $this->make_row_for_allocatable($rowobject, $cellhelpers, $subrowhelper);
}
- return $table_html;
+ return $tablehtml;
}
/**
@@ -237,21 +237,21 @@ public function make_rows($tablerows, $cell_helpers, $sub_row_helper, $is_multip
* @param cell_interface[] $cell_helpers
* @return string
*/
- private function make_upper_headers($cell_helpers, $is_multiple_markers) {
+ private function make_upper_headers($cellhelpers, $ismultiplemarkers) {
$html = '';
- $headers = $this->upper_header_names_and_colspans($cell_helpers);
+ $headers = $this->upper_header_names_and_colspans($cellhelpers);
- foreach ($headers as $header_name => $colspan) {
- $colspan_value = $colspan;
+ foreach ($headers as $headername => $colspan) {
+ $colspanvalue = $colspan;
- if ($html == '' && $is_multiple_markers) {
- $colspan_value += 1;
+ if ($html == '' && $ismultiplemarkers) {
+ $colspanvalue += 1;
}
- $html .= ' ';
- $html .= get_string($header_name.'_table_header', 'mod_coursework');
- $html .= get_string($header_name.'_table_header', 'mod_coursework')
- ? ($this->output->help_icon($header_name.'_table_header', 'mod_coursework')) : '';
+ $html .= ' | ';
+ $html .= get_string($headername.'_table_header', 'mod_coursework');
+ $html .= get_string($headername.'_table_header', 'mod_coursework')
+ ? ($this->output->help_icon($headername.'_table_header', 'mod_coursework')) : '';
$html .= ' | ';
}
@@ -262,10 +262,10 @@ private function make_upper_headers($cell_helpers, $is_multiple_markers) {
* @param cell_interface[] $cell_helpers
* @return mixed
*/
- private function upper_header_names_and_colspans($cell_helpers) {
+ private function upper_header_names_and_colspans($cellhelpers) {
$headers = [];
- foreach ($cell_helpers as $helper) {
+ foreach ($cellhelpers as $helper) {
if (!array_key_exists($helper->header_group(), $headers)) {
$headers[$helper->header_group()] = 1;
} else {
diff --git a/renderers/object_renderer.php b/renderers/object_renderer.php
index 110b7461..011f0ea2 100644
--- a/renderers/object_renderer.php
+++ b/renderers/object_renderer.php
@@ -80,93 +80,93 @@ public function render_feedback(feedback $feedback) {
$table->head[] = $header;
// Assessor who gave this feedback.
- $table_row = new html_table_row();
- $table_row->cells['left'] = get_string('assessor', 'mod_coursework');
+ $tablerow = new html_table_row();
+ $tablerow->cells['left'] = get_string('assessor', 'mod_coursework');
if (!has_capability('mod/coursework:submit', $coursework->get_context()) || is_siteadmin($USER->id) ) {
- $table_row->cells['right'] = $feedback->get_assesor_username();
+ $tablerow->cells['right'] = $feedback->get_assesor_username();
} else {
if ((!$submission->get_coursework()->sampling_enabled() || $submission->sampled_feedback_exists()) && $feedback->assessorid == 0 && $feedback->timecreated == $feedback->timemodified) {
- $table_row->cells['right'] = get_string('automaticagreement', 'mod_coursework');
+ $tablerow->cells['right'] = get_string('automaticagreement', 'mod_coursework');
} else {
- $table_row->cells['right'] = $feedback->display_assessor_name();
+ $tablerow->cells['right'] = $feedback->display_assessor_name();
}
}
- $table->data[] = $table_row;
+ $table->data[] = $tablerow;
// Grade row.
- $table_row = new html_table_row();
+ $tablerow = new html_table_row();
- $left_cell = new html_table_cell();
- $right_cell = new html_table_cell();
+ $leftcell = new html_table_cell();
+ $rightcell = new html_table_cell();
$nameforgrade = get_string('provisionalgrade', 'mod_coursework');
- $left_cell->text = $nameforgrade;
+ $leftcell->text = $nameforgrade;
// For final feedback, students should see the moderated grade, not the one awarded by the final grader.
- $grade_judge = new grade_judge($coursework);
- $right_cell->text = $grade_judge->grade_to_display($feedback->get_grade());
- $right_cell->id = 'final_feedback_grade';
+ $gradejudge = new grade_judge($coursework);
+ $rightcell->text = $gradejudge->grade_to_display($feedback->get_grade());
+ $rightcell->id = 'final_feedback_grade';
- $table_row->cells['left'] = $left_cell;
- $table_row->cells['right'] = $right_cell;
- $table->data[] = $table_row;
+ $tablerow->cells['left'] = $leftcell;
+ $tablerow->cells['right'] = $rightcell;
+ $table->data[] = $tablerow;
// Feedback comment.
$comment = $feedback->feedbackcomment;
- $table_row = new html_table_row();
- $left_cell = new html_table_cell();
- $right_cell = new html_table_cell();
+ $tablerow = new html_table_row();
+ $leftcell = new html_table_cell();
+ $rightcell = new html_table_cell();
- $left_cell->text = get_string('feedbackcomment', 'mod_coursework');
- $right_cell->text = $comment;
- $right_cell->id = 'final_feedback_comment';
+ $leftcell->text = get_string('feedbackcomment', 'mod_coursework');
+ $rightcell->text = $comment;
+ $rightcell->id = 'final_feedback_comment';
- $table_row->cells['left'] = $left_cell;
- $table_row->cells['right'] = $right_cell;
- $table->data[] = $table_row;
+ $tablerow->cells['left'] = $leftcell;
+ $tablerow->cells['right'] = $rightcell;
+ $table->data[] = $tablerow;
- $table_row = new html_table_row();
- $left_cell = new html_table_cell();
- $right_cell = new html_table_cell();
+ $tablerow = new html_table_row();
+ $leftcell = new html_table_cell();
+ $rightcell = new html_table_cell();
$files = $feedback->get_feedback_files();
if ($files) {
- $left_cell->text = get_string('feedbackfiles', 'mod_coursework');
- $right_cell->text = $this->render_feedback_files(new mod_coursework_feedback_files($files));
- $right_cell->id = 'final_feedback_files';
+ $leftcell->text = get_string('feedbackfiles', 'mod_coursework');
+ $rightcell->text = $this->render_feedback_files(new mod_coursework_feedback_files($files));
+ $rightcell->id = 'final_feedback_files';
- $table_row->cells['left'] = $left_cell;
- $table_row->cells['right'] = $right_cell;
- $table->data[] = $table_row;
+ $tablerow->cells['left'] = $leftcell;
+ $tablerow->cells['right'] = $rightcell;
+ $table->data[] = $tablerow;
}
// Rubric stuff if it's there
if ($coursework->is_using_advanced_grading() && ($coursework->finalstagegrading == 0 || ($coursework->finalstagegrading == 1 && $feedback->stage_identifier != 'final_agreed_1'))) {
- $table_row = new html_table_row();
- $left_cell = new html_table_cell();
- $right_cell = new html_table_cell();
+ $tablerow = new html_table_row();
+ $leftcell = new html_table_cell();
+ $rightcell = new html_table_cell();
$controller = $coursework->get_advanced_grading_active_controller();
- $left_cell->text = 'Advanced grading';
- $right_cell->text = $controller->render_grade($this->page, $feedback->id, null, '', false);
+ $leftcell->text = 'Advanced grading';
+ $rightcell->text = $controller->render_grade($this->page, $feedback->id, null, '', false);
- $table_row->cells['left'] = $left_cell;
- $table_row->cells['right'] = $right_cell;
- $table->data[] = $table_row;
+ $tablerow->cells['left'] = $leftcell;
+ $tablerow->cells['right'] = $rightcell;
+ $table->data[] = $tablerow;
}
$out .= html_writer::table($table);
// It seems html_table doesn't support colgroup, so manually add it here
$colgroup = ' ';
- $to_replace = '';
- $pos = strrpos($out, $to_replace);
+ $toreplace = '';
+ $pos = strrpos($out, $toreplace);
- $out = substr_replace($out, $colgroup . $to_replace, $pos, strlen($to_replace));
+ $out = substr_replace($out, $colgroup . $toreplace, $pos, strlen($toreplace));
return $out;
}
@@ -195,53 +195,53 @@ public function render_moderation(moderation $moderation) {
$table->head[] = $header;
// Moderated by
- $table_row = new html_table_row();
- $left_cell = new html_table_cell();
- $right_cell = new html_table_cell();
- $left_cell->text = get_string('moderatedby', 'coursework' );
- $right_cell->text = $moderatedby;
- $right_cell->id = 'moderation_moderatedby';
+ $tablerow = new html_table_row();
+ $leftcell = new html_table_cell();
+ $rightcell = new html_table_cell();
+ $leftcell->text = get_string('moderatedby', 'coursework' );
+ $rightcell->text = $moderatedby;
+ $rightcell->id = 'moderation_moderatedby';
- $table_row->cells['left'] = $left_cell;
- $table_row->cells['right'] = $right_cell;
- $table->data[] = $table_row;
+ $tablerow->cells['left'] = $leftcell;
+ $tablerow->cells['right'] = $rightcell;
+ $table->data[] = $tablerow;
// Last edited by
- $table_row = new html_table_row();
- $left_cell = new html_table_cell();
- $right_cell = new html_table_cell();
- $left_cell->text = get_string('lasteditedby', 'coursework');
- $right_cell->text = $lasteditedby . ' on ' .
+ $tablerow = new html_table_row();
+ $leftcell = new html_table_cell();
+ $rightcell = new html_table_cell();
+ $leftcell->text = get_string('lasteditedby', 'coursework');
+ $rightcell->text = $lasteditedby . ' on ' .
userdate($moderation->timemodified, '%a, %d %b %Y, %H:%M');
- $right_cell->id = 'moderation_lasteditedby';
+ $rightcell->id = 'moderation_lasteditedby';
- $table_row->cells['left'] = $left_cell;
- $table_row->cells['right'] = $right_cell;
- $table->data[] = $table_row;
+ $tablerow->cells['left'] = $leftcell;
+ $tablerow->cells['right'] = $rightcell;
+ $table->data[] = $tablerow;
// Moderation agreement
- $table_row = new html_table_row();
- $left_cell = new html_table_cell();
- $right_cell = new html_table_cell();
- $left_cell->text = get_string('moderationagreement', 'coursework');
- $right_cell->text = get_string($moderation->agreement, 'coursework');
- $right_cell->id = 'moderation_agreement';
+ $tablerow = new html_table_row();
+ $leftcell = new html_table_cell();
+ $rightcell = new html_table_cell();
+ $leftcell->text = get_string('moderationagreement', 'coursework');
+ $rightcell->text = get_string($moderation->agreement, 'coursework');
+ $rightcell->id = 'moderation_agreement';
- $table_row->cells['left'] = $left_cell;
- $table_row->cells['right'] = $right_cell;
- $table->data[] = $table_row;
+ $tablerow->cells['left'] = $leftcell;
+ $tablerow->cells['right'] = $rightcell;
+ $table->data[] = $tablerow;
// Moderation comment
- $table_row = new html_table_row();
- $left_cell = new html_table_cell();
- $right_cell = new html_table_cell();
- $left_cell->text = get_string('comment', 'mod_coursework');
- $right_cell->text = $moderation->modcomment;
- $right_cell->id = 'moderation_comment';
+ $tablerow = new html_table_row();
+ $leftcell = new html_table_cell();
+ $rightcell = new html_table_cell();
+ $leftcell->text = get_string('comment', 'mod_coursework');
+ $rightcell->text = $moderation->modcomment;
+ $rightcell->id = 'moderation_comment';
- $table_row->cells['left'] = $left_cell;
- $table_row->cells['right'] = $right_cell;
- $table->data[] = $table_row;
+ $tablerow->cells['left'] = $leftcell;
+ $tablerow->cells['right'] = $rightcell;
+ $table->data[] = $tablerow;
$out .= html_writer::table($table);
@@ -276,7 +276,7 @@ protected function render_mod_coursework_assessor_feedback_row(mod_coursework_as
$row->attributes['class'] =
"feedback-{$feedbackrow->get_assessor_id()}-{$feedbackrow->get_allocatable()->id()} {$feedbackrow->get_stage()->identifier()}";
- $existing_feedback = $feedbackrow->get_feedback();
+ $existingfeedback = $feedbackrow->get_feedback();
// Assessor cell: name, image and edit link.
@@ -297,8 +297,8 @@ protected function render_mod_coursework_assessor_feedback_row(mod_coursework_as
$cell->text = 'asdadas';
// Edit feedback link.
$submission = $feedbackrow->get_submission();
- $new_feedback = false;
- if (empty($existing_feedback)) {
+ $newfeedback = false;
+ if (empty($existingfeedback)) {
$params = [
'assessorid' => $assessor->id(),
'stage_identifier' => $feedbackrow->get_stage()->identifier(),
@@ -306,42 +306,42 @@ protected function render_mod_coursework_assessor_feedback_row(mod_coursework_as
if ($submission) {
$params['submissionid'] = $submission->id;
}
- $new_feedback = feedback::build($params);
+ $newfeedback = feedback::build($params);
}
$ability = new ability(user::find($USER), $feedbackrow->get_coursework());
- if ($existing_feedback && $ability->can('edit', $existing_feedback)) {
+ if ($existingfeedback && $ability->can('edit', $existingfeedback)) {
$linktitle = get_string('edit');
$icon = new pix_icon('edit', $linktitle, 'coursework', ['width' => '20px']);
- $link_id = "edit_feedback_" . $feedbackrow->get_feedback()->id;
+ $linkid = "edit_feedback_" . $feedbackrow->get_feedback()->id;
$link = $this->get_router()->get_path('edit feedback', ['feedback' => $feedbackrow->get_feedback()]);
- $iconlink = $this->output->action_icon($link, $icon, null, ['id' => $link_id]);
+ $iconlink = $this->output->action_icon($link, $icon, null, ['id' => $linkid]);
$cell->text .= $iconlink;
- } else if ($new_feedback && $ability->can('new', $new_feedback)) {
+ } else if ($newfeedback && $ability->can('new', $newfeedback)) {
// New
$linktitle = "new_feedback";
$icon = new pix_icon('edit', $linktitle, 'coursework', ['width' => '20px']);
- $new_feedback_params = [
+ $newfeedbackparams = [
'submission' => $feedbackrow->get_submission(),
'assessor' => $feedbackrow->get_assessor(),
'stage' => $feedbackrow->get_stage(),
];
- $link = $this->get_router()->get_path('new feedback', $new_feedback_params);
+ $link = $this->get_router()->get_path('new feedback', $newfeedbackparams);
$iconlink = $this->output->action_icon($link, $icon, null, ['class' => "new_feedback"]);
$cell->text .= $iconlink;
- } else if ($existing_feedback && $ability->can('show', $existing_feedback)) {
+ } else if ($existingfeedback && $ability->can('show', $existingfeedback)) {
// Show - for managers and others who are reviewing the grades but who should
// not be able to change them.
$linktitle = get_string('viewfeedback', 'mod_coursework');
$icon = new pix_icon('show', $linktitle, 'coursework', ['width' => '20px']);
- $link_id = "show_feedback_" . $feedbackrow->get_feedback()->id;
+ $linkid = "show_feedback_" . $feedbackrow->get_feedback()->id;
$link = $this->get_router()->get_path('show feedback', ['feedback' => $feedbackrow->get_feedback()]);
- $iconlink = $this->output->action_icon($link, $icon, null, ['id' => $link_id]);
+ $iconlink = $this->output->action_icon($link, $icon, null, ['id' => $linkid]);
$cell->text .= $iconlink;
}
@@ -374,15 +374,15 @@ 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 = [];
+ $submissionfiles = $files->get_files();
+ $filesarray = [];
- foreach ($submission_files as $file) {
- $files_array[] = $this->make_file_link($files, $file);
+ foreach ($submissionfiles as $file) {
+ $filesarray[] = $this->make_file_link($files, $file);
}
$br = html_writer::empty_tag('br');
- $out = implode($br, $files_array);
+ $out = implode($br, $filesarray);
return $out;
}
@@ -394,14 +394,14 @@ public function render_submission_files(mod_coursework_submission_files $files)
public function render_feedback_files(mod_coursework_feedback_files $files) {
- $files_array = [];
- $submission_files = $files->get_files();
- foreach ($submission_files as $file) {
- $files_array[] = $this->make_file_link($files, $file, 'feedbackfile');
+ $filesarray = [];
+ $submissionfiles = $files->get_files();
+ foreach ($submissionfiles as $file) {
+ $filesarray[] = $this->make_file_link($files, $file, 'feedbackfile');
}
$br = html_writer::empty_tag('br');
- $out = implode($br, $files_array);
+ $out = implode($br, $filesarray);
return $out;
}
@@ -413,18 +413,18 @@ public function render_feedback_files(mod_coursework_feedback_files $files) {
* @param bool $with_resubmit_button
* @return string
*/
- public function render_submission_files_with_plagiarism_links(mod_coursework_submission_files $files, $with_resubmit_button = true) {
+ public function render_submission_files_with_plagiarism_links(mod_coursework_submission_files $files, $withresubmitbutton = true) {
global $USER;
$ability = new ability(user::find($USER), $files->get_coursework());
$coursework = $files->get_coursework();
- $submission_files = $files->get_files();
+ $submissionfiles = $files->get_files();
$submission = $files->get_submission();
- $files_array = [];
+ $filesarray = [];
- foreach ($submission_files as $file) {
+ foreach ($submissionfiles as $file) {
$link = $this->make_file_link($files, $file);
@@ -433,15 +433,15 @@ public function render_submission_files_with_plagiarism_links(mod_coursework_sub
$link .= ' '. $this->render_file_plagiarism_information($file, $coursework, $submission).' ';
}
- if ($with_resubmit_button) {
+ if ($withresubmitbutton) {
$link .= ' '. $this->render_resubmit_to_plagiarism_button($coursework, $submission).' ';
}
- $files_array[] = $link;
+ $filesarray[] = $link;
}
$br = html_writer::empty_tag('br');
- $out = implode($br, $files_array);
+ $out = implode($br, $filesarray);
return $out;
}
@@ -459,11 +459,11 @@ public function render_plagiarism_links($files) {
$ability = new ability(user::find($USER), $files->get_coursework());
$coursework = $files->get_coursework();
- $submission_files = $files->get_files();
+ $submissionfiles = $files->get_files();
$submission = $files->get_submission();
- $files_array = [];
+ $filesarray = [];
- foreach ($submission_files as $file) {
+ foreach ($submissionfiles as $file) {
$link = '';
@@ -472,11 +472,11 @@ public function render_plagiarism_links($files) {
$link = $this->render_file_plagiarism_information($file, $coursework, $submission);
}
- $files_array[] = $link;
+ $filesarray[] = $link;
}
$br = html_writer::empty_tag('br');
- $out = implode($br, $files_array);
+ $out = implode($br, $filesarray);
return $out;
}
@@ -516,15 +516,15 @@ protected function render_mod_coursework_coursework(mod_coursework_coursework $c
$cangrade = has_capability('mod/coursework:addinitialgrade', $this->page->context);
$canpublish = has_capability('mod/coursework:publish', $this->page->context);
- $is_published = $coursework->user_grade_is_published($USER->id);
- $allowed_to_add_general_feedback = has_capability('mod/coursework:addgeneralfeedback', $coursework->get_context());
+ $ispublished = $coursework->user_grade_is_published($USER->id);
+ $allowedtoaddgeneralfeedback = has_capability('mod/coursework:addgeneralfeedback', $coursework->get_context());
$canaddgeneralfeedback = has_capability('mod/coursework:addgeneralfeedback', $this->page->context);
$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()) {
+ if (($coursework->is_general_feedback_enabled() && $allowedtoaddgeneralfeedback && (time() > $coursework->generalfeedback || $cangrade || $canpublish || $ispublished)) || !$coursework->is_general_feedback_enabled()) {
$out .= html_writer::tag('h3', get_string('generalfeedback', 'coursework'));
$out .= $coursework->feedbackcomment
? html_writer::tag('p', $coursework->feedbackcomment)
@@ -554,13 +554,13 @@ protected function render_mod_coursework_coursework(mod_coursework_coursework $c
* @param mod_coursework_allocation_table $allocation_table
* @return string
*/
- protected function render_mod_coursework_allocation_table(mod_coursework_allocation_table $allocation_table) {
+ protected function render_mod_coursework_allocation_table(mod_coursework_allocation_table $allocationtable) {
global $SESSION;
- $table_html = $allocation_table->get_hidden_elements();
+ $tablehtml = $allocationtable->get_hidden_elements();
- $table_html .= '
+ $tablehtml .= '
@@ -568,14 +568,14 @@ protected function render_mod_coursework_allocation_table(mod_coursework_allocat
';
- $options = $allocation_table->get_options();
+ $options = $allocationtable->get_options();
- $paging_bar = new paging_bar($allocation_table->get_participant_count(), $options['page'], $options['perpage'],
+ $pagingbar = new paging_bar($allocationtable->get_participant_count(), $options['page'], $options['perpage'],
$this->page->url, 'page');
- $all = count($allocation_table->get_coursework()->get_allocatables());
+ $all = count($allocationtable->get_coursework()->get_allocatables());
- $records_per_page = [3 => 3,
+ $recordsperpage = [3 => 3,
10 => 10,
20 => 20,
30 => 30,
@@ -587,57 +587,57 @@ protected function render_mod_coursework_allocation_table(mod_coursework_allocat
// Commenting these out as they appear unused and are causing exception in behat test.
// $single_select_params = compact('sortby', 'sorthow', 'page');
// $single_select_params['page'] = '0';
- $select = new single_select($this->page->url, 'per_page', $records_per_page, $options['perpage'], null);
+ $select = new single_select($this->page->url, 'per_page', $recordsperpage, $options['perpage'], null);
$select->label = get_string('records_per_page', 'coursework');
$select->class = 'jumpmenu';
$select->formid = 'sectionmenu';
- $table_html .= $this->output->render($select);
+ $tablehtml .= $this->output->render($select);
// Get the hidden elements used for assessors and moderators selected on other pages;
- $allocatable_cell_helper = $allocation_table->get_allocatable_cell();
- $table_html .= '';
- $table_html .= $allocatable_cell_helper->get_table_header($allocation_table->get_options());
- $table_html .= ' | ';
+ $allocatablecellhelper = $allocationtable->get_allocatable_cell();
+ $tablehtml .= '';
+ $tablehtml .= $allocatablecellhelper->get_table_header($allocationtable->get_options());
+ $tablehtml .= ' | ';
$no = 0;
- foreach ($allocation_table->marking_stages() as $stage) {
+ foreach ($allocationtable->marking_stages() as $stage) {
if ($stage->uses_allocation()) {
- $table_html .= '';
+ $tablehtml .= ' | ';
// pin all checkbox
- $checkbox_title = get_string('selectalltopin', 'coursework');
+ $checkboxtitle = get_string('selectalltopin', 'coursework');
if ($stage->allocation_table_header() == 'Assessor') {
$no++;
if ($stage->stage_has_allocation() ) {// has any pins
- $table_html .= '';
+ $tablehtml .= '';
}
- $table_html .= $stage->allocation_table_header() . ' ' . $no;
- } else if ($allocation_table->get_coursework()->moderation_agreement_enabled()) {
+ $tablehtml .= $stage->allocation_table_header() . ' ' . $no;
+ } else if ($allocationtable->get_coursework()->moderation_agreement_enabled()) {
//moderator header
if ($stage->stage_has_allocation() ) {// has any pins
- $table_html .= '';
+ $tablehtml .= '';
}
- $table_html .= get_string('moderator', 'coursework');
+ $tablehtml .= get_string('moderator', 'coursework');
} else {
- $table_html .= $stage->allocation_table_header();
+ $tablehtml .= $stage->allocation_table_header();
}
- $table_html .= ' | ';
+ $tablehtml .= '';
}
}
- $table_html .= '
+ $tablehtml .= '
';
- $rowdata = $allocation_table->get_table_rows_for_page();
+ $rowdata = $allocationtable->get_table_rows_for_page();
foreach ($rowdata as $row) {
- $table_html .= $this->render_allocation_table_row($row);
+ $tablehtml .= $this->render_allocation_table_row($row);
}
- $table_html .= '
+ $tablehtml .= '
';
@@ -647,13 +647,13 @@ protected function render_mod_coursework_allocation_table(mod_coursework_allocat
'type' => 'submit',
'id' => 'save_manual_allocations_1',
'value' => get_string('save', 'mod_coursework')];
- $table_html .= html_writer::empty_tag('input', $attributes);
+ $tablehtml .= html_writer::empty_tag('input', $attributes);
- $table_html .= $this->output->render($select);
+ $tablehtml .= $this->output->render($select);
- $table_html .= $this->page->get_renderer('mod_coursework', 'object')->render($paging_bar);
+ $tablehtml .= $this->page->get_renderer('mod_coursework', 'object')->render($pagingbar);
- return $table_html;
+ return $tablehtml;
}
/**
@@ -664,20 +664,20 @@ protected function render_mod_coursework_allocation_table(mod_coursework_allocat
* @param mod_coursework_allocation_table_row $allocation_row
* @return \html_table_row
*/
- protected function render_mod_coursework_allocation_table_row(mod_coursework_allocation_table_row $allocation_row) {
+ protected function render_mod_coursework_allocation_table_row(mod_coursework_allocation_table_row $allocationrow) {
$row = new html_table_row();
- $row->id = $allocation_row->get_allocatable()->type().'_'.$allocation_row->get_allocatable()->id();
+ $row->id = $allocationrow->get_allocatable()->type().'_'.$allocationrow->get_allocatable()->id();
- $allocatable_cell_helper = $allocation_row->get_allocatable_cell();
+ $allocatablecellhelper = $allocationrow->get_allocatable_cell();
- $allocatable_cell = $allocatable_cell_helper->get_table_cell($allocation_row);
- $row->cells['allocatable'] = $allocatable_cell;
+ $allocatablecell = $allocatablecellhelper->get_table_cell($allocationrow);
+ $row->cells['allocatable'] = $allocatablecell;
- $stages = $allocation_row->marking_stages();
+ $stages = $allocationrow->marking_stages();
foreach ($stages as $stage) {
- $row->cells[$stage->identifier()] = $stage->get_allocation_table_cell($allocation_row->get_allocatable());
+ $row->cells[$stage->identifier()] = $stage->get_allocation_table_cell($allocationrow->get_allocatable());
}
return $row;
@@ -691,8 +691,8 @@ protected function render_mod_coursework_allocation_table_row(mod_coursework_all
* @return string
*/
public function render_mod_coursework_allocation_widget(mod_coursework_allocation_widget $allocationwidget) {
- $lang_str = ($allocationwidget->get_coursework()->moderation_agreement_enabled()) ? 'allocateassessorsandmoderators' : 'allocateassessors';
- $html = html_writer::tag('h2', get_string($lang_str, 'mod_coursework'));
+ $langstr = ($allocationwidget->get_coursework()->moderation_agreement_enabled()) ? 'allocateassessorsandmoderators' : 'allocateassessors';
+ $html = html_writer::tag('h2', get_string($langstr, 'mod_coursework'));
$html .= ' ';
@@ -796,8 +796,8 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$comma = ",";
}
} else {
- $grade_scale = \grade_scale::fetch(['id' => abs($samplingwidget->get_coursework()->grade)]);
- $scale = $grade_scale->scale;
+ $gradescale = \grade_scale::fetch(['id' => abs($samplingwidget->get_coursework()->grade)]);
+ $scale = $gradescale->scale;
}
$html .= " ";
@@ -810,10 +810,10 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$columndata = [new html_table_cell($assessor1cell)];
- $percentage_options = [];
+ $percentageoptions = [];
for ($i = 0; $i < 110; $i = $i + 10) {
- $percentage_options[$i] = "{$i}%";
+ $percentageoptions[$i] = "{$i}%";
}
$javascript = false;
@@ -822,22 +822,22 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
// Create the secon
- $sampling_strategies = ['0' => get_string('sampling_manual', 'mod_coursework'),
+ $samplingstrategies = ['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;
- $sampling_cell = html_writer::start_tag('div', ['class' => 'samples_strategy']);
- $sampling_cell .= html_writer::label(get_string('sampletype', 'mod_coursework'), "assessor_{$i}_samplingstrategy");
+ $samplingcell = html_writer::start_tag('div', ['class' => 'samples_strategy']);
+ $samplingcell .= html_writer::label(get_string('sampletype', 'mod_coursework'), "assessor_{$i}_samplingstrategy");
- $sampling_cell .= html_writer::select($sampling_strategies,
+ $samplingcell .= html_writer::select($samplingstrategies,
"assessor_{$i}_samplingstrategy",
$selected,
false,
['id' => "assessor_{$i}_samplingstrategy", 'class' => "assessor_sampling_strategy sampling_strategy_detail"]);
- $sampling_cell .= html_writer::end_tag('div');
+ $samplingcell .= html_writer::end_tag('div');
if ($i == $samplingwidget->get_coursework()->get_max_markers()) {
$javascript = true;
@@ -851,9 +851,9 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$graderules .= $this->get_sampling_strategy_form_elements($samplingwidget->get_coursework(), $i, $javascript);
- $sampling_cell .= html_writer::div($graderules, '', ['id' => "assessor_{$i}_automatic_rules"]);
+ $samplingcell .= html_writer::div($graderules, '', ['id' => "assessor_{$i}_automatic_rules"]);
- $columndata[] = new html_table_cell($sampling_cell);
+ $columndata[] = new html_table_cell($samplingcell);
}
$table->data[] = $columndata;
@@ -905,74 +905,74 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
private function sampling_strategy_column($samplingwidget, $suffix = '') {
- $percentage_options = [];
+ $percentageoptions = [];
for ($i = 0; $i < 110; $i = $i + 10) {
- $percentage_options[$i] = "{$i}%";
+ $percentageoptions[$i] = "{$i}%";
}
// Hidden input containing scale values
$scale = [];
- $sampling_column = " ";
+ $samplingcolumn = " ";
- $sampling_column .= html_writer::tag('br', '');
- $sampling_column .= html_writer::tag('strong', get_string('selectrules', 'mod_coursework'));
- $sampling_column .= html_writer::tag('br', '');
+ $samplingcolumn .= html_writer::tag('br', '');
+ $samplingcolumn .= html_writer::tag('strong', get_string('selectrules', 'mod_coursework'));
+ $samplingcolumn .= html_writer::tag('br', '');
- $sampling_column .= html_writer::start_tag('div');
+ $samplingcolumn .= html_writer::start_tag('div');
for ($i = 0; $i < 1; $i++) {
- $sampling_column .= html_writer::start_tag('span', ['class' => "assessor_{$suffix}_grade_rules", 'id' => "assessor_{$suffix}_grade_rules"]);
+ $samplingcolumn .= html_writer::start_tag('span', ['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'),
+ $samplingcolumn .= html_writer::checkbox("assessor_{$suffix}_samplerules[]", 1, false, get_string('grade', 'mod_coursework'),
['id' => "assessor_{$suffix}_samplerules_{$i}", 'class' => "assessor_{$suffix} sampling_strategy_detail"]);
$options = ['0' => get_string('percentagesign', 'mod_coursework'),
'1' => get_string('gradescale', 'mod_coursework')];
- $sampling_column .= html_writer::select($options,
+ $samplingcolumn .= html_writer::select($options,
"assessor_{$suffix}_sampletype[]",
$samplingwidget->get_sampling_strategy(),
false,
['id' => "assessor_{$suffix}_sampletype_{$i}", 'class' => "grade_type assessor_{$suffix} sampling_strategy_detail"]);
- $sampling_column .= html_writer::label(get_string('from', 'mod_coursework'), 'assessortwo_samplefrom[0]');
+ $samplingcolumn .= html_writer::label(get_string('from', 'mod_coursework'), 'assessortwo_samplefrom[0]');
- $rule_options = $percentage_options;
+ $ruleoptions = $percentageoptions;
- $sampling_column .= html_writer::select($rule_options,
+ $samplingcolumn .= html_writer::select($ruleoptions,
"assessor_{$suffix}_samplefrom[]",
$samplingwidget->get_sampling_strategy(),
false,
['id' => "assessor_{$suffix}_samplefrom_{$i}", 'class' => "assessor_{$suffix} sampling_strategy_detail"]);
- $sampling_column .= html_writer::label(get_string('to', 'mod_coursework'), "assessor_{$suffix}_sampleto[0]");
+ $samplingcolumn .= html_writer::label(get_string('to', 'mod_coursework'), "assessor_{$suffix}_sampleto[0]");
- $sampling_column .= html_writer::select($rule_options,
+ $samplingcolumn .= html_writer::select($ruleoptions,
"assessor_{$suffix}_sampleto[]",
$samplingwidget->get_sampling_strategy(),
false,
['id' => "assessor_{$suffix}_sampleto_{$i}", 'class' => "assessor_{$suffix} sampling_strategy_detail"]);
- $sampling_column .= html_writer::end_tag('span', '');
+ $samplingcolumn .= html_writer::end_tag('span', '');
}
- $sampling_column .= html_writer::end_tag('div');
+ $samplingcolumn .= html_writer::end_tag('div');
- $sampling_column .= html_writer::link('#', get_string('addgraderule', 'mod_coursework'), ['id' => "assessor_{$suffix}_addgradderule", 'class' => 'addgradderule sampling_strategy_detail']);
- $sampling_column .= html_writer::link('#', get_string('removegraderule', 'mod_coursework'), ['id' => "assessor_{$suffix}_removegradderule", 'class' => 'removegradderule sampling_strategy_detail']);
+ $samplingcolumn .= html_writer::link('#', get_string('addgraderule', 'mod_coursework'), ['id' => "assessor_{$suffix}_addgradderule", 'class' => 'addgradderule sampling_strategy_detail']);
+ $samplingcolumn .= html_writer::link('#', get_string('removegraderule', 'mod_coursework'), ['id' => "assessor_{$suffix}_removegradderule", 'class' => 'removegradderule sampling_strategy_detail']);
- $sampling_column .= html_writer::checkbox("assessor_{$suffix}_samplertopup", 1, false, get_string('topupto', 'mod_coursework'),
+ $samplingcolumn .= html_writer::checkbox("assessor_{$suffix}_samplertopup", 1, false, get_string('topupto', 'mod_coursework'),
['id' => "assessor_{$suffix}_samplerules[]", 'class' => "assessor_{$suffix} sampling_strategy_detail"]);
- $sampling_column .= html_writer::select($percentage_options,
+ $samplingcolumn .= html_writer::select($percentageoptions,
"assessor_{$suffix}_sampletopup",
$samplingwidget->get_sampling_strategy(),
false,
['id' => "assessor_{$suffix}_sampletopup", 'class' => "assessor_{$suffix} sampling_strategy_detail"]);
- $sampling_column .= html_writer::label(get_string('ofallstudents', 'mod_coursework'), 'assessortwo_sampleto[]');
+ $samplingcolumn .= html_writer::label(get_string('ofallstudents', 'mod_coursework'), 'assessortwo_sampleto[]');
- return $sampling_column;
+ return $samplingcolumn;
}
@@ -1068,10 +1068,10 @@ protected function get_allocation_strategy_form_elements($coursework) {
}
preg_match('/([^\/]+).php/', $fullclassname, $matches);
$classname = $matches[1];
- $full_class_name = '\mod_coursework\allocation\strategy\\' . $classname;
+ $fullclassname = '\mod_coursework\allocation\strategy\\' . $classname;
// We want the elements from all the strategies so we can show/hide them.
/* @var \mod_coursework\allocation\strategy\base $strategy */
- $strategy = new $full_class_name($coursework);
+ $strategy = new $fullclassname($coursework);
$attributes = [
'class' => 'assessor-strategy-options',
@@ -1090,7 +1090,7 @@ protected function get_allocation_strategy_form_elements($coursework) {
return $html;
}
- protected function get_sampling_strategy_form_elements($coursework, $assessor_number, $load_javascript=false) {
+ protected function get_sampling_strategy_form_elements($coursework, $assessornumber, $loadjavascript=false) {
global $CFG, $DB;
@@ -1107,14 +1107,14 @@ protected function get_sampling_strategy_form_elements($coursework, $assessor_nu
}*/
preg_match('/([^\/]+).php/', $classdir."/".$plugin->rulename.".php", $matches);
$classname = $matches[1];
- $full_class_name = '\mod_coursework\sample_set_rule\\' . $classname;
+ $fullclassname = '\mod_coursework\sample_set_rule\\' . $classname;
- $sampling_rule = new $full_class_name($coursework);
+ $samplingrule = new $fullclassname($coursework);
- $html .= $sampling_rule->add_form_elements($assessor_number);
+ $html .= $samplingrule->add_form_elements($assessornumber);
- if ($load_javascript) {
- $javascript .= $sampling_rule->add_form_elements_js($assessor_number);
+ if ($loadjavascript) {
+ $javascript .= $samplingrule->add_form_elements_js($assessornumber);
}
}
@@ -1142,13 +1142,13 @@ protected function resubmit_to_plagiarism_button($coursework, $submission) {
['type' => 'hidden',
'name' => 'id',
'value' => $coursework->get_coursemodule_id()]);
- $plagiarism_plugin_names = [];
+ $plagiarismpluginnames = [];
foreach ($coursework->get_plagiarism_helpers() as $helper) {
- $plagiarism_plugin_names[] = $helper->human_readable_name();
+ $plagiarismpluginnames[] = $helper->human_readable_name();
}
- $plagiarism_plugin_names = implode(' ', $plagiarism_plugin_names);
+ $plagiarismpluginnames = implode(' ', $plagiarismpluginnames);
- $resubmit = get_string('resubmit', 'coursework', $plagiarism_plugin_names);
+ $resubmit = get_string('resubmit', 'coursework', $plagiarismpluginnames);
$html .= html_writer::empty_tag('input',
['type' => 'submit',
'value' => $resubmit,
@@ -1164,7 +1164,7 @@ protected function resubmit_to_plagiarism_button($coursework, $submission) {
*/
protected function render_file_plagiarism_information($file, $coursework) {
- $plagiarism_links_params = [
+ $plagiarismlinksparams = [
'userid' => $file->get_userid(),
'file' => $file,
'cmid' => $coursework->get_coursemodule_id(),
@@ -1172,7 +1172,7 @@ protected function render_file_plagiarism_information($file, $coursework) {
'coursework' => $coursework->id,
'modname' => 'coursework',
];
- $plagiarsmlinks = plagiarism_get_links($plagiarism_links_params);
+ $plagiarsmlinks = plagiarism_get_links($plagiarismlinksparams);
return $plagiarsmlinks;
}
@@ -1183,7 +1183,7 @@ protected function render_file_plagiarism_information($file, $coursework) {
* @param string $class_name
* @return string
*/
- protected function make_file_link($files, $file, $class_name = 'submissionfile') {
+ protected function make_file_link($files, $file, $classname = 'submissionfile') {
global $CFG;
$url = "{$CFG->wwwroot}/pluginfile.php/{$file->get_contextid()}" .
@@ -1196,7 +1196,7 @@ protected function make_file_link($files, $file, $class_name = 'submissionfile')
['class' => 'submissionfileicon']);
$fileurl = $url . $file->get_filepath() . $file->get_itemid() . '/' . rawurlencode($filename);
- return html_writer::link($fileurl, $image.$filename, ['class' => $class_name]);
+ return html_writer::link($fileurl, $image.$filename, ['class' => $classname]);
}
/**
@@ -1224,34 +1224,34 @@ protected function render_resubmit_to_plagiarism_button($coursework, $submission
protected function coursework_deadlines_table(mod_coursework_coursework $coursework) {
global $USER;
- $dealine_extension =
+ $dealineextension =
\mod_coursework\models\deadline_extension::get_extension_for_student(user::find($USER), $coursework);
- $personal_deadline =
+ $personaldeadline =
\mod_coursework\models\personal_deadline::get_personal_deadline_for_student(user::find($USER), $coursework);
$normaldeadline = $coursework->deadline;
- if ($personal_deadline) {
- $normaldeadline = $personal_deadline->personal_deadline;
+ if ($personaldeadline) {
+ $normaldeadline = $personaldeadline->personal_deadline;
}
- $deadline_header_text = get_string('deadline', 'coursework');
+ $deadlineheadertext = get_string('deadline', 'coursework');
if ($coursework->personal_deadlines_enabled() && (!has_capability('mod/coursework:submit', $this->page->context) || is_siteadmin($USER))) {
- $deadline_header_text .= " ". get_string('default_deadline', 'coursework');
+ $deadlineheadertext .= " ". get_string('default_deadline', 'coursework');
}
- $deadline_date = '';
+ $deadlinedate = '';
- if ($dealine_extension) {
- $deadline_date .= ' ';
- $deadline_date .= userdate($normaldeadline, '%a, %d %b %Y, %H:%M');
- $deadline_date .= '';
+ if ($dealineextension) {
+ $deadlinedate .= ' ';
+ $deadlinedate .= userdate($normaldeadline, '%a, %d %b %Y, %H:%M');
+ $deadlinedate .= '';
} else if ($coursework->has_deadline()) {
- $deadline_date .= userdate($normaldeadline, '%a, %d %b %Y, %H:%M');
+ $deadlinedate .= userdate($normaldeadline, '%a, %d %b %Y, %H:%M');
} else {
- $deadline_date .= get_string('nocourseworkdeadline', 'mod_coursework');
+ $deadlinedate .= get_string('nocourseworkdeadline', 'mod_coursework');
}
- $deadline_message = '';
+ $deadlinemessage = '';
if ($coursework->has_deadline()) {
if ($coursework->allow_late_submissions()) {
$latemessage = get_string('latesubmissionsallowed', 'mod_coursework');
@@ -1261,50 +1261,50 @@ protected function coursework_deadlines_table(mod_coursework_coursework $coursew
$lateclass = $coursework->deadline_has_passed() ? 'text-error' : 'text-warning';
}
$latemessage .= ' ';
- $deadline_message = html_writer::start_tag('span', ['class' => $lateclass]);
- $deadline_message .= $latemessage;
- $deadline_message .= html_writer::end_tag('span');
+ $deadlinemessage = html_writer::start_tag('span', ['class' => $lateclass]);
+ $deadlinemessage .= $latemessage;
+ $deadlinemessage .= html_writer::end_tag('span');
}
// Does the user have an extension?
- $deadline_extension_message = '';
- if ($dealine_extension) {
- $deadline_extension_message .= html_writer::start_tag('div');
- $deadline_extension_message .= ' You have an extension! Your deadine is: '
- . userdate($dealine_extension->extended_deadline);
- $deadline_extension_message .= html_writer::end_tag('div');
+ $deadlineextensionmessage = '';
+ if ($dealineextension) {
+ $deadlineextensionmessage .= html_writer::start_tag('div');
+ $deadlineextensionmessage .= ' You have an extension! Your deadine is: '
+ . userdate($dealineextension->extended_deadline);
+ $deadlineextensionmessage .= html_writer::end_tag('div');
}
if ($coursework->has_deadline()) {
- $deadline_message .= html_writer::start_tag('div', ['class' => 'autofinalise_info']);
- $deadline_message .= ($coursework->personal_deadlines_enabled() && (!has_capability('mod/coursework:submit', $this->page->context) || is_siteadmin($USER)))
+ $deadlinemessage .= html_writer::start_tag('div', ['class' => 'autofinalise_info']);
+ $deadlinemessage .= ($coursework->personal_deadlines_enabled() && (!has_capability('mod/coursework:submit', $this->page->context) || is_siteadmin($USER)))
? get_string('personal_deadline_warning', 'mod_coursework') : get_string('deadline_warning', 'mod_coursework');
- $deadline_message .= html_writer::end_tag('div');
+ $deadlinemessage .= html_writer::end_tag('div');
}
- $table_html = '
+ $tablehtml = '
- '.$deadline_header_text.' |
- '. $deadline_date.'
- '.$deadline_extension_message.'
- '. $deadline_message.' |
+ '.$deadlineheadertext.' |
+ '. $deadlinedate.'
+ '.$deadlineextensionmessage.'
+ '. $deadlinemessage.' |
';
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')
+ $generalfeedbackheader = get_string('generalfeedbackdeadline', 'coursework') . ': ';
+ $generalfeedbackdeadline = $coursework->get_general_feedback_deadline();
+ $generalfeedbackdeadlinemessage = $generalfeedbackdeadline
+ ? userdate($generalfeedbackdeadline, '%a, %d %b %Y, %H:%M')
: get_string('notset', 'coursework');
- $table_html .= '
+ $tablehtml .= '
- '. $general_feedback_header.' |
- '. $general_feedback_deadline_message.' |
+ '. $generalfeedbackheader.' |
+ '. $generalfeedbackdeadlinemessage.' |
';
@@ -1312,56 +1312,56 @@ protected function coursework_deadlines_table(mod_coursework_coursework $coursew
if ($coursework->individualfeedback) {
- $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')
+ $individualfeedbackheader = get_string('individualfeedback', 'coursework');
+ $individualfeedbackdeadline = $coursework->get_individual_feedback_deadline();
+ $indivisualfeedbackmessage = $individualfeedbackdeadline
+ ? userdate($individualfeedbackdeadline, '%a, %d %b %Y, %H:%M')
: get_string('notset', 'coursework');
- $table_html .= '
+ $tablehtml .= '
- '. $individual_feedback_header.' |
- '. $indivisual_feedback_message.' |
+ '. $individualfeedbackheader.' |
+ '. $indivisualfeedbackmessage.' |
';
}
- $table_html .= '
+ $tablehtml .= '
';
- return $table_html;
+ return $tablehtml;
}
/**
* @param \mod_coursework\allocation\table\row\builder $allocation_row
* @return string
*/
- private function render_allocation_table_row($allocation_row) {
+ private function render_allocation_table_row($allocationrow) {
- $row_html = '
-
+ $rowhtml = '
+
';
- $allocatable_cell_helper = $allocation_row->get_allocatable_cell();
- $row_html .= $allocatable_cell_helper->get_table_cell($allocation_row);
+ $allocatablecellhelper = $allocationrow->get_allocatable_cell();
+ $rowhtml .= $allocatablecellhelper->get_table_cell($allocationrow);
- foreach ($allocation_row->marking_stages() as $stage) {
+ foreach ($allocationrow->marking_stages() as $stage) {
if ($stage->uses_allocation() && $stage->identifier() != 'moderator') {
- $row_html .= $stage->get_allocation_table_cell($allocation_row->get_allocatable());
+ $rowhtml .= $stage->get_allocation_table_cell($allocationrow->get_allocatable());
}
}
// moderator
- if ($allocation_row->get_coursework()->moderation_agreement_enabled()) {
- $row_html .= $stage->get_moderation_table_cell($allocation_row->get_allocatable());
+ if ($allocationrow->get_coursework()->moderation_agreement_enabled()) {
+ $rowhtml .= $stage->get_moderation_table_cell($allocationrow->get_allocatable());
}
- $row_html .= ' ';
+ $rowhtml .= '';
- return $row_html;
+ return $rowhtml;
}
/**
@@ -1370,31 +1370,31 @@ 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) {
- $coursework_page_url = $this->get_router()->get_path('coursework', ['coursework' => $personal_deadlines_table->get_coursework()]);
- $table_html = ' '.html_writer::link($coursework_page_url, get_string('returntocourseworkpage', 'mod_coursework')).' ';
+ protected function render_mod_coursework_personal_deadlines_table(mod_coursework_personal_deadlines_table $personaldeadlinestable) {
+ $courseworkpageurl = $this->get_router()->get_path('coursework', ['coursework' => $personaldeadlinestable->get_coursework()]);
+ $tablehtml = ' '.html_writer::link($courseworkpageurl, get_string('returntocourseworkpage', 'mod_coursework')).' ';
- $table_html .= ' '.get_string('nopersonaldeadlineforextensionwarning', 'mod_coursework').' ';
+ $tablehtml .= ' '.get_string('nopersonaldeadlineforextensionwarning', 'mod_coursework').' ';
- $usergroups = $personal_deadlines_table->get_coursework()->get_allocatable_type();
+ $usergroups = $personaldeadlinestable->get_coursework()->get_allocatable_type();
- $table_html .= ' '.html_writer::link('#', get_string('setdateforselected', 'mod_coursework', $personal_deadlines_table->get_coursework()->get_allocatable_type()), ['id' => 'selected_dates']).' ';
+ $tablehtml .= ' '.html_writer::link('#', get_string('setdateforselected', 'mod_coursework', $personaldeadlinestable->get_coursework()->get_allocatable_type()), ['id' => 'selected_dates']).' ';
if (has_capability('mod/coursework:revertfinalised', $this->page->context)) {
- $table_html .= ' ' . html_writer::link('#', get_string('unfinaliseselected', 'mod_coursework', $personal_deadlines_table->get_coursework()->get_allocatable_type()), ['id' => 'selected_unfinalise']) . ' ';
+ $tablehtml .= ' ' . html_writer::link('#', get_string('unfinaliseselected', 'mod_coursework', $personaldeadlinestable->get_coursework()->get_allocatable_type()), ['id' => 'selected_unfinalise']) . ' ';
}
- $table_html .= ' ';
+ $tablehtml .= ' ';
$url = $this->get_router()->get_path('edit personal deadline', []);
- $table_html .= ' ';
+ $tablehtml .= '';
- return $table_html;
+ return $tablehtml;
}
@@ -1443,52 +1443,52 @@ protected function render_mod_coursework_personal_deadlines_table(mod_coursework
* @param \mod_coursework\personal_deadline\table\row\builder $personal_deadline_row
* @return string
*/
- private function render_personal_deadline_table_row($personal_deadline_row) {
+ private function render_personal_deadline_table_row($personaldeadlinerow) {
global $USER;
- $coursework = $personal_deadline_row->get_coursework();
+ $coursework = $personaldeadlinerow->get_coursework();
- $new_personal_deadline_params = [
- 'allocatableid' => $personal_deadline_row->get_allocatable()->id(),
- 'allocatabletype' => $personal_deadline_row->get_allocatable()->type(),
- 'courseworkid' => $personal_deadline_row->get_coursework()->id,
+ $newpersonaldeadlineparams = [
+ 'allocatableid' => $personaldeadlinerow->get_allocatable()->id(),
+ 'allocatabletype' => $personaldeadlinerow->get_allocatable()->type(),
+ 'courseworkid' => $personaldeadlinerow->get_coursework()->id,
];
//$personal_deadline = \mod_coursework\models\personal_deadline::find($new_personal_deadline_params);
- $personal_deadline =
- \mod_coursework\models\personal_deadline::get_personal_deadline_for_student(user::find($personal_deadline_row->get_allocatable()->id()), $coursework);
+ $personaldeadline =
+ \mod_coursework\models\personal_deadline::get_personal_deadline_for_student(user::find($personaldeadlinerow->get_allocatable()->id()), $coursework);
- if (!$personal_deadline) {
- $personal_deadline = \mod_coursework\models\personal_deadline::build($new_personal_deadline_params);
+ if (!$personaldeadline) {
+ $personaldeadline = \mod_coursework\models\personal_deadline::build($newpersonaldeadlineparams);
}
$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 .= '';
- $row_html .= '';
- $row_html .= ' | ';
-
- $new_personal_deadline_params = [
- 'allocatableid' => $personal_deadline_row->get_allocatable()->id(),
- 'allocatabletype' => $personal_deadline_row->get_allocatable()->type(),
- 'courseworkid' => $personal_deadline_row->get_coursework()->id,
+ $disabledelement = (!$personaldeadline ||($personaldeadline && $ability->can('edit', $personaldeadline)) ) ? "" : " disabled='disabled' ";
+
+ $rowhtml = ' ';
+ $rowhtml .= '';
+ $rowhtml .= '';
+ $rowhtml .= '';
+ $rowhtml .= ' | ';
+
+ $newpersonaldeadlineparams = [
+ 'allocatableid' => $personaldeadlinerow->get_allocatable()->id(),
+ 'allocatabletype' => $personaldeadlinerow->get_allocatable()->type(),
+ 'courseworkid' => $personaldeadlinerow->get_coursework()->id,
'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);
- $row_html .= $personaldeadlines_cell_helper->get_table_cell($personal_deadline_row);
- $row_html .= '';
- $row_html .= "".$personal_deadline_row->get_submission_status()." | ";
- $row_html .= ' ';
+ $allocatablecellhelper = $personaldeadlinerow->get_allocatable_cell();
+ $personaldeadlinescellhelper = $personaldeadlinerow->get_personal_deadline_cell();
+ $rowhtml .= $allocatablecellhelper->get_table_cell($personaldeadlinerow);
+ $rowhtml .= $personaldeadlinescellhelper->get_table_cell($personaldeadlinerow);
+ $rowhtml .= '';
+ $rowhtml .= " ".$personaldeadlinerow->get_submission_status()." | ";
+ $rowhtml .= '';
- return $row_html;
+ return $rowhtml;
}
/**
@@ -1499,9 +1499,9 @@ private function render_personal_deadline_table_row($personal_deadline_row) {
protected function coursework_grading_summary_table(mod_coursework_coursework $coursework) {
global $USER;
- $gradedHeader = "";
+ $gradedheader = "";
- $warning_message = "";
+ $warningmessage = "";
$stagename = $coursework->has_multiple_markers() ? ' (Agreed grade)' : '';
$participants = 0;
@@ -1514,44 +1514,44 @@ protected function coursework_grading_summary_table(mod_coursework_coursework $c
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 | ";
+ $warningmessage = " You don't have a capability to grade anyone in this Coursework | ";
} else {
$participants = $this->get_allocatables_count_per_assessor($coursework);
$allsubmissions = $coursework->get_all_submissions();
- $assessable_submitted_submissions = $this->get_submissions_for_assessor($coursework, $allsubmissions);
- $submitted = count($assessable_submitted_submissions);
+ $assessablesubmittedsubmissions = $this->get_submissions_for_assessor($coursework, $allsubmissions);
+ $submitted = count($assessablesubmittedsubmissions);
- $assessable_submitted_submissions = $this->remove_unfinalised_submissions($assessable_submitted_submissions);
+ $assessablesubmittedsubmissions = $this->remove_unfinalised_submissions($assessablesubmittedsubmissions);
- $assessable_submitted_submissions = $this->remove_ungradable_submissions($assessable_submitted_submissions);
+ $assessablesubmittedsubmissions = $this->remove_ungradable_submissions($assessablesubmittedsubmissions);
// Remove all submission with final grade
- $assessable_submitted_submissions = $this->removed_final_graded_submissions($assessable_submitted_submissions);
+ $assessablesubmittedsubmissions = $this->removed_final_graded_submissions($assessablesubmittedsubmissions);
// If has addagreedgrade or administergrade or addallocatedagreedgrade+initialgrade
if (has_any_capability(['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
- $numberofassessable = count($assessable_submitted_submissions);
+ $numberofassessable = count($assessablesubmittedsubmissions);
- $assessable_submitted_submissions = $this->remove_final_gradable_submissions($assessable_submitted_submissions);
+ $assessablesubmittedsubmissions = $this->remove_final_gradable_submissions($assessablesubmittedsubmissions);
- $needsgrading = $numberofassessable - count($assessable_submitted_submissions);
+ $needsgrading = $numberofassessable - count($assessablesubmittedsubmissions);
}
// If has initialgrade
if (has_any_capability(['mod/coursework:addinitialgrade', 'mod/coursework:administergrades'], $coursework->get_context())) {
- $assessable_submitted_submissions = $this->remove_final_gradable_submissions($assessable_submitted_submissions);
- $needsgrading += count($this->get_assessor_initial_graded_submissions($assessable_submitted_submissions));
+ $assessablesubmittedsubmissions = $this->remove_final_gradable_submissions($assessablesubmittedsubmissions);
+ $needsgrading += count($this->get_assessor_initial_graded_submissions($assessablesubmittedsubmissions));
}
- $graded_submissions = $this->get_submissions_with_final_grade($this->get_submissions_for_assessor($coursework, $allsubmissions));
- $graded = count($graded_submissions);
+ $gradedsubmissions = $this->get_submissions_with_final_grade($this->get_submissions_for_assessor($coursework, $allsubmissions));
+ $graded = count($gradedsubmissions);
$finalgrade = $graded;
// display breakdown of marks for initial stages
@@ -1562,7 +1562,7 @@ protected function coursework_grading_summary_table(mod_coursework_coursework $c
$initialassessorno = substr("$stage", -1);
$gradedsubmissions = $coursework->get_graded_submissions_by_stage($stage);
$grade = count($this->get_submissions_for_assessor($coursework, $gradedsubmissions));
- $gradedHeader .= " " . get_string('initialassessorno', 'mod_coursework', $initialassessorno);
+ $gradedheader .= " " . get_string('initialassessorno', 'mod_coursework', $initialassessorno);
$finalgrade .= " " . $grade;
}
}
@@ -1574,26 +1574,26 @@ protected function coursework_grading_summary_table(mod_coursework_coursework $c
}
// BUILD table
- $table_html = ' ';
- $table_html .= $warning_message;
+ $tablehtml = '';
+ $tablehtml .= $warningmessage;
// participants row
- $table_html .= ''.get_string('participants', 'mod_coursework').' | '.$participants.' | ';
+ $tablehtml .= ''.get_string('participants', 'mod_coursework').' | '.$participants.' | ';
// number of submission row
- $table_html .= ''.get_string('submitted', 'mod_coursework').' | '.$submitted.' | ';
+ $tablehtml .= ''.get_string('submitted', 'mod_coursework').' | '.$submitted.' | ';
// submissions needs grading row
- $table_html .= ''.get_string('needsgrading', 'mod_coursework').' | '.$needsgrading.' | ';
+ $tablehtml .= ''.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 . ' | ';
+ $tablehtml .= '' . get_string('graded', 'mod_coursework') . $stagename . $gradedheader . ' | ' . $graded . ' | ';
} else {
- $table_html .= '' . get_string('graded', 'mod_coursework') . $stagename . $gradedHeader . ' | ' . $finalgrade . ' | ';
+ $tablehtml .= '' . get_string('graded', 'mod_coursework') . $stagename . $gradedheader . ' | ' . $finalgrade . ' | ';
}
// submissions graded and published
- $table_html .= ''.get_string('gradedandpublished', 'mod_coursework').' | '.$published.' | ';
+ $tablehtml .= ''.get_string('gradedandpublished', 'mod_coursework').' | '.$published.' | ';
- $table_html .= ' ';
+ $tablehtml .= ' ';
- return $table_html;
+ return $tablehtml;
}
/**
diff --git a/settings.php b/settings.php
index c4504533..12238a09 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->add($settings_header);
+ $settingsheader = new admin_setting_heading('settings_header', '', get_string('settings_header', 'mod_coursework'));
+ $settings->add($settingsheader);
// Set site-wide option for late submission
- $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');
+ $availabilityheader = new admin_setting_heading('availability_header', get_string('availability', 'mod_coursework'), '');
+ $settings->add($availabilityheader);
+ $allowlatesubmissionname = get_string('allowlatesubmissions', 'coursework');
+ $allowlatesubmissiondescription = get_string('allowlatesubmissions_desc', 'coursework');
$options = [ 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));
+ $allowlatesubmissionname, $allowlatesubmissiondescription, 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'), '');
- $settings->add($submissions_header);
+ $submissionsheader = new admin_setting_heading('submissions_header', get_string('submissions', 'mod_coursework'), '');
+ $settings->add($submissionsheader);
$configmaxbytesstring = get_string('configmaxbytes', 'coursework');
$maximumsizestring = get_string('maximumsize', 'coursework');
$maxbytessetting = new admin_setting_configselect('coursework_maxbytes',
@@ -54,41 +54,41 @@
}
// Submissions
- $submissions_header = new admin_setting_heading('submissions_header', get_string('submissions', 'mod_coursework'), '');
- $settings->add($submissions_header);
+ $submissionsheader = new admin_setting_heading('submissions_header', get_string('submissions', 'mod_coursework'), '');
+ $settings->add($submissionsheader);
$options = [ 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);
+ $submissionreceiptheader = new admin_setting_heading('submissionreceipt_header', get_string('submissionreceipt', 'mod_coursework'), '');
+ $settings->add($submissionreceiptheader);
$options = [ 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);
- $blind_marking_name = get_string('blindmarking', 'coursework');
- $blind_marking_description = get_string('blindmarking_desc', 'coursework');
+ $blindmarkingheader = new admin_setting_heading('blindmarking_header', get_string('blindmarking', 'mod_coursework'), '');
+ $settings->add($blindmarkingheader);
+ $blindmarkingname = get_string('blindmarking', 'coursework');
+ $blindmarkingdescription = get_string('blindmarking_desc', 'coursework');
$options = [ 0 => get_string('no'), 1 => get_string('yes')];
- $settings->add(new admin_setting_configselect('coursework_blindmarking', $blind_marking_name, $blind_marking_description, 0, $options));
+ $settings->add(new admin_setting_configselect('coursework_blindmarking', $blindmarkingname, $blindmarkingdescription, 0, $options));
$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'), '');
- $settings->add($assessoranonymity_header);
- $assessor_anonymity_name = get_string('assessoranonymity', 'coursework');
- $assessor_anonymity_description = get_string('assessoranonymity_desc', 'coursework');
+ $assessoranonymityheader = new admin_setting_heading('assessoranonymity_header', get_string('assessoranonymity', 'mod_coursework'), '');
+ $settings->add($assessoranonymityheader);
+ $assessoranonymityname = get_string('assessoranonymity', 'coursework');
+ $assessoranonymitydescription = get_string('assessoranonymity_desc', 'coursework');
$options = [ 0 => get_string('no'), 1 => get_string('yes')];
- $settings->add(new admin_setting_configselect('coursework_assessoranonymity', $assessor_anonymity_name, $assessor_anonymity_description, 0, $options));
+ $settings->add(new admin_setting_configselect('coursework_assessoranonymity', $assessoranonymityname, $assessoranonymitydescription, 0, $options));
// Set site-wide options for when feedback is due.
$weeks = [];
for ($i = 1; $i <= 10; $i++) {
$weeks[$i] = $i;
}
- $feedbacktypes_header = new admin_setting_heading('feedbacktypes_header', get_string('feedbacktypes', 'mod_coursework'), '');
- $settings->add($feedbacktypes_header);
+ $feedbacktypesheader = new admin_setting_heading('feedbacktypes_header', get_string('feedbacktypes', 'mod_coursework'), '');
+ $settings->add($feedbacktypesheader);
$generalfeedbackstring = get_string('generalfeedback', 'coursework');
$configgeneralfeedbackstring = get_string('configgeneralfeedback', 'coursework');
$generalfeedbacksetting = new admin_setting_configselect('coursework_generalfeedback',
@@ -98,10 +98,10 @@
$settings->add($generalfeedbacksetting);
// enable auto-release of individual feedback
- $individual_feedback_auto_release_name = get_string('individual_feedback_auto_release', 'coursework');
- $individual_feedback_auto_release_name_description = get_string('individual_feedback_auto_release_desc', 'coursework');
+ $individualfeedbackautoreleasename = get_string('individual_feedback_auto_release', 'coursework');
+ $individualfeedbackautoreleasenamedescription = get_string('individual_feedback_auto_release_desc', 'coursework');
$options = [ 0 => get_string('no'), 1 => get_string('yes')];
- $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_configselect('coursework_auto_release_individual_feedback', $individualfeedbackautoreleasename, $individualfeedbackautoreleasenamedescription, 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');
@@ -113,56 +113,56 @@
$settings->add($individualfeedbacksetting);
// Feedback release email
- $feedbackreleaseemail_name = get_string('feedbackreleaseemail', 'coursework');
- $feedbackreleaseemail_description = get_string('feedbackreleaseemail_help', 'coursework');
+ $feedbackreleaseemailname = get_string('feedbackreleaseemail', 'coursework');
+ $feedbackreleaseemaildescription = get_string('feedbackreleaseemail_help', 'coursework');
$options = [ 0 => get_string('no'), 1 => get_string('yes')];
- $settings->add(new admin_setting_configselect('coursework_feedbackreleaseemail', $feedbackreleaseemail_name, $feedbackreleaseemail_description, 1, $options));
+ $settings->add(new admin_setting_configselect('coursework_feedbackreleaseemail', $feedbackreleaseemailname, $feedbackreleaseemaildescription, 1, $options));
- $day_reminder = [];
+ $dayreminder = [];
for ($i = 2; $i <= 7; $i++) {
- $day_reminder[$i] = $i;
+ $dayreminder[$i] = $i;
}
- $studentreminder_header = new admin_setting_heading('studentreminder_header', get_string('studentreminder', 'mod_coursework'), '');
- $settings->add($studentreminder_header);
+ $studentreminderheader = new admin_setting_heading('studentreminder_header', get_string('studentreminder', 'mod_coursework'), '');
+ $settings->add($studentreminderheader);
$reminderstring = get_string('coursework_reminder', 'coursework');
$confreminderstring = get_string('config_coursework_reminder', 'coursework');
$settings->add(new admin_setting_configselect('coursework_day_reminder', $reminderstring,
- $confreminderstring, 7, $day_reminder));
+ $confreminderstring, 7, $dayreminder));
$secondreminderstring = get_string('second_reminder', 'coursework');
$confsecondreminderstring = get_string('config_second_reminder', 'coursework');
$settings->add(new admin_setting_configselect('coursework_day_second_reminder', $secondreminderstring,
- $confsecondreminderstring, 3, $day_reminder));
+ $confsecondreminderstring, 3, $dayreminder));
// 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);
- $agree_terms_name = get_string('agreeterms', 'coursework');
- $agree_terms_description = get_string('agreetermsdescription', 'coursework');
+ $termsagreementheader = new admin_setting_heading('termsagreement_header', get_string('termsagreement', 'mod_coursework'), '');
+ $settings->add($termsagreementheader);
+ $agreetermsname = get_string('agreeterms', 'coursework');
+ $agreetermsdescription = get_string('agreetermsdescription', 'coursework');
$options = [ 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));
+ $agreetermsname, $agreetermsdescription, 0, $options));
- $agree_terms_text = get_string('agreetermstext', 'coursework');
+ $agreetermstext = get_string('agreetermstext', 'coursework');
$settings->add(new admin_setting_confightmleditor('coursework_agree_terms_text',
- $agree_terms_text, '', ''));
+ $agreetermstext, '', ''));
// Extensions
- $extensions_header =
+ $extensionsheader =
new admin_setting_heading('extensions_header', get_string('extensions', 'mod_coursework'), '');
- $settings->add($extensions_header);
+ $settings->add($extensionsheader);
// Enable coursework individual extensions
- $individual_extension_name = get_string('individual_extension', 'coursework');
- $individual_extension_description = get_string('individual_extension_desc', 'coursework');
+ $individualextensionname = get_string('individual_extension', 'coursework');
+ $individualextensiondescription = get_string('individual_extension_desc', 'coursework');
$options = [ 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));
+ $settings->add(new admin_setting_configselect('coursework_individual_extension', $individualextensionname, $individualextensiondescription, 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');
+ $extensionlistlabel = get_string('extension_reasons', 'coursework');
+ $extensionlistdescription = get_string('extension_reasons_desc', 'coursework');
$settings->add(new admin_setting_configtextarea('coursework_extension_reasons_list',
- $extension_list_label, $extension_list_description, ''));
+ $extensionlistlabel, $extensionlistdescription, ''));
// maximum extension deadline
$settings->add(new admin_setting_configtext('coursework_max_extension_deadline', get_string('maximum_extension_deadline', 'coursework'),
@@ -173,12 +173,12 @@
$options = ['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);
+ $gradingpageheader = new admin_setting_heading('grading_page_header', get_string('grading_page', 'mod_coursework'), '');
+ $settings->add($gradingpageheader);
- $per_page = get_string('per_page', 'coursework');
- $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));
+ $perpage = get_string('per_page', 'coursework');
+ $perpagedescription = get_string('per_page_desc', 'coursework');
+ $settings->add(new admin_setting_configselect('coursework_per_page', $perpage, $perpagedescription, '10', $options));
// Automatic agreement delay
@@ -190,16 +190,16 @@
$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);
+ $gradeeditingheader = new admin_setting_heading('grade_editing_header', get_string('grade_editing', 'mod_coursework'), '');
+ $settings->add($gradeeditingheader);
- $grade_editing_name = get_string('grade_editing_enabled', 'coursework');
- $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));
+ $gradeeditingname = get_string('grade_editing_enabled', 'coursework');
+ $gradeeditingdescription = get_string('grade_editing_enabled_desc', 'coursework');
+ $settings->add(new admin_setting_configselect('coursework_grade_editing', $gradeeditingname, $gradeeditingdescription, '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);
+ $deadlinedefaultsheader = new admin_setting_heading('deadline_defaults_header', get_string('deadline_defaults', 'mod_coursework'), '');
+ $settings->add($deadlinedefaultsheader);
// Marking deadline
$options = ['0' => get_string('disabled', 'mod_coursework')];
@@ -209,9 +209,9 @@
$options['28'] = get_string('fourweeksoption', 'mod_coursework');
$options['35'] = get_string('fiveweeksoption', 'mod_coursework');
$options['42'] = get_string('sixweeksoption', 'mod_coursework');
- $marking_deadline_name = get_string('marking_deadline_default', 'coursework');
- $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));
+ $markingdeadlinename = get_string('marking_deadline_default', 'coursework');
+ $markingdeadlinedescription = get_string('marking_deadline_enabled_desc', 'coursework');
+ $settings->add(new admin_setting_configselect('coursework_marking_deadline', $markingdeadlinename, $markingdeadlinedescription, '0', $options));
// Marking deadline
$options = ['0' => get_string('disabled', 'mod_coursework')];
@@ -222,17 +222,17 @@
$options['35'] = get_string('fiveweeksoption', 'mod_coursework');
$options['42'] = get_string('sixweeksoption', 'mod_coursework');
- $agreed_marking_deadline_name = get_string('agreed_marking_deadline_default', 'coursework');
- $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));
+ $agreedmarkingdeadlinename = get_string('agreed_marking_deadline_default', 'coursework');
+ $agreedmarkingdeadlinedescription = get_string('agreed_marking_deadline_default_desc', 'coursework');
+ $settings->add(new admin_setting_configselect('coursework_agreed_marking_deadline', $agreedmarkingdeadlinename, $agreedmarkingdeadlinedescription, '0', $options));
// Start date
$options = ['0' => get_string('disabled', 'mod_coursework')];
$options['1'] = get_string('today', 'mod_coursework');
- $start_date_name = get_string('startdate', 'coursework');
- $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));
+ $startdatename = get_string('startdate', 'coursework');
+ $startdatedescription = get_string('start_date_enabled_desc', 'coursework');
+ $settings->add(new admin_setting_configselect('coursework_start_date', $startdatename, $startdatedescription, '0', $options));
// Submission deadline
$options = ['0' => get_string('disabled', 'mod_coursework')];
@@ -241,13 +241,13 @@
$options['14'] = get_string('fourteendays', 'mod_coursework');
$options['31'] = get_string('onemonth', 'mod_coursework');
- $submission_deadline_name = get_string('submissiondeadline', 'coursework');
- $submission_deadline_description = get_string('submission_deadline_enabled_desc', 'coursework');
- $settings->add(new admin_setting_configselect('coursework_submission_deadline', $submission_deadline_name, $submission_deadline_description, '0', $options));
+ $submissiondeadlinename = get_string('submissiondeadline', 'coursework');
+ $submissiondeadlinedescription = get_string('submission_deadline_enabled_desc', 'coursework');
+ $settings->add(new admin_setting_configselect('coursework_submission_deadline', $submissiondeadlinename, $submissiondeadlinedescription, '0', $options));
// Assessor allocations
- $assessor_allocations_header = new admin_setting_heading('assessor_allocations_header_header', get_string('assessorallocations', 'mod_coursework'), '');
- $settings->add($assessor_allocations_header);
+ $assessorallocationsheader = new admin_setting_heading('assessor_allocations_header_header', get_string('assessorallocations', 'mod_coursework'), '');
+ $settings->add($assessorallocationsheader);
$options = [ 'username' => get_string('username'), 'email' => get_string('email')];
$settings->add(new admin_setting_configselect('coursework_allocation_identifier', get_string('allocationidentifier', 'coursework'), get_string('allocationidentifier_desc', 'coursework'), 'username', $options));
diff --git a/tests/behat/pages/coursework_page.php b/tests/behat/pages/coursework_page.php
index 1e2ca213..59bfa617 100644
--- a/tests/behat/pages/coursework_page.php
+++ b/tests/behat/pages/coursework_page.php
@@ -41,8 +41,8 @@ class mod_coursework_behat_coursework_page extends mod_coursework_behat_page_bas
*/
public function individual_feedback_date_present() {
$table = $this->getPage()->find('css', 'table.deadlines');
- $table_header_present = strpos($table->getText(), 'utomatically release individual feedback') !== false;
- return $table_header_present;
+ $tableheaderpresent = strpos($table->getText(), 'utomatically release individual feedback') !== false;
+ return $tableheaderpresent;
}
/**
@@ -50,8 +50,8 @@ public function individual_feedback_date_present() {
*/
public function general_feedback_date_present() {
$table = $this->getPage()->find('css', 'table.deadlines');
- $table_header_present = strpos($table->getText(), 'General feedback deadline');
- return $table_header_present !== false;
+ $tableheaderpresent = strpos($table->getText(), 'General feedback deadline');
+ return $tableheaderpresent !== false;
}
public function confirm() {
@@ -68,21 +68,21 @@ public function show_hide_non_allocated_students() {
}
}
- public function get_coursework_name($courseworkName) {
- $coursework_heading = $this->getPage()->find('css', 'h2');
- $coursework_heading_present = strpos($coursework_heading->getText(), $courseworkName);
+ public function get_coursework_name($courseworkname) {
+ $courseworkheading = $this->getPage()->find('css', 'h2');
+ $courseworkheadingpresent = strpos($courseworkheading->getText(), $courseworkname);
- return $coursework_heading_present !== false;
+ return $courseworkheadingpresent !== false;
}
- public function get_coursework_student_name($studentName) {
- $table_users = $this->getPage()->findAll('css', 'table.submissions');
+ public function get_coursework_student_name($studentname) {
+ $tableusers = $this->getPage()->findAll('css', 'table.submissions');
- if (!empty($table_users)) {
- foreach ($table_users as $table_user) {
- $coursework_student_name = strpos($table_user->getText(), $studentName);
+ if (!empty($tableusers)) {
+ foreach ($tableusers as $tableuser) {
+ $courseworkstudentname = strpos($tableuser->getText(), $studentname);
- if ($coursework_student_name !== false) {
+ if ($courseworkstudentname !== false) {
return true;
}
}
diff --git a/tests/classes/rule_test.php b/tests/classes/rule_test.php
index 68fcd3b6..814f003f 100644
--- a/tests/classes/rule_test.php
+++ b/tests/classes/rule_test.php
@@ -32,37 +32,37 @@ class abiity_rule_test extends basic_testcase {
public function test_allows_when_allowed_and_rule_returns_true() {
$coursework = new \mod_coursework\models\coursework();
- $rule_function = function ($object) {
+ $rulefunction = function ($object) {
return true;
};
- $rule = new rule('set on fire', 'mod_coursework\models\coursework', $rule_function, true );
+ $rule = new rule('set on fire', 'mod_coursework\models\coursework', $rulefunction, true );
$this->assertTrue($rule->allows($coursework));
}
public function test_allows_when_prevent_and_rule_returns_true() {
$coursework = new \mod_coursework\models\coursework();
- $rule_function = function ($object) {
+ $rulefunction = function ($object) {
return true;
};
- $rule = new rule('set on fire', 'mod_coursework\models\coursework', $rule_function, false);
+ $rule = new rule('set on fire', 'mod_coursework\models\coursework', $rulefunction, false);
$this->assertFalse($rule->allows($coursework));
}
public function test_prevents_when_allowed_and_rule_returns_true() {
$coursework = new \mod_coursework\models\coursework();
- $rule_function = function ($object) {
+ $rulefunction = function ($object) {
return true;
};
- $rule = new rule('set on fire', 'mod_coursework\models\coursework', $rule_function, true);
+ $rule = new rule('set on fire', 'mod_coursework\models\coursework', $rulefunction, true);
$this->assertFalse($rule->prevents($coursework));
}
public function test_prevents_when_prevent_and_rule_returns_true() {
$coursework = new \mod_coursework\models\coursework();
- $rule_function = function ($object) {
+ $rulefunction = function ($object) {
return true;
};
- $rule = new rule('set on fire', 'mod_coursework\models\coursework', $rule_function, false);
+ $rule = new rule('set on fire', 'mod_coursework\models\coursework', $rulefunction, false);
$this->assertTrue($rule->prevents($coursework));
}
@@ -70,37 +70,37 @@ public function test_prevents_when_prevent_and_rule_returns_true() {
public function test_allows_when_allowed_and_rule_returns_false() {
$coursework = new \mod_coursework\models\coursework();
- $rule_function = function ($object) {
+ $rulefunction = function ($object) {
return false;
};
- $rule = new rule('set on fire', 'mod_coursework\models\coursework', $rule_function, true);
+ $rule = new rule('set on fire', 'mod_coursework\models\coursework', $rulefunction, true);
$this->assertFalse($rule->allows($coursework));
}
public function test_allows_when_prevent_and_rule_returns_false() {
$coursework = new \mod_coursework\models\coursework();
- $rule_function = function ($object) {
+ $rulefunction = function ($object) {
return false;
};
- $rule = new rule('set on fire', 'mod_coursework\models\coursework', $rule_function, false);
+ $rule = new rule('set on fire', 'mod_coursework\models\coursework', $rulefunction, false);
$this->assertFalse($rule->allows($coursework));
}
public function test_prevents_when_allowed_and_rule_returns_false() {
$coursework = new \mod_coursework\models\coursework();
- $rule_function = function ($object) {
+ $rulefunction = function ($object) {
return false;
};
- $rule = new rule('set on fire', 'mod_coursework\models\coursework', $rule_function, true);
+ $rule = new rule('set on fire', 'mod_coursework\models\coursework', $rulefunction, true);
$this->assertFalse($rule->prevents($coursework));
}
public function test_prevents_when_prevent_and_rule_returns_false() {
$coursework = new \mod_coursework\models\coursework();
- $rule_function = function ($object) {
+ $rulefunction = function ($object) {
return false;
};
- $rule = new rule('set on fire', 'mod_coursework\models\coursework', $rule_function, false);
+ $rule = new rule('set on fire', 'mod_coursework\models\coursework', $rulefunction, false);
$this->assertFalse($rule->prevents($coursework));
}
}
diff --git a/view.php b/view.php
index c20919aa..e4d23009 100644
--- a/view.php
+++ b/view.php
@@ -53,11 +53,11 @@
$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);
+$coursemoduleid = optional_param('id', 0, PARAM_INT);
+$courseworkid = optional_param('e', 0, PARAM_INT);
// Hacky fix for the need for the form to self-submit to this page.
-if (!$coursework_id) {
- $coursework_id = optional_param('courseworkid', 0, PARAM_INT);
+if (!$courseworkid) {
+ $courseworkid = optional_param('courseworkid', 0, PARAM_INT);
}
$publish = optional_param('publishbutton', 0, PARAM_ALPHA);
$download = optional_param('download', false, PARAM_BOOL);
@@ -65,184 +65,184 @@
$resubmitted = optional_param('resubmitted', 0, PARAM_INT); // Is this a post-resubmit redirect?
$submissionid = optional_param('submissionid', 0, PARAM_INT); // Which thing to resubmit.
$confirm = optional_param('confirm', 0, PARAM_INT);
-$export_grades = optional_param('export', false, PARAM_BOOL);
-$download_grading_sheet = optional_param('export_grading_sheet', false, PARAM_BOOL);
+$exportgrades = optional_param('export', false, PARAM_BOOL);
+$downloadgradingsheet = optional_param('export_grading_sheet', false, PARAM_BOOL);
$group = optional_param('group', -1, PARAM_INT);
$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);
+if (!isset($SESSION->displayallstudents[$coursemoduleid])) {
+ $SESSION->displayallstudents[$coursemoduleid] = optional_param('displayallstudents', false, PARAM_BOOL);
- $displayallstudents = $SESSION->displayallstudents[$course_module_id];
+ $displayallstudents = $SESSION->displayallstudents[$coursemoduleid];
} else {
- $displayallstudents = optional_param('displayallstudents', $SESSION->displayallstudents[$course_module_id], PARAM_INT);
- $SESSION->displayallstudents[$course_module_id] = $displayallstudents;
+ $displayallstudents = optional_param('displayallstudents', $SESSION->displayallstudents[$coursemoduleid], PARAM_INT);
+ $SESSION->displayallstudents[$coursemoduleid] = $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]
+if (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
$page = 0;
- $SESSION->page[$course_module_id] = $page;
-} else if (!(isset($SESSION->page[$course_module_id]))) {
- $SESSION->page[$course_module_id] = optional_param('page', 0, PARAM_INT);
- $page = $SESSION->page[$course_module_id];
+ $SESSION->page[$coursemoduleid] = $page;
+} else if (!(isset($SESSION->page[$coursemoduleid]))) {
+ $SESSION->page[$coursemoduleid] = optional_param('page', 0, PARAM_INT);
+ $page = $SESSION->page[$coursemoduleid];
} else {
- $page = optional_param('page', $SESSION->page[$course_module_id], PARAM_INT);
- $SESSION->page[$course_module_id] = $page;
+ $page = optional_param('page', $SESSION->page[$coursemoduleid], PARAM_INT);
+ $SESSION->page[$coursemoduleid] = $page;
}
// If a session variable holding perpage preference for the specific coursework is not set, set default value (grab default value from global setting).
-if (!(isset($SESSION->perpage[$course_module_id]))) {
- $SESSION->perpage[$course_module_id] = optional_param('per_page', $CFG->coursework_per_page, PARAM_INT);
- $perpage = $SESSION->perpage[$course_module_id];
+if (!(isset($SESSION->perpage[$coursemoduleid]))) {
+ $SESSION->perpage[$coursemoduleid] = optional_param('per_page', $CFG->coursework_per_page, PARAM_INT);
+ $perpage = $SESSION->perpage[$coursemoduleid];
} else {
- $perpage = optional_param('per_page', $SESSION->perpage[$course_module_id], PARAM_INT);
- $SESSION->perpage[$course_module_id] = $perpage;
+ $perpage = optional_param('per_page', $SESSION->perpage[$coursemoduleid], PARAM_INT);
+ $SESSION->perpage[$coursemoduleid] = $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);
- $sortby = $SESSION->sortby[$course_module_id];
+if (!(isset($SESSION->sortby[$coursemoduleid]))) {
+ $SESSION->sortby[$coursemoduleid] = optional_param('sortby', 'lastname', PARAM_ALPHA);
+ $sortby = $SESSION->sortby[$coursemoduleid];
} else {
- $sortby = optional_param('sortby', $SESSION->sortby[$course_module_id], PARAM_ALPHA);
- $SESSION->sortby[$course_module_id] = $sortby;
+ $sortby = optional_param('sortby', $SESSION->sortby[$coursemoduleid], PARAM_ALPHA);
+ $SESSION->sortby[$coursemoduleid] = $sortby;
}
// If a session variable holding sorthow preference for the specific coursework is not set, set default value ('ASC').
-if (!(isset($SESSION->sorthow[$course_module_id]))) {
- $SESSION->sorthow[$course_module_id] = optional_param('sorthow', 'ASC', PARAM_ALPHA);
- $sorthow = $SESSION->sorthow[$course_module_id];
+if (!(isset($SESSION->sorthow[$coursemoduleid]))) {
+ $SESSION->sorthow[$coursemoduleid] = optional_param('sorthow', 'ASC', PARAM_ALPHA);
+ $sorthow = $SESSION->sorthow[$coursemoduleid];
} else {
- $sorthow = optional_param('sorthow', $SESSION->sorthow[$course_module_id], PARAM_ALPHA);
- $SESSION->sorthow[$course_module_id] = $sorthow;
+ $sorthow = optional_param('sorthow', $SESSION->sorthow[$coursemoduleid], PARAM_ALPHA);
+ $SESSION->sorthow[$coursemoduleid] = $sorthow;
}
// 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];
+if (!(isset($SESSION->coursework_firstname_alpha[$coursemoduleid]))) {
+ $SESSION->coursework_firstname_alpha[$coursemoduleid] = optional_param('coursework_firstname_alpha', '', PARAM_ALPHA);
+ $courseworkfirstnamealpha = $SESSION->coursework_firstname_alpha[$coursemoduleid];
} else {
- $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;
+ $courseworkfirstnamealpha = optional_param('coursework_firstname_alpha', $SESSION->coursework_firstname_alpha[$coursemoduleid], PARAM_ALPHA);
+ $SESSION->coursework_firstname_alpha[$coursemoduleid] = $courseworkfirstnamealpha;
}
// 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];
+if (!(isset($SESSION->coursework_lastname_alpha[$coursemoduleid]))) {
+ $SESSION->coursework_lastname_alpha[$coursemoduleid] = optional_param('coursework_lastname_alpha', '', PARAM_ALPHA);
+ $courseworklastnamealpha = $SESSION->coursework_lastname_alpha[$coursemoduleid];
} 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;
+ $courseworklastnamealpha = optional_param('coursework_lastname_alpha', $SESSION->coursework_lastname_alpha[$coursemoduleid], PARAM_ALPHA);
+ $SESSION->coursework_lastname_alpha[$coursemoduleid] = $courseworklastnamealpha;
}
// 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];
+if (!(isset($SESSION->coursework_groupname_alpha[$coursemoduleid]))) {
+ $SESSION->coursework_groupname_alpha[$coursemoduleid] = optional_param('coursework_groupname_alpha', '', PARAM_ALPHA);
+ $courseworkgroupnamealpha = $SESSION->coursework_groupname_alpha[$coursemoduleid];
} else {
- $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;
+ $courseworkgroupnamealpha = optional_param('coursework_groupname_alpha', $SESSION->coursework_groupname_alpha[$coursemoduleid], PARAM_ALPHA);
+ $SESSION->coursework_groupname_alpha[$coursemoduleid] = $courseworkgroupnamealpha;
}
// 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]
+if (isset($SESSION->viewallstudents_perpage[$coursemoduleid]) && optional_param('viewallstudents_per_page', 0, PARAM_INT) != $SESSION->viewallstudents_perpage[$coursemoduleid]
&& 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]))) {
- $SESSION->viewallstudents_page[$course_module_id] = optional_param('viewallstudents_page', 0, PARAM_INT);
- $viewallstudents_page = $SESSION->viewallstudents_page[$course_module_id];
+ $viewallstudentspage = 0;
+ $SESSION->viewallstudents_page[$coursemoduleid] = $viewallstudentspage;
+} else if (!(isset($SESSION->viewallstudents_page[$coursemoduleid]))) {
+ $SESSION->viewallstudents_page[$coursemoduleid] = optional_param('viewallstudents_page', 0, PARAM_INT);
+ $viewallstudentspage = $SESSION->viewallstudents_page[$coursemoduleid];
} else {
- $viewallstudents_page = optional_param('viewallstudents_page', $SESSION->viewallstudents_page[$course_module_id], PARAM_INT);
- $SESSION->viewallstudents_page[$course_module_id] = $viewallstudents_page;
+ $viewallstudentspage = optional_param('viewallstudents_page', $SESSION->viewallstudents_page[$coursemoduleid], PARAM_INT);
+ $SESSION->viewallstudents_page[$coursemoduleid] = $viewallstudentspage;
}
// 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];
+if (!(isset($SESSION->viewallstudents_perpage[$coursemoduleid]))) {
+ $SESSION->viewallstudents_perpage[$coursemoduleid] = optional_param('viewallstudents_per_page', $perpage, PARAM_INT);
+ $viewallstudentsperpage = $SESSION->viewallstudents_perpage[$coursemoduleid];
} else {
- $viewallstudents_perpage = optional_param('viewallstudents_per_page', $SESSION->perpage[$course_module_id], PARAM_INT);
- $SESSION->viewallstudents_perpage[$course_module_id] = $viewallstudents_perpage;
+ $viewallstudentsperpage = optional_param('viewallstudents_per_page', $SESSION->perpage[$coursemoduleid], PARAM_INT);
+ $SESSION->viewallstudents_perpage[$coursemoduleid] = $viewallstudentsperpage;
}
// 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];
+if (!(isset($SESSION->viewallstudents_sortby[$coursemoduleid]))) {
+ $SESSION->viewallstudents_sortby[$coursemoduleid] = optional_param('viewallstudents_sortby', $sortby, PARAM_ALPHA);
+ $viewallstudentssortby = $SESSION->viewallstudents_sortby[$coursemoduleid];
} else {
- $viewallstudents_sortby = optional_param('viewallstudents_sortby', $SESSION->sortby[$course_module_id], PARAM_ALPHA);
- $SESSION->viewallstudents_sortby[$course_module_id] = $viewallstudents_sortby;
+ $viewallstudentssortby = optional_param('viewallstudents_sortby', $SESSION->sortby[$coursemoduleid], PARAM_ALPHA);
+ $SESSION->viewallstudents_sortby[$coursemoduleid] = $viewallstudentssortby;
}
// 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];
+if (!(isset($SESSION->viewallstudents_sorthow[$coursemoduleid]))) {
+ $SESSION->viewallstudents_sorthow[$coursemoduleid] = optional_param('viewallstudents_sorthow', $sorthow, PARAM_ALPHA);
+ $viewallstudentssorthow = $SESSION->viewallstudents_sorthow[$coursemoduleid];
} else {
- $viewallstudents_sorthow = optional_param('viewallstudents_sorthow', $SESSION->sorthow[$course_module_id], PARAM_ALPHA);
- $SESSION->viewallstudents_sorthow[$course_module_id] = $viewallstudents_sorthow;
+ $viewallstudentssorthow = optional_param('viewallstudents_sorthow', $SESSION->sorthow[$coursemoduleid], PARAM_ALPHA);
+ $SESSION->viewallstudents_sorthow[$coursemoduleid] = $viewallstudentssorthow;
}
// 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];
+if (!(isset($SESSION->viewallstudents_firstname_alpha[$coursemoduleid]))) {
+ $SESSION->viewallstudents_firstname_alpha[$coursemoduleid] = optional_param('viewallstudents_firstname_alpha', '', PARAM_ALPHA);
+ $viewallstudentsfirstnamealpha = $SESSION->coursework_firstname_alpha[$coursemoduleid];
} else {
- $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;
+ $viewallstudentsfirstnamealpha = optional_param('viewallstudents_firstname_alpha', $SESSION->viewallstudents_firstname_alpha[$coursemoduleid], PARAM_ALPHA);
+ $SESSION->viewallstudents_firstname_alpha[$coursemoduleid] = $viewallstudentsfirstnamealpha;
}
// 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];
+if (!(isset($SESSION->viewallstudents_lastname_alpha[$coursemoduleid]))) {
+ $SESSION->viewallstudents_lastname_alpha[$coursemoduleid] = optional_param('viewallstudents_lastname_alpha', '', PARAM_ALPHA);
+ $viewallstudentslastnamealpha = $SESSION->viewallstudents_lastname_alpha[$coursemoduleid];
} else {
- $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;
+ $viewallstudentslastnamealpha = optional_param('viewallstudents_lastname_alpha', $SESSION->viewallstudents_lastname_alpha[$coursemoduleid], PARAM_ALPHA);
+ $SESSION->viewallstudents_lastname_alpha[$coursemoduleid] = $viewallstudentslastnamealpha;
}
// 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];
+if (!(isset($SESSION->viewallstudents_groupname_alpha[$coursemoduleid]))) {
+ $SESSION->viewallstudents_groupname_alpha[$coursemoduleid] = optional_param('viewallstudents_groupname_alpha', '', PARAM_ALPHA);
+ $viewallstudentsgroupnamealpha = $SESSION->viewallstudents_groupname_alpha[$coursemoduleid];
} else {
- $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;
+ $viewallstudentsgroupnamealpha = optional_param('viewallstudents_groupname_alpha', $SESSION->viewallstudents_groupname_alpha[$coursemoduleid], PARAM_ALPHA);
+ $SESSION->viewallstudents_groupname_alpha[$coursemoduleid] = $viewallstudentsgroupnamealpha;
}
if (!($sorthow === 'ASC' || $sorthow === 'DESC')) {
$sorthow = 'ASC';
}
-$coursework_record = new stdClass();
+$courseworkrecord = new stdClass();
-if ($course_module_id) {
- $course_module = get_coursemodule_from_id('coursework',
- $course_module_id,
+if ($coursemoduleid) {
+ $coursemodule = get_coursemodule_from_id('coursework',
+ $coursemoduleid,
0,
false,
MUST_EXIST);
- $course = $DB->get_record('course', ['id' => $course_module->course], '*', MUST_EXIST);
- $coursework_record = $DB->get_record('coursework',
- ['id' => $course_module->instance],
+ $course = $DB->get_record('course', ['id' => $coursemodule->course], '*', MUST_EXIST);
+ $courseworkrecord = $DB->get_record('coursework',
+ ['id' => $coursemodule->instance],
'*',
MUST_EXIST);
} else {
- if ($coursework_id) {
- $coursework_record = $DB->get_record('coursework',
- ['id' => $coursework_id],
+ if ($courseworkid) {
+ $courseworkrecord = $DB->get_record('coursework',
+ ['id' => $courseworkid],
'*',
MUST_EXIST);
$course = $DB->get_record('course',
- ['id' => $coursework_record->course],
+ ['id' => $courseworkrecord->course],
'*',
MUST_EXIST);
- $course_module = get_coursemodule_from_instance('coursework',
- $coursework_record->id,
+ $coursemodule = get_coursemodule_from_instance('coursework',
+ $courseworkrecord->id,
$course->id,
false,
MUST_EXIST);
@@ -251,7 +251,7 @@
}
}
-$coursework = mod_coursework\models\coursework::find($coursework_record);
+$coursework = mod_coursework\models\coursework::find($courseworkrecord);
// 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) {
@@ -291,65 +291,65 @@
}
// This will set $PAGE->context to the coursemodule's context.
-require_login($course, true, $course_module);
+require_login($course, true, $coursemodule);
// Name of new zip file.
$filename = str_replace(' ', '_', clean_filename($COURSE->shortname . '-' . $coursework->name . '.zip'));
-if ($download && $zip_file = $coursework->pack_files()) {
- send_temp_file($zip_file, $filename); // Send file and delete after sending.
+if ($download && $zipfile = $coursework->pack_files()) {
+ send_temp_file($zipfile, $filename); // Send file and delete after sending.
}
-if ($export_grades) {
+if ($exportgrades) {
// Headers and data for csv
- $csv_cells = ['name', 'username', 'idnumber', 'email'];
+ $csvcells = ['name', 'username', 'idnumber', 'email'];
if ($coursework->personal_deadlines_enabled()) {
- $csv_cells[] = 'personaldeadline';
+ $csvcells[] = 'personaldeadline';
}
- $csv_cells[] = 'submissiondate';
- $csv_cells[] = 'submissiontime';
- $csv_cells[] = 'submissionfileid';
+ $csvcells[] = 'submissiondate';
+ $csvcells[] = 'submissiontime';
+ $csvcells[] = 'submissionfileid';
if ($coursework->extensions_enabled() && ($coursework->has_deadline()) || $coursework->personal_deadlines_enabled()) {
- $csv_cells[] = 'extensiondeadline';
- $csv_cells[] = 'extensionreason';
- $csv_cells[] = 'extensionextrainfo';
+ $csvcells[] = 'extensiondeadline';
+ $csvcells[] = 'extensionreason';
+ $csvcells[] = 'extensionextrainfo';
}
if ($coursework->plagiarism_flagging_enbled()) {
- $csv_cells[] = 'plagiarismflagstatus';
- $csv_cells[] = 'plagiarismflagcomment';
+ $csvcells[] = 'plagiarismflagstatus';
+ $csvcells[] = 'plagiarismflagcomment';
}
- $csv_cells[] = 'stages';
+ $csvcells[] = 'stages';
if ($coursework->moderation_agreement_enabled()) {
- $csv_cells[] = 'moderationagreement';
+ $csvcells[] = 'moderationagreement';
}
- $csv_cells[] = 'finalgrade';
+ $csvcells[] = '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 = new \mod_coursework\export\csv($coursework, $csvcells, $filename);
$csv->export();
}
-if ($download_grading_sheet) {
+if ($downloadgradingsheet) {
- $csv_cells = \mod_coursework\export\grading_sheet::cells_array($coursework);
+ $csvcells = \mod_coursework\export\grading_sheet::cells_array($coursework);
$timestamp = date('d_m_y @ H-i');
$filename = get_string('gradingsheetfor', 'coursework'). $coursework->name .' '.$timestamp;
- $grading_sheet = new \mod_coursework\export\grading_sheet($coursework, $csv_cells, $filename);
- $grading_sheet->export();
+ $gradingsheet = new \mod_coursework\export\grading_sheet($coursework, $csvcells, $filename);
+ $gradingsheet->export();
}
-$can_grade = has_capability('mod/coursework:addinitialgrade', $PAGE->context);
-$can_submit = has_capability('mod/coursework:submit', $PAGE->context);
-$can_view_students = false;
+$cangrade = has_capability('mod/coursework:addinitialgrade', $PAGE->context);
+$cansubmit = has_capability('mod/coursework:submit', $PAGE->context);
+$canviewstudents = false;
// TODO this is awful.
$capabilities = ['addinstance',
@@ -372,7 +372,7 @@
foreach ($capabilities as $capability) {
if (has_capability('mod/coursework:' . $capability, $PAGE->context)) {
- $can_view_students = true;
+ $canviewstudents = true;
break;
}
}
@@ -387,9 +387,9 @@
add_to_log($course->id,
'coursework',
'view',
- "view.php?id=$course_module->id",
+ "view.php?id=$coursemodule->id",
$coursework->name,
- $course_module->id);
+ $coursemodule->id);
}
// Print the page header.
@@ -397,19 +397,19 @@
// 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);
+ $viewallstudentssortby = optional_param('viewallstudents_sortby', 'groupname', PARAM_ALPHA);
}
-$params = ['id' => $course_module->id,
+$params = ['id' => $coursemodule->id,
'sortby' => $sortby,
'sorthow' => $sorthow,
'per_page' => $perpage,
'group' => $group];
-if (!empty($SESSION->displayallstudents[$course_module_id])) {
- $params['viewallstudents_sorthow'] = $viewallstudents_sorthow;
- $params['viewallstudents_sortby'] = $viewallstudents_sortby;
- $params['viewallstudents_per_page'] = $viewallstudents_perpage;
+if (!empty($SESSION->displayallstudents[$coursemoduleid])) {
+ $params['viewallstudents_sorthow'] = $viewallstudentssorthow;
+ $params['viewallstudents_sortby'] = $viewallstudentssortby;
+ $params['viewallstudents_per_page'] = $viewallstudentsperpage;
}
$PAGE->set_url('/mod/coursework/view.php', $params);
@@ -437,25 +437,25 @@
/**
* @var mod_coursework_object_renderer $object_renderer
*/
-$object_renderer = $PAGE->get_renderer('mod_coursework', 'object');
+$objectrenderer = $PAGE->get_renderer('mod_coursework', 'object');
/**
* @var mod_coursework_page_renderer $page_renderer
*/
-$page_renderer = $PAGE->get_renderer('mod_coursework', 'page');
+$pagerenderer = $PAGE->get_renderer('mod_coursework', 'page');
-$html .= $object_renderer->render(new mod_coursework_coursework($coursework));
+$html .= $objectrenderer->render(new mod_coursework_coursework($coursework));
// Allow tutors to upload files as part of the coursework task? Easily done via the main
// course thing, so not necessary.
// If this is a student, show the submission form, or their existing submission, or both
// There is scope for an arbitrary number of files to be added here, before the deadline.
-if ($can_submit && !$can_grade) {
- $html .= $page_renderer->student_view_page($coursework, \mod_coursework\models\user::find($USER));
+if ($cansubmit && !$cangrade) {
+ $html .= $pagerenderer->student_view_page($coursework, \mod_coursework\models\user::find($USER));
}
// Display the submissions table of all the students instead.
-if ($can_view_students) {
+if ($canviewstudents) {
// If the resubmit button was pressed (for plagiarism), we need to fire a new event.
if ($resubmit && $submissionid) {
@@ -466,7 +466,7 @@
$submission = submission::find($submissionid);
$params = [
- 'cm' => $course_module->id,
+ 'cm' => $coursemodule->id,
'userid' => $submission->get_author_id(),
];
// Get the hash so we can retrieve the file and update timemodified.
@@ -512,21 +512,21 @@
} else {
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] = "";
+ $courseworkfirstnamealpha = $SESSION->coursework_firstname_alpha[$coursemoduleid] = "";
+ $courseworklastnamealpha = $SESSION->coursework_lastname_alpha[$coursemoduleid] = "";
+ $courseworkgroupnamealpha = $SESSION->coursework_groupname_alpha[$coursemoduleid] = "";
}
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] = "";
+ $viewallstudentsfirstnamealpha = $SESSION->viewallstudents_firstname_alpha[$coursemoduleid] = "";
+ $viewallstudentslastnamealpha = $SESSION->viewallstudents_lastname_alpha[$coursemoduleid] = "";
+ $viewallstudentsgroupnamealpha = $SESSION->viewallstudents_groupname_alpha[$coursemoduleid] = "";
}
- $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();
+ $html .= $pagerenderer->teacher_grading_page($coursework, $page, $perpage, $sortby, $sorthow, $group, $courseworkfirstnamealpha, $courseworklastnamealpha, $courseworkgroupnamealpha, $resettable);
+ $html .= $pagerenderer->non_teacher_allocated_grading_page($coursework, $viewallstudentspage, $viewallstudentsperpage, $viewallstudentssortby, $viewallstudentssorthow, $group, $displayallstudents, $viewallstudentsfirstnamealpha, $viewallstudentslastnamealpha, $viewallstudentsgroupnamealpha);
+ $html .= $pagerenderer->datatables_render($coursework);
+ $html .= $pagerenderer->render_modal();
}
}
From b84653ba93e3d35132fbe515e638cd076831da3c Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Tue, 3 Sep 2024 10:40:06 +0100
Subject: [PATCH 16/25] CTP-3690 package
---
classes/event/assessable_submitted.php | 2 +-
classes/forms/choose_student_for_submission_mform.php | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/classes/event/assessable_submitted.php b/classes/event/assessable_submitted.php
index d32319d3..5ea9a3d3 100644
--- a/classes/event/assessable_submitted.php
+++ b/classes/event/assessable_submitted.php
@@ -16,7 +16,7 @@
/**
*
- * @package coursework_submitted
+ * @package mod_coursework
* @copyright 2013 Frédéric Massart
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
diff --git a/classes/forms/choose_student_for_submission_mform.php b/classes/forms/choose_student_for_submission_mform.php
index 78936938..892a2222 100644
--- a/classes/forms/choose_student_for_submission_mform.php
+++ b/classes/forms/choose_student_for_submission_mform.php
@@ -16,8 +16,7 @@
/**
*
- * @package
- * @subpackage
+ * @package mod_coursework
* @copyright 2012 Matt Gibson {@link http://moodle.org/user/view.php?id=81450}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
From dca59d912839f3472f209f9391ad3421d8e98c8f Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Tue, 3 Sep 2024 11:10:13 +0100
Subject: [PATCH 17/25] Plugin version 2024090300
---
version.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/version.php b/version.php
index c671f302..f6f52b99 100644
--- a/version.php
+++ b/version.php
@@ -24,7 +24,7 @@
$plugin->component = 'mod_coursework';
-$plugin->version = 2024082700; // If version == 0 then module will not be installed
+$plugin->version = 2024090300; // If version == 0 then module will not be installed
$plugin->requires = 2023100400; // Requires this Moodle version
$plugin->cron = 300; // Period for cron to check this module (secs).
From 1e50a3c3a050cc72151b9159011278a8309d4766 Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Tue, 3 Sep 2024 15:07:12 +0100
Subject: [PATCH 18/25] CTP-3690 spacing
---
classes/auto_grader/percentage_distance.php | 2 +-
classes/controllers/personal_deadlines_controller.php | 2 +-
classes/export/csv/cells/agreedfeedback_cell.php | 2 +-
classes/export/csv/cells/otherassessors_cell.php | 2 +-
classes/export/import.php | 4 ++--
classes/sample_set_rule/range_sample_type.php | 2 +-
mod_form.php | 2 +-
renderers/object_renderer.php | 6 +++---
8 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/classes/auto_grader/percentage_distance.php b/classes/auto_grader/percentage_distance.php
index 850823a3..8ef2abdf 100644
--- a/classes/auto_grader/percentage_distance.php
+++ b/classes/auto_grader/percentage_distance.php
@@ -75,7 +75,7 @@ public function create_auto_grade_if_rules_match() {
return;
}
- if ($this->grades_are_close_enough() ) {
+ if ($this->grades_are_close_enough()) {
if (!$this->get_allocatable()->has_agreed_feedback($this->get_coursework())) {
$this->create_final_feedback();
} else {
diff --git a/classes/controllers/personal_deadlines_controller.php b/classes/controllers/personal_deadlines_controller.php
index 969556e2..a7464d2b 100644
--- a/classes/controllers/personal_deadlines_controller.php
+++ b/classes/controllers/personal_deadlines_controller.php
@@ -70,7 +70,7 @@ protected function new_personal_deadline() {
$data = $this->form->get_data();
- if (empty($data->multipleuserdeadlines) ) {
+ if (empty($data->multipleuserdeadlines)) {
if (!$this->get_personal_deadline()) { // personal deadline doesnt exist
// add new
$data->createdbyid = $USER->id;
diff --git a/classes/export/csv/cells/agreedfeedback_cell.php b/classes/export/csv/cells/agreedfeedback_cell.php
index ee3d6903..368dbb6d 100644
--- a/classes/export/csv/cells/agreedfeedback_cell.php
+++ b/classes/export/csv/cells/agreedfeedback_cell.php
@@ -66,7 +66,7 @@ public function validate_cell($value, $submissionid, $stageidentifier='', $uploa
$submission = \mod_coursework\models\submission::find($subdbrecord);
// Is the submission in question ready to grade?
- if (!$submission->all_inital_graded() && !empty($value)) {
+ if (!$submission->all_inital_graded() && !empty($value)) {
return get_string('submissionnotreadyforagreedgrade', 'coursework');
}
diff --git a/classes/export/csv/cells/otherassessors_cell.php b/classes/export/csv/cells/otherassessors_cell.php
index 4549af12..e0dc9469 100644
--- a/classes/export/csv/cells/otherassessors_cell.php
+++ b/classes/export/csv/cells/otherassessors_cell.php
@@ -70,7 +70,7 @@ public function get_cell($submission, $student, $stageidentifier) {
continue;
}
$ability = new ability(user::find($USER), $this->coursework);
- if ((($ability->can('show', $feedback) || has_capability('mod/coursework:addallocatedagreedgrade', $submission->get_coursework()->get_context())) &&
+ 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()) {
diff --git a/classes/export/import.php b/classes/export/import.php
index 2fe4d52d..d0c6e208 100644
--- a/classes/export/import.php
+++ b/classes/export/import.php
@@ -202,7 +202,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);
@@ -611,7 +611,7 @@ public function add_grade($submissionid, $grade, $feedback, $stageidentifier, $u
$feedbackid = $DB->insert_record('coursework_feedbacks', $addgrade, true);
- if ($usesrubric) {
+ if ($usesrubric) {
$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);
diff --git a/classes/sample_set_rule/range_sample_type.php b/classes/sample_set_rule/range_sample_type.php
index 1de88567..8ab658ec 100644
--- a/classes/sample_set_rule/range_sample_type.php
+++ b/classes/sample_set_rule/range_sample_type.php
@@ -94,7 +94,7 @@ public function range_elements($assessornumber, $sequence, $dbrecord=false) {
$scale = [];
- if ($this->coursework->grade > 0) {
+ if ($this->coursework->grade > 0) {
for ($i = 0; $i <= $this->coursework->grade; $i++) {
$scale[] = $i;
}
diff --git a/mod_form.php b/mod_form.php
index 2bccc639..0accae25 100644
--- a/mod_form.php
+++ b/mod_form.php
@@ -227,7 +227,7 @@ public function validation($data, $files) {
$errors['agreedgrademarkingdeadline'] = get_string('must_be_after_initial_grade_dealdine', 'mod_coursework');
}
- if (isset($data['relativeagreedmarkingdeadline']) && $data['relativeagreedmarkingdeadline'] != 0 && $data['relativeagreedmarkingdeadline'] < $data['relativeinitialmarkingdeadline'] ) {
+ if (isset($data['relativeagreedmarkingdeadline']) && $data['relativeagreedmarkingdeadline'] != 0 && $data['relativeagreedmarkingdeadline'] < $data['relativeinitialmarkingdeadline'] ) {
$errors['relativeagreedmarkingdeadline'] = get_string('must_be_after_or_equal_to_relative_initial_grade_dealdine', 'mod_coursework');
}
diff --git a/renderers/object_renderer.php b/renderers/object_renderer.php
index 011f0ea2..51080243 100644
--- a/renderers/object_renderer.php
+++ b/renderers/object_renderer.php
@@ -787,7 +787,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$scale = "";
- if ($samplingwidget->get_coursework()->grade > 0) {
+ if ($samplingwidget->get_coursework()->grade > 0) {
$comma = "";
@@ -1629,7 +1629,7 @@ public function get_allocatables_count_per_assessor($coursework) {
$submission = $allocatable->get_submission($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())
+ && !empty($submission) && (($submission->all_inital_graded() && !$coursework->sampling_enabled())
|| ($coursework->sampling_enabled() && $submission->all_inital_graded() && $submission->max_number_of_feedbacks() > 1 ))) {
$participant ++;
}
@@ -1805,7 +1805,7 @@ public function get_submissions_for_assessor($coursework, $submissions) {
foreach ($submissions as $sub) {
$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())
+ && !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))) {
$gradeblesub[$submission->id] = $submission;
From 11da13d559d8774e4d4b6149d7871195ec302cad Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Tue, 3 Sep 2024 16:21:45 +0100
Subject: [PATCH 19/25] CTP-3690 remove legacy event
---
index.php | 13 ++-----------
view.php | 19 +++++--------------
2 files changed, 7 insertions(+), 25 deletions(-)
diff --git a/index.php b/index.php
index 818a5180..151840a8 100644
--- a/index.php
+++ b/index.php
@@ -35,17 +35,8 @@
require_course_login($course);
-if ((float)substr($CFG->release, 0, 5) > 2.6) { // 2.8 > 2.6
- $event = \mod_coursework\event\course_module_instance_list_viewed::create(['context' => context_course::instance($course->id)]);
- $event->trigger();
-} else {
- add_to_log($course->id,
- 'coursework',
- 'view',
- "view.php?id=$coursemodule->id",
- $coursework->name,
- $coursemodule->id);
-}
+$event = \mod_coursework\event\course_module_instance_list_viewed::create(['context' => context_course::instance($course->id)]);
+$event->trigger();
// Print the header.
diff --git a/view.php b/view.php
index e4d23009..b8ae5bfe 100644
--- a/view.php
+++ b/view.php
@@ -377,20 +377,11 @@
}
}
-if ((float)substr($CFG->release, 0, 5) > 2.6) { // 2.8 > 2.6
- $event = \mod_coursework\event\course_module_viewed::create([
- 'objectid' => $coursework->id,
- 'context' => $coursework->get_context(),
- ]);
- $event->trigger();
-} else {
- add_to_log($course->id,
- 'coursework',
- 'view',
- "view.php?id=$coursemodule->id",
- $coursework->name,
- $coursemodule->id);
-}
+
+$event = \mod_coursework\event\course_module_viewed::create(
+ ['objectid' => $coursework->id, 'context' => $coursework->get_context()]
+);
+$event->trigger();
// Print the page header.
From f72a8df267ad130f7c18909b0a8ce8a2b74bf7fb Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Tue, 3 Sep 2024 16:24:04 +0100
Subject: [PATCH 20/25] CTP-3690 correct commit 16f5fa2c underscores
---
actions/ajax/datatable/grading.php | 2 +-
classes/ability/rule.php | 16 +++---
classes/allocation/manager.php | 6 +--
classes/export/csv.php | 6 +--
classes/grading_report.php | 14 +++---
classes/sample_set_rule/range_sample_type.php | 49 ++++++++++---------
classes/sample_set_rule/total_sample_type.php | 28 ++++++-----
7 files changed, 63 insertions(+), 58 deletions(-)
diff --git a/actions/ajax/datatable/grading.php b/actions/ajax/datatable/grading.php
index 2d874bd2..25ebaba0 100644
--- a/actions/ajax/datatable/grading.php
+++ b/actions/ajax/datatable/grading.php
@@ -47,7 +47,7 @@
$reportoptions['showsubmissiongrade'] = false;
$reportoptions['showgradinggrade'] = false;
$reportoptions['courseworkid'] = $courseworkid;
-$reportoptions['mode'] = \mod_coursework\grading_report::$modegetremainrecords;
+$reportoptions['mode'] = \mod_coursework\grading_report::MODE_GET_REMAIN_RECORDS;
//$controller = new mod_coursework\controllers\grading_controller(['courseworkid' => $report_options, 'allocatableid' => $USER->id, 'allocatabletype' => $USER->id]);
$controller = new mod_coursework\controllers\grading_controller([]);
diff --git a/classes/ability/rule.php b/classes/ability/rule.php
index f29490c3..a3393fa0 100644
--- a/classes/ability/rule.php
+++ b/classes/ability/rule.php
@@ -52,14 +52,14 @@ class rule {
/**
* @param string $action
- * @param string $class_name
- * @param $rule_function
+ * @param string $classname
+ * @param $rulefunction
* @param bool $allow
*/
public function __construct($action, $classname, $rulefunction, $allow = true) {
$this->action = $action;
- $this->class_name = $classname;
- $this->rule_function = $rulefunction;
+ $this->classname = $classname;
+ $this->rulefunction = $rulefunction;
$this->allow = $allow;
}
@@ -81,7 +81,7 @@ public function matches($action, $object) {
* @return bool
*/
public function allows($object) {
- $rule = $this->rule_function;
+ $rule = $this->rulefunction;
return $rule($object) && $this->allow;
}
@@ -92,7 +92,7 @@ public function allows($object) {
* @return bool
*/
public function prevents($object) {
- $rule = $this->rule_function;
+ $rule = $this->rulefunction;
return $rule($object) && !$this->allow;
}
@@ -109,10 +109,10 @@ protected function action_matches($action) {
* @return bool
*/
protected function class_matches($object) {
- if (get_class($object) == $this->class_name) {
+ if (get_class($object) == $this->classname) {
return true;
}
- if (get_parent_class($object) == $this->class_name) {
+ if (get_parent_class($object) == $this->classname) {
return true;
}
return false;
diff --git a/classes/allocation/manager.php b/classes/allocation/manager.php
index 2ec4f19f..57b38a9a 100644
--- a/classes/allocation/manager.php
+++ b/classes/allocation/manager.php
@@ -304,7 +304,7 @@ public function auto_generate_sample_set() {
for ($stagenumber = 2; $stagenumber <= $this->get_coursework()->get_max_markers(); $stagenumber++) {
- $stage = "assessor{$stagenumber}";
+ $stage = "assessor_{$stagenumber}";
$this->remove_unmarked_automatic_allocatables($stage);
@@ -353,7 +353,7 @@ public function auto_generate_sample_set() {
$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{$stagenumber}";
+ $sample->stage_identifier = "assessor_{$stagenumber}";
$sample->selectiontype = "automatic";
// If this a manually selected allocatable check to see if the allocatable is already in the table
@@ -369,7 +369,7 @@ public function get_include_in_sample_set($stagenumber) {
global $DB;
- $stage = "assessor{$stagenumber}";
+ $stage = "assessor_{$stagenumber}";
$sql = "SELECT allocatableid,
courseworkid,
diff --git a/classes/export/csv.php b/classes/export/csv.php
index 5db099ce..e16cafea 100644
--- a/classes/export/csv.php
+++ b/classes/export/csv.php
@@ -66,7 +66,7 @@ class csv {
public function __construct($coursework, $csvcells, $filename) {
$this->coursework = $coursework;
$this->dateformat = '%a, %d %b %Y, %H:%M';
- $this->csv_cells = $csvcells;
+ $this->csvcells = $csvcells;
$this->filename = $filename;
}
@@ -80,7 +80,7 @@ public function export() {
$csvdata = [];
// headers
- $this->add_headers($this->csv_cells);
+ $this->add_headers($this->csvcells);
/**
* @var submission[] $submissions
@@ -246,7 +246,7 @@ public function add_csv_data($submission) {
$students = $submission->get_students();
foreach ($students as $student) {
- $csvdata[] = $this->add_cells_to_array($submission, $student, $this->csv_cells);
+ $csvdata[] = $this->add_cells_to_array($submission, $student, $this->csvcells);
}
return $csvdata;
diff --git a/classes/grading_report.php b/classes/grading_report.php
index a39d2044..2d63a089 100644
--- a/classes/grading_report.php
+++ b/classes/grading_report.php
@@ -39,10 +39,10 @@
*/
class grading_report {
- //added static vars to determine in what manner the report is loaded
- public static $modegetall = 1;
- public static $modegetfirstrecords = 2;
- public static $modegetremainrecords = 3;
+ // Added constants to determine in what manner the report is loaded.
+ const MODE_GET_ALL = 1;
+ const MODE_GET_FIRST_RECORDS = 2;
+ const MODE_GET_REMAIN_RECORDS = 3;
/**
* @var array rendering options
@@ -406,13 +406,13 @@ public function get_table_rows_for_page($rowcount = false) {
$counter = count($rows);
$this->realtotalrows = $counter;
- $mode = empty($this->options['mode']) ? self::$modegetall : $this->options['mode'];
+ $mode = empty($this->options['mode']) ? self::MODE_GET_ALL : $this->options['mode'];
if ($mode != self::$modegetall) {
$perpage = $this->options['perpage'] ?? 10;
if ($counter > $perpage) {
- if ($mode == self::$modegetfirstrecords) {
+ if ($mode == self::MODE_GET_FIRST_RECORDS) {
$rows = array_slice($rows, 0, $perpage);
- } else if ($mode == self::$modegetremainrecords) {
+ } else if ($mode == self::MODE_GET_REMAIN_RECORDS) {
$rows = array_slice($rows, $perpage);
}
}
diff --git a/classes/sample_set_rule/range_sample_type.php b/classes/sample_set_rule/range_sample_type.php
index 8ab658ec..b3336f8d 100644
--- a/classes/sample_set_rule/range_sample_type.php
+++ b/classes/sample_set_rule/range_sample_type.php
@@ -60,7 +60,7 @@ public function add_form_elements($assessornumber=0) {
{coursework_sample_set_plugin} sp
WHERE sr.sample_set_plugin_id = sp.id
AND sr.courseworkid = {$this->coursework->id}
- AND sr.stageidentifier = 'assessor{$assessornumber}'
+ AND sr.stage_identifier = 'assessor_{$assessornumber}'
AND sp.rulename = 'range_sample_type'";
$rulesfound = false;
@@ -77,9 +77,9 @@ public function add_form_elements($assessornumber=0) {
$html .= $this->range_elements($assessornumber, 0, false);
}
- $html .= html_writer::link('#', get_string('addgraderule', 'mod_coursework'), ['id' => "assessor{$assessornumber}addgradderule", 'class' => 'addgradderule sample_set_rule']);
+ $html .= html_writer::link('#', get_string('addgraderule', 'mod_coursework'), ['id' => "assessor_{$assessornumber}_addgradderule", 'class' => 'addgradderule sample_set_rule']);
$html .= " ";
- $html .= html_writer::link('#', get_string('removegraderule', 'mod_coursework'), ['id' => "assessor{$assessornumber}removegradderule", 'class' => 'removegradderule sample_set_rule']);
+ $html .= html_writer::link('#', get_string('removegraderule', 'mod_coursework'), ['id' => "assessor_{$assessornumber}_removegradderule", 'class' => 'removegradderule sample_set_rule']);
return $html;
}
@@ -118,10 +118,14 @@ public function range_elements($assessornumber, $sequence, $dbrecord=false) {
$ruleschecked = false;
}
- $html = html_writer::start_tag('div', ['class' => "assessor{$assessornumber}graderules", 'id' => "assessor{$assessornumber}graderules{$sequence}"]);
+ $html = html_writer::start_tag(
+ 'div',
+ ['class' => "assessor_{$assessornumber}_grade_rules", 'id' => "assessor_{$assessornumber}_grade_rules_{$sequence}"]
+ );
- $html .= html_writer::checkbox("assessor{$assessornumber}samplerules[]", 1, $ruleschecked, '',
- ['id' => "assessor{$assessornumber}samplerules{$sequence}", 'class' => "assessor{$assessornumber} rangegradecheckbox samplesetrule"]);
+ $html .= html_writer::checkbox(
+ "assessor_{$assessornumber}_samplerules[]", 1, $ruleschecked, '',
+ ['id' => "assessor_{$assessornumber}_samplerules_{$sequence}", 'class' => "assessor_{$assessornumber} range_grade_checkbox sample_set_rule"]);
$gradescaletext = ($this->coursework->grade < 0) ? get_string('scale', 'mod_coursework') : get_string('grade', 'mod_coursework');
$gradescaleval = ($this->coursework->grade < 0) ? 'scale' : 'grade';
@@ -130,28 +134,28 @@ public function range_elements($assessornumber, $sequence, $dbrecord=false) {
$gradescaleval => $gradescaletext];
$html .= html_writer::select($options,
- "assessor{$assessornumber}sampletype[]",
+ "assessor_{$assessornumber}_sampletype[]",
"",
$selectedtype,
- ['id' => "assessor{$assessornumber}sampletype{$sequence}", 'class' => "grade_type sample_set_rule"]);
+ ['id' => "assessor_{$assessornumber}_sampletype_{$sequence}", 'class' => "grade_type sample_set_rule"]);
$html .= html_writer::label(get_string('from', 'mod_coursework'), 'assessortwo_samplefrom[0]');
$ruleoptions = (!empty($selectedtype) && array_key_exists('percentage', $selectedtype)) ? $percentageoptions : $scale; //change this into a ternary statement that
$html .= html_writer::select($ruleoptions,
- "assessor{$assessornumber}samplefrom[]",
+ "assessor_{$assessornumber}_samplefrom[]",
"",
$selectedfrom,
- ['id' => "assessor{$assessornumber}samplefrom{$sequence}", 'class' => " sample_set_rule range_drop_down range_samp_from"]);
+ ['id' => "assessor_{$assessornumber}_samplefrom_{$sequence}", 'class' => " sample_set_rule range_drop_down range_samp_from"]);
- $html .= html_writer::label(get_string('to', 'mod_coursework'), "assessor{$assessornumber}sampleto[0]");
+ $html .= html_writer::label(get_string('to', 'mod_coursework'), "assessor_{$assessornumber}_sampleto[0]");
$html .= html_writer::select(array_reverse($ruleoptions, true),
- "assessor{$assessornumber}sampleto[]",
+ "assessor_{$assessornumber}_sampleto[]",
"",
$selectedto,
- ['id' => "assessor{$assessornumber}sampleto{$sequence}", 'class' => " sample_set_rule range_drop_down"]);
+ ['id' => "assessor_{$assessornumber}_sampleto_{$sequence}", 'class' => " sample_set_rule range_drop_down"]);
$html .= html_writer::end_tag('div', '');
@@ -330,10 +334,10 @@ public function save_form_data($assessornumber=0, &$order=0) {
global $DB;
- $samplerules = optional_param_array("assessor{$assessornumber}samplerules", false, PARAM_RAW);
- $sampletype = optional_param_array("assessor{$assessornumber}sampletype", false, PARAM_RAW);
- $samplefrom = optional_param_array("assessor{$assessornumber}samplefrom", false, PARAM_RAW);
- $sampleto = optional_param_array("assessor{$assessornumber}sampleto", false, PARAM_RAW);
+ $samplerules = optional_param_array("assessor_{$assessornumber}_samplerules", false, PARAM_RAW);
+ $sampletype = optional_param_array("assessor_{$assessornumber}_sampletype", false, PARAM_RAW);
+ $samplefrom = optional_param_array("assessor_{$assessornumber}_samplefrom", false, PARAM_RAW);
+ $sampleto = optional_param_array("assessor_{$assessornumber}_sampleto", false, PARAM_RAW);
$sampleplugin = $DB->get_record('coursework_sample_set_plugin', ['rulename' => 'range_sample_type']);
@@ -348,7 +352,7 @@ public function save_form_data($assessornumber=0, &$order=0) {
$dbrecord->sample_set_plugin_id = $sampleplugin->id;
$dbrecord->courseworkid = $this->coursework->id;
$dbrecord->ruleorder = $order;
- $dbrecord->stage_identifier = "assessor{$assessornumber}";
+ $dbrecord->stage_identifier = "assessor_{$assessornumber}";
$DB->insert_record("coursework_sample_set_rules", $dbrecord);
$order++;
@@ -361,7 +365,7 @@ public function adjust_sample_set($stagenumber, &$allocatables, &$manualsamplese
global $DB;
- $stage = "assessor_".$stagenumber;
+ $stage = "assessor_" . $stagenumber;
$sql = "SELECT r.*,p.rulename
FROM {coursework_sample_set_plugin} p,
@@ -391,7 +395,6 @@ public function adjust_sample_set($stagenumber, &$allocatables, &$manualsamplese
&& isset($allocatables[$awf->allocatableid])) {
$autosampleset[$awf->allocatableid] = $allocatables[$awf->allocatableid];
}
-
}
}
}
@@ -454,9 +457,9 @@ 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, ['courseworkid' => $this->coursework->id,
- 'stage' => $stage]);
-
+ return $DB->get_records_sql($sql,
+ ['courseworkid' => $this->coursework->id, 'stage' => $stage]
+ );
}
}
diff --git a/classes/sample_set_rule/total_sample_type.php b/classes/sample_set_rule/total_sample_type.php
index 0aec7c3c..16d985d0 100644
--- a/classes/sample_set_rule/total_sample_type.php
+++ b/classes/sample_set_rule/total_sample_type.php
@@ -49,7 +49,7 @@ public function get_default_rule_order() {
}
- public function add_form_elements($assessornumber=0) {
+ public function add_form_elements($assessornumber = 0) {
global $DB;
@@ -58,7 +58,7 @@ public function add_form_elements($assessornumber=0) {
{coursework_sample_set_plugin} sp
WHERE sr.sample_set_plugin_id = sp.id
AND sr.courseworkid = {$this->coursework->id}
- AND sr.stageidentifier = 'assessor{$assessornumber}'
+ AND sr.stage_identifier = 'assessor_{$assessornumber}'
AND sp.rulename = 'total_sample_type'";
$selected = ($record = $DB->get_record_sql($sql)) ? [$record->upperlimit => $record->upperlimit] : false;
@@ -72,14 +72,16 @@ public function add_form_elements($assessornumber=0) {
$html = html_writer::start_div('sampletotal');
- $html .= html_writer::checkbox("assessor{$assessornumber}sampletotalcheckbox", 1, $checked, get_string('topupto', 'mod_coursework'),
- ['id' => "assessor{$assessornumber}sampletotalcheckbox", 'class' => "assessor{$assessornumber} totalcheckbox samplesetrule"]);
+ $html .= html_writer::checkbox(
+ "assessor_{$assessornumber}_sampletotal_checkbox", 1, $checked, get_string('topupto', 'mod_coursework'),
+ ['id' => "assessor_{$assessornumber}_sampletotal_checkbox", 'class' => "assessor{$assessornumber} totalcheckbox samplesetrule"]);
- $html .= html_writer::select($percentageoptions,
- "assessor{$assessornumber}sampletotal",
+ $html .= html_writer::select(
+ $percentageoptions,
+ "assessor_{$assessornumber}_sampletotal",
"",
$selected,
- ['id' => "assessor{$assessornumber}sampletotal", 'class' => " sample_set_rule"]);
+ ['id' => "assessor_{$assessornumber}_sampletotal", 'class' => " sample_set_rule"]);
$html .= html_writer::label(get_string('ofallstudents', 'mod_coursework'), 'assessortwo_sampletotal[]');
$html .= html_writer::end_div();
@@ -87,7 +89,7 @@ public function add_form_elements($assessornumber=0) {
return $html;
}
- public function add_form_elements_js($assessornumber=0) {
+ public function add_form_elements_js($assessornumber = 0) {
$jsscript = "
@@ -113,11 +115,11 @@ public function add_form_elements_js($assessornumber=0) {
}
- function save_form_data($assessornumber=0, &$order=0) {
+ function save_form_data($assessornumber = 0, &$order = 0) {
global $DB;
- $totalcheckbox = optional_param("assessor{$assessornumber}sampletotalcheckbox", false, PARAM_INT);
- $sampletotal = optional_param("assessor{$assessornumber}sampletotal", false, PARAM_INT);
+ $totalcheckbox = optional_param("assessor_{$assessornumber}_sampletotal_checkbox", false, PARAM_INT);
+ $sampletotal = optional_param("assessor_{$assessornumber}_sampletotal", false, PARAM_INT);
if ($totalcheckbox) {
@@ -128,7 +130,7 @@ function save_form_data($assessornumber=0, &$order=0) {
$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{$assessornumber}";
+ $dbrecord->stage_identifier = "assessor_{$assessornumber}";
$DB->insert_record('coursework_sample_set_rules', $dbrecord);
}
@@ -146,7 +148,7 @@ public function adjust_sample_set($stagenumber, &$allocatables, &$manualsamplese
global $DB;
- $stage = "assessor_".$stagenumber;
+ $stage = "assessor_" . $stagenumber;
$sql = "SELECT r.*,p.rulename
FROM {coursework_sample_set_plugin} p,
From 25e2797c158bcc7e3a9491e2f762e9890a6aa936 Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Mon, 9 Sep 2024 15:36:59 +0100
Subject: [PATCH 21/25] CTP-3690 correct commit 16f5fa2c wrapped_object
---
classes/decorators/submission_groups_decorator.php | 6 +++---
classes/framework/decorator.php | 12 ++++++------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/classes/decorators/submission_groups_decorator.php b/classes/decorators/submission_groups_decorator.php
index c67e4db1..8756dc7b 100644
--- a/classes/decorators/submission_groups_decorator.php
+++ b/classes/decorators/submission_groups_decorator.php
@@ -31,7 +31,7 @@
* submissions enabled. We want to make sure that the students get the grade of the group thing rather
* than their own missing assignment.
*
- * @property submission wrapped_object
+ * @property submission wrappedobject
* @package mod_coursework\decorators
*/
class submission_groups_decorator extends decorator {
@@ -43,11 +43,11 @@ class submission_groups_decorator extends decorator {
*/
public function user_is_in_same_group($user) {
- if (!$this->wrapped_object->get_coursework()->is_configured_to_have_group_submissions()) {
+ if (!$this->wrappedobject->get_coursework()->is_configured_to_have_group_submissions()) {
throw new \coding_exception('Asking for groups membership of a submissions when we are not using groups');
}
- $group = $this->wrapped_object->get_allocatable();
+ $group = $this->wrappedobject->get_allocatable();
return groups_is_member($group->id, $user->id);
}
diff --git a/classes/framework/decorator.php b/classes/framework/decorator.php
index 1f137f98..6f520d90 100644
--- a/classes/framework/decorator.php
+++ b/classes/framework/decorator.php
@@ -36,10 +36,10 @@ class decorator {
protected $wrappedobject;
/**
- * @param $wrapped_object
+ * @param $wrappedobject
*/
public function __construct($wrappedobject) {
- $this->wrapped_object = $wrappedobject;
+ $this->wrappedobject = $wrappedobject;
}
/**
@@ -50,7 +50,7 @@ public function __construct($wrappedobject) {
* @return mixed
*/
public function __call($method, $args) {
- return call_user_func_array([$this->wrapped_object,
+ return call_user_func_array([$this->wrappedobject,
$method],
$args);
}
@@ -62,7 +62,7 @@ public function __call($method, $args) {
* @return mixed
*/
public function __get($name) {
- return $this->wrapped_object->$name;
+ return $this->wrappedobject->$name;
}
/**
@@ -73,13 +73,13 @@ public function __get($name) {
* @return mixed
*/
public function __set($name, $value) {
- return $this->wrapped_object->$name = $value;
+ return $this->wrappedobject->$name = $value;
}
/**
* @return mixed
*/
public function wrapped_object() {
- return $this->wrapped_object;
+ return $this->wrappedobject;
}
}
From 7d013246e1b39881465595ef212f7d3f13c5f75c Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Mon, 9 Sep 2024 15:49:04 +0100
Subject: [PATCH 22/25] CTP-3690 correct commit 16f5fa2c sub_rows
---
classes/grading_report.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/classes/grading_report.php b/classes/grading_report.php
index 2d63a089..1ab601a7 100644
--- a/classes/grading_report.php
+++ b/classes/grading_report.php
@@ -313,14 +313,14 @@ public function get_cells_helpers() {
* @return sub_rows_interface
*/
public function get_sub_row_helper() {
- return $this->sub_rows;
+ return $this->subrows;
}
/**
* @param $rows_strategy
*/
public function add_sub_rows($rowsstrategy) {
- $this->sub_rows = $rowsstrategy;
+ $this->subrows = $rowsstrategy;
}
/**
From 058524a32f2bfc285bb50047193ed41f77830bce Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Mon, 9 Sep 2024 16:05:00 +0100
Subject: [PATCH 23/25] CTP-3690 correct commit 16f5fa2c stages/base and
grading report
---
classes/stages/base.php | 20 ++++++++++----------
renderers/grading_report_renderer.php | 14 +++++++-------
2 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/classes/stages/base.php b/classes/stages/base.php
index 2eeb39e4..05e96ea7 100644
--- a/classes/stages/base.php
+++ b/classes/stages/base.php
@@ -75,7 +75,7 @@ abstract class base {
*/
public function __construct($coursework, $stageidentifier) {
$this->coursework = $coursework;
- $this->stage_identifier = $stageidentifier;
+ $this->stageidentifier = $stageidentifier;
}
/**
@@ -164,7 +164,7 @@ protected function strategy_name() {
* @return string 'assessor_1'
*/
public function identifier() {
- return $this->stage_identifier;
+ return $this->stageidentifier;
}
/**
@@ -405,7 +405,7 @@ public function has_allocation($allocatable) {
if (!isset(allocation::$pool[$courseworkid]['stage_identifier'])) {
allocation::fill_pool_coursework($courseworkid);
}
- $this->allocatables_with_allocations = array_column(allocation::$pool[$courseworkid]['stage_identifier'][$this->stage_identifier] ?? [], 'allocatableid');
+ $this->allocatables_with_allocations = array_column(allocation::$pool[$courseworkid]['stage_identifier'][$this->stageidentifier] ?? [], 'allocatableid');
}
return in_array($allocatable->id, $this->allocatables_with_allocations);
@@ -419,7 +419,7 @@ public function has_allocation($allocatable) {
public function stage_has_allocation() {
$courseworkid = $this->get_coursework_id();
allocation::fill_pool_coursework($courseworkid);
- $record = allocation::get_object($courseworkid, 'stage_identifier', [$this->stage_identifier]);
+ $record = allocation::get_object($courseworkid, 'stage_identifier', [$this->stageidentifier]);
return !empty($record);
}
@@ -510,7 +510,7 @@ public function allocatable_is_in_sample($allocatable) {
return true;
}
- if ($this->stage_identifier == 'final_agreed_1') {
+ if ($this->stageidentifier == 'final_agreed_1') {
return true;
}
@@ -518,7 +518,7 @@ public function allocatable_is_in_sample($allocatable) {
$record = assessment_set_membership::get_object(
$this->coursework->id,
'allocatableid-allocatabletype-stage_identifier',
- [$allocatable->id(), $allocatable->type(), $this->stage_identifier]);
+ [$allocatable->id(), $allocatable->type(), $this->stageidentifier]);
return !empty($record);
}
@@ -538,7 +538,7 @@ public function add_allocatable_to_sampling($allocatable) {
$moderationsetmembership->courseworkid = $this->coursework->id;
$moderationsetmembership->allocatableid = $allocatable->id();
$moderationsetmembership->allocatabletype = $allocatable->type();
- $moderationsetmembership->stage_identifier = $this->stage_identifier;
+ $moderationsetmembership->stage_identifier = $this->stageidentifier;
$moderationsetmembership->save();
}
@@ -552,7 +552,7 @@ public function remove_allocatable_from_sampling($allocatable) {
'courseworkid' => $this->coursework->id,
'allocatableid' => $allocatable->id(),
'allocatabletype' => $allocatable->type(),
- 'stage_identifier' => $this->stage_identifier,
+ 'stage_identifier' => $this->stageidentifier,
];
$DB->delete_records('coursework_sample_set_mbrs', $params);
}
@@ -592,7 +592,7 @@ public function assessor_has_allocation($allocatable) {
$allocation = allocation::get_object(
$this->coursework->id,
'allocatableid-allocatabletype-stage_identifier',
- [$allocatable->id(), $allocatable->type(), $this->stage_identifier]
+ [$allocatable->id(), $allocatable->type(), $this->stageidentifier]
);
$result = ($allocation && $allocation->assessorid == $USER->id);
return $result;
@@ -744,7 +744,7 @@ public function other_parallel_stage_has_feedback_from_this_assessor($assessor,
* @return string
*/
public function type() {
- return substr($this->stage_identifier, 0, -2);
+ return substr($this->stageidentifier, 0, -2);
}
/**
diff --git a/renderers/grading_report_renderer.php b/renderers/grading_report_renderer.php
index a0ddfb39..5c25160d 100644
--- a/renderers/grading_report_renderer.php
+++ b/renderers/grading_report_renderer.php
@@ -47,7 +47,7 @@ class mod_coursework_grading_report_renderer extends plugin_renderer_base {
/**
* @param grading_report $grading_report
- * param $is_multiple_markers
+ * param $ismultiplemarkers
* @return string
*/
public function render_grading_report($gradingreport, $ismultiplemarkers) {
@@ -60,7 +60,7 @@ public function render_grading_report($gradingreport, $ismultiplemarkers) {
if (count($tablerows) == $gradingreport->realtotalrows) {
$options['class'] = 'full-loaded';
}
- $this->row_class = $ismultiplemarkers ? 'submissionrowmulti' : 'submissionrowsingle';
+ $this->rowclass = $ismultiplemarkers ? 'submissionrowmulti' : 'submissionrowsingle';
if (empty($tablerows)) {
return $langelement . ' '.get_string('nousers', 'coursework').' ';
@@ -124,13 +124,13 @@ protected function make_header_cell($cellhelper, $options) {
protected function make_row_for_allocatable($rowobject, $cellhelpers, $subrowhelper) {
//$class = (!$row_object->get_coursework()->has_multiple_markers()) ? "submissionrowsingle": "submissionrowmulti";
- $class = $this->row_class;
+ $class = $this->rowclass;
$submission = $rowobject->get_submission();
$allocatable = $rowobject->get_allocatable();
$tablehtml = ' ';
- $ismultiplemarkers = $this->is_multiple_markers;
+ $ismultiplemarkers = $this->ismultiplemarkers;
$tblassessorfeedbacks = $subrowhelper->get_row_with_assessor_feedback_table($rowobject, count($cellhelpers));
if ($ismultiplemarkers) {
$tablehtml .= ' | ';
@@ -216,14 +216,14 @@ protected function end_table() {
* @param $tablerows
* @param $cell_helpers
* @param $sub_row_helper
- * @param $is_multiple_markers
+ * @param $ismultiplemarkers
* @return string
*/
public function make_rows($tablerows, $cellhelpers, $subrowhelper, $ismultiplemarkers) {
$tablehtml = '';
- $this->row_class = $ismultiplemarkers ? 'submissionrowmulti' : 'submissionrowsingle';
- $this->is_multiple_markers = $ismultiplemarkers;
+ $this->rowclass = $ismultiplemarkers ? 'submissionrowmulti' : 'submissionrowsingle';
+ $this->ismultiplemarkers = $ismultiplemarkers;
foreach ($tablerows as $rowobject) {
$tablehtml .= $this->make_row_for_allocatable($rowobject, $cellhelpers, $subrowhelper);
From bd5b82b58552a392ded8eb82eec7ba2fa9562f60 Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Mon, 9 Sep 2024 16:07:12 +0100
Subject: [PATCH 24/25] CTP-3690 alignment
---
actions/allocate.php | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/actions/allocate.php b/actions/allocate.php
index 1f9180aa..154639a6 100644
--- a/actions/allocate.php
+++ b/actions/allocate.php
@@ -97,13 +97,14 @@
$jsmodule = [
'name' => 'mod_coursework',
'fullpath' => '/mod/coursework/module.js',
- 'requires' => ['base',
- 'node-base'],
+ 'requires' => ['base', 'node-base'],
];
-$PAGE->requires->js_init_call('M.mod_coursework.init_allocate_page',
- ['wwwroot' => $CFG->wwwroot, 'coursemoduleid' => $coursemoduleid],
- false,
- $jsmodule);
+$PAGE->requires->js_init_call(
+ 'M.mod_coursework.init_allocate_page',
+ ['wwwroot' => $CFG->wwwroot, 'coursemoduleid' => $coursemoduleid],
+ false,
+ $jsmodule
+);
$PAGE->requires->string_for_js('sameassessorerror', 'coursework');
From 632b28287e0cace4edc3c7de66732ee3c20ad71e Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Mon, 9 Sep 2024 16:39:55 +0100
Subject: [PATCH 25/25] CTP-3690 correct commit f72a8df
---
classes/grading_report.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/classes/grading_report.php b/classes/grading_report.php
index 1ab601a7..73afd9e7 100644
--- a/classes/grading_report.php
+++ b/classes/grading_report.php
@@ -407,7 +407,7 @@ public function get_table_rows_for_page($rowcount = false) {
$counter = count($rows);
$this->realtotalrows = $counter;
$mode = empty($this->options['mode']) ? self::MODE_GET_ALL : $this->options['mode'];
- if ($mode != self::$modegetall) {
+ if ($mode != self::MODE_GET_ALL) {
$perpage = $this->options['perpage'] ?? 10;
if ($counter > $perpage) {
if ($mode == self::MODE_GET_FIRST_RECORDS) {
|