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.
I use pages and panels to completely control the display of my webpage. However, with quiz questions, I don't see how I can use pages and panels to control it's rendering. Any ideas?
Comment | File | Size | Author |
---|---|---|---|
#23 | quiz_take_pane_task-2013168-23.patch | 5.72 KB | partdigital |
#20 | quiz-undefined-index-fix-2013168-20.patch | 693 bytes | estebanvalerio.h |
#1 | quiz_take_pages-2013168-1.patch | 7.03 KB | Bès |
Comments
Comment #1
Bès CreditAttribution: Bès commentedHere is a patch that add a task manager for pagemanager for the node/%node/take path and a ctools content_type for the quiz take page to have a pane with the quiz take form in a panels.
Comment #2
mcpuddin CreditAttribution: mcpuddin commentedAwesome Bes! So I actually found this module which did everything I needed:
http://drupal.org/project/pm_existing_pages
It turns any custom path into a pageable system.
Comment #3
Bès CreditAttribution: Bès commentedYes I know pm_existing_pages but we still need the ctools content_type to display quiz take pages. And as the creation of a task plugin is easy I did it.
Can you confirm that the ctools content type "quiz take pane" works for you ?
Comment #4
jhedstromThis patch works great. I didn't need the additional module pm_existing_pages.
Comment #5
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedGood :) Patch in comment #1 has been committed but I didn't test it thoroughly. It would be nice if one of you could provide panel's export to test it easily.
Comment #7
kylahuff CreditAttribution: kylahuff commentedHi guys,
I'm trying to do the same thing. I have a quiz that I'm trying to display on my panel page. So you can take the quiz from the home page and it doesn't take you off to the /take page.
I have the module - pm_existing_pages installed.
But I can't figure out how I actually get it to work?
Can someone please provide step by step instructions?
Thanks in advance.
Comment #8
jhedstrom@kylahuff, in theory, if you are using it on a page that doesn't already have a node context, you'll need to add one. Once the panel has a quiz node context, the 'Quiz take pane' should be available under the 'Quiz' category when you go to add content to your panel. You shouldn't need the pm_existing_pages module at all for the basic use case.
I only tested this to take over the entire
node/NID/take
path with a panel, I didn't test with embedding specific quizzes in panels.Comment #10
ksiebel CreditAttribution: ksiebel commentedThe panels/ctools integration has to be rewritten after the FAPI refactoring. Current integration does not work anymore...
Comment #11
ksiebel CreditAttribution: ksiebel commentedComment #13
ksiebel CreditAttribution: ksiebel commentedThe panels integration should be implemented for:
- quiz question
- quiz question feedback
- quiz results (myresults...)
Comment #16
seanenroute CreditAttribution: seanenroute commentedI'm having a dickens of a time getting Quiz Take pages into panels for layout purposes. What selection/context combination should be used?
Comment #17
seanenroute CreditAttribution: seanenroute commentedJust noticed an error from the quiztake panel page.
Notice: Undefined index: node/%node/take in quiz_quiztake_menu_alter() (line 44 of C:\Users\SeanB\Sites\lquiz75\sites\all\modules\quiz\plugins\page_manager\tasks\quiztake.inc).
I'm using Quiz 7.5 dev - June 25 version
Comment #18
geisel CreditAttribution: geisel commentedThe issue in #17 seems to be part of the problem, for sure. In quiztake.inc we set the page handler for node/%node/take, but in quiz.module the handler is for node/%quiz_menu/take so we don't actually override the same index into the array for the page manager, hence it never gets set.
I'm not 100% sure, but it looks like it could also be a problem that quiz.module defines node/%quiz_menu/take/%question_number as I'm not sure that is covered by the override. I didn't check the revision history, but I'm guessing those changes were made to quiz.module after pages integration was initially working.
I dug into this to fix a problem for a client and haven't found a simple fix yet, but hopefully this is enough to help someone else get there faster.
-Brian
Comment #20
estebanvalerio.h CreditAttribution: estebanvalerio.h commentedI also got issue on #17 after updating quiz module and run update.php:
Notice: Undefined index: node/%node/take in quiz_quiztake_menu_alter() (line 44 of quiz/plugins/page_manager/tasks/quiztake.inc).
Here's a quiz-undefined-index-fix-2013168-20.patch for that error.
Comment #21
partdigital CreditAttribution: partdigital commentedIt looks like there were a lot of changes in the quiz module that weren't accounted for in the panel pane nor page manager task. In particular the page callback and the paths in page_manager/tasks/quiztake.inc
I've attached a patch that fixes the panel pane and page manager task. I rolled it off the latest release. (7.x-5.0-alpha9+1-dev) but it also works with 7.x-5.0-alpha9
Comment #22
partdigital CreditAttribution: partdigital commentedThere was a bug in the previous patch, here is a revised version.
Comment #23
partdigital CreditAttribution: partdigital commentedAnd one more, this addresses the same issue. I keep finding issues with my patch heh
Comment #24
djdevinThanks!
Just wondering why you added the isset()s around $quiz->allow_jumping, since that value is supposed to always be set.
Otherwise changes look pretty minimal so if somebody can RTBC I'll commit.
Comment #25
osopolarThis patch works for me, thanks.
Comment #26
djdevinComment #28
djdevinCommitted, thanks!
Comment #31
neubreed CreditAttribution: neubreed as a volunteer and commentedIs it possible to add the current question as a context so I can add fields from the question's image / media or video fields into panes on the take page?