Skip to content

Commit

Permalink
Merge branch 'MDL-78614-39' of https://github.com/noeldemartin/moodle
Browse files Browse the repository at this point in the history
…into MOODLE_39_STABLE
  • Loading branch information
andrewnicols committed Jul 5, 2023
2 parents ff3ed67 + 837d4f6 commit 409d3db
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 22 deletions.
2 changes: 2 additions & 0 deletions mod/quiz/tests/behat/behat_mod_quiz.php
Expand Up @@ -542,6 +542,8 @@ public function the_page_break_icon_after_question_should_not_exist($addorremove

/**
* Check the add or remove page-break link after a particular question contains the given parameters in its url.
*
* @When /^the "(Add|Remove)" page break link after question "(?P<question_name>(?:[^"]|\\")*) should contain:$/
* @When /^the "(Add|Remove)" page break link after question "(?P<question_name>(?:[^"]|\\")*) should contain:"$/
* @param string $addorremoves 'Add' or 'Remove'.
* @param string $questionname the name of the question before the icon to click.
Expand Down
Expand Up @@ -82,6 +82,7 @@ public function i_add_a_reviewer_for_workshop_participant($reviewername, $partic
/**
* Manually allocates multiple reviewers in workshop.
*
* @When /^I allocate submissions in workshop "(?P<workshop_name_string>(?:[^"]|\\")*)" as:$/
* @When /^I allocate submissions in workshop "(?P<workshop_name_string>(?:[^"]|\\")*)" as:"$/
* @param string $workshopname
* @param TableNode $table should have one column with title 'Reviewer' and another with title 'Participant' (or 'Reviewee')
Expand Down
3 changes: 3 additions & 0 deletions mod/workshop/tests/behat/behat_mod_workshop.php
Expand Up @@ -64,6 +64,7 @@ public function i_change_phase_in_workshop_to($workshopname, $phase) {
/**
* Adds or edits a student workshop submission.
*
* @When /^I add a submission in workshop "(?P<workshop_name_string>(?:[^"]|\\")*)" as:$/
* @When /^I add a submission in workshop "(?P<workshop_name_string>(?:[^"]|\\")*)" as:"$/
* @param string $workshopname
* @param TableNode $table data to fill the submission form with, must contain 'Title'
Expand All @@ -85,6 +86,7 @@ public function i_add_a_submission_in_workshop_as($workshopname, $table) {
/**
* Sets the workshop assessment form.
*
* @When /^I edit assessment form in workshop "(?P<workshop_name_string>(?:[^"]|\\")*)" as:$/
* @When /^I edit assessment form in workshop "(?P<workshop_name_string>(?:[^"]|\\")*)" as:"$/
* @param string $workshopname
* @param TableNode $table data to fill the submission form with, must contain 'Title'
Expand All @@ -103,6 +105,7 @@ public function i_edit_assessment_form_in_workshop_as($workshopname, $table) {
/**
* Peer-assesses a workshop submission.
*
* @When /^I assess submission "(?P<submission_string>(?:[^"]|\\")*)" in workshop "(?P<workshop_name_string>(?:[^"]|\\")*)" as:$/
* @When /^I assess submission "(?P<submission_string>(?:[^"]|\\")*)" in workshop "(?P<workshop_name_string>(?:[^"]|\\")*)" as:"$/
* @param string $submission
* @param string $workshopname
Expand Down
8 changes: 4 additions & 4 deletions mod/workshop/tests/behat/delete_submission.feature
Expand Up @@ -25,24 +25,24 @@ Feature: Workshop submission removal
| workshop | TestWorkshop | c1 | workshop1 | 1 |
# Teacher sets up assessment form and changes the phase to submission.
And I am on the "Course1" course page logged in as teacher1
And I edit assessment form in workshop "TestWorkshop" as:"
And I edit assessment form in workshop "TestWorkshop" as:
| id_description__idx_0_editor | Aspect1 |
| id_description__idx_1_editor | Aspect2 |
| id_description__idx_2_editor | |
And I change phase in workshop "TestWorkshop" to "Submission phase"
# Student1 submits.
And I am on the "TestWorkshop" "workshop activity" page logged in as student1
And I add a submission in workshop "TestWorkshop" as:"
And I add a submission in workshop "TestWorkshop" as:
| Title | Submission1 |
| Submission content | Some content |
# Student2 submits.
And I am on the "Course1" course page logged in as student2
And I add a submission in workshop "TestWorkshop" as:"
And I add a submission in workshop "TestWorkshop" as:
| Title | Submission2 |
| Submission content | Some content |
# Teacher allocates student3 to be reviewer of student2's submission.
And I am on the "TestWorkshop" "workshop activity" page logged in as teacher1
And I allocate submissions in workshop "TestWorkshop" as:"
And I allocate submissions in workshop "TestWorkshop" as:
| Participant | Reviewer |
| Sam2 Student2 | Sam3 Student3 |

Expand Down
2 changes: 1 addition & 1 deletion mod/workshop/tests/behat/example_submission.feature
Expand Up @@ -21,7 +21,7 @@ Feature: Provide example submission
| workshop | TestWorkshop | c1 | workshop1 | 1 |
# As a teacher, define the assessment form to be used in the workshop.
When I am on the "Course1" course page logged in as teacher1
And I edit assessment form in workshop "TestWorkshop" as:"
And I edit assessment form in workshop "TestWorkshop" as:
| id_description__idx_0_editor | Aspect1 |
| id_description__idx_1_editor | Aspect2 |
| id_description__idx_2_editor | |
Expand Down
8 changes: 4 additions & 4 deletions mod/workshop/tests/behat/export_submission.feature
Expand Up @@ -30,18 +30,18 @@ Feature: Exporting workshop submissions and assessments to a portfolio
And I click on "Save" "button"
# Teacher sets up assessment form and changes the phase to submission.
And I am on the "Course1" course page logged in as teacher1
And I edit assessment form in workshop "TestWorkshop" as:"
And I edit assessment form in workshop "TestWorkshop" as:
| id_description__idx_0_editor | Aspect1 |
| id_description__idx_1_editor | Aspect2 |
And I change phase in workshop "TestWorkshop" to "Submission phase"
# Student1 submits.
And I am on the "TestWorkshop" "workshop activity" page logged in as student1
And I add a submission in workshop "TestWorkshop" as:"
And I add a submission in workshop "TestWorkshop" as:
| Title | Submission1 |
| Submission content | Some content |
# Student2 submits.
And I am on the "Course1" course page logged in as student2
And I add a submission in workshop "TestWorkshop" as:"
And I add a submission in workshop "TestWorkshop" as:
| Title | Submission2 |
| Submission content | Some content |
# Teacher allocates reviewers and changes the phase to assessment.
Expand All @@ -51,7 +51,7 @@ Feature: Exporting workshop submissions and assessments to a portfolio
And I should see "Submitted (2) / not submitted (0)"
And I should see "Submission1" in the "Sam1 Student1" "table_row"
And I should see "Submission2" in the "Sam2 Student2" "table_row"
And I allocate submissions in workshop "TestWorkshop" as:"
And I allocate submissions in workshop "TestWorkshop" as:
| Participant | Reviewer |
| Sam1 Student1 | Sam2 Student2 |
| Sam2 Student2 | Sam1 Student1 |
Expand Down
6 changes: 3 additions & 3 deletions mod/workshop/tests/behat/file_type_restriction.feature
Expand Up @@ -57,7 +57,7 @@ Feature: File types of the submission and feedback attachments can be limitted
Scenario: Overall feedback attachments obey the list of allowed file types
# Define workshop to accept only .php files as overall feedback attachments.
Given I am on the "Course1" course page logged in as teacher1
And I edit assessment form in workshop "TestWorkshop" as:"
And I edit assessment form in workshop "TestWorkshop" as:
| id_description__idx_0_editor | Aspect1 |
| id_description__idx_1_editor | Aspect2 |
| id_description__idx_2_editor | |
Expand All @@ -69,12 +69,12 @@ Feature: File types of the submission and feedback attachments can be limitted
And I change phase in workshop "TestWorkshop" to "Submission phase"
# As a student, attempt to attach an invalid file.
And I am on the TestWorkshop "workshop activity" page logged in as student1
And I add a submission in workshop "TestWorkshop" as:"
And I add a submission in workshop "TestWorkshop" as:
| Title | Submission1 |
| Submission content | Some content |
# As a teacher, allocate that submission to be assessed by another student.
And I am on the TestWorkshop "workshop activity" page logged in as teacher1
And I allocate submissions in workshop "TestWorkshop" as:"
And I allocate submissions in workshop "TestWorkshop" as:
| Participant | Reviewer |
| Sam1 Student1 | Sam2 Student2 |
And I change phase in workshop "TestWorkshop" to "Assessment phase"
Expand Down
16 changes: 8 additions & 8 deletions mod/workshop/tests/behat/workshop_assessment.feature
Expand Up @@ -27,26 +27,26 @@ Feature: Workshop submission and assessment
| workshop | TestWorkshop | c1 | workshop1 | 2 | 1 |
# teacher1 sets up assessment form and changes the phase to submission
When I am on the "Course1" course page logged in as teacher1
And I edit assessment form in workshop "TestWorkshop" as:"
And I edit assessment form in workshop "TestWorkshop" as:
| id_description__idx_0_editor | Aspect1 |
| id_description__idx_1_editor | Aspect2 |
| id_description__idx_2_editor | |
And I change phase in workshop "TestWorkshop" to "Submission phase"
# student1 submits
And I am on the TestWorkshop "workshop activity" page logged in as student1
Then I should see "Submit your work"
And I add a submission in workshop "TestWorkshop" as:"
And I add a submission in workshop "TestWorkshop" as:
| Title | Submission1 |
| Submission content | Some content |
And "//div[@class='submission-full' and contains(.,'Submission1') and contains(.,'submitted on')]" "xpath_element" should exist
# student2 submits
And I am on the "Course1" course page logged in as student2
And I add a submission in workshop "TestWorkshop" as:"
And I add a submission in workshop "TestWorkshop" as:
| Title | Submission2 |
| Submission content | Some content |
# student3 submits
And I am on the "Course1" course page logged in as student3
And I add a submission in workshop "TestWorkshop" as:"
And I add a submission in workshop "TestWorkshop" as:
| Title | Submission3 |
| Submission content | Some content |
# teacher1 allocates reviewers and changes the phase to assessment
Expand All @@ -59,7 +59,7 @@ Feature: Workshop submission and assessment
And I should see "Submission2" in the "Sam2 Student2" "table_row"
And I should see "Submission3" in the "Sam3 Student3" "table_row"
And I should see "No submission found for this user" in the "Sam4 Student4" "table_row"
And I allocate submissions in workshop "TestWorkshop" as:"
And I allocate submissions in workshop "TestWorkshop" as:
| Participant | Reviewer |
| Sam1 Student1 | Sam2 Student2 |
| Sam2 Student2 | Sam1 Student1 |
Expand All @@ -71,15 +71,15 @@ Feature: Workshop submission and assessment
# student1 assesses work of student2 and student3
And I am on the TestWorkshop "workshop activity" page logged in as student1
And "//ul[@class='tasks']/li[div[@class='title' and contains(.,'Assess peers')]]/div[@class='details' and contains(.,'pending: 2') and contains(.,'total: 2')]" "xpath_element" should exist
And I assess submission "Sam2" in workshop "TestWorkshop" as:"
And I assess submission "Sam2" in workshop "TestWorkshop" as:
| grade__idx_0 | 5 / 10 |
| peercomment__idx_0 | You can do better |
| grade__idx_1 | 10 / 10 |
| peercomment__idx_1 | Amazing |
| Feedback for the author | Good work |
And "//ul[@class='tasks']/li[div[@class='title' and contains(.,'Assess peers')]]/div[@class='details' and contains(.,'pending: 1') and contains(.,'total: 2')]" "xpath_element" should exist
And I am on "Course1" course homepage
And I assess submission "Sam3" in workshop "TestWorkshop" as:"
And I assess submission "Sam3" in workshop "TestWorkshop" as:
| grade__idx_0 | 9 / 10 |
| peercomment__idx_0 | Well done |
| grade__idx_1 | 8 / 10 |
Expand All @@ -89,7 +89,7 @@ Feature: Workshop submission and assessment
# student2 assesses work of student1
And I am on the TestWorkshop "workshop activity" page logged in as student2
And "//ul[@class='tasks']/li[div[@class='title' and contains(.,'Assess peers')]]/div[@class='details' and contains(.,'pending: 1') and contains(.,'total: 1')]" "xpath_element" should exist
And I assess submission "Sam1" in workshop "TestWorkshop" as:"
And I assess submission "Sam1" in workshop "TestWorkshop" as:
| grade__idx_0 | 6 / 10 |
| peercomment__idx_0 | |
| grade__idx_1 | 7 / 10 |
Expand Down
4 changes: 2 additions & 2 deletions mod/workshop/tests/behat/workshop_late_submission.feature
Expand Up @@ -23,7 +23,7 @@ Feature: Workshop 'Late submissions are allowed' task
| workshop | TestWorkshop1 | c1 | workshop1 | 1 | 1514904308 | 1893369600 |
# Teacher sets up assessment form and changes the phase to submission.
And I am on the "TestWorkshop1" "workshop activity" page logged in as teacher1
And I edit assessment form in workshop "TestWorkshop1" as:"
And I edit assessment form in workshop "TestWorkshop1" as:
| id_description__idx_0_editor | Aspect1 |
| id_description__idx_1_editor | Aspect2 |
| id_description__idx_2_editor | Aspect3 |
Expand All @@ -35,7 +35,7 @@ Feature: Workshop 'Late submissions are allowed' task
When I am on the "TestWorkshop1" "workshop activity" page logged in as student1
Then I should see "Submissions deadline:"
And I should not see "Late submissions are allowed"
And I add a submission in workshop "TestWorkshop1" as:"
And I add a submission in workshop "TestWorkshop1" as:
| Title | Submission from s1 |
| Submission content | Some content from student1 |

Expand Down

0 comments on commit 409d3db

Please sign in to comment.