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
01fb81b8
Commit
01fb81b8
authored
Sep 04, 2014
by
Nimisha Asthagiri
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4975 from edx/reruns/analytics_i4x
Remove client side parsing of module_id
parents
90fbbe14
afa57f50
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
7 deletions
+23
-7
lms/djangoapps/instructor/views/api.py
+5
-1
lms/djangoapps/instructor/views/legacy.py
+4
-2
lms/djangoapps/instructor/views/tools.py
+11
-0
lms/static/coffee/src/instructor_dashboard/instructor_analytics.coffee
+2
-3
lms/templates/courseware/instructor_dashboard.html
+1
-1
No files found.
lms/djangoapps/instructor/views/api.py
View file @
01fb81b8
...
...
@@ -77,6 +77,7 @@ from .tools import (
set_due_date_extension
,
strip_if_string
,
bulk_email_is_enabled_for_course
,
add_block_ids
,
)
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
opaque_keys
import
InvalidKeyError
...
...
@@ -1545,8 +1546,11 @@ def proxy_legacy_analytics(request, course_id):
return
HttpResponse
(
"Error requesting from analytics server."
,
status
=
500
)
if
res
.
status_code
is
200
:
payload
=
json
.
loads
(
res
.
content
)
add_block_ids
(
payload
)
content
=
json
.
dumps
(
payload
)
# return the successful request content
return
HttpResponse
(
res
.
content
,
content_type
=
"application/json"
)
return
HttpResponse
(
content
,
content_type
=
"application/json"
)
elif
res
.
status_code
is
404
:
# forward the 404 and content
return
HttpResponse
(
res
.
content
,
content_type
=
"application/json"
,
status
=
404
)
...
...
lms/djangoapps/instructor/views/legacy.py
View file @
01fb81b8
...
...
@@ -51,7 +51,7 @@ from django_comment_common.models import (
)
from
django_comment_client.utils
import
has_forum_access
from
instructor.offline_gradecalc
import
student_grades
,
offline_grades_available
from
instructor.views.tools
import
strip_if_string
,
bulk_email_is_enabled_for_course
from
instructor.views.tools
import
strip_if_string
,
bulk_email_is_enabled_for_course
,
add_block_ids
from
instructor_task.api
import
(
get_running_instructor_tasks
,
get_instructor_task_history
,
...
...
@@ -921,7 +921,9 @@ def instructor_dashboard(request, course_id):
if
res
.
status_code
==
codes
.
OK
:
# WARNING: do not use req.json because the preloaded json doesn't
# preserve the order of the original record (hence OrderedDict).
return
json
.
loads
(
res
.
content
,
object_pairs_hook
=
OrderedDict
)
payload
=
json
.
loads
(
res
.
content
,
object_pairs_hook
=
OrderedDict
)
add_block_ids
(
payload
)
return
payload
else
:
log
.
error
(
"Error fetching
%
s, code:
%
s, msg:
%
s"
,
url
,
res
.
status_code
,
res
.
content
)
...
...
lms/djangoapps/instructor/views/tools.py
View file @
01fb81b8
...
...
@@ -14,6 +14,7 @@ from courseware.models import StudentModule
from
xmodule.fields
import
Date
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.django
import
modulestore
from
opaque_keys.edx.keys
import
UsageKey
from
bulk_email.models
import
CourseAuthorization
...
...
@@ -309,3 +310,13 @@ def dump_student_extensions(course, student):
"title"
:
_
(
"Due date extensions for {0} {1} ({2})"
)
.
format
(
student
.
first_name
,
student
.
last_name
,
student
.
username
),
"data"
:
data
}
def
add_block_ids
(
payload
):
"""
rather than manually parsing block_ids from module_ids on the client, pass the block_ids explicitly in the payload
"""
if
'data'
in
payload
:
for
ele
in
payload
[
'data'
]:
if
'module_id'
in
ele
:
ele
[
'block_id'
]
=
UsageKey
.
from_string
(
ele
[
'module_id'
])
.
block_id
lms/static/coffee/src/instructor_dashboard/instructor_analytics.coffee
View file @
01fb81b8
...
...
@@ -120,9 +120,8 @@ class GradeDistributionDisplay
# populate selector
@
$problem_selector
.
empty
()
for
{
module_id
,
grade_info
}
in
data
.
data
I4X_PROBLEM
=
/i4x:\/\/.*\/.*\/problem\/(.*)/
label
=
(
I4X_PROBLEM
.
exec
module_id
)
?
[
1
]
for
{
module_id
,
block_id
,
grade_info
}
in
data
.
data
label
=
block_id
label
?=
module_id
@
$problem_selector
.
append
$
'<option/>'
,
...
...
lms/templates/courseware/instructor_dashboard.html
View file @
01fb81b8
...
...
@@ -665,7 +665,7 @@ function goto( mode)
</tr>
%for row in analytics_results['ProblemGradeDistribution']['data']:
<tr>
<td>
${row['
module_id'].split('/')[-1
]}
</td>
<td>
${row['
block_id'
]}
</td>
<td>
${max(grade_record['max_grade'] for grade_record in row["grade_info"])}
%for grade_record in row["grade_info"]:
<td>
...
...
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