From 4d354b6809b9a900883156b76e3380d4a83708e2 Mon Sep 17 00:00:00 2001 From: bdaloukas Date: Sun, 13 Aug 2017 16:46:21 +0300 Subject: [PATCH] Fix: Score on hangman with multiple words --- hangman/play.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hangman/play.php b/hangman/play.php index 4ffd60c..3328468 100644 --- a/hangman/play.php +++ b/hangman/play.php @@ -311,7 +311,7 @@ function game_hangman_play( $id, $game, $attempt, $hangman, $onlyshow, $showsolu echo "

".get_string( 'grade', 'game').' : '.round( $query->percent * 100).' %'; if ($hangman->maxtries > 1) { $percent = ($correct - $wrong / $max) / game_strlen( $query->answertext); - if( $done) { + if ($done) { $percent = 0; } $score = $hangman->corrects / $hangman->maxtries + $percent / $hangman->maxtries; @@ -483,7 +483,7 @@ function hangman_showpage(&$done, &$correct, &$wrong, $max, &$wordline, &$wordli } else { $score = -1; } - if( $hangman->maxtries > 0) { + if ($hangman->maxtries > 0) { $percent = ($correct - $wrong / $max) / game_strlen( $word); $score = $hangman->corrects / $hangman->maxtries + $percent / $hangman->maxtries; }