Attendance sessions by hour

Attendance sessions by hour

by Monico Briseño -
Number of replies: 36
Picture of Testers
Hi, all. Attendance module is a nice tool for all schools. However, in the school where I work, needs to attendance sessions by hour.

BTY, I'm not PHP expert programmer.

Can anybody give me some ideas to do this? or Did Anybody do this?

TIA
Average of ratings: -
In reply to Monico Briseño

Re: Attendance sessions by hour

by Frederic Nevers -
Hi Monico,

I used to have the same problem as you so I looked into the code and I have just come up with something that you might be interested in.

Basically, I have added "hours and minutes" to the module, allowing you to set up sessions which start at a specific time e.g. 14:05. This allows you to have several sessions during one day (one session every 5 minutes if you wanted to!)

I have also added a "Description" facility to the "Add multiple sessions" as I needed it. So I can now create several sessions with the same name e.g. Year 13 Computer studies, and it will appear automatically for all these sessions.

Like I said, I have only just finished it and I'm not the best programmer in the world so you might want to backup and take all necessary precautions before you install it on your production site.

That said, it works and has not broken anything on my site. To be fair, the changes I made to the code are trivial and I did not make any changes to the database at all (it already accepted all the changes I made, you could even add "seconds" if you wanted to!)

I will put a contrib into the tracker to see if my code would be accepted into the "core" of the application as a lot of people have requested something like this.

Please let me know how things go and if it also works for you smile

Cheers,
Fred
In reply to Frederic Nevers

Re: Attendance sessions by hour

by Monico Briseño -
Picture of Testers
Hi, Fred. I appreciate a lot your effort to develop this new feature into Attendance activity. Yes, you did great job.

I just downloaded all files you put them into Moodle Tracker. I just installed all of them in their proper folders. I went to my develop moodle site logged into as Admin, and new Attendance table information appeared, I clicked on the continue button and so far, all work great.

I opened my demo course, I went to Attendance area and the hours and minutes section are there, great. I create some of them to check them out. However, in the Attendance tab secction appeared in time column some different. I attached a screenshot about it.

Finally, in the Report tab section, don't appear all attendance by hour. Just the first one that I took attendance.


Attachment attendancebyhour.jpg
In reply to Monico Briseño

Re: Attendance sessions by hour

by Frederic Nevers -
Hi Monico,

thanks a lot for trying this out for me smile

Please try and save the attached file into blocks/attendance/lang/en_utf8 and the problem you have with the time not showing should be sorted.

