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

Pleaes 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 following question types exists for your use:

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

## Class Options¶

Argument Description
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

## Macros¶

\checkbox *
Arguments: * – If given, a single choice checkbox is shown instead of a multi choice.

Shows an unchecked checkbox for demonstration purposes.

\checkedbox *
Arguments: * – If given, a single choice checkbox is shown instead of a multi choice.

Shows a checked checkbox for demonstration purposes.

\filledbox *
Arguments: * – If given, a single choice checkbox is shown instead of a multi choice.

Shows a filled checkbox for demonstration purposes.

\correctedbox *
Arguments: * – If given, a single choice checkbox is shown instead of a multi choice.

Shows a filled and checked checkbox for demonstration purposes.

\singlemark [kwargs] {question} {lower} {upper}

A simple “mark” question, i.e. a range. The command does not currently allow adding an alternate answer in a way similar to the markgroup or rangearray environments.

Arguments: Keyword Arguments: question – The question text lower – The text for the lower label upper – The text for the upper label var – The variable for the question (to be appended to context). count – The number of checkboxes (default: markcheckboxcount).
\singlemarkother [kwargs] {question} {lower} {upper} {other}

Similar to \singlemark but also takes an alternative answer.

Arguments: Keyword Arguments: question – The question text lower – The text for the lower label upper – The text for the upper label other – The text for the other label var – The variable for the question (to be appended to context). count – The number of checkboxes (default: markcheckboxcount).
\textbox * [kwargs] {height} {question}
Arguments: Keyword Arguments: * – If given, the textbox is scalable in height height – The height of the text including a unit. If the * parameter is given, then this is the minimal height only question – The question text, may not contain fragile content text – The question text for the metadata. Fragile content is currently not supported. var – The variable name for this textbox (to be appended to context)

Todo

\textbox should be able to handle an optional keyword argument and then allow the question text to include fragile content.

Note that the SDAPS class supports rather fancy textbox handling including textboxes around other content!

Warning

The following examples are missing code for proper use! They mostly exist to show off the features but are not quite ready for easy consumption.

\addinfo {key} {value}

Adds a bit of metadata. This metadata will for example appear on the cover page of the report.

Arguments: key – The key to set value – The value to set the key to

## Environments¶

\begin{choicequestion} [kwargs] {text}
content
\end{choicequestion}
Arguments: Keyword Arguments: text – Text of the choice question. Fragile content is currently not supported. 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: Keyword Arguments: text – The text for the choice. Fragile content is currently not supported. 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: Keyword Arguments: cols – The number of columns to span. text – The text for the choice. Fragile content is currently not supported. 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: Keyword Arguments: cols – The number of columns to span. text – The text for the choice. Fragile content is currently not supported. 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: Keyword Arguments: text – The choices (header) text. 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: Keyword Arguments: text – Question text. 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.