Skip to content

Commit

Permalink
Merge branch 'MDL-27916' of git://github.com/timhunt/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Jun 20, 2011
2 parents 1533a25 + 88ef9d0 commit 70e35c4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
28 changes: 16 additions & 12 deletions question/behaviour/adaptive/behaviour.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,22 @@ public function get_expected_data() {
return parent::get_expected_data();
}

public function get_state_string($showcorrectness) {
$laststep = $this->qa->get_last_step();
if ($laststep->has_behaviour_var('_try')) {
$state = question_state::graded_state_for_fraction(
$laststep->get_behaviour_var('_rawfraction'));
return $state->default_string(true);
}

$state = $this->qa->get_state();
if ($state == question_state::$todo) {
return get_string('notcomplete', 'qbehaviour_adaptive');
} else {
return parent::get_state_string($showcorrectness);
}
}

public function get_right_answer_summary() {
return $this->question->get_right_answer_summary();
}
Expand All @@ -61,18 +77,6 @@ public function adjust_display_options(question_display_options $options) {
}
}

public function get_state_string($showcorrectness) {
$state = $this->qa->get_state();

$laststep = $this->qa->get_last_step();
if ($laststep->has_behaviour_var('_try')) {
$state = question_state::graded_state_for_fraction(
$laststep->get_behaviour_var('_rawfraction'));
}

return $state->default_string($showcorrectness);
}

public function process_action(question_attempt_pending_step $pendingstep) {
if ($pendingstep->has_behaviour_var('comment')) {
return $this->process_comment($pendingstep);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@
$string['gradingdetails'] = 'Marks for this submission: {$a->raw}/{$a->max}.';
$string['gradingdetailsadjustment'] = 'With previous penalties this gives <strong>{$a->cur}/{$a->max}</strong>.';
$string['gradingdetailspenalty'] = 'This submission attracted a penalty of {$a}.';
$string['notcomplete'] = 'Not complete';
$string['pluginname'] = 'Adaptive mode';
9 changes: 9 additions & 0 deletions question/behaviour/immediatefeedback/behaviour.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ public function get_expected_data() {
return parent::get_expected_data();
}

public function get_state_string($showcorrectness) {
$state = $this->qa->get_state();
if ($state == question_state::$todo) {
return get_string('notcomplete', 'qbehaviour_immediatefeedback');
} else {
return parent::get_state_string($showcorrectness);
}
}

public function get_right_answer_summary() {
return $this->question->get_right_answer_summary();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

$string['notcomplete'] = 'Not complete';
$string['pluginname'] = 'Immediate feedback';

0 comments on commit 70e35c4

Please sign in to comment.