Subject: RE: [LON-CAPA-dev] 11-15-2005 meeting notes

From: "GARRETT, DONNELL MAZON" <[email-masked]>
Date: Wed, 16 Nov 2005 17:16:40 -0500

Okay.. lemme get this straight

External response POSTs an http query to a specific url..  this url will
be a link to a cgi form..  the cgi form runs what ever "value pairs" the
problem sends, the text from the student's answer, and the problem's
answer.  

This is then returned as:
<loncapagrade>
  <awarddetail>EXACT_ANS</awarddetail>
  <message>Message to student</message>
</loncapagrade>

Where lon-capa can then detect whether the student was correct or not
and assign credit where credit is due.

My question is this:  
Let's say we had a situation where the cgi script (I seem to remember
this needing a cgi script from one of our past discussions) was to run
the math solver of our choice (oh.. I dunno.. let's say Maple).
Can we POST 1) the text from the student, 2) the Maple script to solve
the problem
Can whatever the outcome of the maple script be checked against what the
student's text is to verify that the student is correct? (or is that the
cgi script's job?)
Can the student's answer be tested against more that one answer from
Maple? (let's say, a complex number in rectangular form and the same
number in polar form and having both be shown as correct when either is
inputted as an answer)
Or am I totally confused??

Thanks
Donnell 
-----Original Message-----
From: [email-masked]
[mailto:[email-masked]] On Behalf Of Guy
Albertelli II
Sent: Wednesday, November 16, 2005 4:34 PM
To: [email-masked]
Subject: Re: [LON-CAPA-dev] 11-15-2005 meeting notes

Hi Donnell,

> I was forwarded this question:
> 
> I wonder:  If Lon-CAPA can communicate via COM and XML docs, it might
> even be possible to use a tool like Matlab or Mathcad or Maple to let
> the students enter math expressions and do any symbolic processing on
> them, then let Lon-CAPA evaluate if the correct answer was entered.
Then
> we get the best of both worlds because we already have licenses for
the
> various math engines.
> -Roger Dougal
> 
> I don't know the answer
> What should I reply with?
> 
> I was under the understanding that the external response would allow
for
> external solving, however how this is done I don't know yet.  Via COM?
I
> dunno.. I assume that XML docs can be used (since that's how
.problem's
> are constructed anyway).  I haven't had time to mess with external
> response yet.

It is done through HTTP (we submit a http POST request to a specifed
url with 
- any key/value pairs the problem wants to send
- the text of the student's submission
- the problem's answer

We then expect back an xml response that looks like:

<loncapagrade>
  <awarddetail>EXACT_ANS</awarddetail>
  <message>Message to student</message>
</loncapagrade>

Current valid possible awards are: (some of these may not make sense
in this context, and if we need new ones they aren't hard to add)

MISSING_ANSWER
ERROR
NO_RESPONSE
TOO_LONG
UNIT_INVALID_INSTRUCTOR
UNIT_INVALID_STUDENT
UNIT_IRRECONCIBLE
UNIT_FAIL
NO_UNIT
UNIT_NOTNEEDED
WANTED_NUMERIC
BAD_FORMULA
SIG_FAIL
INCORRECT 
MISORDERED_RANK
INVALID_FILETYPE
DRAFT
SUBMITTED
ASSIGNED_SCORE
APPROX_ANS
EXACT_ANS
COMMA_FAIL 

-- 
[email-masked]   0-7-2-0-27,137
_______________________________________________
LON-CAPA-dev mailing list
[email-masked]
http://mail.lon-capa.org/mailman/listinfo/lon-capa-dev

---

From: Guy Albertelli II <[email-masked]>
Date: Wed, 16 Nov 2005 18:39:18 -0500 (EST)

Hi Donnell,

> this needing a cgi script from one of our past discussions)

It needs anything that can accept a HTTP POST request. (Generally this
is accomplished with a webserver running some a cgi script, but it
doesn't have to be.)

> was to run

> - the text of the student's submission

This is the complet text that student put in the the html page.

> - the problem's answer

This will be whatever you set the answer="" to in the response. This
could be a complete Maple script. It could be the gettysburg address,
it could be the complete source code to mozilla. It's whatever you set
the answer to.

> - any key/value pairs the problem wants to send

We will also send the complet contents of a Perl hash along. This
could contains whatever you want to put into a perl hash.

A really simple (maybe to simple?) perl script that could be on the
receiving end of things is this one:
http://zaphod.lite.msu.edu/cgi-bin/cvsweb.cgi/loncom/homework/gradesubmission.pl?rev=1.2

> student's text is to verify that the student is correct? (or is that the

The cgi script _MUST_ return something that says 'INCORRECT' or
'EXACT_ANS' so the cgi script must decide whther the studnet is
correct or not.

> number in polar form and having both be shown as correct when either is

You can do what ever the heck you want in the cgi script.

You have the student's reponse, and any contextual information you
want to provide. 

You can do _ANYTHING_ you want with these two things.

I just need to know if you decided if it was right or wrong. (or
possibly the student subbmtied something horribly malformed)