aimmath-commit Mailing List for AiM Assessment in Mathematics (Page 5)
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...> - 2004-02-16 03:25:40
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28702 Modified Files: RandArgs.mpl Log Message: Added a few new Rand Args and tweaked a few existing ones Index: RandArgs.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/RandArgs.mpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RandArgs.mpl 21 Jan 2004 22:52:46 -0000 1.2 --- RandArgs.mpl 16 Feb 2004 03:17:56 -0000 1.3 *************** *** 19,22 **** --- 19,25 ---- `Package/Assign`(`Rand/Integer`,"",[-`Rand/SmallIntMax`..`Rand/SmallIntMax`]): `Package/Assign`(`Rand/NonzeroInteger`,"",[`Rand/Posint`,`Rand/Negint`]): + `Package/Assign`(`Rand/ProperFraction/Pos`,"",Frac(0,`Rand/SmallDenominators`)): + `Package/Assign`(`Rand/ProperFraction/Neg`,"",Frac(-1,`Rand/SmallDenominators`)): + `Package/Assign`(`Rand/ProperFraction`,"",Frac(-1..0,`Rand/SmallDenominators`)): `Package/Assign`(`Rand/Fraction/Pos`,"",Frac(0..1,`Rand/SmallDenominators`)): `Package/Assign`(`Rand/Fraction/Neg`,"",Frac(-3..-1,`Rand/SmallDenominators`)): *************** *** 242,245 **** --- 245,254 ---- `Package/Assign`(`Rand/NegPowerOf/Binomial/Linear`,"", Fn(ToThe,`Rand/Binomial/Linear`,`Rand/Negint`)): + `Package/Assign`(`Rand/PosFracPowerOf/Binomial/Linear`,"", + Fn(ToThe,`Rand/Binomial/Linear`,`Rand/ProperFraction/Pos`)): + `Package/Assign`(`Rand/NegFracPowerOf/Binomial/Linear`,"", + Fn(ToThe,`Rand/Binomial/Linear`,`Rand/ProperFraction/Neg`)): + `Package/Assign`(`Rand/FracPowerOf/Binomial/Linear`,"", + Fn(ToThe,`Rand/Binomial/Linear`,`Rand/ProperFraction`)): `Package/Assign`(`Rand/RatPowerOf/Binomial/Linear`,"", Fn(ToThe,`Rand/Binomial/Linear`,`Rand/Rational`)): *************** *** 674,677 **** --- 683,692 ---- `Package/Assign`(`Rand/2var/NegPowerOf/Binomial/Linear`,"", Fn(ToThe,`Rand/2var/Binomial/Linear`,`Rand/Negint`)): + `Package/Assign`(`Rand/2var/PosFracPowerOf/Binomial/Linear`,"", + Fn(ToThe,`Rand/2var/Binomial/Linear`,`Rand/Fraction/Pos`)): + `Package/Assign`(`Rand/2var/NegFracPowerOf/Binomial/Linear`,"", + Fn(ToThe,`Rand/2var/Binomial/Linear`,`Rand/Fraction/Neg`)): + `Package/Assign`(`Rand/2var/FracPowerOf/Binomial/Linear`,"", + Fn(ToThe,`Rand/2var/Binomial/Linear`,`Rand/Fraction`)): `Package/Assign`(`Rand/2var/RatPowerOf/Binomial/Linear`,"", Fn(ToThe,`Rand/2var/Binomial/Linear`,`Rand/Rational`)): *************** *** 1195,1198 **** --- 1210,1219 ---- `Package/Assign`(`Rand/3var/NegPowerOf/Trinomial/Linear`,"", Fn(ToThe,`Rand/3var/Trinomial/Linear`,`Rand/Negint`)): + `Package/Assign`(`Rand/3var/PosFractPowerOf/Trinomial/Linear`,"", + Fn(ToThe,`Rand/3var/Trinomial/Linear`,`Rand/Fraction/Pos`)): + `Package/Assign`(`Rand/3var/NegFracPowerOf/Trinomial/Linear`,"", + Fn(ToThe,`Rand/3var/Trinomial/Linear`,`Rand/Fraction/Neg`)): + `Package/Assign`(`Rand/3var/FractionPowerOf/Trinomial/Linear`,"", + Fn(ToThe,`Rand/3var/Trinomial/Linear`,`Rand/Fraction`)): `Package/Assign`(`Rand/3var/RatPowerOf/Trinomial/Linear`,"", Fn(ToThe,`Rand/3var/Trinomial/Linear`,`Rand/Rational`)): *************** *** 1231,1234 **** --- 1252,1258 ---- "Rand/Integer", "Rand/NonzeroInteger", + "Rand/ProperFraction/Pos", + "Rand/ProperFraction/Neg", + "Rand/ProperFraction", "Rand/Fraction/Pos", "Rand/Fraction/Neg", *************** *** 1326,1329 **** --- 1350,1356 ---- "Rand/PowerOf/Binomial/Mixed", "Rand/NegPowerOf/Binomial/Linear", + "Rand/PosFracPowerOf/Binomial/Linear", + "Rand/NegFracPowerOf/Binomial/Linear", + "Rand/FracPowerOf/Binomial/Linear", "Rand/RatPowerOf/Binomial/Linear", "Rand/MixedPowerOf/Binomial/Linear", *************** *** 1425,1428 **** --- 1452,1458 ---- "Rand/2var/PowerOf/Binomial/Mixed", "Rand/2var/NegPowerOf/Binomial/Linear", + "Rand/2var/PosFracPowerOf/Binomial/Linear", + "Rand/2var/NegFracPowerOf/Binomial/Linear", + "Rand/2var/FracPowerOf/Binomial/Linear", "Rand/2var/RatPowerOf/Binomial/Linear", "Rand/2var/MixedPowerOf/Binomial/Linear", *************** *** 1520,1523 **** --- 1550,1556 ---- "Rand/3var/PowerOf/Binomial/Mixed", "Rand/3var/NegPowerOf/Trinomial/Linear", + "Rand/3var/PosFractPowerOf/Trinomial/Linear", + "Rand/3var/NegFracPowerOf/Trinomial/Linear", + "Rand/3var/FractionPowerOf/Trinomial/Linear", "Rand/3var/RatPowerOf/Trinomial/Linear", "Rand/3var/MixedPowerOf/Trinomial/Linear", |
From: <mo...@us...> - 2004-02-16 03:24:47
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28554 Modified Files: Inert.mpl Log Message: Improvements to Inertify() Index: Inert.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Inert.mpl,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Inert.mpl 14 Feb 2004 17:55:08 -0000 1.12 --- Inert.mpl 16 Feb 2004 03:17:02 -0000 1.13 *************** *** 389,428 **** `Package/Assign`( `Inertify`::procedure, ! "Tries its best to convert a Maple expression to an InertExpr. This is meant to be somewhat of an inverse operation to Value (though Value is clearly not 1-1).", proc(f::anything) ! local num,den,i; if type(f, `+`) then ! HardPlus(op(map(Inertify,[op(f)]))) elif type(f,`*`) then num:=NULL; den:=NULL; for i in [op(f)] do if type(i,`^`(anything,negint)) then ! den:=eval(den),Inertify(op(1,i)^(-op(2,i))); elif type(i,fraction) then if not type(op(1,i),identical(1)) then ! num:=eval(num),Inertify(op(1,i)); fi: ! den:=eval(den),Inertify(op(2,i)); else ! num:=eval(num),Inertify(i); fi: od: if den=NULL then ! Cdot(num) else if num=NULL then num:=1 fi; ! Over(Cdot(num),Cdot(den)) fi # Cdot(op(map(Inertify,[op(f)]))) elif type(f,`^`) then if type(op(2,f),negint) then ! Over(1,ToThe(Inertify(op(1,f)),-op(2,f))) else ! ToThe(op(map(Inertify,[op(f)]))) fi; elif type(f,exp(anything)) then ! Exp(op(map(Inertify,[op(f)]))) elif type(f,ln(anything)) then ! Ln(op(map(Inertify,[op(f)]))) elif type(f,float) then Decimal(f) --- 389,430 ---- `Package/Assign`( `Inertify`::procedure, ! "Tries its best to convert a Maple expression to an InertExpr. This is meant to be somewhat of an inverse operation to Value (though Value is clearly not 1-1). If called with the second optional argument @'soft'@, it will convert @+@ and @*@ to @Plus@ and @Times@ instead of @HardPlus@ and @Cdot@", proc(f::anything) ! local num,den,i,plusmap,timesmap,m; ! plusmap:=[HardPlus,Plus]; timesmap:=[Cdot,Times]; ! m:=`if`(nargs=1,1,2); if type(f, `+`) then ! plusmap[m](op(map(Inertify,[op(f)],args[2..-1]))) elif type(f,`*`) then num:=NULL; den:=NULL; for i in [op(f)] do if type(i,`^`(anything,negint)) then ! den:=eval(den),Inertify(op(1,i)^(-op(2,i)),args[2..-1]); elif type(i,fraction) then if not type(op(1,i),identical(1)) then ! num:=eval(num),Inertify(op(1,i),args[2..-1]); fi: ! den:=eval(den),Inertify(op(2,i),args[2..-1]); else ! num:=eval(num),Inertify(i,args[2..-1]); fi: od: if den=NULL then ! timesmap[m](num) else if num=NULL then num:=1 fi; ! Over(timesmap[m](num),timesmap[m](den)) fi # Cdot(op(map(Inertify,[op(f)]))) elif type(f,`^`) then if type(op(2,f),negint) then ! Over(1,ToThe(Inertify(op(1,f),args[2..-1]),-op(2,f))) else ! ToThe(op(map(Inertify,[op(f)],args[2..-1]))) fi; elif type(f,exp(anything)) then ! Exp(op(map(Inertify,[op(f)],args[2..-1]))) elif type(f,ln(anything)) then ! Ln(op(map(Inertify,[op(f)],args[2..-1]))) elif type(f,float) then Decimal(f) |
From: <mo...@us...> - 2004-02-14 18:05:19
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27905 Modified Files: SafeParse.mpl Log Message: added dx, dy, and dz to the list of safe names for use in total differential questions Index: SafeParse.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/SafeParse.mpl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SafeParse.mpl 19 Sep 2003 20:11:01 -0000 1.5 --- SafeParse.mpl 14 Feb 2004 17:58:38 -0000 1.6 *************** *** 421,424 **** --- 421,429 ---- "csgn", "diff", + # KM + "dx", + "dy", + "dz", + # END KM "dilog", "e", |
From: <mo...@us...> - 2004-02-14 18:01:54
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26961 Modified Files: Inert.mpl Log Message: fixed a bug in Inert/Times Index: Inert.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Inert.mpl,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Inert.mpl 12 Jan 2004 06:02:18 -0000 1.11 --- Inert.mpl 14 Feb 2004 17:55:08 -0000 1.12 *************** *** 748,753 **** t:=`aim/LaTeX/CleanNonprinting`(TeX(args[i])); if length(u)>0 and length(t)>0 and ! `Util/Numeric`(u[-1..-1]) ! then if `Util/Numeric`(t[1..1]) then s:=cat(s,"\\cdot{}",TeX(args[i])); --- 748,752 ---- t:=`aim/LaTeX/CleanNonprinting`(TeX(args[i])); if length(u)>0 and length(t)>0 and ! `Util/Numeric`(u[-1..-1]) then if `Util/Numeric`(t[1..1]) then s:=cat(s,"\\cdot{}",TeX(args[i])); *************** *** 759,763 **** fi: else ! s:=cat(s,"\\,",TeX(args[i])); fi: else --- 758,767 ---- fi: else ! if t[1..1]="-" then ! s:=cat(s,"\\cdot{}\\left(", ! TeX(args[i]),"\\right)"); ! else ! s:=cat(s,"\\,",TeX(args[i])); ! fi: fi: else |
Update of /cvsroot/aimmath/moodle/mod/math_assignment In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21525 Modified Files: aimpage.php config.html lib.php mod.html pdfgen.php problems.tex servers.php subjectpage.php view.php Log Message: assignment only visible when coursemodule is. now can deal with .pdf images in tex file review button now always there many other little tweaks Index: aimpage.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/aimpage.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** aimpage.php 11 Jan 2004 14:59:53 -0000 1.21 --- aimpage.php 29 Jan 2004 18:20:38 -0000 1.22 *************** *** 66,69 **** --- 66,73 ---- error("You are not allowed on this page"); } + + if (!$isteacher and !$cm->visible) { + error("This assignment should not be visible"); + } // Process arguments Index: config.html =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/config.html,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** config.html 11 Jan 2004 19:43:12 -0000 1.8 --- config.html 29 Jan 2004 18:20:38 -0000 1.9 *************** *** 1,3 **** --- 1,16 ---- <?php + + // require_once('../mod/math_assignment/lib.php'); + function get_server_depends($server, $justcount=true) { + global $CFG; + + if ($justcount) { + return count_records("math_assignment_subjects", "server", $server->id); + } + return get_records_sql("SELECT s.course, c.shortname, c.fullname, s.name + FROM {$CFG->prefix}math_assignment_subjects s, {$CFG->prefix}course c + WHERE c.id = s.course AND s.server = $server->id"); + } + $straimserverconfig = get_string("aimserverconfig", "math_assignment"); $strautoregister = get_string("autoregister", "math_assignment"); *************** *** 10,36 **** $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); ?> ! </td> ! </tr> ! <tr valign="top"> ! <td align="right"><p><b><?php echo $strautoregister; ?>:</b></p></td> ! <td align="left"><?php ! unset($options); ! $options[0] = get_string("no"); ! $options[1] = get_string("yes"); ! ! choose_from_menu ($options, "math_assignment_auto_register", $CFG->math_assignment_auto_register, "", "", ""); ! ?></td> ! <td align="left"><?php helpbutton ("config_autoregister", $strautoregister, "math_assignment"); ?></td> ! </tr> <tr valign="top"> --- 23,81 ---- $straimsubject = get_string("aimsubject", "math_assignment"); $straimsubjectpasswd = get_string("aimsubjectpasswd", "math_assignment"); + $strname = get_string("name", "math_assignment"); + $straddress = get_string("address", "math_assignment"); + $strdepends = get_string("dependentcourses", "math_assignment"); + $stredit = get_string("edit"); + $strdelete = get_string("delete"); + $strpassword = get_string('password'); + + if ($servers = get_records("math_assignment_servers", "", "", "name ASC")) { + $table->head = array($strname, $straddress, $strpassword, $strdepends, $stredit, $strdelete); + $table->width = array("*", "*", "*", "*", "*", "*"); + $table->align = array("LEFT", "LEFT", "LEFT", "CENTER", "CENTER", "CENTER"); + + foreach ($servers as $server) { + $table->data[] = array($server->name, $server->address, str_repeat("*", strlen($server->password)), + get_server_depends($server), "<a href=\"../mod/math_assignment/servers.php?id=$server->id\">$stredit</a>", + "<a href=\"../mod/math_assignment/servers.php?id=$server->id&name=&address=&password=\">$strdelete</a>"); + } + print_heading($straimserverconfig); + print_table($table); + + $server->name = ""; + $server->address = ""; + $server->password = ""; + + } + echo '<p><center>'; + print_single_button('../mod/math_assignment/servers.php', NULL, get_string("addnewserver", "math_assignment")); + echo '</center>'; + + if ($subjects = get_records('math_assignment_subjects')) { + unset($table); + $table->head = array (get_string('course'), $straimserver, $straimsubject, $strpassword, $stredit, $strdelete); + $generaltable->align = array ("LEFT", "LEFT", "LEFT", "LEFT", "CENTER", "CENTER"); + + foreach($subjects as $subject) { + $course = get_record('course', 'id', $subject->course); + $server = get_record('math_assignment_servers', 'id', $subject->server); + $table->data[] = array($course->fullname, $server->name, $subject->name, str_repeat("*", strlen($subject->password)), + "<a href=\"../mod/math_assignment/subjects.php?id=$subject->id\">$stredit</a>", + "<a href=\"../mod/math_assignment/subjects.php?id=$subject->id&course=&name=&subject=&password=\"> + $strdelete</a>"); + } + + print_heading($strcoursesettings); + print_table($table); + } + + echo '<p><center>'; + print_single_button('../mod/math_assignment/subjects.php', NULL, get_string("addnewsubject", "math_assignment")); + echo '</center>'; ?> <form method="post" action="<?php echo $CFG->wwwroot; ?>/mod/math_assignment/saveconfig.php" name="form"> ! <p /> ! <table cellpadding="9" cellspacing="0" align="center"> <tr valign="top"> *************** *** 45,134 **** <td align="left"><?php helpbutton ("config_latexoutput", $strlatexoutput, "math_assignment"); ?></td> </tr> - <tr valign="top"> - <td align="right"><p><b><?php echo $straimdisplay; ?>:</b></p></td> - <td align="left"><?php - unset($options); - $options[0] = get_string("nobody", "math_assignment"); - $options[1] = get_string("administrators"); - $options[2] = get_string("teachers"); - choose_from_menu ($options, "math_assignment_aim_display", $CFG->math_assignment_aim_display, "", "", ""); - ?></td> - <td align="left"><?php helpbutton ("config_aimdisplay", $straimdisplay, "math_assignment"); ?></td> - </tr> - <tr valign="top"> - <td align="right"><p><b><?php echo $strdefaultemailhost; ?>:</b></p></td> - <td align="left"><input type="text" name="math_assignment_default_email_host" size="40" maxlength="255" value="<?php echo $CFG->math_assignment_default_email_host; ?>" /></td> - <td align="left"><?php helpbutton ("config_defaultemailhost", $strdefaultemailhost, "math_assignment"); ?></td> - </tr> - <tr valign="top"> - <td align="right"><p><b><?php echo $strsecretaryemail; ?>:</b></p></td> - <td align="left"><input type="text" name="math_assignment_secretary_email" size="40" maxlength="255" value="<?php echo $CFG->math_assignment_secretary_email; ?>" /></td> - <td align="left"><?php helpbutton ("config_secretaryemail", $strsecretaryemail, "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 - $options = array(); - if ($servers = get_records("math_assignment_servers", "", "", "name ASC")) { - foreach ($servers as $server) { - $options[$server->id] = $server->name; - } - } - - foreach ($courses as $course) { - if (!$subject = get_record("math_assignment_subjects", "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 ($options, "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"; - } - } - - // remove any entries in the subjects table which correspond to non-existent courses - unset($courseids); - foreach ($courses as $course) { - if (isset($courseids)) - $courseids .= ", $course->id"; - else - $courseids = "$course->id"; - } - $db->Execute("DELETE FROM `{$CFG->prefix}math_assignment_subjects` WHERE `course` NOT IN ($courseids)"); - - ?> <tr> --- 90,94 ---- Index: lib.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/lib.php,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** lib.php 16 Jan 2004 09:34:57 -0000 1.50 --- lib.php 29 Jan 2004 18:20:38 -0000 1.51 *************** *** 36,43 **** } $math_assignment->problems = trim($math_assignment->problems); - if ($math_assignment->problems) { - if (math_assignment_is_tex_file($math_assignment->problems) xor $math_assignment->aimquiz) - return get_string($math_assignment->aimquiz ? "invalidmustbetex" : "invalidmustnotbetex", "math_assignment", get_string("problems", "math_assignment")); - } // solutions --- 36,39 ---- *************** *** 54,61 **** } $math_assignment->solutions = trim($math_assignment->solutions); - if ($math_assignment->solutions) { - if (math_assignment_is_tex_file($math_assignment->solutions) xor $math_assignment->aimquiz) - return get_string($math_assignment->aimquiz ? "invalidmustbetex" : "invalidmustnotbetex", "math_assignment", get_string("solutions", "math_assignment")); - } // check that the paper grade is valid --- 50,53 ---- *************** *** 103,110 **** } $math_assignment->problems = trim($math_assignment->problems); - if ($math_assignment->problems) { - if (math_assignment_is_tex_file($math_assignment->problems) xor $math_assignment->aimquiz) - return get_string($math_assignment->aimquiz ? "invalidmustbetex" : "invalidmustnotbetex", "math_assignment", get_string("problems", "math_assignment")); - } // solutions --- 95,98 ---- *************** *** 121,128 **** } $math_assignment->solutions = trim($math_assignment->solutions); - if ($math_assignment->solutions) { - if (math_assignment_is_tex_file($math_assignment->solutions) xor $math_assignment->aimquiz) - return get_string($math_assignment->aimquiz ? "invalidmustbetex" : "invalidmustnotbetex", "math_assignment", get_string("solutions", "math_assignment")); - } // check that the paper grade is valid --- 109,112 ---- *************** *** 298,302 **** if($math_assignment->problems) { ! if (math_assignment_is_tex_file($math_assignment->problems)) $proburl = "$CFG->wwwroot/mod/math_assignment/pdfgen.php?id=$math_assignment->id&type=problems"; else if ($math_assignment->problemsisurl) --- 282,286 ---- if($math_assignment->problems) { ! if (math_assignment_is_tex_file($math_assignment->problems) or $math_assignment->problems == 'default') $proburl = "$CFG->wwwroot/mod/math_assignment/pdfgen.php?id=$math_assignment->id&type=problems"; else if ($math_assignment->problemsisurl) *************** *** 307,317 **** $proburl = "$CFG->wwwroot/file.php?file=/$math_assignment->course/$math_assignment->problems"; } - else if ($math_assignment->aimquiz) - $proburl = "$CFG->wwwroot/mod/math_assignment/pdfgen.php?id=$math_assignment->id&type=problems"; else $proburl = ""; if($math_assignment->solutions) { ! if (math_assignment_is_tex_file($math_assignment->solutions)) $solurl = "$CFG->wwwroot/mod/math_assignment/pdfgen.php?id=$math_assignment->id&type=solutions"; else if ($math_assignment->solutionsisurl) --- 291,299 ---- $proburl = "$CFG->wwwroot/file.php?file=/$math_assignment->course/$math_assignment->problems"; } else $proburl = ""; if($math_assignment->solutions) { ! if (math_assignment_is_tex_file($math_assignment->solutions) or $math_assignment->problems == 'default') $solurl = "$CFG->wwwroot/mod/math_assignment/pdfgen.php?id=$math_assignment->id&type=solutions"; else if ($math_assignment->solutionsisurl) *************** *** 322,327 **** $solurl = "$CFG->wwwroot/file.php?file=/$math_assignment->course/$math_assignment->solutions"; } - else if ($math_assignment->aimquiz) - $solurl = "$CFG->wwwroot/mod/math_assignment/pdfgen.php?id=$math_assignment->id&type=solutions"; else $solurl = ""; --- 304,307 ---- *************** *** 331,335 **** /// Function which prints the problem and solution sheet links /// Note that if $align is empty we assume we are already in a paragraph, else we put the links in a paragraph ! math_assignment_get_file_urls($math_assignment, $proburl, $solurl); $proburl = htmlspecialchars($proburl); --- 311,315 ---- /// Function which prints the problem and solution sheet links /// Note that if $align is empty we assume we are already in a paragraph, else we put the links in a paragraph ! global $CFG; math_assignment_get_file_urls($math_assignment, $proburl, $solurl); $proburl = htmlspecialchars($proburl); *************** *** 344,347 **** --- 324,331 ---- $strviewproblems = get_string("viewproblems", "math_assignment"); $return .= "<a href=\"$proburl\" target=\"problems\">$strviewproblems</a>"; + if (isteacher($math_assignment->course) and math_assignment_is_tex_file($math_assignment->problems)) { + $return .= " <a href=\"$CFG->wwwroot/mod/math_assignment/texedit.php?id=$math_assignment->id&file=$math_assignment->problems\" + target=\"edit\"><img src=\"$CFG->pixpath/i/edit.gif\" height=16 width=16 border=0 alt=\"\"></a>"; + } } if (($solurl) and ($math_assignment->solutiontime < time()) && isstudent($math_assignment->course)) { *************** *** 364,367 **** --- 348,355 ---- $strviewsolutions = get_string("viewsolutions", "math_assignment"); $return .= "<a href=\"$solurl\" target=\"solutions\">$strviewsolutions</a>"; + if (isteacher($math_assignment->course) and math_assignment_is_tex_file($math_assignment->solutions)) { + $return .= " <a href=\"$CFG->wwwroot/mod/math_assignment/texedit.php?id=$math_assignment->id&file=$math_assignment->solutions\" + target=\"edit\"><img src=\"$CFG->pixpath/i/edit.gif\" height=16 width=16 border=0 alt=\"\"></a>"; + } } if (isset($return)) { *************** *** 705,710 **** $out = preg_replace("/<table border>/", "<table border=\"1\">", $out); $out = preg_replace("/<hr noshade(?=[\s\/])/", "<hr noshade=\"noshade\" ", $out); ! $out = preg_replace("/width\=([\d]+)/", "width=\"$2\"", $out); ! $out = preg_replace("/height\=([\d]+)/", "height=\"$2\"", $out); // sort out a netscape bug $out = str_replace("<br/>", "<br />", $out); --- 693,698 ---- $out = preg_replace("/<table border>/", "<table border=\"1\">", $out); $out = preg_replace("/<hr noshade(?=[\s\/])/", "<hr noshade=\"noshade\" ", $out); ! $out = preg_replace("/width\=([\d]+)/", "width=\"$1\"", $out); ! $out = preg_replace("/height\=([\d]+)/", "height=\"$1\"", $out); // sort out a netscape bug $out = str_replace("<br/>", "<br />", $out); Index: mod.html =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/mod.html,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** mod.html 11 Jan 2004 14:08:06 -0000 1.26 --- mod.html 29 Jan 2004 18:20:38 -0000 1.27 *************** *** 148,151 **** --- 148,152 ---- $coursedirs = get_directory_list($rootdir, $CFG->moddata); $options = array(); + $options['default'] = 'default'; foreach ($coursedirs as $dir) { $options["$dir"] = $dir; *************** *** 160,166 **** <?php choose_from_menu ($options, "problems", $form->problems, $strnone, "sheet_change('problems', 'list');", ""); ?> - <?php if (math_assignment_is_tex_file("$rootdir/$form->problems")) { - echo " <a href=\"$CFG->wwwroot/mod/math_assignment/texedit.php?id=$form->id&file=$form->problems\" target=\"_blank\">" . get_string("edit") . "</a>"; - } ?> </td> <td rowspan="4"><?php helpbutton("addupdate_problems", $strproblems, "math_assignment"); ?> --- 161,164 ---- *************** *** 197,200 **** --- 195,199 ---- $coursedirs = get_directory_list($rootdir, $CFG->moddata); $options = array(); + $options['default'] = 'default'; foreach ($coursedirs as $dir) { $options["$dir"] = $dir; *************** *** 209,215 **** <?php choose_from_menu($options, "solutions", $form->solutions, $strnone, "sheet_change('solutions', 'list');", ""); ?> - <?php if (math_assignment_is_tex_file("$rootdir/$form->solutions")) { - echo " <a href=\"$CFG->wwwroot/mod/math_assignment/texedit.php?id=$form->id&file=$form->solutions\" target=\"texedit\">" . get_string("edit") . "</a>"; - } ?> </td> <td rowspan="4"><?php helpbutton("addupdate_solutions", $strsolutions, "math_assignment"); ?> --- 208,211 ---- *************** *** 245,258 **** </tr> - <?php - if ($aimsubject) { - ?> - <tr valign="top"> - <td align="center" colspan="2"><p><?php print_string("mustbetex", "math_assignment"); ?></p></td> - </tr> - <?php - } - ?> - <tr valign="top"> <td align="right"><p><b><?php echo $strmaxgrade; ?>:</b></p></td> --- 241,244 ---- *************** *** 281,284 **** --- 267,272 ---- $strnone, "", ""); 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.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** pdfgen.php 11 Jan 2004 14:59:53 -0000 1.26 --- pdfgen.php 29 Jan 2004 18:20:38 -0000 1.27 *************** *** 26,29 **** --- 26,34 ---- error("Course is misconfigured"); } + + if (! $cm = get_coursemodule_from_instance("math_assignment", $math_assignment->id, $course->id)) { + error("Course Module ID was incorrect"); + } + require_login(); *************** *** 34,37 **** --- 39,46 ---- } + if (!isteacher($course->id) and !$cm->visible) { + error("This assignment should not be visible"); + } + // make sure students don't look at solutions before they should if ($type == "solutions" and isstudent($course->id) and $math_assignment->solutiontime > time()){ *************** *** 174,182 **** $data,1 ); ! if (!$conn = ftp_connect("manor.york.ac.uk")) echo "couldn't open ftp connection"; ! if (!ftp_login($conn, "gustav", "bekieh++")) echo "couldn't log in"; ! if (!ftp_chdir($conn, "/home/gustav/public_html/moodletex")) echo " couldn't change directory"; ! if (!ftp_site($conn, "chmod 0744 /home/gustav/public_html/moodletex/$tempfile$key.jpg")) echo "couldn't chmod"; ! ftp_close($conn); } } --- 183,193 ---- $data,1 ); ! if ($texmachine == "remote") { ! if (!$conn = ftp_connect("manor.york.ac.uk")) echo "couldn't open ftp connection"; ! if (!ftp_login($conn, "gustav", "bekieh++")) echo "couldn't log in"; ! if (!ftp_chdir($conn, "/home/gustav/public_html/moodletex")) echo " couldn't change directory"; ! if (!ftp_site($conn, "chmod 0744 /home/gustav/public_html/moodletex/$tempfile$key.jpg")) echo "couldn't chmod"; ! ftp_close($conn); ! } } } *************** *** 207,227 **** $latex = implode ('', file($texfile)); ! // Copy eps files to moodletex ! if (preg_match_all("/(?<=[\\W])[\\w]+\\.eps/" ,$latex, $imagematches)) { ! $images = $imagematches[1]; foreach ($images as $image) { if (!math_assignment_copy("$CFG->dataroot/$course->id/$image", "$remote$tempfile$image")) { error("Couldn't copy graphics file $image"); } ! $latex = preg_replace("/(?<=[\\W])[\\w]+\\.eps/", "$tempfile$image", $latex, 1); ! if (!$conn = ftp_connect("manor.york.ac.uk")) echo "couldn't open ftp connection"; ! if (!ftp_login($conn, "gustav", "bekieh++")) echo "couldn't log in"; ! if (!ftp_site($conn, "chmod 0744 /home/gustav/public_html/moodletex/$tempfile$image.eps")) echo "couldn't chmod"; ! ftp_close($conn); } } // \aimquestion prints a \spericalangle before the aim question ! $latex = str_replace('\aimquestion', '$\sphericalangle$ \aimque', $latex); // now insert the aim questions foreach ($questions as $question) { --- 218,240 ---- $latex = implode ('', file($texfile)); ! // Copy pdf files to moodletex ! if (preg_match_all("/(?<=[\\W])[\\w]+\\.p[dn][fg]/" ,$latex, $imagematches)) { ! $images = $imagematches[0]; foreach ($images as $image) { if (!math_assignment_copy("$CFG->dataroot/$course->id/$image", "$remote$tempfile$image")) { error("Couldn't copy graphics file $image"); } ! $latex = preg_replace("/$image/", "$tempfile$image", $latex, 1); ! if ($texmachine == "remote") { ! if (!$conn = ftp_connect("manor.york.ac.uk")) error("couldn't open ftp connection"); ! if (!ftp_login($conn, "gustav", "bekieh++")) error("couldn't log in"); ! if (!ftp_site($conn, "chmod 0744 /home/gustav/public_html/moodletex/$tempfile$image")) error("couldn't chmod"); ! ftp_close($conn); ! } } } // \aimquestion prints a \spericalangle before the aim question ! $latex = str_replace('\aimquestion', '$\bigodot$ \aimque', $latex); // now insert the aim questions foreach ($questions as $question) { *************** *** 232,236 **** $latex = implode ('', file("$CFG->dirroot/mod/math_assignment/$type.tex")); foreach ($questions as $question) { ! $latex .= "\n\n\\nextq $\\sphericalangle$ ".math_assignment_aim_to_latex($question,$type); } $latex .= "\n\n\\end{document}"; --- 245,249 ---- $latex = implode ('', file("$CFG->dirroot/mod/math_assignment/$type.tex")); foreach ($questions as $question) { ! $latex .= "\n\n\\nextq ".math_assignment_aim_to_latex($question,$type); } $latex .= "\n\n\\end{document}"; *************** *** 299,303 **** // "<latex>\n\n\vspace{2mm}\\noindent{\\bf Part \$2}\n\n</latex>",$data); $data = preg_replace("/id=\"question(\d+).(\d+)\"/i", ! "<latex>\n\n\vspace{1mm}{\\bf (\$2)} </latex>",$data); // replace radio buttons --- 312,316 ---- // "<latex>\n\n\vspace{2mm}\\noindent{\\bf Part \$2}\n\n</latex>",$data); $data = preg_replace("/id=\"question(\d+).(\d+)\"/i", ! "<latex>\n\n\vspace{1mm}\\noindent{\\bf (\$2)} </latex>",$data); // replace radio buttons *************** *** 305,315 **** "<latex>\n\n {\bf $2: } </latex>",$data); $data = preg_replace("/(type=\"radio\"[^\/]*value=\")([B-Z])\"/", ! "<latex>~~~~~ {\bf $2: } </latex>",$data); ! // replace checkboxes by diamonds $data = preg_replace("/(type=\"checkbox\"[^\/]*value=\")([A])\"/", ! "<latex>\n\n\\noindent{\bf $2: } </latex>",$data); $data = preg_replace("/(type=\"checkbox\"[^\/]*value=\")([B-Z])\"/", ! "<latex>{\bf $2: } </latex>",$data); // remove small print --- 318,328 ---- "<latex>\n\n {\bf $2: } </latex>",$data); $data = preg_replace("/(type=\"radio\"[^\/]*value=\")([B-Z])\"/", ! "<latex>;~~~~ {\bf $2: } </latex>",$data); ! // replace checkboxes $data = preg_replace("/(type=\"checkbox\"[^\/]*value=\")([A])\"/", ! "<latex>\n\n{\bf $2: } </latex>",$data); $data = preg_replace("/(type=\"checkbox\"[^\/]*value=\")([B-Z])\"/", ! "<latex>;~~~~ {\bf $2: } </latex>",$data); // remove small print Index: problems.tex =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/problems.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** problems.tex 27 Sep 2003 09:19:27 -0000 1.1 --- problems.tex 29 Jan 2004 18:20:38 -0000 1.2 *************** *** 13,17 **** \newcommand{\nextq}{\addtocounter{question}{1}\vspace{0.3truecm} ! \noindent{\bf\arabic{question}.$\quad$}} \begin{document} --- 13,17 ---- \newcommand{\nextq}{\addtocounter{question}{1}\vspace{0.3truecm} ! \noindent{\bf AiM \arabic{question}.$\quad$}} \begin{document} Index: servers.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/servers.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** servers.php 11 Jan 2004 14:08:06 -0000 1.5 --- servers.php 29 Jan 2004 18:20:38 -0000 1.6 *************** *** 4,11 **** /* optional variables: ! id Server id used when editing a record ! name Server name used when adding or editing a record ! address Server address used when adding or editing a record ! password Zone admin password for the server used when adding or editing a record */ --- 4,11 ---- /* optional variables: ! id Server id used when editing a record ! name Server name used when adding or editing a record ! address Server address used when adding or editing a record ! password Zone admin password for the server used when adding or editing a record */ *************** *** 21,26 **** } - $straimserverconfig = get_string("aimserverconfig", "math_assignment"); - if (isset($name) || isset($address) || isset($password)) { // add or edit a record optional_variable($name, ""); --- 21,24 ---- *************** *** 92,96 **** error(get_string("failed", "math_assignment"), "servers.php"); } ! redirect("servers.php", get_string("changessaved"), 1); } --- 90,94 ---- error(get_string("failed", "math_assignment"), "servers.php"); } ! redirect("http://aim.york.ac.uk/moodle/admin/module.php?module=math_assignment", get_string("changessaved"), 1); } *************** *** 101,104 **** --- 99,103 ---- $strmanagemodules = get_string("managemodules"); $strmathassignment = get_string("modulename", "math_assignment"); + $straimserverconfig = get_string("aimserverconfig", "math_assignment"); print_header("$site->shortname: $straimserverconfig", "$site->fullname", Index: subjectpage.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/subjectpage.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** subjectpage.php 11 Jan 2004 14:59:53 -0000 1.5 --- subjectpage.php 29 Jan 2004 18:20:38 -0000 1.6 *************** *** 83,88 **** 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); --- 83,89 ---- print_header("$course->shortname: $math_assignment->name", "$course->fullname", ! "$navigation <a href=\"index.php?id=$course->id\">$strmath_assignments</a> -> ! <a href=\"subjectpage.php?id=$course->id\">$straimsubjectpage</a>", ! "", "", true, '', navmenu($course, $cm), $usexml); Index: view.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/view.php,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** view.php 16 Jan 2004 09:34:57 -0000 1.28 --- view.php 29 Jan 2004 18:20:38 -0000 1.29 *************** *** 62,65 **** --- 62,69 ---- error("You are not allowed on this page"); } + + if (!$isteacher and !$cm->visible) { + error("This assignment should not be visible"); + } $hasaim = ($math_assignment->aimgrade > 0); *************** *** 420,424 **** if ($hasboth) $table->data[] = array($picture, $student->firstname, $student->lastname, $email, $papergrade, ! "$aimgrade $edited<a href=\"editgrade.php?id=$math_assignment->id&userid=$student->userid\">$stredit</a>$editedclose", $student->totalgrade); else if ($haspaper) $table->data[] = array($picture, $student->firstname, $student->lastname, $email, $papergrade); --- 424,429 ---- if ($hasboth) $table->data[] = array($picture, $student->firstname, $student->lastname, $email, $papergrade, ! "$aimgrade $edited<a href=\"editgrade.php?id=$math_assignment->id&userid=$student->userid\">$stredit</a>$editedclose ! <a href=\"aimpage.php?id=$cm->id&reviewstudent=$student->username&aimaction=reviewquiz\">$strreview</a>", $student->totalgrade); else if ($haspaper) $table->data[] = array($picture, $student->firstname, $student->lastname, $email, $papergrade); |
From: <gus...@pr...> - 2004-01-28 20:53:26
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22612/WEB-INF/maple/aim Modified Files: Question.mpl Log Message: makes sure that a student's mark can never go down with further attempts. Index: Question.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Question.mpl,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Question.mpl 10 Oct 2003 09:49:31 -0000 1.9 --- Question.mpl 28 Jan 2004 20:52:11 -0000 1.10 *************** *** 1551,1555 **** startix, # the index of the first correct attempt, if any; # otherwise, the index of the latest valid attempt, ! # if any; otherwise 0. a,r,b,bstring,i,mark,msg; --- 1551,1556 ---- startix, # the index of the first correct attempt, if any; # otherwise, the index of the latest valid attempt, ! # if any; otherwise 0, ! maxmark, # highest mark on previous attempts. a,r,b,bstring,i,mark,msg; *************** *** 1575,1578 **** --- 1576,1597 ---- n := nops(attempts); marks := map(x -> x['RawMark'],attempts); + + ##################################################### + # The following will calculate the adjusted marks of + # all previous attempts and keep the maximum in maxmark. + # We will later use maxmark to make sure that the new + # adjusted mark is not less than this. + # GWD + + startix := n; + maxmark := 0; # the maximum mark + b := 0; # b is the number of valid but incorrect attempts before startix + while (startix > 0) do + maxmark := max(0., marks[startix] - b * p, maxmark); + b := b+1; + startix := startix-1; + end do; + + ##################################################### isvalid := attempts[1]['IsValid']; *************** *** 1718,1721 **** --- 1737,1752 ---- fi; # matches if wasright then ... + ############################################################### + # Now we will make sure that the new adjusted mark is not less + # then previous asjusted marks. + # GWD + if (mark < maxmark) then + msg := cat(msg, + sprintf(" On a previous attempt you obtained a mark of %.2f. AiM doesn't want your new mark to be less than your best mark on a previous attempt and thus your overall mark is kept at %.2f. ", + maxmark,maxmark)); + mark := maxmark; + end if; + ############################################################### + this['Mark'] := mark; this['MarkMessage'] := msg; |
From: <mo...@us...> - 2004-01-21 22:53:17
|
Update of /cvsroot/aimmath/AIM/doc In directory sc8-pr-cvs1:/tmp/cvs-serv8279 Modified Files: RandArgCatalog.html Log Message: Added some documentation Index: RandArgCatalog.html =================================================================== RCS file: /cvsroot/aimmath/AIM/doc/RandArgCatalog.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RandArgCatalog.html 12 Jan 2004 05:58:12 -0000 1.1 --- RandArgCatalog.html 21 Jan 2004 22:53:13 -0000 1.2 *************** *** 20,23 **** --- 20,42 ---- </font></center> + <div class="p"><!----></div> + The following is a list of predefined arguments to the + <tt>Rand()</tt> + function. Each argument is shown with sample expressions + produced when <tt>Rand()</tt> is called with that argument. + Thus, for example, to produce a random expression similar + to the ones shown immediately following the name [...7374 lines suppressed...] ! </td><td nowrap="nowrap" align="center"> ! ln(y) ! <div class="hrcomp"><hr noshade="noshade" size="1"/></div>x<sup>4</sup> y<sup>6</sup> z<br /></td><td nowrap="nowrap" align="center"> ! , 5 x y<sup>2</sup> <font face="symbol">-</font ! >7 x z<sup>4</sup>, x y z, 9 x<sup>4</sup> y z + <i>e</i><sup>z</sup>, x<sup><font face="symbol">-</font ! >2/3</sup> z<sup><font face="symbol">-</font ! >9</sup> ln(y)</td></tr></table> </td></tr></table> *************** *** 4525,4528 **** by <a href="http://hutchinson.belmont.ma.us/tth/"> T<sub><font size="-1">T</font></sub>H</a>, ! version 3.30.<br />On 19 Dec 2003, 21:00.</small> </html> --- 4506,4509 ---- by <a href="http://hutchinson.belmont.ma.us/tth/"> T<sub><font size="-1">T</font></sub>H</a>, ! version 3.30.<br />On 21 Jan 2004, 17:23.</small> </html> |
From: <mo...@us...> - 2004-01-21 22:52:49
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1:/tmp/cvs-serv8232 Modified Files: RandArgs.mpl Log Message: Added some documentation Index: RandArgs.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/RandArgs.mpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RandArgs.mpl 12 Jan 2004 05:58:12 -0000 1.1 --- RandArgs.mpl 21 Jan 2004 22:52:46 -0000 1.2 *************** *** 1556,1559 **** --- 1556,1569 ---- printf("\\begin{document}\n"): printf("\\begin{center}\n\\LARGE{Catalog of Built-in Rand Args}\n\\end{center}\n"): + printf("\n\n The following is a list of predefined arguments to the + {\\tt Rand()} + function. Each argument is shown with sample expressions + produced when {\\tt Rand()} is called with that argument. + Thus, for example, to produce a random expression similar + to the ones shown immediately following the name + {\\bf Rand/Fraction/Neg} you would simply use the syntax + \n\n\\begin{center}{\\tt Rand(`Rand/Fraction/Neg`)}\\end{center} + \n\n Note that in all but the simplest cases the expression + produced is an Inert expression.\n\n"); printf("\\tableofcontents\n"): `RandArgs/ProcessList`(L,n,1); *************** *** 1562,1570 **** ): ! # The following lines are used to create the "catalog" documentation for RandArgs. ! # This takes a very long time, however so they are commented out except when making ! # changes to RandArgs. DO NOT DELETE! Note that if you use them yourself you should ! # make the obvious system-specific modifications. A better mechanism for turning this ! # on and off should be devised some day. # _cdir_:=currentdir(): --- 1572,1581 ---- ): ! # The following lines are used to create the "catalog" documentation for ! # RandArgs. This takes a very long time, however so they are commented out ! # except when making changes to RandArgs. DO NOT DELETE! Note that if you ! # use them yourself you should make the obvious system-specific ! # modifications. A better mechanism for turning this on and off should be ! # devised some day. # _cdir_:=currentdir(): |
From: <mo...@us...> - 2004-01-16 22:57:18
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1:/tmp/cvs-serv29793 Modified Files: AutoConf.mpl AutoConfWin.mpl Log Message: Fixed a bug that prevented BLAT from being detected during installation. Index: AutoConf.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/AutoConf.mpl,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AutoConf.mpl 25 Sep 2003 19:01:14 -0000 1.7 --- AutoConf.mpl 16 Jan 2004 22:57:15 -0000 1.8 *************** *** 535,562 **** ###################################################################### - # Look for email program - - if os_os = "Linux" or os_os = "OS X" then - Config['SendmailProgram'] := - look_for_prog( - "sendmail", - "Conf" = 'SendmailProgram', - "Path" = "sendmail", - "Def" = "/usr/lib/sendmail", - "Def" = "/usr/bin/sendmail" - ): - setconfig('BLATProgram',""): - setconfig('SMTPServer',""): - else - Config['BLATProgram'] := cat(Config['CatalinaHome'],"\\bin\\blat\\blat.exe"): - setconfig('SendmailProgram',""); - setconfig('SMTPServer',""): - fi: - - p("\n"): - - - ###################################################################### - # Look for upload directory --- 535,538 ---- *************** *** 821,824 **** --- 797,830 ---- )): fi: + ###################################################################### + + # Look for email program + + if os_os = "Linux" or os_os = "OS X" then + Config['SendmailProgram'] := + look_for_prog( + "sendmail", + "Conf" = 'SendmailProgram', + "Path" = "sendmail", + "Def" = "/usr/lib/sendmail", + "Def" = "/usr/bin/sendmail" + ): + setconfig('BLATProgram',""): + setconfig('SMTPServer',""): + else + Config['BLATProgram'] := + look_for_prog( + "BLATProgram", + "Conf" = 'BLATProgram', + "Path" = "blat.exe", + "Def" = cat(Config['WebAppDir'],"\\bin\\blat\\blat.exe") + ): + setconfig('SendmailProgram',""); + setconfig('SMTPServer',""): + fi: + + p("\n"): + + ###################################################################### # KM Index: AutoConfWin.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/AutoConfWin.mpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AutoConfWin.mpl 25 Sep 2003 19:01:14 -0000 1.3 --- AutoConfWin.mpl 16 Jan 2004 22:57:15 -0000 1.4 *************** *** 743,747 **** setconfig('SMTPServer',""): else ! Config['BLATProgram'] := cat(Config['CatalinaHome'],"\\bin\\blat\\blat.exe"): setconfig('SendmailProgram',""); setconfig('SMTPServer',""): --- 743,753 ---- setconfig('SMTPServer',""): else ! Config['BLATProgram'] := ! look_for_prog( ! "BLATProgram", ! "Conf" = 'BLATProgram', ! "Path" = "blat.exe", ! "Def" = cat(Config['WebAppDir'],"\\bin\\blat\\blat.exe") ! ): setconfig('SendmailProgram',""); setconfig('SMTPServer',""): *************** *** 750,754 **** p("\n"): ! setconfig('AliceHistorySize',20): --- 756,760 ---- p("\n"): ! ###################################################################### setconfig('AliceHistorySize',20): |
From: <gus...@us...> - 2004-01-16 09:35:00
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment In directory sc8-pr-cvs1:/tmp/cvs-serv18698 Modified Files: editgrade.php email.php lib.php updatepapergrades.php view.php Log Message: various small fixes Index: editgrade.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/editgrade.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** editgrade.php 11 Jan 2004 14:59:53 -0000 1.6 --- editgrade.php 16 Jan 2004 09:34:57 -0000 1.7 *************** *** 5,9 **** require_once("../../config.php"); require_once("lib.php"); - require_once("../../user/lib.php"); require_variable($id); // quiz id --- 5,8 ---- *************** *** 75,79 **** } if (!isset($err)) { ! $err = math_assignment_update_grades($gradeobj) ? 0 : 1; if (!$err) { redirect("view.php?id=$cm->id", get_string("changessaved") . "\n" . --- 74,78 ---- } if (!isset($err)) { ! $err = update_record('math_assignment_grades', $gradeobj) ? 0 : 1; if (!$err) { redirect("view.php?id=$cm->id", get_string("changessaved") . "\n" . Index: email.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/email.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** email.php 11 Jan 2004 14:59:53 -0000 1.6 --- email.php 16 Jan 2004 09:34:57 -0000 1.7 *************** *** 6,10 **** require_once("../../config.php"); require_once("lib.php"); - require_once("../../user/lib.php"); require_variable($id); // course module id --- 6,9 ---- Index: lib.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/lib.php,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** lib.php 11 Jan 2004 19:48:27 -0000 1.49 --- lib.php 16 Jan 2004 09:34:57 -0000 1.50 *************** *** 246,250 **** $return->grades = math_assignment_get_grades($math_assignment, "id", "asc"); if ($return->grades) ! array_walk($return->grades, create_function('&$val','$val = $val->totalgrade;')); return $return; --- 246,250 ---- $return->grades = math_assignment_get_grades($math_assignment, "id", "asc"); if ($return->grades) ! array_walk($return->grades, create_function('&$val','$val = $val->totalgrade+0;')); return $return; *************** *** 744,748 **** } if ($changed) ! math_assignment_update_grades($entry); } else { --- 744,748 ---- } if ($changed) ! update_record('math_assignment_grades', $entry); } else { *************** *** 760,778 **** } - function math_assignment_update_grades($gradeobj) { - /// Function which updates a grade record in the database - - global $db, $CFG; - - return $db->Execute("UPDATE {$CFG->prefix}math_assignment_grades SET `papergrade`=$gradeobj->papergrade, `papertimemodified`=$gradeobj->papertimemodified, `aimgrade`=$gradeobj->aimgrade,`aimtimemodified`=$gradeobj->aimtimemodified,`aimoverride`=$gradeobj->aimoverride,`aimcomment`='$gradeobj->aimcomment' WHERE `assignment`=$gradeobj->assignment AND `userid`=$gradeobj->userid"); - } - function math_assignment_total_grade($math_assignment, $gradeobj) { /// Funtion which returns the total grade given a grade object ! $grade = min(max($gradeobj->aimgrade, 0), $math_assignment->aimgrade); ! if ($math_assignment->papersheetsreturned) { ! $grade += min(max($gradeobj->papergrade, 0), $math_assignment->papergrade); ! } ! return $grade; } --- 760,768 ---- } function math_assignment_total_grade($math_assignment, $gradeobj) { /// Funtion which returns the total grade given a grade object ! ! return min(max($gradeobj->aimgrade, 0), $math_assignment->aimgrade) ! + min(max($gradeobj->papergrade, 0), $math_assignment->papergrade); } *************** *** 823,828 **** $grade = get_record_sql("SELECT papergrade, aimgrade, aimoverride, aimcomment FROM {$CFG->prefix}math_assignment_grades WHERE assignment = '$math_assignment->id' and userid = '$key'"); if ($grade) { ! $students[$key]->papergrade = $grade->papergrade; ! $students[$key]->aimgrade = $grade->aimgrade; $students[$key]->aimoverride = $grade->aimoverride ; $students[$key]->aimcomment = $grade->aimcomment; --- 813,818 ---- $grade = get_record_sql("SELECT papergrade, aimgrade, aimoverride, aimcomment FROM {$CFG->prefix}math_assignment_grades WHERE assignment = '$math_assignment->id' and userid = '$key'"); if ($grade) { ! $students[$key]->papergrade = $grade->papergrade+0; ! $students[$key]->aimgrade = $grade->aimgrade+0; $students[$key]->aimoverride = $grade->aimoverride ; $students[$key]->aimcomment = $grade->aimcomment; *************** *** 1099,1107 **** $grade->aimcomment = ""; } if ($math_assignment->papergrade > 0) { if ($grade->papergrade >= 0) { ! $papergrade = "<b>$grade->papergrade / $math_assignment->papergrade</b>"; } else if ($grade->papergrade = -1) { ! $papergrade = "<b>-- / $math_assignment->papergrade</b>"; } // display in grey if results have not been finalised --- 1089,1101 ---- $grade->aimcomment = ""; } + $pg = $grade->papergrade+0; // The +0 converts it into a number + $pm = $math_assignment->papergrade+0; if ($math_assignment->papergrade > 0) { if ($grade->papergrade >= 0) { ! $pg = $grade->papergrade+0; // The +0 converts it into a number ! $pm = $math_assignment->papergrade+0; ! $papergrade = "<b>$pg / $pm</b>"; } else if ($grade->papergrade = -1) { ! $papergrade = "<b>-- / $pm</b>"; } // display in grey if results have not been finalised *************** *** 1117,1125 **** $papergrade = ""; } if ($math_assignment->aimgrade > 0) { if ($grade->aimgrade >= 0) { ! $aimgrade = "<b>$grade->aimgrade / $math_assignment->aimgrade</b>"; } else { ! $aimgrade = "<b>-- / $math_assignment->aimgrade</b>"; } // show aimgrade in grey if quiz has not closed yet --- 1111,1121 ---- $papergrade = ""; } + $ag = $grade->aimgrade+0; // The +0 converts it into a number + $am = $math_assignment->aimgrade+0; if ($math_assignment->aimgrade > 0) { if ($grade->aimgrade >= 0) { ! $aimgrade = "<b>$ag / $am</b>"; } else { ! $aimgrade = "<b>-- / $am</b>"; } // show aimgrade in grey if quiz has not closed yet *************** *** 1146,1150 **** AND (papergrade >= 0 OR aimgrade >= 0)" ); ! $average = strval(round($gr->average)) . "/$maxgrade"; // Don't show a total grade if there is an unpublished paper grade --- 1142,1146 ---- AND (papergrade >= 0 OR aimgrade >= 0)" ); ! $average = strval(round($gr->average*10)/10) . "/$maxgrade"; // Don't show a total grade if there is an unpublished paper grade Index: updatepapergrades.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/updatepapergrades.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** updatepapergrades.php 11 Jan 2004 14:59:53 -0000 1.6 --- updatepapergrades.php 16 Jan 2004 09:34:57 -0000 1.7 *************** *** 33,39 **** $warning = 0; foreach ($_POST as $userid => $grade) { ! if (ctype_digit("$userid") && (ctype_digit("$grade") || "$grade" === "")) { if ($grade < 0) { - $grade = 0; $warning = 1; } --- 33,38 ---- $warning = 0; foreach ($_POST as $userid => $grade) { ! if (ctype_digit("$userid")) { if ($grade < 0) { $warning = 1; } *************** *** 61,65 **** $gradeobj->papergrade = $grade; $gradeobj->papertimemodified = time(); ! if (!math_assignment_update_grades($gradeobj)) { $warning = 4; } --- 60,65 ---- $gradeobj->papergrade = $grade; $gradeobj->papertimemodified = time(); ! $gradeobj->aimcomment = addslashes($gradeobj->aimcomment); ! if (!update_record('math_assignment_grades', $gradeobj)) { $warning = 4; } *************** *** 73,77 **** $delay = 3; if ($warning) { ! $strnotice .= "<br />There have however been some irregularities (such as grades larger than the allowed maximum or negative grades). Please review the grades."; $delay = 15; } --- 73,77 ---- $delay = 3; if ($warning) { ! $strnotice .= "<br />There have however been some irregularities (such as grades larger than the allowed maximum or negative grades) $warning. Please review the grades."; $delay = 15; } Index: view.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/view.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** view.php 11 Jan 2004 14:59:53 -0000 1.27 --- view.php 16 Jan 2004 09:34:57 -0000 1.28 *************** *** 281,311 **** $inbox = true; } if ($haspaper) { echo "<b>"; if ($hasaim) echo "$strpaper "; ! echo "$strgrade :</b> "; ! if ($math_assignment->papersheetsreturned) { ! if ($grade->aimgrade >= 0) { ! echo "$grade->papergrade / $math_assignment->papergrade"; ! } else { ! print_string("notattempted", "math_assignment"); ! } ! } 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 > AIMOVR_RESET) { ! echo " ("; ! print_string("gradeoverride", "math_assignment"); ! echo ")"; ! } ! echo "<br />"; if ($grade->aimcomment) echo "<b>" . $course->teacher . " " . get_string("comment", "math_assignment") . --- 281,333 ---- $inbox = true; } + $pg = $grade->papergrade+0; // The +0 converts it into a number + $pm = $math_assignment->papergrade+0; + if ($math_assignment->papergrade > 0) { + if ($grade->papergrade >= 0) { + $pg = $grade->papergrade+0; // The +0 converts it into a number + $pm = $math_assignment->papergrade+0; + $papergrade = "<b>$pg / $pm</b>"; + } else if ($grade->papergrade = -1) { + $papergrade = "<b>-- / $pm</b>"; + } + // display in grey if results have not been finalised + if (!$math_assignment->papersheetsreturned) { + $papergrade = "<span style=\"color: silver \">$papergrade</span>"; + } + // don't give results if assignment still open + if ($math_assignment->timedue > time()) { + $papergrade = $stropen; + } + } + else { + $papergrade = ""; + } + $ag = $grade->aimgrade+0; // The +0 converts it into a number + $am = $math_assignment->aimgrade+0; + if ($math_assignment->aimgrade > 0) { + if ($grade->aimgrade >= 0) { + $aimgrade = "<b>$ag / $am</b>"; + } else { + $aimgrade = "<b>-- / $am</b>"; + } + // show aimgrade in grey if quiz has not closed yet + if ($math_assignment->timedue > time()) { + $aimgrade = "<span style=\"color: silver \">$aimgrade</span>"; + } + if ($grade->aimoverride > AIMOVR_RESET) { + $aimgrade .= " (" . get_string("gradeoverride", "math_assignment") . ")"; + } + } + else { + $aimgrade = ""; + } if ($haspaper) { echo "<b>"; if ($hasaim) echo "$strpaper "; ! echo "$strgrade: $papergrade<br />"; } if ($hasaim) { echo "<b>$strcomputer $strgrade :</b> "; ! echo "$aimgrade <br />"; if ($grade->aimcomment) echo "<b>" . $course->teacher . " " . get_string("comment", "math_assignment") . *************** *** 361,370 **** $picture = print_user_picture($student->userid, $course->id, $student->picture, false, true); if ($student->papergrade >= 0) ! $papergrade = $student->papergrade; else $papergrade = ""; $papergrade = "<input type=\"text\" name=\"$student->userid\" size=\"10\" maxlength=\"10\" value=\"$papergrade\" tabindex=\"$i\" />"; if ($student->aimgrade >= 0) ! $aimgrade = $student->aimgrade; else $aimgrade = ""; --- 383,392 ---- $picture = print_user_picture($student->userid, $course->id, $student->picture, false, true); if ($student->papergrade >= 0) ! $papergrade = $student->papergrade+0; else $papergrade = ""; $papergrade = "<input type=\"text\" name=\"$student->userid\" size=\"10\" maxlength=\"10\" value=\"$papergrade\" tabindex=\"$i\" />"; if ($student->aimgrade >= 0) ! $aimgrade = $student->aimgrade+0; else $aimgrade = ""; |
From: <mo...@us...> - 2004-01-12 06:15:58
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim In directory sc8-pr-cvs1:/tmp/cvs-serv1542/WEB-INF/maple/aim Modified Files: TextQuestion.mpl Log Message: Implements the String() wrapper for the c> prompt. Using c> String(sometype), where 'sometype' is a Maple type, caused AIM to interpret the student's answer as a string, and then check if the string is of type 'sometype' for validation. Note that if Maple can determine that 'sometype' is a subtype of type 'string', the wrapper String() is not needed and may be ommitted. This mechanism is useful for defining and validating custom input types for student answers. Index: TextQuestion.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/TextQuestion.mpl,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TextQuestion.mpl 9 Jan 2004 06:47:00 -0000 1.11 --- TextQuestion.mpl 12 Jan 2004 06:15:55 -0000 1.12 *************** *** 158,162 **** ", proc(this,x::`aim/Question/Attempt_`) ! local savedframe,attempt,mapletype,err,msg,ans,rightans,ok,rawmark,tlimit; # KM global Config; --- 158,163 ---- ", proc(this,x::`aim/Question/Attempt_`) ! local savedframe,attempt,mapletype,err,msg,ans,rightans,ok,rawmark,tlimit, ! cleanmapletype; # KM global Config; *************** *** 173,176 **** --- 174,182 ---- rightans := eval(this['RightAnswer']); mapletype := this['MapleType']; + # KM + cleanmapletype:=`if`(type(mapletype,specfunc(anything,'String')), + op(mapletype), + mapletype): + # END KM msg := ""; *************** *** 181,185 **** # KM # WAS: not(type(rightans,mapletype)) then ! not(type(Value(rightans),mapletype)) then # END KM msg := __("Teacher's answer has the wrong type."); --- 187,191 ---- # KM # WAS: not(type(rightans,mapletype)) then ! not(type(Value(rightans),cleanmapletype)) then # END KM msg := __("Teacher's answer has the wrong type."); *************** *** 369,378 **** else if attempt['Answer'] <> NULL then ! # KM & GG if type([attempt['Answer']],[string]) then html := cat( - __("No validation is possible with this question. \n"), __("Your last answer, exactly as you typed it, was: \n"), "<br/><pre>", --- 375,383 ---- else if attempt['Answer'] <> NULL then ! # KM if type([attempt['Answer']],[string]) then html := cat( __("Your last answer, exactly as you typed it, was: \n"), "<br/><pre>", *************** *** 469,473 **** # 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 --- 474,479 ---- # KM # WAS: if reqtype = string then ! # WAS: if subtype(reqtype,string) then ! if subtype(reqtype,string) or type(reqtype,specfunc(type,'String')) then # END # don't allow the empty string to be valid or it will cause *************** *** 479,483 **** # 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'] := --- 485,491 ---- # check that the string matches the required type in the case # where the user has specified a subtype of type string ! # removing the String() wrapper when needed ! if type(reqtype,specfunc(type,'String')) then reqtype:=op(reqtype); fi: ! if (not(type(rawans,reqtype))) then attempt['ValidationNote'] := __("wrong type"); attempt['ValidationMessage'] := |
From: <mo...@us...> - 2004-01-12 06:11:43
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim In directory sc8-pr-cvs1:/tmp/cvs-serv998/WEB-INF/maple/aim Modified Files: SyntaxHints.mpl Log Message: Added custom Maple types: OrderedPair, OrderedTriple, OrderedTuple, and SeqOrderedPair. Also added custom parsers `Parse/OrderedTuple` and `Parse/SeqOrderedTuple` to parse strings that match these data types into lists. This allows the student to enter ordered tuples such as (1,2) as any of (1,2), [1,2], or simply 1,2. Similarly a finite sequence can be entered using this notation (by considering it as an n-tuple). The question author can specify the Maple type of the components in the tuples via the String() wrapper at the c> flag. For example, c> String(OrderedPair(integer,integer)) tells AIM that the student's answer should be left as an unevaluated string, which is then checked against the data type OrderedPair(integer,integer) to see if it parses to an ordered pair of integers. To parse the student's answer string in the marking proc, the Parse routines are used. Index: SyntaxHints.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/SyntaxHints.mpl,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SyntaxHints.mpl 10 Oct 2003 09:48:30 -0000 1.6 --- SyntaxHints.mpl 12 Jan 2004 06:11:40 -0000 1.7 *************** *** 962,966 **** msg, sprintf(__("#Explain constant functions (%s,%s,%s,%A,%s)"), ! fstring0,xstring,red(fstring1,"*(",xstring,")"), fx,fstring0); else --- 962,966 ---- msg, sprintf(__("#Explain constant functions (%s,%s,%s,%A,%s)"), ! fstring0,xstring,red(fstring1,"*(",xstring,")"), fx,fstring0); else *************** *** 968,972 **** msg, sprintf(__("#Explain funny functions (%s,%s,%s)"), ! red(fstring0),red(xstring),red(fstring1,"*(",xstring,")")); fi; --- 968,972 ---- msg, sprintf(__("#Explain funny functions (%s,%s,%s)"), ! red(fstring0),red(xstring),red(fstring1,"*(",xstring,")")); fi; *************** *** 1092,1098 **** badm := `if`(member(lcm,vars),ucm,lcm); msg := cat(msg, ! sprintf( ! __("If so, you should note that this involves the variable <tt><font color='red'>%s</font></tt>, which is not relevant for this question. Perhaps you mean <tt><font color='green'>%s</font></tt> instead. (Remember that Maple is case-sensitive.)"), ! badm,goodm)); return(msg); fi; --- 1092,1098 ---- badm := `if`(member(lcm,vars),ucm,lcm); msg := cat(msg, ! sprintf( ! __("If so, you should note that this involves the variable <tt><font color='red'>%s</font></tt>, which is not relevant for this question. Perhaps you mean <tt><font color='green'>%s</font></tt> instead. (Remember that Maple is case-sensitive.)"), ! badm,goodm)); return(msg); fi; *************** *** 1176,1178 **** ###################################################################### ! EndPackage(): --- 1176,1381 ---- ###################################################################### ! ###################################################################### ! # Custom Student Input Types and Parsers ! ###################################################################### ! # TODO: Make these more general and robust ! ! `Package/Assign`( ! `type/OrderedPair`::boolean, ! "Returns @true@ if the argument is a Maple list of two elements or a string that has ! one of the three forms: @(a,b)@, @[a,b]@, @a,b@. This is intended for use with ! the c> flag and the @String@ keyword, so that students can enter an ordered pair for ! their answer. It is forgiving with brackets in that it will accept @(a,b)@, @[a,b]@, ! or simply @a,b@ as the student answer and treat each as the same ordered pair. ! The optional second and third arguments can be used to specify the Maple type of ! @a@ and @b@ respectively.<br><br> ! Example: <br><br> ! @c> String(OrderedPair(integer,rational))@ <br><br> ! will only match ordered pairs @(a,b)@ for which @a@ parses to an @integer@ and ! @b@ parses to a @rational@. Note that currently this type checking is not recursive, ! so that @a@ and @b@ are interpreted as parsed Maple expressions, not strings ! (unless the student encloses them in quotes). In particular, you cannot ! test for an @OrderedPair@ of @OrderedPair@'s (which would be ambiguous anyway since ! brackets/parentheses are optional). ! ", ! proc(s::anything) ! local S,t1,t2,T,n: ! t1:='anything'; t2:='anything'; ! if nargs>1 then t1:=args[2] fi: ! if nargs>2 then t2:=args[3] fi: ! if not type(s,string) then return type(s,[t1,t2]) fi; ! S:=`Util/RemoveWhiteSpace`(s): ! # convert () to [] ! if S[1]="(" and S[-1]=")" then S:=cat("[",S[2..-2],"]"); fi: ! # if they omitted brackets, supply them ! if S[1]<>"[" or S[-1]<>"]" then S:=cat("[",S,"]"): fi: ! n:=length(S); ! if n<5 then return false fi: ! T:=`aim/SafeParse`(S): ! return evalb(T['Status']="OK" and type(T['Value'],[t1,t2])) ! end ! ): ! ! `Package/Assign`( ! `type/OrderedTriple`::boolean, ! "Returns @true@ if the argument is a Maple list of three elements or a string that has ! one of the three forms: @(a,b,c)@, @[a,b,c]@, or @a,b,c@. This is intended for use with ! the c> flag and the @String@ keyword, so that students can enter an ordered triple for ! their answer. It is forgiving with brackets in that it will accept any of the three ! forms above as the student answer and treat each as the same ordered ! triple. The optional second, third, and fourth arguments can be used to specify the ! Maple type of @a@, @b@, and @c@ respectively.<br><br> ! Example: <br><br> ! @c> String(OrderedPair(integer,rational,algebraic))@ <br><br> ! will only match ordered triples @(a,b,c)@ for which @a@ parses to an @integer@, ! @b@ parses to a @rational@, and @c@ parses to a @algebraic@. ! Note that currently this type checking is not recursive, ! so that @a@, @b@, and @c@ are interpreted as parsed Maple expressions, not strings ! (unless the student encloses them in quotes). In particular, you cannot ! test for an @OrderedTriple@ of @OrderedPair@'s, for example (which would be ambiguous ! anyway since brackets/parentheses are optional). ! ", ! proc(s::anything) ! local S,t1,t2,t3,T,n: ! t1:='anything'; t2:='anything'; t3:='anything'; ! if nargs>1 then t1:=args[2] fi: ! if nargs>2 then t2:=args[3] fi: ! if nargs>3 then t3:=args[4] fi: ! if not type(s,string) then return type(s,[t1,t2,t3]) fi; ! S:=`Util/RemoveWhiteSpace`(s): ! # convert () to [] ! if S[1]="(" and S[-1]=")" then S:=cat("[",S[2..-2],"]"); fi: ! # if they omitted brackets, supply them ! if S[1]<>"[" or S[-1]<>"]" then S:=cat("[",S,"]"): fi: ! n:=length(S); ! if n<7 then return false fi: ! T:=`aim/SafeParse`(S): ! return evalb(T['Status']="OK" and type(T['Value'],[t1,t2,t3])) ! end ! ): ! ! `Package/Assign`( ! `type/OrderedTuple`::boolean, ! "Returns @true@ if the argument is any non-string Maple object or a string that has ! one of the three forms: @(a1,a2,...)@, @[a1,a2,...]@, or @a1,a2,...@. This is intended ! for use with the c> flag and the @String@ keyword, so that students can enter an ! ordered tuple or sequence for their answer. It is forgiving with brackets in that it ! will accept any of the three forms described above as the student answer and treat each ! as the same ordered tuple. ! The optional second argument can be used to specify the Maple type of all of the ! components of the tuple.<br><br> ! Example: <br><br> ! @c> String(OrderedTuple(integer))@ <br><br> ! will only match ordered tuples @(a1,a2,...)@ for which each @ai@ parses to an ! @integer@. Note that currently this type checking is not recursive, ! so that each @ai@ is interpreted as a parsed Maple expressions, not strings ! (unless the student encloses them in quotes). In particular, you cannot ! test for an @OrderedTuple@ of @OrderedPair@'s, for example, (which would be ambiguous ! anyway since brackets/parentheses are optional). ! ", ! proc(s::anything) ! local S,t1,T,n: ! t1:='anything'; ! if nargs>1 then t1:=args[2] fi: ! if not type(s,string) then return type(s,list(t1)) fi; ! S:=`Util/RemoveWhiteSpace`(s): ! # convert () to [] ! if S[1]="(" and S[-1]=")" then S:=cat("[",S[2..-2],"]"); fi: ! # if they omitted brackets, supply them ! if S[1]<>"[" or S[-1]<>"]" then S:=cat("[",S,"]"): fi: ! n:=length(S); ! if n<3 then return false fi: ! T:=`aim/SafeParse`(S): ! return evalb(T['Status']="OK" and type(T['Value'],list(t1))) ! end ! ): ! ! `Package/Assign`( ! `type/SeqOrderedPair`::boolean, ! "Returns @true@ if the argument is a Maple list of lists of two elements or a string ! that has the forms: @(a1,b1),(a2,b2),...,(an,bn)@ where any of the parentheses can ! be replaced by square brackets and the entire list can be surrounded by square ! brackets. This is intended for use with the c> flag and the @String@ keyword, so ! that students can enter a sequence of ordered pairs for their answer. ! The optional second and third arguments can be used to specify the Maple type of ! @ai@ and @bi@ respectively. All pairs must have the same types of components.<br><br> ! ! Example: <br><br> ! @c> String(SeqOrderedPair(integer,rational))@ <br><br> ! ! will only match sequences of ordered pairs @(a,b)@ for which @a@ parses to an ! @integer@ and @b@ parses to a @rational@. Note that currently this type checking ! is not recursive, so that @a@ and @b@ are interpreted as parsed Maple ! expressions, not strings (unless the student encloses them in quotes). ! ", ! proc(s::anything) ! local S,t1,t2,T,n,LPorB,RPorB,NotComma,OnePair,OnePPair, ! OneBPair,SeqPair,SeqPPair,SeqBPair,BSeqBPair: ! t1:='anything'; t2:='anything'; ! if nargs>1 then t1:=args[2] fi: ! if nargs>2 then t2:=args[3] fi: ! if not type(s,string) then return type(s,list([t1,t2])) fi; ! S:=`Util/RemoveWhiteSpace`(s): ! # build our regular expression ! NotComma:="[^,]"; ! OnePPair:=cat("\\((",NotComma,"+,",NotComma,"+)","\\)"); ! # convert all (a,b) to [a,b] ! S:=StringTools:-RegSubs(OnePPair = "[\\1]",S); ! # if they omitted surrounding brackets, supply them ! if S[1..2]<>"[[" or S[-2..-1]<>"]]" then S:=cat("[",S,"]"): fi: ! T:=`aim/SafeParse`(S): ! return evalb(T['Status']="OK" and type(T['Value'],list([t1,t2]))) ! end ! ): ! ! `Package/Assign`( ! `Parse/OrderedTuple`::list, ! "Parses a string of type @OrderedPair@, @OrderedTriple@, or @OrderedTuple@ and returns ! the Maple list of elements that the string represents. If the string cannot be ! parsed it returns @NULL@. ! ", ! proc(s::{string,list}) ! local S,T,n: ! if type([s],[list]) then return s fi; ! S:=`Util/RemoveWhiteSpace`(s): ! n:=length(S); ! # convert () to [] ! if S[1]="(" and S[-1]=")" and n>2 then S:=cat("[",S[2..-2],"]"); fi: ! # if they omitted brackets, supply them ! if S[1]<>"[" or S[-1]<>"]" and n>2 then S:=cat("[",S,"]"): fi: ! T:=`aim/SafeParse`(S): ! if T['Status']="OK" then ! return T['Value'] ! else ! return NULL; ! fi ! end ! ): ! ! `Package/Assign`( ! `Parse/SeqOrderedTuple`::list(list), ! "Parses a string of type @SeqOrderedPair@ and returns ! the Maple list of elements that the string represents. If the string cannot be ! parsed it returns @NULL@. ! ", ! proc(s::{string,list}) ! local S,T,n,NotComma,OnePPair: ! if type([s],[list(list)]) then return s fi; ! S:=`Util/RemoveWhiteSpace`(s): ! # build our regular expression ! NotComma:="[^,]"; ! OnePPair:=cat("\\((",NotComma,"+,",NotComma,"+)","\\)"); ! # convert all (a,b) to [a,b] ! S:=StringTools:-RegSubs(OnePPair = "[\\1]",S); ! # if they omitted surrounding brackets, supply them ! if S[1..2]<>"[[" or S[-2..-1]<>"]]" then S:=cat("[",S,"]"): fi: ! T:=`aim/SafeParse`(S): ! if T['Status']="OK" then ! return T['Value'] ! else ! return NULL; ! fi ! end ! ): ! ! EndPackage(): \ No newline at end of file |
From: <mo...@us...> - 2004-01-12 06:02:21
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim In directory sc8-pr-cvs1:/tmp/cvs-serv32142/WEB-INF/maple/aim Modified Files: Inert.mpl Log Message: Added Inert/Pair and Inert/PairSequence to represent ordered pairs and finte sequences of ordered pairs. Index: Inert.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Inert.mpl,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Inert.mpl 20 Dec 2003 21:42:22 -0000 1.10 --- Inert.mpl 12 Jan 2004 06:02:18 -0000 1.11 *************** *** 1332,1335 **** --- 1332,1390 ---- ): + ################################################################### + # tuples + ################################################################### + + ################################################################### + `Package/Assign`( + `Inert/Pair`::Inert, + "The Inert ordered pair.", + `new/Inert`( (x,y)->[x,y], # Map + "\\left(%1,%2\\right)", # TeX + 2, # Nargs + 'anything', # Domain + "Pair", # Name + false, # Needs parentheses + true, # Provides parentheses + false, # Associative + 0) # Precedence + ): + + `Package/Assign`( + Pair::procedure, + "", + proc() Apply(`Inert/Pair`,args) end + ): + + ################################################################### + `Package/Assign`( + `Inert/PairSequence`::Inert, + "A sequence of ordered pairs.", + `new/Inert`( proc() [args] end, # Map + proc() # TeX + local i,s; + s:=`if`(nargs>0, + cat("\\left(",TeX(args[1][1]),",",TeX(args[1][2]),"\\right)"), + ""); + for i from 2 to nargs do + s:=cat(s,",\\left(",TeX(args[i][1]),",",TeX(args[i][2]),"\\right)"); + od: + return s + end, + -1, # Nargs + [anything,anything], # Domain + "PairSequence", # Name + true, # Needs parentheses + false, # Provides parentheses + true, # Associative + 0) # Precedence + ): + + `Package/Assign`( + PairSequence::procedure, + "", + proc() Apply(`Inert/PairSequence`,args) end + ): + ################################################################### # END Inert |
From: <mo...@us...> - 2004-01-12 05:59:51
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim In directory sc8-pr-cvs1:/tmp/cvs-serv31526/WEB-INF/maple/aim Modified Files: Number.mpl Log Message: A documentation tweak. Index: Number.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Number.mpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Number.mpl 26 Oct 2003 04:03:58 -0000 1.2 --- Number.mpl 12 Jan 2004 05:59:48 -0000 1.3 *************** *** 268,272 **** `Package/Assign`( `type/PrimeFactorization`, ! "Matches strings which are the prime factorization of a positive integer, e.g. \"2*3^2**7^2*11\". Whitespace is ignored. The factors can be entered in any order and a power of the same prime can occur more than once, e.g. \"2*2*3*3^2\". Zero exponents are also allowed, e.g. \"2*3^0*5^2\". This type is useful when asking the students to enter the prime factorization of a number.", And(string,PrimeFactorizationString) ): --- 268,272 ---- `Package/Assign`( `type/PrimeFactorization`, ! "Matches strings which are the prime factorization of a positive integer, e.g. \"2*3^2*7^2*11\". Whitespace is ignored. The factors can be entered in any order and a power of the same prime can occur more than once, e.g. \"2*2*3*3^2\". Zero exponents are also allowed, e.g. \"2*3^0*5^2\". This type is useful when asking the students to enter the prime factorization of a number.", And(string,PrimeFactorizationString) ): |
From: <mo...@us...> - 2004-01-12 05:59:05
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim In directory sc8-pr-cvs1:/tmp/cvs-serv31426/WEB-INF/maple/aim Modified Files: SET.mpl Log Message: Updates Set/isEqual so it now calls aim/TestSet Index: SET.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/SET.mpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SET.mpl 19 Sep 2003 04:11:15 -0000 1.3 --- SET.mpl 12 Jan 2004 05:59:02 -0000 1.4 *************** *** 86,95 **** `Package/Assign`( `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 ): --- 86,100 ---- `Package/Assign`( `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). It uses #aim/TestSet# to do the comparison. An optional 3rd argument is a comparison function that is passed along to #`aim/TestSet`# as it's third argument.", 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); ! if nargs=3 then ! `aim/TestSet`(a,b,args[3]); ! else ! `aim/TestSet`(a,b); ! fi end ): |
From: <mo...@us...> - 2004-01-12 05:58:15
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1:/tmp/cvs-serv31316/WEB-INF/maple Modified Files: PackageList Added Files: RandArgs.mpl Log Message: Added a new Package RandArgs and associated documention and hooks. This provides a library of predefined arguments for Rand and a html look-up catalog so that a question author can simply look up the kind of random expression he wants to use in his question in the catalog and then use it directly with no further programming needed. --- NEW FILE: RandArgs.mpl --- # Copyright (C) 2003 Ken Monks # Distributed without warranty under the GPL - see README for details read("Package.mpl"): Package("RandArgs", "This package contains a large collection of premade arguments to Rand(). See the catalog for details. " ): # Parameters `Package/Assign`(`Rand/SmallIntMax`,"",9): `Package/Assign`(`Rand/SmallDenominators`,"",[2..6,8]): `Package/Assign`(`Rand/Def`,"",[-9..-1,1..9]): # Numbers `Package/Assign`(`Rand/Posint`,"",[1..`Rand/SmallIntMax`]): `Package/Assign`(`Rand/Negint`,"",[-`Rand/SmallIntMax`..-1]): `Package/Assign`(`Rand/Integer`,"",[-`Rand/SmallIntMax`..`Rand/SmallIntMax`]): [...1543 lines suppressed...] # The following lines are used to create the "catalog" documentation for RandArgs. # This takes a very long time, however so they are commented out except when making # changes to RandArgs. DO NOT DELETE! Note that if you use them yourself you should # make the obvious system-specific modifications. A better mechanism for turning this # on and off should be devised some day. # _cdir_:=currentdir(): # currentdir("D:\\AIM\\tomcat\\webapps\\ROOT\\doc"): # writeto("RandArgCatalog.tex"): #`RandArgs/MakeCatalog`(`RandArgs/StructuredDefinedNames`,5); # system("latex -q RandArgCatalog"); # system("echo ."); # system("tth RandArgCatalog"); # system("echo ."); # writeto(terminal): # currentdir(_cdir_): # unassign('_cdir_'); EndPackage(): Index: PackageList =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/PackageList,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PackageList 10 Oct 2003 15:44:14 -0000 1.7 --- PackageList 12 Jan 2004 05:58:12 -0000 1.8 *************** *** 65,67 **** --- 65,68 ---- aim/try/Question aim/try/Quiz + RandArgs Site |
From: <mo...@us...> - 2004-01-12 05:58:15
|
Update of /cvsroot/aimmath/AIM/doc In directory sc8-pr-cvs1:/tmp/cvs-serv31316/doc Modified Files: AuthoringPackages.html Added Files: RandArgCatalog.html Log Message: Added a new Package RandArgs and associated documention and hooks. This provides a library of predefined arguments for Rand and a html look-up catalog so that a question author can simply look up the kind of random expression he wants to use in his question in the catalog and then use it directly with no further programming needed. --- NEW FILE: RandArgCatalog.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <meta name="GENERATOR" content="TtH 3.30"> <style type="text/css"> div.p { margin-top: 7pt;}</style> <style type="text/css"><!-- td div.comp { margin-top: -0.6ex; margin-bottom: -1ex;} td div.comb { margin-top: -0.6ex; margin-bottom: -.6ex;} td div.hrcomp { line-height: 0.9; margin-top: -0.8ex; margin-bottom: -1ex;} td div.norm {line-height:normal;} span.roman {font-family: serif; font-style: normal; font-weight: normal;} span.overacc2 {position: relative; left: .8em; top: -1.2ex;} span.overacc1 {position: relative; left: .6em; top: -1.2ex;} --></style> <center><font size="+3"> <title>Catalog of Built-in Rand Args</title> Catalog of Built-in Rand Args [...4489 lines suppressed...] >x (2 x <font face="symbol">-</font >8 y z<sup>5</sup>), 5 x <font face="symbol">-</font >8 y<sup>3</sup> z<sup>2</sup>, (7 x<sup>3</sup> z<sup>2</sup> <font face="symbol">-</font >9 y) ln(z), </td><td nowrap="nowrap" align="center"> ln(x) <div class="hrcomp"><hr noshade="noshade" size="1"/></div>x<sup>2</sup> z<sup><font face="symbol">-</font >1/2</sup> <font face="symbol">Ö</font >y<br /></td><td nowrap="nowrap" align="center"> , 3 z <font face="symbol">-</font >3 x<sup>3</sup> y<sup>3</sup></td></tr></table> </td></tr></table> <br /><br /><hr /><small>File translated from T<sub><font size="-1">E</font></sub>X by <a href="http://hutchinson.belmont.ma.us/tth/"> T<sub><font size="-1">T</font></sub>H</a>, version 3.30.<br />On 19 Dec 2003, 21:00.</small> </html> Index: AuthoringPackages.html =================================================================== RCS file: /cvsroot/aimmath/AIM/doc/AuthoringPackages.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AuthoringPackages.html 13 Oct 2003 21:17:34 -0000 1.4 --- AuthoringPackages.html 12 Jan 2004 05:58:12 -0000 1.5 *************** *** 35,38 **** --- 35,41 ---- numerals, converting numbers to words, etc)</li> <li><a href="Random.html"><b>Random</b></a> - defines some utility functions for generating random questions. The Rand() command is an all purpose recursive random-thing-maker.</li> + <li><a href="RandArgCatalog.html" target="_blank"><b>RandArgs</b></a> - A library of predefined + arguments to Rand with samples of the expressions each + produces. </li> <li><a href="aim/AnswerHints.html"><b>AnswerHints</b></a> - This package defines utilities useful for detecting common mathematical errors in |
From: <gus...@us...> - 2004-01-11 19:48:31
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment In directory sc8-pr-cvs1:/tmp/cvs-serv19339 Modified Files: lib.php Log Message: grades are now floats Index: lib.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/lib.php,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** lib.php 11 Jan 2004 19:43:12 -0000 1.48 --- lib.php 11 Jan 2004 19:48:27 -0000 1.49 *************** *** 873,879 **** $hasaim = $math_assignment->aimquiz; ! $papergrade = min(max((int) $student->papergrade, 0), $math_assignment->papergrade); if ($hasaim) { ! $aimgrade = min(max((int) $student->aimgrade, 0), $math_assignment->aimgrade); } if (!($student->papergrade >=0 or $student->aimgrade >=0)) { // Don't send email if no work was completed --- 873,879 ---- $hasaim = $math_assignment->aimquiz; ! $papergrade = min(max($student->papergrade, 0), $math_assignment->papergrade); if ($hasaim) { ! $aimgrade = min(max($student->aimgrade, 0), $math_assignment->aimgrade); } if (!($student->papergrade >=0 or $student->aimgrade >=0)) { // Don't send email if no work was completed |
From: <gus...@us...> - 2004-01-11 19:45:30
|
Update of /cvsroot/aimmath/moodle/lang/en/help/math_assignment In directory sc8-pr-cvs1:/tmp/cvs-serv18662 Removed Files: config_grademultiplier.html Log Message: grades are now floats --- config_grademultiplier.html DELETED --- |
From: <gus...@us...> - 2004-01-11 19:43:16
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment/db In directory sc8-pr-cvs1:/tmp/cvs-serv18245/db Modified Files: mysql.sql Log Message: grades are now floats Index: mysql.sql =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/db/mysql.sql,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** mysql.sql 11 Jan 2004 14:59:53 -0000 1.14 --- mysql.sql 11 Jan 2004 19:43:12 -0000 1.15 *************** *** 31,48 **** # ! # Table structure for table `prefix_math_assignment_grades` # ! CREATE TABLE prefix_math_assignment_grades ( id int(10) unsigned NOT NULL auto_increment, assignment int(10) unsigned NOT NULL default '0', userid int(10) unsigned NOT NULL default '0', ! papergrade int(10) NOT NULL default '-1', papertimemodified int(10) unsigned NOT NULL default '0', ! aimgrade int(10) NOT NULL default '-1', aimtimemodified int(10) unsigned NOT NULL default '0', aimoverride tinyint(1) NOT NULL default '0', aimcomment text NOT NULL, ! PRIMARY KEY (id) ) TYPE=MyISAM COMMENT='Final math assignment grade (may be best of several attempts'; --- 31,49 ---- # ! # Table structure for table `mdl_math_assignment_grades` # ! CREATE TABLE mdl_math_assignment_grades ( id int(10) unsigned NOT NULL auto_increment, assignment int(10) unsigned NOT NULL default '0', userid int(10) unsigned NOT NULL default '0', ! papergrade float NOT NULL default '-1', papertimemodified int(10) unsigned NOT NULL default '0', ! aimgrade float NOT NULL default '-1', aimtimemodified int(10) unsigned NOT NULL default '0', aimoverride tinyint(1) NOT NULL default '0', aimcomment text NOT NULL, ! PRIMARY KEY (id), ! KEY assignment (assignment,userid) ) TYPE=MyISAM COMMENT='Final math assignment grade (may be best of several attempts'; *************** *** 91,95 **** INSERT `prefix_config` SET `name`="math_assignment_debug",`value`="0"; INSERT `prefix_config` SET `name`="math_assignment_auto_register",`value`="1"; - 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_aim_display", `value`="1"; --- 92,95 ---- |
From: <gus...@us...> - 2004-01-11 19:43:16
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment In directory sc8-pr-cvs1:/tmp/cvs-serv18245 Modified Files: config.html lib.php Log Message: grades are now floats Index: config.html =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/config.html,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** config.html 11 Jan 2004 14:08:06 -0000 1.7 --- config.html 11 Jan 2004 19:43:12 -0000 1.8 *************** *** 2,6 **** $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"); --- 2,5 ---- *************** *** 34,42 **** <td align="left"><?php helpbutton ("config_autoregister", $strautoregister, "math_assignment"); ?></td> </tr> ! <tr valign="top"> ! <td align="right"><p><b><?php echo $strgrademultiplier; ?>:</b></p></td> ! <td align="left"><input type="text" name="math_assignment_grade_multiplier" size="20" maxlength="20" value="<?php echo $CFG->math_assignment_grade_multiplier; ?>" /></td> ! <td align="left"><?php helpbutton ("config_grademultiplier", $strgrademultiplier, "math_assignment"); ?></TD> ! </tr> <tr valign="top"> <td align="right"><p><b><?php echo $strlatexoutput; ?>:</b></p></td> --- 33,37 ---- <td align="left"><?php helpbutton ("config_autoregister", $strautoregister, "math_assignment"); ?></td> </tr> ! <tr valign="top"> <td align="right"><p><b><?php echo $strlatexoutput; ?>:</b></p></td> Index: lib.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/lib.php,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** lib.php 11 Jan 2004 17:20:31 -0000 1.47 --- lib.php 11 Jan 2004 19:43:12 -0000 1.48 *************** *** 644,651 **** // find the row which gives the totals if (preg_match("/<td(?:\s[^<>]*?|)>Total<\/td>(?:.(?!<td\s|<td>))*.?<td(?:\s[^<>]*?|)>((?:.(?!<\/td>))*?.?)<\/td>(?:.(?!<td\s|<td>))*.?<td(?:\s[^<>]*?|)>((?:.(?!<\/td>))*?.?)<\/td>/si", $data, $matches)) { ! if (empty($CFG->math_assignment_grade_multiplier)) ! $CFG->math_assignment_grade_multiplier = 1.0; ! $max_grade = (int) (((float) decodeHTML($matches[1])) * ((float) $CFG->math_assignment_grade_multiplier)); ! $grade = (int) (((float) decodeHTML($matches[2])) * ((float) $CFG->math_assignment_grade_multiplier)); } } --- 644,649 ---- // find the row which gives the totals if (preg_match("/<td(?:\s[^<>]*?|)>Total<\/td>(?:.(?!<td\s|<td>))*.?<td(?:\s[^<>]*?|)>((?:.(?!<\/td>))*?.?)<\/td>(?:.(?!<td\s|<td>))*.?<td(?:\s[^<>]*?|)>((?:.(?!<\/td>))*?.?)<\/td>/si", $data, $matches)) { ! $max_grade = (float) decodeHTML($matches[1]); ! $grade = (float) decodeHTML($matches[2]); } } *************** *** 1110,1113 **** --- 1108,1112 ---- if (!$math_assignment->papersheetsreturned) { $papergrade = "<span style=\"color: silver \">$papergrade</span>"; + } // don't give results if assignment still open if ($math_assignment->timedue > time()) { |
From: <gus...@us...> - 2004-01-11 17:20:35
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment In directory sc8-pr-cvs1:/tmp/cvs-serv18402 Modified Files: lib.php Log Message: grades are now not withheld until the assignment closes but are displayed in grey Index: lib.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/lib.php,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** lib.php 11 Jan 2004 16:36:20 -0000 1.46 --- lib.php 11 Jan 2004 17:20:31 -0000 1.47 *************** *** 1,6 **** <?PHP // $Id$ - //@include_once("../../lib/t2mml/edit.php"); // TeX to MathML converter script - /// Library of functions and constants for module math_assignment --- 1,4 ---- *************** *** 243,263 **** /// indexed by user. It also returns a maximum allowed grade. ! $math_assignment = get_record("math_assignment", "id", $math_assignmentid); ! ! // If there is a hand-marked component then don't display grades until they are finalized ! if ($math_assignment->papergrade > 0 and !$math_assignment->papersheetsreturned) { ! return false; ! } ! // If there is only an aim quiz dont display grades until after due date ! // This actually turned out to be a nuisance so I am commenting this out ! //else if ($math_assignment->papergrade <= 0 and $math_assignment->timedue > time()) { ! // return false; ! //} else { ! $return->maxgrade = $math_assignment->papergrade+ $math_assignment->aimgrade; ! $return->grades = math_assignment_get_grades($math_assignment, "id", "asc"); ! if ($return->grades) ! array_walk($return->grades, create_function('&$val','$val = $val->totalgrade;')); ! return $return; ! //} } --- 241,252 ---- /// indexed by user. It also returns a maximum allowed grade. ! $math_assignment = get_record("math_assignment", "id", $math_assignmentid); ! ! $return->maxgrade = $math_assignment->papergrade+ $math_assignment->aimgrade; ! $return->grades = math_assignment_get_grades($math_assignment, "id", "asc"); ! if ($return->grades) ! array_walk($return->grades, create_function('&$val','$val = $val->totalgrade;')); ! return $return; ! } *************** *** 710,714 **** $photo = print_user_picture($userid, 1, $haspicture, true, true); return "<th align=\"left\">Student photo</th><td>$photo</td></tr><tr> ! <th align=\"left\">Student ID</th>\n<td>$matches[1]</td>";' ), $out ); --- 699,703 ---- $photo = print_user_picture($userid, 1, $haspicture, true, true); return "<th align=\"left\">Student photo</th><td>$photo</td></tr><tr> ! <th align=\"left\">Student ID</th>\n<td>$matches[1]</td>";' ), $out ); *************** *** 833,867 **** if ($students) { foreach ($students as $key => $student) { ! if ($students[$key] = get_record_sql("SELECT firstname, lastname, email, username, mailformat, picture FROM {$CFG->prefix}user WHERE id = '$key' AND deleted = '0'")) { ! $grade = get_record_sql("SELECT papergrade, aimgrade, aimoverride, aimcomment FROM {$CFG->prefix}math_assignment_grades WHERE assignment = '$math_assignment->id' and userid = '$key'"); ! if ($grade) { ! $students[$key]->papergrade = $grade->papergrade; ! $students[$key]->aimgrade = $grade->aimgrade; ! $students[$key]->aimoverride = $grade->aimoverride ; ! $students[$key]->aimcomment = $grade->aimcomment; ! $students[$key]->totalgrade = math_assignment_total_grade($math_assignment, $grade); ! } ! else { ! $students[$key]->papergrade = -1; ! $students[$key]->aimgrade = -1; ! $students[$key]->aimoverride = AIMOVR_OFF ; ! $students[$key]->aimcomment = ""; ! $students[$key]->totalgrade = 0; ! } ! } ! else { ! // assume it failed because deleted was not zero ! unset($students[$key]); ! } } // sort if (strcasecmp($sortdir, "desc") == 0) ! $mult = -1; else ! $mult = 1; if (strcasecmp($sort, "id") == 0) ! uksort($students, create_function('$a, $b', 'return (($a > $b) ? 1 : -1) * ' . $mult . ';')); else ! uasort($students, create_function('$a, $b', 'return (($a->' . $sort . ' > $b->' . $sort . ') ? 1 : -1) * ' . $mult . ';')); } break; --- 822,856 ---- if ($students) { foreach ($students as $key => $student) { ! if ($students[$key] = get_record_sql("SELECT firstname, lastname, email, username, mailformat, picture FROM {$CFG->prefix}user WHERE id = '$key' AND deleted = '0'")) { ! $grade = get_record_sql("SELECT papergrade, aimgrade, aimoverride, aimcomment FROM {$CFG->prefix}math_assignment_grades WHERE assignment = '$math_assignment->id' and userid = '$key'"); ! if ($grade) { ! $students[$key]->papergrade = $grade->papergrade; ! $students[$key]->aimgrade = $grade->aimgrade; ! $students[$key]->aimoverride = $grade->aimoverride ; ! $students[$key]->aimcomment = $grade->aimcomment; ! $students[$key]->totalgrade = math_assignment_total_grade($math_assignment, $grade); ! } ! else { ! $students[$key]->papergrade = -1; ! $students[$key]->aimgrade = -1; ! $students[$key]->aimoverride = AIMOVR_OFF ; ! $students[$key]->aimcomment = ""; ! $students[$key]->totalgrade = 0; ! } ! } ! else { ! // assume it failed because deleted was not zero ! unset($students[$key]); ! } } // sort if (strcasecmp($sortdir, "desc") == 0) ! $mult = -1; else ! $mult = 1; if (strcasecmp($sort, "id") == 0) ! uksort($students, create_function('$a, $b', 'return (($a > $b) ? 1 : -1) * ' . $mult . ';')); else ! uasort($students, create_function('$a, $b', 'return (($a->' . $sort . ' > $b->' . $sort . ') ? 1 : -1) * ' . $mult . ';')); } break; *************** *** 1113,1123 **** } if ($math_assignment->papergrade > 0) { ! if (!$math_assignment->papersheetsreturned) { ! $papergrade = get_string("notpublished", "math_assignment"); ! } else if ($grade->papergrade >= 0) { $papergrade = "<b>$grade->papergrade / $math_assignment->papergrade</b>"; } else if ($grade->papergrade = -1) { $papergrade = "<b>-- / $math_assignment->papergrade</b>"; } if ($math_assignment->timedue > time()) { $papergrade = $stropen; --- 1102,1114 ---- } if ($math_assignment->papergrade > 0) { ! if ($grade->papergrade >= 0) { $papergrade = "<b>$grade->papergrade / $math_assignment->papergrade</b>"; } else if ($grade->papergrade = -1) { $papergrade = "<b>-- / $math_assignment->papergrade</b>"; } + // display in grey if results have not been finalised + if (!$math_assignment->papersheetsreturned) { + $papergrade = "<span style=\"color: silver \">$papergrade</span>"; + // don't give results if assignment still open if ($math_assignment->timedue > time()) { $papergrade = $stropen; *************** *** 1167,1173 **** $row = array ($link); ! // show links to the solutions only after the due date if ($solurl) { ! if ($timenow > $math_assignment->timedue) $solutions = "<a href=\"$solurl\" target=\"solutions\">$strviewsolutions</a>"; else --- 1158,1164 ---- $row = array ($link); ! // show links to the solutions only after the solutiontime if ($solurl) { ! if ($timenow > $math_assignment->solutiontime) $solutions = "<a href=\"$solurl\" target=\"solutions\">$strviewsolutions</a>"; else |
From: <gus...@us...> - 2004-01-11 16:36:23
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment In directory sc8-pr-cvs1:/tmp/cvs-serv8539 Modified Files: lib.php Log Message: fixed bug in solutiontime. Index: lib.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/lib.php,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** lib.php 11 Jan 2004 14:08:06 -0000 1.45 --- lib.php 11 Jan 2004 16:36:20 -0000 1.46 *************** *** 20,24 **** // solution time ! $math_assignment->solutiontime = make_timestamp($math_assignment->dueyear, $math_assignment->duemonth,$math_assignment->dueday, $math_assignment->duehour, $math_assignment->dueminute); if ($math_assignment->solutiontime < $math_assignment->timedue) { $math_assignment->solutiontime += 86400; --- 20,24 ---- // solution time ! $math_assignment->solutiontime = make_timestamp($math_assignment->dueyear, $math_assignment->duemonth,$math_assignment->dueday, $math_assignment->solutionhour, $math_assignment->solutionminute); if ($math_assignment->solutiontime < $math_assignment->timedue) { $math_assignment->solutiontime += 86400; *************** *** 87,91 **** // solution time ! $math_assignment->solutiontime = make_timestamp($math_assignment->dueyear, $math_assignment->duemonth,$math_assignment->dueday, $math_assignment->duehour, $math_assignment->dueminute); if ($math_assignment->solutiontime < $math_assignment->timedue) { $math_assignment->solutiontime += 86400; --- 87,91 ---- // solution time ! $math_assignment->solutiontime = make_timestamp($math_assignment->dueyear, $math_assignment->duemonth,$math_assignment->dueday, $math_assignment->solutionhour, $math_assignment->solutionminute); if ($math_assignment->solutiontime < $math_assignment->timedue) { $math_assignment->solutiontime += 86400; *************** *** 165,171 **** /// $return->info = a short text description ! if ($logs = get_records_select("log", "userid='$user->id' AND module='math_assig' ! AND action='view' AND ! (info='$math_assignment->id' OR info='$math_assignment->name')", "time ASC")) { $numviews = count($logs); --- 165,170 ---- /// $return->info = a short text description ! if ($logs = get_records_select("log", "userid='$user->id' AND module='math_assignment' ! AND action='view' AND info='$math_assignment->id'", "time ASC")) { $numviews = count($logs); *************** *** 185,197 **** global $CFG, $THEME; ! if ($logs = get_records_select("log", "userid='$user->id' AND module='math_assig' ! AND action='view' ! AND (info='$math_assignment->id' OR info='$math_assignment->name')", "time ASC")) { $numviews = count($logs); $lastlog = array_pop($logs); ! $aimlogs = get_records_select("log", "userid='$user->id' AND module='math_assig' ! AND action='aimpage' ! AND (info='$math_assignment->id' OR info='$math_assignment->name')", "time ASC"); $numaims = count($aimlogs); --- 184,194 ---- global $CFG, $THEME; ! if ($logs = get_records_select("log", "userid='$user->id' AND module='math_assignment' ! AND action='view' AND info='$math_assignment->id'", "time ASC")) { $numviews = count($logs); $lastlog = array_pop($logs); ! $aimlogs = get_records_select("log", "userid='$user->id' AND module='math_assignment' ! AND action='aimpage' AND info='$math_assignment->id'", "time ASC"); $numaims = count($aimlogs); |
Update of /cvsroot/aimmath/moodle/mod/math_assignment In directory sc8-pr-cvs1:/tmp/cvs-serv23019 Modified Files: aimpage.php deleteserver.php editgrade.php email.php pdfgen.php saveconfig.php subjectpage.php updatepapergrades.php view.php Log Message: improved logs Index: aimpage.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/aimpage.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** aimpage.php 11 Jan 2004 14:08:06 -0000 1.20 --- aimpage.php 11 Jan 2004 14:59:53 -0000 1.21 *************** *** 59,63 **** require_login($course->id); ! add_to_log($course->id, "math_assignment", "aimpage", "aimpage.php?id=$cm->id", "$math_assignment->name"); $isteacher = isteacher($course->id); --- 59,63 ---- require_login($course->id); ! add_to_log($course->id, "math_assignment", "AiM page", "aimpage.php?id=$cm->id", "$math_assignment->id"); $isteacher = isteacher($course->id); Index: deleteserver.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/deleteserver.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** deleteserver.php 11 Jan 2004 14:08:06 -0000 1.3 --- deleteserver.php 11 Jan 2004 14:59:53 -0000 1.4 *************** *** 8,11 **** --- 8,15 ---- require_variable($id); // server id to delete optional_variable($newserver, 0); // server to replace the deleted one + + require_login($course->id); + + add_to_log(1, "math_assignment", "delete server", "servers.php", "$id"); if (! $site = get_site()) { Index: editgrade.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/editgrade.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** editgrade.php 11 Jan 2004 14:08:06 -0000 1.5 --- editgrade.php 11 Jan 2004 14:59:53 -0000 1.6 *************** *** 28,32 **** require_login($course->id); ! add_to_log($course->id, "math_assignment", "editgrade", "editgrade.php?id=$math_assignment->id&userid=$userid", isset($grade) ? "$grade" : ""); if (!isteacher($course->id)) { --- 28,32 ---- require_login($course->id); ! add_to_log($course->id, "math_assignment", "edit grade", "editgrade.php?id=$math_assignment->id&userid=$userid", isset($grade) ? "$grade" : ""); if (!isteacher($course->id)) { Index: email.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/email.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** email.php 10 Nov 2003 12:15:29 -0000 1.5 --- email.php 11 Jan 2004 14:59:53 -0000 1.6 *************** *** 34,38 **** $teacher = $USER; ! add_to_log($course->id, "math_assignment", "finalise grades", "view.php?id=$cm->id", "$math_assignment->name"); if (!isteacher($course->id)) { --- 34,38 ---- $teacher = $USER; ! add_to_log($course->id, "math_assignment", "finalise grades", "view.php?id=$cm->id", "$math_assignment->id"); if (!isteacher($course->id)) { Index: pdfgen.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/pdfgen.php,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** pdfgen.php 11 Jan 2004 14:08:06 -0000 1.25 --- pdfgen.php 11 Jan 2004 14:59:53 -0000 1.26 *************** *** 39,43 **** } ! add_to_log($course->id, "math_assignment", "pdfgen", "pdfgen.php?id=$math_assignment->id", $type); if ($math_assignment->aimquiz) { --- 39,43 ---- } ! add_to_log($course->id, "math_assignment", "$type", "pdfgen.php?id=$math_assignment->id&type=$type", $math_assignment->id); if ($math_assignment->aimquiz) { Index: saveconfig.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/saveconfig.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** saveconfig.php 11 Jan 2004 14:08:06 -0000 1.5 --- saveconfig.php 11 Jan 2004 14:59:53 -0000 1.6 *************** *** 12,15 **** --- 12,17 ---- redirect("$CFG->wwwroot/$CFG->admin/index.php"); } + + add_to_log(1, "math_assignment", "configure", "", ""); if (!isadmin()) { Index: subjectpage.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/subjectpage.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** subjectpage.php 11 Jan 2004 14:08:06 -0000 1.4 --- subjectpage.php 11 Jan 2004 14:59:53 -0000 1.5 *************** *** 28,32 **** } ! add_to_log($course->id, "math_assignment", "aimsubjectpage", "aimsubjectpage.php?id=$id", "$subject->name"); if (!$_POST) { --- 28,32 ---- } ! add_to_log($course->id, "math_assignment", "AiM subject", "aimsubjectpage.php?id=$id", "$subject->id"); if (!$_POST) { Index: updatepapergrades.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/updatepapergrades.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** updatepapergrades.php 11 Jan 2004 13:18:17 -0000 1.5 --- updatepapergrades.php 11 Jan 2004 14:59:53 -0000 1.6 *************** *** 24,28 **** require_login($course->id); ! add_to_log($course->id, "math_assignment", "updatepapergrades", "updatepapergrades.php?id=$math_assignment->id", ""); if (!isteacher($course->id)) { --- 24,28 ---- require_login($course->id); ! add_to_log($course->id, "math_assignment", "update papergrades", "view.php?q=$math_assignment->id", $math_assignment->id); if (!isteacher($course->id)) { Index: view.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/view.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** view.php 11 Jan 2004 14:08:06 -0000 1.26 --- view.php 11 Jan 2004 14:59:53 -0000 1.27 *************** *** 46,50 **** require_login($course->id); ! add_to_log($course->id, "math_assignment", "view", "view.php?id=$cm->id", "$math_assignment->name"); if (isset ($outputchange)) { --- 46,50 ---- require_login($course->id); ! add_to_log($course->id, "math_assignment", "view", "view.php?id=$cm->id", "$math_assignment->id"); if (isset ($outputchange)) { |
From: <gus...@us...> - 2004-01-11 14:59:58
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment/db In directory sc8-pr-cvs1:/tmp/cvs-serv23019/db Modified Files: mysql.sql Log Message: improved logs Index: mysql.sql =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/db/mysql.sql,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** mysql.sql 6 Oct 2003 00:11:07 -0000 1.13 --- mysql.sql 11 Jan 2004 14:59:53 -0000 1.14 *************** *** 6,19 **** ! 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', ! papersheetsreturned tinyint(1) NOT NULL default '0', ! aimquiz varchar(255) NOT NULL default '', aimfocus tinyint(1) unsigned NOT NULL default '1', papergrade int(10) unsigned NOT NULL default '0', --- 6,23 ---- ! # ! # Table structure for table `prefix_math_assignment` ! # ! ! 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) default NULL, ! problemsisurl tinyint(1) unsigned NOT NULL default '1', ! solutions varchar(255) default NULL, ! solutionsisurl tinyint(1) unsigned NOT NULL default '1', ! papersheetsreturned tinyint(1) unsigned NOT NULL default '0', ! aimquiz varchar(255) default NULL, aimfocus tinyint(1) unsigned NOT NULL default '1', papergrade int(10) unsigned NOT NULL default '0', *************** *** 26,66 **** ! 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`) ! ) TYPE=MyISAM COMMENT='AiM subject used by each course'; ! CREATE TABLE `prefix_math_assignment_server` ( ! `id` int(10) unsigned NOT NULL auto_increment, ! `name` varchar(255) NOT NULL default '', ! `address` varchar(255) NOT NULL default '', ! `password` varchar(255) NOT NULL default '', ! PRIMARY KEY (`id`), ! UNIQUE `NAME` (`name`) ! ) TYPE=MyISAM COMMENT='AiM servers used by math assignments'; - CREATE TABLE `prefix_math_assignment_grades` ( - `assignment` int(10) unsigned NOT NULL default '0', - `userid` int(10) unsigned NOT NULL default '0', - `papergrade` int(10) NOT NULL default '-1', - `papertimemodified` int(10) unsigned NOT NULL default '0', - `aimgrade` int(10) NOT NULL default '-1', - `aimtimemodified` int(10) unsigned NOT NULL default '0', - `aimoverride` tinyint(1) NOT NULL default '0', - `aimcomment` text NOT NULL default '', - PRIMARY KEY (`assignment`,`userid`) - ) TYPE=MyISAM COMMENT='Final math assignment grade (may be best of several attempts)'; ! CREATE TABLE `mdl_math_assignment_seed` ( ! `assignment` int(10) NOT NULL default '0', ! `student` int(10) default NULL, ! `seed` int(8) NOT NULL default '0', ! PRIMARY KEY (`assignment`,`seed`) ) TYPE=MyISAM COMMENT='seeds for problem sheets'; INSERT `prefix_config` SET `name`="math_assignment_debug",`value`="0"; INSERT `prefix_config` SET `name`="math_assignment_auto_register",`value`="1"; --- 30,92 ---- ! # ! # Table structure for table `prefix_math_assignment_grades` ! # ! CREATE TABLE prefix_math_assignment_grades ( ! id int(10) unsigned NOT NULL auto_increment, ! assignment int(10) unsigned NOT NULL default '0', ! userid int(10) unsigned NOT NULL default '0', ! papergrade int(10) NOT NULL default '-1', ! papertimemodified int(10) unsigned NOT NULL default '0', ! aimgrade int(10) NOT NULL default '-1', ! aimtimemodified int(10) unsigned NOT NULL default '0', ! aimoverride tinyint(1) NOT NULL default '0', ! aimcomment text NOT NULL, ! PRIMARY KEY (id) ! ) TYPE=MyISAM COMMENT='Final math assignment grade (may be best of several attempts'; ! # ! # Table structure for table `prefix_math_assignment_seeds` ! # ! ! CREATE TABLE prefix_math_assignment_seeds ( ! id int(10) unsigned NOT NULL auto_increment, ! assignment int(10) NOT NULL default '0', ! student int(10) default NULL, ! seed int(8) NOT NULL default '0', ! PRIMARY KEY (id) ) TYPE=MyISAM COMMENT='seeds for problem sheets'; + # + # Table structure for table `prefix_math_assignment_servers` + # + + CREATE TABLE prefix_math_assignment_servers ( + id int(10) unsigned NOT NULL auto_increment, + name varchar(255) NOT NULL default '', + address varchar(255) NOT NULL default '', + password varchar(255) NOT NULL default '', + PRIMARY KEY (id), + UNIQUE KEY NAME (name) + ) TYPE=MyISAM COMMENT='AiM servers used by math assignments'; + + + # + # Table structure for table `prefix_math_assignment_subjects` + # + + CREATE TABLE prefix_math_assignment_subjects ( + id int(10) unsigned NOT NULL auto_increment, + 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 (id) + ) TYPE=MyISAM COMMENT='AiM subject used by each course'; + + INSERT `prefix_config` SET `name`="math_assignment_debug",`value`="0"; INSERT `prefix_config` SET `name`="math_assignment_auto_register",`value`="1"; *************** *** 70,71 **** --- 96,106 ---- INSERT `prefix_config` SET `name`="math_assignment_default_email_host", `value`=""; INSERT `prefix_config` SET `name`="math_assignment_secretary_email", `value`=""; + + INSERT INTO `prefix_log_display` VALUES ('math_assignment', 'solutions', 'math_assignment', 'name'); + INSERT INTO `prefix_log_display` VALUES ('math_assignment', 'problems', 'math_assignment', 'name'); + INSERT INTO `prefix_log_display` VALUES ('math_assignment', 'AiM page', 'math_assignment', 'name'); + INSERT INTO `prefix_log_display` VALUES ('math_assignment', 'finalise grades', 'math_assignment', 'name'); + INSERT INTO `prefix_log_display` VALUES ('math_assignment', 'AiM subject', 'math_assignment_subjects', 'name'); + INSERT INTO `prefix_log_display` VALUES ('math_assignment', 'update papergrades', 'math_assignment', 'name'); + INSERT INTO `prefix_log_display` VALUES ('math_assignment', 'view', 'math_assignment', 'name'); + INSERT INTO `prefix_log_display` VALUES ('math_assignment', 'delete server', 'math_assignment_servers', 'name'); |