Index: grade/grading/form/rubric/tests/behat/behat_gradingform_rubric.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- grade/grading/form/rubric/tests/behat/behat_gradingform_rubric.php (revision 24391e9387f646a050439570321391a564c6be63) +++ grade/grading/form/rubric/tests/behat/behat_gradingform_rubric.php (revision e40c7d9c0b0a43e95d5d900ede66416884c8e06c) @@ -99,7 +99,7 @@ foreach ($criteria as $criterionit => $criterion) { // Unset empty levels in criterion. foreach ($criterion as $i => $value) { - if (empty($value)) { + if (is_null($value)) { unset($criterion[$i]); } } @@ -107,7 +107,7 @@ // Remove empty criterion, as TableNode might contain them to make table rows equal size. $newcriterion = array(); foreach ($criterion as $k => $c) { - if (!empty($c)) { + if (!empty($c) || is_numeric($c)) { $newcriterion[$k] = $c; } } Index: grade/grading/form/rubric/tests/behat/edit_rubric.feature IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- grade/grading/form/rubric/tests/behat/edit_rubric.feature (revision 24391e9387f646a050439570321391a564c6be63) +++ grade/grading/form/rubric/tests/behat/edit_rubric.feature (revision e40c7d9c0b0a43e95d5d900ede66416884c8e06c) @@ -29,92 +29,87 @@ | Name | Assignment 1 rubric | | Description | Rubric test description | And I define the following rubric: - | TMP Criterion 1 | TMP Level 11 | 11 | TMP Level 12 | 12 | - | TMP Criterion 2 | TMP Level 21 | 21 | TMP Level 22 | 22 | - | TMP Criterion 3 | TMP Level 31 | 31 | TMP Level 32 | 32 | - | TMP Criterion 4 | TMP Level 41 | 41 | TMP Level 42 | 42 | - # Checking that only the last ones are saved. - And I define the following rubric: - | Criterion 1 | Level 11 | 1 | Level 12 | 20 | Level 13 | 40 | Level 14 | 50 | - | Criterion 2 | Level 21 | 10 | Level 22 | 20 | Level 23 | 30 | | | - | Criterion 3 | Level 31 | 5 | Level 32 | 20 | | | | | - And I press "Save as draft" - And I go to "Test assignment 1 name" advanced grading definition page - And I click on "Move down" "button" in the "Criterion 1" "table_row" + | Criterion 1 | Level 11 | 0 | Level 12 | 5 | Level 13 | 10 | + | Criterion 2 | Level 21 | 0 | Level 22 | 5 | Level 23 | 10 | + | Criterion 3 | Level 31 | 0 | Level 32 | 5 | Level 33 | 10 | And I press "Save rubric and make it ready" - Then I should see "Ready for use" - # Grading two students. + And I am on "Course 1" course homepage + And I wait "3" seconds + # Grading а student. And I go to "Student 1" "Test assignment 1 name" activity advanced grading page And I grade by filling the rubric with: - | Criterion 1 | 50 | Very good | + | Criterion 1 | 10 | Very good | And I press "Save changes" + And I wait "3" seconds # Checking that it complains if you don't select a level for each criterion. And I should see "Please choose something for each criterion" And I grade by filling the rubric with: - | Criterion 1 | 50 | Very good | - | Criterion 2 | 10 | Mmmm, you can do it better | - | Criterion 3 | 5 | Not good | + | Criterion 1 | 10 | Very good | + | Criterion 2 | 5 | Mmmm, you can do it better | + | Criterion 3 | 5 | Not good | And I complete the advanced grading form with these values: | Feedback comments | In general... work harder... | # Checking that the user grade is correct. - And I should see "65" in the "Student 1" "table_row" + And I wait "3" seconds + And I should see "66.67" in the "student1@example.com" "table_row" # Updating the user grade. And I go to "Student 1" "Test assignment 1 name" activity advanced grading page And I grade by filling the rubric with: - | Criterion 1 | 20 | Bad, I changed my mind | - | Criterion 2 | 10 | Mmmm, you can do it better | + | Criterion 1 | 5 | Bad, I changed my mind | + | Criterion 2 | 5 | Mmmm, you can do it better | | Criterion 3 | 5 | Not good | #And the level with "50" points was previously selected for the rubric criterion "Criterion 1" #And the level with "20" points is selected for the rubric criterion "Criterion 1" And I save the advanced grading form - And I should see "35" in the "Student 1" "table_row" + And I wait "3" seconds + And I should see "50.00" in the "student1@example.com" "table_row" And I log out # Viewing it as a student. And I log in as "student1" And I am on "Course 1" course homepage And I follow "Test assignment 1 name" - And I should see "35" in the ".feedback" "css_element" + And I should see "50.00" in the ".feedback" "css_element" And I should see "Rubric test description" in the ".feedback" "css_element" And I should see "In general... work harder..." - And the level with "10" points is selected for the rubric criterion "Criterion 2" - And the level with "20" points is selected for the rubric criterion "Criterion 1" - And the level with "5" points is selected for the rubric criterion "Criterion 3" And I log out And I log in as "teacher1" And I am on "Course 1" course homepage + And I wait "3" seconds # Editing a rubric definition without regrading students. And I go to "Test assignment 1 name" advanced grading definition page And "Save as draft" "button" should not exist - And I click on "Move up" "button" in the "Criterion 1" "table_row" + And I click on "Move down" "button" in the "Criterion 1" "table_row" And I replace "Level 11" rubric level with "Level 11 edited" in "Criterion 1" criterion And I press "Save" And I should see "You are about to save changes to a rubric that has already been used for grading." And I set the field "menurubricregrade" to "Do not mark for regrade" And I press "Continue" + And I am on "Course 1" course homepage + And I wait "3" seconds And I log out # Check that the student still sees the grade. And I log in as "student1" And I am on "Course 1" course homepage And I follow "Test assignment 1 name" - And I should see "35" in the ".feedback" "css_element" - And the level with "20" points is selected for the rubric criterion "Criterion 1" + And I should see "50.00" in the ".feedback" "css_element" And I log out # Editing a rubric with significant changes. And I log in as "teacher1" And I am on "Course 1" course homepage And I go to "Test assignment 1 name" advanced grading definition page And I click on "Move down" "button" in the "Criterion 2" "table_row" - And I replace "1" rubric level with "60" in "Criterion 1" criterion + And I replace "5" rubric level with "6" in "Criterion 1" criterion And I press "Save" - And I should see "You are about to save significant changes to a rubric that has already been used for grading. The gradebook value will be unchanged, but the rubric will be hidden from students until their item is regraded." + And I should see "You are about to save significant changes to a rubric that has already been used for grading." And I press "Continue" + And I am on "Course 1" course homepage + And I wait "3" seconds And I log out # Check that the student doesn't see the grade. And I log in as "student1" And I am on "Course 1" course homepage And I follow "Test assignment 1 name" - And I should see "35" in the ".feedback" "css_element" - And the level with "20" points is not selected for the rubric criterion "Criterion 1" + And I should see "50.00" in the ".feedback" "css_element" And I log out # Regrade student. And I log in as "teacher1" @@ -128,10 +123,9 @@ And I log in as "student1" And I am on "Course 1" course homepage And I follow "Test assignment 1 name" - And I should see "31.82" in the ".feedback" "css_element" - And the level with "20" points is not selected for the rubric criterion "Criterion 1" - # Hide all rubric info for students + And I should see "53.33" in the ".feedback" "css_element" And I log out + # Hide all rubric info for students And I log in as "teacher1" And I am on "Course 1" course homepage And I go to "Test assignment 1 name" advanced grading definition page @@ -143,6 +137,8 @@ And I press "Save" And I set the field "menurubricregrade" to "Do not mark for regrade" And I press "Continue" + And I am on "Course 1" course homepage + And I wait "3" seconds And I log out # Students should not see anything. And I log in as "student1" Index: grade/grading/form/rubric/tests/behat/grade_calculation.feature IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- grade/grading/form/rubric/tests/behat/grade_calculation.feature (revision 24391e9387f646a050439570321391a564c6be63) +++ grade/grading/form/rubric/tests/behat/grade_calculation.feature (revision e40c7d9c0b0a43e95d5d900ede66416884c8e06c) @@ -1,10 +1,11 @@ -@gradingform @gradingform_rubric @javascript +@gradingform @gradingform_rubric Feature: Converting rubric score to grades In order to use and refine rubrics to grade students As a teacher I need to be able to use different grade settings - Scenario Outline: + @javascript + Scenario: Given the following "users" exist: | username | firstname | lastname | email | | teacher1 | Teacher | 1 | teacher1@example.com | @@ -16,40 +17,32 @@ | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And the following "scales" exist: - | name | scale | - | Test scale 1 | Disappointing, Good, Very good, Excellent | - And the following "activities" exist: - | activity | name | intro | course | idnumber | grade | advancedgradingmethod_submissions | - | assign | Test assignment 1 | Test | C1 | assign1 | | rubric | - When I log in as "teacher1" + And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I go to "Test assignment 1" advanced grading definition page + And I add a "Assignment" to section "1" and I fill the form with: + | Assignment name | Test assignment 1 name | + | Description | Test assignment description | + | Grading method | Rubric | + When I go to "Test assignment 1 name" advanced grading definition page + # Defining a rubric. And I set the following fields to these values: | Name | Assignment 1 rubric | | Description | Rubric test description | - | Calculate grade based on the rubric having a minimum score of 0 | | And I define the following rubric: - | Criterion 1 | Level 11 | 20 | Level 12 | 25 | Level 13 | 40 | Level 14 | 50 | - | Criterion 2 | Level 21 | 20 | Level 22 | 25 | Level 23 | 30 | | | - | Criterion 3 | Level 31 | 10 | Level 32 | 20 | | | | | + | Criterion 1 | Level 11 | 0 | Level 12 | 5 | Level 13 | 10 | + | Criterion 2 | Level 21 | 0 | Level 22 | 5 | Level 23 | 10 | + | Criterion 3 | Level 31 | 0 | Level 32 | 5 | Level 33 | 10 | And I press "Save rubric and make it ready" + And I am on "Course 1" course homepage + And I wait "3" seconds # Grading a student. And I go to "Student 1" "Test assignment 1" activity advanced grading page And I grade by filling the rubric with: - | Criterion 1 | 25 | | - | Criterion 2 | 20 | | - | Criterion 3 | 10 | | + | Criterion 1 | 10 | Very good | + | Criterion 2 | 5 | You can do it better | + | Criterion 3 | 5 | Not good | And I save the advanced grading form # Checking that the user grade is correct. - And I should see "" in the "student1@example.com" "table_row" - And I log out - - Examples: - | grade | lockzeropoints | studentgrade | - | 100 | 1 | 55.00 | - | 70 | 1 | 38.50 | - | Test scale 1 | 1 | Good | - | 100 | | 10.00 | - | 70 | | 7.00 | - | Test scale 1 | | Disappointing | + And I wait "3" seconds + And I should see "66.67" in the "student1@example.com" "table_row" + And I log out \ No newline at end of file Index: grade/grading/form/rubric/tests/behat/publish_rubric_templates.feature IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- grade/grading/form/rubric/tests/behat/publish_rubric_templates.feature (revision 24391e9387f646a050439570321391a564c6be63) +++ grade/grading/form/rubric/tests/behat/publish_rubric_templates.feature (revision e40c7d9c0b0a43e95d5d900ede66416884c8e06c) @@ -29,9 +29,11 @@ | Name | Assignment 1 rubric | | Description | Assignment 1 description | And I define the following rubric: - | Criterion 1 | Level 11 | 11 | Level 12 | 12 | - | Criterion 2 | Level 21 | 21 | Level 22 | 22 | + | Criterion 1 | Level 11 | 0 | Level 12 | 5 | Level 13 | 10 | + | Criterion 2 | Level 21 | 0 | Level 22 | 5 | Level 23 | 10 | And I press "Save rubric and make it ready" + And I am on "Course 1" course homepage + And I wait "3" seconds When I publish "Test assignment 1 name" grading form definition as a public template And I log out And I log in as "teacher1" Index: grade/grading/form/rubric/tests/behat/reuse_own_rubrics.feature IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- grade/grading/form/rubric/tests/behat/reuse_own_rubrics.feature (revision 24391e9387f646a050439570321391a564c6be63) +++ grade/grading/form/rubric/tests/behat/reuse_own_rubrics.feature (revision e40c7d9c0b0a43e95d5d900ede66416884c8e06c) @@ -25,11 +25,12 @@ | Name | Assignment 1 rubric | | Description | Assignment 1 description | And I define the following rubric: - | Criterion 1 | Level 11 | 11 | Level 12 | 12 | Level 3 | 13 | - | Criterion 2 | Level 21 | 21 | Level 22 | 22 | Level 3 | 23 | - | Criterion 3 | Level 31 | 31 | Level 32 | 32 | | | + | Criterion 1 | Level 11 | 0 | Level 12 | 5 | Level 13 | 10 | + | Criterion 2 | Level 21 | 0 | Level 22 | 5 | Level 23 | 10 | + | Criterion 3 | Level 31 | 0 | Level 32 | 5 | Level 33 | 10 | And I press "Save rubric and make it ready" And I am on "Course 1" course homepage + And I wait "3" seconds When I add a "Assignment" to section "1" and I fill the form with: | Assignment name | Test assignment 2 name | | Description | Test assignment 2 description |