msg='<font color="red">'+_('Error: user "{username}" does not have rolename "{rolename}", cannot remove').format(username=uname,rolename=rolename)+'</font>'
else:
user.roles.remove(role)
msg='<font color="green">'+_('Removed "{username}" from "{course_id}" forum role = "{rolename}"').format(username=user,course_id=course.id.to_deprecated_string(),rolename=rolename)+'</font>'
else:
ifalreadyexists:
msg='<font color="red">'+_('Error: user "{username}" already has rolename "{rolename}", cannot add').format(username=uname,rolename=rolename)+'</font>'
msg='<font color="red">'+_('Error: user "{username}" should first be added as staff before adding as a forum administrator, cannot add').format(username=uname)+'</font>'
else:
user.roles.add(role)
msg='<font color="green">'+_('Added "{username}" to "{course_id}" forum role = "{rolename}"').format(username=user,course_id=course.id.to_deprecated_string(),rolename=rolename)+'</font>'
returnmsg
def_role_members_table(role,title,course_key):
def_role_members_table(role,title,course_key):
"""
"""
Return a data table of usernames and names of users in group_name.
Return a data table of usernames and names of users in group_name.
## Only show this banner on the edx.org website (other sites may choose to show this if they wish)
## Only show this banner on the edx.org website (other sites may choose to show this if they wish)
...
@@ -202,19 +202,10 @@ function goto( mode)
...
@@ -202,19 +202,10 @@ function goto( mode)
% endif
% endif
<p>
<p>
<ahref="${reverse('spoc_gradebook', kwargs=dict(course_id=course.id.to_deprecated_string()))}"class="${'is-disabled' if disable_buttons else ''}">${_("Gradebook")}</a>
</p>
<p>
<inputtype="submit"name="action"value="Dump list of enrolled students"class="${'is-disabled' if disable_buttons else ''}">
<inputtype="submit"name="action"value="Dump list of enrolled students"class="${'is-disabled' if disable_buttons else ''}">
</p>
</p>
<p>
<p>
<inputtype="submit"name="action"value="Dump Grades for all students in this course"class="${'is-disabled' if disable_buttons else ''}">
<inputtype="submit"name="action"value="Download CSV of all student grades for this course"class="${'is-disabled' if disable_buttons else ''}">
</p>
<p>
<inputtype="submit"name="action"value="Dump all RAW grades for all students in this course"class="${'is-disabled' if disable_buttons else ''}">
<inputtype="submit"name="action"value="Dump all RAW grades for all students in this course"class="${'is-disabled' if disable_buttons else ''}">
<inputtype="submit"name="action"value="Download CSV of all RAW grades"class="${'is-disabled' if disable_buttons else ''}">
<inputtype="submit"name="action"value="Download CSV of all RAW grades"class="${'is-disabled' if disable_buttons else ''}">
</p>
</p>
...
@@ -223,7 +214,12 @@ function goto( mode)
...
@@ -223,7 +214,12 @@ function goto( mode)
%if not settings.FEATURES.get('ENABLE_ASYNC_ANSWER_DISTRIBUTION'):
%if not settings.FEATURES.get('ENABLE_ASYNC_ANSWER_DISTRIBUTION'):
<inputtype="submit"name="action"value="Download CSV of answer distributions"class="${'is-disabled' if disable_buttons else ''}">
<inputtype="submit"name="action"value="Download CSV of answer distributions"class="${'is-disabled' if disable_buttons else ''}">
%endif
%endif
<inputtype="submit"name="action"value="Dump description of graded assignments configuration">
<pclass="is-deprecated">
${_("To download student grades and view the grading configuration for your course, visit the Data Download section of the Instructor Dashboard.")}
</p>
<pclass="is-deprecated">
${_("To view the Gradebook (only available for courses with a small number of enrolled students), visit the Student Admin section of the Instructor Dashboard.")}
<inputtype="submit"name="action"value="Reset ALL students' attempts">
<inputtype="submit"name="action"value="Rescore ALL students' problem submissions">
</p>
<p>
<p>${_("These actions run in the background, and status for active tasks will appear in a table below. To see status for all tasks submitted for this problem, click on this button:")}
<pclass="copy">${_("Please try not to email students more than once per week. Important things to consider before sending:")}</p>
<ulclass="list-advice">
<liclass="item">${_("Have you read over the email to make sure it says everything you want to say?")}</li>
<liclass="item">${_("Have you sent the email to yourself first to make sure you're happy with how it's displayed, and that embedded links and images work properly?")}</li>