Index: quiz.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/quiz/quiz.module,v
retrieving revision 1.138.2.9
diff -u -p -r1.138.2.9 quiz.module
--- quiz.module	29 Jun 2009 17:43:16 -0000	1.138.2.9
+++ quiz.module	7 Jul 2009 17:29:35 -0000
@@ -90,6 +90,8 @@ function quiz_perm() {
     'view user results', 'view own results',
     // Allow a quiz question to be viewed outside of a test.
     'view quiz question outside of a quiz',
+    // Allow someone to see the answers to a quiz question
+    'view solutions'
   );
 }
 
Index: question_types/matching/matching.classes.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/quiz/question_types/matching/matching.classes.inc,v
retrieving revision 1.2.2.6
diff -u -p -r1.2.2.6 matching.classes.inc
--- question_types/matching/matching.classes.inc	29 Jun 2009 17:46:58 -0000	1.2.2.6
+++ question_types/matching/matching.classes.inc	7 Jul 2009 17:29:35 -0000
@@ -89,11 +89,14 @@ class MatchingQuestion implements QuizQu
   // This is called whenever a question is rendered, either
   // to an administrator or to a quiz taker.
   public function getQuestionForm($node, $context = NULL) {
+    
+    $display_object = menu_get_object();
+        
     list($questions, $select_option) = $this->getQuestion($node);
     foreach ($questions as $question) {
       $form['tries[' . $question['match_id'] . ']'] = array(
         '#type' => 'select',
-        '#title' => $question['question'],
+        '#title' => ($display_object->type == 'quiz') ? $question['question'] : $question['question'] . ' (answer is \'' . $question['answer'] . '\')',
         '#options' => $this->customShuffle($select_option),
       );
     }
Index: question_types/multichoice/multichoice.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/quiz/question_types/multichoice/multichoice.module,v
retrieving revision 1.2.2.5
diff -u -p -r1.2.2.5 multichoice.module
--- question_types/multichoice/multichoice.module	3 Jul 2009 20:07:19 -0000	1.2.2.5
+++ question_types/multichoice/multichoice.module	7 Jul 2009 17:29:35 -0000
@@ -713,9 +713,12 @@ function multichoice_render_question_for
   else {
     $type = 'checkboxes';
   }
-
+  
+  $display_object = menu_get_object();
+  
   // Get options.
-  $options = array();
+  $options = array();  
+  
   $fake_answer_id = 0;
   while (list($key, $answer) = each($node->answers)) {
     if (empty($answer['correct']) && !isset($answer['answer']) && empty($answer['feedback'])) {
@@ -726,29 +729,31 @@ function multichoice_render_question_for
         // We are probably in a preview. Generate fake answer IDs. Later we will disabled submit, too.
         $answer['answer_id'] = ++$fake_answer_id;
       }
-      $options[$answer['answer_id']] = '<span class="multichoice_answer_text">'. check_markup($answer['answer'], $node->format, FALSE) .'</span>';
+      if ($display_object->type != 'quiz' && $answer['is_correct'] == 1) {
+        $options[$answer['answer_id']] = '<span class="multichoice_answer_correct">'. check_markup($answer['answer'], $node->format, FALSE) .' (correct answer)</span>';
+      }
+      else {
+        $options[$answer['answer_id']] = '<span class="multichoice_answer_text">'. check_markup($answer['answer'], $node->format, FALSE) .'</span>';        
+      }
     }
   }
 
   $form['question'] = array('#type' => 'markup', '#value' => check_markup($node->body, $node->format, FALSE));
-
+  
   // Create form.
-
+  
   $form['tries'] = array(
     '#type' => $type,
     '#options' => $options,
   );
 
