Problem in upgrade Ultimate Quiz Mode 1.2.0 -> 1.3.3

All web design discussion, including Ultimate Quiz MOD support.

Moderator: CricketMX Forum Moderators

doswald
Frequent Poster
Frequent Poster
Posts: 32
Joined: Thu Jan 10, 2008 10:32 am

hello battye, first of all let me thank you for this wonderful MOD, my users like it very much, i am juts having problem upgrading from the previous version 1.2.0 to 1.3.3 (downloaded from this site).

sir, just a few questions i already browse this site and hunt for the solutions because whenever i upgrade my UQM in my test environment I can't see the the Time where i will set the duration of test, also I carefully followed the UQM...mod.txt instruction, since i have UQM 1.2.0 i just put the "quiz_updater.php" in my root then install it (pls correct me if that is the right thing).

now, after i copied/overwrite all the quiz files this is what happened whenever i add quiz True/False, after the quiz the answer looks like this now (pls refer to the image below), as you can see the "Your answer was (blank)," and it supposedly the answers will show isn't it?

i hope you can help me too mate. this is wonderful MOD...

Image

Quiz Admin

Image
Last edited by doswald on Fri Jan 11, 2008 7:13 am, edited 1 time in total.
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Hmm, it's not picking up the post data somehow. Do you use phpNuke and/or PHP5?
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)
doswald
Frequent Poster
Frequent Poster
Posts: 32
Joined: Thu Jan 10, 2008 10:32 am

battye wrote:Hmm, it's not picking up the post data somehow. Do you use phpNuke and/or PHP5?
hi mate. that was fast, thanks for the reply i'm using Integramod (phpbb) with PHP version 4.3.10

ps> i attached the Quiz admin in the first post to show that Time didn't appear.

thanks again mate.
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Could you please post of the following files (in code tags of course) in your next post

quiz.php
admin_quiz_body.tpl (I can't remember if that is the correct file, it might be called quiz_config_body.tpl... it will be whichever quiz file is in your subSilver/admin/ directory)

Thanks :)
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)
doswald
Frequent Poster
Frequent Poster
Posts: 32
Joined: Thu Jan 10, 2008 10:32 am

hi mate, here's my

quiz.php

Code: Select all

