Skip to content

Commit

Permalink
Merge branch 'MDL-80751-main-2' of https://github.com/mihailges/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyatregubov committed Sep 3, 2024
2 parents 93aa8af + 990d54f commit d38fa6e
Show file tree
Hide file tree
Showing 41 changed files with 105 additions and 147 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,10 @@ Feature: availability_grade

# Log back in as teacher.
When I am on the "A1" "assign activity" page logged in as teacher1
And I change window size to "large"

# Give the assignment 40%.
And I navigate to "Submissions" in current page administration
# Pick the grade link in the row that has [email protected] in it.
And I change window size to "large"
And I click on "Grade" "link" in the "[email protected]" "table_row"
And I go to "[email protected]" "A1" activity advanced grading page
And I change window size to "medium"
And I set the field "Grade out of 100" to "40"
And I click on "Save changes" "button"
Expand Down
9 changes: 3 additions & 6 deletions completion/tests/behat/activity_completion_criteria.feature
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ Feature: Allow to mark course as completed without cron for activity completion
@javascript
Scenario: Update course completion when teacher grades a single assignment
Given I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "Submissions" in current page administration
And I click on "Grade" "link" in the "[email protected]" "table_row"
And I go to "[email protected]" "Test assignment name" activity advanced grading page
And I set the field "Grade out of 100" to "40"
And I click on "Save changes" "button"
And I am on "Completion course" course homepage
Expand All @@ -79,15 +78,13 @@ Feature: Allow to mark course as completed without cron for activity completion
And I set the field "Assignment - Test assignment name2" to "1"
And I press "Save changes"
And I am on the "Test assignment name" "assign activity" page
And I navigate to "Submissions" in current page administration
And I click on "Grade" "link" in the "[email protected]" "table_row"
And I go to "[email protected]" "Test assignment name" activity advanced grading page
And I set the field "Grade out of 100" to "40"
And I click on "Save changes" "button"
And I am on the "Completion course" course page logged in as student1
And I should see "Status: In progress"
And I am on the "Test assignment name2" "assign activity" page logged in as teacher1
And I navigate to "Submissions" in current page administration
And I click on "Grade" "link" in the "[email protected]" "table_row"
And I go to "[email protected]" "Test assignment name2" activity advanced grading page
And I set the field "Grade out of 100" to "40"
And I click on "Save changes" "button"
When I am on the "Completion course" course page logged in as student1
Expand Down
3 changes: 1 addition & 2 deletions completion/tests/behat/restrict_activity_by_grade.feature
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ Feature: Restrict activity availability through grade conditions
And I should see "Submitted for grading"

