Merge branch 'MDL-47410-310' of git://github.com/mihailges/moodle into MOODLE_310_STABLE

This commit is contained in:
Andrew Nicols
2021-02-17 09:41:40 +08:00
16 changed files with 239 additions and 293 deletions
@@ -10,12 +10,10 @@ Feature: Delete custom licenses
And I navigate to "Licence > Licence manager" in site administration
And I click on "Create licence" "link"
And I set the following fields to these values:
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| version[day] | 1 |
| version[month] | March |
| version[year] | 2019 |
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| Licence version | ##1 March 2019## |
And I press "Save changes"
And I click on "Delete" "icon" in the "MIT" "table_row"
When I click on "Save changes" "button" in the "Delete licence" "dialogue"
@@ -9,12 +9,10 @@ Feature: Custom licences
And I navigate to "Licence > Licence manager" in site administration
And I click on "Create licence" "link"
And I set the following fields to these values:
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| version[day] | 1 |
| version[month] | January |
| version[year] | 2020 |
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| Licence version | ##first day of January 2020## |
When I press "Save changes"
Then I should see "Licence manager"
And I should see "MIT Licence" in the "MIT" "table_row"
@@ -25,12 +23,10 @@ Feature: Custom licences
And I navigate to "Licence > Licence manager" in site administration
And I click on "Create licence" "link"
And I set the following fields to these values:
| shortname | MIT |
| fullname | MIT Licence |
| source | opensource.org/licenses/MIT |
| version[day] | 1 |
| version[month] | January |
| version[year] | 2020 |
| shortname | MIT |
| fullname | MIT Licence |
| source | opensource.org/licenses/MIT |
| Licence version | ##2020-01-01## |
When I press "Save changes"
Then I should see "Invalid source URL"
And I set the following fields to these values:
@@ -49,12 +45,10 @@ Feature: Custom licences
And I navigate to "Licence > Licence manager" in site administration
And I click on "Create licence" "link"
And I set the following fields to these values:
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| version[day] | 1 |
| version[month] | March |
| version[year] | 2019 |
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| Licence version | ##1 March 2019## |
When I press "Save changes"
Then I should see "Licence manager"
And I should see "2019030100" in the "MIT" "table_row"
@@ -65,12 +59,10 @@ Feature: Custom licences
And I navigate to "Licence > Licence manager" in site administration
And I click on "Create licence" "link"
And I set the following fields to these values:
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| version[day] | 1 |
| version[month] | March |
| version[year] | 2019 |
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| Licence version | ##1 Mar 2019## |
And I press "Save changes"
And I should see "Licence manager"
And I should see "MIT Licence" in the "MIT" "table_row"
+5 -4
View File
@@ -136,6 +136,11 @@ class behat_field_manager {
*/
public static function guess_field_type(NodeElement $fieldnode, Session $session) {
// If the type is explicitly set on the element pointed to by the label - use it.
if ($fieldtype = $fieldnode->getAttribute('data-fieldtype')) {
return self::normalise_fieldtype($fieldtype);
}
// Textareas are considered text based elements.
$tagname = strtolower($fieldnode->getTagName());
if ($tagname == 'textarea') {
@@ -151,10 +156,6 @@ class behat_field_manager {
$type = $fieldnode->getAttribute('type');
switch ($type) {
case 'text':
if ($fieldtype = $fieldnode->getAttribute('data-fieldtype')) {
return self::normalise_fieldtype($fieldtype);
}
return 'text';
case 'password':
case 'email':
case 'file':
@@ -267,6 +267,9 @@ XPATH
.//descendant::span[@data-inplaceeditable][descendant::a[%titleMatch%]]
XPATH
,
'date_time' => <<<XPATH
.//fieldset[(%idMatch% or ./legend[%tagTextMatch%]) and (@data-fieldtype='date' or @data-fieldtype='date_time')]
XPATH
],
];
+101
View File
@@ -0,0 +1,101 @@
<?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/>.
/**
* Date form field class.
*
* @package core_form
* @category test
* @copyright 2013 David Monllaó
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php.
require_once(__DIR__ . '/behat_form_group.php');
use Behat\Mink\Exception\ExpectationException;
/**
* Date form field.
*
* This class will be refactored in case we are interested in
* creating more complex formats to fill date and date-time fields.
*
* @package core_form
* @category test
* @copyright 2013 David Monllaó
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class behat_form_date extends behat_form_group {
/**
* Sets the value to a date field.
*
* @param string $value The value to be assigned to the date selector field. The string value must be either
* parsable into a UNIX timestamp or equal to 'disabled' (if disabling the date selector).
* @return void
* @throws ExpectationException If the value is invalid.
*/
public function set_value($value) {
if ($value === 'disabled') {
// Disable the given date selector field.
$this->set_child_field_value('enabled', false);
} else if (is_numeric($value)) { // The value is numeric (unix timestamp).
// Assign the mapped values to each form element in the date selector field.
foreach ($this->get_mapped_fields($value) as $childname => $childvalue) {
$this->set_child_field_value($childname, $childvalue);
}
} else { // Invalid value.
// Get the name of the field.
$fieldname = $this->field->find('css', 'legend')->getHtml();
throw new ExpectationException("Invalid value for '{$fieldname}'", $this->session);
}
}
/**
* Returns the date field identifiers and the values that should be assigned to them.
*
* @param int $timestamp The UNIX timestamp
* @return array
*/
protected function get_mapped_fields(int $timestamp): array {
return [
'enabled' => true,
'day' => date('j', $timestamp),
'month' => date('n', $timestamp),
'year' => date('Y', $timestamp),
];
}
/**
* Sets a value to a child element in the date form field.
*
* @param string $childname The name of the child field
* @param string|bool $childvalue The value
*/
private function set_child_field_value(string $childname, $childvalue) {
// Find the given child form element in the date selector field.
$childelement = $this->field->find('css', "*[name$='[{$childname}]']");
if ($childelement) {
// Get the field instance for the given child form element.
$childinstance = $this->get_field_instance_for_element($childelement);
// Set the value to the child form element.
$childinstance->set_value($childvalue);
}
}
}
@@ -1,42 +0,0 @@
<?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/>.
/**
* Date form field class.
*
* @package core_form
* @category test
* @copyright 2013 David Monllaó
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php.
require_once(__DIR__ . '/behat_form_group.php');
/**
* Date form field.
*
* This class will be refactored in case we are interested in
* creating more complex formats to fill date and date-time fields.
*
* @package core_form
* @category test
* @copyright 2013 David Monllaó
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class behat_form_date_selector extends behat_form_group {
}
@@ -25,7 +25,7 @@
// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php.
require_once(__DIR__ . '/behat_form_date_selector.php');
require_once(__DIR__ . '/behat_form_date.php');
/**
* Date time form field.
@@ -38,5 +38,18 @@ require_once(__DIR__ . '/behat_form_date_selector.php');
* @copyright 2013 David Monllaó
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class behat_form_date_time_selector extends behat_form_date_selector {
class behat_form_date_time extends behat_form_date {
/**
* Returns the date field identifiers and the values that should be assigned to them.
*
* @param int $timestamp The UNIX timestamp
* @return array
*/
protected function get_mapped_fields(int $timestamp): array {
return array_merge(parent::get_mapped_fields($timestamp), [
'hour' => date('G', $timestamp),
'minute' => (int) date('i', $timestamp)
]);
}
}
+13 -2
View File
@@ -173,17 +173,28 @@ class behat_form_field implements behat_session_interface {
* @return behat_form_field
*/
private function guess_type() {
return $this->get_field_instance_for_element($this->field);
}
/**
* Returns the appropriate form field object for a given node element.
*
* @param NodeElement $element The node element
* @return behat_form_field
*/
protected function get_field_instance_for_element(NodeElement $element): behat_form_field {
global $CFG;
// We default to the text-based field if nothing was detected.
if (!$type = behat_field_manager::guess_field_type($this->field, $this->session)) {
if (!$type = behat_field_manager::guess_field_type($element, $this->session)) {
$type = 'text';
}
$classname = 'behat_form_' . $type;
$classpath = $CFG->dirroot . '/lib/behat/form_field/' . $classname . '.php';
require_once($classpath);
return new $classname($this->session, $this->field);
return new $classname($this->session, $element);
}
/**
@@ -1,4 +1,4 @@
<label class="form-check {{#error}}has-danger{{/error}} fitem {{#advanced}}advanced{{/advanced}} {{{element.extraclasses}}}">
<label data-fieldtype="checkbox" class="form-check {{#error}}has-danger{{/error}} fitem {{#advanced}}advanced{{/advanced}} {{{element.extraclasses}}}">
{{^element.hardfrozen}}
{{#element.frozen}}
<input type="hidden" name="{{element.name}}" value="{{element.frozenvalue}}">
@@ -1,6 +1,6 @@
{{< core_form/element-group }}
{{$element}}
<fieldset class="m-0 p-0 border-0" id="{{element.id}}">
<fieldset data-fieldtype="date" class="m-0 p-0 border-0" id="{{element.id}}">
<legend class="sr-only">{{label}}</legend>
<span class="fdate_selector d-flex align-items-center">
{{#element.elements}}
@@ -1,6 +1,6 @@
{{< core_form/element-group }}
{{$element}}
<fieldset class="m-0 p-0 border-0" id="{{element.id}}">
<fieldset data-fieldtype="date_time" class="m-0 p-0 border-0" id="{{element.id}}">
<legend class="sr-only">{{label}}</legend>
<div class="fdate_time_selector d-flex flex-wrap align-items-center">
{{#element.elements}}
+6
View File
@@ -4,6 +4,12 @@ information provided here is intended especially for developers.
=== 3.10.1 ===
* New optional parameter $extracontent for print_collapsible_region_start(). This allows developers to add interactive HTML elements
(e.g. a help icon) after the collapsible region's toggle link.
* Behat now supports date selection from the date form element. Examples:
- I set the field "<field_string>" to "##15 March 2021##"
- I set the field "<field_string>" to "##first day of January last year##"
* Behat now supports date and time selection from the datetime form element. Examples:
- I set the field "<field_string>" to "##15 March 2021 08:15##"
- I set the field "<field_string>" to "##first day of January last year noon##"
=== 3.10 ===
* PHPUnit has been upgraded to 8.5. That comes with a few changes:
@@ -40,18 +40,13 @@ Feature: Assign group override
And I navigate to "Group overrides" in current page administration
And I press "Add group override"
And I set the following fields to these values:
| Override group | Group 1 |
| id_duedate_enabled | 1 |
| duedate[day] | 1 |
| duedate[month] | January |
| duedate[year] | 2020 |
| duedate[hour] | 08 |
| duedate[minute] | 00 |
| Override group | Group 1 |
| Due date | ##1 Jan 2020 08:00## |
And I press "Save"
And I should see "Wednesday, 1 January 2020, 8:00"
Then I click on "Edit" "link" in the "Group 1" "table_row"
And I set the following fields to these values:
| duedate[year] | 2030 |
| Due date | ##1 Jan 2030 08:00## |
And I press "Save"
And I should see "Tuesday, 1 January 2030, 8:00"
And I click on "Delete" "link"
@@ -65,19 +60,14 @@ Feature: Assign group override
And I navigate to "Group overrides" in current page administration
And I press "Add group override"
And I set the following fields to these values:
| Override group | Group 1 |
| id_duedate_enabled | 1 |
| duedate[day] | 1 |
| duedate[month] | January |
| duedate[year] | 2020 |
| duedate[hour] | 08 |
| duedate[minute] | 00 |
| Override group | Group 1 |
| Due date | ##1 Jan 2020 08:00## |
And I press "Save"
And I should see "Wednesday, 1 January 2020, 8:00"
Then I click on "copy" "link"
And I set the following fields to these values:
| Override group | Group 2 |
| duedate[year] | 2030 |
| Override group | Group 2 |
| Due date | ##1 Jan 2030 08:00## |
And I press "Save"
And I should see "Tuesday, 1 January 2030, 8:00"
And I should see "Group 2"
@@ -88,25 +78,15 @@ Feature: Assign group override
When I follow "Test assignment name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| id_duedate_enabled | 1 |
| id_allowsubmissionsfromdate_enabled | 0 |
| id_cutoffdate_enabled | 0 |
| duedate[day] | 1 |
| duedate[month] | January |
| duedate[year] | 2000 |
| duedate[hour] | 08 |
| duedate[minute] | 00 |
| Allow submissions from | disabled |
| Due date | ##1 Jan 2000 08:00## |
| Cut-off date | disabled |
And I press "Save and display"
And I navigate to "Group overrides" in current page administration
And I press "Add group override"
And I set the following fields to these values:
| Override group | Group 1 |
| id_duedate_enabled | 1 |
| duedate[day] | 1 |
| duedate[month] | January |
| duedate[year] | 2020 |
| duedate[hour] | 08 |
| duedate[minute] | 00 |
| Override group | Group 1 |
| Due date | ##1 Jan 2020 08:00## |
And I press "Save"
And I should see "Wednesday, 1 January 2020, 8:00"
And I log out
@@ -126,25 +106,15 @@ Feature: Assign group override
When I follow "Test assignment name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| id_duedate_enabled | 0 |
| id_allowsubmissionsfromdate_enabled | 0 |
| id_cutoffdate_enabled | 1 |
| cutoffdate[day] | 1 |
| cutoffdate[month] | January |
| cutoffdate[year] | 2000 |
| cutoffdate[hour] | 08 |
| cutoffdate[minute] | 00 |
| Due date | disabled |
| Allow submissions from | disabled |
| Cut-off date | ##1 Jan 2000 08:00## |
And I press "Save and display"
And I navigate to "Group overrides" in current page administration
And I press "Add group override"
And I set the following fields to these values:
| Override group | Group 1 |
| id_cutoffdate_enabled | 1 |
| cutoffdate[day] | 1 |
| cutoffdate[month] | January |
| cutoffdate[year] | 2030 |
| cutoffdate[hour] | 08 |
| cutoffdate[minute] | 00 |
| Override group | Group 1 |
| Cut-off date | ##1 Jan 2030 08:00## |
And I press "Save"
And I should see "Tuesday, 1 January 2030, 8:00"
And I log out
@@ -164,25 +134,15 @@ Feature: Assign group override
When I follow "Test assignment name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| id_duedate_enabled | 0 |
| id_allowsubmissionsfromdate_enabled | 1 |
| id_cutoffdate_enabled | 0 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2030 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Due date | disabled |
| Allow submissions from | ##1 January 2030 08:00## |
| Cut-off date | disabled |
And I press "Save and display"
And I navigate to "Group overrides" in current page administration
And I press "Add group override"
And I set the following fields to these values:
| Override group | Group 1 |
| id_allowsubmissionsfromdate_enabled | 1 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2015 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Override group | Group 1 |
| Allow submissions from | ##1 Jan 2015 08:00## |
And I press "Save"
And I should see "Thursday, 1 January 2015, 8:00"
And I log out
@@ -204,38 +164,23 @@ Feature: Assign group override
When I follow "Test assignment name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| id_duedate_enabled | 0 |
| id_allowsubmissionsfromdate_enabled | 1 |
| id_cutoffdate_enabled | 0 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2040 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Due date | disabled |
| Allow submissions from | ##1 January 2040 08:00## |
| Cut-off date | disabled |
And I press "Save and display"
And I navigate to "Group overrides" in current page administration
And I press "Add group override"
And I set the following fields to these values:
| Override group | Group 1 |
| id_allowsubmissionsfromdate_enabled | 1 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2030 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Override group | Group 1 |
| Allow submissions from | ##1 January 2030 08:00## |
And I press "Save"
And I should see "Tuesday, 1 January 2030, 8:00"
And I follow "Test assignment name"
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
| id_allowsubmissionsfromdate_enabled | 1 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2031 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Override user | Student1 |
| Allow submissions from | ##1 January 2031 08:00## |
And I press "Save"
And I should see "Wednesday, 1 January 2031, 8:00"
And I log out
@@ -304,22 +249,12 @@ Feature: Assign group override
And I navigate to "Group overrides" in current page administration
And I press "Add group override"
And I set the following fields to these values:
| Override group | Group 1 |
| id_allowsubmissionsfromdate_enabled | 1 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2020 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Override group | Group 1 |
| Allow submissions from | ##1 January 2020 08:00## |
And I press "Save and enter another override"
And I set the following fields to these values:
| Override group | Group 2 |
| id_allowsubmissionsfromdate_enabled | 1 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2020 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Override group | Group 2 |
| Allow submissions from | ##1 January 2020 08:00## |
And I press "Save"
And I log out
When I log in as "teacher1"
@@ -26,33 +26,21 @@ Feature: Assignment with no calendar capabilites
Given I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
When I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name |
| Description | Test assignment description |
| id_allowsubmissionsfromdate_enabled | 1 |
| id_allowsubmissionsfromdate_day | 1 |
| id_allowsubmissionsfromdate_month | 1 |
| id_allowsubmissionsfromdate_year | 2017 |
| id_duedate_enabled | 1 |
| id_duedate_day | 1 |
| id_duedate_month | 2 |
| id_duedate_year | 2017 |
| id_cutoffdate_enabled | 1 |
| id_cutoffdate_day | 2 |
| id_cutoffdate_month | 2 |
| id_cutoffdate_year | 2017 |
| id_gradingduedate_enabled | 1 |
| id_gradingduedate_day | 1 |
| id_gradingduedate_month | 3 |
| id_gradingduedate_year | 2017 |
| Assignment name | Test assignment name |
| Description | Test assignment description |
| Allow submissions from | ##1 January 2017## |
| Due date | ##1 February 2017## |
| Cut-off date | ##2 February 2017## |
| Remind me to grade by | ##1 March 2017## |
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test assignment name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| id_allowsubmissionsfromdate_year | 2018 |
| id_duedate_year | 2018 |
| id_cutoffdate_year | 2018 |
| id_gradingduedate_year | 2018 |
| Allow submissions from | ##1 January 2018## |
| Due date | ##1 February 2018## |
| Cut-off date | ##2 February 2018## |
| Remind me to grade by | ##1 March 2018## |
And I press "Save and return to course"
Then I should see "Test assignment name"
@@ -30,18 +30,13 @@ Feature: Assign user override
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
| id_duedate_enabled | 1 |
| duedate[day] | 1 |
| duedate[month] | January |
| duedate[year] | 2020 |
| duedate[hour] | 08 |
| duedate[minute] | 00 |
| Override user | Student1 |
| Due date | ##first day of January 2020 08:00## |
And I press "Save"
And I should see "Wednesday, 1 January 2020, 8:00"
Then I click on "Edit" "link" in the "Sam1 Student1" "table_row"
And I set the following fields to these values:
| duedate[year] | 2030 |
| Due date | ##first day of January 2030 08:00## |
And I press "Save"
And I should see "Tuesday, 1 January 2030, 8:00"
And I click on "Delete" "link"
@@ -56,19 +51,14 @@ Feature: Assign user override
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
| id_duedate_enabled | 1 |
| duedate[day] | 1 |
| duedate[month] | January |
| duedate[year] | 2020 |
| duedate[hour] | 08 |
| duedate[minute] | 00 |
| Override user | Student1 |
| Due date | ##2020-01-01 08:00## |
And I press "Save"
And I should see "Wednesday, 1 January 2020, 8:00"
Then I click on "copy" "link"
And I set the following fields to these values:
| Override user | Student2 |
| duedate[year] | 2030 |
| Override user | Student2 |
| Due date | ##2030-01-01 08:00## |
And I press "Save"
And I should see "Tuesday, 1 January 2030, 8:00"
And I should see "Sam2 Student2"
@@ -80,25 +70,15 @@ Feature: Assign user override
When I follow "Test assignment name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| id_duedate_enabled | 1 |
| id_allowsubmissionsfromdate_enabled | 0 |
| id_cutoffdate_enabled | 0 |
| duedate[day] | 1 |
| duedate[month] | January |
| duedate[year] | 2000 |
| duedate[hour] | 08 |
| duedate[minute] | 00 |
| Allow submissions from | disabled |
| Due date | ##1 Jan 2000 08:00## |
| Cut-off date | disabled |
And I press "Save and display"
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
| id_duedate_enabled | 1 |
| duedate[day] | 1 |
| duedate[month] | January |
| duedate[year] | 2020 |
| duedate[hour] | 08 |
| duedate[minute] | 00 |
| Override user | Student1 |
| Due date | ##1 Jan 2020 08:00## |
And I press "Save"
And I should see "Wednesday, 1 January 2020, 8:00"
And I log out
@@ -119,25 +99,15 @@ Feature: Assign user override
When I follow "Test assignment name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| id_duedate_enabled | 0 |
| id_allowsubmissionsfromdate_enabled | 0 |
| id_cutoffdate_enabled | 1 |
| cutoffdate[day] | 1 |
| cutoffdate[month] | January |
| cutoffdate[year] | 2000 |
| cutoffdate[hour] | 08 |
| cutoffdate[minute] | 00 |
| Due date | disabled |
| Allow submissions from | disabled |
| Cut-off date | ##1 Jan 2000 08:00## |
And I press "Save and display"
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
| id_cutoffdate_enabled | 1 |
| cutoffdate[day] | 1 |
| cutoffdate[month] | January |
| cutoffdate[year] | 2030 |
| cutoffdate[hour] | 08 |
| cutoffdate[minute] | 00 |
| Override user | Student1 |
| Cut-off date | ##1 Jan 2030 08:00## |
And I press "Save"
And I should see "Tuesday, 1 January 2030, 8:00"
And I log out
@@ -158,25 +128,15 @@ Feature: Assign user override
When I follow "Test assignment name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| id_duedate_enabled | 0 |
| id_allowsubmissionsfromdate_enabled | 1 |
| id_cutoffdate_enabled | 0 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2030 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Due date | disabled |
| Allow submissions from | ##1 January 2030 08:00## |
| Cut-off date | disabled |
And I press "Save and display"
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
| id_allowsubmissionsfromdate_enabled | 1 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2015 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Override user | Student1 |
| Allow submissions from | ##1 Jan 2015 08:00## |
And I press "Save"
And I should see "Thursday, 1 January 2015, 8:00"
And I log out
@@ -253,22 +213,12 @@ Feature: Assign user override
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
| id_allowsubmissionsfromdate_enabled | 1 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2015 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Override user | Student1 |
| Allow submissions from | ##first day of January 2015 08:00## |
And I press "Save and enter another override"
And I set the following fields to these values:
| Override user | Student2 |
| id_allowsubmissionsfromdate_enabled | 1 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2015 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Override user | Student2 |
| Allow submissions from | ##first day of January 2015 08:00## |
And I press "Save"
And I log out
When I log in as "teacher1"
@@ -290,13 +240,8 @@ Feature: Assign user override
When I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
| id_allowsubmissionsfromdate_enabled | 1 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2015 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Override user | Student1 |
| Allow submissions from | ##1 Jan 2015 08:00## |
And I press "Save"
Then I should see "This override is inactive"
And "Edit" "icon" should exist in the "Sam1 Student1" "table_row"
@@ -114,13 +114,8 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student |
| id_duedate_enabled | 1 |
| duedate[day] | 1 |
| duedate[month] | January |
| duedate[year] | 2030 |
| duedate[hour] | 08 |
| duedate[minute] | 00 |
| Override user | Student |
| Due date | ##2030-01-01 08:00## |
And I press "Save"
And I should see "Tuesday, 1 January 2030, 8:00"
And I follow "Test assignment name"