From c56ae661af0a80afa18629bc35dd9a331f0ee8b3 Mon Sep 17 00:00:00 2001
From: watson8 <14983002+watson8@users.noreply.github.com>
Date: Mon, 2 Sep 2024 13:51:09 +0100
Subject: [PATCH 01/27] CTP-3762 add missing upgrade savepoint (#10)
---
db/upgrade.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/db/upgrade.php b/db/upgrade.php
index de358995..11960664 100644
--- a/db/upgrade.php
+++ b/db/upgrade.php
@@ -1649,6 +1649,7 @@ function xmldb_coursework_upgrade($oldversion) {
if ($oldversion < 2014090200) {
$DB->execute("UPDATE {coursework} SET moderationenabled = 0");
+ upgrade_mod_savepoint(true, 2014090200, 'coursework');
}
if ($oldversion < 2014090801) {
From bf95d97280b078b756366dae8042d81b46c68d85 Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Mon, 2 Sep 2024 14:24:50 +0100
Subject: [PATCH 02/27] CTP-3560 behat indentation
---
...ion_automatic_allocations_disabled.feature | 26 +--
...tomatic_equal_assessor_allocations.feature | 59 +++----
...nteracting_with_manual_allocations.feature | 55 +++---
...ic_percentage_assessor_allocations.feature | 66 ++++---
...cation_manual_assessor_allocations.feature | 88 +++++-----
...ibility_of_all_students_capability.feature | 8 -
...n_visibility_of_allocated_students.feature | 40 ++---
...n_visibility_of_allocated_teachers.feature | 24 +--
tests/behat/automatic_agreement.feature | 77 ++++-----
..._agreed_graders_with_blind_marking.feature | 45 +++--
...reed_graders_without_blind_marking.feature | 46 ++---
...ty_for_teachers_with_blind_marking.feature | 65 ++++---
...for_teachers_without_blind_marking.feature | 55 +++---
tests/behat/deadline_extension.feature | 4 +-
...ine_extension_reason_dropdown_list.feature | 5 +-
tests/behat/enrolment_triggers.feature | 29 ++--
tests/behat/factory.feature | 129 +++++++-------
...feedback_auto_release_without_cron.feature | 37 ++--
tests/behat/feedback_collisions.feature | 82 ++++-----
...dit_feedback_within_specified_time.feature | 15 +-
tests/behat/feedback_files.feature | 59 ++++---
...back_final_feedback_double_marking.feature | 100 ++++++-----
tests/behat/feedback_general_feedback.feature | 109 ++++++------
...edback_group_feedback_for_students.feature | 70 ++++----
tests/behat/feedback_group_marking.feature | 44 ++---
...eedback_multiple_assessor_feedback.feature | 159 +++++++++--------
.../behat/feedback_publishing_grades.feature | 76 ++++----
...feedback_restrict_feedback_editing.feature | 7 -
tests/behat/feedback_rubrics.feature | 81 +++++----
tests/behat/feedback_single_marking.feature | 73 ++++----
tests/behat/feedback_zero_grades.feature | 32 ++--
tests/behat/installation_and_set_up.feature | 35 ++--
.../behat/sampling_automatic_sampling.feature | 23 +--
tests/behat/sampling_manual_sampling.feature | 89 +++++-----
.../sampling_sample_range_set_rules.feature | 20 +--
...submissions_agree_submission_terms.feature | 163 +++++++++---------
.../submissions_auto_finalisation.feature | 29 ++--
tests/behat/submissions_deadlines.feature | 42 ++---
.../submissions_early_finalisation.feature | 81 ++++-----
.../submissions_file_upload_limit.feature | 25 ++-
.../submissions_file_upload_types.feature | 48 +++---
.../submissions_group_submissions.feature | 72 ++++----
.../submissions_late_submissions.feature | 41 +++--
tests/behat/submissions_start_date.feature | 37 ++--
.../submissions_student_submission.feature | 58 +++----
...ubmissions_submit_onbehalf_student.feature | 2 +-
tests/behat/warnings.feature | 43 ++---
47 files changed, 1237 insertions(+), 1336 deletions(-)
delete mode 100644 tests/behat/feedback_restrict_feedback_editing.feature
diff --git a/tests/behat/allocation_automatic_allocations_disabled.feature b/tests/behat/allocation_automatic_allocations_disabled.feature
index 034f2cb9..8536bf9e 100644
--- a/tests/behat/allocation_automatic_allocations_disabled.feature
+++ b/tests/behat/allocation_automatic_allocations_disabled.feature
@@ -5,17 +5,17 @@ Feature: Automatic allocations can be disabled
I want to be able to turn off automatic allocations
So that I can choose the teachers manually and not have weird or inappropriate allocations
- Background:
- Given the managers are not allowed to grade
- And there is a course
- And there is a coursework
- And there is a teacher
- And I am logged in as a manager
- And the managers are not allowed to grade
- And there are no allocations in the db
+ Background:
+ Given the managers are not allowed to grade
+ And there is a course
+ And there is a coursework
+ And there is a teacher
+ And I am logged in as a manager
+ And the managers are not allowed to grade
+ And there are no allocations in the db
- Scenario: Nothing happens with
- Given the coursework "allocationenabled" setting is "1" in the database
- And the coursework "assessorallocationstrategy" setting is "none" in the database
- When there is a student
- Then there should be no allocations in the db
+ Scenario: Nothing happens with
+ Given the coursework "allocationenabled" setting is "1" in the database
+ And the coursework "assessorallocationstrategy" setting is "none" in the database
+ When there is a student
+ Then there should be no allocations in the db
diff --git a/tests/behat/allocation_automatic_equal_assessor_allocations.feature b/tests/behat/allocation_automatic_equal_assessor_allocations.feature
index 7a3a8461..7dc68dc8 100644
--- a/tests/behat/allocation_automatic_equal_assessor_allocations.feature
+++ b/tests/behat/allocation_automatic_equal_assessor_allocations.feature
@@ -6,35 +6,30 @@ Feature: Automatic equal assessor allocations
So that the marking is fairly distributed and the interface is less cluttered for teachers,
and they don't mark to many or too few.
- Background:
- Given the managers are not allowed to grade
- And there is a course
- And there is a coursework
- And the coursework "allocationenabled" setting is "1" in the database
- And the coursework "numberofmarkers" setting is "1" in the database
- And there is a student
- And there is a teacher
- And teachers hava a capability to administer grades
- And I am logged in as a manager
- And there are no allocations in the db
-
- Scenario: Automatic allocations should work
- When I visit the allocations page
- And I save everything
- And I log out
- And I log in as the teacher
- And I visit the coursework page
- Then I should see the student's name on the page
-
- Scenario: Automatic allocations of non-manually allocated should work
- When I visit the allocations page
- And I save everything
- And I log out
- And I log in as the teacher
- And I visit the coursework page
- Then I should see the student's name on the page
-
-
-
-
-
+ Background:
+ Given the managers are not allowed to grade
+ And there is a course
+ And there is a coursework
+ And the coursework "allocationenabled" setting is "1" in the database
+ And the coursework "numberofmarkers" setting is "1" in the database
+ And there is a student
+ And there is a teacher
+ And teachers hava a capability to administer grades
+ And I am logged in as a manager
+ And there are no allocations in the db
+
+ Scenario: Automatic allocations should work
+ When I visit the allocations page
+ And I save everything
+ And I log out
+ And I log in as the teacher
+ And I visit the coursework page
+ Then I should see the student's name on the page
+
+ Scenario: Automatic allocations of non-manually allocated should work
+ When I visit the allocations page
+ And I save everything
+ And I log out
+ And I log in as the teacher
+ And I visit the coursework page
+ Then I should see the student's name on the page
diff --git a/tests/behat/allocation_automatic_interacting_with_manual_allocations.feature b/tests/behat/allocation_automatic_interacting_with_manual_allocations.feature
index 2e976845..2516b80a 100644
--- a/tests/behat/allocation_automatic_interacting_with_manual_allocations.feature
+++ b/tests/behat/allocation_automatic_interacting_with_manual_allocations.feature
@@ -5,33 +5,32 @@ Feature: Automatically allocations interacting with manually allocated students
I want to be able to reallocate all of the non manual students
So that if the number of students or teachers has changed, I can make sure everything remains balanced
- Background:
- Given there is a course
- And there is a coursework
- And the coursework "allocationenabled" setting is "1" in the database
- And the coursework "numberofmarkers" setting is "1" in the database
- And the managers are not allowed to grade
- And there is a student
- And there is a teacher
- And I am logged in as a manager
+ Background:
+ Given there is a course
+ And there is a coursework
+ And the coursework "allocationenabled" setting is "1" in the database
+ And the coursework "numberofmarkers" setting is "1" in the database
+ And the managers are not allowed to grade
+ And there is a student
+ And there is a teacher
+ And I am logged in as a manager
- Scenario: Automatic allocations should not alter the manual allocations
- Given there is another teacher
- And there are no allocations in the db
- When I visit the allocations page
- And I manually allocate the student to the teacher
- And I set the allocation strategy to 100 percent for the other teacher
- And I save everything
- When I visit the allocations page
- Then I should see the student allocated to the teacher for the first assessor
-
- @javascript
- Scenario: Automatic allocations should wipe the older automatic allocations
- Given the student is allocated to the teacher
- And there is another teacher
- When I visit the allocations page
- And I set the allocation strategy to 100 percent for the other teacher
- And I press "Apply"
- When I visit the allocations page
- Then I should see the student allocated to the other teacher for the first assessor
+ Scenario: Automatic allocations should not alter the manual allocations
+ Given there is another teacher
+ And there are no allocations in the db
+ When I visit the allocations page
+ And I manually allocate the student to the teacher
+ And I set the allocation strategy to 100 percent for the other teacher
+ And I save everything
+ When I visit the allocations page
+ Then I should see the student allocated to the teacher for the first assessor
+ @javascript
+ Scenario: Automatic allocations should wipe the older automatic allocations
+ Given the student is allocated to the teacher
+ And there is another teacher
+ When I visit the allocations page
+ And I set the allocation strategy to 100 percent for the other teacher
+ And I press "Apply"
+ When I visit the allocations page
+ Then I should see the student allocated to the other teacher for the first assessor
diff --git a/tests/behat/allocation_automatic_percentage_assessor_allocations.feature b/tests/behat/allocation_automatic_percentage_assessor_allocations.feature
index a470fe8d..06a13fe8 100644
--- a/tests/behat/allocation_automatic_percentage_assessor_allocations.feature
+++ b/tests/behat/allocation_automatic_percentage_assessor_allocations.feature
@@ -6,38 +6,34 @@ Feature: Automatic percentage assessor allocations
So that the marking is fairly distributed and the interface is less cluttered for teachers,
and they don't mark to many or too few.
- Background:
- Given there is a course
- And there is a coursework
- And the coursework "allocationenabled" setting is "1" in the database
- And the coursework "numberofmarkers" setting is "1" in the database
- And the managers are not allowed to grade
- And there is a student
- And there is a teacher
- And I am logged in as a manager
- And there are no allocations in the db
-
- @javascript
- Scenario: Automatic percentage allocations should allocate to the right teacher
- Given there is another teacher
- And there are no allocations in the db
- When I visit the allocations page
- And I set the allocation strategy to 100 percent for the other teacher
- And I press "Apply"
- When I visit the allocations page
- Then I should see the student allocated to the other teacher for the first assessor
-
- Scenario: percentage allocations should not allocate to the wrong teacher
- Given there is another teacher
- And there are no allocations in the db
- When I visit the allocations page
- And I set the allocation strategy to 100 percent for the other teacher
- And I save everything
- And I log out
- And I log in as the teacher
- And I visit the coursework page
- Then I should not see the student's name on the page
-
-
-
-
+ Background:
+ Given there is a course
+ And there is a coursework
+ And the coursework "allocationenabled" setting is "1" in the database
+ And the coursework "numberofmarkers" setting is "1" in the database
+ And the managers are not allowed to grade
+ And there is a student
+ And there is a teacher
+ And I am logged in as a manager
+ And there are no allocations in the db
+
+ @javascript
+ Scenario: Automatic percentage allocations should allocate to the right teacher
+ Given there is another teacher
+ And there are no allocations in the db
+ When I visit the allocations page
+ And I set the allocation strategy to 100 percent for the other teacher
+ And I press "Apply"
+ When I visit the allocations page
+ Then I should see the student allocated to the other teacher for the first assessor
+
+ Scenario: percentage allocations should not allocate to the wrong teacher
+ Given there is another teacher
+ And there are no allocations in the db
+ When I visit the allocations page
+ And I set the allocation strategy to 100 percent for the other teacher
+ And I save everything
+ And I log out
+ And I log in as the teacher
+ And I visit the coursework page
+ Then I should not see the student's name on the page
diff --git a/tests/behat/allocation_manual_assessor_allocations.feature b/tests/behat/allocation_manual_assessor_allocations.feature
index 250814ef..13acf308 100644
--- a/tests/behat/allocation_manual_assessor_allocations.feature
+++ b/tests/behat/allocation_manual_assessor_allocations.feature
@@ -5,51 +5,51 @@ Feature: Manually assessor allocations
As a course leader
I want to be able to manually allocate students to assessors
- Background:
- Given there is a course
- And there is a coursework
- And the coursework "allocationenabled" setting is "1" in the database
- And the coursework "assessorallocationstrategy" setting is "none" in the database
- And the coursework "numberofmarkers" setting is "2" in the database
- And there is a student
- And there is a teacher
- And I am logged in as a manager
+ Background:
+ Given there is a course
+ And there is a coursework
+ And the coursework "allocationenabled" setting is "1" in the database
+ And the coursework "assessorallocationstrategy" setting is "none" in the database
+ And the coursework "numberofmarkers" setting is "2" in the database
+ And there is a student
+ And there is a teacher
+ And I am logged in as a manager
- Scenario: Teachers do not see students who are allocated to other teachers
- Given there is another teacher
- And there are no allocations in the db
- When I visit the allocations page
- And I manually allocate the student to the other teacher
- And I log out
- And I log in as the teacher
- And I visit the coursework page
- Then I should not see the student's name on the page
+ Scenario: Teachers do not see students who are allocated to other teachers
+ Given there is another teacher
+ And there are no allocations in the db
+ When I visit the allocations page
+ And I manually allocate the student to the other teacher
+ And I log out
+ And I log in as the teacher
+ And I visit the coursework page
+ Then I should not see the student's name on the page
- Scenario: auto allocations should not alter the manual allocations
- Given there is another teacher
- And there are no allocations in the db
- When I visit the allocations page
- And I manually allocate the student to the teacher
- And I set the allocation strategy to 100 percent for the other teacher
- And I save everything
- And I visit the allocations page
- Then I should see the student allocated to the teacher for the first assessor
+ Scenario: auto allocations should not alter the manual allocations
+ Given there is another teacher
+ And there are no allocations in the db
+ When I visit the allocations page
+ And I manually allocate the student to the teacher
+ And I set the allocation strategy to 100 percent for the other teacher
+ And I save everything
+ And I visit the allocations page
+ Then I should see the student allocated to the teacher for the first assessor
- Scenario: allocating multiple teachers
- Given there is another teacher
- When I visit the allocations page
- And I manually allocate the student to the teacher
- And I save everything
- And I visit the allocations page
- And I manually allocate the student to the other teacher for the second assessment
- And I save everything
- And I visit the allocations page
- Then I should see that the student has two allcations
+ Scenario: allocating multiple teachers
+ Given there is another teacher
+ When I visit the allocations page
+ And I manually allocate the student to the teacher
+ And I save everything
+ And I visit the allocations page
+ And I manually allocate the student to the other teacher for the second assessment
+ And I save everything
+ And I visit the allocations page
+ Then I should see that the student has two allcations
- Scenario: Allocations work for more than one student
- Given there is another student
- When I visit the allocations page
- And I manually allocate the student to the teacher
- And I manually allocate the other student to the teacher
- And I save everything
- Then I should see that both students are allocated to the teacher
+ Scenario: Allocations work for more than one student
+ Given there is another student
+ When I visit the allocations page
+ And I manually allocate the student to the teacher
+ And I manually allocate the other student to the teacher
+ And I save everything
+ Then I should see that both students are allocated to the teacher
diff --git a/tests/behat/allocation_visibility_of_all_students_capability.feature b/tests/behat/allocation_visibility_of_all_students_capability.feature
index 15551950..cc5d6444 100644
--- a/tests/behat/allocation_visibility_of_all_students_capability.feature
+++ b/tests/behat/allocation_visibility_of_all_students_capability.feature
@@ -38,11 +38,3 @@ Feature: View of all students: allocated and non allocated students
And I visit the coursework page
And I click show all students button
Then I should see another student's name on the page
-
-
-
-
-
-
-
-
diff --git a/tests/behat/allocation_visibility_of_allocated_students.feature b/tests/behat/allocation_visibility_of_allocated_students.feature
index dc4481d1..a47afbe6 100644
--- a/tests/behat/allocation_visibility_of_allocated_students.feature
+++ b/tests/behat/allocation_visibility_of_allocated_students.feature
@@ -5,25 +5,25 @@ Feature: Visibility of allocated students
As a course leader
I want teachers to only see the students who have been allocated to them
- Background:
- Given there is a course
- And there is a coursework
- And the coursework "allocationenabled" setting is "1" in the database
- And the coursework "assessorallocationstrategy" setting is "none" in the database
- And there is a student
- And there is a teacher
+ Background:
+ Given there is a course
+ And there is a coursework
+ And the coursework "allocationenabled" setting is "1" in the database
+ And the coursework "assessorallocationstrategy" setting is "none" in the database
+ And there is a student
+ And there is a teacher
- Scenario: Teachers do not see students who are unallocated
- Given I log in as the teacher
- And I visit the coursework page
- Then I should not see the student's name on the page
+ Scenario: Teachers do not see students who are unallocated
+ Given I log in as the teacher
+ And I visit the coursework page
+ Then I should not see the student's name on the page
- Scenario: I can allocate a student manually and the teacher will see them
- Given I am logged in as a manager
- When I visit the allocations page
- And I manually allocate the student to the teacher
- And I save everything
- And I log out
- And I log in as the teacher
- And I visit the coursework page
- Then I should see the student's name on the page
\ No newline at end of file
+ Scenario: I can allocate a student manually and the teacher will see them
+ Given I am logged in as a manager
+ When I visit the allocations page
+ And I manually allocate the student to the teacher
+ And I save everything
+ And I log out
+ And I log in as the teacher
+ And I visit the coursework page
+ Then I should see the student's name on the page
diff --git a/tests/behat/allocation_visibility_of_allocated_teachers.feature b/tests/behat/allocation_visibility_of_allocated_teachers.feature
index 6ac591d8..832fba3a 100644
--- a/tests/behat/allocation_visibility_of_allocated_teachers.feature
+++ b/tests/behat/allocation_visibility_of_allocated_teachers.feature
@@ -5,16 +5,16 @@ Feature: Visibility of allocated teachers
I want to know who is allocated to mark each submission
So that I do not accidentally mark the wrong stuff
- Background:
- Given there is a course
- And there is a coursework
- And there is a student
+ Background:
+ Given there is a course
+ And there is a coursework
+ And there is a student
- Scenario: I should see the name of the allocated teacher in the assessor feedback cell
- Given there is a teacher
- And the coursework is set to single marker
- And the coursework has assessor allocations enabled
- And the student is manually allocated to the teacher
- When I log in as a manager
- And I visit the coursework page
- Then I should see the name of the teacher in the assessor feedback cell
+ Scenario: I should see the name of the allocated teacher in the assessor feedback cell
+ Given there is a teacher
+ And the coursework is set to single marker
+ And the coursework has assessor allocations enabled
+ And the student is manually allocated to the teacher
+ When I log in as a manager
+ And I visit the coursework page
+ Then I should see the name of the teacher in the assessor feedback cell
diff --git a/tests/behat/automatic_agreement.feature b/tests/behat/automatic_agreement.feature
index c33b0c71..5ecae93e 100644
--- a/tests/behat/automatic_agreement.feature
+++ b/tests/behat/automatic_agreement.feature
@@ -5,48 +5,35 @@ Feature: Automatic agreement for simple grades
I can add an automatic agreement for double marking when both simple grades are adjacent within a specified range,
so that the highest grade is chosen for all cases apart from the fail grades.
- Background:
- Given there is a course
- And there is a coursework
- And the coursework "numberofmarkers" setting is "2" in the database
- And there is a teacher
- And there is another teacher
- And there is a student
- And the student has a submission
- And the submission is finalised
- And the coursework deadline has passed
-
- Scenario: Only one grade in the submissions
- And the coursework "automaticagreementstrategy" setting is "none" in the database
- Given I am logged in as a teacher
- And I visit the coursework page
- And I click on the new feedback button for assessor 1
- When I grade the submission as 56 using the simple form
- Then I should not see the final grade on the multiple marker page
-
- Scenario: Simple grades within 10% boundaries takes higher mark as a final grade
- Given the coursework "automaticagreementstrategy" setting is "percentage_distance" in the database
- Given the coursework "automaticagreementrange" setting is "10" in the database
- And I am logged in as a teacher
- And I visit the coursework page
- And I click on the new feedback button for assessor 1
- And I grade the submission as 67 using the simple form
- And I log out
- And I log in as the other teacher
- And I visit the coursework page
- And I click on the new feedback button for assessor 2
- And I grade the submission as 63 using the simple form
- Then I should see the final grade as 67 on the multiple marker page
-
-
-
-
-
-
-
-
-
-
-
-
-
+ Background:
+ Given there is a course
+ And there is a coursework
+ And the coursework "numberofmarkers" setting is "2" in the database
+ And there is a teacher
+ And there is another teacher
+ And there is a student
+ And the student has a submission
+ And the submission is finalised
+ And the coursework deadline has passed
+
+ Scenario: Only one grade in the submissions
+ And the coursework "automaticagreementstrategy" setting is "none" in the database
+ Given I am logged in as a teacher
+ And I visit the coursework page
+ And I click on the new feedback button for assessor 1
+ When I grade the submission as 56 using the simple form
+ Then I should not see the final grade on the multiple marker page
+
+ Scenario: Simple grades within 10% boundaries takes higher mark as a final grade
+ Given the coursework "automaticagreementstrategy" setting is "percentage_distance" in the database
+ Given the coursework "automaticagreementrange" setting is "10" in the database
+ And I am logged in as a teacher
+ And I visit the coursework page
+ And I click on the new feedback button for assessor 1
+ And I grade the submission as 67 using the simple form
+ And I log out
+ And I log in as the other teacher
+ And I visit the coursework page
+ And I click on the new feedback button for assessor 2
+ And I grade the submission as 63 using the simple form
+ Then I should see the final grade as 67 on the multiple marker page
diff --git a/tests/behat/blind_marking_visibiilty_for_agreed_graders_with_blind_marking.feature b/tests/behat/blind_marking_visibiilty_for_agreed_graders_with_blind_marking.feature
index 3107d88c..c34228ee 100644
--- a/tests/behat/blind_marking_visibiilty_for_agreed_graders_with_blind_marking.feature
+++ b/tests/behat/blind_marking_visibiilty_for_agreed_graders_with_blind_marking.feature
@@ -6,28 +6,27 @@ Feature: visibility of agreed graders with blind marking
teachers before the agreement phase
So that we are not influenced by one another or confused over what to do
- Background:
- Given there is a course
- And there is a coursework
- And blind marking is enabled
- And teachers have the add agreed grade capability
- And there is a teacher
- And there is another teacher
- And the coursework "numberofmarkers" setting is "2" in the database
- And there is a student
- And the student has a submission
- And the submission is finalised
+ Background:
+ Given there is a course
+ And there is a coursework
+ And blind marking is enabled
+ And teachers have the add agreed grade capability
+ And there is a teacher
+ And there is another teacher
+ And the coursework "numberofmarkers" setting is "2" in the database
+ And there is a student
+ And the student has a submission
+ And the submission is finalised
- Scenario: agreed graders cannot see other feedbacks before they have done their own
- Given I am logged in as the other teacher
- And there is feedback for the submission from the teacher
- When I visit the coursework page
- Then I should not see the grade from the teacher in the assessor table
-
- Scenario: agreed graders can view the feedback of the other assessors when all done
- Given there are feedbacks from both teachers
- And I am logged in as the other teacher
- And I visit the coursework page
- When I click on the view icon for the first initial assessor's grade
- Then I should see the first initial assessors grade and comment
+ Scenario: agreed graders cannot see other feedbacks before they have done their own
+ Given I am logged in as the other teacher
+ And there is feedback for the submission from the teacher
+ When I visit the coursework page
+ Then I should not see the grade from the teacher in the assessor table
+ Scenario: agreed graders can view the feedback of the other assessors when all done
+ Given there are feedbacks from both teachers
+ And I am logged in as the other teacher
+ And I visit the coursework page
+ When I click on the view icon for the first initial assessor's grade
+ Then I should see the first initial assessors grade and comment
diff --git a/tests/behat/blind_marking_visibiilty_for_agreed_graders_without_blind_marking.feature b/tests/behat/blind_marking_visibiilty_for_agreed_graders_without_blind_marking.feature
index 3b0606d8..6a02ce43 100644
--- a/tests/behat/blind_marking_visibiilty_for_agreed_graders_without_blind_marking.feature
+++ b/tests/behat/blind_marking_visibiilty_for_agreed_graders_without_blind_marking.feature
@@ -6,28 +6,28 @@ Feature: visibility of agreed graders without blind marking
teachers before the agreement phase
So that we are not influenced by one another or confused over what to do
- Background:
- Given there is a course
- And there is a coursework
- And there is a teacher
- And there is another teacher
- And the coursework "numberofmarkers" setting is "2" in the database
- And there is a student
- And the student has a submission
- And the submission is finalised
+ Background:
+ Given there is a course
+ And there is a coursework
+ And there is a teacher
+ And there is another teacher
+ And the coursework "numberofmarkers" setting is "2" in the database
+ And there is a student
+ And the student has a submission
+ And the submission is finalised
- Scenario: agreed graders can see other feedbacks before they have done their own
- Given teachers have the add agreed grade capability
- And the coursework "viewinitialgradeenabled" setting is "1" in the database
- And I am logged in as the other teacher
- And there is feedback for the submission from the teacher
- When I visit the coursework page
- Then I should see the grade from the teacher in the assessor table
+ Scenario: agreed graders can see other feedbacks before they have done their own
+ Given teachers have the add agreed grade capability
+ And the coursework "viewinitialgradeenabled" setting is "1" in the database
+ And I am logged in as the other teacher
+ And there is feedback for the submission from the teacher
+ When I visit the coursework page
+ Then I should see the grade from the teacher in the assessor table
- Scenario: agreed graders can view the feedback of the other assessors when all done
- Given there are feedbacks from both teachers
- And teachers have the add agreed grade capability
- And I am logged in as the other teacher
- And I visit the coursework page
- When I click on the view icon for the first initial assessor's grade
- Then I should see the first initial assessors grade and comment
\ No newline at end of file
+ Scenario: agreed graders can view the feedback of the other assessors when all done
+ Given there are feedbacks from both teachers
+ And teachers have the add agreed grade capability
+ And I am logged in as the other teacher
+ And I visit the coursework page
+ When I click on the view icon for the first initial assessor's grade
+ Then I should see the first initial assessors grade and comment
diff --git a/tests/behat/blind_marking_visibility_for_teachers_with_blind_marking.feature b/tests/behat/blind_marking_visibility_for_teachers_with_blind_marking.feature
index 2577ebc2..46a036e0 100644
--- a/tests/behat/blind_marking_visibility_for_teachers_with_blind_marking.feature
+++ b/tests/behat/blind_marking_visibility_for_teachers_with_blind_marking.feature
@@ -5,37 +5,34 @@ Feature: Visibility for teachers with blind marking
I want to be able to prevent teachers from seeing each others' marks
So that I can be sure that they are not influenced by each other and the marking is fair
- Background:
- Given there is a course
- And there is a coursework
- And blind marking is enabled
-
- Scenario: The student names are hidden from teachers in the user cells
- Given I am logged in as a teacher
- And there is a student
- When I visit the coursework page
- Then I should not see the student's name in the user cell
-
- Scenario: The user names are hidden from teachers in the group cells
- Given I am logged in as a teacher
- And there is a student
- And group submissions are enabled
- And the student is a member of a group
- And the group is part of a grouping for the coursework
- When I visit the coursework page
- Then I should not see the student's name in the group cell
-
- Scenario: Teachers cannot see other initial grades before final grading happens
- Given the coursework "numberofmarkers" setting is "2" in the database
- And there is a teacher
- And there is another teacher
- And there is a student
- And the student has a submission
- And the submission is finalised
- And there are feedbacks from both teachers
- And I am logged in as the other teacher
- When I visit the coursework page
- Then I should not see the grade from the teacher in the assessor table
-
-
-
+ Background:
+ Given there is a course
+ And there is a coursework
+ And blind marking is enabled
+
+ Scenario: The student names are hidden from teachers in the user cells
+ Given I am logged in as a teacher
+ And there is a student
+ When I visit the coursework page
+ Then I should not see the student's name in the user cell
+
+ Scenario: The user names are hidden from teachers in the group cells
+ Given I am logged in as a teacher
+ And there is a student
+ And group submissions are enabled
+ And the student is a member of a group
+ And the group is part of a grouping for the coursework
+ When I visit the coursework page
+ Then I should not see the student's name in the group cell
+
+ Scenario: Teachers cannot see other initial grades before final grading happens
+ Given the coursework "numberofmarkers" setting is "2" in the database
+ And there is a teacher
+ And there is another teacher
+ And there is a student
+ And the student has a submission
+ And the submission is finalised
+ And there are feedbacks from both teachers
+ And I am logged in as the other teacher
+ When I visit the coursework page
+ Then I should not see the grade from the teacher in the assessor table
diff --git a/tests/behat/blind_marking_visibility_for_teachers_without_blind_marking.feature b/tests/behat/blind_marking_visibility_for_teachers_without_blind_marking.feature
index b5f94c43..b3fdc266 100644
--- a/tests/behat/blind_marking_visibility_for_teachers_without_blind_marking.feature
+++ b/tests/behat/blind_marking_visibility_for_teachers_without_blind_marking.feature
@@ -5,35 +5,34 @@ Feature: visibility for teachers without blind marking
I want to be able to prevent teachers from seeing each others' marks
So that I can be sure that they are not influenced by each other and the marking is fair
- Background:
- Given there is a course
- And there is a coursework
+ Background:
+ Given there is a course
+ And there is a coursework
- Scenario: The student names are normally visible to teachers in the user cells
- Given I am logged in as a teacher
- And there is a student
- When I visit the coursework page
- Then I should see the student's name in the user cell
+ Scenario: The student names are normally visible to teachers in the user cells
+ Given I am logged in as a teacher
+ And there is a student
+ When I visit the coursework page
+ Then I should see the student's name in the user cell
Scenario: The user names are visible from teachers in the group cells
- Given I am logged in as a teacher
- And there is a student
- And group submissions are enabled
- And the student is a member of a group
- And the group is part of a grouping for the coursework
- When I visit the coursework page
- Then I should see the student's name in the group cell
-
- Scenario: Teachers can see other grades
- Given the coursework "numberofmarkers" setting is "2" in the database
- And the coursework "viewinitialgradeenabled" setting is "1" in the database
- And there is a teacher
- And there is another teacher
- And there is a student
- And the student has a submission
- And the submission is finalised
- And there are feedbacks from both teachers
- And I am logged in as the other teacher
- When I visit the coursework page
- Then I should see the grade from the teacher in the assessor table
+ Given I am logged in as a teacher
+ And there is a student
+ And group submissions are enabled
+ And the student is a member of a group
+ And the group is part of a grouping for the coursework
+ When I visit the coursework page
+ Then I should see the student's name in the group cell
+ Scenario: Teachers can see other grades
+ Given the coursework "numberofmarkers" setting is "2" in the database
+ And the coursework "viewinitialgradeenabled" setting is "1" in the database
+ And there is a teacher
+ And there is another teacher
+ And there is a student
+ And the student has a submission
+ And the submission is finalised
+ And there are feedbacks from both teachers
+ And I am logged in as the other teacher
+ When I visit the coursework page
+ Then I should see the grade from the teacher in the assessor table
diff --git a/tests/behat/deadline_extension.feature b/tests/behat/deadline_extension.feature
index 7f30c8b0..e35c0a0a 100644
--- a/tests/behat/deadline_extension.feature
+++ b/tests/behat/deadline_extension.feature
@@ -28,7 +28,7 @@ Feature: Deadlines extensions for submissions
Scenario: The teacher can add a deadline extension to an individual submission
Given the coursework deadline has passed
And I log in as a manager
- And I am on the coursework page
+ And I visit the coursework page
When I add a new extension for the student
Then I should be on the coursework page
And I should see the extended deadline in the student row
@@ -37,7 +37,7 @@ Feature: Deadlines extensions for submissions
Given the coursework deadline has passed
And there is an extension for the student which has expired
And I log in as a manager
- And I am on the coursework page
+ And I visit the coursework page
When I edit the extension for the student
Then I should be on the coursework page
And I should see the extended deadline in the student row
diff --git a/tests/behat/deadline_extension_reason_dropdown_list.feature b/tests/behat/deadline_extension_reason_dropdown_list.feature
index 50db3908..84987d2f 100644
--- a/tests/behat/deadline_extension_reason_dropdown_list.feature
+++ b/tests/behat/deadline_extension_reason_dropdown_list.feature
@@ -15,7 +15,7 @@ Feature: Deadline extension reasons dropdown list
Given the coursework deadline has passed
And there are some extension reasons configured at site level
And I log in as a manager
- And I am on the coursework page
+ And I visit the coursework page
When I add a new extension for the student
Then I should be on the coursework page
When I click on the edit extension icon for the student
@@ -27,11 +27,10 @@ Feature: Deadline extension reasons dropdown list
And there are some extension reasons configured at site level
And there is an extension for the student which has expired
And I log in as a manager
- And I am on the coursework page
+ And I visit the coursework page
When I edit the extension for the student
Then I should be on the coursework page
And I should see the new extended deadline in the student row
When I click on the edit extension icon for the student
Then I should see the new deadline reason in the dropdown
And I should see the new extra deadline information in the deadline extension form
-
diff --git a/tests/behat/enrolment_triggers.feature b/tests/behat/enrolment_triggers.feature
index 1a61d77d..3799958b 100644
--- a/tests/behat/enrolment_triggers.feature
+++ b/tests/behat/enrolment_triggers.feature
@@ -5,31 +5,30 @@ Feature: the students should be auto allocated on enrolment
I want the students to be reallocated when they or their assessors are added or removed from the course
So that they always have a configured allocation for an appropriate assessor
- Background:
- Given there is a course
- And there is a coursework
- And there is a teacher
- And the coursework "allocationenabled" setting is "1" in the database
- And there are no allocations in the db
-
- Scenario: new students should be allocated when they join
+ Background:
+ Given there is a course
+ And there is a coursework
+ And there is a teacher
+ And the coursework "allocationenabled" setting is "1" in the database
+ And there are no allocations in the db
+
+ Scenario: new students should be allocated when they join
pending
- Scenario: exisitng manual allocations should not be reallocated when a tutor joins
+ Scenario: exisitng manual allocations should not be reallocated when a tutor joins
pending
- Scenario: existing auto allocations should not be reallocated when a tutor joins
+ Scenario: existing auto allocations should not be reallocated when a tutor joins
pending
- Scenario: exisitng graded allocations should not be reallocated when a tutor joins
+ Scenario: exisitng graded allocations should not be reallocated when a tutor joins
pending
- Scenario: exisitng manual allocations should not be reallocated when a tutor leaves
+ Scenario: exisitng manual allocations should not be reallocated when a tutor leaves
pending
- Scenario: existing auto allocations should not be reallocated when a tutor leaves
+ Scenario: existing auto allocations should not be reallocated when a tutor leaves
pending
- Scenario: exisitng graded allocations should not be reallocated when a tutor leaves
+ Scenario: exisitng graded allocations should not be reallocated when a tutor leaves
pending
-
diff --git a/tests/behat/factory.feature b/tests/behat/factory.feature
index 8c8f9356..cb5b314e 100644
--- a/tests/behat/factory.feature
+++ b/tests/behat/factory.feature
@@ -5,83 +5,80 @@ Feature: Testing that the factories for behat steps work. If any tests fail, fix
I want to be able to use a factory to generate the scenario context
So that my tests are easier to write and run faster
- @javascript
- Scenario: Making a coursework
- Given there is a course
- And I am logged in as a teacher
- And there is a coursework
- When I visit the coursework page
- Then I should see the title of the coursework on the page
+ @javascript
+ Scenario: Making a coursework
+ Given there is a course
+ And I am logged in as a teacher
+ And there is a coursework
+ When I visit the coursework page
+ Then I should see the title of the coursework on the page
- Scenario: the submission factory works properly and shows the file on the page
- Given there is a course
- And there is a coursework
- And I am logged in as a student
- And I have a submission
- When I visit the coursework page
- Then I should see the file on the page
+ Scenario: the submission factory works properly and shows the file on the page
+ Given there is a course
+ And there is a coursework
+ And I am logged in as a student
+ And I have a submission
+ When I visit the coursework page
+ Then I should see the file on the page
- @javascript
- Scenario: the submission factory works properly and shows the file in the upload area
- Given there is a course
- And there is a coursework
- And I am logged in as a student
- And I have a submission
- When I visit the coursework page
- And I click on the edit submission button
- Then I should see "1" elements in "Upload a file" filemanager
+ @javascript
+ Scenario: the submission factory works properly and shows the file in the upload area
+ Given there is a course
+ And there is a coursework
+ And I am logged in as a student
+ And I have a submission
+ When I visit the coursework page
+ And I click on the edit submission button
+ Then I should see "1" elements in "Upload a file" filemanager
- Scenario: Making a coursework sets the defaults correctly
- Given there is a course
- And I am logged in as an editing teacher
- When I visit the course page
- And I turn editing mode on
- When I add a "Coursework" to section "3" and I fill the form with:
+ Scenario: Making a coursework sets the defaults correctly
+ Given there is a course
+ And I am logged in as an editing teacher
+ When I visit the course page
+ And I turn editing mode on
+ When I add a "coursework" activity to course "C1" section "3" and I fill the form with:
| name | Test coursework |
| Description | Test coursework description |
- Then the coursework general feedback should be disabled
+ Then the coursework general feedback should be disabled
- Scenario: The coursework settings can be changed
- Given there is a course
- And I am logged in as an editing teacher
- And there is a coursework
- And the coursework "blindmarking" setting is "1" in the database
- When I visit the coursework settings page
- Then the field "blindmarking" matches value "1"
+ Scenario: The coursework settings can be changed
+ Given there is a course
+ And I am logged in as an editing teacher
+ And there is a coursework
+ And the coursework "blindmarking" setting is "1" in the database
+ When I visit the coursework settings page
+ Then the field "blindmarking" matches value "1"
- Scenario: disabling general feedback alters the db setting (checkboxes bug is fixed - 0 was being interpreted as 1)
- Given there is a course
- And I am logged in as an editing teacher
- When I visit the course page
- And I turn editing mode on
- When I add a "Coursework" to section "3" and I fill the form with:
+ Scenario: disabling general feedback alters the db setting (checkboxes bug is fixed - 0 was being interpreted as 1)
+ Given there is a course
+ And I am logged in as an editing teacher
+ When I visit the course page
+ And I turn editing mode on
+ When I add a "coursework" activity to course "C1" section "3" and I fill the form with:
| name | Test coursework |
| Description | Test coursework description |
| blindmarking | 0 |
- Then the coursework "blindmarking" setting should be "0" in the database
+ Then the coursework "blindmarking" setting should be "0" in the database
- Scenario: logged in as a teacher works
- Given there is a course
- And I am logged in as a teacher
- When I visit the course page
- Then I should be on the course page
-
- Scenario: logged in as a manager works
- Given there is a course
- And I am logged in as a manager
- When I visit the course page
- Then I should be on the course page
-
- Scenario: logged in as a manager works when a student has been created
- Given there is a course
- And there is a student
- Then I am logged in as a manager
-
- Scenario: Making a setting NULL
- Given there is a course
- And there is a coursework
- And the coursework "individualfeedback" setting is "NULL" in the database
- Then the coursework "blindmarking" setting should be "0" in the database
+ Scenario: logged in as a teacher works
+ Given there is a course
+ And I am logged in as a teacher
+ When I visit the course page
+ Then I should be on the course page
+ Scenario: logged in as a manager works
+ Given there is a course
+ And I am logged in as a manager
+ When I visit the course page
+ Then I should be on the course page
+ Scenario: logged in as a manager works when a student has been created
+ Given there is a course
+ And there is a student
+ Then I am logged in as a manager
+ Scenario: Making a setting NULL
+ Given there is a course
+ And there is a coursework
+ And the coursework "individualfeedback" setting is "NULL" in the database
+ Then the coursework "blindmarking" setting should be "0" in the database
diff --git a/tests/behat/feedback_auto_release_without_cron.feature b/tests/behat/feedback_auto_release_without_cron.feature
index 5c7bc465..73791ba9 100644
--- a/tests/behat/feedback_auto_release_without_cron.feature
+++ b/tests/behat/feedback_auto_release_without_cron.feature
@@ -1,3 +1,4 @@
+@mod @mod_coursework
Feature: Auto releasing the student feedback without cron
As a student
@@ -5,23 +6,23 @@ Feature: Auto releasing the student feedback without cron
for automatic release passes
So that I get the feedback I need and don't think the system is broken
- Background:
- Given there is a course
- And there is a coursework
- And the coursework is set to single marker
- And there is a student
- And the student has a submission
- And there is a teacher
- And there is feedback for the submission from the teacher
+ Background:
+ Given there is a course
+ And there is a coursework
+ And the coursework is set to single marker
+ And there is a student
+ And the student has a submission
+ And there is a teacher
+ And there is feedback for the submission from the teacher
- Scenario: auto release happens after the deadline without the cron running
- Given the coursework individual feedback release date has passed
- When I log in as a student
- And I visit the coursework page
- Then I should see "Released to students"
+ Scenario: auto release happens after the deadline without the cron running
+ Given the coursework individual feedback release date has passed
+ When I log in as a student
+ And I visit the coursework page
+ Then I should see "Released to students"
- Scenario: auto release does not happen before the deadline without the cron running
- Given the coursework individual feedback release date has not passed
- When I log in as a student
- And I visit the coursework page
- Then I should not see "Released to students"
\ No newline at end of file
+ Scenario: auto release does not happen before the deadline without the cron running
+ Given the coursework individual feedback release date has not passed
+ When I log in as a student
+ And I visit the coursework page
+ Then I should not see "Released to students"
diff --git a/tests/behat/feedback_collisions.feature b/tests/behat/feedback_collisions.feature
index 5911ab87..83130de6 100644
--- a/tests/behat/feedback_collisions.feature
+++ b/tests/behat/feedback_collisions.feature
@@ -1,3 +1,4 @@
+@mod @mod_coursework @mod_coursework_feedback_collisions @javascript
Feature: Collisions: two people try to create feedback at the same time
As a teacher
@@ -5,47 +6,46 @@ Feature: Collisions: two people try to create feedback at the same time
teacher has already done so
So that I do not get a surprise when the grades I have awarded disappear
- Background:
- Given there is a course
- And there is a coursework
- And there is a student
- And the student has a submission
- And the submission is finalised
+ Background:
+ Given there is a course
+ And there is a coursework
+ And there is a student
+ And the student has a submission
+ And the submission is finalised
- Scenario: Single marker: If I submit feedback and it's already been given then the form should reload with a warning
- Given there is a teacher
- And there is another teacher
- And I am logged in as the other teacher
- And the coursework is set to single marker
- When I visit the coursework page
- And I click the new single final feedback button for the student
- And I have an assessor feedback
- When I grade the submission using the simple form
- Then I should be on the create feedback page
- And I should see "has already submitted"
- Then I should see the grade comment in the form on the page
- And I should see the grade in the form on the page
+ Scenario: Single marker: If I submit feedback and it's already been given then the form should reload with a warning
+ Given there is a teacher
+ And there is another teacher
+ And I am logged in as the other teacher
+ And the coursework is set to single marker
+ When I visit the coursework page
+ And I click the new single final feedback button for the student
+ And I have an assessor feedback
+ When I grade the submission using the simple form
+ Then I should be on the create feedback page
+ And I should see "has already submitted"
+ Then I should see the grade comment in the form on the page
+ And I should see the grade in the form on the page
- Scenario: Multiple marker: If I submit feedback and it's already been given then it should be given a new stage_identifier
- Given there is a teacher
- And there is another teacher
- And I am logged in as the other teacher
- And the coursework is set to double marker
- When I visit the coursework page
- And I click on the new feedback button for assessor 1
- And I have an assessor feedback
- When I grade the submission using the simple form
- Then I should be on the coursework page
-
- Scenario: Multiple marker: If I submit feedback and it's already been given by all teachers then it should fail
- Given there is a teacher
- And there is another teacher
- And I am logged in as a manager
- And the coursework is set to double marker
- When I visit the coursework page
- And I click on the new feedback button for assessor 1
- And I have an assessor feedback
- And there is final feedback from the other teacher
- When I grade the submission using the simple form
- Then I should be on the create feedback page
+ Scenario: Multiple marker: If I submit feedback and it's already been given then it should be given a new stage_identifier
+ Given there is a teacher
+ And there is another teacher
+ And I am logged in as the other teacher
+ And the coursework is set to double marker
+ When I visit the coursework page
+ And I click on the new feedback button for assessor 1
+ And I have an assessor feedback
+ When I grade the submission using the simple form
+ Then I should be on the coursework page
+ Scenario: Multiple marker: If I submit feedback and it's already been given by all teachers then it should fail
+ Given there is a teacher
+ And there is another teacher
+ And I am logged in as a manager
+ And the coursework is set to double marker
+ When I visit the coursework page
+ And I click on the new feedback button for assessor 1
+ And I have an assessor feedback
+ And there is final feedback from the other teacher
+ When I grade the submission using the simple form
+ Then I should be on the create feedback page
diff --git a/tests/behat/feedback_edit_feedback_within_specified_time.feature b/tests/behat/feedback_edit_feedback_within_specified_time.feature
index eba2ce97..a797184a 100644
--- a/tests/behat/feedback_edit_feedback_within_specified_time.feature
+++ b/tests/behat/feedback_edit_feedback_within_specified_time.feature
@@ -1,11 +1,11 @@
-
+@mod @mod_coursework
Feature: Allow markers to edit their marking but only during specific marking stages
As an initial marker
I want to be able to edit my initial marking if I have made a mistake.
So that if the marking stage is at final agreed grading there is a time window for initial marks edition to happen
- Background:
+ Background:
Given there is a course
And there is a coursework
And the coursework "allocationenabled" setting is "1" in the database
@@ -17,23 +17,19 @@ Feature: Allow markers to edit their marking but only during specific marking st
And the student has a submission
And the submission is finalised
-
-
Scenario: Edit own initial feedback before delayed time
Given there are feedbacks from both teachers
And I log in as the teacher
And I visit the coursework page
Then I should see the edit feedback button for the teacher's feedback
-
- @javascript
+ @javascript
Scenario: Edit own initial feedback after delayed time
Given there are feedbacks from both teachers
And I wait "35" seconds
And I log in as the teacher
And I visit the coursework page
- Then I should not see the edit feedback button for the teacher's feedback
-
+ Then I should not see the edit feedback button for the teacher's feedback
Scenario: Automatic agreement before delayed time
Given the coursework "automaticagreementstrategy" setting is "percentage_distance" in the database
@@ -50,7 +46,6 @@ Feature: Allow markers to edit their marking but only during specific marking st
And I visit the coursework page
Then I should not see the final grade on the multiple marker page
-
@javascript
Scenario: Automatic agreement after delayed time
Given the coursework "automaticagreementstrategy" setting is "percentage_distance" in the database
@@ -64,6 +59,6 @@ Feature: Allow markers to edit their marking but only during specific marking st
And I visit the coursework page
And I click on the new feedback button for assessor 2
And I grade the submission as 63 without comments using the simple form
- And I wait "50" seconds
+ And I wait "50" seconds
And I visit the coursework page
Then I should see the final grade as 67 on the multiple marker page
diff --git a/tests/behat/feedback_files.feature b/tests/behat/feedback_files.feature
index fe2bd721..989c846c 100644
--- a/tests/behat/feedback_files.feature
+++ b/tests/behat/feedback_files.feature
@@ -1,38 +1,37 @@
+@_file_upload
Feature: Adding feedback files
As a teacher
I want to be able to add feedback files
So that I can provide users with rich, detailed feedback
- Background:
- Given there is a course
- And there is a coursework
- And the coursework "numberofmarkers" setting is "1" in the database
- And there is a student
- And the student has a submission
- And the submission is finalised
-
- @javascript
- Scenario: I can upload any file type, regardless of the coursework file types
- Given the coursework "filetypes" setting is "pdf" in the database
- And I am logged in as a teacher
- When I visit the coursework page
- And I click the new single final feedback button for the student
- And I upload "mod/coursework/tests/files_for_uploading/Test_image.png" file to "Upload a file" filemanager
- Then I should see "1" elements in "Upload a file" filemanager
-
- @javascript
- Scenario: Students see all the feedback files
- Given I am logged in as a manager
- When I visit the coursework page
- And I click the new single final feedback button for the student
- And I upload "mod/coursework/tests/files_for_uploading/Test_image.png" file to "Upload a file" filemanager
- When I upload "mod/coursework/tests/files_for_uploading/Test_document_two.docx" file to "Upload a file" filemanager
- And I press "Save changes"
- And I publish the grades
- And I log out
- And I log in as a student
- And I visit the coursework page
- Then I should see two feedback files on the page
+ Background:
+ Given there is a course
+ And there is a coursework
+ And the coursework "numberofmarkers" setting is "1" in the database
+ And there is a student
+ And the student has a submission
+ And the submission is finalised
+ @javascript
+ Scenario: I can upload any file type, regardless of the coursework file types
+ Given the coursework "filetypes" setting is "pdf" in the database
+ And I am logged in as a teacher
+ When I visit the coursework page
+ And I click the new single final feedback button for the student
+ And I upload "mod/coursework/tests/files_for_uploading/Test_image.png" file to "Upload a file" filemanager
+ Then I should see "1" elements in "Upload a file" filemanager
+ @javascript
+ Scenario: Students see all the feedback files
+ Given I am logged in as a manager
+ When I visit the coursework page
+ And I click the new single final feedback button for the student
+ And I upload "mod/coursework/tests/files_for_uploading/Test_image.png" file to "Upload a file" filemanager
+ When I upload "mod/coursework/tests/files_for_uploading/Test_document_two.docx" file to "Upload a file" filemanager
+ And I press "Save changes"
+ And I publish the grades
+ And I log out
+ And I log in as a student
+ And I visit the coursework page
+ Then I should see two feedback files on the page
diff --git a/tests/behat/feedback_final_feedback_double_marking.feature b/tests/behat/feedback_final_feedback_double_marking.feature
index ad807395..e040c80d 100644
--- a/tests/behat/feedback_final_feedback_double_marking.feature
+++ b/tests/behat/feedback_final_feedback_double_marking.feature
@@ -5,54 +5,52 @@ Feature: Adding and editing final feedback
As a course leader
I want to be able to edit the final grade via a form
- Background:
- Given there is a course
- And there is a coursework
- And there is a teacher
- And there is another teacher
- And the coursework "numberofmarkers" setting is "2" in the database
- And there is a student
- And the student has a submission
- And the submission is finalised
-
- Scenario: Setting the final feedback grade
- Given there are feedbacks from both teachers
- And I am logged in as a manager
- And I visit the coursework page
- When I click the new multiple final feedback button for the student
- When I grade the submission using the simple form
- Then I should be on the coursework page
- And I should see the final grade on the multiple marker page
-
- Scenario: Setting the final feedback comment
- Given there are feedbacks from both teachers
- And I am logged in as a manager
- And I visit the coursework page
- When I click the new multiple final feedback button for the student
- When I grade the submission using the simple form
- Then I should be on the coursework page
- When I click the edit final feedback button
- Then I should see the grade comment in the form on the page
- And I should see the grade in the form on the page
-
- Scenario: I can be both an initial assessor and the manager who agrees grades
- And managers do not have the manage capability
- Given I am logged in as a manager
- And there are feedbacks from both me and another teacher
- And I visit the coursework page
- When I click the new multiple final feedback button for the student
- And I grade the submission using the simple form
- Then I should be on the coursework page
-
- Scenario: Editing final feedback from others
- And managers do not have the manage capability
- Given I am logged in as a manager
- And there are feedbacks from both me and another teacher
- And there is final feedback from the other teacher
- When I visit the coursework page
- When I click the edit final feedback button
- And I should see the other teacher's final grade in the form on the page
- And I grade the submission using the simple form
- Then I should be on the coursework page
-
-
+ Background:
+ Given there is a course
+ And there is a coursework
+ And there is a teacher
+ And there is another teacher
+ And the coursework "numberofmarkers" setting is "2" in the database
+ And there is a student
+ And the student has a submission
+ And the submission is finalised
+
+ Scenario: Setting the final feedback grade
+ Given there are feedbacks from both teachers
+ And I am logged in as a manager
+ And I visit the coursework page
+ When I click the new multiple final feedback button for the student
+ When I grade the submission using the simple form
+ Then I should be on the coursework page
+ And I should see the final grade on the multiple marker page
+
+ Scenario: Setting the final feedback comment
+ Given there are feedbacks from both teachers
+ And I am logged in as a manager
+ And I visit the coursework page
+ When I click the new multiple final feedback button for the student
+ When I grade the submission using the simple form
+ Then I should be on the coursework page
+ When I click the edit final feedback button
+ Then I should see the grade comment in the form on the page
+ And I should see the grade in the form on the page
+
+ Scenario: I can be both an initial assessor and the manager who agrees grades
+ And managers do not have the manage capability
+ Given I am logged in as a manager
+ And there are feedbacks from both me and another teacher
+ And I visit the coursework page
+ When I click the new multiple final feedback button for the student
+ And I grade the submission using the simple form
+ Then I should be on the coursework page
+
+ Scenario: Editing final feedback from others
+ And managers do not have the manage capability
+ Given I am logged in as a manager
+ And there are feedbacks from both me and another teacher
+ And there is final feedback from the other teacher
+ When I visit the coursework page
+ When I click the edit final feedback button
+ And I should see the other teacher's final grade in the form on the page
+ And I grade the submission using the simple form
+ Then I should be on the coursework page
diff --git a/tests/behat/feedback_general_feedback.feature b/tests/behat/feedback_general_feedback.feature
index 52923edb..fbe6567e 100644
--- a/tests/behat/feedback_general_feedback.feature
+++ b/tests/behat/feedback_general_feedback.feature
@@ -5,59 +5,56 @@ Feature: general feedback
I want to be able to provide some general feedback for all of the students before their individual feedback is released
So that they can prepare effectively for upcoming exams or assignments
- Scenario: enabling general feedback shows the place for managers to enter feedback
- Given there is a course
- And there is a coursework
- And the coursework general feedback is enabled
- And I am logged in as an manager
- When I visit the coursework page
- Then I should see "Add general feedback"
-
- Scenario: disabling general feedback does not hide the place for managers to enter feedback
- Given there is a course
- And there is a coursework
- And the coursework general feedback is disabled
- And I am logged in as an manager
- When I visit the coursework page
- Then I should see "Add general feedback"
-
- Scenario: enabling general feedback shows students the feedback deadline
- Given there is a course
- And there is a coursework
- And the coursework general feedback is enabled
- And I am logged in as a student
- And I have a submission
- When I visit the coursework page
- And I should see "General feedback deadline"
-
- Scenario: enabling general feedback shows students the feedback when the deadline has passed
- Given there is a course
- And there is a coursework
- And the coursework general feedback is enabled
- And there is some general feedback
- And the general feedback deadline has passed
- And I am logged in as a student
- And I have a submission
- When I visit the coursework page
- Then I should see "General feedback"
-
- Scenario: disabling general feedback hides the feedback from students
- Given there is a course
- And there is a coursework
- And the coursework general feedback is disabled
- And I am logged in as a student
- When I visit the coursework page
- Then I should not see "General feedback:"
- And I should not see "General feedback deadline"
-
- Scenario: Users without permission cannot add or edit general feedback
- Given there is a course
- And there is a coursework
- And the coursework general feedback is enabled
- And I am logged in as an editing teacher
- When I visit the coursework page
- Then I should not see "Edit general feedback"
- And I should not see "Add general feedback"
-
-
-
+ Scenario: enabling general feedback shows the place for managers to enter feedback
+ Given there is a course
+ And there is a coursework
+ And the coursework general feedback is enabled
+ And I am logged in as an manager
+ When I visit the coursework page
+ Then I should see "Add general feedback"
+
+ Scenario: disabling general feedback does not hide the place for managers to enter feedback
+ Given there is a course
+ And there is a coursework
+ And the coursework general feedback is disabled
+ And I am logged in as an manager
+ When I visit the coursework page
+ Then I should see "Add general feedback"
+
+ Scenario: enabling general feedback shows students the feedback deadline
+ Given there is a course
+ And there is a coursework
+ And the coursework general feedback is enabled
+ And I am logged in as a student
+ And I have a submission
+ When I visit the coursework page
+ And I should see "General feedback deadline"
+
+ Scenario: enabling general feedback shows students the feedback when the deadline has passed
+ Given there is a course
+ And there is a coursework
+ And the coursework general feedback is enabled
+ And there is some general feedback
+ And the general feedback deadline has passed
+ And I am logged in as a student
+ And I have a submission
+ When I visit the coursework page
+ Then I should see "General feedback"
+
+ Scenario: disabling general feedback hides the feedback from students
+ Given there is a course
+ And there is a coursework
+ And the coursework general feedback is disabled
+ And I am logged in as a student
+ When I visit the coursework page
+ Then I should not see "General feedback:"
+ And I should not see "General feedback deadline"
+
+ Scenario: Users without permission cannot add or edit general feedback
+ Given there is a course
+ And there is a coursework
+ And the coursework general feedback is enabled
+ And I am logged in as an editing teacher
+ When I visit the coursework page
+ Then I should not see "Edit general feedback"
+ And I should not see "Add general feedback"
diff --git a/tests/behat/feedback_group_feedback_for_students.feature b/tests/behat/feedback_group_feedback_for_students.feature
index 857585e4..30a3fa2a 100644
--- a/tests/behat/feedback_group_feedback_for_students.feature
+++ b/tests/behat/feedback_group_feedback_for_students.feature
@@ -5,42 +5,42 @@ Feature: Students see feedback on group assignments
I want to be able to see the feedaback for the group assignment even if I did not submit it
So that I know what my marks are and can improve my work
- Background:
- Given there is a course
- And there is a coursework
- And the coursework "use_groups" setting is "1" in the database
- And the coursework is set to double marker
- And there is a manager
- And there is a student
- And the student is a member of a group
- And there is another student
- And the other student is a member of the group
- And the group has a submission
- And the submission is finalised
- And there is final feedback
- And the grades have been published
+ Background:
+ Given there is a course
+ And there is a coursework
+ And the coursework "use_groups" setting is "1" in the database
+ And the coursework is set to double marker
+ And there is a manager
+ And there is a student
+ And the student is a member of a group
+ And there is another student
+ And the other student is a member of the group
+ And the group has a submission
+ And the submission is finalised
+ And there is final feedback
+ And the grades have been published
- Scenario: I can see the published grade when someone else submitted
- Given I am logged in as the other student
- When I visit the coursework page
- Then I should see the grade for the group submission
- And I should see the feedback for the group submission
+ Scenario: I can see the published grade when someone else submitted
+ Given I am logged in as the other student
+ When I visit the coursework page
+ Then I should see the grade for the group submission
+ And I should see the feedback for the group submission
- Scenario: I can see the published grade when I submitted
- Given I am logged in as the student
- When I visit the coursework page
- Then I should see the grade for the group submission
- And I should see the feedback for the group submission
+ Scenario: I can see the published grade when I submitted
+ Given I am logged in as the student
+ When I visit the coursework page
+ Then I should see the grade for the group submission
+ And I should see the feedback for the group submission
- @broken
- Scenario: I can see the published grade in the gradebook when someone else submitted
- Given I am logged in as the other student
- And I visit the coursework page
- When I visit the gradebook page
- Then I should see the grade in the gradebook
+ @broken
+ Scenario: I can see the published grade in the gradebook when someone else submitted
+ Given I am logged in as the other student
+ And I visit the coursework page
+ When I visit the gradebook page
+ Then I should see the grade in the gradebook
- @broken
- Scenario: I can see the published grade in the gradebook when I submitted
- Given I am logged in as the student
- When I visit the gradebook page
- Then I should see the grade in the gradebook
+ @broken
+ Scenario: I can see the published grade in the gradebook when I submitted
+ Given I am logged in as the student
+ When I visit the gradebook page
+ Then I should see the grade in the gradebook
diff --git a/tests/behat/feedback_group_marking.feature b/tests/behat/feedback_group_marking.feature
index d788c225..90c6d074 100644
--- a/tests/behat/feedback_group_marking.feature
+++ b/tests/behat/feedback_group_marking.feature
@@ -6,26 +6,26 @@ Feature: Marking the group submissions applies the grades to the whole group
So that the marks are awarded to all of the group members and they can
see their feedback and grades
- Background:
- Given there is a course
- And there is a coursework
- And there is a teacher
- And there is another teacher
- And the coursework "numberofmarkers" setting is "2" in the database
- And the coursework "use_groups" setting is "1" in the database
- And there is a student
- And the student is a member of a group
- And there is another student
- And the other student is a member of the group
- And the group has a submission
- And the submission is finalised
- And there are feedbacks from both teachers
- And I am logged in as a manager
+ Background:
+ Given there is a course
+ And there is a coursework
+ And there is a teacher
+ And there is another teacher
+ And the coursework "numberofmarkers" setting is "2" in the database
+ And the coursework "use_groups" setting is "1" in the database
+ And there is a student
+ And the student is a member of a group
+ And there is another student
+ And the other student is a member of the group
+ And the group has a submission
+ And the submission is finalised
+ And there are feedbacks from both teachers
+ And I am logged in as a manager
- Scenario: grading the submission makes the grades show up for both students in the interface
- Given I am on the coursework page
- When I click the new final feedback button for the group
- And show me the page
- And I grade the submission using the simple form
- Then I should be on the coursework page
- And I should see the final grade for the group in the grading interface
+ Scenario: grading the submission makes the grades show up for both students in the interface
+ Given I visit the coursework page
+ When I click the new final feedback button for the group
+ And show me the page
+ And I grade the submission using the simple form
+ Then I should be on the coursework page
+ And I should see the final grade for the group in the grading interface
diff --git a/tests/behat/feedback_multiple_assessor_feedback.feature b/tests/behat/feedback_multiple_assessor_feedback.feature
index 017c779c..165c0110 100644
--- a/tests/behat/feedback_multiple_assessor_feedback.feature
+++ b/tests/behat/feedback_multiple_assessor_feedback.feature
@@ -5,95 +5,92 @@ Feature: Multiple assessors simple grading form
I want there to be a simple grading form
So that I can give students a grade and a feedback comment without any frustrating extra work
- Background:
- Given there is a course
- And the following "permission overrides" exist:
+ Background:
+ Given there is a course
+ And the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| mod/coursework:editinitialgrade | Allow | teacher | Course | C1 |
- And there is a coursework
- And the coursework "numberofmarkers" setting is "2" in the database
- And the coursework "allocationenabled" setting is "0" in the database
- And there is a student
- And the student has a submission
+ And there is a coursework
+ And the coursework "numberofmarkers" setting is "2" in the database
+ And the coursework "allocationenabled" setting is "0" in the database
+ And there is a student
+ And the student has a submission
- Scenario: Grades can be saved
- Given I am logged in as a teacher
- And the submission is finalised
- And I visit the coursework page
- And I click on the new feedback button for assessor 1
- When I grade the submission using the simple form
- Then I should see the grade on the page
+ Scenario: Grades can be saved
+ Given I am logged in as a teacher
+ And the submission is finalised
+ And I visit the coursework page
+ And I click on the new feedback button for assessor 1
+ When I grade the submission using the simple form
+ Then I should see the grade on the page
- Scenario: Grade comments can be saved
- Given I am logged in as a teacher
- And the submission is finalised
- And I visit the coursework page
- And I click on the new feedback button for assessor 1
- When I grade the submission using the simple form
- And I visit the edit feedback page
- Then I should see the grade comment in the form on the page
+ Scenario: Grade comments can be saved
+ Given I am logged in as a teacher
+ And the submission is finalised
+ And I visit the coursework page
+ And I click on the new feedback button for assessor 1
+ When I grade the submission using the simple form
+ And I visit the edit feedback page
+ Then I should see the grade comment in the form on the page
- @javascript
- Scenario: Grade files can be saved
- Given I am logged in as a teacher
- And the submission is finalised
- And I visit the coursework page
- And I click on the new feedback button for assessor 1
- When I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
- And I press "Save and finalise"
- And I click on the edit feedback icon
- Then I should be on the edit feedback page
- Then I should see "1" elements in "Upload a file" filemanager
+ @javascript
+ Scenario: Grade files can be saved
+ Given I am logged in as a teacher
+ And the submission is finalised
+ And I visit the coursework page
+ And I click on the new feedback button for assessor 1
+ When I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
+ And I press "Save and finalise"
+ And I click on the edit feedback icon
+ Then I should be on the edit feedback page
+ Then I should see "1" elements in "Upload a file" filemanager
- Scenario: Grade comments can be edited
- Given I am logged in as a teacher
- And the submission is finalised
- And I have an assessor feedback
- And I visit the coursework page
- And I click on the edit feedback icon
- Then I should see the grade comment in the form on the page
+ Scenario: Grade comments can be edited
+ Given I am logged in as a teacher
+ And the submission is finalised
+ And I have an assessor feedback
+ And I visit the coursework page
+ And I click on the edit feedback icon
+ Then I should see the grade comment in the form on the page
- Scenario: Grades can not be edited by other teachers
- Given there is a teacher
- And there is another teacher
- And there is feedback for the submission from the teacher
- And I am logged in as the other teacher
- And the submission is finalised
- When I visit the coursework page
- Then show me the page
- Then I should not see the edit feedback button for the teacher's feedback
+ Scenario: Grades can not be edited by other teachers
+ Given there is a teacher
+ And there is another teacher
+ And there is feedback for the submission from the teacher
+ And I am logged in as the other teacher
+ And the submission is finalised
+ When I visit the coursework page
+ Then show me the page
+ Then I should not see the edit feedback button for the teacher's feedback
- @javascript
- Scenario: Grade files can be edited and more are added
- Given I am logged in as a teacher
- And the submission is finalised
- And I visit the coursework page
- And I click on the new feedback button for assessor 1
- And I wait "1" seconds
- When I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
- And I press "Save and finalise"
- And I click on the edit feedback icon
- And I wait "2" seconds
- And I upload "mod/coursework/tests/files_for_uploading/Test_document_two.docx" file to "Upload a file" filemanager
- Then I should see "2" elements in "Upload a file" filemanager
-
- When I press "Save and finalise"
- And I click on the edit feedback icon
- And I wait "1" seconds
- Then I should see "2" elements in "Upload a file" filemanager
-
- Scenario: I should not see the feedback icon when the submisison has not been finalised
- Given I am logged in as a teacher
- And I visit the coursework page
- Then I should not see a link to add feedback
-
- Scenario: managers can grade the initial stages
- Given I am logged in as a manager
- And the submission is finalised
- And I visit the coursework page
- And I click on the new feedback button for assessor 1
- When I grade the submission using the simple form
- Then I should see the grade on the page
+ @javascript @_file_upload
+ Scenario: Grade files can be edited and more are added
+ Given I am logged in as a teacher
+ And the submission is finalised
+ And I visit the coursework page
+ And I click on the new feedback button for assessor 1
+ And I wait "1" seconds
+ When I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
+ And I press "Save and finalise"
+ And I click on the edit feedback icon
+ And I wait "2" seconds
+ And I upload "mod/coursework/tests/files_for_uploading/Test_document_two.docx" file to "Upload a file" filemanager
+ Then I should see "2" elements in "Upload a file" filemanager
+ When I press "Save and finalise"
+ And I click on the edit feedback icon
+ And I wait "1" seconds
+ Then I should see "2" elements in "Upload a file" filemanager
+ Scenario: I should not see the feedback icon when the submisison has not been finalised
+ Given I am logged in as a teacher
+ And I visit the coursework page
+ Then I should not see a link to add feedback
+ Scenario: managers can grade the initial stages
+ Given I am logged in as a manager
+ And the submission is finalised
+ And I visit the coursework page
+ And I click on the new feedback button for assessor 1
+ When I grade the submission using the simple form
+ Then I should see the grade on the page
diff --git a/tests/behat/feedback_publishing_grades.feature b/tests/behat/feedback_publishing_grades.feature
index 432b8703..cb5e17a7 100644
--- a/tests/behat/feedback_publishing_grades.feature
+++ b/tests/behat/feedback_publishing_grades.feature
@@ -5,44 +5,44 @@ Feature: publishing grades to the students
As a manager
I want to be able to publish the grades when I am ready to
- Background:
- Given there is a course
- And there is a coursework
- And the coursework "numberofmarkers" setting is "1" in the database
- And the coursework "blindmarking" setting is "0" in the database
- And the coursework "moderationenabled" setting is "0" in the database
- And there is a student
- And the student has a submission
- And the submission is finalised
+ Background:
+ Given there is a course
+ And there is a coursework
+ And the coursework "numberofmarkers" setting is "1" in the database
+ And the coursework "blindmarking" setting is "0" in the database
+ And the coursework "moderationenabled" setting is "0" in the database
+ And there is a student
+ And the student has a submission
+ And the submission is finalised
- Scenario: Not publishing with double marking hides feedback from the student
- Given there is a teacher
- And there is another teacher
- And the coursework "numberofmarkers" setting is "2" in the database
- And there are feedbacks from both teachers
- And I am logged in as a manager
- When I visit the coursework page
- And I click the new multiple final feedback button for the student
- And I grade the submission using the simple form
- And I log out
- And I log in as the student
- And I visit the coursework page
- Then I should not see the final grade on the student page
- And I should not see the grade comment on the student page
+ Scenario: Not publishing with double marking hides feedback from the student
+ Given there is a teacher
+ And there is another teacher
+ And the coursework "numberofmarkers" setting is "2" in the database
+ And there are feedbacks from both teachers
+ And I am logged in as a manager
+ When I visit the coursework page
+ And I click the new multiple final feedback button for the student
+ And I grade the submission using the simple form
+ And I log out
+ And I log in as the student
+ And I visit the coursework page
+ Then I should not see the final grade on the student page
+ And I should not see the grade comment on the student page
- Scenario: Deliberate publishing with double marking shows feedback to the student
- Given there is a teacher
- And there is another teacher
- And the coursework "numberofmarkers" setting is "2" in the database
- And there are feedbacks from both teachers
- And I am logged in as a manager
+ Scenario: Deliberate publishing with double marking shows feedback to the student
+ Given there is a teacher
+ And there is another teacher
+ And the coursework "numberofmarkers" setting is "2" in the database
+ And there are feedbacks from both teachers
+ And I am logged in as a manager
- When I visit the coursework page
- And I click the new multiple final feedback button for the student
- And I grade the submission using the simple form
- And I press the publish button
- And I log out
- And I log in as the student
- And I visit the coursework page
- Then I should see the final grade on the student page
- And I should see the grade comment on the student page
\ No newline at end of file
+ When I visit the coursework page
+ And I click the new multiple final feedback button for the student
+ And I grade the submission using the simple form
+ And I press the publish button
+ And I log out
+ And I log in as the student
+ And I visit the coursework page
+ Then I should see the final grade on the student page
+ And I should see the grade comment on the student page
diff --git a/tests/behat/feedback_restrict_feedback_editing.feature b/tests/behat/feedback_restrict_feedback_editing.feature
deleted file mode 100644
index 9187cc93..00000000
--- a/tests/behat/feedback_restrict_feedback_editing.feature
+++ /dev/null
@@ -1,7 +0,0 @@
-Feature: Resticting the editing of feedback by the assessors who added it
-
- As a course leader
- I want to be sure that assessor cannot modify their feedback after they have left it
- So that I can be sure that the grades are fair and no later changes happened due to
- later finding out about other people's grades
-
diff --git a/tests/behat/feedback_rubrics.feature b/tests/behat/feedback_rubrics.feature
index 30fcac22..8ed8381d 100644
--- a/tests/behat/feedback_rubrics.feature
+++ b/tests/behat/feedback_rubrics.feature
@@ -6,48 +6,47 @@ Feature: Adding feedback using the built in Moodle rubrics
in a standardised way
So that I can grade the work faster, give more consistent responses and make the process more fair
- Background:
- Given there is a course
- And there is a coursework
- And the coursework "numberofmarkers" setting is "1" in the database
- And there is a student
- And the student has a submission
- And the submission is finalised
- And I am logged in as a teacher
+ Background:
+ Given there is a course
+ And there is a coursework
+ And the coursework "numberofmarkers" setting is "1" in the database
+ And there is a student
+ And the student has a submission
+ And the submission is finalised
+ And I am logged in as a teacher
- Scenario: I should be able to add feedback using a simple rubric
- Given there is a rubric defined for the coursework
- Given I visit the coursework page
- When I click the new single final feedback button for the student
- And I grade by filling the rubric with:
+ Scenario: I should be able to add feedback using a simple rubric
+ Given there is a rubric defined for the coursework
+ Given I visit the coursework page
+ When I click the new single final feedback button for the student
+ And I grade by filling the rubric with:
| first criterion | 1 | Very good |
- And I fill in the rest of the form after the rubric and submit it
- And I log out
- And I log in as a manager
- And I visit the coursework page
- And I publish the grades
- And I log out
- And I log in as a student
- And I visit the coursework page
- Then I should see the rubric grade on the page
- And I should see the grade comment on the student page
+ And I fill in the rest of the form after the rubric and submit it
+ And I log out
+ And I log in as a manager
+ And I visit the coursework page
+ And I publish the grades
+ And I log out
+ And I log in as a student
+ And I visit the coursework page
+ Then I should see the rubric grade on the page
+ And I should see the grade comment on the student page
- @broken
- Scenario: I should see the rubric grade show up in the gradebook
- Given there is a rubric defined for the coursework
- Given I visit the coursework page
- When I click the new single final feedback button for the student
- And I grade by filling the rubric with:
+ @broken
+ Scenario: I should see the rubric grade show up in the gradebook
+ Given there is a rubric defined for the coursework
+ Given I visit the coursework page
+ When I click the new single final feedback button for the student
+ And I grade by filling the rubric with:
| first criterion | 1 | Very good |
- And I fill in the rest of the form after the rubric and submit it
- And I log out
- And I log in as a manager
- And I visit the coursework page
- And I publish the grades
- And I log out
- And I log in as a student
- When I visit the gradebook page
- Then I should see the rubric grade in the gradebook
- When I visit the coursework page
- And I should see the grade comment on the student page
-
+ And I fill in the rest of the form after the rubric and submit it
+ And I log out
+ And I log in as a manager
+ And I visit the coursework page
+ And I publish the grades
+ And I log out
+ And I log in as a student
+ When I visit the gradebook page
+ Then I should see the rubric grade in the gradebook
+ When I visit the coursework page
+ And I should see the grade comment on the student page
diff --git a/tests/behat/feedback_single_marking.feature b/tests/behat/feedback_single_marking.feature
index e985c733..60649a43 100644
--- a/tests/behat/feedback_single_marking.feature
+++ b/tests/behat/feedback_single_marking.feature
@@ -5,44 +5,43 @@ Feature: Adding and editing single feedback
As a course leader
I want to be able to edit the final grade via a form
- Background:
- Given there is a course
- And there is a coursework
- And the coursework "numberofmarkers" setting is "1" in the database
- And there is a student
- And there is a teacher
- And the student has a submission
- And the teacher has a capability to edit their own initial feedbacks
- And I log in as the teacher
+ Background:
+ Given there is a course
+ And there is a coursework
+ And the coursework "numberofmarkers" setting is "1" in the database
+ And there is a student
+ And there is a teacher
+ And the student has a submission
+ And the teacher has a capability to edit their own initial feedbacks
+ And I log in as the teacher
- Scenario: Setting the final feedback grade
- Given the submission is finalised
- And the coursework deadline has passed
- And I visit the coursework page
- When I click the new single final feedback button for the student
- When I grade the submission using the simple form
- Then I should be on the coursework page
- And I should see the final grade on the single marker page
+ Scenario: Setting the final feedback grade
+ Given the submission is finalised
+ And the coursework deadline has passed
+ And I visit the coursework page
+ When I click the new single final feedback button for the student
+ When I grade the submission using the simple form
+ Then I should be on the coursework page
+ And I should see the final grade on the single marker page
- Scenario: Setting the final feedback comment
- Given the submission is finalised
- And I visit the coursework page
- When I click the new single final feedback button for the student
- When I grade the submission using the simple form
- Then I should be on the coursework page
- When I click the edit final feedback button
- Then I should see the grade comment in the form on the page
- And I should see the grade in the form on the page
+ Scenario: Setting the final feedback comment
+ Given the submission is finalised
+ And I visit the coursework page
+ When I click the new single final feedback button for the student
+ When I grade the submission using the simple form
+ Then I should be on the coursework page
+ When I click the edit final feedback button
+ Then I should see the grade comment in the form on the page
+ And I should see the grade in the form on the page
- Scenario: I should not see the feedback icon when the submisison has not been finalised
- And I visit the coursework page
- Then I should not see a link to add feedback
-
- Scenario: Editing someone elses grade
- Given the submission is finalised
- And there is feedback for the submission from the teacher
- And I visit the coursework page
- When I click the edit final feedback button
- Then I should see the grade comment as "Blah" in the form on the page
- And I should see the other teacher's grade in the form on the page
+ Scenario: I should not see the feedback icon when the submisison has not been finalised
+ And I visit the coursework page
+ Then I should not see a link to add feedback
+ Scenario: Editing someone elses grade
+ Given the submission is finalised
+ And there is feedback for the submission from the teacher
+ And I visit the coursework page
+ When I click the edit final feedback button
+ Then I should see the grade comment as "Blah" in the form on the page
+ And I should see the other teacher's grade in the form on the page
diff --git a/tests/behat/feedback_zero_grades.feature b/tests/behat/feedback_zero_grades.feature
index 5c66ebfd..f5a0f70c 100644
--- a/tests/behat/feedback_zero_grades.feature
+++ b/tests/behat/feedback_zero_grades.feature
@@ -1,3 +1,4 @@
+@mod @mod_coursework
Feature: Zero grades should show up just like the others
As a teacher
@@ -5,20 +6,19 @@ Feature: Zero grades should show up just like the others
So that in case there is no work submitted or the work is truly and irredeemably useless,
the student will know
- Background:
- Given there is a course
- And there is a coursework
- And there is a student
- And the student has a submission
- And the submission is finalised
-
- Scenario: Single maker final feedback
- Given the coursework "grade" setting is "9" in the database
- Given I am logged in as a teacher
- And the coursework "numberofmarkers" setting is "1" in the database
- When I visit the coursework page
- And I click the new single final feedback button for the student
- And I grade the submission as 0 using the simple form
- Then I should be on the coursework page
- And I should see the final grade as 0 on the single marker page
+ Background:
+ Given there is a course
+ And there is a coursework
+ And there is a student
+ And the student has a submission
+ And the submission is finalised
+ Scenario: Single maker final feedback
+ Given the coursework "grade" setting is "9" in the database
+ Given I am logged in as a teacher
+ And the coursework "numberofmarkers" setting is "1" in the database
+ When I visit the coursework page
+ And I click the new single final feedback button for the student
+ And I grade the submission as 0 using the simple form
+ Then I should be on the coursework page
+ And I should see the final grade as 0 on the single marker page
diff --git a/tests/behat/installation_and_set_up.feature b/tests/behat/installation_and_set_up.feature
index 4ea75f2d..f5341016 100644
--- a/tests/behat/installation_and_set_up.feature
+++ b/tests/behat/installation_and_set_up.feature
@@ -5,27 +5,24 @@ Feature: Installing the coursework module and making sure it works
As an admin
I need to be able to successfully install the module in a course and add an instance
- @javascript
- Scenario: I can add a new instance of the coursework module to a course
- Given there is a course
- And I am logged in as an editing teacher
- And I visit the course page
- And I turn editing mode on
- When I add a "Coursework" to section "3" and I fill the form with:
+ @javascript
+ Scenario: I can add a new instance of the coursework module to a course
+ Given there is a course
+ And I am logged in as an editing teacher
+ And I visit the course page
+ And I turn editing mode on
+ When I add a "coursework" activity to course "C1" section "3" and I fill the form with:
| name | Test coursework |
| Description | Test coursework description |
- Then I should be on the course page
+ Then I should be on the course page
- Scenario: The module can be used with course completion enabled
- Given there is a course
- And I am logged in as an editing teacher
- And the course has completion enabled
- When I visit the course page
- And I turn editing mode on
- When I add a "Coursework" to section "3" and I fill the form with:
+ Scenario: The module can be used with course completion enabled
+ Given there is a course
+ And I am logged in as an editing teacher
+ And the course has completion enabled
+ When I visit the course page
+ And I turn editing mode on
+ When I add a "coursework" activity to course "C1" section "3" and I fill the form with:
| name | Test coursework |
| Description | Test coursework description |
- Then I should be on the course page
-
-
-
+ Then I should be on the course page
diff --git a/tests/behat/sampling_automatic_sampling.feature b/tests/behat/sampling_automatic_sampling.feature
index 44774e15..299fbd89 100644
--- a/tests/behat/sampling_automatic_sampling.feature
+++ b/tests/behat/sampling_automatic_sampling.feature
@@ -1,3 +1,4 @@
+@mod @mod_coursework
Feature: Automatic sampling using total number of students in stage 1 and 2
As a course administrator setting up a coursework instance for a large group of students
@@ -17,19 +18,17 @@ Feature: Automatic sampling using total number of students in stage 1 and 2
Scenario: Automatically allocating a total for stage 2 based on stage 1
Given the coursework "numberofmarkers" setting is "2" in the database
And the coursework "samplingenabled" setting is "1" in the database
- And I am on the allocations page
+ And I visit the allocations page
When I enable automatic sampling for stage 2
And I enable total rule for stage 2
And I select 50% of total students in stage 1
And I save sampling strategy
- Then a student or another student should be automatically included in sample for stage 2
-
-
+ Then a student or another student should be automatically included in sample for stage 2
Scenario: Automatically allocating a total for stage 3 based on stage 2
Given the coursework "numberofmarkers" setting is "3" in the database
And the coursework "samplingenabled" setting is "1" in the database
- And I am on the allocations page
+ And I visit the allocations page
When I enable automatic sampling for stage 2
And I enable total rule for stage 2
And I select 100% of total students in stage 1
@@ -39,24 +38,12 @@ Feature: Automatic sampling using total number of students in stage 1 and 2
And I save sampling strategy
Then a student or another student should be automatically included in sample for stage 3
-
-
Scenario: Automatically allocating a total for stage 3 based on stage 1
Given the coursework "numberofmarkers" setting is "3" in the database
And the coursework "samplingenabled" setting is "1" in the database
- And I am on the allocations page
+ And I visit the allocations page
When I enable automatic sampling for stage 3
And I enable total rule for stage 3
And I select 50% of total students in stage 1
And I save sampling strategy
Then a student or another student should be automatically included in sample for stage 3
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/behat/sampling_manual_sampling.feature b/tests/behat/sampling_manual_sampling.feature
index a84b1955..5a7c3cb2 100644
--- a/tests/behat/sampling_manual_sampling.feature
+++ b/tests/behat/sampling_manual_sampling.feature
@@ -5,49 +5,46 @@ Feature: Manual sampling
I can manually select the submissions to be included in the sample for a single feedback stage
So I can select correct sample of students for double marking
- Background:
- Given there is a course
- And I am logged in as a manager
- And the manager has a capability to allocate students in samplings
- And there is a coursework
- And the coursework allocation option is disabled
- And the coursework has sampling enabled
- And the coursework is set to double marker
- And there is a student
- And there is a teacher
- And the teacher has a capability to mark submissions
- And there is another teacher
- And the student has a submission
- And there is feedback for the submission from the other teacher
- And the submission deadline has passed
- And the submission is finalised
-
-
- Scenario: Manual sampling should include student when selected
- When I visit the allocations page
- And I select a student as a part of the sample for the second stage
- And I save everything
- And I log out
- And I log in as the teacher
- And I visit the coursework page
- Then I should be able to add the second grade for this student
-
-
- Scenario: Manual sampling should not include student when not selected
- When I visit the allocations page
- And I deselect a student as a part of the sample for the second stage
- And I save everything
- And I log out
- And I log in as the teacher
- And I visit the coursework page
- Then I should not be able to add the second grade for this student
-
-
- Scenario: Single grade should go to the gradebook column when only first stage is in sample
- When I visit the allocations page
- And I deselect a student as a part of the sample for the second stage
- And I save everything
- And I log out
- And I log in as the teacher
- And I visit the coursework page
- Then I should see the grade given by the initial teacher in the provisional grade column
+ Background:
+ Given there is a course
+ And I am logged in as a manager
+ And the manager has a capability to allocate students in samplings
+ And there is a coursework
+ And the coursework allocation option is disabled
+ And the coursework has sampling enabled
+ And the coursework is set to double marker
+ And there is a student
+ And there is a teacher
+ And the teacher has a capability to mark submissions
+ And there is another teacher
+ And the student has a submission
+ And there is feedback for the submission from the other teacher
+ And the submission deadline has passed
+ And the submission is finalised
+
+ Scenario: Manual sampling should include student when selected
+ When I visit the allocations page
+ And I select a student as a part of the sample for the second stage
+ And I save everything
+ And I log out
+ And I log in as the teacher
+ And I visit the coursework page
+ Then I should be able to add the second grade for this student
+
+ Scenario: Manual sampling should not include student when not selected
+ When I visit the allocations page
+ And I deselect a student as a part of the sample for the second stage
+ And I save everything
+ And I log out
+ And I log in as the teacher
+ And I visit the coursework page
+ Then I should not be able to add the second grade for this student
+
+ Scenario: Single grade should go to the gradebook column when only first stage is in sample
+ When I visit the allocations page
+ And I deselect a student as a part of the sample for the second stage
+ And I save everything
+ And I log out
+ And I log in as the teacher
+ And I visit the coursework page
+ Then I should see the grade given by the initial teacher in the provisional grade column
diff --git a/tests/behat/sampling_sample_range_set_rules.feature b/tests/behat/sampling_sample_range_set_rules.feature
index 53ba5026..71714f77 100644
--- a/tests/behat/sampling_sample_range_set_rules.feature
+++ b/tests/behat/sampling_sample_range_set_rules.feature
@@ -1,3 +1,4 @@
+@mod @mod_coursework
Feature: Automatic sample based on range set grades using marking of students in stage 1 and 2
As a manager, I want to be able to automatically allocate assessors to students
@@ -26,10 +27,9 @@ Feature: Automatic sample based on range set grades using marking of students in
And I grade the submission as 45 using the simple form
And I log out
-
Scenario: Automatically allocating a set of students within specified grade rule range in stage 2 based on stage 1 grades
Given I am logged in as a manager
- And I am on the allocations page
+ And I visit the allocations page
And I enable automatic sampling for stage 2
And show me the page
And I enable grade range rule 1 for stage 2
@@ -50,11 +50,9 @@ Feature: Automatic sample based on range set grades using marking of students in
#Then a student should be automatically included in sample for stage 2
#And another student should be automatically included in sample for stage 2
-
-
Scenario: Automatically allocating a set of students within specified percentage rule range in stage 3 based on stage 2 grades
Given I am logged in as a manager
- And I am on the allocations page
+ And I visit the allocations page
And I enable automatic sampling for stage 2
And I enable total rule for stage 2
And I select 100% of total students in stage 1
@@ -66,7 +64,7 @@ Feature: Automatic sample based on range set grades using marking of students in
And I grade the submission as 40 using the simple form
And I log out
And I am logged in as a manager
- And I am on the allocations page
+ And I visit the allocations page
When I enable automatic sampling for stage 3
And I enable grade range rule 1 for stage 3
And I select limit type for grade range rule 1 in stage 3 as "percentage"
@@ -75,13 +73,3 @@ Feature: Automatic sample based on range set grades using marking of students in
And I save sampling strategy
Then a student should be automatically included in sample for stage 3
And another student should not be automatically included in sample for stage 3
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/behat/submissions_agree_submission_terms.feature b/tests/behat/submissions_agree_submission_terms.feature
index 35ede8d9..b94f931e 100644
--- a/tests/behat/submissions_agree_submission_terms.feature
+++ b/tests/behat/submissions_agree_submission_terms.feature
@@ -1,96 +1,95 @@
-@mod @mod_coursework
+@mod @mod_coursework @_file_upload
Feature: Students must agree to terms before submitting anything
As a manger
I want to be able to force students to agree to terms and conditions
So that we are legally protected in case of disputes over plagiarism and the students can't cheat
- Background:
- Given there is a course
- And there is a coursework
- And I am logged in as a student
+ Background:
+ Given there is a course
+ And there is a coursework
+ And I am logged in as a student
- Scenario: I see the terms when the site has the option enabled
- Given the sitewide "coursework_agree_terms" setting is "1"
- And the sitewide "coursework_agree_terms_text" setting is "Some text"
- When I visit the coursework page
- And I click on the new submission button
- Then I should be on the new submission page
- And I should see "Some text"
+ Scenario: I see the terms when the site has the option enabled
+ Given the sitewide "coursework_agree_terms" setting is "1"
+ And the sitewide "coursework_agree_terms_text" setting is "Some text"
+ When I visit the coursework page
+ And I click on the new submission button
+ Then I should be on the new submission page
+ And I should see "Some text"
- Scenario: I do not see the terms when the site has the option disabled
- Given the sitewide "coursework_agree_terms" setting is "0"
- And the sitewide "coursework_agree_terms_text" setting is "Some text"
- When I visit the coursework page
- And I click on the new submission button
- Then I should be on the new submission page
- And I should not see "Some text"
+ Scenario: I do not see the terms when the site has the option disabled
+ Given the sitewide "coursework_agree_terms" setting is "0"
+ And the sitewide "coursework_agree_terms_text" setting is "Some text"
+ When I visit the coursework page
+ And I click on the new submission button
+ Then I should be on the new submission page
+ And I should not see "Some text"
- @javascript
- Scenario: The submission is saved when the agree terms checkbox is checked during create
- Given the sitewide "coursework_agree_terms" setting is "1"
- And the sitewide "coursework_agree_terms_text" setting is "Some text"
- When I visit the coursework page
- And I click on the new submission button
- And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
- And I set the field "termsagreed" to "1"
- And I press "Submit"
- Then I should be on the coursework page
+ @javascript
+ Scenario: The submission is saved when the agree terms checkbox is checked during create
+ Given the sitewide "coursework_agree_terms" setting is "1"
+ And the sitewide "coursework_agree_terms_text" setting is "Some text"
+ When I visit the coursework page
+ And I click on the new submission button
+ And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
+ And I set the field "termsagreed" to "1"
+ And I press "Submit"
+ Then I should be on the coursework page
- @javascript
- Scenario: The submission is not saved when the agree terms checkbox is not checked during create
- Given the sitewide "coursework_agree_terms" setting is "1"
- And the sitewide "coursework_agree_terms_text" setting is "Some text"
- When I visit the coursework page
- And I click on the new submission button
- And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
- And I press "Submit"
- Then I should be on the create submission page
+ @javascript
+ Scenario: The submission is not saved when the agree terms checkbox is not checked during create
+ Given the sitewide "coursework_agree_terms" setting is "1"
+ And the sitewide "coursework_agree_terms_text" setting is "Some text"
+ When I visit the coursework page
+ And I click on the new submission button
+ And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
+ And I press "Submit"
+ Then I should be on the create submission page
- @javascript
- Scenario: The submission is saved when the agree terms checkbox is checked during update
- Given the sitewide "coursework_agree_terms" setting is "1"
- And the sitewide "coursework_agree_terms_text" setting is "Some text"
- And the student has a submission
- When I visit the coursework page
- And I click on the edit submission button
- And I set the field "termsagreed" to "1"
- And I press "Submit"
- Then I should be on the coursework page
+ @javascript
+ Scenario: The submission is saved when the agree terms checkbox is checked during update
+ Given the sitewide "coursework_agree_terms" setting is "1"
+ And the sitewide "coursework_agree_terms_text" setting is "Some text"
+ And the student has a submission
+ When I visit the coursework page
+ And I click on the edit submission button
+ And I set the field "termsagreed" to "1"
+ And I press "Submit"
+ Then I should be on the coursework page
- @javascript
- Scenario: The submission is not saved when the agree terms checkbox is not checked during update
- Given the sitewide "coursework_agree_terms" setting is "1"
- And the sitewide "coursework_agree_terms_text" setting is "Some text"
- And the student has a submission
- When I visit the coursework page
- And I click on the edit submission button
- And I press "Submit"
- Then I should be on the update submission page
+ @javascript
+ Scenario: The submission is not saved when the agree terms checkbox is not checked during update
+ Given the sitewide "coursework_agree_terms" setting is "1"
+ And the sitewide "coursework_agree_terms_text" setting is "Some text"
+ And the student has a submission
+ When I visit the coursework page
+ And I click on the edit submission button
+ And I press "Submit"
+ Then I should be on the update submission page
- @javascript
- Scenario: The file should not be saved if the agree terms are skipped on create
- Given the sitewide "coursework_agree_terms" setting is "1"
- And the sitewide "coursework_agree_terms_text" setting is "Some text"
- When I visit the coursework page
- And I click on the new submission button
- And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
- And I press "Submit"
- Then I should be on the create submission page
- When I visit the coursework page
- Then I should not see the file on the page
-
- @javascript
- Scenario: The file should not be saved if the agree terms are skipped on update
- Given the sitewide "coursework_agree_terms" setting is "1"
- And the sitewide "coursework_agree_terms_text" setting is "Some text"
- And the coursework "maxfiles" setting is "2" in the database
- And the student has a submission
- When I visit the coursework page
- And I click on the edit submission button
- And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
- And I press "Submit"
- Then I should be on the update submission page
- When I visit the coursework page
- Then I should see 1 file on the page
+ @javascript
+ Scenario: The file should not be saved if the agree terms are skipped on create
+ Given the sitewide "coursework_agree_terms" setting is "1"
+ And the sitewide "coursework_agree_terms_text" setting is "Some text"
+ When I visit the coursework page
+ And I click on the new submission button
+ And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
+ And I press "Submit"
+ Then I should be on the create submission page
+ When I visit the coursework page
+ Then I should not see the file on the page
+ @javascript
+ Scenario: The file should not be saved if the agree terms are skipped on update
+ Given the sitewide "coursework_agree_terms" setting is "1"
+ And the sitewide "coursework_agree_terms_text" setting is "Some text"
+ And the coursework "maxfiles" setting is "2" in the database
+ And the student has a submission
+ When I visit the coursework page
+ And I click on the edit submission button
+ And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
+ And I press "Submit"
+ Then I should be on the update submission page
+ When I visit the coursework page
+ Then I should see 1 file on the page
diff --git a/tests/behat/submissions_auto_finalisation.feature b/tests/behat/submissions_auto_finalisation.feature
index b8edc44b..18b19cc8 100644
--- a/tests/behat/submissions_auto_finalisation.feature
+++ b/tests/behat/submissions_auto_finalisation.feature
@@ -1,3 +1,4 @@
+@mod @mod_coursework
Feature: Auto finalising before cron runs
As a teacher
@@ -5,19 +6,19 @@ Feature: Auto finalising before cron runs
wait for the cron to run
So that I can start marking immediately
- Background:
- Given there is a course
- And there is a coursework
- And there is a student
- And the student has a submission
+ Background:
+ Given there is a course
+ And there is a coursework
+ And there is a student
+ And the student has a submission
- Scenario: Teacher visits the page and sees the submission is finalised when the deadline has passed
- Given I am logged in as a teacher
- And the coursework deadline has passed
- When I visit the coursework page
- Then I should see "Ready to grade"
+ Scenario: Teacher visits the page and sees the submission is finalised when the deadline has passed
+ Given I am logged in as a teacher
+ And the coursework deadline has passed
+ When I visit the coursework page
+ Then I should see "Ready to grade"
- Scenario: Teacher visits the page and sees the submission is not finalised when the deadline has not passed
- Given I am logged in as a teacher
- When I visit the coursework page
- Then I should not see "Ready to grade"
+ Scenario: Teacher visits the page and sees the submission is not finalised when the deadline has not passed
+ Given I am logged in as a teacher
+ When I visit the coursework page
+ Then I should not see "Ready to grade"
diff --git a/tests/behat/submissions_deadlines.feature b/tests/behat/submissions_deadlines.feature
index 934338fa..930ead3e 100644
--- a/tests/behat/submissions_deadlines.feature
+++ b/tests/behat/submissions_deadlines.feature
@@ -5,28 +5,28 @@ Feature: Deadlines for submissions
I want to set deadlines that are viible to the student
So that they know when they are expected to submut, and can be sent automatic reminders
- Background:
- Given there is a course
- And I am logged in as a teacher
- And there is a coursework
+ Background:
+ Given there is a course
+ And I am logged in as a teacher
+ And there is a coursework
- Scenario: the general feedback deadline should be visible if enabled and set
- Given the coursework "generalfeedback" setting is "777777" in the database
- And the coursework general feedback is enabled
- When I visit the coursework page
- Then I should see the date when the general feedback will be released
+ Scenario: the general feedback deadline should be visible if enabled and set
+ Given the coursework "generalfeedback" setting is "777777" in the database
+ And the coursework general feedback is enabled
+ When I visit the coursework page
+ Then I should see the date when the general feedback will be released
- Scenario: the individual feedback deadline should not be visible if not enabled
- Given the coursework "individualfeedback" setting is "0" in the database
- When I visit the coursework page
- Then I should not see the date when the individual feedback will be released
+ Scenario: the individual feedback deadline should not be visible if not enabled
+ Given the coursework "individualfeedback" setting is "0" in the database
+ When I visit the coursework page
+ Then I should not see the date when the individual feedback will be released
- Scenario: the individual feedback deadline should be visible if enabled
- Given the coursework "individualfeedback" setting is "777777" in the database
- When I visit the coursework page
- Then I should see the date when the individual feedback will be released
+ Scenario: the individual feedback deadline should be visible if enabled
+ Given the coursework "individualfeedback" setting is "777777" in the database
+ When I visit the coursework page
+ Then I should see the date when the individual feedback will be released
- Scenario: the general feedback deadline should be visible if not enabled
- Given the coursework "individualfeedback" setting is "7777777" in the database
- When I visit the coursework page
- Then I should see the date when the individual feedback will be released
\ No newline at end of file
+ Scenario: the general feedback deadline should be visible if not enabled
+ Given the coursework "individualfeedback" setting is "7777777" in the database
+ When I visit the coursework page
+ Then I should see the date when the individual feedback will be released
diff --git a/tests/behat/submissions_early_finalisation.feature b/tests/behat/submissions_early_finalisation.feature
index 5e2ad2b8..05ac7c8e 100644
--- a/tests/behat/submissions_early_finalisation.feature
+++ b/tests/behat/submissions_early_finalisation.feature
@@ -1,3 +1,4 @@
+@mod @mod_coursework
Feature: Early finalisation of student submissions
As a teacher
@@ -5,47 +6,47 @@ Feature: Early finalisation of student submissions
So that there is a way to know when something is ready to mark before the deadline is due and I
can plan my grading work more effectively
- Background:
- Given there is a course
- And there is a coursework
- And the coursework "allowearlyfinalisation" setting is "1" in the database
- And I am logged in as a student
+ Background:
+ Given there is a course
+ And there is a coursework
+ And the coursework "allowearlyfinalisation" setting is "1" in the database
+ And I am logged in as a student
- @javascript
- Scenario: I upload a file and finalise it immediately
- When I visit the coursework page
- And I click on the new submission button
- And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
- And I save and finalise the submission
- And I visit the coursework page
- Then I should see the file on the page
- And I should not see the edit submission button
- And I should not see the finalise submission button
+ @javascript @_file_upload
+ Scenario: I upload a file and finalise it immediately
+ When I visit the coursework page
+ And I click on the new submission button
+ And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
+ And I save and finalise the submission
+ And I visit the coursework page
+ Then I should see the file on the page
+ And I should not see the edit submission button
+ And I should not see the finalise submission button
- @broken @javascript
- Scenario: I upload a file and save it
- When I visit the coursework page
- And I click on the new submission button
- And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
- And I save the submission
- And I visit the coursework page
- And I click on the finalise submission button
- And I agree to the confirm message
- Then I should be on the coursework page
- And I should not see the finalise submission button
+ @broken @javascript @_file_upload
+ Scenario: I upload a file and save it
+ When I visit the coursework page
+ And I click on the new submission button
+ And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
+ And I save the submission
+ And I visit the coursework page
+ And I click on the finalise submission button
+ And I agree to the confirm message
+ Then I should be on the coursework page
+ And I should not see the finalise submission button
- @javascript
- Scenario: I should not see the early finalisation button on the student page when the option is disabled
- Given the coursework "allowearlyfinalisation" setting is "0" in the database
- When I visit the coursework page
- And I click on the new submission button
- And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
- And I save the submission
- And I visit the coursework page
- Then I should not see the finalise button
+ @javascript @_file_upload
+ Scenario: I should not see the early finalisation button on the student page when the option is disabled
+ Given the coursework "allowearlyfinalisation" setting is "0" in the database
+ When I visit the coursework page
+ And I click on the new submission button
+ And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
+ And I save the submission
+ And I visit the coursework page
+ Then I should not see the finalise button
- Scenario: I should not see the early finalisation button on the student submission form
- Given the coursework "allowearlyfinalisation" setting is "0" in the database
- When I visit the coursework page
- And I click on the new submission button
- Then I should not see the save and finalise button
\ No newline at end of file
+ Scenario: I should not see the early finalisation button on the student submission form
+ Given the coursework "allowearlyfinalisation" setting is "0" in the database
+ When I visit the coursework page
+ And I click on the new submission button
+ Then I should not see the save and finalise button
diff --git a/tests/behat/submissions_file_upload_limit.feature b/tests/behat/submissions_file_upload_limit.feature
index 50ae4ffb..38770dcf 100644
--- a/tests/behat/submissions_file_upload_limit.feature
+++ b/tests/behat/submissions_file_upload_limit.feature
@@ -5,18 +5,17 @@ Feature: File upload limits
I want to be able to limit the number of files that a student can upload
So that they must submit a specific number
- Background:
- Given there is a course
- And there is a coursework
- And I am logged in as a student
+ Background:
+ Given there is a course
+ And there is a coursework
+ And I am logged in as a student
- @javascript
- Scenario: I am prevented from uploading more files than specified
- Given the coursework "maxfiles" setting is "2" in the database
-
- When I visit the coursework page
- And I click on the new submission button
- And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
- And I upload "mod/coursework/tests/files_for_uploading/Test_document_two.docx" file to "Upload a file" filemanager
- Then the file upload button should not be visible
+ @javascript @_file_upload
+ Scenario: I am prevented from uploading more files than specified
+ Given the coursework "maxfiles" setting is "2" in the database
+ When I visit the coursework page
+ And I click on the new submission button
+ And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
+ And I upload "mod/coursework/tests/files_for_uploading/Test_document_two.docx" file to "Upload a file" filemanager
+ Then the file upload button should not be visible
diff --git a/tests/behat/submissions_file_upload_types.feature b/tests/behat/submissions_file_upload_types.feature
index 04315233..061ba499 100644
--- a/tests/behat/submissions_file_upload_types.feature
+++ b/tests/behat/submissions_file_upload_types.feature
@@ -5,33 +5,33 @@ Feature: Restricting the types of files that students can upload
I want to be able to restrict what file types the students can upload
So that tutors marking the work have a consistent experence and don't waste time
- Background:
- Given there is a course
- And there is a coursework
- And I am logged in as a student
+ Background:
+ Given there is a course
+ And there is a coursework
+ And I am logged in as a student
- @javascript
- Scenario: I can upload anything when the settings are empty
- Given the coursework "filetypes" setting is "" in the database
+ @javascript @_file_upload
+ Scenario: I can upload anything when the settings are empty
+ Given the coursework "filetypes" setting is "" in the database
- When I visit the coursework page
- And I click on the new submission button
- And I upload "mod/coursework/tests/files_for_uploading/Test_image.png" file to "Upload a file" filemanager
- Then I should see "1" elements in "Upload a file" filemanager
+ When I visit the coursework page
+ And I click on the new submission button
+ And I upload "mod/coursework/tests/files_for_uploading/Test_image.png" file to "Upload a file" filemanager
+ Then I should see "1" elements in "Upload a file" filemanager
# Wrong file type throws an exception with a backtrace. Can't find out how to expect this.
-# @javascript
-# Scenario: I can not upload other file types when the settings are restrictive
-# Given the coursework "filetypes" setting is "doc" in the database
+# @javascript @_file_upload
+# Scenario: I can not upload other file types when the settings are restrictive
+# Given the coursework "filetypes" setting is "doc" in the database
#
-# When I visit the coursework page
-# And I upload "mod/coursework/tests/files_for_uploading/Test_image.png" file to "Upload a file" filemanager
-# Then I should see "0" elements in "Upload a file" filemanager
+# When I visit the coursework page
+# And I upload "mod/coursework/tests/files_for_uploading/Test_image.png" file to "Upload a file" filemanager
+# Then I should see "0" elements in "Upload a file" filemanager
- @javascript
- Scenario: I can upload allowed file types when the settings are restrictive
- Given the coursework "filetypes" setting is "docx" in the database
- When I visit the coursework page
- And I click on the new submission button
- And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
- Then I should see "1" elements in "Upload a file" filemanager
\ No newline at end of file
+ @javascript @_file_upload
+ Scenario: I can upload allowed file types when the settings are restrictive
+ Given the coursework "filetypes" setting is "docx" in the database
+ When I visit the coursework page
+ And I click on the new submission button
+ And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
+ Then I should see "1" elements in "Upload a file" filemanager
diff --git a/tests/behat/submissions_group_submissions.feature b/tests/behat/submissions_group_submissions.feature
index 1e81afba..dc438526 100644
--- a/tests/behat/submissions_group_submissions.feature
+++ b/tests/behat/submissions_group_submissions.feature
@@ -5,44 +5,44 @@ Feature: Students are able to submit one piece of work on behalf of the group
I want to be able to submit a single piece of work on behalf of the other people in my group
So that they and the tutor can see it and mark it
- Background:
- Given there is a course
- And there is a coursework
- And the coursework "use_groups" setting is "1" in the database
- And I am logged in as a student
- And the student is a member of a group
- And there is another student
- And the other student is a member of the group
+ Background:
+ Given there is a course
+ And there is a coursework
+ And the coursework "use_groups" setting is "1" in the database
+ And I am logged in as a student
+ And the student is a member of a group
+ And there is another student
+ And the other student is a member of the group
- @javascript
- Scenario: I can submit a file and it appears for the others to see
- When I visit the coursework page
- And I click on the new submission button
- And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
- And I press "Submit"
- And I log out
- And I log in as the other student
- And I visit the coursework page
- Then I should see the file on the page
+ @javascript @_file_upload
+ Scenario: I can submit a file and it appears for the others to see
+ When I visit the coursework page
+ And I click on the new submission button
+ And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
+ And I press "Submit"
+ And I log out
+ And I log in as the other student
+ And I visit the coursework page
+ Then I should see the file on the page
- @javascript
- Scenario: I can resubmit the work when someone else has submitted it
- Given the coursework "maxfiles" setting is "2" in the database
- And I visit the coursework page
- And I click on the new submission button
- And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
- And I press "Submit"
- And I log out
- And I log in as the other student
- And I visit the coursework page
- Then I should see that the submission was made by the student
+ @javascript @_file_upload
+ Scenario: I can resubmit the work when someone else has submitted it
+ Given the coursework "maxfiles" setting is "2" in the database
+ And I visit the coursework page
+ And I click on the new submission button
+ And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
+ And I press "Submit"
+ And I log out
+ And I log in as the other student
+ And I visit the coursework page
+ Then I should see that the submission was made by the student
- When I click on the edit submission button
- Then I should see "1" elements in "Upload a file" filemanager
+ When I click on the edit submission button
+ Then I should see "1" elements in "Upload a file" filemanager
- When I upload "mod/coursework/tests/files_for_uploading/Test_document_two.docx" file to "Upload a file" filemanager
+ When I upload "mod/coursework/tests/files_for_uploading/Test_document_two.docx" file to "Upload a file" filemanager
- And I press "Submit"
- Then I should be on the coursework page
- And I should see both the submission files on the page
- And I should see that the submission was made by the other student
+ And I press "Submit"
+ Then I should be on the coursework page
+ And I should see both the submission files on the page
+ And I should see that the submission was made by the other student
diff --git a/tests/behat/submissions_late_submissions.feature b/tests/behat/submissions_late_submissions.feature
index 16d1fe76..f13ffb5c 100644
--- a/tests/behat/submissions_late_submissions.feature
+++ b/tests/behat/submissions_late_submissions.feature
@@ -1,29 +1,28 @@
+@mod @mod_coursework
Feature: Late submissions
As a teacher
I want to be able to allow stuents to submit work past the deadline
So that they can still get some credit even if their grades get capped
- Background:
- Given there is a course
- And there is a coursework
- And I am logged in as a student
-
- Scenario: not allowed to submit late if the setting does not allow it
- Given the coursework "allowlatesubmissions" setting is "0" in the database
- And the submission deadline has passed
- When I visit the coursework page
- Then I should not see the new submission button
-
- @javascript
- Scenario: allowed to submit late if the setting allows it
- Given the coursework "allowlatesubmissions" setting is "1" in the database
- And the submission deadline has passed
- When I visit the coursework page
- Then I should see the new submission button
- When I visit the new submission page
- And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
- And I press "Submit"
- Then I should be on the coursework page
+ Background:
+ Given there is a course
+ And there is a coursework
+ And I am logged in as a student
+ Scenario: not allowed to submit late if the setting does not allow it
+ Given the coursework "allowlatesubmissions" setting is "0" in the database
+ And the submission deadline has passed
+ When I visit the coursework page
+ Then I should not see the new submission button
+ @javascript @_file_upload
+ Scenario: allowed to submit late if the setting allows it
+ Given the coursework "allowlatesubmissions" setting is "1" in the database
+ And the submission deadline has passed
+ When I visit the coursework page
+ Then I should see the new submission button
+ When I visit the new submission page
+ And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
+ And I press "Submit"
+ Then I should be on the coursework page
diff --git a/tests/behat/submissions_start_date.feature b/tests/behat/submissions_start_date.feature
index e8ca422d..2619ab90 100644
--- a/tests/behat/submissions_start_date.feature
+++ b/tests/behat/submissions_start_date.feature
@@ -1,27 +1,28 @@
+@mod @mod_coursework
Feature: Start date
As a teacher
I want to be able to restrict the start date of the coursework
So that students will not begin to work on it until the right time
- Background:
- Given there is a course
- And there is a coursework
+ Background:
+ Given there is a course
+ And there is a coursework
- Scenario: The student can submit when the start date is disabled
- Given the coursework start date is disabled
- When I log in as a student
- And I visit the coursework page
- Then I should see the new submission button
+ Scenario: The student can submit when the start date is disabled
+ Given the coursework start date is disabled
+ When I log in as a student
+ And I visit the coursework page
+ Then I should see the new submission button
- Scenario: The student can not submit when the start date is in the future
- Given the coursework start date is in the future
- When I log in as a student
- And I visit the coursework page
- Then I should not see the new submission button
+ Scenario: The student can not submit when the start date is in the future
+ Given the coursework start date is in the future
+ When I log in as a student
+ And I visit the coursework page
+ Then I should not see the new submission button
- Scenario: The student can submit when the start date is in the past
- Given the coursework start date is in the past
- When I log in as a student
- And I visit the coursework page
- Then I should see the new submission button
\ No newline at end of file
+ Scenario: The student can submit when the start date is in the past
+ Given the coursework start date is in the past
+ When I log in as a student
+ And I visit the coursework page
+ Then I should see the new submission button
diff --git a/tests/behat/submissions_student_submission.feature b/tests/behat/submissions_student_submission.feature
index 01bcb082..963e5a1d 100644
--- a/tests/behat/submissions_student_submission.feature
+++ b/tests/behat/submissions_student_submission.feature
@@ -5,35 +5,29 @@ Feature: Students can submit files
As a student who has completed some work
I want to be able to upload it as a file to the coursework instance
- Background:
- Given there is a course
- And there is a coursework
- And I am logged in as a student
-
- @javascript
- Scenario: I upload a file and see it on the coursework page as read only
- When I visit the coursework page
- And I click on the new submission button
- And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
- And I save the submission
- Then I should be on the coursework page
- And I should see the file on the page
- And I should see the edit submission button
-
- @javascript
- Scenario: I upload a file and save it and I see it when I come back
- When I visit the coursework page
- And I click on the new submission button
- And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
- And I save the submission
- Then I should be on the coursework page
- When I visit the course page
- And I visit the coursework page
- And I click on the edit submission button
- Then I should see "1" elements in "Upload a file" filemanager
-
-
-
-
-
-
+ Background:
+ Given there is a course
+ And there is a coursework
+ And I am logged in as a student
+
+ @javascript @_file_upload
+ Scenario: I upload a file and see it on the coursework page as read only
+ When I visit the coursework page
+ And I click on the new submission button
+ And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
+ And I save the submission
+ Then I should be on the coursework page
+ And I should see the file on the page
+ And I should see the edit submission button
+
+ @javascript @_file_upload
+ Scenario: I upload a file and save it and I see it when I come back
+ When I visit the coursework page
+ And I click on the new submission button
+ And I upload "mod/coursework/tests/files_for_uploading/Test_document.docx" file to "Upload a file" filemanager
+ And I save the submission
+ Then I should be on the coursework page
+ When I visit the course page
+ And I visit the coursework page
+ And I click on the edit submission button
+ Then I should see "1" elements in "Upload a file" filemanager
diff --git a/tests/behat/submissions_submit_onbehalf_student.feature b/tests/behat/submissions_submit_onbehalf_student.feature
index 8aee7f49..6922ed43 100644
--- a/tests/behat/submissions_submit_onbehalf_student.feature
+++ b/tests/behat/submissions_submit_onbehalf_student.feature
@@ -11,7 +11,7 @@ Feature: User can submit on behalf of a student
And there is a student
And I am logged in as a manager
- @javascript
+ @javascript @_file_upload
Scenario: As a teacher, I upload a file and see it on the coursework page as read only
When I visit the coursework page
And I click on the new submission button for the student
diff --git a/tests/behat/warnings.feature b/tests/behat/warnings.feature
index 3769f3ec..d13f3286 100644
--- a/tests/behat/warnings.feature
+++ b/tests/behat/warnings.feature
@@ -1,30 +1,31 @@
+@mod @mod_coursework@mod @mod_coursework
Feature: warnings when settings are not right
As a manager
I want to know when there are issues with the setup of the coursework instance
So that I can take corrective action before stuff goes wrong
- Background:
- Given there is a course
- And there is a coursework
+ Background:
+ Given there is a course
+ And there is a coursework
- Scenario: managers see a warning about there being too few teachers
- Given there is a teacher
- And the coursework "numberofmarkers" setting is "3" in the database
- And I am logged in as a manager
- When I visit the coursework page
- Then I should see "There are only"
+ Scenario: managers see a warning about there being too few teachers
+ Given there is a teacher
+ And the coursework "numberofmarkers" setting is "3" in the database
+ And I am logged in as a manager
+ When I visit the coursework page
+ Then I should see "There are only"
- Scenario: Teachers do not see the warnign about too few teachers
- Given there is a teacher
- And the coursework "numberofmarkers" setting is "3" in the database
- And I am logged in as a teacher
- When I visit the coursework page
- Then I should not see "There are only"
+ Scenario: Teachers do not see the warning about too few teachers
+ Given there is a teacher
+ And the coursework "numberofmarkers" setting is "3" in the database
+ And I am logged in as a teacher
+ When I visit the coursework page
+ Then I should not see "There are only"
- Scenario: There is no warning when there are enough teachers
- Given there is a teacher
- And the coursework "numberofmarkers" setting is "1" in the database
- And I am logged in as a manager
- When I visit the coursework page
- Then I should not see "There are only"
+ Scenario: There is no warning when there are enough teachers
+ Given there is a teacher
+ And the coursework "numberofmarkers" setting is "1" in the database
+ And I am logged in as a manager
+ When I visit the coursework page
+ Then I should not see "There are only"
From aa3285d916924fe79280413d41a8b599edf1d338 Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Tue, 3 Sep 2024 09:36:45 +0100
Subject: [PATCH 03/27] CTP-3690 comma multi-line array
---
actions/allocate.php | 4 +-
actions/feedbacks/edit.php | 2 +-
actions/feedbacks/show.php | 2 +-
actions/feedbacks/update.php | 2 +-
actions/personal_deadline.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/set_personal_deadlines.php | 2 +-
backup/moodle2/backup_coursework_stepslib.php | 26 ++---
classes/allocation/strategy/base.php | 2 +-
classes/allocation/strategy/percentages.php | 4 +-
classes/auto_grader/average_grade.php | 2 +-
classes/auto_grader/percentage_distance.php | 2 +-
classes/calendar.php | 4 +-
.../deadline_extensions_controller.php | 12 +--
.../personal_deadlines_controller.php | 4 +-
.../plagiarism_flagging_controller.php | 4 +-
.../controllers/submissions_controller.php | 12 +--
classes/cron.php | 2 +-
.../csv/cells/assessorfeedback_cell.php | 2 +-
.../export/csv/cells/assessorgrade_cell.php | 2 +-
.../export/csv/cells/otherassessors_cell.php | 2 +-
classes/export/grading_sheet.php | 2 +-
classes/export/import.php | 2 +-
classes/forms/advance_plugins_form.php | 2 +-
classes/forms/assessor_feedback_mform.php | 4 +-
classes/framework/test/table_base_test.php | 14 +--
classes/grading_table_row_base.php | 2 +-
classes/models/course_module.php | 2 +-
classes/models/moderation_set_rule.php | 2 +-
classes/models/personal_deadline.php | 2 +-
classes/models/sample_set_rule.php | 2 +-
.../minimum_range_grade_percent.php | 6 +-
.../minimum_range_grade_raw.php | 6 +-
.../range_grade_percent.php | 4 +-
.../moderation_set_rule/range_grade_raw.php | 4 +-
.../range_total_percent.php | 2 +-
classes/personal_deadline/table/builder.php | 4 +-
classes/plagiarism_helpers/turnitin.php | 2 +-
classes/privacy/provider.php | 26 ++---
.../cells/moderation_agreement_cell.php | 8 +-
.../cells/multiple_agreed_grade_cell.php | 2 +-
.../cells/plagiarism_flag_cell.php | 6 +-
.../cells/single_assessor_feedback_cell.php | 2 +-
classes/sample_set_rule/sample_base.php | 2 +-
classes/sampling_set_widget.php | 4 +-
classes/stages/base.php | 6 +-
classes/warnings.php | 2 +-
db/access.php | 102 +++++++++---------
db/caches.php | 4 +-
db/events.php | 2 +-
db/log.php | 2 +-
db/tasks.php | 8 +-
lib.php | 6 +-
mod_form.php | 4 +-
renderers/grading_report_renderer.php | 4 +-
renderers/object_renderer.php | 10 +-
view.php | 4 +-
60 files changed, 184 insertions(+), 184 deletions(-)
diff --git a/actions/allocate.php b/actions/allocate.php
index 1b9fc262..01ac806c 100644
--- a/actions/allocate.php
+++ b/actions/allocate.php
@@ -98,7 +98,7 @@
'name' => 'mod_coursework',
'fullpath' => '/mod/coursework/module.js',
'requires' => array('base',
- 'node-base')
+ 'node-base'),
);
$PAGE->requires->js_init_call('M.mod_coursework.init_allocate_page',
array('wwwroot' => $CFG->wwwroot, 'coursemoduleid' => $coursemoduleid),
@@ -215,7 +215,7 @@
// Spacer so that we can float the headers next to each other.
$attributes = array(
- 'class' => 'coursework_spacer'
+ 'class' => 'coursework_spacer',
);
echo html_writer::start_tag('div', $attributes);
echo html_writer::end_tag('div');
diff --git a/actions/feedbacks/edit.php b/actions/feedbacks/edit.php
index 57ebd485..397d7d1b 100644
--- a/actions/feedbacks/edit.php
+++ b/actions/feedbacks/edit.php
@@ -29,7 +29,7 @@
$params = array(
'feedbackid' => $feedbackid,
- 'ajax' => $ajax
+ 'ajax' => $ajax,
);
$controller = new mod_coursework\controllers\feedback_controller($params);
$controller->edit_feedback();
diff --git a/actions/feedbacks/show.php b/actions/feedbacks/show.php
index b74fd868..a3ee41ef 100644
--- a/actions/feedbacks/show.php
+++ b/actions/feedbacks/show.php
@@ -29,7 +29,7 @@
$params = array(
'feedbackid' => $feedbackid,
- 'ajax' => $ajax
+ 'ajax' => $ajax,
);
$controller = new mod_coursework\controllers\feedback_controller($params);
diff --git a/actions/feedbacks/update.php b/actions/feedbacks/update.php
index ab1bafad..4524d49b 100644
--- a/actions/feedbacks/update.php
+++ b/actions/feedbacks/update.php
@@ -39,7 +39,7 @@
'finalised' => $finalised,
'remove' => $remove,
'confirm' => $confirm,
- 'ajax' => $ajax
+ 'ajax' => $ajax,
);
if ($ajax) {
diff --git a/actions/personal_deadline.php b/actions/personal_deadline.php
index e4ed63cc..63508468 100644
--- a/actions/personal_deadline.php
+++ b/actions/personal_deadline.php
@@ -46,7 +46,7 @@
'allocatableid' => $allocatableid,
'allocatabletype' => $allocatabletype,
'setpersonaldeadlinespage' => $setpersonaldeadlinespage,
- 'multipleuserdeadlines' => $multipleuserdeadlines
+ 'multipleuserdeadlines' => $multipleuserdeadlines,
);
if ($selectedtype != 'unfinalise') {
diff --git a/actions/plagiarism_flagging/create.php b/actions/plagiarism_flagging/create.php
index 1afc831c..12eb39fe 100644
--- a/actions/plagiarism_flagging/create.php
+++ b/actions/plagiarism_flagging/create.php
@@ -31,7 +31,7 @@
$submissionid = required_param('submissionid', PARAM_INT);
$params = array(
- 'submissionid' => $submissionid
+ 'submissionid' => $submissionid,
);
$controller = new mod_coursework\controllers\plagiarism_flagging_controller($params);
diff --git a/actions/plagiarism_flagging/edit.php b/actions/plagiarism_flagging/edit.php
index be4b7507..deb30313 100644
--- a/actions/plagiarism_flagging/edit.php
+++ b/actions/plagiarism_flagging/edit.php
@@ -27,7 +27,7 @@
$flagid = optional_param('flagid', 0, PARAM_INT);
$params = array(
- 'flagid' => $flagid
+ 'flagid' => $flagid,
);
$controller = new mod_coursework\controllers\plagiarism_flagging_controller($params);
diff --git a/actions/plagiarism_flagging/new.php b/actions/plagiarism_flagging/new.php
index d1b3a388..a4b01cb1 100644
--- a/actions/plagiarism_flagging/new.php
+++ b/actions/plagiarism_flagging/new.php
@@ -27,7 +27,7 @@
$submissionid = required_param('submissionid', PARAM_INT);
$params = array(
- 'submissionid' => $submissionid
+ 'submissionid' => $submissionid,
);
$controller = new mod_coursework\controllers\plagiarism_flagging_controller($params);
diff --git a/actions/plagiarism_flagging/update.php b/actions/plagiarism_flagging/update.php
index 903d7245..33d2825f 100644
--- a/actions/plagiarism_flagging/update.php
+++ b/actions/plagiarism_flagging/update.php
@@ -31,7 +31,7 @@
$flagid = required_param('flagid', PARAM_INT);
$params = array(
- 'flagid' => $flagid
+ 'flagid' => $flagid,
);
$controller = new mod_coursework\controllers\plagiarism_flagging_controller($params);
diff --git a/actions/set_personal_deadlines.php b/actions/set_personal_deadlines.php
index c6d42bf4..2e946a07 100644
--- a/actions/set_personal_deadlines.php
+++ b/actions/set_personal_deadlines.php
@@ -59,7 +59,7 @@
'name' => 'mod_coursework',
'fullpath' => '/mod/coursework/module.js',
'requires' => array('base',
- 'node-base')
+ 'node-base'),
);
$PAGE->requires->js_init_call('M.mod_coursework.init_personal_deadlines_page',
[],
diff --git a/backup/moodle2/backup_coursework_stepslib.php b/backup/moodle2/backup_coursework_stepslib.php
index 104b12e9..960553cf 100644
--- a/backup/moodle2/backup_coursework_stepslib.php
+++ b/backup/moodle2/backup_coursework_stepslib.php
@@ -105,7 +105,7 @@ protected function define_structure() {
'draftfeedbackenabled',
'processenrol',
'processunenrol',
- 'plagiarismflagenabled'
+ 'plagiarismflagenabled',
));
$sample_strategies = new backup_nested_element('coursework_sample_set_rules');
@@ -140,7 +140,7 @@ protected function define_structure() {
"createdby",
"timecreated",
"lastmodifiedby",
- "timemodified"
+ "timemodified",
));
$moderation_agreements = new backup_nested_element('coursework_mod_agreements');
@@ -154,7 +154,7 @@ protected function define_structure() {
"timemodified",
"lasteditedby",
"modcomment",
- "modecommentformat"
+ "modecommentformat",
));
$feedbacks = new backup_nested_element('coursework_feedbacks');
@@ -176,7 +176,7 @@ protected function define_structure() {
"entry_id",
"markernumber",
"stage_identifier",
- "finalised"
+ "finalised",
));
$submissions = new backup_nested_element('coursework_submissions');
@@ -198,7 +198,7 @@ protected function define_structure() {
'allocatablegroup',
"firstpublished",
"lastpublished",
- "timesubmitted"
+ "timesubmitted",
));
$reminders = new backup_nested_element('coursework_reminders');
@@ -207,7 +207,7 @@ protected function define_structure() {
"userid",
"coursework_id",
"remindernumber",
- "extension"
+ "extension",
));
$pairs = new backup_nested_element('coursework_allocation_pairs');
@@ -223,7 +223,7 @@ protected function define_structure() {
"allocatableid",
"allocatabletype",
'allocatableuser',
- 'allocatablegroup'
+ 'allocatablegroup',
));
$modsetrules = new backup_nested_element('coursework_mod_set_rules');
@@ -235,7 +235,7 @@ protected function define_structure() {
"ruleorder",
"upperlimit",
"lowerlimit",
- "minimum"
+ "minimum",
));
$allocation_configs = new backup_nested_element('coursework_allocation_configs');
@@ -246,7 +246,7 @@ protected function define_structure() {
"allocationstrategy",
"assessorid",
"value",
- "purpose"
+ "purpose",
));
$modsetmembers = new backup_nested_element('coursework_mod_set_members');
@@ -258,7 +258,7 @@ protected function define_structure() {
"allocatabletype",
'allocatableuser',
'allocatablegroup',
- "stage_identifier"
+ "stage_identifier",
));
$extensions = new backup_nested_element('coursework_extensions');
@@ -274,7 +274,7 @@ protected function define_structure() {
"pre_defined_reason",
"createdbyid",
"extra_information_text",
- "extra_information_format"
+ "extra_information_format",
));
$personal_deadlines = new backup_nested_element('coursework_person_deadlines');
@@ -290,7 +290,7 @@ protected function define_structure() {
"createdbyid",
"timecreated",
"timemodified",
- "lastmodifiedbyid"
+ "lastmodifiedbyid",
));
$sample_members = new backup_nested_element('coursework_sample_set_mbrs');
@@ -303,7 +303,7 @@ protected function define_structure() {
'allocatableuser',
'allocatablegroup',
"stage_identifier",
- "selectiontype"
+ "selectiontype",
));
// A coursework instance has submissions.
diff --git a/classes/allocation/strategy/base.php b/classes/allocation/strategy/base.php
index 4069fa15..92210f76 100644
--- a/classes/allocation/strategy/base.php
+++ b/classes/allocation/strategy/base.php
@@ -146,7 +146,7 @@ protected final function get_existing_config_data($type = 'assessor', $reset = f
$params = array(
'courseworkid' => $this->coursework->id,
'allocationstrategy' => $this->get_name(),
- 'purpose' => $type
+ 'purpose' => $type,
);
$this->settings[$type] = $DB->get_records('coursework_allocation_config', $params);
diff --git a/classes/allocation/strategy/percentages.php b/classes/allocation/strategy/percentages.php
index a6fc2064..90b7f098 100644
--- a/classes/allocation/strategy/percentages.php
+++ b/classes/allocation/strategy/percentages.php
@@ -104,7 +104,7 @@ public function add_form_elements($strategypurpose = 'assessor') {
$attributes = array(
'name' => 'assessorstrategy'.$this->get_name().'['.$teacher->id.']',
- 'size' => 3
+ 'size' => 3,
);
if ($currentsetting) {
$attributes['value'] = $currentsetting->value;
@@ -159,7 +159,7 @@ public function save_allocation_strategy_options() {
'courseworkid' => $this->coursework->id,
'allocationstrategy' => $this->get_name(),
'assessorid' => $teacherid,
- 'purpose' => 'assessor'
+ 'purpose' => 'assessor',
);
$DB->delete_records('coursework_allocation_config', $params);
continue;
diff --git a/classes/auto_grader/average_grade.php b/classes/auto_grader/average_grade.php
index 149f166b..46114cd3 100644
--- a/classes/auto_grader/average_grade.php
+++ b/classes/auto_grader/average_grade.php
@@ -135,7 +135,7 @@ private function create_final_feedback() {
feedback::create(array(
'stage_identifier' => 'final_agreed_1',
'submissionid' => $this->get_allocatable()->get_submission($this->get_coursework())->id(),
- 'grade' => $this->automatic_grade()
+ 'grade' => $this->automatic_grade(),
));
}
diff --git a/classes/auto_grader/percentage_distance.php b/classes/auto_grader/percentage_distance.php
index 92575b51..4f59a389 100644
--- a/classes/auto_grader/percentage_distance.php
+++ b/classes/auto_grader/percentage_distance.php
@@ -133,7 +133,7 @@ private function create_final_feedback() {
feedback::create(array(
'stage_identifier' => 'final_agreed_1',
'submissionid' => $this->get_allocatable()->get_submission($this->get_coursework())->id(),
- 'grade' => $this->automatic_grade()
+ 'grade' => $this->automatic_grade(),
));
}
diff --git a/classes/calendar.php b/classes/calendar.php
index 6d52af5c..1ebcefb1 100644
--- a/classes/calendar.php
+++ b/classes/calendar.php
@@ -58,12 +58,12 @@ public static function coursework_event(object $coursework, string $eventtype, ?
if ($cm->showdescription) {
$event->description = array(
'text' => $intro,
- 'format' => $coursework->introformat
+ 'format' => $coursework->introformat,
);
} else {
$event->description = array(
'text' => '',
- 'format' => $coursework->introformat
+ 'format' => $coursework->introformat,
);
}
diff --git a/classes/controllers/deadline_extensions_controller.php b/classes/controllers/deadline_extensions_controller.php
index 7612db02..bf0d86d5 100644
--- a/classes/controllers/deadline_extensions_controller.php
+++ b/classes/controllers/deadline_extensions_controller.php
@@ -210,13 +210,13 @@ public function ajax_submit_mitigation($data_params) {
$response = [
'error' => 0,
'data' => $data_params,
- 'content' => $content
+ 'content' => $content,
];
echo json_encode($response);
} else {
$response = [
'error' => 1,
- 'messages' => $errors
+ 'messages' => $errors,
];
echo json_encode($response);
@@ -246,7 +246,7 @@ public function submission_exists($data) {
return $DB->record_exists('coursework_submissions', array(
'courseworkid' => $data['courseworkid'],
'allocatableid' => $data['allocatableid'],
- 'allocatabletype' => $data['allocatabletype']
+ 'allocatabletype' => $data['allocatabletype'],
));
}
@@ -322,13 +322,13 @@ public function ajax_edit_mitigation($data_params) {
];
$response = [
'error' => 0,
- 'data' => $deadline_extension_transform
+ 'data' => $deadline_extension_transform,
];
}
} else {
$response = [
'error' => 1,
- 'message' => 'ID can not be lower than 1!'
+ 'message' => 'ID can not be lower than 1!',
];
}
echo json_encode($response);
@@ -373,7 +373,7 @@ public function ajax_new_mitigation($data_params) {
$response = [
'error' => 0,
- 'data' => $deadline_extension_transform
+ 'data' => $deadline_extension_transform,
];
echo json_encode($response);
diff --git a/classes/controllers/personal_deadlines_controller.php b/classes/controllers/personal_deadlines_controller.php
index c34d6385..6774813b 100644
--- a/classes/controllers/personal_deadlines_controller.php
+++ b/classes/controllers/personal_deadlines_controller.php
@@ -179,7 +179,7 @@ public function insert_update($time) {
if (!$this->validated($time)) {
return [
'error' => 1,
- 'message' => 'The new deadline you chose has already passed. Please select appropriate deadline'
+ 'message' => 'The new deadline you chose has already passed. Please select appropriate deadline',
];
}
$this->coursework = coursework::find(['id' => $this->params['courseworkid']]);
@@ -243,7 +243,7 @@ public function insert_update($time) {
return [
'error' => 0,
'time' => $date,
- 'timestamp' => $timestamp
+ 'timestamp' => $timestamp,
];
}
diff --git a/classes/controllers/plagiarism_flagging_controller.php b/classes/controllers/plagiarism_flagging_controller.php
index 30e2bf50..c08c6abd 100644
--- a/classes/controllers/plagiarism_flagging_controller.php
+++ b/classes/controllers/plagiarism_flagging_controller.php
@@ -181,8 +181,8 @@ protected function update_plagiarism_flag() {
'submissionid' => $plagiarismflag->submissionid,
'flagid' => $flagid,
'oldstatus' => $oldstatus,
- 'newstatus' => $plagiarismflag->status
- )
+ 'newstatus' => $plagiarismflag->status,
+ ),
);
$event = \mod_coursework\event\coursework_plagiarism_flag_updated::create($params);
diff --git a/classes/controllers/submissions_controller.php b/classes/controllers/submissions_controller.php
index 467111d8..b2320ea2 100644
--- a/classes/controllers/submissions_controller.php
+++ b/classes/controllers/submissions_controller.php
@@ -77,7 +77,7 @@ protected function new_submission() {
$submit_form = new student_submission_form($path,
array(
'coursework' => $this->coursework,
- 'submission' => $submission
+ 'submission' => $submission,
));
if ($submit_form->is_submitted()) {
$validation = $submit_form->validate_defined_fields();
@@ -152,8 +152,8 @@ protected function create_submission() {
'context' => $context,
'objectid' => $submission->id,
'other' => array(
- 'courseworkid' => $this->coursework->id
- )
+ 'courseworkid' => $this->coursework->id,
+ ),
);
$event = assessable_submitted::create($params);
$event->trigger();
@@ -213,7 +213,7 @@ protected function edit_submission() {
$submit_form = new student_submission_form($path,
array(
'coursework' => $this->coursework,
- 'submission' => $submission
+ 'submission' => $submission,
));
if ($submit_form->is_submitted()) {
$validation = $submit_form->validate_defined_fields();
@@ -273,8 +273,8 @@ protected function update_submission() {
'context' => $context,
'objectid' => $submission->id,
'other' => array(
- 'courseworkid' => $this->coursework->id
- )
+ 'courseworkid' => $this->coursework->id,
+ ),
);
$event = assessable_submitted::create($params);
$event->trigger();
diff --git a/classes/cron.php b/classes/cron.php
index 57a7f363..894cfa51 100644
--- a/classes/cron.php
+++ b/classes/cron.php
@@ -71,7 +71,7 @@ private static function send_reminders_to_students() {
$counts = array(
'emails' => 0,
- 'users' => 0
+ 'users' => 0,
);
$userswhoneedreminding = [];
diff --git a/classes/export/csv/cells/assessorfeedback_cell.php b/classes/export/csv/cells/assessorfeedback_cell.php
index 86bf9aaf..e3062990 100644
--- a/classes/export/csv/cells/assessorfeedback_cell.php
+++ b/classes/export/csv/cells/assessorfeedback_cell.php
@@ -137,7 +137,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
'courseworkid' => $this->coursework->id,
'allocatableid' => $submission->allocatableid,
'allocatabletype' => $submission->allocatabletype,
- 'stage_identifier' => $stage_identifier
+ 'stage_identifier' => $stage_identifier,
);
if (!has_capability('mod/coursework:administergrades', $modulecontext)
diff --git a/classes/export/csv/cells/assessorgrade_cell.php b/classes/export/csv/cells/assessorgrade_cell.php
index 3c2a83b8..081148f0 100644
--- a/classes/export/csv/cells/assessorgrade_cell.php
+++ b/classes/export/csv/cells/assessorgrade_cell.php
@@ -217,7 +217,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
'courseworkid' => $this->coursework->id,
'allocatableid' => $submission->allocatableid,
'allocatabletype' => $submission->allocatabletype,
- 'stage_identifier' => $stage_identifier
+ 'stage_identifier' => $stage_identifier,
);
if (!has_capability('mod/coursework:administergrades', $PAGE->context)
diff --git a/classes/export/csv/cells/otherassessors_cell.php b/classes/export/csv/cells/otherassessors_cell.php
index 008def5a..66caf981 100644
--- a/classes/export/csv/cells/otherassessors_cell.php
+++ b/classes/export/csv/cells/otherassessors_cell.php
@@ -48,7 +48,7 @@ public function get_cell($submission, $student, $stage_identifier) {
$params = array(
'submissionid' => $submission->id,
'assessorid' => $USER->id,
- 'stageidentifier' => $stage_identifier
+ 'stageidentifier' => $stage_identifier,
);
$sql = "SELECT * FROM {coursework_feedbacks}
diff --git a/classes/export/grading_sheet.php b/classes/export/grading_sheet.php
index d3ce543d..1c8ea7aa 100644
--- a/classes/export/grading_sheet.php
+++ b/classes/export/grading_sheet.php
@@ -32,7 +32,7 @@ class grading_sheet extends csv {
public function get_submissions($groupid = null, $selected_submission_ids = '') {
global $PAGE, $USER;
$params = array(
- 'courseworkid' => $this->coursework->id
+ 'courseworkid' => $this->coursework->id,
);
$submissions = submission::find_all($params);
diff --git a/classes/export/import.php b/classes/export/import.php
index bc8e10e7..5a8c87a5 100644
--- a/classes/export/import.php
+++ b/classes/export/import.php
@@ -706,7 +706,7 @@ public function get_stage_identifier($submissionid, $cell_identifier) {
array('courseworkid' => $this->coursework->id,
'allocatableid' => $submission->allocatableid,
'allocatabletype' => $submission->allocatabletype,
- 'assessorid' => $USER->id
+ 'assessorid' => $USER->id,
));
$stage_identifier = $dbrecord->stage_identifier;
}
diff --git a/classes/forms/advance_plugins_form.php b/classes/forms/advance_plugins_form.php
index 9c2d4932..75c8a343 100644
--- a/classes/forms/advance_plugins_form.php
+++ b/classes/forms/advance_plugins_form.php
@@ -53,7 +53,7 @@ public function definition() {
$file_manager_options = array(
'subdirs' => false,
'accepted_types' => '*',
- 'return_types' => FILE_INTERNAL
+ 'return_types' => FILE_INTERNAL,
);
$this->_form->addElement('filemanager',
'file_element',
diff --git a/classes/forms/assessor_feedback_mform.php b/classes/forms/assessor_feedback_mform.php
index fb419e14..911c1c16 100644
--- a/classes/forms/assessor_feedback_mform.php
+++ b/classes/forms/assessor_feedback_mform.php
@@ -108,7 +108,7 @@ public function definition() {
$file_manager_options = array(
'subdirs' => false,
'accepted_types' => '*',
- 'return_types' => FILE_INTERNAL
+ 'return_types' => FILE_INTERNAL,
);
$uploadfilestring = get_string('uploadafile');
@@ -235,7 +235,7 @@ public function get_file_options() {
'areamaxbytes' => $filemanager->getAreamaxbytes(),
'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/framework/test/table_base_test.php b/classes/framework/test/table_base_test.php
index 2f16324e..14f9dd5f 100644
--- a/classes/framework/test/table_base_test.php
+++ b/classes/framework/test/table_base_test.php
@@ -52,7 +52,7 @@ public function test_find_when_true_with_id() {
$generator = testing_util::get_data_generator();
$params = array(
- 'username' => 'freddo'
+ 'username' => 'freddo',
);
$user = $generator->create_user($params);
@@ -63,7 +63,7 @@ public function test_find_when_true_with_other_param() {
$generator = testing_util::get_data_generator();
$params = array(
- 'username' => 'freddo'
+ 'username' => 'freddo',
);
$user = $generator->create_user($params);
@@ -74,7 +74,7 @@ public function test_find_when_true_with_entire_db_object() {
$generator = testing_util::get_data_generator();
$params = array(
- 'username' => 'freddo'
+ 'username' => 'freddo',
);
$user = $generator->create_user($params);
@@ -83,7 +83,7 @@ public function test_find_when_true_with_entire_db_object() {
public function test_find_when_false() {
$params = array(
- 'username' => 'freddo'
+ 'username' => 'freddo',
);
$this->assertFalse(framework_user_table::find($params));
}
@@ -96,7 +96,7 @@ public function test_exists_when_true() {
$generator = testing_util::get_data_generator();
$params = array(
- 'username' => 'freddo'
+ 'username' => 'freddo',
);
$generator->create_user($params);
@@ -105,7 +105,7 @@ public function test_exists_when_true() {
public function test_exists_when_false() {
$params = array(
- 'username' => 'freddo'
+ 'username' => 'freddo',
);
$this->assertFalse(framework_user_table::exists($params));
}
@@ -114,7 +114,7 @@ public function test_find_when_given_a_db_record() {
$generator = testing_util::get_data_generator();
$params = array(
- 'username' => 'freddo'
+ 'username' => 'freddo',
);
$user = $generator->create_user($params);
$this->assertEquals($user->id, framework_user_table::find($user)->id);
diff --git a/classes/grading_table_row_base.php b/classes/grading_table_row_base.php
index 51532886..1752b4ee 100644
--- a/classes/grading_table_row_base.php
+++ b/classes/grading_table_row_base.php
@@ -257,7 +257,7 @@ public function get_plagiarism_flag() {
$submission = $this->get_submission();
$params = array(
- 'submissionid' => $submission->id
+ 'submissionid' => $submission->id,
);
return plagiarism_flag::find($params);
diff --git a/classes/models/course_module.php b/classes/models/course_module.php
index ed0aeccb..392ffb0d 100644
--- a/classes/models/course_module.php
+++ b/classes/models/course_module.php
@@ -57,7 +57,7 @@ class course_module extends table_base {
public static function fill_pool($array) {
self::$pool = [
'id' => [],
- 'course-module-instance' => []
+ 'course-module-instance' => [],
];
foreach ($array as $record) {
$object = new self($record);
diff --git a/classes/models/moderation_set_rule.php b/classes/models/moderation_set_rule.php
index 11d44550..15ab01d2 100644
--- a/classes/models/moderation_set_rule.php
+++ b/classes/models/moderation_set_rule.php
@@ -96,7 +96,7 @@ abstract class moderation_set_rule extends table_base implements renderable {
'ruleorder',
'upperlimit',
'lowerlimit',
- 'minimum'
+ 'minimum',
);
/**
diff --git a/classes/models/personal_deadline.php b/classes/models/personal_deadline.php
index b02713bd..00025a09 100644
--- a/classes/models/personal_deadline.php
+++ b/classes/models/personal_deadline.php
@@ -112,7 +112,7 @@ protected static function get_cache_array($coursework_id) {
global $DB;
$records = $DB->get_records(static::$table_name, ['courseworkid' => $coursework_id]);
$result = [
- 'allocatableid-allocatabletype' => []
+ 'allocatableid-allocatabletype' => [],
];
if ($records) {
foreach ($records as $record) {
diff --git a/classes/models/sample_set_rule.php b/classes/models/sample_set_rule.php
index 465bbe23..a3411d1c 100644
--- a/classes/models/sample_set_rule.php
+++ b/classes/models/sample_set_rule.php
@@ -96,7 +96,7 @@ abstract class sample_set_rule extends table_base implements renderable {
'ruleorder',
'upperlimit',
'lowerlimit',
- 'minimum'
+ 'minimum',
);
/**
diff --git a/classes/moderation_set_rule/minimum_range_grade_percent.php b/classes/moderation_set_rule/minimum_range_grade_percent.php
index 888b48b3..6551a877 100644
--- a/classes/moderation_set_rule/minimum_range_grade_percent.php
+++ b/classes/moderation_set_rule/minimum_range_grade_percent.php
@@ -128,7 +128,7 @@ public function get_form_elements() {
$html .= get_string('upperlimit', 'mod_coursework').' ';
$attributes = array(
'name' => 'rule_'.self::get_name().'_upperlimit',
- 'size' => 3
+ 'size' => 3,
);
$html .= html_writer::empty_tag('input', $attributes);
$html .= html_writer::end_tag('p');
@@ -137,7 +137,7 @@ public function get_form_elements() {
$html .= get_string('lowerlimit', 'mod_coursework').' ';
$attributes = array(
'name' => self::get_name().'_lowerlimit',
- 'size' => 3
+ 'size' => 3,
);
$html .= html_writer::empty_tag('input', $attributes);
$html .= html_writer::end_tag('p');
@@ -146,7 +146,7 @@ public function get_form_elements() {
$html .= get_string('modsetminimum', 'mod_coursework').' ';
$attributes = array(
'name' => self::get_name().'_minimum',
- 'size' => 4
+ 'size' => 4,
);
$html .= html_writer::empty_tag('input', $attributes);
$html .= html_writer::end_tag('p');
diff --git a/classes/moderation_set_rule/minimum_range_grade_raw.php b/classes/moderation_set_rule/minimum_range_grade_raw.php
index 76985030..42598297 100644
--- a/classes/moderation_set_rule/minimum_range_grade_raw.php
+++ b/classes/moderation_set_rule/minimum_range_grade_raw.php
@@ -122,7 +122,7 @@ public function get_form_elements() {
$html .= get_string('upperlimit', 'mod_coursework').' ';
$attributes = array(
'name' => 'rule_minimum_range_grade_raw_upperlimit',
- 'size' => 3
+ 'size' => 3,
);
$html .= html_writer::empty_tag('input', $attributes);
$html .= html_writer::end_tag('p');
@@ -131,7 +131,7 @@ public function get_form_elements() {
$html .= get_string('lowerlimit', 'mod_coursework').' ';
$attributes = array(
'name' => 'rule_minimum_range_grade_raw_lowerlimit',
- 'size' => 3
+ 'size' => 3,
);
$html .= html_writer::empty_tag('input', $attributes);
$html .= html_writer::end_tag('p');
@@ -140,7 +140,7 @@ public function get_form_elements() {
$html .= get_string('modsetminimum', 'mod_coursework').' ';
$attributes = array(
'name' => 'rule_minimum_range_grade_raw_minimum',
- 'size' => 4
+ 'size' => 4,
);
$html .= html_writer::empty_tag('input', $attributes);
$html .= html_writer::end_tag('p');
diff --git a/classes/moderation_set_rule/range_grade_percent.php b/classes/moderation_set_rule/range_grade_percent.php
index 25cfff42..73e14808 100644
--- a/classes/moderation_set_rule/range_grade_percent.php
+++ b/classes/moderation_set_rule/range_grade_percent.php
@@ -119,7 +119,7 @@ public function get_form_elements() {
$html .= get_string('upperlimit', 'mod_coursework').' ';
$attributes = array(
'name' => 'rule_range_grade_percent_upperlimit',
- 'size' => 3
+ 'size' => 3,
);
$html .= html_writer::empty_tag('input', $attributes).'%';
$html .= html_writer::end_tag('p');
@@ -128,7 +128,7 @@ public function get_form_elements() {
$html .= get_string('lowerlimit', 'mod_coursework').' ';
$attributes = array(
'name' => 'rule_range_grade_percent_lowerlimit',
- 'size' => 3
+ 'size' => 3,
);
$html .= html_writer::empty_tag('input', $attributes).'%';
$html .= html_writer::end_tag('p');
diff --git a/classes/moderation_set_rule/range_grade_raw.php b/classes/moderation_set_rule/range_grade_raw.php
index 7e4502cf..f6913c03 100644
--- a/classes/moderation_set_rule/range_grade_raw.php
+++ b/classes/moderation_set_rule/range_grade_raw.php
@@ -110,7 +110,7 @@ public function get_form_elements() {
$html .= get_string('upperlimit', 'mod_coursework').' ';
$attributes = array(
'name' => 'rule_range_grade_raw_upperlimit',
- 'size' => 3
+ 'size' => 3,
);
$html .= html_writer::empty_tag('input', $attributes);
$html .= html_writer::end_tag('p');
@@ -119,7 +119,7 @@ public function get_form_elements() {
$html .= get_string('lowerlimit', 'mod_coursework').' ';
$attributes = array(
'name' => 'rule_range_grade_raw_lowerlimit',
- 'size' => 3
+ 'size' => 3,
);
$html .= html_writer::empty_tag('input', $attributes);
$html .= html_writer::end_tag('p');
diff --git a/classes/moderation_set_rule/range_total_percent.php b/classes/moderation_set_rule/range_total_percent.php
index 825ed812..eb0563d7 100644
--- a/classes/moderation_set_rule/range_total_percent.php
+++ b/classes/moderation_set_rule/range_total_percent.php
@@ -127,7 +127,7 @@ public function get_form_elements() {
$html .= get_string('upperlimit', 'mod_coursework').' ';
$attributes = array(
'name' => 'rule_range_total_percent_upperlimit',
- 'size' => 3
+ 'size' => 3,
);
$html .= html_writer::empty_tag('input', $attributes).'%';
$html .= html_writer::end_tag('p');
diff --git a/classes/personal_deadline/table/builder.php b/classes/personal_deadline/table/builder.php
index ec6d52e2..6610bee2 100644
--- a/classes/personal_deadline/table/builder.php
+++ b/classes/personal_deadline/table/builder.php
@@ -112,7 +112,7 @@ public function get_options() {
*/
public function get_allocatable_cell() {
$items = array(
- 'coursework' => $this->coursework
+ 'coursework' => $this->coursework,
);
if ($this->coursework->is_configured_to_have_group_submissions()) {
@@ -126,7 +126,7 @@ public function get_allocatable_cell() {
*/
public function get_personal_deadline_cell() {
$items = array(
- 'coursework' => $this->coursework
+ 'coursework' => $this->coursework,
);
return new personal_deadline_cell($items);
diff --git a/classes/plagiarism_helpers/turnitin.php b/classes/plagiarism_helpers/turnitin.php
index ec2c23b8..2ba1c168 100644
--- a/classes/plagiarism_helpers/turnitin.php
+++ b/classes/plagiarism_helpers/turnitin.php
@@ -50,7 +50,7 @@ public function enabled() {
$params = array(
'cm' => $this->get_coursework()->get_course_module()->id,
'name' => 'use_turnitin',
- 'value' => 1
+ 'value' => 1,
);
if ($DB->record_exists('plagiarism_turnitin_config', $params)) {
return true;
diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php
index acc79b7a..5680ed20 100644
--- a/classes/privacy/provider.php
+++ b/classes/privacy/provider.php
@@ -54,7 +54,7 @@ public static function get_metadata(collection $collection) : collection {
'timemodified' => 'timemodified',
'grade' => 'privacy:metadata:grade',
'submissionid' => 'privacy:metadata:submissionid',
- 'feedbackcomment' => 'privacy:metadata:feedbackcomment'
+ 'feedbackcomment' => 'privacy:metadata:feedbackcomment',
];
$submissions = [
'authorid' => 'privacy:metadata:authorid',
@@ -62,7 +62,7 @@ public static function get_metadata(collection $collection) : collection {
'timecreated' => 'privacy:metadata:timecreated',
'timemodified' => 'timemodified',
'createdby' => 'createdby',
- 'timesubmitted' => 'timesubmitted'
+ 'timesubmitted' => 'timesubmitted',
];
$extensions = [
'allocatableid' => 'privacy:metadata:allocatableid',
@@ -70,27 +70,27 @@ public static function get_metadata(collection $collection) : collection {
'extra_information_text' => 'privacy:metadata:extra_information_text',
'extended_deadline' => 'privacy:metadata:extended_deadline',
'allocatableuser' => 'privacy:metadata:userid',
- 'allocatablegroup' => 'privacy:metadata:groupid'
+ 'allocatablegroup' => 'privacy:metadata:groupid',
];
$persondeadlines = [
'allocatableid' => 'privacy:metadata:allocatableid',
'createdbyid' => 'privacy:metadata:createdbyid',
'personal_deadline' => 'privacy:metadata:personal_deadline',
'allocatableuser' => 'privacy:metadata:userid',
- 'allocatablegroup' => 'privacy:metadata:groupid'
+ 'allocatablegroup' => 'privacy:metadata:groupid',
];
$modagreements = [
'moderatorid' => 'privacy:metadata:moderatorid',
'agreement' => 'privacy:metadata:agreement',
'modcomment' => 'privacy:metadata:modcomment',
'timecreated' => 'privacy:metadata:timecreated',
- 'timemodified' => 'timemodified'
+ 'timemodified' => 'timemodified',
];
$plagiarismflags = [
'createdby' => 'privacy:metadata:createdby',
'comment' => 'privacy:metadata:comment',
'timecreated' => 'privacy:metadata:timecreated',
- 'timemodified' => 'timemodified'
+ 'timemodified' => 'timemodified',
];
$collection->add_database_table('coursework_feedbacks', $feedbacks, 'privacy:metadata:feedbacks');
$collection->add_database_table('coursework_submissions', $submissions, 'privacy:metadata:submissions');
@@ -113,7 +113,7 @@ public static function get_users_in_context(userlist $userlist) {
$params = [
'modulename' => 'coursework',
'contextid' => $context->id,
- 'contextlevel' => CONTEXT_MODULE
+ 'contextlevel' => CONTEXT_MODULE,
];
$sql = "SELECT cwf.assessorid
FROM {context} ctx
@@ -192,7 +192,7 @@ public static function get_contexts_for_userid(int $userid) : contextlist {
'allocatableuser' => $userid,
'allocatablegroup' => $userid,
'moderatorid' => $userid,
- 'createdby' => $userid
+ 'createdby' => $userid,
];
$sql = "SELECT ctx.id
FROM {course_modules} cm
@@ -445,7 +445,7 @@ protected static function export_coursework_submission(\stdClass $submission, \c
'timemodified' => transform::datetime($submission->timemodified),
'timesubmitted' => transform::datetime($submission->timesubmitted),
'createdby' => $submission->createdby,
- 'finalised' => transform::yesno($submission->finalised)
+ 'finalised' => transform::yesno($submission->finalised),
];
writer::with_context($context)
->export_data(array_merge($currentpath, [get_string('privacy:submissionpath', 'mod_coursework')]), $submissionData);
@@ -503,7 +503,7 @@ protected static function format_submissions_feedback(\stdClass $feedback) {
'grade' => $feedback->grade,
'feedbackcomment' => $feedback->feedbackcomment,
'stage_identifier' => $feedback->stage_identifier,
- 'finalised' => transform::yesno($feedback->finalised)
+ 'finalised' => transform::yesno($feedback->finalised),
];
return $feedbackData;
}
@@ -523,7 +523,7 @@ protected static function export_coursework_extension_data($extension, $context,
$extensionData = [
'extended_deadline' => transform::datetime($extension->extended_deadline),
'extra_information_text' => $extension->extra_information_text,
- 'createdbyid' => $extension->createdbyid
+ 'createdbyid' => $extension->createdbyid,
];
writer::with_context($context)
->export_data(array_merge($path, [get_string('privacy:extensionpath', 'mod_coursework')]), (object) $extensionData);
@@ -545,7 +545,7 @@ protected static function export_person_deadline_data($personDeadline, $context,
'personal_deadline' => transform::datetime($personDeadline->personal_deadline),
'timecreated' => transform::datetime($personDeadline->timecreated),
'timemodified' => transform::datetime($personDeadline->timemodified),
- 'createdbyid' => $personDeadline->createdbyid
+ 'createdbyid' => $personDeadline->createdbyid,
];
writer::with_context($context)
->export_data(array_merge($path, [get_string('privacy:person_deadlines', 'mod_coursework')]), (object) $personDeadlineData);
@@ -577,7 +577,7 @@ protected static function export_plagiarism_flags_data($plagiarism, $context, $p
'status' => $status,
'timecreated' => transform::datetime($plagiarism->timecreated),
'timemodified' => transform::datetime($plagiarism->timemodified),
- 'createdby' => $plagiarism->createdby
+ 'createdby' => $plagiarism->createdby,
];
writer::with_context($context)
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 53aca8a7..07b72e25 100644
--- a/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php
+++ b/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php
@@ -78,7 +78,7 @@ public function get_table_cell($rowobject) {
'submissionid' => $rowobject->get_submission()->id,
'moderatorid' => $USER->id,
'stage_identifier' => $this->stage->identifier(),
- 'feedbackid' => $rowobject->get_single_feedback()->id
+ 'feedbackid' => $rowobject->get_single_feedback()->id,
);
// allow moderations if feedback exists
$new_moderation = moderation::build($moderation_params);
@@ -166,7 +166,7 @@ private function new_moderation_button($rowobject, $assessor) {
'submission' => $rowobject->get_submission(),
'assessor' => $assessor,
'stage' => $this->stage,
- 'feedbackid' => $feedback->id
+ 'feedbackid' => $feedback->id,
);
$link = $this->get_router()->get_path('new moderations', $moderation_params);
@@ -191,7 +191,7 @@ private function edit_moderation_button($rowobject) {
$feedback = $rowobject->get_submission()->get_assessor_feedback_by_stage('assessor_1');
$feedback_params = array(
- 'moderation' => $this->stage->get_moderation_for_feedback($feedback)
+ 'moderation' => $this->stage->get_moderation_for_feedback($feedback),
);
$link = $this->get_router()->get_path('edit moderation', $feedback_params);
@@ -218,7 +218,7 @@ private function show_moderation_button($rowobject) {
$feedback = $rowobject->get_submission()->get_assessor_feedback_by_stage('assessor_1');
$moderation_params = array(
- 'moderation' => $this->stage->get_moderation_for_feedback($feedback)
+ 'moderation' => $this->stage->get_moderation_for_feedback($feedback),
);
$linktitle = get_string('viewmoderation', 'mod_coursework');
diff --git a/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php b/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
index 8654576a..3b01688b 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
@@ -92,7 +92,7 @@ public function get_content($rowobject) {
if ($existing_feedback && $ability->can('edit', $existing_feedback)) {
$feedback_route_params = array(
- 'feedback' => $finalfeedback
+ 'feedback' => $finalfeedback,
);
$link = $this->get_router()->get_path('ajax edit feedback', $feedback_route_params);
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 f4b22698..019e6ddd 100644
--- a/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php
+++ b/classes/render_helpers/grading_report/cells/plagiarism_flag_cell.php
@@ -51,7 +51,7 @@ public function get_table_cell($rowobject) {
if ($rowobject->has_submission() && $rowobject->get_submission()->finalised) {
$plagiarism_flag_params = array(
- 'submissionid' => $rowobject->get_submission()->id
+ 'submissionid' => $rowobject->get_submission()->id,
);
$plagiarism_flag = plagiarism_flag::find($plagiarism_flag_params);
@@ -111,7 +111,7 @@ private function new_flag_plagiarism_button($row_object) {
$title = get_string('flagplagiarism', 'coursework');
$feedback_params = array(
- 'submission' => $row_object->get_submission()
+ 'submission' => $row_object->get_submission(),
);
$link = $this->get_router()->get_path('new plagiarism flag', $feedback_params);
@@ -134,7 +134,7 @@ private function edit_flag_plagiarism_button($row_object) {
$title = get_string('editflagplagiarism', 'coursework');
$feedback_params = array(
- 'flag' => $row_object->get_plagiarism_flag()
+ 'flag' => $row_object->get_plagiarism_flag(),
);
$link = $this->get_router()->get_path('edit plagiarism flag', $feedback_params);
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 1573f4e2..88875297 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
@@ -167,7 +167,7 @@ private function edit_feedback_button($rowobject) {
global $OUTPUT;
$feedback_params = array(
- 'feedback' => $this->stage->get_feedback_for_allocatable($rowobject->get_allocatable())
+ 'feedback' => $this->stage->get_feedback_for_allocatable($rowobject->get_allocatable()),
);
$link = $this->get_router()->get_path('edit feedback', $feedback_params);
diff --git a/classes/sample_set_rule/sample_base.php b/classes/sample_set_rule/sample_base.php
index e4a25d12..308f6775 100644
--- a/classes/sample_set_rule/sample_base.php
+++ b/classes/sample_set_rule/sample_base.php
@@ -87,7 +87,7 @@ abstract class sample_base {
'ruleorder',
'upperlimit',
'lowerlimit',
- 'minimum'
+ 'minimum',
);
function __construct($coursework) {
diff --git a/classes/sampling_set_widget.php b/classes/sampling_set_widget.php
index f1d7bbc2..7ef9ca6e 100644
--- a/classes/sampling_set_widget.php
+++ b/classes/sampling_set_widget.php
@@ -126,7 +126,7 @@ public function get_potential_rule_class_names() {
if (!$fullclassname::allow_multiple()) {
$params = array(
'courseworkid' => $this->coursework->id,
- 'rulename' => $rulename
+ 'rulename' => $rulename,
);
$alreadygotone = $DB->record_exists('coursework_mod_set_rules', $params);
if ($alreadygotone) {
@@ -174,7 +174,7 @@ public function get_add_rule_form_elements() {
$attributes = array(
'class' => 'rule-config',
'id' => 'rule-config-'.$shortname,
- 'style' => 'display:none' // Always hide, so they only get revealed by clicking the radio buttons.
+ 'style' => 'display:none', // Always hide, so they only get revealed by clicking the radio buttons.
);
$html .= html_writer::start_tag('div', $attributes);
/* @var models\moderation_set_rule $instance */
diff --git a/classes/stages/base.php b/classes/stages/base.php
index e81b86c0..c867db19 100644
--- a/classes/stages/base.php
+++ b/classes/stages/base.php
@@ -66,7 +66,7 @@ abstract class base {
* @var array
*/
private static $self_cache = [
- 'user_is_assessor' => []
+ 'user_is_assessor' => [],
];
/**
@@ -552,7 +552,7 @@ public function remove_allocatable_from_sampling($allocatable) {
'courseworkid' => $this->coursework->id,
'allocatableid' => $allocatable->id(),
'allocatabletype' => $allocatable->type(),
- 'stage_identifier' => $this->stage_identifier
+ 'stage_identifier' => $this->stage_identifier,
);
$DB->delete_records('coursework_sample_set_mbrs', $params);
}
@@ -719,7 +719,7 @@ public function get_feedback_for_submission($submission) {
*/
public function get_moderation_for_feedback($feedback) {
$moderation_params = array(
- 'feedbackid' => $feedback->id
+ 'feedbackid' => $feedback->id,
);
return moderation::find($moderation_params);
}
diff --git a/classes/warnings.php b/classes/warnings.php
index 21576ab3..b05f450c 100644
--- a/classes/warnings.php
+++ b/classes/warnings.php
@@ -371,7 +371,7 @@ private function students_who_are_not_in_any_group($student_sql, $student_params
$params = array_merge($student_params,
array(
- 'courseid' => $this->coursework->get_course()->id
+ 'courseid' => $this->coursework->get_course()->id,
));
$students = $DB->get_records_sql($sql, $params);
return $students;
diff --git a/db/access.php b/db/access.php
index 07e8c4b2..ea402cb1 100644
--- a/db/access.php
+++ b/db/access.php
@@ -60,9 +60,9 @@
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
- 'manager' => CAP_ALLOW
+ 'manager' => CAP_ALLOW,
),
- 'clonepermissionsfrom' => 'moodle/course:manageactivities'
+ 'clonepermissionsfrom' => 'moodle/course:manageactivities',
),
'mod/coursework:view' => array(
@@ -73,8 +73,8 @@
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
- 'manager' => CAP_ALLOW
- )
+ 'manager' => CAP_ALLOW,
+ ),
),
'mod/coursework:submit' => array(
@@ -82,8 +82,8 @@
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
- 'student' => CAP_ALLOW
- )
+ 'student' => CAP_ALLOW,
+ ),
),
'mod/coursework:submitonbehalfof' => array(
@@ -91,8 +91,8 @@
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
- 'manager' => CAP_ALLOW
- )
+ 'manager' => CAP_ALLOW,
+ ),
),
'mod/coursework:addinitialgrade' => array(
@@ -102,8 +102,8 @@
'legacy' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
- 'manager' => CAP_ALLOW
- )
+ 'manager' => CAP_ALLOW,
+ ),
),
'mod/coursework:editinitialgrade' => array(
@@ -111,8 +111,8 @@
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
- 'manager' => CAP_ALLOW
- )
+ 'manager' => CAP_ALLOW,
+ ),
),
'mod/coursework:addagreedgrade' => array(
@@ -120,8 +120,8 @@
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
- 'manager' => CAP_ALLOW
- )
+ 'manager' => CAP_ALLOW,
+ ),
),
'mod/coursework:editagreedgrade' => array(
@@ -129,8 +129,8 @@
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
- 'manager' => CAP_ALLOW
- )
+ 'manager' => CAP_ALLOW,
+ ),
),
'mod/coursework:publish' => array(
@@ -138,8 +138,8 @@
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
- 'manager' => CAP_ALLOW
- )
+ 'manager' => CAP_ALLOW,
+ ),
),
'mod/coursework:viewanonymous' => array(
@@ -147,8 +147,8 @@
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
- 'manager' => CAP_ALLOW
- )
+ 'manager' => CAP_ALLOW,
+ ),
),
'mod/coursework:revertfinalised' => array(
@@ -156,8 +156,8 @@
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
- 'manager' => CAP_ALLOW
- )
+ 'manager' => CAP_ALLOW,
+ ),
),
'mod/coursework:allocate' => array(
@@ -165,8 +165,8 @@
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
- 'manager' => CAP_ALLOW
- )
+ 'manager' => CAP_ALLOW,
+ ),
),
'mod/coursework:viewallgradesatalltimes' => array(
@@ -174,8 +174,8 @@
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
- 'manager' => CAP_ALLOW
- )
+ 'manager' => CAP_ALLOW,
+ ),
),
'mod/coursework:administergrades' => array(
@@ -183,8 +183,8 @@
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
- 'manager' => CAP_ALLOW
- )
+ 'manager' => CAP_ALLOW,
+ ),
),
'mod/coursework:grantextensions' => array(
@@ -192,8 +192,8 @@
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
- 'manager' => CAP_ALLOW
- )
+ 'manager' => CAP_ALLOW,
+ ),
),
'mod/coursework:canexportfinalgrades' => array(
@@ -201,8 +201,8 @@
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
- 'manager' => CAP_ALLOW
- )
+ 'manager' => CAP_ALLOW,
+ ),
),
'mod/coursework:viewextensions' => array(
@@ -213,7 +213,7 @@
'manager' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
- )
+ ),
),
'mod/coursework:grade' => array(
@@ -224,7 +224,7 @@
'manager' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
- )
+ ),
),
'mod/coursework:addgeneralfeedback' => array(
'riskbitmask' => RISK_MANAGETRUST | RISK_PERSONAL,
@@ -232,7 +232,7 @@
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
'manager' => CAP_ALLOW,
- )
+ ),
),
'mod/coursework:viewallstudents' => array(
@@ -242,8 +242,8 @@
'legacy' => array(
'manager' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
- 'editingteacher' => CAP_ALLOW
- )
+ 'editingteacher' => CAP_ALLOW,
+ ),
),
'mod/coursework:addallocatedagreedgrade' => array(
@@ -251,8 +251,8 @@
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
- 'manager' => CAP_ALLOW
- )
+ 'manager' => CAP_ALLOW,
+ ),
),
'mod/coursework:editallocatedagreedgrade' => array(
@@ -260,8 +260,8 @@
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
- 'manager' => CAP_ALLOW
- )
+ 'manager' => CAP_ALLOW,
+ ),
),
'mod/coursework:editpersonaldeadline' => array(
@@ -269,8 +269,8 @@
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
- 'manager' => CAP_ALLOW
- )
+ 'manager' => CAP_ALLOW,
+ ),
),
'mod/coursework:moderate' => array(
@@ -278,8 +278,8 @@
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
- 'manager' => CAP_ALLOW
- )
+ 'manager' => CAP_ALLOW,
+ ),
),
'mod/coursework:receivesubmissionnotifications' => array(
@@ -287,8 +287,8 @@
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
- 'manager' => CAP_ALLOW
- )
+ 'manager' => CAP_ALLOW,
+ ),
),
'mod/coursework:addplagiarismflag' => array(
@@ -298,8 +298,8 @@
'legacy' => array(
'manager' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
- 'editingteacher' => CAP_ALLOW
- )
+ 'editingteacher' => CAP_ALLOW,
+ ),
),
'mod/coursework:updateplagiarismflag' => array(
@@ -307,8 +307,8 @@
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
- 'manager' => CAP_ALLOW
- )
+ 'manager' => CAP_ALLOW,
+ ),
),
);
diff --git a/db/caches.php b/db/caches.php
index b097c831..5870f333 100644
--- a/db/caches.php
+++ b/db/caches.php
@@ -22,6 +22,6 @@
$definitions = array(
'courseworkdata' => array(
- 'mode' => cache_store::MODE_APPLICATION
- )
+ 'mode' => cache_store::MODE_APPLICATION,
+ ),
);
diff --git a/db/events.php b/db/events.php
index 31627dd3..58ea29ae 100644
--- a/db/events.php
+++ b/db/events.php
@@ -35,7 +35,7 @@
array(
'eventname' => '\mod_coursework\event\coursework_deadline_changed',
'callback' => 'mod_coursework_observer::coursework_deadline_changed',
- 'schedule' => 'cron'
+ 'schedule' => 'cron',
),
array(
'eventname' => '\core\event\course_module_updated',
diff --git a/db/log.php b/db/log.php
index cd5cd1a1..864ae951 100644
--- a/db/log.php
+++ b/db/log.php
@@ -39,5 +39,5 @@
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' => 'view all', 'mtable' => 'coursework', 'field' => 'name'),
);
diff --git a/db/tasks.php b/db/tasks.php
index 8ab3a22e..fda40ee2 100644
--- a/db/tasks.php
+++ b/db/tasks.php
@@ -33,7 +33,7 @@
'hour' => '0',
'day' => '*',
'month' => '*',
- 'dayofweek' => '*'
+ 'dayofweek' => '*',
),
array(
'classname' => 'mod_coursework\task\enrol_task',
@@ -42,7 +42,7 @@
'hour' => '*',
'day' => '*',
'month' => '*',
- 'dayofweek' => '*'
+ 'dayofweek' => '*',
),
array(
'classname' => 'mod_coursework\task\unenrol_task',
@@ -51,6 +51,6 @@
'hour' => '*',
'day' => '*',
'month' => '*',
- 'dayofweek' => '*'
- )
+ 'dayofweek' => '*',
+ ),
);
diff --git a/lib.php b/lib.php
index 8784f020..1fb5062a 100644
--- a/lib.php
+++ b/lib.php
@@ -479,7 +479,7 @@ function coursework_update_instance($coursework) {
'oldindividualdeadline' => $oldindividualdeadline,
'newindividualdeadline' => $coursework->individualfeedback,
'userfrom' => $USER->id,
- )
+ ),
);
$event = \mod_coursework\event\coursework_deadline_changed::create($params);
@@ -927,7 +927,7 @@ function coursework_seconds_to_string($seconds) {
60 => array(get_string('minute', 'mod_coursework'),
get_string('minutes', 'mod_coursework')),
1 => array(get_string('second', 'mod_coursework'),
- get_string('seconds', 'mod_coursework'))
+ get_string('seconds', 'mod_coursework')),
);
$result = [];
@@ -966,7 +966,7 @@ function coursework_get_current_max_feedbacks($courseworkid) {
GROUP BY feedbacks.submissionid) AS feedbackcounts
";
$params = array(
- 'courseworkid' => $courseworkid
+ 'courseworkid' => $courseworkid,
);
$max = $DB->get_field_sql($sql, $params);
diff --git a/mod_form.php b/mod_form.php
index 19201e1e..a2caea1b 100644
--- a/mod_form.php
+++ b/mod_form.php
@@ -51,7 +51,7 @@ public function definition() {
'fullpath' => '/mod/coursework/mod_form.js',
'requires' => array(
'node',
- 'ajax'
+ 'ajax',
));
$PAGE->requires->js_init_call('M.mod_coursework.init', [], true, $module);
@@ -824,7 +824,7 @@ protected function add_number_of_initial_assessors_field() {
// Don't want to give the option for 0!
1 => 1,
2 => 2,
- 3 => 3
+ 3 => 3,
);
// Remove all options lower than the current maximum number of feedbacks that any student has.
$currentmaxfeedbacks = coursework_get_current_max_feedbacks($courseworkid);
diff --git a/renderers/grading_report_renderer.php b/renderers/grading_report_renderer.php
index ae5ff26b..ea532009 100644
--- a/renderers/grading_report_renderer.php
+++ b/renderers/grading_report_renderer.php
@@ -86,13 +86,13 @@ private function generate_lang_element() {
'download_submitted_files' => get_string('download_submitted_files', 'mod_coursework'),
'exportfinalgrades' => get_string('exportfinalgrades', 'mod_coursework'),
'exportgradingsheets' => get_string('exportgradingsheets', 'mod_coursework'),
- 'loadingpagination' => get_string('loadingpagination', 'mod_coursework')
+ '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'
+ 'id' => 'element_lang_messages',
));
$result = html_writer::div($result);
diff --git a/renderers/object_renderer.php b/renderers/object_renderer.php
index 22bfe18c..ae12d656 100644
--- a/renderers/object_renderer.php
+++ b/renderers/object_renderer.php
@@ -328,7 +328,7 @@ protected function render_mod_coursework_assessor_feedback_row(mod_coursework_as
$new_feedback_params = array(
'submission' => $feedbackrow->get_submission(),
'assessor' => $feedbackrow->get_assessor(),
- 'stage' => $feedbackrow->get_stage()
+ 'stage' => $feedbackrow->get_stage(),
);
$link = $this->get_router()->get_path('new feedback', $new_feedback_params);
$iconlink = $this->output->action_icon($link, $icon, null, array('class' => "new_feedback"));
@@ -1038,7 +1038,7 @@ protected function make_moderation_set_rule_row(moderation_set_rule $rule) {
$attributes = array(
'type' => 'submit',
'name' => 'delete-mod-set-rule[' . $rule->id . ']',
- 'value' => $linktitle
+ 'value' => $linktitle,
);
$controlscell->text .= html_writer::empty_tag('input', $attributes);
$row->cells[] = $controlscell;
@@ -1073,7 +1073,7 @@ protected function get_allocation_strategy_form_elements($coursework) {
$attributes = array(
'class' => 'assessor-strategy-options',
- 'id' => 'assessor-strategy-' . $classname
+ 'id' => 'assessor-strategy-' . $classname,
);
// Hide this if it's not currently selected.
$strategytype = 'assessorallocationstrategy';
@@ -1166,7 +1166,7 @@ protected function render_file_plagiarism_information($file, $coursework) {
'cmid' => $coursework->get_coursemodule_id(),
'course' => $coursework->get_course(),
'coursework' => $coursework->id,
- 'modname' => 'coursework'
+ 'modname' => 'coursework',
);
$plagiarsmlinks = plagiarism_get_links($plagiarism_links_params);
@@ -1473,7 +1473,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',
);
$allocatable_cell_helper = $personal_deadline_row->get_allocatable_cell();
diff --git a/view.php b/view.php
index 51bb866e..90805981 100644
--- a/view.php
+++ b/view.php
@@ -47,7 +47,7 @@
'fullpath' => '/mod/coursework/module.js',
'requires' => array('base',
'node-base'),
- 'strings' => []
+ 'strings' => [],
);
$PAGE->requires->yui_module('moodle-core-notification', 'notification_init');
@@ -481,7 +481,7 @@
// work.
if ($filehash) {
$params = array(
- 'pathnamehash' => $filehash
+ 'pathnamehash' => $filehash,
);
$file = $DB->get_record('files', $params);
$file->timemodified = time();
From 2adde4de38cab7b52722539340486a7bcd980bff Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Tue, 3 Sep 2024 09:44:49 +0100
Subject: [PATCH 04/27] CTP-3690 indentation
---
actions/upload_grading_sheet.php | 2 +-
.../backup_coursework_activity_task.class.php | 30 ++--
classes/ability.php | 14 +-
classes/allocation/manager.php | 24 +--
classes/allocation/table/cell/builder.php | 18 +-
classes/allocation/table/processor.php | 28 +--
classes/assessor_feedback_row.php | 2 +-
.../personal_deadlines_controller.php | 64 ++++---
.../controllers/submissions_controller.php | 28 +--
classes/cron.php | 12 +-
classes/export/csv.php | 78 ++++----
.../csv/cells/assessorfeedback_cell.php | 2 +-
.../export/csv/cells/assessorgrade_cell.php | 8 +-
classes/export/csv/cells/cell_base.php | 2 +-
.../csv/cells/moderationagreement_cell.php | 12 +-
.../export/csv/cells/otherassessors_cell.php | 8 +-
classes/export/csv/cells/singlegrade_cell.php | 4 +-
.../export/csv/cells/submissiontime_cell.php | 2 +-
classes/export/grading_sheet.php | 110 ++++++------
classes/export/import.php | 126 ++++++-------
classes/file_importer.php | 2 +-
classes/forms/deadline_extension_form.php | 2 +-
classes/forms/student_submission_form.php | 2 +-
classes/forms/upload_allocations_form.php | 2 +-
classes/grading_table_row_base.php | 2 +-
classes/models/moderation.php | 6 +-
classes/models/outstanding_marking.php | 12 +-
.../grading_report/cells/_user_cell.php | 20 +--
.../cells/moderation_agreement_cell.php | 2 +-
.../cells/multiple_agreed_grade_cell.php | 14 +-
.../grading_report/cells/user_cell.php | 28 +--
classes/sample_set_rule/range_sample_type.php | 68 +++----
classes/sample_set_rule/total_sample_type.php | 14 +-
classes/warnings.php | 52 +++---
db/upgrade.php | 2 +-
lib.php | 168 +++++++++---------
mod_form.php | 40 ++---
renderers/object_renderer.php | 34 ++--
settings.php | 2 +-
view.php | 2 +-
40 files changed, 523 insertions(+), 525 deletions(-)
diff --git a/actions/upload_grading_sheet.php b/actions/upload_grading_sheet.php
index 9a43230f..1dbae1e1 100644
--- a/actions/upload_grading_sheet.php
+++ b/actions/upload_grading_sheet.php
@@ -69,7 +69,7 @@
$csvimport = new \mod_coursework\export\import($coursework, false, false);
- // $csv_cells = $csvimport->csv_columns(); //all columns from spreadsheet
+ // $csv_cells = $csvimport->csv_columns(); //all columns from spreadsheet
$procsessingresults = $csvimport->validate_csv($content, $data->encoding, $data->delimiter_name, $csv_cells);
diff --git a/backup/moodle2/backup_coursework_activity_task.class.php b/backup/moodle2/backup_coursework_activity_task.class.php
index 78a19a15..c3654be1 100644
--- a/backup/moodle2/backup_coursework_activity_task.class.php
+++ b/backup/moodle2/backup_coursework_activity_task.class.php
@@ -24,25 +24,25 @@
class backup_coursework_activity_task extends backup_activity_task {
- static public function encode_content_links($content) {
- global $CFG;
+ static public function encode_content_links($content) {
+ global $CFG;
- $base = preg_quote($CFG->wwwroot, "/");
+ $base = preg_quote($CFG->wwwroot, "/");
- // These have to be picked up by the restore code COURSEWORK... are arbitrary
- $search = "/(".$base."\/mod\/coursework\/index.php\?id\=)([0-9]+)/";
- $content = preg_replace($search, '$@COURSEWORKINDEX*$2@$', $content);
+ // These have to be picked up by the restore code COURSEWORK... are arbitrary
+ $search = "/(".$base."\/mod\/coursework\/index.php\?id\=)([0-9]+)/";
+ $content = preg_replace($search, '$@COURSEWORKINDEX*$2@$', $content);
- $search = "/(".$base."\/mod\/coursework\/view.php\?id\=)([0-9]+)/";
- $content = preg_replace($search, '$@COURSEWORKBYID*$2@$', $content);
+ $search = "/(".$base."\/mod\/coursework\/view.php\?id\=)([0-9]+)/";
+ $content = preg_replace($search, '$@COURSEWORKBYID*$2@$', $content);
- return $content;
- }
+ return $content;
+ }
- protected function define_my_settings() {
- }
+ protected function define_my_settings() {
+ }
- protected function define_my_steps() {
- $this->add_step(new backup_coursework_activity_structure_step('coursework_structure', 'coursework.xml'));
- }
+ protected function define_my_steps() {
+ $this->add_step(new backup_coursework_activity_structure_step('coursework_structure', 'coursework.xml'));
+ }
}
diff --git a/classes/ability.php b/classes/ability.php
index c24ad60e..681e8a98 100644
--- a/classes/ability.php
+++ b/classes/ability.php
@@ -152,7 +152,7 @@ function (coursework $coursework) {
// New feedback
$this->prevent_new_feedback_with_no_submission();
- $this->prevent_new_feedback_when_submission_not_finalised();
+ $this->prevent_new_feedback_when_submission_not_finalised();
$this->prevent_new_feedback_when_prerequisite_stages_have_no_feedback();
$this->prevent_new_feedback_with_empty_stage();
$this->prevent_new_feedback_when_allocatable_already_has_feedback_for_this_stage();
@@ -163,7 +163,7 @@ function (coursework $coursework) {
$this->prevent_new_feedback_when_not_assessor_for_stage();
$this->prevent_new_feedback_from_non_allocated_assessors();
$this->allow_new_feedback_by_allocated_assessor();
- $this->allow_new_feedback_from_any_assessor_when_allocation_is_disabled_for_stage_or_instance();
+ $this->allow_new_feedback_from_any_assessor_when_allocation_is_disabled_for_stage_or_instance();
$this->allow_new_feedback_if_agreed_feedback_and_user_can_add_agreed_feedback();
// Create feedback
@@ -230,7 +230,7 @@ function (coursework $coursework) {
// Plagiarism flagging rules for Plagiarism Alert
// New
- // $this->prevent_new_plagiarism_flag_if_already_exists();
+ // $this->prevent_new_plagiarism_flag_if_already_exists();
$this->allow_new_plagiarism_flag_with_capability();
// Edit
@@ -425,7 +425,7 @@ function (submission $submission) {
}
protected function allow_show_submission_to_graders_after_feedback_release() {
-// Show to graders after release
+ // Show to graders after release
$this->allow('show',
'mod_coursework\models\submission',
function (submission $submission) {
@@ -485,8 +485,8 @@ function (submission $submission) {
// take into account courseworks with personal deadlines
if ($submission->get_coursework()->personal_deadlines_enabled()) {
$deadline_passed = (bool)$submission->submission_personal_deadline() < time();
- } else {
- $deadline_passed = $submission->get_coursework()->deadline_has_passed();
+ } else {
+ $deadline_passed = $submission->get_coursework()->deadline_has_passed();
}
$ok_to_submit_late = $submission->get_coursework()->allow_late_submissions();
$coursework = $submission->get_coursework();
@@ -1202,7 +1202,7 @@ private function allow_show_grading_table_row_if_user_can_grant_extension_and_no
'mod_coursework\grading_table_row_base',
function (grading_table_row_base $row) {
- return (!$row->get_coursework()->allocation_enabled() && has_capability('mod/coursework:grantextensions',
+ return (!$row->get_coursework()->allocation_enabled() && has_capability('mod/coursework:grantextensions',
$row->get_coursework()
->get_context()));
diff --git a/classes/allocation/manager.php b/classes/allocation/manager.php
index e25b57af..b4dd472f 100644
--- a/classes/allocation/manager.php
+++ b/classes/allocation/manager.php
@@ -344,18 +344,18 @@ public function auto_generate_sample_set() {
// Save sample set
if (!empty($auto_sample_set)) {
- foreach ($auto_sample_set as $allocatable) {
- $sample = new \stdClass();
- $sample->courseworkid = $this->coursework->id;
- $sample->allocatableid = $allocatable->id;
- $sample->allocatabletype = ($this->coursework->is_configured_to_have_group_submissions()) ? "group" : "user";
- $sample->stage_identifier = "assessor_{$stage_number}";
- $sample->selectiontype = "automatic";
-
- // If this a manually selected allocatable check to see if the allocatable is already in the table
- $DB->insert_record("coursework_sample_set_mbrs", $sample);
-
- }
+ foreach ($auto_sample_set as $allocatable) {
+ $sample = new \stdClass();
+ $sample->courseworkid = $this->coursework->id;
+ $sample->allocatableid = $allocatable->id;
+ $sample->allocatabletype = ($this->coursework->is_configured_to_have_group_submissions()) ? "group" : "user";
+ $sample->stage_identifier = "assessor_{$stage_number}";
+ $sample->selectiontype = "automatic";
+
+ // If this a manually selected allocatable check to see if the allocatable is already in the table
+ $DB->insert_record("coursework_sample_set_mbrs", $sample);
+
+ }
}
}
}
diff --git a/classes/allocation/table/cell/builder.php b/classes/allocation/table/cell/builder.php
index 859cb3e6..6ffeb3a3 100644
--- a/classes/allocation/table/cell/builder.php
+++ b/classes/allocation/table/cell/builder.php
@@ -191,9 +191,9 @@ private function prepare_allocation_table_cell() {
}
$contents .= '
';
- if ($this->coursework->allocation_enabled()) {
- $assessor_dropdown = $this->get_potential_marker_dropdown();
- }
+ if ($this->coursework->allocation_enabled()) {
+ $assessor_dropdown = $this->get_potential_marker_dropdown();
+ }
$assessor_name = '';
if ($this->has_feedback()) {
$class .= ' has-assessor-feedback ';
@@ -210,7 +210,7 @@ private function prepare_allocation_table_cell() {
}
if ($assessor_name) {
- if ($this->get_stage()->uses_sampling() && !$this->get_feedback() && !$this->has_automatic_sampling()) {
+ if ($this->get_stage()->uses_sampling() && !$this->get_feedback() && !$this->has_automatic_sampling()) {
$contents .= '
';
}
$contents .= "{$assessor_name}";
@@ -437,15 +437,15 @@ private function has_final_feedback() {
[$this->allocatable->id(), $this->allocatable->type()]
);
if ($submission) {
- $feedbacks = isset(feedback::$pool[$this->coursework->id]['submissionid'][$submission->id]) ?
+ $feedbacks = isset(feedback::$pool[$this->coursework->id]['submissionid'][$submission->id]) ?
feedback::$pool[$this->coursework->id]['submissionid'][$submission->id] : [];
- foreach ($feedbacks as $feedback) {
- if ($feedback->stage_identifier == 'final_agreed_1') {
- return true;
+ foreach ($feedbacks as $feedback) {
+ if ($feedback->stage_identifier == 'final_agreed_1') {
+ return true;
+ }
}
}
- }
return false;
}
diff --git a/classes/allocation/table/processor.php b/classes/allocation/table/processor.php
index 7b6c5f85..fd329886 100644
--- a/classes/allocation/table/processor.php
+++ b/classes/allocation/table/processor.php
@@ -87,19 +87,19 @@ private function get_row($allocatable) {
private function clean_data($raw_data) {
// Data looks like this:
-// $example_data = array(
-// 4543 => array( // Student id
-// 'assessor_1' => array(
-// 'allocation_id' => 43,
-// 'assessor_id' => 232,
-// ),
-// 'moderator_1' => array(
-// 'allocation_id' => 46,
-// 'assessor_id' => 235,
-// 'in_set' => 1,
-// )
-// )
-// );
+ // $example_data = array(
+ // 4543 => array( // Student id
+ // 'assessor_1' => array(
+ // 'allocation_id' => 43,
+ // 'assessor_id' => 232,
+ // ),
+ // 'moderator_1' => array(
+ // 'allocation_id' => 46,
+ // 'assessor_id' => 235,
+ // 'in_set' => 1,
+ // )
+ // )
+ // );
$clean_data = [];
foreach ($raw_data as $allocatable_id => $datarrays) {
@@ -117,7 +117,7 @@ private function clean_data($raw_data) {
$clean_data[$allocatable_id][$stage->identifier()] = $stage_data;
}
}
- /* if (array_key_exists('moderator', $datarrays)) {
+ /* if (array_key_exists('moderator', $datarrays)) {
$moderator_data = $datarrays['moderator'];
$clean_data[$allocatable_id]['moderator'] = $moderator_data;
}*/
diff --git a/classes/assessor_feedback_row.php b/classes/assessor_feedback_row.php
index d24932d6..be98e9b5 100644
--- a/classes/assessor_feedback_row.php
+++ b/classes/assessor_feedback_row.php
@@ -128,7 +128,7 @@ public function get_graded_by() {
* @return string
*/
public function get_graders_name() {
- return $this->get_graded_by()->profile_link();
+ return $this->get_graded_by()->profile_link();
}
/**
diff --git a/classes/controllers/personal_deadlines_controller.php b/classes/controllers/personal_deadlines_controller.php
index 6774813b..be1a73ec 100644
--- a/classes/controllers/personal_deadlines_controller.php
+++ b/classes/controllers/personal_deadlines_controller.php
@@ -84,36 +84,34 @@ protected function new_personal_deadline() {
$this->personal_deadline->update_attributes($data);
}
} else {
-
- $allocatables = unserialize($data->allocatableid);
-
- foreach ($allocatables as $allocatableid) {
- $data->allocatableid = $allocatableid;
- $data->id = '';
- //$data->id = '';
- $findparams = array(
- 'allocatableid' => $allocatableid,
- 'allocatabletype' => $data->allocatabletype,
- 'courseworkid' => $data->courseworkid,
- );
- $this->personal_deadline = personal_deadline::find_or_build($findparams);
-
- if (empty($this->personal_deadline->personal_deadline)) { // personal deadline doesnt exist
- // add new
- $data->createdbyid = $USER->id;
- $this->personal_deadline = personal_deadline::build($data);
- $this->personal_deadline->save();
-
- } else {
- // update
- $data->id = $this->personal_deadline->id;
- $data->lastmodifiedbyid = $USER->id;
- $data->timemodified = time();
- $this->personal_deadline->update_attributes($data);
- }
-
+ $allocatables = unserialize($data->allocatableid);
+ foreach ($allocatables as $allocatableid) {
+ $data->allocatableid = $allocatableid;
+ $data->id = '';
+ //$data->id = '';
+ $findparams = array(
+ 'allocatableid' => $allocatableid,
+ 'allocatabletype' => $data->allocatabletype,
+ 'courseworkid' => $data->courseworkid,
+ );
+ $this->personal_deadline = personal_deadline::find_or_build($findparams);
+
+ if (empty($this->personal_deadline->personal_deadline)) { // personal deadline doesnt exist
+ // add new
+ $data->createdbyid = $USER->id;
+ $this->personal_deadline = personal_deadline::build($data);
+ $this->personal_deadline->save();
+
+ } else {
+ // update
+ $data->id = $this->personal_deadline->id;
+ $data->lastmodifiedbyid = $USER->id;
+ $data->timemodified = time();
+ $this->personal_deadline->update_attributes($data);
}
+ }
+
}
redirect($coursework_page_url);
}
@@ -141,12 +139,12 @@ protected function set_default_current_deadline() {
$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
- if (is_array($this->params['allocatableid']) || !$this->get_personal_deadline()) { // if no personal deadline then use coursework deadline
- $this->personal_deadline->personal_deadline = $this->coursework->deadline;
+ // If the allocatableid is an array then the current page will probably be setting multiple the personal deadlines
+ // of multiple allocatable ids in which case set the personal deadline to the coursework default
+ if (is_array($this->params['allocatableid']) || !$this->get_personal_deadline()) { // if no personal deadline then use coursework deadline
+ $this->personal_deadline->personal_deadline = $this->coursework->deadline;
- }
+ }
return $params;
}
diff --git a/classes/controllers/submissions_controller.php b/classes/controllers/submissions_controller.php
index b2320ea2..60b73b53 100644
--- a/classes/controllers/submissions_controller.php
+++ b/classes/controllers/submissions_controller.php
@@ -116,14 +116,14 @@ protected function create_submission() {
$submission->authorid = $submission->get_author_id(); // Create new function to get the author id depending on whether the current user is submitting on behalf
$submission->timesubmitted = time();
- // Automatically finalise any submissions that's past the deadline/personal deadline and doesn't have valid extension
+ // Automatically finalise any submissions that's past the deadline/personal deadline and doesn't have valid extension
if ($this->coursework->personal_deadlines_enabled()) {
// Check is submission has a valid personal deadline or a valid extension
- if (!$this->has_valid_personal_deadline($submission) && !$this->has_valid_extension($submission)) {
- $submission->finalised = 1;
- }
+ if (!$this->has_valid_personal_deadline($submission) && !$this->has_valid_extension($submission)) {
+ $submission->finalised = 1;
+ }
} else if ($this->coursework->deadline_has_passed() && !$this->has_valid_extension($submission)) {
- $submission->finalised = 1;
+ $submission->finalised = 1;
}
$ability = new ability(user::find($USER), $this->coursework);
@@ -167,7 +167,7 @@ protected function create_submission() {
}
}
- if ($submission->finalised) {
+ if ($submission->finalised) {
if (!$submission->get_coursework()->has_deadline()) {
$userids = explode(',', $submission->get_coursework()->get_submission_notification_users());
@@ -221,11 +221,11 @@ protected function edit_submission() {
$submit_form->set_data($submission);
- if ($validation != true) {
+ if ($validation != true) {
$this->get_page_renderer()->edit_submission_page($submit_form, $submission);
return true;
- }
- }
+ }
+ }
/**
*
@@ -399,11 +399,11 @@ protected function check_coursework_is_open($coursework) {
*/
private function exception_if_late($submission) {
$could_have_submitted = has_capability('mod/coursework:submit', $this->coursework->get_context());
- if ($this->coursework->personal_deadlines_enabled()) {
- $deadline_has_passed = !$this->has_valid_personal_deadline($submission);
- } else {
- $deadline_has_passed = $this->coursework->deadline_has_passed();
- }
+ if ($this->coursework->personal_deadlines_enabled()) {
+ $deadline_has_passed = !$this->has_valid_personal_deadline($submission);
+ } else {
+ $deadline_has_passed = $this->coursework->deadline_has_passed();
+ }
if ($could_have_submitted && $deadline_has_passed && !$this->has_valid_extension($submission) && !$this->coursework->allow_late_submissions()) {
throw new late_submission($this->coursework);
diff --git a/classes/cron.php b/classes/cron.php
index 894cfa51..b04ee7df 100644
--- a/classes/cron.php
+++ b/classes/cron.php
@@ -51,7 +51,7 @@ public static function run() {
echo "Starting coursework cron functions...\n";
self::finalise_any_submissions_where_the_deadline_has_passed();
self::send_reminders_to_students();
- // self::send_first_reminders_to_admins(); #90211934
+ // self::send_first_reminders_to_admins(); #90211934
self::autorelease_feedbacks_where_the_release_date_has_passed();
return true;
}
@@ -109,7 +109,7 @@ private static function send_reminders_to_students() {
if ($individual_extension) {
// check if 1st reminder is due to be sent but has not been sent yet
- if ($coursework->due_to_send_first_reminders($individual_extension->extended_deadline) &&
+ if ($coursework->due_to_send_first_reminders($individual_extension->extended_deadline) &&
$student->has_not_been_sent_reminder($coursework, 1, $individual_extension->extended_deadline)) {
$student->deadline = $individual_extension->extended_deadline;
$student->extension = $individual_extension->extended_deadline;
@@ -117,15 +117,15 @@ private static function send_reminders_to_students() {
$student->nextremindernumber = 1;
$userswhoneedreminding[$student->id().'_'.$coursework->id] = $student;
- // check if 2nd reminder is due to be sent but has not been sent yet
- } else if ($coursework->due_to_send_second_reminders($individual_extension->extended_deadline) &&
+ // check if 2nd reminder is due to be sent but has not been sent yet
+ } else if ($coursework->due_to_send_second_reminders($individual_extension->extended_deadline) &&
$student->has_not_been_sent_reminder($coursework, 2, $individual_extension->extended_deadline)) {
$student->deadline = $individual_extension->extended_deadline;
$student->extension = $individual_extension->extended_deadline;
$student->coursework_id = $coursework->id;
$student->nextremindernumber = 2;
$userswhoneedreminding[$student->id().'_'.$coursework->id] = $student;
- }
+ }
} else if ($deadline > time()) { // coursework or personal deadline hasn't passed
// check if 1st reminder is due to be sent but has not been sent yet
@@ -386,7 +386,7 @@ private static function autorelease_feedbacks_where_the_release_date_has_passed(
global $DB;
echo 'Auto releasing feedbacks for courseworks where the release date have passed...';
- $sql = "SELECT *
+ $sql = "SELECT *
FROM {coursework} c
JOIN {coursework_submissions} cs
ON c.id = cs.courseworkid
diff --git a/classes/export/csv.php b/classes/export/csv.php
index c0db544a..704f9498 100644
--- a/classes/export/csv.php
+++ b/classes/export/csv.php
@@ -128,11 +128,11 @@ public function add_cells_to_array($submission, $student, $csv_cells) {
}
} else if ($csv_cell != 'stages' && $csv_cell != 'moderationagreement' && $csv_cell != 'otherassessors') {
$cell = $cell->get_cell($submission, $student, false);
- if (is_array($cell)) {
- $row = array_merge($row, $cell);
- } else {
- $row[] = $cell;
- }
+ if (is_array($cell)) {
+ $row = array_merge($row, $cell);
+ } else {
+ $row[] = $cell;
+ }
} else {
$stages = $cell->get_cell($submission, $student, false);
@@ -147,50 +147,50 @@ public function add_cells_to_array($submission, $student, $csv_cells) {
* create headers for CSV
* @param $csv_headers
*/
- public function add_headers($csv_headers) {
- $headers = [];
- foreach ($csv_headers as $header) {
- if (substr($header, 0, 8) == 'assessor') {
- $stage = (substr($header, -1));
- $header = substr($header, 0, -1);
+ public function add_headers($csv_headers) {
+ $headers = [];
+ foreach ($csv_headers as $header) {
+ if (substr($header, 0, 8) == 'assessor') {
+ $stage = (substr($header, -1));
+ $header = substr($header, 0, -1);
+ }
+ $class = "mod_coursework\\export\\csv\\cells\\".$header."_cell";
+ $cell = new $class($this->coursework);
+ if (substr($header, 0, 8) == 'assessor') {
+ $head = $cell->get_header($stage);
+ if (is_array($head)) {
+ $headers = array_merge($headers, $head);
+ } else {
+ $headers[$header.$stage] = $head;
}
- $class = "mod_coursework\\export\\csv\\cells\\".$header."_cell";
- $cell = new $class($this->coursework);
- if (substr($header, 0, 8) == 'assessor') {
- $head = $cell->get_header($stage);
- if (is_array($head)) {
- $headers = array_merge($headers, $head);
- } else {
- $headers[$header.$stage] = $head;
- }
-
- } else if ($header != 'stages' && $header != 'moderationagreement' && $header != 'otherassessors' ) {
- $head = $cell->get_header(false);
- if (is_array($head)) {
- $headers = array_merge($headers, $head);
- } else {
- $headers[$header] = $head;
- }
+
+ } else if ($header != 'stages' && $header != 'moderationagreement' && $header != 'otherassessors' ) {
+ $head = $cell->get_header(false);
+ if (is_array($head)) {
+ $headers = array_merge($headers, $head);
} else {
- $array_headers = $cell->get_header(false);
- $headers = array_merge($headers, $array_headers);
+ $headers[$header] = $head;
}
+ } else {
+ $array_headers = $cell->get_header(false);
+ $headers = array_merge($headers, $array_headers);
}
+ }
- $this->csvexport->add_data($headers);
+ $this->csvexport->add_data($headers);
- }
+ }
/**
* Add filename to the CSV
* @param $filename
* @return string
*/
- public function add_filename($filename) {
+ public function add_filename($filename) {
- $filename = clean_filename($filename);
- return $this->csvexport->filename = $filename.'.csv';
- }
+ $filename = clean_filename($filename);
+ return $this->csvexport->filename = $filename.'.csv';
+ }
/**
* Function to sort array in order of submission's lastname
@@ -264,9 +264,9 @@ public function other_assessors_cells() {
$increment = 2;
}
- for ($i = 1; $i < $this->coursework->get_max_markers(); $i++) {
- $cells = $cells + $increment; // one for grade, one for feedback
- }
+ for ($i = 1; $i < $this->coursework->get_max_markers(); $i++) {
+ $cells = $cells + $increment; // one for grade, one for feedback
+ }
return $cells;
diff --git a/classes/export/csv/cells/assessorfeedback_cell.php b/classes/export/csv/cells/assessorfeedback_cell.php
index e3062990..d1be9117 100644
--- a/classes/export/csv/cells/assessorfeedback_cell.php
+++ b/classes/export/csv/cells/assessorfeedback_cell.php
@@ -125,7 +125,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
}
if (!$this->coursework->allocation_enabled() && !empty($feedback)) {
- // Was this user the one who last graded this submission if not then user cannot grade
+ // Was this user the one who last graded this submission if not then user cannot grade
if ($feedback->assessorid != $USER->id || !has_capability('mod/coursework:editinitialgrade', $modulecontext) )
return get_string('nopermissiontogradesubmission', 'coursework');
diff --git a/classes/export/csv/cells/assessorgrade_cell.php b/classes/export/csv/cells/assessorgrade_cell.php
index 081148f0..ef991bbb 100644
--- a/classes/export/csv/cells/assessorgrade_cell.php
+++ b/classes/export/csv/cells/assessorgrade_cell.php
@@ -205,7 +205,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
}
if (!$this->coursework->allocation_enabled() && !empty($feedback)) {
- // Was this user the one who last graded this submission if not then user cannot grade
+ // Was this user the one who last graded this submission if not then user cannot grade
if ($feedback->assessorid != $USER->id || !has_capability('mod/coursework:editinitialgrade', $PAGE->context))
return get_string('nopermissiontogradesubmission', 'coursework');
@@ -246,9 +246,9 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
} else if (has_any_capability($agreedgradecap, $PAGE->context)) {
- // If you have the add agreed or edit agreed grades capabilities then you may have the grades on your export sheet
- // We will return true as we will ignore them
- return true;
+ // If you have the add agreed or edit agreed grades capabilities then you may have the grades on your export sheet
+ // We will return true as we will ignore them
+ return true;
} else {
return get_string('nopermissiontoimportgrade', 'coursework');
diff --git a/classes/export/csv/cells/cell_base.php b/classes/export/csv/cells/cell_base.php
index 563f8484..ff72d309 100644
--- a/classes/export/csv/cells/cell_base.php
+++ b/classes/export/csv/cells/cell_base.php
@@ -230,7 +230,7 @@ public function get_stage_identifier_for_assessor($submission, $student) {
} else if ($this->coursework->get_max_markers() > 1) {
// get existing feedback
- $sql = "SELECT * FROM {coursework_feedbacks}
+ $sql = "SELECT * FROM {coursework_feedbacks}
WHERE submissionid= $submission->id
AND assessorid = $USER->id
AND stage_identifier <> 'final_agreed_1'";
diff --git a/classes/export/csv/cells/moderationagreement_cell.php b/classes/export/csv/cells/moderationagreement_cell.php
index a989a1e2..12795ed6 100644
--- a/classes/export/csv/cells/moderationagreement_cell.php
+++ b/classes/export/csv/cells/moderationagreement_cell.php
@@ -62,12 +62,12 @@ public function get_cell($submission, $student, $stage_identifier) {
$data[] = $this->get_assessor_name($moderation_agreement->moderatorid);
$data[] = $this->get_assessor_username($moderation_agreement->moderatorid);
$data[] = userdate($moderation_agreement->timemodified, $this->dateformat);
- } else {
- $data[] = '';
- $data[] = '';
- $data[] = '';
- $data[] = '';
- }
+ } else {
+ $data[] = '';
+ $data[] = '';
+ $data[] = '';
+ $data[] = '';
+ }
return $data;
}
diff --git a/classes/export/csv/cells/otherassessors_cell.php b/classes/export/csv/cells/otherassessors_cell.php
index 66caf981..5b6bffda 100644
--- a/classes/export/csv/cells/otherassessors_cell.php
+++ b/classes/export/csv/cells/otherassessors_cell.php
@@ -42,8 +42,8 @@ public function get_cell($submission, $student, $stage_identifier) {
global $DB, $USER;
// find out current user stage identifier
- // $stage_identifier =
- // retrieve all feedbacks without currents user feedback
+ // $stage_identifier =
+ // retrieve all feedbacks without currents user feedback
$params = array(
'submissionid' => $submission->id,
@@ -59,7 +59,7 @@ public function get_cell($submission, $student, $stage_identifier) {
$feedbacks = $DB->get_records_sql($sql, $params);
$gradedata = [];
- // $stage_identifier = ($this->coursework->get_max_markers() == 1) ? "assessor_1" : $this->get_stage_identifier_for_assessor($submission, $student);
+ // $stage_identifier = ($this->coursework->get_max_markers() == 1) ? "assessor_1" : $this->get_stage_identifier_for_assessor($submission, $student);
foreach ($feedbacks as $feedback) {
$grade = $submission->get_assessor_feedback_by_stage($feedback->stage_identifier);
@@ -146,7 +146,7 @@ public function get_header($stage) {
}
$fields['otherassessorfeedback' . $i] = get_string('otherassessorfeedback', 'coursework', $i);
}
- return $fields;
+ return $fields;
}
}
diff --git a/classes/export/csv/cells/singlegrade_cell.php b/classes/export/csv/cells/singlegrade_cell.php
index 22c2d721..d56da8f4 100644
--- a/classes/export/csv/cells/singlegrade_cell.php
+++ b/classes/export/csv/cells/singlegrade_cell.php
@@ -160,7 +160,7 @@ public function validate_cell($value, $submissionid, $stage_identifier='', $uplo
$feedback = feedback::find($feedback_params);
if (!$this->coursework->allocation_enabled() && !empty($feedback)) {
- // Was this user the one who last graded this submission if not then user cannot grade
+ // Was this user the one who last graded this submission if not then user cannot grade
if ($feedback->assessorid != $USER->id || !has_capability('mod/coursework:editinitialgrade', $PAGE->context) && !has_capability('mod/coursework:administergrades', $PAGE->context))
return get_string('nopermissiontoeditgrade', 'coursework');
@@ -253,7 +253,7 @@ function get_rubrics($coursework, $csv_cells) {
// Find out the position of singlegrade
$position = array_search('singlegrade', $csv_cells);
// Get all data from the position of the singlegrade to the length of rubricheaders
- // $csv_cells = array_splice($csv_cells,5, 1, $rubricheaders);
+ // $csv_cells = array_splice($csv_cells,5, 1, $rubricheaders);
$start_cells = array_slice($csv_cells, 0, $position, true);
$end_cells = array_slice($csv_cells, $position + 1, count($csv_cells), true);
diff --git a/classes/export/csv/cells/submissiontime_cell.php b/classes/export/csv/cells/submissiontime_cell.php
index a7452bdf..205c186d 100644
--- a/classes/export/csv/cells/submissiontime_cell.php
+++ b/classes/export/csv/cells/submissiontime_cell.php
@@ -34,7 +34,7 @@ class submissiontime_cell extends cell_base {
* @return string
*/
public function get_cell($submission, $student, $stage_identifier) {
- return $this->submission_time($submission);
+ return $this->submission_time($submission);
}
/**
diff --git a/classes/export/grading_sheet.php b/classes/export/grading_sheet.php
index 1c8ea7aa..e3166847 100644
--- a/classes/export/grading_sheet.php
+++ b/classes/export/grading_sheet.php
@@ -35,7 +35,7 @@ public function get_submissions($groupid = null, $selected_submission_ids = '')
'courseworkid' => $this->coursework->id,
);
- $submissions = submission::find_all($params);
+ $submissions = submission::find_all($params);
// remove unfinalised submissions
foreach ($submissions as $submission) {
@@ -55,44 +55,44 @@ public function get_submissions($groupid = null, $selected_submission_ids = '')
/**
* @var submission[] $submissions
*/
- foreach ($submissions as $submission) {
- $stage_identifiers = [];
- // remove all submissions that a user is not supposed to see
-
- // double marking not allocated
- $stages = $this->coursework->get_max_markers();
- if ($stages > 1 && !$this->coursework->allocation_enabled() && !has_capability('mod/coursework:addagreedgrade', $PAGE->context)) {
- // if samplings enabled, work out how many per submission
- if ($this->coursework->sampling_enabled()) {
- $stage_identifiers[] = 'assessor_1'; // always have at least one assessor
- // check how many other assessors for this submission
- $in_sample = $submission->get_submissions_in_sample();
- foreach ($in_sample as $i) {
- $stage_identifiers[] = $i->stage_identifier;
- }
- } else { // if sampling not enabled, everyone is marked in all stages
- for ($i = 1; $i <= $stages; $i++) {
- $stage_identifiers[] = 'assessor_' . $i;
- }
- }
- // check if any of the submissions still requires marking
- for ($i = 0; $i < count($stage_identifiers); $i++) {
- $feedback = $submission->get_assessor_feedback_by_stage($stage_identifiers[$i]);
- // if no feedback or feedback belongs to current user don't remove submission
- if (!$feedback || $feedback->assessorid == $USER->id) {
- break;
- } else if ($i + 1 < count($stage_identifiers)) {
- continue;
- }
- // if the last submission was already marked remove it from the array
- unset($submissions[$submission->id]);
- }
- }
-
- // TODO - decide if already marked submissions should be displayed in single marking
- // if not marked by a user than dont display it as it would allow them to edit it??
- // || $submission->get_state() == submission::FINAL_GRADED
- if (!$ability->can('show', $submission)
+ foreach ($submissions as $submission) {
+ $stage_identifiers = [];
+ // remove all submissions that a user is not supposed to see
+
+ // double marking not allocated
+ $stages = $this->coursework->get_max_markers();
+ if ($stages > 1 && !$this->coursework->allocation_enabled() && !has_capability('mod/coursework:addagreedgrade', $PAGE->context)) {
+ // if samplings enabled, work out how many per submission
+ if ($this->coursework->sampling_enabled()) {
+ $stage_identifiers[] = 'assessor_1'; // always have at least one assessor
+ // check how many other assessors for this submission
+ $in_sample = $submission->get_submissions_in_sample();
+ foreach ($in_sample as $i) {
+ $stage_identifiers[] = $i->stage_identifier;
+ }
+ } else { // if sampling not enabled, everyone is marked in all stages
+ for ($i = 1; $i <= $stages; $i++) {
+ $stage_identifiers[] = 'assessor_' . $i;
+ }
+ }
+ // check if any of the submissions still requires marking
+ for ($i = 0; $i < count($stage_identifiers); $i++) {
+ $feedback = $submission->get_assessor_feedback_by_stage($stage_identifiers[$i]);
+ // if no feedback or feedback belongs to current user don't remove submission
+ if (!$feedback || $feedback->assessorid == $USER->id) {
+ break;
+ } else if ($i + 1 < count($stage_identifiers)) {
+ continue;
+ }
+ // if the last submission was already marked remove it from the array
+ unset($submissions[$submission->id]);
+ }
+ }
+
+ // TODO - decide if already marked submissions should be displayed in single marking
+ // if not marked by a user than dont display it as it would allow them to edit it??
+ // || $submission->get_state() == submission::FINAL_GRADED
+ if (!$ability->can('show', $submission)
|| ($stages == 1 && !has_capability('mod/coursework:addinitialgrade', $PAGE->context))
|| ($this->coursework->allocation_enabled() && !$this->coursework
->assessor_has_any_allocation_for_student($submission->reload()->get_allocatable())
@@ -105,12 +105,12 @@ public function get_submissions($groupid = null, $selected_submission_ids = '')
&& (has_capability('mod/coursework:addagreedgrade', $PAGE->context)
|| has_capability('mod/coursework:editagreedgrade', $PAGE->context)))
|| ((has_capability('mod/coursework:addagreedgrade', $PAGE->context) && $submission->get_state() < submission::FULLY_GRADED ))
- ) {
- unset($submissions[$submission->id]);
- continue;
- }
- }
- }
+ ) {
+ unset($submissions[$submission->id]);
+ continue;
+ }
+ }
+ }
return $submissions;
}
@@ -166,15 +166,15 @@ public static function cells_array($coursework) {
// based on capabilities decide what view display - singlegrade or multiplegrade
if ((has_capability('mod/coursework:addagreedgrade', $PAGE->context) || has_capability('mod/coursework:administergrades', $PAGE->context))
&& $coursework->get_max_markers() > 1 ) {
- for ($i = 1; $i <= $coursework->get_max_markers(); $i++) {
- // extra column with allocated assessor name
- if ($coursework->allocation_enabled() && $coursework->get_max_markers() > 1
+ for ($i = 1; $i <= $coursework->get_max_markers(); $i++) {
+ // extra column with allocated assessor name
+ if ($coursework->allocation_enabled() && $coursework->get_max_markers() > 1
&& (has_capability('mod/coursework:addinitialgrade', $PAGE->context)
|| has_capability('mod/coursework:editinitialgrade', $PAGE->context))) {
- $csv_cells[] = 'assessor' . $i;
- }
- $csv_cells[] = 'assessorgrade'.$i;
- $csv_cells[] = 'assessorfeedback'.$i;
+ $csv_cells[] = 'assessor' . $i;
+ }
+ $csv_cells[] = 'assessorgrade'.$i;
+ $csv_cells[] = 'assessorfeedback'.$i;
}
$csv_cells[] = 'agreedgrade';
$csv_cells[] = 'agreedfeedback';
@@ -192,9 +192,9 @@ public static function cells_array($coursework) {
} else if (has_capability('mod/coursework:addinitialgrade', $PAGE->context)
|| has_capability('mod/coursework:administergrades', $PAGE->context)) {
- // if (!$coursework->is_using_rubric()) {
+ // if (!$coursework->is_using_rubric()) {
$csv_cells[] = 'singlegrade';
- /* } else {
+ /* } else {
$criterias = $coursework->get_rubric_criteria();
@@ -204,7 +204,7 @@ public static function cells_array($coursework) {
}
}
- */
+ */
$csv_cells[] = 'feedbackcomments';
}
diff --git a/classes/export/import.php b/classes/export/import.php
index 5a8c87a5..437ecad8 100644
--- a/classes/export/import.php
+++ b/classes/export/import.php
@@ -141,15 +141,15 @@ public function validate_csv($content, $encoding, $delimeter, $csv_cells) {
$result = $cell->validate_cell($value, $submissionid, $stage_identifier, $uploadedgradecells);
}
- if ($result !== true) {
- $errors[$s] = $result;
- break; // Go to next line on error
- } else if ($cells[$i] == "singlegrade" || $cells[$i] == "assessorgrade" || $cells[$i] == "agreedgrade" && !empty($value)) {
+ if ($result !== true) {
+ $errors[$s] = $result;
+ break; // Go to next line on error
+ } else if ($cells[$i] == "singlegrade" || $cells[$i] == "assessorgrade" || $cells[$i] == "agreedgrade" && !empty($value)) {
- $uploadedgradecells[] = $stage_identifier;
+ $uploadedgradecells[] = $stage_identifier;
- }
- $i++;
+ }
+ $i++;
}
$s++;
}
@@ -203,10 +203,10 @@ function rubric_count_correct($csvheader, $linefromimportedcsv) {
unset($csvheader[$position + $offset]);
unset($linefromimportedcsv[$position + $offset]);
-// if ($type == 'agreedgrade' && $this->coursework->finalstagegrading == 0) {
+ // if ($type == 'agreedgrade' && $this->coursework->finalstagegrading == 0) {
array_splice($csvheader, $position + $offset, 0, array_keys($headers));
array_splice($linefromimportedcsv, $position + $offset, 0, array(''));
-// }
+ // }
$offset = $offset + count($headers) - 1;
$expectedsize = (int)count($csvheader);
$actualsize = (int)count($linefromimportedcsv);
@@ -344,9 +344,9 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
foreach ($csvline as $k => $v) {
if (substr($k, 0, 13) == 'assessorgrade' || substr($k, 0, 11) == 'singlegrade') {
- $stages[$k] = $this->get_stage_identifier($csvline['submissionid'], $k);
+ $stages[$k] = $this->get_stage_identifier($csvline['submissionid'], $k);
} else if (substr($k, 0, 11) == 'agreedgrade') {
- $stages[$k] = 'final_agreed_1';
+ $stages[$k] = 'final_agreed_1';
}
}
}
@@ -362,7 +362,7 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
foreach ($stages as $k => $stage) {
- // When allocation is enabled
+ // When allocation is enabled
if (has_capability('mod/coursework:administergrades', $PAGE->context) && $coursework->allocation_enabled() && $stage != 'final_agreed_1' && $coursework->has_multiple_markers() == true) {
$rubricoffset += 1;
if ($a == 1) $rubricoffsetstart += 1;
@@ -436,62 +436,62 @@ public function process_csv($content, $encoding, $delimiter, $csv_cells, $proces
$rubricoffset = $rubricoffset + $numberofrubrics + 1;
}
- $arrayvalues = array_filter($rubricdata);
+ $arrayvalues = array_filter($rubricdata);
- if (!empty($arrayvalues)) {
+ if (!empty($arrayvalues)) {
- //for ( $critidx < $numberofrubrics; ) {
- $critidx = 0;
- // This assumes that the data in the csv is in the correct criteria order.....it should be
- foreach ($criterias as $c) {
- $criteriagrade = [];
+ //for ( $critidx < $numberofrubrics; ) {
+ $critidx = 0;
+ // This assumes that the data in the csv is in the correct criteria order.....it should be
+ foreach ($criterias as $c) {
+ $criteriagrade = [];
- // We need to get the levelid for the value that the criteria has been given
+ // We need to get the levelid for the value that the criteria has been given
- $levelid = $this->get_value_rubric_levelid($c, $rubricdata[$critidx]);
+ $levelid = $this->get_value_rubric_levelid($c, $rubricdata[$critidx]);
- $criteriagrade['levelid'] = $levelid;
- $criteriagrade['remark'] = $rubricdata[$critidx + 1];
+ $criteriagrade['levelid'] = $levelid;
+ $criteriagrade['remark'] = $rubricdata[$critidx + 1];
- $criteriagradedata['criteria'][$c['id']] = $criteriagrade;
+ $criteriagradedata['criteria'][$c['id']] = $criteriagrade;
- $critidx = $critidx + 2;
+ $critidx = $critidx + 2;
- }
- } else {
- $criteriagradedata = false;
}
+ } else {
+ $criteriagradedata = false;
+ }
- // Need to decide where the grade instance submit and get grade should be put as in order
+ // 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;
+ // Pass the criteria data into the csvline position for the grade data so we can generate a grade
+ $csvline[$gradepointer] = $criteriagradedata;
- // In case there is another rubric to be extracted from the csv set the new value of the rubric offset
+ // In case there is another rubric to be extracted from the csv set the new value of the rubric offset
- } else if ($coursework->is_using_rubric() && ($stage == 'final_agreed_1' && $this->coursework->finalstagegrading == 1)) {
+ } else if ($coursework->is_using_rubric() && ($stage == 'final_agreed_1' && $this->coursework->finalstagegrading == 1)) {
- if (!isset($numberofrubrics)) {
+ if (!isset($numberofrubrics)) {
- $criterias = $this->coursework->get_rubric_criteria();
+ $criterias = $this->coursework->get_rubric_criteria();
- $numberofrubrics = count($criterias) * 2;
+ $numberofrubrics = count($criterias) * 2;
- }
- $stagemultiplier = $numberofstages - 1;
+ }
+ $stagemultiplier = $numberofstages - 1;
- // The calculation below finds the position of the agreed grades in the uploaded csv
+ // The calculation below finds the position of the agreed grades in the uploaded csv
- $rubricoffset = $rubricoffsetstart + $stagemultiplier + ($numberofrubrics * $stagemultiplier);
+ $rubricoffset = $rubricoffsetstart + $stagemultiplier + ($numberofrubrics * $stagemultiplier);
- if ($coursework->allocation_enabled()) $rubricoffset += 1;
+ if ($coursework->allocation_enabled()) $rubricoffset += 1;
- $gradearrvalue = array_slice($line, $rubricoffset, 2);
+ $gradearrvalue = array_slice($line, $rubricoffset, 2);
- $csvline[$gradepointer] = $gradearrvalue[0];
- $csvline[$feedbackpointer] = $gradearrvalue[1];
+ $csvline[$gradepointer] = $gradearrvalue[0];
+ $csvline[$feedbackpointer] = $gradearrvalue[1];
- }
+ }
// don't create/update feedback if grade is empty
if (!empty($csvline[$gradepointer])) {
@@ -566,7 +566,7 @@ public function add_grade($submissionid, $grade, $feedback, $stage_identifier, $
// workout markernumber
if ($stage_identifier == 'assessor_1') {
- // assessor_1 is always marker 1
+ // assessor_1 is always marker 1
$markernumber = 1;
} else {
// get all feedbacks and add 1
@@ -670,9 +670,9 @@ public function edit_grade($cwfeedbackid, $grade, $feedback, $uses_rubric=false)
$update = $DB->update_record('coursework_feedbacks', $edit_grade);
// if record updated and coursework has automatic grading enabled update agreedgrade
- if ($update && $this->coursework->automaticagreement_enabled()) {
- $this->auto_agreement($cwfeedbackid);
- }
+ if ($update && $this->coursework->automaticagreement_enabled()) {
+ $this->auto_agreement($cwfeedbackid);
+ }
}
return $update;
@@ -741,19 +741,19 @@ public function get_stage_identifier($submissionid, $cell_identifier) {
'stage_identifier' => 'assessor_1'));
// no sample or no feedback for sample yet
if (!$in_sample || ($in_sample && !$feedback)) {
- $stage_identifier = 'assessor_1';
+ $stage_identifier = 'assessor_1';
} else { // find out which sample wasn't graded yet
- $samples = $submission->get_submissions_in_sample();
- foreach ($samples as $sample) {
- $feedback = $DB->record_exists('coursework_feedbacks', array('submissionid' => $submissionid,
+ $samples = $submission->get_submissions_in_sample();
+ foreach ($samples as $sample) {
+ $feedback = $DB->record_exists('coursework_feedbacks', array('submissionid' => $submissionid,
'stage_identifier' => $sample->stage_identifier));
- // if feedback doesn't exist, we'll use this stage identifier for a new feedback
- if (!$feedback) {
- $stage_identifier = $sample->stage_identifier;
- break;
- }
- }
- }
+ // if feedback doesn't exist, we'll use this stage identifier for a new feedback
+ if (!$feedback) {
+ $stage_identifier = $sample->stage_identifier;
+ break;
+ }
+ }
+ }
}
}
@@ -791,9 +791,9 @@ public function auto_agreement($cwfeedbackid) {
$auto_grader->create_auto_grade_if_rules_match();
}
- public function remove_other_assessors_grade($csv_cells, &$line) {
+ public function remove_other_assessors_grade($csv_cells, &$line) {
- $otherassessors = false;
+ $otherassessors = false;
if (in_array('otherassessors', $csv_cells)) {
// find position of otherassesors so we know from which key to unset
@@ -820,7 +820,7 @@ public function remove_other_assessors_grade($csv_cells, &$line) {
}
- return $csv_cells;
+ return $csv_cells;
}
}
diff --git a/classes/file_importer.php b/classes/file_importer.php
index d41f4b5c..b73413ee 100644
--- a/classes/file_importer.php
+++ b/classes/file_importer.php
@@ -177,7 +177,7 @@ public function import_zip_files($coursework, $feedbackstage, $overwritecurrent)
$results[$filename] = get_string('feedbacksubmissionpublished', 'mod_coursework');
}
- } else {
+ } else {
$results[$filename] = get_string('feedbacknotfound', 'mod_coursework');
}
}
diff --git a/classes/forms/deadline_extension_form.php b/classes/forms/deadline_extension_form.php
index b6083172..5ea0553d 100644
--- a/classes/forms/deadline_extension_form.php
+++ b/classes/forms/deadline_extension_form.php
@@ -124,7 +124,7 @@ public function personal_deadline() {
'courseworkid' => $courseworkid,
);
- return $personal_deadline = $DB->get_record('coursework_person_deadlines', $params);
+ return $personal_deadline = $DB->get_record('coursework_person_deadlines', $params);
}
}
diff --git a/classes/forms/student_submission_form.php b/classes/forms/student_submission_form.php
index ff5bca7f..3c4695ac 100644
--- a/classes/forms/student_submission_form.php
+++ b/classes/forms/student_submission_form.php
@@ -183,7 +183,7 @@ public function handle() {
$mailer = new mailer($coursework);
if (!empty($notifyuser)) $mailer->send_submission_notification($notifyuser);
- }
+ }
}
}
diff --git a/classes/forms/upload_allocations_form.php b/classes/forms/upload_allocations_form.php
index 795d2847..be524829 100644
--- a/classes/forms/upload_allocations_form.php
+++ b/classes/forms/upload_allocations_form.php
@@ -39,7 +39,7 @@ function definition() {
$mform->addElement('filepicker', 'allocationsdata', get_string('allocationsfile', 'coursework'), null, array( 'accepted_types' => '*.csv'));
$mform->addRule('allocationsdata', null, 'required');
- // $mform->addElement('checkbox', 'overwrite', '', get_string('overwritegrades', 'coursework'));
+ // $mform->addElement('checkbox', 'overwrite', '', get_string('overwritegrades', 'coursework'));
$mform->addElement('hidden', 'cmid', $this->cmid);
$mform->setType('cmid', PARAM_RAW);
diff --git a/classes/grading_table_row_base.php b/classes/grading_table_row_base.php
index 1752b4ee..6c9a71c1 100644
--- a/classes/grading_table_row_base.php
+++ b/classes/grading_table_row_base.php
@@ -255,7 +255,7 @@ public function get_submission() {
*/
public function get_plagiarism_flag() {
- $submission = $this->get_submission();
+ $submission = $this->get_submission();
$params = array(
'submissionid' => $submission->id,
);
diff --git a/classes/models/moderation.php b/classes/models/moderation.php
index ca7808cd..db962a11 100644
--- a/classes/models/moderation.php
+++ b/classes/models/moderation.php
@@ -48,7 +48,7 @@ class moderation extends table_base {
/**
* @var int
*/
- public $feedbackid;
+ public $feedbackid;
/**
* @var int
@@ -113,8 +113,8 @@ public function get_agreement() {
* @return bool|submission
*/
public function get_submission() {
- $feedback = $this->get_feedback();
- $this->submission = submission::find($feedback->submissionid);
+ $feedback = $this->get_feedback();
+ $this->submission = submission::find($feedback->submissionid);
return $this->submission;
}
diff --git a/classes/models/outstanding_marking.php b/classes/models/outstanding_marking.php
index f6bc8fac..2d7d8a93 100644
--- a/classes/models/outstanding_marking.php
+++ b/classes/models/outstanding_marking.php
@@ -73,13 +73,13 @@ public function get_to_grade_agreed_count($cwkrecord, $userid) {
//AGREED GRADE INFORMATION
- if ($this->should_get_to_mark_agreed_grade_info($coursework->id, $userid) && $coursework->has_multiple_markers()) {
- if (!$coursework->sampling_enabled()) {
- $agreedsubmissions = $this->get_to_grade_agreed_grade_submissions($coursework->id, $coursework->get_max_markers());
- } else {
- $agreedsubmissions = $this->get_to_grade_agreed_grade_sampled_submissions($coursework->id);
- }
+ if ($this->should_get_to_mark_agreed_grade_info($coursework->id, $userid) && $coursework->has_multiple_markers()) {
+ if (!$coursework->sampling_enabled()) {
+ $agreedsubmissions = $this->get_to_grade_agreed_grade_submissions($coursework->id, $coursework->get_max_markers());
+ } else {
+ $agreedsubmissions = $this->get_to_grade_agreed_grade_sampled_submissions($coursework->id);
}
+ }
return (!empty($agreedsubmissions)) ? count($agreedsubmissions) : 0;
}
diff --git a/classes/render_helpers/grading_report/cells/_user_cell.php b/classes/render_helpers/grading_report/cells/_user_cell.php
index def69931..213a3428 100644
--- a/classes/render_helpers/grading_report/cells/_user_cell.php
+++ b/classes/render_helpers/grading_report/cells/_user_cell.php
@@ -48,7 +48,7 @@ public function get_table_cell($rowobject) {
*/
$user = $rowobject->get_allocatable();
- /* if ($rowobject->can_view_username()) {
+ /* if ($rowobject->can_view_username()) {
$content .= $OUTPUT->user_picture($user->get_raw_record());
} else {
$renderer = $PAGE->get_renderer('core');
@@ -69,28 +69,28 @@ public function get_table_cell($rowobject) {
*/
public function get_table_header($options = []) {
- $viewanonymous = has_capability('mod/coursework:viewanonymous', $this->coursework->get_context());
+ $viewanonymous = has_capability('mod/coursework:viewanonymous', $this->coursework->get_context());
//adding this line so that the sortable heading function will make a sortable link unique to the table
// If tablename is set
$tablename = (!empty($options['tablename'])) ? $options['tablename'] : '';
- // allow to sort users only if CW is not set to blind marking or a user has capability to view anonymous
- if ($viewanonymous || !$this->coursework->blindmarking) {
- $sort_by_first_name = $this->helper_sortable_heading(get_string('firstname'),
+ // allow to sort users only if CW is not set to blind marking or a user has capability to view anonymous
+ if ($viewanonymous || !$this->coursework->blindmarking) {
+ $sort_by_first_name = $this->helper_sortable_heading(get_string('firstname'),
'firstname',
$options['sorthow'],
$options['sortby'],
$tablename);
- $sort_by_last_name = $this->helper_sortable_heading(get_string('lastname'),
+ $sort_by_last_name = $this->helper_sortable_heading(get_string('lastname'),
'lastname',
$options['sorthow'],
$options['sortby'],
$tablename);
- } else { // otherwise display header without sorting
- $sort_by_first_name = get_string('firstname');
- $sort_by_last_name =get_string('lastname');
- }
+ } else { // otherwise display header without sorting
+ $sort_by_first_name = get_string('firstname');
+ $sort_by_last_name =get_string('lastname');
+ }
if ($this->fullname_format() == 'lf') {
$sort_by_name = $sort_by_last_name . ' / ' . $sort_by_first_name;
diff --git a/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php b/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php
index 07b72e25..1ab3ac31 100644
--- a/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php
+++ b/classes/render_helpers/grading_report/cells/moderation_agreement_cell.php
@@ -162,7 +162,7 @@ private function new_moderation_button($rowobject, $assessor) {
// moderation only done for single marking courseworks
$feedback = $rowobject->get_submission()->get_assessor_feedback_by_stage('assessor_1');
- $moderation_params = array(
+ $moderation_params = array(
'submission' => $rowobject->get_submission(),
'assessor' => $assessor,
'stage' => $this->stage,
diff --git a/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php b/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
index 3b01688b..d0dc6ed4 100644
--- a/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
+++ b/classes/render_helpers/grading_report/cells/multiple_agreed_grade_cell.php
@@ -79,8 +79,8 @@ public function get_content($rowobject) {
if ($finalfeedback !== false) {
$grade_judge = new grade_judge($this->coursework);
$content .= $grade_judge->grade_to_display($finalfeedback->get_grade());
- // $content .= html_writer::empty_tag('br');
- // $content .= ' by: ' . $finalfeedback->get_assesor_username();
+ // $content .= html_writer::empty_tag('br');
+ // $content .= ' by: ' . $finalfeedback->get_assesor_username();
}
// Edit/new link
@@ -150,13 +150,13 @@ public function get_content($rowobject) {
if ($finalfeedback !== false) {
$content .= html_writer::empty_tag('br');
- if ((!$this->coursework->sampling_enabled() || $rowobject->get_submission()->sampled_feedback_exists()) && ($finalfeedback->get_feedbacks_assessorid() == 0
+ if ((!$this->coursework->sampling_enabled() || $rowobject->get_submission()->sampled_feedback_exists()) && ($finalfeedback->get_feedbacks_assessorid() == 0
&& $finalfeedback->timecreated == $finalfeedback->timemodified)
|| $finalfeedback->lasteditedbyuser == 0) { // if the grade was automatically agreed
- $content .= "(".get_string('automaticagreement', 'coursework').")";
- } else {
- $content .= ' by: ' . $finalfeedback->get_assesor_username();
- }
+ $content .= "(".get_string('automaticagreement', 'coursework').")";
+ } else {
+ $content .= ' by: ' . $finalfeedback->get_assesor_username();
+ }
}
return $content;
}
diff --git a/classes/render_helpers/grading_report/cells/user_cell.php b/classes/render_helpers/grading_report/cells/user_cell.php
index 6eddeab0..acf601fd 100644
--- a/classes/render_helpers/grading_report/cells/user_cell.php
+++ b/classes/render_helpers/grading_report/cells/user_cell.php
@@ -43,7 +43,7 @@ public function get_table_cell($rowobject) {
$content = '';
- /* if ($rowobject->can_view_username()) {
+ /* if ($rowobject->can_view_username()) {
$content .= $OUTPUT->user_picture($user->get_raw_record());
} else {
$renderer = $PAGE->get_renderer('core');
@@ -56,7 +56,7 @@ public function get_table_cell($rowobject) {
$content .= ' ' . $rowobject->get_user_name(true);
$content .= "
".$rowobject->get_email();
$user = $rowobject->get_allocatable();
-/*
+ /*
$candidatenumber = $user->candidate_number();
if (!empty($candidatenumber)) {
@@ -65,7 +65,7 @@ public function get_table_cell($rowobject) {
}
-*/
+ */
return $this->get_new_cell_with_class($content);
}
@@ -76,35 +76,35 @@ public function get_table_cell($rowobject) {
*/
public function get_table_header($options = []) {
- $viewanonymous = has_capability('mod/coursework:viewanonymous', $this->coursework->get_context());
+ $viewanonymous = has_capability('mod/coursework:viewanonymous', $this->coursework->get_context());
//adding this line so that the sortable heading function will make a sortable link unique to the table
// If tablename is set
$tablename = (!empty($options['tablename'])) ? $options['tablename'] : '';
- // allow to sort users only if CW is not set to blind marking or a user has capability to view anonymous
- if ($viewanonymous || !$this->coursework->blindmarking) {
- $sort_by_first_name = $this->helper_sortable_heading(get_string('firstname'),
+ // allow to sort users only if CW is not set to blind marking or a user has capability to view anonymous
+ if ($viewanonymous || !$this->coursework->blindmarking) {
+ $sort_by_first_name = $this->helper_sortable_heading(get_string('firstname'),
'firstname',
$options['sorthow'],
$options['sortby'],
$tablename);
- $sort_by_last_name = $this->helper_sortable_heading(get_string('lastname'),
+ $sort_by_last_name = $this->helper_sortable_heading(get_string('lastname'),
'lastname',
$options['sorthow'],
$options['sortby'],
$tablename);
- $sort_by_email = $this->helper_sortable_heading(get_string('email', 'mod_coursework'),
+ $sort_by_email = $this->helper_sortable_heading(get_string('email', 'mod_coursework'),
'email',
$options['sorthow'],
$options['sortby'],
$tablename);
- } else { // otherwise display header without sorting
- $sort_by_first_name = get_string('firstname');
- $sort_by_last_name = get_string('lastname');
- $sort_by_email = get_string('email', 'mod_coursework');
- }
+ } else { // otherwise display header without sorting
+ $sort_by_first_name = get_string('firstname');
+ $sort_by_last_name = get_string('lastname');
+ $sort_by_email = get_string('email', 'mod_coursework');
+ }
if ($this->fullname_format() == 'lf') {
$sort_by_first_name = ' / ' . $sort_by_first_name;
diff --git a/classes/sample_set_rule/range_sample_type.php b/classes/sample_set_rule/range_sample_type.php
index 303fc868..bfb5f8f9 100644
--- a/classes/sample_set_rule/range_sample_type.php
+++ b/classes/sample_set_rule/range_sample_type.php
@@ -105,7 +105,7 @@ 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_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);
@@ -337,23 +337,23 @@ public function save_form_data($assessor_number=0, &$order=0) {
$sample_plugin = $DB->get_record('coursework_sample_set_plugin', array('rulename' => 'range_sample_type'));
- if ($sample_rules) {
- foreach ($sample_rules as $i => $val) {
+ if ($sample_rules) {
+ foreach ($sample_rules as $i => $val) {
- $dbrecord = new \stdClass();
+ $dbrecord = new \stdClass();
- $dbrecord->ruletype = $sample_type[$i];
- $dbrecord->lowerlimit = $sample_from[$i];
- $dbrecord->upperlimit = $sample_to[$i];
- $dbrecord->sample_set_plugin_id = $sample_plugin->id;
- $dbrecord->courseworkid = $this->coursework->id;
- $dbrecord->ruleorder = $order;
- $dbrecord->stage_identifier = "assessor_{$assessor_number}";
+ $dbrecord->ruletype = $sample_type[$i];
+ $dbrecord->lowerlimit = $sample_from[$i];
+ $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}";
- $DB->insert_record("coursework_sample_set_rules", $dbrecord);
- $order++;
- }
+ $DB->insert_record("coursework_sample_set_rules", $dbrecord);
+ $order++;
}
+ }
}
@@ -404,35 +404,35 @@ private function rationalise($ruletype, $limit1, $limit2) {
$limits[0] = ($limit1>$limit2) ? $limit2 : $limit1;
$limits[1] = ($limit1>$limit2) ? $limit1 : $limit2;
- if ($ruletype == 'scale') {
- ++$limits[0];
- ++$limits[1];
- }
-
- if ($ruletype == 'percentage') {
- if ($this->coursework->grade > 0) {
- $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)));
+ if ($ruletype == 'scale') {
+ ++$limits[0];
+ ++$limits[1];
+ }
- if ($scale) {
+ if ($ruletype == 'percentage') {
+ if ($this->coursework->grade > 0) {
+ $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)));
- $coursework_scale = explode(",", $scale->scale);
+ if ($scale) {
- $number_of_items = count($coursework_scale);
+ $coursework_scale = explode(",", $scale->scale);
- $weighting = 100 / $number_of_items; // shall we round it????
+ $number_of_items = count($coursework_scale);
- $limits[0] = ceil($limits[0]/$weighting); // element of array
- $limits[1] = ceil($limits[1]/$weighting); // element of array
+ $weighting = 100 / $number_of_items; // shall we round it????
- // Note we have to add one as the values are not stored in there element positions
+ $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
}
+
}
+ }
return $limits;
}
@@ -453,7 +453,7 @@ private function get_allocatables_in_range($stage, $limit1, $limit2) {
// Note as things stand limit1 and limit2 can not be params as the type of the grade field (varchar)
//means the values are cast as strings
- return $DB->get_records_sql($sql, array('courseworkid' => $this->coursework->id,
+ return $DB->get_records_sql($sql, array('courseworkid' => $this->coursework->id,
'stage' => $stage));
}
diff --git a/classes/sample_set_rule/total_sample_type.php b/classes/sample_set_rule/total_sample_type.php
index f1993680..38bb27a4 100644
--- a/classes/sample_set_rule/total_sample_type.php
+++ b/classes/sample_set_rule/total_sample_type.php
@@ -219,15 +219,15 @@ public function adjust_sample_set($stage_number, &$allocatables, &$manual_sample
if (!is_array($array_keys)) $array_keys = array($array_keys);
//use the allocatables array to get other ungraded allocatables
- foreach ($array_keys as $id) {
+ foreach ($array_keys as $id) {
- if (!isset($published[$id]) && !isset($finalised[$id])
- && !isset($auto_sample_set[$id]) && !isset($manual_sample_set[$id])
- )
- $auto_sample_set[$id] = $allocatables[$id];
+ if (!isset($published[$id]) && !isset($finalised[$id])
+ && !isset($auto_sample_set[$id]) && !isset($manual_sample_set[$id])
+ )
+ $auto_sample_set[$id] = $allocatables[$id];
- if (count($auto_sample_set) == $total_to_return) break;
- }
+ if (count($auto_sample_set) == $total_to_return) break;
+ }
}
diff --git a/classes/warnings.php b/classes/warnings.php
index b05f450c..5f86c68b 100644
--- a/classes/warnings.php
+++ b/classes/warnings.php
@@ -224,41 +224,41 @@ public function manual_allocation_not_completed() {
for ($i = 1; $i <= $coursework_stages; $i++) {
$assessor = 'assessor_'.$i;
- if ($coursework->samplingenabled == 0 || $assessor == 'assessor_1') {
- $allocatables = $coursework->get_allocatables();
+ if ($coursework->samplingenabled == 0 || $assessor == 'assessor_1') {
+ $allocatables = $coursework->get_allocatables();
- foreach ($allocatables as $allocatable) {
+ foreach ($allocatables as $allocatable) {
- $params = array('courseworkid' => $coursework->id,
- 'stageidentifier' => $assessor,
- 'allocatableid' => $allocatable->id);
+ $params = array('courseworkid' => $coursework->id,
+ 'stageidentifier' => $assessor,
+ 'allocatableid' => $allocatable->id);
- $existing_allocations = $this->check_existing_allocations($params);
+ $existing_allocations = $this->check_existing_allocations($params);
- if ($existing_allocations == false) {
- return $this->alert_div(get_string('assessors_no_allocated_warning', 'mod_coursework'));
- }
- }
- } else {
+ if ($existing_allocations == false) {
+ return $this->alert_div(get_string('assessors_no_allocated_warning', 'mod_coursework'));
+ }
+ }
+ } else {
- $params = array('courseworkid' => $coursework->id);
- $sql = "SELECT id, stage_identifier, allocatableid
+ $params = array('courseworkid' => $coursework->id);
+ $sql = "SELECT id, stage_identifier, allocatableid
FROM {coursework_sample_set_mbrs}
WHERE courseworkid = :courseworkid";
- $stage_identifiers = $DB->get_records_sql($sql, $params);
- foreach ($stage_identifiers as $stage_identifier) {
- $params = array('courseworkid' => $coursework->id,
- 'stageidentifier' => $stage_identifier->stage_identifier,
- 'allocatableid' => $stage_identifier->allocatableid);
+ $stage_identifiers = $DB->get_records_sql($sql, $params);
+ foreach ($stage_identifiers as $stage_identifier) {
+ $params = array('courseworkid' => $coursework->id,
+ 'stageidentifier' => $stage_identifier->stage_identifier,
+ 'allocatableid' => $stage_identifier->allocatableid);
- $existing_allocations = $this->check_existing_allocations($params);
+ $existing_allocations = $this->check_existing_allocations($params);
- if ($existing_allocations == false) {
- return $this->alert_div(get_string('assessors_no_allocated_warning', 'mod_coursework'));
- }
- }
- }
+ if ($existing_allocations == false) {
+ return $this->alert_div(get_string('assessors_no_allocated_warning', 'mod_coursework'));
+ }
+ }
+ }
}
return '';
}
@@ -275,7 +275,7 @@ public function check_existing_allocations($params) {
AND stage_identifier = :stageidentifier
AND allocatableid = :allocatableid";
- return $existing_allocations = $DB->get_records_sql($sql, $params);
+ return $existing_allocations = $DB->get_records_sql($sql, $params);
}
diff --git a/db/upgrade.php b/db/upgrade.php
index 11960664..b41f65c1 100644
--- a/db/upgrade.php
+++ b/db/upgrade.php
@@ -2496,7 +2496,7 @@ function xmldb_coursework_upgrade($oldversion) {
$cwk->renamefiles = ($cwk->blindmarking == 1 || $courseworkhassubmissions) ? 1 : 0;
$DB->update_record('coursework', $cwk);
- }
+ }
// Coursework savepoint reached.
upgrade_mod_savepoint(true, 2019121403, 'coursework');
diff --git a/lib.php b/lib.php
index 1fb5062a..5dc3b10d 100644
--- a/lib.php
+++ b/lib.php
@@ -276,21 +276,21 @@ 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
- $togradeinitialcount = $outstandingmarking->get_to_grade_initial_count($dbcoursework, $user->id());
- $name = ($coursework->has_multiple_markers()) ? get_string('initialgrade', 'coursework') : get_string('grade', 'mod_coursework');
- $itemcount = $togradeinitialcount;
+ if ($event->eventtype == 'initialgradingdue') {
+ // Initial grades
+ $togradeinitialcount = $outstandingmarking->get_to_grade_initial_count($dbcoursework, $user->id());
+ $name = ($coursework->has_multiple_markers()) ? get_string('initialgrade', 'coursework') : get_string('grade', 'mod_coursework');
+ $itemcount = $togradeinitialcount;
- } else if ($event->eventtype == 'agreedgradingdue') {
- // Agreed grades
- $togradeagreedcount = $outstandingmarking->get_to_grade_agreed_count($dbcoursework, $user->id());
- $name = get_string('agreedgrade', 'coursework');
- $itemcount = $togradeagreedcount;
+ } else if ($event->eventtype == 'agreedgradingdue') {
+ // Agreed grades
+ $togradeagreedcount = $outstandingmarking->get_to_grade_agreed_count($dbcoursework, $user->id());
+ $name = get_string('agreedgrade', 'coursework');
+ $itemcount = $togradeagreedcount;
- }
+ }
$submission_url = new \moodle_url('/mod/coursework/view.php', array('id' => $cm->id));
@@ -517,45 +517,45 @@ function coursework_update_instance($coursework) {
*
* @param $coursework
*/
- function coursework_update_events($coursework, $eventtype) {
- global $DB;
-
- $event = "";
- $eventid = $DB->get_record('event', array('modulename' => 'coursework', 'instance' => $coursework->id, 'eventtype' => $eventtype));
-
- if ($eventid) {
- $event = calendar_event::load($eventid->id);
- }
-
- // Update/create event for coursework deadline [due]
- if ($eventtype == 'due') {
- $data = \mod_coursework\calendar::coursework_event($coursework, $eventtype, $coursework->deadline);
- if ($event) {
- $event->update($data); //update if event exists
- } else {
- calendar_event::create($data); // Create new event as it doesn't exist
- }
- }
-
- // Update/create event for coursework initialmarking deadline [initialgradingdue]
- if ($eventtype == 'initialgradingdue') {
- $data = \mod_coursework\calendar::coursework_event($coursework, $eventtype, $coursework->initialmarkingdeadline);
- if ($event) {
- $event->update($data); //update if event exists
- } else {
- calendar_event::create($data); // Create new event as it doesn't exist
- }
- }
-
- // Update/create event for coursework agreedgrademarking deadline [agreedgradingdue]
- if ($eventtype == 'agreedgradingdue') {
- $data = \mod_coursework\calendar::coursework_event($coursework, $eventtype, $coursework->agreedgrademarkingdeadline);
- if ($event) {
- $event->update($data); //update if event exists
- } else {
- calendar_event::create($data); // Create new event as it doesn't exist
- }
- }
+function coursework_update_events($coursework, $eventtype) {
+ global $DB;
+
+ $event = "";
+ $eventid = $DB->get_record('event', array('modulename' => 'coursework', 'instance' => $coursework->id, 'eventtype' => $eventtype));
+
+ if ($eventid) {
+ $event = calendar_event::load($eventid->id);
+ }
+
+ // Update/create event for coursework deadline [due]
+ if ($eventtype == 'due') {
+ $data = \mod_coursework\calendar::coursework_event($coursework, $eventtype, $coursework->deadline);
+ if ($event) {
+ $event->update($data); //update if event exists
+ } else {
+ calendar_event::create($data); // Create new event as it doesn't exist
+ }
+ }
+
+ // Update/create event for coursework initialmarking deadline [initialgradingdue]
+ if ($eventtype == 'initialgradingdue') {
+ $data = \mod_coursework\calendar::coursework_event($coursework, $eventtype, $coursework->initialmarkingdeadline);
+ if ($event) {
+ $event->update($data); //update if event exists
+ } else {
+ calendar_event::create($data); // Create new event as it doesn't exist
+ }
+ }
+
+ // Update/create event for coursework agreedgrademarking deadline [agreedgradingdue]
+ if ($eventtype == 'agreedgradingdue') {
+ $data = \mod_coursework\calendar::coursework_event($coursework, $eventtype, $coursework->agreedgrademarkingdeadline);
+ if ($event) {
+ $event->update($data); //update if event exists
+ } else {
+ calendar_event::create($data); // Create new event as it doesn't exist
+ }
+ }
}
/**
@@ -837,7 +837,7 @@ function coursework_extend_settings_navigation(settings_navigation $settings, na
function coursework_role_assigned_event_handler($roleassignment) {
global $DB;
-// return true; // Until we fix the auto allocator. The stuff below causes an infinite loop.
+ // return true; // Until we fix the auto allocator. The stuff below causes an infinite loop.
$courseworkids = coursework_get_coursework_ids_from_context_id($roleassignment->contextid);
@@ -992,7 +992,7 @@ function coursework_send_deadline_changed_emails($eventdata) {
// No need to send emails if none of the deadlines have changed.
- // echo 'Starting to send Coursework deadline changed emails...';
+ // echo 'Starting to send Coursework deadline changed emails...';
$counter = 0;
$coursework = coursework::find($eventdata->other['courseworkid']);
@@ -1074,7 +1074,7 @@ function coursework_send_deadline_changed_emails($eventdata) {
message_send($messagedata);
}
- // echo 'Sent '.$counter.' messages.';
+ // echo 'Sent '.$counter.' messages.';
return true;
}
@@ -1286,39 +1286,39 @@ function course_group_member_removed($event_data) {
}
} else {
// find all individual students in the group
- $students = get_enrolled_users($coursework->get_context(), 'mod/coursework:submit', $groupid);
- if ($students) {
- foreach ($students as $student) {
- if (can_delete_allocation($coursework->id(), $student->id)) {
- $DB->delete_records('coursework_allocation_pairs', array('courseworkid' => $coursework->id(), 'assessorid' => $removeduserid, 'allocatableid' => $student->id, 'stage_identifier' => 'assessor_1'));
- }
- }
- } else {
- continue;
- }
+ $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)) {
+ $DB->delete_records('coursework_allocation_pairs', array('courseworkid' => $coursework->id(), 'assessorid' => $removeduserid, 'allocatableid' => $student->id, 'stage_identifier' => 'assessor_1'));
+ }
+ }
+ } else {
+ continue;
+ }
}
// check if there are any other assessor in the group, at this point the removed member should no longer be in the group
$assessors_in_group = get_enrolled_users($coursework->get_context(), 'mod/coursework:addinitialgrade', $groupid);
- if ($assessors_in_group) { // if another assessor found, assign all allocatables in this group to the other assessor
- if ($coursework->is_configured_to_have_group_submissions()) {// yes - assign the assessor to a allocatable group
- $stage_1->make_auto_allocation_if_necessary(group::find($groupid));
- } else {
- $allocatables = $coursework->get_allocatables();
- if ($allocatables) {
- // yes - assign this assessor to every allocatable student in the appropriate course group
- foreach ($allocatables as $allocatable) {
- // process students allocations
- $stage_1->make_auto_allocation_if_necessary($allocatable);
- }
- } else {// no - do nothing, return true
- continue;
- }
- }
- } else {
- continue;
- }
+ if ($assessors_in_group) { // if another assessor found, assign all allocatables in this group to the other assessor
+ if ($coursework->is_configured_to_have_group_submissions()) {// yes - assign the assessor to a allocatable group
+ $stage_1->make_auto_allocation_if_necessary(group::find($groupid));
+ } else {
+ $allocatables = $coursework->get_allocatables();
+ if ($allocatables) {
+ // yes - assign this assessor to every allocatable student in the appropriate course group
+ foreach ($allocatables as $allocatable) {
+ // process students allocations
+ $stage_1->make_auto_allocation_if_necessary($allocatable);
+ }
+ } else {// no - do nothing, return true
+ continue;
+ }
+ }
+ } else {
+ continue;
+ }
} else if ($student) {
if ($coursework->is_configured_to_have_group_submissions()) {
// check if student was the only student member in the group
@@ -1385,7 +1385,7 @@ function can_delete_allocation($courseworkid, $allocatableid) {
* @param $course_module_id
* @return string
*/
- function plagiarism_similarity_information($course_module) {
+function plagiarism_similarity_information($course_module) {
$html = '';
ob_start();
@@ -1451,7 +1451,7 @@ function coursework_personal_deadline_passed($courseworkid) {
WHERE courseworkid = :courseworkid
AND personal_deadline < :now";
- return $DB->record_exists_sql($sql, array('courseworkid' => $courseworkid, 'now' => time()));
+ return $DB->record_exists_sql($sql, array('courseworkid' => $courseworkid, 'now' => time()));
}
diff --git a/mod_form.php b/mod_form.php
index a2caea1b..d584ca28 100644
--- a/mod_form.php
+++ b/mod_form.php
@@ -69,13 +69,13 @@ public function definition() {
$this->add_submission_deadline_field();
$this->add_personal_deadline_field();
- // if (coursework_is_ulcc_digest_coursework_plugin_installed()) {
+ // if (coursework_is_ulcc_digest_coursework_plugin_installed()) {
$this->add_marking_deadline_field();
$this->add_initial_marking_deadline_field();
$this->add_agreed_grade_marking_deadline_field();
$this->add_relative_initial_marking_deadline_field();
$this->add_relative_agreed_grade_marking_deadline_field();
- // }
+ // }
$this->add_allow_early_finalisation_field();
$this->add_allow_late_submissions_field();
@@ -191,11 +191,11 @@ public function validation($data, $files) {
$errors = [];
- if ($data['startdate'] != 0 && !empty($data['deadline']) && $data['startdate'] > $data['deadline']) {
- $errors['startdate'] = get_string('must_be_before_dealdine', 'mod_coursework');
- }
+ if ($data['startdate'] != 0 && !empty($data['deadline']) && $data['startdate'] > $data['deadline']) {
+ $errors['startdate'] = get_string('must_be_before_dealdine', 'mod_coursework');
+ }
- if ($data['individualfeedback'] != 0 && !empty($data['deadline']) && $data['individualfeedback'] < $data['deadline']) {
+ if ($data['individualfeedback'] != 0 && !empty($data['deadline']) && $data['individualfeedback'] < $data['deadline']) {
$errors['individualfeedback'] = get_string('must_be_after_dealdine', 'mod_coursework');
}
@@ -262,7 +262,7 @@ function get_data() {
}
if ($this->forceblindmarking() == 1) {
- $data->blindmarking = $CFG->coursework_blindmarking;
+ $data->blindmarking = $CFG->coursework_blindmarking;
}
if ($data->numberofmarkers > 1) {
@@ -522,7 +522,7 @@ protected function add_agreed_grade_marking_deadline_field() {
array('optional' => true, 'disabled' => $disabled)
);
- // $moodle_form->disabledIf('agreedgrademarkingdeadline', 'numberofmarkers', 'eq', '1');
+ // $moodle_form->disabledIf('agreedgrademarkingdeadline', 'numberofmarkers', 'eq', '1');
if (!empty($CFG->coursework_agreed_marking_deadline)) $moodle_form->setDefault('agreedgrademarkingdeadline', $default_timestamp);
$moodle_form->addHelpButton('agreedgrademarkingdeadline', 'agreedgrademarkingdeadline', 'mod_coursework');
@@ -715,7 +715,7 @@ protected function add_max_file_size_field() {
get_string('maximumsize', 'coursework'),
$choices);
$moodle_form->setDefault('maxbytes', $CFG->coursework_maxbytes);
- /* $moodle_form->addElement('static',
+ /* $moodle_form->addElement('static',
'maxbyteslabel',
'',
get_string('maximumsizelabel', 'coursework'));*/
@@ -1039,7 +1039,7 @@ protected function add_individual_feedback_release_date_field() {
$moodle_form->disabledIf('individualfeedback', 'forceautorelease', 'eq', 1);
}
$moodle_form->disabledIf('individualfeedback', 'deadline[enabled]', 'notchecked');
-// $moodle_form->addRule(array('individualfeedback', 'deadline'), get_string('must_be_after_dealdine', 'mod_coursework'), 'compare', 'gt');
+ // $moodle_form->addRule(array('individualfeedback', 'deadline'), get_string('must_be_after_dealdine', 'mod_coursework'), 'compare', 'gt');
}
/**
@@ -1112,16 +1112,16 @@ protected function add_tweaks_to_standard_grading_form_elements() {
$moodle_form->disabledIf('finalstagegrading', 'feedbackexists', 'eq', 1);
// Don't think this belongs here...
-// $options = array(0 => get_string('no'), 1 => get_string('yes'));
-// $moodle_form->addElement('select', 'automaticagreement', get_string('automaticagreement', 'mod_coursework'), $options);
-// $moodle_form->addHelpButton('automaticagreement', 'automaticagreement', 'mod_coursework');
-// $moodle_form->setDefault('automaticagreement',0);
-// $moodle_form->disabledIf('automaticagreement', 'numberofmarkers', 'eq', '1');
-//
-// $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');
+ // $options = array(0 => get_string('no'), 1 => get_string('yes'));
+ // $moodle_form->addElement('select', 'automaticagreement', get_string('automaticagreement', 'mod_coursework'), $options);
+ // $moodle_form->addHelpButton('automaticagreement', 'automaticagreement', 'mod_coursework');
+ // $moodle_form->setDefault('automaticagreement',0);
+ // $moodle_form->disabledIf('automaticagreement', 'numberofmarkers', 'eq', '1');
+ //
+ // $moodle_form->addElement('text', 'automaticagreementrange', get_string('automaticagreementrange', 'mod_coursework'), array('size' => 3));
+ // $moodle_form->addHelpButton('automaticagreementrange', 'automaticagreementrange', 'mod_coursework');
+ // $moodle_form->setDefault('automaticagreementrange',0);
+ // $moodle_form->disabledIf('automaticagreementrange', 'automaticagreement', 'eq', '0');
}
diff --git a/renderers/object_renderer.php b/renderers/object_renderer.php
index ae12d656..f7e6f71f 100644
--- a/renderers/object_renderer.php
+++ b/renderers/object_renderer.php
@@ -791,10 +791,10 @@ public function render_mod_coursework_sampling_set_widget(mod_coursework_samplin
$comma = "";
- for ($i = 0; $i <= $samplingwidget->get_coursework()->grade; $i++) {
- $scale .= $comma.$i;
- $comma = ",";
- }
+ for ($i = 0; $i <= $samplingwidget->get_coursework()->grade; $i++) {
+ $scale .= $comma.$i;
+ $comma = ",";
+ }
} else {
$grade_scale = \grade_scale::fetch(array('id' => abs($samplingwidget->get_coursework()->grade)));
$scale = $grade_scale->scale;
@@ -1100,7 +1100,7 @@ protected function get_sampling_strategy_form_elements($coursework, $assessor_nu
//$fullclasspaths = glob($classdir . '/*.php');
foreach ($sampleplugins as $plugin) {
- /* if (strpos($fullclassname, 'base') !== false) {
+ /* if (strpos($fullclassname, 'base') !== false) {
continue;
}*/
preg_match('/([^\/]+).php/', $classdir."/".$plugin->rulename.".php", $matches);
@@ -1792,22 +1792,22 @@ public function get_submissions_for_assessor($coursework, $submissions) {
} else if (is_siteadmin($USER) || !$coursework->allocation_enabled() || has_any_capability(array('mod/coursework:administergrades'), $coursework->get_context())) {
- foreach ($submissions as $sub) {
- $submission = submission::find($sub);
- $gradeblesub[$submission->id] = $submission;
- }
+ foreach ($submissions as $sub) {
+ $submission = submission::find($sub);
+ $gradeblesub[$submission->id] = $submission;
+ }
- } else {
- foreach ($submissions as $sub) {
- $submission = submission::find($sub);
- if ($coursework->assessor_has_any_allocation_for_student($submission->reload()->get_allocatable()) || (has_capability('mod/coursework:addagreedgrade', $coursework->get_context()))
- && !empty($submission) && (($submission->all_inital_graded() && !$submission->get_coursework()->sampling_enabled())
- || ($submission->get_coursework()->sampling_enabled() && $submission->all_inital_graded() && $submission->max_number_of_feedbacks() > 1))) {
+ } else {
+ foreach ($submissions as $sub) {
+ $submission = submission::find($sub);
+ if ($coursework->assessor_has_any_allocation_for_student($submission->reload()->get_allocatable()) || (has_capability('mod/coursework:addagreedgrade', $coursework->get_context()))
+ && !empty($submission) && (($submission->all_inital_graded() && !$submission->get_coursework()->sampling_enabled())
+ || ($submission->get_coursework()->sampling_enabled() && $submission->all_inital_graded() && $submission->max_number_of_feedbacks() > 1))) {
- $gradeblesub[$submission->id] = $submission;
- }
+ $gradeblesub[$submission->id] = $submission;
}
}
+ }
return $gradeblesub;
}
diff --git a/settings.php b/settings.php
index b6ec8765..996c28b1 100644
--- a/settings.php
+++ b/settings.php
@@ -169,7 +169,7 @@
get_string('maximum_extension_deadline_desc', 'coursework'),
18, PARAM_INT, 2));
- // Default per page
+ // Default per page
$options = array('3' => '3', '10' => '10', '20' => '20', '30' => '30', '40' => '40', '50' => '50', '100' => '100');
diff --git a/view.php b/view.php
index 90805981..af5a7c82 100644
--- a/view.php
+++ b/view.php
@@ -339,7 +339,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;
From 4f2d22c2496c19929ada1c859c99fbe969907c94 Mon Sep 17 00:00:00 2001
From: David Watson <14983002+watson8@users.noreply.github.com>
Date: Tue, 3 Sep 2024 09:47:43 +0100
Subject: [PATCH 05/27] CTP-3690 boilerplate comment
---
classes/event/assessable_uploaded.php | 1 +
classes/forms/upload_allocations_form.php | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/classes/event/assessable_uploaded.php b/classes/event/assessable_uploaded.php
index 7b3a4cc9..fe25b149 100644
--- a/classes/event/assessable_uploaded.php
+++ b/classes/event/assessable_uploaded.php
@@ -13,6 +13,7 @@
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see
'; - $table_html .= $allocatable_cell_helper->get_table_header($allocation_table->get_options()); - $table_html .= ' | '; + $allocatablecellhelper = $allocationtable->get_allocatable_cell(); + $tablehtml .= ''; + $tablehtml .= $allocatablecellhelper->get_table_header($allocationtable->get_options()); + $tablehtml .= ' | '; $no = 0; - foreach ($allocation_table->marking_stages() as $stage) { + foreach ($allocationtable->marking_stages() as $stage) { if ($stage->uses_allocation()) { - $table_html .= ''; + $tablehtml .= ' | '; // pin all checkbox - $checkbox_title = get_string('selectalltopin', 'coursework'); + $checkboxtitle = get_string('selectalltopin', 'coursework'); if ($stage->allocation_table_header() == 'Assessor') { $no++; if ($stage->stage_has_allocation() ) {// has any pins - $table_html .= ''; + $tablehtml .= ''; } - $table_html .= $stage->allocation_table_header() . ' ' . $no; - } else if ($allocation_table->get_coursework()->moderation_agreement_enabled()) { + $tablehtml .= $stage->allocation_table_header() . ' ' . $no; + } else if ($allocationtable->get_coursework()->moderation_agreement_enabled()) { //moderator header if ($stage->stage_has_allocation() ) {// has any pins - $table_html .= ''; + $tablehtml .= ''; } - $table_html .= get_string('moderator', 'coursework'); + $tablehtml .= get_string('moderator', 'coursework'); } else { - $table_html .= $stage->allocation_table_header(); + $tablehtml .= $stage->allocation_table_header(); } - $table_html .= ' | '; + $tablehtml .= ''; } } - $table_html .= ' + $tablehtml .= ' '; - $rowdata = $allocation_table->get_table_rows_for_page(); + $rowdata = $allocationtable->get_table_rows_for_page(); foreach ($rowdata as $row) { - $table_html .= $this->render_allocation_table_row($row); + $tablehtml .= $this->render_allocation_table_row($row); } - $table_html .= ' + $tablehtml .= '
---|
'.$deadline_header_text.' | -'. $deadline_date.' - '.$deadline_extension_message.' - '. $deadline_message.' |
+ '.$deadlineheadertext.' | +'. $deadlinedate.' + '.$deadlineextensionmessage.' + '. $deadlinemessage.' |
---|---|---|---|
'. $general_feedback_header.' | -'. $general_feedback_deadline_message.' | +'. $generalfeedbackheader.' | +'. $generalfeedbackdeadlinemessage.' |
'. $individual_feedback_header.' | -'. $indivisual_feedback_message.' | +'. $individualfeedbackheader.' | +'. $indivisualfeedbackmessage.' |
'.get_string('participants', 'mod_coursework').' | '.$participants.' |
---|---|
'.get_string('participants', 'mod_coursework').' | '.$participants.' |
'.get_string('submitted', 'mod_coursework').' | '.$submitted.' |
'.get_string('submitted', 'mod_coursework').' | '.$submitted.' |
'.get_string('needsgrading', 'mod_coursework').' | '.$needsgrading.' |
'.get_string('needsgrading', 'mod_coursework').' | '.$needsgrading.' |
' . get_string('graded', 'mod_coursework') . $stagename . $gradedHeader . ' | ' . $graded . ' |
' . get_string('graded', 'mod_coursework') . $stagename . $gradedheader . ' | ' . $graded . ' |
' . get_string('graded', 'mod_coursework') . $stagename . $gradedHeader . ' | ' . $finalgrade . ' |
' . get_string('graded', 'mod_coursework') . $stagename . $gradedheader . ' | ' . $finalgrade . ' |
'.get_string('gradedandpublished', 'mod_coursework').' | '.$published.' |
'.get_string('gradedandpublished', 'mod_coursework').' | '.$published.' |