decoupling the view logic and the quiz taking logic using AJAX quiz
| Project: | Quiz |
| Version: | 6.x-5.x-dev |
| Component: | Code - Quiz module |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed |
Jump to:
If you go to a question node, you see the prompt for the question and then an interaction field to answer it. There's also a Next button beneath it to continue to the next question, but it doesn't do anything.
In you go to a Quiz node, you see a question just as above, except now the Next button continues to the next question in the quiz.
I propose that the main view hook for quiz resources not assume that a student is answer the question or taking the quiz. Instead, those features should go into a new action. Something like "take". We already have /node/NUMBER/questions and /node/NUMBER/admin. We could add /node/NUMBER/take as the path for when a student is taking a quiz. And this would only apply to quiz nodes as question nodes cannot be answered except in the context of a quiz.
I'd like to come up with a better name than "take", one that would accommodate the variety of words that the "quiz" module models: quizzes, tests, exams, assessments, homework, exercises, problem sets. Maybe "fill" or "respond"? Respond would match the QTI data/conceptual model of prompts and responses.
I can implement this. What do others think of this plan? I'd like to include it in Quiz 4.0.

#1
This was actually the original pattern for Quiz, IIRC. Some time between the Drupal 4.7 version of Quiz and the Drupal 5 version of Quiz, this changed. I've had more than a few requests to change it back.
For questions: I would be happy with a view that did not include the buttons. I'd like to hear more about how this would look.
For the quiz: I imagine that the taking of the quiz would be handled by logic separate from the standard node viewing. Right now, quiz_take_quiz gets called from quiz_view() under basically all circumstances. I'd much prefer a system that made the quiz taking process pluggable (generically speaking), so that we could continue doing quizzes as they are now, as well as "all in one page", printer-friendly, and so on.
Sivaji has "AJAX quizzes" on his task list, and I don't know how he plans on implementing that. But that is a perfect example of how decoupling the view logic and the quiz taking logic and making the later more configurable could really pay off.
What are you thinking in terms of workflow? What will an administrator see when viewing a quiz? What will a user see?
#2
If we were to divide the quiz module to handle this new scenario, it means a few things:
1) we have to figure out how admins will be able to configure what views people will be able to access, and under what conditions.
2) We need to figure out how to write an abstraction layer that will handle tracking the progress through a quiz, timing, and all that good stuff.
(assuming we want to provide that to multiple views)
#3
In IRC we agreed that this could jeopardize the GSoC release target for Quiz 4.x so instead I'll work on this in Quiz 5.x.
Since then, I've had another idea for how we could reconcile the work that I need to do with Sivaji's. I think we could both work in Quiz 4.x and avoid the hassle of divergence and merging.
The multichoice question type checks for whether its in a quiz and if not, warns that it won't be scored. We could have every question type checked whether it was in a quiz, and if so then display a teacher/instructor view instead of a student/respondent view. I've done this in my checkout and it takes <10 lines of code.
Then a new question organization type, Item Collection, could be made that works similarly to Quiz in that it has a list of items, but doesn't have all the interaction settings and UI. That way Sivaji could keep working on Quiz and I could work on a separate content type. Only our questions would be in common, and a simple check for whether they're in a quiz or not would separate our concerns.
Sivaji, how does this sound to you?
#4
I like the idea of decoupling the view logic and the quiz taking logic using AJAX quiz. As of now for the GSoC i have only a basic AJAX quiz is done. It works something as follow
1. enabling AJAX quiz will introduce one more tab "AJAX Quiz" (similar to "manage questions").
2. When you click on the "AJAX Quiz" tab you will be taken to a page
node/$nid/ajax-quizwhere you can view the quiz description and a link to start quiz.3. When you click the "start" link consecutive questions will be loaded one below the other using
quiz_take_quiz().I would like to do this after GSoC as a part of quiz 4.x. Let me know your thoughts on this.
(btw, i could see Crell, add1Sun and other drupal developers who don't have access to quiz CVS is in issue assigned list. why ?)
#5
changing issue title
#6
Sivaji, it would be great to have your AJAX Quiz feature in the 4.0 release. I think once it's working, it should be the only quiz-taking interface. Every browser now supports the AJAX that's necessary. Because it would be the only taking interface and because the user can't be expected to know what "AJAX" means, I propose that the tab be named "Take" or "Take quiz", something like that.
Further, I think we should make the main node view of the quiz describe the quiz, as in the top of this ticket. What do you think of that? The node view would describe the quiz and include notes on it, what the objectives are, etc. Then the "Take" tab would prompt and record student responses.
If the user has taken the quiz, the main node view could also tell them their score, comparative stats, etc.
#7
@turadg thanks for your comments.
As per our IRC discussion with mbutcher and stwith, lets have AJAX quiz as an optional feature for quiz 4.x. Both the "quiz view" and
"AJAX quiz""Take Quiz" tab can be used to attend quiz. We will make AJAX quiz as default quiz handling mechanism in quiz 5.x. Moving forward to quiz 5.x#8