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
78696c62
Commit
78696c62
authored
Jan 30, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work on open ended flagged problems
parent
5f538f07
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
127 additions
and
0 deletions
+127
-0
lms/djangoapps/open_ended_grading/controller_query_service.py
+20
-0
lms/djangoapps/open_ended_grading/views.py
+55
-0
lms/templates/open_ended_problems/open_ended_flagged_problems.html
+52
-0
No files found.
lms/djangoapps/open_ended_grading/controller_query_service.py
View file @
78696c62
...
...
@@ -21,6 +21,8 @@ class ControllerQueryService(GradingService):
self
.
is_unique_url
=
self
.
url
+
'/is_name_unique/'
self
.
combined_notifications_url
=
self
.
url
+
'/combined_notifications/'
self
.
grading_status_list_url
=
self
.
url
+
'/get_grading_status_list/'
self
.
flagged_problem_list_url
=
self
.
url
+
'/get_flagged_problem_list/'
self
.
take_action_on_flags_url
=
self
.
url
+
'/take_action_on_flags/'
def
check_if_name_is_unique
(
self
,
location
,
problem_id
,
course_id
):
params
=
{
...
...
@@ -57,3 +59,21 @@ class ControllerQueryService(GradingService):
response
=
self
.
get
(
self
.
grading_status_list_url
,
params
)
return
response
def
get_flagged_problem_list
(
self
,
course_id
):
params
=
{
'course_id'
:
course_id
,
}
response
=
self
.
get
(
self
.
flagged_problem_list_url
,
params
)
return
response
def
take_action_on_flags
(
self
,
course_id
,
student_id
,
submission_id
):
params
=
{
'course_id'
:
course_id
,
'student_id'
:
student_id
,
'submission_id'
:
submission_id
,
}
response
=
self
.
post
(
self
.
take_action_on_flags_url
,
params
)
return
response
lms/djangoapps/open_ended_grading/views.py
View file @
78696c62
...
...
@@ -194,6 +194,61 @@ def student_problem_list(request, course_id):
'staff_access'
:
False
,
})
@cache_control
(
no_cache
=
True
,
no_store
=
True
,
must_revalidate
=
True
)
def
flagged_problem_list
(
request
,
course_id
):
'''
Show a student problem list
'''
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'staff'
)
student_id
=
unique_id_for_user
(
request
.
user
)
# call problem list service
success
=
False
error_text
=
""
problem_list
=
[]
base_course_url
=
reverse
(
'courses'
)
try
:
problem_list_json
=
controller_qs
.
get_grading_status_list
(
course_id
,
unique_id_for_user
(
request
.
user
))
problem_list_dict
=
json
.
loads
(
problem_list_json
)
success
=
problem_list_dict
[
'success'
]
if
'error'
in
problem_list_dict
:
error_text
=
problem_list_dict
[
'error'
]
problem_list
=
problem_list_dict
[
'problem_list'
]
for
i
in
xrange
(
0
,
len
(
problem_list
)):
problem_url_parts
=
search
.
path_to_location
(
modulestore
(),
course
.
id
,
problem_list
[
i
][
'location'
])
problem_url
=
base_course_url
+
"/"
for
z
in
xrange
(
0
,
len
(
problem_url_parts
)):
part
=
problem_url_parts
[
z
]
if
part
is
not
None
:
if
z
==
1
:
problem_url
+=
"courseware/"
problem_url
+=
part
+
"/"
problem_list
[
i
]
.
update
({
'actual_url'
:
problem_url
})
except
GradingServiceError
:
error_text
=
"Error occured while contacting the grading service"
success
=
False
# catch error if if the json loads fails
except
ValueError
:
error_text
=
"Could not get problem list"
success
=
False
ajax_url
=
_reverse_with_slash
(
'open_ended_problems'
,
course_id
)
return
render_to_response
(
'open_ended_problems/open_ended_problems.html'
,
{
'course'
:
course
,
'course_id'
:
course_id
,
'ajax_url'
:
ajax_url
,
'success'
:
success
,
'problem_list'
:
problem_list
,
'error_text'
:
error_text
,
# Checked above
'staff_access'
:
False
,
})
@cache_control
(
no_cache
=
True
,
no_store
=
True
,
must_revalidate
=
True
)
def
combined_notifications
(
request
,
course_id
):
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'load'
)
user
=
request
.
user
...
...
lms/templates/open_ended_problems/open_ended_flagged_problems.html
0 → 100644
View file @
78696c62
<
%
inherit
file=
"/main.html"
/>
<
%
block
name=
"bodyclass"
>
${course.css_class}
</
%
block>
<
%
namespace
name=
'static'
file=
'/static_content.html'
/>
<
%
block
name=
"headextra"
>
<
%
static:css
group=
'course'
/>
</
%
block>
<
%
block
name=
"title"
><title>
${course.number} Flagged Open Ended Problems
</title></
%
block>
<
%
include
file=
"/courseware/course_navigation.html"
args=
"active_page='flagged_open_ended_problems'"
/>
<section
class=
"container"
>
<div
class=
"open-ended-problems"
data-ajax_url=
"${ajax_url}"
>
<div
class=
"error-container"
>
${error_text}
</div>
<h1>
Flagged Open Ended Problems
</h1>
<h2>
Instructions
</h2>
<p>
Here are a list of open ended problems for this course that have been flagged by students as potentially inappropriate.
</p>
% if success:
% if len(flagged_list) == 0:
<div
class=
"message-container"
>
No flagged problems exist.
</div>
%else:
<table
class=
"problem-list"
>
<tr>
<th>
Problem Name
</th>
<th>
Student ID
</th>
<th>
Student Response
</th>
<th>
Submission ID
</th>
</tr>
%for problem in problem_list:
<tr>
<td>
${problem['problem_name']}
</td>
<td>
${problem['student_id']}
</td>
<td>
${problem['student_response']}
</td>
<td>
${problem['submission_id']}
</td>
</tr>
%endfor
</table>
%endif
%endif
</div>
</section>
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