Change layout slides

GoempieK
Forums
I changed the layout of the slides form with panels. Now i would like to change the layout of slides inside a course. When i make changes in panels to the slide layout these work when you go the the slide itself. But when you start a course and the slide is a part of the course then the layout doesn't work. How can i theme the slides inside a course? Thanks
Pepe

Hello,

Hello, You could information about this here : https://h5p.org/documentation/for-developers/visual-changes Hope it helps
GoempieK

Drupal issue

Hello Pepe I don't think is has anything to do with h5p. The layout of a slide is made by drupal, so i would need to know wich .tpl is used to create the view node/xx/take <-- I can't seem to figure out how and where this layout is created. Thanks
admin

Hi GoempieK,

Hi GoempieK,

When you are taking a lesson, you are looking at the questions with a special view mode (question).

So for the slides(quiz_directions) thats what you should look at, the quiz_directions content type in question view mode.

 

Best regards

GoempieK

Thanks

Ok, thanks for clearing up the fog :-)
GoempieK

DisplaySuite

Just tried it with display suit with the same result.
admin

Hi GoempieK,

Hi GoempieK,

You can take a look at the function quiz_take_question_view in profiles/opigno_lms/modules/contrib/quiz/quiz.module

 

Best regards

GoempieK

theme_quiz_single_question_node

Thanks, but stil don't understand why i cant alter the layout with ds or paneliser. In this function the only thing that is happening is calling the question_node function theme_quiz_single_question_node($variables) { $node = $variables['question_node']; // This might seem meaningless, but it is designed this way to allow themes to add more // meaningful stuff here... return drupal_render($node->content); }
GoempieK

update to quiz 7.x-5.2

I see that there are people with the same issues as me https://www.opigno.org/en/forum/developing-opigno/custom-template-slides-etc https://www.drupal.org/node/1120016 https://www.drupal.org/node/2427715#comment-9645933 And it seems that the 5 branch solves these issues. Is it safe to update to quiz 7.x-5.2 or wil this break opigno? Thanks
admin

Hi GoempieK,

Hi GoempieK,

No, regarding branch 5 of quiz you will have to wait for it to be released on Opigno. 

The drupal issue that you linked is very old, does not apply anymore, improvements have been done in the meanwhile, after the node_build_content the function theme_quiz_single_question_node is now called via theme('quiz_single_question_node...

This means that its pretty easy to change it to add specify a specific template file with the hook_theme_registry_alter.

https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_theme_registry_alter/7.x

 

Best regards

GoempieK

almost there

I create a custom quiz-single-question-node.tpl.php <?php print drupal_render($question_node->content['body']); ?> <?php print drupal_render($question_node->content['field_belangrijk']); ?> The only problem i have now is to print the next button to the next quiz. Anyone have an idea how i can do this? Thx