fixing merge conflicts

This commit is contained in:
e0d
2013-12-16 15:02:14 -05:00
11 changed files with 996 additions and 19 deletions

View File

@@ -8,6 +8,9 @@ from abc import ABCMeta, abstractmethod
from django.contrib.auth.models import User, Group
from xmodule.modulestore import Location
from xmodule.modulestore.exceptions import InvalidLocationError, ItemNotFoundError
from xmodule.modulestore.django import loc_mapper
from xmodule.modulestore.locator import CourseLocator
class CourseContextRequired(Exception):
@@ -134,20 +137,45 @@ class CourseRole(GroupBasedRole):
A named role in a particular course
"""
def __init__(self, role, location, course_context=None):
# pylint: disable=no-member
loc = Location(location)
legacy_group_name = '{0}_{1}'.format(role, loc.course)
if loc.category.lower() == 'course':
course_id = loc.course_id
else:
"""
Location may be either a Location, a string, dict, or tuple which Location will accept
in its constructor, or a CourseLocator. Handle all these giving some preference to
the preferred naming.
"""
# TODO: figure out how to make the group name generation lazy so it doesn't force the
# loc mapping?
if not hasattr(location, 'course_id'):
location = Location(location)
# direct copy from auth.authz.get_all_course_role_groupnames will refactor to one impl asap
groupnames = []
try:
groupnames.append('{0}_{1}'.format(role, location.course_id))
except InvalidLocationError: # will occur on old locations where location is not of category course
if course_context is None:
raise CourseContextRequired()
course_id = course_context
else:
groupnames.append('{0}_{1}'.format(role, course_context))
group_name = '{0}_{1}'.format(role, course_id)
# pylint: disable=no-member
if isinstance(location, Location):
try:
locator = loc_mapper().translate_location(location.course_id, location, False, False)
groupnames.append('{0}_{1}'.format(role, locator.course_id))
except (InvalidLocationError, ItemNotFoundError):
# if it's never been mapped, the auth won't be via the Locator syntax
pass
# least preferred legacy role_course format
groupnames.append('{0}_{1}'.format(role, location.course))
elif isinstance(location, CourseLocator):
# handle old Location syntax
old_location = loc_mapper().translate_locator_to_location(location, get_course=True)
if old_location:
# the slashified version of the course_id (myu/mycourse/myrun)
groupnames.append('{0}_{1}'.format(role, old_location.course_id))
# add the least desirable but sometimes occurring format.
groupnames.append('{0}_{1}'.format(role, old_location.course))
super(CourseRole, self).__init__([group_name, legacy_group_name])
super(CourseRole, self).__init__(groupnames)
class OrgRole(GroupBasedRole):

View File

@@ -23,6 +23,17 @@
<h1>${_("Staff grading")}</h1>
<div class="breadcrumbs"></div>
<div class="error-container"></div>
<br>
<div style="color:red;">
<b>
The issue we had between Dec 3 and Dec 5 with the visibility
of student responses has now been resolved. All responses
should now be visible. Thank you for your patience!
--the edX team
</b>
</div>
<br>
<hr>
<div class="message-container"></div>

View File

@@ -16,6 +16,17 @@
<section class="container">
<div class="combined-notifications" data-ajax_url="${ajax_url}">
<div class="error-container">${error_text}</div>
<br>
<div style="color:red;">
<b>
The issue we had between Dec 3 and Dec 5 with the visibility
of student responses has now been resolved. All responses
should now be visible. Thank you for your patience!
--the edX team
</b>
</div>
<br>
<hr>
<h1>${_("Open Ended Console")}</h1>
<h2>${_("Instructions")}</h2>

View File

@@ -19,6 +19,17 @@
<section class="container">
<div class="open-ended-problems" data-ajax_url="${ajax_url}">
<div class="error-container">${error_text}</div>
<br>
<div style="color:red;">
<b>
The issue we had between Dec 3 and Dec 5 with the visibility
of student responses has now been resolved. All responses
should now be visible. Thank you for your patience!
--the edX team
</b>
</div>
<br>
<hr>
<h1>${_("Flagged Open Ended Problems")}</h1>
<h2>${_("Instructions")}</h2>

View File

@@ -16,6 +16,17 @@
<section class="container">
<div class="open-ended-problems" data-ajax_url="${ajax_url}">
<div class="error-container">${error_text}</div>
<br>
<div style="color:red;">
<b>
The issue we had between Dec 3 and Dec 5 with the visibility
of student responses has now been resolved. All responses
should now be visible. Thank you for your patience!
--the edX team
</b>
</div>
<br>
<hr>
<h1>${_("Open Ended Problems")}</h1>
<h2>${_("Instructions")}</h2>
<p>${_("Here is a list of open ended problems for this course.")}</p>

View File

@@ -15,6 +15,17 @@ criteria.{end_li_tag}
<section class="container peer-grading-container">
<div class="peer-grading" data-ajax-url="${ajax_url}" data-use-single-location="${use_single_location}">
<div class="error-container">${error_text}</div>
<br>
<div style="color:red;">
<b>
The issue we had between Dec 3 and Dec 5 with the visibility
of student responses has now been resolved. All responses
should now be visible. Thank you for your patience!
--the edX team
</b>
</div>
<br>
<hr>
<div class="peer-grading-tools">
<h1 class="peer-grading-title">${_("Peer Grading")}</h1>
<h2 class="peer-grading-instructions">${_("Instructions")}</h2>