Revert "Ora2 dates reprise"
This commit is contained in:
@@ -22,7 +22,6 @@ class DateSummarySerializer(serializers.Serializer):
|
||||
link = serializers.SerializerMethodField()
|
||||
link_text = serializers.CharField()
|
||||
title = serializers.CharField()
|
||||
extra_info = serializers.CharField()
|
||||
|
||||
def get_learner_has_access(self, block):
|
||||
learner_is_full_access = self.context.get('learner_is_full_access', False)
|
||||
|
||||
@@ -10,7 +10,6 @@ from datetime import datetime
|
||||
import pytz
|
||||
import six
|
||||
from crum import get_current_request
|
||||
from dateutil.parser import parse as parse_date
|
||||
from django.conf import settings
|
||||
from django.http import Http404, QueryDict
|
||||
from django.urls import reverse
|
||||
@@ -72,7 +71,7 @@ log = logging.getLogger(__name__)
|
||||
# Used by get_course_assignments below. You shouldn't need to use this type directly.
|
||||
_Assignment = namedtuple(
|
||||
'Assignment', ['block_key', 'title', 'url', 'date', 'contains_gated_content', 'complete', 'past_due',
|
||||
'assignment_type', 'extra_info']
|
||||
'assignment_type']
|
||||
)
|
||||
|
||||
|
||||
@@ -509,7 +508,6 @@ def get_course_assignment_date_blocks(course, user, request, num_return=None,
|
||||
date_block.past_due = assignment.past_due
|
||||
date_block.link = request.build_absolute_uri(assignment.url) if assignment.url else ''
|
||||
date_block.set_title(assignment.title, link=assignment.url)
|
||||
date_block._extra_info = assignment.extra_info
|
||||
date_blocks.append(date_block)
|
||||
date_blocks = sorted((b for b in date_blocks if b.is_enabled or include_past_dates), key=date_block_key_fn)
|
||||
if num_return:
|
||||
@@ -553,72 +551,9 @@ def get_course_assignments(course_key, user, include_access=False):
|
||||
complete = is_block_structure_complete_for_assignments(block_data, subsection_key)
|
||||
past_due = not complete and due < now
|
||||
assignments.append(_Assignment(
|
||||
subsection_key, title, url, due, contains_gated_content, complete, past_due, assignment_type, None
|
||||
subsection_key, title, url, due, contains_gated_content, complete, past_due, assignment_type
|
||||
))
|
||||
|
||||
# Load all dates for ORA blocks as separate assignments
|
||||
descendents = block_data.get_children(subsection_key)
|
||||
while descendents:
|
||||
descendent = descendents.pop()
|
||||
descendents.extend(block_data.get_children(descendent))
|
||||
if block_data.get_xblock_field(descendent, 'category', None) == 'openassessment':
|
||||
graded = block_data.get_xblock_field(descendent, 'graded', False)
|
||||
has_score = block_data.get_xblock_field(descendent, 'has_score', False)
|
||||
weight = block_data.get_xblock_field(descendent, 'weight', 1)
|
||||
if not (graded and has_score and (weight is None or weight > 0)):
|
||||
continue
|
||||
|
||||
all_assessments = [{
|
||||
'name': 'submission',
|
||||
'due': block_data.get_xblock_field(descendent, 'submission_due'),
|
||||
'start': block_data.get_xblock_field(descendent, 'submission_start'),
|
||||
'required': True
|
||||
}]
|
||||
valid_assessments = block_data.get_xblock_field(descendent, 'valid_assessments')
|
||||
|
||||
if valid_assessments:
|
||||
all_assessments.extend(valid_assessments)
|
||||
|
||||
assignment_type = block_data.get_xblock_field(descendent, 'format', None)
|
||||
complete = is_block_structure_complete_for_assignments(block_data, descendent)
|
||||
|
||||
block_title = block_data.get_xblock_field(descendent, 'title', _('Open Response Assessment'))
|
||||
|
||||
for assessment in valid_assessments:
|
||||
due = parse_date(assessment['due']).replace(tzinfo=pytz.UTC) if assessment['due'] else None
|
||||
if due is None:
|
||||
continue
|
||||
|
||||
if assessment['name'] == 'self-assessment':
|
||||
assessment_type = _("Self Assessment")
|
||||
elif assessment['name'] == 'peer-assessment':
|
||||
assessment_type = _("Peer Assessment")
|
||||
elif assessment['name'] == 'staff-assessment':
|
||||
assessment_type = _("Staff Assessment")
|
||||
elif assessment['name'] == 'submission':
|
||||
assessment_type = _("Submission")
|
||||
else:
|
||||
assessment_type = assessment['name']
|
||||
title = "{} ({})".format(block_title, assessment_type)
|
||||
url = ''
|
||||
start = parse_date(assessment['start']).replace(tzinfo=pytz.UTC) if assessment['start'] else None
|
||||
assignment_released = not start or start < now
|
||||
if assignment_released:
|
||||
url = reverse('jump_to', args=[course_key, descendent])
|
||||
|
||||
past_due = not complete and due and due < now
|
||||
assignments.append(_Assignment(
|
||||
descendent,
|
||||
title,
|
||||
url,
|
||||
due,
|
||||
contains_gated_content,
|
||||
complete,
|
||||
past_due,
|
||||
assignment_type,
|
||||
_("Open Response Assessment due dates are set by your instructor and can't be shifted.")
|
||||
))
|
||||
|
||||
return assignments
|
||||
|
||||
|
||||
|
||||
@@ -77,11 +77,6 @@ class DateSummary(object):
|
||||
"""The detail text displayed by this summary."""
|
||||
return ''
|
||||
|
||||
@property
|
||||
def extra_info(self):
|
||||
"""Extra detail to display as a tooltip."""
|
||||
return None
|
||||
|
||||
def register_alerts(self, request, course):
|
||||
"""
|
||||
Registers any relevant course alerts given the current request.
|
||||
@@ -393,7 +388,6 @@ class CourseAssignmentDate(DateSummary):
|
||||
self.contains_gated_content = False
|
||||
self.complete = None
|
||||
self.past_due = None
|
||||
self._extra_info = None
|
||||
|
||||
@property
|
||||
def date(self):
|
||||
@@ -411,10 +405,6 @@ class CourseAssignmentDate(DateSummary):
|
||||
def link(self):
|
||||
return self.assignment_link
|
||||
|
||||
@property
|
||||
def extra_info(self):
|
||||
return self._extra_info
|
||||
|
||||
@link.setter
|
||||
def link(self, link):
|
||||
self.assignment_link = link
|
||||
|
||||
@@ -99,7 +99,10 @@
|
||||
}
|
||||
|
||||
.no-access {
|
||||
color: #767676;
|
||||
// This is too low-contrast for a11y purposes. But since it only applies to pieces of the page that are
|
||||
// inaccessible to users, and we have a banner explaining the parts that are inaccessible at the top,
|
||||
// we're OK from an accessibility point of view.
|
||||
color: #d1d2d4;
|
||||
}
|
||||
|
||||
.timeline-date-content {
|
||||
@@ -112,14 +115,10 @@
|
||||
align-items: center;
|
||||
|
||||
&.not-released {
|
||||
color: #b1a3a3;
|
||||
color: #767676;
|
||||
}
|
||||
}
|
||||
|
||||
.timeline-date {
|
||||
color: #2d323e;
|
||||
}
|
||||
|
||||
.timeline-title {
|
||||
@include font-size(14);
|
||||
|
||||
@@ -135,7 +134,7 @@
|
||||
}
|
||||
|
||||
&.not-released {
|
||||
color: #767676;
|
||||
color: #d1d2d4;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,30 +149,8 @@
|
||||
color: #2d323e;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
&.not-released {
|
||||
color: #767676;
|
||||
}
|
||||
}
|
||||
|
||||
.timeline-extra-info {
|
||||
@include font-size(14);
|
||||
|
||||
display: flex;
|
||||
flex: 100%;
|
||||
line-height: 1.25;
|
||||
|
||||
a {
|
||||
color: #2d323e;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
&.not-released {
|
||||
color: #767676;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.pill {
|
||||
@include font-size(12);
|
||||
|
||||
|
||||
@@ -82,11 +82,6 @@ from openedx.core.djangolib.markup import HTML, Text
|
||||
<div class="timeline-description ${access_class} ${not_released}">
|
||||
${block.description}
|
||||
</div>
|
||||
% if block.extra_info:
|
||||
<div class="timeline-extra-info ${access_class} ${not_released}">
|
||||
${block.extra_info}
|
||||
</div>
|
||||
% endif
|
||||
% endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -41,20 +41,10 @@ class TestIcsGeneration(TestCase):
|
||||
|
||||
def make_assigment(
|
||||
self, block_key=None, title=None, url=None, date=None, contains_gated_content=False, complete=False,
|
||||
past_due=False, assignment_type=None, extra_info=None
|
||||
past_due=False, assignment_type=None
|
||||
):
|
||||
""" Bundles given info into a namedtupled like get_course_assignments returns """
|
||||
return _Assignment(
|
||||
block_key,
|
||||
title,
|
||||
url,
|
||||
date,
|
||||
contains_gated_content,
|
||||
complete,
|
||||
past_due,
|
||||
assignment_type,
|
||||
extra_info
|
||||
)
|
||||
return _Assignment(block_key, title, url, date, contains_gated_content, complete, past_due, assignment_type)
|
||||
|
||||
def expected_ics(self, *assignments):
|
||||
""" Returns hardcoded expected ics strings for given assignments """
|
||||
|
||||
@@ -41,11 +41,10 @@ class ContentTypeGateTransformer(BlockStructureTransformer):
|
||||
inside of it is content gated. `contains_gated_content` can then be used to indicate something
|
||||
in the blocks subtree is gated.
|
||||
"""
|
||||
if block_structure.get_xblock_field(block_key, 'contains_gated_content'):
|
||||
return
|
||||
block_structure.override_xblock_field(block_key, 'contains_gated_content', True)
|
||||
|
||||
for parent_block_key in block_structure.get_parents(block_key):
|
||||
if block_structure.get_xblock_field(parent_block_key, 'contains_gated_content'):
|
||||
continue
|
||||
block_structure.override_xblock_field(parent_block_key, 'contains_gated_content', True)
|
||||
self._set_contains_gated_content_on_parents(block_structure, parent_block_key)
|
||||
|
||||
def transform(self, usage_info, block_structure):
|
||||
|
||||
@@ -21,9 +21,6 @@ from django.utils.translation import ugettext as _
|
||||
% if course_date.description:
|
||||
<p class="description">${course_date.description}</p>
|
||||
% endif
|
||||
% if course_date.extra_info:
|
||||
<div class="extra-info">${course_date.extra_info}</div>
|
||||
% endif
|
||||
% if course_date.link and course_date.link_text:
|
||||
<div class="date-summary-link">
|
||||
<a href="${course_date.link}">${course_date.link_text}</a>
|
||||
|
||||
1
setup.py
1
setup.py
@@ -66,7 +66,6 @@ setup(
|
||||
"load_override_data = lms.djangoapps.course_blocks.transformers.load_override_data:OverrideDataTransformer",
|
||||
"content_type_gate = openedx.features.content_type_gating.block_transformers:ContentTypeGateTransformer",
|
||||
"access_denied_message_filter = lms.djangoapps.course_blocks.transformers.access_denied_filter:AccessDeniedMessageFilterTransformer",
|
||||
"open_assessment_transformer = lms.djangoapps.courseware.transformers:OpenAssessmentDateTransformer",
|
||||
],
|
||||
"openedx.ace.policy": [
|
||||
"bulk_email_optout = lms.djangoapps.bulk_email.policies:CourseEmailOptout"
|
||||
|
||||
Reference in New Issue
Block a user