# sdapsclassic class¶

This is the main class which currently should be used to create questionnaires. It builds on top of the other packages and adds new macros and environments which are similar to the ones from the original SDAPS LaTeX class.

Please note that the environments from the sdapslayout package cannot be used directly as using these environments will cause conflicting macro definitions. Instead one can simply use the aliases provided in this class.

The entire document should be wrapped using the questionnaire environment.

The following macros and environments exist:

The following question types exists for your use:

You should only use \section{} for structuring the document.

## Class Options¶

Argument

Description

sdaps_style

The markings style to use. Either “code128”, “qr” (default: code128)

checkmode

The mode for checkbox recognition can be any of:
• checkcorrect: check to mark, fill to correct (unmark) (default)

• check: check or fill to mark

• fill: fill to mark

disable_recognition

Disable all recognition related page markings. This must not be used when intending to ues the SDAPS program for optical mark recognition. An example use case would be creating a PDF form using the SDAPS LaTeX classes. (default: not set)

twoside_barcode

Where to draw barcodes if in twoside/duplex mode:
• both: draw on front and back (default)

• front: only draw on the front of the page

• back: only draw on the back of the page

globalid

A global identifier to be printed on the document (as barcode)

globalidlabel

The label for the barcode (only code128)

no_print_questionnaire_id

Disable printing of questionnaire IDs

print_questionnaire_id

Enable printing of questionnaire IDs

## General macros and environments¶

\begin{questionnaire} [kwargs]
content
\end{questionnaire}
Keyword Arguments

noinfo – Suppress the generation of the standard information text

This is the main environment. You should have exactly one of these environments containing the entire document.

\begin{info}
content
\end{info}

A simple environment which places a line on top and below the content.

\addinfo {key} {value}

Attach further metadata to the SDAPS project. This may be used for any purpose and the information will also appear on the cover page when generating a report using the main SDAPS program.

\sdapsinfo

Print the instruction text that is printed at the top of the page unless the noinfo keyword argument is given to questionnaire.

Place into a info block to get the same visual appearance as the default information text.

\sdapspagemark

This macro must be executed once for every page. By default it is placed into the center footer and as such should not be executed unless the footer is modified.

While this command is provided, use it at your own risk. No guarantees are made on how the class uses this macro internally. If you use it, you need to verify the behaviour whenever the class is updated and ensure that everything is functioning appropriately. In particular, this macro must not be executed twice per page.

## Question Environments¶

\begin{choicequestion} [kwargs] {text}
content
\end{choicequestion}
Arguments

text – Text of the choice question. Fragile content is currently not supported.

Keyword Arguments
• cols – Number of columns

• colsep – Spacing added on the left/right of every cell. This defaults to 6pt.

• rowsep – Extra distance between rows. This defaults to 0pt.

• var – Variable name for this question (to be appended to context).

• text – Replacement text for metadata

• type – the question type “multichoice” or “singlechoice”

• multichoice – switch to multichoice “Choice” question mode

• singlechoice – switch to singlechoice “Option” question mode

The content should only contain \choiceitem, \choicemulticolitem and \choiceitemtext.

\choiceitem [kwargs] {text}

A possible choice in a choicequestion. Will span exactly one column.

Arguments

text – The text for the choice. Fragile content is currently not supported.

Keyword Arguments
• var – Variable name for this answer for multichoice (to be appended to context).

• val – Value for this answer for singlechoice.

• text – Replacement text for metadata.

\choicemulticolitem [kwargs] {cols} {text}

A possible choice in a choicequestion. Will span exactly cols columns.

Arguments
• cols – The number of columns to span.

• text – The text for the choice. Fragile content is currently not supported.

Keyword Arguments
• var – Variable name for this answer for multichoice (to be appended to context).

• val – Value for this answer for singlechoice.

• text – Replacement text for metadata.

\choiceitemtext [kwargs] {height} {cols} {text}

A possible freeform choice in a choicequestion. The text field will be of height height and it will span exactly cols columns.

The text item can currently only be used in multichoice environments.

Arguments
• cols – The number of columns to span.

• text – The text for the choice. Fragile content is currently not supported.

Keyword Arguments
• var – Variable name for this question (to be appended to context).

• text – Replacement text for metadata.

\begin{optionquestion} [kwargs] {text}
content
\end{optionquestion}

Alias for choicequestion which simply sets it into singlechoice mode by default.

\begin{info}
content
\end{info}

A simple block to typeset important information differently.

\begin{markgroup} [kwargs] {text}
content
\end{markgroup}
Arguments
• text – Common question for all subquestions. Fragile content is currently not supported

• kwags – Same as rangearray

Todo

The spacing in the “other” case is not sane, we need a larger default spacing in general.

\begin{choicegroup} [kwargs] {text}
content
\end{choicegroup}
Arguments
• text – Common question for all subquestions. Fragile content is currently not supported

• kwags – Same as choicearray

Note

The choicegroup environment is an alias for the choicearray environment. At this point the only difference is that the choicegroup environment correctly prints the header and that it creates the \groupaddchoice and \choiceline aliases.

\choice [kwargs] {text}

A possible choice inside inside the group.

Arguments

text – The choices (header) text.

Keyword Arguments
• text – A replacement text for the metadata, if set fragile content is permitted inside the text argument.

• var – Variable name for this answer for multichoice (to be appended to context).

• val – Value for this answer for singlechoice.

\groupaddchoice [kwargs] {text}

Alias for \choice for compatibility.

\question [kwargs] {text}

A single question inside the group. All choices need to be defined earlier using \choice.

Arguments

text – Question text.

Keyword Arguments
• text – A replacement text for the metadata, if set fragile content is permitted inside the text argument.

• var – Variable name for this question (to be appended to context).

• range – Specify which chekcboxes to show. Needs ot be given an in order list of variables (multichoice) or values (singlechoice) also allowing specifying for any amount of items.

\choiceline [kwargs] {text}

Alias for \question for compatibility.

\begin{optiongroup} [kwargs] {text}
content
\end{optiongroup}

Alias for choicegroup which simply sets it into singlechoice mode by default.

## Complex typesetting and images¶

SDAPS allows replacing the text which is exported for the metadata (i.e. what will show up in the report). This can make sense for convenience reasons, if shortened answers are sufficient for e.g. the report, but it also allows inserting complicated LaTeX expressions into the document without having to fear any issues.

Apart from the advantage of having a better string in the report or similar you also get the advantage that more TeX commands can be used in the document. Usually environments like verbatim or array would not work inside an SDAPS environment, but they will work if a replacement text is specified.