<?php
/***************************************************************************
 *                               quiz.php
 *                            -------------------
 *   begin                : Sat, May 21, 2005
 *   copyright          : (C) 2005 Battye @ CricketMX.com
 *   email                : cricketmx@hotmail.com
 *
 *   $Id: quiz.php, v2 (May 2005) battye Exp $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
include($phpbb_root_path . 'includes/functions_quiz.'.$phpEx);

	$language = $board_config['default_lang'];
	
	if (!file_exists($phpbb_root_path . 'language/lang_' . $language . '/lang_quiz.' . $phpEx))
	{
		$language = 'english';
	}
	
	include($phpbb_root_path . 'language/lang_' . $language . '/lang_quiz.' . $phpEx);

$userdata = session_pagestart($user_ip, PAGE_QUIZ);
init_userprefs($userdata);

// Just to help users know what version of UQM they are using, I will add it here, it will be changed in every version mind you (it is commented out purposely)
// $quiz_version = '1.2.0';

	// Define mode and type
	$mode = htmlspecialchars($HTTP_GET_VARS['mode']);
	$type = htmlspecialchars($HTTP_POST_VARS['type']);
	
		if($type == "multiple_choice")
		{
			$quiz_type = "multiple_choice"; // Default for 1.0.x
		}
		
		if($type == "true_false")
		{
			$quiz_type = "true_false"; // New in 1.1.x
		}
		
		if($type == "input_answer")
		{
			$quiz_type = "input_answer"; // Default for Pre 0.0.x, reapplied in 1.1.x
		}

	if( isset($HTTP_GET_VARS[POST_CAT_URL]) ) // Let's list the quizzes in a certain category, and all that jazz
	{
		$category_id = intval($HTTP_GET_VARS[POST_CAT_URL]);
	
		$password_sql = "SELECT * FROM " . QUIZ_CATEGORY_TABLE . " WHERE category_id = $category_id";
		
			if(!$password_result = $db->sql_query($password_sql))
			{
			message_die(GENERAL_ERROR, 'Could not obtain category password', '', __LINE__, __FILE__, $password_sql);
			}
			
			$password_row = $db->sql_fetchrow($password_result);
			
			if( !$userdata['session_logged_in'] )
			{
				if( $password_row['category_permissions'] == ON || $password_row['category_permissions'] == OFF )
				{
				message_die(GENERAL_ERROR, $lang['Quiz_registered_category_permissions_no_access']);
				}
			}
		
		if($password_row['category_password'] !== 'd41d8cd98f00b204e9800998ecf8427e' && quiz_check_category_password($category_id) != ON)
		{
			if( isset($HTTP_POST_VARS['password']) )
			{
				if( md5($HTTP_POST_VARS['password']) != quiz_category_password($category_id) )
				{
					message_die(GENERAL_ERROR, $lang['Quiz_category_password_wrong']);
				}
				
				else
				{
				$password_data = $userdata['session_quiz_categories'] . $category_id . ',';
				$update_pw_data = "UPDATE " . SESSIONS_TABLE . " SET session_quiz_categories = '" . $password_data . "' WHERE session_id = '" . $userdata['session_id'] . "'";
				
					if(!$db->sql_query($update_pw_data))
					{
						message_die(GENERAL_ERROR, '', 'Could not update password list', __LINE__, __FILE__, $update_pw_data);
					}
					
				redirect( append_sid("quiz.$phpEx?" . POST_CAT_URL . "=$category_id", true) );
				}
			}
			
		include($phpbb_root_path . "includes/page_header.$phpEx");
		$template->set_filenames(array("quiz_pw" => 'quiz_category_password_body.tpl'));
		
			$template->assign_vars( array(
			"F_FORM" => append_sid("quiz.$phpEx?" . POST_CAT_URL . "=$category_id"),
			
			"L_SUBMIT" => $lang['Submit'],
			"L_ENTER_PASSWORD" => $lang['Quiz_password_protect_information'],
			"L_PASSWORD" => $lang['Quiz_password_protect']));
			
		$template->pparse("quiz_pw");
		include($phpbb_root_path . "includes/page_tail.$phpEx");
		}
	
	$page_title = $lang['Quiz_quizzes'] . ' :: ' . switch_to_category_name($category_id);
	include($phpbb_root_path . "includes/page_header.$phpEx");
	$template->set_filenames(array("quiz_cat" => 'quiz_category_body.tpl'));	
	
	if( isset($HTTP_POST_VARS['view_method']) )
	{
	$method = intval($HTTP_POST_VARS['view_method']);
		
		if($method == 1)
		{
			$sql_addon = "ORDER BY quiz_name ASC";
		}

		if($method == 2)
		{
			$sql_addon = "ORDER BY quiz_id ASC";
		}
		
		if($method == 3)
		{
			$sql_addon = "ORDER BY quiz_type ASC";
		}
		
		if($method == 4)
		{
			$sql_addon = "ORDER BY quiz_author ASC";
		}
	}
	
	else
	{
		$sql_addon = 'ORDER BY quiz_name ASC';
	}
		
		$sql = "SELECT * FROM " . QUIZ_GENERAL_TABLE . " WHERE quiz_category = '" . $category_id . "' " . $sql_addon;
			
		if(!$result = $db->sql_query($sql))
		{
			message_die(GENERAL_ERROR, '', 'Could not obtain quiz name data', __LINE__, __FILE__);
		}
		
		if( $db->sql_numrows($result) == 0)
		{
			$template->assign_block_vars("nothing_row", array(
			"L_NO_RESULTS" => sprintf($lang['Quiz_no_quizzes'], append_sid("quiz.$phpEx?mode=add"))
			));
		}
		
		while($row = $db->sql_fetchrow($result))
		{		
			$quiz_name = str_replace("\'", "''", $row['quiz_name']);
			$quiz_id = intval($row['quiz_id']);
			
				if( $row['quiz_author'] != -21000 )
				{
				$quiz_author = ( $row['quiz_author'] == ANONYMOUS ) ? $lang['Guest'] : "<a href=" . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . intval($row['quiz_author']) . "") . ">" . convert_id($row['quiz_author']) . "</a>";
				}
				
				else
				{
				$quiz_author = $board_config['Quiz_packs_bot'];				
				}
				
			$quiz_type = str_replace("\'", "''", $row['quiz_type']);
		
			if( intval($row['quiz_plays']) != 1 )
			{
				$quiz_plays = sprintf($lang['Quiz_number_of_plays'], $row['quiz_plays']);
			}
			
			else if( intval($row['quiz_plays']) == 1 )
			{
				$quiz_plays = $lang['Quiz_number_of_play'];
			}

		// We need to let the users know which type of quiz it is surely.
		if($quiz_type == MULTIPLE_CHOICE)
		{
			$ultimate_quiz_type = $lang['Quiz_type_multiple_choice'];
		}	
		
		if($quiz_type == TRUE_FALSE)
		{
			$ultimate_quiz_type = $lang['Quiz_type_true_false'];
		}		
		
		if($quiz_type == INPUT_ANSWER)
		{
			$ultimate_quiz_type = $lang['Quiz_type_input_answer'];
		}
		
			 $template->assign_block_vars("play_row", array(
			 "U_QUIZ_LINK" => "<a href='" . append_sid("quiz.$phpEx?mode=play&" . POST_QUIZ_URL . "=" . $quiz_id . "") . "'>$quiz_name</a>",
			 "U_AUTHOR" => $quiz_author,
			 "U_TYPE" => $ultimate_quiz_type,
			 "U_PLAYS" => $quiz_plays));
			 
		}
		
	$template->assign_vars( array(
	"U_QUIZZES" => switch_to_category_name($category_id),
	"U_SUBMIT_QUIZ" => "<a href='" . append_sid("quiz.$phpEx?mode=add") . "'>" . $lang['Submit_quiz'] . "</a>",
	"U_STATISTICS_LINK" => "<a href='" . append_sid("quiz_stats.$phpEx") . "'>" . $lang['Quiz_stats'] . "</a>",
	
	"F_FORM" => append_sid("quiz.$phpEx?" . POST_CAT_URL . "=$category_id"),
	
	"L_SUBMIT" => $lang['Submit'],
	"L_VIEW_ALPHABETICAL" => $lang['Quiz_view_alphabetical'],
	"L_VIEW_TYPE" => $lang['Quiz_view_type'],
	"L_VIEW_AUTHOR" => $lang['Quiz_view_author'],
	"L_VIEW_CHRONILOGICAL" => $lang['Quiz_view_chronilogical']));
		
	$template->pparse("quiz_cat");
	include($phpbb_root_path . "includes/page_tail.$phpEx");
	}
		
	if( $mode == 'play' || isset($HTTP_GET_VARS[POST_QUIZ_URL]) )
	{
	quiz_permissions();
	
	// September 10, 2005. Newest addition. In all probability not much will be done on this tonight. I made a function though :)
	// Actually, I might CVS it.
	$quiz_id = intval($HTTP_GET_VARS[POST_QUIZ_URL]); // Intval it now. Saves doing it every time it is called up for selection (cricket-ism).
	$quiz_type = quiz_type($quiz_id);
	
	// Let's check the stats, if the admin wants users to be able to play each quiz, once only.
	if( quiz_check_moderative_status($userdata['user_id'], $quiz_id) != ON && $userdata['user_level'] != ADMIN )
	{
		if( $board_config['Quiz_Play_Once'] == ON )
		{
			$statistics_check = "SELECT * FROM " . QUIZ_STATISTICS_TABLE . " WHERE quiz_id = $quiz_id AND user_id = " . $userdata['user_id'];
		
			if( !$statistics_check_result = $db->sql_query($statistics_check) )
			{
				message_die(GENERAL_ERROR, 'Could not get statistics data to check Quiz_Play_Once setting', '', __LINE__, __FILE__, $statistics_check);
			}
			
			if( $db->sql_numrows($statistics_check_result) == 1 || $db->sql_numrows($statistics_check_result) > 1 )
			{
				message_die(GENERAL_MESSAGE, $lang['Quiz_only_play_it_once']);
			}
		}
	}
	
	// Basically, there will be three sections (no prizes for guessing). This is the first. Hopefully they are not too large.
	$sql = "SELECT * FROM " . QUIZ_GENERAL_TABLE . " WHERE quiz_id = " . $quiz_id;
		
		if(!$result = $db->sql_query($sql))
		{
			message_die(GENERAL_ERROR, '', 'Could not obtain basic quiz data', __LINE__, __FILE__);
		}
			
	$general_quiz_data = $db->sql_fetchrow($result);
		
	// Author information
	$quiz_author_id = $general_quiz_data['quiz_author'];
	$quiz_author_name = convert_id($general_quiz_data['quiz_author']);
	$quiz_author_link = "<a href='" . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$quiz_author_id") . "'>$quiz_author_name</a>";
		
	// Miscellaneous
	$quiz_name = str_replace("\'", "''", $general_quiz_data['quiz_name']);
	$quiz_category = intval($general_quiz_data['quiz_category']);
	$quiz_enabled = $general_quiz_data['quiz_enabled'];
	
	$password_sql = "SELECT * FROM " . QUIZ_CATEGORY_TABLE . " WHERE category_id = $quiz_category";
		
		if(!$password_result = $db->sql_query($password_sql))
		{
			message_die(GENERAL_ERROR, '', 'Could not obtain category password', __LINE__, __FILE__, $password_sql);
		}
		
		$password_row = $db->sql_fetchrow($password_result);
		
		if( !$userdata['session_logged_in'] )
		{
			if( $password_row['category_permissions'] == ON || $password_row['category_permissions'] == OFF )
			{
				message_die(GENERAL_ERROR, $lang['Quiz_registered_category_permissions_no_access']);
			}		
		}
		
		if( quiz_check_category_password($quiz_category) != 1 && $password_row['category_password'] !== 'd41d8cd98f00b204e9800998ecf8427e' )
		{
		include($phpbb_root_path . "includes/page_header.$phpEx");
		$template->set_filenames(array("quiz_pw" => 'quiz_category_password_body.tpl'));
		
			$template->assign_vars( array(
			"F_FORM" => append_sid("quiz.$phpEx?mode=play&" . POST_QUIZ_URL . "=$quiz_id"),
			
			"L_SUBMIT" => $lang['Submit'],
			"L_ENTER_PASSWORD" => $lang['Quiz_password_protect_information'],
			"L_PASSWORD" => $lang['Quiz_password_protect']));
			
		$template->pparse("quiz_pw");
		include($phpbb_root_path . "includes/page_tail.$phpEx");
		}

		if($board_config['Quiz_Author_Play'] == OFF && $quiz_author_id == $userdata['user_id'])
		{
			if( quiz_check_moderative_status($userdata['user_id'], $quiz_id) == ON )
			{
			message_die(GENERAL_MESSAGE, $lang['Quiz_author_cannot_play'] . '<br />' . sprintf($lang['Quiz_author_cannot_play_give_edit_options'], '<a href="' . append_sid("quiz_cp.$phpEx?mode=edit&q=$quiz_id") . '">', '</a>', '<a href="' . append_sid("quiz_cp.$phpEx?mode=delete&q=$quiz_id") . '">', '</a>', '<a href="' . append_sid("quiz_cp.$phpEx?mode=move&q=$quiz_id") . '">', '</a>'));
			}
			
			else
			{
			message_die(GENERAL_MESSAGE, $lang['Quiz_author_cannot_play']);
			}
		}
	
		if($quiz_type == MULTIPLE_CHOICE)
		{
		$page_title = $quiz_name;
		include($phpbb_root_path . "includes/page_header.$phpEx");
		$template->set_filenames(array("play_multiple_choice" => 'quiz_play_multiple_choice_body.tpl'));	
		
			if( quiz_check_moderative_status($userdata['user_id'], $quiz_id) == ON )
			{
				$mod_langs = '<br />' . $lang['Quiz_cp_play_quiz_mod'] . '<br />' . sprintf( $lang['Quiz_cp_play_quiz_mod_do'], '<a href="' . append_sid("quiz_cp.$phpEx?mode=edit&" . POST_QUIZ_URL . "=$quiz_id") . '">', '</a>', '<a href="' . append_sid("quiz_cp.$phpEx?mode=delete&" . POST_QUIZ_URL . "=$quiz_id") . '">', '</a>', '<a href="' . append_sid("quiz_cp.$phpEx?mode=move&" . POST_QUIZ_URL . "=$quiz_id") . '">', '</a>');
			}
			
			else
			{
				$mod_langs = '';
			}

		$select_quiz_data = "SELECT * FROM " . QUIZ_MULTIPLE_CHOICE_TABLE . " WHERE quiz_id = $quiz_id";

			if(!$result_quiz_data = $db->sql_query($select_quiz_data))
			{
				message_die(GENERAL_ERROR, '', 'Could not obtain advanced quiz data', __LINE__, __FILE__);
			}
			
				while($quiz_data = $db->sql_fetchrow($result_quiz_data))
				{
				$quiz_question = smilies_pass(bbencode_second_pass($quiz_data['quiz_question'], ''));
				$quiz_question_id = $quiz_data['question_id'];
				
				$quiz_multiple_choice = array();
				$quiz_multiple_choice = explode("!*-.@.-*!", $quiz_data['quiz_alternates']);
				
				$template->assign_vars( array(
				 "U_QUIZ_NAME" => $quiz_name,
				 "U_STATISTICS" => "<a href='" . append_sid("quiz_stats.$phpEx?" . POST_QUIZ_URL . "=$quiz_id") . "'>" . $lang['Quiz_stats'] . "</a>",
				 
				 "F_FORM" => append_sid("quiz.$phpEx?mode=results"),
				 "F_ID" => $quiz_id,
				 "F_TYPE" => $quiz_type,
				 "F_TIME" => time(),
				
				 "L_MOD_LANGS" => $mod_langs,
				 "L_MULTIPLE_INFORMATION" => $lang['Quiz_multiple_information'], 
				 "L_SUBMIT" => $lang['Submit_quiz']));
				
				 $template->assign_block_vars("quiz_row", array(
				 "U_QUESTION_ID" => $quiz_question_id,
				 "U_QUESTION" => $quiz_question,
				 
				 "Q_ALTERNATE_ONE" => $quiz_multiple_choice[0],
				 "Q_ALTERNATE_TWO" => $quiz_multiple_choice[1],
				 "Q_ALTERNATE_THREE" => $quiz_multiple_choice[2],
				 "Q_ALTERNATE_FOUR" => $quiz_multiple_choice[3]));			
				}
				
		$template->pparse("play_multiple_choice");
		include($phpbb_root_path . "includes/page_tail.$phpEx");
		}
	
		if($quiz_type == INPUT_ANSWER)
		{
		$page_title = $quiz_name;
		include($phpbb_root_path . "includes/page_header.$phpEx");
		$template->set_filenames(array("play_input_answer" => 'quiz_play_input_answer_body.tpl'));	

			if( quiz_check_moderative_status($userdata['user_id'], $quiz_id) == ON )
			{
			$mod_langs = '<br />' . $lang['Quiz_cp_play_quiz_mod'] . '<br />' . sprintf( $lang['Quiz_cp_play_quiz_mod_do'], '<a href="' . append_sid("quiz_cp.$phpEx?mode=edit&" . POST_QUIZ_URL . "=$quiz_id") . '">', '</a>', '<a href="' . append_sid("quiz_cp.$phpEx?mode=delete&" . POST_QUIZ_URL . "=$quiz_id") . '">', '</a>', '<a href="' . append_sid("quiz_cp.$phpEx?mode=move&" . POST_QUIZ_URL . "=$quiz_id") . '">', '</a>');
			}
			
			else
			{
				$mod_langs = '';
			}		
		
		$select_quiz_data = "SELECT * FROM " . QUIZ_INPUT_TABLE . " WHERE quiz_id = $quiz_id";

			if(!$result_quiz_data = $db->sql_query($select_quiz_data))
			{
				message_die(GENERAL_ERROR, '', 'Could not obtain advanced quiz data', __LINE__, __FILE__);
			}
			
				while($quiz_data = $db->sql_fetchrow($result_quiz_data))
				{
				$quiz_question = smilies_pass(bbencode_second_pass($quiz_data['quiz_question'], ''));
				$quiz_question_id = $quiz_data['question_id'];
				
				// I've decided not to encode the answer, it is easier to compare it to an id, such as the game_id / quiz_id partnership in 1.0.6
		
				$template->assign_vars( array(
				 "U_QUIZ_NAME" => $quiz_name,
				 "U_STATISTICS" => "<a href='" . append_sid("quiz_stats.$phpEx?" . POST_QUIZ_URL . "=$quiz_id") . "'>" . $lang['Quiz_stats'] . "</a>",
				 
				 "F_FORM" => append_sid("quiz.$phpEx?mode=results"),
				 "F_ID" => $quiz_id,
				 "F_TYPE" => $quiz_type,
				 "F_TIME" => time(),
	
				 "L_MOD_LANGS" => $mod_langs,	
				 "L_INPUT_INFORMATION" => $lang['Quiz_input_information'], 
				 "L_SUBMIT" => $lang['Submit_quiz']));
				
				 $template->assign_block_vars("quiz_row", array(
				 "U_QUESTION_ID" => $quiz_question_id,
				 "U_QUESTION" => $quiz_question));
				 
				}
			
		$template->pparse("play_input_answer");
		include($phpbb_root_path . "includes/page_tail.$phpEx");
		}
	
		if($quiz_type == TRUE_FALSE)
		{
		$page_title = $quiz_name;
		include($phpbb_root_path . "includes/page_header.$phpEx");
		$template->set_filenames(array("play_true_false" => 'quiz_play_true_false_body.tpl'));
		
			if( quiz_check_moderative_status($userdata['user_id'], $quiz_id) == ON )
			{
				$mod_langs = '<br />' . $lang['Quiz_cp_play_quiz_mod'] . '<br />' . sprintf( $lang['Quiz_cp_play_quiz_mod_do'], '<a href="' . append_sid("quiz_cp.$phpEx?mode=edit&" . POST_QUIZ_URL . "=$quiz_id") . '">', '</a>', '<a href="' . append_sid("quiz_cp.$phpEx?mode=delete&" . POST_QUIZ_URL . "=$quiz_id") . '">', '</a>', '<a href="' . append_sid("quiz_cp.$phpEx?mode=move&" . POST_QUIZ_URL . "=$quiz_id") . '">', '</a>');
			}
			
			else
			{
				$mod_langs = '';
			}
		
		$select_quiz_data = "SELECT * FROM " . QUIZ_TRUE_FALSE_TABLE . " WHERE quiz_id = $quiz_id";

			if(!$result_quiz_data = $db->sql_query($select_quiz_data))
			{
				message_die(GENERAL_ERROR, '', 'Could not obtain advanced quiz data', __LINE__, __FILE__);
			}
			
				while($quiz_data = $db->sql_fetchrow($result_quiz_data))
				{
				$quiz_question = smilies_pass(bbencode_second_pass($quiz_data['quiz_question'], ''));
				$quiz_question_id = $quiz_data['question_id'];
				$quiz_answer = $quiz_data['quiz_answer']; 
				
				 $template->assign_vars( array(
				 "U_QUIZ_NAME" => $quiz_name,		
				 "U_STATISTICS" => "<a href='" . append_sid("quiz_stats.$phpEx?" . POST_QUIZ_URL . "=$quiz_id") . "'>" . $lang['Quiz_stats'] . "</a>",
				 
				 "F_FORM" => append_sid("quiz.$phpEx?mode=results"),
				 "F_ID" => $quiz_id,
				 "F_TYPE" => $quiz_type,
				 "F_TIME" => time(),
	
				 "L_MOD_LANGS" => $mod_langs,	
				 "L_TRUE_FALSE_INFORMATION" => $lang['Quiz_true_false_information'], 
				 "L_TRUE" => $lang['Quiz_answer_true'], 
				 "L_FALSE" => $lang['Quiz_answer_false'],
				 "L_SUBMIT" => $lang['Submit_quiz']));
				
				 $template->assign_block_vars("quiz_row", array(
				 "U_QUESTION_ID" => $quiz_question_id,
				 "U_QUESTION" => $quiz_question,
				 "U_ANSWER" => md5($quiz_answer)));
				 
				}
			
		$template->pparse("play_true_false");
		include($phpbb_root_path . "includes/page_tail.$phpEx");
		}
	}
		
	if($mode == 'add')
	{
	quiz_permissions();
	$quiz_questions_explode = explode(',', $board_config['Quiz_Min_Max_Questions']);
	
	if( $board_config['Quiz_Mod_Submit'] == ON && quiz_check_moderative_status($userdata['user_id'], '') != ON )
	{
		message_die(GENERAL_MESSAGE, $lang['Quiz_only_mod_can_submit']);
	}
	
		if(!$HTTP_POST_VARS['Questions_number'] && isset($quiz_type))
		{
			message_die(GENERAL_MESSAGE, $lang['Quiz_no_number_chosen']);
		}
		
		if(!isset($HTTP_POST_VARS['type']))
		{
		$page_title = $lang['Submit_quiz'];
		include($phpbb_root_path . "includes/page_header.$phpEx");
		$template->set_filenames(array("add_initial" => 'quiz_add_initial_body.tpl'));
		
			if( $quiz_questions_explode[0] == $quiz_questions_explode[1] )
			{
			$quiz_min_max_questions_set = sprintf($lang['Quiz_min_max_set'], $quiz_questions_explode[0]);
			$quiz_default_number = '&nbsp;<b>' . intval($quiz_questions_explode[0]) . '</b><input type="hidden" name="Questions_number" value="' . intval($quiz_questions_explode[0]) . '" />';
			}
		
			else
			{
			$quiz_min_max_questions_set = sprintf($lang['Quiz_min_max'], $quiz_questions_explode[0], $quiz_questions_explode[1]);
			$quiz_default_number = '&nbsp;<input type="text" class="post" name="Questions_number" size="5" maxlength="4" value="" />';
			}
			
		$template->assign_vars(array( 
			"U_DEFAULT" => $quiz_default_number,
		
			"F_FORM" => append_sid("quiz.$phpEx?mode=add"),
		
			"L_MIN_MAX" => $quiz_min_max_questions_set,
			"L_SETUP_OPTIONS" => $lang['Quiz_set_up_options'],
			"L_SELECT_NUMBER" => $lang['Quiz_select_number'],
			"L_TRUE_FALSE" => $lang['Submit_true_false_quiz'],
			"L_MULTIPLE_CHOICE" => $lang['Submit_multiple_choice_quiz'],
			"L_INPUT" => $lang['Submit_input_quiz'],
			"L_SUBMIT" => $lang['Submit_quiz']));
			
		$template->pparse("add_initial");
		include($phpbb_root_path . "includes/page_tail.$phpEx");
		}
	
		if($quiz_type == 'multiple_choice')
		{
		$page_title = $lang['Submit_multiple_choice_quiz'];
		include($phpbb_root_path . "includes/page_header.$phpEx");
		
		quiz_check_question_limitations();
		
		$template->set_filenames(array("multiple_choice" => "quiz_add_multiple_choice_body.tpl"));
	
			for ( $i = 0; $i < intval($HTTP_POST_VARS['Questions_number']); $i++ )
			{
			$template->assign_block_vars('question_number', array(
			 'U_UNIQUE' => $i));
			}
			
			// To make the box..
			$category_drop_down_box = '<select name="category">';
			$category_sql = "SELECT * FROM " . QUIZ_CATEGORY_TABLE . " ORDER BY category_id ASC";
			
			if(!$category_result = $db->sql_query($category_sql))
			{
			message_die(GENERAL_ERROR, '', 'Could not fetch category names!');
			}
			
			while($category_row = $db->sql_fetchrow($category_result))
			{
			$category_drop_down_box .= populate_quiz_drop_down_box($category_row['category_id'], $category_row['category_name']);
			}
			
			$category_drop_down_box .= '</select>';
		
		$template->assign_vars(array( 
			"F_FORM" => append_sid("quiz.$phpEx?mode=sql"),
			
			"U_TOTAL" => intval($HTTP_POST_VARS['Questions_number']),
			"U_CATEGORY" => $category_drop_down_box,
		
			"L_INSERT_NAME" => $lang['Quiz_insert_name'],
			"L_QUESTION" => $lang['Quiz_question'],
			"L_ALTERNATE_ANSWER" => $lang['Quiz_alternate'],
			"L_SUBMIT" => $lang['Submit_quiz']));
		
		$template->pparse("multiple_choice");
		include($phpbb_root_path . "includes/page_tail.$phpEx");
		}
	
		if($quiz_type == 'input_answer')
		{
		$page_title = $lang['Submit_input_quiz'];
		include($phpbb_root_path . "includes/page_header.$phpEx");
		
		$template->set_filenames(array("input" => "quiz_add_input_body.tpl"));
		
		quiz_check_question_limitations();
	
			for ( $i = 0; $i < intval($HTTP_POST_VARS['Questions_number']); $i++ )
			{
				 $template->assign_block_vars('question_number', array(
				 'U_UNIQUE' => $i));
			}
			
			// To make the box..
			$category_drop_down_box = '<select name="category">';
			$category_sql = "SELECT * FROM " . QUIZ_CATEGORY_TABLE . " ORDER BY category_id ASC";
			
			if(!$category_result = $db->sql_query($category_sql))
			{
				message_die(GENERAL_ERROR, '', 'Could not fetch category names!');
			}
			
			while($category_row = $db->sql_fetchrow($category_result))
			{
				$category_drop_down_box .= populate_quiz_drop_down_box($category_row['category_id'], $category_row['category_name']);
			}
			
			$category_drop_down_box .= '</select>';
		
		$template->assign_vars(array( 
			"F_FORM" => append_sid("quiz.$phpEx?mode=sql"),
			
			"U_TOTAL" => intval($HTTP_POST_VARS['Questions_number']),
			"U_CATEGORY" => $category_drop_down_box,
		
			"L_INSERT_NAME" => $lang['Quiz_insert_name'],
			"L_CORRECT_ANSWER" => $lang['Quiz_answer_correct'],
			"L_QUESTION" => $lang['Quiz_question'],
			"L_SUBMIT" => $lang['Submit_quiz']));
		
		$template->pparse("input");
		include($phpbb_root_path . "includes/page_tail.$phpEx");
		}
		
		if($quiz_type == 'true_false')
		{
		$page_title = $lang['Submit_true_false_quiz'];
		include($phpbb_root_path . "includes/page_header.$phpEx");
		
		$template->set_filenames(array("true_false" => "quiz_add_true_false_body.tpl"));
	
		quiz_check_question_limitations();
	
			for ( $i = 0; $i < intval($HTTP_POST_VARS['Questions_number']); $i++ )
			{
				 $template->assign_block_vars('question_number', array(
				 'U_UNIQUE' => $i));
			}
		
			// To make the box..
			$category_drop_down_box = '<select name="category">';
			$category_sql = "SELECT * FROM " . QUIZ_CATEGORY_TABLE . " ORDER BY category_id ASC";
			
			if(!$category_result = $db->sql_query($category_sql))
			{
				message_die(GENERAL_ERROR, '', 'Could not fetch category names!');
			}
			
			while($category_row = $db->sql_fetchrow($category_result))
			{
				$category_drop_down_box .= populate_quiz_drop_down_box($category_row['category_id'], $category_row['category_name']);
			}
			
			$category_drop_down_box .= '</select>';		
		
			$template->assign_vars(array( 
				"F_FORM" => append_sid("quiz.$phpEx?mode=sql"),
			
				"U_TOTAL" => intval($HTTP_POST_VARS['Questions_number']),
				"U_CATEGORY" => $category_drop_down_box,
			
				"L_INSERT_NAME" => $lang['Quiz_insert_name'],
				"L_TRUE" => $lang['Quiz_answer_true'],
				"L_FALSE" => $lang['Quiz_answer_false'],
				"L_QUESTION" => $lang['Quiz_question'],
				"L_SUBMIT" => $lang['Submit_quiz']));
		
		$template->pparse("true_false");
		include($phpbb_root_path . "includes/page_tail.$phpEx");
		}
	}
	
	if($mode == "sql")
	{
	// Similar to that of v1.0.x but not the same
	// This is better :-)

		if($HTTP_POST_VARS['Quiz_Type'] == "Input" || $HTTP_POST_VARS['Quiz_Type'] == "True_False")
		{
			if($HTTP_POST_VARS['Quiz_Type'] == "Input")
			{
				$table_name = QUIZ_INPUT_TABLE; // x_quiz_input_data
			}
			
			else
			{
				$table_name = QUIZ_TRUE_FALSE_TABLE; // x_quiz_true_false_data
			}

			for ( $i = 0; $i < intval($HTTP_POST_VARS['Quiz_Question']); $i++ )
			{	
				$question_sql = "INSERT INTO " . $table_name . " (quiz_id, question_id, quiz_question, quiz_answer) 	
				VALUES ( " . next_quiz_id() . ", " . ($i + 1) . ", '" . str_replace("\'", "''", bbencode_first_pass(htmlspecialchars($HTTP_POST_VARS["Question_$i"]), '')) . "', 
				'" . str_replace("\'", "''", bbencode_first_pass(htmlspecialchars($HTTP_POST_VARS["Correct_Answer_$i"]), '')) . "')";
					
				if( !$question_result = $db->sql_query($question_sql))
				{
					message_die(GENERAL_ERROR, 'Could not insert question / answer data', '', __LINE__, __FILE__, $question_sql);
				}
			}
		}
		
		if($HTTP_POST_VARS['Quiz_Type'] == "Multiple")
		{
			for ( $i = 0; $i < intval($HTTP_POST_VARS['Quiz_Question']); $i++ )
			{	
				// The answer isn't going to be Alternate_x_x now is it :roll:
				// Well not often anyway ;-)
				// Update: A few months later, I don't even know what the hell I was talking about. Better read the code to find out what exactly this section does eh?
				
				$answer = array();
				
				if($HTTP_POST_VARS["Correct_Answer_$i"] == "Alternate1_$i")
				{
					$answer[$i] = bbencode_first_pass(str_replace("\'", "''", $HTTP_POST_VARS["Alternate1_$i"]), '');
				}
				
				else if($HTTP_POST_VARS["Correct_Answer_$i"] == "Alternate2_$i")
				{
					$answer[$i] = bbencode_first_pass(str_replace("\'", "''", $HTTP_POST_VARS["Alternate2_$i"]), '');
				}
				
				else if($HTTP_POST_VARS["Correct_Answer_$i"] == "Alternate3_$i")
				{
					$answer[$i] = bbencode_first_pass(str_replace("\'", "''", $HTTP_POST_VARS["Alternate3_$i"]), '');
				}
				
				else if($HTTP_POST_VARS["Correct_Answer_$i"] == "Alternate4_$i")
				{
					$answer[$i] = bbencode_first_pass(str_replace("\'", "''", $HTTP_POST_VARS["Alternate4_$i"]), '');
				}
				
				// As much as I hate the following few lines, because it is awfully messy, I must say, it works beautifully
				// Basically this is the most effective way of doing it. You can use the | but that means that anyone that uses that screws up the quiz.
				// Sure the same thing can happen with !*-.@.-*! but what are the odds?
				
				$question_sql = "INSERT INTO " . QUIZ_MULTIPLE_CHOICE_TABLE . " 
				(quiz_id, question_id, quiz_question, quiz_alternates, quiz_answer) 	
				VALUES ( " . next_quiz_id() . ", " . ($i + 1) . ", '" . str_replace("\'", "''", bbencode_first_pass(htmlspecialchars($HTTP_POST_VARS["Question_$i"]), '')) . "',
				'" . str_replace("\'", "''", htmlspecialchars($HTTP_POST_VARS["Alternate1_$i"])) . "!*-.@.-*!" . str_replace("\'", "''", htmlspecialchars($HTTP_POST_VARS["Alternate2_$i"])) . "!*-.@.-*!" . str_replace("\'", "''", htmlspecialchars($HTTP_POST_VARS["Alternate3_$i"])) . "!*-.@.-*!" . str_replace("\'", "''", htmlspecialchars($HTTP_POST_VARS["Alternate4_$i"])) . "', 
				'" . htmlspecialchars($answer[$i]) . "')";
					
				if( !$question_result = $db->sql_query($question_sql))
				{
					message_die(GENERAL_ERROR, 'Could not insert question / answer data', '', __LINE__, __FILE__, $question_sql);
				}
			}			
		}
		
				if($HTTP_POST_VARS['Quiz_Type'] == "True_False")
				{
					$ultimate_quiz_type = TRUE_FALSE;
				}
				
				else if($HTTP_POST_VARS['Quiz_Type'] == "Multiple")
				{
					$ultimate_quiz_type = MULTIPLE_CHOICE;
				}

				else if($HTTP_POST_VARS['Quiz_Type'] == "Input")
				{
					$ultimate_quiz_type = INPUT_ANSWER;
				}
				
	$sql =  "INSERT INTO " . QUIZ_GENERAL_TABLE . " (quiz_id, quiz_name, quiz_author, quiz_category, quiz_type) VALUES (
			  " . next_quiz_id() . ",
			  '" . str_replace("\'", "''", htmlspecialchars($HTTP_POST_VARS['Quiz_Name'])) . "',
			  '" . $userdata['user_id'] . "', 
			  '" . intval($HTTP_POST_VARS['category']) . "',
			  '" . $ultimate_quiz_type . "')";

			if( !$result = $db->sql_query($sql))
			{
				message_die(GENERAL_ERROR, 'Could not insert basic quiz details', '', __LINE__, __FILE__, $sql);
			}
			
			else
			{
				message_die(GENERAL_MESSAGE, $lang['Quiz_added_successfully']);
			}
	}
	
	if($mode == "results")
	{
	$page_title = $lang['Quiz_score'];
	include($phpbb_root_path . "includes/page_header.$phpEx");
	
	$template->set_filenames(array("quiz_result" => 'quiz_result_body.tpl'));
	
	$type = htmlspecialchars($HTTP_POST_VARS['type']);
	$id = intval($HTTP_POST_VARS['id']);
	
	if( quiz_check_moderative_status($userdata['user_id'], $id) != ON && $userdata['user_level'] != ADMIN )
	{
		if( $board_config['Quiz_Play_Once'] == ON )
		{
			$statistics_check = "SELECT * FROM " . QUIZ_STATISTICS_TABLE . " WHERE quiz_id = '$id' AND user_id = '" . $userdata['user_id'] . "'";
		
			if( !$statistics_check_result = $db->sql_query($statistics_check) )
			{
				message_die(GENERAL_ERROR, 'Could not get statistics data to check Quiz_Play_Once setting', '', __LINE__, __FILE__, $statistics_check);
			}
			
			if( $db->sql_numrows($statistics_check_result) == 1 || $db->sql_numrows($statistics_check_result) > 1 )
			{
				message_die(GENERAL_MESSAGE, $lang['Quiz_only_play_it_once']);
			}
		}
	}
	
		if($type == "input_answer")
		{
			$table = QUIZ_INPUT_TABLE;
		}
	
		else if($type == "true_false")
		{
			$table = QUIZ_TRUE_FALSE_TABLE;
		}
		
		else if($type == "multiple_choice")
		{
			$table = QUIZ_MULTIPLE_CHOICE_TABLE;
		}		
		
	$number_of_questions = number_of_questions($id, $table);
	
	$time_taken_to_complete_quiz = time() - intval($HTTP_POST_VARS['f_time']);
	$seconds_taken_to_complete_quiz = $time_taken_to_complete_quiz % 60;
	$minutes_taken_to_complete_quiz = ($time_taken_to_complete_quiz - $seconds_taken_to_complete_quiz) / 60;	
	
	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']);
		}
	}
	
		for ( $i = 0; $i < $number_of_questions; $i++ )
		{	
			$sql = "SELECT quiz_question FROM " . $table . " WHERE question_id = " . ($i + 1) . " AND quiz_id = " . $id;
			
			if(!$result = $db->sql_query($sql))
			{
				message_die(GENERAL_ERROR, '', 'Could not get question', __LINE__, __FILE__);
			}

			$row = $db->sql_fetchrow($result);
		
		// Fixed in 1.3.0: All errors with " and inverted commas. I think htmlspecialchars is to blame for this.
		$question = smilies_pass(bbencode_second_pass($row['quiz_question'], ''));
		$user_answer = str_replace("\'", "'", str_replace('\"', '"', $HTTP_POST_VARS['uqm' . ($i + 1)])); // Changed in 1.3.1. Added letters uqm to overcome PHP bug. Thanks to Xore (MOD Team Member) for pointing this out.
		$actual_answer = str_replace('&quot;', '"', htmlspecialchars(quiz_answer(($i + 1), $id, $table)));
		
			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);
			}
			
			else if(strtolower($user_answer) != strtolower($actual_answer))
			{
				$correct[$i] = 0;
				$incorrect[$i] = 1;
				$status = sprintf($lang['Quiz_answer_status'], $user_answer, $actual_answer);
			}
			
			if($board_config['Quiz_show_answers'] == ON)
			{
				$template->assign_block_vars("answer_row", array(
				"U_STATUS" => $status,
				"U_QUESTION" => $question));
			}
		}
		
		// Get percentage
		if ( @array_sum($correct) != 0 && @array_sum($incorrect) != 0 )
		{			
			if( @array_sum($incorrect) == @array_sum($correct) )
			{
				$percentage = '50';
			}
			
			else
			{
				$percentage = ( @array_sum($correct) / ( @array_sum($correct) + @array_sum($incorrect) ) ) * 100;
			}
		}
		
		else
		{
			if( @array_sum($incorrect) == '0' )
			{
				$percentage = '100';
			}
			
			else if( @array_sum($correct) == '0' )
			{
				$percentage = '0';
			}
		}
		
		$update_play = "UPDATE " . QUIZ_GENERAL_TABLE . " SET quiz_plays = quiz_plays + 1 WHERE quiz_id = $id";
		
		if( !$db->sql_query($update_play) )
		{
			message_die(GENERAL_ERROR, 'Could not update play counter', '', __LINE__, __FILE__, $update_play);
		}
		
		$percentage = number_format($percentage, 0);
	
		$template->assign_vars(array( 
		"U_CORRECT_SCORE" => sprintf($lang['Quiz_show_correct_score'], @array_sum($correct)),
		"U_INCORRECT_SCORE" => sprintf($lang['Quiz_show_incorrect_score'], @array_sum($incorrect)),
		"U_PERCENTAGE" => $percentage . '%',
		
		"L_TIME_TAKEN" => sprintf($lang['Quiz_user_time_taken_quiz'], $minutes_taken_to_complete_quiz, $seconds_taken_to_complete_quiz),
		"L_RETURN_INDEX" => sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>'),
		"L_RETURN_QUIZ" => sprintf($lang['Quiz_click_return_quiz'], '<a href="' . append_sid("quiz.$phpEx") . '">', '</a>'),
		"L_ANSWERS" => $lang['Quiz_score']));
			
			$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'] . "', '" . @array_sum($correct) . "', '" . @array_sum($incorrect) . "', '$percentage')";
			
			if(!$db->sql_query($statistics_sql))
			{
				message_die(GENERAL_ERROR, '', 'Could not insert statistical values', __LINE__, __FILE__, $statistics_sql);
			}
			
			// Let's do the cash
			if( $board_config['Quiz_CashMOD_On'] == ON )
			{
			include($phpbb_root_path . 'includes/functions_cash.'.$phpEx);
			
				// Lets get the currency.. err... name?
				$get_cash_name = "SELECT cash_name FROM " . CASH_TABLE . " WHERE cash_dbfield = '" . $board_config['Quiz_Cash_Currency'] . "'";
				
					if( !$get_cash_result = $db->sql_query($get_cash_name) )
					{
						message_die(GENERAL_ERROR, 'Unable to execute cash name query', '', __LINE__, __FILE__, $get_cash_name);
					}
			
			$actual_cash_name = $db->sql_fetchrow($get_cash_result);
			
			$cash_per_correct = $board_config['Quiz_Cash_Correct'];
			$cash_per_incorrect = $board_config['Quiz_Cash_Incorrect'];
			$cash_tax = $board_config['Quiz_Cash_Tax'];
			
			$total_cash = ( ( @array_sum($correct) * $cash_per_correct ) - ( @array_sum($incorrect) * $cash_per_incorrect ) - ( $cash_tax ) );
			
			if( $total_cash > 0 || $total_cash == 0 )
			{
			$cash_language_variable = sprintf($lang['Quiz_cash_total_result_gain'], $total_cash, $actual_cash_name['cash_name']);
			
				$cash_sql = "UPDATE " . USERS_TABLE . " SET " . $board_config['Quiz_Cash_Currency'] . " = " . $board_config['Quiz_Cash_Currency'] . " + " . intval($total_cash) . " WHERE user_id = " . $userdata['user_id'];
			}
			
			else if( $total_cash < 0 )
			{
			$total_cash = str_replace('-', '', $total_cash);
			$cash_language_variable = sprintf($lang['Quiz_cash_total_result_loss'], $total_cash, $actual_cash_name['cash_name']);
			
				$cash_sql = "UPDATE " . USERS_TABLE . " SET " . $board_config['Quiz_Cash_Currency'] . " = " . $board_config['Quiz_Cash_Currency'] . " - " . intval($total_cash) . " WHERE user_id = " . $userdata['user_id'];
			}
			
				if( !$db->sql_query($cash_sql) )
				{
					message_die(GENERAL_ERROR, 'Unable to execute cash update', '', __LINE__, __FILE__, $cash_sql);
				}
			
			$template->assign_block_vars('cash_row', array());
			$template->assign_vars(array("U_CASH" => $cash_language_variable));
			}
			
		$template->pparse("quiz_result");
		include($phpbb_root_path . "includes/page_tail.$phpEx");
	}

	
	$page_title = $lang['Quiz_quizzes'];
	include($phpbb_root_path . "includes/page_header.$phpEx");
	$template->set_filenames(array("quiz_index" => "quiz_index_body.tpl"));
	
		if( !$userdata['session_logged_in'] )
		{
			$sql_suffix = "WHERE category_permissions = 0 OR category_permissions = 1";
		}
		
		else
		{
			$sql_suffix = '';
		}
	
	$sql = "SELECT * FROM " . QUIZ_CATEGORY_TABLE . " $sql_suffix";
		
	if(!$result = $db->sql_query($sql))
	{
		message_die(GENERAL_ERROR, '', 'Could not obtain quiz category data', __LINE__, __FILE__);
	}
	
	while($row = $db->sql_fetchrow($result))
	{
	$category_id = intval($row['category_id']);
	$category_name = str_replace("\'", "''", $row['category_name']);
	$category_description = str_replace("\'", "''", $row['category_description']);
	$category_quizzes = category_quizzes($category_id);
	
	$template->assign_block_vars("quiz_row", array(
	"U_NAME" => "<a href='" .  append_sid("quiz.$phpEx?" . POST_CAT_URL . "=$category_id") . "'>$category_name</a>",
	"U_DESCRIPTION" => $category_description,
	"U_QUIZZES" => $category_quizzes . ' ' . $lang['Quiz_quizzes']));
	}

	$template->assign_vars(array( 
	"U_SUBMIT_QUIZ" => "<a href='" . append_sid("quiz.$phpEx?mode=add") . "'>" . $lang['Submit_quiz'] . "</a>",
	"U_STATISTICS_LINK" => "<a href='" . append_sid("quiz_stats.$phpEx") . "'>" . $lang['Quiz_stats'] . "</a>",
	
	"L_QUIZZES" => ( $board_config['Quiz_timeout'] == 0 ) ? $lang['Quiz_quizzes'] : sprintf($lang['Quiz_user_time_on_index'], $board_config['Quiz_timeout']),
	"L_ANSWERS" => $lang['Quiz_score']));
	
	if( $board_config['Quiz_CashMOD_On'] == ON )
	{
	// Just noticed that there are 971 line so far, can we make 1000? Yep
	$template->assign_block_vars('cash_row', array());
	$quiz_cash_correct = intval($board_config['Quiz_Cash_Correct']);
	$quiz_cash_incorrect = intval($board_config['Quiz_Cash_Incorrect']);
	$quiz_cash_tax = intval($board_config['Quiz_Cash_Tax']);
	
	$template->assign_vars( array(
	"CASH_INFORMATION" => sprintf($lang['Quiz_cash_information'], $quiz_cash_correct, $quiz_cash_incorrect, $quiz_cash_tax)));
	// I'm now depressed, that was the first time this series I haven't labelled it L_, U_, or F_. Pfft
	}
	
	$template->pparse("quiz_index");
	include($phpbb_root_path . "includes/page_tail.$phpEx");
?>
i can't find the file that you were asking under templates/admin directory, please refer to the image below.

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

quiz_settings_body is the one. Sorry, I really haven't looked at UQM 1.3.3 for quite a while, I can't remember the files offhand like I used to.

Also, use

Code: Select all

 instead of [quote] as it doesn't stretch the page :)

[size=150]Edit: if you could post admin_quiz.php too that would be great. Thanks[/size]
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)
doswald
Frequent Poster
Frequent Poster
Posts: 32
Joined: Thu Jan 10, 2008 10:32 am

thanks mate, here's my

quiz_settings_body.tpl

Code: Select all

<form action="{F_FORM}" method="post">
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
	<tr>
		<td colspan="3" align="center" width="100%" class="catSides" nowrap="nowrap"> <span class="cattitle">{L_PERMISSIONS}</span> </td>
	</tr>
	
	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			<span class="genmed">{L_AUTHOR_MOD}</span>
		</td>
			
		<td width="15%" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				<input type="radio" name="Quiz_Author_Mod" {U_AUTHOR_MOD_ON} value="{U_ON}"> {L_YES}
			</span>
		</td>
		
		<td width="15%" class="row1" align="center" valign="middle" height="100%">
			<span class="genmed">
				<input type="radio" name="Quiz_Author_Mod" {U_AUTHOR_MOD_OFF} value="{U_OFF}"> {L_NO}
			</span>
		</td>
	</tr>
	
	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			<span class="genmed">{L_REGISTER_TO_PLAY}</span>
		</td>
			
		<td width="15%" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				<input type="radio" name="Quiz_Register_Play" {U_REGISTER_TO_PLAY_ON} value="{U_ON}"> {L_YES}
			</span>
		</td>
		
		<td width="15%" class="row1" align="center" valign="middle" height="100%">
			<span class="genmed">
				<input type="radio" name="Quiz_Register_Play" {U_REGISTER_TO_PLAY_OFF} value="{U_OFF}"> {L_NO}
			</span>
		</td>
	</tr>
	
	<!-- BEGIN register_row -->
	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			<span class="genmed">{L_POST_COUNT}</span>
		</td>
			
		<td width="15%" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				<input type="radio" name="Quiz_Post_Count_Play" {U_POST_COUNT_ON} value="{U_ON}"> {L_YES}
			</span>
		</td>
		
		<td width="15%" class="row1" align="center" valign="middle" height="100%">
			<span class="genmed">
				<input type="radio" name="Quiz_Post_Count_Play" {U_POST_COUNT_OFF} value="{U_OFF}"> {L_NO}
			</span>
		</td>
	</tr>

	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			<span class="genmed">{L_POST_REQUIREMENT}</span>
		</td>
				
		<td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				 <input type="text" name="Quiz_Post_Requirement" size="16" value="{U_MINIMUM_POST_REQUIRED}">
			</span>
		</td>
	</tr>
	<!-- END register_row -->		

	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			<span class="genmed">{L_MODERATORS}</span>
		</td>
				
		<td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				 <input type="text" name="Quiz_Moderators" size="16" value="{U_MODERATORS}">
			</span>
		</td>
	</tr>
	
	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			<span class="genmed">{L_BANNED}</span>
		</td>
				
		<td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				 <input type="text" name="Quiz_Banned" size="16" value="{U_BANNED}">
			</span>
		</td>
	</tr>
	
	<tr>
		<td colspan="3" align="center" width="100%" class="catSides" nowrap="nowrap"> <span class="cattitle">{L_STATS}</span> </td>
	</tr>
	
	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			<span class="genmed">{L_CLEAR_STATS}</span>
		</td>
				
		<td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				{U_CLEAR_STATS}
			</span>
		</td>
	</tr>

	<tr>
		<td colspan="3" align="center" width="100%" class="catSides" nowrap="nowrap"> <span class="cattitle">{L_CONFIGURATION}</span> </td>
	</tr>
	
	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			<span class="genmed">{L_SHOW_ANSWERS}</span>
		</td>
			
		<td width="15%" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				<input type="radio" name="Quiz_show_answers" {U_SHOW_ANSWERS_ON} value="{U_ON}"> {L_YES}
			</span>
		</td>
		
		<td width="15%" class="row1" align="center" valign="middle" height="100%">
			<span class="genmed">
				<input type="radio" name="Quiz_show_answers" {U_SHOW_ANSWERS_OFF} value="{U_OFF}"> {L_NO}
			</span>
		</td>
	</tr>

	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			<span class="genmed">{L_CASH_ON}</span>
		</td>
			
		<td width="15%" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				<input type="radio" name="Quiz_CashMOD_On" {U_CASH_ON} value="{U_ON}"> {L_YES}
			</span>
		</td>
		
		<td width="15%" class="row1" align="center" valign="middle" height="100%">
			<span class="genmed">
				<input type="radio" name="Quiz_CashMOD_On" {U_CASH_OFF} value="{U_OFF}"> {L_NO}
			</span>
		</td>
	</tr>	
	
	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			<span class="genmed">{L_MOD_SUBMIT}</span>
		</td>
			
		<td width="15%" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				<input type="radio" name="Quiz_Mod_Submit" {U_MOD_SUBMIT_ON} value="{U_ON}"> {L_YES}
			</span>
		</td>
		
		<td width="15%" class="row1" align="center" valign="middle" height="100%">
			<span class="genmed">
				<input type="radio" name="Quiz_Mod_Submit" {U_MOD_SUBMIT_OFF} value="{U_OFF}"> {L_NO}
			</span>
		</td>
	</tr>	
	
	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			<span class="genmed">{L_STATS_DISPLAY}</span>
		</td>
				
		<td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				 <input type="text" name="Quiz_Stats_Display" size="5" value="{U_QUIZ_STATS_DISPLAY}">
			</span>
		</td>
	</tr>
	
	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			<span class="genmed">{L_PLAY_ONCE}</span>
		</td>
			
		<td width="15%" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				<input type="radio" name="Quiz_Play_Once" {U_PLAY_ONCE_ON} value="{U_ON}"> {L_YES}
			</span>
		</td>
		
		<td width="15%" class="row1" align="center" valign="middle" height="100%">
			<span class="genmed">
				<input type="radio" name="Quiz_Play_Once" {U_PLAY_ONCE_OFF} value="{U_OFF}"> {L_NO}
			</span>
		</td>
	</tr>
	
	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			<span class="genmed">{L_AUTHOR_PLAY}</span>
		</td>
			
		<td width="15%" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				<input type="radio" name="Quiz_Author_Play" {U_AUTHOR_PLAY_ON} value="{U_ON}"> {L_YES}
			</span>
		</td>
		
		<td width="15%" class="row1" align="center" valign="middle" height="100%">
			<span class="genmed">
				<input type="radio" name="Quiz_Author_Play" {U_AUTHOR_PLAY_OFF} value="{U_OFF}"> {L_NO}
			</span>
		</td>
	</tr>

	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			<span class="genmed">{L_QUIZ_PACKS_BOT}</span>
		</td>
			
		<td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				<input type="text" name="Quiz_bot" size="16" value="{U_QUIZ_BOT}" />
			</span>
		</td>
	</tr>
	
	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			<span class="genmed">{L_SET_TIMELIMIT}</span>
		</td>
			
		<td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				<input type="text" name="Quiz_timeout" size="2" value="{U_SET_TIMELIMIT}" />
			</span>
		</td>
	</tr>
	
	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			<span class="genmed">{L_PACKS_DROPDOWN}</span>
		</td>
			
		<td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				{U_PACKS_DROPDOWN}
			</span>
		</td>
	</tr>
	
	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			<span class="genmed">{L_MIN_MAX_QUESTIONS}</span>
		</td>
				
		<td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				 <input type="text" name="Quiz_Min_Max_Questions" size="16" value="{U_MIN_MAX_QUESTIONS}">
			</span>
		</td>
	</tr>

	<!-- BEGIN cash_row -->		
	<tr>
		<td colspan="3" align="center" width="100%" class="catSides" nowrap="nowrap"> <span class="cattitle">{L_CASH_SETTINGS}</span> </td>
	</tr>

	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			<span class="genmed">{L_C_CURRENCY}</span>
		</td>
				
		<td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				 <input type="text" name="Quiz_admin_cash_currency" size="10" value="{U_C_CURRENCY}">
			</span>
		</td>
	</tr>
	
	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			<span class="genmed">{L_C_CORRECT}</span>
		</td>
				
		<td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				 <input type="text" name="Quiz_admin_cash_correct" size="5" value="{U_C_CORRECT}">
			</span>
		</td>
	</tr>
	
	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			<span class="genmed">{L_C_INCORRECT}</span>
		</td>
				
		<td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				 <input type="text" name="Quiz_admin_cash_incorrect" size="5" value="{U_C_INCORRECT}">
			</span>
		</td>
	</tr>
	
	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			<span class="genmed">{L_C_TAX}</span>
		</td>
				
		<td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				 <input type="text" name="Quiz_admin_cash_tax" size="5" value="{U_C_TAX}">
			</span>
		</td>
	</tr>
	<!-- END cash_row -->		

	<tr>
		<td colspan="3" align="center" width="100%" class="catSides" nowrap="nowrap"> <span class="cattitle">{L_CATEGORIES}</span> </td>
	</tr>
	
	<tr>
		<td width="100%" colspan="3" class="row1" align="center" valign="middle" height="100%">
			<span class="gen">{U_ADD_CATEGORY}</span>
		</td>
	</tr>
	
	<!-- BEGIN category_row -->		
	<tr>
		<td width="70%" class="row1" align="left" valign="middle" height="100%">
			 <span class="genmed"><b>{category_row.U_NAME}</b></span><br /><span class="genmed"> {category_row.U_DESCRIPTION}</span>
		</td>
			
		<td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
			<span class="genmed">
				{category_row.U_EDIT_CATEGORY}, {category_row.U_DELETE_CATEGORY}, {category_row.U_MOVE_CATEGORY}
			</span>
		</td>
	</tr>
	<!-- END category_row -->		
		
	<tr>
		<th colspan="3" width="100%" class="thTop" nowrap="nowrap">
			<input class="liteoption" type="submit" value="{L_SUBMIT}" />
		</th>
	</tr>
</table>
</form>

<table width="100%" border="0">
	<tr>
		<td border="0" align="left" width="100%"><span class="genmed">{Q_LATEST}</span></td>
	</tr>
</table> 
and my admin_quiz.php

Code: Select all

<?php 
/*************************************************************************** 
 *                               admin_quiz.php 
 *                            ------------------- 
 *   begin                : Wednesday, Aug 25, 2004 
 *   copyright          : (C) 2004 Battye @ CricketMX.com 
 *   email                : cricketmx@hotmail.com 
 * 
 *   $Id: admin_quiz.php, v1.000.0.00 2004/08/24 22:53:47 battye Exp $ 
 * 
 * 
 ***************************************************************************/ 

