Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv1782/mod/math_assignment
Modified Files:
aimpage.php index.php
Log Message:
Removed 'printer friendly version' links from aimpage. Also another minor bug fix in index.php.
Index: aimpage.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/aimpage.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** aimpage.php 11 Sep 2003 15:12:23 -0000 1.3
--- aimpage.php 11 Sep 2003 21:15:32 -0000 1.4
***************
*** 14,18 ****
optional_variable($q); // quiz ID
optional_variable($aimaction); // action to get AiM to perform
! optional_variable($output, "html"); // output type (html, xml, pdf)
if (strcasecmp($output, "xml") == 0)
--- 14,18 ----
optional_variable($q); // quiz ID
optional_variable($aimaction); // action to get AiM to perform
! optional_variable($output, "html"); // output type (html, xml)
if (strcasecmp($output, "xml") == 0)
***************
*** 20,27 ****
else
$usexml = false;
- if (strcasecmp($output, "pdf") == 0)
- $makepdf = true;
- else
- $makepdf = false;
if (! $site = get_site()) {
--- 20,23 ----
***************
*** 69,73 ****
// browse through the data which has been POSTed to us
$postdata = "";
- $createpdfaction = "";
if (!$_POST) {
if (isteacher($course->id)) {
--- 65,68 ----
***************
*** 75,79 ****
$postdata = math_assignment_add_arg_to_url_data($postdata, "Command","try/Quiz");
$postdata = math_assignment_add_arg_to_url_data($postdata, "Action", "TryQuiz");
- $createpdfaction = "try";
}
else if (strcasecmp($aimaction, "edit") == 0) { // load the edit quiz page
--- 70,73 ----
***************
*** 105,109 ****
$postdata = math_assignment_add_arg_to_url_data($postdata, "StudentID", $USER->username);
$postdata = math_assignment_add_arg_to_url_data($postdata, "Password", $server->student_passwd);
- $createpdfaction = "show";
}
}
--- 99,102 ----
***************
*** 115,129 ****
}
}
- if (array_key_exists("Command", $_POST)) {
- if (strcasecmp($_POST['Command'], "ShowQuizPage") == 0)
- $createpdfaction = "show";
- else if(strcasecmp($_POST['Command'], "try/Quiz") == 0)
- $createpdfaction = "try";
- }
}
- if (empty($createpdfaction))
- $makepdf = false; // only allow pdf for supported pages
- if ($makepdf)
- $createpdfaction = ""; // don't display pdf link for pdf output page
// Print the page header
--- 108,112 ----
***************
*** 153,158 ****
// Print the main part of the page
! if (!$makepdf)
! math_assignment_print_aim_output_script();
if (isset($CFG->math_assignment_debug)) {
--- 136,140 ----
// Print the main part of the page
! math_assignment_print_aim_output_script();
if (isset($CFG->math_assignment_debug)) {
***************
*** 167,171 ****
// load the AiM page and grab the result
! $data = math_assignment_get_aim_output($server->address, $postdata, ($usexml || $makepdf) ? "latex" : "html");
// check if we need to sooth any AiM grumbles
--- 149,153 ----
// load the AiM page and grab the result
! $data = math_assignment_get_aim_output($server->address, $postdata, $usexml ? "latex" : "html");
// check if we need to sooth any AiM grumbles
***************
*** 178,182 ****
}
// retry
! $data = math_assignment_get_aim_output($server->address, $postdata, ($usexml || $makepdf) ? "latex" : "html");
}
}
--- 160,164 ----
}
// retry
! $data = math_assignment_get_aim_output($server->address, $postdata, $usexml ? "latex" : "html");
}
}
***************
*** 185,229 ****
if (isteacher($course->id))
echo math_assignment_get_admin_links($cm, $math_assignment, "right");
- // write pdf link
- if ($createpdfaction) {
- $strcreatepdf = get_string("createpdf", "math_assignment");
- echo "<p align=\"right\"><a href=\"aimpage.php?id=$cm->id&aimaction=$createpdfaction&output=pdf\">$strcreatepdf</a> ";
- helpbutton("try_quiz", $strcreatepdf, "math_assignment");
- echo "</p>\n";
- }
-
// write out relevant parts of it
! $data = math_assignment_convert_aim_output($math_assignment, $subject, $data, $server->address, "aimpage.php?id=$cm->id", !$makepdf, $grade, $max_grade);
if (!$data) {
error(get_string("nooutput", "math_assignment"), "view.php?id=$cm->id");
}
! if ($makepdf) {
! if (math_assignment_pdf($math_assignment, $course, $data)) {
! notice(get_string("pdfok", "math_assignment"));
! } else {
! error(get_string("pdferror", "math_assignment"));
! }
! }
! else {
! print_simple_box_start("center", "", "$THEME->cellcontent", "20");
! echo $data;
! print_simple_box_end();
! // update max grade
! if ($max_grade > 0)
! set_field("math_assignment", "aimgrade", $max_grade, "id", $math_assignment->id);
! // update student grade when marking only
! if (isstudent($course->id)) {
! if (array_key_exists("Command", $_POST)) {
! if (strcmp($_POST['Command'], "MarkQuiz") == 0) {
! math_assignment_store_grade($math_assignment, $USER->id, -1, $grade);
! }
}
}
-
- // display teacher grade override comment (if any)
- math_assignment_print_grade_override($math_assignment, $USER->id);
}
if (isset($CFG->math_assignment_debug)) {
--- 167,194 ----
if (isteacher($course->id))
echo math_assignment_get_admin_links($cm, $math_assignment, "right");
// write out relevant parts of it
! $data = math_assignment_convert_aim_output($math_assignment, $subject, $data, $server->address, "aimpage.php?id=$cm->id", true, $grade, $max_grade);
if (!$data) {
error(get_string("nooutput", "math_assignment"), "view.php?id=$cm->id");
}
! print_simple_box_start("center", "", "$THEME->cellcontent", "20");
! echo $data;
! print_simple_box_end();
! // update max grade
! if ($max_grade > 0)
! set_field("math_assignment", "aimgrade", $max_grade, "id", $math_assignment->id);
! // update student grade when marking only
! if (isstudent($course->id)) {
! if (array_key_exists("Command", $_POST)) {
! if (strcmp($_POST['Command'], "MarkQuiz") == 0) {
! math_assignment_store_grade($math_assignment, $USER->id, -1, $grade);
}
}
}
+
+ // display teacher grade override comment (if any)
+ math_assignment_print_grade_override($math_assignment, $USER->id);
if (isset($CFG->math_assignment_debug)) {
Index: index.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/index.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** index.php 11 Sep 2003 20:50:40 -0000 1.2
--- index.php 11 Sep 2003 21:15:32 -0000 1.3
***************
*** 120,132 ****
math_assignment_get_file_urls($course->id, $math_assignment, $proburl, $solurl);
if ($teacher) {
! if ($showaim) {
// lookup subject
if (! $subject = get_record("math_assignment_subject", "id", $math_assignment->aimsubject)) {
! $subject->server = 0;
! $subject->name = "Unknown"; // this should never happen!
}
// lookup server
if (! $server = get_record("math_assignment_server", "id", $subject->server)) {
! $server->name = "Unknown"; // this should never happen!
$server->address = "unknown";
}
--- 120,132 ----
math_assignment_get_file_urls($course->id, $math_assignment, $proburl, $solurl);
if ($teacher) {
! if ($showaim && $math_assignment->aimquiz) {
// lookup subject
if (! $subject = get_record("math_assignment_subject", "id", $math_assignment->aimsubject)) {
! $subject->server = 0;
! $subject->name = "Unknown";
}
// lookup server
if (! $server = get_record("math_assignment_server", "id", $subject->server)) {
! $server->name = "Unknown";
$server->address = "unknown";
}
***************
*** 138,143 ****
}
array_push($row, userdate($math_assignment->timedue, "", 99, false), $math_assignment->problems ? "<a href=\"$proburl\" target=\"problems\">$strviewproblems</a>" : "", $math_assignment->solutions ? "<a href=\"$solurl\" target=\"solutions\">$strviewsolutions</a>" : "");
! if ($showaim)
! array_push($row, $subject->name, "$server->name ($server->address)");
$table->data[] = $row;
}
--- 138,147 ----
}
array_push($row, userdate($math_assignment->timedue, "", 99, false), $math_assignment->problems ? "<a href=\"$proburl\" target=\"problems\">$strviewproblems</a>" : "", $math_assignment->solutions ? "<a href=\"$solurl\" target=\"solutions\">$strviewsolutions</a>" : "");
! if ($showaim) {
! if ($math_assignment->aimquiz)
! array_push($row, $subject->name, "$server->name ($server->address)");
! else
! array_push($row, "", "");
! }
$table->data[] = $row;
}
|