Getting attendance report at category level

Getting attendance report at category level

by Ramamoorthy Makkithaya -
Number of replies: 21

Hi,

I would like to generate report at a category level to see who all attended specific courses in certain duration. My scenario is :

 

- Create a category specific to a project

- Create multiple courses under that category [project]

- Subscribe certain project members to category

- Schedule the training plan

- Take attendance for each of the planned course [If there is an option to capture the attendance if an only if someone has provided the feedback, it would be great]

- Then take report at category [project] level to see who all attended the coursse

- Report shou be have fields like 'Category' , 'Course name' , 'Teacher', "Atennded date', 'Quiz marks' etc .

Any idea how can we implement the same using attndance module/feedback module?

 

Thanks,

Ramamoorthy

 

 

Average of ratings: -
In reply to Ramamoorthy Makkithaya

Re: Getting attendance report at category level

by Barry Oosthuizen -
Hi Ramamoorthy,

You'd need to do quite a bit of customised coding to get your desired report. Are you familiar with PHP? You could take a look at the project I'm working on. It already sets you off in the right direction. CONTRIB-1400
In reply to Barry Oosthuizen

Re: Getting attendance report at category level

by Ramamoorthy Makkithaya -

Hi Barry,

Thanks for the reply. I am not having much experience in PHP. However would like to give a try. Would you be able to let me know the files that I might need to modify for this request.

Is the project you are working on towards this feature only? Is it available for beta version which I can install and try it out?

Thanks,

Ramamoorthy

In reply to Ramamoorthy Makkithaya

Re: Getting attendance report at category level

by Barry Oosthuizen -
Hi Ramamoorthy,

My project deals mainly with the reporting part of your idea (though just in a general way - not doing specifically what you want).

Let's look at your requirements:

  • - Create a category specific to a project
  • - Create multiple courses under that category [project]
  • - Subscribe certain project members to categoryI think this not so straightforward.
Use Meta Courses and Child Courses for the above. If Moodle allowed you to enroll students into a Course category you would be better off (less work to do later when it comes to reporting).

  • - Schedule the training plan
Do this by creating sessions in Attendance module?

  • - Take attendance for each of the planned course [If there is an option to capture the attendance if an only if someone has provided the feedback, it would be great]
Do you mean you don't want them to appear on the list unless they've provided feedback to a specific feedback questionaire? If so, you would need to edit the attendances.php file and possibly the locallib.php file. You would also need to create a form of some sort and add database table/fields where you can store which feedback instance has to be completed for them to appear on the list. This whole part is a big job!

  • - Then take report at category [project] level to see who all attended the coursse
