aimmath-commit Mailing List for AiM Assessment in Mathematics (Page 11)
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: <mo...@us...> - 2003-09-22 02:21:58
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim
In directory sc8-pr-cvs1:/tmp/cvs-serv3895
Modified Files:
Decimal.mpl
Log Message:
a minor documentation fix
Index: Decimal.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Decimal.mpl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Decimal.mpl 20 Sep 2003 16:30:44 -0000 1.2
--- Decimal.mpl 22 Sep 2003 02:21:55 -0000 1.3
***************
*** 124,129 ****
`Package/Assign`(
! `Decimal/RepeatingDenominators`::posint,
! "Returns all positive integer d<500 such that 1/d has repeating digits with minimum period n for the repeating part of its decimal representation (and does not have a finite decimal representation).",
proc(n::posint)
local LookUp;
--- 124,129 ----
`Package/Assign`(
! `Decimal/RepeatingDenominators`::list(posint),
! "Returns the list of all positive integer d<500 such that 1/d has repeating digits with minimum period n for the repeating part of its decimal representation (and does not have a finite decimal representation).",
proc(n::posint)
local LookUp;
|
|
From: <mo...@us...> - 2003-09-22 02:21:47
|
Update of /cvsroot/aimmath/AIM/doc In directory sc8-pr-cvs1:/tmp/cvs-serv3780 Modified Files: AuthoringGuide.pdf Log Message: ..another installment... Index: AuthoringGuide.pdf =================================================================== RCS file: /cvsroot/aimmath/AIM/doc/AuthoringGuide.pdf,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 Binary files /tmp/cvsdqY8s9 and /tmp/cvs8LdRLb differ |
|
From: <ma...@us...> - 2003-09-22 01:13:05
|
Update of /cvsroot/aimmath/moodle/lang/en In directory sc8-pr-cvs1:/tmp/cvs-serv25016/lang/en Modified Files: math_assignment.php Log Message: Started to implement paging in view.php. Currently MySQL only but database access needs to be changed throughout. Index: math_assignment.php =================================================================== RCS file: /cvsroot/aimmath/moodle/lang/en/math_assignment.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** math_assignment.php 20 Sep 2003 19:13:43 -0000 1.11 --- math_assignment.php 22 Sep 2003 01:13:01 -0000 1.12 *************** *** 28,31 **** --- 28,32 ---- $string['coursesettings'] = "Course Settings"; $string['deletequery'] = "Are you sure you want to delete this server?"; + $string['displayingrows'] = "Displaying rows \$a->start to \$a->end from \$a->total"; $string['edited'] = "Edited"; $string['edit'] = "Edit"; |
|
From: <ma...@us...> - 2003-09-22 01:13:05
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv25016/mod/math_assignment
Modified Files:
view.php
Log Message:
Started to implement paging in view.php. Currently MySQL only but database access needs to be changed throughout.
Index: view.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/view.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** view.php 21 Sep 2003 21:02:35 -0000 1.10
--- view.php 22 Sep 2003 01:13:01 -0000 1.11
***************
*** 1,3 ****
! <?PHP // $Id$
/// This page lets teachers view the grades for all students in the course for the math assignment
--- 1,3 ----
! <?php // $Id$
/// This page lets teachers view the grades for all students in the course for the math assignment
***************
*** 11,16 ****
optional_variable($q); // assignment ID
optional_variable($download, ""); // to download data
- optional_variable($page, 1); // page to display
optional_variable($sort, "lastname ASC"); // column and direction to sort
if (! $site = get_site()) {
--- 11,17 ----
optional_variable($q); // assignment ID
optional_variable($download, ""); // to download data
optional_variable($sort, "lastname ASC"); // column and direction to sort
+ optional_variable($page, 1); // page to display
+ optional_variable($pagerows, 100); // number of students to display per page
if (! $site = get_site()) {
***************
*** 51,76 ****
$hasboth = ($hasaim and $haspaper);
- // verify that the sort string is correct
- $sort = explode(" ", $sort);
- if (count($sort) != 2) {
- $sort[0] = "lastname"; // not valid so use default instead
- $sort[1] = "ASC";
- }
- $sortgrade = 0;
- if (strcasecmp($sort[0], "lastname") != 0) { // check for field name in most likely used order
- if (strcasecmp($sort[0], "firstname") != 0) { // to improve speed
- if (strcasecmp($sort[0], "totalgrade") != 0)
- $sort[0] = "lastname"; // not valid so use default instead
- else if (strcasecmp($sort[1], "desc") == 0)
- $sortgrade = -1;
- else
- $sortgrade = 1;
- }
- }
- if (strcasecmp($sort[1], "asc") != 0 && strcasecmp($sort[1], "desc") != 0)
- $sort[1] = "ASC"; // not valid so use default instead
- if (!$sortgrade)
- $sort = implode(" ", $sort);
-
$strfirstname = get_string("firstname");
$strlastname = get_string("lastname");
--- 52,55 ----
***************
*** 92,97 ****
if (isteacher($course->id)) {
! // Get a list of all students
! if (!$students = get_course_students($course->id, $sortgrade ? "''" : "u.$sort")) {
print_header("$course->shortname: $math_assignment->name", "$course->fullname",
"$navigation <a href=\"index.php?id=$course->id\">$strmath_assignments</a> -> $math_assignment->name",
--- 71,119 ----
if (isteacher($course->id)) {
! // verify that the sort string is correct
! $sort = explode(" ", $sort);
! if (count($sort) != 2) {
! $sort[0] = "lastname"; // not valid so use default instead
! $sort[1] = "ASC";
! }
! $sortgrade = 0;
! if (strcasecmp($sort[0], "lastname") != 0) { // check for field name in most likely used order
! if (strcasecmp($sort[0], "firstname") != 0) { // to improve speed
! if (strcasecmp($sort[0], "totalgrade") != 0)
! $sort[0] = "lastname"; // not valid so use default instead
! else if (strcasecmp($sort[1], "desc") == 0)
! $sortgrade = -1;
! else
! $sortgrade = 1;
! }
! }
! if (strcasecmp($sort[1], "asc") != 0 && strcasecmp($sort[1], "desc") != 0)
! $sort[1] = "ASC"; // not valid so use default instead
! $sort = implode(" ", $sort);
!
! // check page is valid
! if ($page <= 0)
! $page = 1;
! if ($pagerows < 10) { // refuse to show less than 10 rows per page
! if ($pagerows > 0)
! $page = (int) (($page - 1) * $pagerows) / 10 + 1;
! else
! $page = 1;
! $pagerows = 10;
! }
!
! // Count all students (NOTE : MySQL 4 only but nice and fast)
! $numstudents = $db->Execute("SELECT count(*) FROM {$CFG->prefix}user u LEFT JOIN {$CFG->prefix}user_students s ON s.userid = u.id WHERE s.course = '$course->id' AND u.deleted = '0'");
! if ($numstudents)
! $numstudents = (int) $numstudents->fields[0];
! else
! $numstudents = 0;
!
! if (($page - 1) * $pagerows > $numstudents)
! $page = (int) ($numstudents + $pagerows - 1) / $pagerows;
!
! // Get a list of students for this page
! $page = ($page - 1) * $pagerows;
! if (!$students = get_course_students($course->id, $sortgrade ? "''" : "u.$sort" . ($pagerows ? " LIMIT $page, $pagerows" : ""))) {
print_header("$course->shortname: $math_assignment->name", "$course->fullname",
"$navigation <a href=\"index.php?id=$course->id\">$strmath_assignments</a> -> $math_assignment->name",
***************
*** 392,395 ****
--- 414,420 ----
}
+ // print paging controls
+ print_paging_form ("top", $cm->id, $sort, $numstudents, $page, $pagerows);
+
echo "<form action=\"updatepapergrades.php?id=$math_assignment->id\" method=\"post\" name=\"papergradeform\">";
print_table($table);
***************
*** 420,423 ****
--- 445,451 ----
echo "</td></tr></table>";
+ // print paging controls
+ print_paging_form ("bottom", $cm->id, $sort, $numstudents, $page, $pagerows);
+
if ($adminlinks = math_assignment_get_admin_links($cm, $math_assignment, "center")) {
print_heading(get_string("administration"));
***************
*** 440,442 ****
--- 468,492 ----
}
+ function print_paging_form($name, $id, $sort, $count, $page, $pagerows) {
+ if ($count > $pagerows) {
+ echo "<form action=\"view.php?id=$id\" method=\"post\" name=\"page$name\">\n";
+ echo "<input type=\"hidden\" name=\"sort\" value=\"$sort\" />\n";
+ $moreinfo->start = $page + 1;
+ $moreinfo->end = min($page + $pagerows, $count);
+ $moreinfo->total = $count;
+ echo "<p align=\"center\">" . get_string("displayingrows", "math_assignment", $moreinfo) . "</p>\n";
+ echo "<p align=\"center\">" . get_string("page") . " :";
+ $pages = ($count + $pagerows - 1) / $pagerows;
+ $page++;
+ for ($i = 1; $i <= $pages; $i++) {
+ if ($i == $page)
+ echo " <b>$i</b>";
+ else
+ echo " <input type=\"submit\" name=\"page\" value=\"$i\" />";
+ }
+ echo "</p>\n";
+ echo "<input type=\"hidden\" name=\"pagerows\" value=\"$pagerows\" />\n";
+ echo "</form>\n";
+ }
+ }
?>
|
|
From: <gus...@us...> - 2003-09-21 22:01:07
|
Update of /cvsroot/aimmath/moodle/lib/t2mml
In directory sc8-pr-cvs1:/tmp/cvs-serv26362/lib/t2mml
Added Files:
edit.php
Log Message:
edit.php will be a commented and extended version of editeml.php
--- NEW FILE: edit.php ---
<?
/* This TeX to MathML converter is based on
WeM - Web editeur Mathematique
Copyright 2002 Stephan Semirat
Contact : ad...@ma...
*/
function chercherbf($bo,$bf,$expression) {
$expression=str_replace($bo,"(",$expression);
$expression=str_replace($bf,")",$expression);
$expr=$expression;
$k=0;
$flag=true;
while ($flag==true){
$j=strpos($expr,"(");
$i=strpos($expr,")");
if ($i===false) $i=100000;
if ($j===false) $j=100000;
if ($i<$j) {
$k++;
if ($k==1) $flag=false; else
$expr=substr($expr,$i+1,strlen($expr));
}
if ($i>$j) {
$k--;
$expr=substr($expr,$j+1,strlen($expr));
}
if ($i==$j) {$flag=false;die("i=j");}
}
$expression=substr($expression,0,strlen($expression)-strlen($expr)+$i);
$expression=str_replace("(",$bo,$expression);
$expression=str_replace(")",$bf,$expression);
return $expression;
}
function chercherbo($bo,$bf,$expression) {
$expression=str_replace($bo,"(",$expression);
$expression=str_replace($bf,")",$expression);
$expr=$expression;
$k=0;
$flag=true;
while ($flag==true){
$i=strrpos($expr,"(");
$j=strrpos($expr,")");
if ($i===false) $i=-1;
if ($j===false) $j=-1;
if ($i>$j) {
$k++;
if ($k==1) $flag=false; else
$expr=substr($expr,0,$i);
}
if ($i<$j) {
$k--;
$expr=substr($expr,0,$j);
}
if ($i==$j) {$flag=false;die("probleme de format du texte");}
}
$expression=substr($expression,$i+1,strlen($expression));
$expression=str_replace("(",$bo,$expression);
$expression=str_replace(")",$bf,$expression);
return $expression;
}
function indiceexposant($expr) {
$l=strlen($expr);
$exprr="";
$i=$l-1;
while ($i>=0){
$a=substr($expr,$i,1);
$i--;
$ok=false; $j=$i;
if ((ereg("\^",$a)) || (ereg("\_",$a))) {
$b=substr($expr,$i,1);
$i--;
if ((ereg(">",$b)) || ($b=="}")){
if (substr($expr,$i,1)=="/"){
$numerateur=strrchr(substr($expr,0,$i+2),"<");
$i=$i-strlen($numerateur)+1;
} else {
if ($b==">") $b=strrchr(substr($expr,0,$i+2),"<");
$i=$i-strlen($b)+1;
$balisefin=$b;
if ($b!="}") $balisedebut=str_replace("/","",$b); else $balisedebut="{";
$c=chercherbo($balisedebut,$balisefin,substr($expr,0,$i+1));
$i=$i-strlen($c.$balisedebut);
$c=indiceexposant($c);
if ($balisedebut!="{") $balisedebutN=$balisedebut; else $balisedebutN="<mrow>";
if ($balisefin!="}") $balisefinN=$balisefin; else $balisefinN="</mrow>";
$numerateur=$c;
}
$ok=true;
}
$b=substr($exprr,0,1);
if (ereg("<",$b)) {
$j=strpos($exprr,">");
$b=substr($exprr,0,$j+1);
$balisedebut=$b;
$balisefin=substr($b,0,1)."/".substr($b,1,strlen($b)-1);
$c=indiceexposant(chercherbf($balisedebut,$balisefin,substr($exprr,strlen($balisedebut),strlen($exprr))));
$exprr=substr($exprr,strlen($balisedebut.$c.$balisefin),strlen($exprr));
if (($balisedebut=="<msup>") && (ereg("\_",$a))){
$baliseO="<msubsup>";
$baliseF="</msubsup>";
$balisedebut="";
$balisefin="";
} else {
if (ereg("\_",$a)) {
$baliseO="<msub>";
$baliseF="</msub>";
} else {
$baliseO="<msup>";
$baliseF="</msup>";
}
} $denominateur=$balisedebut.$c.$balisefin;
} else $ok=false;
if ($ok) {
$exprr=$baliseO.$balisedebutN.$numerateur.$balisefinN.$denominateur.$baliseF.$exprr;
$a="";
} else $i=$j;
}
$exprr=$a.$exprr;
}
return $exprr;
}
function editestring($expr) {
while(ereg("\(([^()]*)\)",$expr)){
$expr=preg_replace("/\(([^()]*)\)/","<mrow><mo><parenthese></mo>$1<mo></parenthese></mo></mrow>",$expr);
}
$l=strlen($expr);
//echo "expr=$expr\n ";
$exprr="";
$i=$l-1;
while ($i>=0){
$a=substr($expr,$i,1);
//echo " a=$a ";
$i--;
if ($a==";") {
$texte=false;
$b=strrchr(substr($expr,0,$i+1),"&");
if (ereg("(&#)(.*)([^a-zA-Z]+)",$b)) { $texte=true;}
if ($b=="") {$texte=true;}
if ($texte==true){
$b=strrchr(substr($expr,0,$i+2),"<");
if (!(ereg("<mo",$b))) $a="<mo>".$a."</mo>";
$exprr=$a.$exprr;
$a="";
} else {
$b=strrchr(substr($expr,0,$i+2),"<");
$exprr=$b.$exprr;
$i=$i-strlen($b)+1;
$a="";
}
}
if (ereg("(\+|\-|\(|\)|=|\[|\]|\*|,|\.|:|%)",$a)) {
$b=strrchr(substr($expr,0,$i+2),"<");
if (!(ereg("<mo",$b))) $a="<mo>".$a."</mo>";
$exprr=$a.$exprr;
$a="";
}
if ($a=="|") {
$b=strrchr(substr($expr,0,$i+2),"<");
if (!(ereg("<mo",$b))) $a="<mo>".$a."</mo>";
$exprr="<mo>&#mid;</mo>".$exprr;
$a="";
}
/* if (ereg("\}",$a)) {
$b=chercherbo("{","}",substr($expr,0,$i+1));
$i=$i-strlen($b)-1;
if (($test=="^") || ($test=="_")) $exprr="<mrow>".$b."</mrow>".$exprr; else $exprr="{".$b."}".$exprr;
$a="";
}*/
if (ereg(">",$a)) {
$b=substr($expr,$i,1);
if ($b!="\\") {
$b=strrchr(substr($expr,0,$i+2),"<");
$exprr=$b.$exprr;
$i=$i-strlen($b)+1;
$a="";
}
}
if (ereg("[0-9]",$a)) {
while(ereg("[0-9]|\.|,",substr($expr,$i,1)) && ($i>=0)){
$a=substr($expr,$i,1).$a;
$i--;
}
$b=strrchr(substr($expr,0,$i+2),"<");
if (!(ereg("<mn",$b))) $a="<mn>".$a."</mn>";
$exprr=$a.$exprr;
$a="";
}
if (ereg("[a-zA-Z]",$a)){
$texte=false;
$b=strrchr(substr($expr,0,$i+2),"\\");
if (ereg("(\\\)(.*)([^a-zA-Z]+)",$b)) {$texte=true;}
if ($b=="") {$texte=true;}
if ($texte==true){
$b=strrchr(substr($expr,0,$i+2),"<");
// echo "//b=$b//";
if ((!(ereg("<mi",$b)) && (!(ereg("<mtext",$b)))) || (!($b))) $a="<mi>".$a."</mi>";
$exprr=$a.$exprr;
$a="";
} else {
$commande=substr($b,1,strlen($b));
$c=strrchr(substr($expr,0,$i+2),"<");
if ((!(ereg("<mo",$c))) || (!($c))) {
$i=$i-strlen($b)+1;
if (($commande!="sqrt") && ($commande!="frac")) {
$exprr="<mo>&#".$commande.";</mo>".$exprr;
} else
$exprr="\\".$commande."".$exprr;
} else {
$exprr=str_replace("\\".$commande,"&#".$commande.";",$c).$exprr;
// echo "c=$c\n";
//echo "exprr=$exprr\n";
$i=$i-strlen($c)+1;
//$a=substr($expr,$i,1);
//echo "a=$a\n";
//$a="";
}
$a="";
}
}
if ($a==" "){
$b=substr($expr,$i,1);
if ($b=="\\") {
$exprr="<mspace width=\"1em\"/>".$exprr;
$i--;
} else {
$b=strrchr(substr($expr,0,$i+2),"<");
if (ereg("<mtext",$b)) $exprr=" ".$exprr;
}
$a="";
}
if ($a=="\'"){
$exprr="<mi>\'</mi>".$exprr;
$a="";
}
$exprr=$a.$exprr;
// echo "\n exprr=$exprr\n";
}
return $exprr;
}
function editermaths($message){
$flag=0;
$message=str_replace("&#lt;","<mo>&#lt;</mo>",$message);
$message=str_replace("&#gt;","<mo>&#gt;</mo>",$message);
$message=str_replace("<mo><mo>","<mo>",$message);
$message=str_replace("</mo></mo>","</mo>",$message);
$message=preg_replace("/(\\\){1}(begin)\{(array)\}/","<mtable><mtr columnalign=\"left\"><mtd>",$message);
$message=preg_replace("/(\\\){1}(end)\{(array)\}/","</mtd></mtr>\n</mtable>",$message);
$message=preg_replace("/((\\\){2})(<br \/>)?/","</mtd></mtr>\n<mtr columnalign=\"left\"><mtd>",$message);
$message=preg_replace("/(&)([^#])/","</mtd><mtd>$2",$message);
$message=str_replace("<mtr columnalign=\"left\"><mtd>\n</mtd></mtr>\n</mtable>","</mtable>",$message);
while($flag<2) {
$message=preg_replace("/(\\\){1}(displaystyle)\{([^}{]*)\}/","<mstyle displaystyle=\"true\">$3</mstyle>",$message);
$message=preg_replace("/(\\\){1}(to)/","<mo>\\RightArrow</mo>",$message);
$temp=preg_replace("/(\\\){1}(vec)\{([^}{]*)\}/",
"<mover accent=\"true\"><mrow>$3</mrow> <mo stretchy=\"true\">\\RightArrow</mo></mover>",$message);
if ($message!=$temp) {$message=editermaths($temp);}
$temp=preg_replace("/(\\\){1}(bar|overbar)\{([^}{]*)\}/",
"<mover accent=\"true\"><mrow>$3</mrow> <mo stretchy=\"true\">\\OverBar</mo></mover>",$message);
if ($message!=$temp) {$message=editermaths($temp);}
$temp=preg_replace("/(\\\){1}(overbrace)\{([^}{]*)\}/",
"<mover accent=\"true\"><mrow>$3</mrow> <mo stretchy=\"true\">\\OverBrace</mo></mover>",$message);
if ($message!=$temp) {$message=editermaths($temp);}
$temp=preg_replace("/(\\\){1}(underbrace)\{([^}{]*)\}/",
"<munder accentunder=\"true\"><mrow>$3</mrow> <mo stretchy=\"true\">\\UnderBrace</mo></munder>",$message);
if ($message!=$temp) {$message=editermaths($temp);}
$temp=preg_replace("/(\\\){1}(over)\{([^}{]*)\}\{([^}{]*)\}/",
"<mover><mrow>$3</mrow> <mrow>$4</mrow></mover>",$message);
if ($message!=$temp) {$message=editermaths($temp);}
$temp=preg_replace("/(\\\){1}(under)\{([^}{]*)\}\{([^}{]*)\}/",
"<munder><mrow>$3</mrow> <mrow>$4</mrow></munder>",$message);
if ($message!=$temp) {$message=editermaths($temp);}
$temp=preg_replace("/(\\\){1}(binomial)\{([^}{]*)\}\{([^}{]*)\}/",
"<mrow><mo><parenthese></mo><mfrac linethickness=\"0\"><mrow>$3</mrow><mrow>$4</mrow></mfrac><mo></parenthese></mo></mrow>",$message);
if ($message!=$temp) {$message=editermaths($temp);}
$temp=preg_replace("/(\\\){1}(text)\{([^}{]*)\}/","<mtext>$3</mtext>",$message);
if ($message!=$temp) {$message=editermaths($temp);}
$temp=preg_replace("/(\\\){1}(sqrt)\{([^}{]*)\}/","<msqrt>$3</msqrt>",$message);
if ($message!=$temp) {$message=editermaths($temp);}
$temp=preg_replace("/(\\\){1}(frac)\{([^}{]*)\}\{([^}{]*)\}/","<mfrac><mrow>$3</mrow> <mrow>$4</mrow></mfrac>",$message);
if ($message!=$temp) {$message=editermaths($temp);}
$message=preg_replace("/(\^\{[^}{]*\})(\_\{[^}{]*\})/","$2$1",$message);
$message=preg_replace("/(\^|\_)\{([^}{]*)\}/","$1<mrow>$2</mrow>",$message);
$message=preg_replace("/(\\\){1}(mathfrak)\{([^}{]{1})\}/","\\\\$3fr ",$message);
$message=preg_replace("/(\\\){1}(mathbb)\{([^}{]{1})\}/","\\\\$3opf ",$message);
$message=preg_replace("/(\\\){1}(mathcal)\{([^}{]{1})\}/","\\\\$3scr ",$message);
$message=preg_replace("/(\^.{1})(\_.{1})/","$2$1",$message);
$flag++;
}
$message=preg_replace("/(\{){1}([^{}]+)(\}){1}/e","'{'.editermaths(\"$2\").'}'",$message);
$message=editestring($message);
$message=indiceexposant($message);
// $message=preg_replace("/<msubsup><mo>(&#sum;|&#prod;)<\/mo>([^{}]*)<\/msubsup>/",
// "<munderover><mo>$1</mo>$2</munderover>",$message);
$message=preg_replace("/<mo>&#(sin|arcsin|cos|arccos|tan|arctan|ln|log|lim|min|max|inf|sup);<\/mo>/",
"<mi>$1</mi>",$message);
// $message=preg_replace("/<msub><mi>(lim|min|max|inf|sup)<\/mi>([^{}]*)<\/msub>/e",
// "'<munder><mi>$1</mi>'.chercherbf('<msub>','</msub>',\"$2\").'</munder>'.substr(\"$2\",strlen(chercherbf('<msub>','</msub>',\"$2\"))+7,strlen(\"$2\")).'</msub>'",$message);
$message=str_replace("<br />","",$message);
return $message;
}
function editer($message) {
// replace < and > by their html entities
$message=str_replace("<","&#lt;",$message);
$message=str_replace(">","&#gt;",$message);
// remove empty lines. Note that the pattern is not surrounded by delimiters. Why not?
$message=ereg_replace("(\n|\r){2}","\\1",$message);
// I don't understand (\\\) yet.
// <accolade> will be replaced by { again later
$message=preg_replace("/(\\\){1}(\{)/","<mo><accolade></mo>",$message);
$message=preg_replace("/(\\\){1}(\})/","<mo></accolade></mo>",$message);
// <quote/> will be replaced by ' later
$message=preg_replace("/(\')/","<quote/>",$message);
$message = nl2br($message);
// still have to find out the purpose of these flags. They must be there to make sure the expression to be
// converted is not to complicated and takes too much time.
$flag=0;
while($flag<200) {
$fflag=0;
while((ereg("$",$message)) && ($fflag<5)) {
// equations and displayed equations are converted with editermaths() and then wrapped
// this is the place to also deal with \( and \[
$message=preg_replace("/(\\$){2}([^$]+)(\\$){2}/e","'<div align=\"center\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\"><mstyle displaystyle=\"true\">'.editermaths(\"$2\").'</mstyle></math></div>'",$message);
$message=preg_replace("/(\\$){1}([^$]+)(\\$){1}/e","'<math xmlns=\"http://www.w3.org/1998/Math/MathML\">'.editermaths(\"$2\").'</math>'",$message);
$fflag++;
}
// table environment
$message=preg_replace("/(\\\){1}(begin)\{(ltabular)\}(\[([0-9]*)?\])?(<br \/>)?([^}{]*)(\\\){1}(end)\{(ltabular)\}/",
"\n<table border=\"$5\" width=\"100%\">\n<tr valign=\"center\"><td align=\"center\">\n$7\n</td></tr>\n</table>",$message);
$message=preg_replace("/(\\\){1}(begin)\{(tabular)\}(\[([0-9]*)?\])?(<br \/>)?([^}{]*)(\\\){1}(end)\{(tabular)\}/",
"<table border=\"$5\"><tr valign=\"center\"><td align=\"center\">$7</td></tr>\n</table>",$message);
// inside a table environment \\ at the end of the line should start a new row
// I think we need a safeguard so that this is not used outside a table environment
$message=preg_replace("/((\\\){2})(<br \/>)?/","</td></tr>\n<tr valign=\"center\"><td align=\"center\">",$message);
// inside a table environment & should start a new cell. I don't know what the # is for
$message=preg_replace("/(&)([^#])/","</td><td align=\"center\">$2",$message);
//remove empty table rows
$message=str_replace("<tr valign=\"center\"><td align=\"center\">\n</td></tr>\n</table>","</table>",$message);
// searches for all kinds of theorem style environments and prints their name in bold and the content in italics
// this should be translated to english
$message=preg_replace("/(\\\){1}(begin|debut)\{(théorème|définition|exemple|exemples|proposition|propriété|propriétés|exercice|exercices|démonstration|preuve)( ?[0-9]*)\}([^}{]*)(\\\){1}(end|fin)\{(théorème|définition|exemple|exemples|proposition|propriété|propriétés|exercice|exercices|démonstration|preuve)\}/e",
"'<b>'.ucwords(\"$3\").\"$4.\".'</b><i>'.\"$5\".'</i>'",$message);
$message=preg_replace("/(\\\){1}(color)\[([^}{]*)\]\{([^}{]*)\}/","<font color=\"$3\">$4</font>",$message);
// the following should look for \begin{flushleft} ,flushright,center instead. Also \centering
$message=preg_replace("/(\\\){1}(left)\{([^}{]*)\}/","<div align=\"left\">$3</div>",$message);
$message=preg_replace("/(\\\){1}(right)\{([^}{]*)\}/","<div align=\"right\">$3</div>",$message);
$message=preg_replace("/(\\\){1}(center)\{([^}{]*)\}/","<div align=\"center\">$3</div>",$message);
// text styles
// this should be changed because the tex syntax is {\bf } not \bf{ }
$message=preg_replace("/(\\\){1}(bf)\{([^}{]*)\}/","<b>$3</b>",$message);
$message=preg_replace("/(\\\){1}(it)\{([^}{]*)\}/","<i>$3</i>",$message);
$message=preg_replace("/(\\\){1}(ul)\{([^}{]*)\}/","<u>$3</u>",$message);
$message=preg_replace("/(\\\){1}(chapter)\{([^}{]*)\}/","<h1>$3</h1>",$message);
$message=preg_replace("/(\\\){1}(section)\{([^}{]*)\}/","<h2>$3</h2>",$message);
$message=preg_replace("/(\\\){1}(subsection)\{([^}{]*)\}/","<h3>$3</h3>",$message);
$message=preg_replace("/(\\\){1}(subsubsection)\{([^}{]*)\}/","<h4>$3</h4>",$message);
$message=preg_replace("/(\\\){1}(end)\{(itemize)\}/","</li></ul>",$message);
$message=preg_replace("/(\\\){1}(begin)\{(itemize)\}/","<ul>",$message);
$message=preg_replace("/(\\\){1}(end)\{(enumerate)\}/","</li></ol>",$message);
$message=preg_replace("/(\\\){1}(begin)\{(enumerate|enumerer)\}\[([1|a|A|i|I]?)\]/","<ol type=\"$4\">",$message);
$message=str_replace("\\item","</li><li>",$message);
$flag++;
}
// remove the extra </li> that the above will have introduced
$message=ereg_replace("(<ol type=\")(a|A|1|i|I)(\"><br />\n</li>)","<ol type=\"\\2\"><br />\n",$message);
$message=str_replace("<ul><br />\n</li>","<ul><br />\n",$message);
$message=str_replace("\\quad"," ",$message);
$message=str_replace("\\qquad"," ",$message);
$message=str_replace("&#","&",$message);
// put parentheses, braces and quotes back
$message=str_replace("<parenthese>","(",$message);
$message=str_replace("</parenthese>",")",$message);
$message=str_replace("<accolade>","{",$message);
$message=str_replace("</accolade>","}",$message);
$message=str_replace("<quote/>","'",$message);
// should ad umlauts
$message=preg_replace("/([éèëàçêûïâîôùÀÈÎÔÛÏÂ]{1})/e","htmlentities(\"$1\")",$message);
return $message;
}
?>
|
|
From: <ma...@us...> - 2003-09-21 21:02:45
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv15735/mod/math_assignment
Modified Files:
view.php
Log Message:
Implemented sorting in view.php. No UI yet.
Index: view.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/view.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** view.php 20 Sep 2003 15:56:02 -0000 1.9
--- view.php 21 Sep 2003 21:02:35 -0000 1.10
***************
*** 11,14 ****
--- 11,16 ----
optional_variable($q); // assignment ID
optional_variable($download, ""); // to download data
+ optional_variable($page, 1); // page to display
+ optional_variable($sort, "lastname ASC"); // column and direction to sort
if (! $site = get_site()) {
***************
*** 49,52 ****
--- 51,76 ----
$hasboth = ($hasaim and $haspaper);
+ // verify that the sort string is correct
+ $sort = explode(" ", $sort);
+ if (count($sort) != 2) {
+ $sort[0] = "lastname"; // not valid so use default instead
+ $sort[1] = "ASC";
+ }
+ $sortgrade = 0;
+ if (strcasecmp($sort[0], "lastname") != 0) { // check for field name in most likely used order
+ if (strcasecmp($sort[0], "firstname") != 0) { // to improve speed
+ if (strcasecmp($sort[0], "totalgrade") != 0)
+ $sort[0] = "lastname"; // not valid so use default instead
+ else if (strcasecmp($sort[1], "desc") == 0)
+ $sortgrade = -1;
+ else
+ $sortgrade = 1;
+ }
+ }
+ if (strcasecmp($sort[1], "asc") != 0 && strcasecmp($sort[1], "desc") != 0)
+ $sort[1] = "ASC"; // not valid so use default instead
+ if (!$sortgrade)
+ $sort = implode(" ", $sort);
+
$strfirstname = get_string("firstname");
$strlastname = get_string("lastname");
***************
*** 69,73 ****
// Get a list of all students
! if (!$students = get_course_students($course->id, "u.lastname ASC")) {
print_header("$course->shortname: $math_assignment->name", "$course->fullname",
"$navigation <a href=\"index.php?id=$course->id\">$strmath_assignments</a> -> $math_assignment->name",
--- 93,97 ----
// Get a list of all students
! if (!$students = get_course_students($course->id, $sortgrade ? "''" : "u.$sort")) {
print_header("$course->shortname: $math_assignment->name", "$course->fullname",
"$navigation <a href=\"index.php?id=$course->id\">$strmath_assignments</a> -> $math_assignment->name",
***************
*** 88,91 ****
--- 112,119 ----
$grades[$student->id]->aimcomment = "";
}
+ }
+
+ if ($sortgrade) { // we need to do the sorting ourselves
+ usort($students, create_function('$a,$b','global $math_assignment, $grades; return ((math_assignment_total_grade($math_assignment, $grades[$a->id]) < math_assignment_total_grade($math_assignment, $grades[$b->id])) ? -1 : 1) * ' . $sortgrade . ';'));
}
}
|
|
From: <mo...@us...> - 2003-09-20 21:51:30
|
Update of /cvsroot/aimmath/AIM/doc In directory sc8-pr-cvs1:/tmp/cvs-serv24350 Modified Files: AuthoringGuide.pdf Log Message: ...added some more... Index: AuthoringGuide.pdf =================================================================== RCS file: /cvsroot/aimmath/AIM/doc/AuthoringGuide.pdf,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 Binary files /tmp/cvsdbbBFK and /tmp/cvs66Fbio differ |
|
From: <mo...@us...> - 2003-09-20 21:46:12
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple
In directory sc8-pr-cvs1:/tmp/cvs-serv23763
Modified Files:
Random.mpl
Log Message:
modified the "Nice" commands to have the first argument processed by Rand
Index: Random.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/Random.mpl,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Random.mpl 20 Sep 2003 19:26:03 -0000 1.9
--- Random.mpl 20 Sep 2003 21:46:08 -0000 1.10
***************
*** 429,434 ****
`Nice/Monomial`::InertExpr,
"Produces a monomial of the form @a*x^n@ where @a@ is randomly selected from @arange@ and @n@ is randomly selected from @deg@ if those arguments are present. If @deg@ or @arange@ are not passed as arguments the default value is @1..3@ for both. The argument @x@ is mandatory and can be any algebraic expression or Inert Expression.",
! proc(x::{algebraic,InertExpr},deg,arange)
! local n,a,nr,ar;
# defaults
--- 429,436 ----
`Nice/Monomial`::InertExpr,
"Produces a monomial of the form @a*x^n@ where @a@ is randomly selected from @arange@ and @n@ is randomly selected from @deg@ if those arguments are present. If @deg@ or @arange@ are not passed as arguments the default value is @1..3@ for both. The argument @x@ is mandatory and can be any algebraic expression or Inert Expression.",
! proc(_x,deg,arange)
! local n,a,nr,ar,x;
!
! x:=Rand(_x);
# defaults
***************
*** 450,455 ****
`Nice/Binomial`::InertExpr,
"Produces a \"nice\" binomial from its arguments (which is more complicated than it sounds). If one looks through the problems assigned in a typical calculus or precalc book, one will notice that there are certain rules that authors tend to follow when designing \"nice\" questions. This procedure attempts to produce a \"nice\" random binomial in @x@ that is a sum of a monomial in @x@ and a constant term in a random order. The defaults for the degree of the monomial and the two coefficients can be overriden by supplying the appropriate arguments. The argument @x@ is mandatory and can be any algebraic expression or Inert Expression.",
! proc(x::{algebraic,InertExpr},deg,arange,brange)
! local n,a,b,nr,ar,br,i;
# defaults
--- 452,459 ----
`Nice/Binomial`::InertExpr,
"Produces a \"nice\" binomial from its arguments (which is more complicated than it sounds). If one looks through the problems assigned in a typical calculus or precalc book, one will notice that there are certain rules that authors tend to follow when designing \"nice\" questions. This procedure attempts to produce a \"nice\" random binomial in @x@ that is a sum of a monomial in @x@ and a constant term in a random order. The defaults for the degree of the monomial and the two coefficients can be overriden by supplying the appropriate arguments. The argument @x@ is mandatory and can be any algebraic expression or Inert Expression.",
! proc(_x,deg,arange,brange)
! local n,a,b,nr,ar,br,i,x;
!
! x:=Rand(_x);
# defaults
***************
*** 540,545 ****
`Nice/Trinomial`::InertExpr,
"Produces a \"nice\" trinomial in @x@. See #Nice/Binomial# for more info.",
! proc(x::{algebraic,InertExpr},deg,arange,brange,crange)
! local n,m,a,b,c,nr,ar,br,cr,i,typ;
# defaults
--- 544,551 ----
`Nice/Trinomial`::InertExpr,
"Produces a \"nice\" trinomial in @x@. See #Nice/Binomial# for more info.",
! proc(_x,deg,arange,brange,crange)
! local n,m,a,b,c,nr,ar,br,cr,i,typ,x;
!
! x:=Rand(_x);
# defaults
|
|
From: <mo...@us...> - 2003-09-20 19:26:07
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1:/tmp/cvs-serv861 Modified Files: Random.mpl Log Message: fixed a typo Index: Random.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/Random.mpl,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Random.mpl 12 Sep 2003 03:16:46 -0000 1.8 --- Random.mpl 20 Sep 2003 19:26:03 -0000 1.9 *************** *** 83,87 **** <LI>if the argument is of the form @Frac(n,d)@ then an improper fraction whose integer part is @Rand(n)@ and whose denominator is @Rand(d)@ is returned, i.e. if @N:=Rand(n)@, @M:=Rand(d)@, and @a:=Rand(1..M-1)@ then @(N*M+a)/M@ is returned. <LI>if the argument is @Null@, then @NULL@ is returned (i.e. @Rand(Null)@ returns @NULL@). ! <LI<Any other argument is simply returned. </OL> ", --- 83,87 ---- <LI>if the argument is of the form @Frac(n,d)@ then an improper fraction whose integer part is @Rand(n)@ and whose denominator is @Rand(d)@ is returned, i.e. if @N:=Rand(n)@, @M:=Rand(d)@, and @a:=Rand(1..M-1)@ then @(N*M+a)/M@ is returned. <LI>if the argument is @Null@, then @NULL@ is returned (i.e. @Rand(Null)@ returns @NULL@). ! <LI>Any other argument is simply returned. </OL> ", |
|
From: <gus...@us...> - 2003-09-20 19:13:48
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment/db
In directory sc8-pr-cvs1:/tmp/cvs-serv31283/mod/math_assignment/db
Modified Files:
mysql.php mysql.sql
Log Message:
There now is a new option "focus" which determines whether the aim quiz is shown with single question per page or multiple questions per page.
Index: mysql.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/db/mysql.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** mysql.php 18 Sep 2003 23:57:57 -0000 1.6
--- mysql.php 20 Sep 2003 19:13:43 -0000 1.7
***************
*** 7,36 ****
global $CFG;
! $return = true;
! if ($oldversion < 2003091500) {
! table_column("math_assignment_subject", "", "course");
! }
! if ($oldversion < 2003091616) {
! if (!execute_sql("ALTER TABLE `{$CFG->prefix}math_assignment` ADD `problemscompile` TINYINT(1) NOT NULL default '1' AFTER `problems`, ADD `solutionscompile` TINYINT(1) NOT NULL default '1' AFTER `solutions`"))
! $return = false;
! }
! 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;
! }
! 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;
}
--- 7,15 ----
global $CFG;
! if ($oldversion < 2003092001) {
! table_column("math_assignment", "", "focus", "tinyint", "1", "unsigned", "1");
}
!
! return true;
}
Index: mysql.sql
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/db/mysql.sql,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** mysql.sql 18 Sep 2003 23:57:57 -0000 1.5
--- mysql.sql 20 Sep 2003 19:13:43 -0000 1.6
***************
*** 5,23 ****
# that may be used, especially new entries in the table log_display
! CREATE TABLE `prefix_math_assignment` (
! `id` int(10) unsigned NOT NULL auto_increment,
! `course` int(10) unsigned NOT NULL default '0',
! `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',
! `aimquiz` varchar(255) NOT NULL default '',
! `papergrade` int(10) unsigned NOT NULL default '0',
! `aimgrade` int(10) unsigned NOT NULL default '0',
! `timedue` int(10) unsigned NOT NULL default '0',
! `timemodified` int(10) unsigned NOT NULL default '0',
! PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='Main information about each math assignment';
CREATE TABLE `prefix_math_assignment_subject` (
--- 5,26 ----
# that may be used, especially new entries in the table log_display
!
! CREATE TABLE mdl_math_assignment (
! id int(10) unsigned NOT NULL auto_increment,
! course int(10) unsigned NOT NULL default '0',
! 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',
! aimquiz varchar(255) NOT NULL default '',
! papergrade int(10) unsigned NOT NULL default '0',
! aimgrade int(10) unsigned NOT NULL default '0',
! timedue int(10) unsigned NOT NULL default '0',
! timemodified int(10) unsigned NOT NULL default '0',
! focus tinyint(3) unsigned NOT NULL default '1',
! PRIMARY KEY (id)
) TYPE=MyISAM COMMENT='Main information about each math assignment';
+
CREATE TABLE `prefix_math_assignment_subject` (
|
|
From: <gus...@us...> - 2003-09-20 19:13:47
|
Update of /cvsroot/aimmath/moodle/lang/en In directory sc8-pr-cvs1:/tmp/cvs-serv31283/lang/en Modified Files: math_assignment.php Log Message: There now is a new option "focus" which determines whether the aim quiz is shown with single question per page or multiple questions per page. Index: math_assignment.php =================================================================== RCS file: /cvsroot/aimmath/moodle/lang/en/math_assignment.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** math_assignment.php 19 Sep 2003 09:36:44 -0000 1.10 --- math_assignment.php 20 Sep 2003 19:13:43 -0000 1.11 *************** *** 16,19 **** --- 16,20 ---- $string['aimserverconfig'] = "AiM Server Configuration"; $string['aimserverplural'] = "AiM Servers"; + $string['aimstyle'] = "AiM Page Style"; $string['aimsubject'] = "AiM Subject"; $string['aimsubjectpasswd'] = "AiM Subject Password"; *************** *** 45,55 **** $string['or'] = "OR"; $string['outputchange'] = "Click here to change to"; ! $string['outputprobs'] = "Mathematics not displaying correctly? The page is currently being produced using"; $string['paper'] = "Paper"; $string['problems'] = "Problem sheet"; $string['marksheet'] = "Mark sheet"; ! $string['mathml'] = "XML with MathML"; $string['maxgrade'] = "Maximum Grade"; $string['maxgradepaperonly'] = "(paper-based hand-marked questions only)"; $string['name'] = "Name"; $string['newgrade'] = "Override Grade"; --- 46,58 ---- $string['or'] = "OR"; $string['outputchange'] = "Click here to change to"; ! $string['outputcurrent'] = "Moodle is currently using"; ! $string['outputprobs'] = "Mathematics not displaying correctly?"; $string['paper'] = "Paper"; $string['problems'] = "Problem sheet"; $string['marksheet'] = "Mark sheet"; ! $string['mathml'] = "MathML"; $string['maxgrade'] = "Maximum Grade"; $string['maxgradepaperonly'] = "(paper-based hand-marked questions only)"; + $string['multiplequestion'] = "multiple questions"; $string['name'] = "Name"; $string['newgrade'] = "Override Grade"; *************** *** 67,70 **** --- 70,74 ---- $string['reviewresults'] = "Review Results"; $string['serverinuse'] = "Error : Can not delete server as one or more assignments depend on it."; + $string['singlequestion'] = "single question"; $string['solutions'] = "Solution sheet"; $string['student_password'] = "Student AiM Password"; |
|
From: <gus...@us...> - 2003-09-20 19:13:47
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv31283/mod/math_assignment
Modified Files:
aimpage.php mod.html version.php
Log Message:
There now is a new option "focus" which determines whether the aim quiz is shown with single question per page or multiple questions per page.
Index: aimpage.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/aimpage.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** aimpage.php 20 Sep 2003 14:50:27 -0000 1.9
--- aimpage.php 20 Sep 2003 19:13:43 -0000 1.10
***************
*** 99,102 ****
--- 99,106 ----
$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);
+ $postdata = math_assignment_add_arg_to_url_data($postdata, "FocusLabel", "1");
+ $postdata = math_assignment_add_arg_to_url_data($postdata, "OldFocusLabel", "");
+ $focus = ($math_assignment) ? "true" : "false";
+ $postdata = math_assignment_add_arg_to_url_data($postdata, "Focused", $focus);
}
}
Index: mod.html
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/mod.html,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** mod.html 19 Sep 2003 08:36:18 -0000 1.15
--- mod.html 20 Sep 2003 19:13:43 -0000 1.16
***************
*** 29,32 ****
--- 29,35 ----
$form->aimquiz = "";
}
+ if (!isset($form->aimfocus)) {
+ $form->aimfocus = 1;
+ }
if (!isset($form->papergrade)) {
$form->papergrade = 10;
***************
*** 75,78 ****
--- 78,82 ----
$straimsubject = get_string("aimsubject","math_assignment");
$straimquiz = get_string("aimquiz","math_assignment");
+ $straimstyle = get_string("aimstyle","math_assignment");
?>
***************
*** 226,231 ****
</td>
</tr>
- </td>
- </tr>
<?php
--- 230,233 ----
***************
*** 233,238 ****
?>
<tr valign="top">
! <td align="right"><p><b><?php echo $straimquiz; ?>:</b></p></td>
! <td>
<input type="text" name="aimquiz" size="40" maxlength="255" value="<?php p($form->aimquiz); ?>" />
<?php
--- 235,240 ----
?>
<tr valign="top">
! <td align="right"><p><b><?php echo $straimquiz; ?>:</b></p></td>
! <td>
<input type="text" name="aimquiz" size="40" maxlength="255" value="<?php p($form->aimquiz); ?>" />
<?php
***************
*** 241,245 ****
target=\"subject\">AiM administration</a>";
?>
! </td>
</tr>
<?php
--- 243,259 ----
target=\"subject\">AiM administration</a>";
?>
! </td>
! </tr>
! <tr>
! <td align="right"><p><b><?php echo $straimstyle; ?>:</b></p></td>
! <td>
! <input type="radio" name="focus" value="1" <?php p($form->focus ? "checked" : "") ?> />
! <?php p(get_string("singlequestion","math_assignment")) ?>
! <input type="radio" name="focus" value="0" <?php p($form->focus ? "" : "checked") ?> />
! <?php
! p(get_string("multiplequestion","math_assignment"));
! helpbutton("addupdate_style", $straimstyle, "math_assignment");
! ?>
! </td>
</tr>
<?php
Index: version.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/version.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** version.php 18 Sep 2003 23:57:57 -0000 1.4
--- version.php 20 Sep 2003 19:13:43 -0000 1.5
***************
*** 6,10 ****
/////////////////////////////////////////////////////////////////////////////////
! $module->version = 2003091900; // The (date) version of this module
$module->cron = 0; // How often should cron check this module (seconds)?
--- 6,10 ----
/////////////////////////////////////////////////////////////////////////////////
! $module->version = 2003092001; // The (date) version of this module
$module->cron = 0; // How often should cron check this module (seconds)?
|
|
From: <mo...@us...> - 2003-09-20 16:30:57
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim
In directory sc8-pr-cvs1:/tmp/cvs-serv3273
Modified Files:
Decimal.mpl TextQuestion.mpl
Log Message:
changed validation to allow a subtype of type string to be specified at the c> flag (without AiM trying to parse the student's answer)
Index: Decimal.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Decimal.mpl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Decimal.mpl 1 Sep 2003 05:55:59 -0000 1.1
--- Decimal.mpl 20 Sep 2003 16:30:44 -0000 1.2
***************
*** 29,42 ****
`Package/Assign`(
! `type/RepeatingDecimal`::boolean,
! "Returns @true@ if the argument is a string and @`Decimal/isRepeating`(a)@ evaluates to @true@",
proc(a::anything)
! if type(a,string) and `Decimal/isRepeating`(a) then
! true
! else
! false
! fi
end
):
`Package/Assign`(
--- 29,44 ----
`Package/Assign`(
! `type/_RepeatingDecimal`::boolean,
! "",
proc(a::anything)
! return evalb(type(a,string) and `Decimal/isRepeating`(a))
end
):
+
+ `Package/Assign`(
+ `type/RepeatingDecimal`::type,
+ "Returns @true@ if the argument is a string and @`Decimal/isRepeating`(a)@ evaluates to @true@",
+ And(string,_RepeatingDecimal)
+ ):
`Package/Assign`(
Index: TextQuestion.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/TextQuestion.mpl,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TextQuestion.mpl 27 Aug 2003 22:34:38 -0000 1.4
--- TextQuestion.mpl 20 Sep 2003 16:30:44 -0000 1.5
***************
*** 356,360 ****
rawans := attempt['RawAnswer'];
! if reqtype = string then
# don't allow the empty string to be valid or it will cause
# a penalty to be given if the student answers it correctly
--- 356,363 ----
rawans := attempt['RawAnswer'];
! # KM
! # WAS: if reqtype = string then
! if subtype(reqtype,string) then
! # END
# don't allow the empty string to be valid or it will cause
# a penalty to be given if the student answers it correctly
***************
*** 362,365 ****
--- 365,388 ----
# request for the quiz to be marked
if rawans = "" then attempt['IsValid']:=false; RETURN(false) fi;
+ # KM
+ # check that the string matches the required type in the case
+ # where the user has specified a subtype of type string
+ if (not(type(rawans,reqtype))) then
+ attempt['ValidationNote'] := __("wrong type");
+ attempt['ValidationMessage'] :=
+ cat(
+ "<font color='red'>",
+ `aim/HelpLink`(__("Wrong type"),"types"),
+ "</font>\n<br/>\n",
+ __("Your answer should have type"),
+ "\n<br/>\n<font color='blue'><tt>",
+ sprintf("%A",reqtype),
+ "</font></tt>\n<br/>\n",
+ __("but it does not."),
+ "\n<br/>\n");
+ attempt['IsValid'] := false;
+ RETURN(false);
+ fi;
+ # END KM
attempt['Answer'] := rawans;
RETURN(true);
|
|
From: <gus...@us...> - 2003-09-20 15:56:07
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv30557/mod/math_assignment
Modified Files:
view.php
Log Message:
now prints paper grades only if the maximum pagergrade is >0 and similarly for computer grades.
Index: view.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/view.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** view.php 19 Sep 2003 13:52:53 -0000 1.8
--- view.php 20 Sep 2003 15:56:02 -0000 1.9
***************
*** 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,51 ----
add_to_log($course->id, "math_assignment", "view", "view.php?id=$cm->id", "$math_assignment->id");
! $hasaim = ($math_assignment->aimgrade > 0);
! $haspaper = ($math_assignment->papergrade > 0);
! $hasboth = ($hasaim and $haspaper);
$strfirstname = get_string("firstname");
***************
*** 120,125 ****
$myxls->InsertText($strfirstname);
$myxls->InsertText($strlastname);
! $myxls->InsertText("$strpaper $strgrade");
! if ($hasaim) $myxls->InsertText("$strcomputer $strgrade");
$myxls->InsertText("$strtotal $strgrade");
--- 122,129 ----
$myxls->InsertText($strfirstname);
$myxls->InsertText($strlastname);
! if ($hasboth) {
! $myxls->InsertText("$strpaper $strgrade");
! $myxls->InsertText("$strcomputer $strgrade");
! }
$myxls->InsertText("$strtotal $strgrade");
***************
*** 134,146 ****
$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));
--- 138,150 ----
$myxls->InsertText($student->firstname);
$myxls->InsertText($student->lastname);
! if ($hasboth) {
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));
***************
*** 161,165 ****
echo "$strfirstname\t$strlastname\t";
! if ($hasaim)
echo "$strpaper $strgrade\t$strcomputer $strgrade\t$strtotal $strgrade\n";
else
--- 165,169 ----
echo "$strfirstname\t$strlastname\t";
! if ($hasboth)
echo "$strpaper $strgrade\t$strcomputer $strgrade\t$strtotal $strgrade\n";
else
***************
*** 171,180 ****
$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";
}
--- 175,184 ----
$student = $students[$studentid];
echo "$student->firstname\t$student->lastname\t";
! if ($hasboth) {
if ($studentgrade->papergrade >= 0)
! echo "$studentgrade->papergrade";
echo "\t";
if ($studentgrade->aimgrade >= 0)
! echo "$studentgrade->aimgrade";
echo "\t";
}
***************
*** 202,206 ****
echo "<tr><th>$strfirstname</th><th>$strlastname</th>";
! if ($hasaim)
echo "<th>AiM<br>$strgrade</th><th>$strpaper<br>$strgrade</th>";
else
--- 206,210 ----
echo "<tr><th>$strfirstname</th><th>$strlastname</th>";
! if ($hasboth)
echo "<th>AiM<br>$strgrade</th><th>$strpaper<br>$strgrade</th>";
else
***************
*** 213,224 ****
$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>";
--- 217,228 ----
$student = $students[$studentid];
echo "<tr><td height=\"40\">$student->firstname</td><td>$student->lastname</td>";
! if ($hasboth) {
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>";
***************
*** 226,231 ****
else {
echo "<td>";
! if ($studentgrade->aimgrade >= 0)
! echo "$studentgrade->aimgrade";
else echo " ";
echo "</td>";
--- 230,235 ----
else {
echo "<td>";
! if (math_assignment_total_grade($math_assignment, $studentgrade) >= 0)
! echo math_assignment_total_grade($math_assignment, $studentgrade);
else echo " ";
echo "</td>";
***************
*** 265,296 ****
$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");
}
}
--- 269,303 ----
$inbox = true;
}
! if ($haspaper) {
echo "<b>$strpaper $strgrade :</b> ";
if ($grade->papergrade >= 0)
! echo "$grade->papergrade / $math_assignment->papergrade";
else
! print_string("notmarked", "math_assignment");
! echo "<br />";
! }
! if ($hasaim) {
! echo "<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 />";
}
! if ($hasboth) {
! $totalgrade = math_assignment_total_grade($math_assignment, $grade);
! echo "<b>$strtotal $strgrade :</b> ";
! if ($totalgrade >= 0)
! echo " $totalgrade / $totalmax";
else
! print_string("notmarked", "math_assignment");
}
}
***************
*** 301,305 ****
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");
--- 308,312 ----
echo math_assignment_get_admin_links($cm, $math_assignment, "right");
print_heading($strgrades);
! if ($hasboth) {
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");
***************
*** 323,350 ****
$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++;
}
--- 330,364 ----
$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 ($hasboth)
! $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 if ($haspaper)
! $table->data[] = array($picture, $student->firstname, $student->lastname, $papergrade);
! else if ($hasaim)
! $table->data[] = array($picture, $student->firstname, $student->lastname,
! "$aimgrade $edited<a href=\"editgrade.php?id=$math_assignment->id&userid=$student->id\">$stredit</a>$editedclose");
!
$i++;
}
***************
*** 367,374 ****
$options["download"] = "txt";
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>";
--- 381,392 ----
$options["download"] = "txt";
print_single_button("view.php", $options, get_string("downloadtext"));
! echo "</td>";
! if ($haspaper) {
! echo "<td>";
! $options["download"] = "marksheet";
! print_single_button("view.php", $options, get_string("marksheet","math_assignment"));
! echo "</td>";
! }
! echo "<td>";
helpbutton ("downloadgrades", "$strgrades", "math_assignment");
echo "</td></tr></table>";
***************
*** 383,389 ****
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>";
--- 401,407 ----
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: <gus...@us...> - 2003-09-20 14:50:30
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv20182/mod/math_assignment
Modified Files:
aimpage.php
Log Message:
changed layout for output problem box
Index: aimpage.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/aimpage.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** aimpage.php 18 Sep 2003 23:57:57 -0000 1.8
--- aimpage.php 20 Sep 2003 14:50:27 -0000 1.9
***************
*** 186,213 ****
}
// print output problems box
if (function_exists('editer')) {
- echo "<center>";
print_simple_box_start();
- echo "<p align=\"center\">";
- print_string("outputprobs", "math_assignment");
- echo " ";
- print_string($usexml ? "mathml" : "html", "math_assignment");
- echo ".<br />\n";
echo "<form name=\"output_change\" action=\"aimpage.php?id=$cm->id\" method=\"post\">\n";
echo "<input type=\"hidden\" name=\"outputchange\" value=\"" . ($usexml ? "html" : "xml") . "\" />\n";
echo "<input type=\"hidden\" name=\"postdata\" value=\"" . htmlspecialchars($postdata) . "\" />\n";
echo "<a href=\"javascript:document.output_change.submit();\">";
print_string("outputchange", "math_assignment");
echo " ";
print_string($usexml ? "html" : "mathml", "math_assignment");
! echo "</a>.\n</form></p>\n";
print_simple_box_end();
- echo "</center>\n";
}
// write admin links
if (isteacher($course->id))
echo math_assignment_get_admin_links($cm, $math_assignment, "right");
if (isset($debug)) {
--- 186,218 ----
}
+ // put output problems box and admin links side by side
+ echo "<table width=\"100%\"><tr><td align=\"left\">";
+
// print output problems box
if (function_exists('editer')) {
print_simple_box_start();
echo "<form name=\"output_change\" action=\"aimpage.php?id=$cm->id\" method=\"post\">\n";
echo "<input type=\"hidden\" name=\"outputchange\" value=\"" . ($usexml ? "html" : "xml") . "\" />\n";
echo "<input type=\"hidden\" name=\"postdata\" value=\"" . htmlspecialchars($postdata) . "\" />\n";
+ print_string("outputprobs", "math_assignment");
+ echo "<br />";
+ print_string("outputcurrent", "math_assignment");
+ echo " ";
+ print_string($usexml ? "mathml" : "html", "math_assignment");
+ echo "<br />\n";
echo "<a href=\"javascript:document.output_change.submit();\">";
print_string("outputchange", "math_assignment");
echo " ";
print_string($usexml ? "html" : "mathml", "math_assignment");
! echo "</a>\n";
! echo "</form>";
print_simple_box_end();
}
+ echo "</td><td align=\"right\">";
// write admin links
if (isteacher($course->id))
echo math_assignment_get_admin_links($cm, $math_assignment, "right");
+ echo "</td></tr></table>";
if (isset($debug)) {
***************
*** 255,257 ****
print_footer($course);
! ?>
\ No newline at end of file
--- 260,262 ----
print_footer($course);
! ?>
|
|
From: <gus...@us...> - 2003-09-20 14:49:10
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv20002/mod/math_assignment
Modified Files:
lib.php
Log Message:
removed pdf output function which is now in pdfgen.php
Index: lib.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/lib.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** lib.php 18 Sep 2003 23:57:57 -0000 1.14
--- lib.php 20 Sep 2003 14:49:06 -0000 1.15
***************
*** 777,876 ****
}
- function math_assignment_pdf($math_assignment, $course, $data, $solutions="true") {
- /// Function which extracts the latex from the AiM quiz page and converts it to pdf
- /// This is not yet complete. In particular figures are ignored.
- /// The strategy is:
- /// 1) use regexps to convert anything on the quiz page that
- /// we want to keep into latex,
- /// 2) collect all the latex together
- /// 3) pass it through pdflatex
-
- $latex = "\\documentclass[12pt]{article}\n
- \\usepackage{amsmath}\n
- \\begin{document}\n
- \\begin{center}
- {\\bf " . $course->fullname . ": " . $aim_quiz->name . "}
- \\end{center}";
-
- //echo htmlentities($data);
-
- // 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
- //$data = preg_replace("/class=\"lastanswer\"[\s\S]*?((?=class=\"rightanswer)|$)/",
- // "<latex>\n\n\\noindent{\\bf Right Answer:}\n\n</latex>",$data);
- $data = preg_replace("/class=\"lastanswer/",
- "<latex>\n\n\\noindent{\\bf Your Answer: }</latex>",$data);
- $data = preg_replace("/Your last answer was ([A-Z])/",
- "<latex>$1</latex>",$data);
-
- $data = preg_replace("/class=\"rightanswer/",
- "<latex>\n\n\\noindent{\\bf Right Answer: }</latex>",$data);
- $data = preg_replace("/The correct answer is ([A-Z])/",
- "<latex>$1</latex>",$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}";
-
- // Write latex to disk and then convert to pdf
- // The use of the temp file needs to be changed
- $fp=fopen("temp.tex","w");
- fwrite($fp,$latex);
- fclose($fp);
- exec("pdflatex -interaction=batchmode temp.tex");
-
- // The following should be changed to load temp.pdf into a separate window
- redirect("temp.pdf");
-
- return true;
- }
?>
--- 777,780 ----
|
|
From: <ma...@us...> - 2003-09-19 20:22:48
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv19418/mod/math_assignment
Modified Files:
view.php
Log Message:
Improved the html for the marksheet
Index: view.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/view.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** view.php 19 Sep 2003 09:36:44 -0000 1.7
--- view.php 19 Sep 2003 13:52:53 -0000 1.8
***************
*** 186,195 ****
} 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>";
--- 186,205 ----
} else if ($download == "marksheet") { // display marksheet table, ready for printing
!
! ?>
!
! <!doctype html public \"-//w3c//dtd html 4.0 transitional//en\">
! <html>
! <head>
! <title>Marksheet for <?php echo "$course->shortname, $math_assignment->name"; ?></title>
! </head>
! <body bgcolor="#FFFFFF" text="#000000"><b>Marksheet for <?php echo $course->shortname; ?><br><?php echo $math_assignment->name; ?><b><p>
! <table border="1">
!
! <?php
/// Print names of all the fields
! echo "<tr><th>$strfirstname</th><th>$strlastname</th>";
!
if ($hasaim)
echo "<th>AiM<br>$strgrade</th><th>$strpaper<br>$strgrade</th>";
|
|
From: <mo...@us...> - 2003-09-19 20:21:27
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple
In directory sc8-pr-cvs1:/tmp/cvs-serv4298
Modified Files:
Console.mpl
Log Message:
added two debugging utilities: ShowTable and ShowTableProc
Index: Console.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/Console.mpl,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Console.mpl 30 Aug 2003 21:01:45 -0000 1.4
--- Console.mpl 19 Sep 2003 04:08:00 -0000 1.5
***************
*** 144,148 ****
elif assigned(p["Dir"]) and assigned(p["QuestionName"]) then
questionfile := cat(subject['RootDir'],"/",p["Dir"],"/questions/",
! p["QuestionName"],".m"):
question := traperror(eval(AimCache['Load',questionfile]));
if question = lasterror then
--- 144,148 ----
elif assigned(p["Dir"]) and assigned(p["QuestionName"]) then
questionfile := cat(subject['RootDir'],"/",p["Dir"],"/questions/",
! p["QuestionName"],".m"):
question := traperror(eval(AimCache['Load',questionfile]));
if question = lasterror then
***************
*** 361,362 ****
--- 361,460 ----
`aim/AssignedNames`;
end:
+
+ ######################################################################
+ #
+ # AIM classes are Maple tables, and often have entries which are
+ # themselves tables or lists of tables. Maple does a poor job of
+ # formatting them when you ask it to print them (it wordwraps
+ # everything). This routine prints any Maple table in a
+ # more structured manner to aid in debugging.
+ #
+ # Syntax: ShowTable(T)
+ # - prints any expression T. The other two arguments are used
+ # internally by the routine and normally should be ommitted
+ # by the user. The bodies of procedures are omitted.
+ #
+ ShowTable:=proc(T,_indent,startonnewline)
+ local i,indent,spaces;
+
+ indent:=0;
+ if nargs>1 then indent:=_indent; fi;
+ spaces:=cat(" "$indent);
+ if nargs>2 then
+ printf(cat("\n",spaces));
+ fi:
+
+ if type(T,procedure) then
+ ShowTable("proc() ... end");
+ elif type(T,list) then
+ if hastype(T,table) then
+ ShowTable("[");
+ for i to nops(T)-1 do
+ ShowTable(T[i],indent+2,true);
+ printf(",");
+ od:
+ ShowTable(T[-1],indent+2,true);
+ ShowTable("]",indent,true);
+ else
+ ShowTable(sprintf("%a",T));
+ fi:
+ elif type(T,table) then
+ ShowTable("table(");
+ for i in [indices(T)] do
+ ShowTable(sprintf("%a = ",op(i)),indent+2,true);
+ ShowTable(T[op(i)],indent+2);
+ od;
+ ShowTable(")",indent,true);
+ else
+ if type(T,string) then
+ printf("%s",T);
+ else
+ printf("%a",T);
+ fi:
+ fi:
+ end:
+
+ ######################################################################
+ #
+ # ShowTableProc(T) is exactly the same as ShowTable, except that the
+ # bodies of procedures are not ommitted when printing T
+ #
+ ShowTableProc:=proc(T,_indent,startonnewline)
+ local i,indent,spaces;
+
+ indent:=0;
+ if nargs>1 then indent:=_indent; fi;
+ spaces:=cat(" "$indent);
+ if nargs>2 then
+ printf(cat("\n",spaces));
+ fi:
+
+ if type(T,procedure) then
+ print(T);
+ elif type(T,list) then
+ if hastype(T,table) then
+ ShowTableProc("[");
+ for i to nops(T)-1 do
+ ShowTableProc(T[i],indent+2,true);
+ printf(",");
+ od:
+ ShowTableProc(T[-1],indent+2,true);
+ ShowTableProc("]",indent,true);
+ else
+ ShowTableProc(sprintf("%a",T));
+ fi:
+ elif type(T,table) then
+ ShowTableProc("table(");
+ for i in [indices(T)] do
+ ShowTableProc(sprintf("%a = ",op(i)),indent+2,true);
+ ShowTableProc(T[op(i)],indent+2);
+ od;
+ ShowTableProc(")",indent,true);
+ else
+ if type(T,string) then
+ printf("%s",T);
+ else
+ printf("%a",T);
+ fi:
+ fi:
+ end:
|
|
From: <mo...@us...> - 2003-09-19 20:21:23
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim
In directory sc8-pr-cvs1:/tmp/cvs-serv4786
Modified Files:
Compile.mpl Inert.mpl LaTeX.mpl SET.mpl SyntaxHints.mpl
Test.mpl
Log Message:
several bug fixes and tweaks to improve handling of SET's and Inerts representing SETs
Index: Compile.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Compile.mpl,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Compile.mpl 30 Aug 2003 21:04:04 -0000 1.6
--- Compile.mpl 19 Sep 2003 04:11:15 -0000 1.7
***************
*** 400,404 ****
nam,flagnum,lines]);
fi;
! setans := sprintf("questionversion['RightAnswer'] := %s;\n",text);
printvar := "postamble_";
##########
--- 400,407 ----
nam,flagnum,lines]);
fi;
! # KM Change this so it evals the teacher's answer in case a table is submitted
! # WAS: setans := sprintf("questionversion['RightAnswer'] := %s;\n",text);
! setans := sprintf("questionversion['RightAnswer'] := eval(%s);\n",text);
! # END KM
printvar := "postamble_";
##########
***************
*** 611,615 ****
RETURN([cat(__("Problem while parsing answer test:"),
sprintf("\n<br/>\n%s\n<br/><br/>\n%s\n<br/><br/>\n",
! err[1],err[3])),
nam,atestflagnum,lines]);
fi;
--- 614,618 ----
RETURN([cat(__("Problem while parsing answer test:"),
sprintf("\n<br/>\n%s\n<br/><br/>\n%s\n<br/><br/>\n",
! err[1],err[3])),
nam,atestflagnum,lines]);
fi;
***************
*** 881,886 ****
##########
elif member(flag, {"value>","penalty>","answer>","answertest>",
! "answervariable>","prompt>","postprompt>",
! "mapletype>","forbid>"}) then
RETURN([sprintf(__("%s flag is not allowed for multipart questions."),flag)
,nam,flagnum,lines]);
--- 884,889 ----
##########
elif member(flag, {"value>","penalty>","answer>","answertest>",
! "answervariable>","prompt>","postprompt>",
! "mapletype>","forbid>"}) then
RETURN([sprintf(__("%s flag is not allowed for multipart questions."),flag)
,nam,flagnum,lines]);
***************
*** 1581,1590 ****
proc(f)
local f_inert,params,locals,optseq,remtab,
! stats,desc,globals,lexseq,param;
f_inert := ToInert(eval(f));
if not(type(f_inert,function) and
! op(0,f_inert) = _Inert_PROC) then
error("Argument is not a procedure");
fi;
--- 1584,1593 ----
proc(f)
local f_inert,params,locals,optseq,remtab,
! stats,desc,globals,lexseq,param;
f_inert := ToInert(eval(f));
if not(type(f_inert,function) and
! op(0,f_inert) = _Inert_PROC) then
error("Argument is not a procedure");
fi;
***************
*** 1626,1630 ****
_Inert_EXPSEQ(
_Inert_UNEVAL(
! _Inert_NAME("Answer"))))),
op(stats),
_Inert_ASSIGN(
--- 1629,1633 ----
_Inert_EXPSEQ(
_Inert_UNEVAL(
! _Inert_NAME("Answer"))))),
op(stats),
_Inert_ASSIGN(
***************
*** 1692,1700 ****
return(
_Inert_ASSIGN(
! _Inert_TABLEREF(
! _Inert_PARAM(1),
! _Inert_EXPSEQ(
! _Inert_UNEVAL(_Inert_NAME("RawMark")))),
! op(op(2,x))),
_Inert_RETURN(_Inert_NAME("NULL")));
fi;
--- 1695,1703 ----
return(
_Inert_ASSIGN(
! _Inert_TABLEREF(
! _Inert_PARAM(1),
! _Inert_EXPSEQ(
! _Inert_UNEVAL(_Inert_NAME("RawMark")))),
! op(op(2,x))),
_Inert_RETURN(_Inert_NAME("NULL")));
fi;
***************
*** 1744,1754 ****
proc(vars::list(string),f)
local f_inert,params,locals,optseq,remtab,stats,desc,
! globals,lexseq,globalnames,newglobals,newlocals,
! transtable,i,j,loc,nam;
f_inert := ToInert(eval(f));
if not(type(f_inert,function) and
! op(0,f_inert) = _Inert_PROC) then
error("Second argument is not a procedure");
fi;
--- 1747,1757 ----
proc(vars::list(string),f)
local f_inert,params,locals,optseq,remtab,stats,desc,
! globals,lexseq,globalnames,newglobals,newlocals,
! transtable,i,j,loc,nam;
f_inert := ToInert(eval(f));
if not(type(f_inert,function) and
! op(0,f_inert) = _Inert_PROC) then
error("Second argument is not a procedure");
fi;
Index: Inert.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Inert.mpl,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Inert.mpl 12 Sep 2003 03:16:07 -0000 1.5
--- Inert.mpl 19 Sep 2003 04:11:15 -0000 1.6
***************
*** 269,278 ****
G['NeedsParentheses'] and
F['Precedence']>G['Precedence'] then
! ParenArgs:=ParenArgs,cat("\\left(",i['TeX'],"\\right)")
else
! ParenArgs:=ParenArgs,i['TeX'];
fi:
else
! ParenArgs:=ParenArgs,i;
fi:
od:
--- 269,278 ----
G['NeedsParentheses'] and
F['Precedence']>G['Precedence'] then
! ParenArgs:=eval(ParenArgs),cat("\\left(",i['TeX'],"\\right)")
else
! ParenArgs:=eval(ParenArgs),i['TeX'];
fi:
else
! ParenArgs:=eval(ParenArgs),eval(i);
fi:
od:
***************
*** 1047,1054 ****
"The Inert Set function (represents a SET object).",
`new/Inert`(`new/SET`, # Map
! proc() # TeX
! cat("\\left\\{",TeX(args),"\\right\\}");
! end,
! -1, # Nargs
'anything', # Domain
"SET", # Name
--- 1047,1056 ----
"The Inert Set function (represents a SET object).",
`new/Inert`(`new/SET`, # Map
! proc() # TeX
! cat("\\left\\{",
! TeX(args),
! "\\right\\}")
! end,
! -1, # Nargs
'anything', # Domain
"SET", # Name
***************
*** 1067,1072 ****
"The Inert Set function (represents a SET object).",
`new/Inert`(`SET/Union`, # Map
! proc() # TeX
! cat(TeX(args[1]),seq(cat("\\cup{}",TeX(args[i])),i=2..nargs))
end,
-1, # Nargs
--- 1069,1076 ----
"The Inert Set function (represents a SET object).",
`new/Inert`(`SET/Union`, # Map
! proc() # TeX
! if nargs=0 then "\\{\\}" else
! cat(TeX(args[1]),seq(cat("\\cup{}",TeX(args[i])),i=2..nargs))
! fi:
end,
-1, # Nargs
Index: LaTeX.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/LaTeX.mpl,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** LaTeX.mpl 15 Sep 2003 16:17:56 -0000 1.11
--- LaTeX.mpl 19 Sep 2003 04:11:15 -0000 1.12
***************
*** 509,515 ****
else
# KM
! # Make the LaTeX command aware of InertExpr objects and how to format them
if type(eval(e),InertExpr) then
texlist := [e['TeX']];
else
# end KM
--- 509,520 ----
else
# KM
! # Make the LaTeX command aware of InertExpr and SET objects
! # and how to format them
if type(eval(e),InertExpr) then
texlist := [e['TeX']];
+ elif type(eval(e),'SET') then
+ texlist := ["\\left\\{",
+ `Util/CommaJoin`(op(map(`aim/LaTeX`,[op(e['Elements'])]))),
+ "\\right\\}"];
else
# end KM
Index: SET.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/SET.mpl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SET.mpl 12 Sep 2003 03:16:07 -0000 1.2
--- SET.mpl 19 Sep 2003 04:11:15 -0000 1.3
***************
*** 87,92 ****
`SET/isEqual`::boolean,
"Returns true if the set represented by SET @A@ equals the set represented by SET @B@ (order of elements doesn't matter).",
! proc(A::SET,B::SET)
! evalb(A['toSet']=B['toSet']);
end
):
--- 87,95 ----
`SET/isEqual`::boolean,
"Returns true if the set represented by SET @A@ equals the set represented by SET @B@ (order of elements doesn't matter).",
! proc(A::{SET,set},B::{SET,set})
! local a,b;
! a:=`if`(type(A,SET),A['toSet'],A);
! b:=`if`(type(B,SET),B['toSet'],B);
! evalb(a=b);
end
):
***************
*** 132,138 ****
goodguy:=true;
for k from 2 to nargs do
! if not `SET/isMember`(j,B) then goodguy:=false; break; fi
od:
! if goodguy then L:=L,j fi;
od:
eval(`new/SET`(L));
--- 135,141 ----
goodguy:=true;
for k from 2 to nargs do
! if not `SET/isMember`(x,B) then goodguy:=false; break; fi
od:
! if goodguy then L:=L,x fi;
od:
eval(`new/SET`(L));
Index: SyntaxHints.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/SyntaxHints.mpl,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** SyntaxHints.mpl 1 Sep 2003 05:55:59 -0000 1.4
--- SyntaxHints.mpl 19 Sep 2003 04:11:15 -0000 1.5
***************
*** 1011,1015 ****
"Return a string that a student could type to enter @e@",
proc(e::anything)
! local s;
if nargs = 0 then
"";
--- 1011,1015 ----
"Return a string that a student could type to enter @e@",
proc(e::anything)
! local s,x;
if nargs = 0 then
"";
***************
*** 1023,1026 ****
--- 1023,1030 ----
e;
# KM
+ elif type(e,SET) then
+ cat("{",
+ `Util/CommaJoin`(op(map(`aim/EntryHint`,e['Elements']))),
+ "}");
elif type(e,InertExpr) then
`aim/EntryHint`(Value(e));
Index: Test.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Test.mpl,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Test.mpl 1 Sep 2003 05:55:59 -0000 1.4
--- Test.mpl 19 Sep 2003 04:11:15 -0000 1.5
***************
*** 100,107 ****
`Package/Assign`(
`aim/TestSET`::boolean,
! "Return @true@ if both arguments are @SET@ objects and #`SET/isEqual`# determines they represent the same set. Returns false otherwise.
",
proc(ans::anything,rightans::anything)
! if type(ans,SET) and type(rightans,SET) then
return `SET/isEqual`(ans,rightans);
else
--- 100,108 ----
`Package/Assign`(
`aim/TestSET`::boolean,
! "Return @true@ if @rightans@ is a @SET@, @ans@ is a @SET@ or a @set@
! and they represent the same set. Returns false otherwise.
",
proc(ans::anything,rightans::anything)
! if type(ans,{SET,set}) and type(rightans,SET) then
return `SET/isEqual`(ans,rightans);
else
|
|
From: <ma...@us...> - 2003-09-19 20:13:54
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv17637/mod/math_assignment
Modified Files:
saveconfig.php
Log Message:
Minor bug fix
Index: saveconfig.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/saveconfig.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** saveconfig.php 19 Sep 2003 00:01:10 -0000 1.1
--- saveconfig.php 19 Sep 2003 13:41:37 -0000 1.2
***************
*** 41,47 ****
$result = true;
foreach ($subjects as $course => $subject) {
! $subject->course = $course;
! if (!insert_record("math_assignment_subject", $subject))
! $return = false;
}
if (!$result) {
--- 41,49 ----
$result = true;
foreach ($subjects as $course => $subject) {
! if ($subject->server) {
! $subject->course = $course;
! if (!insert_record("math_assignment_subject", $subject))
! $result = false;
! }
}
if (!$result) {
|
|
From: <mo...@us...> - 2003-09-19 20:13:23
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim
In directory sc8-pr-cvs1:/tmp/cvs-serv7298
Modified Files:
Test.mpl
Log Message:
tweak to allow extended_numeric values infinity,-infinity, undefined as student and teacher's answers
Index: Test.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Test.mpl,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Test.mpl 19 Sep 2003 04:11:15 -0000 1.5
--- Test.mpl 19 Sep 2003 20:13:19 -0000 1.6
***************
*** 112,115 ****
--- 112,138 ----
):
+ ######################################################################
+
+ `Package/Assign`(
+ `aim/TestExtended_numeric`::boolean,
+ "Returns @`aim/TestNumeric`(ans,rightans)@ if @ans@ and @rightans@ are both @numeric@, otherwise it returns @`aim/TestEqual`(ans,rightans)@. This allows the @ans@ and @rightans@ to be one of @{infinity,-infinity,undefined}@
+ ",
+ proc(ans::anything,
+ rightans::anything,
+ # optional
+ marginspec_::`aim/Test/MarginSpecification`)
+ local marginspec;
+
+ marginspec:=NULL;
+ if nargs>2 then marginspec:=marginespec_ fi;
+
+ if type(ans,numeric) and type(rightans,numeric) then
+ return `aim/TestNumeric`(ans,rightans,marginspec)
+ else
+ return `aim/TestEqual`(ans,rightans)
+ fi:
+ end
+ ):
+
# END KM
***************
*** 453,456 ****
--- 476,483 ----
if mapletype = numeric or type([rightans],[numeric]) then
RETURN(`aim/TestNumeric`(ans,rightans,marginspec));
+ # KM
+ elif mapletype = extended_numeric or type([rightans],[extended_numeric]) then
+ return `aim/TestExtended_numeric`(ans,rightans,marginspec)
+ # END KM
elif mapletype = string or type([rightans],[string]) then
RETURN(`aim/TestEqual`(ans,rightans));
|
|
From: <ma...@us...> - 2003-09-19 20:12:34
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv22173/mod/math_assignment
Modified Files:
config.html
Log Message:
Minor bug fix
Index: config.html
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/config.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** config.html 18 Sep 2003 23:57:57 -0000 1.3
--- config.html 19 Sep 2003 11:58:27 -0000 1.4
***************
*** 72,78 ****
// get aim server
unset($options);
! $servers = get_records("math_assignment_server", "", "", "name ASC");
! foreach ($servers as $server) {
! $option[$server->id] = $server->name;
}
--- 72,79 ----
// get aim server
unset($options);
! if ($servers = get_records("math_assignment_server", "", "", "name ASC")) {
! foreach ($servers as $server) {
! $option[$server->id] = $server->name;
! }
}
|
|
From: <mo...@us...> - 2003-09-19 20:11:06
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1:/tmp/cvs-serv6900 Modified Files: SafeParse.mpl Log Message: added "undefined" to OKNames Index: SafeParse.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/SafeParse.mpl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SafeParse.mpl 6 Sep 2003 10:46:51 -0000 1.4 --- SafeParse.mpl 19 Sep 2003 20:11:01 -0000 1.5 *************** *** 467,470 **** --- 467,473 ---- "true", "trunc", + # KM + "undefined", + # END KM "vector" ]): |
|
From: <gus...@us...> - 2003-09-19 20:04:00
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv18796/mod/math_assignment
Modified Files:
mod.html
Log Message:
fixed bugs
Index: mod.html
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/mod.html,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** mod.html 18 Sep 2003 23:57:57 -0000 1.14
--- mod.html 19 Sep 2003 08:36:18 -0000 1.15
***************
*** 44,48 ****
// get aimsubject from database
if (!$aimsubject = get_field("math_assignment_subject", "name", "course", $form->course))
! $aimsubject = 0;
// Process problems and solutions
--- 44,48 ----
// get aimsubject from database
if (!$aimsubject = get_field("math_assignment_subject", "name", "course", $form->course))
! $aimsubject = "";
// Process problems and solutions
***************
*** 230,241 ****
<?php
! if ($aimsubject > 0) {
?>
<tr valign="top">
<td align="right"><p><b><?php echo $straimquiz; ?>:</b></p></td>
<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>
</tr>
--- 230,244 ----
<?php
! if ($aimsubject) {
?>
<tr valign="top">
<td align="right"><p><b><?php echo $straimquiz; ?>:</b></p></td>
<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>
</tr>
|
|
From: <gus...@us...> - 2003-09-19 20:02:54
|
Update of /cvsroot/aimmath/moodle/lang/en In directory sc8-pr-cvs1:/tmp/cvs-serv28285/lang/en Modified Files: math_assignment.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: math_assignment.php =================================================================== RCS file: /cvsroot/aimmath/moodle/lang/en/math_assignment.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** math_assignment.php 18 Sep 2003 23:57:57 -0000 1.9 --- math_assignment.php 19 Sep 2003 09:36:44 -0000 1.10 *************** *** 48,51 **** --- 48,52 ---- $string['paper'] = "Paper"; $string['problems'] = "Problem sheet"; + $string['marksheet'] = "Mark sheet"; $string['mathml'] = "XML with MathML"; $string['maxgrade'] = "Maximum Grade"; |