Turnitin Assignment Report

Turnitin Assignment Report

by Juan F -
Number of replies: 2

Greetings,

I'm trying to create a dashboard SQL report (Moodle 2.9) that returns the course name, course id, turnitin assignment name, turnitin assignment id, and turnitin assignment introduction.  I reviewed the tables and came up with the following SQL:

SELECT
c.shortname,
c.id as "Course ID",
t.name as "Assignment Name",
t.intro

FROM mdl_turnitintool t
INNER JOIN mdl_course c ON c.id = t.id

WHERE c.category = 497
AND (c.shortname LIKE '%ACC%' OR c.shortname LIKE '%BSM%' OR c.shortname LIKE '%BUS%' OR c.shortname LIKE '%CIS%' OR c.shortname LIKE '%ECO%' OR c.shortname LIKE '%MGT%')
GROUP by c.shortname

It returns courses WITH turnitin assignments and courses without turnitin assignments.  What in the heck am I doing wrong?

Thanks for the assistance everyone!

Average of ratings: -
In reply to Juan F

Re: Turnitin Assignment Report

by Sam Chaffee -
Picture of Core developers

Hi Chris,

At a glance it looks like the join on the turnitin table is wrong: 

ON c.id = t.id

Probably should be something like:

ON c.id = t.course
Cheers,

Sam

In reply to Sam Chaffee

Re: Turnitin Assignment Report

by Juan F -

Sam, that did it.  Can't believe I overlooked this identifier.  Thanks for the extra help!

Chris