| Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv9302/mod/math_assignment
Modified Files:
	aimpage.php 
Log Message:
Improved debugging facilities plus a minor bug fix to the html / xml choice code
Index: aimpage.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/aimpage.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** aimpage.php	16 Sep 2003 17:05:37 -0000	1.6
--- aimpage.php	16 Sep 2003 19:13:03 -0000	1.7
***************
*** 15,18 ****
--- 15,24 ----
      optional_variable($aimaction);  // action to get AiM to perform
  
+     // debugging
+     if (isset($CFG->math_assignment_debug))
+         $debug = $CFG->math_assignment_debug;
+     if (array_key_exists("debug", $_GET))
+         $debug = $_GET['debug'];
+ 
      if (! $site = get_site()) {
          redirect("$CFG->wwwroot/$CFG->admin/index.php");
***************
*** 109,113 ****
                      setcookie("output", $_POST['outputchange'], 0x7FFFFFFF);
                      $_COOKIE['output'] = $_POST['outputchange'];
!                     $postdata = $_POST['postdata'];                     
                  }
              }
--- 115,120 ----
                      setcookie("output", $_POST['outputchange'], 0x7FFFFFFF);
                      $_COOKIE['output'] = $_POST['outputchange'];
!                     $postdata = $_POST['postdata'];
!                     $_POST = array();
                  }
              }
***************
*** 153,158 ****
      math_assignment_print_aim_output_script();
  
!     if (isset($CFG->math_assignment_debug)) {
!         if ($CFG->math_assignment_debug > 0) {
              $urlout = htmlspecialchars($server->address . "?" . $postdata);
              if (!$_POST)
--- 160,165 ----
      math_assignment_print_aim_output_script();
  
!     if (isset($debug)) {
!         if ($debug > 0) {
              $urlout = htmlspecialchars($server->address . "?" . $postdata);
              if (!$_POST)
***************
*** 203,206 ****
--- 210,222 ----
      if (isteacher($course->id))
          echo math_assignment_get_admin_links($cm, $math_assignment, "right");
+ 
+     if (isset($debug)) {
+         if ($debug > 1) {
+             echo "<p><a href=\"#endofbefore\">Skip this debug output</a></p>";
+             echo "<p>" . nl2br(htmlspecialchars($data)) . "</p>";
+             echo "<a name=\"endofbefore\"></a>";
+         }
+     }
+ 
      // 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);
***************
*** 228,234 ****
      math_assignment_print_grade_override($math_assignment, $USER->id);
  
!     if (isset($CFG->math_assignment_debug)) {
!         if ($CFG->math_assignment_debug > 1) {
              echo "<p>" . nl2br(htmlspecialchars($data)) . "</p>";
          }
      }
--- 244,252 ----
      math_assignment_print_grade_override($math_assignment, $USER->id);
  
!     if (isset($debug)) {
!         if ($debug > 2) {
!             echo "<p><a href=\"#endofafter\">Skip this debug output</a></p>";
              echo "<p>" . nl2br(htmlspecialchars($data)) . "</p>";
+             echo "<a name=\"endofafter\"></a>";
          }
      }
 |