Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim/try
In directory sc8-pr-cvs1:/tmp/cvs-serv12052/WEB-INF/maple/aim/try
Modified Files:
Question.mpl Quiz.mpl
Log Message:
merged from develop_2_1
Index: Question.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/try/Question.mpl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Question.mpl 5 May 2003 03:25:46 -0000 1.2
--- Question.mpl 25 Aug 2003 21:47:19 -0000 1.3
***************
*** 20,23 ****
--- 20,24 ----
qdc['StudentIsTeacher'] := true:
qdc['QuizReviewMode'] := false:
+ qdc['QuestionReviewMode'] := false:
qdc['QuizTryMode'] := false:
qdc['QuestionTryMode'] := true:
***************
*** 42,48 ****
qdc['ShowPrevious'] := true:
qdc['ShowFeedback'] := true:
- qdc['ShowFeedbackMC'] := true:
qdc['ShowMark'] := true:
- qdc['ShowMarkMC'] := true:
qdc['ShowRightAnswer'] := true:
qdc['ShowSolution'] := true:
--- 43,47 ----
***************
*** 67,77 ****
['Parameter',"QuestionName" = 'required',""],
['Parameter',"SourceFile" = "",""],
['Parameter',"QuestionSeed"::integer = 0,""],
! ['Parameter',"RawAnswer" = ""],
!
! ['Parameter',"Action"::{"Mark","NewVersion"} = "Mark"],
##################################################
--- 66,81 ----
['Parameter',"QuestionName" = 'required',""],
+ ['Parameter',"QuestionLabel" = "",""],
+
['Parameter',"SourceFile" = "",""],
['Parameter',"QuestionSeed"::integer = 0,""],
! ['Parameter',
! "Action"::{"Mark",
! "TryQuestion",
! "NewVersion",
! "TryRightAnswer"} =
! "TryRightAnswer"],
##################################################
***************
*** 121,126 ****
["tr",
[["td","width" = "16%"],`HTML/CloseButton`],
! [["td","width" = "16%"],[["a", "href" = "#bottom"],__("Bottom")],
! [["td","width" = "16%"],{"editsource"}]]]],
[["hr", "noshade"]],
__("Seed: "),
--- 125,132 ----
["tr",
[["td","width" = "16%"],`HTML/CloseButton`],
! [["td","width" = "16%"],[["a", "href" = "#bottom"],__("Bottom")]],
! [["td","width" = "16%"],{"editsource"}],
! [["td","width" = "16%"],{["Mark"]}],
! [["td","width" = "16%"],{["NewVersion"]}]]],
[["hr", "noshade"]],
__("Seed: "),
***************
*** 145,150 ****
question,qname,title,shorttitle,
dir,fullqfile,vrsion,instance,seed,
! show,rawans,editsource,err,fulldir,attempt,
! rightans,numrows,numcols,i,j,cell;
global AimCache;
--- 151,156 ----
question,qname,title,shorttitle,
dir,fullqfile,vrsion,instance,seed,
! show,rawtable,rawans,editsource,err,fulldir,
! qlist,q,userightans;
global AimCache;
***************
*** 179,183 ****
qname := p["QuestionName"];
-
editsource := NULL;
--- 185,188 ----
***************
*** 185,189 ****
editsource :=
sprintf(
! "<input type=hidden name=\"SourceFile\" value=%a>\n%s\n",
p["SourceFile"],
page['ActionLink',"EditSource"]);
--- 190,194 ----
editsource :=
sprintf(
! "<input type=hidden name='SourceFile' value='%s'/>\n%s\n",
p["SourceFile"],
page['ActionLink',"EditSource"]);
***************
*** 200,206 ****
"<font color='red'>",
sprintf(__("Cannot load question file: %s"),fullqfile),
! "</font>\n<br>\n",
`HTML/Escape`(err),
! "<br>\n",
page['ActionLink',"Mark",[],__("Retry")]);
page['FillTemplate',"editsource" = editsource,"show" = err];
--- 205,211 ----
"<font color='red'>",
sprintf(__("Cannot load question file: %s"),fullqfile),
! "</font>\n<br/>\n",
`HTML/Escape`(err),
! "<br/>\n",
page['ActionLink',"Mark",[],__("Retry")]);
page['FillTemplate',"editsource" = editsource,"show" = err];
***************
*** 213,221 ****
"<font color='red'>",
__("Malformed question"),
! "</font><br>\n",
page['ActionLink',"Mark",[],__("Retry")],
! "\n<br><pre>\n",
`HTML/Escape`(sprintf("%a",eval(question))),
! "\n</pre><br>\n");
page['FillTemplate',"editsource" = editsource,"show" = err];
RETURN();
--- 218,226 ----
"<font color='red'>",
__("Malformed question"),
! "</font><br/>\n",
page['ActionLink',"Mark",[],__("Retry")],
! "\n<br/><pre>\n",
`HTML/Escape`(sprintf("%a",eval(question))),
! "\n</pre><br/>\n");
page['FillTemplate',"editsource" = editsource,"show" = err];
RETURN();
***************
*** 231,235 ****
editsource :=
sprintf(
! "<input type=hidden name=\"SourceFile\" value=%a>\n%s\n",
p["SourceFile"],
page['ActionLink',"EditSource"]);
--- 236,240 ----
editsource :=
sprintf(
! "<input type=hidden name='SourceFile' value='%s'>\n%s\n",
p["SourceFile"],
page['ActionLink',"EditSource"]);
***************
*** 248,260 ****
"<font color='red'>",
__("Error in MakeVersion:"),
! "</font><br>\n",
`HTML/Escape`(err),
! "<br>\n",
page['ActionLink',"Mark",[],__("Retry")],
! "<br>\n",
__("Question:"),
! "<br>\n<pre>\n",
`HTML/Escape`(`Class/ToString`(question,20,80))),
! "</pre><br>\n";
page['FillTemplate',"editsource" = editsource,"show" = err];
RETURN();
--- 253,265 ----
"<font color='red'>",
__("Error in MakeVersion:"),
! "</font><br/>\n",
`HTML/Escape`(err),
! "<br/>\n",
page['ActionLink',"Mark",[],__("Retry")],
! "<br/>\n",
__("Question:"),
! "<br/>\n<pre>\n",
`HTML/Escape`(`Class/ToString`(question,20,80))),
! "</pre><br/>\n";
page['FillTemplate',"editsource" = editsource,"show" = err];
RETURN();
***************
*** 266,274 ****
"<font color='red'>",
__("Malformed question version:"),
! "</font><br>\n",
page['ActionLink',"Mark",[],__("Retry")],
! "\n<br><pre>\n",
`HTML/Escape`(sprintf("%a",eval(question))),
! "\n</pre><br>\n");
page['FillTemplate',"editsource" = editsource,"show" = err];
RETURN();
--- 271,279 ----
"<font color='red'>",
__("Malformed question version:"),
! "</font><br/>\n",
page['ActionLink',"Mark",[],__("Retry")],
! "\n<br/><pre>\n",
`HTML/Escape`(sprintf("%a",eval(question))),
! "\n</pre><br/>\n");
page['FillTemplate',"editsource" = editsource,"show" = err];
RETURN();
***************
*** 279,318 ****
"<font color='red'>",
__("Question Initialization Failed:"),
! "</font><br>\n",
vrsion['Preamble'],
! "\n<br><pre>\n");
page['FillTemplate',"editsource" = editsource,"show" = err,"title" = qname];
RETURN();
! else
!
! rawans := p["RawAnswer"];
! if p["Action"] = "NewVersion" or rawans = "" then
! if type(question,`aim/TextQuestion`) then
! rawans := `aim/EntryHint`(vrsion['RightAnswer']);
! elif type(question,`aim/MatrixQuestion`) then
! rawans := "";
! rightans := vrsion['RightAnswer'];
! numrows := vrsion['NumRows'];
! numcols := vrsion['NumCols'];
!
! for i to numrows do
! for j to numcols do
! cell := traperror(`aim/EntryHint`(rightans[i,j]));
! if cell = lasterror then cell := ""; fi;
! rawans := rawans,cell;
! if j < numcols then rawans := rawans,"|"; fi;
! od;
! if i < numrows then rawans := rawans,"\n"; fi;
! od;
! rawans := cat(rawans);
! elif type(question,`aim/MCQuestion`) then
! rawans := vrsion['RightLabel'];
! elif type(question,`aim/MRQuestion`) then
! rawans := sprintf("%a",vrsion['RightLabels']);
! else
! rawans := "";
! fi;
! fi;
# if `Util/RemoveWhiteSpace`(vrsion['Note']) <> "" then
--- 284,294 ----
"<font color='red'>",
__("Question Initialization Failed:"),
! "</font><br/>\n",
vrsion['Preamble'],
! "\n<br/><pre>\n");
page['FillTemplate',"editsource" = editsource,"show" = err,"title" = qname];
RETURN();
! else # question version constructed, seems OK
# if `Util/RemoveWhiteSpace`(vrsion['Note']) <> "" then
***************
*** 320,324 ****
# cat(
# vrsion['Postamble'],
! # "<br><b>",__("Question note:"),"</b> ",`HTML/Escape`(vrsion['Note']));
# fi;
--- 296,300 ----
# cat(
# vrsion['Postamble'],
! # "<br/><b>",__("Question note:"),"</b> ",`HTML/Escape`(vrsion['Note']));
# fi;
***************
*** 326,335 ****
cat(
vrsion['Postamble'],
! "<br>\n",
page['ActionLink',"Mark"]," ",
page['ActionLink',"NewVersion"],
! "\n<br><hr>\n");
! instance := traperror(eval(vrsion['MakeInstance',rawans]));
if instance = lasterror then
--- 302,341 ----
cat(
vrsion['Postamble'],
! "<br/>\n",
page['ActionLink',"Mark"]," ",
page['ActionLink',"NewVersion"],
! "\n<br/><hr/>\n");
! if p["QuestionLabel"] = "" then
! rawtable := eval(p);
! else
! rawtable := table([]);
! if type([vrsion],[`aim/MultiQuestion/Version`]) then
! for q in vrsion['SubQuestions'] do
! rawans :=
! p[cat("RawAnswer",p["QuestionLabel"],q['Label'])];
! if not(type([rawans],[string])) then
! rawans := "";
! fi;
! rawtable[cat("RawAnswer",q['Label'])] := rawans;
! od;
! else
! rawans :=
! p[cat("RawAnswer",p["QuestionLabel"])];
! if not(type([rawans],[string])) then
! rawans := "";
! fi;
! rawtable["RawAnswer"] := rawans;
! fi;
! fi;
!
! userightans :=
! evalb((p["Action"] = "NewVersion") or
! (p["Action"] = "TryRightAnswer"));
!
! instance :=
! traperror(eval(
! `aim/Question/MakeInstance/Recursive`(
! vrsion,rawtable,table([]),`try/Question/Context`,userightans)));
if instance = lasterror then
***************
*** 339,349 ****
"<font color='red'>",
__("Error in MakeInstance:"),
! "</font><br>\n",
`HTML/Escape`(err),
! "<br>\n",
page['ActionLink',"Mark",[],__("Retry")],
! "<br>\n",
__("Question version:"),
! "<br>\n<pre>\n",
`HTML/Escape`(`Class/ToString`(vrsion,20,80))),
"\n</pre>\n";
--- 345,355 ----
"<font color='red'>",
__("Error in MakeInstance:"),
! "</font><br/>\n",
`HTML/Escape`(err),
! "<br/>\n",
page['ActionLink',"Mark",[],__("Retry")],
! "<br/>\n",
__("Question version:"),
! "<br/>\n<pre>\n",
`HTML/Escape`(`Class/ToString`(vrsion,20,80))),
"\n</pre>\n";
***************
*** 357,365 ****
"<font color='red'>",
__("Malformed question instance:"),
! "</font><br>\n",
page['ActionLink',"Mark",[],__("Retry")],
! "\n<br><pre>\n",
`HTML/Escape`(sprintf("%a",eval(instance))),
! "\n</pre><br>\n");
page['FillTemplate',"editsource" = editsource,"show" = err];
RETURN();
--- 363,371 ----
"<font color='red'>",
__("Malformed question instance:"),
! "</font><br/>\n",
page['ActionLink',"Mark",[],__("Retry")],
! "\n<br/><pre>\n",
`HTML/Escape`(sprintf("%a",eval(instance))),
! "\n</pre><br/>\n");
page['FillTemplate',"editsource" = editsource,"show" = err];
RETURN();
***************
*** 367,372 ****
else
- attempt := eval(instance['Attempt']);
-
show :=
instance['Show',`try/Question/Context`];
--- 373,376 ----
***************
*** 377,383 ****
"<font color='red'>",
__("Error in Show: result was not a string."),
! "</font><br>\n",
page['ActionLink',"Mark",[],__("Retry")],
! "<br><pre>\n",
`HTML/Escape`(sprintf("%a",eval(show))),
"\n</pre>\n");
--- 381,387 ----
"<font color='red'>",
__("Error in Show: result was not a string."),
! "</font><br/>\n",
page['ActionLink',"Mark",[],__("Retry")],
! "<br/><pre>\n",
`HTML/Escape`(sprintf("%a",eval(show))),
"\n</pre>\n");
***************
*** 388,394 ****
fi; # ENDS: if instance = lasterror then ...
- page['HiddenParameters'] :=
- page['HiddenParameters'] minus {"RawAnswer"};
-
title :=
"<center><h1>",__("AIM question trial"),"</h1></center>\n",
--- 392,395 ----
***************
*** 426,430 ****
title,
"<tr><td>",__("Description:"),"</td>\n",
! "<td>",`LaTeX/Wrap`(question['Description']),"</td></tr>\n";
fi;
title := title,"</table>\n";
--- 427,431 ----
title,
"<tr><td>",__("Description:"),"</td>\n",
! "<td>",`aim/LaTeX/Wrap`(question['Description']),"</td></tr>\n";
fi;
title := title,"</table>\n";
***************
*** 433,436 ****
--- 434,439 ----
shorttitle := cat(shorttitle);
page['Title'] := shorttitle;
+
+ p["QuestionLabel"] := "";
page['FillTemplate',
Index: Quiz.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/try/Quiz.mpl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Quiz.mpl 5 May 2003 03:25:46 -0000 1.2
--- Quiz.mpl 25 Aug 2003 21:47:19 -0000 1.3
***************
*** 20,23 ****
--- 20,24 ----
qdc['StudentIsTeacher'] := true:
qdc['QuizReviewMode'] := false:
+ qdc['QuestionReviewMode'] := false:
qdc['QuizTryMode'] := true:
qdc['QuestionTryMode'] := false:
***************
*** 75,78 ****
--- 76,83 ----
}
+ function Validate() {
+ Mark();
+ }
+
",
`aim/MRQuestion/Script`,
***************
*** 115,119 ****
"Try an individual question.",
['Command' = "try/Question",
! 'Arguments' = ["QuestionName","QuestionSeed","RawAnswer"],
'LinkText' = __("Try question")]],
--- 120,124 ----
"Try an individual question.",
['Command' = "try/Question",
! 'Arguments' = ["QuestionName","QuestionSeed","QuestionLabel"],
'LinkText' = __("Try question")]],
***************
*** 177,181 ****
proc(page::`aim/admin/Page`,p::table)
! local subject,quizname,quiz,quizversion,quizinstance,
seed,keys,question,label,cgilabel,questiontable,
rawans,rightans,numrows,numcols,i,j,cell;
--- 182,186 ----
proc(page::`aim/admin/Page`,p::table)
! local subject,quizname,quiz,quizversion,quizinstance,quizhistory,
seed,keys,question,label,cgilabel,questiontable,
rawans,rightans,numrows,numcols,i,j,cell;
***************
*** 236,240 ****
od;
! quizinstance := eval(quizversion['MakeInstance',p]);
quizinstance['SetBody',`try/Quiz/Context`];
--- 241,248 ----
od;
! quizhistory := `new/aim/Quiz/History`(quizversion);
!
! quizinstance :=
! eval(quizversion['MakeInstance',p,quizhistory,`try/Quiz/Context`]);
quizinstance['SetBody',`try/Quiz/Context`];
***************
*** 244,248 ****
`new/HTML/Tag`(["table", "width" = "100%"]);
! for question in quizversion['Questions'] do
label := question['Label'];
questiontable['AddContents',
--- 252,256 ----
`new/HTML/Tag`(["table", "width" = "100%"]);
! for question in quizversion['TopQuestions'] do
label := question['Label'];
questiontable['AddContents',
|