Great!
I have another question which may warrant a new thread but here goes lol:
As you know, I've been doing all the code changes (thanks to you!), etc at my test site and will soon be adding it to my live forum. One thing I've never done within
Quiz ACP is clear all the
Statistics before all code changes were made (including the new SQL entry). I've cleared all the Statistics (basically to check all is in order) and whilst they have been cleared, I was unable to replay a Quiz that I've already done before statistics were cleared. Is this right?
I thought (dangerous I know!) that on clearing the statistics it would "empty" the SQL tables for all members statistcs meaning that they have the ability to play the quizzes again. The only reason why I've thought about this is that I was toying with the idea of "clearing" the statistics, say, once a year (or every six months) so that all members get another opportunity to play quizzes they've only been able to play once.
Other words, once statistics are cleared (or SQL tables truncated EXCEPT the actual quizzes?), stats are reset and all members can play a quiz again (only once) until the next time they are cleared a year later? Or is it just a case of "resetting" phpbb_quiz quiz_user_list SQL entry?
Hope that makes sense and I'm not setting out to make more work honest! Just a thought or something I may had overlooked.
admin/admin_quiz.tpl:
Code: Select all
if( $HTTP_GET_VARS['mode'] == "clear_quiz_statistics" )
{
if( intval($HTTP_GET_VARS['confirm']) == 0 || !isset($HTTP_GET_VARS['confirm'])) // Give the user a chance to espape the deletion, or a second chance if they somehow got to this page without the confirm var. set.
{
message_die(GENERAL_MESSAGE, sprintf($lang['Quiz_admin_stats_clear_all_stats_do_confirm'], "<a href='" . append_sid('admin_quiz.'.$phpEx.'?mode=clear_quiz_statistics&confirm=1') . "'>", "</a>"));
}
else if( intval($HTTP_GET_VARS['confirm']) == 1 )
{
$sql = "TRUNCATE TABLE " . QUIZ_STATISTICS_TABLE;
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Unable to truncate statistics table (' . QUIZ_STATISTICS_TABLE . ')', '', __LINE__, __FILE__, $sql);
}
message_die(GENERAL_MESSAGE, $lang['Quiz_admin_stats_clear_all_stats_do_deleted']);
}
}