Merge branch 'backup_bump' of git://github.com/stronk7/moodle
authorSam Hemelryk <sam@moodle.com>
Mon, 27 Jun 2011 07:28:49 +0000 (15:28 +0800)
committerSam Hemelryk <sam@moodle.com>
Mon, 27 Jun 2011 07:28:49 +0000 (15:28 +0800)
mod/lesson/lang/en/lesson.php
mod/lesson/locallib.php
question/behaviour/adaptive/renderer.php
question/behaviour/adaptive/simpletest/testwalkthrough.php

index 4a2a3b1..abc853a 100644 (file)
@@ -34,7 +34,7 @@ $string['actionaftercorrectanswer_help'] = 'After answering a question correctly
 $string['actions'] = 'Actions';
 $string['activitylink'] = 'Link to an activity';
 $string['activitylink_help'] = 'To provide a link at the end of the lesson to another activity in the course, select the activity from the dropdown list.';
-$string['activitylinkname'] = 'Go to: {$a}';
+$string['activitylinkname'] = 'Go to {$a}';
 $string['addabranchtable'] = 'Add a content page';
 $string['addanendofbranch'] = 'Add an end of branch';
 $string['addanewpage'] = 'Add a new page';
index b4fb01e..84a8661 100644 (file)
@@ -1280,7 +1280,7 @@ class lesson extends lesson_base {
                 $instancename = $DB->get_field($modname, 'name', array('id' => $module->instance));
                 if ($instancename) {
                     return html_writer::link(new moodle_url('/mod/'.$modname.'/view.php', array('id'=>$this->properties->activitylink)),
-                        get_string('returnto', 'lesson', get_string('activitylinkname', 'lesson', $instancename)),
+                        get_string('activitylinkname', 'lesson', $instancename),
                         array('class'=>'centerpadded lessonbutton standardbutton'));
                 }
             }
index f9faf30..da1a632 100644 (file)
@@ -77,7 +77,7 @@ class qbehaviour_adaptive_renderer extends qbehaviour_renderer {
 
         $gradingdetails = get_string('gradingdetails', 'qbehaviour_adaptive', $mark);
 
-        $gradingdetails .= $this->penalty_info($qa, $mark);
+        $gradingdetails .= $this->penalty_info($qa, $mark, $options);
 
         $output = '';
         $output .= html_writer::tag('div', get_string($class, 'question'),
@@ -87,7 +87,14 @@ class qbehaviour_adaptive_renderer extends qbehaviour_renderer {
         return $output;
     }
 
-    protected function penalty_info($qa, $mark) {
+    /**
+     * Display the information about the penalty calculations.
+     * @param question_attempt $qa the question attempt.
+     * @param object $mark contains information about the current mark.
+     * @param question_display_options $options display options.
+     */
+    protected function penalty_info(question_attempt $qa, $mark,
+            question_display_options $options) {
         if (!$qa->get_question()->penalty) {
             return '';
         }
@@ -102,7 +109,7 @@ class qbehaviour_adaptive_renderer extends qbehaviour_renderer {
         // penalty is relevant only if the answer is not correct and further attempts are possible
         if (!$qa->get_state()->is_finished()) {
             $output .= ' ' . get_string('gradingdetailspenalty', 'qbehaviour_adaptive',
-                    $qa->get_question()->penalty);
+                    format_float($qa->get_question()->penalty, $options->markdp));
         }
 
         return $output;
index 88fd82c..26eb641 100644 (file)
@@ -101,7 +101,10 @@ class qbehaviour_adaptive_walkthrough_test extends qbehaviour_walkthrough_test_b
                 $this->get_contains_mc_radio_expectation($rightindex, true, true),
                 $this->get_contains_mc_radio_expectation(($rightindex + 1) % 3, true, false),
                 $this->get_contains_mc_radio_expectation(($rightindex + 2) % 3, true, false),
-                $this->get_contains_correct_expectation());
+                $this->get_contains_correct_expectation(),
+                new PatternExpectation('/' . preg_quote(
+                        get_string('gradingdetailspenalty', 'qbehaviour_adaptive',
+                            format_float($mc->penalty, $this->displayoptions->markdp))) . '/'));
         $this->assertEqual('A',
                 $this->quba->get_response_summary($this->slot));