/*************************************************************************** 
 * 
 *   This program is free software; you can redistribute it and/or modify 
 *   it under the terms of the GNU General Public License as published by 
 *   the Free Software Foundation; either version 2 of the License, or 
 *   (at your option) any later version. 
 * 
 ***************************************************************************/ 

define('IN_PHPBB', 1); 

if( !empty($setmodules) ) 
{ 
   $filename = basename(__FILE__); 
   $module['General']['Quiz'] = $filename; 

   return; 
} 

// 
// Load default header 
// 
$phpbb_root_path = "./../"; 
require($phpbb_root_path . 'extension.inc'); 
require($phpbb_root_path . "includes/functions_quiz.$phpEx"); 
require('./pagestart.' . $phpEx); 

   $language = $board_config['default_lang']; 
    
   if (!file_exists($phpbb_root_path . 'language/lang_' . $language . '/lang_quiz.' . $phpEx)) 
   { 
      $language = 'english'; 
   } 
    
   include($phpbb_root_path . 'language/lang_' . $language . '/lang_quiz.' . $phpEx); 

// Define the mode we are in 

   if($HTTP_GET_VARS['mode'] == "submit" && isset($HTTP_POST_VARS)) 
   { 
   // While this is long, it is the most efficient way to do it at this point in time. It is also the same way the phpBB dev's run a lot of queries, in update_to_latest.php :-D 
   $sql = array(); 

      if($HTTP_POST_VARS['Quiz_Register_Play'] == ON ) 
      { 
         $sql[] = "UPDATE " . CONFIG_TABLE . " SET config_value = '" . intval($HTTP_POST_VARS['Quiz_Post_Count_Play']) . "' WHERE config_name = 'Quiz_Post_Count_Play'"; 
         $sql[] = "UPDATE " . CONFIG_TABLE . " SET config_value = '" . intval($HTTP_POST_VARS['Quiz_Post_Requirement']) . "' WHERE config_name = 'Quiz_Post_Requirement'"; 
      } 
    
   $sql[] = "UPDATE " . CONFIG_TABLE . " SET config_value = '" . intval($HTTP_POST_VARS['Quiz_Author_Play']) . "' WHERE config_name = 'Quiz_Author_Play'"; 
   $sql[] = "UPDATE " . CONFIG_TABLE . " SET config_value = '" . intval($HTTP_POST_VARS['Quiz_show_answers']) . "' WHERE config_name = 'Quiz_show_answers'"; 
   $sql[] = "UPDATE " . CONFIG_TABLE . " SET config_value = '" . intval($HTTP_POST_VARS['Quiz_Register_Play']) . "' WHERE config_name = 'Quiz_Register_Play'"; 
   $sql[] = "UPDATE " . CONFIG_TABLE . " SET config_value = '" . intval($HTTP_POST_VARS['Quiz_Play_Once']) . "' WHERE config_name = 'Quiz_Play_Once'"; 
   $sql[] = "UPDATE " . CONFIG_TABLE . " SET config_value = '" . str_replace("\'", "''", htmlspecialchars($HTTP_POST_VARS['Quiz_Min_Max_Questions'])) . "' WHERE config_name = 'Quiz_Min_Max_Questions'"; 
   $sql[] = "UPDATE " . CONFIG_TABLE . " SET config_value = '" . str_replace("\'", "''", htmlspecialchars($HTTP_POST_VARS['Quiz_Moderators'])) . "' WHERE config_name = 'Quiz_Moderators'"; 
   $sql[] = "UPDATE " . CONFIG_TABLE . " SET config_value = '" . str_replace("\'", "''", htmlspecialchars($HTTP_POST_VARS['Quiz_Banned'])) . "' WHERE config_name = 'Quiz_Banned'"; 
   $sql[] = "UPDATE " . CONFIG_TABLE . " SET config_value = '" . str_replace("\'", "''", htmlspecialchars($HTTP_POST_VARS['Quiz_Author_Mod'])) . "' WHERE config_name = 'Quiz_Author_Mod'"; 
   $sql[] = "UPDATE " . CONFIG_TABLE . " SET config_value = '" . intval($HTTP_POST_VARS['Quiz_Stats_Display']) . "' WHERE config_name = 'Quiz_Stats_Display'"; 
   $sql[] = "UPDATE " . CONFIG_TABLE . " SET config_value = '" . intval($HTTP_POST_VARS['Quiz_Mod_Submit']) . "' WHERE config_name = 'Quiz_Mod_Submit'"; 
   $sql[] = "UPDATE " . CONFIG_TABLE . " SET config_value = '" . intval($HTTP_POST_VARS['Quiz_CashMOD_On']) . "' WHERE config_name = 'Quiz_CashMOD_On'"; 
   $sql[] = "UPDATE " . CONFIG_TABLE . " SET config_value = '" . intval($HTTP_POST_VARS['Quiz_CashMOD_On']) . "' WHERE config_name = 'Quiz_CashMOD_On'"; 
   $sql[] = "UPDATE " . CONFIG_TABLE . " SET config_value = '" . intval($HTTP_POST_VARS['Quiz_admin_cash_correct']) . "' WHERE config_name = 'Quiz_Cash_Correct'"; 
   $sql[] = "UPDATE " . CONFIG_TABLE . " SET config_value = '" . intval($HTTP_POST_VARS['Quiz_admin_cash_incorrect']) . "' WHERE config_name = 'Quiz_Cash_Incorrect'"; 
   $sql[] = "UPDATE " . CONFIG_TABLE . " SET config_value = '" . intval($HTTP_POST_VARS['Quiz_admin_cash_tax']) . "' WHERE config_name = 'Quiz_Cash_Tax'"; 
   $sql[] = "UPDATE " . CONFIG_TABLE . " SET config_value = '" . str_replace("\'", "''", htmlspecialchars($HTTP_POST_VARS['Quiz_admin_cash_currency'])) . "' WHERE config_name = 'Quiz_Cash_Currency'"; 
             
      for ($i = 0; $i < count($sql); $i++) 
      { 
         if(!$result = $db->sql_query($sql[$i])) 
         { 
            message_die(GENERAL_ERROR, "Query $i did not execute correctly", "", __LINE__, __FILE__, $sql[$i]); 
         } 
      } 
       
   message_die(GENERAL_MESSAGE, sprintf($lang['Quiz_admin_configuration_updated'], '<a href="' . append_sid("admin_quiz.$phpEx") . '">', '</a>')); 
   } 
    
   if( $HTTP_GET_VARS['mode'] == "category" ) 
   { 
   $category_id = intval($HTTP_GET_VARS['id']); 

      if($HTTP_GET_VARS['action'] == "add") 
      { 
         if($HTTP_GET_VARS['ask'] == "true") 
         { 
         $sql = "SELECT category_id FROM " . QUIZ_CATEGORY_TABLE . " ORDER BY category_id DESC LIMIT 1"; 

            if(!$result = $db->sql_query($sql)) 
            { 
               message_die(GENERAL_ERROR, "Could not find category id", "", __LINE__, __FILE__, $sql); 
            } 
          
         $row = $db->sql_fetchrow($result); 
         $category_password = ( isset($HTTP_POST_VARS['password']) ) ? md5($HTTP_POST_VARS['password']) : ''; 
         $new_id = ($row['category_id'] + 1); 
          
         $new_category = "INSERT INTO " . QUIZ_CATEGORY_TABLE . " (category_id, category_name, category_description, category_password, category_permissions) VALUES ($new_id, '" . str_replace("\'", "''", htmlspecialchars($HTTP_POST_VARS['name'])) . "', '" . str_replace("\'", "''", htmlspecialchars($HTTP_POST_VARS['description'])) . "', '" . $category_password . "', " . intval($HTTP_POST_VARS['permissions']) . ")"; 
                   
            if( !$db->sql_query($new_category) ) 
            { 
               message_die(GENERAL_ERROR, "Could not find make new category", "", __LINE__, __FILE__, $new_category); 
            } 
             
            else 
            { 
               message_die(GENERAL_MESSAGE, $lang['Quiz_admin_new_category_successful']); 
            } 
         } 
          
         $template->set_filenames(array("quiz_add" => "admin/quiz_add_category_body.tpl")); 
       
         $template->assign_vars( array( 
         "F_FORM" => append_sid("admin_quiz.$phpEx?mode=category&action=add&ask=true"), 
          
         "L_CHOOSE_PER" => $lang['Quiz_admin_category_permissions_choose'], 
         "L_GUEST" => $lang['Quiz_admin_category_guest'], 
         "L_REG" => $lang['Quiz_admin_category_registered'], 
         "L_REG_HIDDEN" => $lang['Quiz_admin_category_registered_hidden'], 
          
         "L_ADD" => $lang['Quiz_admin_cat_add'], 
         "L_SUBMIT" => $lang['Submit'], 
         "L_PASSWORD" => $lang['Quiz_admin_password_protect'], 
         "L_DESCRIPTION" => $lang['Quiz_admin_description'], 
         "L_NAME" => $lang['Quiz_admin_name'], 
         "L_EXPLAINATION" => $lang['Quiz_admin_add_explanation'], 
         "L_EDITING" => $lang['Quiz_admin_add'])); 
          
         $template->pparse("quiz_add"); 
         include("page_footer_admin.$phpEx");       
      } 
    
      if($HTTP_GET_VARS['action'] == "edit") 
      { 
      $category_password = ( isset($HTTP_POST_VARS['password']) ) ? md5($HTTP_POST_VARS['password']) : ''; 
       
         if($HTTP_GET_VARS['ask'] == "true") 
         { 
         $sql = "UPDATE " . QUIZ_CATEGORY_TABLE . " SET category_name = '" . str_replace("\'", "''", htmlspecialchars($HTTP_POST_VARS['name'])) . "', category_description = '" . str_replace("\'", "''", htmlspecialchars($HTTP_POST_VARS['description'])) . "', category_password =  '" . $category_password . "', category_permissions = " . intval($HTTP_POST_VARS['permissions']) . " WHERE category_id = $category_id"; 

            if(!$db->sql_query($sql)) 
            { 
               message_die(GENERAL_ERROR, "Could not update category", "", __LINE__, __FILE__, $sql); 
            } 
             
            else 
            { 
               message_die(GENERAL_MESSAGE, $lang['Quiz_admin_category_update_successful']); 
            } 
         } 
          
      $template->set_filenames(array("quiz_edit" => "admin/quiz_edit_category_body.tpl")); 
       
      $sql = "SELECT * FROM " . QUIZ_CATEGORY_TABLE . " WHERE category_id = $category_id"; 
             
         if(!$result = $db->sql_query($sql)) 
         { 
            message_die(GENERAL_ERROR, "Could not find category", "", __LINE__, __FILE__, $sql); 
         } 
          
         $row = $db->sql_fetchrow($result); 
          
         $category_name = str_replace("\''", "''", $row['category_name']); 
         $category_description = str_replace("\'", "''", $row['category_description']); 
          
         $template->assign_vars( array( 
         "U_NAME" => $category_name, 
         "U_DESCRIPTION" => $category_description, 
          
         "F_FORM" => append_sid("admin_quiz.$phpEx?mode=category&action=edit&ask=true&id=$category_id"), 
          
         "L_CHOOSE_PER" => $lang['Quiz_admin_category_permissions_choose'], 
         "L_GUEST" => $lang['Quiz_admin_category_guest'], 
         "L_REG" => $lang['Quiz_admin_category_registered'], 
         "L_REG_HIDDEN" => $lang['Quiz_admin_category_registered_hidden'],          
          
         "L_PASSWORD" => $lang['Quiz_admin_password_protect'], 
         "L_SUBMIT" => $lang['Submit'], 
         "L_DESCRIPTION" => $lang['Quiz_admin_description'], 
         "L_NAME" => $lang['Quiz_admin_name'], 
         "L_EXPLAINATION" => $lang['Quiz_admin_edit_explanation'], 
         "L_EDITING" => $lang['Quiz_admin_editing'])); 
          
         $template->pparse("quiz_edit"); 
         include("page_footer_admin.$phpEx");       
      } 
       
      if($HTTP_GET_VARS['action'] == "move") 
      { 
         if($HTTP_GET_VARS['ask'] == "true") 
         { 
         $sql = "UPDATE " . QUIZ_GENERAL_TABLE . " SET quiz_category = " . intval($HTTP_POST_VARS['category']) . " 
         WHERE quiz_category = $category_id"; 
          
            if(!$db->sql_query($sql)) 
            { 
               message_die(GENERAL_ERROR, "Could not delete category", "", __LINE__, __FILE__, $sql); 
            } 
             
            else 
            { 
               message_die(GENERAL_MESSAGE, $lang['Quiz_admin_move_category_successful']); 
            } 
         } 
          
      $template->set_filenames(array("quiz_cat_move" => "admin/quiz_move_category_body.tpl")); 
      $sql = "SELECT * FROM " . QUIZ_CATEGORY_TABLE; 
      $dropdown = "<select name='category'>"; 
       
         if(!$result = $db->sql_query($sql)) 
         { 
            message_die(GENERAL_ERROR, "Could not find category data", "", __LINE__, __FILE__, $sql); 
         } 
          
         while($row = $db->sql_fetchrow($result)) 
         { 
            $dropdown .= populate_quiz_drop_down_box($row['category_id'], $row['category_name']); 
         } 
       
      $dropdown .= '</select>'; 
       
      $template->assign_vars( array( 
         "U_DROPDOWN" => $dropdown, 
          
         "F_FORM" => append_sid("admin_quiz.$phpEx?mode=category&action=move&ask=true&id=$category_id"), 
          
         "L_SUBMIT" => $lang['Submit'], 
         "L_MOVE" => $lang['Quiz_admin_cat_move'], 
         "L_MOVE_TO_WHERE" => $lang['Quiz_admin_cat_move_to_category'])); 
          
      $template->pparse("quiz_cat_move"); 
      include("page_footer_admin.$phpEx"); 
      } 
       
      if($HTTP_GET_VARS['action'] == "delete") 
      { 
         if($HTTP_GET_VARS['ask'] == "true") 
         { 
         $sql = "DELETE FROM " . QUIZ_CATEGORY_TABLE . " WHERE category_id = $category_id"; 
          
            if(!$db->sql_query($sql)) 
            { 
               message_die(GENERAL_ERROR, "Could not delete category", "", __LINE__, __FILE__, $sql); 
            } 
         } 
          
         else 
         { 
            message_die(GENERAL_MESSAGE, sprintf($lang['Quiz_admin_delete_category'], append_sid("admin_quiz.$phpEx?mode=category&action=delete&ask=true&id=$category_id"))); 
         } 
      } 
   } 
       
