]> git.mjollnir.org Git - moodle.git/commitdiff
Removed hard-coded strings and fixed labels
authormark-nielsen <mark-nielsen>
Tue, 19 Sep 2006 03:47:49 +0000 (03:47 +0000)
committermark-nielsen <mark-nielsen>
Tue, 19 Sep 2006 03:47:49 +0000 (03:47 +0000)
mod/lesson/action/addbranchtable.php
mod/lesson/action/addpage.php
mod/lesson/action/editpage.php

index d4ce0b41906527aade317ad5adaf03a8f8b2992b..75dc20e0af884f2883315d8654590aff47a799e8 100644 (file)
@@ -44,8 +44,8 @@
     <input type="hidden" name="sesskey" value="<?PHP echo $USER->sesskey ?>" />
     <center><table class="generalbox" cellpadding=5 border=1>
     <tr valign="top">
-    <td><b><?php print_string("pagetitle", "lesson"); ?>:</b><br />
-    <label for="title" class="hidden-label"><?php print_string('pagetitle', 'lesson'); ?></label><input type="text" id="title" name="title" size="80" maxsize="255" value="" /></td></tr>
+    <td><b><label for="title"><?php print_string("pagetitle", "lesson"); ?>:</label></b><br />
+    <input type="text" id="title" name="title" size="80" maxsize="255" value="" /></td></tr>
     <?php
     echo "<tr><td><b>";
     echo get_string("pagecontents", "lesson").":</b><br />\n";
index 395204d054e89c37dfb21fb0d24409bf2db6351a..0ec6c61f75c0e4609db815e58d66b8d699bda8a4 100644 (file)
@@ -1,6 +1,11 @@
 <?php // $Id$
-
-/************** add page ************************************/
+/**
+ *  Action for adding a question page.  Prints an HTML form.
+ *
+ * @version $Id$
+ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
+ * @package lesson
+ **/
     $CFG->pagepath = 'mod/lesson/addpage';
     
     // first get the preceeding page
     print_heading_with_help(get_string("addaquestionpage", "lesson"), "overview", "lesson");
     ?>
     <form name="form" method="post" action="lesson.php">
-    <input type="hidden" name="id" value="<?PHP echo $cm->id ?>">
+    <input type="hidden" name="id" value="<?php echo $cm->id ?>">
     <input type="hidden" name="action" value="insertpage">
-    <input type="hidden" name="pageid" value="<?PHP echo $pageid ?>">
-    <input type="hidden" name="sesskey" value="<?PHP echo $USER->sesskey ?>">
+    <input type="hidden" name="pageid" value="<?php echo $pageid ?>">
+    <input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>">
     <center>
       <?php
         echo '<b>'.get_string("questiontype", "lesson").":</b> \n";
         if ( $qtype == LESSON_SHORTANSWER || $qtype == LESSON_MULTICHOICE ) {  // only display this option for Multichoice and shortanswer
             echo '<p>';
             if ($qtype == LESSON_SHORTANSWER) {
-                echo "<b>".get_string("casesensitive", "lesson").":</b> \n";
+                $qoptionstr = get_string('casesensitive', 'lesson');
             } else {
-                echo "<b>".get_string("multianswer", "lesson").":</b> \n";
+                $qoptionstr = get_string('multianswer', 'lesson');
             }
-            echo " <label for=\"qoption\" class=\"hidden-label\">Question Option</label><input type=\"checkbox\" id=\"qoption\" name=\"qoption\" value=\"1\"/>";
+            echo "<label for=\"qoption\"><strong>$qoptionstr</strong></label><input type=\"checkbox\" id=\"qoption\" name=\"qoption\" value=\"1\"/>";
             helpbutton("questionoption", get_string("questionoption", "lesson"), "lesson");
             echo '</p>';
         }
     ?>
     <table cellpadding="5" class="generalbox" border="1">
     <tr valign="top">
-    <td><b><?php print_string("pagetitle", "lesson"); ?>:</b><br />
-    <!-- hidden-label added --><label for="title" class="hidden-label">Title</label><input type="text" id="title" name="title" size="80" maxsize="255" value=""></td></tr>
-    <?PHP
+    <td><b><label for="title"><?php print_string("pagetitle", "lesson"); ?>:</label></b><br />
+    <input type="text" id="title" name="title" size="80" maxsize="255" value=""></td></tr>
+    <?php
     echo "<tr><td><b>";
     echo get_string("pagecontents", "lesson").":</b><br />\n";
     print_textarea($usehtmleditor, 25,70, 630, 400, "contents");
index 9344c1360a4d41479ee1761758819bc4d4f6b443..191186baee27e3aa5e828011f2dac0720693803d 100644 (file)
@@ -1,7 +1,12 @@
 <?php // $Id$
