Statistical questions with answer based on a random file (with randomly generated data)

Statistical questions with answer based on a random file (with randomly generated data)

by Matthias Studer -
Number of replies: 5

In my statistical course, I would like to provide exercises with randomly generated data (i.e., one different dataset for each student). There are several reasons for that.

 - I have around 200 students.
 - Students cannot copy the answer of another student.
 - They can run several attempts with different numbers.
 - The analysis should be done in an external software (SPSS in my course).

I have seen the "Calculated question" (or maybe, "computed questions"). However, I cannot use it, since I should typically have a file (and not data printed on the screen) and typically something like 4'000 thousand values (several variables for several individuals).

Typical questions on this dataset would be:
 - Compute the mean using a statistical software (or another more advanced statistical analysis).

I thought that it might be quite easy to generate the datasets in R. I would end up with say 200 files. I could also provide the right answers (i.e., the mean) for each dataset for each question.

My question is: Is there a way to manage such kinds of settings with Moodle?

I thought about the following:
 - Quiz cannot be used because
        1) I need to propose a random file AND the answer would be different for each file.
        2) It is not feasible to generate one question for each question (i.e. mean) and dataset. It would take too much time.
 - Questionnaire: I could use a questionnaire to retrieve the answers and then make the corrections in R. But how can I send the feedback to the students ?

If you have any experience or proposition with these kinds of questions, I would be very interested!

Many thanks for your answer!
Average of ratings: -
In reply to Matthias Studer

Re: Statistical questions with answer based on a random file (with randomly generated data)

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I don't know of any question type that supports having a randomly generated file for each student, although I can see that it would be a good feature.

If you want sophisticated random generation of Maths problems, then it may be worth your while having a look at the STACK question type: https://moodle.org/plugins/qtype_stack

I am just wondering: Could you do a link to a downloadable file in the quiestion text using a data: URL. Like

<a href="data:text/plain,1,2%0a3,4%0a5,6">Download your dataset</a>

Let's try it: Download your dataset.

But, there is some way to go to get the contents of that randomly generated.

In reply to Matthias Studer

Re: Statistical questions with answer based on a random file (with randomly generated data)

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

I think that I know what you are after\ because I teach statistics with Moodle.

I like to use calculated multiple choice.  It takes some effort to understand this question type, but briefly, I have a dataset with some values that I change.  The answers to following questions also change based upon what the students see in their randomized calculated choices for this question. 

The bottom line is that it works, with some effort.

You need to dig into this question type, however.  It is really cool!  And I love it.  Moodle is the only LMS with this question type.

I might be able to share an example, if you think that you want to invest your time into it.  I use this technique for a class that has around 80 students in it.

In reply to Matthias Studer

Re: Statistical questions with answer based on a random file (with randomly generated data)

by Matthias Giger -
Picture of Particularly helpful Moodlers

Depending on how sophisticated your calculated statistics are, you could use the GeoGebra question type.

  • In GeoGebra you can create random numbers and even make use of JavaScript.
  • You have basic statistical computation.
  • The question type allows for a quick check whether an answer is correct or not (Boolean).

However, I've never tried to do something with a larger number of measurements. So I don't really know how well GeoGebra would perform in a Moodle environment for such a task.

In reply to Matthias Giger

Re: Statistical questions with answer based on a random file (with randomly generated data)

by Matthias Studer -

Many thanks for all your answers! However, I went through each proposition and found no suitable solutions (unfortunately!).

I thought that I can maybe reformulate my question. What I would like is to have a different data file for each user (or best tentative), leading to different solutions for each question. Basically, I could describe the possible answers using a CSV file (or whatever file format) or in a table that would look like this.



File  Answer to question 1
 Answer to question 2
... Answer to question q
file1.sav
                       2.56
                   5.65
   ...             X1q
file2.sav                      32.89
                  1.89
   ....
            X2q
fileN.sav                      Xn1
                     Xn2
  ....
            Xnq

with n (number of datasets) typically between 100 and 300 and q (number of questions) around 10

Is it possible to have quiz version? I mean half the student would get the quiz corresponding to line one and the other half line 2.

Then is it possible to automatically import a version of a quiz using for instance some kind of XML? If this is the case, I could generate in R an XML file for 200 version that I could import in Moodle.

Do you think that this could be done in one way or the other?



In reply to Matthias Studer

Re: Statistical questions with answer based on a random file (with randomly generated data)

by Matthias Studer -

I just saw the discussion here: https://moodle.org/mod/forum/discuss.php?d=231180

If some kind of sequence of variants were available, this would perfectly suit my needs. The use of cloze question type is also proposed. I suppose that I could generate the syntax for several (i.e., 200) cloze questions, each related to a different dataset. However, this forces the student to answer all the questions before submitting the page. Therefore, students might lose their answers if they accidentally close their browser.


Thanks for your answers.