]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14352 - General feedback for descriptions not showing up on the review page,...
authortjhunt <tjhunt>
Tue, 22 Apr 2008 16:17:01 +0000 (16:17 +0000)
committertjhunt <tjhunt>
Tue, 22 Apr 2008 16:17:01 +0000 (16:17 +0000)
lang/en_utf8/help/quiz/description.html
question/type/description/question.html
question/type/description/questiontype.php
theme/standard/styles_layout.css

index d3f530ac94189603b081ab015cd4e6bace7e5a9e..5da94aeb6ff120ec7a60a61070a12154801ca845 100644 (file)
@@ -1,14 +1,11 @@
 <h1>Description</h1>
 
-
-
 <p>This type of question is not really a question.  </p>
 
-
-
 <p>All it does is print some text without requiring any answers.</p>
 
-
-
 <p>It can be used to print a descriptive text to be used by a following group of questions.</p>
 
+<p>The General feedback can be used if you have some text that you want to appear on the review
+page only. The 'Question text' appears both during the attempt and on the review page.</p>
\ No newline at end of file
index 71d7dc58ee4df478da633b5ebe001219db4efb0e..6353f5ad0c4d91c07c6d4d9eb7d617d1e519703e 100644 (file)
@@ -11,4 +11,9 @@
       <img class="qimage" src="<?php echo $image; ?>" alt="" />
     <?php } ?>
   </div>
+  <?php if ($generalfeedback) { ?>
+    <div class="generalfeedback">
+      <?php echo $generalfeedback ?>
+    </div>
+  <?php } ?>
 </div>
index 0ac008c493c61e261152bc70362b1dd539525485..85ec40dce8dc1d67d039288b1fc6d7f6e70f5cc2 100644 (file)
@@ -43,6 +43,7 @@ class description_qtype extends default_questiontype {
 
     function print_question(&$question, &$state, $number, $cmoptions, $options) {
         global $CFG;
+        $isfinished = question_state_is_graded($state->last_graded) || $state->event == QUESTION_EVENTCLOSE;
 
         if (!empty($cmoptions->id)) {
             $cm = get_coursemodule_from_instance('quiz', $cmoptions->id);
@@ -65,6 +66,12 @@ class description_qtype extends default_questiontype {
         $questiontext = $this->format_text($question->questiontext, $question->questiontextformat, $cmoptions);
         $image = get_question_image($question);
 
+        $generalfeedback = '';
+        if ($isfinished && $options->generalfeedback) {
+            $generalfeedback = $this->format_text($question->generalfeedback,
+                    $question->questiontextformat, $cmoptions);
+        }
+
         include "$CFG->dirroot/question/type/description/question.html";
     }
 
index 89708702ba8f10cfb15d4964654f07c93b5b8c72..8b7fd2c48e458b189e2f5d8776083edd0dccf80a 100644 (file)
@@ -2582,11 +2582,16 @@ body.notes .notesgroup {
 .que.description .info {
   display: none;
 }
-.que.description .content {
+.que.description .content,
+.que.description .generalfeedback {
   margin-left: 1.2em;
+  margin-bottom: 0.5em;
   float: none;
   width: auto;
 }
+.que.description .qtext {
+  margin-bottom: 0;
+}
 .que .qtext {
   margin-bottom: 1.5em;
 }