$template->set_filenames(array("quiz_admin" => "admin/quiz_settings_body.tpl")); 

// Permissions 
$quiz_register_to_play_on = ( $board_config['Quiz_Register_Play'] == ON ) ? "checked=\"checked\"" : ""; 
$quiz_register_to_play_off = ( $board_config['Quiz_Register_Play'] == OFF ) ? "checked=\"checked\"" : ""; // No guests basically 

$quiz_post_count_on = ( $board_config['Quiz_Post_Count_Play'] == ON ) ? "checked=\"checked\"" : ""; 
$quiz_post_count_off = ( $board_config['Quiz_Post_Count_Play'] == OFF ) ? "checked=\"checked\"" : ""; 

$quiz_author_mod_on = ( $board_config['Quiz_Author_Mod'] == ON ) ? "checked=\"checked\"" : ""; 
$quiz_author_mod_off = ( $board_config['Quiz_Author_Mod'] == OFF ) ? "checked=\"checked\"" : ""; 

$quiz_mod_submitters_on = ( $board_config['Quiz_Mod_Submit'] == ON ) ? "checked=\"checked\"" : ""; 
$quiz_mod_submitters_off = ( $board_config['Quiz_Mod_Submit'] == OFF ) ? "checked=\"checked\"" : ""; 

