mirrored from git://git.moodle.org/moodle.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'MDL-79990-401' of https://github.com/lameze/moodle into…
… MOODLE_401_STABLE
- Loading branch information
Showing
2 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
grade/grading/form/guide/tests/behat/assign_marking_guide.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
@gradingform @gradingform_guide @javascript | ||
Feature: Display marking guide information to students | ||
In order for students to see the marking guide information | ||
As a teacher | ||
I should be able to change display settings for marking guide information | ||
|
||
Background: | ||
Given the following "courses" exist: | ||
| fullname | shortname | | ||
| Course 1 | C1 | | ||
And the following "users" exist: | ||
| username | firstname | lastname | email | | ||
| teacher1 | Teacher | 1 | teacher1@example.com | | ||
| student1 | Student | 1 | student1@example.com | | ||
And the following "course enrolments" exist: | ||
| user | course | role | | ||
| teacher1 | C1 | editingteacher | | ||
| student1 | C1 | student | | ||
And the following "activities" exist: | ||
| activity | course | name | advancedgradingmethod_submissions | | ||
| assign | C1 | Assign 1 | guide | | ||
And I am on the "Course 1" course page logged in as teacher1 | ||
And I go to "Assign 1" advanced grading definition page | ||
And I set the following fields to these values: | ||
| Name | Assign 1 marking guide | | ||
| Description | Marking guide description | | ||
And I define the following marking guide: | ||
| Criterion name | Description for students | Description for markers | Maximum score | | ||
| Grade Criteria 1 | Grade 1 description for students | Grade 1 description for markers | 70 | | ||
| Grade Criteria 2 | Grade 2 description for students | Grade 2 description for markers | 30 | | ||
And I press "Save marking guide and make it ready" | ||
|
||
Scenario: Confirm that marking guide information is not displayed after student is graded | ||
# Update the existing marking guide to ensure that marks per criterion is displayed. | ||
Given I click on "Edit the current form definition" "link" | ||
And I set the field "Show marks per criterion to students" to "0" | ||
And I press "Save" | ||
And I am on the "Assign 1" "assign activity" page | ||
And I go to "Student 1" "Assign 1" activity advanced grading page | ||
And I grade by filling the marking guide with: | ||
| Grade Criteria 1 | 50 | Excellent work! | | ||
| Grade Criteria 2 | 20 | Try harder | | ||
And I press "Save changes" | ||
When I am on the "Assign 1" "assign activity" page logged in as student1 | ||
# Confirm the marking guide information display after student is graded when marking per criterion display is disabled. | ||
# Confirm that overall grade is displayed. | ||
Then I should see "70.00 / 100.00" | ||
And I should see the marking guide information displayed as: | ||
| criteria | description | remark | | ||
| Grade Criteria 1 | Grade 1 description for students | Excellent work! | | ||
| Grade Criteria 2 | Grade 2 description for students | Try harder | | ||
|
||
Scenario: Confirm that marking guide information is displayed after student is graded | ||
Given I am on the "Assign 1" "assign activity" page logged in as student1 | ||
And I should see "Grade 1 description for students" in the "Grade Criteria 1" "table_row" | ||
And I should see "Grade 2 description for students" in the "Grade Criteria 2" "table_row" | ||
# No grade to student1 yet. | ||
And I should not see "70.00 / 100.00" | ||
# No need to update marking guide as marking guide definition is already enabled by default | ||
And I am on the "Assign 1" "assign activity" page logged in as teacher1 | ||
And I go to "Student 1" "Assign 1" activity advanced grading page | ||
And I grade by filling the marking guide with: | ||
| Grade Criteria 1 | 50 | Excellent work! | | ||
| Grade Criteria 2 | 20 | Try harder | | ||
And I press "Save changes" | ||
When I am on the "Assign 1" "assign activity" page logged in as student1 | ||
# Student1 grade is now displayed. | ||
Then I should see "70.00 / 100.00" | ||
And I should see the marking guide information displayed as: | ||
| criteria | description | remark | maxscore | criteriascore | | ||
| Grade Criteria 1 | Grade 1 description for students | Excellent work! | 70 | 50 / 70 | | ||
| Grade Criteria 2 | Grade 2 description for students | Try harder | 30 | 20 / 30 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Behat custom steps and configuration for mod_bigbluebuttonbn. | ||
* | ||
* @package mod_assign | ||
* @category test | ||
* @copyright 2024 Simey Lameze <simey@moodle.com> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
require_once(__DIR__ . '/../../../../lib/behat/behat_base.php'); | ||
|
||
use Behat\Gherkin\Node\TableNode; | ||
|
||
/** | ||
* Behat custom steps and configuration for mod_assign. | ||
* | ||
* @package mod_assign | ||
* @category test | ||
* @copyright 2024 Simey Lameze <simey@moodle.com> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class behat_mod_assign extends behat_base { | ||
|
||
/** | ||
* Check that the marking guide information is displayed correctly. | ||
* | ||
* @Then /^I should see the marking guide information displayed as:$/ | ||
* @param TableNode $table The table of marking guide information to check. | ||
*/ | ||
public function i_should_see_marking_guide_information(TableNode $table) { | ||
|
||
if (!$table->getRowsHash()) { | ||
return; | ||
} | ||
|
||
$criteriacheck = 1; | ||
foreach ($table as $row) { | ||
|
||
$locator = "//table[@id='guide0-criteria']/tbody/tr[$criteriacheck]/td"; | ||
|
||
$this->assertSession()->elementContains('xpath', "{$locator}[@class='descriptionreadonly']", $row['criteria']); | ||
$this->assertSession()->elementContains('xpath', "{$locator}[@class='descriptionreadonly']", $row['description']); | ||
|
||
if (!empty($row['remark'])) { | ||
$this->assertSession()->elementContains('xpath', "{$locator}[@class='remark']", $row['remark']); | ||
} | ||
|
||
if (!empty($row['maxscore'])) { | ||
$this->assertSession()->elementContains('xpath', "{$locator}[@class='descriptionreadonly']", $row['maxscore']); | ||
} | ||
|
||
if (!empty($row['criteriascore'])) { | ||
$this->assertSession()->elementContains('xpath', "{$locator}[@class='score']", $row['criteriascore']); | ||
} | ||
|
||
$criteriacheck++; | ||
} | ||
} | ||
} |