Can quiz authors have moderative status over their own quizzes? YES
Only quiz moderators can submit quizzes? NO
Should users only be able to play each quiz once? YES
Should the quiz author be able to play their own quizzes? NO
After all the code changes that I've done in Dynamic Timer thread, this is what happens:
1. A Quiz Author submits a quiz
2. If they try to play a quiz they submitted they get this message: You cannot play a quiz you have submitted. Underneath this it gives the Moderator controls (Edit, Delete, Move) - This is correct, but...
3. If the Quiz Author attempts to play the quiz they submitted a second time, they get this message: You have already attempted to play this quiz! - but NO Moderator controls!
I think the problem lies here:
Code: Select all
// 06-11-08 quiz_play_once_addition
$qpo_sql = $db->sql_query("SELECT quiz_user_list FROM " . QUIZ_GENERAL_TABLE . " WHERE quiz_id = $quiz_id");
$qpo_row = $db->sql_fetchrow($qpo_sql);
$qpo_user_plays = explode(',', $qpo_row['quiz_user_list']);
for( $exp = 0; $exp < count($qpo_user_plays); $exp++ )
{
if( is_numeric($qpo_user_plays[$exp]) && $qpo_user_plays[$exp] == $userdata['user_id'] )
{
$message = 'You have already attempted to play this quiz!' . '<br /><br />' . sprintf($lang['Quiz_click_return_quiz'], '<a href="' . append_sid("quiz.$phpEx") . '">', '</a> ');
message_die(GENERAL_MESSAGE, $message);
}
}
Code: Select all
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']);
}
}
Sorry again, battye. I believe this one may help towards phpBB3 UQM though? I hope!