Commit 821ab1bf authored by Damyon Wiese's avatar Damyon Wiese
Browse files

MDL-52954 assign: Behat fixes because the assign grading ui has changed

parent 11c16f5f
......@@ -115,11 +115,13 @@ Feature: availability_grade
# Give the assignment 40%.
And I follow "A1"
And I follow "View/grade all submissions"
And I follow "View all submissions"
# Pick the grade link in the row that has s@example.com in it.
And I click on "//a[contains(@href, 'action=grade') and ancestor::tr/td[normalize-space(.) = 's@example.com']]/img" "xpath_element"
And I click on "Grade" "link" in the "s@example.com" "table_row"
And I set the field "Grade out of 100" to "40"
And I click on "Save changes" "button"
And I press "Ok"
And I click on "Edit settings" "link"
# Log back in as student.
And I log out
......
......@@ -56,11 +56,13 @@ Feature: Restrict activity availability through grade conditions
And I am on site homepage
And I follow "Course 1"
And I follow "Grade assignment"
And I follow "View/grade all submissions"
And I click on "Grade Student First" "link" in the "Student First" "table_row"
And I follow "View all submissions"
And I click on "Grade" "link" in the "Student First" "table_row"
And I set the following fields to these values:
| Grade | 21 |
And I press "Save changes"
And I press "Ok"
And I follow "Edit settings"
And I log out
And I log in as "student1"
And I am on site homepage
......
......@@ -93,11 +93,13 @@ Feature: Restrict sections availability through completion or grade conditions
And I am on site homepage
And I follow "Course 1"
And I follow "Grade assignment"
And I follow "View/grade all submissions"
And I click on "Grade Student First" "link" in the "Student First" "table_row"
And I follow "View all submissions"
And I click on "Grade" "link" in the "Student First" "table_row"
And I set the following fields to these values:
| Grade | 21 |
And I press "Save changes"
And I press "Ok"
And I follow "Edit settings"
And I log out
And I log in as "student1"
And I am on site homepage
......
......@@ -84,9 +84,11 @@ Feature: Marking guides can be created and edited
And I wait "1" seconds
Then the field "Guide criterion B criterion remark" matches value "Comment 4"
When I press "Save changes"
Then I should see "The grade changes were saved"
And I press "Ok"
And I follow "Edit settings"
And I follow "Test assignment 1 name"
And I follow "View all submissions"
# Checking that the user grade is correct.
When I press "Continue"
Then I should see "80" in the "Student 1" "table_row"
And I log out
# Viewing it as a student.
......
......@@ -4,7 +4,8 @@ Feature: Rubrics can be created and edited
As a teacher
I need to edit previously used rubrics
Background:
@javascript
Scenario: I can use rubrics to grade and edit them later updating students grades
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
......@@ -152,8 +153,3 @@ Feature: Rubrics can be created and edited
And I should not see "Criterion 2" in the ".submissionstatustable" "css_element"
And I should not see "Criterion 3" in the ".submissionstatustable" "css_element"
And I should not see "Rubric test description" in the ".feedback" "css_element"
@javascript
Scenario: I can use rubrics to grade and edit them later updating students grades with Javascript enabled
Scenario: I can use rubrics to grade and edit them later updating students grades with Javascript disabled
......@@ -82,21 +82,19 @@ class behat_grading extends behat_base {
public function i_go_to_activity_advanced_grading_page($userfullname, $activityname) {
// Step to access the user grade page from the grading page.
$usergradetext = get_string('gradeuser', 'assign', $userfullname);
// Shortcut in case we already are in the grading page.
$usergradetextliteral = behat_context_helper::escape($usergradetext);
if ($this->getSession()->getPage()->find('named_partial', array('link', $usergradetextliteral))) {
$this->execute('behat_general::click_link', $this->escape($usergradetext));
return true;
}
$gradetext = get_string('grade');
$this->execute('behat_general::click_link', $this->escape($activityname));
$this->execute('behat_general::click_link', $this->escape(get_string('viewgrading', 'assign')));
$this->execute('behat_general::click_link', $this->escape($usergradetext));
$this->execute('behat_general::i_click_on_in_the',
array(
$this->escape($gradetext),
'link',
$this->escape($userfullname),
'table_row'
));
}
/**
......@@ -156,7 +154,10 @@ class behat_grading extends behat_base {
public function i_save_the_advanced_grading_form() {
$this->execute('behat_forms::press_button', get_string('savechanges'));
$this->execute('behat_forms::press_button', get_string('continue'));
$this->execute('behat_forms::press_button', 'Ok');
$this->execute('behat_general::i_click_on', array($this->escape(get_string('editsettings')), 'link'));
$this->execute('behat_forms::press_button', get_string('cancel'));
$this->execute('behat_general::i_click_on', array($this->escape(get_string('viewgrading', 'mod_assign')), 'link'));
}
/**
......
@core @core_grades @gradereport_singleview
@core @core_grades @gradereport_singleview @javascript
Feature: We can bulk insert grades for students in a course
As a teacher
In order to quickly grade items
......@@ -33,12 +33,13 @@ Feature: We can bulk insert grades for students in a course
Given I log in as "teacher1"
And I follow "Course 1"
And I follow "Test assignment one"
And I follow "View/grade all submissions"
And I follow "Grade Student 1"
And I follow "View all submissions"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the following fields to these values:
| Grade out of 100 | 50 |
And I press "Save changes"
And I press "Continue"
And I press "Ok"
And I follow "Edit settings"
And I follow "View gradebook"
And I follow "Single view for Test assignment one"
Then the field "Grade for james (Student) 1" matches value "50.00"
......@@ -73,13 +74,16 @@ Feature: We can bulk insert grades for students in a course
Given I log in as "teacher1"
And I follow "Course 1"
And I follow "Test assignment two"
And I follow "View/grade all submissions"
And I follow "Grade Student 1"
And I follow "View all submissions"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the following fields to these values:
| Grade out of 100 | 50 |
And I press "Save changes"
And I press "Continue"
And I press "Ok"
And I follow "Edit settings"
And I follow "View gradebook"
And I click on "input[title='Dock Navigation block']" "css_element"
And I click on "input[title='Dock Administration block']" "css_element"
And I follow "Single view for Test assignment two"
And I select "Student 1" from the "Select user..." singleselect
Then the field "Grade for Test assignment two" matches value "50.00"
......
@core @core_grades
@core @core_grades @javascript
Feature: View gradebook when scales are used
In order to use scales to grade activities
As an teacher
......@@ -49,18 +49,27 @@ Feature: View gradebook when scales are used
And I set the field "grade[modgrade_type]" to "Scale"
And I set the field "grade[modgrade_scale]" to "Letterscale"
And I press "Save and display"
And I follow "View/grade all submissions"
And I click on "Grade Student 1" "link" in the "Student 1" "table_row"
And I follow "View all submissions"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade" to "A"
And I press "Save and show next"
And I press "Save changes"
And I press "Ok"
And I click on "[data-action=next-user]" "css_element"
And I set the field "Grade" to "B"
And I press "Save and show next"
And I press "Save changes"
And I press "Ok"
And I click on "[data-action=next-user]" "css_element"
And I set the field "Grade" to "C"
And I press "Save and show next"
And I press "Save changes"
And I press "Ok"
And I click on "[data-action=next-user]" "css_element"
And I set the field "Grade" to "D"
And I press "Save and show next"
And I press "Save changes"
And I press "Ok"
And I click on "[data-action=next-user]" "css_element"
And I set the field "Grade" to "F"
And I press "Save changes"
And I press "Ok"
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I navigate to "Course grade settings" node in "Grade administration > Setup"
......
@core @core_grades
@core @core_grades @javascript
Feature: View gradebook when single item scales are used
In order to use single item scales to grade activities
As an teacher
......@@ -43,10 +43,11 @@ Feature: View gradebook when single item scales are used
And I set the field "grade[modgrade_type]" to "Scale"
And I set the field "grade[modgrade_scale]" to "Singleitem"
And I press "Save and display"
And I follow "View/grade all submissions"
And I click on "Grade Student 1" "link" in the "Student 1" "table_row"
And I follow "View all submissions"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade" to "A"
And I press "Save changes"
And I press "Ok"
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I navigate to "Course grade settings" node in "Grade administration > Setup"
......
......@@ -64,6 +64,7 @@ Feature: Using the activity grade form element
And I press "Save and display"
And I should not see "You must choose whether to rescale existing grades or not"
@javascript
Scenario: Attempting to change the scale when grades already exist
Given I log in as "admin"
And I navigate to "Scales" node in "Site administration > Grades"
......@@ -88,12 +89,12 @@ Feature: Using the activity grade form element
| grade[modgrade_scale] | ABCDEF |
And I follow "Course 1"
And I follow "Test assignment name"
And I follow "View/grade all submissions"
And I click on "Grade Student 1" "link" in the "Student 1" "table_row"
And I follow "View all submissions"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade" to "C"
And I press "Save changes"
And I press "Continue"
And I click on "Edit settings" "link" in the "Administration" "block"
And I press "Ok"
And I click on "Edit settings" "link"
When I expand all fieldsets
Then I should see "Some grades have already been awarded, so the grade type and scale cannot be changed"
......@@ -132,6 +133,7 @@ Feature: Using the activity grade form element
And I press "Save and display"
And I should see "You cannot change the maximum grade when grades already exist for an activity with ratings"
@javascript
Scenario: Attempting to change the maximum grade when no rescaling option has been chosen
Given I log in as "teacher1"
And I follow "Course 1"
......@@ -141,14 +143,11 @@ Feature: Using the activity grade form element
| Description | Test assignment description |
And I follow "Course 1"
And I follow "Test assignment name"
And I follow "View/grade all submissions"
And I click on "Grade Student 1" "link" in the "Student 1" "table_row"
And I follow "View all submissions"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade out of 100" to "50"
And I press "Save changes"
And I press "Continue"
And I click on "Edit settings" "link" in the "Administration" "block"
And I press "Ok"
And I click on "Edit settings" "link"
When I expand all fieldsets
Then I should see "Some grades have already been awarded, so the grade type cannot be changed. If you wish to change the maximum grade, you must first choose whether or not to rescale existing grades."
And I set the field "Maximum grade" to "50"
And I press "Save and display"
And I should see "You must choose whether to rescale existing grades or not"
......@@ -447,6 +447,7 @@ $string['subplugintype_assignsubmission'] = 'Submission plugin';
$string['subplugintype_assignsubmission_plural'] = 'Submission plugins';
$string['subplugintype_assignfeedback'] = 'Feedback plugin';
$string['subplugintype_assignfeedback_plural'] = 'Feedback plugins';
$string['teamname'] = 'Team: {$a}';
$string['teamsubmission'] = 'Students submit in groups';
$string['teamsubmission_help'] = 'If enabled students will be divided into groups based on the default set of groups or a custom grouping. A group submission will be shared among group members and all members of the group will see each others changes to the submission.';
$string['teamsubmissiongroupingid'] = 'Grouping for student groups';
......
......@@ -205,7 +205,7 @@ class assign {
public function register_return_link($action, $params) {
global $PAGE;
$params['action'] = $action;
$currenturl = new moodle_url('/mod/assign/view.php');
$currenturl = new moodle_url('/mod/assign/view.php', array('id' => $this->get_course_module()->id));
$currenturl->params($params);
$PAGE->set_url($currenturl);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment