[LON-CAPA-users] Quick Question

Harding, Gene L glhardin at purdue.edu
Wed Mar 4 08:44:41 EST 2020


Hi,

I have a question about accessing submissions using the &submission() function.

I am working on a problem interfacing with Geogebra that will have a variable number of submission inputs, depending on the randomization of the problem. The code in the customresponse section is relatively short and straightforward, so I just used an array to load the values. Someone at last year's conference suggested this approach, and it works well, creating an array of the appropriate size for the submission:
[cid:image002.jpg at 01D5F201.23A73F30]

The code in the primary block of Perl script, however, is more complicated, so I have been using discrete variables with names that make it easier to read, follow, and troubleshoot the code:
[cid:image006.jpg at 01D5F201.23A73F30]
I have found that I can include the unused variables, which in the above case are all of the variables beginning with $A2, and LON-CAPA just ignores those variables with no apparent ill effects. Is that a reasonable and "safe" way to write the code, or I am asking for trouble using this approach?

Best regards,

Gene L. Harding, PE
Associate Professor of ECET
Purdue University
574-520-4190
https://polytechnic.purdue.edu/south-bend/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20200304/408d8ac1/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 2238 bytes
Desc: image002.jpg
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20200304/408d8ac1/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.jpg
Type: image/jpeg
Size: 17635 bytes
Desc: image006.jpg
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20200304/408d8ac1/attachment-0003.jpg>


More information about the LON-CAPA-users mailing list