numerical questions using base 60 with tolerances

numerical questions using base 60 with tolerances

autor Edward Bolton -
Počet odpovedí: 14

Hi All,

I am using Moodle 3.6 Is there any way of setting a numerical question to base 60. I want the students to give time based answers and i want to give them a tolerance.  if the answer is close to the hour  i am unable to give a tolerance  as the accepted answer would not look like a time.  

for example  the students are asked to calculate the tides time in order for a ship to pass under a bridge.  The answer let say is 15:54, but the ship would be able to pass under that bridge between 15:39 to 16:09 so i need all of the times between to be acceptable answers.  if i were to use standard tolerances it would accept 1539-1569 the latter not being a real time.   


Thanks 

Edward 

Priemer hodnotení : -
V odpovedi na Edward Bolton

Re: numerical questions using base 60 with tolerances

autor Dominique Bauer -
Obrázok: Documentation writers Obrázok: Particularly helpful Moodlers Obrázok: Plugin developers
Hello Edward,

Tim is right, this is not possible.

However, you could use a workaround. Write or have someone write for you a JavaScript that reads the student's answer from the answer box, for example upon clicking the Check button, saves it temporarily, multiply the digits before the colon by 60, add the digits after the colon, and put the total back in the answer box. This value can then be evaluated by the Calculated question within the absolute error specified. Upon page reload, put back the original student's answer in the answer box.

This will most probably work fine and will be transparent to the student. The required code is simple for anyone with some JavaScript knowledge.
V odpovedi na Dominique Bauer

Re: numerical questions using base 60 with tolerances

autor Dominique Bauer -
Obrázok: Documentation writers Obrázok: Particularly helpful Moodlers Obrázok: Plugin developers
Hello Edward,

I wrote the code to read a time, using JavaScript Date objects and methods, and made an example with the Formulas question. The code can also be used with the Calculated question by just replacing the designation of the answer box.

Formulas_20201208_1811.png


V odpovedi na Dominique Bauer

Re: numerical questions using base 60 with tolerances

autor Joseph Rézeau -
Obrázok: Core developers Obrázok: Particularly helpful Moodlers Obrázok: Plugin developers Obrázok: Testers Obrázok: Translators

Just tried it on your site, Dominique. Does not work as expected, see screenshot.

V odpovedi na Joseph Rézeau

Re: numerical questions using base 60 with tolerances

autor Dominique Bauer -
Obrázok: Documentation writers Obrázok: Particularly helpful Moodlers Obrázok: Plugin developers
Joseph,

Thanks for taking the time to try my question. Úsmev

From what I see, it works perfectly on Chrome and Firefox, and whatever the language of the browser.

Please could you tell me how you got to your screenshot?
V odpovedi na Dominique Bauer

Re: numerical questions using base 60 with tolerances

autor Joseph Rézeau -
Obrázok: Core developers Obrázok: Particularly helpful Moodlers Obrázok: Plugin developers Obrázok: Testers Obrázok: Translators

Hi Dominique,

I confirm that it does not work in any of my installed browsers. Here's another example:

When I look in the Console, I get an infinite number of error messages like this one:

V odpovedi na Joseph Rézeau

Re: numerical questions using base 60 with tolerances

autor Dominique Bauer -
Obrázok: Documentation writers Obrázok: Particularly helpful Moodlers Obrázok: Plugin developers
Joseph,

The problem is with the Date objects and methods I used and the time zones. (You are in France 6 hours ahead of us in Quebec). I will fix this problem shortly (the question, not the time zones Mrnutie).

Thanks again for reporting the problem.
V odpovedi na Dominique Bauer

Re: numerical questions using base 60 with tolerances

autor Joseph Rézeau -
Obrázok: Core developers Obrázok: Particularly helpful Moodlers Obrázok: Plugin developers Obrázok: Testers Obrázok: Translators

Ah, "maudits français !" Mrnutie

V odpovedi na Joseph Rézeau

Re: numerical questions using base 60 with tolerances

autor Dominique Bauer -
Obrázok: Documentation writers Obrázok: Particularly helpful Moodlers Obrázok: Plugin developers
I don't believe the error messages are due specifically to this question and I wouldn't worry too much.

I think they probably relate to small syntax nonconformities in the PHP code of the Formulas question. These small nonconformities are not serious, but they should nevertheless be corrected as soon as possible.

C'est chose du passé. Il y a de plus en plus de Français au Québec et la plupart semblent heureux et très appréciés. Évidemment côté culture, histoire..., le Québec c'est l'Amérique, pas l'Europe.
V odpovedi na Dominique Bauer

Re: numerical questions using base 60 with tolerances

autor Dominique Bauer -
Obrázok: Documentation writers Obrázok: Particularly helpful Moodlers Obrázok: Plugin developers
I fixed the question and think it should now work in any time zone.

# Joseph, you would do me a favor if you could check if it works in your time zone which is different from mine.

Since I didn't know exactly what Edward, the OP, wanted to do, I opted to use the Date objects and methods which seemed easier. I could also have done the calculations directly, which would not have been very complex either.

So, by using a little JavaScript code, student answers can be treated to adapt them to a particular format, here that of time.
V odpovedi na Dominique Bauer

Re: numerical questions using base 60 with tolerances

autor Joseph Rézeau -
Obrázok: Core developers Obrázok: Particularly helpful Moodlers Obrázok: Plugin developers Obrázok: Testers Obrázok: Translators

Works fine with my time (Central European Time).

V odpovedi na Joseph Rézeau

Re: numerical questions using base 60 with tolerances

autor Edward Bolton -
thats for all your time looking into this. I was just look for a tool that would allow answers to be submitted where the tolerances crossed the hour. i will have a go with what has been produced. thanks again
V odpovedi na Edward Bolton

Re: numerical questions using base 60 with tolerances

autor Joseph Rézeau -
Obrázok: Core developers Obrázok: Particularly helpful Moodlers Obrázok: Plugin developers Obrázok: Testers Obrázok: Translators

Hi Edward,

You might try using one of the question types which use regular expressions:

For example I managed to formulate your case in my own RegExp question type like this:

(15:(39|(4(0|1|2|3|4|5|6|7|8|9)))|15:(5(0|1|2|3|4|5|6|7|8|9))|15:(5(0|1|2|3|4|5|6|7|8|9)))
 

will accept:

  • 15:39
  • 15:40
  • 15:41
  • 15:42
  • 15:43
  • 15:44
  • 15:45
  • 15:46
  • 15:47
  • 15:48
  • 15:49
  • 15:50
  • 15:51
  • 15:52
  • 15:53
  • 15:54
  • 15:55
  • 15:56
  • 15:57
  • 15:58
  • 15:59
  • 15:50
  • 15:51
  • 15:52
  • 15:53
  • 15:54
  • 15:55
  • 15:56
  • 15:57
  • 15:58
  • 15:59

But it's rather tedious to enter the formula so would not recommend it.Mrnutie

V odpovedi na Joseph Rézeau

Re: numerical questions using base 60 with tolerances

autor Joseph Rézeau -
Obrázok: Core developers Obrázok: Particularly helpful Moodlers Obrázok: Plugin developers Obrázok: Testers Obrázok: Translators

Wrong formula, sorry, correct formula should be:

(15:(39|(4(0|1|2|3|4|5|6|7|8|9)))|15:(5(0|1|2|3|4|5|6|7|8|9))|15:(5(0|1|2|3|4|5|6|7|8|9))|16:0(0(0|1|2|3|4|5|6|7|8|9)))