Hi Gordon,
thanks to you for your great work!
A couple more of things...
When, as a student, I click on the "Item Analisys Report" I get a repeated warning (I think It appears so many times as the student's attemps number):
Did you remember to make the first column something unique in your call to get_records? Duplicate value '18' found in column 'id'.
- line 1014 of \lib\dml\mysqli_native_moodle_database.php: call to debugging()
- line 1395 of \lib\tablelib.php: call to mysqli_native_moodle_database->get_records_sql()
- line 152 of \mod\hotpot\report\renderer.php: call to table_sql->query_db()
- line 88 of \mod\hotpot\report\renderer.php: call to mod_hotpot_report_renderer->reportcontent()
- line 93 of \mod\hotpot\report.php: call to mod_hotpot_report_renderer->render_report()
I've been trying to find the problem by comparing with the hotpot add-on used in my university during this academic year (in a older version of Moodle).
In the query, I think the problem is the table "mdl_user u". It shouldn't appear at the FROM statement...(maybe?)
SELECT ha.*,
(ha.timemodified - ha.timestart) AS duration,
1 AS q_0,
1 AS q_1,
1 AS q_2,
1 AS q_3,
1 AS q_4,
1 AS q_5,
1 AS q_6,
1 AS q_7,
1 AS q_8,
1 AS q_9,
ROUND (gg.rawgrade, 0) AS grade
FROM mdl_hotpot_attempts ha,
mdl_user u,
mdl_grade_items gi,
mdl_grade_grades gg
WHERE ha.hotpotid = '5'
AND ha.userid = '3'
AND ha.userid = gg.userid
AND gg.itemid = gi.id
AND gi.courseid = '8'
AND gi.itemtype = 'mod'
AND gi.itemmodule = 'hotpot'
AND gi.iteminstance = '5'
On the other hand, if as a admin I click on a report and, after that, I change my rol (with "Swith rol to...") I get an error ("Can not find the data record in database"):
FROM {course_modules} cm
JOIN {modules} md ON md.id = cm.module
JOIN {hotpot} m ON m.id = cm.instance
WHERE cm.id = :cmid AND md.name = :modulename
[array (
'cmid' => 8,
'modulename' => 'hotpot',
)]
Error code: invalidrecordunknown
- line 1400 of \lib\dml\moodle_database.php: dml_missing_record_exception thrown
- line 1275 of \lib\datalib.php: call to moodle_database->get_record_sql()
- line 34 of \mod\hotpot\report.php: call to get_coursemodule_from_id()
This time I've not idea how to fix it...
Regards,
Maria