Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
a4e283e9
Commit
a4e283e9
authored
12 years ago
by
kimth
Browse files
Options
Downloads
Patches
Plain Diff
File submission frontend checks for filesize
parent
3db07bca
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/lib/xmodule/xmodule/js/src/capa/display.coffee
+9
-1
9 additions, 1 deletion
common/lib/xmodule/xmodule/js/src/capa/display.coffee
with
9 additions
and
1 deletion
common/lib/xmodule/xmodule/js/src/capa/display.coffee
+
9
−
1
View file @
a4e283e9
...
...
@@ -151,9 +151,16 @@ class @Problem
fd
=
new
FormData
()
# Sanity check of file size
file_too_large
=
false
max_filesize
=
10
*
1000
*
1000
# 10 MB
@
inputs
.
each
(
index
,
element
)
->
if
element
.
type
is
'file'
if
element
.
files
[
0
]
instanceof
File
if
element
.
files
[
0
].
size
>
max_filesize
file_too_large
=
true
alert
'Submission aborted! Your file "'
+
element
.
files
[
0
].
name
+
'" is too large (max size: '
+
max_filesize
/
(
1000
*
1000
)
+
' MB)'
fd
.
append
(
element
.
id
,
element
.
files
[
0
])
else
fd
.
append
(
element
.
id
,
''
)
...
...
@@ -173,7 +180,8 @@ class @Problem
else
alert
(
response
.
success
)
$
.
ajaxWithPrefix
(
"
#{
@
url
}
/problem_check"
,
settings
)
if
not
file_too_large
$
.
ajaxWithPrefix
(
"
#{
@
url
}
/problem_check"
,
settings
)
check
:
=>
Logger
.
log
'problem_check'
,
@
answers
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment