diff --git a/app/views/users/_user_programing_attr.html.erb b/app/views/users/_user_programing_attr.html.erb
index 0ebe997e2..0bfbd379f 100644
--- a/app/views/users/_user_programing_attr.html.erb
+++ b/app/views/users/_user_programing_attr.html.erb
@@ -11,7 +11,7 @@
<% homework.homework_tests.each_with_index do |test, index| %>
-
+
<% if index != 0 %>
@@ -22,7 +22,7 @@
<% else %>
@@ -34,4 +34,11 @@
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js
index ca07093fe..0499ac5fb 100644
--- a/public/javascripts/homework.js
+++ b/public/javascripts/homework.js
@@ -168,7 +168,14 @@ $(function(){
$("#BluePopupBox").on('click', 'a.icon_add', function(){
var html = bt('t:test-answer-list', null);
$(this).parent('.mt10').after(html);
-
+ var inputs = document.getElementsByName("program[input][]");
+ var outputs = document.getElementsByName("program[output][]");
+ if (inputs.length == outputs.length) {
+ for (var i=0; i minHeight) {
+ if (maxHeight && elem.scrollHeight > maxHeight) {
+ height = maxHeight - padding;
+ style.overflowY = 'auto';
+ style2.overflowY = 'auto';
+ } else {
+ height = elem.scrollHeight - padding;
+ style.overflowY = 'hidden';
+ style2.overflowY = 'hidden';
+ };
+ style.height = height + extra + 'px';
+ style2.height = height + extra + 'px';
+ scrollTop += parseInt(style.height) - elem.currHeight;
+ document.body.scrollTop = scrollTop;
+ document.documentElement.scrollTop = scrollTop;
+ elem.currHeight = parseInt(style.height);
+ };
+ if (elem2.scrollHeight > minHeight) {
+ if (maxHeight && elem2.scrollHeight > maxHeight) {
+ height = maxHeight - padding;
+ style.overflowY = 'auto';
+ style2.overflowY = 'auto';
+ } else {
+ height = elem2.scrollHeight - padding;
+ style.overflowY = 'hidden';
+ style2.overflowY = 'hidden';
+ };
+ style.height = height + extra + 'px';
+ style2.height = height + extra + 'px';
+ scrollTop += parseInt(style2.height) - elem2.currHeight;
+ document.body.scrollTop = scrollTop;
+ document.documentElement.scrollTop = scrollTop;
+ elem2.currHeight = parseInt(style2.height);
+ };
+ };
+
+ addEvent(elem, 'propertychange', change);
+ addEvent(elem, 'input', change);
+ addEvent(elem, 'focus', change);
+ addEvent(elem2, 'propertychange', change);
+ addEvent(elem2, 'input', change);
+ addEvent(elem2, 'focus', change);
+ change();
+};
\ No newline at end of file