]> git.mjollnir.org Git - moodle.git/commitdiff
quiz editing: MDL-17398 cleaned up random question display in the edit subtab
authorpilpi <pilpi>
Fri, 28 Nov 2008 14:07:06 +0000 (14:07 +0000)
committerpilpi <pilpi>
Fri, 28 Nov 2008 14:07:06 +0000 (14:07 +0000)
made the link in an empty random question more readable, added a link to show category contents after the list of sample questions of a random question

lang/en_utf8/quiz.php
mod/quiz/editlib.php
theme/standard/styles_color.css

index f5bfc43abb0c1569b11a30f86e94f050cf6986dd..132d0f859684d55c5395b260d998b4137a5044d7 100644 (file)
@@ -26,7 +26,7 @@ $string['addingshortanswer'] = 'Adding a Short-Answer question';
 $string['addingtruefalse'] = 'Adding a True/False question';
 $string['addmoreoverallfeedbacks'] = 'Add {no} more feedback fields';
 $string['addnewpagesafterselected'] = 'Add new pages after selected questions';
-$string['addnewquestionsqbank'] = 'Add questions to the category $a->catname in the \'Question bank contents\' tool $a->arrow';
+$string['addnewquestionsqbank'] = 'Add questions to the category $a->catname: $a->link';
 $string['addpagehere'] = 'Add page here';
 $string['addquestion'] = 'Add question';
 $string['addquestions'] = 'Add questions';
@@ -630,6 +630,7 @@ $string['shortanswer'] = 'Short Answer';
 $string['show'] = 'Show';
 $string['showall'] = 'Show all questions on one page';
 $string['showbreaks'] = 'Show page breaks';
+$string['showcategorycontents'] = 'Show category contents $a->arrow';
 $string['showcorrectanswer'] = 'In feedback, show correct answers?';
 $string['showdetailedmarks'] = 'Show mark details';
 $string['showfeedback'] = 'After answering, show feedback?';
index b9fd42dd4c65b1911e0804d328facc2c8c1ad6e0..690dc6b16ca227c8f3d477336d9b1dd91c02d10e 100644 (file)
@@ -819,25 +819,30 @@ function quiz_print_randomquestion(&$question, &$pageurl, &$quiz,$quiz_qbanktool
     echo '<div class="randomquestionqlist">';
     $randomquestionlistsize=3;
     if(!$questioncount){
+        //No questions in category, give an error plus instructions
+        //error
         echo '<span class="error">';
         print_string("noquestionsnotinuse", "quiz");
+        echo '</span>';
         echo '<br />';
-        if(!$quiz_qbanktool){
-            echo '<a href="'.
-                $pageurl->out(false,array("qbanktool"=>1,
-                "cat"=>$category->id.','.$category->contextid)).
-                 '">';
-        }
+
+        //create link to open question bank
         $a = new stdClass;
-        $a->catname = '<strong>' . $category->name . '</strong>';
         $a->arrow = $THEME->rarrow;
+        $strshowcategorycontents=get_string('showcategorycontents','quiz', $a);
+        $linkcategorycontents=' <a href="'.
+            $pageurl->out(false,array("qbanktool"=>1,
+            "cat"=>$category->id.','.$category->contextid)).
+             '">'.$strshowcategorycontents.'</a>';
+
+        // embed the link into the string with instructions
+        $a = new stdClass;
+        $a->catname = '<strong>' . $category->name . '</strong>';
+        $a->link =  $linkcategorycontents;
         echo get_string('addnewquestionsqbank','quiz', $a);
-        if(!$quiz_qbanktool){
-            echo '</a>';
-        }
 
-        echo '</span>';
     }else{
+        //Category has questions, list a sample of them
         echo "<ul>";
         quiz_simple_question_list($pageurl, $question->category,
                 $randomquestionlistsize);
@@ -845,7 +850,16 @@ function quiz_print_randomquestion(&$question, &$pageurl, &$quiz,$quiz_qbanktool
         if ($questioncount>$randomquestionlistsize){
             echo "... ";
         }
+        
+        $a = new stdClass;
+        $a->arrow = $THEME->rarrow;
+        $strshowcategorycontents=get_string("showcategorycontents","quiz",$a);
         print_string("totalquestionsinrandomqcategory","quiz",$questioncount);
+
+        echo ' <a href="'.
+         $pageurl->out(false,array("qbanktool"=>1,"cat"=>$category->id.','.$category->contextid)).
+         '">'.$strshowcategorycontents.'</a>';
+        
         echo "</li>";
         echo "</ul>";
     }
index add490ee8861ef9a770dd46074ed095ec092d565..75498c912fde3e25bd658a03e223e717712671c0 100644 (file)
@@ -1130,7 +1130,9 @@ bank window's title is prominent enough*/
 }
 #mod-quiz-edit .questioncontentcontainer div.randomquestionqlist{
     background-color:#eee;
-    color:#777;
+}
+#mod-quiz-edit .questioncontentcontainer div.randomquestionqlist ul{
+    color:#555;
 }
 #mod-quiz-edit .questioncontentcontainer div.randomquestionqlist .totalquestionsinrandomqcategory{
     color:#000;