Skip to content

Commit 2d4785d

Browse files
committed
sphinx: Improve rangearray and markgroup documentation
1 parent 6cddf25 commit 2d4785d

File tree

2 files changed

+43
-5
lines changed

2 files changed

+43
-5
lines changed

sphinx/sdapsclassic.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ Question Environments
355355
\markline{Second question}{b}{d}
356356
\end{markgroup}
357357

358-
\begin{markgroup}[other]{Another further set of questions with an alternative answer}
358+
\begin{markgroup}[count=7,other]{Another further set of questions with an alternative answer and 7 choices}
359359
\markline{First question}{lower}{upper}{other}
360360
\markline{Second question}{a}{b}{c}
361361
\end{markgroup}

sphinx/sdapslayout.rst

+42-4
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,51 @@ be created directly with sdapsarray.
6969
choice macro and each question using the question macro.
7070

7171
.. environ::
72-
\begin{optionarray}[]
72+
\begin{optionarray}[kwargs]
7373
\end{optionarray}
7474

75-
.. todo:: Uh, document this.
75+
Identical to :environ:`choicearray` with the singlechoice keyword arguemnt
76+
set by default.
7677

7778
.. environ::
78-
\begin{rangearray}[]
79+
\begin{rangearray}[kwargs]
7980
\end{rangearray}
8081

81-
.. todo:: Uh, document this.
82+
:kwarg align: named alignment group, set to a common name to align multiple environments to each other
83+
:kwarg count: the number of choices in the scale (default: 5)
84+
:kwarg other: whether to show an alternative answer outside of the scale
85+
:kwarg layouter: set the sdapsarray layouter (unlikely to be useful in this case)
86+
87+
The rangearray environment is used for a scale with lower/upper labels plus
88+
optionally a further checkmark outside of the range.
89+
90+
Each question is added using the :macro:`\\range` macro.
91+
92+
.. macro:: \range[kwargs]{question}{lower}{upper}{other}
93+
94+
:param question: The question text.
95+
:param lower: The text for the lower end label.
96+
:param upper: The text for the upper end label.
97+
:param upper: The text for the alternative choice (only valid if other
98+
is passed to the environmet.
99+
:kwarg var: Variable name for this question (to be appended to context).
100+
:kwarg text: A replacement text for the metadata, if set fragile content is
101+
permitted inside the `text` argument.
102+
:kwarg upper: A replacement text for the metadata, if set fragile content is
103+
permitted inside the `upper` argument.
104+
:kwarg lower: A replacement text for the metadata, if set fragile content is
105+
permitted inside the `lower` argument.
106+
:kwarg other: A replacement text for the metadata, if set fragile content is
107+
permitted inside the `other` argument.
108+
109+
.. sdaps:: Example of a rangearray environment
110+
111+
\begin{rangearray}[count=7,other]
112+
\range{Question one}{lower}{upper}{other}
113+
\range{Question two}{bad}{good}{unsure}
114+
\end{rangearray}
115+
116+
\begin{rangearray}
117+
\range{Question three}{lower}{upper}
118+
\range{Question four}{bad}{good}
119+
\end{rangearray}

0 commit comments

Comments
 (0)