Maple Grading Issues: Grading Sets of Vectors

 

Until 2023 we asked for sets of vectors to be entered as comma-separated lists, without set braces. This has now changed. This document shows how to deal with braces.

The most common question of this type is asking the user to enter a Basis set. The example code below is for this. The following algorithmic definitions are used:

# aij values are defined as the elements of the vectors

# PartMark is the Mark for correct answer w/o braces

$PartMark=0.9;
$Penalty=1-$PartMark;
$PMPer=100*$PartMark;    # Use this if you use the Feedback prompt (see below).


The code:


# Convert response to string to search for braces
 


B0:="$RESPONSE";   

M:=0;

if (SearchText("{",B0)>0) and (SearchText("}",B0)>0) then

      # Give the part mark for braces, then remove braces.

   M:=$Penalty;  
   B1A:=StringTools:-Substitute(B0,"{","");
   B1:=StringTools:-Substitute(B1A,"}","");
else

   # No braces, proceed to mark vectors.

   B1:=B0;
end if;

Bf:=parse(B1);

if IsBasis(<<$a11,$a21,$a31>|<$a12,$a22,$a32>|<$a13,$a23,$a33>>,[Bf],basistype=column) then
   M:=M+(1-$Penalty);
end if;

M;

You can also add a prompt at the bottom of Feedback, telling the student about part marks:

<hr />
<p style="text-align: center;"><span style="font-size:9px;">
If you omitted the {set braces} but were otherwise correct you recieved $PMPer% of the mark.
</span></p>

 

Maple Grading Issues Index

Main Index

Last updated: 2023/04/10 SS/DAG