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
134f2f7a
Commit
134f2f7a
authored
Feb 05, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests, bugfix for problem url error
parent
e13de754
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
lms/djangoapps/open_ended_grading/tests.py
+10
-10
lms/djangoapps/open_ended_grading/views.py
+2
-1
No files found.
lms/djangoapps/open_ended_grading/tests.py
View file @
134f2f7a
...
...
@@ -156,7 +156,7 @@ class TestPeerGradingService(ct.PageLoader):
data
=
{
'location'
:
self
.
location
}
r
=
self
.
peer_module
.
get_next_submission
(
data
)
d
=
json
.
loads
(
r
)
d
=
r
self
.
assertTrue
(
d
[
'success'
])
self
.
assertIsNotNone
(
d
[
'submission_id'
])
self
.
assertIsNotNone
(
d
[
'prompt'
])
...
...
@@ -166,7 +166,7 @@ class TestPeerGradingService(ct.PageLoader):
def
test_get_next_submission_missing_location
(
self
):
data
=
{}
r
=
self
.
peer_module
.
get_next_submission
(
data
)
d
=
json
.
loads
(
r
)
d
=
r
self
.
assertFalse
(
d
[
'success'
])
self
.
assertEqual
(
d
[
'error'
],
"Missing required keys: location"
)
...
...
@@ -174,27 +174,27 @@ class TestPeerGradingService(ct.PageLoader):
data
=
'rubric_scores[]=1|rubric_scores[]=2|location='
+
location
+
'|submission_id=1|submission_key=fake key|score=2|feedback=feedback|submission_flagged=False'
qdict
=
QueryDict
(
data
.
replace
(
"|"
,
"&"
))
r
=
self
.
peer_module
.
save_grade
(
qdict
)
d
=
json
.
loads
(
r
.
content
)
d
=
r
self
.
assertTrue
(
d
[
'success'
])
def
test_save_grade_missing_keys
(
self
):
data
=
{}
r
=
self
.
peer_module
.
save_grade
(
data
)
d
=
json
.
loads
(
r
)
d
=
r
self
.
assertFalse
(
d
[
'success'
])
self
.
assertTrue
(
d
[
'error'
]
.
find
(
'Missing required keys:'
)
>
-
1
)
def
test_is_calibrated_success
(
self
):
data
=
{
'location'
:
self
.
location
}
r
=
self
.
peer_module
.
is_student_calibrated
(
data
)
d
=
json
.
loads
(
r
)
d
=
r
self
.
assertTrue
(
d
[
'success'
])
self
.
assertTrue
(
'calibrated'
in
d
)
def
test_is_calibrated_failure
(
self
):
data
=
{}
r
=
self
.
peer_module
.
is_student_calibrated
(
data
)
d
=
json
.
loads
(
r
)
d
=
r
self
.
assertFalse
(
d
[
'success'
])
self
.
assertFalse
(
'calibrated'
in
d
)
...
...
@@ -202,7 +202,7 @@ class TestPeerGradingService(ct.PageLoader):
data
=
{
'location'
:
self
.
location
}
r
=
self
.
peer_module
.
show_calibration_essay
(
data
)
d
=
json
.
loads
(
r
)
d
=
r
self
.
assertTrue
(
d
[
'success'
])
self
.
assertIsNotNone
(
d
[
'submission_id'
])
self
.
assertIsNotNone
(
d
[
'prompt'
])
...
...
@@ -213,7 +213,7 @@ class TestPeerGradingService(ct.PageLoader):
data
=
{}
r
=
self
.
peer_module
.
show_calibration_essay
(
data
)
d
=
json
.
loads
(
r
)
d
=
r
self
.
assertFalse
(
d
[
'success'
])
self
.
assertEqual
(
d
[
'error'
],
"Missing required keys: location"
)
...
...
@@ -226,14 +226,14 @@ class TestPeerGradingService(ct.PageLoader):
'feedback'
:
'This is feedback'
,
'rubric_scores[]'
:
[
1
,
2
]}
r
=
self
.
peer_module
.
save_calibration_essay
(
data
)
d
=
json
.
loads
(
r
)
d
=
r
self
.
assertTrue
(
d
[
'success'
])
self
.
assertTrue
(
'actual_score'
in
d
)
def
test_save_calibration_essay_missing_keys
(
self
):
data
=
{}
r
=
self
.
peer_module
.
save_calibration_essay
(
data
)
d
=
json
.
loads
(
r
)
d
=
r
self
.
assertFalse
(
d
[
'success'
])
self
.
assertTrue
(
d
[
'error'
]
.
find
(
'Missing required keys:'
)
>
-
1
)
self
.
assertFalse
(
'actual_score'
in
d
)
...
...
lms/djangoapps/open_ended_grading/views.py
View file @
134f2f7a
...
...
@@ -95,7 +95,7 @@ def peer_grading(request, course_id):
return
HttpResponseRedirect
(
problem_url
)
except
:
error_message
=
"Error with initializing peer grading. Centralized module does not exist. Please contact course staff."
log
.
e
rror
(
error_message
+
"Current course is: {0}"
.
format
(
course_id
))
log
.
e
xception
(
error_message
+
"Current course is: {0}"
.
format
(
course_id
))
return
HttpResponse
(
error_message
)
def
generate_problem_url
(
problem_url_parts
,
base_course_url
):
...
...
@@ -112,6 +112,7 @@ def generate_problem_url(problem_url_parts, base_course_url):
if
z
==
1
:
problem_url
+=
"courseware/"
problem_url
+=
part
+
"/"
return
problem_url
@cache_control
(
no_cache
=
True
,
no_store
=
True
,
must_revalidate
=
True
)
...
...
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