|
|
@ -177,12 +177,21 @@ function attendance_form_sessiondate_selector (MoodleQuickForm $mform) { |
|
|
|
} |
|
|
|
|
|
|
|
$sesendtime = array(); |
|
|
|
$sesendtime[] =& $mform->createElement('static', 'from', '', get_string('from', 'attendance')); |
|
|
|
$sesendtime[] =& $mform->createElement('select', 'starthour', get_string('hour', 'form'), $hours, false, true); |
|
|
|
$sesendtime[] =& $mform->createElement('select', 'startminute', get_string('minute', 'form'), $minutes, false, true); |
|
|
|
$sesendtime[] =& $mform->createElement('static', 'to', '', get_string('to', 'attendance')); |
|
|
|
$sesendtime[] =& $mform->createElement('select', 'endhour', get_string('hour', 'form'), $hours, false, true); |
|
|
|
$sesendtime[] =& $mform->createElement('select', 'endminute', get_string('minute', 'form'), $minutes, false, true); |
|
|
|
if (!right_to_left()) { |
|
|
|
$sesendtime[] =& $mform->createElement('static', 'from', '', get_string('from', 'attendance')); |
|
|
|
$sesendtime[] =& $mform->createElement('select', 'starthour', get_string('hour', 'form'), $hours, false, true); |
|
|
|
$sesendtime[] =& $mform->createElement('select', 'startminute', get_string('minute', 'form'), $minutes, false, true); |
|
|
|
$sesendtime[] =& $mform->createElement('static', 'to', '', get_string('to', 'attendance')); |
|
|
|
$sesendtime[] =& $mform->createElement('select', 'endhour', get_string('hour', 'form'), $hours, false, true); |
|
|
|
$sesendtime[] =& $mform->createElement('select', 'endminute', get_string('minute', 'form'), $minutes, false, true); |
|
|
|
} else { |
|
|
|
$sesendtime[] =& $mform->createElement('static', 'from', '', get_string('from', 'attendance')); |
|
|
|
$sesendtime[] =& $mform->createElement('select', 'startminute', get_string('minute', 'form'), $minutes, false, true); |
|
|
|
$sesendtime[] =& $mform->createElement('select', 'starthour', get_string('hour', 'form'), $hours, false, true); |
|
|
|
$sesendtime[] =& $mform->createElement('static', 'to', '', get_string('to', 'attendance')); |
|
|
|
$sesendtime[] =& $mform->createElement('select', 'endminute', get_string('minute', 'form'), $minutes, false, true); |
|
|
|
$sesendtime[] =& $mform->createElement('select', 'endhour', get_string('hour', 'form'), $hours, false, true); |
|
|
|
} |
|
|
|
$mform->addGroup($sesendtime, 'sestime', get_string('time', 'attendance'), array(' '), true); |
|
|
|
} |
|
|
|
|
|
|
@ -458,7 +467,7 @@ function attendance_can_student_mark($sess, $log = true) { |
|
|
|
$record = $DB->get_record_select('attendance_log', $sql, $params); |
|
|
|
} else { |
|
|
|
// Assume ATTENDANCE_SHAREDIP_FORCED. |
|
|
|
$sql = 'sessionid = ? AND studentid <> ? ipaddress = ?'; |
|
|
|
$sql = 'sessionid = ? AND studentid <> ? AND ipaddress = ?'; |
|
|
|
$params = array($sess->id, $USER->id, getremoteaddr()); |
|
|
|
$record = $DB->get_record_select('attendance_log', $sql, $params); |
|
|
|
} |
|
|
@ -509,7 +518,7 @@ function attendance_exporttotableed($data, $filename, $format) { |
|
|
|
// Sending HTTP headers. |
|
|
|
$workbook->send($filename); |
|
|
|
// Creating the first worksheet. |
|
|
|
$myxls = $workbook->add_worksheet('Attendances'); |
|
|
|
$myxls = $workbook->add_worksheet(get_string('modulenameplural', 'attendance')); |
|
|
|
// Format types. |
|
|
|
$formatbc = $workbook->add_format(); |
|
|
|
$formatbc->set_bold(1); |
|
|
@ -695,7 +704,13 @@ function attendance_construct_sessions_data_for_add($formdata, mod_attendance_st |
|
|
|
} |
|
|
|
} else { |
|
|
|
$sess = new stdClass(); |
|
|
|
$sess->sessdate = $sessiondate; |
|
|
|
$sess->sessdate = make_timestamp( |
|
|
|
date("Y", $formdata->sessiondate), |
|
|
|
date("m", $formdata->sessiondate), |
|
|
|
date("d", $formdata->sessiondate), |
|
|
|
$formdata->sestime['starthour'], |
|
|
|
$formdata->sestime['startminute'] |
|
|
|
); |
|
|
|
$sess->duration = $duration; |
|
|
|
$sess->descriptionitemid = $formdata->sdescription['itemid']; |
|
|
|
$sess->description = $formdata->sdescription['text']; |
|
|
|