Right now, each time you go to the add questions tab, the screen is blanked out and only shows the taxonomy selection box. After selecting some questions to add to the quiz, these should always show up so that it's obvious what questions have been already assigned and what options have been selected.
Comments
Comment #1
webchickOk, added in this functionality. But I found a few more problems:
1. Taxonomy choice not remembered between page loads, so after submitting questions, always comes back as:
"The following questions met the search criteria:
No questions found."
Will investigate taxonomy_form to figure out how to select last selections by default.
2. Question statuses (statusii? ;)) seem to always stay "Random" even though they are updated correctly in database (need to change my SELECT queries to add the question_status field, and probably move the node-to-question mapping to a separate function since it's copied almost line-for-line in two places)
3. The way the question adding works now (as it was inherited from the original code), when you click "Submit questions" the contents of quiz_questions are cleared out and replaced with whatever active questions you have on-screen (in this case, those that have been filtered by selected taxonomy terms). This means if you had questions in there before that were classified under the term "Apple," and have since searched for questions classified under the term "Banana," only the "Banana" questions remain attached to the quiz; the rest are dropped. This is probably not the best way for this to occur, so I'll need to brainstorm on how best to address this... perhaps add/remove buttons next to each question..?
Comment #2
webchick> 1. Taxonomy choice not remembered between page loads
Fixed. Added parameter to _quiz_taxonomy_select to send selected values to taxonomy_form.
> 2. Question statuses (statusii? ;)) seem to always stay "Random" even though they are updated correctly in database
Mostly have this working. The list of already added questions correctly reflects what status the question has, but when filtering the question list, all radio buttons default to "Random" even if they're already set on the quiz to be something else. I have some sort of scoping issue which I'll hopefully be able to fix sometime when it is NOT 3 AM on a school night. ;P
Comment #3
webchickDefault radio selection issue now fixed. Contacting Robert for clarification on expected behaviour for #3.
Comment #4
webchickActually, as I was posing the question the answer occurred to me:
New behaviour is that quiz_update_questions will first create an array of what questions are already assigned to the quiz, then go through each selected question to see if it's in the array of existing questions. If so, perform an update, else insert a new record.
Marking issue fixed.
Comment #5
lukes commentedComment #6
(not verified) commentedComment #7
(not verified) commented