Browse Source

Fix: Cryptex - Show grade while game continues

MOODLE_20_STABLE
Vasilis Daloukas 10 years ago
parent
commit
3fbfad1601
  1. 8
      locallib.php
  2. 4
      version.php
  3. 2
      view.php

8
locallib.php

@ -735,8 +735,12 @@ function game_questions_shortanswer_question_fraction( $table, $fields, $select)
} }
// update grade item and send all grades to gradebook // update grade item and send all grades to gradebook
game_grade_item_update( $game); $grades = new stdClass();
game_update_grades( $game); $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 //Update table game_grades

4
version.php

@ -22,10 +22,10 @@ if( !isset( $plugin))
$useplugin = 2; $useplugin = 2;
$plugin->component = 'mod_game'; // Full name of the plugin (used for diagnostics) $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->requires = 2010112400; // Requires Moodle 2.0
$plugin->cron = 0; // Period for cron to check this module (secs) $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) if( $useplugin != 2)
$module = $plugin; $module = $plugin;

2
view.php

@ -208,7 +208,7 @@
$attemptgrade = game_score_to_grade($attempt->score, $game); $attemptgrade = game_score_to_grade($attempt->score, $game);
if ($gradecolumn) { if ($gradecolumn) {
if ($attemptoptions->scores && $attempt->timefinish > 0) { if ($attemptoptions->scores) {
$formattedgrade = game_format_grade($game, $attemptgrade); $formattedgrade = game_format_grade($game, $attemptgrade);
// highlight the highest grade if appropriate // highlight the highest grade if appropriate
if ($overallstats && !$attempt->preview && $numattempts > 1 && !is_null($mygrade) && if ($overallstats && !$attempt->preview && $numattempts > 1 && !is_null($mygrade) &&

Loading…
Cancel
Save