[LON-CAPA-users] Quick Question

Harding, Gene L glhardin at purdue.edu
Wed Mar 4 09:17:26 EST 2020

Hi Mark,

In the customresponse section, the array created matches the size of the submission. It's the Perl script I was wondering about. The number of variables defined in the Perl script to capture the submission will ultimately be 76, but the actual number of submission elements will vary from 20 to 76, depending on the randomization. The predefined variables to capture the submission elements will usually "outnumber" the actual submission elements. 

In my experience so far, those extra variables do not get used/initialized. When I try to display them in the problem statement (for debugging purposes) they do not have values, just show up as literals, e.g., "$A2plus_tailx" instead of some numeric value. Does that make sense?


Gene L. Harding, PE
Associate Professor of ECET
Purdue University

-----Original Message-----
From: LON-CAPA-users <lon-capa-users-bounces at mail.lon-capa.org> On Behalf Of Lucas, Mark
Sent: Wednesday, March 4, 2020 8:57 AM
To: Discussion list for LON-CAPA users <lon-capa-users at mail.lon-capa.org>
Subject: Re: [LON-CAPA-users] Quick Question

My gut says that is not a problem. Since you are grading it in the customresponse, you just ignore those parts of the array if they do contain useful information.
They will be saved as part of the “submission” record for the student, but that shouldn’t be a problem.


> On Mar 4, 2020, at 8:44 AM, Harding, Gene L <glhardin at purdue.edu> wrote:
> 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:
> <image002.jpg>
> 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:
> <image006.jpg>
> 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/
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users at mail.lon-capa.org
> https://nam03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmail.
> lon-capa.org%2Fmailman%2Flistinfo%2Flon-capa-users&data=02%7C01%7C
> lucasm%40ohio.edu%7C269ca88417f8491a9cf108d7c042612a%7Cf3308007477c4a7
> 0888934611817c55a%7C0%7C0%7C637189263646163217&sdata=FbYNztkeBq0Q0
> Cfz%2BU4pX7xL74HzWKpwcuuLKuQO4jg%3D&reserved=0

Mark Lucas 								email: lucasm at ohio.edu
252D Clippinger Lab						phone: (740)597-2984
Department of Physics and Astronomy			fax: (740)593-0433
Ohio University
Athens, OH 45701

LON-CAPA-users mailing list
LON-CAPA-users at mail.lon-capa.org

More information about the LON-CAPA-users mailing list