Restriction by language

Availability restriction ::: availability_language
Maintained by RenaatRenaat 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.

Tests Coverage 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

  • Gábor Takács
    Wed, 7 Jan 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.
  • Gareth Cooper
    Thu, 8 Jan 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, 8 Jan 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.
  • Gareth Cooper
    Thu, 8 Jan 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.
  • Federica Marra
    Tue, 28 Apr 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, 30 Apr 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.
  • Iñigo Zendegi Urzelai
    Tue, 16 Jun 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, 17 Jun 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.
  • Iñigo Zendegi Urzelai
    Wed, 17 Jun 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...
  • Renaat
    Thu, 25 Jun 2015, 10:11 PM
    Hello Iñigo,

    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ñigo Zendegi Urzelai
    Wed, 8 Jul 2015, 8:44 PM
    Hi Renaat,

    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
  • Mauro Villoldo
    Sat, 8 Aug 2015, 3:53 AM
    Hi Renaat,

    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!
  • Renaat
    Sat, 8 Aug 2015, 3:41 PM
    Click on the eye icon!

    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)
  • Mauro Villoldo
    Mon, 10 Aug 2015, 9:26 PM
    Oopss, I feel stupid now... :P

    Renaat, thank you very much for this plugin and for your help, the plugin work as expected now!

    Thanks again!
  • jake sullivan
    Wed, 19 Aug 2015, 4:10 AM
    Hi Renaat, is it possible to use your plugin in moodle version 2.5? I'm a newbie in moodle development, how do I install the plugin in the first place?
Please login to post comments