$quiz_moderators = str_replace("\'", "''", $board_config['Quiz_Moderators']); 
$quiz_banned = str_replace("\'", "''", $board_config['Quiz_Banned']); 

$quiz_minimum_post_requirement = $board_config['Quiz_Post_Requirement']; 
$quiz_stats_display = intval($board_config['Quiz_Stats_Display']); 
    
// General Settings 
$quiz_show_answers_on = ( $board_config['Quiz_show_answers'] == ON ) ? "checked=\"checked\"" : ""; 
$quiz_show_answers_off = ( $board_config['Quiz_show_answers'] == OFF ) ? "checked=\"checked\"" : ""; // Show answers after playing? 

$quiz_play_once_on = ( $board_config['Quiz_Play_Once'] == ON ) ? "checked=\"checked\"" : ""; 
$quiz_play_once_off = ( $board_config['Quiz_Play_Once'] == OFF ) ? "checked=\"checked\"" : ""; // Users can only play each quiz once? 

$quiz_author_play_on = ( $board_config['Quiz_Author_Play'] == ON ) ? "checked=\"checked\"" : ""; 
$quiz_author_play_off = ( $board_config['Quiz_Author_Play'] == OFF ) ? "checked=\"checked\"" : ""; // Can the author play? OFF = NO. 