And I am on the "Grade assignment" "assign activity" page logged in as teacher1
And I navigate to "Submissions" in current page administration
And I change window size to "large"
And I click on "Grade" "link" in the "Student First" "table_row"
And I go to "Student First" "Grade assignment" activity advanced grading page
And I change window size to "medium"
And I set the following fields to these values:
| Grade | 21 |
Expand Down
3 changes: 1 addition & 2 deletions completion/tests/behat/restrict_section_availability.feature
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ Feature: Restrict sections availability through completion or grade conditions
And I should see "Submitted for grading"
And I log out
And I am on the "Grade assignment" "assign activity" page logged in as teacher1
And I navigate to "Submissions" in current page administration
And I change window size to "large"
And I click on "Grade" "link" in the "Student First" "table_row"
And I go to "Student First" "Grade assignment" activity advanced grading page
And I change window size to "medium"
And I set the following fields to these values:
| Grade | 21 |
Expand Down
8 changes: 4 additions & 4 deletions grade/grading/tests/behat/behat_grading.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,19 @@ public function i_go_to_advanced_grading_definition_page($activityname) {
public function i_go_to_activity_advanced_grading_page($userfullname, $activityname) {

// Step to access the user grade page from the grading page.
$gradetext = get_string('gradeverb');

$this->execute('behat_navigation::go_to_breadcrumb_location', $this->escape($activityname));

$this->execute('behat_general::click_link', get_string('gradeitem:submissions', 'mod_assign'));

$this->execute('behat_general::i_click_on_in_the',
array(
$this->escape($gradetext),
'link',
$this->escape(get_string('gradeactions', 'assign')),
'actionmenu',
$this->escape($userfullname),
'table_row'
));

$this->execute('behat_action_menu::i_choose_in_the_open_action_menu', get_string('gradeverb'));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ Feature: We can bulk insert grades for students in a course

Scenario: I can bulk insert grades and check their override flags for grade view.
Given I am on the "Test assignment one" "assign activity" page
And I navigate to "Submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I go to "Student 1" "Test assignment one" activity advanced grading page
And I set the following fields to these values:
| Grade out of 100 | 50 |
And I press "Save changes"
Expand Down Expand Up @@ -97,8 +96,7 @@ Feature: We can bulk insert grades for students in a course

Scenario: I can bulk insert grades and check their override flags for user view.
Given I am on the "Test assignment two" "assign activity" page
And I navigate to "Submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I go to "Student 1" "Test assignment two" activity advanced grading page
And I set the following fields to these values:
| Grade out of 100 | 50 |
And I press "Save changes"
Expand Down
3 changes: 1 addition & 2 deletions grade/tests/behat/grade_feedback.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ Feature: Display feedback on the Grader report
| gradeitem | user | grade | feedback |
| Grade item 1 | student1 | | Longer feedback text content |
And I am on the "Test assignment name 1" "assign activity" page logged in as teacher1
And I navigate to "Submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I go to "Student 1" "Test assignment name 1" activity advanced grading page
And I set the following fields to these values:
| Grade out of 100 | 50 |
| Feedback comments | This is feedback |
Expand Down
3 changes: 1 addition & 2 deletions grade/tests/behat/grade_item_form_unhide.feature
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ Feature: Teacher can unhide grades on the edit page allowing students to view th
| activity | course | idnumber | name | intro | assignfeedback_comments_enabled |
| assign | C1 | assign1 | Test assignment name | Test assignment description | 1 |
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "Submissions" in current page administration
And I change window size to "large"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I go to "Student 1" "Test assignment name" activity advanced grading page
And I set the following fields to these values:
| Grade out of 100 | 50 |
| Feedback comments | I'm the teacher feedback |
Expand Down
6 changes: 2 additions & 4 deletions grade/tests/behat/grade_regrade_do_not_override.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ Feature: Regrading grades does not unnecessarily mark some as overriden
And I set the field "Available aggregation types" to "Weighted mean of grades"
And I press "Save changes"
And I am on the "Assignment 1" "assign activity" page
And I navigate to "Submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I go to "Student 1" "Assignment 1" activity advanced grading page
And I set the field "Grade out of 100" to "80"
And I press "Save and show next"
And I set the field "Grade out of 100" to "60"
Expand Down Expand Up @@ -55,8 +54,7 @@ Feature: Regrading grades does not unnecessarily mark some as overriden
@javascript
Scenario: Confirm overridden course total does not get regraded when activity grade is changed
Given I am on the "Assignment 1" "assign activity" page
And I navigate to "Submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I go to "Student 1" "Assignment 1" activity advanced grading page
And I set the field "Grade out of 100" to "90"
And I press "Save and show next"
And I set the field "Grade out of 100" to "70"
Expand Down
3 changes: 1 addition & 2 deletions grade/tests/behat/grade_scales.feature
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ 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 navigate to "Submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I go to "Student 1" "Test assignment one" activity advanced grading page
And I set the field "Grade" to "A"
And I press "Save changes"
And I click on "[data-action=next-user]" "css_element"
Expand Down
3 changes: 1 addition & 2 deletions grade/tests/behat/grade_single_item_scales.feature
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ 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 "EN Singleitem"
And I press "Save and display"
And I navigate to "Submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I go to "Student 1" "Test assignment one" activity advanced grading page
And I set the field "Grade" to "A"
And I press "Save changes"
When I am on the "Course 1" "grades > course grade settings" page
Expand Down
6 changes: 2 additions & 4 deletions lib/form/tests/behat/modgrade_validation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ Feature: Using the activity grade form element
| grade[modgrade_scale] | ABCDEF |
And I press "Save and display"
And I am on the "Test assignment name" "assign activity" page
And I navigate to "Submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I go to "Student 1" "Test assignment name" activity advanced grading page
And I set the field "Grade" to "C"
And I press "Save changes"
And I follow "Edit settings"
Expand Down Expand Up @@ -120,8 +119,7 @@ Feature: Using the activity grade form element
@javascript
Scenario: Attempting to change the maximum grade when no rescaling option has been chosen
Given I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "Submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I go to "Student 1" "Test assignment name" activity advanced grading page
And I set the field "Grade out of 100" to "50"
And I press "Save changes"
And I follow "Edit settings"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ Feature: Check that any changes to assignment feedback comments are not lost
| activity | name | course | assignfeedback_comments_enabled |
| assign | Test assignment name | C1 | 1 |
And I am on the "Test assignment name" Activity page logged in as teacher1
And I navigate to "Submissions" in current page administration
And I change window size to "large"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I go to "Student 1" "Test assignment name" activity advanced grading page
When I set the following fields to these values:
| Grade out of 100 | 101 |
| Feedback comments | Feedback from teacher. |
Expand Down
13 changes: 4 additions & 9 deletions mod/assign/feedback/editpdf/tests/behat/annotate_pdf.feature
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ Feature: In an assignment, teacher can annotate PDF files during grading
| file | mod/assign/feedback/editpdf/tests/fixtures/testgs.pdf |

When I am on the "Test assignment name" Activity page logged in as teacher1
And I navigate to "Submissions" in current page administration
And I change window size to "large"
And I click on "Grade" "link" in the "Submitted for grading" "table_row"
And I go to "Submitted for grading" "Test assignment name" activity advanced grading page
And I change window size to "medium"
Then I should see "Page 1 of 1"
And I wait for the complete PDF to load
Expand All @@ -55,9 +54,8 @@ Feature: In an assignment, teacher can annotate PDF files during grading
And I follow "View annotated PDF..."
Then I should see "Page 1 of 1"
And I am on the "Test assignment name" Activity page logged in as teacher1
And I navigate to "Submissions" in current page administration
And I change window size to "large"
And I click on "Grade" "link" in the "Submitted for grading" "table_row"
And I go to "Submitted for grading" "Test assignment name" activity advanced grading page
And I change window size to "medium"
Then I should see "Page 1 of 3"
And I wait for the complete PDF to load
Expand Down Expand Up @@ -111,9 +109,8 @@ Feature: In an assignment, teacher can annotate PDF files during grading
And I log out

When I am on the "Test assignment name" Activity page logged in as teacher1
And I navigate to "Submissions" in current page administration
And I change window size to "large"
And I click on "Grade" "link" in the "Submitted for grading" "table_row"
And I go to "Submitted for grading" "Test assignment name" activity advanced grading page
And I change window size to "medium"
Then I should see "Page 1 of 3"
And I click on ".navigate-next-button" "css_element"
Expand Down Expand Up @@ -183,9 +180,7 @@ Feature: In an assignment, teacher can annotate PDF files during grading
| file | mod/assign/feedback/editpdf/tests/fixtures/submission.pdf |

And I am on the "Test assignment name" Activity page logged in as teacher1
And I navigate to "Submissions" in current page administration
And I open the action menu in "Student 2" "table_row"
And I click on "Grade" "link" in the "Student 2" "table_row"
And I go to "Student 1" "Test assignment name" activity advanced grading page
And I wait for the complete PDF to load
And I click on ".linebutton" "css_element"
And I draw on the pdf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ Feature: Ensure that a comment remains visible if its popup menu is open
| file | mod/assign/feedback/editpdf/tests/fixtures/submission.pdf |

And I am on the "Test assignment name" Activity page logged in as teacher1
And I navigate to "Submissions" in current page administration
And I change window size to "large"
And I click on "Grade" "link" in the "Submitted for grading" "table_row"
And I go to "Submitted for grading" "Test assignment name" activity advanced grading page
And I change window size to "medium"
And I wait for the complete PDF to load

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ Feature: In a group assignment, teacher can annotate PDF files for all users
| file | mod/assign/feedback/editpdf/tests/fixtures/submission.pdf |

And I am on the "Test assignment name" Activity page logged in as teacher1
And I navigate to "Submissions" in current page administration
And I click on "Grade" "link" in the "Submitted for grading" "table_row"
And I go to "Submitted for grading" "Test assignment name" activity advanced grading page
And I wait for the complete PDF to load
And I click on ".navigate-next-button" "css_element"
And I wait until the page is ready
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ Feature: In an assignment, teacher can view the feedback for a previous attempt.
| file | mod/assign/feedback/editpdf/tests/fixtures/submission.pdf, mod/assign/feedback/editpdf/tests/fixtures/testgs.pdf |

When I am on the "Test assignment name" Activity page logged in as teacher1
And I navigate to "Submissions" in current page administration
And I change window size to "large"
And I click on "Grade" "link" in the "Submitted for grading" "table_row"
And I go to "Submitted for grading" "Test assignment name" activity advanced grading page
And I change window size to "medium"
Then I should see "Page 1 of 3"
And I click on ".navigate-next-button" "css_element"
Expand Down
5 changes: 1 addition & 4 deletions mod/assign/gradingtable.php
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,6 @@ public function col_grademax(stdClass $row) {
* @return string
*/
public function col_grade(stdClass $row): string {
$separator = $this->output->spacer(array(), true);
$gradingdisabled = $this->assignment->grading_disabled($row->id, true, $this->gradinginfo);
$displaygrade = $this->display_grade($row->grade, $this->quickgrading && !$gradingdisabled, $row->userid, $row->timemarked);

Expand All @@ -1012,10 +1011,8 @@ public function col_grade(stdClass $row): string {
}
$url = new moodle_url('/mod/assign/view.php', $urlparams);

// The grade button.
$gradebutton = html_writer::link($url, get_string('gradeverb'), ['class' => 'btn btn-primary']);
// The container with the grade information.
$gradecontainer = $this->output->container($gradebutton . $separator . $displaygrade, 'w-100');
$gradecontainer = $this->output->container($displaygrade, 'w-100');

$menu = new action_menu();
$menu->set_owner_selector('.gradingtable-actionmenu');
Expand Down
9 changes: 4 additions & 5 deletions mod/assign/tests/behat/allow_another_attempt.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ Feature: In an assignment, students start a new attempt based on their previous
| Test assignment name | student1 | I'm the student first submission |

And I am on the "Test assignment name" Activity page logged in as teacher1
And I navigate to "Submissions" in current page administration
And I change window size to "large"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I go to "Student 1" "Test assignment name" activity advanced grading page
And I change window size to "medium"
And I set the following fields to these values:
| Allow another attempt | 1 |
Expand All @@ -50,9 +49,8 @@ Feature: In an assignment, students start a new attempt based on their previous
And I log out

And I am on the "Test assignment name" Activity page logged in as teacher1
And I navigate to "Submissions" in current page administration
And I change window size to "large"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I go to "Student 1" "Test assignment name" activity advanced grading page
And I change window size to "medium"
And I should see "I'm the student first submission"

Expand Down Expand Up @@ -134,7 +132,8 @@ Feature: In an assignment, students start a new attempt based on their previous
And "Student 2" row "Status" column of "generaltable" table should contain "Reopened"
And "Student 3" row "Status" column of "generaltable" table should contain "Submitted for grading"
And "Student 4" row "Status" column of "generaltable" table should contain "Submitted for grading"
And I click on "Grade" "link" in the "Student 3" "table_row"
And I click on "Grade actions" "actionmenu" in the "Student 3" "table_row"
And I choose "Grade" in the open action menu
And I set the following fields to these values:
| Allow another attempt | 1 |
And I press "Save changes"
Expand Down
Loading

0 comments on commit d38fa6e

Please sign in to comment.