Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: preparing multiple choice questions

  • To: mathgroup at
  • Subject: [mg63371] Re: preparing multiple choice questions
  • From: "Jean-Marc Gulliet" <jeanmarc.gulliet at>
  • Date: Tue, 27 Dec 2005 04:42:41 -0500 (EST)
  • Organization: The Open University, Milton Keynes, U.K.
  • References: <doof2r$kd9$>
  • Sender: owner-wri-mathgroup at

"Baris Erbas" <berbas at> a écrit dans le message de news: 
doof2r$kd9$1 at
| Dear Mathematica Users,
| I have been trying to prepare a test of 30 question with multiple choices
| ranging from a-e.
| I want to automatically assign the question numbers and and the correct
| answers using mathematica. All correct answers should be in equal 
| i.e. 6 a, 6 b, . 6 e.
| I tried to use Random with Table however it doesnt produce equal number of
| correct answers. I also tried to look into the Statistical packages.
| Is there a way of doing this in Mathematica? Could you please froward me 
| a link if you already know one?
| All the best
| Baris Erbas

Hi Baris,

The following function will do what you want:




Best regards,

(************** Content-type: application/mathematica **************
                     CreatedBy='Mathematica 5.2'

                    Mathematica-Compatible Notebook

This notebook can be used with any Mathematica-compatible
application, such as Mathematica, MathReader or Publicon. The data
for the notebook starts with the line containing stars above.

To get the notebook into a Mathematica-compatible application, do
one of the following:

* Save the data starting with the line of stars above into a file
  with a name ending in .nb, then open the file inside the

* Copy the data starting with the line of stars above to the
  clipboard, then use the Paste menu command inside the application.

Data for notebooks contains only printable 7-bit ASCII and can be
sent directly in email or through ftp in text mode.  Newlines can be
CR, LF or CRLF (Unix, Macintosh or MS-DOS style).

NOTE: If you modify the data for this notebook not in a Mathematica-
compatible application, you must delete the line below containing
the word CacheID, otherwise Mathematica-compatible applications may
try to use invalid cache data.

For more information on notebooks and Mathematica-compatible
applications, contact Wolfram Research:
  email: info at
  phone: +1-217-398-0700 (U.S.)

Notebook reader applications are available free of charge from
Wolfram Research.

(*NotebookOptionsPosition[      2674,         78]*)
(*NotebookOutlinePosition[      3317,        100]*)
(*  CellTagsIndexPosition[      3273,         96]*)

    \(correctAnswers[] :=
      Module[{occurences = {0, 0, 0, 0, 0}, results},
        While[occurences != {6, 6, 6, 6,
              6}, \[IndentingNewLine]results =
            Table[{q, {a, b, c, d,
                    e}[\([Random[Integer, {1, 5}]]\)]}, {q, 1, 30}];
          occurences =
            Length /@
                      2]\)]\);\[IndentingNewLine]]; \
\[IndentingNewLine]results]\)], "Input"],


    \(correctAnswers[]\)], "Input"],

    \({{1, e}, {2, e}, {3, b}, {4, b}, {5, e}, {6, d}, {7, c}, {8,
        d}, {9, d}, {10, d}, {11, b}, {12, a}, {13, a}, {14, c}, {15,
        c}, {16, e}, {17, a}, {18, c}, {19, a}, {20, b}, {21,
        e}, {22, c}, {23, b}, {24, d}, {25, d}, {26, a}, {27,
        e}, {28, c}, {29, a}, {30, b}}\)], "Output"]
}, Open  ]]
FrontEndVersion->"5.2 for Microsoft Windows",
ScreenRectangle->{{0, 1280}, {0, 717}},
WindowSize->{770, 559},
WindowMargins->{{0, Automatic}, {Automatic, 0}}

End of Mathematica Notebook file.

  • Prev by Date: Re: Re: Questions regarding MatrixExp, and its usage
  • Next by Date: Re: preparing multiple choice questions
  • Previous by thread: Re: preparing multiple choice questions
  • Next by thread: Re: preparing multiple choice questions