Attendance module

Attendance module

by Martin Dougiamas -
Number of replies: 66
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Russell Jungwirth (who has been helping with a few bits and pieces recently) recently sent me a great start for a new module to manually record attendance at any point in the course.

I've put it in /contrib/attendance and it's available from the Modules download page: http://moodle.org/download/modules/

I'll tell Russell about this thread - he may want to say more about it. smile
Average of ratings: -
In reply to Martin Dougiamas

Re: Attendance module

by Rob Butner -

I installed the attendence module----the current lang packs for en does not contain the required "attendance.php" file. I copied the attendance.php from the /mod/attendance/ folder and placed it into the lang/en folder. But I cant find any way to access the attendance functions....Where is it and how does it function????

Rob

In reply to Rob Butner

Re: Attendance module

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
You have to visit the admin page to install it ... after that it appears on your activity module "add" menu (with chat, forum, etc)
In reply to Martin Dougiamas

Re: Attendance module

by Rob Butner -

It seems to be somewhat functioning---but I'm getting the following error:

Warning: Invalid argument supplied for foreach() in c:\program files\easyphp\www\mod\attendance\view.php on line 63

 

In reply to Rob Butner

Re: Attendance module

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Note the version number 0.1 ... I would suggest that is not ready for end-users yet. It would better if bug reports had fixes attached. smile
In reply to Rob Butner

Re: Attendance module

by Steven Priefer -
I just recently installed the attendance module.  Having this module is essential before I start using moodle full time.  Anyway attendance.php file is no where to be found.
In reply to Steven Priefer

Re: Attendance module

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Steven,

The attendance module is not currently maintained by anyone, and some major problems from the initial implementation were never resolved.

I do not recommend using this module in its current form - it has really messed up some courses.
In reply to Martin Dougiamas

Re: Attendance module

by Jacob Romeyn -

Most of it seems to work ok.  If all students are marked as "P" I get this error:

Warning: Invalid argument supplied for foreach() in /home/www/moodle/mod/attendance/view.php on line 63

But with one or more students marked "A"  everything is OK.

 


In reply to Martin Dougiamas

Re: Attendance module

by Russell Jungwirth -
All right! This is what I need! You guys are doing great in finding these bugs. Keep up the good work wink
Fixes will be provided as time permits. As you may have gathered, I'm the module developer, and I've got a few tricks ready to come out of the bag. The next version of the module should be ready in the next few days, - let's say... when Martin gets my cvs tree access set up and I finish these features:

- Creation wizard for multiple attendance instances at one time
- Automatic attendance logging based on student activity logs through the cron function
- Extended reporting to add up all student attendance information in the course at any given time.

Okay... so that's a lot, but I'm making some significant changes to the code that haven't been committed to the tree yet, so though I'd like to give you fixes right off the bat, I can make no commitments. wink

Russell Jungwirth
Sureblue Studios LLC
In reply to Russell Jungwirth

Re: Attendance module

by Tony Ruggiero -

Russell:

Great job!!!!!

We have been looking for exactly this. Will the students be able to see their attendance. Also we have a different number of hours to post for each assignment, will that be a feature?

Thanks for all your hard work,

Tony

In reply to Tony Ruggiero

Re: Attendance module

by Tony Ruggiero -

Russell:

The only thing we will have to do is to eliminate the students from seeing everyone elses attendance. Privacy laws require that we do so.

Tony

In reply to Tony Ruggiero

Re: Attendance module

by Russell Jungwirth -
(from the email I sent to Tony)

The next version of the module, which I should be posting to CVS today,
will allow students to view their attendance.
As for different numbers of hours for each assignment, do you mean that
each individual attendance instance can have different numbers of hours in
it? If that's the case, then it does that already. Also note that
eventually you'll be able to get attendance modules to automatically move
themselves to the appropriate week by their date, if your course is
configured in the weekly format.

In reply to Martin Dougiamas

Re: Attendance module

by Russell Jungwirth -
Please also note that the feature that allows attendance instances to be automatically moved to the section that corresponds to their date will not work at the moment because there has to be some minor changes made to the files course/lib.php and course/mod.php to allow them to be moved. I've proposed these changes to Martin, but they aren't there at the moment.
Please also note that a course must be in weekly format for this option to apply. If it's not in weekly format, the option will simply be ignored.
Instances can, of course, always be moved manually as any other module's instances.

I've attached context diff's of course/lib.php and course/mod.php from the 09-10 nightly build for the ambitious
In reply to Russell Jungwirth

Re: Attendance module

by Damian Scisci -
Just installed the module.  I noticed that attendance shows up in the grading section of course.  Will it be configured to be a gradable module?  Meaning, a student can get a point or two for attending a topic?  I think that could be a useful option for some.
In reply to Damian Scisci

Re: Attendance module

by Rob Butner -

Yes!!!

We would like to be able to take roll, per topic (class) and based upon the student attending, award some amount of points that will apply tward the final grade in the gradebook----Rob

In reply to Russell Jungwirth

Re: Attendance module

by Russell Jungwirth -
that won't be very hard to do. I'll put an option in to allow each instance to have a grading value that will default to 0, but will pro-rate the grade based on the number of hours attended.
In reply to Russell Jungwirth

Re: Attendance module

by Russell Jungwirth -
Good News everyone! YOU DON'T HAVE TO MAKE THESE MODIFICATIONS ANY MORE Thanks some code I used from Ben Pirt's appointment module, which does the same kind of thing as mine does with dynamic sectioning, I've updated my code so that changes don't have to be made to the course/lib.php and course/mod.php files. I guess I don't know my moodle api's well enough yet. :-} New version in CVS, of course.
In reply to Martin Dougiamas

attendance at small group seminars

by Gustav W Delius -
We need an attendance module as well. However we have the added complication that once a week the whole class is split into smaller groups. These groups then meet for a seminar, led by a seminar leader who takes an attendance record. We would like the seminar leader to enter this attendance record into Moodle, so that the teacher can see it for all students.

Now it would be very inconvenient if the individual seminar leader has to search for his small number of students inside the long list of all class participants in order to enter their attendance. Instead the seminar leader should be shown a list of only those students that were supposed to show up for his particular meeting.

Of course Moodle needs to know which student belongs to which seminar group. We are proposing to hold that information an extra column of the user_students table. There also has to be an additional table course_groups, each entry of which corresponds to a group and determines the group's seminar leader. It is the id number of the group in this table that is contained in the extra column of the user_students table.

Using the information in these tables, a seminar leader can automatically be shown only those students from the large class that were actually supposed to attend his seminar.

Maybe Russell can build this functionality into his module, if not we will build on his work later. And Russell: we need it soon wink
In reply to Gustav W Delius

Re: attendance at small group seminars

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Just a note on groups - I am starting on group support in the next few weeks.

http://moodle.org/doc/?frame=future.html
In reply to Martin Dougiamas

Re: attendance at small group seminars

by Gustav W Delius -
I am glad to hear that you are soon introducing support for groups within courses. Is there a bug or a post where I can read about the details of what you have planned?
In reply to Gustav W Delius

Re: attendance at small group seminars

by Russell Jungwirth -
If you can wait for Martin to come a ways on groups, I'd be more than happy to work off his design. I could see this being a very useful sub-feature to integrate into attendance. I don't want to reinvent the wheel if I don't have to smile
In reply to Martin Dougiamas

Re: Attendance module

by Russell Jungwirth -
FYI - I have just committed version 0.2 to the CVS server.

What's in the new version:

View All attendance rolls in one report
settings page for module preferences
multi-page reports for View All
student view attendance listings
tallying of absences and tardies

What's not implemented:
auto-attendance logging per activity
grading attendance
attendance by groups
multiple instance creation wizard

In reply to Russell Jungwirth

Re: Attendance module

by Russell Jungwirth -
oops! another minor fix. student now views only his own attendance record in view.php
viewall.php not fixed yet. that's next.
In reply to Martin Dougiamas

Re: Attendance module

by Russell Jungwirth -
okay! Version 0.3 is now out. This is the first feature-complete version I've created. It's prolly low-beta quality at this point.
See CVS for updates.
Specific changes:
viewall.php has been added to allow for viewing full attendance information for the course. It does multi-page and single-page reports with width limiting, as well as a big single-table report version. Next in that area will be exports to spreadsheet format.
Student-only view limiting has been implemented in view.php and viewall.php.

That's it for me today, you've been a great audience! Be sure to tip your waitress, and try the veal, it's terriffic! smile
In reply to Russell Jungwirth

Re: Attendance module

by Jacob Romeyn -

I looked in the CVS and could not find it wideeyes.gif

 

. Can you tell me where it is?shy.gif 

 

The one under optional Modules is still the old one.sad.gif

In reply to Jacob Romeyn

Re: Attendance module

by Russell Jungwirth -
yeah, you have to use cvs to get it. Do this:

make a directory for your cvs checkout. call it whatever you want.
Then:

From a Unix/Linux computer

To connect and login for the first time to the CVS server, you can use this command:

cvs -d:pserver:anonymous@cvs.moodle.sourceforge.net:/cvsroot/moodle login

There is no password - when asked for one, just hit Enter.

To checkout (download) the entire Moodle code for the first time, use this command:

cvs -z3 -d:pserver:anonymous@cvs.moodle.sourceforge.net:/cvsroot/moodle co contrib

Later, to update your local copy of Moodle to the current version in CVS you just need to go into your local moodle directory and type:

cvs update -dP

From a Windows computer

To get started with a fresh copy of Moodle, follow the following steps:

1. Get TortoiseCVS from tortoisecvs.org and install it, then reboot.
2. Find or create a new folder somewhere where you want Moodle to be downloaded to.
3. Right-mouse-click that folder and choose "CVS Checkout" from the menu. You should see a dialog box.
4. Copy this text into the CVSROOT field: :pserver:anonymous@cvs.moodle.sourceforge.net:/cvsroot/moodle
5. Press the button: "Fetch list...".
6. To the right of the button you'll see a list of modules: choose "contrib" from that list.
7. Press the button: "OK" and everything should be downloaded.

