[LON-CAPA-users] How to realize a randomly generated downloadable data set?

Peter Riegler lon-capa-users@mail.lon-capa.org
Thu, 21 Jun 2007 16:55:14 +0200

Here is an example which Gerd has provided to me. However, it does not 
open a "save as"-window on all browsers

<script type="loncapa/perl">$omega=2*$pi/&random(30,60,1);
for ($t=0;$t<=600;$t++) {
<startouttext />
<script type="text/javascript">
function datawindow() {
Copy the data file and perform a Fourier analysis.<br />
<a href="javascript:datawindow();">Data File</a><br />
What is the angular frequency of the data?<endouttext />
<numericalresponse unit="rad/s" format="3s" answer="$omega">
     <responseparam type="tolerance" default="5%" name="tol" 
description="Numerical Tolerance" />

     <textline readonly="no" />


Jay Sullivan wrote:

> Gerd,
> Trying to figure out what you mean here. Do you mean javascript that 
> would allow the user to download the data?
> Is that possible with javascript security? If you have an example of 
> that, I would love to use it in several of my problems.
> Jay
> On 5/7/07, *Gerd Kortemeyer* <korte@lite.msu.edu 
> <mailto:korte@lite.msu.edu>> wrote:
>     If yes, then the problem below might do the trick. Alternatively, one
>     could put a piece of JavaScript around the data which provides a "file."

Peter Riegler
Fachhochschule Braunschweig/Wolfenbüttel
Salzdahlumer Str. 46/48, 38302 Wolfenbüttel
Tel. +49 5331 939 6314, Fax. +49 5331 939 6002
email: p.riegler@fh-wolfenbuettel.de