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
21e13e44
Commit
21e13e44
authored
Aug 22, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pep8 and pylint fixes
parent
a0680143
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
17 deletions
+30
-17
common/lib/xmodule/xmodule/combined_open_ended_module.py
+6
-6
common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py
+16
-6
common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py
+3
-3
common/lib/xmodule/xmodule/open_ended_grading_classes/grading_service_module.py
+3
-0
common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py
+2
-2
No files found.
common/lib/xmodule/xmodule/combined_open_ended_module.py
View file @
21e13e44
...
...
@@ -213,7 +213,7 @@ class CombinedOpenEndedFields(object):
help
=
"The number of times the student can try to answer this problem."
,
default
=
1
,
scope
=
Scope
.
settings
,
values
=
{
"min"
:
1
}
values
=
{
"min"
:
1
}
)
accept_file_upload
=
Boolean
(
display_name
=
"Allow File Uploads"
,
...
...
@@ -242,7 +242,7 @@ class CombinedOpenEndedFields(object):
display_name
=
"Problem Weight"
,
help
=
"Defines the number of points each problem is worth. If the value is not set, each problem is worth one point."
,
scope
=
Scope
.
settings
,
values
=
{
"min"
:
0
,
"step"
:
".1"
},
values
=
{
"min"
:
0
,
"step"
:
".1"
},
default
=
1
)
min_to_calibrate
=
Integer
(
...
...
@@ -250,28 +250,28 @@ class CombinedOpenEndedFields(object):
help
=
"The minimum number of calibration essays each student will need to complete for peer grading."
,
default
=
3
,
scope
=
Scope
.
settings
,
values
=
{
"min"
:
1
,
"max"
:
20
,
"step"
:
"1"
}
values
=
{
"min"
:
1
,
"max"
:
20
,
"step"
:
"1"
}
)
max_to_calibrate
=
Integer
(
display_name
=
"Maximum Peer Grading Calibrations"
,
help
=
"The maximum number of calibration essays each student will need to complete for peer grading."
,
default
=
6
,
scope
=
Scope
.
settings
,
values
=
{
"min"
:
1
,
"max"
:
20
,
"step"
:
"1"
}
values
=
{
"min"
:
1
,
"max"
:
20
,
"step"
:
"1"
}
)
peer_grader_count
=
Integer
(
display_name
=
"Peer Graders per Response"
,
help
=
"The number of peers who will grade each submission."
,
default
=
3
,
scope
=
Scope
.
settings
,
values
=
{
"min"
:
1
,
"step"
:
"1"
,
"max"
:
5
}
values
=
{
"min"
:
1
,
"step"
:
"1"
,
"max"
:
5
}
)
required_peer_grading
=
Integer
(
display_name
=
"Required Peer Grading"
,
help
=
"The number of other students each student making a submission will have to grade."
,
default
=
3
,
scope
=
Scope
.
settings
,
values
=
{
"min"
:
1
,
"step"
:
"1"
,
"max"
:
5
}
values
=
{
"min"
:
1
,
"step"
:
"1"
,
"max"
:
5
}
)
markdown
=
String
(
help
=
"Markdown source of this module"
,
...
...
common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py
View file @
21e13e44
...
...
@@ -351,7 +351,12 @@ class CombinedOpenEndedV1Module():
return
self
.
current_task
.
get_html
(
self
.
system
)
def
get_html_ajax
(
self
,
data
):
return
{
'html'
:
self
.
get_html
()}
"""
Get HTML in AJAX callback
data - Needed to preserve AJAX structure
Output: Dictionary with html attribute
"""
return
{
'html'
:
self
.
get_html
()}
def
get_current_attributes
(
self
,
task_number
):
"""
...
...
@@ -643,7 +648,12 @@ class CombinedOpenEndedV1Module():
def
get_current_state
(
self
,
data
):
return
self
.
get_context
()
def
get_last_response_ajax
(
self
,
data
):
def
get_last_response_ajax
(
self
,
data
):
"""
Get the last response via ajax callback
data - Needed to preserve ajax callback structure
Output: Last response dictionary
"""
return
self
.
get_last_response
(
self
.
current_task_number
)
def
next_problem
(
self
,
_data
):
...
...
@@ -666,10 +676,10 @@ class CombinedOpenEndedV1Module():
return
self
.
out_of_sync_error
(
data
)
success
,
can_reset
,
error
=
self
.
check_if_student_has_done_needed_grading
()
if
not
can_reset
:
return
{
'error'
:
error
,
'success'
:
False
}
if
self
.
student_attempts
>=
self
.
max_attempts
-
1
:
if
self
.
student_attempts
==
self
.
max_attempts
-
1
:
self
.
student_attempts
+=
1
return
{
'error'
:
error
,
'success'
:
False
}
if
self
.
student_attempts
>=
self
.
max_attempts
-
1
:
if
self
.
student_attempts
==
self
.
max_attempts
-
1
:
self
.
student_attempts
+=
1
return
{
'success'
:
False
,
# This is a student_facing_error
...
...
common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_rubric.py
View file @
21e13e44
...
...
@@ -214,7 +214,7 @@ class CombinedOpenEndedRubric(object):
#Get the highest possible score across all categories
max_score
=
max
(
max_scores
)
#Loop through each category
for
i
,
category
in
enumerate
(
rubric_categories
):
for
i
,
category
in
enumerate
(
rubric_categories
):
#Loop through each option in the category
for
j
in
xrange
(
len
(
category
[
'options'
])):
#Intialize empty grader types list
...
...
@@ -234,10 +234,10 @@ class CombinedOpenEndedRubric(object):
#If a list in the list of lists for this position exists, append to it
actual_scores
[
i
]
+=
[
j
]
actual_scores
=
[
sum
(
i
)
/
len
(
i
)
for
i
in
actual_scores
]
actual_scores
=
[
sum
(
i
)
/
len
(
i
)
for
i
in
actual_scores
]
correct
=
[]
#Define if the student is "correct" (1) "incorrect" (0) or "partially correct" (.5)
for
(
i
,
a
)
in
enumerate
(
actual_scores
):
for
(
i
,
a
)
in
enumerate
(
actual_scores
):
if
int
(
a
)
==
max_scores
[
i
]:
correct
.
append
(
1
)
elif
int
(
a
)
==
0
:
...
...
common/lib/xmodule/xmodule/open_ended_grading_classes/grading_service_module.py
View file @
21e13e44
...
...
@@ -11,6 +11,9 @@ log = logging.getLogger(__name__)
class
GradingServiceError
(
Exception
):
"""
Exception for grading service. Shown when Open Response Assessment servers cannot be reached.
"""
pass
...
...
common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py
View file @
21e13e44
...
...
@@ -333,7 +333,7 @@ class OpenEndedChild(object):
try
:
image_data
.
seek
(
0
)
image_ok
=
open_ended_image_submission
.
run_image_tests
(
image_data
)
except
:
except
Exception
:
log
.
exception
(
"Could not create image and check it."
)
if
image_ok
:
...
...
@@ -346,7 +346,7 @@ class OpenEndedChild(object):
success
,
s3_public_url
=
open_ended_image_submission
.
upload_to_s3
(
image_data
,
image_key
,
self
.
s3_interface
)
except
:
except
Exception
:
log
.
exception
(
"Could not upload image to S3."
)
return
success
,
image_ok
,
s3_public_url
...
...
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