|
|
|
Environment:
|
IE and FF - but i suspect it's on the server, actually...
|
|
Issue Links:
|
Blockers
|
|
This issue blocks:
|
|
MDL-7333
QUIZ WILL NOT IMPORT QUIZ FILES in 1.63 or 1.7
|
|
|
|
|
|
Duplicate
|
|
|
|
This issue is duplicated by:
|
|
MDL-4617
string null can not be inserted to database
|
|
|
|
|
|
|
|
When you have a question that has the word NULL as a possible answer, it causes weird behaviour.
This manifested itself first at school with 1.5.4.. where a question in a python class had null as the answer. I think the teacher had imported the test using GIFT, and probably had never previewed it. When one tried to take the test, ti simply wouldn't display. Thru some lengthy trial and error I isolated it down to a question that had blank answers, but for which null would have been one good answer. When i put it in, the question could not save, or saved but led to the error.
I just tried it in 1.7 and found this:
When you create a fresh question, putting the word null, without quote, lower-case, it gives this error:
Column 'answer' cannot be null
INSERT INTO mdl_question_answers ( QUESTION, ANSWER, FRACTION, FEEDBACK ) VALUES ( 3, null, -1, '' )
if you continue you go back to the site home page.
What's peculiar is that with enough going back and forth you can actually get the value to save (i.e. by editing the question after it did not save successfully, so it may be unique to an INSERT situation, while UPDATE may work fine. This theory is further confirmed by the fact that i was able to EDIT a question to include the word null, but when I saved it as a new question, it choked as before.
This does not seem to apply to upper-case NULL, and is not a problem if the answer is in quotes.
|
|
Description
|
When you have a question that has the word NULL as a possible answer, it causes weird behaviour.
This manifested itself first at school with 1.5.4.. where a question in a python class had null as the answer. I think the teacher had imported the test using GIFT, and probably had never previewed it. When one tried to take the test, ti simply wouldn't display. Thru some lengthy trial and error I isolated it down to a question that had blank answers, but for which null would have been one good answer. When i put it in, the question could not save, or saved but led to the error.
I just tried it in 1.7 and found this:
When you create a fresh question, putting the word null, without quote, lower-case, it gives this error:
Column 'answer' cannot be null
INSERT INTO mdl_question_answers ( QUESTION, ANSWER, FRACTION, FEEDBACK ) VALUES ( 3, null, -1, '' )
if you continue you go back to the site home page.
What's peculiar is that with enough going back and forth you can actually get the value to save (i.e. by editing the question after it did not save successfully, so it may be unique to an INSERT situation, while UPDATE may work fine. This theory is further confirmed by the fact that i was able to EDIT a question to include the word null, but when I saved it as a new question, it choked as before.
This does not seem to apply to upper-case NULL, and is not a problem if the answer is in quotes.
|
Show » |
|