You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error reading from database (Unknown column 'lastattempttime' in 'order clause' SELECT * FROM ( SELECT -- Information about the question q.id, lci.componentid, qbe.idnumber as label, COALESCE (qbe.idnumber, CAST(qbe.id AS CHAR)) as idnumber, q.name as questionname, q.questiontext as questiontext, q.qtype as qtype, qc.name as categoryname, -- Information about CAT scales, parameters and contexts lci.catscaleid catscaleid, lci.status testitemstatus, lci.componentname component, lci.id as itemid, lccs.name as catscalename, lccs.id as lccscatscaleid, lcip.model as model, lcip.difficulty, lcip.discrimination, lcip.guessing, lcip.json, lcip.timecreated, lcip.timemodified, lcip.status, lcip.contextid AS lcipcontextid, -- Information about usage statisitcs COALESCE(astat.numberattempts,0) attempts, COALESCE(astat.lastattempt,0) as astatlastattempttime, ustat.userid, ustat.numberattempts userattempts, ustat.lastattempt as userlastattempttime FROM mdl_local_catquiz_catscales lccs -- Get all corresponding items of those scales, skip if not existent -- (INNER JOIN) JOIN mdl_local_catquiz_items lci ON lci.catscaleid=lccs.id -- Get all the item parameter for the question for the given context(s), -- skip if not existent JOIN mdl_local_catquiz_itemparams lcip ON lcip.itemid = lci.id AND lci.activeparamid = lcip.id -- Get all information about the question from the questionbank itself JOIN mdl_question q ON q.id=lci.componentid JOIN mdl_question_versions qv ON qv.questionid=q.id JOIN mdl_question_bank_entries qbe ON qbe.id=qv.questionbankentryid JOIN mdl_question_categories qc ON qc.id=qbe.questioncategoryid -- Get all information about the attempts in the scale(s) -- and context(s) in general and for specific user(s) LEFT JOIN (SELECT lca.scaleid, lca.contextid, qa.questionid, COUNT(qa.id) numberattempts, MAX(qas.timecreated) as lastattempt FROM mdl_local_catquiz_attempts lca JOIN mdl_adaptivequiz_attempt aqa ON lca.attemptid = aqa.id JOIN mdl_question_attempts qa ON qa.questionusageid = aqa.uniqueid JOIN mdl_question_attempt_steps qas ON qas.questionattemptid = qa.id AND qas.fraction IS NOT NULL GROUP BY lca.scaleid, lca.contextid, qa.questionid ) astat ON astat.contextid = lcip.contextid AND astat.questionid = q.id AND astat.scaleid = ? LEFT JOIN (SELECT NULL AS userid, NULL AS numberattempts, NULL AS lastattempt) as ustat ON 1=1 ) s WHERE 1=1 AND lcipcontextid COLLATE utf8mb4_bin = 5 AND lccscatscaleid = ? ORDER BY
The text was updated successfully, but these errors were encountered:
Ich vermute, dass das Problem bei wunderbyte_table liegt.
Ich kann den Fehler triggern, wenn ich nach last attempt time sortiere und dann eine fulltext search ausführe.
In unserer SQL query geben wir kein Feld lastattempttime zurück, sondern astatlastattempttime.
Beim Erzeugen der wunderbyte table geben wir als column name lastattempttime an aber wir haben dafür in der Table Klasse folgende Funktion:
/** * Return value for lastattempttime column. * * @param \stdClass $values * @return string */publicfunctioncol_lastattempttime($values) {
if (intval($values->astatlastattempttime) === 0) {
returnget_string('notyetcalculated', 'local_catquiz');
}
returnuserdate($values->astatlastattempttime);
}
Vielleicht muss einfach bei $table->define_sortablecolumns statt 'lastattempttime' 'astatlastattempttime' verwendet werden - das werd ich überprüfen
Previously, sorting the questions of a scale by attempt time and then
switching the page via pagination or doing a fulltext search would cause
an error. This is fixed now by using the same column name for the
col_NAME() function as for the sortable column.
Previously, sorting the questions of a scale by attempt time and then
switching the page via pagination or doing a fulltext search would cause
an error. This is fixed now by using the same column name for the
col_NAME() function as for the sortable column.
Error reading from database (Unknown column 'lastattempttime' in 'order clause' SELECT * FROM ( SELECT -- Information about the question q.id, lci.componentid, qbe.idnumber as label, COALESCE (qbe.idnumber, CAST(qbe.id AS CHAR)) as idnumber, q.name as questionname, q.questiontext as questiontext, q.qtype as qtype, qc.name as categoryname, -- Information about CAT scales, parameters and contexts lci.catscaleid catscaleid, lci.status testitemstatus, lci.componentname component, lci.id as itemid, lccs.name as catscalename, lccs.id as lccscatscaleid, lcip.model as model, lcip.difficulty, lcip.discrimination, lcip.guessing, lcip.json, lcip.timecreated, lcip.timemodified, lcip.status, lcip.contextid AS lcipcontextid, -- Information about usage statisitcs COALESCE(astat.numberattempts,0) attempts, COALESCE(astat.lastattempt,0) as astatlastattempttime, ustat.userid, ustat.numberattempts userattempts, ustat.lastattempt as userlastattempttime FROM mdl_local_catquiz_catscales lccs -- Get all corresponding items of those scales, skip if not existent -- (INNER JOIN) JOIN mdl_local_catquiz_items lci ON lci.catscaleid=lccs.id -- Get all the item parameter for the question for the given context(s), -- skip if not existent JOIN mdl_local_catquiz_itemparams lcip ON lcip.itemid = lci.id AND lci.activeparamid = lcip.id -- Get all information about the question from the questionbank itself JOIN mdl_question q ON q.id=lci.componentid JOIN mdl_question_versions qv ON qv.questionid=q.id JOIN mdl_question_bank_entries qbe ON qbe.id=qv.questionbankentryid JOIN mdl_question_categories qc ON qc.id=qbe.questioncategoryid -- Get all information about the attempts in the scale(s) -- and context(s) in general and for specific user(s) LEFT JOIN (SELECT lca.scaleid, lca.contextid, qa.questionid, COUNT(qa.id) numberattempts, MAX(qas.timecreated) as lastattempt FROM mdl_local_catquiz_attempts lca JOIN mdl_adaptivequiz_attempt aqa ON lca.attemptid = aqa.id JOIN mdl_question_attempts qa ON qa.questionusageid = aqa.uniqueid JOIN mdl_question_attempt_steps qas ON qas.questionattemptid = qa.id AND qas.fraction IS NOT NULL GROUP BY lca.scaleid, lca.contextid, qa.questionid ) astat ON astat.contextid = lcip.contextid AND astat.questionid = q.id AND astat.scaleid = ? LEFT JOIN (SELECT NULL AS userid, NULL AS numberattempts, NULL AS lastattempt) as ustat ON 1=1 ) s WHERE 1=1 AND lcipcontextid COLLATE utf8mb4_bin = 5 AND lccscatscaleid = ? ORDER BY
The text was updated successfully, but these errors were encountered: