Browse Source

Initial commit. Version 2.1.1

MOODLE_23_STABLE
Artem Andreev 15 years ago
commit
b86085074f
  1. 1237
      CHANGES
  2. 26
      README.txt
  3. 49
      RELEASES.txt
  4. 89
      add_form.php
  5. 190
      attendances.php
  6. 176
      attsettings.php
  7. 202
      backuplib.php
  8. 124
      db/access.php
  9. 80
      db/install.xml
  10. 221
      db/upgrade.php
  11. 48
      duration_form.php
  12. 187
      export.php
  13. 113
      export_form.php
  14. BIN
      icon.gif
  15. 20
      index.php
  16. 116
      lang/cs_utf8/attforblock.php
  17. 84
      lang/de/attforblock.php
  18. 11
      lang/en_us_utf8/README
  19. 10
      lang/en_us_utf8/attforblock.php
  20. 119
      lang/en_utf8/attforblock.php
  21. 12
      lang/en_utf8/help/attforblock/createmultiplesessions.html
  22. 4
      lang/en_utf8/help/attforblock/createonesession.html
  23. 26
      lang/en_utf8/help/attforblock/defaultstatuses.html
  24. 6
      lang/en_utf8/help/attforblock/display.html
  25. 3
      lang/en_utf8/help/attforblock/export.html
  26. 6
      lang/en_utf8/help/attforblock/hiddensessions.html
  27. 4
      lang/en_utf8/help/attforblock/myvariables.html
  28. 5
      lang/en_utf8/help/attforblock/report.html
  29. 20
      lang/en_utf8/help/attforblock/sessions.html
  30. 3
      lang/en_utf8/help/attforblock/studentview.html
  31. 113
      lang/es_utf8/attforblock.php
  32. 4
      lang/es_utf8/help/attforblock/changesession.html
  33. 10
      lang/es_utf8/help/attforblock/createmultiplesessions.html
  34. 4
      lang/es_utf8/help/attforblock/createonesession.html
  35. 26
      lang/es_utf8/help/attforblock/defaultstatuses.html
  36. 4
      lang/es_utf8/help/attforblock/display.html
  37. 3
      lang/es_utf8/help/attforblock/export.html
  38. 4
      lang/es_utf8/help/attforblock/mods.html
  39. 3
      lang/es_utf8/help/attforblock/myvariables.html
  40. 5
      lang/es_utf8/help/attforblock/report.html
  41. 16
      lang/es_utf8/help/attforblock/sessions.html
  42. 3
      lang/es_utf8/help/attforblock/studentview.html
  43. 3
      lang/es_utf8/help/attforblock/updateattendance.html
  44. 87
      lang/eu_utf8/attforblock.php
  45. 26
      lang/eu_utf8/help/attforblock/defaultstatuses.html
  46. 12
      lang/eu_utf8/help/attforblock/sessions.html
  47. 94
      lang/fr_utf8/attforblock.php
  48. 84
      lang/it/attforblock.php
  49. 12
      lang/it/help/attforblock/sessions.html
  50. 116
      lang/ja_utf8/attforblock.php
  51. 6
      lang/ja_utf8/help/attforblock/createmultiplesessions.html
  52. 2
      lang/ja_utf8/help/attforblock/createonesession.html
  53. 26
      lang/ja_utf8/help/attforblock/defaultstatuses.html
  54. 2
      lang/ja_utf8/help/attforblock/display.html
  55. 2
      lang/ja_utf8/help/attforblock/export.html
  56. 3
      lang/ja_utf8/help/attforblock/hiddensessions.html
  57. 2
      lang/ja_utf8/help/attforblock/myvariables.html
  58. 2
      lang/ja_utf8/help/attforblock/report.html
  59. 14
      lang/ja_utf8/help/attforblock/sessions.html
  60. 2
      lang/ja_utf8/help/attforblock/studentview.html
  61. 113
      lang/ru_utf8/attforblock.php
  62. 12
      lang/ru_utf8/help/attforblock/sessions.html
  63. 87
      lang/sk_utf8/attforblock.php
  64. 77
      lang/sv/attforblock.php
  65. 389
      lib.php
  66. 314
      locallib.php
  67. 164
      manage.php
  68. 32
      mod_form.php
  69. 226
      report.php
  70. 255
      restorelib.php
  71. 265
      sessions.php
  72. 69
      update_form.php
  73. 11
      version.php
  74. 118
      view.php

1237
CHANGES

File diff suppressed because it is too large

26
README.txt

@ -0,0 +1,26 @@
*********************************************************************************************
****** WARNING: THIS MODULE IS IN DEVELOPMENT. USE WITH CAUTION ******
*********************************************************************************************
--------
ABOUT
--------
This is version 2.1.x of the "Attendance" module (attforblock). It is still IN DEVELOPMENT
and should not be considered a stable release unless otherwise noted.
It has been tested on Moodle 1.9+, MySQL and PHP 5.2+.
The "Attendance" module is developed by Dmitry Pupinin, Novosibirsk, 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
-----------
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.
Only the instructor can update the attendance data. However, a student gets to see his attendance record.
----------------
INSTALLATION
----------------
The attendance follows standard installation procedures. Place the "attendance" directory in your blocks directory, "attforblock" directory in your mod directory. Please delete old language files from your moodledata/lang/en directory if you are upgrading the module. Then visit the Admin page in Moodle to activate it.

49
RELEASES.txt

@ -0,0 +1,49 @@
****************************************************************************
****** WARNING: ATTENDANCE MODULE IS IN DEVELOPMENT. USE WITH CAUTION ******
****************************************************************************
--------------
RELEASE NOTES
--------------
1.0 - 09 jan 2006 Dmitry Pupinin [moodle.org member]
+ basic functions
1.0.1 - 23 jan 2006 Dmitry Pupinin [moodle.org member]
+ attendance displayed on user's quick and full report pages
2.0 - 10 may 2007 - Dmitry Pupinin [moodle.org member]
* code rewrited. General code moved from block to attforblock module.
* this version only compatible with latest Moodle 1.8 (without grouping!)
2.0.2 - 06 jul 2007 - Dmitry Pupinin [moodle.org member]
* bug fixed: empty Gradebook
* bug fixed: error if block instance added before module instance
* bug fixed: wrong link on report tab when no session added
* bug fixed: Activity report looks good
+ link from Activities block point directly to Attendances (because it can't be more than one)
* bug fixed: Wrong link when adding a session for a date that had already been added
* bug fixed: Error when settings updated
* en_utf8 lang updated (thanks to A. T. Wyatt)
+ en_us_utf8 lang added (contain only differences from en_utf8)
2.0.3 - 27 jan 2008 - Dmitry Pupinin [moodle.org member]
* bug fixed: If session have apostrophes in the description it can't will be changed to "taken"
(you can't lost any data but upgrading strongly recommended)
+ french language added
* bug fixed: functions for work with groups changed in Moodle 1.9
2.0.4 - 19 jun 2008 - Dmitry Pupinin [moodle.org member]
+ compatibility with Gradebook of Moodle 1.9
2.1.0 - 24 jan 2009 - Dmitry Pupinin [moodle.org member]
+ unlimited number of statuses
+ unlimited sessions in day
+ reset feature
* permissions improved
* backup/restore improved
* export improved
2.1.0 - 28 feb 2009 - Dmitry Pupinin [moodle.org member]
+ hidden sessions displayed
* format of backup changed
* bug fixes

89
add_form.php

@ -0,0 +1,89 @@
<?php // $Id: add_form.php,v 1.1.2.2 2009/02/23 19:22:42 dlnsk Exp $
require_once($CFG->libdir.'/formslib.php');
class mod_attforblock_add_form extends moodleform {
function definition() {
global $CFG;
$mform =& $this->_form;
$course = $this->_customdata['course'];
$cm = $this->_customdata['cm'];
// $coursecontext = $this->_customdata['coursecontext'];
$modcontext = $this->_customdata['modcontext'];
// $forum = $this->_customdata['forum'];
// $post = $this->_customdata['post']; // hack alert
$mform->addElement('header', 'general', get_string('addsession','attforblock'));//fill in the data depending on page params
//later using set_data
$mform->addElement('checkbox', 'addmultiply', '', get_string('createmultiplesessions','attforblock'));
$mform->setHelpButton('addmultiply', array('createmultiplesessions', get_string('createmultiplesessions','attforblock'), 'attforblock'));
// $mform->addElement('date_selector', 'sessiondate', get_string('sessiondate','attforblock'));
$mform->addElement('date_time_selector', 'sessiondate', get_string('sessiondate','attforblock'));
for ($i=0; $i<=23; $i++) {
$hours[$i] = sprintf("%02d",$i);
}
for ($i=0; $i<60; $i+=5) {
$minutes[$i] = sprintf("%02d",$i);
}
$durtime = array();
$durtime[] =& MoodleQuickForm::createElement('select', 'hours', get_string('hour', 'form'), $hours, false, true);
$durtime[] =& MoodleQuickForm::createElement('select', 'minutes', get_string('minute', 'form'), $minutes, false, true);
$mform->addGroup($durtime, 'durtime', get_string('duration','attforblock'), array(' '), true);
$mform->addElement('date_selector', 'sessionenddate', get_string('sessionenddate','attforblock'));
$mform->disabledIf('sessionenddate', 'addmultiply', 'notchecked');
$sdays = array();
if ($CFG->calendar_startwday === '0') { //week start from sunday
$sdays[] =& MoodleQuickForm::createElement('checkbox', 'Sun', '', get_string('sunday','calendar'));
}
$sdays[] =& MoodleQuickForm::createElement('checkbox', 'Mon', '', get_string('monday','calendar'));
$sdays[] =& MoodleQuickForm::createElement('checkbox', 'Tue', '', get_string('tuesday','calendar'));
$sdays[] =& MoodleQuickForm::createElement('checkbox', 'Wed', '', get_string('wednesday','calendar'));
$sdays[] =& MoodleQuickForm::createElement('checkbox', 'Thu', '', get_string('thursday','calendar'));
$sdays[] =& MoodleQuickForm::createElement('checkbox', 'Fri', '', get_string('friday','calendar'));
$sdays[] =& MoodleQuickForm::createElement('checkbox', 'Sat', '', get_string('saturday','calendar'));
if ($CFG->calendar_startwday !== '0') { //week start from sunday
$sdays[] =& MoodleQuickForm::createElement('checkbox', 'Sun', '', get_string('sunday','calendar'));
}
$mform->addGroup($sdays, 'sdays', get_string('sessiondays','attforblock'), array(' '), true);
$mform->disabledIf('sdays', 'addmultiply', 'notchecked');
$period = array(1=>1,2,3,4,5,6,7,8);
$periodgroup = array();
$periodgroup[] =& MoodleQuickForm::createElement('select', 'period', '', $period, false, true);
$periodgroup[] =& MoodleQuickForm::createElement('static', 'perioddesc', '', get_string('week','attforblock'));
$mform->addGroup($periodgroup, 'periodgroup', get_string('period','attforblock'), array(' '), false);
$mform->disabledIf('periodgroup', 'addmultiply', 'notchecked');
$mform->addElement('text', 'sdescription', get_string('description', 'attforblock'), 'size="48"');
$mform->setType('sdescription', PARAM_TEXT);
$mform->addRule('sdescription', get_string('maximumchars', '', 100), 'maxlength', 100, 'client');
//-------------------------------------------------------------------------------
// buttons
$submit_string = get_string('addsession', 'attforblock');
$this->add_action_buttons(false, $submit_string);
$mform->addElement('hidden', 'id', $cm->id);
$mform->addElement('hidden', 'action', 'add');
}
// function validation($data, $files) {
// $errors = parent::validation($data, $files);
// if (($data['timeend']!=0) && ($data['timestart']!=0)
// && $data['timeend'] <= $data['timestart']) {
// $errors['timeend'] = get_string('timestartenderror', 'forum');
// }
// return $errors;
// }
}
?>

190
attendances.php

@ -0,0 +1,190 @@
<?PHP // $Id: attendances.php,v 1.2.2.5 2009/02/23 19:22:40 dlnsk Exp $
// Lists all the sessions for a course
require_once('../../config.php');
require_once($CFG->libdir.'/blocklib.php');
require_once('locallib.php');
require_once('lib.php');
if (!function_exists('grade_update')) { //workaround for buggy PHP versions
require_once($CFG->libdir.'/gradelib.php');
}
$id = required_param('id', PARAM_INT);
$sessionid = required_param('sessionid', PARAM_INT);
$group = optional_param('group', -1, PARAM_INT); // Group to show
$sort = optional_param('sort','lastname', PARAM_ALPHA);
if (! $cm = get_record('course_modules', 'id', $id)) {
error('Course Module ID was incorrect');
}
if (! $course = get_record('course', 'id', $cm->course)) {
error('Course is misconfigured');
}
require_login($course->id);
if (! $attforblock = get_record('attforblock', 'id', $cm->instance)) {
error("Course module is incorrect");
}
if (! $user = get_record('user', 'id', $USER->id) ) {
error("No such user in this course");
}
if (!$context = get_context_instance(CONTEXT_MODULE, $cm->id)) {
print_error('badcontext');
}
$statlist = implode(',', array_keys( (array)get_statuses($course->id) ));
if ($form = data_submitted()) {
$students = array(); // stores students ids
$formarr = (array)$form;
$i = 0;
$now = time();
foreach($formarr as $key => $value) {
if(substr($key,0,7) == 'student' && $value !== '') {
$students[$i] = new Object();
$sid = substr($key,7); // gets studeent id from radiobutton name
$students[$i]->studentid = $sid;
$students[$i]->statusid = $value;
$students[$i]->statusset = $statlist;
$students[$i]->remarks = array_key_exists('remarks'.$sid, $formarr) ? $formarr['remarks'.$sid] : '';
$students[$i]->sessionid = $sessionid;
$students[$i]->timetaken = $now;
$students[$i]->takenby = $USER->id;
$i++;
}
}
$attforblockrecord = get_record('attforblock', 'course', $course->id);
foreach($students as $student) {
if ($log = get_record('attendance_log', 'sessionid', $sessionid, 'studentid', $student->studentid)) {
$student->id = $log->id; // this is id of log
update_record('attendance_log', $student);
} else {
insert_record('attendance_log', $student);
}
}
set_field('attendance_sessions', 'lasttaken', $now, 'id', $sessionid);
set_field('attendance_sessions', 'lasttakenby', $USER->id, 'id', $sessionid);
attforblock_update_grades($attforblockrecord);
add_to_log($course->id, 'attendance', 'updated', 'mod/attforblock/report.php?id='.$id, $user->lastname.' '.$user->firstname);
redirect('manage.php?id='.$id, get_string('attendancesuccess','attforblock'), 3);
exit();
}
/// Print headers
$navlinks[] = array('name' => $attforblock->name, 'link' => "view.php?id=$id", 'type' => 'activity');
$navlinks[] = array('name' => get_string('update', 'attforblock'), 'link' => null, 'type' => 'activityinstance');
$navigation = build_navigation($navlinks);
print_header("$course->shortname: ".$attforblock->name.' - ' .get_string('update','attforblock'), $course->fullname,
$navigation, "", "", true, "&nbsp;", navmenu($course));
//check for hack
if (!$sessdata = get_record('attendance_sessions', 'id', $sessionid)) {
error("Required Information is missing", "manage.php?id=".$id);
}
$help = helpbutton ('updateattendance', get_string('help'), 'attforblock', true, false, '', true);
$update = count_records('attendance_log', 'sessionid', $sessionid);
if ($update) {
require_capability('mod/attforblock:changeattendances', $context);
print_heading(get_string('update','attforblock').' ' .get_string('attendanceforthecourse','attforblock').' :: ' .$course->fullname.$help);
} else {
require_capability('mod/attforblock:takeattendances', $context);
print_heading(get_string('attendanceforthecourse','attforblock').' :: ' .$course->fullname.$help);
}
/// find out current groups mode
$groupmode = groups_get_activity_groupmode($cm);
$currentgroup = groups_get_activity_group($cm, true);
if ($currentgroup) {
$students = get_users_by_capability($context, 'moodle/legacy:student', '', "u.$sort ASC", '', '', $currentgroup, '', false);
} else {
$students = get_users_by_capability($context, 'moodle/legacy:student', '', "u.$sort ASC", '', '', '', '', false);
}
$sort = $sort == 'firstname' ? 'firstname' : 'lastname';
/// Now we need a menu for separategroups as well!
if ($groupmode == VISIBLEGROUPS ||
($groupmode && has_capability('moodle/site:accessallgroups', $context))) {
groups_print_activity_menu($cm, "attendances.php?id=$id&amp;sessionid=$sessionid&amp;sort=$sort");
}
$table->data[][] = '<b>'.get_string('sessiondate','attforblock').': '.userdate($sessdata->sessdate, get_string('strftimedate').', '.get_string('strftimehm', 'attforblock')).
', "'.($sessdata->description ? $sessdata->description : get_string('nodescription', 'attforblock')).'"</b>';
print_table($table);
$statuses = get_statuses($course->id);
$i = 3;
foreach($statuses as $st) {
$tabhead[] = "<a href=\"javascript:select_all_in('TD', 'cell c{$i}', null);\"><u>$st->acronym</u></a>";
$i++;
}
$tabhead[] = get_string('remarks','attforblock');
$firstname = "<a href=\"attendances.php?id=$id&amp;sessionid=$sessionid&amp;sort=firstname\">".get_string('firstname').'</a>';
$lastname = "<a href=\"attendances.php?id=$id&amp;sessionid=$sessionid&amp;sort=lastname\">".get_string('lastname').'</a>';
if ($CFG->fullnamedisplay == 'lastname firstname') { // for better view (dlnsk)
$fullnamehead = "$lastname / $firstname";
} else {
$fullnamehead = "$firstname / $lastname";
}
if ($students) {
unset($table);
$table->width = '0%';
$table->head[] = '#';
$table->align[] = 'center';
$table->size[] = '20px';
$table->head[] = '';
$table->align[] = '';
$table->size[] = '1px';
$table->head[] = $fullnamehead;
$table->align[] = 'left';
$table->size[] = '';
$table->wrap[2] = 'nowrap';
foreach ($tabhead as $hd) {
$table->head[] = $hd;
$table->align[] = 'center';
$table->size[] = '20px';
}
$i = 0;
foreach($students as $student) {
$i++;
$att = get_record('attendance_log', 'sessionid', $sessionid, 'studentid', $student->id);
$table->data[$student->id][] = (!$att && $update) ? "<font color=\"red\"><b>$i</b></font>" : $i;
$table->data[$student->id][] = print_user_picture($student->id, $course->id, $student->picture, 20, true, true);//, $returnstring=false, $link=true, $target='');
$table->data[$student->id][] = "<a href=\"view.php?id=$id&amp;student={$student->id}\">".((!$att && $update) ? '<font color="red"><b>' : '').fullname($student).((!$att && $update) ? '</b></font>' : '').'</a>';
foreach($statuses as $st) {
@$table->data[$student->id][] = '<input name="student'.$student->id.'" type="radio" value="'.$st->id.'" '.($st->id == $att->statusid ? 'checked' : '').'>';
}
$table->data[$student->id][] = '<input type="text" name="remarks'.$student->id.'" size="" value="'.($att ? $att->remarks : '').'">';
}
echo '<form name="takeattendance" method="post" action="attendances.php">';
print_table($table);
echo '<input type="hidden" name="id" value="'.$id.'">';
echo '<input type="hidden" name="sessionid" value="'.$sessionid.'">';
echo '<input type="hidden" name="formfrom" value="editsessvals">';
echo '<center><input type="submit" name="esv" value="'.get_string('ok').'"></center>';
echo '</form>';
} else {
print_heading(get_string('nothingtodisplay'), 'center');
}
echo get_string('status','attforblock').':<br />';
foreach($statuses as $st) {
echo $st->acronym.' - '.$st->description.'<br />';
}
print_footer($course);
?>

176
attsettings.php

@ -0,0 +1,176 @@
<?PHP
require_once('../../config.php');
require_once('locallib.php');
require_once('lib.php');
$id = required_param('id', PARAM_INT);
$submitsettings = optional_param('submitsettings');
$action = optional_param('action', '', PARAM_MULTILANG);
$stid = optional_param('st', 0, PARAM_INT);
if ($id) {
if (! $cm = get_record('course_modules', 'id', $id)) {
error('Course Module ID was incorrect');
}
if (! $course = get_record('course', 'id', $cm->course)) {
error('Course is misconfigured');
}
if (! $attforblock = get_record('attforblock', 'id', $cm->instance)) {
error("Course module is incorrect");
}
}
$attforblockrecord = get_record('attforblock','course',$course->id);
require_login($course->id);
if (! $user = get_record('user', 'id', $USER->id) ) {
error("No such user in this course");
}
if (!$context = get_context_instance(CONTEXT_MODULE, $cm->id)) {
print_error('badcontext');
}
require_capability('mod/attforblock:manageattendances', $context);
/// Print headers
$navlinks[] = array('name' => $attforblock->name, 'link' => "view.php?id=$id", 'type' => 'activity');
$navlinks[] = array('name' => get_string('settings', 'attforblock'), 'link' => null, 'type' => 'activityinstance');
$navigation = build_navigation($navlinks);
print_header("$course->shortname: ".$attforblock->name.' - '.get_string('settings','attforblock'), $course->fullname,
$navigation, "", "", true, "&nbsp;", navmenu($course));
if (!empty($action)) {
switch ($action) {
case 'delete':
if (!$rec = get_record('attendance_statuses', 'courseid', $course->id, 'id', $stid)) {
print_error('notfoundstatus', 'attforblock', "attsettings.php?id=$id");
}
if (count_records('attendance_log', 'statusid', $stid)) {
print_error('cantdeletestatus', 'attforblock', "attsettings.php?id=$id");
}
$confirm = optional_param('confirm');
if (isset($confirm)) {
set_field('attendance_statuses', 'deleted', 1, 'id', $rec->id);
// delete_records('attendance_statuses', 'id', $rec->id);
redirect('attsettings.php?id='.$id, get_string('statusdeleted','attforblock'), 3);
}
print_heading(get_string('deletingstatus','attforblock').' :: ' .$course->fullname);
notice_yesno(get_string('deletecheckfull', '', get_string('variable', 'attforblock')).
'<br /><br />'.$rec->acronym.': '.
($rec->description ? $rec->description : get_string('nodescription', 'attforblock')),
"attsettings.php?id=$id&amp;st=$stid&amp;action=delete&amp;confirm=1", $_SERVER['HTTP_REFERER']);
exit;
case 'show':
set_field('attendance_statuses', 'visible', 1, 'id', $stid);
break;
case 'hide':
$students = get_users_by_capability($context, 'moodle/legacy:student', '', '', '', '', '', '', false);
$studlist = implode(',', array_keys($students));
if (!count_records_select('attendance_log', "studentid IN ($studlist) AND statusid = $stid")) {
set_field('attendance_statuses', 'visible', 0, 'id', $stid);
} else {
print_error('canthidestatus', 'attforblock', "attsettings.php?id=$id");
}
break;
default: //Adding new status
$newacronym = optional_param('newacronym', '', PARAM_MULTILANG);
$newdescription = optional_param('newdescription', '', PARAM_MULTILANG);
$newgrade = optional_param('newgrade', 0, PARAM_INT);
if (!empty($newacronym) && !empty($newdescription)) {
unset($rec);
$rec->courseid = $course->id;
$rec->acronym = $newacronym;
$rec->description = $newdescription;
$rec->grade = $newgrade;
insert_record('attendance_statuses', $rec);
add_to_log($course->id, 'attendance', 'setting added', 'mod/attforblock/attsettings.php?course='.$course->id, $user->lastname.' '.$user->firstname);
} else {
print_error('cantaddstatus', 'attforblock', "attsettings.php?id=$id");
}
break;
}
}
show_tabs($cm, $context, 'settings');
if ($submitsettings) {
config_save(); //////////////////////////////
notice(get_string('variablesupdated','attforblock'), 'attsettings.php?id='.$id);
}
$i = 1;
$table->width = '100%';
//$table->tablealign = 'center';
$table->head = array('#',
get_string('acronym','attforblock'),
get_string('description'),
get_string('grade'),
get_string('action'));
$table->align = array('center', 'center', 'center', 'center', 'center', 'center');
//$table->size = array('1px', '1px', '*', '1px', '1px', '1px');
$statuses = get_statuses($course->id, false);
$deltitle = get_string('delete');
foreach($statuses as $st)
{
$table->data[$i][] = $i;
// $table->data[$i][] = $st->status;
$table->data[$i][] = '<input type="text" name="acronym['.$st->id.']" size="2" maxlength="2" value="'.$st->acronym.'" />';
$table->data[$i][] = '<input type="text" name="description['.$st->id.']" size="30" maxlength="30" value="'.$st->description.'" />';
$table->data[$i][] = '<input type="text" name="grade['.$st->id.']" size="4" maxlength="4" value="'.$st->grade.'" />';
$action = $st->visible ? 'hide' : 'show';
$titlevis = get_string($action);
$deleteact = '';
if (!count_records('attendance_log', 'statusid', $st->id)) {
$deleteact = "<a title=\"$deltitle\" href=\"attsettings.php?id=$cm->id&amp;st={$st->id}&amp;action=delete\">".
"<img src=\"{$CFG->pixpath}/t/delete.gif\" alt=\"$deltitle\" /></a>&nbsp;";
}
$table->data[$i][] = "<a title=\"$titlevis\" href=\"attsettings.php?id=$cm->id&amp;st={$st->id}&amp;action=$action\">".
"<img src=\"{$CFG->pixpath}/t/{$action}.gif\" alt=\"$titlevis\" /></a>&nbsp;".
$deleteact;
$i++;
}
$new_row = array('*',
'<input type="text" name="newacronym" size="2" maxlength="2" value="" />',
'<input type="text" name="newdescription" size="30" maxlength="30" value="" />',
'<input type="text" name="newgrade" size="4" maxlength="4" value="" />',
'<input type="submit" name="action" value="'.get_string('add', 'attforblock').'">'
);
$table->data[$i] = $new_row;
echo '<div align="center"><div class="generalbox boxwidthwide">';
echo '<form aname="gsess" method="post" action="attsettings.php" onSubmit="return validateSession()">';
echo '<h1 class="main help">'.get_string('myvariables','attforblock').helpbutton ('myvariables', get_string('myvariables','attforblock'), 'attforblock', true, false, '', true).'</h1>';
print_table($table);
echo '<input type="hidden" name="id" value="'.$id.'"><br />';
echo '<input type="submit" name="submitsettings" value="'.get_string("update",'attforblock').'">';
echo '</form></div></div>';
print_footer($course);
function config_save()
{
global $course, $user, $attforblockrecord;
$acronym = required_param('acronym');
$description = required_param('description');
$grade = required_param('grade',PARAM_INT);
foreach ($acronym as $id => $v) {
$rec = get_record('attendance_statuses', 'id', $id);
$rec->acronym = $acronym[$id];
$rec->description = $description[$id];
$rec->grade = $grade[$id];
update_record('attendance_statuses', $rec);
add_to_log($course->id, 'attendance', 'settings updated', 'mod/attforblock/attsettings.php?course='.$course->id, $user->lastname.' '.$user->firstname);
}
attforblock_update_grades($attforblockrecord);
}
?>

202
backuplib.php

@ -0,0 +1,202 @@
<?php
function attforblock_check_backup_mods($course, $user_data=false, $backup_unique_code=null, $instances=null) {
if (!empty($instances) && is_array($instances) && count($instances)) {
$info = array();
foreach ($instances as $id => $instance) {
$info += attforblock_check_backup_mods_instances($course, $instance, $backup_unique_code);
}
return $info;
}
return $info;
}
function attforblock_check_backup_mods_instances($course, $instance, $backup_unique_code) {
//First the course data
$info[$instance->id.'0'][0] = '<b>'.$instance->name.'</b>';
$info[$instance->id.'0'][1] = '';
$sessions = get_records_menu('attendance_sessions', 'courseid', $course);
$info[$instance->id.'1'][0] = get_string('sessions', 'attforblock');
$info[$instance->id.'1'][1] = count($sessions);
//Now, if requested, the user_data
if (!empty($instance->userdata)) {
$info[$instance->id.'2'][0] = get_string('attrecords', 'attforblock');
$sesslist = implode(',', array_keys($sessions));
if ($datas = get_records_list('attendance_log', 'sessionid', $sesslist)) {
$info[$instance->id.'2'][1] = count($datas);
} else {
$info[$instance->id.'2'][1] = 0;
}
}
return $info;
}
function attforblock_backup_mods($bf, $preferences) {
global $CFG;
$status = true;
//Iterate over attforblock table
$attforblocks = get_records ('attforblock', 'course', $preferences->backup_course, 'id');
if ($attforblocks) {
foreach ($attforblocks as $attforblock) {
if (backup_mod_selected($preferences, 'attforblock', $attforblock->id)) {
$status = attforblock_backup_one_mod($bf, $preferences, $attforblock);
}
}
}
return $status;
}
function attforblock_backup_one_mod($bf, $preferences, $attforblock) {
global $CFG;
if (is_numeric($attforblock)) {
$attforblock = get_record('attforblock', 'id', $attforblock);
}
$status = true;
//Start mod
fwrite ($bf,start_tag('MOD',3,true));
//Print attforblock data
fwrite ($bf,full_tag('ID',4,false,$attforblock->id));
fwrite ($bf,full_tag('MODTYPE',4,false,'attforblock'));
fwrite ($bf,full_tag('COURSE',4,false,$attforblock->course));
fwrite ($bf,full_tag('NAME',4,false,$attforblock->name));
fwrite ($bf,full_tag('GRADE',4,false,$attforblock->grade));
attforblock_backup_attendance_statuses ($bf,$preferences,$attforblock);
attforblock_backup_attendance_sessions ($bf,$preferences,$attforblock);
if (backup_userdata_selected($preferences, 'attforblock', $attforblock->id)) {
attforblock_backup_attendance_log ($bf,$preferences,$attforblock);
}
//End mod
$status =fwrite ($bf,end_tag('MOD',3,true));
return $status;
}
function attforblock_backup_attendance_sessions ($bf,$preferences,$attforblock) {
global $CFG;
$status = true;
$datas = get_records('attendance_sessions', 'courseid', $attforblock->course);
if ($datas) {
//Write start tag
$status =fwrite ($bf,start_tag('SESSIONS',4,true));
//Iterate over each session
foreach ($datas as $item) {
//Start session
$status =fwrite ($bf,start_tag('SESSION',5,true));
//Print contents
fwrite ($bf,full_tag('ID',6,false,$item->id));
fwrite ($bf,full_tag('COURSEID',6,false,$item->courseid));
fwrite ($bf,full_tag('SESSDATE',6,false,$item->sessdate));
fwrite ($bf,full_tag('DURATION',6,false,$item->duration));
fwrite ($bf,full_tag('TIMEMODIFIED',6,false,$item->timemodified));
fwrite ($bf,full_tag('DESCRIPTION',6,false,$item->description));
if (backup_userdata_selected($preferences, 'attforblock', $attforblock->id)) {
fwrite ($bf,full_tag('LASTTAKEN',6,false,$item->lasttaken));
fwrite ($bf,full_tag('LASTTAKENBY',6,false,$item->lasttakenby));
} else {
fwrite ($bf,full_tag('LASTTAKEN',6,false,0));
fwrite ($bf,full_tag('LASTTAKENBY',6,false,0));
}
//End submission
$status =fwrite ($bf,end_tag('SESSION',5,true));
}
//Write end tag
$status =fwrite ($bf,end_tag('SESSIONS',4,true));
}
return $status;
}
function attforblock_backup_attendance_statuses ($bf,$preferences,$attforblock) {
global $CFG;
$status = true;
$datas = get_records('attendance_statuses', 'courseid', $attforblock->course);
//If there is levels
if ($datas) {
//Write start tag
$status =fwrite ($bf,start_tag('STATUSES',4,true));
//Iterate over each status
foreach ($datas as $item) {
//Start status
$status =fwrite ($bf,start_tag('STATUS',5,true));
//Print status contents
fwrite ($bf,full_tag('ID',6,false,$item->id));
fwrite ($bf,full_tag('COURSEID',6,false,$item->courseid));
fwrite ($bf,full_tag('ACRONYM',6,false,$item->acronym));
fwrite ($bf,full_tag('DESCRIPTION',6,false,$item->description));
fwrite ($bf,full_tag('GRADE',6,false,$item->grade));
fwrite ($bf,full_tag('VISIBLE',6,false,$item->visible));
fwrite ($bf,full_tag('DELETED',6,false,$item->deleted));
//End submission
$status =fwrite ($bf,end_tag('STATUS',5,true));
}
//Write end tag
$status =fwrite ($bf,end_tag('STATUSES',4,true));
}
return $status;
}
function attforblock_backup_attendance_log ($bf,$preferences,$attforblock) {
global $CFG;
$status = true;
$sessions = get_records_menu('attendance_sessions', 'courseid', $attforblock->course);
$sesslist = implode(',', array_keys($sessions));
$datas = get_records_list('attendance_log', 'sessionid', $sesslist);
//If there is levels
if ($datas) {
//Write start tag
$status = fwrite ($bf,start_tag('LOGS',4,true));
//Iterate over each log
foreach ($datas as $item) {
//Start log
$status = fwrite ($bf,start_tag('LOG',5,true));
//Print log contents
fwrite ($bf,full_tag('ID',6,false,$item->id));
fwrite ($bf,full_tag('SESSIONID',6,false,$item->sessionid));
fwrite ($bf,full_tag('STUDENTID',6,false,$item->studentid));
fwrite ($bf,full_tag('STATUSID',6,false,$item->statusid));
fwrite ($bf,full_tag('TIMETAKEN',6,false,$item->timetaken));
fwrite ($bf,full_tag('TAKENBY',6,false,$item->takenby));
fwrite ($bf,full_tag('STATUSSET',6,false,$item->statusset));
fwrite ($bf,full_tag('REMARKS',6,false,$item->remarks));
//End submission
$status = fwrite ($bf,end_tag('LOG',5,true));
}
//Write end tag
$status = fwrite ($bf,end_tag('LOGS',4,true));
}
return $status;
}
?>

124
db/access.php

@ -0,0 +1,124 @@
<?php
//
// Capability definitions for the assignment module.
//
// The capabilities are loaded into the database table when the module is
// installed or updated. Whenever the capability definitions are updated,
// the module version number should be bumped up.
//
// The system has four possible values for a capability:
// CAP_ALLOW, CAP_PREVENT, CAP_PROHIBIT, and inherit (not set).
//
//
// CAPABILITY NAMING CONVENTION
//
// It is important that capability names are unique. The naming convention
// for capabilities that are specific to modules and blocks is as follows:
// [mod/block]/<component_name>:<capabilityname>
//
// component_name should be the same as the directory name of the mod or block.
//
// Core moodle capabilities are defined thus:
// moodle/<capabilityclass>:<capabilityname>
//
// Examples: mod/forum:viewpost
// block/recent_activity:view
// moodle/site:deleteuser
//
// The variable name for the capability definitions array follows the format
// $<componenttype>_<component_name>_capabilities
//
// For the core capabilities, the variable is $moodle_capabilities.
$mod_attforblock_capabilities = array(
'mod/attforblock:view' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
),
'mod/attforblock:viewreports' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
),
'mod/attforblock:takeattendances' => array(
'riskbitmask' => RISK_DATALOSS,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
),
'mod/attforblock:changeattendances' => array(
'riskbitmask' => RISK_DATALOSS,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
),
'mod/attforblock:manageattendances' => array(
'riskbitmask' => RISK_CONFIG,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
'editingteacher' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
),
'mod/attforblock:changepreferences' => array(
'riskbitmask' => RISK_CONFIG,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
'editingteacher' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
),
'mod/attforblock:export' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
'editingteacher' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
)
);
?>

