# Exam Class : Points in the right Margin for \question

I've a .tex file with \question \part and \subpart (sample .tex file pasted in this question).

I need all points in the right margin; currently for \question it's not coming in the margin.

Also I want to replace default Question number with something like : "Q.1" (currently it's showing only "1")

\documentclass[addpoints,answers,10pt]{exam}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{nonfloat}
\usepackage{caption}
\usepackage{amsmath,amssymb}
\usepackage{lmodern}
\usepackage{textcomp}
\usepackage{ifpdf}
\marksnotpoints
\bracketedpoints
\pointsdroppedatright
\pointsinrightmargin
\footrule
\renewcommand{\thepartno}{\Alph{partno}}
\newcolumntype{b}{X}
\newcolumntype{s}{>{\hsize=.1\hsize}X}
\begin{document}
\begin{questions}
\question{\textbf{ Solve ANY ONE}}[4]  \begin{parts}
\part[2]
Prepare a speech, to be belivered at your school, on the topic "Health is Wealth", on the occasion of world Health Day .
\part[2]
Solve Any TWO
\begin{subparts}
\subpart[1]  \rule{1cm}{0.4pt}  was known as peace-loving and cultured city-state. (Marathon, Athens, Sparta)
\subpart[1] The first tool made by man was  \rule{1cm}{0.4pt}  . (Hand axe, a Spear, an Adaze)
\subpart[1] Lord Buddha preached in  \rule{1cm}{0.4pt}  language. (Hindi, Pali, Sanskrit)
\end{subparts}
\end{parts}
\end{questions}
\end{document}

-
1st question: you have to write \question[4]{\textbf{ Solve ANY ONE}} and not \question{\textbf{ Solve ANY ONE}}[4]. – karlkoeller Aug 25 '13 at 17:56
On www-math.mit.edu/~psh/exam/examdoc.pdf page 31 they explain how you should do this. I tried but still have problems with the alignment. code is like this in the preamble: \qformat{Question \thequestion \hfill} – Arne Aug 25 '13 at 18:07
Thank You ; First question is resolved after implementing your solution. – Pawan Mude Aug 25 '13 at 18:10

1. You are misusing \question; the syntax is \question[<points>], so you should use

\question[4]
\textbf{ Solve ANY ONE}

2. To change only the label used for numbering questions, redefine \questionlabel:

\renewcommand\questionlabel{Q.\thequestion.}


To change the representation for the counter altogether, redefine \thequestion:

\renewcommand\thequestion{Q.\arabic{question}}


The complete code:

\documentclass[addpoints,answers,10pt]{exam}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{nonfloat}
\usepackage{caption}
\usepackage{amsmath,amssymb}
\usepackage{lmodern}
\usepackage{textcomp}
\usepackage{ifpdf}
\marksnotpoints
\bracketedpoints
\pointsdroppedatright
\pointsinrightmargin
\footrule
\renewcommand{\thepartno}{\Alph{partno}}
\newcolumntype{b}{X}
\newcolumntype{s}{>{\hsize=.1\hsize}X}

\renewcommand\questionlabel{\llap{Q.}\thequestion.}

\begin{document}
\begin{questions}
\question[4]
\textbf{Solve ANY ONE}
\begin{parts}
\part[2]
Prepare a speech, to be belivered at your school, on the topic "Health is Wealth", on the occasion of world Health Day .
\part[2]
Solve Any TWO
\begin{subparts}
\subpart[1]  \rule{1cm}{0.4pt}  was known as peace-loving and cultured city-state. (Marathon, Athens, Sparta)
\subpart[1] The first tool made by man was  \rule{1cm}{0.4pt}  . (Hand axe, a Spear, an Adaze)
\subpart[1] Lord Buddha preached in  \rule{1cm}{0.4pt}  language. (Hindi, Pali, Sanskrit)
\end{subparts}
\end{parts}
\end{questions}
\end{document}


-
@karlkoeller thanks. I've deleted the spurious code. – Gonzalo Medina Aug 25 '13 at 23:30
Thanks a lot Gonzalo for correcting me. – Pawan Mude Aug 26 '13 at 6:48

Although Gonzalo has answered your question already, I just wanted to point out that you are not only misusing \question, but also misunderstanding (or misusing) the concept of points.

It seems to me that you want your question worth 4 points, but you are declaring it worth 11 points.

Infact, if you put a command \droptotalpoints after your question, you will see "Total for Question 1: 11" which is not correct.

The right way is to put \noaddpoints when the points number serves only as an information and restore the meaning with \addpoints when needed.

Below is an example that shows this concept. The first question is your original one with the uncorrect number of points and the second question the modified one which uses the correct number.

\documentclass[addpoints,answers,10pt]{exam}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{nonfloat}
\usepackage{caption}
\usepackage{amsmath,amssymb}
\usepackage{lmodern}
\usepackage{textcomp}
\usepackage{ifpdf}
\marksnotpoints
\bracketedpoints
\pointsdroppedatright
\pointsinrightmargin
\footrule
\renewcommand{\thepartno}{\Alph{partno}}
\newcolumntype{b}{X}
\newcolumntype{s}{>{\hsize=.1\hsize}X}

\renewcommand\questionlabel{\llap{Q.}\thequestion.}

\begin{document}

\begin{questions}

\question[4]
\textbf{Solve ANY ONE}
\begin{parts}
\part[2]
Prepare a speech, to be belivered at your school, on the topic "Health is Wealth", on the occasion of world Health Day .
\part[2]
Solve Any TWO
\begin{subparts}
\subpart[1]  \rule{1cm}{0.4pt}  was known as peace-loving and cultured city-state. (Marathon, Athens, Sparta)
\subpart[1] The first tool made by man was  \rule{1cm}{0.4pt}  . (Hand axe, a Spear, an Adaze)
\subpart[1] Lord Buddha preached in  \rule{1cm}{0.4pt}  language. (Hindi, Pali, Sanskrit)
\end{subparts}
\end{parts}

\droptotalpoints

\question[4]
\textbf{Solve ANY ONE}
\begin{parts}
\part[2]
Prepare a speech, to be belivered at your school, on the topic "Health is Wealth", on the occasion of world Health Day .
\part[2]
Solve Any TWO
\begin{subparts}
\subpart[1]  \rule{1cm}{0.4pt}  was known as peace-loving and cultured city-state. (Marathon, Athens, Sparta)
\subpart[1] The first tool made by man was  \rule{1cm}{0.4pt}  . (Hand axe, a Spear, an Adaze)
\subpart[1] Lord Buddha preached in  \rule{1cm}{0.4pt}  language. (Hindi, Pali, Sanskrit)
\end{subparts}
\end{parts}

\droptotalpoints

\end{questions}

\end{document}


Output

I apologize if you've read this answer and you were not interested in such things...

-
Thank you for precise and concise explanation of the points concept. This is one of the best post to get clarification. – Pawan Mude Aug 26 '13 at 6:50
@PawanMude You're welcome. – karlkoeller Aug 26 '13 at 6:52