quiz input answers case sensitive

All web design discussion, including Ultimate Quiz MOD support.

Moderator: CricketMX Forum Moderators

Post Reply
kking183
Greenhorn
Greenhorn
Posts: 20
Joined: Tue Jul 03, 2007 10:03 am

hi i have installed your quiz mod but i seem to be having the problem the answers are case sensitive but i am using your latest version 1.33 which says this bug had been fixed can you tell me whats wrong as far as i know i installed it all correctly i uploaded the files edited the ones that need editing then run the install.php
my site is http://www.nopaypoker.co.uk if you want to take a look
and you can use this username

username : support
password : help
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

If you open quiz.php, can you find this code?

Code: Select all

			if(strtolower($user_answer) == strtolower($actual_answer))
			{
				$correct[$i] = 1;
				$incorrect[$i] = 0;
				
				// The message consists of Question: Your Answer: Actual Answer
				$status = sprintf($lang['Quiz_answer_status'], $user_answer, $actual_answer);
			}
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)
kking183
Greenhorn
Greenhorn
Posts: 20
Joined: Tue Jul 03, 2007 10:03 am

yes its there thank you for the quick reply
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Just to test that, replace that section with:

Code: Select all

         if(strtolower("AAAaaa") == strtolower("aaaaaa"))
         {
            $correct[$i] = 1;
            $incorrect[$i] = 0;
            
            // The message consists of Question: Your Answer: Actual Answer
            $status = sprintf($lang['Quiz_answer_status'], $user_answer, $actual_answer);
         }
Let me know what happens :)

Welcome to the forum by the way :)
Don't forget to make a post in Introductory Forum :D
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)
kking183
Greenhorn
Greenhorn
Posts: 20
Joined: Tue Jul 03, 2007 10:03 am

all that seemed to do is make it say all the answers were correct
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

That is good, it shows that the mechanism is working. Hmm :?

Replace it with

Code: Select all

			if(strtolower($user_answer) == strtolower($actual_answer))
			{
				$correct[$i] = 1;
				$incorrect[$i] = 0;
				
				// The message consists of Question: Your Answer: Actual Answer
				$status = sprintf($lang['Quiz_answer_status'], $user_answer, $actual_answer);
			}
Again, so it is back like it was originally.

Then before:

Code: Select all

if(strtolower($user_answer) == strtolower($actual_answer))
			{
Add:

Code: Select all

$message_d = 'USER ANSWER: ' . strtolower($user_answer) . ' || ACTUAL ANSWER: ' . strtolower($actual_answer) . '<br />';
echo @$message_d;
Let me know what it says (in fact, paste what it says here :))
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)
kking183
Greenhorn
Greenhorn
Posts: 20
Joined: Tue Jul 03, 2007 10:03 am

very strange just before you replied again i changed the top line of the code back to the original and it seems to be working now :roll:
kking183
Greenhorn
Greenhorn
Posts: 20
Joined: Tue Jul 03, 2007 10:03 am

USER ANSWER: david coleman || ACTUAL ANSWER: david coleman
USER ANSWER: || ACTUAL ANSWER: toy story 2
USER ANSWER: || ACTUAL ANSWER: k-9
USER ANSWER: || ACTUAL ANSWER: anthea turner
USER ANSWER: || ACTUAL ANSWER: jack nicholson
USER ANSWER: || ACTUAL ANSWER: tim brooke-taylor, graeme garden and bill oddie
USER ANSWER: || ACTUAL ANSWER: chris evans and gaby roslin
USER ANSWER: || ACTUAL ANSWER: the man with the golden gun
USER ANSWER: || ACTUAL ANSWER: meg ryan
USER ANSWER: || ACTUAL ANSWER: lassie
thats what it showed i only answered the first question
kking183
Greenhorn
Greenhorn
Posts: 20
Joined: Tue Jul 03, 2007 10:03 am

Who did Sue Barker replace as host of the BBC quiz show "A Question Of Sport"? Your answer was david coleman, the correct answer was David Coleman
In 1999, what film became Tom Hanks first sequel? Your answer was , the correct answer was Toy Story 2
What was the name of the robot dog that became a regular companion for "Doctor Who"? Your answer was , the correct answer was K-9
Which former "Blue Peter" presenter was involved in the first National Lottery TV draw in November 1994? Your answer was , the correct answer was Anthea Turner
Who played The Joker in the 1989 film "Batman"? Your answer was , the correct answer was Jack Nicholson
Who were the three stars of the TV show "The Goodies"? Your answer was , the correct answer was Tim Brooke-Taylor, Graeme Garden and Bill Oddie
Who were the original presenters on Channel 4's "Big Breakfast"? Your answer was , the correct answer was Chris Evans and Gaby Roslin
In which Bond film does Britt Ekland play the character of Mary Goodnight? Your answer was , the correct answer was The Man With The Golden Gun
Which actress divorced Dennis Quaid in 2001 after she had an affair with Russell Crowe? Your answer was , the correct answer was Meg Ryan
Which famous female character of TV and films was played by a male when she was first introduced to our screens in 1943? Your answer was , the correct answer was Lassie
Correct Answers: 1 Incorrect Answers: 9
10%
You took 0 minutes, 16 seconds
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

kking183 wrote:very strange just before you replied again i changed the top line of the code back to the original and it seems to be working now :roll:
If it is working, don't make any more changes :)
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)
kking183
Greenhorn
Greenhorn
Posts: 20
Joined: Tue Jul 03, 2007 10:03 am

thanks for all your help as soon as i have made some more quizzes i will attempt making some quiz packs for here :)
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Fantastic news, mate :)

Hope to see you around here again. Feel free to check out our OT Forum if you are interested :)
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