[LON-CAPA-users] tables, matching problems

Gerd Kortemeyer lon-capa-users@mail.lon-capa.org
Fri, 11 Feb 2005 16:59:01 -0500

Hi Sally,

Here's a solution with static images. I am sort of reconstruction what the
listitems usually do for you. Replace the <img>'s with the GNUplots, and you
are in business.

What this does:
The script has two arrays
@files - filenames, in your case, the parameters/functions for dynamic plots
@vals - the correct answer to go with each
The next loop just permutes both @files and @vals, but keeps them in order
Then between the <startouttext />...<endouttext />, you plot your table,
labeling the columns A, B, etc. While I pass the filenames to static <img>, you
would pass the functions to the GNUplots.
The I use a normal optionresponse, with "Circuit A", ... and "none" as options.
Then I make foils with the correct answers "Circuit A", ... "none", and vals[n]
as printed text. I have put in two capacitances that I do not have plots for,
and then have five foils picked.

<script type="loncapa/perl"># Names of the files
# Capacitances of the depicted circuits
# Mix up the order
for ($i=1;$i<=3;$i++) {

<startouttext />Consider the following four circuits:
<tr><th>Circuit A</th><th>Circuit B</th><th>Circuit C</th><th>Circuit
<td><img src="four/$files[0].gif" TeXwidth="18" /></td>
<td><img src="four/$files[1].gif" TeXwidth="18" /></td>
<td><img src="four/$files[2].gif" TeXwidth="18" /></td>
<td><img src="four/$files[3].gif" TeXwidth="18" /></td>
Match the circuits and their capacitances.<endouttext />
<optionresponse max="5" randomize="yes" TeXlayout="horizontal">
    <foilgroup options="('Circuit A','Circuit B','Circuit C','Circuit

<foil location="random" value="Circuit A" name="foilA">
<startouttext />
$vals[0]<endouttext />
<foil location="random" value="Circuit B" name="foilB">
<startouttext />
$vals[1]<endouttext />
<foil location="random" value="Circuit C" name="foilC">
<startouttext />
$vals[2]<endouttext />
<foil location="random" value="Circuit D" name="foilD">
<startouttext />
$vals[3]<endouttext />
<foil location="random" value="none" name="foilE">
<startouttext />
2C<endouttext />
<foil location="random" value="none" name="foilF">
<startouttext />
C/2<endouttext />


<allow src="/res/msu/kortemey/physicslib/capacitors/four/*" />

Quoting Sally Hunnicutt <sshunnic@vcu.edu>:

> The graphs are dynamically generated within CAPA.
> Sally
> At 03:49 PM 2/11/05 -0500, Gerd Kortemeyer wrote:
> >Hi Sally,
> >
> >Quoting Sally Hunnicutt <sshunnic@vcu.edu>:
> >
> > > OK, here is what I am trying to do.  I have four graphs (gnuplots), one
> for
> > > A, one for B, etc.
> >
> >Are these static graphs (boiled down to gifs, jpgs), or dynamically
> generated
> >within LON-CAPA?
> >
> >- Gerd.
> >
> >
> >----------------------------------------------------------------
> >This message was sent using IMP, the Internet Messaging Program.
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users@mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users

Gerd Kortemeyer, Ph.D.
E-192 Holmes Hall
Michigan State University
East Lansing, MI 48825

This message was sent using IMP, the Internet Messaging Program.