Drop-down filter by grade item name

Drop-down filter by grade item name

by andrea light -
Number of replies: 1
I am new to SQL so any help you could offer would be appreciated!

I have a specific course that contains 3 Topics/scorm packages and one quiz.  

2017 course

  • Module 1
  • Module 2
  • Module 3
  • Final Quiz

Is it possible to add a dropdown filter that will contain only the 4 items inside my 2017 course?

I was able to use %%FILTER_CATEGORIES:c.category%% to filter individual courses before, but now all of my courses are contained within the same course. %%FILTER_CATEGORIES:gi.itemname%% does not work.

Here is the code I altered.....

SELECT u.firstname AS 'First' , u.lastname AS 'Last',

gi.itemname AS 'item name',

ROUND(gg.finalgrade,2) AS Grade, 

DATE_ADD('1970-01-01', INTERVAL gi.timemodified SECOND) AS Time

 

FROM prefix_course AS c

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

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

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

JOIN prefix_grade_grades AS gg ON gg.userid = u.id

JOIN prefix_grade_items AS gi ON gi.id = gg.itemid

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

 

WHERE  gi.courseid = c.id AND cc.name = '2017 Vehicle Emissions Testing Program Course' AND gi.itemtype = 'mod'

%%FILTER_CATEGORIES:c.category%%

%%FILTER_SYSTEMUSER:ra.userid%%

%%FILTER_SEARCHTEXT:gi.itemname:~%%

%%FILTER_STARTTIME:gg.timemodified:>%% %%FILTER_ENDTIME:gg.timemodified:<%% 

ORDER BY firstname

Average of ratings: -
In reply to andrea light

Re: Drop-down filter by grade item name

by Randy Thornton -
Picture of Documentation writers

Dropdown, I don't believe so.

There is a user module filter but it shows all the modules for a user, not certain ones. There are filters for %%FILTER_COURSEMODULEID:columnname, %%FILTER_COURSEMODULEFIELDS:columnname and %%FILTER_COURSEMODULE:columnname though.

You could limit your WHERE statement to just those four mods, since you are querying a specific course, so at least the search output would only cover those four.