[ALPHA] Ultimate Quiz MOD v2.1.2 Progress

All web design discussion, including Ultimate Quiz MOD support.

Moderator: CricketMX Forum Moderators

User avatar
Clenzowen
Frequent Poster
Frequent Poster
Posts: 29
Joined: Fri Feb 11, 2011 9:42 pm
Contact:

Hello,
always the same mistakes ...
I hope to repair it, because I had just installed the mod quizzes, and members appreciate.

I just made the changes requested and The first error message at the top of the page that appears is :

Code: Select all

Warning: Cannot modify header information - headers already sent by (output started at /home/forumsfa/public_html/personnel/gratuits/arcades-et-jeux-35/quiz_installer.php:1) in /home/forumsfa/public_html/personnel/gratuits/arcades-et-jeux-35/includes/functions.php on line 2678
And the second message

Code: Select all

Erreur générale
SQL ERROR [ mysql4 ]

Table 'phpbb3_quiz_categories' already exists [1050]

SQL

CREATE TABLE phpbb3_quiz_categories ( quiz_category_id INT(5) NOT NULL AUTO_INCREMENT PRIMARY KEY , quiz_category_name INT(5) NOT NULL )

BACKTRACE

FILE: includes/db/mysql.php
LINE: 175
CALL: dbal->sql_error()

FILE: quiz_installer.php
LINE: 48
CALL: dbal_mysql->sql_query()
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

What happens if you try to access quiz.php?

That "Erreur générale" is appearing on quiz_installer.php. Once you have run that file (and made the change at http://forums.cricketmx.com/viewtopic.p ... 82#p105682) you can delete quiz_installer.php.
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
User avatar
Clenzowen
Frequent Poster
Frequent Poster
Posts: 29
Joined: Fri Feb 11, 2011 9:42 pm
Contact:

when i click on quiz to play I have this error message

Code: Select all

Erreur générale
SQL ERROR [ mysql4 ]

Unknown column 's.quiz_statistic_id' in 'field list' [1054]

SQL

SELECT COUNT(s.quiz_statistic_id) AS quiz_count FROM phpbb3_quiz_statistics s, phpbb3_quiz_questions q WHERE s.quiz_user = 2 AND s.quiz_question_id = q.question_id AND q.question_quiz = 5 LIMIT 1

BACKTRACE

FILE: includes/db/mysql.php
LINE: 175
CALL: dbal->sql_error()

FILE: includes/db/mysql.php
LINE: 222
CALL: dbal_mysql->sql_query()

FILE: includes/db/dbal.php
LINE: 170
CALL: dbal_mysql->_sql_query_limit()

FILE: includes/quiz/quiz_statistics.php
LINE: 191
CALL: dbal->sql_query_limit()

FILE: quiz.php
LINE: 553
CALL: quiz_statistics->has_user_played_quiz()
when I want to start installing the update by typing in the browser

Code: Select all

General Error
SQL ERROR [mysql4]

Table 'phpbb3_quiz_categories' already exists [1050]

SQL

CREATE TABLE phpbb3_quiz_categories (quiz_category_id INT (5) NOT NULL PRIMARY KEY AUTO_INCREMENT, quiz_category_name INT (5) NOT NULL)

BackTrace

FILE: includes / db / mysql.php
LINE: 175
CALL: DBAL-> SQL_ERROR ()

FILE: quiz_installer.php
LINE: 48
CALL: dbal_mysql-> sql_query ()
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

I've never seen the "Unknown column 's.quiz_statistic_id' in 'field list' [1054]" error before, I don't even recall seeing it during development.

I think the best thing might be to backup phpbb_quiz and phpbb_quiz_questions and phpbb_quiz_statistics - then drop the 4 quiz tables in phpMyAdmin - run quiz_installer.php and re-insert the backed up data.

I think you have missed a step during the upgrade but I am not sure what.
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
User avatar
Clenzowen
Frequent Poster
Frequent Poster
Posts: 29
Joined: Fri Feb 11, 2011 9:42 pm
Contact:

Sorry I double checked everything it still does not ...
And I still have a general error:

Code: Select all

SQL ERROR [ mysql4 ]

Unknown column 's.quiz_statistic_id' in 'field list' [1054]

SQL

SELECT COUNT(s.quiz_statistic_id) AS quiz_count FROM phpbb3_quiz_statistics s, phpbb3_quiz_questions q WHERE s.quiz_user = 2 AND s.quiz_question_id = q.question_id AND q.question_quiz = 5 LIMIT 1

BACKTRACE

FILE: includes/db/mysql.php
LINE: 175
CALL: dbal->sql_error()

FILE: includes/db/mysql.php
LINE: 222
CALL: dbal_mysql->sql_query()

FILE: includes/db/dbal.php
LINE: 170
CALL: dbal_mysql->_sql_query_limit()

FILE: includes/quiz/quiz_statistics.php
LINE: 191
CALL: dbal->sql_query_limit()

FILE: quiz.php
LINE: 553
CALL: quiz_statistics->has_user_played_quiz()
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

In phpMyAdmin can you browse the phpbb3_quiz_statistics table? There should definitely be a quiz_statistic_id (underlined, it is the primary key).

Could you also check the phpbb3_config table and ensure that all of the quiz settings (they all start with qc_ are present). I don't think it relates to this error, but something is going wrong and I can't narrow down what it is yet :?

Are you able to provide a link to your forum with a test account so I can look? 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)
User avatar
Clenzowen
Frequent Poster
Frequent Poster
Posts: 29
Joined: Fri Feb 11, 2011 9:42 pm
Contact:

