Re: Limiting the number of answers in seprarate groups mode
this line in mod\choice\view.php gets the number of answers for a choice to calculate how many people have selected a particular choice:
$countanswers = (get_records("choice_answers", "optionid",
$optionid));
- this doesn't take any notice of what group the user is in.
you could set up seperate Choice's for each group, but
also goto http://moodle.org/bugs and log a feature request for this, I might get to adding the feature sometime!
Dan
Re: Re: Limiting the number of answers in seprarate groups mode
thank you for your quick answer. Creating so many choice would not solve the problem, because eg. one student could vote in every choice.
Actually the time to create so many choices would be longer than writing the patch to view.php.
I attach the new fixed version of view.php without this issue. It's tested and works properly. Perhaps worth putting it into CVS.
Jacek
Re: Re: Limiting the number of answers in seprarate groups mode
nice work! - there's a slightly newer version of View.php that allows the admin to be shown in the listing. I've modified your view.php - try the attached file. - I notice you've also killed some ugly "stupid" JS with some better code! (I haven't tested the page yet!)
- can you also make your modifications to report.php? - I'll upload them to CVS after testing on this end!
Dan
Re: Re: Limiting the number of answers in seprarate groups mode
Hi guys,
This is great, and just what I need for a course I'm running. However, I don't know what to do with the view.php file. I'm new to moodle and not much of a programmer. Any help would be much appreciated.
cheers,
Erik
Re: Re: Limiting the number of answers in seprarate groups mode
thanks,
Dan
Re: Re: Limiting the number of answers in seprarate groups mode
This is exactly what I was looking for. Thanks!
Will it work with 1.5.2 as well? Can you tell if it will be incorporated in version 1.6?
Re: Re: Limiting the number of answers in seprarate groups mode
thanks,
Dan
Limiting the number of answers in seprarate groups mode 1.6 Patch
replace the files in your mod\choice directory with the files in the attached zip file.
thanks,
Dan
Re: Limiting the number of answers in seprarate groups mode 1.6 Patch
Re: Limiting the number of answers in seprarate groups mode 1.6 Patch
I have checked your modification for moodle-16. But in my opinion it will not work, since moodle-16 allows a single user to participate in more than one group. To make this work we need to record group number in a table choice_answers, and in view.php allow a student to select for which group the choice is made.
There is a similar problem with teachers, a teacher can belong to many groups or not belong to any. What you think about this large modifications and stable state of choice module in 1.6 branch?
Jacek
Re: Limiting the number of answers in seprarate groups mode 1.6 Patch
I was hoping that if I had separate groups, then it would use the limit number as the limit per group. I use metacourses for teachers who teach various sections of the same course (for example, Algebra 1-Section 01, Algebra 1-Section 2). I create a metacourse called Algebra 1-TeacherName with the section courses as children. Then I create a group for each child course and put in the group the participants that correspond to each section. I would like to be able to use a choice with separate groups to allow one student from each section to sign up for a topic. The patch did not seem to allow that behavior and I did not like that it seemed to log out the user if someone else had already picked an option.
Currently, I have instructed teachers to create a single choice for each section but this is not ideal. If a feature request does not exist, I would be happy to create one if there is interest in further developing the use of groups with the choice activity. With improvements with groups in 1.8 and 1.9 it seems like an opportune time to make such a request. Peace.
Re: Limiting the number of answers in seprarate groups mode 1.6 Patch
Hi Anthony,
I've never really been happy with the way the Choice works with groups - I just haven't had the chance to sit down and figure out how it "should" work! - Would love for you or anyone else to work out how you feel it should work and put it in as an improvement in the Tracker. - I'm not sure when I will get a chance to implement what is being asked for, but if the tracker item is well written and thought out, I might just manage it before 1.8 release! - (I have got a few other things I'm hoping to have ready for then anyway!)
Thanks!
Dan
Re: Limiting the number of answers in seprarate groups mode 1.6 Patch
-- from MDL-7429:
I have given some thought to how to handle groups or at least how I would like to see them implemented/revised to work in choice activities. The behavior would remain the same for no groups - any member of the course can select an item with the limit being enforced for that one choice.
For visible groups, I would like one choice created for each group (similar to wikis, forums, etc.). I believe that this consistency is important. Within the choice for that group the limits are enforced. Hence, one student per group being able to sign up for a given topic. Some code may need to be re-worked to view the results of other groups. If the results of the choice are published (i.e. visible to students), then the members of other groups should be able to see the those results.
For separate groups, I would like one choice created for each group. Within the choice for that group the limits are enforced. A student who is not in the group would not be able to view the results of other groups.
--
Re: Limiting the number of answers in seprarate groups mode 1.6 Patch
yours comments on MDL-7429 are pretty clear for me (my original patch for moodle 1.5 works like this), but as I wrote in my previews post in current moodle versions student (and teacher) can belong to more than a single group. These students should have a possibility to select for which group they made a choice. Without this support the new implementation of limiting the number of answers in choice module will be incomplete.
Re: Limiting the number of answers in seprarate groups mode 1.6 Patch
Re: Limiting the number of answers in seprarate groups mode 1.6 Patch
Re: Limiting the number of answers in seprarate groups mode 1.6 Patch
Hi Jacek,
This would not make it into 1.6(except as a custom patch) - it could possibly end up in 1.8 or later however.
Thanks,
Dan
Re: Limiting the number of answers in seprarate groups mode 1.6 Patch
Any patch for 1.8.3+?
if instead of putting the zip of the files I would prefer to have a patch (a diff) that allows to apply the changes to the current version.... the I could do it myself...
Joan
Re: Limiting the number of answers in seprarate groups mode 1.6 Patch
Hi Joan,
Have a quick look at David Murdak's patch in MDL-11850 - I plan on reviewing it properly this week or next - it might solve your problem!
Note. - the patch will likely not work correctly in Moodle 1.9 - the choice lib is changing a bit in those areas.
Thanks,
Dan