atutor.no

Here be links.

Changing the algorithm for multiple answer questions

Vegard A. Johansen's picture

This is a followup to my post Improving "multiple answer" question type, which we managed to sort our due to great help by Serhiy - thanks!

Read the comments on the previous post to get the discussions, here's only the highlights, the solution, and the tools you need to get this done on your ATutor install.

Problem

The problem with the multiple answer questions was that is was an all or nothing approach to scoring them, which ment it was hard to score them automatically.

Put differently: if you had a question worth 5 points, which had 10 alternatives where 5 of them was correct, the student would have to match all the 5 alternatives to get hs 5 point. If he had 4 correct he got nothing.

Solution

We wanted to change this to work consistently with the matching question type, where the student would get 4 points for his 4 correct alternatives, and at the same time make sure he couldn't get everything correct by just selecting all alternatives.

Serhiy allready had the algorithm to do this, so we got it from him and here is an example of the new calculation for multiple answer questions:

Here's the new logic / flow:

  • The median score per alternative is calculated from the max possible score on the question (in this example it's 1 for all alternatives, but it would be a different number if you had a higher max possible score on the question)
  • For this example, when median = 1: one correctly marked alternative gives 1 point, one falsely marked gives -1.
  • it is not possible to obtain negative score, as 0 is the lowest you can go.

Get it done - change algorithm

Rather than creating a patch I'll describe to you how to get this done on your own system. There are two parts of it, and you might not want to use both of them.

First, replace the old algorithm with the new one. Find the file include/classes/testQuestions.class.php and within that change line 1425 to 1455 with the code in the attached file (down below) called MA_modified_part_of_testQuestions.class.php.txt. Note that this is true for the current (1.6.2) version of the file in ATutor, but not neccessarily for later versions.

This will change the algorithm for new results, but you might want to make use of this algorithm on your previous results too?

Get it done - update old scores

To update all your earlier test results (note again, there might be reasons you do not want to do this.

But if you wish to, which we did, download the attached custom.zip file, unzip it and you will find a folder called custom and a file within it called updateTaskScores.php.

Upload the folder to you ATutor root directory, log in as admin, navigate to the file online, that is http://yourinstall/atutor/custom/updateTaskScores.php

..and click the buttom with the Norwegian text "oppdater poeng på alle tester" ("update points on all tests"). Wait, done.

Remove the custom folder and file again and you are all set!

Huge thanks to Serhiy for the algorithm and Svein-Tore for the update script!

AttachmentSize
MA_modified_part_of_testQuestions.class_.php.txt1.69 KB
custom.zip1.97 KB

Comments

Serhiy Kostyshyn's picture

Re: Changing the algorithm for multiple answer questions

I'm glad to see you've got it done. And thanks for mentioning my input, though the change is really modest: it's only an appropriate fragment of Joel's code cloned.

It should be added here that we've been using it for 2 years in a production environment – without any problems. So one may consider it bug-free.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

Hi, this is the atutor.no blog, where the community can blog about things related to use, development or thoughts concerning the open source LCMS ATutor!

Register or log in to start blogging, or get in touch for any reason!

Recent comments