# exsheets varying of question's point value

I'm using exsheets package. I want variations with different point values.

\documentclass[a4paper]{article}
\usepackage[magyar]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{t1enc}
\usepackage{lipsum}
%
\usepackage{titlesec}
\begin{filecontents}{\jobname-example.inc}
\begin{question}{2}
What is the result of \vary{$2+3$}{$1231+4431$}?
\end{question}
\end{filecontents}
\begin{document}
%
%
\SetVariations{2}
\variant{1}
\section{Group A}
\includequestions{\jobname-example.inc}
\newpage
\variant{2}
\section{Group B}
\includequestions{\jobname-example.inc}
\end{document}


I want two different point value:

\documentclass[a4paper]{article}
\usepackage[magyar]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{t1enc}
\usepackage{lipsum}
%
\usepackage{titlesec}
\begin{filecontents}{\jobname-example.inc}
\begin{question}{\vary{2}{4}} % <<<==== CHANGE =======
What is the result of \vary{$2+3$}{$1231+4431$}?
\end{question}
\end{filecontents}
\begin{document}
%
%
\SetVariations{2}
\variant{1}
\section{Group A}
\includequestions{\jobname-example.inc}
\newpage
\variant{2}
\section{Group B}
\includequestions{\jobname-example.inc}
\end{document}


But it fails on changed line:

! You can't use \long' after \the.


Is there any solutions without create two full question (the differences between questions only the numbers)?

• That's not possible with the current implementation. I'll add something to the next release and will write an answer then – clemens Dec 13 '13 at 14:37
• Oh, understand. Many-many thanks for your work! – uzsolt Dec 13 '13 at 19:12

Since v0.12 exsheets provides a possibility: a leading bang in the points argument to the question environment prevents parsing of the points:

\documentclass{article}

\usepackage{exsheets}
\SetVariations{2}

\begin{document}

\variant{1}
\section{Group A}
\begin{question}{!\vary{2}{4}}
What is the result of \vary{$2+3$}{$1231+4431$}?
\end{question}

\variant{2}\setcounter{question}{0}
\section{Group B}
\begin{question}{!\vary{2}{4}}
What is the result of \vary{$2+3$}{$1231+4431$}?
\end{question}

\end{document}


This comes with a cost: the points are not added to the sum of points any more. Should that be needed one could define something like

\newcommand*\varypoints[2]{%
% \points*{} only prints them (without unit')
\vary
}


and use it instead. (However, for the example this would sum both points from group A and group B – surely not what's wanted.

The easiest but maybe not safest way would be to define

\newcommand*\varypoints[2]{%
% \points*{} only prints them (without unit')
`