[LON-CAPA-users] Returning data from excel?

lon-capa-users@mail.lon-capa.org lon-capa-users@mail.lon-capa.org
Mon, 21 May 2007 20:02:45 -0400


I am attacking the problem of wanting to do lab analysis reports on line.

The examples already out there (written in LonCapa) are a problem for my
students in that the student must get all the data input correctly the
first (or second) time. High school students do not do that, they
constantly have to go back and re-enter their data.

I am writing spreadsheets that vaguely look like LonCapa - each data entry
item has an associated box that lights up Red or Green, and indicates
whether this answer is OK or an Error. They have been well trained with the
LonCapa red and green responses:)

The spreadsheets include some macros and a lot of functions to ensure
correct calculations, percent error results, and so on. I am including
security type functions (I have had a couple of students try and hack the
files), as well as "back door" commands to let me see what is going on when
the student has odd results. It is fairly quick to generate these in Excel;
I expect it would be much more time consuming to write in Javascript. It is
all spreadsheet type stuff anyway, although maybe I just think in those
terms. My first attempts have worked very well; it is interesting, because
the students are now forced to do their analysis correctly rather than hand
in the standard garbage. It is great having their analysis already graded,
rather than having to go through all their data and puzzle out where they
went wrong.

It looks like getting the Excel to talk to LonCapa is going to be a
problem. As Guy indicates, pushing between the two isn't very natural.
Somehow LonCapa needs to schedule the Excel spreadsheet so the sheet knows
its parentage, which I don't see how to make work.

So, my current plan is to have a function in the spreadsheet which
generates an "answer code" ONLY when the student gets everything correct.
This answer code is also generated by identical logic in a perl script in
LonCapa (the answer code is computed from the student's LonCapa login and a
string describing the spreadsheet). So, in LonCapa I set up a numeric
response question whose answer is this goofy number. The student solves the
spreadsheet to get the answer code to answer the LonCapa question.

I think this will serve my needs well enough, although not as slick as
having the Excel generated seamlessly from LonCapa.

Thanks,
brew
-----lon-capa-users-admin@mail.lon-capa.org wrote: -----

To: <lon-capa-users@mail.lon-capa.org>
From: "James Sullivan" <SullivanJ@coastal.cc.nc.us>
Sent by: lon-capa-users-admin@mail.lon-capa.org
Date: 05/21/2007 02:48PM
Subject: Re: [LON-CAPA-users] Returning data from excel?

What if you were to use a javascript spreadsheet instead of excel?

Is the "Excel" part of the problem critical, or do you just need the
student to work with some type of spreadsheet program? If you could use a
javascript spreadsheet instead, I'm guessing you could get the spreadsheet
to talk back to the parent problem page without any major portability or
security issues.

Just a thought, Good luck. I'd be interested to hear how this turns out.
Jay


>>> Guy Albertelli II <guy@albertelli.com> 05/21/07 12:55 PM >>>
Hi Brew,

> I am trying to return a string from an Excel spreadsheet to a
> LonCapa problem. I see how James Sullivan is doing this in
> Java, using the construct
>
eval("opener.document.forms.lonhomework.HWVAL_"+responseid+".value="+string);


Well this isn't the important line from his problem. The important
line is the one that sets the value of the string variable since that
is where data move from the java applet into the webpage through the
use of javascript.

That being said:

> Does anyone know of a similar thing in Excel? I anticipate having a
> button on the spreadsheet which is clicked. The code for the button
> would do something like the above...

I suspect having a button in Excel that does this when clicked would
be near impossible, Having a button on the webpage that pulls data
from Excel might be possible, but it will likely be fragile and
requires your students configuring their browsers to be dangerously
open to external attacks.

An example of how one might go about this is documented here:
http://forums.devarticles.com/javascript-development-22/pulling-and-displaying-data-from-excel-spreadsheet-47084.html


As you can see from the example it would require the use of ActiveX to
start and manage the Excel, which means the students need to open the
ability for webpages to opena and run Excel which means now their
computer could easily get hijacked by a malicious webiste which could
all kinds of nasty things to them.

So is it possible... Yes ... but only likely for Windows computers set
to really promiscious modes.

--
guy@albertelli.com   0-7-0-9-27,137
_______________________________________________
LON-CAPA-users mailing list
LON-CAPA-users@mail.lon-capa.org
http://mail.lon-capa.org/mailman/listinfo/lon-capa-users


_______________________________________________
LON-CAPA-users mailing list
LON-CAPA-users@mail.lon-capa.org
http://mail.lon-capa.org/mailman/listinfo/lon-capa-users