TIME EXCEED

All web design discussion, including Ultimate Quiz MOD support.

Moderator: CricketMX Forum Moderators

Post Reply
User avatar
kikkotm
Know-It-All
Know-It-All
Posts: 186
Joined: Fri Nov 09, 2007 12:16 am
Location: ROMA CAPUT MUNDI - Italy

So, i hope that i can explain my problem in a nearly correct english :P

I've installed the UQM and I made some quizzes with the time limit.
So, if I try to solve the quiz in a time out of limits it's all ok and I can't publish my results... but if I come back (with the same user), re-open the quiz and check the answers in a short time, the results will be showed.

I use the time to force the users to don't use Google...but if I can do the quiz 2 times, is useless use the time.

I can also solve the quiz how many times I want... This is a little "bug" of the mod...

There is the possibility to solve only ONE time the quiz, and if the user go out of time to do a result =0 ?
10x
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Do you mean that, you want a user to only be able to play a quiz once, regardless of whether they complete it or not?
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)
User avatar
kikkotm
Know-It-All
Know-It-All
Posts: 186
Joined: Fri Nov 09, 2007 12:16 am
Location: ROMA CAPUT MUNDI - Italy

yeah...maybe...

I want that a user can play a quiz ONLY ONE TIME.

I try to explane with an example:
I'm an user and I open a quiz.
I read the first question
I search the answer on Google and I write it
I read the second question
I search on Google ...
etc...
I click on SUBMIT QUIZ
And come up the phrase: "TIME LIMIT EXCEED"
So, I come back.
Refresh the page
Do the same quiz in 20sec with the answer that I've searched previously.
Submit my PERFECT result...

Is too easy to solve with this method...You understand?
ImageImage Wine is an enemy of the man... Who escapes in front of the enemy is an ignoble man!!! ImageImage
Image Image
Image Image
Image Image
Image Image
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

In the ACP under this Quiz Config have you selected the setting that users can only play a quiz once?
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)
User avatar
kikkotm
Know-It-All
Know-It-All
Posts: 186
Joined: Fri Nov 09, 2007 12:16 am
Location: ROMA CAPUT MUNDI - Italy

yeah of course, but the problem persist!

edit: Ok it was my error...Only the amministrator can play the quiz how many times he want :wink: but the problem with the time is the same:
If the user play the quiz once and he go out of time limit, he can play another time the same quiz.
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

kikkotm wrote:If the user play the quiz once and he go out of time limit, he can play another time the same quiz.
Even if you have the play once setting set to on?
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)
User avatar
kikkotm
Know-It-All
Know-It-All
Posts: 186
Joined: Fri Nov 09, 2007 12:16 am
Location: ROMA CAPUT MUNDI - Italy

yeah...I said you before!
ImageImage Wine is an enemy of the man... Who escapes in front of the enemy is an ignoble man!!! ImageImage
Image Image
Image Image
Image Image
Image Image
User avatar
kikkotm
Know-It-All
Know-It-All
Posts: 186
Joined: Fri Nov 09, 2007 12:16 am
Location: ROMA CAPUT MUNDI - Italy

impossible to solve? :roll:
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

I'll need to have a look at the code, I think I might need to write something custom for you.

Check back here tomorrow, hopefully I can post a quick solution for you :)
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)
User avatar
kikkotm
Know-It-All
Know-It-All
Posts: 186
Joined: Fri Nov 09, 2007 12:16 am
Location: ROMA CAPUT MUNDI - Italy

oh but i'm always here...i read some posts to improve the quizzes :P
ImageImage Wine is an enemy of the man... Who escapes in front of the enemy is an ignoble man!!! ImageImage
Image Image
Image Image
Image Image
Image Image
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

See if this fixes it.

Open quiz.php

FIND

