Learn how to create free response questions, which take advantage of Wolfram's knowledge base. Set conditions and add optional paramters.

Free response questions are a great question type to elicit answers from students when the questions are open-ended or there are different ways to answer. SYLVA’s interpreter can understand multiple types of inputs including but not limited to numbers, strings, expressions, geographic locations, and even files such as images or notebooks.

We’ll review how to create a standard free response question by:

- Creating a question
- Defining conditions for the solution
- Adding parameters (optional)

Let’s create a question. Write the question then choose Free Response from the Answer type dropdown.

Based on the solution to the question, choose the best suited interpreter for the answer that students will provide. In our example, we are asking the students to write the name of a city as the answer, so I’ll go ahead and select City as the interpreter.

The next step is to determine the conditions for a student’s answer to be considered correct.

It helps to break down the original question. In our example, in order for the student’s answer to be correct:

- the city must first be within 300 miles from London
- the city must be outside of the UK

I’ll write these as 2 separate conditions. We can add more conditions by clicking the **(+)**.

In the template, we can see the basic notation ** #givenAnswer == 1. &** uses

By setting the interpreter, we already made sure that the answer must be a city and other answers will not be accepted.

For the first condition, we first want to calculate the distance between London and the student’s given answer.

Second, we want to confirm that distance is less than 300 miles.

Now condition one is complete and says, take the student’s given answer, calculate the distance between that city and London, then check if it is less than 300 miles.

The second condition is that the student’s given answer must be outside the UK. So I’ll go ahead and say the given answer is **not** within the United Kingdom.

Both conditions are now complete. Under the points column, you can see we will award 1 point for meeting each condition separately. If you want, you can also combine both conditions into one line of code to award points only if the student meets both conditions.

Now let’s preview the question and test it out to check it works properly.

We can check **Paris**, which is both within 300 miles from London and not within the UK. We are awarded full points.

We can try again with **Tokyo** which is not within the UK but more than 300 miles from London. We receive only partial points.

Lastly, let's try **Glasgow**. Glasgow is both within the UK and more than 300 miles from London. So, we receive no points.

Let’s return to our original question. We can create different versions of the same question by adding a parameter. Perhaps we want to change the distance of 300 miles to be a range of 300 to 500 miles.

- In the original
**Question**, we replace 300 with the parameter distance defined by back ticks.*`distance`*

- We can define this parameter by going to
**Assets (+)**,**Parameter**, naming it distance and setting the range of 300 to 500 in steps of 50 miles.

- The last step is to include the parameter variable in the conditions. Only condition one includes the distance measurement. We replace the 300 with the notation
.*TemplateSlot[“distance”]*

Note that the parameter notation uses ** TemplateSlot["distance"]** when using expressions and the notation uses back ticks

Remember that the parameter needs to be stated in 3 places:

- the
**Parameters**section - the
**Question** - in the
**Conditions**

Let’s preview the question again, and we can see the question uses a certain number of miles. If we preview the question again, the question randomly selects a different number of miles from our provided range.

Don’t forget to save your work once you're done and then deploy your assessment to SYLVA when you’re finished!

Now you’re equipped with the basics to get creative with your own free response questions. All you need to do is create a question, select free response as the question type, define conditions for the solution, and if you want, add parameters to create different versions of the same questions. You have great flexibility with selecting among a variety of interpreters for student answers. The interpreters and automatic grading functionality means you no longer need to list up every possible solution or grade different answers by hand, saving you both an immense amount of time and effort.