MantisBT - ATutor
View Issue Details
0005396ATutorTests/Surveyspublic2013-12-06 13:032013-12-28 12:49
mancoolgunda 
mancoolgunda 
normalminoralways
closedfixed 
 
2.22.2 
SVN
b08417f
0005396: editing an expired test shows a queryDB error
On editing an "Expired test", it shows a queryDB error. However, it works fine when we edit an "Ongoing test".
No tags attached.
Issue History
2013-12-06 13:03mancoolgundaNew Issue
2013-12-07 16:22mancoolgundaNote Added: 0006541
2013-12-28 10:22gregSVN Revision# => b08417f
2013-12-28 10:22gregNote Added: 0006577
2013-12-28 10:22gregStatusnew => resolved
2013-12-28 10:22gregFixed in Version => 2.2
2013-12-28 10:22gregResolutionopen => fixed
2013-12-28 10:22gregAssigned To => mancoolgunda
2013-12-28 12:49gregNote Added: 0006592
2013-12-28 12:49gregStatusresolved => closed

Notes
(0006541)
mancoolgunda   
2013-12-07 16:22   
I have created a PR for this issue:
https://github.com/atutor/ATutor/pull/80 [^]
(0006577)
greg   
2013-12-28 10:22   
I have removed the TRUE parameter passed for the queryDB function for finding whether submissions are made for the test or not. Clearly, this is a query which would return multiple results(multiple students have submitted the test results) and hence the third parameter($oneRow) should be FALSE(by default) since this parameter is used to make an extra check for queries that are supposed to return just 0 or 1 row.

Another thing I changed was at Line 94.
Steps to reproduce this bug: If an instructor has created a test as "Anonymous" and then he receives submissions from students. After this, when he edits the test, he would not be able to change the "Anonymous" option of the test since the radio button would be disabled. Still when he submits the edit form after making other changes like "Title, Description", the anonymous field would change to 0 in the db.
This happens because $row_anonymous['anonymous'] would not return any result since $row_anonymous would be a multi-dimensional array (Array=>(Array=>(test_id: 1, anonymous: 1), Array=>(test_id: 1, anonymous: 1))) and hence it takes 0 by default.
However, by using $row_anonymous[0]['anonymous'] the first row's anonymous field is retrieved.
(0006592)
greg   
2013-12-28 12:49   
closed for ATutor 2.2