Page 1 of 1

Quiz Stats Reset

Posted: Sun Mar 08, 2009 12:03 am
by DakotaSurfer
I want to reset all the stats for the current quizzes. I'd like to be able to do it with one swoop, truncate the plays, stats and members but keep all the quizzes so everyone can start over and so I can start a new contest. We get new members so the questions will always be good so even maybe a cut-off date using their "Joined" date as a key element rather than the user_id. In other words, newer members need only play. I have been using the code "batty" gave me from earlier where I can delete the quiz entries by user_id and quiz _id but it never effects the "Most Played Quizzes" stats and I'd like to reset that as well. Plus it does take forever to remove the entires of 300+ entires. Any thoughts?

Re: Quiz Stats Reset

Posted: Sun Mar 08, 2009 2:34 am
by battye
If you look in phpMyAdmin at the database, can you confirm that there is a table called "phpbb_quiz_statistics" or similar?
Within that there should be a few columns saying "stats_id, quiz_id, user_id, stats_correct, stats_incorrect, stats_percentage"

Thanks for posting this in the forum.

Re: Quiz Stats Reset

Posted: Mon Mar 09, 2009 3:39 pm
by DakotaSurfer
Absolutely... sorry for the delay, gets hectic sometimes. These were all created with the mod installation. You should have copies of the original files you sent me for deleting users info and quiz info from my PM to you.

Tables and Fields
  • phpbb_quiz
    quiz_id
    quiz_name
    quiz_author
    quiz_enabled
    quiz_category
    quiz_type
    quiz_plays
  • phpbb_quiz_categories
    category_id
    category_password
    category_name
    category_permissions
    category_description
  • phpbb_quiz_input_data
    quiz_id
    question_id
    quiz_question
    quiz_answer
  • phpbb_quiz_multiple_choice_data
    quiz_id
    question_id
    quiz_question
    quiz_alternates
    quiz_answer
  • phpbb_quiz_statistics
    stats_id
    quiz_id
    user_id
    stats_correct
    stats_incorrect
    stats_percentage
  • phpbb_quiz_true_false_data
    quiz_id
    question_id
    quiz_question
    quiz_answer

Re: Quiz Stats Reset

Posted: Thu Mar 19, 2009 9:18 am
by battye
Hi,

Sorry for the delay. By the look of it all stats data is kept in phpbb_quiz_statistics, so to completely wipe this you can truncate that table. In phpMyAdmin the query for this is: TRUNCATE TABLE phpbb_quiz_statistics;

Back up that table first of course, just in case you realise down the track you need something from those stats.

To reset the amount of plays, use this query: UPDATE phpbb_quiz SET quiz_plays = 0;

Let me know if you have any other questions :)

Re: Quiz Stats Reset

Posted: Wed Apr 08, 2009 3:17 pm
by DakotaSurfer
I'll try this out the next time I want to reset all the stats. I've already started a new contest so I don't want to disturb the data for now. Thanks for the help. It's been a busy 1st quarter.