// until the first time the button is clicked.
if (!dialog) {
- // Hide Calendar if we click anywhere in the document other than the calendar
+ // Hide Calendar if we click anywhere in the document other than the calendar.
Event.on(document, "click", function(e) {
var el = Event.getTarget(e);
var dialogEl = dialog.element;
if (YAHOO.env.ua.ie) {
// Since we're hiding the table using yui-overlay-hidden, we
// want to let the dialog know that the content size has changed, when
- // shown
+ // shown.
dialog.fireEvent("changeContent");
}
});
calendar = new YAHOO.widget.Calendar("cal", {
iframe:false, // Turn iframe off, since container has iframe support.
- hide_blank_weeks:true // Enable, to demonstrate how we handle changing height, using changeContent
+ hide_blank_weeks:true // Enable, to demonstrate how we handle changing height, using changeContent.
});
calendar.cfg.setProperty("start_weekday", M.attendance.cal_start_weekday);
calendar.renderEvent.subscribe(function() {
// Tell Dialog it's contents have changed, which allows
- // container to redraw the underlay (for IE6/Safari2)
+ // container to redraw the underlay (for IE6/Safari2).
dialog.fireEvent("changeContent");
});
}
var seldate = calendar.getSelectedDates();
if (seldate.length > 0) {
- // Set the pagedate to show the selected date if it exists
+ // Set the pagedate to show the selected date if it exists.
calendar.cfg.setProperty("pagedate", seldate[0]);
calendar.render();
}
*/
function xmldb_attendance_upgrade($oldversion=0) {
- global $CFG, $THEME, $DB;
+ global $DB;
$dbman = $DB->get_manager(); // Loads ddl manager and xmldb classes.
$result = true;
* @return void
*/
public function definition() {
-
global $USER, $DB, $PAGE;
$mform =& $this->_form;
-
$course = $this->_customdata['course'];
$cm = $this->_customdata['cm'];
$modcontext = $this->_customdata['modcontext'];
$mform->addElement('select', 'format', get_string('format'),
array('excel' => get_string('downloadexcel', 'attendance'),
'ooo' => get_string('downloadooo', 'attendance'),
- 'text' => get_string('downloadtext', 'attendance')
- ));
+ 'text' => get_string('downloadtext', 'attendance')));
$submitstring = get_string('ok');
$this->add_action_buttons(false, $submitstring);
print_error('No such session in this course');
}
- $sesstarttime = $formdata->sestime['starthour']*HOURSECS + $formdata->sestime['startminute'] * MINSECS;
- $sesendtime = $formdata->sestime['endhour']*HOURSECS + $formdata->sestime['endminute'] * MINSECS;
+ $sesstarttime = $formdata->sestime['starthour'] * HOURSECS + $formdata->sestime['startminute'] * MINSECS;
+ $sesendtime = $formdata->sestime['endhour'] * HOURSECS + $formdata->sestime['endminute'] * MINSECS;
$sess->sessdate = $formdata->sessiondate + $sesstarttime;
$sess->duration = $sesendtime - $sesstarttime;
$dta = $this->construct_date_time_actions($sessdata, $sess);
$table->data[$sess->id][] = $i;
- $table->data[$sess->id][] = $sess->groupid ? get_string('group') . ': ' . $sessdata->groups[$sess->groupid]->name :
- get_string('commonsession', 'attendance');
+ $table->data[$sess->id][] = $sess->groupid ? get_string('group') . ': ' . $sessdata->groups[$sess->groupid]->name
+ : get_string('commonsession', 'attendance');
$table->data[$sess->id][] = $dta['date'];
$table->data[$sess->id][] = $dta['time'];
$table->data[$sess->id][] = $sess->description;
$row = new html_table_row();
$row->cells[] = $i;
- $sessiontypeshort = $sess->groupid ? get_string('group') . ': ' . $userdata->groups[$sess->groupid]->name :
- get_string('commonsession', 'attendance');
+ $sessiontypeshort = $sess->groupid ? get_string('group') . ': ' . $userdata->groups[$sess->groupid]->name
+ : get_string('commonsession', 'attendance');
$row->cells[] = html_writer::tag('nobr', $sessiontypeshort);
$row->cells[] = userdate($sess->sessdate, get_string('strftimedmyw', 'attendance'));
$row->cells[] = $this->construct_time($sess->sessdate, $sess->duration);
$sesstext = html_writer::link($reportdata->url_take($sess->id, $sess->groupid), $sesstext);
}
$sesstext .= html_writer::empty_tag('br');
- $sesstext .= $sess->groupid ? get_string('group') . ': ' . $reportdata->groups[$sess->groupid]->name : get_string('commonsession', 'attendance');
+ $sesstext .= $sess->groupid ? get_string('group') . ': ' . $reportdata->groups[$sess->groupid]->name
+ : get_string('commonsession', 'attendance');
$table->head[] = $sesstext;
$table->align[] = 'center';
}
if ($bulkmessagecapability) { // Create the checkbox for bulk messaging.
- $row->cells[] = html_writer::checkbox('user'.$user->id, 'on', false, '', array('class' => 'attendancesesscheckbox'));
+ $row->cells[] = html_writer::checkbox('user'.$user->id, 'on', false, '',
+ array('class' => 'attendancesesscheckbox'));
}
$table->data[] = $row;
And I follow "Add"
And I set the field "Allow students to record own attendance" to "1"
And I set the following fields to these values:
- | id_sessiondate_hour | 23 |
+ | id_sestime_starthour | 23 |
And I click on "id_submitbutton" "button"
And I log out
When I log in as "student1"
And I follow "Attendance"
And I follow "Add"
And I set the following fields to these values:
- | id_sessiondate_hour | 01 |
+ | id_sestime_starthour | 01 |
And I click on "id_submitbutton" "button"
And I follow "Report"
And I follow "Low grade"
And I follow "Attendance"
And I follow "Add"
And I set the following fields to these values:
- | id_sessiondate_hour | 01 |
+ | id_sestime_starthour | 01 |
And I click on "id_submitbutton" "button"
And I follow "Export"
Then the field "id_ident_idnumber" matches value ""
+++ /dev/null
-<?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/>.
-
-/**
- * This file contains an event for when an attendance is taken.
- *
- * @package mod_attendance
- * @copyright 2014 onwards Dan Marsden
- * @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 is taken.
- *
- * @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 attendance_taken_by_student extends \core\event\base {
-
- /**
- * Init method.
- */
- protected function init() {
- $this->data['crud'] = 'r';
- $this->data['edulevel'] = self::LEVEL_TEACHING;
- $this->data['objecttable'] = 'attendance';
- }
-
- /**
- * Returns non-localised description of what happened.
- *
- * @return string
- */
- public function get_description() {
- return 'Student with id ' . $this->userid . ' took attendance with instanceid ' .
- $this->objectid;
- }
-
- /**
- * Returns localised general event name.
- *
- * @return string
- */
- public static function get_name() {
- return get_string('eventtakenbystudent', 'mod_attendance');
- }
-
- /**
- * Get URL related to the action
- *
- * @return \moodle_url
- */
- public function get_url() {
- return new \moodle_url('/mod/attendance/take.php', array('id' => $this->contextinstanceid,
- 'sessionid' => $this->other['sessionid'],
- 'grouptype' => $this->other['grouptype']));
- }
-
- /**
- * 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', 'taken', $this->get_url(),
- '', $this->contextinstanceid);
- }
-
- /**
- * Custom validation.
- *
- * @throws \coding_exception
- * @return void
- */
- protected function validate_data() {
- if (empty($this->other['sessionid'])) {
- throw new \coding_exception('The event mod_attendance\\event\\attendance_taken must specify sessionid.');
- }
- parent::validate_data();
- }
-}
And I follow "Add"
And I set the following fields to these values:
- | Create multiple sessions | 0 |
+ | id_addmultiply | 0 |
And I click on "submitbutton" "button"
When I follow "Take attendance"
And I follow "Test attendance"
And I follow "Add"
And I set the following fields to these values:
- | Create multiple sessions | 0 |
+ | id_addmultiply | 0 |
And I click on "submitbutton" "button"
And I follow "Export"
And I follow "Add"
And I set the following fields to these values:
- | Create multiple sessions | 0 |
+ | id_addmultiply | 0 |
| Use status set | Status set 1 (P L E A) |
- | id_sessiondate_hour | 10 |
- | id_sessiondate_minute | 0 |
+ | id_sestime_starthour | 10 |
+ | id_sestime_startminute | 0 |
And I click on "submitbutton" "button"
And I follow "Add"
And I set the following fields to these values:
- | Create multiple sessions | 0 |
+ | id_addmultiply | 0 |
| Use status set | Status set 2 (G O B) |
- | id_sessiondate_hour | 11 |
- | id_sessiondate_minute | 0 |
+ | id_sestime_starthour | 11 |
+ | id_sestime_startminute | 0 |
And I click on "submitbutton" "button"
When I click on "Take attendance" "link" in the "10:00" "table_row"
And I follow "Test attendance"
And I follow "Add"
And I set the following fields to these values:
- | Create multiple sessions | 0 |
+ | id_addmultiply | 0 |
And I click on "submitbutton" "button"
And I click on "Take attendance" "link"