Professional Documents
Culture Documents
CASE
END as session,
value,
timemodified,
FROM `prefix_course_modules` as cm
JOIN prefix_modules as m ON cm.module=m.id
JOIN prefix_course as c ON cm.course = c.id
WHERE m.name LIKE '%scorm%'
GROUP BY cm.course,cm.module
ORDER BY count(cm.id) desc
Lists SCORM status for all enrolled users by Course name
This report will list the SCORM status for all users enrolled in the course. It is
ordered first by Course name, then student’s last name, then student’s first
name, then attempt number. This can be limited to individual courses by
adding to the where clause the course id to report on.
SELECT
u.firstname AS First,
u.lastname AS Last,
u.idnumber AS Employee_ID,
u.city AS City,
uid.data AS State,
u.country AS Country,
g.name AS Group_name,
c.fullname AS Course,
st.attempt AS Attempt,
st.value AS Status,
FROM_UNIXTIME(st.timemodified,"%m-%d-%Y") AS Date
FROM prefix_scorm_scoes_track AS st
JOIN prefix_user AS u ON st.userid=u.id
JOIN prefix_user_info_data AS uid ON uid.userid = u.i
d
JOIN prefix_scorm AS sc ON sc.id=st.scormid
JOIN prefix_course AS c ON c.id=sc.course
JOIN prefix_groups AS g ON g.courseid = c.id
JOIN prefix_groups_members AS m ON g.id = m.groupid
UNION
SELECT
user2.firstname AS First,
user2.lastname AS Last,
user2. idnumber AS Employee_ID,
user2.city AS City,
uid.data AS State,
user2.country AS Country,
g.name AS Group_name,
c.fullname AS Course,
"-" AS Attempt,
"not_started" AS Status,
"-" AS Date
FROM prefix_user_enrolments AS ue
JOIN prefix_enrol AS e ON e.id = ue.enrolid
JOIN prefix_course AS c ON c.id = e.courseid
JOIN prefix_user AS user2 ON user2 .id = ue.userid
JOIN prefix_user_info_data AS uid ON uid.userid = use
r2.id
JOIN prefix_groups AS g ON g.courseid = c.id
JOIN prefix_groups_members AS m ON g.id = m.groupid
JOIN prefix_scorm AS sc ON sc.course=c.id
Left Join prefix_scorm_scoes_track AS st on st.scormi
d=sc.id AND st.userid=user2.id
, cc.name AS 'Category'
, scm.name AS 'Sample Activity Name'
, FROM_UNIXTIME(c.startdate) AS 'Course Start Date'
, COUNT(DISTINCT cm.id) AS 'Resources Used'
#, FROM_UNIXTIME(cm.added) AS 'resource added'
FROM prefix_course_modules AS cm
JOIN prefix_modules AS m ON cm.module = m.id AND m.na
me LIKE 'SCO%'
WHERE
1
%%FILTER_STARTTIME:c.startdate:>%%
%%FILTER_ENDTIME:c.startdate:<%%
This report shows the users completion status of activities across all
courses. It is intended to be uses with Configurable Reports filters for user,
start and end times, and also to be able to search the Module names.
Note: The CASE statement with module numbers may differ on different
systems, depending on the number give to the module when the site was
created or the module added to the site. These are common default
numbers, but you should check your id numbers for them in the
course_modules table and adjust as required. You can also add other, third-
party plugins too if you wish.
SELECT
u.username As 'User',
c.shortname AS 'Course',
m.name AS Activitytype,
CASE
WHEN cm.module = 1 THEN (SELECT a1.name FROM pref
ix_assign a1 WHERE a1.id = cm.instance)
WHEN cm.module = 2 THEN (SELECT a2.name FROM pref
ix_assignment a2 WHERE a2.id = cm.instance)
WHEN cm.module = 3 THEN (SELECT a3.name FROM pref
ix_book a3 WHERE a3.id = cm.instance)
WHEN cm.module = 4 THEN (SELECT a4.name FROM pref
ix_chat a4 WHERE a4.id = cm.instance)
WHEN cm.module = 5 THEN (SELECT a5.name FROM pref
ix_choice a5 WHERE a5.id = cm.instance)
WHEN cm.module = 6 THEN (SELECT a6.name FROM pref
ix_data a6 WHERE a6.id = cm.instance)
WHEN cm.module = 7 THEN (SELECT a7.name FROM pref
ix_feedback a7 WHERE a7.id = cm.instance)
WHEN cm.module = 8 THEN (SELECT a8.name FROM pref
ix_folder a8 WHERE a8.id = cm.instance)
WHEN cm.module = 9 THEN (SELECT a9.name FROM pref
ix_forum a9 WHERE a9.id = cm.instance)
WHEN cm.module = 10 THEN (SELECT a10.name FROM pr
efix_glossary a10 WHERE a10.id = cm.instance)
WHEN cm.module = 11 THEN (SELECT a11.name FROM pr
efix_imscp a11 WHERE a11.id = cm.instance)
WHEN cm.module = 12 THEN (SELECT a12.name FROM pr
efix_label a12 WHERE a12.id = cm.instanc
e)
WHEN cm.module = 13 THEN (SELECT a13.name FROM pr
efix_lesson a13 WHERE a13.id = cm.instance
)
WHEN cm.module = 14 THEN (SELECT a14.name FROM pr
efix_lti a14 WHERE a14.id = cm.ins
tance)
WHEN cm.module = 15 THEN (SELECT a15.name FROM pr
efix_page a15 WHERE a15.id = cm.instanc
e)
WHEN cm.module = 16 THEN (SELECT a16.name FROM pr
efix_quiz a16 WHERE a16.id = cm.instan
ce)
WHEN cm.module = 17 THEN (SELECT a17.name FROM pr
efix_resource a17 WHERE a17.id = cm.instance)
WHEN cm.module = 18 THEN (SELECT a18.name FROM pr
efix_scorm a18 WHERE a18.id = cm.instance
)
WHEN cm.module = 19 THEN (SELECT a19.name FROM pr
efix_survey a19 WHERE a19.id = cm.instanc
e)
WHEN cm.module = 20 THEN (SELECT a20.name FROM pr
efix_url a20 WHERE a20.id = cm.i
nstance)
WHEN cm.module = 21 THEN (SELECT a21.name FROM pr
efix_wiki a21 WHERE a21.id = cm.in
stance)
WHEN cm.module = 22 THEN (SELECT a22.name FROM pr
efix_workshop a22 WHERE a22.id = cm.instanc
e)
END AS Actvityname,
# cm.section AS Coursesection,
CASE
WHEN cm.completion = 0 THEN '0 None'
WHEN cm.completion = 1 THEN '1 Self'
WHEN cm.completion = 2 THEN '2 Auto'
END AS Activtycompletiontype,
CASE
WHEN cmc.completionstate = 0 THEN 'In Progress'
WHEN cmc.completionstate = 1 THEN 'Completed'
WHEN cmc.completionstate = 2 THEN 'Completed with
Pass'
WHEN cmc.completionstate = 3 THEN 'Completed with
Fail'
ELSE 'Unknown'
END AS 'Progress',
DATE_FORMAT(FROM_UNIXTIME(cmc.timemodified), '%Y-%m-%
d %H:%i') AS 'When'
FROM prefix_course_modules_completion cmc
JOIN prefix_user u ON cmc.userid = u.id
JOIN prefix_course_modules cm ON cmc.coursemoduleid =
cm.id
JOIN prefix_course c ON cm.course = c.id
JOIN prefix_modules m ON cm.module = m.id
# skip the predefined admin and guest user
WHERE u.id > 2
# config reports filters
%%FILTER_USERS:u.username%%
%%FILTER_SEARCHTEXT:m.name:~%%
%%FILTER_STARTTIME:cmc.timemodified:>%% %%FILTER_ENDT
IME:cmc.timemodified:<%%
ORDER BY u.username