80
db/install.xml

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="mod/attforblock/db" VERSION="20090112" COMMENT="XMLDB file for Moodle mod/attforblock"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE NAME="attforblock" COMMENT="Module for support Attendances" NEXT="attendance_sessions">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="course"/>
<FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="grade"/>
<FIELD NAME="grade" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="100" SEQUENCE="false" ENUM="false" COMMENT="This is maximum grade for instance" PREVIOUS="name"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for attforblock"/>
</KEYS>
<INDEXES>
<INDEX NAME="course" UNIQUE="false" FIELDS="course"/>
</INDEXES>
</TABLE>
<TABLE NAME="attendance_sessions" COMMENT="attendance_sessions table retrofitted from MySQL" PREVIOUS="attforblock" NEXT="attendance_log">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
<FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="sessdate"/>
<FIELD NAME="sessdate" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="duration"/>
<FIELD NAME="duration" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="sessdate" NEXT="lasttaken"/>
<FIELD NAME="lasttaken" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" PREVIOUS="duration" NEXT="lasttakenby"/>
<FIELD NAME="lasttakenby" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="lasttaken" NEXT="timemodified"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" PREVIOUS="lasttakenby" NEXT="description"/>
<FIELD NAME="description" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for attendance_sessions"/>
</KEYS>
<INDEXES>
<INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="sessdate"/>
<INDEX NAME="sessdate" UNIQUE="false" FIELDS="sessdate" PREVIOUS="courseid"/>
</INDEXES>
</TABLE>
<TABLE NAME="attendance_log" COMMENT="attendance_log table retrofitted from MySQL" PREVIOUS="attendance_sessions" NEXT="attendance_statuses">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="sessionid"/>
<FIELD NAME="sessionid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="studentid"/>
<FIELD NAME="studentid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="sessionid" NEXT="statusid"/>
<FIELD NAME="statusid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="link with attendance_status table" PREVIOUS="studentid" NEXT="statusset"/>
<FIELD NAME="statusset" TYPE="char" LENGTH="100" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="statusid" NEXT="timetaken"/>
<FIELD NAME="timetaken" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="When attendance of this student was taken" PREVIOUS="statusset" NEXT="takenby"/>
<FIELD NAME="takenby" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timetaken" NEXT="remarks"/>
<FIELD NAME="remarks" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="takenby"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for attendance_log"/>
</KEYS>
<INDEXES>
<INDEX NAME="sessionid" UNIQUE="false" FIELDS="sessionid" NEXT="studentid"/>
<INDEX NAME="studentid" UNIQUE="false" FIELDS="studentid" PREVIOUS="sessionid" NEXT="statusid"/>
<INDEX NAME="statusid" UNIQUE="false" FIELDS="statusid" PREVIOUS="studentid"/>
</INDEXES>
</TABLE>
<TABLE NAME="attendance_statuses" COMMENT="attendance_statuses table retrofitted from MySQL" PREVIOUS="attendance_log">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
<FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="acronym"/>
<FIELD NAME="acronym" TYPE="char" LENGTH="2" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="description"/>
<FIELD NAME="description" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="acronym" NEXT="grade"/>
<FIELD NAME="grade" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="description" NEXT="visible"/>
<FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="grade" NEXT="deleted"/>
<FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="visible"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for attendance_settings"/>
</KEYS>
<INDEXES>
<INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="visible"/>
<INDEX NAME="visible" UNIQUE="false" FIELDS="visible" PREVIOUS="courseid" NEXT="deleted"/>
<INDEX NAME="deleted" UNIQUE="false" FIELDS="deleted" PREVIOUS="visible"/>
</INDEXES>
</TABLE>
</TABLES>
</XMLDB>

221
db/upgrade.php

@ -0,0 +1,221 @@
<?php //$Id: upgrade.php,v 1.1.2.2 2009/02/23 19:22:42 dlnsk Exp $
// This file keeps track of upgrades to
// the forum module
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installtion to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// The commands in here will all be database-neutral,
// using the functions defined in lib/ddllib.php
function xmldb_attforblock_upgrade($oldversion=0) {
global $CFG, $THEME, $db;
$result = true;
/// And upgrade begins here. For each one, you'll need one
/// block of code similar to the next one. Please, delete
/// this comment lines once this file start handling proper
/// upgrade code.
if ($result && $oldversion < 2008021904) { //New version in version.php
global $USER;
if ($sessions = get_records('attendance_sessions', 'takenby', 0)) {
foreach ($sessions as $sess) {
if (count_records('attendance_log', 'attsid', $sess->id) > 0) {
$sess->takenby = $USER->id;
$sess->timetaken = $sess->timemodified ? $sess->timemodified : time();
$sess->description = addslashes($sess->description);
$result = update_record('attendance_sessions', $sess) and $result;
}
}
}
}
if ($oldversion < 2008102401 and $result) {
$table = new XMLDBTable('attforblock');
$field = new XMLDBField('grade');
$field->setAttributes(XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null, null, '100', 'name');
$result = $result && add_field($table, $field);
$table = new XMLDBTable('attendance_sessions');
$field = new XMLDBField('courseid');
$field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'id');
$result = $result && change_field_unsigned($table, $field);
// $field = new XMLDBField('creator');
// $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'courseid');
// $result = $result && change_field_unsigned($table, $field);
$field = new XMLDBField('sessdate');
$field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'creator');
$result = $result && change_field_unsigned($table, $field);
$field = new XMLDBField('duration');
$field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'sessdate');
$result = $result && add_field($table, $field);
$field = new XMLDBField('timetaken');
$field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'takenby');
$result = $result && change_field_unsigned($table, $field);
$result = $result && rename_field($table, $field, 'lasttaken');
$field = new XMLDBField('takenby');
$field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'lasttaken');
$result = $result && change_field_unsigned($table, $field);
$result = $result && rename_field($table, $field, 'lasttakenby');
$field = new XMLDBField('timemodified');
$field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null, null, null, 'lasttaken');
$result = $result && change_field_unsigned($table, $field);
$table = new XMLDBTable('attendance_log');
$field = new XMLDBField('attsid');
$field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'id');
$result = $result && change_field_unsigned($table, $field);
$field = new XMLDBField('studentid');
$field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'attsid');
$result = $result && change_field_unsigned($table, $field);
$field = new XMLDBField('statusid');
$field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'status');
$result = $result && add_field($table, $field);
$field = new XMLDBField('statusset');
$field->setAttributes(XMLDB_TYPE_CHAR, '100', null, null, null, null, null, null, 'statusid');
$result = $result && add_field($table, $field);
$field = new XMLDBField('timetaken');
$field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'statusid');
$result = $result && add_field($table, $field);
$field = new XMLDBField('takenby');
$field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'timetaken');
$result = $result && add_field($table, $field);
//Indexes
$index = new XMLDBIndex('statusid');
$index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('statusid'));
$result = $result && add_index($table, $index);
$index = new XMLDBIndex('attsid');
$index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('attsid'));
$result = $result && drop_index($table, $index);
$field = new XMLDBField('attsid'); //Rename field
$field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'id');
$result = $result && rename_field($table, $field, 'sessionid');
$index = new XMLDBIndex('sessionid');
$index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('sessionid'));
$result = $result && add_index($table, $index);
$table = new XMLDBTable('attendance_settings');
$field = new XMLDBField('courseid');
$field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'id');
$result = $result && change_field_unsigned($table, $field);
$field = new XMLDBField('visible');
$field->setAttributes(XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '1', 'grade');
$result = $result && add_field($table, $field);
$field = new XMLDBField('deleted');
$field->setAttributes(XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'visible');
$result = $result && add_field($table, $field);
//Indexes
$index = new XMLDBIndex('visible');
$index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('visible'));
$result = $result && add_index($table, $index);
$index = new XMLDBIndex('deleted');
$index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('deleted'));
$result = $result && add_index($table, $index);
$result = $result && rename_table($table, 'attendance_statuses');
}
if ($oldversion < 2008102406 and $result) {
if ($courses = get_records_sql("SELECT courseid FROM {$CFG->prefix}attendance_sessions GROUP BY courseid")) {
foreach ($courses as $c) {
//Adding own status for course (now it must have own)
if (!count_records('attendance_statuses', 'courseid', $c->courseid)) {
$statuses = get_records('attendance_statuses', 'courseid', 0);
foreach($statuses as $stat) {
$rec = $stat;
$rec->courseid = $c->courseid;
insert_record('attendance_statuses', $rec);
}
}
$statuses = get_records('attendance_statuses', 'courseid', $c->courseid);
$statlist = implode(',', array_keys($statuses));
$sess = get_records_select_menu('attendance_sessions', "courseid = $c->courseid AND lasttakenby > 0");
$sesslist = implode(',', array_keys($sess));
foreach($statuses as $stat) {
execute_sql("UPDATE {$CFG->prefix}attendance_log
SET statusid = {$stat->id}, statusset = '$statlist'
WHERE sessionid IN ($sesslist) AND status = '$stat->status'");
}
$sessions = get_records_list('attendance_sessions', 'id', $sesslist);
foreach($sessions as $sess) {
execute_sql("UPDATE {$CFG->prefix}attendance_log
SET timetaken = {$sess->lasttaken},
takenby = {$sess->lasttakenby}
WHERE sessionid = {$sess->id}");
}
}
}
}
if ($oldversion < 2008102409 and $result) {
$table = new XMLDBTable('attendance_statuses');
$field = new XMLDBField('status');
$result = $result && drop_field($table, $field);
$index = new XMLDBIndex('status');
$index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('status'));
$result = $result && drop_index($table, $index);
$table = new XMLDBTable('attendance_log');
$field = new XMLDBField('status');
$result = $result && drop_field($table, $field);
$index = new XMLDBIndex('status');
$index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('status'));
$result = $result && drop_index($table, $index);
$table = new XMLDBTable('attendance_sessions');
$field = new XMLDBField('creator');
$result = $result && drop_field($table, $field);
}
return $result;
}
?>

48
duration_form.php

@ -0,0 +1,48 @@
<?php // $Id: duration_form.php,v 1.3.2.2 2009/02/23 19:22:42 dlnsk Exp $
require_once($CFG->libdir.'/formslib.php');
class mod_attforblock_duration_form extends moodleform {
function definition() {
global $CFG;
$mform =& $this->_form;
$course = $this->_customdata['course'];
$cm = $this->_customdata['cm'];
$modcontext = $this->_customdata['modcontext'];
$ids = $this->_customdata['ids'];
$mform->addElement('header', 'general', get_string('changeduration','attforblock'));
$mform->addElement('static', 'count', get_string('countofselected','attforblock'), count(explode('_', $ids)));
for ($i=0; $i<=23; $i++) {
$hours[$i] = sprintf("%02d",$i);
}
for ($i=0; $i<60; $i+=5) {
$minutes[$i] = sprintf("%02d",$i);
}
$durselect[] =& MoodleQuickForm::createElement('select', 'hours', '', $hours);
$durselect[] =& MoodleQuickForm::createElement('select', 'minutes', '', $minutes, false, true);
$mform->addGroup($durselect, 'durtime', get_string('newduration','attforblock'), array(' '), true);
$mform->addElement('hidden', 'ids', $ids);
$mform->addElement('hidden', 'id', $cm->id);
$mform->addElement('hidden', 'action', 'changeduration');
$mform->setDefaults(array('durtime' => array('hours'=>0, 'minutes'=>0)));
//-------------------------------------------------------------------------------
// buttons
$submit_string = get_string('update', 'attforblock');
$this->add_action_buttons(true, $submit_string);
// $mform->addElement('hidden', 'id', $cm->id);
// $mform->addElement('hidden', 'sessionid', $sessionid);
// $mform->addElement('hidden', 'action', 'changeduration');
}
}
?>

187
export.php

@ -0,0 +1,187 @@
<?PHP // $Id: export.php,v 1.1.2.2 2009/02/23 19:22:40 dlnsk Exp $
// Lists all the sessions for a course
require_once('../../config.php');
require_once('locallib.php');
// require_once('grouplib.php');
require_once('export_form.php');
$id = required_param('id', PARAM_INT);
// $format = optional_param('format', '', PARAM_ACTION);
if (! $cm = get_record("course_modules", "id", $id)) {
error("Course Module ID was incorrect");
}
if (! $course = get_record("course", "id", $cm->course)) {
error("Course is misconfigured");
}
if (! $attforblock = get_record('attforblock', 'id', $cm->instance)) {
error("Course module is incorrect");
}
require_login($course->id);
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
require_capability('mod/attforblock:export', $context);
$mform_export = new mod_attforblock_export_form('export.php', array('course'=>$course, 'cm'=>$cm, 'modcontext'=>$context));
if ($fromform = $mform_export->get_data()) {
$group = groups_get_group($fromform->group);
if ($group) {
$students = get_users_by_capability($context, 'moodle/legacy:student', '', 'u.lastname ASC', '', '', $group->id, '', false);
} else {
$students = get_users_by_capability($context, 'moodle/legacy:student', '', 'u.lastname ASC', '', '', '', '', false);
}
if ($students) {
$filename = clean_filename($course->shortname.'_Attendances_'.userdate(time(), '%Y%m%d-%H%M'));
$data->tabhead = array();
// $data->sheettitle = $course->fullname.' - ';
// $data->sheettitle .= $group ? $group->name : get_string('allparticipants');
$data->course = $course->fullname;
$data->group = $group ? $group->name : get_string('allparticipants');
if (isset($fromform->ident['id'])) {
$data->tabhead[] = get_string('studentid','attforblock');
}
if (isset($fromform->ident['uname'])) {
$data->tabhead[] = get_string('username');
}
$data->tabhead[] = get_string('lastname');
$data->tabhead[] = get_string('firstname');
$select = "courseid = {$course->id} AND sessdate >= {$course->startdate}";
if (isset($fromform->includenottaken)) {
$select .= " AND sessdate <= {$fromform->sessionenddate}";
} else {
$select .= " AND lasttaken != 0";
}
if ($sessions = get_records_select('attendance_sessions', $select, 'sessdate ASC')) {
foreach($sessions as $sess) {
$data->tabhead[] = userdate($sess->sessdate, get_string('strftimedmyhm', 'attforblock'));
}
} else {
error('Sessions not found!', 'report.php?id='.$id);
}
$data->tabhead[] = '%';
$i = 0;
$data->table = array();
$statuses = get_statuses($course->id);
foreach($students as $student) {
if (isset($fromform->ident['id'])) {
$data->table[$i][] = $student->id;
}
if (isset($fromform->ident['uname'])) {
$data->table[$i][] = $student->username;
}
$data->table[$i][] = $student->lastname;
$data->table[$i][] = $student->firstname;
foreach ($sessions as $sess) {
if ($rec = get_record('attendance_log', 'sessionid', $sess->id, 'studentid', $student->id)) {
$data->table[$i][] = $statuses[$rec->statusid]->acronym;
} else {
$data->table[$i][] = '-';
}
}
$data->table[$i][] = get_percent($student->id, $course).'%';
$i++;
}
if ($fromform->format === 'text') {
ExportToCSV($data, $filename);
} else {
ExportToTableEd($data, $filename, $fromform->format);
}
exit;
} else {
error('Students not found!', 'report.php?id='.$id);
}
} else {
/// Print headers
$navlinks[] = array('name' => $attforblock->name, 'link' => "view.php?id=$id", 'type' => 'activity');
$navlinks[] = array('name' => get_string('export', 'quiz'), 'link' => null, 'type' => 'activityinstance');
$navigation = build_navigation($navlinks);
print_header("$course->shortname: ".$attforblock->name.' - ' .get_string('export', 'quiz'), $course->fullname,
$navigation, "", "", true, "&nbsp;", navmenu($course));
show_tabs($cm, $context, 'export');
$mform_export->display();
}
print_footer($course);
/////////////////////////////////////////////////////////////////////////////////
function ExportToTableEd($data, $filename, $format) {
global $CFG;
if ($format === 'excel') {
require_once("$CFG->libdir/excellib.class.php");
$filename .= ".xls";
$workbook = new MoodleExcelWorkbook("-");
} else {
require_once("$CFG->libdir/odslib.class.php");
$filename .= ".ods";
$workbook = new MoodleODSWorkbook("-");
}
/// Sending HTTP headers
$workbook->send($filename);
/// Creating the first worksheet
$myxls =& $workbook->add_worksheet('Attendances');
/// format types
$formatbc =& $workbook->add_format();
$formatbc->set_bold(1);
$myxls->write(0, 0, get_string('course'), $formatbc);
$myxls->write(0, 1, $data->course);
$myxls->write(1, 0, get_string('group'), $formatbc);
$myxls->write(1, 1, $data->group);
$i = 3;
$j = 0;
foreach ($data->tabhead as $cell) {
$myxls->write($i, $j++, $cell, $formatbc);
}
$i++;
$j = 0;
foreach ($data->table as $row) {
foreach ($row as $cell) {
$myxls->write($i, $j++, $cell);
// if (is_numeric($cell)) {
// $myxls->write_number($i, $j++, $cell);
// } else {
// $myxls->write_string($i, $j++, $cell);
// }
}
$i++;
$j = 0;
}
$workbook->close();
}
function ExportToCSV($data, $filename) {
$filename .= ".txt";
header("Content-Type: application/download\n");
header("Content-Disposition: attachment; filename=\"$filename\"");
header("Expires: 0");
header("Cache-Control: must-revalidate,post-check=0,pre-check=0");
header("Pragma: public");
echo get_string('course')."\t".$data->course."\n";
echo get_string('group')."\t".$data->group."\n\n";
echo implode("\t", $data->tabhead)."\n";
foreach ($data->table as $row) {
echo implode("\t", $row)."\n";
}
}
?>

113
export_form.php

