• Resolved nelsontubaina

    (@nelsontubaina)


    hey mate, GREAT plugin, but I found a glitch, when the quiz only takes 1 try per user, and you got several quizzes, the quizzes that the user did not answer think he already answered them and does not let em answer…

    FOR EXAMPLE:
    user : jarbas
    quizzes : quiz 001, quiz002
    parameters: quiz 001 only 1 try per user, quiz 002 only 1 try per user

    jarbas answers quiz 001. jarbas goes to quiz 002 and quiz 002 thinks he already answered it. does not allow jarbas to answer ‘again’.

    the bug is a faulty sql query in the mlw_quiz.php, lines from 30 to 38, u need to check instead of just searching for the user email, also the quiz_id to make sure that user email appears at least (in my example) 1 time given that quiz_id for quiz 001 OR quiz_id for quiz 002, depending on wich one you are looking at at the moment.

    check out this code, did not change almost anything.

    //aqui eu checo SE o número máximo de tentativas n?o é ilimitado E se o user está logado...
    	if ( $mlw_quiz_options->total_user_tries != 0 && is_user_logged_in() )
    	{
    		//se estiver logado e houver um numero máximo de tentativas, eu verifico se ele já estourou ou n?o esse máximo...
    		$current_user = wp_get_current_user();
    		//pelo que eu to vendo aqui, o sistema original só procura o quiz pelo endere?o de e-mail do usuário e n?o o email do user + o id do quiz...
    		$mlw_qmn_user_try_count = $wpdb->get_var($wpdb->prepare( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_results WHERE email='%s' AND deleted='0' AND quiz_id='".$mlw_quiz_id."'", $current_user->user_email));
    		if ($mlw_qmn_user_try_count >= $mlw_quiz_options->total_user_tries) { $mlw_qmn_isAllowed = false; }
    	}

    https://www.ads-software.com/plugins/quiz-master-next/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thank you for reporting this. My version had checked for the Quiz Id as you have corrected it to. I must have uploaded a slightly older version by mistake. I’ll get the right one uploaded right away.

    ~Frank

    I just uploaded the newest update. Version 1.6.2 has fixed this issue. Thanks again for reporting this.

    ~Frank

    Hi,

    I had already notified some bugs when sending results and correction to user by email, after taking the quiz… Did you finally manage to fix it?

    Thanks a lot!

    Hi,

    I had already notified some bugs when sending results and correction to user by email, after taking the quiz… Did you finally manage to fix it?

    Thanks a lot!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘BUG FIXED – user answer only 1 time each quiz’ is closed to new replies.