lesson activity does not show any detailed statistics

lesson activity does not show any detailed statistics

by zena kar -
Number of replies: 1

Hi there,

I have created a few lesson activity's on Moodle for my class of students, and each of these students had completed the lesson a week ago in an in-class session. The lesson activity was also set up using the groups and groupings settings as i only wanted specific students taking the lesson. When i came to view the 'reports' tab under the lesson i was surprised to see that under both 'overview' and 'detailed statistics' it said 'No attempts have been made on this lesson'.

This is a real shame as i really need the data to analyse my findings on the specific lessons i have created, please can anyone help?

Thanks,

Zena.

Average of ratings: -
In reply to zena kar

Re: lesson activity does not show any detailed statistics

by Joel Allen -

I have noticed the same problems you are describing.  The lesson report tab was not showing any information after enabling groups and groupings.  I am running version 1.9.10.

I have experimented on one of my test boxes and may have found a solution by modifying the following file.  (mod/lesson/report.php)

Around line 21 there is a check to see if the lesson is using groupings and if so it appear to build a bad SQL query string.  The query seems to be trying to select based on a groupingid field value when it should be using a groupid field value.

As a test I remarked the conditional statement used to determine which query to use and the reporting tab is now showing me what I expect.  Not sure I have have broken any other feature by making this change.

Hopefully some others will speak up in this thread to verify the problem and solution.

The code block looks like this after i made the changes.

//    if (!empty($CFG->enablegroupings) && !empty($cm->groupingid)) {
//        $sql = "SELECT DISTINCT u.*
//                FROM {$CFG->prefix}lesson_attempts a
//                    INNER JOIN {$CFG->prefix}user u ON u.id = a.userid
//                    INNER JOIN {$CFG->prefix}groups_members gm ON gm.userid = u.id
//                    INNER JOIN {$CFG->prefix}groupings_groups gg ON gm.groupid = {$cm->groupingid}
//                WHERE a.lessonid = '$lesson->id'
//                ORDER BY u.lastname";
//    } else {
$sql = "SELECT u.*
FROM {$CFG->prefix}user u,
{$CFG->prefix}lesson_attempts a
WHERE a.lessonid = '$lesson->id' and
u.id = a.userid
ORDER BY u.lastname";
//    }

 

Joel Allen