Wouldn't it be nice: Rubric ratings in a Database

Re: Wouldn't it be nice: Rubric ratings in a Database

by Gordon Carter -
Number of replies: 0

I agree Matthias. Our LMS Developer has been out since January and I've had no help trying to find where things are stored. I've been tasked with developing a process for reporting related to Rubrics, Badges, etc and it's been a nightmare figuring this out. As for the Rubrics, one report is supposed to be How Many Participants Scored a 3, 2, 1, etc. I guess on the front end the user can assign scores but the scores aren't necessarily stored on the back end. The scores are related to Badge Statements so if a statement is related to a score of 3, then the statement is provided, not the score. I had to assign scores to each statement but that sometimes doesn't work because there are editing errors in the DB so even wildcards sometimes don't work efficiently. I've deterimined that Moodle isn't a developer-friendly DB system even though it's useful for users on the front end. sad


This is my code to get the "Scores". Note that 'Score' is the actual "Score" and I attached 0,1,2,3 to them in SQL.: 

SELECT gd.name AS 'Rubric Name',grc.description AS 'Criteria Description',grl.definition AS 'Score',grf.remark AS 'Grader Remarks', c.id as courseid

,crs.shortname AS 'Course',asg.name AS 'Assignment Name', stu.id AS 'User ID', stu.firstname, stu.lastname, stu.idnumber as useridnumber,stu.username

,DATE_ADD('1970-01-01', INTERVAL asg.duedate SECOND) AS 'Due Date'

FROM `prefix`.`mdl_course` AS crs

JOIN `prefix`.`mdl_course_modules` AS cm ON crs.id = cm.course

JOIN `prefix`.`mdl_assign` AS asg ON asg.id = cm.instance

JOIN `prefix`.`mdl_context` AS c ON cm.id = c.instanceid

JOIN `prefix`.`mdl_grading_areas` AS ga ON c.id=ga.contextid

JOIN `prefix`.`mdl_grading_definitions` AS gd ON ga.id = gd.areaid

JOIN `prefix`.`mdl_gradingform_rubric_criteria` AS grc ON (grc.definitionid = gd.id)

JOIN `prefix`.`mdl_gradingform_rubric_levels` AS grl ON (grl.criterionid = grc.id)

JOIN `prefix`.`mdl_grading_instances` AS gin ON gin.definitionid = gd.id

JOIN `prefix`.`mdl_assign_grades` AS ag ON ag.id = gin.itemid

JOIN `prefix`.`mdl_user` AS stu ON stu.id = ag.userid

JOIN `prefix`.`mdl_user` AS rubm ON rubm.id = gin.raterid

JOIN `prefix`.`mdl_gradingform_rubric_fillings` AS grf ON (grf.instanceid = gin.id)

AND (grf.criterionid = grc.id) AND (grf.levelid = grl.id)

WHERE gin.status = 1 and CRS.id in (3974, 3975, 3976, 3977, 3978, 3979, 3980) and grc.sortorder <> 11 

ORDER BY gd.name ASC,stu.lastname ASC,stu.firstname ASC,grc.description ASC