mirrored from git://git.moodle.org/moodle.git
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-51090: mod_quiz grading validation of an essay question
An invalid format is casted to 0 (if a string) or to some truncated value in other cases (ex: 10..5).
- Loading branch information
Showing
5 changed files
with
128 additions
and
6 deletions.
There are no files selected for viewing
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
59 changes: 59 additions & 0 deletions
59
mod/quiz/tests/behat/validate_manual_mark_correct_format.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,59 @@ | ||
@mod @mod_quiz | ||
Feature: In order to mannually mark a question I want | ||
As a teacher | ||
I must be able to set the marks I want on the Rapport question page. | ||
|
||
Background: | ||
Given the following "users" exist: | ||
| username | firstname | lastname | email | | ||
| teacher1 | Teacher | 1 | teacher1@example.com | | ||
| student1 | Student | 1 | student0@example.com | | ||
And the following "courses" exist: | ||
| fullname | shortname | category | | ||
| Course 1 | C1 | 0 | | ||
And the following "course enrolments" exist: | ||
| user | course | role | | ||
| teacher1 | C1 | editingteacher | | ||
| student1 | C1 | student | | ||
And the following "question categories" exist: | ||
| contextlevel | reference | name | | ||
| Course | C1 | Test questions | | ||
Given the following "questions" exist: | ||
| questioncategory | qtype | name | questiontext | defaultmark | | ||
| Test questions | essay | TF1 | First question | 20 | | ||
And the following "activities" exist: | ||
| activity | name | intro | course | idnumber | grade | | ||
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | 20 | | ||
And quiz "Quiz 1" contains the following questions: | ||
| question | page | requireprevious | | ||
| TF1 | 1 | 0 | | ||
And I log in as "student1" | ||
And I follow "Course 1" | ||
And I follow "Quiz 1" | ||
And I press "Attempt quiz now" | ||
And I follow "Finish attempt ..." | ||
And I press "Submit all and finish" | ||
# Pop-up confirmation | ||
And I click on "Submit all and finish" "button" in the "Confirmation" "dialogue" | ||
And I log out | ||
And I log in as "teacher1" | ||
And I follow "Course 1" | ||
And I follow "Quiz 1" | ||
And I follow "Attempts: 1" | ||
And I follow "Review attempt" | ||
|
||
@javascript | ||
Scenario: Validating the marking of an essay question attempt. | ||
When I follow "Make comment or override mark" | ||
And I switch to "commentquestion" window | ||
And I set the field "Mark" to "25" | ||
And I press "Save" | ||
Then I should see "This grade is outside the valid range." | ||
And I set the field "Mark" to "aa" | ||
And I press "Save" | ||
Then I should see "That is not a valid number." | ||
And I set the field "Mark" to "10" | ||
And I press "Save" | ||
Then I should see "Changes saved" | ||
|
||
|
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
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
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