Drag and Drop

Drag-and-drop questions are a type of interactive question format where students are required to
manipulate elements on the screen by dragging and dropping them into the correct positions.
They have been available since October 2023.

Examples:

DragAndDropMath
DragAndDropText
DragAndDropTable

How do you create a drag-and-drop question?

WebMiau has a template for drag-and-drop questions.

DragAndDropTable

Define possible answers with the \tile{<name>}{<text content>} command in the variables' environment.

1
2
3
4
5
6
7
8
9
10
\begin{variables}       
    \tile{w1}{$-3y+2$}
    \tile{w2}{$3y-2$}
    \tile{w3}{$4y+2$}
    \tile{w4}{$-4y+2$}
    \tile{w5}{$4y-2$}
    \tile{w6}{$x^2+x-6$}
    \tile{w7}{$x^2-x+6$}
    \tile{w8}{$x^2-x-6$}       
\end{variables}

Currently, the tile content is static and cannot be randomized. Therefore, it is not possible to use
variables defined by \randint, \function, or other variable commands.
It's possible to define more tiles than placeholders.

One placeholder corresponds to an answer environment where the solution has to be defined.

If there is only one correct solution for a placeholder, you have to create something like the
following:

1
2
3
\begin{answer}
    \solution{w7} % w7 is the name of the correct tile
\end{answer}

Otherwise, you have to provide all possible solutions:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
\begin{variables}
    \tile{rose}{Rose}
    \tile{mann}{Mann}
    \tile{hund}{Hund}
    % ... other tiles ...
\end{variables}
 
\begin{answer}
    \solution{rose}
    \inputAsString{A1}
    \checkStringsForRelation{
      equalIgnoreCaseString(A1,rose) OR
      equalIgnoreCaseString(A1,mann) OR
      equalIgnoreCaseString(A1,hund)}
\end{answer}

You can put the placeholders anywhere in the question text with the \ansref command. It doesn't
matter if it's in running text or tables, and so on.

DragAndDropTable

Is it possible to mix drag-and-drop questions with other question types?

No, it is not possible. Drag-and-drop questions have a different document class than questions of
type input.xxx. Drag-and-drop questions have to be in a separate problem document.

Examples in WebMiau

Examples

Notice that questions of type draganddrop, with images in tiles, are not supported yet.