Browse Source

Add test for changing default staus set,

improve some language strings relating to status sets
MOODLE_32_STABLE
Dan Marsden 8 years ago
parent
commit
64e6df0154
  1. 2
      lang/en/attendance.php
  2. 2
      renderables.php
  3. 2
      renderer.php
  4. 32
      tests/behat/defaultstatus.feature
  5. 2
      tests/behat/extra_features.feature
  6. 2
      tests/behat/preferences.feature

2
lang/en/attendance.php

@ -158,7 +158,6 @@ $string['moreattendance'] = 'Attendance has been successfully taken for this pag
$string['moveleft'] = 'Move left';
$string['moveright'] = 'Move right';
$string['mustselectusers'] = 'Must select users to export';
$string['myvariables'] = 'My Variables';
$string['newdate'] = 'New date';
$string['newduration'] = 'New duration';
$string['newstatusset'] = 'New set of statuses';
@ -267,6 +266,7 @@ $string['status'] = 'Status';
$string['statuses'] = 'Statuses';
$string['statusdeleted'] = 'Status deleted';
$string['statusset'] = 'Status set {$a}';
$string['statussetsettings'] = 'Status set';
$string['strftimedm'] = '%h %d';
$string['strftimedmy'] = '%d %h %Y';
$string['strftimedmyhm'] = '%d %h %Y %I.%M%P'; // Line added to allow multiple sessions in the same day.

2
renderables.php

@ -96,7 +96,7 @@ class attendance_tabs implements renderable {
if (has_capability('mod/attendance:changepreferences', $context)) {
$toprow[] = new tabobject(self::TAB_PREFERENCES, $this->att->url_preferences()->out(),
get_string('settings', 'attendance'));
get_string('statussetsettings', 'attendance'));
}
if (has_capability('mod/attendance:managetemporaryusers', $context)) {
$toprow[] = new tabobject(self::TAB_TEMPORARYUSERS, $this->att->url_managetemp()->out(),

2
renderer.php

@ -1445,7 +1445,7 @@ class mod_attendance_renderer extends plugin_renderer_base {
$table->data[$i][] = $this->construct_preferences_button(get_string('add', 'attendance'),
mod_attendance_preferences_page_params::ACTION_ADD);
$o = html_writer::tag('h1', get_string('myvariables', 'attendance'));
$o = html_writer::tag('h1', get_string('statussetsettings', 'attendance'));
$o .= html_writer::table($table);
$o .= html_writer::input_hidden_params($prefdata->url(array(), false));
// We should probably rewrite this to use mforms but for now add sesskey.

32
tests/behat/defaultstatus.feature

@ -0,0 +1,32 @@
@mod @mod_attendance
Feature: Admin can set default status set for use in new attendance
Background:
Given the following "courses" exist:
| fullname | shortname | summary | category | timecreated | timemodified |
| Course 1 | C1 | Prove the attendance activity works | 0 | ##yesterday## | ##yesterday## |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "course enrolments" exist:
| course | user | role | timestart |
| C1 | teacher1 | editingteacher | ##yesterday## |
And I log in as "admin"
And I navigate to "Attendance" node in "Site administration > Plugins"
And I follow "Default status set"
And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[2]/td[3]/input" to "customstatusdescription"
And I click on "Update" "button" in the "#preferencesform" "css_element"
And I should see "Status updated"
And I log out
@javascript
Scenario: Modified default status set added to new attendance
When I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add a "Attendance" to section "1" and I fill the form with:
| Name | Attendance1 |
And I click on "Save and display"
And I should see "Attendance1"
And I follow "Status set"
Then I should see "customstatusdescription"

2
tests/behat/extra_features.feature

@ -149,7 +149,7 @@ Feature: Test the various new features in the attendance module
Given I log in as "teacher1"
And I follow "Course 1"
And I follow "Test attendance"
And I follow "Settings"
And I follow "Status set"
And I set the field "jump" to "New set of statuses"
And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[1]/td[2]/input" to "G"
And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[1]/td[3]/input" to "Great"

2
tests/behat/preferences.feature

@ -23,7 +23,7 @@ Feature: Teachers can't change status variables to have empty acronyms or descri
And I add a "Attendance" to section "1" and I fill the form with:
| Name | Attendancepreftest |
And I follow "Attendancepreftest"
And I follow "Settings"
And I follow "Status set"
@javascript
Scenario: Teachers can add status variables

Loading…
Cancel
Save