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

Peter Riegler lon-capa-users@mail.lon-capa.org
Wed, 09 May 2007 20:30:53 +0200


Gerd Kortemeyer wrote:
> 
> On May 7, 2007, at 2:56 PM, Gerd Kortemeyer wrote:
> 
>>
>> Would the students web-savvy enough to copy the data out of a  textarea?
> 
Well, as I am in a computer science department I would say they are. But 
reality might prove me wrong.

Anyway, your suggestion involving JavaScript seems to be far more 
elegant in that I wouldn't have to keep innumerable data files as 
published resources on hard disk.
> 
> 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."
> 
> 
>> On May 7, 2007, at 2:45 PM, Peter Riegler wrote:
>>
>>>
>>>
>>> I want my students to do a frequency analysis of a noisy  
>>> monofrequential signal (by FFT or whatever). What I have in mind  is 
>>> to have a problem where the student is offered a downloadable  file 
>>> together with a single numerical answer field for entering  the 
>>> obtained signal frequency.
>>>
>>> If I had a static data file I would make a published resource out  of 
>>> it and hardlink it into the problem file. However, I would like  to 
>>> have individual, i.e. random, data files for each student. Is  there 
>>> a way of having dynamic data files as resources?
>>>
> 
> <problem>
> <script type="loncapa/perl">$omega=2*$pi/&random(30,60,1);
> $phi=&random(1,2,0.1);
> $amp=&random(3,10,1);
> for ($t=0;$t<=600;$t++) {
>      $func=$amp*(sin($omega*$t+$phi)+&random(-0.2,0.2,0.01));
>      $data.="$t,$func\n";
> }</script>
> <startouttext />Copy the data below and perform a Fourier  analysis.<br />
> <textarea cols="20" rows="10">$data</textarea><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" />
>     
> </numericalresponse>
> </problem>
> 
> 
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users@mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users

-- 
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
http://public.rz.fh-wolfenbuettel.de/~riegler