[LON-CAPA-users] carrying parameters between problems...?

Guy Albertelli II lon-capa-users@mail.lon-capa.org
Fri, 28 Mar 2003 16:53:09 -0500 (EST)


Hi Ray,

>     Does anyone know if you can carry variable values over from one problem 
> resource (in a given sequence) to another problem resource? 

No.

> If not, then can we get a single problem resource to be displayed as
> though it were in fact a series of resources?

No.


However the only not so good Idea I have is this.

Have the calculations occur in a .library and have the calculations
not use the standard seed settings. Maybe set the see off of just the
student name and course id and some file specific info (filename?)

It sort of kills the general usability of the problem but will let you
do what you want here.

You can use the function
&random_set_seed_from_phrase()

to the set the random seed to some other than the default we provide.

And you will want to set $hidden::RANDOMINIT to 1 to prevent use from
overriding your seed.

<script type="loncapa/perl">
$name=&EXT('user.name');
$domain=&EXT('user.domain');
$course=&EXT('user.course.id');
$filename="whateverthislibaryiscvalled.library';
$hidden::RANDOMINIT=1;
&random_set_seed_from_phrase("$name:$domain:$course:$filename");
</script>

I am not sure how this will affect <option/radio/match/rank/response>
in the same file, and how they will interact with your code, they do
some randomseed mumbo jumbo but they should be properly saving and
restoring the current seed.
-- 
guy@albertelli.com  LON-CAPA Developer  0-7-7-1-