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-69690-401' of https://github.com/ilyatregubov/moodle …
…into MOODLE_401_STABLE
- Loading branch information
Showing
4 changed files
with
129 additions
and
5 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
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,48 @@ | ||
<?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/>. | ||
|
||
/** | ||
* Grade item, fieldname mapping. | ||
* | ||
* @package core_grades | ||
* @copyright Ilya Tregubov <ilya.a.tregubov@gmail.com> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace core_grades\local\gradeitem; | ||
|
||
/** | ||
* Grade item, fieldname mapping. | ||
* | ||
* @package core_grades | ||
* @copyright Ilya Tregubov <ilya.a.tregubov@gmail.com> | ||
*/ | ||
interface fieldname_mapping { | ||
|
||
/** | ||
* Get the suffixed field name for an activity field mapped from its itemnumber. | ||
* | ||
* For legacy reasons, the first itemnumber has no suffix on field names. | ||
* | ||
* @param string $component The component that the grade item belongs to | ||
* @param int $itemnumber The grade itemnumber | ||
* @param string $fieldname The name of the field to be rewritten | ||
* @return string The translated field name | ||
*/ | ||
public static function get_field_name_for_itemnumber(string $component, int $itemnumber, string $fieldname): string; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
@mod @mod_workshop | ||
Feature: Workshop assessment with grade to pass | ||
In order to use workshop activity | ||
As a teacher | ||
I need to be able to setup workshop with require assessment grade and grade to pass | ||
|
||
Background: | ||
Given the following "users" exist: | ||
| username | firstname | lastname | email | | ||
| student1 | Sam1 | Student1 | student1@example.com | | ||
| teacher1 | Terry1 | Teacher1 | teacher1@example.com | | ||
And the following "courses" exist: | ||
| fullname | shortname | format | enablecompletion | | ||
| Course1 | c1 | topics | 1 | | ||
And the following "course enrolments" exist: | ||
| user | course | role | | ||
| student1 | c1 | student | | ||
| teacher1 | c1 | editingteacher | | ||
|
||
@javascript | ||
Scenario: Setup workshop with assessment grade and pass grade set | ||
And I log in as "teacher1" | ||
And I am on "Course1" course homepage with editing mode on | ||
And I add a "Workshop" to section "0" | ||
And I expand all fieldsets | ||
When I set the following fields to these values: | ||
| Workshop name | Test workshop | | ||
| Completion tracking | Show activity as complete when conditions are met | | ||
| Require grade | Assessment | | ||
| completionpassgrade | 1 | | ||
And I press "Save and display" | ||
And I should see "This activity does not have a valid grade to pass set. It may be set in the Grade section of the activity settings." | ||
And I set the field "Assessment grade to pass" to "" | ||
And I press "Save and display" | ||
And I should see "This activity does not have a valid grade to pass set. It may be set in the Grade section of the activity settings." | ||
And I set the field "Assessment grade to pass" to "81" | ||
And I press "Save and display" | ||
And I should see "The grade to pass can not be greater than the maximum possible grade 20" | ||
And I set the field "Assessment grade to pass" to "hello" | ||
And I press "Save and display" | ||
And I should see "You must enter a number here." | ||
And I set the field "Assessment grade to pass" to "12,34" | ||
And I press "Save and display" | ||
And I should see "You must enter a number here." | ||
And I set the field "Assessment grade to pass" to "10" | ||
And I press "Save and display" | ||
Then I should see "Setup phase" in the "h3#mod_workshop-userplanheading" "css_element" |