From 3fbfad16011322088d2d5630a75dda11037f37fb Mon Sep 17 00:00:00 2001 From: Vasilis Daloukas Date: Sun, 12 Jul 2015 15:27:27 +0300 Subject: [PATCH] Fix: Cryptex - Show grade while game continues --- locallib.php | 8 ++++++-- version.php | 4 ++-- view.php | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/locallib.php b/locallib.php index afe0b96..b169046 100755 --- a/locallib.php +++ b/locallib.php @@ -735,8 +735,12 @@ function game_questions_shortanswer_question_fraction( $table, $fields, $select) } // update grade item and send all grades to gradebook - game_grade_item_update( $game); - game_update_grades( $game); + $grades = new stdClass(); + $grades->userid = $USER->id; + $grades->rawgrade = game_score_to_grade($score, $game); + $grades->datesubmitted = time(); + game_grade_item_update( $game, $grades); + game_update_grades( $game, $grades->userid); } //Update table game_grades diff --git a/version.php b/version.php index 265f3e3..e43bbb1 100755 --- a/version.php +++ b/version.php @@ -22,10 +22,10 @@ if( !isset( $plugin)) $useplugin = 2; $plugin->component = 'mod_game'; // Full name of the plugin (used for diagnostics) -$plugin->version = 2015071202; // The current module version (Date: YYYYMMDDXX) +$plugin->version = 2015071203; // 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 = '3.30.12'; +$plugin->release = '3.30.12.3'; if( $useplugin != 2) $module = $plugin; diff --git a/view.php b/view.php index f2785a3..7f7a1bf 100755 --- a/view.php +++ b/view.php @@ -208,7 +208,7 @@ $attemptgrade = game_score_to_grade($attempt->score, $game); if ($gradecolumn) { - if ($attemptoptions->scores && $attempt->timefinish > 0) { + if ($attemptoptions->scores) { $formattedgrade = game_format_grade($game, $attemptgrade); // highlight the highest grade if appropriate if ($overallstats && !$attempt->preview && $numattempts > 1 && !is_null($mygrade) &&