From 4358b705e50958b571f87bc6158b7779cf864021 Mon Sep 17 00:00:00 2001 From: Neill Magill Date: Wed, 22 Apr 2015 13:10:00 +0100 Subject: [PATCH 1/2] MDL-49637 assign: Behat test for blind marking with workflow This test checks that that if reveal student identities is used before or after the submissions grades have been set released that the teacher's feedback is displayed to students. --- .../tests/behat/steps_blind_marking.feature | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 mod/assign/tests/behat/steps_blind_marking.feature diff --git a/mod/assign/tests/behat/steps_blind_marking.feature b/mod/assign/tests/behat/steps_blind_marking.feature new file mode 100644 index 00000000000..3b4d8269faa --- /dev/null +++ b/mod/assign/tests/behat/steps_blind_marking.feature @@ -0,0 +1,99 @@ +@mod @mod_assign +Feature: Assignments correctly add feedback to the grade report when workflow and blind marking are enabled. + In order to give students feedback when blind marking + As a teacher + I should be able to reveal student identities at any time and have my feedback show + to the student in the gradebook when the grades are in a released state. + + Background: + Given the following "courses" exist: + | fullname | shortname | category | groupmode | + | Course 1 | C1 | 0 | 1 | + And the following "users" exist: + | username | firstname | lastname | email | + | teacher1 | Teacher | 1 | teacher1@example.com | + | student1 | Student | 1 | student1@example.com | + And the following "course enrolments" exist: + | user | course | role | + | teacher1 | C1 | editingteacher | + | student1 | C1 | student | + # Add the assignment. + And I log in as "teacher1" + And I follow "Course 1" + And I turn editing mode on + And I add a "Assignment" to section "1" and I fill the form with: + | Assignment name | Test assignment name | + | Description | Test assignment description | + | Online text | 1 | + | File submissions | 0 | + | Use marking workflow | Yes | + | Blind marking | Yes | + And I log out + # Add a submission. + And I log in as "student1" + And I follow "Course 1" + When I follow "Test assignment name" + Then I should not see "Feedback" + And I should see "Not marked" in the "Grading status" "table_row" + And I press "Add submission" + And I set the following fields to these values: + | Online text | I'm the student's first submission | + And I press "Save changes" + And I log out + # Mark the submission. + And I log in as "teacher1" + And I follow "Course 1" + And I follow "Test assignment name" + And I follow "View/grade all submissions" + And I should see "Not marked" in the "Participant 1" "table_row" + And I click on "Grade Participant 1" "link" in the "Participant 1" "table_row" + And I set the field "Grade out of 100" to "50" + And I set the field "Marking workflow state" to "In review" + And I set the field "Feedback comments" to "Great job! Lol, not really." + And I press "Save changes" + And I press "Continue" + And I should see "In review" in the "Participant 1" "table_row" + + @javascript + Scenario: Student identities are revealed after releasing the grades. + When I click on "Grade Participant 1" "link" in the "Participant 1" "table_row" + And I set the field "Marking workflow state" to "Ready for release" + And I press "Save changes" + And I press "Continue" + And I should see "Ready for release" in the "Participant 1" "table_row" + And I click on "Grade Participant 1" "link" in the "Participant 1" "table_row" + And I set the field "Marking workflow state" to "Released" + And I press "Save changes" + And I press "Continue" + And I should see "Released" in the "Participant 1" "table_row" + And I set the field "Grading action" to "Reveal student identities" + And I press "Continue" + And I log out + And I log in as "student1" + And I follow "Course 1" + And I follow "Grades" + And I set the field "Grade report" to "User report" + Then I should see "50" + And I should see "Great job! Lol, not really." + + @javascript + Scenario: Student identities are revealed before releasing the grades. + When I click on "Grade Participant 1" "link" in the "Participant 1" "table_row" + And I set the field "Marking workflow state" to "Ready for release" + And I press "Save changes" + And I press "Continue" + And I should see "Ready for release" in the "Participant 1" "table_row" + And I set the field "Grading action" to "Reveal student identities" + And I press "Continue" + And I click on "Grade Student 1" "link" in the "Student 1" "table_row" + And I set the field "Marking workflow state" to "Released" + And I press "Save changes" + And I press "Continue" + And I should see "Released" in the "Student 1" "table_row" + And I log out + And I log in as "student1" + And I follow "Course 1" + And I follow "Grades" + And I set the field "Grade report" to "User report" + Then I should see "50" + And I should see "Great job! Lol, not really." From 895d6c75a4d9a95d3ffcc5b5d86e42c70f9a3b4c Mon Sep 17 00:00:00 2001 From: Neill Magill Date: Fri, 27 Mar 2015 16:16:18 +0000 Subject: [PATCH 2/2] MDL-49637 assign: Workflow & blind marking do not always show feedback Before this patch if an assignment has workflow and blind marking enabled if a teacher sets a submission to have its grades released to students before they reveal student identities the feedback they have given is not displayed to the student. The patch causes the reveal_identities() method to pass the correct value to the get_feedback_plugin_by_type() function in the assign class. --- mod/assign/locallib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index d35f43188ae..d87a62ae195 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -5470,6 +5470,7 @@ class assign { $adminconfig = $this->get_admin_config(); $gradebookplugin = $adminconfig->feedback_plugin_for_gradebook; + $gradebookplugin = str_replace('assignfeedback_', '', $gradebookplugin); $grades = $DB->get_records('assign_grades', array('assignment'=>$this->get_instance()->id)); $plugin = $this->get_feedback_plugin_by_type($gradebookplugin);