Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi !
My question is, quizz will led admin to display questions in a single page ?
Comments
Comment #1
turadg CreditAttribution: turadg commentedYes, that is something that I'm working on.
Can you tell me more about how you plan to use the feature? That will help inform the design.
Comment #2
andeim CreditAttribution: andeim commentedIn a single page we can have multi-choices, questions, long answer, short....
Having all in a single page will be used for short quiz I suppose (5 multi choice for example) but we will be able to do long quiz (no limit ;) ).
My using will be very simple, just the visitor can read his quiz from beginning to end change answers and validate at end.
You can see an example attached.
Comment #3
robatwork CreditAttribution: robatwork commentedturadg,
I'm also in need of this functionality, so allow me to give my input on desired functionality. Ideally, I would like to be able to drag and drop questions onto different pages and order them within a given page, much like you can drag and drop them currently on the "Manage questions" tab to set the overall order. I would like the ability to place an arbitrary number of questions on each individual page -- say 4 questions on page 1, 3 questions on page 2, and 5 questions on page 3. If the interface allowed for a visual way of arranging and laying this out, that would be most intuitive I believe.
Do you have an estimate on when you'll be committing an initial version of your pagination functionality?
Comment #4
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedThis feature is already addressed in my GSoC proposal http://groups.drupal.org/node/21627
Comment #5
turadg CreditAttribution: turadg commentedI just spoke with sivaji on IRC and he explained how what adeim described is already in his master plan for 4.x. So adeim you can look forward to sivaji's implementation in late July.
robatwork's request is pretty different and may merit another ticket. It's not putting all the questions on one page, but paginating them across multiple pages. The editing interface would be part of the current Admin section. That shouldn't be too hard to add in.
The bigger issue is how to render those pages. Currently there is one View on the quizzes which assumes a student is taking the quiz. Sivaji's work is on that view.
My plan right is to create a separate Teacher subsystem of Quiz (or something like that) that let's you view a quiz for purposes other than taking it. E.g. printing. This view would make use of the pagination.
robatwork, in your particular case, why do you want pagination? is it for a student view or a teacher view? would what I describe answer your case?
Comment #6
robatwork CreditAttribution: robatwork commentedturadg,
I would want pagination not just for a back-end admin (teacher) view, but more so for the front-end user (student) taking the quiz. The purpose is to split up large quizzes, say with 50+ questions, to make them more manageable for the quiz taker. For example, if I have a quiz with 50 questions, I'd like to have 5 pages with 10 questions each. Ideally on multi-page quizzes, the page number (1 of 5) and progress indicator (3 questions answered, 47 remaining) would display on each page to give status to the quiz taker.
A good use-case of an existing quiz that I'd like to replicate with the Drupal Quiz module can be found here:
http://newyork.timeout.com/quiz/715/715-do-you-belong
Comment #7
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedComment #8
Renee S CreditAttribution: Renee S commentedIs this something already in the Look+Feel (can't find it, but maybe I'm looking in the wrong spot!) or will this be implemented under the "Ajaxifying" tasks?
Comment #9
falcon CreditAttribution: falcon commentedComment #10
aleksey.tk CreditAttribution: aleksey.tk commentedSubscribing. This feature is a must!
Comment #11
falcon CreditAttribution: falcon commentedIf someone creates a patch, or can come up with some funding I will be happy to include this in Quiz 4.1.
Comment #12
oz_an CreditAttribution: oz_an commentedwhat size of funding ur talking about? I really need that feature and tending to use flash to implement it on my own (rather easily and unwillingly), though I hate people using flash when they meet a difficulty in the standard ways. So I really need that future and I think it was and is a must for a quiz module. Maybe we the people who need it can help to fund it.
Comment #13
falcon CreditAttribution: falcon commentedWe need to add some features to the admin section. Primarily we need change the manage questions tab so that you can decide what questions belongs to what pages. I imagine that you can add a page row, and all question rows below a page row belongs to that page. In addition we need to rewrite most of the quiz taking logic to allow for multiple questions in one page. I estimate the size of funding to 13 500 USD
Comment #14
oz_an CreditAttribution: oz_an commentedthen we need 135 contributors
Comment #15
falcon CreditAttribution: falcon commentedOk. Is 100 USD per contributor a drupal standard? I guess we'll have to cross our fingers that some organization can pay the bill or contribute the development time needed to do this.
Comment #16
404 CreditAttribution: 404 commentedsubscribe
Comment #17
nsuit CreditAttribution: nsuit commentedI am in need of this functionality too. Subscribing ++
Comment #18
zeezhao CreditAttribution: zeezhao commentedsubscribing.
Comment #19
nsuit CreditAttribution: nsuit commentedIs there any way I could test that new work-flow that was mentioned in a response to this blog: http://www.appnovation.com/quiz-module
"Sivaji's new test-taking workflow that incrementally adds questions to the page".
Thanks
Comment #20
linuxeasy CreditAttribution: linuxeasy commentedI have made changes in the version 3, by which display of multiple questions became possible on the page, and it also accepts the answers correctly too.
I am just testing for bugs and will post them shortly :)
Comment #21
djdevinGreat! I am developing heavily in Quiz 4 - would love to see what you did and possibly port it over.
Comment #22
falcon CreditAttribution: falcon commentedI hope someone will contribute the development time needed to include this in Quiz 5.
Ideally we should change the entire quiz taking logic while doing this. Currently all answers to a question is stored in $_POST['tries']. Druapals Form API is not used correctly when taking a quiz IMHO. I think Quiz taking should be done using a regular multi-step form, or are there any reasons not to? Optionally we can keep things the way they are, and change it around for Drupal 7.
Comment #23
linuxeasy CreditAttribution: linuxeasy commentedExtremely sorry and apologetic for delay in submitting my code!
I have attached my changes in the module.. and I have tested at my end.
I have made changes to the functions such as quiz_take_quiz() of quiz.module, and quiz.pages.inc
I have tested it on all answer types and it works successfully...
please try it out and let me know if you face any probs...
I have attached the zip file, what simply you can do it.. just replace its files with your existing quiz module files (sorry as for now.. i couldn't get time to follow and override or patch techniques of drupal, may be later). However, changes are made only to quiz.module and quiz.pages.inc files, all other files are unchanged!
these changes are made to quiz 3 module.
After replacing it with existing module files... all the questions in a particular quiz will come all at once!
please let me know further recommendations and your valuable feedbacks...
credits to core quiz module developers for making this module in a way that I didn't got too tedious work to implement this feature!
Comment #24
djdevin@linuxeasy, great job, I took your code, tweaked it and applied it to Quiz 4 and was able to get all questions on a single page and have the result stored correctly. Feedback at the end of the quiz also shows. There are some visual issues that need to be addressed and currently no validation on the submission. An option to enable per quiz to show all questions on a single page would be nice. I am going to work on it a little bit more and release a patch if it seems stable enough.
Comment #25
linuxeasy CreditAttribution: linuxeasy commented@djdevin, Hey thanks Man, please keep me updated regarding the same too:)
What we can do is trying using a if-condition, providing users an option whether they want multiple questions appear at once or one questions.
Comment #26
djdevinAttached is a patch to Quiz 4 dev branch which enables all questions to be displayed on a single page, configurable per quiz. Results are stored correctly and feedback at end of quiz is shown. Please run update.php after patching (or fresh install), this will add the single_page field to quiz_node_properties.
Also make sure that if you change the settings on a quiz node and aren't seeing the change, logout/login should be enough to clear out the old quiz revision.
To do, for starters?
Credit to @linuxeasy for Quiz 3 version
This patch is sponsored by DLC Solutions, LLC. (http://www.dlc-solutions.com)
Comment #27
linuxeasy CreditAttribution: linuxeasy commentedGreat work @djdevin,
I have some opinion on the following:
Regarding -->Visual fixes (shows "2 of X" questions on the results page)
If you see my customization on quiz 3 module, this does not show up.
This could be fixed/hidden by commenting out code showing the above pagination like information.
Isn't it?
I might be incorrect, as I am new to drupal coding, but just having this opinion since it I could hide it in my submitted customization.
Regards
linuxeasy ;)
Comment #28
djdevinThanks :) I see, yep that should be taken out if $quiz->single_page is set :) Or maybe change it to say something else, like "X questions" instead of a pager.
Currently testing some other mods, will roll a new patch soon. Also changed the form ID back to quiz-question-answering-form so custom theming/overrides would work.
Comment #29
djdevinHere's a better patch.
1) Changed the big form ID to quiz-question-answering-form
2) Used theme_item_list for the list of nodes, and give them classes
3) Updated quiz_progress so we can receive the
quiz
node - will display "X questions" or "X of X questions"4) Broke apart the theming functions so we have 1 for normal questions and 1 for the big page of questions
I'd like to see if someone can use form API to generate the questions instead of regexing out the modifications needed to each individual quiz question form.
Appreciating any comments! Patch against dev.
Comment #30
linuxeasy CreditAttribution: linuxeasy commentedYup, thats exactly where I got into mess..
The reason is simple. These forms are generated from the question types modules. Now instead of making modifications in each questions type modules (such as multi choice, true/false, etc), I made the changes at one place!
By this, the other question types can still remain unchanged same as community ones!
Regards
Comment #31
ratinakage CreditAttribution: ratinakage commentedLooking forward to this feature!
Subscribing...
Comment #32
cvbuelow CreditAttribution: cvbuelow commentedI used this patch but it seems to have some bugs. When I check the box to show all the questions on one page it does this but when I take the quiz and submit the form it goes to [quiz name]/take and returns 404 Page Not Found. It works fine when the questions are all on separate pages.
Also it seems like there is some sort of caching issue. Once I check the box to show all questions on the same page, then if I make other changes to the quiz like changing the name or adding questions those changes are not reflected when I take the quiz. It still shows the old name. When I go back to settings it shows the new name.
Comment #33
cvbuelow CreditAttribution: cvbuelow commentedOk, these weren't bugs after all. I just didn't realize what was going on.
If you create a path alias like node/191 => myquizzes/quiz1
you need to manually create one like node/191/take => myquizzes/quiz1/take
The caching issue was that I didn't realize that once you start taking a quiz it will keep you on that revision until you finish it, which makes sense. So if you start taking your quiz, then make a change to it in the settings and refresh you will still be looking at the old revision. Just have to finish the quiz and start again to see the new revision.
Comment #34
cvbuelow CreditAttribution: cvbuelow commentedI did run into another issue though when using "Show all questions on a single page". When you finish the quiz it shows the results to the questions in a different order than the questions were on the single page, which I thought was confusing. The reason is because it is ordering them by the
answer_timestamp
, which is the same for all questions since they were all submitted at the same time from the single page. To fix this just tell the query to ORDER BY the question weight, in this casers.weight
.in quiz.module line 3179 (patched version):
Comment #35
djdevinNice find, that makes sense...does this patch work with Quiz 4 un-patched as well?
Even though this patch would fix a specific issue with another patch, I think sorting by actual question order instead of answer timestamp would be a more reliable way to display the results.
Comment #36
ratinakage CreditAttribution: ratinakage commentedHi, when is this patch going to become part of the dev branch?
Thanks!
Comment #37
djdevinUnfortunately, probably not for a while. This is more of a hack at this point, because it rewrites the output of questions instead of modifying the forms before render. I'm not sure what approach to take but if the maintainers could point us in the right direction I think we have enough support to do it in a "good" way.
Comment #38
falcon CreditAttribution: falcon commentedI haven't had the time to review the patch yet, but if it is a temporary solution it is as djdevin say, we probably won't include it in the quiz core modules.
I think there are three things that are important for this feature:
1. Support for multiple questions on multiple pages.
For instance we might add an "add page" button to the manage questions tab so that we can have something like this:
1. Football questions(page 1)
1.1. Who won the WC?
1.2. Who is the better football player, Bart Simpson or Monty Python?
2. Formula 1 question(page 2)
2.1. Who is the most winning Formula 1 driver?
2.2. Who is the most winning Formula 1 team?
(Maybe we can use quiz directions for this?)
2. Make better use of FAPI
Today we use $_POST directly. It is not a good solution. We should use multistep forms and do the validation and submit process the normal drupal way.
3. API
We will be focusing on making quiz core as extensible as possible in the future. When adding support for multiple questions on multiple pages we need to bear this in mind. (If we make full use of the FAPI we will also make quiz core more extensible.)
(We don't need to make all of this happen at once)
Another question is in what version this patch should be added. Originally I was hoping that we could add this feature to the Drupal 7 version of quiz, I'm not sure if we should make a Quiz 5 version for Drupal 6.
What do you think?
Comment #39
ratinakage CreditAttribution: ratinakage commented@faclon - Firstly, thanks for the module! We are using it to administer short quizzes and its working quite nicely!
I don't really think having multiple questions on multiple pages is high on too many people's priority list.
For me, the biggest reason for wanting this feature added is to improve general usability. At the moment, if you have a test with 50 questions and you are on question #50 and want to get back to question #1, you need to click the back button 50 times. And to recheck your work that means clicking and waiting for the page to refresh each time. And then to get back to the end of the test, another 50 clicks. Its quite time consuming even on a fast server.
Having a checkbox that allows you to have your whole test on one page would be a huge help. I would definitely recommend putting it into the Drupal 6 version of the module if its possible...
Another solution to this problem I suggested in this thread: http://drupal.org/node/842450.
Thanks!
Comment #40
djdevin@ratinakage I saw your other issue before, it would be nice to have implemented. Have you been able to do any startup work on it? Side note, if you want to link to a thread, just use the
#842450: Quiz progress block would be really great
syntax, drupal.org will make the issue queue link and color it for you.As falcon said, we don't have to do everything at once - if we can get Quiz 4 to use more of FAPI and start with implementing single page quizzes, multi-page quizzes would not be far off. Maybe we all can start with looking at what needs to change in quiz core and the question types.
@falcon in regards to the question about what version to implement this in, I am pretty sure people will be running D6 for a while. You said a Quiz 4.1 version could be possible...maybe this would be the back port of some essential Quiz 5 features to D6 (single/multi page quizzes, adaptive/branching questions). I'm really hoping that the changes to use all of FAPI make it into Quiz 4 so we get some better ground work for Quiz 5.
Just thinking out loud. Thoughts appreciated.
Comment #41
ratinakage CreditAttribution: ratinakage commentedHi,
I am having trouble applying this patch. Its the first time I am patching and Drupal module so please bear with me...
I started a clean Drupal site. I patched the module using cygwin and this tutorial (http://community.contractwebdevelopment.com/patching-drupal-modules-in-w...). I then dropped the patched module into the modules folder of my clean Drupal site.
I go to the modules page and try to enable the quiz module and I get the following error:
Fatal error: Cannot redeclare quiz_update_6419() (previously declared in C:\Users\gstern\Desktop\Quiz\Quiz\www\quiz\sites\all\modules\quiz\quiz.install:16) in C:\Users\gstern\Desktop\Quiz\Quiz\www\quiz\sites\all\modules\quiz\quiz.install on line 38
Please let me know if I am doing something wrong...
Thanks!!!
Comment #42
ratinakage CreditAttribution: ratinakage commentedHi,
Continuing testing this patch, I fixed the error in my post #41, above by changing the quiz_update_6419 method name to quiz_updated_6666.
Now I get a little further. I am able to create a quiz with two questions and see it on a single page by clicking 'Take'. The problem is that once I answer the questions and click 'Finish', it gives me the following error:
By the way, I am patching the latest Quiz 4.0 rc7.
Comment #43
djdevinTry this patch. I had to make some edits for it to work with the latest -dev and rc7. Also make sure you run update.php after you patch. It will add the single_page column to your quiz node properties table.
Comment #44
ashernor CreditAttribution: ashernor commentedEven this last patch doesn't work for me ? Can someone publish his patched version of the module ?
Comment #45
djdevinCan you provide more information? Are you patching against the dev branch?
Comment #46
ashernor CreditAttribution: ashernor commentedI just tried again with the dev branch and the last patch, here is what is my result :
Comment #47
djdevinThis isn't a big deal, the quiz.pages.inc patch is only to show "20 questions" instead of "1 of 20" questions. I will re-roll a patch for the latest dev. The base functionality should still work fine. Make sure you update.php afterwards.
Still working on a better solution using form API.
Comment #48
sbrousseau CreditAttribution: sbrousseau commentedHello all,
I am a frequent reader of the drupal forums, but this is my first time posting on drupal.org.
First of all I would like to say a big thanks to djdevin (and linuxeasy for quiz 3 version) for posting this patch, as it provides exactly the functionality I was looking for. Great work!
Secondly, I have run into an issue with quiz scoring while displaying all questions on a single page. I thought maybe if I post it here someone may be able to provide some insight into what might be causing the issue.
Here is what is happening:
-I am using a fresh install of quiz module version 6.x-4.x-dev.
-I have applied the most recent patch submitted by djdevin (quiz4-503228-single-page-quiz.patch) and ran update.php.
-I have created a quiz displaying all questions on a single page.
-The quiz consists of all multichoice questions.
-The quiz is using the "random questions" option and is pulling 10 random questions from a pool of about 60.
-I take the quiz, answer all questions correctly, and click finish.
-Instead of scoring the 10 questions as would be expected, the quiz seems to pull a new set of 10 random questions from the pool of 60 and apply the answers to the new set. Many will be marked as unanswered.
-Every time the results page is refreshed, so is the set of questions.
-If any of these questions were included in the original set of questions they will be marked as correct, otherwise they have no answer and count for 0 points.
I am not sure, but I think the quiz_take_quiz function still believes that the quiz is being loaded for the first time and generates a random list when the finish button is clicked.
Does anyone have any ideas on how to prevent the random list from being generated a second time?
Any input would be greatly appreciated.
Comment #49
sbrousseau CreditAttribution: sbrousseau commentedAdding this code at the very top of the 'quiz_build_question_list' function seems to prevent a new set of questions being randomly generated on page refresh when using the 'random questions' setting:
if ($quiz->single_page && $_SESSION['quiz_'. $quiz->nid]['quiz_questions']) {
$questions = $_SESSION['quiz_'. $quiz->nid]['quiz_questions'];
return $questions;
}
This at least works while the quiz is in progress... finishing the quiz produces an accurate score, however refreshing on the finish page still loads a random set of questions and affects the score...
Comment #50
Christian Le Fournis CreditAttribution: Christian Le Fournis commentedGreat patch, however I don't know if it's a bug but the summary page does not display for anonymous, it only works if authenticated.
Comment #51
sbrousseau CreditAttribution: sbrousseau commentedI am having this problem too, I think it is related to the random hash code included in the URL for anonymous users to prevent caching. If this code is commented out the summary page shows up:
quiz.module quiz_take_quiz function:
// If anonymous user, refresh url with unique hash to prevent caching.
if (!$user->uid && $q_passed_validation === TRUE) {
drupal_goto('node/'. $quiz->nid .'/take', array('quizkey' => md5(mt_rand() . time())));
}
Of course I don't think this will fix the problem without creating other problems with caching...
Comment #52
barckhoff CreditAttribution: barckhoff commentedsubscribe
Comment #53
delykj CreditAttribution: delykj commentedsubscribe
Comment #54
Hany Albeshry CreditAttribution: Hany Albeshry commentedHello,
I have troubles finding the correct version to apply the latest patch in #43 against, please help
Comment #55
barckhoff CreditAttribution: barckhoff commented@saintofmadness Use the development version of Quiz (6.x-4.x-dev) and apply the patch to that.
Comment #56
barckhoff CreditAttribution: barckhoff commentedHi,
I just wanted to say that I've installed this patch and the single page view works well except that if you wish to make questions that require answers, it does not enforce this requirement as needed. It displays the message to say that you must answer the question, but this is displayed after calculating the score for the entire quiz, so the answer requirement is ignored.
Comment #57
djdevin@barckhoff yes this is a known issue that I have encountered. The temporary solution for us was to do client-side validation. I haven't had a chance to revisit the patch yet (it was for client work) but we have more work coming up that will require some updates to this functionality including utilizing more of form API to submit quizzes. Of course if you're so included to do so, any patch would be appreciated to properly check and report missing values :)
Comment #58
lordpicklepuss CreditAttribution: lordpicklepuss commentedI'm trying to add a CCK text field to the bottom of each question, and not having any success while using this patch. Is CCK support still available using this patch?
Comment #59
clarjon1 CreditAttribution: clarjon1 commentedHi,
This patch, even though applied to the rc7, does not work properly, or even apply properly. The following output occurs:
Contents of quiz.module.rej:
Contents of quiz.pages.inc.rej:
The results of this is that for some reason, after the one page has been enabled for a quiz, you cannot revert to single questions per page mode, and the quiz does not seem to save to the database correctly -- i'll do some playing with the code to try and manually patch this, but a more up to date patch for the latest version of the quiz would be a lot better to see.
Comment #60
clarjon1 CreditAttribution: clarjon1 commentedI did some playing around, and a clue to the .module error seems to be in the patch file itself -- there is a missing + at the beginning of the line.
So the patch system was trying to find a non-existant "}" character to put the code around, when that "}" should have been marked with a "+" at the start of the line -- Hope this helps.
Comment #61
sreynen CreditAttribution: sreynen commentedJust updating issue status and removing old status from title.
Comment #62
jdvc CreditAttribution: jdvc commentedYo djdevin, muchas gracias, patch works awesome! FYI for everyone else, I applied the patch in #43 manually to rc7 (a little tedious, but whatever) and it worked great. Did have an issue trying to patch with cli though. One thing is that when i try to set one page quiz as the default it doesn't work. But I can go to each individual quiz and set them to be one page.
Comment #63
djdevinHmm good point. Currently I'm working on a new non-hack way of doing single page quizzes that paves the way for multi-page quizzes, but it involves modifying all the question types and the question type class to utilize form API entirely for processing/rendering/validating. Once I get it stable I'll post for review.
Comment #64
falcon CreditAttribution: falcon commentedRe #63: Interesting!
Comment #65
djdevinI've been trying to refactor based on the hints inside the code and @todos. Things like:
- Eliminating the usage of $_POST['tries'] and $_POST in general
- Have quiz question types return single form elements so they can be joined properly to make multi-question pages
- Using $_SESSION['quiz_questions'] and a $_SESSION['current_quiz_question'] index instead of two separate arrays for questions, to allow for more flexible quiz question navigation
- Try and move things out of quiz_take_quiz that should be in FAPI
- For multichoice et al, instead of choice_answers, using FAPI #options
- Merging single/multi page functions in the last patch so that one function renders an arbitrary # of questions
I managed to get quiz taking and grading working OK with the new way (single and question per page quizzes), but I'm sure it's still a little fragile. Feedback doesn't work yet - it's a little difficult since it's in quiz_take_quiz and now everything is happening in FAPI.
Comment #66
turadg CreditAttribution: turadg commented@djdevin, awesome work. quiz_take_quiz has been the bane of all Quiz module devs. Falcon made an issue for rewriting it with FAPI, #634110: Rewrite quiz_take_quiz() with FAPI, but I'm surprised he didn't title it "quiz_take_quiz must die die die".
Because this issue requires such bigs change that can introduce a lot of bugs, would it make sense to rewrite quiz_take_quiz for FAPI and get that stable first? That code could get into CVS sooner than later. Then this issue could progress with patches on a more stable target.
Falcon, do you think a quiz_take_quiz rewrite could happen in Quiz 4.x?
Comment #67
djdevinI posted an alpha patch over on #634110: Rewrite quiz_take_quiz() with FAPI - hope that's alright, I think all FAPI-related discussion/development should be there as this issue title doesn't really apply to this patch.
Comment #68
adrianmak CreditAttribution: adrianmak commentedsubscribe.
I'm just evaluate an e-learning project for a primary school.
One of the client requirement is to show all questions on a single page instead of one question per page as implemented currently.
Anybody could tell me is this feature implemented yet in dev or rc version ?
Comment #69
tchurch CreditAttribution: tchurch commented+1
Comment #70
djdevin@adrianmak, this feature is not in any version as of yet. Currently you will have to use the patches provided if you need it
Comment #71
palmereldritch CreditAttribution: palmereldritch commentedSorry if this has been asked and answered, but can anyone tell me when/if the ability to present multiple questions per page will be added to Quiz? I understand I can use the patches, above, to present ALL questions on one page, but I only want to present 4 questions at a time, with a total of 40 questions, and I only want to allow the quiz-taker to move to the next set of 4 questions once all 4 of the current questions have been answered correctly. I realize this is probably unlike 99% of the other quizzes out there, so would this scenario be supported once multiple questions per page is added?
Also, the links to the documentation and FAQs for Quiz are currently returing 'Access Forbidden' errors.
Thanks!
Comment #72
djdevin@palmereldritch,
That is all that is available now, and it's really a bandaid fix. If you take a look at #634110: Rewrite quiz_take_quiz() with FAPI the functionality is planned to have an arbitrary number of pages.
Comment #73
zeezhao CreditAttribution: zeezhao commented@djdevin - please do you have a version of the patch that works with quiz-6.x-4.0? I could not get current patch correctly. Thanks
Comment #74
diseño web palma de Mallorca CreditAttribution: diseño web palma de Mallorca commentedHi, I got this patch manually typed in files .module .install .inc ... yes my eyes hurt a bit...
Anyway, I did the PHP update, and the table seem to be created on DB, and yes !! all questions where listed in on a single page !! but when I took the quiz and hited the button "Correct the Quiz" did not work !!
When I press the "submit" button at the end of the Quiz, instead of getting the results of the quiz I get the a reload page going to same quiz and all the values I give to each question are all reset, so it's like a reset form button.
Did anyone get the same??
Thank's
Comment #75
diseño web palma de Mallorca CreditAttribution: diseño web palma de Mallorca commentedSeems like Quiz is not been evaluated... Cauze I can see in my account Results estadistics that test has been taken but shows like "in progress" and score is "not evaluated"
Any idea?¿ OO
Comment #76
Lanbaba CreditAttribution: Lanbaba commentedGreat job guys.
Pls can somebody post a patched version of the module here. Having issues with getting the particular version for the patch.
Thanks
Comment #77
djdevinPlease try this patch if you need single page support in Quiz4 - this is just a temporary (bad) solution - the good solution is #634110: Rewrite quiz_take_quiz() with FAPI
Patched against 4.x-dev (mar 26), patch with patch -p1
Comment #78
kmccullagh CreditAttribution: kmccullagh commentedhi djdevin,
I just installed that patch (quiz4-503228-single-page-quiz.patch). It gives me the option to show all questions on a single page but when I select the box and save it doesn't store the setting and reverts to blank.
Using drupal 6.16 and quiz 1.4. Any ideas?
Comment #79
djdevin@kmccullagh run updatedb or update.php first
Comment #80
kmccullagh CreditAttribution: kmccullagh commentedI tried that and it said update complete however it still doesn't work. The error below is being logged
"Unknown column 'single_page' in 'field list' query: SELECT aid, number_of_random_questions, max_score_for_random, pass_rate, summary_pass, summary_default, randomization, backwards_navigation, repeat_until_correct, feedback_time, display_feedback, quiz_open, quiz_close, takes, show_attempt_stats, keep_results, time_limit, quiz_always, tid, has_userpoints, allow_skipping, allow_resume, allow_jumping, single_page FROM quiz_node_properties WHERE vid = 234 AND nid = 220 in /opt/lampp/htdocs/sandbox/sites/all/modules/contrib/quiz/quiz.module on line 830."
any further suggestions?
oh and we don't use drush.
cheers
Comment #81
djdevinThat field is supposed to get added with the update, not sure why it didn't...you can just do it manually with devel/php
Warning, modifies your DB schema, and this is a very beta solution.
Comment #82
sbrousseau CreditAttribution: sbrousseau commentedJust noticed an issue when using this patch:
-I have a site using quiz version 6.x-4.x-dev and the "quiz reports" module to track user statistics, and everything works as expected.
-I apply this patch (from comment #43) and set the quiz to display all question in a single page.
-Now every time I refresh the "/take" page for the quiz, an additional take is added on the reports page.
-The additional take that is added will always appear as "in progress" and will never finish.
-Finishing the quiz also adds another take (because it refreshes the "/take" page I assume)
Does anyone have an idea as to why this might be occurring because of this patch?
Anyone else having this issue?
Any insight would be greatly appreciated!
Comment #83
falcon CreditAttribution: falcon commentedThanks for reporting. This isn't a quiz bug, it is a problem with the patch.
Comment #84
AndyThornton CreditAttribution: AndyThornton commented**** HEALTH WARNING ****
Take care with the patch from #43 regarding the comment mentioned by Sean above (#82). As he mentioned, each time the quiz is played it leaves an 'in progress' version of the quiz. We had 8200 in-progress quizzes. I made a change that created a new revision and next thing I know our website was down! Basically, in the quiz_take_quiz function it calls a function to tidy old in progress quizzes. It attempted to delete all 8200 old in progress quizzes at once. I am not 100% sure why it couldnt, but I suspect that the DB just got snarled up with locks (especially if someone else tries to play the quiz while this is going on, as they will probably end up trying to delete the same rows etc).
If you find this patch is crucial to your world and you too have a bunch of in-progress quizzes you may wish to be careful when you create a new revision. The way I managed to get around it was by modifying the aforementioned function (_quiz_delete_old_in_progress). I added a "LIMIT 0 , 50" on the select so that it only tries to do 50 per time. This has allowed our site to come back to life, and also allows the quiz to be played again.
Comment #85
djdevinYep that is a known bug with this patch. I haven't touched this one in a while to work on #634110: Rewrite quiz_take_quiz() with FAPI but if you find a solution to have the result not create itself without a submission, that'd be great to at least get this thing more stable for production use.
Comment #86
swarad07Hey djdevin,
Is there are patch for quiz 6.x-4.1 version ? I want to display all the questions in one page on the /take page. I am searching for something that can take me close to showing all the questions on one page instead of me starting from scratch. I followed the #634110: Rewrite quiz_take_quiz() with FAPI post too. But couldn't find a solution.
Cheers
Comment #87
nirvanajyothi CreditAttribution: nirvanajyothi commentedSubscribing.
Comment #88
vishalkhialani CreditAttribution: vishalkhialani commentedHi,
Can this be done for quiz 7.x-4.x-dev . As the above patch seems for drupal 6.
Cheers,
Vishal
Comment #89
scottrigbyThis functionality is resolved in a much better way here #634110: Rewrite quiz_take_quiz() with FAPI. Let's work toward a 7.x-4.x reroll of the patch in that issue.
Comment #90
kurti CreditAttribution: kurti commentedAny news??
I´ve just applied the #43 patch and when I read the #82 post ...argggg always take page.
I need a solution...like all followers :)
If anyone wants to help me contact me to bring me a 6.x - 4.x module with single page works.
Many thanks!!
Comment #91
Paras Kuhad CreditAttribution: Paras Kuhad commentedThanks everyone for this great project, I tried patch in #43, but it didn't work for me on 6.x - 4.x version. So I applied the patch manually on 6.x-4.4, I also maintained these two fields : allow_resume, allow_jumping in various queries which were probably introduced after this patch on this issue queue. Here I am attaching a tarball of patched module, I am also providing a patch with respect to 6.x-4.x branch, I hope it would help someone.
Comment #92
kurti CreditAttribution: kurti commentedMany thanks Paras, I have to test it.
Could you upload the module in zip package?
This gz package is empty...
Comment #93
Paras Kuhad CreditAttribution: Paras Kuhad commentedHi Kurti,
The uploaded gz package isn't empty, you will have to extract it twice to get the folder.
Comment #94
ansim234 CreditAttribution: ansim234 commentedComment #95
ansim234 CreditAttribution: ansim234 commentedHello Paras Kuhad,
Could you upload the module in zip package?
This gz package is empty...
I am not able to get the folder please can you upload again?
Comment #96
djdevinRezipping for the people who can't open .tgz (Windows?)
Comment #97
ansim234 CreditAttribution: ansim234 commentedHello djdevin,
This will work for display the all quiz question in one page?
Comment #98
djdevinYes. It will "work" but it's really a hack.
Comment #99
Greg Turner CreditAttribution: Greg Turner commentedDoes anyone know the status for a 7.x patch?
Comment #100
doxigo CreditAttribution: doxigo commentedI still cant figure out why we cant have allow resume function for single page quizzes, does anyone know how to fix this? or have any suggestions ?
Comment #101
digitopo CreditAttribution: digitopo commentedYes I'm also looking for this option in 7x, bump?
Comment #102
nstillblue CreditAttribution: nstillblue commentedHow can I display all questions on one page in the quiz module for Drupal 7?
I am new to Drupal and I'm happy with the Quiz-module, but this is a major issue for my project.
Comment #103
er.garg.karanIt was a great experience using this quiz plugin. But I have a requirement in my project, that at present is not available in this module and that is the feature of having all the questions of a quiz being listed on a single page, rather requesting for next question after answering one.
Comment #104
jeanfranco CreditAttribution: jeanfranco commentedFor everyone who needs the single page support for quiz on Drupal 7, I used the patch on #93 to make a version of it in 7.x-4.0-beta1.
I warn you though this is a rough adaptation of the patch to drupal 7.
I don't know how to make a .patch, so i'm uploading the zip, but I just made changes to quiz.install, quiz.module and quiz.pages.inc.
Comment #105
Renee S CreditAttribution: Renee S commentedFolks, don't change version numbers back and forth -- module development best practice is that changes get made to the current version and then backported.
Comment #106
klaasvw CreditAttribution: klaasvw commentedHere's a patch against 7.x-4.x-dev containing the changes from #104.
I've also added an upgrade hook that adds the single_page column.
Comment #107
j_ten_man CreditAttribution: j_ten_man commented#106 works for me. Thanks.
Comment #108
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedMoving this to 7.x-5.x.
To commit this patch we need to refactor quiz. Includes (Proper use of form API, refraining from Session and node hooks, etc.), otherwise it would be just an incremental hack.
Comment #109
Madzgo CreditAttribution: Madzgo commentedI have a problem with patch at #106,
it doesn't save form data, instead it takes me to a 404 page (when someone clicks Finish)
Has anyone had this problem?
Comment #110
mcpuddin CreditAttribution: mcpuddin commented@sivaji, I just read your most recent comment, and you say that quiz needs to be completely refactored? Is that why this issue exists #2012180: Errors when trying to get 7.x-5.x installed?
Would love to help out where I can with that, but don't even know where to get started.
Comment #111
djdevinCheck out #634110: Rewrite quiz_take_quiz() with FAPI - this is the big one to get all the question types to use more of the FAPI.
Comment #112
Madzgo CreditAttribution: Madzgo commented#109 update:
The problem now only occurs with anonymous users.
I fixed the redirection by removing the url() function in theme_quiz_multi_question_node (quiz.pages.inc). (problem was pathauto)
Comment #113
mcpuddin CreditAttribution: mcpuddin commentedIf we have a patch being reviewed for 7.x-4.x-dev in comment #106, why are we pushing this off another X amount of months/years when its almost ready to go? I understand this can be seen as an "incremental hack", but its can fix the problem right now. Shouldn't we instead create another issue for 7.x-5.x-dev and let this one for 4.x-dev move forward?
I'm setting this back to 7.x-4.x-dev so we can at last get that patch reviewed and cleaned up.
Comment #114
mcpuddin CreditAttribution: mcpuddin commentedI took a look at patch #106 and it did not handle
1) quizzes with no questions
2) validation of results
I went ahead and fixed those with this patch agains 7.x-4.x-dev ( don't test against alpha or beta )
After going through the code and sifting through quiz.module, I totally understand what sivaji was talking about. The whole module is a hack ( apologies to the people that wrote it ). However, what we have is what we have and I'm really interested in getting this in 7.x-4.x-dev. If someone is willing to volley the testing around with me, I'd be happy to fix anything you find in a very quick fashion. Just one note, if you notice an error, just please describe how to reproduce the error.
Comment #115
mcpuddin CreditAttribution: mcpuddin commentedComment #116
mcpuddin CreditAttribution: mcpuddin commentedLooked into the bug mentioned #112 for anonymous users and fixed it. Thanks Madzgo!
Comment #117
mcpuddin CreditAttribution: mcpuddin commentedSo I did some more testing and I realized that the above patch didn't support:
Now let's get some testing!
Comment #118
mcpuddin CreditAttribution: mcpuddin commentedI just made an update so that feedback respects that "pass_rate" variable when completing the quiz.
Comment #119
j_ten_man CreditAttribution: j_ten_man commented#118 doesn't seem to be working for randomized questions. I have 8 questions and have it set to display 4 random questions. When I submit, different questions come up.
Comment #120
pubo68 CreditAttribution: pubo68 commentedHi, I'm totally new on Drupal.
Can anyone help me to install this function on my site? I already have installed and working Quiz. Only need the capability of show more than one question per page inside of an article/basic page.
Thank you very much!
Comment #121
bharata CreditAttribution: bharata commentedWhat would it take to make the patch from post #118 above work for 7.x-4.0-beta1?
Also, isn't there some way that Views could be used to render many questions on one page?
Thanks!!
Comment #122
seanenroute CreditAttribution: seanenroute commentedResults page does not honor Question order. It appears to show the results page in the order the questions were created.
Example:
1) Create Quiz, select Taking Options > Select: Show all questions on a single page
2) Create Questions in Quiz: Q1, Q2, Q3, etc
3) Reorder the Quiz Questions to: Q3, Q2, Q1
4) Results page show answers in original order: Q1, Q2, Q3 instead of Q3, Q2, Q1
When I turn off "Show all questions on single page" the Results page shows the correct order of questions.
If I turn the single page feature back on it once again show the incorrect Result page (Q1, Q2, Q3 instead of reordered Q3, Q2, Q1), I was hopeing it would reset but sadly it did not.
I'm guessing that the patch causes the Result page to order the questions based upon the ID of the Question, but just a guess.
Patch #118 with Quiz set to 1 page.
Comment #123
seanenroute CreditAttribution: seanenroute commentedIt gets stuck at Result ID 0 if you start a quiz but don't complete it.
When a user clicks Take a Quiz but doesn't complete the quiz it gets stuck on an infinate loop where you can never get past Result ID #0. Even if you retake the quiz and fill in all the answers it still considers you stuck at Result ID #0.
Even odder, if you take another Quiz when you finish it, you are teleported straight back to the stuck Quiz and get the message that you have to complete all the questions.
Patch #118 with Quiz set to 1 page.
Comment #124
omvaishnav CreditAttribution: omvaishnav commentedHello All,
Is now any new bug free patch for quiz-7.x-4.0-beta1 version?
I am waiting to a new patch for showing all questions in single page. If anyone has a new solution please reply.
Thanks!!
Comment #125
JanderSun CreditAttribution: JanderSun commentedHello All,
I too was seeking some guidance in making this work with the quiz-7.x-4.0-beta1 module?
Additional I am seeking guidance in adding a selection to Quiz creation to set the number of questions per page.
Thanks in advance.
Comment #126
drewbe121212 CreditAttribution: drewbe121212 commentedHello,
I have a pretty heavily forked version of Quiz at this moment and I would like to return to the scheduled release cycle of the core module, but this cannot happen until this functionality is present.
Is this meant to just fall off until the rewrite for 8 now?
Comment #127
abhi91garg CreditAttribution: abhi91garg commentedi used #96.
it was great
but i want 10 question per page in my project.
anybody have idea about this issue.
Comment #128
abhi91garg CreditAttribution: abhi91garg commentedhello
I used #96.
it was great
but i want 10 question per page in my project.
(want pagination in the all questions)
anybody have idea about this issue.
Comment #129
rajatparida CreditAttribution: rajatparida commentedHi
I am using drupal 7 and quiz 7.4 version , I am also checked with #96 and #106, both are working fine for displaying all question on single page, but unfortunately the form submit not working, when I click on the Finish button, it just reload the page
If any one have any idea regarding this, kindly let me know,
Thanks
Comment #130
Thytane CreditAttribution: Thytane commented#116 works for me. No fails during the patch instead of the others.
Comment #131
djdevinRerolled for 7.x-4-x and also fixed an issue where the question title (node body) was not appearing because of changes to rendering. Extra fields on the questions (if any) should display as well.
Comment #132
rajatparida CreditAttribution: rajatparida commentedThanks djdevin #131 working fine for me
Comment #133
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedI didn't read the issue fully. However patch in #131 would be an incremental hack to quiz module, especially the snips highlighted below.
(.*?)
|si', $node->content['question_form']['#markup'], $matches);
+ $form_free_body = preg_replace('/]*?>/', '', $matches[1]);
+ $node->content['question_form']['#markup'] = str_replace('name="tries', 'name="tries_' . $node->nid . '', $form_free_body);
+ $item_list[] = drupal_render($node->content);
+ }
+ else {
+ break;
+ }
+ }
?>
Ideal way to fix this would be rewriting quiz module or at least function quiz_take_quiz(). I hope to see this happen at least in 8.x.
Comment #134
djdevinFor sure this is a hack, but I would say getting paginated questions, or at least all questions without pagination should be a focus in 7.x....it will be years before big education sites upgrade to 8.x! Unfortunately we have no other alternative than hacking this functionality to meet our clients' requirements. Judging by the constant activity on this issue it seems like it is requested functionality for a lot of users that shouldn't be put off.
I posted a proof of concept along with other contributors in #634110: Rewrite quiz_take_quiz() with FAPI to rewrite that function and I think it should be revisited before even thinking about 8.x.
Comment #135
kc99 CreditAttribution: kc99 commentedAfter trying #131 and #116, get:
Notice: Undefined property: stdClass::$single_page in quiz_take_quiz() (line 2026 of /srv/bindings/03871c1026de4a709ca559d10ff04c25/code/sites/all/modules/quiz/quiz.module).
In Taking Options, Show all questions on a single page checkbox does not stayed checked. Yes, ran update.php.
Comment #136
scottrigbyCross-posting #2220635: co-maintainer request for djdevin for those interested in #634110-47: Rewrite quiz_take_quiz() with FAPI
Comment #137
Alcaparra CreditAttribution: Alcaparra commentedis this feature in the new versions?
Comment #138
djdevinit's in the 5.x version
Comment #139
maxichka CreditAttribution: maxichka commentedThis functionality doesnt seem to be available in 5.x version.
Which Dev version do I download?
Comment #140
djdevinThe functionality is in any 5.x version, enable the "Quiz page" module.
Comment #141
Alcaparra CreditAttribution: Alcaparra commentedPlease, please, please, I need this feature in version 7.x
Comment #142
djdevinPlease stop asking for this, it is already in the 7.x-5.x version.
Comment #143
seanenroute CreditAttribution: seanenroute commented@alcaparra and anyone else interested I've got a test site up running Quiz 7.5x with the ability to create single page quizzes. Feel free to play around.
http://elearning.seanbarber.com/
Comment #144
Alcaparra CreditAttribution: Alcaparra commentedI activated "Quiz page" module, but I don't know what to do after, any guide?
Comment #145
blakefrederick CreditAttribution: blakefrederick commentedI also enabled the Quiz page module, but it appears to only have 2 fields - Title and Question. The Question field is merely a text area with summary. It's not at all clear to me how the Quiz page content type can be utilized to create multiple Quiz questions on a single page. Care to enlighten us djdevin?
Comment #146
ezraw CreditAttribution: ezraw commentedI wrote some basic instructions with screenshots that might be of use: https://www.drupal.org/node/2333943#comment-9126321
Comment #147
blakefrederick CreditAttribution: blakefrederick commentedThanks ezraw! Those instructions are clear and worked perfectly for me.
Comment #148
cornelism CreditAttribution: cornelism commentedso tell me, where is that quiz page module, because I cannot seem to find it.
Comment #149
djdevinSee https://www.drupal.org/node/503228#comment-9167527
and
See https://www.drupal.org/node/503228#comment-9195471
for instructions.
Comment #150
kandrupaler CreditAttribution: kandrupaler commentedHi!
I'm new to Drupal. I installed quiz 7.x-4.0-rc1. It's working fine except for the issue in this thread: all questions on one page.
Is there a way to get all questions on the same page with 7.x-4.0-rc1? If yes, what is that way?
Also, I see that it's going to happen in 7.x-5.x. Any idea when this version will be released?
Comment #151
djdevinHi,
5.x is pretty stable. It's in alpha because the API is changing a bit.
There is no good way to get page functionality in the 4.x version.
If you are just starting out you can safely start with 7.x-5.x-alpha10.
Comment #152
kandrupaler CreditAttribution: kandrupaler commentedThanks @djdevin. Installed 7.x-5.x-alpha10 and it's working fine!
Comment #153
nareshbw CreditAttribution: nareshbw commented#116 is working fine for me
Comment #154
kandrupaler CreditAttribution: kandrupaler commented@djdevin,
7.x-5.x-alpha10 doesn't seem to have H5P support. Is there a way to enable it without losing the same page functionality?
Comment #155
akalata CreditAttribution: akalata commented@kiranbr for 5.x, use https://www.drupal.org/project/quiz_h5p for H5P content.
Comment #156
kandrupaler CreditAttribution: kandrupaler commented@akalata thanks a ton!!!!
Comment #157
Ameer Mubarik Bajwa CreditAttribution: Ameer Mubarik Bajwa commentedHow can we show all question under on page?