WordPress.org

Ready to get started?Download WordPress

Forums

WP Survey And Quiz Tool
see ranking results (3 posts)

  1. pettedemon
    Member
    Posted 2 years ago #

    I wish every member could see the ranking of who has played: time needed and rating. is it possible?

    http://wordpress.org/extend/plugins/wp-survey-and-quiz-tool/

  2. VineyardTravel
    Member
    Posted 1 year ago #

    I would like this as well.

  3. psychedelus
    Member
    Posted 1 year ago #

    If you are comfortable in writing some simple PHP and MYSQL you can use something like this to get the fastest times. I use this query on one of my sites to display the three top contenders with the fastest times in a quiz.

    <?php
    global $wpdb;
    $res = $wpdb->get_results("SELECT DISTINCT(SEC_TO_TIME(timetaken)) AS thetime, person_name FROM wp_wpsqt_all_results ORDER BY thetime ASC LIMIT 0, 3");
    foreach ($res as $rs) {
      echo $rs->thetime . ' ' . $rs->person_name . '\n';
    }
    ?>

    The code above will show you the three fastest times and the names of the contestants.

    You could also display the users score amongst those details. To do this paste the following into your page:

    <?php
    global $wpdb;
    $res = $wpdb->get_results("SELECT DISTINCT(SEC_TO_TIME(timetaken)) AS thetime, person_name, score, total FROM wp_wpsqt_all_results ORDER BY thetime ASC LIMIT 0, 3");
    foreach ($res as $rs) {
      echo 'Time: ' . $rs->thetime . ' Name: ' . $rs->person_name . ' Score: ' . $rs->score . '/' . $rs->total . '\n';
    }
    ?>

    Hope this helps.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic