-1

In the great R-exams package can specify the numerical answers width in cloze questions with \exextra[numwidth,logical]{TRUE}.

I want create exams with mixed type cloze, for example num|num|string (solve an equation and don't know how many solutions exist - if less than three, the latest answers should be -). In this case the answers fields appear like this:

Bad align

The students know the last answer is string because this input box is smaller than other. How can all input boxes be equal width?

(I want import the output into Moodle so this question maybe exams2moodle()-specific.)

MWE:

\exsection{test}
\extype{cloze}
\exclozetype{num|num|string}
\exsolution{100|200|-}
\exextra[numwidth,logical]{TRUE}
\begin{question}
  This is a blind question text.
  \begin{tabular}{rc}
    $x_1=$ & ##ANSWER1## \\
    $x_2=$ & ##ANSWER2## \\
    $x_3=$ & ##ANSWER3## \\
  \end{tabular}
\end{question}

Build the XML:

library('exams')
exams2moodle('test.Rnw')
Achim Zeileis
  • 15,710
  • 1
  • 39
  • 49
uzsolt
  • 5,832
  • 2
  • 20
  • 32
  • I'm not the one who downvoted or voted to close, but one possible reason is because there is no reproducible example here - we cannot replicate what you're seeing, so unless someone knows off the top of their head, we cannot work to help you find a solution. – DaveArmstrong Mar 07 '21 at 13:56
  • @DaveArmstrong The reason of close flag: 'Needs more focus. This question currently includes multiple questions in one. It should focus on one problem only.'. I think this is only one question. But who knows now I added an MWE. – uzsolt Mar 07 '21 at 14:15

1 Answers1

1

Starting from version 2.4-0 you can specify both numwidth and stringwidth in terms of the same character that is used to determine the width of the box, e.g.,

\exextra[numwidth,character]{9999}
\exextra[stringwidth,character]{9999}
Achim Zeileis
  • 15,710
  • 1
  • 39
  • 49
  • I modified `.Rnw` as in my question's update but the input boxes have different widths. Maybe it counts the version of exams package is 2.3-6 (as I see this is the latest). – uzsolt Mar 09 '21 at 07:31
  • 1
    Version 2.4-0 (the devel version from R-Forge) is needed for this, pointed out now. – Achim Zeileis Mar 09 '21 at 08:20
  • Version 2.4-0 of R/exams has been published on CRAN, updated the answer again. – Achim Zeileis Oct 17 '22 at 12:13