diff --git a/classes/controllers/feedback_controller.php b/classes/controllers/feedback_controller.php index ff1a50e..5198524 100644 --- a/classes/controllers/feedback_controller.php +++ b/classes/controllers/feedback_controller.php @@ -116,8 +116,14 @@ protected function new_feedback() { } $ability = new ability(user::find($USER), $this->coursework); - $ability->require_can('new', $teacherfeedback); - + if (!$ability->can('new', $teacherfeedback)) { + if ($this->params['ajax']) { + echo json_encode(['success' => false, 'message' => $ability->get_last_message()]); + die(); + } else { + throw new access_denied($this->coursework, $ability->get_last_message()); + } + } $this->check_stage_permissions($this->params['stage_identifier']); $urlparams = []; diff --git a/classes/models/outstanding_marking.php b/classes/models/outstanding_marking.php index 3c615e1..426da50 100644 --- a/classes/models/outstanding_marking.php +++ b/classes/models/outstanding_marking.php @@ -24,13 +24,6 @@ class outstanding_marking { - private $dayinsecs; - - public function __construct() { - - $this->day_in_secs = 86400; - } - /** * @param $cwkrecord * @param $userid diff --git a/classes/test_helpers/factory_mixin.php b/classes/test_helpers/factory_mixin.php index 2d40525..0cfa532 100644 --- a/classes/test_helpers/factory_mixin.php +++ b/classes/test_helpers/factory_mixin.php @@ -252,7 +252,7 @@ public function create_a_group_submission_for_the_student() { * @return feedback * @throws coding_exception */ - public function create_a_final_feedback_for_the_submisison() { + public function create_a_final_feedback_for_the_submission() { $generator = $this->get_coursework_generator(); $feedback = new stdClass(); $feedback->submissionid = $this->get_submission()->id; @@ -269,7 +269,7 @@ public function create_a_final_feedback_for_the_submisison() { * @return stdClass * @throws \coding_exception */ - public function create_an_assessor_feedback_for_the_submisison($assessor) { + public function create_an_assessor_feedback_for_the_submission($assessor) { $count = $this->number_of_assessor_feedbacks(); $generator = $this->get_coursework_generator(); diff --git a/datatables/js/datatables.js b/datatables/js/datatables.js index 4a4c5e2..01e7cbf 100644 --- a/datatables/js/datatables.js +++ b/datatables/js/datatables.js @@ -252,7 +252,7 @@ $( document ).ready(function() { } else { $(''+ - '' + $('#' + table_id).clone().html() + '
' + + '' + $('#' + table_id).clone().html() + '
' + '').insertAfter($(tr)); } @@ -285,7 +285,7 @@ $( document ).ready(function() { // row.child( format(row.data()) ).show(); row.child($( ''+ - '' + + '' + '
' + $('#' + table_id).clone().html() + '
' + $('#' + table_id).clone().html() + '
' )).show(); tr.addClass('shown'); diff --git a/datatables/js/edit_datatables.js b/datatables/js/edit_datatables.js index 4c4becc..063996d 100644 --- a/datatables/js/edit_datatables.js +++ b/datatables/js/edit_datatables.js @@ -727,41 +727,44 @@ $(document).ready(function () { }).done(function(response) { response = $.parseJSON(response); var modalbody = $('#modal-grading').find('.modal-body'); - modalbody.html(response.formhtml); - var filemanager = modalbody.find('.filemanager'); - if (response.filemanageroptions && filemanager.length) { - var elementid = filemanager.attr('id'); - var clientid = elementid.substr(12); - if (clientid) { - response.filemanageroptions.client_id = clientid; - M.form_filemanager.init(Y, response.filemanageroptions); + // Careful as not all requests return a response.success value. Only if it's false, show error. + if ((response.success ?? true) === false && (response.message ?? null)) { + modalbody.html(response.message); + } else { + modalbody.html(response.formhtml); + var filemanager = modalbody.find('.filemanager'); + if (response.filemanageroptions && filemanager.length) { + var elementid = filemanager.attr('id'); + var clientid = elementid.substr(12); + if (clientid) { + response.filemanageroptions.client_id = clientid; + M.form_filemanager.init(Y, response.filemanageroptions); + } } - } - if (response.editoroptions) { - require(['editor_tiny/editor'], (Tiny) => { - Tiny.setupForElementId({ - elementId: 'id_feedbackcomment', - options: JSON.parse(response.editoroptions), + if (response.editoroptions) { + require(['editor_tiny/editor'], (Tiny) => { + Tiny.setupForElementId({ + elementId: 'id_feedbackcomment', + options: JSON.parse(response.editoroptions), + }); }); - }); - } - - if (response.commentoptions) { - M.util.js_pending('gradingform_guide/comment_chooser'); - require(['gradingform_guide/comment_chooser'], function(amd) { - $(".remark").each( function (i,ele) { - buttonele = $(ele).find(".commentchooser"); - textele = $(ele).find(".markingguideremark"); - - buttonid = $(buttonele).attr("id"); - textid = $(textele).attr("id"); + } - amd.initialise(1, buttonid, textid, response.commentoptions) ; - M.util.js_complete('gradingform_guide/comment_chooser'); + if (response.commentoptions) { + M.util.js_pending('gradingform_guide/comment_chooser'); + require(['gradingform_guide/comment_chooser'], function(amd) { + $(".remark").each( function (i,ele) { + buttonele = $(ele).find(".commentchooser"); + textele = $(ele).find(".markingguideremark"); + buttonid = $(buttonele).attr("id"); + textid = $(textele).attr("id"); + amd.initialise(1, buttonid, textid, response.commentoptions); + M.util.js_complete('gradingform_guide/comment_chooser'); - }) + }) - }); + }); + } } }); var cell_td = $(this).closest('td'); diff --git a/tests/behat/behat_mod_coursework.php b/tests/behat/behat_mod_coursework.php index c64df53..a542dc7 100644 --- a/tests/behat/behat_mod_coursework.php +++ b/tests/behat/behat_mod_coursework.php @@ -577,6 +577,28 @@ public function i_click_on_the_new_feedback_button_for_assessor($assessornumber) } + /** + * The UI may contain multiple "New feedback" buttons some of which are not interactable + * @Given /^I click on the only interactable link with title "(?P(?:[^"]|\\")*)"$/ + * @param string $linktitle + */ + public function i_click_on_the_only_interactable_link_with_title(string $linktitle) { + $nodes = $this->find_all('link', $linktitle); + $visible = []; + foreach ($nodes as $node) { + if ($node->isVisible()) { + $visible[] = $node; + } + } + $countvisible = count($visible); + if ($countvisible !== 1) { + throw new ExpectationException( + "Expected one '$linktitle' visible link but found $countvisible", $this->getSession() + ); + } + reset($visible)->click(); + } + /** * @Given /^I click on the new feedback button for assessor (\d+) for another student$/ * @param $assessornumber @@ -1992,7 +2014,7 @@ public function there_is_final_feedback() { } /** - * @Given /^there is final feedback from the other teacher$/ + * @Given /^there is final feedback from the other teacher with grade 45$/ */ public function there_is_final_feedback_from_the_other_teacher() { $generator = $this->get_coursework_generator(); @@ -2169,7 +2191,7 @@ public function i_should_see_the_final_single_grade_on_the_page($grade = 56) { } /** - * @Given /^I have an assessor feedback$/ + * @Given /^I have an assessor feedback at grade 67$/ */ public function i_have_an_assessor_feedback() { /** @@ -2267,6 +2289,46 @@ public function i_grade_the_submission_using_the_simple_form($grade = 56, $witho $this->feedback = feedback::last(); } + /** + * Launch the grade submission modal and complete with grade/comment. + * @When /^I grade the submission(?: as )?(\d+)? using the ajax form$/ + * + * @param int $grade + * @param bool $withoutcomments + * @throws Behat\Mink\Exception\ElementException + * @throws Behat\Mink\Exception\ElementNotFoundException + */ + public function i_grade_the_submission_using_the_ajax_form($grade = 56) { + // Form loaded and sent by AJAX now so wait for it to load. + $this->wait_for_pending_js(); + $this->wait_for_seconds(1); + $this->execute('behat_forms::i_set_the_field_to', [$this->escape("Grade"), $grade]); + $this->execute( + 'behat_forms::i_set_the_field_to', [$this->escape("Comment"), "New comment here"] + ); + $this->wait_for_pending_js(); + $this->execute( + 'behat_general::i_click_on', [get_string('saveandfinalise', 'coursework'), 'button'] + ); + $this->wait_for_pending_js(); + $this->wait_for_seconds(2); + $this->assertSession()->pageTextContains(get_string('alert_feedback_save_successful', 'coursework')); + $this->feedback = feedback::last(); + } + + /** + * Expand the row in the grading form to expose feedback button. + * @When /^I expand the coursework grading row$/ + * @return void + */ + public function i_expand_the_grading_row() { + $this->execute( + 'behat_general::i_click_on', ['.details-control', 'css_element'] + ); + $this->wait_for_pending_js(); + $this->wait_for_seconds(1); + } + /** * @Then /^I should see the final grade for the group in the grading interface$/ * diff --git a/tests/behat/feedback_collisions.feature b/tests/behat/feedback_collisions.feature index 83130de..bcfa1c9 100644 --- a/tests/behat/feedback_collisions.feature +++ b/tests/behat/feedback_collisions.feature @@ -13,39 +13,42 @@ Feature: Collisions: two people try to create feedback at the same time 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 + @javascript + Scenario: Single marker: If I submit feedback and it's already been given then the form should show 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 have an assessor feedback at grade 67 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 + And I should see "Allocatable already has feedback for this stage" + @javascript 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 + And I have an assessor feedback at grade 67 + And I visit the coursework page + And I expand the coursework grading row + And I click on "New feedback" "link" + And I grade the submission as 56 using the ajax form + @javascript 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 + And I have an assessor feedback at grade 67 + And there is final feedback from the other teacher with grade 45 + And I expand the coursework grading row + And I wait until the page is ready + And I wait "2" seconds + And I click on "New feedback" "link" + And I wait until the page is ready + And I wait "2" seconds + And I should see "Allocatable already has feedback for this stage" diff --git a/tests/behat/feedback_files.feature b/tests/behat/feedback_files.feature index 989c846..7820ce4 100644 --- a/tests/behat/feedback_files.feature +++ b/tests/behat/feedback_files.feature @@ -1,4 +1,4 @@ -@_file_upload +@mod @mod_coursework @_file_upload Feature: Adding feedback files As a teacher diff --git a/tests/behat/feedback_final_feedback_double_marking.feature b/tests/behat/feedback_final_feedback_double_marking.feature index e040c80..b7d7409 100644 --- a/tests/behat/feedback_final_feedback_double_marking.feature +++ b/tests/behat/feedback_final_feedback_double_marking.feature @@ -1,4 +1,4 @@ -@mod @mod_coursework +@mod @mod_coursework @mod_coursework_feedback_final_feedback_double_marking Feature: Adding and editing final feedback In order to provide students with a fair final grade that combines the component grades @@ -15,42 +15,48 @@ Feature: Adding and editing final feedback And the student has a submission And the submission is finalised + @javascript 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 + And I click the new multiple final feedback button for the student + And I grade the submission as 57 using the ajax form + Then I visit the coursework page + And I should see the final grade as 57 on the multiple marker page + @javascript 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 + And I click the new multiple final feedback button for the student + And I grade the submission as 58 using the ajax form + Then I visit 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 + And I wait until the page is ready + And I wait "1" seconds + And the field "Grade" matches value "58" + And the field "Comment" matches value "New comment here" + @javascript 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 + And I grade the submission as 59 using the ajax form + @javascript 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 + And there is final feedback from the other teacher with grade 45 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 + And I wait until the page is ready + And I wait "2" seconds + And I wait until the page is ready + And the field "Grade" matches value "45" diff --git a/tests/behat/feedback_group_marking.feature b/tests/behat/feedback_group_marking.feature index 90c6d07..130af87 100644 --- a/tests/behat/feedback_group_marking.feature +++ b/tests/behat/feedback_group_marking.feature @@ -1,4 +1,4 @@ -@mod @mod_coursework +@mod @mod_coursework @mod_coursework_feedback_group_marking Feature: Marking the group submissions applies the grades to the whole group As a teacher @@ -22,10 +22,11 @@ Feature: Marking the group submissions applies the grades to the whole group And there are feedbacks from both teachers And I am logged in as a manager + @javascript 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 grade the submission as 56 using the ajax form + Then I visit the coursework page + And I wait "2" seconds 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 165c011..425ceaf 100644 --- a/tests/behat/feedback_multiple_assessor_feedback.feature +++ b/tests/behat/feedback_multiple_assessor_feedback.feature @@ -1,4 +1,4 @@ -@mod @mod_coursework +@mod @mod_coursework @mod_coursework_multiple_assessors Feature: Multiple assessors simple grading form As a teacher @@ -16,42 +16,59 @@ Feature: Multiple assessors simple grading form And there is a student And the student has a submission + @javascript 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 + And I expand the coursework grading row + And I click on the only interactable link with title "New feedback" + When I grade the submission using the ajax form + And I visit the coursework page + And I expand the coursework grading row + And I wait "2" seconds + Then I should see "56" in the "table.assessors_expanded tr.assessor_1 td.assessor_feedback_grade" "css_element" + + @javascript 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 expand the coursework grading row + And I click on the only interactable link with title "New feedback" + When I grade the submission using the ajax form And I visit the edit feedback page - Then I should see the grade comment in the form on the page + And the field "Comment" matches value "New comment here" - @javascript + @javascript @_file_upload 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 + And I expand the coursework grading row + And I wait "1" seconds + And I click on the only interactable link with title "New feedback" 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 + And I wait until the page is ready + And I visit the coursework page + And I expand the coursework grading row + And I wait "1" seconds + And I click on the only interactable link with title "Edit feedback" + And I wait "1" seconds Then I should see "1" elements in "Upload a file" filemanager + @javascript 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 have an assessor feedback at grade 67 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 + And I expand the coursework grading row + And I click on the only interactable link with title "Edit feedback" + And I wait until the page is ready + And the field "Comment" matches value "New comment here" Scenario: Grades can not be edited by other teachers Given there is a teacher @@ -68,29 +85,35 @@ Feature: Multiple assessors simple grading form 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 expand the coursework grading row + And I click on the only interactable link with title "New feedback" 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 visit the coursework page + And I expand the coursework grading row + And I click on the only interactable link with title "Edit feedback" 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 visit the coursework page + And I click on the only interactable link with title "Edit feedback" 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 + Scenario: I should not see the feedback icon when the submission 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 + @javascript 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 + And I expand the coursework grading row + And I click on the only interactable link with title "New feedback" + When I grade the submission using the ajax 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 cb5e17a..12a4825 100644 --- a/tests/behat/feedback_publishing_grades.feature +++ b/tests/behat/feedback_publishing_grades.feature @@ -1,4 +1,4 @@ -@mod @mod_coursework +@mod @mod_coursework @mod_coursework_feedback_publishing_grades Feature: publishing grades to the students In order that the students receive their final grades @@ -15,6 +15,7 @@ Feature: publishing grades to the students And the student has a submission And the submission is finalised + @javascript Scenario: Not publishing with double marking hides feedback from the student Given there is a teacher And there is another teacher @@ -23,13 +24,21 @@ Feature: publishing grades to the students 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 grade the submission as 56 using the ajax form + Then I visit the coursework page + And I click the edit final feedback button + And I wait until the page is ready + And I wait "1" seconds + And the field "Grade" matches value "56" + And the field "Comment" matches value "New comment here" 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 + @javascript Scenario: Deliberate publishing with double marking shows feedback to the student Given there is a teacher And there is another teacher @@ -39,10 +48,14 @@ Feature: publishing grades to the students 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 grade the submission as 56 using the ajax form + And I visit the coursework page And I press the publish button And I log out + And I log in as the student And I visit the coursework page + And I wait "2" seconds Then I should see the final grade on the student page + And I wait "100" seconds 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 60649a4..306b7b4 100644 --- a/tests/behat/feedback_single_marking.feature +++ b/tests/behat/feedback_single_marking.feature @@ -1,4 +1,4 @@ -@mod @mod_coursework +@mod @mod_coursework @mod_coursework_feedback_single_marking Feature: Adding and editing single feedback In order to provide students with a fair final grade that combines the component grades @@ -15,33 +15,33 @@ Feature: Adding and editing single feedback 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 + @javascript + Scenario: Setting the final feedback grade and comment 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 + And I grade the submission as 56 using the ajax form + Then I visit the coursework page + And I should see the final grade as 56 on the single marker page + And I click the edit final feedback button + And I wait until the page is ready + And I wait "1" seconds + And the field "Grade" matches value "56" + And the field "Comment" matches value "New comment here" - 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 + Scenario: I should not see the feedback icon when the submission 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 + @javascript + Scenario: Editing someone else's 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 + And I wait until the page is ready + And I wait "1" seconds + And the field "Grade" matches value "58" + And I wait "1" seconds + And the field with xpath "//textarea[@id='id_feedbackcomment']" matches value "Blah" diff --git a/tests/classes/cron_test.php b/tests/classes/cron_test.php index c5042d9..0572d12 100644 --- a/tests/classes/cron_test.php +++ b/tests/classes/cron_test.php @@ -146,7 +146,7 @@ public function test_auto_releasing_happens_after_deadline(): void { $this->create_a_student(); $submission = $this->create_a_submission_for_the_student(); $submission->update_attribute('finalised', 1); - $this->create_a_final_feedback_for_the_submisison(); + $this->create_a_final_feedback_for_the_submission(); $coursework->update_attribute('individualfeedback', strtotime('-1 week')); \mod_coursework\cron::run(); diff --git a/tests/classes/grade_judge_test.php b/tests/classes/grade_judge_test.php index 6923b26..1f87339 100644 --- a/tests/classes/grade_judge_test.php +++ b/tests/classes/grade_judge_test.php @@ -43,7 +43,7 @@ public function test_get_feedbck_that_is_promoted_to_gradebook_returns_initial_f $submission = $this->create_a_submission_for_the_student(); $assessor = $this->create_a_teacher(); - $feedback = $this->create_an_assessor_feedback_for_the_submisison($assessor); + $feedback = $this->create_an_assessor_feedback_for_the_submission($assessor); $this->assertEquals($feedback->id, $gradejudge->get_feedback_that_is_promoted_to_gradebook($submission)->id); } @@ -57,7 +57,7 @@ public function test_sampling_disabled_one_marker(): void { $submission = $this->create_a_submission_for_the_student(); $assessor = $this->create_a_teacher(); - $feedback = $this->create_an_assessor_feedback_for_the_submisison($assessor); + $feedback = $this->create_an_assessor_feedback_for_the_submission($assessor); $this->assertEquals($feedback->id, $gradejudge->get_feedback_that_is_promoted_to_gradebook($submission)->id); } diff --git a/tests/classes/models/user_test.php b/tests/classes/models/user_test.php index 5272f5b..d82f0d8 100644 --- a/tests/classes/models/user_test.php +++ b/tests/classes/models/user_test.php @@ -43,7 +43,7 @@ public function test_find(): void { // has_agreed_feedback() public function test_has_final_agreed_grade_returns_true_when_present(): void { - $this->create_a_final_feedback_for_the_submisison(); + $this->create_a_final_feedback_for_the_submission(); $this->assertTrue($this->get_student()->has_agreed_feedback($this->get_coursework())); } @@ -55,7 +55,7 @@ public function test_has_final_agreed_grade_returns_false_when_not_present(): vo public function test_has_final_agreed_grade_returns_false_when_present_for_different_coursework(): void { $this->create_a_student(); - $this->create_a_final_feedback_for_the_submisison(); + $this->create_a_final_feedback_for_the_submission(); $coursework = $this->getMockBuilder('\mod_coursework\coursework')->setMethods(['id'])->getMock(); $coursework->expects($this->any()) ->method('id') @@ -66,7 +66,7 @@ public function test_has_final_agreed_grade_returns_false_when_present_for_diffe public function test_has_final_agreed_grade_returns_false_when_initial_feedback_is_present(): void { $this->create_a_student(); $teacher = $this->create_a_teacher(); - $this->create_an_assessor_feedback_for_the_submisison($teacher); + $this->create_an_assessor_feedback_for_the_submission($teacher); $this->assertFalse($this->get_student()->has_agreed_feedback($this->get_coursework())); } @@ -77,7 +77,7 @@ public function test_has_all_initial_feedbacks_returns_false_when_only_some_are_ $this->create_a_coursework(); $this->coursework->update_attribute('numberofmarkers', 2); $teacher = $this->create_a_teacher(); - $this->create_an_assessor_feedback_for_the_submisison($teacher); + $this->create_an_assessor_feedback_for_the_submission($teacher); $this->assertFalse($this->get_student()->has_all_initial_feedbacks($this->get_coursework())); } @@ -86,7 +86,7 @@ public function test_has_all_initial_feedbacks_returns_false_when_only_final_gra $this->create_a_coursework(); $this->coursework->update_attribute('numberofmarkers', 1); $teacher = $this->create_a_teacher(); - $this->create_a_final_feedback_for_the_submisison($teacher); + $this->create_a_final_feedback_for_the_submission($teacher); $this->assertFalse($this->get_student()->has_all_initial_feedbacks($this->get_coursework())); } @@ -95,7 +95,7 @@ public function test_has_all_initial_feedbacks_returns_false_when_all_are_presen $this->create_a_coursework(); $this->coursework->update_attribute('numberofmarkers', 1); $teacher = $this->create_a_teacher(); - $this->create_an_assessor_feedback_for_the_submisison($teacher); + $this->create_an_assessor_feedback_for_the_submission($teacher); $this->assertTrue($this->get_student()->has_all_initial_feedbacks($this->get_coursework())); } diff --git a/tests/classes/stages/assessor_test.php b/tests/classes/stages/assessor_test.php index 60cc2f1..2324c46 100644 --- a/tests/classes/stages/assessor_test.php +++ b/tests/classes/stages/assessor_test.php @@ -62,7 +62,7 @@ public function test_prerequisite_stages_is_ok_with_one_assessor_feedback(): voi $student = $this->create_a_student(); $this->create_a_submission_for_the_student(); $this->create_a_teacher(); - $this->create_an_assessor_feedback_for_the_submisison($this->teacher); + $this->create_an_assessor_feedback_for_the_submission($this->teacher); $this->assertTrue($secondstage->prerequisite_stages_have_feedback($student)); } diff --git a/tests/classes/stages/final_agreed_test.php b/tests/classes/stages/final_agreed_test.php index f474112..ed51e14 100644 --- a/tests/classes/stages/final_agreed_test.php +++ b/tests/classes/stages/final_agreed_test.php @@ -58,7 +58,7 @@ public function test_prerequisite_stages_is_false_with_one_assessor_feedback(): $student = $this->create_a_student(); $this->create_a_submission_for_the_student(); $this->create_a_teacher(); - $this->create_an_assessor_feedback_for_the_submisison($this->teacher); + $this->create_an_assessor_feedback_for_the_submission($this->teacher); $this->assertFalse($stage->prerequisite_stages_have_feedback($student)); } @@ -72,8 +72,8 @@ public function test_prerequisite_stages_is_true_with_two_assessor_feedbacks(): $this->create_a_submission_for_the_student(); $this->create_a_teacher(); $this->create_another_teacher(); - $this->create_an_assessor_feedback_for_the_submisison($this->teacher); - $this->create_an_assessor_feedback_for_the_submisison($this->otherteacher); + $this->create_an_assessor_feedback_for_the_submission($this->teacher); + $this->create_an_assessor_feedback_for_the_submission($this->otherteacher); // Need to student to be in the sample. diff --git a/version.php b/version.php index 3c38c53..058ac42 100644 --- a/version.php +++ b/version.php @@ -24,7 +24,7 @@ $plugin->component = 'mod_coursework'; -$plugin->version = 2024091600; // If version == 0 then module will not be installed +$plugin->version = 2024100701; // If version == 0 then module will not be installed $plugin->requires = 2023100400; // Requires this Moodle version $plugin->cron = 300; // Period for cron to check this module (secs).