Closed (fixed)
Project:
Quiz
Version:
7.x-5.x-dev
Component:
Code - Quiz core
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 May 2014 at 10:16 UTC
Updated:
28 Jan 2020 at 09:03 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ezraw commentedThis works in 7.x-5.x-dev.
Comment #2
djdevinJust tested this and it did not. Now when you view the question its fine as expected, but inside of the quiz the fields don't show.
Talked about this briefly at Drupalcon @ the Quiz BOF, we need to render the entity and it will open up a lot more behaviours.
Comment #3
djdevinComment #5
seanenroute commentedThe June 7 version of 7.5 dev looks like it will utilize an image field. I've enclosed a quick demo video of it in action.
For those using 7.4 you can use the Quiz CCK module to bring in images and videos.
Comment #8
ezraw commentedTested true/false question by adding an image field, creating a quiz, add a t/f question with an image and taking test as an authenticated user. Image appears as expected.
Comment #9
ezraw commentedComment #11
yogesh kushwaha commentedhow to display audio field when user is actually taking the quiz. It shows on the multiple choice content type node, but not when user is actually taking the quiz. is there any available patch or still not fixed? I am still wondering..
Thanks
Comment #12
djdevinMake sure you are using the 5.x version of the module.
Comment #13
yogesh kushwaha commentedthanks its working now but at result page it display each question score, I need result summary also. How can I do this because my requirement is to display result summary as well as score.
Comment #14
esod commentedWe're using 7.x-5.0-alpha4+72-dev. I've added the image field (field_quiz_icon) to the quiz, multichoice, and truefalse content types. I've added an image to the quiz node on node/11111/edit. I've added an image to the multichoice question through the Manage questions admin interface. node/11111/quiz/questions -> Edit, which takes me to node/22222/edit.
The image appears on the question node (node/22222) and on the quiz node (node/11111). In the quiz itself, field_quiz_icon is empty.


I can node_load(11111) in my hook_form_alter() to get the data:
but that seems expensive. However for our use case node_load() on the quiz will pre-empt administrators having to add the same image to each question. But that's our use case.
Any thoughts?
Comment #15
djdevinAre you sure your quiz has the correct revision of the question? That's the only way the field would be empty.
Note that you will have to finish your current result to start a new one with the new revision. Check the "Manage questions" tab to make sure you are on the current revision of the question before doing so.
Comment #16
esod commentedThanks. When I went to Manage questions I noticed that one of the questions (perhaps the one that had the image), needed to be updated. But for us the question becomes moot since we decided that we want to have only one image for the entire quiz print on each question and on the report page. To accomplish that I'm querying the database in my form_alter with:
We don't love using arg(), and it's going away in Drupal 8, but for this case we're going with it. I'm sure there's a query that will get the uri without using arg().
If we add another image, this one to the question, I'll comment again.
Comment #17
djdevinSure, so this still works.
If you did want to do something special with the way questions render, keep in mind that they are nodes, and they have view modes (Question view mode), so if you were to do something with the template or display suite, the changes would be visible. That is probably better than doing a form alter.
#2371115: Quiz question "take" not rendering using correct template might provide some more insight.
Comment #18
esod commentedWe are most likely not using display suite. When you say "do something with the template" are you referring to a display suite template? Adding to $form gets the values to our copy of quiz-report-form.tpl.php, but so far we can add elements to the presentation layer by either:
1. using #weight in the elements we are adding; not an ideal solution.
2. adding theme templates whose contents print below the form values.
I might be a little off topic for this issue. I'm just concerned about getting the public facing pages to a place where the front end folks can perform their magic.
Comment #19
neubreed commentedIt would be good to be able to inert any entity and have it appear on the rendered question. I've tried media which allows for all sorts of file types, which doesn't work unfortunately :(
I want the user to insert either an image or video_embed which works but I don't want them to be able to insert both. So I installed conditional_fields so the user chooses one or the other and nothing appears on the rendered question even though both these types do work.
Is there a hook in the module somewhere so I can override the question rendering to get this to work?
** EDIT ** Sorry worked it out .. I need to delete all the results to see any updates to the questions
Comment #20
vmkazakoff commentednot work with private files (