Choices not avaiable

Choices not avaiable

by Khurram Iqbal -
Number of replies: 13
In have created a an activity "Choices". It does not shows the choices (radio button). I donot know why. I have 1.9 version of moodle installed on Linux machine. Can anyonme please help cuz our course has been started already. I am also attaching a screen caputure for your reference.
Attachment Choice_not_available.gif
Average of ratings: -
In reply to Khurram Iqbal

Re: Choices not avaiable

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
It was fixed a couple of days after Moodle 1.9 was released - please upgrade to the latest 1.9 stable.

thanks,

smile

Dan
In reply to Dan Marsden

Re: Choices not avaiable

by Khurram Iqbal -

Thanks Dan. I am now upgrading my Moodle installation from 1.9 to 1.9 Stable.

really appreciate you help. smile

In reply to Khurram Iqbal

Re: Choices not avaiable

by John Iwaniec -
Khurram,
Did the upgrade resolve this issue. I'm having the same problem following upgrading to 1.9 from 1.8.4. All choice activities work before but only some did not work after. I have very carefully checked to see that settings on all were consistent and consequently am concerned to know that the upgrade is the answer. I'm also concerned that my host provider uses Fantastico to support upgrades and is not currently offering Moodle 1.9.1
John
In reply to John Iwaniec

Re: Choices not avaiable

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Hi John,

this was fixed in MDL-13812

If you don't want to upgrade, you can apply the fix yourself - as per the comments in the bug linked above:

find this in mod\choice\lib.php in function choice_show_form()
if (isset($text) && isset($allresponses[$optionid])) { //make sure there are no dud entries in the db with blank text values.

replace with this:
if (isset($text)) { //make sure there are no dud entries in the db with blank text values.

thanks,

smile

Dan
In reply to Dan Marsden

Re: Choices not avaiable

by John Iwaniec -
Dan,
Thanks for your advice on this. I'm not a coder so perhaps you'll forgive appearances of lameness :|
This is what I find in my version of lib.php:

function choice_show_form($choice, $user, $cm) {

//$cdisplay is an array of the display info for a choice $cdisplay[$optionid]->text - text name of option.
// ->maxanswers -maxanswers for this option
// ->full - whether this option is full or not. 0=not full, 1=full
$cdisplay = array();

$aid = 0;
foreach ($choice->option as $optionid => $text) {
if (isset($text)) { //make sure there are no dud entries in the db with blank text values.

It appears that my version has the modification you are suggesting. Am I missing something?
Many thanks for your kind attention.
John
In reply to John Iwaniec

Re: Choices not avaiable

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Hi John,

maybe your issue is different to the one explained above?

can you please explain your problem, and detail what settings are set in your choice?

thanks,

smile

Dan
In reply to Dan Marsden

Re: Choices not avaiable

by John Iwaniec -
I have 37 choice questions deployed in one of my courses. Prior to upgrading they were functioning as intended. After upgrade some but not all of the choices would not display. An example is the following:
Choice does not display

The settings for this activity are as follows:
Limit: Disable
Choice 1
Choice: All of the time
Limit: 0
Choice 2
Choice: Most of the time
Limit: 0
Choice 3
Choice: Some of the time
Limit: 0
Choice 4
Choice: Never
Limit: 0

Restrict answering to this time period: not checked
Miscellaneous Settings
Display Mode: Display horizontally
Publish results: do not publish results to students
Privacy of results: Publish anonymous results, do not show student names
Allow choice to be updated: No
Show column for unanswered: No
Group Mode: Separate Groups
Visible: Show
ID number: Blank

Settings on all choices are consistent with this example

BTW, I would be happy to create an admin account for you so that you could take a look at the site, if you would be so kind.

Thanks again for your kind attention to this. Again, let me say that all choices were functioning before upgrade.
John
In reply to John Iwaniec

Re: Choices not avaiable

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Hi John,

what do you mean "choice does not display" - could you provide a screenshot to show us what you mean? - also who is logged in when the "choice doesn't display"? - is it a student? - is that student in a group?

thanks,

smile

Dan
In reply to John Iwaniec

Re: Choices not avaiable

by Chris Elkin -
Hi John

Thank you for your post. We too faced the choice bugette but fixed it easily with the aid of your post.

Thanks again big grin

Chris
In reply to Dan Marsden

Re: Choices not avaiable

by michael krikonis -

We had an issue where the options for choice did not display for admin, teacher and student when completing questionaire. See attached.

We applied the fix :

find this in mod\choice\lib.php in function choice_show_form()
if (isset($text) && isset($allresponses[$optionid])) { //make sure there are no dud entries in the db with blank text values.

replace with this:
if (isset($text)) { //make sure there are no dud entries in the db with blank text values.

issue is resolved.

Thanks!

Michael

Attachment Choice.JPG
In reply to michael krikonis

Re: Choices not avaiable

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
thanks Michael,

I worked on the issue with John offline - he had a corrupted site due to a partial restore/partial upgrade failure..

The "Best" fix for this issue is to upgrade to the latest Moodle 1.9.1 - there were a couple of other issues with the choice module that were fixed and 375 bug fixes in total since Moodle 1.9 - see here:
http://tracker.moodle.org/secure/IssueNavigator.jspa?mode=hide&requestId=10543

thanks,

smile

Dan