Compare commits
46 Commits
40-behatfi
...
MOODLE_27_
Author | SHA1 | Date |
---|---|---|
Dan Marsden | 3b9f928ed5 | 8 years ago |
Dan Marsden | 597291a31a | 9 years ago |
Dan Marsden | f5a572deba | 9 years ago |
Dan Marsden | 97c8b52f32 | 9 years ago |
Neill Magill | 37b5c126df | 9 years ago |
Dan Marsden | 3fa3265a6c | 9 years ago |
Barry Oosthuizen | 6d26d4a972 | 9 years ago |
Syxton | 2b9fea2609 | 9 years ago |
Dan Marsden | df3b56f5dd | 9 years ago |
Dan Marsden | 469a8fa7f1 | 9 years ago |
Barry Oosthuizen | e5b55cc04d | 9 years ago |
Barry Oosthuizen | 9bb49b6510 | 9 years ago |
Dan Marsden | cf6230e1bd | 9 years ago |
Barry Oosthuizen | 6677ff2ea7 | 9 years ago |
Dan Marsden | cc2ef207e1 | 9 years ago |
Dan Marsden | 9b500d6740 | 10 years ago |
Barry Oosthuizen | b4883b7ba7 | 10 years ago |
Dan Marsden | d04bd807c2 | 10 years ago |
Dan Marsden | d6fa8c3f39 | 10 years ago |
Dan Marsden | 9ece7cf1e2 | 10 years ago |
Barry Oosthuizen | 0893ad210c | 10 years ago |
Dan Marsden | 2602e8ad03 | 10 years ago |
Dan Marsden | 4db7f05256 | 10 years ago |
Barry Oosthuizen | 6463e40fa0 | 10 years ago |
Barry Oosthuizen | 995e71671e | 10 years ago |
Paolo Tramonti | f72f1cfe3e | 11 years ago |
Kathrin | 45e1d9407c | 10 years ago |
Dan Marsden | dc74f67b38 | 10 years ago |
Dan Marsden | b0b98426fd | 10 years ago |
Dan Marsden | 8c0dfb29c6 | 10 years ago |
Dan Marsden | b7699c3049 | 10 years ago |
Dan Marsden | 47878ec7df | 10 years ago |
Dan Marsden | bbf8b5c43e | 10 years ago |
Dan Marsden | 4cfcbba68e | 10 years ago |
Dan Marsden | f391488440 | 10 years ago |
Barry Oosthuizen | 0a250c0758 | 10 years ago |
Barry Oosthuizen | f90ef5b8cf | 10 years ago |
Barry Oosthuizen | c30db3cb1c | 10 years ago |
Barry Oosthuizen | b1827357cf | 10 years ago |
Barry Oosthuizen | 05ae529f90 | 10 years ago |
Barry Oosthuizen | e3bcaad74d | 10 years ago |
Barry Oosthuizen | def7647ec8 | 10 years ago |
Barry Oosthuizen | b0ea71ddbb | 10 years ago |
Dan Marsden | f4298d751e | 10 years ago |
Kathrin | e11af5973e | 10 years ago |
Barry Oosthuizen | a085adf2bc | 10 years ago |
25 changed files with 560 additions and 123 deletions
@ -0,0 +1,39 @@ |
|||||
|
language: php |
||||
|
|
||||
|
sudo: false |
||||
|
|
||||
|
cache: |
||||
|
directories: |
||||
|
- $HOME/.composer/cache |
||||
|
|
||||
|
php: |
||||
|
- 5.6 |
||||
|
|
||||
|
matrix: |
||||
|
|
||||
|
env: |
||||
|
matrix: |
||||
|
- DB=pgsql MOODLE_BRANCH=MOODLE_27_STABLE |
||||
|
- DB=mysqli MOODLE_BRANCH=MOODLE_27_STABLE |
||||
|
|
||||
|
before_install: |
||||
|
- phpenv config-rm xdebug.ini |
||||
|
- cd ../.. |
||||
|
- composer selfupdate |
||||
|
- composer create-project -n --no-dev moodlerooms/moodle-plugin-ci ci ^1 |
||||
|
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH" |
||||
|
|
||||
|
install: |
||||
|
- moodle-plugin-ci install |
||||
|
|
||||
|
script: |
||||
|
- moodle-plugin-ci phplint |
||||
|
- moodle-plugin-ci phpcpd |
||||
|
- moodle-plugin-ci phpmd |
||||
|
- moodle-plugin-ci codechecker |
||||
|
- moodle-plugin-ci csslint |
||||
|
- moodle-plugin-ci shifter |
||||
|
- moodle-plugin-ci jshint |
||||
|
- moodle-plugin-ci validate |
||||
|
- moodle-plugin-ci phpunit |
||||
|
- moodle-plugin-ci behat |
@ -1,21 +1,15 @@ |
|||||
ABOUT |
ABOUT |
||||
========== |
========== |
||||
The "Attendance" module was developed by |
The Attendance module is supported and maintained by Dan Marsden http://danmarsden.com |
||||
|
|
||||
|
The Attendance module was previously developed by |
||||
Dmitry Pupinin, Novosibirsk, Russia, |
Dmitry Pupinin, Novosibirsk, Russia, |
||||
Artem Andreev, Taganrog, Russia. |
Artem Andreev, Taganrog, Russia. |
||||
|
|
||||
This block may be distributed under the terms of the General Public License |
|
||||
(see http://www.gnu.org/licenses/gpl.txt for details) |
|
||||
|
|
||||
PURPOSE |
PURPOSE |
||||
========== |
========== |
||||
The attendance module and block are designed to allow instructors of a course keep an attendance log of the students in their courses. The instructor will setup the frequency of his classes (# of days per week & length of course) and the attendance is ready for use. To take attendance, the instructor clicks on the "Update Attendance" button and is presented with a list of all the students in that course, along with 4 options: Present, Absent, Late & Excused, with a Remarks textbox. Instructors can download the attendance for their course in Excel format or text format. |
The Attendance module allows teachers to maintain a record of attendance, replacing or supplementing a paper-based attendance register. |
||||
Only the instructor can update the attendance data. However, a student gets to see his attendance record. |
It is primarily used in blended-learning environments where students are required to attend classes, lectures and tutorials and allows |
||||
|
the teacher to track and optionally provide a grade for the students attendance. |
||||
INSTALLATION |
|
||||
========== |
|
||||
The attendance module follows standard installation procedure. |
|
||||
|
|
||||
1. Create folder <path to your moodle dir>/mod/attendance. |
Sessions can be configured to allow students to record their own attendance and a range of different reports are available. |
||||
2. Extract files from folder inside archive to created folder. |
|
||||
3. Visit page Home ► Site administration ► Notifications to complete installation. |
|
@ -0,0 +1,100 @@ |
|||||
|
<?php |
||||
|
// This file is part of the Attendance module for 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/>. |
||||
|
|
||||
|
/** |
||||
|
* This file contains an event for when an attendance status is updated. |
||||
|
* |
||||
|
* @package mod_attendance |
||||
|
* @copyright 2015 onwards, University of Nottingham |
||||
|
* @author Barry Oosthuizen <barry.oosthuizen@nottingham.ac.uk> |
||||
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
||||
|
*/ |
||||
|
|
||||
|
namespace mod_attendance\event; |
||||
|
defined('MOODLE_INTERNAL') || die(); |
||||
|
|
||||
|
/** |
||||
|
* Event for when an attendance status is removed. |
||||
|
* |
||||
|
* @property-read array $other { |
||||
|
* Extra information about event properties. |
||||
|
* |
||||
|
* @string mode Mode of the report viewed. |
||||
|
* } |
||||
|
* @package mod_attendance |
||||
|
* @since Moodle 2.7 |
||||
|
* @copyright 2013 onwards Dan Marsden |
||||
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
||||
|
*/ |
||||
|
class status_removed extends \core\event\base { |
||||
|
|
||||
|
/** |
||||
|
* Init method. |
||||
|
*/ |
||||
|
protected function init() { |
||||
|
$this->data['crud'] = 'd'; |
||||
|
$this->data['edulevel'] = self::LEVEL_TEACHING; |
||||
|
$this->data['objecttable'] = 'attendance_statuses'; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Returns non-localised description of what happened. |
||||
|
* |
||||
|
* @return string |
||||
|
*/ |
||||
|
public function get_description() { |
||||
|
return 'User with id ' . $this->userid . ' deleted attendance status "' . $this->data['other']['acronym'] . ' - ' . $this->data['other']['description'] . '" with instanceid ' . |
||||
|
$this->objectid . ''; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Returns localised general event name. |
||||
|
* |
||||
|
* @return string |
||||
|
*/ |
||||
|
public static function get_name() { |
||||
|
return get_string('statusdeleted', 'mod_attendance'); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Get URL related to the action |
||||
|
* |
||||
|
* @return \moodle_url |
||||
|
*/ |
||||
|
public function get_url() { |
||||
|
return new \moodle_url('/mod/attendance/preferences.php', array('id' => $this->contextinstanceid)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Replace add_to_log() statement. |
||||
|
* |
||||
|
* @return array of parameters to be passed to legacy add_to_log() function. |
||||
|
*/ |
||||
|
protected function get_legacy_logdata() { |
||||
|
return array($this->courseid, 'attendance', 'status removed', $this->get_url(), |
||||
|
$this->other['acronym'] . ' - ' . $this->other['description'], $this->contextinstanceid); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Custom validation. |
||||
|
* |
||||
|
* @throws \coding_exception |
||||
|
* @return void |
||||
|
*/ |
||||
|
protected function validate_data() { |
||||
|
parent::validate_data(); |
||||
|
} |
||||
|
} |
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
@ -0,0 +1,55 @@ |
|||||
|
@mod @uon @mod_attendance @mod_attendance_preferences |
||||
|
Feature: Teachers can't change status variables to have empty acronyms or descriptions |
||||
|
In order to update status variables |
||||
|
As a teacher |
||||
|
I need to see an error notice below each acronym / description that I try to set to be empty |
||||
|
|
||||
|
Background: |
||||
|
Given the following "courses" exist: |
||||
|
| fullname | shortname | summary | category | |
||||
|
| Course 1 | C101 | Prove the attendance activity settings works | 0 | |
||||
|
And the following "users" exist: |
||||
|
| username | firstname | lastname | |
||||
|
| student1 | Sam | Student | |
||||
|
| teacher1 | Teacher | One | |
||||
|
And the following "course enrolments" exist: |
||||
|
| user | course | role | |
||||
|
| student1 | C101 | student | |
||||
|
| teacher1 | C101 | editingteacher | |
||||
|
And 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 press "Save and display" |
||||
|
And I follow "Settings" |
||||
|
|
||||
|
@javascript |
||||
|
Scenario: Teachers can add status variables |
||||
|
# Set the second status acronym to be empty |
||||
|
Given I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[2]/td[2]/input" to "" |
||||
|
# Set the second status description to be empty |
||||
|
And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[2]/td[3]/input" to "" |
||||
|
# Set the second status grade to be empty |
||||
|
And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[2]/td[4]/input" to "" |
||||
|
When I click on "Update" "button" in the "#preferencesform" "css_element" |
||||
|
Then I should see "Empty acronyms are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[2]/td[2]/p" "xpath_element" |
||||
|
And I should see "Empty descriptions are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[2]/td[3]/p" "xpath_element" |
||||
|
And I click on "Update" "button" in the "#preferencesform" "css_element" |
||||
|
|
||||
|
# Set the first status acronym to be empty |
||||
|
Given I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[1]/td[2]/input" to "" |
||||
|
# Set the first status description to be empty |
||||
|
And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[1]/td[3]/input" to "" |
||||
|
# Set the first status grade to be empty |
||||
|
And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[1]/td[4]/input" to "" |
||||
|
# Set the third status acronym to be empty |
||||
|
And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[3]/td[2]/input" to "" |
||||
|
# Set the third status description to be empty |
||||
|
And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[3]/td[3]/input" to "" |
||||
|
# Set the third status grade to be empty |
||||
|
And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[3]/td[4]/input" to "" |
||||
|
When I click on "Update" "button" in the "#preferencesform" "css_element" |
||||
|
Then I should see "Empty acronyms are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[1]/td[2]/p" "xpath_element" |
||||
|
And I should see "Empty descriptions are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[1]/td[3]/p" "xpath_element" |
||||
|
And I should see "Empty acronyms are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[3]/td[2]/p" "xpath_element" |
||||
|
And I should see "Empty descriptions are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[3]/td[3]/p" "xpath_element" |
Loading…
Reference in new issue