Carl,
Happy to help. Another issue with the current setup (I don't know if this was
an issue before) is that the problems are rather slow to load. I don't know
how much it affects students, but debugging the problems becomes a pain. Also,
after you change the source for each problem, it won't reload immediately, you
have to click either reset submissions, new randomization, or leave the problem
and come back in.
It could be done, though I don't know that my solution is very elegant. Keep
in mind that all of my knowledge on this topic is from googling and
experimenting.
I have found that it works best to just have the applet output all of its data
to LON-CAPA so that LON-CAPA knows how to redraw the applet after submission.
This is somewhat complicated by the fact that one doesn't technically know what
GeoGebra will name things. However, they generally name them alphabetically,
points are a,b,c,... and lines are A,B,C,...; it might be useful to use this
for your problem to make it easier to keep the parts separate.
Anyhow, I think you could start by having two customresponses and setting your
update listener to have both (assuming and id="12")
document.lonhomework.elements["HWVAL_11"].value = array_of_data
document.lonhomework.elements["HWVAL_12"].value = array_of_data
where array_of_data is basically a dump of all the coordinates of points,
whether lines were drawn, etc. delimited in someway (commas, semicolons, etc.).
Note that LON-CAPA will receive this a string. Then have the first
customresponse algorithm operate on the data corresponding to the first 3
points and if there was a line (calculate slope, etc.) and the second
customresponse operate on the rest. Maybe something like
x1,y1;x2,y2;x3,y3;is_line_1_drawn:x4,y4;x5,y5;is_line_2_drawn
and have the algorithms start by splitting the string, starting with colons.
Again, this would be rather tedious, and there may be a much better way.
Jacob
From: lon-capa-users-boun...@mail.lon-capa.org
on behalf of Carl Lira
Sent: Thursday, May 5, 2016 11:14:36 PM
To: 'Discussion list for LON-CAPA users'
Subject: Re: [LON-CAPA-users] background image in geogebra
Thank you. Until your help I was unaware of the option to embed custom
problems in loncapa. Bummer that they removed the option to export to html.
I don't like assignments on one server that are dependent on another server
working.
A follow up question. Your example shows a single submission. Can multiple
parts be constructed where students complete one part of a graphical
construction and then move on to a second part that they add to the graph?
How would you suggest I approach that type of multiple part problem? To be
specific, I would like to guide students to first find a particular point
and then draw a line through that point and then add a second line with a
different slope through the same point, so they end up with a distorted X,
where the slope and endpoints of each leg are important.
Carl
-Original Message-
From: lon-capa-users-boun...@mail.lon-capa.org
[mailto:lon-capa-users-boun...@mail.lon-capa.org] On Behalf Of Jacob Bond
Sent: Thursday, May 05, 2016 10:45 PM
To: Discussion list for LON-CAPA users
Subject: Re: [LON-CAPA-users] background image in geogebra
Carl,
I wanted to mention some things that I wish I'd known (and didn't pop up on
Google right away for me):
Since the videos were made, GeoGebra removed the option to export as a
webpage. This option is still in the menu, but it will just make you upload
it to GeoGebraTube. Instead, I uploaded the GeoGebra worksheet to
GeoGebraTube (tube.geogebra.org) and told LON-CAPA where to find the
worksheet. Once the worksheet is uploaded to GeoGebraTube, to embed the
applet in LON-CAPA, I used the second method on this page:
https://www.geogebra.org/manual/en/Reference:Applet_Embedding
I also found the source for this page helpful:
http://archive.geogebra.org/source/program/applet/geogebra_applet_javascript
_test.htm
And these were very helpful:
http://www.geogebra.org/manual/en/Reference:JavaScript
http://www.geogebra.org/manual/en/Reference:Applet_Parameters
Good luck,
Jacob
From: lon-capa-users-boun...@mail.lon-capa.org
on behalf of Carl Lira
Sent: Thursday, May 5, 2016 9:59:56 PM
To: 'Discussion list for LON-CAPA users'
Subject: Re: [LON-CAPA-users] background image in geogebra
Jacob,
Thank you for the links! I will study these.
Carl
-Original Message-
From: lon-capa-users-boun...@mail.lon-capa.org
[mailto:lon-capa-users-boun...@mail.lon-capa.org] On Behalf Of Jacob Bond
Sent: Thursday, May 05, 2016 9:27 PM
To: Discussion list for LON-CAPA users
Subject: Re: [LON-CAPA-users] background image in geogebra