(paraphrased from http://http://moodle.org/mod/resource/view.php?id=8)


Otherwise, just use the one I've attached. It's pipin' hot fresh!
In reply to Russell Jungwirth

Re: Attendance module

by Tony Ruggiero -

Russell:

Updated my install of the module, the upgrade of the db went fine. Click on View All Attendance Rolls and I get:

Warning: Invalid argument supplied for foreach() in /var/virtualhosts/denver.heritage-educationonline.com/html/mod/attendance/viewall.php on line 96

Warning: Invalid argument supplied for foreach() in /var/virtualhosts/denver.heritage-educationonline.com/html/mod/attendance/viewall.php on line 96

Warning: Invalid argument supplied for foreach() in /var/virtualhosts/denver.heritage-educationonline.com/html/mod/attendance/viewall.php on line 96

Warning: Invalid argument supplied for foreach() in /var/virtualhosts/denver.heritage-educationonline.com/html/mod/attendance/viewall.php on line 96

Warning: Invalid argument supplied for foreach() in /var/virtualhosts/denver.heritage-educationonline.com/html/mod/attendance/viewall.php on line 96

Just FYI,

Tony

 

In reply to Tony Ruggiero

Re: Attendance module

by Russell Jungwirth -
k, I think I've fixed it. Update from CVS again, or edit viewall.php and replace the code at line 96 that looks like this:
foreach ($rolls as $roll) {
$atts[$numatt]->sroll[$roll->userid][$roll->hour]->status=$roll->status;
$atts[$numatt]->sroll[$roll->userid][$roll->hour]->notes=$roll->notes;
}

with this:
if ($rolls) {
foreach ($rolls as $roll) {
$atts[$numatt]->sroll[$roll->userid][$roll->hour]->status=$roll->status;
$atts[$numatt]->sroll[$roll->userid][$roll->hour]->notes=$roll->notes;
}
}
In reply to Russell Jungwirth

Re: Attendance module

by Tony Ruggiero -

Russell:

It works...great job.

Tony

 

In reply to Tony Ruggiero

Re: Attendance module

by Tony Ruggiero -

Russell:

I am trying to create a hack of this great module. We would like to be able to have the instance setup the week then allow the instructor to enter the number of hours (with either a drop down box or an entry field).

The amounts in each day would then be totalled up at the end of that week to give the overall attendance for the week.

Thanks for tackling this.

Tony

In reply to Tony Ruggiero

Re: Attendance module

by Russell Jungwirth -
Tony,
I should get around to working on this feature on Tuesday afternoon or Wednesday morning (CST). Stay Tuned!

Russ
In reply to Russell Jungwirth

Re: Attendance module

by Tony Ruggiero -

Russell:

Thanks. I am newbie to php/mysql so I know I would make something blow up if I tried to do it.

Tony

In reply to Tony Ruggiero

Re: Attendance module

by Russell Jungwirth -
Tony,

This feature has now been added to the module. You can add attendance instances for a whole week using the 'add multiple rolls' link at the bottom of the 'add' page.

When viewing a given instance of attendance in that week, you can now click on the 'View all rolls for this week' link to view all the rolls that fall within the range of that given week. There is also a link on that report to view all rolls in that section instead of limiting it purely by date range.

Russ
In reply to Russell Jungwirth

Re: Attendance module

by Tony Ruggiero -

Russell:

Thanks, I took a few days "off" and wanted to get back and thank you. We will proably use it day by day, since each day's required attendance varies in hours.

Tony

 

In reply to Tony Ruggiero

Re: Attendance module

by Russell Jungwirth -
Yeah, that's probably the best thing to do in that situation. It would be awful complex to have an 'add multiple' screen that allowed for varying numbers of hours to be added for multiple days at once. If you have any suggestions on an uber-intuitive way to do this on the 'add multiple' form please share!

And thanks for the encouragement, it helps!

Russ
In reply to Martin Dougiamas

Re: Attendance module

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers
Hi, I've just installed this module, and all seems to be working ... apart from:

When I go to Update this Attendance, I get an error saying

Warning: Invalid argument supplied for foreach() in /home/baillie/public_html/learningcentre/mod/attendance/mod.html on line 52
See attached clip for context.

The text at line 51 of mod.html is
foreach ($rolls as $roll) {

Any clues anyone??
Attachment attendance-clip1.jpg
In reply to Jon Bolton

Re: Attendance module

by Jacob Romeyn -

Yes I still get that same error.

If, however, you change it for one student to "T" or "A" the error will go away.

In reply to Jon Bolton

Re: Attendance module

by Russell Jungwirth -
Oops - bug! I've updated the module code in cvs, and attached the changed file here as well. Sorry bout that...
In reply to Russell Jungwirth

Re: Attendance module

by Jacob Romeyn -

That fixed that partbiggrin.gif. But now an other error is present in the "View all" option:

Warning: Invalid argument supplied for foreach() in /home/www/moodle/mod/attendance/viewall.php on line 96sad.gif

This problem also goes away when at least one "T" or "A"  is set


 

In reply to Jacob Romeyn

Re: Attendance module

by Russell Jungwirth -
I see the problem! The module just got incorporated into the main moodle cvs tree, but it didn't roll in my new bug fixes. I just found out about the move this morning, and haven't had a chance to update the code in the main tree. I've been updating to the contrib tree instead!

Anyways, I've fixed that bug as well. Attached is the new version of that file. The updated version will be incorporated into tonight's nightly release. Thanks for your patience and understanding.

Russell Jungwirth
In reply to Russell Jungwirth

Re: Attendance module

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Actually, I'm not seeing updates on either location from the last couple of days ... there may be some other problem.

Also, note that the "nightlies" are now being generated every hour. (I should rename them smile )
In reply to Martin Dougiamas

Re: Attendance module

by Russell Jungwirth -
yeah... I wasn't committing the changes in cvs properly. I'm on the right track now. I'll check the 'nightly' next hour to verify that all is in sync.
In reply to Russell Jungwirth

Re: Attendance module

by Bob Lee -

Hello...

I'm getting an error in the Attendance module which says:

Fatal error: Call to undefined function: tally_overall_absences_fraction() in /home/wolfpsy/www/moodle/mod/attendance/viewall.php on line 261

Can you look at this and let me know what is wrong?  Also, is there a resource which explains how best to use the attendance module, e.g., what is autoattend, etc.  Basically some docs about the module?

Thanks a bunch.  Good module, I think, but I'm still wondering how to use is effectively.

Thanks!

Bob Lee

In reply to Bob Lee

Re: Attendance module

by Russell Jungwirth -
Bob,
Update your installation. I've changed the name of the tally_overall_absences_fraction function to attendance_tally_overall_absences_fraction. It appears that you have an updated version of lib.php but not an updated version of viewall.php. The latest version of moodle, available at
http://moodle.sourceforge.net/nightly/moodle-latest.tgz
has the corrected version of the module.

As for documentation, it hasn't been written yet. You may want to read the threads in this forum, as they probably have the best discussion of the where and why's of the module.

Russ
In reply to Russell Jungwirth

Re: Attendance module

by Jacob Romeyn -
I  changed the viewall.php  and that fixed the problem.  Thank youbiggrin.gif
In reply to Russell Jungwirth

Re: Attendance module

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers
Thanks for the updated file Russell. I've just uploaded the file that was attached to your post but I am still getting the same error message. Any ideas?
In reply to Jon Bolton

Re: Attendance module

by Timothy Takemoto -

I got
Warning: Invalid argument supplied for foreach() in /home/tim/mootim/moodle/mod/attendance/view.php on line 125
When I viewed an attendance module. Perhaps this has something to do with the fact that there are no students enrolled on the course. I was just trying to check out the module.
Tim

In reply to Martin Dougiamas

Re: Attendance module

by Ger Tielemans -

Nice modul!

We are moving form classes with closed doors to open learning landscapes.

Brings new resposibilties for our schoolteachers: "Are all the students in the house?" They started to count them on paper.. This modul fits their new "sheep countin need" THANKS (So i would propose to replace the current icon with a white sheep smiley.gif)


Another "new need" is that the teacher needs to know if students have the choice to be present in an offered meeting. (if no student will coem, the teacher can help other students..)

The same for exams: students can choose from a list the date they will take their first exam. Thinking how I could use your modul for this, I got a brainwave: I can use poll for that, all the functionality is there. Just clone poll and give it a informationmark icon, changing the text a little... 

Question to Martin: is worth to make a new modul of it, or is it to close to poll?

In reply to Ger Tielemans

Re: Attendance module

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
The "Choice" module is already perfect for that, I think.
In reply to Martin Dougiamas

Re: Attendance module

by Roger Ek -

Hi Martin,

Maybe this follow on should be in the choice forum, but anyway...

When trying to use the choice module to book students there are two obvious limitations that might be easy to fix (but again it might be more related to the attendance module than the choice..)

  1. I could not find a way for a student to re-schedule, once a choice is given it stays. When using as a booking method you would like to offer the opportunity for the student to reschedule (make a new choice).
  2. Number of seats, often there is some limitations in seats. It would be of great help if a max number of seats could be entered for each choice. Once the limit is reached, no more student can book that seminar (make that choice).

So take it as an idea for further improvement of an already excellent package.

Thanks

Roger

In reply to Ger Tielemans

Re: Attendance module

by Roger Ek -

Hi Ger,

If you still have this need, you may want to try my hack of the choice module. I posted it in the choice forum here.

Roger

In reply to Roger Ek

Re: Attendance module

by Ger Tielemans -

Thanks, it is already useful in it's current form:

  • I set the limit=1
  • I make a Moodle section with thematic choice-sets of 6 each 

Nice, very nice..

In reply to Ger Tielemans

Re: Attendance module

by Roger Ek -

Glad you liked it.

We are using the limit figures to set the available seats, say 30. When 30 students makes this choice it is "sold out". When the 31 student tries this choice he will be asked to make another choice.

 

In reply to Martin Dougiamas

Re: Attendance module

by Stephen Henneberry -
I have just tried to implement the attendance module in one of my courses, but I am getting the following error:
Warning: Invalid argument supplied for foreach() in /home/dokusha/www/www/moodle/mod/attendance/lib.php on line 230

I think that what follows may be line 230, but lacking a proper text editor I counted by hand! black eye

foreach ($attrecs as $attrec) { $grid[$attrec->hour]=$attrec->status; }

In addition, I have a question about automatic attendance using activity. I have checked the "autoattend" spot, assuming that this was all I needed to do, but ALL students get a P regardless of activity. Am I missing something? Is there documentation on this mod somewhere? I tried to find it and came up empty handed.

(I am using Moodle version 1.1.1 and Attendance version 0.1)
In reply to Stephen Henneberry

Re: Attendance module

by Russell Jungwirth -
sorry - the same bug that keeps popping up... I went through the code and fixed all occurrences of that potential bug. That should fix your problem. Download the latest nightly build at

http://moodle.sourceforge.net/nightly/moodle-latest.tgz

and install it. This should fix your problem.

Russell Jungwirth
In reply to Russell Jungwirth

Re: Attendance module

by Tony Ruggiero -

Russell:

Food for thought.

It would be sweet to be able to have the code give attendance "credit" for participation in forums or taking quizes, etc. Something that is able to be set for different values for each activity.

I don't know if this is a major kernal change or just changes to the modules.

ok, now I will shut up  tongueout.gif

Tony

In reply to Russell Jungwirth

Re: Attendance module

by Dale Jones -
Hi Russ;
This might not even be attendance's fault, but when I go through a user's activity and look for their "complete" activity, I'm getting this error whown in the list of attendances.  (It might be where that user didn't have an attendance logged?  I don't know)

Warning: Invalid argument supplied for foreach() in /home/marywebb/public_html/moodle/mod/attendance/lib.php on line 230

I'm using 1.2, updated last night.

This isn't critical to me, so no sweat if it doesn't get fixed. 

Best wishes
Dale
In reply to Russell Jungwirth

Re: Attendance module

by Abdul Rahman -

Hi

Has there been any development on the Attendance module? The last I heard it is still unstable.

I'd be interested to hear how you are tracking attendance without this module. Do you use the logs?

In reply to Abdul Rahman

Re: Attendance module

by Russell Jungwirth -
I'm going to resume development on the attendance module again. It'll take me a little bit to get back up to speed again, but rest assured development will continue!

Russell Jungwirth
In reply to Russell Jungwirth

Re: Attendance module

by Abdul Rahman -

Hi

Has there been any development on the Attendance module? The last I heard it is still unstable.

I'd be interested to hear how you are tracking attendance without this module. Do you use the logs?

In reply to Abdul Rahman

Re: Attendance module

by Travis Newton -
It does seem to be. I get an error in the totals section of the table. sad It would be nice to use it.