@ -0,0 +1,113 @@
<?php // $Id: export_form.php,v 1.2.2.3 2009/03/11 18:17:38 dlnsk Exp $
require_once($CFG->libdir.'/formslib.php');
class mod_attforblock_export_form extends moodleform {
function definition() {
global $CFG, $USER;
$mform =& $this->_form;
$course = $this->_customdata['course'];
$cm = $this->_customdata['cm'];
// $coursecontext = $this->_customdata['coursecontext'];
$modcontext = $this->_customdata['modcontext'];
// $forum = $this->_customdata['forum'];
// $post = $this->_customdata['post']; // hack alert
$mform->addElement('header', 'general', get_string('export','quiz'));
$mform->setHelpButton('general', array('export', get_string('export','quiz'), 'attforblock'));
// $mform->addElement('date_selector', 'sessiondate', get_string('sessiondate','attforblock'));
$groupmode=groups_get_activity_groupmode($cm);
$groups = groups_get_activity_allowed_groups($cm, $USER->id);
if ($groupmode == VISIBLEGROUPS or has_capability('moodle/site:accessallgroups', $modcontext)) {
$grouplist[0] = get_string('allparticipants');
}
if ($groups) {
foreach ($groups as $group) {
$grouplist[$group->id] = $group->name;
}
}
$mform->addElement('select', 'group', get_string('group'), $grouplist);
$ident = array();
$ident[] =& MoodleQuickForm::createElement('checkbox', 'id', '', get_string('studentid', 'attforblock'));
$ident[] =& MoodleQuickForm::createElement('checkbox', 'uname', '', get_string('username'));
$mform->addGroup($ident, 'ident', get_string('identifyby','attforblock'), array('<br />'), true);
$mform->setDefaults(array('ident[id]' => true, 'ident[uname]' => true));
// for ($i=0; $i<=23; $i++) {
// $hours[$i] = sprintf("%02d",$i);
// }
// for ($i=0; $i<60; $i+=5) {
// $minutes[$i] = sprintf("%02d",$i);
// }
// $stime = array();
// $stime[] =& MoodleQuickForm::createElement('select', 'hours', get_string('hour', 'form'), $hours, false, true);
// $stime[] =& MoodleQuickForm::createElement('select', 'minutes', get_string('minute', 'form'), $minutes, false, true);
// $mform->addGroup($stime, 'stime', get_string('sessionstarttime','attforblock'), array(' '), true);
// $durtime = array();
// $durtime[] =& MoodleQuickForm::createElement('select', 'hours', get_string('hour', 'form'), $hours, false, true);
// $durtime[] =& MoodleQuickForm::createElement('select', 'minutes', get_string('minute', 'form'), $minutes, false, true);
// $mform->addGroup($durtime, 'durtime', get_string('duration','attforblock'), array(' '), true);
$mform->addElement('checkbox', 'includenottaken', get_string('includenottaken','attforblock'), get_string('yes'));
$mform->addElement('date_selector', 'sessionenddate', get_string('endofperiod','attforblock'));
$mform->disabledIf('sessionenddate', 'includenottaken', 'notchecked');
$mform->addElement('select', 'format', get_string('format'),
array('excel' => get_string('downloadexcel','attforblock'),
'ooo' => get_string('downloadooo','attforblock'),
'text' => get_string('downloadtext','attforblock')
));
// $opts = array();
// $opts[] =& MoodleQuickForm::createElement('checkbox', 'Mon', '', get_string('monday','calendar'));
//// $opts[] =& MoodleQuickForm::createElement('checkbox', 'Tue', '', get_string('tuesday','calendar'));
//// $opts[] =& MoodleQuickForm::createElement('checkbox', 'Wed', '', get_string('wednesday','calendar'));
//// $opts[] =& MoodleQuickForm::createElement('checkbox', 'Thu', '', get_string('thursday','calendar'));
//// $opts[] =& MoodleQuickForm::createElement('checkbox', 'Fri', '', get_string('friday','calendar'));
//// $opts[] =& MoodleQuickForm::createElement('checkbox', 'Sat', '', get_string('saturday','calendar'));
// $mform->addGroup($opts, 'opts', get_string('sessiondays','attforblock'), array(' '), true);
// $mform->disabledIf('opts', 'addmultiply', 'notchecked');
//
// $period = array(1=>1,2,3,4,5,6,7,8);
// $periodgroup = array();
// $periodgroup[] =& MoodleQuickForm::createElement('select', 'period', '', $period, false, true);
// $periodgroup[] =& MoodleQuickForm::createElement('static', 'perioddesc', '', get_string('week','attforblock'));
// $mform->addGroup($periodgroup, 'periodgroup', get_string('period','attforblock'), array(' '), false);
// $mform->disabledIf('periodgroup', 'addmultiply', 'notchecked');
//
// $mform->addElement('text', 'sdescription', get_string('description', 'attforblock'), 'size="48"');
// $mform->setType('sdescription', PARAM_TEXT);
// $mform->addRule('sdescription', get_string('maximumchars', '', 100), 'maxlength', 100, 'client');
//-------------------------------------------------------------------------------
// buttons
$submit_string = get_string('ok');
$this->add_action_buttons(false, $submit_string);
$mform->addElement('hidden', 'id', $cm->id);
// $mform->addElement('hidden', 'action', 'add');
}
// function validation($data, $files) {
// $errors = parent::validation($data, $files);
// if (($data['timeend']!=0) && ($data['timestart']!=0)
// && $data['timeend'] <= $data['timestart']) {
// $errors['timeend'] = get_string('timestartenderror', 'forum');
// }
// return $errors;
// }
}
?>

BIN
icon.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 B

20
index.php

@ -0,0 +1,20 @@
<?PHP // $Id: index.php,v 1.4.2.1 2009/02/23 19:22:40 dlnsk Exp $
/// This page lists all the instances of attforblock in a particular course
/// Replace attforblock with the name of your module
require_once('../../config.php');
$id = required_param('id', PARAM_INT); // Course id
if (! $course = get_record('course', 'id', $id)) {
error('Course ID is incorrect');
}
if ($att = array_pop(get_all_instances_in_course('attforblock', $course, NULL, true))) {
redirect("view.php?id=$att->coursemodule");
} else {
print_error('notfound', 'attforblock');
}
?>

116
lang/cs_utf8/attforblock.php

@ -0,0 +1,116 @@
<?PHP // $Id: attforblock.php,v 1.1.2.1 2009/03/10 11:19:37 dlnsk Exp $
// attendanceblk.php - created with Moodle 1.5.3+ (2005060230)
$string['Aacronym'] = 'A';
$string['Afull'] = 'Absence';
$string['Eacronym'] = 'O';
$string['Efull'] = 'Omluveno';
$string['Lacronym'] = 'Z';
$string['Lfull'] = 'Zpoždění';
$string['Pacronym'] = 'P';
$string['Pfull'] = 'Přítomen';
$string['acronym'] = 'Zkratka';
$string['add'] = 'Přidat';
$string['addmultiplesessions'] = 'Přidat více záznamů';
$string['addsession'] = 'Přidat záznam';
$string['allcourses'] = 'Všechny kurzy';
$string['alltaken'] = 'Všechny proběhlé';
$string['attendanceforthecourse'] = 'Docházka pro kurz';
$string['attendancegrade'] = 'Hodnocení docházky';
$string['attendancenotstarted'] = 'Docházka pro tento kurz dosud nebyla zahájena';
$string['attendancepercent'] = 'Docházka v procentech';
$string['attendancereport'] = 'Sestavy docházky';
$string['attendancesuccess'] = 'Docházka byla úspěšně založena';
$string['attendanceupdated'] = 'Docházka byla úspěšně aktualizována';
$string['attforblock:changepreferences'] = 'Změnit nastavení';
$string['attforblock:changeattendances'] = 'Změnit docházku';
$string['attforblock:export'] = 'Exportovat sestavy';
$string['attforblock:manageattendances'] = 'Spravovat docházku';
$string['attforblock:takeattendances'] = 'Vyplnit docházku';
$string['attforblock:view'] = 'Prohlédnout docházku';
$string['attforblock:viewreports'] = 'Prohlédnout sestavy';
$string['attrecords'] = 'Záznamy docházky';
$string['changeduration'] = 'Změnit trvání';
$string['changesession'] = 'Změnit záznam';
$string['countofselected'] = 'Počet vybraných';
$string['createmultiplesessions'] = 'Vytvořit více záznamů';
$string['createonesession'] = 'Vytvořit jeden záznam pro kurz';
$string['defaults'] = 'Výchozí hodnoty';
$string['delete'] = 'Smazat';
$string['deletelogs'] = 'Smazat docházková data';
$string['deleteselected'] = 'Smazat vybrané';
$string['deletesession'] = 'Smazat záznam';
$string['deletesessions'] = 'Smazat všechny záznamy';
$string['deletingsession'] = 'Smazání záznamu v kurzu';
$string['description'] = 'Popis';
$string['display'] = 'Zobrazit';
$string['downloadexcel'] = 'Stáhnout ve formátu XLS';
$string['downloadooo'] = 'Stáhnout ve formátu ODT';
$string['downloadtext'] = 'Stáhnout ve formátu TXT';
$string['duration'] = 'Trvání';
$string['editsession'] = 'Editovat záznam';
$string['endofperiod'] = 'Konec období';
$string['errorinaddingsession'] = 'Chyba v přidání záznamu';
$string['erroringeneratingsessions'] = 'Chyba v generování záznamů';
$string['hiddensessions'] = 'Skryté záznamy';
$string['identifyby'] = 'Identifikuj studenta podle';
$string['includenottaken'] = 'Včetně budoucích záznamů';
$string['indetail'] = 'Podrobně…';
$string['moduledescription'] = 'Smíte přidat pouze jeden modul docházky na kurz.<br />Odstranění tohoto modulu neodstraní data!';
$string['modulename'] = 'Docházka';
$string['modulenameplural'] = 'Docházky';
$string['months'] = 'Měsíce';
$string['myvariables'] = 'Volby';
$string['newdate'] = 'Nové datum';
$string['newduration'] = 'Nové trvání';
$string['noattforuser'] = 'Pro uživatele neexistují žádné záznamy docházky';
$string['nodescription'] = 'Řádný záznam třídy';
$string['noguest'] = 'Hosté nemohou vidět docházku';
$string['noofdaysabsent'] = 'Žádné dny absence';
$string['noofdaysexcused'] = 'Žádné dny omluvené';
$string['noofdayslate'] = 'Žádné dny pozdě';
$string['noofdayspresent'] = 'Žádné dny přítomen';
$string['nosessiondayselected'] = 'Nebyl vybrán žádný den se záznamem';
$string['nosessionexists'] = 'Pro tento kurz neexistují žádné záznamy';
$string['notfound'] = 'Docházková činnost nebyla v tomto kurzu nalezena!';
$string['olddate'] = 'Staré datum';
$string['period'] = 'Frekvence';
$string['remarks'] = 'Poznámky';
$string['report'] = 'Přehled';
$string['resetdescription'] = 'Nezapomeňte, že smazání docházkových dat smaže informace z databáze. Můžete skrýt starší záznamy změnou data zahájení kurzu.';
$string['resetstatuses'] = 'Obnovit stavy do výchozích hodnot';
$string['restoredefaults'] = 'Obnovit výchozí';
$string['session'] = 'Záznam';
$string['sessionadded'] = 'Záznam úspěšně přidán';
$string['sessionalreadyexists'] = 'Záznam pro toto datum již existuje';
$string['sessiondate'] = 'Datum záznamu';
$string['sessiondays'] = 'Dny';
$string['sessiondeleted'] = 'Záznam úspěšně smazán';
$string['sessionenddate'] = 'Koncové datum záznamů';
$string['sessionexist'] = 'Záznam nebyl přidán (již existuje)!';
$string['sessions'] = 'Záznamy';
$string['sessionscompleted'] = 'Všechny záznamy';
$string['sessionsgenerated'] = 'Záznamy úspěšně vygenerovány';
$string['sessionstartdate'] = 'Počáteční datum záznamů';
$string['sessionupdated'] = 'Záznam úspěšně aktualizován';
$string['settings'] = 'Nastavení';
$string['showdefaults'] = 'Ukázat výchozí';
$string['status'] = 'Stav';
$string['strftimedm'] = '%%d.%%m.';
$string['strftimedmy'] = '%%d.%%m.%%Y';
$string['strftimedmyhm'] = '%%d.%%m.%%Y %%H:%%M'; // line added to allow multiple sessions in the same day
$string['strftimedmyw'] = '%%A&nbsp;%%d.%%m.%%Y';
$string['strftimehm'] = '%%H:%%M'; //line added to allow display of time
$string['strftimeshortdate'] = '%%d.%%m.%%Y';
$string['studentid'] = 'ID studenta';
$string['takeattendance'] = 'Vyplnit docházku';
$string['thiscourse'] = 'Tento kurz';
$string['update'] = 'Aktualizovat';
$string['variablesupdated'] = 'Volby úspěšně aktualizovány';
$string['versionforprinting'] = 'verze pro tisk';
$string['week'] = 'týdnů';
$string['weeks'] = 'Týdny';
$string['youcantdo'] = 'Nemůžete nic udělat';
?>

84
lang/de/attforblock.php

@ -0,0 +1,84 @@
<?PHP // $Id: attforblock.php,v 1.1.2.2 2009/02/23 19:22:43 dlnsk Exp $
// attforblock.php - created with Moodle 1.5.3+ (2005060230)
$string['modulename'] = 'Anwesenheit';
$string['modulenameplural'] = 'Anwesenheit';
$string['modulenamesimple'] = 'Anwesenheit';
$string['Aacronym'] = 'F';
$string['Afull'] = 'Fehlend';
$string['Eacronym'] = 'E';
$string['Efull'] = 'Entschuldigt';
$string['Lacronym'] = 'V';
$string['Lfull'] = 'Verspätet';
$string['Pacronym'] = 'A';
$string['Pfull'] = 'Anwesend';
$string['acronym'] = 'Akronym';
$string['add'] = 'Hinzufügen';
$string['addmultiplesessions'] = 'Lehrveranstaltungen hinzufügen';
$string['addsession'] = 'Lehrveranstaltung hinzufügen';
$string['alltaken'] = 'Alle Aufzeichnungen';
$string['attendanceforthecourse'] = 'Anwesenheit beim Kurs';
$string['attendancegrade'] = 'Anwesenheit Punkte';
$string['attendancenotstarted'] = 'Für diesen Kurs gibt es noch keine Aufzeichnungen.';
$string['attendancepercent'] = 'Anwesenheit Prozent';
$string['attendancereport'] = 'Anwesenheit Bericht';
$string['attendancesuccess'] = 'Anwesenheit erfolgreich aufgezeichnet';
$string['attendanceupdated'] = 'Anwesenheit erfolgreich aktualisiert';
$string['changesession'] = 'Lehrveranstaltung ändern';
$string['createmultiplesessions'] = 'wöchentliche Lehrveranstaltungen';
$string['createonesession'] = 'einzelne Lehrveranstaltung';
$string['defaults'] = 'Standardeinstellungen';
$string['delete'] = 'Löschen';
$string['deletesession'] = 'Lehrveranstaltung löschen';
$string['deletingsession'] = 'Lehrveranstaltung wird gelöscht';
$string['description'] = 'Beschreibung';
$string['display'] = 'Anzeigen';
$string['downloadexcel'] = 'Download als Excel-Datei';
$string['downloadtext'] = 'Download als Text-Datei';
$string['editsession'] = 'Lehrveranstaltung ändern';
$string['errorinaddingsession'] = 'Fehler beim Hinzufügen der Lehrveranstaltung';
$string['erroringeneratingsessions'] = 'Fehler beim Erstellen der Lehrveranstaltung';
$string['indetail'] = 'Im Detail ...';
$string['months'] = 'Monate';
$string['myvariables'] = 'Meine Variablen';
$string['newdate'] = 'Neues Datum';
$string['nodescription'] = 'Keine Beschreibung vorhanden!';
$string['noguest'] = 'Gast sieht keine Anwesenheit';
$string['noofdaysabsent'] = 'Versäumte Veranstaltungen';
$string['noofdaysexcused'] = 'Entschuldigt ferngeblieben';
$string['noofdayslate'] = 'Teilweise besucht';
$string['noofdayspresent'] = 'Besuchte Veranstaltungen';
$string['nosessiondayselected'] = 'Keine Lehrveranstaltung ausgewählt';
$string['nosessionexists'] = 'Es gibt keine Lehrveranstaltungen';
$string['olddate'] = 'Altes Datum';
$string['period'] = 'Intervall';
$string['remarks'] = 'Bemerkungen';
$string['report'] = 'Bericht';
$string['restoredefaults'] = 'Standard wiederherstellen';
$string['session'] = 'Lehrveranstaltung';
$string['sessionadded'] = 'Lehrveranstaltung erfolgreich hinzugefügt';
$string['sessionalreadyexists'] = 'Für dieses Datum existiert bereits eine Lehrveranstaltung';
$string['sessiondate'] = 'Datum der Lehrveranstaltung';
$string['sessiondays'] = 'Wochentage';
$string['sessiondeleted'] = 'Lehrveranstaltung erfolgreich gelöscht';
$string['sessionenddate'] = 'Die Lehrveranstaltungen enden am';
$string['sessionexist'] = 'Lehrveranstaltung nicht hinzugefügt (existiert bereits)!';
$string['sessionscompleted'] = 'Lehrveranstaltung vervollständigt';
$string['sessionsgenerated'] = 'Lehrveranstaltung erfolgreich angelegt';
$string['sessionstartdate'] = 'Die Lehrveranstaltungen beginnen am';
$string['sessionupdated'] = 'Lehrveranstaltung erfolgreich aktualisiert';
$string['settings'] = 'Einstellungen';
$string['status'] = 'Status';
$string['strftimedm'] = '%%d.%%m';
$string['strftimedmy'] = '%%d.%%m.%%Y';
$string['strftimedmyw'] = '%%d.%%m.%%y&nbsp;(%%a)';
$string['strftimeshortdate'] = '%%d.%%m.%%Y';
$string['studentid'] = 'Teilnehmer ID';
$string['takeattendance'] = 'Anwesenheit erfassen';
$string['update'] = 'Aktualisiere';
$string['variablesupdated'] = 'Variablen erfolgreich aktualisiert';
$string['week'] = 'Woche(n)';
$string['weeks'] = 'Wochen';
?>

11
lang/en_us_utf8/README

@ -0,0 +1,11 @@
US English is only slightly different from standard English.
Only a few words are changed, like :
enrolment -> enrollment
colour -> color
Note that many help files and strings may be missing but this
doesn't matter much. Because the "parent language" of this
pack is "en", missing strings will be taken from there.
So you should also copy en_utf8 language files.

10
lang/en_us_utf8/attforblock.php

@ -0,0 +1,10 @@
<?PHP // $Id: attforblock.php,v 1.1.2.2 2009/02/23 19:22:46 dlnsk Exp $
// block_attendance.php - created with Moodle 1.5.3+ (2005060230)
$string['strftimedm'] = '%%m.%%d';
$string['strftimedmy'] = '%%m.%%d.%%Y';
$string['strftimedmyw'] = '%%m.%%d.%%y&nbsp;(%%a)';
$string['strftimeshortdate'] = '%%m.%%d.%%Y';
?>

119
lang/en_utf8/attforblock.php

@ -0,0 +1,119 @@
<?PHP // $Id: attforblock.php,v 1.1.2.4 2009/04/12 17:50:11 dlnsk Exp $
// attendanceblk.php - created with Moodle 1.5.3+ (2005060230)
$string['Aacronym'] = 'A';
$string['Afull'] = 'Absent';
$string['Eacronym'] = 'E';
$string['Efull'] = 'Excused';
$string['Lacronym'] = 'L';
$string['Lfull'] = 'Late';
$string['Pacronym'] = 'P';
$string['Pfull'] = 'Present';
$string['acronym'] = 'Acronym';
$string['add'] = 'Add';
$string['addmultiplesessions'] = 'Add multiple sessions';
$string['addsession'] = 'Add session';
$string['allcourses'] = 'All courses';
$string['alltaken'] = 'All taken';
$string['attendanceforthecourse'] = 'Attendance for the course';
$string['attendancegrade'] = 'Attendance grade';
$string['attendancenotstarted'] = 'Attendance has not started yet for this course';
$string['attendancepercent'] = 'Attendance percent';
$string['attendancereport'] = 'Attendance report';
$string['attendancesuccess'] = 'Attendance has been successfully taken';
$string['attendanceupdated'] = 'Attendance successfully updated';
$string['attforblock:changepreferences'] = 'Changing Preferences';
$string['attforblock:changeattendances'] = 'Changing Attendances';
$string['attforblock:export'] = 'Export Reports';
$string['attforblock:manageattendances'] = 'Manage Attendances';
$string['attforblock:takeattendances'] = 'Taking Attendances';
$string['attforblock:view'] = 'Viewing Attendances';
$string['attforblock:viewreports'] = 'Viewing Reports';
$string['attrecords'] = 'Attendances records';
$string['changeduration'] = 'Change duration';
$string['changesession'] = 'Change session';
$string['countofselected'] = 'Count of selected';
$string['createmultiplesessions'] = 'Create multiple sessions';
$string['createonesession'] = 'Create one session for the course';
$string['defaults'] = 'Defaults';
$string['delete'] = 'Delete';
$string['deletelogs'] = 'Delete attendance data';
$string['deleteselected'] = 'Delete selected';
$string['deletesession'] = 'Delete session';
$string['deletesessions'] = 'Delete all sessions';
$string['deletingsession'] = 'Deleting session for the course';
$string['deletingstatus'] = 'Deleting status for the course';
$string['description'] = 'Description';
$string['display'] = 'Display';
$string['downloadexcel'] = 'Download in Excel format';
$string['downloadooo'] = 'Download in OpenOffice format';
$string['downloadtext'] = 'Download in text format';
$string['duration'] = 'Duration';
$string['editsession'] = 'Edit Session';
$string['endofperiod'] = 'End of period';
$string['errorinaddingsession'] = 'Error in adding session';
$string['erroringeneratingsessions'] = 'Error in generating sessions ';
$string['hiddensessions'] = 'Hidden sessions';
$string['identifyby'] = 'Identify student by';
$string['includenottaken'] = 'Include not taken sessions';
$string['indetail'] = 'In detail...';
$string['moduledescription'] = 'You can add only one module Attendance per course.<br />Removal of this module will not entail removal of the data!';
$string['modulename'] = 'Attendance';
$string['modulenameplural'] = 'Attendances';
$string['months'] = 'Months';
$string['myvariables'] = 'My Variables';
$string['newdate'] = 'New date';
$string['newduration'] = 'New duration';
$string['noattforuser'] = 'No attendance records exist for the user';
$string['nodescription'] = 'Regular class session';
$string['noguest'] = 'Guest can\'t see attendance';
$string['noofdaysabsent'] = 'No of days absent';
$string['noofdaysexcused'] = 'No of days excused';
$string['noofdayslate'] = 'No of days late';
$string['noofdayspresent'] = 'No of days present';
$string['nosessiondayselected'] = 'No Session day selected';
$string['nosessionexists'] = 'No Session exists for this course';
$string['notfound'] = 'Attendance activity not found in this course!';
$string['olddate'] = 'Old date';
$string['period'] = 'Frequency';
$string['remarks'] = 'Remarks';
$string['report'] = 'Report';
$string['resetdescription'] = 'Remember that deleting attendance data will erase information from database. You can just hide older sessions having changed start date of course!';
$string['resetstatuses'] = 'Reset statuses to default';
$string['restoredefaults'] = 'Restore defaults';
$string['session'] = 'Session';
$string['sessionadded'] = 'Session successfully added';
$string['sessionalreadyexists'] = 'Session already exists for this date';
$string['sessiondate'] = 'Session Date';
$string['sessiondays'] = 'Session Days';
$string['sessiondeleted'] = 'Session successfully deleted';
$string['sessionenddate'] = 'Session end date';
$string['sessionexist'] = 'Session not added (already exists)!';
$string['sessions'] = 'Sessions';
$string['sessionscompleted'] = 'Sessions completed';
$string['sessionsgenerated'] = 'Sessions successfully generated';
$string['sessionstartdate'] = 'Session start date';
$string['sessionupdated'] = 'Session successfully updated';
$string['settings'] = 'Settings';
$string['showdefaults'] = 'Show defaults';
$string['status'] = 'Status';
$string['statusdeleted'] = 'Status deleted';
$string['strftimedm'] = '%%d.%%m';
$string['strftimedmy'] = '%%d.%%m.%%Y';
$string['strftimedmyhm'] = '%%d.%%m.%%Y %%H.%%M'; // line added to allow multiple sessions in the same day
$string['strftimedmyw'] = '%%d.%%m.%%y&nbsp;(%%a)';
$string['strftimehm'] = '%%H:%%M'; //line added to allow display of time
$string['strftimeshortdate'] = '%%d.%%m.%%Y';
$string['studentid'] = 'Student ID';
$string['takeattendance'] = 'Take attendance';
$string['thiscourse'] = 'This course';
$string['update'] = 'Update';
$string['variable'] = 'variable';
$string['variablesupdated'] = 'Variables successfully updated';
$string['versionforprinting'] = 'version for printing';
$string['week'] = 'week(s)';
$string['weeks'] = 'Weeks';
$string['youcantdo'] = 'You can\'t do anything';
?>

12
lang/en_utf8/help/attforblock/createmultiplesessions.html

@ -0,0 +1,12 @@
<p align="center"><b>Attendance</b></p>
<p align="left"><strong>Create Multiple Sessions</strong></p>
<p align="left">This function allows you to create multiple sessions in one simple
step. <p />
<strong>Session Start Date</strong>: Select the start date of your course
(the first day of class)<br>
<strong>Session End Date</strong>: Select the last
day of class (the last day you want to take attendance). <br />
<strong>Session Days</strong>: Select the days of the week when your class will meet (for example, Monday/Wednesday/Friday).<br />
<strong>Frequency</strong>: This allows for a frequency setting. If your class will meet every week, select
1; if it will meet every other week, select 2; every 3rd week, select 3, etc.</p>

4
lang/en_utf8/help/attforblock/createonesession.html

@ -0,0 +1,4 @@
<p align="center"><b>Attendance</b></p>
<p align="left"><strong>Create One Session</strong></p>
<p align="left">To create one session that you want to take attendance for, select
the date, enter a description (optional) and click on &quot;Add Session&quot;.</p>

26
lang/en_utf8/help/attforblock/defaultstatuses.html

@ -0,0 +1,26 @@
<h1 class="main help"><?php print_string("defaults",'block_attendance');?></h1>
<table border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td align="center"><strong>#</strong></td>
<td align="center"><strong><?php print_string('status','block_attendance');?> </strong></td>
<td align="center"><strong><?php print_string('acronym','block_attendance');?></strong></td>
<td><strong><?php print_string('description');?></strong></td>
<td width="100" align="center"><strong><?php print_string('grade');?></strong></td>
</tr>
<?php
$vars = get_records('attendance_settings', 'courseid', 0);
$i=1;
foreach($vars as $settings)
{
?>
<tr>
<td align="center"><?php echo $i++;?>.</td>
<td align="center"><?php echo $settings->status;?></td>
<td align="center"><?php echo $settings->acronym;?></td>
<td align="left"><?php echo $settings->description;?></td>
<td width="100" align="center"><?php echo $settings->grade;?></td>
</tr>
<?php
}
?>
</table>

