Drupal: How to automatically group users?
August 4, 2008 3:36 PM   Subscribe

Drupal: How do I automatically assign users into groups when they register? Is this something I can do with Organic Groups? Profile tags? A different module?

Background: I'm using Drupal to build an online course in which each student is assigned an instructor. I want to assign each student an instructor automatically and I want it done so that each instructor has roughly the same number of students (that is, not randomly). The instructor needs an easy way to read comments made only by his students. Is this something I can do with the Organic Groups module? Something I can do with Views? Something I can do with profile tags?

Google-fu for modules has failed me and nothing's happening in my question on Drupal's forums. Come to the rescue, AskMe!
posted by l33tpolicywonk to Computers & Internet (4 answers total) 2 users marked this as a favorite
 
I think it is unlikely you will find a module that automatically assigns users to a balanced pool of groups. I think you need to learn how to write a module -- it's not too hard. There's some good stuff at Drupal.org.
posted by meta_eli at 3:51 PM on August 4, 2008


Best answer: if you go the custom module route, http://drupal.org/project/og_mandatory_group looks like it may have some good code to steal for the auto-assigning of people to groups on signup.
posted by verb at 6:55 PM on August 4, 2008


Best answer: I think meta_eli is right that there is probably not an existing module for what you want to do. The fact that you've had no response in the forum lends support to that hypothesis, as people are usually quite quick to chime in if there is an existing module that solves the problem at hand. On the other hand, I've many times been at work on a module for some arcane requirement only to find that one already existed, so it's probably worth combing the module lists.

Views will definitely not help. I have not used OG or profile tags, so I don't know about those, but I suspect not.

It sounds like a pretty easy module to write, though. Just two queries. If you can't write it, try the Drupal Paid Services forum on Drupal.org.
posted by bricoleur at 7:57 PM on August 4, 2008


Best answer: Take a look at the hook_user() function.

Also, if you go it on your own, I recommend the book Pro Drupal Development
posted by meta_eli at 10:41 AM on August 5, 2008


« Older Why did Malcolm X frequently use Portugal as a...   |   Laptop Hard Drive Decision - which one is best for... Newer »
This thread is closed to new comments.