-
Notifications
You must be signed in to change notification settings - Fork 4
CTP-4793 moderated marking behat tests #181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive Behat test coverage for the double marking with blind marking workflow in the coursework module. The tests verify the complete marking cycle from setup through grade release, ensuring blind marking functionality works correctly with double markers and optional moderation.
Key Changes:
- Added 897 lines of Behat test scenarios covering double-blind marking workflows
- Implemented 27 new Behat step definitions to support the test scenarios
- Added helper methods for managing coursework entities (allocations, submissions, feedbacks, moderations)
Reviewed changes
Copilot reviewed 2 out of 6 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| tests/behat/double_marking_blind.feature | Comprehensive test scenarios for double-blind marking workflow including setup, marker allocation, submission, marking, moderation, and grade release |
| tests/behat/behat_mod_coursework.php | New step definitions and helper methods to support double-blind marking test scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
andrewhancox
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how other people feel but I really don't think we should be creating any more custom behat steps unless we can possibly avoid it - if anything we should be going the other way.
Please could you explain further? The dev docs say Sometimes, you will need to set up data that is specific to your plugin, or perform steps that are specific to your plugin's UI. In this case it may be necessary to write new step definitions – no suggestion these should be avoided. If we're adding custom steps where there are already steps in core that do the job then I agree we shouldn't do that. But for setting up some specific state that's not part of the thing being tested, I prefer custom steps to painfully walking through manual clicks. They're quicker to run and quicker to read. |
Generators are the appropriate way to do setup and add far less code, most set up done by this plugin should be happening this way. |
|
Taking mod_assign as an example, there are some generators here: |
|
Yep - regex to get dom elements is fragile as hell, constantly breaks and needs updating. e.g. depending on what is appropriate. That should make writing tests a lot simpler. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 6 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@andrewhancox @leonstr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 7 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
leonstr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI checks for this branch currently fail so this at least needs resolving. If any of the current Behat failures are due to bugs in Coursework then those failing scenarios should be moved to pull requests fixing these bugs.
|
Am ok if I'm losing the popular vote here but I'm still really uncomfortable with this direction - we're doubling down on weird/bad practice. If it's what we need to do in the short/medium term then fair enough but I wanted to reiterate my concerns. |
eb3eff1 to
23ee7dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 6 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
23ee7dc to
72dce74
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 6 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 6 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
reamed i_allocate_the_following_markers() to the_following_markers_are_allocated()
…n_marking.feature using existing behat steps to replace there_is_a_blind_marking_coursework()
c1d88de to
eab83a0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 7 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@leonstr @andrewhancox any chance this can be finalised? |
leonstr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nitpicks.
| $userid = $DB->get_field_sql( | ||
| "SELECT id FROM {user} WHERE firstname = ? AND lastname = ?", | ||
| [$firstname, $lastname] | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe:
$userid = $DB->get_field('user', 'id', ['firstname' => $firsname, 'lastname' => $lastname]);
| I want to perform the full coursework workflow with blind marking. | ||
|
|
||
| Background: | ||
| And the following "roles" exist: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Background should start Given followed by Ands, i.e.:
8 Given the following "roles" exist:
⋮
83 And there is a course
⋮
96 And there is a coursework
| # Student has extension so late submission is in time | ||
| When I am on the "Course 1" "course" page logged in as "student1" | ||
| And I follow "Coursework 1" | ||
| When I visit the coursework page |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be And not When?
| And I follow "Coursework 1" | ||
| Then I should see "Submission" | ||
| And I should see "In marking" | ||
| And I should not see "Edit your submission" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use But not And.
| I want to perform the full coursework workflow with blind marking. | ||
|
|
||
| Background: | ||
| And the following "roles" exist: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Background should start Given followed by Ands, i.e.:
7 Background:
8 Given the following "roles" exist:
⋮
83 And there is a course
⋮
96 And there is a coursework
| Then I should see "Disagreed" in row "2" | ||
| When I follow "Disagreed" | ||
| And I wait until the page is ready | ||
| Then I should see "I don't like it!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be And not Then.
| | Comment | I don't like it at all! | | ||
|
|
||
| And I am on the "Course 1" "course" page logged in as "marker1" | ||
| And I follow "Coursework 1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When?
| And I follow "Agreed" in row "1" | ||
| Then I should see "Moderation for " | ||
| And I should see "Moderator 1" | ||
| And "Save changes" "button" should not exist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use But.
Added Behat tests for moderated marking according to https://liveuclac-my.sharepoint.com/:x:/g/personal/dtnvgal_ucl_ac_uk/ESRtBFnS-xVPmFJl-YynDLsBRKCXh-zHVUgfq0ydIGWSkw?e=FrVGTS&wdOrigin=TEAMS-MAGLEV.p2p_ns.rwc&wdExp=TEAMS-TREATMENT&wdhostclicktime=1763465662042&web=1
Tests involved Turnitin are dealt with in a separate story.