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?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Bès’s picture

Status: Active » Needs review
FileSize
7.03 KB

Here 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.

mcpuddin’s picture

Awesome 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.

Bès’s picture

Yes 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 ?

jhedstrom’s picture

Version: 7.x-4.0-alpha12 » 7.x-4.x-dev
Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

This patch works great. I didn't need the additional module pm_existing_pages.

Sivaji_Ganesh_Jojodae’s picture

Category: Support request » Feature request
Status: Reviewed & tested by the community » Fixed

Good :) 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

kylahuff’s picture

Status: Closed (fixed) » Active

Hi 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.

jhedstrom’s picture

@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.

  • Commit 052f07b on 7.x-4.x, 7.x-5.x by sivaji:
    Issue #2013168 by Bès | mcpuddin: Quiz Question with Pages and Panels.
    
ksiebel’s picture

Version: 7.x-4.x-dev » 7.x-5.x-dev

The panels/ctools integration has to be rewritten after the FAPI refactoring. Current integration does not work anymore...

ksiebel’s picture

  • Commit 052f07b on 7.x-4.x, 7.x-5.x, quiz-pages by sivaji:
    Issue #2013168 by Bès | mcpuddin: Quiz Question with Pages and Panels.
    
ksiebel’s picture

The panels integration should be implemented for:

- quiz question
- quiz question feedback
- quiz results (myresults...)

  • Commit 052f07b on 7.x-4.x, 7.x-5.x, quiz-pages, 2269219 by sivaji:
    Issue #2013168 by Bès | mcpuddin: Quiz Question with Pages and Panels.
    

  • Commit 052f07b on 7.x-4.x, 7.x-5.x, 2269219 by sivaji:
    Issue #2013168 by Bès | mcpuddin: Quiz Question with Pages and Panels.
    
seanenroute’s picture

I'm having a dickens of a time getting Quiz Take pages into panels for layout purposes. What selection/context combination should be used?

seanenroute’s picture

Just 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

geisel’s picture

The 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

  • sivaji committed 052f07b on 7.x-6.x
    Issue #2013168 by Bès | mcpuddin: Quiz Question with Pages and Panels.
    
estebanvalerio.h’s picture

I 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.

partdigital’s picture

It 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

partdigital’s picture

FileSize
5.67 KB

There was a bug in the previous patch, here is a revised version.

partdigital’s picture

FileSize
5.72 KB

And one more, this addresses the same issue. I keep finding issues with my patch heh

djdevin’s picture

Thanks!

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.

osopolar’s picture

This patch works for me, thanks.

djdevin’s picture

Status: Active » Needs review

The last submitted patch, 1: quiz_take_pages-2013168-1.patch, failed testing.

djdevin’s picture

Status: Needs review » Fixed

Committed, thanks!

  • djdevin committed 0309991 on 7.x-5.x authored by partdigital
    Issue #2013168 by partdigital, Bès, estebanvalerio.h: Quiz Question with...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

neubreed’s picture

Is 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?