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

    (@antoineh)

    Sorry, not sure what you mean.

    Thread Starter friendlydesign

    (@friendlydesign)

    Sorry, my English is not very good.

    After validation of the scores, the points obtained by the user appears next to the icon of statistical graphics. I would do the same for the number of points obtained by the user for bonus questions.

    (perhaps in page “class-football-pool-pool.php”)

    ex :

    Feb 20, 2016
    18:00 Team 1 2 – 0 Team 2 3 (here icon graphics)

    Bonus Question 1

    Answer : …

    Closed 2016-02-20 17:00 3 Pts(value in admin) + Points real !

    Plugin Author AntoineH

    (@antoineh)

    I’m on holiday right now. I’ll check it when I get home (next week).

    Thread Starter friendlydesign

    (@friendlydesign)

    Ok thanks !

    Thread Starter friendlydesign

    (@friendlydesign)

    Hello,

    May I ask if you have had time to see my question?

    thanks in advance !

    Plugin Author AntoineH

    (@antoineh)

    Hi,

    Unfortunately this is not something that can be changed via a hook. So this means you’ll have to edit one of the plugin’s file. If you do an update in the future, you’ll have to redo the changes.

    The changes must be done in “classes\class-football-pool-pool.php”. Look for the line that reads:

    $points = $question['points'] == 0 ? __( 'variable', FOOTBALLPOOL_TEXT_DOMAIN ) : $question['points'];

    Add the following code below that line:

    if ( $question['score_date'] ) {
    	if ( $question['correct'] ) {
    		if ( $question['user_points'] != 0 ) {
    			$points_scored = $question['user_points'];
    		} else {
    			$points_scored = $points;
    		}
    	} else {
    		$points_scored = 0;
    	}
    	$points_scored = sprintf( ' (%s points scored)', $points_scored );
    } else {
    	$points_scored = '';
    }

    (ofcourse you can change the text to whatever you want)

    And then below the line that reads:

    $output .= sprintf( '<span class="bonus points">%s %s'
    					, $points
    					, __( 'points', FOOTBALLPOOL_TEXT_DOMAIN )
    			);

    Add this line:

    $output .= $user_points;

    I didn’t test this thoroughly, so I may have missed a certain scenario, but it shows how it should be done and should give you a start.

    Thread Starter friendlydesign

    (@friendlydesign)

    Thx u very much !!!!

    But the last line is :

    $output .= $points_scored;

    not

    $output .= $user_points;

    U are the best !

    Thx for this plugin !!!!!!!

    Thread Starter friendlydesign

    (@friendlydesign)

    Last question… perhaps ??

    How display total score by user for one match ?

    Thx !

    Plugin Author AntoineH

    (@antoineh)

    Total score for one match? Please explain. I don’t think I understand correctly what you want.

    Thread Starter friendlydesign

    (@friendlydesign)

    Total score = points prediction + points bonus questions by user by match

    Ex : match 1, user “toto” : 8 pts prediction (score correct) + 4 pts question bonus = 12 pts total score for toto in match 1 (in array shortcode or on page “classes\class-football-pool-pool.php”.

    Thx !!!!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Display Bonus question Points’ is closed to new replies.