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
d06f5f77
Commit
d06f5f77
authored
Jan 30, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix file upload stuff, debug some image check routines
parent
0622dc99
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
7 deletions
+26
-7
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
+21
-4
common/lib/xmodule/xmodule/open_ended_image_submission.py
+1
-1
common/lib/xmodule/xmodule/openendedchild.py
+4
-2
No files found.
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
View file @
d06f5f77
...
@@ -178,13 +178,27 @@ class @CombinedOpenEnded
...
@@ -178,13 +178,27 @@ class @CombinedOpenEnded
save_answer
:
(
event
)
=>
save_answer
:
(
event
)
=>
event
.
preventDefault
()
event
.
preventDefault
()
max_filesize
=
2
*
1000
*
1000
#2MB
if
@
child_state
==
'initial'
if
@
child_state
==
'initial'
file
_data
=
""
file
s
=
""
if
@
can_upload_files
==
true
if
@
can_upload_files
==
true
files
=
$
(
'.file-upload-box'
)[
0
].
files
[
0
]
files
=
$
(
'.file-upload-box'
)[
0
].
files
[
0
]
file_data
=
files
if
files
.
size
>
max_filesize
data
=
{
'student_answer'
:
@
answer_area
.
val
(),
'file_data'
:
file_data
}
@
can_upload_files
=
false
$
.
postWithPrefix
"
#{
@
ajax_url
}
/save_answer"
,
data
,
(
response
)
=>
files
=
""
fd
=
new
FormData
()
fd
.
append
(
'student_answer'
,
@
answer_area
.
val
())
fd
.
append
(
'student_file'
,
files
)
fd
.
append
(
'can_upload_files'
,
files
)
#data = {'student_answer' : @answer_area.val(), 'file_value' : file_value, 'file_id' : file_id}
settings
=
type
:
"POST"
data
:
fd
processData
:
false
contentType
:
false
success
:
(
response
)
=>
if
response
.
success
if
response
.
success
@
rubric_wrapper
.
html
(
response
.
rubric_html
)
@
rubric_wrapper
.
html
(
response
.
rubric_html
)
@
rubric_wrapper
.
show
()
@
rubric_wrapper
.
show
()
...
@@ -193,6 +207,9 @@ class @CombinedOpenEnded
...
@@ -193,6 +207,9 @@ class @CombinedOpenEnded
@
rebind
()
@
rebind
()
else
else
@
errors_area
.
html
(
response
.
error
)
@
errors_area
.
html
(
response
.
error
)
$
.
ajaxWithPrefix
(
"
#{
@
ajax_url
}
/save_answer"
,
settings
)
else
else
@
errors_area
.
html
(
'Problem state got out of sync. Try reloading the page.'
)
@
errors_area
.
html
(
'Problem state got out of sync. Try reloading the page.'
)
...
...
common/lib/xmodule/xmodule/open_ended_image_submission.py
View file @
d06f5f77
...
@@ -70,7 +70,7 @@ class URLProperties(object):
...
@@ -70,7 +70,7 @@ class URLProperties(object):
def
check_suffix
(
self
):
def
check_suffix
(
self
):
good_suffix
=
False
good_suffix
=
False
for
suffix
in
ALLOWABLE_IMAGE_SUFFIXES
:
for
suffix
in
ALLOWABLE_IMAGE_SUFFIXES
:
if
self
.
url_string
.
endswith
(
suffix
)
if
self
.
url_string
.
endswith
(
suffix
)
:
good_suffix
=
True
good_suffix
=
True
break
break
return
good_suffix
return
good_suffix
...
...
common/lib/xmodule/xmodule/openendedchild.py
View file @
d06f5f77
...
@@ -23,6 +23,7 @@ from .stringify import stringify_children
...
@@ -23,6 +23,7 @@ from .stringify import stringify_children
from
.xml_module
import
XmlDescriptor
from
.xml_module
import
XmlDescriptor
from
xmodule.modulestore
import
Location
from
xmodule.modulestore
import
Location
from
capa.util
import
*
from
capa.util
import
*
import
open_ended_image_submission
from
datetime
import
datetime
from
datetime
import
datetime
...
@@ -274,12 +275,13 @@ class OpenEndedChild(object):
...
@@ -274,12 +275,13 @@ class OpenEndedChild(object):
correctness
=
'correct'
if
self
.
is_submission_correct
(
score
)
else
'incorrect'
correctness
=
'correct'
if
self
.
is_submission_correct
(
score
)
else
'incorrect'
return
correctness
return
correctness
def
should_request_image
(
self
):
def
upload_image_to_s3
(
self
,
image_data
):
"""
"""
@return:
@return:
"""
"""
pass
success
=
False
image_ok
=
run_image_checks
(
image
)
...
...
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