Allow author to cap enrollments in course

add a test case for enrollment caps

pep8 fix
This commit is contained in:
Chris Dodge
2013-12-16 15:19:59 -05:00
parent 0f8919a6ba
commit ad7348ec11
9 changed files with 96 additions and 4 deletions

View File

@@ -13,7 +13,7 @@ from xmodule.seq_module import SequenceDescriptor, SequenceModule
from xmodule.graders import grader_from_conf
import json
from xblock.fields import Scope, List, String, Dict, Boolean
from xblock.fields import Scope, List, String, Dict, Boolean, Integer
from .fields import Date
from xmodule.modulestore.locator import CourseLocator
from django.utils.timezone import UTC
@@ -384,6 +384,9 @@ class CourseFields(object):
display_coursenumber = String(help="An optional display string for the course number that will get rendered in the LMS",
scope=Scope.settings)
max_student_enrollments_allowed = Integer(help="Limit the number of students allowed to enroll in this course.",
scope=Scope.settings)
class CourseDescriptor(CourseFields, SequenceDescriptor):
module_class = SequenceModule