[resolved] [Plugin : Contact Form 7] change default quiz with random (2 posts)

  1. pistian
    Posted 7 years ago #

    I would like to change the default quiz with random numbers and I tried this: (/includes/classes/classes.php at row 301)

    case 'quiz':
    if ( count( $raw_values ) == 0 && count( $values ) == 0 )
    { // default quiz
    $rand_num = rand(0, 9);
    $rand_num2 = rand(0, 9);
    $sum = $rand_num + $rand_num2;
    	$raw_values1[] = $rand_num.'+'.$rand_num2.'=?|'.$sum;
    	$values[] = $rand_num.'+'.$rand_num2.'=?';

    ..but it doesn't works. Answer is wrong even if the sum is correct.

    Any ideas. Are there any problems in the hashing?
    Thanks in advance

  2. pistian
    Posted 7 years ago #

    Solved. There was an error in $raw_values1[]. It should be $raw_values[].
    What a noob!!

    Anyway.. I hope this helps somebody else.

    Thanks for this plugin.

Topic Closed

This topic has been closed to new replies.

About this Topic