Posts made by Simon Coggins

Moodle in English -> General developer forum -> Dynamic Cohorts

by Simon Coggins -

We have some funding to extend the current cohorts functionality to include 'dynamic' cohorts (see below for a summary).

Are there were any plans to extend cohorts in this direction, and if so, would you be interested in this implementation for core? We'd be happy to contribute the code and are keen on collaborating to ensure it aligns well with any existing or future plans in this direction.
Any feedback is also welcome on the implementation below or any problems that this change might introduce.
---
Existing cohorts would be given a 'type' with a choice between static or dynamic. Existing functionality would remain the same with existing cohorts being labelled as 'static'.
Dynamic cohorts would be defined by a set of rules, for example:
  • Users with an email matching '@example.com'
  • Users who have logged on in the last 3 months
  • Users with a user custom profile field set to 'instructor'
  • etc.
There would be a wide range of 'rules' and rules would be class-based to allow more to be added easily.
Groups of rules could be combined into rulesets, and applied with AND/OR logic so you could build up complex rulesets:
  • Users who have logged on in the last 3 months AND have their city set to 'New York'
  • Users who's language is set to 'es' OR Users who's language is set to 'fr'
On the back end, the cohort would still be defined as a list of userids in the cohort_members table. Event handlers would be added to check for changes that could affect cohort membership. An additional cron task would be included to catch any cases missed by the event handlers (for example, if a third party module modified a table directly).
Any events triggered by changes to cohort membership would also need to be retriggered when a cohort membership changes.
Average of ratings: -

That makes it a bit difficult to create a child language pack because you can't see the parent strings, so there's no easy way to know which ones might need changing.

I created a patch that seems to do what I want - it shows the parent strings when they are available and falls back to english when there is no string in the parent language.The patch is for moodle 1.9, but I've attached it here in case anyone else has a similar problem.

Simon

Average of ratings: Useful (2)

I'm trying to figure out how to use the moodle 1.9 interface to create a new language pack, based on a non-English parent language.

The problem I'm having is, when you go to Language Editing > Language Pack Maintaining > Edit words or phrases > Choose a file to edit, you get the comparison view, but the 'current' string on the left displaying the English version of the string.

In order to scan through the listings to look for changes I'd like these strings to appear in the parent language instead.

I've tried setting the site default language, and the user's language in their profile, but it won't change from English.

Anyone got any suggestions? I'm happy to hack the code if it can be fixed that way. If there's a config option I'm missing, even better wink

The screenshot below shows what I mean (with Castillian Spanish (es_es) selected, which has International Spanish (es) as its parent language. it's the words on the left ('Add a new entry', etc) that I'd like to appear in the parent language.

Thanks,

Simon

Screenshot of issue with language translation

Average of ratings: -

Moodle in English -> Testing and QA -> Moodle testing script

by Simon Coggins -

Hi,

I work for Totara, which is a distribution of moodle, and as part of our QA process we've written a number of test scripts designed to automatically check a site for various types of errors. We run these scripts on a number of installs (windows and linux servers, different databases, etc) before each release.

The first script is a spider which follows all the internal links looking for PHP errors, database errors, missing language strings, 404s and moodle error boxes. It includes some whitelisting so you can exclude 'known' errors. It should also be fairly easy to extend to include other types of checks. The code is here:

https://github.com/totara/Totara-test-scripts/blob/master/link_checker.php

Since the script runs on any moodle site (it was designed for 1.9 but seems to work on 2.0 too), I thought I'd share it here.

We've got some other scripts too but they are a bit specific to our setup at the moment - I'll try and tidy them up and add them to the repo too.

Simon

Average of ratings: -

If you've used the same text in both message templates with different results then this does sound like a bug. The code that substitutes the customfields is in a function called facetoface_email_substitutions(), clearly for some reason it's behaving different for reminders than for the original notification.

Simon

Average of ratings: Useful (1)