-
-/************** edit page ************************************/
-
+/**
+ *  Action for editing a page.  Prints an HTML form.
+ *
+ * @version $Id$
+ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
+ * @package lesson
+ **/
     // get the page
     $pageid = required_param('pageid', PARAM_INT);
     $redirect = optional_param('redirect', '', PARAM_ALPHA);
                 lesson_qtype_menu($LESSON_QUESTION_TYPE, $page->qtype, 
                                   "lesson.php?id=$cm->id&action=editpage&pageid=$page->id",
                                   "document.editpage.redisplay.value=1;document.editpage.submit();");
-                echo "<p><b>".get_string("multianswer", "lesson").":</b> \n";
+                echo "<p><b><label for=\"qoption\">".get_string('multianswer', 'lesson').":</label></b> \n";
                 if ($page->qoption) {
-                    echo "<label for=\"qoption\" class=\"hidden-label\">Question Option</label><input type=\"checkbox\" id=\"qoption\" name=\"qoption\" value=\"1\" checked=\"checked\"/>";
+                    echo "<input type=\"checkbox\" id=\"qoption\" name=\"qoption\" value=\"1\" checked=\"checked\" />";
                 } else {
-                    echo "<label for=\"qoption\" class=\"hidden-label\">Question Option</label><input type=\"checkbox\" id=\"qoption\" name=\"qoption\" value=\"1\"/>";
+                    echo "<input type=\"checkbox\" id=\"qoption\" name=\"qoption\" value=\"1\" />";
                 }
                 helpbutton("questionoption", get_string("questionoption", "lesson"), "lesson");
                 echo "</p>\n";
                 lesson_qtype_menu($LESSON_QUESTION_TYPE, $page->qtype, 
                                   "lesson.php?id=$cm->id&action=editpage&pageid=$page->id",
                                   "document.editpage.redisplay.value=1;document.editpage.submit();");
-                echo "<p><b>".get_string("casesensitive", "lesson").":</b> \n";
+                echo "<p><b><label for=\"qoption\">".get_string('casesensitive', 'lesson').":</label></b> \n";
                 if ($page->qoption) {
-                    echo "<label for=\"qoption\" class=\"hidden-label\">Question Option</label><input type=\"checkbox\" id=\"qoption\" name=\"qoption\" value=\"1\" checked=\"checked\"/>";
+                    echo "<input type=\"checkbox\" id=\"qoption\" name=\"qoption\" value=\"1\" checked=\"checked\" />";
                 } else {
-                    echo "<label for=\"qoption\" class=\"hidden-label\">Question Option</label><input type=\"checkbox\" id=\"qoption\" name=\"qoption\" value=\"1\"/>";
+                    echo "<input type=\"checkbox\" id=\"qoption\" name=\"qoption\" value=\"1\" />";
                 }
                 helpbutton("questionoption", get_string("questionoption", "lesson"), "lesson");
                 echo "</p>\n";
     ?>
     <table cellpadding="5" class="generalbox" border="1">
     <tr valign="top">
