lesson activity does not show any detailed statistics

Re: lesson activity does not show any detailed statistics

by Joel Allen -
Number of replies: 0

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