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
ddc8bf2b
Commit
ddc8bf2b
authored
Feb 04, 2013
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add instructor dashboard feature to download profile & problem state
parent
01fab2ec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
+55
-0
lms/djangoapps/instructor/views.py
+40
-0
lms/templates/courseware/instructor_dashboard.html
+15
-0
No files found.
lms/djangoapps/instructor/views.py
View file @
ddc8bf2b
...
...
@@ -384,6 +384,46 @@ def instructor_dashboard(request, course_id):
track
.
views
.
server_track
(
request
,
'remove-instructor {0}'
.
format
(
user
),
{},
page
=
'idashboard'
)
#----------------------------------------
# DataDump
elif
'Download CSV of all student profile data'
in
action
:
enrolled_students
=
User
.
objects
.
filter
(
courseenrollment__course_id
=
course_id
)
.
order_by
(
'username'
)
profkeys
=
[
'name'
,
'language'
,
'location'
,
'year_of_birth'
,
'gender'
,
'level_of_education'
,
'mailing_address'
,
'goals'
]
datatable
=
{
'header'
:
[
'username'
,
'email'
]
+
profkeys
}
def
getdat
(
u
):
p
=
u
.
profile
return
[
u
.
username
,
u
.
email
]
+
[
getattr
(
p
,
x
,
''
)
for
x
in
profkeys
]
datatable
[
'data'
]
=
[
getdat
(
u
)
for
u
in
enrolled_students
]
datatable
[
'title'
]
=
'Student profile data for course
%
s'
%
course_id
return
return_csv
(
'profiledata_
%
s.csv'
%
course_id
,
datatable
)
elif
'Download CSV of all responses to problem'
in
action
:
problem_to_dump
=
request
.
POST
.
get
(
'problem_to_dump'
,
''
)
if
problem_to_dump
[
-
4
:]
==
".xml"
:
problem_to_dump
=
problem_to_dump
[:
-
4
]
try
:
(
org
,
course_name
,
run
)
=
course_id
.
split
(
"/"
)
module_state_key
=
"i4x://"
+
org
+
"/"
+
course_name
+
"/problem/"
+
problem_to_dump
smdat
=
StudentModule
.
objects
.
filter
(
course_id
=
course_id
,
module_state_key
=
module_state_key
)
smdat
=
smdat
.
order_by
(
'student'
)
msg
+=
"Found module to reset. "
except
Exception
as
err
:
msg
+=
"<font color='red'>Couldn't find module with that urlname. </font>"
msg
+=
"<pre>
%
s</pre>"
%
escape
(
err
)
smdat
=
[]
if
smdat
:
datatable
=
{
'header'
:
[
'username'
,
'state'
]}
datatable
[
'data'
]
=
[
[
x
.
student
.
username
,
x
.
state
]
for
x
in
smdat
]
datatable
[
'title'
]
=
'Student state for problem
%
s'
%
problem_to_dump
return
return_csv
(
'student_state_from_
%
s.csv'
%
problem_to_dump
,
datatable
)
#----------------------------------------
# Group management
elif
'List beta testers'
in
action
:
...
...
lms/templates/courseware/instructor_dashboard.html
View file @
ddc8bf2b
...
...
@@ -64,6 +64,7 @@ function goto( mode)
<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('Data');"
class=
"${modeflag.get('Data')}"
>
DataDump
</a>
|
<a
href=
"#"
onclick=
"goto('Manage Groups');"
class=
"${modeflag.get('Manage Groups')}"
>
Manage Groups
</a>
]
</h2>
...
...
@@ -269,6 +270,20 @@ function goto( mode)
##-----------------------------------------------------------------------------
%if modeflag.get('Data'):
<hr
width=
"40%"
style=
"align:left"
>
<p>
<input
type=
"submit"
name=
"action"
value=
"Download CSV of all student profile data"
>
</p>
<p>
Problem urlname:
<input
type=
"text"
name=
"problem_to_dump"
size=
"40"
>
<input
type=
"submit"
name=
"action"
value=
"Download CSV of all responses to problem"
>
</p>
<hr
width=
"40%"
style=
"align:left"
>
%endif
##-----------------------------------------------------------------------------
%if modeflag.get('Manage Groups'):
%if instructor_access:
<hr
width=
"40%"
style=
"align:left"
>
...
...
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