Browse Source

New: Multianswer questions on Book with questions Game

MOODLE_20_STABLE
Vasilis Daloukas 10 years ago
parent
commit
8e66c259a3
  1. 2
      bookquiz/play.php
  2. 10
      locallib.php
  3. 4
      version.php

2
bookquiz/play.php

@ -343,7 +343,7 @@ function game_bookquiz_check_questions( $id, $game, $attempt, $bookquiz, $contex
continue; continue;
} }
$grade = $grades[ $question->id]; $grade = $grades[ $question->id];
if( $grade->grade < 0.5){ if( $grade->grade < 0.99){
continue; continue;
} }

10
locallib.php

@ -2014,16 +2014,22 @@ function game_grade_questions( $questions)
if( $id === false) if( $id === false)
continue; continue;
if( array_key_exists( $id, $grades))
$grade = $grades[ $id];
else
{
$grade = new stdClass(); $grade = new stdClass();
$grade->grade = 0;
$grade->id = $id; $grade->id = $id;
}
$grade->response = $value; $grade->response = $value;
$grade->grade = 0;
$question = $questions[ $id]; $question = $questions[ $id];
if( $question->qtype == 'multichoice') if( $question->qtype == 'multichoice')
{ {
$answer = $question->options->answers[ $value]; $answer = $question->options->answers[ $value];
$grade->grade = $answer->fraction; $grade->grade += $answer->fraction;
}else if( $question->qtype == 'shortanswer') }else if( $question->qtype == 'shortanswer')
{ {
foreach( $question->options->answers as $answerid => $answer) foreach( $question->options->answers as $answerid => $answer)

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 = 2015071403; // The current module version (Date: YYYYMMDDXX) $plugin->version = 2015071404; // 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.14.3'; $plugin->release = '3.30.14.4';
if( $useplugin != 2) if( $useplugin != 2)
$module = $plugin; $module = $plugin;

Loading…
Cancel
Save