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. 14
      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;
}
$grade = $grades[ $question->id];
if( $grade->grade < 0.5){
if( $grade->grade < 0.99){
continue;
}

14
locallib.php

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

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

Loading…
Cancel
Save