Add Custom User Field (Dropdown) in Moodle

巧了我就是萌 提交于 2019-12-11 13:44:54

问题


Hi I need to add Custom User Field (Dropdown) in Moodle. I know I can add it through https://docs.moodle.org/24/en/User_profile_fields and https://docs.moodle.org/dev/User_profile_fields

I went ahead with above method and added dropdown accordingly. However, when I see it in database, {user_info_field} it shows only one row with my select fields seperated by new line. Screenshot is listed.

I want these params to be appear in separate rows. Because, I've few development in pipeline which involves creation of custom invoicing plugin that allows to store pricing for each university.


回答1:


That is how dropdown fields store their options in Moodle - all the values, separated by newlines.

If you want a list of possible values, retrieve mdl_user_info_field.param1 then use explode("\n", $fieldvalue).




回答2:


I Used in built cohort system to categorized users in different University. Here I didn't have to create custom profile field.

For invoicing plugin, I will manipulate same cohorts (in my case University) by creating local plugin which adds tables to database field. Thank you all for your help.



来源:https://stackoverflow.com/questions/31023333/add-custom-user-field-dropdown-in-moodle

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!