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
Tcexam is running on Postgres 11.12 (raspbian)
Tcexam is throwing error if you try to show test result as normal user (index tab -> column "status"):
ERROR: [2] pg_query(): Query failed: ERROR: operator does not exist: boolean = integer LINE 1: ...user_id=3 AND testuser_status>3) AND test_results_to_users=1 ^ HINT: No operator matches the given name and argument types. You might need to add explicit type casts. | LINE: 83 | FILE: /var/www/html/tcexam/shared/code/tce_db_dal_postgresql.php
ERROR: ERROR: operator does not exist: boolean = integer LINE 1: ...user_id=3 AND testuser_status>3) AND test_results_to_users=1 ^ HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
Is this caused by some wrong configuration? This can be fixed by applying following patch to /tcexam/shared/code/tce_functions_test_stats.php file:
--- tce_functions_test_stats.php 2021-05-24 13:36:00.743252741 +0200
+++ tce_functions_test_stats.php.notpatched 2021-05-24 13:40:04.180108677 +0200
@@ -1282,7 +1282,7 @@
$str = '0'; // string to return
$test_id = intval($test_id);
$user_id = intval($user_id);
- $sql = 'SELECT test_id FROM '.K_TABLE_TESTS.' WHERE test_id IN (SELECT DISTINCT testuser_test_id FROM '.K_TABLE_TEST_USER.' WHERE testuser_user_id='.intval($user_id).' AND testuser_status>3) AND '.$filter.'=1::BOOLEAN';
+ $sql = 'SELECT test_id FROM '.K_TABLE_TESTS.' WHERE test_id IN (SELECT DISTINCT testuser_test_id FROM '.K_TABLE_TEST_USER.' WHERE testuser_user_id='.intval($user_id).' AND testuser_status>3) AND '.$filter.'=1';
if ($r = F_db_query($sql, $db)) {
while ($m = F_db_fetch_assoc($r)) {
$str .= ','.$m['test_id'];
The text was updated successfully, but these errors were encountered:
It looks like those cases are not properly handled when using Postgres.
I will need to investigate how to make those queries working with all supported DBs, as your suggested change only works for Postgres.
Hello,
Tcexam is running on Postgres 11.12 (raspbian)
Tcexam is throwing error if you try to show test result as normal user (index tab -> column "status"):
Is this caused by some wrong configuration? This can be fixed by applying following patch to /tcexam/shared/code/tce_functions_test_stats.php file:
The text was updated successfully, but these errors were encountered: