From: Chris S. <san...@us...> - 2005-07-14 16:18:28
|
Update of /cvsroot/stack/stack-1-0/scripts/maxima In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8501/scripts/maxima Modified Files: stackmaxima.mac Log Message: Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/stackmaxima.mac,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** stackmaxima.mac 14 Jul 2005 12:53:41 -0000 1.19 --- stackmaxima.mac 14 Jul 2005 16:18:19 -0000 1.20 *************** *** 306,326 **** */ Stack_Test(SA,SB) := ! BLOCK([KEEPFLOAT,DEMOIVRE,TRIGEXPAND,LOGEXPAND,exp], ! DEMOIVRE:TRUE, /* See pg 24 */ TRIGEXPAND:TRUE, /* See pg 80 */ LOGEXPAND:SUPER, KEEPFLOAT:TRUE, /* See pg 23 */ ! exp:trigreduce(SA-SB), ! if floatnump(exp) then RETURN(FALSE), ! exp:trigsimp(exp), ! if fullratsimp(exp)=0 then RETURN(TRUE) else RETURN(FALSE) )$ /* An answer test based on Stack_Test for the a> flag. */ ATAlgEquiv(SA,SB) := ! BLOCK([KEEPFLOAT,DEMOIVRE,TRIGEXPAND,RawMark,FeedBack,AnswerNote,str], RawMark:0, FeedBack:"", AnswerNote:"", KEEPFLOAT:TRUE, /* See pg 23 */ - DEMOIVRE:TRUE, /* See pg 24 */ /* Are we dealing with matrices? */ if matrixp(SB) then --- 306,324 ---- */ Stack_Test(SA,SB) := ! BLOCK([KEEPFLOAT,TRIGEXPAND,LOGEXPAND,ex], TRIGEXPAND:TRUE, /* See pg 80 */ LOGEXPAND:SUPER, KEEPFLOAT:TRUE, /* See pg 23 */ ! ex:trigreduce(trigexpand(trigrat(SA-SB))), ! if floatnump(ex) then RETURN(FALSE), ! exp:trigsimp(ex), ! if fullratsimp(ex)=0 then RETURN(TRUE) else RETURN(FALSE) )$ /* An answer test based on Stack_Test for the a> flag. */ ATAlgEquiv(SA,SB) := ! BLOCK([KEEPFLOAT,RawMark,FeedBack,AnswerNote,str], RawMark:0, FeedBack:"", AnswerNote:"", KEEPFLOAT:TRUE, /* See pg 23 */ /* Are we dealing with matrices? */ if matrixp(SB) then *************** *** 342,351 **** return(ATSet(SA,SB)), /* Otherwise */ - exp:trigreduce(SA-SB), - if exp=0.0 then AnswerNote:", Floating point zero found", if Stack_Test(SA,SB) then ! (RawMark:1, AnswerNote:CONCAT(AnswerNote,"Correct")) ! else ! AnswerNote:CONCAT("Incorrect",AnswerNote), str:StackReturnOb("true",STRING(RawMark),AnswerNote,FeedBack), RETURN(str) --- 340,345 ---- return(ATSet(SA,SB)), /* Otherwise */ if Stack_Test(SA,SB) then ! RawMark:1, str:StackReturnOb("true",STRING(RawMark),AnswerNote,FeedBack), RETURN(str) *************** *** 353,362 **** Stack_Matrix_Test(SA,SB) := ! BLOCK([KEEPFLOAT,DEMOIVRE,TRIGEXPAND,SAr,SAc,SBr,SBc,ZM], SAr : length(SA), SAc : length(SA[1]), SBr : length(SB), SBc : length(SB[1]), - DEMOIVRE:TRUE, /* See pg 24 */ TRIGEXPAND:TRUE, /* See pg 80 */ LOGEXPAND:SUPER, --- 347,355 ---- Stack_Matrix_Test(SA,SB) := ! BLOCK([KEEPFLOAT,TRIGEXPAND,SAr,SAc,SBr,SBc,ZM], SAr : length(SA), SAc : length(SA[1]), SBr : length(SB), SBc : length(SB[1]), TRIGEXPAND:TRUE, /* See pg 80 */ LOGEXPAND:SUPER, *************** *** 395,399 **** /* An answer test based on two matrices for SA and SB */ ATMatrix(SA,SB):= ! BLOCK([KEEPFLOAT,DEMOIVRE,TRIGEXPAND,RawMark,FeedBack,AnswerNote,str,SAr,SAc,SBr,SBc,ZM], RawMark:1, FeedBack:"", AnswerNote:"", /* Get sizes of matrices */ --- 388,392 ---- /* An answer test based on two matrices for SA and SB */ ATMatrix(SA,SB):= ! BLOCK([RawMark,FeedBack,AnswerNote,str,SAr,SAc,SBr,SBc,ZM], RawMark:1, FeedBack:"", AnswerNote:"", /* Get sizes of matrices */ *************** *** 422,426 **** /* An answer test based on two lists for SA and SB */ ATSet(SA,SB):= ! BLOCK([KEEPFLOAT,DEMOIVRE,TRIGEXPAND,RawMark,FeedBack,AnswerNote,str,SAl,SBl,ZM], RawMark:1, FeedBack:"", AnswerNote:"", /* Get sizes of matrices */ --- 415,419 ---- /* An answer test based on two lists for SA and SB */ ATSet(SA,SB):= ! BLOCK([RawMark,FeedBack,AnswerNote,str,SAl,SBl,ZM], RawMark:1, FeedBack:"", AnswerNote:"", /* Get sizes of matrices */ *************** *** 444,451 **** /* An answer test based on the Maxima's notion of equals. */ ATCASEqual(SA,SB) := ! BLOCK([KEEPFLOAT,DEMOIVRE,TRIGEXPAND,RawMark,FeedBack,AnswerNote,str], RawMark:0, FeedBack:"", AnswerNote:"", KEEPFLOAT:TRUE, /* See pg 23 */ - DEMOIVRE:TRUE, /* See pg 24 */ if SA=SB then (RawMark:1, AnswerNote:"Correct" ) --- 437,443 ---- /* An answer test based on the Maxima's notion of equals. */ ATCASEqual(SA,SB) := ! BLOCK([KEEPFLOAT,RawMark,FeedBack,AnswerNote,str], RawMark:0, FeedBack:"", AnswerNote:"", KEEPFLOAT:TRUE, /* See pg 23 */ if SA=SB then (RawMark:1, AnswerNote:"Correct" ) *************** *** 567,574 **** /* An answer test based expandp(sa). */ ATExpanded(SA) := ! BLOCK([KEEPFLOAT,DEMOIVRE,TRIGEXPAND,RawMark,FeedBack,AnswerNote,str], RawMark:0, FeedBack:"", AnswerNote:"", KEEPFLOAT:TRUE, /* See pg 23 */ - DEMOIVRE:TRUE, /* See pg 24 */ if expandp(SA) then RETURN(StackReturnOb("true","1","Correct","")) --- 559,565 ---- /* An answer test based expandp(sa). */ ATExpanded(SA) := ! BLOCK([KEEPFLOAT,RawMark,FeedBack,AnswerNote,str], RawMark:0, FeedBack:"", AnswerNote:"", KEEPFLOAT:TRUE, /* See pg 23 */ if expandp(SA) then RETURN(StackReturnOb("true","1","Correct","")) *************** *** 584,588 **** /* SBL is a list: the teacher's answer, the variable, and whether formative feedback is to be provided. */ if listp(SBL) then (SB:SBL[1], v:SBL[2], quiet:SBL[3]) else ! RETURN(StackReturnOb("false","0","ATFacForm_error_list",StackAddFeedback("","ATFacForm_error_list"))), /* If we don't have an atom as the teacher's variable, then we need to make a substitution */ if atom(v)#TRUE then (SA:subst(facdum,v,SA),SB:subst(facdum,v,SB),v:facdum), --- 575,579 ---- /* SBL is a list: the teacher's answer, the variable, and whether formative feedback is to be provided. */ if listp(SBL) then (SB:SBL[1], v:SBL[2], quiet:SBL[3]) else ! RETURN(StackReturnOb("false","0","ATFacForm_error_list",StackAddFeedback("","ATPartFrac_error_list"))), /* If we don't have an atom as the teacher's variable, then we need to make a substitution */ if atom(v)#TRUE then (SA:subst(facdum,v,SA),SB:subst(facdum,v,SB),v:facdum), *************** *** 601,605 **** /* sa is the students' ansewer, sbl is a list consisting of (1) the integrand, and (2) the variable */ ATInt(sa,sbl) := ! BLOCK([KEEPFLOAT,DEMOIVRE,RawMark,FeedBack,AnswerNote,str,da,db,dd,dc,sb,var,cont,ans], RawMark:0, FeedBack:"", AnswerNote:"", /* SBL is a list: the teacher's answer, the variable, and whether formative feedback is to be provided. */ --- 592,596 ---- /* sa is the students' ansewer, sbl is a list consisting of (1) the integrand, and (2) the variable */ ATInt(sa,sbl) := ! BLOCK([KEEPFLOAT,RawMark,FeedBack,AnswerNote,str,da,db,dd,dc,sb,var,cont,ans,ex], RawMark:0, FeedBack:"", AnswerNote:"", /* SBL is a list: the teacher's answer, the variable, and whether formative feedback is to be provided. */ *************** *** 607,616 **** ( cont:FALSE, FeedBack:StackAddFeedback("","ATInt_error_list"), AnswerNote:"ATInt_error_list"), KEEPFLOAT:TRUE, /* See pg 23 */ - DEMOIVRE:TRUE, /* See pg 24 */ if cont then (ans : int(sb,var), da:diff(sa,var), db:diff(sb,var), ! dd:float(fullratsimp(sa-ans)), dc:numberp(dd) and dd#0.0, if Stack_Test(da,sb) then --- 598,607 ---- ( cont:FALSE, FeedBack:StackAddFeedback("","ATInt_error_list"), AnswerNote:"ATInt_error_list"), KEEPFLOAT:TRUE, /* See pg 23 */ if cont then (ans : int(sb,var), da:diff(sa,var), db:diff(sb,var), ! ex:trigreduce(trigexpand(trigrat(sa-ans))), ! dd:float(ex), dc:numberp(dd) and dd#0.0, if Stack_Test(da,sb) then *************** *** 634,638 **** /* sa is the students' ansewer, sbl is a list consisting of (1) the integrand, and (2) the variable */ ATDiff(sa,sbl) := ! BLOCK([KEEPFLOAT,DEMOIVRE,TRIGEXPAND,RawMark,FeedBack,AnswerNote,str,da,db,dd,dc,sb,var,cont], RawMark:0, FeedBack:"", AnswerNote:"", /* SBL is a list: the teacher's answer, the variable, and whether formative feedback is to be provided. */ --- 625,629 ---- /* sa is the students' ansewer, sbl is a list consisting of (1) the integrand, and (2) the variable */ ATDiff(sa,sbl) := ! BLOCK([KEEPFLOAT,RawMark,FeedBack,AnswerNote,str,da,db,dd,dc,sb,var,cont], RawMark:0, FeedBack:"", AnswerNote:"", /* SBL is a list: the teacher's answer, the variable, and whether formative feedback is to be provided. */ *************** *** 640,644 **** ( cont:FALSE, FeedBack:StackAddFeedback("","ATDiff_error_list"), AnswerNote:"ATDiff_error_list"), KEEPFLOAT:TRUE, /* See pg 23 */ - DEMOIVRE:TRUE, /* See pg 24 */ if cont then ( --- 631,634 ---- |