diff --git a/hangman/play.php b/hangman/play.php
index d7bbac1..4ffd60c 100644
--- a/hangman/play.php
+++ b/hangman/play.php
@@ -311,7 +311,10 @@ 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);
- $score = $hangman->corrects / $hangman->maxtries + $percent / 100;
+ if( $done) {
+ $percent = 0;
+ }
+ $score = $hangman->corrects / $hangman->maxtries + $percent / $hangman->maxtries;
echo '
'.get_string( 'hangman_gradeinstance', 'game').' : '.
round( $score * 100).' %';
}
@@ -482,7 +485,7 @@ function hangman_showpage(&$done, &$correct, &$wrong, $max, &$wordline, &$wordli
}
if( $hangman->maxtries > 0) {
$percent = ($correct - $wrong / $max) / game_strlen( $word);
- $score = $hangman->corrects / $hangman->maxtries + $percent / 100;
+ $score = $hangman->corrects / $hangman->maxtries + $percent / $hangman->maxtries;
}
game_updateattempts( $game, $attempt, $score, $finished);
game_update_queries( $game, $attempt, $query, $score, $answer);
diff --git a/version.php b/version.php
index 1559abf..5794e3a 100644
--- a/version.php
+++ b/version.php
@@ -35,7 +35,7 @@ if (!isset( $plugin)) {
}
$plugin->component = 'mod_game'; // Full name of the plugin (used for diagnostics).
-$plugin->version = 2017081301; // The current module version (Date: YYYYMMDDXX).
+$plugin->version = 2017081302; // The current module version (Date: YYYYMMDDXX).
$plugin->requires = 2010112400; // Requires Moodle 2.0.
$plugin->cron = 0; // Period for cron to check this module (secs).
$plugin->release = '2017-08-13';