fixed capitalization and quoting of attribute values

This commit is contained in:
gustav_delius 2004-09-12 17:34:35 +00:00
parent 41905731b7
commit d1290cec39
121 changed files with 1401 additions and 1401 deletions

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
// This page prints a particular instance of quiz // This page prints a particular instance of quiz
@ -58,8 +58,8 @@
$strquiz = get_string("modulename", "quiz"); $strquiz = get_string("modulename", "quiz");
print_header_simple("$quiz->name", "", print_header_simple("$quiz->name", "",
"<A HREF=index.php?id=$course->id>$strquizzes</A> -> "<a href=\"index.php?id=$course->id\">$strquizzes</a> ->
<A HREF=\"view.php?id=$cm->id\">$quiz->name</A> -> $strattemptnum", <a href=\"view.php?id=$cm->id\">$quiz->name</a> -> $strattemptnum",
"", "", true); "", "", true);
echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>'; // for overlib echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>'; // for overlib

View file

@ -1,4 +1,4 @@
<?PHP //$Id$ <?php //$Id$
//This php script contains all the stuff to backup/restore //This php script contains all the stuff to backup/restore
//quiz mods //quiz mods

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
// Allows a teacher to create, edit and delete categories // Allows a teacher to create, edit and delete categories
require_once("../../config.php"); require_once("../../config.php");
@ -40,7 +40,7 @@
$streditcategories = get_string("editcategories", "quiz"); $streditcategories = get_string("editcategories", "quiz");
print_header_simple("$streditcategories", " $streditcategories", print_header_simple("$streditcategories", " $streditcategories",
"<A HREF=\"edit.php\">$streditingquiz</A> -> $streditcategories"); "<a href=\"edit.php\">$streditingquiz</a> -> $streditcategories");
/// Delete category if the user wants to delete it /// Delete category if the user wants to delete it
@ -65,13 +65,13 @@
print_simple_box(get_string("categorymove", "quiz", $vars), "CENTER"); print_simple_box(get_string("categorymove", "quiz", $vars), "CENTER");
$categories = quiz_get_category_menu($course->id); $categories = quiz_get_category_menu($course->id);
unset($categories[$category->id]); unset($categories[$category->id]);
echo "<CENTER><P><FORM ACTION=category.php METHOD=get>"; echo "<center><p><form action=\"category.php\" method=\"get\">";
echo "<INPUT TYPE=hidden NAME=id VALUE=\"$course->id\" />"; echo "<input type=\"hidden\" name=\"id\" value=\"$course->id\" />";
echo "<INPUT TYPE=hidden NAME=delete VALUE=\"$category->id\" />"; echo "<input type=\"hidden\" name=\"delete\" value=\"$category->id\" />";
choose_from_menu($categories, "confirm", "", ""); choose_from_menu($categories, "confirm", "", "");
echo "<INPUT TYPE=submit VALUE=\"".get_string("categorymoveto", "quiz")."\" />"; echo "<input type=\"submit\" value=\"".get_string("categorymoveto", "quiz")."\" />";
echo "<INPUT TYPE=submit NAME=cancel VALUE=\"$strcancel\" />"; echo "<input type=\"submit\" name=\"cancel\" value=\"$strcancel\" />";
echo "</FORM></P></CENTER>"; echo "</form></p></center>";
print_footer($course); print_footer($course);
exit; exit;
} }
@ -82,10 +82,10 @@
/// Print heading /// Print heading
echo "<P ALIGN=CENTER><FONT SIZE=3>"; echo "<p align=\"center\"><font size=\"3\">";
echo $streditcategories; echo $streditcategories;
helpbutton("categories", $streditcategories, "quiz"); helpbutton("categories", $streditcategories, "quiz");
echo "</FONT></P>"; echo "</font></p>";
/// If data submitted, then process and store. /// If data submitted, then process and store.
@ -151,31 +151,31 @@
$table->width = 200; $table->width = 200;
$table->nowrap = true; $table->nowrap = true;
echo "<FORM ACTION=category.php METHOD=post>"; echo "<form action=\"category.php\" method=\"post\">";
foreach ($categories as $category) { foreach ($categories as $category) {
$count = count_records("quiz_questions", "category", $category->id); $count = count_records("quiz_questions", "category", $category->id);
if ($category->id == $default) { if ($category->id == $default) {
$delete = ""; // Can't delete default category $delete = ""; // Can't delete default category
} else { } else {
$delete = "<A HREF=\"category.php?id=$course->id&delete=$category->id\">$strdelete</A>"; $delete = "<a href=\"category.php?id=$course->id&delete=$category->id\">$strdelete</a>";
} }
$table->data[] = array ("<INPUT TYPE=text NAME=\"c$category->id\" VALUE=\"$category->name\" SIZE=15 />", $table->data[] = array ("<input type=\"text\" name=\"c$category->id\" value=\"$category->name\" size=\"15\" />",
"<INPUT TYPE=text NAME=\"i$category->id\" VALUE=\"$category->info\" SIZE=50 />", "<input type=\"text\" name=\"i$category->id\" value=\"$category->info\" size=\"50\" />",
choose_from_menu ($publishoptions, "p$category->id", "$category->publish", "", "", "", true), choose_from_menu ($publishoptions, "p$category->id", "$category->publish", "", "", "", true),
"$count", "$count",
$delete); $delete);
} }
$table->data[] = array ("<INPUT TYPE=text NAME=\"new\" VALUE=\"\" SIZE=15 />", $table->data[] = array ("<input type=\"text\" name=\"new\" value=\"\" size=\"15\" />",
"<INPUT TYPE=text NAME=\"newinfo\" VALUE=\"\" SIZE=50 />", "<input type=\"text\" name=\"newinfo\" value=\"\" size=\"50\" />",
choose_from_menu ($publishoptions, "newpublish", "", "", "", "", true), choose_from_menu ($publishoptions, "newpublish", "", "", "", "", true),
"", "",
"$stradd"); "$stradd");
print_table($table); print_table($table);
echo "<INPUT TYPE=hidden NAME=id VALUE=\"$course->id\" />"; echo "<input type=\"hidden\" name=\"id\" value=\"$course->id\" />";
echo "<CENTER><BR><INPUT TYPE=submit VALUE=\"$strsavechanges\" /> "; echo "<center><br><input type=\"submit\" value=\"$strsavechanges\" /> ";
echo "<BR><BR><INPUT TYPE=submit NAME=backtoquiz VALUE=\"$strbacktoquiz\" /> "; echo "<br><br><input type=\"submit\" name=\"backtoquiz\" value=\"$strbacktoquiz\" /> ";
echo "</CENTER>"; echo "</center>";
echo "</FORM>"; echo "</form>";
print_footer(); print_footer();

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
function quiz_upgrade($oldversion) { function quiz_upgrade($oldversion) {
// This function does anything necessary to upgrade // This function does anything necessary to upgrade

View file

@ -1,4 +1,4 @@
<?PHP <?php
function quiz_upgrade($oldversion) { function quiz_upgrade($oldversion) {
// This function does anything necessary to upgrade // This function does anything necessary to upgrade

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
function quiz_upgrade($oldversion) { function quiz_upgrade($oldversion) {
// This function does anything necessary to upgrade // This function does anything necessary to upgrade

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
require_once("../../config.php"); require_once("../../config.php");
require_once("lib.php"); require_once("lib.php");

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
// Import quiz questions into the given category // Import quiz questions into the given category
require_once("../../config.php"); require_once("../../config.php");
@ -89,15 +89,15 @@
print_simple_box_start("center", "", "$THEME->cellheading"); print_simple_box_start("center", "", "$THEME->cellheading");
echo "<form enctype=\"multipart/form-data\" method=\"post\" action=\"export.php\">"; echo "<form enctype=\"multipart/form-data\" method=\"post\" action=\"export.php\">";
echo "<table cellpadding=5>"; echo "<table cellpadding=\"5\">";
echo "<tr><td align=right>"; echo "<tr><td align=\"right\">";
print_string("category", "quiz"); print_string("category", "quiz");
echo ":</td><td>"; echo ":</td><td>";
choose_from_menu($categories, "category", "$category->id", ""); choose_from_menu($categories, "category", "$category->id", "");
echo "</tr>"; echo "</tr>";
echo "<tr><td align=right>"; echo "<tr><td align=\"right\">";
print_string("fileformat", "quiz"); print_string("fileformat", "quiz");
echo ":</td><td>"; echo ":</td><td>";
choose_from_menu($fileformatnames, "format", "gift", ""); choose_from_menu($fileformatnames, "format", "gift", "");
@ -111,8 +111,8 @@
echo "</td></tr>"; echo "</td></tr>";
echo "<tr><td align=\"center\" colspan=\"2\">"; echo "<tr><td align=\"center\" colspan=\"2\">";
echo " <input type=hidden name=category value=\"$category->id\" />"; echo " <input type=\"hidden\" name=\"category\" value=\"$category->id\" />";
echo " <input type=submit name=save value=\"".get_string("exportquestions","quiz")."\" />"; echo " <input type=\"submit\" name=\"save\" value=\"".get_string("exportquestions","quiz")."\" />";
echo "</td></tr>"; echo "</td></tr>";
echo "</table>"; echo "</table>";

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
/// format.php - Default format class for file imports/exports. // /// format.php - Default format class for file imports/exports. //

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
/// ///
/// Written by Tom Robb <tom@robb.net> 2 November 2003 /// Written by Tom Robb <tom@robb.net> 2 November 2003

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
/// Academy of Nursing format /// Academy of Nursing format
@ -38,7 +38,7 @@ class quiz_file_format extends quiz_default_format {
$answerstart = strpos($text, "{"); $answerstart = strpos($text, "{");
if ($answerstart === false) { if ($answerstart === false) {
if ($this->displayerrors) { if ($this->displayerrors) {
echo "<P>$text<P>Could not find a {"; echo "<p>$text<p>Could not find a {";
} }
return false; return false;
} }
@ -46,7 +46,7 @@ class quiz_file_format extends quiz_default_format {
$answerfinish = strpos($text, "}"); $answerfinish = strpos($text, "}");
if ($answerfinish === false) { if ($answerfinish === false) {
if ($this->displayerrors) { if ($this->displayerrors) {
echo "<P>$text<P>Could not find a }"; echo "<p>$text<p>Could not find a }";
} }
return false; return false;
} }
@ -67,7 +67,7 @@ class quiz_file_format extends quiz_default_format {
switch ($countanswers) { switch ($countanswers) {
case 0: // invalid question case 0: // invalid question
if ($this->displayerrors) { if ($this->displayerrors) {
echo "<P>No answers found in $answertext"; echo "<p>No answers found in $answertext";
} }
return false; return false;

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
/// Blackboard 6.0 Format /// Blackboard 6.0 Format
/// ///

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
/// Class for importing course test manager questions. // /// Class for importing course test manager questions. //
/// // /// //
@ -51,25 +51,25 @@ class quiz_file_format {
print_simple_box_start("center", "", "$THEME->cellheading"); print_simple_box_start("center", "", "$THEME->cellheading");
if ($hostname_access_error) { notify("couldn't connect to ODBC Socket Server on " . $hostname_access_error); } if ($hostname_access_error) { notify("couldn't connect to ODBC Socket Server on " . $hostname_access_error); }
echo "<form method=\"post\" action=\"import.php\">"; echo "<form method=\"post\" action=\"import.php\">";
echo "<table cellpadding=5>"; echo "<table cellpadding=\"5\">";
echo "<tr><td align=right>"; echo "<tr><td align=\"right\">";
echo "What is the hostname or IP address of the ODBC Socket Server:</td><td>"; echo "What is the hostname or IP address of the ODBC Socket Server:</td><td>";
echo " <input name=\"hostname\" type=\"text\" size=\"50\" value=\"".stripslashes($hostname_access_error)."\" />"; echo " <input name=\"hostname\" type=\"text\" size=\"50\" value=\"".stripslashes($hostname_access_error)."\" />";
echo " <input name=\"filename\" type=\"hidden\" value=\"".$filename."\" />"; echo " <input name=\"filename\" type=\"hidden\" value=\"".$filename."\" />";
echo " <input name=\"category\" type=\"hidden\" value=\"".$category->id."\" />"; echo " <input name=\"category\" type=\"hidden\" value=\"".$category->id."\" />";
echo " <input name=\"format\" type=\"hidden\" value=\"".$form->format."\" />"; echo " <input name=\"format\" type=\"hidden\" value=\"".$form->format."\" />";
echo "</td><td>&nbsp;</td></tr>"; echo "</td><td>&nbsp;</td></tr>";
echo "<tr><td align=right>"; echo "<tr><td align=\"right\">";
echo "What is the location of the database (.mdb file) on the Socket Server:</td><td>"; echo "What is the location of the database (.mdb file) on the Socket Server:</td><td>";
echo " <input name=\"mdbpath\" type=\"text\" size=\"50\" value=\"".stripslashes($mdbpath)."\" />"; echo " <input name=\"mdbpath\" type=\"text\" size=\"50\" value=\"".stripslashes($mdbpath)."\" />";
echo "</td><td>&nbsp;</td></tr>"; echo "</td><td>&nbsp;</td></tr>";
echo "<tr><td align=right>"; echo "<tr><td align=\"right\">";
echo "What is the location of the system database (System.mda file) on the Socket Server:</td><td>"; echo "What is the location of the system database (System.mda file) on the Socket Server:</td><td>";
echo " <input name=\"mdapath\" type=\"text\" size=\"50\" value=\"".stripslashes($mdapath)."\" />"; echo " <input name=\"mdapath\" type=\"text\" size=\"50\" value=\"".stripslashes($mdapath)."\" />";
echo "</td><td>&nbsp;</td></tr>"; echo "</td><td>&nbsp;</td></tr>";
echo "<tr><td>&nbsp;</td><td>"; echo "<tr><td>&nbsp;</td><td>";
echo " <input type=submit name=save value=\"Connect to Server\" />"; echo " <input type=\"submit\" name=\"save\" value=\"Connect to Server\" />";
echo "</td></tr>"; echo "</td></tr>";
echo "</table>"; echo "</table>";
echo "</form>"; echo "</form>";
@ -112,8 +112,8 @@ class quiz_file_format {
print_heading_with_help($strimportquestions, "import", "quiz"); print_heading_with_help($strimportquestions, "import", "quiz");
print_simple_box_start("center", "", "$THEME->cellheading"); print_simple_box_start("center", "", "$THEME->cellheading");
echo "<form method=\"post\" action=\"import.php\">"; echo "<form method=\"post\" action=\"import.php\">";
echo "<table cellpadding=5>"; echo "<table cellpadding=\"5\">";
echo "<tr><td align=right>"; echo "<tr><td align=\"right\">";
echo "Choose a category of questions to import:</td><td>"; echo "Choose a category of questions to import:</td><td>";
asort($question_categories); asort($question_categories);
choose_from_menu($question_categories, "question_category","All Categories","All Categories", "", "allcategories"); choose_from_menu($question_categories, "question_category","All Categories","All Categories", "", "allcategories");
@ -127,7 +127,7 @@ class quiz_file_format {
} }
echo "</td><td>&nbsp;</td>"; echo "</td><td>&nbsp;</td>";
echo "</tr><tr><td>&nbsp;</td><td>"; echo "</tr><tr><td>&nbsp;</td><td>";
echo " <input type=submit name=save value=\"Import Questions\" />"; echo " <input type=\"submit\" name=\"save\" value=\"Import Questions\" />";
echo "</td></tr>"; echo "</td></tr>";
echo "</table>"; echo "</table>";
echo "</form>"; echo "</form>";
@ -265,7 +265,7 @@ class quiz_file_format {
function deletedatabase($filename) { function deletedatabase($filename) {
if (! $this->fulldelete($filename)) { if (! $this->fulldelete($filename)) {
echo "<BR>Error: Could not delete: $filename"; echo "<br>Error: Could not delete: $filename";
return false; return false;
} }
return true; return true;

View file

@ -126,7 +126,7 @@ class quiz_file_format extends quiz_default_format {
$answerstart = strpos($text, "{"); $answerstart = strpos($text, "{");
if ($answerstart === false) { if ($answerstart === false) {
if ($this->displayerrors) { if ($this->displayerrors) {
echo "<P>$text<P>Could not find a {"; echo "<p>$text<p>Could not find a {";
} }
return false; return false;
} }
@ -134,7 +134,7 @@ class quiz_file_format extends quiz_default_format {
$answerfinish = strpos($text, "}"); $answerfinish = strpos($text, "}");
if ($answerfinish === false) { if ($answerfinish === false) {
if ($this->displayerrors) { if ($this->displayerrors) {
echo "<P>$text<P>Could not find a }"; echo "<p>$text<p>Could not find a }";
} }
return false; return false;
} }
@ -193,7 +193,7 @@ class quiz_file_format extends quiz_default_format {
if (!isset($question->qtype)) { if (!isset($question->qtype)) {
if ($this->displayerrors) { if ($this->displayerrors) {
echo "<P>$text<P>Question type not set."; echo "<p>$text<p>Question type not set.";
} }
return false; return false;
} }
@ -218,7 +218,7 @@ class quiz_file_format extends quiz_default_format {
$countanswers = count($answers); $countanswers = count($answers);
if ($countanswers < 2) { if ($countanswers < 2) {
if ($this->displayerrors) { if ($this->displayerrors) {
echo "<P>$text<P>Found tilde for multiple choice, echo "<p>$text<p>Found tilde for multiple choice,
but too few answers for Multiple Choice.<br /> but too few answers for Multiple Choice.<br />
Found <u>$countanswers</u> answers in answertext."; Found <u>$countanswers</u> answers in answertext.";
} }
@ -262,7 +262,7 @@ class quiz_file_format extends quiz_default_format {
$countanswers = count($answers); $countanswers = count($answers);
if ($countanswers < 3) { if ($countanswers < 3) {
if ($this->displayerrors) { if ($this->displayerrors) {
echo "<P>$text<P>Found markers for Matching format echo "<p>$text<p>Found markers for Matching format
(= and ->), but too few answers -- must be at least 3.<br /> (= and ->), but too few answers -- must be at least 3.<br />
Found <u>$countanswers</u> answers in answertext."; Found <u>$countanswers</u> answers in answertext.";
} }
@ -274,7 +274,7 @@ class quiz_file_format extends quiz_default_format {
$answer = trim($answer); $answer = trim($answer);
if (strpos($answer, "->") <= 0) { if (strpos($answer, "->") <= 0) {
if ($this->displayerrors) { if ($this->displayerrors) {
echo "<P>$text<P>Error processing Matching question.<br /> echo "<p>$text<p>Error processing Matching question.<br />
Improperly formatted answer: $answer"; Improperly formatted answer: $answer";
} }
return false; return false;
@ -323,7 +323,7 @@ class quiz_file_format extends quiz_default_format {
if (count($answers) == 0) { if (count($answers) == 0) {
// invalid question // invalid question
if ($this->displayerrors) { if ($this->displayerrors) {
echo "<P>$text<P>Found equals=, but no answers in answertext"; echo "<p>$text<p>Found equals=, but no answers in answertext";
} }
return false; return false;
break; break;
@ -364,7 +364,7 @@ class quiz_file_format extends quiz_default_format {
if (count($answers) == 0) { if (count($answers) == 0) {
// invalid question // invalid question
if ($this->displayerrors) { if ($this->displayerrors) {
echo "<P>$text<P>No answers found in answertext (Numerical answer)"; echo "<p>$text<p>No answers found in answertext (Numerical answer)";
} }
return false; return false;
break; break;
@ -407,8 +407,8 @@ class quiz_file_format extends quiz_default_format {
OR !is_numeric($question->max[$key]) OR !is_numeric($question->max[$key])
OR !is_numeric($question->max[$key])) { OR !is_numeric($question->max[$key])) {
if ($this->displayerrors) { if ($this->displayerrors) {
echo "<P>$text<P>For numerical questions, answer must be numbers. echo "<p>$text<p>For numerical questions, answer must be numbers.
<P>Answer: <u>$answer</u><P>ErrorMargin: <u>$errormargin</u> ."; <p>Answer: <u>$answer</u><p>ErrorMargin: <u>$errormargin</u> .";
} }
return false; return false;
break; break;
@ -423,7 +423,7 @@ class quiz_file_format extends quiz_default_format {
default: default:
if ($this->displayerrors) { if ($this->displayerrors) {
echo "<P>$text<P> No valid question type. Error in switch(question->qtype)"; echo "<p>$text<p> No valid question type. Error in switch(question->qtype)";
} }
return false; return false;
break; break;

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
/// Modified by Tom Robb 12 June 2003 to include percentage and comment insertion /// Modified by Tom Robb 12 June 2003 to include percentage and comment insertion
/// facility. /// facility.
@ -43,7 +43,7 @@ class quiz_file_format extends quiz_default_format {
$answerstart = strpos($text, "{"); $answerstart = strpos($text, "{");
if ($answerstart === false) { if ($answerstart === false) {
if ($this->displayerrors) { if ($this->displayerrors) {
echo "<P>$text<P>Could not find a {"; echo "<p>$text<p>Could not find a {";
} }
return false; return false;
} }
@ -51,7 +51,7 @@ class quiz_file_format extends quiz_default_format {
$answerfinish = strpos($text, "}"); $answerfinish = strpos($text, "}");
if ($answerfinish === false) { if ($answerfinish === false) {
if ($this->displayerrors) { if ($this->displayerrors) {
echo "<P>$text<P>Could not find a }"; echo "<p>$text<p>Could not find a }";
} }
return false; return false;
} }
@ -79,7 +79,7 @@ class quiz_file_format extends quiz_default_format {
switch ($countanswers) { switch ($countanswers) {
case 0: // invalid question case 0: // invalid question
if ($this->displayerrors) { if ($this->displayerrors) {
echo "<P>No answers found in $answertext"; echo "<p>No answers found in $answertext";
} }
return false; return false;

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
/// MULTIANSWER FORMAT /// MULTIANSWER FORMAT

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
/// IMS QTI FORMAT /// IMS QTI FORMAT

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// // // //
// WebCT FORMAT // // WebCT FORMAT //

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
// Import quiz questions into the given category // Import quiz questions into the given category
require_once("../../config.php"); require_once("../../config.php");
@ -101,30 +101,30 @@
print_heading_with_help($strimportquestions, "import", "quiz"); print_heading_with_help($strimportquestions, "import", "quiz");
print_simple_box_start("center", "", "$THEME->cellheading"); print_simple_box_start("center", "", "$THEME->cellheading");
echo "<form enctype=\"multipart/form-data\" method=\"post\" action=import.php>"; echo "<form enctype=\"multipart/form-data\" method=\"post\" action=\"import.php\">";
echo "<table cellpadding=5>"; echo "<table cellpadding=\"5\">";
echo "<tr><td align=right>"; echo "<tr><td align=\"right\">";
print_string("category", "quiz"); print_string("category", "quiz");
echo ":</td><td>"; echo ":</td><td>";
// choose_from_menu($categories, "category", "$category->id", ""); // choose_from_menu($categories, "category", "$category->id", "");
echo quiz_get_category_coursename($category); echo quiz_get_category_coursename($category);
echo "</tr>"; echo "</tr>";
echo "<tr><td align=right>"; echo "<tr><td align=\"right\">";
print_string("fileformat", "quiz"); print_string("fileformat", "quiz");
echo ":</td><td>"; echo ":</td><td>";
choose_from_menu($fileformatnames, "format", "gift", ""); choose_from_menu($fileformatnames, "format", "gift", "");
helpbutton("import", $strimportquestions, "quiz"); helpbutton("import", $strimportquestions, "quiz");
echo "</tr>"; echo "</tr>";
echo "<tr><td align=right>"; echo "<tr><td align=\"right\">";
print_string("upload"); print_string("upload");
echo ":</td><td>"; echo ":</td><td>";
echo " <input name=\"newfile\" type=\"file\" size=\"50\" />"; echo " <input name=\"newfile\" type=\"file\" size=\"50\" />";
echo "</tr><tr><td>&nbsp;</td><td>"; echo "</tr><tr><td>&nbsp;</td><td>";
echo " <input type=hidden name=category value=\"$category->id\" />"; echo " <input type=\"hidden\" name=\"category\" value=\"$category->id\" />";
echo " <input type=submit name=save value=\"".get_string("uploadthisfile")."\" />"; echo " <input type=\"submit\" name=\"save\" value=\"".get_string("uploadthisfile")."\" />";
echo "</td></tr>"; echo "</td></tr>";
echo "</table>"; echo "</table>";

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
// This page lists all the instances of quiz in a particular course // This page lists all the instances of quiz in a particular course
@ -76,10 +76,10 @@
foreach ($quizzes as $quiz) { foreach ($quizzes as $quiz) {
if (!$quiz->visible) { if (!$quiz->visible) {
//Show dimmed if the mod is hidden //Show dimmed if the mod is hidden
$link = "<A class=\"dimmed\" HREF=\"view.php?id=$quiz->coursemodule\">$quiz->name</A>"; $link = "<a class=\"dimmed\" href=\"view.php?id=$quiz->coursemodule\">$quiz->name</a>";
} else { } else {
//Show normal if the mod is visible //Show normal if the mod is visible
$link = "<A HREF=\"view.php?id=$quiz->coursemodule\">$quiz->name</A>"; $link = "<a href=\"view.php?id=$quiz->coursemodule\">$quiz->name</a>";
} }
$bestgrade = quiz_get_best_grade($quiz->id, $USER->id); $bestgrade = quiz_get_best_grade($quiz->id, $USER->id);

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
/// Library of function for module quiz /// Library of function for module quiz
@ -1263,7 +1263,7 @@ function quiz_print_question_list($questionlist, $grades) {
$sumgrade += $grades[$qnum]; $sumgrade += $grades[$qnum];
} }
echo "<tr><td colspan=5 align=\"right\">\n"; echo "<tr><td colspan=\"5\" align=\"right\">\n";
echo "<input type=\"submit\" value=\"$strsavegrades:\" />\n"; echo "<input type=\"submit\" value=\"$strsavegrades:\" />\n";
echo "<input type=\"hidden\" name=\"setgrades\" value=\"save\" />\n"; echo "<input type=\"hidden\" name=\"setgrades\" value=\"save\" />\n";
echo "<td align=\"left\" bgcolor=\"$THEME->cellcontent\">\n"; echo "<td align=\"left\" bgcolor=\"$THEME->cellcontent\">\n";
@ -1399,11 +1399,11 @@ function quiz_print_cat_question_list($categoryid, $quizselected=true) {
if ($canedit) { if ($canedit) {
echo "<td>\n"; echo "<td>\n";
echo "<a title=\"$strdelete\" href=\"question.php?id=$question->id&delete=$question->id\">\n<img echo "<a title=\"$strdelete\" href=\"question.php?id=$question->id&delete=$question->id\">\n<img
src=\"../../pix/t/delete.gif\" border=0></a>&nbsp;"; src=\"../../pix/t/delete.gif\" border=\"0\"></a>&nbsp;";
echo "<a title=\"$strpreview\" href=\"#\" onClick=\"openpopup('/mod/quiz/preview.php?id=$question->id','$strpreview','scrollbars=yes,resizable=yes,width=700,height=480', false)\"><img echo "<a title=\"$strpreview\" href=\"#\" onClick=\"openpopup('/mod/quiz/preview.php?id=$question->id','$strpreview','scrollbars=yes,resizable=yes,width=700,height=480', false)\"><img
src=\"../../pix/i/search.gif\" border=\"0\"></a>&nbsp;"; src=\"../../pix/i/search.gif\" border=\"0\"></a>&nbsp;";
echo "<a title=\"$stredit\" href=\"question.php?id=$question->id\"><img echo "<a title=\"$stredit\" href=\"question.php?id=$question->id\"><img
src=\"../../pix/t/edit.gif\" border=0></a>"; src=\"../../pix/t/edit.gif\" border=\"0\"></a>";
echo "</td>\n";// deleted </tr> jm echo "</td>\n";// deleted </tr> jm
} }
echo "</tr>\n"; echo "</tr>\n";
@ -1411,7 +1411,7 @@ function quiz_print_cat_question_list($categoryid, $quizselected=true) {
if ($quizselected) { if ($quizselected) {
echo "<tr>\n<td colspan=\"3\">"; echo "<tr>\n<td colspan=\"3\">";
echo "<input type=\"submit\" name=\"add\" value=\"<< $straddselectedtoquiz\" />\n"; echo "<input type=\"submit\" name=\"add\" value=\"<< $straddselectedtoquiz\" />\n";
//echo "<input type=submit name=\"delete\" value=\"XX Delete selected\">"; //echo "<input type=\"submit\" name=\"delete\" value=\"XX Delete selected\">";
echo "<input type=\"button\" onclick=\"checkall()\" value=\"$strselectall\" />\n"; echo "<input type=\"button\" onclick=\"checkall()\" value=\"$strselectall\" />\n";
echo "</td></tr>"; echo "</td></tr>";
} }
@ -1795,11 +1795,11 @@ function quiz_print_recent_mod_activity($activity, $course, $detail=false) {
echo "<tr><td bgcolor=\"$THEME->cellcontent2\" class=\"forumpostpicture\" width=\"35\" valign=\"top\">"; echo "<tr><td bgcolor=\"$THEME->cellcontent2\" class=\"forumpostpicture\" width=\"35\" valign=\"top\">";
print_user_picture($activity->user->userid, $course, $activity->user->picture); print_user_picture($activity->user->userid, $course, $activity->user->picture);
echo "</td><td width=\"100%\"><font size=2>"; echo "</td><td width=\"100%\"><font size=\"2\">";
if ($detail) { if ($detail) {
echo "<img src=\"$CFG->modpixpath/$activity->type/icon.gif\" ". echo "<img src=\"$CFG->modpixpath/$activity->type/icon.gif\" ".
"height=16 width=16 alt=\"$activity->type\"> "; "height=\"16\" width=\"16\" alt=\"$activity->type\"> ";
echo "<a href=\"$CFG->wwwroot/mod/quiz/view.php?id=" . $activity->instance . "\">" echo "<a href=\"$CFG->wwwroot/mod/quiz/view.php?id=" . $activity->instance . "\">"
. $activity->name . "</a> - "; . $activity->name . "</a> - ";

View file

@ -61,15 +61,15 @@
<form name="form" method="post" action="../mod/quiz/edit.php"> <form name="form" method="post" action="../mod/quiz/edit.php">
<center> <center>
<table cellpadding=5> <table cellpadding="5">
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("name") ?>:</b></p></td> <td align="right"><p><b><?php print_string("name") ?>:</b></p></td>
<td> <td>
<input type="text" name="name" size=40 value="<?php p($form->name) ?>" /> <input type="text" name="name" size="40" value="<?php p($form->name) ?>" />
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("introduction", "quiz") ?>:</b></p> <td align="right"><p><b><?php print_string("introduction", "quiz") ?>:</b></p>
<br /> <br />
<font size="1"> <font size="1">
<?php <?php
@ -91,8 +91,8 @@
?> ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("quizopen", "quiz") ?>:</b></p></td> <td align="right"><p><b><?php print_string("quizopen", "quiz") ?>:</b></p></td>
<td> <td>
<?php <?php
if (!$form->timeopen and $course->format == "weeks") { if (!$form->timeopen and $course->format == "weeks") {
@ -104,8 +104,8 @@
?> ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("quizclose", "quiz") ?>:</b></p></td> <td align="right"><p><b><?php print_string("quizclose", "quiz") ?>:</b></p></td>
<td> <td>
<?php <?php
if (!$form->timeclose and $course->format == "weeks") { if (!$form->timeclose and $course->format == "weeks") {
@ -118,8 +118,8 @@
</td> </td>
</tr> </tr>
<!-- BEGIN EDIT --> <!-- BEGIN EDIT -->
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("timelimit", "quiz") ?>:</b></p></td> <td align="right"><p><b><?php print_string("timelimit", "quiz") ?>:</b></p></td>
<td> <td>
<?php <?php
print_timer_selector($form->timelimit, get_string("minutes","quiz")); print_timer_selector($form->timelimit, get_string("minutes","quiz"));
@ -128,8 +128,8 @@
</td> </td>
</tr> </tr>
<!-- END EDIT --> <!-- END EDIT -->
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("shufflequestions", "quiz") ?>:</b></p></td> <td align="right"><p><b><?php print_string("shufflequestions", "quiz") ?>:</b></p></td>
<td> <td>
<?php <?php
$options = array(); $options = array();
@ -140,8 +140,8 @@
?> ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("shuffleanswers", "quiz") ?>:</b></p></td> <td align="right"><p><b><?php print_string("shuffleanswers", "quiz") ?>:</b></p></td>
<td> <td>
<?php <?php
$options = array(); $options = array();
@ -152,8 +152,8 @@
?> ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("attemptsallowed", "quiz") ?>:</b></p></td> <td align="right"><p><b><?php print_string("attemptsallowed", "quiz") ?>:</b></p></td>
<td> <td>
<?php <?php
$options = array(); $options = array();
@ -167,8 +167,8 @@
?> ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("eachattemptbuildsonthelast", "quiz") ?>:</b></p></td> <td align="right"><p><b><?php print_string("eachattemptbuildsonthelast", "quiz") ?>:</b></p></td>
<td> <td>
<?php <?php
$options = array(); $options = array();
@ -182,8 +182,8 @@
?> ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("grademethod", "quiz") ?>:</b></p></td> <td align="right"><p><b><?php print_string("grademethod", "quiz") ?>:</b></p></td>
<td> <td>
<?php <?php
$options = array(); $options = array();
@ -196,8 +196,8 @@
?> ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("showfeedback", "quiz") ?>:</b></p></td> <td align="right"><p><b><?php print_string("showfeedback", "quiz") ?>:</b></p></td>
<td> <td>
<?php <?php
$options = array(); $options = array();
@ -208,8 +208,8 @@
?> ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("showcorrectanswer", "quiz") ?>:</b></p></td> <td align="right"><p><b><?php print_string("showcorrectanswer", "quiz") ?>:</b></p></td>
<td> <td>
<?php <?php
$options = array(); $options = array();
@ -220,8 +220,8 @@
?> ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("allowreview", "quiz") ?>:</b></p></td> <td align="right"><p><b><?php print_string("allowreview", "quiz") ?>:</b></p></td>
<td> <td>
<?php <?php
$options = array(); $options = array();
@ -232,8 +232,8 @@
?> ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("maximumgrade") ?>:</b></p></td> <td align="right"><p><b><?php print_string("maximumgrade") ?>:</b></p></td>
<td> <td>
<?php <?php
for ($i=100; $i>=1; $i--) { for ($i=100; $i>=1; $i--) {
@ -246,32 +246,32 @@
?> ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("requirepassword", "quiz") ?>:</b></p></td> <td align="right"><p><b><?php print_string("requirepassword", "quiz") ?>:</b></p></td>
<td> <td>
<input type="text" name="password" size=40 value="<?php p($form->password) ?>" /> <input type="text" name="password" size="40" value="<?php p($form->password) ?>" />
<?php helpbutton("requirepassword", get_string("requirepassword", "quiz"), "quiz"); ?> <?php helpbutton("requirepassword", get_string("requirepassword", "quiz"), "quiz"); ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("requiresubnet", "quiz") ?>:</b></p></td> <td align="right"><p><b><?php print_string("requiresubnet", "quiz") ?>:</b></p></td>
<td> <td>
<input type="text" name="subnet" size=40 value="<?php p($form->subnet) ?>" /> <input type="text" name="subnet" size="40" value="<?php p($form->subnet) ?>" />
<?php helpbutton("requiresubnet", get_string("requiresubnet", "quiz"), "quiz"); ?> <?php helpbutton("requiresubnet", get_string("requiresubnet", "quiz"), "quiz"); ?>
</td> </td>
</tr> </tr>
</table> </table>
<input type="hidden" name=questions value="<?php p($form->questions) ?>" /> <input type="hidden" name="questions" value="<?php p($form->questions) ?>" />
<!-- these hidden variables are always the same --> <!-- these hidden variables are always the same -->
<input type="hidden" name=course value="<?php p($form->course) ?>" /> <input type="hidden" name="course" value="<?php p($form->course) ?>" />
<input type="hidden" name=coursemodule value="<?php p($form->coursemodule) ?>" /> <input type="hidden" name="coursemodule" value="<?php p($form->coursemodule) ?>" />
<input type="hidden" name=section value="<?php p($form->section) ?>" /> <input type="hidden" name="section" value="<?php p($form->section) ?>" />
<input type="hidden" name=module value="<?php p($form->module) ?>" /> <input type="hidden" name="module" value="<?php p($form->module) ?>" />
<input type="hidden" name=modulename value="<?php p($form->modulename) ?>" /> <input type="hidden" name="modulename" value="<?php p($form->modulename) ?>" />
<input type="hidden" name=instance value="<?php p($form->instance) ?>" /> <input type="hidden" name="instance" value="<?php p($form->instance) ?>" />
<input type="hidden" name=mode value="<?php p($form->mode) ?>" /> <input type="hidden" name="mode" value="<?php p($form->mode) ?>" />
<input type="hidden" name=destination value="<?php echo "$CFG->wwwroot/course/mod.php" ?>" /> <input type="hidden" name="destination" value="<?php echo "$CFG->wwwroot/course/mod.php" ?>" />
<input type="submit" value="<?php print_string("continue") ?>" /> <input type="submit" value="<?php print_string("continue") ?>" />
</center> </center>
</form> </form>

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
// A quick way to add lots of questions to a category (and a quiz) // A quick way to add lots of questions to a category (and a quiz)
require_once("../../config.php"); require_once("../../config.php");
@ -122,39 +122,39 @@
$options[1] = get_string("yes"); $options[1] = get_string("yes");
print_simple_box_start("center", "", "$THEME->cellheading"); print_simple_box_start("center", "", "$THEME->cellheading");
echo "<FORM METHOD=\"POST\" ACTION=multiple.php>"; echo "<form method=\"POST\" action=\"multiple.php\">";
echo "<TABLE cellpadding=5>"; echo "<table cellpadding="5">";
echo "<TR><TD align=right>"; echo "<tr><td align="right">";
print_string("category", "quiz"); print_string("category", "quiz");
echo ":</TD><TD>"; echo ":</td><td>";
// choose_from_menu($categories, "category", "$category->id", ""); // choose_from_menu($categories, "category", "$category->id", "");
quiz_category_select_menu($course->id, true, true, $category->id ); quiz_category_select_menu($course->id, true, true, $category->id );
echo "</TR>"; echo "</tr>";
echo "<TR><TD align=right>"; echo "<tr><td align="right">";
print_string("randomcreate", "quiz"); print_string("randomcreate", "quiz");
echo ":</TD><TD>"; echo ":</td><td>";
choose_from_menu($randomcount, "randomcreate", "10", ""); choose_from_menu($randomcount, "randomcreate", "10", "");
echo "</TR>"; echo "</tr>";
echo "<TR><TD align=right>"; echo "<tr><td align="right">";
print_string("defaultgrade", "quiz"); print_string("defaultgrade", "quiz");
echo ":</TD><TD>"; echo ":</td><td>";
choose_from_menu($gradecount, "randomgrade", "1", ""); choose_from_menu($gradecount, "randomgrade", "1", "");
echo "</TR>"; echo "</tr>";
echo "<TR><TD align=right>"; echo "<tr><td align="right">";
print_string("addquestionstoquiz", "quiz"); print_string("addquestionstoquiz", "quiz");
echo ":</TD><TD>"; echo ":</td><td>";
choose_from_menu($options, "addquestionstoquiz", "1", ""); choose_from_menu($options, "addquestionstoquiz", "1", "");
echo "</TR>"; echo "</tr>";
echo "<TR><TD>&nbsp;</TD><TD>"; echo "<tr><td>&nbsp;</td><td>";
echo " <INPUT TYPE=hidden NAME=category VALUE=\"$category->id\" />"; echo " <input type="hidden" name="category" value=\"$category->id\" />";
echo " <INPUT TYPE=submit NAME=save VALUE=\"$strcreatemultiple\" />"; echo " <input type="submit" name="save" value=\"$strcreatemultiple\" />";
echo "</TD></TR>"; echo "</td></tr>";
echo "</TABLE>"; echo "</table>";
echo "</FORM>"; echo "</form>";
print_simple_box_end(); print_simple_box_end();
print_footer(); print_footer();

View file

@ -61,7 +61,7 @@
print_header(); print_header();
print_heading(get_string("previewquestion","quiz")); print_heading(get_string("previewquestion","quiz"));
echo "<p align='center'><input type=\"button\" onClick=\"window.close()\" value=\"" . get_string("close", "quiz") . "\" /></p>"; echo "<p align=\"center\"><input type=\"button\" onClick=\"window.close()\" value=\"" . get_string("close", "quiz") . "\" /></p>";
if (empty($question->id)) { if (empty($question->id)) {
$question->id = ""; $question->id = "";

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
/// For creating and editing quiz questions. /// For creating and editing quiz questions.
require_once("../../config.php"); require_once("../../config.php");
@ -93,7 +93,7 @@
} }
if ($beingused) { if ($beingused) {
$beingused = implode(", ", $beingused); $beingused = implode(", ", $beingused);
$beingused = get_string("questioninuse", "quiz", "<I>$question->name</I>")."<P>".$beingused; $beingused = get_string("questioninuse", "quiz", "<i>$question->name</i>")."<p>".$beingused;
notice($beingused, "edit.php"); notice($beingused, "edit.php");
} else { // the question is not used in any of the existing quizzes } else { // the question is not used in any of the existing quizzes

View file

@ -1,27 +1,27 @@
<FORM name="theform" method="post" action="question.php"> <form name="theform" method="post" action="question.php">
<CENTER> <center>
<INPUT type="hidden" name="nextwizardpage" value="<?php p($nextwizardpage)?>" /> <input type="hidden" name="nextwizardpage" value="<?php p($nextwizardpage)?>" />
<?php foreach ($calculatedmessages as $message) {formerr("$message<br/>");} ?> <?php foreach ($calculatedmessages as $message) {formerr("$message<br/>");} ?>
<TABLE cellpadding=5> <table cellpadding="5">
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("category", "quiz") ?>:</b></p></td>
<TD> <td>
<?php quiz_category_select_menu($course->id, true, true, $question->category); ?> <?php quiz_category_select_menu($course->id, true, true, $question->category); ?>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("questionname", "quiz") ?>:</b></p></td>
<TD> <td>
<INPUT type="text" name="name" size=50 value="<?php p($question->name) ?>" /> <input type="text" name="name" size="50" value="<?php p($question->name) ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?> <?php if (isset($err["name"])) formerr($err["name"]); ?>
</TD> </td>
</TR> </tr>
<tr valign=top> <tr valign="top">
<td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p> <td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>
<br /> <br />
<br /> <br />
<br /> <br />
<p><font SIZE="1"> <p><font size="1">
<?php <?php
if ($usehtmleditor) { if ($usehtmleditor) {
helpbutton("richtext", get_string("helprichtext"), "moodle", true, true); helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
@ -42,7 +42,7 @@
if ($usehtmleditor) { /// Trying this out for a while if ($usehtmleditor) { /// Trying this out for a while
echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'" />'; echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'" />';
} else { } else {
echo "<div align=right>"; echo "<div align=\"right\">";
print_string("formattexttype"); print_string("formattexttype");
echo ":&nbsp;"; echo ":&nbsp;";
if (!isset($question->questiontextformat)) { if (!isset($question->questiontextformat)) {
@ -55,93 +55,93 @@
?> ?>
</td> </td>
</tr> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("imagedisplay", "quiz") ?>:</b></p></td>
<TD> <td>
<?php if (empty($images)) { <?php if (empty($images)) {
print_string("noimagesyet"); print_string("noimagesyet");
} else { } else {
choose_from_menu($images, "image", "$question->image", get_string("none"),"",""); choose_from_menu($images, "image", "$question->image", get_string("none"),"","");
} }
?> ?>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("correctanswerformula", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("correctanswerformula", "quiz") ?>:</b></p></td>
<TD> <td>
<INPUT align="LEFT" type="text" id="formula0" name="answer[]" size="20" value="<?php p($answers[0]->answer) ?>" />&nbsp;&nbsp; <input align="LEFT" type="text" id="formula0" name="answer[]" size="20" value="<?php p($answers[0]->answer) ?>" />&nbsp;&nbsp;
<INPUT type="hidden" name="fraction[]" value="1.0" /> <input type="hidden" name="fraction[]" value="1.0" />
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("tolerance", "quiz"); ?>:</B></P></TD> <td align="right"><p><b><?php print_string("tolerance", "quiz"); ?>:</b></p></td>
<TD> <td>
<INPUT align="LEFT" type="text" id=tolerance0" name="tolerance[]" size="15" value="<?php p($answers[0]->tolerance) ?>" />&plusmn; <input align="LEFT" type="text" id="tolerance0" name="tolerance[]" size="15" value="<?php p($answers[0]->tolerance) ?>" />&plusmn;
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("tolerancetype", "quiz"); ?>:</B></P></TD> <td align="right"><p><b><?php print_string("tolerancetype", "quiz"); ?>:</b></p></td>
<TD> <td>
<?php choose_from_menu($qtypeobj->tolerance_types(), <?php choose_from_menu($qtypeobj->tolerance_types(),
'tolerancetype[]', $answers[0]->tolerancetype, false); ?> 'tolerancetype[]', $answers[0]->tolerancetype, false); ?>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("correctanswerlength", "quiz"); ?>:</B></P></TD> <td align="right"><p><b><?php print_string("correctanswerlength", "quiz"); ?>:</b></p></td>
<TD> <td>
<?php choose_from_menu(array('1' => '1', '2' => '2', '3' => '3', <?php choose_from_menu(array('1' => '1', '2' => '2', '3' => '3',
'4' => '4', '5' => '5', '6' => '6', '4' => '4', '5' => '5', '6' => '6',
'7' => '7', '8' => '8', '9' => '9', '7' => '7', '8' => '8', '9' => '9',
'10' => '10'), '10' => '10'),
'correctanswerlength[]', 'correctanswerlength[]',
$answers[0]->correctanswerlength, false); ?> $answers[0]->correctanswerlength, false); ?>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("feedback", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("feedback", "quiz") ?>:</b></p></td>
<TD> <td>
<textarea name="feedback[]" rows=2 cols=50 wrap="virtual"><?php p($answers[0]->feedback) ?></textarea> <textarea name="feedback[]" rows="2" cols="50" wrap="virtual"><?php p($answers[0]->feedback) ?></textarea>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("unit", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("unit", "quiz") ?>:</b></p></td>
<TD> <td>
<P><INPUT type="HIDDEN" name="multiplier[]" value="1.0" /> <p><input type="HIDDEN" name="multiplier[]" value="1.0" />
<INPUT align="LEFT" type="text" id="defaultunit" name="unit[]" <input align="LEFT" type="text" id="defaultunit" name="unit[]"
size="5" value="<?php p($units[0]->unit) ?>" /> size="5" value="<?php p($units[0]->unit) ?>" />
<B>(<?php print_string("optional", "quiz") ?>)</B></P> <b>(<?php print_string("optional", "quiz") ?>)</b></p>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<td></td> <td></td>
<TD align=left><P><B><?php print_string("alternativeunits", "quiz") ?>:</B></P></TD> <td align="left"><p><b><?php print_string("alternativeunits", "quiz") ?>:</b></p></td>
<td></td> <td></td>
</TR> </tr>
<?PHP <?php
for ($i=1; $i<count($units); $i++) { for ($i=1; $i<count($units); $i++) {
$unit=$units[$i]; $unit=$units[$i];
?> ?>
<TR valign=top> <tr valign="top">
<td></td> <td></td>
<TD align=left> <td align="left">
<P><B><?php print_string("multiplier", "quiz") ?>:</B> <p><b><?php print_string("multiplier", "quiz") ?>:</b>
<INPUT type="text" id="<?php p("multiplier$i") ?>" size="10" <input type="text" id="<?php p("multiplier$i") ?>" size="10"
align="RIGHT" name="multiplier[]" align="RIGHT" name="multiplier[]"
value="<?php p($unit->multiplier) ?>" /> value="<?php p($unit->multiplier) ?>" />
<B>&nbsp;&nbsp;&nbsp;<?php print_string("unit", "quiz") ?>:</B> <b>&nbsp;&nbsp;&nbsp;<?php print_string("unit", "quiz") ?>:</b>
<INPUT align="LEFT" type="text" id="<?php p("unit$i") ?>" <input align="LEFT" type="text" id="<?php p("unit$i") ?>"
name="unit[]" name="unit[]"
size="5" value="<?php p($unit->unit) ?>" /></P> size="5" value="<?php p($unit->unit) ?>" /></p>
</TD> </td>
</TR> </tr>
<?PHP <?php
} /// END for } /// END for
?> ?>
</TABLE> </table>
<input type="hidden" name=id value="<?php p($question->id) ?>" /> <input type="hidden" name="id" value="<?php p($question->id) ?>" />
<input type="hidden" name=qtype value="<?php p($question->qtype) ?>" /> <input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<input type="submit" onClick="return determineMinAndMax();" value="<?php print_string("savechanges") ?>" /> <input type="submit" onClick="return determineMinAndMax();" value="<?php print_string("savechanges") ?>" />
</center> </center>
</form> </form>

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
// Get a handle to the question type we are dealing with here // Get a handle to the question type we are dealing with here
$qtypeobj = $QUIZ_QTYPES[CALCULATED]; $qtypeobj = $QUIZ_QTYPES[CALCULATED];

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
/////////////////////////////// ///////////////////////////////
/// CALCULATED HELPER CLASS /// /// CALCULATED HELPER CLASS ///

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
///////////////// /////////////////
/// CALCULATED /// /// CALCULATED ///
@ -43,12 +43,12 @@ class quiz_calculated_qtype extends quiz_dataset_dependent_questiontype {
? 'decimals' ? 'decimals'
: 'significantfigures'), 'quiz', $i); : 'significantfigures'), 'quiz', $i);
} }
return '<INPUT TYPE="submit" onClick="' return '<input type="submit" onClick="'
. "document.addform.regenerateddefid.value='$datasetdef->id'; return true;" . "document.addform.regenerateddefid.value='$datasetdef->id'; return true;"
.'" VALUE="'. get_string('generatevalue', 'quiz') . '"/><br/>' .'" value="'. get_string('generatevalue', 'quiz') . '"/><br/>'
. '<INPUT TYPE="text" SIZE="3" NAME="calcmin[]" ' . '<input type="text" size="3" name="calcmin[]" '
. " VALUE=\"$regs[2]\"/> &amp; <INPUT NAME=\"calcmax[]\" " . " value=\"$regs[2]\"/> &amp; <input name=\"calcmax[]\" "
. ' TYPE="text" SIZE="3" VALUE="' . $regs[3] .'"/> ' . ' type="text" size="3" value="' . $regs[3] .'"/> '
. choose_from_menu($lengthoptions, 'calclength[]', . choose_from_menu($lengthoptions, 'calclength[]',
$regs[4], // Selected $regs[4], // Selected
'', '', '', true) . '<br/>' '', '', '', true) . '<br/>'

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
/////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////
/// ABSTRACT SUPERCLASS FOR QUSTION TYPES THAT USE DATASETS /// /// ABSTRACT SUPERCLASS FOR QUSTION TYPES THAT USE DATASETS ///
@ -360,9 +360,9 @@ class quiz_dataset_dependent_questiontype extends quiz_default_questiontype {
$value = $item->value; $value = $item->value;
} else { } else {
$icon = "<IMG SRC=\"$CFG->wwwroot/pix/f/" $icon = "<img src=\"$CFG->wwwroot/pix/f/"
. mimeinfo('icon', $item->value) . mimeinfo('icon', $item->value)
. '" HEIGHT="16" WIDTH="16" BORDER="0" ALT="File" />'; . '" height="16" width="16" border="0" alt="File" />';
if (substr(strtolower($item->value), 0, 7)=='http://') { if (substr(strtolower($item->value), 0, 7)=='http://') {
$link = $item->value; $link = $item->value;

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
///// This page offers a way to define category level datasets ///// ///// This page offers a way to define category level datasets /////
@ -32,7 +32,7 @@
$strquestions = get_string("questions", "quiz"); $strquestions = get_string("questions", "quiz");
print_header_simple("$strdefinedataset", "$strdefinedataset", print_header_simple("$strdefinedataset", "$strdefinedataset",
"<A HREF=\"../../edit.php\">$streditingquiz</A> -> $strdefinedataset"); "<a href=\"../../edit.php\">$streditingquiz</a> -> $strdefinedataset");
if ($form = data_submitted()) { /// Filename if ($form = data_submitted()) { /// Filename
@ -74,7 +74,7 @@
echo "<input type=\"hidden\" name=\"question\" value=\"$question\" />"; echo "<input type=\"hidden\" name=\"question\" value=\"$question\" />";
} }
echo "<table cellpadding=5>"; echo "<table cellpadding=\"5\">";
$definitions = get_records('quiz_dataset_definitions', $definitions = get_records('quiz_dataset_definitions',
'category', 'category',
@ -86,7 +86,7 @@
$definition = NULL; $definition = NULL;
} }
echo "<tr><td align=right>"; echo "<tr><td align=\"right\">";
print_string("itemdefinition", "quiz"); print_string("itemdefinition", "quiz");
echo ":</td><td>"; echo ":</td><td>";
echo "<input name=\"name[]\" type=\"text\" size=\"20\" value=\"$definition->name\" />"; echo "<input name=\"name[]\" type=\"text\" size=\"20\" value=\"$definition->name\" />";
@ -96,7 +96,7 @@
echo "</td></tr>\n"; echo "</td></tr>\n";
} }
echo "<tr><td align=\"CENTER\" colspan=\"3\"><input type=submit value=\"".get_string("continue")."\" /></td></tr>"; echo "<tr><td align=\"CENTER\" colspan=\"3\"><input type=\"submit\" value=\"".get_string("continue")."\" /></td></tr>";
echo "</table>"; echo "</table>";
echo "</form>"; echo "</form>";
print_simple_box_end(); print_simple_box_end();

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
// Allows a teacher to create, edit and delete datasets // Allows a teacher to create, edit and delete datasets
@ -124,17 +124,17 @@
$columns = array(); $columns = array();
if ($maxnumber == $number) { if ($maxnumber == $number) {
$columns[] = $columns[] =
"<INPUT TYPE=\"hidden\" name=\"numbertodelete\" value=\"$number\"/> "<input type=\"hidden\" name=\"numbertodelete\" value=\"$number\"/>
<INPUT TYPE=\"submit\" name=\"deletebutton\" value=\"$strdelete\"/>"; <input type=\"submit\" name=\"deletebutton\" value=\"$strdelete\"/>";
} else { } else {
$columns[] = ''; $columns[] = '';
} }
$columns[] = $number; $columns[] = $number;
foreach ($datasetdefs as $datasetdef) { foreach ($datasetdefs as $datasetdef) {
$columns[] = $columns[] =
'<INPUT TYPE="hidden" name="itemid[]" value="'. $datasetdef->items[$number]->id .'"/>' '<input type="hidden" name="itemid[]" value="'. $datasetdef->items[$number]->id .'"/>'
. "<INPUT TYPE=\"hidden\" name=\"number[]\" value=\"$number\"/> . "<input type=\"hidden\" name=\"number[]\" value=\"$number\"/>
<INPUT TYPE=\"hidden\" name=\"definition[]\" value=\"$datasetdef->id\"/>" <input type=\"hidden\" name=\"definition[]\" value=\"$datasetdef->id\"/>"
. // Set $data: . // Set $data:
($data[$datasetdef->name] = $datasetdef->items[$number]->value) ; ($data[$datasetdef->name] = $datasetdef->items[$number]->value) ;
@ -156,16 +156,16 @@
$force = ''; $force = '';
$reuse = ' checked="checked" '; $reuse = ' checked="checked" ';
} }
$forceregeneration = '<br/><INPUT type="radio" name="forceregeneration" ' $forceregeneration = '<br/><input type="radio" name="forceregeneration" '
. $reuse . ' value="0"/>' . $strreuseifpossible . $reuse . ' value="0"/>' . $strreuseifpossible
. '<br/><INPUT type="radio" name="forceregeneration" value="1" ' . '<br/><input type="radio" name="forceregeneration" value="1" '
. $force . ' />' . $strforceregeneration; . $force . ' />' . $strforceregeneration;
} else { } else {
$forceregeneration = ''; $forceregeneration = '';
} }
$addline = array('<INPUT TYPE="hidden" name="numbertoadd" value="' $addline = array('<input type="hidden" name="numbertoadd" value="'
. ($maxnumber+1) . ($maxnumber+1)
. "\"/><INPUT TYPE=\"submit\" name=\"addbutton\" value=\"$stradd\"/>" . "\"/><input type=\"submit\" name=\"addbutton\" value=\"$stradd\"/>"
. $forceregeneration . $forceregeneration
, $maxnumber+1); , $maxnumber+1);
foreach ($datasetdefs as $datasetdef) { foreach ($datasetdefs as $datasetdef) {
@ -229,10 +229,10 @@
} }
$addline[] = $addline[] =
'<INPUT TYPE="hidden" name="itemid[]" value="'.$itemid.'"/>' '<input type="hidden" name="itemid[]" value="'.$itemid.'"/>'
. "<INPUT TYPE=\"hidden\" name=\"definition[]\" value=\"$datasetdef->id\"/>" . "<input type=\"hidden\" name=\"definition[]\" value=\"$datasetdef->id\"/>"
. ( 2 != $datasetdef->type . ( 2 != $datasetdef->type
? '<INPUT TYPE="text" size="20" name="value[]" value="' ? '<input type="text" size="20" name="value[]" value="'
. $itemvalue . $itemvalue
. '"/>' . '"/>'
: choose_from_menu($coursefiles, 'value[]', : choose_from_menu($coursefiles, 'value[]',
@ -251,23 +251,23 @@
// Print form for adding one more dataset // Print form for adding one more dataset
$addtable->align = $table->align; $addtable->align = $table->align;
$addtable->data = array($addline); $addtable->data = array($addline);
echo "<FORM NAME=\"addform\" METHOD=\"post\" ACTION=\"question.php\"> echo "<form name=\"addform\" method=\"post\" action=\"question.php\">
<INPUT TYPE=\"hidden\" NAME=\"regenerateddefid\" VALUE=\"0\"/> <input type=\"hidden\" name=\"regenerateddefid\" value=\"0\"/>
<INPUT TYPE=\"hidden\" NAME=\"id\" VALUE=\"$question->id\"/> <input type=\"hidden\" name=\"id\" value=\"$question->id\"/>
<INPUT TYPE=\"hidden\" NAME=\"editdatasets\" VALUE=\"1\"/>"; <input type=\"hidden\" name=\"editdatasets\" value=\"1\"/>";
print_table($addtable); print_table($addtable);
echo '</FORM>'; echo '</form>';
// Print form with current datasets // Print form with current datasets
if ($table->data) { if ($table->data) {
echo "<FORM METHOD=\"post\" ACTION=\"question.php\"> echo "<form method=\"post\" action=\"question.php\">
<INPUT TYPE=\"hidden\" NAME=\"id\" VALUE=\"$question->id\"/> <input type=\"hidden\" name=\"id\" value=\"$question->id\"/>
<INPUT TYPE=\"hidden\" NAME=\"editdatasets\" VALUE=\"1\"/>"; <input type=\"hidden\" name=\"editdatasets\" value=\"1\"/>";
print_table($table); print_table($table);
echo '</FORM>'; echo '</form>';
} }
echo "<center><BR><BR><FORM METHOD=\"get\" ACTION=\"edit.php\"><INPUT TYPE=\"hidden\" NAME=\"question\" VALUE=\"$question->id\"/><INPUT TYPE=submit NAME=backtoquiz VALUE=\"$strbacktoquiz\"></FORM></center>\n"; echo "<center><br><br><form method=\"get\" action=\"edit.php\"><input type=\"hidden\" name=\"question\" value=\"$question->id\"/><input type=\"submit\" name=\"backtoquiz\" value=\"$strbacktoquiz\"></form></center>\n";
print_footer(); print_footer();

View file

@ -1,58 +1,58 @@
<FORM name="theform" method="post" action="question.php"> <form name="theform" method="post" action="question.php">
<CENTER> <center>
<INPUT type="hidden" name="nextwizardpage" value="calculated.html"/> <input type="hidden" name="nextwizardpage" value="calculated.html"/>
<TABLE cellpadding=5> <table cellpadding="5">
<?php if (!empty($datasets)) { ?> <?php if (!empty($datasets)) { ?>
<TR valign="top"> <tr valign="top">
<TD align="right"><B><?php print_string("wildcard", "quiz") ?> </B></TD> <td align="right"><b><?php print_string("wildcard", "quiz") ?> </b></td>
<TD align="right">{<?php foreach($datasets as $name => $tmp){break;} p($name) ?>}</TD> <td align="right">{<?php foreach($datasets as $name => $tmp){break;} p($name) ?>}</td>
<TD><B> - <?php print_string("substitutedby", "quiz") ?></B></TD> <td><b> - <?php print_string("substitutedby", "quiz") ?></b></td>
<TD align="left"><?php echo array_shift($datasets) ?></TD> <td align="left"><?php echo array_shift($datasets) ?></td>
</TR> </tr>
<?php foreach ($datasets as $name => $menu) { ?> <?php foreach ($datasets as $name => $menu) { ?>
<TR valign="top"> <tr valign="top">
<TD/> <td/>
<TD align="right">{<?php p($name) ?>}</TD> <td align="right">{<?php p($name) ?>}</td>
<TD/> <td/>
<TD align="left"><?php echo $menu ?> <td align="left"><?php echo $menu ?>
</TR> </tr>
<?php } <?php }
} else { ?> } else { ?>
<TR> <tr>
<TD colspan="4"><?php print_string('nopossibledatasets', 'quiz') ?> <td colspan="4"><?php print_string('nopossibledatasets', 'quiz') ?>
<INPUT type="hidden" name="dataset[]" value="0"/> <input type="hidden" name="dataset[]" value="0"/>
</TD> </td>
</TR> </tr>
<?php } ?> <?php } ?>
<TR valign=top> <tr valign="top">
<TD/> <td/>
<TD/> <td/>
<TD/> <td/>
<TD> <td>
<INPUT type="hidden" name="name" value="<?php p($question->name) ?>" /> <input type="hidden" name="name" value="<?php p($question->name) ?>" />
<INPUT type="hidden" name="questiontext" value="<?php p($question->questiontext) ?>" /> <input type="hidden" name="questiontext" value="<?php p($question->questiontext) ?>" />
<INPUT type="hidden" name="questiontextformat" value="<?php p($question->questiontextformat) ?>" /> <input type="hidden" name="questiontextformat" value="<?php p($question->questiontextformat) ?>" />
<INPUT type="hidden" name="image" value="<?php p($question->image) ?>" /> <input type="hidden" name="image" value="<?php p($question->image) ?>" />
<?php foreach ($answers as $answer) { ?> <?php foreach ($answers as $answer) { ?>
<INPUT type="hidden" name="answer[]" value="<?php p($answer->answer) ?>" /> <input type="hidden" name="answer[]" value="<?php p($answer->answer) ?>" />
<INPUT type="hidden" name="fraction[]" value="<?php p($answer->fraction) ?>" /> <input type="hidden" name="fraction[]" value="<?php p($answer->fraction) ?>" />
<INPUT type="hidden" name="feedback[]" value="<?php p($answer->feedback) ?>" /> <input type="hidden" name="feedback[]" value="<?php p($answer->feedback) ?>" />
<INPUT type="hidden" name="tolerance[]" value="<?php p($answer->tolerance) ?>" /> <input type="hidden" name="tolerance[]" value="<?php p($answer->tolerance) ?>" />
<INPUT type="hidden" name="tolerancetype[]" value="<?php p($answer->tolerancetype) ?>" /> <input type="hidden" name="tolerancetype[]" value="<?php p($answer->tolerancetype) ?>" />
<INPUT type="hidden" name="correctanswerlength[]" value="<?php p($answer->correctanswerlength) ?>" /> <input type="hidden" name="correctanswerlength[]" value="<?php p($answer->correctanswerlength) ?>" />
<?php } ?> <?php } ?>
<?php foreach ($units as $unit) { ?> <?php foreach ($units as $unit) { ?>
<INPUT type="hidden" name="multiplier[]" value="<?php p($unit->multiplier) ?>" /> <input type="hidden" name="multiplier[]" value="<?php p($unit->multiplier) ?>" />
<INPUT type="hidden" name="unit[]" value="<?php p($unit->unit) ?>" /> <input type="hidden" name="unit[]" value="<?php p($unit->unit) ?>" />
<?php } ?> <?php } ?>
</TD> </td>
</TR> </tr>
</TABLE> </table>
<INPUT type="hidden" name=id value="<?php p($question->id) ?>" /> <input type="hidden" name="id" value="<?php p($question->id) ?>" />
<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>" /> <input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<INPUT type="hidden" name="category" value="<?php p($question->category) ?>" /> <input type="hidden" name="category" value="<?php p($question->category) ?>" />
<INPUT type="submit" value="<?php print_string("savechanges") ?>" /> <input type="submit" value="<?php print_string("savechanges") ?>" />
</CENTER> </center>
</FORM> </form>

View file

@ -1,36 +1,36 @@
<FORM name="theform" method="post" action="question.php"> <form name="theform" method="post" action="question.php">
<CENTER> <center>
<TABLE cellpadding=5> <table cellpadding="5">
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("category", "quiz") ?>:</b></p></td>
<TD> <td>
<?php quiz_category_select_menu($course->id, true, true, $question->category); ?> <?php quiz_category_select_menu($course->id, true, true, $question->category); ?>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("questionname", "quiz") ?>:</b></p></td>
<TD> <td>
<INPUT type="text" name="name" size=40 value="<?php p($question->name) ?>" /> <input type="text" name="name" size="40" value="<?php p($question->name) ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?> <?php if (isset($err["name"])) formerr($err["name"]); ?>
</TD> </td>
</TR> </tr>
<tr valign=top> <tr valign="top">
<td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p> <td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>
@ -40,7 +40,7 @@
<br /> <br />
<p><font SIZE="1"> <p><font size="1">
<?php <?php
@ -82,7 +82,7 @@
} else { } else {
echo "<div align=right>"; echo "<div align=\"right\">";
print_string("formattexttype"); print_string("formattexttype");
@ -108,11 +108,11 @@
</tr> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("imagedisplay", "quiz") ?>:</b></p></td>
<TD> <td>
<?php if (empty($images)) { <?php if (empty($images)) {
@ -126,25 +126,25 @@
?> ?>
</TD> </td>
</TR> </tr>
</TABLE> </table>
<INPUT type="hidden" name=id value="<?php p($question->id) ?>" /> <input type="hidden" name="id" value="<?php p($question->id) ?>" />
<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>" /> <input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<INPUT type="hidden" name=defaultgrade value="0" /> <input type="hidden" name="defaultgrade" value="0" />
<INPUT type="submit" value="<?php print_string("savechanges") ?>" /> <input type="submit" value="<?php print_string("savechanges") ?>" />
</CENTER> </center>
</FORM> </form>

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
print_heading_with_help(get_string("editingdescription", "quiz"), "description", "quiz"); print_heading_with_help(get_string("editingdescription", "quiz"), "description", "quiz");
require("description.html"); require("description.html");

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
/////////////////// ///////////////////
/// DESCRIPTION /// /// DESCRIPTION ///

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
if (!empty($question->id)) { if (!empty($question->id)) {
$options = get_record("quiz_match", "question", $question->id); $options = get_record("quiz_match", "question", $question->id);
@ -7,7 +7,7 @@
} }
} }
if (empty($subquestions) and empty($subanswers)) { if (empty($subquestions) and empty($subanswers)) {
for ($i=0; $i<QUIZ_MAX_NUMBER_ANSWERS; $i++) { for ($i=0; $i<quiz_MAX_NUMBER_ANSWERS; $i++) {
$subquestions[] = ""; // Make question slots, default as blank $subquestions[] = ""; // Make question slots, default as blank
$subanswers[] = ""; // Make answer slots, default as blank $subanswers[] = ""; // Make answer slots, default as blank
} }

View file

@ -1,36 +1,36 @@
<FORM name="theform" method="post" action="question.php"> <form name="theform" method="post" action="question.php">
<CENTER> <center>
<TABLE cellpadding=5> <table cellpadding="5">
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("category", "quiz") ?>:</b></p></td>
<TD> <td>
<?php quiz_category_select_menu($course->id, true, true, $question->category); ?> <?php quiz_category_select_menu($course->id, true, true, $question->category); ?>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("questionname", "quiz") ?>:</b></p></td>
<TD> <td>
<INPUT type="text" name="name" size=40 value="<?php p($question->name) ?>" /> <input type="text" name="name" size="40" value="<?php p($question->name) ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?> <?php if (isset($err["name"])) formerr($err["name"]); ?>
</TD> </td>
</TR> </tr>
<tr valign=top> <tr valign="top">
<td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p> <td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>
@ -40,7 +40,7 @@
<br /> <br />
<p><font SIZE="1"> <p><font size="1">
<?php <?php
@ -82,7 +82,7 @@
} else { } else {
echo "<div align=right>"; echo "<div align=\"right\">";
print_string("formattexttype"); print_string("formattexttype");
@ -108,11 +108,11 @@
</tr> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("imagedisplay", "quiz") ?>:</b></p></td>
<TD> <td>
<?php if (empty($images)) { <?php if (empty($images)) {
@ -126,25 +126,25 @@
?> ?>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("choices", "quiz") ?></B>:</P></TD> <td align="right"><p><b><?php print_string("choices", "quiz") ?></b>:</p></td>
<TD><P><?php print_string("filloutthreequestions", "quiz") ?></P> <td><p><?php print_string("filloutthreequestions", "quiz") ?></p>
</TD> </td>
</TR> </tr>
<?PHP <?php
for ($i=1; $i<=QUIZ_MAX_NUMBER_ANSWERS; $i++) { for ($i=1; $i<=QUIZ_MAX_NUMBER_ANSWERS; $i++) {
@ -152,27 +152,27 @@
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php echo get_string("question", "quiz")." $i"; ?> :</B></P></TD> <td align="right"><p><b><?php echo get_string("question", "quiz")." $i"; ?> :</b></p></td>
<TD> <td>
<textarea name="subquestions[]" rows=5 cols=50><?php p($subquestions[$i-1]) ?></textarea> <textarea name="subquestions[]" rows="5" cols="50"><?php p($subquestions[$i-1]) ?></textarea>
<br /> <br />
<?php echo get_string("matchanswer", "quiz")." $i"; ?>&nbsp;&nbsp; <?php echo get_string("matchanswer", "quiz")." $i"; ?>&nbsp;&nbsp;
<INPUT type="text" name="subanswers[]" size=50 value="<?php p($subanswers[$i-1]) ?>" /> <input type="text" name="subanswers[]" size="50" value="<?php p($subanswers[$i-1]) ?>" />
</TD> </td>
</TR> </tr>
<?PHP <?php
} }
@ -180,19 +180,19 @@
</TABLE> </table>
<INPUT type="hidden" name=id value="<?php p($question->id) ?>" /> <input type="hidden" name="id" value="<?php p($question->id) ?>" />
<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>" /> <input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<INPUT type="submit" value="<?php print_string("savechanges") ?>" /> <input type="submit" value="<?php print_string("savechanges") ?>" />
</CENTER> </center>
</FORM> </form>

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
///////////// /////////////
/// MATCH /// /// MATCH ///

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
if ($question->questiontext and $question->id) { if ($question->questiontext and $question->id) {
$answers = quiz_get_answers($question); $answers = quiz_get_answers($question);

View file

@ -1,46 +1,46 @@
<FORM name="theform" method="post" action="question.php"> <form name="theform" method="post" action="question.php">
<CENTER> <center>
<TABLE cellpadding=5> <table cellpadding="5">
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("category", "quiz") ?>:</b></p></td>
<TD> <td>
<?php quiz_category_select_menu($course->id, true, true, $question->category); ?> <?php quiz_category_select_menu($course->id, true, true, $question->category); ?>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("questionname", "quiz") ?>:</b></p></td>
<TD> <td>
<INPUT type="text" name="name" size=40 value="<?php p($question->name) ?>" /> <input type="text" name="name" size="40" value="<?php p($question->name) ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?> <?php if (isset($err["name"])) formerr($err["name"]); ?>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("question", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p></td>
<TD> <td>
<?php if (isset($err["questiontext"])) { <?php if (isset($err["questiontext"])) {
formerr($err["questiontext"]); formerr($err["questiontext"]);
echo "<BR />"; echo "<br />";
} }
@ -58,15 +58,15 @@
?> ?>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("imagedisplay", "quiz") ?>:</b></p></td>
<TD> <td>
<?php if (empty($images)) { <?php if (empty($images)) {
@ -80,24 +80,24 @@
?> ?>
</TD> </td>
</TR> </tr>
</TABLE> </table>
<INPUT type="hidden" name=id value="<?php p($question->id) ?>" /> <input type="hidden" name="id" value="<?php p($question->id) ?>" />
<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>" /> <input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<INPUT type="hidden" name=defaultgrade value="<?php p($question->defaultgrade) ?>" /> <input type="hidden" name="defaultgrade" value="<?php p($question->defaultgrade) ?>" />
<INPUT type="submit" value="<?php print_string("savechanges") ?>" /> <input type="submit" value="<?php print_string("savechanges") ?>" />
</CENTER> </center>
</FORM> </form>

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
/////////////////// ///////////////////
/// MULTIANSWER /// (Embedded - cloze) /// MULTIANSWER /// (Embedded - cloze)

View file

@ -8,7 +8,7 @@
if (!empty($options->answers)) { if (!empty($options->answers)) {
$answersraw = get_records_list("quiz_answers", "id", $options->answers); $answersraw = get_records_list("quiz_answers", "id", $options->answers);
} }
for ($i=0; $i<QUIZ_MAX_NUMBER_ANSWERS; $i++) { for ($i=0; $i<quiz_MAX_NUMBER_ANSWERS; $i++) {
$answers[] = ""; // Make answer slots, default as blank $answers[] = ""; // Make answer slots, default as blank
} }
if (!empty($answersraw)) { if (!empty($answersraw)) {

View file

@ -1,36 +1,36 @@
<FORM name="theform" method="post" action="question.php"> <form name="theform" method="post" action="question.php">
<CENTER> <center>
<TABLE cellpadding=5> <table cellpadding="5">
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("category", "quiz") ?>:</b></p></td>
<TD> <td>
<?php quiz_category_select_menu($course->id, true, true, $question->category); ?> <?php quiz_category_select_menu($course->id, true, true, $question->category); ?>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("questionname", "quiz") ?>:</b></p></td>
<TD> <td>
<INPUT type="text" name="name" size=40 value="<?php p($question->name) ?>" /> <input type="text" name="name" size="40" value="<?php p($question->name) ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?> <?php if (isset($err["name"])) formerr($err["name"]); ?>
</TD> </td>
</TR> </tr>
<tr valign=top> <tr valign="top">
<td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p> <td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>
@ -40,7 +40,7 @@
<br /> <br />
<p><font SIZE="1"> <p><font size="1">
<?php <?php
@ -82,7 +82,7 @@
} else { } else {
echo "<div align=right>"; echo "<div align=\"right\">";
print_string("formattexttype"); print_string("formattexttype");
@ -108,11 +108,11 @@
</tr> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("imagedisplay", "quiz") ?>:</b></p></td>
<TD> <td>
<?php if (empty($images)) { <?php if (empty($images)) {
@ -126,15 +126,15 @@
?> ?>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("answerhowmany", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("answerhowmany", "quiz") ?>:</b></p></td>
<TD> <td>
<?php <?php
@ -148,25 +148,25 @@
?> ?>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("choices", "quiz") ?></B>:</P></TD> <td align="right"><p><b><?php print_string("choices", "quiz") ?></b>:</p></td>
<TD><P><?php print_string("fillouttwochoices", "quiz") ?></P> <td><p><?php print_string("fillouttwochoices", "quiz") ?></p>
</TD> </td>
</TR> </tr>
<?PHP <?php
for ($i=1; $i<=QUIZ_MAX_NUMBER_ANSWERS; $i++) { for ($i=1; $i<=QUIZ_MAX_NUMBER_ANSWERS; $i++) {
@ -182,13 +182,13 @@
?> ?>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php echo get_string("choice", "quiz")." $i"; ?>:</B></P></TD> <td align="right"><p><b><?php echo get_string("choice", "quiz")." $i"; ?>:</b></p></td>
<TD> <td>
<INPUT type="text" name="answer[]" size=50 maxlength=255 value="<?php p($answers[$i-1]->answer) ?>" />&nbsp;&nbsp; <input type="text" name="answer[]" size="50" maxlength="255" value="<?php p($answers[$i-1]->answer) ?>" />&nbsp;&nbsp;
<?php print_string("grade"); <?php print_string("grade");
@ -196,31 +196,31 @@
choose_from_menu($gradeoptionsfull, "fraction[]", $answers[$i-1]->fraction, ""); ?> choose_from_menu($gradeoptionsfull, "fraction[]", $answers[$i-1]->fraction, ""); ?>
<BR> <br>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("feedback", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("feedback", "quiz") ?>:</b></p></td>
<TD> <td>
<textarea name="feedback[]" rows=2 cols=50 wrap="virtual"><?php p($answers[$i-1]->feedback) ?></textarea> <textarea name="feedback[]" rows="2" cols="50" wrap="virtual"><?php p($answers[$i-1]->feedback) ?></textarea>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD colspan=2>&nbsp;</TD> <td colspan="2">&nbsp;</td>
</TR> </tr>
@ -230,19 +230,19 @@
?> ?>
</TABLE> </table>
<INPUT type="hidden" name=id value="<?php p($question->id) ?>" /> <input type="hidden" name="id" value="<?php p($question->id) ?>" />
<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>" /> <input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<INPUT type="submit" value="<?php print_string("savechanges") ?>" /> <input type="submit" value="<?php print_string("savechanges") ?>" />
</CENTER> </center>
</FORM> </form>

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
/////////////////// ///////////////////
/// MULTICHOICE /// /// MULTICHOICE ///

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
// This will only support one answer of the type NUMERICAL // This will only support one answer of the type NUMERICAL
// However, lib.php has support for multiple answers // However, lib.php has support for multiple answers

View file

@ -1,25 +1,25 @@
<FORM name="theform" method="post" action="question.php"> <form name="theform" method="post" action="question.php">
<CENTER> <center>
<TABLE cellpadding=5> <table cellpadding="5">
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("category", "quiz") ?>:</b></p></td>
<TD> <td>
<?php quiz_category_select_menu($course->id, true, true, $question->category); ?> <?php quiz_category_select_menu($course->id, true, true, $question->category); ?>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("questionname", "quiz") ?>:</b></p></td>
<TD> <td>
<INPUT type="text" name="name" size=50 value="<?php p($question->name) ?>" /> <input type="text" name="name" size="50" value="<?php p($question->name) ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?> <?php if (isset($err["name"])) formerr($err["name"]); ?>
</TD> </td>
</TR> </tr>
<tr valign=top> <tr valign="top">
<td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p> <td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>
<br /> <br />
<br /> <br />
<br /> <br />
<p><font SIZE="1"> <p><font size="1">
<?php <?php
if ($usehtmleditor) { if ($usehtmleditor) {
helpbutton("richtext", get_string("helprichtext"), "moodle", true, true); helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
@ -40,7 +40,7 @@
if ($usehtmleditor) { if ($usehtmleditor) {
echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'" />'; echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'" />';
} else { } else {
echo "<div align=right>"; echo "<div align=\"right\">";
print_string("formattexttype"); print_string("formattexttype");
echo ":&nbsp;"; echo ":&nbsp;";
if (!isset($question->questiontextformat)) { if (!isset($question->questiontextformat)) {
@ -53,20 +53,20 @@
?> ?>
</td> </td>
</tr> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("imagedisplay", "quiz") ?>:</b></p></td>
<TD> <td>
<?php if (empty($images)) { <?php if (empty($images)) {
print_string("noimagesyet"); print_string("noimagesyet");
} else { } else {
choose_from_menu($images, "image", "$question->image", get_string("none"),"",""); choose_from_menu($images, "image", "$question->image", get_string("none"),"","");
} }
?> ?>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("correctanswer", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("correctanswer", "quiz") ?>:</b></p></td>
<?php <?php
// Even thou the rest of the module can handle up to six numerical answers, // Even thou the rest of the module can handle up to six numerical answers,
// this form will limit the number of numerical answers to one only. // this form will limit the number of numerical answers to one only.
@ -77,69 +77,69 @@
$acceptederror = ""; $acceptederror = "";
} }
?> ?>
<TD> <td>
<INPUT align="LEFT" type="text" id="correct0" name="answer[]" size="20" value="<?php p($answers[0]->answer) ?>" />&nbsp;&nbsp; <input align="LEFT" type="text" id="correct0" name="answer[]" size="20" value="<?php p($answers[0]->answer) ?>" />&nbsp;&nbsp;
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("acceptederror", "quiz"); ?>:</B></P></TD> <td align="right"><p><b><?php print_string("acceptederror", "quiz"); ?>:</b></p></td>
<TD> <td>
<INPUT align="LEFT" type="text" id="acceptederror0" name="acceptederror[]" size="15" value="<?php p($acceptederror) ?>" />&plusmn; <input align="LEFT" type="text" id="acceptederror0" name="acceptederror[]" size="15" value="<?php p($acceptederror) ?>" />&plusmn;
<!-- Values max and min will be determined when the form is submitted --> <!-- Values max and min will be determined when the form is submitted -->
<INPUT type="HIDDEN" id="min0" name="min[]" value="" /> <input type="HIDDEN" id="min0" name="min[]" value="" />
<INPUT type="HIDDEN" id="max0" name="max[]" value="" /> <input type="HIDDEN" id="max0" name="max[]" value="" />
<INPUT type="HIDDEN" name="fraction[]" value="1" /> <input type="HIDDEN" name="fraction[]" value="1" />
<BR/> <br/>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("feedback", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("feedback", "quiz") ?>:</b></p></td>
<TD> <td>
<textarea name="feedback[]" rows=2 cols=50 wrap="virtual"><?php p($answers[0]->feedback) ?></textarea> <textarea name="feedback[]" rows="2" cols="50" wrap="virtual"><?php p($answers[0]->feedback) ?></textarea>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("unit", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("unit", "quiz") ?>:</b></p></td>
<TD> <td>
<P><INPUT type="HIDDEN" name="multiplier[]" value="1.0" /> <p><input type="HIDDEN" name="multiplier[]" value="1.0" />
<INPUT align="LEFT" type="text" id="defaultunit" name="unit[]" <input align="LEFT" type="text" id="defaultunit" name="unit[]"
size="5" value="<?php p($units[0]->unit) ?>" /> size="5" value="<?php p($units[0]->unit) ?>" />
<B>(<?php print_string("optional", "quiz") ?>)</B></P> <b>(<?php print_string("optional", "quiz") ?>)</b></p>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<td></td> <td></td>
<TD align=left><P><B><?php print_string("alternativeunits", "quiz") ?>:</B></P></TD> <td align="left"><p><b><?php print_string("alternativeunits", "quiz") ?>:</b></p></td>
<td></td> <td></td>
</TR> </tr>
<?PHP <?php
for ($i=1; $i<count($units); $i++) { for ($i=1; $i<count($units); $i++) {
$unit=$units[$i]; $unit=$units[$i];
?> ?>
<TR valign=top> <tr valign="top">
<td></td> <td></td>
<TD align=left> <td align="left">
<P><B><?php print_string("multiplier", "quiz") ?>:</B> <p><b><?php print_string("multiplier", "quiz") ?>:</b>
<INPUT type="text" id="<?php p("multiplier$i") ?>" size="10" <input type="text" id="<?php p("multiplier$i") ?>" size="10"
align="RIGHT" name="multiplier[]" align="RIGHT" name="multiplier[]"
value="<?php p($unit->multiplier) ?>" /> value="<?php p($unit->multiplier) ?>" />
<B>&nbsp;&nbsp;&nbsp;<?php print_string("unit", "quiz") ?>:</B> <b>&nbsp;&nbsp;&nbsp;<?php print_string("unit", "quiz") ?>:</b>
<INPUT align="LEFT" type="text" id="<?php p("unit$i") ?>" <input align="LEFT" type="text" id="<?php p("unit$i") ?>"
name="unit[]" name="unit[]"
size="5" value="<?php p($unit->unit) ?>" /></P> size="5" value="<?php p($unit->unit) ?>" /></p>
</TD> </td>
</TR> </tr>
<?PHP <?php
} /// END for } /// END for
?> ?>
</TABLE> </table>
<INPUT type="hidden" name=id value="<?php p($question->id) ?>" /> <input type="hidden" name="id" value="<?php p($question->id) ?>" />
<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>" /> <input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<INPUT type="submit" onClick="return determineMinAndMax();" value="<?php print_string("savechanges") ?>" /> <input type="submit" onClick="return determineMinAndMax();" value="<?php print_string("savechanges") ?>" />
</CENTER> </center>
</FORM> </form>
<SCRIPT language="JAVASCRIPT"> <script language="JAVASCRIPT">
function determineMinAndMax() { function determineMinAndMax() {
// This client-side script will determine the values for min and max // This client-side script will determine the values for min and max
// based on the input for answer and acceptederror. // based on the input for answer and acceptederror.
@ -174,4 +174,4 @@ function determineMinAndMax() {
} }
} }
} }
</SCRIPT> </script>

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
///////////////// /////////////////
/// NUMERICAL /// /// NUMERICAL ///

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
print_heading_with_help(get_string("editingrandom", "quiz"), "random", "quiz"); print_heading_with_help(get_string("editingrandom", "quiz"), "random", "quiz");
require("random.html"); require("random.html");

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
////////////// //////////////
/// RANDOM /// /// RANDOM ///

View file

@ -4,11 +4,11 @@
<table cellpadding=5> <table cellpadding="5">
<tr valign=top> <tr valign="top">
<td align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("category", "quiz") ?>:</b></p></td>
<td> <td>
@ -18,9 +18,9 @@
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("questionname", "quiz") ?>:</b></p></td>
<td> <td>
@ -30,7 +30,7 @@
} ?> } ?>
<input type="text" name="name" size=40 value="<?php p($question->name) ?>" /> <input type="text" name="name" size="40" value="<?php p($question->name) ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?> <?php if (isset($err["name"])) formerr($err["name"]); ?>
@ -42,13 +42,13 @@
<input type="hidden" name=questiontext value="---" /> <input type="hidden" name="questiontext" value="---" />
<input type="hidden" name=id value="<?php p($question->id) ?>" /> <input type="hidden" name="id" value="<?php p($question->id) ?>" />
<input type="hidden" name=qtype value="<?php p($question->qtype) ?>" /> <input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<input type="submit" value="<?php print_string("savechanges") ?>" /> <input type="submit" value="<?php print_string("savechanges") ?>" />

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
if (!empty($question->id)) { if (!empty($question->id)) {
$options = get_record("quiz_randomsamatch", "question", $question->id); $options = get_record("quiz_randomsamatch", "question", $question->id);
} else { } else {

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
///////////////////// /////////////////////
/// RANDOMSAMATCH /// /// RANDOMSAMATCH ///

View file

@ -1,30 +1,30 @@
<FORM name="theform" method="post" action="question.php"> <form name="theform" method="post" action="question.php">
<CENTER> <center>
<TABLE cellpadding=5> <table cellpadding="5">
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("category", "quiz") ?>:</b></p></td>
<TD> <td>
<?PHP echo $categories[$question->category]; ?> <?php echo $categories[$question->category]; ?>
<input type="hidden" name="category" value="<?PHP echo "$question->category"; ?>" /> <input type="hidden" name="category" value="<?php echo "$question->category"; ?>" />
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("questionname", "quiz") ?>:</b></p></td>
<TD> <td>
<?PHP <?php
if (empty($question->name)) { if (empty($question->name)) {
@ -34,21 +34,21 @@
?> ?>
<INPUT type="text" name="name" size=40 value="<?php p($question->name) ?>" /> <input type="text" name="name" size="40" value="<?php p($question->name) ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?> <?php if (isset($err["name"])) formerr($err["name"]); ?>
</TD> </td>
</TR> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("introduction", "quiz") ?>:</b></p> <td align="right"><p><b><?php print_string("introduction", "quiz") ?>:</b></p>
<br /> <br />
<p><font SIZE="1"> <p><font size="1">
<?php <?php
@ -96,7 +96,7 @@
} else { } else {
echo "<div align=right>"; echo "<div align="right">";
print_string("formattexttype"); print_string("formattexttype");
@ -122,11 +122,11 @@
</tr> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("randomsamatchnumber", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("randomsamatchnumber", "quiz") ?>:</b></p></td>
<TD> <td>
<?php <?php
@ -160,23 +160,23 @@
?> ?>
</TD> </td>
</TR> </tr>
</TABLE> </table>
<INPUT type="hidden" name=id value="<?php p($question->id) ?>" /> <input type="hidden" name="id" value="<?php p($question->id) ?>" />
<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>" /> <input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<INPUT type="submit" value="<?php print_string("savechanges") ?>" /> <input type="submit" value="<?php print_string("savechanges") ?>" />
</CENTER> </center>
</FORM> </form>

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
if (!empty($question->id)) { if (!empty($question->id)) {
$options = get_record("quiz_shortanswer", "question", $question->id); $options = get_record("quiz_shortanswer", "question", $question->id);
} else { } else {
@ -7,7 +7,7 @@
if (!empty($options->answers)) { if (!empty($options->answers)) {
$answersraw = get_records_list("quiz_answers", "id", $options->answers); $answersraw = get_records_list("quiz_answers", "id", $options->answers);
} }
for ($i=0; $i<QUIZ_MAX_NUMBER_ANSWERS; $i++) { for ($i=0; $i<quiz_MAX_NUMBER_ANSWERS; $i++) {
$answers[] = ""; // Make answer slots, default as blank $answers[] = ""; // Make answer slots, default as blank
} }
if (!empty($answersraw)) { if (!empty($answersraw)) {

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
/////////////////// ///////////////////
/// SHORTANSWER /// /// SHORTANSWER ///

View file

@ -1,36 +1,36 @@
<FORM name="theform" method="post" action="question.php"> <form name="theform" method="post" action="question.php">
<CENTER> <center>
<TABLE cellpadding=5> <table cellpadding="5">
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("category", "quiz") ?>:</b></p></td>
<TD> <td>
<?php quiz_category_select_menu($course->id, true, true, $question->category); ?> <?php quiz_category_select_menu($course->id, true, true, $question->category); ?>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("questionname", "quiz") ?>:</b></p></td>
<TD> <td>
<INPUT type="text" name="name" size=50 value="<?php p($question->name) ?>" /> <input type="text" name="name" size="50" value="<?php p($question->name) ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?> <?php if (isset($err["name"])) formerr($err["name"]); ?>
</TD> </td>
</TR> </tr>
<tr valign=top> <tr valign="top">
<td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p> <td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>
@ -40,7 +40,7 @@
<br /> <br />
<p><font SIZE="1"> <p><font size="1">
<?php <?php
@ -82,7 +82,7 @@
} else { } else {
echo "<div align=right>"; echo "<div align=\"right\">";
print_string("formattexttype"); print_string("formattexttype");
@ -108,11 +108,11 @@
</tr> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("imagedisplay", "quiz") ?>:</b></p></td>
<TD> <td>
<?php if (empty($images)) { <?php if (empty($images)) {
@ -126,15 +126,15 @@
?> ?>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("casesensitive", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("casesensitive", "quiz") ?>:</b></p></td>
<TD> <td>
<?php <?php
@ -148,25 +148,25 @@
?> ?>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("correctanswers", "quiz") ?></B>:</P></TD> <td align="right"><p><b><?php print_string("correctanswers", "quiz") ?></b>:</p></td>
<TD> <td>
<P><?php print_string("filloutoneanswer", "quiz") ?></P> <p><?php print_string("filloutoneanswer", "quiz") ?></p>
</TD> </td>
<?PHP <?php
for ($i=1; $i<=QUIZ_MAX_NUMBER_ANSWERS; $i++) { for ($i=1; $i<=QUIZ_MAX_NUMBER_ANSWERS; $i++) {
@ -174,13 +174,13 @@
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php echo get_string("answer", "quiz")." $i"; ?>:</B></P></TD> <td align="right"><p><b><?php echo get_string("answer", "quiz")." $i"; ?>:</b></p></td>
<TD> <td>
<INPUT type="text" name="answer[]" size=50 value="<?php p($answers[$i-1]->answer) ?>" />&nbsp;&nbsp; <input type="text" name="answer[]" size="50" value="<?php p($answers[$i-1]->answer) ?>" />&nbsp;&nbsp;
<?php print_string("grade"); <?php print_string("grade");
@ -188,35 +188,35 @@
choose_from_menu($gradeoptions, "fraction[]", $answers[$i-1]->fraction,""); ?> choose_from_menu($gradeoptions, "fraction[]", $answers[$i-1]->fraction,""); ?>
<BR> <br>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("feedback", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("feedback", "quiz") ?>:</b></p></td>
<TD> <td>
<textarea name="feedback[]" rows=2 cols=50 wrap="virtual"><?php p($answers[$i-1]->feedback) ?></textarea> <textarea name="feedback[]" rows="2" cols="50" wrap="virtual"><?php p($answers[$i-1]->feedback) ?></textarea>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD colspan=2>&nbsp;</TD> <td colspan="2">&nbsp;</td>
</TR> </tr>
<?PHP <?php
} }
@ -224,19 +224,19 @@
</TABLE> </table>
<INPUT type="hidden" name=id value="<?php p($question->id) ?>" /> <input type="hidden" name="id" value="<?php p($question->id) ?>" />
<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>" /> <input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<INPUT type="submit" value="<?php print_string("savechanges") ?>" /> <input type="submit" value="<?php print_string("savechanges") ?>" />
</CENTER> </center>
</FORM> </form>

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
if (!empty($question->id)) { if (!empty($question->id)) {
$options = get_record("quiz_truefalse", "question", "$question->id"); $options = get_record("quiz_truefalse", "question", "$question->id");

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
///////////////// /////////////////
/// TRUEFALSE /// /// TRUEFALSE ///
@ -142,7 +142,7 @@ class quiz_truefalse_qtype extends quiz_default_questiontype {
echo "<input $truechecked type=\"radio\" $readonly $inputname value=\"$true->id\" />$true->answer"; echo "<input $truechecked type=\"radio\" $readonly $inputname value=\"$true->id\" />$true->answer";
echo "</td><td $falsecorrect>"; echo "</td><td $falsecorrect>";
echo "<input $falsechecked type=\"radio\" $readonly $inputname value=\"$false->id\" />$false->answer"; echo "<input $falsechecked type=\"radio\" $readonly $inputname value=\"$false->id\" />$false->answer";
echo "</td></tr></table><br clear=\"all\">";// changed from CLEAR=ALL jm echo "</td></tr></table><br clear=\"all\">";// changed from clear=ALL jm
if ($quiz->feedback && isset($answers[$nameprefix]) if ($quiz->feedback && isset($answers[$nameprefix])
&& $feedback = $answers[$nameprefix]->feedback) { && $feedback = $answers[$nameprefix]->feedback) {
quiz_print_comment( quiz_print_comment(

View file

@ -1,36 +1,36 @@
<FORM name="theform" method="post" action="question.php"> <form name="theform" method="post" action="question.php">
<CENTER> <center>
<TABLE cellpadding=5> <table cellpadding="5">
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("category", "quiz") ?>:</b></p></td>
<TD> <td>
<?php quiz_category_select_menu($course->id, true, true, $question->category); ?> <?php quiz_category_select_menu($course->id, true, true, $question->category); ?>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("questionname", "quiz") ?>:</b></p></td>
<TD> <td>
<INPUT type="text" name="name" size=50 value="<?php p($question->name) ?>" /> <input type="text" name="name" size="50" value="<?php p($question->name) ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?> <?php if (isset($err["name"])) formerr($err["name"]); ?>
</TD> </td>
</TR> </tr>
<tr valign=top> <tr valign="top">
<td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p> <td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>
@ -40,7 +40,7 @@
<br /> <br />
<p><font SIZE="1"> <p><font size="1">
<?php <?php
@ -82,7 +82,7 @@
} else { } else {
echo "<div align=right>"; echo "<div align=\"right\">";
print_string("formattexttype"); print_string("formattexttype");
@ -108,11 +108,11 @@
</tr> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("imagedisplay", "quiz") ?>:</b></p></td>
<TD> <td>
<?php if (empty($images)) { <?php if (empty($images)) {
@ -126,17 +126,17 @@
?> ?>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("correctanswer", "quiz") ?>:</B></P></TD> <td align="right"><p><b><?php print_string("correctanswer", "quiz") ?>:</b></p></td>
<TD> <td>
<?php $menu[0] = get_string("false", "quiz"); <?php $menu[0] = get_string("false", "quiz");
@ -144,49 +144,49 @@
choose_from_menu($menu, "answer", "$question->answer", ""); ?> choose_from_menu($menu, "answer", "$question->answer", ""); ?>
<BR> <br>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("feedback", "quiz") ?> (<?php print_string("true", "quiz") ?>):</B></P></TD> <td align="right"><p><b><?php print_string("feedback", "quiz") ?> (<?php print_string("true", "quiz") ?>):</b></p></td>
<TD> <td>
<textarea name="feedbacktrue" rows=2 cols=50 wrap="virtual"><?php p($true->feedback) ?></textarea> <textarea name="feedbacktrue" rows="2" cols="50" wrap="virtual"><?php p($true->feedback) ?></textarea>
</TD> </td>
</TR> </tr>
<TR valign=top> <tr valign="top">
<TD align=right><P><B><?php print_string("feedback", "quiz") ?> (<?php print_string("false", "quiz") ?>):</B></P></TD> <td align="right"><p><b><?php print_string("feedback", "quiz") ?> (<?php print_string("false", "quiz") ?>):</b></p></td>
<TD> <td>
<textarea name="feedbackfalse" rows=2 cols=50 wrap="virtual"><?php p($false->feedback) ?></textarea> <textarea name="feedbackfalse" rows="2" cols="50" wrap="virtual"><?php p($false->feedback) ?></textarea>
</TD> </td>
</TR> </tr>
</TABLE> </table>
<INPUT type="hidden" name=id value="<?php p($question->id) ?>" /> <input type="hidden" name="id" value="<?php p($question->id) ?>" />
<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>" /> <input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<INPUT type="submit" value="<?php print_string("savechanges") ?>" /> <input type="submit" value="<?php print_string("savechanges") ?>" />
</CENTER> </center>
</FORM> </form>

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
// This function fetches files from the data directory // This function fetches files from the data directory
// Syntax: quizfile.php/quiz id/question id/dir/.../dir/filename.ext // Syntax: quizfile.php/quiz id/question id/dir/.../dir/filename.ext
// It is supposed to be used by the quiz module only // It is supposed to be used by the quiz module only

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
// This script uses installed report plugins to print quiz reports // This script uses installed report plugins to print quiz reports
@ -51,7 +51,7 @@
$strreport = get_string("report", "quiz"); $strreport = get_string("report", "quiz");
print_header_simple("$quiz->name", "", print_header_simple("$quiz->name", "",
"<A HREF=index.php?id=$course->id>$strquizzes</A> "<a href=\"index.php?id=$course->id\">$strquizzes</a>
-> <a href=\"view.php?id=$cm->id\">$quiz->name</a> -> $strreport", -> <a href=\"view.php?id=$cm->id\">$quiz->name</a> -> $strreport",
"", "", true, update_module_button($cm->id, $course->id, $strquiz), navmenu($course, $cm)); "", "", true, update_module_button($cm->id, $course->id, $strquiz), navmenu($course, $cm));
@ -69,7 +69,7 @@
} }
} }
echo "<table cellpadding=10 align=center><tr>"; echo "<table cellpadding=\"10\" align=\"center\"><tr>";
foreach ($reportlist as $report) { foreach ($reportlist as $report) {
$strreport = get_string("report$report", "quiz"); $strreport = get_string("report$report", "quiz");
if ($report == $mode) { if ($report == $mode) {

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
/// Default class for report plugins /// Default class for report plugins

View file

@ -1,4 +1,4 @@
<?PHP // $Id: report.php, <?php // $Id: report.php,
// created from the above 2003/11/20 by Tom Robb tom@robb.net // created from the above 2003/11/20 by Tom Robb tom@robb.net
// Version 2.5 Modified 2004/01/18 // Version 2.5 Modified 2004/01/18
// Further errorsin percentage calculations corrected // Further errorsin percentage calculations corrected
@ -657,7 +657,7 @@ class quiz_report extends quiz_default_report {
} }
////////--------------------------- If it falls through both of the $download choices, print on screen ////////--------------------------- If it falls through both of the $download choices, print on screen
//Print user responses //Print user responses
print ("<table border=1 align=center width=95% cellpadding=2 cellspacing=0>\n"); print ("<table border=\"1\" align=\"center\" width=\"95%\" cellpadding=\"2\" cellspacing=\"0\">\n");
$totcolcount = $table_colcount+2; $totcolcount = $table_colcount+2;
print("<tr><th colspan=$totcolcount>$strindivresp</th></tr>"); print("<tr><th colspan=$totcolcount>$strindivresp</th></tr>");
qr_print_headers($data_tally,"$strname","$strgrade"); qr_print_headers($data_tally,"$strname","$strgrade");
@ -674,23 +674,23 @@ class quiz_report extends quiz_default_report {
//else the data to be printed is in $thisitem['data'] and $thisitem['score'] == 1 shows that the item was correct //else the data to be printed is in $thisitem['data'] and $thisitem['score'] == 1 shows that the item was correct
if ($thisitem['score'] < 1) {$thiscolor = "ff0000";} else {$thiscolor = "000000";} if ($thisitem['score'] < 1) {$thiscolor = "ff0000";} else {$thiscolor = "000000";}
if ($thisitemkey == 0){ if ($thisitemkey == 0){
print("<th align='left'>$thisitem&nbsp;</th>"); print("<th align=\"left\">$thisitem&nbsp;</th>");
} elseif ($thisitemkey == 1){ } elseif ($thisitemkey == 1){
print("<td align='right'>&nbsp;$thisitem%&nbsp;&nbsp;</td>"); print("<td align=\"right\">&nbsp;$thisitem%&nbsp;&nbsp;</td>");
} elseif ($thisitemkey['qtype'] == 2){ } elseif ($thisitemkey['qtype'] == 2){
print("<td>&nbsp;&nbsp;$thisitem[data][answer]&nbsp;&nbsp;</td>"); print("<td>&nbsp;&nbsp;$thisitem[data][answer]&nbsp;&nbsp;</td>");
} elseif ($thisitem['qtype'] == 5) { } elseif ($thisitem['qtype'] == 5) {
if ($thisitem['score'] == 1) {$thiscolor = "blue";} if ($thisitem['score'] == 1) {$thiscolor = "blue";}
if(!$thisitem['data'][1]){$thisitem['data'][1]="($strnoresponse)";} if(!$thisitem['data'][1]){$thisitem['data'][1]="($strnoresponse)";}
print("<td align=center><font size=-2>{$thisitem['data'][0]}<br /><font color='$thiscolor'>{$thisitem['data'][1]}</font></font></td>"); print("<td align=\"center\"><font size=\"-2\">{$thisitem['data'][0]}<br /><font color='$thiscolor'>{$thisitem['data'][1]}</font></font></td>");
} elseif ($thisitem['qtype'] == 3) { } elseif ($thisitem['qtype'] == 3) {
if ($showtext) { if ($showtext) {
print("<td align=center><font color='$thiscolor' size=-2>&nbsp;&nbsp;{$thisitem['data']}&nbsp;&nbsp;</font></td>"); print("<td align=\"center\"><font color='$thiscolor' size=\"-2\">&nbsp;&nbsp;{$thisitem['data']}&nbsp;&nbsp;</font></td>");
} else { } else {
print("<td align=center><font color='$thiscolor'>&nbsp;&nbsp;{$thisitem['data']}&nbsp;&nbsp;</font></td>"); print("<td align=\"center\"><font color='$thiscolor'>&nbsp;&nbsp;{$thisitem['data']}&nbsp;&nbsp;</font></td>");
} }
} else { } else {
print("<td align=center><font color='$thiscolor'>&nbsp;&nbsp;{$thisitem['data']}&nbsp;&nbsp;</font></td>"); print("<td align=\"center\"><font color='$thiscolor'>&nbsp;&nbsp;{$thisitem['data']}&nbsp;&nbsp;</font></td>");
} }
} }
} }
@ -705,44 +705,44 @@ class quiz_report extends quiz_default_report {
print_object($qtally); print_object($qtally);
} }
//print tally of how many selected each choice //print tally of how many selected each choice
print ("<p><table width=95% border=1 align=center cellpadding=2 cellspacing=0>\n"); print ("<p><table width=\"95%\" border=\"1\" align=\"center\" cellpadding=\"2\" cellspacing=\"0\">\n");
print("<tr><th colspan=$totcolcount>$stritemanal</th></tr>"); print("<tr><th colspan=$totcolcount>$stritemanal</th></tr>");
qr_print_headers($data_tally,"Item","&nbsp;"); qr_print_headers($data_tally,"Item","&nbsp;");
//display row with correct answers //display row with correct answers
print("<tr><th colspan=2 align=right>$strcorrresp:</th>"); print("<tr><th colspan=\"2\" align=\"right\">$strcorrresp:</th>");
foreach ($qs_in_order as $qid){ foreach ($qs_in_order as $qid){
if ($quests[$qid]['qtype'] == 5) { if ($quests[$qid]['qtype'] == 5) {
foreach($match_answers[$qid] as $thisans){ foreach($match_answers[$qid] as $thisans){
print("<th align='center'>&nbsp;$thisans&nbsp;</th>"); print("<th align=\"center\">&nbsp;$thisans&nbsp;</th>");
} }
} else { } else {
print("<th align='center'>&nbsp;{$quests[$qid]['correct']}&nbsp;</th>"); print("<th align=\"center\">&nbsp;{$quests[$qid]['correct']}&nbsp;</th>");
} }
} }
print("</tr>\n"); print("</tr>\n");
//display a row for each possible multiple choice with $max_choices being highest row,$table_colcount is the width //display a row for each possible multiple choice with $max_choices being highest row,$table_colcount is the width
for ($i = 1; $i<= $max_choices;$i++){ for ($i = 1; $i<= $max_choices;$i++){
print("<tr valign=top><th colspan=2 align=right>&nbsp;M/C #$i</td>"); print("<tr valign=\"top\"><th colspan=\"2\" align=\"right\">&nbsp;M/C #$i</td>");
//display answer tallies //display answer tallies
for ($j = 1; $j <= $table_colcount; $j++){ for ($j = 1; $j <= $table_colcount; $j++){
//substitute "<br />" for a "//" //substitute "<br />" for a "//"
$nowdata = $analysis[$i][$j]; $nowdata = $analysis[$i][$j];
if (strpos($nowdata,"//")>0) {$nowdata = str_replace("//","<br />",$nowdata);} if (strpos($nowdata,"//")>0) {$nowdata = str_replace("//","<br />",$nowdata);}
print("<td align='center'>&nbsp;$nowdata</td>"); print("<td align=\"center\">&nbsp;$nowdata</td>");
} }
} }
print("</tr>\n"); print("</tr>\n");
//Display the total percent correct //Display the total percent correct
print("<tr valign=top><th align=right colspan=2>$strpercentcorrect:</th>"); print("<tr valign=\"top\"><th align=\"right\" colspan=\"2\">$strpercentcorrect:</th>");
for ($i = 0; $i< $table_colcount;$i++){ for ($i = 0; $i< $table_colcount;$i++){
print ("<th>{$pct_correct[$i]}</th> "); print ("<th>{$pct_correct[$i]}</th> ");
} }
print("</tr>\n"); print("</tr>\n");
//Finally display the itemanalysis //Finally display the itemanalysis
print("<tr valign=top valign='middle'><th align=right colspan=2>"); print("<tr valign=\"top\" valign=\"middle\"><th align=\"right\" colspan=\"2\">");
helpbutton("discrimination", "", "quiz"); helpbutton("discrimination", "", "quiz");
print(" $strdiscrimination:</th>"); print(" $strdiscrimination:</th>");
for ($i = 1; $i<= $table_colcount;$i++){ for ($i = 1; $i<= $table_colcount;$i++){
@ -753,30 +753,30 @@ class quiz_report extends quiz_default_report {
} else { } else {
$val = 0; $val = 0;
} }
print ("<th valign='middle'><font size=-1>$val ({$top_scores[$i]}/{$bott_scores[$i]})</font></th> "); print ("<th valign=\"middle\"><font size=\"-1\">$val ({$top_scores[$i]}/{$bott_scores[$i]})</font></th> ");
} }
print("</tr>\n"); print("</tr>\n");
print("</table>\n"); print("</table>\n");
//Now printout the questions (and M/C answers if $containsMC //Now printout the questions (and M/C answers if $containsMC
print ("<p><table width=95% border=1 align=center cellpadding=2 cellspacing=0>\n"); print ("<p><table width=\"95%\" border=\"1\" align=\"center\" cellpadding=\"2\" cellspacing=\"0\">\n");
if ($containsMCTF){$ws = " ". $strwithsummary;} else {$ws = "";} if ($containsMCTF){$ws = " ". $strwithsummary;} else {$ws = "";}
print("<tr><th colspan=3>QUIZ: $quiz->name&nbsp;&nbsp; -- &nbsp;&nbsp;$strlistitems$ws</th></tr>\n"); print("<tr><th colspan=\"3\">QUIZ: $quiz->name&nbsp;&nbsp; -- &nbsp;&nbsp;$strlistitems$ws</th></tr>\n");
$qcount = 0; $qcount = 0;
$itemcount = 0; //needed since matching Qs adds additional columns of data in $analysis $itemcount = 0; //needed since matching Qs adds additional columns of data in $analysis
foreach ($qs_in_order as $qid){ foreach ($qs_in_order as $qid){
$qcount++; $qcount++;
if ($quests[$qid]['qtype']==5) { $itemcount = $itemcount + $match_number[$qid];} else {$itemcount++;} if ($quests[$qid]['qtype']==5) { $itemcount = $itemcount + $match_number[$qid];} else {$itemcount++;}
print("<tr valign=top><th width='10%'>Q-$qcount</th><td colspan=2>{$quests[$qid]['qtext']}</td></tr>\n"); print("<tr valign=\"top\"><th width='10%'>Q-$qcount</th><td colspan=\"2\">{$quests[$qid]['qtext']}</td></tr>\n");
if($quests[$qid]['qtype']==3){ if($quests[$qid]['qtype']==3){
$nowchoices = $quests[$qid]['choice']; $nowchoices = $quests[$qid]['choice'];
foreach($nowchoices as $thischoice){ foreach($nowchoices as $thischoice){
$cno = $thischoice['choiceno']; $cno = $thischoice['choiceno'];
$nowstat = $analysis[$cno][$itemcount]; $nowstat = $analysis[$cno][$itemcount];
$pct_cor = qr_make_pct($nowstat,$total_user_count); $pct_cor = qr_make_pct($nowstat,$total_user_count);
print("<tr valign=top><td align='right' width='10%'>$nowstat ($pct_cor%)&nbsp;</td>"); print("<tr valign=\"top\"><td align=\"right\" width=\"10%\">$nowstat ($pct_cor%)&nbsp;</td>");
print("<td width='5%' align='center'><b>A-$cno</b></td><td>{$thischoice['answer']}</td></tr>\n"); print("<td width=\"5%\" align=\"center\"><b>A-$cno</b></td><td>{$thischoice['answer']}</td></tr>\n");
} }
} }
if($quests[$qid]['qtype']==2){ if($quests[$qid]['qtype']==2){
@ -785,21 +785,21 @@ class quiz_report extends quiz_default_report {
$colpos = strpos($nowstat,":"); $colpos = strpos($nowstat,":");
$nowresp = substr($nowstat,$colpos+1); $nowresp = substr($nowstat,$colpos+1);
$pct_cor = qr_make_pct($nowresp,$total_user_count); $pct_cor = qr_make_pct($nowresp,$total_user_count);
print("<tr valign=top><td align='right'>$nowresp ($pct_cor%)&nbsp;</td>"); print("<tr valign=\"top\"><td align=\"right\">$nowresp ($pct_cor%)&nbsp;</td>");
print("<td colspan=2 align=left>True</td></tr>\n"); print("<td colspan=\"2\" align=\"left\">True</td></tr>\n");
//"False" responses //"False" responses
$nowstat = $analysis[2][$itemcount]; $nowstat = $analysis[2][$itemcount];
$colpos = strpos($nowstat,":"); $colpos = strpos($nowstat,":");
$nowresp = substr($nowstat,$colpos+1); $nowresp = substr($nowstat,$colpos+1);
$pct_cor = qr_make_pct($nowresp,$total_user_count); $pct_cor = qr_make_pct($nowresp,$total_user_count);
print("<tr valign=top><td align='right'>$nowresp ($pct_cor%)&nbsp;</td>"); print("<tr valign=\"top\"><td align=\"right\">$nowresp ($pct_cor%)&nbsp;</td>");
print("<td colspan=2 align=left>False</td></tr>\n"); print("<td colspan=\"2\" align=\"left\">False</td></tr>\n");
} }
} }
print("</table>\n"); print("</table>\n");
echo "<br />\n"; echo "<br />\n";
echo "<table border=0 align=center><tr>\n"; echo "<table border=\"0\" align=\"center\"><tr>\n";
echo "<td>"; echo "<td>";
unset($options); unset($options);
$options["id"] = "$cm->id"; $options["id"] = "$cm->id";
@ -894,7 +894,7 @@ function qr_print_headers($data_tally,$nm,$gd){
global $qs_in_order,$qtally,$quests,$total_user_count,$match_number,$strquestion; global $qs_in_order,$qtally,$quests,$total_user_count,$match_number,$strquestion;
$qcount = 0; $qcount = 0;
if($nm == "Item") { if($nm == "Item") {
print("<tr><th colspan=2 align=right>$strquestion:</th>"); print("<tr><th colspan=\"2\" align=\"right\">$strquestion:</th>");
} else { } else {
print("<tr><th>$nm</th><th width='5%'>$gd</th>"); print("<tr><th>$nm</th><th width='5%'>$gd</th>");
} }
@ -1025,20 +1025,20 @@ function qr_match_array($nowQ){
function qr_match_table($resplist){ function qr_match_table($resplist){
global $quiz_matches; global $quiz_matches;
$tbl = "\n<table border=0 cellspacing=0 cellpadding=2 align=center><tr valign='middle' align='center'>"; $tbl = "\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\"><tr valign=\"middle\" align=\"center\">";
$resp_array = explode(",",$resplist); $resp_array = explode(",",$resplist);
$q_cnt=0; $q_cnt=0;
foreach ($resp_array as $resp_pair){ foreach ($resp_array as $resp_pair){
$q_cnt++; $q_cnt++;
$tbl = $tbl ."<td><font size-1> $q_cnt</font></td>"; $tbl = $tbl ."<td><font size-1> $q_cnt</font></td>";
} }
$tbl = $tbl . "</tr>\n<tr valign=middle>"; $tbl = $tbl . "</tr>\n<tr valign=\"middle\">";
foreach ($resp_array as $resp_pair){ foreach ($resp_array as $resp_pair){
$resp_QA = explode("-",$resp_pair); $resp_QA = explode("-",$resp_pair);
if ($resp_QA[0] == $resp_QA[1]){ if ($resp_QA[0] == $resp_QA[1]){
$qa = "<b> <font size=-2>{$quiz_matches[$resp_QA[0]]['Q']}</font>&nbsp;- <font color='blue' size=-2>{$quiz_matches[$resp_QA[1]]['A']}</font></b>"; $qa = "<b> <font size=\"-2\">{$quiz_matches[$resp_QA[0]]['Q']}</font>&nbsp;- <font color=\"blue\" size=\"-2\">{$quiz_matches[$resp_QA[1]]['A']}</font></b>";
} else{ } else{
$qa = "<b><font size=-2> {$quiz_matches[$resp_QA[0]]['Q']}</font>&nbsp;- <font color='red' size=-2> {$quiz_matches[$resp_QA[1]]['A']}</font></b>"; $qa = "<b><font size=\"-2\"> {$quiz_matches[$resp_QA[0]]['Q']}</font>&nbsp;- <font color=\"red\" size=\"-2\"> {$quiz_matches[$resp_QA[1]]['A']}</font></b>";
} }
// $qa = $resp_QA[0] . "=" . $resp_QA[1] ; // $qa = $resp_QA[0] . "=" . $resp_QA[1] ;
$tbl = $tbl . "<td>$qa</td>"; $tbl = $tbl . "<td>$qa</td>";

View file

@ -107,7 +107,7 @@ class quiz_report extends quiz_default_report {
} }
//Embed script for warning //Embed script for warning
echo "\n<script lang=javascript>\n<!--\nfunction delcheck(){\n "; echo "\n<script lang=\"javascript\">\n<!--\nfunction delcheck(){\n ";
echo "if (confirm('$strreallydel')) {\n"; echo "if (confirm('$strreallydel')) {\n";
echo " document.delform.del.value='all';\n return true;\n"; echo " document.delform.del.value='all';\n return true;\n";
echo " } else {\n"; echo " } else {\n";
@ -124,7 +124,7 @@ class quiz_report extends quiz_default_report {
//There might be a more elegant way than using the <center> tag for this //There might be a more elegant way than using the <center> tag for this
echo "<center><input type=\"submit\" value=\"$strdeleteselected\">&nbsp;"; echo "<center><input type=\"submit\" value=\"$strdeleteselected\">&nbsp;";
echo "<input type=button value=\"$strdeleteall\" onClick=\"if(delcheck()){document.delform.submit()}\" />\n</center>\n"; echo "<input type=\"button\" value=\"$strdeleteall\" onClick=\"if(delcheck()){document.delform.submit()}\" />\n</center>\n";
echo "</form>\n"; echo "</form>\n";
return true; return true;
@ -145,7 +145,7 @@ class quiz_report extends quiz_default_report {
} else { } else {
$attemptlapse = "..."; $attemptlapse = "...";
} }
$button = "<input type=checkbox name=\"box$attempt->id\" value=\"$attempt->id\" />"; $button = "<input type=\"checkbox\" name=\"box$attempt->id\" value=\"$attempt->id\" />";
$revurl = "review.php?q=$quiz->id&attempt=$attempt->id"; $revurl = "review.php?q=$quiz->id&attempt=$attempt->id";
if ($attemptgrade == $bestgrade) { if ($attemptgrade == $bestgrade) {
$userattempts[] = "$button&nbsp;<span class=\"highlight\">$attemptgrade</span>&nbsp;<a href=\"$revurl\">$attemptdate</a>&nbsp;($attemptlapse)"; $userattempts[] = "$button&nbsp;<span class=\"highlight\">$attemptgrade</span>&nbsp;<a href=\"$revurl\">$attemptdate</a>&nbsp;($attemptlapse)";

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
/// Overview report just displays a big table of all the attempts /// Overview report just displays a big table of all the attempts

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
/// Overview report just displays a big table of all the attempts /// Overview report just displays a big table of all the attempts
@ -642,7 +642,7 @@ class quiz_report extends quiz_default_report {
/// Otherwise, display the table as HTML /// Otherwise, display the table as HTML
echo "<table border=1 align=\"center\">"; echo "<table border=\"1\" align=\"center\">";
echo "<tr>"; echo "<tr>";
echo "<td>&nbsp;</td>"; echo "<td>&nbsp;</td>";
for ($i=1; $i<=$count; $i++) { for ($i=1; $i<=$count; $i++) {
@ -679,7 +679,7 @@ class quiz_report extends quiz_default_report {
echo "</table>"; echo "</table>";
echo "<br />"; echo "<br />";
echo "<table border=0 align=center><tr>"; echo "<table border=\"0\" align=\"center\"><tr>";
echo "<td>"; echo "<td>";
unset($options); unset($options);
$options["id"] = "$cm->id"; $options["id"] = "$cm->id";

View file

@ -1,4 +1,4 @@
<?PHP //$Id$ <?php //$Id$
//This php script contains all the stuff to backup/restore //This php script contains all the stuff to backup/restore
//quiz mods //quiz mods

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
// This page prints a review of a particular quiz attempt // This page prints a review of a particular quiz attempt
@ -73,7 +73,7 @@
$stroverdue = get_string("overdue", "quiz"); $stroverdue = get_string("overdue", "quiz");
print_header_simple("$quiz->name", "", print_header_simple("$quiz->name", "",
"<A HREF=index.php?id=$course->id>$strquizzes</A> "<a href=\"index.php?id=$course->id\">$strquizzes</a>
-> <a href=\"view.php?id=$cm->id\">$quiz->name</a> -> $strreview", -> <a href=\"view.php?id=$cm->id\">$quiz->name</a> -> $strreview",
"", "", true); "", "", true);

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Code fragment to define the version of quiz // Code fragment to define the version of quiz

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
// This page prints a particular instance of quiz // This page prints a particular instance of quiz
@ -46,7 +46,7 @@
$strquiz = get_string("modulename", "quiz"); $strquiz = get_string("modulename", "quiz");
print_header_simple("$quiz->name", "", print_header_simple("$quiz->name", "",
"<A HREF=index.php?id=$course->id>$strquizzes</A> -> $quiz->name", "<a href=\"index.php?id=$course->id\">$strquizzes</a> -> $quiz->name",
"", "", true, update_module_button($cm->id, $course->id, $strquiz), navmenu($course, $cm)); "", "", true, update_module_button($cm->id, $course->id, $strquiz), navmenu($course, $cm));
if (isteacher($course->id)) { if (isteacher($course->id)) {
@ -54,7 +54,7 @@
$usercount = count_records("quiz_grades", "quiz", "$quiz->id"); $usercount = count_records("quiz_grades", "quiz", "$quiz->id");
$strusers = get_string("users"); $strusers = get_string("users");
$strviewallanswers = get_string("viewallanswers","quiz",$attemptcount); $strviewallanswers = get_string("viewallanswers","quiz",$attemptcount);
echo "<p align=right><a href=\"report.php?id=$cm->id\">$strviewallanswers ($usercount $strusers)</a></p>"; echo "<p align=\"right\"><a href=\"report.php?id=$cm->id\">$strviewallanswers ($usercount $strusers)</a></p>";
} else if (!$cm->visible) { } else if (!$cm->visible) {
notice(get_string("activityiscurrentlyhidden")); notice(get_string("activityiscurrentlyhidden"));
} }
@ -83,8 +83,8 @@
} }
if ($quiz->attempts > 1) { if ($quiz->attempts > 1) {
echo "<p align=center>".get_string("attemptsallowed", "quiz").": $quiz->attempts</p>"; echo "<p align=\"center\">".get_string("attemptsallowed", "quiz").": $quiz->attempts</p>";
echo "<p align=center>".get_string("grademethod", "quiz").": ".$QUIZ_GRADE_METHOD[$quiz->grademethod]."</p>"; echo "<p align=\"center\">".get_string("grademethod", "quiz").": ".$QUIZ_GRADE_METHOD[$quiz->grademethod]."</p>";
} else { } else {
echo "<br />"; echo "<br />";
} }
@ -116,7 +116,7 @@
if ($quiz->grade) { if ($quiz->grade) {
$attemptgrade = format_float(($attempt->sumgrades/$quiz->sumgrades)*$quiz->grade); $attemptgrade = format_float(($attempt->sumgrades/$quiz->sumgrades)*$quiz->grade);
if ($attemptgrade == $mygrade) { if ($attemptgrade == $mygrade) {
$attemptgrade = "<span class=highlight>$attemptgrade</span>"; $attemptgrade = "<span class=\"highlight\">$attemptgrade</span>";
} }
if (!$available and $quiz->review) { if (!$available and $quiz->review) {
$attemptgrade = "<a href=\"review.php?q=$quiz->id&attempt=$attempt->id\">$attemptgrade</a>"; $attemptgrade = "<a href=\"review.php?q=$quiz->id&attempt=$attempt->id\">$attemptgrade</a>";

View file

@ -1,4 +1,4 @@
<?PHP //$Id$ <?php //$Id$
//This php script contains all the stuff to backup/restore //This php script contains all the stuff to backup/restore
//resource mods //resource mods

View file

@ -1,44 +1,44 @@
<form method="post" action="module.php" name="form"> <form method="post" action="module.php" name="form">
<table cellpadding=9 cellspacing=0 > <table cellpadding="9" cellspacing="0" >
<tr valign=top> <tr valign="top">
<td align=right><p>resource_framesize:</td> <td align="right"><p>resource_framesize:</td>
<td> <td>
<input name=resource_framesize type=text size=5 value="<?php p($CFG->resource_framesize) ?>" /> <input name="resource_framesize" type="text" size="5" value="<?php p($CFG->resource_framesize) ?>" />
</td> </td>
<td> <td>
<?php print_string("configframesize", "resource") ?> <?php print_string("configframesize", "resource") ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p>resource_websearch:</td> <td align="right"><p>resource_websearch:</td>
<td> <td>
<input name=resource_websearch type=text size=30 value="<?php p($CFG->resource_websearch) ?>" /> <input name="resource_websearch" type="text" size="30" value="<?php p($CFG->resource_websearch) ?>" />
</td> </td>
<td> <td>
<?php print_string("configwebsearch", "resource") ?> <?php print_string("configwebsearch", "resource") ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p>resource_defaulturl:</td> <td align="right"><p>resource_defaulturl:</td>
<td> <td>
<input name=resource_defaulturl type=text size=30 value="<?php p($CFG->resource_defaulturl) ?>" /> <input name="resource_defaulturl" type="text" size="30" value="<?php p($CFG->resource_defaulturl) ?>" />
</td> </td>
<td> <td>
<?php print_string("configdefaulturl", "resource") ?> <?php print_string("configdefaulturl", "resource") ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p>resource_secretphrase:</td> <td align="right"><p>resource_secretphrase:</td>
<td> <td>
<input name=resource_secretphrase type=text size=30 value="<?php p($CFG->resource_secretphrase) ?>" /> <input name="resource_secretphrase" type="text" size="30" value="<?php p($CFG->resource_secretphrase) ?>" />
</td> </td>
<td> <td>
<?php print_string("configsecretphrase", "resource") ?> <?php print_string("configsecretphrase", "resource") ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p>resource_filterexternalpages:</td> <td align="right"><p>resource_filterexternalpages:</td>
<td> <td>
<?php <?php
unset($choices); unset($choices);
@ -51,8 +51,8 @@
<?php print_string("configfilterexternalpages", "resource") ?> <?php print_string("configfilterexternalpages", "resource") ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p>resource_popup:</td> <td align="right"><p>resource_popup:</td>
<td> <td>
<?php <?php
unset($choices); unset($choices);
@ -67,11 +67,11 @@
</tr> </tr>
<?php foreach ($RESOURCE_WINDOW_OPTIONS as $optionname) { <?php foreach ($RESOURCE_WINDOW_OPTIONS as $optionname) {
$defaultvalue = "resource_popup$optionname"; $defaultvalue = "resource_popup$optionname";
echo "<tr valign=top>"; echo "<tr valign=\"top\">";
echo "<td align=right><p>$defaultvalue:</td>"; echo "<td align=\"right\"><p>$defaultvalue:</td>";
echo "<td>"; echo "<td>";
if ($optionname == "height" or $optionname == "width") { if ($optionname == "height" or $optionname == "width") {
echo "<input name=$defaultvalue type=text size=5 value=\"".$CFG->$defaultvalue."\" />"; echo "<input name=$defaultvalue type=\"text\" size=\"5\" value=\"".$CFG->$defaultvalue."\" />";
} else { } else {
choose_from_menu ($choices, $defaultvalue, $CFG->$defaultvalue, ""); choose_from_menu ($choices, $defaultvalue, $CFG->$defaultvalue, "");
} }
@ -82,8 +82,8 @@
echo "</tr>"; echo "</tr>";
} }
?> ?>
<tr valign=top> <tr valign="top">
<td align=right><p>resource_windowsettings:</td> <td align="right"><p>resource_windowsettings:</td>
<td> <td>
<?php <?php
unset($choices); unset($choices);
@ -96,8 +96,8 @@
<?php print_string("configwindowsettings", "resource") ?> <?php print_string("configwindowsettings", "resource") ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p>resource_parametersettings:</td> <td align="right"><p>resource_parametersettings:</td>
<td> <td>
<?php <?php
unset($choices); unset($choices);
@ -111,7 +111,7 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan=3 align=center> <td colspan="3" align="center">
<input type="submit" value="<?php print_string("savechanges") ?>" /></td> <input type="submit" value="<?php print_string("savechanges") ?>" /></td>
</tr> </tr>
</table> </table>

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
// Manage all uploaded files in a course file area // Manage all uploaded files in a course file area
@ -82,7 +82,7 @@
print_heading(get_string("publicsitefileswarning"), "center", 2); print_heading(get_string("publicsitefileswarning"), "center", 2);
} }
echo "<table border=0 align=center cellspacing=3 cellpadding=3 width=640>"; echo "<table border=\"0\" align=\"center\" cellspacing=\"3\" cellpadding=\"3\" width=\"640\">";
echo "<tr>"; echo "<tr>";
echo "<td colspan=\"2\">"; echo "<td colspan=\"2\">";
} }
@ -147,25 +147,25 @@
$strmaxsize = get_string("maxsize", "", $filesize); $strmaxsize = get_string("maxsize", "", $filesize);
$strcancel = get_string("cancel"); $strcancel = get_string("cancel");
echo "<P>$struploadafile ($strmaxsize) --> <B>$wdir</B>"; echo "<p>$struploadafile ($strmaxsize) --> <b>$wdir</b>";
echo "<TABLE><TR><TD COLSPAN=2>"; echo "<table><tr><td colspan=\"2\">";
echo "<FORM ENCTYPE=\"multipart/form-data\" METHOD=\"post\" ACTION=\"".$ME."\">"; echo "<form enctype=\"multipart/form-data\" method=\"post\" action=\"".$ME."\">";
echo " <INPUT TYPE=hidden NAME=MAX_FILE_SIZE value=\"$upload_max_filesize\" />"; echo " <input type=\"hidden\" name=MAX_FILE_SIZE value=\"$upload_max_filesize\" />";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir />"; echo " <input type=\"hidden\" name=\"wdir\" value=$wdir />";
echo " <INPUT TYPE=hidden NAME=action VALUE=upload />"; echo " <input type=\"hidden\" name=\"action\" value=\"upload\" />";
echo " <INPUT NAME=\"userfile\" TYPE=\"file\" size=\"60\" />"; echo " <input name=\"userfile\" type=\"file\" size=\"60\" />";
echo " </TD><TR><TD WIDTH=10>"; echo " </td><tr><td width=\"10\">";
echo " <INPUT TYPE=submit NAME=save VALUE=\"$struploadthisfile\" />"; echo " <input type=\"submit\" name=\"save\" value=\"$struploadthisfile\" />";
echo "</FORM>"; echo "</form>";
echo "</TD><TD WIDTH=100%>"; echo "</td><td width=\"100%\">";
echo "<FORM ACTION=\"".$ME."\" METHOD=\"get\">"; echo "<form action=\"".$ME."\" method=\"get\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir />"; echo " <input type=\"hidden\" name=\"wdir\" value=$wdir />";
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel />"; echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />";
echo " <INPUT TYPE=submit VALUE=\"$strcancel\" />"; echo " <input type=\"submit\" value=\"$strcancel\" />";
echo "</FORM>"; echo "</form>";
echo "</TD></TR></TABLE>"; echo "</td></tr></table>";
} }
html_footer(); html_footer();
break; break;
@ -176,7 +176,7 @@
foreach ($USER->filelist as $file) { foreach ($USER->filelist as $file) {
$fullfile = $basedir.$file; $fullfile = $basedir.$file;
if (! fulldelete($fullfile)) { if (! fulldelete($fullfile)) {
echo "<BR>Error: Could not delete: $fullfile"; echo "<br />Error: Could not delete: $fullfile";
} }
} }
clearfilelist(); clearfilelist();
@ -186,7 +186,7 @@
} else { } else {
html_header($course, $wdir); html_header($course, $wdir);
if (setfilelist($_POST)) { if (setfilelist($_POST)) {
echo "<p align=center>".get_string("deletecheckwarning").":</p>"; echo "<p align=\"center\">".get_string("deletecheckwarning").":</p>";
print_simple_box_start("center"); print_simple_box_start("center");
printfilelist($USER->filelist); printfilelist($USER->filelist);
print_simple_box_end(); print_simple_box_end();
@ -206,7 +206,7 @@
if ($count = setfilelist($_POST)) { if ($count = setfilelist($_POST)) {
$USER->fileop = $action; $USER->fileop = $action;
$USER->filesource = $wdir; $USER->filesource = $wdir;
echo "<p align=center>"; echo "<p align=\"center\">";
print_string("selectednowmove", "moodle", $count); print_string("selectednowmove", "moodle", $count);
echo "</p>"; echo "</p>";
} }
@ -222,7 +222,7 @@
$oldfile = $basedir.$file; $oldfile = $basedir.$file;
$newfile = $basedir.$wdir."/".$shortfile; $newfile = $basedir.$wdir."/".$shortfile;
if (!rename($oldfile, $newfile)) { if (!rename($oldfile, $newfile)) {
echo "<P>Error: $shortfile not moved"; echo "<p>Error: $shortfile not moved";
} }
} }
} }
@ -247,24 +247,24 @@
$strcancel = get_string("cancel"); $strcancel = get_string("cancel");
$strrenamefileto = get_string("renamefileto", "moodle", $file); $strrenamefileto = get_string("renamefileto", "moodle", $file);
html_header($course, $wdir, "form.name"); html_header($course, $wdir, "form.name");
echo "<P>$strrenamefileto:"; echo "<p>$strrenamefileto:";
echo "<TABLE><TR><TD>"; echo "<table><tr><td>";
echo "<FORM ACTION=\"".$ME."\" METHOD=\"post\" NAME=\"form\">"; echo "<form action=\"".$ME."\" method=\"post\" name=\"form\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir />"; echo " <input type=\"hidden\" name=\"wdir\" value=$wdir />";
echo " <INPUT TYPE=hidden NAME=action VALUE=rename />"; echo " <input type=\"hidden\" name=\"action\" value=\"rename\" />";
echo " <INPUT TYPE=hidden NAME=oldname VALUE=\"$file\" />"; echo " <input type=\"hidden\" name=\"oldname\" value=\"$file\" />";
echo " <INPUT TYPE=text NAME=name SIZE=35 VALUE=\"$file\" />"; echo " <input type=\"text\" name=\"name\" size=\"35\" value=\"$file\" />";
echo " <INPUT TYPE=submit VALUE=\"$strrename\" />"; echo " <input type=\"submit\" value=\"$strrename\" />";
echo "</FORM>"; echo "</form>";
echo "</TD><TD>"; echo "</td><td>";
echo "<FORM ACTION=\"".$ME."\" METHOD=get>"; echo "<form action=\"".$ME."\" method=\"get\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir />"; echo " <input type=\"hidden\" name=\"wdir\" value=$wdir />";
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel />"; echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />";
echo " <INPUT TYPE=submit VALUE=\"$strcancel\" />"; echo " <input type=\"submit\" value=\"$strcancel\" />";
echo "</FORM>"; echo "</form>";
echo "</TD></TR></TABLE>"; echo "</td></tr></table>";
} }
html_footer(); html_footer();
break; break;
@ -285,23 +285,23 @@
$strcancel = get_string("cancel"); $strcancel = get_string("cancel");
$strcreatefolder = get_string("createfolder", "moodle", $wdir); $strcreatefolder = get_string("createfolder", "moodle", $wdir);
html_header($course, $wdir, "form.name"); html_header($course, $wdir, "form.name");
echo "<P>$strcreatefolder:"; echo "<p>$strcreatefolder:";
echo "<TABLE><TR><TD>"; echo "<table><tr><td>";
echo "<FORM ACTION=\"".$ME."\" METHOD=post NAME=form>"; echo "<form action=\"".$ME."\" method=\"post\" name=\"form\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir />"; echo " <input type=\"hidden\" name=\"wdir\" value=$wdir />";
echo " <INPUT TYPE=hidden NAME=action VALUE=mkdir />"; echo " <input type=\"hidden\" name=\"action\" value=\"mkdir\" />";
echo " <INPUT TYPE=text NAME=name SIZE=35 />"; echo " <input type=\"text\" name=\"name\" size=\"35\" />";
echo " <INPUT TYPE=submit VALUE=\"$strcreate\" />"; echo " <input type=\"submit\" value=\"$strcreate\" />";
echo "</FORM>"; echo "</form>";
echo "</TD><TD>"; echo "</td><td>";
echo "<FORM ACTION=\"".$ME."\" METHOD=get>"; echo "<form action=\"".$ME."\" method=\"get\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir />"; echo " <input type=\"hidden\" name=\"wdir\" value=$wdir />";
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel />"; echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />";
echo " <INPUT TYPE=submit VALUE=\"$strcancel\" />"; echo " <input type=\"submit\" value=\"$strcancel\" />";
echo "</FORM>"; echo "</form>";
echo "</TD></TR></TABLE>"; echo "</td></tr></table>";
} }
html_footer(); html_footer();
break; break;
@ -315,7 +315,7 @@
displaydir($wdir); displaydir($wdir);
} else { } else {
$streditfile = get_string("edit", "", "<B>$file</B>"); $streditfile = get_string("edit", "", "<b>$file</b>");
$fileptr = fopen($basedir.$file, "r"); $fileptr = fopen($basedir.$file, "r");
$contents = fread($fileptr, filesize($basedir.$file)); $contents = fread($fileptr, filesize($basedir.$file));
fclose($fileptr); fclose($fileptr);
@ -334,24 +334,24 @@
print_heading("$streditfile"); print_heading("$streditfile");
echo "<TABLE><TR><TD COLSPAN=2>"; echo "<table><tr><td colspan=\"2\">";
echo "<FORM ACTION=\"".$ME."\" METHOD=\"post\" NAME=\"form\" $onsubmit>"; echo "<form action=\"".$ME."\" method=\"post\" name=\"form\" $onsubmit>";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\" />"; echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />";
echo " <INPUT TYPE=hidden NAME=file VALUE=\"$file\" />"; echo " <input type=\"hidden\" name=\"file\" value=\"$file\" />";
echo " <INPUT TYPE=hidden NAME=action VALUE=edit />"; echo " <input type=\"hidden\" name=\"action\" value=\"edit\" />";
print_textarea($usehtmleditor, 25, 80, 680, 400, "text", $contents); print_textarea($usehtmleditor, 25, 80, 680, 400, "text", $contents);
echo "</TD></TR><TR><TD>"; echo "</td></tr><tr><td>";
echo " <INPUT TYPE=submit VALUE=\"".get_string("savechanges")."\" />"; echo " <input type=\"submit\" value=\"".get_string("savechanges")."\" />";
echo "</FORM>"; echo "</form>";
echo "</TD><TD>"; echo "</td><td>";
echo "<FORM ACTION=\"".$ME."\" METHOD=get>"; echo "<form action=\"".$ME."\" method=\"get\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir />"; echo " <input type=\"hidden\" name=\"wdir\" value=$wdir />";
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel />"; echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />";
echo " <INPUT TYPE=submit VALUE=\"".get_string("cancel")."\" />"; echo " <input type=\"submit\" value=\"".get_string("cancel")."\" />";
echo "</FORM>"; echo "</form>";
echo "</TD></TR></TABLE>"; echo "</td></tr></table>";
if ($usehtmleditor) { if ($usehtmleditor) {
print_richedit_javascript("form", "text", "yes"); print_richedit_javascript("form", "text", "yes");
@ -392,28 +392,28 @@
html_header($course, $wdir, "form.name"); html_header($course, $wdir, "form.name");
if (setfilelist($_POST)) { if (setfilelist($_POST)) {
echo "<P ALIGN=CENTER>".get_string("youareabouttocreatezip").":</P>"; echo "<p align=\"center\">".get_string("youareabouttocreatezip").":</p>";
print_simple_box_start("center"); print_simple_box_start("center");
printfilelist($USER->filelist); printfilelist($USER->filelist);
print_simple_box_end(); print_simple_box_end();
echo "<BR>"; echo "<br />";
echo "<P ALIGN=CENTER>".get_string("whattocallzip"); echo "<p align=\"center\">".get_string("whattocallzip");
echo "<TABLE><TR><TD>"; echo "<table><tr><td>";
echo "<FORM ACTION=\"".$ME."\" METHOD=post NAME=form>"; echo "<form action=\"".$ME."\" method=\"post\" name=\"form\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\" />"; echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />";
echo " <INPUT TYPE=hidden NAME=action VALUE=zip />"; echo " <input type=\"hidden\" name=\"action\" value=\"zip\" />";
echo " <INPUT TYPE=text NAME=name SIZE=35 VALUE=\"new.zip\" />"; echo " <input type=\"text\" name=\"name\" size=\"35\" value=\"new.zip\" />";
echo " <INPUT TYPE=submit VALUE=\"".get_string("createziparchive")."\" />"; echo " <input type=\"submit\" value=\"".get_string("createziparchive")."\" />";
echo "</FORM>"; echo "</form>";
echo "</TD><TD>"; echo "</td><td>";
echo "<FORM ACTION=\"".$ME."\" METHOD=get>"; echo "<form action=\"".$ME."\" method=\"get\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir />"; echo " <input type=\"hidden\" name=\"wdir\" value=$wdir />";
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel />"; echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />";
echo " <INPUT TYPE=submit VALUE=\"".get_string("cancel")."\" />"; echo " <input type=\"submit\" value=\"".get_string("cancel")."\" />";
echo "</FORM>"; echo "</form>";
echo "</TD></TR></TABLE>"; echo "</td></tr></table>";
} else { } else {
displaydir($wdir); displaydir($wdir);
clearfilelist(); clearfilelist();
@ -432,7 +432,7 @@
$strok = get_string("ok"); $strok = get_string("ok");
$strunpacking = get_string("unpacking", "", $file); $strunpacking = get_string("unpacking", "", $file);
echo "<P ALIGN=CENTER>$strunpacking:</P>"; echo "<p align=\"center\">$strunpacking:</p>";
$file = basename($file); $file = basename($file);
@ -442,11 +442,11 @@
if (!$list = $archive->extract("$basedir/$wdir")) { if (!$list = $archive->extract("$basedir/$wdir")) {
error($archive->errorInfo(true)); error($archive->errorInfo(true));
} else { // print some output } else { // print some output
echo "<table cellpadding=\"4\" cellspacing=\"2\" border=\"0\" width=640>"; echo "<table cellpadding=\"4\" cellspacing=\"2\" border=\"0\" width=\"640\">";
echo "<tr><th align=left>$strname</th>"; echo "<tr><th align=\"left\">$strname</th>";
echo "<th align=right>$strsize</th>"; echo "<th align=\"right\">$strsize</th>";
echo "<th align=right>$strmodified</th>"; echo "<th align=\"right\">$strmodified</th>";
echo "<th align=right>$strstatus</th></tr>"; echo "<th align=\"right\">$strstatus</th></tr>";
foreach ($list as $item) { foreach ($list as $item) {
echo "<tr>"; echo "<tr>";
$item['filename'] = str_replace("$basedir/$wdir/", "", $item['filename']); $item['filename'] = str_replace("$basedir/$wdir/", "", $item['filename']);
@ -466,20 +466,20 @@
} else { // Use external unzip program } else { // Use external unzip program
print_simple_box_start("center"); print_simple_box_start("center");
echo "<PRE>"; echo "<pre>";
$command = "cd $basedir/$wdir ; $CFG->unzip -o $file 2>&1"; $command = "cd $basedir/$wdir ; $CFG->unzip -o $file 2>&1";
passthru($command); passthru($command);
echo "</PRE>"; echo "</pre>";
print_simple_box_end(); print_simple_box_end();
} }
echo "<CENTER><FORM ACTION=\"".$ME."\" METHOD=get>"; echo "<center><form action=\"".$ME."\" method=\"get\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir />"; echo " <input type=\"hidden\" name=\"wdir\" value=$wdir />";
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel />"; echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />";
echo " <INPUT TYPE=submit VALUE=\"$strok\" />"; echo " <input type=\"submit\" value=\"$strok\" />";
echo "</FORM>"; echo "</form>";
echo "</CENTER>"; echo "</center>";
} else { } else {
displaydir($wdir); displaydir($wdir);
} }
@ -495,7 +495,7 @@
$strok = get_string("ok"); $strok = get_string("ok");
$strlistfiles = get_string("listfiles", "", $file); $strlistfiles = get_string("listfiles", "", $file);
echo "<P ALIGN=CENTER>$strlistfiles:</P>"; echo "<p align=\"center\">$strlistfiles:</p>";
$file = basename($file); $file = basename($file);
include_once($CFG->libdir.'/pclzip/pclzip.lib.php'); include_once($CFG->libdir.'/pclzip/pclzip.lib.php');
@ -504,8 +504,8 @@
notify($archive->errorInfo(true)); notify($archive->errorInfo(true));
} else { } else {
echo "<table cellpadding=\"4\" cellspacing=\"2\" border=\"0\" width=640>"; echo "<table cellpadding=\"4\" cellspacing=\"2\" border=\"0\" width=\"640\">";
echo "<tr><th align=left>$strname</th><th align=right>$strsize</th><th align=right>$strmodified</th></tr>"; echo "<tr><th align=\"left\">$strname</th><th align=\"right\">$strsize</th><th align=\"right\">$strmodified</th></tr>";
foreach ($list as $item) { foreach ($list as $item) {
echo "<tr>"; echo "<tr>";
print_cell("left", $item['filename']); print_cell("left", $item['filename']);
@ -520,13 +520,13 @@
} }
echo "</table>"; echo "</table>";
} }
echo "<br /><center><form action=\"".$ME."\" method=get>"; echo "<br /><center><form action=\"".$ME."\" method=\"get\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir />"; echo " <input type=\"hidden\" name=\"wdir\" value=$wdir />";
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel />"; echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />";
echo " <INPUT TYPE=submit VALUE=\"$strok\" />"; echo " <input type=\"submit\" value=\"$strok\" />";
echo "</FORM>"; echo "</form>";
echo "</CENTER>"; echo "</center>";
} else { } else {
displaydir($wdir); displaydir($wdir);
} }
@ -636,7 +636,7 @@ function printfilelist($filelist) {
foreach ($filelist as $file) { foreach ($filelist as $file) {
if (is_dir($basedir.$file)) { if (is_dir($basedir.$file)) {
echo "<img src=\"$CFG->pixpath/f/folder.gif\" height=16 width=16> $file<br />"; echo "<img src=\"$CFG->pixpath/f/folder.gif\" height=\"16\" width=\"16\"> $file<br />";
$subfilelist = array(); $subfilelist = array();
$currdir = opendir($basedir.$file); $currdir = opendir($basedir.$file);
while ($subfile = readdir($currdir)) { while ($subfile = readdir($currdir)) {
@ -648,18 +648,18 @@ function printfilelist($filelist) {
} else { } else {
$icon = mimeinfo("icon", $file); $icon = mimeinfo("icon", $file);
echo "<img src=\"$CFG->pixpath/f/$icon\" height=16 width=16> $file<br />"; echo "<img src=\"$CFG->pixpath/f/$icon\" height=\"16\" width=\"16\"> $file<br />";
} }
} }
} }
function print_cell($alignment="center", $text="&nbsp;") { function print_cell($alignment="center", $text="&nbsp;") {
echo "<TD ALIGN=\"$alignment\" NOWRAP>"; echo "<td align=\"$alignment\" nowrap=\"nowrap\">";
echo "<FONT SIZE=\"-1\" FACE=\"Arial, Helvetica\">"; echo "<font size=\"-1\" face=\"Arial, Helvetica\">";
echo "$text"; echo "$text";
echo "</FONT>"; echo "</font>";
echo "</TD>\n"; echo "</td>\n";
} }
function displaydir ($wdir) { function displaydir ($wdir) {
@ -703,15 +703,15 @@ function displaydir ($wdir) {
$strchoose = get_string("choose"); $strchoose = get_string("choose");
echo "<FORM ACTION=\"".$ME."\" METHOD=post NAME=dirform>"; echo "<form action=\"".$ME."\" method=\"post\" name=\"dirform\">";
echo "<TABLE BORDER=0 cellspacing=2 cellpadding=2 width=640>"; echo "<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\" width=\"640\">";
echo "<TR>"; echo "<tr>";
echo "<TH WIDTH=5></TH>"; echo "<th width=\"5\"></th>";
echo "<TH ALIGN=left>$strname</TH>"; echo "<th align=\"left\">$strname</th>";
echo "<TH ALIGN=right>$strsize</TH>"; echo "<th align=\"right\">$strsize</th>";
echo "<TH ALIGN=right>$strmodified</TH>"; echo "<th align=\"right\">$strmodified</th>";
echo "<TH ALIGN=right>$straction</TH>"; echo "<th align=\"right\">$straction</th>";
echo "</TR>\n"; echo "</tr>\n";
if ($wdir == "/") { if ($wdir == "/") {
$wdir = ""; $wdir = "";
@ -730,15 +730,15 @@ function displaydir ($wdir) {
$filesafe = rawurlencode($dir); $filesafe = rawurlencode($dir);
$filedate = userdate(filectime($filename), "%d %b %Y, %I:%M %p"); $filedate = userdate(filectime($filename), "%d %b %Y, %I:%M %p");
echo "<TR>"; echo "<tr>";
print_cell("center", "<INPUT TYPE=checkbox NAME=\"file$count\" VALUE=\"$fileurl\" />"); print_cell("center", "<input type=\"checkbox\" name=\"file$count\" value=\"$fileurl\" />");
print_cell("left", "<A HREF=\"".basename($ME)."?id=$id&wdir=$fileurl\"><IMG SRC=\"$CFG->pixpath/f/folder.gif\" HEIGHT=16 WIDTH=16 BORDER=0 ALT=\"Folder\"></A> <A HREF=\"".basename($ME)."?id=$id&wdir=$fileurl\">".htmlspecialchars($dir)."</A>"); print_cell("left", "<a href=\"".basename($ME)."?id=$id&wdir=$fileurl\"><img src=\"$CFG->pixpath/f/folder.gif\" height=\"16\" width=\"16\" border=\"0\" alt=\"Folder\"></a> <a href=\"".basename($ME)."?id=$id&wdir=$fileurl\">".htmlspecialchars($dir)."</a>");
print_cell("right", "-"); print_cell("right", "-");
print_cell("right", $filedate); print_cell("right", $filedate);
print_cell("right", "<A HREF=\"".basename($ME)."?id=$id&wdir=$wdir&file=$filesafe&action=rename\">$strrename</A>"); print_cell("right", "<a href=\"".basename($ME)."?id=$id&wdir=$wdir&file=$filesafe&action=rename\">$strrename</a>");
echo "</TR>"; echo "</tr>";
} }
} }
@ -771,9 +771,9 @@ function displaydir ($wdir) {
print_cell("center", "<input type=\"checkbox\" name=\"file$count\" value=\"$fileurl\" />"); print_cell("center", "<input type=\"checkbox\" name=\"file$count\" value=\"$fileurl\" />");
echo "<td align=left nowrap>"; echo "<td align=\"left\" nowrap=\"nowrap\">";
link_to_popup_window ($ffurl, "display", link_to_popup_window ($ffurl, "display",
"<img src=\"$CFG->pixpath/f/$icon\" height=16 width=16 border=0 alt=\"file\">", "<img src=\"$CFG->pixpath/f/$icon\" height=\"16\" width=\"16\" border=\"0\" alt=\"file\">",
480, 640); 480, 640);
echo "<font size=\"-1\" face=\"Arial, Helvetica\">"; echo "<font size=\"-1\" face=\"Arial, Helvetica\">";
link_to_popup_window ($ffurl, "display", htmlspecialchars($file), 480, 640); link_to_popup_window ($ffurl, "display", htmlspecialchars($file), 480, 640);
@ -792,22 +792,22 @@ function displaydir ($wdir) {
$edittext .= "<a href=\"".basename($ME)."?id=$id&wdir=$wdir&file=$fileurl&action=listzip\">$strlist</a> "; $edittext .= "<a href=\"".basename($ME)."?id=$id&wdir=$wdir&file=$fileurl&action=listzip\">$strlist</a> ";
} }
print_cell("right", "$edittext <A HREF=\"".basename($ME)."?id=$id&wdir=$wdir&file=$filesafe&action=rename\">$strrename</A>"); print_cell("right", "$edittext <a href=\"".basename($ME)."?id=$id&wdir=$wdir&file=$filesafe&action=rename\">$strrename</a>");
echo "</tr>"; echo "</tr>";
} }
} }
echo "</table>"; echo "</table>";
echo "<hr width=640 align=center noshade size=1>"; echo "<hr width=\"640\" align=\"center\" noshade size=\"1\" />";
if (empty($wdir)) { if (empty($wdir)) {
$wdir = "/"; $wdir = "/";
} }
echo "<TABLE BORDER=0 cellspacing=2 cellpadding=2 width=640>"; echo "<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\" width=\"640\">";
echo "<TR><TD>"; echo "<tr><td>";
echo "<INPUT TYPE=hidden NAME=id VALUE=\"$id\" />"; echo "<input type=\"hidden\" name=\"id\" value=\"$id\" />";
echo "<INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\" /> "; echo "<input type=\"hidden\" name=\"wdir\" value=\"$wdir\" /> ";
$options = array ( $options = array (
"move" => "$strmovetoanotherfolder", "move" => "$strmovetoanotherfolder",
"delete" => "$strdeletecompletely", "delete" => "$strdeletecompletely",
@ -817,34 +817,34 @@ function displaydir ($wdir) {
choose_from_menu ($options, "action", "", "$strwithchosenfiles...", "javascript:document.dirform.submit()"); choose_from_menu ($options, "action", "", "$strwithchosenfiles...", "javascript:document.dirform.submit()");
} }
echo "</FORM>"; echo "</form>";
echo "<TD ALIGN=center>"; echo "<td align=\"center\">";
if (!empty($USER->fileop) and ($USER->fileop == "move") and ($USER->filesource <> $wdir)) { if (!empty($USER->fileop) and ($USER->fileop == "move") and ($USER->filesource <> $wdir)) {
echo "<FORM ACTION=\"".$ME."\" METHOD=get>"; echo "<form action=\"".$ME."\" method=\"get\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\" />"; echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />";
echo " <INPUT TYPE=hidden NAME=action VALUE=paste />"; echo " <input type=\"hidden\" name=\"action\" value=\"paste\" />";
echo " <INPUT TYPE=submit VALUE=\"$strmovefilestohere\" />"; echo " <input type=\"submit\" value=\"$strmovefilestohere\" />";
echo "</FORM>"; echo "</form>";
} }
echo "<TD ALIGN=right>"; echo "<td align=\"right\">";
echo "<FORM ACTION=\"".$ME."\" METHOD=get>"; echo "<form action=\"".$ME."\" method=\"get\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\" />"; echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />";
echo " <INPUT TYPE=hidden NAME=action VALUE=mkdir />"; echo " <input type=\"hidden\" name=\"action\" value=\"mkdir\" />";
echo " <INPUT TYPE=submit VALUE=\"$strmakeafolder\" />"; echo " <input type=\"submit\" value=\"$strmakeafolder\" />";
echo "</FORM>"; echo "</form>";
echo "</TD>"; echo "</td>";
echo "<TD ALIGN=right>"; echo "<td align=\"right\">";
echo "<FORM ACTION=\"".$ME."\" METHOD=get>"; echo "<form action=\"".$ME."\" method=\"get\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\" />"; echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />";
echo " <INPUT TYPE=hidden NAME=action VALUE=upload />"; echo " <input type=\"hidden\" name=\"action\" value=\"upload\" />";
echo " <INPUT TYPE=submit VALUE=\"$struploadafile\" />"; echo " <input type=\"submit\" value=\"$struploadafile\" />";
echo "</FORM>"; echo "</form>";
echo "</TD></TR>"; echo "</td></tr>";
echo "</TABLE>"; echo "</table>";
echo "<HR WIDTH=640 ALIGN=CENTER NOSHADE SIZE=1>"; echo "<hr width=\"640\" align=\"center\" NOSHADE size=\"1\">";
} }

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
function resource_upgrade($oldversion) { function resource_upgrade($oldversion) {
// This function does anything necessary to upgrade // This function does anything necessary to upgrade

View file

@ -1,4 +1,4 @@
<?PHP <?php
function resource_upgrade($oldversion) { function resource_upgrade($oldversion) {
// This function does anything necessary to upgrade // This function does anything necessary to upgrade

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
function resource_upgrade($oldversion) { function resource_upgrade($oldversion) {
// This function does anything necessary to upgrade // This function does anything necessary to upgrade

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
//This function provides automatic linking to //This function provides automatic linking to
//resources when its name (title) is found inside every Moodle text //resources when its name (title) is found inside every Moodle text
//It's based in the glosssary filter by Williams Castillo //It's based in the glosssary filter by Williams Castillo
@ -94,7 +94,7 @@
//Now avoid searching inside links //Now avoid searching inside links
$links = array(); $links = array();
preg_match_all('/<A[\s](.+?)>(.+?)<\/A>/is',$text,$list_of_links); preg_match_all('/<a[\s](.+?)>(.+?)<\/A>/is',$text,$list_of_links);
foreach (array_unique($list_of_links[0]) as $key=>$value) { foreach (array_unique($list_of_links[0]) as $key=>$value) {
$links['<@'.$key.'@>'] = $value; $links['<@'.$key.'@>'] = $value;
} }

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
require_once("../../config.php"); require_once("../../config.php");
@ -14,7 +14,7 @@
if ($course->category) { if ($course->category) {
require_login($course->id); require_login($course->id);
$navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->"; $navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
} else { } else {
$navigation = ''; $navigation = '';
} }

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
if (!isset($CFG->resource_framesize)) { if (!isset($CFG->resource_framesize)) {
set_config("resource_framesize", 130); set_config("resource_framesize", 130);

View file

@ -1,4 +1,4 @@
<?PHP //$Id$ <?php //$Id$
//This php script contains all the stuff to backup/restore //This php script contains all the stuff to backup/restore
//resource mods //resource mods

View file

@ -9,15 +9,15 @@
<input type="hidden" name="instance" value="<?php p($form->instance) ?>" /> <input type="hidden" name="instance" value="<?php p($form->instance) ?>" />
<input type="hidden" name="mode" value="<?php p($form->mode) ?>" /> <input type="hidden" name="mode" value="<?php p($form->mode) ?>" />
<table cellpadding=5> <table cellpadding="5">
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("name") ?>:</b></p></td> <td align="right"><p><b><?php print_string("name") ?>:</b></p></td>
<td> <td>
<input type="text" name="name" size=65 value="<?php p($form->name) ?>" /> <input type="text" name="name" size="65" value="<?php p($form->name) ?>" />
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("summary") ?>:</b></p> <td align="right"><p><b><?php print_string("summary") ?>:</b></p>
<font size="1"> <font size="1">
<?php <?php
helpbutton("summary", get_string("summary"), "resource", true, true); helpbutton("summary", get_string("summary"), "resource", true, true);

View file

@ -1,12 +1,12 @@
<tr valign="top"> <tr valign="top">
<td align="right" nowrap> <td align="right" nowrap="nowrap">
<p><b><?php print_string("resourcetypedirectory", "resource") ?>:</b></p> <p><b><?php print_string("resourcetypedirectory", "resource") ?>:</b></p>
</td> </td>
<td> <td>
<?php choose_from_menu($dirs, "reference", $form->reference, get_string("maindirectory", "resource"), '', '') ?> <?php choose_from_menu($dirs, "reference", $form->reference, get_string("maindirectory", "resource"), '', '') ?>
</td> </td>
</tr> </tr>
<tr valign="top"> <td align="right" nowrap>&nbsp; <tr valign="top"> <td align="right" nowrap="nowrap">&nbsp;
</td> </td>
<td> <td>
<p><?php print_string("directoryinfo", "resource") ?></p> <p><?php print_string("directoryinfo", "resource") ?></p>

View file

@ -68,7 +68,7 @@ function display() {
navmenu($course, $this->cm)); navmenu($course, $this->cm));
if (isteacheredit($course->id)) { if (isteacheredit($course->id)) {
echo "<div align=\"right\"><img src=\"$CFG->pixpath/i/files.gif\" height=16 width=16 alt=\"\">&nbsp". echo "<div align=\"right\"><img src=\"$CFG->pixpath/i/files.gif\" height=\"16\" width=\"16\" alt=\"\">&nbsp".
"<a href=\"$CFG->wwwroot/files/index.php?id={$course->id}&wdir=/{$resource->reference}$subdir\">". "<a href=\"$CFG->wwwroot/files/index.php?id={$course->id}&wdir=/{$resource->reference}$subdir\">".
get_string("editfiles")."...</a></div>"; get_string("editfiles")."...</a></div>";
} }

View file

@ -29,7 +29,7 @@
<tr valign="top"> <tr valign="top">
<td align="right" nowrap> <td align="right" nowrap="nowrap">
<p><b><?php echo $strfilename ?>:</b></p> <p><b><?php echo $strfilename ?>:</b></p>
</td> </td>
<td> <td>
@ -68,13 +68,13 @@
var frameitem = [<?php echo $frameoption; ?>]; var frameitem = [<?php echo $frameoption; ?>];
var allitems = [<?php echo $alloptions; ?>]; var allitems = [<?php echo $alloptions; ?>];
</script> </script>
<input type="radio" name="windowpopup" value=0 <?php echo ($windowtype != "popup") ? "checked" : "" ?> <input type="radio" name="windowpopup" value="0" <?php echo ($windowtype != "popup") ? "checked" : "" ?>
onClick="lockoptions('form', 'windowpopup[0]', frameitem); onClick="lockoptions('form', 'windowpopup[0]', frameitem);
return lockoptions('form', 'windowpopup[1]', popupitems);" /> return lockoptions('form', 'windowpopup[1]', popupitems);" />
<b title="<?php print_string("pagedisplay", "resource") ?>"><?php print_string("pagewindow", "resource") ?></b> <b title="<?php print_string("pagedisplay", "resource") ?>"><?php print_string("pagewindow", "resource") ?></b>
<ul> <ul>
<input type="hidden" name="hframepage" value=0 /> <input type="hidden" name="hframepage" value="0" />
<input type="checkbox" name="framepage" value=1 <?php echo ($form->options == "frame") ? "checked" : "" ?> /> <input type="checkbox" name="framepage" value="1" <?php echo ($form->options == "frame") ? "checked" : "" ?> />
<?php print_string("frameifpossible", "resource") ?> <?php print_string("frameifpossible", "resource") ?>
</ul> </ul>
</td> </td>
@ -83,7 +83,7 @@
<tr valign="top"> <tr valign="top">
<td colspan="2"> <td colspan="2">
<input name="windowpopup" type=radio value=1 <?php echo ($windowtype == "popup") ? "checked" : "" ?> <input name="windowpopup" type="radio" value="1" <?php echo ($windowtype == "popup") ? "checked" : "" ?>
onclick="lockoptions('form', 'windowpopup[0]', frameitem); onclick="lockoptions('form', 'windowpopup[0]', frameitem);
return lockoptions('form', 'windowpopup[1]', popupitems);" /> return lockoptions('form', 'windowpopup[1]', popupitems);" />
<b title="<?php p($strnewwindowopen) ?>"><?php p($strnewwindow) ?></b> <b title="<?php p($strnewwindowopen) ?>"><?php p($strnewwindow) ?></b>
@ -93,19 +93,19 @@
if ($name == "height" or $name == "width") { if ($name == "height" or $name == "width") {
continue; continue;
} }
echo "<input name=\"h$name\" type=hidden value=0 />"; echo "<input name=\"h$name\" type="hidden" value="0" />";
echo "<input name=\"$name\" type=checkbox value=1 ".$window->$name." />"; echo "<input name=\"$name\" type="checkbox" value="1" ".$window->$name." />";
$stringname = "str$name"; $stringname = "str$name";
echo $$stringname."<br />"; echo $$stringname."<br />";
} }
?> ?>
<input name="hwidth" type=hidden value=0 /> <input name="hwidth" type="hidden" value="0" />
<input name="width" type=text size=4 value="<?php p($window->width) ?>" /> <input name="width" type="text" size="4" value="<?php p($window->width) ?>" />
<?php p($strwidth) ?><br /> <?php p($strwidth) ?><br />
<input name="hheight" type=hidden value=0 /> <input name="hheight" type="hidden" value="0" />
<input name="height" type=text size=4 value="<?php p($window->height) ?>" /> <input name="height" type="text" size="4" value="<?php p($window->height) ?>" />
<?php p($strheight) ?><br /> <?php p($strheight) ?><br />
<?php <?php
if ($windowtype == "page") { if ($windowtype == "page") {

View file

@ -337,7 +337,7 @@ function display() {
if (!empty($_GET['frameset']) and $_GET['frameset'] == "top") { if (!empty($_GET['frameset']) and $_GET['frameset'] == "top") {
print_header($pagetitle, $course->fullname, "$navigation <a target=\"$CFG->framename\" href=\"$fullurl\">{$resource->name}</a>", "", "", true, update_module_button($this->cm->id, $course->id, $strresource), navmenu($course, $this->cm, "parent")); print_header($pagetitle, $course->fullname, "$navigation <a target=\"$CFG->framename\" href=\"$fullurl\">{$resource->name}</a>", "", "", true, update_module_button($this->cm->id, $course->id, $strresource), navmenu($course, $this->cm, "parent"));
echo "<center><font size=-1>".text_to_html($resource->summary, true, false)."</font></center>"; echo "<center><font size=\"-1\">".text_to_html($resource->summary, true, false)."</font></center>";
echo "</body></html>"; echo "</body></html>";
exit; exit;
} }
@ -365,11 +365,11 @@ function display() {
echo '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'; echo '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
echo ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '; echo ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';
echo ' width="600" height="70" id="mp3player" align="">'; echo ' width="600" height="70" id="mp3player" align="">';
echo "<param name=movie value=\"$CFG->wwwroot/lib/mp3player/mp3player.swf?src=$fullurl&autostart=yes\">"; echo "<param name=\"movie\" value=\"$CFG->wwwroot/lib/mp3player/mp3player.swf?src=$fullurl&autostart=yes\">";
echo '<param name=quality value=high>'; echo '<param name="quality" value="high">';
echo '<param name=bgcolor value="#333333">'; echo '<param name="bgcolor" value="#333333">';
echo "<embed src=\"$CFG->wwwroot/lib/mp3player/mp3player.swf?src=$fullurl&autostart=yes\" "; echo "<embed src=\"$CFG->wwwroot/lib/mp3player/mp3player.swf?src=$fullurl&autostart=yes\" ";
echo " quality=high bgcolor=\"#333333\" width=\"600\" height=\"70\" name=\"mp3player\" "; echo " quality=\"high\" bgcolor=\"#333333\" width=\"600\" height=\"70\" name=\"mp3player\" ";
echo ' type="application/x-shockwave-flash" '; echo ' type="application/x-shockwave-flash" ';
echo ' pluginspage="http://www.macromedia.com/go/getflashplayer">'; echo ' pluginspage="http://www.macromedia.com/go/getflashplayer">';
echo '</embed>'; echo '</embed>';
@ -383,15 +383,15 @@ function display() {
echo ' standby="Loading Microsoft® Windows® Media Player components..." '; echo ' standby="Loading Microsoft® Windows® Media Player components..." ';
echo ' id="msplayer" align="" type="application/x-oleobject">'; echo ' id="msplayer" align="" type="application/x-oleobject">';
echo "<param name=\"Filename\" value=\"$fullurl\">"; echo "<param name=\"Filename\" value=\"$fullurl\">";
echo '<param name="ShowControls" value=true />'; echo '<param name="ShowControls" value="true" />';
echo '<param name="AutoRewind" value=true />'; echo '<param name="AutoRewind" value="true" />';
echo '<param name="AutoStart" value=true />'; echo '<param name="AutoStart" value="true" />';
echo '<param name="Autosize" value=true />'; echo '<param name="Autosize" value="true" />';
echo '<param name="EnableContextMenu" value=true />'; echo '<param name="EnableContextMenu" value="true" />';
echo '<param name="TransparentAtStart" value=false />'; echo '<param name="TransparentAtStart" value="false" />';
echo '<param name="AnimationAtStart" value=false />'; echo '<param name="AnimationAtStart" value="false" />';
echo '<param name="ShowGotoBar" value=false />'; echo '<param name="ShowGotoBar" value="false" />';
echo '<param name="EnableFullScreenControls" value=true />'; echo '<param name="EnableFullScreenControls" value="true" />';
echo "\n<embed src=\"$fullurl\" name=\"msplayer\" type=\"$mimetype\" "; echo "\n<embed src=\"$fullurl\" name=\"msplayer\" type=\"$mimetype\" ";
echo ' ShowControls="1" AutoRewind="1" AutoStart="1" Autosize="0" EnableContextMenu="1"'; echo ' ShowControls="1" AutoRewind="1" AutoStart="1" Autosize="0" EnableContextMenu="1"';
echo ' TransparentAtStart="0" AnimationAtStart="0" ShowGotoBar="0" EnableFullScreenControls="1"'; echo ' TransparentAtStart="0" AnimationAtStart="0" ShowGotoBar="0" EnableFullScreenControls="1"';
@ -408,9 +408,9 @@ function display() {
echo ' height="450" width="600"'; echo ' height="450" width="600"';
echo ' id="quicktime" align="" type="application/x-oleobject">'; echo ' id="quicktime" align="" type="application/x-oleobject">';
echo "<param name=\"src\" value=\"$fullurl\" />"; echo "<param name=\"src\" value=\"$fullurl\" />";
echo '<param name="autoplay" value=true />'; echo '<param name="autoplay" value="true" />';
echo '<param name="loop" value=true />'; echo '<param name="loop" value="true" />';
echo '<param name="controller" value=true />'; echo '<param name="controller" value="true" />';
echo '<param name="scale" value="aspect" />'; echo '<param name="scale" value="aspect" />';
echo "\n<embed src=\"$fullurl\" name=\"quicktime\" type=\"$mimetype\" "; echo "\n<embed src=\"$fullurl\" name=\"quicktime\" type=\"$mimetype\" ";
echo ' height="450" width="600" scale="aspect"'; echo ' height="450" width="600" scale="aspect"';

View file

@ -27,7 +27,7 @@
<tr valign="top"> <tr valign="top">
<td align="right" nowrap> <td align="right" nowrap="nowrap">
<p><b><?php print_string("fulltext", "resource") ?>:</b></p><br /> <p><b><?php print_string("fulltext", "resource") ?>:</b></p><br />
<font size="1"> <font size="1">
<?php helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br /> <?php helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br />
@ -65,7 +65,7 @@
var popupitems = [<?php echo $popupoptions; ?>]; var popupitems = [<?php echo $popupoptions; ?>];
var allitems = [<?php echo $alloptions; ?>]; var allitems = [<?php echo $alloptions; ?>];
</script> </script>
<input type="radio" name="windowpopup" value=0 <?php echo ($windowtype != "popup") ? "checked" : "" ?> <input type="radio" name="windowpopup" value="0" <?php echo ($windowtype != "popup") ? "checked" : "" ?>
onClick="return lockoptions('form', 'windowpopup[1]', popupitems);" /> onClick="return lockoptions('form', 'windowpopup[1]', popupitems);" />
<b title="<?php print_string("pagedisplay", "resource") ?>"><?php print_string("pagewindow", "resource") ?></b> <b title="<?php print_string("pagedisplay", "resource") ?>"><?php print_string("pagewindow", "resource") ?></b>
</td> </td>
@ -74,7 +74,7 @@
<tr valign="top"> <tr valign="top">
<td colspan="2"> <td colspan="2">
<input name="windowpopup" type=radio value=1 <?php echo ($windowtype == "popup") ? "checked" : "" ?> <input name="windowpopup" type="radio" value="1" <?php echo ($windowtype == "popup") ? "checked" : "" ?>
onclick=" return lockoptions('form', 'windowpopup[1]', popupitems);" /> onclick=" return lockoptions('form', 'windowpopup[1]', popupitems);" />
<b title="<?php p($strnewwindowopen) ?>"><?php p($strnewwindow) ?></b> <b title="<?php p($strnewwindowopen) ?>"><?php p($strnewwindow) ?></b>
<ul> <ul>
@ -83,19 +83,19 @@
if ($name == "height" or $name == "width") { if ($name == "height" or $name == "width") {
continue; continue;
} }
echo "<input name=\"h$name\" type=hidden value=0 />"; echo "<input name=\"h$name\" type="hidden" value="0" />";
echo "<input name=\"$name\" type=checkbox value=1 ".$window->$name." />"; echo "<input name=\"$name\" type="checkbox" value="1" ".$window->$name." />";
$stringname = "str$name"; $stringname = "str$name";
echo $$stringname."<br />"; echo $$stringname."<br />";
} }
?> ?>
<input name="hwidth" type=hidden value=0 /> <input name="hwidth" type="hidden" value="0" />
<input name="width" type=text size=4 value="<?php p($window->width) ?>" /> <input name="width" type="text" size="4" value="<?php p($window->width) ?>" />
<?php p($strwidth) ?><br /> <?php p($strwidth) ?><br />
<input name="hheight" type=hidden value=0 /> <input name="hheight" type="hidden" value="0" />
<input name="height" type=text size=4 value="<?php p($window->height) ?>" /> <input name="height" type="text" size="4" value="<?php p($window->height) ?>" />
<?php p($strheight) ?><br /> <?php p($strheight) ?><br />
<?php <?php
if ($windowtype == "page") { if ($windowtype == "page") {

View file

@ -140,7 +140,7 @@ function display() {
print_simple_box(format_text($resource->alltext, FORMAT_HTML, $formatoptions, $course->id), "center", "", "$THEME->cellcontent", "20"); print_simple_box(format_text($resource->alltext, FORMAT_HTML, $formatoptions, $course->id), "center", "", "$THEME->cellcontent", "20");
echo "<center><p><font size=1>$strlastmodified: ".userdate($resource->timemodified)."</p></center>"; echo "<center><p><font size=\"1\">$strlastmodified: ".userdate($resource->timemodified)."</p></center>";
print_footer($course); print_footer($course);
} }

View file

@ -139,7 +139,7 @@ function display() {
print_simple_box(format_text($resource->alltext, $resource->options, $formatoptions, $course->id), print_simple_box(format_text($resource->alltext, $resource->options, $formatoptions, $course->id),
"center", "", "$THEME->cellcontent", "20"); "center", "", "$THEME->cellcontent", "20");
echo "<center><p><font size=1>$strlastmodified: ".userdate($resource->timemodified)."</p></center>"; echo "<center><p><font size=\"1\">$strlastmodified: ".userdate($resource->timemodified)."</p></center>";
print_footer($course); print_footer($course);
} }

View file

@ -28,7 +28,7 @@
<tr valign="top"> <tr valign="top">
<td align="right" nowrap> <td align="right" nowrap="nowrap">
<p><b><?php print_string("fulltext", "resource") ?>:</b></p><br /> <p><b><?php print_string("fulltext", "resource") ?>:</b></p><br />
<font size="1"> <font size="1">
<?php helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br /> <?php helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br />
@ -40,7 +40,7 @@
</td> </td>
</tr> </tr>
<tr valign="top"> <tr valign="top">
<td align="right" nowrap> <td align="right" nowrap="nowrap">
<p><b><?php print_string("formattexttype") ?>:</b></p><br /> <p><b><?php print_string("formattexttype") ?>:</b></p><br />
</td> </td>
<td> <td>
@ -77,7 +77,7 @@
var popupitems = [<?php echo $popupoptions; ?>]; var popupitems = [<?php echo $popupoptions; ?>];
var allitems = [<?php echo $alloptions; ?>]; var allitems = [<?php echo $alloptions; ?>];
</script> </script>
<input type="radio" name="windowpopup" value=0 <?php echo ($windowtype != "popup") ? "checked" : "" ?> <input type="radio" name="windowpopup" value="0" <?php echo ($windowtype != "popup") ? "checked" : "" ?>
onClick="return lockoptions('form', 'windowpopup[1]', popupitems);" /> onClick="return lockoptions('form', 'windowpopup[1]', popupitems);" />
<b title="<?php print_string("pagedisplay", "resource") ?>"><?php print_string("pagewindow", "resource") ?></b> <b title="<?php print_string("pagedisplay", "resource") ?>"><?php print_string("pagewindow", "resource") ?></b>
<?php print_string("pagedisplay", "resource") ?> <?php print_string("pagedisplay", "resource") ?>
@ -87,7 +87,7 @@
<tr valign="top"> <tr valign="top">
<td colspan="2"> <td colspan="2">
<input name="windowpopup" type=radio value=1 <?php echo ($windowtype == "popup") ? "checked" : "" ?> <input name="windowpopup" type="radio" value="1" <?php echo ($windowtype == "popup") ? "checked" : "" ?>
onclick=" return lockoptions('form', 'windowpopup[1]', popupitems);" /> onclick=" return lockoptions('form', 'windowpopup[1]', popupitems);" />
<b title="<?php p($strnewwindowopen) ?>"><?php p($strnewwindow) ?></b> <b title="<?php p($strnewwindowopen) ?>"><?php p($strnewwindow) ?></b>
<?php p($strnewwindowopen) ?> <?php p($strnewwindowopen) ?>
@ -97,19 +97,19 @@
if ($name == "height" or $name == "width") { if ($name == "height" or $name == "width") {
continue; continue;
} }
echo "<input name=\"h$name\" type=hidden value=0 />"; echo "<input name=\"h$name\" type="hidden" value="0" />";
echo "<input name=\"$name\" type=checkbox value=1 ".$window->$name." />"; echo "<input name=\"$name\" type="checkbox" value="1" ".$window->$name." />";
$stringname = "str$name"; $stringname = "str$name";
echo $$stringname."<br />"; echo $$stringname."<br />";
} }
?> ?>
<input name="hwidth" type=hidden value=0 /> <input name="hwidth" type="hidden" value="0" />
<input name="width" type=text size=4 value="<?php p($window->width) ?>" /> <input name="width" type="text" size="4" value="<?php p($window->width) ?>" />
<?php p($strwidth) ?><br /> <?php p($strwidth) ?><br />
<input name="hheight" type=hidden value=0 /> <input name="hheight" type="hidden" value="0" />
<input name="height" type=text size=4 value="<?php p($window->height) ?>" /> <input name="height" type="text" size="4" value="<?php p($window->height) ?>" />
<?php p($strheight) ?><br /> <?php p($strheight) ?><br />
<?php <?php
if ($windowtype == "page") { if ($windowtype == "page") {

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Code fragment to define the module version etc. // Code fragment to define the module version etc.

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
require_once("../../config.php"); require_once("../../config.php");
require_once("lib.php"); require_once("lib.php");

View file

@ -1,4 +1,4 @@
<?PHP //$Id$ <?php //$Id$
//This php script contains all the stuff to backup/restore //This php script contains all the stuff to backup/restore
//scorm mods //scorm mods

View file

@ -1,8 +1,8 @@
<form method="post" action="module.php" name="form"> <form method="post" action="module.php" name="form">
<table cellpadding=9 cellspacing=0 > <table cellpadding="9" cellspacing="0" >
<tr valign=top> <tr valign="top">
<td align=right><p>scorm_validate:</td> <td align="right"><p>scorm_validate:</td>
<td> <td>
<?php <?php
unset($choices); unset($choices);
@ -20,17 +20,17 @@
<?php print_string("validationtype", "scorm") ?> <?php print_string("validationtype", "scorm") ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p>scorm_framesize:</td> <td align="right"><p>scorm_framesize:</td>
<td> <td>
<input name=scorm_framesize type=text size=5 value="<?php p($CFG->scorm_framesize) ?>" /> <input name="scorm_framesize" type="text" size="5" value="<?php p($CFG->scorm_framesize) ?>" />
</td> </td>
<td> <td>
<?php print_string("configframesize", "scorm") ?> <?php print_string("configframesize", "scorm") ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p>scorm_popup:</td> <td align="right"><p>scorm_popup:</td>
<td> <td>
<?php <?php
unset($choices); unset($choices);
@ -45,11 +45,11 @@
</tr> </tr>
<?php foreach ($SCORM_WINDOW_OPTIONS as $optionname) { <?php foreach ($SCORM_WINDOW_OPTIONS as $optionname) {
$defaultvalue = "scorm_popup$optionname"; $defaultvalue = "scorm_popup$optionname";
echo "<tr valign=top>"; echo "<tr valign=\"top\">";
echo "<td align=right><p>$defaultvalue:</td>"; echo "<td align=\"right\"><p>$defaultvalue:</td>";
echo "<td>"; echo "<td>";
if ($optionname == "height" or $optionname == "width") { if ($optionname == "height" or $optionname == "width") {
echo "<input name=$defaultvalue type=text size=5 value=\"".$CFG->$defaultvalue."\" />"; echo "<input name=$defaultvalue type=\"text\" size=\"5\" value=\"".$CFG->$defaultvalue."\" />";
} else { } else {
choose_from_menu ($choices, $defaultvalue, $CFG->$defaultvalue, ""); choose_from_menu ($choices, $defaultvalue, $CFG->$defaultvalue, "");
} }
@ -61,7 +61,7 @@
} }
?> ?>
<tr> <tr>
<td colspan=3 align=center> <td colspan="3" align="center">
<input type="submit" value="<?php print_string("savechanges") ?>" /> <input type="submit" value="<?php print_string("savechanges") ?>" />
</td> </td>
</tr> </tr>

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
// Manage ONLY ZIP & PIF uploaded files in a course file area // Manage ONLY ZIP & PIF uploaded files in a course file area
@ -82,7 +82,7 @@
print_heading(get_string("publicsitefileswarning"), "center", 2); print_heading(get_string("publicsitefileswarning"), "center", 2);
} }
echo "<table border=0 align=center cellspacing=3 cellpadding=3 width=640>"; echo "<table border=\"0\" align=\"center\" cellspacing=\"3\" cellpadding=\"3\" width=\"640\">";
echo "<tr>"; echo "<tr>";
echo "<td colspan=\"2\">"; echo "<td colspan=\"2\">";
} }
@ -147,25 +147,25 @@
$strmaxsize = get_string("maxsize", "", $filesize); $strmaxsize = get_string("maxsize", "", $filesize);
$strcancel = get_string("cancel"); $strcancel = get_string("cancel");
echo "<P>$struploadafile ($strmaxsize) --> <B>$wdir</B>"; echo "<p>$struploadafile ($strmaxsize) --> <b>$wdir</b>";
echo "<TABLE><TR><TD COLSPAN=2>"; echo "<table><tr><td colspan=\"2\">";
echo "<FORM ENCTYPE=\"multipart/form-data\" METHOD=\"post\" ACTION=\"".$ME."\">"; echo "<form enctype=\"multipart/form-data\" method=\"post\" action=\"".$ME."\">";
echo " <INPUT TYPE=hidden NAME=MAX_FILE_SIZE value=\"$upload_max_filesize\" />"; echo " <input type=\"hidden\" name=MAX_FILE_SIZE value=\"$upload_max_filesize\" />";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir />"; echo " <input type=\"hidden\" name=\"wdir\" value=$wdir />";
echo " <INPUT TYPE=hidden NAME=action VALUE=upload />"; echo " <input type=\"hidden\" name=\"action\" value=\"upload\" />";
echo " <INPUT NAME=\"userfile\" TYPE=\"file\" size=\"60\" />"; echo " <input name=\"userfile\" type=\"file\" size=\"60\" />";
echo " </TD><TR><TD WIDTH=10>"; echo " </td><tr><td width=\"10\">";
echo " <INPUT TYPE=submit NAME=save VALUE=\"$struploadthisfile\" />"; echo " <input type=\"submit\" name=\"save\" value=\"$struploadthisfile\" />";
echo "</FORM>"; echo "</form>";
echo "</TD><TD WIDTH=100%>"; echo "</td><td width=\"100%\">";
echo "<FORM ACTION=\"".$ME."\" METHOD=\"get\">"; echo "<form action=\"".$ME."\" method=\"get\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir />"; echo " <input type=\"hidden\" name=\"wdir\" value=$wdir />";
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel />"; echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />";
echo " <INPUT TYPE=submit VALUE=\"$strcancel\" />"; echo " <input type=\"submit\" value=\"$strcancel\" />";
echo "</FORM>"; echo "</form>";
echo "</TD></TR></TABLE>"; echo "</td></tr></table>";
} }
html_footer(); html_footer();
break; break;
@ -176,7 +176,7 @@
foreach ($USER->filelist as $file) { foreach ($USER->filelist as $file) {
$fullfile = $basedir.$file; $fullfile = $basedir.$file;
if (! fulldelete($fullfile)) { if (! fulldelete($fullfile)) {
echo "<BR>Error: Could not delete: $fullfile"; echo "<br>Error: Could not delete: $fullfile";
} }
} }
clearfilelist(); clearfilelist();
@ -186,7 +186,7 @@
} else { } else {
html_header($course, $wdir); html_header($course, $wdir);
if (setfilelist($_POST)) { if (setfilelist($_POST)) {
echo "<p align=center>".get_string("deletecheckwarning").":</p>"; echo "<p align=\"center\">".get_string("deletecheckwarning").":</p>";
print_simple_box_start("center"); print_simple_box_start("center");
printfilelist($USER->filelist); printfilelist($USER->filelist);
print_simple_box_end(); print_simple_box_end();
@ -206,7 +206,7 @@
if ($count = setfilelist($_POST)) { if ($count = setfilelist($_POST)) {
$USER->fileop = $action; $USER->fileop = $action;
$USER->filesource = $wdir; $USER->filesource = $wdir;
echo "<p align=center>"; echo "<p align=\"center\">";
print_string("selectednowmove", "moodle", $count); print_string("selectednowmove", "moodle", $count);
echo "</p>"; echo "</p>";
} }
@ -222,7 +222,7 @@
$oldfile = $basedir.$file; $oldfile = $basedir.$file;
$newfile = $basedir.$wdir."/".$shortfile; $newfile = $basedir.$wdir."/".$shortfile;
if (!rename($oldfile, $newfile)) { if (!rename($oldfile, $newfile)) {
echo "<P>Error: $shortfile not moved"; echo "<p>Error: $shortfile not moved";
} }
} }
} }
@ -247,24 +247,24 @@
$strcancel = get_string("cancel"); $strcancel = get_string("cancel");
$strrenamefileto = get_string("renamefileto", "moodle", $file); $strrenamefileto = get_string("renamefileto", "moodle", $file);
html_header($course, $wdir, "form.name"); html_header($course, $wdir, "form.name");
echo "<P>$strrenamefileto:"; echo "<p>$strrenamefileto:";
echo "<TABLE><TR><TD>"; echo "<table><tr><td>";
echo "<FORM ACTION=\"".$ME."\" METHOD=\"post\" NAME=\"form\">"; echo "<form action=\"".$ME."\" method=\"post\" name=\"form\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir />"; echo " <input type=\"hidden\" name=\"wdir\" value=$wdir />";
echo " <INPUT TYPE=hidden NAME=action VALUE=rename />"; echo " <input type=\"hidden\" name=\"action\" value=\"rename\" />";
echo " <INPUT TYPE=hidden NAME=oldname VALUE=\"$file\" />"; echo " <input type=\"hidden\" name=\"oldname\" value=\"$file\" />";
echo " <INPUT TYPE=text NAME=name SIZE=35 VALUE=\"$file\" />"; echo " <input type=\"text\" name=\"name\" size=\"35\" value=\"$file\" />";
echo " <INPUT TYPE=submit VALUE=\"$strrename\" />"; echo " <input type=\"submit\" value=\"$strrename\" />";
echo "</FORM>"; echo "</form>";
echo "</TD><TD>"; echo "</td><td>";
echo "<FORM ACTION=\"".$ME."\" METHOD=get>"; echo "<form action=\"".$ME."\" method=\"get\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir />"; echo " <input type=\"hidden\" name=\"wdir\" value=$wdir />";
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel />"; echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />";
echo " <INPUT TYPE=submit VALUE=\"$strcancel\" />"; echo " <input type=\"submit\" value=\"$strcancel\" />";
echo "</FORM>"; echo "</form>";
echo "</TD></TR></TABLE>"; echo "</td></tr></table>";
} }
html_footer(); html_footer();
break; break;
@ -285,23 +285,23 @@
$strcancel = get_string("cancel"); $strcancel = get_string("cancel");
$strcreatefolder = get_string("createfolder", "moodle", $wdir); $strcreatefolder = get_string("createfolder", "moodle", $wdir);
html_header($course, $wdir, "form.name"); html_header($course, $wdir, "form.name");
echo "<P>$strcreatefolder:"; echo "<p>$strcreatefolder:";
echo "<TABLE><TR><TD>"; echo "<table><tr><td>";
echo "<FORM ACTION=\"".$ME."\" METHOD=post NAME=form>"; echo "<form action=\"".$ME."\" method=\"post\" name=\"form\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir />"; echo " <input type=\"hidden\" name=\"wdir\" value=$wdir />";
echo " <INPUT TYPE=hidden NAME=action VALUE=mkdir />"; echo " <input type=\"hidden\" name=\"action\" value=\"mkdir\" />";
echo " <INPUT TYPE=text NAME=name SIZE=35 />"; echo " <input type=\"text\" name=\"name\" size=\"35\" />";
echo " <INPUT TYPE=submit VALUE=\"$strcreate\" />"; echo " <input type=\"submit\" value=\"$strcreate\" />";
echo "</FORM>"; echo "</form>";
echo "</TD><TD>"; echo "</td><td>";
echo "<FORM ACTION=\"".$ME."\" METHOD=get>"; echo "<form action=\"".$ME."\" method=\"get\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir />"; echo " <input type=\"hidden\" name=\"wdir\" value=$wdir />";
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel />"; echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />";
echo " <INPUT TYPE=submit VALUE=\"$strcancel\" />"; echo " <input type=\"submit\" value=\"$strcancel\" />";
echo "</FORM>"; echo "</form>";
echo "</TD></TR></TABLE>"; echo "</td></tr></table>";
} }
html_footer(); html_footer();
break; break;
@ -315,7 +315,7 @@
displaydir($wdir); displaydir($wdir);
} else { } else {
$streditfile = get_string("edit", "", "<B>$file</B>"); $streditfile = get_string("edit", "", "<b>$file</b>");
$fileptr = fopen($basedir.$file, "r"); $fileptr = fopen($basedir.$file, "r");
$contents = fread($fileptr, filesize($basedir.$file)); $contents = fread($fileptr, filesize($basedir.$file));
fclose($fileptr); fclose($fileptr);
@ -334,24 +334,24 @@
print_heading("$streditfile"); print_heading("$streditfile");
echo "<TABLE><TR><TD COLSPAN=2>"; echo "<table><tr><td colspan=\"2\">";
echo "<FORM ACTION=\"".$ME."\" METHOD=\"post\" NAME=\"form\" $onsubmit>"; echo "<form action=\"".$ME."\" method=\"post\" name=\"form\" $onsubmit>";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\" />"; echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />";
echo " <INPUT TYPE=hidden NAME=file VALUE=\"$file\" />"; echo " <input type=\"hidden\" name=\"file\" value=\"$file\" />";
echo " <INPUT TYPE=hidden NAME=action VALUE=edit />"; echo " <input type=\"hidden\" name=\"action\" value=\"edit\" />";
print_textarea($usehtmleditor, 25, 80, 680, 400, "text", $contents); print_textarea($usehtmleditor, 25, 80, 680, 400, "text", $contents);
echo "</TD></TR><TR><TD>"; echo "</td></tr><tr><td>";
echo " <INPUT TYPE=submit VALUE=\"".get_string("savechanges")."\" />"; echo " <input type=\"submit\" value=\"".get_string("savechanges")."\" />";
echo "</FORM>"; echo "</form>";
echo "</TD><TD>"; echo "</td><td>";
echo "<FORM ACTION=\"".$ME."\" METHOD=get>"; echo "<form action=\"".$ME."\" method=\"get\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir />"; echo " <input type=\"hidden\" name=\"wdir\" value=$wdir />";
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel />"; echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />";
echo " <INPUT TYPE=submit VALUE=\"".get_string("cancel")."\" />"; echo " <input type=\"submit\" value=\"".get_string("cancel")."\" />";
echo "</FORM>"; echo "</form>";
echo "</TD></TR></TABLE>"; echo "</td></tr></table>";
if ($usehtmleditor) { if ($usehtmleditor) {
print_richedit_javascript("form", "text", "yes"); print_richedit_javascript("form", "text", "yes");
@ -392,28 +392,28 @@
html_header($course, $wdir, "form.name"); html_header($course, $wdir, "form.name");
if (setfilelist($_POST)) { if (setfilelist($_POST)) {
echo "<P ALIGN=CENTER>".get_string("youareabouttocreatezip").":</P>"; echo "<p align=\"center\">".get_string("youareabouttocreatezip").":</p>";
print_simple_box_start("center"); print_simple_box_start("center");
printfilelist($USER->filelist); printfilelist($USER->filelist);
print_simple_box_end(); print_simple_box_end();
echo "<BR>"; echo "<br>";
echo "<P ALIGN=CENTER>".get_string("whattocallzip"); echo "<p align=\"center\">".get_string("whattocallzip");
echo "<TABLE><TR><TD>"; echo "<table><tr><td>";
echo "<FORM ACTION=\"".$ME."\" METHOD=post NAME=form>"; echo "<form action=\"".$ME."\" method=\"post\" name=\"form\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\" />"; echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />";
echo " <INPUT TYPE=hidden NAME=action VALUE=zip />"; echo " <input type=\"hidden\" name=\"action\" value=\"zip\" />";
echo " <INPUT TYPE=text NAME=name SIZE=35 VALUE=\"new.zip\" />"; echo " <input type=\"text\" name=\"name\" size=\"35\" value=\"new.zip\" />";
echo " <INPUT TYPE=submit VALUE=\"".get_string("createziparchive")."\" />"; echo " <input type=\"submit\" value=\"".get_string("createziparchive")."\" />";
echo "</FORM>"; echo "</form>";
echo "</TD><TD>"; echo "</td><td>";
echo "<FORM ACTION=\"".$ME."\" METHOD=get>"; echo "<form action=\"".$ME."\" method=\"get\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir />"; echo " <input type=\"hidden\" name=\"wdir\" value=$wdir />";
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel />"; echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />";
echo " <INPUT TYPE=submit VALUE=\"".get_string("cancel")."\" />"; echo " <input type=\"submit\" value=\"".get_string("cancel")."\" />";
echo "</FORM>"; echo "</form>";
echo "</TD></TR></TABLE>"; echo "</td></tr></table>";
} else { } else {
displaydir($wdir); displaydir($wdir);
clearfilelist(); clearfilelist();
@ -432,7 +432,7 @@
$strok = get_string("ok"); $strok = get_string("ok");
$strunpacking = get_string("unpacking", "", $file); $strunpacking = get_string("unpacking", "", $file);
echo "<P ALIGN=CENTER>$strunpacking:</P>"; echo "<p align=\"center\">$strunpacking:</p>";
$file = basename($file); $file = basename($file);
@ -442,11 +442,11 @@
if (!$list = $archive->extract("$basedir/$wdir")) { if (!$list = $archive->extract("$basedir/$wdir")) {
error($archive->errorInfo(true)); error($archive->errorInfo(true));
} else { // print some output } else { // print some output
echo "<table cellpadding=\"4\" cellspacing=\"2\" border=\"0\" width=640>"; echo "<table cellpadding=\"4\" cellspacing=\"2\" border=\"0\" width=\"640\">";
echo "<tr><th align=left>$strname</th>"; echo "<tr><th align=\"left\">$strname</th>";
echo "<th align=right>$strsize</th>"; echo "<th align=\"right\">$strsize</th>";
echo "<th align=right>$strmodified</th>"; echo "<th align=\"right\">$strmodified</th>";
echo "<th align=right>$strstatus</th></tr>"; echo "<th align=\"right\">$strstatus</th></tr>";
foreach ($list as $item) { foreach ($list as $item) {
echo "<tr>"; echo "<tr>";
$item['filename'] = str_replace("$basedir/$wdir/", "", $item['filename']); $item['filename'] = str_replace("$basedir/$wdir/", "", $item['filename']);
@ -466,20 +466,20 @@
} else { // Use external unzip program } else { // Use external unzip program
print_simple_box_start("center"); print_simple_box_start("center");
echo "<PRE>"; echo "<pre>";
$command = "cd $basedir/$wdir ; $CFG->unzip -o $file 2>&1"; $command = "cd $basedir/$wdir ; $CFG->unzip -o $file 2>&1";
passthru($command); passthru($command);
echo "</PRE>"; echo "</pre>";
print_simple_box_end(); print_simple_box_end();
} }
echo "<CENTER><FORM ACTION=\"".$ME."\" METHOD=get>"; echo "<center><form action=\"".$ME."\" method=\"get\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir />"; echo " <input type=\"hidden\" name=\"wdir\" value=$wdir />";
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel />"; echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />";
echo " <INPUT TYPE=submit VALUE=\"$strok\" />"; echo " <input type=\"submit\" value=\"$strok\" />";
echo "</FORM>"; echo "</form>";
echo "</CENTER>"; echo "</center>";
} else { } else {
displaydir($wdir); displaydir($wdir);
} }
@ -495,7 +495,7 @@
$strok = get_string("ok"); $strok = get_string("ok");
$strlistfiles = get_string("listfiles", "", $file); $strlistfiles = get_string("listfiles", "", $file);
echo "<P ALIGN=CENTER>$strlistfiles:</P>"; echo "<p align=\"center\">$strlistfiles:</p>";
$file = basename($file); $file = basename($file);
include_once($CFG->libdir.'/pclzip/pclzip.lib.php'); include_once($CFG->libdir.'/pclzip/pclzip.lib.php');
@ -504,8 +504,8 @@
notify($archive->errorInfo(true)); notify($archive->errorInfo(true));
} else { } else {
echo "<table cellpadding=\"4\" cellspacing=\"2\" border=\"0\" width=640>"; echo "<table cellpadding=\"4\" cellspacing=\"2\" border=\"0\" width=\"640\">";
echo "<tr><th align=left>$strname</th><th align=right>$strsize</th><th align=right>$strmodified</th></tr>"; echo "<tr><th align=\"left\">$strname</th><th align=\"right\">$strsize</th><th align=\"right\">$strmodified</th></tr>";
foreach ($list as $item) { foreach ($list as $item) {
echo "<tr>"; echo "<tr>";
print_cell("left", $item['filename']); print_cell("left", $item['filename']);
@ -520,13 +520,13 @@
} }
echo "</table>"; echo "</table>";
} }
echo "<br /><center><form action=\"".$ME."\" method=get>"; echo "<br /><center><form action=\"".$ME."\" method=\"get\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir />"; echo " <input type=\"hidden\" name=\"wdir\" value=$wdir />";
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel />"; echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />";
echo " <INPUT TYPE=submit VALUE=\"$strok\" />"; echo " <input type=\"submit\" value=\"$strok\" />";
echo "</FORM>"; echo "</form>";
echo "</CENTER>"; echo "</center>";
} else { } else {
displaydir($wdir); displaydir($wdir);
} }
@ -636,7 +636,7 @@ function printfilelist($filelist) {
foreach ($filelist as $file) { foreach ($filelist as $file) {
if (is_dir($basedir.$file)) { if (is_dir($basedir.$file)) {
echo "<img src=\"$CFG->pixpath/f/folder.gif\" height=16 width=16> $file<br />"; echo "<img src=\"$CFG->pixpath/f/folder.gif\" height=\"16\" width=\"16\"> $file<br />";
$subfilelist = array(); $subfilelist = array();
$currdir = opendir($basedir.$file); $currdir = opendir($basedir.$file);
while ($subfile = readdir($currdir)) { while ($subfile = readdir($currdir)) {
@ -648,18 +648,18 @@ function printfilelist($filelist) {
} else { } else {
$icon = mimeinfo("icon", $file); $icon = mimeinfo("icon", $file);
echo "<img src=\"$CFG->pixpath/f/$icon\" height=16 width=16> $file<br />"; echo "<img src=\"$CFG->pixpath/f/$icon\" height=\"16\" width=\"16\"> $file<br />";
} }
} }
} }
function print_cell($alignment="center", $text="&nbsp;") { function print_cell($alignment="center", $text="&nbsp;") {
echo "<TD ALIGN=\"$alignment\" NOWRAP>"; echo "<td align=\"$alignment\" nowrap=\"nowrap\">";
echo "<FONT SIZE=\"-1\" FACE=\"Arial, Helvetica\">"; echo "<font size=\"-1\" face=\"Arial, Helvetica\">";
echo "$text"; echo "$text";
echo "</FONT>"; echo "</font>";
echo "</TD>\n"; echo "</td>\n";
} }
function displaydir ($wdir) { function displaydir ($wdir) {
@ -704,15 +704,15 @@ function displaydir ($wdir) {
$strchoose = get_string("choose"); $strchoose = get_string("choose");
echo "<FORM ACTION=\"".$ME."\" METHOD=post NAME=dirform>"; echo "<form action=\"".$ME."\" method=\"post\" name=\"dirform\">";
echo "<TABLE BORDER=0 cellspacing=2 cellpadding=2 width=640>"; echo "<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\" width=\"640\">";
echo "<TR>"; echo "<tr>";
echo "<TH WIDTH=5></TH>"; echo "<th width=\"5\"></th>";
echo "<TH ALIGN=left>$strname</TH>"; echo "<th align=\"left\">$strname</th>";
echo "<TH ALIGN=right>$strsize</TH>"; echo "<th align=\"right\">$strsize</th>";
echo "<TH ALIGN=right>$strmodified</TH>"; echo "<th align=\"right\">$strmodified</th>";
echo "<TH ALIGN=right>$straction</TH>"; echo "<th align=\"right\">$straction</th>";
echo "</TR>\n"; echo "</tr>\n";
if ($wdir == "/") { if ($wdir == "/") {
$wdir = ""; $wdir = "";
@ -731,15 +731,15 @@ function displaydir ($wdir) {
$filesafe = rawurlencode($dir); $filesafe = rawurlencode($dir);
$filedate = userdate(filectime($filename), "%d %b %Y, %I:%M %p"); $filedate = userdate(filectime($filename), "%d %b %Y, %I:%M %p");
echo "<TR>"; echo "<tr>";
print_cell("center", "<INPUT TYPE=checkbox NAME=\"file$count\" VALUE=\"$fileurl\" />"); print_cell("center", "<input type=\"checkbox\" name=\"file$count\" value=\"$fileurl\" />");
print_cell("left", "<A HREF=\"".basename($ME)."?id=$id&wdir=$fileurl\"><IMG SRC=\"$CFG->pixpath/f/folder.gif\" HEIGHT=16 WIDTH=16 BORDER=0 ALT=\"Folder\"></A> <A HREF=\"".basename($ME)."?id=$id&wdir=$fileurl\">".htmlspecialchars($dir)."</A>"); print_cell("left", "<a href=\"".basename($ME)."?id=$id&wdir=$fileurl\"><img src=\"$CFG->pixpath/f/folder.gif\" height=\"16\" width=\"16\" border=\"0\" alt=\"Folder\"></a> <a href=\"".basename($ME)."?id=$id&wdir=$fileurl\">".htmlspecialchars($dir)."</a>");
print_cell("right", "-"); print_cell("right", "-");
print_cell("right", $filedate); print_cell("right", $filedate);
print_cell("right", "<A HREF=\"".basename($ME)."?id=$id&wdir=$wdir&file=$filesafe&action=rename\">$strrename</A>"); print_cell("right", "<a href=\"".basename($ME)."?id=$id&wdir=$wdir&file=$filesafe&action=rename\">$strrename</a>");
echo "</TR>"; echo "</tr>";
} }
} }
@ -772,9 +772,9 @@ function displaydir ($wdir) {
print_cell("center", "<input type=\"checkbox\" name=\"file$count\" value=\"$fileurl\" />"); print_cell("center", "<input type=\"checkbox\" name=\"file$count\" value=\"$fileurl\" />");
echo "<td align=left nowrap>"; echo "<td align=\"left\" nowrap=\"nowrap\">";
link_to_popup_window ($ffurl, "display", link_to_popup_window ($ffurl, "display",
"<img src=\"$CFG->pixpath/f/$icon\" height=16 width=16 border=0 alt=\"file\">", "<img src=\"$CFG->pixpath/f/$icon\" height=\"16\" width=\"16\" border=\"0\" alt=\"file\">",
480, 640); 480, 640);
echo "<font size=\"-1\" face=\"Arial, Helvetica\">"; echo "<font size=\"-1\" face=\"Arial, Helvetica\">";
link_to_popup_window ($ffurl, "display", htmlspecialchars($file), 480, 640); link_to_popup_window ($ffurl, "display", htmlspecialchars($file), 480, 640);
@ -793,22 +793,22 @@ function displaydir ($wdir) {
$edittext .= "<a href=\"".basename($ME)."?id=$id&wdir=$wdir&file=$fileurl&action=listzip\">$strlist</a> "; $edittext .= "<a href=\"".basename($ME)."?id=$id&wdir=$wdir&file=$fileurl&action=listzip\">$strlist</a> ";
} }
print_cell("right", "$edittext <A HREF=\"".basename($ME)."?id=$id&wdir=$wdir&file=$filesafe&action=rename\">$strrename</A>"); print_cell("right", "$edittext <a href=\"".basename($ME)."?id=$id&wdir=$wdir&file=$filesafe&action=rename\">$strrename</a>");
echo "</tr>"; echo "</tr>";
} }
} }
echo "</table>"; echo "</table>";
echo "<hr width=640 align=center noshade size=1>"; echo "<hr width=\"640\" align=\"center\" noshade=\"noshade\" size=\"1\">";
if (empty($wdir)) { if (empty($wdir)) {
$wdir = "/"; $wdir = "/";
} }
echo "<TABLE BORDER=0 cellspacing=2 cellpadding=2 width=640>"; echo "<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\" width=\"640\">";
echo "<TR><TD>"; echo "<tr><td>";
echo "<INPUT TYPE=hidden NAME=id VALUE=\"$id\" />"; echo "<input type=\"hidden\" name=\"id\" value=\"$id\" />";
echo "<INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\" /> "; echo "<input type=\"hidden\" name=\"wdir\" value=\"$wdir\" /> ";
$options = array ( $options = array (
"move" => "$strmovetoanotherfolder", "move" => "$strmovetoanotherfolder",
"delete" => "$strdeletecompletely", "delete" => "$strdeletecompletely",
@ -818,34 +818,34 @@ function displaydir ($wdir) {
choose_from_menu ($options, "action", "", "$strwithchosenfiles...", "javascript:document.dirform.submit()"); choose_from_menu ($options, "action", "", "$strwithchosenfiles...", "javascript:document.dirform.submit()");
} }
echo "</FORM>"; echo "</form>";
echo "<TD ALIGN=center>"; echo "<td align=\"center\">";
if (!empty($USER->fileop) and ($USER->fileop == "move") and ($USER->filesource <> $wdir)) { if (!empty($USER->fileop) and ($USER->fileop == "move") and ($USER->filesource <> $wdir)) {
echo "<FORM ACTION=\"".$ME."\" METHOD=get>"; echo "<form action=\"".$ME."\" method=\"get\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\" />"; echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />";
echo " <INPUT TYPE=hidden NAME=action VALUE=paste />"; echo " <input type=\"hidden\" name=\"action\" value=\"paste\" />";
echo " <INPUT TYPE=submit VALUE=\"$strmovefilestohere\" />"; echo " <input type=\"submit\" value=\"$strmovefilestohere\" />";
echo "</FORM>"; echo "</form>";
} }
echo "<TD ALIGN=right>"; echo "<td align=\"right\">";
echo "<FORM ACTION=\"".$ME."\" METHOD=get>"; echo "<form action=\"".$ME."\" method=\"get\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\" />"; echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />";
echo " <INPUT TYPE=hidden NAME=action VALUE=mkdir />"; echo " <input type=\"hidden\" name=\"action\" value=\"mkdir\" />";
echo " <INPUT TYPE=submit VALUE=\"$strmakeafolder\" />"; echo " <input type=\"submit\" value=\"$strmakeafolder\" />";
echo "</FORM>"; echo "</form>";
echo "</TD>"; echo "</td>";
echo "<TD ALIGN=right>"; echo "<td align=\"right\">";
echo "<FORM ACTION=\"".$ME."\" METHOD=get>"; echo "<form action=\"".$ME."\" method=\"get\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id />"; echo " <input type=\"hidden\" name=\"id\" value=$id />";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\" />"; echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />";
echo " <INPUT TYPE=hidden NAME=action VALUE=upload />"; echo " <input type=\"hidden\" name=\"action\" value=\"upload\" />";
echo " <INPUT TYPE=submit VALUE=\"$struploadafile\" />"; echo " <input type=\"submit\" value=\"$struploadafile\" />";
echo "</FORM>"; echo "</form>";
echo "</TD></TR>"; echo "</td></tr>";
echo "</TABLE>"; echo "</table>";
echo "<HR WIDTH=640 ALIGN=CENTER NOSHADE SIZE=1>"; echo "<hr width=\"640\" align=\"center\" noshade=\"noshade\" size=\"1\">";
} }

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
function scorm_upgrade($oldversion) { function scorm_upgrade($oldversion) {
/// This function does anything necessary to upgrade /// This function does anything necessary to upgrade

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
function scorm_upgrade($oldversion) { function scorm_upgrade($oldversion) {
// This function does anything necessary to upgrade // This function does anything necessary to upgrade

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
require_once("../../config.php"); require_once("../../config.php");
require_once("lib.php"); require_once("lib.php");
@ -82,17 +82,17 @@
// //
print_simple_box_start("center", "", "$THEME->cellheading"); print_simple_box_start("center", "", "$THEME->cellheading");
echo "<table cellpadding=\"5\" align=\"center\">\n"; echo "<table cellpadding=\"5\" align=\"center\">\n";
echo " <tr><td align=\"right\" nowrap><p><b>$strname:</b></p></td><td><p>$form->name</p></a></td></tr>\n"; echo " <tr><td align=\"right\" nowrap=\"nowrap\"><p><b>$strname:</b></p></td><td><p>$form->name</p></a></td></tr>\n";
echo " <tr><td align=\"right\" nowrap><p><b>".get_string("validation","scorm").":</b></p></td><td><p>".get_string($result,"scorm")."</p></a></td></tr>\n"; echo " <tr><td align=\"right\" nowrap=\"nowrap\"><p><b>".get_string("validation","scorm").":</b></p></td><td><p>".get_string($result,"scorm")."</p></a></td></tr>\n";
if ($errorlogs != '') { if ($errorlogs != '') {
$lines = round(count($errors)/4); $lines = round(count($errors)/4);
if ($lines < 5) { if ($lines < 5) {
$lines = 5; $lines = 5;
} }
echo " <tr><td align=\"right\" nowrap><p><b>".get_string("errorlogs","scorm").":</b></p></td><td><textarea rows=\"".$lines."\" cols=\"30\" readonly>".$errorlogs."</textarea></a></td></tr>\n"; echo " <tr><td align=\"right\" nowrap=\"nowrap\"><p><b>".get_string("errorlogs","scorm").":</b></p></td><td><textarea rows=\"".$lines."\" cols=\"30\" readonly>".$errorlogs."</textarea></a></td></tr>\n";
} }
if (($form->mode == "update") && ($form->launch == 0) && (get_records("scorm_sco_users","scormid",$form->instance))) if (($form->mode == "update") && ($form->launch == 0) && (get_records("scorm_sco_users","scormid",$form->instance)))
echo " <tr><td align=\"center\" colspan=\"2\" nowrap><p><b>".get_string("trackingloose","scorm")."</b></p></td></tr>\n"; echo " <tr><td align=\"center\" colspan=\"2\" nowrap=\"nowrap\"><p><b>".get_string("trackingloose","scorm")."</b></p></td></tr>\n";
echo "</table>\n"; echo "</table>\n";
if (($result == "regular") || ($result == "found")){ if (($result == "regular") || ($result == "found")){
if (empty($form->auto)) { if (empty($form->auto)) {
@ -150,8 +150,8 @@
?> ?>
<table cellpadding="5" align="center"> <table cellpadding="5" align="center">
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("grademethod", "scorm") ?>:</b></p></td> <td align="right"><p><b><?php print_string("grademethod", "scorm") ?>:</b></p></td>
<td> <td>
<?php <?php
$options = array(); $options = array();
@ -163,8 +163,8 @@
?> ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("maximumgrade") ?>:</b></p></td> <td align="right"><p><b><?php print_string("maximumgrade") ?>:</b></p></td>
<td> <td>
<?php <?php
for ($i=100; $i>=1; $i--) { for ($i=100; $i>=1; $i--) {
@ -176,8 +176,8 @@
?> ?>
</td> </td>
</tr> </tr>
<tr valign=top> <tr valign="top">
<td align=right><p><b><?php print_string("autocontinue","scorm") ?>:</b></p></td> <td align="right"><p><b><?php print_string("autocontinue","scorm") ?>:</b></p></td>
<td> <td>
<?php <?php
$options = array(); $options = array();
@ -188,7 +188,7 @@
</td> </td>
</tr> </tr>
<tr valign="top"> <tr valign="top">
<td align="right" nowrap> <td align="right" nowrap="nowrap">
<p><b><?php p($strnewwindow) ?></b></p> <p><b><?php p($strnewwindow) ?></b></p>
</td> </td>
<td> <td>
@ -207,8 +207,8 @@
echo "document.theform.auto.disabled=true;\n"; echo "document.theform.auto.disabled=true;\n";
?> ?>
</script> </script>
<input name="setnewwindow" type=hidden value=1 /> <input name="setnewwindow" type="hidden" value="1" />
<input name="newwindow" type=checkbox value=1 <?php p($newwindow) ?> onclick="autowindow();return lockoptions('theform','newwindow', subitems);" /> <input name="newwindow" type="checkbox" value="1" <?php p($newwindow) ?> onclick="autowindow();return lockoptions('theform','newwindow', subitems);" />
<?php p($strnewwindowopen) ?> <?php p($strnewwindowopen) ?>
<ul> <ul>
<?php <?php
@ -223,10 +223,10 @@
} }
?> ?>
<input name="hwidth" type=hidden value="0" /> <input name="hwidth" type="hidden" value="0" />
<input name="width" type=text size=4 value="<?php p($window->width) ?>" /> <?php p($strwidth) ?><br /> <input name="width" type="text" size="4" value="<?php p($window->width) ?>" /> <?php p($strwidth) ?><br />
<input name="hheight" type=hidden value="0" /> <input name="hheight" type="hidden" value="0" />
<input name="height" type=text size=4 value="<?php p($window->height) ?>" /> <?php p($strheight) ?><br /> <input name="height" type="text" size="4" value="<?php p($window->height) ?>" /> <?php p($strheight) ?><br />
<?php <?php
if (!$newwindow) { if (!$newwindow) {
echo "<script>\n<!--\n"; echo "<script>\n<!--\n";
@ -253,7 +253,7 @@
<input type="hidden" name="mode" value="<?php p($form->mode) ?>" /> <input type="hidden" name="mode" value="<?php p($form->mode) ?>" />
<div align="center"> <div align="center">
<input type="submit" value="<?php print_string("savechanges") ?>" /> <input type="submit" value="<?php print_string("savechanges") ?>" />
<input type="submit" name=cancel value="<?php print_string("cancel") ?>" /> <input type="submit" name="cancel" value="<?php print_string("cancel") ?>" />
</div> </div>
</form> </form>
<?php <?php

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
require_once("../../config.php"); require_once("../../config.php");
@ -10,7 +10,7 @@
if ($course->category) { if ($course->category) {
require_login($course->id); require_login($course->id);
$navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->"; $navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
} else { } else {
$navigation = ''; $navigation = '';
} }
@ -58,20 +58,20 @@
$tt = "$scorm->section"; $tt = "$scorm->section";
} }
} else { } else {
$tt = "<FONT SIZE=1>".userdate($scorm->timemodified); $tt = "<font size=\"1\">".userdate($scorm->timemodified);
} }
if (!$scorm->visible) { if (!$scorm->visible) {
//Show dimmed if the mod is hidden //Show dimmed if the mod is hidden
$table->data[] = array ($tt, "<A class=\"dimmed\" HREF=\"view.php?id=$scorm->coursemodule\">$scorm->name</A>", $table->data[] = array ($tt, "<a class=\"dimmed\" href=\"view.php?id=$scorm->coursemodule\">$scorm->name</a>",
text_to_html($scorm->summary) ); text_to_html($scorm->summary) );
} else { } else {
//Show normal if the mod is visible //Show normal if the mod is visible
$table->data[] = array ($tt, "<A HREF=\"view.php?id=$scorm->coursemodule\">$scorm->name</A>", $table->data[] = array ($tt, "<a href=\"view.php?id=$scorm->coursemodule\">$scorm->name</a>",
text_to_html($scorm->summary) ); text_to_html($scorm->summary) );
} }
} }
echo "<BR>"; echo "<br>";
print_table($table); print_table($table);

View file

@ -1,4 +1,4 @@
<?PHP // $Id$ <?php // $Id$
/// Library of functions and constants for module scorm /// Library of functions and constants for module scorm
/// (replace scorm with the name of your module and delete this line) /// (replace scorm with the name of your module and delete this line)
@ -588,7 +588,7 @@ function scorm_string_round($stringa) {
// Crop a string to $len character and set an anchor title to the full string // Crop a string to $len character and set an anchor title to the full string
$len=11; $len=11;
if ( strlen($stringa)>$len ) { if ( strlen($stringa)>$len ) {
return "<A name=\"\" title=\"$stringa\">".substr($stringa,0,$len-4).'...'.substr($stringa,strlen($stringa)-1,1).'</A>'; return "<a name=\"\" title=\"$stringa\">".substr($stringa,0,$len-4).'...'.substr($stringa,strlen($stringa)-1,1).'</a>';
} else } else
return $stringa; return $stringa;
} }

Some files were not shown because too many files have changed in this diff Show more