Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • replace line 24 of /home/cotosanc/public_html/wp-content/plugins/php-everywhere/phpeverywhere.php

    with this line:

    add_action(‘widgets_init’, function(){return register_widget(“phpeverywherewidget”);});

    booom fixed

    kvanbiesen

    (@kvanbiesen)

    kvanbiesen

    (@kvanbiesen)

    you sure you published the page?

    dont use the back button to retake the quiz

    it work fine here, multiple browsers

    what happens if you add? it will show a dirty attemps and maxtries (it will only look a the attemps when loading the page, so use back for browser = no worky.

    if( isset( $params["chances"])) {
    		$attempts = $wpdb->get_var( "
    			SELECT count(*) FROM {$wpdb->base_prefix}ssquiz_history WHERE user_id = {$info->user->id} AND quiz_id = {$info->quiz->id}
    		");
    		echo "Attempts Saved: ".$attempts." Max_chances". intval( $params["chances"]);
    		if( $attempts >= intval( $params["chances"]) )
    			return ssquiz_return_quiz_body( '<h2>'.__('You already took this quiz', 'ssquiz').'</h2>' );
    	}

    ps, tried both logged in and logout users

    kvanbiesen

    (@kvanbiesen)

    read my dirty fix in here

    kvanbiesen

    (@kvanbiesen)

    i’m pretty sure its related to the timezone/time notation on your pc…

    if you change it to like say belgian notation/timezone, i’m pretty sure it will work.

    The Date function ssvadim used, doesnt cover that, he will need to adapt the conversion to UTCtime, and then calculate with it.

    i’ve created a dirty fix for you guys. it should work/but break after an update
    open the ssquiz.js in in editor

    replace line 947-949

    var date = new Date(left * 1000);
    
    var time = date.toTimeString().substr(3, 5);

    with

    var secsleft=left;
    var minutes = Math.floor(secsleft / 60);
    secsleft -= minutes * 60;
    
    var seconds = parseInt(secsleft % 60, 10);
    var time = (minutes < 10 ? '0' + minutes : minutes) + ':' + (seconds < 10 ? '0' + seconds : seconds);

    should work if you stay under the hour, easy to change ofc

    kvanbiesen

    (@kvanbiesen)

    Dirty hack – will break on update most likely

    open client-quiz.php

    replace (line 83-90)

    // Did current user tried this quiz
    if( $info->one_chance ) {
    		$attempts = $wpdb->get_var( "
    			SELECT count(*) FROM {$wpdb->base_prefix}ssquiz_history WHERE user_id = {$info->user->id} AND quiz_id = {$info->quiz->id}
    		");
    		if( $attempts > 0 )
    			return ssquiz_return_quiz_body( '<h2>'.__('You already took this quiz', 'ssquiz').'</h2>' );
    	}

    with

    //remove one_change and replaced with chances
    	if( isset( $params["chances"])) {
    		$attempts = $wpdb->get_var( "
    			SELECT count(*) FROM {$wpdb->base_prefix}ssquiz_history WHERE user_id = {$info->user->id} AND quiz_id = {$info->quiz->id}
    		");
    		if( $attempts >= intval( $params["chances"]) )
    			return ssquiz_return_quiz_body( '<h2>'.__('You already took this quiz', 'ssquiz').'</h2>' );
    	}

    then in your yourcode, add chances=3 to make 3 attempts. (1 for once_change)

    kvanbiesen

    (@kvanbiesen)

    well i’m pretty new @ wordpress(only start looking at it 1 week ago), so i’m still trying to figure everything out myself.

    i think, this is explanation..

    let say your site = http://somewpsite.com

    the plugins_url function gives the full path to the lang dir. so it will be the absolute path
    http://somewpsite.com/wp-content/plugins/ssquiz/lang/ssquiz-es_ES.mo wich it will look for.

    Most likely it wont be able to fetch this, well maybe it can, but it wont find the Po files.

    if you change it by my command, it will look in the folders using relative paths (relative from the folder its located..). and then it will know how to find every file.

    Btw a lot of __() need to be replaced, otherwise it will be partial your language, partial english..

    Other then that, Its an awesome plugin. easy, works fine (in english, multilang needed some fixing)

    kvanbiesen

    (@kvanbiesen)

    Change Line 361 of ssquiz.php

    load_plugin_textdomain( 'ssquiz', false, plugins_url( 'ssquiz/lang' ) );

    to

    load_plugin_textdomain( 'ssquiz', false, dirname(plugin_basename( __FILE__ ) ) .'/lang');

    btw while the plugin works great, it needs some fixing in the localization. Some Fields Arent Translated but can be dirty hacked to make it work.

    by example in client-quiz, __(“Answered questions”) must be changed to __(“Answered questions”, ‘ssquiz’) in order to make it work

Viewing 8 replies - 1 through 8 (of 8 total)