Moodle Quiz (Co-Ordinates)

Moodle Quiz (Co-Ordinates)

by Reuben Ellett -
Number of replies: 4

Good Afternoon, All

We are using the latest version of Moodle. 

I need to do a quiz that consists of the student plotting co-ordinates. They are expected to have their own map as a part of the quiz. They need to give a 6 figure co-ordinate to a location on the map. The first 3 digits are the X axis and the last 3 are the Y axis.

If the answer to one of the locations for example is 100278 then there needs to be tolerance within a hundred metres. The upper tolerance would be 101 and 279, and the lower tolerances need to be 099 and 277 respectively.

Answers are entered as a numerical string (E.G. 099279) and need to still be valid within the ranges. I note that the numerical question type has fixed tolerances (for a total numerical value) and as such I cannot use that mechanism - unless I break up the X and Y axis into two separate questions. 

Are there any suggestions in the community as to how I can achieve the result I am looking for?

Average of ratings: -
In reply to Reuben Ellett

Re: Moodle Quiz (Co-Ordinates)

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
When you said the students were potting points, I thought you were looking for the drag-drop markers question type. You might want to check that out.

For specialised parsing of a 6-digit string, I don't think any of the standard question types would do it. Regex, Formulas or STACK question types probably could.
In reply to Reuben Ellett

Re: Moodle Quiz (Co-Ordinates)

by Matthias Giger -
Picture of Particularly helpful Moodlers
It would be simpler to use the coordinates in the usual form (x, y) instead (two input fields), but the Formulas question type could help you to do what you are looking for.

First you divide your number by 1000 and then use the floor() function to get the first coordinate which you compare with a range of desired value +/- 0.1 %. Then you subtract that value times 1000 from your original number to get the second coordinate and also compare it to the desired range.
In reply to Reuben Ellett

Re: Moodle Quiz (Co-Ordinates)

by Reuben Ellett -
So after looking at the offered solutions by Tim Hunt and Matthias Giger (thank you very much for your time, gentlemen) I have come up with a solution... It's simple.

Figures need to be tolerable for the third digit (123) by one number either side (122, 125) as well as the sixth digit (456) being tolerable 1 either side (455, 457).

Easiest way to do this is add in multiple answers, so for example:

Answer 1: 123456 (with a tolerance error of 1)
Answer 2: 122456 (with a tolerance error of 1)
Answer 3: 124456 (with a tolerance of 1)

As the answers are entered in as a six digit string this appears to be the simplest method.

For a bit more context, this is useful for testing MGRS, BNG, or any other map reading/grid reference method that utilises simple X and Y co-ordinates.
Average of ratings: Useful (1)
In reply to Reuben Ellett

Re: Moodle Quiz (Co-Ordinates)

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
This is one of those thigns where, once you see the answer, it seems obvious!

Well done for working that out.