6
lang/en_utf8/help/attforblock/display.html

@ -0,0 +1,6 @@
<p align="center"><b>Attendance</b></p>
<p align="left"><strong>Display</strong></p>
<p align="left">Use this option to modify the way the attendance record is displayed.
You can chose between &quot;all taken&quot; which will show all sessions, &quot;weeks&quot;
which will show weekly averages, and &quot;months&quot; to display monthly averages
for each student.</p>

3
lang/en_utf8/help/attforblock/export.html

@ -0,0 +1,3 @@
<p align="center"><b>Attendance</b></p>
<p align="left"><strong>Export</strong></p>
<p align="left">Use this option to select the format for the export data.</p>

6
lang/en_utf8/help/attforblock/hiddensessions.html

@ -0,0 +1,6 @@
<p align="center"><b>Attendance</b></p>
<p align="left"><strong>Hidden sessions</strong></p>
<p align="left">Session hides if course's start date older than its date.
Change start date of course and hidden sessions will be shown.</p>
<p align="left">You can use this feature to hide older sessions instead delete.
Remember than only visible sessions using in Gradebook.</p>

4
lang/en_utf8/help/attforblock/myvariables.html

@ -0,0 +1,4 @@
<p align="center"><b>Attendance</b></p>
<p align="left"><strong>My Variables</strong></p>
<p align="left">Change settings here to modify the default attendance categories
and points assigned to each category.</p>

5
lang/en_utf8/help/attforblock/report.html

@ -0,0 +1,5 @@
<p align="center"><b>Attendance</b></p>
<p align="left"><strong>Report</strong></p>
<p align="left">Modify attendance data by adjusting the display settings. Data
may also be downloaded for offline viewing and analysis via the &quot;Report&quot;
pulldown menu found at the bottom of the report screen.</p>

20
lang/en_utf8/help/attforblock/sessions.html

@ -0,0 +1,20 @@
<p align="center"><b>Attendance module</b></p>
<p align="center">
<?php
$temp = $module;
unset($module);
require_once($CFG->dirroot.'/mod/attforblock/version.php');
echo get_string('version').": $module->release ($module->version)";
unset($module);
$module = $temp;
?>
</p>
<p align="left">Attendance sessions are shown here. If no sessions appear, click
on the &quot;Add&quot; tab to create new sessions. </p>
<p align="left">Take attendance by clicking on the green icon under the &quot;actions&quot;
menu (left side). </p>
<p align="left">Edit each session by clicking on the middle &quot;edit session&quot;
icon. After taking attendance you can edit the session by clicking on the description.
</p>
<p align="left">Delete the session entirely by clicking on the delete icon on
the right side.</p>

3
lang/en_utf8/help/attforblock/studentview.html

@ -0,0 +1,3 @@
<p align="center"><b>Attendance</b></p>
<p align="left"><strong>Student View</strong></p>
<p align="left">This screen allows you to view the attendance records for a single student. Use the "version for printing" link to print a copy without the tabs and headers displayed on the webpage.</p>

113
lang/es_utf8/attforblock.php

@ -0,0 +1,113 @@
<?PHP // $Id: attforblock.php,v 1.1.2.3 2009/02/25 10:30:58 dlnsk Exp $
// attendanceblk.php - created with Moodle 1.5.3+ (2005060230)
$string['allcourses'] = 'Todos los cursos';
$string['Aacronym'] = 'A';
$string['acronym'] = 'Acrónimo';
$string['add'] = 'Añadir';
$string['addmultiplesessions'] = 'Añadir varias sesiones';
$string['addsession'] = 'Añadir sesión';
$string['Afull'] = 'Ausente';
$string['alltaken'] = 'Hasta hoy';
$string['attendanceforthecourse'] = 'Asistencia para el Curso/Asignatura';
$string['attendancegrade'] = 'Puntación Asistencia';
$string['attendancenotstarted'] = 'La Asistencia todavía no ha sido iniciada para este curso';
$string['attendancepercent'] = 'Porcentaje';
$string['attendancereport'] = 'Informe de Asistencia';
$string['attendancesuccess'] = 'Asistencia tomada con éxito';
$string['attendanceupdated'] = 'Asistencia actualizada con éxito';
$string['attforblock:changeattendances'] = 'Cambiar asistencias';
$string['attforblock:changepreferences'] = 'Cambiar Preferencias';
$string['attforblock:export'] = 'Exportar Informes';
$string['attforblock:manageattendances'] = 'Gestionar Asistencias';
$string['attforblock:takeattendances'] = 'Tomar Asistencias';
$string['attforblock:view'] = 'Ver Asistencias';
$string['attforblock:viewreports'] = 'Ver Informes';
$string['attrecords'] = 'Asistencias tomadas';
$string['changeduration'] = 'Cambiar duración';
$string['changesession'] = 'Cambiar Sesión';
$string['countofselected'] = 'Recuento de selección';
$string['createmultiplesessions'] = 'Crear varias sesiones';
$string['createonesession'] = 'Crear una sesión para el curso';
$string['defaults'] = 'Por Defecto';
$string['delete'] = 'Eliminar';
$string['deletelogs'] = 'Eliminar datos de asistencia';
$string['deleteselected'] = 'Eliminar selección';
$string['deletesession'] = 'Eliminar Sesión';
$string['deletesessions'] = 'Eliminar todas las sesiones';
$string['deletingsession'] = 'Eliminando Sesión para el Curso/Asignatura';
$string['description'] = 'Descripción';
$string['display'] = 'Mostrar';
$string['downloadexcel'] = 'Descargar en Formato Excell';
$string['downloadooo'] = 'Descargar en Formato OpenOffice';
$string['downloadtext'] = 'Descargar en Formato de Texto';
$string['duration'] = 'Duración';
$string['Eacronym'] = 'J';
$string['editsession'] = 'Editar Sesión';
$string['Efull'] = 'Justificado';
$string['endofperiod'] = 'Fin del periodo';
$string['errorinaddingsession'] = 'Error añadiendo Sesión';
$string['erroringeneratingsessions'] = 'Error generando sesión ';
$string['identifyby'] = 'Identificar estudiantes por';
$string['includenottaken'] = 'Incluir sesiones no registradas';
$string['indetail'] = 'En Detalle...';
$string['Lacronym'] = 'T';
$string['Lfull'] = 'Tarde';
$string['moduledescription'] = 'Sólo se puede agregar una actividad \"Asistencia\" por curso.<br>Si se elimina esta actividad, los datos de la base de datos no se verán afectados, así que reaparecerán en caso de volver a agregar nuevamente la actividad.';
$string['modulename'] = 'Asistencia';
$string['modulenameplural'] = 'Asistencias';
$string['months'] = 'Meses';
$string['myvariables'] = 'Mis Variables';
$string['newdate'] = 'Nueva Fecha';
$string['newduration'] = 'Nueva duración';
$string['noattforuser'] = 'No existen registros de asistencia para el usuario';
$string['nodescription'] = 'Sesión de Clase Normal';
$string['noguest'] = 'Los invitados no pueden ver la asistencia';
$string['noofdaysabsent'] = 'Nº de días de ausencia';
$string['noofdaysexcused'] = 'Nº de días con faltas justificadas';
$string['noofdayslate'] = 'Nº de días de retrasos';
$string['noofdayspresent'] = 'Nº de días de asistencia';
$string['nosessiondayselected'] = 'No se ha seleccionado día de Sesión';
$string['nosessionexists'] = 'No existen Sesiones para este curso';
$string['notfound'] = 'No se ha encontrado ninguna actividad Asistencia en este curso';
$string['olddate'] = 'Fecha Anterior';
$string['Pacronym'] = 'P';
$string['period'] = 'Frecuencia';
$string['Pfull'] = 'Presente';
$string['remarks'] = 'Observaciones';
$string['report'] = 'Informe';
$string['resetdescription'] = 'Recuerde que eliminando los datos de la asistencia provocará el borrado de información en la base de datos. Usted puede ocultar sesiones anteriores cambiando la fecha de inicio del curso en la zona de administración.';
$string['resetstatuses'] = 'Reinicar la configuración por defecto';
$string['restoredefaults'] = 'Restarurar valores por defecto';
$string['session'] = 'Sesión';
$string['sessionadded'] = 'Sesión añadida con éxito';
$string['sessionalreadyexists'] = 'Ya existe una sesión para la fecha indicada';
$string['sessiondate'] = 'Fecha de la Sesión';
$string['sessiondays'] = 'Días de Sesión';
$string['sessiondeleted'] = 'Sesión eliminada con éxito';
$string['sessionenddate'] = 'Fecha de Fin de Sesión';
$string['sessionexist'] = 'Sesión no añadida (ya existe)';
$string['sessions'] = 'Sesiones';
$string['sessionscompleted'] = 'Sesiones completadas';
$string['sessionsgenerated'] = 'Sesiones generadas con éxito';
$string['sessionstartdate'] = 'Fecha de Inicio de la Sesión';
$string['sessionupdated'] = 'Sesión actualizada con éxito';
$string['settings'] = 'Configuración';
$string['showdefaults'] = 'Mostrar opciones por defecto';
$string['status'] = 'Estado';
$string['strftimedm'] = '%%d.%%m';
$string['strftimedmy'] = '%%d.%%m.%%Y';
$string['strftimedmyhm'] = '%%d.%%m.%%Y %%H.%%M';
$string['strftimedmyw'] = '%%d.%%m.%%y&nbsp;(%%a)';
$string['strftimehm'] = '%%H:%%M';
$string['strftimeshortdate'] = '%%d.%%m.%%Y';
$string['studentid'] = 'ID de Estudiante';
$string['takeattendance'] = 'Iniciar Asistencia';
$string['thiscourse'] = 'Este curso';
$string['update'] = 'Actualizar';
$string['variablesupdated'] = 'Variables actualizadas con éxito';
$string['versionforprinting'] = 'versión para Imprimir';
$string['week'] = 'semana(s)';
$string['weeks'] = 'Semanas';
$string['youcantdo'] = 'Usted no puede hacer nada';
?>

4
lang/es_utf8/help/attforblock/changesession.html

@ -0,0 +1,4 @@
<p align="center"><b>Asistencia</b></p>
<p align="left"><strong>Cambiar sesión</strong></p>
<p align="left">Esta función le permite cambiar la fecha, la hora de inicio, la duración y la descripción de una sesión en particular. <br />

10
lang/es_utf8/help/attforblock/createmultiplesessions.html

@ -0,0 +1,10 @@
<p align="center"><b>Asistencia</b></p>
<p align="left"><strong>Crear Múltiples Sesiones</strong></p>
<p align="left">Esta función le permite crear múltiples sesiones en un único paso. <br />
<strong>Fecha de Inicio de Sesión</strong>: seleccione la fecha de inicio de su curso<F2> asignatura
(el primer día de clase).<br><strong>Fecha de Fin de Sesión</strong>: indique aquí el último día de clase
(el último día en que usted quiera tomar asistencia). <br />
<strong>Días de Sesión</strong>: Seleccione los días de la semana en los que tenga clase.<br />
<strong>Frecuencia</strong>: Esto permite configurar las repeticiones. Si su clase se repite semanalmente, seleccione 1,
si su clase se repite cada dos semanas, seleccione 2, si sucede cada 3 semanas, seleccione 3, etc.<br><br>Finalmente, usted puede escribir el nombre que desea otorgarle a cada asistencia por defecto. En cualquier caso, siempre podrá editar individualmente este valor.</p>

4
lang/es_utf8/help/attforblock/createonesession.html

@ -0,0 +1,4 @@
<p align="center"><b>Asistencia</b></p>
<p align="left"><strong>Crear Una Sesión</strong></p>
<p align="left">Para crear una sesión en la que desee tomar la asistencia seleccione
la fecha, introduzca una descripción (opcional) y haga click sobre &quot;Añadir Sesión&quot;.</p>

26
lang/es_utf8/help/attforblock/defaultstatuses.html

@ -0,0 +1,26 @@
<h1 class="main help"><?php print_string("defaults",'block_attendance');?></h1>
<table border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td align="center"><strong>#</strong></td>
<td align="center"><strong><?php print_string('status','block_attendance');?> </strong></td>
<td align="center"><strong><?php print_string('acronym','block_attendance');?></strong></td>
<td><strong><?php print_string('description');?></strong></td>
<td width="100" align="center"><strong><?php print_string('grade');?></strong></td>
</tr>
<?php
$vars = get_records('attendance_settings', 'courseid', 0);
$i=1;
foreach($vars as $settings)
{
?>
<tr>
<td align="center"><?php echo $i++;?>.</td>
<td align="center"><?php echo $settings->status;?></td>
<td align="center"><?php echo $settings->acronym;?></td>
<td align="left"><?php echo $settings->description;?></td>
<td width="100" align="center"><?php echo $settings->grade;?></td>
</tr>
<?php
}
?>
</table>

4
lang/es_utf8/help/attforblock/display.html

@ -0,0 +1,4 @@
<p align="center"><b>Asitencia</b></p>
<p align="left"><strong>Mostrar</strong></p>
<p align="left">Utilice esta opción para modificar la forma en que se visualizan los registros de asistencia.
Puede elegir entre:<br><br><strong>&quot;Hasta hoy&quot;</strong>, que mostrará las asistencias tomadas hasta el día en curso.<br><strong>&quot;Semanas&quot;</strong>, que mostrará las asistencias agrupadas por semanas y<br><strong>&quot;Meses&quot;</strong> para mostrar las asistencias mensuales de cada grupo de estudiantes.

3
lang/es_utf8/help/attforblock/export.html

@ -0,0 +1,3 @@
<p align="center"><b>Asistencia</b></p>
<p align="left"><strong>Exportar</strong></p>
<p align="left">Utilice esta opción para seleccionar el formato en que se exportarán los datos. Puede decidir si incluye o no las sesiones no registradas. También puede exportar hasta una fecha determinada, dejando las demás fuera del archivo de exportación.<br><br>Se exporta en formato xls (MsExcell), ods (OoCalc) o Texto txt.</p>

4
lang/es_utf8/help/attforblock/mods.html

@ -0,0 +1,4 @@
<p align="center"><b>Asistencia</b></p>
<p align="left"><strong>Crear - Editar asistencia</strong></p>
<p align="left">El módulo asistencia permite llevar un seguimiento de los estudiantes en cuanto a su asistencia/retrasos/ausencias a las clases. Los parámetros elegidos pueden ser calificados, asignando valores. Ejemplo: Asiste = 2; Retraso = 1; Justificado = 1; Ausente = 0. Esta actividad debe ir acompañada, obligatoriamente, del bloque Asistencia correspondiente y sólo se permite una actividad por curso. En caso de eliminar la actividad, los datos permanecen registrados en la base de datos, de modo que reaparecerán en caso de volver a agregarla.<br><br>Es importante tener en cuenta que el módulo funciona atendiendo a la fecha de inicio curso. Usted debe mantener la configuración de fecha de inicio del curso debidamente actualizada accediendo a "Configuración" en el Panel de Adminsitración del curso. La actividad Asistencia <strong>no mostrará</strong> las sesiones anteriores a la fecha de inicio del curso.

3
lang/es_utf8/help/attforblock/myvariables.html

@ -0,0 +1,3 @@
<p align="center"><b>Asistencia</b></p>
<p align="left"><strong>Mis Variables</strong></p>
<p align="left">Cambie esta configuración para modificar las categorías de asistencia que vienen definidas por defecto y la puntuación asignada a cada categoría.<br><br>Si usted lo desea, puede agregar nuevas categorías completando el recuadro vacío y utilizando el botón "añadir"-<br><br>Puede utilizar valores negativos. No se admiten campos vacíos, siendo el valor predeterminado el cero (0).<br><br>Puede modificar los valores cuantas veces lo desee, el módulo recalculará los valores que han sido previamente asignados a los alumnos, mostrando su nueva calificación sin ningún problema.</p>

5
lang/es_utf8/help/attforblock/report.html

@ -0,0 +1,5 @@
<p align="center"><b>Asistencia</b></p>
<p align="left"><strong>Informe</strong></p>
<p align="justify">Modifique la forma en que se visualizan los datos de asistencia ajustando los parámetros. Los datos también pueden ser
descargados para una visualización sin conexión y analizarlos mediante el menú desplegable de &quot;Informe&quot;
que puede encontrar en la pestaña "exportar".</p><br><br><strong>Informe individual:</strong> Si lo desea, también puede hacer click sobre el nombre del estudiante para poder ver un informe individualizado de su asistencia. En este sitio dispondrá de una opción para imprimir su informe personal o también podrá visualizar la asistencia del estudiante en todos los cursos en los que se encuentra matriculado (rol).</p>

16
lang/es_utf8/help/attforblock/sessions.html

@ -0,0 +1,16 @@
<p align="center"><b>Asistencia</b></p>
<p align="center">
<?php
$temp = $module;
unset($module);
require_once($CFG->dirroot.'/mod/attforblock/version.php');
echo get_string('version').": $module->release ($module->version)";
unset($module);
$module = $temp;
?>
</p>
<p align="left">Las sesiones de Asistencia se muestran aquí. Si no aparecen sesiones, utilice la pestaña &quot;Añadir&quot; para crear una nuevas sesiones. </p>Es importante tener en cuenta que el módulo funciona atendiendo a la fecha de inicio curso. Usted debe mantener la configuración de fecha de inicio del curso debidamente actualizada accediendo a "Configuración" en el Panel de Adminsitración del curso. La actividad Asistencia <strong>no mostrará</strong> las sesiones anteriores a la fecha de inicio del curso.
<p align="left"><strong>Iniciar registro de asistencia:</strong> Inicie el registro de asistencias por medio del icono de color verde que hay bajo el menú &quot;acciones&quot; (parte izquierda). </p>
<p align="left"><strong>Editar sesión:</strong> Edite cada sesión haciendo uso del icono central &quot;editar sesión&quot;. Una vez haya finalizado la toma de Asistencias, puede editar la sesión haciendo click en la descripción.
</p>
<p align="left"><strong>Eliminar sesión:</strong> elimine por completo la sesión en el icono de la derecha.</p><br><strong>Eliminar/modificar varias sesiones simultáneamente:</strong> para poder eliminar o modificar la duración de varias sesiones simultáneamente debe seleccionarlas en la casilla que se encuentra al final de cada una de ellas, al final de la página encontrará las opciones <strong>"Con las seleccionadas"</strong>, una vez aquí, debe elegir la opción que desee.

3
lang/es_utf8/help/attforblock/studentview.html

@ -0,0 +1,3 @@
<p align="center"><b>Asistencia</b></p>
<p align="left"><strong>Vista de Estudiante</strong></p>
<p align="left">Esta pantalla permite ver los registros de asistencia de un estudiante en concreto. Use el enlace "versión para imprimir" si desea imprimir una copia sin las pestañas ni encabezados mostrados en la página web.</p>La opción "todos los cursos" le permitirá consultar en una página la asistencia registrada en los demás cursos en los que el estudiante está matriculado (rol).

3
lang/es_utf8/help/attforblock/updateattendance.html

@ -0,0 +1,3 @@
<p align="center"><b>Asistencia</b></p>
<p align="left"><strong>Actualizar asistencia</strong></p>
<p align="left">Desde aquí podrá marcar los datos de asistencia de su grupo de estudiantes. Puede hacerlo individualmente o en bloque. Para asignar a todos sus alumnos el mismo valor, puede seleccionar la letra que figura en el encabezado de cada columna (P, J, T...) y luego modificar individualmente algún dato concreto. Al final del listado encontrará el botón "ok" (puede acceder rápidamente pulsando la tecla Fin de su teclado) que grabará los resultados. Puede modificar los valores en cualquier momento accediendo nuevamente la asistencia de este día/hora. Junto a cada registro encontrará una caja de texto que le permitirá anotar observaciones personalizadas para cada estudiante.</p><br><br><strong>Informe individual:</strong> Si lo desea, también puede hacer click sobre el nombre del estudiante para poder ver un informe individualizado de su asistencia. En este sitio dispondrá de una opción para imprimir su informe personal o también podrá visualizar la asistencia del estudiante en todos los cursos en los que se encuentra matriculado (rol).</p>

87
lang/eu_utf8/attforblock.php

@ -0,0 +1,87 @@
<?PHP // $Id: attforblock.php,v 1.1.2.2 2009/02/23 19:22:44 dlnsk Exp $
// attforblock.php - created with Moodle 1.7.1+ (2006101010)
$string['modulename'] = 'Asistentzia';
$string['modulenameplural'] = 'Asistentziak';
$string['modulenamesimple'] = 'Asistentzia';
$string['Aacronym'] = 'F';
$string['Afull'] = 'Falta';
$string['Eacronym'] = 'A';
$string['Efull'] = 'Aitzakia';
$string['Lacronym'] = 'B';
$string['Lfull'] = 'Berandu';
$string['Pacronym'] = 'E';
$string['Pfull'] = 'Etorria';
$string['acronym'] = 'Laburdura';
$string['add'] = 'Gehitu';
$string['addmultiplesessions'] = 'Hainbat saio gehitu';
$string['addsession'] = 'Saioa gehitu';
$string['alltaken'] = 'Erregistro guztiak';
$string['attendanceforthecourse'] = 'Ikastaroko asistentzia';
$string['attendancegrade'] = 'Asistentzia-nota';
$string['attendancenotstarted'] = 'Asistentzia ez da abian jarri ikastaro honetan';
$string['attendancepercent'] = 'Asistentziaren ehunekoa';
$string['attendancereport'] = 'Asistentziaren txostena';
$string['attendancesuccess'] = 'Egoki erregistratu da asistentzia';
$string['attendanceupdated'] = 'Asistentzia egoki igo da';
$string['changesession'] = 'Saioa aldatu';
$string['createmultiplesessions'] = 'Hainbat saio sortu';
$string['createonesession'] = 'Ikastarorako saio bat sortu';
$string['defaults'] = 'Berezkoak';
$string['delete'] = 'Ezabatu';
$string['deletesession'] = 'Saioa ezabatu';
$string['deletingsession'] = 'Ezabatu ikastarorako saioa';
$string['description'] = 'Deskribapena';
$string['display'] = 'Erakutsi';
$string['downloadexcel'] = 'Excel-formatuan jaitsi';
$string['downloadtext'] = 'Testu-formatuan jaitsi';
$string['editsession'] = 'Saioa editatu';
$string['errorinaddingsession'] = 'Errorea saioa gehitzean';
$string['erroringeneratingsessions'] = 'Erorrea saioak sortzean';
$string['indetail'] = 'Zehatzago';
$string['months'] = 'Hilabeteak';
$string['myvariables'] = 'Nire aldagaiak';
$string['newdate'] = 'Data berria';
$string['noattforuser'] = 'Erabiltzaile honek ez du asistentziarik';
$string['nodescription'] = 'Saio honek ez du deskribapenik';
$string['noguest'] = 'Bisitariak ezin du asistentziarik ikusi';
$string['noofdaysabsent'] = 'Beti etorri da';
$string['noofdaysexcused'] = 'Ez du inoiz aitzakirik izan';
$string['noofdayslate'] = 'Ez da inoiz berandu etorri';
$string['noofdayspresent'] = 'Ez da inoiz etorri';
$string['nosessiondayselected'] = 'Ez da saio-egunik aukeratu';
$string['nosessionexists'] = 'Ez dago saiorik ikastaro honetarako';
$string['olddate'] = 'Data zaharra';
$string['period'] = 'Epea';
$string['remarks'] = 'Oharrak';
$string['report'] = 'Txostena';
$string['restoredefaults'] = 'Berezko ezarpenak berreskuratu';
$string['session'] = 'Saioa';
$string['sessionadded'] = 'Saioa egoki gehitu da';
$string['sessionalreadyexists'] = 'Data horretarako dagoeneko bada saioa';
$string['sessiondate'] = 'Saioaren data';
$string['sessiondays'] = 'Saioaren egunak';
$string['sessiondeleted'] = 'Saioa egoki ezabatu da';
$string['sessionenddate'] = 'Saioaren amaiera-data';
$string['sessionexist'] = 'Saioa ez da gehitu (dagoeneko bazen)!';
$string['sessionscompleted'] = 'Saioak bukatuta';
$string['sessionsgenerated'] = 'Saioak egoki sortu dira';
$string['sessionstartdate'] = 'Saioaren hasiera-data';
$string['sessionupdated'] = 'Saioa egoki igo da';
$string['settings'] = 'Ezarpenak';
$string['showdefaults'] = 'Erakutsi berezko ezarpenak';
$string['status'] = 'Estatusa';
$string['strftimedm'] = '%%mk.%%d';
$string['strftimedmy'] = '%%Y(e)ko.%%mk.%%d';
$string['strftimedmyw'] = '%%Y(e)ko.%%mk.%%d (%%a)';
$string['strftimeshortdate'] = '%%Y(e)ko.%%mk.%%d';
$string['studentid'] = 'Ikaslearen IDa';
$string['takeattendance'] = 'Asistentzia erregistratu';
$string['update'] = 'Igo';
$string['variablesupdated'] = 'Ezarpenak egoki igo dira';
$string['versionforprinting'] = 'Inprimatzeko bertsioa';
$string['week'] = 'aste';
$string['weeks'] = 'Asteak';
?>

26
lang/eu_utf8/help/attforblock/defaultstatuses.html

@ -0,0 +1,26 @@
<h1 class="main help"><?php print_string("defaults",'block_attendance');?></h1>
<table border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td align="center"><strong>#</strong></td>
<td align="center"><strong><?php print_string('status','block_attendance');?> </strong></td>
<td align="center"><strong><?php print_string('acronym','block_attendance');?></strong></td>
<td><strong><?php print_string('description');?></strong></td>
<td width="100" align="center"><strong><?php print_string('grade');?></strong></td>
</tr>
<?php
$vars = get_records('attendance_settings', 'courseid', 0);
$i=1;
foreach($vars as $settings)
{
?>
<tr>
<td align="center"><?php echo $i++;?>.</td>
<td align="center"><?php echo $settings->status;?></td>
<td align="center"><?php echo $settings->acronym;?></td>
<td align="left"><?php echo $settings->description;?></td>
<td width="100" align="center"><?php echo $settings->grade;?></td>
</tr>
<?php
}
?>
</table>

12
lang/eu_utf8/help/attforblock/sessions.html

@ -0,0 +1,12 @@
<p align="center"><b>Asistentziarako blokea</b></p>
<p align="center">
<?php
$temp = $module;
unset($module);
require_once($CFG->dirroot.'/mod/attforblock/version.php');
echo get_string('version').": $module->release ($module->version)";
unset($module);
$module = $temp;
?>
</p>

94
lang/fr_utf8/attforblock.php

