Merge branch 'dormsbee/multicourse' into multicourse_wiki
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
from fs.errors import ResourceNotFoundError
|
||||
from path import path
|
||||
|
||||
from xmodule.modulestore import Location
|
||||
from xmodule.seq_module import SequenceDescriptor, SequenceModule
|
||||
|
||||
|
||||
class CourseDescriptor(SequenceDescriptor):
|
||||
module_class = SequenceModule
|
||||
|
||||
@@ -51,7 +54,7 @@ class CourseDescriptor(SequenceDescriptor):
|
||||
try:
|
||||
with self.system.resources_fs.open(path("about") / section_key + ".html") as htmlFile:
|
||||
return htmlFile.read()
|
||||
except IOError:
|
||||
except ResourceNotFoundError:
|
||||
return "! About section missing !"
|
||||
elif section_key == "title":
|
||||
return self.name
|
||||
@@ -79,7 +82,7 @@ class CourseDescriptor(SequenceDescriptor):
|
||||
try:
|
||||
with self.system.resources_fs.open(path("info") / section_key + ".html") as htmlFile:
|
||||
return htmlFile.read()
|
||||
except IOError:
|
||||
return "! About section missing !"
|
||||
except ResourceNotFoundError:
|
||||
return "! Info section missing !"
|
||||
|
||||
raise KeyError("Invalid about key " + str(section_key))
|
||||
|
||||
@@ -125,7 +125,7 @@ def render_accordion(request, course, chapter, section):
|
||||
Returns (initialization_javascript, content)'''
|
||||
|
||||
# TODO (cpennington): do the right thing with courses
|
||||
toc = toc_for_course(request.user, request, course.location, chapter, section)
|
||||
toc = toc_for_course(request.user, request, course, chapter, section)
|
||||
|
||||
active_chapter = 1
|
||||
for i in range(len(toc)):
|
||||
|
||||
Reference in New Issue
Block a user