aimmath-commit Mailing List for AiM Assessment in Mathematics (Page 3)
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: Neil S. <nps...@us...> - 2004-10-14 11:09:20
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17595/WEB-INF/maple Added Files: Tag: aim-xml XML.mpl Log Message: General XML-handling facilities --- NEW FILE: XML.mpl --- # Copyright (C) 2004 Neil Strickland # Distributed without warranty under the GPL - see README for details read("Package.mpl"): Package("XML"," This package defines a number of convenient methods for working with XML. "): `Package/Dependencies` := []: ###################################################################### `Package/Assign`( `type/XML/Var`::type, "@type(x,`XML/Var`)@ is @true@ if @x@ is of the form `XML/Var`@(something)@ or `XML/ValueVar`@(something)@ or `XML/AttributeVar`@(something)@.", {specfunc(anything,`XML/Var`), specfunc(anything,`XML/ValueVar`), specfunc(anything,`XML/AttributeVar`)} ): `Package/Assign`( `type/XML/ValueVar`::type, "@type(x,`XML/ValueVar`)@ is @true@ if @x@ is of the form `XML/ValueVar`@(something)@.", {specfunc(anything,`XML/ValueVar`)} ): `Package/Assign`( `type/XML/AttributeVar`::type, "@type(x,`XML/AttributeVar`)@ is @true@ if @x@ is of the form `XML/AttributeVar`@(something)@.", {specfunc(anything,`XML/AttributeVar`)} ): `Package/Assign`( `type/XML/PackedTemplate`::type, "A packed template is a particular kind of XML element, namely a <seq> element whose contents are just strings or XML variables. Any template (ie any XML element, possibly with variable elements) can be converted to a packed template by converting the elements to strings as far as possible. ", proc(x::anything) RETURN(evalb( type(x,`XML/Element`) and x['Type'] = "seq" and type(x['Contents'],list({string,`XML/Var`})))); end ): ###################################################################### ###################################################################### `Package/Assign`(`XML/NamespaceTable`, "A table mapping three standard prefixes (the empty string, @xml@ and @xmlns@) to namespace URIs. ", table(["" = "", "xmlns" = "", "xml" = "http://www.w3.org/XML/1998/namespace"]) ): `Class/Declare`(`XML/Element`, "An object of type Element represents a XML element together with its attributes and contents. ", ['Constructor', "<p> If @head@ is a string, then it is used as the element type, and there are no attributes. </p><p> If @head@ is a list, then the first element is used as the element type, and the remaining elements are used as attribute equations. </p><p> Any arguments after the first are used as the contents of the element. <ul> <li> if an argument is a string or a element object, it is used directly</li> <li> if an argument is a list, then the constructor is applied recursively with the list entries as arguments </li> </ul> Additionally, if any attribute or content object is a set of the form @{x}@, it gets converted to @`XML/Var`(x)@. </p> ", proc(this,head::{string,list}) local msg,qn,i; this['Attributes'] := table([]); this['NamespaceTable'] := eval(`XML/NamespaceTable`); if nargs = 1 then return(); fi; if type(head,string) then qn := head; elif type(head,list) and nops(head) > 0 and type(head[1],string) then qn := head[1]; this['SetAttributes',op(head[2..-1])]; else msg := sprintf("Head should be a string or a list whose first element is a string: %A",head); ERROR(msg); fi; i := searchtext(":",qn); if i > 0 then this['Prefix'] := substring(qn,1..i-1); this['Name'] := substring(qn,i+1..-1); else this['Prefix'] := ""; this['Name'] := qn; fi; this['Contents'] := map(`XML/NewElementAux`,[args[3..-1]],this['NamespaceTable']); RETURN(); end ], ['Field','Type'::string, "The type of element. For example, for an image element, this would be the string "img". For a element like @<n:widget xmlns:n="http://www.gadgets.com/bits">@, this field just contains the string "widget". " ], ['Field','Prefix'::string, "For a element like @<xyz:widget xmlns:xyz="http://www.gadgets.com/bits">@, this field just contains the string "xyz". " ], ['Field','NamespaceTable'::table = eval(`XML/NamespaceTable`), "A table giving namespace URI's associated to various prefixes that may be used in this element, its descendants, and associated attributes. " ], ['Field','NamespaceTableInherited'::boolean=true, "For efficiency, the namespace table is often inherited from an ancestor element. In that case, this field should be set to @true@. This acts as a warning that we must copy the table before making changes to it. " ], ['Method','QName'::string, "", proc(this) local t,p; t := this['Type']; p := this['Prefix']; `if`(p="",t,cat(p,":",t)); end ], ['Method','GetURI'::string, "Fetch the URI associated to a specified prefix, returning @NULL@ if no URI is known. ", proc(this,prefix::string) local t; t := eval(this['NamespaceTable']); if assigned(t[prefix]) then return(t[prefix]); else return(NULL); fi; end ], ['Method','NamespaceURI'::string, "The URI describing the namespace for the name of this element", proc(this) local t,prefix; t := eval(this['NamespaceTable']); prefix := this['Prefix']; if assigned(t[prefix]) then return(t[prefix]); else return(NULL); fi; end ], ['Field','Attributes'::table, "The table of attributes of the element, indexed by pairs @(attribute prefix,attribute name)@. " ], ['Method','SetAttributes'::'void', "The arguments should be attribute equations; they are added to the attributes of the element. Qualified names can be given in the form @"foo:bar"@ or @["foo","bar"]@. Attributes that are namespace declarations will be added to the @NamespaceTable@ field in the obvious way. Attributes may also be given as expressions of the form <p> @_XML_Attribute(_XML_AttrName(...),_XML_AttrValue(...))@, </p> as generated by the @XMLTools@ module. ", proc(this) local x,qn,v,a,msg,i; a := eval(this['Attributes']); for x in args[2..-1] do if type(x,`MapleXML/Attribute`) then qn := [op([1,2],x),op([1,1],x)]; v := op([2,1],x); else if type(x,equation) then qn := lhs(x); v := rhs(x); else qn := x; v := "true"; fi; if type([qn],[string]) then i := searchtext(":",qn); if i > 0 then qn := [substring(qn,1..i-1),substring(qn,i+1..-1)]; else qn := ["",qn]; fi; fi; fi; if not(type([qn],[[string,string]])) then msg := sprintf( __("LHS of attribute equation is not a string or pair of strings: %a"), x); ERROR(msg); fi; if v = NULL then a[op(qn)] := NULL; next; fi; if nops([v]) > 1 then msg := sprintf(__("RHS of attribute equation is a sequence: %a"),x); ERROR(msg); fi; if type(v,set) and nops(v) = 1 then v := `XML/ValueVar`(op(v)); fi; if qn[1] = "xmlns" and type(v,string) then this['AddPrefix',qn[2],v]; fi; if type(v,{string,numeric,boolean,`XML/ValueVar`}) then a[op(qn)] := v; else msg := sprintf(__("Invalid attribute equation: %a"),x); ERROR(msg); fi; od; NULL; end ], ['Method','AddPrefix'::'void', "Adds a prefix and associated URI to the namespace table. If the namespace table was inherited from an ancestor, make a new copy before modifying it. ", proc(this,prefix::string,uri::string) local t; t := eval(this['NamespaceTable']); if this['NamespaceTableInherited'] then t := copy(t); this['NamespaceTable'] := eval(t); this['NamespaceTableInherited'] := false; fi; t[prefix] := uri; end ], ['Method','ClearAttributes'::'void', "Remove all attributes of the element. The namespace table is not changed, which could in principle lead to inconsistencies. ", proc(this) this['Attributes'] := table([]); NULL; end ], ['Field','Contents'::list, "The list of contents of the element. These may be strings, numbers, boolean values, elements, XML variables or packed menus. " ], ['Method','AddContents'::'void', "Apply the function #`XML/NewElementAux`# to each of the arguments, and append the results to the @Contents@ field", proc(this) local newcontents; newcontents := map(`XML/NewElementAux`,[args[2..-1]]); this['Contents'] := [op(this['Contents']), op(newcontents)]; NULL; end ], ['Method','ClearContents'::'void', "Remove all contents of this element.", proc(this) this['Contents'] := []; end ], ['Method','ContentTree'::anything, "The arguments should be a sequence of positive integers. For example, @element['ContentTree',6,2]@ is the second entry in the sixth entry of @element@.", proc(this) local i,j,k,t,c,msg; t := this; for k from 2 to nargs do i := args[k]; if not(type(k,posint)) then msg := __("Arguments to the ContentTree method must be positive integers"); ERROR(msg); fi; if not(type(t,`XML/Element`)) then msg := __("ContentTree index out of bounds"); ERROR(msg); fi; j := 0; c := t['Contents']; while ( j < nops(c) and i > 0 ) do j := j+1; if type(c[j],`XML/Element`) then i := i-1; fi; od; if (i = 0) then t := eval(c[j]); else msg := __("ContentTree index out of bounds"); ERROR(msg); fi; od; RETURN(eval(t)); end ], ['Method','ToSeq', "", proc(this) local elementtype,s,attribtable,namix,nam,val,contents,separator, allstrings,a,x,msg,prefix,qn; s := "<",this['QName']; attribtable := eval(this['Attributes']); for namix in indices(attribtable) do prefix := namix[1]; nam := namix[2]; qn := `if`(prefix="", nam, cat(prefix,":",nam)); val := attribtable[op(namix)]; # ignore attributes whose value is NULL if val = NULL then next; fi; if type(val,`XML/ValueVar`) then s := s,`XML/AttributeVar`(nam,op(val)); elif val <> NULL then s := s," ",qn,"=",`XML/ValueEscape`(val); fi; od; if this['Contents'] = [] then s := s,"/>"; return(`XML/Condense`(s)); fi; s := s,">"; contents := NULL; for x in this['Contents'] do if type(x,`XML/Element`) then contents := contents,x['ToSeq']; elif type(x,`XML/Var`) then contents := contents,x; elif type(x,{string,numeric,boolean}) then contents := contents,sprintf("%A",x); else msg := sprintf(__("Invalid contents in XML element: %a"),x); ERROR(msg); fi; od; s := s,contents,"</",this['QName'],">"; RETURN(`XML/Condense`(s)); end ], ['Method','Variables'::set(`XML/Var`), "Return the list of all XML variables that appear in this element.", proc(this) local v; v := {this['ToSeq']}; v := select(type,v,`XML/Var`); RETURN(v); end ], ['Method','ToPack'::`XML/Element`, "Return the result of converting this element to a packed template.", proc(this) local s,t; s := this['ToSeq']; t := `new/XML/Element`("seq"); t['Contents'] := [s]; RETURN(eval(t)); end ], ['Method','IsPacked'::boolean, "Return @true@ if this element is a packed template.", proc(this) evalb( this['Type'] = "seq" and type(this['Contents'], list({string,numeric,boolean,`XML/Var`}))); end ], ['Method','IsFilled'::boolean, "Return @true@ if this is a <seq> element whose contents are all strings, numbers or boolean values. ", proc(this) evalb( this['Type'] = "seq" and type(this['Contents'], list({string,numeric,boolean}))); end ], ['Method','ToString'::`XML/String`, "Return a string of XML representing this element.", proc(this) `XML/ToString`(this['ToSeq']); end ], ['Method','Print'::'void', "Print a string of XML representing this element.", proc(this) `XML/Print`(this); end ] ): ### Auxiliary function used in the constructor `Package/Assign`( `XML/NewElementAux`, "An auxiliary function used by the constructor #`new/XML/Element`#", proc(x,p_::table) local msg,p; if nargs > 1 then p := eval(p_); else p := NULL; fi; if type([x],{[string],[numeric],[boolean]}) then RETURN(x); elif type([x],[specfunc(string,_XML_Text)]) then RETURN(op(1,x)); elif type([x],[specfunc(string,_XML_Entity)]) then RETURN(cat("&",op(1,x),";")); elif type([x],[`XML/Element`]) then if x['Type'] = "seq" then RETURN(op(x['Contents'])); else RETURN(eval(x)); fi; elif type([x],[set]) and nops(x) = 1 then RETURN(`XML/Var`(op(x))); elif type([x],[list]) then RETURN(`new/XML/Element`(op(x))); elif type([x],[`MapleXML/Element`]) then RETURN(`XML/Objectify`(x,p)); else msg := sprintf("Invalid argument in XML/NewElementAux: %a",[x]); ERROR(msg); fi; end ): ###################################################################### `Package/Assign`( `XML/Condense`::exprseq(string), "Join together any consecutive sequences of strings in the arguments, and return the resulting sequence. For example, <pre> @`XML/Condense`(\"abc\",\"def\",3,\"x\",\"y\",\"z\") = \"abc\",3,\"xyz\" @ </pre> ", proc() local a,b,x,y; a := NULL; b := NULL; for x in args do if type(x,{boolean,numeric}) then y := sprintf("%A",x); else y := x; fi; if type(y,string) then b := b,y; else if b <> NULL then a := a,cat("",b); fi; b := NULL; a := a,y; fi; od; if b <> NULL then a := a,cat("",b); fi; RETURN(a); end ): ###################################################################### `Package/Assign`( `XML/ElementOpenStart`::string, "An auxiliary function for converting elements to strings. Special behaviour for a few elements is stored in the remember table for this function.", proc(elementtype::string) cat("<",elementtype); end ): `Package/Assign`( `XML/ElementOpenEnd`::string, "An auxiliary function for converting elements to strings. Special behaviour for a few elements is stored in the remember table for this function.", proc(elementtype::string) cat(">"); end ): `Package/Assign`( `XML/ElementClose`::string, "An auxiliary function for converting elements to strings. Special behaviour for a few elements is stored in the remember table for this function.", proc(elementtype::string) cat("</",elementtype,">"); end ): # Adjust whitespace `XML/ElementOpenEnd`("br") := " />\n": `XML/ElementOpenEnd`("hr") := " />\n": `XML/ElementOpenEnd`("p") := ">\n": `XML/ElementClose`("p") := "\n</p>\n": `XML/ElementOpenEnd`("div") := ">\n": `XML/ElementClose`("div") := "\n</div>\n": `XML/ElementOpenStart`("seq") := "": `XML/ElementOpenEnd`("seq") := "": `XML/ElementClose`("seq") := "": ###################################################################### `Package/Assign`( `XML/ToString`, "Convert all arguments to strings, concatenate, and return the result. The arguments can be XML elements or primitive object (strings, numbers or boolean values). XML variables are also converted to strings, but this is primarily intended for developing and debugging templates. ", proc() local s,x; s := ""; for x in args do if type(x,string) then s := s,x; elif type(x,{numeric,boolean}) then s := s,sprintf("%A",x); elif type(x,`XML/Element`) then s := s,`XML/ToString`(x['ToSeq']); elif type(x,`XML/ValueVar`) then s := s,sprintf("%a",{op(x)}); elif type(x,`XML/AttributeVar`) then s := s,sprintf(" %a={%a}",op(1,x),op(2,x)); elif type(x,`XML/Var`) then s := s, "<font color='green'>", `XML/Escape/String`(sprintf("%A",{x})), "</font>"; else s := s, "<font color='aqua'>", `XML/Escape/String`(sprintf("%A",x)), "</font>"; fi; od; RETURN(cat(s)); end ): ###################################################################### `Package/Assign`( `XML/ToPack`::`XML/PackedTemplate`, "Convert the arguments to a packed template. The arguments can be XML elements or variables, or <select> elements with indeterminate initial selection, or primitive types (strings, numbers or boolean values). ", proc() local pack,x,t; pack := ""; for x in args do if type(x,{numeric,boolean}) then pack := pack,sprintf("%A",x); elif type(x,`XML/Element`) then pack := pack,op(x['ToPack']['Contents']); else pack := pack,x; fi; od; pack := `XML/Condense`(pack); t := `new/XML/Element`("seq"); t['Contents'] := [pack]; RETURN(eval(t)); end ): ###################################################################### `Package/Assign`( `XML/Print`::'void', "Convert @x@ to a string using #`XML/ToString`# and print it.", proc(x) printf("%s\n\n",`XML/ToString`(x)); NULL; end ): ###################################################################### `Package/Assign`( `XML/Subs`, "The last argument @x@ is expected to be a packed template with some variable elements. The other arguments are equations like @n = v@. The return value is a copy of @x@ with all occurences of @`XML/Var`(n)@ replaced by @v@, and similarly for @`XML/ValueVar`@ and @`XML/AttributeVar`@ ", proc() local eqs,a,b,c,x,y,z,t,msg; if nargs = 0 then RETURN(NULL); fi; x := args[nargs]; if not(type(x,`XML/PackedTemplate`)) then msg := __("Last argument is not a packed template."); ERROR(msg); fi; eqs := NULL; t := table([args[1..-2]]); y := map(`XML/SubsAux`,x['Contents'],t); y := [`XML/Condense`(op(y))]; z := `new/XML/Element`("seq"); z['Contents'] := y; RETURN(eval(z)); end ): `Package/Assign`( `XML/SubsAux`, "An auxiliary function used by #`XML/Subs`#", proc(u,v::table) local a; if type(u,`XML/Var`) and assigned(v[op(u)]) then v[op(u)]; elif type(u,`XML/AttributeVar`) and assigned(v[op(2,u)]) then a := v[op(2,u)]; if a = NULL then NULL; elif type([a],[{string,numeric}]) then cat(" ",op(1,u),"=",`XML/ValueEscape`(a)); else u; fi; else u; fi; end ): ###################################################################### `Package/Assign`( `XML/Escape/String`::`XML/String`, "Return a copy of @s@ with all less-than signs, greater-than signs, ampersands and quotation marks replaced by the corresponding XML character entities (&lt;, &gt;, &amp; and &quot;). The result is suitable for use as XML text. ", proc(s::string) local b; b := convert(s,bytes); b := subs( 38 = (38, 97, 109, 112, 59), # & 60 = (38, 108, 116, 59), # < 62 = (38, 103, 116, 59), # > 34 = (38, 113, 117, 111, 116, 59), # " b); convert(b,bytes); end ): `Package/Assign`( `XML/Escape`::`XML/String`, "This is the same as #`XML/Escape/String`# except that it also accepts a variable number of arguments, converts non-strings to strings, and concatenates the results. ", proc() local x,html; html := ""; for x in args do if type(x,string) then html := html,x; else html := html,sprintf("%A",x); fi; od; RETURN(`XML/Escape/String`(cat(html))); end ): `Package/Assign`( `XML/ValueEscape/String`::`XML/String`, "Return a copy of @s@ with ampersands and quotation marks replaced by the corresponding XML character entities (&amp; and &quot;), wrapped in quotation marks. The result is suitable for use as an XML attribute value. ", proc(s::string) local b; b := convert(s,bytes); b := subs( 38 = (38, 97, 109, 112, 59), # & 60 = (38, 108, 116, 59), # < 62 = (38, 103, 116, 59), # > 34 = (38, 113, 117, 111, 116, 59), # " b); convert([34,op(b),34],bytes); end ): `Package/Assign`( `XML/ValueEscape`::`XML/String`, "This is the same as #`XML/ValueEscape/String`# except that it also converts non-strings to strings. ", proc(x) local s,b; if nargs = 0 then RETURN(NULL); fi; if type(x,{numeric,boolean}) then RETURN(sprintf("\"%A\"",x)); fi; if type(x,string) then s := x; else # This should not happen in a working application. The # specified behaviour is designed for debugging only. s := sprintf("%A",x); fi; RETURN(`XML/ValueEscape/String`(s)); end ): ###################################################################### `Package/Assign`( `type/MapleXML/Element`, "", proc(x) evalb( type(x,function) and op(0,x) = '_XML_Element' and nops(x) > 0 and type(op(1,x),`MapleXML/ElementType`) ); end ): `Package/Assign`( `type/MapleXML/ElementType`, "", proc(x) evalb( type(x,function) and op(0,x) = '_XML_ElementType' and type([op(x)],[string$3]) ); end ): `Package/Assign`( `type/MapleXML/Attribute`, "", proc(x) evalb( type(x,function) and op(0,x) = '_XML_Attribute' and type([op(x)],[`MapleXML/AttrName`,`MapleXML/AttrValue`]) ); end ): `Package/Assign`( `type/MapleXML/AttrName`, "", proc(x) evalb( type(x,function) and op(0,x) = '_XML_AttrName' and type([op(x)],[string$3]) ); end ): `Package/Assign`( `type/MapleXML/AttrValue`, "", proc(x) evalb( type(x,function) and op(0,x) = '_XML_AttrValue' and type([op(x)],[string]) ); end ): `Package/Assign`( `type/MapleXML/Text`, "", proc(x) evalb( type(x,function) and op(0,x) = '_XML_Text' and type([op(x)],[string]) ); end ): `Package/Assign`( `XML/Objectify`::`XML/Element`, "", proc(e::`MapleXML/Element`,p_::table) local t,x,p,n; t := op(1,e); x := `new/XML/Element`(); x['Type'] := op(1,t); x['Prefix'] := op(2,t); if nargs > 1 then x['NamespaceTable'] := eval(p); x['NamespaceTableInherited'] := true; elif op(2,t) <> "" or op(3,t) <> "" then n := copy(`XML/NamespaceTable`); n[op(2,t)] := op(3,t); fi; x['SetAttributes',op(op(2,e))]; x['Contents'] := map(`XML/NewElementAux`,op(3,e)); RETURN(eval(x)); end ): ###################################################################### EndPackage(): |
From: Neil S. <nps...@us...> - 2004-10-14 10:59:07
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15359/WEB-INF/maple Modified Files: Tag: aim-xml Aim.mpl Log Message: Cosmetic tidying and an `aim/DoSOAP` stub Index: Aim.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/Aim.mpl,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** Aim.mpl 11 Mar 2004 13:39:42 -0000 1.6 --- Aim.mpl 14 Oct 2004 10:58:46 -0000 1.6.2.1 *************** *** 480,487 **** fi; - ### GWD - # DIST RETURN(subj['HomePage',accesslevel,"StudentID" = id,"Password" = password]); RETURN(subj['HomePageWithMarks',accesslevel,id,"StudentID" = id,"Password" = password]); - ### END GWD end ): --- 480,484 ---- *************** *** 500,508 **** param::table) local quizcontext,isguest,command,mode,notstrict,showsol,showmark, - # KM - # DIST focuslabel,oldfocuslabel; focuslabel,oldfocuslabel,history,historyfile,seed,seedfile, solnRevealed; - # END KM command := param["Command"]; --- 497,502 ---- *************** *** 513,525 **** quizcontext['QueryLink'] := subj['QueryLink']; - # KM solnRevealed := false; - # END KM if subj['IsRegistered',id] then quizcontext['Student'] := eval(subj['GetStudent',id]); quizcontext['StudentID'] := id; ! # KM ! # check if the student has previously shown the solutions on ! # this quiz, show them again until he requests a new version seedfile := cat(quiz['RootDir'],"/records/",id,"/seed.m"); if `OS/FileExists`(seedfile) and not command="NewQuizVersion" then --- 507,517 ---- quizcontext['QueryLink'] := subj['QueryLink']; solnRevealed := false; if subj['IsRegistered',id] then quizcontext['Student'] := eval(subj['GetStudent',id]); quizcontext['StudentID'] := id; ! ! # check if the student has previously shown the solutions on ! # this quiz, show them again until he requests a new version seedfile := cat(quiz['RootDir'],"/records/",id,"/seed.m"); if `OS/FileExists`(seedfile) and not command="NewQuizVersion" then *************** *** 533,537 **** end: fi: ! # END KM else quizcontext['Student'] := NULL; --- 525,529 ---- end: fi: ! else quizcontext['Student'] := NULL; *************** *** 554,565 **** quizcontext['Focused'] := evalb( - # KM - # DIST param["Focused"] = "true" and - # DIST command <> "NewQuizVersion" and - # DIST command <> "ShowQuizSolutions" param["Focused"] = "true") and not (isguest and member(command,{"ShowQuizSolutions","NewQuizVersion"})); - # END KM focuslabel := param["FocusLabel"]; --- 546,552 ---- *************** *** 567,575 **** focuslabel := ""; fi; - # KM if command = "NewQuizVersion" then focuslabel := "1"; fi: - # END KM quizcontext['FocusLabel'] := focuslabel; --- 554,560 ---- *************** *** 601,608 **** mode := quiz['Mode']; notstrict := evalb(mode <> "strict"); - # KM - # DIST showsol := evalb(command = "ShowQuizSolutions"); showsol := evalb((command = "ShowQuizSolutions") or solnRevealed); - # END KM if quizcontext['AfterDueDate'] then # If a guest visits after the due date, we just show the questions --- 586,590 ---- *************** *** 642,665 **** quizcontext['UseRecordedSeed'] := evalb(not(isguest or (command = "NewQuizVersion"))); - # KM - # DIST quizcontext['UseSeedParameter'] := isguest; quizcontext['UseSeedParameter'] := evalb(isguest and not(command = "NewQuizVersion")); - # END KM quizcontext['GenerateSeed'] := evalb(isguest or (command = "NewQuizVersion")); quizcontext['ReportSeed'] := isguest; ! quizcontext['RecordSeed'] := ! # KM ! # DIST evalb(not(isguest) and (command = "NewQuizVersion")); ! not isguest; ! # DIST quizcontext['DeleteSeed'] := showsol; quizcontext['DeleteSeed'] := evalb(command = "NewQuizVersion"); - # END KM ! # GWD: If the optional parameter "SeedPassword" is set to ! # the subject password then the seed given by the parameter ! # "Seed" should be used. if (assigned(param["SeedPassword"]) and assigned(param["Seed"])) then if (subj['AdminPassword'] = param["SeedPassword"]) then --- 624,639 ---- quizcontext['UseRecordedSeed'] := evalb(not(isguest or (command = "NewQuizVersion"))); quizcontext['UseSeedParameter'] := evalb(isguest and not(command = "NewQuizVersion")); quizcontext['GenerateSeed'] := evalb(isguest or (command = "NewQuizVersion")); quizcontext['ReportSeed'] := isguest; ! quizcontext['RecordSeed'] := not(isguest); quizcontext['DeleteSeed'] := evalb(command = "NewQuizVersion"); ! # GWD: If the optional parameter "SeedPassword" is set to ! # the subject password then the seed given by the parameter ! # "Seed" should be used. if (assigned(param["SeedPassword"]) and assigned(param["Seed"])) then if (subj['AdminPassword'] = param["SeedPassword"]) then *************** *** 676,694 **** quizcontext['InviteSolutions'] := evalb(mode = "practice" and not(showsol)); ! # KM ! # This line has no effect ! # DIST quizcontext['InviteNewVersion'] := ! # DIST evalb(mode = "practice"); ! # END KM quizcontext['InviteNewVersion'] := showsol; quizcontext['InviteNewQuiz'] := true; ########### - # KM if command = "NewQuizVersion" then quizcontext['AcceptAnswers'] := false; quizcontext['UseRecordedAnswers'] := false; elif solnRevealed or command = "ShowQuizPage" then - # DIST if command = "ShowQuizPage" then - # END KM quizcontext['AcceptAnswers'] := false; quizcontext['UseRecordedAnswers'] := not(isguest); --- 650,661 ---- quizcontext['InviteSolutions'] := evalb(mode = "practice" and not(showsol)); ! quizcontext['InviteNewVersion'] := showsol; quizcontext['InviteNewQuiz'] := true; ########### if command = "NewQuizVersion" then quizcontext['AcceptAnswers'] := false; quizcontext['UseRecordedAnswers'] := false; elif solnRevealed or command = "ShowQuizPage" then quizcontext['AcceptAnswers'] := false; quizcontext['UseRecordedAnswers'] := not(isguest); *************** *** 710,717 **** quizcontext['ShowPrevious'] := true; quizcontext['ShowFeedback'] := showmark; - # KM - # DIST quizcontext['ShowMark'] := showmark; quizcontext['ShowMark'] := showmark and not isguest; - # END KM quizcontext['ShowRightAnswer'] := showsol; quizcontext['ShowSolution'] := showsol; --- 677,681 ---- *************** *** 759,765 **** eval(`aim/MakeQuizContext`(subj,quiz,id,password,param)); - # KM - # had to move these lines from the bottom of the proc - # to here in order to accomodate SolutionsRevealed modes if quizcontext['DeleteSeed'] then traperror( --- 723,726 ---- *************** *** 767,771 **** sprintf("%s/records/%s/oldseed.m",quiz['RootDir'],id))); fi; - # END KM # find the seed to use for randomization --- 728,731 ---- *************** *** 843,850 **** od; fi; - # KM elif not quizcontext['AcceptAnswers'] then rawtable := table([]); - # END KM else rawtable := eval(param); --- 803,808 ---- *************** *** 858,866 **** if quizcontext['SaveHistory'] then - # KM if command = "ShowQuizSolutions" then eval(quizinstance['History'])['SolutionsRevealed'] := true; fi: - # END KM historyfile := sprintf("%s/records/%s/%A.m",quiz['RootDir'],id,seed); --- 816,822 ---- *************** *** 868,878 **** fi; - # KM - # DIST if quizcontext['DeleteSeed'] then - # DIST traperror( - # DIST `OS/Rename`(sprintf("%s/records/%s/seed.m",quiz['RootDir'],id), - # DIST sprintf("%s/records/%s/oldseed.m",quiz['RootDir'],id))); - # DIST fi; - # END KM RETURN(quizinstance['Show',quizcontext]); end --- 824,827 ---- *************** *** 890,893 **** --- 839,850 ---- ###################################################################### + `Package/Assign`( + `aim/DoSOAP`::string, + "", + proc(s::string) + printf("<aim-response>\n%s\n</aim-response>\n",s); + end + ): + EndPackage(): |
From: Neil S. <nps...@us...> - 2004-10-14 10:56:41
|
Update of /cvsroot/aimmath/AIM/WEB-INF/classes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14951/WEB-INF/classes Modified Files: Tag: aim-xml Alice.class AliceLog.class AliceLogEntry.class AliceRequest.class Maple.class Log Message: Reorganization for web-services compatibility Index: AliceLog.class =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/classes/AliceLog.class,v retrieving revision 1.6.4.1 retrieving revision 1.6.4.2 diff -C2 -d -r1.6.4.1 -r1.6.4.2 Binary files /tmp/cvsiJWkVk and /tmp/cvshoc7eC differ Index: AliceLogEntry.class =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/classes/AliceLogEntry.class,v retrieving revision 1.5.4.1 retrieving revision 1.5.4.2 diff -C2 -d -r1.5.4.1 -r1.5.4.2 Binary files /tmp/cvs5Sqmlt and /tmp/cvsaEaRQK differ Index: Alice.class =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/classes/Alice.class,v retrieving revision 1.6.4.1 retrieving revision 1.6.4.2 diff -C2 -d -r1.6.4.1 -r1.6.4.2 Binary files /tmp/cvs2jhhJw and /tmp/cvsEM2IiO differ Index: Maple.class =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/classes/Maple.class,v retrieving revision 1.4.4.1 retrieving revision 1.4.4.2 diff -C2 -d -r1.4.4.1 -r1.4.4.2 Binary files /tmp/cvskrddDH and /tmp/cvsUrEhiZ differ Index: AliceRequest.class =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/classes/AliceRequest.class,v retrieving revision 1.7.4.1 retrieving revision 1.7.4.2 diff -C2 -d -r1.7.4.1 -r1.7.4.2 Binary files /tmp/cvslmFVkN and /tmp/cvsxLP444 differ |
From: Neil S. <nps...@us...> - 2004-10-14 10:56:41
|
Update of /cvsroot/aimmath/AIM/WEB-INF/java In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14951/WEB-INF/java Modified Files: Tag: aim-xml Alice.java Maple.java Log Message: Reorganization for web-services compatibility Index: Alice.java =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/java/Alice.java,v retrieving revision 1.8.4.1 retrieving revision 1.8.4.2 diff -C2 -d -r1.8.4.1 -r1.8.4.2 *** Alice.java 7 Oct 2004 10:55:52 -0000 1.8.4.1 --- Alice.java 14 Oct 2004 10:56:22 -0000 1.8.4.2 *************** *** 513,528 **** throws ServletException, IOException { ! // This is for output to be sent as our response. ! StringWriter webOutput_ = new StringWriter(); ! PrintWriter webOutput = new PrintWriter(webOutput_); ! ! StringWriter msg_; ! PrintWriter msg; ! ! PrintWriter logWriter; ! ! Maple maple; ! String commandparam,initcommand,commandargs,page; ! // logRequest(request); --- 513,517 ---- throws ServletException, IOException { ! String commandparam; // logRequest(request); *************** *** 537,549 **** new AliceRequest(request,TempDir,MaxPostSize); ! commandparam = alicereq.getParameter("Command"); ! if ((commandparam != null) && ! commandparam.startsWith("Servlet")) { ! // this request is to be handled directly by the ! // servlet, not by Maple. ! doServletCommand(commandparam,request,response); ! return; } AliceLogEntry logentry = new AliceLogEntry(alicereq); --- 526,567 ---- new AliceRequest(request,TempDir,MaxPostSize); ! PrintWriter out = response.getWriter(); ! // out.println("Content type is " + alicereq.type); ! // out.close(); ! // return; ! if (alicereq.isSOAP()) { ! doSOAP(alicereq,response); ! } else { ! commandparam = alicereq.getParameter("Command"); ! if ((commandparam != null) && ! commandparam.startsWith("Servlet")) { ! // this request is to be handled directly by the ! // servlet, not by Maple. ! ! doServletCommand(commandparam,request,response); ! } else { ! doMain(alicereq,response); ! } } + } + + public void doMain (AliceRequest alicereq, + HttpServletResponse response) + throws ServletException, IOException { + + + StringWriter webOutput_ = new StringWriter(); + PrintWriter webOutput = new PrintWriter(webOutput_); + PrintWriter out = response.getWriter(); + + StringWriter msg_; + PrintWriter msg; + + PrintWriter logWriter; + + Maple maple; + String commandparam,initcommand,commandargs,page,tthOptions; + AliceLogEntry logentry = new AliceLogEntry(alicereq); *************** *** 584,588 **** writeLog("Command sent to maple process " + ! maple.id + ":\n" + "`aim/Main`(" + commandargs + "):\n\n"); if (LastRequestFile != null) { --- 602,607 ---- writeLog("Command sent to maple process " + ! maple.id + ":\n" + ! "`aim/Main`(" + commandargs + "):\n\n"); if (LastRequestFile != null) { *************** *** 600,641 **** // execute command, sending output to the web page. try { ! ! String tthOpt = ""; ! //get user agent ! String browser = request.getHeader("User-Agent"); ! if (browser != null) { ! browser = browser.toLowerCase(); ! //System.out.println("Browser: " + browser); ! ! //this captures safari and real mozilla and netscape 6+ only ! //and not even Opera that will identify as Mozilla ! //add more if needed ! if ( ! ((browser.indexOf("mozilla/5.0") >= 0) && ! (browser.indexOf("gecko") >= 0)) ! || ! (browser.indexOf("safari") >= 0) ! || ! (browser.indexOf("opera 7") >= 0) ! ) ! { ! tthOpt = "-u"; ! } ! } ! ! maple.exec("`aim/Main`(" + commandargs + "):\n", webOutput, alicereq.mathdisplay, tthOpt); } catch(Exception e) { logentry.close("ERROR"); maple.condemned = true; maplePool.returnMaple(maple); ! msg_ = new StringWriter(); msg = new PrintWriter(msg_); ! msg.write("Error while executing Maple command:\n" + "`aim/Main`(" + commandargs + "):\n-----------------\n" + "Exception message:\n" + e.getMessage() + "\n\n" + "Stack trace:\n"); ! e.printStackTrace(msg); --- 619,636 ---- // execute command, sending output to the web page. try { ! maple.exec("`aim/Main`(" + commandargs + "):\n", webOutput); } catch(Exception e) { logentry.close("ERROR"); maple.condemned = true; maplePool.returnMaple(maple); ! msg_ = new StringWriter(); msg = new PrintWriter(msg_); ! msg.write("Error while executing Maple command:\n" + "`aim/Main`(" + commandargs + "):\n-----------------\n" + "Exception message:\n" + e.getMessage() + "\n\n" + "Stack trace:\n"); ! e.printStackTrace(msg); *************** *** 647,650 **** --- 642,646 ---- page = webOutput_.toString(); boolean complete = true; + String responsetype = "text/html"; if (page.startsWith("ContentType=")) { *************** *** 652,665 **** int j = page.indexOf("\n"); if (j != -1) { ! response.setContentType(page.substring(i,j)); page = page.substring(j+1); - } else { - response.setContentType("text/html"); } ! } else { if (page.indexOf("</html>") == -1) { complete = false; } ! response.setContentType("text/html"); } --- 648,669 ---- int j = page.indexOf("\n"); if (j != -1) { ! responsetype = page.substring(i,j); page = page.substring(j+1); } ! } ! ! response.setContentType(responsetype); ! ! if (responsetype.equals("text/html")) { if (page.indexOf("</html>") == -1) { complete = false; } ! tthOptions = (alicereq.useUnicode ? " -u " : ""); ! try { ! page = tth.TtH.convert(page,tthOptions); ! } catch (Exception e) { ! writeSOAPFault(out,"Server.TtH","TtH error",alicereq.getServletPath(),e); ! return; ! } } *************** *** 676,679 **** --- 680,783 ---- } + public void doSOAP (AliceRequest alicereq, + HttpServletResponse response) + throws ServletException, IOException { + + PrintWriter out = response.getWriter(); + + StringWriter msg_; + PrintWriter msg; + + PrintWriter logWriter; + + Maple maple; + String commandparam,initcommand,commandargs,page,tthOptions; + + AliceLogEntry logentry = new AliceLogEntry(alicereq); + aliceLog.addEntry(logentry); + + // Build the command to send to Maple + commandargs = alicereq.mapleCommandArgs(); + + // Get a Maple process to execute the command + maple = null; + + // out.println("DoSOAP"); + + try { + maple = maplePool.getMaple("(soap)"); + } catch (Exception e) { + msg_ = new StringWriter(); + msg = new PrintWriter(msg_); + + msg.write("Fatal error getting new Maple process:\n" + + "Exception message:\n" + e.getMessage() + "\n\n" + + "Stack trace:\n"); + + e.printStackTrace(msg); + + msg.write("\n\n"); + + throw(new UnavailableException(msg_.toString())); + } + + if (maple == null) { + writeSOAPFault(out,"Server.busy","Server busy",alicereq.getServletPath()); + + logentry.close("SERVER BUSY"); + return; + } + + logentry.processID = maple.id; + + initMaple(maple); + + writeLog("SOAP request sent to maple process " + maple.id + "\n\n"); + + response.setContentType("application/soap+xml"); + // execute command + try { + maple.exec("`aim/DoSOAP`(" + commandargs + "):\n",out); + } catch(Exception e) { + logentry.close("ERROR"); + maple.condemned = true; + maplePool.returnMaple(maple); + writeSOAPFault(out,"Server","Server error",alicereq.getServletPath(),e); + return; + } finally { + alicereq.deleteFiles(); + } + logentry.close(); + maplePool.returnMaple(maple); + maplePool.clean(1000000,10000000); + } + + private void writeSOAPFault(PrintWriter w,String faultcode, + String faultstring,String faultactor) { + writeSOAPFault(w,faultcode,faultstring,faultactor,""); + } + + private void writeSOAPFault(PrintWriter w,String faultcode, + String faultstring, String faultactor, Exception e) { + writeSOAPFault(w,faultcode,faultstring,faultactor,e.getMessage()); + } + + private void writeSOAPFault(PrintWriter w,String faultcode, + String faultstring, String faultactor, String detail) { + w.println("<soap:Envelope "); + w.println(" xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'"); + w.println(" soap:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>"); + w.println(" <soap:Body>"); + w.println(" <soap:Fault>"); + w.println(" <faultcode>soap:" + faultcode + "</faultcode>"); + w.println(" <faultstring>" + faultstring + "</faultstring>"); + w.println(" <faultactor>" + faultactor + "</faultactor>"); + if (detail != null && ! detail.equals("")) { + w.println(" <detail>" + detail + "</detail>"); + } + w.println(" </soap:Fault>"); + w.println(" </soap:Body>"); + w.println("</soap:Envelope>"); + } public void printBusyPage(HttpServletResponse response) { *************** *** 924,929 **** } - - // This will be called when the web server shuts down. public void destroy() { --- 1028,1031 ---- *************** *** 938,944 **** /** * A utility class encoding a request that might or might not be ! * of content type multipart/form-data. Typically requests that ! * include a file upload will have this type, whereas requests ! * without file uploads will have type text/plain (?) */ --- 1040,1048 ---- /** * A utility class encoding a request that might or might not be ! * of content type multipart/form-data or application/soap+xml. ! * Typically requests that include a file upload will have type ! * multipart/form-data, requests in SOAP format will have ! * type application/soap+xml, and other requests will have type ! * text/plain (?) */ *************** *** 946,950 **** --- 1050,1059 ---- private HttpServletRequest request; private MultipartRequest mprequest; + private String XMLtext; private Vector parameterNames; + private String fulltype; + public String useragent; + public boolean useUnicode; + public String type; public String studentID; public String command; *************** *** 961,965 **** public AliceRequest(HttpServletRequest r, String uploadDirectory, ! int maxPostSize) throws IOException { int i; Enumeration names; --- 1070,1074 ---- public AliceRequest(HttpServletRequest r, String uploadDirectory, ! int maxPostSize) throws IOException, ServletException { int i; Enumeration names; *************** *** 967,983 **** request = r; ! try { ! mprequest = ! new MultipartRequest(r, ! uploadDirectory, ! maxPostSize); ! } catch(IOException e) { ! if (e.getMessage() == ! "Posted content type isn't multipart/form-data") { ! mprequest = null; ! } else { e.fillInStackTrace(); throw(e); } } --- 1076,1146 ---- request = r; ! ! useUnicode = false; ! String useragent = request.getHeader("User-Agent"); ! if (useragent != null) { ! useragent = useragent.toLowerCase(); ! //System.out.println("Useragent: " + useragent); ! ! //this captures safari and real mozilla and netscape 6+ only ! //and not even Opera that will identify as Mozilla ! //add more if needed ! if ( ! ((useragent.indexOf("mozilla/5.0") >= 0) && ! (useragent.indexOf("gecko") >= 0)) ! || ! (useragent.indexOf("safari") >= 0) ! || ! (useragent.indexOf("opera 7") >= 0) ! ) ! { ! useUnicode = true; ! } ! } ! ! fulltype = r.getContentType(); ! if (fulltype == null) { ! fulltype = ""; ! } else { ! fulltype = fulltype.toLowerCase(); ! } ! ! if (fulltype.startsWith("application/soap+xml")) { ! type = "application/soap+xml"; ! studentID = "(soap)"; ! // To do: use the right encoding rather than the default ! BufferedReader in = ! new BufferedReader(new InputStreamReader(request.getInputStream())); ! String line; ! StringWriter xmlwriter = new StringWriter(); ! try { ! while((line = in.readLine()) != null) {xmlwriter.write(line);} ! } catch(IOException e) { ! e.fillInStackTrace(); ! throw new ServletException("Could not read request body\n",e); ! } ! XMLtext = xmlwriter.toString(); ! return; ! } ! ! if (fulltype.startsWith("multipart/form-data")) { ! type = "multipart/form-data"; ! try { ! mprequest = ! new MultipartRequest(r, ! uploadDirectory, ! maxPostSize); ! } catch(IOException e) { e.fillInStackTrace(); throw(e); } + } else if (fulltype.startsWith("text/plain")) { + type = "text/plain"; + } else if (fulltype.equals("")) { + // fulltype = "text/plain"; + fulltype = "empty"; + } else { + // throw new ServletException("Unrecognised content type: " + fulltype); + fulltype = type; } *************** *** 1028,1032 **** subject = r.getParameter("SubjectName"); quiz = r.getParameter("QuizName"); ! mathdisplay = r.getParameter("MathDisplay"); } else { studentID = mprequest.getParameter("StudentID"); --- 1191,1195 ---- subject = r.getParameter("SubjectName"); quiz = r.getParameter("QuizName"); ! mathdisplay = r.getParameter("MathDisplay"); } else { studentID = mprequest.getParameter("StudentID"); *************** *** 1034,1038 **** subject = mprequest.getParameter("SubjectName"); quiz = mprequest.getParameter("QuizName"); ! mathdisplay = mprequest.getParameter("MathDisplay"); } --- 1197,1201 ---- subject = mprequest.getParameter("SubjectName"); quiz = mprequest.getParameter("QuizName"); ! mathdisplay = mprequest.getParameter("MathDisplay"); } *************** *** 1041,1048 **** } ! if (studentID == null) { studentID = ""; } ! if (command == null) { command = ""; } ! if (subject == null) { subject = ""; } ! if (quiz == null) { quiz = ""; } if (mathdisplay == null) { mathdisplay = "html"; } } --- 1204,1211 ---- } ! if (studentID == null) { studentID = ""; } ! if (command == null) { command = ""; } ! if (subject == null) { subject = ""; } ! if (quiz == null) { quiz = ""; } if (mathdisplay == null) { mathdisplay = "html"; } } *************** *** 1059,1063 **** public boolean isMultiPart() { ! return (mprequest != null); } --- 1222,1234 ---- public boolean isMultiPart() { ! return (type == "multipart/form-data"); ! } ! ! public boolean isSOAP() { ! return (type == "application/soap+xml"); ! } ! ! public String getServletPath() { ! return request.getServletPath(); } *************** *** 1137,1178 **** public String mapleCommandArgs() { ! StringWriter params = new StringWriter(); ! Enumeration names = parameterNames.elements(); ! String name,value; ! File serverfile; ! String serverfilename,originalfilename; ! while(names.hasMoreElements()) { ! name = (String)names.nextElement(); ! value = getParameter(name); ! params.write(",\"" + name + "\"="); ! params.write(Maple.quote(value)); ! } ! names = getFileNames(); ! while(names.hasMoreElements()) { ! name = (String)names.nextElement(); ! if ( getFile(name) != null && ! (serverfilename = getFile(name).getAbsolutePath()) != null) { ! params.write(",\"" + name + "\"=" + ! Maple.quote(serverfilename)); } ! originalfilename = getOriginalFileName(name); ! if (originalfilename != null) { ! params.write(",\"" + name + "Original\"=" + ! Maple.quote(originalfilename)); } } - params.flush(); - - String paramstring = params.toString(); - if (paramstring.startsWith(",")) { - paramstring = paramstring.substring(1); - } - - return paramstring; } } --- 1308,1353 ---- public String mapleCommandArgs() { ! if (isSOAP()) { ! return(Maple.quote(XMLtext)); ! } else { ! StringWriter params = new StringWriter(); ! Enumeration names = parameterNames.elements(); ! String name,value; ! File serverfile; ! String serverfilename,originalfilename; ! while(names.hasMoreElements()) { ! name = (String)names.nextElement(); ! value = getParameter(name); ! params.write(",\"" + name + "\"="); ! params.write(Maple.quote(value)); ! } ! names = getFileNames(); ! while(names.hasMoreElements()) { ! name = (String)names.nextElement(); ! if ( getFile(name) != null && ! (serverfilename = getFile(name).getAbsolutePath()) != null) { ! params.write(",\"" + name + "\"=" + ! Maple.quote(serverfilename)); ! } ! originalfilename = getOriginalFileName(name); ! if (originalfilename != null) { ! params.write(",\"" + name + "Original\"=" + ! Maple.quote(originalfilename)); ! } } ! params.flush(); ! ! String paramstring = params.toString(); ! if (paramstring.startsWith(",")) { ! paramstring = paramstring.substring(1); } + + return paramstring; } } } *************** *** 1190,1197 **** public AliceLogEntry (AliceRequest a) { ! studentID = (a.studentID.length() == 0) ? " " : a.studentID; ! command = (a.command.length() == 0) ? " " : a.command; ! subject = (a.subject.length() == 0) ? " " : a.subject; ! quiz = (a.quiz.length() == 0) ? " " : a.quiz; processID = -1; startTime = new Date(); --- 1365,1372 ---- public AliceLogEntry (AliceRequest a) { ! studentID = (a.studentID == null || a.studentID.length() == 0) ? " " : a.studentID; ! command = (a.command == null || a.command.length() == 0) ? " " : a.command; ! subject = (a.subject == null || a.subject.length() == 0) ? " " : a.subject; ! quiz = (a.quiz == null || a.quiz.length() == 0) ? " " : a.quiz; processID = -1; startTime = new Date(); Index: Maple.java =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/java/Maple.java,v retrieving revision 1.5.4.1 retrieving revision 1.5.4.2 diff -C2 -d -r1.5.4.1 -r1.5.4.2 *** Maple.java 7 Oct 2004 10:54:28 -0000 1.5.4.1 --- Maple.java 14 Oct 2004 10:56:22 -0000 1.5.4.2 *************** *** 138,155 **** // The command need not have a semicolon or newline at the end public synchronized void exec(String cmd) throws Exception { ! exec(cmd, null, "html", ""); ! } ! ! // Execute a given command 'cmd' and write the results to 'out'. ! // The command need not have a semicolon or newline at the end ! // Default to converting the latex output with tth ! public synchronized void exec(String cmd, PrintWriter out) throws Exception { ! exec(cmd, null, "html", ""); } // Execute a given command 'cmd' and write the results to 'out'. // The command need not have a semicolon or newline at the end ! // Convert latex using the option given ! public synchronized void exec(String cmd, PrintWriter out, String mathdisplay, String tthOpt) throws Exception { --- 138,147 ---- // The command need not have a semicolon or newline at the end public synchronized void exec(String cmd) throws Exception { ! exec(cmd, null); } // Execute a given command 'cmd' and write the results to 'out'. // The command need not have a semicolon or newline at the end ! public synchronized void exec(String cmd, PrintWriter out) throws Exception { *************** *** 163,167 **** // Tell Maple to print the terminator string, so we can see // that it has finished. ! this.write( ("printf(\"\\n" + terminator + "\\n\"):\n")); // Next, read the output, line-by-line, until terminator is read: --- 155,159 ---- // Tell Maple to print the terminator string, so we can see // that it has finished. ! this.write( "printf(\"\\n" + terminator + "\\n\"):\n" ); // Next, read the output, line-by-line, until terminator is read: *************** *** 173,187 **** } ! outstring.append(s); ! outstring.append("\n"); ! } ! ! if (out != null) { ! if (mathdisplay.toLowerCase().equals("html")) // this don't work! How do we do string comparisons? ! out.print(tth.TtH.convert(outstring.toString(), tthOpt)); ! else if (mathdisplay.toLowerCase().equals("latex")) ! out.print(outstring.toString()); ! else // default to using tth ! out.print(tth.TtH.convert(outstring.toString(), tthOpt)); } } --- 165,169 ---- } ! if (out != null) { out.println(s); } } } *************** *** 196,200 **** // as 'use', so we save and restore the value of lastUseTime. l = lastUseTime; ! exec("2+2",p,"html",""); lastUseTime = l; return( s.toString().trim().equals("4") ); --- 178,182 ---- // as 'use', so we save and restore the value of lastUseTime. l = lastUseTime; ! exec("2+2",p); lastUseTime = l; return( s.toString().trim().equals("4") ); *************** *** 204,220 **** } - // I don't know why the checkout() method is here - it is never invoked - // public synchronized String checkout() { - // StringWriter s = new StringWriter(); - // PrintWriter p = new PrintWriter(s); - - // try { - // exec("2+2",p,"html",""); - // return( s.toString().trim() ); - // } catch (Exception e) { - // return("Aargh!"); - // } - // } - public static String quote(String s) { if (s == null) { --- 186,189 ---- |
From: Neil S. <nps...@us...> - 2004-10-07 11:51:48
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26452/WEB-INF/maple/aim Modified Files: Tag: aim-xml Register.mpl Student.mpl Log Message: Added support for tutorial groups Index: Register.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Register.mpl,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -C2 -d -r1.3 -r1.3.6.1 *** Register.mpl 25 Aug 2003 21:47:19 -0000 1.3 --- Register.mpl 7 Oct 2004 11:51:30 -0000 1.3.6.1 *************** *** 58,61 **** --- 58,131 ---- ], + ['Field','UseGroups'::boolean = false, + "@True@ if the class is divided into groups + " + ], + + ['Field','GroupTable'::table, + "The table of #`aim/Register/Group`# objects containing + information about the groups (indexed by group ID's) + " + ], + + ['Method','GroupIDs'::list(string), + "The list of IDs of the groups", + proc(this) + map(op,[indices(this['GroupTable'])]); + end + ], + + ['Method','GetGroup'::`aim/Register/Group`, + "Return the #`aim/Register/Group`# objects containing + information about the group with the specified ID. + ", + proc(this,id::string) + local gt,gp; + if this['UseGroups'] <> true then + error(__("Register does not use groups")); + fi; + gt := eval(this['GroupTable']); + if not type([gt],[table]) then + error(__("Malformed group table")); + fi; + gp := eval(gt[id]); + if not(type([`aim/Register/Group`],[gp])) then + error(sprintf(__("Invalid group ID: %s"),id)); + fi; + eval(gp); + end + ], + + ['Method','AddGroup'::'void', + "Add the specified #`aim/Register/Group`# object to the group + table. If there is already a group with the specified ID, + then the details are overwritten. + ", + proc(this,g::`aim/Register/Group`) + local id,gt; + id := g['ID']; + gt := eval(this['GroupTable']); + if not(type([gt],[table])) then + gt := table([]); + this['GroupTable'] := eval(gt); + fi; + gt[id] := eval(g); + this['UseGroups'] := true; + NULL; + end + ], + + ['Method','GroupMembers'::list(`aim/Student`), + "Return the list of members of the group with the specified ID. + ", + proc(this,id::string) + if this['UseGroups'] <> true then + error(__("Register does not use groups")); + fi; + + select(s -> evalb(s['Group'] = id), this['List']); + end + ], + ['Method','List'::list(`aim/Student`), "The list of Student objects, unsorted", *************** *** 112,115 **** --- 182,200 ---- ", proc(this,student::`aim/Student`) + local gp; + + if this['UseGroups'] then + gp := student['Group']; + if not(type([gp],[string])) then + gp := ""; + student['Group'] := ""; + fi; + if gp <> "" and not(member(gp,this['GroupIDs'])) then + error(__("For student %s: group %s is invalid."), + student['ID'],gp); + fi; + else + student['Group'] := ""; + fi; this['IDTable'][student['ID']] := eval(student); NULL; *************** *** 481,484 **** --- 566,602 ---- ): + `Class/Declare`( + `aim/Register/Group`, + "An object of this class represents a group of students in the + register. Typically this will be used when a course has + lectures given by a primary lecturer, with a number of different + tutorial groups led by different teaching assistants. + ", + ['Field','ID'::string, + "An identifier for the group. It should be unique within this + register. + " + ], + + ['Field','MeetingTime'::string, + "Time(s) when the group meets. + " + ], + + ['Field','MeetingPlace'::string, + "Place(s) where the group meets. + " + ], + + ['Field','Teacher'::string, + "The name of the teacher who teaches the group. + " + ], + + ['Field','TeacherEmail'::string, + "The email address of the teacher. + " + ] + ): EndPackage(): Index: Student.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Student.mpl,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -C2 -d -r1.4 -r1.4.4.1 *** Student.mpl 26 Aug 2003 20:34:59 -0000 1.4 --- Student.mpl 7 Oct 2004 11:51:30 -0000 1.4.4.1 *************** *** 28,32 **** surname_::string, email_::string, ! password_::string) if nargs > 1 then this['ID'] := sprintf("%A",id_); --- 28,33 ---- surname_::string, email_::string, ! password_::string, ! group_::string) if nargs > 1 then this['ID'] := sprintf("%A",id_); *************** *** 68,71 **** --- 69,78 ---- # student or assigned by the teacher. + ['Field','Group'::string, + "This field can be used to identify the tutorial group to which the + student belongs, if the class is divided into groups. + " + ], + ['Method','Name'::string, "First name followed by surname.", *************** *** 143,149 **** ['Method','GeneratePassword'::'void', ! "Give this student a randomly generated password.", proc(this) ! this['Password'] := `aim/RandomPassword`(); NULL; end --- 150,160 ---- ['Method','GeneratePassword'::'void', ! "Give this student a randomly generated password. This will not ! overwrite a nonempty password that has already been set. ! ", proc(this) ! if this['Password'] = "" then ! this['Password'] := `aim/RandomPassword`(); ! fi; NULL; end |
From: Neil S. <nps...@us...> - 2004-10-07 11:50:47
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26253/WEB-INF/maple/aim/admin Modified Files: Tag: aim-xml Subject.mpl Log Message: Show hidden quizzes by default Index: Subject.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/Subject.mpl,v retrieving revision 1.5 retrieving revision 1.5.4.1 diff -C2 -d -r1.5 -r1.5.4.1 *** Subject.mpl 7 Sep 2003 09:37:52 -0000 1.5 --- Subject.mpl 7 Oct 2004 11:50:27 -0000 1.5.4.1 *************** *** 13,17 **** ['Parameter',"SubjectName" = 'required'], ['Parameter',"QuizName"], ! ['Parameter',"ShowHiddenQuizzes"::boolean = false], ['Parameter', --- 13,17 ---- ['Parameter',"SubjectName" = 'required'], ['Parameter',"QuizName"], ! ['Parameter',"ShowHiddenQuizzes"::boolean = true], ['Parameter', |
From: Neil S. <nps...@us...> - 2004-10-07 11:22:29
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19865/WEB-INF/maple/aim/admin Modified Files: Tag: aim-xml Quiz.mpl Log Message: Show hidden questions by default Index: Quiz.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/Quiz.mpl,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** Quiz.mpl 16 Nov 2003 14:22:53 -0000 1.6 --- Quiz.mpl 7 Oct 2004 11:22:17 -0000 1.6.2.1 *************** *** 20,24 **** ['Parameter',"QuizName" = 'required'], ['Parameter',"QuestionName"], ! ['Parameter',"ShowHiddenQuestions"::boolean = false], ['Parameter',"ShowQuestionSelector"::boolean = false], ['Parameter',"SelectorText" = ""], --- 20,24 ---- ['Parameter',"QuizName" = 'required'], ['Parameter',"QuestionName"], ! ['Parameter',"ShowHiddenQuestions"::boolean = true], ['Parameter',"ShowQuestionSelector"::boolean = false], ['Parameter',"SelectorText" = ""], |
From: Neil S. <nps...@us...> - 2004-10-07 11:21:12
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19514/WEB-INF/maple/aim Modified Files: Tag: aim-xml Test.mpl Log Message: Improved numerical testing Index: Test.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Test.mpl,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** Test.mpl 10 Mar 2004 02:06:54 -0000 1.8 --- Test.mpl 7 Oct 2004 11:20:52 -0000 1.8.2.1 *************** *** 161,165 **** marginspec_::`aim/Test/MarginSpecification`) ! local ANS,RIGHTANS,err,lhs,rhs,n; RIGHTANS := traperror(evalf(rightans)); --- 161,165 ---- marginspec_::`aim/Test/MarginSpecification`) ! local ANS,RIGHTANS,magnitude,err,lhs,rhs,n; RIGHTANS := traperror(evalf(rightans)); *************** *** 167,180 **** ERROR(__("Second argument is not numeric")); fi; ! ! ANS := traperror(evalf(ans)); ! if not(type([ANS],[numeric])) then ! RETURN(false); fi; - err := abs(ANS - RIGHTANS); if nargs < 3 then ! # just use the default tolerance of 5% of the correct answer ! RETURN(evalb(err <= 0.05 * abs(RIGHTANS))); else # the third argument specifies the tolerance --- 167,178 ---- ERROR(__("Second argument is not numeric")); fi; ! if abs(RIGHTANS) < 1 then ! magnitude := 0; ! else ! magnitude := floor(log10(abs(RIGHTANS))); fi; if nargs < 3 then ! Digits := 10; else # the third argument specifies the tolerance *************** *** 183,213 **** rhs := op(2,marginspec_); if lhs = 'margin' then ! RETURN(evalb(err <= rhs)); ! elif lhs = 'tolerance' then ! RETURN(evalb(err <= abs(RIGHTANS) * rhs)); ! elif lhs = 'sf' then ! if not(type([rhs],[posint])) then ! ERROR(__("Invalid margin specification")); fi; ! n := 10^(rhs - 1 - floor(log10(abs(RIGHTANS)))); ! RETURN(evalb(trunc(n * ANS) = trunc(n * RIGHTANS))); ! elif lhs = 'dp' then ! if not(type([rhs],[integer])) then ! ERROR(__("Invalid margin specification")); fi; ! n := 10^(-rhs); ! RETURN(evalb(trunc(n * ANS) = trunc(n * RIGHTANS))); ! elif lhs = 'sfround' then if not(type([rhs],[posint])) then ERROR(__("Invalid margin specification")); fi; ! n := 10^(rhs - 1 - floor(log10(abs(RIGHTANS)))); ! RETURN(evalb(round(n * ANS) = round(n * RIGHTANS))); ! elif lhs = 'dpround' then if not(type([rhs],[integer])) then ERROR(__("Invalid margin specification")); fi; ! n := 10^(-rhs); ! RETURN(evalb(round(n * ANS) = round(n * RIGHTANS))); else ERROR(__("Invalid margin specification")); --- 181,203 ---- rhs := op(2,marginspec_); if lhs = 'margin' then ! if not(type([rhs],[positive])) then ! ERROR(__("Invalid margin specification - margin must be positive")); fi; ! Digits := max(10,magnitude - floor(evalf(log10(rhs))) + 3); ! elif lhs = 'tolerance' then ! if not(type([rhs],[positive])) then ! ERROR(__("Invalid margin specification - tolerance must be positive")); fi; ! Digits := max(10, -floor(evalf(log10(rhs))) + 3); ! elif lhs = 'sf' or lhs = 'sfround' then if not(type([rhs],[posint])) then ERROR(__("Invalid margin specification")); fi; ! Digits := max(10,rhs+3); ! elif lhs = 'dp' or lhs = 'dpround' then if not(type([rhs],[integer])) then ERROR(__("Invalid margin specification")); fi; ! Digits := max(10,magnitude - rhs + 3); else ERROR(__("Invalid margin specification")); *************** *** 217,220 **** --- 207,252 ---- fi; fi; + + # re-evaluate the right answer, possibly to higher precision + # than before (if Digits has been increased). + RIGHTANS := traperror(evalf(rightans)); + if not(type([RIGHTANS],[numeric])) then + ERROR(__("Second argument is not numeric")); + fi; + + ANS := traperror(evalf(ans)); + if not(type([ANS],[numeric])) then + RETURN(false); + fi; + + err := abs(ANS - RIGHTANS); + + if nargs < 3 then + # just use the default tolerance of 5% of the correct answer + RETURN(evalb(err <= 0.05 * abs(RIGHTANS))); + else + # the third argument specifies the tolerance + lhs := op(1,marginspec_); + rhs := op(2,marginspec_); + if lhs = 'margin' then + RETURN(evalb(err <= rhs)); + elif lhs = 'tolerance' then + RETURN(evalb(err <= abs(RIGHTANS) * rhs)); + elif lhs = 'sf' then + n := 10^(rhs - 1 - floor(log10(abs(RIGHTANS)))); + RETURN(evalb(trunc(n * ANS) = trunc(n * RIGHTANS))); + elif lhs = 'dp' then + n := 10^(-rhs); + RETURN(evalb(trunc(n * ANS) = trunc(n * RIGHTANS))); + elif lhs = 'sfround' then + n := 10^(rhs - 1 - floor(log10(abs(RIGHTANS)))); + RETURN(evalb(round(n * ANS) = round(n * RIGHTANS))); + elif lhs = 'dpround' then + n := 10^(-rhs); + RETURN(evalb(round(n * ANS) = round(n * RIGHTANS))); + else + ERROR(__("Invalid margin specification")); + fi; + fi; end ): |
From: Neil S. <nps...@us...> - 2004-10-07 11:05:51
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15967/WEB-INF/maple/aim Modified Files: Tag: aim-xml Subject.mpl Log Message: Fixed case-sensitivity of name sorting in `aim/Subject/Analysis/Entry` Index: Subject.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Subject.mpl,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** Subject.mpl 10 Mar 2004 02:06:53 -0000 1.5 --- Subject.mpl 7 Oct 2004 11:05:40 -0000 1.5.2.1 *************** *** 959,965 **** "", proc(this) ! cat(this['StudentSurname']," ", ! this['StudentFirstName']," ", ! this['StudentID']); end ] --- 959,966 ---- "", proc(this) ! `Util/ToLowerCase`( ! cat(this['StudentSurname']," ", ! this['StudentFirstName']," ", ! this['StudentID'])); end ] |
From: Neil S. <nps...@us...> - 2004-10-07 10:59:46
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14057/WEB-INF/maple Modified Files: Tag: aim-xml SafeParse.mpl Log Message: added `aim/SafeParse/WordsToString2` to fix endian problem Index: SafeParse.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/SafeParse.mpl,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** SafeParse.mpl 21 May 2004 14:12:27 -0000 1.9 --- SafeParse.mpl 7 Oct 2004 10:59:34 -0000 1.9.2.1 *************** *** 740,743 **** --- 740,775 ---- + `Package/Assign`( + `aim/SafeParse/WordsToString2`::string, + "Convert a list of 4-byte integers to a string. The bytes are + interpreted as ASCII characters, with less-significant bytes + referring to later characters. This is the internal coding + used by Maple for names on some systems.", + proc(d::list(integer)) + + local nam,blk,i,w,c; + + nam := NULL; + for i from 1 to nops(d) do + blk = NULL; + w := d[i]; + c := irem(w,256); + if (c <> 0) then blk := c,blk; fi; + w := iquo(w,256); + c := irem(w,256); + if (c <> 0) then blk := c,blk; fi; + w := iquo(w,256); + c := irem(w,256); + if (c <> 0) then blk := c,blk; fi; + w := iquo(w,256); + c := irem(w,256); + if (c <> 0) then blk := c,blk; fi; + nam := nam,blk; + od; + RETURN(convert([nam],'bytes')); + end + ): + + ###################################################################### |
From: Neil S. <nps...@us...> - 2004-10-07 10:56:05
|
Update of /cvsroot/aimmath/AIM/WEB-INF/java In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13466/WEB-INF/java Modified Files: Tag: aim-xml Alice.java Log Message: Index: Alice.java =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/java/Alice.java,v retrieving revision 1.8 retrieving revision 1.8.4.1 diff -C2 -d -r1.8 -r1.8.4.1 *** Alice.java 5 Sep 2003 09:57:07 -0000 1.8 --- Alice.java 7 Oct 2004 10:55:52 -0000 1.8.4.1 *************** *** 120,123 **** --- 120,128 ---- // if necessary. + private String ZoneFile; + // The DefaultZone.mpl file. The servlet will look in this file + // to find the administrator password, which controls access to + // the servlet monitor. + private int MaxPostSize; // The maximum allowed size for uploaded files, in bytes *************** *** 174,177 **** --- 179,183 ---- AliceMapleDir = getInitParameter("AliceMapleDir"); TempDir = getInitParameter("TempDir"); + ZoneFile = getInitParameter("ZoneFile"); // It doesn't necessarily matter if these ones are null *************** *** 610,613 **** --- 616,621 ---- || (browser.indexOf("safari") >= 0) + || + (browser.indexOf("opera 7") >= 0) ) { *************** *** 733,737 **** out.println("<body bgcolor='white'>"); out.println("<h1>Alice server monitor</h1>"); ! DateFormat d = DateFormat.getTimeInstance(DateFormat.SHORT); out.println("Page last refreshed " + d.format(new Date())); out.println("<hr noshade>"); --- 741,745 ---- out.println("<body bgcolor='white'>"); out.println("<h1>Alice server monitor</h1>"); ! DateFormat d = DateFormat.getTimeInstance(); out.println("Page last refreshed " + d.format(new Date())); out.println("<hr noshade>"); *************** *** 858,865 **** trapOutput_ = new StringWriter(); trapOutput = new PrintWriter(trapOutput_); ! initcommand = "currentdir(\"" + AliceMapleDir + "\"):\n"; maple.exec(initcommand,trapOutput); } catch (Exception ex) { - //TODO: check that these \n's are OK in Windows msg_ = new StringWriter(); msg = new PrintWriter(msg_); --- 866,874 ---- trapOutput_ = new StringWriter(); trapOutput = new PrintWriter(trapOutput_); ! initcommand = ! "currentdir(\"" + AliceMapleDir + "\"):" + ! "ProcessID:=" + maple.id + ":\n"; maple.exec(initcommand,trapOutput); } catch (Exception ex) { msg_ = new StringWriter(); msg = new PrintWriter(msg_); *************** *** 1203,1207 **** public String toHTML() { String id,st,tt; ! DateFormat df = DateFormat.getTimeInstance(DateFormat.SHORT); if (processID < 0) { --- 1212,1216 ---- public String toHTML() { String id,st,tt; ! DateFormat df = DateFormat.getTimeInstance(); if (processID < 0) { *************** *** 1290,1293 **** // Local Variables: // c-basic-offset: 2 ! // compile-command: "javac -d /aim/WEB-INF/classes Alice.java" // End: --- 1299,1302 ---- // Local Variables: // c-basic-offset: 2 ! // compile-command: "javac -d ../classes Alice.java" // End: |
From: Neil S. <nps...@us...> - 2004-10-07 10:55:14
|
Update of /cvsroot/aimmath/AIM/WEB-INF/classes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13351/WEB-INF/classes Modified Files: Tag: aim-xml AliceLog.class AliceLogEntry.class AliceRequest.class Maple.class MaplePool.class Log Message: Index: MaplePool.class =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/classes/MaplePool.class,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 Binary files /tmp/cvs1YwmZe and /tmp/cvsaepInw differ Index: AliceLog.class =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/classes/AliceLog.class,v retrieving revision 1.6 retrieving revision 1.6.4.1 diff -C2 -d -r1.6 -r1.6.4.1 Binary files /tmp/cvs91zftk and /tmp/cvsexLUUB differ Index: AliceLogEntry.class =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/classes/AliceLogEntry.class,v retrieving revision 1.5 retrieving revision 1.5.4.1 diff -C2 -d -r1.5 -r1.5.4.1 Binary files /tmp/cvsPZLqAt and /tmp/cvsU2wX7K differ Index: Maple.class =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/classes/Maple.class,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -C2 -d -r1.4 -r1.4.4.1 Binary files /tmp/cvsBlarBy and /tmp/cvsQ00ecQ differ Index: AliceRequest.class =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/classes/AliceRequest.class,v retrieving revision 1.7 retrieving revision 1.7.4.1 diff -C2 -d -r1.7 -r1.7.4.1 Binary files /tmp/cvs9jIvqs and /tmp/cvsJBax3J differ |
From: Neil S. <nps...@us...> - 2004-10-07 10:55:14
|
Update of /cvsroot/aimmath/AIM/WEB-INF/classes/tth In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13351/WEB-INF/classes/tth Modified Files: Tag: aim-xml TtH.class TtHReader.class Log Message: Index: TtHReader.class =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/classes/tth/TtHReader.class,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -C2 -d -r1.3 -r1.3.4.1 Binary files /tmp/cvsdHFeZr and /tmp/cvsRIFauJ differ Index: TtH.class =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/classes/tth/TtH.class,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -C2 -d -r1.3 -r1.3.4.1 Binary files /tmp/cvsJDJDqx and /tmp/cvs0v2hZO differ |
From: Neil S. <nps...@us...> - 2004-10-07 10:54:41
|
Update of /cvsroot/aimmath/AIM/WEB-INF/java In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13229/WEB-INF/java Modified Files: Tag: aim-xml Maple.java Log Message: Checking should not reset last use time Index: Maple.java =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/java/Maple.java,v retrieving revision 1.5 retrieving revision 1.5.4.1 diff -C2 -d -r1.5 -r1.5.4.1 *** Maple.java 5 Sep 2003 09:13:48 -0000 1.5 --- Maple.java 7 Oct 2004 10:54:28 -0000 1.5.4.1 *************** *** 190,196 **** --- 190,201 ---- StringWriter s = new StringWriter(); PrintWriter p = new PrintWriter(s); + Date l; try { + // The exec method sets lastUseTime. We do not want to consider checking + // as 'use', so we save and restore the value of lastUseTime. + l = lastUseTime; exec("2+2",p,"html",""); + lastUseTime = l; return( s.toString().trim().equals("4") ); } catch (Exception e) { *************** *** 199,213 **** } ! public synchronized String checkout() { ! StringWriter s = new StringWriter(); ! PrintWriter p = new PrintWriter(s); ! try { ! exec("2+2",p,"html",""); ! return( s.toString().trim() ); ! } catch (Exception e) { ! return("Aargh!"); ! } ! } public static String quote(String s) { --- 204,219 ---- } ! // I don't know why the checkout() method is here - it is never invoked ! // public synchronized String checkout() { ! // StringWriter s = new StringWriter(); ! // PrintWriter p = new PrintWriter(s); ! // try { ! // exec("2+2",p,"html",""); ! // return( s.toString().trim() ); ! // } catch (Exception e) { ! // return("Aargh!"); ! // } ! // } public static String quote(String s) { |
From: Neil S. <nps...@us...> - 2004-10-07 10:54:41
|
Update of /cvsroot/aimmath/AIM/WEB-INF/classes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13229/WEB-INF/classes Modified Files: Tag: aim-xml Alice.class Log Message: Checking should not reset last use time Index: Alice.class =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/classes/Alice.class,v retrieving revision 1.6 retrieving revision 1.6.4.1 diff -C2 -d -r1.6 -r1.6.4.1 Binary files /tmp/cvsvg46gt and /tmp/cvsIjRNgl differ |
From: Neil S. <nps...@us...> - 2004-10-07 08:42:18
|
Update of /cvsroot/aimmath/AIM/WEB-INF/logs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18180/WEB-INF/logs Removed Files: README Log Message: --- README DELETED --- |
From: Neil S. <nps...@us...> - 2004-09-17 14:02:15
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1082/WEB-INF/maple/aim Modified Files: MultiQuestion.mpl Question.mpl Quiz.mpl Log Message: Fixed bugs related to image lists, and made changes to display the value of questions to students. Index: MultiQuestion.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/MultiQuestion.mpl,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MultiQuestion.mpl 10 Mar 2004 02:04:44 -0000 1.6 --- MultiQuestion.mpl 17 Sep 2004 14:02:05 -0000 1.7 *************** *** 222,226 **** ], ! ['Field','TopImages'::list(integer), "The list of numbers of images associated with this question version, and not associated with any subquestion. The numbers are assigned by --- 222,226 ---- ], ! ['Field','TopImages'::list(integer) = [], "The list of numbers of images associated with this question version, and not associated with any subquestion. The numbers are assigned by *************** *** 236,242 **** ", proc(this) ! local q; [op(this['TopImages']), ! op(map(q -> q['Images'], this['TopSubQuestions']))] end ], --- 236,244 ---- ", proc(this) ! local t,q; ! t := this['TopImages']; ! if t = NULL then t := []; fi; [op(this['TopImages']), ! op(map(q -> op(q['Images']), this['TopSubQuestions']))] end ], Index: Question.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Question.mpl,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Question.mpl 11 Mar 2004 13:39:42 -0000 1.12 --- Question.mpl 17 Sep 2004 14:02:05 -0000 1.13 *************** *** 1546,1554 **** "Return a copy of this history, modified so that it contains only the first @attemptnum@ attempts. - <br><br> - <font color='red'> - There are problems with the question review page, which may - be due to bugs in this method. - </font> ", proc(this,attemptnum::integer) --- 1546,1549 ---- *************** *** 1568,1586 **** allattempts := this['Attempts']; attempts := []; ! i := 1; n := 0; ! while (i <= nops(allattempts)) and (n + allattempts[i]['Count'] < attemptnum) do ! attempts := [op(attempts),allattempts[i]]; n := n + allattempts[i]['Count']; ! i := i + 1; od; ! if (i <= nops(allattempts)) and (n < attemptnum - 1) then a := eval(allattempts[i]['ShortAttempt']); m := `new/aim/Question/MultipleAttempt`(a); m['Count'] := attemptnum - 1 - n; ! attempts := [op(attempts),m]; fi; h['Attempts'] := attempts; --- 1563,1581 ---- allattempts := this['Attempts']; attempts := []; ! i := nops(allattempts); n := 0; ! while (i > 0) and (n + allattempts[i]['Count'] < attemptnum) do ! attempts := [allattempts[i],op(attempts)]; n := n + allattempts[i]['Count']; ! i := i - 1; od; ! if (i > 0) and (n < attemptnum - 1) then a := eval(allattempts[i]['ShortAttempt']); m := `new/aim/Question/MultipleAttempt`(a); m['Count'] := attemptnum - 1 - n; ! attempts := [m,op(attempts)]; fi; h['Attempts'] := attempts; *************** *** 1980,1983 **** --- 1975,1981 ---- rawans := ""; fi; + elif quizcontext['QuizReviewMode'] or + quizcontext['QuestionReviewMode'] then + rawans := history['LastRawAnswer']; fi; *************** *** 2045,2051 **** fi; ! history['AddAttempt',eval(attempt),quizcontext['MarkRequested']]; ! ! vrsion['AdjustMark',eval(history)]; this['Version'] := eval(vrsion); --- 2043,2051 ---- fi; ! if not(quizcontext['QuizReviewMode'] or ! quizcontext['QuestionReviewMode']) then ! history['AddAttempt',eval(attempt),quizcontext['MarkRequested']]; ! vrsion['AdjustMark',eval(history)]; ! fi; this['Version'] := eval(vrsion); *************** *** 2290,2294 **** if not(trymode or reviewmode) then href := sprintf("javascript:Focus('%s');", ! this['Label']); nav['AddContents', ["td", --- 2290,2294 ---- if not(trymode or reviewmode) then href := sprintf("javascript:Focus('%s');", ! this['Label']); nav['AddContents', ["td", *************** *** 2307,2311 **** [["td", "align" = "left"], [["a", "name" = this['Label']], ! ["b",__("Question")," ",this['Label']]]], [["td", "align" = "right"], ["table", --- 2307,2314 ---- [["td", "align" = "left"], [["a", "name" = this['Label']], ! ["b",__("Question")," ",this['Label']]]," ", ! `if`(this['Value'] = 1, ! __("(1 mark)"), ! sprintf(__("(%A marks)"),this['Value']))], [["td", "align" = "right"], ["table", *************** *** 2387,2392 **** else # level > 0 header := ! cat("<div class='questionheader'><a name='", ! this['Label'],"'><b>",this['Label'],"</b></a></div>\n"); fi; RETURN(header); --- 2390,2399 ---- else # level > 0 header := ! sprintf( ! "<div class='questionheader'><a name='%s'><b>%s</b></a> %s</div>\n", ! this['Label'],this['Label'], ! `if`(this['Value'] = 1, ! __("(1 mark)"), ! sprintf(__("(%A marks)"),this['Value']))); fi; RETURN(header); Index: Quiz.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Quiz.mpl,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Quiz.mpl 11 Mar 2004 13:39:42 -0000 1.7 --- Quiz.mpl 17 Sep 2004 14:02:05 -0000 1.8 *************** *** 2134,2140 **** "", proc(this) ! cat(this['StudentSurname']," ", ! this['StudentFirstName']," ", ! this['StudentID']); end ] --- 2134,2141 ---- "", proc(this) ! `Util/ToLowerCase`( ! cat(this['StudentSurname']," ", ! this['StudentFirstName']," ", ! this['StudentID'])); end ] |
From: Neil S. <nps...@us...> - 2004-09-17 13:59:38
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv348/WEB-INF/maple Modified Files: Class.mpl Log Message: Fixed bug to make method with no arguments override field in parent class. Index: Class.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/Class.mpl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Class.mpl 27 Aug 2003 22:34:37 -0000 1.4 --- Class.mpl 17 Sep 2004 13:59:28 -0000 1.5 *************** *** 80,92 **** if nops(indices) = 1 then ! if member(index,class['Fields']) then ! RETURN(eval(tbl)[index]); ! elif member(index,class['StaticFields']) then ! RETURN(class['StaticFieldValue'][index]); ! elif member(index,class['Methods']) then # A method with no arguments should override a field with the # same name in a parent class this := `Class/SetIndexFunction`(tbl,class['Name']); RETURN(cat(class['Name'],"!",index)(this)); elif member(index,class['IndirectFields']) then RETURN(eval(tbl)[class['FieldIndirectionTable'][index]][index]); --- 80,92 ---- if nops(indices) = 1 then ! if member(index,class['Methods']) then # A method with no arguments should override a field with the # same name in a parent class this := `Class/SetIndexFunction`(tbl,class['Name']); RETURN(cat(class['Name'],"!",index)(this)); + elif member(index,class['Fields']) then + RETURN(eval(tbl)[index]); + elif member(index,class['StaticFields']) then + RETURN(class['StaticFieldValue'][index]); elif member(index,class['IndirectFields']) then RETURN(eval(tbl)[class['FieldIndirectionTable'][index]][index]); |
From: Greg G. <gr...@us...> - 2004-08-30 06:24:24
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27620 Modified Files: Date.mpl Log Message: Not that it matters much, but the 'WeekDay', 'WeekDayName', etc. methods of the Date class were not being set correctly (they needed to take account of the fact that 1 January, 1970 was a Thursday). Now they are. - GG Index: Date.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/Date.mpl,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Date.mpl 29 Aug 2004 20:34:50 -0000 1.7 --- Date.mpl 30 Aug 2004 06:24:16 -0000 1.8 *************** *** 549,553 **** this['Second'] := second; ! this['WeekDay'] := irem(iquo(this['Raw'] + offset,86400),7); fi; --- 549,554 ---- this['Second'] := second; ! ### 1 January, 1970 was a Thursday ! this['WeekDay'] := irem(iquo(this['Raw'] + offset,86400) + 4,7); fi; *************** *** 611,615 **** this['Raw'] := raw - offset; ! this['WeekDay'] := irem(iquo(raw,86400),7); end ], --- 612,617 ---- this['Raw'] := raw - offset; ! ### 1 January, 1970 was a Thursday ! this['WeekDay'] := irem(iquo(raw,86400) + 4,7); end ], |
From: Greg G. <gr...@us...> - 2004-08-29 20:35:00
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32127 Modified Files: AutoConf.mpl Date.mpl Log Message: AutoConf.mpl : added missing comma. Date.mpl: replaced `Date/DaysSince1Jan2000` by `Date/DaysSince1Jan1970` - GG Index: AutoConf.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/AutoConf.mpl,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** AutoConf.mpl 21 May 2004 14:12:27 -0000 1.10 --- AutoConf.mpl 29 Aug 2004 20:34:50 -0000 1.11 *************** *** 426,430 **** "Env" = "CATALINA_HOME", "Def" = ["/usr/local","tomcat"], ! "Def" = ["/Library","Tomcat"] "Def" = ["/usr/local","jakarta-tomcat"], "Def" = ["/usr/local","jakarta-tomcat-*"], --- 426,430 ---- "Env" = "CATALINA_HOME", "Def" = ["/usr/local","tomcat"], ! "Def" = ["/Library","Tomcat"], "Def" = ["/usr/local","jakarta-tomcat"], "Def" = ["/usr/local","jakarta-tomcat-*"], Index: Date.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/Date.mpl,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Date.mpl 11 Apr 2004 07:08:13 -0000 1.6 --- Date.mpl 29 Aug 2004 20:34:50 -0000 1.7 *************** *** 277,288 **** `Package/Assign`( ! `Date/DaysSince1Jan2000`::integer, "Returns for the specified @year@, @month@ and @day@, the number of days ! since the 1st of January, 2000. ", proc(year::posint, month::posint, day::posint) local i; ! if year < 2000 then ! error sprintf(__("Year out of range (must be >= 2000): %A"), year); elif month > 12 then error sprintf(__("Month invalid: %A"), month); --- 277,288 ---- `Package/Assign`( ! `Date/DaysSince1Jan1970`::integer, "Returns for the specified @year@, @month@ and @day@, the number of days ! since the 1st of January, 1970. ", proc(year::posint, month::posint, day::posint) local i; ! if year < 1970 then ! error sprintf(__("Year out of range (must be >= 1970): %A"), year); elif month > 12 then error sprintf(__("Month invalid: %A"), month); *************** *** 291,296 **** `Date/MonthLength`(month, year), day); fi; ! (year - 2000) * 365 ! + `Date/LeapYearCount`(2000, year) + `if`(evalb(`Date/IsLeapYear`(year) and month > 2), 1, 0) + sum(`Date/MonthLengths`[i], i = 1 .. month - 1) --- 291,296 ---- `Date/MonthLength`(month, year), day); fi; ! (year - 1970) * 365 ! + `Date/LeapYearCount`(1970, year) + `if`(evalb(`Date/IsLeapYear`(year) and month > 2), 1, 0) + sum(`Date/MonthLengths`[i], i = 1 .. month - 1) *************** *** 309,314 **** proc(year::posint, m::posint, n::posint) local d; ! # 1st of January, 2000 was a Saturday ! d := 1 + ((1 - `Date/DaysSince1Jan2000`(year, m, 1)) mod 7) + 7 * (n - 1); while d > `Date/MonthLength`(m, year) do d := d - 7; --- 309,314 ---- proc(year::posint, m::posint, n::posint) local d; ! # 1st of January, 1970 was a Thursday ! d := 1 + ((3 - `Date/DaysSince1Jan1970`(year, m, 1)) mod 7) + 7 * (n - 1); while d > `Date/MonthLength`(m, year) do d := d - 7; |
From: <ben...@id...> - 2004-05-22 12:32:24
|
Dear Open Source developer I am doing a research project on "Fun and Software Development" in which I kindly invite you to participate. You will find the online survey under http://fasd.ethz.ch/qsf/. The questionnaire consists of 53 questions and you will need about 15 minutes to complete it. With the FASD project (Fun and Software Development) we want to define the motivational significance of fun when software developers decide to engage in Open Source projects. What is special about our research project is that a similar survey is planned with software developers in commercial firms. This procedure allows the immediate comparison between the involved individuals and the conditions of production of these two development models. Thus we hope to obtain substantial new insights to the phenomenon of Open Source Development. With many thanks for your participation, Benno Luthiger PS: The results of the survey will be published under http://www.isu.unizh.ch/fuehrung/blprojects/FASD/. We have set up the mailing list fa...@we... for this study. Please see http://fasd.ethz.ch/qsf/mailinglist_en.html for registration to this mailing list. _______________________________________________________________________ Benno Luthiger Swiss Federal Institute of Technology Zurich 8092 Zurich Mail: benno.luthiger(at)id.ethz.ch _______________________________________________________________________ |
From: Jon B. <bre...@us...> - 2004-05-22 00:14:28
|
Update of /cvsroot/aimmath/AIM/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22211 Modified Files: installosx.html Log Message: fix error in installosx Index: installosx.html =================================================================== RCS file: /cvsroot/aimmath/AIM/doc/installosx.html,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** installosx.html 21 May 2004 14:12:28 -0000 1.7 --- installosx.html 22 May 2004 00:14:19 -0000 1.8 *************** *** 390,394 **** <code>###Connecting to AiM</code><br> <code><IfModule mod_jk.c></code><br> ! <code>JkWorkerFile /usr/local/tomcat/conf/workers.properties</code><br> <code>JkLogFile /usr/local/tomcat/logs/mod_jk.log</code><br> <code>JkLogLevel debug</code><br> --- 390,394 ---- <code>###Connecting to AiM</code><br> <code><IfModule mod_jk.c></code><br> ! <code>JkWorkersFile /usr/local/tomcat/conf/workers.properties</code><br> <code>JkLogFile /usr/local/tomcat/logs/mod_jk.log</code><br> <code>JkLogLevel debug</code><br> |
From: Jon B. <bre...@us...> - 2004-05-21 14:12:37
|
Update of /cvsroot/aimmath/AIM/bin/tth_exe/OSX In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28978/bin/tth_exe/OSX Added Files: tth Log Message: Second attempt at committing --- NEW FILE: tth --- (This appears to be a binary file; contents omitted.) |
From: Jon B. <bre...@us...> - 2004-05-21 14:12:37
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28978/WEB-INF/maple Modified Files: AutoConf.mpl ManualConfig.dist SafeParse.mpl Log Message: Second attempt at committing Index: AutoConf.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/AutoConf.mpl,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** AutoConf.mpl 11 Apr 2004 07:08:12 -0000 1.9 --- AutoConf.mpl 21 May 2004 14:12:27 -0000 1.10 *************** *** 426,429 **** --- 426,430 ---- "Env" = "CATALINA_HOME", "Def" = ["/usr/local","tomcat"], + "Def" = ["/Library","Tomcat"] "Def" = ["/usr/local","jakarta-tomcat"], "Def" = ["/usr/local","jakarta-tomcat-*"], *************** *** 472,480 **** "Conf" = 'MapleProgram', "Def" = "/bin/maple", - "Def" = "/Applications/Maple 9.app/Contents/MacOS/bin/maple", "Def" = "/usr/bin/maple", "Def" = "/usr/local/bin/maple", "Def" = "/usr/local/maple/bin/maple", "Def" = "/usr/local/maple_su/bin/maple", "Path" = "maple", "Check" = ["-c quit;","Waterloo"] --- 473,482 ---- "Conf" = 'MapleProgram', "Def" = "/bin/maple", "Def" = "/usr/bin/maple", "Def" = "/usr/local/bin/maple", "Def" = "/usr/local/maple/bin/maple", "Def" = "/usr/local/maple_su/bin/maple", + "Def" = "/Applications/'Maple 9.5'/'Maple 9.5.app'/Contents/MacOS/bin/maple", + "Def" = "/Applications/'Maple 9.app'/Contents/MacOS/bin/maple", "Path" = "maple", "Check" = ["-c quit;","Waterloo"] *************** *** 791,795 **** # Look for TtH ! if os_os = "Linux" or os_os = "OS X" then Config['TtHProgram'] := look_for_prog( --- 793,797 ---- # Look for TtH ! if os_os = "Linux" then Config['TtHProgram'] := look_for_prog( *************** *** 800,803 **** --- 802,814 ---- "Check" = ["-r < tthtest.tex","TtH is OK"] ): + elif os_os = "OS X" then + Config['TtHProgram'] := + look_for_prog( + "TtH", + "Conf" = 'TtHProgram', + "Path" = "tth", + "Def" = cat(Config['WebAppDir'],"/bin/tth_exe/OSX/tth"), + "Check" = ["-r < tthtest.tex","TtH is OK"] + ): else Config['TtHProgram'] := Index: ManualConfig.dist =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/ManualConfig.dist,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ManualConfig.dist 13 Apr 2004 08:55:16 -0000 1.5 --- ManualConfig.dist 21 May 2004 14:12:27 -0000 1.6 *************** *** 23,27 **** # 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": --- 23,27 ---- # Config['BLATProgram'] := "C:\\Tomcat\\webapps\\AiM\\bin\\blat\\blat.exe": ! # The absolute path to the sendmail program, used under Linux and OS X # Config['SendmailProgram'] := "/usr/lib/sendmail": *************** *** 32,35 **** --- 32,36 ---- # Config['JavaHome'] := "/usr/java/jdk": # Config['JavaHome'] := "C:\\j2sdk1.4.2": + # Config['JavaHome'] := "/Library/Java/Home": *************** *** 46,49 **** --- 47,51 ---- # Config['MapleProgram'] := "/usr/bin/maple": # Config['MapleProgram'] := "C:\\Program Files\\Maple 8\\bin.win\\cmaple8.exe": + # Config['MapleProgram'] := "/Applications/Maple 9.app/Contents/MacOS/bin/maple": *************** *** 51,56 **** # 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": --- 53,59 ---- # 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_exe/tth": ! # Config['TtHProgram'] := "C:\\Tomcat\\webapps\\AiM\\bin\\tth_exe\\tth.exe": ! # Config['TtHProgram'] := "/usr/local/tomcat/webapps/aim/bin/tth_exe/OSX/tth": Index: SafeParse.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/SafeParse.mpl,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SafeParse.mpl 15 Apr 2004 08:53:27 -0000 1.8 --- SafeParse.mpl 21 May 2004 14:12:27 -0000 1.9 *************** *** 676,679 **** --- 676,712 ---- ###################################################################### + + if os_os = "OS X" then + `Package/Assign`( + `aim/SafeParse/WordsToString`::string, + "Convert a list of 4-byte integers to a string. The bytes are + interpreted as ASCII characters, with less-significant bytes + referring to earlier characters. This is the internal coding + used by Maple for names.", + proc(d::list(integer)) + + local nam,blk,i,w,c; + + nam := NULL; + for i from 1 to nops(d) do + blk := NULL; + w := d[i]; + c := irem(w,256); + if (c <> 0) then blk := c,blk; fi; + w := iquo(w,256); + c := irem(w,256); + if (c <> 0) then blk := c,blk; fi; + w := iquo(w,256); + c := irem(w,256); + if (c <> 0) then blk := c,blk; fi; + w := iquo(w,256); + c := irem(w,256); + if (c <> 0) then blk := c,blk; fi; + nam := nam,blk; + od; + RETURN(convert([nam],'bytes')); + end + ): + else `Package/Assign`( `aim/SafeParse/WordsToString`::string, *************** *** 704,707 **** --- 737,741 ---- end ): + fi: |
From: Jon B. <bre...@us...> - 2004-05-21 14:12:37
|
Update of /cvsroot/aimmath/AIM/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28978/doc Modified Files: installosx.html Log Message: Second attempt at committing Index: installosx.html =================================================================== RCS file: /cvsroot/aimmath/AIM/doc/installosx.html,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** installosx.html 29 Sep 2003 21:13:19 -0000 1.6 --- installosx.html 21 May 2004 14:12:28 -0000 1.7 *************** *** 19,22 **** --- 19,23 ---- --> <li><a href="#aim">Install AiM itself</a></li> + <li><a href="#connect">Connecting Apache and Tomcat</a></li> </ol> It is likely that you already have some of the above software installed *************** *** 43,48 **** The Maple and Java source code for AiM itself is free software; you can redistribute it and/or modify it under the terms of the GNU <a ! href='http://www.gnu.org/licenses/gpl.html'>General Public ! License</a>, as distributed by the <a href='http://www.fsf.org'>Free Software Foundation</a>; either version 2 of the license or (at your option) any later version. --- 44,49 ---- The Maple and Java source code for AiM itself is free software; you can redistribute it and/or modify it under the terms of the GNU <a ! href="http://www.gnu.org/licenses/gpl.html">General Public ! License</a>, as distributed by the <a href="http://www.fsf.org">Free Software Foundation</a>; either version 2 of the license or (at your option) any later version. *************** *** 55,75 **** <h2><a name="usr">Get acquainted with Terminal</a></h2> ! The AiM installation will require you to use the Terminal application for some of the installation steps. Terminal can be found in <font color="green">/Applications/Utilities</font>. It is recommended that you place Terminal in your Dock for easier access. There are a few commands that will be of use during the installation. These include <code>cd</code> (change directory), <code>mkdir</code> (make directory), <code>ln -s</code> (make a symbolic link), and <code>sudo</code> (temporarily assume <code>root</code> privileges).<p/> ! Many of the files associated with AiM are placed in subdirectories of the <font color='green'>/usr</font> directory. Under OS X <font color='green'>/usr</font> is hidden. The simplest way to browse and work with <font color='green'>/usr</font> is to create a symbolic link to the directory in your home directory. To do this start the Terminal application and enter, on one line, <font color='green'>ln -s /usr usr</font>. Now open your home directory. You should see a folder called <font color='green'>usr</font>. You can browse through the new folder as you normally would, but must use Terminal to create or move any files into the <font color='green'>/usr</font> directory or any of its subdirectories. <h2><a name="maple">Maple</a></h2> ! You will need Maple version 9. Simply follow Maple's default installation procedure, which typically installs software associated ! with Maple in a directory such as <font color='green'>/Applications/Maple 9</font> ! so that the executables lie in <font color='green'>/Applications/Maple\ 9.app/Contents/MacOS/bin</font>. ! A nice way to make these available in a standard path is by creating ! symbolic links into <font color='green'>/usr/local/bin</font> via the command <code>ln -s</code> in the Terminal application. For example <blockquote> <code>ln -s /Applications/Maple\ 9.app/Contents/MacOS/bin/maple /usr/local/bin/maple</code> </blockquote> ! will create a symbolic link in <code>/usr/local/bin</code> to the maple binary file. <p/> If you want to use AiM for actual teaching (rather than just checking --- 56,80 ---- <h2><a name="usr">Get acquainted with Terminal</a></h2> ! The AiM installation will require you to use the Terminal application for some of the installation steps. Terminal can be found in <font color="green"><code>/Applications/Utilities</code></font>. It is recommended that you place Terminal in your Dock for easier access. There are a few commands that will be of use during the installation. These include <code>cd</code> (change directory), <code>mkdir</code> (make directory), <code>ln -s</code> (make a symbolic link), and <code>sudo</code> (temporarily assume <code>root</code> privileges).<p/> ! Many of the files associated with AiM are placed in subdirectories of the <font color="green"><code>/usr</code></font> directory. Under OS X <font color="green"><code>/usr</code></font> is hidden. The simplest way to browse and work with <font color="green"><code>/usr</code></font> is to create a symbolic link to the directory in your home directory. To do this start the Terminal application and enter, on one line, <font color="green"><code>ln -s /usr usr</code></font>. Now open your home directory. You should see a folder called <font color="green"><code>usr</code></font>. You can browse through the new folder as you normally would, but must use Terminal to create or move any files into the <font color="green"><code>/usr</code></font> directory or any of its subdirectories. <h2><a name="maple">Maple</a></h2> ! You will need Maple version 9 or higher. Simply follow Maple's default installation procedure, which typically installs software associated ! with Maple in a directory such as <font color="green"><code>/Applications/Maple 9</code></font> ! so that the executables lie in <font color="green"><code>/Applications/Maple\ 9.app/Contents/MacOS/bin</code></font>. ! A nice way to make maple available in a standard path is by creating ! symbolic links into <font color="green"><code>/usr/local/bin</code></font> via the command <code>ln -s</code> in the Terminal application. For example <blockquote> <code>ln -s /Applications/Maple\ 9.app/Contents/MacOS/bin/maple /usr/local/bin/maple</code> </blockquote> ! will create a symbolic link in <font color="green"><code>/usr/local/bin</code></font> to the maple binary file. One could make the OS X installation mimic a UNIX or Linux install by entering ! <blockquote> ! <code>ln -s /Applications/Maple\ 9.app/Contents/MacOS /usr/local/maple</code> ! </blockquote> ! and then add <font color="green"><code>/usr/local/maple/bin</code></font> to the PATH variable. See <a href="http://www.peachpit.com/articles/article.asp?p=31442&seqNum=4">Configuring Your OS X Unix Environment</a> for information about changing the PATH variable. <p/> If you want to use AiM for actual teaching (rather than just checking *************** *** 78,105 **** then this is not an issue. If you do not have such a license, or are unsure of the type of license that your campus has, then you should ! contact <a href='mailto:in...@ma...'>Waterloo Maple</a> directly to ensure that you are complying with your license terms. If you have any complex discussions about licensing issues then (<a ! href='mailto:N.P...@sh...'>Neil Strickland</a>) would appreciate a copy. Waterloo Maple are aware of AiM and are generally supportive. Our main contact there has been <a href='dmc...@ma...'>Darren McIntyre</a> (but you should ! email <a href='mailto:in...@ma...'>in...@ma...</a> in the first instance). <h2><a name="tomcat">Tomcat</a></h2> ! You will need the Jakarta Tomcat 4 server from <a href="http://jakarta.apache.org">jakarta.apache.org</a> or from <a ! href="http://serverlogistics.com/tomcat.php">ServerLogistics</a>. Download ! <a href="http://aimmath.sourceforge.net/jakarta-tomcat-4.1.27.tar.gz"> ! jakarta tomcat 4.1.27</a> (7.1 MB) from jakarta.apache.org or <a href="http://serverlogistics.com/software/packages/jaguar/CompleteTomcat-4.1.24.dmg.gz"> ! jakarta tomcat 4.1.24</a> (7.8 MB) from ServerLogistics. If you downloaded jakarta-tomcat-4.1.27 to the Desktop, you should unpack it and move the resulting folder to ! <font color='green'>/usr/local/</font>, and make a symbolic link to ! it from <font color='green'>/usr/local/tomcat</font>. You can move the folder using the command ! <blockquote> ! <code>sudo mv ~/Desktop/jakarta-tomcat-4.1.27 /usr/local</code> ! </blockquote> ! in the Terminal and enter your password when prompted. If you downloaded from ServerLogistics, follow their installation instructions. If you have a 4.0 series installation of Tomcat, it is a good idea to replace it with the current version (there were some location changes of some directories which may cause some problems if you don't --- 83,104 ---- then this is not an issue. If you do not have such a license, or are unsure of the type of license that your campus has, then you should ! contact <a href="mailto:in...@ma...">Waterloo Maple</a> directly to ensure that you are complying with your license terms. If you have any complex discussions about licensing issues then (<a ! href="mailto:N.P...@sh...">Neil Strickland</a>) would appreciate a copy. Waterloo Maple are aware of AiM and are generally supportive. Our main contact there has been <a href='dmc...@ma...'>Darren McIntyre</a> (but you should ! email <a href="mailto:in...@ma...">in...@ma...</a> in the first instance). <h2><a name="tomcat">Tomcat</a></h2> ! You will need the Jakarta Tomcat server from <a href="http://jakarta.apache.org">jakarta.apache.org</a> or from <a ! href="http://serverlogistics.com/tomcat.php">ServerLogistics</a>. I would recommend downloading ! <a href="http://apache.oregonstate.edu/jakarta/tomcat-5/v5.0.24/bin/jakarta-tomcat-5.0.24.tar.gz"> ! jakarta-tomcat-5.0.24</a> (9.8 MB) from jakarta.apache.org or <a href="http://serverlogistics.com/software/packages/jaguar/CompleteTomcat-4.1.24.dmg.gz"> ! jakarta tomcat 4.1.24</a> (7.8 MB) from ServerLogistics. If you downloaded jakarta-tomcat-5.0.24 to the Desktop, then follow the directions found at <a href="http://www.developer.com/tech/article.php/981431">http://www.developer.com/tech/article.php/981431</a> for installing Tomcat 4. You only need to alter the name of the file to match the one you downloaded. If you downloaded from ServerLogistics, follow their installation instructions. One thing to note about the ServerLogistics' installation is that it puts Tomcat in <font color="green"><code>/Library/Tomcat</code></font> and you should modify any references to <font color="green"><code>/usr/local/tomcat</code></font> below to <font color="green"><code>/Library/Tomcat</code></font>. If you have a 4.0 series installation of Tomcat, it is a good idea to replace it with the current version (there were some location changes of some directories which may cause some problems if you don't *************** *** 107,117 **** At this point you need to set the JAVA_HOME environment variable. To do this open Terminal and enter <blockquote> ! <code>pico .tcshrc</code> </blockquote> then enter <blockquote> ! <code>setenv JAVA_HOME /Library/Java/Home</code> </blockquote> ! and finally press CTRL-O to save the .tcshrc file and CTRL-X to quit the pico editor. You can start up the Tomcat server and test some example applications, if you like, but generally it's problem-free. <!-- --- 106,118 ---- At this point you need to set the JAVA_HOME environment variable. To do this open Terminal and enter <blockquote> ! <code>pico .tcshrc</code> for the tcsh shell or<br> ! <code>pico .bashrc</code> for the bash shell </blockquote> then enter <blockquote> ! <code>setenv JAVA_HOME /Library/Java/Home</code> for tcsh or<br> ! <code>export JAVA_HOME="/Library/Java/Home"</code> for bash. </blockquote> ! and finally press CTRL-O to save the .tcshrc file and CTRL-X to quit the pico editor. You can now start up the Tomcat server using the commands found in the installation instructions you followed and test some example applications, but generally everything should work as expected. <!-- *************** *** 119,136 **** <h2><a name="tth">TtH</a></h2> ! If you don't already have <font color='green'>tth</font> (the command that runs the TeX-to-HTML converter TtH from <a href="http://hutchinson.belmont.ma.us/tth/">hutchinson.belmont.ma.us/tth/</a>) ! installed or if your already installed version of <font color='green'>tth</font> is version 3.30 or better, you may skip this section. <p/> ! During the running of <font color='green'>AutoConf.mpl</font> (see the next section), the TtH used by AiM is set to the first one found by searching the ! standard paths <font color='green'>/usr/local/bin</font>, ! <font color='green'>/usr/bin</font> and <font color='green'>/bin</font>, and if it is not found among these paths it is set to the copy of ! <font color='green'>tth</font> that comes with the AiM distribution. ! If <font color='green'>AutoConf.mpl</font> finds a version ! of <font color='green'>tth</font> on your system that is older than 3.30 you should set AiM to use its own copy, by setting <blockquote> --- 120,137 ---- <h2><a name="tth">TtH</a></h2> ! If you don't already have <font color="green">tth</font> (the command that runs the TeX-to-HTML converter TtH from <a href="http://hutchinson.belmont.ma.us/tth/">hutchinson.belmont.ma.us/tth/</a>) ! installed or if your already installed version of <font color="green">tth</font> is version 3.30 or better, you may skip this section. <p/> ! During the running of <font color="green">AutoConf.mpl</font> (see the next section), the TtH used by AiM is set to the first one found by searching the ! standard paths <font color="green">/usr/local/bin</font>, ! <font color="green">/usr/bin</font> and <font color="green">/bin</font>, and if it is not found among these paths it is set to the copy of ! <font color="green">tth</font> that comes with the AiM distribution. ! If <font color="green">AutoConf.mpl</font> finds a version ! of <font color="green">tth</font> on your system that is older than 3.30 you should set AiM to use its own copy, by setting <blockquote> *************** *** 139,144 **** </blockquote> (modified appropriately for whatever your AiM webapps directory is) in ! <font color='green'>ManualConfig.mpl</font> and rerunning <font ! color='green'>AutoConf.mpl</font>. <p/> Note that versions of TtH older that 3.30 may translate some ``unbalanced'' --- 140,145 ---- </blockquote> (modified appropriately for whatever your AiM webapps directory is) in ! <font color="green">ManualConfig.mpl</font> and rerunning <font ! color="green">AutoConf.mpl</font>. <p/> Note that versions of TtH older that 3.30 may translate some ``unbalanced'' *************** *** 165,182 **** <a href="http://sourceforge.net/projects/aimmath/">SourceForge</a> or directly <a href="http://aimmath.sourceforge.net/aim.zip">from here</a> ! and unzip it. You should get a folder called <font color="green">aim Folder</font>. Rename the <font color="green">aim Folder</font> to <font color="green">AiM</font>. Now move the <font color="green">AiM</font> folder into the ! <font color='green'>/usr/local/tomcat/webapps/</font> directory by entering <blockquote> <code>sudo mv ~/Desktop/AiM /usr/local/tomcat/webapps</code> </blockquote> ! in Terminal (assuming you unzipped on the Desktop). If you unzipped in a different location, then type <code>sudo mv </code> and then drag your <font color="green">AiM</font> folder onto the Terminal window. The path to your <font color="green">AiM</font> folder will be auto completed and you can finish the command by entering space and the rest of the command above. ! You do not have to rename the aim Folder to AiM. You can choose any name for this subdirectory. If you choose ! ROOT then the directory will not appear in the URL of the server pages for the AiM quizzes. Any other choice will appear in the URL. (It is possible to have multiple AiM installations, and this simple rule ensures the URLs of these parallel installations are distinguished.) Below we will ! assume that you chose the name <font color='green'>AiM</font>. If you chose something different, simply replace ! <font color='green'>AiM</font> by your choice in all filenames and URLs below. <p/> --- 166,183 ---- <a href="http://sourceforge.net/projects/aimmath/">SourceForge</a> or directly <a href="http://aimmath.sourceforge.net/aim.zip">from here</a> ! and unzip it. You should get a folder called <font color="green"><code>aim Folder</code></font>. Rename the <font color="green"><code>aim Folder</code></font> to <font color="green"><code>AiM</code></font>. Now move the <font color="green"><code>AiM</code></font> folder into the ! <font color="green"><code>/usr/local/tomcat/webapps/</code></font> directory by entering <blockquote> <code>sudo mv ~/Desktop/AiM /usr/local/tomcat/webapps</code> </blockquote> ! in Terminal (assuming you unzipped on the Desktop). If you unzipped in a different location, then type <code>sudo mv </code> and then drag your <font color="green"><code>AiM</code></font> folder onto the Terminal window. The path to your <font color="green">AiM</font> folder will be auto completed and you can finish the command by entering space and the rest of the command above. ! You do not have to rename the <font color="green"><code>aim Folder</code></font> to <font color="green"><code>AiM</code></font>. You can choose any name (not containing spaces) for this subdirectory. If you choose ! <font color="green">ROOT</font> then the directory will not appear in the URL of the server pages for the AiM quizzes. Any other choice will appear in the URL. (It is possible to have multiple AiM installations, and this simple rule ensures the URLs of these parallel installations are distinguished.) Below we will ! assume that you chose the name <font color="green"><code>AiM</code></font>. If you chose something different, simply replace ! <font color="green"><code>AiM</code></font> by your choice in all filenames and URLs below. <p/> *************** *** 197,201 **** </em></dt> <dd>In this case, you should unzip the new AiM into the ! <font color='green'>/usr/local/tomcat/webapps/ROOT/</font> directory (or to wherever you chose to install the old AiM). The old subjects, quizzes and student data will then still be available in the updated AiM --- 198,202 ---- </em></dt> <dd>In this case, you should unzip the new AiM into the ! <font color="green"><code>/usr/local/tomcat/webapps/ROOT/</code></font> directory (or to wherever you chose to install the old AiM). The old subjects, quizzes and student data will then still be available in the updated AiM *************** *** 205,209 **** </li> <li>Change to the maple directory of your new AiM installation. (If you installed ! AiM in the default location then the directory will be <font color='green'>/usr/local/tomcat/webapps/AiM/WEB-INF/maple/</font>.) You can do this by entering <blockquote> --- 206,210 ---- </li> <li>Change to the maple directory of your new AiM installation. (If you installed ! AiM in the default location then the directory will be <font color="green"><code>/usr/local/tomcat/webapps/AiM/WEB-INF/maple/</code></font>.) You can do this by entering <blockquote> *************** *** 212,216 **** in Terminal. <!-- ! If you already have a <font color='green'>Config.mpl</font> file, you should make a copy of it. Backup files called Config.bak are generated automatically, so you should use some other name. --- 213,217 ---- in Terminal. <!-- ! If you already have a <font color="green">Config.mpl</font> file, you should make a copy of it. Backup files called Config.bak are generated automatically, so you should use some other name. *************** *** 218,222 **** --> Now start Maple, and read in the file ! <font color='green'>AutoConf.mpl</font> by entering <blockquote> <code>sudo maple</code> --- 219,223 ---- --> Now start Maple, and read in the file ! <font color="green">AutoConf.mpl</font> by entering <blockquote> <code>sudo maple</code> *************** *** 228,246 **** 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. <p/> <a name = "reconfig"> ! Usually <font color='green'>AutoConf.mpl</font></a> will find everything it needs, but if not, you will need to have a file <font ! color='green'>ManualConfig.mpl</font> that contains the parameters whose default values you wish to override and rerun <font ! color='green'>AutoConf.mpl</font>. To create such a file start ! by copying <font color='green'>ManualConfig.dist</font> to <font ! color='green'>ManualConfig.mpl</font> and then edit it following the instructions included in the file. You should then run <font ! color='green'>AutoConf.mpl</font> again. You can iterate this procedure as often as is needed until you get an installation without error messages. Particular settings you may want to check are the following: --- 229,247 ---- 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. <p/> <a name = "reconfig"> ! Usually <font color="green">AutoConf.mpl</font></a> will find everything it needs, but if not, you will need to have a file <font ! color="green">ManualConfig.mpl</font> that contains the parameters whose default values you wish to override and rerun <font ! color="green">AutoConf.mpl</font>. To create such a file start ! by copying <font color="green">ManualConfig.dist</font> to <font ! color="green">ManualConfig.mpl</font> and then edit it following the instructions included in the file. You should then run <font ! color="green">AutoConf.mpl</font> again. You can iterate this procedure as often as is needed until you get an installation without error messages. Particular settings you may want to check are the following: *************** *** 264,279 **** Config['TomcatPort'] := 80: </blockquote> ! in <font color='green'>ManualConfig.mpl</font>. If you neglected to do this the first time around you may have to manually edit ! the files <font color='green'>admin.html</font> and ! <font color='green'>index.html</font> in ! the <font color='green'>WEB-INF</font> directory and ! <font color='green'>DefaultZone.mpl</font> ! in the <font color='green'>WEB-INF/root</font> directory, to remove the string <tt>:8080</tt>. Incidentally, the port used by Tomcat is set in the <tt><Connector/></tt> tag (that is in turn embedded in <tt><Server ...><Service ...> ... </Service></Server></tt>) in the file ! <font color='green'>/usr/local/tomcat/conf/server.xml</font>.</dd> <dt><em>Is the time set correctly?</em> <dd>There is currently a problem with time zones; if automatic --- 265,280 ---- Config['TomcatPort'] := 80: </blockquote> ! in <font color="green">ManualConfig.mpl</font>. If you neglected to do this the first time around you may have to manually edit ! the files <font color="green">admin.html</font> and ! <font color="green">index.html</font> in ! the <font color="green"><code>WEB-INF</code></font> directory and ! <font color="green">DefaultZone.mpl</font> ! in the <font color="green"><code>WEB-INF/root</code></font> directory, to remove the string <tt>:8080</tt>. Incidentally, the port used by Tomcat is set in the <tt><Connector/></tt> tag (that is in turn embedded in <tt><Server ...><Service ...> ... </Service></Server></tt>) in the file ! <font color="green"><code>/usr/local/tomcat/conf/server.xml</code></font>.</dd> <dt><em>Is the time set correctly?</em> <dd>There is currently a problem with time zones; if automatic *************** *** 284,305 **** GMT = GMT + 0 hours. If you are in the southern hemisphere or your locale doesn't have daylight saving, you may want ! to hard-set the time in <font color='green'>ManualConfig.mpl</font> (see the end of the file).</dd> </dl> <p/> ! By the way, by running <font color='green'>AutoConf.mpl</font>, ! the file <font color='green'>Servlet.mpl</font> is read which configures Tomcat, writing <ul> <li>configuration information for Tomcat to the file ! <font color='green'>/usr/local/tomcat/conf/server.xml</font>;</li> <li> and AiM-specific configuration information to the file ! <font color='green'>WEB-INF/web.xml</font> under the main AiM directory. </li> <!-- <li>and the scripts ! <font color='green'>WEB-INF/startaim.sh</font> and ! <font color='green'>WEB-INF/stopaim.sh</font> to stop and start the Tomcat server. </li> --- 285,306 ---- GMT = GMT + 0 hours. If you are in the southern hemisphere or your locale doesn't have daylight saving, you may want ! to hard-set the time in <font color="green">ManualConfig.mpl</font> (see the end of the file).</dd> </dl> <p/> ! By the way, by running <font color="green">AutoConf.mpl</font>, ! the file <font color="green">Servlet.mpl</font> is read which configures Tomcat, writing <ul> <li>configuration information for Tomcat to the file ! <font color="green">/usr/local/tomcat/conf/server.xml</font>;</li> <li> and AiM-specific configuration information to the file ! <font color="green">WEB-INF/web.xml</font> under the main AiM directory. </li> <!-- <li>and the scripts ! <font color="green">WEB-INF/startaim.sh</font> and ! <font color="green">WEB-INF/stopaim.sh</font> to stop and start the Tomcat server. </li> *************** *** 319,327 **** </li> <li>Point your Web browser at the URL of the AiM server. This will be something ! like <font color='green'><a href="http://localhost:8080/AiM/admin.html">http://localhost:8080/AiM/admin.html</a></font>, ! where you will need to replace <font color='green'>AiM</font> by the name of ! the subdirectory of <font color='green'>/usr/local/tomcat/webapps/</font> ! if you chose to unzip AiM in a directory other than AiM/, or omit ! <font color='green'>AiM/</font> completely if you chose to put it in ROOT/. You should click on 'Zone login' to log on as the administrator (with empty password). After logging in, you can set a password, create new --- 320,328 ---- </li> <li>Point your Web browser at the URL of the AiM server. This will be something ! like <font color="green"><a href="http://localhost:8080/AiM/admin.html">http://localhost:8080/AiM/admin.html</a></font>, ! where you will need to replace <font color="green">AiM</font> by the name of ! the subdirectory of <font color="green"><code>/usr/local/tomcat/webapps/</code></font> ! if you chose to unzip AiM in a directory other than <font color="green"><code>AiM/</code></font>, or omit ! <font color="green"><code>AiM/</code></font> completely if you chose to put it in <font color="green"><code>ROOT/</code></font>. You may also need to alter localhost to match the name of your server,e. g., www.myserver.edu:8080. You should click on 'Zone login' to log on as the administrator (with empty password). After logging in, you can set a password, create new *************** *** 332,347 **** installation to your new installation. All the data is contained in the directory ! <font color='green'>root</font> inside the <font color='green'>WEB-INF</font> subdirectory of your old AiM installation. You can copy the entire contents ! into the corresponding <font color='green'>root</font> directory of your new installation. However you also need to make a global search and replace in all files in that directory. If your old installation for example was in ! <font color='green'>/usr/local/tomcat/webapps/ROOT/</font> and your new one ! is in <font color='green'>/usr/local/tomcat/webapps/AiM/</font> then you want ! to replace every occurrence of <font color='green'>ROOT</font> by ! <font color='green'>AiM</font> in all the files.</li> --> </ol> <h2><a name="trouble">Troubleshooting</a></h2> --- 333,438 ---- installation to your new installation. All the data is contained in the directory ! <font color="green">root</font> inside the <font color="green">WEB-INF</font> subdirectory of your old AiM installation. You can copy the entire contents ! into the corresponding <font color="green">root</font> directory of your new installation. However you also need to make a global search and replace in all files in that directory. If your old installation for example was in ! <font color="green">/usr/local/tomcat/webapps/ROOT/</font> and your new one ! is in <font color="green">/usr/local/tomcat/webapps/AiM/</font> then you want ! to replace every occurrence of <font color="green">ROOT</font> by ! <font color="green">AiM</font> in all the files.</li> --> </ol> + + <h2><a name="connect">Connecting Apache and Tomcat</a></h2> + <h3><font color="red">Warning!! This should only be attempted by users who are very comfortable with the Terminal and working with system configuration files.</font></h3> + <ol> + <li>Shutdown Tomcat and Apache. + <ul> + <li>You can shutdown Apache by turning off Web sharing in System Preferences.</li> + <li> Tomcat can be shutdown by running + <blockquote> + <code>sudo /usr/local/tomcat/bin/shutdown.sh</code> + </blockquote> + in the Terminal.</li> + </ul></li><p/> + <li>Install JK 1.2 module for Apache + <ul> + <li>Download the binary release of the module from <a href="http://apache.mirrors.redwire.net/jakarta/tomcat-connectors/jk/binaries/macosx/jakarta-tomcat-connectors-jk-1.2.5-macosx-apache-1.3.28.tar.gz">http://apache.mirrors.redwire.net/jakarta/tomcat-connectors/jk/binaries/macosx/jakarta-tomcat-connectors-jk-1.2.5-macosx-apache-1.3.28.tar.gz</a> and unzip the file. Move the <font color="green">mod_jk.so</font> file found in the unzipped archive to the Apache module directory and give it the correct file properties by entering the following series of commands in the Terminal + <blockquote> + <code>sudo cp ~/Desktop/jakarta-tomcat-connectors-jk-1.2.5-macosx-apache-1.3.28/mod_jk.so /usr/libexec/httpd/mod_jk.so</code><br><br> + <code>sudo chown root:wheel /usr/libexec/httpd/mod_jk.so</code><br><br> + <code>sudo chmod 755 /usr/libexec/httpd/mod_jk.so</code> + </blockquote></li> + </ul></li> + <li>Edit the Apache configuration file + <ul> + <li>Back up the configuration file by entering in Terminal + <blockquote> + <code>sudo cp /etc/httpd/httpd.conf /etc/httpd/httpd.conf.mybak</code> + </blockquote></li> + <li>Add the following lines to the <font color="green">httpd.conf</font> file by first opening the file in the Terminal with + <blockquote> + <code> sudo pico /etc/httpd/httpd.conf</code> + </blockquote></li> + <dl> + <dt>In the LoadModule section before the hfs_apple_module add + <blockquote> + <code>LoadModule jk_module libexec/httpd/mod_jk.so</code> + </blockquote></dt> + <dt>In the AddModule section before the mod_hfs_apple.c add + <blockquote> + <code>AddModule mod_jk.c</code> + </blockquote></dt> + <dt>Before Section 3 on Virtual Hosts add + <blockquote> + <code>###Connecting to AiM</code><br> + <code><IfModule mod_jk.c></code><br> + <code>JkWorkerFile /usr/local/tomcat/conf/workers.properties</code><br> + <code>JkLogFile /usr/local/tomcat/logs/mod_jk.log</code><br> + <code>JkLogLevel debug</code><br> + <code>Alias /AiM /usr/local/tomcat/webapps/AiM</code><br> + <code>JkMount /AiM/* aimWorker</code><br> + <code><Location "/AiM/WEB-INF/"></code><br> + <code>AllowOverride None</code><br> + <code>deny from all</code><br> + <code></Location></code><br> + <code></IfModule></code><br> + </blockquote></dt> + <dt> Now do CTRL-O RETURN CTRL-X to save and close the file.</dt> + </dl> + </ul></li> + <li>Create the <font color="green">workers.properties</font> file by typing the following in the Terminal + <blockquote> + <code>sudo pico /usr/local/tomcat/conf/workers.properties</code><br> + <code>#Set up for AiM</code><br> + <code>workers.tomcat_home=/usr/local/tomcat</code><br> + <code>workers.java_home=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home</code><br> + <code>ps=\</code><br> + <code>worker.list=aimWorker</code><br> + <code>worker.aimWorker.port=8009</code><br> + <code>worker.aimWorker.host=localhost</code><br> + <code>worker.aimWorker.type=ajp13</code><br> + </blockquote>and do CTRL-O RETURN CTRL-X to save and close the file.</li><p/> + <li>Edit the <font color="green">jk2.properties</font> file + <ul> + <li>Back up the file by entering + <blockquote> + <code>sudo cp /usr/local/tomcat/conf/jk2.properties /usr/local/tomcat/conf/jk2.properties.mybak</code> + </blockquote> + in the Terminal</li> + <li>Open the file with + <blockquote> + <code>sudo pico /usr/local/tomcat/conf/jk2.properties</code> + </blockquote> + and remove the # symbol from the beginning of the shm.file line. Do CTRL-O RETURN CTRL-X to save and close the file. + </ul> + </li><p/> + <li>Return to step 2 of the <a href="#aim">AiM installation</a> and set the port for AiM to 80 in <font color="green">ManualConfiig.mpl</font> and follow the rest of the AiM installation instructions. + </li><p/> + <li>Test the set up by starting Apache and Tomcat and entering <code>http://myservername/AiM/</code> into your browser. You should see the student login page. + </li> + </ol> <h2><a name="trouble">Troubleshooting</a></h2> *************** *** 377,381 **** This means that Tomcat started successfully but Alice did not. You should look at the most recent Tomcat log file ! <font color='green'>/usr/local/tomcat/logs/log.YYYY-MM-DD.txt</font>, and search backward from the end for the string "unavailable". Just above this, you should find a --- 468,472 ---- This means that Tomcat started successfully but Alice did not. You should look at the most recent Tomcat log file ! <font color="green">/usr/local/tomcat/logs/log.YYYY-MM-DD.txt</font>, and search backward from the end for the string "unavailable". Just above this, you should find a *************** *** 395,400 **** use</font> in the log file. You should either shut down the other server, or change the port that Tomcat is listening and also set ! <font color='green'>Config['TomcatPort']</font> ! in <font color='green'>AutoConfig.mws</font> to specify a different port and re-execute that worksheet. </li> --- 486,491 ---- use</font> in the log file. You should either shut down the other server, or change the port that Tomcat is listening and also set ! <font color="green">Config['TomcatPort']</font> ! in <font color="green">AutoConfig.mws</font> to specify a different port and re-execute that worksheet. </li> *************** *** 406,410 **** </ul> <hr/> ! Last modified by Jon Breitenbucher on 15/09/03 </body> --- 497,501 ---- </ul> <hr/> ! Last modified by Jon Breitenbucher on 21/05/04 </body> |