Restriction by language

Availability conditions ::: availability_language
Maintained by RenaatRenaat Debleu
Restrict module and section access based on user language.
Latest release:
1149 sites
819 downloads
52 fans
Current versions available: 9

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.

travisCoverage Status

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2

Contributors

Renaat
Renaat Debleu (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Thu, Oct 23, 2014, 3:39 AM
    Hi there, this is exactly the plugin we need for our organization. Is it possible to run it in 2.5.5+?
  • Renaat
    Thu, Oct 23, 2014, 3:13 PM
    Sorry about this, but conditional activities are 2.7+
  • Wed, Nov 26, 2014, 8:14 PM
    We are using this plugin and works like a charm, thanks a lot Renaat!

    BTW, we've also translated it to Basque smile
  • Wed, Dec 17, 2014, 11:55 PM
    Just for the record: there is a forum thread talking about this plugin to be included in the core:

    https://lang.moodle.org/mod/forum/discuss.php?d=3940
  • Wed, Jan 7, 2015, 8:43 PM
    Is there any documentation how to set up this plugin?
    I have installed it and it is present in the plugins overview page.
    Where should I set up the restriction? (I search it in the course's activity's settings, but no such "Restrict Access" block there.) Can anybody help?
  • Wed, Jan 7, 2015, 9:57 PM
    Thank you Renaat for the fast answer! The problem was that I had to enable conditional access in admin/settings.php?section=optionalsubsystems. Now it works perfect.
  • Thu, Jan 8, 2015, 8:30 PM
    Hello Renaat, is there any way to *hide* sections of the other language groups, rather than simply restricting access? At the moment we can control access, but all content is still visible - is there something I should set to hide content for other language groups - at the moment, our display looks a little cluttered unless we can do this. Thanks for producing this useful plugin!
  • Renaat
    Thu, Jan 8, 2015, 8:43 PM
    Just click on the eye icon you see before the word 'language' in the access restrictions: The "crossed out eye" icon means the module or section will be hidden for other language groups. Perhaps it would be a good idea to make this option (hidden) standard.
  • Thu, Jan 8, 2015, 9:03 PM
    (thanks for the fast response!) I missed it, thanks. Could be a default, yes though it's obvious now! Perhaps an information (?) point would be useful there.
  • Tue, Apr 28, 2015, 11:25 PM
    Hi Renaat, I agree with Gareth! I was trying to hide the activity and in this way it is not working well. Maybe better to add some information about t or a screenshot with the crossed eye. smile
    Thanks for the plugin, it is very useful for us!
  • Renaat
    Thu, Apr 30, 2015, 12:07 AM
    People sometimes ask me why the option restrict by language does not appear. There can be 2 reasons:

    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.
  • Tue, Jun 16, 2015, 6:54 PM
    Hi,

    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.
  • Renaat
    Wed, Jun 17, 2015, 4:17 PM
    Hello Iñigo,

    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.
  • Wed, Jun 17, 2015, 6:14 PM
    Oops, it seems like my tests were not well done (the student i was testing with also had another role), sorry about that.

    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...
Please login to post comments