Code: Select all

	if( $board_config['Quiz_timeout'] != 0 )
	{
		if( $time_taken_to_complete_quiz > ($board_config['Quiz_timeout'] * $number_of_questions) )
		{
			message_die(GENERAL_MESSAGE, $lang['Quiz_user_exceed_timelimit']);
		}
	}
REPLACE WITH

Code: Select all

	if( $board_config['Quiz_timeout'] != 0 )
	{
		if( $time_taken_to_complete_quiz > ($board_config['Quiz_timeout'] * $number_of_questions) )
		{
		$statistics_sql = "INSERT INTO " . QUIZ_STATISTICS_TABLE . " (stats_id, quiz_id, user_id, stats_correct, stats_incorrect, stats_percentage) VALUES ('" . quiz_new_stats_id() . "', '$id', '" . $userdata['user_id'] . "', '0', '0', '0', '0')";
			
			if(!$db->sql_query($statistics_sql))
			{
				message_die(GENERAL_ERROR, '', 'Could not insert statistical values', __LINE__, __FILE__, $statistics_sql);
			}
			
			message_die(GENERAL_MESSAGE, $lang['Quiz_user_exceed_timelimit']);
		}
	}
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)
User avatar
kikkotm
Know-It-All
Know-It-All
Posts: 186
Joined: Fri Nov 09, 2007 12:16 am
Location: ROMA CAPUT MUNDI - Italy

no...there is an error...

Code: Select all

DEBUG MODE



SQL Error : 1136 Column count doesn't match value count at row 1

INSERT INTO phpbb_quiz_statistics (stats_id, quiz_id, user_id, stats_correct, stats_incorrect, stats_percentage) VALUES ('14', '3', '40', '0', '0', '0', '0')


Line : 855

File : quiz.php
i try to write

Code: Select all

 if( $db->sql_query($statistics_sql)) 
instead

Code: Select all

 if(!$db->sql_query($statistics_sql)) 
it run without errors, but the problem with time is the same...if the user exceed, he can run the quiz again
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Sorry, I think I accidentally entered a column too many. Give this a shot:

Open quiz.php

FIND

Code: Select all

	if( $board_config['Quiz_timeout'] != 0 )
	{
		if( $time_taken_to_complete_quiz > ($board_config['Quiz_timeout'] * $number_of_questions) )
		{
			message_die(GENERAL_MESSAGE, $lang['Quiz_user_exceed_timelimit']);
		}
	}
REPLACE WITH

Code: Select all

	if( $board_config['Quiz_timeout'] != 0 )
	{
		if( $time_taken_to_complete_quiz > ($board_config['Quiz_timeout'] * $number_of_questions) )
		{
		$statistics_sql = "INSERT INTO " . QUIZ_STATISTICS_TABLE . " (stats_id, quiz_id, user_id, stats_correct, stats_incorrect, stats_percentage) VALUES ('" . quiz_new_stats_id() . "', '$id', '" . $userdata['user_id'] . "', '0', '0', '0')";
			
			if(!$db->sql_query($statistics_sql))
			{
				message_die(GENERAL_ERROR, '', 'Could not insert statistical values', __LINE__, __FILE__, $statistics_sql);
			}
			
			message_die(GENERAL_MESSAGE, $lang['Quiz_user_exceed_timelimit']);
		}
	}
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)
User avatar
kikkotm
Know-It-All
Know-It-All
Posts: 186
Joined: Fri Nov 09, 2007 12:16 am
Location: ROMA CAPUT MUNDI - Italy

GOOOOOOOOOOOOOOOOD
NOW IS ALL OK!!!!! I CAN DO MY TOURNAMENT!!!

You're the best!!! :D :D :D :D :D

Image
ImageImage Wine is an enemy of the man... Who escapes in front of the enemy is an ignoble man!!! ImageImage
Image Image
Image Image
Image Image
Image Image
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Fantastic, glad to hear all is well.

Please feel free to stick around, be sure to check out the OT Forum if you haven't already :)
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