$quiz_cash_on = ( $board_config['Quiz_CashMOD_On'] == ON ) ? "checked=\"checked\"" : ""; 
$quiz_cash_off = ( $board_config['Quiz_CashMOD_On'] == OFF ) ? "checked=\"checked\"" : ""; // Cash enabled? OFF = NO. 

$quiz_min_max_questions = str_replace("\'", "''", $board_config['Quiz_Min_Max_Questions']); 

// Advanced Cash 

   if( $board_config['Quiz_CashMOD_On'] == ON ) 
   { 
      $template->assign_block_vars('cash_row', array()); // Initialize the whole cash thing.. sigh. Bloody boring this is lol 
      $quiz_cash_correct = intval($board_config['Quiz_Cash_Correct']); 
      $quiz_cash_incorrect = intval($board_config['Quiz_Cash_Incorrect']); 
      $quiz_cash_tax = intval($board_config['Quiz_Cash_Tax']); 
      $quiz_cash_currency = str_replace("\'", "''", $board_config['Quiz_Cash_Currency']); 
       
      $template->assign_vars( array( 
      "U_C_CORRECT" => $quiz_cash_correct, 
      "U_C_INCORRECT" => $quiz_cash_incorrect, 
      "U_C_TAX" => $quiz_cash_tax,    
      "U_C_CURRENCY" => $quiz_cash_currency, 
       
      "L_C_CORRECT" => $lang['Quiz_admin_cash_correct'], 
      "L_C_INCORRECT" => $lang['Quiz_admin_cash_incorrect'], 
      "L_C_TAX" => $lang['Quiz_admin_cash_taxation'], 
      "L_C_CURRENCY" => $lang['Quiz_admin_cash_currency'])); // I'm still bored 
       
      // Don't believe me? I'll type out the lyrics to the song I'm listening to. The beginning is coming up.. very soon.. 10 seconds max.. here we go 
      // When I look back upon my life it's always with a sense of shame ... give up ... no matter when or where or who, theres only ... give up ... It's a sin, It's a sin, everything 
      // i've ever done, everything I ever do, It's a, It's a, It's a sin ... give up ... no matter when or where or who ... give up ... it's a sin, it's a sin, it's a sin ... 
       
      // I never realised it was this repetitive around the chorus.. lol 
      // Guess what the song is.. AND DON'T GOOGLE IT!! 
      // Answer can be found somewhere below.. somewhere ;-) 
      // I just made this script 8 lines longer. Go me. 
   } 

