cgnieder/xsim

Printcollection outputs questions without question number

Hirshx opened this issue · 1 comments

Hirshx commented

I am currently working on an exam template using xsim. I created a custom exercise template which can output indiviual points if the question consists of several subquestions. In the MWE below I now have the following problem:

Compiling as is does output all questions but without question numbers. The grading table does not contain any of the questions and the total point value is displayed as 0.

Already tried:

  • If I include \printcollection{klausur} while inside the collection-environment, the output does contain question numbers and points in the grading table. However this method will not be viable in the final template because I aim to include the datatool package to create multiple exams with pre-filled information e.g. name and id number of our students.
  • If I use the default \begin{exercise} ... \end{exercies} instead of my own template, question numbers and grading table are again visible. This leads me to believe that the problem is with my exercise template. However I am unable to find it.

Any input is appreciated.

\documentclass[12pt,parskip=true,headsepline=true]{scrartcl}
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%Pakete%%%%%%%%%%%%%%%%%%%%%%%%%
	\usepackage[utf8]{inputenc}
	\usepackage[ngerman]{babel}
	\usepackage[most]{tcolorbox}
	%%%%%%%%%%%%%%%%%%%%%%%%%xsim setup%%%%%%%%%%%%%%%%%%%%%%%%
	\usepackage[use-aux]{xsim}
	\xsimsetup{collect}
	%%%%%%%%%%%%%%%%%%%%%Exercise template%%%%%%%%%%%%%%%%%%%%%%
	\DeclareExerciseProperty{subpoints}
	\DeclareExercisePropertyAlias{subpoints}{points}
	\DeclareExerciseEnvironmentTemplate{klausur}
        {%
        \tcolorbox[standard jigsaw,%
        opacityback=0,%
        opacityframe=0,%
        coltitle=black,%
        breakable,%
        drop shadow,%
        beforeafter skip=.5\baselineskip,%
        title= \textbf{\XSIMmixedcase{\GetExerciseName}~\GetExerciseProperty{counter}}%
        \GetExercisePropertyT{points}{%
          \quad
          (%
            \XSIMifeqF{\GetExerciseProperty{subpoints}}{\PropertyValue}
              {$\GetExerciseProperty{subpoints} ={}$}%
            $\printgoal{\PropertyValue}$ \IfExerciseGoalSingularTF{points}{Punkt}{Punkte}% 
          )%
        }%
        ]
        }
        {\endtcolorbox}%
    
    \DeclareExerciseType{klausuraufgabe}{%
      exercise-env = aufgabe ,%
      solution-env = loesung ,%
      exercise-name = Aufgabe ,%
      exercises-name = Aufgabenübersicht ,%
      solution-name = Lösung ,%
      solutions-name = Lösungen ,%
      exercise-template = klausur,%
      solution-template = klausur,%
      exercise-heading = \subsection*,%
      solution-heading = \subsection*%
    }%
    \DeclareExerciseCollection{klausur}%
    
    %%%%%%%%%%%%%%%%%%%%%%%%%Hauptteil%%%%%%%%%%%%%%%%%%%%%%%%
    \begin{document}
    
    \activatecollection{klausur}
    \collectexercises{klausur}
    
    \begin{aufgabe}[points=1]
    First Question.
    \end{aufgabe}
    
    \begin{aufgabe}[points=2]
    Second Question.
    \end{aufgabe}
    
    \begin{aufgabe}[points=1+1+1]
    Third question which consists of 3 subquestions.
    \end{aufgabe}
    
    %\printcollection{klausur}
    \collectexercisesstop{klausur}
    
    \printcollection{klausur}
    \gradingtable
    
    \end{document}

I already asked this question on the german site texwelt and tex.se.

Since this is more like a question than bug report, I've added an answer to your question on tex.se (I prefer calling it TeX-SX).