Skip to content
Snippets Groups Projects
Unverified Commit 2601975f authored by Dillon Dumesnil's avatar Dillon Dumesnil Committed by GitHub
Browse files

Revert "AA-223 - Add ORA2 dates to the dates page"

parent a0bc3786
No related merge requests found
...@@ -22,7 +22,6 @@ class DateSummarySerializer(serializers.Serializer): ...@@ -22,7 +22,6 @@ class DateSummarySerializer(serializers.Serializer):
link = serializers.SerializerMethodField() link = serializers.SerializerMethodField()
link_text = serializers.CharField() link_text = serializers.CharField()
title = serializers.CharField() title = serializers.CharField()
extra_info = serializers.CharField()
def get_learner_has_access(self, block): def get_learner_has_access(self, block):
learner_is_full_access = self.context.get('learner_is_full_access', False) learner_is_full_access = self.context.get('learner_is_full_access', False)
......
...@@ -10,7 +10,6 @@ from datetime import datetime ...@@ -10,7 +10,6 @@ from datetime import datetime
import pytz import pytz
import six import six
from crum import get_current_request from crum import get_current_request
from dateutil.parser import parse as parse_date
from django.conf import settings from django.conf import settings
from django.http import Http404, QueryDict from django.http import Http404, QueryDict
from django.urls import reverse from django.urls import reverse
...@@ -72,7 +71,7 @@ log = logging.getLogger(__name__) ...@@ -72,7 +71,7 @@ log = logging.getLogger(__name__)
# Used by get_course_assignments below. You shouldn't need to use this type directly. # Used by get_course_assignments below. You shouldn't need to use this type directly.
_Assignment = namedtuple( _Assignment = namedtuple(
'Assignment', ['block_key', 'title', 'url', 'date', 'contains_gated_content', 'complete', 'past_due', '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, ...@@ -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.past_due = assignment.past_due
date_block.link = request.build_absolute_uri(assignment.url) if assignment.url else '' date_block.link = request.build_absolute_uri(assignment.url) if assignment.url else ''
date_block.set_title(assignment.title, link=assignment.url) date_block.set_title(assignment.title, link=assignment.url)
date_block._extra_info = assignment.extra_info
date_blocks.append(date_block) 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) 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: if num_return:
...@@ -553,69 +551,9 @@ def get_course_assignments(course_key, user, include_access=False): ...@@ -553,69 +551,9 @@ def get_course_assignments(course_key, user, include_access=False):
complete = is_block_structure_complete_for_assignments(block_data, subsection_key) complete = is_block_structure_complete_for_assignments(block_data, subsection_key)
past_due = not complete and due < now past_due = not complete and due < now
assignments.append(_Assignment( 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
valid_assessments = [{
'name': 'submission',
'due': block_data.get_xblock_field(descendent, 'submission_due'),
'start': block_data.get_xblock_field(descendent, 'submission_start'),
'required': True
}] + block_data.get_xblock_field(descendent, 'valid_assessments')
gated = include_access and block_data.get_xblock_field(descendent, 'gated', False)
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])
url = request and request.build_absolute_uri(url)
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 return assignments
......
...@@ -77,11 +77,6 @@ class DateSummary(object): ...@@ -77,11 +77,6 @@ class DateSummary(object):
"""The detail text displayed by this summary.""" """The detail text displayed by this summary."""
return '' return ''
@property
def extra_info(self):
"""Extra detail to display as a tooltip."""
return None
def register_alerts(self, request, course): def register_alerts(self, request, course):
""" """
Registers any relevant course alerts given the current request. Registers any relevant course alerts given the current request.
...@@ -393,7 +388,6 @@ class CourseAssignmentDate(DateSummary): ...@@ -393,7 +388,6 @@ class CourseAssignmentDate(DateSummary):
self.contains_gated_content = False self.contains_gated_content = False
self.complete = None self.complete = None
self.past_due = None self.past_due = None
self._extra_info = None
@property @property
def date(self): def date(self):
...@@ -411,10 +405,6 @@ class CourseAssignmentDate(DateSummary): ...@@ -411,10 +405,6 @@ class CourseAssignmentDate(DateSummary):
def link(self): def link(self):
return self.assignment_link return self.assignment_link
@property
def extra_info(self):
return self._extra_info
@link.setter @link.setter
def link(self, link): def link(self, link):
self.assignment_link = link self.assignment_link = link
......
...@@ -99,7 +99,10 @@ ...@@ -99,7 +99,10 @@
} }
.no-access { .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 { .timeline-date-content {
...@@ -112,14 +115,10 @@ ...@@ -112,14 +115,10 @@
align-items: center; align-items: center;
&.not-released { &.not-released {
color: #b1a3a3; color: #767676;
} }
} }
.timeline-date {
color: #2d323e;
}
.timeline-title { .timeline-title {
@include font-size(14); @include font-size(14);
...@@ -135,7 +134,7 @@ ...@@ -135,7 +134,7 @@
} }
&.not-released { &.not-released {
color: #767676; color: #d1d2d4;
} }
} }
...@@ -150,30 +149,8 @@ ...@@ -150,30 +149,8 @@
color: #2d323e; color: #2d323e;
text-decoration: underline; 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 { .pill {
@include font-size(12); @include font-size(12);
......
...@@ -82,11 +82,6 @@ from openedx.core.djangolib.markup import HTML, Text ...@@ -82,11 +82,6 @@ from openedx.core.djangolib.markup import HTML, Text
<div class="timeline-description ${access_class} ${not_released}"> <div class="timeline-description ${access_class} ${not_released}">
${block.description} ${block.description}
</div> </div>
% if block.extra_info:
<div class="timeline-extra-info ${access_class} ${not_released}">
${block.extra_info}
</div>
% endif
% endif % endif
</div> </div>
</div> </div>
......
...@@ -41,20 +41,10 @@ class TestIcsGeneration(TestCase): ...@@ -41,20 +41,10 @@ class TestIcsGeneration(TestCase):
def make_assigment( def make_assigment(
self, block_key=None, title=None, url=None, date=None, contains_gated_content=False, complete=False, 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 """ """ Bundles given info into a namedtupled like get_course_assignments returns """
return _Assignment( return _Assignment(block_key, title, url, date, contains_gated_content, complete, past_due, assignment_type)
block_key,
title,
url,
date,
contains_gated_content,
complete,
past_due,
assignment_type,
extra_info
)
def expected_ics(self, *assignments): def expected_ics(self, *assignments):
""" Returns hardcoded expected ics strings for given assignments """ """ Returns hardcoded expected ics strings for given assignments """
......
...@@ -41,11 +41,10 @@ class ContentTypeGateTransformer(BlockStructureTransformer): ...@@ -41,11 +41,10 @@ class ContentTypeGateTransformer(BlockStructureTransformer):
inside of it is content gated. `contains_gated_content` can then be used to indicate something inside of it is content gated. `contains_gated_content` can then be used to indicate something
in the blocks subtree is gated. 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): 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) self._set_contains_gated_content_on_parents(block_structure, parent_block_key)
def transform(self, usage_info, block_structure): def transform(self, usage_info, block_structure):
......
...@@ -21,9 +21,6 @@ from django.utils.translation import ugettext as _ ...@@ -21,9 +21,6 @@ from django.utils.translation import ugettext as _
% if course_date.description: % if course_date.description:
<p class="description">${course_date.description}</p> <p class="description">${course_date.description}</p>
% endif % 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: % if course_date.link and course_date.link_text:
<div class="date-summary-link"> <div class="date-summary-link">
<a href="${course_date.link}">${course_date.link_text}</a> <a href="${course_date.link}">${course_date.link_text}</a>
......
...@@ -66,7 +66,6 @@ setup( ...@@ -66,7 +66,6 @@ setup(
"load_override_data = lms.djangoapps.course_blocks.transformers.load_override_data:OverrideDataTransformer", "load_override_data = lms.djangoapps.course_blocks.transformers.load_override_data:OverrideDataTransformer",
"content_type_gate = openedx.features.content_type_gating.block_transformers:ContentTypeGateTransformer", "content_type_gate = openedx.features.content_type_gating.block_transformers:ContentTypeGateTransformer",
"access_denied_message_filter = lms.djangoapps.course_blocks.transformers.access_denied_filter:AccessDeniedMessageFilterTransformer", "access_denied_message_filter = lms.djangoapps.course_blocks.transformers.access_denied_filter:AccessDeniedMessageFilterTransformer",
"open_assessment_transformer = lms.djangoapps.courseware.transformers:OpenAssessmentDateTransformer",
], ],
"openedx.ace.policy": [ "openedx.ace.policy": [
"bulk_email_optout = lms.djangoapps.bulk_email.policies:CourseEmailOptout" "bulk_email_optout = lms.djangoapps.bulk_email.policies:CourseEmailOptout"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment