[LON-CAPA-users] coding a customresponse problem using &cas()
Justin Gray
jgray at math.sfu.ca
Tue May 26 20:19:44 EDT 2015
Hi Peter,
Thanks very much for pointing me to this example. I like the layout very
much. It makes the input easy for students. This would make a nice template
for those problems where the dimensions of the matrix were specified in
advance.
Best,
Justin
Justin Gray | Senior Lecturer
Department of Mathematics | Simon Fraser University
8888 University Drive, Burnaby | V5A 1S6 | Canada
Tel: +1 778.782.4237
On Tue, May 26, 2015 at 7:45 AM, Peter Riegler <p.riegler at ostfalia.de>
wrote:
> Hi Justin,
>
> maybe
> /res/fhwf/riegler/Mathematik/Lineare
> Algebra/Matrizen/matrix_mit_rang_angeben.problem
> could serve as a template.
> I agree, the code looks horrible. Essentially it does
> 1. read out the matrix values from the html textfields
> 2. make a maxima-formatted matrix out of that
> 3. compute the rank of that matrix
> Steps 2 und 3 are done by getMatrixRang in the library
> /res/fhwf/riegler/Mathematik/Lineare Algebra/Libraries/matrix.library
>
> sub getMatrixRang {
> my ($mat) = @_;
> my @matrix = @$mat;
> my $str = "matrix(";
> foreach my $ref_zeile (@matrix) {
> my $zeile = join( ',', @$ref_zeile );
> $str .= "[$zeile],";
> }
> $str =~ s/,$/)/g;
> $str = "rank($str);";
> $rank = &main::cas('maxima',"$str");
> return $rank;
> }
>
> I suppose it should suffice to change the last three lines to
> $checkifidempotent = "is($str . $str = $str);"; # $str is the
> student provided matrix formatted in maxima
> $isidempotent = &main::cas('maxima',"$checkifidempotent");
> and then check whether $isidempotent is "true" or "false".
>
> Sorry that I don't test the code myself. Other obligations are calling...
>
> One final comment, though:
>
> On 26.05.2015 03:49, Justin Gray wrote:
>
> P.S. Ideally, I would like to stipulate that students provide a
>> nontrivial example (excluding the zero matrix and the identity matrix)
>> but that is the topic of another discussion.
>>
>> I had similar concerns when I specified the "give me an example of a
> matrix of given rank"-problem on which the above is based. Based on
> occasional checks it seems that at least in my linear algebra class almost
> no student comes up with trivial solutions (echelon forms in this case). I
> guess it takes some familiarity with a concept and some time to be able to
> come up with trivial solutions.
>
> Peter
>
>>
>> Justin Gray | Senior Lecturer
>> Department of Mathematics | Simon Fraser University
>> 8888 University Drive, Burnaby | V5A 1S6 | Canada
>> Tel: +1 778.782.4237
>>
>>
>>
>>
>> _______________________________________________
>> LON-CAPA-users mailing list
>> LON-CAPA-users at mail.lon-capa.org
>> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
>>
>>
> --
> Peter Riegler
> Ostfalia Hochschule für angewandte Wissenschaften
> Hochschule Braunschweig/Wolfenbüttel
> Salzdahlumer Str. 46/48
> 38302 Wolfenbüttel
>
> Fakultät Informatik
> Fon: ++49 5331 939 31540
> http://ostfalia.de/pws/riegler
>
> Zentrum für erfolgreiches Lehren und Lernen
> Fon: ++49 5331 939 17200
> http://www.ostfalia.de/zell
>
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users at mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20150526/6e34834e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SFU_2012_email_sig.jpg
Type: image/jpeg
Size: 8910 bytes
Desc: not available
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20150526/6e34834e/attachment-0001.jpg>
More information about the LON-CAPA-users
mailing list