Page 1 of 1

quiz input answers case sensitive

Posted: Tue Jul 03, 2007 10:10 am
by kking183
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

Posted: Tue Jul 03, 2007 10:40 am
by battye
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);
			}

Posted: Tue Jul 03, 2007 10:54 am
by kking183
yes its there thank you for the quick reply

Posted: Tue Jul 03, 2007 10:57 am
by battye
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

Posted: Tue Jul 03, 2007 11:04 am
by kking183
all that seemed to do is make it say all the answers were correct

Posted: Tue Jul 03, 2007 11:16 am
by battye
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 :))

Posted: Tue Jul 03, 2007 11:23 am
by kking183
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:

Posted: Tue Jul 03, 2007 11:25 am
by kking183
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

Posted: Tue Jul 03, 2007 11:26 am
by kking183
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

Posted: Tue Jul 03, 2007 11:30 am
by battye
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 :)

Posted: Tue Jul 03, 2007 11:34 am
by kking183
thanks for all your help as soon as i have made some more quizzes i will attempt making some quiz packs for here :)

Posted: Tue Jul 03, 2007 11:46 am
by battye
Fantastic news, mate :)

Hope to see you around here again. Feel free to check out our OT Forum if you are interested :)