Skip to content

Commit

Permalink
Fixes bug preventing leaderboards to show
Browse files Browse the repository at this point in the history
Pages without the quiz on them do not have the settings loaded so we
have to prepare the quiz using the ID
  • Loading branch information
Frank Corso committed Jun 17, 2017
1 parent ab49cbe commit 2587970
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions php/leaderboard-function.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function qsm_addon_leaderboards_generate( $quiz_id ) {
$quiz_id = intval( $quiz_id );

// Retrieve template, grading system, and name of quiz
$mlwQuizMasterNext->pluginHelper->prepare_quiz( $quiz_id );
$template = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_leaderboards', 'template' );
$grade_system = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_options', 'system' );
$quiz_name = $wpdb->get_var( $wpdb->prepare( "SELECT quiz_name FROM {$wpdb->prefix}mlw_quizzes WHERE deleted='0' AND quiz_id=%d", $quiz_id ) );
Expand Down
6 changes: 3 additions & 3 deletions qsm-leaderboards.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* Description: Adds some basic leaderboards to Quiz And Survey Master
* Author: Frank Corso
* Author URI: https://quizandsurveymaster.com
* Version: 1.0.0
* Version: 1.0.1
*
* @author Frank Corso
* @version 1.0.0
* @version 1.0.1
*/

if ( ! defined( 'ABSPATH' ) ) exit;
Expand All @@ -29,7 +29,7 @@ class QSM_Leaderboards {
* @var string
* @since 1.0.0
*/
public $version = '1.0.0';
public $version = '1.0.1';

/**
* Main Construct Function
Expand Down

0 comments on commit 2587970

Please sign in to comment.