One of our customer would use Moodle for an event application, because all of the users are already in it and they wouldn’t use a new system for this.

In an event there were more groups. Users allowed to join into this groups by selecting a role. Every group was limited number of places in every role.

I wouldn’t install any plugin for this, after some research, I found that the Choice activity is good for this.

We created choices for each group in the course, then we used Option for each role and we set limit for every role.

After users applied into the groups, we could query the event applications using this query:

SET @CourseId = 42;

SELECT 
	user.id userid, 
	user.username,
	user.firstname,
	user.lastname,
	user.email,
	choice.name groupname,
	choice_options.text role

FROM mdl_user user
INNER JOIN mdl_choice_answers choice_answers ON choice_answers.userid = user.id
INNER JOIN mdl_choice choice ON choice.id = choice_answers.choiceid
INNER JOIN mdl_choice_options choice_options ON choice_options.id = choice_answers.optionid
WHERE choice.course = @CourseId
ORDER BY user.lastname;

This method can be also used for selecting a room in an event where the Option will represent one room with limited places.