Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printcollection outputs questions without question number #120

Open
Hirshx opened this issue Oct 18, 2023 · 1 comment
Open

Printcollection outputs questions without question number #120

Hirshx opened this issue Oct 18, 2023 · 1 comment

Comments

@Hirshx
Copy link

Hirshx commented Oct 18, 2023

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.

@muzimuzhi
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants