Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29897/maple/aim
Modified Files:
Tag: aim-xml
MatrixQuestion.mpl Quiz.mpl SOAP.mpl Zone.mpl
Log Message:
Index: Zone.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Zone.mpl,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -C2 -d -r1.6.2.1 -r1.6.2.2
*** Zone.mpl 31 Mar 2005 12:38:12 -0000 1.6.2.1
--- Zone.mpl 29 Apr 2005 15:09:45 -0000 1.6.2.2
***************
*** 218,221 ****
--- 218,222 ----
local studenthead,studentfoot,studenthtml,studentloginfile,
adminhead,adminfoot,adminhtml,adminloginfile,fd;
+ global Config;
try
***************
*** 243,247 ****
[["form",
"name" = "aimform",
! "action" = this['ServletURL'],
"method" = "POST"],
[["inputhidden", "name" = "Command", "value" = ""]],
--- 244,248 ----
[["form",
"name" = "aimform",
! "action" = Config['ServletURL'],
"method" = "POST"],
[["inputhidden", "name" = "Command", "value" = ""]],
***************
*** 309,313 ****
[["form",
"name" = "aimform",
! "action" = this['ServletURL'],
"method" = "POST"],
[["inputhidden", "name" = "Command", "value" = "admin/Subject" ]],
--- 310,314 ----
[["form",
"name" = "aimform",
! "action" = Config['ServletURL'],
"method" = "POST"],
[["inputhidden", "name" = "Command", "value" = "admin/Subject" ]],
Index: Quiz.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Quiz.mpl,v
retrieving revision 1.8.2.4
retrieving revision 1.8.2.5
diff -C2 -d -r1.8.2.4 -r1.8.2.5
*** Quiz.mpl 25 Apr 2005 22:36:46 -0000 1.8.2.4
--- Quiz.mpl 29 Apr 2005 15:09:45 -0000 1.8.2.5
***************
*** 1526,1530 ****
`HTML/ToString`(
`aim/HTMLPage`(__("AIM Quiz"),
- ["javascript",`aim/MatrixQuestion/Script`],
["javascript",`aim/SubmitScript`],
this['Header'],
--- 1526,1529 ----
Index: MatrixQuestion.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/MatrixQuestion.mpl,v
retrieving revision 1.4.2.3
retrieving revision 1.4.2.4
diff -C2 -d -r1.4.2.3 -r1.4.2.4
*** MatrixQuestion.mpl 22 Apr 2005 07:15:43 -0000 1.4.2.3
--- MatrixQuestion.mpl 29 Apr 2005 15:09:45 -0000 1.4.2.4
***************
*** 10,43 ****
######################################################################
- `Package/Assign`(
- `aim/MatrixQuestion/Script`::string,
- "This is a script to be included in the HTML page header for any quiz
- containing matrix questions. It defines a function that is used to
- condense a matrix of strings into a single string, by inserting the
- character @|@ between horizontally adjacent cells, and the newline
- character between rows.
- ",
- " function squashmatrix(n) {
- var f,i,j,label,s,t,rows,cols;
- f = document.aimform;
- rows = f.elements[n + 'NumRows'].value;
- cols = f.elements[n + 'NumCols'].value;
- s = '';
- for (i = 1; i <= rows; i++) {
- for (j = 1; j <= cols; j++) {
- label = '' + n + 'Row' + i + 'Col' + j;
- t = f.elements[label].value;
- s += t;
- if (j < cols) { s += '|'; }
- }
- if (i < rows) { s += '\\n'; }
- }
- f.elements[n].value = s;
- };
- "
- ):
-
- ######################################################################
-
`Class/Declare`(`aim/MatrixQuestion`,
['Extends',`aim/Question`],
--- 10,13 ----
***************
*** 394,399 ****
for j to cols do
onchange :=
! sprintf("%s+'"'+document.getElementById('%s_Row%d_Col%d').value+'"'",
! onchange,i,j);
if j < cols then
onchange := cat(onchange,"+'|'");
--- 364,369 ----
for j to cols do
onchange :=
! sprintf("%s+document.getElementById('%s_Row%d_Col%d').value",
! onchange,cgilabel,i,j);
if j < cols then
onchange := cat(onchange,"+'|'");
***************
*** 421,425 ****
onchange=\"%s\"/>
",
! cgilabel,i,j,boxsize,rawmat[i,j],onchange),
"</td>\n";
od;
--- 391,395 ----
onchange=\"%s\"/>
",
! cgilabel,i,j,cgilabel,i,j,boxsize,rawmat[i,j],onchange),
"</td>\n";
od;
***************
*** 430,435 ****
"</table>\n</td><td valign=\"middle\">",
this['PostPrompt'],"</td></tr></table>",
! sprintf("<input type='hidden' name='%s' value='%s'/>\n",
! cgilabel,rawans);
RETURN(cat(html));
--- 400,405 ----
"</table>\n</td><td valign=\"middle\">",
this['PostPrompt'],"</td></tr></table>",
! sprintf("<input type='hidden' name='%s' id ='%s' value='%s'/>\n",
! cgilabel,cgilabel,rawans);
RETURN(cat(html));
Index: SOAP.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Attic/SOAP.mpl,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -C2 -d -r1.1.2.5 -r1.1.2.6
*** SOAP.mpl 25 Apr 2005 23:08:02 -0000 1.1.2.5
--- SOAP.mpl 29 Apr 2005 15:09:45 -0000 1.1.2.6
***************
*** 103,114 ****
['Process',
proc(inp,out)
! local item,errs;
out["format"] := inp["format"];
- out["maxScore"] := round(100 * item['Value']);
try
item := `aim/SOAP/GetItem`(inp);
catch "Compilation failure":
errs := lastexception[3];
- out["sourceCached"] := false;
out["sourceErrors"] :=
[["http://errors.aiminfo.net/CompilationFailed",
--- 103,112 ----
['Process',
proc(inp,out)
! local item,errs,val;
out["format"] := inp["format"];
try
item := `aim/SOAP/GetItem`(inp);
catch "Compilation failure":
errs := lastexception[3];
out["sourceErrors"] :=
[["http://errors.aiminfo.net/CompilationFailed",
***************
*** 117,120 ****
--- 115,126 ----
return();
end try;
+ val := item['Value'];
+ if frac(val) <> 0 then
+ out["sourceErrors"] :=
+ [["http://errors.aiminfo.net/NonIntegerValue",
+ __("Item value must be an integer"),""]];
+ return();
+ fi;
+ out["maxScore"] := round(val);
return();
end
***************
*** 200,204 ****
vrsion['CGIPrefix'] :=
! cat(inp["embedPrefix"],"RawAnswer");
responses := table(inp["responses"]);
--- 206,210 ----
vrsion['CGIPrefix'] :=
! cat(inp["namePrefix"],"RawAnswer");
responses := table(inp["responses"]);
***************
*** 244,248 ****
t);
out["outcomeVars"] := eval(t);
! out["outputs"] := inst['ShowParts',context];
NULL;
end
--- 250,254 ----
t);
out["outcomeVars"] := eval(t);
! out["output"] := inst['ShowParts',context];
NULL;
end
|