Note: You are currently viewing documentation for Moodle 2.9. Up-to-date documentation for the latest stable version of Moodle may be available here: Attendance module.

Attendance module: Difference between revisions

From MoodleDocs
(partially updated the page to conform to v2.4.0 (beta) by Dmitry Pupinin and Artem Andreev)
(remove some old cruft.)
 
(17 intermediate revisions by 8 users not shown)
Line 1: Line 1:
The '''Attendance''' module is designed for ''teachers to be able take attendance'' during class, and for ''students to be able to view their own attendance record''. A teacher can mark the attendance status of a student as Present, Absent, Late, or Excused. These descriptions are configurable.
{{Infobox plugin
|type = Activity module and optional block
|entry = https://moodle.org/plugins/browse.php?list=set&id=36
|tracker = https://github.com/danmarsden/moodle-mod_attendance/issues
|discussion = https://moodle.org/mod/forum/view.php?id=741
|maintainer = [[User:Dan Marsden|Dan Marsden]]
|float = right
}}


== General ==
== Quick update, July 2013 ==


See the [http://moodle.org/mod/forum/view.php?id=741 Attendance module forum] for discussion and support on this module.
# [https://moodle.org/mod/forum/discuss.php?d=228684#p997183 Artem Andreev] is no longer working on this plugin, [https://moodle.org/mod/forum/discuss.php?d=228684#p1006980 Dan Marsden] is now maintaining the plugin.
# The old module was previously named 'attforblock' and has now been renamed to 'attendance'
# at this stage no restore code has been written to allow backup files with old style "attforblock" to be restored into the renamed module.
#See the [http://moodle.org/mod/forum/view.php?id=741 Attendance module forum] for discussion and support on this module.
#Location on GIT of the recent versions: [http://github.com/danmarsden/moodle-mod_attendance Attendance module], [http://github.com/danmarsden/moodle-block_attendance Attendance block]


Currently (July 2012), there is a version 2.4.0 of this module available for Moodle v2.0, which is apparently still in beta. It can be downloaded as a zip file at [https://github.com/andreev-artem/moodle_mod_attforblock/zipball/MDL_20 https://github.com/andreev-artem/moodle_mod_attforblock/zipball/MDL_20] or downloaded via Git at [https://github.com/andreev-artem/moodle_mod_attforblock/tree/MDL_20 https://github.com/andreev-artem/moodle_mod_attforblock/tree/MDL_20], as reported in [http://moodle.org/mod/forum/discuss.php?d=181299 this post].
===Introduction===
The '''Attendance''' [[Module|module]] is designed for ''teachers to be able take attendance'' during class, and for ''students to be able to view their own attendance record''.


The README file of the module warns that it is compatible only with Moodle v2.0, but the present editor has installed it for Moodle v2.3, and preliminary testing indicates that it works.
A teacher can mark the attendance status of a student as "Present", "Absent", "Late", or "Excused". These status descriptions are configurable, and more can be added. The teacher adds Attendance as an activity of a course, and then sets up the sessions whose attendance is to be tracked.


Note: there is no Attendance module listed in the new [http://moodle.org/plugins Moodle Plugins page]. (There is a plugin called Attendance Register, but that's different.) If and when someone publishes the new Attendance module there, please also update this page.
The Attendance module can generate reports for either the entire class or for individual students. Students may also see their own attendance record if the activity is not hidden.
 
The optional [[Attendance_block|Attendance block]] allows teachers quick access to the Attendance functionality, and allows students quick access to a summary report for their own attendance. (A [[Block|block]] is a user interface element that can be added to Moodle screens.)
 
=== History ===
 
Attendance was originally a Moodle [[Block|block]] developed by Russell Jungwirth in 2003 (see post [http://moodle.org/mod/forum/discuss.php?d=2431]). In 2005, [http://moodle.org/user/view.php?id=18237 Dmitry Pupinin] picked up the reins and released version 1.0.2, his first version of the Attendance block (see post [http://moodle.org/mod/forum/discuss.php?d=33132#p158189]). In May 2007, Dmitry released a new version 2.0 suitable for Moodle 1.8. This release was a dramatic restructuring of code that resulted in a significant [[Module|module]] along with a small block (see post [http://moodle.org/mod/forum/discuss.php?d=71597]). Dmitry continued to develop the module and block through 2010.
 
In November 2010, [http://moodle.org/user/profile.php?id=52322 Artem Andreev] updated the code to version 2.2 (see post [http://moodle.org/mod/forum/discuss.php?d=162960]) to add common and group session options and some user interface improvements. [http://moodle.org/user/view.php?id=1281787&course=5 Luis Ramón López] wrote modifications that added the ability to create multiple attendance instances in a single course; for example, one instance for laboratory activities and another instance for lecture periods (see post [http://moodle.org/mod/forum/discuss.php?d=162960#p724169]). Version 2.3 was released in January 2011. <!-- What is this version about, then? Why is it given alongside another version in the table in section Branches below? -->
 
Immediately after the release of version 2.3, work began on porting the code to Moodle 2.x. In July 2011, Artem released Attendance version 2.4.0 (see post [http://moodle.org/mod/forum/discuss.php?d=181299]), a rewrite of the code as a [[Module|module]] with an optional [[Block|block]] for use with Moodle 2.x only. In July 2012, Artem released a new branch of version 2.4.0 updated to work with Moodle 2.3.
 
In July 2013 Dan Marsden took over maintenance of the plugin and renamed the "attforblock" module to "attendance"
 
There is another unrelated attendance plugin in the plugins database: https://moodle.org/plugins/view.php?plugin=mod_attendanceregister
 
=== For developers ===
 
The current version of the Attendance block and the Attendance module are hosted on Dan Marsden's github site.
 
{| class="wikitable"
|-
! Module
! Block
|-
| [https://github.com/danmarsden/moodle-mod_attendance/tree/master https://github.com/danmarsden/moodle-mod_attendance/tree/master]
| [http://github.com/danmarsden/moodle-block_attendance/tree/master http://github.com/danmarsden/moodle-block_attendance/tree/master]
|}
 
 
== Upgrade from mod_attforblock to new mod_attendance ==
The new attendance module renames the attforblock module to attendance - when this module was first created you couldn't have a Module with the same name as a block - newer versions of Moodle allow this and in preparation for inclusion in the moodle.org plugins database we renamed "attforblock" to "attendance" - we have included some code to convert your old "attforblock" database entries to use the new "attendance" format.
# make sure you are running the latest attforblock code - the new attendance module will only allow upgrades from attforblock version 2012120700
# Download the new attendance module and install it in the usual place (in a folder called mod/attendance)
# remove the old "mod/attforblock" folder from your site (don't use the uninstall function in the admin menu unless you don't need to keep previously created attendance modules in your courses)
# Trigger the normal upgrade process by visiting admin > notifications and it will migrate the data from your old attforblock module to the newly named "attendance" module
 
=== Upgrade info for Developers/Admins ===
The rename of the module only changes one of the database table names - attforblock to attendance, all the other tables are already prefixed with 'attendance' so these aren't changed. The Moodle install process hits install.xml first which is a problem as it will fail as some of the tables listed in install.xml already exist. To work around this we abuse the mod/attendance/version.php file a bit. This file is included first when checking for upgrades so we do a check there to see if data from the old mod_attforblock still exists - it it does it renames the old 'attforblock' table to 'attendance' amd updates the record in the modules to rename it from 'attforblock' to 'attendance' - it also checks to make sure the old 'attforblock' directory has been deleted and will only upgrade from attforblock versions higher than 2012120700 - it's possible this could be improved, pull requests are welcome. After the upgrade has completed you may want to remove the upgrade code from version.php as it will result in an extra few db queries every time the version.php files are loaded to avoid the small unnecessary performance impact that the code causes.


== Installation ==
== Installation ==


First, read article [[Installing contributed modules or plugins]], if you haven't done so already.
First, make sure you're familiar with page [[Installing contributed modules or plugins]].


The installation can only be performed by a user who has (a) write access to the file structure on the computer hosting Moodle, and (b) administration rights for the Moodle installation.
The installation can only be performed by a user who has both write access to the file structure on the computer hosting Moodle and administrator rights for the Moodle installation.


* Log into the computer that hosts your Moodle installation.
=== Language files ===
* Download the zip file from  [https://github.com/andreev-artem/moodle_mod_attforblock/zipball/MDL_20 https://github.com/andreev-artem/moodle_mod_attforblock/zipball/MDL_20], and unpack it into an empty directory.
* Create the folder <code>&lt;path of your Moodle installation directory&gt;/mod/attforblock</code>.  (If you've installed Moodle in the standard location on a Linux system, that would be <code>/var/www/html/moodle/mod/attforblock</code>.)
* Copy the extracted files into the newly created folder. (On a Linux system, you'd use the command <code>sudo cp -r ~/andreev-artem-moodle_mod_attforblock-2e9d05a/* /var/www/html/moodle/mod/attforblock/</code>, assuming you'd extracted the ZIP files under your home directory and had installed Moodle in the standard location.)
* On Linux systems, make sure to change the owner and group of the copied files:
** Check the owner and group of the other files by commanding <code>ls -l /var/www/html/moodle</code>.
** Command <code>sudo chown -R &lt;user&gt;:&lt;group&gt; /var/www/html/moodle/mod/attforblock</code>, where <code>&lt;user&gt;</code> and <code>&lt;group&gt;</code> are the same as for the other files of the Moodle installation.
* In your browser, open the Moodle page, and log in as the administrator. You will be asked to complete the installation of the module. Click the "Update" button at the bottom. This will cause the Attendance database structure to be set up.


=== Language files ===
The ''language files'' for localizing the module are '''<code>.../attforblock/lang/</code>'''''language code'''''<code>/attforblock.php</code>'''. In order to customize the strings, you can
* either edit the language file(s) of the language(s) you're interested in, or
* edit the string definitions through Moodle itself when logged in as an administrator, via ''Settings &gt; Site administration &gt; Language &gt; Language customization''. '''(Note: this method doesn't seem to work as of 4 Aug. 2012)'''


The ''language files'' for localizing the module are <code>.../attforblock/lang/&lt;language code&gt;/attforblock.php</code>.  In order to customize the strings, you can edit the language file(s) of the language(s) you're interested in. You can do it through Moodle itself when logged in as an administrator, via Site administration &gt; Language &gt; Language customization.
Note that the '''date format''' is controlled by the language file you install. As an example, assume that you're using the '''<code>en_us</code>''' language file, which defines the date format as m.d.y.  In order to change the format to m/d/y, you could use the first method mentioned above, and edit the language definition file '''<code>.../attforblock/lang/en_us/attforblock.php</code>''' and change the string definitions into this:


Note that the '''date format''' is controlled by the language file you install. In the English language file (<code>.../attforblock/lang/en/attforblock.php</code>), the day.month.year format is used. If you prefer some other format, edit the following strings in the language file. (The US month.day.year format is used in this example.)
$string['strftimedm'] = '%m/%d';
$string['strftimedmy'] = '%m/%d/%Y';
$string['strftimedmyw'] = '%m/%d/%y&nbsp;(%a)';
$string['strftimeshortdate'] = '%m/%d/%Y';
$string['strftimedmyhm'] = '%m/%d/%Y %H:%M'; // line added to allow multiple sessions in the same day


$string['strftimedm'] = '%%m.%%d';
Another example: if you're using the '''<code>en</code>''' language file, and want to change the sting "Late" to "Tardy", you could use the second method mentioned above, namely: '''(Note: this method doesn't seem to work as of 4 Aug. 2012)'''
$string['strftimedmy'] = '%%m.%%d.%%Y';
* log in as an administrator;
$string['strftimedmyw'] = '%%m.%%d.%%y&nbsp;(%%a)';
* click ''Settings &gt; Site administration &gt; Language &gt; Language customization'';
$string['strftimeshortdate'] = '%%m.%%d.%%Y';
* choose "English (en)" from the pull-down menu, which is shown if more than one language pack has been installed;
* click on the ''Open language pack for editing'' button;
* after the language pack has been loaded, click on the ''Continue'' button;
* in the "Filter strings" screen's component list, scroll down to the bolded "mod" heading, and then click on the "attforblock.php" line under it;
** (note: you could also reduce the number of strings shown, for example by writing "Late" in the "Only strings containing" filter input line)
* click on the ''Show strings'' button;
* scroll down until you find the string ''Lfull'', whose definition is "Late";
* write "Tardy" in the edit box to the right;
* (you might also want to change the definition of the string ''Lacronym'' from "L" to "T";)
* click on the ''Save changes to the language pack'' button on the bottom of the screen; and
* in the confirmation screen, click on the ''Continue'' button.


Another option for getting US dates is to use the <code>en_us</code> language file instead of <code>en</code>. The former defines the date-related strings as given above, but defers to the <code>en</code> language file for all other strings.
== Teacher's usage instructions ==


== Using module in a class by a teacher ==
=== Adding an Attendance Activity instance ===


=== Adding an Attendance activity ===
After the attendance module has been properly installed, the teacher must add Attendance as an activity to each course they wish to keep attendance for. This is done by first ensuring that you are in the edit mode and then selecting "Add an activity or resource" in a Moodle [[Course_sections|section]] box. Note that you may now add as many instances of the Attendance module as you like, and that each instance may have multiple sections. Be sure to give the instance a name that indicates what it will be used for; for example, "Lecture Attendance". If you will be using groups in your course, set the Group mode accordingly, because even if groups exist in the course, you will not be able to use them within the Attendance module if you select ''No groups''.


After the attendance block and module have been properly installed, ''the teacher must add Attendance as an activity'' to each course they wish to keep attendance for. To do this:
Once you have added an attendance instance, you are ready to start taking attendance during classes.
* Ensure that you are in the edit mode.
* Display the main page of a course.
* Click on the "Add an activity or resource" link.
* Select the "Attendance" radio button in the dialog that now pops up, and then press "Add".
* Configure the Attendance activity. '''TO DO: add details here'''


After this, the attendance module can be used.
=== Adding an Attendance block to a course page ===


'''TO DO: update the instructions from this point down to reflect the new version of Attendance'''
For a shortcut to attendance information for both teachers and students, it is recommended that you install the associated [[Attendance_block|Attendance block]] (see the installation instructions above). If you have done so, you also need to add the Attendance block to your course page, like this:


However, the section link that was just added in the preceding paragraph is the "clunky way" to work with the attendance module. Of course, we DO want students to be able to view their attendance records, just not with that link. There is a second, better, way to accomplish this using the [[Attendance block]]. Select "Attendance" from the pull-down menu in the "Blocks" block. This will create a block with teacher options to take attendance, report on attendance, or change the attendance settings. The same block will instead have an attendance report for students.
* Turn editing on.
* Find the block entitled "Add a block."
* In the drop-down menu in this block, select ''Attendance'' to add the Attendance block.
* As always, move the block to fit your viewing preference.


=== Setting Attendance categories and grading options ===
=== Setting Attendance categories and grading options ===


Now it is time to set your attendance options. Select "Settings" from the attendance block. This brings you to the letters, descriptions, and grade (points) to assign for the four attendance options. By default these are Present, Absent, Late, and Excused. You may prefer to change the descriptions (e.g., change the word Late to Tardy), change the order, or change the way points are counted so make appropriate changes here to the names, order, and grades. Be sure to click the "Update" button when you are done.
Now it is time to set your attendance options. Select your attendance activity and you will see a bar of options, the last of which is "Settings." Select "Settings" and you are presented with acronyms, attendance status descriptions, and grade (points) to assign. By default, the status descriptions are "Present", "Absent", "Late", and "Excused".


=== Adding sessions ===
You may prefer to change the descriptions (for example, by changing "Late" to "Tardy"), change the way points are counted, or add new status descriptions. To do the latter, fill in the fifth line and click the ''Add'' button. Important: when you hit the ''Add'' button, any changes made to existing options that were made after the last time the ''Update'' button was used will be lost. Likewise, when you hit the ''Update'' button, any changes made to the ''Add'' after the last time the ''Add'' button was hit will be lost.


Next it is time to add sessions. Note that there is a restriction here. You can only have one session per day. Since you can only have one attendance activity installed (which means that you cannot have a lab attendance activity and a lecture attendance activity) and can only have one attendance session per day, if you have more than one class session per day you will have to be creative in taking attendance. And if you have more than seven class sessions for a single class in a week--then you are overworked!
Finally, when you are done changing items on this page, be sure to click the ''Update'' button to register the changes.


To add class sections, click the "Add" tab (second from left) at the top of the page (if you left the attendance page, select any of the three links from the attendance block to return to the attendance page and gain access to the "Add" tab). You have two options here, to add a single session or to add multiple sessions. The single session is self-explanatory as well as time consuming to use when you have many class sessions so I will go straight the more useful option, how to add multiple sessions.
=== Adding sessions ===


Under the "Create multiple sessions" label choose the date for the first session you wish to add followed by the date for the last session you wish to add. Next select the days of the week on which the class meets. The final option, frequency, may look confusing but it is actually straight-forward. If your class meets every week (the normal situation) then you want a frequency of 1 week which is the default. If your class meets every other week, then you want a frequency of 2 weeks, and so on. When you click the "Add multiple sessions" button, your sessions will be created and you will see a message indicating this.
Next, it is time to add sessions. To add class sections, click the ''Add'' tab (second from left) at the top of the Attendance page. Alternatively, you can click the ''Add'' button from the Attendance block (if you've installed it) to directly navigate to the page for adding sessions. If you chose "No groups", or have not defined groups, then the Session type will be forced to "Common." If you have defined groups and have chosen to use them in your course's Attendance activity, then you will have the option to create sessions for a group or all students.


=== Taking attendance ===
You have two options for adding sessions, adding a single session or adding multiple sessions. The single session is self-explanatory as well as time-consuming to use when you have many class sessions, so we will go straight to the more useful option.


Now head to the attendance tab. Here you see the list of all attendance sessions you have added. You can delete an individual session by clicking the X to the right of it. (Personal note, it sure would be nice if there was an option to select a few sessions and delete them all at once--I use the multiple sessions option to put my sessions in for the entire semester and then have to go and remove sessions for vacation days one at a time.) You can edit a session (change the date or add a description) with the standard hand icon to the right of the session, or you can take attendance for a session by clicking the green radio button to the right of the session. Sessions where attendance has already been taken do not have the green button, but instead the description is a link that takes you to the screen to modify the attendance record for that session.
Check the ''Create multiple sessions'' button. Select the date and time for the first session you wish to add, followed by the duration of the session. Then, enter the date for the last session you wish to add. Since most classes do not meet seven days a week, select the checkboxes for days the class meets. The final option, frequency, may look confusing but it is actually straightforward: if your class meets every week, as is typical, then you want a frequency of 1 week, which is the default. If your class meets every other week, then select a frequency of 2 weeks, and so on. If you wish, you may type a description for the sessions you are creating. If you leave the description field blank, it will default to "Regular class session". Finally, click the ''Add multiple sessions'' button to create your sessions. You will see a message confirming this.


You will note that when taking attendance the column headings for attendance state are links. If you click one of these column headings, all students will have their status changed to the status you selected. Thus, if everyone is absent (God forbid!), you merely click the '''A''' and it will change everyone's status to absent. If Little Johnny is the only student absent, you would logically click '''P''' to set everyone to present and then go down to Little Johnny and change his status to '''A'''. Enter remarks as appropriate (e.g., the reason for an absence if known or the minutes late if someone is tardy) and click OK to complete taking record.
=== Editing sessions ===


=== Reports ===
Click on the ''Attendance'' tab. <!-- Attendance tab of what page? --> Here, you will see the list of all attendance sessions you have added. You can delete an individual session by clicking the X on the session rectangle's right-hand side. Alternatively, you can check the checkboxes of each session you wish to delete, and then choose "Delete" from the pull-down menu at the bottom right-hand corner of the page to delete all the selected sessions.


Finally, you have the reports. This is, again, obvious. One of my colleagues prefers to take record on paper and transfer it to Moodle. She suggested printing the monthly report before the start of the month and then taking record on this report. It has an added advantage because you have each student's picture with the record sheet. Of course, that is only useful for students who actually put photos of themselves in for their picture.
You can edit a session &mdash; for example, to change its date or description &mdash; by clicking the hand icon on the session rectangle's right-hand side.


A final note here. If you added the attendance block as recommended, you may wonder what it looks like for students. It is completely different -- showing a summary of their attendance record and having a single link for them to view the details of their personal attendance. Another reason why I think the attendance block should always be added when you use the attendance module.
=== Taking attendance ===


== The README file of the beta version ==
Finally, we get to using the module for its intended purpose. You can take attendance for a session by clicking on the green radio button on the session rectangle's right-hand side. Those sessions whose attendance has already been taken do not have the green button. However, the description is a link that takes you to a screen for modifying the attendance record for that session.


*********************************************************************************************
Note that when taking attendance, the column headings for attendance status are links. If you click one of these column headings, all students will have their status changed to the status you selected. Thus, if everyone is present, you can merely click the ''P'' column header to change everyone's status to "Present". If only one person is absent, you could first click ''P'' to set everyone's status to "Present", and then set the absent student's status to "Absent".
****** WARNING: THIS MODULE IS IN DEVELOPMENT. USE WITH CAUTION ******
*********************************************************************************************


--------
Enter remarks as appropriate &mdash; for example, the reason for an absence if known, or the number of minutes a student was late &mdash; and click the ''OK'' button to record the information.
ABOUT
--------
This is version 2.4.x of the "Attendance" module (attforblock).  It is still IN
DEVELOPMENT and should not be considered a stable release unless otherwise
noted.


2.4.x release is compatible only with Moodle 2.0.
=== Reports ===


The "Attendance" module is developed by
You can generate attendance reports on sessions:
    Dmitry Pupinin, Novosibirsk, Russia,
* Select the Attendance activity of the course and session you're interested in.
    Artem Andreev, Taganrog, Russia.
* Click on the ''Export'' tab near the top.
* Change the export settings if you wish.
* From the ''Format'' pull-down menu, select the file format you'd like to export the attendance report in.
* Click on the ''OK'' button.
* Your browser will now probably ask you to either display or save the file.


This block may be distributed under the terms of the General Public License (see
One teacher's style of using the Attendance module, useful in those (probably frequent) situations where there's no access to Moodle in the classroom, is to first take attendance on paper, and then to transfer the information to Moodle later. To ease this task, one can print a monthly report before the start of the month and use the printout for recording attendance during class. This method has the added advantage of having a picture on the printed report for each student who has uploaded their photo to Moodle.  '''(as of 4 Aug. 2012, can't see this feature working)'''
http://www.gnu.org/licenses/gpl.txt for details)


-----------
== Discuss the module ==
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.


----------------
If you have an idea about new features, or need support on using the module, participate in the discussion on the [http://moodle.org/mod/forum/view.php?f=125 Attendance module forum].
INSTALLATION
----------------
The attendance follows standard installation procedures.  Place the
"attforblock" directory in your mod directory. Then visit the Admin page in
Moodle to activate it.


== See also ==
== See also ==


* [http://moodle.org/mod/forum/view.php?id=741 Attendance module forum]
* [[Attendance block]]
* [[Git for Administrators]]
* [[Git for Administrators]]


[[Category:Contributed code]]
[[Category:Contributed code]]
[[Category:Teacher]]


[[ja:出欠]]
[[ja:出欠]]

Latest revision as of 23:50, 12 July 2015

Quick update, July 2013

  1. Artem Andreev is no longer working on this plugin, Dan Marsden is now maintaining the plugin.
  2. The old module was previously named 'attforblock' and has now been renamed to 'attendance'
  3. at this stage no restore code has been written to allow backup files with old style "attforblock" to be restored into the renamed module.
  4. See the Attendance module forum for discussion and support on this module.
  5. Location on GIT of the recent versions: Attendance module, Attendance block

Introduction

The Attendance module is designed for teachers to be able take attendance during class, and for students to be able to view their own attendance record.

A teacher can mark the attendance status of a student as "Present", "Absent", "Late", or "Excused". These status descriptions are configurable, and more can be added. The teacher adds Attendance as an activity of a course, and then sets up the sessions whose attendance is to be tracked.

The Attendance module can generate reports for either the entire class or for individual students. Students may also see their own attendance record if the activity is not hidden.

The optional Attendance block allows teachers quick access to the Attendance functionality, and allows students quick access to a summary report for their own attendance. (A block is a user interface element that can be added to Moodle screens.)

History

Attendance was originally a Moodle block developed by Russell Jungwirth in 2003 (see post [1]). In 2005, Dmitry Pupinin picked up the reins and released version 1.0.2, his first version of the Attendance block (see post [2]). In May 2007, Dmitry released a new version 2.0 suitable for Moodle 1.8. This release was a dramatic restructuring of code that resulted in a significant module along with a small block (see post [3]). Dmitry continued to develop the module and block through 2010.

In November 2010, Artem Andreev updated the code to version 2.2 (see post [4]) to add common and group session options and some user interface improvements. Luis Ramón López wrote modifications that added the ability to create multiple attendance instances in a single course; for example, one instance for laboratory activities and another instance for lecture periods (see post [5]). Version 2.3 was released in January 2011.

Immediately after the release of version 2.3, work began on porting the code to Moodle 2.x. In July 2011, Artem released Attendance version 2.4.0 (see post [6]), a rewrite of the code as a module with an optional block for use with Moodle 2.x only. In July 2012, Artem released a new branch of version 2.4.0 updated to work with Moodle 2.3.

In July 2013 Dan Marsden took over maintenance of the plugin and renamed the "attforblock" module to "attendance"

There is another unrelated attendance plugin in the plugins database: https://moodle.org/plugins/view.php?plugin=mod_attendanceregister

For developers

The current version of the Attendance block and the Attendance module are hosted on Dan Marsden's github site.

Module Block
https://github.com/danmarsden/moodle-mod_attendance/tree/master http://github.com/danmarsden/moodle-block_attendance/tree/master


Upgrade from mod_attforblock to new mod_attendance

The new attendance module renames the attforblock module to attendance - when this module was first created you couldn't have a Module with the same name as a block - newer versions of Moodle allow this and in preparation for inclusion in the moodle.org plugins database we renamed "attforblock" to "attendance" - we have included some code to convert your old "attforblock" database entries to use the new "attendance" format.

  1. make sure you are running the latest attforblock code - the new attendance module will only allow upgrades from attforblock version 2012120700
  2. Download the new attendance module and install it in the usual place (in a folder called mod/attendance)
  3. remove the old "mod/attforblock" folder from your site (don't use the uninstall function in the admin menu unless you don't need to keep previously created attendance modules in your courses)
  4. Trigger the normal upgrade process by visiting admin > notifications and it will migrate the data from your old attforblock module to the newly named "attendance" module

Upgrade info for Developers/Admins

The rename of the module only changes one of the database table names - attforblock to attendance, all the other tables are already prefixed with 'attendance' so these aren't changed. The Moodle install process hits install.xml first which is a problem as it will fail as some of the tables listed in install.xml already exist. To work around this we abuse the mod/attendance/version.php file a bit. This file is included first when checking for upgrades so we do a check there to see if data from the old mod_attforblock still exists - it it does it renames the old 'attforblock' table to 'attendance' amd updates the record in the modules to rename it from 'attforblock' to 'attendance' - it also checks to make sure the old 'attforblock' directory has been deleted and will only upgrade from attforblock versions higher than 2012120700 - it's possible this could be improved, pull requests are welcome. After the upgrade has completed you may want to remove the upgrade code from version.php as it will result in an extra few db queries every time the version.php files are loaded to avoid the small unnecessary performance impact that the code causes.

Installation

First, make sure you're familiar with page Installing contributed modules or plugins.

The installation can only be performed by a user who has both write access to the file structure on the computer hosting Moodle and administrator rights for the Moodle installation.

Language files

The language files for localizing the module are .../attforblock/lang/language code/attforblock.php. In order to customize the strings, you can

  • either edit the language file(s) of the language(s) you're interested in, or
  • edit the string definitions through Moodle itself when logged in as an administrator, via Settings > Site administration > Language > Language customization. (Note: this method doesn't seem to work as of 4 Aug. 2012)

Note that the date format is controlled by the language file you install. As an example, assume that you're using the en_us language file, which defines the date format as m.d.y. In order to change the format to m/d/y, you could use the first method mentioned above, and edit the language definition file .../attforblock/lang/en_us/attforblock.php and change the string definitions into this:

$string['strftimedm'] = '%m/%d';
$string['strftimedmy'] = '%m/%d/%Y';
$string['strftimedmyw'] = '%m/%d/%y (%a)';
$string['strftimeshortdate'] = '%m/%d/%Y';
$string['strftimedmyhm'] = '%m/%d/%Y %H:%M'; // line added to allow multiple sessions in the same day

Another example: if you're using the en language file, and want to change the sting "Late" to "Tardy", you could use the second method mentioned above, namely: (Note: this method doesn't seem to work as of 4 Aug. 2012)

  • log in as an administrator;
  • click Settings > Site administration > Language > Language customization;
  • choose "English (en)" from the pull-down menu, which is shown if more than one language pack has been installed;
  • click on the Open language pack for editing button;
  • after the language pack has been loaded, click on the Continue button;
  • in the "Filter strings" screen's component list, scroll down to the bolded "mod" heading, and then click on the "attforblock.php" line under it;
    • (note: you could also reduce the number of strings shown, for example by writing "Late" in the "Only strings containing" filter input line)
  • click on the Show strings button;
  • scroll down until you find the string Lfull, whose definition is "Late";
  • write "Tardy" in the edit box to the right;
  • (you might also want to change the definition of the string Lacronym from "L" to "T";)
  • click on the Save changes to the language pack button on the bottom of the screen; and
  • in the confirmation screen, click on the Continue button.

Teacher's usage instructions

Adding an Attendance Activity instance

After the attendance module has been properly installed, the teacher must add Attendance as an activity to each course they wish to keep attendance for. This is done by first ensuring that you are in the edit mode and then selecting "Add an activity or resource" in a Moodle section box. Note that you may now add as many instances of the Attendance module as you like, and that each instance may have multiple sections. Be sure to give the instance a name that indicates what it will be used for; for example, "Lecture Attendance". If you will be using groups in your course, set the Group mode accordingly, because even if groups exist in the course, you will not be able to use them within the Attendance module if you select No groups.

Once you have added an attendance instance, you are ready to start taking attendance during classes.

Adding an Attendance block to a course page

For a shortcut to attendance information for both teachers and students, it is recommended that you install the associated Attendance block (see the installation instructions above). If you have done so, you also need to add the Attendance block to your course page, like this:

  • Turn editing on.
  • Find the block entitled "Add a block."
  • In the drop-down menu in this block, select Attendance to add the Attendance block.
  • As always, move the block to fit your viewing preference.

Setting Attendance categories and grading options

Now it is time to set your attendance options. Select your attendance activity and you will see a bar of options, the last of which is "Settings." Select "Settings" and you are presented with acronyms, attendance status descriptions, and grade (points) to assign. By default, the status descriptions are "Present", "Absent", "Late", and "Excused".

You may prefer to change the descriptions (for example, by changing "Late" to "Tardy"), change the way points are counted, or add new status descriptions. To do the latter, fill in the fifth line and click the Add button. Important: when you hit the Add button, any changes made to existing options that were made after the last time the Update button was used will be lost. Likewise, when you hit the Update button, any changes made to the Add after the last time the Add button was hit will be lost.

Finally, when you are done changing items on this page, be sure to click the Update button to register the changes.

Adding sessions

Next, it is time to add sessions. To add class sections, click the Add tab (second from left) at the top of the Attendance page. Alternatively, you can click the Add button from the Attendance block (if you've installed it) to directly navigate to the page for adding sessions. If you chose "No groups", or have not defined groups, then the Session type will be forced to "Common." If you have defined groups and have chosen to use them in your course's Attendance activity, then you will have the option to create sessions for a group or all students.

You have two options for adding sessions, adding a single session or adding multiple sessions. The single session is self-explanatory as well as time-consuming to use when you have many class sessions, so we will go straight to the more useful option.

Check the Create multiple sessions button. Select the date and time for the first session you wish to add, followed by the duration of the session. Then, enter the date for the last session you wish to add. Since most classes do not meet seven days a week, select the checkboxes for days the class meets. The final option, frequency, may look confusing but it is actually straightforward: if your class meets every week, as is typical, then you want a frequency of 1 week, which is the default. If your class meets every other week, then select a frequency of 2 weeks, and so on. If you wish, you may type a description for the sessions you are creating. If you leave the description field blank, it will default to "Regular class session". Finally, click the Add multiple sessions button to create your sessions. You will see a message confirming this.

Editing sessions

Click on the Attendance tab. Here, you will see the list of all attendance sessions you have added. You can delete an individual session by clicking the X on the session rectangle's right-hand side. Alternatively, you can check the checkboxes of each session you wish to delete, and then choose "Delete" from the pull-down menu at the bottom right-hand corner of the page to delete all the selected sessions.

You can edit a session — for example, to change its date or description — by clicking the hand icon on the session rectangle's right-hand side.

Taking attendance

Finally, we get to using the module for its intended purpose. You can take attendance for a session by clicking on the green radio button on the session rectangle's right-hand side. Those sessions whose attendance has already been taken do not have the green button. However, the description is a link that takes you to a screen for modifying the attendance record for that session.

Note that when taking attendance, the column headings for attendance status are links. If you click one of these column headings, all students will have their status changed to the status you selected. Thus, if everyone is present, you can merely click the P column header to change everyone's status to "Present". If only one person is absent, you could first click P to set everyone's status to "Present", and then set the absent student's status to "Absent".

Enter remarks as appropriate — for example, the reason for an absence if known, or the number of minutes a student was late — and click the OK button to record the information.

Reports

You can generate attendance reports on sessions:

  • Select the Attendance activity of the course and session you're interested in.
  • Click on the Export tab near the top.
  • Change the export settings if you wish.
  • From the Format pull-down menu, select the file format you'd like to export the attendance report in.
  • Click on the OK button.
  • Your browser will now probably ask you to either display or save the file.

One teacher's style of using the Attendance module, useful in those (probably frequent) situations where there's no access to Moodle in the classroom, is to first take attendance on paper, and then to transfer the information to Moodle later. To ease this task, one can print a monthly report before the start of the month and use the printout for recording attendance during class. This method has the added advantage of having a picture on the printed report for each student who has uploaded their photo to Moodle. (as of 4 Aug. 2012, can't see this feature working)

Discuss the module

If you have an idea about new features, or need support on using the module, participate in the discussion on the Attendance module forum.

See also