[LON-CAPA-users] {Disarmed} Re: Having javascript variables persist through submission

Mills, Douglas G dmills at illinois.edu
Mon Mar 7 10:30:34 EST 2016

HI Jacob,

I haven't worked with GeoGebra so may be missing something, but for other things I've done, I've sometimes added a part that the students don't see, set the weight to 0 and used responses with hiddenline boxes as in the tutorial to store information. This has the unfortunate consequence though of potentially confusing students if they look at an interface that shows them that there were 4 parts when in fact they see only three.

Alternatively, more recently I've used a custom response to store additional information in a part that the students DO see but use the customresponse processing to check their answer only against the relevant part of the submission.  Here's an example:

<customresponse answerdisplay="$key" id="11">
<answer type="loncapa/perl" id="1_8">if (substr($submission,0,5)==$key) {return 'EXACT_ANS'; }
return 'INCORRECT';</answer>
    <hiddenline />

In this case, I control the submission from my JavaScript widget and know that it will be exactly 5 characters long, so I'm comparing only the first give characters of the student submission against the correct answer (and showing the correct answer in the answer display) but I have additional information stored after the first five characters of the submission which I'm using to reset the display to match the student's submission.  If you'll have a variable number of characters in the correct answer, I would think you could add a special character of some kind following their submission (: or | for example?) and then use that to delineate where their answer stops and your data starts.


Douglas Mills
Director of Instructional Technology
Department of Chemistry
University of Illinois

From: <lon-capa-users-bounces at mail.lon-capa.org<mailto:lon-capa-users-bounces at mail.lon-capa.org>> on behalf of Jacob Bond <bond13 at purdue.edu<mailto:bond13 at purdue.edu>>
Reply-To: Discussion list for LON-CAPA users <lon-capa-users at mail.lon-capa.org<mailto:lon-capa-users at mail.lon-capa.org>>
Date: Sunday, March 6, 2016 at 12:13 PM
To: "lon-capa-users at mail.lon-capa.org<mailto:lon-capa-users at mail.lon-capa.org>" <lon-capa-users at mail.lon-capa.org<mailto:lon-capa-users at mail.lon-capa.org>>
Subject: [LON-CAPA-users] Having javascript variables persist through submission

I am working on using GeoGebra for having students do graphing (for example using this app:


I would like to have the graph persist after submission as in the tutorial videos (


<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.lon-2Dcapa.org_geogebraTutorial.html&d=BQMFAw&c=8hUWFZcy2Z-Za5rBPlktOQ&r=lm_7ZS7-EAc__llGmOcR7rpM4OG1Bat_vcdWNBw5ZVA&m=FYWeWpOjYT9pl0KX39HAaD0CJ-vEHamKvkMvZiAiIoc&s=qExMMDR36H5tiaIZT7X4y0FWOjHkyBBCT3RFS6FANpk&e=>see especially video 3B)

However, I am checking the slope and x-intercept and so I don't have a submission box to store the coordinates of the points when the graph is submitted.  Is there another way to keep the values, like setting them as a variable for Perl or something?

Thank you,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20160307/62e45a18/attachment.html>

More information about the LON-CAPA-users mailing list