// Categories 
$categories = "SELECT * FROM " . QUIZ_CATEGORY_TABLE; 

   if(!$cat_result = $db->sql_query($categories)) 
   { 
      message_die(GENERAL_ERROR, "Could not get category data", "", __LINE__, __FILE__, $categories); 
   } 
    
   while($cat_row = $db->sql_fetchrow($cat_result)) 
   { 
      $category_id = intval($cat_row['category_id']); 
      $category_name = str_replace("\'", "''", $cat_row['category_name']) . ' ' . sprintf($lang['Quiz_admin_number_quizzes'], category_quizzes($category_id)); 
      $category_description = str_replace("\'", "''", $cat_row['category_description']); 
       
         $template->assign_block_vars('category_row', array( 
         "U_ID" => $category_id, 
         "U_NAME" => $category_name, 
         "U_DESCRIPTION" => $category_description, 
         "U_EDIT_CATEGORY" => "<a href='" . append_sid("admin_quiz.$phpEx?mode=category&action=edit&id=$category_id") . "'>" . $lang['Quiz_admin_cat_edit'] . "</a>", 
         "U_DELETE_CATEGORY" => "<a href='" . append_sid("admin_quiz.$phpEx?mode=category&action=delete&id=$category_id") . "'>" . $lang['Quiz_admin_cat_delete'] . "</a>", 
         "U_MOVE_CATEGORY" => "<a href='" . append_sid("admin_quiz.$phpEx?mode=category&action=move&id=$category_id") . "'>" . $lang['Quiz_admin_cat_move'] . "</a>", 
         )); 
   } 
    
   // Just to tell the user the latest version. What a pain, file_get_contents() isn't compatible with anything below 4.3.. oh well, file() it is then. 
   $update_file = array(); 
   $update_file = file("http://www.cmxmods.net/quiz_latest.txt"); 

   $template->assign_vars( array( 
   "U_ON" => ON, 
   "U_OFF" => OFF, 
    
   "U_ADD_CATEGORY" => "<a href='" . append_sid("admin_quiz.$phpEx?mode=category&action=add") . "'>" . $lang['Quiz_admin_cat_add'] . "</a>", 
    
   "U_SHOW_ANSWERS_ON" => $quiz_show_answers_on, 
   "U_SHOW_ANSWERS_OFF" => $quiz_show_answers_off, 
    
   "U_MOD_SUBMIT_ON" => $quiz_mod_submitters_on, 
   "U_MOD_SUBMIT_OFF" => $quiz_mod_submitters_off, 
    
   "U_MIN_MAX_QUESTIONS" => $quiz_min_max_questions, 
    
   "U_AUTHOR_MOD_ON" => $quiz_author_mod_on, 
   "U_AUTHOR_MOD_OFF" => $quiz_author_mod_off, 
    
   "U_CASH_ON" => $quiz_cash_on, 
   "U_CASH_OFF" => $quiz_cash_off, 
    
   "U_REGISTER_TO_PLAY_ON" => $quiz_register_to_play_on, 
   "U_REGISTER_TO_PLAY_OFF" => $quiz_register_to_play_off, 
    
   "U_MODERATORS" => $quiz_moderators, 
   "U_BANNED" => $quiz_banned, 
    
   "U_POST_COUNT_ON" => $quiz_post_count_on, 
   "U_POST_COUNT_OFF" => $quiz_post_count_off, 
    
   "U_MINIMUM_POST_REQUIRED" => $quiz_minimum_post_requirement, 
    
   "U_QUIZ_STATS_DISPLAY" => $quiz_stats_display, 
    
   "U_PLAY_ONCE_ON" => $quiz_play_once_on, 
   "U_PLAY_ONCE_OFF" => $quiz_play_once_off, 
    
   "U_AUTHOR_PLAY_ON" => $quiz_author_play_on, 
   "U_AUTHOR_PLAY_OFF" => $quiz_author_play_off,    

   "F_FORM" => append_sid("admin_quiz.$phpEx?mode=submit"), 
    
   "Q_LATEST" => sprintf($lang['Quiz_admin_latest_version'], htmlspecialchars($update_file[0])), 
    
   "L_SUBMIT" => $lang['Submit'], 
    
   "L_YES" => $lang['Quiz_admin_yes'], 
   "L_NO" => $lang['Quiz_admin_no'], 
    
   "L_CONFIGURATION" => $lang['Quiz_admin_configuration'], 
   "L_PERMISSIONS" => $lang['Quiz_admin_permissions'], 
   "L_CATEGORIES" => $lang['Quiz_admin_categories'], 
   "L_CASH_SETTINGS" => $lang['Quiz_admin_cash_settings'], 
    
   "L_CASH_ON" => $lang['Quiz_admin_cash_enable'], 
   "L_MOD_SUBMIT" => $lang['Quiz_admin_mod_only_submit'], 
   "L_AUTHOR_MOD" => $lang['Quiz_admin_author_mod'], 
   "L_SHOW_ANSWERS" => $lang['Quiz_admin_show_answers'], 
   "L_MIN_MAX_QUESTIONS" => $lang['Quiz_admin_quiz_numbers'], 
   "L_REGISTER_TO_PLAY" => $lang['Quiz_admin_register_to_play'], 
   "L_MODERATORS" => $lang['Quiz_admin_moderators'], 
   "L_BANNED" => $lang['Quiz_admin_banned'], 
   "L_POST_COUNT" => $lang['Quiz_admin_post_count'] , 
   "L_POST_REQUIREMENT" => $lang['Quiz_admin_posts'], 
   "L_STATS_DISPLAY" => $lang['Quiz_admin_stats_display'], 
   "L_PLAY_ONCE" => $lang['Quiz_admin_play_once'], 
   "L_AUTHOR_PLAY" => $lang['Quiz_admin_author_play'] 
   )); 

   if($board_config['Quiz_Register_Play'] == ON) 
   { 
      $template->assign_block_vars('register_row', array()); 
   } 
