Пример #1
0
function filltext($x)
{
    global $fill;
    if ($fill) {
        return html_safe(stripslashes($_POST[$x]));
    }
}
echo "<h2>" . _("Add Quiz Pages") . "</h2>";
if ($_SESSION['quiz_data']['lastpage'] == 'newquiz') {
    evalstart();
    echo "<p>" . _("Fill out the details for the first page in your quiz.") . "</p>\n";
} else {
    if (!evalpages()) {
        $fill = TRUE;
        echo "<p>" . _("This page ID is already taken:") . " '" . html_safe($_POST['page_id']) . "' ";
        echo _("Please choose a different one.") . "</p>\n";
    } else {
        $fill = FALSE;
    }
    echo "<p>" . sprintf(_("If you have entered all quiz pages, <a href='%s'>click here</a> to view the output."), "./output_quiz.php") . "</p>\n";
}
echo "<form method='post' action='./quiz_pages.php'>\n<p>";
echo _("Page ID:");
echo " <input type='text' name='page_id' size='10' value='" . filltext('page_id') . "'><br>";
echo _("This should be brief and not contain any spaces or special characters. For example, pqbasic5 or latex3.") . "</p>\n";
echo "<p>" . _("Page name/description:");
echo " <input type='text' name='page_name' size='40' value='" . filltext('page_name') . "'><br>";
echo _("HTML allowed. For example, &lt;b&gt;Page 5&lt;/b&gt;: Poetry, font size changes.") . "</p>\n";
echo "<p><input type='submit' value='" . _("send") . "'></p>\n</form>";
$_SESSION['quiz_data']['lastpage'] = 'quizpages';
// vim: sw=4 ts=4 expandtab
Пример #2
0
echo " " . sprintf($default_feedbacktext, $default_feedbackurl) . "</p>\n<hr>\n";
echo "<p>" . _("For very tricky errors you can prepare additional hints, which will not be shown before the user requests this by clicking a link. This feature was introduced because too many people couldn't find scannos like tbe and arid and answering all the forum messages got somewhat burdensome. :-)") . "</p>\n";
echo "<p>" . _("Introducing text for 1st hint:");
echo " <input type='text' name='linktext' size='100' value='" . filltext('linktext') . "'><br>\n";
echo _("HTML allowed. This field is optional. If you leave it empty the following default will appear:");
echo " {$default_hintlink}</p>\n";
echo "<p>" . _("Text of 1st hint:");
echo " <input type='text' name='hinttext' size='100' value='" . filltext('hinttext') . "'><br>\n";
echo _("HTML allowed. This field is optional. If you leave it empty there will be no hint for this type of error.") . "</p>\n<hr>\n";
echo "<p>" . _("You can even add another hint in case the user is still helpless.") . "</p>\n";
echo "<p>" . _("Introducing text for 2nd hint:");
echo " <input type='text' name='linktext2' size='100' value='" . filltext('linktext2') . "'><br>\n";
echo _("HTML allowed. This field is optional. If you leave it empty the following default will appear:");
echo " {$default_hintlink}</p>\n";
echo "<p>" . _("Text of 2nd hint:");
echo " <input type='text' name='hinttext2' size='100' value='" . filltext('hinttext2') . "'><br>\n";
echo _("HTML allowed. This field is optional. If you leave it empty there will be no 2nd hint for this type of error.") . "</p>\n";
echo "<p>" . _("Theoretically you can add more hints, but again you have to manually edit the final file for this.") . "</p>\n<hr>\n";
echo "<p>" . sprintf(_("If you want you can also provide a link to a relevant section of the guidelines.  If you choose one of these, a sentence such as this will appear: \"See the <a href='%s' target='_blank'>Page Headers/Page Footers</a> section of the Proofreading Guidelines for details.\" (with a different section name and \"Proofreading\" or \"Formatting\" as appropriate)."), "../../../faq/proofreading_guidelines.php#page_hf") . "</p>\n";
echo "<p>" . _("Proofreading Guidelines section:") . "<br>\n";
echo "<select size='1' name='P_guideline'>\n<option></option>\n";
$query = "SELECT count(*) AS numrules FROM rules";
$result = mysql_query($query);
$num_rules = mysql_result($result, 0, "numrules");
for ($i = 1; $i <= $num_rules; $i++) {
    $query = "SELECT anchor,subject FROM rules WHERE id = '{$i}' AND document = 'proofreading_guidelines.php'";
    $result = mysql_query($query);
    $rule = mysql_fetch_assoc($result);
    if ($rule != "") {
        echo "<option value='{$rule['anchor']}'>{$rule['subject']}</option>\n";
    }