Lists and sets

You can have answers with lists and sets. There are multiple forms understood as lists; you can configure it in the Input options and Validation options sections.

Wiris Quizzes 4 documentation

This documentation page has been updated to the latest Wiris Quizzes version. You can find the same information for the previous versions here.

Let us create a basic question asking to sort a set of integers:

By default,

  • Lists are allowed but elements need to be enclosed within curly brackets.
  • Comma is used as a separator.
  • The student's answer is compared as a list (taking into account order and repetition).

In this example, we check the option Lists without enclosers

Thus, the following answers will be validated as we specify in the table below.

Student answer Validation
-7,-4,1,5
left curly bracket negative 7 comma negative 4 comma 1 comma 5 right curly bracket
table row cell negative 7 end cell row cell negative 4 end cell row 1 row 5 end table blank
blank
negative 7 space minus 4 space 1 space 5

LIVE DEMO

By default, to be accepted, lists in student and correct answers must have equivalent items and in the same order. That is, the order is important, and repetition has sense. In contrast, sets are lists without order nor duplicated items.

As an example, we can ask for the roots of a given polynomial and we might be interested in accepting any answer with the correct values.

Thus, we can set the lists to be understood as sets in Validation options > Comparison with student answer. That is, ignore repetition and order in the comparison.

The grading will behave as you can see below.

Student answer Validation
left curly bracket 1 comma 2 comma 2 right curly bracket
1 comma 2 comma 2
1 comma 2
1 comma 2 comma 2 comma 2 comma 1
1 space 2 space 2

LIVE DEMO