Moodle plugins directory: Restriction by language | Moodle.org
Restriction by language
Availability restriction ::: availability_language
Maintained by Renaat Debleu
Restrict module and section access based on user language.
Latest release:
1939 sites
359 downloads
63 fans
Current versions available: 11
Language filters are great, but sometimes they can make your resources and activities very complex. This availability condition makes it easy to show an English resource only to English users and an activity in French only to French speaking students.
Check the global documentation about conditional availability settings first.
This plugin only pops up when
- There is more than 1 language installed in the system (obvious, we need a least 2 languages installed to restrict)
- When the language of the course is NOT forced. (Course - Edit settings - Appearance - Force language). When a course has a forced language, everything will be shown in this language and we are certain no user will ever arrive with another language enabled. On that moment there is no need to show the restriction, as it would only create the illusion that people could be restricted.
WARNING: The Moodle Mobile app filters resources and activities using the language of the smart phone, not using the language of the Moodle app.
Useful links
Contributors
Renaat Debleu (Lead maintainer)
Please login to view contributors details and/or to contact them
Thanks for the plugin, it is very useful for us!
1. There is only 1 language installed in the system (obvious, we need a least 2 languages installed to restrict)
2. The course language is forced. (Course - Edit settings - Appearance - Force language). When a course has a forced language, everything inside that course appears in that forced language and we are certain no user will ever arrive with another language enabled. On this moment there is no need to show the restriction as it would only create the illusion that people could be restricted.
I've realized that language availability conditions are not controlled in the Moodle Mobile app and the activities are shown always.
I don't know if this issue should be fixed by the plugin itself or by the Mobile app, if anyone tells me I can create the issue where it belongs.
Good find! I have no clue how the Moodle Mobile App handles availability conditions nor wrote code for the app. As far as I know, the Moodle Mobile app delivers content using js, json, and html instead of php.
But have you logged in as a student using Moodle Mobile and tested the availability conditions? When I use the app as a student, I see that all availability conditions are working, but
- the resources are hidden or shown, there is never is a reason shown why a resource is available or not.
- there is a time lapse when you change something in Moodle and when it reflects in the app (the changes only show when I purge the caches)
Can you confirm that the language availability condition is the only availability condition that is not working in the Mobile App (by testing other conditions as grade - date -...). When the language condition is the only availability condition that is not working, you have to report the issue on https://github.com/ewallah/moodle-availability_condition_language/issues, else the issue has to be reported in https://tracker.moodle.org/projects/MOBILE
When I find time, I will try things out on the qa.moodle.net site to have a better understanding of the default behaviour of availability conditions in the Moodle Mobile app.
I've tested now with a only-student-role user and now I see it works, but I've seen that the language comparison is not made with the language set in the app but the one set in the user profile.
When you're using a browser the language selected on the list prevails over the user profile language, shouldn't the language selected in the app also prevail over the user profile language? I doubt again if this is something about the plugin or about the app...
Indeed the language selected in the app should prevail. But honestly, I do not know how this can be accomplished. So perhaps you could do both: report the issue on github and in the tracker.
I will update the plugin to warn about this problem and I posted a question on the Moodle Mobile forum to have a clue how this issue could be solved.
I've read your post on the Moodle Mobile forum [1], we'll see if Juan confirms it can be done.
Thanks!
[1]: https://moodle.org/mod/forum/discuss.php?d=315805
I just installed your plugin in our 2.7, but the activities keep showing...
Not available unless: The student's language is English (en)
In your screenshot shows (Hidden otherwise) and this is the behavior we need...
Am I missing something here? maybe my moodle version differs yours...
Just to clarify...
what we need is if the students switch the interface to english they should see the english content and when they switch to spanish they should see the spanish content.
Thanks!
If the eye is SHUT then english students will not see the activity at all.
If the eye is OPEN the students who do not speak english will see the activity but it will be greyed out and have information about why they can't access it yet.
See the global documentation (https://docs.moodle.org/29/en/Conditional_activities_settings)
Renaat, thank you very much for this plugin and for your help, the plugin work as expected now!
Thanks again!