MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: questions about make boxes

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.


> This is related to work I am doing for my math classes, using
> Mathematica to generate random math problems for my students.
> Thanks for your patience and any help you might offer.
> 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],

Arnoud Buzing

  • Prev by Date: Re: Disappearing variables
  • Next by Date: Re: Removing packages
  • Previous by thread: questions about make boxes
  • Next by thread: TeXForm[] anyone??