0

I have been able to use xsim to extract easy, medium and difficult questions from a tagged Question Bank. However, I am not able to get the tex file with the list of all easy questions, all medium questions and all difficult questions.

Here is a MWE:

\documentclass[14pt]{article}
\usepackage{amsmath, amssymb, amsthm, amsfonts}
\usepackage[verbose,clear-aux]{xsim}
\usepackage{filecontents}

\DeclareExerciseCollection{foo-easy}
\DeclareExerciseCollection{foo-medium}
\DeclareExerciseCollection{foo-difficult}
\DeclareExerciseTagging{difficulty}
\xsimsetup
{
    difficulty={1,2,3},
    print-collection/print=both
}
\begin{filecontents*}
    {foo.tex}

    \begin{exercise}[difficulty=1]
        bla bla
\end{exercise}
\begin{solution}
bla bla bla
\end{solution}

\begin{exercise}[difficulty = 2]
bla
\end{exercise}
\begin{solution}
bla bla bla bla
\end{solution}
\end{filecontents*}

\begin{document}
\collectexercises{foo-easy}
\xsimsetup{difficulty=1}
\input{foo.tex}
\collectexercisesstop{foo-easy}

\collectexercises{foo-medium}
\xsimsetup{difficulty=2}
\input{foo.tex}
\collectexercisesstop{foo-medium}

\collectexercises{foo-difficult}
\xsimsetup{difficulty=3}
\input{foo.tex}
\collectexercisesstop{foo-difficult}

\section{Level 01 Problems}
\printcollection{foo-easy}
\printsolutionstype*{foo-easy}

\section{Level 02 Problems}
\printcollection{foo-medium}

\section{Level 03 Problems}
\printcollection{foo-difficult}

\end{document}

  • 1
    Welcome to TeX.SE! Can you please elaborate further and provide a minimal working example showing what you have tried? We are happy to help! – M. Al Jumaily Jul 27 '19 at 22:15
  • Is it the possible related question? https://tex.stackexchange.com/questions/430593/creating-a-multi-labeled-question-bank-with-xsim-exam. Please, where have you the file \input{foo.tex}? Welcome between the users. – Sebastiano Jul 28 '19 at 11:34
  • foo.tex gets created in the current working directory by the use of the command filecontents*, with all the exercises and their solutions. When compiled the pdf of the MWE contains perfectly the easy, medium and difficult solutions sorted in three different sections. But I am unable to access all the sorted questions, which are in foo-easy, foo-medium and foo-difficult. – NoviceMath Jul 28 '19 at 13:21
  • What do you mean by “But I am unable to access all the sorted questions”? How do you want to “access” the exercises? Which outcome do you want to have? – cgnieder Sep 27 '19 at 11:45
  • I am unable to get the tex file with easy questions, tex file with medium and tex file with difficult questions. It generates pdf with easy, pdf with medium and pdf with difficult questions – NoviceMath Sep 28 '19 at 14:04

0 Answers0