<% var releasedToStudents = xblockInfo.get('released_to_students'); var visibilityState = xblockInfo.get('visibility_state'); var published = xblockInfo.get('published'); var prereq = xblockInfo.get('prereq'); var hasPartitionGroups = xblockInfo.get('has_partition_group_components'); var userPartitionInfo = xblockInfo.get('user_partition_info'); var selectedGroupsLabel = userPartitionInfo['selected_groups_label']; var selectedPartitionIndex = userPartitionInfo['selected_partition_index']; var statusMessages = []; var messageType; var messageText; var statusType = null; var addStatusMessage = function (statusType, message) { var statusIconClass = ''; if (statusType === 'warning') { statusIconClass = 'fa-file-o'; } else if (statusType === 'error') { statusIconClass = 'fa-warning'; } else if (statusType === 'staff-only' || statusType === 'gated') { statusIconClass = 'fa-lock'; } else if (statusType === 'partition-groups') { statusIconClass = 'fa-eye'; } statusMessages.push({iconClass: statusIconClass, text: message}); }; if (prereq) { var prereqDisplayName = ''; _.each(xblockInfo.get('prereqs'), function (p) { if (p.block_usage_key == prereq) { prereqDisplayName = p.block_display_name; return false; } }); messageType = 'gated'; messageText = interpolate( gettext('Prerequisite: %(prereq_display_name)s'), {prereq_display_name: prereqDisplayName}, true ); addStatusMessage(messageType, messageText); } if (staffOnlyMessage) { messageType = 'staff-only'; messageText = gettext('Contains staff only content'); addStatusMessage(messageType, messageText); } else { if (visibilityState === 'needs_attention' && xblockInfo.isVertical()) { messageType = 'warning'; if (published && releasedToStudents) { messageText = gettext('Unpublished changes to live content'); } else if (!published) { messageText = gettext('Unpublished units will not be released'); } else { messageText = gettext('Unpublished changes to content that will release in the future'); } addStatusMessage(messageType, messageText); } if (selectedPartitionIndex !== -1 && !isNaN(selectedPartitionIndex) && xblockInfo.isVertical()) { messageType = 'partition-groups'; messageText = edx.StringUtils.interpolate( gettext('Access to this unit is restricted to: {selectedGroupsLabel}'), { selectedGroupsLabel: selectedGroupsLabel } ) addStatusMessage(messageType, messageText); } else if (hasPartitionGroups && xblockInfo.isVertical()) { addStatusMessage( 'partition-groups', gettext('Access to some content in this unit is restricted to specific groups of learners') ); } } var gradingType = gettext('Ungraded'); if (xblockInfo.get('graded')) { gradingType = xblockInfo.get('format') } var is_proctored_exam = xblockInfo.get('is_proctored_exam'); var is_practice_exam = xblockInfo.get('is_practice_exam'); var is_onboarding_exam = xblockInfo.get('is_onboarding_exam'); var exam_value; if (is_proctored_exam) { if (is_onboarding_exam) { exam_value = gettext('Onboarding Exam'); } else if (is_practice_exam) { exam_value = gettext('Practice proctored Exam'); } else { exam_value = gettext('Proctored Exam'); } } else { exam_value = gettext('Timed Exam'); } %> <% if (parentInfo) { %>
  • <% if (xblockInfo.isHeaderVisible()) { %>
    <% if (includesChildren) { %>

    <% } else { %>

    <% } %> <% if (xblockInfo.isVertical()) { %> "> <%- xblockInfo.get('display_name') %> <% } else { %> "> <%- xblockInfo.get('display_name') %> <% } %>

    <% if (!xblockInfo.isVertical()) { %> <% if (xblockInfo.get('explanatory_message') !=null) { %>
    <%- xblockInfo.get('explanatory_message') %>
    <% } else { %>

    <%- gettext('Release Status:') %> <% if (!course.get('self_paced')) { %> <% if (xblockInfo.get('released_to_students')) { %> <%- gettext('Released:') %> <% } else if (xblockInfo.get('release_date')) { %> <%- gettext('Scheduled:') %> <% } else { %> <%- gettext('Unscheduled') %> <% } %> <% if (xblockInfo.get('release_date')) { %> <%- xblockInfo.get('release_date') %> <% } %> <% } %>

    <% } %> <% if (xblockInfo.isChapter()) { %>
    <% var number_of_highlights = (xblockInfo.get('highlights') || []).length; %>
    <% } %> <% if (xblockInfo.get('is_time_limited')) { %>

    <%- gettext('Graded as:') %> <%- gradingType %> - <%- exam_value %> <%- exam_value %> <% if (xblockInfo.get('due_date') && !course.get('self_paced')) { %> <%- gettext('Due:') %> <%- xblockInfo.get('due_date') %> <% } %>

    <% } else if (xblockInfo.get('due_date') || xblockInfo.get('graded')) { %>

    <%- gettext('Graded as:') %> <%- gradingType %> <% if (xblockInfo.get('due_date') && !course.get('self_paced')) { %> <%- gettext('Due:') %> <%- xblockInfo.get('due_date') %> <% } %>

    <% } %>

    <% if (xblockInfo.get('hide_after_due')) { %> <% if (course.get('self_paced')) { %> <%- gettext("Subsection is hidden after course end date") %> <% } else { %> <%- gettext("Subsection is hidden after due date") %> <% } %> <% } %>

    <% } %> <% if (statusMessages.length > 0) { %>
    <% for (var i=0; i

    <%- statusMessages[i].text %>

    <% } %>
    <% } %>
    <% } %> <% } %> <% if (!parentInfo && xblockInfo.get('child_info') && xblockInfo.get('child_info').children.length === 0) { %>

    <%- gettext("You haven't added any content to this course yet.") %> <%- addChildLabel %>

    <% } else if (!xblockInfo.isVertical()) { %>
    <% if (childType) { %> <% if (xblockInfo.isChildAddable()) { %> <% } %> <% } %>
    <% } %> <% if (parentInfo) { %>
  • <% } %>