-  // branch on view context
-  $display_object = menu_get_object();
-
   switch ($display_object->type) {
     case 'quiz':
       // Find out if there is already an answer (e.g. if Back has been clicked).
       // If there is an answer or answers, then put this into the $form['tries']
       // field.
       $rid = $_SESSION['quiz_' . $quiz->nid]['result_id'];
-      $answers = _multichoice_get_response_answers($node, $rid);
+      $answers = _multichoice_get_response_answers($node, $rid);      
       if (count($answers) > 0) {
         if ($type == 'radios') { // Only one for radio
           $form['tries']['#default_value'] = $answers[0];
@@ -779,9 +784,15 @@ function multichoice_render_question_for
        */
       break;
     default:
+      if (!user_access('view solutions')) {
+        $form['tries'] = array('#type' => 'markup', '#value' => 'You are now allowed to access question answers.');
+      }
+      break;
+      
+      
       // do nothing else
   }
-
+  
   if ($fake_answer_id > 0) {
     // This is not a real quiz question. It's just a preview.
     $form['submit']['#disabled'] = TRUE;
Index: question_types/quiz_question/quiz_question.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/quiz/question_types/quiz_question/quiz_question.module,v
retrieving revision 1.2.2.3
diff -u -p -r1.2.2.3 quiz_question.module
--- question_types/quiz_question/quiz_question.module	3 Jul 2009 20:07:19 -0000	1.2.2.3
+++ question_types/quiz_question/quiz_question.module	7 Jul 2009 17:29:35 -0000
@@ -204,8 +204,9 @@ function quiz_question_validate($node, &
  */
 function quiz_question_question_form($context, $node) {
   $form = _quiz_question_get_instance($node)->getQuestionForm($node, $context);
+  
   $display_object = menu_get_object();
-
+      
   switch ($display_object->type) {
     case 'quiz':
       $quiz = $display_object;
@@ -235,9 +236,23 @@ function quiz_question_question_form($co
 
       break;
     default:
+      if (!user_access('view solutions')) {
+        $place_holder = $form['question'];
+        
+        unset($form);
+        
+        $form_question = $place_holder;
+                
+        $form['tries'] = array(
+          '#type'  => 'markup',
+          '#value' => '<br /> You are now allowed to access question answers.'
+        );
+      }
+      break;
+      
       // nothing
   }
-
+  
   return $form;
 }
 
Index: question_types/quiz_question/quiz_question.truefalse.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/quiz/question_types/quiz_question/quiz_question.truefalse.inc,v
retrieving revision 1.2.2.3
diff -u -p -r1.2.2.3 quiz_question.truefalse.inc
--- question_types/quiz_question/quiz_question.truefalse.inc	26 Jun 2009 18:22:04 -0000	1.2.2.3
+++ question_types/quiz_question/quiz_question.truefalse.inc	7 Jul 2009 17:29:35 -0000
@@ -74,7 +74,9 @@ class TrueFalseQuestion implements QuizQ
   // to an administrator or to a quiz taker.
   public function getQuestionForm($node, $context = NULL) {
 
-    // Question first
+  $display_object = menu_get_object();
+  
+  // Question first
     $form['question'] = array(
       '#type' => 'markup',
       '#value' => $node->body
@@ -85,8 +87,8 @@ class TrueFalseQuestion implements QuizQ
       '#type' => 'radios',
       '#title' => t('Choose one'),
       '#options' => array(
-        1 => t('True'),
-        0 => t('False'),
+        1 => ($display_object->type == 'quiz' || $node->correct_answer == 0) ? t('True') : t('True (correct)'),
+        0 => ($display_object->type == 'quiz' || $node->correct_answer == 1) ? t('False') : t('False (correct)')
       ),
       //'#default_value' => 1,
       '#required' => TRUE,
Index: question_types/short_answer/short_answer.classes.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/quiz/question_types/short_answer/short_answer.classes.inc,v
retrieving revision 1.2.2.5
diff -u -p -r1.2.2.5 short_answer.classes.inc
--- question_types/short_answer/short_answer.classes.inc	29 Jun 2009 17:43:17 -0000	1.2.2.5
+++ question_types/short_answer/short_answer.classes.inc	7 Jul 2009 17:29:36 -0000
@@ -94,14 +94,17 @@ class ShortAnswerQuestion implements Qui
   // This is called whenever a question is rendered, either
   // to an administrator or to a quiz taker.
   public function getQuestionForm($node, $context = NULL) {
-    $form['question'] = array(
+    
+  $display_object = menu_get_object();
+
+  $form['question'] = array(
        '#type' => 'markup',
        '#value' => check_markup($node->body, $node->format),
      );
      $form['tries'] = array(
        '#type' => 'textfield',
        '#title' => t('Answer'),
-       '#description' => t('Enter your answer here'),
+       '#description' => ($display_object->type == 'quiz') ? t('Enter your answer here') : t('Correct answer is !answer', array('!answer' => $node->correct_answer)),
        '#default_value' => isset($context['tries']) ? $context['tries'] : '',
        '#size' => 60,
        '#maxlength' => 256,
