Application Center - Maplesoft

App Preview:

Creating Quizzes in Descriptive Statistics

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application




Student Statistics: Creating Quizzes for Descriptive Statistics

Using the Quiz  command from the Grading package, it is possible to generate interactive quizzes that ask students to answer questions on topics in Statistics, such as finding the mean, median, or standard deviation of a sample of data, or specifying the interquartile range directly from a plot of a sample.

Defining a randomly generated data sample

 

To begin with, we can declare a procedure that generates a random sample of data:

InitializeData := proc()
    local data;
    
    randomize();
    data := Vector[row](5, rand(1 .. 10));
    Grading:-Quiz:-Set( = data);
    return data;
end proc:

Two key commands are used to randomly generate the data: randomize , which resets the seed for random number generation, and inside of the data vector, and the rand( )  constructor, which is a random number generator, generating in this case number between 1 and 10.

 

In order to use this data sample in a quiz, we also need to use the Grading[Quiz][Set]  command in order to send the generated data sample to the quiz creation module. Once we have created this procedure, we can simply call it in order to return a randomly generated sample:

InitializeData();

Vector[row]([2, 9, 9, 3, 5])

(1)

Quiz: Calculate the Mean

 

In order to create our first quiz, we next create our grading procedure:

GradeMean := proc()
    uses Grading:-Quiz;
    evalb( Student:-Statistics:-Mean( Get() ) = Get(`$RESPONSE`) );
end proc:

In this procedure, we compare the known value of our sample using the Student[Statistics][Mean]  command with the response entered by the student. We retrieve the response using the Grading[Quiz][Get]  command.

 

To generate our quiz, we use the Quiz command, first specifying the question, then grading procedure, and finally any initialization procedures that generate our data:

Grading:-Quiz( "What is the mean of the following sample: $data", GradeMean, InitializeData );

By entering a value in the above text box and clicking 'Check Answer', students will receive a notification on whether or not their response is correct.

Quiz: Calculate the Median

 

Similar to the example for finding the Mean, since we have already created a procedure for initializing our data, we can start by creating the grading procedure for comparing the known Median value with the entered response. The evalb  command is used to determine if these two match, returning either a true or false answer.

GradeMedian := proc()
    uses Grading:-Quiz;
    evalb( Student:-Statistics:-Median( Get() ) = Get(`$RESPONSE`) );
end proc:

Grading:-Quiz( "What is the median of the following sample: $data", GradeMedian, InitializeData );

Quiz: Calculate the Standard Deviation

 

It is also important to note that all of the created quizzes can be regenerated using the 'Try Another' button in the created quiz.

GradeStandardDeviation := proc()
    uses Grading:-Quiz;
    evalb( Student:-Statistics:-StandardDeviation( Get() ) = Get(`$RESPONSE`) );
end proc:

Grading:-Quiz( "What is the standard deviation of the following sample: $data", GradeStandardDeviation, InitializeData );

Quiz: Find the Interquartile Range

 

The Quiz command can also be used to create questions using plots. In the following example, we start by creating a new initialization procedure that creates a random sample of data and in addition, a plot of this data. Both of these are set to variable names that are then send to the quiz module using the Quiz[Set] command.

InitPlot := proc()
    local data, qplot;
    
    randomize();
    data := Vector[row](5, rand(1 .. 10));
    Grading:-Quiz:-Set( = data);

    qplot := Student:-Statistics:-InterquartileRange(data, output = plot);
    Grading:-Quiz:-Set( = qplot);

    return NULL;
end proc:

Similar to the above examples, the grading procedure for the plot question compares a response with the calculated value from routines in Student[Statistics]:

GradeIQR := proc()
    uses Grading:-Quiz;
    evalb( Student:-Statistics:-InterquartileRange( Get() ) = Get(`$RESPONSE`) );
end proc:

In this case, we can also add more options to the quiz command, such as specifying the size of the plot:

Grading:-Quiz( "Using the following graph, calculate the interquartile range: $plot", GradeIQR, InitPlot, plotsize=[400,400] );

See Also

 

Student , Student[Statistics] , Grading[Quiz] , Student[Statistics][Mean] , Student[Statistics][Median] , Student[Statistics][StandardDeviation] , Student[Statistics][InterquartileRange] , examples,Quiz

Legal Notice: © Maplesoft, a division of Waterloo Maple Inc. 2014. Maplesoft and Maple are trademarks of Waterloo Maple Inc. This application may contain errors and Maplesoft is not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact Maplesoft for permission if you wish to use this application in for-profit activities.