Here you need to edit the adv_report.php and reportlib.php files (if you're using my modifications) or you could just edit report.php can locallib.php so that the report recoginises whether the course is a meta / child course and the act accordingly (show all attendance for related courses).

  • - Report shou be have fields like 'Category' , 'Course name' , 'Teacher', "Atennded date', 'Quiz marks' etc .
I have added extra fields to my reports (and to the whole way I use the attendance module) so you have lots of examples to work from, only your fields are probably not so straightforward wink (mine don't have any logic/rules attached). My reports do allow you to view attendance of all courses that you have permission to view (or one at a time).

In reply to Barry Oosthuizen

Re: Getting attendance report at category level

by Ramamoorthy Makkithaya -

Hi Barry,

Is there a way in which I can try your changes on my server and see if it gives me few of the functionalities which I am looking for?

Thanks,

Ramamoorthy

In reply to Ramamoorthy Makkithaya

Re: Getting attendance report at category level

by Barry Oosthuizen -
Hi Ramamoorthy,

Sure, just download the 2nd file at CONTRIB-1400 in the Tracker and extract it to your mod folder.

If you already have an attendance module installed you will have to go to Site Admin > Modules and delete the old attforblock (all your data will be lost). Then go to Site Admin > Notifications.

Cheers,

Barry
In reply to Barry Oosthuizen

Re: Getting attendance report at category level

by Ramamoorthy Makkithaya -

Hi Barry,

Thanks for this. I tried out the latest zipped file [260809_0015_attforblock.zip ] . Advanced report is somewhat I am looking for. However have few more queries.

- As you mentioned , I will be able to take report based on the permission that I have. What is the kind of permission it looks for? Course creator,teacher or anything else. As an admin of whole site, can't I have access to all courses?

- There is no export to excel feature availabe when I take advanced report. Everything will be displayed on the web page itself. Is there a way I can export that to excel?

- Also the fields like 'Category' and 'attended date' is not available. Category will be an important field to segregate the courses further. Is it possible to add that field?

Thanks,

Ramamoorthy

In reply to Ramamoorthy Makkithaya

Re: Getting attendance report at category level

by Barry Oosthuizen -
Hi Ramamoorthy,

Thanks for checking out the new code.

As an admin of the whole site you shouldn't have any problems viewing anything. You could always remove the check for permission if that fits in with your setup.

I have not worked on the excel export feature. From what I remember it's not too difficult to modify.

You can add 'Category' field if you want. I don't have time to work on it and don't have any need for it. It should be simple. Maybe look at how I added 'groups' and work from there. (You basically just have to use the category table instead of the groups table from the database). By the way the 'groups' field doesn't check for permissions as far as I remember.

Not sure what you mean with 'attended date'. Do you mean the time that the student arrived/left?

Cheers,

Barry



In reply to Barry Oosthuizen

Re: Getting attendance report at category level

by Ramamoorthy Makkithaya -

Hi Barry,

Thanks for the reply.

As an admin I can view all the courses. However when I take the advanced report, I get the report for only few of the courses. Not of all. Any idea why?

Attended date I mean the date when the attendance is taken. This will help us in knowing when was the session conducted and when a student attended the course.

Can you give me pointers as to which files that I need to modify for having excel export feature and having category field? That would help me in starting with the changes.

Thanks,

Ramamoorthy

In reply to Ramamoorthy Makkithaya

Re: Getting attendance report at category level

by Barry Oosthuizen -
Hi Ramamoorthy,

To have a course's attendance included in the advanced report you need the following:

  1. Students enrolled your courses
  2. Attendance sessions created
  3. Attendance taken.
  4. The right combination of filters (to report everything leave everything on 'All')
  5. A valid date range set in the filters
Also on the advanced report page in the 'Status' filter section, if you select e.g. 'Course 2 - * Present' and 'Course 1' under the Course section you won't get any results. In other words if you drill down that far you have to take it one course at a time because each course has it's own set of statuses in the database (even though they look the same).

I have just tried with two courses following all of the above and I get everything on my report (only the sessions where attendance has actually been taken), so I can't reproduce your problem.

To find out which files to edit: Browse to the relevant page in your browser and then look in the address bar. The name of the main file will be there.

I also use Eclipse to help me find out where functions were defined etc. Saves me lots of trouble.

Cheers,

Barry

In reply to Ramamoorthy Makkithaya

Re: Getting attendance report at category level

by Ramamoorthy Makkithaya -
Hi, Is creating a session and taking attendance [Both] must for a course to appear in advanced report? Is there a way we can make it available even without those? Thanks, Ramamoorthy
In reply to Ramamoorthy Makkithaya

Re: Getting attendance report at category level

by Ramamoorthy Makkithaya -

Hi,

Also, when I go to advanced report in the course list there are only few courses listed. I see that only 9 courses listed there. Whereas there are around 20 odd courses in the portal. So I am not very much sure as to what is the fileter criteria getting used.

Thanks,

Ramamoorthy

In reply to Ramamoorthy Makkithaya

Re: Getting attendance report at category level

by Barry Oosthuizen -
As far as I can tell all you need to get a course listed in the dropdown menu (filter option) is to have students enrolled in that particular course.

Do all your 20 odd courses have students enrolled? If not, then there is no point in reporting on the attendance for those courses.

If you're using Meta courses / child courses I'm not sure what the results will be.
In reply to Barry Oosthuizen

Re: Getting attendance report at category level

by Ramamoorthy Makkithaya -

Hi Barry,

Yes. Students have enrolled to those courses. One of the course even I tried to create a session and record attendance. Even after doing it, that course is not listed in course list box. Hoever if I click on report section, I am able to see the recoreded attendance for that course.

I am not sure if I am missing anything here.

Thanks,

Ramamoorthy

In reply to Ramamoorthy Makkithaya

Re: Getting attendance report at category level

by Barry Oosthuizen -
Hi Ramamoorthy,

Sorry, I'm not able to reproduce your problem. The only other thing I can think of is the course start dates, maybe try setting this to an earlier date. If the course start date is later than the session date this can cause problems.

If you could figure out (by experimenting) what triggers certain courses to be listed and certain courses not listed in the dropdown box I'll be able to fix it. It's not giving me any problems.

Maybe write down all the variables of your 20 courses e.g. course start date, session dates, attendance has been taken, students are enrolled, etc. Then see if your list makes sense. From the list then check which courses are not being displayed in the dropdown box. With this info you/I should be able to figure out what's going on.

Cheers,

Barry
In reply to Barry Oosthuizen

Re: Getting attendance report at category level

by Ramamoorthy Makkithaya -

Hi Barry,

I played around with the data. Found the issue.

I am the overall site admin for my training portal. With that access I will not be able to see all the courses in the advanced report. For seeing any courses in the list, I should be past of any of the roles [Admin,teacher,student etc] for that particular course. If I am not in any of those roles, that course will not be visible to me.

Can a overall site admin be able to see all the courses without getting added to any of the roles for individual courses?

Thanks,

Ramamoorthy

In reply to Ramamoorthy Makkithaya

Re: Getting attendance report at category level

by Barry Oosthuizen -
Hi Ramamoorthy,

I have only tried this as the overall admin for the whole site and as a student.

For seeing any courses in the list, I should be past of any of the roles [Admin,teacher,student etc] for that particular course. If I am not in any of those roles, that course will not be visible to me.

Do you mean you have to have one of those roles in the course itself to see it in the dropdown list?

This might explain why everything is working for me because I'm the site admin and also enrolled myself into the courses as a student...

If you can confirm that this is the issue I'll look for a fix.

Cheers,

Barry
In reply to Barry Oosthuizen

Re: Getting attendance report at category level

by Ramamoorthy Makkithaya -

Hi Barry,

Yes. If I have enrolled to the courses, [Asanything like teacher,admin,student etc] it will be appearing in course listbox. If I am not enrolled that course will not be appeared eventhough I am the site admin.

Thanks,

Ramamoorthy

In reply to Ramamoorthy Makkithaya

Re: Getting attendance report at category level

by Barry Oosthuizen -
Hi Ramamoorthy,

Thanks for you help in identifying the issue.

See if this will fix it for you:

Change advanced_report_form.php starting from around line 23 as follows:

// add a course select element to the form
$courselist = array('-1' => 'All');
if (has_capability('moodle/legacy:teacher', $context)) {
$courses = get_courses("all", "c.fullname ASC", "c.*");
} else {
$courses = get_my_courses($USER->id, 'fullname ASC, sortorder ASC,visible DESC', '*', false, 21);
}
foreach($courses as $course) {
$courselist[$course->id] = $course->fullname;
}

I just tried it and then created a new course without assigning any roles and it showed up in the exisiting courses course listbox. This should allow anyone with a sitewide role of nonediting teacher and higher to view all courses otherwise the functionality will be as before.

Cheers,

Barry
In reply to Barry Oosthuizen

Re: Getting attendance report at category level

by Kent Calero -

Barry, the fix worked in getting all courses to be listed, however, the report is still limited to the students within that specific course.

I'm currently running the report from within a random course. Does the attendance activity need to be added to the front page and the report ran from there? Please advise

As you mentioned, I believe it woudl be beneficial to run the report from the admin-reports screen.

In reply to Kent Calero

Re: Getting attendance report at category level

by Barry Oosthuizen -
Hi Kent,

You don't have to add the attendance activity to the front page.

Which paramaters have you selected from the dropdown lists?

Once you make selections from the 'Status' option the report will be restricted to one course only. This is because each course has it's own statuses with a unique id (even if they may have the same acronym/description. Maybe I should make it a multiselect so you can select more than one status at a time.

Re: Moving the report to the admin-reports screen
I guess for our situations it makes sense but for other colleges where each teacher is responsible for their own attendance records in their course I imagine it would be preferable to have the reports inside their course. It will also be harder to maintain as we'll then have 3 separate packages (mod, block & admin-report).

Cheers,

Barry
In reply to Ramamoorthy Makkithaya

Re: Getting attendance report at category level

by Barry Oosthuizen -
If by 'course' you mean results (after clicking update) then:

Yes. To get any results in the report this is required.

No. There is no other way.