Skip to content

Commit

Permalink
Initial commit. Version 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
andreev-artem committed Jul 9, 2010
0 parents commit bdaf527
Show file tree
Hide file tree
Showing 17 changed files with 987 additions and 0 deletions.
680 changes: 680 additions & 0 deletions CHANGES

Large diffs are not rendered by default.

123 changes: 123 additions & 0 deletions READ ME.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
*********************************************************************************************
****** WARNING: THIS MODULE AND BLOCK ARE IN DEVELOPMENT. USE WITH CAUTION ******
*********************************************************************************************

--------------
RELEASE NOTES
--------------
1.0.1 - 09/16/2005 Lady800cc [moodle.org member]
- Fixed problems with permissions for teachers
- Changed date output to include day of week

1.0.2 - 9 nov 2005 Dmitry Pupinin [moodle.org member]
+ added Report tab
+ taking attendances, view reports by groups
* timestamp used in database (database will automaticaly update)
* source code generaly modified with moodle's standarts
* percents calculation modified (excused means present)

1.0.3 - 9 jan 2006 Dmitry Pupinin [moodle.org member]
+ grading attendances
+ grade weight can be different for each course (may be a negative)
+ grade added to GRADEBOOK (by means of special module "Attendance for Block")
+ different intervals for Report (weeks, months, all)
+ creating multiply sessions in any time
+ description for each session
+ support Postgres (not tested!)

1.0.4 - 17 jan 2006 Dmitry Pupinin [moodle.org member]
* bug fixed: if pages was open from outside moodle error displayed instead login page
* bug fixed: Postgres syntax error (thanks to Michael Deane)

1.0.5 - 23 jan 2006 Dmitry Pupinin [moodle.org member]
+ group names added to Excel and Text reports (if groups exist)
+ attendance displayed on user's quick and full report pages
+ students sort possibility in report
+ user's names is links now
* log messages updated
* bug fixed: guest can't see anything now
* bug fixed: isteacher() was called without parameters

1.0.6 - 2 feb 2006 Dmitry Pupinin [moodle.org member]
+ dates in head of report table is links to update attendance
+ percent calculating is updated (see Q&A in bottom of this page)
+ each acronym in table head on "Update attendance" page now works as "Select All" for radiobuttons in
his column (thanks to Michael Deane for idea)
+ date formats define in langs
* bug fixed: not all users were in Excel and Text exports

1.0.7 - 25 feb 2006 - Dmitry Pupinin [moodle.org member]
+ user's pictures added to Report and Update pages
+ icons (edit, delete) taking from themes
+ possibility to add sessions for every week or using period
* Postgres support improved
* supporting servers with php directive "short_open_tag=Off" (was used only <?php tag)
* bug fixed: Division by zero
* bug fixed: Notice displayed if selected group is empty
! not a bug: Adding multiple sessions cause warning and don't work (see description on http://moodle.org/mod/forum/discuss.php?d=38987#186029)

1.0.8 - 13 jul 2006 - Dmitry Pupinin [moodle.org member]
* bug fixed: acronyms and descriptions took from lang rather then course settings
* bug fixed: default acronyms displayed in report and exports
* bug fixed: warning on Admin page (v1.6) in Debug mode
* defaults of variables moved in context help
+ indexes added to database
+ student's view improved
+ user's name and surname in tables now is link to "student view" for instructor. User's picture is link to student details.
+ "version for printing" added to "student view"
+ utf migrating

1.0.9 - 20 feb 2007 - Dmitry Pupinin [moodle.org member]
+ attendances are showing from course's start date (use it when new semester starts)

1.1.0 - 10 may 2007 - Dmitry Pupinin [moodle.org member]
* bug fixed: remark for user can move to other user
* bug fixed: when group selected list of users not sorting
! IMPORTANT: This version is last for Moodle 1.6 (only critical bugfixes can be)

2.0 - 10 may 2007 - Dmitry Pupinin [moodle.org member]
* code rewrited. Now this is Module with block.
* this version only compatible with latest Moodle 1.8 (without grouping!)

2.0.1 - 02 jul 2007 - Dmitry Pupinin [moodle.org member]
* bug fixed: course id in block. Now using $COURSE

--------
ABOUT
--------
This is version 2.0.x of the attendance block. It is still IN DEVELOPMENT and should not be considered a stable release unless otherwise noted. It has been tested on Moodle 1.8+, MySQL and PHP 4.4+.

The attendance block was start development by the Human Logic Development Team, Dubai, UAE.
Visit them online at www.human-logic.com

Development of 1.0 branch was continue by Dmitry Pupinin (dlnsk at ngs dot ru). This branch isn't compatibly with version 1.2 from Human Logic!

