3

When students encounter a Short Answer or a Numerical question, they are presented with a text box in which they can enter their answer. Their answers will be compared to a list of allowed answers provided during the question authoring. I'm trying to adjust the size of the questions text boxes in case of a question consisting of multiple subquestions.

The length of the text box is computed based on the length of the longest answer including the wrong answers. In case of multiple SA subquestions, I've added the same dummy wrong answer to all embedded-answers.

Subquestion 1:  {1:SA:%100%A~%0%XXXX}
Subquestion 2:  {1:SA:%100%BB~%0%XXXX}
Subquestion 3:  {1:SA:%100%CCC~%0%XXXX}
Subquestion 4:  {1:SA:%100%DDDD~%0%XXXX}

where XXXX is the dummy wrong answer.

In the example below, I also show the HTML code to show the use of tables for a better control over question and embedded-answer boxes alignment.

<table>
    <tbody>
        <tr>
            <td>
                Subquestion 1:
            </td>
            <td>{1:SA:%100%A~%0%XXXXX}</td>
        </tr>
        <tr>
            <td>
                Subquestion 2:
            </td>
            <td>{1:SA:%100%BB~%0%XXXXX}</td>
        </tr>
        <tr>
            <td>
                Subquestion 3:
            </td>
            <td>{1:SA:%100%CCC~%0%XXXXX}</td>
        </tr>
        <tr>
            <td>
                Subquestion 4:
            </td>
            <td>{1:SA:%100%DDDD~%0%XXXX}</td>
        </tr>
    </tbody>
</table>

Markup text and preview of Moodle embedded-answers

The same length dummy answers seems to work. Is there any other known way to adjust the sizes of the embedded-answer text boxes?

0 Answers0