Commit b87ab764 by David Ormsbee

Separate SectionDescriptor and add highlights field.

parent e28932c7
...@@ -2,7 +2,7 @@ from setuptools import find_packages, setup ...@@ -2,7 +2,7 @@ from setuptools import find_packages, setup
XMODULES = [ XMODULES = [
"book = xmodule.backcompat_module:TranslateCustomTagDescriptor", "book = xmodule.backcompat_module:TranslateCustomTagDescriptor",
"chapter = xmodule.seq_module:SequenceDescriptor", "chapter = xmodule.seq_module:SectionDescriptor",
"conditional = xmodule.conditional_module:ConditionalDescriptor", "conditional = xmodule.conditional_module:ConditionalDescriptor",
"course = xmodule.course_module:CourseDescriptor", "course = xmodule.course_module:CourseDescriptor",
"customtag = xmodule.template_module:CustomTagDescriptor", "customtag = xmodule.template_module:CustomTagDescriptor",
......
...@@ -12,7 +12,7 @@ from pytz import UTC ...@@ -12,7 +12,7 @@ from pytz import UTC
from lxml import etree from lxml import etree
from xblock.core import XBlock from xblock.core import XBlock
from xblock.fields import Integer, Scope, Boolean, String from xblock.fields import Integer, Scope, Boolean, String, List
from xblock.fragment import Fragment from xblock.fragment import Fragment
from .exceptions import NotFoundError from .exceptions import NotFoundError
...@@ -583,3 +583,20 @@ class SequenceDescriptor(SequenceFields, ProctoringFields, MakoModuleDescriptor, ...@@ -583,3 +583,20 @@ class SequenceDescriptor(SequenceFields, ProctoringFields, MakoModuleDescriptor,
xblock_body["content_type"] = "Sequence" xblock_body["content_type"] = "Sequence"
return xblock_body return xblock_body
class HighlightsFields(object):
"""Only Sections have summaries now, but we may expand that later."""
highlights = List(
help=_("A list summarizing what students should look forward to in this section."),
scope=Scope.settings
)
class SectionModule(HighlightsFields, SequenceModule):
"""Module for a Section/Chapter."""
class SectionDescriptor(HighlightsFields, SequenceDescriptor):
"""Descriptor for a Section/Chapter."""
module_class = SectionModule
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment