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
aa4b6118
Commit
aa4b6118
authored
Apr 29, 2013
by
dcadams
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some cleanup.
parent
b62b4ac2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
36 deletions
+2
-36
lms/djangoapps/instructor/tests/test_enrollment.py
+0
-2
lms/djangoapps/instructor/views.py
+2
-32
lms/urls.py
+0
-2
No files found.
lms/djangoapps/instructor/tests/test_enrollment.py
View file @
aa4b6118
...
...
@@ -103,7 +103,6 @@ class TestInstructorEnrollsStudent(LoginEnrollmentTestCase):
self
.
activate_user
(
self
.
student1
)
self
.
student2
=
'test1_2@student.com'
self
.
password
=
'bar'
self
.
create_account
(
's1_2'
,
self
.
student2
,
self
.
password
)
self
.
activate_user
(
self
.
student2
)
...
...
@@ -146,7 +145,6 @@ class TestInstructorEnrollsStudent(LoginEnrollmentTestCase):
self
.
activate_user
(
self
.
student
)
self
.
student
=
'test2_2@student.com'
self
.
password
=
'bar'
self
.
create_account
(
's2_2'
,
self
.
student
,
self
.
password
)
self
.
activate_user
(
self
.
student
)
...
...
lms/djangoapps/instructor/views.py
View file @
aa4b6118
...
...
@@ -1030,36 +1030,6 @@ def _do_enroll_students(course_id, students, overload=False, auto_enroll=False):
return
data
@ensure_csrf_cookie
@cache_control
(
no_cache
=
True
,
no_store
=
True
,
must_revalidate
=
True
)
def
enroll_students
(
request
,
course_id
):
"""Allows a staff member to enroll students in a course.
This is a short-term hack for Berkeley courses launching fall
2012. In the long term, we would like functionality like this, but
we would like both the instructor and the student to agree. Right
now, this allows any instructor to add students to their course,
which we do not want.
It is poorly written and poorly tested, but it's designed to be
stripped out.
"""
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'staff'
)
existing_students
=
[
ce
.
user
.
email
for
ce
in
CourseEnrollment
.
objects
.
filter
(
course_id
=
course_id
)]
new_students
=
request
.
POST
.
get
(
'new_students'
)
ret
=
_do_enroll_students
(
course
,
course_id
,
new_students
)
added_students
=
ret
[
'added'
]
rejected_students
=
ret
[
'rejected'
]
return
render_to_response
(
"enroll_students.html"
,
{
'course'
:
course_id
,
'existing_students'
:
existing_students
,
'added_students'
:
added_students
,
'rejected_students'
:
rejected_students
,
'debug'
:
new_students
})
#Unenrollment
def
_do_unenroll_students
(
course_id
,
students
):
"""Do the actual work of un-enrolling multiple students, presented as a string
...
...
@@ -1072,7 +1042,7 @@ def _do_unenroll_students(course_id, students):
isok
=
False
cea
=
CourseEnrollmentAllowed
.
objects
.
filter
(
course_id
=
course_id
,
email
=
student
)
#
Safe to get the first entry
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"
...
...
@@ -1084,7 +1054,7 @@ def _do_unenroll_students(course_id, students):
continue
nce
=
CourseEnrollment
.
objects
.
filter
(
user
=
user
,
course_id
=
course_id
)
#
Safe to get the first entry
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
nce
:
try
:
nce
[
0
]
.
delete
()
...
...
lms/urls.py
View file @
aa4b6118
...
...
@@ -236,8 +236,6 @@ if settings.COURSEWARE_ENABLED:
'instructor.views.gradebook'
,
name
=
'gradebook'
),
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/grade_summary$'
,
'instructor.views.grade_summary'
,
name
=
'grade_summary'
),
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/enroll_students$'
,
'instructor.views.enroll_students'
,
name
=
'enroll_students'
),
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/staff_grading$'
,
'open_ended_grading.views.staff_grading'
,
name
=
'staff_grading'
),
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/staff_grading/get_next$'
,
...
...
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