Please let me know whether it works. It does on my install, so I hope it does on yours. If it doesn't. I'll review all the files I saved in the tracker as I might have saved the wrong one (I'm not very organised....)

Cheers,
Fred
In reply to Frederic Nevers

Re: Attendance sessions by hour

by Monico Briseño -
Picture of Testers
Hi, Fred. Thank you for your sooner response. I did exactly that you wrote. But, new problem appeared. I attached a screenshot of this. No time, description and action information in each column.

Cheers

Mónico

Attachment attendancebyhour.jpg
In reply to Monico Briseño

Re: Attendance sessions by hour

by Barry Oosthuizen -
Hi Fred,

I've just installed your added functionality of the attendance module and got the same error with the time shown as strftimehm.

Other than that it seems to be working fine.

Thanks so much for taking the time to do this.

Barry
In reply to Barry Oosthuizen

Re: Attendance sessions by hour

by Frederic Nevers -
Hi Monico and Barry,

thanks for your patience. I think I know where the problem is: I did not provide you with the right language file.

Please try and save the attached file into block/attendance/en_utf8/

I attached the wrong file to the post yesterday...

I have just tried this on my install and it works, so fingers crossed smile

I will add the time functionality in the reports so that the time shows in the column headers. I think once all the changes have been made, I will repackage the whole thing and save it somewhere. Do you know the best way to do this? I can email you it if you like?

Fred
In reply to Frederic Nevers

Re: Attendance sessions by hour

by Frederic Nevers -
Okay so I've just updated the report file so that it now shows the time as well. I have not made the time "clickable" as it returns the same data as the date shown.

Also, I have changed the date format (it now shows short name of month) as it was a little bit confusing when both month and time were shown in the same cell.

You will need to place the report.php file in mod/attforblock/ and also get the NEW (refer to FOLLOWING post) block_attendance.php to be saved into blocks/attendance/en_utf8

Hope it works for you guys. Let me know if there are other changes that need to be made.

Cheers,
Fred
In reply to Frederic Nevers

Re: Attendance sessions by hour

by Frederic Nevers -
New block_attendance.php language file
In reply to Frederic Nevers

Re: Attendance sessions by hour

by Barry Oosthuizen -
Hi Fred,

This is just fantastic! Well done, and thank you very much!

On the Report Tab:
I noticed (after playing around a bit) that if I add lots of sessions that when I select "Display Month" the sessions move outside of the normal screen size. I guess this must have happened before already? Never noticed these options before...

Would it be possible to add the time on the individual reports as well? (the screen you get when you click on the student's name in the normal report which is the same the report the students see)

Barry


In reply to Barry Oosthuizen

Re: Attendance sessions by hour

by Frederic Nevers -
Hi Barry,

Thanks a lot for trying this out for me smile

The width issue happened before but it wasn't as noticeable as the months weren't displayed as big (I'm not sure whether this explanation makes any sense). I have the same problem with the gradebook, when there are too many items, they just go off screen. I've worked out a "hack" for the gradebook that only works in IE but would probably be applicable to the attendance module as well (I think). Basically, it displays the headings (names of assignments) vertically rather than horizontally, thus saving some screen space.

I would think it is possible to add the time on the individual reports. I will definitely look into it some time this week. I'll post the files here when I'm done with it.

Cheers,
Fred

In reply to Frederic Nevers

Multiple Sessions & Daylight Saving

by Barry Oosthuizen -
Hi Fred,

I think there's a lot of people out there that'll be very happy with the work you've done!

I seem to have a daylight saving problem when creating multiple sessions in advance. Any idea on a workaround?

Thanks again,

Barry




In reply to Barry Oosthuizen

Re: Multiple Sessions & Daylight Saving

by Frederic Nevers -

Hi Barry,

Thanks for reporting this, i hadn't noticed. I'm looking into the issue now. There seems to be an issue with the function used to saved a session time as one of the arguments of the function is now deprecated (since PHP 5.1).

I'm sure there is a way to sort out the issue but I haven't figured it out yet... Maybe next weekend. If anyone has any idea...

I've included new files on this forum if you're interested smile

Cheers,

Fred

In reply to Frederic Nevers

Re: Multiple Sessions & Daylight Saving

by Barry Oosthuizen -

Hi Fred,

Thanks so much for the updates and all your help. 

I'll test the updates later tonight.

Cheers,

Barry

In reply to Frederic Nevers

Re: Attendance sessions by hour

by Monico Briseño -
Picture of Testers
Hi, Fred. I updated the report.php file. It works fine. I attached a screenshot about it.

Thank you for your time and effort to create great moodle stuff for rest of us!

Cheers

Mónico
Attachment attendancereport.jpg
In reply to Frederic Nevers

Re: Attendance sessions by hour

by Monico Briseño -
Picture of Testers
Hi, Fred. I started to play around with your Attendance session by hour. When I downloaded the attendance file in Excel format. I open it, but don't appear each hour information by day. I attached a screenshot.

This file is very important, because is the historical record related with each student attendance. Can you help us to solve this problem.

TIA



Attachment attendancefile.jpg
In reply to Frederic Nevers

Re: Attendance sessions by hour

by Monico Briseño -
Picture of Testers
Hi, Fred. I want to share the student point of view of his/her attendance report. In the following screenshot as you see attendance column appear without hour. I think is very important to include this information in the student report.

Cheers


Attachment attendancestudenview.jpg
In reply to Frederic Nevers

Re: Attendance sessions by hour

by Monico Briseño -
Picture of Testers
Hi, fred. I appreciate all your hard work on Attendance mod with sessions by hour. I updated the file that you attached and it works fine. I'm sending to you a screenshot.

Great job!cool
Attachment attendancebyhour.jpg
In reply to Monico Briseño

Re: Attendance sessions by hour

by Frederic Nevers -

Hi Monico,

Thanks for reporting these issues. I had not noticed them as I didn't even know it existed (the individual student report) and it's very useful.

I have now fixed the 2 issues you reported and included the files in this post. I haven't been able to resize the cells in the Excel document automatically during the export (time doesn't show unless you widen the cells). Does anyone know how to do this? Anyway, the time is now there in brackets.

I have tested Excel and CSV exports but have not been able to test ODS as I don't have Open Office. Could someone please check it out and let me know whether it works?

You will need to save the following files into their respective areas for the fixes to work:

  • mod/attforblock/locallib.php
  • mod/attforblock/export.php
  • blocks/attendance/lang/en-utf8/block-attendance.php

I hope this works for you as well as it does for me.

Cheers,

Fred

In reply to Frederic Nevers

Re: Attendance sessions by hour

by Monico Briseño -
Picture of Testers
Hi fred. You first comment is very important for me, because is the most important part of the Moodle: the community work. If you didn't notice them. I help you with my comment and you improve your great job. Thanks.

BTY, I downloaded the rar file. I put all of them in each proper folder and all work great!

Also, I tasted with Openoffice format and its works fine. I attached a screenshot of student report.

Cheers
Attachment attendancereport.jpg
In reply to Frederic Nevers

Re: Attendance sessions by hour

by Monico Briseño -
Picture of Testers
Hi, Fred. After to check attendance session by hour out, again. I found an issue on report tab section. I attached a screenshot of this situation.
When you click on Display menu and choose Months. All attendance taken appeared. But, when you click on Display menu an choose All taken Attendance session on October 8, column didn't appear.

Can you help to solve this?

TIA

Cheers


Attachment attendanceupdate.jpg
In reply to Monico Briseño

Re: Attendance sessions by hour

by Frederic Nevers -
Hi Monico,

I have had a similar issue in the past (before all the "multiple sessions" had been added) and I have no idea what the problem might be. I actually reported it in the tracker a couple of months ago. I have noticed that it happens when you create sessions that take place "in the past" e.g. adding a session for the 6th October when it is the 7th in real life. Not sure whether this makes sense smile
All I know, is that when you try to download the data to Excel or something like this, all sessions should appear just fine. This issue has even sorted itself out for some of my attendances????

@Barry,

I've looked into the DST issue further and found out that the timezone is set in your php.ini file. I haven't had the issue that you have as I live in an area which does not use DST. I have tried to add a function which would force the attendance module to not use DST but I have failed so far. If you are interested, I tried to use this function http://th.php.net/manual/en/function.date-default-timezone-set.php Would you have any idea how to use it?

I'll keep looking into it.

Cheers,
Fred
In reply to Frederic Nevers

Re: Attendance sessions by hour

by Monico Briseño -
Picture of Testers
Hi, Fred. Thank you for your sooner reply. The screenshot that I sent to you is related with a session created today. This situation can help to figure out where problem is. In OO spreadsheet or MS- Excel file appear attendance sessions correctly. No problem.

Cheers

In reply to Frederic Nevers

Re: Attendance sessions by hour

by Barry Oosthuizen -
Hi Fred,

Thanks for looking into the timezone issue. I I'll have a play with the function and see what I can come up with.

I've been thinking about the sessions that go off the page and thought maybe the layout of the report should be changed i.e. instead of expanding horizontally it should expand vertically in the same way as the layout of the individual student reports. Maybe use a drop down list somewhere to easily narrow it down to one student's records.

I suppose it's more of a problem for schools (like ours) where the attendance is taken by one central officer for all students in all classes/courses as apposed to tutors only taking attendance in their own course as in a university.

I also think if you view the report as "All taken" and you've taken more than 256 that it would not work in Excel (which only has 256 columns).

I'll be playing around to see what I can come with.

Barry




In reply to Frederic Nevers

Re: Attendance sessions by hour

by Monico Briseño -
Picture of Testers
Hi, Fred. After I sent to you my last comment. I checked attendance report section again. Suddendly in the All taken menu appeared all sessions taken without problem. I didn't do any different before this. I attached a screenshot of this report section.

Cheers


Attachment attendancebyhour.jpg
In reply to Monico Briseño

Re: Attendance sessions by hour

by umesh chavan -
HELO MONICO,

I AM USING THE LATEST VERSION OF MOODLE...I TRIED ATTENDANCE MODULE ITS VERY NICE...BUT I AM NOT GETTING TIME..IT GIVES 00.00....IN THE REPORT.
CAN YOU GUIDE ME?..I HAVE ALREADY ADDED REPORT.PHP AND BLOCK_ATTENDANCE.PHP FILES IN PROPER FOLDERS....

I ALSO WANT TO TAKE THE ATTENDANCE HOURLY...HOW TO CONFIGURE IT?

UMESH
In reply to umesh chavan

Re: Attendance sessions by hour

by Frederic Nevers -
Hello Umesh,

first things first smile, could you please type in your messages in lowercase, it's easier to read.

Use the files attached to this post to replace your existing files, in the right locations mentioned below (you might want to backup your existing files before doing this).

mod/attforblock/locallib.php
mod/attforblock/export.php
mod/attforblock/report.php
mod/attforblock/sessions.php
mod/attforblock/manage.php
blocks/attendance/lang/en-utf8/block-attendance.php

Please let me know if this doesn't work.

Hope this helps,
Fred
In reply to Frederic Nevers

Re: Attendance sessions by hour

by umesh chavan -
hello fred,
thanks for your suggestions...

i tried all the files you have given in proper folders but when i am replacing the block_attendance.php with odl one the page of attendance dosent appear...the file size 3kb dosent work...the file which has 5kb size works..but it doesnt give me time.. it shows 00.00 and i want hourly attendance....am using moodle verion...Moodle 1.9.2+ (Build: 20081008)....


kindly guide me....

regards
umesh
In reply to umesh chavan

Re: Attendance sessions by hour

by Frederic Nevers -
Hello Umesh,

I think your attendance might actually be working. It is normal that the attendance that you set up before modifying the code will appear as 00.00 as that's what the code was actually set to before I changed it. Installing the new code will not modify the sessions you had already created, you would have to do this manually.

Have you tried to add new sessions? When you add sessions, make sure that you set the time properly using the drop-down boxes and it should just register it into the database and show properly.

Please let me if that works.
Cheers,
Fred
In reply to Frederic Nevers

Re: Attendance sessions by hour

by umesh chavan -
helo fred,

thats great...it was my mistake..it was there the drop down menu for time but couldnt understood....now it fine...its working.
the only thing now is in the report it dosnt show 'session'...some other characters it shows....all the files are in place which you have already given....


regards
umesh
Attachment Clipboard02.jpg
In reply to umesh chavan

Re: Attendance sessions by hour

by Frederic Nevers -
Hi Umesh,

glad to hear you got it to work smile

It seems that I packaged a file that I shouldn't...

Please try and replace your existing blocks/attendance/lang/en-utf8/bolck-attendance.php with the one I attached to this message.

This should do the trick. Please let me know if it works so that I can repackage and make it available as a working version for everybody else to use smile

Cheers,
Fred
In reply to Frederic Nevers

Re: Attendance sessions by hour

by umesh chavan -
helo fred...

thats gr8.....now its working fine.....actually speaking i was doing rong ...and yes ofcourse all the files you sent helped me....

thanks a lot....

can you tell me can we use somthing like barcode or RFID attendnace cards scanning devices and attach to our module so attendance will happen automatically...students will swap the card and we will have complete attendance.....

one more thing ...can you add all select button for present students...so taht we can select all P with one click and only click for absent students whcih will be very less in no.....generally most students are present....
here am attaching a pic of one attendance system software.

Attachment Clipboard01.jpg
In reply to umesh chavan

Re: Attendance sessions by hour

by umesh chavan -
sorry fred...you are simply great...i havent seen that option of selecting all by one click...i found it...gr8 it will help me gr8ly...



thanks....

umesh
In reply to umesh chavan

Re: Attendance sessions by hour

by Frederic Nevers -
Hi Umesh,

I'm glad to hear that you got it to work in the end.

Thanks for all the praise but I'm afraid I am not the person who actually made the block smile . I only made some changes to allow multiple sessions per day. So the Javascript that allows you to select all present students is the work of Dimtry Pupinin, creator of the block (sorry if I didn't spell your name properly).

To answer your question about automatic attendance, I heard of people being able to link their SIS with the block. I think it all depends on how attendance is presently recorded with your RFID / barcodes. If the data is saved as a UNIX timestamp (which it probably is), then you will be good to go as the database uses these.

Thanks a lot for your feedback. I will repackage the files and make them available to everybody in this thread.

Cheers,
Fred


In reply to Frederic Nevers

Re: Attendance sessions by hour

by N Prasad -

Please do provide the entire release as a link directly in this forum. If possible, please add the weeks involved directly into the session. Eg. if I create a session Monday 11-1 for date range 1st June 2009, 31st June 2009, then there are 4 weeks in the period with respecitve dates Wk 1(1st june - 7th june), Wk 2 (8th june- 14th june).....etc. And in these columns for the session, it would be easy to to just add marks associate.

Also, it would be nice that we be allowed to create the particular attributes that we want store the scores in, with our our own mark limits, and of any particular type rather than just radio buttons. Preferrably use input boxes, which have validation. See my ideas attached here:

See the last Figure in the file attached for the week idea.

In reply to N Prasad

Re: Attendance sessions by hour

by Barry Oosthuizen -
This was the 'hacked' version to cater for more than one session a day (it was previously restricted to one session per day only). The current stable release is the best version to use and already has all the functionality of the hacked version plus more features like the 'with selected' option on the Sessions page and unlimited variables on the Settings page.

You can get the current stable version from the modules and plugins database if you haven't already.