![]() Type refers to what type of input it is, it can be a floating-point number (float), an integer (int) or a string of text (str). Description is as expected, a description of the input. Key is effectively the name of the field and the key is used as a variable in creating the calculation steps, i.e., how we get the correct answers to which we match the students' answers. We define (at minimum) three attributes for the student inputs that are the key, description, and type. ![]() It is a dictionary of the boxes defined by Global extra. What we read as input is governed by gapfiller_fields = (Lines 16 – 18 in Figure 3). How to setup reading the user input, doing the calculations and checking the answers. ![]() Using the question template of Antti Karttunen, Figure 3 shows the relevant parts we need to consider. Before setting up anything else, the bottom of the Customisation field has the section Input UIs, here you should select Gapfiller from the drop-down menu. Checking the answersįourth step is setting up what CodeRunner uses as input, what it calculates, and what it checks. Typesetting tip: Global extra is monospace, so every character and space will be of same width. This creates a box with a width of 10 characters. The boxes are created inserting a number within square brackets inside curly brackets, like in the example we have typed. The syntax is pretty simple, everything you type in the Global extra field will appear in the answer field for the students. Setting up the Answer field with Global extra. Figure 2 shows what we need to type in order to produce the fields seen in Figure 1.įigure 2. This is the part with the gray background in Figure 1. Next, we make the answer field, which is defined by Global extra, i.e., it asks for the student's input. This is similar to every other question type in Moodle. between Question 1 and Answer, i.e., the bulk of the question. This is the piece of text that students see in Figure 1. Setting what the student seesĪ logical order for the actual content of the question is to first write the question text in General -> Question text. This is designed to be something that the students can do over and over again to see when they have the correct answer without any penalties, so we set Penalty regime to 0. Then, depending on what you are doing with the question, you can set Marking to fit your needs. In CodeRunner question type we set the Question type to python3. Then you only need to change the actual contents of the question. When creating these kinds of questions, we need to give input to five sections (in order of appearance):ģ) General -> Question name and Question textĪll common settings are already set if you use the given Moodle XML file. At its core, CodeRunner runs the calculations based on the students' input and checks whether the answers are correct.įigure 1. Later we will dig deeper with an example where the student must perform a linear fit of their data, but first let's look at a simple question, calculation of the amount of substance from a weighed sample. We will examine the functionality of these "expanded Calculated" type of questions with two examples. CodeRunner allows for each student to input their own initial values, say, from a laboratory exercise, and we can check their homework automatically. The Calculated question type still requires an input from the teacher as to what values are used, even if they are randomized between students. Moodle XML file for this exercise (Download and import it in Moodle)ĬodeRunner offers even more flexibility when you need to include varying initial values for calculations in your exercises.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |