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
0622dc99
Commit
0622dc99
authored
Jan 29, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Javascript to handle file uploads
parent
fbdc190a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
5 deletions
+9
-5
common/lib/xmodule/xmodule/combined_open_ended_module.py
+3
-3
common/lib/xmodule/xmodule/js/src/capa/display.coffee
+0
-0
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
+5
-2
common/lib/xmodule/xmodule/self_assessment_module.py
+1
-0
No files found.
common/lib/xmodule/xmodule/combined_open_ended_module.py
View file @
0622dc99
...
...
@@ -39,7 +39,7 @@ MAX_SCORE = 1
MAX_SCORE_ALLOWED
=
3
IS_SCORED
=
False
ACCEPT_FILE_UPLOAD
=
Fals
e
ACCEPT_FILE_UPLOAD
=
Tru
e
class
CombinedOpenEndedModule
(
XModule
):
"""
...
...
@@ -141,8 +141,8 @@ class CombinedOpenEndedModule(XModule):
#Allow reset is true if student has failed the criteria to move to the next child task
self
.
allow_reset
=
instance_state
.
get
(
'ready_to_reset'
,
False
)
self
.
max_attempts
=
int
(
self
.
metadata
.
get
(
'attempts'
,
MAX_ATTEMPTS
))
self
.
is_scored
=
(
self
.
metadata
.
get
(
'is_graded'
,
IS_SCORED
)
==
"True"
)
self
.
accept_file_upload
=
(
self
.
metadata
.
get
(
'accept_file_upload'
,
ACCEPT_FILE_UPLOAD
)
==
"True"
)
self
.
is_scored
=
(
self
.
metadata
.
get
(
'is_graded'
,
IS_SCORED
)
in
[
True
,
"True"
]
)
self
.
accept_file_upload
=
(
self
.
metadata
.
get
(
'accept_file_upload'
,
ACCEPT_FILE_UPLOAD
)
in
[
True
,
"True"
]
)
log
.
debug
(
self
.
metadata
.
get
(
'is_graded'
,
IS_SCORED
))
...
...
common/lib/xmodule/xmodule/js/src/capa/display.coffee
View file @
0622dc99
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
View file @
0622dc99
...
...
@@ -179,7 +179,11 @@ class @CombinedOpenEnded
save_answer
:
(
event
)
=>
event
.
preventDefault
()
if
@
child_state
==
'initial'
data
=
{
'student_answer'
:
@
answer_area
.
val
()}
file_data
=
""
if
@
can_upload_files
==
true
files
=
$
(
'.file-upload-box'
)[
0
].
files
[
0
]
file_data
=
files
data
=
{
'student_answer'
:
@
answer_area
.
val
(),
'file_data'
:
file_data
}
$
.
postWithPrefix
"
#{
@
ajax_url
}
/save_answer"
,
data
,
(
response
)
=>
if
response
.
success
@
rubric_wrapper
.
html
(
response
.
rubric_html
)
...
...
@@ -307,7 +311,6 @@ class @CombinedOpenEnded
setup_file_upload
:
=>
if
window
.
File
and
window
.
FileReader
and
window
.
FileList
and
window
.
Blob
alert
(
'File API supported.'
)
if
@
accept_file_upload
==
"True"
@
can_upload_files
=
true
@
file_upload_area
.
html
(
'<input type="file" class="file-upload-box">'
)
...
...
common/lib/xmodule/xmodule/self_assessment_module.py
View file @
0622dc99
...
...
@@ -107,6 +107,7 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
if
dispatch
not
in
handlers
:
return
'Error'
log
.
debug
(
get
)
before
=
self
.
get_progress
()
d
=
handlers
[
dispatch
](
get
,
system
)
after
=
self
.
get_progress
()
...
...
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