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
09442ef4
Commit
09442ef4
authored
Apr 29, 2014
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port spoc gradebook to new instructor dash
LMS-1296
parent
c224fe57
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
2 deletions
+74
-2
lms/djangoapps/courseware/features/courseware_common.py
+5
-0
lms/djangoapps/courseware/features/lti.feature
+2
-1
lms/djangoapps/instructor/views/instructor_dashboard.py
+50
-1
lms/templates/instructor/instructor_dashboard_2/student_admin.html
+15
-0
lms/urls.py
+2
-0
No files found.
lms/djangoapps/courseware/features/courseware_common.py
View file @
09442ef4
...
...
@@ -14,6 +14,11 @@ def i_click_on_the_tab(step, tab_text):
world
.
click_link
(
tab_text
)
@step
(
'I click on the "([^"]*)" link$'
)
def
i_click_on_the_link
(
step
,
link_text
):
world
.
click_link
(
link_text
)
@step
(
'I visit the courseware URL$'
)
def
i_visit_the_course_info_url
(
step
):
world
.
visit
(
'/courses/MITx/6.002x/2012_Fall/courseware'
)
...
...
lms/djangoapps/courseware/features/lti.feature
View file @
09442ef4
...
...
@@ -51,7 +51,8 @@ Feature: LMS.LTI component
Then I see text "Problem Scores
:
5/10"
And
I see graph with total progress
"5%"
Then
I click on the
"Instructor"
tab
And
I click on the
"Gradebook"
tab
And
I click on the
"Student Admin"
tab
And
I click on the
"View Gradebook"
link
And
I see in the gradebook table that
"HW"
is
"50"
And
I see in the gradebook table that
"Total"
is
"5"
...
...
lms/djangoapps/instructor/views/instructor_dashboard.py
View file @
09442ef4
...
...
@@ -6,6 +6,7 @@ from django.utils.translation import ugettext as _
from
django_future.csrf
import
ensure_csrf_cookie
from
django.views.decorators.cache
import
cache_control
from
edxmako.shortcuts
import
render_to_response
from
django.contrib.auth.models
import
User
from
django.core.urlresolvers
import
reverse
from
django.utils.html
import
escape
from
django.http
import
Http404
...
...
@@ -18,9 +19,10 @@ from xmodule.modulestore.django import modulestore
from
xblock.field_data
import
DictFieldData
from
xblock.fields
import
ScopeIds
from
courseware.access
import
has_access
from
courseware.courses
import
get_course_by_id
,
get_cms_course_link
from
courseware.courses
import
get_course_by_id
,
get_cms_course_link
,
get_course_with_access
from
django_comment_client.utils
import
has_forum_access
from
django_comment_common.models
import
FORUM_ROLE_ADMINISTRATOR
from
instructor.offline_gradecalc
import
student_grades
from
student.models
import
CourseEnrollment
from
bulk_email.models
import
CourseAuthorization
from
class_dashboard.dashboard_data
import
get_section_display_name
,
get_array_section_has_problem
...
...
@@ -156,15 +158,23 @@ def _section_membership(course_id, access):
def
_section_student_admin
(
course_id
,
access
):
""" Provide data for the corresponding dashboard section """
is_small_course
=
False
enrollment_count
=
CourseEnrollment
.
num_enrolled_in
(
course_id
)
max_enrollment_for_buttons
=
settings
.
FEATURES
.
get
(
"MAX_ENROLLMENT_INSTR_BUTTONS"
)
if
max_enrollment_for_buttons
is
not
None
:
is_small_course
=
enrollment_count
<=
max_enrollment_for_buttons
section_data
=
{
'section_key'
:
'student_admin'
,
'section_display_name'
:
_
(
'Student Admin'
),
'access'
:
access
,
'is_small_course'
:
is_small_course
,
'get_student_progress_url_url'
:
reverse
(
'get_student_progress_url'
,
kwargs
=
{
'course_id'
:
course_id
}),
'enrollment_url'
:
reverse
(
'students_update_enrollment'
,
kwargs
=
{
'course_id'
:
course_id
}),
'reset_student_attempts_url'
:
reverse
(
'reset_student_attempts'
,
kwargs
=
{
'course_id'
:
course_id
}),
'rescore_problem_url'
:
reverse
(
'rescore_problem'
,
kwargs
=
{
'course_id'
:
course_id
}),
'list_instructor_tasks_url'
:
reverse
(
'list_instructor_tasks'
,
kwargs
=
{
'course_id'
:
course_id
}),
'spoc_gradebook_url'
:
reverse
(
'spoc_gradebook'
,
kwargs
=
{
'course_id'
:
course_id
}),
}
return
section_data
...
...
@@ -246,3 +256,42 @@ def _section_metrics(course_id, access):
'get_students_problem_grades_url'
:
reverse
(
'get_students_problem_grades'
),
}
return
section_data
#---- Gradebook (shown to small courses only) ----
@cache_control
(
no_cache
=
True
,
no_store
=
True
,
must_revalidate
=
True
)
def
spoc_gradebook
(
request
,
course_id
):
"""
Show the gradebook for this course:
- Only shown for courses with enrollment < settings.FEATURES.get("MAX_ENROLLMENT_INSTR_BUTTONS")
- Only displayed to course staff
"""
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'staff'
,
depth
=
None
)
enrolled_students
=
User
.
objects
.
filter
(
courseenrollment__course_id
=
course_id
,
courseenrollment__is_active
=
1
)
.
order_by
(
'username'
)
.
select_related
(
"profile"
)
# TODO (vshnayder): implement pagination to show to large courses
max_num_students
=
settings
.
FEATURES
.
get
(
"MAX_ENROLLMENT_INSTR_BUTTONS"
)
enrolled_students
=
enrolled_students
[:
max_num_students
]
# HACK!
student_info
=
[
{
'username'
:
student
.
username
,
'id'
:
student
.
id
,
'email'
:
student
.
email
,
'grade_summary'
:
student_grades
(
student
,
request
,
course
),
'realname'
:
student
.
profile
.
name
,
}
for
student
in
enrolled_students
]
return
render_to_response
(
'courseware/gradebook.html'
,
{
'students'
:
student_info
,
'course'
:
course
,
'course_id'
:
course_id
,
# Checked above
'staff_access'
:
True
,
'ordered_grades'
:
sorted
(
course
.
grade_cutoffs
.
items
(),
key
=
lambda
i
:
i
[
1
],
reverse
=
True
),
})
lms/templates/instructor/instructor_dashboard_2/student_admin.html
View file @
09442ef4
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<
%
page
args=
"section_data"
/>
<div>
%if section_data['is_small_course']:
## Show the gradebook for small courses
<h2>
${_("Student Gradebook")}
</h2>
<p>
${_("Click here to view the gradebook for enrolled students. This feature is only visible to courses with a small number of total enrolled students.")}
</p>
<br>
<p>
<a
href=
"${ section_data['spoc_gradebook_url'] }"
class=
"progress-link"
>
${_("View Gradebook")}
</a>
</p>
<hr>
%endif
</div>
<div
class=
"student-specific-container action-type-container"
>
<h2>
${_("Student-specific grade inspection")}
</h2>
<div
class=
"request-response-error"
></div>
...
...
lms/urls.py
View file @
09442ef4
...
...
@@ -273,6 +273,8 @@ if settings.COURSEWARE_ENABLED:
'instructor.views.instructor_dashboard.instructor_dashboard_2'
,
name
=
"instructor_dashboard"
),
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/instructor_dashboard/api/'
,
include
(
'instructor.views.api_urls'
)),
url
(
r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/gradebook$'
,
'instructor.views.instructor_dashboard.spoc_gradebook'
,
name
=
'spoc_gradebook'
),
# see ENABLE_INSTRUCTOR_LEGACY_DASHBOARD section for legacy dash urls
...
...
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