extra field ?

All web design discussion, including Ultimate Quiz MOD support.

Moderator: CricketMX Forum Moderators

Post Reply
antisa
Greenhorn
Greenhorn
Posts: 3
Joined: Mon Oct 01, 2007 1:16 pm

Is is possible to display a text box if the result was true when the user has responded false ?

for example for the true/false quizz the response was false, the user would like to know why and what was the correct answer (some details)

Thanks for all!!
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

You asked that in your other post :)

Unfortunately, this isn't a feature.
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
lennibert
Greenhorn
Greenhorn
Posts: 1
Joined: Mon Dec 10, 2007 9:50 pm

Hi there, I could use some help on the same issue.
I really need comments to my questions, so it tried to fix it myself.

First I added a textfield to the quiz_multiple_choice_data table. For testing purposes I also added a few entries to the field.

I then added a column to the table in the quiz_result_body-template and invented a variable, which I called {answer_row.U_COMMENT}.

Now of course this variable needs to be defined, so I tried to do that in the quiz.php, but unfortunately I didn't get it to work. Any hints on what to add to quiz.php? Do more files have to be changed? For now I'm just interested in SEEING the comments, not editing them...
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

1) You have to add a quiz_comment table into the respective database tables. From memory I think they are _true_false, _multiple_choice and _input_answer

It sounds like you have already done this part. If you didn't call it quiz_comment, then anywhere I've put quiz_comment below replace it with what you actually called it.

2) You can't just invent variables out of thin air. There will be a part of quiz.php where you will find:

Code: Select all

$template->assign_block_vars("answer_row", array(
FIND this. Below you might see something like

Code: Select all

"U_QUESTION" => $row['quiz_question']
Note: It might not be $row, it might be $quiz_row, or $question_row or something like that. This is important.

Below that, add U_COMMENT, ie:

Code: Select all

"U_COMMENT" => $row/$quiz_row/$question_row/etc['quiz_comment']
Now, don't include all of the slashes :wink:

If it is $row, you'd make it $row['quiz_comment'], if it was $quiz_row it would be $quiz_row['quiz_comment'] and so on.

In the .tpl file quiz_result_body.tpl, make sure if you are adding an extra column to the layout you increase whatever colspan value is included, otherwise the layout might look strange.

Good luck :)
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
Post Reply