From e1365761a397914f24c72e919040a809bcd4d5a9 Mon Sep 17 00:00:00 2001 From: Pisces000221 <1786762946@qq.com> Date: Thu, 30 Nov 2017 22:21:22 +0800 Subject: [PATCH] Fix cannot submit file when the editor is empty --- views/problem.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/problem.ejs b/views/problem.ejs index 00770e9..a511691 100644 --- a/views/problem.ejs +++ b/views/problem.ejs @@ -360,7 +360,7 @@ div[class*=ace_br] { editor.renderer.updateFontSize(); function submit_code() { - if (!editor.getValue().trim()) return false; + if (!$('#submit_code input[name=answer]').val().trim() && !editor.getValue().trim()) return false; $('#submit_code input[name=language]').val($('#languages-menu .item.active').data('value')); lastSubmitted = editor.getValue(); $('#submit_code input[name=code]').val(editor.getValue());