yes, quiz_statistic_id is underlined
i send u a pm for attest count
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Thanks Clenzowen, I had a look and fixed it for you.
Creating table phpbb3_quiz...

Creating table phpbb3_quiz_questions...

Creating table phpbb3_quiz_statistics...

Creating table phpbb3_quiz_categories...

Creating table phpbb3_config...

Installation is finished with no errors.

For support, please visit CricketMX.com or phpBB MOD support topic.
I see what the problem is now, I think you had UQM v2.0.0 already installed - so when you overwrote the files it was still looking at the old database tables from v2.0.0 :)

I didn't delete the existing tables as I wasn't sure if you still wanted them, so I renamed them to phpbb3_quiz_OLD, phpbb3_quiz_questions_OLD, phpbb3_quiz_categories_OLD and phpbb3_quiz_statistics_OLD.

I tested the quiz page, it appears with no errors :) So all you need to do now is add a category in the ACP and start adding questions :)

Let me know if it works :)
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)
Abera
Greenhorn
Greenhorn
Posts: 18
Joined: Sun Feb 13, 2011 3:18 pm

battye wrote: Abera, the colour is the same used as in polls.
Thank you sir. I don't know which one it was, but I got it changed. :D
Color bars
User avatar
Clenzowen
Frequent Poster
Frequent Poster
Posts: 29
Joined: Fri Feb 11, 2011 9:42 pm
Contact:

it's ok thank you
Would you like me to translate files in french please?
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Yes, a French translation would be great - thank you :)
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
User avatar
Clenzowen
Frequent Poster
Frequent Poster
Posts: 29
Joined: Fri Feb 11, 2011 9:42 pm
Contact:

ok I'll do translations, tomorrow, I would have more time.
plasmino
Greenhorn
Greenhorn
Posts: 18
Joined: Sun Jan 17, 2010 3:35 pm
Location: Italia, Milano
Contact:

battye, I was on 2.1.0 ... send me the files for the upgrade? :D
Livirathon
Greenhorn
Greenhorn
Posts: 2
Joined: Sun Feb 20, 2011 2:13 am

:D hi~battye

Quiz mod can't support Multil language.

Image
Image
Image

if i use english name is work!
Image
else
Image
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Ahhh, the foreign characters always get me :(

The fix mainly consists of adding a "true" parameter at the end of the request_var function.

CATEGORIES

Code: Select all

--------------OPEN includes/acp/acp_quiz.php--------------------



-----------FIND----------------

					// Now do the actual update, fix up the category name first.
					$category = utf8_normalize_nfc( $db->sql_escape(request_var('category_name', '')) );

-------------REPLACE WITH-------------

					// Now do the actual update, fix up the category name first.
					$category = $db->sql_escape( utf8_normalize_nfc(request_var('category_name', '', true)) );






---------------FIND---------------

					if( !check_form_key('uqm_category') )
					{
						trigger_error($user->lang['ACP_UQM_QUIZ_FORM_INVALID'] . adm_back_link(append_sid("{$phpbb_admin_path}index.$phpEx?i=quiz&t=add_category")));
					}

					$category = utf8_normalize_nfc( $db->sql_escape(request_var('category_name', '')) );



---------REPLACE WITH------------



					if( !check_form_key('uqm_category') )
					{
						trigger_error($user->lang['ACP_UQM_QUIZ_FORM_INVALID'] . adm_back_link(append_sid("{$phpbb_admin_path}index.$phpEx?i=quiz&t=add_category")));
					}

					$category = $db->sql_escape( utf8_normalize_nfc(request_var('category_name', '', true)) );


EDIT: here are the fixes for adding/playing quizzes

Code: Select all

---OPEN quiz.php---

---FIND---

			$check_correct	= $quiz_configuration->check_correct_checked($current_questions); // see if the user has left any empty
			$quiz_name	= request_var('quiz_name', '');	

---REPLACE WITH---

			$check_correct	= $quiz_configuration->check_correct_checked($current_questions); // see if the user has left any empty
			$quiz_name	= request_var('quiz_name', '', true);	


----OPEN includes/quiz/quiz_question.php----

---FIND---

		for($i = 0; $i < request_var('question_number', 0); $i++)
		{
			$question_name	= request_var('question_name_' . $i, '');
			$answers_name	= request_var('answers_' . $i, '');
			$multiples 	= explode("\n", $answers_name);
			$correct	= request_var('answer_' . $i, '');

---REPLACE WITH---

		for($i = 0; $i < request_var('question_number', 0); $i++)
		{
			$question_name	= request_var('question_name_' . $i, '', true);
			$answers_name	= request_var('answers_' . $i, '', true);
			$multiples 	= explode("\n", $answers_name);
			$correct	= request_var('answer_' . $i, '', true);

Then run these SQL queries to convert the database tables to utf8_bin (by default they are collated in latin or something, which is another thing that will be rectified with UMIL...)

Code: Select all

----DATABASE----

ALTER DATABASE `phpbb_quiz` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
ALTER DATABASE `phpbb_quiz_categories` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
ALTER DATABASE `phpbb_quiz_questions` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
ALTER DATABASE `phpbb_quiz_statistics` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;


Edit 2: screenshots of foreign characters working + the quiz play once setting below. I also found a bug whereby if the "show answers" config setting is disabled, then no quiz statistics are stored - that's fixed now :)
Attachments
Quiz play once config setting (in use)
Quiz play once config setting (in use)
Foreign characters when submitting a quiz
Foreign characters when submitting a quiz
Foreign characters when playing a quiz
Foreign characters when playing a quiz
Foreign characters in categories
Foreign characters in categories
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

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