Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22612/WEB-INF/maple/aim
Modified Files:
Question.mpl
Log Message:
makes sure that a student's mark can never go down with further attempts.
Index: Question.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Question.mpl,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Question.mpl 10 Oct 2003 09:49:31 -0000 1.9
--- Question.mpl 28 Jan 2004 20:52:11 -0000 1.10
***************
*** 1551,1555 ****
startix, # the index of the first correct attempt, if any;
# otherwise, the index of the latest valid attempt,
! # if any; otherwise 0.
a,r,b,bstring,i,mark,msg;
--- 1551,1556 ----
startix, # the index of the first correct attempt, if any;
# otherwise, the index of the latest valid attempt,
! # if any; otherwise 0,
! maxmark, # highest mark on previous attempts.
a,r,b,bstring,i,mark,msg;
***************
*** 1575,1578 ****
--- 1576,1597 ----
n := nops(attempts);
marks := map(x -> x['RawMark'],attempts);
+
+ #####################################################
+ # The following will calculate the adjusted marks of
+ # all previous attempts and keep the maximum in maxmark.
+ # We will later use maxmark to make sure that the new
+ # adjusted mark is not less than this.
+ # GWD
+
+ startix := n;
+ maxmark := 0; # the maximum mark
+ b := 0; # b is the number of valid but incorrect attempts before startix
+ while (startix > 0) do
+ maxmark := max(0., marks[startix] - b * p, maxmark);
+ b := b+1;
+ startix := startix-1;
+ end do;
+
+ #####################################################
isvalid := attempts[1]['IsValid'];
***************
*** 1718,1721 ****
--- 1737,1752 ----
fi; # matches if wasright then ...
+ ###############################################################
+ # Now we will make sure that the new adjusted mark is not less
+ # then previous asjusted marks.
+ # GWD
+ if (mark < maxmark) then
+ msg := cat(msg,
+ sprintf(" On a previous attempt you obtained a mark of %.2f. AiM doesn't want your new mark to be less than your best mark on a previous attempt and thus your overall mark is kept at %.2f. ",
+ maxmark,maxmark));
+ mark := maxmark;
+ end if;
+ ###############################################################
+
this['Mark'] := mark;
this['MarkMessage'] := msg;
|