Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim/analyze
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16947/maple/aim/analyze
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/analyze/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:14 -0000 1.2.10.1
***************
*** 137,141 ****
analysis := NULL;
if p["Action"] = "AnalyzeSubject" then
! analysis := traperror(eval(subject['GetAnalysis']));
fi;
--- 137,144 ----
analysis := NULL;
if p["Action"] = "AnalyzeSubject" then
! try
! analysis := eval(subject['GetAnalysis']);
! catch:
! end try;
fi;
***************
*** 143,147 ****
register := subject['GetRegister'];
ids := map(op,[indices(eval(register['IDTable']))]);
! analysis := traperror(eval(subject['Analyze']));
if not(type([analysis],[`aim/Subject/Analysis`])) then
page['SetError',
--- 146,153 ----
register := subject['GetRegister'];
ids := map(op,[indices(eval(register['IDTable']))]);
! try
! analysis := eval(subject['Analyze']);
! catch:
! end try;
if not(type([analysis],[`aim/Subject/Analysis`])) then
page['SetError',
Index: Question.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/analyze/Question.mpl,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -C2 -d -r1.4 -r1.4.2.1
*** Question.mpl 11 Mar 2004 13:39:43 -0000 1.4
--- Question.mpl 31 Mar 2005 12:38:13 -0000 1.4.2.1
***************
*** 228,234 ****
quizname := p["QuizName"];
! quiz := traperror(eval(subject['GetQuiz',quizname]));
!
! if not(type(quiz,`aim/Quiz`)) then
page['SetError',
__("Could not load quiz: %s"),
--- 228,238 ----
quizname := p["QuizName"];
! quiz := NULL;
! try
! quiz := eval(subject['GetQuiz',quizname]);
! catch:
! end try;
!
! if not(type([quiz],[`aim/Quiz`])) then
page['SetError',
__("Could not load quiz: %s"),
***************
*** 239,255 ****
questionname := p["QuestionName"];
partlabel := p["PartLabel"];
! question := traperror(quiz['GetQuestion',questionname,partlabel]);
!
! if not(type(question,`aim/Question`)) then
page['SetError',
__("Could not load question: %s"),
quizname];
! RETURN();
fi;
analysis := NULL;
if p["Action"] = "AnalyzeQuestion" then
! analysis :=
! traperror(eval(quiz['GetQuestionAnalysis',questionname,partlabel]));
fi;
--- 243,266 ----
questionname := p["QuestionName"];
partlabel := p["PartLabel"];
! question := NULL;
! try
! question := quiz['GetQuestion',questionname,partlabel];
! catch:
! end try;
!
! if not(type([question],[`aim/Question`])) then
page['SetError',
__("Could not load question: %s"),
quizname];
! return();
fi;
analysis := NULL;
if p["Action"] = "AnalyzeQuestion" then
! try
! analysis :=
! eval(quiz['GetQuestionAnalysis',questionname,partlabel]);
! catch:
! end try;
fi;
Index: Quiz.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/analyze/Quiz.mpl,v
retrieving revision 1.3
retrieving revision 1.3.6.1
diff -C2 -d -r1.3 -r1.3.6.1
*** Quiz.mpl 25 Aug 2003 21:47:19 -0000 1.3
--- Quiz.mpl 31 Mar 2005 12:38:14 -0000 1.3.6.1
***************
*** 132,137 ****
subject := eval(page['Subject']);
quizname := p["QuizName"];
! quiz := traperror(eval(subject['GetQuiz',quizname]));
!
if not(type([quiz],[`aim/Quiz`])) then
page['SetError',
--- 132,141 ----
subject := eval(page['Subject']);
quizname := p["QuizName"];
! quiz := NULL;
! try
! quiz := eval(subject['GetQuiz',quizname]);
! catch:
! end try;
!
if not(type([quiz],[`aim/Quiz`])) then
page['SetError',
***************
*** 143,147 ****
analysis := NULL;
if p["Action"] = "AnalyzeQuiz" then
! analysis := traperror(eval(quiz['GetAnalysis']));
fi;
--- 147,154 ----
analysis := NULL;
if p["Action"] = "AnalyzeQuiz" then
! try
! analysis := eval(quiz['GetAnalysis']);
! catch:
! end try;
fi;
***************
*** 149,153 ****
register := eval(subject['GetRegister']);
ids := map(op,[indices(eval(register['IDTable']))]);
! analysis := traperror(eval(quiz['Analyze',ids,eval(register)]));
if not(type([analysis],[`aim/Quiz/Analysis`])) then
page['SetError',
--- 156,163 ----
register := eval(subject['GetRegister']);
ids := map(op,[indices(eval(register['IDTable']))]);
! try
! analysis := eval(quiz['Analyze',ids,eval(register)]);
! catch:
! end try;
if not(type([analysis],[`aim/Quiz/Analysis`])) then
page['SetError',
|