@ -0,0 +1,94 @@
<?PHP // $Id: attforblock.php,v 1.1.2.2 2009/02/23 19:22:45 dlnsk Exp $
// attendanceblk.php - created with Moodle 1.5.3+ (2005060230)
$string['attforblock:changepreferences'] = 'Modifier les préférences';
$string['attforblock:export'] = 'Exporter Rapports';
$string['attforblock:manageattendances'] = 'Gérer les présences';
$string['attforblock:takeattendances'] = 'Prendre les présences';
$string['attforblock:view'] = 'Voir les présences';
$string['attforblock:viewreports'] = 'Voir Rapports';
$string['modulename'] = 'Présence';
$string['modulenameplural'] = 'Présences';
$string['notfound'] = 'Aucune activité Présence dans ce cours !';
$string['Aacronym'] = 'A';
$string['Afull'] = 'Absent';
$string['Eacronym'] = 'E';
$string['Efull'] = 'Excusé';
$string['Lacronym'] = 'R';
$string['Lfull'] = 'Retard';
$string['Pacronym'] = 'P';
$string['Pfull'] = 'Présent';
$string['acronym'] = 'Acronyme';
$string['add'] = 'Ajouter';
$string['addmultiplesessions'] = 'Ajouter plusieurs sessions';
$string['addsession'] = 'Ajouter session';
$string['alltaken'] = 'Sessions passées';
$string['attendanceforthecourse'] = 'Présence pour le cours';
$string['attendancegrade'] = 'Note de présence';
$string['attendancenotstarted'] = 'La prise de présence n\'a pas encore commencé pour ce cours';
$string['attendancepercent'] = 'Pourcentage de présence';
$string['attendancereport'] = 'Rapport de présence';
$string['attendancesuccess'] = 'Les présences ont bien été enregistrées';
$string['attendanceupdated'] = 'Présence mise à jour avec succès';
$string['changesession'] = 'Modifier la session';
$string['createmultiplesessions'] = 'Créer plusieurs sessions';
$string['createonesession'] = 'Créer une session pour le cours';
$string['defaults'] = 'Valeurs par défaut';
$string['delete'] = 'Supprimer';
$string['deletesession'] = 'Supprimer session';
$string['deletingsession'] = 'Supprimer la session pour le cours';
$string['description'] = 'Description';
$string['display'] = 'Affichage';
$string['downloadexcel'] = 'Télécharger au format Excel';
$string['downloadooo'] = 'Télécharger au format OpenOffice';
$string['downloadtext'] = 'Télécharger au format text';
$string['editsession'] = 'Editer session';
$string['errorinaddingsession'] = 'Erreur d\'ajout de session';
$string['erroringeneratingsessions'] = 'Erreur de génération de sessions ';
$string['indetail'] = 'En détails...';
$string['months'] = 'Mois';
$string['myvariables'] = 'Mes Variables';
$string['newdate'] = 'Nouvelle date';
$string['noattforuser'] = 'Aucun enregistrement de présence pour l\'utilisateur';
$string['nodescription'] = 'Session régulière de cours';
$string['noguest'] = 'Les invités ne peuvent voir les présences';
$string['noofdaysabsent'] = 'No of days absent';
$string['noofdaysexcused'] = 'No of days excused';
$string['noofdayslate'] = 'No of days late';
$string['noofdayspresent'] = 'No of days present';
$string['nosessiondayselected'] = 'Pas de jour de Session sélectionné';
$string['nosessionexists'] = 'Aucune session n\'existe pour ce cours';
$string['olddate'] = 'Ancienne date';
$string['period'] = 'Fréquence';
$string['versionforprinting'] = 'version pour impression';
$string['remarks'] = 'Remarques';
$string['report'] = 'Rapport';
$string['restoredefaults'] = 'Restaurer les valeurs par défaut';
$string['session'] = 'Session';
$string['sessionadded'] = 'Session ajoutée avec succès';
$string['sessionalreadyexists'] = 'La session existe déjà pour cette date';
$string['sessiondate'] = 'Date de Session';
$string['sessiondays'] = 'Jours de Session';
$string['sessiondeleted'] = 'Session supprimée avec succès';
$string['sessionenddate'] = 'Date de fin de Session';
$string['sessionexist'] = 'Session non ajoutée (existe déjà)!';
$string['sessionscompleted'] = 'Sessions réalisées';
$string['sessionsgenerated'] = 'Sessions générées avec succès';
$string['sessionstartdate'] = 'Date de début de Session';
$string['sessionupdated'] = 'Session enregistrée avec succès';
$string['settings'] = 'Paramètres';
$string['showdefaults'] = 'les valeurs par défaut';
$string['status'] = 'Statut';
$string['strftimedm'] = '%%d.%%m';
$string['strftimedmy'] = '%%d.%%m.%%Y';
$string['strftimedmyw'] = '%%d.%%m.%%y&nbsp;(%%a)';
$string['strftimeshortdate'] = '%%d.%%m.%%Y';
$string['studentid'] = 'ID Etudiant';
$string['takeattendance'] = 'Prendre les présences';
$string['update'] = 'Enregistrer';
$string['variablesupdated'] = 'Variables mises à jour';
$string['week'] = 'semaine(s)';
$string['weeks'] = 'Semaines';
?>

84
lang/it/attforblock.php

@ -0,0 +1,84 @@
<?PHP // $Id: attforblock.php,v 1.1.2.2 2009/02/23 19:22:45 dlnsk Exp $
// attendanceblk.php - created with Moodle 1.5.3+ (2005060230)
$string['modulename'] = 'Presenze';
$string['modulenameplural'] = 'Presenze';
$string['modulenamesimple'] = 'Presenze';
$string['Aacronym'] = 'A';
$string['Afull'] = 'Assente';
$string['Eacronym'] = 'G';
$string['Efull'] = 'Giustificato';
$string['Lacronym'] = 'R';
$string['Lfull'] = 'Ritardo';
$string['Pacronym'] = 'P';
$string['Pfull'] = 'Presente';
$string['acronym'] = 'Acronimo';
$string['add'] = 'Aggiungi';
$string['addmultiplesessions'] = 'Aggiungi Sesioni Multiple';
$string['addsession'] = 'Aggiungi una Sessione';
$string['alltaken'] = 'Tutte registrate';
$string['attendanceforthecourse'] = 'Presenze al Corso';
$string['attendancegrade'] = 'Voto di Presenza';
$string['attendancenotstarted'] = 'La registrazione delle Presenze per questo corso non &egrave; ancora iniziata';
$string['attendancepercent'] = 'Percentuale di Presenze';
$string['attendancereport'] = 'Sommario delle presenze';
$string['attendancesuccess'] = 'Le presenze sono state registrate';
$string['attendanceupdated'] = 'Le presenze sono state aggiornate';
$string['changesession'] = 'Cambia sessione';
$string['createmultiplesessions'] = 'Crea sessioni multiple';
$string['createonesession'] = 'Crea una sessione per il corso';
$string['defaults'] = 'Defaults';
$string['delete'] = 'Cancella';
$string['deletesession'] = 'Cancella la Sesssione';
$string['deletingsession'] = 'Cancellazione della sessione dal corso';
$string['description'] = 'Descrizione';
$string['display'] = 'Mostra';
$string['downloadexcel'] = 'Download in formato Excel';
$string['downloadtext'] = 'Download in formato testo';
$string['editsession'] = 'Modifica la Sessione';
$string['errorinaddingsession'] = 'Errore nell\'aggiunta della sessione';
$string['erroringeneratingsessions'] = 'Errore nella creazione delle sessioni ';
$string['indetail'] = 'In dettaglio...';
$string['months'] = 'Mesi';
$string['myvariables'] = 'Le mie variabili';
$string['newdate'] = 'Nuova data';
$string['nodescription'] = 'Nessuna descrizione per questa sessione';
$string['noguest'] = 'Gli Ospiti non possono accedere alle presenze';
$string['noofdaysabsent'] = 'Giorni di assenza';
$string['noofdaysexcused'] = 'Giorni giustificati';
$string['noofdayslate'] = 'Ritardi';
$string['noofdayspresent'] = 'Giorni di presenza';
$string['nosessiondayselected'] = 'Non &egrave; stato selezionato il giorno della sessione';
$string['nosessionexists'] = 'Non esistono Sessioni per questo corso';
$string['olddate'] = 'Data precedente';
$string['period'] = 'Periodo';
$string['remarks'] = 'Note';
$string['report'] = 'Sommario';
$string['restoredefaults'] = 'Restore defaults';
$string['session'] = 'Sessione';
$string['sessionadded'] = 'Sessione aggiunta con successo';
$string['sessionalreadyexists'] = 'Esiste gi&agrave; una sessione in questa data';
$string['sessiondate'] = 'Data della Sessione';
$string['sessiondays'] = 'Giorni delle Sessioni';
$string['sessiondeleted'] = 'Sessione cancellata con successo';
$string['sessionenddate'] = 'Data di fine Sessione';
$string['sessionexist'] = 'Sessione non aggiunta (esiste gi&agrave;)!';
$string['sessionscompleted'] = 'Sessioni Completate';
$string['sessionsgenerated'] = 'Sessioni create con successo';
$string['sessionstartdate'] = 'Data di inizio delle Sessioni';
$string['sessionupdated'] = 'Sessione aggiornata con successo';
$string['settings'] = 'Impostazioni';
$string['status'] = 'Stato';
$string['strftimedm'] = '%%d.%%m';
$string['strftimedmy'] = '%%d.%%m.%%Y';
$string['strftimedmyw'] = '%%d.%%m.%%y&nbsp;(%%a)';
$string['strftimeshortdate'] = '%%d.%%m.%%Y';
$string['studentid'] = 'ID Studente';
$string['takeattendance'] = 'Registra le Presenze';
$string['update'] = 'Aggiorna';
$string['variablesupdated'] = 'Variabli aggiornate con successo';
$string['week'] = 'settimana/e';
$string['weeks'] = 'Settimane';
?>

12
lang/it/help/attforblock/sessions.html

@ -0,0 +1,12 @@
<p align="center"><b>Blocco Presenze</b></p>
<p align="center">
<?php
$temp = $module;
unset($module);
require_once($CFG->dirroot.'/mod/attforblock/version.php');
echo get_string('version').": $module->release ($module->version)";
unset($module);
$module = $temp;
?>
</p>

116
lang/ja_utf8/attforblock.php

@ -0,0 +1,116 @@
<?PHP // $Id: attforblock.php,v 1.1.2.3 2009/04/07 17:23:36 dlnsk Exp $
// attforblock.php - created with Moodle 2.0 dev (Build: 20090403) (2009040100)
$string['Aacronym'] = '欠';
$string['Afull'] = '欠席';
$string['Eacronym'] = '早';
$string['Efull'] = '早退';
$string['Lacronym'] = '遅';
$string['Lfull'] = '遅刻';
$string['Pacronym'] = '出';
$string['Pfull'] = '出席';
$string['acronym'] = '頭文字';
$string['add'] = '追加';
$string['addmultiplesessions'] = '倍数セッションを追加する';
$string['addsession'] = 'セッションを追加する';
$string['allcourses'] = 'すべてのコース';
$string['alltaken'] = 'すべて';
$string['attendanceforthecourse'] = 'コースの出欠';
$string['attendancegrade'] = '出席点';
$string['attendancenotstarted'] = 'このコースの出欠は、まだ開始されていません。';
$string['attendancepercent'] = '出欠パーセント';
$string['attendancereport'] = '出欠レポート';
$string['attendancesuccess'] = '出欠が正常に取られました。';
$string['attendanceupdated'] = '出欠が正常に更新されました。';
$string['attforblock:changeattendances'] = '出欠の変更';
$string['attforblock:changepreferences'] = '属性の変更';
$string['attforblock:export'] = 'レポートをエクスポートする';
$string['attforblock:manageattendances'] = '出欠の管理';
$string['attforblock:takeattendances'] = '出欠を取る';
$string['attforblock:view'] = '出欠の表示';
$string['attforblock:viewreports'] = 'レポートの表示';
$string['attrecords'] = '出欠レコード';
$string['changeduration'] = '持続時間を変更する';
$string['changesession'] = 'セッションを変更する';
$string['countofselected'] = '選択数';
$string['createmultiplesessions'] = '倍数セッションを作成する';
$string['createonesession'] = '1つのセッションをコースに作成する';
$string['defaults'] = 'デフォルト';
$string['delete'] = '削除';
$string['deletelogs'] = '出欠データを削除する';
$string['deleteselected'] = '選択したデータを削除する';
$string['deletesession'] = 'セッションを削除する';
$string['deletesessions'] = 'すべてのセッションを削除する';
$string['deletingsession'] = 'コースセッションを削除';
$string['description'] = '説明';
$string['display'] = '表示';
$string['downloadexcel'] = 'Excelフォーマットでダウンロードする';
$string['downloadooo'] = 'OpenOfficeフォーマットでダウンロードする';
$string['downloadtext'] = 'テキストフォーマットでダウンロードする';
$string['duration'] = '持続時間';
$string['editsession'] = 'セッションを編集する';
$string['endofperiod'] = '最終日';
$string['errorinaddingsession'] = 'セッションの追加中にエラーが発生しました。';
$string['erroringeneratingsessions'] = 'セッションの生成中にエラーが発生しました。';
$string['hiddensessions'] = '非表示セッション';
$string['identifyby'] = '学生の選択方法';
$string['includenottaken'] = '出欠が取られていないセッションを含む';
$string['indetail'] = '詳細 ...';
$string['moduledescription'] = 'あなたは、1コースあたり1つの出欠モジュールのみ追加することができます。<br />このモジュールを削除したとしても、データが削除されるわけではありません!';
$string['modulename'] = '出欠';
$string['modulenameplural'] = '出欠';
$string['months'] = '月';
$string['myvariables'] = 'マイ変数';
$string['newdate'] = '新しい出欠日';
$string['newduration'] = '新しい持続時間';
$string['noattforuser'] = 'このユーザの出欠レコードはありません。';
$string['nodescription'] = '標準クラスセッション';
$string['noguest'] = 'ゲストは出欠を閲覧できません。';
$string['noofdaysabsent'] = '欠席数';
$string['noofdaysexcused'] = '早退数';
$string['noofdayslate'] = '遅刻数';
$string['noofdayspresent'] = '出席数';
$string['nosessiondayselected'] = 'セッション日が選択されませんでした。';
$string['nosessionexists'] = 'このコースには、セッションがありません。';
$string['notfound'] = 'このコースには、出欠活動はありません!';
$string['olddate'] = '古い出欠日';
$string['period'] = '頻度';
$string['remarks'] = '備考';
$string['report'] = 'レポート';
$string['resetdescription'] = '出欠を削除することで、データベースから情報が削除されることに留意してください。あなたは、コースの開始日を変更することで、古いセッションを隠すことができます!';
$string['resetstatuses'] = 'ステータスをデフォルトにリセットする';
$string['restoredefaults'] = 'デフォルトをリストアする';
$string['session'] = 'セッション';
$string['sessionadded'] = 'セッションが正常に追加されました。';
$string['sessionalreadyexists'] = 'この日には、すでにセッションが追加されています。';
$string['sessiondate'] = 'セッション日';
$string['sessiondays'] = 'セッション曜日';
$string['sessiondeleted'] = 'セッションが正常に削除されました。';
$string['sessionenddate'] = 'セッション終了日';
$string['sessionexist'] = 'セッションは追加されませんでした (すでに追加されています)!';
$string['sessions'] = 'セッション';
$string['sessionscompleted'] = 'セッション完了';
$string['sessionsgenerated'] = 'セッションが正常に生成されました。';
$string['sessionstartdate'] = 'セッション開始日';
$string['sessionupdated'] = 'セッションが正常に更新されました。';
$string['settings'] = '設定';
$string['showdefaults'] = 'デフォルトを表示する';
$string['status'] = 'ステータス';
$string['strftimedm'] = '%%m/%%d';
$string['strftimedmy'] = '%%Y/%%m/%%d';
$string['strftimedmyhm'] = '%%Y/%%m/%%d %%H.%%M';
$string['strftimedmyw'] = '%%Y/%%m/%%d&nbsp;(%%a)';
$string['strftimehm'] = '%%H:%%M';
$string['strftimeshortdate'] = '%%Y/%%m/%%d';
$string['studentid'] = '学籍番号';
$string['takeattendance'] = '出欠を取る';
$string['thiscourse'] = 'このコース';
$string['update'] = '更新';
$string['variablesupdated'] = '変数が正常に更新されました。';
$string['versionforprinting'] = '印刷画面';
$string['week'] = '週';
$string['weeks'] = '週';
$string['youcantdo'] = 'あなたは、何もできません。';
?>

6
lang/ja_utf8/help/attforblock/createmultiplesessions.html

@ -0,0 +1,6 @@
<h1>倍数セッションを作成する</h1>
<p>あなたは、この機能を使って、1つのシンプルなステップで倍数セッションを作成することができます。<p />
<p><strong>セッション開始日</strong>: あなたのコース開始日 (授業の初日) を選択してください。<br />
<strong>セッション終了日</strong>: 授業の最終日 (あなたが出欠を取りたい最終日) を選択してください。<br />
<strong>セッション曜日</strong>: あなたの授業が開講される週の曜日を選択してください (例 月曜日/水曜日/金曜日)。<br />
<strong>頻度</strong>: ここでは、頻度を設定することができます。あなたの授業が毎週開講される場合、1を設定してください。隔週に開講される場合は、2を設定してください。また、第3週に開講される場合は、3を選択してください。</p>

2
lang/ja_utf8/help/attforblock/createonesession.html

@ -0,0 +1,2 @@
<h1>1つのセッションを作成する</h1>
<p>あなたが出欠を取りたい、1つのセッションを作成するには、日付を選択して説明 (任意) を入力した後、「セッションを追加する」をクリックしてください。</p>

26
lang/ja_utf8/help/attforblock/defaultstatuses.html

@ -0,0 +1,26 @@
<h1><?php print_string("defaults",'attforblock');?></h1>
<table border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td align="center"><strong>#</strong></td>
<td align="center"><strong><?php print_string('status','attforblock');?> </strong></td>
<td align="center"><strong><?php print_string('acronym','attforblock');?></strong></td>
<td><strong><?php print_string('description');?></strong></td>
<td width="100" align="center"><strong><?php print_string('grade');?></strong></td>
</tr>
<?php
$vars = get_records('attendance_settings', 'courseid', 0);
$i=1;
foreach($vars as $settings)
{
?>
<tr>
<td align="center"><?php echo $i++;?>.</td>
<td align="center"><?php echo $settings->status;?></td>
<td align="center"><?php echo $settings->acronym;?></td>
<td align="left"><?php echo $settings->description;?></td>
<td width="100" align="center"><?php echo $settings->grade;?></td>
</tr>
<?php
}
?>
</table>

2
lang/ja_utf8/help/attforblock/display.html

@ -0,0 +1,2 @@
<h1>表示</h1>
<p>このオプションは、出欠レコードの表示方法の変更に使用してください。あなたは、それぞれの学生に関して、すべてを表示する「すべて」、週ごとの平均を表示する「週」、月ごとの平均を表示する「月」を選択することができます。</p>

2
lang/ja_utf8/help/attforblock/export.html

@ -0,0 +1,2 @@
<h1>エクスポート</h1>
<p>このオプションは、エクスポートデータのフォーマット選択に使用してください。</p>

3
lang/ja_utf8/help/attforblock/hiddensessions.html

@ -0,0 +1,3 @@
<h1>非表示セッション</h1>
<p>コース開始日が実際の日時より古い場合、セッションが隠されます。コース開始日を変更することで、非表示セッションが表示されます。</p>
<p>あなたは、古いセッションを削除する代わりに、この機能を使用することができます。評定表には、表示セッションのみ使用されますので留意してください。</p>

2
lang/ja_utf8/help/attforblock/myvariables.html

@ -0,0 +1,2 @@
<h1>マイ変数</h1>
<p>デフォルトの出欠カテゴリおよび各カテゴリに割り当てられている評点を修正するには、ここで設定を変更してください。</p>

2
lang/ja_utf8/help/attforblock/report.html

@ -0,0 +1,2 @@
<h1>レポート</h1>
<p>表示設定を調整することで、出欠データを修正してください。オフライン閲覧および分析のため、レポート画面下部にある「レポート」プルダウンメニューより、データをダウンロードすることもできます。</p>

14
lang/ja_utf8/help/attforblock/sessions.html

@ -0,0 +1,14 @@
<p>
<?php
$temp = $module;
unset($module);
require_once($CFG->dirroot.'/mod/attforblock/version.php');
echo get_string('version').": $module->release ($module->version)";
unset($module);
$module = $temp;
?>
</p>
<p>ここに出欠セッションが表示されます。セッションが表示されない場合、新しいセッションを追加するため、「追加」タブをクリックしてください。</p>
<p>「操作」メニューの下 (左側) にあるグリーンのアイコンをクリックすることで、出欠を取ることができます。 </p>
<p>中央にある「セッションを編集する」アイコンをクリックすることで、それぞれのセッションを編集してください。出欠を取った後、説明をクリックすることで、あなたはセッションを編集することができます。</p>
<p align="left">右側にあるアイコンをクリックすることで、セッションを削除することができます。</p>

2
lang/ja_utf8/help/attforblock/studentview.html

@ -0,0 +1,2 @@
<h1>学生ビュー</h1>
<p>この画面では、学生の出欠レコードを個別に閲覧することができます。「印刷画面」リンクを使用することで、タブおよびヘッダを含まないページをウェブページに表示することができます。</p>

113
lang/ru_utf8/attforblock.php

@ -0,0 +1,113 @@
<?PHP // $Id: attforblock.php,v 1.1.2.4 2009/04/12 17:50:11 dlnsk Exp $
// attforblock.php - created with Moodle 1.8.2+ (2007021520)
$string['Aacronym'] = 'Н';
$string['Afull'] = 'Не был';
$string['Eacronym'] = 'У';
$string['Efull'] = 'Уважительная причина';
$string['Lacronym'] = 'О';
$string['Lfull'] = 'Опоздал';
$string['Pacronym'] = 'П';
$string['Pfull'] = 'Присутствовал';
$string['acronym'] = 'Сокращ.';
$string['add'] = 'Добавить';
$string['addmultiplesessions'] = 'Добавить несколько занятий';
$string['addsession'] = 'Добавить занятие';
$string['alltaken'] = 'Все прошедшие';
$string['attendanceforthecourse'] = 'Посещаемость для курса';
$string['attendancegrade'] = 'Оценка за посещаемость';
$string['attendancenotstarted'] = 'Пока нет отметок о посещаемости в данном курсе.';
$string['attendancepercent'] = 'Процент посещаемости';
$string['attendancereport'] = 'Отчет о посещаемости';
$string['attendancesuccess'] = 'Информация о присутствии успешно запомнена';
$string['attendanceupdated'] = 'Информация о присутствии успешно обновлена';
$string['attforblock:changepreferences'] = 'Изменение настроек';
$string['attforblock:changeattendances'] = 'Редактирование посещаемости';
$string['attforblock:export'] = 'Экспорт отчетов';
$string['attforblock:manageattendances'] = 'Управление посещаемостью';
$string['attforblock:takeattendances'] = 'Отметка посещаемости';
$string['attforblock:view'] = 'Просмотр посещаемости';
$string['attforblock:viewreports'] = 'Просмотр отчетов';
$string['attrecords'] = 'Отметок о посещаемости';
$string['changeduration'] = 'Изменить продолжительность';
$string['changesession'] = 'Изменить занятие';
$string['countofselected'] = 'Выбрано занятий';
$string['createmultiplesessions'] = 'Создать несколько занятий';
$string['createonesession'] = 'Создать одно занятие для курса';
$string['defaults'] = 'По умолчанию';
$string['delete'] = 'Удалить';
$string['deleteselected'] = 'Удалить выбранные';
$string['deletesession'] = 'Удалить занятие';
$string['deletingsession'] = 'Удаление занятия из курса';
$string['deletingstatus'] = 'Удаление статуса из курса';
$string['description'] = 'Описание';
$string['display'] = 'Отображать';
$string['downloadexcel'] = 'Скачать в формате Excel';
$string['downloadooo'] = 'Скачать в формате OpenOffice';
$string['downloadtext'] = 'Скачать в текстовом формате';
$string['duration'] = 'Продолжительность';
$string['editsession'] = 'Редактировать занятие';
$string['endofperiod'] = 'Конец периода';
$string['errorinaddingsession'] = 'Ошибка при добавлении занятия';
$string['erroringeneratingsessions'] = 'Ошибка при создании занятий';
$string['hiddensessions'] = 'Скрытых занятий';
$string['identifyby'] = 'Идентифицировать студентов по';
$string['includenottaken'] = 'Включить не прошедшие занятия';
$string['indetail'] = 'Подробнее...';
$string['moduledescription'] = 'Вы можете добавить только один данный модуль в каждый курс.<br />Удаление этого модуля не повлечет удаление данных о посещаемости!';
$string['modulename'] = 'Посещаемость';
$string['modulenameplural'] = 'Посещаемость';
$string['months'] = 'По месяцам';
$string['myvariables'] = 'Мои переменные';
$string['newdate'] = 'Новая дата';
$string['newduration'] = 'New duration';
$string['noattforuser'] = 'Нет отметок посещаемости для этого пользователя';
$string['nodescription'] = 'Для этого занятия нет описания';
$string['noguest'] = 'Гость не может видеть информацию о посещаемости';
$string['noofdaysabsent'] = 'Пропущено';
$string['noofdaysexcused'] = 'Пропущено по ув. причине';
$string['noofdayslate'] = 'Опозданий';
$string['noofdayspresent'] = 'Вы присутствовали';
$string['nosessiondayselected'] = 'Не выбран день занятия';
$string['nosessionexists'] = 'В данном курсе отсутствуют занятия. Сначала добавьте их';
$string['notfound'] = 'Элемент курса - \"Посещаемость\" не найден в данном курсе!';
$string['olddate'] = 'Старая дата';
$string['period'] = 'Периодичность';
$string['remarks'] = 'Заметка';
$string['report'] = 'Отчет';
$string['restoredefaults'] = 'Востановить значения по-умолчанию';
$string['session'] = 'Занятие';
$string['sessionadded'] = 'Занятие успешно добавлено';
$string['sessionalreadyexists'] = 'В этот день занятие уже существует';
$string['sessiondate'] = 'Дата занятия';
$string['sessiondays'] = 'Дни занятий';
$string['sessiondeleted'] = 'Занятие успешно удалено';
$string['sessionenddate'] = 'Дата завершения занятий';
$string['sessionexist'] = 'Занятие не добавлено (уже существует)!';
$string['sessions'] = 'Занятия';
$string['sessionscompleted'] = 'Прошло занятий';
$string['sessionsgenerated'] = 'Занятия успешно созданы';
$string['sessionstartdate'] = 'Дата начала занятий';
$string['sessionupdated'] = 'Занятие успешно изменено';
$string['settings'] = 'Настройки';
$string['showdefaults'] = 'Показать значения по-умолчанию';
$string['status'] = 'Статус';
$string['statusdeleted'] = 'Статус удален';
$string['strftimedm'] = '%%d.%%m';
$string['strftimedmy'] = '%%d.%%m.%%Y';
$string['strftimedmyhm'] = '%%d.%%m.%%Y %%H.%%M';
$string['strftimedmyw'] = '%%d.%%m.%%y&nbsp;(%%a)';
$string['strftimehm'] = '%%H:%%M';
$string['strftimeshortdate'] = '%%d.%%m.%%Y';
$string['studentid'] = 'ID студента';
$string['takeattendance'] = 'Отметить посещаемость';
$string['update'] = 'Обновить';
$string['variable'] = 'переменную';
$string['variablesupdated'] = 'Переменные успешно обновлены';
$string['versionforprinting'] = 'версия для печати';
$string['week'] = 'неделя(и)';
$string['weeks'] = 'По неделям';
$string['youcantdo'] = 'Вы ничего не можете сделать';
?>

