[edutex] show/hide

story at uakron.edu story at uakron.edu
Sun Aug 30 15:12:53 CEST 2009


On 29 Aug 2009 at 18:08, Frank Quinn wrote:

> This is an idea about how (in PDF) to hide an answer sheet until a  
> button is activated. It also illustrates what the modular design  
> should make possible, without changing core code. Finally  it could be  
> used to address security concerns, though that is not the primary  
> objective.
> 
> The idea is to have the question sheet and answer sheet be separate  
> documents.  The "show answers" button could either bring the answer  
> document out of hiding (if they are delivered together) or send a  
> request to the server to send it.

The hiding and showing of the button is simple enough in PDF

> The scoring functionality should be embedded in the answer document.  
> Anyone (eg. Don) know how this could be done?
> 
> -- can JS functions query fields in a different document?

Yes, and No.  One of the products I sell at acrotex.net does that. A PDF opens other PDFs,
the document author makes selections from this PDF by clicking checkboxes, then the 
master PDF searches through the PDFs it opened to get the selection.  However, this 
occurs on the local computer system, outside a browser.  I don't think it can for PDFs inside 
(separate) browser windows.

> -- if not then perhaps the question document could have a function  
> that collects the responses and sends them (eg as a string) to the  
> answer document? 

That could be done, but the question doc would have to send the data to a server-side 
script, which would then bounce the data back to the answer doc. On receiving the data, the 
the answer doc, the client-side JS would be called to mark the test, then send results back 
to the server for storage.  It will be rather tricky to write such code.

The simplest and most natural thing to do  is to encypt the document so the computer clever 
student (not the calculus clever student) cannot see the JS.

One other possibility: I can write some latex code so that an FDF file is written with all the 
JS code needed to process the document.  On submit, the server sends this FDF to the 
questions document, it executes after is loads and goes through the test to evaluate each 
question, gather data, and then send back to the server for storage.  Again, this is a clunky 
approach requiring server-side file management.

The easiest is to encypt.  pdftex used to have an encypt version, but I believe it was 
dropped. Third party product such as fdfmergelite (at $1000) does the job, including
merging data with PDF server-side.  (However, I don't think it can merge when the file is 
encypted, I'll have to check the docs.)

dps

> Frank
> 



--
Dr. D. P. Story / Dept. of Theoretical and Applied Mathematics / The University of Akron /
Akron, OH 44325 / dpstory at uakron.edu /
Personal URL: http://www.math.uakron.edu/~dpstory/
AcroTeX PDF Blog: http://www.math.uakron.edu/~dpstory/pdfblog.html
AcroTeX Web Site: http://www.math.uakron.edu/~dpstory/acrotex.html
http://www.acrotex.net



More information about the edutex mailing list