Analysis graph is only brown

Analysis graph is only brown

by Toshihiro KITA -
Number of replies: 5
Picture of Plugin developers Picture of Translators
I use Feedback (ver. 2008050129) on Moodle 1.9.11+.
The bar graph on the analysis result page is in brown color only as shown on the attached image.

I found in the HTML source the color of the bar (GIF image) of each item is same like
<img alt="0" src="pics/0.gif" ...
<img alt="0" src="pics/0.gif" ...

Is this a bug in Feedback module for Moodle 1.9 and is there any way to fix it?
# Feedback module for Moodle 2.0 looked fine when I tested on demo.moodle.net.
Attachment feedback-analysis1.png
Average of ratings: Useful (1)
In reply to Toshihiro KITA

Re: Analysis graph is only brown

by Toshihiro KITA -
Picture of Plugin developers Picture of Translators
I solved the problem by modifying the code as follows:

mod/feedback/item/multichoice/lib.php  (around line 155) and
mod/feedback/item/multichoicerated/lib.php (around line 132)

                if( function_exists("bcmod")) {
                    $intvalue = bcmod($pixnr, 10);
                }else {
                    $intvalue = 0;
                }
should be changed to
                $intvalue = $pixnr - floor($pixnr/10)*10;

# I do not know why the function 'bcmod' must be used in the code if it is not always available...
# On some PHP setup (ex. CentOS 5.5) bcmod seems not available unless you recompile PHP with --enable-bcmath.
Average of ratings: Useful (1)
In reply to Toshihiro KITA

Re: Analysis graph is only brown

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators

Hi Toshihiro,

that is old code I never changed blush. I should do this.
Thank you for reminding my!

Andreas

In reply to Andreas Grabs

Re: Analysis graph is only brown

by Toshihiro KITA -
Picture of Plugin developers Picture of Translators
Hi,

Oh, I guessed so. smile

Thank you very much for developing this useful module.
I am letting students use Feedback via mobile phones including iPhone and Android phones
(thanks to MFM).
In reply to Toshihiro KITA

Re: Analysis graph is only brown

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators

Hi Toshihiro,

I changed the code now in feedback for 1.9 and 2.x

from
$intvalue = bcmod($pixnr, 10);

to
$intvalue = $pixnr % 10;

Thank you for reminding!
Andreas

In reply to Andreas Grabs

Re: Analysis graph is only brown

by Toshihiro KITA -
Picture of Plugin developers Picture of Translators
Oh, % operator is available in PHP!
I did not notice that.

Thank you for your quick revision.