12
lang/ru_utf8/help/attforblock/sessions.html

@ -0,0 +1,12 @@
<p align="center"><b>Модуль Посещаемость</b></p>
<p align="center">
<?php
$temp = $module;
unset($module);
require_once($CFG->dirroot.'/mod/attforblock/version.php');
echo get_string('version').": $module->release ($module->version)";
unset($module);
$module = $temp;
?>
</p>

87
lang/sk_utf8/attforblock.php

@ -0,0 +1,87 @@
<?PHP // $Id: attforblock.php,v 1.1.2.2 2009/02/23 19:22:45 dlnsk Exp $
// attendanceblk.php - created with Moodle 1.5.3+ (2005060230)
$string['modulename'] = 'Účasť';
$string['modulenameplural'] = 'Účasti';
$string['modulenamesimple'] = 'Účasť';
$string['Aacronym'] = 'C';
$string['Afull'] = 'Chýbajúci';
$string['Eacronym'] = 'O';
$string['Efull'] = 'Ospravedlnený';
$string['Lacronym'] = 'N';
$string['Lfull'] = 'Neskorý';
$string['Pacronym'] = 'P';
$string['Pfull'] = 'Prítomný';
$string['acronym'] = 'Akronym';
$string['add'] = 'Pridať';
$string['addmultiplesessions'] = 'Pridať viaceré termíny';
$string['addsession'] = 'Pridať termíny';
$string['alltaken'] = 'Všetky termíny';
$string['attendanceforthecourse'] = 'Účasť pre kurz';
$string['attendancegrade'] = 'Účasť Známky';
$string['attendancenotstarted'] = 'Účasť pre tento kurz nebola ešte aktivovaná';
$string['attendancepercent'] = 'Účasť Percentá';
$string['attendancereport'] = 'Účasť Report';
$string['attendancesuccess'] = 'Účasť bola úspešne vložená';
$string['attendanceupdated'] = 'Účasť úspešne aktualizovaná';
$string['changesession'] = 'Zmena termínu';
$string['createmultiplesessions'] = 'Vytvoriť viac termínov';
$string['createonesession'] = 'Vytvoriť jeden termín pre kurz';
$string['defaults'] = 'Štandardné hodnoty';
$string['delete'] = 'Vymazať';
$string['deletesession'] = 'Vymazať termín';
$string['deletingsession'] = 'Vymazanie termínu pre kurz';
$string['description'] = 'Názov';
$string['display'] = 'Zobrazenie';
$string['downloadexcel'] = 'Download v XLS formáte';
$string['downloadtext'] = 'Download v TXT formáte';
$string['editsession'] = 'Uprav termín';
$string['errorinaddingsession'] = 'Chyba pri pridávaní termínov';
$string['erroringeneratingsessions'] = 'Chyba pri vytváraní termínov ';
$string['indetail'] = 'Detailne...';
$string['months'] = 'Mesiace';
$string['myvariables'] = 'Moje nastavenia';
$string['newdate'] = 'Nový dátum';
$string['noattforuser'] = 'Tento používateľ nemá zaznamenané žiadne účasti';
$string['nodescription'] = 'Tento termín nemá názov';
$string['noguest'] = 'Hosť nemôže vidieť účasť';
$string['noofdaysabsent'] = 'Počet neospravedlnených účastí';
$string['noofdaysexcused'] = 'Počet ospravedlnených účastí';
$string['noofdayslate'] = 'Počet oneskorených účastí';
$string['noofdayspresent'] = 'Počet prítomných účastí';
$string['nosessiondayselected'] = 'Nie je vybraný deň termínu';
$string['nosessionexists'] = 'Pre tento kurz neexistuje termín';
$string['olddate'] = 'Starý dátum';
$string['period'] = 'Obdobie';
$string['versionforprinting'] = 'Verzia pre tlač';
$string['remarks'] = 'Poznámky';
$string['report'] = 'Report';
$string['restoredefaults'] = 'Obnovenie štandardných nastavení';
$string['session'] = 'Termín';
$string['sessionadded'] = 'Termín úspešne generovaný';
$string['sessionalreadyexists'] = 'Tento termín pre tento kurz už existuje';
$string['sessiondate'] = 'Dátum termínu';
$string['sessiondays'] = 'Dni termínu';
$string['sessiondeleted'] = 'Termín úspešne vymazaný';
$string['sessionenddate'] = 'Ukončenie termínov';
$string['sessionexist'] = 'Session not added (already exist)!';
$string['sessionscompleted'] = 'Termíny ukončené';
$string['sessionsgenerated'] = 'Termíny úspešne generované';
$string['sessionstartdate'] = 'Začiatok termínov';
$string['sessionupdated'] = 'Termín úspešne zmenený';
$string['settings'] = 'Nastavenia';
$string['showdefaults'] = 'Ukázať štandardné nastavenia';
$string['status'] = 'Stav';
$string['strftimedm'] = '%%d.%%m';
$string['strftimedmy'] = '%%d.%%m.%%Y';
$string['strftimedmyw'] = '%%d.%%m.%%y&nbsp;(%%a)';
$string['strftimeshortdate'] = '%%d.%%m.%%Y';
$string['studentid'] = 'Študentské ID';
$string['takeattendance'] = 'Zapísať Účasť';
$string['update'] = 'Aktualizácia';
$string['variablesupdated'] = 'Premenné úspešne aktualizované';
$string['week'] = 'týždeň';
$string['weeks'] = 'Týždne';
?>

77
lang/sv/attforblock.php

@ -0,0 +1,77 @@
<?PHP // $Id: attforblock.php,v 1.1.2.2 2009/02/23 19:22:45 dlnsk Exp $
// attforblock.php - created with Moodle 1.6 development (2005101200)
$string['modulename'] = 'Närvaro';
$string['modulenameplural'] = 'Närvaro';
$string['modulenamesimple'] = 'Närvaro';
$string['Aacronym'] = 'F';
$string['Afull'] = 'Frånvarande';
$string['Eacronym'] = 'G';
$string['Efull'] = 'Giltig frånvaro';
$string['Lacronym'] = 'S';
$string['Lfull'] = 'Sen';
$string['Pacronym'] = 'N';
$string['Pfull'] = 'Närvarande';
$string['acronym'] = 'Akronym';
$string['add'] = 'Lägg till ';
$string['addmultiplesessions'] = 'Lägg till flerfaldiga sessioner';
$string['addsession'] = 'Lägg till session';
$string['alltaken'] = 'Allt har registrerats';
$string['attendanceforthecourse'] = 'Närvaro för kurs';
$string['attendancegrade'] = 'Närvaro - betyg';
$string['attendancepercent'] = 'Närvaro i procent';
$string['attendancereport'] = 'Närvarorapport';
$string['attendancesuccess'] = 'Närvaron har framgångsrikt registrerats';
$string['attendanceupdated'] = 'Närvaron har framgångsrikt uppdaterats';
$string['changesession'] = 'Ändra session';
$string['createmultiplesessions'] = 'Skapa flerfaldiga sessioner';
$string['createonesession'] = 'Skapa en session för kursen';
$string['defaults'] = 'Förinställda värden';
$string['delete'] = 'Ta bort ';
$string['deletesession'] = 'Ta bort session';
$string['deletingsession'] = 'Tar bort session för kursen';
$string['description'] = 'Beskrivning';
$string['display'] = 'Visa';
$string['downloadexcel'] = 'Ladda ner i Excel-format';
$string['downloadtext'] = 'Ladda ner i textformat';
$string['editsession'] = 'Redigera session';
$string['errorinaddingsession'] = 'Ett fel uppstod när en session skulle läggas till';
$string['erroringeneratingsessions'] = 'Ett fel uppstod när sessioner skulle genereras ';
$string['indetail'] = 'I detalj';
$string['months'] = 'Månader';
$string['myvariables'] = 'Mina variabler';
$string['newdate'] = 'Nytt datum';
$string['nodescription'] = 'Ingen beskrivning av den här sessionen';
$string['noguest'] = 'Gäster kan inte se närvaro';
$string['noofdaysabsent'] = 'Antal frånvarodagar';
$string['noofdaysexcused'] = 'Antal dagar med giltig frånvaro';
$string['noofdayslate'] = 'Antal dagar med sen ankomst';
$string['noofdayspresent'] = 'Antal närvarodagar';
$string['nosessiondayselected'] = 'Ingen session har valts';
$string['nosessionexists'] = 'Det finns ingen session för den här kursen';
$string['olddate'] = 'Gammalt datum';
$string['remarks'] = 'Anmärkningar';
$string['report'] = 'Rapport';
$string['restoredefaults'] = 'Återställ standardinställningar';
$string['session'] = 'Session';
$string['sessionadded'] = 'Sessionen har framgångsrikt lagts till';
$string['sessionalreadyexists'] = 'Det finns redan en session for detta datum';
$string['sessiondate'] = 'Session - datum';
$string['sessiondays'] = 'Session - dagar';
$string['sessiondeleted'] = 'Sessionen har framgångsrikt tagits bort';
$string['sessionenddate'] = 'Slutdatum för session';
$string['sessionexist'] = 'Sessionen har inte lagt till (den fanns redan)';
$string['sessionscompleted'] = 'Sessionerna är fullgjorda';
$string['sessionsgenerated'] = 'Sessioner har framgångsrikt genererats';
$string['sessionstartdate'] = 'Startdatum för session';
$string['sessionupdated'] = 'Sessionen har framgångsrikt uppdaterats';
$string['settings'] = 'Inställningar';
$string['status'] = 'Status';
$string['studentid'] = 'Student/elev/deltagar/lärande ID';
$string['takeattendance'] = 'Registrera närvaro';
$string['update'] = 'Uppdatera';
$string['variablesupdated'] = 'Variablerna har framgångsrikt uppdaterats';
$string['weeks'] = 'Veckor';
?>

389
lib.php

@ -0,0 +1,389 @@
<?PHP // $Id: lib.php,v 1.4.2.5 2009/03/11 18:21:08 dlnsk Exp $
/// Library of functions and constants for module attforblock
$attforblock_CONSTANT = 7; /// for example
function attforblock_install() {
$result = true;
$arr = array('P' => 2, 'A' => 0, 'L' => 1, 'E' => 1);
foreach ($arr as $k => $v) {
unset($rec);
$rec->courseid = 0;
$rec->acronym = get_string($k.'acronym', 'attforblock');
$rec->description = get_string($k.'full', 'attforblock');
$rec->grade = $v;
$rec->visible = 1;
$rec->deleted = 0;
$result = $result && insert_record('attendance_statuses', $rec);
}
return $result;
}
function attforblock_add_instance($attforblock) {
/// Given an object containing all the necessary data,
/// (defined by the form in mod.html) this function
/// will create a new instance and return the id number
/// of the new instance.
$attforblock->timemodified = time();
if ($att = get_record('attforblock', 'course', $attforblock->course)) {
$modnum = get_field('modules', 'id', 'name', 'attforblock');
if (!get_record('course_modules', 'course', $attforblock->course, 'module', $modnum)) {
delete_records('attforblock', 'course', $attforblock->course);
$attforblock->id = insert_record('attforblock', $attforblock);
} else {
return false;
}
} else {
$attforblock->id = insert_record('attforblock', $attforblock);
}
//Copy statuses for new instance from defaults
if (!get_records('attendance_statuses', 'courseid', $attforblock->course)) {
$statuses = get_records('attendance_statuses', 'courseid', 0, 'id');
foreach($statuses as $stat) {
$rec = $stat;
$rec->courseid = $attforblock->course;
insert_record('attendance_statuses', $rec);
}
}
// attforblock_grade_item_update($attforblock);
// attforblock_update_grades($attforblock);
return $attforblock->id;
}
function attforblock_update_instance($attforblock) {
/// Given an object containing all the necessary data,
/// (defined by the form in mod.html) this function
/// will update an existing instance with new data.
$attforblock->timemodified = time();
$attforblock->id = $attforblock->instance;
if (! update_record('attforblock', $attforblock)) {
return false;
}
attforblock_grade_item_update($attforblock);
return true;
}
function attforblock_delete_instance($id) {
/// Given an ID of an instance of this module,
/// this function will permanently delete the instance
/// and any data that depends on it.
if (! $attforblock = get_record('attforblock', 'id', $id)) {
return false;
}
$result = delete_records('attforblock', 'id', $id);
attforblock_grade_item_delete($attforblock);
return $result;
}
function attforblock_delete_course($course, $feedback=true){
if ($sess = get_records('attendance_sessions', 'courseid', $course->id, '', 'id')) {
$slist = implode(',', array_keys($sess));
delete_records_select('attendance_log', "sessionid IN ($slist)");
delete_records('attendance_sessions', 'courseid', $course->id);
}
delete_records('attendance_statuses', 'courseid', $course->id);
//Inform about changes performed if feedback is enabled
// if ($feedback) {
// notify(get_string('deletedefaults', 'lesson', $count));
// }
return true;
}
/**
* Called by course/reset.php
* @param $mform form passed by reference
*/
function attforblock_reset_course_form_definition(&$mform) {
$mform->addElement('header', 'attendanceheader', get_string('modulename', 'attforblock'));
$mform->addElement('static', 'description', get_string('description', 'attforblock'),
get_string('resetdescription', 'attforblock'));
$mform->addElement('checkbox', 'reset_attendance_log', get_string('deletelogs','attforblock'));
$mform->addElement('checkbox', 'reset_attendance_sessions', get_string('deletesessions','attforblock'));
$mform->disabledIf('reset_attendance_sessions', 'reset_attendance_log', 'notchecked');
$mform->addElement('checkbox', 'reset_attendance_statuses', get_string('resetstatuses','attforblock'));
$mform->setAdvanced('reset_attendance_statuses');
$mform->disabledIf('reset_attendance_statuses', 'reset_attendance_log', 'notchecked');
}
/**
* Course reset form defaults.
*/
function attforblock_reset_course_form_defaults($course) {
return array('reset_attendance_log'=>0, 'reset_attendance_statuses'=>0, 'reset_attendance_sessions'=>0);
}
function attforblock_reset_userdata($data) {
if (!empty($data->reset_attendance_log)) {
$sess = get_records('attendance_sessions', 'courseid', $data->courseid, '', 'id');
$slist = implode(',', array_keys($sess));
delete_records_select('attendance_log', "sessionid IN ($slist)");
set_field('attendance_sessions', 'lasttaken', 0, 'courseid', $data->courseid);
}
if (!empty($data->reset_attendance_statuses)) {
delete_records('attendance_statuses', 'courseid', $data->courseid);
$statuses = get_records('attendance_statuses', 'courseid', 0, 'id');
foreach($statuses as $stat) {
$rec = $stat;
$rec->courseid = $data->courseid;
insert_record('attendance_statuses', $rec);
}
}
if (!empty($data->reset_attendance_sessions)) {
delete_records('attendance_sessions', 'courseid', $data->courseid);
}
}
function attforblock_user_outline($course, $user, $mod, $attforblock) {
/// Return a small object with summary information about what a
/// user has done with a given particular instance of this module
/// Used for user activity reports.
/// $return->time = the time they did it
/// $return->info = a short text description
require_once('locallib.php');
if (isstudent($course->id, $user->id)) {
if ($sescount = get_attendance($user->id,$course)) {
$strgrade = get_string('grade');
$maxgrade = get_maxgrade($user->id, $course);
$usergrade = get_grade($user->id, $course);
$percent = get_percent($user->id,$course);
$result->info = "$strgrade: $usergrade / $maxgrade ($percent%)";
}
}
return $result;
}
function attforblock_user_complete($course, $user, $mod, $attforblock) {
/// Print a detailed representation of what a user has done with
/// a given particular instance of this module, for user activity reports.
require_once('locallib.php');
if (isstudent($course->id, $user->id)) {
// if (! $cm = get_coursemodule_from_instance("attforblock", $attforblock->id, $course->id)) {
// error("Course Module ID was incorrect");
// }
print_user_attendaces($user, $mod, $course);
}
//return true;
}
function attforblock_print_recent_activity($course, $isteacher, $timestart) {
/// Given a course and a time, this module should find recent activity
/// that has occurred in attforblock activities and print it out.
/// Return true if there was output, or false is there was none.
return false; // True if anything was printed, otherwise false
}
function attforblock_cron () {
/// Function to be run periodically according to the moodle cron
/// This function searches for things that need to be done, such
/// as sending out mail, toggling flags etc ...
return true;
}
/**
* Return grade for given user or all users.
*
* @param int $attforblockid id of attforblock
* @param int $userid optional user id, 0 means all users
* @return array array of grades, false if none
*/
function attforblock_get_user_grades($attforblock, $userid=0) {
global $CFG;
require_once('locallib.php');
if (! $course = get_record('course', 'id', $attforblock->course)) {
error("Course is misconfigured");
}
$result = false;
if ($userid) {
$result = array();
$result[$userid]->userid = $userid;
$result[$userid]->rawgrade = $attforblock->grade * get_percent($userid, $course) / 100;
} else {
if ($students = get_course_students($course->id)) {
$result = array();
foreach ($students as $student) {
$result[$student->id]->userid = $student->id;
$result[$student->id]->rawgrade = $attforblock->grade * get_percent($student->id, $course) / 100;
}
}
}
return $result;
}
/**
* Update grades by firing grade_updated event
*
* @param object $attforblock null means all attforblocks
* @param int $userid specific user only, 0 mean all
*/
function attforblock_update_grades($attforblock=null, $userid=0, $nullifnone=true) {
global $CFG;
if (!function_exists('grade_update')) { //workaround for buggy PHP versions
require_once($CFG->libdir.'/gradelib.php');
}
if ($attforblock != null) {
if ($grades = attforblock_get_user_grades($attforblock, $userid)) {
foreach($grades as $k=>$v) {
if ($v->rawgrade == -1) {
$grades[$k]->rawgrade = null;
}
}
attforblock_grade_item_update($attforblock, $grades);
} else {
attforblock_grade_item_update($attforblock);
}
} else {
$sql = "SELECT a.*, cm.idnumber as cmidnumber, a.course as courseid
FROM {$CFG->prefix}attforblock a, {$CFG->prefix}course_modules cm, {$CFG->prefix}modules m
WHERE m.name='attforblock' AND m.id=cm.module AND cm.instance=a.id";
if ($rs = get_recordset_sql($sql)) {
while ($attforblock = rs_fetch_next_record($rs)) {
// if ($attforblock->grade != 0) {
attforblock_update_grades($attforblock);
// } else {
// attforblock_grade_item_update($attforblock);
// }
}
rs_close($rs);
}
}
}
/**
* Create grade item for given attforblock
*
* @param object $attforblock object with extra cmidnumber
* @param mixed optional array/object of grade(s); 'reset' means reset grades in gradebook
* @return int 0 if ok, error code otherwise
*/
function attforblock_grade_item_update($attforblock, $grades=NULL) {
global $CFG;
require_once('locallib.php');
if (!function_exists('grade_update')) { //workaround for buggy PHP versions
require_once($CFG->libdir.'/gradelib.php');
}
if (!isset($attforblock->courseid)) {
$attforblock->courseid = $attforblock->course;
}
if (! $course = get_record('course', 'id', $attforblock->course)) {
error("Course is misconfigured");
}
//$attforblock->grade = get_maxgrade($course);
if(!empty($attforblock->cmidnumber)){
$params = array('itemname'=>$attforblock->name, 'idnumber'=>$attforblock->cmidnumber);
}else{
// MDL-14303
$cm = get_coursemodule_from_instance('attforblock', $attforblock->id);
$params = array('itemname'=>$attforblock->name, 'idnumber'=>$cm->id);
}
if ($attforblock->grade > 0) {
$params['gradetype'] = GRADE_TYPE_VALUE;
$params['grademax'] = $attforblock->grade;
$params['grademin'] = 0;
}
else if ($attforblock->grade < 0) {
$params['gradetype'] = GRADE_TYPE_SCALE;
$params['scaleid'] = -$attforblock->grade;
} else {
$params['gradetype'] = GRADE_TYPE_NONE;
}
if ($grades === 'reset') {
$params['reset'] = true;
$grades = NULL;
}
return grade_update('mod/attforblock', $attforblock->courseid, 'mod', 'attforblock', $attforblock->id, 0, $grades, $params);
}
/**
* Delete grade item for given attforblock
*
* @param object $attforblock object
* @return object attforblock
*/
function attforblock_grade_item_delete($attforblock) {
global $CFG;
require_once($CFG->libdir.'/gradelib.php');
if (!isset($attforblock->courseid)) {
$attforblock->courseid = $attforblock->course;
}
return grade_update('mod/attforblock', $attforblock->courseid, 'mod', 'attforblock', $attforblock->id, 0, NULL, array('deleted'=>1));
}
function attforblock_get_participants($attforblockid) {
//Must return an array of user records (all data) who are participants
//for a given instance of attforblock. Must include every user involved
//in the instance, independient of his role (student, teacher, admin...)
//See other modules as example.
return false;
}
function attforblock_scale_used ($attforblockid, $scaleid) {
//This function returns if a scale is being used by one attforblock
//it it has support for grading and scales. Commented code should be
//modified if necessary. See forum, glossary or journal modules
//as reference.
$return = false;
//$rec = get_record("attforblock","id","$attforblockid","scale","-$scaleid");
//
//if (!empty($rec) && !empty($scaleid)) {
// $return = true;
//}
return $return;
}
//////////////////////////////////////////////////////////////////////////////////////
/// Any other attforblock functions go here. Each of them must have a name that
/// starts with attforblock_
?>

314
locallib.php

