Configurable Reports does not work since update

Configurable Reports does not work since update

by Wolf Georg Tews -
Number of replies: 2
Hello together,

we experience a problem with our configurable reports SQL Code since we updated our system to 3.4.

Can anybody help us with following code snippet?

SELECT

u.firstname AS 'First Name'

, u.lastname AS 'Last Name'

, CONCAT('<a target="_blank" href="%%WWWROOT%%/report/outline/user.php',CHAR(63),'id=',u.id,'&course=',c.id,'&mode=complete','">','Link','</a>') AS 'Links to Activity Report'

 

# ,  COUNT(l.id) AS 'Edits'

 

, SUM(IF(FLOOR((l.TIME - c.startdate)/(60*60*24*7))=1,1,0)) AS 'Unit 0 Post'

 

#, CONCAT('<a target="_blank" href="%%WWWROOT%%/report/log/index.php',CHAR(63),'chooselog=1&showusers=1&showcourses=0&id=',c.id,'&user=',u.id,'&date=0&modid=&modaction=&logformat=showashtml','">','Logs','</a>') AS 'Logs'

 

#, CONCAT('<a target="_blank" href="%%WWWROOT%%/report/outline/user.php',CHAR(63),'id=',u.id,'&course=',c.id,'&mode=outline">','Outline','</a>') AS 'Activity Outline'

 

#, CONCAT('<a target="_blank" href="%%WWWROOT%%/report/outline/user.php',CHAR(63),'id=',u.id,'&course=',c.id,'&mode=complete">','Activity','</a>') AS 'Consolidated Activity'

 

FROM prefix_user AS u

JOIN prefix_role_assignments AS ra ON u.id = ra.userid

JOIN prefix_context AS ctx ON ra.contextid = ctx.id

JOIN prefix_course AS c ON c.id = ctx.instanceid

JOIN prefix_course_categories AS cc ON c.category = cc.id

 

LEFT JOIN prefix_log AS l ON l.userid = u.id AND l.course = c.id  AND l.action LIKE "%add%" 

 

WHERE c.id = %%COURSEID%%

AND ra.roleid =5

AND ctx.instanceid = c.id

GROUP BY u.id

ORDER BY u.lastname, u.firstname


Thank you in advance.

Kind Regards
Wolf Georg Tews


Average of ratings: -
In reply to Wolf Georg Tews

Re: Configurable Reports does not work since update

by Ben Haensel -

What is the error you're getting? If you just created that report, you'll need to check the box to make it a "Global Report" in the report settings for the '%%COURSEID%%' filter to work. -Ben

In reply to Ben Haensel

Re: Configurable Reports does not work since update

by Wolf Georg Tews -

Dear Ben,

thank you for your answer - apparently, the plugin does not count correctly.

I inserted some more weeks in the code. In unit 3 in the first row should stay 7 instead of 2.

It should only count the posts created in the specific week.


CR_example

Thank you in advance and have a great weekend.

Best

Georg