diff --git a/app/helpers/exercises_helper.rb b/app/helpers/exercises_helper.rb index 1442e1da3..437965ca6 100644 --- a/app/helpers/exercises_helper.rb +++ b/app/helpers/exercises_helper.rb @@ -734,6 +734,6 @@ module ExercisesHelper #实训题学生代码的行数 def content_line(content) - content.split(/\r?\n/).length + content.split(/\r?\n/).length + 1 end end diff --git a/app/templates/exercise_export/exercise_export.css b/app/templates/exercise_export/exercise_export.css index b7f4892c1..407a39b1f 100644 --- a/app/templates/exercise_export/exercise_export.css +++ b/app/templates/exercise_export/exercise_export.css @@ -315,7 +315,6 @@ table td{ /*}*/ textarea{ width:100%; - height:100%; resize:none; border:none; background-color:#eee; diff --git a/app/templates/exercise_export/exercise_user.html.erb b/app/templates/exercise_export/exercise_user.html.erb index ea782e23b..52a083eab 100644 --- a/app/templates/exercise_export/exercise_user.html.erb +++ b/app/templates/exercise_export/exercise_user.html.erb @@ -322,6 +322,7 @@ <% else %> <% latest_code = game.try(:lastest_code) %> <% end %> + <% con_rows = content_line(latest_code) %> <div class="mbt20"> <p class="bgc" > <span class="pd10" style="display:inherit;"> @@ -330,7 +331,7 @@ </span> </p> <div class="bg-e pd10"> - <textarea class="" id="content_show_<%= game.id %>" name="content"><%= latest_code %></textarea> + <textarea class="" id="content_show_<%= game.id %>" name="content" rows="<%= con_rows %>">><%= latest_code %></textarea> </div> </div> </div>