Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim/review
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16947/maple/aim/review
Modified Files:
Tag: aim-xml
Question.mpl Quiz.mpl Subject.mpl
Log Message:
Many small changes, especially to error handling
Index: Subject.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/review/Subject.mpl,v
retrieving revision 1.2
retrieving revision 1.2.10.1
diff -C2 -d -r1.2 -r1.2.10.1
*** Subject.mpl 5 May 2003 03:25:46 -0000 1.2
--- Subject.mpl 31 Mar 2005 12:38:15 -0000 1.2.10.1
***************
*** 122,128 ****
qname := quiz['Name'];
qtitle := quiz['Title'];
! histories := traperror(quiz['GetHistories',id]);
! if histories = lasterror then
! err := lasterr;
if length(err) > 70 then
err := cat(substring(err,1..67),"...");
--- 122,129 ----
qname := quiz['Name'];
qtitle := quiz['Title'];
! try
! histories := quiz['GetHistories',id];
! catch:
! err := StringTools[FormatMessage](lastexception[2..-1]);
if length(err) > 70 then
err := cat(substring(err,1..67),"...");
***************
*** 138,143 ****
"</td>\n",
"<td colspan='3'><font color='red'>",err,"</font></td>\n",
! "</tr>\n";
! elif histories = [] then
quizmarks :=
quizmarks,
--- 139,147 ----
"</td>\n",
"<td colspan='3'><font color='red'>",err,"</font></td>\n",
! "</tr>\n";
! next;
! end try;
!
! if histories = [] then
quizmarks :=
quizmarks,
Index: Question.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/review/Question.mpl,v
retrieving revision 1.2
retrieving revision 1.2.6.1
diff -C2 -d -r1.2 -r1.2.6.1
*** Question.mpl 25 Aug 2003 21:47:19 -0000 1.2
--- Question.mpl 31 Mar 2005 12:38:14 -0000 1.2.6.1
***************
*** 240,247 ****
fi;
! quiz := traperror(eval(subject['GetQuiz',p["QuizName"]]));
! if not(type(quiz,`aim/Quiz`)) then
page['SetError',"%s: %s",__("Could not load quiz"),p["QuizName"]];
! RETURN();
fi;
--- 240,252 ----
fi;
! quiz := NULL;
! try
! quiz := eval(subject['GetQuiz',p["QuizName"]]);
! catch:
! end try;
!
! if not(type([quiz],[`aim/Quiz`])) then
page['SetError',"%s: %s",__("Could not load quiz"),p["QuizName"]];
! return();
fi;
***************
*** 268,278 ****
eval(quizversion['LabelTable'][p["QuestionLabel"]]);
! history := traperror(eval(quiz['GetHistory',id,seed]));
! if not(type(history,`aim/Quiz/History`)) then
page['SetError',
__("Could not load history for quiz %s and student %s"),
quiz['Name'],
id];
! RETURN();
fi;
--- 273,288 ----
eval(quizversion['LabelTable'][p["QuestionLabel"]]);
! history := NULL;
! try
! history := eval(quiz['GetHistory',id,seed]);
! catch:
! end try;
!
! if not(type([history],[`aim/Quiz/History`])) then
page['SetError',
__("Could not load history for quiz %s and student %s"),
quiz['Name'],
id];
! return();
fi;
***************
*** 303,307 ****
numattempts := [op(numattempts),subqhistory['Count']];
! attempt := traperror(eval(subqhistory['Attempt',attemptnum]));
if not(type([attempt],[`aim/Question/ShortAttempt`])) then
page['SetError',
--- 313,321 ----
numattempts := [op(numattempts),subqhistory['Count']];
! attempt := NULL;
! try
! attempt := eval(subqhistory['Attempt',attemptnum]);
! catch:
! end try;
if not(type([attempt],[`aim/Question/ShortAttempt`])) then
page['SetError',
Index: Quiz.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/review/Quiz.mpl,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -C2 -d -r1.4 -r1.4.2.1
*** Quiz.mpl 10 Mar 2004 02:06:54 -0000 1.4
--- Quiz.mpl 31 Mar 2005 12:38:15 -0000 1.4.2.1
***************
*** 208,212 ****
subject := eval(page['Subject']);
register := eval(subject['GetRegister']);
! quiz := traperror(eval(subject['GetQuiz',p["QuizName"]]));
id := p["StudentID"];
student := register['GetStudent',id];
--- 208,218 ----
subject := eval(page['Subject']);
register := eval(subject['GetRegister']);
!
! quiz := NULL;
! try
! quiz := eval(subject['GetQuiz',p["QuizName"]]);
! catch:
! end try;
!
id := p["StudentID"];
student := register['GetStudent',id];
***************
*** 248,258 ****
quizversion := eval(quiz['MakeVersion',seed]);
! history := traperror(quiz['GetHistory',id,seed]);
! if not(type(history,`aim/Quiz/History`)) then
page['SetError',
__("Could not load quiz history for quiz %s and student %s"),
quiz['Name'],
id];
! RETURN();
fi;
--- 254,269 ----
quizversion := eval(quiz['MakeVersion',seed]);
! history := NULL;
! try
! history := quiz['GetHistory',id,seed];
! catch:
! end try;
!
! if not(type([history],[`aim/Quiz/History`])) then
page['SetError',
__("Could not load quiz history for quiz %s and student %s"),
quiz['Name'],
id];
! return();
fi;
|