aimmath-commit Mailing List for AiM Assessment in Mathematics (Page 20)
Brought to you by:
gustav_delius,
npstrick
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
(73) |
Aug
(96) |
Sep
(240) |
Oct
(34) |
Nov
(12) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(31) |
Feb
(6) |
Mar
(17) |
Apr
(6) |
May
(5) |
Jun
|
Jul
|
Aug
(2) |
Sep
(2) |
Oct
(19) |
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
(14) |
Apr
(33) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <gus...@us...> - 2003-08-26 18:31:26
|
Update of /cvsroot/aimmath/AIM In directory sc8-pr-cvs1:/tmp/cvs-serv8393 Added Files: install.html Log Message: simply forwards to the installation instructions in doc/install.html --- NEW FILE: install.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <TITLE>Installation Instructions</TITLE> <META http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <meta http-equiv="refresh" content="0; URL=doc/install.html"> </HEAD> <BODY> You will be forwarded automatically to the <a href="doc/install.html">installation instructions</a>. </BODY> </HTML> |
From: <gus...@us...> - 2003-08-26 18:06:16
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1:/tmp/cvs-serv3815/WEB-INF/maple Modified Files: Servlet.mpl Log Message: no longer copies com.oreilly classes Index: Servlet.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/Servlet.mpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Servlet.mpl 25 Aug 2003 21:47:18 -0000 1.3 --- Servlet.mpl 26 Aug 2003 18:06:06 -0000 1.4 *************** *** 201,284 **** ###################################################################### - # - # This section used to create a file server.xml and use it to - # overwrite Tomcat's server.xml. There is no reason to do this. - # - # file := cat(webinf,"/server.xml"): - # - # fd := traperror(fopen(file,'WRITE')): - # - # if fd = lasterror then - # printf("Cannot open web.xml for writing:\n%a\n\n",fd): - # `quit`(1): - # fi: - # - # port := ServletConfig['TomcatPort']: - # ctxt := ServletConfig['TomcatContext']: - # path := `if`(ctxt = "ROOT","",ctxt): - # - # fprintf(fd," - # <!-- AIM Server Configuration File --> - # - # <!-- This is automatically generated from data in ServletConfig.mpl - # by running Servlet.mpl. The file ServletConfig.mpl is in turn - # automatically generated by AutoConf.mpl, using values supplied - # in ManualConfig.mpl if necessary. - # --> - # - # <Server port=\"8005\" shutdown=\"SHUTDOWN\" debug=\"0\"> - # <Service name=\"Tomcat-Standalone\"> - # <Connector className=\"org.apache.catalina.connector.http.HttpConnector\" - # port=\"%s\" minProcessors=\"5\" maxProcessors=\"75\" - # enableLookups=\"true\" redirectPort=\"8443\" - # acceptCount=\"10\" debug=\"0\" connectionTimeout=\"60000\"/> - # <Engine name=\"Standalone\" defaultHost=\"localhost\" debug=\"0\"> - # <Logger className=\"org.apache.catalina.logger.FileLogger\" - # prefix=\"catalina_log.\" suffix=\".txt\" - # timestamp=\"true\"/> - # <Realm className=\"org.apache.catalina.realm.MemoryRealm\" /> - # <Host name=\"localhost\" debug=\"0\" - # appBase=\"webapps\" unpackWARs=\"true\"> - # <Valve className=\"org.apache.catalina.valves.AccessLogValve\" - # directory=\"logs\" prefix=\"access.\" suffix=\".txt\" - # pattern=\"common\"/> - # <Logger className=\"org.apache.catalina.logger.FileLogger\" - # directory=\"logs\" prefix=\"log.\" suffix=\".txt\" - # timestamp=\"true\"/> - # <Context path=\"%s\" docBase=\"%s\" debug=\"0\" reloadable=\"true\"/> - # </Host> - # </Engine> - # </Service> - # </Server> - # - # ",port,path,ctxt - # - # ): - # - # unassign('port','ctxt','dbse'): - # fclose(fd): - # - # file1 := - # os_maplename(cat(ServletConfig['CatalinaHome'],"/conf/server.xml")): - # file2 := - # os_maplename(cat(ServletConfig['CatalinaHome'],"/conf/server.bak")): - # - #if os_fileexists(file1) then - # printf("Backing up %s\n",file1): - # err := traperror(os_copy(file1,file2)): - # if err = lasterror then - # printf("Failed: %s\n\n",err): - # `quit`(1): - # fi: - #fi: - # - #printf("Copying %s to %s\n", file, file1): - #err := traperror(os_copy(file,file1)): - #if err = lasterror then - # printf("Failed: %s\n\n",err): - # `quit`(1): - #fi: - # - ###################################################################### if os_os = "Linux" then --- 201,204 ---- *************** *** 375,419 **** fi: - ###################################################################### - - # Copy the com.oreilly.servlet classes - - cosdir := "com/oreilly/servlet/": - cossource := cat("../cos/",cosdir): - - # Of the three lines below, the first is approved for Tomcat 4.0 but - # fails for Tomcat 4.1, and the reverse is true of the second. The - # third option is not really the approved place for general purpose - # classes, but it works with all versions of Tomcat. - #cosdest := cat(ServletConfig['CatalinaHome'],"/classes/",cosdir): - #cosdest := cat(ServletConfig['CatalinaHome'],"/shared/classes/",cosdir): - cosdest := cat(webinf,"/classes/",cosdir): - - if not(os_fileexists(cat(cosdest,"/multipart/Part.class"))) then - err := traperror(os_makedirectory(cat(cosdest,"/multipart"))): - - if err = lasterror then - printf("Could not create directory for com.oreilly.servlet classes\n"): - `quit`(1): - fi: - - for f in os_listfiles(cossource) do - if f <> "multipart" then - os_copy(cat(cossource,"/",f),cat(cosdest,"/",f)): - fi: - od: - - for f in os_listfiles(cat(cossource,"/multipart")) do - os_copy(cat(cossource,"/multipart/",f), - cat(cosdest,"/multipart/",f)): - od: - - if not(os_fileexists(cat(cosdest,"/multipart/Part.class"))) then - printf("Could not copy com.oreilly.servlet classes\n"): - `quit`(1): - fi: - else - printf("com.oreilly.servlet classes are already installed.\n"): - fi: read("Make.mpl"); --- 295,298 ---- |
From: <gus...@us...> - 2003-08-26 18:04:45
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1:/tmp/cvs-serv3347/WEB-INF/maple Modified Files: Tag: windows Servlet.mpl Log Message: no longer copies com.oreilly classes Index: Servlet.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/Servlet.mpl,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** Servlet.mpl 26 Aug 2003 08:27:43 -0000 1.3.2.1 --- Servlet.mpl 26 Aug 2003 18:04:23 -0000 1.3.2.2 *************** *** 240,323 **** ###################################################################### - # - # This section used to create a file server.xml and use it to - # overwrite Tomcat's server.xml. There is no reason to do this. - # - # file := cat(webinf,"/server.xml"): - # - # fd := traperror(fopen(file,'WRITE')): - # - # if fd = lasterror then - # printf("Cannot open web.xml for writing:\n%a\n\n",fd): - # `quit`(1): - # fi: - # - # port := ServletConfig['TomcatPort']: - # ctxt := ServletConfig['TomcatContext']: - # path := `if`(ctxt = "ROOT","",ctxt): - # - # fprintf(fd," - # <!-- AIM Server Configuration File --> - # - # <!-- This is automatically generated from data in ServletConfig.mpl - # by running Servlet.mpl. The file ServletConfig.mpl is in turn - # automatically generated by AutoConf.mpl, using values supplied - # in ManualConfig.mpl if necessary. - # --> - # - # <Server port=\"8005\" shutdown=\"SHUTDOWN\" debug=\"0\"> - # <Service name=\"Tomcat-Standalone\"> - # <Connector className=\"org.apache.catalina.connector.http.HttpConnector\" - # port=\"%s\" minProcessors=\"5\" maxProcessors=\"75\" - # enableLookups=\"true\" redirectPort=\"8443\" - # acceptCount=\"10\" debug=\"0\" connectionTimeout=\"60000\"/> - # <Engine name=\"Standalone\" defaultHost=\"localhost\" debug=\"0\"> - # <Logger className=\"org.apache.catalina.logger.FileLogger\" - # prefix=\"catalina_log.\" suffix=\".txt\" - # timestamp=\"true\"/> - # <Realm className=\"org.apache.catalina.realm.MemoryRealm\" /> - # <Host name=\"localhost\" debug=\"0\" - # appBase=\"webapps\" unpackWARs=\"true\"> - # <Valve className=\"org.apache.catalina.valves.AccessLogValve\" - # directory=\"logs\" prefix=\"access.\" suffix=\".txt\" - # pattern=\"common\"/> - # <Logger className=\"org.apache.catalina.logger.FileLogger\" - # directory=\"logs\" prefix=\"log.\" suffix=\".txt\" - # timestamp=\"true\"/> - # <Context path=\"%s\" docBase=\"%s\" debug=\"0\" reloadable=\"true\"/> - # </Host> - # </Engine> - # </Service> - # </Server> - # - # ",port,path,ctxt - # - # ): - # - # unassign('port','ctxt','dbse'): - # fclose(fd): - # - # file1 := - # os_maplename(cat(ServletConfig['CatalinaHome'],"/conf/server.xml")): - # file2 := - # os_maplename(cat(ServletConfig['CatalinaHome'],"/conf/server.bak")): - # - #if os_fileexists(file1) then - # printf("Backing up %s\n",file1): - # err := traperror(os_copy(file1,file2)): - # if err = lasterror then - # printf("Failed: %s\n\n",err): - # `quit`(1): - # fi: - #fi: - # - #printf("Copying %s to %s\n", file, file1): - #err := traperror(os_copy(file,file1)): - #if err = lasterror then - # printf("Failed: %s\n\n",err): - # `quit`(1): - #fi: - # - ###################################################################### if os_os = "Linux" then --- 240,243 ---- *************** *** 414,458 **** fi: - ###################################################################### - - # Copy the com.oreilly.servlet classes - - cosdir := "com/oreilly/servlet/": - cossource := cat("../cos/",cosdir): - - # Of the three lines below, the first is approved for Tomcat 4.0 but - # fails for Tomcat 4.1, and the reverse is true of the second. The - # third option is not really the approved place for general purpose - # classes, but it works with all versions of Tomcat. - #cosdest := cat(ServletConfig['CatalinaHome'],"/classes/",cosdir): - #cosdest := cat(ServletConfig['CatalinaHome'],"/shared/classes/",cosdir): - cosdest := cat(webinf,"/classes/",cosdir): - - if not(os_fileexists(cat(cosdest,"/multipart/Part.class"))) then - err := traperror(os_makedirectory(cat(cosdest,"/multipart"))): - - if err = lasterror then - printf("Could not create directory for com.oreilly.servlet classes\n"): - `quit`(1): - fi: - - for f in os_listfiles(cossource) do - if f <> "multipart" then - os_copy(cat(cossource,"/",f),cat(cosdest,"/",f)): - fi: - od: - - for f in os_listfiles(cat(cossource,"/multipart")) do - os_copy(cat(cossource,"/multipart/",f), - cat(cosdest,"/multipart/",f)): - od: - - if not(os_fileexists(cat(cosdest,"/multipart/Part.class"))) then - printf("Could not copy com.oreilly.servlet classes\n"): - `quit`(1): - fi: - else - printf("com.oreilly.servlet classes are already installed.\n"): - fi: read("Make.mpl"); --- 334,337 ---- |
From: <gus...@us...> - 2003-08-26 17:13:26
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/locales In directory sc8-pr-cvs1:/tmp/cvs-serv26233/WEB-INF/maple/locales Modified Files: en.mpl Log Message: adjusted note about hidden subjects to agree with Ken's change Index: en.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/locales/en.mpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** en.mpl 5 May 2003 03:25:46 -0000 1.2 --- en.mpl 26 Aug 2003 17:13:22 -0000 1.3 *************** *** 338,343 **** __("#Explain new subjects hidden") := "Note that newly created subjects are 'hidden', so that they are not ! visible to students until they are ready. Thus, a newly created ! subject will not be visible on this page unless you click 'Show hidden subjects' ": --- 338,342 ---- __("#Explain new subjects hidden") := "Note that newly created subjects are 'hidden', so that they are not ! visible to students until they are ready. They are however visible on this page unless you click 'Hide hidden subjects' ": |
From: <gus...@us...> - 2003-08-26 17:13:04
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/locales In directory sc8-pr-cvs1:/tmp/cvs-serv26162/WEB-INF/maple/locales Modified Files: Tag: windows en.mpl Log Message: adjusted note about hidden subjects to agree with Ken's change Index: en.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/locales/en.mpl,v retrieving revision 1.2 retrieving revision 1.2.6.1 diff -C2 -d -r1.2 -r1.2.6.1 *** en.mpl 5 May 2003 03:25:46 -0000 1.2 --- en.mpl 26 Aug 2003 17:12:59 -0000 1.2.6.1 *************** *** 338,343 **** __("#Explain new subjects hidden") := "Note that newly created subjects are 'hidden', so that they are not ! visible to students until they are ready. Thus, a newly created ! subject will not be visible on this page unless you click 'Show hidden subjects' ": --- 338,342 ---- __("#Explain new subjects hidden") := "Note that newly created subjects are 'hidden', so that they are not ! visible to students until they are ready. They are however visible on this page unless you click 'Hide hidden subjects' ": |
From: <gus...@us...> - 2003-08-26 14:58:36
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1:/tmp/cvs-serv1517/WEB-INF/maple Modified Files: Tag: windows ManualConfig.dist Added Files: Tag: windows AutoConf.mws Removed Files: Tag: windows AutoConf.mpl Log Message: Configuration now through Maple worksheet --- NEW FILE: AutoConf.mws --- {VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Text Output" -1 6 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 2 2 2 2 2 1 2 1 3 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Maple Output" -1 11 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 3 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27212 "# @(#)$Id: AutoC onf.mpl,v 1.3.2.1 2003/08/26 08:27:43 gustav_delius Exp $\n\n# Copyrig ht (C) 2003 Neil Strickland\n# Distributed without warranty under the \+ GPL - see README for details\n\nConfig := table([]):\n\n# This workshe et will configure your AiM system. Mostly this will be\n# done automat ically. However you will want to \n# change are the first three lines \+ starting with Config['..., \n# following the explanations given.\n\n## ####################################################################\n # The SMTP server that AiM should use for sending mail.\n# You will ce rtainly want to change this setting.\nConfig['SMTPServer'] := \"smtp.y ork.ac.uk\":\n\n###################################################### ################\n# The fully qualified host name of the server (eg ai m.shef.ac.uk).\n# For initial testing purposes, you can set this to \" localhost\". This\n# will allow you to access AiM that it is running \+ on, but not from any\n# other machine. \nConfig['HostName'] := \"loca lhost\":\n\n########################################################## ############\n# The name of the subdirectory of the Tomcat\\webapps di rectory into \n# which you have copied the AiM files\nConfig['TomcatCo ntext'] := \"beta1\":\n\n# You probably won't need to make any changes below, unless you get an\n# error message after executing the workshe et.\n\n# Now simply press Enter to execute the worksheet.\n\n######### #############################################################\n# The a bsolute path to the BLAT program, used for sending email\n# Config['BL ATProgram'] := \"C:\\\\Tomcat\\\\webapps\\\\AiM\\\\bin\\\\blat\\\\blat .exe\":\n\n########################################################### ###########\n# The absolute path to the kill program (used to kill pro cesses on this OS).\n# Config['KillProgram'] := \"C:\\\\Tomcat\\\\weba pps\\\\AiM\\\\bin\\\\Process\\\\Process.exe\":\n\n#################### ##################################################\n# The number of 'R ecent Requests' to show on the Alice Monitor page\n# Config['AliceHist orySize'] := 20:\n\n################################################## ####################\n# The time limits placed on Maple processes by t he Alice servlet. \n# Processes which take longer than the time limit \+ are terminated.\n# The AdminTimeLimit restricts the time allowed for A dministrative\n# commands. The StudentTimeLimit is the restriction on \+ all other \n# commands. Generally the StudentTimeLimit should be short er than\n# the admisitrative time limit. Both values are integers whic h specify \n# the time limit in milliseconds.\n# Config['StudentTimeLi mit'] := 60000: # one minute\n# Config['AdminTimeLimit'] := 1200000: \+ # twenty minutes\n\n################################################# #####################\n# The maximum number of maple processes that ca n be running at the same\n# time on this machine.\n# Config['MaxMapleP rocesses'] := 8:\n\n################################################## ####################\n# The top directory for the Java distribution. \+ \n# Config['JavaHome'] := \"C:\\\\Program Files\\\\Java\\\\j2re1.4.2\" :\n\n\n############################################################### #######\n# The top directory for the Tomcat distribution. \n# Config[' CatalinaHome'] := \"C:\\\\Tomcat\":\n\n\n############################# #########################################\n# The absolute path to the \+ maple program. \n# Config['MapleProgram'] := \"C:\\\\Program Files \\\\Maple 8\\\\bin.win\\\\cmaple8.exe\":\n\n\n######################## ##############################################\n# The absolute path to the tth program (used to convert LaTeX to HTML).\n# Config['TtHProgra m'] := \"C:\\\\Tomcat\\\\webapps\\\\AiM\\\\bin\\\\tth\\\\tth.exe\":\n \n\n################################################################## ####\n# The directory where the servlet should put temporary copies of uploaded\n# files. (The Maple part of the system will delete them or move them to\n# a more permanent home moments later.) \n# Config['Te mpDir'] := \"C:\\\\WINDOWS\\\\Temp\":\n\n\n########################### ###########################################\n# The maximum allowed siz e for uploaded files, in bytes. The default is\n# ten megabytes.\n# C onfig['MaxPostSize'] := 10485760:\n\n\n############################### #######################################\n# The number of the port on w hich Tomcat should listen. By default\n# this is 8080. For any port o ther than 80, the\n# number must be included explicitly in URL's (for \+ example, \n# http://allserv.rug.ac.be:8080). \n# Config['TomcatPort'] \+ := 8080:\n\n\n\n###################################################### ################\n# In principle this allows you to choose the languag e in which AiM's\n# messages are presented. The required mechanisms a re in place but \n# as yet there are no tables of translated messages. \n# Config['Locale'] := \"en\":\n\n\n################################# #####################################\n# Config['ShowToolBars'] := tru e:\n# true if the administrator's browser windows should have a full s et of\n# toolbars; false if they should be omitted to save space.\n\n \n#################################################################### ##\n# The name of the time zone, and the number of SECONDS ahead of GM T.\n# Note that these are separate variables, not fields in the Config \n# table.\n#\n# The handling of summer time may not be correct in Eur ope, and is\n# certainly incorrect in the southern hemisphere. It is \+ recommended\n# that you adjust manually for this. \n#\n# `Date/LocalT imeZoneName` := \"GMT\":\n# `Date/LocalTimeZoneOffset` := 0:\n\n\n## ####################################################################\n ###################################################################### \n# You can change the following fields if you dare, but you should\n# read the source code first and probably ask for advice.\n# Config['Ai mDir']\n# Config['LastRequestFile']\n# Config['Locale']\n# Config['Log Dir']\n# Config['MapleInitOptions']\n# Config['MapleVersion']\n# Confi g['OperatingSystem']\n# Config['RootDir']\n# Config['ServletLogFile'] \n# Config['DocumentURL']\n# Config['ServletURL']\n# Config['WEBINFDir ']\n# Config['WebAppDir']\n# Config['WebDir']\n\n\n################### ###################################################\n\n\nprintf(\"AIM \+ will now try to configure your system automatically.\\n\"):\n\nread(\" Util0.mpl\"):\nread(\"OS0.mpl\"):\n\nif (os_os = \"DOS\") then\n setca se := util_tolowercase:\nelse\n setcase := proc(s) s; end:\nfi:\n\nosn ame1 := proc()\n if (nargs = 0) then\n NULL;\n else\n os_osname(args )\n fi;\nend:\n\nunassign('`Date/LocalTimeZoneName`'):\nunassign('`Dat e/LocalTimeZoneOffset`'):\n\np := proc() printf(args); end:\n\nif (waf fle = true) then\n q := eval(p):\nelse\n q := proc() 1; end:\nfi:\n\ns etconfig :=\n# KM\n# DIST proc(k::name,v::\{integer,string,boolean\}) \n proc(k::name,v::\{numeric,string,boolean\})\n# END KM\n # Set Conf ig[k] to v unless Config[k] is already defined and\n # has the same t ype as v or is NULL.\n global Config;\n\n if member([k],[indices(Con fig)]) then\n if not(type([Config[k]],[whattype(v)])) and Config[k] \+ <> NULL then\n q(\"Config[%A] was set manually to %A\\n\",k,Config[ k]);\n q(\"This has the wrong type and is being overridden by the d efault,\\n\"):\n q(\"which is %A.\\n\\n\",v):\n Config[k] := v: \n fi:\n else\n Config[k] := v:\n fi:\n end:\n\n################ ######################################################\n\n# Determine \+ operating system and Maple version number\n\nprintf(\"%s%s\\n\",os_vnu mmsg,os_osmsg):\n\nif (os_vnum = 0) then stop; fi:\n\nConfig['MapleVer sion'] := os_vnum:\nConfig['OperatingSystem'] := os_os:\n\n######## ##############################################################\n\n# De fine some functions to access the file system\n\nstrip := proc(s::stri ng,t::string)\n if length(s) >= length(t) and\n substring(s,-length (t) .. -1) = t then\n RETURN(substring(s,1..(-length(t)-1)));\n else \n RETURN(NULL):\n fi:\nend:\n\n\n################################### ###################################\n\n\npath := getenv(\"PATH\"):\nif path = NULL then\n path := []: \n q(\"Execution path is empty\\n\"): \nelse \n path := [os_pathsplit(path)]:\n q(\"Execution path is %A\\n \",path):\nfi:\n\nlook_for_dir :=\n proc(target::string)\n local msg, checks,places,ans,newdirs,l,r,c,d,d1,\n place,x,y,m,prog,progdi r,ok,found,location;\n global problems;\n\n p(\"\\nLooking for %s\\n \",target):\n\n found := false:\n location := NULL:\n\n checks,plac es :=\n selectremove(e -> evalb(lhs(e) = \"Check\"),[args[2..-1]]): \n \n checks := map(rhs,checks):\n\n ans := NULL;\n newdirs := []: \n\n for place in places do\n l := lhs(place):\n r := rhs(place): \n newdirs := NULL:\n if l = \"Conf\" then\n if member([r],[ind ices(Config)]) then\n d := Config[r];\n if type([d],[string]) \+ then\n newdirs := [setcase(d)];\n q(\"Config['%a'] was set m anually to %a\\n\",r,d):\n else\n q(\"Config['%a'] was set to %A,\\n which is not a string\\n\",\n r,d):\n fi:\n else \n q(\"Config['%a'] is not set\\n\",r):\n fi:\n elif l = \"En v\" then\n newdirs := [getenv(r)]:\n if newdirs = [] then\n \+ q(\"Environment variable %s is not set\\n\",r):\n else\n q(\"En vironment variable %s is set to %s\\n\",r,op(newdirs)):\n fi:\n e lif l = \"Def\" then\n d := r[1]:\n q(\"Checking default locatio n %s%s%s* ...\",d,os_pathsep,r[2]):\n if r[1] = \"\" or r[1] = \"c: \" or r[1] = \"C:\" then\n d1 := cat(d,\"/\"):\n else\n d1 \+ := d;\n fi:\n if (os_direxists(d1)) then\n newdirs := map(se tcase,os_listfiles(d1)):\n newdirs := select(util_startswith,newdi rs,setcase(r[2])):\n newdirs := map((x,y) -> os_osname(cat(y,\"/\" ,x)),newdirs,d):\n newdirs := select(os_direxists,newdirs):\n \+ if newdirs = [] then\n q(\"not found\\n\"):\n fi:\n else\n q(\"directory does not exist.\\n\"):\n fi:\n elif l = \"Path \" then\n q(\"Checking the path for executables like *%s%s ...\",os _pathsep,r):\n progdir,prog := op(util_splitfilename(r)):\n if o s_os = \"Linux\" then\n d := util_striptrailspaces(os_system0(\"wh ich %a\",prog)):\n if util_endswith(d,r) then\n d := substrin g(d,1..-length(r)-1):\n newdirs := [d]:\n fi:\n else\n \+ newdirs := map(setcase,select(util_endswith,path,progdir)):\n new dirs :=\n select((x,y) -> os_fileexists(cat(x,\"/\",y)),newdirs,p rog):\n newdirs := map((x,m) -> substring(x,1..-m-1),newdirs,lengt h(r)):\n fi:\n if newdirs = [] then\n q(\"not found\\n\"):\n fi:\n fi:\n\n for d in newdirs do\n q(\"trying %s ... \",d) :\n if os_direxists(d) then\n q(\"exists ... \"):\n ok := t rue:\n for c in checks do\n if not(os_fileexists(cat(d,\"/\", c))) then\n ok := false:\n break:\n fi:\n od:\n \+ if ( ok ) then\n q(\" OK\\n\"):\n p(\"%s found at %s\\n\" ,target,d):\n found := true:\n location := d:\n if (tes tmode <> true) then\n RETURN(d):\n fi:\n else\n q( \" not OK (does not contain %s)\\n\",c):\n fi:\n fi:\n od:\n \+ od:\n if (found <> true) then\n p(\"Could not find %s\\n\",target) :\n problems := true:\n fi:\n RETURN(location):\n end:\n \n####### ###########################################\n\nlook_for_prog :=\n proc (target::string)\n local msg,checks,places,ans,l,r,c,d,place,x,y,m,f, ok,e,cmd,location;\n global problems;\n\n p(\"\\nLooking for %s\\n\" ,target):\n location := NULL:\n\n checks,places :=\n selectremove( e -> evalb(lhs(e) = \"Check\"),[args[2..-1]]):\n \n checks := map(rh s,checks):\n\n ans := NULL;\n\n for place in places do\n l := lhs( place):\n r := rhs(place):\n f := NULL:\n if l = \"Conf\" then\n if member([r],[indices(Config)]) then\n d := Config[r];\n \+ if type([d],[string]) then\n f := d;\n q(\"Config['%a'] was \+ set manually to %a\\n\",r,d):\n else\n q(\"Config['%a'] was s et to %A,\\n which is not a string\\n\",\n r,d):\n fi:\n \+ else\n q(\"Config['%a'] is not set\\n\",r):\n fi:\n elif l = \"Def\" then\n f := r:\n if os_fileexists(f) then\n q(\"Fou nd at default location %s\\n\",f)\n else\n q(\"Nothing in defau lt location %s\\n\",f):\n f := NULL;\n fi:\n elif l = \"Path \" then\n q(\"Checking the path for executables like *%s%s ...\",os _pathsep,r):\n if os_os = \"Linux\" then\n d := util_striptrail spaces(os_system0(\"which %a\",r)):\n if os_fileexists(d) then\n \+ f := d: \n q(\"found at %s\\n\",f):\n else\n q(\"not found\\n\"):\n fi:\n else\n d := map((x,y) -> cat(x,\"/\", y),path,r): \n d := select(os_fileexists,d):\n if d <> [] then \n f := d[1]: \n q(\"found at %s\\n\",f):\n else\n \+ q(\"not found\\n\"):\n f := NULL;\n fi:\n fi:\n fi:\n\n if f <> NULL then\n f := os_osname(f):\n q(\"Trying %s ... \" ,f):\n if os_fileexists(f) then\n q(\"exists ... \"):\n ok \+ := true:\n for c in checks do\n cmd := cat(\"\\\"\",f,\"\\\" \+ \",c[1]);\n e := traperror(os_system(cmd)):\n if e = lasterr or then\n q(\"\\nNot OK : error while executing %a : %s\\n\",cmd ,e):\n elif SearchText(c[2],e) = 0 then\n q(\"\\nNot OK : ' %s %s' does not produce '%s' in the output.\\n\",\n f,c[1],c[2 ]):\n if length(e) > 300 then e := cat(substring(e,1..300),\"... \"): fi:\n q(\"Output was: \\n%s\\n\\n\",e):\n ok := false ;\n break:\n fi:\n od:\n if ( ok ) then\n q(\" OK\\n\"):\n p(\"%s found at %s\\n\",target,f):\n location : = f:\n if (testmode <> true) then RETURN(f): fi:\n else\n \+ q(\"Not OK\\n\"):\n fi:\n else\n q(\"does not exist.\\n\" ):\n fi:\n fi:\n od:\n if (location = NULL) then\n p(\"Could \+ not find %s\\n\",target):\n problems := true:\n fi:\n RETURN(locat ion):\n end:\n\nproblems := false;\n\n################################ ######################################\n\n# Look for Java\n\n# Config[ 'JavaHome']\n# JAVA_HOME in the environment\n# Defaults: Linux: /usr/j ava/jdk*, /usr/local/jdk*\n# DOS: c:\\java\\jdk*, c:\\jdk*\n # double parent of java executable (try 'where', or PATH)\n#\n# Check: should contain file bin/java\n\nif os_os = \"Linux\" then\n Config['J avaHome'] :=\n look_for_dir(\n \"Java\",\n \"Conf\" = 'JavaHome',\n \"Env\" = \"JAVA_HOME\",\n \"Def\" = [\"/usr/java\",\"jdk\"],\n \"Def\" = [\"/usr/local\",\"jdk\"],\n \"Path\" = \"bin/java\",\n \"Check\" = \"bin/java\"\n ):\nelse\n Config['JavaHome'] :=\n osname 1(look_for_dir(\n \"Java\",\n \"Conf\" = 'JavaHome',\n \"Env\" = \"JAVA_HOME\",\n \"Def\" = [\"C:\\\\java\",\"jdk\"],\n \"Def\" \+ = [\"C:\\\\java\",\"j2\"],\n \"Def\" = [\"C:\",\"jdk\"],\n \"Def\" = [\"C:\",\"j2\"],\n \"Def\" = [\"C:\\\\Program Files\\\\java\", \"jdk\"],\n \"Def\" = [\"C:\\\\Program Files\\\\java\",\"j2\"],\n \+ \"Def\" = [\"C:\\\\Program Files\",\"jdk\"],\n \"Def\" = [\"C:\\ \\Program Files\",\"j2\"],\n \"Path\" = \"bin/java.exe\",\n \"Check \" = \"bin/java.exe\"\n )):\nfi:\n \n\n############################### #######################################\n\n# Look for Tomcat\n\ncd := \+ [util_slashsplit(currentdir())]:\nif nops(cd) > 4 then\n cd := util_sl ashjoin(op(cd[1..-6])):\n cd := (\"Def\" = [cd,\"tomcat\"], \"Def\" = \+ [cd,\"jakarta-tomcat\"]):\nelse\n cd := NULL:\nfi:\n\nif os_os = \"Lin ux\" then\n Config['CatalinaHome'] :=\n look_for_dir(\n \"Tomcat\",\n \"Conf\" = 'CatalinaHome',\n \"Env\" = \"CATALINA_HOME\",\n \"Def \" = [\"/usr/local\",\"tomcat\"],\n \"Def\" = [\"/usr/local\",\"jak arta-tomcat\"],\n cd,\n \"Check\" = \"bin/catalina.sh\"\n ):\nelse\n Config['CatalinaHome'] :=\n osname1(look_for_dir(\n \"Tomcat\",\n \+ \"Conf\" = 'CatalinaHome',\n \"Env\" = \"CATALINA_HOME\",\n \"Def\" = [\"C:\",\"tomcat\"],\n \"Def\" = [\"C:\",\"jakarta-tomcat\"],\n \+ \"Def\" = [\"C:\\\\Program Files\",\"tomcat\"],\n \"Def\" = [\"C: \\\\Program Files\",\"jakarta-tomcat\"],\n cd,\n \"Check\" = \"bin/c atalina.bat\"\n )):\nfi:\n\n\n######################################## ##############################\n\n# Look for Maple\n\nif os_os = \"Lin ux\" then\n Config['MapleProgram'] :=\n look_for_prog(\n \"Maple\",\n \"Conf\" = 'MapleProgram',\n \"Def\" = \"/bin/maple\",\n \"Def \" = \"/usr/bin/maple\",\n \"Def\" = \"/usr/local/bin/maple\",\n \+ \"Def\" = \"/usr/local/maple/bin/maple\",\n \"Def\" = \"/usr/loc al/maple_su/bin/maple\",\n \"Path\" = \"maple\",\n \"Check\" = [\"- c quit;\",\"Waterloo\"]\n ):\nelse\n Config['MapleProgram'] :=\n osnam e1(look_for_prog(\n \"Maple\",\n \"Conf\" = 'MapleProgram',\n \"De f\" = \"C:\\\\Maple\\\\bin.wnt\\\\cmaple.exe\",\n \"Def\" = \"C: \\\\Program Files\\\\Maple\\\\bin.wnt\\\\cmaple.exe\",\n \"Def\" = \+ \"C:\\\\Maple 8\\\\bin.win\\\\cmaple8.exe\",\n \"Def\" = \"C:\\\\Pr ogram Files\\\\Maple 8\\\\bin.win\\\\cmaple8.exe\",\n \"Def\" = \"C :\\\\Program Files\\\\Maple 9\\\\bin.win\\\\cmaple9.exe\",\n \"Def\" \+ = \"C:\\\\Maple 7\\\\bin.wnt\\\\cmaple.exe\",\n \"Def\" = \"C:\\ \\Program Files\\\\Maple 7\\\\bin.wnt\\\\cmaple.exe\",\n \"Def\" = \+ \"C:\\\\Maple 6\\\\bin.wnt\\\\cmaple.exe\",\n \"Def\" = \"C:\\\\Pro gram Files\\\\Maple 6\\\\bin.wnt\\\\cmaple.exe\",\n \"Path\" = \"cma ple8.exe\",\n \"Path\" = \"cmaple.exe\",\n \"Check\" = [\"-c quit; \",\"Waterloo\"]\n )):\nfi:\n\n\n##################################### #################################\n\n# Look for upload directory\n\nif os_os = \"Linux\" then\n Config['TempDir'] :=\n look_for_dir(\n \"up load directory\",\n \"Conf\" = 'TempDir',\n \"Env\" = \"TempDir\" ,\n \"Env\" = \"TMPDIR\",\n \"Def\" = [\"\",\"tmp\"]\n ):\nelse \n Config['TempDir'] :=\n osname1(look_for_dir(\n \"upload directory \",\n \"Conf\" = 'TempDir',\n \"Env\" = \"TempDir\",\n \"Env\" \+ = \"TMPDIR\",\n \"Env\" = \"Temp\",\n \"Env\" = \"TMP\",\n \"D ef\" = [\"C:\",\"temp\"],\n \"Def\" = [\"C:\",\"tmp\"]\n )):\nfi: \n\nsetconfig('MaxPostSize',10 * 1024 * 1024):\n\n#################### ##################################################\n\np(\"\\nFinding t he host name\\n\"):\n\nif type([Config['HostName']],[string]) then\n \+ q(\"The host name was set manually to %a\\n\",Config['HostName']):\nel se\n if os_os = \"Linux\" then\n hostname := traperror(ssystem(\"host name --fqdn\")):\n if hostname = lasterror then\n err := hostname: \n elif hostname[1] > 0 then\n err := hostname[2]:\n else\n host name := hostname[2]:\n err := NULL:\n fi:\n if err = NULL then\n \+ if length(hostname) > 0 and substring(hostname,-1..-1)= \"\\n\" then \n hostname := substring(hostname,1..-2):\n fi:\n q(\"'hostname --fqdn' returned %a\\n\",hostname):\n if (hostname = \"localhost.lo caldomain\") then\n hostname := \"localhost\":\n fi:\n else\n \+ q(\"Error while running 'hostname --fqdn' :\\n%s\\n\\n\",err):\n fi: \n else\n hostname := \"localhost\":\n fi: \n\nConfig['HostName'] := \+ hostname:\n\nfi:\n\np(\"Host name set to %s\\n\\n\",Config['HostName'] ):\n\n################################################################ ######\n\nsetconfig('Locale',\"en\"):\n\n############################# #########################################\n\np(\"Setting time zone\\n \"):\n\n\ntimezone := NULL:\ntimeoffset := NULL:\n\nzones :=\n table([ \n \"ADT\" =-03,\n \"AHST\"=-10,\n \"AST\" =-04,\n \"AT\" =-02,\n \"B ST\" =+01,\n \"BT\" =+03,\n \"CAT\" =-10,\n \"CCT\" =+08,\n \"CDT\" = -05,\n \"CET\" =+01,\n \"CST\" =-06,\n \"EADT\"=+11,\n \"EAST\"=+10,\n \"EDT\" =-04,\n \"EET\" =+02,\n \"EST\" =-05,\n \"FST\" =+02,\n \"FWT \" =+01,\n \"GMT\" = 0,\n \"GST\" =+10,\n \"HDT\" =-09,\n \"HST\" =-1 0,\n \"IDLE\"=+12,\n \"IDLW\"=-12,\n \"JST\" =+09,\n \"MDT\" =-06,\n \+ \"MEST\"=+02,\n \"MET\" =+01,\n \"MEWT\"=+01,\n \"MST\" =-07,\n \"NT\" =-11,\n \"NZDT\"=+13,\n \"NZST\"=+12,\n \"PDT\" =-07,\n \"PST\" =-08 ,\n \"SST\" =+02,\n \"SWT\" =+01,\n \"UTC\" = 0,\n \"WADT\"=+08,\n \" WAST\"=+07,\n \"WAT\" =-01,\n \"WET\" = 0,\n \"YDT\" =-08,\n \"YST\" \+ =-09\n]):\n\n\nif os_os = \"Linux\" then\n timezone := traperror(util_ striptrailspaces(os_system(\"date +%%Z\")));\n if timezone = lasterror then timezone := NULL: fi:\n t0 := traperror(parse(os_system(\"date + \\\"(%%H*60+%%M)\\\"\"))):\n t0 := traperror(parse(os_system(\"date -u +\\\"(%%H*60+%%M)\\\"\"))):\n if type([t0,t1],[integer,integer]) then \n if t0 > t1 + 13 * 60 then\n t0 := t0 - 24 * 60:\n fi:\n timeof fset := round((t0 - t1)/15) * 15 * 60: \n fi:\nfi:\n\nif type([`Date/L ocalTimeZoneName`],[string]) then\n timezone := `Date/LocalTimeZoneNam e`:\n q(\"Time zone was set manually to %a\\n\",timezone):\nelif timez one <> NULL then\n q(\"Time zone was determined automatically as %a\\n \",timezone):\nelse\n q(\"Could not determine time zone, assuming GMT \\n\"):\n timezone := \"GMT\":\nfi:\n\n\nif type([`Date/LocalTimeZoneO ffset`],[integer]) then\n timeoffset := `Date/LocalTimeZoneOffset`:\n \+ q(\"The offset from UTC was set manually to %d\\n\",timeoffset):\n if \+ timeoffset <> 0 and abs(timeoffset) < 24 then\n q(\"This appears to b e in hours, but it needs to be in seconds.\\n\"):\n q(\"It will be co nverted automatically.\\n\"):\n timeoffset := timeoffset * 3600:\n el se\n if not (type(integer,timeoffset/900)) then\n timeoffset := rou nd(timeoffset / 900) * 900:\n q(\"This was rounded to %d\\n\",timeof fset):\n fi:\n fi:\nelif type([zones[timezone]],[integer]) then\n tim eoffset := zones[timezone] * 3600:\n q(\"The offset from UTC is %d hou r(s)\\n\",zones[timezone]):\nelif timeoffset <> NULL then\n timeoffset := round(timeoffset / 900) * 900:\n q(\"The offset from UTC was calcu lated as %A hour(s)\\n\",\n timeoffset/3600.):\nelse\n q(\"The offse t from UTC could not be determined, and will be taken\\n\"):\n q(\"to \+ be zero. \\n\"):\n timeoffset := 0:\nfi:\n\n`Date/LocalTimeZoneName` : = timezone:\n`Date/LocalTimeZoneOffset` := timeoffset:\n\np(\"Time zon e set to %s (= UTC +%A hours)\\n\",timezone,timeoffset/3600):\n\n##### #################################################################\n\np (\"Setting other configuration options\\n\"):\n\nif type([Config['Tomc atPort']],[integer]) then\n Config['TomcatPort'] := sprintf(\"%d\",Con fig['TomcatPort']):\nfi:\n\nsetconfig('TomcatPort' , \"8080\"):\n\nif \+ (Config['TomcatPort'] = \"80\") then\n setconfig('HostPort' , Config[' HostName']):\nelse\n setconfig('HostPort' , cat(Config['HostName'],\": \",Config['TomcatPort'])):\nfi:\n\nsetconfig('TomcatContext' , \"AiM\" ):\n\nif Config['TomcatContext'] = \"ROOT\" then\n setconfig('FullCont ext',Config['HostPort']):\n setconfig('WebAppDir',\n os_maplename(cat (Config['CatalinaHome'],\"/webapps/ROOT\"))):\nelse\n setconfig('FullC ontext',\n cat(Config['HostPort'],\"/\",Config['TomcatContext'])):\n \+ setconfig('WebAppDir' ,\n os_maplename(\n cat(Config['CatalinaHome' ],\"/webapps/\",Config['TomcatContext']))):\nfi:\n\nprintf(Config['Web AppDir']);\n\nsetconfig('WEBINFDir' ,\n cat(Config['WebAppDir'],\"/WEB -INF\")):\n\nsetconfig('AimDir' , Config['WEBINFDir']):\nsetconfig(' LogDir' , cat(Config['AimDir'],\"/logs\")):\nsetconfig('RootDir' , \+ cat(Config['AimDir'],\"/root\")):\n\nsetconfig('ServletLogFile',os_osn ame(cat(Config['LogDir'],\"/servletlog\"))):\nsetconfig('LastRequestFi le',os_osname(cat(Config['LogDir'],\"/lastrequest\"))):\nsetconfig('Em ailLogFile',os_osname(cat(Config['LogDir'],\"/emaillog\"))):\n\nsetcon fig('WebDir' , Config['WebAppDir']):\nsetconfig('DocDir' , cat(Config[ 'WebAppDir'],\"/doc\")):\n\nsetconfig('ServletURL', cat(\"http://\",Co nfig['FullContext'],\"/Alice\")):\nsetconfig('DocumentURL' , cat(\"htt p://\",Config['FullContext'])):\n\nsetconfig('ShowToolBars' , true):\n \nsetconfig('MapleInitOptions',\"default\"):\n\n\n#################### ##################################################\n\n# Look for TtH\n \nif os_os = \"Linux\" then\n Config['TtHProgram'] :=\n look_for_prog( \n \"TtH\",\n \"Conf\" = 'TtHProgram',\n \"Path\" = \"tth\",\n \+ \"Def\" = \"/usr/local/bin/tth\",\n \"Def\" = \"/usr/bin/tth\",\n \"Def\" = \"/bin/tth\",\n \"Def\" = cat(Config['WebAppDir'],\"/ bin/tth_exe/tth\"),\n \"Check\" = [\"-r < tthtest.tex\",\"TtH is OK\" ]\n ):\nelse\n Config['TtHProgram'] :=\n os_osname(look_for_prog(\n \+ \"TtH\",\n \"Conf\" = 'TtHProgram',\n \"Path\" = \"tth.exe\",\n \+ \"Def\" = \"C:\\\\TtH\\\\tth.exe\",\n \"Def\" = \"C:\\\\Program F iles\\\\tth.exe\",\n \"Def\" = \"C:\\\\Program Files\\\\TtH\\\\tth. exe\",\n \"Def\" = cat(Config['WebAppDir'],\"\\\\bin\\\\tth_exe\\\\ tth.exe\"),\n \"Check\" = [\"-r < tthtest.tex\",\"TtH is OK\"]\n )): \nfi:\n\n\n########################################################### ###########\n\n# Look for the Kill Program\n\nif os_os = \"Linux\" the n\n Config['KillProgram'] :=\"/bin/kill\";\n os_osname(look_for_prog( \n \"Kill Process Utility\",\n \"Conf\" = 'KillProgram',\n \"Pa th\" = \"kill\",\n \"Def\" = \"/bin/kill\",\n \"Def\" = \"/us r/bin/kill\",\n \"Def\" = \"/usr/local/bin/kill\",\n \"Check\" = [\"\",\"kill\"]\n )):\n Config['KillProgramArg'] :=\"-9\";\nelse\n C onfig['KillProgram'] :=\n os_osname(look_for_prog(\n \"Kill Process U tility\",\n \"Conf\" = 'KillProgram',\n \"Path\" = \"Process.exe\" ,\n \"Def\" = \"C:\\\\AIM\\\\Process\",\n \"Def\" = \"C:\\\\Proc ess\",\n \"Def\" = cat(Config['WebAppDir'],\"\\\\bin\\\\process\\\\ Process.exe\"),\n \"Check\" = [\"-v\",\"beyondlogic.org\"]\n )):\n se tconfig('KillProgramArg',\"-k\");\nfi:\n\n\n########################## ############################################\n\n# Look for email progr am\n\nif os_os = \"Linux\" then\n Config['SendmailProgram'] :=\n look_ for_prog(\n \"sendmail\",\n \"Conf\" = 'SendmailProgram',\n \"Path \" = \"sendmail\",\n \"Def\" = \"/usr/lib/sendmail\",\n \"Def\" \+ = \"/usr/bin/sendmail\"\n ):\n setconfig('BLATProgram',\"\"):\n setco nfig('SMTPServer',\"\"):\nelse\n Config['BLATProgram'] := cat(Config[' CatalinaHome'],\"\\\\bin\\\\blat\\\\blat.exe\"):\n setconfig('Sendmail Program',\"\");\n setconfig('SMTPServer',\"\"):\nfi:\n\np(\"\\n\"):\n \n\n\nsetconfig('AliceHistorySize',20):\nsetconfig('MaxMapleProcesses' ,8):\nsetconfig('StudentTimeLimit',60000): # one minute\nsetconfig('A dminTimeLimit',1200000): # twenty minutes\n\nsetconfig('TimeLimit',2. 0): # two seconds\n\n\np(\"\\n\"):\n\n################################ ######################################\n\nread(\"ConfigFields.mpl\"): \n\np(\"Writing Config.mpl and ServletConfig.mpl\\n\"):\n\nif os_filee xists(\"Config.mpl\") then\n p(\"Renaming Config.mpl as Config.bak\\n \\n\"):\n err := traperror(os_rename(\"Config.mpl\",\"Config.bak\")): \n if (err = lasterror) then\n p(\"Failed: %s\\n\",err):\n `quit`(1) :\n fi:\nfi:\n\nm := proc() fprintf(fd,args); q(args); end:\n\naddhash :=\n proc(s::string) \n convert(subs(10 = op([10,35,32]),convert(s,b ytes))[2..-1],bytes):\n end:\n\npadeq :=\n proc(k::name,l::integer)\n \+ m(\"'%a'%s = %a,\\n\",k,\n cat(\" \" $ (15 - length(k))),\n `if `(Config[k] = NULL,\"NULL\",Config[k])):\n end:\n\nhdr := \"\nThis fil e is generated automatically by AutoConf.mpl. It is\nrecommended that you do not edit it directly. Instead, you should\ncreate a separate \+ file called ManualConfig.mpl and copy over any\ndefinitions (from eith er Config.mpl or ServletConfig.mpl) that you\nwish to override. You c an then run AutoConf.mpl to fill in the\nremaining definitions and che ck that everything is consistent.\n\":\n\n\nfd := traperror(fopen(\"Co nfig.mpl\",'WRITE')):\nif (fd = lasterror) then\n p(\"Could not open C onfig.mpl for writing:\\n%a\\n\\n\",fd):\n `quit`(1):\nfi:\n\nfprintf( fd,addhash(hdr)):\nfprintf(fd,\"\\n\\n\"):\n\nm(\"Config := table([\\n \"):\n\nfor x in ConfigFields do\n padeq(x[1],15):\n fprintf(fd,addhas h(x[3])):\n fprintf(fd,\"\\n\\n\"):\nod:\n\nm(\"NULL]):\\n\\n\"):\n\nm (\"`Date/LocalTimeZoneName` := %a:\\n\",`Date/LocalTimeZoneName`):\n m(\"`Date/LocalTimeZoneOffset` := %d:\\n\",`Date/LocalTimeZoneOffset`) :\n\nm(\"\\n\\n\"):\n\nerr := traperror(fclose(fd)):\nif err = lasterr or then\n p(\"Could not close Config.mpl:\\n%a\\n\\n\",err):\n `quit`( 1):\nfi:\n\nfd := traperror(fopen(\"ServletConfig.mpl\",'WRITE')):\nif (fd = lasterror) then\n p(\"Could not open ServletConfig.mpl for writ ing:\\n%a\\n\\n\",fd):\n `quit`(1):\nfi:\n\nfprintf(fd,addhash(hdr)): \nfprintf(fd,\"\\n\\n\"):\n\nm(\"ServletConfig := table([\\n\"):\n\nfo r x in ServletConfigFields do\n padeq(x[1],18):\n fprintf(fd,addhash(x [3])):\n fprintf(fd,\"\\n\\n\"):\nod:\n\nm(\"NULL]):\\n\\n\"):\n\nerr \+ := traperror(fclose(fd)):\nif err = lasterror then\n p(\"Could not clo se ServletConfig.mpl:\\n%a\\n\\n\",err):\n `quit`(1):\nfi:\n\n\n###### ################################################################\n\nif problems = true then\n p(\"There were configuration problems.\\n\"): \n p(\"Please read the messages above. \+ \\n\"):\n if (waffle <> true) then\n p(\"You can get more detailed me ssages by setting waffle := true \\n\"):\n p(\"before executing the w orksheet again. \\n\"):\n fi:\n p(\"To fix t he problems, edit the relevant entries at the top of \\n\"):\n p(\"the worksheet and then execute it again. \\n\"):\n if (dontquit <> \+ true) then `quit`(1): fi:\nfi:\n\nif problems = false then read(\"Serv let.mpl\"): \n p(\"AIM was successfully configured. \\n\"):\nfi:\n " }}{PARA 6 "" 1 "" {TEXT -1 56 "AIM will now try to configure your sy stem automatically." }}{PARA 6 "" 1 "" {TEXT -1 25 "Maple version numb er is 8" }}{PARA 6 "" 1 "" {TEXT -1 64 "Operating system is not Unix, \+ assumed to be some kind of Windows" }}{PARA 11 "" 1 "" {XPPMATH 20 "6# >%)problemsG%&falseG" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}{PARA 6 "" 1 " " {TEXT -1 16 "Looking for Java" }}{PARA 6 "" 1 "" {TEXT -1 48 "Java f ound at C:\\Program Files\\java\\j2re1.4.1_02" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}{PARA 6 "" 1 "" {TEXT -1 18 "Looking for Tomcat" }} {PARA 6 "" 1 "" {TEXT -1 25 "Tomcat found at C:\\tomcat" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}{PARA 6 "" 1 "" {TEXT -1 17 "Looking for Maple" } }{PARA 6 "" 1 "" {TEXT -1 59 "Maple found at C:\\Program Files\\Maple \+ 8\\bin.win\\cmaple8.exe" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}{PARA 6 "" 1 "" {TEXT -1 28 "Looking for upload directory" }}{PARA 6 "" 1 "" {TEXT -1 60 "upload directory found at C:\\DOCUME~1\\ADMINI~1\\LOCALS~ 1\\Temp" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}{PARA 6 "" 1 "" {TEXT -1 21 "Finding the host name" }}{PARA 6 "" 1 "" {TEXT -1 26 "Host name se t to localhost" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}{PARA 6 "" 1 "" {TEXT -1 17 "Setting time zone" }}{PARA 6 "" 1 "" {TEXT -1 37 "Time zo ne set to GMT (= UTC +0 hours)" }}{PARA 6 "" 1 "" {TEXT -1 35 "Setting other configuration options" }}{PARA 6 "" 1 "" {TEXT -1 23 "C:/tomcat /webapps/beta1" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}{PARA 6 "" 1 "" {TEXT -1 15 "Looking for TtH" }}{PARA 6 "" 1 "" {TEXT -1 41 "TtH found at C:\\Program Files\\TtH\\tth.exe" }}{PARA 6 "" 1 "" {TEXT -1 0 "" } }{PARA 6 "" 1 "" {TEXT -1 32 "Looking for Kill Process Utility" }} {PARA 6 "" 1 "" {TEXT -1 77 "Kill Process Utility found at C:\\tomcat \\webapps\\beta1\\bin\\process\\Process.exe" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}{PARA 6 "" 1 "" {TEXT -1 0 "" }}{PARA 6 "" 1 "" {TEXT -1 40 "Writing Config.mpl and ServletConfig.mpl" }}{PARA 6 "" 1 "" {TEXT -1 33 "Renaming Config.mpl as Config.bak" }}{PARA 6 "" 1 "" {TEXT -1 0 " " }}{PARA 6 "" 1 "" {TEXT -1 50 "com.oreilly.servlet classes are alrea dy installed." }}{PARA 6 "" 1 "" {TEXT -1 21 "Reading OS.mpl...done" } }{PARA 6 "" 1 "" {TEXT -1 23 "Reading Util.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 23 "Reading I18n.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 24 "Reading Class.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 22 "Reading P ot.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 23 "Reading Date.mpl...done " }}{PARA 6 "" 1 "" {TEXT -1 29 "Reading ParsedText.mpl...done" }} {PARA 6 "" 1 "" {TEXT -1 25 "Reading Random.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 24 "Reading Cache.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 29 "Reading ImageCache.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 23 "R eading HTML.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 28 "Reading aim/LaT eX.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 24 "Reading Local.mpl...done " }}{PARA 6 "" 1 "" {TEXT -1 28 "Reading SafeParse.mpl...done" }} {PARA 6 "" 1 "" {TEXT -1 27 "Reading aim/Test.mpl...done" }}{PARA 6 " " 1 "" {TEXT -1 27 "Reading aim/Util.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 28 "Reading aim/Util1.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 27 "Reading aim/Mark.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 34 "Readin g aim/SyntaxHints.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 27 "Reading a im/Diff.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 26 "Reading aim/Int.mpl ...done" }}{PARA 6 "" 1 "" {TEXT -1 32 "Reading aim/Functions.mpl...do ne" }}{PARA 6 "" 1 "" {TEXT -1 27 "Reading aim/Trig.mpl...done" }} {PARA 6 "" 1 "" {TEXT -1 29 "Reading aim/Matrix.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 30 "Reading aim/Student.mpl...done" }}{PARA 6 "" 1 " " {TEXT -1 31 "Reading aim/Register.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 31 "Reading aim/Question.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 35 "Reading aim/TextQuestion.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 33 "Reading aim/MCQuestion.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 33 "Reading aim/MRQuestion.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 37 " Reading aim/MatrixQuestion.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 36 " Reading aim/MultiQuestion.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 27 "R eading aim/Quiz.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 32 "Reading aim /QuizCache.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 30 "Reading aim/Subj ect.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 27 "Reading aim/Zone.mpl... done" }}{PARA 6 "" 1 "" {TEXT -1 30 "Reading aim/Compile.mpl...done" } }{PARA 6 "" 1 "" {TEXT -1 28 "Reading aim/Admin.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 38 "Reading aim/admin/SourceDir.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 39 "Reading aim/admin/SourceFile.mpl...done" }} {PARA 6 "" 1 "" {TEXT -1 33 "Reading aim/admin/Quiz.mpl...done" }} {PARA 6 "" 1 "" {TEXT -1 36 "Reading aim/admin/Subject.mpl...done" }} {PARA 6 "" 1 "" {TEXT -1 40 "Reading aim/admin/SubjectHome.mpl...done " }}{PARA 6 "" 1 "" {TEXT -1 37 "Reading aim/admin/Register.mpl...done " }}{PARA 6 "" 1 "" {TEXT -1 37 "Reading aim/admin/Generate.mpl...done " }}{PARA 6 "" 1 "" {TEXT -1 35 "Reading aim/admin/Notify.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 36 "Reading aim/admin/Student.mpl...done" } }{PARA 6 "" 1 "" {TEXT -1 33 "Reading aim/admin/Zone.mpl...done" }} {PARA 6 "" 1 "" {TEXT -1 42 "Reading aim/admin/ZoneAdminHome.mpl...don e" }}{PARA 6 "" 1 "" {TEXT -1 44 "Reading aim/admin/ZoneStudentHome.mp l...done" }}{PARA 6 "" 1 "" {TEXT -1 39 "Reading aim/analyze/Question. mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 35 "Reading aim/analyze/Quiz.mp l...done" }}{PARA 6 "" 1 "" {TEXT -1 38 "Reading aim/analyze/Subject.m pl...done" }}{PARA 6 "" 1 "" {TEXT -1 38 "Reading aim/review/Question. mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 34 "Reading aim/review/Quiz.mpl ...done" }}{PARA 6 "" 1 "" {TEXT -1 37 "Reading aim/review/Subject.mpl ...done" }}{PARA 6 "" 1 "" {TEXT -1 35 "Reading aim/try/Question.mpl.. .done" }}{PARA 6 "" 1 "" {TEXT -1 31 "Reading aim/try/Quiz.mpl...done " }}{PARA 6 "" 1 "" {TEXT -1 23 "Reading Site.mpl...done" }}{PARA 6 " " 1 "" {TEXT -1 22 "Reading Aim.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 30 "Reading AliceServer.mpl...done" }}{PARA 6 "" 1 "" {TEXT -1 36 " AIM was successfully configured. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "0 0 0" 1364 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 } Index: ManualConfig.dist =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/ManualConfig.dist,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** ManualConfig.dist 26 Aug 2003 08:27:43 -0000 1.2.2.1 --- ManualConfig.dist 26 Aug 2003 14:58:30 -0000 1.2.2.2 *************** *** 11,15 **** # The SMTP server that AiM should use for sending mail. # You will certainly want to change this setting. ! # Config['SMTPServer'] := "smtp.york.ac.uk": ###################################################################### --- 11,15 ---- # The SMTP server that AiM should use for sending mail. # You will certainly want to change this setting. ! Config['SMTPServer'] := "smtp.york.ac.uk": ###################################################################### *************** *** 18,27 **** # will allow you to access AiM that it is running on, but not from any # other machine. ! # Config['HostName'] := "localhost": ###################################################################### # The name of the subdirectory of the Tomcat\webapps directory into # which you have copied the AiM files ! # Config['TomcatContext'] := "AiM": # You probably won't need to make any changes below, unless you get an --- 18,27 ---- # will allow you to access AiM that it is running on, but not from any # other machine. ! Config['HostName'] := "localhost": ###################################################################### # The name of the subdirectory of the Tomcat\webapps directory into # which you have copied the AiM files ! Config['TomcatContext'] := "beta1": # You probably won't need to make any changes below, unless you get an --- AutoConf.mpl DELETED --- |
From: <gus...@us...> - 2003-08-26 14:58:35
|
Update of /cvsroot/aimmath/AIM/doc In directory sc8-pr-cvs1:/tmp/cvs-serv1517/doc Modified Files: Tag: windows install.html Log Message: Configuration now through Maple worksheet Index: install.html =================================================================== RCS file: /cvsroot/aimmath/AIM/doc/install.html,v retrieving revision 1.2.2.2 retrieving revision 1.2.2.3 diff -C2 -d -r1.2.2.2 -r1.2.2.3 *** install.html 26 Aug 2003 08:28:30 -0000 1.2.2.2 --- install.html 26 Aug 2003 14:58:30 -0000 1.2.2.3 *************** *** 96,122 **** to run the new installation in parallel.<p/> </li> ! <li> ! Change directory to <font color='green'>C:\Tomcat\webapps\AiM\WEB-INF\maple</font>. ! Open the file <font color='green'>ManualConfig.dist</font> in notepad or you ! favourite texteditor. In this file you can make changes to the default configuration. You ! should then save it under the name <font color='green'>ManualConfig.mpl</font>. ! You will want to uncomment ! the line <font color='green'>Config['SMTPServer'] := "smtp.york.ac.uk":</font> and ! replace the server name by the name of your local mail server. ! Also, if you chose a directory other than <font color='green'>AiM</font> ! you should uncomment the line <font color='green'>Config['TomcatContext'] := "AiM":</font> ! and replace <font color='green'>AiM</font> by the name you chose. You may also set the name ! of your server. You probably won't have to make any more changes.<p/> ! </li> ! <li> ! Now start Maple, and issue the command <font color='green'>read `AutoConf.mpl`;</font> ! This will use the settings you made in <font color='green'>ManualConfig.mpl</font> but otherwise will try to ! find out all the necessary configuration information automatically. If it complains of any problems, you may wish to set <font color='green'>waffle := true</font> and run it again ! to get a more verbose report. The output is saved in the file ! <font color='green'>autoconf.log</font> as well as being ! printed on the terminal. Using this information you can then review the ! settings in <font color='green'>ManualConfig.mpl</font> and make the necessary changes before reading in AutoConf.mpl again. You can iterate this procedure as often as you like until you get an installation without --- 96,107 ---- to run the new installation in parallel.<p/> </li> ! <li>Open the Maple worksheet <a href="..\WEB-INF\maple\AutoConf.mws">AutoConf.mws</a>. Just clicking the link ! should do it. In this worksheet you can first make changes to the default configuration, as explained there. ! Then execute the worksheet. The worksheet will ! find out most of the necessary configuration information automatically. If it complains of any problems, you may wish to set <font color='green'>waffle := true</font> and run it again ! to get a more verbose report. Using this information you can then review the ! settings at the top of the worksheet and make the necessary changes before reading in AutoConf.mpl again. You can iterate this procedure as often as you like until you get an installation without |
From: <gus...@us...> - 2003-08-26 08:28:38
|
Update of /cvsroot/aimmath/AIM/doc In directory sc8-pr-cvs1:/tmp/cvs-serv5513/doc Added Files: Tag: windows install.html Log Message: special to windows installation |
From: <gus...@us...> - 2003-08-26 08:27:54
|
Update of /cvsroot/aimmath/AIM/WEB-INF/java In directory sc8-pr-cvs1:/tmp/cvs-serv5333/WEB-INF/java Modified Files: Tag: windows Alice.java Maple.java MaplePool.java Log Message: special to windows installation Index: Alice.java =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/java/Alice.java,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** Alice.java 25 Aug 2003 21:47:18 -0000 1.3 --- Alice.java 26 Aug 2003 08:27:43 -0000 1.3.2.1 *************** *** 6,9 **** --- 6,10 ---- * * This is the main servlet for the AIM system. + * Modified by Ken Monks * * *************** *** 100,105 **** import com.oreilly.servlet.*; [...1646 lines suppressed...] *** 1241,1246 **** ents = entries.elements(); while(ents.hasMoreElements()) { ! e = (AliceLogEntry)ents.nextElement(); ! s = e.toHTML() + s; } } --- 1588,1593 ---- ents = entries.elements(); while(ents.hasMoreElements()) { ! e = (AliceLogEntry)ents.nextElement(); ! s = e.toHTML() + s; } } *************** *** 1269,1271 **** // compile-command: "javac -d /aim/WEB-INF/classes Alice.java" // End: - --- 1616,1617 ---- Index: Maple.java =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/java/Maple.java,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** Maple.java 25 Aug 2003 21:47:18 -0000 1.3 --- Maple.java 26 Aug 2003 08:27:43 -0000 1.3.2.1 *************** *** 6,9 **** --- 6,10 ---- * * This class represents a Maple process. + * Modified by Ken Monks */ *************** *** 12,15 **** --- 13,17 ---- public class Maple { + public Date creationTime; *************** *** 23,26 **** --- 25,42 ---- public int id = 0; + // KM + // The OS PID for this process, obtained by querying the Maple process + // a negative value means no process id is available + public int pid = -1; + + // True if this maple object has been discarded from the Maple pool + public boolean discarded = false; + + // Since I'm not sure how to throw an exception from one thread to another + // The MapleCommandThread stores its exceptions in here + // It is null if no exception was encountered + public Exception exception = null; + // END KM + // The number of users assigned to this process public int load = 0; *************** *** 37,40 **** --- 53,61 ---- private BufferedReader mapleOutput; + // KM + // I think we should handle the Maple Error stream also... + private BufferedReader mapleError; + // END KM + // Note: the exec method is passed an argument webOutput. // The method reads from mapleOutput, and writes to webOutput. *************** *** 51,54 **** --- 72,87 ---- "interface(quiet=true, errorcursor=false, errorbreak=0):"; + // KM + // The command used to kill processes in this OS. + // Useful for killing hung maple processes whose PID is known + public String killProgram = "Process"; + + // The argument to the command used to kill processes in this OS. + // For example "process -k 1234" has killProgram="process" and + // killProgramArg="-k" and pid=1234. In "kill -9 1234" killProgram="kill" + // killProgramArg="-9" and pid= 1234. + public String killProgramArg = "-k"; + // END KM + // The exec method asks Maple to executes a command, and then to // print the terminator string given below. The exec method then *************** *** 82,85 **** --- 115,134 ---- } + // KM + public Maple(String prog,String initoptions,String killprog,String killprogarg) throws IOException { + this.creationTime = new Date(); + this.lastUseTime = this.creationTime; + if (prog != null) + this.program = prog; + if (initoptions != null) + this.initOptions = initoptions; + if (killprog != null) + this.killProgram = killprog; + if (killprog != null) + this.killProgramArg = killprogarg; + this.startProcess(); + } + // END KM + private void startProcess() throws IOException { this.lastUseTime = new Date(); *************** *** 88,94 **** this.mapleOutput = new BufferedReader(new InputStreamReader(process.getInputStream())); ! ! this.write(initOptions); } // send a string to Maple --- 137,169 ---- this.mapleOutput = new BufferedReader(new InputStreamReader(process.getInputStream())); ! // KM ! // we may not need this, but it might be a good idea to manually close ! // it when cleaning up destroyed processes ! this.mapleError = ! new BufferedReader(new InputStreamReader(process.getErrorStream())); ! // get the PID ! this.getPID(); ! // END KM ! this.write(initOptions); ! } ! ! // KM ! private void getPID() throws IOException { ! String ms = "if assigned(Sockets) and " + ! " member(GetProcessID,{exports(Sockets)}) then " + ! " printf(\"%d\\n\",Sockets:-GetProcessID()) " + ! "else " + ! " printf(\"-1\\n\") " + ! "fi;\n"; ! this.write(ms); ! String s = mapleOutput.readLine(); ! // if this is not Maple 8 it should not return an integer ! try { ! this.pid = Integer.parseInt(s); ! } catch (Exception e) { ! this.pid = -1; ! } } + // END KM // send a string to Maple *************** *** 99,102 **** --- 174,179 ---- // return true if the process has exited, or was never started + // TODO: check what happens if the process is destroyed externally? + // Should this be synchronized? public boolean noProcess() { if (process == null) return true; *************** *** 118,121 **** --- 195,200 ---- // Close the Maple session: + // TODO: check the noProcess behavior when the process is destroyed + // externally, e.g. from the monitor page. public void close() { if (noProcess()) { *************** *** 123,128 **** } else { try { ! this.write("shutdown();quit;\n"); ! process.waitFor(); } catch(Exception ex) {} } --- 202,207 ---- } else { try { ! this.write("shutdown();quit;\n"); ! process.waitFor(); } catch(Exception ex) {} } *************** *** 130,136 **** public void destroy() { ! try { process.destroy(); ! } catch(Exception e) {} } --- 209,245 ---- public void destroy() { ! // KM ! if (pid<0) { ! // END KM ! try { process.destroy(); ! // KM ! mapleInput.close(); ! mapleOutput.close(); ! mapleError.close(); ! process = null; ! // END KM ! } catch(Exception e) {} ! // KM ! } else { ! try { ! // we know the PID so we kill, close, and smash ! // everything that might possibly cause a problem ! // TODO: What happens if the process is already missing? ! Process rt = Runtime.getRuntime().exec(killProgram + " " + ! killProgramArg + " " + ! pid); ! rt.waitFor(); ! rt.getOutputStream().close(); ! rt.getInputStream().close(); ! rt.getErrorStream().close(); ! process.destroy(); ! mapleInput.close(); ! mapleOutput.close(); ! mapleError.close(); ! process = null; ! } catch (Exception e) { } ! } ! // END KM } *************** *** 153,158 **** public synchronized void exec(String cmd, PrintWriter out, String mathdisplay) throws Exception { ! ! lastUseTime = new Date(); StringBuffer outstring = new StringBuffer(); --- 262,267 ---- public synchronized void exec(String cmd, PrintWriter out, String mathdisplay) throws Exception { ! ! lastUseTime = new Date(); StringBuffer outstring = new StringBuffer(); *************** *** 167,179 **** // Next, read the output, line-by-line, until terminator is read: while(true) { ! String s = mapleOutput.readLine(); ! if (s == null || s.indexOf(terminator) != -1 ) { ! break; ! } ! outstring.append(s); ! outstring.append("\n"); ! } if (out != null) { --- 276,288 ---- // Next, read the output, line-by-line, until terminator is read: while(true) { ! String s = mapleOutput.readLine(); ! if (s == null || s.indexOf(terminator) != -1 ) { ! break; ! } ! outstring.append(s); ! outstring.append("\n"); ! } if (out != null) { *************** *** 187,194 **** } ! public synchronized boolean check() { StringWriter s = new StringWriter(); PrintWriter p = new PrintWriter(s); try { exec("2+2",p); --- 296,312 ---- } ! public boolean check() { StringWriter s = new StringWriter(); PrintWriter p = new PrintWriter(s); + // KM + // I don't think we want to count this as a "last use", otherwise refreshing + // the AIM Monitor page resets all the "last use" times to the present time + // I think its more useful to have them show the last time the process was + // used for something nontrivial. The status report of "ok" indicates that + // the check was successful. + Date saveLUT = lastUseTime; + // END KM + try { exec("2+2",p); *************** *** 196,199 **** --- 314,321 ---- } catch (Exception e) { return(false); + // KM + } finally { + lastUseTime = saveLUT; + // END KM } } *************** *** 212,227 **** switch(c[i]) { case '\\': ! q[j] = '\\'; q[j+1] = '\\'; j += 2; break; case '\"': ! q[j] = '\\'; q[j+1] = '\"'; j += 2; break; case '\n': ! q[j] = '\\'; q[j+1] = 'n'; j += 2; break; case '\t': ! q[j] = '\\'; q[j+1] = 't'; j += 2; break; case '\r': ! q[j] = '\\'; q[j+1] = 'r'; j += 2; break; default: ! q[j] = c[i]; ! j++; } } --- 334,349 ---- switch(c[i]) { case '\\': ! q[j] = '\\'; q[j+1] = '\\'; j += 2; break; case '\"': ! q[j] = '\\'; q[j+1] = '\"'; j += 2; break; case '\n': ! q[j] = '\\'; q[j+1] = 'n'; j += 2; break; case '\t': ! q[j] = '\\'; q[j+1] = 't'; j += 2; break; case '\r': ! q[j] = '\\'; q[j+1] = 'r'; j += 2; break; default: ! q[j] = c[i]; ! j++; } } Index: MaplePool.java =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/java/MaplePool.java,v retrieving revision 1.2 retrieving revision 1.2.6.1 diff -C2 -d -r1.2 -r1.2.6.1 *** MaplePool.java 5 May 2003 05:15:42 -0000 1.2 --- MaplePool.java 26 Aug 2003 08:27:43 -0000 1.2.6.1 *************** *** 11,14 **** --- 11,15 ---- * pass it to the returnMaple() method to return it to the pool. * + * Modified by Ken Monks * TODO: better handling of broken or nonresponding processes */ *************** *** 24,27 **** --- 25,33 ---- public int maxProcesses = 8; // max allowed number of processes + // KM + public String killProgram = null; // absolute path to the kill program + public String killProgramArg = null; // argument to the kill program that precedes the PID + // END KM + public Hashtable maplesByID; public Hashtable maplesByStudent; *************** *** 54,64 **** } ! private Maple startMaple() // Start a new Maple process, mark it as busy, add it to the pool, // and return it. This method does not check the limit on process // numbers. throws IOException { ! synchronized (this) { ! Maple maple = new Maple(program,initOptions); maple.id = nextID++; maple.busy = true; --- 60,77 ---- } ! // KM ! // DIST private Maple startMaple() ! private synchronized Maple startMaple() ! // END KM // Start a new Maple process, mark it as busy, add it to the pool, // and return it. This method does not check the limit on process // numbers. throws IOException { ! // KM ! // DIST synchronized (this) { ! // DIST Maple maple = new Maple(program,initOptions); ! Maple maple = new Maple(program,initOptions,killProgram,killProgramArg); ! // END KM ! maple.id = nextID++; maple.busy = true; *************** *** 68,75 **** writeLog("Starting new Maple process: ID = " + maple.id + "\n"); return maple; ! } } ! public Maple getMaple(String student) // Get a Maple process for use by the specified student. The pool will // remember which process the student has used, and try to assign the --- 81,94 ---- writeLog("Starting new Maple process: ID = " + maple.id + "\n"); return maple; ! // KM ! // DIST } ! // END KM ! } ! // KM ! // DIST public Maple getMaple(String student) ! public synchronized Maple getMaple(String student) ! // END KM // Get a Maple process for use by the specified student. The pool will // remember which process the student has used, and try to assign the *************** *** 82,86 **** int minload; ! synchronized(this) { // remember the time. // (Any process assigned to a student will be unassigned if it --- 101,107 ---- int minload; ! // KM ! // DIST synchronized(this) { ! // END KM // remember the time. // (Any process assigned to a student will be unassigned if it *************** *** 92,207 **** if (bestmaple == null) { ! // no process assigned to this student yet ! if (maplesByID.size() < maxProcesses) { ! // under the process limit, so start a new one for this student ! bestmaple = startMaple(); ! bestmaple.load = 1; ! maplesByStudent.put(student,bestmaple); ! bestmaple.busy = true; ! bestmaple.user = student; ! return(bestmaple); ! } else { ! // no more processes allowed, so find one that this student ! // can share, with the minimum possible load ! ids = maplesByID.keys(); ! minload = Integer.MAX_VALUE; ! while (ids.hasMoreElements()) { ! id = (Integer)ids.nextElement(); ! maple = (Maple)maplesByID.get(id); ! if ((! maple.busy) && (maple.load < minload)) { ! minload = Math.min(minload,maple.load); ! bestmaple = maple; ! } ! } ! if (bestmaple == null) { ! writeLog("Servlet busy - request refused\n"); ! return(null); ! } else { ! bestmaple.busy = true; ! bestmaple.load++; ! maplesByStudent.put(student,bestmaple); ! bestmaple.user = student; ! return(bestmaple); ! } ! } } else { ! // there is a process assigned to this student ! if (bestmaple.busy) { ! // the assigned process is busy ! if (! student.equals("(admin)") && ! student.equals(bestmaple.user) && ! ((new Date()).getTime() - ! bestmaple.lastUseTime.getTime()) < 30000) { ! // The process is still working on the last request from ! // this student, which was submitted less than 30 seconds ! // ago; so we reject the request. ! return(null); ! } ! // find another process that this student can use ! ids = maplesByID.keys(); ! oldmaple = bestmaple; ! bestmaple = null; ! minload = Integer.MAX_VALUE; ! while (ids.hasMoreElements()) { ! id = (Integer)ids.nextElement(); ! maple = (Maple) maplesByID.get(id); ! if ((! maple.busy) && (maple.load < minload)) { ! minload = Math.min(minload,maple.load); ! bestmaple = maple; ! } ! } ! if (bestmaple == null) { ! // ! if (maplesByID.size() >= maxProcesses) { ! writeLog("Servlet busy - request refused\n"); ! return(null); ! } else { ! bestmaple = startMaple(); ! } ! } ! bestmaple.busy = true; ! bestmaple.user = student; ! oldmaple.load--; ! bestmaple.load++; ! maplesByStudent.put(student,bestmaple); ! return(bestmaple); ! } else { ! // assigned process is not busy ! bestmaple.busy = true; ! bestmaple.user = student; ! return(bestmaple); ! } } ! } } ! public void removeMaple(Maple maple) { Enumeration students; String student; ! ! synchronized(this) { maplesByID.remove(new Integer(maple.id)); students = maplesByStudent.keys(); while (students.hasMoreElements()) { ! student = (String)students.nextElement(); ! if (maplesByStudent.get(student) == maple) { ! maplesByStudent.remove(student); ! } } ! } } ! public void returnMaple(Maple maple) throws IOException { ! Enumeration students; ! String student; ! if (maple.condemned) { removeMaple(maple); --- 113,246 ---- if (bestmaple == null) { ! // no process assigned to this student yet ! if (maplesByID.size() < maxProcesses) { ! // under the process limit, so start a new one for this student ! bestmaple = startMaple(); ! bestmaple.load = 1; ! maplesByStudent.put(student,bestmaple); ! bestmaple.busy = true; ! bestmaple.user = student; ! return(bestmaple); ! } else { ! // no more processes allowed, so find one that this student ! // can share, with the minimum possible load ! ids = maplesByID.keys(); ! minload = Integer.MAX_VALUE; ! while (ids.hasMoreElements()) { ! id = (Integer)ids.nextElement(); ! maple = (Maple)maplesByID.get(id); ! if ((! maple.busy) && (maple.load < minload)) { ! minload = Math.min(minload,maple.load); ! bestmaple = maple; ! } ! } ! if (bestmaple == null) { ! writeLog("Servlet busy - request refused\n"); ! return(null); ! } else { ! bestmaple.busy = true; ! bestmaple.load++; ! maplesByStudent.put(student,bestmaple); ! bestmaple.user = student; ! return(bestmaple); ! } ! } } else { ! // there is a process assigned to this student ! if (bestmaple.busy) { ! // the assigned process is busy ! if (! student.equals("(admin)") && ! student.equals(bestmaple.user) && ! ((new Date()).getTime() - ! bestmaple.lastUseTime.getTime()) < 30000) { ! // The process is still working on the last request from ! // this student, which was submitted less than 30 seconds ! // ago; so we reject the request. ! return(null); ! } ! // find another process that this student can use ! ids = maplesByID.keys(); ! oldmaple = bestmaple; ! bestmaple = null; ! minload = Integer.MAX_VALUE; ! while (ids.hasMoreElements()) { ! id = (Integer)ids.nextElement(); ! maple = (Maple) maplesByID.get(id); ! if ((! maple.busy) && (maple.load < minload)) { ! minload = Math.min(minload,maple.load); ! bestmaple = maple; ! } ! } ! if (bestmaple == null) { ! // ! if (maplesByID.size() >= maxProcesses) { ! writeLog("Servlet busy - request refused\n"); ! return(null); ! } else { ! bestmaple = startMaple(); ! } ! } ! bestmaple.busy = true; ! bestmaple.user = student; ! oldmaple.load--; ! bestmaple.load++; ! maplesByStudent.put(student,bestmaple); ! return(bestmaple); ! } else { ! // assigned process is not busy ! bestmaple.busy = true; ! bestmaple.user = student; ! return(bestmaple); ! } } ! // KM ! // DIST } ! // END KM } ! // KM ! // removes the maple object from the pool, ! // but doesn't kill the process if its running ! // this is only called by other higher level routines, ! // so I am changing it from public to private ! // dist public void removeMaple(Maple maple) { ! private synchronized void removeMaple(Maple maple) { ! // END KM Enumeration students; String student; ! // KM ! // DIST synchronized(this) { ! // END KM maplesByID.remove(new Integer(maple.id)); students = maplesByStudent.keys(); while (students.hasMoreElements()) { ! student = (String)students.nextElement(); ! if (maplesByStudent.get(student) == maple) { ! maplesByStudent.remove(student); ! } } ! // KM ! // DIST } ! // END KM } ! // returns a Maple object to the pool when its done executing a command ! // KM ! // DIST public void returnMaple(Maple maple) ! public synchronized void returnMaple(Maple maple) ! // END KM throws IOException { ! // KM ! // dist Enumeration students; ! // dist String student; ! // dist synchronized(this) { ! // END KM if (maple.condemned) { removeMaple(maple); *************** *** 215,283 **** } public void discardMaple(Maple maple) { - Enumeration students; - String student; ! removeMaple(maple); ! try { ! writeLog("Closing condemned Maple process: ID = " + maple.id +"\n"); ! maple.destroy(); ! } ! catch(Exception e) {}; } ! public void condemn(Maple maple) { ! synchronized(this) { maple.condemned = true; if ( ! maple.busy) { ! removeMaple(maple); ! try { ! maple.close(); ! } ! catch(Exception e) {}; } ! } } // close all the processes in the pool ! public void drain() throws IOException { Maple maple; Integer id; Enumeration ids; - - writeLog("Draining Maple process pool"); ! synchronized(this) { ! ids = maplesByID.keys(); ! while (ids.hasMoreElements()) { ! id = (Integer)ids.nextElement(); ! maple = (Maple)maplesByID.get(id); ! maple.close(); ! } ! maplesByID.clear(); ! maplesByStudent.clear(); } } ! // close all the processes in the pool ! public void scorch() throws IOException { Maple maple; Integer id; Enumeration ids; - - writeLog("Scorching Maple process pool"); ! synchronized(this) { ids = maplesByID.keys(); while (ids.hasMoreElements()) { ! id = (Integer)ids.nextElement(); ! maple = (Maple)maplesByID.get(id); ! maple.destroy(); } maplesByID.clear(); maplesByStudent.clear(); ! } } --- 254,356 ---- } + // This removes the Maple object from the pool and unconditionally kills its process + // KM + // DIST public void discardMaple(Maple maple) { + // END KM public void discardMaple(Maple maple) { ! // KM ! // dist Enumeration students; ! // dist String student; ! // END KM ! ! removeMaple(maple); ! try { ! // KM ! // dist writeLog("Closing condemned Maple process: ID = " + maple.id +"\n"); ! writeLog("Destroying condemned Maple process: ID = " + maple.id +"\n"); ! // END KM ! maple.destroy(); ! } ! catch(Exception e) {}; ! // KM ! maple.discarded = true; ! // END KM } ! // Condemn the maple process and if its not busy, close it. ! // KM ! // DIST public void condemn(Maple maple) { ! public synchronized void condemn(Maple maple) { ! // DIST synchronized(this) { ! // END KM maple.condemned = true; if ( ! maple.busy) { ! removeMaple(maple); ! try { ! maple.close(); ! } catch(Exception e) {}; } ! // KM ! // DIST } ! // END KM } // close all the processes in the pool ! // KM ! // DIST public void drain() ! public synchronized void drain() ! // END KM throws IOException { Maple maple; Integer id; Enumeration ids; ! writeLog("Draining Maple process pool"); ! // KM ! // DIST synchronized(this) { ! // END KM ! ids = maplesByID.keys(); ! while (ids.hasMoreElements()) { ! id = (Integer)ids.nextElement(); ! maple = (Maple)maplesByID.get(id); ! maple.close(); } + maplesByID.clear(); + maplesByStudent.clear(); + // KM + // DIST } + // END KM + } ! // destroy all the processes in the pool ! // KM ! // DIST public void scorch() ! public synchronized void scorch() ! // END KM throws IOException { Maple maple; Integer id; Enumeration ids; ! writeLog("Scorching Maple process pool"); ! // KM ! // DIST synchronized(this) { ! // END KM ids = maplesByID.keys(); while (ids.hasMoreElements()) { ! id = (Integer)ids.nextElement(); ! maple = (Maple)maplesByID.get(id); ! // KM ! maple.discarded = true; ! // END KM ! maple.destroy(); } maplesByID.clear(); maplesByStudent.clear(); ! // KM ! // DIST } ! // END KM } *************** *** 286,290 **** // unassign processes from students who have not accessed the // system for age0 milliseconds. ! public void clean(long age0,long age1) throws IOException { long cutoff0 = (new Date()).getTime() - age0; --- 359,366 ---- // unassign processes from students who have not accessed the // system for age0 milliseconds. ! // KM ! // DIST public void clean(long age0,long age1) ! public synchronized void clean(long age0,long age1) ! // END KM throws IOException { long cutoff0 = (new Date()).getTime() - age0; *************** *** 297,329 **** msg.append("Cleaning Maple process pool\n"); ! ! synchronized(this) { ! ids = maplesByID.keys(); ! while(ids.hasMoreElements()) { ! id = (Integer)ids.nextElement(); ! maple = (Maple) maplesByID.get(id); ! if (maple.lastUseTime.getTime() < cutoff0 || ! maple.creationTime.getTime() < cutoff1) { ! msg.append("Condemning old process " + maple.id + "\n"); ! condemn(maple); ! } } ! students = maplesByStudent.keys(); ! while (students.hasMoreElements()) { ! student = (String) students.nextElement(); ! if (((Date)lastAccessByStudent.get(student)).getTime() ! < cutoff0) { ! lastAccessByStudent.remove(student); ! maple = (Maple) maplesByStudent.get(student); ! if (maple != null) { ! maplesByStudent.remove(student); ! maple.load--; ! } ! } } - writeLog(msg.toString()); } } --- 373,407 ---- msg.append("Cleaning Maple process pool\n"); ! // KM ! // DIST synchronized(this) { ! // END KM ! ids = maplesByID.keys(); ! while(ids.hasMoreElements()) { ! id = (Integer)ids.nextElement(); ! maple = (Maple) maplesByID.get(id); ! if (maple.lastUseTime.getTime() < cutoff0 || ! maple.creationTime.getTime() < cutoff1) { ! msg.append("Condemning old process " + maple.id + "\n"); ! condemn(maple); } + } ! students = maplesByStudent.keys(); ! while (students.hasMoreElements()) { ! student = (String) students.nextElement(); ! if (((Date)lastAccessByStudent.get(student)).getTime() < cutoff0) { ! lastAccessByStudent.remove(student); ! maple = (Maple) maplesByStudent.get(student); ! if (maple != null) { ! maplesByStudent.remove(student); ! maple.load--; ! } } } + writeLog(msg.toString()); + // KM + // DIST } + // END KM } *************** *** 339,343 **** } ! public String statusReport() { StringBuffer report = new StringBuffer(); Enumeration ids,students; --- 417,424 ---- } ! // KM ! // DIST public String statusReport() { ! public synchronized String statusReport() { ! // END KM StringBuffer report = new StringBuffer(); Enumeration ids,students; *************** *** 348,436 **** String creationtime,lastusetime,user,status; Hashtable index; ! ! synchronized (this) { ids = maplesByID.keys(); if (ids.hasMoreElements()) { ! report.append("<table border width='100%'>\n" + ! " <tr>\n" + ! " <th>ID</th>\n" + ! " <th>Created</th>\n" + ! " <th>Last Used</th>\n" + ! " <th>User</th>\n" + ! " <th>Load</th>\n" + ! " <th>Status</th>\n" + ! " </tr>\n"); ! ! index = new Hashtable(); ! while (ids.hasMoreElements()) { ! id = (Integer) ids.nextElement(); ! index.put(id,new Vector()); ! maple = (Maple)maplesByID.get(id); ! creationtime = tf.format(maple.creationTime); ! lastusetime = tf.format(maple.lastUseTime); ! ! if (maple.busy) { ! user = maple.user; ! status = "busy"; ! } else { ! user = "(free)"; ! if (maple.condemned) { ! status = "condemned"; ! } else { ! if (maple.check()) { ! status = "ok"; ! } else { ! status = "not ok - closing"; ! condemn(maple); ! } ! } ! } ! ! report.append(" <tr>\n" + ! " <td>" + maple.id + "</td>\n" + ! " <td>" + creationtime + "</td>\n" + ! " <td>" + lastusetime + "</td>\n" + ! " <td>" + user + "</td>\n" + ! " <td>" + maple.load + "</td>\n" + ! " <td>" + status + "</td>\n" + ! " </tr>\n"); ! ! } ! report.append("</table>\n"); ! students = maplesByStudent.keys(); ! while (students.hasMoreElements()) { ! student = (String) students.nextElement(); ! id = new Integer(((Maple) (maplesByStudent.get(student))).id); ! ((Vector) index.get(id)).addElement(student); ! } ! report.append("<h2>Process assignments:</h2>\n"); ! report.append("<table border width='100%'>\n" + ! "<tr>\n" + ! "<th width='10%'>Process</th>\n" + ! "<th width='90%'>Students</th>\n" ); ! ids = maplesByID.keys(); ! while (ids.hasMoreElements()) { ! id = (Integer) ids.nextElement(); ! report.append("<tr><td width='10%'>" + ! id.intValue() + ! "</td>\n<td width='90%'>"); ! students = ((Vector) index.get(id)).elements(); ! while (students.hasMoreElements()) { ! student = (String) students.nextElement(); ! report.append(student + " "); ! } ! report.append("</td></tr>\n"); ! } ! report.append("</table>\n"); } else { ! report.append("There are no active Maple processes.<br>\n"); } return (report.toString()); } ! } } --- 429,531 ---- String creationtime,lastusetime,user,status; Hashtable index; ! // KM ! // DIST synchronized (this) { ! // END KM ids = maplesByID.keys(); if (ids.hasMoreElements()) { ! report.append( ! "<table border width='100%'>\n" + ! " <tr>\n" + ! " <th>ID</th>\n" + ! // KM ! " <th>PID</th>\n" + ! // END KM ! " <th>Created</th>\n" + ! " <th>Last Used</th>\n" + ! " <th>User</th>\n" + ! " <th>Load</th>\n" + ! " <th>Status</th>\n" + ! " </tr>\n"); ! ! index = new Hashtable(); ! while (ids.hasMoreElements()) { ! id = (Integer) ids.nextElement(); ! index.put(id,new Vector()); ! maple = (Maple)maplesByID.get(id); ! creationtime = tf.format(maple.creationTime); ! lastusetime = tf.format(maple.lastUseTime); ! ! if (maple.busy) { ! user = maple.user; ! status = "busy"; ! } else { ! user = "(free)"; ! if (maple.condemned) { ! status = "condemned"; ! } else { ! if (maple.check()) { ! status = "ok"; ! } else { ! status = "not ok - closing"; ! condemn(maple); ! } ! } ! } ! ! report.append(" <tr>\n" + ! " <td>" + maple.id + "</td>\n" + ! // KM ! " <td>" + (maple.pid == -1 ? "N/A" : Integer.toString(maple.pid)) + "</td>\n" + ! // END KM ! " <td>" + creationtime + "</td>\n" + ! " <td>" + lastusetime + "</td>\n" + ! " <td>" + user + "</td>\n" + ! " <td>" + maple.load + "</td>\n" + ! " <td>" + status + "</td>\n" + ! " </tr>\n"); ! ! } ! report.append("</table>\n"); ! ! students = maplesByStudent.keys(); ! while (students.hasMoreElements()) { ! student = (String) students.nextElement(); ! id = new Integer(((Maple) (maplesByStudent.get(student))).id); ! ((Vector) index.get(id)).addElement(student); ! } ! ! report.append("<h2>Process assignments:</h2>\n"); ! report.append("<table border width='100%'>\n" + ! "<tr>\n" + ! "<th width='10%'>Process</th>\n" + ! "<th width='90%'>Students</th>\n" ); ! ids = maplesByID.keys(); ! while (ids.hasMoreElements()) { ! id = (Integer) ids.nextElement(); ! report.append( ! "<tr><td width='10%'>" + ! id.intValue() + ! "</td>\n<td width='90%'>"); ! students = ((Vector) index.get(id)).elements(); ! while (students.hasMoreElements()) { ! student = (String) students.nextElement(); ! report.append(student + " "); ! } ! report.append("</td></tr>\n"); ! } ! report.append("</table>\n"); } else { ! report.append("There are no active Maple processes.<br>\n"); } return (report.toString()); } ! // KM ! // DIST } ! // END KM ! } |
From: <gus...@us...> - 2003-08-26 08:27:53
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1:/tmp/cvs-serv5333/WEB-INF/maple Modified Files: Tag: windows AutoConf.mpl ManualConfig.dist Servlet.mpl Log Message: special to windows installation Index: AutoConf.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/AutoConf.mpl,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** AutoConf.mpl 25 Aug 2003 21:47:18 -0000 1.3 --- AutoConf.mpl 26 Aug 2003 08:27:43 -0000 1.3.2.1 *************** *** 4,7 **** --- 4,8 ---- # Distributed without warranty under the GPL - see README for details + printf("AIM will now try to configure your system automatically.\n"): *************** *** 457,460 **** --- 458,462 ---- fi: + # KM # dist p("\n"): *************** *** 483,486 **** --- 485,489 ---- "Def" = "C:\\AIM\\Process", "Def" = "C:\\Process", + "Def" = cat(Config['WebAppDir'],"\\bin\\process\\process.exe"), "Check" = ["-v","beyondlogic.org"] )): Index: ManualConfig.dist =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/ManualConfig.dist,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** ManualConfig.dist 25 Aug 2003 21:47:18 -0000 1.2 --- ManualConfig.dist 26 Aug 2003 08:27:43 -0000 1.2.2.1 *************** *** 2,7 **** # This configuration file can be edited by hand. After editing, you ! # should run AutoConf.mpl to generate Config.mpl and ServletConfig.mpl, ! # and then run Servlet.mpl to generate web.xml and server.xml, as # described in the installation instructions. --- 2,6 ---- # This configuration file can be edited by hand. After editing, you ! # should run AutoConf.mpl as # described in the installation instructions. *************** *** 10,41 **** ###################################################################### # The name of the subdirectory of the Tomcat\webapps directory into # which you have copied the AiM files # Config['TomcatContext'] := "AiM": ! ###################################################################### ! # The SMTP server that AiM should use for sending mail. This is only ! # used under Windows. You will certainly want to change this setting. ! # Config['SMTPServer'] := "smtp.york.ac.uk": ! # The absolute path to the BLAT program, used for sending email under ! # Windows. # Config['BLATProgram'] := "C:\\Tomcat\\webapps\\AiM\\bin\\blat\\blat.exe": ! # The absolute path to the sendmail program, used under Linux ! # Config['SendmailProgram'] := "/usr/lib/sendmail": ###################################################################### ! # The top directory for the Java distribution. The ! # recommended locations are as follows: ! # Config['JavaHome'] := "/usr/java/jdk": ! # Config['JavaHome'] := "C:\\j2sdk1.4.2": ###################################################################### ! # The top directory for the Tomcat distribution. The recommended ! # locations are as follows: ! # Config['CatalinaHome'] := "/usr/local/tomcat": # Config['CatalinaHome'] := "C:\\Tomcat": --- 9,66 ---- ###################################################################### + # The SMTP server that AiM should use for sending mail. + # You will certainly want to change this setting. + # Config['SMTPServer'] := "smtp.york.ac.uk": + + ###################################################################### + # The fully qualified host name of the server (eg aim.shef.ac.uk). + # For initial testing purposes, you can set this to "localhost". This + # will allow you to access AiM that it is running on, but not from any + # other machine. + # Config['HostName'] := "localhost": + + ###################################################################### # The name of the subdirectory of the Tomcat\webapps directory into # which you have copied the AiM files # Config['TomcatContext'] := "AiM": ! # You probably won't need to make any changes below, unless you get an ! # error message after reading in autoconf.mpl ! ###################################################################### ! # The absolute path to the BLAT program, used for sending email # Config['BLATProgram'] := "C:\\Tomcat\\webapps\\AiM\\bin\\blat\\blat.exe": ! ###################################################################### ! # The absolute path to the kill program (used to kill processes on this OS). ! # Config['KillProgram'] := "C:\\Tomcat\\webapps\\AiM\\bin\\Process\\Process.exe": + ###################################################################### + # The number of 'Recent Requests' to show on the Alice Monitor page + # Config['AliceHistorySize'] := 20: ###################################################################### ! # The time limits placed on Maple processes by the Alice servlet. ! # Processes which take longer than the time limit are terminated. ! # The AdminTimeLimit restricts the time allowed for Administrative ! # commands. The StudentTimeLimit is the restriction on all other ! # commands. Generally the StudentTimeLimit should be shorter than ! # the admisitrative time limit. Both values are integers which specify ! # the time limit in milliseconds. ! # Config['StudentTimeLimit'] := 60000: # one minute ! # Config['AdminTimeLimit'] := 1200000: # twenty minutes + ###################################################################### + # The maximum number of maple processes that can be running at the same + # time on this machine. + # Config['MaxMapleProcesses'] := 8: ###################################################################### ! # The top directory for the Java distribution. ! # Config['JavaHome'] := "C:\\Program Files\\Java\\j2re1.4.2": ! ! ! ###################################################################### ! # The top directory for the Tomcat distribution. # Config['CatalinaHome'] := "C:\\Tomcat": *************** *** 43,48 **** ###################################################################### # The absolute path to the maple program. - # The recommended locations are as follows: - # Config['MapleProgram'] := "/usr/bin/maple": # Config['MapleProgram'] := "C:\\Program Files\\Maple 8\\bin.win\\cmaple8.exe": --- 68,71 ---- *************** *** 50,55 **** ###################################################################### # The absolute path to the tth program (used to convert LaTeX to HTML). - # The recommended locations are as follows: - # Config['TtHProgram'] := "/usr/local/tomcat/webapps/aim/bin/tth/tth": # Config['TtHProgram'] := "C:\\Tomcat\\webapps\\AiM\\bin\\tth\\tth.exe": --- 73,76 ---- *************** *** 58,65 **** # The directory where the servlet should put temporary copies of uploaded # files. (The Maple part of the system will delete them or move them to ! # a more permanent home moments later.) Under Windows, the path should ! # use backslashes as separators, and should not contain any spaces. ! # The recommended locations are as follows ! # Config['TempDir'] := "/tmp": # Config['TempDir'] := "C:\\WINDOWS\\Temp": --- 79,83 ---- # The directory where the servlet should put temporary copies of uploaded # files. (The Maple part of the system will delete them or move them to ! # a more permanent home moments later.) # Config['TempDir'] := "C:\\WINDOWS\\Temp": *************** *** 72,83 **** ###################################################################### - # The fully qualified host name of the server (eg aim.shef.ac.uk). - # For initial testing purposes, you can set this to "localhost". This - # will allow you to access AIM that it is running on, but not from any - # other machine. - # Config['HostName'] := "localhost": - - - ###################################################################### # The number of the port on which Tomcat should listen. By default # this is 8080. For any port other than 80, the --- 90,93 ---- *************** *** 89,93 **** ###################################################################### ! # In principle this allows you to choose the language in which AIM's # messages are presented. The required mechanisms are in place but # as yet there are no tables of translated messages. --- 99,103 ---- ###################################################################### ! # In principle this allows you to choose the language in which AiM's # messages are presented. The required mechanisms are in place but # as yet there are no tables of translated messages. *************** *** 129,138 **** # Config['DocumentURL'] # Config['ServletURL'] - # KM - # Config['TimeLimit'] - # END KM # Config['WEBINFDir'] # Config['WebAppDir'] # Config['WebDir'] ###################################################################### --- 139,146 ---- # Config['DocumentURL'] # Config['ServletURL'] # Config['WEBINFDir'] # Config['WebAppDir'] # Config['WebDir'] + ###################################################################### Index: Servlet.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/Servlet.mpl,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** Servlet.mpl 25 Aug 2003 21:47:18 -0000 1.3 --- Servlet.mpl 26 Aug 2003 08:27:43 -0000 1.3.2.1 *************** *** 4,7 **** --- 4,8 ---- # Distributed without warranty under the GPL - see README for details + # This script creates the servlet configuration file web.xml, # and the scripts startaim.sh and stopaim.sh that start and *************** *** 156,159 **** --- 157,198 ---- ): + # KM + initparam( + "KillProgram", + "The command used to kill processes on this OS.", + 'omit', + 'KillProgram' + ): + + initparam( + "KillProgramArg", + "The argument given to the kill command to kill processes on this OS (preceding the PID).", + 'omit', + 'KillProgramArg' + ): + + initparam( + "AliceHistorySize", + "The number of 'Recent Requests' to display on the Alice Monitor page.", + 20, + 'AliceHistorySize' + ): + + initparam( + "StudentTimeLimit", + "The time limit on non-administrative commands in milliseconds.", + 60000, + 'StudentTimeLimit' + ): + + initparam( + "AdminTimeLimit", + "The time limit on administrative commands in milliseconds.", + 1200000, + 'AdminTimeLimit' + ): + + # END KM + initparam( "LogFile", *************** *** 406,410 **** for f in os_listfiles(cat(cossource,"/multipart")) do os_copy(cat(cossource,"/multipart/",f), ! cat(cosdest,"/multipart/",f)): od: --- 445,449 ---- for f in os_listfiles(cat(cossource,"/multipart")) do os_copy(cat(cossource,"/multipart/",f), ! cat(cosdest,"/multipart/",f)): od: |
From: <gus...@us...> - 2003-08-26 08:27:53
|
Update of /cvsroot/aimmath/AIM/doc In directory sc8-pr-cvs1:/tmp/cvs-serv5333/doc Removed Files: Tag: windows install.html installwin.html Log Message: special to windows installation --- install.html DELETED --- --- installwin.html DELETED --- |
From: <gus...@us...> - 2003-08-26 08:27:53
|
Update of /cvsroot/aimmath/AIM/bin/tth_exe In directory sc8-pr-cvs1:/tmp/cvs-serv5333/bin/tth_exe Removed Files: Tag: windows tth Log Message: special to windows installation --- tth DELETED --- |
From: <gus...@us...> - 2003-08-26 08:27:52
|
Update of /cvsroot/aimmath/AIM/bin/process In directory sc8-pr-cvs1:/tmp/cvs-serv5333/bin/process Added Files: Tag: windows Process.exe Readme.txt Log Message: special to windows installation --- NEW FILE: Process.exe --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Readme.txt --- Command Line Process Viewer/Killer/Suspender for Windows NT/2000/XP http://www.beyondlogic.org/consulting/processutil/processutil.htm |
From: <gus...@us...> - 2003-08-26 07:14:40
|
Update of /cvsroot/aimmath/AIM/bin/process In directory sc8-pr-cvs1:/tmp/cvs-serv26022/process Log Message: Directory /cvsroot/aimmath/AIM/bin/process added to the repository --> Using per-directory sticky tag `windows' |
From: <gus...@us...> - 2003-08-25 22:46:50
|
Update of /cvsroot/aimmath/AIM/WEB-INF/classes In directory sc8-pr-cvs1:/tmp/cvs-serv12209/WEB-INF/classes Modified Files: Tag: develop_2_1 Alice.class Maple.class Log Message: now provide MathDisplay=latex option Index: Alice.class =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/classes/Alice.class,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 Binary files /tmp/cvsyDL7eq and /tmp/cvsgFXpgG differ Index: Maple.class =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/classes/Maple.class,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 Binary files /tmp/cvsrJUpLq and /tmp/cvsudSzkH differ |
From: <gus...@us...> - 2003-08-25 22:00:51
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim/analyze In directory sc8-pr-cvs1:/tmp/cvs-serv12052/WEB-INF/maple/aim/analyze Modified Files: Question.mpl Quiz.mpl Log Message: merged from develop_2_1 Index: Question.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/analyze/Question.mpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Question.mpl 5 May 2003 03:25:46 -0000 1.2 --- Question.mpl 25 Aug 2003 21:47:19 -0000 1.3 *************** *** 36,40 **** ['Parameter',"QuizName" = 'required'], ['Parameter',"QuestionName" = 'required'], ! ['Parameter', "ValidityConstraint":: --- 36,40 ---- ['Parameter',"QuizName" = 'required'], ['Parameter',"QuestionName" = 'required'], ! ['Parameter',"PartLabel"::string = 'required'], ['Parameter', "ValidityConstraint":: *************** *** 217,222 **** proc(page::`aim/admin/Page`,p::table) ! local action,subject,quizname,quiz,questionname,question,analysis, ! opts,summary,timedatestring; global AimCache; --- 217,222 ---- proc(page::`aim/admin/Page`,p::table) ! local action,subject,quizname,quiz,questionname,partlabel, ! question,analysis,opts,summary,timedatestring; global AimCache; *************** *** 227,231 **** quizname := p["QuizName"]; ! quiz := traperror(subject['GetQuiz',quizname]); if not(type(quiz,`aim/Quiz`)) then --- 227,232 ---- quizname := p["QuizName"]; ! ! quiz := traperror(eval(subject['GetQuiz',quizname])); if not(type(quiz,`aim/Quiz`)) then *************** *** 237,241 **** questionname := p["QuestionName"]; ! question := traperror(quiz['GetQuestion',questionname]); if not(type(question,`aim/Question`)) then --- 238,243 ---- questionname := p["QuestionName"]; ! partlabel := p["PartLabel"]; ! question := traperror(quiz['GetQuestion',questionname,partlabel]); if not(type(question,`aim/Question`)) then *************** *** 249,258 **** if p["Action"] = "AnalyzeQuestion" then analysis := ! traperror(eval(quiz['GetQuestionAnalysis',questionname])); fi; if analysis = NULL then analysis := ! eval(`aim/Question/Analyze`(quiz['RootDir'],questionname)); if not(type([analysis],[`aim/Question/Analysis`])) then --- 251,263 ---- if p["Action"] = "AnalyzeQuestion" then analysis := ! traperror(eval(quiz['GetQuestionAnalysis',questionname,partlabel])); fi; if analysis = NULL then analysis := ! # KM ! # DIST eval(`aim/Question/Analyze`(quiz['RootDir'],questionname)); ! eval(`aim/Question/Analyze`(quiz['RootDir'],questionname,partlabel)); ! # END KM if not(type([analysis],[`aim/Question/Analysis`])) then Index: Quiz.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/analyze/Quiz.mpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Quiz.mpl 5 May 2003 03:25:46 -0000 1.2 --- Quiz.mpl 25 Aug 2003 21:47:19 -0000 1.3 *************** *** 62,66 **** "", ['Command' = "analyze/Question", ! 'Arguments' = ["QuestionName"], 'LinkText' = __("Analyze")]], --- 62,66 ---- "", ['Command' = "analyze/Question", ! 'Arguments' = ["QuestionName","PartLabel"], 'LinkText' = __("Analyze")]], *************** *** 124,129 **** local subject,register,ids,action,quizname,quiz, ! qnames,i,istring,qname,question,analysis,entry, ! resultstable,questiontable,timedatestring,f,g; action := p["Action"]; --- 124,130 ---- local subject,register,ids,action,quizname,quiz, ! qn,qnos,i,qname,question,analysis,entry, ! resultstable,questiontable,timedatestring,f,g, ! nl,qlist,nllist; action := p["Action"]; *************** *** 144,148 **** analysis := traperror(eval(quiz['GetAnalysis'])); fi; ! if analysis = NULL then register := eval(subject['GetRegister']); --- 145,149 ---- analysis := traperror(eval(quiz['GetAnalysis'])); fi; ! if analysis = NULL then register := eval(subject['GetRegister']); *************** *** 157,161 **** analysis['Sort',p["OrderStudentsBy"]]; ! qnames := quiz['QuestionNames']; if analysis['AnalysisTime'] = NULL then --- 158,173 ---- analysis['Sort',p["OrderStudentsBy"]]; ! qlist := quiz['Questions']; ! nllist := map(q -> [q['Name'],q['PartLabel']],qlist); ! ! qn := 0; ! qnos := NULL; ! for nl in nllist do ! if member(nl[2], {"", ".1"}) then ! qn := qn + 1; ! fi; ! qnos := qnos, cat("", qn, nl[2]); ! od; ! qnos := [qnos]; if analysis['AnalysisTime'] = NULL then *************** *** 166,178 **** if action = "DownloadQuiz" then ! f := (n,x) -> cat(x['MarkString',n],"\t"); g := ! proc(entry,qnames) sprintf("%s\t%s\t%s\t%s%s\n", entry['StudentID'], entry['StudentFirstName'], entry['StudentSurname'], ! cat(op(map(f,qnames,entry))), entry['TotalMarkString']); end; --- 178,190 ---- if action = "DownloadQuiz" then ! f := (n,x) -> cat(x['MarkString',op(n)],"\t"); g := ! proc(entry,nllist) sprintf("%s\t%s\t%s\t%s%s\n", entry['StudentID'], entry['StudentFirstName'], entry['StudentSurname'], ! cat(op(map(f,nllist,entry))), entry['TotalMarkString']); end; *************** *** 186,192 **** __("First name"),"\t", __("Surname"),"\t", ! seq(sprintf("%d\t",i),i=1..nops(qnames)), __("Total"),"\n", ! op(map(g,analysis['Entries'],qnames))); page['SetContentType',"text/tab-separated-values"]; --- 198,204 ---- __("First name"),"\t", __("Surname"),"\t", ! seq(sprintf("%d\t",i),i=1..nops(nllist)), __("Total"),"\n", ! op(map(g,analysis['Entries'],nllist))); page['SetContentType',"text/tab-separated-values"]; *************** *** 194,200 **** fi; ! f := (n,x) -> cat("<td>",x['MarkString',n],"</td>\n"); ! g := proc(entry,qnames) cat( "<tr>\n<td>", --- 206,213 ---- fi; ! f := (n,x) -> cat("<td>",x['MarkString',op(n)],"</td>\n"); ! #f := (n,x) -> cat("<td>",convert(eval(x['MarkCodeTable][op(1,n)])),"</td>\n"); ! g := proc(entry,nllist) cat( "<tr>\n<td>", *************** *** 208,212 **** entry['StudentSurname'], "</td>\n", ! op(map(f,qnames,entry)), "<td>",entry['TotalMarkString'],"</td>\n", "</tr>\n"); --- 221,225 ---- entry['StudentSurname'], "</td>\n", ! op(map(f,nllist,entry)), "<td>",entry['TotalMarkString'],"</td>\n", "</tr>\n"); *************** *** 214,218 **** resultstable := ! cat(op(map(g,analysis['Entries'],qnames))); resultstable := --- 227,231 ---- resultstable := ! cat(op(map(g,analysis['Entries'],nllist))); resultstable := *************** *** 222,227 **** "<th>",__("ID"),"</th>\n", "<th>",__("Name"),"</th>\n", ! seq(sprintf("<th><a href='#Q%d'>%d</a></th>\n",i,i), ! i=1..nops(qnames)), "<th>",__("Total"),"</th>\n", "</tr>", --- 235,239 ---- "<th>",__("ID"),"</th>\n", "<th>",__("Name"),"</th>\n", ! seq(sprintf("<th><a href='#Q%s'>%s</a></th>\n",qn,qn),qn=qnos), "<th>",__("Total"),"</th>\n", "</tr>", *************** *** 236,240 **** ["tr", [["th","width" = "10%","noscroll"]], # question number ! [["th","width" = "45%","align"="left"],__("Question name")], [["th","width" = "15%"]], # edit link [["th","width" = "15%"]], # try link --- 248,253 ---- ["tr", [["th","width" = "10%","noscroll"]], # question number ! [["th","width" = "40%","align"="left"],__("Question name")], ! [["th","width" = "5%"]], # part label [["th","width" = "15%"]], # edit link [["th","width" = "15%"]], # try link *************** *** 242,257 **** ]); ! for i to nops(qnames) do ! istring := sprintf("%d",i); ! qname := qnames[i]; ! questiontable['AddContents', ! ["tr", ! ["td",[["a", "name" = cat("Q",istring)],istring]], ! ["td",qname], ! ["td",page['ActionLink',"EditQuestion",[qname]]], ! ["td",page['ActionLink',"TryQuestion",[qname]]], ! ["td",page['ActionLink',"AnalyzeQuestion",[qname]]]]]; ! question := traperror(eval(quiz['GetQuestion',qname])); if type(question,`aim/Question`) then if assigned(question['Description']) and question['Description'] <> "" then --- 255,270 ---- ]); ! for i to nops(nllist) do ! question := qlist[i]; if type(question,`aim/Question`) then + qname := question['Name']; + questiontable['AddContents', + ["tr", + ["td",[["a", "name" = cat("Q",qnos[i])],qnos[i]]], + ["td",qname], + ["td",question['PartLabel']], + ["td",page['ActionLink',"EditQuestion",[qname]]], + ["td",page['ActionLink',"TryQuestion",[qname]]], + ["td",page['ActionLink',"AnalyzeQuestion",[qname,question['PartLabel']]]]]]; if assigned(question['Description']) and question['Description'] <> "" then |
From: <gus...@us...> - 2003-08-25 22:00:50
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin In directory sc8-pr-cvs1:/tmp/cvs-serv12052/WEB-INF/maple/aim/admin Modified Files: Generate.mpl Notify.mpl Quiz.mpl Register.mpl SourceDir.mpl SourceFile.mpl Student.mpl Subject.mpl SubjectHome.mpl Zone.mpl Added Files: ZoneAdminHome.mpl ZoneStudentHome.mpl Log Message: merged from develop_2_1 Index: Generate.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/Generate.mpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Generate.mpl 5 May 2003 03:25:46 -0000 1.2 --- Generate.mpl 25 Aug 2003 21:47:19 -0000 1.3 *************** *** 109,119 **** cat( __("Passwords were generated for the following students:"), ! "\n<br>\n", studentlist, ! "\n<br>\n", sprintf( __("Click on the %s link to send email to these students, telling them their passwords."), page['ActionLink',"Notify",[idlist]]), ! "\n<br>\n"); fi; else --- 109,119 ---- cat( __("Passwords were generated for the following students:"), ! "\n<br/>\n", studentlist, ! "\n<br/>\n", sprintf( __("Click on the %s link to send email to these students, telling them their passwords."), page['ActionLink',"Notify",[idlist]]), ! "\n<br/>\n"); fi; else *************** *** 123,127 **** "<font color='red'>", __("There was an error while generating passwords:"), ! "</font>\n<br>\n<pre>\n", err, "\n</pre>\n"); --- 123,127 ---- "<font color='red'>", __("There was an error while generating passwords:"), ! "</font>\n<br/>\n<pre>\n", err, "\n</pre>\n"); Index: Notify.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/Notify.mpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Notify.mpl 5 May 2003 03:25:46 -0000 1.2 --- Notify.mpl 25 Aug 2003 21:47:19 -0000 1.3 *************** *** 107,113 **** html, __("The following students were notified of their passwords:"), ! "\n<br>\n", "<table>\n",op(map(line,notified)),"</table>\n", ! "<br>\n"; fi; --- 107,113 ---- html, __("The following students were notified of their passwords:"), ! "\n<br/>\n", "<table>\n",op(map(line,notified)),"</table>\n", ! "<br/>\n"; fi; *************** *** 115,123 **** html := html, ! "<hr>", __("The following students were not notified, because their email addresses are not known:"), ! "\n<br>\n", "<table>\n",op(map(line,noemail)),"</table>\n", ! "<br>\n"; fi; --- 115,123 ---- html := html, ! "<hr/>", __("The following students were not notified, because their email addresses are not known:"), ! "\n<br/>\n", "<table>\n",op(map(line,noemail)),"</table>\n", ! "<br/>\n"; fi; *************** *** 125,135 **** html := html, ! "<hr>", __("The following students were not found in the register:"), ! "\n<br>\n", "<table>\n", op(map(i -> cat("<tr><td>",i,"</td></tr>\n"),badids)), "</table>\n", ! "<br>\n"; fi; html := cat(html); --- 125,135 ---- html := html, ! "<hr/>", __("The following students were not found in the register:"), ! "\n<br/>\n", "<table>\n", op(map(i -> cat("<tr><td>",i,"</td></tr>\n"),badids)), "</table>\n", ! "<br/>\n"; fi; html := cat(html); Index: Quiz.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/Quiz.mpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Quiz.mpl 5 May 2003 03:25:46 -0000 1.2 --- Quiz.mpl 25 Aug 2003 21:47:19 -0000 1.3 *************** *** 100,103 **** --- 100,108 ---- ['LinkText' = __("Browse source"), 'Command' = "admin/SourceDir"]], + + ['Action',"AddEditQuestions", + "Browse the source file directory.", + ['LinkText' = __("Add or edit questions"), + 'Command' = "admin/SourceDir"]], ['Action',"AnalyzeQuiz", *************** *** 169,175 **** [["td", "width" = "40%", "align" = "left"], [["a", "name" = "Questions"],["h2",__("Questions")]]], ! [["td", "width" = "30%", "align" = "right"], {["UseAllQuestions"]}], ! [["td", "width" = "30%", "align" = "right"], {"togglehidden"}]]], {"questiontable"}, --- 174,182 ---- [["td", "width" = "40%", "align" = "left"], [["a", "name" = "Questions"],["h2",__("Questions")]]], ! [["td", "width" = "20%", "align" = "right"], ! {["AddEditQuestions"]}], ! [["td", "width" = "20%", "align" = "right"], {["UseAllQuestions"]}], ! [["td", "width" = "20%", "align" = "right"], {"togglehidden"}]]], {"questiontable"}, *************** *** 187,191 **** "rows" = "15" ], {"selectortext"}], ! "\n<br>\n", [["hr", "noshade"]], --- 194,198 ---- "rows" = "15" ], {"selectortext"}], ! "\n<br/>\n", [["hr", "noshade"]], *************** *** 252,256 **** if err = lasterror then page['SetError', ! cat(__("Error while creating quiz %s:"),"\n<br>\n%s<br>\n"), quizname,err]; RETURN(); --- 259,263 ---- if err = lasterror then page['SetError', ! cat(__("Error while creating quiz %s:"),"\n<br/>\n%s<br/>\n"), quizname,err]; RETURN(); *************** *** 381,385 **** [["th", "align" = "left", "width" = "10%"]," "], [["th", "align" = "left", "width" = "10%"]," "]], ! ["tr", [["td", "colspan" = "6"],["hr"]]]); if p["ShowHiddenQuestions"] = "true" then --- 388,392 ---- [["th", "align" = "left", "width" = "10%"]," "], [["th", "align" = "left", "width" = "10%"]," "]], ! ["tr", [["td", "colspan" = "7"],["hr"]]]); if p["ShowHiddenQuestions"] = "true" then Index: Register.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/Register.mpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Register.mpl 5 May 2003 03:25:46 -0000 1.2 --- Register.mpl 25 Aug 2003 21:47:19 -0000 1.3 *************** *** 355,359 **** textfile := p["FileToUpload"]; if not(type([textfile],[string])) then ! page['SetError',__("Invalid upload file:<br> %A<br>"),textfile]; RETURN(); fi; --- 355,359 ---- textfile := p["FileToUpload"]; if not(type([textfile],[string])) then ! page['SetError',__("Invalid upload file:<br/> %A<br/>"),textfile]; RETURN(); fi; *************** *** 366,370 **** err := traperror(register['LoadText',p["FileToUpload"]]); if err = lasterror then ! page['SetError',__("Error uploading register:<br>%s<br>"),err]; RETURN(); fi; --- 366,370 ---- err := traperror(register['LoadText',p["FileToUpload"]]); if err = lasterror then ! page['SetError',__("Error uploading register:<br/>%s<br/>"),err]; RETURN(); fi; *************** *** 373,377 **** err := traperror(register['MergeText',textfile]); if err = lasterror then ! page['SetError',__("Error uploading register:<br>%s<br>"),err]; RETURN(); fi; --- 373,377 ---- err := traperror(register['MergeText',textfile]); if err = lasterror then ! page['SetError',__("Error uploading register:<br/>%s<br/>"),err]; RETURN(); fi; *************** *** 436,440 **** "<td><input type='checkbox' name='",s['ID'],"Selected'", `if`(member(s['ID'],sl)," checked",""), ! "></td>\n", "<td>",s['ID'],"</td>\n", "<td>",s['Name'],"</td>\n", --- 436,440 ---- "<td><input type='checkbox' name='",s['ID'],"Selected'", `if`(member(s['ID'],sl)," checked",""), ! "/></td>\n", "<td>",s['ID'],"</td>\n", "<td>",s['Name'],"</td>\n", *************** *** 467,471 **** "</tr>\n", op(map(studentline,studentlist,page,selected)), ! "</table>\n<br>\n"); page['Title'] := --- 467,471 ---- "</tr>\n", op(map(studentline,studentlist,page,selected)), ! "</table>\n<br/>\n"); page['Title'] := Index: SourceDir.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/SourceDir.mpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SourceDir.mpl 5 May 2003 03:25:46 -0000 1.2 --- SourceDir.mpl 25 Aug 2003 21:47:19 -0000 1.3 *************** *** 167,171 **** title := cat( ! "<h1>",__("AIM source files"),"</h1><br>\n", "<table>\n", "<tr><td>",__("Subject:"),"</td>\n", --- 167,171 ---- title := cat( ! "<h1>",__("AIM source files"),"</h1><br/>\n", "<table>\n", "<tr><td>",__("Subject:"),"</td>\n", *************** *** 174,178 **** "<td>",quiztitle,"</td></tr>\n", "</table>", ! "\n<br>\n"); shorttitle := sprintf("%s:%s:%s",__("Source"),subjname,quizname); --- 174,178 ---- "<td>",quiztitle,"</td></tr>\n", "</table>", ! "\n<br/>\n"); shorttitle := sprintf("%s:%s:%s",__("Source"),subjname,quizname); *************** *** 181,190 **** title := cat( ! "<h1>",__("AIM source files"),"</h1><br>\n", "<table>\n", "<tr><td>",__("Subject:"),"</td>\n", "<td>",subjtitle,"</td></tr>\n", "</table>", ! "\n<br>\n"); shorttitle := sprintf("%s:%s",__("Source"),subjname); --- 181,190 ---- title := cat( ! "<h1>",__("AIM source files"),"</h1><br/>\n", "<table>\n", "<tr><td>",__("Subject:"),"</td>\n", "<td>",subjtitle,"</td></tr>\n", "</table>", ! "\n<br/>\n"); shorttitle := sprintf("%s:%s",__("Source"),subjname); *************** *** 194,198 **** title := cat( ! "<h1>",__("AIM source files"),"</h1><br>\n", "<table>\n", "<tr><td>",__("Subject:"),"</td>\n", --- 194,198 ---- title := cat( ! "<h1>",__("AIM source files"),"</h1><br/>\n", "<table>\n", "<tr><td>",__("Subject:"),"</td>\n", *************** *** 201,205 **** "<td>",p["Dir"],"</td></tr>\n", "</table>", ! "\n<br>\n"); shorttitle := sprintf("%s:%s",__("Source"),subjname,p["Dir"]); --- 201,205 ---- "<td>",p["Dir"],"</td></tr>\n", "</table>", ! "\n<br/>\n"); shorttitle := sprintf("%s:%s",__("Source"),subjname,p["Dir"]); Index: SourceFile.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/SourceFile.mpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SourceFile.mpl 5 May 2003 03:25:46 -0000 1.2 --- SourceFile.mpl 25 Aug 2003 21:47:19 -0000 1.3 *************** *** 314,318 **** if nops(questions) = 0 then ! compreport := compreport,"\n<br>\n",__("No questions found"),"\n<br>\n"; fi; --- 314,318 ---- if nops(questions) = 0 then ! compreport := compreport,"\n<br/>\n",__("No questions found"),"\n<br/>\n"; fi; *************** *** 341,352 **** compreport := compreport, ! "<hr noshade>\n", sprintf( ! __("Question <font color='red'><tt>%s</tt></font>: compilation error\n<br>\n"), qname), msg; if errline > 0 then ! compreport := compreport,"\n<hr>\n<pre>\n"; for i from 1 to errline - 1 do compreport := compreport,lines[i]; --- 341,352 ---- compreport := compreport, ! "<hr noshade/>\n", sprintf( ! __("Question <font color='red'><tt>%s</tt></font>: compilation error\n<br/>\n"), qname), msg; if errline > 0 then ! compreport := compreport,"\n<hr/>\n<pre>\n"; for i from 1 to errline - 1 do compreport := compreport,lines[i]; *************** *** 363,367 **** fi; ! compreport := compreport,"<hr noshade>\n"; else compreport := --- 363,367 ---- fi; ! compreport := compreport,"<hr noshade/>\n"; else compreport := *************** *** 369,375 **** "<font color='red'>", __("Error: malformed compilation report"), ! "</font>\n<br>\n<pre>\n", `HTML/Escape`(sprintf("%a",eval(question))), ! "\n</pre>\n<br>\n"; fi; od; --- 369,375 ---- "<font color='red'>", __("Error: malformed compilation report"), ! "</font>\n<br/>\n<pre>\n", `HTML/Escape`(sprintf("%a",eval(question))), ! "\n</pre>\n<br/>\n"; fi; od; Index: Student.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/Student.mpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Student.mpl 5 May 2003 03:25:46 -0000 1.2 --- Student.mpl 25 Aug 2003 21:47:19 -0000 1.3 *************** *** 236,240 **** "value=\"",student['Password'],"\" ", "size=\"50\" ", ! "name=\"StudentPassword\"></td>\n", "</tr>\n"); --- 236,240 ---- "value=\"",student['Password'],"\" ", "size=\"50\" ", ! "name=\"StudentPassword\"/></td>\n", "</tr>\n"); Index: Subject.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/Subject.mpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Subject.mpl 5 May 2003 03:25:46 -0000 1.2 --- Subject.mpl 25 Aug 2003 21:47:19 -0000 1.3 *************** *** 340,344 **** if err = lasterror then page['SetError', ! cat(__("Error while creating subject %s:"),"\n<br>\n%s<br>\n"), subjectname,err]; RETURN(); --- 340,344 ---- if err = lasterror then page['SetError', ! cat(__("Error while creating subject %s:"),"\n<br/>\n%s<br/>\n"), subjectname,err]; RETURN(); Index: SubjectHome.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/SubjectHome.mpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SubjectHome.mpl 5 May 2003 03:25:46 -0000 1.2 --- SubjectHome.mpl 25 Aug 2003 21:47:19 -0000 1.3 *************** *** 123,127 **** if headtext = lasterror then ! headtext := sprintf("<h1>%s</h1>\n<br>\n",subject['Title']); fi; --- 123,127 ---- if headtext = lasterror then ! headtext := sprintf("<h1>%s</h1>\n<br/>\n",subject['Title']); fi; *************** *** 133,137 **** headtext := p["HeadText"]; if headtext = "" then ! headtext := sprintf("<h1>%s</h1>\n<br>\n",subject['Title']); fi; --- 133,137 ---- headtext := p["HeadText"]; if headtext = "" then ! headtext := sprintf("<h1>%s</h1>\n<br/>\n",subject['Title']); fi; Index: Zone.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/Zone.mpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Zone.mpl 5 May 2003 03:25:46 -0000 1.2 --- Zone.mpl 25 Aug 2003 21:47:19 -0000 1.3 *************** *** 14,19 **** ['Parameter',"SubjectName"], ! ['Parameter',"ShowHiddenSubjects"::boolean = false], ! ['Parameter', "Action" :: --- 14,21 ---- ['Parameter',"SubjectName"], ! # KM ! # DIST ['Parameter',"ShowHiddenSubjects"::boolean = false], ! ['Parameter',"ShowHiddenSubjects"::boolean = true], ! # END KM ['Parameter', "Action" :: *************** *** 86,89 **** --- 88,107 ---- 'Command' = "admin/Register"]], + ['Action',"EditStudentHome", + "Edit the header and footer for the home page seen by students. + (In between the header and footer goes an automatically generated + quiz selection form.", + ['LinkText' = __("Edit student login page"), + 'Command' = "admin/ZoneStudentHome"] + ], + + ['Action',"EditAdminHome", + "Edit the header and footer for the home page seen by students. + (In between the header and footer goes an automatically generated + quiz selection form.", + ['LinkText' = __("Edit administrator login page"), + 'Command' = "admin/ZoneAdminHome"] + ], + ################################################## *************** *** 173,187 **** ########## - ["h2",__("ID Note")], - ["br"], - __("#Explain ID note"), - ["br"], - [["textarea", "name" = "IDNote", "cols" = "70", "rows" = "20"], - {"IDNote"} - ], - ["br"], - - ########## - [["table", "width" = "100%"], ["tr", --- 191,194 ---- *************** *** 190,195 **** --- 197,204 ---- [["td", "width" = "50%", "align" = "right"], {"togglehidden"}]]], + {"explainhidden"}, {"subjecttable"}, ["br"], + ["hr"], __("New subject:")," ", [["inputtext", "name" = "SubjectToCreate", "value" = ""]], *************** *** 198,201 **** --- 207,223 ---- __("#Explain new subjects hidden"), [["hr","noshade"]], + + ########## + + ["h2",__("Login pages")], + ["br"], + {["EditStudentHome"]}, + ["br"], + {["EditAdminHome"]}, + ["br"], + [["hr","noshade"]], + + ########## + [["table","width" = "100%"], ["tr", *************** *** 206,244 **** [["td","width" = "17%"],{["SaveZoneOptions"]}]]], [["hr", "noshade"]], - - ########## - - ["h2",__("Student login page")], - ["br"], - __("#Explain student head and foot"), - ["h3",__("Header:")], - ["br"], - [["textarea", "name" = "StudentHead", "cols" = "70", "rows" = "20"], - {"studenthead"} - ], - ["br"], - ["h3",__("Footer:")], - ["br"], - [["textarea", "name" = "StudentFoot", "cols" = "70", "rows" = "10"], - {"studentfoot"} - ], - ["br"], - - ["h2",__("Administrator login page")], - ["br"], - __("#Explain admin head and foot"), - ["h3",__("Header:")], - ["br"], - [["textarea", "name" = "AdminHead", "cols" = "70", "rows" = "20"], - {"adminhead"} - ], - ["br"], - ["h3",__("Footer:")], - ["br"], - [["textarea", "name" = "AdminFoot", "cols" = "70", "rows" = "10"], - {"adminfoot"} - ], - ["br"], - [["a", "name"="bottom"]] ], --- 228,231 ---- *************** *** 250,256 **** local subject,excludedsubject,nam,subjectlist,ord,err, ! subjecttable,subjectnumber,togglehidden,hiddensubjects, ! studenthead,studentfoot,adminhead,adminfoot, ! studentheadfile,studentfootfile,adminheadfile,adminfootfile; global DefaultZone; --- 237,242 ---- local subject,excludedsubject,nam,subjectlist,ord,err, ! subjecttable,subjectnumber,togglehidden,explainhidden, ! hiddensubjects,visiblesubjects; global DefaultZone; *************** *** 268,305 **** fi; - studentheadfile := cat(Config['RootDir'],"/zonehead.html"); - studentfootfile := cat(Config['RootDir'],"/zonefoot.html"); - adminheadfile := cat(Config['RootDir'],"/adminhead.html"); - adminfootfile := cat(Config['RootDir'],"/adminfoot.html"); - if p["Action"] = "LoadZoneOptions" then - - studenthead := - traperror(`Util/TextFileContents`(studentheadfile)); - if studenthead = lasterror then studenthead := ""; fi; - - studentfoot := - traperror(`Util/TextFileContents`(studentfootfile)); - if studentfoot = lasterror then studentfoot := ""; fi; - - adminhead := - traperror(`Util/TextFileContents`(adminheadfile)); - if adminhead = lasterror then adminhead := ""; fi; - - adminfoot := - traperror(`Util/TextFileContents`(adminfootfile)); - if adminfoot = lasterror then adminfoot := ""; fi; else - - studenthead := p["StudentHead"]; - studentfoot := p["StudentFoot"]; - adminhead := p["AdminHead"]; - adminfoot := p["AdminFoot"]; - - fprintf(studentheadfile,"%s\n",studenthead); - fprintf(studentfootfile,"%s\n",studentfoot); - fprintf(adminheadfile,"%s\n",adminhead); - fprintf(adminfootfile,"%s\n",adminfoot); - page['SetTable', DefaultZone, --- 254,259 ---- *************** *** 363,437 **** fi; ! subjecttable := ! `new/HTML/Tag`( ! ["table", "width" = "100%"], ! ["tr", [["th", "align" = "left", "width" = "10%"], ! __("Subject number")], [["th", "align" = "left", "width" = "50%"], ! __("Name")], [["th", "align" = "left", "width" = "10%"]," "], [["th", "align" = "left", "width" = "10%"]," "], [["th", "align" = "left", "width" = "10%"]," "], [["th", "align" = "left", "width" = "10%"]," "]], ! ["tr", [["td", "colspan" = "8"],["hr"]]]); ! ! if p["ShowHiddenSubjects"] = "true" then ! togglehidden := page['ActionLink',"HideHiddenSubjects"]; ! subjecttable['AddContents', ! ["tr",[["td", "colspan" = "8"], ! __("Visible subjects")]]]; ! else ! togglehidden := ! sprintf(__("#Explain hidden subjects (%s)"), ! page['ActionLink',"ShowHiddenSubjects"]); ! fi; ! ! subjectnumber := 0; ! ! for nam in DefaultZone['SubjectNames'] do ! subjectnumber := subjectnumber + 1; ! subjecttable['AddContents', ! ["tr", ! [["td", "align" = "left"], ! [["inputtext", ! "name" = cat(nam,"Order"), ! "value" = sprintf("%A",subjectnumber), ! "size" = "3"]]], ! [["td","align" = "left"],nam], ! [["td","align" = "left"], ! page['ActionLink',"LoadSubjectOptions",[nam]]], ! [["td","align" = "left"], ! page['ActionLink',"AnalyzeSubject",[nam]]], ! [["td","align" = "left"], ! page['ActionLink',"ToggleSubject",[nam],__("Hide")]]]] ! od; ! ! if p["ShowHiddenSubjects"] = "true" then ! subjecttable['AddContents', ! ["tr",[["td", "colspan" = "8"],["hr"]]], ! ["tr",[["td", "colspan" = "8"], ! __("Hidden subjects")]]]; ! ! hiddensubjects := ! `OS/ListFiles`(cat(DefaultZone['RootDir'],"/subjects")); ! ! hiddensubjects := ! {op(hiddensubjects)} minus {op(DefaultZone['SubjectNames'])}; ! hiddensubjects := sort([op(hiddensubjects)]); ! for nam in hiddensubjects do subjecttable['AddContents', ["tr", ! [["td", "align" = "left"], " "], [["td","align" = "left"],nam], [["td","align" = "left"], ! page['ActionLink',"LoadSubjectOptions",[nam]]], ! [["td","align" = "left"]," "], [["td","align" = "left"], ! page['ActionLink',"ToggleSubject",[nam],__("Unhide")]]]] ! od; ! fi; page['Title'] := __("Zone:"); --- 317,415 ---- fi; ! ! visiblesubjects := DefaultZone['SubjectNames']; ! ! hiddensubjects := ! `OS/ListFiles`(cat(DefaultZone['RootDir'],"/subjects")); ! ! hiddensubjects := ! {op(hiddensubjects)} minus {op(visiblesubjects)}; ! ! hiddensubjects := sort([op(hiddensubjects)]); ! ! # if visiblesubjects = [] and ! # hiddensubjects = [] then ! # subjecttable := ! # __("There are no visible or hidden subjects for this zone."); ! # else ! subjecttable := ! `new/HTML/Tag`( ! ["table", "width" = "100%"], ! ["tr", [["th", "align" = "left", "width" = "10%"], ! __("Subject number")], [["th", "align" = "left", "width" = "50%"], ! __("Name")], [["th", "align" = "left", "width" = "10%"]," "], [["th", "align" = "left", "width" = "10%"]," "], [["th", "align" = "left", "width" = "10%"]," "], [["th", "align" = "left", "width" = "10%"]," "]], ! ["tr", [["td", "colspan" = "8"],["hr"]]]); ! if p["ShowHiddenSubjects"] = "true" then ! togglehidden := page['ActionLink',"HideHiddenSubjects"]; ! explainhidden := ""; ! subjecttable['AddContents', ! ["tr",[["td", "colspan" = "8"], ! __("Visible subjects")]]]; ! else ! togglehidden := page['ActionLink',"ShowHiddenSubjects"]; ! explainhidden := ! sprintf(__("#Explain hidden subjects (%s)"), ! page['ActionLink',"ShowHiddenSubjects"]); ! fi; ! if visiblesubjects = [] then subjecttable['AddContents', ["tr", ! [["td", "align" = "center","colspan" = "8"], ! __("There are no visible subjects for this zone.")]]]; ! else ! subjectnumber := 0; ! for nam in DefaultZone['SubjectNames'] do ! subjectnumber := subjectnumber + 1; ! subjecttable['AddContents', ! ["tr", ! [["td", "align" = "left"], ! [["inputtext", ! "name" = cat(nam,"Order"), ! "value" = sprintf("%A",subjectnumber), ! "size" = "3"]]], [["td","align" = "left"],nam], [["td","align" = "left"], ! page['ActionLink',"LoadSubjectOptions",[nam]]], [["td","align" = "left"], ! page['ActionLink',"AnalyzeSubject",[nam]]], ! [["td","align" = "left"], ! page['ActionLink',"ToggleSubject",[nam],__("Hide")]]]] ! od; ! fi; ! ! if p["ShowHiddenSubjects"] = "true" then ! if hiddensubjects = [] then ! subjecttable['AddContents', ! ["tr", ! [["td", "align" = "center","colspan" = "8"], ! __("There are no hidden subjects for this zone.")]]]; ! else ! subjecttable['AddContents', ! ["tr",[["td", "colspan" = "8"],["hr"]]], ! ["tr",[["td", "colspan" = "8"], ! __("Hidden subjects")]]]; ! ! for nam in hiddensubjects do ! subjecttable['AddContents', ! ["tr", ! [["td", "align" = "left"], " "], ! [["td","align" = "left"],nam], ! [["td","align" = "left"], ! page['ActionLink',"LoadSubjectOptions",[nam]]], ! [["td","align" = "left"]," "], ! [["td","align" = "left"], ! page['ActionLink',"ToggleSubject",[nam],__("Unhide")]]]] ! od; ! fi; ! fi; ! # fi; page['Title'] := __("Zone:"); *************** *** 452,460 **** page['FillTemplate', "togglehidden" = togglehidden, ! "subjecttable" = subjecttable['ToString'], ! "studenthead" = studenthead, ! "studentfoot" = studentfoot, ! "adminhead" = adminhead, ! "adminfoot" = adminfoot ]; end --- 430,435 ---- page['FillTemplate', "togglehidden" = togglehidden, ! "explainhidden" = explainhidden, ! "subjecttable" = subjecttable['ToString'] ]; end |
From: <gus...@us...> - 2003-08-25 22:00:38
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim/review In directory sc8-pr-cvs1:/tmp/cvs-serv12052/WEB-INF/maple/aim/review Modified Files: Quiz.mpl Added Files: Question.mpl Log Message: merged from develop_2_1 Index: Quiz.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/review/Quiz.mpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Quiz.mpl 5 May 2003 03:25:46 -0000 1.2 --- Quiz.mpl 25 Aug 2003 21:47:19 -0000 1.3 *************** *** 18,21 **** --- 18,22 ---- rqc0['StudentIsTeacher'] := true: rqc0['QuizReviewMode'] := true: + rqc0['QuestionReviewMode'] := false: rqc0['QuizTryMode'] := false: rqc0['QuestionTryMode'] := false: *************** *** 40,46 **** rqc0['ShowPrevious'] := true: rqc0['ShowFeedback'] := true: - rqc0['ShowFeedbackMC'] := true: rqc0['ShowMark'] := true: - rqc0['ShowMarkMC'] := true: rqc0['ShowRightAnswer'] := false: rqc0['ShowSolution'] := false: --- 41,45 ---- *************** *** 62,65 **** --- 61,65 ---- rqc1['StudentIsTeacher'] := true: rqc1['QuizReviewMode'] := true: + rqc1['QuestionReviewMode'] := true: rqc1['QuizTryMode'] := true: rqc1['QuestionTryMode'] := true: *************** *** 84,90 **** rqc1['ShowPrevious'] := true: rqc1['ShowFeedback'] := true: - rqc1['ShowFeedbackMC'] := true: rqc1['ShowMark'] := true: - rqc1['ShowMarkMC'] := true: rqc1['ShowRightAnswer'] := true: rqc1['ShowSolution'] := true: --- 84,88 ---- *************** *** 125,133 **** 'ExtraScript' = "f.ShowSolution.value = 'false';"]], ! ['Action',"TryQuestion", ! "Try a question", ! ['Command' = "try/Question", ! 'LinkText' = __("Try"), ! 'Arguments' = ["QuestionName","QuestionSeed","RawAnswer"]]], ['Action',"EditSource", --- 123,131 ---- 'ExtraScript' = "f.ShowSolution.value = 'false';"]], ! ['Action',"ReviewQuestion", ! "Review a question", ! ['Command' = "review/Question", ! 'LinkText' = __("Review"), ! 'Arguments' = ["QuestionLabel","AttemptNumber"]]], ['Action',"EditSource", *************** *** 205,209 **** local subject,register,quiz,id, student,studentname,emailstudent,adminstudent,togglesolution, ! seed,quizversion,quizinstance,history,questionhistory, question,label,rawtable,quizcontext; --- 203,207 ---- local subject,register,quiz,id, student,studentname,emailstudent,adminstudent,togglesolution, ! seed,quizversion,quizinstance,history,labeltable, question,label,rawtable,quizcontext; *************** *** 260,276 **** rawtable := table([]); ! questionhistory := eval(history['QuestionHistory']); for question in quizversion['Questions'] do label := question['Label']; rawtable[cat("RawAnswer",label)] := ! eval(questionhistory[label])['LastRawAnswer']; od; - quizinstance := - eval(quizversion['MakeInstance', - eval(rawtable), - eval(history), - true]); - if p["ShowSolution"] = "true" then quizcontext := `aim/review/Quiz/Context/Sol`; --- 258,268 ---- rawtable := table([]); ! labeltable := eval(history['LabelTable']); for question in quizversion['Questions'] do label := question['Label']; rawtable[cat("RawAnswer",label)] := ! eval(labeltable[label])['LastRawAnswer']; od; if p["ShowSolution"] = "true" then quizcontext := `aim/review/Quiz/Context/Sol`; *************** *** 280,283 **** --- 272,281 ---- togglesolution := page['ActionLink',"ShowSolution"]; fi; + + quizinstance := + eval(quizversion['MakeInstance', + eval(rawtable), + eval(history), + eval(quizcontext)]); quizinstance['SetBody',quizcontext]; |
From: <gus...@us...> - 2003-08-25 22:00:37
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim/try In directory sc8-pr-cvs1:/tmp/cvs-serv12052/WEB-INF/maple/aim/try Modified Files: Question.mpl Quiz.mpl Log Message: merged from develop_2_1 Index: Question.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/try/Question.mpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Question.mpl 5 May 2003 03:25:46 -0000 1.2 --- Question.mpl 25 Aug 2003 21:47:19 -0000 1.3 *************** *** 20,23 **** --- 20,24 ---- qdc['StudentIsTeacher'] := true: qdc['QuizReviewMode'] := false: + qdc['QuestionReviewMode'] := false: qdc['QuizTryMode'] := false: qdc['QuestionTryMode'] := true: *************** *** 42,48 **** qdc['ShowPrevious'] := true: qdc['ShowFeedback'] := true: - qdc['ShowFeedbackMC'] := true: qdc['ShowMark'] := true: - qdc['ShowMarkMC'] := true: qdc['ShowRightAnswer'] := true: qdc['ShowSolution'] := true: --- 43,47 ---- *************** *** 67,77 **** ['Parameter',"QuestionName" = 'required',""], ['Parameter',"SourceFile" = "",""], ['Parameter',"QuestionSeed"::integer = 0,""], ! ['Parameter',"RawAnswer" = ""], ! ! ['Parameter',"Action"::{"Mark","NewVersion"} = "Mark"], ################################################## --- 66,81 ---- ['Parameter',"QuestionName" = 'required',""], + ['Parameter',"QuestionLabel" = "",""], + ['Parameter',"SourceFile" = "",""], ['Parameter',"QuestionSeed"::integer = 0,""], ! ['Parameter', ! "Action"::{"Mark", ! "TryQuestion", ! "NewVersion", ! "TryRightAnswer"} = ! "TryRightAnswer"], ################################################## *************** *** 121,126 **** ["tr", [["td","width" = "16%"],`HTML/CloseButton`], ! [["td","width" = "16%"],[["a", "href" = "#bottom"],__("Bottom")], ! [["td","width" = "16%"],{"editsource"}]]]], [["hr", "noshade"]], __("Seed: "), --- 125,132 ---- ["tr", [["td","width" = "16%"],`HTML/CloseButton`], ! [["td","width" = "16%"],[["a", "href" = "#bottom"],__("Bottom")]], ! [["td","width" = "16%"],{"editsource"}], ! [["td","width" = "16%"],{["Mark"]}], ! [["td","width" = "16%"],{["NewVersion"]}]]], [["hr", "noshade"]], __("Seed: "), *************** *** 145,150 **** question,qname,title,shorttitle, dir,fullqfile,vrsion,instance,seed, ! show,rawans,editsource,err,fulldir,attempt, ! rightans,numrows,numcols,i,j,cell; global AimCache; --- 151,156 ---- question,qname,title,shorttitle, dir,fullqfile,vrsion,instance,seed, ! show,rawtable,rawans,editsource,err,fulldir, ! qlist,q,userightans; global AimCache; *************** *** 179,183 **** qname := p["QuestionName"]; - editsource := NULL; --- 185,188 ---- *************** *** 185,189 **** editsource := sprintf( ! "<input type=hidden name=\"SourceFile\" value=%a>\n%s\n", p["SourceFile"], page['ActionLink',"EditSource"]); --- 190,194 ---- editsource := sprintf( ! "<input type=hidden name='SourceFile' value='%s'/>\n%s\n", p["SourceFile"], page['ActionLink',"EditSource"]); *************** *** 200,206 **** "<font color='red'>", sprintf(__("Cannot load question file: %s"),fullqfile), ! "</font>\n<br>\n", `HTML/Escape`(err), ! "<br>\n", page['ActionLink',"Mark",[],__("Retry")]); page['FillTemplate',"editsource" = editsource,"show" = err]; --- 205,211 ---- "<font color='red'>", sprintf(__("Cannot load question file: %s"),fullqfile), ! "</font>\n<br/>\n", `HTML/Escape`(err), ! "<br/>\n", page['ActionLink',"Mark",[],__("Retry")]); page['FillTemplate',"editsource" = editsource,"show" = err]; *************** *** 213,221 **** "<font color='red'>", __("Malformed question"), ! "</font><br>\n", page['ActionLink',"Mark",[],__("Retry")], ! "\n<br><pre>\n", `HTML/Escape`(sprintf("%a",eval(question))), ! "\n</pre><br>\n"); page['FillTemplate',"editsource" = editsource,"show" = err]; RETURN(); --- 218,226 ---- "<font color='red'>", __("Malformed question"), ! "</font><br/>\n", page['ActionLink',"Mark",[],__("Retry")], ! "\n<br/><pre>\n", `HTML/Escape`(sprintf("%a",eval(question))), ! "\n</pre><br/>\n"); page['FillTemplate',"editsource" = editsource,"show" = err]; RETURN(); *************** *** 231,235 **** editsource := sprintf( ! "<input type=hidden name=\"SourceFile\" value=%a>\n%s\n", p["SourceFile"], page['ActionLink',"EditSource"]); --- 236,240 ---- editsource := sprintf( ! "<input type=hidden name='SourceFile' value='%s'>\n%s\n", p["SourceFile"], page['ActionLink',"EditSource"]); *************** *** 248,260 **** "<font color='red'>", __("Error in MakeVersion:"), ! "</font><br>\n", `HTML/Escape`(err), ! "<br>\n", page['ActionLink',"Mark",[],__("Retry")], ! "<br>\n", __("Question:"), ! "<br>\n<pre>\n", `HTML/Escape`(`Class/ToString`(question,20,80))), ! "</pre><br>\n"; page['FillTemplate',"editsource" = editsource,"show" = err]; RETURN(); --- 253,265 ---- "<font color='red'>", __("Error in MakeVersion:"), ! "</font><br/>\n", `HTML/Escape`(err), ! "<br/>\n", page['ActionLink',"Mark",[],__("Retry")], ! "<br/>\n", __("Question:"), ! "<br/>\n<pre>\n", `HTML/Escape`(`Class/ToString`(question,20,80))), ! "</pre><br/>\n"; page['FillTemplate',"editsource" = editsource,"show" = err]; RETURN(); *************** *** 266,274 **** "<font color='red'>", __("Malformed question version:"), ! "</font><br>\n", page['ActionLink',"Mark",[],__("Retry")], ! "\n<br><pre>\n", `HTML/Escape`(sprintf("%a",eval(question))), ! "\n</pre><br>\n"); page['FillTemplate',"editsource" = editsource,"show" = err]; RETURN(); --- 271,279 ---- "<font color='red'>", __("Malformed question version:"), ! "</font><br/>\n", page['ActionLink',"Mark",[],__("Retry")], ! "\n<br/><pre>\n", `HTML/Escape`(sprintf("%a",eval(question))), ! "\n</pre><br/>\n"); page['FillTemplate',"editsource" = editsource,"show" = err]; RETURN(); *************** *** 279,318 **** "<font color='red'>", __("Question Initialization Failed:"), ! "</font><br>\n", vrsion['Preamble'], ! "\n<br><pre>\n"); page['FillTemplate',"editsource" = editsource,"show" = err,"title" = qname]; RETURN(); ! else ! ! rawans := p["RawAnswer"]; ! if p["Action"] = "NewVersion" or rawans = "" then ! if type(question,`aim/TextQuestion`) then ! rawans := `aim/EntryHint`(vrsion['RightAnswer']); ! elif type(question,`aim/MatrixQuestion`) then ! rawans := ""; ! rightans := vrsion['RightAnswer']; ! numrows := vrsion['NumRows']; ! numcols := vrsion['NumCols']; ! ! for i to numrows do ! for j to numcols do ! cell := traperror(`aim/EntryHint`(rightans[i,j])); ! if cell = lasterror then cell := ""; fi; ! rawans := rawans,cell; ! if j < numcols then rawans := rawans,"|"; fi; ! od; ! if i < numrows then rawans := rawans,"\n"; fi; ! od; ! rawans := cat(rawans); ! elif type(question,`aim/MCQuestion`) then ! rawans := vrsion['RightLabel']; ! elif type(question,`aim/MRQuestion`) then ! rawans := sprintf("%a",vrsion['RightLabels']); ! else ! rawans := ""; ! fi; ! fi; # if `Util/RemoveWhiteSpace`(vrsion['Note']) <> "" then --- 284,294 ---- "<font color='red'>", __("Question Initialization Failed:"), ! "</font><br/>\n", vrsion['Preamble'], ! "\n<br/><pre>\n"); page['FillTemplate',"editsource" = editsource,"show" = err,"title" = qname]; RETURN(); ! else # question version constructed, seems OK # if `Util/RemoveWhiteSpace`(vrsion['Note']) <> "" then *************** *** 320,324 **** # cat( # vrsion['Postamble'], ! # "<br><b>",__("Question note:"),"</b> ",`HTML/Escape`(vrsion['Note'])); # fi; --- 296,300 ---- # cat( # vrsion['Postamble'], ! # "<br/><b>",__("Question note:"),"</b> ",`HTML/Escape`(vrsion['Note'])); # fi; *************** *** 326,335 **** cat( vrsion['Postamble'], ! "<br>\n", page['ActionLink',"Mark"]," ", page['ActionLink',"NewVersion"], ! "\n<br><hr>\n"); ! instance := traperror(eval(vrsion['MakeInstance',rawans])); if instance = lasterror then --- 302,341 ---- cat( vrsion['Postamble'], ! "<br/>\n", page['ActionLink',"Mark"]," ", page['ActionLink',"NewVersion"], ! "\n<br/><hr/>\n"); ! if p["QuestionLabel"] = "" then ! rawtable := eval(p); ! else ! rawtable := table([]); ! if type([vrsion],[`aim/MultiQuestion/Version`]) then ! for q in vrsion['SubQuestions'] do ! rawans := ! p[cat("RawAnswer",p["QuestionLabel"],q['Label'])]; ! if not(type([rawans],[string])) then ! rawans := ""; ! fi; ! rawtable[cat("RawAnswer",q['Label'])] := rawans; ! od; ! else ! rawans := ! p[cat("RawAnswer",p["QuestionLabel"])]; ! if not(type([rawans],[string])) then ! rawans := ""; ! fi; ! rawtable["RawAnswer"] := rawans; ! fi; ! fi; ! ! userightans := ! evalb((p["Action"] = "NewVersion") or ! (p["Action"] = "TryRightAnswer")); ! ! instance := ! traperror(eval( ! `aim/Question/MakeInstance/Recursive`( ! vrsion,rawtable,table([]),`try/Question/Context`,userightans))); if instance = lasterror then *************** *** 339,349 **** "<font color='red'>", __("Error in MakeInstance:"), ! "</font><br>\n", `HTML/Escape`(err), ! "<br>\n", page['ActionLink',"Mark",[],__("Retry")], ! "<br>\n", __("Question version:"), ! "<br>\n<pre>\n", `HTML/Escape`(`Class/ToString`(vrsion,20,80))), "\n</pre>\n"; --- 345,355 ---- "<font color='red'>", __("Error in MakeInstance:"), ! "</font><br/>\n", `HTML/Escape`(err), ! "<br/>\n", page['ActionLink',"Mark",[],__("Retry")], ! "<br/>\n", __("Question version:"), ! "<br/>\n<pre>\n", `HTML/Escape`(`Class/ToString`(vrsion,20,80))), "\n</pre>\n"; *************** *** 357,365 **** "<font color='red'>", __("Malformed question instance:"), ! "</font><br>\n", page['ActionLink',"Mark",[],__("Retry")], ! "\n<br><pre>\n", `HTML/Escape`(sprintf("%a",eval(instance))), ! "\n</pre><br>\n"); page['FillTemplate',"editsource" = editsource,"show" = err]; RETURN(); --- 363,371 ---- "<font color='red'>", __("Malformed question instance:"), ! "</font><br/>\n", page['ActionLink',"Mark",[],__("Retry")], ! "\n<br/><pre>\n", `HTML/Escape`(sprintf("%a",eval(instance))), ! "\n</pre><br/>\n"); page['FillTemplate',"editsource" = editsource,"show" = err]; RETURN(); *************** *** 367,372 **** else - attempt := eval(instance['Attempt']); - show := instance['Show',`try/Question/Context`]; --- 373,376 ---- *************** *** 377,383 **** "<font color='red'>", __("Error in Show: result was not a string."), ! "</font><br>\n", page['ActionLink',"Mark",[],__("Retry")], ! "<br><pre>\n", `HTML/Escape`(sprintf("%a",eval(show))), "\n</pre>\n"); --- 381,387 ---- "<font color='red'>", __("Error in Show: result was not a string."), ! "</font><br/>\n", page['ActionLink',"Mark",[],__("Retry")], ! "<br/><pre>\n", `HTML/Escape`(sprintf("%a",eval(show))), "\n</pre>\n"); *************** *** 388,394 **** fi; # ENDS: if instance = lasterror then ... - page['HiddenParameters'] := - page['HiddenParameters'] minus {"RawAnswer"}; - title := "<center><h1>",__("AIM question trial"),"</h1></center>\n", --- 392,395 ---- *************** *** 426,430 **** title, "<tr><td>",__("Description:"),"</td>\n", ! "<td>",`LaTeX/Wrap`(question['Description']),"</td></tr>\n"; fi; title := title,"</table>\n"; --- 427,431 ---- title, "<tr><td>",__("Description:"),"</td>\n", ! "<td>",`aim/LaTeX/Wrap`(question['Description']),"</td></tr>\n"; fi; title := title,"</table>\n"; *************** *** 433,436 **** --- 434,439 ---- shorttitle := cat(shorttitle); page['Title'] := shorttitle; + + p["QuestionLabel"] := ""; page['FillTemplate', Index: Quiz.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/try/Quiz.mpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Quiz.mpl 5 May 2003 03:25:46 -0000 1.2 --- Quiz.mpl 25 Aug 2003 21:47:19 -0000 1.3 *************** *** 20,23 **** --- 20,24 ---- qdc['StudentIsTeacher'] := true: qdc['QuizReviewMode'] := false: + qdc['QuestionReviewMode'] := false: qdc['QuizTryMode'] := true: qdc['QuestionTryMode'] := false: *************** *** 75,78 **** --- 76,83 ---- } + function Validate() { + Mark(); + } + ", `aim/MRQuestion/Script`, *************** *** 115,119 **** "Try an individual question.", ['Command' = "try/Question", ! 'Arguments' = ["QuestionName","QuestionSeed","RawAnswer"], 'LinkText' = __("Try question")]], --- 120,124 ---- "Try an individual question.", ['Command' = "try/Question", ! 'Arguments' = ["QuestionName","QuestionSeed","QuestionLabel"], 'LinkText' = __("Try question")]], *************** *** 177,181 **** proc(page::`aim/admin/Page`,p::table) ! local subject,quizname,quiz,quizversion,quizinstance, seed,keys,question,label,cgilabel,questiontable, rawans,rightans,numrows,numcols,i,j,cell; --- 182,186 ---- proc(page::`aim/admin/Page`,p::table) ! local subject,quizname,quiz,quizversion,quizinstance,quizhistory, seed,keys,question,label,cgilabel,questiontable, rawans,rightans,numrows,numcols,i,j,cell; *************** *** 236,240 **** od; ! quizinstance := eval(quizversion['MakeInstance',p]); quizinstance['SetBody',`try/Quiz/Context`]; --- 241,248 ---- od; ! quizhistory := `new/aim/Quiz/History`(quizversion); ! ! quizinstance := ! eval(quizversion['MakeInstance',p,quizhistory,`try/Quiz/Context`]); quizinstance['SetBody',`try/Quiz/Context`]; *************** *** 244,248 **** `new/HTML/Tag`(["table", "width" = "100%"]); ! for question in quizversion['Questions'] do label := question['Label']; questiontable['AddContents', --- 252,256 ---- `new/HTML/Tag`(["table", "width" = "100%"]); ! for question in quizversion['TopQuestions'] do label := question['Label']; questiontable['AddContents', |
From: <gus...@us...> - 2003-08-25 22:00:36
|
Update of /cvsroot/aimmath/AIM In directory sc8-pr-cvs1:/tmp/cvs-serv12052 Modified Files: help.html Log Message: merged from develop_2_1 Index: help.html =================================================================== RCS file: /cvsroot/aimmath/AIM/help.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** help.html 20 Apr 2003 23:14:27 -0000 1.1.1.1 --- help.html 25 Aug 2003 21:47:20 -0000 1.2 *************** *** 1,5 **** <HTML> <HEAD> ! <TITLE>AIM help</TITLE> </HEAD> <BODY BGCOLOR=WHITE> --- 1,6 ---- <HTML> + <!-- @(#)$Id$ --> <HEAD> ! <TITLE>AiM help</TITLE> </HEAD> <BODY BGCOLOR=WHITE> *************** *** 7,11 **** <TR> <TD ALIGN=LEFT> ! <H1>Help with the Alice system</H1> </TD> <TD ALIGN=RIGHT> --- 8,12 ---- <TR> <TD ALIGN=LEFT> ! <H1>Help with the AiM system</H1> </TD> <TD ALIGN=RIGHT> *************** *** 18,22 **** <LI><A HREF="#practice">Practice mode</A></LI> <LI><A HREF="#assessment">Assessment mode</A></LI> ! <LI><A HREF="#output">Understanding Alice's output</A></LI> <LI><A HREF="#entry">How do I enter my answers?</A></LI> <LI><A HREF="#types">Types</A></LI> --- 19,23 ---- <LI><A HREF="#practice">Practice mode</A></LI> <LI><A HREF="#assessment">Assessment mode</A></LI> ! <LI><A HREF="#output">Understanding AiM's output</A></LI> <LI><A HREF="#entry">How do I enter my answers?</A></LI> <LI><A HREF="#types">Types</A></LI> *************** *** 27,44 **** <A NAME="overview"><H2>Overview</H2></A> ! <B>Alice</B> is a computer system that assists in the teaching of some parts of University mathematics. Your comments and suggestions ! will be very welcome; you can send them by email to <A ! HREF="MAILTO:N.P...@sh...">Neil Strickland</A>. ! <BR><BR> The basic idea is that you follow the obvious links from the ! <A HREF="index.html">Alice login page</A>, and ! then Alice will present you with a list of questions. There is detailed advice below on <A HREF="entry">how to enter your answers</A>. You can then click the <B>Mark</B> button at the bottom of the page to mark your work. The details of how this works ! depend on whether Alice is running in <A HREF="#practice">practice mode</A> or <A HREF="#assessment">assessment mode</A>. --- 28,44 ---- <A NAME="overview"><H2>Overview</H2></A> ! <B>AiM</B> is a computer system that assists in the teaching of some parts of University mathematics. Your comments and suggestions ! will be very welcome; you can post them on the forum <a href="http://maths-physics.org.uk/aiminfo/mod/forum/view.php?id=14">Using AiM</a>. ! <br/><br/> The basic idea is that you follow the obvious links from the ! <A HREF="index.html">AiM login page</A>, and ! then AiM will present you with a list of questions. There is detailed advice below on <A HREF="entry">how to enter your answers</A>. You can then click the <B>Mark</B> button at the bottom of the page to mark your work. The details of how this works ! depend on whether AiM is running in <A HREF="#practice">practice mode</A> or <A HREF="#assessment">assessment mode</A>. *************** *** 56,60 **** the page where you filled in your answers, correct any mistakes, and try again. Alternatively, you can go away and come back some other ! time; Alice will remember your previous answers, so you can correct any that were wrong, and leave the others as they are. The system will give you a numerical mark for your work which you may --- 56,60 ---- the page where you filled in your answers, correct any mistakes, and try again. Alternatively, you can go away and come back some other ! time; AiM will remember your previous answers, so you can correct any that were wrong, and leave the others as they are. The system will give you a numerical mark for your work which you may *************** *** 63,67 **** <A HREF="#assessment">assessment mode</A>. ! <BR><BR> If you want to see the solutions, you can click the <B>Solutions</B> --- 63,67 ---- <A HREF="#assessment">assessment mode</A>. ! <br/><br/> If you want to see the solutions, you can click the <B>Solutions</B> *************** *** 79,83 **** different students will get slightly different questions. ! <BR><BR> A test in assessment mode will usually have a "Due date" --- 79,83 ---- different students will get slightly different questions. ! <br/><br/> A test in assessment mode will usually have a "Due date" *************** *** 91,100 **** system has misunderstood what you meant then you can fix the problem before proceeding. When you are satisfied with your answers, you ! can click the <B>Mark</B> button. Alice will tell you whether your answers are right or wrong (except for multiple choice questions) and may give some feedback about any answers that are wrong, but it will not tell you the right answers. ! <BR><BR> Usually, <B>no credit will be given for partially correct --- 91,100 ---- system has misunderstood what you meant then you can fix the problem before proceeding. When you are satisfied with your answers, you ! can click the <B>Mark</B> button. AiM will tell you whether your answers are right or wrong (except for multiple choice questions) and may give some feedback about any answers that are wrong, but it will not tell you the right answers. ! <br/><br/> Usually, <B>no credit will be given for partially correct *************** *** 109,113 **** a syntax error rather than a mathematical error. ! <br><br> Thus, it would make sense to: <ul> --- 109,113 ---- a syntax error rather than a mathematical error. ! <br/><br/> Thus, it would make sense to: <ul> *************** *** 124,135 **** </li> </ul> ! <BR><BR> ! If you access the test after the due date, then Alice will tell you your marks and give the solutions to the questions. ! <A NAME="output"><H2>Understanding Alice's output</H2></A> ! Alice generally displays mathematics in a good approximation to traditional notation. (Formulas are translated into HTML, so they can be displayed in most browsers without any kind of plugin. This --- 124,135 ---- </li> </ul> ! <br/><br/> ! If you access the test after the due date, then AiM will tell you your marks and give the solutions to the questions. ! <A NAME="output"><H2>Understanding AiM's output</H2></A> ! AiM generally displays mathematics in a good approximation to traditional notation. (Formulas are translated into HTML, so they can be displayed in most browsers without any kind of plugin. This *************** *** 141,145 **** Macintosh, or using Netscape under Unix or Linux. ! <br><br> You may find that subscripts and superscripts are too small to read --- 141,145 ---- Macintosh, or using Netscape under Unix or Linux. ! <br/><br/> You may find that subscripts and superscripts are too small to read *************** *** 151,155 **** <b>Fonts</b>, then change the variable width font size. ! <br><br> Apart from these font issues, there is one feature that may cause --- 151,155 ---- <b>Fonts</b>, then change the variable width font size. ! <br/><br/> Apart from these font issues, there is one feature that may cause *************** *** 160,164 **** </td><td nowrap align=center> 1<hr NOSHADE> ! 3<Br></td><td nowrap align=center> (x + y), </td></Table> </td></table></centEr> --- 160,164 ---- </td><td nowrap align=center> 1<hr NOSHADE> ! 3<br/></td><td nowrap align=center> (x + y), </td></Table> </td></table></centEr> *************** *** 169,173 **** </td><td nowrap align=center> 1<hr NOSHADE> ! 2<Br></td><td nowrap align=center> <font face=symbol>Ö</font >3, </td></Table> --- 169,173 ---- </td><td nowrap align=center> 1<hr NOSHADE> ! 2<br/></td><td nowrap align=center> <font face=symbol>Ö</font >3, </td></Table> *************** *** 179,183 **** <font face=symbol>Ö</font >3<hr NOSHADE> ! 2<Br></td><td nowrap align=center> . </td></Table> </td></table></centEr> --- 179,183 ---- <font face=symbol>Ö</font >3<hr NOSHADE> ! 2<br/></td><td nowrap align=center> . </td></Table> </td></table></centEr> *************** *** 192,208 **** taking the Applied Mathematics Core course AMA101 then you will learn to use Maple there. If you are not, the advice below should ! be sufficient. Alice tries quite hard to give helpful information about syntax errors. You can also learn about the right syntax by doing tests in <a href="#practice">practice mode</a> and asking for the solutions; as well as displaying the right answers in ordinary ! mathematical notation, Alice will tell you how they could be ! entered. (However, there are often several possible ways, and Alice will not always suggest the easiest one.) ! <BR><BR> When you have entered your answer, you can always click on the <B>Validate</B> button at the bottom of the page to see how Maple will interpret it. If there are any syntax errors or Maple has misunderstood what you meant then you can fix the problem before ! asking Alice to mark your work. <UL> --- 192,208 ---- taking the Applied Mathematics Core course AMA101 then you will learn to use Maple there. If you are not, the advice below should ! be sufficient. AiM tries quite hard to give helpful information about syntax errors. You can also learn about the right syntax by doing tests in <a href="#practice">practice mode</a> and asking for the solutions; as well as displaying the right answers in ordinary ! mathematical notation, AiM will tell you how they could be ! entered. (However, there are often several possible ways, and AiM will not always suggest the easiest one.) ! <br/><br/> When you have entered your answer, you can always click on the <B>Validate</B> button at the bottom of the page to see how Maple will interpret it. If there are any syntax errors or Maple has misunderstood what you meant then you can fix the problem before ! asking AiM to mark your work. <UL> *************** *** 218,222 **** common source of syntax errors. Note that you do <B>not</B> need a semicolon at the end, unlike when you are using Maple directly. ! <BR><BR></LI> <LI> Use a caret (^) for raising something to a power: for example, <FONT COLOR=BLUE>x<SUP>2</SUP></FONT> should be entered as --- 218,222 ---- common source of syntax errors. Note that you do <B>not</B> need a semicolon at the end, unlike when you are using Maple directly. ! <br/><br/></LI> <LI> Use a caret (^) for raising something to a power: for example, <FONT COLOR=BLUE>x<SUP>2</SUP></FONT> should be entered as *************** *** 228,232 **** and <FONT COLOR=BLUE>x<SUP>1/3</SUP></FONT> as <TT><FONT COLOR=GREEN>x^(1/3)</FONT></TT>. ! <BR><BR></LI> <LI> More generally, when in doubt, use brackets. For example, <FONT COLOR=BLUE> --- 228,232 ---- and <FONT COLOR=BLUE>x<SUP>1/3</SUP></FONT> as <TT><FONT COLOR=GREEN>x^(1/3)</FONT></TT>. ! <br/><br/></LI> <LI> More generally, when in doubt, use brackets. For example, <FONT COLOR=BLUE> *************** *** 235,239 **** </td><td nowrap align=center> a + b<hr NOSHADE> ! c + d <Br></td><td nowrap align=center> </td></Table> </td></table></centEr> --- 235,239 ---- </td><td nowrap align=center> a + b<hr NOSHADE> ! c + d <br/></td><td nowrap align=center> </td></Table> </td></table></centEr> *************** *** 245,251 **** square or curly ones (like <TT><FONT COLOR=GREEN>[a+b]</FONT></TT> or <TT><FONT COLOR=GREEN>{a+b}</FONT></TT>). ! <BR> If you type ! <TT><FONT COLOR=GREEN>a+b/(c+d)</FONT></TT>, then Alice will think that you mean <FONT COLOR=BLUE> --- 245,251 ---- square or curly ones (like <TT><FONT COLOR=GREEN>[a+b]</FONT></TT> or <TT><FONT COLOR=GREEN>{a+b}</FONT></TT>). ! <br/> If you type ! <TT><FONT COLOR=GREEN>a+b/(c+d)</FONT></TT>, then AiM will think that you mean <FONT COLOR=BLUE> *************** *** 254,262 **** a +</td><td nowrap align=center> b<hr NOSHADE> ! c + d<Br></td><td nowrap align=center> </td></Table> </td></table></centEr> </FONT> ! If you type <TT><FONT COLOR=GREEN>(a+b)/c+d</FONT></TT>, then Alice will think that you mean <FONT COLOR=BLUE> --- 254,262 ---- a +</td><td nowrap align=center> b<hr NOSHADE> ! c + d<br/></td><td nowrap align=center> </td></Table> </td></table></centEr> </FONT> ! If you type <TT><FONT COLOR=GREEN>(a+b)/c+d</FONT></TT>, then AiM will think that you mean <FONT COLOR=BLUE> *************** *** 265,273 **** </td><td nowrap align=center> a + b<hr NOSHADE> ! c<Br></td><td nowrap align=center> + d </td></Table> </td></table></centEr> </FONT> ! If you type <TT><FONT COLOR=GREEN>a+b/c+d</FONT></TT>, then Alice will think that you mean <FONT COLOR=BLUE> --- 265,273 ---- </td><td nowrap align=center> a + b<hr NOSHADE> ! c<br/></td><td nowrap align=center> + d </td></Table> </td></table></centEr> </FONT> ! If you type <TT><FONT COLOR=GREEN>a+b/c+d</FONT></TT>, then AiM will think that you mean <FONT COLOR=BLUE> *************** *** 276,284 **** a +</td><td nowrap align=center> b<hr NOSHADE> ! c<Br></td><td nowrap align=center> + d </td></Table> </td></table></centEr> </FONT> ! <BR> Some other examples: <UL> --- 276,284 ---- a +</td><td nowrap align=center> b<hr NOSHADE> ! c<br/></td><td nowrap align=center> + d </td></Table> </td></table></centEr> </FONT> ! <br/> Some other examples: <UL> *************** *** 301,305 **** </LI> </UL> ! <BR><BR></LI> <LI>Maple is case-sensitive. Do not enter <TT><FONT COLOR=GREEN>X</FONT></TT> instead of --- 301,305 ---- </LI> </UL> ! <br/><br/></LI> <LI>Maple is case-sensitive. Do not enter <TT><FONT COLOR=GREEN>X</FONT></TT> instead of *************** *** 333,337 **** <TT><FONT COLOR=GREEN>exp(x)</FONT></TT> for <FONT COLOR=BLUE>e<SUP>x</SUP></FONT>. ! <BR><BR></LI> <LI> <FONT COLOR=BLUE>sin<SUP>2</SUP>x</FONT> should be entered as --- 333,337 ---- <TT><FONT COLOR=GREEN>exp(x)</FONT></TT> for <FONT COLOR=BLUE>e<SUP>x</SUP></FONT>. ! <br/><br/></LI> <LI> <FONT COLOR=BLUE>sin<SUP>2</SUP>x</FONT> should be entered as *************** *** 340,344 **** <FONT COLOR=BLUE>tan<SUP>2</SUP>(x)</FONT>, <FONT COLOR=BLUE>sinh<SUP>2</SUP>(x)</FONT> and so on. ! <BR><BR></LI> <LI> Recall that <FONT COLOR=BLUE>sin<SUP>-1</SUP>(x)</FONT> --- 340,344 ---- <FONT COLOR=BLUE>tan<SUP>2</SUP>(x)</FONT>, <FONT COLOR=BLUE>sinh<SUP>2</SUP>(x)</FONT> and so on. ! <br/><br/></LI> <LI> Recall that <FONT COLOR=BLUE>sin<SUP>-1</SUP>(x)</FONT> *************** *** 352,356 **** Similarly, <FONT COLOR=BLUE>tan<SUP>-1</SUP>(x)</FONT> should be entered as <TT><FONT COLOR=GREEN>arctan(x)</FONT></TT> and so on. ! <BR><BR></LI> <LI> Greek letters can be entered using their English names: for --- 352,356 ---- Similarly, <FONT COLOR=BLUE>tan<SUP>-1</SUP>(x)</FONT> should be entered as <TT><FONT COLOR=GREEN>arctan(x)</FONT></TT> and so on. ! <br/><br/></LI> <LI> Greek letters can be entered using their English names: for *************** *** 360,368 **** <FONT FACE=SYMBOL COLOR=BLUE>2p</FONT> as <TT><FONT COLOR=GREEN>2*pi</FONT></TT>. ! <BR><BR></LI> <LI> When you work directly with Maple, the vector <FONT COLOR=BLUE>(1,2,3)</FONT> must be entered as ! <TT><FONT COLOR=GREEN>vector([1,2,3])</FONT></TT>. Many AIM questions are set up so that you can just enter <tt><font color='green'>[1,2,3]</font></tt> instead. --- 360,368 ---- <FONT FACE=SYMBOL COLOR=BLUE>2p</FONT> as <TT><FONT COLOR=GREEN>2*pi</FONT></TT>. ! <br/><br/></LI> <LI> When you work directly with Maple, the vector <FONT COLOR=BLUE>(1,2,3)</FONT> must be entered as ! <TT><FONT COLOR=GREEN>vector([1,2,3])</FONT></TT>. Many AiM questions are set up so that you can just enter <tt><font color='green'>[1,2,3]</font></tt> instead. *************** *** 374,378 **** <Table align=left><tr><td nowrap align=center> </td><td align=left><font face=symbol> ! é<br>ê<br> ë </font></td><td align=center> --- 374,378 ---- <Table align=left><tr><td nowrap align=center> </td><td align=left><font face=symbol> ! é<br/>ê<br/> ë </font></td><td align=center> *************** *** 389,393 **** <table><TR><TD nowrap align="center" colspan=0>6</td></tabLe></TD></TR></TablE> </td><td nowrap></td><td align=left><font face=symbol> ! ù<br>ú<br> û </font></td><td align=center> --- 389,393 ---- <table><TR><TD nowrap align="center" colspan=0>6</td></tabLe></TD></TR></TablE> </td><td nowrap></td><td align=left><font face=symbol> ! ù<br/>ú<br/> û </font></td><td align=center> *************** *** 397,401 **** must be entered as <TT><FONT COLOR=GREEN>matrix([[1,2,3],[4,5,6]])</FONT></TT>. ! Many AIM questions are set up so that you can just enter <TT><FONT COLOR=GREEN>[[1,2,3],[4,5,6]]</FONT></TT> instead. Note that there are double square brackets at the beginning and --- 397,401 ---- must be entered as <TT><FONT COLOR=GREEN>matrix([[1,2,3],[4,5,6]])</FONT></TT>. ! Many AiM questions are set up so that you can just enter <TT><FONT COLOR=GREEN>[[1,2,3],[4,5,6]]</FONT></TT> instead. Note that there are double square brackets at the beginning and *************** *** 406,413 **** <A NAME="types"><H2>Types</H2></A> ! Sometimes, Alice will check the type of your answer (eg whether it is a constant, a function of x, a vector, a matrix ...) before working out whether it is correct. If your answer has the wrong ! type Alice will allow you to go back and change it without any penalty. Unfortunately, the warning messages for type errors are not as comprehensible as they might be. Here are some examples that --- 406,413 ---- <A NAME="types"><H2>Types</H2></A> ! Sometimes, AiM will check the type of your answer (eg whether it is a constant, a function of x, a vector, a matrix ...) before working out whether it is correct. If your answer has the wrong ! type AiM will allow you to go back and change it without any penalty. Unfortunately, the warning messages for type errors are not as comprehensible as they might be. Here are some examples that *************** *** 420,424 **** <Table align=left><tr><td nowrap align=center> </td><td align=left><font face=symbol> ! é<br>ê<br> ë </font></td><td align=center> --- 420,424 ---- <Table align=left><tr><td nowrap align=center> </td><td align=left><font face=symbol> ! é<br/>ê<br/> ë </font></td><td align=center> *************** *** 431,435 **** <table><TR><TD nowrap align="center" colspan=0>4</td></tabLe></TD></TR></TablE> </td><td nowrap></td><td align=left><font face=symbol> ! ù<br>ú<br> û </font></td><td align=center> --- 431,435 ---- <table><TR><TD nowrap align="center" colspan=0>4</td></tabLe></TD></TR></TablE> </td><td nowrap></td><td align=left><font face=symbol> ! ù<br/>ú<br/> û </font></td><td align=center> *************** *** 437,454 **** </td></table></centEr> but you enter the number 7 as your answer. You will get the ! following message: <BR> ! <font color=red><br> ! Your answer has the following error: <br> Wrong type. Your answer was ! <BR><BR> 7 ! <BR><BR> It should be of type ! <BR><BR> [[constant,constant],[constant,constant]] ! <BR><BR> but it is not. Try again. ! </font><BR> This of course means that your answer was supposed to be a 2x2 matrix with constant entries, but in fact it is just a single --- 437,454 ---- </td></table></centEr> but you enter the number 7 as your answer. You will get the ! following message: <br/> ! <font color=red><br/> ! Your answer has the following error: <br/> Wrong type. Your answer was ! <br/><br/> 7 ! <br/><br/> It should be of type ! <br/><br/> [[constant,constant],[constant,constant]] ! <br/><br/> but it is not. Try again. ! </font><br/> This of course means that your answer was supposed to be a 2x2 matrix with constant entries, but in fact it is just a single *************** *** 459,475 **** Suppose that the correct answer is x<SUP>2</SUP> + y<SUP>2</SUP>, but your answer is x<SUP>2</SUP> + y<SUP>2</SUP> + z<SUP>2</SUP>. ! You might get the following message:<BR> ! <font color=red><br> Your last answer was: ! <br><center> x<SUP>2</SUP> + y<SUP>2</SUP> + z<SUP>2</SUP>. ! </center><br> ! Wrong type.<br> Your answer should have type ! <BR> polynom(constant,[x,y]) ! <BR> but it does not. ! </font><BR><br> This means that your answer was supposed to be a polynomial function of x and y, but in fact it depends on z as well. For --- 459,475 ---- Suppose that the correct answer is x<SUP>2</SUP> + y<SUP>2</SUP>, but your answer is x<SUP>2</SUP> + y<SUP>2</SUP> + z<SUP>2</SUP>. ! You might get the following message:<br/> ! <font color=red><br/> Your last answer was: ! <br/><center> x<SUP>2</SUP> + y<SUP>2</SUP> + z<SUP>2</SUP>. ! </center><br/> ! Wrong type.<br/> Your answer should have type ! <br/> polynom(constant,[x,y]) ! <br/> but it does not. ! </font><br/><br/> This means that your answer was supposed to be a polynomial function of x and y, but in fact it depends on z as well. For *************** *** 482,499 **** Suppose that the correct answer is 2 sin(3 x) but your answer is just the number 5. ! You might get the following message:<BR> ! <font color=red><br> Your last answer was: ! <br><center> 5 ! </center><br> ! Wrong type.<br> Your answer should have type ! <BR> dependent(x) ! <BR> but it does not. </font> ! <br><br> This means that your answer was supposed to depend on x. </LI> --- 482,499 ---- Suppose that the correct answer is 2 sin(3 x) but your answer is just the number 5. ! You might get the following message:<br/> ! <font color=red><br/> Your last answer was: ! <br/><center> 5 ! </center><br/> ! Wrong type.<br/> Your answer should have type ! <br/> dependent(x) ! <br/> but it does not. </font> ! <br/><br/> This means that your answer was supposed to depend on x. </LI> *************** *** 502,515 **** <A NAME="forbid"><H2>Forbidden words</H2></A> ! Suppose that Alice asked you to calculate sin(<FONT FACE=SYMBOL>p</FONT>/4) (for which the answer is of course 2<SUP>-1/2</SUP>). One cunning plan that might occur to you would be to just enter <TT><FONT COLOR=GREEN>sin(pi/4)</FONT></TT> as your answer, leaving Maple to do all the real work. If this worked, it ! would remove the whole point, so Alice prevents it. For each question, there are certain "forbidden words" that you are not allowed to use as part of your answer; in the example above, the word "sin" would be forbidden. If you give an answer ! involving a forbidden word, Alice will tell you, and you will be able to go back and change it without any penalty. --- 502,515 ---- <A NAME="forbid"><H2>Forbidden words</H2></A> ! Suppose that AiM asked you to calculate sin(<FONT FACE=SYMBOL>p</FONT>/4) (for which the answer is of course 2<SUP>-1/2</SUP>). One cunning plan that might occur to you would be to just enter <TT><FONT COLOR=GREEN>sin(pi/4)</FONT></TT> as your answer, leaving Maple to do all the real work. If this worked, it ! would remove the whole point, so AiM prevents it. For each question, there are certain "forbidden words" that you are not allowed to use as part of your answer; in the example above, the word "sin" would be forbidden. If you give an answer ! involving a forbidden word, AiM will tell you, and you will be able to go back and change it without any penalty. *************** *** 520,522 **** not help you in the written exam, which carries much more weight. </BODY> ! </HTML> \ No newline at end of file --- 520,522 ---- not help you in the written exam, which carries much more weight. </BODY> ! </HTML> \ No newline at end of file |
From: <gus...@us...> - 2003-08-25 22:00:20
|
Update of /cvsroot/aimmath/AIM/WEB-INF/logs In directory sc8-pr-cvs1:/tmp/cvs-serv12052/WEB-INF/logs Added Files: README Log Message: merged from develop_2_1 |
Update of /cvsroot/aimmath/AIM/examples/Trig In directory sc8-pr-cvs1:/tmp/cvs-serv12052/examples/Trig Added Files: README advancedlevel.aim ordinarylevel.aim trig_eqn_cosnx-1.aim trig_eqn_cosxr.aim trig_eqn_dblang0.aim trig_eqn_dblang1.aim trig_eqn_dblang2.aim trig_eqn_dblang3.aim trig_eqn_quadtan.aim trig_eqn_rewsincos.aim trig_eqn_sina+b.aim trig_eqn_sina-b.aim trig_eqn_sinnx-r.aim trig_eqn_sinnxr.aim trig_eqn_sinsqxr.aim trig_eqn_sinxr.aim trig_eqn_tan2x.aim trig_eqn_tansqxn.aim Log Message: merged from develop_2_1 |
Update of /cvsroot/aimmath/AIM/WEB-INF/classes In directory sc8-pr-cvs1:/tmp/cvs-serv12052/WEB-INF/classes Modified Files: Alice.class AliceLog.class AliceLogEntry.class AliceRequest.class Maple.class Log Message: merged from develop_2_1 |
From: <gus...@us...> - 2003-08-25 22:00:05
|
Update of /cvsroot/aimmath/AIM/WEB-INF/java In directory sc8-pr-cvs1:/tmp/cvs-serv12052/WEB-INF/java Modified Files: Alice.java Maple.java Log Message: merged from develop_2_1 |
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1:/tmp/cvs-serv12052/WEB-INF/maple Modified Files: Aim.mpl AliceServer.mpl AutoConf.mpl Cache.mpl Class.mpl ConfigFields.mpl Console.mpl Date.mpl FullPackage.mpl HTML.mpl I18n.mpl ImageCache.mpl Local.mpl Make.mpl ManualConfig.dist OS.mpl OS0.mpl OS0_DOS.mpl OS0_Linux.mpl OS0_OSX.mpl Package.mpl PackageList ParsedText.mpl Pot.mpl Random.mpl SafeParse.mpl Servlet.mpl Site.mpl Util.mpl Util0.mpl fixintrep5.mpl fixintrep6.mpl Added Files: OS0Win.mpl OSWin.c OSWin.dll newDate.mpl Removed Files: LaTeX.mpl Log Message: merged from develop_2_1 --- LaTeX.mpl DELETED --- |