On-screen attendance report only shows one session for week, downloaded report cannot differentiate sessions

On-screen attendance report only shows one session for week, downloaded report cannot differentiate sessions

by Margot Schuhmacher -
Number of replies: 5
When I view the Attendance Report and click on an individual student participant, only one of the weekly sessions (two sessions recorded each week) are displayed.

Below is the participant attendance report showing 22 sessions have been completed over 11 weeks, and one session is displayed for each week (randomly shows either the Lab or Tutorial Attendance). How can we display all sessions for a week on the screen?

Is the code only looking at the first session for a week in the database to display the report on screen, rather than displaying all sessions?

Also when we download the report in Excel format, I cannot differentiate the sessions, as the description is not included (a workaround I guess would be for the sessions to have different days/times).

Margot

Sessions completed: 22
Present: 18
Late: 0
Excused: 0
Absent: 4
Attendance percent: 81.82 %
Attendance grade: 36 / 44
   
# Date Time Description Status Remarks
1 27.07.09 (Mon) 09:00 Lab Attendance Present
2 3.08.09 (Mon) 09:00 Tutorial Attendance Present
3 10.08.09 (Mon) 09:00 Tutorial Attendance Present
4 17.08.09 (Mon) 09:00 Lab Attendance Present
5 24.08.09 (Mon) 09:00 Lab Attendance Absent
6 31.08.09 (Mon) 09:00 Tutorial Attendance Present
7 7.09.09 (Mon) 09:00 Tutorial Attendance Present
8 14.09.09 (Mon) 09:00 Tutorial Attendance Absent
9 21.09.09 (Mon) 09:00 Tutorial Attendance Present
10 5.10.09 (Mon) 10:00 Lab Attendance Present
11 12.10.09 (Mon) 10:00 Tutorial Attendance Present

Average of ratings: -
In reply to Margot Schuhmacher

Re: On-screen attendance report only shows one session for week, downloaded report cannot differentiate sessions

by Barry Oosthuizen -
Hi Margot,

Which version are you using?

I don't know why some of your sessions are not being displayed (mine are all showing up fine, three sessions a day, different days, etc). Maybe it's related to the problem others had with the Monthly Reports - see previous discussions. Did you have that problem as well? Just a thought.

Excel Report:
To get the description in your Excel download you could make a small change to the export.php

Change line 67 from

$data->tabhead[] = userdate($sess->sessdate, get_string('strftimedmy', 'attforblock'));

to

$data->tabhead[] = userdate($sess->sessdate, get_string('strftimedmy', 'attforblock')).' - '.$sess->description;

If you want to include the weekday e.g. '(Mon) (Tue)' you could use

$data->tabhead[] = userdate($sess->sessdate, get_string('strftimedmyw', 'attforblock')).' - '.$sess->description;

In this case you would need to edit your language file (mod/attforblock/lang/en/attforblock.php)

Change

$string['strftimedmyw'] = '%%d.%%m.%%y (%%a)';

to

$string['strftimedmyw'] = '%%d.%%m.%%y(%%a)';

This is to get rid of the ' ' in your excel export. It will also change the format 7.09.09 (Mon) to 7.09.09(Mon) - it get's rid of the space before '(' from your Sessions list under the Sessions tab

Cheers,

Barry

In reply to Barry Oosthuizen

Re: On-screen attendance report only shows one session for week, downloaded report cannot differentiate sessions

by Margot Schuhmacher -
Thanks for the information. I have worked out why not all sessions are displaying in the participant report. The lecturer had created "weekly" tutorial and lab sessions for classes run over several days (as we have 200 students). Both the tutorial and lab sessions were set to be the same day and time each week (e.g. Monday 09:00). If I make one of the sessions a different time (e.g. Monday 11:00) all sessions appear.

Margot
In reply to Margot Schuhmacher

Re: On-screen attendance report only shows one session for week, downloaded report cannot differentiate sessions

by Barry Oosthuizen -
Hi Margot,

That's great you found the reason. I don't see why you shouldn't be able to have more than one session at the same time. It seems when multiple sessions per day were introduced the code still tries to prevent duplicates by not allowing more than one session per start time. I think a better way for preventing duplicates would be to check the time and description together, not just the time.

Cheers,

Barry

In reply to Barry Oosthuizen

Re: On-screen attendance report only shows one session for week, downloaded report cannot differentiate sessions

by Margot Schuhmacher -
Hi Barry

Thanks for all the information - yes I agree adding the description in the downloaded report allows differentiation. I have tested the code changes you advised for export.php which has solved this problem (but only one session per week seems to appear on the screen display if sessions have same start time with different descriptions).

cheers
Margot
In reply to Margot Schuhmacher

Re: On-screen attendance report only shows one session for week, downloaded report cannot differentiate sessions

by Barry Oosthuizen -
Hi Margot,

Glad to hear the solution worked for you.

Regarding the duplicates:

I've just downloaded the latest code for 1.9.x to see where the problem is and it seems the duplicate checks have been completely commented out (see lines 88 - 92 and 148 - 153). Which version are you using?

If you have a different version you can either upgrade or comment out the 4/5 lines of each section of code that contain something like:

count_records('attendance_sessions', 'courseid', $course->id, 'sessdate',

Or, if you want it to check the start time + description for duplicates then do the following:

1. make sure you have the lates version

2. uncomment all the lines mentioned above (delete the // at the start of each line)

3. Change line 88 to:

if(count_records('attendance_sessions', 'courseid', $course->id, 'sessdate', $sdate, 'description', $fromform->sdescription) > 0) {

4. Change line 148 to:

$count = count_records('attendance_sessions','courseid', $course->id, 'sessdate', $newdate, 'description', $fromform->sdescription);

I'm almost sure it would work (but haven't tested it myself).

Cheers,

Barry