Commit 2a96c456 by Calen Pennington

Make default value for format setting None, and force lms and cms to be explicit…

Make default value for format setting None, and force lms and cms to be explicit about a string default
parent cfd7e6d2
...@@ -213,7 +213,7 @@ class CourseGradingModel(object): ...@@ -213,7 +213,7 @@ class CourseGradingModel(object):
descriptor = get_modulestore(location).get_item(location) descriptor = get_modulestore(location).get_item(location)
return { return {
"graderType": descriptor.lms.format or 'Not Graded', "graderType": descriptor.lms.format if descriptor.lms.format is not None else 'Not Graded',
"location": location, "location": location,
"id": 99 # just an arbitrary value to "id": 99 # just an arbitrary value to
} }
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
<div class="row gradable"> <div class="row gradable">
<label>Graded as:</label> <label>Graded as:</label>
<div class="gradable-status" data-initial-status="${subsection.lms.format if subsection.lms.format is None else 'Not Graded'}"> <div class="gradable-status" data-initial-status="${subsection.lms.format if subsection.lms.format is not None else 'Not Graded'}">
</div> </div>
<div class="due-date-input row"> <div class="due-date-input row">
......
...@@ -592,7 +592,7 @@ class CourseDescriptor(SequenceDescriptor): ...@@ -592,7 +592,7 @@ class CourseDescriptor(SequenceDescriptor):
# The xmoduledescriptors included here are only the ones that have scores. # The xmoduledescriptors included here are only the ones that have scores.
section_description = {'section_descriptor': s, 'xmoduledescriptors': filter(lambda child: child.has_score, xmoduledescriptors)} section_description = {'section_descriptor': s, 'xmoduledescriptors': filter(lambda child: child.has_score, xmoduledescriptors)}
section_format = s.lms.format section_format = s.lms.format if s.lms.format is not None else ''
graded_sections[section_format] = graded_sections.get(section_format, []) + [section_description] graded_sections[section_format] = graded_sections.get(section_format, []) + [section_description]
all_descriptors.extend(xmoduledescriptors) all_descriptors.extend(xmoduledescriptors)
......
...@@ -317,7 +317,7 @@ def progress_summary(student, request, course, model_data_cache): ...@@ -317,7 +317,7 @@ def progress_summary(student, request, course, model_data_cache):
section_total, graded_total = graders.aggregate_scores( section_total, graded_total = graders.aggregate_scores(
scores, section_module.display_name_with_default) scores, section_module.display_name_with_default)
format = section_module.lms.format format = section_module.lms.format if section_module.lms.format is not None else ''
sections.append({ sections.append({
'display_name': section_module.display_name_with_default, 'display_name': section_module.display_name_with_default,
'url_name': section_module.url_name, 'url_name': section_module.url_name,
......
...@@ -103,7 +103,7 @@ def toc_for_course(user, request, course, active_chapter, active_section, model_ ...@@ -103,7 +103,7 @@ def toc_for_course(user, request, course, active_chapter, active_section, model_
if not section.lms.hide_from_toc: if not section.lms.hide_from_toc:
sections.append({'display_name': section.display_name_with_default, sections.append({'display_name': section.display_name_with_default,
'url_name': section.url_name, 'url_name': section.url_name,
'format': section.lms.format, 'format': section.lms.format if section.lms.format is not None else '',
'due': section.lms.due, 'due': section.lms.due,
'active': active, 'active': active,
'graded': section.lms.graded, 'graded': section.lms.graded,
......
...@@ -24,7 +24,6 @@ class LmsNamespace(Namespace): ...@@ -24,7 +24,6 @@ class LmsNamespace(Namespace):
help="What format this module is in (used for deciding which " help="What format this module is in (used for deciding which "
"grader to apply, and what to show in the TOC)", "grader to apply, and what to show in the TOC)",
scope=Scope.settings, scope=Scope.settings,
default='',
) )
start = Date(help="Start time when this module is visible", scope=Scope.settings) start = Date(help="Start time when this module is visible", scope=Scope.settings)
......
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