Bug #2561
SQL error in the Tests tool, Chamilo 1.8.8 alpha-
100%
Description
DATABASE ERROR #1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''TEST AND te.exe_exo_id = 2 ORDER BY tth.exe_cours_id A' at line 3 QUERY : SELECT firstname as col0, lastname col1, tth.exe_name, tth.exe_result , tth.exe_weighting, tth.exe_date FROM tth, `chamilo_main`.`user` tu WHERE tu.user_id=tth.exe_user_id AND tth.exe_cours_id = 'TEST AND te.exe_exo_id = 2 ORDER BY tth.exe_cours_id ASC, tth.exe_date DESC FILE : C:\Users\Ivan Tcholakov\workspace\chamilo-classic-test\main\inc\lib\statsUtils.lib.inc.php LINE : 119 FUNCTION : getManyResultsXCol
Files
History
Updated by Ivan Tcholakov about 8 years ago
- Assignee deleted (
Ivan Tcholakov)
I think, this task is not for me.
exercice/exercise_result.class.php
Check the line 118:
WHERE tu.user_id=tth.exe_user_id AND tth.exe_cours_id = '" . Database :: escape_string($cid) . " $user_id_and '
exercice/exercise.lib.php
Check the line 793:
WHERE tu.user_id=tth.exe_user_id AND tth.exe_cours_id = '" . Database :: escape_string($_cid) . " $user_id_and $exercise_where
and the line 874:
WHERE tu.user_id=tth.exe_user_id AND tth.exe_cours_id = '" . Database :: escape_string($_cid)." $user_id_and $exercise_where
Updated by Julio Montoya about 8 years ago
- Status changed from New to Assigned
- Assignee set to Julio Montoya
thanks for reporting it
Updated by Julio Montoya about 8 years ago
- Status changed from Assigned to Needs more info
- % Done changed from 0 to 50
Updated by Ivan Tcholakov about 8 years ago
After updating the source, I tried the same place (Tests tool, the "Results and feedback" button) and a different SQL error occured:
DATABASE ERROR #1146: Table 'chamilo_main.tth' doesn't exist QUERY : SELECT firstname as col0, lastname col1, tth.exe_name, tth.exe_result , tth.exe_weighting, tth.exe_date FROM tth, `chamilo_main`.`user` tu WHERE tu.user_id=tth.exe_user_id AND tth.exe_cours_id = 'TEST' AND te.exe_exo_id = 2 ORDER BY tth.exe_cours_id ASC, tth.exe_date DESC FILE : C:\Users\Ivan Tcholakov\workspace\chamilo-classic-test\main\inc\lib\statsUtils.lib.inc.php LINE : 119 FUNCTION : getManyResultsXCol
See the picture too.
Updated by Ivan Tcholakov about 8 years ago
- File yet_another.png yet_another.png added
Within the file main/exercice/exercise.lib.php there are the functions and get_count_exam_results() and get_exam_results_data().
Inside it the variable $TBL_TRACK_HOTPOTATOES has not been initialized.
I declared (locally in my sources only) the variable $TBL_TRACK_HOTPOTATOES as global at the beginnig of these functions and I got yet another error:
DATABASE ERROR #1054: Unknown column 'te.exe_exo_id' in 'where clause' QUERY : SELECT firstname as col0, lastname col1, tth.exe_name, tth.exe_result , tth.exe_weighting, tth.exe_date FROM `chamilo_main`.`track_e_hotpotatoes` tth, `chamilo_main`.`user` tu WHERE tu.user_id=tth.exe_user_id AND tth.exe_cours_id = 'TEST' AND te.exe_exo_id = 2 ORDER BY tth.exe_cours_id ASC, tth.exe_date DESC FILE : C:\Users\Ivan Tcholakov\workspace\chamilo-classic-test\main\inc\lib\statsUtils.lib.inc.php LINE : 119 FUNCTION : getManyResultsXCol
Updated by Julio Montoya about 8 years ago
Ivan Tcholakov wrote:
Within the file main/exercice/exercise.lib.php there are the functions and get_count_exam_results() and get_exam_results_data().
Inside it the variable $TBL_TRACK_HOTPOTATOES has not been initialized.
I declared (locally in my sources only) the variable $TBL_TRACK_HOTPOTATOES as global at the beginnig of these functions and I got yet another error:[...]
hello Ivan, did you have a hotpotatoe file I can use?
Updated by Ivan Tcholakov about 8 years ago
Updated by Julio Montoya about 8 years ago
- Status changed from Needs more info to Bug resolved
- Assignee deleted (
Julio Montoya) - % Done changed from 50 to 90
i think there are not more sql errors ?
Updated by Ivan Tcholakov about 8 years ago
The last one still stays - "Unknown column 'te.exe_exo_id' in 'where clause'". On a system switched into testing mode click on the icon "Results and feedback" and you will see the error. I am sending a picture.
Updated by Julio Montoya about 8 years ago
- Status changed from Bug resolved to Assigned
- Assignee set to Julio Montoya
- % Done changed from 90 to 70
Ivan Tcholakov wrote:
The last one still stays - "Unknown column 'te.exe_exo_id' in 'where clause'". On a system switched into testing mode click on the icon "Results and feedback" and you will see the error. I am sending a picture.
thanks, here's the fix, need more test when dealing with gradebook ...
Updated by Yannick Warnier about 8 years ago
Should I put this one in "Requires testing", or is there still something to do about it?
Updated by Ivan Tcholakov about 8 years ago
- File sql_error_on_sample_test_results_and_feedback.png sql_error_on_sample_test_results_and_feedback.png added
I tried the "Results and feedback" icon against the ordinary sample test. This is what I got:
DATABASE ERROR #1054: Unknown column 'propagate_neg' in 'field list' QUERY : SELECT lastname as col0, firstname as col1, ce.title as col2, te.exe_result as exresult , te.exe_weighting as exweight, te.exe_date as exdate, te.exe_id as exid, email as exemail, te.start_date as col4, steps_counter as exstep, exe_user_id as excruid,te.exe_duration as exduration, propagate_neg FROM `chamilo_TESTCOURSE`.`quiz` AS ce INNER JOIN `chamilo_main`.`track_e_exercices` AS te ON (te.exe_exo_id = ce.id) INNER JOIN `chamilo_main`.`user` AS user ON (user.user_id = exe_user_id) WHERE te.status != 'incomplete' AND te.exe_cours_id='TESTCOURSE' AND te.session_id = 0 AND ce.active <>-1 AND orig_lp_id = 0 AND orig_lp_item_id = 0 AND te.exe_exo_id = 1 ORDER BY col1 LIMIT 0, 20 FILE : C:\xampp\htdocs\chamilo-classic\main\exercice\exercise.lib.php LINE : 939 FUNCTION : get_exam_results_data
Updated by Ivan Tcholakov about 8 years ago
I'll reinstall the system for confirmation about the last error.
Updated by Ivan Tcholakov about 8 years ago
After reinstalling the system the last error disappeared. I can't find more SQL errors here. Only I suspect a missing feature (there is no way for looking at the HotPotatoes results) for which I will open a separate task.
Updated by Julio Montoya about 8 years ago
- Status changed from Assigned to Needs more info
- Assignee deleted (
Julio Montoya) - % Done changed from 70 to 80
waiting for more errors :)
Updated by Yannick Warnier about 8 years ago
- Target version changed from 1.8.8 alpha to 1.8.8 beta
Updated by Julio Montoya almost 8 years ago
- Status changed from Needs more info to Bug resolved
- % Done changed from 80 to 100