WeBWorK Problems

GeoGebra and list passing

GeoGebra and list passing

by Olivia Henders -
Number of replies: 2
Does anyone have any experience with inserting GeoGebra applets and passing lists to them?

I've created questions with basic applets like the one at http://webwork.maa.org/wiki/GeoGebra1#.WWUnaa1z2Cg, and passing individual values works just fine. However, I'm trying to make a question in which a list gets passed in to populate a graph with values. The issue is that GeoGebra doesn't seem to recognize any sort of list or array that I try to pass in from WeBWorK.

Has anyone found a good way of doing this?
In reply to Olivia Henders

Re: GeoGebra and list passing

by Olivia Henders -
Update: This has been figured out by using https://wiki.geogebra.org/en/Reference:JavaScript

However, I'm wondering if anyone has any tips for running a loop to pass these values in. You can just use multiple setListValue() statements, but that can get lengthy if you're dealing with a long list. For loops within the Javascript don't seem to want to work, though. I'm going to try enclosing the entire Javascript script in a Perl loop to see if that works, but it seems excessive to execute the same script multiple times to set different values each time.

Any simpler ways of doing this?

In reply to Olivia Henders

Re: GeoGebra and list passing

by Michael Gage -
This is probably a question in which it would be helpful to involve some of the geogebra power users (if you know any). If you can post a version of the problem you are trying to construct we might be able to help more explicitly.

There is a relatively new facility for returning a JSON object in the automatic exercise checking on the reference page you have posted but I don't see something that would accept JSON objects. On the other hand there are commands for passing in xml strings and returning them that have been part of geogebra for some time and might be suitable. How useful they are may depend what kind of objects you are trying to construct.

This sounds like a great project -- please keep us informed as to how things work out.

-- Mike