aimmath-commit Mailing List for AiM Assessment in Mathematics (Page 12)
Brought to you by:
gustav_delius,
npstrick
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
(73) |
Aug
(96) |
Sep
(240) |
Oct
(34) |
Nov
(12) |
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(31) |
Feb
(6) |
Mar
(17) |
Apr
(6) |
May
(5) |
Jun
|
Jul
|
Aug
(2) |
Sep
(2) |
Oct
(19) |
Nov
|
Dec
|
| 2005 |
Jan
|
Feb
|
Mar
(14) |
Apr
(33) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <gus...@us...> - 2003-09-19 20:02:23
|
Update of /cvsroot/aimmath/AIM/doc
In directory sc8-pr-cvs1:/tmp/cvs-serv29338/doc
Modified Files:
AuthoringPackages.html
Log Message:
Added aim/Test to the list
Index: AuthoringPackages.html
===================================================================
RCS file: /cvsroot/aimmath/AIM/doc/AuthoringPackages.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** AuthoringPackages.html 13 Sep 2003 07:30:38 -0000 1.1
--- AuthoringPackages.html 19 Sep 2003 06:56:38 -0000 1.2
***************
*** 18,42 ****
</p>
<ul>
! <li><a href="aim/Diff.html"><b>Diff</b></a> - authoring utilities for differentiation questions
! <li><a href="aim/Int.html"><b>Int</b></a> - authoring utilities for integration questions
! <li><a href="aim/Matrix.html"><b>Matrix</b></a> - authoring utilities for matrix questions
! <li><a href="aim/Trig.html"><b>Trig</b></a> - authoring utilities for trig questions
<li><a href="aim/Calc.html"><b>Calc</b></a> - uses Maple's Student[Calculus] package to automatically produce
! step by step solutions of calculus problems
<li><a href="aim/Inert.html"><b>Inert</b></a> - defines Inert forms of Maple expressions and allows customized
! latex formatting of expressions
<li><a href="aim/SET.html"><b>SET</b></a> - defines an AiM class SET and related functions to get around
the problems inherent in trying to use Maple sets in randomized
! questions
<li><a href="aim/Decimal.html"><b>Decimal</b></a> - authoring utilities for dealing with the decimal representation
! of rationals
<li><a href="aim/Number.html"><b>Number</b></a> - utilities for dealing with the representations of integers (Roman
! numerals, converting numbers to words, etc)
! <li><a href="Random.html"><b>Random</b></a> - the Rand command now has several new features
<li><b>Keys()</b> - an authoring utility that makes it easy to generate quiz question
! selector functions
<li><b>Nice</b> - `Nice/Monomial`(), `Nice/Binomial`(), `Nice/Trinomial`() are
utilities that produce "nice" monomials, binomials, and
! trinomials similar to those usually found in textbook questions
</ul>
</BODY>
--- 18,43 ----
</p>
<ul>
! <li><a href="aim/Test.html"><b>Test</b></a> - a number of different tests that can be used to check whether a student's answer is correct.</li>
! <li><a href="aim/Diff.html"><b>Diff</b></a> - authoring utilities for differentiation questions</li>
! <li><a href="aim/Int.html"><b>Int</b></a> - authoring utilities for integration questions</li>
! <li><a href="aim/Matrix.html"><b>Matrix</b></a> - authoring utilities for matrix questions</li>
! <li><a href="aim/Trig.html"><b>Trig</b></a> - authoring utilities for trig questions</li>
<li><a href="aim/Calc.html"><b>Calc</b></a> - uses Maple's Student[Calculus] package to automatically produce
! step by step solutions of calculus problems</li>
<li><a href="aim/Inert.html"><b>Inert</b></a> - defines Inert forms of Maple expressions and allows customized
! latex formatting of expressions</li>
<li><a href="aim/SET.html"><b>SET</b></a> - defines an AiM class SET and related functions to get around
the problems inherent in trying to use Maple sets in randomized
! questions</li>
<li><a href="aim/Decimal.html"><b>Decimal</b></a> - authoring utilities for dealing with the decimal representation
! of rationals</li>
<li><a href="aim/Number.html"><b>Number</b></a> - utilities for dealing with the representations of integers (Roman
! numerals, converting numbers to words, etc)</li>
! <li><a href="Random.html"><b>Random</b></a> - This package defines some utility functions for generating random questions. The Rand() command is an all purpose recursive random-thing-maker.</li>
<li><b>Keys()</b> - an authoring utility that makes it easy to generate quiz question
! selector functions</li>
<li><b>Nice</b> - `Nice/Monomial`(), `Nice/Binomial`(), `Nice/Trinomial`() are
utilities that produce "nice" monomials, binomials, and
! trinomials similar to those usually found in textbook questions.</li>
</ul>
</BODY>
|
|
From: <gus...@us...> - 2003-09-19 19:58:42
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv28285/mod/math_assignment
Modified Files:
view.php
Log Message:
can now produce a printer-friendly marksheet from view.php. Not very polished yet but will do until we get feedback about it.
Index: view.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/view.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** view.php 18 Sep 2003 11:30:04 -0000 1.6
--- view.php 19 Sep 2003 09:36:44 -0000 1.7
***************
*** 136,146 ****
if ($hasaim) {
if ($studentgrade->papergrade >= 0)
! $myxls->InsertNumber($studentgrade->papergrade);
else
! $myxls->InsertText("");
if ($studentgrade->aimgrade >= 0)
! $myxls->InsertNumber($studentgrade->aimgrade);
else
! $myxls->InsertText("");
}
$myxls->InsertNumber(math_assignment_total_grade($math_assignment, $studentgrade));
--- 136,146 ----
if ($hasaim) {
if ($studentgrade->papergrade >= 0)
! $myxls->InsertNumber($studentgrade->papergrade);
else
! $myxls->InsertText("");
if ($studentgrade->aimgrade >= 0)
! $myxls->InsertNumber($studentgrade->aimgrade);
else
! $myxls->InsertText("");
}
$myxls->InsertNumber(math_assignment_total_grade($math_assignment, $studentgrade));
***************
*** 173,180 ****
if ($hasaim) {
if ($studentgrade->papergrade >= 0)
! echo "$studentgrade->papergrade";
echo "\t";
if ($studentgrade->aimgrade >= 0)
! echo "$studentgrade->aimgrade";
echo "\t";
}
--- 173,180 ----
if ($hasaim) {
if ($studentgrade->papergrade >= 0)
! echo "$studentgrade->papergrade";
echo "\t";
if ($studentgrade->aimgrade >= 0)
! echo "$studentgrade->aimgrade";
echo "\t";
}
***************
*** 184,187 ****
--- 184,229 ----
exit;
+
+ } else if ($download == "marksheet") { // display marksheet table, ready for printing
+
+ /// Print names of all the fields
+
+ echo "<html><head><title>Marksheet for $course->shortname, $math_assignment->name</title></head>
+ <body><b>Marksheet for $course->shortname<br>$math_assignment->name<b><p>
+ <table border=\"1\"><tr><th>$strfirstname</th><th>$strlastname</th>";
+ if ($hasaim)
+ echo "<th>AiM<br>$strgrade</th><th>$strpaper<br>$strgrade</th>";
+ else
+ echo "<th>$strgrade</th>";
+ echo "<th width=\"300\">Comments</th></tr>";
+
+ /// Print all the lines of data.
+
+ foreach ($grades as $studentid => $studentgrade) {
+ $student = $students[$studentid];
+ echo "<tr><td height=\"40\">$student->firstname</td><td>$student->lastname</td>";
+ if ($hasaim) {
+ echo "<td>";
+ if ($studentgrade->aimgrade >= 0)
+ echo "$studentgrade->aimgrade";
+ else echo " ";
+ echo "</td><td>";
+ if ($studentgrade->papergrade >= 0)
+ echo "$studentgrade->papergrade";
+ else echo " ";
+ echo "</td>";
+ }
+ else {
+ echo "<td>";
+ if ($studentgrade->aimgrade >= 0)
+ echo "$studentgrade->aimgrade";
+ else echo " ";
+ echo "</td>";
+ }
+ echo "<td> </td></tr>";
+ }
+ echo "</table></body></html>";
+
+ exit;
} else { // Just print the web page
***************
*** 216,235 ****
echo "<b>$strpaper $strgrade :</b> ";
if ($grade->papergrade >= 0)
! echo "$grade->papergrade / $math_assignment->papergrade";
else
! print_string("notmarked", "math_assignment");
echo "<br /><b>$strcomputer $strgrade :</b> ";
if ($grade->aimgrade >= 0)
! echo "$grade->aimgrade / $math_assignment->aimgrade";
else
! print_string("notattempted", "math_assignment");
if ($grade->aimoverride) {
! echo " (";
! print_string("gradeoverride", "math_assignment");
! echo ")";
}
echo "<br />";
if ($grade->aimcomment)
! echo "<b>" . $course->teacher . " " . get_string("comment", "math_assignment") . ":</b> " . nl2br(htmlspecialchars($grade->aimcomment)) . "<br />";
$totalgrade = math_assignment_total_grade($math_assignment, $grade);
echo "<b>$strtotal $strgrade :</b> $totalgrade / $totalmax";
--- 258,277 ----
echo "<b>$strpaper $strgrade :</b> ";
if ($grade->papergrade >= 0)
! echo "$grade->papergrade / $math_assignment->papergrade";
else
! print_string("notmarked", "math_assignment");
echo "<br /><b>$strcomputer $strgrade :</b> ";
if ($grade->aimgrade >= 0)
! echo "$grade->aimgrade / $math_assignment->aimgrade";
else
! print_string("notattempted", "math_assignment");
if ($grade->aimoverride) {
! echo " (";
! print_string("gradeoverride", "math_assignment");
! echo ")";
}
echo "<br />";
if ($grade->aimcomment)
! echo "<b>" . $course->teacher . " " . get_string("comment", "math_assignment") . ":</b> " . nl2br(htmlspecialchars($grade->aimcomment)) . "<br />";
$totalgrade = math_assignment_total_grade($math_assignment, $grade);
echo "<b>$strtotal $strgrade :</b> $totalgrade / $totalmax";
***************
*** 238,244 ****
echo "<b>$strgrade :</b> ";
if ($grade->papergrade >= 0)
! echo "$grade->papergrade / $math_assignment->papergrade";
else
! print_string("notmarked", "math_assignment");
}
}
--- 280,286 ----
echo "<b>$strgrade :</b> ";
if ($grade->papergrade >= 0)
! echo "$grade->papergrade / $math_assignment->papergrade";
else
! print_string("notmarked", "math_assignment");
}
}
***************
*** 271,298 ****
$picture = print_user_picture($student->id, $course->id, $student->picture, false, true);
if ($studentgrade->papergrade >= 0)
! $papergrade = $studentgrade->papergrade;
else
! $papergrade = "";
$papergrade = "<input type=\"text\" name=\"$student->id\" size=\"10\" maxlength=\"10\" value=\"$papergrade\" tabindex=\"$i\" />";
if ($studentgrade->aimgrade >= 0)
! $aimgrade = $studentgrade->aimgrade;
else
! $aimgrade = "";
if ($studentgrade->aimoverride) {
! $edited = "$stredited (";
! $editedclose = ")";
}
else if ($studentgrade->aimcomment) {
! $edited = "$strcommented (";
! $editedclose = ")";
}
else {
! $edited = "";
! $editedclose = "";
}
if ($hasaim)
! $table->data[] = array($picture, $student->firstname, $student->lastname, $papergrade, "$aimgrade $edited<a href=\"editgrade.php?id=$math_assignment->id&userid=$student->id\">$stredit</a>$editedclose", math_assignment_total_grade($math_assignment, $studentgrade));
else
! $table->data[] = array($picture, $student->firstname, $student->lastname, $papergrade);
$i++;
}
--- 313,340 ----
$picture = print_user_picture($student->id, $course->id, $student->picture, false, true);
if ($studentgrade->papergrade >= 0)
! $papergrade = $studentgrade->papergrade;
else
! $papergrade = "";
$papergrade = "<input type=\"text\" name=\"$student->id\" size=\"10\" maxlength=\"10\" value=\"$papergrade\" tabindex=\"$i\" />";
if ($studentgrade->aimgrade >= 0)
! $aimgrade = $studentgrade->aimgrade;
else
! $aimgrade = "";
if ($studentgrade->aimoverride) {
! $edited = "$stredited (";
! $editedclose = ")";
}
else if ($studentgrade->aimcomment) {
! $edited = "$strcommented (";
! $editedclose = ")";
}
else {
! $edited = "";
! $editedclose = "";
}
if ($hasaim)
! $table->data[] = array($picture, $student->firstname, $student->lastname, $papergrade, "$aimgrade $edited<a href=\"editgrade.php?id=$math_assignment->id&userid=$student->id\">$stredit</a>$editedclose", math_assignment_total_grade($math_assignment, $studentgrade));
else
! $table->data[] = array($picture, $student->firstname, $student->lastname, $papergrade);
$i++;
}
***************
*** 316,319 ****
--- 358,364 ----
print_single_button("view.php", $options, get_string("downloadtext"));
echo "</td><td>";
+ $options["download"] = "marksheet";
+ print_single_button("view.php", $options, get_string("marksheet","math_assignment"));
+ echo "</td><td>";
helpbutton ("downloadgrades", "$strgrades", "math_assignment");
echo "</td></tr></table>";
***************
*** 328,334 ****
if (!empty($math_assignment->aimquiz)) {
if ($grade->aimoverride) {
! echo "<p align=\"center\">";
! print_string("gradeoverridemsg", "math_assignment");
! echo "</p>";
}
echo "<p align=\"center\"><a href=\"aimpage.php?id=$cm->id\">" . get_string("viewquiz", "math_assignment") . "</a></p>";
--- 373,379 ----
if (!empty($math_assignment->aimquiz)) {
if ($grade->aimoverride) {
! echo "<p align=\"center\">";
! print_string("gradeoverridemsg", "math_assignment");
! echo "</p>";
}
echo "<p align=\"center\"><a href=\"aimpage.php?id=$cm->id\">" . get_string("viewquiz", "math_assignment") . "</a></p>";
|
|
From: <mo...@us...> - 2003-09-19 19:57:37
|
Update of /cvsroot/aimmath/AIM/doc In directory sc8-pr-cvs1:/tmp/cvs-serv5057 Modified Files: AuthoringGuide.pdf Log Message: the saga continues... more to come... Index: AuthoringGuide.pdf =================================================================== RCS file: /cvsroot/aimmath/AIM/doc/AuthoringGuide.pdf,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsPwy8i2 and /tmp/cvseDOeDX differ |
|
From: <gus...@us...> - 2003-09-19 19:57:08
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim
In directory sc8-pr-cvs1:/tmp/cvs-serv9805/WEB-INF/maple/aim
Modified Files:
Subject.mpl
Log Message:
changed the method: AuthenticateStudent so that the student is also authenticated if the password is the AdminPassword rather than the student's password. That makes it easier for external programs to log in students.
Index: Subject.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Subject.mpl,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Subject.mpl 25 Aug 2003 21:47:19 -0000 1.3
--- Subject.mpl 19 Sep 2003 13:04:47 -0000 1.4
***************
*** 372,376 ****
['Method','AuthenticateStudent'::`HTML/String`,
"Returns the empty string if there is a registered student with
! ID @id@ and password @password@. Otherwise, return an HTML page
with an error message.
",
--- 372,378 ----
['Method','AuthenticateStudent'::`HTML/String`,
"Returns the empty string if there is a registered student with
! ID @id@ and password @password@ or if there is a registered
! student with ID @id@ and the @password@ is the AdminPassword.
! Otherwise, return an HTML page
with an error message.
",
***************
*** 392,396 ****
`HTML/Subs`("idnote" = DefaultZone['IDNote'],
"emaillink" = DefaultZone['AdminEmailLink'],
! copy(`aim/Subject/AuthStud/Template/NoID`))));
elif not(register['IsMember',id]) then
--- 394,398 ----
`HTML/Subs`("idnote" = DefaultZone['IDNote'],
"emaillink" = DefaultZone['AdminEmailLink'],
! copy(`aim/Subject/AuthStud/Template/NoID`))));
elif not(register['IsMember',id]) then
***************
*** 408,411 ****
--- 410,417 ----
copy(`aim/Subject/AuthStud/Template/Register`))));
fi;
+
+ elif this['AdminPassword'] = password then
+ RETURN("");
+
elif not(register['CheckPassword',id,password]) then
RETURN(
***************
*** 413,417 ****
`HTML/Subs`("idnote" = DefaultZone['IDNote'],
"emaillink" = DefaultZone['AdminEmailLink'],
! copy(`aim/Subject/AuthStud/Template/BadPassword`))));
else
--- 419,423 ----
`HTML/Subs`("idnote" = DefaultZone['IDNote'],
"emaillink" = DefaultZone['AdminEmailLink'],
! copy(`aim/Subject/AuthStud/Template/BadPassword`))));
else
***************
*** 559,565 ****
`Util/TextFileContents`(cat(this['RootDir'],"/subjhead.html")),
op(`HTML/Hide`("Command" = "ShowQuizPage",
! "SubjectName" = this['Name'],
! "QuizName" = "",
! extra)),
this['QuizTable',accesslevel],
[["br"]],
--- 565,571 ----
`Util/TextFileContents`(cat(this['RootDir'],"/subjhead.html")),
op(`HTML/Hide`("Command" = "ShowQuizPage",
! "SubjectName" = this['Name'],
! "QuizName" = "",
! extra)),
this['QuizTable',accesslevel],
[["br"]],
***************
*** 610,616 ****
# KM
sprintf("%3a of %3a = %5.1f%%",
! totalmark,totalvalue,
! 100.*history['TotalMark']/history['TotalValue']
! )
);
# end KM
--- 616,622 ----
# KM
sprintf("%3a of %3a = %5.1f%%",
! totalmark,totalvalue,
! 100.*history['TotalMark']/history['TotalValue']
! )
);
# end KM
***************
*** 653,663 ****
`Util/TextFileContents`(cat(this['RootDir'],"/subjhead.html")),
op(`HTML/Hide`("Command" = "ShowQuizPage",
! "SubjectName" = this['Name'],
! "QuizName" = "",
# KM
! "FocusLabel" = "1",
! "OldFocusLabel" = "",
# END KM
! extra)),
this['QuizTableWithMarks',accesslevel,studentid],
[["br"]],
--- 659,669 ----
`Util/TextFileContents`(cat(this['RootDir'],"/subjhead.html")),
op(`HTML/Hide`("Command" = "ShowQuizPage",
! "SubjectName" = this['Name'],
! "QuizName" = "",
# KM
! "FocusLabel" = "1",
! "OldFocusLabel" = "",
# END KM
! extra)),
this['QuizTableWithMarks',accesslevel,studentid],
[["br"]],
***************
*** 1066,1068 ****
EndPackage():
-
--- 1072,1073 ----
|
|
From: <ma...@us...> - 2003-09-19 00:01:13
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv31247/mod/math_assignment
Added Files:
saveconfig.php
Log Message:
Changed to one aim subject per course
--- NEW FILE: saveconfig.php ---
<?PHP // $Id: saveconfig.php,v 1.1 2003/09/19 00:01:10 madalex Exp $
/* This page saves the options from config.html
We can't just use the standard action provided by moodle because of the
course specific options which relate to the aim subjects
*/
require_once("../../config.php");
require_once("lib.php");
if (! $site = get_site()) {
redirect("$CFG->wwwroot/$CFG->admin/index.php");
}
if (!isadmin()) {
error(get_string("adminonly", "math_assignment"));
}
// process variables passed
$subjects = array();
foreach ($_POST as $name => $value) {
if (preg_match("/server([0-9]*)/", $name, $matches))
$subjects[$matches[1]]->server = $value;
else if (preg_match("/name([0-9]*)/", $name, $matches))
$subjects[$matches[1]]->name = $value;
else if (preg_match("/password([0-9]*)/", $name, $matches))
$subjects[$matches[1]]->password = $value;
else
set_config($name, $value);
}
// save course specific options
/* Note that ALL courses appear on the form so we assume that $subjects is comlete. Hence we
simply truncate the table and write it out again to save testing for existence before doing an insert
or an update as required since I am lazy :-) */
if (!$db->Execute("TRUNCATE TABLE `{$CFG->prefix}math_assignment_subject`")) {
error(get_string("failed", "math_assignment"), "$CFG->wwwroot/$CFG->admin/module.php?module=math_assignment");
}
$result = true;
foreach ($subjects as $course => $subject) {
$subject->course = $course;
if (!insert_record("math_assignment_subject", $subject))
$return = false;
}
if (!$result) {
error(get_string("failed", "math_assignment"), "$CFG->wwwroot/$CFG->admin/module.php?module=math_assignment");
}
redirect("$CFG->wwwroot/$CFG->admin/modules.php", get_string("changessaved"), 1);
?>
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv30468/mod/math_assignment
Modified Files:
aimpage.php config.html index.php lib.php mod.html pdfgen.php
servers.php version.php
Removed Files:
subjects.php
Log Message:
Changed to one aim subject per course
Index: aimpage.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/aimpage.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** aimpage.php 16 Sep 2003 19:13:03 -0000 1.7
--- aimpage.php 18 Sep 2003 23:57:57 -0000 1.8
***************
*** 56,60 ****
// Process arguments
! if (!$subject = get_record("math_assignment_subject", "id", $math_assignment->aimsubject)) {
error(get_string("noaccess", "math_assignment"));
}
--- 56,60 ----
// Process arguments
! if (!$subject = get_record("math_assignment_subject", "course", $course->id)) {
error(get_string("noaccess", "math_assignment"));
}
Index: config.html
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/config.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** config.html 16 Sep 2003 14:41:38 -0000 1.2
--- config.html 18 Sep 2003 23:57:57 -0000 1.3
***************
*** 1,13 ****
<?php
$strautoregister = get_string("autoregister", "math_assignment");
$strgrademultiplier = get_string("grademultiplier", "math_assignment");
$strlatexoutput = get_string("latexoutput", "math_assignment");
- $strserverdisplay = get_string("serverdisplay", "math_assignment");
$straimdisplay = get_string("aimdisplay", "math_assignment");
?>
! <form method="post" action="module.php" name="form">
<table cellpadding="9" cellspacing="0">
<tr>
<td colspan="3" align="center">
<?php helpbutton ("config", get_string("help"), "math_assignment", true, true); ?>
--- 1,20 ----
<?php
+ $straimserverconfig = get_string("aimserverconfig", "math_assignment");
$strautoregister = get_string("autoregister", "math_assignment");
$strgrademultiplier = get_string("grademultiplier", "math_assignment");
$strlatexoutput = get_string("latexoutput", "math_assignment");
$straimdisplay = get_string("aimdisplay", "math_assignment");
+ $strcoursesettings = get_string("coursesettings", "math_assignment");
+ $straimserver = get_string("aimserver", "math_assignment");
+ $straimsubject = get_string("aimsubject", "math_assignment");
+ $straimsubjectpasswd = get_string("aimsubjectpasswd", "math_assignment");
?>
! <form method="post" action="<?php echo $CFG->wwwroot; ?>/mod/math_assignment/saveconfig.php" name="form">
<table cellpadding="9" cellspacing="0">
<tr>
+ <td colspan="3" align="center"><a href="<?php echo $CFG->wwwroot; ?>/mod/math_assignment/servers.php"><?php echo $straimserverconfig; ?></a></td>
+ </tr>
+ <tr>
<td colspan="3" align="center">
<?php helpbutton ("config", get_string("help"), "math_assignment", true, true); ?>
***************
*** 42,69 ****
</tr>
<tr valign="top">
- <td align="right"><p><b><?php echo "Teachers choose AiM subject" ?>:</b></p></td>
- <td align="left"><?php
- unset($options);
- $options[0] = "false";
- $options[1] = "true";
-
- choose_from_menu ($options, "math_assignment_teachers_choose_subject", $CFG->math_assignment_teachers_choose_subject, "", "", "");
- ?></td>
- <td align="left"><?php helpbutton ("config_choosesubject", "Teachers choose AiM subject", "math_assignment"); ?></td>
- </tr>
- <tr valign="top">
- <td align="right"><p><b><?php echo $strserverdisplay; ?>:</b></p></td>
- <td align="left"><?php
- unset($options);
- $options[0] = get_string("never", "math_assignment");
- $options[1] = get_string("ifduplicates", "math_assignment");
- $options[2] = get_string("ifmultiple", "math_assignment");
- $options[3] = get_string("always", "math_assignment");
-
- choose_from_menu ($options, "math_assignment_server_display", $CFG->math_assignment_server_display, "", "", "");
- ?></td>
- <td align="left"><?php helpbutton ("config_serverdisplay", $strserverdisplay, "math_assignment"); ?></td>
- </tr>
- <tr valign="top">
<td align="right"><p><b><?php echo $straimdisplay; ?>:</b></p></td>
<td align="left"><?php
--- 49,52 ----
***************
*** 77,85 ****
<td align="left"><?php helpbutton ("config_aimdisplay", $straimdisplay, "math_assignment"); ?></td>
</tr>
! <tr>
! <td colspan="3" align="center">
! <p><a href="<?php echo $CFG->wwwroot; ?>/mod/math_assignment/servers.php"><?php print_string("aimserverconfig", "math_assignment"); ?></a></p>
! </td>
! </tr>
<tr>
<td colspan="3" align="center">
--- 60,117 ----
<td align="left"><?php helpbutton ("config_aimdisplay", $straimdisplay, "math_assignment"); ?></td>
</tr>
! <?php
!
! // display rows for entering per course settings
! if ($courses = get_courses()) {
! ?>
! <tr>
! <th colspan="3" align="center"><?php echo $strcoursesettings; ?></th>
! </tr>
! <?php
!
! // get aim server
! unset($options);
! $servers = get_records("math_assignment_server", "", "", "name ASC");
! foreach ($servers as $server) {
! $option[$server->id] = $server->name;
! }
!
! foreach ($courses as $course) {
! if (!$subject = get_record("math_assignment_subject", "course", $course->id)) {
! $subject->name = "";
! $subject->server = 0;
! $subject->password = "";
! }
! echo "<tr>\n";
! echo "<td colspan=\"3\" align=\"center\">{$course->fullname} ({$course->shortname})</td>\n";
! echo "</tr>\n";
! echo "<tr>\n";
! echo "<td align=\"right\"><p><b>$straimserver : </b></p></td>\n";
! echo "<td align=\"left\">";
! choose_from_menu ($option, "server$course->id", $subject->server, "choose", "", 0);
! echo "</td>\n";
! echo "<td align=\"left\">";
! helpbutton ("config_aimserver", $straimserver, "math_assignment");
! echo "</td>\n";
! echo "</tr>\n";
! echo "<tr>\n";
! echo "<td align=\"right\"><p><b>$straimsubject : </b></p></td>\n";
! echo "<td align=\"left\"><input type=\"text\" name=\"name$course->id\" value=\"$subject->name\" /></td>\n";
! echo "<td align=\"left\">";
! helpbutton ("config_aimsubject", $straimsubject, "math_assignment");
! echo "</td>\n";
! echo "</tr>\n";
! echo "<tr>\n";
! echo "<td align=\"right\"><p><b>$straimsubjectpasswd : </b></p></td>\n";
! echo "<td align=\"left\"><input type=\"password\" name=\"password$course->id\" value=\"$subject->password\" /></td>\n";
! echo "<td align=\"left\">";
! helpbutton ("config_aimsubjectpasswd", $straimsubjectpasswd, "math_assignment");
! echo "</td>\n";
! echo "</tr>\n";
! }
! }
!
! ?>
!
<tr>
<td colspan="3" align="center">
***************
*** 87,90 ****
--- 119,123 ----
</td>
</tr>
+
</table>
</form>
Index: index.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/index.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** index.php 13 Sep 2003 13:01:16 -0000 1.4
--- index.php 18 Sep 2003 23:57:57 -0000 1.5
***************
*** 122,126 ****
if ($showaim && $math_assignment->aimquiz) {
// lookup subject
! if (! $subject = get_record("math_assignment_subject", "id", $math_assignment->aimsubject)) {
$subject->server = 0;
$subject->name = "Unknown";
--- 122,126 ----
if ($showaim && $math_assignment->aimquiz) {
// lookup subject
! if (! $subject = get_record("math_assignment_subject", "course", $course->id)) {
$subject->server = 0;
$subject->name = "Unknown";
Index: lib.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/lib.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** lib.php 18 Sep 2003 11:16:16 -0000 1.13
--- lib.php 18 Sep 2003 23:57:57 -0000 1.14
***************
*** 225,252 ****
}
- function math_assignment_list_all_subjects($select) {
- global $db, $CFG;
-
- $rs = $db->Execute("SELECT {$CFG->prefix}math_assignment_subject.id AS id,{$CFG->prefix}math_assignment_subject.name AS subject,{$CFG->prefix}math_assignment_server.name AS server FROM {$CFG->prefix}math_assignment_subject LEFT JOIN {$CFG->prefix}math_assignment_server ON {$CFG->prefix}math_assignment_subject.server={$CFG->prefix}math_assignment_server.id ORDER BY server,subject ASC");
- if (empty($rs))
- return ($select == 0); // empty list
- if ($CFG->math_assignment_server_display == 0) // never
- $showserver = false;
- else if ($CFG->math_assignment_server_display == 1) // duplicates
- $showserver = count_records_sql("SELECT `name` from `{$CFG->prefix}math_assignment_subject`;") - count_records_sql("SELECT DISTINCT `name` from `{$CFG->prefix}math_assignment_subject`;");
- else if ($CFG->math_assignment_server_display == 2) // multiple
- $showserver = count_records_sql("SELECT `id` from `{$CFG->prefix}math_assignment_server`;") > 1;
- else // always
- $showserver = true;
- while ($record = $rs->FetchRow()) {
- if ($record['id'] == $select)
- echo "<option selected=\"true\"";
- else
- echo "<option";
- echo " value=\"{$record['id']}\">" . htmlspecialchars("{$record['subject']}" . ($showserver ? " on {$record['server']}" : "")) . "</option>\n";
- }
- return true;
- }
-
function math_assignment_help_button($page, $name, $print=true) {
/// Function which outputs / returns the output required for a help button for this module
--- 225,228 ----
***************
*** 484,493 ****
if (empty($math_assignment->aimquiz)) { // no aim questions
- $math_assignment->aimsubject = 0;
$math_assignment->aimgrade = 0;
return true;
}
! if (!$subject = get_record("math_assignment_subject", "id", $math_assignment->aimsubject))
return false;
if (!$server = get_record("math_assignment_server", "id", $subject->server))
--- 460,468 ----
if (empty($math_assignment->aimquiz)) { // no aim questions
$math_assignment->aimgrade = 0;
return true;
}
! if (!$subject = get_record("math_assignment_subject", "course", $math_assignment->course))
return false;
if (!$server = get_record("math_assignment_server", "id", $subject->server))
***************
*** 524,528 ****
if (is_null($subject)) {
! if (!$subject = get_record("math_assignment_subject", "id", $math_assignment->aimsubject))
return false;
$server = null;
--- 499,503 ----
if (is_null($subject)) {
! if (!$subject = get_record("math_assignment_subject", "course", $math_assignment->course))
return false;
$server = null;
Index: mod.html
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/mod.html,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** mod.html 18 Sep 2003 12:48:06 -0000 1.13
--- mod.html 18 Sep 2003 23:57:57 -0000 1.14
***************
*** 26,32 ****
$form->solutionscompile = true;
}
- if (!isset($form->aimsubject)) {
- $form->aimsubject = 0;
- }
if (!isset($form->aimquiz)) {
$form->aimquiz = "";
--- 26,29 ----
***************
*** 45,54 ****
$form->name = get_string("modulename", "math_assignment");
! if (!$form->aimsubject > 0) {
! // get aimsubject from database
! if (!$form->aimsubject = get_field("math_assignment_subject", "id", "course", $form->course)) {
! $form->aimsubject = 0;
! };
! }
// Process problems and solutions
$form->problemsurl = "";
--- 42,49 ----
$form->name = get_string("modulename", "math_assignment");
! // get aimsubject from database
! if (!$aimsubject = get_field("math_assignment_subject", "name", "course", $form->course))
! $aimsubject = 0;
!
// Process problems and solutions
$form->problemsurl = "";
***************
*** 225,275 ****
<input type="text" name="papergrade" size="10" maxlength="10" value="<?php p($form->papergrade); ?>" /> <?php
// print the following clarification only if there can be an AiM component
! if (($CFG->math_assignment_teachers_choose_subject > 0) or ($form->aimsubject > 0)) {
print_string("maxgradepaperonly", "math_assignment");
- }
helpbutton("addupdate_maxgrade", $strmaxgrade, "math_assignment");
?>
</td>
</tr>
-
- <?php
- if ($CFG->math_assignment_teachers_choose_subject) {
- ?>
- <tr valign="top">
- <td align="right"><p><b><?php echo "$straimsubject"; ?>:</b></p></td>
- <td>
- <select name="aimsubject">
- <?php math_assignment_list_all_subjects($form->aimsubject); ?>
- </select>
- <?php
- helpbutton ("addupdate_serversubject", $straimsubject, "math_assignment");
- if (isadmin()) {
- if (!empty($update)) {
- $newreturn = "update=$update";
- if (!empty($return)) {
- $newreturn .= "&return=$return";
- }
- }
- else if (isset($id) && isset($section) && isset($add)) {
- $newreturn = "id=$id§ion=$section&add=$add";
- }
- else {
- $newreturn = "";
- }
- if (!empty($newreturn)) {
- $newreturn = "?return=" . htmlspecialchars(urlencode($newreturn));
- }
- echo "<a href=\"$CFG->wwwroot/mod/math_assignment/servers.php$newreturn\">" . get_string("aimserverconfig", "math_assignment") . "</a>";
- }
- ?>
</td>
</tr>
- <?php
- }
- else echo "<input type=\"hidden\" name=\"aimsubject\" value=\"$form->aimsubject\">";
- ?>
<?php
! if (($CFG->math_assignment_teachers_choose_subject > 0) or ($form->aimsubject > 0)) {
?>
<tr valign="top">
--- 220,234 ----
<input type="text" name="papergrade" size="10" maxlength="10" value="<?php p($form->papergrade); ?>" /> <?php
// print the following clarification only if there can be an AiM component
! if ($aimsubject > 0)
print_string("maxgradepaperonly", "math_assignment");
helpbutton("addupdate_maxgrade", $strmaxgrade, "math_assignment");
?>
</td>
</tr>
</td>
</tr>
<?php
! if ($aimsubject > 0) {
?>
<tr valign="top">
***************
*** 277,282 ****
<td>
<input type="text" name="aimquiz" size="40" maxlength="255" value="<?php p($form->aimquiz); ?>" /> <?php helpbutton("addupdate_quiz", $straimquiz, "math_assignment"); ?>
! <?php if ($form->aimsubject > 0) {
! echo "<a href=\"$CFG->wwwroot/mod/math_assignment/subjectpage.php?id=$form->course\" target=\"suject\">AiM administration</a>";
} ?>
</td>
--- 236,240 ----
<td>
<input type="text" name="aimquiz" size="40" maxlength="255" value="<?php p($form->aimquiz); ?>" /> <?php helpbutton("addupdate_quiz", $straimquiz, "math_assignment"); ?>
! echo "<a href=\"$CFG->wwwroot/mod/math_assignment/subjectpage.php?id=$form->course\" target=\"subject\">AiM administration</a>";
} ?>
</td>
Index: pdfgen.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/pdfgen.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** pdfgen.php 18 Sep 2003 20:15:12 -0000 1.4
--- pdfgen.php 18 Sep 2003 23:57:57 -0000 1.5
***************
*** 62,66 ****
if ($math_assignment->aimquiz) {
! if (!$subject = get_record("math_assignment_subject", "id", $math_assignment->aimsubject)) {
error(get_string("noaccess", "math_assignment"));
}
--- 62,66 ----
if ($math_assignment->aimquiz) {
! if (!$subject = get_record("math_assignment_subject", "course", $course->id)) {
error(get_string("noaccess", "math_assignment"));
}
Index: servers.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/servers.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** servers.php 9 Sep 2003 18:31:07 -0000 1.1
--- servers.php 18 Sep 2003 23:57:57 -0000 1.2
***************
*** 11,16 ****
optional_variable($student_passwd); // student AiM password
optional_variable($delete); // delete button
- optional_variable($return); // return options (passed to mod.php to go back to add / update page)
- $return = htmlspecialchars(stripslashes($return));
if (! $site = get_site()) {
--- 11,14 ----
***************
*** 32,36 ****
$server = substr($server, 0, strpos($server, "(") - 1);
if (!$server = get_record("math_assignment_server", "name", $server)) {
! error(get_string("failed","math_assignment"), "servers.php?return=$return");
}
// check that there are no assignments dependent on the server
--- 30,34 ----
$server = substr($server, 0, strpos($server, "(") - 1);
if (!$server = get_record("math_assignment_server", "name", $server)) {
! error(get_string("failed","math_assignment"), "servers.php");
}
// check that there are no assignments dependent on the server
***************
*** 39,43 ****
foreach ($subjects as $subject) {
if (record_exists("math_assignment", "subject", $subject->id)) {
! error(get_string("serverinuse","math_assignment"), "servers.php?return=$return");
}
}
--- 37,41 ----
foreach ($subjects as $subject) {
if (record_exists("math_assignment", "subject", $subject->id)) {
! error(get_string("serverinuse","math_assignment"), "servers.php");
}
}
***************
*** 45,49 ****
// does the user really want to delete?
print_header("$site->shortname: $straimserverconfig", "$site->fullname");
! notice_yesno(get_string("deletequery", "math_assignment") . "<br />$server->name ($server->address)", "deleteserver.php?id=$server->id&return=$return", "servers.php?return=$return");
print_footer();
exit;
--- 43,47 ----
// does the user really want to delete?
print_header("$site->shortname: $straimserverconfig", "$site->fullname");
! notice_yesno(get_string("deletequery", "math_assignment") . "<br />$server->name ($server->address)", "deleteserver.php?id=$server->id", "servers.php");
print_footer();
exit;
***************
*** 87,95 ****
$stradministration = get_string("administration");
$strmanagemodules = get_string("managemodules");
! $strmathassignmentsettings = get_string("mathassignmentsettings", "math_assignment");
print_header("$site->shortname: $straimserverconfig", "$site->fullname",
! "<a href=\"$CFG->wwwroot/$CFG->admin/index.php\">$stradministration</a> -> <a href=\"$CFG->wwwroot/$CFG->admin/modules.php\">$strmanagemodules</a> -> <a href=\"$CFG->wwwroot/mod/math_assignment/config.php\">$strmathassignmentsettings</a> -> $straimserverconfig");
/// Print the main part of the page
--- 85,94 ----
$stradministration = get_string("administration");
+ $strconfiguration = get_string("configuration");
$strmanagemodules = get_string("managemodules");
! $strmathassignment = get_string("modulename", "math_assignment");
print_header("$site->shortname: $straimserverconfig", "$site->fullname",
! "<a href=\"$CFG->wwwroot/$CFG->admin/index.php\">$stradministration</a> -> <a href=\"$CFG->wwwroot/$CFG->admin/configure.php\">$strconfiguration</a> -> <a href=\"$CFG->wwwroot/$CFG->admin/modules.php\">$strmanagemodules</a> -> <a href=\"$CFG->wwwroot/$CFG->admin/module.php?module=math_assignment\">$strmathassignment</a> -> $straimserverconfig");
/// Print the main part of the page
***************
*** 120,143 ****
}
- // function to load manage subjects form if a server has been selected
- function manageSubjects() {
-
- // check that the new item is not selected
- frm = document.mainform;
- server = frm.server.options[frm.server.selectedIndex].text;
- if (server != "<?php print_string("newitem", "math_assignment") ?>") {
-
- // fill in server name value and submit password form
- frm = document.subjectform;
- frm.server.value = server.slice(0, server.indexOf("(") - 1);
- frm.submit();
- }
- }
-
//end hiding --></script>
<form name="mainform" method="post" action="<?php echo $ME ?>">
<center>
- <input type="hidden" name="return" value="<?php echo "$return"; ?>" />
<?php print_heading_with_help($straimserverconfig, "server", "math_assignment"); ?>
--- 119,126 ----
***************
*** 191,201 ****
</form>
</td>
- <td align="left">
- <form name="subjectform" method="post" action="subjects.php">
- <input type="hidden" name="server" value="0" />
- <input type="hidden" name="return" value="<?php echo "$return"; ?>" />
- <input type="button" name="subjects" value="<?php print_string("managesubjects","math_assignment"); ?>" onClick="manageSubjects();" />
- </form>
- </td>
</tr>
</table>
--- 174,177 ----
***************
*** 204,213 ****
</table>
-
- <?php
- if (!empty($return)) {
- echo "<p><a href=\"$CFG->wwwroot/course/mod.php?$return\">" . get_string("continue") . "</a></p>";
- }
- ?>
</center>
--- 180,183 ----
Index: version.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/version.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** version.php 18 Sep 2003 11:16:16 -0000 1.3
--- version.php 18 Sep 2003 23:57:57 -0000 1.4
***************
*** 6,10 ****
/////////////////////////////////////////////////////////////////////////////////
! $module->version = 2003091812; // The (date) version of this module
$module->cron = 0; // How often should cron check this module (seconds)?
--- 6,10 ----
/////////////////////////////////////////////////////////////////////////////////
! $module->version = 2003091900; // The (date) version of this module
$module->cron = 0; // How often should cron check this module (seconds)?
--- subjects.php DELETED ---
|
|
From: <ma...@us...> - 2003-09-18 23:58:01
|
Update of /cvsroot/aimmath/moodle/lang/en In directory sc8-pr-cvs1:/tmp/cvs-serv30468/lang/en Modified Files: math_assignment.php Log Message: Changed to one aim subject per course Index: math_assignment.php =================================================================== RCS file: /cvsroot/aimmath/moodle/lang/en/math_assignment.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** math_assignment.php 18 Sep 2003 11:16:15 -0000 1.8 --- math_assignment.php 18 Sep 2003 23:57:57 -0000 1.9 *************** *** 16,31 **** $string['aimserverconfig'] = "AiM Server Configuration"; $string['aimserverplural'] = "AiM Servers"; - $string['aimserversubjects'] = "AiM Server Subjects"; $string['aimsubject'] = "AiM Subject"; ! $string['always'] = "Always"; $string['analyseresults'] = "Analyse AiM Results"; $string['attemptquiz'] = "Attempt AiM Quiz"; $string['autoregister'] = "Auto-register Students with AiM"; $string['browsesource'] = "Browse AiM Source"; - $string['choosesubject'] = "Teachers choose AiM subject"; - $string['compiletex'] = "Files with a .tex or .latex extension will be compiled automatically. See help for details."; $string['computer'] = "Computer"; $string['comment'] = "Comment"; $string['commented'] = "Commented"; $string['deletequery'] = "Are you sure you want to delete this server?"; $string['edited'] = "Edited"; --- 16,29 ---- $string['aimserverconfig'] = "AiM Server Configuration"; $string['aimserverplural'] = "AiM Servers"; $string['aimsubject'] = "AiM Subject"; ! $string['aimsubjectpasswd'] = "AiM Subject Password"; $string['analyseresults'] = "Analyse AiM Results"; $string['attemptquiz'] = "Attempt AiM Quiz"; $string['autoregister'] = "Auto-register Students with AiM"; $string['browsesource'] = "Browse AiM Source"; $string['computer'] = "Computer"; $string['comment'] = "Comment"; $string['commented'] = "Commented"; + $string['coursesettings'] = "Course Settings"; $string['deletequery'] = "Are you sure you want to delete this server?"; $string['edited'] = "Edited"; *************** *** 41,50 **** $string['guestsno'] = "Sorry, guests can not view or attempt assignments"; $string['html'] = "HTML"; - $string['ifduplicates'] = "When Duplicate Subjects Exist"; - $string['ifmultiple'] = "When Multiple Servers Exist"; $string['invalid'] = "Error : Invalid entry"; $string['invalidgrademultiplier'] = "Grade multiplier must be a number between 0.1 and 10000 inclusive."; $string['latexoutput'] = "Default LaTeX Output Method"; - $string['loading'] = "Starting Download..."; $string['oldgrade'] = "Current Grade"; $string['or'] = "OR"; --- 39,45 ---- *************** *** 52,62 **** $string['outputprobs'] = "Mathematics not displaying correctly? The page is currently being produced using"; $string['paper'] = "Paper"; - $string['passwd'] = "Password"; - $string['pdferror'] = "There has been a problem while trying to create the pdf file."; - $string['pdfok'] = "The pdf file has been successfully opened in another browser window."; $string['problems'] = "Problem sheet"; $string['mathml'] = "XML with MathML"; - $string['managesubjects'] = "Manage Subjects"; - $string['mathassignmentsettings'] = "Math Assignment Configuration"; $string['maxgrade'] = "Maximum Grade"; $string['maxgradepaperonly'] = "(paper-based hand-marked questions only)"; --- 47,52 ---- *************** *** 64,68 **** $string['newgrade'] = "Override Grade"; $string['newitem'] = "New..."; - $string['never'] = "Never"; $string['noaccess'] = "Error : The administrator has not granted access to this subject on this server"; $string['nobody'] = "Nobody"; --- 54,57 ---- *************** *** 76,88 **** $string['reset'] = "Reset"; $string['reviewresults'] = "Review Results"; ! $string['serverdisplay'] = "Server Display"; ! $string['serverinuse'] = "Error : Can not delete server as one or more Assignments depend on it."; $string['solutions'] = "Solution sheet"; $string['student_password'] = "Student AiM Password"; $string['studentnotattempted'] = "The student has not attempted this assignment."; - $string['subject'] = "Subject"; - $string['subjectinuse'] = "Error : Can not delete subject as one or more Assignments depend on it."; - $string['subjectplural'] = "Subjects"; - $string['subjectson'] = "Subjects on "; $string['timedue'] = "Due Date and Time"; $string['tryquiz'] = "Try AiM Assignment"; --- 65,72 ---- $string['reset'] = "Reset"; $string['reviewresults'] = "Review Results"; ! $string['serverinuse'] = "Error : Can not delete server as one or more assignments depend on it."; $string['solutions'] = "Solution sheet"; $string['student_password'] = "Student AiM Password"; $string['studentnotattempted'] = "The student has not attempted this assignment."; $string['timedue'] = "Due Date and Time"; $string['tryquiz'] = "Try AiM Assignment"; |
|
From: <ma...@us...> - 2003-09-18 23:58:01
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment/db
In directory sc8-pr-cvs1:/tmp/cvs-serv30468/mod/math_assignment/db
Modified Files:
mysql.php mysql.sql
Log Message:
Changed to one aim subject per course
Index: mysql.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/db/mysql.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** mysql.php 18 Sep 2003 11:26:24 -0000 1.5
--- mysql.php 18 Sep 2003 23:57:57 -0000 1.6
***************
*** 20,23 ****
--- 20,35 ----
$return = false;
}
+ if ($oldversion < 2003091821) {
+ if (!execute_sql("ALTER TABLE `{$CFG->prefix}math_assignment` DROP `aimsubject`"))
+ $return = false;
+ if (!execute_sql("ALTER TABLE `{$CFG->prefix}math_assignment_subject` DROP PRIMARY KEY, DROP `id`"))
+ $return = false;
+ execute_sql("ALTER TABLE `{$CFG->prefix}math_assignment_subject` ADD `course` INT(10) UNSIGNED NOT NULL default '0' FIRST");
+ execute_sql("ALTER TABLE `{$CFG->prefix}math_assignment_subject` CHANGE `course` `course` INT(10) UNSIGNED NOT NULL default '0' FIRST");
+ if (!execute_sql("ALTER TABLE `{$CFG->prefix}math_assignment_subject` ADD PRIMARY KEY (`course`)"))
+ $return = false;
+ execute_sql("ALTER TABLE `{$CFG->prefix}math_assignment_subject` COMMENT='AiM subject used by each course'");
+ execute_sql("DELETE FROM `{$CFG->prefix}config` WHERE `name`='math_assignment_teachers_choose_subject' or `name`='math_assignment_server_display'");
+ }
return $return;
}
Index: mysql.sql
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/db/mysql.sql,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** mysql.sql 18 Sep 2003 11:26:24 -0000 1.4
--- mysql.sql 18 Sep 2003 23:57:57 -0000 1.5
***************
*** 13,17 ****
`solutions` varchar(255) NOT NULL default '',
`solutionsisurl` tinyint(1) NOT NULL default '1',
- `aimsubject` int(10) NOT NULL default '0',
`aimquiz` varchar(255) NOT NULL default '',
`papergrade` int(10) unsigned NOT NULL default '0',
--- 13,16 ----
***************
*** 23,33 ****
CREATE TABLE `prefix_math_assignment_subject` (
! `id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
`server` int(10) unsigned NOT NULL default '0',
`password` varchar(255) NOT NULL default '',
! PRIMARY KEY (`id`),
UNIQUE `UNIQUE` (`name`, `server`)
! ) TYPE=MyISAM COMMENT='AiM subjects used by math assignments';
CREATE TABLE `prefix_math_assignment_server` (
--- 22,32 ----
CREATE TABLE `prefix_math_assignment_subject` (
! `course` int(10) unsigned NOT NULL default '0',
`name` varchar(255) NOT NULL default '',
`server` int(10) unsigned NOT NULL default '0',
`password` varchar(255) NOT NULL default '',
! PRIMARY KEY (`course`),
UNIQUE `UNIQUE` (`name`, `server`)
! ) TYPE=MyISAM COMMENT='AiM subject used by each course';
CREATE TABLE `prefix_math_assignment_server` (
***************
*** 56,60 ****
INSERT `prefix_config` SET `name`="math_assignment_grade_multiplier",`value`="1";
INSERT `prefix_config` SET `name`="math_assignment_default_latex_output",`value`="0";
- INSERT `prefix_config` SET `name`="math_assignment_server_display", `value`="2";
INSERT `prefix_config` SET `name`="math_assignment_aim_display", `value`="1";
- INSERT `prefix_config` SET `name`="math_assignment_teachers_choose_subject", `value`="1";
--- 55,57 ----
|
|
From: <ma...@us...> - 2003-09-18 20:15:45
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv17749/mod/math_assignment
Modified Files:
pdfgen.php
Log Message:
Changed pdfgen.php to output pdf directly again. This time I think it should work, even with IE.
Index: pdfgen.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/pdfgen.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** pdfgen.php 17 Sep 2003 17:13:09 -0000 1.3
--- pdfgen.php 18 Sep 2003 20:15:12 -0000 1.4
***************
*** 178,186 ****
// output of pdf
! /*
if ($file = fopen("temp.pdf", "rb")) { // the 'b' is for compatibility with Windoze
// tell the browser that it is pdf
header("Content-type: application/pdf");
fpassthru($file); // chuck all the data direct to the browser and close the handle
--- 178,190 ----
// output of pdf
!
if ($file = fopen("temp.pdf", "rb")) { // the 'b' is for compatibility with Windoze
// tell the browser that it is pdf
header("Content-type: application/pdf");
+ if ($solutions)
+ header("Content-disposition: inline; filename=solutions.pdf");
+ else
+ header("Content-disposition: inline; filename=problems.pdf");
fpassthru($file); // chuck all the data direct to the browser and close the handle
***************
*** 189,195 ****
error("It didn't work!"); // error message
}
- */
-
- redirect("temp.pdf");
?>
--- 193,196 ----
|
|
From: <gus...@us...> - 2003-09-18 17:30:19
|
Update of /cvsroot/aimmath/moodle/lang/en/help/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv14175/lang/en/help/math_assignment
Modified Files:
addupdate.html addupdate_name.html addupdate_quiz.html
mods.html
Added Files:
addupdate_maxgrade.html addupdate_problems.html
addupdate_solutions.html addupdate_timedue.html
Log Message:
updated help pages for mod.html
--- NEW FILE: addupdate_maxgrade.html ---
<P ALIGN=CENTER><B><?php echo get_string("maxgrade","math_assignment") ?></B></P>
<p>This is the highest possible mark on the hand-marked part of the assignment. If your assignment has no <?php echo get_string("aimquiz","math_assignment") ?> then this is the maximum total mark for the assignment. This maximum mark
will be used as a check when the grades are entered by the marker. The student will see his grades as something like 7/10 if 10 is the maximum grade.
<P><B>Links:</B></P>
<UL>
<LI>Parent : <A href="help.php?module=math_assignment&file=addupdate.html">Add or Update <?php echo get_string("modulename","math_assignment") ?></A>
<LI>Previous Field : <A href="help.php?module=math_assignment&file=addupdate_solutions.html"><?php echo get_string("solutions","math_assignment") ?></A>
<LI>Next Field : <A href="help.php?module=math_assignment&file=addupdate_quiz.html"><?php echo get_string("aimquiz","math_assignment") ?></A>
</UL>
--- NEW FILE: addupdate_problems.html ---
<P ALIGN=CENTER><B><?php echo get_string("problems","math_assignment") ?></B></P>
<p>Here you tell Moodle where it can find the <?php echo get_string("problems","math_assignment") ?>. There are three alternative ways of specifying the <?php echo get_string("problems","math_assignment") ?>:
<ul>
<li><b><?php echo get_string("useuploaded","math_assignment") ?>:</b> If you have already uploaded the <?php echo get_string("problems","math_assignment") ?> to Moodle using Moodle's File manager then you can select it from the drop-down list.</li>
<li><b><?php echo get_string("uploadnew","math_assignment") ?>:</b> If you have the <?php echo get_string("problems","math_assignment") ?> in some of the folders on your computer or on the network then you can upload it to Moodle from here. Simply click the "Browse" button, navigate through the filesystem and select the correct file.</li>
<li><b><?php echo get_string("externalurl","math_assignment") ?>:</b> If your <?php echo get_string("problems","math_assignment") ?> is already available on the web then you don't have to upload it to Moodle. You can simply link to it by pasting the full URL (including the http://) into this field.</li>
</ul>
If your <?php echo get_string("modulename","math_assignment") ?> does not contain a <?php echo get_string("aimquiz","math_assignment") ?> then you can post your <?php echo get_string("problems","math_assignment") ?> in any electronic format. However the pdf format is the recommended format because most computers will be able to display this. Postscript is possible but not as convenient for students who may want to look at the <?php echo get_string("problems","math_assignment") ?> at home because the postscript files are longer and not every computer has a postscript viewer.
<p>
If your <?php echo get_string("modulename","math_assignment") ?> does contain a <?php echo get_string("aimquiz","math_assignment") ?> then you should provide the <?php echo get_string("problems","math_assignment") ?> in tex format. This enables the system to include those questions that are generated by AiM in the problem sheet before automatically creating a pdf file from the tex source.
<P><B>Links:</B></P>
<UL>
<LI>Parent : <A href="help.php?module=math_assignment&file=addupdate.html">Add or Update <?php echo get_string("modulename","math_assignment") ?></A>
<LI>Previous Field : <A href="help.php?module=math_assignment&file=addupdate_timedue.html"><?php echo get_string("name","math_assignment") ?></A>
<LI>Next Field : <A href="help.php?module=math_assignment&file=addupdate_solutions.html"><?php echo get_string("solutions","math_assignment") ?></A>
</UL>
--- NEW FILE: addupdate_solutions.html ---
<P ALIGN=CENTER><B><?php echo get_string("solutions","math_assignment") ?></B></P>
<p>Here you tell Moodle where it can find the <?php echo get_string("solutions","math_assignment") ?>. There are three alternative ways of specifying the <?php echo get_string("solutions","math_assignment") ?>:
<ul>
<li><b><?php echo get_string("useuploaded","math_assignment") ?>:</b> If you have already uploaded the <?php echo get_string("solutions","math_assignment") ?> to Moodle using Moodle's File manager then you can select it from the drop-down list.</li>
<li><b><?php echo get_string("uploadnew","math_assignment") ?>:</b> If you have the <?php echo get_string("solutions","math_assignment") ?> in some of the folders on your computer or on the network then you can upload it to Moodle from here. Simply click the "Browse" button, navigate through the filesystem and select the correct file.</li>
<li><b><?php echo get_string("externalurl","math_assignment") ?>:</b> If your <?php echo get_string("solutions","math_assignment") ?> is already available on the web then you don't have to upload it to Moodle. You can simply link to it by pasting the full URL (including the http://) into this field.</li>
</ul>
The <?php echo get_string("solutions","math_assignment") ?> will only be visible to the students after the due date.
<p>
If your <?php echo get_string("modulename","math_assignment") ?> does not contain a <?php echo get_string("aimquiz","math_assignment") ?> then you can post your <?php echo get_string("solutions","math_assignment") ?> in any electronic format. However the pdf format is the recommended format because most computers will be able to display this. Postscript is possible but not as convenient for students who may want to look at the <?php echo get_string("solutions","math_assignment") ?> at home because the postscript files are longer and not every computer has a postscript viewer.
<p>
If your <?php echo get_string("modulename","math_assignment") ?> does contain a <?php echo get_string("aimquiz","math_assignment") ?> then you should provide the <?php echo get_string("solutions","math_assignment") ?> in tex format. This enables the system to include those questions that are generated by AiM in the <?php echo get_string("solutions","math_assignment") ?> before automatically creating a pdf file from the tex source.
<P><B>Links:</B></P>
<UL>
<LI>Parent : <A href="help.php?module=math_assignment&file=addupdate.html">Add or Update <?php echo get_string("modulename","math_assignment") ?></A>
<LI>Previous Field : <A href="help.php?module=math_assignment&file=addupdate_problems.html"><?php echo get_string("problems","math_assignment") ?></A>
<LI>Next Field : <A href="help.php?module=math_assignment&file=addupdate_maxgrade.html"><?php echo get_string("maxgrade","math_assignment") ?></A>
</UL>
--- NEW FILE: addupdate_timedue.html ---
<P ALIGN=CENTER><B><?php echo get_string("timedue","math_assignment") ?></B></P>
<p>Here you set the date and the time when your students have to hand in the <?php echo get_string("modulename","math_assignment") ?>. You could for example set this to the start time of the lecture during which you collect the student's work. After this time the system will allow the students to view the <?php echo get_string("solutions","math_assignment") ?>. If the <?php echo get_string("modulename","math_assignment") ?> contains a <?php echo get_string("aimquiz","math_assignment") ?> then this will automatically be set up to close at the same time. The <?php echo get_string("timedue","math_assignment") ?> will be shown to the student when he views the <?php echo get_string("modulename","math_assignment") ?>.
<P><B>Links:</B></P>
<UL>
<LI>Parent : <A href="help.php?module=math_assignment&file=addupdate.html">Add or Update <?php echo get_string("modulename","math_assignment") ?></A>
<LI>Previous Field : <A href="help.php?module=math_assignment&file=addupdate_name.html"><?php echo get_string("name","math_assignment") ?></A>
<LI>Next Field : <A href="help.php?module=math_assignment&file=addupdate_problems.html"><?php echo get_string("problems","math_assignment") ?></A>
</UL>
Index: addupdate.html
===================================================================
RCS file: /cvsroot/aimmath/moodle/lang/en/help/math_assignment/addupdate.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** addupdate.html 9 Sep 2003 18:31:07 -0000 1.1
--- addupdate.html 18 Sep 2003 17:30:09 -0000 1.2
***************
*** 1,23 ****
! <P ALIGN=CENTER><B>Add or Update Quiz</B></P>
!
! <P>This page allows you to add an existing AiM quiz to moodle. All fields are required.</P>
!
! <P>The name is used within moodle only. It need not be the same as the name of the quiz in AiM.</P>
!
! <P>Select the AiM subject hosted on the AiM server to which the quiz belongs from the list supplied. The subjects listed are those which the administrator has allowed access to on the servers the administrator has entered. The list shows the subjects grouped by which server they are on. See the help page for this field for more details. Contact the administrator if you are unsure about the option you should select.</P>
!
! <P>The "Quiz" field must be filled with the name by which AiM refers to the quiz.</P>
!
! <P>Click on the "Save Changes" button to add the quiz.</P>
! <P>Admininstration access to the subject is provided automatically to teachers. This allows the results to be viewed and analysed without the need to login to AiM after having already logged on moodle.</P>
! <P>Students in the course to which the quiz has been added are automatically given access to the subject. If necessary they are registered automatically unless this has been disabled by the administrator.</P>
<P><B>Fields:</B></P>
<UL>
! <LI><A href="help.php?module=math_assignment&file=addupdate_name.html">Name</A>
! <LI><A href="help.php?module=math_assignment&file=addupdate_serversubject.html">Subject / AiM Server</A>
! <LI><A href="help.php?module=math_assignment&file=addupdate_quiz.html">Quiz</A>
</UL>
--- 1,16 ----
! <P ALIGN=CENTER><B>Add or Update <?php echo get_string("modulename","math_assignment") ?></B></P>
! <P>This page allows you to add or update an <?php echo get_string("modulename","math_assignment") ?></P>
! <P>After filling in the fields click on the "Save Changes" button to add or update the <?php echo get_string("modulename","math_assignment") ?>.</P>
<P><B>Fields:</B></P>
<UL>
! <LI><A href="help.php?module=math_assignment&file=addupdate_name.html"><?php echo get_string("name","math_assignment") ?></A>
! <LI><A href="help.php?module=math_assignment&file=addupdate_timedue.html"><?php echo get_string("timedue","math_assignment") ?></A>
! <LI><A href="help.php?module=math_assignment&file=addupdate_problems.html"><?php echo get_string("problems","math_assignment") ?></A>
! <LI><A href="help.php?module=math_assignment&file=addupdate_solutions.html"><?php echo get_string("solutions","math_assignment") ?></A>
! <LI><A href="help.php?module=math_assignment&file=addupdate_maxgrade.html"><?php echo get_string("maxgrade","math_assignment") ?></A>
! <LI><A href="help.php?module=math_assignment&file=addupdate_quiz.html"><?php echo get_string("aimquiz","math_assignment") ?></A>
</UL>
Index: addupdate_name.html
===================================================================
RCS file: /cvsroot/aimmath/moodle/lang/en/help/math_assignment/addupdate_name.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** addupdate_name.html 9 Sep 2003 18:31:07 -0000 1.1
--- addupdate_name.html 18 Sep 2003 17:30:09 -0000 1.2
***************
*** 1,10 ****
<P ALIGN=CENTER><B>Name Field</B></P>
! <P>This field contains the name for the quiz. It is for display within moodle only.</P>
<P><B>Links:</B></P>
<UL>
! <LI>Parent : <A href="help.php?module=math_assignment&file=addupdate.html">Add or Update Quiz</A>
! <LI>Next Field : <A href="help.php?module=math_assignment&file=addupdate_serversubject.html">Subject / AiM Server</A>
! <LI><A href="help.php?module=moodle&file=index.html">Help Index</A>
</UL>
--- 1,9 ----
<P ALIGN=CENTER><B>Name Field</B></P>
! <p>This field contains the name for the <?php echo get_string("modulename","math_assignment") ?>. This will be used as the link text for the <?php echo get_string("modulename","math_assignment") ?> on the course home page.</P>
<P><B>Links:</B></P>
<UL>
! <LI>Parent : <A href="help.php?module=math_assignment&file=addupdate.html">Add or Update <?php echo get_string("modulename","math_assignment") ?></A>
! <LI>Next Field : <A href="help.php?module=math_assignment&file=addupdate_timedue.html"><?php echo get_string("timedue","math_assignment") ?></A>
</UL>
Index: addupdate_quiz.html
===================================================================
RCS file: /cvsroot/aimmath/moodle/lang/en/help/math_assignment/addupdate_quiz.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** addupdate_quiz.html 9 Sep 2003 18:31:07 -0000 1.1
--- addupdate_quiz.html 18 Sep 2003 17:30:09 -0000 1.2
***************
*** 1,10 ****
<P ALIGN=CENTER><B>Quiz Field</B></P>
! <P>This field contains the name by which AiM refers to the quiz.</P>
<P><B>Links:</B></P>
<UL>
! <LI>Parent : <A href="help.php?module=math_assignment&file=addupdate.html">Add or Update Quiz</A>
! <LI>Previous Field : <A href="help.php?module=math_assignment&file=addupdate_serversubject.html">Subject / AiM Server</A>
<LI><A href="help.php?module=moodle&file=index.html">Help Index</A>
</UL>
--- 1,13 ----
<P ALIGN=CENTER><B>Quiz Field</B></P>
! <P>This field only shows if an AiM subject has been created for you on an AiM server. If you enter the name of a quiz that has been set up on AiM then this quiz will become an integral part of the <?php echo get_string("modulename","math_assignment") ?>.
! </P>
! <p>If you click on the AiM administration link the AiM subject administration page will open in a separate window. This may be useful for looking up the names of the quizzes that have been set up or for example.
! </p>
<P><B>Links:</B></P>
<UL>
! <LI>Parent : <A href="help.php?module=math_assignment&file=addupdate.html">Add or Update <?php echo get_string("modulename","math_assignment") ?></A>
! <LI>Previous Field : <A href="help.php?module=math_assignment&file=addupdate_maxgrade.html"><?php echo get_string("maxgrade","math_assignment") ?></A>
<LI><A href="help.php?module=moodle&file=index.html">Help Index</A>
</UL>
Index: mods.html
===================================================================
RCS file: /cvsroot/aimmath/moodle/lang/en/help/math_assignment/mods.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** mods.html 9 Sep 2003 18:31:07 -0000 1.1
--- mods.html 18 Sep 2003 17:30:09 -0000 1.2
***************
*** 1,4 ****
! <p><img valign="absmiddle" src="<?php echo "$CFG->wwwroot"; ?>/mod/math_assignment/icon.gif"> <b>Math Assignments</b></p>
<ul>
! <p>This module allows you to create an mathematics assignment with randomly generated problem sheets and questions marked by hand and by computer using the AiM system. The student can access the AiM questions from the moodle window and the grades output by AiM are recorded automatically.</p>
</ul>
--- 1,4 ----
! <p><img valign="absmiddle" src="<?php echo "$CFG->wwwroot"; ?>/mod/math_assignment/icon.gif"> <b><?php echo get_string("modulename","math_assignment") ?></b></p>
<ul>
! <p>This module allows you to create <?php echo get_string("modulenameplural","math_assignment") ?> with randomly generated problem sheets and questions marked by hand and by computer using the AiM system. </p>
</ul>
|
|
From: <gus...@us...> - 2003-09-18 12:48:09
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv13219/mod/math_assignment
Modified Files:
mod.html
Log Message:
bug fix (inserted hidden input field for aimsubject) and tex explanation removed
Index: mod.html
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/mod.html,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** mod.html 18 Sep 2003 11:16:16 -0000 1.12
--- mod.html 18 Sep 2003 12:48:06 -0000 1.13
***************
*** 171,177 ****
</td>
</tr>
- <tr>
- <td colspan="2"><?php echo "$strcompiletex"; ?></td>
- </tr>
</table>
</td>
--- 171,174 ----
***************
*** 219,225 ****
</td>
</tr>
- <tr>
- <td colspan="2"><?php echo "$strcompiletex"; ?></td>
- </tr>
</table>
</td>
--- 216,219 ----
***************
*** 273,276 ****
--- 267,271 ----
<?php
}
+ else echo "<input type=\"hidden\" name=\"aimsubject\" value=\"$form->aimsubject\">";
?>
|
|
From: <ma...@us...> - 2003-09-18 11:30:13
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv29537/mod/math_assignment
Modified Files:
view.php
Log Message:
Fixed a bug in view.php so that your modification now works (it was never displaying aim marks even when it should have been).
Index: view.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/view.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** view.php 17 Sep 2003 10:20:59 -0000 1.5
--- view.php 18 Sep 2003 11:30:04 -0000 1.6
***************
*** 45,49 ****
add_to_log($course->id, "math_assignment", "view", "view.php?id=$cm->id", "$math_assignment->id");
! $hasaim = (!$math_assignment_aimquiz == "");
$strfirstname = get_string("firstname");
--- 45,49 ----
add_to_log($course->id, "math_assignment", "view", "view.php?id=$cm->id", "$math_assignment->id");
! $hasaim = (!$math_assignment->aimquiz == "");
$strfirstname = get_string("firstname");
|
|
From: <ma...@us...> - 2003-09-18 11:26:27
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment/db
In directory sc8-pr-cvs1:/tmp/cvs-serv28957/mod/math_assignment/db
Modified Files:
mysql.php mysql.sql
Log Message:
Default value now set for math_assignment_teachers_choose_subject config option.
Index: mysql.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/db/mysql.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** mysql.php 18 Sep 2003 11:16:15 -0000 1.4
--- mysql.php 18 Sep 2003 11:26:24 -0000 1.5
***************
*** 16,19 ****
--- 16,20 ----
}
if ($oldversion < 2003091812) {
+ set_config("math_assignment_teachers_choose_subject", "1");
if (!execute_sql("ALTER TABLE `{$CFG->prefix}math_assignment` CHANGE `problemscompile` `problemsisurl` TINYINT(1) NOT NULL default '1' AFTER `problems`, CHANGE `solutionscompile` `solutionsisurl` TINYINT(1) NOT NULL default '1' AFTER `solutions`"))
$return = false;
Index: mysql.sql
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/db/mysql.sql,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** mysql.sql 18 Sep 2003 11:16:16 -0000 1.3
--- mysql.sql 18 Sep 2003 11:26:24 -0000 1.4
***************
*** 58,59 ****
--- 58,60 ----
INSERT `prefix_config` SET `name`="math_assignment_server_display", `value`="2";
INSERT `prefix_config` SET `name`="math_assignment_aim_display", `value`="1";
+ INSERT `prefix_config` SET `name`="math_assignment_teachers_choose_subject", `value`="1";
|
|
From: <ma...@us...> - 2003-09-18 11:16:33
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv27017/mod/math_assignment
Modified Files:
lib.php mod.html version.php
Log Message:
Improved handling of URLs for problem and solution sheets fixing bugs and removing $math_assignment->problemscompile etc.
Index: lib.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/lib.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** lib.php 16 Sep 2003 15:43:03 -0000 1.12
--- lib.php 18 Sep 2003 11:16:16 -0000 1.13
***************
*** 15,48 ****
// problems
if ($math_assignment->problems === "") {
! if ($math_assignment->problemsurl)
$math_assignment->problems = $math_assignment->problemsurl;
else if (!empty($_FILES['problemsfile']))
$math_assignment->problems = math_assignment_save_upload($math_assignment->course, $_FILES['problemsfile']);
}
$math_assignment->problems = trim($math_assignment->problems);
- if (isset($math_assignment->problemscompile)) {
- $math_assignment->problemscompile = ($math_assignment->problemscompile != "");
- if (!math_assignment_is_tex_file($math_assignment->problems))
- $math_assignment->problemscompile = false;
- }
- else
- $math_assignment->problemscompile = false;
// solutions
if ($math_assignment->solutions === "") {
! if ($math_assignment->solutionsurl)
$math_assignment->solutions = $math_assignment->solutionsurl;
else if (!empty($_FILES['solutionsfile']))
$math_assignment->solutions = math_assignment_save_upload($math_assignment->course, $_FILES['solutionsfile']);
}
$math_assignment->solutions = trim($math_assignment->solutions);
- if (isset($math_assignment->solutionscompile)) {
- $math_assignment->solutionscompile = ($math_assignment->solutionscompile != "");
- if (!math_assignment_is_tex_file($math_assignment->solutions))
- $math_assignment->solutionscompile = false;
- }
- else
- $math_assignment->solutionscompile = false;
$math_assignment->timemodified = time();
--- 15,40 ----
// problems
+ $math_assignment->problemsisurl = 0;
if ($math_assignment->problems === "") {
! if ($math_assignment->problemsurl) {
$math_assignment->problems = $math_assignment->problemsurl;
+ $math_assignment->problemsisurl = 1;
+ }
else if (!empty($_FILES['problemsfile']))
$math_assignment->problems = math_assignment_save_upload($math_assignment->course, $_FILES['problemsfile']);
}
$math_assignment->problems = trim($math_assignment->problems);
// solutions
+ $math_assignment->solutionsisurl = 0;
if ($math_assignment->solutions === "") {
! if ($math_assignment->solutionsurl) {
$math_assignment->solutions = $math_assignment->solutionsurl;
+ $math_assignment->solutionsisurl = 1;
+ }
else if (!empty($_FILES['solutionsfile']))
$math_assignment->solutions = math_assignment_save_upload($math_assignment->course, $_FILES['solutionsfile']);
}
$math_assignment->solutions = trim($math_assignment->solutions);
$math_assignment->timemodified = time();
***************
*** 62,95 ****
// problems
if ($math_assignment->problems === "") {
! if ($math_assignment->problemsurl)
$math_assignment->problems = $math_assignment->problemsurl;
else if (!empty($_FILES['problemsfile']))
$math_assignment->problems = math_assignment_save_upload($math_assignment->course, $_FILES['problemsfile']);
}
$math_assignment->problems = trim($math_assignment->problems);
- if (isset($math_assignment->problemscompile)) {
- $math_assignment->problemscompile = ($math_assignment->problemscompile != "");
- if (!math_assignment_is_tex_file($math_assignment->problems))
- $math_assignment->problemscompile = false;
- }
- else
- $math_assignment->problemscompile = false;
// solutions
if ($math_assignment->solutions === "") {
! if ($math_assignment->solutionsurl)
$math_assignment->solutions = $math_assignment->solutionsurl;
else if (!empty($_FILES['solutionsfile']))
$math_assignment->solutions = math_assignment_save_upload($math_assignment->course, $_FILES['solutionsfile']);
}
$math_assignment->solutions = trim($math_assignment->solutions);
- if (isset($math_assignment->solutionscompile)) {
- $math_assignment->solutionscompile = ($math_assignment->solutionscompile != "");
- if (!math_assignment_is_tex_file($math_assignment->solutions))
- $math_assignment->solutionscompile = false;
- }
- else
- $math_assignment->solutionscompile = false;
$math_assignment->timemodified = time();
--- 54,79 ----
// problems
+ $math_assignment->problemsisurl = 0;
if ($math_assignment->problems === "") {
! if ($math_assignment->problemsurl) {
$math_assignment->problems = $math_assignment->problemsurl;
+ $math_assignment->problemsisurl = 1;
+ }
else if (!empty($_FILES['problemsfile']))
$math_assignment->problems = math_assignment_save_upload($math_assignment->course, $_FILES['problemsfile']);
}
$math_assignment->problems = trim($math_assignment->problems);
// solutions
+ $math_assignment->solutionsisurl = 0;
if ($math_assignment->solutions === "") {
! if ($math_assignment->solutionsurl) {
$math_assignment->solutions = $math_assignment->solutionsurl;
+ $math_assignment->solutionsisurl = 1;
+ }
else if (!empty($_FILES['solutionsfile']))
$math_assignment->solutions = math_assignment_save_upload($math_assignment->course, $_FILES['solutionsfile']);
}
$math_assignment->solutions = trim($math_assignment->solutions);
$math_assignment->timemodified = time();
***************
*** 282,318 ****
global $CFG;
! if($math_assignment->problemscompile) {
! if ($math_assignment->problems || $math_assignment->aimquiz)
$proburl = "pdfgen.php?id=$math_assignment->id&type=problems";
else
! $proburl = "";
! }
! else {
! if ($math_assignment->problems) {
! if ($CFG->slasharguments)
! $proburl = "$CFG->wwwroot/file.php/$math_assignment->course/$math_assignment->problems";
! else
! $proburl = "$CFG->wwwroot/file.php?file=/$math_assignment->course/$math_assignment->problems";
! }
! else
! $proburl = "";
}
! if($math_assignment->solutionscompile) {
! if ($math_assignment->solutions || $math_assignment->aimquiz)
$solurl = "pdfgen.php?id=$math_assignment->id&type=solutions";
else
! $solurl = "";
! }
! else {
! if ($math_assignment->solutions) {
! if ($CFG->slasharguments)
! $solurl = "$CFG->wwwroot/file.php/$math_assignment->course/$math_assignment->solutions";
! else
! $solurl = "$CFG->wwwroot/file.php?file=/$math_assignment->course/$math_assignment->solutions";
! }
! else
! $solurl = "";
}
}
--- 266,298 ----
global $CFG;
! if($math_assignment->problems) {
! if (math_assignment_is_tex_file($math_assignment->problems))
$proburl = "pdfgen.php?id=$math_assignment->id&type=problems";
+ else if ($math_assignment->problemsisurl)
+ $proburl = $math_assignment->problems;
+ else if ($CFG->slasharguments)
+ $proburl = "$CFG->wwwroot/file.php/$math_assignment->course/$math_assignment->problems";
else
! $proburl = "$CFG->wwwroot/file.php?file=/$math_assignment->course/$math_assignment->problems";
}
+ else if ($math_assignment->aimquiz)
+ $proburl = "pdfgen.php?id=$math_assignment->id&type=problems";
+ else
+ $proburl = "";
! if($math_assignment->solutions) {
! if (math_assignment_is_tex_file($math_assignment->solutions))
$solurl = "pdfgen.php?id=$math_assignment->id&type=solutions";
+ else if ($math_assignment->solutionsisurl)
+ $solurl = $math_assignment->solutions;
+ else if ($CFG->slasharguments)
+ $solurl = "$CFG->wwwroot/file.php/$math_assignment->course/$math_assignment->solutions";
else
! $solurl = "$CFG->wwwroot/file.php?file=/$math_assignment->course/$math_assignment->solutions";
}
+ else if ($math_assignment->aimquiz)
+ $solurl = "pdfgen.php?id=$math_assignment->id&type=solutions";
+ else
+ $solurl = "";
}
Index: mod.html
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/mod.html,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** mod.html 18 Sep 2003 09:48:51 -0000 1.11
--- mod.html 18 Sep 2003 11:16:16 -0000 1.12
***************
*** 54,58 ****
$form->problemsurl = "";
if ($form->problems) {
! if (strcasecmp(substr($form->problems, 0, 5), "http:") == 0) {
$form->problemsurl = $form->problems;
$form->problems = "";
--- 54,58 ----
$form->problemsurl = "";
if ($form->problems) {
! if ($form->problemsisurl) {
$form->problemsurl = $form->problems;
$form->problems = "";
***************
*** 61,65 ****
$form->solutionsurl = "";
if ($form->solutions) {
! if (strcasecmp(substr($form->solutions, 0, 5), "http:") == 0) {
$form->solutionsurl = $form->solutions;
$form->solutions = "";
--- 61,65 ----
$form->solutionsurl = "";
if ($form->solutions) {
! if ($form->solutionsisurl) {
$form->solutionsurl = $form->solutions;
$form->solutions = "";
***************
*** 171,178 ****
</td>
</tr>
- <input type="hidden" name="problemscompile" value="false"> <!--
<tr>
! <td colspan="2"><input type="checkbox" name="problemscompile"<?php if ($form->problemscompile) echo " checked=\"true\""; ?> /><?php echo "$strcompiletex"; ?></td>
! </tr> -->
</table>
</td>
--- 171,177 ----
</td>
</tr>
<tr>
! <td colspan="2"><?php echo "$strcompiletex"; ?></td>
! </tr>
</table>
</td>
***************
*** 220,227 ****
</td>
</tr>
- <input type="hidden" name="solutionscompile" value="false"><!--
<tr>
! <td colspan="2"><input type="checkbox" name="solutionscompile"<?php if ($form->solutionscompile) echo " checked=\"true\""; ?> /><?php echo "$strcompiletex"; ?></td>
! </tr> -->
</table>
</td>
--- 219,225 ----
</td>
</tr>
<tr>
! <td colspan="2"><?php echo "$strcompiletex"; ?></td>
! </tr>
</table>
</td>
Index: version.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/version.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** version.php 16 Sep 2003 15:21:47 -0000 1.2
--- version.php 18 Sep 2003 11:16:16 -0000 1.3
***************
*** 6,10 ****
/////////////////////////////////////////////////////////////////////////////////
! $module->version = 2003091616; // The (date) version of this module
$module->cron = 0; // How often should cron check this module (seconds)?
--- 6,10 ----
/////////////////////////////////////////////////////////////////////////////////
! $module->version = 2003091812; // The (date) version of this module
$module->cron = 0; // How often should cron check this module (seconds)?
|
|
From: <ma...@us...> - 2003-09-18 11:16:32
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment/db
In directory sc8-pr-cvs1:/tmp/cvs-serv27017/mod/math_assignment/db
Modified Files:
mysql.php mysql.sql
Log Message:
Improved handling of URLs for problem and solution sheets fixing bugs and removing $math_assignment->problemscompile etc.
Index: mysql.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/db/mysql.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** mysql.php 16 Sep 2003 15:20:11 -0000 1.3
--- mysql.php 18 Sep 2003 11:16:15 -0000 1.4
***************
*** 15,18 ****
--- 15,22 ----
$return = false;
}
+ if ($oldversion < 2003091812) {
+ if (!execute_sql("ALTER TABLE `{$CFG->prefix}math_assignment` CHANGE `problemscompile` `problemsisurl` TINYINT(1) NOT NULL default '1' AFTER `problems`, CHANGE `solutionscompile` `solutionsisurl` TINYINT(1) NOT NULL default '1' AFTER `solutions`"))
+ $return = false;
+ }
return $return;
}
Index: mysql.sql
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/db/mysql.sql,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mysql.sql 16 Sep 2003 15:20:12 -0000 1.2
--- mysql.sql 18 Sep 2003 11:16:16 -0000 1.3
***************
*** 10,16 ****
`name` varchar(255) NOT NULL default '',
`problems` varchar(255) NOT NULL default '',
! `problemscompile` tinyint(1) NOT NULL default '1',
`solutions` varchar(255) NOT NULL default '',
! `solutionscompile` tinyint(1) NOT NULL default '1',
`aimsubject` int(10) NOT NULL default '0',
`aimquiz` varchar(255) NOT NULL default '',
--- 10,16 ----
`name` varchar(255) NOT NULL default '',
`problems` varchar(255) NOT NULL default '',
! `problemsisurl` tinyint(1) NOT NULL default '1',
`solutions` varchar(255) NOT NULL default '',
! `solutionsisurl` tinyint(1) NOT NULL default '1',
`aimsubject` int(10) NOT NULL default '0',
`aimquiz` varchar(255) NOT NULL default '',
|
|
From: <ma...@us...> - 2003-09-18 11:16:31
|
Update of /cvsroot/aimmath/moodle/lang/en In directory sc8-pr-cvs1:/tmp/cvs-serv27017/lang/en Modified Files: math_assignment.php Log Message: Improved handling of URLs for problem and solution sheets fixing bugs and removing $math_assignment->problemscompile etc. Index: math_assignment.php =================================================================== RCS file: /cvsroot/aimmath/moodle/lang/en/math_assignment.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** math_assignment.php 16 Sep 2003 17:05:37 -0000 1.7 --- math_assignment.php 18 Sep 2003 11:16:15 -0000 1.8 *************** *** 24,28 **** $string['browsesource'] = "Browse AiM Source"; $string['choosesubject'] = "Teachers choose AiM subject"; ! $string['compiletex'] = "Compile file (if any) as TeX source and add AiM questions (if any)"; $string['computer'] = "Computer"; $string['comment'] = "Comment"; --- 24,28 ---- $string['browsesource'] = "Browse AiM Source"; $string['choosesubject'] = "Teachers choose AiM subject"; ! $string['compiletex'] = "Files with a .tex or .latex extension will be compiled automatically. See help for details."; $string['computer'] = "Computer"; $string['comment'] = "Comment"; |
|
From: <gus...@us...> - 2003-09-18 09:48:56
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv10875/mod/math_assignment
Modified Files:
mod.html subjectpage.php
Log Message:
bug corrected
Index: mod.html
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/mod.html,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** mod.html 18 Sep 2003 09:32:48 -0000 1.10
--- mod.html 18 Sep 2003 09:48:51 -0000 1.11
***************
*** 285,289 ****
<input type="text" name="aimquiz" size="40" maxlength="255" value="<?php p($form->aimquiz); ?>" /> <?php helpbutton("addupdate_quiz", $straimquiz, "math_assignment"); ?>
<?php if ($form->aimsubject > 0) {
! echo "<a href=\"$CFG->wwwroot/mod/math_assignment/subjectpage.php?id=$form->aimsubject\" target=\"suject\">AiM administration</a>";
} ?>
</td>
--- 285,289 ----
<input type="text" name="aimquiz" size="40" maxlength="255" value="<?php p($form->aimquiz); ?>" /> <?php helpbutton("addupdate_quiz", $straimquiz, "math_assignment"); ?>
<?php if ($form->aimsubject > 0) {
! echo "<a href=\"$CFG->wwwroot/mod/math_assignment/subjectpage.php?id=$form->course\" target=\"suject\">AiM administration</a>";
} ?>
</td>
Index: subjectpage.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/subjectpage.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** subjectpage.php 18 Sep 2003 09:32:48 -0000 1.1
--- subjectpage.php 18 Sep 2003 09:48:51 -0000 1.2
***************
*** 8,12 ****
require_once("lib.php");
! require_variable($id); // Course Module ID
if (! $course = get_record("course", "id", $id)) {
--- 8,12 ----
require_once("lib.php");
! require_variable($id); // course ID
if (! $course = get_record("course", "id", $id)) {
|
|
From: <gus...@us...> - 2003-09-18 09:32:52
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv8293/mod/math_assignment
Modified Files:
mod.html
Added Files:
subjectpage.php
Log Message:
Added link to AiM subject administration to mod.html to make it easier for lecturers to set up their AiM quizzes.
--- NEW FILE: subjectpage.php ---
<?PHP // $Id: subjectpage.php,v 1.1 2003/09/18 09:32:48 gustav_delius Exp $
/*
* This page displays the AiM subject administration page
*/
require_once("../../config.php");
require_once("lib.php");
require_variable($id); // Course Module ID
if (! $course = get_record("course", "id", $id)) {
error("Course is misconfigured");
}
if (!$subject = get_record("math_assignment_subject", "course", $id)) {
error("This page should not be shown unless a subject has been assigned to the course");
}
if (!$server = get_record("math_assignment_server", "id", $subject->server)) {
error("The server belonging to his subject is not set up correctly");
}
require_login($course->id);
if (!isteacher($id)) {
errpr("Only teachers should be able to view this page");
}
add_to_log($course->id, "math_assignment", "aimsubjectpage", "aimsubjectpage.php?id=$id", "$subject->name");
if (!$_POST) {
$postdata = math_assignment_add_arg_to_url_data($postdata, "Command","admin/Subject");
$postdata = math_assignment_add_arg_to_url_data($postdata, "Action", "LoadSubjectOptions");
$postdata = math_assignment_add_arg_to_url_data($postdata, "SubjectName", $subject->name);
$postdata = math_assignment_add_arg_to_url_data($postdata, "Password", $subject->password);
}
else {
// load requested page
foreach ($_POST as $key => $arg) {
if (strcasecmp($key, "target")) { // ignore target arguments
$postdata = math_assignment_add_arg_to_url_data($postdata, math_assignment_convert_arg_name($key), stripslashes($arg));
}
}
// special case for changing the output type
if (count($_POST) == 2) {
if (array_key_exists("outputchange", $_POST) && array_key_exists("postdata", $_POST)) {
if (strcmp($_POST['outputchange'], "html") == 0 || strcmp($_POST['outputchange'], "xml") == 0) {
// set the cookie
setcookie("output", $_POST['outputchange'], 0x7FFFFFFF);
$_COOKIE['output'] = $_POST['outputchange'];
$postdata = $_POST['postdata'];
$_POST = array();
}
}
}
}
// get output option from cookie
if (function_exists('editer')) {
if (array_key_exists("output", $_COOKIE))
$usexml = (strcasecmp($_COOKIE['output'], "xml") == 0);
else
$usexml = $CFG->math_assignment_default_latex_output ? true : false;
}
else
$usexml = false;
$usexml = false;
// Print the page header
if ($course->category) {
$navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
}
else
$navigation = "";
$strmath_assignments = get_string("modulenameplural", "math_assignment");
$strmath_assignment = get_string("modulename", "math_assignment");
$straimsubjectpage = get_string("editquiz", "math_assignment");
print_header("$course->shortname: $math_assignment->name", "$course->fullname",
"$navigation <a href=\"index.php?id=$course->id\">$strmath_assignments</a> -> $straimsubjectpage",
"", "", true, update_module_button($cm->id, $course->id, $strmath_assignment), navmenu($course, $cm), $usexml);
// Print the main part of the page
math_assignment_print_aim_output_script();
// load the AiM page and grab the result
$data = math_assignment_get_aim_output($server->address, $postdata, $usexml ? "latex" : "html");
// write out relevant parts of it
$data = math_assignment_convert_aim_output($math_assignment, $subject, $data, $server->address, "subjectpage.php?id=$id", true, $grade, $max_grade);
if (!$data) {
error(get_string("nooutput", "math_assignment"));
}
print_simple_box_start("center", "", "$THEME->cellcontent", "20");
echo $data;
print_simple_box_end();
/// Finish the page
print_footer($course);
?>
Index: mod.html
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/mod.html,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** mod.html 17 Sep 2003 09:12:04 -0000 1.9
--- mod.html 18 Sep 2003 09:32:48 -0000 1.10
***************
*** 171,175 ****
</td>
</tr>
! <input type="hidden" name="problemscompile" value="true"> <!--
<tr>
<td colspan="2"><input type="checkbox" name="problemscompile"<?php if ($form->problemscompile) echo " checked=\"true\""; ?> /><?php echo "$strcompiletex"; ?></td>
--- 171,175 ----
</td>
</tr>
! <input type="hidden" name="problemscompile" value="false"> <!--
<tr>
<td colspan="2"><input type="checkbox" name="problemscompile"<?php if ($form->problemscompile) echo " checked=\"true\""; ?> /><?php echo "$strcompiletex"; ?></td>
***************
*** 220,224 ****
</td>
</tr>
! <input type="hidden" name="solutionscompile" value="true"><!--
<tr>
<td colspan="2"><input type="checkbox" name="solutionscompile"<?php if ($form->solutionscompile) echo " checked=\"true\""; ?> /><?php echo "$strcompiletex"; ?></td>
--- 220,224 ----
</td>
</tr>
! <input type="hidden" name="solutionscompile" value="false"><!--
<tr>
<td colspan="2"><input type="checkbox" name="solutionscompile"<?php if ($form->solutionscompile) echo " checked=\"true\""; ?> /><?php echo "$strcompiletex"; ?></td>
***************
*** 284,287 ****
--- 284,290 ----
<td>
<input type="text" name="aimquiz" size="40" maxlength="255" value="<?php p($form->aimquiz); ?>" /> <?php helpbutton("addupdate_quiz", $straimquiz, "math_assignment"); ?>
+ <?php if ($form->aimsubject > 0) {
+ echo "<a href=\"$CFG->wwwroot/mod/math_assignment/subjectpage.php?id=$form->aimsubject\" target=\"suject\">AiM administration</a>";
+ } ?>
</td>
</tr>
|
|
From: <gus...@us...> - 2003-09-17 19:20:43
|
Update of /cvsroot/aimmath/moodle/lib/t2mml In directory sc8-pr-cvs1:/tmp/cvs-serv27283/t2mml Log Message: Directory /cvsroot/aimmath/moodle/lib/t2mml added to the repository |
|
From: <gus...@us...> - 2003-09-17 19:20:41
|
Update of /cvsroot/aimmath/moodle/lib In directory sc8-pr-cvs1:/tmp/cvs-serv27263/lib Log Message: Directory /cvsroot/aimmath/moodle/lib added to the repository |
|
From: <gus...@us...> - 2003-09-17 17:13:57
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv32512/mod/math_assignment
Modified Files:
pdfgen.php
Log Message:
moved the pdf creation onto this page. Still preliminary
Index: pdfgen.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/pdfgen.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pdfgen.php 13 Sep 2003 13:01:16 -0000 1.2
--- pdfgen.php 17 Sep 2003 17:13:09 -0000 1.3
***************
*** 9,13 ****
optional_variable($type, "problems"); // "problems" or "solutions"
! $solutions = (strcasecmp($type, "solutions") == 0);
if (! $site = get_site()) {
--- 9,14 ----
optional_variable($type, "problems"); // "problems" or "solutions"
!
! $solutions = (boolean)($type == "solutions");
if (! $site = get_site()) {
***************
*** 24,27 ****
--- 25,32 ----
require_login($course->id);
+
+ if (!isstudent($course->id) and !isteacher) {
+ error("Sorry, this assignment is not for you!");
+ }
add_to_log($course->id, "math_assignment", "pdfgen", "pdfgen.php?id=$math_assignment->id", $type);
***************
*** 29,53 ****
// check that the request is valid
- if ($problems) {
- if (strcasecmp(substr($math_assignment->problems, -4), ".tex")) {
- error("Not a dynamic problem sheet."); // this should never happen as we only link to this page if needed
- }
- }
if ($solutions) {
! if (time() < $math_assignment->timedue) {
error("You can not view the solutions until the assignment has closed!");
}
- if (strcasecmp(substr($math_assignment->solutions, -4), ".tex")) {
- error("Not a dynamic solution sheet."); // this should never happen as we only link to this page if needed
- }
}
! ///// ####### YOUR CODE HERE! #######
! /*
! - Examine $math_assignment->problems or $math_assignment->solutions
! - If URL or filesystem path points to a non-tex file then fail with an error message (since my code should produce links directly to static files)
! - load tex file
! - load aim page
! */
if ($math_assignment->aimquiz) {
--- 34,63 ----
// check that the request is valid
if ($solutions) {
! if (time() < $math_assignment->timedue and isstudent($course->id)) {
error("You can not view the solutions until the assignment has closed!");
}
}
! // Load lecturer's tex files or use dummy and store in $latex
!
! math_assignment_get_file_urls($math_assignment,$probfile,$solfile);
! if ($solutions) $texfile = $solfile; else $texfile = $probfile;
! if (math_assignment_is_tex_file($texfile)) {
! $latex = file_get_contents($texfile);
! }
! else {
! $latex = "
! \\documentclass[12pt]{article}\n
! \\usepackage{amsmath}\n
! \\begin{document}\n
! \\begin{center}
! {\\bf " . $course->fullname . ": " . $math_assignment->name . "}
! \\end{center}
! ";
! }
!
! // if there is an aim quiz load it into $data
!
if ($math_assignment->aimquiz) {
***************
*** 60,75 ****
$postdata = "";
! // ##### I wasn't sure which aim page you actually wanted. Use this for the student's view of the quiz:
! $postdata = math_assignment_add_arg_to_url_data($postdata, "Command", "ShowQuizPage");
! $postdata = math_assignment_add_arg_to_url_data($postdata, "SubjectName", $subject->name);
! $postdata = math_assignment_add_arg_to_url_data($postdata, "QuizName", $math_assignment->aimquiz);
! $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);
! // ##### Or this for the lecturer's 'try quiz' view of the quiz:
! $postdata = math_assignment_add_arg_to_url_data($postdata, "Command","try/Quiz");
! $postdata = math_assignment_add_arg_to_url_data($postdata, "Action", "TryQuiz");
! $postdata = math_assignment_add_arg_to_url_data($postdata, "SubjectName", $subject->name);
! $postdata = math_assignment_add_arg_to_url_data($postdata, "QuizName", $math_assignment->aimquiz);
! $postdata = math_assignment_add_arg_to_url_data($postdata, "Password", $subject->password);
// load the AiM page and grab the result
--- 70,86 ----
$postdata = "";
! if (isstudent($course->id)) {
! $postdata = math_assignment_add_arg_to_url_data($postdata, "Command", "ShowQuizPage");
! $postdata = math_assignment_add_arg_to_url_data($postdata, "SubjectName", $subject->name);
! $postdata = math_assignment_add_arg_to_url_data($postdata, "QuizName", $math_assignment->aimquiz);
! $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);
! }
! else
! $postdata = math_assignment_add_arg_to_url_data($postdata, "Command","try/Quiz");
! $postdata = math_assignment_add_arg_to_url_data($postdata, "Action", "TryQuiz");
! $postdata = math_assignment_add_arg_to_url_data($postdata, "SubjectName", $subject->name);
! $postdata = math_assignment_add_arg_to_url_data($postdata, "QuizName", $math_assignment->aimquiz);
! $postdata = math_assignment_add_arg_to_url_data($postdata, "Password", $subject->password);
// load the AiM page and grab the result
***************
*** 88,121 ****
}
}
! $data = math_assignment_convert_aim_output($math_assignment, $subject, $data, "", "", false, $grade, $max_grade);
! // #### $data now contains the same data that was being passed to your function
}
! /*
! - generate pdf file
! */
! // output of pdf
! /*
! Is it possible to generate the pdf direct to stdout? If so you could call the program with the passthru function
! and not generate any files which would be good.
! If you do have to create a file, remeber to use the tempnam function so that you don't get collisions.
! I assume here that you have created a pdf file, for the sake of argument in "/tmp/problems.pdf"
! Whilst you could use the readfile function to open and output the file in one go it is best to do it this way
! because we only set the output type to pdf after successfully opening the file. If it fails we can still output
! an error message in html.
! */
! if ($file = fopen("/tmp/problems.pdf", "rb")) { // the 'b' is for compatibility with Windoze
// tell the browser that it is pdf
header("Content-type: application/pdf");
- /* more headers controlling caching, etc if required */
-
fpassthru($file); // chuck all the data direct to the browser and close the handle
}
--- 99,187 ----
}
}
+ }
! // convert AiM questions or solutions in $data and add to $latex
! // remove everything before the first question
! $data = preg_replace("/^[\s\S]*?(?=id=\"question)/",
! "",$data);
+ if (!$solutions) {
+ // remove all answers and solutions
+ $data = preg_replace("/class=\"lastanswer\"[\s\S]*?((?=id=\"question)|$)/",
+ "",$data);
}
! else {
! // remove answers but keep solution
!
! // Keep the answer to multiple choice questions
! // The "class=\"solu is there to save this from being erased in the next step below
! $data = preg_replace("/The correct answer is ([A-Z])/",
! "class=\"solu<latex>\n\n\\noindent{\\bf Right Answer: } $1</latex>",$data);
!
! // Remove anything else up to the solution or the next question or the end of file
! $data = preg_replace("/class=\"lastanswer\"[\s\S]*?((?=class=\"solu)|(?=id=\"quest)|$)/",
! "",$data);
!
! $data = preg_replace("/class=\"solution/",
! "<latex>\n\n\\noindent{\\bf Solution:}\n\n</latex>",$data);
! }
!
! // remove questionheaders including descriptions
! $data = preg_replace("/class=\"questionheader\"[\s\S]*?class=\"questionbody/",
! "",$data);
! // Questions
! $data = preg_replace("/id=\"question(\d+)\"/i",
! "<latex>\n\n\vspace{5mm}\\noindent{\\bf Question \$1:}\n\n</latex>",$data);
!
! // Parts
! $data = preg_replace("/id=\"question(\d+).(\d+)\"/i",
! "<latex>\n\n\vspace{2mm}\\noindent{\\bf Part \$2}\n\n</latex>",$data);
!
! // replace radio buttons
! $data = preg_replace("/(type=\"radio\"[^\/]*value=\")([A-Z])\"/",
! "<latex>\n\n {\bf $2 } </latex>",$data);
!
! // replace checkboxes by diamonds
! $data = preg_replace("/(type=\"checkbox\"[^\/]*value=\")([A-Z])\"/",
! "<latex>\n\n {\bf $2 } </latex>",$data);
!
! // delete AiM syntax hints (identified by \small)
! $data = preg_replace("/\\\\small[^}]*./",
! "",$data);
!
! // We might at some point want to replace input box by ....
! //preg_match_all("/<latex>([\s\S]*)?<\/latex>/", $data, $matches);
! //$latex .= implode(" ", $matches[0]);
!
! // extract anything inside <latex> ..</latex> and append it to $latex
! // this is not done elegantly, but who cares.
! $chunks = explode("</latex>",$data);
! array_pop($chunks);
! foreach ($chunks as $chunk) {
! preg_match("/(?<=<latex>)[\s\S]*$/","$chunk",$piece);
! $latex .= $piece[0];
! }
! $latex .= "\n\n\\end{document}";
! // generate pdf file from $latex
! //$tempfile = tempnam();
! $tempfile = "temp.tex";
! if (!$fp=fopen($tempfile,"w"))
! error("Sorry, I can't produce the pdf output. Failed to open temporary file.");
! fwrite($fp,$latex);
! fclose($fp);
! exec("pdflatex -interaction=batchmode temp.tex");
!
! // output of pdf
! /*
! if ($file = fopen("temp.pdf", "rb")) { // the 'b' is for compatibility with Windoze
// tell the browser that it is pdf
header("Content-type: application/pdf");
fpassthru($file); // chuck all the data direct to the browser and close the handle
}
***************
*** 123,125 ****
error("It didn't work!"); // error message
}
! ?>
\ No newline at end of file
--- 189,195 ----
error("It didn't work!"); // error message
}
! */
!
! redirect("temp.pdf");
!
! ?>
|
|
From: <gus...@us...> - 2003-09-17 10:21:03
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv11482/mod/math_assignment
Modified Files:
view.php
Log Message:
Now only shows computer grade if there actually is an AiM component
Index: view.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/view.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** view.php 10 Sep 2003 18:25:51 -0000 1.4
--- view.php 17 Sep 2003 10:20:59 -0000 1.5
***************
*** 44,47 ****
--- 44,49 ----
add_to_log($course->id, "math_assignment", "view", "view.php?id=$cm->id", "$math_assignment->id");
+
+ $hasaim = (!$math_assignment_aimquiz == "");
$strfirstname = get_string("firstname");
***************
*** 119,123 ****
$myxls->InsertText($strlastname);
$myxls->InsertText("$strpaper $strgrade");
! $myxls->InsertText("$strcomputer $strgrade");
$myxls->InsertText("$strtotal $strgrade");
--- 121,125 ----
$myxls->InsertText($strlastname);
$myxls->InsertText("$strpaper $strgrade");
! if ($hasaim) $myxls->InsertText("$strcomputer $strgrade");
$myxls->InsertText("$strtotal $strgrade");
***************
*** 132,143 ****
$myxls->InsertText($student->firstname);
$myxls->InsertText($student->lastname);
! if ($studentgrade->papergrade >= 0)
! $myxls->InsertNumber($studentgrade->papergrade);
! else
! $myxls->InsertText("");
! if ($studentgrade->aimgrade >= 0)
! $myxls->InsertNumber($studentgrade->aimgrade);
! else
! $myxls->InsertText("");
$myxls->InsertNumber(math_assignment_total_grade($math_assignment, $studentgrade));
}
--- 134,147 ----
$myxls->InsertText($student->firstname);
$myxls->InsertText($student->lastname);
! if ($hasaim) {
! if ($studentgrade->papergrade >= 0)
! $myxls->InsertNumber($studentgrade->papergrade);
! else
! $myxls->InsertText("");
! if ($studentgrade->aimgrade >= 0)
! $myxls->InsertNumber($studentgrade->aimgrade);
! else
! $myxls->InsertText("");
! }
$myxls->InsertNumber(math_assignment_total_grade($math_assignment, $studentgrade));
}
***************
*** 156,160 ****
/// Print names of all the fields
! echo "$strfirstname\t$strlastname\t$strpaper $strgrade\t$strcomputer $strgrade\t$strtotal $strgrade\n";
/// Print all the lines of data.
--- 160,168 ----
/// Print names of all the fields
! echo "$strfirstname\t$strlastname\t";
! if ($hasaim)
! echo "$strpaper $strgrade\t$strcomputer $strgrade\t$strtotal $strgrade\n";
! else
! echo "$strgrade\n";
/// Print all the lines of data.
***************
*** 163,172 ****
$student = $students[$studentid];
echo "$student->firstname\t$student->lastname\t";
! if ($studentgrade->papergrade >= 0)
! echo "$studentgrade->papergrade";
! echo "\t";
! if ($studentgrade->aimgrade >= 0)
! echo "$studentgrade->aimgrade";
! echo "\t";
echo math_assignment_total_grade($math_assignment, $studentgrade);
echo "\n";
--- 171,182 ----
$student = $students[$studentid];
echo "$student->firstname\t$student->lastname\t";
! if ($hasaim) {
! if ($studentgrade->papergrade >= 0)
! echo "$studentgrade->papergrade";
! echo "\t";
! if ($studentgrade->aimgrade >= 0)
! echo "$studentgrade->aimgrade";
! echo "\t";
! }
echo math_assignment_total_grade($math_assignment, $studentgrade);
echo "\n";
***************
*** 203,226 ****
$inbox = true;
}
! echo "<b>$strpaper $strgrade :</b> ";
! if ($grade->papergrade >= 0)
! echo "$grade->papergrade / $math_assignment->papergrade";
! else
! print_string("notmarked", "math_assignment");
! echo "<br /><b>$strcomputer $strgrade :</b> ";
! if ($grade->aimgrade >= 0)
! echo "$grade->aimgrade / $math_assignment->aimgrade";
! else
! print_string("notattempted", "math_assignment");
! if ($grade->aimoverride) {
! echo " (";
! print_string("gradeoverride", "math_assignment");
! echo ")";
}
- echo "<br />";
- if ($grade->aimcomment)
- echo "<b>" . $course->teacher . " " . get_string("comment", "math_assignment") . ":</b> " . nl2br(htmlspecialchars($grade->aimcomment)) . "<br />";
- $totalgrade = math_assignment_total_grade($math_assignment, $grade);
- echo "<b>$strtotal $strgrade :</b> $totalgrade / $totalmax";
}
if ($inbox)
--- 213,245 ----
$inbox = true;
}
! if ($hasaim) {
! echo "<b>$strpaper $strgrade :</b> ";
! if ($grade->papergrade >= 0)
! echo "$grade->papergrade / $math_assignment->papergrade";
! else
! print_string("notmarked", "math_assignment");
! echo "<br /><b>$strcomputer $strgrade :</b> ";
! if ($grade->aimgrade >= 0)
! echo "$grade->aimgrade / $math_assignment->aimgrade";
! else
! print_string("notattempted", "math_assignment");
! if ($grade->aimoverride) {
! echo " (";
! print_string("gradeoverride", "math_assignment");
! echo ")";
! }
! echo "<br />";
! if ($grade->aimcomment)
! echo "<b>" . $course->teacher . " " . get_string("comment", "math_assignment") . ":</b> " . nl2br(htmlspecialchars($grade->aimcomment)) . "<br />";
! $totalgrade = math_assignment_total_grade($math_assignment, $grade);
! echo "<b>$strtotal $strgrade :</b> $totalgrade / $totalmax";
! }
! else {
! echo "<b>$strgrade :</b> ";
! if ($grade->papergrade >= 0)
! echo "$grade->papergrade / $math_assignment->papergrade";
! else
! print_string("notmarked", "math_assignment");
}
}
if ($inbox)
***************
*** 230,237 ****
echo math_assignment_get_admin_links($cm, $math_assignment, "right");
print_heading($strgrades);
! echo "<p align=\"center\"><b>" . get_string("maximumgrade") . "</b>: $math_assignment->papergrade ($strpaper) + $math_assignment->aimgrade ($strcomputer) = $totalmax</p>";
! $table->head = array ("", get_string("firstname"), get_string("lastname"), "$strpaper $strgrade", "$strcomputer $strgrade", "$strtotal $strgrade");
! $table->width = array(35, "", "", "", "", "");
! $table->align = array("LEFT", "RIGHT", "LEFT", "CENTER", "CENTER", "CENTER");
$stredit = get_string("edit", "math_assignment");
--- 249,264 ----
echo math_assignment_get_admin_links($cm, $math_assignment, "right");
print_heading($strgrades);
! if ($hasaim) {
! echo "<p align=\"center\"><b>" . get_string("maximumgrade") . "</b>: $math_assignment->papergrade ($strpaper) + $math_assignment->aimgrade ($strcomputer) = $totalmax</p>";
! $table->head = array ("", get_string("firstname"), get_string("lastname"), "$strpaper $strgrade", "$strcomputer $strgrade", "$strtotal $strgrade");
! $table->width = array(35, "", "", "", "", "");
! $table->align = array("LEFT", "RIGHT", "LEFT", "CENTER", "CENTER", "CENTER");
! }
! else {
! echo "<p align=\"center\"><b>" . get_string("maximumgrade") . "</b>: $totalmax</p>";
! $table->head = array ("", get_string("firstname"), get_string("lastname"), "$strgrade");
! $table->width = array(35, "", "", "");
! $table->align = array("LEFT", "RIGHT", "LEFT", "CENTER");
! }
$stredit = get_string("edit", "math_assignment");
***************
*** 264,268 ****
$editedclose = "";
}
! $table->data[] = array($picture, $student->firstname, $student->lastname, $papergrade, "$aimgrade $edited<a href=\"editgrade.php?id=$math_assignment->id&userid=$student->id\">$stredit</a>$editedclose", math_assignment_total_grade($math_assignment, $studentgrade));
$i++;
}
--- 291,298 ----
$editedclose = "";
}
! if ($hasaim)
! $table->data[] = array($picture, $student->firstname, $student->lastname, $papergrade, "$aimgrade $edited<a href=\"editgrade.php?id=$math_assignment->id&userid=$student->id\">$stredit</a>$editedclose", math_assignment_total_grade($math_assignment, $studentgrade));
! else
! $table->data[] = array($picture, $student->firstname, $student->lastname, $papergrade);
$i++;
}
|
|
From: <gus...@us...> - 2003-09-17 09:12:08
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv31924/mod/math_assignment
Modified Files:
mod.html
Log Message:
Commented out checkbox controls. Set default for Maximum Grade to 10. Prints explanation of Maximum Grade only if there can be an AiM component.
Index: mod.html
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/mod.html,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** mod.html 16 Sep 2003 16:58:21 -0000 1.8
--- mod.html 17 Sep 2003 09:12:04 -0000 1.9
***************
*** 33,37 ****
}
if (!isset($form->papergrade)) {
! $form->papergrade = 0;
}
if (!isset($form->aimgrade)) {
--- 33,37 ----
}
if (!isset($form->papergrade)) {
! $form->papergrade = 10;
}
if (!isset($form->aimgrade)) {
***************
*** 171,177 ****
</td>
</tr>
<tr>
<td colspan="2"><input type="checkbox" name="problemscompile"<?php if ($form->problemscompile) echo " checked=\"true\""; ?> /><?php echo "$strcompiletex"; ?></td>
! </tr>
</table>
</td>
--- 171,178 ----
</td>
</tr>
+ <input type="hidden" name="problemscompile" value="true"> <!--
<tr>
<td colspan="2"><input type="checkbox" name="problemscompile"<?php if ($form->problemscompile) echo " checked=\"true\""; ?> /><?php echo "$strcompiletex"; ?></td>
! </tr> -->
</table>
</td>
***************
*** 219,225 ****
</td>
</tr>
<tr>
<td colspan="2"><input type="checkbox" name="solutionscompile"<?php if ($form->solutionscompile) echo " checked=\"true\""; ?> /><?php echo "$strcompiletex"; ?></td>
! </tr>
</table>
</td>
--- 220,227 ----
</td>
</tr>
+ <input type="hidden" name="solutionscompile" value="true"><!--
<tr>
<td colspan="2"><input type="checkbox" name="solutionscompile"<?php if ($form->solutionscompile) echo " checked=\"true\""; ?> /><?php echo "$strcompiletex"; ?></td>
! </tr> -->
</table>
</td>
***************
*** 230,234 ****
<td>
<input type="text" name="papergrade" size="10" maxlength="10" value="<?php p($form->papergrade); ?>" /> <?php
! print_string("maxgradepaperonly", "math_assignment");
helpbutton("addupdate_maxgrade", $strmaxgrade, "math_assignment");
?>
--- 232,239 ----
<td>
<input type="text" name="papergrade" size="10" maxlength="10" value="<?php p($form->papergrade); ?>" /> <?php
! // print the following clarification only if there can be an AiM component
! if (($CFG->math_assignment_teachers_choose_subject > 0) or ($form->aimsubject > 0)) {
! print_string("maxgradepaperonly", "math_assignment");
! }
helpbutton("addupdate_maxgrade", $strmaxgrade, "math_assignment");
?>
|
|
From: <gus...@us...> - 2003-09-16 20:22:05
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim/try
In directory sc8-pr-cvs1:/tmp/cvs-serv14519/WEB-INF/maple/aim/try
Modified Files:
Question.mpl Quiz.mpl
Log Message:
Fixed a bug in the seed input box
Index: Question.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/try/Question.mpl,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Question.mpl 1 Sep 2003 20:22:23 -0000 1.4
--- Question.mpl 16 Sep 2003 20:22:01 -0000 1.5
***************
*** 134,138 ****
"name" = "QuestionSeed",
"value" = {"QuestionSeed"},
! "onchange='seedchanged=true;'"]],
["br"],
{"show"},
--- 134,138 ----
"name" = "QuestionSeed",
"value" = {"QuestionSeed"},
! "onchange" = "seedchanged=true;"]],
["br"],
{"show"},
***************
*** 450,452 ****
EndPackage():
-
--- 450,451 ----
Index: Quiz.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/try/Quiz.mpl,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Quiz.mpl 25 Aug 2003 21:47:19 -0000 1.3
--- Quiz.mpl 16 Sep 2003 20:22:01 -0000 1.4
***************
*** 144,150 ****
["td",
[["inputtext",
! "name" = "QuizSeed",
! "value" = {"QuizSeed"},
! "onchange" = "'seedchanged=true;'"]]]]],
[["hr","noshade"]],
[["table","width" = "100%"],
--- 144,150 ----
["td",
[["inputtext",
! "name" = "QuestionSeed",
! "value" = {"QuestionSeed"},
! "onchange" = "seedchanged=true;"]]]]],
[["hr","noshade"]],
[["table","width" = "100%"],
***************
*** 286,288 ****
EndPackage():
-
--- 286,287 ----
|
|
From: <ma...@us...> - 2003-09-16 19:13:08
|
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>";
}
}
|