Login Form

#491 – the results of the quiz

Posted in ‘BF Quiz’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Tuesday, 16 December 2014 01:01 AEDT
sashido
Joomla! version: (3.3)

Hi Tim,

Is there a way after to make:

1. after submitting a quiz to load the questions of the quiz with the fields filled in with the answers of the user AND
2. these just given answers marked with "correct" or "incorrect" css classes (like green for correct and red for incorrect)

I'm trying to make a website for children and that will be more clear if they could see what they did good and what they didn't

I guess that I should work with the showIncorrect and showIncorrect2 functions in controller.php... But please, could you give a hint how could I make this work?

I have a one page quiz.

Thank you.

Regards,
Aleksandra
 
Tuesday, 16 December 2014 09:57 AEDT 10'
Tim
Everything Bundle, BF Quiz Plus 3 Years, BF Survey 12 Months
Hi Aleksandra,

>I guess that I should work with the showIncorrect and showIncorrect2 functions in controller.php... But
>please, could you give a hint how could I make this work?

Yes, this would be where you'd need to customise.

In the showIncorrect function, around line 1166, you will see the code that is shown when the answer was correct
//was answer correct?
if(trim(strtoupper($answer))==trim(strtoupper($correctanswer)) | $row->suppressQuestion == 1 | $row->question_type == 10){

You can see on line 1177, it is already showing the question
<?php echo JText::_( $row->question ); ?>

The answer selected is shown via
<?php echo $answerWithSpaces; ?>
and you could adjust the code round here to show the green correct

When it was incorrect, you'll see the code around line 1218
<?php echo JText::_("COM_BFQUIZPLUS_YOUR_ANSWER_OF"); ?>
<?php echo $answerWithSpaces; ?>

and you could change this code to show the red incorrect.

regards

Tim
Follow us on twitter http://twitter.com/tamlynsoftware
Wednesday, 17 December 2014 00:52 AEDT
sashido
Thank you for detailed and quick answer :-) !

In the quizzes I use mostly the following structure:

The "heading" type of question with the explanation of the task and then a number of questions belonging to this "heading". So I need to display the "heading" of the question. And then indeed the answers. I looked through the controller.php, but couldn't really find what variable is responsible for that.

Then I also probably need to access the variables of suffix and prefix of the question.

Thank you very much again!

 
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.
Go to top