From a1c8f8c4686c3b9513e98ac6eff1279fa0ae2077 Mon Sep 17 00:00:00 2001
From: Sarina Canelake
- ${_("To view the Gradebook (small courses only), please visit the 'Student Admin' section of the instructor dashboard.")}
-
- ${_("To perform grade downloads, please visit the 'Data Download' section of the instructor dashboard.")}
-
- ${_("To download student grades, please visit the 'Data Download' section of the instructor dashboard.")}
-
@@ -226,7 +215,10 @@ function goto( mode)
%endif
- ${_("To view the graded assignments configuration, please visit the 'Data Download' section of the instructor dashboard.")}
+ ${_("To download student grades and view the grading configuration for your course, visit the Data Download section of the Instructor Dashboard.")}
+
+ ${_("To view the Gradebook (only available for courses with a small number of enrolled students), visit the Student Admin section of the Instructor Dashboard.")}
"
+ msg = _("Failed to communicate with gradebook server at {url}").format(url=rgburl) + "
"
msg += _("Error: {err}").format(err=err)
msg += "
resp={resp}".format(resp=resp.content)
msg += "
data={data}".format(data=data)
@@ -565,6 +524,7 @@ def _do_remote_gradebook(user, course, action, args=None, files=None):
return msg, datatable
+
def _role_members_table(role, title, course_key):
"""
Return a data table of usernames and names of users in group_name.
@@ -784,7 +744,7 @@ def get_student_grade_summary_data(request, course, get_grades=True, get_raw_sco
datarow = [student.id, student.username, student.profile.name, student.email]
try:
datarow.append(student.externalauthmap.external_email)
- except: # ExternalAuthMap.DoesNotExist
+ except Exception: # pylint: disable=broad-except
datarow.append('')
if get_grades:
@@ -843,12 +803,12 @@ def _do_enroll_students(course, course_key, students, secure=False, overload=Fal
if overload: # delete all but staff
todelete = CourseEnrollment.objects.filter(course_id=course_key)
- for ce in todelete:
- if not has_access(ce.user, 'staff', course) and ce.user.email.lower() not in new_students_lc:
- status[ce.user.email] = 'deleted'
- ce.deactivate()
+ for enrollee in todelete:
+ if not has_access(enrollee.user, 'staff', course) and enrollee.user.email.lower() not in new_students_lc:
+ status[enrollee.user.email] = 'deleted'
+ enrollee.deactivate()
else:
- status[ce.user.email] = 'is staff'
+ status[enrollee.user.email] = 'is staff'
ceaset = CourseEnrollmentAllowed.objects.filter(course_id=course_key)
for cea in ceaset:
status[cea.email] = 'removed from pending enrollment list'
@@ -882,7 +842,7 @@ def _do_enroll_students(course, course_key, students, secure=False, overload=Fal
)
# Composition of email
- d = {
+ email_data = {
'site_name': stripped_site_name,
'registration_url': registration_url,
'course': course,
@@ -897,11 +857,11 @@ def _do_enroll_students(course, course_key, students, secure=False, overload=Fal
user = User.objects.get(email=student)
except User.DoesNotExist:
- #Student not signed up yet, put in pending enrollment allowed table
+ # Student not signed up yet, put in pending enrollment allowed table
cea = CourseEnrollmentAllowed.objects.filter(email=student, course_id=course_key)
- #If enrollmentallowed already exists, update auto_enroll flag to however it was set in UI
- #Will be 0 or 1 records as there is a unique key on email + course_id
+ # If enrollmentallowed already exists, update auto_enroll flag to however it was set in UI
+ # Will be 0 or 1 records as there is a unique key on email + course_id
if cea:
cea[0].auto_enroll = auto_enroll
cea[0].save()
@@ -909,7 +869,7 @@ def _do_enroll_students(course, course_key, students, secure=False, overload=Fal
+ ('on' if auto_enroll else 'off')
continue
- #EnrollmentAllowed doesn't exist so create it
+ # EnrollmentAllowed doesn't exist so create it
cea = CourseEnrollmentAllowed(email=student, course_id=course_key, auto_enroll=auto_enroll)
cea.save()
@@ -918,9 +878,9 @@ def _do_enroll_students(course, course_key, students, secure=False, overload=Fal
if email_students:
# User is allowed to enroll but has not signed up yet
- d['email_address'] = student
- d['message'] = 'allowed_enroll'
- send_mail_ret = send_mail_to_student(student, d)
+ email_data['email_address'] = student
+ email_data['message'] = 'allowed_enroll'
+ send_mail_ret = send_mail_to_student(student, email_data)
status[student] += (', email sent' if send_mail_ret else '')
continue
@@ -936,13 +896,13 @@ def _do_enroll_students(course, course_key, students, secure=False, overload=Fal
if email_students:
# User enrolled for first time, populate dict with user specific info
- d['email_address'] = student
- d['full_name'] = user.profile.name
- d['message'] = 'enrolled_enroll'
- send_mail_ret = send_mail_to_student(student, d)
+ email_data['email_address'] = student
+ email_data['full_name'] = user.profile.name
+ email_data['message'] = 'enrolled_enroll'
+ send_mail_ret = send_mail_to_student(student, email_data)
status[student] += (', email sent' if send_mail_ret else '')
- except:
+ except Exception: # pylint: disable=broad-except
status[student] = 'rejected'
datatable = {'header': ['StudentEmail', 'action']}
@@ -977,15 +937,17 @@ def _do_unenroll_students(course_key, students, email_students=False):
)
if email_students:
course = modulestore().get_course(course_key)
- #Composition of email
- d = {'site_name': stripped_site_name,
- 'course': course}
+ # Composition of email
+ data = {
+ 'site_name': stripped_site_name,
+ 'course': course
+ }
for student in old_students:
isok = False
cea = CourseEnrollmentAllowed.objects.filter(course_id=course_key, email=student)
- #Will be 0 or 1 records as there is a unique key on email + course_id
+ # Will be 0 or 1 records as there is a unique key on email + course_id
if cea:
cea[0].delete()
status[student] = "un-enrolled"
@@ -996,25 +958,25 @@ def _do_unenroll_students(course_key, students, email_students=False):
except User.DoesNotExist:
if isok and email_students:
- #User was allowed to join but had not signed up yet
- d['email_address'] = student
- d['message'] = 'allowed_unenroll'
- send_mail_ret = send_mail_to_student(student, d)
+ # User was allowed to join but had not signed up yet
+ data['email_address'] = student
+ data['message'] = 'allowed_unenroll'
+ send_mail_ret = send_mail_to_student(student, data)
status[student] += (', email sent' if send_mail_ret else '')
continue
- #Will be 0 or 1 records as there is a unique key on user + course_id
+ # Will be 0 or 1 records as there is a unique key on user + course_id
if CourseEnrollment.is_enrolled(user, course_key):
try:
CourseEnrollment.unenroll(user, course_key)
status[student] = "un-enrolled"
if email_students:
- #User was enrolled
- d['email_address'] = student
- d['full_name'] = user.profile.name
- d['message'] = 'enrolled_unenroll'
- send_mail_ret = send_mail_to_student(student, d)
+ # User was enrolled
+ data['email_address'] = student
+ data['full_name'] = user.profile.name
+ data['message'] = 'enrolled_unenroll'
+ send_mail_ret = send_mail_to_student(student, data)
status[student] += (', email sent' if send_mail_ret else '')
except Exception: # pylint: disable=broad-except
@@ -1025,8 +987,7 @@ def _do_unenroll_students(course_key, students, email_students=False):
datatable['data'] = [[x, status[x]] for x in sorted(status)]
datatable['title'] = _('Un-enrollment of students')
- data = dict(datatable=datatable)
- return data
+ return dict(datatable=datatable)
def send_mail_to_student(student, param_dict):
@@ -1123,15 +1084,15 @@ def get_answers_distribution(request, course_key):
dist = grades.answer_distributions(course.id)
- d = {}
- d['header'] = ['url_name', 'display name', 'answer id', 'answer', 'count']
+ dist = {}
+ dist['header'] = ['url_name', 'display name', 'answer id', 'answer', 'count']
- d['data'] = [
+ dist['data'] = [
[url_name, display_name, answer_id, a, answers[a]]
for (url_name, display_name, answer_id), answers in sorted(dist.items())
for a in answers
]
- return d
+ return dist
#-----------------------------------------------------------------------------
@@ -1153,8 +1114,8 @@ def compute_course_stats(course):
children = module.get_children()
category = module.__class__.__name__ # HtmlDescriptor, CapaDescriptor, ...
counts[category] += 1
- for c in children:
- walk(c)
+ for child in children:
+ walk(child)
walk(course)
stats = dict(counts) # number of each kind of module
diff --git a/lms/templates/courseware/legacy_instructor_dashboard.html b/lms/templates/courseware/legacy_instructor_dashboard.html
index f6003e1885..cf0733c433 100644
--- a/lms/templates/courseware/legacy_instructor_dashboard.html
+++ b/lms/templates/courseware/legacy_instructor_dashboard.html
@@ -136,7 +136,7 @@ function goto( mode)
${_("Back To Instructor Dashboard")}
- ${_("Instructor Dashboard")}
+ ${_("Legacy Instructor Dashboard")}
%if settings.FEATURES.get('IS_EDX_DOMAIN', False):
## Only show this banner on the edx.org website (other sites may choose to show this if they wish)
@@ -201,21 +201,10 @@ function goto( mode)
% endif
-
${_("To perform these actions, please visit the 'Student Admin' section of the instructor dashboard.")}
+${_("To perform these actions, visit the Student Admin section of the Instructor Dashboard.")}
%endif${_("To perform these actions, please visit the 'Student Admin' section of the instructor dashboard.")}
+${_("To perform these actions, visit the Student Admin section of the Instructor Dashboard.")}
%endif @@ -301,12 +293,8 @@ function goto( mode) ##----------------------------------------------------------------------------- %if modeflag.get('Admin'): - %if instructor_access: -${_("To add or remove course staff, please visit the 'Membership' section of the instructor dashboard.")}
- %endif - - %if admin_access: -${_("To add or remove course instructors, please visit the 'Membership' section of the instructor dashboard.")}
+ %if instructor_access or admin_access: +${_("To add or remove course staff or instructors, visit the Membership section of the Instructor Dashboard.")}
%endif %if settings.FEATURES['ENABLE_MANUAL_GIT_RELOAD'] and admin_access: @@ -318,7 +306,7 @@ function goto( mode) ##----------------------------------------------------------------------------- %if modeflag.get('Forum Admin'): -${_("To manage forum roles, please visit the 'Membership' section of the instructor dashboard.")}
+${_("To manage forum roles, visit the Membership section of the Instructor Dashboard.")}
%endif ##----------------------------------------------------------------------------- @@ -369,17 +357,13 @@ function goto( mode) %if modeflag.get('Data'):- ${_("To download student profile data, please visit the 'Data Download' section of the instructor dashboard.")} -
-${_("Problem urlname:")}
- ${_("To download student anonymized IDs, please visit the 'Data Download' section of the instructor dashboard.")} + ${_("To download student profile data and anonymized IDs, visit the Data Download section of the Instructor Dashboard.")}
${_("To manage beta tester roles, please visit the 'Membership' section of the instructor dashboard.")}
- %if course.is_cohorted: -${_("To manage course cohorts, please visit the 'Membership' section of the instructor dashboard.")}
+${_("To manage beta tester roles and cohort groups, visit the Membership section of the Instructor Dashboard.")}
+ %else: +${_("To manage beta tester roles, visit the Membership section of the Instructor Dashboard.")}
%endif - %endif %endif ##----------------------------------------------------------------------------- %if modeflag.get('Email'): -${_("To send email, please visit the 'Email' section of the instructor dashboard.")}
+${_("To send email, visit the Email section of the Instructor Dashboard.")}
%endif @@ -698,7 +681,7 @@ function goto( mode)- ${_("These statistics can be viewed under the 'Admin' tab of the legacy instructor dashboard.")} + ${_("View course statistics in the Admin section of this legacy instructor dashboard.")}
%endif