From 3f5f8090d1ed9175492d085a4323a68ee473127e Mon Sep 17 00:00:00 2001 From: David Watson <14983002+watson8@users.noreply.github.com> Date: Mon, 12 Aug 2024 09:21:35 +0100 Subject: [PATCH 01/51] CTP-3558 coding std add file headers --- actions/ajax/datatable/grading.php | 21 ++++++++++++++++++ actions/ajax/deadline_extension/edit.php | 21 ++++++++++++++++++ actions/ajax/deadline_extension/new.php | 21 ++++++++++++++++++ actions/ajax/deadline_extension/submit.php | 21 ++++++++++++++++++ actions/allocationsession.php | 21 ++++++++++++++++++ actions/deadline_extensions/create.php | 21 ++++++++++++++++++ actions/deadline_extensions/edit.php | 21 ++++++++++++++++++ actions/deadline_extensions/new.php | 21 ++++++++++++++++++ actions/deadline_extensions/show.php | 21 ++++++++++++++++++ actions/deadline_extensions/update.php | 21 ++++++++++++++++++ actions/feedbacks/create.php | 21 ++++++++++++++++++ actions/feedbacks/update.php | 21 ++++++++++++++++++ actions/moderations/create.php | 21 ++++++++++++++++++ actions/moderations/update.php | 21 ++++++++++++++++++ actions/personal_deadline.php | 21 ++++++++++++++++++ actions/plagiarism_flagging/create.php | 21 ++++++++++++++++++ actions/plagiarism_flagging/update.php | 21 ++++++++++++++++++ actions/processallocation.php | 21 ++++++++++++++++++ actions/selectallallocatables.php | 21 ++++++++++++++++++ actions/submissions/create.php | 21 ++++++++++++++++++ actions/submissions/edit.php | 21 ++++++++++++++++++ actions/submissions/finalise.php | 21 ++++++++++++++++++ actions/submissions/new.php | 21 ++++++++++++++++++ actions/submissions/update.php | 21 ++++++++++++++++++ actions/upload_feedback.php | 21 ++++++++++++++++++ actions/upload_grading_sheet.php | 21 ++++++++++++++++++ .../backup_coursework_activity_task.class.php | 21 ++++++++++++++++++ backup/moodle2/backup_coursework_stepslib.php | 21 ++++++++++++++++++ ...restore_coursework_activity_task.class.php | 21 ++++++++++++++++++ .../moodle2/restore_coursework_stepslib.php | 21 ++++++++++++++++++ classes/ability.php | 21 ++++++++++++++++++ classes/ability/rule.php | 21 ++++++++++++++++++ classes/allocation/allocatable.php | 21 ++++++++++++++++++ classes/allocation/auto_allocator.php | 21 ++++++++++++++++++ classes/allocation/moderatable.php | 21 ++++++++++++++++++ classes/allocation/table/cell/builder.php | 21 ++++++++++++++++++ classes/allocation/table/cell/data.php | 21 ++++++++++++++++++ classes/allocation/table/cell/processor.php | 21 ++++++++++++++++++ classes/allocation/table/processor.php | 21 ++++++++++++++++++ classes/allocation/table/row/processor.php | 21 ++++++++++++++++++ classes/auto_grader/auto_grader.php | 21 ++++++++++++++++++ classes/auto_grader/average_grade.php | 21 ++++++++++++++++++ classes/auto_grader/none.php | 21 ++++++++++++++++++ classes/auto_grader/percentage_distance.php | 21 ++++++++++++++++++ .../controllers/allocations_controller.php | 21 ++++++++++++++++++ classes/controllers/controller_base.php | 21 ++++++++++++++++++ .../deadline_extensions_controller.php | 21 ++++++++++++++++++ classes/controllers/feedback_controller.php | 21 ++++++++++++++++++ classes/controllers/grading_controller.php | 21 ++++++++++++++++++ .../controllers/moderations_controller.php | 21 ++++++++++++++++++ .../personal_deadlines_controller.php | 21 ++++++++++++++++++ .../plagiarism_flagging_controller.php | 21 ++++++++++++++++++ .../controllers/submissions_controller.php | 21 ++++++++++++++++++ classes/cron.php | 21 ++++++++++++++++++ .../coursework_groups_decorator.php | 21 ++++++++++++++++++ .../submission_groups_decorator.php | 21 ++++++++++++++++++ .../course_module_instance_list_viewed.php | 21 ++++++++++++++++++ classes/event/course_module_viewed.php | 21 ++++++++++++++++++ classes/event/feedback_changed.php | 21 ++++++++++++++++++ classes/exceptions/access_denied.php | 21 ++++++++++++++++++ classes/exceptions/late_submission.php | 21 ++++++++++++++++++ .../export/csv/cells/agreedfeedback_cell.php | 21 ++++++++++++++++++ classes/export/csv/cells/agreedgrade_cell.php | 21 ++++++++++++++++++ classes/export/csv/cells/assessor_cell.php | 21 ++++++++++++++++++ .../csv/cells/assessorfeedback_cell.php | 21 ++++++++++++++++++ .../export/csv/cells/assessorgrade_cell.php | 21 ++++++++++++++++++ classes/export/csv/cells/cell_base.php | 21 ++++++++++++++++++ classes/export/csv/cells/cell_interface.php | 21 ++++++++++++++++++ classes/export/csv/cells/email_cell.php | 21 ++++++++++++++++++ .../csv/cells/extensiondeadline_cell.php | 21 ++++++++++++++++++ .../csv/cells/extensionextrainfo_cell.php | 21 ++++++++++++++++++ .../export/csv/cells/extensionreason_cell.php | 21 ++++++++++++++++++ .../csv/cells/feedbackcomments_cell.php | 21 ++++++++++++++++++ classes/export/csv/cells/finalgrade_cell.php | 21 ++++++++++++++++++ classes/export/csv/cells/group_cell.php | 21 ++++++++++++++++++ classes/export/csv/cells/idnumber_cell.php | 21 ++++++++++++++++++ .../csv/cells/moderationagreement_cell.php | 21 ++++++++++++++++++ classes/export/csv/cells/name_cell.php | 21 ++++++++++++++++++ .../export/csv/cells/otherassessors_cell.php | 21 ++++++++++++++++++ .../csv/cells/personaldeadline_cell.php | 21 ++++++++++++++++++ .../csv/cells/plagiarismflagcomment_cell.php | 21 ++++++++++++++++++ .../csv/cells/plagiarismflagstatus_cell.php | 21 ++++++++++++++++++ classes/export/csv/cells/singlegrade_cell.php | 21 ++++++++++++++++++ classes/export/csv/cells/stages_cell.php | 21 ++++++++++++++++++ .../export/csv/cells/submissiondate_cell.php | 21 ++++++++++++++++++ .../csv/cells/submissionfileid_cell.php | 21 ++++++++++++++++++ .../export/csv/cells/submissionid_cell.php | 21 ++++++++++++++++++ .../export/csv/cells/submissiontime_cell.php | 21 ++++++++++++++++++ classes/export/csv/cells/username_cell.php | 21 ++++++++++++++++++ classes/export/import.php | 21 ++++++++++++++++++ classes/file_importer.php | 21 ++++++++++++++++++ classes/forms/deadline_extension_form.php | 21 ++++++++++++++++++ classes/forms/personal_deadline_form.php | 21 ++++++++++++++++++ classes/forms/upload_feedback_form.php | 21 ++++++++++++++++++ classes/forms/upload_grading_sheet_form.php | 21 ++++++++++++++++++ classes/framework/ability.php | 21 ++++++++++++++++++ classes/framework/decorator.php | 21 ++++++++++++++++++ classes/framework/test/classes/user_table.php | 21 ++++++++++++++++++ classes/framework/test/table_base_test.php | 21 ++++++++++++++++++ classes/grade_judge.php | 21 ++++++++++++++++++ classes/mailer.php | 21 ++++++++++++++++++ classes/models/assessment_set_membership.php | 21 ++++++++++++++++++ classes/models/deadline_extension.php | 21 ++++++++++++++++++ classes/models/group.php | 21 ++++++++++++++++++ classes/models/null_feedback.php | 21 ++++++++++++++++++ classes/models/null_user.php | 21 ++++++++++++++++++ classes/models/outstanding_marking.php | 21 ++++++++++++++++++ classes/models/personal_deadline.php | 21 ++++++++++++++++++ classes/models/plagiarism_flag.php | 21 ++++++++++++++++++ classes/models/reminder.php | 21 ++++++++++++++++++ classes/models/user.php | 21 ++++++++++++++++++ classes/personal_deadline/allocatable.php | 21 ++++++++++++++++++ classes/plagiarism_helpers/base.php | 21 ++++++++++++++++++ classes/plagiarism_helpers/turnitin.php | 21 ++++++++++++++++++ .../grading_report/base_renderer.php | 21 ++++++++++++++++++ .../grading_report/cells/_user_cell.php | 21 ++++++++++++++++++ .../grading_report/cells/allocatable_cell.php | 21 ++++++++++++++++++ .../grading_report/cells/cell_base.php | 21 ++++++++++++++++++ .../grading_report/cells/cell_interface.php | 21 ++++++++++++++++++ .../grading_report/cells/email_cell.php | 21 ++++++++++++++++++ .../grading_report/cells/first_name_cell.php | 21 ++++++++++++++++++ .../cells/first_name_letter_cell.php | 21 ++++++++++++++++++ .../cells/grade_for_gradebook_cell.php | 21 ++++++++++++++++++ .../grading_report/cells/group_cell.php | 21 ++++++++++++++++++ .../grading_report/cells/idnumber_cell.php | 21 ++++++++++++++++++ .../grading_report/cells/last_name_cell.php | 21 ++++++++++++++++++ .../cells/last_name_letter_cell.php | 21 ++++++++++++++++++ .../cells/moderation_agreement_cell.php | 21 ++++++++++++++++++ .../grading_report/cells/moderation_cell.php | 21 ++++++++++++++++++ .../cells/multiple_agreed_grade_cell.php | 21 ++++++++++++++++++ .../cells/personal_deadline_cell.php | 21 ++++++++++++++++++ .../grading_report/cells/plagiarism_cell.php | 21 ++++++++++++++++++ .../cells/plagiarism_flag_cell.php | 21 ++++++++++++++++++ .../cells/single_assessor_feedback_cell.php | 21 ++++++++++++++++++ .../grading_report/cells/status_cell.php | 21 ++++++++++++++++++ .../grading_report/cells/submission_cell.php | 21 ++++++++++++++++++ .../cells/time_submitted_cell.php | 21 ++++++++++++++++++ .../grading_report/cells/user_cell.php | 21 ++++++++++++++++++ .../component_factory_interface.php | 21 ++++++++++++++++++ .../grading_report/multi_renderer.php | 21 ++++++++++++++++++ .../grading_report/single_renderer.php | 21 ++++++++++++++++++ .../multi_marker_feedback_sub_rows.php | 21 ++++++++++++++++++ .../grading_report/sub_rows/no_sub_rows.php | 21 ++++++++++++++++++ .../sub_rows/sub_rows_interface.php | 21 ++++++++++++++++++ .../renderers/deadline_extension_renderer.php | 21 ++++++++++++++++++ .../renderers/personal_deadline_renderer.php | 21 ++++++++++++++++++ classes/router.php | 21 ++++++++++++++++++ classes/sample_set_rule/sample_base.php | 22 ++++++++++++------- classes/stages/assessor.php | 21 ++++++++++++++++++ classes/stages/base.php | 21 ++++++++++++++++++ classes/stages/final_agreed.php | 21 ++++++++++++++++++ classes/stages/moderator.php | 21 ++++++++++++++++++ classes/test_helpers/factory_mixin.php | 21 ++++++++++++++++++ classes/traits/allocatable_functions.php | 21 ++++++++++++++++++ classes/warnings.php | 21 ++++++++++++++++++ db/caches.php | 21 ++++++++++++++++++ db/install.php | 21 ++++++++++++++++++ renderable.php | 21 ++++++++++++++++++ renderers/grading_report_renderer.php | 21 ++++++++++++++++++ renderers/object_renderer.php | 21 ++++++++++++++++++ renderers/page_renderer.php | 21 ++++++++++++++++++ tests/behat/behat_mod_coursework.php | 21 ++++++++++++++++++ tests/behat/pages/allocations_page.php | 21 ++++++++++++++++++ tests/behat/pages/coursework_page.php | 21 ++++++++++++++++++ tests/behat/pages/edit_extension_page.php | 21 ++++++++++++++++++ tests/behat/pages/gradebook_page.php | 21 ++++++++++++++++++ tests/behat/pages/login_page.php | 21 ++++++++++++++++++ .../pages/multiple_grading_interface.php | 21 ++++++++++++++++++ tests/behat/pages/new_extension_page.php | 21 ++++++++++++++++++ tests/behat/pages/page_base.php | 21 ++++++++++++++++++ tests/behat/pages/show_feedback_page.php | 21 ++++++++++++++++++ .../behat/pages/single_grading_interface.php | 21 ++++++++++++++++++ tests/behat/pages/student_page.php | 21 ++++++++++++++++++ tests/behat/pages/student_submission_form.php | 21 ++++++++++++++++++ tests/classes/ability_test.php | 21 ++++++++++++++++++ .../allocation/auto_allocator_test.php | 21 ++++++++++++++++++ .../allocation/form/table_processor_test.php | 21 ++++++++++++++++++ .../allocation/strategy/percentages_test.php | 21 ++++++++++++++++++ .../auto_grader/percentage_distance_test.php | 21 ++++++++++++++++++ .../deadline_extensions_controller_test.php | 21 ++++++++++++++++++ tests/classes/cron_test.php | 21 ++++++++++++++++++ tests/classes/grade_judge_test.php | 21 ++++++++++++++++++ .../models/deadline_extension_test.php | 21 ++++++++++++++++++ tests/classes/models/group_test.php | 21 ++++++++++++++++++ .../models/moderation_set_membership_test.php | 21 ++++++++++++++++++ tests/classes/models/user_test.php | 21 ++++++++++++++++++ tests/classes/router_test.php | 21 ++++++++++++++++++ tests/classes/rule_test.php | 21 ++++++++++++++++++ tests/classes/stages/assessor_test.php | 21 ++++++++++++++++++ tests/classes/stages/final_agreed_test.php | 21 ++++++++++++++++++ tests/cron_tester.php | 21 ++++++++++++++++++ 191 files changed, 4004 insertions(+), 8 deletions(-) diff --git a/actions/ajax/datatable/grading.php b/actions/ajax/datatable/grading.php index a3875c18..c1ad9542 100644 --- a/actions/ajax/datatable/grading.php +++ b/actions/ajax/datatable/grading.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + ob_start(); require_once(dirname(__FILE__) . '/../../../../../config.php'); diff --git a/actions/ajax/deadline_extension/edit.php b/actions/ajax/deadline_extension/edit.php index 34a70bb2..bc034c37 100644 --- a/actions/ajax/deadline_extension/edit.php +++ b/actions/ajax/deadline_extension/edit.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + require_once(dirname(__FILE__) . '/../../../../../config.php'); diff --git a/actions/ajax/deadline_extension/new.php b/actions/ajax/deadline_extension/new.php index 59b9ac9c..d2df1e03 100644 --- a/actions/ajax/deadline_extension/new.php +++ b/actions/ajax/deadline_extension/new.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + require_once(dirname(__FILE__) . '/../../../../../config.php'); diff --git a/actions/ajax/deadline_extension/submit.php b/actions/ajax/deadline_extension/submit.php index 2e46b34a..b9b0509f 100644 --- a/actions/ajax/deadline_extension/submit.php +++ b/actions/ajax/deadline_extension/submit.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + require_once(dirname(__FILE__) . '/../../../../../config.php'); diff --git a/actions/allocationsession.php b/actions/allocationsession.php index eb59b009..de0d0807 100644 --- a/actions/allocationsession.php +++ b/actions/allocationsession.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + require_once("../../../config.php"); global $SESSION; diff --git a/actions/deadline_extensions/create.php b/actions/deadline_extensions/create.php index 27de4624..d1f091bc 100644 --- a/actions/deadline_extensions/create.php +++ b/actions/deadline_extensions/create.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + require_once(dirname(__FILE__) . '/../../../../config.php'); diff --git a/actions/deadline_extensions/edit.php b/actions/deadline_extensions/edit.php index 48a66432..973e97e8 100644 --- a/actions/deadline_extensions/edit.php +++ b/actions/deadline_extensions/edit.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + require_once(dirname(__FILE__) . '/../../../../config.php'); diff --git a/actions/deadline_extensions/new.php b/actions/deadline_extensions/new.php index 43002b8d..0b8b54f9 100644 --- a/actions/deadline_extensions/new.php +++ b/actions/deadline_extensions/new.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + require_once(dirname(__FILE__) . '/../../../../config.php'); diff --git a/actions/deadline_extensions/show.php b/actions/deadline_extensions/show.php index 5b8f780f..b5f4aa55 100644 --- a/actions/deadline_extensions/show.php +++ b/actions/deadline_extensions/show.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + require_once(dirname(__FILE__) . '/../../../../config.php'); diff --git a/actions/deadline_extensions/update.php b/actions/deadline_extensions/update.php index cc07a0d0..0c04a660 100644 --- a/actions/deadline_extensions/update.php +++ b/actions/deadline_extensions/update.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + require_once(dirname(__FILE__) . '/../../../../config.php'); diff --git a/actions/feedbacks/create.php b/actions/feedbacks/create.php index a7ab4ffa..c9c3e2a6 100644 --- a/actions/feedbacks/create.php +++ b/actions/feedbacks/create.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Creates a feedback instance and redirects to the coursework page. diff --git a/actions/feedbacks/update.php b/actions/feedbacks/update.php index d0fe7643..a7c9e039 100644 --- a/actions/feedbacks/update.php +++ b/actions/feedbacks/update.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Creates a feedback instance and redirects to the coursework page. diff --git a/actions/moderations/create.php b/actions/moderations/create.php index d4303031..f65c257b 100644 --- a/actions/moderations/create.php +++ b/actions/moderations/create.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Creates a moderation agreement instance and redirects to the coursework page. diff --git a/actions/moderations/update.php b/actions/moderations/update.php index da792420..3d005d3e 100644 --- a/actions/moderations/update.php +++ b/actions/moderations/update.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Creates a moderation instance and redirects to the coursework page. diff --git a/actions/personal_deadline.php b/actions/personal_deadline.php index baf5be4f..a7235b0b 100644 --- a/actions/personal_deadline.php +++ b/actions/personal_deadline.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + require_once(dirname(__FILE__) . '/../../../config.php'); diff --git a/actions/plagiarism_flagging/create.php b/actions/plagiarism_flagging/create.php index c0572e16..d870cb19 100644 --- a/actions/plagiarism_flagging/create.php +++ b/actions/plagiarism_flagging/create.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Creates a plagiarism flagging instance and redirects to the coursework page. diff --git a/actions/plagiarism_flagging/update.php b/actions/plagiarism_flagging/update.php index bde1335a..35aa5e41 100644 --- a/actions/plagiarism_flagging/update.php +++ b/actions/plagiarism_flagging/update.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Updates a plagiarism flag instance and redirects to the coursework page. diff --git a/actions/processallocation.php b/actions/processallocation.php index e5ebd4c3..619bed50 100644 --- a/actions/processallocation.php +++ b/actions/processallocation.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + //this stops the page from aborting when an ajax call disconnects ignore_user_abort(true); diff --git a/actions/selectallallocatables.php b/actions/selectallallocatables.php index 679150bf..b87cd6eb 100644 --- a/actions/selectallallocatables.php +++ b/actions/selectallallocatables.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + use \mod_coursework\models\coursework; diff --git a/actions/submissions/create.php b/actions/submissions/create.php index 37177ad2..e8814473 100644 --- a/actions/submissions/create.php +++ b/actions/submissions/create.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Creates a submission instance and redirects to the coursework page. diff --git a/actions/submissions/edit.php b/actions/submissions/edit.php index 58ebe594..6dc5473f 100644 --- a/actions/submissions/edit.php +++ b/actions/submissions/edit.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Creates a submission instance and redirects to the coursework page. diff --git a/actions/submissions/finalise.php b/actions/submissions/finalise.php index f729a594..4c9069a3 100644 --- a/actions/submissions/finalise.php +++ b/actions/submissions/finalise.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Creates a submission instance and redirects to the coursework page. diff --git a/actions/submissions/new.php b/actions/submissions/new.php index cf4bb1a5..ba6d0aef 100644 --- a/actions/submissions/new.php +++ b/actions/submissions/new.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Creates a submission instance and redirects to the coursework page. diff --git a/actions/submissions/update.php b/actions/submissions/update.php index dc7d3593..ef7ecb60 100644 --- a/actions/submissions/update.php +++ b/actions/submissions/update.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Creates a submission instance and redirects to the coursework page. diff --git a/actions/upload_feedback.php b/actions/upload_feedback.php index 62f4e361..f4ccf593 100644 --- a/actions/upload_feedback.php +++ b/actions/upload_feedback.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Created by PhpStorm. * User: Nigel.Daley diff --git a/actions/upload_grading_sheet.php b/actions/upload_grading_sheet.php index 57a8acd6..c76905f3 100644 --- a/actions/upload_grading_sheet.php +++ b/actions/upload_grading_sheet.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Created by PhpStorm. * User: Nigel.Daley diff --git a/backup/moodle2/backup_coursework_activity_task.class.php b/backup/moodle2/backup_coursework_activity_task.class.php index 171f7f67..94d5cedb 100644 --- a/backup/moodle2/backup_coursework_activity_task.class.php +++ b/backup/moodle2/backup_coursework_activity_task.class.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + require_once($CFG->dirroot . '/mod/coursework/backup/moodle2/backup_coursework_stepslib.php'); diff --git a/backup/moodle2/backup_coursework_stepslib.php b/backup/moodle2/backup_coursework_stepslib.php index e092e90f..bc9e1994 100644 --- a/backup/moodle2/backup_coursework_stepslib.php +++ b/backup/moodle2/backup_coursework_stepslib.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + class backup_coursework_activity_structure_step extends backup_activity_structure_step { diff --git a/backup/moodle2/restore_coursework_activity_task.class.php b/backup/moodle2/restore_coursework_activity_task.class.php index 7f7310b3..f346f537 100644 --- a/backup/moodle2/restore_coursework_activity_task.class.php +++ b/backup/moodle2/restore_coursework_activity_task.class.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + defined('MOODLE_INTERNAL') || die(); diff --git a/backup/moodle2/restore_coursework_stepslib.php b/backup/moodle2/restore_coursework_stepslib.php index 0a5d6ecc..ff15bc9e 100644 --- a/backup/moodle2/restore_coursework_stepslib.php +++ b/backup/moodle2/restore_coursework_stepslib.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + defined('MOODLE_INTERNAL') || die(); diff --git a/classes/ability.php b/classes/ability.php index b45aa042..452d0869 100644 --- a/classes/ability.php +++ b/classes/ability.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework; diff --git a/classes/ability/rule.php b/classes/ability/rule.php index d9e9fc7f..2154c5a0 100644 --- a/classes/ability/rule.php +++ b/classes/ability/rule.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\ability; diff --git a/classes/allocation/allocatable.php b/classes/allocation/allocatable.php index 06fb2a87..836fb17f 100644 --- a/classes/allocation/allocatable.php +++ b/classes/allocation/allocatable.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\allocation; use mod_coursework\models\coursework; diff --git a/classes/allocation/auto_allocator.php b/classes/allocation/auto_allocator.php index 4caa89ab..7340ee33 100644 --- a/classes/allocation/auto_allocator.php +++ b/classes/allocation/auto_allocator.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\allocation; diff --git a/classes/allocation/moderatable.php b/classes/allocation/moderatable.php index 8ade7881..e9628f6d 100644 --- a/classes/allocation/moderatable.php +++ b/classes/allocation/moderatable.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\allocation; diff --git a/classes/allocation/table/cell/builder.php b/classes/allocation/table/cell/builder.php index cd86737a..5f177516 100644 --- a/classes/allocation/table/cell/builder.php +++ b/classes/allocation/table/cell/builder.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\allocation\table\cell; use mod_coursework\models\allocation; diff --git a/classes/allocation/table/cell/data.php b/classes/allocation/table/cell/data.php index a32765c4..08a13758 100644 --- a/classes/allocation/table/cell/data.php +++ b/classes/allocation/table/cell/data.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\allocation\table\cell; use mod_coursework\models\user; diff --git a/classes/allocation/table/cell/processor.php b/classes/allocation/table/cell/processor.php index b556e00e..fdb29c70 100644 --- a/classes/allocation/table/cell/processor.php +++ b/classes/allocation/table/cell/processor.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\allocation\table\cell; use mod_coursework\models\allocation; diff --git a/classes/allocation/table/processor.php b/classes/allocation/table/processor.php index d89270aa..4cb43a41 100644 --- a/classes/allocation/table/processor.php +++ b/classes/allocation/table/processor.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * This class is here to take the data from the table on the allocation page and process each diff --git a/classes/allocation/table/row/processor.php b/classes/allocation/table/row/processor.php index b50784a0..c333c861 100644 --- a/classes/allocation/table/row/processor.php +++ b/classes/allocation/table/row/processor.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\allocation\table\row; use mod_coursework\allocation\allocatable; diff --git a/classes/auto_grader/auto_grader.php b/classes/auto_grader/auto_grader.php index 08f2a843..9a738960 100644 --- a/classes/auto_grader/auto_grader.php +++ b/classes/auto_grader/auto_grader.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\auto_grader; diff --git a/classes/auto_grader/average_grade.php b/classes/auto_grader/average_grade.php index e74faaee..3d509cc0 100644 --- a/classes/auto_grader/average_grade.php +++ b/classes/auto_grader/average_grade.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\auto_grader; diff --git a/classes/auto_grader/none.php b/classes/auto_grader/none.php index 13383bd2..4c806988 100644 --- a/classes/auto_grader/none.php +++ b/classes/auto_grader/none.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\auto_grader; diff --git a/classes/auto_grader/percentage_distance.php b/classes/auto_grader/percentage_distance.php index 055880d6..f0241a4c 100644 --- a/classes/auto_grader/percentage_distance.php +++ b/classes/auto_grader/percentage_distance.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\auto_grader; diff --git a/classes/controllers/allocations_controller.php b/classes/controllers/allocations_controller.php index 5966cb66..aece883f 100644 --- a/classes/controllers/allocations_controller.php +++ b/classes/controllers/allocations_controller.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\controllers; diff --git a/classes/controllers/controller_base.php b/classes/controllers/controller_base.php index 1cc48ef9..2e5a30fe 100644 --- a/classes/controllers/controller_base.php +++ b/classes/controllers/controller_base.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\controllers; diff --git a/classes/controllers/deadline_extensions_controller.php b/classes/controllers/deadline_extensions_controller.php index 7fbc230f..183a1a64 100644 --- a/classes/controllers/deadline_extensions_controller.php +++ b/classes/controllers/deadline_extensions_controller.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\controllers; use mod_coursework\ability; diff --git a/classes/controllers/feedback_controller.php b/classes/controllers/feedback_controller.php index 54cd5048..cbae9c96 100644 --- a/classes/controllers/feedback_controller.php +++ b/classes/controllers/feedback_controller.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\controllers; diff --git a/classes/controllers/grading_controller.php b/classes/controllers/grading_controller.php index 1881ce17..4f7ef8d1 100644 --- a/classes/controllers/grading_controller.php +++ b/classes/controllers/grading_controller.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\controllers; diff --git a/classes/controllers/moderations_controller.php b/classes/controllers/moderations_controller.php index 445c9383..7e9cd6dc 100644 --- a/classes/controllers/moderations_controller.php +++ b/classes/controllers/moderations_controller.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\controllers; diff --git a/classes/controllers/personal_deadlines_controller.php b/classes/controllers/personal_deadlines_controller.php index 160e05fe..da85bd38 100644 --- a/classes/controllers/personal_deadlines_controller.php +++ b/classes/controllers/personal_deadlines_controller.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\controllers; use mod_coursework\ability; diff --git a/classes/controllers/plagiarism_flagging_controller.php b/classes/controllers/plagiarism_flagging_controller.php index 6db924eb..8effca0c 100644 --- a/classes/controllers/plagiarism_flagging_controller.php +++ b/classes/controllers/plagiarism_flagging_controller.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\controllers; diff --git a/classes/controllers/submissions_controller.php b/classes/controllers/submissions_controller.php index 14e44b2c..3fec188f 100644 --- a/classes/controllers/submissions_controller.php +++ b/classes/controllers/submissions_controller.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\controllers; diff --git a/classes/cron.php b/classes/cron.php index 7cb41590..b5b8fa2b 100644 --- a/classes/cron.php +++ b/classes/cron.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework; use context; diff --git a/classes/decorators/coursework_groups_decorator.php b/classes/decorators/coursework_groups_decorator.php index dcac15fc..6b8f76f6 100644 --- a/classes/decorators/coursework_groups_decorator.php +++ b/classes/decorators/coursework_groups_decorator.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\decorators; use mod_coursework\framework\decorator; diff --git a/classes/decorators/submission_groups_decorator.php b/classes/decorators/submission_groups_decorator.php index 3edfb24f..e3297959 100644 --- a/classes/decorators/submission_groups_decorator.php +++ b/classes/decorators/submission_groups_decorator.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\decorators; diff --git a/classes/event/course_module_instance_list_viewed.php b/classes/event/course_module_instance_list_viewed.php index 1fa6b8f6..cf4c518b 100644 --- a/classes/event/course_module_instance_list_viewed.php +++ b/classes/event/course_module_instance_list_viewed.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + // This file is part of the Certificate module for Moodle - http://moodle.org/ // diff --git a/classes/event/course_module_viewed.php b/classes/event/course_module_viewed.php index ca021329..31bfdfe3 100644 --- a/classes/event/course_module_viewed.php +++ b/classes/event/course_module_viewed.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\event; diff --git a/classes/event/feedback_changed.php b/classes/event/feedback_changed.php index 3874a277..6cf18f87 100644 --- a/classes/event/feedback_changed.php +++ b/classes/event/feedback_changed.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + diff --git a/classes/exceptions/access_denied.php b/classes/exceptions/access_denied.php index 9ec3d833..8bf68240 100644 --- a/classes/exceptions/access_denied.php +++ b/classes/exceptions/access_denied.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\exceptions; diff --git a/classes/exceptions/late_submission.php b/classes/exceptions/late_submission.php index a7f7ed74..b009aea0 100644 --- a/classes/exceptions/late_submission.php +++ b/classes/exceptions/late_submission.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\exceptions; diff --git a/classes/export/csv/cells/agreedfeedback_cell.php b/classes/export/csv/cells/agreedfeedback_cell.php index f246bf62..6c7f44a0 100644 --- a/classes/export/csv/cells/agreedfeedback_cell.php +++ b/classes/export/csv/cells/agreedfeedback_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; use mod_coursework\models\submission; diff --git a/classes/export/csv/cells/agreedgrade_cell.php b/classes/export/csv/cells/agreedgrade_cell.php index 2cc45c1e..1b9a6157 100644 --- a/classes/export/csv/cells/agreedgrade_cell.php +++ b/classes/export/csv/cells/agreedgrade_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; use mod_coursework\models\submission; diff --git a/classes/export/csv/cells/assessor_cell.php b/classes/export/csv/cells/assessor_cell.php index 96f6b125..ea9fcba4 100644 --- a/classes/export/csv/cells/assessor_cell.php +++ b/classes/export/csv/cells/assessor_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; use mod_coursework\models\submission; diff --git a/classes/export/csv/cells/assessorfeedback_cell.php b/classes/export/csv/cells/assessorfeedback_cell.php index c17e026c..7f5cc46d 100644 --- a/classes/export/csv/cells/assessorfeedback_cell.php +++ b/classes/export/csv/cells/assessorfeedback_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; use mod_coursework\models\submission; diff --git a/classes/export/csv/cells/assessorgrade_cell.php b/classes/export/csv/cells/assessorgrade_cell.php index 8abf1a2a..8bef322f 100644 --- a/classes/export/csv/cells/assessorgrade_cell.php +++ b/classes/export/csv/cells/assessorgrade_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; use mod_coursework\models\submission; diff --git a/classes/export/csv/cells/cell_base.php b/classes/export/csv/cells/cell_base.php index 992b9eef..2fbbdf05 100644 --- a/classes/export/csv/cells/cell_base.php +++ b/classes/export/csv/cells/cell_base.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; use mod_coursework\models\coursework; diff --git a/classes/export/csv/cells/cell_interface.php b/classes/export/csv/cells/cell_interface.php index 278ecd97..db4331bd 100644 --- a/classes/export/csv/cells/cell_interface.php +++ b/classes/export/csv/cells/cell_interface.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; diff --git a/classes/export/csv/cells/email_cell.php b/classes/export/csv/cells/email_cell.php index d073488a..0e4f93fd 100644 --- a/classes/export/csv/cells/email_cell.php +++ b/classes/export/csv/cells/email_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; use mod_coursework\models\submission; diff --git a/classes/export/csv/cells/extensiondeadline_cell.php b/classes/export/csv/cells/extensiondeadline_cell.php index 355564ac..9428e0ce 100644 --- a/classes/export/csv/cells/extensiondeadline_cell.php +++ b/classes/export/csv/cells/extensiondeadline_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; diff --git a/classes/export/csv/cells/extensionextrainfo_cell.php b/classes/export/csv/cells/extensionextrainfo_cell.php index 5aa9942b..4f4aa63d 100644 --- a/classes/export/csv/cells/extensionextrainfo_cell.php +++ b/classes/export/csv/cells/extensionextrainfo_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; diff --git a/classes/export/csv/cells/extensionreason_cell.php b/classes/export/csv/cells/extensionreason_cell.php index a3280ef9..957109fa 100644 --- a/classes/export/csv/cells/extensionreason_cell.php +++ b/classes/export/csv/cells/extensionreason_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; diff --git a/classes/export/csv/cells/feedbackcomments_cell.php b/classes/export/csv/cells/feedbackcomments_cell.php index 8bedf42c..473e5a10 100644 --- a/classes/export/csv/cells/feedbackcomments_cell.php +++ b/classes/export/csv/cells/feedbackcomments_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; use mod_coursework\models\submission; diff --git a/classes/export/csv/cells/finalgrade_cell.php b/classes/export/csv/cells/finalgrade_cell.php index 1097d858..1ec55174 100644 --- a/classes/export/csv/cells/finalgrade_cell.php +++ b/classes/export/csv/cells/finalgrade_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; use mod_coursework\models\submission; diff --git a/classes/export/csv/cells/group_cell.php b/classes/export/csv/cells/group_cell.php index 4b4aec77..f98cda35 100644 --- a/classes/export/csv/cells/group_cell.php +++ b/classes/export/csv/cells/group_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; diff --git a/classes/export/csv/cells/idnumber_cell.php b/classes/export/csv/cells/idnumber_cell.php index ac72c005..5574041a 100644 --- a/classes/export/csv/cells/idnumber_cell.php +++ b/classes/export/csv/cells/idnumber_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; use mod_coursework\models\submission; diff --git a/classes/export/csv/cells/moderationagreement_cell.php b/classes/export/csv/cells/moderationagreement_cell.php index 80ceb071..8cbbc81f 100644 --- a/classes/export/csv/cells/moderationagreement_cell.php +++ b/classes/export/csv/cells/moderationagreement_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; use mod_coursework\models\submission; diff --git a/classes/export/csv/cells/name_cell.php b/classes/export/csv/cells/name_cell.php index da45f97b..812abf73 100644 --- a/classes/export/csv/cells/name_cell.php +++ b/classes/export/csv/cells/name_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; use mod_coursework\models\submission; diff --git a/classes/export/csv/cells/otherassessors_cell.php b/classes/export/csv/cells/otherassessors_cell.php index 2594d065..aa0861fa 100644 --- a/classes/export/csv/cells/otherassessors_cell.php +++ b/classes/export/csv/cells/otherassessors_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; use mod_coursework\models\submission; diff --git a/classes/export/csv/cells/personaldeadline_cell.php b/classes/export/csv/cells/personaldeadline_cell.php index 02c455ae..96886744 100644 --- a/classes/export/csv/cells/personaldeadline_cell.php +++ b/classes/export/csv/cells/personaldeadline_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; use mod_coursework\models\submission; diff --git a/classes/export/csv/cells/plagiarismflagcomment_cell.php b/classes/export/csv/cells/plagiarismflagcomment_cell.php index 24952a62..571a87d4 100644 --- a/classes/export/csv/cells/plagiarismflagcomment_cell.php +++ b/classes/export/csv/cells/plagiarismflagcomment_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; diff --git a/classes/export/csv/cells/plagiarismflagstatus_cell.php b/classes/export/csv/cells/plagiarismflagstatus_cell.php index 801f6280..773e6e40 100644 --- a/classes/export/csv/cells/plagiarismflagstatus_cell.php +++ b/classes/export/csv/cells/plagiarismflagstatus_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; diff --git a/classes/export/csv/cells/singlegrade_cell.php b/classes/export/csv/cells/singlegrade_cell.php index 42e7563c..fa52c3cb 100644 --- a/classes/export/csv/cells/singlegrade_cell.php +++ b/classes/export/csv/cells/singlegrade_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; use mod_coursework\models\submission; diff --git a/classes/export/csv/cells/stages_cell.php b/classes/export/csv/cells/stages_cell.php index cd2e7c1c..49a291e8 100644 --- a/classes/export/csv/cells/stages_cell.php +++ b/classes/export/csv/cells/stages_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; use mod_coursework\models\submission; diff --git a/classes/export/csv/cells/submissiondate_cell.php b/classes/export/csv/cells/submissiondate_cell.php index a1293316..306ed8af 100644 --- a/classes/export/csv/cells/submissiondate_cell.php +++ b/classes/export/csv/cells/submissiondate_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; use mod_coursework\models\submission; diff --git a/classes/export/csv/cells/submissionfileid_cell.php b/classes/export/csv/cells/submissionfileid_cell.php index fa73c56b..85bd447b 100644 --- a/classes/export/csv/cells/submissionfileid_cell.php +++ b/classes/export/csv/cells/submissionfileid_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; diff --git a/classes/export/csv/cells/submissionid_cell.php b/classes/export/csv/cells/submissionid_cell.php index 4d236f5a..392fe07e 100644 --- a/classes/export/csv/cells/submissionid_cell.php +++ b/classes/export/csv/cells/submissionid_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; diff --git a/classes/export/csv/cells/submissiontime_cell.php b/classes/export/csv/cells/submissiontime_cell.php index 0ed18839..e71e524e 100644 --- a/classes/export/csv/cells/submissiontime_cell.php +++ b/classes/export/csv/cells/submissiontime_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; diff --git a/classes/export/csv/cells/username_cell.php b/classes/export/csv/cells/username_cell.php index 9869cd40..2528e49b 100644 --- a/classes/export/csv/cells/username_cell.php +++ b/classes/export/csv/cells/username_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export\csv\cells; use mod_coursework\models\submission; diff --git a/classes/export/import.php b/classes/export/import.php index b79aeb6a..8b3df941 100644 --- a/classes/export/import.php +++ b/classes/export/import.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\export; use mod_coursework\export\csv; use mod_coursework\grade_judge; diff --git a/classes/file_importer.php b/classes/file_importer.php index 576bd3a3..02de0dc2 100644 --- a/classes/file_importer.php +++ b/classes/file_importer.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework; diff --git a/classes/forms/deadline_extension_form.php b/classes/forms/deadline_extension_form.php index 084c28a0..b07d3256 100644 --- a/classes/forms/deadline_extension_form.php +++ b/classes/forms/deadline_extension_form.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\forms; use mod_coursework\models\coursework; diff --git a/classes/forms/personal_deadline_form.php b/classes/forms/personal_deadline_form.php index 78f950f0..bebed249 100644 --- a/classes/forms/personal_deadline_form.php +++ b/classes/forms/personal_deadline_form.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\forms; use mod_coursework\models\coursework; diff --git a/classes/forms/upload_feedback_form.php b/classes/forms/upload_feedback_form.php index 4b01b931..e55ca05c 100644 --- a/classes/forms/upload_feedback_form.php +++ b/classes/forms/upload_feedback_form.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Created by PhpStorm. * User: Nigel.Daley diff --git a/classes/forms/upload_grading_sheet_form.php b/classes/forms/upload_grading_sheet_form.php index 564ba116..9d2e4035 100644 --- a/classes/forms/upload_grading_sheet_form.php +++ b/classes/forms/upload_grading_sheet_form.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Created by PhpStorm. * User: Nigel.Daley diff --git a/classes/framework/ability.php b/classes/framework/ability.php index 94ac93a4..84c7add9 100644 --- a/classes/framework/ability.php +++ b/classes/framework/ability.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\framework; use mod_coursework\ability\rule; diff --git a/classes/framework/decorator.php b/classes/framework/decorator.php index 57d988ae..4795cd30 100644 --- a/classes/framework/decorator.php +++ b/classes/framework/decorator.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\framework; diff --git a/classes/framework/test/classes/user_table.php b/classes/framework/test/classes/user_table.php index 02fdda36..166155eb 100644 --- a/classes/framework/test/classes/user_table.php +++ b/classes/framework/test/classes/user_table.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Class framework_user_table allows us to test the table_base class on a reasonably stable table diff --git a/classes/framework/test/table_base_test.php b/classes/framework/test/table_base_test.php index 846e448e..0dbf082d 100644 --- a/classes/framework/test/table_base_test.php +++ b/classes/framework/test/table_base_test.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + defined('MOODLE_INTERNAL') || die(); diff --git a/classes/grade_judge.php b/classes/grade_judge.php index c218c0cf..3fab58b2 100644 --- a/classes/grade_judge.php +++ b/classes/grade_judge.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework; diff --git a/classes/mailer.php b/classes/mailer.php index 99ab0ed3..7f50d174 100644 --- a/classes/mailer.php +++ b/classes/mailer.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework; use mod_coursework\models\submission; diff --git a/classes/models/assessment_set_membership.php b/classes/models/assessment_set_membership.php index 5482ab94..260012b0 100644 --- a/classes/models/assessment_set_membership.php +++ b/classes/models/assessment_set_membership.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * This class allows us to add functionality to the users, despite the fact that Moodle has no diff --git a/classes/models/deadline_extension.php b/classes/models/deadline_extension.php index 465d9af5..158ef146 100644 --- a/classes/models/deadline_extension.php +++ b/classes/models/deadline_extension.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\models; diff --git a/classes/models/group.php b/classes/models/group.php index e75fc939..698a0741 100644 --- a/classes/models/group.php +++ b/classes/models/group.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * This class allows us to add functionality to the users, despite the fact that Moodle has no diff --git a/classes/models/null_feedback.php b/classes/models/null_feedback.php index 7cadb816..d82e14b6 100644 --- a/classes/models/null_feedback.php +++ b/classes/models/null_feedback.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\models; diff --git a/classes/models/null_user.php b/classes/models/null_user.php index f8dc241c..1aadc5b7 100644 --- a/classes/models/null_user.php +++ b/classes/models/null_user.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\models; diff --git a/classes/models/outstanding_marking.php b/classes/models/outstanding_marking.php index 582b4a8b..f469a425 100644 --- a/classes/models/outstanding_marking.php +++ b/classes/models/outstanding_marking.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\models; class outstanding_marking { diff --git a/classes/models/personal_deadline.php b/classes/models/personal_deadline.php index c8349b18..c599cef7 100644 --- a/classes/models/personal_deadline.php +++ b/classes/models/personal_deadline.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\models; diff --git a/classes/models/plagiarism_flag.php b/classes/models/plagiarism_flag.php index d5e5bf1b..7f1b506e 100644 --- a/classes/models/plagiarism_flag.php +++ b/classes/models/plagiarism_flag.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\models; diff --git a/classes/models/reminder.php b/classes/models/reminder.php index 36be80e2..6c687ded 100644 --- a/classes/models/reminder.php +++ b/classes/models/reminder.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\models; diff --git a/classes/models/user.php b/classes/models/user.php index 80b6cfc8..f6313999 100644 --- a/classes/models/user.php +++ b/classes/models/user.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * This class allows us to add functionality to the users, despite the fact that Moodle has no diff --git a/classes/personal_deadline/allocatable.php b/classes/personal_deadline/allocatable.php index 919dc25b..8cf248f1 100644 --- a/classes/personal_deadline/allocatable.php +++ b/classes/personal_deadline/allocatable.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\personal_deadline; use mod_coursework\models\coursework; diff --git a/classes/plagiarism_helpers/base.php b/classes/plagiarism_helpers/base.php index 4fc98e52..ef694a02 100644 --- a/classes/plagiarism_helpers/base.php +++ b/classes/plagiarism_helpers/base.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\plagiarism_helpers; use mod_coursework\models\coursework; diff --git a/classes/plagiarism_helpers/turnitin.php b/classes/plagiarism_helpers/turnitin.php index ca03191d..36f60f69 100644 --- a/classes/plagiarism_helpers/turnitin.php +++ b/classes/plagiarism_helpers/turnitin.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\plagiarism_helpers; diff --git a/classes/render_helpers/grading_report/base_renderer.php b/classes/render_helpers/grading_report/base_renderer.php index ed4ec4e7..2ab83c6e 100644 --- a/classes/render_helpers/grading_report/base_renderer.php +++ b/classes/render_helpers/grading_report/base_renderer.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report; diff --git a/classes/render_helpers/grading_report/cells/_user_cell.php b/classes/render_helpers/grading_report/cells/_user_cell.php index 2ed15136..72ad4c80 100644 --- a/classes/render_helpers/grading_report/cells/_user_cell.php +++ b/classes/render_helpers/grading_report/cells/_user_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; use core_user; diff --git a/classes/render_helpers/grading_report/cells/allocatable_cell.php b/classes/render_helpers/grading_report/cells/allocatable_cell.php index 8be27a7c..0ba0dcfa 100644 --- a/classes/render_helpers/grading_report/cells/allocatable_cell.php +++ b/classes/render_helpers/grading_report/cells/allocatable_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; diff --git a/classes/render_helpers/grading_report/cells/cell_base.php b/classes/render_helpers/grading_report/cells/cell_base.php index 82db8731..8e8dc42e 100644 --- a/classes/render_helpers/grading_report/cells/cell_base.php +++ b/classes/render_helpers/grading_report/cells/cell_base.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; diff --git a/classes/render_helpers/grading_report/cells/cell_interface.php b/classes/render_helpers/grading_report/cells/cell_interface.php index 921480db..94ce2c39 100644 --- a/classes/render_helpers/grading_report/cells/cell_interface.php +++ b/classes/render_helpers/grading_report/cells/cell_interface.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; diff --git a/classes/render_helpers/grading_report/cells/email_cell.php b/classes/render_helpers/grading_report/cells/email_cell.php index cfb4059d..301b15db 100644 --- a/classes/render_helpers/grading_report/cells/email_cell.php +++ b/classes/render_helpers/grading_report/cells/email_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; use core_user; diff --git a/classes/render_helpers/grading_report/cells/first_name_cell.php b/classes/render_helpers/grading_report/cells/first_name_cell.php index 9f390a1e..b940b588 100644 --- a/classes/render_helpers/grading_report/cells/first_name_cell.php +++ b/classes/render_helpers/grading_report/cells/first_name_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; use core_user; diff --git a/classes/render_helpers/grading_report/cells/first_name_letter_cell.php b/classes/render_helpers/grading_report/cells/first_name_letter_cell.php index 9cf7d910..592b29f2 100644 --- a/classes/render_helpers/grading_report/cells/first_name_letter_cell.php +++ b/classes/render_helpers/grading_report/cells/first_name_letter_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; use core_user; 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 1c801899..aeae7f7a 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 @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; use coding_exception; diff --git a/classes/render_helpers/grading_report/cells/group_cell.php b/classes/render_helpers/grading_report/cells/group_cell.php index fa75824e..be672947 100644 --- a/classes/render_helpers/grading_report/cells/group_cell.php +++ b/classes/render_helpers/grading_report/cells/group_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; use coding_exception; diff --git a/classes/render_helpers/grading_report/cells/idnumber_cell.php b/classes/render_helpers/grading_report/cells/idnumber_cell.php index e967accb..742dc7db 100644 --- a/classes/render_helpers/grading_report/cells/idnumber_cell.php +++ b/classes/render_helpers/grading_report/cells/idnumber_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; use mod_coursework\models\user; diff --git a/classes/render_helpers/grading_report/cells/last_name_cell.php b/classes/render_helpers/grading_report/cells/last_name_cell.php index ac53c55e..fada2e6e 100644 --- a/classes/render_helpers/grading_report/cells/last_name_cell.php +++ b/classes/render_helpers/grading_report/cells/last_name_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; use core_user; diff --git a/classes/render_helpers/grading_report/cells/last_name_letter_cell.php b/classes/render_helpers/grading_report/cells/last_name_letter_cell.php index f75a12ed..35c4bf9c 100644 --- a/classes/render_helpers/grading_report/cells/last_name_letter_cell.php +++ b/classes/render_helpers/grading_report/cells/last_name_letter_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; use core_user; 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 2d9b93e8..d71151bc 100644 --- a/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php +++ b/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; use coding_exception; diff --git a/classes/render_helpers/grading_report/cells/moderation_cell.php b/classes/render_helpers/grading_report/cells/moderation_cell.php index dc17a7a2..0a87d89d 100644 --- a/classes/render_helpers/grading_report/cells/moderation_cell.php +++ b/classes/render_helpers/grading_report/cells/moderation_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; 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 64903c0e..09d1e420 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 @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; 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 dcbca2fc..1b1060f7 100644 --- a/classes/render_helpers/grading_report/cells/personal_deadline_cell.php +++ b/classes/render_helpers/grading_report/cells/personal_deadline_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; use coding_exception; diff --git a/classes/render_helpers/grading_report/cells/plagiarism_cell.php b/classes/render_helpers/grading_report/cells/plagiarism_cell.php index fcd79e9e..f45fe283 100644 --- a/classes/render_helpers/grading_report/cells/plagiarism_cell.php +++ b/classes/render_helpers/grading_report/cells/plagiarism_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; use coding_exception; 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 da318582..d4798fc6 100644 --- a/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php +++ b/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; use coding_exception; 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 67294989..43283fbd 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 @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; diff --git a/classes/render_helpers/grading_report/cells/status_cell.php b/classes/render_helpers/grading_report/cells/status_cell.php index a44ba4d6..cac0d210 100644 --- a/classes/render_helpers/grading_report/cells/status_cell.php +++ b/classes/render_helpers/grading_report/cells/status_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; use html_table_cell; diff --git a/classes/render_helpers/grading_report/cells/submission_cell.php b/classes/render_helpers/grading_report/cells/submission_cell.php index 657cffce..ba5b71b8 100644 --- a/classes/render_helpers/grading_report/cells/submission_cell.php +++ b/classes/render_helpers/grading_report/cells/submission_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; use coding_exception; 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 da4eff2d..906caa4a 100644 --- a/classes/render_helpers/grading_report/cells/time_submitted_cell.php +++ b/classes/render_helpers/grading_report/cells/time_submitted_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; use coding_exception; diff --git a/classes/render_helpers/grading_report/cells/user_cell.php b/classes/render_helpers/grading_report/cells/user_cell.php index 2e43a670..9692fd46 100644 --- a/classes/render_helpers/grading_report/cells/user_cell.php +++ b/classes/render_helpers/grading_report/cells/user_cell.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\cells; use core_user; diff --git a/classes/render_helpers/grading_report/component_factory_interface.php b/classes/render_helpers/grading_report/component_factory_interface.php index 7f2316ad..c9d2a08f 100644 --- a/classes/render_helpers/grading_report/component_factory_interface.php +++ b/classes/render_helpers/grading_report/component_factory_interface.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report; diff --git a/classes/render_helpers/grading_report/multi_renderer.php b/classes/render_helpers/grading_report/multi_renderer.php index a072df68..9a8281bb 100644 --- a/classes/render_helpers/grading_report/multi_renderer.php +++ b/classes/render_helpers/grading_report/multi_renderer.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report; diff --git a/classes/render_helpers/grading_report/single_renderer.php b/classes/render_helpers/grading_report/single_renderer.php index 252949f1..c7e2a672 100644 --- a/classes/render_helpers/grading_report/single_renderer.php +++ b/classes/render_helpers/grading_report/single_renderer.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report; diff --git a/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php b/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php index ce325461..aa476358 100644 --- a/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php +++ b/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\sub_rows; 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 09c0992a..482b5018 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 @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\sub_rows; diff --git a/classes/render_helpers/grading_report/sub_rows/sub_rows_interface.php b/classes/render_helpers/grading_report/sub_rows/sub_rows_interface.php index 0300d176..7c87f959 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 @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\render_helpers\grading_report\sub_rows; diff --git a/classes/renderers/deadline_extension_renderer.php b/classes/renderers/deadline_extension_renderer.php index 9c726b5a..a1dca7d4 100644 --- a/classes/renderers/deadline_extension_renderer.php +++ b/classes/renderers/deadline_extension_renderer.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\renderers; diff --git a/classes/renderers/personal_deadline_renderer.php b/classes/renderers/personal_deadline_renderer.php index fbb5a948..99a67405 100644 --- a/classes/renderers/personal_deadline_renderer.php +++ b/classes/renderers/personal_deadline_renderer.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\renderers; diff --git a/classes/router.php b/classes/router.php index 17b740d1..88a0eb6e 100644 --- a/classes/router.php +++ b/classes/router.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework; use coding_exception; diff --git a/classes/sample_set_rule/sample_base.php b/classes/sample_set_rule/sample_base.php index 93b949ee..c6fbca57 100644 --- a/classes/sample_set_rule/sample_base.php +++ b/classes/sample_set_rule/sample_base.php @@ -1,12 +1,18 @@ . /** * File for a sampling rule that will include X students from between an upper and lower limit. diff --git a/classes/stages/assessor.php b/classes/stages/assessor.php index 883ea082..d692bd74 100644 --- a/classes/stages/assessor.php +++ b/classes/stages/assessor.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\stages; use mod_coursework\models\user; diff --git a/classes/stages/base.php b/classes/stages/base.php index 971ff9de..e1d5a820 100644 --- a/classes/stages/base.php +++ b/classes/stages/base.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\stages; diff --git a/classes/stages/final_agreed.php b/classes/stages/final_agreed.php index 7f09e88d..c80e9c78 100644 --- a/classes/stages/final_agreed.php +++ b/classes/stages/final_agreed.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\stages; use mod_coursework\models\user; diff --git a/classes/stages/moderator.php b/classes/stages/moderator.php index c6eb4eca..9894afc8 100644 --- a/classes/stages/moderator.php +++ b/classes/stages/moderator.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\stages; use mod_coursework\models\user; diff --git a/classes/test_helpers/factory_mixin.php b/classes/test_helpers/factory_mixin.php index 37a1edec..c4736709 100644 --- a/classes/test_helpers/factory_mixin.php +++ b/classes/test_helpers/factory_mixin.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\test_helpers; diff --git a/classes/traits/allocatable_functions.php b/classes/traits/allocatable_functions.php index f4ef42a3..73ba4e95 100644 --- a/classes/traits/allocatable_functions.php +++ b/classes/traits/allocatable_functions.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\traits; use mod_coursework\models\assessment_set_membership; diff --git a/classes/warnings.php b/classes/warnings.php index 590c9acd..f9ff2fdd 100644 --- a/classes/warnings.php +++ b/classes/warnings.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework; use mod_coursework\models\coursework; diff --git a/db/caches.php b/db/caches.php index 16c2cd91..a800a74e 100644 --- a/db/caches.php +++ b/db/caches.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + $definitions = array( 'courseworkdata' => array( diff --git a/db/install.php b/db/install.php index 338da5ff..234f6670 100644 --- a/db/install.php +++ b/db/install.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Created by PhpStorm. * User: Nigel.Daley diff --git a/renderable.php b/renderable.php index 5f9e7ead..6665c34c 100644 --- a/renderable.php +++ b/renderable.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * This file contains all of the renderable class definitions. They are separate from the main diff --git a/renderers/grading_report_renderer.php b/renderers/grading_report_renderer.php index 51bba10c..e0bc6704 100644 --- a/renderers/grading_report_renderer.php +++ b/renderers/grading_report_renderer.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + use mod_coursework\ability; use mod_coursework\allocation\allocatable; use mod_coursework\grading_report; diff --git a/renderers/object_renderer.php b/renderers/object_renderer.php index 2c6cde54..763529fc 100644 --- a/renderers/object_renderer.php +++ b/renderers/object_renderer.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + use mod_coursework\ability; use mod_coursework\allocation\manager; use mod_coursework\grade_judge; diff --git a/renderers/page_renderer.php b/renderers/page_renderer.php index 1566c745..da88179c 100644 --- a/renderers/page_renderer.php +++ b/renderers/page_renderer.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + use mod_coursework\ability; use mod_coursework\forms\assessor_feedback_mform; use mod_coursework\forms\student_submission_form; diff --git a/tests/behat/behat_mod_coursework.php b/tests/behat/behat_mod_coursework.php index 944eb227..c6baaf0f 100644 --- a/tests/behat/behat_mod_coursework.php +++ b/tests/behat/behat_mod_coursework.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Step definitions for the Coursework module Behat tests. diff --git a/tests/behat/pages/allocations_page.php b/tests/behat/pages/allocations_page.php index a39978bd..8e103f65 100644 --- a/tests/behat/pages/allocations_page.php +++ b/tests/behat/pages/allocations_page.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + use mod_coursework\allocation\allocatable; use mod_coursework\models\user; diff --git a/tests/behat/pages/coursework_page.php b/tests/behat/pages/coursework_page.php index c5dd71b9..f886c009 100644 --- a/tests/behat/pages/coursework_page.php +++ b/tests/behat/pages/coursework_page.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + use mod_coursework\allocation\allocatable; use mod_coursework\models\user; diff --git a/tests/behat/pages/edit_extension_page.php b/tests/behat/pages/edit_extension_page.php index 12270535..6dd5ccc3 100644 --- a/tests/behat/pages/edit_extension_page.php +++ b/tests/behat/pages/edit_extension_page.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Class mod_coursework_behat_new_extension_page is responsible for representing the new diff --git a/tests/behat/pages/gradebook_page.php b/tests/behat/pages/gradebook_page.php index 7538287d..4b0de0c8 100644 --- a/tests/behat/pages/gradebook_page.php +++ b/tests/behat/pages/gradebook_page.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + defined('MOODLE_INTERNAL') || die(); diff --git a/tests/behat/pages/login_page.php b/tests/behat/pages/login_page.php index 84e9268e..929c47f6 100644 --- a/tests/behat/pages/login_page.php +++ b/tests/behat/pages/login_page.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + use Behat\Mink\Exception\ExpectationException; diff --git a/tests/behat/pages/multiple_grading_interface.php b/tests/behat/pages/multiple_grading_interface.php index 0f06cb91..d35b0c83 100644 --- a/tests/behat/pages/multiple_grading_interface.php +++ b/tests/behat/pages/multiple_grading_interface.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + use mod_coursework\allocation\allocatable; use mod_coursework\models\coursework; diff --git a/tests/behat/pages/new_extension_page.php b/tests/behat/pages/new_extension_page.php index 760c0188..f0e5ad6d 100644 --- a/tests/behat/pages/new_extension_page.php +++ b/tests/behat/pages/new_extension_page.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Class mod_coursework_behat_new_extension_page is responsible for representing the new diff --git a/tests/behat/pages/page_base.php b/tests/behat/pages/page_base.php index 89c5c4b6..69cd3b44 100644 --- a/tests/behat/pages/page_base.php +++ b/tests/behat/pages/page_base.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + use Behat\Mink\Element\NodeElement; use Behat\Mink\Exception\ElementNotFoundException; use Behat\Mink\Exception\ExpectationException; diff --git a/tests/behat/pages/show_feedback_page.php b/tests/behat/pages/show_feedback_page.php index 06697038..95c1dd01 100644 --- a/tests/behat/pages/show_feedback_page.php +++ b/tests/behat/pages/show_feedback_page.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + defined('MOODLE_INTERNAL') || die(); diff --git a/tests/behat/pages/single_grading_interface.php b/tests/behat/pages/single_grading_interface.php index c735e1fc..9e3bc5ca 100644 --- a/tests/behat/pages/single_grading_interface.php +++ b/tests/behat/pages/single_grading_interface.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + use mod_coursework\allocation\allocatable; use mod_coursework\models\coursework; diff --git a/tests/behat/pages/student_page.php b/tests/behat/pages/student_page.php index 16bce570..d0c4d742 100644 --- a/tests/behat/pages/student_page.php +++ b/tests/behat/pages/student_page.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + defined('MOODLE_INTERNAL') || die(); diff --git a/tests/behat/pages/student_submission_form.php b/tests/behat/pages/student_submission_form.php index 6eb47ecc..37219348 100644 --- a/tests/behat/pages/student_submission_form.php +++ b/tests/behat/pages/student_submission_form.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + defined('MOODLE_INTERNAL') || die(); diff --git a/tests/classes/ability_test.php b/tests/classes/ability_test.php index 9bf27102..e0958950 100644 --- a/tests/classes/ability_test.php +++ b/tests/classes/ability_test.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + use mod_coursework\ability; diff --git a/tests/classes/allocation/auto_allocator_test.php b/tests/classes/allocation/auto_allocator_test.php index b6bf80e1..72ccff2a 100644 --- a/tests/classes/allocation/auto_allocator_test.php +++ b/tests/classes/allocation/auto_allocator_test.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + use mod_coursework\models\coursework; /** diff --git a/tests/classes/allocation/form/table_processor_test.php b/tests/classes/allocation/form/table_processor_test.php index ebb11995..663bb49f 100644 --- a/tests/classes/allocation/form/table_processor_test.php +++ b/tests/classes/allocation/form/table_processor_test.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + use mod_coursework\allocation\table\processor; use mod_coursework\models\coursework; diff --git a/tests/classes/allocation/strategy/percentages_test.php b/tests/classes/allocation/strategy/percentages_test.php index b8aa9ffd..24548db4 100644 --- a/tests/classes/allocation/strategy/percentages_test.php +++ b/tests/classes/allocation/strategy/percentages_test.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + global $CFG; diff --git a/tests/classes/auto_grader/percentage_distance_test.php b/tests/classes/auto_grader/percentage_distance_test.php index b64b1107..ac5d3c94 100644 --- a/tests/classes/auto_grader/percentage_distance_test.php +++ b/tests/classes/auto_grader/percentage_distance_test.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + namespace mod_coursework\auto_grader; diff --git a/tests/classes/controllers/deadline_extensions_controller_test.php b/tests/classes/controllers/deadline_extensions_controller_test.php index a398f6d2..ef5a8fb0 100644 --- a/tests/classes/controllers/deadline_extensions_controller_test.php +++ b/tests/classes/controllers/deadline_extensions_controller_test.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Class deadline_extensions_controller_test is responsible for testing the deadline_extensions controller diff --git a/tests/classes/cron_test.php b/tests/classes/cron_test.php index eed71d49..667ed710 100644 --- a/tests/classes/cron_test.php +++ b/tests/classes/cron_test.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + use mod_coursework\models\submission; use mod_coursework\cron; diff --git a/tests/classes/grade_judge_test.php b/tests/classes/grade_judge_test.php index 150b2e85..850185cb 100644 --- a/tests/classes/grade_judge_test.php +++ b/tests/classes/grade_judge_test.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + use mod_coursework\grade_judge; diff --git a/tests/classes/models/deadline_extension_test.php b/tests/classes/models/deadline_extension_test.php index 0c00557d..ed568212 100644 --- a/tests/classes/models/deadline_extension_test.php +++ b/tests/classes/models/deadline_extension_test.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + use mod_coursework\models\deadline_extension; /** diff --git a/tests/classes/models/group_test.php b/tests/classes/models/group_test.php index 9590cda1..5c4a6792 100644 --- a/tests/classes/models/group_test.php +++ b/tests/classes/models/group_test.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + use mod_coursework\models\group; /** diff --git a/tests/classes/models/moderation_set_membership_test.php b/tests/classes/models/moderation_set_membership_test.php index a6c60d6a..2c6dc608 100644 --- a/tests/classes/models/moderation_set_membership_test.php +++ b/tests/classes/models/moderation_set_membership_test.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Class coursework_user_test diff --git a/tests/classes/models/user_test.php b/tests/classes/models/user_test.php index 364b043f..65d5e210 100644 --- a/tests/classes/models/user_test.php +++ b/tests/classes/models/user_test.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * Class coursework_user_test diff --git a/tests/classes/router_test.php b/tests/classes/router_test.php index eadd67d7..06607b98 100644 --- a/tests/classes/router_test.php +++ b/tests/classes/router_test.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + use mod_coursework\models\submission; use mod_coursework\router; diff --git a/tests/classes/rule_test.php b/tests/classes/rule_test.php index 1d11ce2d..bfeea60c 100644 --- a/tests/classes/rule_test.php +++ b/tests/classes/rule_test.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + use mod_coursework\ability\rule; diff --git a/tests/classes/stages/assessor_test.php b/tests/classes/stages/assessor_test.php index 89849ac3..493a5402 100644 --- a/tests/classes/stages/assessor_test.php +++ b/tests/classes/stages/assessor_test.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * @group mod_coursework diff --git a/tests/classes/stages/final_agreed_test.php b/tests/classes/stages/final_agreed_test.php index 6b253a05..ba400145 100644 --- a/tests/classes/stages/final_agreed_test.php +++ b/tests/classes/stages/final_agreed_test.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + /** * @group mod_coursework diff --git a/tests/cron_tester.php b/tests/cron_tester.php index cffac8c6..fad026cf 100644 --- a/tests/cron_tester.php +++ b/tests/cron_tester.php @@ -1,4 +1,25 @@ . + +/** + * @package mod_coursework + * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + define('CLI_SCRIPT', true); From f55e699b4da996793599593cdb0b803135826652 Mon Sep 17 00:00:00 2001 From: David Watson <14983002+watson8@users.noreply.github.com> Date: Mon, 12 Aug 2024 09:28:27 +0100 Subject: [PATCH 02/51] CTP-3558 coding std add eof newline --- actions/ajax/deadline_extension/edit.php | 2 +- actions/ajax/deadline_extension/new.php | 2 +- actions/deadline_extensions/create.php | 2 +- actions/deadline_extensions/edit.php | 2 +- actions/deadline_extensions/new.php | 2 +- actions/deadline_extensions/show.php | 2 +- actions/deadline_extensions/update.php | 2 +- actions/feedbacks/create.php | 2 +- actions/feedbacks/edit.php | 2 +- actions/feedbacks/show.php | 2 +- actions/feedbacks/update.php | 2 +- actions/moderations/create.php | 2 +- actions/moderations/edit.php | 2 +- actions/moderations/new.php | 2 +- actions/moderations/show.php | 2 +- actions/moderations/update.php | 2 +- actions/plagiarism_flagging/create.php | 2 +- actions/plagiarism_flagging/edit.php | 2 +- actions/plagiarism_flagging/new.php | 2 +- actions/plagiarism_flagging/update.php | 2 +- actions/processallocation.php | 2 +- actions/submissions/create.php | 2 +- actions/submissions/edit.php | 2 +- actions/submissions/finalise.php | 2 +- actions/submissions/new.php | 2 +- actions/submissions/update.php | 2 +- actions/upload_allocations.php | 2 +- actions/upload_feedback.php | 2 +- actions/upload_grading_sheet.php | 2 +- backup/moodle2/backup_coursework_activity_task.class.php | 2 +- backup/moodle2/backup_coursework_stepslib.php | 2 +- backup/moodle2/restore_coursework_activity_task.class.php | 2 +- classes/ability.php | 2 +- classes/ability/rule.php | 2 +- classes/allocation/allocatable.php | 2 +- classes/allocation/auto_allocator.php | 2 +- classes/allocation/moderatable.php | 2 +- classes/allocation/table/cell/builder.php | 2 +- classes/allocation/table/cell/data.php | 2 +- classes/allocation/table/cell/processor.php | 2 +- classes/allocation/table/row/processor.php | 2 +- classes/allocation/upload.php | 2 +- classes/auto_grader/auto_grader.php | 2 +- classes/auto_grader/average_grade.php | 2 +- classes/auto_grader/none.php | 2 +- classes/auto_grader/percentage_distance.php | 2 +- classes/controllers/allocations_controller.php | 2 +- classes/controllers/controller_base.php | 2 +- classes/controllers/deadline_extensions_controller.php | 2 +- classes/controllers/grading_controller.php | 2 +- classes/controllers/moderations_controller.php | 2 +- classes/controllers/plagiarism_flagging_controller.php | 2 +- classes/controllers/submissions_controller.php | 2 +- classes/decorators/coursework_groups_decorator.php | 2 +- classes/decorators/submission_groups_decorator.php | 2 +- classes/event/course_module_instance_list_viewed.php | 2 +- classes/event/feedback_changed.php | 2 +- classes/exceptions/access_denied.php | 2 +- classes/exceptions/late_submission.php | 2 +- classes/export/csv.php | 2 +- classes/export/csv/cells/agreedfeedback_cell.php | 2 +- classes/export/csv/cells/agreedgrade_cell.php | 2 +- classes/export/csv/cells/assessor_cell.php | 2 +- classes/export/csv/cells/assessorfeedback_cell.php | 2 +- classes/export/csv/cells/assessorgrade_cell.php | 2 +- classes/export/csv/cells/cell_base.php | 2 +- classes/export/csv/cells/cell_interface.php | 2 +- classes/export/csv/cells/email_cell.php | 2 +- classes/export/csv/cells/extensiondeadline_cell.php | 2 +- classes/export/csv/cells/extensionextrainfo_cell.php | 2 +- classes/export/csv/cells/extensionreason_cell.php | 2 +- classes/export/csv/cells/feedbackcomments_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 +- classes/export/csv/cells/moderationagreement_cell.php | 2 +- classes/export/csv/cells/name_cell.php | 2 +- classes/export/csv/cells/otherassessors_cell.php | 2 +- classes/export/csv/cells/personaldeadline_cell.php | 2 +- classes/export/csv/cells/plagiarismflagcomment_cell.php | 2 +- classes/export/csv/cells/plagiarismflagstatus_cell.php | 2 +- classes/export/csv/cells/singlegrade_cell.php | 2 +- classes/export/csv/cells/stages_cell.php | 2 +- classes/export/csv/cells/submissiondate_cell.php | 2 +- classes/export/csv/cells/submissionfileid_cell.php | 2 +- classes/export/csv/cells/submissionid_cell.php | 2 +- classes/export/csv/cells/submissiontime_cell.php | 2 +- classes/export/csv/cells/username_cell.php | 2 +- classes/export/import.php | 2 +- classes/file_importer.php | 2 +- classes/forms/choose_student_for_submission_mform.php | 2 +- classes/forms/deadline_extension_form.php | 2 +- classes/forms/personal_deadline_form.php | 2 +- classes/forms/upload_allocations_form.php | 2 +- classes/forms/upload_feedback_form.php | 2 +- classes/forms/upload_grading_sheet_form.php | 2 +- classes/forms/view_all_students_mform.php | 2 +- classes/framework/ability.php | 2 +- classes/framework/decorator.php | 2 +- classes/framework/test/classes/user_table.php | 2 +- classes/framework/test/table_base_test.php | 2 +- classes/grade_judge.php | 2 +- classes/grading_table_row_multi.php | 2 +- classes/mailer.php | 2 +- classes/models/assessment_set_membership.php | 2 +- classes/models/deadline_extension.php | 2 +- classes/models/group.php | 2 +- classes/models/moderation.php | 2 +- classes/models/null_feedback.php | 2 +- classes/models/null_user.php | 2 +- classes/models/personal_deadline.php | 2 +- classes/models/plagiarism_flag.php | 2 +- classes/models/reminder.php | 2 +- classes/models/user.php | 2 +- classes/observer.php | 2 +- classes/personal_deadline/allocatable.php | 2 +- classes/plagiarism_helpers/base.php | 2 +- classes/plagiarism_helpers/turnitin.php | 2 +- classes/privacy/provider.php | 2 +- classes/render_helpers/grading_report/base_renderer.php | 2 +- classes/render_helpers/grading_report/cells/_user_cell.php | 2 +- .../render_helpers/grading_report/cells/allocatable_cell.php | 2 +- classes/render_helpers/grading_report/cells/cell_interface.php | 2 +- classes/render_helpers/grading_report/cells/email_cell.php | 2 +- classes/render_helpers/grading_report/cells/first_name_cell.php | 2 +- .../grading_report/cells/first_name_letter_cell.php | 2 +- .../grading_report/cells/grade_for_gradebook_cell.php | 2 +- classes/render_helpers/grading_report/cells/group_cell.php | 2 +- classes/render_helpers/grading_report/cells/last_name_cell.php | 2 +- .../grading_report/cells/last_name_letter_cell.php | 2 +- .../grading_report/cells/moderation_agreement_cell.php | 2 +- classes/render_helpers/grading_report/cells/moderation_cell.php | 2 +- classes/render_helpers/grading_report/cells/plagiarism_cell.php | 2 +- .../grading_report/cells/plagiarism_flag_cell.php | 2 +- classes/render_helpers/grading_report/cells/status_cell.php | 2 +- classes/render_helpers/grading_report/cells/submission_cell.php | 2 +- .../grading_report/component_factory_interface.php | 2 +- classes/render_helpers/grading_report/multi_renderer.php | 2 +- classes/render_helpers/grading_report/single_renderer.php | 2 +- classes/render_helpers/grading_report/sub_rows/no_sub_rows.php | 2 +- .../grading_report/sub_rows/sub_rows_interface.php | 2 +- classes/renderers/coursework_renderer.php | 1 + classes/renderers/deadline_extension_renderer.php | 2 +- classes/renderers/personal_deadline_renderer.php | 2 +- classes/renderers/submission_renderer.php | 1 + classes/sample_set_rule/range_sample_type.php | 2 +- classes/sample_set_rule/sample_base.php | 2 +- classes/sample_set_rule/total_sample_type.php | 2 +- classes/stages/assessor.php | 2 +- classes/stages/base.php | 2 +- classes/stages/final_agreed.php | 2 +- classes/stages/moderator.php | 2 +- classes/task/enrol_task.php | 2 +- classes/task/unenrol_task.php | 2 +- classes/test_helpers/factory_mixin.php | 2 +- classes/traits/allocatable_functions.php | 2 +- classes/warnings.php | 2 +- db/caches.php | 2 +- db/install.php | 2 +- db/messages.php | 2 +- index.php | 2 +- lang/en/coursework.php | 2 +- renderable.php | 2 +- renderers/grading_report_renderer.php | 2 +- renderers/object_renderer.php | 2 +- tests/behat/behat_mod_coursework.php | 2 +- tests/behat/pages/allocations_page.php | 2 +- tests/behat/pages/coursework_page.php | 2 +- tests/behat/pages/edit_extension_page.php | 2 +- tests/behat/pages/gradebook_page.php | 2 +- tests/behat/pages/login_page.php | 2 +- tests/behat/pages/multiple_grading_interface.php | 2 +- tests/behat/pages/new_extension_page.php | 2 +- tests/behat/pages/page_base.php | 2 +- tests/behat/pages/show_feedback_page.php | 2 +- tests/behat/pages/single_grading_interface.php | 2 +- tests/behat/pages/student_page.php | 2 +- tests/behat/pages/student_submission_form.php | 2 +- tests/classes/ability_test.php | 2 +- tests/classes/allocation/auto_allocator_test.php | 2 +- tests/classes/allocation/form/table_processor_test.php | 2 +- tests/classes/allocation/strategy/percentages_test.php | 2 +- .../classes/controllers/deadline_extensions_controller_test.php | 2 +- tests/classes/cron_test.php | 2 +- tests/classes/grade_judge_test.php | 2 +- tests/classes/models/deadline_extension_test.php | 2 +- tests/classes/models/group_test.php | 2 +- tests/classes/models/moderation_set_membership_test.php | 2 +- tests/classes/models/user_test.php | 2 +- tests/classes/router_test.php | 2 +- tests/classes/rule_test.php | 2 +- tests/classes/stages/assessor_test.php | 2 +- tests/classes/stages/final_agreed_test.php | 2 +- tests/cron_tester.php | 2 +- tests/renderer_test.php | 2 +- 195 files changed, 195 insertions(+), 193 deletions(-) diff --git a/actions/ajax/deadline_extension/edit.php b/actions/ajax/deadline_extension/edit.php index bc034c37..2b144889 100644 --- a/actions/ajax/deadline_extension/edit.php +++ b/actions/ajax/deadline_extension/edit.php @@ -50,4 +50,4 @@ $params['submissionid'] = $submissionid; $params['name'] = $name; -$controller->ajax_edit_mitigation($params); \ No newline at end of file +$controller->ajax_edit_mitigation($params); diff --git a/actions/ajax/deadline_extension/new.php b/actions/ajax/deadline_extension/new.php index d2df1e03..8999dfcb 100644 --- a/actions/ajax/deadline_extension/new.php +++ b/actions/ajax/deadline_extension/new.php @@ -50,4 +50,4 @@ $params['submissionid'] = $submissionid; $params['name'] = $name; -$controller->ajax_new_mitigation($params); \ No newline at end of file +$controller->ajax_new_mitigation($params); diff --git a/actions/deadline_extensions/create.php b/actions/deadline_extensions/create.php index d1f091bc..0037e9f5 100644 --- a/actions/deadline_extensions/create.php +++ b/actions/deadline_extensions/create.php @@ -39,4 +39,4 @@ $PAGE->set_url($link); $controller = new mod_coursework\controllers\deadline_extensions_controller($params); -$controller->create_deadline_extension(); \ No newline at end of file +$controller->create_deadline_extension(); diff --git a/actions/deadline_extensions/edit.php b/actions/deadline_extensions/edit.php index 973e97e8..5fd903c3 100644 --- a/actions/deadline_extensions/edit.php +++ b/actions/deadline_extensions/edit.php @@ -31,4 +31,4 @@ 'id' => $id, ); $controller = new mod_coursework\controllers\deadline_extensions_controller($params); -$controller->edit_deadline_extension(); \ No newline at end of file +$controller->edit_deadline_extension(); diff --git a/actions/deadline_extensions/new.php b/actions/deadline_extensions/new.php index 0b8b54f9..4b8ae125 100644 --- a/actions/deadline_extensions/new.php +++ b/actions/deadline_extensions/new.php @@ -35,4 +35,4 @@ 'allocatabletype' => $allocatabletype, ); $controller = new mod_coursework\controllers\deadline_extensions_controller($params); -$controller->new_deadline_extension(); \ No newline at end of file +$controller->new_deadline_extension(); diff --git a/actions/deadline_extensions/show.php b/actions/deadline_extensions/show.php index b5f4aa55..deb8f2f5 100644 --- a/actions/deadline_extensions/show.php +++ b/actions/deadline_extensions/show.php @@ -31,4 +31,4 @@ 'id' => $id, ); $controller = new mod_coursework\controllers\deadline_extensions_controller($params); -$controller->show_deadline_extension(); \ No newline at end of file +$controller->show_deadline_extension(); diff --git a/actions/deadline_extensions/update.php b/actions/deadline_extensions/update.php index 0c04a660..d4dbba71 100644 --- a/actions/deadline_extensions/update.php +++ b/actions/deadline_extensions/update.php @@ -35,4 +35,4 @@ $PAGE->set_url($link); $controller = new mod_coursework\controllers\deadline_extensions_controller($params); -$controller->update_deadline_extension(); \ No newline at end of file +$controller->update_deadline_extension(); diff --git a/actions/feedbacks/create.php b/actions/feedbacks/create.php index c9c3e2a6..142b07b0 100644 --- a/actions/feedbacks/create.php +++ b/actions/feedbacks/create.php @@ -51,4 +51,4 @@ } $controller = new mod_coursework\controllers\feedback_controller($params); -$controller->create_feedback(); \ No newline at end of file +$controller->create_feedback(); diff --git a/actions/feedbacks/edit.php b/actions/feedbacks/edit.php index ee01b238..7b5ae72f 100644 --- a/actions/feedbacks/edit.php +++ b/actions/feedbacks/edit.php @@ -34,4 +34,4 @@ 'ajax' => $ajax ); $controller = new mod_coursework\controllers\feedback_controller($params); -$controller->edit_feedback(); \ No newline at end of file +$controller->edit_feedback(); diff --git a/actions/feedbacks/show.php b/actions/feedbacks/show.php index 47d822c0..84780dfc 100644 --- a/actions/feedbacks/show.php +++ b/actions/feedbacks/show.php @@ -34,4 +34,4 @@ ); $controller = new mod_coursework\controllers\feedback_controller($params); -$controller->show_feedback(); \ No newline at end of file +$controller->show_feedback(); diff --git a/actions/feedbacks/update.php b/actions/feedbacks/update.php index a7c9e039..11004490 100644 --- a/actions/feedbacks/update.php +++ b/actions/feedbacks/update.php @@ -49,4 +49,4 @@ } $controller = new mod_coursework\controllers\feedback_controller($params); -$controller->update_feedback(); \ No newline at end of file +$controller->update_feedback(); diff --git a/actions/moderations/create.php b/actions/moderations/create.php index f65c257b..81bd28d8 100644 --- a/actions/moderations/create.php +++ b/actions/moderations/create.php @@ -42,4 +42,4 @@ 'stage_identifier' => $stage_identifier, ); $controller = new mod_coursework\controllers\moderations_controller($params); -$controller->create_moderation(); \ No newline at end of file +$controller->create_moderation(); diff --git a/actions/moderations/edit.php b/actions/moderations/edit.php index a7d5cac5..30d94920 100644 --- a/actions/moderations/edit.php +++ b/actions/moderations/edit.php @@ -31,4 +31,4 @@ 'moderationid' => $moderationid, ); $controller = new mod_coursework\controllers\moderations_controller($params); -$controller->edit_moderation(); \ No newline at end of file +$controller->edit_moderation(); diff --git a/actions/moderations/new.php b/actions/moderations/new.php index 96bc5abb..743593ee 100644 --- a/actions/moderations/new.php +++ b/actions/moderations/new.php @@ -39,4 +39,4 @@ 'stage_identifier' => $stage_identifier, ); $controller = new mod_coursework\controllers\moderations_controller($params); -$controller->new_moderation(); \ No newline at end of file +$controller->new_moderation(); diff --git a/actions/moderations/show.php b/actions/moderations/show.php index 3896ea35..8e57293f 100644 --- a/actions/moderations/show.php +++ b/actions/moderations/show.php @@ -31,4 +31,4 @@ 'moderationid' => $moderationid, ); $controller = new mod_coursework\controllers\moderations_controller($params); -$controller->show_moderation(); \ No newline at end of file +$controller->show_moderation(); diff --git a/actions/moderations/update.php b/actions/moderations/update.php index 3d005d3e..05287a0f 100644 --- a/actions/moderations/update.php +++ b/actions/moderations/update.php @@ -36,4 +36,4 @@ 'moderationid' => $moderationid, ); $controller = new mod_coursework\controllers\moderations_controller($params); -$controller->update_moderation(); \ No newline at end of file +$controller->update_moderation(); diff --git a/actions/plagiarism_flagging/create.php b/actions/plagiarism_flagging/create.php index d870cb19..4270196d 100644 --- a/actions/plagiarism_flagging/create.php +++ b/actions/plagiarism_flagging/create.php @@ -36,4 +36,4 @@ ); $controller = new mod_coursework\controllers\plagiarism_flagging_controller($params); -$controller->create_plagiarism_flag(); \ No newline at end of file +$controller->create_plagiarism_flag(); diff --git a/actions/plagiarism_flagging/edit.php b/actions/plagiarism_flagging/edit.php index 9877ac24..fcd5fece 100644 --- a/actions/plagiarism_flagging/edit.php +++ b/actions/plagiarism_flagging/edit.php @@ -32,4 +32,4 @@ ); $controller = new mod_coursework\controllers\plagiarism_flagging_controller($params); -$controller->edit_plagiarism_flag(); \ No newline at end of file +$controller->edit_plagiarism_flag(); diff --git a/actions/plagiarism_flagging/new.php b/actions/plagiarism_flagging/new.php index ca94d660..4d8186a0 100644 --- a/actions/plagiarism_flagging/new.php +++ b/actions/plagiarism_flagging/new.php @@ -32,4 +32,4 @@ ); $controller = new mod_coursework\controllers\plagiarism_flagging_controller($params); -$controller->new_plagiarism_flag(); \ No newline at end of file +$controller->new_plagiarism_flag(); diff --git a/actions/plagiarism_flagging/update.php b/actions/plagiarism_flagging/update.php index 35aa5e41..22f764d2 100644 --- a/actions/plagiarism_flagging/update.php +++ b/actions/plagiarism_flagging/update.php @@ -36,4 +36,4 @@ ); $controller = new mod_coursework\controllers\plagiarism_flagging_controller($params); -$controller->update_plagiarism_flag(); \ No newline at end of file +$controller->update_plagiarism_flag(); diff --git a/actions/processallocation.php b/actions/processallocation.php index 619bed50..d63aad26 100644 --- a/actions/processallocation.php +++ b/actions/processallocation.php @@ -63,4 +63,4 @@ $allocator->process_allocations(); - echo $coursework->name. "re-allocated"; \ No newline at end of file + echo $coursework->name. "re-allocated"; diff --git a/actions/submissions/create.php b/actions/submissions/create.php index e8814473..00295aec 100644 --- a/actions/submissions/create.php +++ b/actions/submissions/create.php @@ -51,4 +51,4 @@ $params['submissionid'] = $submissionid; } $controller = new mod_coursework\controllers\submissions_controller($params); -$controller->create_submission(); \ No newline at end of file +$controller->create_submission(); diff --git a/actions/submissions/edit.php b/actions/submissions/edit.php index 6dc5473f..56671e9d 100644 --- a/actions/submissions/edit.php +++ b/actions/submissions/edit.php @@ -33,4 +33,4 @@ 'submissionid' => $submissionid, ); $controller = new mod_coursework\controllers\submissions_controller($params); -$controller->edit_submission(); \ No newline at end of file +$controller->edit_submission(); diff --git a/actions/submissions/finalise.php b/actions/submissions/finalise.php index 4c9069a3..395b8017 100644 --- a/actions/submissions/finalise.php +++ b/actions/submissions/finalise.php @@ -33,4 +33,4 @@ 'submissionid' => $submissionid, ); $controller = new mod_coursework\controllers\submissions_controller($params); -$controller->finalise_submission(); \ No newline at end of file +$controller->finalise_submission(); diff --git a/actions/submissions/new.php b/actions/submissions/new.php index ba6d0aef..54e4cbfa 100644 --- a/actions/submissions/new.php +++ b/actions/submissions/new.php @@ -39,4 +39,4 @@ 'allocatabletype' => $allocatabletype, ); $controller = new mod_coursework\controllers\submissions_controller($params); -$controller->new_submission(); \ No newline at end of file +$controller->new_submission(); diff --git a/actions/submissions/update.php b/actions/submissions/update.php index ef7ecb60..f41aa223 100644 --- a/actions/submissions/update.php +++ b/actions/submissions/update.php @@ -35,4 +35,4 @@ 'finalised' => $finalised, ); $controller = new mod_coursework\controllers\submissions_controller($params); -$controller->update_submission(); \ No newline at end of file +$controller->update_submission(); diff --git a/actions/upload_allocations.php b/actions/upload_allocations.php index 145c34fc..95898666 100644 --- a/actions/upload_allocations.php +++ b/actions/upload_allocations.php @@ -87,4 +87,4 @@ } else { $page_renderer = $PAGE->get_renderer('mod_coursework', 'page'); echo $page_renderer->csv_upload($allocationsuploadform, $csvtype); -} \ No newline at end of file +} diff --git a/actions/upload_feedback.php b/actions/upload_feedback.php index f4ccf593..0639b47f 100644 --- a/actions/upload_feedback.php +++ b/actions/upload_feedback.php @@ -103,4 +103,4 @@ } else { $page_renderer = $PAGE->get_renderer('mod_coursework', 'page'); echo $page_renderer->feedback_upload($feedbackform); -} \ No newline at end of file +} diff --git a/actions/upload_grading_sheet.php b/actions/upload_grading_sheet.php index c76905f3..ce83a6d4 100644 --- a/actions/upload_grading_sheet.php +++ b/actions/upload_grading_sheet.php @@ -110,4 +110,4 @@ } else { $page_renderer = $PAGE->get_renderer('mod_coursework', 'page'); echo $page_renderer->csv_upload($gradinguploadform, $csvtype); -} \ No newline at end of file +} diff --git a/backup/moodle2/backup_coursework_activity_task.class.php b/backup/moodle2/backup_coursework_activity_task.class.php index 94d5cedb..a6d5efb0 100644 --- a/backup/moodle2/backup_coursework_activity_task.class.php +++ b/backup/moodle2/backup_coursework_activity_task.class.php @@ -49,4 +49,4 @@ protected function define_my_steps() { $this->add_step(new backup_coursework_activity_structure_step('coursework_structure', 'coursework.xml')); } -} \ No newline at end of file +} diff --git a/backup/moodle2/backup_coursework_stepslib.php b/backup/moodle2/backup_coursework_stepslib.php index bc9e1994..bcc30655 100644 --- a/backup/moodle2/backup_coursework_stepslib.php +++ b/backup/moodle2/backup_coursework_stepslib.php @@ -449,4 +449,4 @@ protected function define_structure() return $this->prepare_activity_structure($coursework); } -} \ No newline at end of file +} diff --git a/backup/moodle2/restore_coursework_activity_task.class.php b/backup/moodle2/restore_coursework_activity_task.class.php index f346f537..784491c2 100644 --- a/backup/moodle2/restore_coursework_activity_task.class.php +++ b/backup/moodle2/restore_coursework_activity_task.class.php @@ -79,4 +79,4 @@ protected function define_my_steps() $this->add_step(new restore_coursework_activity_structure_step('coursework_structure', 'coursework.xml')); } -} \ No newline at end of file +} diff --git a/classes/ability.php b/classes/ability.php index 452d0869..025eff9a 100644 --- a/classes/ability.php +++ b/classes/ability.php @@ -1382,4 +1382,4 @@ function (plagiarism_flag $plagiarism_flag) { }); } -} \ No newline at end of file +} diff --git a/classes/ability/rule.php b/classes/ability/rule.php index 2154c5a0..571cbe43 100644 --- a/classes/ability/rule.php +++ b/classes/ability/rule.php @@ -118,4 +118,4 @@ protected function class_matches($object) { } return false; } -} \ No newline at end of file +} diff --git a/classes/allocation/allocatable.php b/classes/allocation/allocatable.php index 836fb17f..86e29be6 100644 --- a/classes/allocation/allocatable.php +++ b/classes/allocation/allocatable.php @@ -96,4 +96,4 @@ public function has_all_initial_feedbacks($coursework); * @return submission */ public function get_submission($coursework); -} \ No newline at end of file +} diff --git a/classes/allocation/auto_allocator.php b/classes/allocation/auto_allocator.php index 7340ee33..3475ac91 100644 --- a/classes/allocation/auto_allocator.php +++ b/classes/allocation/auto_allocator.php @@ -138,4 +138,4 @@ private function delete_all_ungraded_auto_allocations() { private function get_coursework() { return $this->coursework; } -} \ No newline at end of file +} diff --git a/classes/allocation/moderatable.php b/classes/allocation/moderatable.php index e9628f6d..9a6faa64 100644 --- a/classes/allocation/moderatable.php +++ b/classes/allocation/moderatable.php @@ -32,4 +32,4 @@ interface moderatable { -} \ No newline at end of file +} diff --git a/classes/allocation/table/cell/builder.php b/classes/allocation/table/cell/builder.php index 5f177516..a2fa8623 100644 --- a/classes/allocation/table/cell/builder.php +++ b/classes/allocation/table/cell/builder.php @@ -477,4 +477,4 @@ private function get_submission() { ); return $submission; } -} \ No newline at end of file +} diff --git a/classes/allocation/table/cell/data.php b/classes/allocation/table/cell/data.php index 08a13758..5914d27f 100644 --- a/classes/allocation/table/cell/data.php +++ b/classes/allocation/table/cell/data.php @@ -122,4 +122,4 @@ private function moderation_set_key() { private function pinned_key() { return 'pinned'; } -} \ No newline at end of file +} diff --git a/classes/allocation/table/cell/processor.php b/classes/allocation/table/cell/processor.php index fdb29c70..5450114b 100644 --- a/classes/allocation/table/cell/processor.php +++ b/classes/allocation/table/cell/processor.php @@ -186,4 +186,4 @@ private function has_automatic_sampling() { return $DB->record_exists('coursework_sample_set_mbrs',$params); } -} \ No newline at end of file +} diff --git a/classes/allocation/table/row/processor.php b/classes/allocation/table/row/processor.php index c333c861..e2047f45 100644 --- a/classes/allocation/table/row/processor.php +++ b/classes/allocation/table/row/processor.php @@ -69,4 +69,4 @@ public function process($data) { } -} \ No newline at end of file +} diff --git a/classes/allocation/upload.php b/classes/allocation/upload.php index d2b03c8e..a6e767b1 100644 --- a/classes/allocation/upload.php +++ b/classes/allocation/upload.php @@ -309,4 +309,4 @@ public function update_allocation($allocationid, $assessorid){ return $update; } -} \ No newline at end of file +} diff --git a/classes/auto_grader/auto_grader.php b/classes/auto_grader/auto_grader.php index 9a738960..643fcb1d 100644 --- a/classes/auto_grader/auto_grader.php +++ b/classes/auto_grader/auto_grader.php @@ -31,4 +31,4 @@ interface auto_grader { public function __construct($coursework, $allocatable); public function create_auto_grade_if_rules_match(); -} \ No newline at end of file +} diff --git a/classes/auto_grader/average_grade.php b/classes/auto_grader/average_grade.php index 3d509cc0..66fb89ed 100644 --- a/classes/auto_grader/average_grade.php +++ b/classes/auto_grader/average_grade.php @@ -177,4 +177,4 @@ private function grades_as_percentages() { $initial_feedbacks); return $grades; } -} \ No newline at end of file +} diff --git a/classes/auto_grader/none.php b/classes/auto_grader/none.php index 4c806988..45b63979 100644 --- a/classes/auto_grader/none.php +++ b/classes/auto_grader/none.php @@ -40,4 +40,4 @@ public function __construct($coursework, $allocatable) { public function create_auto_grade_if_rules_match() { } -} \ No newline at end of file +} diff --git a/classes/auto_grader/percentage_distance.php b/classes/auto_grader/percentage_distance.php index f0241a4c..316199fd 100644 --- a/classes/auto_grader/percentage_distance.php +++ b/classes/auto_grader/percentage_distance.php @@ -169,4 +169,4 @@ private function grades_as_percentages() { $initial_feedbacks); return $grades; } -} \ No newline at end of file +} diff --git a/classes/controllers/allocations_controller.php b/classes/controllers/allocations_controller.php index aece883f..fd357513 100644 --- a/classes/controllers/allocations_controller.php +++ b/classes/controllers/allocations_controller.php @@ -31,4 +31,4 @@ class allocations_controller extends controller_base { -} \ No newline at end of file +} diff --git a/classes/controllers/controller_base.php b/classes/controllers/controller_base.php index 2e5a30fe..3165fd21 100644 --- a/classes/controllers/controller_base.php +++ b/classes/controllers/controller_base.php @@ -273,4 +273,4 @@ protected function renderer_class() { $renderer_class_name = "\\mod_coursework\\renderers\\{$this->model_name()}_renderer"; return $renderer_class_name; } -} \ No newline at end of file +} diff --git a/classes/controllers/deadline_extensions_controller.php b/classes/controllers/deadline_extensions_controller.php index 183a1a64..da4aef13 100644 --- a/classes/controllers/deadline_extensions_controller.php +++ b/classes/controllers/deadline_extensions_controller.php @@ -404,4 +404,4 @@ public function table_cell_response($data_params) { } -} \ No newline at end of file +} diff --git a/classes/controllers/grading_controller.php b/classes/controllers/grading_controller.php index 4f7ef8d1..28d60019 100644 --- a/classes/controllers/grading_controller.php +++ b/classes/controllers/grading_controller.php @@ -51,4 +51,4 @@ public function get_remain_rows_grading_table($options) { return $table_html; } -} \ No newline at end of file +} diff --git a/classes/controllers/moderations_controller.php b/classes/controllers/moderations_controller.php index 7e9cd6dc..19d75912 100644 --- a/classes/controllers/moderations_controller.php +++ b/classes/controllers/moderations_controller.php @@ -268,4 +268,4 @@ protected function check_stage_permissions($identifier) { } } } -} \ No newline at end of file +} diff --git a/classes/controllers/plagiarism_flagging_controller.php b/classes/controllers/plagiarism_flagging_controller.php index 8effca0c..33326754 100644 --- a/classes/controllers/plagiarism_flagging_controller.php +++ b/classes/controllers/plagiarism_flagging_controller.php @@ -236,4 +236,4 @@ protected function prepare_environment() { parent::prepare_environment(); } -} \ No newline at end of file +} diff --git a/classes/controllers/submissions_controller.php b/classes/controllers/submissions_controller.php index 3fec188f..4a8c79f0 100644 --- a/classes/controllers/submissions_controller.php +++ b/classes/controllers/submissions_controller.php @@ -480,4 +480,4 @@ protected function has_valid_personal_deadline($submission){ } return $valid_personal_deadline; } -} \ No newline at end of file +} diff --git a/classes/decorators/coursework_groups_decorator.php b/classes/decorators/coursework_groups_decorator.php index 6b8f76f6..229dac7e 100644 --- a/classes/decorators/coursework_groups_decorator.php +++ b/classes/decorators/coursework_groups_decorator.php @@ -36,4 +36,4 @@ class coursework_groups_decorator extends decorator { -} \ No newline at end of file +} diff --git a/classes/decorators/submission_groups_decorator.php b/classes/decorators/submission_groups_decorator.php index e3297959..88dd494c 100644 --- a/classes/decorators/submission_groups_decorator.php +++ b/classes/decorators/submission_groups_decorator.php @@ -53,4 +53,4 @@ public function user_is_in_same_group($user) { return groups_is_member($group->id, $user->id); } -} \ No newline at end of file +} diff --git a/classes/event/course_module_instance_list_viewed.php b/classes/event/course_module_instance_list_viewed.php index cf4c518b..afabf843 100644 --- a/classes/event/course_module_instance_list_viewed.php +++ b/classes/event/course_module_instance_list_viewed.php @@ -48,4 +48,4 @@ * @package mod_coursework\event */ class course_module_instance_list_viewed extends \core\event\course_module_instance_list_viewed { -} \ No newline at end of file +} diff --git a/classes/event/feedback_changed.php b/classes/event/feedback_changed.php index 6cf18f87..b51ae671 100644 --- a/classes/event/feedback_changed.php +++ b/classes/event/feedback_changed.php @@ -56,4 +56,4 @@ protected function init() { -} \ No newline at end of file +} diff --git a/classes/exceptions/access_denied.php b/classes/exceptions/access_denied.php index 8bf68240..d85f983e 100644 --- a/classes/exceptions/access_denied.php +++ b/classes/exceptions/access_denied.php @@ -48,4 +48,4 @@ public function __construct($coursework, $message = null) { parent::__construct('access_denied', 'mod_coursework', $link, null, $message); } -} \ No newline at end of file +} diff --git a/classes/exceptions/late_submission.php b/classes/exceptions/late_submission.php index b009aea0..53fb67d1 100644 --- a/classes/exceptions/late_submission.php +++ b/classes/exceptions/late_submission.php @@ -47,4 +47,4 @@ public function __construct($coursework, $message = null) { parent::__construct('latesubmissionsnotallowed', 'mod_coursework', $link, null, $message); } -} \ No newline at end of file +} diff --git a/classes/export/csv.php b/classes/export/csv.php index d1fa51db..48088197 100644 --- a/classes/export/csv.php +++ b/classes/export/csv.php @@ -275,4 +275,4 @@ public function other_assessors_cells(){ } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/agreedfeedback_cell.php b/classes/export/csv/cells/agreedfeedback_cell.php index 6c7f44a0..ee4812ab 100644 --- a/classes/export/csv/cells/agreedfeedback_cell.php +++ b/classes/export/csv/cells/agreedfeedback_cell.php @@ -112,4 +112,4 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/agreedgrade_cell.php b/classes/export/csv/cells/agreedgrade_cell.php index 1b9a6157..c8135961 100644 --- a/classes/export/csv/cells/agreedgrade_cell.php +++ b/classes/export/csv/cells/agreedgrade_cell.php @@ -279,4 +279,4 @@ function get_rubrics($coursework,$csv_cells) { } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/assessor_cell.php b/classes/export/csv/cells/assessor_cell.php index ea9fcba4..af7129cb 100644 --- a/classes/export/csv/cells/assessor_cell.php +++ b/classes/export/csv/cells/assessor_cell.php @@ -60,4 +60,4 @@ public function get_header($stage){ -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/assessorfeedback_cell.php b/classes/export/csv/cells/assessorfeedback_cell.php index 7f5cc46d..c92d5568 100644 --- a/classes/export/csv/cells/assessorfeedback_cell.php +++ b/classes/export/csv/cells/assessorfeedback_cell.php @@ -169,4 +169,4 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade } } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/assessorgrade_cell.php b/classes/export/csv/cells/assessorgrade_cell.php index 8bef322f..14fe08fb 100644 --- a/classes/export/csv/cells/assessorgrade_cell.php +++ b/classes/export/csv/cells/assessorgrade_cell.php @@ -339,4 +339,4 @@ function get_rubrics($coursework,$csv_cells) { } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/cell_base.php b/classes/export/csv/cells/cell_base.php index 2fbbdf05..9b91314e 100644 --- a/classes/export/csv/cells/cell_base.php +++ b/classes/export/csv/cells/cell_base.php @@ -298,4 +298,4 @@ public function get_rubric_scores_gradedata($grade, &$gradedata){ } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/cell_interface.php b/classes/export/csv/cells/cell_interface.php index db4331bd..a32e0262 100644 --- a/classes/export/csv/cells/cell_interface.php +++ b/classes/export/csv/cells/cell_interface.php @@ -53,4 +53,4 @@ public function get_header($stage); public function validate_cell($value,$submissions,$stage_dentifier=''); -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/email_cell.php b/classes/export/csv/cells/email_cell.php index 0e4f93fd..f0e7c885 100644 --- a/classes/export/csv/cells/email_cell.php +++ b/classes/export/csv/cells/email_cell.php @@ -55,4 +55,4 @@ public function get_cell($submission, $student, $stage_identifier){ public function get_header($stage){ return get_string('email'); } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/extensiondeadline_cell.php b/classes/export/csv/cells/extensiondeadline_cell.php index 9428e0ce..3b8c57fc 100644 --- a/classes/export/csv/cells/extensiondeadline_cell.php +++ b/classes/export/csv/cells/extensiondeadline_cell.php @@ -53,4 +53,4 @@ public function get_header($stage){ return get_string('extensiondeadline', 'coursework'); } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/extensionextrainfo_cell.php b/classes/export/csv/cells/extensionextrainfo_cell.php index 4f4aa63d..57a11077 100644 --- a/classes/export/csv/cells/extensionextrainfo_cell.php +++ b/classes/export/csv/cells/extensionextrainfo_cell.php @@ -54,4 +54,4 @@ public function get_header($stage){ return get_string('extensionextrainfo', 'coursework'); } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/extensionreason_cell.php b/classes/export/csv/cells/extensionreason_cell.php index 957109fa..32e78ec0 100644 --- a/classes/export/csv/cells/extensionreason_cell.php +++ b/classes/export/csv/cells/extensionreason_cell.php @@ -53,4 +53,4 @@ public function get_header($stage){ return get_string('extensionreason', 'coursework'); } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/feedbackcomments_cell.php b/classes/export/csv/cells/feedbackcomments_cell.php index 473e5a10..5293aa96 100644 --- a/classes/export/csv/cells/feedbackcomments_cell.php +++ b/classes/export/csv/cells/feedbackcomments_cell.php @@ -110,4 +110,4 @@ public function validate_cell($value, $submissionid, $stage_identifier='',$uploa return true; } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/finalgrade_cell.php b/classes/export/csv/cells/finalgrade_cell.php index 1ec55174..05cee364 100644 --- a/classes/export/csv/cells/finalgrade_cell.php +++ b/classes/export/csv/cells/finalgrade_cell.php @@ -50,4 +50,4 @@ public function get_header($stage){ return get_string('provisionalgrade', 'coursework'); } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/group_cell.php b/classes/export/csv/cells/group_cell.php index f98cda35..f860067e 100644 --- a/classes/export/csv/cells/group_cell.php +++ b/classes/export/csv/cells/group_cell.php @@ -46,4 +46,4 @@ public function get_cell($submission, $group, $stage_identifier){ public function get_header($stage){ return get_string('group', 'coursework'); } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/idnumber_cell.php b/classes/export/csv/cells/idnumber_cell.php index 5574041a..76c54eff 100644 --- a/classes/export/csv/cells/idnumber_cell.php +++ b/classes/export/csv/cells/idnumber_cell.php @@ -55,4 +55,4 @@ public function get_cell($submission, $student, $stage_identifier){ public function get_header($stage){ return get_string('idnumber'); } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/moderationagreement_cell.php b/classes/export/csv/cells/moderationagreement_cell.php index 8cbbc81f..dd7a2bea 100644 --- a/classes/export/csv/cells/moderationagreement_cell.php +++ b/classes/export/csv/cells/moderationagreement_cell.php @@ -93,4 +93,4 @@ public function get_header($stage){ return $fields; } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/name_cell.php b/classes/export/csv/cells/name_cell.php index 812abf73..7e60fa5f 100644 --- a/classes/export/csv/cells/name_cell.php +++ b/classes/export/csv/cells/name_cell.php @@ -55,4 +55,4 @@ public function get_cell($submission, $student, $stage_identifier){ public function get_header($stage){ return get_string('studentname', 'coursework'); } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/otherassessors_cell.php b/classes/export/csv/cells/otherassessors_cell.php index aa0861fa..373d4d5c 100644 --- a/classes/export/csv/cells/otherassessors_cell.php +++ b/classes/export/csv/cells/otherassessors_cell.php @@ -155,4 +155,4 @@ public function get_header($stage){ -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/personaldeadline_cell.php b/classes/export/csv/cells/personaldeadline_cell.php index 96886744..c6c6fcd0 100644 --- a/classes/export/csv/cells/personaldeadline_cell.php +++ b/classes/export/csv/cells/personaldeadline_cell.php @@ -50,4 +50,4 @@ public function get_header($stage){ return get_string('personal_deadline', 'coursework'); } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/plagiarismflagcomment_cell.php b/classes/export/csv/cells/plagiarismflagcomment_cell.php index 571a87d4..09d66601 100644 --- a/classes/export/csv/cells/plagiarismflagcomment_cell.php +++ b/classes/export/csv/cells/plagiarismflagcomment_cell.php @@ -53,4 +53,4 @@ public function get_header($stage){ return get_string('plagiarismcomment', 'coursework'); } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/plagiarismflagstatus_cell.php b/classes/export/csv/cells/plagiarismflagstatus_cell.php index 773e6e40..50111673 100644 --- a/classes/export/csv/cells/plagiarismflagstatus_cell.php +++ b/classes/export/csv/cells/plagiarismflagstatus_cell.php @@ -53,4 +53,4 @@ public function get_header($stage){ return get_string('plagiarismstatus', 'coursework'); } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/singlegrade_cell.php b/classes/export/csv/cells/singlegrade_cell.php index fa52c3cb..09d2688d 100644 --- a/classes/export/csv/cells/singlegrade_cell.php +++ b/classes/export/csv/cells/singlegrade_cell.php @@ -284,4 +284,4 @@ function get_rubrics($coursework,$csv_cells) { return $cells; } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/stages_cell.php b/classes/export/csv/cells/stages_cell.php index 49a291e8..9cd61c96 100644 --- a/classes/export/csv/cells/stages_cell.php +++ b/classes/export/csv/cells/stages_cell.php @@ -164,4 +164,4 @@ public function get_header($stage){ -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/submissiondate_cell.php b/classes/export/csv/cells/submissiondate_cell.php index 306ed8af..73a0204d 100644 --- a/classes/export/csv/cells/submissiondate_cell.php +++ b/classes/export/csv/cells/submissiondate_cell.php @@ -49,4 +49,4 @@ public function get_header($stage){ return get_string('submissiondate', 'coursework'); } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/submissionfileid_cell.php b/classes/export/csv/cells/submissionfileid_cell.php index 85bd447b..35eabe79 100644 --- a/classes/export/csv/cells/submissionfileid_cell.php +++ b/classes/export/csv/cells/submissionfileid_cell.php @@ -63,4 +63,4 @@ public function validate_cell($value,$submissionid,$stage_dentifier='',$uploaded return ($value == $hash) ? true : get_string('submissionnotfound','coursework'); } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/submissionid_cell.php b/classes/export/csv/cells/submissionid_cell.php index 392fe07e..5058a291 100644 --- a/classes/export/csv/cells/submissionid_cell.php +++ b/classes/export/csv/cells/submissionid_cell.php @@ -52,4 +52,4 @@ public function validate_cell($value,$submissionid,$stage_dentifier='',$uploaded return ($DB->record_exists('coursework_submissions',array('id'=>$submissionid,'courseworkid'=>$this->coursework->id()))) ? true: get_string('submissionnotfoundincoursework','coursework'); } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/submissiontime_cell.php b/classes/export/csv/cells/submissiontime_cell.php index e71e524e..e1e003d7 100644 --- a/classes/export/csv/cells/submissiontime_cell.php +++ b/classes/export/csv/cells/submissiontime_cell.php @@ -50,4 +50,4 @@ public function get_header($stage){ } -} \ No newline at end of file +} diff --git a/classes/export/csv/cells/username_cell.php b/classes/export/csv/cells/username_cell.php index 2528e49b..9406c6e9 100644 --- a/classes/export/csv/cells/username_cell.php +++ b/classes/export/csv/cells/username_cell.php @@ -56,4 +56,4 @@ public function get_header($stage){ return get_string('studentusername', 'coursework'); } -} \ No newline at end of file +} diff --git a/classes/export/import.php b/classes/export/import.php index 8b3df941..e0bd07b6 100644 --- a/classes/export/import.php +++ b/classes/export/import.php @@ -891,4 +891,4 @@ public function remove_other_assessors_grade($csv_cells, &$line){ } -} \ No newline at end of file +} diff --git a/classes/file_importer.php b/classes/file_importer.php index 02de0dc2..a1772550 100644 --- a/classes/file_importer.php +++ b/classes/file_importer.php @@ -256,4 +256,4 @@ public function feedback_exists($coursework,$submission,$stageidentifier) { } -} \ No newline at end of file +} diff --git a/classes/forms/choose_student_for_submission_mform.php b/classes/forms/choose_student_for_submission_mform.php index ee7855d0..44427fb8 100644 --- a/classes/forms/choose_student_for_submission_mform.php +++ b/classes/forms/choose_student_for_submission_mform.php @@ -77,4 +77,4 @@ protected function definition() { $this->add_action_buttons(true, get_string('choosestudent', 'mod_coursework')); } -} \ No newline at end of file +} diff --git a/classes/forms/deadline_extension_form.php b/classes/forms/deadline_extension_form.php index b07d3256..9f9e3927 100644 --- a/classes/forms/deadline_extension_form.php +++ b/classes/forms/deadline_extension_form.php @@ -134,4 +134,4 @@ public function personal_deadline(){ } -} \ No newline at end of file +} diff --git a/classes/forms/personal_deadline_form.php b/classes/forms/personal_deadline_form.php index bebed249..1d1c8155 100644 --- a/classes/forms/personal_deadline_form.php +++ b/classes/forms/personal_deadline_form.php @@ -80,4 +80,4 @@ public function validation($data, $files) { return $errors; } -} \ No newline at end of file +} diff --git a/classes/forms/upload_allocations_form.php b/classes/forms/upload_allocations_form.php index 503e7a19..17a44a39 100644 --- a/classes/forms/upload_allocations_form.php +++ b/classes/forms/upload_allocations_form.php @@ -69,4 +69,4 @@ function display() { return $this->_form->toHtml(); } -} \ No newline at end of file +} diff --git a/classes/forms/upload_feedback_form.php b/classes/forms/upload_feedback_form.php index e55ca05c..e22449da 100644 --- a/classes/forms/upload_feedback_form.php +++ b/classes/forms/upload_feedback_form.php @@ -96,4 +96,4 @@ function display() { return $this->_form->toHtml(); } -} \ No newline at end of file +} diff --git a/classes/forms/upload_grading_sheet_form.php b/classes/forms/upload_grading_sheet_form.php index 9d2e4035..81fd259c 100644 --- a/classes/forms/upload_grading_sheet_form.php +++ b/classes/forms/upload_grading_sheet_form.php @@ -79,4 +79,4 @@ function display() { -} \ No newline at end of file +} diff --git a/classes/forms/view_all_students_mform.php b/classes/forms/view_all_students_mform.php index 8c90cebe..c9a4e033 100644 --- a/classes/forms/view_all_students_mform.php +++ b/classes/forms/view_all_students_mform.php @@ -56,4 +56,4 @@ public function display() { } -} \ No newline at end of file +} diff --git a/classes/framework/ability.php b/classes/framework/ability.php index 84c7add9..0fd32278 100644 --- a/classes/framework/ability.php +++ b/classes/framework/ability.php @@ -214,4 +214,4 @@ protected function prevent($action, $class, $function) { } -} \ No newline at end of file +} diff --git a/classes/framework/decorator.php b/classes/framework/decorator.php index 4795cd30..05cb833e 100644 --- a/classes/framework/decorator.php +++ b/classes/framework/decorator.php @@ -84,4 +84,4 @@ public function __set($name, $value) { public function wrapped_object() { return $this->wrapped_object; } -} \ No newline at end of file +} diff --git a/classes/framework/test/classes/user_table.php b/classes/framework/test/classes/user_table.php index 166155eb..06b5065a 100644 --- a/classes/framework/test/classes/user_table.php +++ b/classes/framework/test/classes/user_table.php @@ -34,4 +34,4 @@ class framework_user_table extends \mod_coursework\framework\table_base { */ protected static $table_name = 'user'; -} \ No newline at end of file +} diff --git a/classes/framework/test/table_base_test.php b/classes/framework/test/table_base_test.php index 0dbf082d..d9e73235 100644 --- a/classes/framework/test/table_base_test.php +++ b/classes/framework/test/table_base_test.php @@ -141,4 +141,4 @@ public function test_find_all_returns_specific_records() { $this->assertEquals(2, count(framework_user_table::find_all(array('firstname' => 'Dave')))); } -} \ No newline at end of file +} diff --git a/classes/grade_judge.php b/classes/grade_judge.php index 3fab58b2..6a0ab3e3 100644 --- a/classes/grade_judge.php +++ b/classes/grade_judge.php @@ -220,4 +220,4 @@ public function get_grade($value) { -} \ No newline at end of file +} diff --git a/classes/grading_table_row_multi.php b/classes/grading_table_row_multi.php index a10bfc7b..a03c6ec4 100644 --- a/classes/grading_table_row_multi.php +++ b/classes/grading_table_row_multi.php @@ -36,4 +36,4 @@ public function get_assessor_feedback_table() { } -} \ No newline at end of file +} diff --git a/classes/mailer.php b/classes/mailer.php index 7f50d174..3160fe20 100644 --- a/classes/mailer.php +++ b/classes/mailer.php @@ -273,4 +273,4 @@ public function send_submission_notification($userstonotify) { } -} \ No newline at end of file +} diff --git a/classes/models/assessment_set_membership.php b/classes/models/assessment_set_membership.php index 260012b0..43ed486e 100644 --- a/classes/models/assessment_set_membership.php +++ b/classes/models/assessment_set_membership.php @@ -106,4 +106,4 @@ protected function after_destroy() { self::remove_cache($this->courseworkid); } -} \ No newline at end of file +} diff --git a/classes/models/deadline_extension.php b/classes/models/deadline_extension.php index 158ef146..bae838f4 100644 --- a/classes/models/deadline_extension.php +++ b/classes/models/deadline_extension.php @@ -159,4 +159,4 @@ protected function after_destroy() { self::remove_cache($this->courseworkid); } -} \ No newline at end of file +} diff --git a/classes/models/group.php b/classes/models/group.php index 698a0741..a8a02467 100644 --- a/classes/models/group.php +++ b/classes/models/group.php @@ -144,4 +144,4 @@ public static function get_object($id) { } return self::$pool['id'][$id]; } -} \ No newline at end of file +} diff --git a/classes/models/moderation.php b/classes/models/moderation.php index 2a9debb5..a1f1638d 100644 --- a/classes/models/moderation.php +++ b/classes/models/moderation.php @@ -187,4 +187,4 @@ public static function get_moderator_agreement($feedback) { return null; } -} \ No newline at end of file +} diff --git a/classes/models/null_feedback.php b/classes/models/null_feedback.php index d82e14b6..09c3e6f9 100644 --- a/classes/models/null_feedback.php +++ b/classes/models/null_feedback.php @@ -42,4 +42,4 @@ public function get_grade() { return ''; } -} \ No newline at end of file +} diff --git a/classes/models/null_user.php b/classes/models/null_user.php index 1aadc5b7..8c292ffb 100644 --- a/classes/models/null_user.php +++ b/classes/models/null_user.php @@ -114,4 +114,4 @@ public function get_agreed_feedback($coursework){ public function get_submission($coursework) { } -} \ No newline at end of file +} diff --git a/classes/models/personal_deadline.php b/classes/models/personal_deadline.php index c599cef7..5fb970ea 100644 --- a/classes/models/personal_deadline.php +++ b/classes/models/personal_deadline.php @@ -154,4 +154,4 @@ protected function after_destroy() { self::remove_cache($this->courseworkid); } -} \ No newline at end of file +} diff --git a/classes/models/plagiarism_flag.php b/classes/models/plagiarism_flag.php index 7f1b506e..779d5d5d 100644 --- a/classes/models/plagiarism_flag.php +++ b/classes/models/plagiarism_flag.php @@ -169,4 +169,4 @@ protected function after_destroy() { } -} \ No newline at end of file +} diff --git a/classes/models/reminder.php b/classes/models/reminder.php index 6c687ded..bda8b692 100644 --- a/classes/models/reminder.php +++ b/classes/models/reminder.php @@ -33,4 +33,4 @@ class reminder extends table_base { protected static $table_name = 'coursework_reminder'; -} \ No newline at end of file +} diff --git a/classes/models/user.php b/classes/models/user.php index f6313999..ba8f76df 100644 --- a/classes/models/user.php +++ b/classes/models/user.php @@ -212,4 +212,4 @@ public static function get_object($id) { } -} \ No newline at end of file +} diff --git a/classes/observer.php b/classes/observer.php index 66cecc7e..8b3f2b97 100644 --- a/classes/observer.php +++ b/classes/observer.php @@ -96,4 +96,4 @@ public static function remove_teacher_from_dropdown_when_unenrolled(core\event\r } -} \ No newline at end of file +} diff --git a/classes/personal_deadline/allocatable.php b/classes/personal_deadline/allocatable.php index 8cf248f1..41d84f36 100644 --- a/classes/personal_deadline/allocatable.php +++ b/classes/personal_deadline/allocatable.php @@ -96,4 +96,4 @@ public function has_all_initial_feedbacks($coursework); * @return submission */ public function get_submission($coursework); -} \ No newline at end of file +} diff --git a/classes/plagiarism_helpers/base.php b/classes/plagiarism_helpers/base.php index ef694a02..717024db 100644 --- a/classes/plagiarism_helpers/base.php +++ b/classes/plagiarism_helpers/base.php @@ -64,4 +64,4 @@ abstract public function enabled(); */ abstract public function human_readable_name(); -} \ No newline at end of file +} diff --git a/classes/plagiarism_helpers/turnitin.php b/classes/plagiarism_helpers/turnitin.php index 36f60f69..0f75653a 100644 --- a/classes/plagiarism_helpers/turnitin.php +++ b/classes/plagiarism_helpers/turnitin.php @@ -69,4 +69,4 @@ public function enabled() { public function human_readable_name() { return get_string('turnitin', 'plagiarism_turnitin'); } -} \ No newline at end of file +} diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php index 96537ecb..8e506000 100644 --- a/classes/privacy/provider.php +++ b/classes/privacy/provider.php @@ -623,4 +623,4 @@ protected static function export_mod_agreement_data($agreement, $context, $path) writer::with_context($context) ->export_data(array_merge($path, [get_string('privacy:moderator', 'mod_coursework')]), (object) $agreementData); } -} \ No newline at end of file +} diff --git a/classes/render_helpers/grading_report/base_renderer.php b/classes/render_helpers/grading_report/base_renderer.php index 2ab83c6e..b0e44a5e 100644 --- a/classes/render_helpers/grading_report/base_renderer.php +++ b/classes/render_helpers/grading_report/base_renderer.php @@ -35,4 +35,4 @@ public function render_grading_report() { } -} \ No newline at end of file +} diff --git a/classes/render_helpers/grading_report/cells/_user_cell.php b/classes/render_helpers/grading_report/cells/_user_cell.php index 72ad4c80..dd089ee2 100644 --- a/classes/render_helpers/grading_report/cells/_user_cell.php +++ b/classes/render_helpers/grading_report/cells/_user_cell.php @@ -131,4 +131,4 @@ private function fullname_format() { public function header_group() { return 'empty'; } -} \ No newline at end of file +} diff --git a/classes/render_helpers/grading_report/cells/allocatable_cell.php b/classes/render_helpers/grading_report/cells/allocatable_cell.php index 0ba0dcfa..d62f0515 100644 --- a/classes/render_helpers/grading_report/cells/allocatable_cell.php +++ b/classes/render_helpers/grading_report/cells/allocatable_cell.php @@ -29,4 +29,4 @@ */ interface allocatable_cell extends cell_interface { -} \ No newline at end of file +} diff --git a/classes/render_helpers/grading_report/cells/cell_interface.php b/classes/render_helpers/grading_report/cells/cell_interface.php index 94ce2c39..53409676 100644 --- a/classes/render_helpers/grading_report/cells/cell_interface.php +++ b/classes/render_helpers/grading_report/cells/cell_interface.php @@ -67,4 +67,4 @@ public function header_group(); * @return mixed */ public function get_table_header_help_icon(); -} \ No newline at end of file +} diff --git a/classes/render_helpers/grading_report/cells/email_cell.php b/classes/render_helpers/grading_report/cells/email_cell.php index 301b15db..9e8855f8 100644 --- a/classes/render_helpers/grading_report/cells/email_cell.php +++ b/classes/render_helpers/grading_report/cells/email_cell.php @@ -68,4 +68,4 @@ public function get_table_header_class(){ public function header_group() { return 'empty'; } -} \ No newline at end of file +} diff --git a/classes/render_helpers/grading_report/cells/first_name_cell.php b/classes/render_helpers/grading_report/cells/first_name_cell.php index b940b588..d9c08586 100644 --- a/classes/render_helpers/grading_report/cells/first_name_cell.php +++ b/classes/render_helpers/grading_report/cells/first_name_cell.php @@ -68,4 +68,4 @@ public function get_table_header_class(){ public function header_group() { return 'empty'; } -} \ No newline at end of file +} diff --git a/classes/render_helpers/grading_report/cells/first_name_letter_cell.php b/classes/render_helpers/grading_report/cells/first_name_letter_cell.php index 592b29f2..3ef4e218 100644 --- a/classes/render_helpers/grading_report/cells/first_name_letter_cell.php +++ b/classes/render_helpers/grading_report/cells/first_name_letter_cell.php @@ -76,4 +76,4 @@ public function get_table_header_class(){ public function header_group() { return 'empty'; } -} \ No newline at end of file +} 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 aeae7f7a..6e3aaaf6 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 @@ -82,4 +82,4 @@ public function get_table_header_help_icon(){ return ($OUTPUT->help_icon('provisionalgrade', 'mod_coursework')); } -} \ No newline at end of file +} diff --git a/classes/render_helpers/grading_report/cells/group_cell.php b/classes/render_helpers/grading_report/cells/group_cell.php index be672947..91cd7c30 100644 --- a/classes/render_helpers/grading_report/cells/group_cell.php +++ b/classes/render_helpers/grading_report/cells/group_cell.php @@ -114,4 +114,4 @@ protected function add_group_member_name($group_member, $row_object) { public function header_group() { return 'empty'; } -} \ No newline at end of file +} diff --git a/classes/render_helpers/grading_report/cells/last_name_cell.php b/classes/render_helpers/grading_report/cells/last_name_cell.php index fada2e6e..65b5f0d4 100644 --- a/classes/render_helpers/grading_report/cells/last_name_cell.php +++ b/classes/render_helpers/grading_report/cells/last_name_cell.php @@ -68,4 +68,4 @@ public function get_table_header_class(){ public function header_group() { return 'empty'; } -} \ No newline at end of file +} diff --git a/classes/render_helpers/grading_report/cells/last_name_letter_cell.php b/classes/render_helpers/grading_report/cells/last_name_letter_cell.php index 35c4bf9c..7b7770d2 100644 --- a/classes/render_helpers/grading_report/cells/last_name_letter_cell.php +++ b/classes/render_helpers/grading_report/cells/last_name_letter_cell.php @@ -76,4 +76,4 @@ public function get_table_header_class(){ public function header_group() { return 'empty'; } -} \ No newline at end of file +} 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 d71151bc..b7d787ba 100644 --- a/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php +++ b/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php @@ -241,4 +241,4 @@ private function show_moderation_button($rowobject) { null, array('class'=>'show_moderation','id' => $link_id)); } -} \ No newline at end of file +} diff --git a/classes/render_helpers/grading_report/cells/moderation_cell.php b/classes/render_helpers/grading_report/cells/moderation_cell.php index 0a87d89d..6b338ce4 100644 --- a/classes/render_helpers/grading_report/cells/moderation_cell.php +++ b/classes/render_helpers/grading_report/cells/moderation_cell.php @@ -174,4 +174,4 @@ protected function add_new_feedback_link_to_cell($row_object) { public function header_group() { return 'grades'; } -} \ No newline at end of file +} diff --git a/classes/render_helpers/grading_report/cells/plagiarism_cell.php b/classes/render_helpers/grading_report/cells/plagiarism_cell.php index f45fe283..aca3e7e2 100644 --- a/classes/render_helpers/grading_report/cells/plagiarism_cell.php +++ b/classes/render_helpers/grading_report/cells/plagiarism_cell.php @@ -79,4 +79,4 @@ public function get_table_header_class(){ public function header_group() { return 'submission'; } -} \ No newline at end of file +} 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 d4798fc6..5e8d6085 100644 --- a/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php +++ b/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php @@ -148,4 +148,4 @@ private function edit_flag_plagiarism_button($row_object) { $icon = new pix_icon('edit', $title, 'coursework'); return $OUTPUT->action_icon($link, $icon, null, array('id' => $link_id)); } -} \ No newline at end of file +} diff --git a/classes/render_helpers/grading_report/cells/status_cell.php b/classes/render_helpers/grading_report/cells/status_cell.php index cac0d210..9279ff98 100644 --- a/classes/render_helpers/grading_report/cells/status_cell.php +++ b/classes/render_helpers/grading_report/cells/status_cell.php @@ -65,4 +65,4 @@ public function get_table_header_class(){ public function header_group() { return 'empty'; } -} \ No newline at end of file +} diff --git a/classes/render_helpers/grading_report/cells/submission_cell.php b/classes/render_helpers/grading_report/cells/submission_cell.php index ba5b71b8..b5561eda 100644 --- a/classes/render_helpers/grading_report/cells/submission_cell.php +++ b/classes/render_helpers/grading_report/cells/submission_cell.php @@ -160,4 +160,4 @@ public function get_table_header_class(){ public function header_group() { return 'submission'; } -} \ No newline at end of file +} diff --git a/classes/render_helpers/grading_report/component_factory_interface.php b/classes/render_helpers/grading_report/component_factory_interface.php index c9d2a08f..d9e9618d 100644 --- a/classes/render_helpers/grading_report/component_factory_interface.php +++ b/classes/render_helpers/grading_report/component_factory_interface.php @@ -37,4 +37,4 @@ public function get_cells(); public function get_sub_rows(); -} \ No newline at end of file +} diff --git a/classes/render_helpers/grading_report/multi_renderer.php b/classes/render_helpers/grading_report/multi_renderer.php index 9a8281bb..6ef00021 100644 --- a/classes/render_helpers/grading_report/multi_renderer.php +++ b/classes/render_helpers/grading_report/multi_renderer.php @@ -32,4 +32,4 @@ */ class multi_renderer extends base_renderer { -} \ No newline at end of file +} diff --git a/classes/render_helpers/grading_report/single_renderer.php b/classes/render_helpers/grading_report/single_renderer.php index c7e2a672..3666e391 100644 --- a/classes/render_helpers/grading_report/single_renderer.php +++ b/classes/render_helpers/grading_report/single_renderer.php @@ -32,4 +32,4 @@ */ class single_renderer extends base_renderer { -} \ No newline at end of file +} 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 482b5018..43af3210 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 @@ -36,4 +36,4 @@ class no_sub_rows implements sub_rows_interface { public function get_row_with_assessor_feedback_table($row_object, $column_width) { return ''; } -} \ No newline at end of file +} 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 7c87f959..8ddbbafa 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 @@ -37,4 +37,4 @@ interface sub_rows_interface { */ public function get_row_with_assessor_feedback_table($row_object, $column_width); -} \ No newline at end of file +} diff --git a/classes/renderers/coursework_renderer.php b/classes/renderers/coursework_renderer.php index e69de29b..8b137891 100644 --- a/classes/renderers/coursework_renderer.php +++ b/classes/renderers/coursework_renderer.php @@ -0,0 +1 @@ + diff --git a/classes/renderers/deadline_extension_renderer.php b/classes/renderers/deadline_extension_renderer.php index a1dca7d4..2dad353d 100644 --- a/classes/renderers/deadline_extension_renderer.php +++ b/classes/renderers/deadline_extension_renderer.php @@ -105,4 +105,4 @@ public function edit_page($vars) { echo $OUTPUT->footer(); } -} \ No newline at end of file +} diff --git a/classes/renderers/personal_deadline_renderer.php b/classes/renderers/personal_deadline_renderer.php index 99a67405..7a949aa8 100644 --- a/classes/renderers/personal_deadline_renderer.php +++ b/classes/renderers/personal_deadline_renderer.php @@ -75,4 +75,4 @@ public function new_page($vars) { echo $OUTPUT->footer(); } -} \ No newline at end of file +} diff --git a/classes/renderers/submission_renderer.php b/classes/renderers/submission_renderer.php index e69de29b..8b137891 100644 --- a/classes/renderers/submission_renderer.php +++ b/classes/renderers/submission_renderer.php @@ -0,0 +1 @@ + diff --git a/classes/sample_set_rule/range_sample_type.php b/classes/sample_set_rule/range_sample_type.php index 26ed1f5b..cf18cf62 100644 --- a/classes/sample_set_rule/range_sample_type.php +++ b/classes/sample_set_rule/range_sample_type.php @@ -493,4 +493,4 @@ private function get_allocatables_in_range($stage,$limit1,$limit2) { } -} \ No newline at end of file +} diff --git a/classes/sample_set_rule/sample_base.php b/classes/sample_set_rule/sample_base.php index c6fbca57..b1666afa 100644 --- a/classes/sample_set_rule/sample_base.php +++ b/classes/sample_set_rule/sample_base.php @@ -193,4 +193,4 @@ protected function released_submissions(){ } -} \ No newline at end of file +} diff --git a/classes/sample_set_rule/total_sample_type.php b/classes/sample_set_rule/total_sample_type.php index bf651507..386142a8 100644 --- a/classes/sample_set_rule/total_sample_type.php +++ b/classes/sample_set_rule/total_sample_type.php @@ -263,4 +263,4 @@ public function adjust_sample_set($stage_number,&$allocatables,&$manual_sample_s -} \ No newline at end of file +} diff --git a/classes/stages/assessor.php b/classes/stages/assessor.php index d692bd74..e8d32324 100644 --- a/classes/stages/assessor.php +++ b/classes/stages/assessor.php @@ -109,4 +109,4 @@ public function uses_sampling() { } } -} \ No newline at end of file +} diff --git a/classes/stages/base.php b/classes/stages/base.php index e1d5a820..82ca93f7 100644 --- a/classes/stages/base.php +++ b/classes/stages/base.php @@ -986,4 +986,4 @@ public function get_assessor_from_moodle_course_group($allocatable){ return $assessor; } -} \ No newline at end of file +} diff --git a/classes/stages/final_agreed.php b/classes/stages/final_agreed.php index c80e9c78..f31ebc02 100644 --- a/classes/stages/final_agreed.php +++ b/classes/stages/final_agreed.php @@ -63,4 +63,4 @@ public function allocation_table_header() { protected function assessor_capability() { return 'mod/coursework:addagreedgrade'; } -} \ No newline at end of file +} diff --git a/classes/stages/moderator.php b/classes/stages/moderator.php index 9894afc8..0f467844 100644 --- a/classes/stages/moderator.php +++ b/classes/stages/moderator.php @@ -53,4 +53,4 @@ protected function strategy_name() { return 'none'; } -} \ No newline at end of file +} diff --git a/classes/task/enrol_task.php b/classes/task/enrol_task.php index d3eb7869..513fc1b7 100644 --- a/classes/task/enrol_task.php +++ b/classes/task/enrol_task.php @@ -64,4 +64,4 @@ public function execute() { return true; } -} \ No newline at end of file +} diff --git a/classes/task/unenrol_task.php b/classes/task/unenrol_task.php index 8b39a264..e19fa2ab 100644 --- a/classes/task/unenrol_task.php +++ b/classes/task/unenrol_task.php @@ -62,4 +62,4 @@ public function execute() { return true; } -} \ No newline at end of file +} diff --git a/classes/test_helpers/factory_mixin.php b/classes/test_helpers/factory_mixin.php index c4736709..845c0011 100644 --- a/classes/test_helpers/factory_mixin.php +++ b/classes/test_helpers/factory_mixin.php @@ -405,4 +405,4 @@ protected function get_submission() { } return $this->submission; } -} \ No newline at end of file +} diff --git a/classes/traits/allocatable_functions.php b/classes/traits/allocatable_functions.php index 73ba4e95..f4c327b7 100644 --- a/classes/traits/allocatable_functions.php +++ b/classes/traits/allocatable_functions.php @@ -180,4 +180,4 @@ private function fill_submission_and_feedback($coursework) { submission::fill_pool_coursework($coursework_id); feedback::fill_pool_coursework($coursework_id); } -} \ No newline at end of file +} diff --git a/classes/warnings.php b/classes/warnings.php index f9ff2fdd..c210d5cb 100644 --- a/classes/warnings.php +++ b/classes/warnings.php @@ -428,4 +428,4 @@ public function a_to_z_filter_on() { public function filters_warning() { return $this->alert_div(get_string('filteronwarning', 'mod_coursework')); } -} \ No newline at end of file +} diff --git a/db/caches.php b/db/caches.php index a800a74e..cf5fdefc 100644 --- a/db/caches.php +++ b/db/caches.php @@ -25,4 +25,4 @@ 'courseworkdata' => array( 'mode' => cache_store::MODE_APPLICATION ) -); \ No newline at end of file +); diff --git a/db/install.php b/db/install.php index 234f6670..663cd347 100644 --- a/db/install.php +++ b/db/install.php @@ -48,4 +48,4 @@ function xmldb_coursework_install() { $i++; } -} \ No newline at end of file +} diff --git a/db/messages.php b/db/messages.php index 894c8d6d..8317abfd 100644 --- a/db/messages.php +++ b/db/messages.php @@ -48,4 +48,4 @@ ), 'student_deadline_reminder' => array( ), -); \ No newline at end of file +); diff --git a/index.php b/index.php index 95b3a0d1..7d9772a8 100644 --- a/index.php +++ b/index.php @@ -69,4 +69,4 @@ echo $OUTPUT->heading(get_string('modulenameplural', 'coursework'), 2); $page_renderer = $PAGE->get_renderer('mod_coursework', 'page'); echo $page_renderer->view_course_index($course->id); -echo $OUTPUT->footer(); \ No newline at end of file +echo $OUTPUT->footer(); diff --git a/lang/en/coursework.php b/lang/en/coursework.php index 1a977aab..57ff757f 100644 --- a/lang/en/coursework.php +++ b/lang/en/coursework.php @@ -911,4 +911,4 @@ $string['privacy:metadata:persondeadlines'] = 'PersonDeadlines'; $string['privacy:metadata:modagreements'] = 'ModAgreements'; $string['privacy:metadata:plagiarismflags'] = 'PlagiarismFlags'; -$string['loadingpagination'] = 'Loading Pagination'; \ No newline at end of file +$string['loadingpagination'] = 'Loading Pagination'; diff --git a/renderable.php b/renderable.php index 6665c34c..03781525 100644 --- a/renderable.php +++ b/renderable.php @@ -120,4 +120,4 @@ class mod_coursework_feedback_files extends mod_coursework_renderable { * @mixin \mod_coursework\personal_deadline\table\builder */ class mod_coursework_personal_deadlines_table extends mod_coursework_renderable { -} \ No newline at end of file +} diff --git a/renderers/grading_report_renderer.php b/renderers/grading_report_renderer.php index e0bc6704..8232dc00 100644 --- a/renderers/grading_report_renderer.php +++ b/renderers/grading_report_renderer.php @@ -290,4 +290,4 @@ public function grading_table_row_id(allocatable $allocatable, coursework $cours } -} \ No newline at end of file +} diff --git a/renderers/object_renderer.php b/renderers/object_renderer.php index 763529fc..4249ea1b 100644 --- a/renderers/object_renderer.php +++ b/renderers/object_renderer.php @@ -1883,4 +1883,4 @@ public function get_submissions_for_assessor($coursework, $submissions){ -} \ No newline at end of file +} diff --git a/tests/behat/behat_mod_coursework.php b/tests/behat/behat_mod_coursework.php index c6baaf0f..f7886ee8 100644 --- a/tests/behat/behat_mod_coursework.php +++ b/tests/behat/behat_mod_coursework.php @@ -2966,4 +2966,4 @@ public function teachersHavaACapabilityToAdministerGrades() { // } // } // } -} \ No newline at end of file +} diff --git a/tests/behat/pages/allocations_page.php b/tests/behat/pages/allocations_page.php index 8e103f65..d73c04ef 100644 --- a/tests/behat/pages/allocations_page.php +++ b/tests/behat/pages/allocations_page.php @@ -297,4 +297,4 @@ public function save_sampling_strategy() { -} \ No newline at end of file +} diff --git a/tests/behat/pages/coursework_page.php b/tests/behat/pages/coursework_page.php index f886c009..ceaca7d7 100644 --- a/tests/behat/pages/coursework_page.php +++ b/tests/behat/pages/coursework_page.php @@ -93,4 +93,4 @@ public function get_coursework_student_name($studentName) { return false; } -} \ No newline at end of file +} diff --git a/tests/behat/pages/edit_extension_page.php b/tests/behat/pages/edit_extension_page.php index 6dd5ccc3..1684b13f 100644 --- a/tests/behat/pages/edit_extension_page.php +++ b/tests/behat/pages/edit_extension_page.php @@ -71,4 +71,4 @@ public function should_show_extra_information_for_allocatable($string) { $field = $this->getPage()->findField('extra_information[text]'); assertContains($string, $field->getValue()); } -} \ No newline at end of file +} diff --git a/tests/behat/pages/gradebook_page.php b/tests/behat/pages/gradebook_page.php index 4b0de0c8..0e70461a 100644 --- a/tests/behat/pages/gradebook_page.php +++ b/tests/behat/pages/gradebook_page.php @@ -53,4 +53,4 @@ public function should_have_coursework_grade_for_student($coursework, $student, $cell_contents = $grade_cell->getText(); assertEquals($grade, $cell_contents, "Expected the gradebook grade to be '{$grade}', but got '{$cell_contents}'"); } -} \ No newline at end of file +} diff --git a/tests/behat/pages/login_page.php b/tests/behat/pages/login_page.php index 929c47f6..7fa74f3c 100644 --- a/tests/behat/pages/login_page.php +++ b/tests/behat/pages/login_page.php @@ -71,4 +71,4 @@ public function login($user) { } -} \ No newline at end of file +} diff --git a/tests/behat/pages/multiple_grading_interface.php b/tests/behat/pages/multiple_grading_interface.php index d35b0c83..45f9cffe 100644 --- a/tests/behat/pages/multiple_grading_interface.php +++ b/tests/behat/pages/multiple_grading_interface.php @@ -398,4 +398,4 @@ public function click_edit_submission_button_for($allocatable) { $element_selector = $this->allocatable_row_id($allocatable) . ' .edit_submission'; $this->getPage()->find('css', $element_selector)->click(); } -} \ No newline at end of file +} diff --git a/tests/behat/pages/new_extension_page.php b/tests/behat/pages/new_extension_page.php index f0e5ad6d..5c968c89 100644 --- a/tests/behat/pages/new_extension_page.php +++ b/tests/behat/pages/new_extension_page.php @@ -58,4 +58,4 @@ public function submit_form() { $this->getPage()->find('css', '#id_submitbutton')->click(); } -} \ No newline at end of file +} diff --git a/tests/behat/pages/page_base.php b/tests/behat/pages/page_base.php index 69cd3b44..d09224b8 100644 --- a/tests/behat/pages/page_base.php +++ b/tests/behat/pages/page_base.php @@ -216,4 +216,4 @@ protected function pressButtonXpath($locator) { $button->press(); } -} \ No newline at end of file +} diff --git a/tests/behat/pages/show_feedback_page.php b/tests/behat/pages/show_feedback_page.php index 95c1dd01..f0ae0881 100644 --- a/tests/behat/pages/show_feedback_page.php +++ b/tests/behat/pages/show_feedback_page.php @@ -81,4 +81,4 @@ private function get_feedback() { } return $this->feedback; } -} \ No newline at end of file +} diff --git a/tests/behat/pages/single_grading_interface.php b/tests/behat/pages/single_grading_interface.php index 9e3bc5ca..9bafa8ad 100644 --- a/tests/behat/pages/single_grading_interface.php +++ b/tests/behat/pages/single_grading_interface.php @@ -145,4 +145,4 @@ public function should_have_assessor_name_in_assessor_feedback_cell($assessor) { private function allocatable_row_id(\mod_coursework\allocation\allocatable $allocatable) { return '#allocatable_' . $this->allocatable_identifier_hash($allocatable); } -} \ No newline at end of file +} diff --git a/tests/behat/pages/student_page.php b/tests/behat/pages/student_page.php index d0c4d742..04e1186b 100644 --- a/tests/behat/pages/student_page.php +++ b/tests/behat/pages/student_page.php @@ -122,4 +122,4 @@ public function click_on_the_save_submission_button() { $locator = "//div[@class='newsubmissionbutton']"; $this->pressButtonXpath($locator); } -} \ No newline at end of file +} diff --git a/tests/behat/pages/student_submission_form.php b/tests/behat/pages/student_submission_form.php index 37219348..36b137f0 100644 --- a/tests/behat/pages/student_submission_form.php +++ b/tests/behat/pages/student_submission_form.php @@ -47,4 +47,4 @@ public function should_not_have_the_save_and_finalise_button() { $buttons = $this->getPage()->findAll('css', '#id_finalisebutton'); assertEmpty($buttons); } -} \ No newline at end of file +} diff --git a/tests/classes/ability_test.php b/tests/classes/ability_test.php index e0958950..d6891525 100644 --- a/tests/classes/ability_test.php +++ b/tests/classes/ability_test.php @@ -47,4 +47,4 @@ public function test_ridiculous_things_are_banned_by_default_if_not_mentioned() $this->assertFalse($ability->can('set_fire_to', $this->get_coursework())); } -} \ No newline at end of file +} diff --git a/tests/classes/allocation/auto_allocator_test.php b/tests/classes/allocation/auto_allocator_test.php index 72ccff2a..91346ceb 100644 --- a/tests/classes/allocation/auto_allocator_test.php +++ b/tests/classes/allocation/auto_allocator_test.php @@ -192,4 +192,4 @@ private function set_coursework_to_single_marker() { private function disable_moderation() { $this->coursework->update_attribute('moderationenabled', 0); } -} \ No newline at end of file +} diff --git a/tests/classes/allocation/form/table_processor_test.php b/tests/classes/allocation/form/table_processor_test.php index 663bb49f..33d829c8 100644 --- a/tests/classes/allocation/form/table_processor_test.php +++ b/tests/classes/allocation/form/table_processor_test.php @@ -217,4 +217,4 @@ private function delete_all_auto_allocations_caused_by_enrol_hooks() { $DB->delete_records('coursework_allocation_pairs'); } -} \ No newline at end of file +} diff --git a/tests/classes/allocation/strategy/percentages_test.php b/tests/classes/allocation/strategy/percentages_test.php index 24548db4..3dde8599 100644 --- a/tests/classes/allocation/strategy/percentages_test.php +++ b/tests/classes/allocation/strategy/percentages_test.php @@ -165,4 +165,4 @@ private function delete_all_allocations() { $DB->delete_records('coursework_allocation_pairs'); } -} \ No newline at end of file +} diff --git a/tests/classes/controllers/deadline_extensions_controller_test.php b/tests/classes/controllers/deadline_extensions_controller_test.php index ef5a8fb0..5cf92f82 100644 --- a/tests/classes/controllers/deadline_extensions_controller_test.php +++ b/tests/classes/controllers/deadline_extensions_controller_test.php @@ -34,4 +34,4 @@ public function test_model_name() { } -} \ No newline at end of file +} diff --git a/tests/classes/cron_test.php b/tests/classes/cron_test.php index 667ed710..7a2f7a31 100644 --- a/tests/classes/cron_test.php +++ b/tests/classes/cron_test.php @@ -173,4 +173,4 @@ public function test_cron_auto_releasing_when_the_user_is_not_there() { $this->assertEmpty($submission->reload()->firstpublished); } -} \ No newline at end of file +} diff --git a/tests/classes/grade_judge_test.php b/tests/classes/grade_judge_test.php index 850185cb..60969194 100644 --- a/tests/classes/grade_judge_test.php +++ b/tests/classes/grade_judge_test.php @@ -66,4 +66,4 @@ public function test_sampling_disabled_one_marker() { $this->assertEquals($feedback->id, $grade_judge->get_feedback_that_is_promoted_to_gradebook($submission)->id); } -} \ No newline at end of file +} diff --git a/tests/classes/models/deadline_extension_test.php b/tests/classes/models/deadline_extension_test.php index ed568212..c6a4f616 100644 --- a/tests/classes/models/deadline_extension_test.php +++ b/tests/classes/models/deadline_extension_test.php @@ -77,4 +77,4 @@ public function test_get_coursework() { $this->assertEquals($extension->get_coursework(), $coursework); } -} \ No newline at end of file +} diff --git a/tests/classes/models/group_test.php b/tests/classes/models/group_test.php index 5c4a6792..6c84bab3 100644 --- a/tests/classes/models/group_test.php +++ b/tests/classes/models/group_test.php @@ -45,4 +45,4 @@ public function test_find() { $this->assertEquals($group->name, group::find($group->id)->name); } -} \ No newline at end of file +} diff --git a/tests/classes/models/moderation_set_membership_test.php b/tests/classes/models/moderation_set_membership_test.php index 2c6dc608..3216c8e4 100644 --- a/tests/classes/models/moderation_set_membership_test.php +++ b/tests/classes/models/moderation_set_membership_test.php @@ -42,4 +42,4 @@ public function test_find() { $this->assertEquals(22, \mod_coursework\models\assessment_set_membership::find($record->id)->allocatableid); } -} \ No newline at end of file +} diff --git a/tests/classes/models/user_test.php b/tests/classes/models/user_test.php index 65d5e210..c5ae8326 100644 --- a/tests/classes/models/user_test.php +++ b/tests/classes/models/user_test.php @@ -104,4 +104,4 @@ public function test_has_all_initial_feedbacks_returns_false_when_all_are_presen -} \ No newline at end of file +} diff --git a/tests/classes/router_test.php b/tests/classes/router_test.php index 06607b98..1c566bac 100644 --- a/tests/classes/router_test.php +++ b/tests/classes/router_test.php @@ -83,4 +83,4 @@ private function get_course() { $this->course = $this->getDataGenerator()->create_course(); return $this->course; } -} \ No newline at end of file +} diff --git a/tests/classes/rule_test.php b/tests/classes/rule_test.php index bfeea60c..ba58a661 100644 --- a/tests/classes/rule_test.php +++ b/tests/classes/rule_test.php @@ -106,4 +106,4 @@ public function test_prevents_when_prevent_and_rule_returns_false() { } -} \ No newline at end of file +} diff --git a/tests/classes/stages/assessor_test.php b/tests/classes/stages/assessor_test.php index 493a5402..b15870c1 100644 --- a/tests/classes/stages/assessor_test.php +++ b/tests/classes/stages/assessor_test.php @@ -73,4 +73,4 @@ public function test_type() { $this->assertEquals('assessor', $stage->type()); } -} \ No newline at end of file +} diff --git a/tests/classes/stages/final_agreed_test.php b/tests/classes/stages/final_agreed_test.php index ba400145..facd3b7c 100644 --- a/tests/classes/stages/final_agreed_test.php +++ b/tests/classes/stages/final_agreed_test.php @@ -81,4 +81,4 @@ public function test_prerequisite_stages_is_true_with_two_assessor_feedbacks() { $this->assertTrue($stage->prerequisite_stages_have_feedback($student)); } -} \ No newline at end of file +} diff --git a/tests/cron_tester.php b/tests/cron_tester.php index fad026cf..915c0aa2 100644 --- a/tests/cron_tester.php +++ b/tests/cron_tester.php @@ -29,4 +29,4 @@ require_once($CFG->dirroot.'/mod/coursework/lib.php'); -coursework_cron(); \ No newline at end of file +coursework_cron(); diff --git a/tests/renderer_test.php b/tests/renderer_test.php index eadb50d2..400fa4e9 100644 --- a/tests/renderer_test.php +++ b/tests/renderer_test.php @@ -34,4 +34,4 @@ public function test_equals() { $this->assertEquals(1, 1); } -} \ No newline at end of file +} From e3423e5d478a8d87805f232a1155d633c8483510 Mon Sep 17 00:00:00 2001 From: David Watson <14983002+watson8@users.noreply.github.com> Date: Mon, 12 Aug 2024 09:34:38 +0100 Subject: [PATCH 03/51] CTP-3558 coding std package coursework --- actions/allocate.php | 3 +-- actions/feedbacks/edit.php | 3 +-- actions/feedbacks/new.php | 3 +-- actions/feedbacks/show.php | 3 +-- actions/finalgrade.php | 3 +-- actions/general_feedback.php | 3 +-- actions/moderations/edit.php | 3 +-- actions/moderations/new.php | 3 +-- actions/moderations/show.php | 3 +-- actions/plagiarism_flagging/edit.php | 3 +-- actions/plagiarism_flagging/new.php | 3 +-- actions/revert.php | 3 +-- actions/set_personal_deadlines.php | 3 +-- actions/submitonbehalfofstudent.php | 3 +-- actions/upload_allocations.php | 3 +-- classes/allocation/manager.php | 3 +-- classes/allocation/strategy/equal.php | 3 +-- classes/allocation/strategy/group_assessor.php | 3 +-- classes/allocation/strategy/none.php | 3 +-- classes/allocation/strategy/percentages.php | 3 +-- classes/allocation/table/builder.php | 3 +-- classes/allocation/table/row/builder.php | 3 +-- classes/allocation/upload.php | 3 +-- classes/allocation/widget.php | 3 +-- classes/event/coursework_deadline_changed.php | 3 +-- classes/event/coursework_plagiarism_flag_updated.php | 3 +-- classes/feedback_files.php | 3 +-- classes/forms/advance_plugins_form.php | 3 +-- classes/forms/assessor_feedback_mform.php | 3 +-- classes/forms/moderator_agreement_mform.php | 3 +-- classes/forms/plagiarism_flagging_mform.php | 3 +-- classes/forms/student_submission_form.php | 3 +-- classes/forms/upload_allocations_form.php | 3 +-- classes/models/coursework.php | 3 +-- classes/models/moderation_set_rule.php | 3 +-- classes/models/sample_set_rule.php | 3 +-- classes/moderation_set_rule/minimum_range_grade_percent.php | 3 +-- classes/moderation_set_rule/minimum_range_grade_raw.php | 3 +-- classes/moderation_set_rule/range_grade_percent.php | 3 +-- classes/moderation_set_rule/range_grade_raw.php | 3 +-- classes/moderation_set_rule/range_total_percent.php | 3 +-- classes/observer.php | 3 +-- classes/personal_deadline/table/builder.php | 3 +-- classes/personal_deadline/table/row/builder.php | 3 +-- classes/sample_set_rule/range_sample_type.php | 3 +-- classes/sample_set_rule/sample_base.php | 3 +-- classes/sample_set_rule/total_sample_type.php | 3 +-- classes/sampling_set_widget.php | 3 +-- classes/submission_files.php | 3 +-- classes/user_row.php | 3 +-- db/access.php | 3 +-- db/events.php | 3 +-- db/log.php | 3 +-- db/messages.php | 3 +-- db/upgrade.php | 3 +-- index.php | 3 +-- lang/en/coursework.php | 3 +-- lib.php | 3 +-- mod_form.php | 3 +-- renderer.php | 3 +-- settings.php | 3 +-- tests/classes/models/coursework_test.php | 3 +-- tests/classes/models/submission_test.php | 3 +-- tests/generator/lib.php | 3 +-- tests/generator_test.php | 3 +-- version.php | 3 +-- view.php | 3 +-- 67 files changed, 67 insertions(+), 134 deletions(-) diff --git a/actions/allocate.php b/actions/allocate.php index bf03b618..605d126c 100644 --- a/actions/allocate.php +++ b/actions/allocate.php @@ -18,8 +18,7 @@ * Page that prints a table of all students and all markers so that first marker, second marker, moderators * etc can be allocated manually or automatically. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/actions/feedbacks/edit.php b/actions/feedbacks/edit.php index 7b5ae72f..5786513d 100644 --- a/actions/feedbacks/edit.php +++ b/actions/feedbacks/edit.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2014 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/actions/feedbacks/new.php b/actions/feedbacks/new.php index d68afdf1..701a9ea5 100644 --- a/actions/feedbacks/new.php +++ b/actions/feedbacks/new.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/actions/feedbacks/show.php b/actions/feedbacks/show.php index 84780dfc..b74fd868 100644 --- a/actions/feedbacks/show.php +++ b/actions/feedbacks/show.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/actions/finalgrade.php b/actions/finalgrade.php index 4e36a973..5971f31d 100644 --- a/actions/finalgrade.php +++ b/actions/finalgrade.php @@ -17,8 +17,7 @@ /** * This file displays a moodle form used to create a final grade for a submission * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2012 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/actions/general_feedback.php b/actions/general_feedback.php index 41c9bcc1..70562f2f 100644 --- a/actions/general_feedback.php +++ b/actions/general_feedback.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/actions/moderations/edit.php b/actions/moderations/edit.php index 30d94920..8028b076 100644 --- a/actions/moderations/edit.php +++ b/actions/moderations/edit.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/actions/moderations/new.php b/actions/moderations/new.php index 743593ee..ba7a7004 100644 --- a/actions/moderations/new.php +++ b/actions/moderations/new.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/actions/moderations/show.php b/actions/moderations/show.php index 8e57293f..171473ba 100644 --- a/actions/moderations/show.php +++ b/actions/moderations/show.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2018 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/actions/plagiarism_flagging/edit.php b/actions/plagiarism_flagging/edit.php index fcd5fece..be4b7507 100644 --- a/actions/plagiarism_flagging/edit.php +++ b/actions/plagiarism_flagging/edit.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2018 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/actions/plagiarism_flagging/new.php b/actions/plagiarism_flagging/new.php index 4d8186a0..d1b3a388 100644 --- a/actions/plagiarism_flagging/new.php +++ b/actions/plagiarism_flagging/new.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2018 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/actions/revert.php b/actions/revert.php index 0ea6e604..b46b0420 100644 --- a/actions/revert.php +++ b/actions/revert.php @@ -18,8 +18,7 @@ * This file will revert the finalised state for one student's submission so that they can alter * files again. Not allowed if they already have feedbacks * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/actions/set_personal_deadlines.php b/actions/set_personal_deadlines.php index 2d2a80f5..0bc56fb8 100644 --- a/actions/set_personal_deadlines.php +++ b/actions/set_personal_deadlines.php @@ -17,8 +17,7 @@ /** * Page that prints a table of all students and their personal deadlines in order to change it one by one or in bulk . * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2016 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/actions/submitonbehalfofstudent.php b/actions/submitonbehalfofstudent.php index ac2eaa5d..ea764066 100644 --- a/actions/submitonbehalfofstudent.php +++ b/actions/submitonbehalfofstudent.php @@ -18,8 +18,7 @@ * This file provides an interface for someone with the appropriate permissions to submit a file on behalf of a student * who may have problems with their internet access, or who cannot for some reason work out how to use the submission form. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2012 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/actions/upload_allocations.php b/actions/upload_allocations.php index 95898666..5a9a5854 100644 --- a/actions/upload_allocations.php +++ b/actions/upload_allocations.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2016 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/allocation/manager.php b/classes/allocation/manager.php index a3a66f11..9e6b32ca 100644 --- a/classes/allocation/manager.php +++ b/classes/allocation/manager.php @@ -20,8 +20,7 @@ * Page that prints a table of all students and all markers so that first marker, second marker, * moderators etc can be allocated manually or automatically. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/allocation/strategy/equal.php b/classes/allocation/strategy/equal.php index d9ae7395..69531cba 100644 --- a/classes/allocation/strategy/equal.php +++ b/classes/allocation/strategy/equal.php @@ -19,8 +19,7 @@ /** * Allocation strategy for giving all teachers equal numbers of students to mark * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/allocation/strategy/group_assessor.php b/classes/allocation/strategy/group_assessor.php index 3a4876bc..307e2a04 100644 --- a/classes/allocation/strategy/group_assessor.php +++ b/classes/allocation/strategy/group_assessor.php @@ -19,8 +19,7 @@ /** * Class file for the Group assessor allocation strategy. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2018 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/allocation/strategy/none.php b/classes/allocation/strategy/none.php index eb3ccf62..0ca51bc1 100644 --- a/classes/allocation/strategy/none.php +++ b/classes/allocation/strategy/none.php @@ -19,8 +19,7 @@ /** * lass file for the default allocation strategy. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2012 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/allocation/strategy/percentages.php b/classes/allocation/strategy/percentages.php index 84e48fa0..60dd9cfd 100644 --- a/classes/allocation/strategy/percentages.php +++ b/classes/allocation/strategy/percentages.php @@ -19,8 +19,7 @@ /** * Allocation strategy for giving each teacher a different percentage of work to mark. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/allocation/table/builder.php b/classes/allocation/table/builder.php index 372beb7f..689f3bf9 100644 --- a/classes/allocation/table/builder.php +++ b/classes/allocation/table/builder.php @@ -19,8 +19,7 @@ /** * Class file for the renderable object that makes the table for allocating markerts to students. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/allocation/table/row/builder.php b/classes/allocation/table/row/builder.php index 35db0429..2f1b2ae1 100644 --- a/classes/allocation/table/row/builder.php +++ b/classes/allocation/table/row/builder.php @@ -19,8 +19,7 @@ /** * Class file for the renderable object that makes a single row in the marker allocation table. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/allocation/upload.php b/classes/allocation/upload.php index a6e767b1..02257cf1 100644 --- a/classes/allocation/upload.php +++ b/classes/allocation/upload.php @@ -19,8 +19,7 @@ use mod_coursework\models; /** - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2016 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/allocation/widget.php b/classes/allocation/widget.php index 5e77b5eb..daae43a2 100644 --- a/classes/allocation/widget.php +++ b/classes/allocation/widget.php @@ -19,8 +19,7 @@ /** * Rendererable object to make the widget to choose allocation strategy. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2012 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/event/coursework_deadline_changed.php b/classes/event/coursework_deadline_changed.php index 6006a48b..ab12d49a 100644 --- a/classes/event/coursework_deadline_changed.php +++ b/classes/event/coursework_deadline_changed.php @@ -17,8 +17,7 @@ /** * coursework_deadline_changed * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2016 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/event/coursework_plagiarism_flag_updated.php b/classes/event/coursework_plagiarism_flag_updated.php index f149f009..f01adbda 100644 --- a/classes/event/coursework_plagiarism_flag_updated.php +++ b/classes/event/coursework_plagiarism_flag_updated.php @@ -17,8 +17,7 @@ /** * ccoursework_plagiarism_flag_updated * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2016 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/feedback_files.php b/classes/feedback_files.php index afbaae5d..f620e7b2 100644 --- a/classes/feedback_files.php +++ b/classes/feedback_files.php @@ -19,8 +19,7 @@ /** * Displays the information a student sees when they submit or have submitted work * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2012 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/forms/advance_plugins_form.php b/classes/forms/advance_plugins_form.php index 919519cb..604aeb67 100644 --- a/classes/forms/advance_plugins_form.php +++ b/classes/forms/advance_plugins_form.php @@ -17,8 +17,7 @@ /** * Creates an mform for final grade * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2012 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/forms/assessor_feedback_mform.php b/classes/forms/assessor_feedback_mform.php index 2ce55c43..6fb07624 100644 --- a/classes/forms/assessor_feedback_mform.php +++ b/classes/forms/assessor_feedback_mform.php @@ -17,8 +17,7 @@ /** * Creates an mform for final grade * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2012 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/forms/moderator_agreement_mform.php b/classes/forms/moderator_agreement_mform.php index 4f14f4a2..5534a0ab 100644 --- a/classes/forms/moderator_agreement_mform.php +++ b/classes/forms/moderator_agreement_mform.php @@ -17,8 +17,7 @@ /** * Creates an mform for moderator agreement * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/forms/plagiarism_flagging_mform.php b/classes/forms/plagiarism_flagging_mform.php index 794225e7..fd001861 100644 --- a/classes/forms/plagiarism_flagging_mform.php +++ b/classes/forms/plagiarism_flagging_mform.php @@ -17,8 +17,7 @@ /** * Creates an mform for moderator agreement * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2017 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/forms/student_submission_form.php b/classes/forms/student_submission_form.php index 8c34db3d..5b93e7a6 100644 --- a/classes/forms/student_submission_form.php +++ b/classes/forms/student_submission_form.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/forms/upload_allocations_form.php b/classes/forms/upload_allocations_form.php index 17a44a39..61a28e4d 100644 --- a/classes/forms/upload_allocations_form.php +++ b/classes/forms/upload_allocations_form.php @@ -16,8 +16,7 @@ // along with Moodle. If not, see . /** - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2016 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/models/coursework.php b/classes/models/coursework.php index fe942c5f..97a112f8 100644 --- a/classes/models/coursework.php +++ b/classes/models/coursework.php @@ -18,8 +18,7 @@ * Page that prints a table of all students and all markers so that first marker, second marker, moderators * etc can be allocated manually or automatically. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/models/moderation_set_rule.php b/classes/models/moderation_set_rule.php index dacdd2e3..5c64c213 100644 --- a/classes/models/moderation_set_rule.php +++ b/classes/models/moderation_set_rule.php @@ -29,8 +29,7 @@ * it cannot do itself, it will tell you what you need to do. The commands in * here will all be database-neutral, using the functions defined in DLL libraries. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/models/sample_set_rule.php b/classes/models/sample_set_rule.php index b1aa21b8..a976d2d1 100644 --- a/classes/models/sample_set_rule.php +++ b/classes/models/sample_set_rule.php @@ -29,8 +29,7 @@ * it cannot do itself, it will tell you what you need to do. The commands in * here will all be database-neutral, using the functions defined in DLL libraries. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/moderation_set_rule/minimum_range_grade_percent.php b/classes/moderation_set_rule/minimum_range_grade_percent.php index e0c32c58..174db463 100644 --- a/classes/moderation_set_rule/minimum_range_grade_percent.php +++ b/classes/moderation_set_rule/minimum_range_grade_percent.php @@ -17,8 +17,7 @@ /** * File for a moderation set rule that will include X students from between an upper and lower limit. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2012 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/moderation_set_rule/minimum_range_grade_raw.php b/classes/moderation_set_rule/minimum_range_grade_raw.php index 180ba91c..0e5d8828 100644 --- a/classes/moderation_set_rule/minimum_range_grade_raw.php +++ b/classes/moderation_set_rule/minimum_range_grade_raw.php @@ -17,8 +17,7 @@ /** * File for a moderation set rule that will include X students from between an upper and lower limit. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2012 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/moderation_set_rule/range_grade_percent.php b/classes/moderation_set_rule/range_grade_percent.php index 0502ba61..6c36ff95 100644 --- a/classes/moderation_set_rule/range_grade_percent.php +++ b/classes/moderation_set_rule/range_grade_percent.php @@ -18,8 +18,7 @@ * Page that prints a table of all students and all markers so that first marker, second marker, * moderators etc can be allocated manually or automatically. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2012 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/moderation_set_rule/range_grade_raw.php b/classes/moderation_set_rule/range_grade_raw.php index 2fb23faf..9d08d0bf 100644 --- a/classes/moderation_set_rule/range_grade_raw.php +++ b/classes/moderation_set_rule/range_grade_raw.php @@ -18,8 +18,7 @@ * Page that prints a table of all students and all markers so that first marker, second marker, * moderators etc can be allocated manually or automatically. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2012 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/moderation_set_rule/range_total_percent.php b/classes/moderation_set_rule/range_total_percent.php index 32e6ba9b..85931376 100644 --- a/classes/moderation_set_rule/range_total_percent.php +++ b/classes/moderation_set_rule/range_total_percent.php @@ -18,8 +18,7 @@ * Page that prints a table of all students and all markers so that first marker, second marker, * moderators etc can be allocated manually or automatically. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2012 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/observer.php b/classes/observer.php index 8b3f2b97..1580713e 100644 --- a/classes/observer.php +++ b/classes/observer.php @@ -17,8 +17,7 @@ /** * Observers * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2016 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/personal_deadline/table/builder.php b/classes/personal_deadline/table/builder.php index 8629555d..1cba2d41 100644 --- a/classes/personal_deadline/table/builder.php +++ b/classes/personal_deadline/table/builder.php @@ -19,8 +19,7 @@ /** * Class file for the renderable object that makes the table for assigning personal deadlines to students. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/personal_deadline/table/row/builder.php b/classes/personal_deadline/table/row/builder.php index 0f9f3a87..715726a6 100644 --- a/classes/personal_deadline/table/row/builder.php +++ b/classes/personal_deadline/table/row/builder.php @@ -19,8 +19,7 @@ /** * Class file for the renderable object that makes a single row in the marker personal deadline table. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/sample_set_rule/range_sample_type.php b/classes/sample_set_rule/range_sample_type.php index cf18cf62..446f98e7 100644 --- a/classes/sample_set_rule/range_sample_type.php +++ b/classes/sample_set_rule/range_sample_type.php @@ -17,8 +17,7 @@ /** * File for a sampling rule that will include X students from between an upper and lower limit. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2015 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/sample_set_rule/sample_base.php b/classes/sample_set_rule/sample_base.php index b1666afa..b6998e41 100644 --- a/classes/sample_set_rule/sample_base.php +++ b/classes/sample_set_rule/sample_base.php @@ -17,8 +17,7 @@ /** * File for a sampling rule that will include X students from between an upper and lower limit. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2015 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/sample_set_rule/total_sample_type.php b/classes/sample_set_rule/total_sample_type.php index 386142a8..1441cdc5 100644 --- a/classes/sample_set_rule/total_sample_type.php +++ b/classes/sample_set_rule/total_sample_type.php @@ -17,8 +17,7 @@ /** * File for a sampling rule that will include X students from between an upper and lower limit. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2015 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/sampling_set_widget.php b/classes/sampling_set_widget.php index 62a4fcaf..a31c2947 100644 --- a/classes/sampling_set_widget.php +++ b/classes/sampling_set_widget.php @@ -20,8 +20,7 @@ * Page that prints a table of all students and all markers so that first marker, second marker, moderators * etc can be allocated manually or automatically. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2012 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/submission_files.php b/classes/submission_files.php index fb4edc70..7ac536ae 100644 --- a/classes/submission_files.php +++ b/classes/submission_files.php @@ -19,8 +19,7 @@ /** * Displays the information a student sees when they submit or have submitted work * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2012 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/classes/user_row.php b/classes/user_row.php index d3304862..00271b22 100644 --- a/classes/user_row.php +++ b/classes/user_row.php @@ -19,8 +19,7 @@ /** * Class file for the renderable object that makes a single row int he marker allocation table. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2012 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/db/access.php b/db/access.php index 19876a38..bf75b398 100644 --- a/db/access.php +++ b/db/access.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/db/events.php b/db/events.php index 9eb9ae19..0e5fc502 100644 --- a/db/events.php +++ b/db/events.php @@ -17,8 +17,7 @@ /** * Event handlers. Mostly for dealing with auto allocation of markers. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2012 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/db/log.php b/db/log.php index ae01ba39..4028ac84 100644 --- a/db/log.php +++ b/db/log.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/db/messages.php b/db/messages.php index 8317abfd..bc5d351a 100644 --- a/db/messages.php +++ b/db/messages.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2012 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/db/upgrade.php b/db/upgrade.php index d1d77bb3..f18c6985 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -24,8 +24,7 @@ * it cannot do itself, it will tell you what you need to do. The commands in * here will all be database-neutral, using the functions defined in DLL libraries. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/index.php b/index.php index 7d9772a8..ad0baf12 100644 --- a/index.php +++ b/index.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/lang/en/coursework.php b/lang/en/coursework.php index 57ff757f..1b4a6376 100644 --- a/lang/en/coursework.php +++ b/lang/en/coursework.php @@ -17,8 +17,7 @@ /** * English strings for coursework * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/lib.php b/lib.php index f1953afa..25382e5e 100644 --- a/lib.php +++ b/lib.php @@ -17,8 +17,7 @@ /** * Library of interface functions and constants for module coursework * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/mod_form.php b/mod_form.php index 95e646d6..963edd57 100644 --- a/mod_form.php +++ b/mod_form.php @@ -18,8 +18,7 @@ * The main coursework module configuration form. Presented to the user when they make a new * instance of this module * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/renderer.php b/renderer.php index dc34fb4d..be109aeb 100644 --- a/renderer.php +++ b/renderer.php @@ -17,8 +17,7 @@ /** * Renderer for the coursework module. * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/settings.php b/settings.php index 86d1c5a2..951e24c9 100644 --- a/settings.php +++ b/settings.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/tests/classes/models/coursework_test.php b/tests/classes/models/coursework_test.php index 5a0b1787..d0d850d9 100644 --- a/tests/classes/models/coursework_test.php +++ b/tests/classes/models/coursework_test.php @@ -17,8 +17,7 @@ /** * Unit tests for the coursework class * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2012 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/tests/classes/models/submission_test.php b/tests/classes/models/submission_test.php index 911dda02..afb26417 100644 --- a/tests/classes/models/submission_test.php +++ b/tests/classes/models/submission_test.php @@ -17,8 +17,7 @@ /** * Unit tests for the coursework class * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2012 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/tests/generator/lib.php b/tests/generator/lib.php index 7309be0b..2715bc6a 100644 --- a/tests/generator/lib.php +++ b/tests/generator/lib.php @@ -17,8 +17,7 @@ /** * mod_coursework data generator * - * @package mod - * @subpackage coursework + * @package mod_coursework * @category phpunit * @copyright 2012 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later diff --git a/tests/generator_test.php b/tests/generator_test.php index a57dcc59..ab34ebf4 100644 --- a/tests/generator_test.php +++ b/tests/generator_test.php @@ -17,8 +17,7 @@ /** * PHPUnit data generator tests * - * @package mod - * @subpackage coursework + * @package mod_coursework * @category phpunit * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later diff --git a/version.php b/version.php index f96c0f7f..cf66c12d 100644 --- a/version.php +++ b/version.php @@ -15,8 +15,7 @@ // along with Moodle. If not, see . /** - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/view.php b/view.php index b4197421..a1d70008 100644 --- a/view.php +++ b/view.php @@ -17,8 +17,7 @@ /** * Prints a particular instance of coursework * - * @package mod - * @subpackage coursework + * @package mod_coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ From 1361eceaf0c7a79c7b2d06392782bb9635bd6bd7 Mon Sep 17 00:00:00 2001 From: David Watson <14983002+watson8@users.noreply.github.com> Date: Mon, 12 Aug 2024 09:36:53 +0100 Subject: [PATCH 04/51] CTP-3558 coding std remove import leading backslash --- actions/allocate.php | 4 ++-- actions/processallocation.php | 4 ++-- actions/selectallallocatables.php | 4 ++-- actions/set_personal_deadlines.php | 4 ++-- classes/allocation/manager.php | 2 +- classes/grades/gradeitems.php | 4 ++-- classes/models/assessment_set_membership.php | 4 ++-- classes/models/feedback.php | 2 +- classes/models/group.php | 4 ++-- classes/models/moderation.php | 2 +- classes/models/moderation_set_rule.php | 2 +- classes/models/sample_set_rule.php | 2 +- classes/models/submission.php | 2 +- classes/models/user.php | 4 ++-- classes/privacy/provider.php | 16 ++++++++-------- tests/classes/ability_test.php | 2 +- .../auto_grader/percentage_distance_test.php | 2 +- tests/classes/grade_judge_test.php | 2 +- tests/classes/models/deadline_extension_test.php | 2 +- tests/classes/stages/assessor_test.php | 2 +- tests/classes/stages/final_agreed_test.php | 2 +- 21 files changed, 36 insertions(+), 36 deletions(-) diff --git a/actions/allocate.php b/actions/allocate.php index 605d126c..e490bd07 100644 --- a/actions/allocate.php +++ b/actions/allocate.php @@ -23,8 +23,8 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -use \mod_coursework\models\coursework; -use \mod_coursework\allocation\widget; +use mod_coursework\models\coursework; +use mod_coursework\allocation\widget; require_once(dirname(__FILE__).'/../../../config.php'); diff --git a/actions/processallocation.php b/actions/processallocation.php index d63aad26..e0396a9a 100644 --- a/actions/processallocation.php +++ b/actions/processallocation.php @@ -27,8 +27,8 @@ //we have to set the time limit to 0 as depending on set_time_limit ( 0 ); -use \mod_coursework\models\coursework; -use \mod_coursework\allocation\widget; +use mod_coursework\models\coursework; +use mod_coursework\allocation\widget; require_once(dirname(__FILE__).'/../../../config.php'); diff --git a/actions/selectallallocatables.php b/actions/selectallallocatables.php index b87cd6eb..82dd08cb 100644 --- a/actions/selectallallocatables.php +++ b/actions/selectallallocatables.php @@ -22,8 +22,8 @@ -use \mod_coursework\models\coursework; -use \mod_coursework\allocation\widget; +use mod_coursework\models\coursework; +use mod_coursework\allocation\widget; require_once(dirname(__FILE__).'/../../../config.php'); diff --git a/actions/set_personal_deadlines.php b/actions/set_personal_deadlines.php index 0bc56fb8..7bdff01d 100644 --- a/actions/set_personal_deadlines.php +++ b/actions/set_personal_deadlines.php @@ -22,8 +22,8 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -use \mod_coursework\models\coursework; -use \mod_coursework\models\personal_deadline; +use mod_coursework\models\coursework; +use mod_coursework\models\personal_deadline; require_once(dirname(__FILE__).'/../../../config.php'); diff --git a/classes/allocation/manager.php b/classes/allocation/manager.php index 9e6b32ca..8c485eaf 100644 --- a/classes/allocation/manager.php +++ b/classes/allocation/manager.php @@ -30,7 +30,7 @@ use mod_coursework\models\moderation_set_rule; use mod_coursework\moderation_set_widget; use mod_coursework\sampling_set_widget; -use \mod_coursework\stages\base as stage_base; +use mod_coursework\stages\base as stage_base; use moodle_exception; use mod_coursework\grade_judge; diff --git a/classes/grades/gradeitems.php b/classes/grades/gradeitems.php index 63e7a507..f3c93d34 100644 --- a/classes/grades/gradeitems.php +++ b/classes/grades/gradeitems.php @@ -24,8 +24,8 @@ namespace mod_coursework\grades; -use \core_grades\local\gradeitem\itemnumber_mapping; -use \core_grades\local\gradeitem\advancedgrading_mapping; +use core_grades\local\gradeitem\itemnumber_mapping; +use core_grades\local\gradeitem\advancedgrading_mapping; /** * Grade item mappings for the activity. diff --git a/classes/models/assessment_set_membership.php b/classes/models/assessment_set_membership.php index 43ed486e..f317953f 100644 --- a/classes/models/assessment_set_membership.php +++ b/classes/models/assessment_set_membership.php @@ -30,8 +30,8 @@ namespace mod_coursework\models; use mod_coursework\framework\table_base; -use \mod_coursework\allocation\allocatable; -use \mod_coursework\allocation\moderatable; +use mod_coursework\allocation\allocatable; +use mod_coursework\allocation\moderatable; /** * @property int courseworkid diff --git a/classes/models/feedback.php b/classes/models/feedback.php index 42a2395e..24a3b765 100644 --- a/classes/models/feedback.php +++ b/classes/models/feedback.php @@ -22,7 +22,7 @@ use mod_coursework\ability; use mod_coursework\stages\base as stage_base; use stdClass; -use \mod_coursework\feedback_files; +use mod_coursework\feedback_files; defined('MOODLE_INTERNAL') || die(); diff --git a/classes/models/group.php b/classes/models/group.php index a8a02467..1fec42df 100644 --- a/classes/models/group.php +++ b/classes/models/group.php @@ -30,8 +30,8 @@ namespace mod_coursework\models; use mod_coursework\framework\table_base; -use \mod_coursework\allocation\allocatable; -use \mod_coursework\allocation\moderatable; +use mod_coursework\allocation\allocatable; +use mod_coursework\allocation\moderatable; use mod_coursework\traits\allocatable_functions; /** diff --git a/classes/models/moderation.php b/classes/models/moderation.php index a1f1638d..8878d6ba 100644 --- a/classes/models/moderation.php +++ b/classes/models/moderation.php @@ -22,7 +22,7 @@ use mod_coursework\ability; use mod_coursework\stages\base as stage_base; use stdClass; -use \mod_coursework\feedback_files; +use mod_coursework\feedback_files; defined('MOODLE_INTERNAL') || die(); diff --git a/classes/models/moderation_set_rule.php b/classes/models/moderation_set_rule.php index 5c64c213..3a6b8b06 100644 --- a/classes/models/moderation_set_rule.php +++ b/classes/models/moderation_set_rule.php @@ -17,7 +17,7 @@ namespace mod_coursework\models; use mod_coursework\allocation\allocatable; -use \mod_coursework\stages\base as stage_base; +use mod_coursework\stages\base as stage_base; /** * This file keeps track of upgrades to the eassessment module diff --git a/classes/models/sample_set_rule.php b/classes/models/sample_set_rule.php index a976d2d1..a5a19ec4 100644 --- a/classes/models/sample_set_rule.php +++ b/classes/models/sample_set_rule.php @@ -17,7 +17,7 @@ namespace mod_coursework\models; use mod_coursework\allocation\allocatable; -use \mod_coursework\stages\base as stage_base; +use mod_coursework\stages\base as stage_base; /** * This file keeps track of upgrades to the eassessment module diff --git a/classes/models/submission.php b/classes/models/submission.php index 37029efb..f2a9b4d5 100644 --- a/classes/models/submission.php +++ b/classes/models/submission.php @@ -21,7 +21,7 @@ use mod_coursework\ability; use mod_coursework\allocation\allocatable; use mod_coursework\grade_judge; -use \mod_coursework\submission_files; +use mod_coursework\submission_files; use mod_coursework\framework\table_base; use moodle_database; use moodle_url; diff --git a/classes/models/user.php b/classes/models/user.php index ba8f76df..3e1ae278 100644 --- a/classes/models/user.php +++ b/classes/models/user.php @@ -30,8 +30,8 @@ namespace mod_coursework\models; use mod_coursework\framework\table_base; -use \mod_coursework\allocation\allocatable; -use \mod_coursework\allocation\moderatable; +use mod_coursework\allocation\allocatable; +use mod_coursework\allocation\moderatable; use mod_coursework\traits\allocatable_functions; /** diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php index 8e506000..4b723b52 100644 --- a/classes/privacy/provider.php +++ b/classes/privacy/provider.php @@ -15,14 +15,14 @@ // along with Moodle. If not, see . namespace mod_coursework\privacy; defined('MOODLE_INTERNAL') || die(); -use \core_privacy\local\metadata\collection; -use \core_privacy\local\request\contextlist; -use \core_privacy\local\request\writer; -use \core_privacy\local\request\approved_contextlist; -use \core_privacy\local\request\transform; -use \core_privacy\local\request\helper; -use \core_privacy\local\request\userlist; -use \core_privacy\local\request\approved_userlist; +use core_privacy\local\metadata\collection; +use core_privacy\local\request\contextlist; +use core_privacy\local\request\writer; +use core_privacy\local\request\approved_contextlist; +use core_privacy\local\request\transform; +use core_privacy\local\request\helper; +use core_privacy\local\request\userlist; +use core_privacy\local\request\approved_userlist; /** * Privacy Subsystem implementation for coursework. * diff --git a/tests/classes/ability_test.php b/tests/classes/ability_test.php index d6891525..e6674e67 100644 --- a/tests/classes/ability_test.php +++ b/tests/classes/ability_test.php @@ -30,7 +30,7 @@ */ class ability_test extends advanced_testcase { - use \mod_coursework\test_helpers\factory_mixin; + use mod_coursework\test_helpers\factory_mixin; public function setUp() { $this->setAdminUser(); diff --git a/tests/classes/auto_grader/percentage_distance_test.php b/tests/classes/auto_grader/percentage_distance_test.php index ac5d3c94..b5836647 100644 --- a/tests/classes/auto_grader/percentage_distance_test.php +++ b/tests/classes/auto_grader/percentage_distance_test.php @@ -31,7 +31,7 @@ */ class percentage_distance_test extends \advanced_testcase { - use \mod_coursework\test_helpers\factory_mixin; + use mod_coursework\test_helpers\factory_mixin; public function setUp() { $this->setAdminUser(); diff --git a/tests/classes/grade_judge_test.php b/tests/classes/grade_judge_test.php index 60969194..ec43d9a2 100644 --- a/tests/classes/grade_judge_test.php +++ b/tests/classes/grade_judge_test.php @@ -31,7 +31,7 @@ class grade_judge_test extends advanced_testcase { - use \mod_coursework\test_helpers\factory_mixin; + use mod_coursework\test_helpers\factory_mixin; public function setUp() { $this->setAdminUser(); diff --git a/tests/classes/models/deadline_extension_test.php b/tests/classes/models/deadline_extension_test.php index c6a4f616..cd57bc09 100644 --- a/tests/classes/models/deadline_extension_test.php +++ b/tests/classes/models/deadline_extension_test.php @@ -29,7 +29,7 @@ */ class mod_coursework_models_deadline_extension_test extends advanced_testcase { - use \mod_coursework\test_helpers\factory_mixin; + use mod_coursework\test_helpers\factory_mixin; public function setUp() { $this->resetAfterTest(); diff --git a/tests/classes/stages/assessor_test.php b/tests/classes/stages/assessor_test.php index b15870c1..5a313a89 100644 --- a/tests/classes/stages/assessor_test.php +++ b/tests/classes/stages/assessor_test.php @@ -26,7 +26,7 @@ */ class assessor_test extends advanced_testcase { - use \mod_coursework\test_helpers\factory_mixin; + use mod_coursework\test_helpers\factory_mixin; public function setUp() { $this->resetAfterTest(); diff --git a/tests/classes/stages/final_agreed_test.php b/tests/classes/stages/final_agreed_test.php index facd3b7c..8475f96b 100644 --- a/tests/classes/stages/final_agreed_test.php +++ b/tests/classes/stages/final_agreed_test.php @@ -26,7 +26,7 @@ */ class final_agreed_test extends advanced_testcase { - use \mod_coursework\test_helpers\factory_mixin; + use mod_coursework\test_helpers\factory_mixin; public function setUp() { $this->resetAfterTest(); From b8b71968e808dfde91c9ea384f602202fc942e43 Mon Sep 17 00:00:00 2001 From: David Watson <14983002+watson8@users.noreply.github.com> Date: Mon, 12 Aug 2024 09:58:17 +0100 Subject: [PATCH 05/51] CTP-3558 coding std remove space around = --- actions/allocate.php | 2 +- actions/allocationsession.php | 30 ++-- actions/personal_deadline.php | 18 +- actions/selectallallocatables.php | 12 +- actions/upload_allocations.php | 8 +- actions/upload_feedback.php | 10 +- actions/upload_grading_sheet.php | 10 +- backup/moodle2/backup_coursework_stepslib.php | 16 +- classes/ability.php | 16 +- classes/allocation/manager.php | 62 +++---- classes/allocation/table/builder.php | 12 +- classes/allocation/table/cell/builder.php | 8 +- classes/allocation/table/cell/processor.php | 2 +- classes/allocation/table/row/builder.php | 8 +- classes/allocation/upload.php | 42 ++--- classes/auto_grader/average_grade.php | 6 +- .../deadline_extensions_controller.php | 14 +- classes/controllers/feedback_controller.php | 60 +++---- .../personal_deadlines_controller.php | 34 ++-- .../plagiarism_flagging_controller.php | 6 +- .../controllers/submissions_controller.php | 18 +- classes/cron.php | 2 +- classes/export/csv.php | 22 +-- .../export/csv/cells/agreedfeedback_cell.php | 4 +- classes/export/csv/cells/agreedgrade_cell.php | 30 ++-- .../csv/cells/assessorfeedback_cell.php | 10 +- .../export/csv/cells/assessorgrade_cell.php | 26 +-- classes/export/csv/cells/cell_base.php | 8 +- .../csv/cells/feedbackcomments_cell.php | 2 +- .../export/csv/cells/otherassessors_cell.php | 4 +- classes/export/csv/cells/singlegrade_cell.php | 26 +-- .../csv/cells/submissionfileid_cell.php | 4 +- classes/export/grading_sheet.php | 4 +- classes/export/import.php | 150 ++++++++--------- classes/file_importer.php | 22 +-- classes/forms/advance_plugins_form.php | 2 +- classes/forms/assessor_feedback_mform.php | 12 +- classes/forms/deadline_extension_form.php | 4 +- classes/forms/student_submission_form.php | 6 +- classes/forms/upload_allocations_form.php | 2 +- classes/forms/upload_feedback_form.php | 4 +- classes/forms/upload_grading_sheet_form.php | 2 +- classes/forms/view_all_students_mform.php | 2 +- classes/grading_report.php | 4 +- classes/grading_table_row_base.php | 4 +- classes/mailer.php | 4 +- classes/models/coursework.php | 22 +-- classes/models/moderation.php | 2 +- classes/models/outstanding_marking.php | 76 ++++----- classes/models/plagiarism_flag.php | 8 +- classes/models/sample_set_rule.php | 2 +- classes/models/submission.php | 18 +- .../personal_deadline/table/row/builder.php | 18 +- classes/privacy/provider.php | 56 +++---- .../grading_report/cells/_user_cell.php | 2 +- .../grading_report/cells/cell_base.php | 2 +- .../grading_report/cells/group_cell.php | 2 +- .../grading_report/cells/idnumber_cell.php | 2 +- .../cells/moderation_agreement_cell.php | 2 +- .../grading_report/cells/moderation_cell.php | 2 +- .../cells/multiple_agreed_grade_cell.php | 2 +- .../cells/personal_deadline_cell.php | 2 +- .../cells/plagiarism_flag_cell.php | 2 +- .../grading_report/cells/submission_cell.php | 2 +- .../cells/time_submitted_cell.php | 4 +- .../grading_report/cells/user_cell.php | 6 +- .../multi_marker_feedback_sub_rows.php | 6 +- .../renderers/personal_deadline_renderer.php | 4 +- classes/sample_set_rule/range_sample_type.php | 122 +++++++------- classes/sample_set_rule/sample_base.php | 2 +- classes/sample_set_rule/total_sample_type.php | 42 ++--- classes/stages/base.php | 18 +- classes/task/enrol_task.php | 2 +- classes/task/unenrol_task.php | 2 +- classes/warnings.php | 2 +- db/events.php | 20 +-- db/install.php | 4 +- db/upgrade.php | 12 +- lang/en/coursework.php | 158 +++++++++--------- lib.php | 18 +- mod_form.php | 156 ++++++++--------- renderers/grading_report_renderer.php | 2 +- renderers/object_renderer.php | 78 ++++----- renderers/page_renderer.php | 22 +-- settings.php | 48 +++--- tests/behat/behat_mod_coursework.php | 12 +- tests/behat/pages/allocations_page.php | 10 +- .../pages/multiple_grading_interface.php | 4 +- tests/classes/export/csv_test.php | 12 +- tests/classes/router_test.php | 2 +- version.php | 8 +- view.php | 24 +-- 92 files changed, 888 insertions(+), 888 deletions(-) diff --git a/actions/allocate.php b/actions/allocate.php index e490bd07..2f4a0b6f 100644 --- a/actions/allocate.php +++ b/actions/allocate.php @@ -112,7 +112,7 @@ $allocationsmanager = $coursework->get_allocation_manager(); $allocationtable = new mod_coursework\allocation\table\builder($coursework, $options); $allocationtable = new mod_coursework_allocation_table($allocationtable); -$pageurl = $PAGE->url; +$pageurl = $PAGE->url; // 1. Save the rules and settings from the config bits. diff --git a/actions/allocationsession.php b/actions/allocationsession.php index de0d0807..e3410c0e 100644 --- a/actions/allocationsession.php +++ b/actions/allocationsession.php @@ -25,39 +25,39 @@ global $SESSION; -$assesorselect = required_param_array('assesorselect',PARAM_RAW); -$assesorselectvalue = required_param_array('assesorselectvalue',PARAM_RAW); -$pinnedchk = optional_param_array('pinned',array(),PARAM_RAW); -$pinnedchkval = optional_param_array('pinnedvalue',array(),PARAM_RAW); -$moderatorselect = optional_param_array('moderatorselect',array(),PARAM_RAW); -$moderatorselectvalue = optional_param_array('moderatorselectvalue',array(),PARAM_RAW); -$samplechk = optional_param_array('sample',array(),PARAM_RAW); -$samplechkvalue = optional_param_array('samplevalue',array(),PARAM_RAW); -$coursemoduleid = required_param('coursemoduleid', PARAM_INT); +$assesorselect = required_param_array('assesorselect',PARAM_RAW); +$assesorselectvalue = required_param_array('assesorselectvalue',PARAM_RAW); +$pinnedchk = optional_param_array('pinned',array(),PARAM_RAW); +$pinnedchkval = optional_param_array('pinnedvalue',array(),PARAM_RAW); +$moderatorselect = optional_param_array('moderatorselect',array(),PARAM_RAW); +$moderatorselectvalue = optional_param_array('moderatorselectvalue',array(),PARAM_RAW); +$samplechk = optional_param_array('sample',array(),PARAM_RAW); +$samplechkvalue = optional_param_array('samplevalue',array(),PARAM_RAW); +$coursemoduleid = required_param('coursemoduleid', PARAM_INT); if (!isset($SESSION->coursework_allocationsessions)) { - $SESSION->coursework_allocationsessions = array(); + $SESSION->coursework_allocationsessions = array(); } if (!isset($SESSION->coursework_allocationsessions[$coursemoduleid])) { - $SESSION->coursework_allocationsessions[$coursemoduleid] = array(); + $SESSION->coursework_allocationsessions[$coursemoduleid] = array(); } for($i = 0; $i < count($assesorselect); $i++) { - $SESSION->coursework_allocationsessions[$coursemoduleid][$assesorselect[$i]] = $assesorselectvalue[$i]; + $SESSION->coursework_allocationsessions[$coursemoduleid][$assesorselect[$i]] = $assesorselectvalue[$i]; } for($i = 0; $i < count($pinnedchk); $i++) { - $SESSION->coursework_allocationsessions[$coursemoduleid][$pinnedchk[$i]] = $pinnedchkval[$i]; + $SESSION->coursework_allocationsessions[$coursemoduleid][$pinnedchk[$i]] = $pinnedchkval[$i]; } for($i = 0; $i < count($moderatorselect); $i++) { - $SESSION->coursework_allocationsessions[$coursemoduleid][$moderatorselect[$i]] = $moderatorselectvalue[$i]; + $SESSION->coursework_allocationsessions[$coursemoduleid][$moderatorselect[$i]] = $moderatorselectvalue[$i]; } for($i = 0; $i < count($samplechk); $i++) { - $SESSION->coursework_allocationsessions[$coursemoduleid][$samplechk[$i]] = $samplechkvalue[$i]; + $SESSION->coursework_allocationsessions[$coursemoduleid][$samplechk[$i]] = $samplechkvalue[$i]; } diff --git a/actions/personal_deadline.php b/actions/personal_deadline.php index a7235b0b..f27bf651 100644 --- a/actions/personal_deadline.php +++ b/actions/personal_deadline.php @@ -31,17 +31,17 @@ $allocatableid_arr = 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); +$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); -$allocatableid = (!empty($allocatableid_arr)) ? $allocatableid_arr : $allocatableid ; +$allocatableid = (!empty($allocatableid_arr)) ? $allocatableid_arr : $allocatableid ; -$coursework_db = $DB->get_record('coursework',array('id'=>$courseworkid)); +$coursework_db = $DB->get_record('coursework',array('id'=>$courseworkid)); -$coursework = \mod_coursework\models\coursework::find($coursework_db); +$coursework = \mod_coursework\models\coursework::find($coursework_db); require_login($coursework->get_course(),false,$coursework->get_course_module()); @@ -49,8 +49,8 @@ 'courseworkid' => $courseworkid, 'allocatableid' => $allocatableid, 'allocatabletype' => $allocatabletype, - 'setpersonaldeadlinespage' => $setpersonaldeadlinespage, - 'multipleuserdeadlines' => $multipleuserdeadlines + 'setpersonaldeadlinespage' => $setpersonaldeadlinespage, + 'multipleuserdeadlines' => $multipleuserdeadlines ); if ($selectedtype != 'unfinalise') { @@ -69,6 +69,6 @@ redirect($url, $message); } - $controller = new mod_coursework\controllers\submissions_controller($params); + $controller = new mod_coursework\controllers\submissions_controller($params); $controller->unfinalise_submission(); } diff --git a/actions/selectallallocatables.php b/actions/selectallallocatables.php index 82dd08cb..7b7badaf 100644 --- a/actions/selectallallocatables.php +++ b/actions/selectallallocatables.php @@ -33,8 +33,8 @@ require_once($CFG->dirroot.'/mod/coursework/lib.php'); -$coursemoduleid = required_param('coursemoduleid', PARAM_INT); -$stagenumber = required_param('stage', PARAM_INT); +$coursemoduleid = required_param('coursemoduleid', PARAM_INT); +$stagenumber = required_param('stage', PARAM_INT); $coursemodule = get_coursemodule_from_id('coursework', $coursemoduleid, 0, false, MUST_EXIST); $course = $DB->get_record('course', array('id' => $coursemodule->course), '*', MUST_EXIST); $coursework = $DB->get_record('coursework', array('id' => $coursemodule->instance), '*', MUST_EXIST); @@ -47,19 +47,19 @@ if ($stagenumber > 0) { if (!isset($SESSION->allocate_page_selectentirestage[$coursework->id()]['assessor_'.$stagenumber])) { - $SESSION->allocate_page_selectentirestage[$coursework->id()]['assessor_'.$stagenumber] = 0; + $SESSION->allocate_page_selectentirestage[$coursework->id()]['assessor_'.$stagenumber] = 0; } - $SESSION->allocate_page_selectentirestage[$coursework->id()]['assessor_'.$stagenumber] = !$SESSION->allocate_page_selectentirestage[$coursework->id()]['assessor_'.$stagenumber]; + $SESSION->allocate_page_selectentirestage[$coursework->id()]['assessor_'.$stagenumber] = !$SESSION->allocate_page_selectentirestage[$coursework->id()]['assessor_'.$stagenumber]; } else { if (!isset($SESSION->allocate_page_selectentirestage[$coursework->id()]['moderator'])) { - $SESSION->allocate_page_selectentirestage[$coursework->id()]['moderator'] = 0; + $SESSION->allocate_page_selectentirestage[$coursework->id()]['moderator'] = 0; } - $SESSION->allocate_page_selectentirestage[$coursework->id()]['moderator'] = !$SESSION->allocate_page_selectentirestage[$coursework->id()]['moderator']; + $SESSION->allocate_page_selectentirestage[$coursework->id()]['moderator'] = !$SESSION->allocate_page_selectentirestage[$coursework->id()]['moderator']; } diff --git a/actions/upload_allocations.php b/actions/upload_allocations.php index 5a9a5854..54bad5c3 100644 --- a/actions/upload_allocations.php +++ b/actions/upload_allocations.php @@ -57,7 +57,7 @@ -$allocationsuploadform = new upload_allocations_form($coursemoduleid); +$allocationsuploadform = new upload_allocations_form($coursemoduleid); if ($allocationsuploadform->is_cancelled()) { redirect("$CFG->wwwroot/mod/coursework/view.php?id=$coursemoduleid"); @@ -65,15 +65,15 @@ -if ($data = $allocationsuploadform->get_data()) { +if ($data = $allocationsuploadform->get_data()) { //perform checks on data $content = $allocationsuploadform->get_file_content('allocationsdata'); - $csvimport = new \mod_coursework\allocation\upload($coursework); + $csvimport = new \mod_coursework\allocation\upload($coursework); - $procsessingresults = $csvimport->validate_csv($content, $data->encoding, $data->delimiter_name); + $procsessingresults = $csvimport->validate_csv($content, $data->encoding, $data->delimiter_name); //process $csvimport->process_csv($content, $data->encoding, $data->delimiter_name, $procsessingresults); diff --git a/actions/upload_feedback.php b/actions/upload_feedback.php index 0639b47f..26b33317 100644 --- a/actions/upload_feedback.php +++ b/actions/upload_feedback.php @@ -65,7 +65,7 @@ -$feedbackform = new upload_feedback_form($coursework,$coursemoduleid); +$feedbackform = new upload_feedback_form($coursework,$coursemoduleid); if ($feedbackform->is_cancelled()) { redirect(new moodle_url("$CFG->wwwroot/mod/coursework/view.php", array('id' => $coursemoduleid))); @@ -73,7 +73,7 @@ -if ($data = $feedbackform->get_data()) { +if ($data = $feedbackform->get_data()) { //perform checks on data $courseworktempdir = $CFG->dataroot."/temp/coursework/"; @@ -87,15 +87,15 @@ $filepath = $courseworktempdir.'/'.$filename.".zip"; $feedbackform->save_file('feedbackzip', $filepath); - $stageidentifier = $data->feedbackstage; + $stageidentifier = $data->feedbackstage; - $fileimporter = new mod_coursework\coursework_file_zip_importer(); + $fileimporter = new mod_coursework\coursework_file_zip_importer(); $fileimporter->extract_zip_file($filepath,$coursework->get_context_id()); - $updateresults = $fileimporter->import_zip_files($coursework,$stageidentifier,$data->overwrite); + $updateresults = $fileimporter->import_zip_files($coursework,$stageidentifier,$data->overwrite); $page_renderer = $PAGE->get_renderer('mod_coursework', 'page'); echo $page_renderer->process_feedback_upload($updateresults); diff --git a/actions/upload_grading_sheet.php b/actions/upload_grading_sheet.php index ce83a6d4..7df208f6 100644 --- a/actions/upload_grading_sheet.php +++ b/actions/upload_grading_sheet.php @@ -67,7 +67,7 @@ -$gradinguploadform = new upload_grading_sheet_form($coursemoduleid); +$gradinguploadform = new upload_grading_sheet_form($coursemoduleid); if ($gradinguploadform->is_cancelled()) { redirect("$CFG->wwwroot/mod/coursework/view.php?id=$coursemoduleid"); @@ -75,19 +75,19 @@ -if ($data = $gradinguploadform->get_data()) { +if ($data = $gradinguploadform->get_data()) { //perform checks on data $content = $gradinguploadform->get_file_content('gradingdata'); - $csv_cells = \mod_coursework\export\grading_sheet::cells_array($coursework); + $csv_cells = \mod_coursework\export\grading_sheet::cells_array($coursework); - $csvimport = new \mod_coursework\export\import($coursework,false,false); + $csvimport = new \mod_coursework\export\import($coursework,false,false); // $csv_cells = $csvimport->csv_columns(); //all columns from spreadsheet - $procsessingresults = $csvimport->validate_csv($content, $data->encoding, $data->delimiter_name, $csv_cells); + $procsessingresults = $csvimport->validate_csv($content, $data->encoding, $data->delimiter_name, $csv_cells); //process diff --git a/backup/moodle2/backup_coursework_stepslib.php b/backup/moodle2/backup_coursework_stepslib.php index bcc30655..f4645977 100644 --- a/backup/moodle2/backup_coursework_stepslib.php +++ b/backup/moodle2/backup_coursework_stepslib.php @@ -113,9 +113,9 @@ protected function define_structure() )); - $sample_strategies =new backup_nested_element('coursework_sample_set_rules'); + $sample_strategies =new backup_nested_element('coursework_sample_set_rules'); - $sample_strategy = new backup_nested_element('coursework_sample_set_rule',array('id'), + $sample_strategy = new backup_nested_element('coursework_sample_set_rule',array('id'), array('courseworkid', 'sample_set_plugin_id', 'ruleorder', @@ -135,9 +135,9 @@ protected function define_structure() { - $plagiarism_flags = new backup_nested_element('coursework_plagiarism_flags'); + $plagiarism_flags = new backup_nested_element('coursework_plagiarism_flags'); - $plagiarism_flag = new backup_nested_element('coursework_plagiarism_flag', array('id'), + $plagiarism_flag = new backup_nested_element('coursework_plagiarism_flag', array('id'), array( "courseworkid", "submissiond", @@ -152,9 +152,9 @@ protected function define_structure() - $moderation_agreements = new backup_nested_element('coursework_mod_agreements'); + $moderation_agreements = new backup_nested_element('coursework_mod_agreements'); - $moderation_agreement = new backup_nested_element('coursework_mod_agreement', array('id'), + $moderation_agreement = new backup_nested_element('coursework_mod_agreement', array('id'), array( "feedbackid", "moderatorid", @@ -306,9 +306,9 @@ protected function define_structure() )); - $sample_members = new backup_nested_element('coursework_sample_set_mbrs'); + $sample_members = new backup_nested_element('coursework_sample_set_mbrs'); - $sample_member = new backup_nested_element('coursework_sample_set_mbr', array('id'), + $sample_member = new backup_nested_element('coursework_sample_set_mbr', array('id'), array( "courseworkid", "allocatableid", diff --git a/classes/ability.php b/classes/ability.php index 025eff9a..12f89ef9 100644 --- a/classes/ability.php +++ b/classes/ability.php @@ -454,7 +454,7 @@ protected function allow_show_submission_if_user_is_agreed_grade_assessor_and_su $this->allow('show', 'mod_coursework\models\submission', function (submission $submission) { - $state = $submission->get_state(); + $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)); @@ -583,7 +583,7 @@ function (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(); + $coursework_has_no_deadline = !$submission->get_coursework()->has_deadline(); $allowed_to = $this->can('new', $submission) || $this->can('edit', $submission); @@ -858,11 +858,11 @@ protected function allow_new_feedback_from_any_assessor_when_allocation_is_disab 'mod_coursework\models\feedback', function (feedback $feedback) { - $has_editable_feedbacks = false; + $has_editable_feedbacks = false; // find out if the previous grades are editable if ($feedback->is_agreed_grade()) { - $has_editable_feedbacks = $feedback->get_submission()->editable_feedbacks_exist(); + $has_editable_feedbacks = $feedback->get_submission()->editable_feedbacks_exist(); } if ((!$feedback->get_coursework()->allocation_enabled() || !$feedback->get_stage()->uses_allocation()) && !$has_editable_feedbacks ) { @@ -920,9 +920,9 @@ function (feedback $feedback) { $is_creator = $feedback->assessorid == $this->get_user()->id; $is_allocated = $feedback->is_assessor_allocated(); - $submission = $feedback->get_submission(); + $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()); + $in_editable_period = (!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); }); @@ -1182,12 +1182,12 @@ 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; + $has_editable_feedbacks = false; // find out if the previous grades are editable if ($feedback->is_agreed_grade()) { - $has_editable_feedbacks = $feedback->get_submission()->editable_feedbacks_exist(); + $has_editable_feedbacks = $feedback->get_submission()->editable_feedbacks_exist(); } diff --git a/classes/allocation/manager.php b/classes/allocation/manager.php index 8c485eaf..201337d9 100644 --- a/classes/allocation/manager.php +++ b/classes/allocation/manager.php @@ -255,8 +255,8 @@ public function save_sample_set_rule($assessor_number) { global $CFG, $DB; - $sampleplugins = $DB->get_records('coursework_sample_set_plugin',null,'pluginorder'); - $order = 0; + $sampleplugins = $DB->get_records('coursework_sample_set_plugin',null,'pluginorder'); + $order = 0; foreach ($sampleplugins as $plugin) { $classname = '\mod_coursework\sample_set_rule\\' . $plugin->rulename; @@ -275,7 +275,7 @@ public function save_sample() { $DB->delete_records('coursework_sample_set_rules',array('courseworkid'=>$this->coursework->id)); for ($i = 2; $i <= $this->coursework->get_max_markers(); $i++) { - $sample_strategy = required_param("assessor_{$i}_samplingstrategy",PARAM_INT); + $sample_strategy = required_param("assessor_{$i}_samplingstrategy",PARAM_INT); if ($sample_strategy) { $this->save_sample_set_rule($i); @@ -297,15 +297,15 @@ private function get_coursework() { public function auto_generate_sample_set() { global $DB; - $sampleplugins = $DB->get_records('coursework_sample_set_plugin',null,'pluginorder'); - $order = 0; + $sampleplugins = $DB->get_records('coursework_sample_set_plugin',null,'pluginorder'); + $order = 0; - $sample_set = array(); + $sample_set = array(); $allocatables = $this->get_coursework()->get_allocatables(); - $final_agreed_allocatables = $this->get_allocatables_with_final_agreed(); + $final_agreed_allocatables = $this->get_allocatables_with_final_agreed(); //remove any allocatables that have a status of final agreed as these can not be sampled foreach($final_agreed_allocatables as $faa) { @@ -315,27 +315,27 @@ public function auto_generate_sample_set() { for($stage_number = 2; $stage_number <= $this->get_coursework()->get_max_markers(); $stage_number++) { - $stage = "assessor_{$stage_number}"; + $stage = "assessor_{$stage_number}"; $this->remove_unmarked_automatic_allocatables($stage); - $sql = "SELECT DISTINCT rulename + $sql = "SELECT DISTINCT rulename FROM (SELECT rulename,ruleorder FROM {coursework_sample_set_plugin} p, {coursework_sample_set_rules} r - WHERE p.id = r.sample_set_plugin_id + WHERE p.id = r.sample_set_plugin_id AND r.courseworkid = :courseworkid AND stage_identifier = :stage ORDER BY ruleorder)a"; - if ($sampleplugins = $DB->get_records_sql($sql,array('courseworkid'=>$this->coursework->id,'stage'=>$stage))) { + if ($sampleplugins = $DB->get_records_sql($sql,array('courseworkid'=>$this->coursework->id,'stage'=>$stage))) { //$allocatables = $this->get_coursework()->get_allocatables_with_feedback(); $allocatables = $this->get_coursework()->get_allocatables(); $manual_sample_set = $this->get_include_in_sample_set($stage_number); - $auto_with_feedback = $this->get_automatic_with_feedback($stage); + $auto_with_feedback = $this->get_automatic_with_feedback($stage); @@ -345,11 +345,11 @@ public function auto_generate_sample_set() { //in both arrays foreach($auto_with_feedback as $k => $v) { - if (!isset($manual_sample_set[$k])) $manual_sample_set[$k] = $v; + if (!isset($manual_sample_set[$k])) $manual_sample_set[$k] = $v; } - $auto_sample_set = array(); + $auto_sample_set = array(); foreach ($sampleplugins as $plugin) { $classname = '\mod_coursework\sample_set_rule\\' . $plugin->rulename; @@ -363,12 +363,12 @@ public function auto_generate_sample_set() { //save sample set if (!empty($auto_sample_set)) { foreach($auto_sample_set as $allocatable) { - $sample = new \stdClass(); - $sample->courseworkid = $this->coursework->id; - $sample->allocatableid = $allocatable->id; - $sample->allocatabletype = ($this->coursework->is_configured_to_have_group_submissions()) ? "group" : "user"; - $sample->stage_identifier = "assessor_{$stage_number}"; - $sample->selectiontype = "automatic"; + $sample = new \stdClass(); + $sample->courseworkid = $this->coursework->id; + $sample->allocatableid = $allocatable->id; + $sample->allocatabletype = ($this->coursework->is_configured_to_have_group_submissions()) ? "group" : "user"; + $sample->stage_identifier = "assessor_{$stage_number}"; + $sample->selectiontype = "automatic"; //if this a manually selected allocatable check to see if the allocatable is already in the table $DB->insert_record("coursework_sample_set_mbrs", $sample); @@ -383,16 +383,16 @@ public function get_include_in_sample_set($stage_number) { global $DB; - $stage = "assessor_{$stage_number}"; + $stage = "assessor_{$stage_number}"; - $sql = "SELECT allocatableid, + $sql = "SELECT allocatableid, courseworkid, allocatabletype, stage_identifier, selectiontype FROM {coursework_sample_set_mbrs} - WHERE courseworkid = :courseworkid - AND stage_identifier = :stage_identifier + WHERE courseworkid = :courseworkid + AND stage_identifier = :stage_identifier AND selectiontype = 'manual'"; @@ -406,16 +406,16 @@ public function get_automatic_with_feedback($stage) { global $DB; - $sql = "SELECT s.allocatableid, f.* + $sql = "SELECT s.allocatableid, f.* FROM {coursework_submissions} s, {coursework_feedbacks} f, {coursework_sample_set_mbrs} m - WHERE s.id = f.submissionid + WHERE s.id = f.submissionid AND s.courseworkid = :courseworkid AND f.stage_identifier = :stage AND s.courseworkid = m.courseworkid - AND s.allocatableid = m.allocatableid - AND s.allocatabletype = m.allocatabletype + AND s.allocatableid = m.allocatableid + AND s.allocatabletype = m.allocatabletype AND f.stage_identifier = m.stage_identifier "; @@ -426,16 +426,16 @@ public function get_automatic_with_feedback($stage) { public function remove_unmarked_automatic_allocatables($stage) { global $DB; - $sql = "DELETE + $sql = "DELETE FROM {coursework_sample_set_mbrs} WHERE selectiontype = 'automatic' AND stage_identifier = '{$stage}' - AND courseworkid = {$this->coursework->id} + AND courseworkid = {$this->coursework->id} AND allocatableid NOT IN ( SELECT s.allocatableid FROM {coursework_submissions} s, {coursework_feedbacks} f - WHERE s.id = f.submissionid + WHERE s.id = f.submissionid AND s.courseworkid = {$this->coursework->id} AND f.stage_identifier = '{$stage}' diff --git a/classes/allocation/table/builder.php b/classes/allocation/table/builder.php index 689f3bf9..0f08c7ce 100644 --- a/classes/allocation/table/builder.php +++ b/classes/allocation/table/builder.php @@ -134,7 +134,7 @@ public function get_table_rows_for_page() { $start = ($this->options['page']) * $this->options['perpage']; // Will start at 0. $end = ($this->options['page'] + 1) * $this->options['perpage']; // Take care of overlap: 0-10, 10-20, 20-30. - $end = (empty($end)) ? count($rows) : $end; + $end = (empty($end)) ? count($rows) : $end; $counter = 0; // Begin from the first one that the user could see. foreach ($rows as $allocatable_id => $row) { @@ -145,8 +145,8 @@ public function get_table_rows_for_page() { } } - $this->totalrows = $rows; - $this->totalcount = $counter; + $this->totalrows = $rows; + $this->totalcount = $counter; return $this->totalrows; @@ -196,13 +196,13 @@ public function get_allocatable_cell() { public function get_hidden_elements() { global $SESSION; - $elements = ''; + $elements = ''; - $cm = $this->coursework->get_course_module(); + $cm = $this->coursework->get_course_module(); if (isset($SESSION->coursework_allocationsessions[$cm->id])) { - foreach($SESSION->coursework_allocationsessions[$cm->id] as $name => $val) { + foreach($SESSION->coursework_allocationsessions[$cm->id] as $name => $val) { if(!is_array($val)) { diff --git a/classes/allocation/table/cell/builder.php b/classes/allocation/table/cell/builder.php index a2fa8623..5125987e 100644 --- a/classes/allocation/table/cell/builder.php +++ b/classes/allocation/table/cell/builder.php @@ -304,7 +304,7 @@ private function sampling_set_checkbox() { $checkbox_checked = 1; } - $checkbox_checked = $this->checkbox_checked_in_session($checkbox_name,$checkbox_checked); + $checkbox_checked = $this->checkbox_checked_in_session($checkbox_name,$checkbox_checked); $checkbox_title = 'Included in sample'; @@ -352,7 +352,7 @@ private function has_automatic_sampling() { global $DB; - $params = array('courseworkid'=>$this->coursework->id(), + $params = array('courseworkid'=>$this->coursework->id(), 'allocatableid'=>$this->get_allocatable()->id(), 'stage_identifier'=>$this->get_stage()->identifier(), 'selectiontype' => 'automatic'); @@ -378,7 +378,7 @@ private function pinned_checkbox() { } } - $checkbox_checked = $this->checkbox_checked_in_session($checkbox_name,$checkbox_checked); + $checkbox_checked = $this->checkbox_checked_in_session($checkbox_name,$checkbox_checked); $stage = substr($this->get_stage()->identifier(), -1); $checkbox_title = 'Pinned (auto allocations will not alter this)'; @@ -396,7 +396,7 @@ private function checkbox_checked_in_session($checkboxname,$checkboxstate) { global $SESSION; - $cm = $this->coursework->get_course_module(); + $cm = $this->coursework->get_course_module(); if (!empty($SESSION->coursework_allocationsessions[$cm->id])) { if (isset($SESSION->coursework_allocationsessions[$cm->id][$checkboxname])) { diff --git a/classes/allocation/table/cell/processor.php b/classes/allocation/table/cell/processor.php index 5450114b..f78e41ec 100644 --- a/classes/allocation/table/cell/processor.php +++ b/classes/allocation/table/cell/processor.php @@ -178,7 +178,7 @@ private function has_automatic_sampling() { global $DB; - $params = array('courseworkid'=>$this->coursework->id(), + $params = array('courseworkid'=>$this->coursework->id(), 'allocatableid'=>$this->get_allocatable()->id(), 'stage_identifier'=>$this->get_stage()->identifier(), 'selectiontype' => 'automatic'); diff --git a/classes/allocation/table/row/builder.php b/classes/allocation/table/row/builder.php index 2f1b2ae1..cc9e5969 100644 --- a/classes/allocation/table/row/builder.php +++ b/classes/allocation/table/row/builder.php @@ -119,7 +119,7 @@ public function get_student_firstname() { $allocatable = $this->get_allocatable(); if (empty($allocatable->firstname)) { - $this->allocatable = user::find($allocatable); + $this->allocatable = user::find($allocatable); } return $this->get_allocatable()->firstname; @@ -134,7 +134,7 @@ public function get_student_lastname() { $allocatable = $this->get_allocatable(); if (empty($allocatable->lastname)) { - $this->allocatable = user::find($allocatable); + $this->allocatable = user::find($allocatable); } return $this->get_allocatable()->lastname; @@ -148,7 +148,7 @@ public function get_idnumber() { $allocatable = $this->get_allocatable(); if (empty($allocatable->idnumber)) { - $this->allocatable = user::find($allocatable); + $this->allocatable = user::find($allocatable); } return $this->get_allocatable()->idnumber; @@ -164,7 +164,7 @@ public function get_email() { $allocatable = $this->get_allocatable(); if (empty($allocatable->email)) { - $this->allocatable = user::find($allocatable); + $this->allocatable = user::find($allocatable); } return $this->get_allocatable()->email; diff --git a/classes/allocation/upload.php b/classes/allocation/upload.php index 02257cf1..c98fc196 100644 --- a/classes/allocation/upload.php +++ b/classes/allocation/upload.php @@ -70,7 +70,7 @@ public function validate_csv($content,$encoding,$delimeter){ $csvreader->init(); - $errors = array(); + $errors = array(); $s = 0; // find out if this is a group or individual coursework $allocatabletype = $this->coursework->get_allocatable_type(); @@ -78,8 +78,8 @@ public function validate_csv($content,$encoding,$delimeter){ $allocatables = $this->coursework->get_allocatables(); $allocatables = ($allocatabletype == 'group')? array_keys($allocatables) : $allocatables; // find all assessors for this coursework - $assessors = get_enrolled_users($this->coursework->get_context(), 'mod/coursework:addinitialgrade'); - $assessors = array_keys($assessors); // keep only assessors' ids + $assessors = get_enrolled_users($this->coursework->get_context(), 'mod/coursework:addinitialgrade'); + $assessors = array_keys($assessors); // keep only assessors' ids $allocatablesinfile = array(); $csv_cells = array('allocatable'); @@ -103,11 +103,11 @@ public function validate_csv($content,$encoding,$delimeter){ if ($allocatabletype == 'user'){ // get user id - $suballocatable = $DB->get_record('user', array($assessor_identifier=>$value)); + $suballocatable = $DB->get_record('user', array($assessor_identifier=>$value)); $allocatable = ($suballocatable)? \mod_coursework\models\user::find($suballocatable->id): ''; } else { // get group id - $suballocatable = $DB->get_record('groups', array('courseid'=>$this->coursework->course, + $suballocatable = $DB->get_record('groups', array('courseid'=>$this->coursework->course, 'name'=>$value)); $allocatable = ($suballocatable)? \mod_coursework\models\group::find($suballocatable->id) : ''; } @@ -126,7 +126,7 @@ public function validate_csv($content,$encoding,$delimeter){ // skip empty assessors fields if(empty($value)){ continue;} - $assessor = $DB->get_record('user', array($assessor_identifier=>$value)); + $assessor = $DB->get_record('user', array($assessor_identifier=>$value)); if(!$assessor ||!in_array($assessor->id, $assessors)){$errors[$s] = get_string('assessornotincoursework', 'coursework', $keynum ); continue;} @@ -214,18 +214,18 @@ public function process_csv($content, $encoding, $delimiter, $processingresults) if ($cells[$keynum] == 'allocatable') { if ($allocatabletype == 'user'){ // get user id - $suballocatable = $DB->get_record('user', array($assessor_identifier=>$value)); + $suballocatable = $DB->get_record('user', array($assessor_identifier=>$value)); $allocatable = ($suballocatable)? \mod_coursework\models\user::find($suballocatable->id): ''; } else { // get group id - $suballocatable = $DB->get_record('groups', array('courseid'=>$this->coursework->course, + $suballocatable = $DB->get_record('groups', array('courseid'=>$this->coursework->course, 'name'=>$value)); $allocatable = ($suballocatable)? \mod_coursework\models\group::find($suballocatable->id): ''; } } if (substr($cells[$keynum],0,8) == 'assessor' && !(empty($value))){ - $assessor = $DB->get_record('user', array($assessor_identifier=>$value)); + $assessor = $DB->get_record('user', array($assessor_identifier=>$value)); $params = array('courseworkid' => $this->coursework->id, 'allocatableid' => $allocatable->id, @@ -273,14 +273,14 @@ public function process_csv($content, $encoding, $delimiter, $processingresults) public function add_allocation($assessorid, $stage_identifier, $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(); + $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(); $allocationid = $DB->insert_record('coursework_allocation_pairs', $add_allocation, true); @@ -299,10 +299,10 @@ 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; + $update_allocation = new \stdClass(); + $update_allocation->id = $allocationid; + $update_allocation->manual = 1; + $update_allocation->assessorid = $assessorid; $update = $DB->update_record('coursework_allocation_pairs', $update_allocation); return $update; diff --git a/classes/auto_grader/average_grade.php b/classes/auto_grader/average_grade.php index 66fb89ed..f02fcd5d 100644 --- a/classes/auto_grader/average_grade.php +++ b/classes/auto_grader/average_grade.php @@ -115,13 +115,13 @@ private function automatic_grade(){ // round it according to the chosen rule switch ($this->roundingrule) { case 'mid': - $avggrade = round($avggrade); + $avggrade = round($avggrade); break; case 'up': - $avggrade = ceil($avggrade); + $avggrade = ceil($avggrade); break; case 'down': - $avggrade = floor($avggrade); + $avggrade = floor($avggrade); break; } diff --git a/classes/controllers/deadline_extensions_controller.php b/classes/controllers/deadline_extensions_controller.php index da4aef13..7733e16e 100644 --- a/classes/controllers/deadline_extensions_controller.php +++ b/classes/controllers/deadline_extensions_controller.php @@ -169,7 +169,7 @@ 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); + $personal_deadline = $DB->get_record('coursework_person_deadlines', $params); if ($personal_deadline) { $this->coursework->deadline = $personal_deadline->personal_deadline; } @@ -260,7 +260,7 @@ public function personal_deadline(){ $extensionid = optional_param('id', 0, PARAM_INT); if ($extensionid != 0) { - $ext = $DB->get_record('coursework_extensions', array('id' => $extensionid)); + $ext = $DB->get_record('coursework_extensions', array('id' => $extensionid)); $allocatableid = $ext->allocatableid; $allocatabletype = $ext->allocatabletype; $courseworkid = $ext->courseworkid; @@ -268,7 +268,7 @@ public function personal_deadline(){ $allocatableid = required_param('allocatableid', PARAM_INT); $allocatabletype = required_param('allocatabletype', PARAM_ALPHANUMEXT); - $courseworkid = required_param('courseworkid', PARAM_INT); + $courseworkid = required_param('courseworkid', PARAM_INT); } $params = array( @@ -313,12 +313,12 @@ public function ajax_edit_mitigation($data_params) { $deadline_extension_transform = [ 'time_content' => $time_content, - 'time' => $time, + 'time' => $time, 'text' => $deadline_extension->extra_information_text, 'allocatableid' => $deadline_extension->allocatableid, 'allocatabletype' => $deadline_extension->allocatabletype, 'courseworkid' => $deadline_extension->courseworkid, - 'id' => $deadline_extension->id, + 'id' => $deadline_extension->id, 'pre_defined_reason' => $deadline_extension->pre_defined_reason, ]; $response = [ @@ -353,7 +353,7 @@ public function ajax_new_mitigation($data_params){ $time_content = ''; $time = ''; if ($this->coursework->deadline){ - $personal_deadline = $DB->get_record('coursework_person_deadlines', $params); + $personal_deadline = $DB->get_record('coursework_person_deadlines', $params); if ($personal_deadline) { $time_content = 'Personal deadline: ' . userdate($personal_deadline->personal_deadline); // $this->coursework->deadline = $personal_deadline->personal_deadline; @@ -366,7 +366,7 @@ public function ajax_new_mitigation($data_params){ $deadline_extension_transform = [ 'time_content' => $time_content, - 'time' => $time, + 'time' => $time, ]; $response = [ diff --git a/classes/controllers/feedback_controller.php b/classes/controllers/feedback_controller.php index cbae9c96..14965a1b 100644 --- a/classes/controllers/feedback_controller.php +++ b/classes/controllers/feedback_controller.php @@ -71,7 +71,7 @@ protected function show_feedback() { $urlparams = array('feedbackid' => $this->params['feedbackid']); $PAGE->set_url('/mod/coursework/actions/feedbacks/show.php', $urlparams); - $ajax = (isset($this->params['ajax'])) ? $this->params['ajax'] : 0; + $ajax = (isset($this->params['ajax'])) ? $this->params['ajax'] : 0; $teacherfeedback = new feedback($this->params['feedbackid']); @@ -237,7 +237,7 @@ protected function create_feedback() { //we will do this in the cron //only implement auto feedback (automatic agreement) if the settings is set to disabled otherwise //we will do this in the cron - $gradeeditingtime = $teacherfeedback->get_coursework()->get_grade_editing_time(); + $gradeeditingtime = $teacherfeedback->get_coursework()->get_grade_editing_time(); if (empty($gradeeditingtime) || time() > $teacherfeedback->timecreated + $gradeeditingtime) { $this->try_auto_feedback_creation($teacherfeedback->get_submission()); @@ -252,9 +252,9 @@ protected function create_feedback() { $participant = $submission->get_allocatable(); $cell_class = $this->params['cell_type']; $stage = new assessor($coursework, $teacherfeedback->stage_identifier); - $provisional = new grade_for_gradebook_cell(array('coursework'=>$coursework)); + $provisional = new grade_for_gradebook_cell(array('coursework'=>$coursework)); - $jsonarray = array('success' => true); + $jsonarray = array('success' => true); if (strpos($cell_class, 'multi_marker_feedback_sub_rows') !== false) { $feedback_row = new assessor_feedback_row($stage, $participant, $this->coursework); @@ -263,22 +263,22 @@ protected function create_feedback() { if ($teacherfeedback->stage_identifier == 'assessor_1' || $teacherfeedback->stage_identifier == 'assessor_2') { - $jsonarray['assessorname'] = (empty($feedback_row->get_assessor()->id()) && $coursework->allocation_enabled()) ? + $jsonarray['assessorname'] = (empty($feedback_row->get_assessor()->id()) && $coursework->allocation_enabled()) ? get_string('assessornotallocated','mod_coursework') : $cell_object->profile_link($feedback_row); - $jsonarray['assessdate'] = $cell_object->date_for_column($feedback_row); + $jsonarray['assessdate'] = $cell_object->date_for_column($feedback_row); if ($teacherfeedback->stage_identifier == 'assessor_1') { $ability = new ability(user::find($USER, false), $coursework); $stage = new assessor($coursework, 'assessor_2'); - $assessor_feedback_row = new assessor_feedback_row($stage, $feedback_row->get_allocatable(), $coursework); + $assessor_feedback_row = new assessor_feedback_row($stage, $feedback_row->get_allocatable(), $coursework); - $assessortwocell = $cell_object->get_grade_cell_content($assessor_feedback_row,$coursework,$ability); - //$jsonarray['assessortwo'] =$assessortwocell; - if (strpos($assessortwocell, 'new_feedback') !== false) $jsonarray['assessortwo'] = $assessortwocell; + $assessortwocell = $cell_object->get_grade_cell_content($assessor_feedback_row,$coursework,$ability); + //$jsonarray['assessortwo'] =$assessortwocell; + if (strpos($assessortwocell, 'new_feedback') !== false) $jsonarray['assessortwo'] = $assessortwocell; } - $finalfeedback = $feedback_row->get_submission()->get_final_feedback(); + $finalfeedback = $feedback_row->get_submission()->get_final_feedback(); $finalsubmission = $feedback_row->get_submission(); @@ -287,12 +287,12 @@ protected function create_feedback() { $finalfeedback_row = new assessor_feedback_row($finalstage, $participant, $coursework); $agreed_grade_object = new multiple_agreed_grade_cell(array('coursework'=>$coursework,'stage'=>$finalstage)); $jsonarray['finalhtml'] = $agreed_grade_object->get_table_cell($finalfeedback_row); - $jsonarray['allocatableid'] = $submission->get_allocatable()->id(); + $jsonarray['allocatableid'] = $submission->get_allocatable()->id(); } } else { - $jsonarray['extrahtml'] = $provisional->get_table_cell($feedback_row); + $jsonarray['extrahtml'] = $provisional->get_table_cell($feedback_row); } @@ -302,7 +302,7 @@ protected function create_feedback() { $row_object = new $row_class($coursework, $participant); $cell_object = new $cell_class(['coursework' => $coursework, 'stage' => $stage]); $html = $cell_object->get_content($row_object); - $jsonarray['extrahtml'] = $provisional->get_table_cell($row_object); + $jsonarray['extrahtml'] = $provisional->get_table_cell($row_object); @@ -310,7 +310,7 @@ protected function create_feedback() { } - $jsonarray['html'] = $html; + $jsonarray['html'] = $html; echo json_encode($jsonarray); } else { @@ -347,7 +347,7 @@ protected function update_feedback() { if($this->params['remove']){ if (!$this->params['confirm']) { - $urlparams = array('confirm'=>$this->params['confirm'], + $urlparams = array('confirm'=>$this->params['confirm'], 'remove'=>$this->params['remove'],'feedbackid'=>$this->params['feedbackid'],'finalised'=>$this->params['finalised']); $PAGE->set_url('/mod/coursework/actions/feedbacks/edit.php', $urlparams); @@ -399,7 +399,7 @@ protected function update_feedback() { $cell_object = new $cell_class(['coursework' => $coursework, 'stage' => $stage]); $html = $cell_object->get_content($row_object); - $finalfeedback = $row_object->get_submission()->get_final_feedback(); + $finalfeedback = $row_object->get_submission()->get_final_feedback(); } @@ -448,8 +448,8 @@ protected function update_feedback() { $participant = $submission->get_allocatable(); $cell_class = $this->params['cell_type']; $stage = new assessor($coursework, $teacherfeedback->stage_identifier); - $provisional = new grade_for_gradebook_cell(array('coursework'=>$coursework)); - $jsonarray = array('success' => true); + $provisional = new grade_for_gradebook_cell(array('coursework'=>$coursework)); + $jsonarray = array('success' => true); if (strpos($cell_class, 'multi_marker_feedback_sub_rows') !== false) { $feedback_row = new assessor_feedback_row($stage, $participant, $coursework); @@ -457,22 +457,22 @@ protected function update_feedback() { $html = $cell_object->get_grade_cell_content($feedback_row, $coursework); if ($teacherfeedback->stage_identifier == 'assessor_1' || $teacherfeedback->stage_identifier == 'assessor_2') { - $jsonarray['assessorname'] = (empty($feedback_row->get_assessor()->id()) && $coursework->allocation_enabled()) ? + $jsonarray['assessorname'] = (empty($feedback_row->get_assessor()->id()) && $coursework->allocation_enabled()) ? get_string('assessornotallocated','mod_coursework') : $cell_object->profile_link($feedback_row); - $jsonarray['assessdate'] = $cell_object->date_for_column($feedback_row); + $jsonarray['assessdate'] = $cell_object->date_for_column($feedback_row); if ($teacherfeedback->stage_identifier == 'assessor_1') { $ability = new ability(user::find($USER, false), $coursework); $stage = new assessor($coursework, 'assessor_2'); - $assessor_feedback_row = new assessor_feedback_row($stage, $feedback_row->get_allocatable(), $coursework); + $assessor_feedback_row = new assessor_feedback_row($stage, $feedback_row->get_allocatable(), $coursework); - $assessortwocell = $cell_object->get_grade_cell_content($assessor_feedback_row,$coursework,$ability); - //$jsonarray['assessortwo'] =$assessortwocell; - if (strpos($assessortwocell, 'new_feedback') !== false) $jsonarray['assessortwo'] = $assessortwocell; + $assessortwocell = $cell_object->get_grade_cell_content($assessor_feedback_row,$coursework,$ability); + //$jsonarray['assessortwo'] =$assessortwocell; + if (strpos($assessortwocell, 'new_feedback') !== false) $jsonarray['assessortwo'] = $assessortwocell; } - $finalfeedback = $submission->get_final_feedback(); + $finalfeedback = $submission->get_final_feedback(); if ($coursework->automaticagreementrange != 'none' && !empty($finalfeedback)) { $finalstage = new assessor($coursework, "final_agreed_1"); @@ -481,11 +481,11 @@ protected function update_feedback() { $agreed_grade_cell = new multiple_agreed_grade_cell(['coursework' => $coursework, 'stage' => $finalstage]); $jsonarray['finalhtml'] = $agreed_grade_cell->get_content($finalfeedbackrow_object); - $jsonarray['allocatableid'] = $submission->get_allocatable()->id(); + $jsonarray['allocatableid'] = $submission->get_allocatable()->id(); } } else { - $jsonarray['extrahtml'] = strip_tags($provisional->get_table_cell($feedback_row)); + $jsonarray['extrahtml'] = strip_tags($provisional->get_table_cell($feedback_row)); } } else { @@ -494,10 +494,10 @@ protected function update_feedback() { $row_object = new $row_class($coursework, $participant); $cell_object = new $cell_class(['coursework' => $coursework, 'stage' => $stage]); $html = $cell_object->get_content($row_object); - $jsonarray['extrahtml'] = strip_tags($provisional->get_table_cell($row_object)); + $jsonarray['extrahtml'] = strip_tags($provisional->get_table_cell($row_object)); } - $jsonarray['html'] = $html; + $jsonarray['html'] = $html; echo json_encode($jsonarray); } else { diff --git a/classes/controllers/personal_deadlines_controller.php b/classes/controllers/personal_deadlines_controller.php index da85bd38..f87a1bbd 100644 --- a/classes/controllers/personal_deadlines_controller.php +++ b/classes/controllers/personal_deadlines_controller.php @@ -57,7 +57,7 @@ protected function new_personal_deadline() { $ability = new ability(user::find($USER), $this->coursework); $ability->require_can('edit', $this->personal_deadline); - $params['allocatableid'] = (!is_array($params['allocatableid'])) ? $params['allocatableid'] + $params['allocatableid'] = (!is_array($params['allocatableid'])) ? $params['allocatableid'] : serialize($params['allocatableid']) ; $PAGE->set_url('/mod/coursework/actions/personal_deadline/new.php', $params); @@ -65,10 +65,10 @@ protected function new_personal_deadline() { $this->form = new personal_deadline_form($create_url, array('coursework' => $this->coursework)); - $this->personal_deadline->setpersonaldeadlinespage = $this->params['setpersonaldeadlinespage']; - $this->personal_deadline->multipleuserdeadlines = $this->params['multipleuserdeadlines']; + $this->personal_deadline->setpersonaldeadlinespage = $this->params['setpersonaldeadlinespage']; + $this->personal_deadline->multipleuserdeadlines = $this->params['multipleuserdeadlines']; - $this->personal_deadline->allocatableid = $params['allocatableid']; + $this->personal_deadline->allocatableid = $params['allocatableid']; $this->form->set_data($this->personal_deadline); @@ -96,12 +96,12 @@ protected function new_personal_deadline() { } else { - $allocatables = unserialize($data->allocatableid); + $allocatables = unserialize($data->allocatableid); foreach($allocatables as $allocatableid) { - $data->allocatableid = $allocatableid; - $data->id = ''; - //$data->id = ''; + $data->allocatableid = $allocatableid; + $data->id = ''; + //$data->id = ''; $findparams = array( 'allocatableid' => $allocatableid, 'allocatabletype' => $data->allocatabletype, @@ -118,7 +118,7 @@ protected function new_personal_deadline() { } else { // update - $data->id = $this->personal_deadline->id; + $data->id = $this->personal_deadline->id; $data->lastmodifiedbyid = $USER->id; $data->timemodified = time(); $this->personal_deadline->update_attributes($data); @@ -150,11 +150,11 @@ protected function set_default_current_deadline() { //if the allocatableid is an array then the current page will probably be setting multiple the personal deadlines //we use the first element in the array to setup the personal deadline object - $params['allocatableid'] = (is_array($this->params['allocatableid'])) ? current($this->params['allocatableid']) : $this->params['allocatableid'] ; + $params['allocatableid'] = (is_array($this->params['allocatableid'])) ? current($this->params['allocatableid']) : $this->params['allocatableid'] ; $this->personal_deadline = personal_deadline::find_or_build($params); - $params['allocatableid'] = $this->params['allocatableid']; + $params['allocatableid'] = $this->params['allocatableid']; //if the allocatableid is an array then the current page will probably be setting multiple the personal deadlines // of multiple allocatable ids in which case set the personal deadline to the coursework default @@ -203,7 +203,7 @@ public function insert_update($time){ $ability = new ability(user::find($USER), $this->coursework); $ability->require_can('edit', $this->personal_deadline); - $params['allocatableid'] = (!is_array($params['allocatableid'])) ? $params['allocatableid'] + $params['allocatableid'] = (!is_array($params['allocatableid'])) ? $params['allocatableid'] : serialize($params['allocatableid']) ; $data = (object) $this->params; @@ -222,12 +222,12 @@ public function insert_update($time){ $this->personal_deadline->update_attributes($data); } } else { - $allocatables = unserialize($data->allocatableid); + $allocatables = unserialize($data->allocatableid); foreach ($allocatables as $allocatableid) { - $data->allocatableid = $allocatableid; - $data->id = ''; - //$data->id = ''; + $data->allocatableid = $allocatableid; + $data->id = ''; + //$data->id = ''; $findparams = array( 'allocatableid' => $allocatableid, 'allocatabletype' => $data->allocatabletype, @@ -242,7 +242,7 @@ public function insert_update($time){ $this->personal_deadline->save(); } else { // update - $data->id = $this->personal_deadline->id; + $data->id = $this->personal_deadline->id; $data->lastmodifiedbyid = $USER->id; $data->timemodified = time(); $this->personal_deadline->update_attributes($data); diff --git a/classes/controllers/plagiarism_flagging_controller.php b/classes/controllers/plagiarism_flagging_controller.php index 33326754..782e2636 100644 --- a/classes/controllers/plagiarism_flagging_controller.php +++ b/classes/controllers/plagiarism_flagging_controller.php @@ -66,7 +66,7 @@ protected function new_plagiarism_flag() { $plagiarismflag = new plagiarism_flag(); $plagiarismflag->submissionid = $this->params['submissionid']; - $plagiarismflag->courseworkid = $this->coursework->id; + $plagiarismflag->courseworkid = $this->coursework->id; $ability = new ability(user::find($USER), $this->coursework); @@ -120,7 +120,7 @@ protected function create_plagiarism_flag() { global $USER, $PAGE; $plagiarismflag = new plagiarism_flag(); - $plagiarismflag->courseworkid = $this->coursework->id(); + $plagiarismflag->courseworkid = $this->coursework->id(); $plagiarismflag->submissionid = $this->params['submissionid']; $plagiarismflag->createdby = $USER->id; @@ -177,7 +177,7 @@ protected function update_plagiarism_flag() { $plagiarismflag = $form->process_data($plagiarismflag); // add to log here - $oldstatus = $DB->get_field(plagiarism_flag::get_table_name(), 'status', array('id' => $flagid)); //retrieve old status before saving new + $oldstatus = $DB->get_field(plagiarism_flag::get_table_name(), 'status', array('id' => $flagid)); //retrieve old status before saving new $params = array( 'context' => \context_module::instance($this->coursework->get_course_module()->id), 'courseid' => $this->coursework->get_course()->id, diff --git a/classes/controllers/submissions_controller.php b/classes/controllers/submissions_controller.php index 4a8c79f0..aca3ef59 100644 --- a/classes/controllers/submissions_controller.php +++ b/classes/controllers/submissions_controller.php @@ -81,7 +81,7 @@ protected function new_submission() { 'submission' => $submission )); if ($submit_form->is_submitted()) { - $validation = $submit_form->validate_defined_fields(); + $validation = $submit_form->validate_defined_fields(); } if ($validation != true) { $this->get_page_renderer()->new_submission_page($submit_form, $submission); @@ -114,7 +114,7 @@ protected function create_submission() { $submission->createdby = $USER->id; $submission->lastupdatedby = $USER->id; $submission->allocatabletype = $this->params['allocatabletype']; - $submission->authorid = $submission->get_author_id(); //create new function to get the author id depending on whether the current user is submitting on behalf + $submission->authorid = $submission->get_author_id(); //create new function to get the author id depending on whether the current user is submitting on behalf $submission->timesubmitted = time(); @@ -172,11 +172,11 @@ protected function create_submission() { if ($submission->finalised) { if (!$submission->get_coursework()->has_deadline()) { - $userids = explode(',',$submission->get_coursework()->get_submission_notification_users()); + $userids = explode(',',$submission->get_coursework()->get_submission_notification_users()); if (!empty($userids)) { foreach($userids as $u) { - $notifyuser = $DB->get_record('user',array('id'=>trim($u))); + $notifyuser = $DB->get_record('user',array('id'=>trim($u))); if (!empty($notifyuser)) $mailer->send_submission_notification($notifyuser); } @@ -220,7 +220,7 @@ protected function edit_submission() { 'submission' => $submission )); if ($submit_form->is_submitted()) { - $validation = $submit_form->validate_defined_fields(); + $validation = $submit_form->validate_defined_fields(); } $submit_form->set_data($submission); @@ -244,7 +244,7 @@ protected function update_submission() { redirect($coursework_page_url); } - $validated = $this->edit_submission(); + $validated = $this->edit_submission(); if ($validated == true){ return; @@ -336,13 +336,13 @@ protected function unfinalise_submission() { - $allocatableids = (!is_array($this->params['allocatableid'])) ? array($this->params['allocatableid']) : $this->params['allocatableid'] ; + $allocatableids = (!is_array($this->params['allocatableid'])) ? array($this->params['allocatableid']) : $this->params['allocatableid'] ; $personaldeadline_page_url = new \moodle_url('/mod/coursework/actions/personal_deadline.php', array('id'=>$this->coursework->get_coursemodule_id(),'multipleuserdeadlines'=>1,'setpersonaldeadlinespage'=>1, 'courseworkid'=>$this->params['courseworkid'],'allocatabletype'=>$this->params['allocatabletype'])); - $changedeadlines = false; + $changedeadlines = false; foreach($allocatableids as $aid) { @@ -355,7 +355,7 @@ protected function unfinalise_submission() { $submission->finalised = 0; $submission->save(); $personaldeadline_page_url->param("allocatableid_arr[$aid]",$aid); - $changedeadlines = true; + $changedeadlines = true; } } diff --git a/classes/cron.php b/classes/cron.php index b5b8fa2b..127b4c5b 100644 --- a/classes/cron.php +++ b/classes/cron.php @@ -332,7 +332,7 @@ private static function send_email_reminders_to_students(array $users, array &$c $usercounter[$user->id]++; } - $extension = isset($user->extension)? $user->extension : 0; + $extension = isset($user->extension)? $user->extension : 0; $email_reminder = new stdClass(); $email_reminder->userid = $user->id; $email_reminder->coursework_id = $user->coursework_id; diff --git a/classes/export/csv.php b/classes/export/csv.php index 48088197..04bf22dd 100644 --- a/classes/export/csv.php +++ b/classes/export/csv.php @@ -88,7 +88,7 @@ public function export(){ // loop through each submission in the coursework foreach ($submissions as $submission){ // add data to cvs - $data = $this->add_csv_data($submission); + $data = $this->add_csv_data($submission); $csv_data = array_merge($csv_data, $data); } @@ -117,21 +117,21 @@ public function add_cells_to_array($submission,$student,$csv_cells){ if(substr($csv_cell,0,8) == 'assessor'){ $cell = $cell->get_cell($submission, $student, $stage_dentifier); if(is_array($cell)){ - $row = array_merge($row,$cell); + $row = array_merge($row,$cell); } else { $row[] = $cell; } } else if ($csv_cell != 'stages' && $csv_cell != 'moderationagreement' && $csv_cell != 'otherassessors'){ $cell = $cell->get_cell($submission, $student, false); if(is_array($cell)){ - $row = array_merge($row,$cell); + $row = array_merge($row,$cell); } else{ $row[] = $cell; } } else { $stages = $cell->get_cell($submission, $student, false); - $row = array_merge($row,$stages); + $row = array_merge($row,$stages); } } @@ -153,23 +153,23 @@ public function add_headers($csv_headers){ $class = "mod_coursework\\export\\csv\\cells\\".$header."_cell"; $cell = new $class($this->coursework); if(substr($header,0,8) == 'assessor'){ - $head = $cell->get_header($stage); + $head = $cell->get_header($stage); if(is_array($head)){ - $headers = array_merge($headers,$head); + $headers = array_merge($headers,$head); } else{ $headers[$header.$stage] = $head; } } else if ($header != 'stages' && $header != 'moderationagreement' && $header != 'otherassessors' ) { - $head = $cell->get_header(false); + $head = $cell->get_header(false); if(is_array($head)){ - $headers = array_merge($headers,$head); + $headers = array_merge($headers,$head); } else{ $headers[$header] = $head; } } else { $array_headers = $cell->get_header(false); - $headers = array_merge($headers,$array_headers); + $headers = array_merge($headers,$array_headers); } } @@ -254,10 +254,10 @@ public function other_assessors_cells(){ if ($this->coursework->is_using_rubric()) { $criterias = $this->coursework->get_rubric_criteria(); //we will increment by the number of criterias plus 1 for feedback - $increment = (count($criterias) * 2) +1; + $increment = (count($criterias) * 2) +1; } else { - $increment = 2; + $increment = 2; } diff --git a/classes/export/csv/cells/agreedfeedback_cell.php b/classes/export/csv/cells/agreedfeedback_cell.php index ee4812ab..00b073fc 100644 --- a/classes/export/csv/cells/agreedfeedback_cell.php +++ b/classes/export/csv/cells/agreedfeedback_cell.php @@ -60,13 +60,13 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade global $DB,$PAGE,$USER; $stage_identifier = 'final_agreed_1'; - $agreedgradecap = array('mod/coursework:addagreedgrade','mod/coursework:editagreedgrade', + $agreedgradecap = array('mod/coursework:addagreedgrade','mod/coursework:editagreedgrade', 'mod/coursework:addallocatedagreedgrade','mod/coursework:editallocatedagreedgrade'); if (has_any_capability($agreedgradecap,$PAGE->context) || has_capability('mod/coursework:administergrades', $PAGE->context)) { - $subdbrecord = $DB->get_record('coursework_submissions',array('id'=>$submissionid)); + $subdbrecord = $DB->get_record('coursework_submissions',array('id'=>$submissionid)); $submission = \mod_coursework\models\submission::find($subdbrecord); //is the submission in question ready to grade? diff --git a/classes/export/csv/cells/agreedgrade_cell.php b/classes/export/csv/cells/agreedgrade_cell.php index c8135961..e3929025 100644 --- a/classes/export/csv/cells/agreedgrade_cell.php +++ b/classes/export/csv/cells/agreedgrade_cell.php @@ -79,7 +79,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='', $upload global $DB,$PAGE,$USER; $stage_identifier = 'final_agreed_1'; - $agreedgradecap = array('mod/coursework:addagreedgrade','mod/coursework:editagreedgrade', + $agreedgradecap = array('mod/coursework:addagreedgrade','mod/coursework:editagreedgrade', 'mod/coursework:addallocatedagreedgrade','mod/coursework:editallocatedagreedgrade'); if (empty($value)) return true; @@ -87,7 +87,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='', $upload if (has_any_capability($agreedgradecap,$PAGE->context) || has_capability('mod/coursework:administergrades', $PAGE->context)) { - $errormsg = ''; + $errormsg = ''; if (!$this->coursework->is_using_rubric() || ($this->coursework->is_using_rubric() && $this->coursework->finalstagegrading == 1)) { $gradejudge = new grade_judge($this->coursework); @@ -105,7 +105,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='', $upload //keys isnt. We will use array_filter whhich will return all values from the array if this is empty then we have //nothing to do - $arrayvalues = array_filter($value); + $arrayvalues = array_filter($value); //if there are no values we don't need to do anything if (!empty($arrayvalues)) { @@ -142,7 +142,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='', $upload } else { //set value to false so that a submission not ready to grade message isn't returned - $value = false; + $value = false; } @@ -150,7 +150,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='', $upload if (!empty($errormsg)) return $errormsg; - $subdbrecord = $DB->get_record('coursework_submissions',array('id'=>$submissionid)); + $subdbrecord = $DB->get_record('coursework_submissions',array('id'=>$submissionid)); $submission = \mod_coursework\models\submission::find($subdbrecord); @@ -215,9 +215,9 @@ function value_in_rubric($criteria, $value) { global $DB; - $valuefound = false; + $valuefound = false; - $levels = $criteria['levels']; + $levels = $criteria['levels']; if (is_numeric($value) ) { foreach ($levels as $level) { @@ -247,28 +247,28 @@ function get_rubrics($coursework,$csv_cells) { if ($coursework->is_using_rubric() && $this->coursework->finalstagegrading != 1) { - $rubricheaders = array(); + $rubricheaders = array(); $criterias = $coursework->get_rubric_criteria(); foreach ($criterias as $criteria) { - $rubricheaders[] = $criteria['description']; - $rubricheaders[] = $criteria['description']." comment"; + $rubricheaders[] = $criteria['description']; + $rubricheaders[] = $criteria['description']." comment"; } //find out the position of singlegrade $position = array_search('singlegrade',$csv_cells); //get all data from the position of the singlegrade to the length of rubricheaders - // $csv_cells = array_splice($csv_cells,5, 1, $rubricheaders); + // $csv_cells = array_splice($csv_cells,5, 1, $rubricheaders); - $start_cells = array_slice($csv_cells,0,$position,true); - $end_cells = array_slice($csv_cells,$position+1,count($csv_cells),true); + $start_cells = array_slice($csv_cells,0,$position,true); + $end_cells = array_slice($csv_cells,$position+1,count($csv_cells),true); - $cells = array_merge($start_cells,$rubricheaders); + $cells = array_merge($start_cells,$rubricheaders); - $cells = array_merge($cells,$end_cells); + $cells = array_merge($cells,$end_cells); diff --git a/classes/export/csv/cells/assessorfeedback_cell.php b/classes/export/csv/cells/assessorfeedback_cell.php index c92d5568..377c8fdc 100644 --- a/classes/export/csv/cells/assessorfeedback_cell.php +++ b/classes/export/csv/cells/assessorfeedback_cell.php @@ -79,10 +79,10 @@ public function get_header($stage){ public function validate_cell($value,$submissionid,$stage_identifier='',$uploadedgradecells = array()) { global $DB,$PAGE,$USER; - $agreedgradecap = array('mod/coursework:addagreedgrade','mod/coursework:editagreedgrade'); - $initialgradecap = array('mod/coursework:addinitialgrade','mod/coursework:editinitialgrade'); + $agreedgradecap = array('mod/coursework:addagreedgrade','mod/coursework:editagreedgrade'); + $initialgradecap = array('mod/coursework:addinitialgrade','mod/coursework:editinitialgrade'); - $subdbrecord = $DB->get_record('coursework_submissions',array('id'=>$submissionid)); + $subdbrecord = $DB->get_record('coursework_submissions',array('id'=>$submissionid)); $submission = \mod_coursework\models\submission::find($subdbrecord); if (has_any_capability($agreedgradecap,$PAGE->context) && has_any_capability($initialgradecap,$PAGE->context) || has_capability('mod/coursework:administergrades', $PAGE->context)) { @@ -128,7 +128,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade if ($this->coursework->allocation_enabled()) { //check that the user is allocated to the author of the submission - $allocation_params = array( + $allocation_params = array( 'courseworkid' => $this->coursework->id, 'allocatableid' => $submission->allocatableid, 'allocatabletype' => $submission->allocatabletype, @@ -150,7 +150,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade if ($this->coursework->sampling_enabled()){ // check how many sample assessors + add 1 that is always in sample $in_sample = $submission->get_submissions_in_sample(); - $assessors = ($in_sample)? sizeof($in_sample) + 1 : 1; + $assessors = ($in_sample)? sizeof($in_sample) + 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 14fe08fb..f33774e1 100644 --- a/classes/export/csv/cells/assessorgrade_cell.php +++ b/classes/export/csv/cells/assessorgrade_cell.php @@ -98,7 +98,7 @@ public function get_header($stage){ $strings['assessorgrade'.$stage.'_'.$criteria['id'] . 'comment'] = 'Comment for: Assessor '.$stage.' - '.$criteria['description']; } } else { - $strings = get_string('assessorgradecsv', 'coursework', $stage); + $strings = get_string('assessorgradecsv', 'coursework', $stage); } return $strings; @@ -121,7 +121,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='', $upload ) { - $errormsg = ''; + $errormsg = ''; if (!$this->coursework->is_using_rubric()) { $gradejudge = new grade_judge($this->coursework); @@ -138,7 +138,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='', $upload //keys isnt. We will use array_filter whhich will return all values from the array if this is empty then we have //nothing to do - $arrayvalues = array_filter($value); + $arrayvalues = array_filter($value); //if there are no values we don't need to do anything if (!empty($arrayvalues)) { @@ -275,9 +275,9 @@ function value_in_rubric($criteria, $value) { global $DB; - $valuefound = false; + $valuefound = false; - $levels = $criteria['levels']; + $levels = $criteria['levels']; if (is_numeric($value) ) { foreach ($levels as $level) { @@ -307,28 +307,28 @@ function get_rubrics($coursework,$csv_cells) { if ($coursework->is_using_rubric()) { - $rubricheaders = array(); + $rubricheaders = array(); $criterias = $coursework->get_rubric_criteria(); foreach ($criterias as $criteria) { - $rubricheaders[] = $criteria['description']; - $rubricheaders[] = $criteria['description']." comment"; + $rubricheaders[] = $criteria['description']; + $rubricheaders[] = $criteria['description']." comment"; } //find out the position of singlegrade $position = array_search('singlegrade',$csv_cells); //get all data from the position of the singlegrade to the length of rubricheaders - // $csv_cells = array_splice($csv_cells,5, 1, $rubricheaders); + // $csv_cells = array_splice($csv_cells,5, 1, $rubricheaders); - $start_cells = array_slice($csv_cells,0,$position,true); - $end_cells = array_slice($csv_cells,$position+1,count($csv_cells),true); + $start_cells = array_slice($csv_cells,0,$position,true); + $end_cells = array_slice($csv_cells,$position+1,count($csv_cells),true); - $cells = array_merge($start_cells,$rubricheaders); + $cells = array_merge($start_cells,$rubricheaders); - $cells = array_merge($cells,$end_cells); + $cells = array_merge($cells,$end_cells); diff --git a/classes/export/csv/cells/cell_base.php b/classes/export/csv/cells/cell_base.php index 9b91314e..4ae0ca55 100644 --- a/classes/export/csv/cells/cell_base.php +++ b/classes/export/csv/cells/cell_base.php @@ -65,7 +65,7 @@ public function __construct($coursework) { public function can_view_hidden() { $viewanonymous = has_capability('mod/coursework:viewanonymous',$this->coursework->get_context()); - $exportgrade = has_capability('mod/coursework:canexportfinalgrades',$this->coursework->get_context()); + $exportgrade = has_capability('mod/coursework:canexportfinalgrades',$this->coursework->get_context()); return (!$this->coursework->blindmarking || $viewanonymous || $exportgrade); } @@ -179,7 +179,7 @@ public function get_plagiarism_flag_comment_for_csv($submission){ */ public function get_actual_grade($grade){ - $judge = new grade_judge($this->coursework); + $judge = new grade_judge($this->coursework); return $judge->grade_to_display($grade); } @@ -220,9 +220,9 @@ public function get_assessor_username($assessorid) { protected function submission_time($submission){ if ($submission->is_late() && (!$submission->has_extension() || !$submission->submitted_within_extension())){ - $time = get_string('late', 'coursework'); + $time = get_string('late', 'coursework'); } else { - $time = get_string('ontime', 'mod_coursework'); + $time = get_string('ontime', 'mod_coursework'); } return $time; diff --git a/classes/export/csv/cells/feedbackcomments_cell.php b/classes/export/csv/cells/feedbackcomments_cell.php index 5293aa96..aadb2479 100644 --- a/classes/export/csv/cells/feedbackcomments_cell.php +++ b/classes/export/csv/cells/feedbackcomments_cell.php @@ -66,7 +66,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='',$uploa $dbrecord = $DB->get_record('coursework_submissions', array('id'=>$submissionid)); - $submission = \mod_coursework\models\submission::find($dbrecord); + $submission = \mod_coursework\models\submission::find($dbrecord); //is this submission ready to be graded if (!$submission->ready_to_grade()) return get_string('submissionnotreadytograde','coursework'); diff --git a/classes/export/csv/cells/otherassessors_cell.php b/classes/export/csv/cells/otherassessors_cell.php index 373d4d5c..56ef5f23 100644 --- a/classes/export/csv/cells/otherassessors_cell.php +++ b/classes/export/csv/cells/otherassessors_cell.php @@ -104,11 +104,11 @@ public function get_cell($submission, $student, $stage_identifier){ } - $numothereassessorfeedbacks = $submission->max_number_of_feedbacks() -1; + $numothereassessorfeedbacks = $submission->max_number_of_feedbacks() -1; if ($numothereassessorfeedbacks - count($feedbacks) != 0 ) { - $blankcolumns = $numothereassessorfeedbacks - count($feedbacks); + $blankcolumns = $numothereassessorfeedbacks - count($feedbacks); for($i = 0; $i < $blankcolumns; $i++) { if ($this->coursework->is_using_rubric()) { diff --git a/classes/export/csv/cells/singlegrade_cell.php b/classes/export/csv/cells/singlegrade_cell.php index 09d2688d..f2f87c45 100644 --- a/classes/export/csv/cells/singlegrade_cell.php +++ b/classes/export/csv/cells/singlegrade_cell.php @@ -83,7 +83,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade if (has_capability('mod/coursework:addinitialgrade', $PAGE->context) || has_capability('mod/coursework:editinitialgrade', $PAGE->context) || has_capability('mod/coursework:administergrades', $PAGE->context)) { - $errormsg = ''; + $errormsg = ''; if (!empty($value) && !$this->coursework->is_using_rubric()) { $gradejudge = new grade_judge($this->coursework); @@ -101,7 +101,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade //keys isnt. We will use array_filter whhich will return all values from the array if this is empty then we have //nothing to do - $arrayvalues = array_filter($value); + $arrayvalues = array_filter($value); //if there are no values we don't need to do anything if (!empty($arrayvalues)) { @@ -143,7 +143,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade $dbrecord = $DB->get_record('coursework_submissions', array('id'=>$submissionid)); - $submission = \mod_coursework\models\submission::find($dbrecord); + $submission = \mod_coursework\models\submission::find($dbrecord); //is this submission ready to be graded if (!$submission->ready_to_grade() && $submission->get_state() < \mod_coursework\models\submission::FULLY_GRADED) return get_string('submissionnotreadytograde','coursework'); @@ -221,9 +221,9 @@ function value_in_rubric($criteria, $value) { global $DB; - $valuefound = false; + $valuefound = false; - $levels = $criteria['levels']; + $levels = $criteria['levels']; if (is_numeric($value) ) { foreach ($levels as $level) { @@ -253,28 +253,28 @@ function get_rubrics($coursework,$csv_cells) { if ($coursework->is_using_rubric()) { - $rubricheaders = array(); + $rubricheaders = array(); $criterias = $coursework->get_rubric_criteria(); foreach ($criterias as $criteria) { - $rubricheaders[] = $criteria['description']; - $rubricheaders[] = $criteria['description']." comment"; + $rubricheaders[] = $criteria['description']; + $rubricheaders[] = $criteria['description']." comment"; } //find out the position of singlegrade $position = array_search('singlegrade',$csv_cells); //get all data from the position of the singlegrade to the length of rubricheaders - // $csv_cells = array_splice($csv_cells,5, 1, $rubricheaders); + // $csv_cells = array_splice($csv_cells,5, 1, $rubricheaders); - $start_cells = array_slice($csv_cells,0,$position,true); - $end_cells = array_slice($csv_cells,$position+1,count($csv_cells),true); + $start_cells = array_slice($csv_cells,0,$position,true); + $end_cells = array_slice($csv_cells,$position+1,count($csv_cells),true); - $cells = array_merge($start_cells,$rubricheaders); + $cells = array_merge($start_cells,$rubricheaders); - $cells = array_merge($cells,$end_cells); + $cells = array_merge($cells,$end_cells); diff --git a/classes/export/csv/cells/submissionfileid_cell.php b/classes/export/csv/cells/submissionfileid_cell.php index 35eabe79..41ab2615 100644 --- a/classes/export/csv/cells/submissionfileid_cell.php +++ b/classes/export/csv/cells/submissionfileid_cell.php @@ -54,11 +54,11 @@ public function validate_cell($value,$submissionid,$stage_dentifier='',$uploaded return 'No submission hash value entered'; } - $subdbrecord = $DB->get_record('coursework_submissions',array('id'=>$submissionid)); + $subdbrecord = $DB->get_record('coursework_submissions',array('id'=>$submissionid)); $submission = \mod_coursework\models\submission::find($subdbrecord); - $hash = $this->coursework->get_username_hash($submission->allocatableid); + $hash = $this->coursework->get_username_hash($submission->allocatableid); return ($value == $hash) ? true : get_string('submissionnotfound','coursework'); } diff --git a/classes/export/grading_sheet.php b/classes/export/grading_sheet.php index d520d2cb..fbd32337 100644 --- a/classes/export/grading_sheet.php +++ b/classes/export/grading_sheet.php @@ -198,8 +198,8 @@ public static function cells_array($coursework){ $criterias = $coursework->get_rubric_criteria(); foreach ($criterias as $criteria) { - $csv_cells[] = $criteria['description']; - $csv_cells[] = $criteria['description']." comment"; + $csv_cells[] = $criteria['description']; + $csv_cells[] = $criteria['description']." comment"; } diff --git a/classes/export/import.php b/classes/export/import.php index e0bd07b6..1b78b74d 100644 --- a/classes/export/import.php +++ b/classes/export/import.php @@ -82,7 +82,7 @@ public function validate_csv($content,$encoding,$delimeter,$csv_cells) { $csvreader->init(); - $errors = array(); + $errors = array(); $s = 0; $submissions = $this->get_submissions(); @@ -106,15 +106,15 @@ public function validate_csv($content,$encoding,$delimeter,$csv_cells) { // if the csv headers count is different than expected return error if ((!$this->coursework->is_using_rubric() && sizeof($line) != sizeof($cells)) || ($this->coursework->is_using_rubric() && !$this->rubric_count_correct($cells,$line))) {$errors = get_string('incorrectfileformat', 'coursework'); break;} - $offset = 0; + $offset = 0; //holds details on grades that have been successfully uploaded for the current line - $uploadedgradecells = array(); + $uploadedgradecells = array(); for($z = 0; $z < count($line); $z++) { - $value = $line[$z]; + $value = $line[$z]; $stage_identifier = $this->get_stage_identifier($submissionid,$cells[$i]); // remove numbers from cell names so they can be dynamically validated @@ -127,10 +127,10 @@ public function validate_csv($content,$encoding,$delimeter,$csv_cells) { //submission id field should always be first in the csv_cells array // if ($cells[$i] == 'submissionid') { - $submissionid = $value; + $submissionid = $value; } - if (empty($submissionid)) $errors[$s][] = get_string('emptysubmissionid','coursework'); + if (empty($submissionid)) $errors[$s][] = get_string('emptysubmissionid','coursework'); //offsets the position of that we extract the data from $line based on data that has been extracted before @@ -140,19 +140,19 @@ public function validate_csv($content,$encoding,$delimeter,$csv_cells) { && $this->coursework->is_using_rubric() && !($cells[$i] == "agreedgrade" && $this->coursework->finalstagegrading == 1)) { //get the headers that would contain the rubric grade data - $rubricheaders = $cell->get_header(null); + $rubricheaders = $cell->get_header(null); //find out the position of singlegrade $position = $i; //get all data from the position of the grade to the length of rubricheaders - $rubriclinedata = array_slice($line,$position + $offset, count($rubricheaders), true); + $rubriclinedata = array_slice($line,$position + $offset, count($rubricheaders), true); //pass the rubric data in $result = $cell->validate_cell($rubriclinedata, $submissionid, $stage_identifier, $uploadedgradecells); - $z = $z + count($rubricheaders)-1; - $offset = $offset + count($rubricheaders)-1; + $z = $z + count($rubricheaders)-1; + $offset = $offset + count($rubricheaders)-1; } else { $result = $cell->validate_cell($value, $submissionid, $stage_identifier, $uploadedgradecells); @@ -164,7 +164,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[] = $stage_identifier; } $i++; @@ -181,27 +181,27 @@ function rubric_count_correct($csvheader,$linefromimportedcsv) { // get criteria of rubrics and match it to grade cells if ($this->coursework->is_using_rubric()) { - $types = array("singlegrade","assessorgrade"); + $types = array("singlegrade","assessorgrade"); if ($this->coursework->finalstagegrading == 0 ) $types[] = "agreedgrade"; foreach($types as $type) { - $typefound = false; + $typefound = false; //$typepositions holds the places in the array of all vcolumns with headers that //match the type e.g a column named singlegrade1 will match a singlegrade type - $typepositions = false; - $i = 0; + $typepositions = false; + $i = 0; foreach($csvheader as $ch) { if (strpos($ch,$type) !== false) { - if (empty($typepositions)) $typepositions = array(); + if (empty($typepositions)) $typepositions = array(); - $typefound = true; - $typepositions[] = $i; + $typefound = true; + $typepositions[] = $i; //break; } $i++; @@ -211,10 +211,10 @@ function rubric_count_correct($csvheader,$linefromimportedcsv) { //this var is needed to provide an offset so the positions in the array we are looking for //are correct even after a splice and add is carried out - $offset = 0; + $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); @@ -247,7 +247,7 @@ function get_rubric_headers($csvheader) { // get criteria of rubrics and match it to grade cells if ($this->coursework->is_using_rubric()) { - $types = array("singlegrade","assessorgrade"); + $types = array("singlegrade","assessorgrade"); foreach($types as $type) { @@ -329,7 +329,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces $cells = $csv; $i = 0; - $csvline = array(); + $csvline = array(); //if ((!$this->coursework->is_using_rubric() && sizeof($line) != sizeof($cells)) || ($this->coursework->is_using_rubric() && !$this->rubric_count_correct($csv,$line))) { @@ -340,13 +340,13 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces break; } - $idfound = false; + $idfound = false; foreach ($line as $keynum => $value) { if (empty($idfound) && $cells[$i] == 'submissionid') { - $submissionid = $value; - $idfound = true; + $submissionid = $value; + $idfound = true; } //save the value into the csvline with the relevant pointer @@ -362,22 +362,22 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces //is this submission graded? if yes did this user grade it? - $coursework = $submission->get_coursework(); + $coursework = $submission->get_coursework(); $stages = array(); if (!$coursework->has_multiple_markers()) { $stages['singlegrade'] = $this->get_stage_identifier($csvline['submissionid'], 'singlegrade'); if (array_key_exists('agreedgrade',$csvline)) { - $stages['agreedgrade'] = 'final_agreed_1'; + $stages['agreedgrade'] = 'final_agreed_1'; } } else { foreach($csvline as $k => $v) { if (substr($k,0,13) == 'assessorgrade' || substr($k,0,11) == 'singlegrade') { - $stages[$k] = $this->get_stage_identifier($csvline['submissionid'], $k); + $stages[$k] = $this->get_stage_identifier($csvline['submissionid'], $k); } else if (substr($k,0,11) == 'agreedgrade') { - $stages[$k] = 'final_agreed_1'; + $stages[$k] = 'final_agreed_1'; } } } @@ -388,11 +388,11 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces //defines the start offest to be used when searching for a rubric in a uploaded csv, if the format of upload //csv is changed this will require changing - $rubricoffset = $rubricoffsetstart = ($coursework->is_configured_to_have_group_submissions()) ? 4 : 5; + $rubricoffset = $rubricoffsetstart = ($coursework->is_configured_to_have_group_submissions()) ? 4 : 5; - $numberofstages = count($stages); + $numberofstages = count($stages); foreach($stages as $k => $stage) { @@ -409,13 +409,13 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces $grade = $submission->get_assessor_feedback_by_stage($stage); - $feedbackpointer = 'assessorfeedback'.$a; + $feedbackpointer = 'assessorfeedback'.$a; $gradepointer = 'assessorgrade'.$a; if ($k == 'singlegrade') { - $feedbackpointer = 'feedbackcomments'; + $feedbackpointer = 'feedbackcomments'; $gradepointer = 'singlegrade'; } else if ($k == 'agreedgrade') { - $feedbackpointer = 'agreedfeedback'; + $feedbackpointer = 'agreedfeedback'; $gradepointer = 'agreedgrade'; } @@ -437,24 +437,24 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces //array that will hold the advanced grade data - $criteriagradedata = array(); - $criteriagradedata['criteria'] = array(); + $criteriagradedata = array(); + $criteriagradedata['criteria'] = array(); $criterias = $this->coursework->get_rubric_criteria(); $criteriacount = 0; - $numberofrubrics = count($criterias) * 2; + $numberofrubrics = count($criterias) * 2; //if the stage is final agrade we need to make sure the offset is set to the position of the //agreed grades in the csv, this is needed as some users will only have agreed grade capability if ($stage == 'final_agreed_1') { - $stagemultiplier = $numberofstages -1; + $stagemultiplier = $numberofstages -1; //the calculation below finds the position of the agreed grades in the uploaded csv - $rubricoffset = $rubricoffsetstart + $stagemultiplier + ($numberofrubrics * $stagemultiplier); + $rubricoffset = $rubricoffsetstart + $stagemultiplier + ($numberofrubrics * $stagemultiplier); if ($coursework->allocation_enabled()) $rubricoffset += 1; @@ -462,7 +462,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces $feedbackdata = array_slice($line, $rubricoffset+$numberofrubrics, 1); - $csvline[$feedbackpointer] = $feedbackdata[0]; + $csvline[$feedbackpointer] = $feedbackdata[0]; } else { @@ -470,15 +470,15 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces $feedbackdata = array_slice($line, $rubricoffset+$numberofrubrics, 1); - $csvline[$feedbackpointer] = $feedbackdata[0]; + $csvline[$feedbackpointer] = $feedbackdata[0]; - $rubricoffset = $rubricoffset + $numberofrubrics + 1; + $rubricoffset = $rubricoffset + $numberofrubrics + 1; } - $arrayvalues = array_filter($rubricdata); + $arrayvalues = array_filter($rubricdata); if (!empty($arrayvalues)) { @@ -504,14 +504,14 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces } } else { - $criteriagradedata = false; + $criteriagradedata = false; } //need to decide where the grade instance submit and get grade should be put as in order //pass the criteria data into the csvline position for the grade data so we can generate a grade - $csvline[$gradepointer] = $criteriagradedata; + $csvline[$gradepointer] = $criteriagradedata; //in case there is another rubric to be extracted from the csv set the new value of the rubric offset @@ -524,24 +524,24 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces $criterias = $this->coursework->get_rubric_criteria(); - $numberofrubrics = count($criterias) * 2; + $numberofrubrics = count($criterias) * 2; } - $stagemultiplier = $numberofstages -1; + $stagemultiplier = $numberofstages -1; //the calculation below finds the position of the agreed grades in the uploaded csv - $rubricoffset = $rubricoffsetstart + $stagemultiplier + ($numberofrubrics * $stagemultiplier); + $rubricoffset = $rubricoffsetstart + $stagemultiplier + ($numberofrubrics * $stagemultiplier); if ($coursework->allocation_enabled()) $rubricoffset += 1; $gradearrvalue = array_slice($line, $rubricoffset, 2); - $csvline[$gradepointer] = $gradearrvalue[0]; - $csvline[$feedbackpointer] = $gradearrvalue[1]; + $csvline[$gradepointer] = $gradearrvalue[0]; + $csvline[$feedbackpointer] = $gradearrvalue[1]; } @@ -549,11 +549,11 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces // don't create/update feedback if grade is empty if (!empty($csvline[$gradepointer])) { - $stageusesrubric = ($this->coursework->is_using_rubric() + $stageusesrubric = ($this->coursework->is_using_rubric() && !($stage == 'final_agreed_1' && $this->coursework->finalstagegrading)) ? true : false; if (empty($grade)) { - $cwfeedbackid = $this->add_grade($csvline['submissionid'], $csvline[$k], $csvline[$feedbackpointer], $stage,$stageusesrubric); + $cwfeedbackid = $this->add_grade($csvline['submissionid'], $csvline[$k], $csvline[$feedbackpointer], $stage,$stageusesrubric); } else { $cwfeedbackid = $this->get_coursework_feedback_id($csvline['submissionid'], $stage); @@ -589,9 +589,9 @@ function get_value_rubric_levelid($criteria, $value) { global $DB; - $idfound = false; + $idfound = false; - $levels = $criteria['levels']; + $levels = $criteria['levels']; if (is_numeric($value) ) { foreach ($levels as $level) { @@ -633,24 +633,24 @@ public function add_grade($submissionid, $grade, $feedback, $stage_identifier,$u } $gradejudge = new grade_judge($this->coursework); - $grade = $gradejudge->get_grade($grade); + $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(); + $add_grade = new \stdClass(); + $add_grade->id = ''; + $add_grade->submissionid = $submissionid; + $add_grade->assessorid = $USER->id; + $add_grade->timecreated = time(); + $add_grade->timemodified = time(); //we cant save the grade if this coursework uses rubrics as the grade has not been generated and the grade var contains //criteria that will be used to genenrate the grade. We need the feedback id to do this so we need to make the feedback //first - $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; + $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; $feedbackid = $DB->insert_record('coursework_feedbacks', $add_grade, true); @@ -658,10 +658,10 @@ public function add_grade($submissionid, $grade, $feedback, $stage_identifier,$u $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); + $rubricgrade = $gradinginstance->submit_and_get_grade($grade, $feedbackid); - $add_grade->id = $feedbackid; - $add_grade->grade = $rubricgrade; + $add_grade->id = $feedbackid; + $add_grade->grade = $rubricgrade; $DB->update_record('coursework_feedbacks', $add_grade); @@ -707,8 +707,8 @@ public function edit_grade($cwfeedbackid, $grade, $feedback,$uses_rubric=false){ $controller = $this->coursework->get_advanced_grading_active_controller(); //find out how many criteria there are $gradinginstance = $controller->get_or_create_instance(0, $USER->id,$cwfeedbackid); - $rubricgrade = $gradinginstance->submit_and_get_grade($grade, $cwfeedbackid); - $grade = $rubricgrade; + $rubricgrade = $gradinginstance->submit_and_get_grade($grade, $cwfeedbackid); + $grade = $rubricgrade; } @@ -754,7 +754,7 @@ public function get_stage_identifier($submissionid,$cell_identifier) { $submission = $DB->get_record('coursework_submissions', array('id'=>$submissionid)); - $submission = \mod_coursework\models\submission::find($submission); + $submission = \mod_coursework\models\submission::find($submission); // single marked - singlegrade - allocated/notallocated $stage_identifier = 'assessor_1'; @@ -873,7 +873,7 @@ public function remove_other_assessors_grade($csv_cells, &$line){ $criterias = $this->coursework->get_rubric_criteria(); - $startposition = $singlegradeposition+ ((count($criterias) *2) +1); + $startposition = $singlegradeposition+ ((count($criterias) *2) +1); } else { $startposition = array_search('otherassessors', $csv_cells); @@ -882,7 +882,7 @@ public function remove_other_assessors_grade($csv_cells, &$line){ for ($i = $startposition; $i < $startposition+$othercells ; $i++) { unset($line[$i]); } - $csv_cells =array_values($csv_cells); + $csv_cells =array_values($csv_cells); $line = array_values($line); } diff --git a/classes/file_importer.php b/classes/file_importer.php index a1772550..ca22887f 100644 --- a/classes/file_importer.php +++ b/classes/file_importer.php @@ -104,7 +104,7 @@ public function import_zip_files($coursework,$feedbackstage,$overwritecurrent) @set_time_limit(ASSIGNFEEDBACK_FILE_MAXFILEUNZIPTIME); - $results = array(); + $results = array(); $feedbackfilesupdated = 0; $feedbackfilesadded = 0; @@ -119,13 +119,13 @@ public function import_zip_files($coursework,$feedbackstage,$overwritecurrent) foreach ($feedbackfiles as $file) { - $filename = $file->get_filename(); + $filename = $file->get_filename(); if ($allocatableid = $this->is_valid_feedback_file_filename($coursework, $file, $participants) ) { - $subdbrecord = $DB->get_record('coursework_submissions',array('courseworkid'=>$coursework->id(),'allocatableid'=>$allocatableid,'allocatabletype'=>$coursework->get_allocatable_type())); + $subdbrecord = $DB->get_record('coursework_submissions',array('courseworkid'=>$coursework->id(),'allocatableid'=>$allocatableid,'allocatabletype'=>$coursework->get_allocatable_type())); - $submission = \mod_coursework\models\submission::find($subdbrecord); + $submission = \mod_coursework\models\submission::find($subdbrecord); if ($submission->get_state() < \mod_coursework\models\submission::PUBLISHED) { @@ -201,10 +201,10 @@ public function import_zip_files($coursework,$feedbackstage,$overwritecurrent) public function is_valid_feedback_file_filename($coursework,$feedbackfile,$participants) { - $result = false; + $result = false; - $filename = explode('.',$feedbackfile->get_filename()); - $filename = $filename[0]; + $filename = explode('.',$feedbackfile->get_filename()); + $filename = $filename[0]; if ($feedbackfile->is_directory()) { return $result; @@ -220,7 +220,7 @@ public function is_valid_feedback_file_filename($coursework,$feedbackfile,$parti } foreach ($participants as $user) { - if ($filename == $coursework->get_username_hash($user->id)) { + if ($filename == $coursework->get_username_hash($user->id)) { $result = $user->id; break; } @@ -236,13 +236,13 @@ public function feedback_exists($coursework,$submission,$stageidentifier) { global $DB, $USER; - $sql = "SELECT * + $sql = "SELECT * FROM {coursework_feedbacks} - WHERE submissionid = :submissionid + WHERE submissionid = :submissionid AND stage_identifier = :stage "; - $params = array('submissionid'=>$submission->id, + $params = array('submissionid'=>$submission->id, 'stage'=>$stageidentifier); if (!has_capability('mod/coursework:administergrades',$coursework->get_context())) { diff --git a/classes/forms/advance_plugins_form.php b/classes/forms/advance_plugins_form.php index 604aeb67..d52bd57e 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'), array()); $mform->setType('editor', PARAM_RAW); - $file_manager_options = array( + $file_manager_options = array( 'subdirs' => false, 'accepted_types' => '*', 'return_types' => FILE_INTERNAL diff --git a/classes/forms/assessor_feedback_mform.php b/classes/forms/assessor_feedback_mform.php index 6fb07624..59c3e869 100644 --- a/classes/forms/assessor_feedback_mform.php +++ b/classes/forms/assessor_feedback_mform.php @@ -105,7 +105,7 @@ public function definition() { $mform->addElement('editor', 'feedbackcomment', get_string('comment', 'mod_coursework')); $mform->setType('editor', PARAM_RAW); - $file_manager_options = array( + $file_manager_options = array( 'subdirs' => false, 'accepted_types' => '*', 'return_types' => FILE_INTERNAL @@ -149,7 +149,7 @@ public function add_submit_buttons($draftenabled, $feedbackid){ $feedback = $this->_customdata['feedback']; - $is_published = $feedback->get_submission()->is_published(); + $is_published = $feedback->get_submission()->is_published(); if ($feedbackid && !$is_published) { $button_array[] = $this->_form->createElement('submit', 'removefeedbackbutton', get_string('removefeedback', 'coursework')); @@ -235,12 +235,12 @@ public function get_file_options() { $filemanager = $this->_form->getElement('feedback_manager'); if ($filemanager) { $params = (object) [ - 'maxfiles' => $filemanager->getMaxfiles(), - 'subdirs' => $filemanager->getSubdirs(), + 'maxfiles' => $filemanager->getMaxfiles(), + 'subdirs' => $filemanager->getSubdirs(), 'areamaxbytes' => $filemanager->getAreamaxbytes(), - 'target' => 'id_' . $filemanager->getName(), + 'target' => 'id_' . $filemanager->getName(), 'context' => $PAGE->context, - 'itemid' => $filemanager->getValue() + 'itemid' => $filemanager->getValue() ]; $fm = new \form_filemanager($params); $options = $fm->options; diff --git a/classes/forms/deadline_extension_form.php b/classes/forms/deadline_extension_form.php index 9f9e3927..e93c34e8 100644 --- a/classes/forms/deadline_extension_form.php +++ b/classes/forms/deadline_extension_form.php @@ -112,7 +112,7 @@ public function personal_deadline(){ $extensionid = optional_param('id',0, PARAM_INT); if($extensionid != 0){ - $ext = $DB->get_record('coursework_extensions', array('id'=>$extensionid)); + $ext = $DB->get_record('coursework_extensions', array('id'=>$extensionid)); $allocatableid = $ext->allocatableid; $allocatabletype = $ext->allocatabletype; $courseworkid = $ext->courseworkid; @@ -121,7 +121,7 @@ public function personal_deadline(){ $allocatableid = required_param('allocatableid', PARAM_INT); $allocatabletype = required_param('allocatabletype', PARAM_ALPHANUMEXT); - $courseworkid = required_param('courseworkid', PARAM_INT); + $courseworkid = required_param('courseworkid', PARAM_INT); } $params = array( diff --git a/classes/forms/student_submission_form.php b/classes/forms/student_submission_form.php index 5b93e7a6..b02c1a70 100644 --- a/classes/forms/student_submission_form.php +++ b/classes/forms/student_submission_form.php @@ -175,11 +175,11 @@ public function handle() { if (!$submission->get_coursework()->has_deadline()) { - $userids = explode(',',$submission->get_coursework()->get_submission_notification_users()); + $userids = explode(',',$submission->get_coursework()->get_submission_notification_users()); if (!empty($userids)) { foreach($userids as $u) { - $notifyuser = $DB->get_record('user',array('id'=>trim($u))); + $notifyuser = $DB->get_record('user',array('id'=>trim($u))); $mailer = new mailer($coursework); if (!empty($notifyuser)) $mailer->send_submission_notification($notifyuser); @@ -369,7 +369,7 @@ protected function add_instructions_to_form() { $file_manager_options = $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->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'] != '*') { diff --git a/classes/forms/upload_allocations_form.php b/classes/forms/upload_allocations_form.php index 61a28e4d..5a462fed 100644 --- a/classes/forms/upload_allocations_form.php +++ b/classes/forms/upload_allocations_form.php @@ -30,7 +30,7 @@ class upload_allocations_form extends moodleform { private $cmid; function __construct($cmid) { - $this->cmid = $cmid; + $this->cmid = $cmid; parent::__construct(); } diff --git a/classes/forms/upload_feedback_form.php b/classes/forms/upload_feedback_form.php index e22449da..a7e0891d 100644 --- a/classes/forms/upload_feedback_form.php +++ b/classes/forms/upload_feedback_form.php @@ -39,8 +39,8 @@ class upload_feedback_form extends moodleform { private $coursework; function __construct($coursework, $cmid) { - $this->cmid = $cmid; - $this->coursework = $coursework; + $this->cmid = $cmid; + $this->coursework = $coursework; parent::__construct(); } diff --git a/classes/forms/upload_grading_sheet_form.php b/classes/forms/upload_grading_sheet_form.php index 81fd259c..be1d9ac6 100644 --- a/classes/forms/upload_grading_sheet_form.php +++ b/classes/forms/upload_grading_sheet_form.php @@ -38,7 +38,7 @@ class upload_grading_sheet_form extends moodleform { private $cmid; function __construct($cmid) { - $this->cmid = $cmid; + $this->cmid = $cmid; parent::__construct(); } diff --git a/classes/forms/view_all_students_mform.php b/classes/forms/view_all_students_mform.php index c9a4e033..cc981f8f 100644 --- a/classes/forms/view_all_students_mform.php +++ b/classes/forms/view_all_students_mform.php @@ -38,7 +38,7 @@ function definition() { $buttontext = (empty($this->_customdata['displayallstudents'])) ? get_string('viewallstudents', 'coursework') : get_string('hideallstudents','coursework'); - $hiddenvalue = (empty($this->_customdata['displayallstudents'])) ? 1 : 0; + $hiddenvalue = (empty($this->_customdata['displayallstudents'])) ? 1 : 0; $this->_form->addElement('submit', 'displayallstudentbutton', $buttontext); $this->_form->addElement('hidden', 'displayallstudents', $hiddenvalue); $this->_form->setType('displayallstudents', PARAM_INT); diff --git a/classes/grading_report.php b/classes/grading_report.php index ace35c2c..d06a3252 100644 --- a/classes/grading_report.php +++ b/classes/grading_report.php @@ -83,7 +83,7 @@ class grading_report { */ public function __construct(array $options, $coursework) { - $options['courseworkid'] = $coursework->id; + $options['courseworkid'] = $coursework->id; $this->options = $options; $this->coursework = $coursework; @@ -354,7 +354,7 @@ public function get_table_rows_for_page($rowcount=false) { $row_class = $this->coursework->has_multiple_markers() ? 'mod_coursework\grading_table_row_multi' : 'mod_coursework\grading_table_row_single'; $ability = new ability(user::find($USER, false), $this->get_coursework()); - $participantsfound = 0; + $participantsfound = 0; foreach ($participants as $key => $participant) { diff --git a/classes/grading_table_row_base.php b/classes/grading_table_row_base.php index 9359326e..8727c349 100644 --- a/classes/grading_table_row_base.php +++ b/classes/grading_table_row_base.php @@ -347,7 +347,7 @@ public function get_student_firstname() { $allocatable = $this->get_allocatable(); if (empty($allocatable->firstname)) { - $this->allocatable = user::find($allocatable); + $this->allocatable = user::find($allocatable); } return $this->get_allocatable()->firstname; @@ -362,7 +362,7 @@ public function get_student_lastname() { $allocatable = $this->get_allocatable(); if (empty($allocatable->lastname)) { - $this->allocatable = user::find($allocatable); + $this->allocatable = user::find($allocatable); } return $this->get_allocatable()->lastname; diff --git a/classes/mailer.php b/classes/mailer.php index 3160fe20..0360533a 100644 --- a/classes/mailer.php +++ b/classes/mailer.php @@ -109,7 +109,7 @@ public function send_late_submission_notification($submission) { foreach ($recipients as $recipient) { // New approach. - $eventdata = new \core\message\message(); + $eventdata = new \core\message\message(); $eventdata->component = 'mod_coursework'; $eventdata->name = 'submission_receipt'; $eventdata->userfrom = \core_user::get_noreply_user(); @@ -216,7 +216,7 @@ public function send_student_deadline_reminder($user) { $text_body = get_string('cron_email_text', 'mod_coursework', $email_data); $html_body = get_string('cron_email_html', 'mod_coursework', $email_data); - $eventdata = new \core\message\message(); + $eventdata = new \core\message\message(); $eventdata->component = 'mod_coursework'; $eventdata->name = 'student_deadline_reminder'; $eventdata->userfrom = \core_user::get_noreply_user(); diff --git a/classes/models/coursework.php b/classes/models/coursework.php index 97a112f8..d469e967 100644 --- a/classes/models/coursework.php +++ b/classes/models/coursework.php @@ -696,7 +696,7 @@ public function get_file_options() { $turnitinenabled = $this->tii_enabled(); // Turn it in only allows one file. - $max_files = $this->maxfiles; + $max_files = $this->maxfiles; // Turn it in only likes some file types. /* DOC, DOCX, Corel @@ -992,7 +992,7 @@ public function pack_files() { $foldername .= $this->get_username_hash($submission->get_allocatable()->id()); - $filename = $foldername.'/'.$filename; + $filename = $foldername.'/'.$filename; /* @var $f stored_file */ $files_for_zipping[$filename] = $f; @@ -1364,7 +1364,7 @@ public function get_assessor_graded_submissions($assessorid){ ON cs.id = cf.submissionid WHERE cs.courseworkid = :courseworkid AND assessorid = :assessorid"; - $submissions = $DB->get_records_sql($sql, $params); + $submissions = $DB->get_records_sql($sql, $params); foreach ($submissions as $submission) { $submission = submission::find($submission); @@ -1389,7 +1389,7 @@ public function get_published_submissions(){ WHERE courseworkid = :courseworkid AND firstpublished IS NOT NULL"; - $submissions = $DB->get_records_sql($sql, array('courseworkid' => $this->id)); + $submissions = $DB->get_records_sql($sql, array('courseworkid' => $this->id)); foreach ($submissions as &$submission) { $submission = submission::find($submission); } @@ -1413,7 +1413,7 @@ static function get_name_hash($id,$userid,$time=1440000609) return ''; } - $uhash = $id . $userid; + $uhash = $id . $userid; //hash with zero have the potential to become changed in outside programs //so we generate a hash without a leading zero @@ -2325,7 +2325,7 @@ public function get_allocatables() { /** * @var group $group */ - $members = $group->get_members($this->get_context(), $cmobject); + $members = $group->get_members($this->get_context(), $cmobject); if (empty($members)){ continue; } @@ -2608,7 +2608,7 @@ public function get_allocatables_with_feedback($stage, $random = false) { $sql = "SELECT cwrsub.allocatableid, cwrfb.* FROM {coursework_submissions} cwrsub, {coursework_feedbacks} cwrfb - WHERE cwrsub.id = cwrfb.submissionid + WHERE cwrsub.id = cwrfb.submissionid AND cwrsub.courseworkid = :coursework_id AND stage_identifier = :stage"; @@ -2737,10 +2737,10 @@ public function draft_feedback_enabled(){ */ public function get_allocatables_and_deadline() { - $allocatables = $this->get_allocatables(); + $allocatables = $this->get_allocatables(); if (!empty($allocatables)) { - $allocatables = array_map(array($this,"get_allocatable_personal_deadline"), $allocatables); + $allocatables = array_map(array($this,"get_allocatable_personal_deadline"), $allocatables); } return $allocatables; @@ -2757,8 +2757,8 @@ private function get_allocatable_personal_deadline($allocatable) { global $DB; - $allocatable->deadline = $this->deadline; - $allocatable->coursework_id = $this->id; + $allocatable->deadline = $this->deadline; + $allocatable->coursework_id = $this->id; if ($this->personal_deadlines_enabled()) { personal_deadline::fill_pool_coursework($this->id); diff --git a/classes/models/moderation.php b/classes/models/moderation.php index 8878d6ba..d78c1772 100644 --- a/classes/models/moderation.php +++ b/classes/models/moderation.php @@ -113,7 +113,7 @@ public function get_agreement(){ * @return bool|submission */ public function get_submission() { - $feedback = $this->get_feedback(); + $feedback = $this->get_feedback(); $this->submission = submission::find($feedback->submissionid); return $this->submission; diff --git a/classes/models/outstanding_marking.php b/classes/models/outstanding_marking.php index f469a425..157715ba 100644 --- a/classes/models/outstanding_marking.php +++ b/classes/models/outstanding_marking.php @@ -29,7 +29,7 @@ class outstanding_marking { public function __construct() { - $this->day_in_secs = 86400; + $this->day_in_secs = 86400; } @@ -40,9 +40,9 @@ public function __construct() { */ public function get_to_grade_initial_count($cwkrecord,$userid){ - $coursework = new \mod_coursework\models\coursework($cwkrecord); + $coursework = new \mod_coursework\models\coursework($cwkrecord); - $initialsubmissions = array(); + $initialsubmissions = array(); if($this->should_get_to_mark_initial_grade_info($coursework->id,$userid)){ @@ -54,7 +54,7 @@ public function get_to_grade_initial_count($cwkrecord,$userid){ $initialsubmissions = $this->get_multiple_to_mark_sampled_initial_grade_submissions($coursework->id,$userid); } else { - $initialsubmissions = $this->get_multiple_to_mark_initial_grade_submissions($coursework->id,$userid,$coursework->get_max_markers(),$coursework->allocation_enabled()); + $initialsubmissions = $this->get_multiple_to_mark_initial_grade_submissions($coursework->id,$userid,$coursework->get_max_markers(),$coursework->allocation_enabled()); } } @@ -70,9 +70,9 @@ public function get_to_grade_initial_count($cwkrecord,$userid){ */ public function get_to_grade_agreed_count($cwkrecord,$userid) { - $coursework = new \mod_coursework\models\coursework($cwkrecord); + $coursework = new \mod_coursework\models\coursework($cwkrecord); - $agreedsubmissions = array(); + $agreedsubmissions = array(); //AGREED GRADE INFORMATION @@ -98,24 +98,24 @@ private function get_single_marker_initial_grade_submissions_to_mark($coursework global $DB; - $sqlparams = array(); - $sqltable = ""; - $sqlextra = ""; + $sqlparams = array(); + $sqltable = ""; + $sqlextra = ""; if ($allocationenabled) { //we only have to check for submissions allocated to this user - $sqltable = ", {coursework_allocation_pairs} cap "; + $sqltable = ", {coursework_allocation_pairs} cap "; - $sqlextra = " + $sqlextra = " AND cap.courseworkid = cs.courseworkid AND cap.allocatableid = cs.allocatableid AND cap.allocatabletype = cs.allocatabletype AND cap.assessorid = :assessorid "; - $sqlparams['assessorid'] = $userid; + $sqlparams['assessorid'] = $userid; } - $sql = "SELECT cs.id as submissionid + $sql = "SELECT cs.id as submissionid FROM {coursework_submissions} cs LEFT JOIN {coursework_feedbacks} f ON cs.id = f.submissionid @@ -126,7 +126,7 @@ private function get_single_marker_initial_grade_submissions_to_mark($coursework {$sqlextra} "; - $sqlparams['courseworkid'] = $courseworkid; + $sqlparams['courseworkid'] = $courseworkid; return $DB->get_records_sql($sql, $sqlparams); } @@ -142,7 +142,7 @@ private function get_multiple_to_mark_sampled_initial_grade_submissions($coursew global $DB; $countsamples = 'CASE WHEN a.id = NULL THEN 0 ELSE COUNT(a.id)+1 END'; - $sql = " SELECT *, + $sql = " SELECT *, $countsamples AS count_samples, COUNT(a.id) AS ssmID FROM( SELECT cs.id AS csid, f.id AS fid, cs.allocatableid ,ssm.id, COUNT(f.id) AS count_feedback, @@ -162,10 +162,10 @@ private function get_multiple_to_mark_sampled_initial_grade_submissions($coursew GROUP BY a.allocatableid, a.csid, a.fid, a.id, a.count_feedback, a.courseworkid HAVING (count_feedback < $countsamples )"; - $sqlparams = array(); - $sqlparams['subassessorid'] = $userid; - $sqlparams['subcourseworkid'] = $courseworkid; - $sqlparams['courseworkid'] = $courseworkid; + $sqlparams = array(); + $sqlparams['subassessorid'] = $userid; + $sqlparams['subcourseworkid'] = $courseworkid; + $sqlparams['courseworkid'] = $courseworkid; return $DB->get_records_sql($sql, $sqlparams); @@ -183,25 +183,25 @@ private function get_multiple_to_mark_initial_grade_submissions($courseworkid,$u global $DB; - $sqlparams = array(); - $sqltable = ''; - $sqlextra = ''; + $sqlparams = array(); + $sqltable = ''; + $sqlextra = ''; if ($allocationenabled) { //we only have to check for submissions allocated to this user - $sqltable = ", {coursework_allocation_pairs} cap "; + $sqltable = ", {coursework_allocation_pairs} cap "; - $sqlextra = " + $sqlextra = " AND cap.courseworkid = cs.courseworkid AND cap.allocatableid = cs.allocatableid AND cap.allocatabletype = cs.allocatabletype AND cap.assessorid = :assessorid2 "; - $sqlparams['assessorid2'] = $userid; + $sqlparams['assessorid2'] = $userid; } - $sql = "SELECT cs.id AS submissionid, COUNT(f.id) AS count_feedback + $sql = "SELECT cs.id AS submissionid, COUNT(f.id) AS count_feedback FROM {coursework_submissions} cs LEFT JOIN {coursework_feedbacks} f ON cs.id = f.submissionid {$sqltable} @@ -217,11 +217,11 @@ private function get_multiple_to_mark_initial_grade_submissions($courseworkid,$u HAVING (COUNT(f.id) < :numofmarkers)"; - $sqlparams['subassessorid'] = $userid; - $sqlparams['subcourseworkid'] = $courseworkid; - $sqlparams['courseworkid'] = $courseworkid; - $sqlparams['numofmarkers'] = $numberofmarkers; - $sqlparams['assessorid'] = $userid; + $sqlparams['subassessorid'] = $userid; + $sqlparams['subcourseworkid'] = $courseworkid; + $sqlparams['courseworkid'] = $courseworkid; + $sqlparams['numofmarkers'] = $numberofmarkers; + $sqlparams['assessorid'] = $userid; return $DB->get_records_sql($sql, $sqlparams); @@ -264,7 +264,7 @@ private function get_to_grade_agreed_grade_sampled_submissions($courseworkid) { global $DB; $countsamples = 'CASE WHEN a.id = NULL THEN 0 ELSE COUNT(a.id)+1 END'; - $sql = "SELECT *, + $sql = "SELECT *, $countsamples AS count_samples, COUNT(a.id) AS ssmID FROM( SELECT f.id AS fid, cs.id AS csid, cs.allocatableid ,ssm.id, COUNT(f.id) AS count_feedback, @@ -292,7 +292,7 @@ private function get_to_grade_agreed_grade_sampled_submissions($courseworkid) { */ private function has_agreed_grade($course_id,$user_id) { - $coursecontext = \context_course::instance($course_id); + $coursecontext = \context_course::instance($course_id); return has_capability('mod/coursework:addagreedgrade',$coursecontext,$user_id) || has_capability('mod/coursework:addallocatedagreedgrade',$coursecontext,$user_id); } @@ -305,7 +305,7 @@ private function has_agreed_grade($course_id,$user_id) { */ private function has_initial_grade($course_id,$user_id) { - $coursecontext = \context_course::instance($course_id); + $coursecontext = \context_course::instance($course_id); return has_capability('mod/coursework:addinitialgrade',$coursecontext,$user_id); } @@ -318,10 +318,10 @@ private function has_initial_grade($course_id,$user_id) { */ private function should_get_to_mark_initial_grade_info($courseworkid,$userid) { - $coursework = new \mod_coursework\models\coursework($courseworkid); + $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); + $user_has_initial_grade_capability = $this->has_initial_grade($coursework->get_course()->id, $userid); return $user_has_initial_grade_capability; } @@ -333,10 +333,10 @@ private function should_get_to_mark_initial_grade_info($courseworkid,$userid) */ private function should_get_to_mark_agreed_grade_info($courseworkid,$userid) { - $coursework = new \mod_coursework\models\coursework($courseworkid); + $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); + $user_has_agreed_grade_capability = $this->has_agreed_grade($coursework->get_course()->id, $userid); return $user_has_agreed_grade_capability; diff --git a/classes/models/plagiarism_flag.php b/classes/models/plagiarism_flag.php index 779d5d5d..33209032 100644 --- a/classes/models/plagiarism_flag.php +++ b/classes/models/plagiarism_flag.php @@ -50,10 +50,10 @@ class plagiarism_flag extends table_base { /** * Constants with Statuses for Plagiarism flagging */ - const INVESTIGATION = 0; - const RELEASED = 1; - const CLEARED = 2; - const NOTCLEARED = 3; + const INVESTIGATION = 0; + const RELEASED = 1; + const CLEARED = 2; + const NOTCLEARED = 3; /** * @return mixed|\mod_coursework_coursework diff --git a/classes/models/sample_set_rule.php b/classes/models/sample_set_rule.php index a5a19ec4..60905a4f 100644 --- a/classes/models/sample_set_rule.php +++ b/classes/models/sample_set_rule.php @@ -106,7 +106,7 @@ abstract class sample_set_rule extends table_base implements renderable { */ public function __construct($coursework) { - $this->coursework = $coursework; + $this->coursework = $coursework; //parent::__construct($dbrecord); diff --git a/classes/models/submission.php b/classes/models/submission.php index f2a9b4d5..9404f251 100644 --- a/classes/models/submission.php +++ b/classes/models/submission.php @@ -801,13 +801,13 @@ public function get_tii_group_member_with_eula($groupid) { global $DB; - $sql = " + $sql = " SELECT gm.userid as id FROM {groups_members} gm, {turnitintooltwo_users} tu WHERE tu.userid = gm.userid AND user_agreement_accepted != 0 - AND gm.groupid = ? + AND gm.groupid = ? ORDER BY gm.userid LIMIT 1"; @@ -1053,7 +1053,7 @@ public function get_last_submitter() { public function is_late() { // check if submission has personal deadline if ($this->get_coursework()->personaldeadlineenabled){ - $deadline = $this->submission_personal_deadline(); + $deadline = $this->submission_personal_deadline(); } else { // if not, use coursework default deadline $deadline = $this->get_coursework()->get_deadline(); } @@ -1399,7 +1399,7 @@ public function final_draft_feedbacks_exist() { $this->get_coursework()->get_grade_editing_time(); - $sql = " + $sql = " SELECT * FROM {coursework} c, {coursework_submissions} cs, @@ -1414,7 +1414,7 @@ public function final_draft_feedbacks_exist() { AND cf.timecreated + c.gradeeditingtime > :time "; - $editablefeedbacks = $DB->get_records_sql($sql,array('submissionid'=>$this->id,'time'=>time())); + $editablefeedbacks = $DB->get_records_sql($sql,array('submissionid'=>$this->id,'time'=>time())); return (empty($editablefeedbacks)) ? false : $editablefeedbacks; } @@ -1423,12 +1423,12 @@ public function final_draft_feedbacks_exist() { * Determines whether the current user is able to add a turnitin grademark to this submission */ function can_add_tii_grademark() { - $canadd = false; + $canadd = false; if ($this->get_coursework()->get_max_markers() == 1) { - $canadd = (has_any_capability(array('mod/coursework:addinitialgrade','mod/coursework:addministergrades'),$this->get_context()) && $this->ready_to_grade()) ; + $canadd = (has_any_capability(array('mod/coursework:addinitialgrade','mod/coursework:addministergrades'),$this->get_context()) && $this->ready_to_grade()) ; } else { - $canadd = (has_any_capability(array('mod/coursework:addagreedgrade','mod/coursework:addallocatedagreedgrade','mod/coursework:addministergrades'),$this->get_context()) && $this->all_inital_graded()) ; + $canadd = (has_any_capability(array('mod/coursework:addagreedgrade','mod/coursework:addallocatedagreedgrade','mod/coursework:addministergrades'),$this->get_context()) && $this->all_inital_graded()) ; } return $canadd; @@ -1463,7 +1463,7 @@ function has_valid_extension(){ function can_be_unfinalised() { - return ($this->get_state() == submission::FINALISED); + return ($this->get_state() == submission::FINALISED); } /** diff --git a/classes/personal_deadline/table/row/builder.php b/classes/personal_deadline/table/row/builder.php index 715726a6..60e69fc8 100644 --- a/classes/personal_deadline/table/row/builder.php +++ b/classes/personal_deadline/table/row/builder.php @@ -120,7 +120,7 @@ public function get_student_firstname() { $allocatable = $this->get_allocatable(); if (empty($allocatable->firstname)) { - $this->allocatable = user::find($allocatable); + $this->allocatable = user::find($allocatable); } return $this->get_allocatable()->firstname; @@ -135,7 +135,7 @@ public function get_student_lastname() { $allocatable = $this->get_allocatable(); if (empty($allocatable->lastname)) { - $this->allocatable = user::find($allocatable); + $this->allocatable = user::find($allocatable); } return $this->get_allocatable()->lastname; @@ -150,7 +150,7 @@ public function get_idnumber() { $allocatable = $this->get_allocatable(); if (empty($allocatable->idnumber)) { - $this->allocatable = user::find($allocatable); + $this->allocatable = user::find($allocatable); } return $this->get_allocatable()->idnumber; @@ -166,7 +166,7 @@ public function get_email() { $allocatable = $this->get_allocatable(); if (empty($allocatable->email)) { - $this->allocatable = user::find($allocatable); + $this->allocatable = user::find($allocatable); } return $this->get_allocatable()->email; @@ -203,19 +203,19 @@ public function get_personal_deadlines() { public function get_submission_status() { global $DB; - $submission_db = $DB->get_record('coursework_submissions', + $submission_db = $DB->get_record('coursework_submissions', array('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($submission_db); - $statustext = get_string('statusnotsubmitted','mod_coursework'); + $statustext = get_string('statusnotsubmitted','mod_coursework'); if (!empty($submission) && $submission->is_finalised()) { - $statustext = get_string('finalisedsubmission','mod_coursework'); + $statustext = get_string('finalisedsubmission','mod_coursework'); } else if (!empty($submission)) { - $statustext = $submission->get_status_text(); + $statustext = $submission->get_status_text(); } return $statustext; diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php index 4b723b52..33a375f0 100644 --- a/classes/privacy/provider.php +++ b/classes/privacy/provider.php @@ -42,48 +42,48 @@ class provider implements */ public static function get_metadata(collection $collection) : collection { $feedbacks = [ - 'assessorid' => 'privacy:metadata:assessorid', - 'timecreated' => 'privacy:metadata:timecreated', - 'timemodified' => 'timemodified', - 'grade' => 'privacy:metadata:grade', - 'submissionid' => 'privacy:metadata:submissionid', - 'feedbackcomment' => 'privacy:metadata:feedbackcomment' + 'assessorid' => 'privacy:metadata:assessorid', + 'timecreated' => 'privacy:metadata:timecreated', + 'timemodified' => 'timemodified', + 'grade' => 'privacy:metadata:grade', + 'submissionid' => 'privacy:metadata:submissionid', + 'feedbackcomment' => 'privacy:metadata:feedbackcomment' ]; $submissions = [ - 'authorid' => 'privacy:metadata:authorid', - 'userid' => 'privacy:metadata:userid', - 'timecreated' => 'privacy:metadata:timecreated', - 'timemodified' => 'timemodified', - 'createdby' => 'createdby', - 'timesubmitted' => 'timesubmitted' + 'authorid' => 'privacy:metadata:authorid', + 'userid' => 'privacy:metadata:userid', + 'timecreated' => 'privacy:metadata:timecreated', + 'timemodified' => 'timemodified', + 'createdby' => 'createdby', + 'timesubmitted' => 'timesubmitted' ]; $extensions = [ 'allocatableid' => 'privacy:metadata:allocatableid', - 'createdbyid' => 'privacy:metadata:createdbyid', + 'createdbyid' => 'privacy:metadata:createdbyid', 'extra_information_text' => 'privacy:metadata:extra_information_text', 'extended_deadline' => 'privacy:metadata:extended_deadline', - 'allocatableuser' => 'privacy:metadata:userid', - 'allocatablegroup' => 'privacy:metadata:groupid' + 'allocatableuser' => 'privacy:metadata:userid', + 'allocatablegroup' => 'privacy:metadata:groupid' ]; $persondeadlines = [ - 'allocatableid' => 'privacy:metadata:allocatableid', - 'createdbyid' => 'privacy:metadata:createdbyid', + 'allocatableid' => 'privacy:metadata:allocatableid', + 'createdbyid' => 'privacy:metadata:createdbyid', 'personal_deadline' => 'privacy:metadata:personal_deadline', - 'allocatableuser' => 'privacy:metadata:userid', - 'allocatablegroup' => 'privacy:metadata:groupid' + 'allocatableuser' => 'privacy:metadata:userid', + 'allocatablegroup' => 'privacy:metadata:groupid' ]; $modagreements = [ - 'moderatorid' => 'privacy:metadata:moderatorid', - 'agreement' => 'privacy:metadata:agreement', - 'modcomment' => 'privacy:metadata:modcomment', - 'timecreated' => 'privacy:metadata:timecreated', - 'timemodified' => 'timemodified' + 'moderatorid' => 'privacy:metadata:moderatorid', + 'agreement' => 'privacy:metadata:agreement', + 'modcomment' => 'privacy:metadata:modcomment', + 'timecreated' => 'privacy:metadata:timecreated', + 'timemodified' => 'timemodified' ]; $plagiarismflags = [ - 'createdby' => 'privacy:metadata:createdby', - 'comment' => 'privacy:metadata:comment', - 'timecreated' => 'privacy:metadata:timecreated', - 'timemodified' => 'timemodified' + 'createdby' => 'privacy:metadata:createdby', + 'comment' => 'privacy:metadata:comment', + 'timecreated' => 'privacy:metadata:timecreated', + 'timemodified' => 'timemodified' ]; $collection->add_database_table('coursework_feedbacks', $feedbacks, 'privacy:metadata:feedbacks'); $collection->add_database_table('coursework_submissions', $submissions, 'privacy:metadata:submissions'); diff --git a/classes/render_helpers/grading_report/cells/_user_cell.php b/classes/render_helpers/grading_report/cells/_user_cell.php index dd089ee2..38b49c4a 100644 --- a/classes/render_helpers/grading_report/cells/_user_cell.php +++ b/classes/render_helpers/grading_report/cells/_user_cell.php @@ -74,7 +74,7 @@ public function get_table_header($options = array()) { //adding this line so that the sortable heading function will make a sortable link unique to the table //if tablename is set - $tablename = (!empty($options['tablename'])) ? $options['tablename'] : '' ; + $tablename = (!empty($options['tablename'])) ? $options['tablename'] : '' ; // allow to sort users only if CW is not set to blind marking or a user has capability to view anonymous if($viewanonymous || !$this->coursework->blindmarking) { diff --git a/classes/render_helpers/grading_report/cells/cell_base.php b/classes/render_helpers/grading_report/cells/cell_base.php index 8e8dc42e..78079969 100644 --- a/classes/render_helpers/grading_report/cells/cell_base.php +++ b/classes/render_helpers/grading_report/cells/cell_base.php @@ -61,7 +61,7 @@ protected function helper_sortable_heading($display_name, $field, $sort_how, $so $params = array('id' => optional_param('id', 0, PARAM_INT)); - $tablename = (!empty($tablename)) ? $tablename.'_' : '' ; + $tablename = (!empty($tablename)) ? $tablename.'_' : '' ; if (optional_param($tablename.'page', 0, PARAM_INT) > 0) { $params[$tablename.'page'] = optional_param($tablename.'page', 0, PARAM_INT); diff --git a/classes/render_helpers/grading_report/cells/group_cell.php b/classes/render_helpers/grading_report/cells/group_cell.php index 91cd7c30..fc9e9464 100644 --- a/classes/render_helpers/grading_report/cells/group_cell.php +++ b/classes/render_helpers/grading_report/cells/group_cell.php @@ -76,7 +76,7 @@ public function get_table_header($options = array()) { //adding this line so that the sortable heading function will make a sortable link unique to the table //if tablename is set - $tablename = (isset($options['tablename'])) ? $options['tablename'] : '' ; + $tablename = (isset($options['tablename'])) ? $options['tablename'] : '' ; return $this->helper_sortable_heading(get_string('tableheadgroups', 'coursework'), 'groupname', diff --git a/classes/render_helpers/grading_report/cells/idnumber_cell.php b/classes/render_helpers/grading_report/cells/idnumber_cell.php index 742dc7db..f9b78bec 100644 --- a/classes/render_helpers/grading_report/cells/idnumber_cell.php +++ b/classes/render_helpers/grading_report/cells/idnumber_cell.php @@ -54,7 +54,7 @@ public function get_table_header($options = array()) { //adding this line so that the sortable heading function will make a sortable link unique to the table //if tablename is set - $tablename = (!empty($options['tablename'])) ? $options['tablename'] : '' ; + $tablename = (!empty($options['tablename'])) ? $options['tablename'] : '' ; // allow to sort users only if CW is not set to blind marking or a user has capability to view anonymous if($viewanonymous || !$this->coursework->blindmarking) { 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 b7d787ba..ab57ee56 100644 --- a/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php +++ b/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php @@ -70,7 +70,7 @@ public function get_table_cell($rowobject) { $ability = new ability(user::find($USER), $rowobject->get_coursework()); $content = ''; - $moderation = ''; + $moderation = ''; if ($rowobject->has_submission()) { if ($rowobject->get_single_feedback()){ $moderation = $this->stage->get_moderation_for_feedback($rowobject->get_single_feedback()); diff --git a/classes/render_helpers/grading_report/cells/moderation_cell.php b/classes/render_helpers/grading_report/cells/moderation_cell.php index 6b338ce4..1ae0331a 100644 --- a/classes/render_helpers/grading_report/cells/moderation_cell.php +++ b/classes/render_helpers/grading_report/cells/moderation_cell.php @@ -89,7 +89,7 @@ public function get_table_header($options = array()) { //adding this line so that the sortable heading function will make a sortable link unique to the table //if tablename is set - $tablename = (!empty($options['tablename'])) ? $options['tablename'] : '' ; + $tablename = (!empty($options['tablename'])) ? $options['tablename'] : '' ; return $this->helper_sortable_heading(get_string('moderator', 'coursework'), 'modgrade', 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 09d1e420..b6714358 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 @@ -174,7 +174,7 @@ public function get_table_header($options = array()) { //adding this line so that the sortable heading function will make a sortable link unique to the table //if tablename is set - $tablename = (isset($options['tablename'])) ? $options['tablename'] : '' ; + $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); 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 1b1060f7..cedfa016 100644 --- a/classes/render_helpers/grading_report/cells/personal_deadline_cell.php +++ b/classes/render_helpers/grading_report/cells/personal_deadline_cell.php @@ -84,7 +84,7 @@ public function get_table_cell($row_object) { */ public function get_table_header($options = array()) { - $tablename = (!empty($options['tablename'])) ? $options['tablename'] : '' ; + $tablename = (!empty($options['tablename'])) ? $options['tablename'] : '' ; return $this->helper_sortable_heading(get_string('tableheadpersonaldeadline', 'coursework'), 'personaldeadline', 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 5e8d6085..e23dd800 100644 --- a/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php +++ b/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php @@ -54,7 +54,7 @@ public function get_table_cell($rowobject) { $plagiarism_flag_params = array( 'submissionid' => $rowobject->get_submission()->id ); - $plagiarism_flag = plagiarism_flag::find($plagiarism_flag_params); + $plagiarism_flag = plagiarism_flag::find($plagiarism_flag_params); if(!$plagiarism_flag){ // if plagiarism flag for this submission doesn't exist, we can create one $plagiarism_flag_params = array('courseworkid' => $rowobject->get_coursework()->id, diff --git a/classes/render_helpers/grading_report/cells/submission_cell.php b/classes/render_helpers/grading_report/cells/submission_cell.php index b5561eda..01bc85c1 100644 --- a/classes/render_helpers/grading_report/cells/submission_cell.php +++ b/classes/render_helpers/grading_report/cells/submission_cell.php @@ -136,7 +136,7 @@ public function get_table_cell($rowobject) { */ public function get_table_header($options = array()) { - $tablename = (isset($options['tablename'])) ? $options['tablename'] : '' ; + $tablename = (isset($options['tablename'])) ? $options['tablename'] : '' ; $fileid = $this->helper_sortable_heading(get_string('tableheadid', 'coursework'), 'hash', 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 906caa4a..43572a13 100644 --- a/classes/render_helpers/grading_report/cells/time_submitted_cell.php +++ b/classes/render_helpers/grading_report/cells/time_submitted_cell.php @@ -82,7 +82,7 @@ public function prepare_content_cell($row_object) { // check if submission has personal deadline if ($coursework->personaldeadlineenabled ){ - $deadline = $submission->submission_personal_deadline(); + $deadline = $submission->submission_personal_deadline(); } else { // if not, use coursework default deadline $deadline = $coursework->deadline; } @@ -202,7 +202,7 @@ public function get_table_header($options = array()) { //adding this line so that the sortable heading function will make a sortable link unique to the table //if tablename is set - $tablename = (!empty($options['tablename'])) ? $options['tablename'] : '' ; + $tablename = (!empty($options['tablename'])) ? $options['tablename'] : '' ; return $this->helper_sortable_heading(get_string('tableheadsubmissiondate', 'coursework'), 'timesubmitted', diff --git a/classes/render_helpers/grading_report/cells/user_cell.php b/classes/render_helpers/grading_report/cells/user_cell.php index 9692fd46..0bd048ff 100644 --- a/classes/render_helpers/grading_report/cells/user_cell.php +++ b/classes/render_helpers/grading_report/cells/user_cell.php @@ -56,9 +56,9 @@ public function get_table_cell($rowobject) { // TODO CSS for the space!! $content .= ' ' . $rowobject->get_user_name(true); $content .= "
".$rowobject->get_email(); - $user = $rowobject->get_allocatable(); + $user = $rowobject->get_allocatable(); /* - $candidatenumber = $user->candidate_number(); + $candidatenumber = $user->candidate_number(); if (!empty($candidatenumber)) { @@ -81,7 +81,7 @@ public function get_table_header($options = array()) { //adding this line so that the sortable heading function will make a sortable link unique to the table //if tablename is set - $tablename = (!empty($options['tablename'])) ? $options['tablename'] : '' ; + $tablename = (!empty($options['tablename'])) ? $options['tablename'] : '' ; // allow to sort users only if CW is not set to blind marking or a user has capability to view anonymous if($viewanonymous || !$this->coursework->blindmarking) { diff --git a/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php b/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php index aa476358..7f49d599 100644 --- a/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php +++ b/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php @@ -136,7 +136,7 @@ protected function render_assessor_feedback_table(assessor_feedback_table $asses '; } else { - $assessor_details = (empty($feedback_row->get_assessor()->id()) && $coursework->allocation_enabled()) ? + $assessor_details = (empty($feedback_row->get_assessor()->id()) && $coursework->allocation_enabled()) ? get_string('assessornotallocated','mod_coursework') : $this->profile_link($feedback_row); $output_rows .= @@ -150,7 +150,7 @@ protected function render_assessor_feedback_table(assessor_feedback_table $asses if (!empty($output_rows)) { - $allocation_string = ($coursework->allocation_enabled())? + $allocation_string = ($coursework->allocation_enabled())? get_string('allocatedtoassessor', 'mod_coursework'): get_string('assessor', 'mod_coursework'); /* @@ -351,7 +351,7 @@ protected function comment_for_row($feedback_row, $ability) { } } - $grade_editing = get_config('mod_coursework','coursework_grade_editing'); + $grade_editing = get_config('mod_coursework','coursework_grade_editing'); if ($ability->can('edit', $feedback_row->get_feedback()) && !$submission->already_published()) { diff --git a/classes/renderers/personal_deadline_renderer.php b/classes/renderers/personal_deadline_renderer.php index 7a949aa8..2c4b20be 100644 --- a/classes/renderers/personal_deadline_renderer.php +++ b/classes/renderers/personal_deadline_renderer.php @@ -44,12 +44,12 @@ public function new_page($vars) { $PAGE->set_title($SITE->fullname); $PAGE->set_heading($SITE->fullname); - $html = ''; + $html = ''; //if page has been accessed via the set personal deadline page then we dont want to say who set the last personal //deadline if (empty($vars['params']['multipleuserdeadlines'])) { - $allocatable = $vars['personal_deadline']->get_allocatable(); + $allocatable = $vars['personal_deadline']->get_allocatable(); $createdby = $DB->get_record('user', array('id' => $vars['personal_deadline']->createdbyid)); $lasteditedby = $DB->get_record('user', array('id' => $vars['personal_deadline']->lastmodifiedbyid)); diff --git a/classes/sample_set_rule/range_sample_type.php b/classes/sample_set_rule/range_sample_type.php index 446f98e7..4f3dc26f 100644 --- a/classes/sample_set_rule/range_sample_type.php +++ b/classes/sample_set_rule/range_sample_type.php @@ -56,22 +56,22 @@ public function add_form_elements($assessor_number=0) { global $DB; - $html = ''; + $html = ''; - $sql = "SELECT sr.* + $sql = "SELECT sr.* FROM {coursework_sample_set_rules} sr, {coursework_sample_set_plugin} sp - WHERE sr.sample_set_plugin_id = sp.id + WHERE sr.sample_set_plugin_id = sp.id AND sr.courseworkid = {$this->coursework->id} AND sr.stage_identifier = 'assessor_{$assessor_number}' AND sp.rulename = 'range_sample_type'"; - $rulesfound = false; + $rulesfound = false; - $samplerecords = $DB->get_records_sql($sql); + $samplerecords = $DB->get_records_sql($sql); if (!empty($samplerecords)) { - $seq = 0; + $seq = 0; foreach($samplerecords as $record) { $html .= $this->range_elements($assessor_number,$seq,$record); $seq++; @@ -101,30 +101,30 @@ public function range_elements($assessor_number,$sequence,$dbrecord=false) { $percentage_options[$i] = "{$i}"; } - $scale = array(); + $scale = array(); if ($this->coursework->grade > 0) { for($i=0;$i <= $this->coursework->grade; $i++) { - $scale[] = $i; + $scale[] = $i; } } else { - $grade_scale = \grade_scale::fetch(array('id' => abs($this->coursework->grade))); - $scale = explode(",",$grade_scale->scale); + $grade_scale = \grade_scale::fetch(array('id' => abs($this->coursework->grade))); + $scale = explode(",",$grade_scale->scale); } if ($dbrecord) { - $selected_type = array($dbrecord->ruletype=>get_string($dbrecord->ruletype, 'mod_coursework')); - $selected_to = ($dbrecord->ruletype == 'scale') ? array($dbrecord->upperlimit=>$scale[$dbrecord->upperlimit]) : array($dbrecord->upperlimit=>$dbrecord->upperlimit); + $selected_type = array($dbrecord->ruletype=>get_string($dbrecord->ruletype, 'mod_coursework')); + $selected_to = ($dbrecord->ruletype == 'scale') ? array($dbrecord->upperlimit=>$scale[$dbrecord->upperlimit]) : array($dbrecord->upperlimit=>$dbrecord->upperlimit); - $selected_from = ($dbrecord->ruletype == 'scale') ? array($dbrecord->lowerlimit=>$scale[$dbrecord->lowerlimit]) : array($dbrecord->lowerlimit=>$dbrecord->lowerlimit); + $selected_from = ($dbrecord->ruletype == 'scale') ? array($dbrecord->lowerlimit=>$scale[$dbrecord->lowerlimit]) : array($dbrecord->lowerlimit=>$dbrecord->lowerlimit); - $rules_checked = ($dbrecord) ? true : false; + $rules_checked = ($dbrecord) ? true : false; } else { - $selected_type = array('percentage'=>get_string('percentage', 'mod_coursework')); - $selected_to = array('100'=>'100'); - $selected_from = array('0'=>'0');; - $rules_checked = false; + $selected_type = array('percentage'=>get_string('percentage', 'mod_coursework')); + $selected_to = array('100'=>'100'); + $selected_from = array('0'=>'0');; + $rules_checked = false; } @@ -134,8 +134,8 @@ public function range_elements($assessor_number,$sequence,$dbrecord=false) { array('id' => "assessor_{$assessor_number}_samplerules_{$sequence}", 'class' => "assessor_{$assessor_number} range_grade_checkbox sample_set_rule")); - $grade_scale_text = ($this->coursework->grade < 0) ? get_string('scale', 'mod_coursework') : get_string('grade', 'mod_coursework') ; - $grade_scale_val = ($this->coursework->grade < 0) ? 'scale' : 'grade'; + $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'; $options = array('percentage' => get_string('percentage', 'mod_coursework'), $grade_scale_val => $grade_scale_text); @@ -175,9 +175,9 @@ public function range_elements($assessor_number,$sequence,$dbrecord=false) { public function add_form_elements_js($assessor_number=0) { - $js_script = " + $js_script = " - var AUTOMATIC_SAMPLING = 1; + var AUTOMATIC_SAMPLING = 1; //add grade rule buttons $('.addgradderule').each(function(e,element) { @@ -234,7 +234,7 @@ public function add_form_elements_js($assessor_number=0) { var linkid = $(this).attr('id').split('_'); - var spanclass = 'div.'+linkid[0] + '_' + linkid[1] +'_grade_rules'; + var spanclass = 'div.'+linkid[0] + '_' + linkid[1] +'_grade_rules'; if ($('#'+linkid[0] + '_' + linkid[1] + '_samplingstrategy').val() == AUTOMATIC_SAMPLING) { @@ -253,12 +253,12 @@ public function add_form_elements_js($assessor_number=0) { $('.range_grade_checkbox').each(function(e,element) { - var ele_id = $(this).attr('id').split('_'); - var sampletypeid = '#'+ele_id[0]+'_'+ele_id[1]+'_sampletype_'+ele_id[3]; - var samplefromid = '#'+ele_id[0]+'_'+ele_id[1]+'_samplefrom_'+ele_id[3]; - var sampletoid = '#'+ele_id[0]+'_'+ele_id[1]+'_sampleto_'+ele_id[3]; + var ele_id = $(this).attr('id').split('_'); + var sampletypeid = '#'+ele_id[0]+'_'+ele_id[1]+'_sampletype_'+ele_id[3]; + var samplefromid = '#'+ele_id[0]+'_'+ele_id[1]+'_samplefrom_'+ele_id[3]; + var sampletoid = '#'+ele_id[0]+'_'+ele_id[1]+'_sampleto_'+ele_id[3]; - var disabled = !$(this).prop('checked'); + var disabled = !$(this).prop('checked'); $(sampletypeid).attr('disabled',disabled); $(samplefromid).attr('disabled',disabled); @@ -267,12 +267,12 @@ public function add_form_elements_js($assessor_number=0) { $(element).on('change',function() { - var ele_id = $(this).attr('id').split('_'); - var sampletypeid = '#'+ele_id[0]+'_'+ele_id[1]+'_sampletype_'+ele_id[3]; - var samplefromid = '#'+ele_id[0]+'_'+ele_id[1]+'_samplefrom_'+ele_id[3]; - var sampletoid = '#'+ele_id[0]+'_'+ele_id[1]+'_sampleto_'+ele_id[3]; + var ele_id = $(this).attr('id').split('_'); + var sampletypeid = '#'+ele_id[0]+'_'+ele_id[1]+'_sampletype_'+ele_id[3]; + var samplefromid = '#'+ele_id[0]+'_'+ele_id[1]+'_samplefrom_'+ele_id[3]; + var sampletoid = '#'+ele_id[0]+'_'+ele_id[1]+'_sampleto_'+ele_id[3]; - var disabled = !$(this).prop('checked'); + var disabled = !$(this).prop('checked'); $(sampletypeid).attr('disabled',disabled); $(samplefromid).attr('disabled',disabled); @@ -293,12 +293,12 @@ public function add_form_elements_js($assessor_number=0) { function change_options(element) { - var PERCENT = 'percentage'; + var PERCENT = 'percentage'; - var ele_id = $(element).attr('id').split('_'); + var ele_id = $(element).attr('id').split('_'); - var samplefromid = '#'+ele_id[0]+'_'+ele_id[1]+'_samplefrom_'+ele_id[3]; - var sampletoid = '#'+ele_id[0]+'_'+ele_id[1]+'_sampleto_'+ele_id[3]; + var samplefromid = '#'+ele_id[0]+'_'+ele_id[1]+'_samplefrom_'+ele_id[3]; + var sampletoid = '#'+ele_id[0]+'_'+ele_id[1]+'_sampleto_'+ele_id[3]; //remove the contents from the grade rule from and to drop downs @@ -314,7 +314,7 @@ function change_options(element) { selectValues[i] = (i*10); } } else { - var selectValues = $('#scale_values').val().split(','); + var selectValues = $('#scale_values').val().split(','); type = 1; } @@ -355,12 +355,12 @@ public function save_form_data($assessor_number=0,&$order=0) { global $DB; - $sample_rules = optional_param_array("assessor_{$assessor_number}_samplerules",false,PARAM_RAW); - $sample_type = optional_param_array("assessor_{$assessor_number}_sampletype",false,PARAM_RAW); - $sample_from = optional_param_array("assessor_{$assessor_number}_samplefrom",false,PARAM_RAW); - $sample_to = optional_param_array("assessor_{$assessor_number}_sampleto",false,PARAM_RAW); + $sample_rules = optional_param_array("assessor_{$assessor_number}_samplerules",false,PARAM_RAW); + $sample_type = optional_param_array("assessor_{$assessor_number}_sampletype",false,PARAM_RAW); + $sample_from = optional_param_array("assessor_{$assessor_number}_samplefrom",false,PARAM_RAW); + $sample_to = optional_param_array("assessor_{$assessor_number}_sampleto",false,PARAM_RAW); - $sample_plugin = $DB->get_record('coursework_sample_set_plugin',array('rulename'=>'range_sample_type')); + $sample_plugin = $DB->get_record('coursework_sample_set_plugin',array('rulename'=>'range_sample_type')); if ($sample_rules) { foreach ($sample_rules as $i => $val) { @@ -372,8 +372,8 @@ public function save_form_data($assessor_number=0,&$order=0) { $dbrecord->upperlimit = $sample_to[$i]; $dbrecord->sample_set_plugin_id = $sample_plugin->id; $dbrecord->courseworkid = $this->coursework->id; - $dbrecord->ruleorder = $order; - $dbrecord->stage_identifier = "assessor_{$assessor_number}"; + $dbrecord->ruleorder = $order; + $dbrecord->stage_identifier = "assessor_{$assessor_number}"; $DB->insert_record("coursework_sample_set_rules", $dbrecord); $order++; @@ -389,27 +389,27 @@ public function adjust_sample_set($stage_number,&$allocatables,&$manual_sample_s global $DB; - $stage = "assessor_".$stage_number; + $stage = "assessor_".$stage_number; - $sql = "SELECT r.*,p.rulename + $sql = "SELECT r.*,p.rulename FROM {coursework_sample_set_plugin} p, {coursework_sample_set_rules} r - WHERE p.id = r.sample_set_plugin_id + WHERE p.id = r.sample_set_plugin_id AND r.courseworkid = :courseworkid AND p.rulename = 'range_sample_type' AND stage_identifier = :stage ORDER BY ruleorder"; - $ruleinstance = $DB->get_records_sql($sql,array('courseworkid'=>$this->coursework->id,'stage'=>$stage)); + $ruleinstance = $DB->get_records_sql($sql,array('courseworkid'=>$this->coursework->id,'stage'=>$stage)); foreach($ruleinstance as $ri) { - $limit = $this->rationalise($ri->ruletype,$ri->lowerlimit,$ri->upperlimit); + $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]); + $previous_stage = $stage_number-1; + $allocatables_in_range = $this->get_allocatables_in_range("assessor_".$previous_stage,$limit[0],$limit[1]); $finalised = $this->finalised_submissions(); $published = $this->released_submissions(); @@ -428,11 +428,11 @@ private function rationalise($ruletype,$limit1,$limit2) { global $DB; - $limits = array(); + $limits = array(); - $limits[0] = ($limit1>$limit2) ? $limit2 : $limit1; - $limits[1] = ($limit1>$limit2) ? $limit1 : $limit2; + $limits[0] = ($limit1>$limit2) ? $limit2 : $limit1; + $limits[1] = ($limit1>$limit2) ? $limit1 : $limit2; if ($ruletype == 'scale') { ++$limits[0]; @@ -444,19 +444,19 @@ private function rationalise($ruletype,$limit1,$limit2) { $limits[0] = $this->coursework->grade * $limits[0] / 100; $limits[1] = $this->coursework->grade * $limits[1] / 100; } else { - $scale = $DB->get_record("scale",array('id'=>abs($this->coursework->grade))); + $scale = $DB->get_record("scale",array('id'=>abs($this->coursework->grade))); if ($scale) { - $coursework_scale = explode(",",$scale->scale); + $coursework_scale = explode(",",$scale->scale); - $number_of_items = count($coursework_scale); + $number_of_items = count($coursework_scale); - $weighting = 100 / $number_of_items; // shall we round it???? + $weighting = 100 / $number_of_items; // shall we round it???? - $limits[0] = ceil($limits[0]/$weighting); // element of array - $limits[1] = ceil($limits[1]/$weighting); // element of array + $limits[0] = ceil($limits[0]/$weighting); // element of array + $limits[1] = ceil($limits[1]/$weighting); // element of array //note we have to add one as the values are not stored in there element positions diff --git a/classes/sample_set_rule/sample_base.php b/classes/sample_set_rule/sample_base.php index b6998e41..26fc0670 100644 --- a/classes/sample_set_rule/sample_base.php +++ b/classes/sample_set_rule/sample_base.php @@ -97,7 +97,7 @@ abstract class sample_base { function __construct($coursework) { - $this->coursework = $coursework; + $this->coursework = $coursework; } diff --git a/classes/sample_set_rule/total_sample_type.php b/classes/sample_set_rule/total_sample_type.php index 1441cdc5..e2bd2345 100644 --- a/classes/sample_set_rule/total_sample_type.php +++ b/classes/sample_set_rule/total_sample_type.php @@ -55,16 +55,16 @@ public function add_form_elements($assessor_number=0) { global $DB; - $sql = "SELECT sr.* + $sql = "SELECT sr.* FROM {coursework_sample_set_rules} sr, {coursework_sample_set_plugin} sp - WHERE sr.sample_set_plugin_id = sp.id + WHERE sr.sample_set_plugin_id = sp.id AND sr.courseworkid = {$this->coursework->id} AND sr.stage_identifier = 'assessor_{$assessor_number}' AND sp.rulename = 'total_sample_type'"; - $selected = ($record = $DB->get_record_sql($sql)) ? array($record->upperlimit=>$record->upperlimit) : false; - $checked = ($selected) ? true : false; + $selected = ($record = $DB->get_record_sql($sql)) ? array($record->upperlimit=>$record->upperlimit) : false; + $checked = ($selected) ? true : false; @@ -74,7 +74,7 @@ public function add_form_elements($assessor_number=0) { $percentage_options[$i] = "{$i}"; } - $html = html_writer::start_div('sampletotal'); + $html = html_writer::start_div('sampletotal'); $html .= html_writer::checkbox("assessor_{$assessor_number}_sampletotal_checkbox",1,$checked,get_string('topupto','mod_coursework'), array('id'=>"assessor_{$assessor_number}_sampletotal_checkbox",'class'=>"assessor_{$assessor_number} total_checkbox sample_set_rule")); @@ -98,20 +98,20 @@ public function add_form_elements($assessor_number=0) { public function add_form_elements_js($assessor_number=0) { - $js_script = " + $js_script = " $('.total_checkbox').each(function(e,element) { - var ele_id = $(this).attr('id').split('_'); - var sampletotal = '#'+ele_id[0]+'_'+ele_id[1]+'_sampletotal'; - var disabled = !$(this).prop('checked'); + var ele_id = $(this).attr('id').split('_'); + var sampletotal = '#'+ele_id[0]+'_'+ele_id[1]+'_sampletotal'; + var disabled = !$(this).prop('checked'); $(sampletotal).attr('disabled',disabled); $(element).on('change',function() { - var ele_id = $(this).attr('id').split('_'); - var sampletotal = '#'+ele_id[0]+'_'+ele_id[1]+'_sampletotal'; - var disabled = !$(this).prop('checked'); + var ele_id = $(this).attr('id').split('_'); + var sampletotal = '#'+ele_id[0]+'_'+ele_id[1]+'_sampletotal'; + var disabled = !$(this).prop('checked'); $(sampletotal).attr('disabled',disabled); }) @@ -126,8 +126,8 @@ public function add_form_elements_js($assessor_number=0) { function save_form_data($assessor_number=0,&$order=0) { global $DB; - $total_checkbox = optional_param("assessor_{$assessor_number}_sampletotal_checkbox",false,PARAM_INT); - $sample_total = optional_param("assessor_{$assessor_number}_sampletotal",false,PARAM_INT); + $total_checkbox = optional_param("assessor_{$assessor_number}_sampletotal_checkbox",false,PARAM_INT); + $sample_total = optional_param("assessor_{$assessor_number}_sampletotal",false,PARAM_INT); if ($total_checkbox) { @@ -157,26 +157,26 @@ public function adjust_sample_set($stage_number,&$allocatables,&$manual_sample_s global $DB; - $stage = "assessor_".$stage_number; + $stage = "assessor_".$stage_number; - $sql = "SELECT r.*,p.rulename + $sql = "SELECT r.*,p.rulename FROM {coursework_sample_set_plugin} p, {coursework_sample_set_rules} r - WHERE p.id = r.sample_set_plugin_id + WHERE p.id = r.sample_set_plugin_id AND r.courseworkid = :courseworkid AND p.rulename = 'total_sample_type' AND stage_identifier = :stage ORDER BY ruleorder"; - $rule = $DB->get_record_sql($sql,array('courseworkid'=>$this->coursework->id,'stage'=>$stage)); + $rule = $DB->get_record_sql($sql,array('courseworkid'=>$this->coursework->id,'stage'=>$stage)); if ($rule) { $finalised = $this->finalised_submissions(); $published = $this->released_submissions(); - $number_of_alloctables = count($allocatables); + $number_of_alloctables = count($allocatables); - $total_to_return = ceil(($rule->upperlimit/100) * $number_of_alloctables); + $total_to_return = ceil(($rule->upperlimit/100) * $number_of_alloctables); //we include the manual sample set in the count // TODO: should we do this? @@ -233,7 +233,7 @@ public function adjust_sample_set($stage_number,&$allocatables,&$manual_sample_s $array_keys = array_rand($allocatable_sample_set, $total_to_return - count($auto_sample_set)); - if (!is_array($array_keys)) $array_keys = array($array_keys); + if (!is_array($array_keys)) $array_keys = array($array_keys); //use the allocatables array to get other ungraded allocatables foreach ($array_keys as $id) { diff --git a/classes/stages/base.php b/classes/stages/base.php index 82ca93f7..004adba8 100644 --- a/classes/stages/base.php +++ b/classes/stages/base.php @@ -299,7 +299,7 @@ public function allocation_is_manual($allocatable) { public function get_teachers() { $cache = \cache::make('mod_coursework', 'courseworkdata'); - $serialised_teachers = $cache->get($this->coursework->id()."_teachers"); + $serialised_teachers = $cache->get($this->coursework->id()."_teachers"); //there is a chance that when the teachers were initially cached the dataset was empty //so check again @@ -312,7 +312,7 @@ public function get_teachers() { $cache->set($this->coursework->id()."_teachers", serialize($teacher_users)); } else { - $teacher_users = unserialize($serialised_teachers); + $teacher_users = unserialize($serialised_teachers); } return $teacher_users; @@ -572,7 +572,7 @@ public function remove_allocatable_from_sampling($allocatable) { public function user_is_assessor($assessor) { if (!isset(self::$self_cache['user_is_assessor'][$this->coursework->id][$assessor->id])) { $enrolled = is_enrolled($this->coursework->get_course_context(), $assessor, $this->assessor_capability()); - $res = $enrolled || is_primary_admin($assessor->id); + $res = $enrolled || is_primary_admin($assessor->id); self::$self_cache['user_is_assessor'][$this->coursework->id][$assessor->id] = $res; } return self::$self_cache['user_is_assessor'][$this->coursework->id][$assessor->id]; @@ -802,9 +802,9 @@ public function potential_marker_dropdown($allocatable) { $option_for_nothing_chosen_yet = array('' => get_string($identifier, 'mod_coursework')); - $dropdown_name = $this->assessor_dropdown_name($allocatable); + $dropdown_name = $this->assessor_dropdown_name($allocatable); - $selected = $this->selected_allocation_in_session($dropdown_name); + $selected = $this->selected_allocation_in_session($dropdown_name); $assessor_dropdown = \html_writer::select($this->assessor_dropdown_options, @@ -830,9 +830,9 @@ public function potential_moderator_dropdown($allocatable) { 'class' => 'moderator_id_dropdown', ); - $dropdown_name = $this->assessor_dropdown_name($allocatable); + $dropdown_name = $this->assessor_dropdown_name($allocatable); - $selected = $this->selected_allocation_in_session($dropdown_name); + $selected = $this->selected_allocation_in_session($dropdown_name); return $moderator_dropdown = \html_writer::select($this->potential_moderators_as_options_array(), 'allocatables[' . $allocatable->id . '][moderator][assessor_id]', @@ -929,7 +929,7 @@ private function in_editable_period($allocatable) { submission::fill_pool_coursework($coursework_id); $submission = submission::get_object($coursework_id, 'allocatableid-allocatabletype', [$allocatable->id(), $allocatable->type()]); - $feedback = $this->get_feedback_for_submission($submission); + $feedback = $this->get_feedback_for_submission($submission); if ($feedback) { $result += $feedback->timecreated; } @@ -943,7 +943,7 @@ private function in_editable_period($allocatable) { private function selected_allocation_in_session($dropdownname) { global $SESSION; - $cm = $this->coursework->get_course_module(); + $cm = $this->coursework->get_course_module(); if (!empty($SESSION->coursework_allocationsessions[$cm->id])) { diff --git a/classes/task/enrol_task.php b/classes/task/enrol_task.php index 513fc1b7..f85f8484 100644 --- a/classes/task/enrol_task.php +++ b/classes/task/enrol_task.php @@ -44,7 +44,7 @@ public function execute() { global $DB; - $courseworkids = $DB->get_records('coursework',array('processenrol'=>1)); + $courseworkids = $DB->get_records('coursework',array('processenrol'=>1)); if (!empty($courseworkids)) { foreach ($courseworkids as $courseworkid) { diff --git a/classes/task/unenrol_task.php b/classes/task/unenrol_task.php index e19fa2ab..a23485a6 100644 --- a/classes/task/unenrol_task.php +++ b/classes/task/unenrol_task.php @@ -44,7 +44,7 @@ public function execute() { global $DB; - $courseworkids = $DB->get_records('coursework',array('processunenrol'=>1)); + $courseworkids = $DB->get_records('coursework',array('processunenrol'=>1)); if (!empty($courseworkids)) { foreach ($courseworkids as $courseworkid) { diff --git a/classes/warnings.php b/classes/warnings.php index c210d5cb..ea1a8421 100644 --- a/classes/warnings.php +++ b/classes/warnings.php @@ -173,7 +173,7 @@ public function students_in_mutiple_grouos() { } if(!empty($studentmessage)) { - $message = '
'; + $message = '
'; $message .= '

' . get_string('studentsinmultiplegroups', 'mod_coursework') . '

'; $message .= '
    '; $message .= $studentmessage; diff --git a/db/events.php b/db/events.php index 0e5fc502..a08a2052 100644 --- a/db/events.php +++ b/db/events.php @@ -27,25 +27,25 @@ $observers = array( array( - 'eventname' => '\core\event\role_assigned', - 'callback' => 'mod_coursework_observer::autoallocate_when_user_added', + 'eventname' => '\core\event\role_assigned', + 'callback' => 'mod_coursework_observer::autoallocate_when_user_added', ), array( - 'eventname' => '\core\event\role_unassigned', - 'callback' => 'mod_coursework_observer::autoallocate_when_user_removed', + 'eventname' => '\core\event\role_unassigned', + 'callback' => 'mod_coursework_observer::autoallocate_when_user_removed', ), array( - 'eventname' => '\mod_coursework\event\coursework_deadline_changed', - 'callback' => 'mod_coursework_observer::coursework_deadline_changed', + 'eventname' => '\mod_coursework\event\coursework_deadline_changed', + 'callback' => 'mod_coursework_observer::coursework_deadline_changed', 'schedule' => 'cron' ), array( - 'eventname' => '\core\event\course_module_updated', - 'callback' => 'mod_coursework_observer::process_allocation_after_update', + 'eventname' => '\core\event\course_module_updated', + 'callback' => 'mod_coursework_observer::process_allocation_after_update', ), array( - 'eventname' => '\core\event\course_module_created', - 'callback' => 'mod_coursework_observer::process_allocation_after_creation', + 'eventname' => '\core\event\course_module_created', + 'callback' => 'mod_coursework_observer::process_allocation_after_creation', ), array( 'eventname' => '\core\event\group_member_added', diff --git a/db/install.php b/db/install.php index 663cd347..46076d8e 100644 --- a/db/install.php +++ b/db/install.php @@ -34,9 +34,9 @@ function xmldb_coursework_install() { //install the plugins used by sampling in the correct order - $plugins = array('range_sample_type','total_sample_type'); + $plugins = array('range_sample_type','total_sample_type'); - $i = 1; + $i = 1; foreach($plugins as $p) { $dbrecord = new \stdClass(); diff --git a/db/upgrade.php b/db/upgrade.php index f18c6985..f2c3a1a2 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -2005,9 +2005,9 @@ function xmldb_coursework_upgrade($oldversion) { //now create plugin records for sample set plugins - $plugins = array('range_sample_type','total_sample_type'); + $plugins = array('range_sample_type','total_sample_type'); - $i = 1; + $i = 1; foreach($plugins as $p) { $dbrecord = new \stdClass(); @@ -2221,7 +2221,7 @@ function xmldb_coursework_upgrade($oldversion) { // Define table coursework_sample_set_mbrs to be created. $table = new xmldb_table('coursework'); - $upgradefield = new xmldb_field('submissionnotification', XMLDB_TYPE_TEXT, null, null, null, null, null); + $upgradefield = new xmldb_field('submissionnotification', XMLDB_TYPE_TEXT, null, null, null, null, null); if (!$dbman->field_exists($table, $upgradefield)) { $dbman->add_field($table, $upgradefield); @@ -2527,7 +2527,7 @@ function xmldb_coursework_upgrade($oldversion) { // Define table coursework_plagiarism_flag to be created. $table = new xmldb_table('coursework'); - $field = $table->add_field('renamefiles',XMLDB_TYPE_INTEGER,'1',null,null,null,null); + $field = $table->add_field('renamefiles',XMLDB_TYPE_INTEGER,'1',null,null,null,null); // Conditionally launch add field. if (!$dbman->field_exists($table, $field)) { @@ -2535,13 +2535,13 @@ function xmldb_coursework_upgrade($oldversion) { } - $courseworkinstances = $DB->get_records('coursework'); + $courseworkinstances = $DB->get_records('coursework'); foreach($courseworkinstances as $cwk) { $courseworkhassubmissions = ($DB->get_records('coursework_submissions', array('courseworkid' => $cwk->id))) ? true : false; - $cwk->renamefiles = ($cwk->blindmarking == 1 || $courseworkhassubmissions) ? 1 : 0 ; + $cwk->renamefiles = ($cwk->blindmarking == 1 || $courseworkhassubmissions) ? 1 : 0 ; $DB->update_record('coursework',$cwk); } diff --git a/lang/en/coursework.php b/lang/en/coursework.php index 1b4a6376..56d075ce 100644 --- a/lang/en/coursework.php +++ b/lang/en/coursework.php @@ -27,7 +27,7 @@ global $CFG; $string['access_denied'] = 'Access denied'; -$string['all'] = 'ALL'; +$string['all'] = 'ALL'; $string['aday'] = 'A day'; $string['add_rule'] = 'Add rule'; @@ -50,8 +50,8 @@ $string['agreedgradeby'] = 'Agreed grade by'; $string['agreedgradeon'] = 'Agreed grade on'; $string['agreedgradedelay'] = 'Agreed grade delay'; -$string['agreedgrademarkingdeadline'] = 'Agreed grade marking deadline'; -$string['agreedgrademarkingdeadline_help'] = 'Set the date agreed grading should be completed by'; +$string['agreedgrademarkingdeadline'] = 'Agreed grade marking deadline'; +$string['agreedgrademarkingdeadline_help'] = 'Set the date agreed grading should be completed by'; $string['agreed_marking_deadline_default'] = 'Agreed grade marking deadline'; $string['agreed_marking_deadline_default_desc'] = 'Select the default agreed grade marking deadline applied to coursework activities'; $string['agreedgradebyusername'] = 'Agreed grade by username'; @@ -95,9 +95,9 @@ $string['anonymity'] = 'Anonymity'; $string['anonymity_warning_group'] = 'The anonymity may be compromised if only some groups have their grades published.'; $string['anonymity_warning_user'] = 'The anonymity may be compromised if only some students have their grades published.'; -$string['anonymousmarking'] = 'Anonymous marking'; +$string['anonymousmarking'] = 'Anonymous marking'; $string['anonymousmarking_help'] = 'Anonymous marking will be fixed permanently once set and cannot be '. 'changed later. Remember to set the permissions so that the teacher role cannot view logs for '. 'this to be effective.'; -$string['apply'] = 'Apply'; +$string['apply'] = 'Apply'; $string['assessment_group_description'] = 'Description'; $string['assessment_group_title'] = 'Assessment Group'; $string['assessment_period_description'] = 'Description'; @@ -125,23 +125,23 @@ $string['assessormoderatorgrades'] = 'Assessor/moderator grades'; $string['assessoronedefault'] = 'Assessor 1 is included in sample by default'; $string['assessornotallocated'] = 'Assessor not allocated'; -$string['assessornotincoursework'] = 'Assessor {$a} not in the coursework'; +$string['assessornotincoursework'] = 'Assessor {$a} not in the coursework'; $string['assessorupload'] = 'Assessor {$a}'; $string['assessorallocations'] = 'Assessor allocations'; $string['assessors_no_allocated_warning'] = 'Please make sure assessors are allocated.'; -$string['attribute'] = "Attribute"; -$string['availability'] = "Availability"; -$string['automaticagreement'] = "Automatic agreement"; -$string['automaticagreementofgrades'] = "Automatic agreement of grades"; -$string['automaticagreement_desc'] = "TODO description"; -$string['automaticagreement_help'] = "Automatic grade agreement strategy for the final grade. The final grade is worked out from the initial grades based on the strategy chosen"; -$string['automaticagreementrange'] = "Automatic agreement range"; -$string['automaticagreementrange_help'] = "TODO: Automatic agreement range help"; -$string['automaticagreementrange_help'] = "TODO: Automatic agreement range help"; -$string['autopopulatefeedbackcomment'] = "Auto-populate agreed feedback comment"; -$string['autopopulatefeedbackcomment_help'] = "Pre-populate agreed feedback comment field with comments from initial marking. Please note these comments are not saved until 'Save changes' button is pressed."; -$string['grade_editing_enabled'] = "Grade editing time"; -$string['grade_editing_enabled_desc'] = "Select the amount of time that a user has to edit an initial grade after entering it"; +$string['attribute'] = "Attribute"; +$string['availability'] = "Availability"; +$string['automaticagreement'] = "Automatic agreement"; +$string['automaticagreementofgrades'] = "Automatic agreement of grades"; +$string['automaticagreement_desc'] = "TODO description"; +$string['automaticagreement_help'] = "Automatic grade agreement strategy for the final grade. The final grade is worked out from the initial grades based on the strategy chosen"; +$string['automaticagreementrange'] = "Automatic agreement range"; +$string['automaticagreementrange_help'] = "TODO: Automatic agreement range help"; +$string['automaticagreementrange_help'] = "TODO: Automatic agreement range help"; +$string['autopopulatefeedbackcomment'] = "Auto-populate agreed feedback comment"; +$string['autopopulatefeedbackcomment_help'] = "Pre-populate agreed feedback comment field with comments from initial marking. Please note these comments are not saved until 'Save changes' button is pressed."; +$string['grade_editing_enabled'] = "Grade editing time"; +$string['grade_editing_enabled_desc'] = "Select the amount of time that a user has to edit an initial grade after entering it"; $string['automaticallyinsample'] = 'Automatically included in sample'; $string['automaticallocation'] = 'Automatic allocation'; @@ -172,14 +172,14 @@ $string['config_coursework_undergraduate_cap_2_weeks'] = 'Sets the percent that the grade for '. 'undergraduates will capped by if submission is up to 2 weeks late.'; $string['config_enable_sits'] = 'This will require teachers to specify what assessment in the external '. 'records system corresponds to the coursework they are creating.'; $string['config_second_reminder'] = 'Sets the number of days before the deadline/extended deadline for the second email reminder. If the '. 'student has not completed the assignment within the reminder period, they will get an email'; -$string['configuration_needed'] = ' You are being redirected to the allocation page as further configuration is needed due to the the following: {$a->percentage} {$a->manual}'; +$string['configuration_needed'] = ' You are being redirected to the allocation page as further configuration is needed due to the the following: {$a->percentage} {$a->manual}'; $string['configextraid'] = 'Select an additional ID number to be displayed for submissions in the grading report (e.g. candidate ID).'; $string['configforceplagiarism'] = 'These will be set once when the coursework is created and will not '. 'update when the site level settings are altered. Admins can alter them manually on the coursework\'s settings screen'; $string['configgeneralfeedback'] = 'Sets the number of weeks after the deadline that general '. 'feedback should be completed.'; $string['configindividualfeedback'] = 'Sets the number of weeks after the deadline that individual '. 'feedback should be provided to the student.'; $string['configmaxbytes'] = 'Default maximum assignment size for all assignments on the site '. '(subject to course limits and other local settings)'; $string['confirmpublish'] = 'Are you sure you want to release all grades? This action cannot be undone.'; -$string['confirmremovefeedback'] = 'Are you sure you want to remove this feedback? This action cannot be undone'; +$string['confirmremovefeedback'] = 'Are you sure you want to remove this feedback? This action cannot be undone'; $string['continuetocoursework'] = 'Continue to coursework'; $string['coursework'] = 'Coursework'; $string['coursework:addinstance'] = 'Add a new coursework instance'; @@ -238,7 +238,7 @@ $string['deadline'] = 'Deadline for submissions'; $string['deadline_help'] = 'Students will be able to add and remove files up until this deadline, '. 'or until a tutor has graded them if there is no deadline. Please note that if "Use the personal deadline" option is selected, this deadline will act as a default Personal Deadline for each student. '; $string['deadlinechanged'] = 'The {$a->typeofdeadline} deadline has changed for {$a->courseworkname}. The deadline is now {$a->deadline}'; -$string['deadline_defaults'] = 'Deadline Defaults'; +$string['deadline_defaults'] = 'Deadline Defaults'; $string['deadline_warning'] = 'After the deadline the current submission will autofinalise and no edits can be made.'; $string['deadlines'] = 'Deadlines'; $string['default_deadline'] = 'This is the default deadline that will be used if personal deadline was not specified.'; @@ -248,7 +248,7 @@ $string['description'] = 'Description'; $string['disabled'] = 'Disabled'; $string['disagreed'] = 'Disagreed'; -$string['digest'] = 'Digest'; +$string['digest'] = 'Digest'; $string['dodgysrscode'] = 'This candidate number doesn\'t match the required format (6 alphanumeric characters e.g. P12345)'; $string['download_student_files'] = 'Download all student submitted files'; $string['download_submitted_files'] = 'Download submitted files'; @@ -276,7 +276,7 @@ $string['enable_sits'] = 'Enable integration with SITS'; $string['enablegeneralfeedback'] = 'Enable general feedback'; $string['enablegeneralfeedback_help'] = 'This will allow teachers to edit a bit of text which will be released to all students automatically once the deadline for general feedback passes. It is intended for situations when an exam or similar is coming up and areas for all students to improve upon are emerging, but there has not yet been time to mark and release the grades for all the students individually.'; -$string['enroltask'] = 'Coursework process enrolment allocation task'; +$string['enroltask'] = 'Coursework process enrolment allocation task'; $string['eventassessableuploaded'] = 'A file has been uploaded.'; $string['exportfinalgrades'] = 'Export final grades'; $string['exportgradingsheets'] = 'Export grading sheet'; @@ -348,7 +348,7 @@ $string['finaliseyoursubmission'] = 'Finalise your submission'; $string['finalstagegrading'] = 'Grading method for final stage'; $string['finalstagegrading_help'] = 'This allows to choose the grading method for the final stage of grading if Rubrics or Marking Guide is used in initial stages. You will not be able to change it back if at least one final stage feedback exists.'; -$string['finalisedsubmission'] = 'Finalised submission'; +$string['finalisedsubmission'] = 'Finalised submission'; $string['flagplagiarism'] = 'Flag plagiarism'; $string['followingerrors'] = 'Following errors were found:'; $string['forceautoauto_release_individual_feedback'] = 'Force auto release of individual feedback global setting across all courseworks'; @@ -369,7 +369,7 @@ $string['formid'] = 'Select feedback form'; $string['formid_help'] = 'You can create a new form based on an existing form'; $string['fourhours'] = 'Four hours'; -$string['fourteendays'] = '14 days'; +$string['fourteendays'] = '14 days'; $string['from'] = 'from'; $string['generalfeedback'] = 'General feedback'; $string['generalfeedback_help'] = 'Please confirm the date that general feedback on this assignment'. ' will be available to all students. If not enabled, any general feedback will be visible to all students as soon as it is added.'; @@ -381,12 +381,12 @@ $string['graded'] = 'Graded'; $string['gradedandpublished'] = 'Graded and published'; $string['gradebook'] = 'Gradebook'; -$string['grade_help'] = 'Grade help'; +$string['grade_help'] = 'Grade help'; $string['grade_hidden_manager'] = 'Hidden until all initial grades are complete'; $string['grade_hidden_teacher'] = 'Hidden until grades are agreed'; $string['gradeitem:submissions'] = 'Submissions'; -$string['grades_table_header'] = 'Grades'; -$string['grades_table_header_help'] = 'All grades are provisional until finalised at Assessment panel and boards.'; +$string['grades_table_header'] = 'Grades'; +$string['grades_table_header_help'] = 'All grades are provisional until finalised at Assessment panel and boards.'; $string['gradealreadyexists'] = 'Grade already exists'; $string['gradingsheetfile'] = 'Grading sheet file'; $string['gradedby'] = 'Graded by'; @@ -443,11 +443,11 @@ $string['individual_feedback_auto_release'] = 'Auto release of individual feedback'; $string['individual_feedback_auto_release_desc'] = 'This will enable date picker in the individual coursework instance'; $string['initialgrade'] = 'Initial grade'; -$string['submissionnotification'] = 'User to receive submission notification'; +$string['submissionnotification'] = 'User to receive submission notification'; $string['initialassessor'] = 'Initial assessor'; $string['initialassessorno'] = 'Initial Assessor {$a}'; -$string['initialmarkingdeadline'] = 'Initial marking deadline'; -$string['initialmarkingdeadline_help'] = 'Set the date that intial grading should be completed by'; +$string['initialmarkingdeadline'] = 'Initial marking deadline'; +$string['initialmarkingdeadline_help'] = 'Set the date that intial grading should be completed by'; $string['item'] = 'Item'; $string['itsyou'] = '(you)'; $string['lastedited'] = 'Last edited by {$a->name} on {$a->time}'; @@ -528,7 +528,7 @@ $string['modulename'] = 'Coursework'; $string['modulename_help'] = 'The coursework module allows students to upload a file or files to be assessed by assessors as part of a grading process that may include single or multiple assessors, blind marking, moderations, allocation of marking to specific teachers, restricting marking/moderations to a subset of students, or any combination of these. The marking process is highly configurable and has been designed to satisfy the requirements of UK university departments. Integration with Turnitin is available if you have a Turnitin subscription and there is the option to get students to resubmit repeatedly and/or extend the deadlines on a per-student basis.'; $string['modulenameplural'] = 'Courseworks'; -$string['multipleusers'] = 'Multiple users'; +$string['multipleusers'] = 'Multiple users'; $string['must_be_after_dealdine'] = 'Must be after the submission deadline'; $string['must_be_before_dealdine'] = 'Must be before the submission deadline'; $string['must_be_after_initial_grade_dealdine'] = 'Must be after the initial grade deadline'; @@ -558,13 +558,13 @@ $string['nomarkers'] = 'No available assessors'; $string['nomoderators'] = 'No available moderators'; $string['noneedforsubmission'] = 'Submission not needed'; -$string['nopermissiontoimportfeedback'] = 'You do not have permission to import feedback to this coursework'; +$string['nopermissiontoimportfeedback'] = 'You do not have permission to import feedback to this coursework'; $string['nopermissiontogradesubmission'] = 'You do not have permission to grade this submission'; $string['nopermissiontoeditgrade'] = 'You do not have permission to edit this submissions grade'; -$string['nopermissiontoimportgrade'] = 'You do not have permission to upload grades for this submission'; -$string['nopersonaldeadlineforextensionwarning'] = 'Note users who have extensions can not have their personal deadline changed or be a part of bulk unflinalise'; +$string['nopermissiontoimportgrade'] = 'You do not have permission to upload grades for this submission'; +$string['nopersonaldeadlineforextensionwarning'] = 'Note users who have extensions can not have their personal deadline changed or be a part of bulk unflinalise'; $string['norulesyet'] = 'No rules defined.'; -$string['norenamefile'] = 'No (you are unable to change this setting as a submission has been made)'; +$string['norenamefile'] = 'No (you are unable to change this setting as a submission has been made)'; $string['nosave'] = 'You cannot save changes or cancel in preview mode - this will cause an error'; $string['nosubmissionhasbeenmade'] = 'No submission has been made.'; $string['nosubmissionrequired'] = 'No submission required'; @@ -606,10 +606,10 @@ $string['otherassessorfeedback'] = 'Other assessor feedback ({$a})'; $string['overwritegrades'] = 'Check box to allow existing grades to be overwritten by grades present in this csv'; $string['ofallstudents'] = '% of all students'; -$string['participants'] = 'Participants'; -$string['per_page'] = 'Records per page'; -$string['per_page_desc'] = 'Default number of records displayed per page'; -$string['percentage'] = '%'; +$string['participants'] = 'Participants'; +$string['per_page'] = 'Records per page'; +$string['per_page_desc'] = 'Default number of records displayed per page'; +$string['percentage'] = '%'; $string['percentages_do_not_add_up'] = 'Percentage allocations are enabled, but the percentages for each assessor do not add up to 100% (only {$a}%). Some students will remain unallocated until this is fixed.'; $string['personal_deadline'] = 'Personal deadline'; $string['personaldeadlineenabled'] = 'Personal deadline'; @@ -634,10 +634,10 @@ $string['previewform'] = 'Preview form'; $string['provisionalgrade'] = 'Provisional grade'; $string['provisionalgrade_help'] = 'Grade before panels and boards'; -$string['processallocationsupload'] = "Allocations file upload results"; -$string['processallocationsuploaddesc'] = "The allocations file that you uploaded has been validated and processed. Below is the result of the upload. "; -$string['processgradingsheetupload'] = "Grading sheet upload results"; -$string['processgradingsheetuploaddesc'] = "The grading sheet that you uploaded has been validated and processed. Below is the result of the upload. "; +$string['processallocationsupload'] = "Allocations file upload results"; +$string['processallocationsuploaddesc'] = "The allocations file that you uploaded has been validated and processed. Below is the result of the upload. "; +$string['processgradingsheetupload'] = "Grading sheet upload results"; +$string['processgradingsheetuploaddesc'] = "The grading sheet that you uploaded has been validated and processed. Below is the result of the upload. "; $string['publish'] = 'Release all grades'; $string['publishgeneralfeedback'] = 'Release general feedback'; $string['range_grade_percent'] = 'Range between two percentage grades'; @@ -648,12 +648,12 @@ $string['range_total_percentdesc'] = 'With the total sample being at least {$a->upperlimit}%'; $string['records_per_page'] = 'Showing:'; $string['released_early'] = '(released early)'; -$string['relativeinitialmarkingdeadline'] = "Relative initial marking deadline"; -$string['relativeinitialmarkingdeadline_help'] = "Set the amount of time that initial marking should be completed by relative to submission time"; -$string['relativeagreedmarkingdeadline'] = "Relative agreed grade marking deadline"; -$string['relativeagreedmarkingdeadline_help'] = "Set the amount of time that agreed grade should be completed by relative to submission time"; -$string['relativedeadlinesreminder'] = "N.b if you turn off marking deadlines and leave marking reminders on, the reminders will default to the relative deadlines selected by your moodle admin"; -$string['renamefiles'] = 'Rename files'; +$string['relativeinitialmarkingdeadline'] = "Relative initial marking deadline"; +$string['relativeinitialmarkingdeadline_help'] = "Set the amount of time that initial marking should be completed by relative to submission time"; +$string['relativeagreedmarkingdeadline'] = "Relative agreed grade marking deadline"; +$string['relativeagreedmarkingdeadline_help'] = "Set the amount of time that agreed grade should be completed by relative to submission time"; +$string['relativedeadlinesreminder'] = "N.b if you turn off marking deadlines and leave marking reminders on, the reminders will default to the relative deadlines selected by your moodle admin"; +$string['renamefiles'] = 'Rename files'; $string['renamefiles_help'] = 'Sets whether files will be renamed. Automatically set to yes if blind marking is selected'; $string['reminder'] = 'Date 2nd reminder emails'; $string['reminder_first'] = 'Students will receive their first reminder {$a} days before the deadline'; @@ -661,20 +661,20 @@ $string['removefeedback'] = 'Remove feedback'; $string['removegraderule'] = 'Remove rule'; $string['replacing_an_existing_file_warning'] = 'You have already submitted this assignment. The document(s) you choose will replace the document(s) you previously submitted.'; -$string['returntocourseworkpage'] = 'Return to coursework page'; +$string['returntocourseworkpage'] = 'Return to coursework page'; $string['restrictgeneralfeedback'] = 'Restrict general feedback'; $string['resubmit'] = 'Resubmit to {$a}'; $string['resubmitted'] = 'Submission files for {$a} have been sent to the plagiarism system again. It may'. ' take up to an hour or two for them to be processed.'; $string['revert'] = 'Unfinalise'; $string['rightnumberofallocations'] = 'Right number of allocations'; $string['sameforallstages'] = 'Same throughout all stages'; -$string['rounddown'] = 'Rounding down'; -$string['roundingrule'] = "Rounding of average grade"; -$string['roundingrule_help'] = "Rounding of average grade to the whole number rules."; -$string['roundmid'] = 'Mid point rounding'; -$string['roundup'] = 'Rounding up'; -$string['rubric_grade_cannot_be_empty'] = 'Grade can not be empty: '; -$string['rubric_invalid_value'] = 'Value given is invalid for this rubric: '; +$string['rounddown'] = 'Rounding down'; +$string['roundingrule'] = "Rounding of average grade"; +$string['roundingrule_help'] = "Rounding of average grade to the whole number rules."; +$string['roundmid'] = 'Mid point rounding'; +$string['roundup'] = 'Rounding up'; +$string['rubric_grade_cannot_be_empty'] = 'Grade can not be empty: '; +$string['rubric_invalid_value'] = 'Value given is invalid for this rubric: '; $string['sampling'] = 'Sampling'; $string['sampletype'] = 'Sample Type '; @@ -686,7 +686,7 @@ $string['samplingenabled'] = 'Sampling enabled'; $string['samplingenabled_help'] = 'Sampling allows you to choose which students will be included for later stages of marking after the first mark is done.'; $string['save'] = 'Save'; -$string['save_and_exit'] = 'Save and exit'; +$string['save_and_exit'] = 'Save and exit'; $string['save_email_finalised'] = ' and it has been finalised '; $string['save_email_html'] = '

    Dear {$a->name},

    Your submission has been made to {$a->coursework_name} {$a->finalised} with a submission time of {$a->submittedtime}

    The submission id in case of dispute is {$a->submissionid}

    '; $string['save_email_subject'] = 'Submission Receipt'; @@ -706,14 +706,14 @@ $string['selectalltopin'] = 'Pin/unpin marking stage on screen'; $string['selectsamplingstrategy'] = 'Select sampling strategy'; $string['selectrules'] = 'Select rules'; -$string['sendmarkingreminder'] = 'Send marking reminder'; +$string['sendmarkingreminder'] = 'Send marking reminder'; $string['sequence_number_description'] = 'Description'; $string['sequence_number_title'] = 'Sequence / Assessment Title'; -$string['setdateforselected'] = 'Set date for selected {$a}s'; +$string['setdateforselected'] = 'Set date for selected {$a}s'; $string['setpersonaldeadlines'] = 'Set personal deadlines'; $string['setpersonaldeadlinesfor'] = 'Set personal deadlines for {$a}'; $string['settings_header'] = 'All values set in this page are defaults for all courseworks, however \'Availability\', \'Submission\' and \'Feedback types\' settings can be overridden in the individual coursework instance.'; -$string['sevendays'] = '7 days'; +$string['sevendays'] = '7 days'; $string['showallfeedbacks'] = 'Show initial assessors feedback to students'; $string['showallfeedbacks_help'] = 'If enabled, all assessors feedback will be visible to students. This doesn\'t apply to single marked courseworks, where there is only one feedback anyway.'; $string['showallstudents'] = 'Show submissions for other students'; @@ -777,15 +777,15 @@ $string['submissiondeadline'] = 'Submissions deadline'; $string['submissionsdeadlineinfo'] = 'Please note that the submitted work will be auto-finalised when the deadline passes. The submission needs to be finalised to allow assessor(s) to grade.'; $string['submission_deadline_enabled_desc'] = 'Set the default submissions deadline applied to coursework activities'; -$string['submissiontime'] = 'Submission time'; -$string['submissiontype'] = 'Submission type'; -$string['submissionnotallocatedtoassessor'] = 'Submissions for students not allocated to you'; +$string['submissiontime'] = 'Submission time'; +$string['submissiontype'] = 'Submission type'; +$string['submissionnotallocatedtoassessor'] = 'Submissions for students not allocated to you'; $string['submitandfinalise'] = 'Submit and finalise'; $string['submitonbehalfof'] = 'Submit work on behalf of a student'; $string['submissionnotreadyforagreedgrade'] = 'The submission is not ready for agreed grade'; $string['submissionnotreadytograde'] = 'The submission is not ready to be graded'; $string['submission_notification_html'] = '

    Dear {$a->name},

    A submission has been made in the {$a->coursework_name} coursework.

    '; -$string['submission_notification_subject'] = 'A submission has been made in {$a}'; +$string['submission_notification_subject'] = 'A submission has been made in {$a}'; $string['submission_notification_text'] = 'Dear {$a->name},'."\n\n".'A submission has been made in the {$a->coursework_name} coursework.'; $string['coursework:submitonbehalfof'] = 'Submit work on behalf of a student'; $string['submitonbehalfofstudent'] = 'Submit work on behalf of {$a}'; @@ -829,24 +829,24 @@ $string['type_help'] = 'Field type'; $string['type_help_help'] = 'Field type'; $string['uncappedgrade'] = 'Uncapped maximum grade'; -$string['unfinaliseselected'] = 'Unfinialise submissions for selected {$a}s'; -$string['unfinalisedchangesubmissiondate'] = 'You may need to change the submission deadlines for unfinalised submissions. Note if an expired deadline is not changed then your submission will auto-finalise'; +$string['unfinaliseselected'] = 'Unfinialise submissions for selected {$a}s'; +$string['unfinalisedchangesubmissiondate'] = 'You may need to change the submission deadlines for unfinalised submissions. Note if an expired deadline is not changed then your submission will auto-finalise'; $string['unmoderatedworkexists'] = 'Cannot release grades - some work still needs moderating and strict anonymity for moderations is enabled.'; -$string['unenroltask'] = 'Coursework process unenrolment allocation task'; +$string['unenroltask'] = 'Coursework process unenrolment allocation task'; $string['updatethis'] = 'Update this Coursework'; $string['uploadfeedbackfiles'] = 'Upload feedback files in a zip'; $string['upperlimit'] = 'Upper limit'; $string['use_groups'] = 'Group submissions'; $string['use_groups_help'] = 'If enabled, groups of students will submit one bit of work for the whole group. Any student in the group can submit, and if they do, their submission will overwrite any previous submission by other group members.'; -$string['usernamemissing'] = 'User\'s username is missing'; -$string['usernotincoursework'] = 'Student not in the coursework'; -$string['usemarkingdeadline'] = 'Use the marking deadline'; +$string['usernamemissing'] = 'User\'s username is missing'; +$string['usernotincoursework'] = 'Student not in the coursework'; +$string['usemarkingdeadline'] = 'Use the marking deadline'; $string['usepersonaldeadline'] = 'Use the personal deadline'; -$string['uploadallocations'] = 'Upload allocations'; -$string['uploadgradingworksheet'] = 'Upload grading worksheet'; -$string['uploadfeedbackzip'] = 'Upload feedback zip'; -$string['value'] = "Value"; -$string['valuenotincourseworkscale'] = "Grade value not in coursework scale."; +$string['uploadallocations'] = 'Upload allocations'; +$string['uploadgradingworksheet'] = 'Upload grading worksheet'; +$string['uploadfeedbackzip'] = 'Upload feedback zip'; +$string['value'] = "Value"; +$string['valuenotincourseworkscale'] = "Grade value not in coursework scale."; $string['viewfeedback'] = 'View feedback'; $string['viewinitialgradeenabled'] = 'View initial assessors grades'; $string['viewinitialgradeenabled_help'] = 'If selected, assessors will be able to see initial grades from other assessors.'; @@ -855,7 +855,7 @@ $string['viewallstudents'] = 'View students not allocated to user'; $string['week'] = 'Week'; $string['weeks'] = 'Weeks'; -$string['yesrenamefile'] = 'Yes (you are unable to change this setting as a submission has been made)'; +$string['yesrenamefile'] = 'Yes (you are unable to change this setting as a submission has been made)'; $string['youmustagreetotheterms'] = 'You must agree to the following terms before submitting:'; $string['youmustagreetothetermserror'] = 'You must agree to the terms'; $string['yoursrscode'] = 'Your candidate number'; diff --git a/lib.php b/lib.php index 25382e5e..0c344829 100644 --- a/lib.php +++ b/lib.php @@ -162,7 +162,7 @@ function coursework_add_instance($formdata) { //we have to check to see if this coursework has a deadline ifm it doesn't we need to set the //deadline to zero - $formdata->deadline = empty($formdata->deadline) ? 0 : $formdata->deadline; + $formdata->deadline = empty($formdata->deadline) ? 0 : $formdata->deadline; $subnotify = ''; $comma = ''; if (!empty($formdata->submissionnotification)) { @@ -284,7 +284,7 @@ function mod_coursework_core_calendar_provide_event_action(calendar_event $event if ($marker){ // for markers // check how many submissions to mark - $outstandingmarking = new outstanding_marking(); + $outstandingmarking = new outstanding_marking(); if($event->eventtype == 'initialgradingdue') { //initial grades @@ -296,7 +296,7 @@ function mod_coursework_core_calendar_provide_event_action(calendar_event $event //agreed grades $togradeagreedcount = $outstandingmarking->get_to_grade_agreed_count($dbcoursework, $user->id()); $name = get_string('agreedgrade', 'coursework'); - $itemcount = $togradeagreedcount; + $itemcount = $togradeagreedcount; } @@ -447,13 +447,13 @@ function coursework_update_instance($coursework) { $coursework->submissionnotification = $subnotify; - $courseworkhassubmissions = ($DB->get_records('coursework_submissions',array('courseworkid'=>$coursework->id))) + $courseworkhassubmissions = ($DB->get_records('coursework_submissions',array('courseworkid'=>$coursework->id))) ? true : false; //if the coursework has submissions then we the renamefiles setting can't be changes if ($courseworkhassubmissions) { - $currentcoursework = $DB->get_record('coursework',array('id'=>$coursework->id)); + $currentcoursework = $DB->get_record('coursework',array('id'=>$coursework->id)); $coursework->renamefiles = $currentcoursework->renamefiles; @@ -1372,7 +1372,7 @@ function course_group_member_removed($event_data) { } } else { // find all individual students in the group - $students = get_enrolled_users($coursework->get_context(), 'mod/coursework:submit', $groupid); + $students = get_enrolled_users($coursework->get_context(), 'mod/coursework:submit', $groupid); if ($students){ foreach($students as $student){ if (can_delete_allocation($coursework->id(), $student->id)) { @@ -1516,11 +1516,11 @@ function coursework_is_ulcc_digest_coursework_plugin_installed() { global $DB; - $pluginexists = false; - $disgestblockexists = $DB->record_exists_sql("SELECT id FROM {block} WHERE name = 'ulcc_digest' AND visible = 1"); + $pluginexists = false; + $disgestblockexists = $DB->record_exists_sql("SELECT id FROM {block} WHERE name = 'ulcc_digest' AND visible = 1"); if (!empty($disgestblockexists)) { - $pluginexists = ($DB->get_records('block_ulcc_digest_plgs',array('module'=>'coursework','status'=>1))) ? true : false; + $pluginexists = ($DB->get_records('block_ulcc_digest_plgs',array('module'=>'coursework','status'=>1))) ? true : false; } return $pluginexists; diff --git a/mod_form.php b/mod_form.php index 963edd57..abcfcc83 100644 --- a/mod_form.php +++ b/mod_form.php @@ -335,26 +335,26 @@ protected function add_submission_deadline_field() { $moodle_form =& $this->_form; - $default_timestamp = strtotime('+2 weeks'); - $disabled = true; + $default_timestamp = strtotime('+2 weeks'); + $disabled = true; if (!empty($CFG->coursework_submission_deadline)) { - $disabled = false; + $disabled = false; - $default_timestamp =strtotime('today'); - if ($CFG->coursework_submission_deadline == 7 ) { - $default_timestamp = strtotime('+1 weeks'); + $default_timestamp =strtotime('today'); + if ($CFG->coursework_submission_deadline == 7 ) { + $default_timestamp = strtotime('+1 weeks'); } else if ($CFG->coursework_submission_deadline == 14 ) { - $default_timestamp = strtotime('+2 weeks'); + $default_timestamp = strtotime('+2 weeks'); } else if ($CFG->coursework_submission_deadline == 31 ) { - $default_timestamp = strtotime('+1 month'); + $default_timestamp = strtotime('+1 month'); } } $optional = true; $courseworkid = $this->get_coursework_id(); if ($courseworkid){ - $coursework = mod_coursework\models\coursework::find($courseworkid); + $coursework = mod_coursework\models\coursework::find($courseworkid); if($coursework->extension_exists()){ $optional = false; } @@ -414,12 +414,12 @@ protected function add_start_date_field() { $moodle_form =& $this->_form; - $default_timestamp = strtotime('+2 weeks'); - $disabled = true; + $default_timestamp = strtotime('+2 weeks'); + $disabled = true; if (!empty($CFG->coursework_start_date)) { - $disabled = false; - $default_timestamp =strtotime('today'); + $disabled = false; + $default_timestamp =strtotime('today'); } $moodle_form->addElement('date_time_selector', @@ -445,7 +445,7 @@ private function add_marking_deadline_field() { get_string('usemarkingdeadline', 'mod_coursework'), $options); $moodle_form->setType('markingdeadlineenabled', PARAM_INT); - $settingdefault = (empty($CFG->coursework_marking_deadline) && empty($CFG->coursework_agreed_marking_deadline)) ? 0 : 1; + $settingdefault = (empty($CFG->coursework_marking_deadline) && empty($CFG->coursework_agreed_marking_deadline)) ? 0 : 1; $moodle_form->setDefault('markingdeadlineenabled', $settingdefault); } @@ -457,38 +457,38 @@ protected function add_initial_marking_deadline_field() { $moodle_form =& $this->_form; - $default_timestamp =strtotime('today'); - $disabled = true; + $default_timestamp =strtotime('today'); + $disabled = true; - $submission_deadline_timestamp =strtotime('today'); + $submission_deadline_timestamp =strtotime('today'); if (!empty($CFG->coursework_submission_deadline)) { - if ($CFG->coursework_submission_deadline == 7 ) { - $submission_deadline_timestamp = strtotime('+1 weeks'); + if ($CFG->coursework_submission_deadline == 7 ) { + $submission_deadline_timestamp = strtotime('+1 weeks'); } else if ($CFG->coursework_submission_deadline == 14 ) { - $submission_deadline_timestamp = strtotime('+2 weeks'); + $submission_deadline_timestamp = strtotime('+2 weeks'); } else if ($CFG->coursework_submission_deadline == 31 ) { - $submission_deadline_timestamp = strtotime('+1 month'); + $submission_deadline_timestamp = strtotime('+1 month'); } } if (!empty($CFG->coursework_marking_deadline)) { - $disabled = false; + $disabled = false; - if ($CFG->coursework_marking_deadline == 7 ) { - $default_timestamp = strtotime('+1 weeks',$submission_deadline_timestamp); + if ($CFG->coursework_marking_deadline == 7 ) { + $default_timestamp = strtotime('+1 weeks',$submission_deadline_timestamp); } else if ($CFG->coursework_marking_deadline == 14 ) { - $default_timestamp = strtotime('+2 weeks',$submission_deadline_timestamp); + $default_timestamp = strtotime('+2 weeks',$submission_deadline_timestamp); } else if ($CFG->coursework_marking_deadline == 21 ) { - $default_timestamp = strtotime('+3 weeks',$submission_deadline_timestamp); + $default_timestamp = strtotime('+3 weeks',$submission_deadline_timestamp); }else if ($CFG->coursework_marking_deadline == 28 ) { - $default_timestamp = strtotime('+4 weeks',$submission_deadline_timestamp); + $default_timestamp = strtotime('+4 weeks',$submission_deadline_timestamp); } else if ($CFG->coursework_marking_deadline == 35 ) { - $default_timestamp = strtotime('+5 weeks',$submission_deadline_timestamp); + $default_timestamp = strtotime('+5 weeks',$submission_deadline_timestamp); } else if ($CFG->coursework_marking_deadline == 42 ) { - $default_timestamp = strtotime('+6 weeks',$submission_deadline_timestamp); + $default_timestamp = strtotime('+6 weeks',$submission_deadline_timestamp); } } @@ -512,35 +512,35 @@ protected function add_agreed_grade_marking_deadline_field() { $moodle_form =& $this->_form; - $default_timestamp =strtotime('today'); - $disabled = true; + $default_timestamp =strtotime('today'); + $disabled = true; - $submission_deadline_timestamp =strtotime('today'); + $submission_deadline_timestamp =strtotime('today'); if (!empty($CFG->coursework_submission_deadline)) { - if ($CFG->coursework_submission_deadline == 7 ) { - $submission_deadline_timestamp = strtotime('+1 weeks'); + if ($CFG->coursework_submission_deadline == 7 ) { + $submission_deadline_timestamp = strtotime('+1 weeks'); } else if ($CFG->coursework_submission_deadline == 14 ) { - $submission_deadline_timestamp = strtotime('+2 weeks'); + $submission_deadline_timestamp = strtotime('+2 weeks'); } else if ($CFG->coursework_submission_deadline == 31 ) { - $submission_deadline_timestamp = strtotime('+1 month'); + $submission_deadline_timestamp = 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); + $disabled = false; + if ($CFG->coursework_agreed_marking_deadline == 7 ) { + $default_timestamp = strtotime('+1 weeks',$submission_deadline_timestamp); } else if ($CFG->coursework_agreed_marking_deadline == 14 ) { - $default_timestamp = strtotime('+2 weeks',$submission_deadline_timestamp); + $default_timestamp = strtotime('+2 weeks',$submission_deadline_timestamp); } else if ($CFG->coursework_agreed_marking_deadline == 21 ) { - $default_timestamp = strtotime('+3 weeks',$submission_deadline_timestamp); + $default_timestamp = strtotime('+3 weeks',$submission_deadline_timestamp); } else if ($CFG->coursework_agreed_marking_deadline == 28 ) { - $default_timestamp = strtotime('+4 weeks',$submission_deadline_timestamp); + $default_timestamp = strtotime('+4 weeks',$submission_deadline_timestamp); } else if ($CFG->coursework_agreed_marking_deadline == 35 ) { - $default_timestamp = strtotime('+5 weeks',$submission_deadline_timestamp); + $default_timestamp = strtotime('+5 weeks',$submission_deadline_timestamp); } else if ($CFG->coursework_agreed_marking_deadline == 42 ) { - $default_timestamp = strtotime('+6 weeks',$submission_deadline_timestamp); + $default_timestamp = strtotime('+6 weeks',$submission_deadline_timestamp); } } @@ -562,15 +562,15 @@ protected function add_agreed_grade_marking_deadline_field() { protected function add_relative_initial_marking_deadline_field() { global $CFG; - $moodle_form =& $this->_form; + $moodle_form =& $this->_form; - $options = array('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'); - $options['28'] = get_string('fourweeksoption', 'mod_coursework'); - $options['35'] = get_string('fiveweeksoption', 'mod_coursework'); - $options['42'] = get_string('sixweeksoption', 'mod_coursework'); + $options = array('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'); + $options['28'] = get_string('fourweeksoption', 'mod_coursework'); + $options['35'] = get_string('fiveweeksoption', 'mod_coursework'); + $options['42'] = get_string('sixweeksoption', 'mod_coursework'); $moodle_form->addElement('select', 'relativeinitialmarkingdeadline', @@ -590,15 +590,15 @@ protected function add_relative_initial_marking_deadline_field() { protected function add_relative_agreed_grade_marking_deadline_field() { global $CFG; - $moodle_form =& $this->_form; + $moodle_form =& $this->_form; - $options = array('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'); - $options['28'] = get_string('fourweeksoption', 'mod_coursework'); - $options['35'] = get_string('fiveweeksoption', 'mod_coursework'); - $options['42'] = get_string('sixweeksoption', 'mod_coursework'); + $options = array('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'); + $options['28'] = get_string('fourweeksoption', 'mod_coursework'); + $options['35'] = get_string('fiveweeksoption', 'mod_coursework'); + $options['42'] = get_string('sixweeksoption', 'mod_coursework'); $moodle_form->addElement('select', 'relativeagreedmarkingdeadline', @@ -630,7 +630,7 @@ private function add_marking_reminder_field() { get_string('sendmarkingreminder', 'mod_coursework'), $options); $moodle_form->setType('markingreminderenabled', PARAM_INT); - $settingdefault = (empty($CFG->coursework_marking_deadline)) ? 0 : 1; + $settingdefault = (empty($CFG->coursework_marking_deadline)) ? 0 : 1; $moodle_form->setDefault('markingreminderenabled', $settingdefault); } @@ -796,9 +796,9 @@ protected function add_rename_file_field() { $moodle_form =& $this->_form; - $choices = array('0'=>get_string('no'),'1'=>get_string('yes')); - $courseworkid = $this->get_coursework_id(); - $courseworkhassubmissions = (!empty($courseworkid)) ? + $choices = array('0'=>get_string('no'),'1'=>get_string('yes')); + $courseworkid = $this->get_coursework_id(); + $courseworkhassubmissions = (!empty($courseworkid)) ? $courseworkhassubmissions = $DB->get_records('coursework_submissions', array('courseworkid' => $courseworkid)) : false; @@ -827,13 +827,13 @@ protected function add_rename_file_field() { } else { - $sql = "SELECT * + $sql = "SELECT * FROM {coursework} - WHERE id = :courseworkid + WHERE id = :courseworkid AND renamefiles = 1"; - $settingvalue = ($DB->get_records_sql($sql,array('courseworkid'=>$courseworkid))) ? get_string('yesrenamefile','mod_coursework') : get_string('norenamefile','mod_coursework') ; + $settingvalue = ($DB->get_records_sql($sql,array('courseworkid'=>$courseworkid))) ? get_string('yesrenamefile','mod_coursework') : get_string('norenamefile','mod_coursework') ; $moodle_form->addElement('static', 'renamefilesdescription', get_string('renamefiles', 'mod_coursework'), $settingvalue); @@ -1058,14 +1058,14 @@ protected function add_individual_feedback_release_date_field() { ); $options = array('optional' => true); if ($CFG->coursework_auto_release_individual_feedback == 0){ - $options['disabled'] = true; + $options['disabled'] = true; } else{ $default['enabled'] = 1; } if ($CFG->coursework_forceauto_release_individual_feedback == 1){ - $options['optional'] = false; + $options['optional'] = false; } @@ -1252,13 +1252,13 @@ private function add_enable_agreed_grade_delay() { $moodle_form =& $this->_form; - $options = array('0'=>get_string('disabled', 'mod_coursework')); - $options['1800'] = get_string('timedminutes', 'mod_coursework','30'); - $options['3600'] = get_string('timedhour', 'mod_coursework','1'); - $options['7200'] = get_string('timedhours', 'mod_coursework','2'); - $options['18000'] = get_string('timedhours', 'mod_coursework','5'); - $options['43200'] = get_string('timedhours', 'mod_coursework','12'); - $options['86400'] = get_string('aday', 'mod_coursework'); + $options = array('0'=>get_string('disabled', 'mod_coursework')); + $options['1800'] = get_string('timedminutes', 'mod_coursework','30'); + $options['3600'] = get_string('timedhour', 'mod_coursework','1'); + $options['7200'] = get_string('timedhours', 'mod_coursework','2'); + $options['18000'] = get_string('timedhours', 'mod_coursework','5'); + $options['43200'] = get_string('timedhours', 'mod_coursework','12'); + $options['86400'] = get_string('aday', 'mod_coursework'); $moodle_form->addElement('select', 'gradeeditingtime', get_string('gradeeditingtime', 'mod_coursework'), $options); $moodle_form->addHelpButton('gradeeditingtime', 'gradeeditingtime', 'mod_coursework'); @@ -1336,10 +1336,10 @@ private function add_submission_notification_field() { $moodle_form =& $this->_form; - $selectableusers = array(); + $selectableusers = array(); // capability for user allowed to receive submission notifications - $enrolledusers = get_enrolled_users(context_course::instance($COURSE->id), 'mod/coursework:receivesubmissionnotifications'); + $enrolledusers = get_enrolled_users(context_course::instance($COURSE->id), 'mod/coursework:receivesubmissionnotifications'); if($enrolledusers) { foreach ($enrolledusers as $u) { $selectableusers[$u->id] = fullname($u); diff --git a/renderers/grading_report_renderer.php b/renderers/grading_report_renderer.php index 8232dc00..0e791509 100644 --- a/renderers/grading_report_renderer.php +++ b/renderers/grading_report_renderer.php @@ -201,7 +201,7 @@ protected function start_table($options=array()) { $options['width'] = '100%'; $options['class'] = (!empty($options['class'])) ? $options['class'] : ''; $options['class'] .= ' submissions datatabletest display compact'; - $options['id'] = 'dt_table'; + $options['id'] = 'dt_table'; $table_html = \html_writer::start_tag('table', $options); $table_html .= \html_writer::start_tag('thead'); return $table_html; diff --git a/renderers/object_renderer.php b/renderers/object_renderer.php index 4249ea1b..23c21836 100644 --- a/renderers/object_renderer.php +++ b/renderers/object_renderer.php @@ -85,13 +85,13 @@ public function render_feedback(feedback $feedback) { $table_row->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(); + $table_row->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'); } else { - $table_row->cells['right'] = $feedback->display_assessor_name(); + $table_row->cells['right'] = $feedback->display_assessor_name(); } } $table->data[] = $table_row; @@ -204,7 +204,7 @@ public function render_moderation(moderation $moderation){ $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->text = $moderatedby; $right_cell->id = 'moderation_moderatedby'; $table_row->cells['left'] = $left_cell; @@ -565,7 +565,7 @@ protected function render_mod_coursework_allocation_table(mod_coursework_allocat global $PAGE, $OUTPUT, $SESSION; - $table_html = $allocation_table->get_hidden_elements(); + $table_html = $allocation_table->get_hidden_elements(); $table_html .= ' @@ -576,7 +576,7 @@ protected function render_mod_coursework_allocation_table(mod_coursework_allocat '; - $options = $allocation_table->get_options(); + $options = $allocation_table->get_options(); $paging_bar = new paging_bar($allocation_table->get_participant_count(), $options['page'], $options['perpage'], $PAGE->url, 'page'); @@ -792,48 +792,48 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin $html .= html_writer::start_tag('div',array('class'=>'sampling-select')); - $script = " + $script = " var samplingValidateHdl = Array(); "; $html .= html_writer::script($script); - $table = new html_table(); - $table->attributes['class'] = 'sampling'; - $table->head = array(''); + $table = new html_table(); + $table->attributes['class'] = 'sampling'; + $table->head = array(''); - $assessorheaders = array(); + $assessorheaders = array(); for($i = 0; $i < $samplingwidget->get_coursework()->get_max_markers(); $i++) { - $assessorheaders[] = get_string('assessorheading','mod_coursework',$i+1); + $assessorheaders[] = get_string('assessorheading','mod_coursework',$i+1); } $scale = ""; if ($samplingwidget->get_coursework()->grade > 0) { - $comma = ""; + $comma = ""; for($i=0;$i <= $samplingwidget->get_coursework()->grade; $i++) { $scale .= $comma.$i; - $comma = ","; + $comma = ","; } } else { - $grade_scale = \grade_scale::fetch(array('id' => abs($samplingwidget->get_coursework()->grade))); - $scale = $grade_scale->scale; + $grade_scale = \grade_scale::fetch(array('id' => abs($samplingwidget->get_coursework()->grade))); + $scale = $grade_scale->scale; } $html .= ""; - $table->head = $assessorheaders; + $table->head = $assessorheaders; - $assessor1cell = html_writer::start_tag('div',array('class'=>'samples_strategy')); + $assessor1cell = html_writer::start_tag('div',array('class'=>'samples_strategy')); $assessor1cell .= get_string('assessoronedefault','mod_coursework'); $assessor1cell .= html_writer::end_tag('div'); - $columndata = array(new html_table_cell($assessor1cell)); + $columndata = array(new html_table_cell($assessor1cell)); $percentage_options = array(); @@ -841,19 +841,19 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin $percentage_options[$i] = "{$i}%"; } - $javascript = false; + $javascript = false; for ($i = 2; $i <= $samplingwidget->get_coursework()->get_max_markers(); $i++) { //create the secon - $sampling_strategies = array('0' => get_string('sampling_manual','mod_coursework'), + $sampling_strategies = array('0' => get_string('sampling_manual','mod_coursework'), '1' => get_string('sampling_automatic','mod_coursework')); //check whether any rules have been saved for this stage - $selected = ($samplingwidget->get_coursework()->has_automatic_sampling_at_stage('assessor_'.$i)) ? '1' : false; + $selected = ($samplingwidget->get_coursework()->has_automatic_sampling_at_stage('assessor_'.$i)) ? '1' : false; - $sampling_cell = html_writer::start_tag('div',array('class'=>'samples_strategy')); + $sampling_cell = html_writer::start_tag('div',array('class'=>'samples_strategy')); $sampling_cell .= html_writer::label(get_string('sampletype', 'mod_coursework'), "assessor_{$i}_samplingstrategy"); $sampling_cell .= html_writer::select($sampling_strategies, @@ -878,10 +878,10 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin $sampling_cell .= html_writer::div($graderules,'', array('id'=>"assessor_{$i}_automatic_rules")); - $columndata[] = new html_table_cell($sampling_cell); + $columndata[] = new html_table_cell($sampling_cell); } - $table->data[] = $columndata; + $table->data[] = $columndata; //= array($asessoronecell,$asessortwocell); @@ -903,11 +903,11 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin * returning 0 or 1 depending on whether and error was found. (Was that verbose...yeah...oh well) - ND */ - $script = " + $script = " $('#save_manual_sampling').on('click', function (e) { - validationresults = Array(); + validationresults = Array(); $.each(samplingValidateHdl, function(i,functionname) { validationresults.push(eval(functionname+'()')); @@ -941,8 +941,8 @@ private function sampling_strategy_column($samplingwidget,$suffix = '') { } //hidden input containing scale values - $scale = array(); - $sampling_column = ""; + $scale = array(); + $sampling_column = ""; $sampling_column .= html_writer::tag('br',''); $sampling_column .= html_writer::tag('strong',get_string('selectrules','mod_coursework')); @@ -1130,10 +1130,10 @@ protected function get_sampling_strategy_form_elements($coursework,$assessor_num global $CFG, $DB; $html = ''; - $javascript = ''; + $javascript = ''; $classdir = $CFG->dirroot . '/mod/coursework/classes/sample_set_rule/'; - $sampleplugins = $DB->get_records('coursework_sample_set_plugin',null,'pluginorder'); + $sampleplugins = $DB->get_records('coursework_sample_set_plugin',null,'pluginorder'); @@ -1410,13 +1410,13 @@ protected function render_mod_coursework_personal_deadlines_table(mod_coursework global $PAGE; $coursework_page_url = $this->get_router()->get_path('coursework', array('coursework' => $personal_deadlines_table->get_coursework())) ; - $table_html = '
    '.html_writer::link($coursework_page_url,get_string('returntocourseworkpage','mod_coursework')).'
    '; + $table_html = '
    '.html_writer::link($coursework_page_url,get_string('returntocourseworkpage','mod_coursework')).'
    '; $table_html .= '
    '.get_string('nopersonaldeadlineforextensionwarning','mod_coursework').'
    '; - $usergroups = $personal_deadlines_table->get_coursework()->get_allocatable_type(); + $usergroups = $personal_deadlines_table->get_coursework()->get_allocatable_type(); $table_html .= ''; @@ -1425,7 +1425,7 @@ protected function render_mod_coursework_personal_deadlines_table(mod_coursework $table_html .= ''; } $table_html .= '
    '; - $url = $this->get_router()->get_path('edit personal deadline', array()); + $url = $this->get_router()->get_path('edit personal deadline', array()); $table_html .= '
    '; @@ -1493,7 +1493,7 @@ private function render_personal_deadline_table_row($personal_deadline_row) { global $OUTPUT, $USER; - $coursework = $personal_deadline_row->get_coursework(); + $coursework = $personal_deadline_row->get_coursework(); $new_personal_deadline_params = array( 'allocatableid' => $personal_deadline_row->get_allocatable()->id(), @@ -1509,12 +1509,12 @@ private function render_personal_deadline_table_row($personal_deadline_row) { if (!$personal_deadline) { - $personal_deadline = \mod_coursework\models\personal_deadline::build($new_personal_deadline_params); + $personal_deadline = \mod_coursework\models\personal_deadline::build($new_personal_deadline_params); } $ability = new ability(user::find($USER), $coursework); - $disabledelement = (!$personal_deadline ||($personal_deadline && $ability->can('edit', $personal_deadline)) ) ? "" : " disabled='disabled' "; + $disabledelement = (!$personal_deadline ||($personal_deadline && $ability->can('edit', $personal_deadline)) ) ? "" : " disabled='disabled' "; $row_html = ''; @@ -1527,7 +1527,7 @@ private function render_personal_deadline_table_row($personal_deadline_row) { 'allocatableid' => $personal_deadline_row->get_allocatable()->id(), 'allocatabletype' => $personal_deadline_row->get_allocatable()->type(), 'courseworkid' => $personal_deadline_row->get_coursework()->id, - 'setpersonaldeadlinespage' => '1' + 'setpersonaldeadlinespage' => '1' ); @@ -1559,7 +1559,7 @@ protected function coursework_grading_summary_table(mod_coursework_coursework $c $participants = 0; $submitted = 0; - $needsgrading = 0; + $needsgrading = 0; $graded = 0; $finalgrade = 0; $published = 0; @@ -1580,7 +1580,7 @@ protected function coursework_grading_summary_table(mod_coursework_coursework $c $assessable_submitted_submissions = $this->remove_unfinalised_submissions($assessable_submitted_submissions); - $assessable_submitted_submissions = $this->remove_ungradable_submissions($assessable_submitted_submissions); + $assessable_submitted_submissions = $this->remove_ungradable_submissions($assessable_submitted_submissions); //remove all submission with final grade $assessable_submitted_submissions = $this->removed_final_graded_submissions($assessable_submitted_submissions); diff --git a/renderers/page_renderer.php b/renderers/page_renderer.php index da88179c..85cfd7e4 100644 --- a/renderers/page_renderer.php +++ b/renderers/page_renderer.php @@ -390,7 +390,7 @@ public function new_feedback_page($new_feedback , $ajax = false) { // get all initial stages feedbacks for this submission $initial_feedbacks = $DB->get_records('coursework_feedbacks', array('submissionid' => $new_feedback->submissionid)); - $teacher_feedback = new feedback(); + $teacher_feedback = new feedback(); $feedbackcomment = ''; $count = 1; foreach($initial_feedbacks as $initial_feedback){ @@ -602,7 +602,7 @@ public function teacher_grading_page($coursework, $page, $perpage, $sortby, $sor $report_options['page'] = $page; $report_options['group'] = $group; $report_options['perpage'] = $perpage; - $report_options['mode'] = 2; //load first number of records specified by perpage first + $report_options['mode'] = 2; //load first number of records specified by perpage first $report_options['sortby'] = $sortby; $report_options['sorthow'] = $sorthow; $report_options['showsubmissiongrade'] = false; @@ -655,7 +655,7 @@ public function teacher_grading_page($coursework, $page, $perpage, $sortby, $sor && !empty($submissions)) { $url = $pageurl.'&download=1'; - $links[$url] = get_string('download_submitted_files', 'coursework'); + $links[$url] = get_string('download_submitted_files', 'coursework'); } // export final grades button if (has_capability('mod/coursework:viewallgradesatalltimes', @@ -675,13 +675,13 @@ public function teacher_grading_page($coursework, $page, $perpage, $sortby, $sor && $coursework->get_finalised_submissions()){ //export grading sheet $url = $pageurl.'&export_grading_sheet=1'; - $links[$url] = get_string('exportgradingsheets','mod_coursework'); + $links[$url] = get_string('exportgradingsheets','mod_coursework'); //import grading sheet $url = '/mod/coursework/actions/upload_grading_sheet.php?cmid='.$PAGE->cm->id; - $links[$url] = get_string('uploadgradingworksheet','mod_coursework'); + $links[$url] = get_string('uploadgradingworksheet','mod_coursework'); //import annotated submissions $url = '/mod/coursework/actions/upload_feedback.php?cmid='.$PAGE->cm->id; - $links[$url] = get_string('uploadfeedbackfiles','mod_coursework'); + $links[$url] = get_string('uploadfeedbackfiles','mod_coursework'); } @@ -984,7 +984,7 @@ protected function submission_as_readonly_table($submission) { $deadline = ($submission->has_extension()) ? $submission->extension_deadline() : $deadline; - $lateseconds = $submission->time_submitted() - $deadline; + $lateseconds = $submission->time_submitted() - $deadline; $days = floor($lateseconds / 86400); $hours = floor($lateseconds / 3600) % 24; @@ -1412,7 +1412,7 @@ function view_course_index($courseid) { $table = new html_table(); // table headers $format_name = course_get_format($course)->get_format(); - $table->head = array (ucfirst($format_name), 'Courseworks', 'Deadline', 'Submission', 'Grade'); + $table->head = array (ucfirst($format_name), 'Courseworks', 'Deadline', 'Submission', 'Grade'); $currentsection = ''; $printsection = ''; @@ -1467,14 +1467,14 @@ function view_course_index($courseid) { } $url = $CFG->wwwroot.'/mod/coursework/view.php'; $link = "coursemodule->id}\">{$coursework->name}"; - $table->data[] = array(//'cmid'=>$cm->id, + $table->data[] = array(//'cmid'=>$cm->id, 'sectionname'=>$printsection, 'cmname'=>$link, 'timedue'=>$timedue, 'submissioninfo'=>$submitted, 'gradeinfo'=>$grade); } - $o = html_writer::table($table); + $o = html_writer::table($table); return $o; } @@ -1501,7 +1501,7 @@ public function datatables_render($coursework){ $modal_header = html_writer::tag('h5','new Extension', array( 'class' => 'modal-title', - 'id' => 'extension-modal-title', + 'id' => 'extension-modal-title', )); $modal_header .= html_writer::start_tag('button', array( 'type' => 'button', diff --git a/settings.php b/settings.php index 951e24c9..e209d700 100644 --- a/settings.php +++ b/settings.php @@ -33,7 +33,7 @@ // 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_name = get_string('allowlatesubmissions', 'coursework'); $allow_late_submission_description = get_string('allowlatesubmissions_desc', 'coursework'); $options = array( 0 => get_string('no'), 1 => get_string('yes')); $settings->add(new admin_setting_configselect('coursework_allowlatesubmissions', @@ -58,14 +58,14 @@ // 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 = array( 0 => get_string('no'), 1 => get_string('yes')); $settings->add(new admin_setting_configselect('coursework_plagiarismflag', get_string('plagiarism_flag_enable', 'mod_coursework'), get_string('plagiarism_flag_enable_desc', 'mod_coursework'), 0, $options)); // Submission receipt $submissionreceipt_header = new admin_setting_heading('submissionreceipt_header', get_string('submissionreceipt', 'mod_coursework'),''); $settings->add($submissionreceipt_header); - $options = array( 0 => get_string('no'), 1 => get_string('yes')); + $options = array( 0 => get_string('no'), 1 => get_string('yes')); $settings->add(new admin_setting_configselect('coursework_allsubmissionreceipt', get_string('allsubmission', 'mod_coursework'), get_string('allsubmission_desc', 'mod_coursework'), 0, $options)); @@ -73,18 +73,18 @@ // 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_name = get_string('blindmarking', 'coursework'); $blind_marking_description = get_string('blindmarking_desc', 'coursework'); - $options = array( 0 => get_string('no'), 1 => get_string('yes')); + $options = array( 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)); // 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_name = get_string('assessoranonymity', 'coursework'); $assessor_anonymity_description = get_string('assessoranonymity_desc', 'coursework'); - $options = array( 0 => get_string('no'), 1 => get_string('yes')); + $options = array( 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. @@ -103,9 +103,9 @@ $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 = 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 = array( 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)); @@ -119,9 +119,9 @@ $settings->add($individualfeedbacksetting); // Feedback release email - $feedbackreleaseemail_name = get_string('feedbackreleaseemail', 'coursework'); + $feedbackreleaseemail_name = get_string('feedbackreleaseemail', 'coursework'); $feedbackreleaseemail_description = get_string('feedbackreleaseemail_help', 'coursework'); - $options = array( 0 => get_string('no'), 1 => get_string('yes')); + $options = array( 0 => get_string('no'), 1 => get_string('yes')); $settings->add(new admin_setting_configselect('coursework_feedbackreleaseemail', $feedbackreleaseemail_name, $feedbackreleaseemail_description, 1, $options)); @@ -163,9 +163,9 @@ $settings->add($extensions_header); // Enable coursework individual extensions - $individual_extension_name = get_string('individual_extension', 'coursework'); + $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 = array( 0 => get_string('no'), 1 => get_string('yes')); $settings->add(new admin_setting_configselect('coursework_individual_extension', $individual_extension_name, $individual_extension_description, 1, $options)); @@ -182,31 +182,31 @@ // Default per page - $options = array('3'=>'3', '10'=>'10', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100'); + $options = array('3'=>'3', '10'=>'10', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100'); $grading_page_header = new admin_setting_heading('grading_page_header', get_string('grading_page', 'mod_coursework'),''); $settings->add($grading_page_header); - $per_page = get_string('per_page', 'coursework'); + $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)); //automatic agreement delay - $options = array('0'=>get_string('disabled', 'mod_coursework')); - $options['1800'] = get_string('timedminutes', 'mod_coursework','30'); - $options['3600'] = get_string('timedhour', 'mod_coursework','1'); - $options['7200'] = get_string('timedhours', 'mod_coursework','2'); - $options['18000'] = get_string('timedhours', 'mod_coursework','5'); - $options['43200'] = get_string('timedhours', 'mod_coursework','12'); - $options['86400'] = get_string('aday', 'mod_coursework'); + $options = array('0'=>get_string('disabled', 'mod_coursework')); + $options['1800'] = get_string('timedminutes', 'mod_coursework','30'); + $options['3600'] = get_string('timedhour', 'mod_coursework','1'); + $options['7200'] = get_string('timedhours', 'mod_coursework','2'); + $options['18000'] = get_string('timedhours', 'mod_coursework','5'); + $options['43200'] = get_string('timedhours', 'mod_coursework','12'); + $options['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); - $grade_editing_name = get_string('grade_editing_enabled', 'coursework'); + $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)); @@ -265,7 +265,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 = array( '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/behat_mod_coursework.php b/tests/behat/behat_mod_coursework.php index f7886ee8..151b06cd 100644 --- a/tests/behat/behat_mod_coursework.php +++ b/tests/behat/behat_mod_coursework.php @@ -231,7 +231,7 @@ public function theCronRuns() { public function iShouldSeeTheStudentSNameOnThePage($negate = false,$negate2=false,$studentrole) { $page = $this->get_page('coursework page'); - $student = ($studentrole == "another student") ? $this->other_student : $this->student; + $student = ($studentrole == "another student") ? $this->other_student : $this->student; $studentname = fullname($student); @@ -637,7 +637,7 @@ public function theGroupIsPartOfAGroupingForTheCoursework() { $generator = testing_util::get_data_generator(); $grouping = new stdClass(); $grouping->courseid = $this->course->id; - $grouping = $generator->create_grouping($grouping); + $grouping = $generator->create_grouping($grouping); groups_assign_grouping($grouping->id, $this->group->id); $this->get_coursework()->update_attribute('grouping_id', $grouping->id); } @@ -729,10 +729,10 @@ public function managersDoNotHaveTheManageCapability() { public function iAmAllowedToViewAllStudents() { global $DB; - $teacher_role = $DB->get_record('role', array('shortname' => 'teacher')); - $params = array('roleid' => $teacher_role->id, - 'capability' => 'mod/coursework:viewallstudents'); - $permission_setting = CAP_ALLOW; + $teacher_role = $DB->get_record('role', array('shortname' => 'teacher')); + $params = array('roleid' => $teacher_role->id, + 'capability' => 'mod/coursework:viewallstudents'); + $permission_setting = CAP_ALLOW; $DB->set_field('role_capabilities', 'permission', $permission_setting, $params); } diff --git a/tests/behat/pages/allocations_page.php b/tests/behat/pages/allocations_page.php index d73c04ef..c4a51719 100644 --- a/tests/behat/pages/allocations_page.php +++ b/tests/behat/pages/allocations_page.php @@ -159,7 +159,7 @@ public function student_should_have_allocation($student, $teacher, $string) { * @throws \Behat\Mink\Exception\ElementNotFoundException */ public function enable_atomatic_sampling_for($stage) { - $elementid = '#assessor_'.$stage.'_samplingstrategy'; + $elementid = '#assessor_'.$stage.'_samplingstrategy'; $node = $this->getPage()->find('css', $elementid); $node->selectOption('Automatic'); @@ -236,7 +236,7 @@ public function select_total_percentage_for_stage($percentage,$stage) { //increment stage as the this will match the id of the element; $stage++; - $elementid = '#assessor_'.$stage.'_sampletotal'; + $elementid = '#assessor_'.$stage.'_sampletotal'; $node = $this->getPage()->find('css', $elementid); $node->selectOption($percentage); @@ -252,16 +252,16 @@ public function automatically_included_in_sample($coursework,$user,$other_user,$ $other_sql = (!empty($other_user))? "OR allocatableid = $other_user->id" : ''; - $sql = "SELECT * + $sql = "SELECT * FROM {coursework_sample_set_mbrs} WHERE courseworkid = :courseworkid AND stage_identifier = :stage AND (allocatableid = :user $other_sql)"; - $stage = "assessor_".$stage_number; + $stage = "assessor_".$stage_number; - $params = array('courseworkid'=>$coursework->id, + $params = array('courseworkid'=>$coursework->id, 'user'=>$user->id, 'stage' => $stage); diff --git a/tests/behat/pages/multiple_grading_interface.php b/tests/behat/pages/multiple_grading_interface.php index 45f9cffe..a4bb530e 100644 --- a/tests/behat/pages/multiple_grading_interface.php +++ b/tests/behat/pages/multiple_grading_interface.php @@ -329,7 +329,7 @@ protected function new_feedback_button_css($submission) { public function get_provisional_grade_field($submission) { $elementid = '#allocatable_' . $submission->get_coursework() ->get_allocatable_identifier_hash($submission->get_allocatable()). ' .assessor_feedback_grade'; - $grade_field = $this->getPage()->find('css', $elementid); + $grade_field = $this->getPage()->find('css', $elementid); return $grade_field ? $grade_field->getValue() : false; } @@ -340,7 +340,7 @@ public function get_provisional_grade_field($submission) { public function get_grade_field($submission){ $elementid = '#assessorfeedbacktable_' . $submission->get_coursework() ->get_allocatable_identifier_hash($submission->get_allocatable()). ' .grade_for_gradebook_cell'; - $grade_field = $this->getPage()->find('css', $elementid); + $grade_field = $this->getPage()->find('css', $elementid); return $grade_field ? $grade_field->getValue() : false; } diff --git a/tests/classes/export/csv_test.php b/tests/classes/export/csv_test.php index dbd06160..a1d9e218 100644 --- a/tests/classes/export/csv_test.php +++ b/tests/classes/export/csv_test.php @@ -91,7 +91,7 @@ public function test_one_stage(){ $feedback_data->stage_identifier = 'assessor_1'; $feedback = $generator->create_feedback($feedback_data); - $extendion_deadline = time(); + $extendion_deadline = time(); $params = array('allocatableid' => $this->student->id, 'allocatabletype' => 'user', 'courseworkid' => $this->coursework->id, @@ -103,12 +103,12 @@ public function test_one_stage(){ $extension = deadline_extension::create($params); - $extension_reasons = $this->coursework->extension_reasons(); + $extension_reasons = $this->coursework->extension_reasons(); if (empty($extension_reasons)) { set_config('coursework_extension_reasons_list',"coursework extension \n sick leave"); - $extension_reasons = $this->coursework->extension_reasons(); + $extension_reasons = $this->coursework->extension_reasons(); } @@ -134,7 +134,7 @@ public function test_one_stage(){ // build an array $studentname = $student->lastname .' '.$student->firstname; $assessorname = $assessor->lastname .' '. $assessor->firstname; - $assessorusername = $assessor->username; + $assessorusername = $assessor->username; $one_assessor_grades = array('0' => $studentname, @@ -430,8 +430,8 @@ public function test_two_students_one_in_sample(){ $assessorname1 = $assessor1->lastname .' '. $assessor1->firstname; $assessorname2 = $assessor2->lastname .' '. $assessor2->firstname; - $assessorusername1 = $assessor1->username; - $assessorusername2 = $assessor2->username; + $assessorusername1 = $assessor1->username; + $assessorusername2 = $assessor2->username; $assessors_grades = array('0' => $studentname1, '1' => $student1->username, diff --git a/tests/classes/router_test.php b/tests/classes/router_test.php index 1c566bac..cb02d402 100644 --- a/tests/classes/router_test.php +++ b/tests/classes/router_test.php @@ -80,7 +80,7 @@ protected function get_coursework() { * @return stdClass */ private function get_course() { - $this->course = $this->getDataGenerator()->create_course(); + $this->course = $this->getDataGenerator()->create_course(); return $this->course; } } diff --git a/version.php b/version.php index cf66c12d..e88fc65e 100644 --- a/version.php +++ b/version.php @@ -25,10 +25,10 @@ $plugin->component = 'mod_coursework'; -$plugin->version = 2022061000; // If version == 0 then module will not be installed +$plugin->version = 2022061000; // If version == 0 then module will not be installed $plugin->requires = 2021051700; // Requires this Moodle version 3.11 -$plugin->cron = 300; // Period for cron to check this module (secs). +$plugin->cron = 300; // Period for cron to check this module (secs). -$plugin->release = "3.11"; -$plugin->maturity = MATURITY_STABLE; +$plugin->release = "3.11"; +$plugin->maturity = MATURITY_STABLE; diff --git a/view.php b/view.php index a1d70008..3862c813 100644 --- a/view.php +++ b/view.php @@ -136,7 +136,7 @@ // last name alpha if (!(isset($SESSION->coursework_lastname_alpha[$course_module_id]))) { - $SESSION->coursework_lastname_alpha[$course_module_id] = optional_param('coursework_lastname_alpha','', PARAM_ALPHA); + $SESSION->coursework_lastname_alpha[$course_module_id] = optional_param('coursework_lastname_alpha','', PARAM_ALPHA); $coursework_lastname_alpha= $SESSION->coursework_lastname_alpha[$course_module_id]; } else { $coursework_lastname_alpha = optional_param('coursework_lastname_alpha', $SESSION->coursework_lastname_alpha[$course_module_id],PARAM_ALPHA); @@ -145,7 +145,7 @@ // group name alpha if (!(isset($SESSION->coursework_groupname_alpha[$course_module_id]))) { - $SESSION->coursework_groupname_alpha[$course_module_id] = optional_param('coursework_groupname_alpha','', PARAM_ALPHA); + $SESSION->coursework_groupname_alpha[$course_module_id] = optional_param('coursework_groupname_alpha','', PARAM_ALPHA); $coursework_groupname_alpha = $SESSION->coursework_groupname_alpha[$course_module_id]; } else { $coursework_groupname_alpha= optional_param('coursework_groupname_alpha', $SESSION->coursework_groupname_alpha[$course_module_id],PARAM_ALPHA); @@ -160,7 +160,7 @@ $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); + $SESSION->viewallstudents_page[$course_module_id] = optional_param('viewallstudents_page', 0, PARAM_INT); $viewallstudents_page = $SESSION->viewallstudents_page[$course_module_id]; } else { $viewallstudents_page = optional_param('viewallstudents_page', $SESSION->viewallstudents_page[$course_module_id], PARAM_INT); @@ -205,7 +205,7 @@ // last name alpha if (!(isset($SESSION->viewallstudents_lastname_alpha[$course_module_id]))) { - $SESSION->viewallstudents_lastname_alpha[$course_module_id] = optional_param('viewallstudents_lastname_alpha','', PARAM_ALPHA); + $SESSION->viewallstudents_lastname_alpha[$course_module_id] = optional_param('viewallstudents_lastname_alpha','', PARAM_ALPHA); $viewallstudents_lastname_alpha = $SESSION->viewallstudents_lastname_alpha[$course_module_id]; } else { $viewallstudents_lastname_alpha = optional_param('viewallstudents_lastname_alpha', $SESSION->viewallstudents_lastname_alpha[$course_module_id],PARAM_ALPHA); @@ -214,7 +214,7 @@ // group name alpha if (!(isset($SESSION->viewallstudents_groupname_alpha[$course_module_id]))) { - $SESSION->viewallstudents_groupname_alpha[$course_module_id] = optional_param('viewallstudents_groupname_alpha','', PARAM_ALPHA); + $SESSION->viewallstudents_groupname_alpha[$course_module_id] = optional_param('viewallstudents_groupname_alpha','', PARAM_ALPHA); $viewallstudents_groupname_alpha = $SESSION->viewallstudents_groupname_alpha[$course_module_id]; } else { $viewallstudents_groupname_alpha= optional_param('viewallstudents_groupname_alpha', $SESSION->viewallstudents_groupname_alpha[$course_module_id],PARAM_ALPHA); @@ -281,9 +281,9 @@ if (!empty($percentage_allocation_not_complete) || !empty($manual_allocation_not_complete)) { - $redirectdetail = new \stdClass(); - $redirectdetail->percentage = $percentage_allocation_not_complete; - $redirectdetail->manual = $manual_allocation_not_complete; + $redirectdetail = new \stdClass(); + $redirectdetail->percentage = $percentage_allocation_not_complete; + $redirectdetail->manual = $manual_allocation_not_complete; redirect($CFG->wwwroot.'/mod/coursework/actions/allocate.php?id='.$course_module_id,get_string('configuration_needed','coursework',$redirectdetail)); } @@ -352,7 +352,7 @@ if ($download_grading_sheet){ - $csv_cells = \mod_coursework\export\grading_sheet::cells_array($coursework); + $csv_cells = \mod_coursework\export\grading_sheet::cells_array($coursework); $timestamp = date('d_m_y @ H-i'); $filename = get_string('gradingsheetfor', 'coursework'). $coursework->name .' '.$timestamp; @@ -420,9 +420,9 @@ '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; + $params['viewallstudents_sorthow'] = $viewallstudents_sorthow; + $params['viewallstudents_sortby'] = $viewallstudents_sortby; + $params['viewallstudents_per_page'] = $viewallstudents_perpage; } From ca700b61a710da839e18ffb2e0e8b48d64d008c3 Mon Sep 17 00:00:00 2001 From: David Watson <14983002+watson8@users.noreply.github.com> Date: Mon, 12 Aug 2024 11:37:21 +0100 Subject: [PATCH 06/51] CTP-3558 coding std insert space around => --- actions/allocate.php | 4 +- actions/personal_deadline.php | 2 +- backup/moodle2/backup_coursework_stepslib.php | 28 +- .../moodle2/restore_coursework_stepslib.php | 298 +++++++++--------- classes/allocation/manager.php | 16 +- classes/allocation/table/cell/builder.php | 16 +- classes/allocation/table/cell/processor.php | 6 +- classes/allocation/upload.php | 22 +- .../deadline_extensions_controller.php | 2 +- classes/controllers/feedback_controller.php | 10 +- .../personal_deadlines_controller.php | 2 +- .../controllers/submissions_controller.php | 8 +- .../export/csv/cells/agreedfeedback_cell.php | 2 +- classes/export/csv/cells/agreedgrade_cell.php | 2 +- .../csv/cells/assessorfeedback_cell.php | 4 +- classes/export/csv/cells/cell_base.php | 4 +- .../csv/cells/feedbackcomments_cell.php | 2 +- .../csv/cells/moderationagreement_cell.php | 2 +- classes/export/csv/cells/singlegrade_cell.php | 2 +- .../csv/cells/submissionfileid_cell.php | 2 +- .../export/csv/cells/submissionid_cell.php | 2 +- classes/export/import.php | 20 +- classes/file_importer.php | 8 +- classes/forms/deadline_extension_form.php | 6 +- classes/forms/moderator_agreement_mform.php | 2 +- classes/forms/student_submission_form.php | 2 +- classes/framework/test/table_base_test.php | 2 +- classes/grading_table_row_base.php | 6 +- classes/models/coursework.php | 18 +- classes/models/moderation.php | 2 +- classes/models/submission.php | 6 +- .../personal_deadline/table/row/builder.php | 4 +- .../cells/moderation_agreement_cell.php | 4 +- .../cells/multiple_agreed_grade_cell.php | 4 +- .../cells/personal_deadline_cell.php | 2 +- .../cells/single_assessor_feedback_cell.php | 4 +- .../cells/time_submitted_cell.php | 4 +- .../multi_marker_feedback_sub_rows.php | 4 +- classes/router.php | 8 +- classes/sample_set_rule/range_sample_type.php | 26 +- classes/sample_set_rule/sample_base.php | 4 +- classes/sample_set_rule/total_sample_type.php | 8 +- classes/stages/base.php | 6 +- classes/task/enrol_task.php | 4 +- classes/task/unenrol_task.php | 4 +- db/log.php | 8 +- lib.php | 34 +- mod_form.php | 18 +- renderers/grading_report_renderer.php | 8 +- renderers/object_renderer.php | 30 +- renderers/page_renderer.php | 132 ++++---- settings.php | 4 +- tests/behat/behat_mod_coursework.php | 8 +- tests/behat/pages/allocations_page.php | 4 +- tests/classes/export/csv_test.php | 12 +- .../export/grading_sheet_download_test.php | 4 +- version.php | 2 +- 57 files changed, 429 insertions(+), 429 deletions(-) diff --git a/actions/allocate.php b/actions/allocate.php index 2f4a0b6f..cb8f3244 100644 --- a/actions/allocate.php +++ b/actions/allocate.php @@ -101,7 +101,7 @@ 'node-base') ); $PAGE->requires->js_init_call('M.mod_coursework.init_allocate_page', - array('wwwroot'=>$CFG->wwwroot,'coursemoduleid'=>$coursemoduleid), + array('wwwroot' => $CFG->wwwroot,'coursemoduleid' => $coursemoduleid), false, $jsmodule); @@ -240,7 +240,7 @@ echo html_writer::tag('h3', get_string('assessormoderatorgrades', 'mod_coursework')); -echo html_writer::tag('div', get_string('pininfo', 'mod_coursework'), array('class'=>'pininfo')); +echo html_writer::tag('div', get_string('pininfo', 'mod_coursework'), array('class' => 'pininfo')); // Start the form with save button. /* diff --git a/actions/personal_deadline.php b/actions/personal_deadline.php index f27bf651..aa0cceb7 100644 --- a/actions/personal_deadline.php +++ b/actions/personal_deadline.php @@ -39,7 +39,7 @@ $allocatableid = (!empty($allocatableid_arr)) ? $allocatableid_arr : $allocatableid ; -$coursework_db = $DB->get_record('coursework',array('id'=>$courseworkid)); +$coursework_db = $DB->get_record('coursework',array('id' => $courseworkid)); $coursework = \mod_coursework\models\coursework::find($coursework_db); diff --git a/backup/moodle2/backup_coursework_stepslib.php b/backup/moodle2/backup_coursework_stepslib.php index f4645977..d111ac9c 100644 --- a/backup/moodle2/backup_coursework_stepslib.php +++ b/backup/moodle2/backup_coursework_stepslib.php @@ -129,7 +129,7 @@ protected function define_structure() $sample_strategies->add_child($sample_strategy); $sample_strategy->set_source_table('coursework_sample_set_rules', - array('courseworkid'=>backup::VAR_PARENTID)); + array('courseworkid' => backup::VAR_PARENTID)); if($userinfo) { @@ -365,40 +365,40 @@ protected function define_structure() $allocation_configs->add_child($allocation_config); $submission->set_source_table('coursework_submissions', - array('courseworkid'=>backup::VAR_PARENTID)); + array('courseworkid' => backup::VAR_PARENTID)); $feedback->set_source_table('coursework_feedbacks', - array('submissionid'=>backup::VAR_PARENTID)); + array('submissionid' => backup::VAR_PARENTID)); $plagiarism_flag->set_source_table('coursework_plagiarism_flags', - array('submissionid'=>backup::VAR_PARENTID)); + array('submissionid' => backup::VAR_PARENTID)); $moderation_agreement->set_source_table('coursework_mod_agreements', - array('feedbackid'=>backup::VAR_PARENTID)); + array('feedbackid' => backup::VAR_PARENTID)); $reminder->set_source_table('coursework_reminder', - array('coursework_id'=>backup::VAR_PARENTID)); + array('coursework_id' => backup::VAR_PARENTID)); $pair->set_source_table('coursework_allocation_pairs', - array('courseworkid'=>backup::VAR_PARENTID)); + array('courseworkid' => backup::VAR_PARENTID)); $modsetrule->set_source_table('coursework_mod_set_rules', - array('courseworkid'=>backup::VAR_PARENTID)); + array('courseworkid' => backup::VAR_PARENTID)); $extension->set_source_table('coursework_extensions', - array('courseworkid'=>backup::VAR_PARENTID)); + array('courseworkid' => backup::VAR_PARENTID)); $personal_deadline->set_source_table('coursework_person_deadlines', - array('courseworkid'=>backup::VAR_PARENTID)); + array('courseworkid' => backup::VAR_PARENTID)); $modsetmember->set_source_table('coursework_mod_set_members', - array('courseworkid'=>backup::VAR_PARENTID)); + array('courseworkid' => backup::VAR_PARENTID)); $sample_member->set_source_table('coursework_sample_set_mbrs', - array('courseworkid'=>backup::VAR_PARENTID)); + array('courseworkid' => backup::VAR_PARENTID)); $allocation_config->set_source_table('coursework_allocation_config', - array('courseworkid'=>backup::VAR_PARENTID)); + array('courseworkid' => backup::VAR_PARENTID)); //Mark important foreign keys $feedback->annotate_ids('user','assessorid'); @@ -444,7 +444,7 @@ protected function define_structure() $coursework->annotate_ids('grouping','grouping_id'); - $coursework->set_source_table('coursework',array('id'=>backup::VAR_ACTIVITYID)); + $coursework->set_source_table('coursework',array('id' => backup::VAR_ACTIVITYID)); return $this->prepare_activity_structure($coursework); diff --git a/backup/moodle2/restore_coursework_stepslib.php b/backup/moodle2/restore_coursework_stepslib.php index ff15bc9e..54e667aa 100644 --- a/backup/moodle2/restore_coursework_stepslib.php +++ b/backup/moodle2/restore_coursework_stepslib.php @@ -58,21 +58,21 @@ protected function define_structure() // and that the coursework_ prefix is not needed. // It would be nice to go back and take these out here and in backup. // But not essential - $bits=array('submission'=>'coursework_submissions', - 'feedback'=>'coursework_submissions/coursework_submission/coursework_feedbacks', - 'reminder'=>'coursework_reminders', - 'allocation_pair'=>'coursework_allocation_pairs', - 'mod_set_rule'=>'coursework_mod_set_rules', - 'allocation_config'=>'coursework_allocation_configs', - 'mod_set_member'=>'coursework_mod_set_members', - 'sample_set_mbr'=>'coursework_sample_set_mbrs', - 'extension'=>'coursework_extensions', - 'person_deadline'=>'coursework_person_deadlines', + $bits=array('submission' => 'coursework_submissions', + 'feedback' => 'coursework_submissions/coursework_submission/coursework_feedbacks', + 'reminder' => 'coursework_reminders', + 'allocation_pair' => 'coursework_allocation_pairs', + 'mod_set_rule' => 'coursework_mod_set_rules', + 'allocation_config' => 'coursework_allocation_configs', + 'mod_set_member' => 'coursework_mod_set_members', + 'sample_set_mbr' => 'coursework_sample_set_mbrs', + 'extension' => 'coursework_extensions', + 'person_deadline' => 'coursework_person_deadlines', 'mod_agreement' => 'coursework_submissions/coursework_submission/coursework_feedbacks/coursework_feedback/coursework_mod_agreements', 'plagiarism_flag' => 'coursework_submissions/coursework_submission/coursework_plagiarism_flags'); - foreach($bits as $bit=>$bitpath) + foreach($bits as $bit=> $bitpath) { $p=new restore_path_element("coursework_$bit","/activity/coursework/{$bitpath}/coursework_$bit"); $paths[]=$p; @@ -116,16 +116,16 @@ protected function process_coursework_submission($data) 'lastpublished',),$data); $now=time(); - $this->set_defaults(array('timecreated'=>$now, - 'timemodified'=>$now, - 'firstpublished'=>null, - 'lastpublished'=>null, - 'timesubmitted'=>null, - 'finalised'=>0, - 'manualsrscode'=>''), + $this->set_defaults(array('timecreated' => $now, + 'timemodified' => $now, + 'firstpublished' => null, + 'lastpublished' => null, + 'timesubmitted' => null, + 'finalised' => 0, + 'manualsrscode' => ''), $data); - if (!$DB->record_exists('coursework_submissions', array('courseworkid'=>$data->courseworkid, 'allocatableid' =>$data->allocatableid, 'allocatabletype' => $data->allocatabletype))) { + if (!$DB->record_exists('coursework_submissions', array('courseworkid' => $data->courseworkid, 'allocatableid' => $data->allocatableid, 'allocatabletype' => $data->allocatabletype))) { $newitemid = $DB->insert_record('coursework_submissions', $data); $this->set_mapping('coursework_submission', $oldid, $newitemid); @@ -156,21 +156,21 @@ protected function process_coursework_feedback($data) $this->check_grade('cappedgrade',$data); $now=time(); - $this->set_defaults(array('assessorid'=>0, - 'timecreated'=>$now, - 'timemodified'=>$now, - 'grade'=>'', - 'cappedgrade'=>'', - 'feedbackcomment'=>'', - 'timepublished'=>$now, - 'lasteditedbyuser'=>0, - 'isfinalgrade'=>0, - 'ismoderation'=>0, - 'feedbackcommentformat'=>FORMAT_HTML, - 'entry_id'=>0, - 'markernumber'=>0, - 'stage_identifier'=>'', - 'finalised'=>0),$data); + $this->set_defaults(array('assessorid' => 0, + 'timecreated' => $now, + 'timemodified' => $now, + 'grade' => '', + 'cappedgrade' => '', + 'feedbackcomment' => '', + 'timepublished' => $now, + 'lasteditedbyuser' => 0, + 'isfinalgrade' => 0, + 'ismoderation' => 0, + 'feedbackcommentformat' => FORMAT_HTML, + 'entry_id' => 0, + 'markernumber' => 0, + 'stage_identifier' => '', + 'finalised' => 0),$data); $newitemid = $DB->insert_record('coursework_feedbacks', $data); @@ -185,7 +185,7 @@ protected function process_coursework_reminder($data) $data->coursework_id=$this->get_new_parentid('coursework'); $data->userid = $this->get_mappingid('user', $data->userid); - $this->set_defaults(array('remindernumber'=>0),$data); + $this->set_defaults(array('remindernumber' => 0),$data); global $DB; $newitemid = $DB->insert_record('coursework_reminder', $data); @@ -202,11 +202,11 @@ protected function process_coursework_allocation_pair($data) $this->fixallocatable($data); - $this->set_defaults(array('assessorid'=>0, - 'manual'=>0, - 'moderator'=>0, - 'timelocked'=>time(), - 'stage_identifier'=>''),$data); + $this->set_defaults(array('assessorid' => 0, + 'manual' => 0, + 'moderator' => 0, + 'timelocked' => time(), + 'stage_identifier' => ''),$data); global $DB; $newitemid = $DB->insert_record('coursework_allocation_pairs', $data); @@ -219,11 +219,11 @@ protected function process_coursework_mod_set_rule($data) $data->courseworkid=$this->get_new_parentid('coursework'); - $this->set_defaults(array('rulename'=>'', - 'ruleorder'=>0, - 'upperlimit'=>0, - 'lowerlimit'=>0, - 'minimum'=>0),$data); + $this->set_defaults(array('rulename' => '', + 'ruleorder' => 0, + 'upperlimit' => 0, + 'lowerlimit' => 0, + 'minimum' => 0),$data); global $DB; $newitemid = $DB->insert_record('coursework_mod_set_members', $data); @@ -236,12 +236,12 @@ protected function process_coursework_sample_set_rule($data) $data->courseworkid=$this->get_new_parentid('coursework'); - $this->set_defaults(array('ruletype'=>'', - 'ruleorder'=>0, - 'upperlimit'=>0, - 'lowerlimit'=>0, - 'sample_set_plugin_id'=>0, - 'stage_identifier'=>''),$data); + $this->set_defaults(array('ruletype' => '', + 'ruleorder' => 0, + 'upperlimit' => 0, + 'lowerlimit' => 0, + 'sample_set_plugin_id' => 0, + 'stage_identifier' => ''),$data); global $DB; $newitemid = $DB->insert_record('coursework_sample_set_rules', $data); @@ -255,9 +255,9 @@ protected function process_coursework_allocation_config($data) $data->courseworkid=$this->get_new_parentid('coursework'); $data->assessorid = $this->get_mappingid('user', $data->assessorid); - $this->set_defaults(array('allocationstrategy'=>'', - 'value'=>0, - 'purpose'=>''), + $this->set_defaults(array('allocationstrategy' => '', + 'value' => 0, + 'purpose' => ''), $data); global $DB; @@ -272,7 +272,7 @@ protected function process_coursework_mod_set_member($data) $this->fixallocatable($data); - $this->set_defaults(array('stage_identifier'=>''),$data); + $this->set_defaults(array('stage_identifier' => ''),$data); global $DB; $newitemid = $DB->insert_record('coursework_mod_set_members', $data); @@ -286,12 +286,12 @@ protected function process_coursework_sample_set_mbr($data) $this->fixallocatable($data); - $this->set_defaults(array('allocatableid'=>0, - 'allocatabletype'=>'', - 'allocatableuser'=>0, - 'allocatablegroup'=>0, - 'stage_identifier'=>'', - 'selectiontype'=>''),$data); + $this->set_defaults(array('allocatableid' => 0, + 'allocatabletype' => '', + 'allocatableuser' => 0, + 'allocatablegroup' => 0, + 'stage_identifier' => '', + 'selectiontype' => ''),$data); global $DB; $newitemid = $DB->insert_record('coursework_sample_set_mbrs', $data); @@ -308,10 +308,10 @@ protected function process_coursework_extension($data) $this->updatedate(array('extended_deadline'),$data); - $this->set_defaults(array('extended_deadline'=>0, - 'pre_defined_reason'=>'', - 'extra_information_text'=>'', - 'extra_information_format'=>FORMAT_HTML) + $this->set_defaults(array('extended_deadline' => 0, + 'pre_defined_reason' => '', + 'extra_information_text' => '', + 'extra_information_format' => FORMAT_HTML) ,$data); global $DB; @@ -334,10 +334,10 @@ protected function process_coursework_person_deadline($data) 'timemodified'),$data); $now=time(); - $this->set_defaults(array('personal_deadline'=>0, - 'timecreated'=>$now, - 'timemodified'=>0, - 'lastmodifiedbyid'=>0),$data); + $this->set_defaults(array('personal_deadline' => 0, + 'timecreated' => $now, + 'timemodified' => 0, + 'lastmodifiedbyid' => 0),$data); global $DB; $newitemid = $DB->insert_record('coursework_person_deadlines', $data); @@ -361,11 +361,11 @@ protected function process_coursework_mod_agreement($data) 'timemodified'),$data); $now=time(); - $this->set_defaults(array('timecreated'=>$now, - 'timemodified'=>$now, - 'lasteditedby'=>0, - 'modcomment'=>'', - 'modcommentformat'=>1),$data); + $this->set_defaults(array('timecreated' => $now, + 'timemodified' => $now, + 'lasteditedby' => 0, + 'modcomment' => '', + 'modcommentformat' => 1),$data); global $DB; $newitemid = $DB->insert_record('coursework_mod_agreements', $data); @@ -386,11 +386,11 @@ protected function process_coursework_plagiarism_flag($data) 'timemodified'),$data); $now=time(); - $this->set_defaults(array('timecreated'=>$now, - 'timemodified'=>$now, - 'lastmodifieddby'=>0, - 'comment'=>'', - 'comment_format'=>1),$data); + $this->set_defaults(array('timecreated' => $now, + 'timemodified' => $now, + 'lastmodifieddby' => 0, + 'comment' => '', + 'comment_format' => 1),$data); global $DB; $newitemid = $DB->insert_record('coursework_plagiarism_flags', $data); @@ -418,74 +418,74 @@ protected function process_coursework($data) $now=time(); //Taken from install.xml - $this->set_defaults(array('formid'=>0, - 'course'=>0, - 'name'=>'', - 'intro'=>'', - 'introformat'=>FORMAT_HTML, - 'timecreated'=>$now, - 'timemodified'=>$now, - 'grade'=>0, - 'deadline'=>0, - 'srsinclude'=>0, - 'numberofmarkers'=>1, - 'blindmarking'=>1, - 'maxbytes'=>100000, - 'generalfeedback'=>0, - 'individualfeedback'=>0, - 'feedbackcomment'=>'', - 'feedbackcommentformat'=>FORMAT_HTML, - 'generalfeedbacktimepublished'=>0, - 'courseworktype'=>0, - 'assessorallocationstrategy'=>'equal', - 'moderationenabled'=>0, - 'allocationenabled'=>0, - 'moderatorallocationstrategy'=>0, - 'viewothersfeedback'=>0, - 'autoreleasefeedback'=>0, - 'retrospectivemoderation'=>0, - 'studentviewcomponentfeedbacks'=>0, - 'studentviewmoderatorfeedbacks'=>0, - 'strictanonymity'=>0, - 'studentviewfinalfeedback'=>1, - 'studentviewcomponentgrades'=>1, - 'studentviewfinalgrade'=>1, - 'studentviewmoderatorgrade'=>0, - 'strictanonymitymoderator'=>0, - 'allowlatesubmissions'=>0, - 'mitigationenabled'=>0, - 'enablegeneralfeedback'=>0, - 'maxfiles'=>1, - 'filetypes'=>'', - 'use_groups'=>0, - 'grouping_id'=>0, - 'allowearlyfinalisation'=>0, - 'showallfeedbacks'=>0, - 'startdate'=>0, - 'samplingenabled'=>0, - 'extensionsenabled'=>0, - 'assessoranonymity'=>0, - 'viewinitialgradeenabled'=>0, - 'automaticagreement'=>0, - 'automaticagreementrange'=>0, - 'automaticagreementstrategy'=>'', - 'averagerounding'=>'mid', - 'feedbackreleaseemail'=>0, - 'gradeeditingtime'=>0, - 'markingdeadlineenabled'=>0, - 'initialmarkingdeadline'=>0, - 'agreedgrademarkingdeadline'=>0, - 'markingreminderenabled'=>0, - 'submissionnotification'=>'', - 'extension'=>0, - 'relativeinitialmarkingdeadline'=>0, - 'relativeagreedmarkingdeadline'=>0, - 'autopopulatefeedbackcomment'=>0, - 'moderationagreementenabled'=>0, - 'draftfeedbackenabled'=>0, - 'processenrol'=>0, - 'plagiarismflagenabled'=>0, - 'processunenrol'=>0), $data); + $this->set_defaults(array('formid' => 0, + 'course' => 0, + 'name' => '', + 'intro' => '', + 'introformat' => FORMAT_HTML, + 'timecreated' => $now, + 'timemodified' => $now, + 'grade' => 0, + 'deadline' => 0, + 'srsinclude' => 0, + 'numberofmarkers' => 1, + 'blindmarking' => 1, + 'maxbytes' => 100000, + 'generalfeedback' => 0, + 'individualfeedback' => 0, + 'feedbackcomment' => '', + 'feedbackcommentformat' => FORMAT_HTML, + 'generalfeedbacktimepublished' => 0, + 'courseworktype' => 0, + 'assessorallocationstrategy' => 'equal', + 'moderationenabled' => 0, + 'allocationenabled' => 0, + 'moderatorallocationstrategy' => 0, + 'viewothersfeedback' => 0, + 'autoreleasefeedback' => 0, + 'retrospectivemoderation' => 0, + 'studentviewcomponentfeedbacks' => 0, + 'studentviewmoderatorfeedbacks' => 0, + 'strictanonymity' => 0, + 'studentviewfinalfeedback' => 1, + 'studentviewcomponentgrades' => 1, + 'studentviewfinalgrade' => 1, + 'studentviewmoderatorgrade' => 0, + 'strictanonymitymoderator' => 0, + 'allowlatesubmissions' => 0, + 'mitigationenabled' => 0, + 'enablegeneralfeedback' => 0, + 'maxfiles' => 1, + 'filetypes' => '', + 'use_groups' => 0, + 'grouping_id' => 0, + 'allowearlyfinalisation' => 0, + 'showallfeedbacks' => 0, + 'startdate' => 0, + 'samplingenabled' => 0, + 'extensionsenabled' => 0, + 'assessoranonymity' => 0, + 'viewinitialgradeenabled' => 0, + 'automaticagreement' => 0, + 'automaticagreementrange' => 0, + 'automaticagreementstrategy' => '', + 'averagerounding' => 'mid', + 'feedbackreleaseemail' => 0, + 'gradeeditingtime' => 0, + 'markingdeadlineenabled' => 0, + 'initialmarkingdeadline' => 0, + 'agreedgrademarkingdeadline' => 0, + 'markingreminderenabled' => 0, + 'submissionnotification' => '', + 'extension' => 0, + 'relativeinitialmarkingdeadline' => 0, + 'relativeagreedmarkingdeadline' => 0, + 'autopopulatefeedbackcomment' => 0, + 'moderationagreementenabled' => 0, + 'draftfeedbackenabled' => 0, + 'processenrol' => 0, + 'plagiarismflagenabled' => 0, + 'processunenrol' => 0), $data); $this->check_grade('grade',$data); @@ -505,7 +505,7 @@ protected function check_grade($field,&$data) protected function set_defaults($fields,&$data) { - foreach($fields as $name=>$default) + foreach($fields as $name=> $default) { if(!isset($data->$name)) { @@ -541,7 +541,7 @@ protected function after_execute() $itemid=$file->get_itemid(); $entry=$DB->get_record('coursework_submissions', - array('id'=>$itemid)); + array('id' => $itemid)); $submission = \mod_coursework\models\submission::find($entry->id); $submission->rename_files(); // use cw function to handle file renaming as submission may have few files diff --git a/classes/allocation/manager.php b/classes/allocation/manager.php index 201337d9..e74067a3 100644 --- a/classes/allocation/manager.php +++ b/classes/allocation/manager.php @@ -125,7 +125,7 @@ public static function get_allocation_classnames($type = coursework::ASSESSOR) { // move 'none' to be the first option if (array_key_exists('none', $options)){ - $new_value = array('none'=> $options['none']); + $new_value = array('none' => $options['none']); unset($options['none']); $options = $new_value + $options; } @@ -194,8 +194,8 @@ public function auto_generate_moderation_set() { * @return array */ public function get_sampling_options() { - return array('0'=>get_string('manual','mod_coursework'), - '1'=>get_string('automatic','mod_coursework')); + return array('0' => get_string('manual','mod_coursework'), + '1' => get_string('automatic','mod_coursework')); } @@ -272,7 +272,7 @@ public function save_sample_set_rule($assessor_number) { public function save_sample() { global $DB; - $DB->delete_records('coursework_sample_set_rules',array('courseworkid'=>$this->coursework->id)); + $DB->delete_records('coursework_sample_set_rules',array('courseworkid' => $this->coursework->id)); for ($i = 2; $i <= $this->coursework->get_max_markers(); $i++) { $sample_strategy = required_param("assessor_{$i}_samplingstrategy",PARAM_INT); @@ -329,7 +329,7 @@ public function auto_generate_sample_set() { ORDER BY ruleorder)a"; - if ($sampleplugins = $DB->get_records_sql($sql,array('courseworkid'=>$this->coursework->id,'stage'=>$stage))) { + if ($sampleplugins = $DB->get_records_sql($sql,array('courseworkid' => $this->coursework->id,'stage' => $stage))) { //$allocatables = $this->get_coursework()->get_allocatables_with_feedback(); $allocatables = $this->get_coursework()->get_allocatables(); @@ -398,7 +398,7 @@ public function get_include_in_sample_set($stage_number) { //get all users in manually selected for stage in coursework return $DB->get_records_sql($sql, - array('courseworkid'=>$this->coursework->id,'stage_identifier'=>$stage)); + array('courseworkid' => $this->coursework->id,'stage_identifier' => $stage)); } @@ -419,7 +419,7 @@ public function get_automatic_with_feedback($stage) { AND f.stage_identifier = m.stage_identifier "; - return $DB->get_records_sql($sql,array('courseworkid'=>$this->coursework->id,'stage'=>$stage)); + return $DB->get_records_sql($sql,array('courseworkid' => $this->coursework->id,'stage' => $stage)); } @@ -458,7 +458,7 @@ public function get_allocatables_with_final_agreed() { WHERE s.courseworkid = {$this->coursework->id} AND f.stage_identifier = 'final_agreed_1'"; - return $DB->get_records_sql($sql, array('courseworkid'=>$this->coursework->id)); + return $DB->get_records_sql($sql, array('courseworkid' => $this->coursework->id)); } diff --git a/classes/allocation/table/cell/builder.php b/classes/allocation/table/cell/builder.php index 5125987e..83df86cb 100644 --- a/classes/allocation/table/cell/builder.php +++ b/classes/allocation/table/cell/builder.php @@ -309,7 +309,7 @@ private function sampling_set_checkbox() { $checkbox_title = 'Included in sample'; $attributes = array('class' => 'sampling_set_checkbox', - 'id'=>$this->get_allocatable()->type().'_' . $this->get_allocatable()->id() . '_'.$this->get_stage()->identifier() .'_samplecheckbox', + 'id' => $this->get_allocatable()->type().'_' . $this->get_allocatable()->id() . '_'.$this->get_stage()->identifier() .'_samplecheckbox', 'title' => $checkbox_title); // if agreed grade given or grade published to students disable remaining sampling checkbox @@ -338,8 +338,8 @@ private function sampling_hidden_checkbox() { 1, '', array('class' => 'sampling_set_checkbox', - 'id'=>$this->get_allocatable()->type().'_' . $this->get_allocatable()->id() . '_'.$this->get_stage()->identifier() .'_samplecheckbox', - 'title' => $checkbox_title, 'hidden'=>true)); + 'id' => $this->get_allocatable()->type().'_' . $this->get_allocatable()->id() . '_'.$this->get_stage()->identifier() .'_samplecheckbox', + 'title' => $checkbox_title, 'hidden' => true)); } /** @@ -352,9 +352,9 @@ private function has_automatic_sampling() { global $DB; - $params = array('courseworkid'=>$this->coursework->id(), - 'allocatableid'=>$this->get_allocatable()->id(), - 'stage_identifier'=>$this->get_stage()->identifier(), + $params = array('courseworkid' => $this->coursework->id(), + 'allocatableid' => $this->get_allocatable()->id(), + 'stage_identifier' => $this->get_stage()->identifier(), 'selectiontype' => 'automatic'); @@ -430,7 +430,7 @@ private function stage_does_not_use_allocation() { * @throws \coding_exception */ private function get_included_in_sample_label() { - return \html_writer::label(get_string('includedinsample', 'mod_coursework'), null, true, array('class'=>'included_in_sample')); + return \html_writer::label(get_string('includedinsample', 'mod_coursework'), null, true, array('class' => 'included_in_sample')); } /** @@ -438,7 +438,7 @@ private function get_included_in_sample_label() { * @throws \coding_exception */ private function get_automatically_in_sample_label() { - return \html_writer::label(get_string('automaticallyinsample', 'mod_coursework'), null, true, array('class'=>'included_in_sample')); + return \html_writer::label(get_string('automaticallyinsample', 'mod_coursework'), null, true, array('class' => 'included_in_sample')); } /** diff --git a/classes/allocation/table/cell/processor.php b/classes/allocation/table/cell/processor.php index f78e41ec..f7ec2ace 100644 --- a/classes/allocation/table/cell/processor.php +++ b/classes/allocation/table/cell/processor.php @@ -178,9 +178,9 @@ private function has_automatic_sampling() { global $DB; - $params = array('courseworkid'=>$this->coursework->id(), - 'allocatableid'=>$this->get_allocatable()->id(), - 'stage_identifier'=>$this->get_stage()->identifier(), + $params = array('courseworkid' => $this->coursework->id(), + 'allocatableid' => $this->get_allocatable()->id(), + 'stage_identifier' => $this->get_stage()->identifier(), 'selectiontype' => 'automatic'); return $DB->record_exists('coursework_sample_set_mbrs',$params); diff --git a/classes/allocation/upload.php b/classes/allocation/upload.php index c98fc196..6776cd34 100644 --- a/classes/allocation/upload.php +++ b/classes/allocation/upload.php @@ -103,12 +103,12 @@ public function validate_csv($content,$encoding,$delimeter){ if ($allocatabletype == 'user'){ // get user id - $suballocatable = $DB->get_record('user', array($assessor_identifier=>$value)); + $suballocatable = $DB->get_record('user', array($assessor_identifier=> $value)); $allocatable = ($suballocatable)? \mod_coursework\models\user::find($suballocatable->id): ''; } else { // get group id - $suballocatable = $DB->get_record('groups', array('courseid'=>$this->coursework->course, - 'name'=>$value)); + $suballocatable = $DB->get_record('groups', array('courseid' => $this->coursework->course, + 'name' => $value)); $allocatable = ($suballocatable)? \mod_coursework\models\group::find($suballocatable->id) : ''; } @@ -126,7 +126,7 @@ public function validate_csv($content,$encoding,$delimeter){ // skip empty assessors fields if(empty($value)){ continue;} - $assessor = $DB->get_record('user', array($assessor_identifier=>$value)); + $assessor = $DB->get_record('user', array($assessor_identifier=> $value)); if(!$assessor ||!in_array($assessor->id, $assessors)){$errors[$s] = get_string('assessornotincoursework', 'coursework', $keynum ); continue;} @@ -214,18 +214,18 @@ public function process_csv($content, $encoding, $delimiter, $processingresults) if ($cells[$keynum] == 'allocatable') { if ($allocatabletype == 'user'){ // get user id - $suballocatable = $DB->get_record('user', array($assessor_identifier=>$value)); + $suballocatable = $DB->get_record('user', array($assessor_identifier=> $value)); $allocatable = ($suballocatable)? \mod_coursework\models\user::find($suballocatable->id): ''; } else { // get group id - $suballocatable = $DB->get_record('groups', array('courseid'=>$this->coursework->course, - 'name'=>$value)); + $suballocatable = $DB->get_record('groups', array('courseid' => $this->coursework->course, + 'name' => $value)); $allocatable = ($suballocatable)? \mod_coursework\models\group::find($suballocatable->id): ''; } } if (substr($cells[$keynum],0,8) == 'assessor' && !(empty($value))){ - $assessor = $DB->get_record('user', array($assessor_identifier=>$value)); + $assessor = $DB->get_record('user', array($assessor_identifier=> $value)); $params = array('courseworkid' => $this->coursework->id, 'allocatableid' => $allocatable->id, @@ -240,9 +240,9 @@ public function process_csv($content, $encoding, $delimiter, $processingresults) } else { // update allocation if submission was not marked yet - $subdbrecord = $DB->get_record('coursework_submissions', array('courseworkid'=>$this->coursework->id, - 'allocatabletype'=>$allocatabletype, - 'allocatableid'=>$allocatable->id)); + $subdbrecord = $DB->get_record('coursework_submissions', array('courseworkid' => $this->coursework->id, + 'allocatabletype' => $allocatabletype, + 'allocatableid' => $allocatable->id)); $submission = \mod_coursework\models\submission::find($subdbrecord); if (!$submission || !$submission->get_assessor_feedback_by_stage($cells[$keynum])) { diff --git a/classes/controllers/deadline_extensions_controller.php b/classes/controllers/deadline_extensions_controller.php index 7733e16e..0cabedab 100644 --- a/classes/controllers/deadline_extensions_controller.php +++ b/classes/controllers/deadline_extensions_controller.php @@ -396,7 +396,7 @@ public function table_cell_response($data_params) { $row_object = new \mod_coursework\grading_table_row_single($coursework, $participant); } - $time_submitted_cell = new \mod_coursework\render_helpers\grading_report\cells\time_submitted_cell(array('coursework'=>$this->coursework)); + $time_submitted_cell = new \mod_coursework\render_helpers\grading_report\cells\time_submitted_cell(array('coursework' => $this->coursework)); $content = $time_submitted_cell->prepare_content_cell($row_object); diff --git a/classes/controllers/feedback_controller.php b/classes/controllers/feedback_controller.php index 14965a1b..f44d777b 100644 --- a/classes/controllers/feedback_controller.php +++ b/classes/controllers/feedback_controller.php @@ -252,7 +252,7 @@ protected function create_feedback() { $participant = $submission->get_allocatable(); $cell_class = $this->params['cell_type']; $stage = new assessor($coursework, $teacherfeedback->stage_identifier); - $provisional = new grade_for_gradebook_cell(array('coursework'=>$coursework)); + $provisional = new grade_for_gradebook_cell(array('coursework' => $coursework)); $jsonarray = array('success' => true); @@ -285,7 +285,7 @@ protected function create_feedback() { if ($coursework->automaticagreementrange != 'none' && !empty($finalfeedback) && $finalsubmission->all_inital_graded()) { $finalstage = new assessor($coursework, "final_agreed_1"); $finalfeedback_row = new assessor_feedback_row($finalstage, $participant, $coursework); - $agreed_grade_object = new multiple_agreed_grade_cell(array('coursework'=>$coursework,'stage'=>$finalstage)); + $agreed_grade_object = new multiple_agreed_grade_cell(array('coursework' => $coursework,'stage' => $finalstage)); $jsonarray['finalhtml'] = $agreed_grade_object->get_table_cell($finalfeedback_row); $jsonarray['allocatableid'] = $submission->get_allocatable()->id(); } @@ -347,8 +347,8 @@ protected function update_feedback() { if($this->params['remove']){ if (!$this->params['confirm']) { - $urlparams = array('confirm'=>$this->params['confirm'], - 'remove'=>$this->params['remove'],'feedbackid'=>$this->params['feedbackid'],'finalised'=>$this->params['finalised']); + $urlparams = array('confirm' => $this->params['confirm'], + 'remove' => $this->params['remove'],'feedbackid' => $this->params['feedbackid'],'finalised' => $this->params['finalised']); $PAGE->set_url('/mod/coursework/actions/feedbacks/edit.php', $urlparams); @@ -448,7 +448,7 @@ protected function update_feedback() { $participant = $submission->get_allocatable(); $cell_class = $this->params['cell_type']; $stage = new assessor($coursework, $teacherfeedback->stage_identifier); - $provisional = new grade_for_gradebook_cell(array('coursework'=>$coursework)); + $provisional = new grade_for_gradebook_cell(array('coursework' => $coursework)); $jsonarray = array('success' => true); if (strpos($cell_class, 'multi_marker_feedback_sub_rows') !== false) { diff --git a/classes/controllers/personal_deadlines_controller.php b/classes/controllers/personal_deadlines_controller.php index f87a1bbd..807a48c0 100644 --- a/classes/controllers/personal_deadlines_controller.php +++ b/classes/controllers/personal_deadlines_controller.php @@ -197,7 +197,7 @@ public function insert_update($time){ 'message' => 'The new deadline you chose has already passed. Please select appropriate deadline' ]; } - $this->coursework = coursework::find(['id'=>$this->params['courseworkid']]); + $this->coursework = coursework::find(['id' => $this->params['courseworkid']]); require_login($this->coursework->course); $params = $this->set_default_current_deadline(); diff --git a/classes/controllers/submissions_controller.php b/classes/controllers/submissions_controller.php index aca3ef59..a7cc0a36 100644 --- a/classes/controllers/submissions_controller.php +++ b/classes/controllers/submissions_controller.php @@ -176,7 +176,7 @@ protected function create_submission() { if (!empty($userids)) { foreach($userids as $u) { - $notifyuser = $DB->get_record('user',array('id'=>trim($u))); + $notifyuser = $DB->get_record('user',array('id' => trim($u))); if (!empty($notifyuser)) $mailer->send_submission_notification($notifyuser); } @@ -339,8 +339,8 @@ protected function unfinalise_submission() { $allocatableids = (!is_array($this->params['allocatableid'])) ? array($this->params['allocatableid']) : $this->params['allocatableid'] ; $personaldeadline_page_url = new \moodle_url('/mod/coursework/actions/personal_deadline.php', - array('id'=>$this->coursework->get_coursemodule_id(),'multipleuserdeadlines'=>1,'setpersonaldeadlinespage'=>1, - 'courseworkid'=>$this->params['courseworkid'],'allocatabletype'=>$this->params['allocatabletype'])); + array('id' => $this->coursework->get_coursemodule_id(),'multipleuserdeadlines' => 1,'setpersonaldeadlinespage' => 1, + 'courseworkid' => $this->params['courseworkid'],'allocatabletype' => $this->params['allocatabletype'])); $changedeadlines = false; @@ -367,7 +367,7 @@ protected function unfinalise_submission() { redirect($personaldeadline_page_url, get_string('unfinalisedchangesubmissiondate', 'mod_coursework')); } else { $setpersonaldeadline_page_url = new \moodle_url('/mod/coursework/actions/set_personal_deadlines.php', - array('id'=>$this->coursework->get_coursemodule_id())); + array('id' => $this->coursework->get_coursemodule_id())); redirect($setpersonaldeadline_page_url); } diff --git a/classes/export/csv/cells/agreedfeedback_cell.php b/classes/export/csv/cells/agreedfeedback_cell.php index 00b073fc..beb5e659 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,$stage_identifier='',$uploade if (has_any_capability($agreedgradecap,$PAGE->context) || has_capability('mod/coursework:administergrades', $PAGE->context)) { - $subdbrecord = $DB->get_record('coursework_submissions',array('id'=>$submissionid)); + $subdbrecord = $DB->get_record('coursework_submissions',array('id' => $submissionid)); $submission = \mod_coursework\models\submission::find($subdbrecord); //is the submission in question ready to grade? diff --git a/classes/export/csv/cells/agreedgrade_cell.php b/classes/export/csv/cells/agreedgrade_cell.php index e3929025..581b3b87 100644 --- a/classes/export/csv/cells/agreedgrade_cell.php +++ b/classes/export/csv/cells/agreedgrade_cell.php @@ -150,7 +150,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='', $upload if (!empty($errormsg)) return $errormsg; - $subdbrecord = $DB->get_record('coursework_submissions',array('id'=>$submissionid)); + $subdbrecord = $DB->get_record('coursework_submissions',array('id' => $submissionid)); $submission = \mod_coursework\models\submission::find($subdbrecord); diff --git a/classes/export/csv/cells/assessorfeedback_cell.php b/classes/export/csv/cells/assessorfeedback_cell.php index 377c8fdc..61dae139 100644 --- a/classes/export/csv/cells/assessorfeedback_cell.php +++ b/classes/export/csv/cells/assessorfeedback_cell.php @@ -82,7 +82,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade $agreedgradecap = array('mod/coursework:addagreedgrade','mod/coursework:editagreedgrade'); $initialgradecap = array('mod/coursework:addinitialgrade','mod/coursework:editinitialgrade'); - $subdbrecord = $DB->get_record('coursework_submissions',array('id'=>$submissionid)); + $subdbrecord = $DB->get_record('coursework_submissions',array('id' => $submissionid)); $submission = \mod_coursework\models\submission::find($subdbrecord); if (has_any_capability($agreedgradecap,$PAGE->context) && has_any_capability($initialgradecap,$PAGE->context) || has_capability('mod/coursework:administergrades', $PAGE->context)) { @@ -145,7 +145,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade && $this->coursework->get_max_markers() > 1 && !$this->coursework->allocation_enabled()){ // check how many feedbacks for this submission - $feedbacks = $DB->count_records('coursework_feedbacks',array('submissionid'=>$submissionid)); + $feedbacks = $DB->count_records('coursework_feedbacks',array('submissionid' => $submissionid)); if ($this->coursework->sampling_enabled()){ // check how many sample assessors + add 1 that is always in sample diff --git a/classes/export/csv/cells/cell_base.php b/classes/export/csv/cells/cell_base.php index 4ae0ca55..e379f655 100644 --- a/classes/export/csv/cells/cell_base.php +++ b/classes/export/csv/cells/cell_base.php @@ -193,7 +193,7 @@ public function get_actual_grade($grade){ public function get_assessor_name($assessorid){ global $DB; - $assessor = $DB->get_record('user',array('id'=>$assessorid),'firstname, lastname'); + $assessor = $DB->get_record('user',array('id' => $assessorid),'firstname, lastname'); return $assessor->lastname .' '. $assessor->firstname; } @@ -207,7 +207,7 @@ public function get_assessor_name($assessorid){ public function get_assessor_username($assessorid) { global $DB; - $assessor = $DB->get_record('user',array('id'=>$assessorid),'username'); + $assessor = $DB->get_record('user',array('id' => $assessorid),'username'); return $assessor->username; } diff --git a/classes/export/csv/cells/feedbackcomments_cell.php b/classes/export/csv/cells/feedbackcomments_cell.php index aadb2479..370bae17 100644 --- a/classes/export/csv/cells/feedbackcomments_cell.php +++ b/classes/export/csv/cells/feedbackcomments_cell.php @@ -64,7 +64,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='',$uploa if (has_capability('mod/coursework:addinitialgrade', $PAGE->context) || has_capability('mod/coursework:editinitialgrade', $PAGE->context) || has_capability('mod/coursework:administergrades', $PAGE->context)) { - $dbrecord = $DB->get_record('coursework_submissions', array('id'=>$submissionid)); + $dbrecord = $DB->get_record('coursework_submissions', array('id' => $submissionid)); $submission = \mod_coursework\models\submission::find($dbrecord); diff --git a/classes/export/csv/cells/moderationagreement_cell.php b/classes/export/csv/cells/moderationagreement_cell.php index dd7a2bea..aa3cc80e 100644 --- a/classes/export/csv/cells/moderationagreement_cell.php +++ b/classes/export/csv/cells/moderationagreement_cell.php @@ -54,7 +54,7 @@ public function get_cell($submission, $student, $stage_identifier){ } } $feedback = $submission->get_assessor_feedback_by_stage('assessor_1'); - if ($feedback) $moderation = moderation::find(array('feedbackid'=>$feedback->id)); + if ($feedback) $moderation = moderation::find(array('feedbackid' => $feedback->id)); if ($moderation) $moderation_agreement = $moderation->get_moderator_agreement($feedback); diff --git a/classes/export/csv/cells/singlegrade_cell.php b/classes/export/csv/cells/singlegrade_cell.php index f2f87c45..ecdc80bf 100644 --- a/classes/export/csv/cells/singlegrade_cell.php +++ b/classes/export/csv/cells/singlegrade_cell.php @@ -141,7 +141,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade if (!empty($errormsg)) return $errormsg; - $dbrecord = $DB->get_record('coursework_submissions', array('id'=>$submissionid)); + $dbrecord = $DB->get_record('coursework_submissions', array('id' => $submissionid)); $submission = \mod_coursework\models\submission::find($dbrecord); diff --git a/classes/export/csv/cells/submissionfileid_cell.php b/classes/export/csv/cells/submissionfileid_cell.php index 41ab2615..59026769 100644 --- a/classes/export/csv/cells/submissionfileid_cell.php +++ b/classes/export/csv/cells/submissionfileid_cell.php @@ -54,7 +54,7 @@ public function validate_cell($value,$submissionid,$stage_dentifier='',$uploaded return 'No submission hash value entered'; } - $subdbrecord = $DB->get_record('coursework_submissions',array('id'=>$submissionid)); + $subdbrecord = $DB->get_record('coursework_submissions',array('id' => $submissionid)); $submission = \mod_coursework\models\submission::find($subdbrecord); diff --git a/classes/export/csv/cells/submissionid_cell.php b/classes/export/csv/cells/submissionid_cell.php index 5058a291..8be85e9d 100644 --- a/classes/export/csv/cells/submissionid_cell.php +++ b/classes/export/csv/cells/submissionid_cell.php @@ -49,7 +49,7 @@ public function get_header($stage){ public function validate_cell($value,$submissionid,$stage_dentifier='',$uploadedgradecells = array()) { global $DB; - return ($DB->record_exists('coursework_submissions',array('id'=>$submissionid,'courseworkid'=>$this->coursework->id()))) ? true: get_string('submissionnotfoundincoursework','coursework'); + return ($DB->record_exists('coursework_submissions',array('id' => $submissionid,'courseworkid' => $this->coursework->id()))) ? true: get_string('submissionnotfoundincoursework','coursework'); } } diff --git a/classes/export/import.php b/classes/export/import.php index 1b78b74d..7923603e 100644 --- a/classes/export/import.php +++ b/classes/export/import.php @@ -355,7 +355,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces $i++; } - $subdbrecord = $DB->get_record('coursework_submissions', array('id'=>$submissionid)); + $subdbrecord = $DB->get_record('coursework_submissions', array('id' => $submissionid)); $submission = \mod_coursework\models\submission::find($subdbrecord); @@ -628,7 +628,7 @@ public function add_grade($submissionid, $grade, $feedback, $stage_identifier,$u $markernumber = 1; } else { // get all feedbacks and add 1 - $feedbacks = $DB->count_records('coursework_feedbacks',array('submissionid'=>$submissionid)); + $feedbacks = $DB->count_records('coursework_feedbacks',array('submissionid' => $submissionid)); $markernumber = $feedbacks +1; } @@ -751,7 +751,7 @@ public function edit_grade($cwfeedbackid, $grade, $feedback,$uses_rubric=false){ public function get_stage_identifier($submissionid,$cell_identifier) { global $DB, $USER; - $submission = $DB->get_record('coursework_submissions', array('id'=>$submissionid)); + $submission = $DB->get_record('coursework_submissions', array('id' => $submissionid)); $submission = \mod_coursework\models\submission::find($submission); @@ -765,9 +765,9 @@ public function get_stage_identifier($submissionid,$cell_identifier) { && $this->coursework->allocation_enabled()){ $dbrecord = $DB->get_record('coursework_allocation_pairs', - array('courseworkid'=>$this->coursework->id, - 'allocatableid'=>$submission->allocatableid, - 'allocatabletype'=>$submission->allocatabletype, + array('courseworkid' => $this->coursework->id, + 'allocatableid' => $submission->allocatableid, + 'allocatabletype' => $submission->allocatabletype, 'assessorid' => $USER->id )); $stage_identifier = $dbrecord->stage_identifier; @@ -800,16 +800,16 @@ public function get_stage_identifier($submissionid,$cell_identifier) { } } else if ($this->coursework->sampling_enabled()){ // samplings enabled $in_sample = ($subs = $submission->get_submissions_in_sample()) ? sizeof($subs) : 0; - $feedback = $DB->record_exists('coursework_feedbacks', array('submissionid'=>$submissionid, - 'stage_identifier'=>'assessor_1')); + $feedback = $DB->record_exists('coursework_feedbacks', array('submissionid' => $submissionid, + 'stage_identifier' => 'assessor_1')); // no sample or no feedback for sample yet if (!$in_sample || ($in_sample && !$feedback)){ $stage_identifier = 'assessor_1'; } else { // find out which sample wasn't graded yet $samples = $submission->get_submissions_in_sample(); foreach ($samples as $sample){ - $feedback = $DB->record_exists('coursework_feedbacks', array('submissionid'=>$submissionid, - 'stage_identifier'=>$sample->stage_identifier)); + $feedback = $DB->record_exists('coursework_feedbacks', array('submissionid' => $submissionid, + 'stage_identifier' => $sample->stage_identifier)); // if feedback doesn't exist, we'll use this stage identifier for a new feedback if (!$feedback){ $stage_identifier = $sample->stage_identifier; diff --git a/classes/file_importer.php b/classes/file_importer.php index ca22887f..e6693f9b 100644 --- a/classes/file_importer.php +++ b/classes/file_importer.php @@ -123,7 +123,7 @@ public function import_zip_files($coursework,$feedbackstage,$overwritecurrent) if ($allocatableid = $this->is_valid_feedback_file_filename($coursework, $file, $participants) ) { - $subdbrecord = $DB->get_record('coursework_submissions',array('courseworkid'=>$coursework->id(),'allocatableid'=>$allocatableid,'allocatabletype'=>$coursework->get_allocatable_type())); + $subdbrecord = $DB->get_record('coursework_submissions',array('courseworkid' => $coursework->id(),'allocatableid' => $allocatableid,'allocatabletype' => $coursework->get_allocatable_type())); $submission = \mod_coursework\models\submission::find($subdbrecord); @@ -132,7 +132,7 @@ public function import_zip_files($coursework,$feedbackstage,$overwritecurrent) //if only add/edit initial capability then workout stage identifier if ($feedbackstage == 'initialassessor'){ - $feedback = $DB->get_record('coursework_feedbacks', array('submissionid'=>$submission->id, 'assessorid'=>$USER->id )); + $feedback = $DB->get_record('coursework_feedbacks', array('submissionid' => $submission->id, 'assessorid' => $USER->id )); if($feedback){ $feedbackstage = $feedback->stage_identifier; @@ -242,8 +242,8 @@ public function feedback_exists($coursework,$submission,$stageidentifier) { AND stage_identifier = :stage "; - $params = array('submissionid'=>$submission->id, - 'stage'=>$stageidentifier); + $params = array('submissionid' => $submission->id, + 'stage' => $stageidentifier); if (!has_capability('mod/coursework:administergrades',$coursework->get_context())) { $sql .= "AND (assessorid = :assessorid || lasteditedbyuser = :lasteditedbyuser)"; diff --git a/classes/forms/deadline_extension_form.php b/classes/forms/deadline_extension_form.php index e93c34e8..c075b7fd 100644 --- a/classes/forms/deadline_extension_form.php +++ b/classes/forms/deadline_extension_form.php @@ -112,7 +112,7 @@ public function personal_deadline(){ $extensionid = optional_param('id',0, PARAM_INT); if($extensionid != 0){ - $ext = $DB->get_record('coursework_extensions', array('id'=>$extensionid)); + $ext = $DB->get_record('coursework_extensions', array('id' => $extensionid)); $allocatableid = $ext->allocatableid; $allocatabletype = $ext->allocatabletype; $courseworkid = $ext->courseworkid; @@ -126,8 +126,8 @@ public function personal_deadline(){ $params = array( 'allocatableid' => $allocatableid, - 'allocatabletype' =>$allocatabletype , - 'courseworkid' =>$courseworkid, + 'allocatabletype' => $allocatabletype , + 'courseworkid' => $courseworkid, ); return $personal_deadline = $DB->get_record('coursework_person_deadlines', $params); diff --git a/classes/forms/moderator_agreement_mform.php b/classes/forms/moderator_agreement_mform.php index 5534a0ab..9a14be61 100644 --- a/classes/forms/moderator_agreement_mform.php +++ b/classes/forms/moderator_agreement_mform.php @@ -83,7 +83,7 @@ public function definition() { // moderator agreement - $options = array('agreed'=>get_string('agreed', 'coursework'), 'disagreed'=>get_string('disagreed', 'coursework')); + $options = array('agreed' => get_string('agreed', 'coursework'), 'disagreed' => get_string('disagreed', 'coursework')); $mform->addElement('select', 'agreement', get_string('moderationagreement', 'coursework'), $options, diff --git a/classes/forms/student_submission_form.php b/classes/forms/student_submission_form.php index b02c1a70..53fc40e3 100644 --- a/classes/forms/student_submission_form.php +++ b/classes/forms/student_submission_form.php @@ -179,7 +179,7 @@ public function handle() { if (!empty($userids)) { foreach($userids as $u) { - $notifyuser = $DB->get_record('user',array('id'=>trim($u))); + $notifyuser = $DB->get_record('user',array('id' => trim($u))); $mailer = new mailer($coursework); if (!empty($notifyuser)) $mailer->send_submission_notification($notifyuser); diff --git a/classes/framework/test/table_base_test.php b/classes/framework/test/table_base_test.php index d9e73235..93c12362 100644 --- a/classes/framework/test/table_base_test.php +++ b/classes/framework/test/table_base_test.php @@ -98,7 +98,7 @@ public function test_exists_when_true() { $generator = testing_util::get_data_generator(); $params = array( - 'username' =>'freddo' + 'username' => 'freddo' ); $generator->create_user($params); diff --git a/classes/grading_table_row_base.php b/classes/grading_table_row_base.php index 8727c349..1b846495 100644 --- a/classes/grading_table_row_base.php +++ b/classes/grading_table_row_base.php @@ -195,7 +195,7 @@ public function get_personal_deadlines() { $personal_deadline = $DB->get_record('coursework_person_deadlines', array('courseworkid' => $this->get_coursework()->id, 'allocatableid' => $allocatable->id(), - 'allocatabletype'=> $allocatable->type())); + 'allocatabletype' => $allocatable->type())); if ($personal_deadline){ $personal_deadline = $personal_deadline->personal_deadline; } else { @@ -406,7 +406,7 @@ public function has_extension() { global $DB; return $DB->record_exists('coursework_extensions', array('courseworkid' => $this->get_coursework()->id, 'allocatableid' => $this->get_allocatable()->id(), - 'allocatabletype'=> $this->get_allocatable()->type())); + 'allocatabletype' => $this->get_allocatable()->type())); } @@ -421,7 +421,7 @@ public function get_extension() { global $DB; return $DB->get_record('coursework_extensions', array('courseworkid' => $this->get_coursework()->id, 'allocatableid' => $this->get_allocatable()->id(), - 'allocatabletype'=> $this->get_allocatable()->type())); + 'allocatabletype' => $this->get_allocatable()->type())); } public function get_user_firstname() { diff --git a/classes/models/coursework.php b/classes/models/coursework.php index d469e967..938ded24 100644 --- a/classes/models/coursework.php +++ b/classes/models/coursework.php @@ -956,7 +956,7 @@ public function pack_files() { $ability = new ability(user::find($USER), $this); $submissions = $DB->get_records('coursework_submissions', - array('courseworkid' => $this->id, 'finalised'=>1)); + array('courseworkid' => $this->id, 'finalised' => 1)); if (!$submissions) { return false; } @@ -1474,8 +1474,8 @@ public function get_assessor_allocation($allocatable, $stage_identifier) { $params = array( 'courseworkid' => $this->id, 'allocatableid' => $allocatable->allocatableid, - 'stage_identifier'=>$stage_identifier, - 'allocatabletype'=> $allocatable->allocatabletype + 'stage_identifier' => $stage_identifier, + 'allocatabletype' => $allocatable->allocatabletype ); $allocation = $DB->get_record('coursework_allocation_pairs', $params); @@ -2439,7 +2439,7 @@ public function get_finalised_submissions(){ global $DB; $submissions = $DB->get_records('coursework_submissions', - array('courseworkid' => $this->id, 'finalised'=>1), '', 'id'); + array('courseworkid' => $this->id, 'finalised' => 1), '', 'id'); foreach ($submissions as &$submission) { $submission = submission::find($submission); @@ -2534,7 +2534,7 @@ public function extensions_enabled() { public function extension_exists(){ global $DB; - return $DB->record_exists('coursework_extensions',array('courseworkid'=>$this->id)); + return $DB->record_exists('coursework_extensions',array('courseworkid' => $this->id)); } public function get_submissions_with_extensions(){ @@ -2548,7 +2548,7 @@ public function get_submissions_with_extensions(){ AND ce.allocatabletype = cs.allocatabletype AND cs.courseworkid = :courseworkid"; - return $DB->get_records_sql($sql,array('courseworkid'=>$this->id)); + return $DB->get_records_sql($sql,array('courseworkid' => $this->id)); } /** @@ -2564,7 +2564,7 @@ public function get_coursework_submission_personal_deadlines(){ AND pd.allocatabletype = cs.allocatabletype WHERE cs.courseworkid = :courseworkid"; - $submissions = $DB->get_records_sql($sql,array('courseworkid'=>$this->id)); + $submissions = $DB->get_records_sql($sql,array('courseworkid' => $this->id)); // for submissions that don't have a set personal deadline give coursework's default deadline if($submissions) { @@ -2592,7 +2592,7 @@ public function get_coursework_submission_personal_deadlines(){ public function has_automatic_sampling_at_stage($stage) { global $DB; - return $DB->record_exists('coursework_sample_set_rules',array('courseworkid'=>$this->id,'stage_identifier'=>$stage)); + return $DB->record_exists('coursework_sample_set_rules',array('courseworkid' => $this->id,'stage_identifier' => $stage)); } @@ -2619,7 +2619,7 @@ public function get_allocatables_with_feedback($stage, $random = false) { } return $DB->get_records_sql($sql, - array('coursework_id' => $this->id, "stage"=>$stage)); + array('coursework_id' => $this->id, "stage" => $stage)); } diff --git a/classes/models/moderation.php b/classes/models/moderation.php index d78c1772..5e73decd 100644 --- a/classes/models/moderation.php +++ b/classes/models/moderation.php @@ -94,7 +94,7 @@ public function get_feedback(){ global $DB; //Moderation done only for single courseworks so submission id to retrieve feedback is enough - $params = array('id'=>$this->feedbackid); + $params = array('id' => $this->feedbackid); $feedback = $DB->get_record('coursework_feedbacks', $params); return $feedback; diff --git a/classes/models/submission.php b/classes/models/submission.php index 9404f251..c880ff3c 100644 --- a/classes/models/submission.php +++ b/classes/models/submission.php @@ -1414,7 +1414,7 @@ public function final_draft_feedbacks_exist() { AND cf.timecreated + c.gradeeditingtime > :time "; - $editablefeedbacks = $DB->get_records_sql($sql,array('submissionid'=>$this->id,'time'=>time())); + $editablefeedbacks = $DB->get_records_sql($sql,array('submissionid' => $this->id,'time' => time())); return (empty($editablefeedbacks)) ? false : $editablefeedbacks; } @@ -1476,8 +1476,8 @@ function can_be_unfinalised() { function has_specific_assessor_feedback($assessorid){ global $DB; - $feedback = $DB->get_record('coursework_feedbacks', array('submissionid'=>$this->id, - 'assessorid'=>$assessorid)); + $feedback = $DB->get_record('coursework_feedbacks', array('submissionid' => $this->id, + 'assessorid' => $assessorid)); return (empty($feedback)) ? false : $feedback; } diff --git a/classes/personal_deadline/table/row/builder.php b/classes/personal_deadline/table/row/builder.php index 60e69fc8..b421a632 100644 --- a/classes/personal_deadline/table/row/builder.php +++ b/classes/personal_deadline/table/row/builder.php @@ -189,7 +189,7 @@ public function get_personal_deadlines() { $personal_deadline = $DB->get_record('coursework_person_deadlines', array('courseworkid' => $this->get_coursework()->id, 'allocatableid' => $this->allocatable->id(), - 'allocatabletype'=> $this->allocatable->type())); + 'allocatabletype' => $this->allocatable->type())); if ($personal_deadline){ $personal_deadline = $personal_deadline->personal_deadline; } else { @@ -206,7 +206,7 @@ public function get_submission_status() { $submission_db = $DB->get_record('coursework_submissions', array('courseworkid' => $this->get_coursework()->id, 'allocatableid' => $this->allocatable->id(), - 'allocatabletype'=> $this->allocatable->type())); + 'allocatabletype' => $this->allocatable->type())); $submission = \mod_coursework\models\submission::find($submission_db); 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 ab57ee56..24504efa 100644 --- a/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php +++ b/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php @@ -186,7 +186,7 @@ private function new_moderation_button($rowobject, $assessor) { return $OUTPUT->action_link($link, $title, null, - array('class'=>'new_moderation','id' => $link_id)); + array('class' => 'new_moderation','id' => $link_id)); } @@ -239,6 +239,6 @@ private function show_moderation_button($rowobject) { return $OUTPUT->action_link($link, $linktitle, null, - array('class'=>'show_moderation','id' => $link_id)); + array('class' => 'show_moderation','id' => $link_id)); } } diff --git a/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php b/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php index b6714358..5abb6e98 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 @@ -130,7 +130,7 @@ public function get_content($rowobject) { $iconlink = $OUTPUT->action_link($link, $title, null, - array('class'=>'new_final_feedback', + array('class' => 'new_final_feedback', 'id' => 'new_final_feedback_' . $rowobject->get_coursework() ->get_allocatable_identifier_hash($rowobject->get_allocatable()))); @@ -144,7 +144,7 @@ public function get_content($rowobject) { $iconlink = $OUTPUT->action_link($link, $linktitle, null, - array('class'=>'show_feedback','id' => $link_id)); + array('class' => 'show_feedback','id' => $link_id)); } } diff --git a/classes/render_helpers/grading_report/cells/personal_deadline_cell.php b/classes/render_helpers/grading_report/cells/personal_deadline_cell.php index cedfa016..3b1e3ef5 100644 --- a/classes/render_helpers/grading_report/cells/personal_deadline_cell.php +++ b/classes/render_helpers/grading_report/cells/personal_deadline_cell.php @@ -72,7 +72,7 @@ public function get_table_cell($row_object) { $content .= $OUTPUT->action_icon($link, $icon, null, - array('class' => $class,'data-get' =>json_encode($new_personal_deadline_params), 'data-time' => date('d-m-Y H:i', $deadline) )); + array('class' => $class,'data-get' => json_encode($new_personal_deadline_params), '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/single_assessor_feedback_cell.php b/classes/render_helpers/grading_report/cells/single_assessor_feedback_cell.php index 43283fbd..1840154a 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 @@ -204,7 +204,7 @@ private function show_feedback_button($rowobject) { $iconlink = $OUTPUT->action_link($link, $linktitle, null, - array('class'=>'show_feedback','id' => $link_id)); + array('class' => 'show_feedback','id' => $link_id)); return $iconlink; @@ -235,7 +235,7 @@ private function new_feedback_button($rowobject, $assessor) { return $OUTPUT->action_link($link, $title, null, - array('class'=>'new_final_feedback','id' => $link_id)); + array('class' => 'new_final_feedback','id' => $link_id)); } } diff --git a/classes/render_helpers/grading_report/cells/time_submitted_cell.php b/classes/render_helpers/grading_report/cells/time_submitted_cell.php index 43572a13..3c08d4c3 100644 --- a/classes/render_helpers/grading_report/cells/time_submitted_cell.php +++ b/classes/render_helpers/grading_report/cells/time_submitted_cell.php @@ -156,7 +156,7 @@ public function prepare_content_cell($row_object) { $content .= $OUTPUT->action_link($link, $title, null, - array('class' => 'new_deadline_extension', 'data-name' => $row_object->get_allocatable()->name(), 'data-params' => json_encode($new_extension_params), 'data-time' =>json_encode($content_time) )); + array('class' => 'new_deadline_extension', 'data-name' => $row_object->get_allocatable()->name(), 'data-params' => json_encode($new_extension_params), 'data-time' => json_encode($content_time) )); } else if ($ability->can('edit', $extension) && $coursework->extensions_enabled()) { $link = $this->get_router()->get_path('edit deadline extension', array('id' => $extension->id)); @@ -165,7 +165,7 @@ public function prepare_content_cell($row_object) { $content .= $OUTPUT->action_icon($link, $icon, null, - array('class' => 'edit_deadline_extension', 'data-name' => $row_object->get_allocatable()->name(), 'data-params' => json_encode($new_extension_params), 'data-time' =>json_encode($content_time))); + array('class' => 'edit_deadline_extension', 'data-name' => $row_object->get_allocatable()->name(), 'data-params' => json_encode($new_extension_params), 'data-time' => json_encode($content_time))); } diff --git a/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php b/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php index 7f49d599..d5bb812d 100644 --- a/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php +++ b/classes/render_helpers/grading_report/sub_rows/multi_marker_feedback_sub_rows.php @@ -259,7 +259,7 @@ private function show_feedback_link($feedback_row) { $iconlink = $OUTPUT->action_link($link, $linktitle, null, - array('class'=>'show_feedback','id' => $link_id)); + array('class' => 'show_feedback','id' => $link_id)); return $iconlink; } @@ -285,7 +285,7 @@ protected function new_feedaback_link($feedback_row) { $iconlink = $OUTPUT->action_link($link, $linktitle, null, - array('class'=>'new_feedback')); + array('class' => 'new_feedback')); return $iconlink; } diff --git a/classes/router.php b/classes/router.php index 88a0eb6e..6cf568f1 100644 --- a/classes/router.php +++ b/classes/router.php @@ -205,7 +205,7 @@ public function get_path($path_name, $items = array(), $as_url_object = false, $ case 'new moderations': $params = array('submissionid' => $items['submission']->id, 'stage_identifier' => $items['stage']->identifier(), - 'feedbackid' =>$items['feedbackid']); + 'feedbackid' => $items['feedbackid']); $url = new moodle_url('/mod/coursework/actions/moderations/new.php',$params); break; @@ -216,7 +216,7 @@ public function get_path($path_name, $items = array(), $as_url_object = false, $ case 'edit moderation': $url = new moodle_url('/mod/coursework/actions/moderations/edit.php', array('moderationid' => $items['moderation']->id, - 'feedbackid' =>$items['moderation']->feedbackid)); + 'feedbackid' => $items['moderation']->feedbackid)); break; case 'update moderation': @@ -226,13 +226,13 @@ public function get_path($path_name, $items = array(), $as_url_object = false, $ case 'show moderation': $url = new moodle_url('/mod/coursework/actions/moderations/show.php', array('moderationid' => $items['moderation']->id, - 'feedbackid' =>$items['moderation']->feedbackid)); + 'feedbackid' => $items['moderation']->feedbackid)); break; case 'new plagiarism flag': $url = new moodle_url('/mod/coursework/actions/plagiarism_flagging/new.php', - array('submissionid' =>$items['submission']->id )); + array('submissionid' => $items['submission']->id )); break; diff --git a/classes/sample_set_rule/range_sample_type.php b/classes/sample_set_rule/range_sample_type.php index 4f3dc26f..a163b92a 100644 --- a/classes/sample_set_rule/range_sample_type.php +++ b/classes/sample_set_rule/range_sample_type.php @@ -82,9 +82,9 @@ public function add_form_elements($assessor_number=0) { - $html .= html_writer::link('#',get_string('addgraderule','mod_coursework'),array('id'=>"assessor_{$assessor_number}_addgradderule", 'class'=>'addgradderule sample_set_rule')); + $html .= html_writer::link('#',get_string('addgraderule','mod_coursework'),array('id' => "assessor_{$assessor_number}_addgradderule", 'class' => 'addgradderule sample_set_rule')); $html .= " "; - $html .= html_writer::link('#',get_string('removegraderule','mod_coursework'),array('id'=>"assessor_{$assessor_number}_removegradderule", 'class'=>'removegradderule sample_set_rule')); + $html .= html_writer::link('#',get_string('removegraderule','mod_coursework'),array('id' => "assessor_{$assessor_number}_removegradderule", 'class' => 'removegradderule sample_set_rule')); @@ -113,17 +113,17 @@ public function range_elements($assessor_number,$sequence,$dbrecord=false) { } if ($dbrecord) { - $selected_type = array($dbrecord->ruletype=>get_string($dbrecord->ruletype, 'mod_coursework')); - $selected_to = ($dbrecord->ruletype == 'scale') ? array($dbrecord->upperlimit=>$scale[$dbrecord->upperlimit]) : array($dbrecord->upperlimit=>$dbrecord->upperlimit); + $selected_type = array($dbrecord->ruletype=> get_string($dbrecord->ruletype, 'mod_coursework')); + $selected_to = ($dbrecord->ruletype == 'scale') ? array($dbrecord->upperlimit=> $scale[$dbrecord->upperlimit]) : array($dbrecord->upperlimit=> $dbrecord->upperlimit); - $selected_from = ($dbrecord->ruletype == 'scale') ? array($dbrecord->lowerlimit=>$scale[$dbrecord->lowerlimit]) : array($dbrecord->lowerlimit=>$dbrecord->lowerlimit); + $selected_from = ($dbrecord->ruletype == 'scale') ? array($dbrecord->lowerlimit=> $scale[$dbrecord->lowerlimit]) : array($dbrecord->lowerlimit=> $dbrecord->lowerlimit); $rules_checked = ($dbrecord) ? true : false; } else { - $selected_type = array('percentage'=>get_string('percentage', 'mod_coursework')); - $selected_to = array('100'=>'100'); - $selected_from = array('0'=>'0');; + $selected_type = array('percentage' => get_string('percentage', 'mod_coursework')); + $selected_to = array('100' => '100'); + $selected_from = array('0' => '0');; $rules_checked = false; } @@ -360,7 +360,7 @@ public function save_form_data($assessor_number=0,&$order=0) { $sample_from = optional_param_array("assessor_{$assessor_number}_samplefrom",false,PARAM_RAW); $sample_to = optional_param_array("assessor_{$assessor_number}_sampleto",false,PARAM_RAW); - $sample_plugin = $DB->get_record('coursework_sample_set_plugin',array('rulename'=>'range_sample_type')); + $sample_plugin = $DB->get_record('coursework_sample_set_plugin',array('rulename' => 'range_sample_type')); if ($sample_rules) { foreach ($sample_rules as $i => $val) { @@ -401,7 +401,7 @@ public function adjust_sample_set($stage_number,&$allocatables,&$manual_sample_s AND stage_identifier = :stage ORDER BY ruleorder"; - $ruleinstance = $DB->get_records_sql($sql,array('courseworkid'=>$this->coursework->id,'stage'=>$stage)); + $ruleinstance = $DB->get_records_sql($sql,array('courseworkid' => $this->coursework->id,'stage' => $stage)); foreach($ruleinstance as $ri) { @@ -444,7 +444,7 @@ private function rationalise($ruletype,$limit1,$limit2) { $limits[0] = $this->coursework->grade * $limits[0] / 100; $limits[1] = $this->coursework->grade * $limits[1] / 100; } else { - $scale = $DB->get_record("scale",array('id'=>abs($this->coursework->grade))); + $scale = $DB->get_record("scale",array('id' => abs($this->coursework->grade))); if ($scale) { @@ -487,8 +487,8 @@ private function get_allocatables_in_range($stage,$limit1,$limit2) { //means the values are cast as strings - return $DB->get_records_sql($sql, array('courseworkid'=>$this->coursework->id, - 'stage'=>$stage)); + return $DB->get_records_sql($sql, array('courseworkid' => $this->coursework->id, + 'stage' => $stage)); } diff --git a/classes/sample_set_rule/sample_base.php b/classes/sample_set_rule/sample_base.php index 26fc0670..61c3698e 100644 --- a/classes/sample_set_rule/sample_base.php +++ b/classes/sample_set_rule/sample_base.php @@ -172,7 +172,7 @@ protected function finalised_submissions(){ WHERE s.courseworkid = :courseworkid AND f.stage_identifier = 'final_agreed_1'"; - return $DB->get_records_sql($sql, array('courseworkid'=>$this->coursework->id)); + return $DB->get_records_sql($sql, array('courseworkid' => $this->coursework->id)); } @@ -188,7 +188,7 @@ protected function released_submissions(){ WHERE courseworkid = :courseworkid AND firstpublished IS NOT NULL"; - return $DB->get_records_sql($sql, array('courseworkid'=>$this->coursework->id)); + return $DB->get_records_sql($sql, array('courseworkid' => $this->coursework->id)); } diff --git a/classes/sample_set_rule/total_sample_type.php b/classes/sample_set_rule/total_sample_type.php index e2bd2345..3f158572 100644 --- a/classes/sample_set_rule/total_sample_type.php +++ b/classes/sample_set_rule/total_sample_type.php @@ -63,7 +63,7 @@ public function add_form_elements($assessor_number=0) { AND sr.stage_identifier = 'assessor_{$assessor_number}' AND sp.rulename = 'total_sample_type'"; - $selected = ($record = $DB->get_record_sql($sql)) ? array($record->upperlimit=>$record->upperlimit) : false; + $selected = ($record = $DB->get_record_sql($sql)) ? array($record->upperlimit=> $record->upperlimit) : false; $checked = ($selected) ? true : false; @@ -77,7 +77,7 @@ public function add_form_elements($assessor_number=0) { $html = html_writer::start_div('sampletotal'); $html .= html_writer::checkbox("assessor_{$assessor_number}_sampletotal_checkbox",1,$checked,get_string('topupto','mod_coursework'), - array('id'=>"assessor_{$assessor_number}_sampletotal_checkbox",'class'=>"assessor_{$assessor_number} total_checkbox sample_set_rule")); + array('id' => "assessor_{$assessor_number}_sampletotal_checkbox",'class' => "assessor_{$assessor_number} total_checkbox sample_set_rule")); @@ -85,7 +85,7 @@ public function add_form_elements($assessor_number=0) { "assessor_{$assessor_number}_sampletotal", "", $selected, - array('id'=>"assessor_{$assessor_number}_sampletotal", 'class' => " sample_set_rule")); + array('id' => "assessor_{$assessor_number}_sampletotal", 'class' => " sample_set_rule")); $html .= html_writer::label(get_string('ofallstudents', 'mod_coursework'),'assessortwo_sampletotal[]'); $html .= html_writer::end_div(); @@ -168,7 +168,7 @@ public function adjust_sample_set($stage_number,&$allocatables,&$manual_sample_s AND stage_identifier = :stage ORDER BY ruleorder"; - $rule = $DB->get_record_sql($sql,array('courseworkid'=>$this->coursework->id,'stage'=>$stage)); + $rule = $DB->get_record_sql($sql,array('courseworkid' => $this->coursework->id,'stage' => $stage)); if ($rule) { diff --git a/classes/stages/base.php b/classes/stages/base.php index 004adba8..6fcf33d0 100644 --- a/classes/stages/base.php +++ b/classes/stages/base.php @@ -255,7 +255,7 @@ private function get_next_teacher($allocatable) { private function get_percentage_allocated_teachers(){ global $DB; - return $DB->get_records('coursework_allocation_config', array('courseworkid'=>$this->get_coursework_id()),'','assessorid as id'); + return $DB->get_records('coursework_allocation_config', array('courseworkid' => $this->get_coursework_id()),'','assessorid as id'); } /** @@ -560,7 +560,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->stage_identifier ); $DB->delete_records('coursework_sample_set_mbrs', $params); } @@ -824,7 +824,7 @@ public function potential_marker_dropdown($allocatable) { */ public function potential_moderator_dropdown($allocatable) { - $option_for_nothing_chosen_yet = array('' =>'Choose Moderator'); + $option_for_nothing_chosen_yet = array('' => 'Choose Moderator'); $html_attributes = array( 'id' => $this->moderator_dropdown_id($allocatable), 'class' => 'moderator_id_dropdown', diff --git a/classes/task/enrol_task.php b/classes/task/enrol_task.php index f85f8484..6f3988d8 100644 --- a/classes/task/enrol_task.php +++ b/classes/task/enrol_task.php @@ -44,7 +44,7 @@ public function execute() { global $DB; - $courseworkids = $DB->get_records('coursework',array('processenrol'=>1)); + $courseworkids = $DB->get_records('coursework',array('processenrol' => 1)); if (!empty($courseworkids)) { foreach ($courseworkids as $courseworkid) { @@ -58,7 +58,7 @@ public function execute() { $allocator = new \mod_coursework\allocation\auto_allocator($coursework); $allocator->process_allocations(); - $DB->set_field('coursework','processenrol',0,array('id'=>$coursework->id())); + $DB->set_field('coursework','processenrol',0,array('id' => $coursework->id())); } } diff --git a/classes/task/unenrol_task.php b/classes/task/unenrol_task.php index a23485a6..1c766ef6 100644 --- a/classes/task/unenrol_task.php +++ b/classes/task/unenrol_task.php @@ -44,7 +44,7 @@ public function execute() { global $DB; - $courseworkids = $DB->get_records('coursework',array('processunenrol'=>1)); + $courseworkids = $DB->get_records('coursework',array('processunenrol' => 1)); if (!empty($courseworkids)) { foreach ($courseworkids as $courseworkid) { @@ -56,7 +56,7 @@ public function execute() { $allocator = new \mod_coursework\allocation\auto_allocator($coursework); $allocator->process_allocations(); - $DB->set_field('coursework','processunenrol',0,array('id'=>$coursework->id())); + $DB->set_field('coursework','processunenrol',0,array('id' => $coursework->id())); } } diff --git a/db/log.php b/db/log.php index 4028ac84..cd5cd1a1 100644 --- a/db/log.php +++ b/db/log.php @@ -36,8 +36,8 @@ global $DB; $logs = array( - array('module'=>'coursework', 'action'=>'add', 'mtable'=>'coursework', 'field'=>'name'), - array('module'=>'coursework', 'action'=>'update', 'mtable'=>'coursework', 'field'=>'name'), - array('module'=>'coursework', 'action'=>'view', 'mtable'=>'coursework', 'field'=>'name'), - array('module'=>'coursework', 'action'=>'view all', 'mtable'=>'coursework', 'field'=>'name') + array('module' => 'coursework', 'action' => 'add', 'mtable' => 'coursework', 'field' => 'name'), + array('module' => 'coursework', 'action' => 'update', 'mtable' => 'coursework', 'field' => 'name'), + array('module' => 'coursework', 'action' => 'view', 'mtable' => 'coursework', 'field' => 'name'), + array('module' => 'coursework', 'action' => 'view all', 'mtable' => 'coursework', 'field' => 'name') ); diff --git a/lib.php b/lib.php index 0c344829..9f2d53fe 100644 --- a/lib.php +++ b/lib.php @@ -447,13 +447,13 @@ function coursework_update_instance($coursework) { $coursework->submissionnotification = $subnotify; - $courseworkhassubmissions = ($DB->get_records('coursework_submissions',array('courseworkid'=>$coursework->id))) + $courseworkhassubmissions = ($DB->get_records('coursework_submissions',array('courseworkid' => $coursework->id))) ? true : false; //if the coursework has submissions then we the renamefiles setting can't be changes if ($courseworkhassubmissions) { - $currentcoursework = $DB->get_record('coursework',array('id'=>$coursework->id)); + $currentcoursework = $DB->get_record('coursework',array('id' => $coursework->id)); $coursework->renamefiles = $currentcoursework->renamefiles; @@ -535,7 +535,7 @@ function coursework_update_events($coursework, $eventtype){ global $DB; $event = ""; - $eventid = $DB->get_record('event', array('modulename'=>'coursework', 'instance'=>$coursework->id, 'eventtype'=>$eventtype)); + $eventid = $DB->get_record('event', array('modulename' => 'coursework', 'instance' => $coursework->id, 'eventtype' => $eventtype)); if ($eventid){ $event = calendar_event::load($eventid->id); @@ -575,7 +575,7 @@ function coursework_update_events($coursework, $eventtype){ function remove_event($coursework, $eventtype = false){ global $DB; - $params = array('modulename'=>'coursework', 'instance'=>$coursework->id); + $params = array('modulename' => 'coursework', 'instance' => $coursework->id); if ($eventtype){ $params['eventtype'] = $eventtype; @@ -923,7 +923,7 @@ function coursework_role_assigned_event_handler($roleassignment) { $courseworkids = coursework_get_coursework_ids_from_context_id($roleassignment->contextid); foreach ($courseworkids as $courseworkid) { - $DB->set_field('coursework','processenrol',1,array('id'=>$courseworkid)); + $DB->set_field('coursework','processenrol',1,array('id' => $courseworkid)); } return true; @@ -944,7 +944,7 @@ function coursework_role_unassigned_event_handler($roleassignment) { $courseworkids = coursework_get_coursework_ids_from_context_id($roleassignment->contextid); foreach ($courseworkids as $courseworkid) { - $DB->set_field('coursework','processunenrol',1,array('id'=>$courseworkid)); + $DB->set_field('coursework','processunenrol',1,array('id' => $courseworkid)); } return true; @@ -1287,7 +1287,7 @@ function course_group_member_added($event_data) { $addeduserid = $event_data->relateduserid; // get all courseworks with group_assessor allocation strategy - $courseworks = $DB->get_records('coursework', array('course'=>$courseid, 'assessorallocationstrategy' => 'group_assessor')); + $courseworks = $DB->get_records('coursework', array('course' => $courseid, 'assessorallocationstrategy' => 'group_assessor')); foreach($courseworks as $coursework){ @@ -1353,7 +1353,7 @@ function course_group_member_removed($event_data) { $removeduserid = $event_data->relateduserid; // get all courseworks with group_assessor allocation strategy - $courseworks = $DB->get_records('coursework', array('course'=>$courseid, 'assessorallocationstrategy' => 'group_assessor')); + $courseworks = $DB->get_records('coursework', array('course' => $courseid, 'assessorallocationstrategy' => 'group_assessor')); foreach($courseworks as $coursework){ @@ -1504,7 +1504,7 @@ function has_user_seen_tii_EULA_agreement(){ AND user_agreement_accepted <> 0"; } - $shouldseeEULA = $DB->record_exists_sql($sql, array('userid'=>$USER->id)); + $shouldseeEULA = $DB->record_exists_sql($sql, array('userid' => $USER->id)); } } else { $shouldseeEULA = true; @@ -1520,7 +1520,7 @@ function coursework_is_ulcc_digest_coursework_plugin_installed() { $disgestblockexists = $DB->record_exists_sql("SELECT id FROM {block} WHERE name = 'ulcc_digest' AND visible = 1"); if (!empty($disgestblockexists)) { - $pluginexists = ($DB->get_records('block_ulcc_digest_plgs',array('module'=>'coursework','status'=>1))) ? true : false; + $pluginexists = ($DB->get_records('block_ulcc_digest_plgs',array('module' => 'coursework','status' => 1))) ? true : false; } return $pluginexists; @@ -1538,7 +1538,7 @@ function coursework_personal_deadline_passed($courseworkid){ WHERE courseworkid = :courseworkid AND personal_deadline < :now"; - return $DB->record_exists_sql($sql, array('courseworkid' =>$courseworkid , 'now' => time())); + return $DB->record_exists_sql($sql, array('courseworkid' => $courseworkid , 'now' => time())); } @@ -1616,8 +1616,8 @@ function teacher_removed_allocated_not_graded($event_data){ foreach($courseworks as $cw){ $coursework = coursework::find($cw->id); if($coursework->allocation_enabled()){ - $assessor_allocations = $DB->get_records('coursework_allocation_pairs', array('courseworkid'=>$coursework->id, - 'assessorid'=>$userid)); + $assessor_allocations = $DB->get_records('coursework_allocation_pairs', array('courseworkid' => $coursework->id, + 'assessorid' => $userid)); foreach($assessor_allocations as $allocation){ if($allocation->allocatabletype == 'user'){ $allocatable = user::find($allocation->allocatableid); @@ -1631,9 +1631,9 @@ function teacher_removed_allocated_not_graded($event_data){ continue; } - $DB->delete_records('coursework_allocation_pairs', array('courseworkid'=>$coursework->id, - 'assessorid'=>$userid, - 'allocatableid'=>$allocatable->id)); + $DB->delete_records('coursework_allocation_pairs', array('courseworkid' => $coursework->id, + 'assessorid' => $userid, + 'allocatableid' => $allocatable->id)); } } } @@ -1651,6 +1651,6 @@ function teacher_removed_allocated_not_graded($event_data){ function coursework_get_courseworks_by_courseid($courseid){ global $DB; - return $DB->get_records('coursework', array('course'=>$courseid)); + return $DB->get_records('coursework', array('course' => $courseid)); } diff --git a/mod_form.php b/mod_form.php index abcfcc83..ed49f6c7 100644 --- a/mod_form.php +++ b/mod_form.php @@ -364,7 +364,7 @@ protected function add_submission_deadline_field() { $moodle_form->addElement('date_time_selector', 'deadline', get_string('deadline', 'coursework'), - array('optional' => $optional, 'disabled'=> $disabled)); + array('optional' => $optional, 'disabled' => $disabled)); @@ -564,7 +564,7 @@ protected function add_relative_initial_marking_deadline_field() { $moodle_form =& $this->_form; - $options = array('0'=>get_string('disabled', 'mod_coursework')); + $options = array('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'); @@ -592,7 +592,7 @@ protected function add_relative_agreed_grade_marking_deadline_field() { $moodle_form =& $this->_form; - $options = array('0'=>get_string('disabled', 'mod_coursework')); + $options = array('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'); @@ -690,7 +690,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', array('courseid' => $COURSE->id), 'name', 'id, name'); $groups_options = array(); if ($groups_options_result !== false) { foreach ($groups_options_result as $result) { @@ -796,7 +796,7 @@ protected function add_rename_file_field() { $moodle_form =& $this->_form; - $choices = array('0'=>get_string('no'),'1'=>get_string('yes')); + $choices = array('0' => get_string('no'),'1' => get_string('yes')); $courseworkid = $this->get_coursework_id(); $courseworkhassubmissions = (!empty($courseworkid)) ? $courseworkhassubmissions = $DB->get_records('coursework_submissions', array('courseworkid' => $courseworkid)) @@ -833,7 +833,7 @@ protected function add_rename_file_field() { AND renamefiles = 1"; - $settingvalue = ($DB->get_records_sql($sql,array('courseworkid'=>$courseworkid))) ? get_string('yesrenamefile','mod_coursework') : get_string('norenamefile','mod_coursework') ; + $settingvalue = ($DB->get_records_sql($sql,array('courseworkid' => $courseworkid))) ? get_string('yesrenamefile','mod_coursework') : get_string('norenamefile','mod_coursework') ; $moodle_form->addElement('static', 'renamefilesdescription', get_string('renamefiles', 'mod_coursework'), $settingvalue); @@ -1164,7 +1164,7 @@ protected function add_tweaks_to_standard_grading_form_elements() { // $moodle_form->setDefault('automaticagreement',0); // $moodle_form->disabledIf('automaticagreement', 'numberofmarkers', 'eq', '1'); // -// $moodle_form->addElement('text', 'automaticagreementrange', get_string('automaticagreementrange', 'mod_coursework'),array('size'=>3)); +// $moodle_form->addElement('text', 'automaticagreementrange', get_string('automaticagreementrange', 'mod_coursework'),array('size' => 3)); // $moodle_form->addHelpButton('automaticagreementrange', 'automaticagreementrange', 'mod_coursework'); // $moodle_form->setDefault('automaticagreementrange',0); // $moodle_form->disabledIf('automaticagreementrange', 'automaticagreement', 'eq', '0'); @@ -1252,7 +1252,7 @@ private function add_enable_agreed_grade_delay() { $moodle_form =& $this->_form; - $options = array('0'=>get_string('disabled', 'mod_coursework')); + $options = array('0' => get_string('disabled', 'mod_coursework')); $options['1800'] = get_string('timedminutes', 'mod_coursework','30'); $options['3600'] = get_string('timedhour', 'mod_coursework','1'); $options['7200'] = get_string('timedhours', 'mod_coursework','2'); @@ -1355,7 +1355,7 @@ private function add_submission_notification_field() { private function add_automatic_agreement_enabled() { $options = array('none' => 'none', 'percentage_distance' => 'percentage distance', - 'average_grade' =>'average grade'); + 'average_grade' => 'average grade'); $this->form()->addelement('select', 'automaticagreementstrategy', get_string('automaticagreementofgrades', 'mod_coursework'), diff --git a/renderers/grading_report_renderer.php b/renderers/grading_report_renderer.php index 0e791509..360fdf47 100644 --- a/renderers/grading_report_renderer.php +++ b/renderers/grading_report_renderer.php @@ -91,10 +91,10 @@ private function generate_lang_element() { 'loadingpagination' => get_string('loadingpagination', 'mod_coursework') ]; $result = html_writer::empty_tag('input',array( - 'name'=>'', - 'type'=>'hidden', - 'data-lang'=>json_encode($lang_messages), - 'id'=>'element_lang_messages' + 'name' => '', + 'type' => 'hidden', + 'data-lang' => json_encode($lang_messages), + 'id' => 'element_lang_messages' )); $result = html_writer::div($result); diff --git a/renderers/object_renderer.php b/renderers/object_renderer.php index 23c21836..cd211b46 100644 --- a/renderers/object_renderer.php +++ b/renderers/object_renderer.php @@ -778,19 +778,19 @@ 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', array('class' => 'assessor-sampling-wrapper accordion')); $html .= html_writer::start_tag('h3', array('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', array('class' => 'sampling-rules')); // We want to allow the allocation strategy to add configuration options. - $html .= html_writer::start_tag('div',array('class'=>'sampling-select')); + $html .= html_writer::start_tag('div',array('class' => 'sampling-select')); $script = " var samplingValidateHdl = Array(); @@ -829,7 +829,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin $table->head = $assessorheaders; - $assessor1cell = html_writer::start_tag('div',array('class'=>'samples_strategy')); + $assessor1cell = html_writer::start_tag('div',array('class' => 'samples_strategy')); $assessor1cell .= get_string('assessoronedefault','mod_coursework'); $assessor1cell .= html_writer::end_tag('div'); @@ -853,14 +853,14 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin //check whether any rules have been saved for this stage $selected = ($samplingwidget->get_coursework()->has_automatic_sampling_at_stage('assessor_'.$i)) ? '1' : false; - $sampling_cell = html_writer::start_tag('div',array('class'=>'samples_strategy')); + $sampling_cell = html_writer::start_tag('div',array('class' => 'samples_strategy')); $sampling_cell .= html_writer::label(get_string('sampletype', 'mod_coursework'), "assessor_{$i}_samplingstrategy"); $sampling_cell .= html_writer::select($sampling_strategies, "assessor_{$i}_samplingstrategy", $selected, false, - array('id'=>"assessor_{$i}_samplingstrategy",'class'=>"assessor_sampling_strategy sampling_strategy_detail")); + array('id' => "assessor_{$i}_samplingstrategy",'class' => "assessor_sampling_strategy sampling_strategy_detail")); $sampling_cell .= html_writer::end_tag('div'); @@ -876,7 +876,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,'', array('id' => "assessor_{$i}_automatic_rules")); $columndata[] = new html_table_cell($sampling_cell); } @@ -954,7 +954,7 @@ private function sampling_strategy_column($samplingwidget,$suffix = '') { $sampling_column .= html_writer::start_tag('span', array('class' => "assessor_{$suffix}_grade_rules", 'id' => "assessor_{$suffix}_grade_rules")); $sampling_column .= html_writer::checkbox("assessor_{$suffix}_samplerules[]", 1, false, get_string('grade', 'mod_coursework'), - array('id' => "assessor_{$suffix}_samplerules_{$i}", 'class'=>"assessor_{$suffix} sampling_strategy_detail")); + array('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')); @@ -963,7 +963,7 @@ private function sampling_strategy_column($samplingwidget,$suffix = '') { "assessor_{$suffix}_sampletype[]", $samplingwidget->get_sampling_strategy(), false, - array('id' => "assessor_{$suffix}_sampletype_{$i}", 'class'=>"grade_type assessor_{$suffix} sampling_strategy_detail")); + array('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]'); @@ -973,7 +973,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")); + array('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]"); @@ -981,7 +981,7 @@ 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")); + array('id' => "assessor_{$suffix}_sampleto_{$i}", 'class' => "assessor_{$suffix} sampling_strategy_detail")); $sampling_column .= html_writer::end_tag('span', ''); @@ -990,12 +990,12 @@ private function sampling_strategy_column($samplingwidget,$suffix = '') { $sampling_column .= html_writer::end_tag('div'); - $sampling_column .= html_writer::link('#',get_string('addgraderule','mod_coursework'),array('id'=>"assessor_{$suffix}_addgradderule", 'class'=>'addgradderule sampling_strategy_detail')); - $sampling_column .= html_writer::link('#',get_string('removegraderule','mod_coursework'),array('id'=>"assessor_{$suffix}_removegradderule", 'class'=>'removegradderule sampling_strategy_detail')); + $sampling_column .= html_writer::link('#',get_string('addgraderule','mod_coursework'),array('id' => "assessor_{$suffix}_addgradderule", 'class' => 'addgradderule sampling_strategy_detail')); + $sampling_column .= html_writer::link('#',get_string('removegraderule','mod_coursework'),array('id' => "assessor_{$suffix}_removegradderule", 'class' => 'removegradderule sampling_strategy_detail')); $sampling_column .= html_writer::checkbox("assessor_{$suffix}_samplertopup",1,false,get_string('topupto','mod_coursework'), - array('id'=>"assessor_{$suffix}_samplerules[]",'class'=>"assessor_{$suffix} sampling_strategy_detail")); + array('id' => "assessor_{$suffix}_samplerules[]",'class' => "assessor_{$suffix} sampling_strategy_detail")); @@ -1003,7 +1003,7 @@ private function sampling_strategy_column($samplingwidget,$suffix = '') { "assessor_{$suffix}_sampletopup", $samplingwidget->get_sampling_strategy(), false, - array('id'=>"assessor_{$suffix}_sampletopup", 'class' => "assessor_{$suffix} sampling_strategy_detail")); + array('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 ; diff --git a/renderers/page_renderer.php b/renderers/page_renderer.php index 85cfd7e4..541e3b56 100644 --- a/renderers/page_renderer.php +++ b/renderers/page_renderer.php @@ -1375,7 +1375,7 @@ function process_feedback_upload($processingresults) { $html .= get_string('fileuploadresults', 'mod_coursework')."
"; foreach ($processingresults as $file => $result) { - $html .= get_string('fileuploadresult', 'mod_coursework',array('filename'=>$file,'result'=>$result)). "
"; + $html .= get_string('fileuploadresult', 'mod_coursework',array('filename' => $file,'result' => $result)). "
"; } $html .= html_writer::end_tag('p'); } else { @@ -1397,7 +1397,7 @@ function process_feedback_upload($processingresults) { function view_course_index($courseid) { global $CFG, $DB, $USER; $o = ''; - $course = $DB->get_record('course', array('id'=>$courseid)); + $course = $DB->get_record('course', array('id' => $courseid)); $strplural = get_string('modulenameplural', 'assign'); if (!$cms = get_coursemodules_in_course('coursework', $course->id, 'm.deadline')) { $o .= $this->get_renderer()->notification(get_string('thereareno', 'moodle', $strplural)); @@ -1467,12 +1467,12 @@ function view_course_index($courseid) { } $url = $CFG->wwwroot.'/mod/coursework/view.php'; $link = "coursemodule->id}\">{$coursework->name}"; - $table->data[] = array(//'cmid'=>$cm->id, - 'sectionname'=>$printsection, - 'cmname'=>$link, - 'timedue'=>$timedue, - 'submissioninfo'=>$submitted, - 'gradeinfo'=>$grade); + $table->data[] = array(//'cmid' => $cm->id, + 'sectionname' => $printsection, + 'cmname' => $link, + 'timedue' => $timedue, + 'submissioninfo' => $submitted, + 'gradeinfo' => $grade); } $o = html_writer::table($table); return $o; @@ -1493,9 +1493,9 @@ public function datatables_render($coursework){ 'alert_personaldeadline_save_successful' => str_replace(' ', '_', get_string('alert_personaldeadline_save_successful', 'mod_coursework')), 'alert_validate_deadline' => str_replace(' ', '_', get_string('alert_validate_deadline', 'mod_coursework')), 'url_root' => $CFG->wwwroot, - 'alert_feedback_save_successful'=>str_replace(' ', '_', get_string('alert_feedback_save_successful', 'mod_coursework')), - 'alert_feedback_remove_successful'=>str_replace(' ', '_', get_string('alert_feedback_remove_successful', 'mod_coursework')), - 'alert_request_error'=>str_replace(' ', '_', get_string('alert_request_error', 'mod_coursework')), + 'alert_feedback_save_successful' => str_replace(' ', '_', get_string('alert_feedback_save_successful', 'mod_coursework')), + 'alert_feedback_remove_successful' => str_replace(' ', '_', get_string('alert_feedback_remove_successful', 'mod_coursework')), + 'alert_request_error' => str_replace(' ', '_', get_string('alert_request_error', 'mod_coursework')), 'alert_feedback_draft_save_successful' => str_replace(' ', '_', get_string('alert_feedback_draft_save_successful', 'mod_coursework')) ]; @@ -1509,57 +1509,57 @@ public function datatables_render($coursework){ 'aria-label' => 'Close', 'data-dismiss' => 'modal' )); - $modal_header .= html_writer::span('×','',array('aria-hidden'=>'true')); + $modal_header .= html_writer::span('×','',array('aria-hidden' => 'true')); $modal_header .= html_writer::end_tag('button'); - $modal_body = html_writer::start_tag('form', array('id'=>'form-extension')); + $modal_body = html_writer::start_tag('form', array('id' => 'form-extension')); $content = html_writer::empty_tag('input',array( - 'name'=>'allocatabletype', - 'type'=>'hidden', - 'value'=>'', - 'id'=>'extension-allocatabletype' + 'name' => 'allocatabletype', + 'type' => 'hidden', + 'value' => '', + 'id' => 'extension-allocatabletype' )); $content .= html_writer::empty_tag('input',array( - 'name'=>'allocatableid', - 'type'=>'hidden', - 'value'=>'', - 'id'=>'extension-allocatableid' + 'name' => 'allocatableid', + 'type' => 'hidden', + 'value' => '', + 'id' => 'extension-allocatableid' )); $content .= html_writer::empty_tag('input',array( - 'name'=>'courseworkid', - 'type'=>'hidden', - 'value'=>'', - 'id'=>'extension-courseworkid' + 'name' => 'courseworkid', + 'type' => 'hidden', + 'value' => '', + 'id' => 'extension-courseworkid' )); $content .= html_writer::empty_tag('input',array( - 'name'=>'id', - 'type'=>'hidden', - 'value'=>'', - 'id'=>'extension-id' + 'name' => 'id', + 'type' => 'hidden', + 'value' => '', + 'id' => 'extension-id' )); $content .= html_writer::empty_tag('input',array( - 'name'=>'submissionid', - 'type'=>'hidden', - 'value'=>'', - 'id'=>'extension-submissionid' + 'name' => 'submissionid', + 'type' => 'hidden', + 'value' => '', + 'id' => 'extension-submissionid' )); $content .= html_writer::empty_tag('input',array( - 'name'=>'name', - 'type'=>'hidden', - 'id'=>'extension-name', - 'value'=>'', + 'name' => 'name', + 'type' => 'hidden', + 'id' => 'extension-name', + 'value' => '', )); $content .= html_writer::empty_tag('input',array( - 'name'=>'aid', - 'type'=>'hidden', - 'value'=>'', - 'id'=>'button-id' + 'name' => 'aid', + 'type' => 'hidden', + 'value' => '', + 'id' => 'button-id' )); $modal_body .= html_writer::div($content,'display-none'); if ($coursework->deadline) { $content_default_deadline = 'Default deadline: ' . userdate($coursework->deadline); - $content_default_deadline = html_writer::div($content_default_deadline,'col-md-12', array('id'=>'extension-time-content')); + $content_default_deadline = html_writer::div($content_default_deadline,'col-md-12', array('id' => 'extension-time-content')); $modal_body .= html_writer::div($content_default_deadline,'form-group row fitem'); $content_extended_deadline = html_writer::tag('label',get_string('extended_deadline', 'mod_coursework')); @@ -1576,12 +1576,12 @@ public function datatables_render($coursework){ 'id' => 'extension-reason-select', 'class' => 'form-control' )); - $select_extension_reasons_div .= html_writer::div($select_extension_reasons,'col-md-9 form-inline felement', array('data-fieldtype'=>'select')); + $select_extension_reasons_div .= html_writer::div($select_extension_reasons,'col-md-9 form-inline felement', array('data-fieldtype' => 'select')); $modal_body .= html_writer::div($select_extension_reasons_div,'form-group row fitem'); } $content_extra_information = html_writer::tag('label',get_string('extra_information', 'mod_coursework'), array( - 'class'=>'col-form-label d-inline', 'for'=>'id_extra_information' + 'class' => 'col-form-label d-inline', 'for' => 'id_extra_information' )); $content_extra_information_div = html_writer::div($content_extra_information,'col-md-3'); $content_extra_information = html_writer::tag('textarea', '', array( @@ -1590,38 +1590,38 @@ public function datatables_render($coursework){ 'spellcheck' => 'true', 'id' => 'id_extra_information' )); - $content_extra_information_div .= html_writer::div($content_extra_information,'col-md-9 form-inline felement', array('data-fieldtype'=>'editor')); + $content_extra_information_div .= html_writer::div($content_extra_information,'col-md-9 form-inline felement', array('data-fieldtype' => 'editor')); $modal_body .= html_writer::div($content_extra_information_div,'form-group row fitem', array('id' => 'fitem_id_extra_information')); } $modal_body .= html_writer::end_tag('form'); $modal_footer = html_writer::empty_tag('img', array( - 'src'=> $CFG->wwwroot . '/mod/coursework/pix/loadding.gif', - 'alt'=>'Load...', - 'width'=>'25', - 'class'=>'loading_moderation icon', - 'style'=>'visibility: hidden;' + 'src' => $CFG->wwwroot . '/mod/coursework/pix/loadding.gif', + 'alt' => 'Load...', + 'width' => '25', + 'class' => 'loading_moderation icon', + 'style' => 'visibility: hidden;' )); $modal_footer .= html_writer::tag('button', 'Save', array( - 'type'=>'button', - 'class'=>'btn btn-primary', - 'id'=>'extension-submit' + 'type' => 'button', + 'class' => 'btn btn-primary', + 'id' => 'extension-submit' )); $modal_footer .= html_writer::tag('button', 'Close', array( - 'type'=>'button', - 'class'=>'btn btn-secondary btn-extension-close', - 'data-dismiss'=>'modal' + 'type' => 'button', + 'class' => 'btn btn-secondary btn-extension-close', + 'data-dismiss' => 'modal' )); $modal_footer .= html_writer::tag('button', 'Back', array( - 'type'=>'button', - 'class'=>'btn btn-secondary', - 'id'=>'extension-back' + 'type' => 'button', + 'class' => 'btn btn-secondary', + 'id' => 'extension-back' )); $modal_footer .= html_writer::tag('button', 'Next', array( - 'type'=>'button', - 'class'=>'btn btn-secondary', - 'id'=>'extension-next' + 'type' => 'button', + 'class' => 'btn btn-secondary', + 'id' => 'extension-next' )); $html = html_writer::div($modal_header, 'modal-header'); @@ -1638,10 +1638,10 @@ public function datatables_render($coursework){ 'aria-hidden' => 'true' )); $html .= html_writer::empty_tag('input',array( - 'name'=>'', - 'type'=>'hidden', - 'data-lang'=>json_encode($lang_messages), - 'id'=>'datatables_lang_messages' + 'name' => '', + 'type' => 'hidden', + 'data-lang' => json_encode($lang_messages), + 'id' => 'datatables_lang_messages' )); $html = html_writer::div($html); diff --git a/settings.php b/settings.php index e209d700..eb267121 100644 --- a/settings.php +++ b/settings.php @@ -182,7 +182,7 @@ // Default per page - $options = array('3'=>'3', '10'=>'10', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100'); + $options = array('3' => '3', '10' => '10', '20' => '20', '30' => '30', '40' => '40', '50' => '50', '100' => '100'); $grading_page_header = new admin_setting_heading('grading_page_header', get_string('grading_page', 'mod_coursework'),''); @@ -194,7 +194,7 @@ //automatic agreement delay - $options = array('0'=>get_string('disabled', 'mod_coursework')); + $options = array('0' => get_string('disabled', 'mod_coursework')); $options['1800'] = get_string('timedminutes', 'mod_coursework','30'); $options['3600'] = get_string('timedhour', 'mod_coursework','1'); $options['7200'] = get_string('timedhours', 'mod_coursework','2'); diff --git a/tests/behat/behat_mod_coursework.php b/tests/behat/behat_mod_coursework.php index 151b06cd..f0be7b12 100644 --- a/tests/behat/behat_mod_coursework.php +++ b/tests/behat/behat_mod_coursework.php @@ -1000,11 +1000,11 @@ public function theCourseworkHasSamplingEnabled() public function thereIsFeedbackForTheSubmissionFromTheOtherTeacher() { $this->feedback = feedback::create(array( - 'submissionid'=>$this->submission->id, + 'submissionid' => $this->submission->id, 'assessorid' => $this->other_teacher->id, - 'grade'=> '78', - 'feedbackcomment'=>'Blah', - 'stage_identifier'=>'assessor_1' + 'grade' => '78', + 'feedbackcomment' => 'Blah', + 'stage_identifier' => 'assessor_1' )); } diff --git a/tests/behat/pages/allocations_page.php b/tests/behat/pages/allocations_page.php index c4a51719..ef37120c 100644 --- a/tests/behat/pages/allocations_page.php +++ b/tests/behat/pages/allocations_page.php @@ -261,8 +261,8 @@ public function automatically_included_in_sample($coursework,$user,$other_user,$ $stage = "assessor_".$stage_number; - $params = array('courseworkid'=>$coursework->id, - 'user'=>$user->id, + $params = array('courseworkid' => $coursework->id, + 'user' => $user->id, 'stage' => $stage); if (empty($negate)){ diff --git a/tests/classes/export/csv_test.php b/tests/classes/export/csv_test.php index a1d9e218..ef200413 100644 --- a/tests/classes/export/csv_test.php +++ b/tests/classes/export/csv_test.php @@ -73,8 +73,8 @@ public function test_one_stage(){ $this->coursework = $generator->create_instance(array('course' => $this->course->id, 'grade' => 100, 'numberofmarkers' => 1, - 'deadline'=>time()+86400, - 'extensionsenabled'=>1)); + 'deadline' => time()+86400, + 'extensionsenabled' => 1)); $this->submission = new stdClass(); $this->submission->userid = $this->student->id; $this->submission->allocatableid = $this->student->id; @@ -167,7 +167,7 @@ public function test_two_stages(){ $this->coursework = $generator->create_instance(array('course' => $this->course->id, 'grade' => 100, 'numberofmarkers' => 2, - 'deadline'=>time()-86400)); + 'deadline' => time()-86400)); $this->submission = new stdClass(); $this->submission->userid = $this->student->id; $this->submission = $generator->create_submission($this->submission, $this->coursework); @@ -265,7 +265,7 @@ public function test_student_not_in_sample(){ 'grade' => 100, 'numberofmarkers' => 2, 'samplingenabled' => 1, - 'deadline'=>time()+86400)); + 'deadline' => time()+86400)); $this->submission = new stdClass(); $this->submission->userid = $this->student->id; $this->submission = $generator->create_submission($this->submission, $this->coursework); @@ -342,7 +342,7 @@ public function test_two_students_one_in_sample(){ 'grade' => 100, 'numberofmarkers' => 2, 'samplingenabled' => 1, - 'deadline'=>time()+86400)); + 'deadline' => time()+86400)); $student1 = $this->student; $assessor1 = $this->teacher; $assessor2 = $this->other_teacher; @@ -468,7 +468,7 @@ public function test_two_students_one_in_sample(){ '32' => $assessorname2, '33' => $assessorusername2, '34' => userdate(time(),$dateformat), - '35'=> $feedback4->grade); + '35' => $feedback4->grade); $this->assertEquals($assessors_grades, $csv_grades); } diff --git a/tests/classes/export/grading_sheet_download_test.php b/tests/classes/export/grading_sheet_download_test.php index a04374a5..c9753cad 100644 --- a/tests/classes/export/grading_sheet_download_test.php +++ b/tests/classes/export/grading_sheet_download_test.php @@ -65,7 +65,7 @@ public function test_one_stage_no_allocations(){ $this->coursework = $generator->create_instance(array('course' => $this->course->id, 'grade' => 100, 'numberofmarkers' => 1, - 'deadline'=>time()+86400)); + 'deadline' => time()+86400)); $this->submission = new stdClass(); $this->submission->userid = $this->student->id; $this->submission->allocatableid = $this->student->id; @@ -110,7 +110,7 @@ public function test_two_stages_with_allocations(){ 'grade' => 100, 'numberofmarkers' => 2, 'allocationenabled' => 1, - 'deadline'=>time()+86400)); + 'deadline' => time()+86400)); // 2 assessors $assessor1 = $this->teacher; diff --git a/version.php b/version.php index e88fc65e..f3b9fcfb 100644 --- a/version.php +++ b/version.php @@ -25,7 +25,7 @@ $plugin->component = 'mod_coursework'; -$plugin->version = 2022061000; // If version == 0 then module will not be installed +$plugin->version = 2024080600; // If version == 0 then module will not be installed $plugin->requires = 2021051700; // Requires this Moodle version 3.11 $plugin->cron = 300; // Period for cron to check this module (secs). From 7ee19b8563a95273151768dea6a98ece6100afb2 Mon Sep 17 00:00:00 2001 From: David Watson <14983002+watson8@users.noreply.github.com> Date: Mon, 12 Aug 2024 11:46:04 +0100 Subject: [PATCH 07/51] CTP-3558 coding std remove spaces newline btwn ) { --- actions/allocate.php | 2 +- actions/allocationsession.php | 4 +- actions/selectallallocatables.php | 2 +- actions/upload_allocations.php | 2 +- actions/upload_feedback.php | 4 +- actions/upload_grading_sheet.php | 2 +- .../backup_coursework_activity_task.class.php | 9 +- backup/moodle2/backup_coursework_stepslib.php | 9 +- ...restore_coursework_activity_task.class.php | 9 +- .../moodle2/restore_coursework_stepslib.php | 90 +++++++------------ classes/ability.php | 8 +- classes/allocation/manager.php | 24 ++--- classes/allocation/table/builder.php | 8 +- classes/allocation/table/cell/builder.php | 8 +- classes/allocation/table/cell/processor.php | 2 +- classes/allocation/upload.php | 4 +- classes/auto_grader/average_grade.php | 3 +- .../deadline_extensions_controller.php | 6 +- classes/controllers/feedback_controller.php | 14 +-- .../personal_deadlines_controller.php | 6 +- .../controllers/submissions_controller.php | 4 +- .../export/csv/cells/agreedfeedback_cell.php | 2 +- classes/export/csv/cells/agreedgrade_cell.php | 8 +- .../csv/cells/assessorfeedback_cell.php | 6 +- .../export/csv/cells/assessorgrade_cell.php | 9 +- classes/export/csv/cells/cell_base.php | 4 +- .../csv/cells/feedbackcomments_cell.php | 2 +- .../export/csv/cells/otherassessors_cell.php | 2 +- classes/export/csv/cells/singlegrade_cell.php | 10 +-- .../csv/cells/submissionfileid_cell.php | 4 +- classes/export/grading_sheet.php | 2 +- classes/export/import.php | 32 +++---- classes/file_importer.php | 10 +-- classes/forms/student_submission_form.php | 2 +- classes/forms/upload_allocations_form.php | 6 +- classes/forms/upload_feedback_form.php | 6 +- classes/forms/upload_grading_sheet_form.php | 6 +- classes/forms/view_all_students_mform.php | 2 +- classes/grade_judge.php | 4 +- classes/mailer.php | 4 +- classes/models/coursework.php | 25 +++--- classes/models/outstanding_marking.php | 22 ++--- classes/models/submission.php | 10 +-- .../personal_deadline/table/row/builder.php | 4 +- .../grading_report/cells/user_cell.php | 2 +- classes/sample_set_rule/range_sample_type.php | 34 +++---- classes/sample_set_rule/sample_base.php | 2 +- classes/sample_set_rule/total_sample_type.php | 10 +-- classes/stages/base.php | 6 +- classes/task/enrol_task.php | 2 +- classes/task/unenrol_task.php | 2 +- lib.php | 4 +- mod_form.php | 30 +++---- renderers/object_renderer.php | 46 +++++----- renderers/page_renderer.php | 5 +- tests/behat/behat_mod_coursework.php | 48 ++++------ tests/behat/pages/allocations_page.php | 14 ++- .../pages/multiple_grading_interface.php | 3 +- view.php | 8 +- 59 files changed, 279 insertions(+), 339 deletions(-) diff --git a/actions/allocate.php b/actions/allocate.php index cb8f3244..ad66a3fc 100644 --- a/actions/allocate.php +++ b/actions/allocate.php @@ -129,7 +129,7 @@ } -if ($samplingformsavebutton) { +if ($samplingformsavebutton) { if ($coursework->sampling_enabled()) { $allocationsmanager->save_sample(); } diff --git a/actions/allocationsession.php b/actions/allocationsession.php index e3410c0e..bb1d5b88 100644 --- a/actions/allocationsession.php +++ b/actions/allocationsession.php @@ -35,11 +35,11 @@ $samplechkvalue = optional_param_array('samplevalue',array(),PARAM_RAW); $coursemoduleid = required_param('coursemoduleid', PARAM_INT); -if (!isset($SESSION->coursework_allocationsessions)) { +if (!isset($SESSION->coursework_allocationsessions)) { $SESSION->coursework_allocationsessions = array(); } -if (!isset($SESSION->coursework_allocationsessions[$coursemoduleid])) { +if (!isset($SESSION->coursework_allocationsessions[$coursemoduleid])) { $SESSION->coursework_allocationsessions[$coursemoduleid] = array(); } diff --git a/actions/selectallallocatables.php b/actions/selectallallocatables.php index 7b7badaf..f92b313a 100644 --- a/actions/selectallallocatables.php +++ b/actions/selectallallocatables.php @@ -44,7 +44,7 @@ -if ($stagenumber > 0) { +if ($stagenumber > 0) { if (!isset($SESSION->allocate_page_selectentirestage[$coursework->id()]['assessor_'.$stagenumber])) { $SESSION->allocate_page_selectentirestage[$coursework->id()]['assessor_'.$stagenumber] = 0; diff --git a/actions/upload_allocations.php b/actions/upload_allocations.php index 54bad5c3..a7ce3cae 100644 --- a/actions/upload_allocations.php +++ b/actions/upload_allocations.php @@ -65,7 +65,7 @@ -if ($data = $allocationsuploadform->get_data()) { +if ($data = $allocationsuploadform->get_data()) { //perform checks on data diff --git a/actions/upload_feedback.php b/actions/upload_feedback.php index 26b33317..649a78d2 100644 --- a/actions/upload_feedback.php +++ b/actions/upload_feedback.php @@ -73,12 +73,12 @@ -if ($data = $feedbackform->get_data()) { +if ($data = $feedbackform->get_data()) { //perform checks on data $courseworktempdir = $CFG->dataroot."/temp/coursework/"; - if (!is_dir($courseworktempdir)) { + if (!is_dir($courseworktempdir)) { mkdir($courseworktempdir); } diff --git a/actions/upload_grading_sheet.php b/actions/upload_grading_sheet.php index 7df208f6..ae3fa232 100644 --- a/actions/upload_grading_sheet.php +++ b/actions/upload_grading_sheet.php @@ -75,7 +75,7 @@ -if ($data = $gradinguploadform->get_data()) { +if ($data = $gradinguploadform->get_data()) { //perform checks on data diff --git a/backup/moodle2/backup_coursework_activity_task.class.php b/backup/moodle2/backup_coursework_activity_task.class.php index a6d5efb0..321b57ae 100644 --- a/backup/moodle2/backup_coursework_activity_task.class.php +++ b/backup/moodle2/backup_coursework_activity_task.class.php @@ -25,8 +25,7 @@ class backup_coursework_activity_task extends backup_activity_task { - static public function encode_content_links($content) - { + static public function encode_content_links($content) { global $CFG; $base = preg_quote($CFG->wwwroot, "/"); @@ -41,12 +40,10 @@ static public function encode_content_links($content) return $content; } - protected function define_my_settings() - { + protected function define_my_settings() { } - protected function define_my_steps() - { + protected function define_my_steps() { $this->add_step(new backup_coursework_activity_structure_step('coursework_structure', 'coursework.xml')); } } diff --git a/backup/moodle2/backup_coursework_stepslib.php b/backup/moodle2/backup_coursework_stepslib.php index d111ac9c..de345fb9 100644 --- a/backup/moodle2/backup_coursework_stepslib.php +++ b/backup/moodle2/backup_coursework_stepslib.php @@ -23,8 +23,7 @@ class backup_coursework_activity_structure_step extends backup_activity_structure_step { - protected function define_structure() - { + protected function define_structure() { global $DB; foreach(array('coursework_submissions', @@ -32,8 +31,7 @@ protected function define_structure() 'coursework_mod_set_members', 'coursework_sample_set_mbrs', 'coursework_extensions', - 'coursework_person_deadlines') as $tablename) - { + 'coursework_person_deadlines') as $tablename) { $DB->execute("update {{$tablename}} set allocatableuser=0, allocatablegroup=0"); $DB->execute("update {{$tablename}} set allocatableuser=allocatableid where allocatabletype='user'"); $DB->execute("update {{$tablename}} set allocatablegroup=allocatableid where allocatabletype='group'"); @@ -131,8 +129,7 @@ protected function define_structure() $sample_strategy->set_source_table('coursework_sample_set_rules', array('courseworkid' => backup::VAR_PARENTID)); - if($userinfo) - { + if($userinfo) { $plagiarism_flags = new backup_nested_element('coursework_plagiarism_flags'); diff --git a/backup/moodle2/restore_coursework_activity_task.class.php b/backup/moodle2/restore_coursework_activity_task.class.php index 784491c2..1ca2d82b 100644 --- a/backup/moodle2/restore_coursework_activity_task.class.php +++ b/backup/moodle2/restore_coursework_activity_task.class.php @@ -33,8 +33,7 @@ class restore_coursework_activity_task extends restore_activity_task * * @return array of restore_decode_rule */ - static public function define_decode_rules() - { + static public function define_decode_rules() { $rules = array(); $rules[] = new restore_decode_rule('COURSEWORKBYID', @@ -65,16 +64,14 @@ static public function define_decode_contents() { /** * Define (add) particular settings this activity can have. */ - protected function define_my_settings() - { + protected function define_my_settings() { // No particular settings for this activity. } /** * Define (add) particular steps this activity can have. */ - protected function define_my_steps() - { + protected function define_my_steps() { // Only has one structure step. $this->add_step(new restore_coursework_activity_structure_step('coursework_structure', 'coursework.xml')); } diff --git a/backup/moodle2/restore_coursework_stepslib.php b/backup/moodle2/restore_coursework_stepslib.php index 54e667aa..ec360369 100644 --- a/backup/moodle2/restore_coursework_stepslib.php +++ b/backup/moodle2/restore_coursework_stepslib.php @@ -26,10 +26,8 @@ class restore_coursework_activity_structure_step extends restore_activity_structure_step { // Just a handy way to spit out debugging info while in the bowels of restore - static function cheaplog($thing,$append=true) - { - if($append) - { + static function cheaplog($thing,$append=true) { + if($append) { $append=FILE_APPEND; } @@ -41,8 +39,7 @@ static function cheaplog($thing,$append=true) * * @return restore_path_element $structure */ - protected function define_structure() - { + protected function define_structure() { $paths = array(); $paths[] = new restore_path_element('coursework', '/activity/coursework'); @@ -51,8 +48,7 @@ protected function define_structure() // To know if we are including userinfo. $userinfo = $this->get_setting_value('userinfo'); - if($userinfo) - { + if($userinfo) { // Define each element separated. // Note: when I started the code I didn't realise that the names were arbitrary // and that the coursework_ prefix is not needed. @@ -72,8 +68,7 @@ protected function define_structure() 'plagiarism_flag' => 'coursework_submissions/coursework_submission/coursework_plagiarism_flags'); - foreach($bits as $bit=> $bitpath) - { + foreach($bits as $bit=> $bitpath) { $p=new restore_path_element("coursework_$bit","/activity/coursework/{$bitpath}/coursework_$bit"); $paths[]=$p; } @@ -82,10 +77,8 @@ protected function define_structure() return $this->prepare_activity_structure($paths); } - protected function fixallocatable(&$data) - { - if(!empty($data->allocatableuser)) - { + protected function fixallocatable(&$data) { + if(!empty($data->allocatableuser)) { $data->allocatableid=$this->get_mappingid('user',$data->allocatableuser); $data->allocatabletype='user'; } @@ -96,8 +89,7 @@ protected function fixallocatable(&$data) } } - protected function process_coursework_submission($data) - { + protected function process_coursework_submission($data) { global $DB; $data=(object)$data; $oldid=$data->id; @@ -136,8 +128,7 @@ protected function process_coursework_submission($data) } - protected function process_coursework_feedback($data) - { + protected function process_coursework_feedback($data) { global $DB; $data=(object)$data; @@ -177,8 +168,7 @@ protected function process_coursework_feedback($data) $this->set_mapping('coursework_feedback', $oldid, $newitemid, false, null, $this->task->get_old_contextid()); } - protected function process_coursework_reminder($data) - { + protected function process_coursework_reminder($data) { $data=(object)$data; $oldid=$data->id; @@ -191,8 +181,7 @@ protected function process_coursework_reminder($data) $newitemid = $DB->insert_record('coursework_reminder', $data); } - protected function process_coursework_allocation_pair($data) - { + protected function process_coursework_allocation_pair($data) { $data=(object)$data; $oldid=$data->id; @@ -212,8 +201,7 @@ protected function process_coursework_allocation_pair($data) $newitemid = $DB->insert_record('coursework_allocation_pairs', $data); } - protected function process_coursework_mod_set_rule($data) - { + protected function process_coursework_mod_set_rule($data) { $data=(object)$data; $oldid=$data->id; @@ -229,8 +217,7 @@ protected function process_coursework_mod_set_rule($data) $newitemid = $DB->insert_record('coursework_mod_set_members', $data); } - protected function process_coursework_sample_set_rule($data) - { + protected function process_coursework_sample_set_rule($data) { $data=(object)$data; $oldid=$data->id; @@ -247,8 +234,7 @@ protected function process_coursework_sample_set_rule($data) $newitemid = $DB->insert_record('coursework_sample_set_rules', $data); } - protected function process_coursework_allocation_config($data) - { + protected function process_coursework_allocation_config($data) { $data=(object)$data; $oldid=$data->id; @@ -264,8 +250,7 @@ protected function process_coursework_allocation_config($data) $newitemid = $DB->insert_record('coursework_allocation_config', $data); } - protected function process_coursework_mod_set_member($data) - { + protected function process_coursework_mod_set_member($data) { $data=(object)$data; $data->courseworkid=$this->get_new_parentid('coursework'); @@ -278,8 +263,7 @@ protected function process_coursework_mod_set_member($data) $newitemid = $DB->insert_record('coursework_mod_set_members', $data); } - protected function process_coursework_sample_set_mbr($data) - { + protected function process_coursework_sample_set_mbr($data) { $data=(object)$data; $data->courseworkid=$this->get_new_parentid('coursework'); @@ -297,8 +281,7 @@ protected function process_coursework_sample_set_mbr($data) $newitemid = $DB->insert_record('coursework_sample_set_mbrs', $data); } - protected function process_coursework_extension($data) - { + protected function process_coursework_extension($data) { $data=(object)$data; $data->courseworkid=$this->get_new_parentid('coursework'); @@ -319,8 +302,7 @@ protected function process_coursework_extension($data) } - protected function process_coursework_person_deadline($data) - { + protected function process_coursework_person_deadline($data) { $data=(object)$data; $data->courseworkid=$this->get_new_parentid('coursework'); @@ -347,8 +329,7 @@ protected function process_coursework_person_deadline($data) - protected function process_coursework_mod_agreement($data) - { + protected function process_coursework_mod_agreement($data) { $data=(object)$data; $data->feedbackid=$this->get_new_parentid('coursework_feedback'); @@ -372,8 +353,7 @@ protected function process_coursework_mod_agreement($data) } - protected function process_coursework_plagiarism_flag($data) - { + protected function process_coursework_plagiarism_flag($data) { $data=(object)$data; $data->submissionid=$this->get_new_parentid('coursework_submission'); @@ -402,8 +382,7 @@ protected function process_coursework_plagiarism_flag($data) * @param object $data The data in object form * @return void */ - protected function process_coursework($data) - { + protected function process_coursework($data) { global $DB; $data = (object)$data; @@ -495,35 +474,28 @@ protected function process_coursework($data) } - protected function check_grade($field,&$data) - { + protected function check_grade($field,&$data) { if ($data->$field < 0) // Scale found, get mapping. { $data->$field = -($this->get_mappingid('scale', abs($data->$field))); } } - protected function set_defaults($fields,&$data) - { - foreach($fields as $name=> $default) - { - if(!isset($data->$name)) - { + protected function set_defaults($fields,&$data) { + foreach($fields as $name=> $default) { + if(!isset($data->$name)) { $data->$name=$default; } } } - protected function updatedate($fields,&$data) - { - foreach($fields as $field) - { + protected function updatedate($fields,&$data) { + foreach($fields as $field) { $data->$field=$this->apply_date_offset($data->$field); } } - protected function after_execute() - { + protected function after_execute() { global $DB; $this->add_related_files('mod_coursework', 'submission', 'coursework_submission'); $this->add_related_files('mod_coursework', 'feedback', 'coursework_feedback'); @@ -534,10 +506,8 @@ protected function after_execute() $files=$fs->get_area_files($ctx->id,'mod_coursework','submission'); //Array of stored_file - foreach($files as $file) - { - if(!$file->is_directory()) - { + foreach($files as $file) { + if(!$file->is_directory()) { $itemid=$file->get_itemid(); $entry=$DB->get_record('coursework_submissions', diff --git a/classes/ability.php b/classes/ability.php index 12f89ef9..6a66ce2a 100644 --- a/classes/ability.php +++ b/classes/ability.php @@ -461,7 +461,7 @@ function (submission $submission) { }); } - protected function allow_show_submission_if_user_can_administer_grades() { + protected function allow_show_submission_if_user_can_administer_grades() { $this->allow('show', 'mod_coursework\models\submission', function (submission $submission) { @@ -470,7 +470,7 @@ function (submission $submission) { }); } - protected function allow_show_submission_if_user_can_view_all_grades_at_all_times() { + protected function allow_show_submission_if_user_can_view_all_grades_at_all_times() { $this->allow('show', 'mod_coursework\models\submission', function (submission $submission) { @@ -861,7 +861,7 @@ function (feedback $feedback) { $has_editable_feedbacks = false; // find out if the previous grades are editable - if ($feedback->is_agreed_grade()) { + if ($feedback->is_agreed_grade()) { $has_editable_feedbacks = $feedback->get_submission()->editable_feedbacks_exist(); } @@ -1185,7 +1185,7 @@ function (feedback $feedback) { $has_editable_feedbacks = false; // find out if the previous grades are editable - if ($feedback->is_agreed_grade()) { + if ($feedback->is_agreed_grade()) { $has_editable_feedbacks = $feedback->get_submission()->editable_feedbacks_exist(); diff --git a/classes/allocation/manager.php b/classes/allocation/manager.php index e74067a3..a91b8d4f 100644 --- a/classes/allocation/manager.php +++ b/classes/allocation/manager.php @@ -193,7 +193,7 @@ public function auto_generate_moderation_set() { * * @return array */ - public function get_sampling_options() { + public function get_sampling_options() { return array('0' => get_string('manual','mod_coursework'), '1' => get_string('automatic','mod_coursework')); @@ -269,15 +269,15 @@ public function save_sample_set_rule($assessor_number) { } - public function save_sample() { + public function save_sample() { global $DB; $DB->delete_records('coursework_sample_set_rules',array('courseworkid' => $this->coursework->id)); - for ($i = 2; $i <= $this->coursework->get_max_markers(); $i++) { + for ($i = 2; $i <= $this->coursework->get_max_markers(); $i++) { $sample_strategy = required_param("assessor_{$i}_samplingstrategy",PARAM_INT); - if ($sample_strategy) { + if ($sample_strategy) { $this->save_sample_set_rule($i); } @@ -294,7 +294,7 @@ private function get_coursework() { } - public function auto_generate_sample_set() { + public function auto_generate_sample_set() { global $DB; $sampleplugins = $DB->get_records('coursework_sample_set_plugin',null,'pluginorder'); @@ -308,7 +308,7 @@ public function auto_generate_sample_set() { $final_agreed_allocatables = $this->get_allocatables_with_final_agreed(); //remove any allocatables that have a status of final agreed as these can not be sampled - foreach($final_agreed_allocatables as $faa) { + foreach($final_agreed_allocatables as $faa) { if (isset($allocatables[$faa->allocatableid])) unset($allocatables[$faa->allocatableid]); } @@ -344,7 +344,7 @@ public function auto_generate_sample_set() { //I am also not using add the two arrays as using the overloaded + can produce dubious results when a key exists //in both arrays - foreach($auto_with_feedback as $k => $v) { + foreach($auto_with_feedback as $k => $v) { if (!isset($manual_sample_set[$k])) $manual_sample_set[$k] = $v; } @@ -361,8 +361,8 @@ public function auto_generate_sample_set() { } //save sample set - if (!empty($auto_sample_set)) { - foreach($auto_sample_set as $allocatable) { + if (!empty($auto_sample_set)) { + foreach($auto_sample_set as $allocatable) { $sample = new \stdClass(); $sample->courseworkid = $this->coursework->id; $sample->allocatableid = $allocatable->id; @@ -402,7 +402,7 @@ public function get_include_in_sample_set($stage_number) { } - public function get_automatic_with_feedback($stage) { + public function get_automatic_with_feedback($stage) { global $DB; @@ -423,7 +423,7 @@ public function get_automatic_with_feedback($stage) { } - public function remove_unmarked_automatic_allocatables($stage) { + public function remove_unmarked_automatic_allocatables($stage) { global $DB; $sql = "DELETE @@ -447,7 +447,7 @@ public function remove_unmarked_automatic_allocatables($stage) { } - public function get_allocatables_with_final_agreed() { + public function get_allocatables_with_final_agreed() { global $DB; diff --git a/classes/allocation/table/builder.php b/classes/allocation/table/builder.php index 0f08c7ce..3005150b 100644 --- a/classes/allocation/table/builder.php +++ b/classes/allocation/table/builder.php @@ -193,18 +193,18 @@ public function get_allocatable_cell() { return new user_cell($items); } - public function get_hidden_elements() { + public function get_hidden_elements() { global $SESSION; $elements = ''; $cm = $this->coursework->get_course_module(); - if (isset($SESSION->coursework_allocationsessions[$cm->id])) { + if (isset($SESSION->coursework_allocationsessions[$cm->id])) { - foreach($SESSION->coursework_allocationsessions[$cm->id] as $name => $val) { + foreach($SESSION->coursework_allocationsessions[$cm->id] as $name => $val) { - if(!is_array($val)) { + if(!is_array($val)) { $elements .= " "; diff --git a/classes/allocation/table/cell/builder.php b/classes/allocation/table/cell/builder.php index 83df86cb..ba174719 100644 --- a/classes/allocation/table/cell/builder.php +++ b/classes/allocation/table/cell/builder.php @@ -348,7 +348,7 @@ private function sampling_hidden_checkbox() { * @return bool * @throws \coding_exception */ - private function has_automatic_sampling() { + private function has_automatic_sampling() { global $DB; @@ -392,14 +392,14 @@ private function pinned_checkbox() { - private function checkbox_checked_in_session($checkboxname,$checkboxstate) { + private function checkbox_checked_in_session($checkboxname,$checkboxstate) { global $SESSION; $cm = $this->coursework->get_course_module(); - if (!empty($SESSION->coursework_allocationsessions[$cm->id])) { - if (isset($SESSION->coursework_allocationsessions[$cm->id][$checkboxname])) { + if (!empty($SESSION->coursework_allocationsessions[$cm->id])) { + if (isset($SESSION->coursework_allocationsessions[$cm->id][$checkboxname])) { return $SESSION->coursework_allocationsessions[$cm->id][$checkboxname]; } diff --git a/classes/allocation/table/cell/processor.php b/classes/allocation/table/cell/processor.php index f7ec2ace..e8a76dc0 100644 --- a/classes/allocation/table/cell/processor.php +++ b/classes/allocation/table/cell/processor.php @@ -174,7 +174,7 @@ private function process_pin($cell_data) { * @return bool * @throws \coding_exception */ - private function has_automatic_sampling() { + private function has_automatic_sampling() { global $DB; diff --git a/classes/allocation/upload.php b/classes/allocation/upload.php index 6776cd34..1f5befe2 100644 --- a/classes/allocation/upload.php +++ b/classes/allocation/upload.php @@ -97,7 +97,7 @@ public function validate_csv($content,$encoding,$delimeter){ foreach ($line as $keynum => $value) { // validate allocatable (user or group) - if ($cells[$keynum] == 'allocatable') { + if ($cells[$keynum] == 'allocatable') { // check if allocatable exists in the file if (empty($value)){$errors[$s] = get_string($allocatabletype .'namemissing', 'coursework'); break;} @@ -211,7 +211,7 @@ public function process_csv($content, $encoding, $delimiter, $processingresults) // or update it // get allocatable - if ($cells[$keynum] == 'allocatable') { + if ($cells[$keynum] == 'allocatable') { if ($allocatabletype == 'user'){ // get user id $suballocatable = $DB->get_record('user', array($assessor_identifier=> $value)); diff --git a/classes/auto_grader/average_grade.php b/classes/auto_grader/average_grade.php index f02fcd5d..796894aa 100644 --- a/classes/auto_grader/average_grade.php +++ b/classes/auto_grader/average_grade.php @@ -97,8 +97,7 @@ public function create_auto_grade_if_rules_match(){ /** * @return coursework */ - private function get_coursework() - { + private function get_coursework() { return $this->coursework; } diff --git a/classes/controllers/deadline_extensions_controller.php b/classes/controllers/deadline_extensions_controller.php index 0cabedab..c6140307 100644 --- a/classes/controllers/deadline_extensions_controller.php +++ b/classes/controllers/deadline_extensions_controller.php @@ -157,8 +157,7 @@ protected function update_deadline_extension() { * Set the deadline to default current deadline if the extension was never given before * @return array */ - protected function set_default_current_deadline() - { + protected function set_default_current_deadline() { global $DB; $params = array( 'allocatableid' => $this->params['allocatableid'], @@ -183,8 +182,7 @@ protected function set_default_current_deadline() /** * Begin Ajax functions */ - public function ajax_submit_mitigation($data_params) - { + public function ajax_submit_mitigation($data_params) { global $USER, $OUTPUT; $extended_deadline = false; $response = []; diff --git a/classes/controllers/feedback_controller.php b/classes/controllers/feedback_controller.php index f44d777b..b89323a6 100644 --- a/classes/controllers/feedback_controller.php +++ b/classes/controllers/feedback_controller.php @@ -83,7 +83,7 @@ protected function show_feedback() { - if (empty($ajax)) { + if (empty($ajax)) { echo $html; } else { echo json_encode(['success' => true, 'formhtml' => $html]); @@ -261,13 +261,13 @@ protected function create_feedback() { $cell_object = new $cell_class($coursework, $participant); $html = $cell_object->get_grade_cell_content($feedback_row, $this->coursework); - if ($teacherfeedback->stage_identifier == 'assessor_1' || $teacherfeedback->stage_identifier == 'assessor_2') { + if ($teacherfeedback->stage_identifier == 'assessor_1' || $teacherfeedback->stage_identifier == 'assessor_2') { $jsonarray['assessorname'] = (empty($feedback_row->get_assessor()->id()) && $coursework->allocation_enabled()) ? get_string('assessornotallocated','mod_coursework') : $cell_object->profile_link($feedback_row); $jsonarray['assessdate'] = $cell_object->date_for_column($feedback_row); - if ($teacherfeedback->stage_identifier == 'assessor_1') { + if ($teacherfeedback->stage_identifier == 'assessor_1') { $ability = new ability(user::find($USER, false), $coursework); $stage = new assessor($coursework, 'assessor_2'); $assessor_feedback_row = new assessor_feedback_row($stage, $feedback_row->get_allocatable(), $coursework); @@ -282,7 +282,7 @@ protected function create_feedback() { $finalsubmission = $feedback_row->get_submission(); - if ($coursework->automaticagreementrange != 'none' && !empty($finalfeedback) && $finalsubmission->all_inital_graded()) { + if ($coursework->automaticagreementrange != 'none' && !empty($finalfeedback) && $finalsubmission->all_inital_graded()) { $finalstage = new assessor($coursework, "final_agreed_1"); $finalfeedback_row = new assessor_feedback_row($finalstage, $participant, $coursework); $agreed_grade_object = new multiple_agreed_grade_cell(array('coursework' => $coursework,'stage' => $finalstage)); @@ -456,12 +456,12 @@ protected function update_feedback() { $cell_object = new $cell_class($coursework, $participant); $html = $cell_object->get_grade_cell_content($feedback_row, $coursework); - if ($teacherfeedback->stage_identifier == 'assessor_1' || $teacherfeedback->stage_identifier == 'assessor_2') { + if ($teacherfeedback->stage_identifier == 'assessor_1' || $teacherfeedback->stage_identifier == 'assessor_2') { $jsonarray['assessorname'] = (empty($feedback_row->get_assessor()->id()) && $coursework->allocation_enabled()) ? get_string('assessornotallocated','mod_coursework') : $cell_object->profile_link($feedback_row); $jsonarray['assessdate'] = $cell_object->date_for_column($feedback_row); - if ($teacherfeedback->stage_identifier == 'assessor_1') { + if ($teacherfeedback->stage_identifier == 'assessor_1') { $ability = new ability(user::find($USER, false), $coursework); $stage = new assessor($coursework, 'assessor_2'); $assessor_feedback_row = new assessor_feedback_row($stage, $feedback_row->get_allocatable(), $coursework); @@ -474,7 +474,7 @@ protected function update_feedback() { $finalfeedback = $submission->get_final_feedback(); - if ($coursework->automaticagreementrange != 'none' && !empty($finalfeedback)) { + if ($coursework->automaticagreementrange != 'none' && !empty($finalfeedback)) { $finalstage = new assessor($coursework, "final_agreed_1"); $finalfeedbackrow_object = new \mod_coursework\grading_table_row_multi($coursework, $participant); diff --git a/classes/controllers/personal_deadlines_controller.php b/classes/controllers/personal_deadlines_controller.php index 807a48c0..d416bc53 100644 --- a/classes/controllers/personal_deadlines_controller.php +++ b/classes/controllers/personal_deadlines_controller.php @@ -80,7 +80,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; @@ -98,7 +98,7 @@ protected function new_personal_deadline() { $allocatables = unserialize($data->allocatableid); - foreach($allocatables as $allocatableid) { + foreach($allocatables as $allocatableid) { $data->allocatableid = $allocatableid; $data->id = ''; //$data->id = ''; @@ -141,7 +141,7 @@ protected function new_personal_deadline() { * Set the deadline to default coursework deadline if the personal deadline was never given before * @return array */ - protected function set_default_current_deadline() { + protected function set_default_current_deadline() { $params = array( 'allocatableid' => $this->params['allocatableid'], 'allocatabletype' => $this->params['allocatabletype'], diff --git a/classes/controllers/submissions_controller.php b/classes/controllers/submissions_controller.php index a7cc0a36..121dcb25 100644 --- a/classes/controllers/submissions_controller.php +++ b/classes/controllers/submissions_controller.php @@ -175,7 +175,7 @@ protected function create_submission() { $userids = explode(',',$submission->get_coursework()->get_submission_notification_users()); if (!empty($userids)) { - foreach($userids as $u) { + foreach($userids as $u) { $notifyuser = $DB->get_record('user',array('id' => trim($u))); if (!empty($notifyuser)) $mailer->send_submission_notification($notifyuser); @@ -330,7 +330,7 @@ protected function finalise_submission() { } - protected function unfinalise_submission() { + protected function unfinalise_submission() { global $USER, $DB; diff --git a/classes/export/csv/cells/agreedfeedback_cell.php b/classes/export/csv/cells/agreedfeedback_cell.php index beb5e659..667bb397 100644 --- a/classes/export/csv/cells/agreedfeedback_cell.php +++ b/classes/export/csv/cells/agreedfeedback_cell.php @@ -64,7 +64,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade 'mod/coursework:addallocatedagreedgrade','mod/coursework:editallocatedagreedgrade'); if (has_any_capability($agreedgradecap,$PAGE->context) - || has_capability('mod/coursework:administergrades', $PAGE->context)) { + || has_capability('mod/coursework:administergrades', $PAGE->context)) { $subdbrecord = $DB->get_record('coursework_submissions',array('id' => $submissionid)); $submission = \mod_coursework\models\submission::find($subdbrecord); diff --git a/classes/export/csv/cells/agreedgrade_cell.php b/classes/export/csv/cells/agreedgrade_cell.php index 581b3b87..c81dd79a 100644 --- a/classes/export/csv/cells/agreedgrade_cell.php +++ b/classes/export/csv/cells/agreedgrade_cell.php @@ -85,7 +85,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='', $upload if (empty($value)) return true; if (has_any_capability($agreedgradecap,$PAGE->context) - || has_capability('mod/coursework:administergrades', $PAGE->context)) { + || has_capability('mod/coursework:administergrades', $PAGE->context)) { $errormsg = ''; @@ -211,7 +211,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='', $upload * @param $value the value that should be checked to see if it is valid * @return bool */ - function value_in_rubric($criteria, $value) { + function value_in_rubric($criteria, $value) { global $DB; @@ -242,7 +242,7 @@ function value_in_rubric($criteria, $value) { * @param $csv_cells * */ - function get_rubrics($coursework,$csv_cells) { + function get_rubrics($coursework,$csv_cells) { if ($coursework->is_using_rubric() && $this->coursework->finalstagegrading != 1) { @@ -251,7 +251,7 @@ function get_rubrics($coursework,$csv_cells) { $criterias = $coursework->get_rubric_criteria(); - foreach ($criterias as $criteria) { + foreach ($criterias as $criteria) { $rubricheaders[] = $criteria['description']; $rubricheaders[] = $criteria['description']." comment"; } diff --git a/classes/export/csv/cells/assessorfeedback_cell.php b/classes/export/csv/cells/assessorfeedback_cell.php index 61dae139..ae8a76df 100644 --- a/classes/export/csv/cells/assessorfeedback_cell.php +++ b/classes/export/csv/cells/assessorfeedback_cell.php @@ -85,7 +85,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade $subdbrecord = $DB->get_record('coursework_submissions',array('id' => $submissionid)); $submission = \mod_coursework\models\submission::find($subdbrecord); if (has_any_capability($agreedgradecap,$PAGE->context) && has_any_capability($initialgradecap,$PAGE->context) - || has_capability('mod/coursework:administergrades', $PAGE->context)) { + || has_capability('mod/coursework:administergrades', $PAGE->context)) { //is the submission in question ready to grade? @@ -119,14 +119,14 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade } - if (!$this->coursework->allocation_enabled() && !empty($feedback)) { + if (!$this->coursework->allocation_enabled() && !empty($feedback)) { //was this user the one who last graded this submission if not then user cannot grade if ($feedback->assessorid != $USER->id || !has_capability('mod/coursework:editinitialgrade', $PAGE->context) ) return get_string('nopermissiontogradesubmission','coursework'); } - if ($this->coursework->allocation_enabled()) { + if ($this->coursework->allocation_enabled()) { //check that the user is allocated to the author of the submission $allocation_params = array( 'courseworkid' => $this->coursework->id, diff --git a/classes/export/csv/cells/assessorgrade_cell.php b/classes/export/csv/cells/assessorgrade_cell.php index f33774e1..69e27c25 100644 --- a/classes/export/csv/cells/assessorgrade_cell.php +++ b/classes/export/csv/cells/assessorgrade_cell.php @@ -105,8 +105,7 @@ public function get_header($stage){ } - public function validate_cell($value,$submissionid,$stage_identifier='', $uploadedgradecells = array()) - { + public function validate_cell($value,$submissionid,$stage_identifier='', $uploadedgradecells = array()) { global $DB, $PAGE, $USER; if (empty($value)) return true; @@ -271,7 +270,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='', $upload * @param $value the value that should be checked to see if it is valid * @return bool */ - function value_in_rubric($criteria, $value) { + function value_in_rubric($criteria, $value) { global $DB; @@ -302,7 +301,7 @@ function value_in_rubric($criteria, $value) { * @param $csv_cells * */ - function get_rubrics($coursework,$csv_cells) { + function get_rubrics($coursework,$csv_cells) { if ($coursework->is_using_rubric()) { @@ -311,7 +310,7 @@ function get_rubrics($coursework,$csv_cells) { $criterias = $coursework->get_rubric_criteria(); - foreach ($criterias as $criteria) { + foreach ($criterias as $criteria) { $rubricheaders[] = $criteria['description']; $rubricheaders[] = $criteria['description']." comment"; } diff --git a/classes/export/csv/cells/cell_base.php b/classes/export/csv/cells/cell_base.php index e379f655..86d4a221 100644 --- a/classes/export/csv/cells/cell_base.php +++ b/classes/export/csv/cells/cell_base.php @@ -62,7 +62,7 @@ public function __construct($coursework) { * @return bool * @throws \coding_exception */ - public function can_view_hidden() { + public function can_view_hidden() { $viewanonymous = has_capability('mod/coursework:viewanonymous',$this->coursework->get_context()); $exportgrade = has_capability('mod/coursework:canexportfinalgrades',$this->coursework->get_context()); @@ -204,7 +204,7 @@ public function get_assessor_name($assessorid){ * @param $assessorid * @return string */ - public function get_assessor_username($assessorid) { + public function get_assessor_username($assessorid) { global $DB; $assessor = $DB->get_record('user',array('id' => $assessorid),'username'); diff --git a/classes/export/csv/cells/feedbackcomments_cell.php b/classes/export/csv/cells/feedbackcomments_cell.php index 370bae17..45a3a1cf 100644 --- a/classes/export/csv/cells/feedbackcomments_cell.php +++ b/classes/export/csv/cells/feedbackcomments_cell.php @@ -62,7 +62,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='',$uploa global $PAGE, $DB, $USER; if (has_capability('mod/coursework:addinitialgrade', $PAGE->context) || has_capability('mod/coursework:editinitialgrade', $PAGE->context) - || has_capability('mod/coursework:administergrades', $PAGE->context)) { + || has_capability('mod/coursework:administergrades', $PAGE->context)) { $dbrecord = $DB->get_record('coursework_submissions', array('id' => $submissionid)); diff --git a/classes/export/csv/cells/otherassessors_cell.php b/classes/export/csv/cells/otherassessors_cell.php index 56ef5f23..2baa3cde 100644 --- a/classes/export/csv/cells/otherassessors_cell.php +++ b/classes/export/csv/cells/otherassessors_cell.php @@ -106,7 +106,7 @@ public function get_cell($submission, $student, $stage_identifier){ $numothereassessorfeedbacks = $submission->max_number_of_feedbacks() -1; - if ($numothereassessorfeedbacks - count($feedbacks) != 0 ) { + if ($numothereassessorfeedbacks - count($feedbacks) != 0 ) { $blankcolumns = $numothereassessorfeedbacks - count($feedbacks); diff --git a/classes/export/csv/cells/singlegrade_cell.php b/classes/export/csv/cells/singlegrade_cell.php index ecdc80bf..ffc2d7b8 100644 --- a/classes/export/csv/cells/singlegrade_cell.php +++ b/classes/export/csv/cells/singlegrade_cell.php @@ -81,7 +81,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade global $PAGE, $DB, $USER; if (has_capability('mod/coursework:addinitialgrade', $PAGE->context) || has_capability('mod/coursework:editinitialgrade', $PAGE->context) - || has_capability('mod/coursework:administergrades', $PAGE->context)) { + || has_capability('mod/coursework:administergrades', $PAGE->context)) { $errormsg = ''; @@ -165,7 +165,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade ); $feedback = feedback::find($feedback_params); - if (!$this->coursework->allocation_enabled() && !empty($feedback)) { + if (!$this->coursework->allocation_enabled() && !empty($feedback)) { //was this user the one who last graded this submission if not then user cannot grade if ($feedback->assessorid != $USER->id || !has_capability('mod/coursework:editinitialgrade', $PAGE->context) && !has_capability('mod/coursework:administergrades', $PAGE->context)) return get_string('nopermissiontoeditgrade','coursework'); @@ -217,7 +217,7 @@ public function validate_cell($value,$submissionid,$stage_identifier='',$uploade * @param $value the value that should be checked to see if it is valid * @return bool */ - function value_in_rubric($criteria, $value) { + function value_in_rubric($criteria, $value) { global $DB; @@ -248,7 +248,7 @@ function value_in_rubric($criteria, $value) { * @param $csv_cells * */ - function get_rubrics($coursework,$csv_cells) { + function get_rubrics($coursework,$csv_cells) { if ($coursework->is_using_rubric()) { @@ -257,7 +257,7 @@ function get_rubrics($coursework,$csv_cells) { $criterias = $coursework->get_rubric_criteria(); - foreach ($criterias as $criteria) { + foreach ($criterias as $criteria) { $rubricheaders[] = $criteria['description']; $rubricheaders[] = $criteria['description']." comment"; } diff --git a/classes/export/csv/cells/submissionfileid_cell.php b/classes/export/csv/cells/submissionfileid_cell.php index 59026769..a3d36766 100644 --- a/classes/export/csv/cells/submissionfileid_cell.php +++ b/classes/export/csv/cells/submissionfileid_cell.php @@ -47,10 +47,10 @@ public function get_header($stage){ return get_string('submissionfileid', 'coursework'); } - public function validate_cell($value,$submissionid,$stage_dentifier='',$uploadedgradecells = array()) { + public function validate_cell($value,$submissionid,$stage_dentifier='',$uploadedgradecells = array()) { global $DB; - if (empty($value)) { + if (empty($value)) { return 'No submission hash value entered'; } diff --git a/classes/export/grading_sheet.php b/classes/export/grading_sheet.php index fbd32337..8fee305a 100644 --- a/classes/export/grading_sheet.php +++ b/classes/export/grading_sheet.php @@ -197,7 +197,7 @@ public static function cells_array($coursework){ $criterias = $coursework->get_rubric_criteria(); - foreach ($criterias as $criteria) { + foreach ($criterias as $criteria) { $csv_cells[] = $criteria['description']; $csv_cells[] = $criteria['description']." comment"; } diff --git a/classes/export/import.php b/classes/export/import.php index 7923603e..1ac2d059 100644 --- a/classes/export/import.php +++ b/classes/export/import.php @@ -57,7 +57,7 @@ public function validate_submissionfileid(){ * @throws \coding_exception * @throws \moodle_exception */ - public function validate_csv($content,$encoding,$delimeter,$csv_cells) { + public function validate_csv($content,$encoding,$delimeter,$csv_cells) { global $DB, $USER; @@ -112,7 +112,7 @@ public function validate_csv($content,$encoding,$delimeter,$csv_cells) { $uploadedgradecells = array(); - for($z = 0; $z < count($line); $z++) { + for($z = 0; $z < count($line); $z++) { $value = $line[$z]; $stage_identifier = $this->get_stage_identifier($submissionid,$cells[$i]); @@ -126,7 +126,7 @@ public function validate_csv($content,$encoding,$delimeter,$csv_cells) { $cell = new $class($this->coursework); //submission id field should always be first in the csv_cells array // - if ($cells[$i] == 'submissionid') { + if ($cells[$i] == 'submissionid') { $submissionid = $value; } @@ -159,7 +159,7 @@ public function validate_csv($content,$encoding,$delimeter,$csv_cells) { } - if ($result !== true) { + if ($result !== true) { $errors[$s] = $result; break; //go to next line on error } else if ($cells[$i] == "singlegrade" || $cells[$i] == "assessorgrade" || $cells[$i] == "agreedgrade" && !empty($value)) { @@ -176,7 +176,7 @@ public function validate_csv($content,$encoding,$delimeter,$csv_cells) { } - function rubric_count_correct($csvheader,$linefromimportedcsv) { + function rubric_count_correct($csvheader,$linefromimportedcsv) { // get criteria of rubrics and match it to grade cells if ($this->coursework->is_using_rubric()) { @@ -194,9 +194,9 @@ function rubric_count_correct($csvheader,$linefromimportedcsv) { $typepositions = false; $i = 0; - foreach($csvheader as $ch) { + foreach($csvheader as $ch) { - if (strpos($ch,$type) !== false) { + if (strpos($ch,$type) !== false) { if (empty($typepositions)) $typepositions = array(); @@ -242,7 +242,7 @@ function rubric_count_correct($csvheader,$linefromimportedcsv) { } } - function get_rubric_headers($csvheader) { + function get_rubric_headers($csvheader) { // get criteria of rubrics and match it to grade cells if ($this->coursework->is_using_rubric()) { @@ -344,7 +344,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces foreach ($line as $keynum => $value) { - if (empty($idfound) && $cells[$i] == 'submissionid') { + if (empty($idfound) && $cells[$i] == 'submissionid') { $submissionid = $value; $idfound = true; } @@ -373,7 +373,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces } } else { - foreach($csvline as $k => $v) { + foreach($csvline as $k => $v) { if (substr($k,0,13) == 'assessorgrade' || substr($k,0,11) == 'singlegrade') { $stages[$k] = $this->get_stage_identifier($csvline['submissionid'], $k); } else if (substr($k,0,11) == 'agreedgrade') { @@ -397,7 +397,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces foreach($stages as $k => $stage) { //when allocation is enabled - if (has_capability('mod/coursework:administergrades', $PAGE->context) && $coursework->allocation_enabled() && $stage != 'final_agreed_1' && $coursework->has_multiple_markers() == true) { + if (has_capability('mod/coursework:administergrades', $PAGE->context) && $coursework->allocation_enabled() && $stage != 'final_agreed_1' && $coursework->has_multiple_markers() == true) { $rubricoffset += 1; if ($a == 1) $rubricoffsetstart += 1; } @@ -520,7 +520,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces } else if ($coursework->is_using_rubric() && ($stage == 'final_agreed_1' && $this->coursework->finalstagegrading == 1)) { - if (!isset($numberofrubrics)) { + if (!isset($numberofrubrics)) { $criterias = $this->coursework->get_rubric_criteria(); @@ -585,7 +585,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces * @param $value the value that we will retrieve the levelid for * @return bool */ - function get_value_rubric_levelid($criteria, $value) { + function get_value_rubric_levelid($criteria, $value) { global $DB; @@ -654,7 +654,7 @@ public function add_grade($submissionid, $grade, $feedback, $stage_identifier,$u $feedbackid = $DB->insert_record('coursework_feedbacks', $add_grade, true); - if ($uses_rubric) { + if ($uses_rubric) { $controller = $this->coursework->get_advanced_grading_active_controller(); //find out how many criteria there are $gradinginstance = $controller->get_or_create_instance(0, $USER->id,$feedbackid); @@ -827,7 +827,7 @@ public function get_stage_identifier($submissionid,$cell_identifier) { if (substr($cell_identifier, 0, 8) == 'assessor') { $stage_identifier = 'assessor_' . (substr($cell_identifier, -1)); //$cells[$i] = substr($cells[$i], 0, -1); - } else if(substr($cell_identifier, 0, 6) == 'agreed') { + } else if(substr($cell_identifier, 0, 6) == 'agreed') { $stage_identifier = 'final_agreed_1'; } } @@ -867,7 +867,7 @@ public function remove_other_assessors_grade($csv_cells, &$line){ $key = array_search('otherassessors', $csv_cells); unset($csv_cells[$key]); $othercells = $this->other_assessors_cells(); - if ($this->coursework->is_using_rubric()) { + if ($this->coursework->is_using_rubric()) { $singlegradeposition = array_search('singlegrade', $csv_cells); diff --git a/classes/file_importer.php b/classes/file_importer.php index e6693f9b..1e70222a 100644 --- a/classes/file_importer.php +++ b/classes/file_importer.php @@ -33,7 +33,7 @@ class coursework_file_zip_importer { - public function extract_zip_file($filename,$contextid) { + public function extract_zip_file($filename,$contextid) { global $USER; @@ -99,7 +99,7 @@ public function delete_import_files($contextid) { * @param coursework $coursework * @return string - The html response */ - public function import_zip_files($coursework,$feedbackstage,$overwritecurrent) { + public function import_zip_files($coursework,$feedbackstage,$overwritecurrent) { global $CFG, $PAGE, $DB, $USER; @set_time_limit(ASSIGNFEEDBACK_FILE_MAXFILEUNZIPTIME); @@ -219,8 +219,8 @@ public function is_valid_feedback_file_filename($coursework,$feedbackfile,$parti return $result; } - foreach ($participants as $user) { - if ($filename == $coursework->get_username_hash($user->id)) { + foreach ($participants as $user) { + if ($filename == $coursework->get_username_hash($user->id)) { $result = $user->id; break; } @@ -232,7 +232,7 @@ public function is_valid_feedback_file_filename($coursework,$feedbackfile,$parti } - public function feedback_exists($coursework,$submission,$stageidentifier) { + public function feedback_exists($coursework,$submission,$stageidentifier) { global $DB, $USER; diff --git a/classes/forms/student_submission_form.php b/classes/forms/student_submission_form.php index 53fc40e3..793f7a13 100644 --- a/classes/forms/student_submission_form.php +++ b/classes/forms/student_submission_form.php @@ -178,7 +178,7 @@ public function handle() { $userids = explode(',',$submission->get_coursework()->get_submission_notification_users()); if (!empty($userids)) { - foreach($userids as $u) { + foreach($userids as $u) { $notifyuser = $DB->get_record('user',array('id' => trim($u))); $mailer = new mailer($coursework); diff --git a/classes/forms/upload_allocations_form.php b/classes/forms/upload_allocations_form.php index 5a462fed..cdd9faed 100644 --- a/classes/forms/upload_allocations_form.php +++ b/classes/forms/upload_allocations_form.php @@ -29,13 +29,13 @@ class upload_allocations_form extends moodleform { private $cmid; - function __construct($cmid) { + function __construct($cmid) { $this->cmid = $cmid; parent::__construct(); } - function definition() { + function definition() { $mform =& $this->_form; $mform->addElement('filepicker', 'allocationsdata', get_string('allocationsfile','coursework'), null, array( 'accepted_types' => '*.csv')); @@ -64,7 +64,7 @@ function definition() { $this->add_action_buttons(true,get_string('uploadallocations','coursework')); } - function display() { + function display() { return $this->_form->toHtml(); } diff --git a/classes/forms/upload_feedback_form.php b/classes/forms/upload_feedback_form.php index a7e0891d..1f68c130 100644 --- a/classes/forms/upload_feedback_form.php +++ b/classes/forms/upload_feedback_form.php @@ -38,14 +38,14 @@ class upload_feedback_form extends moodleform { private $cmid; private $coursework; - function __construct($coursework, $cmid) { + function __construct($coursework, $cmid) { $this->cmid = $cmid; $this->coursework = $coursework; parent::__construct(); } - function definition() { + function definition() { $mform =& $this->_form; $mform->addElement('filepicker', 'feedbackzip', get_string('feedbackzipfile','coursework'), null, array( 'accepted_types' => '*.zip')); @@ -92,7 +92,7 @@ function definition() { $this->add_action_buttons(true,get_string('uploadfeedbackzip','coursework')); } - function display() { + function display() { return $this->_form->toHtml(); } diff --git a/classes/forms/upload_grading_sheet_form.php b/classes/forms/upload_grading_sheet_form.php index be1d9ac6..fc48e025 100644 --- a/classes/forms/upload_grading_sheet_form.php +++ b/classes/forms/upload_grading_sheet_form.php @@ -37,13 +37,13 @@ class upload_grading_sheet_form extends moodleform { private $cmid; - function __construct($cmid) { + function __construct($cmid) { $this->cmid = $cmid; parent::__construct(); } - function definition() { + function definition() { $mform =& $this->_form; $mform->addElement('filepicker', 'gradingdata', get_string('gradingsheetfile','coursework'), null, array( 'accepted_types' => '*.csv')); @@ -72,7 +72,7 @@ function definition() { $this->add_action_buttons(true,get_string('uploadgradingworksheet','coursework')); } - function display() { + function display() { return $this->_form->toHtml(); } diff --git a/classes/forms/view_all_students_mform.php b/classes/forms/view_all_students_mform.php index cc981f8f..9fbd97c9 100644 --- a/classes/forms/view_all_students_mform.php +++ b/classes/forms/view_all_students_mform.php @@ -31,7 +31,7 @@ class view_all_students_mform extends moodleform { - function definition() { + function definition() { $this->_form->addElement('hidden', 'id', $this->_customdata['cmid']); $this->_form->setType('id', PARAM_INT); diff --git a/classes/grade_judge.php b/classes/grade_judge.php index 6a0ab3e3..3b630637 100644 --- a/classes/grade_judge.php +++ b/classes/grade_judge.php @@ -180,7 +180,7 @@ public function allocatable_needs_more_than_one_feedback ($allocatable){ } - public function grade_in_scale($value) { + public function grade_in_scale($value) { if (is_null($value)) { return true; } else if ($this->coursework->grade >= 1) { @@ -203,7 +203,7 @@ public function grade_in_scale($value) { * @param $value * @return mixed */ - public function get_grade($value) { + public function get_grade($value) { if ($this->coursework->grade <= -1) { // Scale diff --git a/classes/mailer.php b/classes/mailer.php index 0360533a..cd22fa9a 100644 --- a/classes/mailer.php +++ b/classes/mailer.php @@ -185,7 +185,7 @@ public function send_feedback_notification($submission) { * @return mixed * @throws \coding_exception */ - public function send_student_deadline_reminder($user) { + public function send_student_deadline_reminder($user) { global $CFG; @@ -236,7 +236,7 @@ public function send_student_deadline_reminder($user) { - public function send_submission_notification($userstonotify) { + public function send_submission_notification($userstonotify) { global $CFG; diff --git a/classes/models/coursework.php b/classes/models/coursework.php index 938ded24..b30bf239 100644 --- a/classes/models/coursework.php +++ b/classes/models/coursework.php @@ -592,7 +592,7 @@ public function deadline_has_passed() { return ($this->has_deadline() && $this->deadline < time()); } - public function has_deadline() { + public function has_deadline() { return !empty($this->deadline); } @@ -659,7 +659,7 @@ public function get_context_id() { } - function get_grade_editing_time() { + function get_grade_editing_time() { return $this->gradeeditingtime; } @@ -1407,8 +1407,7 @@ public function get_published_submissions(){ * @param int $userid * @return string */ - static function get_name_hash($id,$userid,$time=1440000609) - { + static function get_name_hash($id,$userid,$time=1440000609) { if ($id < 1) { return ''; } @@ -1424,8 +1423,7 @@ static function get_name_hash($id,$userid,$time=1440000609) return $uhash; } - public function get_username_hash($userid) - { + public function get_username_hash($userid) { return static::get_name_hash($this->id,$userid,$this->timecreated); } @@ -2094,8 +2092,7 @@ public function student_is_in_any_group($student) { /** * @return bool */ - public function sampling_enabled() - { + public function sampling_enabled() { return (bool)$this->samplingenabled; } @@ -2260,7 +2257,7 @@ private function get_moderator_grade_stage() { } } - public function get_submission_notification_users() { + public function get_submission_notification_users() { return $this->submissionnotification; } @@ -2589,7 +2586,7 @@ public function get_coursework_submission_personal_deadlines(){ * @param $stage * @return bool */ - public function has_automatic_sampling_at_stage($stage) { + public function has_automatic_sampling_at_stage($stage) { global $DB; return $DB->record_exists('coursework_sample_set_rules',array('courseworkid' => $this->id,'stage_identifier' => $stage)); @@ -2602,7 +2599,7 @@ public function has_automatic_sampling_at_stage($stage) { * * @return allocatable[] */ - public function get_allocatables_with_feedback($stage, $random = false) { + public function get_allocatables_with_feedback($stage, $random = false) { global $DB, $CFG; $sql = "SELECT cwrsub.allocatableid, cwrfb.* @@ -2735,7 +2732,7 @@ public function draft_feedback_enabled(){ * * @return array */ - public function get_allocatables_and_deadline() { + public function get_allocatables_and_deadline() { $allocatables = $this->get_allocatables(); @@ -2753,7 +2750,7 @@ public function get_allocatables_and_deadline() { * * @return array */ - private function get_allocatable_personal_deadline($allocatable) { + private function get_allocatable_personal_deadline($allocatable) { global $DB; @@ -3006,7 +3003,7 @@ public function get_allocatable_deadline($allocatableid) { * @param $allocatable * @return bool/int */ - private function get_allocatable_extension($allocatable) { + private function get_allocatable_extension($allocatable) { global $DB; $extension = false; diff --git a/classes/models/outstanding_marking.php b/classes/models/outstanding_marking.php index 157715ba..5d1d3b96 100644 --- a/classes/models/outstanding_marking.php +++ b/classes/models/outstanding_marking.php @@ -27,7 +27,7 @@ class outstanding_marking { private $day_in_secs; - public function __construct() { + public function __construct() { $this->day_in_secs = 86400; } @@ -76,7 +76,7 @@ public function get_to_grade_agreed_count($cwkrecord,$userid) { //AGREED GRADE INFORMATION - if ($this->should_get_to_mark_agreed_grade_info($coursework->id,$userid) && $coursework->has_multiple_markers()) { + if ($this->should_get_to_mark_agreed_grade_info($coursework->id,$userid) && $coursework->has_multiple_markers()) { if (!$coursework->sampling_enabled()) { $agreedsubmissions = $this->get_to_grade_agreed_grade_submissions($coursework->id,$coursework->get_max_markers()); } else { @@ -94,7 +94,7 @@ public function get_to_grade_agreed_count($cwkrecord,$userid) { * @param bool $allocationenabled * @return array */ - private function get_single_marker_initial_grade_submissions_to_mark($courseworkid, $userid=false, $allocationenabled=false) { + private function get_single_marker_initial_grade_submissions_to_mark($courseworkid, $userid=false, $allocationenabled=false) { global $DB; @@ -102,7 +102,7 @@ private function get_single_marker_initial_grade_submissions_to_mark($coursework $sqltable = ""; $sqlextra = ""; - if ($allocationenabled) { + if ($allocationenabled) { //we only have to check for submissions allocated to this user $sqltable = ", {coursework_allocation_pairs} cap "; @@ -137,7 +137,7 @@ private function get_single_marker_initial_grade_submissions_to_mark($coursework * @param $userid * @return array */ - private function get_multiple_to_mark_sampled_initial_grade_submissions($courseworkid,$userid) { + private function get_multiple_to_mark_sampled_initial_grade_submissions($courseworkid,$userid) { global $DB; @@ -179,7 +179,7 @@ private function get_multiple_to_mark_sampled_initial_grade_submissions($coursew * @param $allocationenabled * @return array */ - private function get_multiple_to_mark_initial_grade_submissions($courseworkid,$userid,$numberofmarkers,$allocationenabled) { + private function get_multiple_to_mark_initial_grade_submissions($courseworkid,$userid,$numberofmarkers,$allocationenabled) { global $DB; @@ -187,7 +187,7 @@ private function get_multiple_to_mark_initial_grade_submissions($courseworkid,$u $sqltable = ''; $sqlextra = ''; - if ($allocationenabled) { + if ($allocationenabled) { //we only have to check for submissions allocated to this user $sqltable = ", {coursework_allocation_pairs} cap "; @@ -290,7 +290,7 @@ private function get_to_grade_agreed_grade_sampled_submissions($courseworkid) { * @param $user_id * @return bool */ - private function has_agreed_grade($course_id,$user_id) { + private function has_agreed_grade($course_id,$user_id) { $coursecontext = \context_course::instance($course_id); @@ -303,7 +303,7 @@ private function has_agreed_grade($course_id,$user_id) { * @param $user_id * @return bool */ - private function has_initial_grade($course_id,$user_id) { + private function has_initial_grade($course_id,$user_id) { $coursecontext = \context_course::instance($course_id); @@ -316,7 +316,7 @@ private function has_initial_grade($course_id,$user_id) { * @param $userid * @return bool */ - private function should_get_to_mark_initial_grade_info($courseworkid,$userid) { + private function should_get_to_mark_initial_grade_info($courseworkid,$userid) { $coursework = new \mod_coursework\models\coursework($courseworkid); @@ -331,7 +331,7 @@ private function should_get_to_mark_initial_grade_info($courseworkid,$userid) * @param $userid * @return bool */ - private function should_get_to_mark_agreed_grade_info($courseworkid,$userid) { + private function should_get_to_mark_agreed_grade_info($courseworkid,$userid) { $coursework = new \mod_coursework\models\coursework($courseworkid); diff --git a/classes/models/submission.php b/classes/models/submission.php index c880ff3c..d8c4a730 100644 --- a/classes/models/submission.php +++ b/classes/models/submission.php @@ -773,7 +773,7 @@ public function get_author_id() { // the author is the first member of the group if ($this->is_submission_on_behalf()) { - if ( $this->get_coursework()->is_configured_to_have_group_submissions()) { + if ( $this->get_coursework()->is_configured_to_have_group_submissions()) { $members = groups_get_members($this->allocatableid, 'u.id', 'id'); if ($members) { $id = reset($members)->id; @@ -797,7 +797,7 @@ public function get_author_id() { * @param $groupid * @return array */ - public function get_tii_group_member_with_eula($groupid) { + public function get_tii_group_member_with_eula($groupid) { global $DB; @@ -914,7 +914,7 @@ public function all_inital_graded() { return $this->get_state() >= submission::FULLY_GRADED; } - public function is_finalised() { + public function is_finalised() { return $this->get_state() == submission::FINALISED; } @@ -1422,7 +1422,7 @@ public function final_draft_feedbacks_exist() { /* * Determines whether the current user is able to add a turnitin grademark to this submission */ - function can_add_tii_grademark() { + function can_add_tii_grademark() { $canadd = false; if ($this->get_coursework()->get_max_markers() == 1) { @@ -1462,7 +1462,7 @@ function has_valid_extension(){ } - function can_be_unfinalised() { + function can_be_unfinalised() { return ($this->get_state() == submission::FINALISED); } diff --git a/classes/personal_deadline/table/row/builder.php b/classes/personal_deadline/table/row/builder.php index b421a632..2daebff3 100644 --- a/classes/personal_deadline/table/row/builder.php +++ b/classes/personal_deadline/table/row/builder.php @@ -200,7 +200,7 @@ public function get_personal_deadlines() { } - public function get_submission_status() { + public function get_submission_status() { global $DB; $submission_db = $DB->get_record('coursework_submissions', @@ -212,7 +212,7 @@ public function get_submission_status() { $statustext = get_string('statusnotsubmitted','mod_coursework'); - if (!empty($submission) && $submission->is_finalised()) { + if (!empty($submission) && $submission->is_finalised()) { $statustext = get_string('finalisedsubmission','mod_coursework'); } else if (!empty($submission)) { $statustext = $submission->get_status_text(); diff --git a/classes/render_helpers/grading_report/cells/user_cell.php b/classes/render_helpers/grading_report/cells/user_cell.php index 0bd048ff..f3dd5541 100644 --- a/classes/render_helpers/grading_report/cells/user_cell.php +++ b/classes/render_helpers/grading_report/cells/user_cell.php @@ -60,7 +60,7 @@ public function get_table_cell($rowobject) { /* $candidatenumber = $user->candidate_number(); - if (!empty($candidatenumber)) { + if (!empty($candidatenumber)) { $content .= '
('.$candidatenumber.')'; diff --git a/classes/sample_set_rule/range_sample_type.php b/classes/sample_set_rule/range_sample_type.php index a163b92a..540506ee 100644 --- a/classes/sample_set_rule/range_sample_type.php +++ b/classes/sample_set_rule/range_sample_type.php @@ -44,11 +44,11 @@ public function adjust_set(array &$moderation_set, array &$potential_allocatable } - public function get_numeric_boundaries() { + public function get_numeric_boundaries() { } - public function get_default_rule_order() { + public function get_default_rule_order() { } @@ -70,7 +70,7 @@ public function add_form_elements($assessor_number=0) { $samplerecords = $DB->get_records_sql($sql); - if (!empty($samplerecords)) { + if (!empty($samplerecords)) { $seq = 0; foreach($samplerecords as $record) { $html .= $this->range_elements($assessor_number,$seq,$record); @@ -92,19 +92,19 @@ public function add_form_elements($assessor_number=0) { return $html; } - public function range_elements($assessor_number,$sequence,$dbrecord=false) { + public function range_elements($assessor_number,$sequence,$dbrecord=false) { $percentage_options = array(); - for($i = 0;$i < 110; $i = $i + 10) { + for($i = 0;$i < 110; $i = $i + 10) { $percentage_options[$i] = "{$i}"; } $scale = array(); if ($this->coursework->grade > 0) { - for($i=0;$i <= $this->coursework->grade; $i++) { + for($i=0;$i <= $this->coursework->grade; $i++) { $scale[] = $i; } } else { @@ -112,7 +112,7 @@ public function range_elements($assessor_number,$sequence,$dbrecord=false) { $scale = explode(",",$grade_scale->scale); } - if ($dbrecord) { + if ($dbrecord) { $selected_type = array($dbrecord->ruletype=> get_string($dbrecord->ruletype, 'mod_coursework')); $selected_to = ($dbrecord->ruletype == 'scale') ? array($dbrecord->upperlimit=> $scale[$dbrecord->upperlimit]) : array($dbrecord->upperlimit=> $dbrecord->upperlimit); @@ -182,7 +182,7 @@ public function add_form_elements_js($assessor_number=0) { //add grade rule buttons $('.addgradderule').each(function(e,element) { - $(element).on('click',function (e) { + $(element).on('click',function (e) { e.preventDefault(); var linkid = $(this).attr('id').split('_'); @@ -228,7 +228,7 @@ public function add_form_elements_js($assessor_number=0) { //remove grade rule buttons $('.removegradderule').each(function(e,element) { - $(element).on('click',function (e) { + $(element).on('click',function (e) { e.preventDefault(); var linkid = $(this).attr('id').split('_'); @@ -265,7 +265,7 @@ public function add_form_elements_js($assessor_number=0) { $(sampletoid).attr('disabled',disabled); - $(element).on('change',function() { + $(element).on('change',function() { var ele_id = $(this).attr('id').split('_'); var sampletypeid = '#'+ele_id[0]+'_'+ele_id[1]+'_sampletype_'+ele_id[3]; @@ -284,7 +284,7 @@ public function add_form_elements_js($assessor_number=0) { //grade rule drop downs $('.grade_type').each(function(e,element) { - $(element).on('change',function() { + $(element).on('change',function() { change_options(this); }) @@ -309,7 +309,7 @@ function change_options(element) { var type = PERCENT; - if ($(element).val() == PERCENT ) { + if ($(element).val() == PERCENT ) { for(var i = 0;i < 11; i++) { selectValues[i] = (i*10); } @@ -403,7 +403,7 @@ public function adjust_sample_set($stage_number,&$allocatables,&$manual_sample_s $ruleinstance = $DB->get_records_sql($sql,array('courseworkid' => $this->coursework->id,'stage' => $stage)); - foreach($ruleinstance as $ri) { + foreach($ruleinstance as $ri) { $limit = $this->rationalise($ri->ruletype,$ri->lowerlimit,$ri->upperlimit); @@ -414,7 +414,7 @@ public function adjust_sample_set($stage_number,&$allocatables,&$manual_sample_s $finalised = $this->finalised_submissions(); $published = $this->released_submissions(); - foreach($allocatables_in_range as $awf) { + foreach($allocatables_in_range as $awf) { if (!isset($published[$awf->allocatableid]) && !isset($finalised[$awf->allocatableid]) && !isset($auto_sample_set[$awf->allocatableid]) && !isset($manual_sample_set[$awf->allocatableid]) && isset($allocatables[$awf->allocatableid])) @@ -424,7 +424,7 @@ public function adjust_sample_set($stage_number,&$allocatables,&$manual_sample_s } } - private function rationalise($ruletype,$limit1,$limit2) { + private function rationalise($ruletype,$limit1,$limit2) { global $DB; @@ -446,7 +446,7 @@ private function rationalise($ruletype,$limit1,$limit2) { } else { $scale = $DB->get_record("scale",array('id' => abs($this->coursework->grade))); - if ($scale) { + if ($scale) { $coursework_scale = explode(",",$scale->scale); @@ -470,7 +470,7 @@ private function rationalise($ruletype,$limit1,$limit2) { return $limits; } - private function get_allocatables_in_range($stage,$limit1,$limit2) { + private function get_allocatables_in_range($stage,$limit1,$limit2) { global $CFG, $DB; $gradesql = ($CFG->dbtype == 'pgsql') ? " CAST(grade AS integer) " : " grade "; diff --git a/classes/sample_set_rule/sample_base.php b/classes/sample_set_rule/sample_base.php index 61c3698e..e9b40d7a 100644 --- a/classes/sample_set_rule/sample_base.php +++ b/classes/sample_set_rule/sample_base.php @@ -96,7 +96,7 @@ abstract class sample_base { - function __construct($coursework) { + function __construct($coursework) { $this->coursework = $coursework; } diff --git a/classes/sample_set_rule/total_sample_type.php b/classes/sample_set_rule/total_sample_type.php index 3f158572..47050565 100644 --- a/classes/sample_set_rule/total_sample_type.php +++ b/classes/sample_set_rule/total_sample_type.php @@ -43,11 +43,11 @@ public function adjust_set(array &$moderation_set, array &$potential_allocatable } - public function get_numeric_boundaries() { + public function get_numeric_boundaries() { } - public function get_default_rule_order() { + public function get_default_rule_order() { } @@ -70,7 +70,7 @@ public function add_form_elements($assessor_number=0) { $percentage_options = array(); - for($i = 5;$i <= 100; $i = $i + 5) { + for($i = 5;$i <= 100; $i = $i + 5) { $percentage_options[$i] = "{$i}"; } @@ -108,7 +108,7 @@ public function add_form_elements_js($assessor_number=0) { $(sampletotal).attr('disabled',disabled); - $(element).on('change',function() { + $(element).on('change',function() { var ele_id = $(this).attr('id').split('_'); var sampletotal = '#'+ele_id[0]+'_'+ele_id[1]+'_sampletotal'; var disabled = !$(this).prop('checked'); @@ -170,7 +170,7 @@ public function adjust_sample_set($stage_number,&$allocatables,&$manual_sample_s $rule = $DB->get_record_sql($sql,array('courseworkid' => $this->coursework->id,'stage' => $stage)); - if ($rule) { + if ($rule) { $finalised = $this->finalised_submissions(); $published = $this->released_submissions(); diff --git a/classes/stages/base.php b/classes/stages/base.php index 6fcf33d0..15e0dd4a 100644 --- a/classes/stages/base.php +++ b/classes/stages/base.php @@ -940,14 +940,14 @@ private function in_editable_period($allocatable) { } - private function selected_allocation_in_session($dropdownname) { + private function selected_allocation_in_session($dropdownname) { global $SESSION; $cm = $this->coursework->get_course_module(); - if (!empty($SESSION->coursework_allocationsessions[$cm->id])) { + if (!empty($SESSION->coursework_allocationsessions[$cm->id])) { - if (!empty($SESSION->coursework_allocationsessions[$cm->id][$dropdownname])) { + if (!empty($SESSION->coursework_allocationsessions[$cm->id][$dropdownname])) { return $SESSION->coursework_allocationsessions[$cm->id][$dropdownname]; } diff --git a/classes/task/enrol_task.php b/classes/task/enrol_task.php index 6f3988d8..37261e28 100644 --- a/classes/task/enrol_task.php +++ b/classes/task/enrol_task.php @@ -46,7 +46,7 @@ public function execute() { $courseworkids = $DB->get_records('coursework',array('processenrol' => 1)); - if (!empty($courseworkids)) { + if (!empty($courseworkids)) { foreach ($courseworkids as $courseworkid) { $coursework = \mod_coursework\models\coursework::find($courseworkid); if (empty($coursework)) { diff --git a/classes/task/unenrol_task.php b/classes/task/unenrol_task.php index 1c766ef6..610874fa 100644 --- a/classes/task/unenrol_task.php +++ b/classes/task/unenrol_task.php @@ -46,7 +46,7 @@ public function execute() { $courseworkids = $DB->get_records('coursework',array('processunenrol' => 1)); - if (!empty($courseworkids)) { + if (!empty($courseworkids)) { foreach ($courseworkids as $courseworkid) { $coursework = \mod_coursework\models\coursework::find($courseworkid); if (empty($coursework)) { diff --git a/lib.php b/lib.php index 9f2d53fe..1f2a0792 100644 --- a/lib.php +++ b/lib.php @@ -174,7 +174,7 @@ function coursework_add_instance($formdata) { $formdata->submissionnotification = $subnotify; //if blindmarking is set we will rename files - if ($formdata->blindmarking == 1) { + if ($formdata->blindmarking == 1) { $formdata->renamefiles = 1; @@ -457,7 +457,7 @@ function coursework_update_instance($coursework) { $coursework->renamefiles = $currentcoursework->renamefiles; - } else if ($coursework->blindmarking == 1) { + } else if ($coursework->blindmarking == 1) { $coursework->renamefiles = 1; diff --git a/mod_form.php b/mod_form.php index ed49f6c7..da15c2a5 100644 --- a/mod_form.php +++ b/mod_form.php @@ -338,7 +338,7 @@ protected function add_submission_deadline_field() { $default_timestamp = strtotime('+2 weeks'); $disabled = true; - if (!empty($CFG->coursework_submission_deadline)) { + if (!empty($CFG->coursework_submission_deadline)) { $disabled = false; $default_timestamp =strtotime('today'); @@ -417,7 +417,7 @@ protected function add_start_date_field() { $default_timestamp = strtotime('+2 weeks'); $disabled = true; - if (!empty($CFG->coursework_start_date)) { + if (!empty($CFG->coursework_start_date)) { $disabled = false; $default_timestamp =strtotime('today'); } @@ -436,7 +436,7 @@ protected function add_start_date_field() { - private function add_marking_deadline_field() { + private function add_marking_deadline_field() { global $CFG; $moodle_form =& $this->_form; $options = array(0 => get_string('no'), 1 => get_string('yes')); @@ -462,7 +462,7 @@ protected function add_initial_marking_deadline_field() { $submission_deadline_timestamp =strtotime('today'); - if (!empty($CFG->coursework_submission_deadline)) { + if (!empty($CFG->coursework_submission_deadline)) { if ($CFG->coursework_submission_deadline == 7 ) { $submission_deadline_timestamp = strtotime('+1 weeks'); } else if ($CFG->coursework_submission_deadline == 14 ) { @@ -472,7 +472,7 @@ protected function add_initial_marking_deadline_field() { } } - if (!empty($CFG->coursework_marking_deadline)) { + if (!empty($CFG->coursework_marking_deadline)) { $disabled = false; @@ -517,7 +517,7 @@ protected function add_agreed_grade_marking_deadline_field() { $submission_deadline_timestamp =strtotime('today'); - if (!empty($CFG->coursework_submission_deadline)) { + if (!empty($CFG->coursework_submission_deadline)) { if ($CFG->coursework_submission_deadline == 7 ) { $submission_deadline_timestamp = strtotime('+1 weeks'); } else if ($CFG->coursework_submission_deadline == 14 ) { @@ -527,7 +527,7 @@ protected function add_agreed_grade_marking_deadline_field() { } } - if (!empty($CFG->coursework_agreed_marking_deadline)) { + if (!empty($CFG->coursework_agreed_marking_deadline)) { $disabled = false; if ($CFG->coursework_agreed_marking_deadline == 7 ) { $default_timestamp = strtotime('+1 weeks',$submission_deadline_timestamp); @@ -559,7 +559,7 @@ protected function add_agreed_grade_marking_deadline_field() { /******** * Adds the relative initial marking deadline fields to the settings */ - protected function add_relative_initial_marking_deadline_field() { + protected function add_relative_initial_marking_deadline_field() { global $CFG; $moodle_form =& $this->_form; @@ -587,7 +587,7 @@ protected function add_relative_initial_marking_deadline_field() { /******** * Adds the relative agreed grade marking deadline fields to the settings */ - protected function add_relative_agreed_grade_marking_deadline_field() { + protected function add_relative_agreed_grade_marking_deadline_field() { global $CFG; $moodle_form =& $this->_form; @@ -790,7 +790,7 @@ protected function add_number_of_files_field() { } - protected function add_rename_file_field() { + protected function add_rename_file_field() { global $DB, $PAGE; @@ -813,10 +813,10 @@ protected function add_rename_file_field() { $PAGE->requires->js_amd_inline(" require(['jquery'], function() { - $('#id_blindmarking').change(function() { + $('#id_blindmarking').change(function() { console.log($(this).val()); - if ($(this).val()== 1) { + if ($(this).val()== 1) { $('#id_renamefiles').val(1); } @@ -1246,7 +1246,7 @@ private function add_view_initial_assessors_grade(){ } - private function add_enable_agreed_grade_delay() { + private function add_enable_agreed_grade_delay() { global $CFG; @@ -1273,7 +1273,7 @@ private function add_enable_agreed_grade_delay() { /** * */ - private function add_save_feedback_as_draft() { + private function add_save_feedback_as_draft() { $moodle_form =& $this->_form; @@ -1329,7 +1329,7 @@ private function add_enable_extensions_field(){ } - private function add_submission_notification_field() { + private function add_submission_notification_field() { global $COURSE; diff --git a/renderers/object_renderer.php b/renderers/object_renderer.php index cd211b46..080638f9 100644 --- a/renderers/object_renderer.php +++ b/renderers/object_renderer.php @@ -771,7 +771,7 @@ protected function get_router() { } - public function render_mod_coursework_sampling_set_widget(mod_coursework_sampling_set_widget $samplingwidget) { + public function render_mod_coursework_sampling_set_widget(mod_coursework_sampling_set_widget $samplingwidget) { global $OUTPUT, $DB; @@ -805,7 +805,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin $assessorheaders = array(); - for($i = 0; $i < $samplingwidget->get_coursework()->get_max_markers(); $i++) { + for($i = 0; $i < $samplingwidget->get_coursework()->get_max_markers(); $i++) { $assessorheaders[] = get_string('assessorheading','mod_coursework',$i+1); } @@ -815,7 +815,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin $comma = ""; - for($i=0;$i <= $samplingwidget->get_coursework()->grade; $i++) { + for($i=0;$i <= $samplingwidget->get_coursework()->grade; $i++) { $scale .= $comma.$i; $comma = ","; } @@ -837,13 +837,13 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin $percentage_options = array(); - for($i = 0;$i < 110; $i = $i + 10) { + for($i = 0;$i < 110; $i = $i + 10) { $percentage_options[$i] = "{$i}%"; } $javascript = false; - for ($i = 2; $i <= $samplingwidget->get_coursework()->get_max_markers(); $i++) { + for ($i = 2; $i <= $samplingwidget->get_coursework()->get_max_markers(); $i++) { //create the secon @@ -905,7 +905,7 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin $script = " - $('#save_manual_sampling').on('click', function (e) { + $('#save_manual_sampling').on('click', function (e) { validationresults = Array(); @@ -932,11 +932,11 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin } - private function sampling_strategy_column($samplingwidget,$suffix = '') { + private function sampling_strategy_column($samplingwidget,$suffix = '') { $percentage_options = array(); - for($i = 0;$i < 110; $i = $i + 10) { + for($i = 0;$i < 110; $i = $i + 10) { $percentage_options[$i] = "{$i}%"; } @@ -1664,7 +1664,7 @@ public function get_allocatables_count_per_assessor($coursework){ $allocatables = $coursework->get_allocatables(); if (!$coursework->has_multiple_markers() && has_capability('mod/coursework:addagreedgrade', $coursework->get_context()) && - !has_capability('mod/coursework:addinitialgrade', $coursework->get_context()) ) { + !has_capability('mod/coursework:addinitialgrade', $coursework->get_context()) ) { $submissions = $coursework->get_all_submissions(); @@ -1705,13 +1705,13 @@ public function get_allocatables_count_per_assessor($coursework){ * @param $submissions * @return mixed */ - public function remove_unfinalised_submissions($submissions) { + public function remove_unfinalised_submissions($submissions) { - foreach($submissions as $sub) { + foreach($submissions as $sub) { $submission = submission::find($sub); - if (empty($submission->finalised)) { + if (empty($submission->finalised)) { unset($submissions[$sub->id]); } } @@ -1727,11 +1727,11 @@ public function remove_unfinalised_submissions($submissions) { */ public function removed_final_graded_submissions($submissions) { - foreach($submissions as $sub) { + foreach($submissions as $sub) { $submission = submission::find($sub); - if (!empty($submission->get_final_grade() )) { + if (!empty($submission->get_final_grade() )) { unset($submissions[$sub->id]); } } @@ -1747,13 +1747,13 @@ public function removed_final_graded_submissions($submissions) { * @return mixed * @throws coding_exception */ - public function remove_ungradable_submissions($submissions) { + public function remove_ungradable_submissions($submissions) { - foreach($submissions as $sub) { + foreach($submissions as $sub) { $submission = submission::find($sub); - if (has_capability('mod/coursework:addallocatedagreedgrade',$submission->get_coursework()->get_context()) && !$submission->is_assessor_initial_grader() && $submission->all_inital_graded()) { + if (has_capability('mod/coursework:addallocatedagreedgrade',$submission->get_coursework()->get_context()) && !$submission->is_assessor_initial_grader() && $submission->all_inital_graded()) { unset($submissions[$sub->id]); } } @@ -1769,10 +1769,10 @@ public function remove_ungradable_submissions($submissions) { */ public function remove_final_gradable_submissions($submissions) { - foreach($submissions as $sub) { + foreach($submissions as $sub) { $submission = submission::find($sub); - if (!empty($submission->all_inital_graded()) ) { + if (!empty($submission->all_inital_graded()) ) { unset($submissions[$sub->id]); } } @@ -1788,15 +1788,15 @@ public function remove_final_gradable_submissions($submissions) { * @return mixed * @throws coding_exception */ - public function get_assessor_initial_graded_submissions($submissions) { + public function get_assessor_initial_graded_submissions($submissions) { global $USER; - foreach($submissions as $sub) { + foreach($submissions as $sub) { $submission = submission::find($sub); if (count($submission->get_assessor_feedbacks()) >= $submission->max_number_of_feedbacks() || $submission->is_assessor_initial_grader() - && (!has_capability('mod/coursework:administergrades',$submission->get_coursework()->get_context()) && !is_siteadmin($USER->id))) { + && (!has_capability('mod/coursework:administergrades',$submission->get_coursework()->get_context()) && !is_siteadmin($USER->id))) { //is this submission assessable by this user at an inital gradig stage unset($submissions[$sub->id]); @@ -1845,7 +1845,7 @@ public function get_submissions_for_assessor($coursework, $submissions){ $gradeblesub = array(); if (!$coursework->has_multiple_markers() && has_capability('mod/coursework:addagreedgrade', $coursework->get_context()) && - !has_capability('mod/coursework:addinitialgrade', $coursework->get_context()) ) { + !has_capability('mod/coursework:addinitialgrade', $coursework->get_context()) ) { foreach($submissions as $sub) { diff --git a/renderers/page_renderer.php b/renderers/page_renderer.php index 541e3b56..96a8b64d 100644 --- a/renderers/page_renderer.php +++ b/renderers/page_renderer.php @@ -153,7 +153,7 @@ public function edit_feedback_page(feedback $teacher_feedback, $assessor, $edito } } - public function confirm_feedback_removal_page(feedback $teacher_feedback, $confirmurl) { + public function confirm_feedback_removal_page(feedback $teacher_feedback, $confirmurl) { global $PAGE, $SITE, $OUTPUT; $grading_title = @@ -1663,8 +1663,7 @@ protected function render_advance_plugins_form() { /** * @return string */ - public function modal_grading_render() - { + public function modal_grading_render() { $this->page->requires->string_for_js('insertcomment', 'gradingform_guide'); $html = '