Forum archive 2000-2006

Andy Wildenberg - executing a POST from WebWork

Andy Wildenberg - executing a POST from WebWork

by Arnold Pizer -
Number of replies: 0
inactiveTopicexecuting a POST from WebWork topic started 2/2/2001; 9:14:57 PM
last post 2/3/2001; 11:03:25 AM
userAndy Wildenberg - executing a POST from WebWork  blueArrow
2/2/2001; 9:14:57 PM (reads: 1270, responses: 3)
Is there any way that you can imbed a link that does a POST from within a WebWork problem? I have another web-based system that I would like have the students link to. I would like to pass the ID as well as a confirmation ticket to the other system, and a POST would be the best way to do it. If POST won't work, I probably could settle for the htmllink command to do a GET, but the information would be passed more in the "clear" since it would appear in the URL.

<| Post or View Comments |>


userMichael Gage - Re: executing a POST from WebWork  blueArrow
2/2/2001; 10:31:26 PM (reads: 1500, responses: 0)
Currently there is no easy way to do a POST command, that I can think of. The best you can do is a GET command triggered by something like

\{htmlLink("http://www.cba.com/test.pl?firsttag=firstarg&nexttag=nextarg", "external link")\}

If you try to include a form in a problem, I think that you will get an error, since the entire problem is already a form. I have not expermented extensively with this however. It's an interesting idea.

<| Post or View Comments |>


userAndy Wildenberg - Re: executing a POST from WebWork  blueArrow
2/3/2001; 10:36:26 AM (reads: 1522, responses: 0)
I was sort of afraid of that. How about this: what is the format of the POST command that you need to generate to be equivalent to answering a question. My first question was essentially "how do you fire my servlet from WebWork" and this question is really "what can my servlet send WebWork so that it will register that a student has completed a problem?"

It looks like the individual answers are just keys of AnSwEr# where # is the #'th answer. But are all the other hidden keys required? Specifically, are the "key" and "source" fields required? I assume so. Do their values appear in any WebWork environment variables (so they can be encoded into a URL). I think that all the others are already in environment variables. Is there any way to recreate them from scratch (since key is big and source is huge)?

<| Post or View Comments |>


userMichael Gage - Re: executing a POST from WebWork  blueArrow
2/3/2001; 11:03:25 AM (reads: 1581, responses: 0)
The "source" field is not required, and in fact it only occurs for users of webwork with "professor" privelages. (It is used to allow editing of a problem through the browser.) The "key" is required and is simply a time limited password. This reduces the number of times the login password is transmitted, and it also insures that if a student leaves a browser open at a public work station, eventually they will be automatically logged out. It is generated randomly, so it can't be reconstructed.

All of the values returned by the "problem" form are available within a webwork problem in the reference hash "$inputs_ref" (see http://webhost.math.rochester.edu/webworkdocs/docs/pglanguage/reference/environmentvariables).

It is also possible to call an applet from a problem and using javaScript to include the output of the applet in the information that is returned to WeBWorK. No one has actually implemented this yet, so I can't point to an example, but you can look for appletLink on http://webhost.math.rochester.edu/webworkdocs/docs/pglanguage/pod/PGbasicmacros in order to get started. Perhaps this would help in your situation.

<| Post or View Comments |>