Forum .LRN Q&A: Response to Implementing class membership quota

Collapse
Posted by Peter Marklund on
Radam, the trigger may be a good idea to enforce the max number of students for a class. However, I imagine that you will want to check the number of students before the addition of the student is even attempted so that you can give the user a message explaining why he/she can't join the class.

The ability to limit the number of students for a class seems like a general enough requirement that it would warrant being in the dotLRN datamodel. From a quick glance at classes-create.sql and communities-create.sql the dotlrn_communities_all table suggests itself as a candidate for putting a max_n_members column in.