Browse Source

tidy up some more coding guideline/behat stuff.

MOODLE_32_STABLE
Dan Marsden 8 years ago
parent
commit
8a9f561f22
  1. 2
      db/access.php
  2. 4
      db/services.php
  3. 1
      lib.php
  4. 6
      renderables.php
  5. 3
      renderer.php
  6. 8
      styles.css
  7. 5
      tests/behat/attendance_mod.feature

2
db/access.php

@ -13,7 +13,6 @@
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
defined('MOODLE_INTERNAL') || die();
/**
* Capability definitions for this module.
@ -23,6 +22,7 @@ defined('MOODLE_INTERNAL') || die();
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$capabilities = array(
'mod/attendance:view' => array(

4
db/services.php

@ -13,7 +13,6 @@
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
defined('MOODLE_INTERNAL') || die();
/**
* Web service local plugin attendance external functions and service definitions.
@ -23,9 +22,12 @@ defined('MOODLE_INTERNAL') || die();
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* We defined the web service functions to install.
*/
$functions = array(
'mod_wsattendance_get_courses_with_today_sessions' => array(
'classname' => 'mod_wsattendance_external',

1
lib.php

@ -22,6 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once(dirname(__FILE__) . '/classes/calendar_helpers.php');
/**

6
renderables.php

@ -80,7 +80,8 @@ class attendance_tabs implements renderable {
if (has_capability('mod/attendance:manageattendances', $context)) {
$toprow[] = new tabobject(self::TAB_ADD,
$this->att->url_sessions()->out(true, array('action' => mod_attendance_sessions_page_params::ACTION_ADD)),
$this->att->url_sessions()->out(true,
array('action' => mod_attendance_sessions_page_params::ACTION_ADD)),
get_string('addsession', 'attendance'));
}
if (has_capability('mod/attendance:viewreports', $context)) {
@ -103,7 +104,8 @@ class attendance_tabs implements renderable {
}
if ($this->currenttab == self::TAB_UPDATE && has_capability('mod/attendance:manageattendances', $context)) {
$toprow[] = new tabobject(self::TAB_UPDATE,
$this->att->url_sessions()->out(true, array('action' => mod_attendance_sessions_page_params::ACTION_UPDATE)),
$this->att->url_sessions()->out(true,
array('action' => mod_attendance_sessions_page_params::ACTION_UPDATE)),
get_string('changesession', 'attendance'));
}

3
renderer.php

@ -1105,7 +1105,8 @@ class mod_attendance_renderer extends plugin_renderer_base {
// We should probably rewrite this to use mforms but for now add sesskey.
$o .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()))."\n";
$o .= $this->construct_preferences_button(get_string('update', 'attendance'), mod_attendance_preferences_page_params::ACTION_SAVE);
$o .= $this->construct_preferences_button(get_string('update', 'attendance'),
mod_attendance_preferences_page_params::ACTION_SAVE);
$o = html_writer::tag('form', $o, array('id' => 'preferencesform', 'method' => 'post',
'action' => $prefdata->url(array(), false)->out_omit_querystring()));
$o = $this->output->container($o, 'generalbox attwidth');

8
styles.css

@ -1,13 +1,13 @@
.path-mod-attendance .attbtn {
-khtml-border-radius: 5px;
-moz-border-radius: 5px;
-opera-border-radius: 5px;
-webkit-border-radius: 5px;
border:1px solid #AAAAAA;
border-radius: 5px;
margin-left: 2px;
margin-right: 2px;
padding: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-opera-border-radius: 5px;
-khtml-border-radius: 5px;
}
.path-mod-attendance .attcurbtn {

5
tests/behat/attendance_mod.feature

@ -24,12 +24,15 @@ Feature: Teachers and Students can record session attendance
| user | course | role |
| student1 | C101 | student |
| teacher1 | C101 | editingteacher |
And I log in as "teacher1"
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 | Attendance |
And I log out
And I log in as "student1"
And I follow "Course 1"
Then I should see "Attendance"
Scenario: Students can mark their own attendance
When I log in as "teacher1"

Loading…
Cancel
Save