Merge pull request #1740 from MITx/fix/vik/peer-image-grading
Fix/vik/peer image grading
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -36,7 +36,7 @@ ALLOWABLE_IMAGE_SUFFIXES = [
|
||||
]
|
||||
|
||||
#Maximum allowed dimensions (x and y) for an uploaded image
|
||||
MAX_ALLOWED_IMAGE_DIM = 1500
|
||||
MAX_ALLOWED_IMAGE_DIM = 2000
|
||||
|
||||
#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):
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user