Average Rank Precision

Average Rank Precision

by Vaishnav Desai -
Number of replies: 4

 

Screenshot

Hi all,

I am facing a small problem. As I have shown in the screen shot I am getting the average score of each item (i.e 2.2 , 2.3 etc). Can anyone guide me on how I could increase the number of decimal places in the average score..(Ex. 2.2xx).

Thank You

Average of ratings: -
In reply to Vaishnav Desai

Re: Average Rank Precision

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Which version of Moodle and Questionnaire are you using?

In reply to Joseph Rézeau

Re: Average Rank Precision

by Vaishnav Desai -

I am using Moodle V -1.9.14.1

and Questionnaire - Version 2005021101

I got these from the readme.txt file.

 

Thank You

In reply to Vaishnav Desai

Re: Average Rank Precision

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

In file <yourmoodle>mod/questionnaire/questiontypes/questiontypes.class.php, inside function mkresavg(), locate the following two sprintf() functions:

line 1994:

$table->data[] = array(format_text($content, FORMAT_HTML), $out, sprintf('%.1f', $avg));

line 2001:

$avg = sprintf('%.1f', $avg);

and change the %.1 to any value you want for the number of decimals you need, e.g.

sprintf('%.2f', $avg)

will give you 2 decimals, etc.

Joseph

PS.- See attached screenshot showing you where to find the version of your installed modules.

Attachment 15-05-2012 10-25-07.jpg