cgnieder / xsim

eXercise Sheets IMproved
65 stars 20 forks source link

Printcollection outputs questions without question number #120

Open Hirshx opened 9 months ago

Hirshx commented 9 months ago

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:

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.

muzimuzhi commented 9 months ago

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).