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
a04881ce
Commit
a04881ce
authored
Mar 27, 2013
by
brianhw
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1740 from MITx/fix/vik/peer-image-grading
Fix/vik/peer image grading
parents
8905343f
7101c760
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
17 deletions
+17
-17
common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py
+11
-3
common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_image_submission.py
+2
-2
common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py
+0
-4
lms/djangoapps/courseware/module_render.py
+3
-7
lms/djangoapps/open_ended_grading/views.py
+1
-1
No files found.
common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py
View file @
a04881ce
...
...
@@ -24,7 +24,7 @@ MAX_ATTEMPTS = 1
MAX_SCORE
=
1
#The highest score allowed for the overall xmodule and for each rubric point
MAX_SCORE_ALLOWED
=
3
MAX_SCORE_ALLOWED
=
50
#If true, default behavior is to score module as a practice problem. Otherwise, no grade at all is shown in progress
#Metadata overrides this.
...
...
@@ -363,7 +363,15 @@ class CombinedOpenEndedV1Module():
"""
self
.
update_task_states
()
html
=
self
.
current_task
.
get_html
(
self
.
system
)
return_html
=
rewrite_links
(
html
,
self
.
rewrite_content_links
)
return_html
=
html
try
:
#Without try except block, get this error:
# File "/home/vik/mitx_all/mitx/common/lib/xmodule/xmodule/x_module.py", line 263, in rewrite_content_links
# if link.startswith(XASSET_SRCREF_PREFIX):
# Placing try except so that if the error is fixed, this code will start working again.
return_html
=
rewrite_links
(
html
,
self
.
rewrite_content_links
)
except
:
pass
return
return_html
def
get_current_attributes
(
self
,
task_number
):
...
...
@@ -782,7 +790,7 @@ class CombinedOpenEndedV1Descriptor():
template_dir_name
=
"combinedopenended"
def
__init__
(
self
,
system
):
self
.
system
=
system
self
.
system
=
system
@classmethod
def
definition_from_xml
(
cls
,
xml_object
,
system
):
...
...
common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_image_submission.py
View file @
a04881ce
...
...
@@ -36,7 +36,7 @@ ALLOWABLE_IMAGE_SUFFIXES = [
]
#Maximum allowed dimensions (x and y) for an uploaded image
MAX_ALLOWED_IMAGE_DIM
=
15
00
MAX_ALLOWED_IMAGE_DIM
=
20
00
#Dimensions to which image is resized before it is evaluated for color count, etc
MAX_IMAGE_DIM
=
150
...
...
@@ -178,7 +178,7 @@ class URLProperties(object):
Runs all available url tests
@return: True if URL passes tests, false if not.
"""
url_is_okay
=
self
.
check_suffix
()
and
self
.
check_if_parses
()
and
self
.
check_domain
()
url_is_okay
=
self
.
check_suffix
()
and
self
.
check_if_parses
()
return
url_is_okay
def
check_domain
(
self
):
...
...
common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py
View file @
a04881ce
...
...
@@ -357,10 +357,6 @@ class OpenEndedChild(object):
if
get_data
[
'can_upload_files'
]
in
[
'true'
,
'1'
]:
has_file_to_upload
=
True
file
=
get_data
[
'student_file'
][
0
]
if
self
.
system
.
track_fuction
:
self
.
system
.
track_function
(
'open_ended_image_upload'
,
{
'filename'
:
file
.
name
})
else
:
log
.
info
(
"No tracking function found when uploading image."
)
uploaded_to_s3
,
image_ok
,
s3_public_url
=
self
.
upload_image_to_s3
(
file
)
if
uploaded_to_s3
:
image_tag
=
self
.
generate_image_tag_from_url
(
s3_public_url
,
file
.
name
)
...
...
lms/djangoapps/courseware/module_render.py
View file @
a04881ce
...
...
@@ -209,9 +209,6 @@ def get_module_for_descriptor(user, request, descriptor, model_data_cache, cours
'waittime'
:
settings
.
XQUEUE_WAITTIME_BETWEEN_REQUESTS
}
def
get_or_default
(
key
,
default
):
getattr
(
settings
,
key
,
default
)
#This is a hacky way to pass settings to the combined open ended xmodule
#It needs an S3 interface to upload images to S3
#It needs the open ended grading interface in order to get peer grading to be done
...
...
@@ -227,12 +224,11 @@ def get_module_for_descriptor(user, request, descriptor, model_data_cache, cours
open_ended_grading_interface
[
'mock_staff_grading'
]
=
settings
.
MOCK_STAFF_GRADING
if
is_descriptor_combined_open_ended
:
s3_interface
=
{
'access_key'
:
get
_or_default
(
'AWS_ACCESS_KEY_ID'
,
''
),
'secret_access_key'
:
get
_or_default
(
'AWS_SECRET_ACCESS_KEY'
,
''
),
'storage_bucket_name'
:
get
_or_default
(
'AWS_STORAGE_BUCKET_NAME'
,
'
'
)
'access_key'
:
get
attr
(
settings
,
'AWS_ACCESS_KEY_ID'
,
''
),
'secret_access_key'
:
get
attr
(
settings
,
'AWS_SECRET_ACCESS_KEY'
,
''
),
'storage_bucket_name'
:
get
attr
(
settings
,
'AWS_STORAGE_BUCKET_NAME'
,
'openended
'
)
}
def
inner_get_module
(
descriptor
):
"""
Delegate to get_module. It does an access check, so may return None
...
...
lms/djangoapps/open_ended_grading/views.py
View file @
a04881ce
...
...
@@ -111,7 +111,7 @@ def peer_grading(request, course_id):
#Get the peer grading modules currently in the course
items
=
modulestore
()
.
get_items
([
'i4x'
,
None
,
course_id_parts
[
1
],
'peergrading'
,
None
])
#See if any of the modules are centralized modules (ie display info from multiple problems)
items
=
[
i
for
i
in
items
if
i
.
metadata
.
get
(
"use_for_single_location"
,
True
)
in
false_dict
]
items
=
[
i
for
i
in
items
if
getattr
(
i
,
"use_for_single_location"
,
True
)
in
false_dict
]
#Get the first one
item_location
=
items
[
0
]
.
location
#Generate a url for the first module and redirect the user to it
...
...
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