Fair Allocation
Maintained by
Learnweb – University of Münster, Daniel Meißner
This Module lets you add an activity to courses, in which users can rate choices. You may then distribute the users fairly to the choices by maximizing overall 'happiness' in terms of ratings.
This may be an alternative to the choice activity or first-come-first-served.
Comments
Comments are no longer open for new posts. Existing comments remain available to read.
it seems that for some reason your database does not allow to create entries within mdl_groups table without a description value defined. The install.xml of moodle within lib/db/install.xml states that the description field is allowed to be null. Additionally, there are multiple other locations in moodle code, where a group without a description is created.
If you want a hotfix for your problem, you can add this line to your code:
diff --git a/locallib.php b/locallib.php
index 0323c21..cdbbf94 100644
--- a/locallib.php
+++ b/locallib.php
@@ -624,6 +624,7 @@ class ratingallocate {
$data->courseid = $this->course->id;
$data->name = $choices[$choice['key']]->title;
$data->idnumber = $groupid;
+ $data->description = '';
$createdid = groups_create_group($data);
groups_assign_grouping($groupingid, $createdid);
$choiceids[$groupid]['groupid'] = $createdid;
However, I do not consider this as a problem of this plugin.
Grettings
Tobias
This is my fisrt use of Fair Allocation.
I have this server environment :
Moodle 3.3.2 (Build: 20170911)
PhP : 7.1;8
MariaDb : 5.5.52
The allocation are already published but when I chosse to creat groups from Allocation I have this error message :
""""""""""""""""""""""""""""""""""
Error writing to database
More information about this error
Debug info: Field 'description' doesn't have a default value
INSERT INTO mdl_groups (courseid,name,idnumber,timecreated,timemodified) VALUES(?,?,?,?,?)
[array (
0 => '5980',
1 => '01. Des œufs au pesticide (Ph Bou et JM Fra)',
2 => 'ratingallocate_c_6',
3 => 1505741865,
4 => 1505741865,
)]
Error code: dmlwriteexception
Stack trace:
line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
line 1274 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
line 1320 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
line 251 of /group/lib.php: call to mysqli_native_moodle_database->insert_record()
line 627 of /mod/ratingallocate/locallib.php: call to groups_create_group()
line 756 of /mod/ratingallocate/locallib.php: call to ratingallocate->process_action_allocation_to_grouping()
line 61 of /mod/ratingallocate/view.php: call to ratingallocate->handle_view()
""""""""""""""""""""""""""""""""""""
Could you help me to fix this problem?
Thank you!
Gabriel
the version 3.2-r1 does add one important aspect, which is the support of moodle 3.2. When I created this patch, I already read through all change logs for the new version and all should still work as before. However, there were changes in the behat framework and therefore the automatic tests fail currently. Until now I was not able to identify or fix this issue, which is why I do not want to publish a version with 3.2 support, yet. Behind the failures of the tests due to the changes in the behat framework other more severe failures could be hiding. Although, I don't think so, I set the version for now to unavailable.
I will publish the next version as soon as possible (probably end of February).
Best wishes,
Tobias
is there a reason that 3.2-r1 (which does not add more than a language string according to https://github.com/learnweb/moodle-mod_ratingallocate/commits/master) is published but set to "unavailable" here?
Thanks,
Alex
you can find this information here: https://github.com/learnweb/moodle-mod_ratingallocate#algorithm
Best wishes,
Tobias
Thanks a lot for this wonderful plugin. We've used this plugin to support the optional course allocation for all the students in our University. We love this plugin.
Students have provided many feedbacks. One of the most important feedback is about the allocation result. Could you please help to check this feedback and to see if you could help with the function which we really need?
Here's the detail information:
We've selected "Rank Choices" as the rating strategy. Take the monday's optional courses for example. There will be 10 optional courses for 1000 students to choose. Each students can rank the 10 options from 1 to 10. But since this is optional courses, many students only want to attend their favorite courses. They want to have a function which they can select the courses that they don't want to attend. So that system won't allocate them into these courses.
Would you please help to see if we can have this function?
Many thanks.
Best wishes,
Lina
I have a request from a costumer. He's interested in the details of the algorithms used. I didn't found any additional information. Could you add some links or information to the documentation?
Best wishes,
Thomas
Hi Tobias,
Thanks for your prompt reply. I really appreciate it. I've installed the new release and it is good that we can export the email information now. I like the other features in the new release. Many thanks for your great contributions.
About the encoding issue, I've checked the phpinfo.php on our server and it shows the following information:
Content-Type text/html; charset=utf-8
The charset is utf-8, but didn't show if it is unicode or not. I'm reading this article:https://www.toptal.com/php/a-utf-8-primer-for-php-and-mysql
From that article that I need to many changes to my moodle instance, I will investigate more about this.
Many thanks for your help.
Best wishes,
Lina
I checked the encoding issue again. For me it is working with 65001 : Unicode (UTF-8).
However this might be dependend on the platform your server runs on or its configuration. Indeed the plugin itself does not define the encoding for the file.
You can find the encoding of your server using YOURMOODLEINSTANCE/admin/phpinfo.php.
There the encoding is displayed at Content-Type -> charset and at default_charset.
I hope that information is helpful.
Best wishes,
Tobias
Many thanks for your kind help. That's really helpful. I've changed the code in ratingallocate/renderer.php and added the idnumber field into the export function and it works. We can now export the student ID information.
$ratingscells[$user->id][3] = $user->idnumber;
Thanks again for the UTF8 issue, I've tried the data import function in Microsoft Excel, I changed the file origin to UTF-8, Chinese GB, simplified Chinese (Mac), simplified Chinese(Windows), I tried all the possible options but still cannot get the correct Chinese character. We will ask teachers to use English only as a temp solution.
Thanks for you help. We really appreciate it.
Best wishes,
Lina
Thanks for your message.
To 1: The column "userid" in the report does belong to the students internal moodle userid. You can use it, for instance, to browse the profile of the user (http://your.moodle/user/profile.php?id=THEUSERID). The other field which could help you to identify students with the same name is the username. Since to my knowledge moodle does not allow to create the same username two times, this should be a unique identifier.
There are no plans at the moment to extend the report to custom user fields. I think you use one to store the student id assigned by the university. But if you would like to have a functionallity like that please put an issue in the github repository (Like above, see "Bug tracker"). Of course you are welcome to contribute extensions like that yourself.
To 2: This is no problem of the plugin but of the combination with the program you use to open the file. The report is encoded using UTF-8, which is quite common. If you use a program, which is capable of displaying UTF-8 encoding, you should be able to view Chinese characters, as well. For Microsoft Excel this should help: http://stackoverflow.com/questions/6002256/is-it-possible-to-force-excel-recognize-utf-8-csv-files-automatically#answer-6488070
I hope this helps you.
Best wishes,
Tobias
Many thanks for your contributions and I really like the design of this plugin, it is much more user friendly.
Our University plan to use this plugin for the optional class selection. But there's 2 issues I've encountered.
1. The exported allocation report does not contain the student ID. There is a column "ID", but it is not the student ID which can identify student with same name.
2. In the exported csv file, Chinese characters cannot display correctly.
Since the new semester will come soon and we plan to provide the optional class selection function to students at the end of this August. Would you please help with the 2 issues above?
Many thanks and I'll be looking forward to your reply.
Best wishes,
Lina
I noticed that you did not specify an issue tracker for your plugin. Providing a place for users of your plugin to report issues encourages participation and provides a way for users to report bugs, make feature requests, or suggest other types of improvements. There are a couple of options. You are welcome to request that a component be created in the Moodle Tracker. This will allow for you to become more familiar with how issues are managed in Moodle core but may take a little more time to setup. Alternatively, for folks who are using Github.com, you can use the issues feature of Github to handle such requests. Kindly let me know which of these two options seems best for you. Peace - Anthony