WordPress.org

Support

Support » Plugins and Hacks » Football Pool » [Resolved] [Plugin: Football Pool] Shows bad points

[Resolved] [Plugin: Football Pool] Shows bad points

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author AntoineH

    @antoineh

    The users prediction page (e.g. /user/?user=1) does indeed always show the max points. That is a bug. I will try and fix it. Thanks for reporting it.

    Plugin Author AntoineH

    @antoineh

    Next update will contain a fix. If you don’t want to wait you can change the function print_bonus_question_for_user() in file classes/class-football-pool-pool.php to:

    public function print_bonus_question_for_user( $questions ) {
    		$output = '';
    		$nr = 1;
    		$statspage = Football_Pool::get_page_link( 'statistics' );
    
    		foreach ( $questions as $question ) {
    			if ( ! $this->bonus_is_editable( $question['questionDate'] ) ) {
    				$output .= '<div class="bonus userview">';
    				$output .= sprintf( '<p class="question">%d. %s</p>', $nr++, $question['question'] );
    				$output .= '<span class="bonus points">';
    				if ( $question['scoreDate'] ) {
    					// standard points or alternate points as reward for question?
    					$points = ( $question['userPoints'] != 0 ) ? $question['userPoints'] : $question['points'];
    					$output .= sprintf( '%d %s ',
    										( $question['correct'] * $points ),
    										__( 'punten', FOOTBALLPOOL_TEXT_DOMAIN )
    								);
    				}
    				$output .= sprintf( '<a title="%s" href="%s?view=bonusquestion&question=%d">',
    									__( 'bekijk antwoorden van andere spelers', FOOTBALLPOOL_TEXT_DOMAIN ), $statspage, $question['id'] );
    				$output .= sprintf( '<img alt="%s" src="%sassets/images/site/charts.png" />',
    									__( 'bekijk antwoorden van andere spelers', FOOTBALLPOOL_TEXT_DOMAIN ), FOOTBALLPOOL_PLUGIN_URL );
    				$output .= '</a></span>';
    				$output .= sprintf( '<p>%s: %s</p>',
    									__( 'antwoord', FOOTBALLPOOL_TEXT_DOMAIN ),
    									( $question['answer'] != '' ? $question['answer'] : '...' )
    							);
    				$output .= '</div>';
    			}
    		}
    
    		return $output;
    	}

    Ok – I changed the code and it works.
    And one more thing – would be nice to under answer the user you could see the correct answer.
    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] [Plugin: Football Pool] Shows bad points’ is closed to new replies.
Skip to toolbar