Update of /cvsroot/aimmath/moodle/mod/aim_quiz
In directory sc8-pr-cvs1:/tmp/cvs-serv27625/mod/aim_quiz
Modified Files:
aimpage.php lib.php view.php
Log Message:
I have made things more moodly by 1) putting the AiM pages into boxes with white background and 2) adding help icons to administrative links. The help files are copied from AiM's teacher.html and still need to be adapted.
Index: aimpage.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/aim_quiz/aimpage.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** aimpage.php 27 Aug 2003 14:21:24 -0000 1.2
--- aimpage.php 30 Aug 2003 15:21:31 -0000 1.3
***************
*** 100,104 ****
foreach ($_POST as $key => $arg) {
if (strcasecmp($key, "target")) { // ignore target arguments
! $postdata = aim_quiz_add_arg_to_url_data($postdata, $key, stripslashes($arg));
}
}
--- 100,104 ----
foreach ($_POST as $key => $arg) {
if (strcasecmp($key, "target")) { // ignore target arguments
! $postdata = aim_quiz_add_arg_to_url_data($postdata, $key, stripslashes($arg));
}
}
***************
*** 107,111 ****
foreach ($_POST as $key => $arg) {
if (strcasecmp($key, "target")) { // ignore target arguments
! $postdata = aim_quiz_add_arg_to_url_data($postdata, $key, $arg);
}
}
--- 107,111 ----
foreach ($_POST as $key => $arg) {
if (strcasecmp($key, "target")) { // ignore target arguments
! $postdata = aim_quiz_add_arg_to_url_data($postdata, $key, $arg);
}
}
***************
*** 141,149 ****
aim_quiz_print_aim_output_script();
! $urlout = htmlspecialchars($server->address . "?" . $postdata);
! if (!$_POST)
! echo "<P>Default page : <A href=\"$urlout\">$urlout</A></P>";
! else
! echo "<P>Requested page : <A href=\"$urlout\">$urlout</A></P>";
// load the AiM page and grab the result
--- 141,150 ----
aim_quiz_print_aim_output_script();
! // For testing purposes only:
! // $urlout = htmlspecialchars($server->address . "?" . $postdata);
! // if (!$_POST)
! // echo "<P>Default page : <A href=\"$urlout\">$urlout</A></P>";
! // else
! // echo "<P>Requested page : <A href=\"$urlout\">$urlout</A></P>";
// load the AiM page and grab the result
***************
*** 171,183 ****
if (isteacher($course->id)) {
// write admin links
! echo "<P align=\"right\">";
! echo "<A href=\"aimpage.php?id=$cm->id\">" . get_string("analyseresults", "aim_quiz") . "</A><BR>";
! echo "<A href=\"aimpage.php?id=$cm->id&aimaction=try\">" . get_string("tryquiz", "aim_quiz") . "</A><BR />";
! echo "<A href=\"aimpage.php?id=$cm->id&aimaction=edit\">" . get_string("editquiz", "aim_quiz") . "</A><BR />";
! echo "<A href=\"aimpage.php?id=$cm->id&aimaction=source\">" . get_string("browsesource", "aim_quiz") . "</A><BR />";
! echo "<A href=\"aimpage.php?id=$cm->id&aimaction=subject\">" . get_string("editsubject", "aim_quiz") . "</A>";
! echo "</P>";
}
echo $data;
// update max grade
--- 172,191 ----
if (isteacher($course->id)) {
// write admin links
! echo "<div align=right>";
! echo "<font size=2>";
! helpbutton("analyze_quiz", get_string("analyze_quiz", "aim_quiz"), "aim_quiz");
! echo "<A href=\"aimpage.php?id=$cm->id\">" . get_string("analyze_quiz", "aim_quiz") . "</A><BR>";
! helpbutton("try_quiz", get_string("try_quiz", "aim_quiz"), "aim_quiz");
! echo "<A href=\"aimpage.php?id=$cm->id&aimaction=try\">" . get_string("try_quiz", "aim_quiz") . "</A><BR />";
! helpbutton("admin_quiz", get_string("admin_quiz", "aim_quiz"), "aim_quiz");
! echo "<A href=\"aimpage.php?id=$cm->id&aimaction=edit\">" . get_string("admin_quiz", "aim_quiz") . "</A><BR />";
! helpbutton("admin_subject", get_string("admin_subject", "aim_quiz"), "aim_quiz");
! echo "<A href=\"aimpage.php?id=$cm->id&aimaction=subject\">" . get_string("admin_subject", "aim_quiz") . "</A>";
! echo "</font></div>";
}
+
+ print_simple_box_start("center", "", "$THEME->cellcontent", "20");
echo $data;
+ print_simple_box_end();
// update max grade
***************
*** 199,201 ****
print_footer($course);
! ?>
\ No newline at end of file
--- 207,209 ----
print_footer($course);
! ?>
Index: lib.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/aim_quiz/lib.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** lib.php 27 Aug 2003 14:21:24 -0000 1.2
--- lib.php 30 Aug 2003 15:21:31 -0000 1.3
***************
*** 195,199 ****
// prepare curl session
if (function_exists('curl_init')) { // use the POST method
! echo "<P>Using POST</P>";
$ch = curl_init($url);
if (!$ch)
--- 195,199 ----
// prepare curl session
if (function_exists('curl_init')) { // use the POST method
! // echo "<P>Using POST</P>";
$ch = curl_init($url);
if (!$ch)
***************
*** 210,214 ****
}
// if CURL is not available, use GET method instead
! echo "<P>Using GET</P>";
return @file_get_contents("$url?$postdata");
}
--- 210,214 ----
}
// if CURL is not available, use GET method instead
! // echo "<P>Using GET</P>";
return @file_get_contents("$url?$postdata");
}
***************
*** 334,341 ****
// find the row which gives the totals
if (preg_match("/<TD(?:\s[^<>]*?|)>Total<\/TD>(?:.(?!<TD\s|<TD>))*.?<TD(?:\s[^<>]*?|)>((?:.(?!<\/TD>))*?.?)<\/TD>(?:.(?!<TD\s|<TD>))*.?<TD(?:\s[^<>]*?|)>((?:.(?!<\/TD>))*?.?)<\/TD>/si", $data, $matches)) {
! if (empty($CFG->aim_quiz_grade_multiplier))
! $CFG->aim_quiz_grade_multiplier = 1.0;
! $max_grade = (int) (((float) html_entity_decode($matches[1])) * ((float) $CFG->aim_quiz_grade_multiplier));
! $grade = (int) (((float) html_entity_decode($matches[2])) * ((float) $CFG->aim_quiz_grade_multiplier));
}
}
--- 334,341 ----
// find the row which gives the totals
if (preg_match("/<TD(?:\s[^<>]*?|)>Total<\/TD>(?:.(?!<TD\s|<TD>))*.?<TD(?:\s[^<>]*?|)>((?:.(?!<\/TD>))*?.?)<\/TD>(?:.(?!<TD\s|<TD>))*.?<TD(?:\s[^<>]*?|)>((?:.(?!<\/TD>))*?.?)<\/TD>/si", $data, $matches)) {
! if (empty($CFG->aim_quiz_grade_multiplier))
! $CFG->aim_quiz_grade_multiplier = 1.0;
! $max_grade = (int) (((float) html_entity_decode($matches[1])) * ((float) $CFG->aim_quiz_grade_multiplier));
! $grade = (int) (((float) html_entity_decode($matches[2])) * ((float) $CFG->aim_quiz_grade_multiplier));
}
}
***************
*** 401,407 ****
// convert Latex to MathML
! if (function_exists('editer')) {
! $out = preg_replace_callback("/<LATEX>(.*?)<\/LATEX>/si", create_function('$matches', 'return editer($matches[1]);'), $out);
! }
// remove all links from error pages
--- 401,408 ----
// convert Latex to MathML
! // **** I have commented the following lines because I want to have a look at the raw latex.
! // if (function_exists('editer')) {
! // $out = preg_replace_callback("/<LATEX>(.*?)<\/LATEX>/si", create_function('$matches', 'return editer($matches[1]);'), $out);
! // }
// remove all links from error pages
***************
*** 473,475 ****
}
! ?>
\ No newline at end of file
--- 474,476 ----
}
! ?>
Index: view.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/aim_quiz/view.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** view.php 27 Aug 2003 14:21:24 -0000 1.2
--- view.php 30 Aug 2003 15:21:31 -0000 1.3
***************
*** 161,164 ****
--- 161,180 ----
"$navigation <A HREF=\"index.php?id=$course->id\">$straim_quizzes</A> -> $aim_quiz->name",
"", "", true, update_module_button($cm->id, $course->id, $straim_quiz), navmenu($course, $cm));
+
+ /// Print administrative links
+ if (isteacher($course->id)) {
+ // write admin links
+ echo "<div align=right>";
+ echo "<font size=2>";
+ helpbutton("analyze_quiz", get_string("analyze_quiz", "aim_quiz"), "aim_quiz");
+ echo "<A href=\"aimpage.php?id=$cm->id\">" . get_string("analyze_quiz", "aim_quiz") . "</A><BR>";
+ helpbutton("try_quiz", get_string("try_quiz", "aim_quiz"), "aim_quiz");
+ echo "<A href=\"aimpage.php?id=$cm->id&aimaction=try\">" . get_string("try_quiz", "aim_quiz") . "</A><BR />";
+ helpbutton("admin_quiz", get_string("admin_quiz", "aim_quiz"), "aim_quiz");
+ echo "<A href=\"aimpage.php?id=$cm->id&aimaction=edit\">" . get_string("admin_quiz", "aim_quiz") . "</A><BR />";
+ helpbutton("admin_subject", get_string("admin_subject", "aim_quiz"), "aim_quiz");
+ echo "<A href=\"aimpage.php?id=$cm->id&aimaction=subject\">" . get_string("admin_subject", "aim_quiz") . "</A>";
+ echo "</font></div>";
+ }
print_heading($strgrades);
***************
*** 175,192 ****
$picture = print_user_picture($student->id, $course->id, $student->picture, false, true);
if ($grades[$student->id]->grade >= 0)
! $grade =& $grades[$student->id]->grade;
else
! $grade = "";
if ($grades[$student->id]->override) {
! $edited = get_string("edited", "aim_quiz") . " (";
! $editedclose = ")";
}
else if ($grades[$student->id]->comment) {
! $edited = get_string("commented", "aim_quiz") . " (";
! $editedclose = ")";
}
else {
! $edited = "";
! $editedclose = "";
}
$table->data[] = array($picture, $student->firstname, $student->lastname, $grade, "$edited<A href=\"editgrade.php?id=$aim_quiz->id&userid=$student->id\">$streditgrade</A>$editedclose");
--- 191,208 ----
$picture = print_user_picture($student->id, $course->id, $student->picture, false, true);
if ($grades[$student->id]->grade >= 0)
! $grade =& $grades[$student->id]->grade;
else
! $grade = "";
if ($grades[$student->id]->override) {
! $edited = get_string("edited", "aim_quiz") . " (";
! $editedclose = ")";
}
else if ($grades[$student->id]->comment) {
! $edited = get_string("commented", "aim_quiz") . " (";
! $editedclose = ")";
}
else {
! $edited = "";
! $editedclose = "";
}
$table->data[] = array($picture, $student->firstname, $student->lastname, $grade, "$edited<A href=\"editgrade.php?id=$aim_quiz->id&userid=$student->id\">$streditgrade</A>$editedclose");
***************
*** 204,215 ****
echo "</TD></TR></TABLE>";
- print_heading(get_string("actions", "aim_quiz"));
- echo "<P align=\"center\">";
- echo "<A href=\"aimpage.php?id=$cm->id\">" . get_string("analyseresults", "aim_quiz") . "</A><BR>";
- echo "<A href=\"aimpage.php?id=$cm->id&aimaction=try\">" . get_string("tryquiz", "aim_quiz") . "</A><BR />";
- echo "<A href=\"aimpage.php?id=$cm->id&aimaction=edit\">" . get_string("editquiz", "aim_quiz") . "</A><BR />";
- echo "<A href=\"aimpage.php?id=$cm->id&aimaction=source\">" . get_string("browsesource", "aim_quiz") . "</A><BR />";
- echo "<A href=\"aimpage.php?id=$cm->id&aimaction=subject\">" . get_string("editsubject", "aim_quiz") . "</A>";
- echo "</P>";
}
else {
--- 220,223 ----
|