Moderative status over authors' own quizzes

All web design discussion, including Ultimate Quiz MOD support.

Moderator: CricketMX Forum Moderators

ABTOP
Greenhorn
Greenhorn
Posts: 24
Joined: Tue Jul 24, 2007 7:49 pm
Contact:

The option to make authors the ability to edit their quizzes can't seem to kick in no matter what.
I set "Can quiz authors have moderative status over their own quizzes?" to YES, but I still can't get those "Edit Quiz, Move Quiz, Delete Quiz" links at the bottom. They will only appear if a user has global administrative privileges, or designated as Quiz Moderator in Quiz Permissions.

Version 1.3.3 (although still says "The latest version of the Ultimate Quiz MOD: 1.2.0" at the bottom of ACP Quiz settings)
User avatar
kikkotm
Know-It-All
Know-It-All
Posts: 186
Joined: Fri Nov 09, 2007 12:16 am
Location: ROMA CAPUT MUNDI - Italy

i think you'll find the answer while reading the post under this.
Last edited by kikkotm on Wed Nov 28, 2007 3:26 pm, edited 1 time in total.
ImageImage Wine is an enemy of the man... Who escapes in front of the enemy is an ignoble man!!! ImageImage
Image Image
Image Image
Image Image
Image Image
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Yeah, as kikkotm said, have a browse through the other topics about moderation.

If that fails, open up functions_quiz.php and look for:

Code: Select all

	if( $board_config['Quiz_Author_Mod'] == ON )
	{
		$sql = "SELECT quiz_author FROM " . QUIZ_GENERAL_TABLE . " WHERE quiz_id = '$quiz_id'";
		
		if(!$result = $db->sql_query($sql))
		{
			message_die(GENERAL_ERROR, '', 'Could not obtain the user id', __LINE__, __FILE__, $sql);
		}
		
		$row = $db->sql_fetchrow($result);

		if( $row['user_id'] == intval($user_id) )
		{
			$quiz_moderator = ON;
		}
	}
If you see that, I see no reason why it wouldn't work?
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)
ABTOP
Greenhorn
Greenhorn
Posts: 24
Joined: Tue Jul 24, 2007 7:49 pm
Contact:

Yes, that code is present. Still I can't moderate my own quizzes unless I enter myself as a Quiz Moderator.

BTY I noticed that you have a missing 'to' between two 'have' in

Code: Select all

$lang['Quiz_post_requirement_not_met'] = 'You have have %s posts to participate in, or submit quizzes';
But more importantly, seems like the language choice for the error massages like the one above or $lang['Quiz_author_cannot_play'] is dependent on the board default language, not the user's language, which seems wrong to me.

Is it possible that somehow because of that

Code: Select all

$lang['Quiz_author_cannot_play_give_edit_options']
gets omitted?

Also there is no index defined for my phpbb_quiz table. Is that OK?
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Sorry, I'm not sure what you mean about the board default language.

quiz_id is the primary key in phpbb_quiz. As long as that is set, you should be fine.
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)
ABTOP
Greenhorn
Greenhorn
Posts: 24
Joined: Tue Jul 24, 2007 7:49 pm
Contact:

battye wrote:Sorry, I'm not sure what you mean about the board default language.
I have two languages on the board - English and Russian. Naturally, in this case one can choose a Default Language in ACP > General Configuration.

The registered users, however, also have a choice of either language.

If I set the board default language to, say, English, and set Quizzes to be playable by only registered users, and if a guest tries to play a Quiz then the guest get the error in the board's default language - English - which is logical. But if a registered user who has set Russian as the preferred language gets an error, than the error will be in English. Most of regular dialogs will be displaying correctly in Russian, but the errors tend to be in English.

See what I mean? :D
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Oh, with regards to error messages by phpBB coding standards they are permitted to be hard-coded (ie. not in the language files) :)
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)
ABTOP
Greenhorn
Greenhorn
Posts: 24
Joined: Tue Jul 24, 2007 7:49 pm
Contact:

battye wrote:Oh, with regards to error messages by phpBB coding standards they are permitted to be hard-coded (ie. not in the language files) :)
Well, they are in $lang files and I translated them. It's more of a convenience issue by itself and the only reason I have mentioned it is in the context of troubleshooting this problem.

The layouts do show the extra line for the missing "Edit Quiz", "Move Quiz" and "Delete Quiz" buttons, it's just the buttons themselves do not display.
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

In functions_quiz.php

FIND

Code: Select all

   if( $board_config['Quiz_Author_Mod'] == ON )
   {
      $sql = "SELECT quiz_author FROM " . QUIZ_GENERAL_TABLE . " WHERE quiz_id = '$quiz_id'";
      
      if(!$result = $db->sql_query($sql))
      {
         message_die(GENERAL_ERROR, '', 'Could not obtain the user id', __LINE__, __FILE__, $sql);
      }
      
      $row = $db->sql_fetchrow($result);

      if( $row['user_id'] == intval($user_id) )
      {
         $quiz_moderator = ON;
      }
   }
AFTER ADD

Code: Select all

echo 'MOD STATUS: ' . $quiz_moderator;
And try again. I don't expect it to fix it (you'll probably get an error) but tell me which number follows MOD STATUS - I'm hoping it's a '1'

You can remove the echo line once you've seen which number is displayed.
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)
ABTOP
Greenhorn
Greenhorn
Posts: 24
Joined: Tue Jul 24, 2007 7:49 pm
Contact:

I get a bunch of errors at the start of the page:

Code: Select all

MOD STATUS: 
Warning: Cannot modify header information - headers already sent by (output started at /home/my_account_name/public_html/forum/includes/functions_quiz.php:75) in /home/my_account_name/public_html/forum/includes/page_header.php on line 943

Warning: Cannot modify header information - headers already sent by (output started at /home/my_account_name/public_html/forum/includes/functions_quiz.php:75) in /home/my_account_name/public_html/forum/includes/page_header.php on line 947

Warning: Cannot modify header information - headers already sent by (output started at /home/my_account_name/public_html/forum/includes/functions_quiz.php:75) in /home/my_account_name/public_html/forum/includes/page_header.php on line 949
Under the overall header I get:

Code: Select all

MOD STATUS: 
Yep, there is nothing.

If I login as Admin, I get the same error on the top of the page and

Code: Select all

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

Ah, silly mistake on my part :wink:

REPLACE

Code: Select all

if( $row['user_id'] == intval($user_id) ) 
WITH

Code: Select all

if( $row['quiz_author'] == intval($user_id) ) 
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)
ABTOP
Greenhorn
Greenhorn
Posts: 24
Joined: Tue Jul 24, 2007 7:49 pm
Contact:

Well, I have a bit of improvement to report.

Now I get:
You cannot play quizzes which you have submitted!
Moderator Options: Edit, Delete, Move
So far so good.
But if I click on any of the links I get:
You are not a quiz moderator!
ABTOP
Greenhorn
Greenhorn
Posts: 24
Joined: Tue Jul 24, 2007 7:49 pm
Contact:

What is the purpose of this section in functions_quiz.php?

Code: Select all

	if( $quiz_moderator != ON )
	{
		$quiz_moderator = OFF;
	}
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Hi,

Have been quite busy today. I will have a look into the code tomorrow morning :)
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)
ABTOP
Greenhorn
Greenhorn
Posts: 24
Joined: Tue Jul 24, 2007 7:49 pm
Contact:

battye wrote:... I will have a look into the code tomorrow morning :)
How's the progress?
Post Reply