// 
// Generate the page, It's A Sin - Pet Shop Boys 
// 
$template->pparse("quiz_admin"); 
include("page_footer_admin.$phpEx"); 
?>
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

That's odd, the entry is definitely there.

See:

Code: Select all

   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">{L_SET_TIMELIMIT}</span>
      </td>
         
      <td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
            <input type="text" name="Quiz_timeout" size="2" value="{U_SET_TIMELIMIT}" />
         </span>
      </td>
   </tr>
Which other MOD's do you have installed?
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)
doswald
Frequent Poster
Frequent Poster
Posts: 32
Joined: Thu Jan 10, 2008 10:32 am

hi battye, i have Cash MOD, Shop Mod, Photo Album, just to name the few.

thanks, how come it didn't appear... hmmm :(
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

doswald wrote:thanks, how come it didn't appear... hmmm :(
You mean it has just started to appear? :?
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)
doswald
Frequent Poster
Frequent Poster
Posts: 32
Joined: Thu Jan 10, 2008 10:32 am

hello mate, actually if you will see my first post the Quiz Admin you won't see anything pertaining to time set for the Quiz. :(
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Try replacing quiz_settings_body with these contents:

It should appear directly under the configuration heading, that is where I have moved it to.

Code: Select all

<form action="{F_FORM}" method="post">
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
   <tr>
      <td colspan="3" align="center" width="100%" class="catSides" nowrap="nowrap"> <span class="cattitle">{L_PERMISSIONS}</span> </td>
   </tr>
   
   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">{L_AUTHOR_MOD}</span>
      </td>
         
      <td width="15%" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
            <input type="radio" name="Quiz_Author_Mod" {U_AUTHOR_MOD_ON} value="{U_ON}"> {L_YES}
         </span>
      </td>
      
      <td width="15%" class="row1" align="center" valign="middle" height="100%">
         <span class="genmed">
            <input type="radio" name="Quiz_Author_Mod" {U_AUTHOR_MOD_OFF} value="{U_OFF}"> {L_NO}
         </span>
      </td>
   </tr>
   
   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">{L_REGISTER_TO_PLAY}</span>
      </td>
         
      <td width="15%" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
            <input type="radio" name="Quiz_Register_Play" {U_REGISTER_TO_PLAY_ON} value="{U_ON}"> {L_YES}
         </span>
      </td>
      
      <td width="15%" class="row1" align="center" valign="middle" height="100%">
         <span class="genmed">
            <input type="radio" name="Quiz_Register_Play" {U_REGISTER_TO_PLAY_OFF} value="{U_OFF}"> {L_NO}
         </span>
      </td>
   </tr>
   
   <!-- BEGIN register_row -->
   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">{L_POST_COUNT}</span>
      </td>
         
      <td width="15%" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
            <input type="radio" name="Quiz_Post_Count_Play" {U_POST_COUNT_ON} value="{U_ON}"> {L_YES}
         </span>
      </td>
      
      <td width="15%" class="row1" align="center" valign="middle" height="100%">
         <span class="genmed">
            <input type="radio" name="Quiz_Post_Count_Play" {U_POST_COUNT_OFF} value="{U_OFF}"> {L_NO}
         </span>
      </td>
   </tr>

   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">{L_POST_REQUIREMENT}</span>
      </td>
            
      <td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
             <input type="text" name="Quiz_Post_Requirement" size="16" value="{U_MINIMUM_POST_REQUIRED}">
         </span>
      </td>
   </tr>
   <!-- END register_row -->      

   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">{L_MODERATORS}</span>
      </td>
            
      <td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
             <input type="text" name="Quiz_Moderators" size="16" value="{U_MODERATORS}">
         </span>
      </td>
   </tr>
   
   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">{L_BANNED}</span>
      </td>
            
      <td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
             <input type="text" name="Quiz_Banned" size="16" value="{U_BANNED}">
         </span>
      </td>
   </tr>
   
   <tr>
      <td colspan="3" align="center" width="100%" class="catSides" nowrap="nowrap"> <span class="cattitle">{L_STATS}</span> </td>
   </tr>
   
   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">{L_CLEAR_STATS}</span>
      </td>
            
      <td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
            {U_CLEAR_STATS}
         </span>
      </td>
   </tr>

   <tr>
      <td colspan="3" align="center" width="100%" class="catSides" nowrap="nowrap"> <span class="cattitle">{L_CONFIGURATION}</span> </td>
   </tr>

  <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">Time limits</span>
      </td>
         
      <td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
            <input type="text" name="Quiz_timeout" size="2" value="{U_SET_TIMELIMIT}" />
         </span>
      </td>
   </tr>
   
   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">{L_SHOW_ANSWERS}</span>
      </td>
         
      <td width="15%" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
            <input type="radio" name="Quiz_show_answers" {U_SHOW_ANSWERS_ON} value="{U_ON}"> {L_YES}
         </span>
      </td>
      
      <td width="15%" class="row1" align="center" valign="middle" height="100%">
         <span class="genmed">
            <input type="radio" name="Quiz_show_answers" {U_SHOW_ANSWERS_OFF} value="{U_OFF}"> {L_NO}
         </span>
      </td>
   </tr>

   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">{L_CASH_ON}</span>
      </td>
         
      <td width="15%" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
            <input type="radio" name="Quiz_CashMOD_On" {U_CASH_ON} value="{U_ON}"> {L_YES}
         </span>
      </td>
      
      <td width="15%" class="row1" align="center" valign="middle" height="100%">
         <span class="genmed">
            <input type="radio" name="Quiz_CashMOD_On" {U_CASH_OFF} value="{U_OFF}"> {L_NO}
         </span>
      </td>
   </tr>   
   
   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">{L_MOD_SUBMIT}</span>
      </td>
         
      <td width="15%" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
            <input type="radio" name="Quiz_Mod_Submit" {U_MOD_SUBMIT_ON} value="{U_ON}"> {L_YES}
         </span>
      </td>
      
      <td width="15%" class="row1" align="center" valign="middle" height="100%">
         <span class="genmed">
            <input type="radio" name="Quiz_Mod_Submit" {U_MOD_SUBMIT_OFF} value="{U_OFF}"> {L_NO}
         </span>
      </td>
   </tr>   
   
   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">{L_STATS_DISPLAY}</span>
      </td>
            
      <td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
             <input type="text" name="Quiz_Stats_Display" size="5" value="{U_QUIZ_STATS_DISPLAY}">
         </span>
      </td>
   </tr>
   
   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">{L_PLAY_ONCE}</span>
      </td>
         
      <td width="15%" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
            <input type="radio" name="Quiz_Play_Once" {U_PLAY_ONCE_ON} value="{U_ON}"> {L_YES}
         </span>
      </td>
      
      <td width="15%" class="row1" align="center" valign="middle" height="100%">
         <span class="genmed">
            <input type="radio" name="Quiz_Play_Once" {U_PLAY_ONCE_OFF} value="{U_OFF}"> {L_NO}
         </span>
      </td>
   </tr>
   
   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">{L_AUTHOR_PLAY}</span>
      </td>
         
      <td width="15%" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
            <input type="radio" name="Quiz_Author_Play" {U_AUTHOR_PLAY_ON} value="{U_ON}"> {L_YES}
         </span>
      </td>
      
      <td width="15%" class="row1" align="center" valign="middle" height="100%">
         <span class="genmed">
            <input type="radio" name="Quiz_Author_Play" {U_AUTHOR_PLAY_OFF} value="{U_OFF}"> {L_NO}
         </span>
      </td>
   </tr>

   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">{L_QUIZ_PACKS_BOT}</span>
      </td>
         
      <td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
            <input type="text" name="Quiz_bot" size="16" value="{U_QUIZ_BOT}" />
         </span>
      </td>
   </tr>
   
   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">{L_PACKS_DROPDOWN}</span>
      </td>
         
      <td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
            {U_PACKS_DROPDOWN}
         </span>
      </td>
   </tr>
   
   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">{L_MIN_MAX_QUESTIONS}</span>
      </td>
            
      <td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
             <input type="text" name="Quiz_Min_Max_Questions" size="16" value="{U_MIN_MAX_QUESTIONS}">
         </span>
      </td>
   </tr>

   <!-- BEGIN cash_row -->      
   <tr>
      <td colspan="3" align="center" width="100%" class="catSides" nowrap="nowrap"> <span class="cattitle">{L_CASH_SETTINGS}</span> </td>
   </tr>

   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">{L_C_CURRENCY}</span>
      </td>
            
      <td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
             <input type="text" name="Quiz_admin_cash_currency" size="10" value="{U_C_CURRENCY}">
         </span>
      </td>
   </tr>
   
   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">{L_C_CORRECT}</span>
      </td>
            
      <td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
             <input type="text" name="Quiz_admin_cash_correct" size="5" value="{U_C_CORRECT}">
         </span>
      </td>
   </tr>
   
   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">{L_C_INCORRECT}</span>
      </td>
            
      <td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
             <input type="text" name="Quiz_admin_cash_incorrect" size="5" value="{U_C_INCORRECT}">
         </span>
      </td>
   </tr>
   
   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
         <span class="genmed">{L_C_TAX}</span>
      </td>
            
      <td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
             <input type="text" name="Quiz_admin_cash_tax" size="5" value="{U_C_TAX}">
         </span>
      </td>
   </tr>
   <!-- END cash_row -->      

   <tr>
      <td colspan="3" align="center" width="100%" class="catSides" nowrap="nowrap"> <span class="cattitle">{L_CATEGORIES}</span> </td>
   </tr>
   
   <tr>
      <td width="100%" colspan="3" class="row1" align="center" valign="middle" height="100%">
         <span class="gen">{U_ADD_CATEGORY}</span>
      </td>
   </tr>
   
   <!-- BEGIN category_row -->      
   <tr>
      <td width="70%" class="row1" align="left" valign="middle" height="100%">
          <span class="genmed"><b>{category_row.U_NAME}</b></span><br /><span class="genmed"> {category_row.U_DESCRIPTION}</span>
      </td>
         
      <td width="30%" colspan="2" class="row2" align="center" valign="middle" height="100%">
         <span class="genmed">
            {category_row.U_EDIT_CATEGORY}, {category_row.U_DELETE_CATEGORY}, {category_row.U_MOVE_CATEGORY}
         </span>
      </td>
   </tr>
   <!-- END category_row -->      
      
   <tr>
      <th colspan="3" width="100%" class="thTop" nowrap="nowrap">
         <input class="liteoption" type="submit" value="{L_SUBMIT}" />
      </th>
   </tr>
</table>
</form>

<table width="100%" border="0">
   <tr>
      <td border="0" align="left" width="100%"><span class="genmed">{Q_LATEST}</span></td>
   </tr>
</table>
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)
doswald
Frequent Poster
Frequent Poster
Posts: 32
Joined: Thu Jan 10, 2008 10:32 am

improving mate, here's my latest print screen, what is that blank field for?

Image

it happen when i try to play the True/False quiz, same thing goes

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

We'll try and sort out the time limits problem first.
In that blank field enter the number of seconds you want to allow per question.
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)
doswald
Frequent Poster
Frequent Poster
Posts: 32
Joined: Thu Jan 10, 2008 10:32 am

hi mate after i define 10 (as 10 secs for each question) when i press Submit then when I go back to the settings it disappears???

now after i play the quiz when i try to stay for a long period( over 10 secs), it still continued and give me an answers/results
Post Reply