# [Tugindia] New environment

mkalidoss mkalidoss at sancharnet.in
Tue Jul 4 03:33:53 CEST 2006

Dear TUGIndia,
I am aware of Exam.cls file for question papers.
However, I am interested in developing a class file,
customized to typeset question paper of our institution.

This question paper contains Part A, which consists
of multiple choice questions and shall contain
questions from 1 to 10. Other parts of the paper
contain questions with numbers, like 11a. 11b etc. and
also numbers like 16, 17, etc.

The desired form of input (for Part A) is

\question [1.] How many cows are needed to graze the field?
\choice One
\choice Two
\choice Three
\choice Four
\question [2.]  blah blah blah blah blah
.....................

I also want to include a switch \2column=true/false
for this section alone.

I tried the following code, which is obviously inadequate.

\newcommand{\aquestions}[1]%
{\ifx\empty#1\empty\else\gdef\@aquestions{#1}\fi}
\newcommand{\aq}[1]%
{\ifx\empty#1\empty\else\gdef\@aq{#1}\fi}
\newcommand{\amark}[1]%
{\ifx\empty#1\empty\else\gdef\@amark{#1}\fi}
\newcommand{\atotal}[1]%
{\ifx\empty#1\empty\else\gdef\@atotal{#1}\fi}

\newenvironment{part-a}%
{\begin{center}\textbf{Part A}\end{center}
Answer~\@aquestions~questions\hfill($\@aq~\times~ \@amark = \@atotal$)
\begin{description}}%
\begin{enumerate}[(a)]
\end{enumerate}
{\end{description}}

Kindly help me.

M. Kalidoss