Best practice forum (Archived)

Quiz Questions Losing Correct Value on Edit

 
Michael Trio
Quiz Questions Losing Correct Value on Edit
by Michael Trio - Thursday, 14 March 2013, 7:18 AM
Group Partners

Something has gone awry with quiz questions somewhere between versions  2.2.5.1 and 2.2.15. (Big range, I know!)  This used to work properly in the older version, but does not now.  Here's what's happening:

1. Create a quiz

2. Go to the question bank and add a question - multiple choice in my testing - with at least one answer worth 100%.

3. Edit the question

Result:  Any answers set to be worth 100% now are worth none.

Expected: 100% values stay 100% when opened.

If it's helpful, my very VERY hacky temporary fix was to modify the onQuickFormEvent function in lib/pear/HTML/QuickForm/select.php and add

if ($value === 1.0) $value='1.0';

before the setValue.

Any thoughts?

Thanks,

Michael

Simon Coggins
Re: Quiz Questions Losing Correct Value on Edit
by Simon Coggins - Thursday, 14 March 2013, 3:06 PM
Group Totara

This bug was caused by the fix to T-10291 added in 2.2.15.

I have a fix in review and we'll include it in the next release once it's been tested.

Simon Coggins
Re: Quiz Questions Losing Correct Value on Edit
by Simon Coggins - Thursday, 14 March 2013, 3:17 PM
Group Totara

Here is a copy of the patch (to be applied against 2.2.15) in case you would like to apply it sooner.

Simon