Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FC-0009] feat: Add subsection grading policy mismatch validation #32813

Merged
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
28 changes: 25 additions & 3 deletions cms/templates/js/course-outline.underscore
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,14 @@ if (staffOnlyMessage) {
}

var gradingType = gettext('Ungraded');
var gradingPolicyMismatch = false;
if (xblockInfo.get('graded')) {
gradingType = xblockInfo.get('format')
if (gradingType) {
gradingPolicyMismatch = (
xblockInfo.get('course_graders').filter((cg) => cg.toLowerCase() === gradingType.toLowerCase())
).length === 0;
}
}

var is_proctored_exam = xblockInfo.get('is_proctored_exam');
Expand Down Expand Up @@ -269,7 +275,7 @@ if (is_proctored_exam) {
)
%>
</span>
<p>
</p>
</div>
<% } %>
<% } else if ((xblockInfo.get('due_date') && !course.get('self_paced')) || xblockInfo.get('graded')) { %>
Expand Down Expand Up @@ -299,7 +305,7 @@ if (is_proctored_exam) {
)
%>
</span>
<p>
</p>
</div>
<% } %>
<% } else if (course.get('self_paced') && course.get('is_custom_relative_dates_active') && xblockInfo.get('relative_weeks_due')) { %>
Expand All @@ -325,7 +331,7 @@ if (is_proctored_exam) {
)
%>
</span>
<p>
</p>
</div>
<% } %>
<div class="status-hide-after-due">
Expand All @@ -352,6 +358,22 @@ if (is_proctored_exam) {
<% } %>
</div>
<% } %>
<% if (gradingPolicyMismatch) { %>
<div class="status-messages">
<div class="container-message wrapper-message">
<div class="message has-warnings">
<p class="warning">
<span class="icon fa fa-warning" aria-hidden="true"></span>
<%- interpolate(
gettext("This subsection is configured as \"%(gradingType)s\", which doesn't exist in the current grading policy."),
{ gradingType: gradingType },
true
) %>
</p>
</div>
</div>
</div>
<% } %>
</div>
<% } %>
<% } %>
Expand Down
Loading