diff --git a/tutor/app/assets/javascripts/solutions.js.coffee b/tutor/app/assets/javascripts/solutions.js.coffee
index 910eeb33..bd78f65d 100644
--- a/tutor/app/assets/javascripts/solutions.js.coffee
+++ b/tutor/app/assets/javascripts/solutions.js.coffee
@@ -49,6 +49,7 @@ index_number = 0
# Author: Ahmed Akram
@compile = (problem_id) ->
input = $('#solution_code').val()
+ alert(input)
if input.length is 0
alert "You didn't write any code"
return
@@ -59,6 +60,7 @@ index_number = 0
url: '/solutions/compile_solution'
data: {code : input, problem_id : problem_id}
datatype: 'json'
+
success: (unique) ->
clear_console()
stop_spin()
@@ -353,6 +355,57 @@ debug_console = ->
content = ""
content = '
'
+ @var = "xxxx"
+ content += "TestCase | Status |
"
+ for i in data
+ if i['success']
+ content += "" + "#{i['test_case']}" +
+ " | "
+ content += "" + "#{i['response']}" +
+ " |
"
+ else
+ content += "" + "#{i['test_case']}" +
+ " | "
+ content += "" + "#{i['response']}"+
+ " |
"
+ out.html(content)
+ return
+ error: (data) ->
+ clear_console()
+ stop_spin()
+ toggle_code_area()
+ return
+ return
+
+
+@validate_contest_code = (problem_id) ->
+ code = $('#solution_code').val()
+ mins = parseInt($('#mins').text())
+ secs = parseInt($('#secs').text())
+ time = (mins * 60) + secs
+ if code.length is 0
+ alert 'Blank submissions are not allowed'
+ return
+ toggle_code_area()
+ start_spin()
+ $.ajax
+ type: "POST"
+ url: '/cproblem/' + problem_id
+ data: {problem_id: problem_id, code: code, time: time}
+ datatype: 'json'
+ success: (data) ->
+ clear_console()
+ stop_spin()
+ toggle_code_area()
+ if data['compiler_error']
+ compilation_error(data['compiler_output'])
+ return
+ out = $('#validate_case')
+ out.html("")
+ content = ""
+ content = ''
+ @var = "xxxx"
content += "TestCase | Status |
"
for i in data
if i['success']
@@ -365,7 +418,7 @@ debug_console = ->
""
content += "" + "#{i['response']}"+
" | "
- out.html(content)
+ out.html(content)
return
error: (data) ->
clear_console()
@@ -382,7 +435,7 @@ debug_console = ->
@reload_template = () ->
editor = ace.edit("editor");
edit_session = editor.getSession();
- template = "public class CoolSoft {\n"
+ template = "\npublic class CoolSoft {\n"
template += "\tpublic static void main(String [] args) {\n\t\t\n\t}\n}"
edit_session.setValue(template);
return
\ No newline at end of file
diff --git a/tutor/app/assets/stylesheets/solutions.css b/tutor/app/assets/stylesheets/solutions.css
index ab2e5dc5..811e6388 100644
--- a/tutor/app/assets/stylesheets/solutions.css
+++ b/tutor/app/assets/stylesheets/solutions.css
@@ -71,14 +71,12 @@ textarea {
border: #999999;
border-style: solid;
border-width: thin;
- max-height: 150px;
- min-height: 150px;
+ max-height: 100px;
+ min-height: 100px;
background: white;
overflow: scroll;
overflow-y: scroll;
overflow-x: scroll;
- max-width: 750px;
- min-width: 750px;
}
.compilation_succeeded {