Update of /cvsroot/aimmath/AIM/WEB-INF/java
In directory sc8-pr-cvs1:/tmp/cvs-serv1797/WEB-INF/java
Modified Files:
Tag: develop_2_1
Alice.java Maple.java
Log Message:
Untested modifications by Mad Alex to provide MathDisplay=latex option, see http://aimmath.sourceforge.net/mod/forum/discuss.php?d=22
Index: Alice.java
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/java/Alice.java,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -d -r1.2 -r1.2.2.1
*** Alice.java 5 May 2003 05:15:42 -0000 1.2
--- Alice.java 17 Aug 2003 11:20:51 -0000 1.2.2.1
***************
*** 593,597 ****
// execute command, sending output to the web page.
try {
! maple.exec("`aim/Main`(" + commandargs + "):\n", webOutput);
} catch(Exception e) {
logentry.close("ERROR");
--- 593,597 ----
// execute command, sending output to the web page.
try {
! maple.exec("`aim/Main`(" + commandargs + "):\n", webOutput, alicereq.mathdisplay);
} catch(Exception e) {
logentry.close("ERROR");
***************
*** 919,922 ****
--- 919,923 ----
public String subject;
public String quiz;
+ public String mathdisplay;
static final String[] specialNames =
***************
*** 995,998 ****
--- 996,1000 ----
subject = r.getParameter("SubjectName");
quiz = r.getParameter("quizName");
+ mathdisplay = r.getParameter("MathDisplay");
} else {
studentID = mprequest.getParameter("StudentID");
***************
*** 1000,1003 ****
--- 1002,1006 ----
subject = mprequest.getParameter("SubjectName");
quiz = mprequest.getParameter("quizName");
+ mathdisplay = mprequest.getParameter("MathDisplay");
}
***************
*** 1010,1013 ****
--- 1013,1017 ----
if (subject == null) { subject = ""; }
if (quiz == null) { quiz = ""; }
+ if (mathdisplay == null) { mathdisplay = "html"; }
}
Index: Maple.java
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/java/Maple.java,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -d -r1.2 -r1.2.2.1
*** Maple.java 5 May 2003 05:15:42 -0000 1.2
--- Maple.java 17 Aug 2003 11:20:51 -0000 1.2.2.1
***************
*** 138,149 ****
// 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 {
--- 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, Sting mathdisplay)
throws Exception {
***************
*** 171,177 ****
}
- // TODO: check if browser accepts <latex> and if so, omit TtH.
if (out != null) {
! out.print(tth.TtH.convert(outstring.toString()));
}
}
--- 177,187 ----
}
if (out != null) {
! if (mathdisplay == "html")
! out.print(tth.TtH.convert(outstring.toString()));
! else if (mathdisplay == "latex")
! out.print(outstring.toString());
! else // default to using tth
! out.print(tth.TtH.convert(outstring.toString()));
}
}
|