Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cms/djangoapps/models/settings/course_grading.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def get_section_grader_type(location):
old_location = loc_mapper().translate_locator_to_location(location)
descriptor = get_modulestore(old_location).get_item(old_location)
return {
"graderType": descriptor.format if descriptor.format is not None else 'Not Graded',
"graderType": descriptor.format if descriptor.format is not None else u"Not Graded",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably should call get_text('Not Graded') and also in the != test below this (perhaps test != u'Not Graded' and != get_text('Not Graded')) yuck. Hmmm, I need to read thru all the code for this page not just what's in this PR to figure this out. I'll look at it friday.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, the problem is that L227 in item.py can't handle None as an asserted value for grader_type as None may mean that it wasn't provided. Perhaps change L129 to give a different default if 'graderType' is missing so that None means 'graderType' == None? Then you can get rid of the 'Not Graded' references (L176, L182) in this file, There are probably other changes.

In general, I think the value should be None/null for not set and the client should be the only one that knows it should use the l10n 'Not Graded' string w/ its unique display formatting.

"location": unicode(location),
}

Expand Down
6 changes: 4 additions & 2 deletions cms/static/js/views/overview_assignment_grader.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ define(["js/views/baseview", "underscore", "gettext", "js/models/assignment_grad
'<% graders.each(function(option) { %>' +
'<li><a <% if (option.get("type") == assignmentType) {%>class="is-selected" <%}%> href="#"><%= option.get("type") %></a></li>' +
'<% }) %>' +
'<li><a class="gradable-status-notgraded" href="#">Not Graded</a></li>' +
'<li><a class="gradable-status-notgraded" href="#">' +
gettext('Not Graded') +
'</a></li>' +
'</ul>');
this.assignmentGrade = new AssignmentGrade({
locator : this.$el.closest('.id-holder').data('locator'),
graderType : this.$el.data('initial-status')});
graderType : this.$el.data('display-status')});
// TODO throw exception if graders is null
this.graders = this.options['graders'];
var cachethis = this;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change render() in overview_assignmtne_grader.js (L41) to check against the l10n value or ensure the graderType is null for Not Graded.

Expand Down
2 changes: 1 addition & 1 deletion cms/templates/edit_subsection.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h4 class="header">${_("Subsection Settings")}</h4>
<div class="row gradable">
<label>${_("Graded as:")}</label>

<div class="gradable-status" data-initial-status="${subsection.format if subsection.format is not None else _('Not Graded')}">
<div class="gradable-status" data-initial-status="${subsection.format if subsection.format is not None else u'Not Graded'}" data-display-status="${_('Not Graded')}">
</div>

<div class="due-date-input row">
Expand Down
2 changes: 1 addition & 1 deletion cms/templates/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ <h3 class="section-name" data-name="${section.display_name_with_default | h}"></

<ul class="actions-list">
<li class="actions-item grades">
<div class="gradable-status" data-initial-status="${subsection.format if subsection.format is not None else _('Not Graded')}"></div>
<div class="gradable-status" data-initial-status="${subsection.format if subsection.format is not None else u'Not Graded'}" data-display-status="${_('Not Graded')}"></div>
</li>
<li class="actions-item delete">
<a href="#" data-tooltip="${_('Delete this subsection')}" class="action delete-subsection-button"><i class="icon-trash"></i> <span class="sr">${_("Delete subsection")}</span></a>
Expand Down