Skip to content

Commit

Permalink
CTP-3690 var underscores
Browse files Browse the repository at this point in the history
  • Loading branch information
watson8 committed Sep 3, 2024
1 parent dbe675f commit 16f5fa2
Show file tree
Hide file tree
Showing 135 changed files with 2,720 additions and 2,720 deletions.
24 changes: 12 additions & 12 deletions actions/ajax/datatable/grading.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
16 changes: 8 additions & 8 deletions actions/ajax/deadline_extension/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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;

Expand Down
16 changes: 8 additions & 8 deletions actions/ajax/deadline_extension/new.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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;

Expand Down
16 changes: 8 additions & 8 deletions actions/ajax/deadline_extension/submit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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;

Expand Down
28 changes: 14 additions & 14 deletions actions/allocate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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');
}

Expand All @@ -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.
Expand All @@ -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');

Expand Down
4 changes: 2 additions & 2 deletions actions/feedbacks/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
$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);

$params = [
'submissionid' => $submissionid,
'isfinalgrade' => $isfinalgrade,
'assessorid' => $assessorid,
'stage_identifier' => $stage_identifier,
'stage_identifier' => $stageidentifier,
'finalised' => $finalised,
'ajax' => $ajax,
];
Expand Down
4 changes: 2 additions & 2 deletions actions/feedbacks/new.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
$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 = [
'submissionid' => $submissionid,
'cmid' => $cmid,
'feedbackid' => $feedbackid,
'assessorid' => $assessorid,
'stage_identifier' => $stage_identifier,
'stage_identifier' => $stageidentifier,
'ajax' => $ajax,
];
$controller = new mod_coursework\controllers\feedback_controller($params);
Expand Down
20 changes: 10 additions & 10 deletions actions/finalgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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.
Expand All @@ -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();
Expand Down Expand Up @@ -90,7 +90,7 @@
}
}

$params = ['submissionid' => $submission_id,
$params = ['submissionid' => $submissionid,
'assessorid' => $assessorid,
'isfinalgrade' => $isfinalgrade];
$oldfinalgrade = $DB->get_record('coursework_feedbacks', $params);
Expand All @@ -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) {
Expand Down Expand Up @@ -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;
Expand All @@ -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();

Expand Down
4 changes: 2 additions & 2 deletions actions/moderations/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
4 changes: 2 additions & 2 deletions actions/moderations/new.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
14 changes: 7 additions & 7 deletions actions/personal_deadline.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand All @@ -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();
Expand Down
Loading

0 comments on commit 16f5fa2

Please sign in to comment.