@ -0,0 +1,314 @@
<?php
global $CFG;
require_once($CFG->libdir.'/gradelib.php');
define('ONE_DAY', 86400); // Seconds in one day
define('ONE_WEEK', 604800); // Seconds in one week
function show_tabs($cm, $context, $currenttab='sessions')
{
$toprow = array();
if (has_capability('mod/attforblock:manageattendances', $context) or
has_capability('mod/attforblock:takeattendances', $context) or
has_capability('mod/attforblock:changeattendances', $context)) {
$toprow[] = new tabobject('sessions', 'manage.php?id='.$cm->id,
get_string('sessions','attforblock'));
}
if (has_capability('mod/attforblock:manageattendances', $context)) {
$toprow[] = new tabobject('add', "sessions.php?id=$cm->id&amp;action=add",
get_string('add','attforblock'));
}
if (has_capability('mod/attforblock:viewreports', $context)) {
$toprow[] = new tabobject('report', 'report.php?id='.$cm->id,
get_string('report','attforblock'));
}
if (has_capability('mod/attforblock:export', $context)) {
$toprow[] = new tabobject('export', 'export.php?id='.$cm->id,
get_string('export','quiz'));
}
if (has_capability('mod/attforblock:changepreferences', $context)) {
$toprow[] = new tabobject('settings', 'attsettings.php?id='.$cm->id,
get_string('settings','attforblock'));
}
$tabs = array($toprow);
print_tabs($tabs, $currenttab);
}
//getting settings for course
function get_statuses($courseid, $onlyvisible = true)
{
if ($onlyvisible) {
$result = get_records_select('attendance_statuses', "courseid = $courseid AND visible = 1 AND deleted = 0", 'grade DESC');
} else {
$result = get_records_select('attendance_statuses', "courseid = $courseid AND deleted = 0", 'grade DESC');
// $result = get_records('attendance_statuses', 'courseid', $courseid, 'grade DESC');
}
return $result;
}
//gets attendance status for a student, returns count
function get_attendance($userid, $course, $statusid=0)
{
global $CFG;
$qry = "SELECT count(*) as cnt
FROM {$CFG->prefix}attendance_log al
JOIN {$CFG->prefix}attendance_sessions ats
ON al.sessionid = ats.id
WHERE ats.courseid = $course->id
AND ats.sessdate >= $course->startdate
AND al.studentid = $userid";
if ($statusid) {
$qry .= " AND al.statusid = $statusid";
}
return count_records_sql($qry);
}
function get_grade($userid, $course)
{
global $CFG;
$logs = get_records_sql("SELECT l.id, l.statusid, l.statusset
FROM {$CFG->prefix}attendance_log l
JOIN {$CFG->prefix}attendance_sessions s
ON l.sessionid = s.id
WHERE l.studentid = $userid
AND s.courseid = $course->id
AND s.sessdate >= $course->startdate");
$result = 0;
if ($logs) {
$stat_grades = records_to_menu(get_records('attendance_statuses', 'courseid', $course->id), 'id', 'grade');
foreach ($logs as $log) {
$result += $stat_grades[$log->statusid];
}
}
return $result;
}
//temporary solution, for support PHP 4.3.0 which minimal requirement for Moodle 1.9.x
function local_array_intersect_key($array1, $array2) {
$result = array();
foreach ($array1 as $key => $value) {
if (isset($array2[$key])) {
$result[$key] = $value;
}
}
return $result;
}
function get_maxgrade($userid, $course)
{
global $CFG;
$logs = get_records_sql("SELECT l.id, l.statusid, l.statusset
FROM {$CFG->prefix}attendance_log l
JOIN {$CFG->prefix}attendance_sessions s
ON l.sessionid = s.id
WHERE l.studentid = $userid
AND s.courseid = $course->id
AND s.sessdate >= $course->startdate");
$maxgrade = 0;
if ($logs) {
$stat_grades = records_to_menu(get_records('attendance_statuses', 'courseid', $course->id), 'id', 'grade');
foreach ($logs as $log) {
$ids = array_flip(explode(',', $log->statusset));
// $grades = array_intersect_key($stat_grades, $ids); // require PHP 5.1.0 and higher
$grades = local_array_intersect_key($stat_grades, $ids); //temporary solution, for support PHP 4.3.0 which minimal requirement for Moodle 1.9.x
$maxgrade += max($grades);
}
}
return $maxgrade;
}
function get_percent_adaptive($userid, $course) // NOT USED
{
global $CFG;
$logs = get_records_sql("SELECT l.id, l.statusid, l.statusset
FROM {$CFG->prefix}attendance_log l
JOIN {$CFG->prefix}attendance_sessions s
ON l.sessionid = s.id
WHERE l.studentid = $userid
AND s.courseid = $course->id
AND s.sessdate >= $course->startdate");
$result = 0;
if ($logs) {
$stat_grades = records_to_menu(get_records('attendance_statuses', 'courseid', $course->id), 'id', 'grade');
$percent = 0;
foreach ($logs as $log) {
$ids = array_flip(explode(',', $log->statusset));
$grades = array_intersect_key($stat_grades, $ids);
$delta = max($grades) - min($grades);
$percent += $stat_grades[$log->statusid] / $delta;
}
$result = $percent / count($logs) * 100;
}
if (!$dp = grade_get_setting($course->id, 'decimalpoints')) {
$dp = $CFG->grade_decimalpoints;
}
return sprintf("%0.{$dp}f", $result);
}
function get_percent($userid, $course)
{
global $CFG;
$maxgrd = get_maxgrade($userid, $course);
if ($maxgrd == 0) {
$result = 0;
} else {
$result = get_grade($userid, $course) / $maxgrd * 100;
}
if ($result < 0) {
$result = 0;
}
if (!$dp = grade_get_setting($course->id, 'decimalpoints')) {
$dp = $CFG->grade_decimalpoints;
}
return sprintf("%0.{$dp}f", $result);
}
function set_current_view($courseid, $view) {
global $SESSION;
return $SESSION->currentattview[$courseid] = $view;
}
function get_current_view($courseid) {
global $SESSION;
if (isset($SESSION->currentattview[$courseid]))
return $SESSION->currentattview[$courseid];
else
return 'all';
}
function print_row($left, $right) {
echo "\n<tr><td nowrap=\"nowrap\" align=\"right\" valign=\"top\" class=\"cell c0\">$left</td><td align=\"left\" valign=\"top\" class=\"info c1\">$right</td></tr>\n";
}
function print_attendance_table($user, $course) {
$complete = get_attendance($user->id, $course);
$percent = get_percent($user->id, $course).'&nbsp;%';
$grade = get_grade($user->id, $course);
echo '<table border="0" cellpadding="0" cellspacing="0" class="list">';
print_row(get_string('sessionscompleted','attforblock').':', "<strong>$complete</strong>");
$statuses = get_statuses($course->id);
foreach($statuses as $st) {
print_row($st->description.': ', '<strong>'.get_attendance($user->id, $course, $st->id).'</strong>');
}
print_row(get_string('attendancepercent','attforblock').':', "<strong>$percent</strong>");
print_row(get_string('attendancegrade','attforblock').':', "<strong>$grade</strong> / ".get_maxgrade($user->id, $course));
print_row('&nbsp;', '&nbsp;');
echo '</table>';
}
function print_user_attendaces($user, $cm, $course = 0, $printing = null) {
global $CFG, $COURSE, $mode;
echo '<table class="userinfobox">';
if (!$printing) {
echo '<tr>';
echo '<td colspan="2" class="generalboxcontent"><div align="right">'.
helpbutton('studentview', get_string('attendancereport','attforblock'), 'attforblock', true, false, '', true).
"<a href=\"view.php?id={$cm->id}&amp;student={$user->id}&amp;mode=$mode&amp;printing=yes\" target=\"_blank\">[".get_string('versionforprinting','attforblock').']</a></div></td>';
echo '</tr>';
}
// echo '<tr>';
// echo '<th colspan="2"><h2 class="main help"><center>'.get_string('attendancereport','attforblock').helpbutton('studentview', get_string('attendancereport','attforblock'), 'attforblock', true, false, '', true).'</center></h1></th>';
// echo '</tr>';
echo '<tr>';
echo '<td class="left side">';
print_user_picture($user->id, $COURSE->id, $user->picture, true);
echo '</td>';
echo '<td class="generalboxcontent">';
echo '<font size="+1"><b>'.fullname($user).'</b></font>';
if ($course) {
echo '<hr />';
$complete = get_attendance($user->id, $course);
if($complete) {
print_attendance_table($user, $course);
} else {
echo get_string('attendancenotstarted','attforblock');
}
} else {
$stqry = "SELECT ats.id,ats.courseid
FROM {$CFG->prefix}attendance_log al
JOIN {$CFG->prefix}attendance_sessions ats
ON al.sessionid = ats.id
WHERE al.studentid = {$user->id}
GROUP BY ats.courseid
ORDER BY ats.courseid asc";
$recs = get_records_sql_menu($stqry);
foreach ($recs as $id => $courseid) {
echo '<hr />';
echo '<table border="0" cellpadding="0" cellspacing="0" width="100%" class="list1">';
$nextcourse = get_record('course', 'id', $courseid);
echo '<tr><td valign="top"><strong>'.$nextcourse->fullname.'</strong></td>';
echo '<td align="right">';
$complete = get_attendance($user->id, $nextcourse);
if($complete) {
print_attendance_table($user, $nextcourse);
} else {
echo get_string('attendancenotstarted','attforblock');
}
echo '</td></tr>';
echo '</table>';
}
}
if ($course) {
$stqry = "SELECT ats.sessdate,ats.description,al.statusid,al.remarks
FROM {$CFG->prefix}attendance_log al
JOIN {$CFG->prefix}attendance_sessions ats
ON al.sessionid = ats.id
WHERE ats.courseid = {$course->id} AND al.studentid = {$user->id}
ORDER BY ats.sessdate asc";
if ($sessions = get_records_sql($stqry)) {
$statuses = get_statuses($course->id);
?>
<div id="mod-assignment-submissions">
<table align="left" cellpadding="3" cellspacing="0" class="submissions">
<tr>
<th>#</th>
<th align="center"><?php print_string('date')?></th>
<th align="center"><?php print_string('time')?></th>
<th align="center"><?php print_string('description','attforblock')?></th>
<th align="center"><?php print_string('status','attforblock')?></th>
<th align="center"><?php print_string('remarks','attforblock')?></th>
</tr>
<?php
$i = 1;
foreach($sessions as $key=>$session)
{
?>
<tr>
<td align="center"><?php echo $i++;?></td>
<td><?php echo userdate($session->sessdate, get_string('strftimedmyw', 'attforblock')); //userdate($students->sessdate,'%d.%m.%y&nbsp;(%a)', 99, false);?></td>
<td><?php echo userdate($session->sessdate, get_string('strftimehm', 'attforblock')); ?></td>
<td><?php echo empty($session->description) ? get_string('nodescription', 'attforblock') : $session->description; ?></td>
<td><?php echo $statuses[$session->statusid]->description ?></td>
<td><?php echo $session->remarks;?></td>
</tr>
<?php
}
echo '</table>';
} else {
print_heading(get_string('noattforuser','attforblock'));
}
}
echo '</td></tr><tr><td>&nbsp;</td></tr></table></div>';
}
?>

164
manage.php

@ -0,0 +1,164 @@
<?PHP // $Id: manage.php,v 1.2.2.4 2009/02/28 19:20:14 dlnsk Exp $
/// This page prints a particular instance of attforblock
/// (Replace attforblock with the name of your module)
require_once('../../config.php');
require_once('locallib.php');
$id = required_param('id', PARAM_INT); // Course Module ID, or
$from = optional_param('from', PARAM_ACTION);
if (! $cm = get_record('course_modules', 'id', $id)) {
error('Course Module ID was incorrect');
}
if (! $course = get_record('course', 'id', $cm->course)) {
error("Course is misconfigured");
}
if (! $attforblock = get_record('attforblock', 'id', $cm->instance)) {
error("Course module is incorrect");
}
require_login($course->id);
if (! $user = get_record('user', 'id', $USER->id) ) {
error("No such user in this course");
}
if (!$context = get_context_instance(CONTEXT_MODULE, $cm->id)) {
print_error('badcontext');
}
if (!has_capability('mod/attforblock:manageattendances', $context) AND
!has_capability('mod/attforblock:takeattendances', $context) AND
!has_capability('mod/attforblock:changeattendances', $context)) {
redirect("view.php?id=$cm->id");
}
//if teacher is coming from block, then check for a session exists for today
if($from === 'block') {
$today = time(); // because we compare with database, we don't need to use usertime()
$sql = "SELECT id, lasttaken
FROM {$CFG->prefix}attendance_sessions
WHERE $today BETWEEN sessdate AND (sessdate + duration)
AND courseid = $course->id";
if($att = get_record_sql($sql)) {
if ((!$att->lasttaken and has_capability('mod/attforblock:takeattendances', $context)) or
($att->lasttaken and has_capability('mod/attforblock:changeattendances', $context))) {
redirect('attendances.php?id='.$id.'&amp;sessionid='.$att->id);
}
}
}
/// Print headers
$navlinks[] = array('name' => $attforblock->name, 'link' => null, 'type' => 'activity');
$navigation = build_navigation($navlinks);
print_header("$course->shortname: ".$attforblock->name, $course->fullname,
$navigation, "", "", true, update_module_button($cm->id, $course->id, get_string('modulename', 'attforblock')),
navmenu($course));
print_heading(get_string('attendanceforthecourse','attforblock').' :: ' .$course->fullname);
if(!count_records_select('attendance_sessions', "courseid = $course->id AND sessdate >= $course->startdate")) { // no session exists for this course
show_tabs($cm, $context);
print_heading(get_string('nosessionexists','attforblock'));
$hiddensess = count_records_select('attendance_sessions', "courseid = $course->id AND sessdate < $course->startdate");
echo '<div align="left">'.helpbutton('hiddensessions', '', 'attforblock', true, true, '', true);
echo get_string('hiddensessions', 'attforblock').': '.$hiddensess.'</div>';
} else { //sessions generated , display them
add_to_log($course->id, 'attendance', 'manage attendances', 'mod/attforblock/manage.php?course='.$course->id, $user->lastname.' '.$user->firstname);
show_tabs($cm, $context);
print_sessions_list($course);
}
// require_once('lib.php');
// $t = attforblock_get_user_grades($attforblock); ////////////////////////////////////////////
print_footer($course);
function print_sessions_list($course) {
global $CFG, $context, $cm;
$strhours = get_string('hours');
$strmins = get_string('min');
$qry = get_records_select('attendance_sessions', "courseid = $course->id AND sessdate >= $course->startdate", 'sessdate asc');
$i = 0;
$table->width = '100%';
//$table->tablealign = 'center';
$table->head = array('#', get_string('date'), get_string('time'), get_string('duration', 'attforblock'), get_string('description','attforblock'), get_string('actions'), get_string('select'));
$table->align = array('', '', '', 'right', 'left', 'center', 'center');
$table->size = array('1px', '1px', '1px', '1px', '*', '1px', '1px');
$allowtake = has_capability('mod/attforblock:takeattendances', $context);
$allowchange = has_capability('mod/attforblock:changeattendances', $context);
$allowmanage = has_capability('mod/attforblock:manageattendances', $context);
foreach($qry as $key=>$sessdata)
{
$i++;
$actions = '';
// if ($allowtake) {
if($sessdata->lasttaken > 0) //attendance has taken
{
if ($allowchange) {
$desc = "<a href=\"attendances.php?id=$cm->id&amp;sessionid={$sessdata->id}\">".
($sessdata->description ? $sessdata->description : get_string('nodescription', 'attforblock')).
'</a>';
} else {
$desc = '<i>'.(empty($sessdata->description) ? get_string('nodescription', 'attforblock') : $sessdata->description).'</i>';
}
} else {
$desc = empty($sessdata->description) ? get_string('nodescription', 'attforblock') : $sessdata->description;
if ($allowtake) {
$title = get_string('takeattendance','attforblock');
$actions = "<a title=\"$title\" href=\"attendances.php?id=$cm->id&amp;sessionid={$sessdata->id}\">".
"<img src=\"{$CFG->pixpath}/t/go.gif\" alt=\"$title\" /></a>&nbsp;";
}
}
// }
if($allowmanage) {
$title = get_string('editsession','attforblock');
$actions .= "<a title=\"$title\" href=\"sessions.php?id=$cm->id&amp;sessionid={$sessdata->id}&amp;action=update\">".
"<img src=\"{$CFG->pixpath}/t/edit.gif\" alt=\"$title\" /></a>&nbsp;";
$title = get_string('deletesession','attforblock');
$actions .= "<a title=\"$title\" href=\"sessions.php?id=$cm->id&amp;sessionid={$sessdata->id}&amp;action=delete\">".
"<img src=\"{$CFG->pixpath}/t/delete.gif\" alt=\"$title\" /></a>&nbsp;";
}
$table->data[$sessdata->id][] = $i;
$table->data[$sessdata->id][] = userdate($sessdata->sessdate, get_string('strftimedmyw', 'attforblock'));
$table->data[$sessdata->id][] = userdate($sessdata->sessdate, get_string('strftimehm', 'attforblock'));
$hours = floor($sessdata->duration / HOURSECS);
$mins = floor(($sessdata->duration - $hours * HOURSECS) / MINSECS);
$mins = $mins < 10 ? "0$mins" : "$mins";
$table->data[$sessdata->id][] = $hours ? "{$hours}&nbsp;{$strhours}&nbsp;{$mins}&nbsp;{$strmins}" : "{$mins}&nbsp;{$strmins}";
$table->data[$sessdata->id][] = $desc;
$table->data[$sessdata->id][] = $actions;
$table->data[$sessdata->id][] = '<input type="checkbox" name="sessid['.$sessdata->id.']" />';
unset($desc, $actions);
}
echo '<div align="center"><div class="generalbox boxwidthwide">';
echo "<form method=\"post\" action=\"sessions.php?id={$cm->id}\">"; //&amp;sessionid={$sessdata->id}
echo '<div align="right">'.helpbutton ('sessions', get_string('help'), 'attforblock', true, true, '', true).'</div>';
print_table($table);
$hiddensess = count_records_select('attendance_sessions', "courseid = $course->id AND sessdate < $course->startdate");
echo '<table width="100%"><tr><td valign="top">';
echo '<div align="left">'.helpbutton('hiddensessions', '', 'attforblock', true, true, '', true);
echo get_string('hiddensessions', 'attforblock').': '.$hiddensess.'</div></td>';
echo '<td><div align="right"><a href="javascript:checkall();">'.get_string('selectall').'</a> /'.
' <a href="javascript:checknone();">'.get_string('deselectall').'</a><br /><br />';
echo '<strong>'.get_string('withselected', 'quiz').':</strong>&nbsp;';
if ($allowmanage) {
$actionlist = array('deleteselected' => get_string('delete'),
'changeduration' => get_string('changeduration', 'attforblock'));
choose_from_menu($actionlist, 'action');
echo '<input type="submit" name="ok" value="'.get_string('ok')."\" />\n";
} else {
echo get_string('youcantdo', 'attforblock'); //You can't do anything
}
echo '</div></td></tr></table>';
echo '</form></div></div>';
}
?>

32
mod_form.php

@ -0,0 +1,32 @@
<?php
require_once ($CFG->dirroot.'/course/moodleform_mod.php');
class mod_attforblock_mod_form extends moodleform_mod {
function definition() {
global $CFG;
$mform =& $this->_form;
//-------------------------------------------------------------------------------
$mform->addElement('header', 'general', get_string('general', 'form'));
$mform->addElement('text', 'name', get_string('name'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', null, 'required', null, 'client');
$mform->setDefault('name', get_string('modulename', 'attforblock'));
$mform->addElement('static', 'attdescription', '', get_string('moduledescription', 'attforblock'));
$mform->addElement('modgrade', 'grade', get_string('grade'));
$mform->setDefault('grade', 100);
$this->standard_coursemodule_elements(true);
//-------------------------------------------------------------------------------
// buttons
$this->add_action_buttons();
}
}
?>

226
report.php

@ -0,0 +1,226 @@
<?PHP // $Id: report.php,v 1.1.2.4 2009/02/28 16:49:17 dlnsk Exp $
// generates sessions
require_once('../../config.php');
require_once($CFG->libdir.'/blocklib.php');
require_once('locallib.php');
define('USER_SMALL_CLASS', 20); // Below this is considered small
define('USER_LARGE_CLASS', 200); // Above this is considered large
define('DEFAULT_PAGE_SIZE', 20);
$id = required_param('id', PARAM_INT);
$group = optional_param('group', -1, PARAM_INT); // Group to show
$view = optional_param('view', 'weeks', PARAM_ALPHA); // which page to show
$current = optional_param('current', 0, PARAM_INT);
$sort = optional_param('sort', 'lastname', PARAM_ALPHA);
if ($id) {
if (! $cm = get_record('course_modules', 'id', $id)) {
error('Course Module ID was incorrect');
}
if (! $course = get_record('course', 'id', $cm->course)) {
error('Course is misconfigured');
}
if (! $attforblock = get_record('attforblock', 'id', $cm->instance)) {
error("Course module is incorrect");
}
}
require_login($course->id);
if (! $user = get_record('user', 'id', $USER->id) ) {
error("No such user in this course");
}
if (!$context = get_context_instance(CONTEXT_MODULE, $cm->id)) {
print_error('badcontext');
}
require_capability('mod/attforblock:viewreports', $context);
//add info to log
add_to_log($course->id, 'attendance', 'report displayed', 'mod/attforblock/report.php?id='.$id, $user->lastname.' '.$user->firstname);
/// Print headers
$navlinks[] = array('name' => $attforblock->name, 'link' => "view.php?id=$id", 'type' => 'activity');
$navlinks[] = array('name' => get_string('report', 'attforblock'), 'link' => null, 'type' => 'activityinstance');
$navigation = build_navigation($navlinks);
print_header("$course->shortname: ".$attforblock->name.' - ' .get_string('report','attforblock'), $course->fullname,
$navigation, "", "", true, "&nbsp;", navmenu($course));
show_tabs($cm, $context, 'report');
$sort = $sort == 'firstname' ? 'firstname' : 'lastname';
if(!count_records('attendance_sessions', 'courseid', $course->id)) { // no session exists for this course
redirect("sessions.php?id=$cm->id&amp;action=add");
} else { // display attendance report
/// find out current groups mode
$groupmode = groups_get_activity_groupmode($cm);
$currentgroup = groups_get_activity_group($cm, true);
if ($groupmode == VISIBLEGROUPS ||
($groupmode && has_capability('moodle/site:accessallgroups', $context))) {
groups_print_activity_menu($cm, "report.php?id=$id&amp;sort=$sort");
}
echo '<div align="right">'.helpbutton ('report', get_string('help'), 'attforblock', true, true, '', true).'</div>';
if ($currentgroup) {
$students = get_users_by_capability($context, 'moodle/legacy:student', '', "u.$sort ASC", '', '', $currentgroup, '', false);
} else {
$students = get_users_by_capability($context, 'moodle/legacy:student', '', "u.$sort ASC", '', '', '', '', false);
}
// display date interval selector
$rec = get_record_sql("SELECT MIN(sessdate) AS min, MAX(sessdate) AS max
FROM {$CFG->prefix}attendance_sessions
WHERE courseid=$course->id AND sessdate >= $course->startdate");
$firstdate = $rec->min;
$lastdate = $rec->max;
$now = time();
$current = $current == 0 ? $now : $current;
list(,,,$wday, $syear, $smonth, $sday) = array_values(usergetdate($firstdate));
$wday = $wday == 0 ? 7 : $wday; //////////////////////////////////////////////////// Нужна проверка настройки календаря
$startdate = make_timestamp($syear, $smonth, $sday-$wday+1); //GMT timestamp but for local midnight of monday
$options['all'] = get_string('alltaken','attforblock');
$options['weeks'] = get_string('weeks','attforblock');
$options['months'] = get_string('months','attforblock');
echo '<center>'.helpbutton ('display', get_string('display','attforblock'), 'attforblock', true, false, '', true).get_string('display','attforblock').': ';
if (isset($_GET['view'])) //{
set_current_view($course->id, $_GET['view']);
$view = get_current_view($course->id);
popup_form("report.php?id=$id&amp;sort=$sort&amp;view=", $options, 'viewmenu', $view, '');
$out = '';
$list = array();
if ($view === 'weeks') {
$format = get_string('strftimedm', 'attforblock');
for ($i = 0, $monday = $startdate; $monday <= $lastdate; $i++, $monday += ONE_WEEK) {
if (count_records_select('attendance_sessions', "courseid={$course->id} AND sessdate >= ".$monday." AND sessdate < ".($monday + ONE_WEEK))) {
$list[] = $monday;
}
}
} elseif ($view === 'months') {
$startdate = make_timestamp($syear, $smonth, 1);
$format = '%B';
for ($i = 0, $month = $startdate; $month <= $lastdate; $i++, $month = make_timestamp($syear, $smonth+$i, 1)) {
if (count_records_select('attendance_sessions', "courseid={$course->id} AND sessdate >= ".$month." AND sessdate < ".make_timestamp($syear, $smonth+$i+1, 1))) {
$list[] = $month;
}
}
}
$found = false;
for ($i = count($list)-1; $i >= 0; $i--) {
if ($list[$i] <= $current && !$found) {
$found = true;
$current = $list[$i];
$out = '<b>'.userdate($list[$i], $format).'</b> / '.$out;
} else {
$out = "\n<a href=\"report.php?id=$id&amp;current={$list[$i]}&amp;sort=$sort\">".userdate($list[$i], $format)."</a> / ".$out;
}
}
echo substr($out, 0, -2)."</center>\n";
$statuses = get_statuses($course->id);
$allstatuses = get_statuses($course->id, false);
if ($view === 'weeks') {
$where = "courseid={$course->id} AND sessdate >= $course->startdate AND sessdate >= $current AND sessdate < ".($current + ONE_WEEK);
} elseif ($view === 'months') {
list(,,,, $syear, $smonth, $sday) = array_values(usergetdate($current));
$where = "courseid={$course->id} AND sessdate >= $course->startdate AND sessdate >= $current AND sessdate < ".make_timestamp($syear, $smonth+1, 1);
} else {
$where = "courseid={$course->id} AND sessdate >= $course->startdate AND sessdate <= ".time();
}
if ($students and
($course_sess = get_records_select('attendance_sessions', $where, 'sessdate ASC'))) {
$firstname = "<a href=\"report.php?id=$id&amp;sort=firstname\">".get_string('firstname').'</a>';
$lastname = "<a href=\"report.php?id=$id&amp;sort=lastname\">".get_string('lastname').'</a>';
if ($CFG->fullnamedisplay == 'lastname firstname') { // for better view (dlnsk)
$fullnamehead = "$lastname / $firstname";
} else {
$fullnamehead = "$firstname / $lastname";
}
$table->head[] = '';
$table->align[] = '';
$table->size[] = '1px';
$table->head[] = $fullnamehead;
$table->align[] = 'left';
$table->size[] = '';
$allowtake = has_capability('mod/attforblock:takeattendances', $context);
$allowchange = has_capability('mod/attforblock:changeattendances', $context);
foreach($course_sess as $sessdata) {
if (count_records('attendance_log', 'sessionid', $sessdata->id)) {
if ($allowchange) {
$table->head[] = "<a href=\"attendances.php?id=$id&amp;sessionid={$sessdata->id}\">".
userdate($sessdata->sessdate, get_string('strftimedm', 'attforblock').'<br />('.get_string('strftimehm', 'attforblock').')').
'</a>';
} else {
$table->head[] = userdate($sessdata->sessdate, get_string('strftimedm', 'attforblock').'<br />('.get_string('strftimehm', 'attforblock').')');
}
} else {
if ($allowtake) {
$table->head[] = "<a href=\"attendances.php?id=$id&amp;sessionid={$sessdata->id}\">".
userdate($sessdata->sessdate, get_string('strftimedm', 'attforblock').'<br />('.get_string('strftimehm', 'attforblock').')').
'</a>';
} else {
$table->head[] = userdate($sessdata->sessdate, get_string('strftimedm', 'attforblock').'<br />('.get_string('strftimehm', 'attforblock').')');
}
}
$table->align[] = 'center';
$table->size[] = '1px';
}
for ($i=0; $i<5; $i++) {
$table->align[] = 'center';
$table->size[] = '1px';
}
foreach($statuses as $st) {
$table->head[] = $st->acronym;
}
$table->head[] = get_string('grade');//.'&nbsp;/&nbsp;'.$maxgrade;
$table->align[] = 'right';
$table->size[] = '1px';
$table->head[] = '%';
foreach($students as $student) {
$table->data[$student->id][] = print_user_picture($student->id, $course->id, $student->picture, 20, true, true);
$table->data[$student->id][] = "<a href=\"view.php?id=$id&amp;student={$student->id}\">".fullname($student).'</a>';
foreach($course_sess as $sessdata) {
if ($att = get_record('attendance_log', 'sessionid', $sessdata->id, 'studentid', $student->id)) {
if (isset($statuses[$att->statusid])) {
$table->data[$student->id][] = $statuses[$att->statusid]->acronym;
} else {
$table->data[$student->id][] = '<font color="red"><b>'.$allstatuses[$att->statusid]->acronym.'</b></font>';
}
} else {
$table->data[$student->id][] = '-';
}
}
foreach($statuses as $st) {
$table->data[$student->id][] = get_attendance($student->id, $course, $st->id);
}
$table->data[$student->id][] = get_grade($student->id, $course).'&nbsp;/&nbsp;'.get_maxgrade($student->id, $course);
$table->data[$student->id][] = get_percent($student->id, $course).'%';
}
echo '<br />';
print_table($table);
} else {
print_heading(get_string('nothingtodisplay'), 'center');
}
echo get_string('status','attforblock').':<br />';
foreach($statuses as $st) {
echo $st->acronym.' - '.$st->description.'<br />';
}
}
print_footer($course);
exit;
?>

255
restorelib.php

@ -0,0 +1,255 @@
<?php
function attforblock_restore_mods($mod,$restore) {
global $CFG, $oldidarray;
$status = true;
//Get record from backup_ids
$data = backup_getid($restore->backup_unique_code, $mod->modtype, $mod->id);
if ($data) {
//Now get completed xmlized object
$info = $data->info;
if (count_records('attforblock', 'course', $restore->course_id)) {
return false;
}
//Now, build the attforblock record structure
$attforblock->course = $restore->course_id;
// $attforblock->teacher = backup_todb($info['MOD']['#']['TEACHER']['0']['#']);
$attforblock->name = backup_todb($info['MOD']['#']['NAME']['0']['#']);
if (isset($info['MOD']['#']['GRADE'])) {
$attforblock->grade = backup_todb($info['MOD']['#']['GRADE']['0']['#']);
} else {
$attforblock->grade = 100;
}
//The structure is equal to the db, so insert the attforblock
$newid = insert_record ('attforblock', $attforblock);
if ($newid) {
//We have the newid, update backup_ids
backup_putid($restore->backup_unique_code, $mod->modtype, $mod->id, $newid);
attforblock_restore_attendance_statuses ($mod->id, $newid, $info, $restore);
attforblock_restore_attendance_sessions ($mod->id, $newid, $info, $restore);
//Now check if want to restore user data and do it.
if (restore_userdata_selected($restore, 'attforblock', $mod->id)) {
attforblock_restore_attendance_log ($mod->id, $newid, $info, $restore);
}
} else {
$status = false;
}
} else {
$status = false;
}
return $status;
}
function attforblock_restore_attendance_sessions ($old_attforblock_id, $new_attforblock_id, $info, $restore) {
global $CFG, $oldidarray;
$status = true;
if (isset($info['MOD']['#']['SESSIONS'])) {
@$stats = $info['MOD']['#']['SESSIONS']['0']['#']['SESSION'];
}else {
@$stats = $info['MOD']['#']['ATTFORBLOCK_SESSIONS']['0']['#']['ROWS'];
}
for($i = 0; $i < sizeof($stats); $i++) {
$stat_info = $stats[$i];
//Now, build the attforblock_SESSIONS record structure
$stat->courseid = $restore->course_id;
// $stat->creator = backup_todb($stat_info['#']['CREATOR']['0']['#']);
$stat->sessdate = backup_todb($stat_info['#']['SESSDATE']['0']['#']);
$stat->timemodified = backup_todb($stat_info['#']['TIMEMODIFIED']['0']['#']);
$stat->description = backup_todb($stat_info['#']['DESCRIPTION']['0']['#']);
if (isset($info['MOD']['#']['SESSIONS'])) {
$stat->duration = backup_todb($stat_info['#']['DURATION']['0']['#']);;
$stat->lasttaken = backup_todb($stat_info['#']['LASTTAKEN']['0']['#']);
$stat->lasttakenby = backup_todb($stat_info['#']['LASTTAKENBY']['0']['#']);
} else { //Old backup
$stat->duration = 0;
$stat->lasttaken = backup_todb($stat_info['#']['TIMETAKEN']['0']['#']);
$stat->lasttakenby = backup_todb($stat_info['#']['TAKENBY']['0']['#']);
}
if (restore_userdata_selected($restore, 'attforblock', $old_attforblock_id)) {
if ($user = backup_getid($restore->backup_unique_code, 'user', $stat->lasttakenby)) {
$stat->lasttakenby = $user->new_id;
}
} else {
$stat->lasttaken = 0;
$stat->lasttakenby = 0;
}
$newid = insert_record ('attendance_sessions', $stat);
$oldidarray[$old_attforblock_id]['attendance_sessions'][backup_todb($stat_info['#']['ID']['0']['#'])] = $newid;
}
return $status;
}
function attforblock_restore_attendance_statuses ($old_attforblock_id, $new_attforblock_id,$info,$restore) {
global $CFG, $oldidarray;
$status = true;
//Get the statuses array
if (isset($info['MOD']['#']['STATUSES'])) {
$stats = $info['MOD']['#']['STATUSES']['0']['#']['STATUS'];
for($i = 0; $i < sizeof($stats); $i++) {
$stat_info = $stats[$i];
//Now, build the attforblock_STATUS record structure
$stat->courseid = $restore->course_id;
$stat->acronym = backup_todb($stat_info['#']['ACRONYM']['0']['#']);
$stat->description = backup_todb($stat_info['#']['DESCRIPTION']['0']['#']);
$stat->grade = backup_todb($stat_info['#']['GRADE']['0']['#']);
$stat->visible = backup_todb($stat_info['#']['VISIBLE']['0']['#']);
$stat->deleted = backup_todb($stat_info['#']['DELETED']['0']['#']);
//if user's data not required, we don't restore invisible and deleted statuses
if (!restore_userdata_selected($restore, 'attforblock', $old_attforblock_id)
and (!$stat->visible or $stat->deleted)) {
continue;
}
$newid = insert_record ('attendance_statuses', $stat);
$oldidarray[$old_attforblock_id]['attendance_statuses'][backup_todb($stat_info['#']['ID']['0']['#'])] = $newid;
}
} elseif (isset($info['MOD']['#']['ATTFORBLOCK_SETTINGS'])) {
$stats = $info['MOD']['#']['ATTFORBLOCK_SETTINGS']['0']['#']['ROWS'];
for($i = 0; $i < sizeof($stats); $i++) {
$stat_info = $stats[$i];
//Now, build the attforblock_STATUS record structure
$stat->courseid = $restore->course_id;
$stat->acronym = backup_todb($stat_info['#']['ACRONYM']['0']['#']);
$stat->description = backup_todb($stat_info['#']['DESCRIPTION']['0']['#']);
$stat->grade = backup_todb($stat_info['#']['GRADE']['0']['#']);
$stat->visible = 1;
$stat->deleted = 0;
$newid = insert_record ('attendance_statuses', $stat);
$oldidarray[$old_attforblock_id]['attendance_statuses'][backup_todb($stat_info['#']['STATUS']['0']['#'])] = $newid;
}
} else {
// ATTFORBLOCK_SETTINGS tag don't exists
// so course used default statuses (can be only in old version)
$stats = get_records('attendance_statuses', 'courseid', 0, 'id ASC');
$oldstats = array('P', 'A', 'L', 'E');
$i = 0;
foreach($stats as $stat) {
// $stat = $stats[$i];
$stat->courseid = $restore->course_id;
$newid = insert_record('attendance_statuses', $stat);
$oldidarray[$old_attforblock_id]['attendance_statuses'][$oldstats[$i++]] = $newid;
// $i++;
}
}
return $status;
}
function attforblock_restore_attendance_log ($old_attforblock_id, $new_attforblock_id,$info,$restore) {
global $CFG, $oldidarray;
$status = true;
//Get the logs array
if (isset($info['MOD']['#']['LOGS'])) {
@$logs = $info['MOD']['#']['LOGS']['0']['#']['LOG'];
} else {
@$logs = $info['MOD']['#']['ATTFORBLOCK_LOG']['0']['#']['ROWS'];
}
$stats = get_records_menu('attendance_statuses', 'courseid', $restore->course_id);
$statslist = implode(',', array_keys($stats));
$sessions = get_records('attendance_sessions', 'courseid', $restore->course_id);
//Iterate over logs
for($i = 0; $i < sizeof($logs); $i++) {
$log_info = $logs[$i];
//Now, build the attforblock_LOG record structure
$log->studentid = backup_todb($log_info['#']['STUDENTID']['0']['#']);
$log->remarks = backup_todb($log_info['#']['REMARKS']['0']['#']);
$user = backup_getid($restore->backup_unique_code, 'user', $log->studentid);
if ($user) {
$log->studentid = $user->new_id;
}
if (isset($info['MOD']['#']['LOGS'])) {
$log->sessionid = $oldidarray[$old_attforblock_id]['attendance_sessions'][backup_todb($log_info['#']['SESSIONID']['0']['#'])];
$log->statusid = $oldidarray[$old_attforblock_id]['attendance_statuses'][backup_todb($log_info['#']['STATUSID']['0']['#'])];
$log->timetaken = backup_todb($log_info['#']['TIMETAKEN']['0']['#']);
$log->statusset = backup_todb($log_info['#']['STATUSSET']['0']['#']);
$ids = explode(',', $log->statusset);
foreach ($ids as $id) {
$new_ids[] = $oldidarray[$old_attforblock_id]['attendance_statuses'][$id];
}
$log->statusset = implode(',', $new_ids);
$log->takenby = backup_todb($log_info['#']['TAKENBY']['0']['#']);
$user = backup_getid($restore->backup_unique_code, 'user', $log->takenby);
if ($user) {
$log->takenby = $user->new_id;
}
} else { //Old version
// Catching bug of first version of backup
if (isset($oldidarray[$old_attforblock_id]['attendance_sessions'][backup_todb($log_info['#']['ATTSID']['0']['#'])])) {
$log->sessionid = $oldidarray[$old_attforblock_id]['attendance_sessions'][backup_todb($log_info['#']['ATTSID']['0']['#'])];
} else {
continue;
}
$log->statusid = $oldidarray[$old_attforblock_id]['attendance_statuses'][backup_todb($log_info['#']['STATUS']['0']['#'])];
$log->statusset = $statslist;
// $log->timetaken = get_field('attendance_sessions', 'lasttaken', 'id', $log->sessionid);
$log->timetaken = $sessions[$log->sessionid]->lasttaken;
$log->takenby = $sessions[$log->sessionid]->lasttakenby;
// $log->takenby = backup_todb($log_info['#']['TAKENBY']['0']['#']);
}
$newid = insert_record ('attendance_log', $log);
$oldidarray[$old_attforblock_id]['attendance_log'][backup_todb($log_info['#']['ID']['0']['#'])] = $newid;
//Do some output
if (($i+1) % 50 == 0) {
if (!defined('RESTORE_SILENTLY')) {
echo '.';
if (($i+1) % 1000 == 0) {
echo '<br />';
}
}
backup_flush(300);
}
}
return $status;
}
// function attforblock_restore_logs($restore,$log) {
//
// $status = true;
//
// return $status;
// }
?>

265
sessions.php

@ -0,0 +1,265 @@
<?PHP // $Id: sessions.php,v 1.2.2.3 2009/02/23 19:22:41 dlnsk Exp $
require_once('../../config.php');
require_once($CFG->libdir.'/blocklib.php');
require_once('locallib.php');
require_once('lib.php');
require_once('add_form.php');
require_once('update_form.php');
require_once('duration_form.php');
if (!function_exists('grade_update')) { //workaround for buggy PHP versions
require_once($CFG->libdir.'/gradelib.php');
}
$id = required_param('id', PARAM_INT);
$action = required_param('action', PARAM_ACTION);
if ($id) {
if (! $cm = get_record('course_modules', 'id', $id)) {
error('Course Module ID was incorrect');
}
if (! $course = get_record('course', 'id', $cm->course)) {
error('Course is misconfigured');
}
if (! $attforblock = get_record('attforblock', 'id', $cm->instance)) {
error("Course module is incorrect");
}
}
require_login($course->id);
if (! $user = get_record('user', 'id', $USER->id) ) {
error("No such user in this course");
}
if (!$context = get_context_instance(CONTEXT_MODULE, $cm->id)) {
print_error('badcontext');
}
require_capability('mod/attforblock:manageattendances', $context);
$navlinks[] = array('name' => $attforblock->name, 'link' => "view.php?id=$id", 'type' => 'activity');
$navlinks[] = array('name' => get_string($action, 'attforblock'), 'link' => null, 'type' => 'activityinstance');
$navigation = build_navigation($navlinks);
print_header("$course->shortname: ".$attforblock->name.' - '.get_string($action,'attforblock'), $course->fullname,
$navigation, "", "", true, "&nbsp;", navmenu($course));
//////////////////////////////////////////////////////////
// Adding sessions
//////////////////////////////////////////////////////////
if ($action === 'add') {
show_tabs($cm, $context, 'add');
$mform_add = new mod_attforblock_add_form('sessions.php', array('course'=>$course, 'cm'=>$cm, 'modcontext'=>$context));
if ($fromform = $mform_add->get_data()) {
$duration = $fromform->durtime['hours']*HOURSECS + $fromform->durtime['minutes']*MINSECS;
$now = time();
if (isset($fromform->addmultiply)) {
$startdate = $fromform->sessiondate;// + $fromform->stime['hour']*3600 + $fromform->stime['minute']*60;
$enddate = $fromform->sessionenddate + ONE_DAY; // because enddate in 0:0am
//get number of days
$days = (int)ceil(($enddate - $startdate) / ONE_DAY);
if($days <= 0)
error(get_string('wrongdatesselected','attforblock'), "sessions.php?id=$id&amp;action=add");
else {
add_to_log($course->id, 'attendance', 'multiply sessions added', 'mod/attforblock/manage.php?id='.$id, $user->lastname.' '.$user->firstname);
// Getting first day of week
$sdate = $startdate;
$dinfo = usergetdate($sdate);
if ($CFG->calendar_startwday === '0') { //week start from sunday
$startweek = $startdate - $dinfo['wday'] * ONE_DAY; //call new variable
} else {
$wday = $dinfo['wday'] === 0 ? 7 : $dinfo['wday'];
$startweek = $startdate - ($wday-1) * ONE_DAY;
}
// Adding sessions
$wdaydesc = array(0=>'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
while ($sdate < $enddate) {
if($sdate < $startweek + ONE_WEEK) {
$dinfo = usergetdate($sdate);
if(key_exists($wdaydesc[$dinfo['wday']] ,$fromform->sdays)) {
//check whether this date there is in our session days
// if(count_records('attendance_sessions', 'courseid', $course->id, 'sessdate', $sdate) > 0) {
// notify(strftime(get_string('strftimedmy', 'attforblock'), $sdate).': '.get_string('sessionexist','attforblock'));
// $sdate += ONE_DAY;
// continue;
// }
$rec->courseid = $course->id;
$rec->sessdate = $sdate;
$rec->duration = $duration;
$rec->description = $fromform->sdescription;
$rec->timemodified = $now;
if(!insert_record('attendance_sessions', $rec))
error(get_string('erroringeneratingsessions','attforblock'), "sessions.php?id=$id&amp;action=add");
}
$sdate += ONE_DAY;
} else {
$startweek += ONE_WEEK * $fromform->period;
$sdate = $startweek;
}
}
notice(get_string('sessionsgenerated','attforblock'));
}
} else {
// insert one session
$rec->courseid = $course->id;
$rec->sessdate = $fromform->sessiondate;
$rec->duration = $duration;
$rec->description = $fromform->sdescription;
$rec->timemodified = $now;
if(insert_record('attendance_sessions', $rec)) {
add_to_log($course->id, 'attendance', 'one session added', 'mod/attforblock/manage.php?id='.$id, $user->lastname.' '.$user->firstname);
notice(get_string('sessionadded','attforblock'));
} else
error(get_string('errorinaddingsession','attforblock'), "sessions.php?id=$id&amp;action=add");
}
}
$mform_add->display();
}
//////////////////////////////////////////////////////////
// Updating sessions
//////////////////////////////////////////////////////////
if ($action === 'update') {
$sessionid = required_param('sessionid');
$mform_update = new mod_attforblock_update_form('sessions.php', array('course'=>$course,
'cm'=>$cm,
'modcontext'=>$context,
'sessionid'=>$sessionid));
if ($mform_update->is_cancelled()) {
redirect('manage.php?id='.$id);
}
if ($fromform = $mform_update->get_data()) {
if (!$att = get_record('attendance_sessions', 'id', $sessionid) ) {
error('No such session in this course');
}
// $newdate = mktime($newhour, $newminute, 0, $newmonth, $newday, $newyear); //new variables called here
//check for duplicate
// $count = count_records('attendance_sessions','courseid', $course->id, 'sessdate', $newdate);
// if($count != 0 && $newdate != $att->sessdate) //duplicate session exists
// error(get_string('sessionalreadyexists','attforblock'),"sessions.php?id=".$id."&amp;sessionid=".
// $sessionid."&amp;sessdate=".$att->sessdate."&amp;action=update");
// else
// {
//update session
$att->sessdate = $fromform->sessiondate;
$att->duration = $fromform->durtime['hours']*HOURSECS + $fromform->durtime['minutes']*MINSECS;
$att->description = $fromform->sdescription;
$att->timemodified = time();
update_record('attendance_sessions', $att);
add_to_log($course->id, 'attendance', 'Session updated', 'mod/attforblock/manage.php?id='.$id, $user->lastname.' '.$user->firstname);
//notice(get_string('sessionupdated','attforblock'), 'manage.php?id='.$id);
redirect('manage.php?id='.$id, get_string('sessionupdated','attforblock'), 3);
// }
}
print_heading(get_string('update','attforblock').' ' .get_string('attendanceforthecourse','attforblock').' :: ' .$course->fullname);
$mform_update->display();
}
//////////////////////////////////////////////////////////
// Deleting sessions
//////////////////////////////////////////////////////////
if ($action === 'delete') {
$sessionid = required_param('sessionid');
$confirm = optional_param('confirm');
if (!$att = get_record('attendance_sessions', 'id', $sessionid) ) {
error('No such session in this course');
}
if (isset($confirm)) {
delete_records('attendance_log', 'sessionid', $sessionid);
delete_records('attendance_sessions', 'id', $sessionid);
add_to_log($course->id, 'attendance', 'Session deleted', 'mod/attforblock/manage.php?id='.$id, $user->lastname.' '.$user->firstname);
$attforblockrecord = get_record('attforblock', 'course', $course->id);
attforblock_update_grades($attforblockrecord);
redirect('manage.php?id='.$id, get_string('sessiondeleted','attforblock'), 3);
}
print_heading(get_string('deletingsession','attforblock').' :: ' .$course->fullname);
notice_yesno(get_string('deletecheckfull', '', get_string('session', 'attforblock')).
'<br /><br />'.userdate($att->sessdate, get_string('strftimedmyhm', 'attforblock')).': '.
($att->description ? $att->description : get_string('nodescription', 'attforblock')),
"sessions.php?id=$id&amp;sessionid=$sessionid&amp;action=delete&amp;confirm=1", $_SERVER['HTTP_REFERER']);
}
if ($action === 'deleteselected') {
$confirm = optional_param('confirm');
if (isset($confirm)) {
$sessionid = required_param('sessionid');
$ids = implode(',', explode('_', $sessionid));
delete_records_select('attendance_log', "sessionid IN ($ids)");
delete_records_select('attendance_sessions', "id IN ($ids)");
add_to_log($course->id, 'attendance', 'Several sessions deleted', 'mod/attforblock/manage.php?id='.$id, $user->lastname.' '.$user->firstname);
$attforblockrecord = get_record('attforblock','course',$course->id);
attforblock_update_grades($attforblockrecord);
redirect('manage.php?id='.$id, get_string('sessiondeleted','attforblock'), 3);
}
$fromform = data_submitted();
$slist = implode(',', array_keys($fromform->sessid));
$sessions = get_records_list('attendance_sessions', 'id', $slist, 'sessdate');
print_heading(get_string('deletingsession','attforblock').' :: ' .$course->fullname);
$message = '<br />';
foreach ($sessions as $att) {
$message .= '<br />'.userdate($att->sessdate, get_string('strftimedmyhm', 'attforblock')).': '.
($att->description ? $att->description : get_string('nodescription', 'attforblock'));
}
$slist = implode('_', array_keys($fromform->sessid));
notice_yesno(get_string('deletecheckfull', '', get_string('sessions', 'attforblock')).$message,
"sessions.php?id=$id&amp;sessionid=$slist&amp;action=deleteselected&amp;confirm=1", $_SERVER['HTTP_REFERER']);
}
//////////////////////////////////////////////////////////
// Change duration
//////////////////////////////////////////////////////////
if ($action === 'changeduration') {
$fromform = data_submitted();
$slist = isset($fromform->sessid) ? implode('_', array_keys($fromform->sessid)) : '';
$mform_duration = new mod_attforblock_duration_form('sessions.php', array('course'=>$course,
'cm'=>$cm,
'modcontext'=>$context,
'ids'=>$slist));
if ($mform_duration->is_cancelled()) {
redirect('manage.php?id='.$id);
}
if ($fromform = $mform_duration->get_data()) {
$now = time();
$slist = implode(',', explode('_', $fromform->ids));
if (!$sessions = get_records_list('attendance_sessions', 'id', $slist) ) {
error('No such session in this course');
}
foreach ($sessions as $sess) {
$sess->duration = $fromform->durtime['hours']*HOURSECS + $fromform->durtime['minutes']*MINSECS;
$sess->timemodified = $now;
update_record('attendance_sessions', $sess);
}
add_to_log($course->id, 'attendance', 'Session updated', 'mod/attforblock/manage.php?id='.$id, $user->lastname.' '.$user->firstname);
redirect('manage.php?id='.$id, get_string('sessionupdated','attforblock'), 3);
}
print_heading(get_string('update','attforblock').' ' .get_string('attendanceforthecourse','attforblock').' :: ' .$course->fullname);
$mform_duration->display();
}
print_footer($course);
?>

69
update_form.php

@ -0,0 +1,69 @@
<?php // $Id: update_form.php,v 1.3.2.2 2009/02/23 19:22:42 dlnsk Exp $
require_once($CFG->libdir.'/formslib.php');
class mod_attforblock_update_form extends moodleform {
function definition() {
global $CFG;
$mform =& $this->_form;
$course = $this->_customdata['course'];
$cm = $this->_customdata['cm'];
// $coursecontext = $this->_customdata['coursecontext'];
$modcontext = $this->_customdata['modcontext'];
$sessionid = $this->_customdata['sessionid'];
if (!$att = get_record('attendance_sessions', 'id', $sessionid) ) {
error('No such session in this course');
}
$mform->addElement('header', 'general', get_string('changesession','attforblock'));
$mform->setHelpButton('general', array('changesession', get_string('changesession','attforblock'), 'attforblock'));
$mform->addElement('static', 'olddate', get_string('olddate','attforblock'), userdate($att->sessdate, get_string('strftimedmyhm', 'attforblock')));
$mform->addElement('date_time_selector', 'sessiondate', get_string('newdate','attforblock'));
for ($i=0; $i<=23; $i++) {
$hours[$i] = sprintf("%02d",$i);
}
for ($i=0; $i<60; $i+=5) {
$minutes[$i] = sprintf("%02d",$i);
}
$durselect[] =& MoodleQuickForm::createElement('select', 'hours', '', $hours);
$durselect[] =& MoodleQuickForm::createElement('select', 'minutes', '', $minutes, false, true);
$mform->addGroup($durselect, 'durtime', get_string('duration','attforblock'), array(' '), true);
$mform->addElement('text', 'sdescription', get_string('description', 'attforblock'), 'size="48"');
$mform->setType('sdescription', PARAM_TEXT);
$mform->addRule('sdescription', get_string('maximumchars', '', 100), 'maxlength', 100, 'client');
$dhours = floor($att->duration / HOURSECS);
$dmins = floor(($att->duration - $dhours * HOURSECS) / MINSECS);
$mform->setDefaults(array('sessiondate' => $att->sessdate,
'durtime' => array('hours'=>$dhours, 'minutes'=>$dmins),
'sdescription' => $att->description));
//-------------------------------------------------------------------------------
// buttons
$submit_string = get_string('update', 'attforblock');
$this->add_action_buttons(true, $submit_string);
$mform->addElement('hidden', 'id', $cm->id);
$mform->addElement('hidden', 'sessionid', $sessionid);
$mform->addElement('hidden', 'action', 'update');
}
// function validation($data, $files) {
// $errors = parent::validation($data, $files);
// if (($data['timeend']!=0) && ($data['timestart']!=0)
// && $data['timeend'] <= $data['timestart']) {
// $errors['timeend'] = get_string('timestartenderror', 'forum');
// }
// return $errors;
// }
}
?>

11
version.php

@ -0,0 +1,11 @@
<?PHP // $Id: version.php,v 1.5.2.5 2009/02/28 19:20:15 dlnsk Exp $
/////////////////////////////////////////////////////////////////////////////////
/// Code fragment to define the version of attforblock
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
$module->version = 2009022800; // The current module version (Date: YYYYMMDDXX)
$module->release = '2.1.1';
$module->cron = 0; // Period for cron to check this module (secs)
?>

118
view.php

@ -0,0 +1,118 @@
<?PHP // $Id: view.php,v 1.3.2.2 2009/02/23 19:22:41 dlnsk Exp $
/// This page prints a particular instance of attforblock
/// (Replace attforblock with the name of your module)
require_once("../../config.php");
require_once('locallib.php');
$id = optional_param('id', -1, PARAM_INT); // Course Module ID, or
// $a = optional_param('a', -1, PARAM_INT); // attforblock ID
$studentid = optional_param('student', 0, PARAM_INT);
$printing = optional_param('printing');
$mode = optional_param('mode', 'thiscourse');
if ($id) {
if (! $cm = get_record("course_modules", "id", $id)) {
error("Course Module ID was incorrect");
}
if (! $course = get_record("course", "id", $cm->course)) {
error("Course is misconfigured");
}
if (! $attforblock = get_record("attforblock", "id", $cm->instance)) {
error("Course module is incorrect");
}
} else {
error("Module id is incorrect.");
// if (! $attforblock = get_record("attforblock", "id", $a)) {
// error("Course module is incorrect");
// }
// if (! $course = get_record("course", "id", $attforblock->course)) {
// error("Course is misconfigured");
// }
// if (! $cm = get_coursemodule_from_instance("attforblock", $attforblock->id, $course->id)) {
// error("Course Module ID was incorrect");
// }
}
require_login($course->id);
if (!$context = get_context_instance(CONTEXT_MODULE, $cm->id)) {
print_error('badcontext');
}
if (!$studentid && (has_capability('mod/attforblock:manageattendances', $context) ||
has_capability('mod/attforblock:takeattendances', $context) ||
has_capability('mod/attforblock:changeattendances', $context))) {
redirect("manage.php?id=$cm->id");
}
if (!$studentid && has_capability('mod/attforblock:viewreports', $context)) {
redirect("report.php?id=$cm->id");
}
if (! $user = get_record('user', 'id', $USER->id) ) {
error("No such user in this course");
}
require_capability('mod/attforblock:view', $context);
$student = false;
if ($studentid) {
if ($studentid == $USER->id or has_capability('mod/attforblock:viewreports', $context)) {
if (!$student = get_record('user', 'id', $studentid) ) {
error("No such user in this course");
}
}
}
// if (empty($student) && has_capability('mod/attforblock:manageattendances', $context)) {
// redirect("manage.php?id=$cm->id");
// }
if ($student) {
$user = $student;
}
if ($printing) {
if ($mode === 'thiscourse') {
print_header('', $course->fullname.' - '.get_string('attendancereport','attforblock'));
print_user_attendaces($user, $cm, $course, 'printing');
} else {
print_header('', get_string('attendancereport','attforblock'));
print_user_attendaces($user, $cm, 0, 'printing');
}
exit();
}
/// Print headers
$navlinks[] = array('name' => $attforblock->name, 'link' => "view.php?id=$id", 'type' => 'activityinstance');
$navlinks[] = array('name' => get_string('attendancereport', 'attforblock'), 'link' => null, 'type' => 'title');
$navigation = build_navigation($navlinks);
print_header("$course->shortname: ".$attforblock->name.' - ' .get_string('export', 'quiz'), $course->fullname,
$navigation, "", "", true, "&nbsp;", navmenu($course));
//add info to log
add_to_log($course->id, 'attendance', 'student view', "mod/attforblock/view.php?course=$course->id&amp;student=$USER->id", $USER->lastname.' '.$USER->firstname);
// print_heading(get_string('attendanceforthecourse','attforblock').' :: ' .$course->fullname);
/// Prints out tabs
$currenttab = $mode;
$studstr = $student ? '&amp;student='.$student->id : '';
$toprow = array();
$toprow[] = new tabobject('thiscourse', "view.php?id=$id&amp;mode=thiscourse{$studstr}",
get_string('thiscourse','attforblock'));
$toprow[] = new tabobject('allcourses', "view.php?id=$id&amp;mode=allcourses{$studstr}",
get_string('allcourses','attforblock'));
print_tabs(array($toprow), $currenttab);
if ($mode === 'thiscourse') {
print_user_attendaces($user, $cm, $course);
} else {
print_user_attendaces($user, $cm);
}
print_footer($course);
?>
Loading…
Cancel
Save