Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
9c7f2cf6
Commit
9c7f2cf6
authored
12 years ago
by
Victor Shnayder
Browse files
Options
Downloads
Patches
Plain Diff
WIP -- do not merge
parent
02d5cfd1
No related branches found
Branches containing commit
Tags
release-2021-05-07-10.28
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lms/djangoapps/instructor/views.py
+10
-3
10 additions, 3 deletions
lms/djangoapps/instructor/views.py
lms/templates/courseware/instructor_dashboard.html
+3
-3
3 additions, 3 deletions
lms/templates/courseware/instructor_dashboard.html
with
13 additions
and
6 deletions
lms/djangoapps/instructor/views.py
+
10
−
3
View file @
9c7f2cf6
...
...
@@ -314,14 +314,14 @@ def instructor_dashboard(request, course_id):
users
=
request
.
POST
[
'
betausers
'
]
log
.
debug
(
"
users: {0!r}
"
.
format
(
users
))
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
(
add_user_to_group
(
request
,
username_or_email
,
group
,
'
beta testers
'
,
'
beta-tester
'
))
elif
action
==
'
Remove beta testers
'
:
users
=
request
.
POST
[
'
betausers
'
]
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
(
remove_user_from_group
(
request
,
username_or_email
,
group
,
'
beta testers
'
,
'
beta-tester
'
))
...
...
@@ -793,11 +793,18 @@ def grade_summary(request, course_id):
# 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
):
"""
Do the actual work of enrolling multiple students, presented as a string
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
=
[
str
(
s
.
strip
())
for
s
in
new_students
]
new_students_lc
=
[
x
.
lower
()
for
x
in
new_students
]
...
...
This diff is collapsed.
Click to expand it.
lms/templates/courseware/instructor_dashboard.html
+
3
−
3
View file @
9c7f2cf6
...
...
@@ -61,7 +61,7 @@ function goto( mode)
%endif
<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('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>
]
</h2>
...
...
@@ -254,7 +254,7 @@ function goto( mode)
%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>
<input
type=
"submit"
name=
"action"
value=
"Enroll multiple students"
>
...
...
@@ -268,7 +268,7 @@ function goto( mode)
<p>
<input
type=
"submit"
name=
"action"
value=
"List beta testers"
>
<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.
</p>
<p>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment