• To: mathgroup at smc.vnet.net
• Subject: [mg13820] Re: questions about make boxes
• From: Arnoud Buzing <arnoudb>
• Date: Fri, 28 Aug 1998 04:18:39 -0400
• Organization: Wolfram Research, Inc.
• References: <6rdms1\$duu@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Tom wrote:
>
> I have been trying to figure out the examples that have been given
> recently responding to the question about box formatting.  I can sort
> of understand the idea, but my knowledge doesn't allow me to modify the
> examples to fit my needs.

<snip>

>
> This is related to work I am doing for my math classes, using
> Mathematica to generate random math problems for my students.
>
>
> Sincerely,
>
> Tom De Vries

This is not exactly what I think you're asking for, but this may be
helpful for making random tests for your students. As I understand it
you want to generate either a "personalized" notebook file or a printed
"personalized" test for each student that you have.

The following may help. It creates StudentAmount different notebooks
which are saved on your computer with NotebookSave. Changing the
NotebookSave line to NotebookPrint[NB] will print all the notebooks.
Each notebook has a random test in it, in the sense that the parameter
a is changed in each passing through the  While loop. This value for a
is then combined, so that you get problems like 34 + x^2 = 0. You can
replace the linear syntax x^2 in StringForm by typing "x Ctrl-6 2" on
the keyboard:

StudentAmount = 2;
StudentCounter = 1;

While[StudentCounter <= StudentAmount,
NB = NotebookCreate[];
a = Random[Integer, {1, 100}];

NotebookWrite[NB, Cell["Algebra Test", "Title"]];
SelectionMove[NB, Next, Cell];
NotebookWrite[NB, Cell["Problem 1: Solve for x", "Text"]];
SelectionMove[NB, Next, Cell];
NotebookWrite[NB, ToBoxes[StringForm["`1` + x^2 = 0", a]]];

NotebookSave[NB, StringJoin["Student", ToString[StudentCounter],
".nb"]];
NotebookClose[NB];
StudentCounter++;
]

---
Arnoud Buzing

```

• Prev by Date: Re: Disappearing variables
• Next by Date: Re: Removing packages