From 8aef6a0e754cbf49079c35764d4ffc61a3583152 Mon Sep 17 00:00:00 2001 From: kimth Date: Fri, 3 Aug 2012 17:38:34 -0400 Subject: [PATCH] Ajax doesn't complain about FormData if there's no file to be uploaded --- common/lib/xmodule/xmodule/js/src/capa/display.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/js/src/capa/display.coffee b/common/lib/xmodule/xmodule/js/src/capa/display.coffee index a06f512a6d..12017105a1 100644 --- a/common/lib/xmodule/xmodule/js/src/capa/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/capa/display.coffee @@ -56,8 +56,13 @@ class @Problem check_fd: => Logger.log 'problem_check', @answers + # If there are no file inputs in the problem, we can fall back on @check + if $('input:file').length == 0 + @check() + return + if not window.FormData - alert "Sorry, your browser does not support file uploads. If you can, please use Chrome or Safari which have been verified to support this feature." + alert "Sorry, your browser does not support file uploads. Your submit request could not be fulfilled. If you can, please use Chrome or Safari which have been verified to support file uploads." return fd = new FormData()