Change the major number to 2.0 is way to show greater differences of new version from version 1.0.x and 1.2 from Human Logic! In this version main part of code moved to module attforblock! Now block is just additional feature for module.

More information about attforblock module read in corresponding directory.

This module and 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 block 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.

--------------
QUESTIONS ?
--------------
If you have questions, concerns or comments about this branch of block, you can post to either the Moodle forums or contact me directly at dlnsk at ngs dot ru

Q: Why attendance percent on pages of block don't equal to percent in Gradebook?
A: Gradebook display how much points student had in this course in comparison with how much he could have. Pages of block display percent of attendance. For example, if student for presence had 3 points and for absence had 1 point then he can't have 0% in Gradebook even though he was absent always, but on block pages in this situation he will have exactly 0%.



Thanks!
7 changes: 7 additions & 0 deletions ToDo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This is ToDo's list from high priority to low:

1. Migration to UTF [READY]
2. Periods and multiply session on the same day [READY]
3. Backuping [READY]
4. Group mode (separated attendance for each group) [READY]
5. Self taking attendance for students
73 changes: 73 additions & 0 deletions block_attendance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?PHP

class block_attendance extends block_base {

function init() {
$this->title = get_string('blockname','block_attendance');
$this->version = 2009022400;
$this->release = '2.1.0';
}

function get_content() {
global $CFG, $USER, $COURSE;

if ($this->content !== NULL) {
return $this->content;
}

$this->content = new stdClass;
$this->content->footer = '';
$this->content->text = '';

if (!$att = array_pop(get_all_instances_in_course('attforblock', $COURSE, NULL, true))) {
$this->content->text = get_string('needactivity','block_attendance');;
return $this->content;
}
$cmid = $att->coursemodule;
require_once($CFG->dirroot.'/mod/attforblock/locallib.php');

if (!$context = get_context_instance(CONTEXT_MODULE, $cmid)) {
print_error('badcontext');
}

// link to attendance
if (has_capability('mod/attforblock:takeattendances', $context) or has_capability('mod/attforblock:changeattendances', $context)) {
$this->content->text .= '<a href="'.$CFG->wwwroot.'/mod/attforblock/manage.php?id='.$cmid.'&amp;from=block">'.get_string('takeattendance','attforblock').'</a><br />';
}
if (has_capability('mod/attforblock:manageattendances', $context)) {
$this->content->text .= '<a href="'.$CFG->wwwroot.'/mod/attforblock/sessions.php?id='.$cmid.'&amp;action=add">'.get_string('add','attforblock').'</a><br />';
}
if (has_capability('mod/attforblock:viewreports', $context)) {
$this->content->text .= '<a href="'.$CFG->wwwroot.'/mod/attforblock/report.php?id='.$cmid.'&amp;view=weeks">'.get_string('report','attforblock').'</a><br />';
}
if (has_capability('mod/attforblock:export', $context)) {
$this->content->text .= '<a href="'.$CFG->wwwroot.'/mod/attforblock/export.php?id='.$cmid.'">'.get_string('export','quiz').'</a><br />';
}
if (has_capability('mod/attforblock:changepreferences', $context)) {
$this->content->text .= '<a href="'.$CFG->wwwroot.'/mod/attforblock/attsettings.php?id='.$cmid.'">'.get_string('settings','attforblock').'</a><br />';
}

if (isstudent($COURSE->id) && has_capability('mod/attforblock:view', $context)) {
$complete = get_attendance($USER->id,$COURSE);
if($complete == 0) { //attendance not generated yet
$this->content->text .= get_string('attendancenotstarted','attforblock');
} else { //attendance taken
$statuses = get_statuses($COURSE->id);
foreach($statuses as $st) {
$this->content->text .= $st->description.':&nbsp;'.get_attendance($USER->id,$COURSE,$st->id).'<br />';
}
$percent = get_percent($USER->id, $COURSE);
$grade = get_grade($USER->id, $COURSE);

$this->content->text .= get_string('attendancepercent','attforblock').':&nbsp;'.$percent.'&nbsp;%<br />';
$this->content->text .= get_string('attendancegrade','attforblock').":&nbsp;$grade<br />";

$this->content->text .= '<a href="'.$CFG->wwwroot.'/mod/attforblock/view.php?id='.$cmid.'">'.get_string('indetail','attforblock').'</a>';
}
}

return $this->content;
}
}

?>
8 changes: 8 additions & 0 deletions lang/cs_utf8/block_attendance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?PHP // $Id: block_attendance.php,v 1.1.2.1 2009/03/10 11:20:02 dlnsk Exp $
// block_attendance.php - created with Moodle 1.5.3+ (2005060230)


$string['blockname'] = 'Docházka';
$string['needactivity'] = 'Tento blok funguje pouze s aktivní činností Docházka v tomto kurzu. Prosím přidejte tuto činnost do kurzu.';

?>
7 changes: 7 additions & 0 deletions lang/de/block_attendance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?PHP // $Id: block_attendance.php,v 1.2.10.1 2009/02/23 19:18:55 dlnsk Exp $
// block_attendance.php - created with Moodle 1.5.3+ (2005060230)


$string['blockname'] = 'Anwesenheit';

?>
11 changes: 11 additions & 0 deletions lang/en_us_utf8/README
Original file line number Diff line number Diff line change
@@ -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 changes: 10 additions & 0 deletions lang/en_us_utf8/block_attendance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?PHP // $Id: block_attendance.php,v 1.1 2007/07/06 18:49:06 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';

?>
8 changes: 8 additions & 0 deletions lang/en_utf8/block_attendance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?PHP // $Id: block_attendance.php,v 1.7.2.1 2009/02/23 19:18:56 dlnsk Exp $
// block_attendance.php - created with Moodle 1.5.3+ (2005060230)


$string['blockname'] = 'Attendance';
$string['needactivity'] = 'This block can work only with an attendance activity. Please add the activity to this course.';

?>
8 changes: 8 additions & 0 deletions lang/es_utf8/block_attendance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?PHP // $Id: block_attendance.php,v 1.1.4.3 2009/02/23 19:18:56 dlnsk Exp $
// block_attendance.php - created with Moodle 1.5.3+ (2005060230)


$string['blockname'] = 'Asistencia';
$string['needactivity'] = 'Este Bloque solo puede trabajar con la actividad Asistencia. Por favor, añada la actividad asistencia a este curso/asignatura';

?>
7 changes: 7 additions & 0 deletions lang/eu_utf8/block_attendance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?PHP // $Id: block_attendance.php,v 1.1.6.1 2009/02/23 19:18:56 dlnsk Exp $
// block_attendance.php - created with Moodle 1.7.1+ (2006101010)


$string['blockname'] = 'Asistentzia';

?>
8 changes: 8 additions & 0 deletions lang/fr_utf8/block_attendance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?PHP // $Id: block_attendance.php,v 1.1.2.3 2009/02/23 19:18:56 dlnsk Exp $
// block_attendance.php - created with Moodle 1.5.3+ (2005060230)


$string['blockname'] = 'Présence';
$string['needactivity'] = 'Ce bloc fonctionne uniquement avec une activité Présence. Veuillez ajouter cette activité à ce cours.';

?>
7 changes: 7 additions & 0 deletions lang/it/block_attendance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?PHP // $Id: block_attendance.php,v 1.1.10.1 2009/02/23 19:18:56 dlnsk Exp $
// block_attendance.php - created with Moodle 1.5.3+ (2005060230)


$string['blockname'] = 'Presenze';

?>
8 changes: 8 additions & 0 deletions lang/ja_utf8/block_attendance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?PHP // $Id: block_attendance.php,v 1.1.10.3 2009/04/07 17:24:08 dlnsk Exp $
// block_attendance.php - created with Moodle 2.0 dev (Build: 20090403) (2009040100)


$string['blockname'] = '出欠';
$string['needactivity'] = 'このブロックは出欠活動のみと動作します。このコースに出欠活動を追加してください。';

?>
8 changes: 8 additions & 0 deletions lang/ru_utf8/block_attendance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?PHP // $Id: block_attendance.php,v 1.4.2.1 2009/02/23 19:18:56 dlnsk Exp $
// block_attendance.php - created with Moodle 1.8.2+ (2007021520)


$string['blockname'] = 'Посещаемость';
$string['needactivity'] = 'Данный блок работает только вместе с элементом курса Посещаемость. Пожалуйста добавьте этот элемент курса.';

?>
7 changes: 7 additions & 0 deletions lang/sk_utf8/block_attendance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?PHP // $Id: block_attendance.php,v 1.1.10.1 2009/02/23 19:18:57 dlnsk Exp $
// block_attendance.php - created with Moodle 1.5.3+ (2005060230)


$string['blockname'] = 'Účasť';

?>
7 changes: 7 additions & 0 deletions lang/sv/block_attendance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?PHP // $Id: block_attendance.php,v 1.1.10.1 2009/02/23 19:18:57 dlnsk Exp $
// block_attendance.php - created with Moodle 1.6 development (2005101200)


$string['blockname'] = 'Närvaro';

?>

0 comments on commit bdaf527

Please sign in to comment.