Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
9c7f2cf6
Commit
9c7f2cf6
authored
Jan 15, 2013
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP -- do not merge
parent
02d5cfd1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
lms/djangoapps/instructor/views.py
+10
-3
lms/templates/courseware/instructor_dashboard.html
+3
-3
No files found.
lms/djangoapps/instructor/views.py
View file @
9c7f2cf6
...
@@ -314,14 +314,14 @@ def instructor_dashboard(request, course_id):
...
@@ -314,14 +314,14 @@ def instructor_dashboard(request, course_id):
users
=
request
.
POST
[
'betausers'
]
users
=
request
.
POST
[
'betausers'
]
log
.
debug
(
"users: {0!r}"
.
format
(
users
))
log
.
debug
(
"users: {0!r}"
.
format
(
users
))
group
=
get_beta_group
(
course
)
group
=
get_beta_group
(
course
)
for
username_or_email
in
users
.
split
(
):
for
username_or_email
in
_split_by_comma_and_whitespace
(
users
):
msg
+=
"<p>{0}</p>"
.
format
(
msg
+=
"<p>{0}</p>"
.
format
(
add_user_to_group
(
request
,
username_or_email
,
group
,
'beta testers'
,
'beta-tester'
))
add_user_to_group
(
request
,
username_or_email
,
group
,
'beta testers'
,
'beta-tester'
))
elif
action
==
'Remove beta testers'
:
elif
action
==
'Remove beta testers'
:
users
=
request
.
POST
[
'betausers'
]
users
=
request
.
POST
[
'betausers'
]
group
=
get_beta_group
(
course
)
group
=
get_beta_group
(
course
)
for
username_or_email
in
users
.
split
(
):
for
username_or_email
in
_split_by_comma_and_whitespace
(
users
):
msg
+=
"<p>{0}</p>"
.
format
(
msg
+=
"<p>{0}</p>"
.
format
(
remove_user_from_group
(
request
,
username_or_email
,
group
,
'beta testers'
,
'beta-tester'
))
remove_user_from_group
(
request
,
username_or_email
,
group
,
'beta testers'
,
'beta-tester'
))
...
@@ -793,11 +793,18 @@ def grade_summary(request, course_id):
...
@@ -793,11 +793,18 @@ def grade_summary(request, course_id):
# enrollment
# enrollment
def
_split_by_comma_and_whitespace
(
s
):
"""
Split a string both by on commas and whitespice.
"""
# Note: split() with no args removes empty strings from output
return
[
x
.
split
()
for
x
in
s
.
split
(
','
)]
def
_do_enroll_students
(
course
,
course_id
,
students
,
overload
=
False
):
def
_do_enroll_students
(
course
,
course_id
,
students
,
overload
=
False
):
"""Do the actual work of enrolling multiple students, presented as a string
"""Do the actual work of enrolling multiple students, presented as a string
of emails separated by commas or returns"""
of emails separated by commas or returns"""
ns
=
[
x
.
split
(
'
\n
'
)
for
x
in
students
.
split
(
','
)]
ns
=
_split_by_comma_and_whitespace
(
students
)
new_students
=
[
item
for
sublist
in
ns
for
item
in
sublist
]
new_students
=
[
item
for
sublist
in
ns
for
item
in
sublist
]
new_students
=
[
str
(
s
.
strip
())
for
s
in
new_students
]
new_students
=
[
str
(
s
.
strip
())
for
s
in
new_students
]
new_students_lc
=
[
x
.
lower
()
for
x
in
new_students
]
new_students_lc
=
[
x
.
lower
()
for
x
in
new_students
]
...
...
lms/templates/courseware/instructor_dashboard.html
View file @
9c7f2cf6
...
@@ -61,7 +61,7 @@ function goto( mode)
...
@@ -61,7 +61,7 @@ function goto( mode)
%endif
%endif
<a
href=
"#"
onclick=
"goto('Admin');"
class=
"${modeflag.get('Admin')}"
>
Admin
</a>
|
<a
href=
"#"
onclick=
"goto('Admin');"
class=
"${modeflag.get('Admin')}"
>
Admin
</a>
|
<a
href=
"#"
onclick=
"goto('Forum Admin');"
class=
"${modeflag.get('Forum Admin')}"
>
Forum Admin
</a>
|
<a
href=
"#"
onclick=
"goto('Forum Admin');"
class=
"${modeflag.get('Forum Admin')}"
>
Forum Admin
</a>
|
<a
href=
"#"
onclick=
"goto('Enrollment');"
class=
"${modeflag.get('Enrollment')}"
>
Enrollment
</a>
<a
href=
"#"
onclick=
"goto('Enrollment');"
class=
"${modeflag.get('Enrollment')}"
>
Enrollment
</a>
|
<a
href=
"#"
onclick=
"goto('Manage Groups');"
class=
"${modeflag.get('Manage Groups')}"
>
Manage Groups
</a>
]
<a
href=
"#"
onclick=
"goto('Manage Groups');"
class=
"${modeflag.get('Manage Groups')}"
>
Manage Groups
</a>
]
</h2>
</h2>
...
@@ -254,7 +254,7 @@ function goto( mode)
...
@@ -254,7 +254,7 @@ function goto( mode)
%endif
%endif
<p>
Add students: enter emails, separated by
return
s or commas;
</p>
<p>
Add students: enter emails, separated by
new line
s or commas;
</p>
<textarea
rows=
"6"
cols=
"70"
name=
"enroll_multiple"
></textarea>
<textarea
rows=
"6"
cols=
"70"
name=
"enroll_multiple"
></textarea>
<input
type=
"submit"
name=
"action"
value=
"Enroll multiple students"
>
<input
type=
"submit"
name=
"action"
value=
"Enroll multiple students"
>
...
@@ -268,7 +268,7 @@ function goto( mode)
...
@@ -268,7 +268,7 @@ function goto( mode)
<p>
<p>
<input
type=
"submit"
name=
"action"
value=
"List beta testers"
>
<input
type=
"submit"
name=
"action"
value=
"List beta testers"
>
<p>
<p>
Enter usernames or emails for students who should be beta-testers, one per line. They will get to
Enter usernames or emails for students who should be beta-testers, one per line
, or separated by commas
. They will get to
see course materials early, as configured via the
<tt>
days_early_for_beta
</tt>
option in the course policy.
see course materials early, as configured via the
<tt>
days_early_for_beta
</tt>
option in the course policy.
</p>
</p>
<p>
<p>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment