Merge branch 'MDL-27916' of git://github.com/timhunt/moodle

This commit is contained in:
Sam Hemelryk
2011-06-20 13:45:12 +08:00
4 changed files with 27 additions and 12 deletions
+16 -12
View File
@@ -49,6 +49,22 @@ class qbehaviour_adaptive extends question_behaviour_with_save {
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();
}
@@ -61,18 +77,6 @@ class qbehaviour_adaptive extends question_behaviour_with_save {
}
}
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);
@@ -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';
@@ -59,6 +59,15 @@ class qbehaviour_immediatefeedback extends question_behaviour_with_save {
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();
}
@@ -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';