-    <td><b><?php print_string("pagetitle", "lesson"); ?>:</b><br />
-    <!-- hidden-label added.--><label for="title" class="hidden-label">Title</label><input type="text" id="title" name="title" size="80" maxsize="255" value="<?php p($page->title) ?>"></td>
+    <td><b><label for="title"><?php print_string('pagetitle', 'lesson'); ?>:</label></b><br />
+    <input type="text" id="title" name="title" size="80" maxsize="255" value="<?php p($page->title) ?>"></td>
     </tr>
     <?PHP
     echo "<tr><td><b>";
             switch ($page->qtype) {
                 case LESSON_MATCHING:
                     if ($n == 0) {
-                        echo "<tr><td><b>".get_string("correctresponse", "lesson").":</b>\n";
+                        echo "<tr><td><b><label for=\"edit-answer[$n]\">".get_string('correctresponse', 'lesson').":</label></b>\n";
                         if ($flags & LESSON_ANSWER_EDITOR) {
-                            echo " [".get_string("useeditor", "lesson").": ".
-                                "<label for=\"answereditor[$n]\" class=\"hidden-label\">answereditor[$n]</label><input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" 
-                                checked=\"checked\">";
+                            echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
+                                "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" checked=\"checked\" />";
                             helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
                             echo "]<br />\n";
                             print_textarea($usehtmleditor, 20, 70, 630, 300, "answer[$n]", $answer->answer);
                             use_html_editor("answer[$n]"); // switch on the editor
                         } else {
-                            echo " [".get_string("useeditor", "lesson").": ".
-                                "<label for=\"answereditor[$n]\" class=\"hidden-label\">answereditor[$n]</label><input type=\"checkbox\" id=\answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\">";
+                            echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
+                                "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" />";
                             helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
                             echo "]<br />\n";
                             print_textarea(false, 6, 70, 630, 300, "answer[$n]", $answer->answer);
                         }
                     } elseif ($n == 1) {
-                        echo "<tr><td><b>".get_string("wrongresponse", "lesson").":</b>\n";
+                        echo "<tr><td><b><label for=\"edit-answer[$n]\">".get_string('wrongresponse', 'lesson').":</label></b>\n";
                         if ($flags & LESSON_ANSWER_EDITOR) {
-                            echo " [".get_string("useeditor", "lesson").": ".
-                                "<label for=\"answereditor[$n]\" class=\"hidden-label\">answereditor[$n]</label><input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" 
-                                checked=\"checked\">";
+                            echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
+                                "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" checked=\"checked\" />";
                             helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
                             echo "]<br />\n";
                             print_textarea($usehtmleditor, 20, 70, 630, 300, "answer[$n]", $answer->answer);
                             use_html_editor("answer[$n]"); // switch on the editor
                         } else {
-                            echo " [".get_string("useeditor", "lesson").": ".
-                                "<label for=\"answereditor[$n]\" class=\"hidden-label\">answereditor[$n]</label><input type=\"checkbox\" id=\answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\">";
+                            echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
+                                "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" />";
                             helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
                             echo "]<br />\n";
                             print_textarea(false, 6, 70, 630, 300, "answer[$n]", $answer->answer);
                         }
                     } else {
                         $ncorrected = $n - 1;
-                        echo "<tr><td><b>".get_string("answer", "lesson")." $ncorrected:</b>\n";
+                        echo "<tr><td><b><label for=\"edit-answer[$n]\">".get_string('answer', 'lesson')." $ncorrected:</label></b>\n";
                         if ($flags & LESSON_ANSWER_EDITOR) {
-                            echo " [".get_string("useeditor", "lesson").": ".
-                                "<label for=\"answereditor[$n]\" class=\"hidden-label\">answereditor[$n]</label><input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" 
-                                checked=\"checked\">"; 
+                            echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
+                                "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" checked=\"checked\" />"; 
                             helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
                             echo "]<br />\n";
                             print_textarea($usehtmleditor, 20, 70, 630, 300, "answer[$n]", $answer->answer);
                             use_html_editor("answer[$n]"); // switch on the editor
                         } else {
-                            echo " [".get_string("useeditor", "lesson").": ".
-                                "<label for=\"answereditor[$n]\" class=\"hidden-label\">answereditor[$n]</label><input type=\"checkbox\" id=\answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\">";
+                            echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
+                                "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" />";
                             helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
                             echo "]<br />\n";
                             print_textarea(false, 6, 70, 630, 300, "answer[$n]", $answer->answer);
                         }
                         echo "</td></tr>\n";
-                        echo "<tr><td><b>".get_string("matchesanswer", "lesson")." $ncorrected:</b>\n";
+                        echo "<tr><td><b><label for=\"edit-response[$n]\">".get_string('matchesanswer', 'lesson')." $ncorrected:</label></b>\n";
                         if ($flags & LESSON_RESPONSE_EDITOR) {
-                            echo " [".get_string("useeditor", "lesson").": ".
-                                "<label for=\"responseeditor[$n]\" class=\"hidden-label\">responseeditor[$n]</label><input type=\"checkbox\" id=\"responseeditor[$n]\" name=\"responseeditor[$n]\" value=\"1\" 
-                                checked=\"checked\">";
+                            echo " [<label for=\"responseeditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
+                                "<input type=\"checkbox\" id=\"responseeditor[$n]\" name=\"responseeditor[$n]\" value=\"1\" checked=\"checked\" />";
                             helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
                             echo "]<br />\n";
                             print_textarea($usehtmleditor, 20, 70, 630, 300, "response[$n]", $answer->response);
                             use_html_editor("response[$n]"); // switch on the editor
                         } else {
-                            echo " [".get_string("useeditor", "lesson").": ".
-                                "<label for=\"responseeditor[$n]\" class=\"hidden-label\">responseeditor[$n]</label><input type=\"checkbox\" id=\"responseeditor[$n]\" name=\"responseeditor[$n]\" value=\"1\">";
+                            echo " [<label for=\"responseeditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
+                                "<input type=\"checkbox\" id=\"responseeditor[$n]\" name=\"responseeditor[$n]\" value=\"1\" />";
                             helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
                             echo "]<br />\n";
                             print_textarea(false, 6, 70, 630, 300, "response[$n]", $answer->response);
                 case LESSON_MULTICHOICE:
                 case LESSON_SHORTANSWER:
                 case LESSON_NUMERICAL:                    
-                    echo "<tr><td><b>".get_string("answer", "lesson")." $nplus1:</b>\n";
+                    echo "<tr><td><b><label for=\"edit-answer[$n]\">".get_string('answer', 'lesson')." $nplus1:</label></b>\n";
                     if ($flags & LESSON_ANSWER_EDITOR and $page->qtype != LESSON_SHORTANSWER and $page->qtype != LESSON_NUMERICAL) {
-                        echo " [".get_string("useeditor", "lesson").": ".
-                            "<label for=\"answereditor[$n]\" class=\"hidden-label\">answereditor[$n]</label><input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" 
-                            checked=\"checked\">";
+                        echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
+                            "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" checked=\"checked\" />";
                         helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
                         echo "]<br />\n";
                         print_textarea($usehtmleditor, 20, 70, 630, 300, "answer[$n]", $answer->answer);
                         use_html_editor("answer[$n]"); // switch on the editor
                     } else {
                         if ($page->qtype != LESSON_SHORTANSWER and $page->qtype != LESSON_NUMERICAL) {
-                            echo " [".get_string("useeditor", "lesson").": ".
-                                "<label for=\"answereditor[$n]\" class=\"hidden-label\">answereditor[$n]</label><input type=\"checkbox\" id=\answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\">"; //CDC hidden label.
+                            echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
+                                "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" />";
                             helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
                             echo "]<br />\n";
                             print_textarea(false, 6, 70, 630, 300, "answer[$n]", $answer->answer);
                         }
                     }
                     echo "</td></tr>\n";
-                    echo "<tr><td><b>".get_string("response", "lesson")." $nplus1:</b>\n";
+                    echo "<tr><td><b><label for=\"edit-response[$n]\">".get_string('response', 'lesson')." $nplus1:</label></b>\n";
                     if ($flags & LESSON_RESPONSE_EDITOR) {
-                        echo " [".get_string("useeditor", "lesson").": ".
-                            "<label for=\"responseeditor[$n]\" class=\"hidden-label\">responseeditor[$n]</label><input type=\"checkbox\" id=\"responseeditor[$n]\" name=\"responseeditor[$n]\" value=\"1\" 
-                            checked=\"checked\">";
+                        echo " [<label for=\"responseeditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
+                            "<input type=\"checkbox\" id=\"responseeditor[$n]\" name=\"responseeditor[$n]\" value=\"1\" checked=\"checked\" />";
                         helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
                         echo "]<br />\n";
                         print_textarea($usehtmleditor, 20, 70, 630, 300, "response[$n]", $answer->response);
                         use_html_editor("response[$n]"); // switch on the editor
                     } else {
-                        echo " [".get_string("useeditor", "lesson").": ".
-                            "<label for=\"responseeditor[$n]\" class=\"hidden-label\">responseeditor[$n]</label><input type=\"checkbox\" id=\"responseeditor[$n]\" name=\"responseeditor[$n]\" value=\"1\">";
+                        echo " [<label for=\"responseeditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
+                            "<input type=\"checkbox\" id=\"responseeditor[$n]\" name=\"responseeditor[$n]\" value=\"1\" />";
                         helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
                         echo "]<br />\n";
                         print_textarea(false, 6, 70, 630, 300, "response[$n]", $answer->response);
                     echo "</td></tr>\n";
                     break;
                 case LESSON_BRANCHTABLE:
-                    echo "<tr><td><b>".get_string("description", "lesson")." $nplus1:</b>\n";
+                    echo "<tr><td><b><label for=\"edit-answer[$n]\">".get_string("description", "lesson")." $nplus1:</label></b>\n";
                     if ($flags & LESSON_ANSWER_EDITOR) {
-                        echo " [".get_string("useeditor", "lesson").": ".
-                            "<label for=\"answereditor[$n]\" class=\"hidden-label\">answereditor[$n]</label><input type=\"checkbox\" name=\"answereditor[$n]\" value=\"1\" 
-                            checked=\"checked\">";
+                        echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
+                            "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" checked=\"checked\" />";
                         helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
                         echo "]<br />\n";
                         print_textarea($usehtmleditor, 20, 70, 630, 300, "answer[$n]", $answer->answer);
                         use_html_editor("answer[$n]"); // switch on the editor
                     } else {
-                        echo " [".get_string("useeditor", "lesson").": ".
-                            "<input type=\"checkbox\" name=\"answereditor[$n]\" value=\"1\">";
+                        echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
+                            "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" />";
                         helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
                         echo "]<br />\n";
                         print_textarea(false, 10, 70, 630, 300, "answer[$n]", $answer->answer);