Removed hard-coded strings and fixed labels

This commit is contained in:
mark-nielsen
2006-09-19 03:47:49 +00:00
parent 63d4c906c7
commit f08769317f
3 changed files with 69 additions and 66 deletions
+2 -2
View 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";
+16 -11
View 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
@@ -43,10 +48,10 @@
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";
@@ -57,20 +62,20 @@
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");
+51 -53
View 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);
@@ -64,11 +69,11 @@
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";
@@ -79,11 +84,11 @@
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";
@@ -102,8 +107,8 @@
?>
<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>";
@@ -156,70 +161,66 @@
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);
@@ -231,19 +232,18 @@
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);
@@ -253,18 +253,17 @@
}
}
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);
@@ -272,18 +271,17 @@
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);