From a9a36d655eaecb9f23a0bf8420a11496aef376fc Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 21 Oct 2016 19:33:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BB=B7=E4=BD=9C=E4=B8=9A=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E9=95=BF=E5=8D=95=E8=AF=8D=E4=B8=8D=E6=8A=98=E8=A1=8C?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/edit.html.erb | 2 +- app/views/student_work/new.html.erb | 2 +- .../users/new_user_commit_homework.html.erb | 374 +++++++++--------- 3 files changed, 189 insertions(+), 189 deletions(-) diff --git a/app/views/student_work/edit.html.erb b/app/views/student_work/edit.html.erb index 657bdf486..68c7a129b 100644 --- a/app/views/student_work/edit.html.erb +++ b/app/views/student_work/edit.html.erb @@ -23,7 +23,7 @@ <%= link_to @homework.user.show_name, user_activities_path(@homework.user_id), :class => "c_blue"%>
-
+
<%= @homework.description.html_safe %>
diff --git a/app/views/student_work/new.html.erb b/app/views/student_work/new.html.erb index 4a6b3608c..0c65e871f 100644 --- a/app/views/student_work/new.html.erb +++ b/app/views/student_work/new.html.erb @@ -218,7 +218,7 @@ <%= link_to @homework.user.show_name, user_activities_path(@homework.user_id), :class => "c_blue"%>
-
+
<%= @homework.description.html_safe %>
diff --git a/app/views/users/new_user_commit_homework.html.erb b/app/views/users/new_user_commit_homework.html.erb index 84503f837..25d411536 100644 --- a/app/views/users/new_user_commit_homework.html.erb +++ b/app/views/users/new_user_commit_homework.html.erb @@ -1,188 +1,188 @@ -<% content_for :header_tags do %> - <%= javascript_include_tag "/assets/codemirror/codemirror_python_ruby_c" %> - <%= javascript_include_tag 'homework','baiduTemplate' %> - <%= stylesheet_link_tag "/assets/codemirror/codemirror" %> -<% end %> - - - - - - -
- -
-
<%= @is_test ? '模拟答题' : '提交作品' %>
-
-
- -
-
-
-
- <%= @homework.name %> -
- - 截止时间:<%= @homework.end_time %> - -
- <%= @homework.user.show_name %> -

- <%= @homework.description.html_safe %> -

-
- -
-
- <%= form_for(@student_work, - :html => { :multipart => true }, - :url => {:controller => 'users', - :action => 'user_commit_homework', - :student_work_id => @student_work.id, - :homework => @homework.id - }, - :method => :post) do |f|%> - -
- 请使用 <%= @homework.language_name %> 语言编写 - <% if @homework.language.to_i == 1 %> - 编译器信息:gcc version "4.4.7" 20120313 (Red Hat 4.4.7-11) (GCC) - <% elsif @homework.language.to_i == 2 %> - 编译器信息:gcc version "4.4.7" 20120313 (Red Hat 4.4.7-11) (GCC) - <% elsif @homework.language.to_i == 3 %> - 编译器信息:Python version "2.6.6" - <% elsif @homework.language.to_i == 4 %> - 编译器信息:java version "1.7.0_85" OpenJDK Runtime Environment - <% end %> - style="display-hidden" id="data-language"> -
-
- <%= f.text_area :name, id: 'program-title', class:"InputBox W700", placeholder:"请概括你的代码的功能", value:"#{@homework.name}的作品提交" %> -
-
- <%= f.text_area :description, id: 'program-src', class:"InputBox W700 H150", placeholder:"请贴入你的代码", rows: 10 %> - -
-
- 测试代码 - <% if @is_test %> - <%=link_to '返 回',homework_common_index_path(:course => @course.id),:class=>'fr mt6',:style =>'line-height:30px;' %> - <% else @is_test %> - 提交代码 - <% end %> -
-
- <% end %> -
-
- -
-
- - <% @student_work.student_work_tests.each_with_index do |test, index| %> -
-

- 第<%= @student_work.student_work_tests.count - index%>次测试 -

- <%= format_time(test.created_at).to_s%> -
-
- <% if test.status.to_i == -2 %> -
<%= test.results.first %>
- <% else %> -
-
    - <% test.results.reverse.each_with_index do |x, i| %> - <% unless x.nil? %> -
  • 测试<%=test.results.size-i%> - <% if x["status"].to_i != 0 %> - <% if x["status"].to_i == 2 %> - 超时! - <% else %> - 测试错误! - <% end %> - 您的输出: -
    <%=x["result"].force_encoding("UTF-8")%> 
    - 正确输出: -
    <%= x["output"].force_encoding("UTF-8") %>
    - -  耗时: -
    <%=x["time_used"]==0?1:x["time_used"]%>毫秒
    - -
    -
  • - <% else %> - 测试正确! -   -  耗时: -
    <%=x["time_used"]==0?1:x["time_used"]%>毫秒
    -
    - - <% end %> - <% end %> - <% end %> -
-
- <% end %> - <% end %> -
+<% content_for :header_tags do %> + <%= javascript_include_tag "/assets/codemirror/codemirror_python_ruby_c" %> + <%= javascript_include_tag 'homework','baiduTemplate' %> + <%= stylesheet_link_tag "/assets/codemirror/codemirror" %> +<% end %> + + + + + + +
+ +
+
<%= @is_test ? '模拟答题' : '提交作品' %>
+
+
+ +
+
+
+
+ <%= @homework.name %> +
+ + 截止时间:<%= @homework.end_time %> + +
+ <%= @homework.user.show_name %> +

+ <%= @homework.description.html_safe %> +

+
+ +
+
+ <%= form_for(@student_work, + :html => { :multipart => true }, + :url => {:controller => 'users', + :action => 'user_commit_homework', + :student_work_id => @student_work.id, + :homework => @homework.id + }, + :method => :post) do |f|%> + +
+ 请使用 <%= @homework.language_name %> 语言编写 + <% if @homework.language.to_i == 1 %> + 编译器信息:gcc version "4.4.7" 20120313 (Red Hat 4.4.7-11) (GCC) + <% elsif @homework.language.to_i == 2 %> + 编译器信息:gcc version "4.4.7" 20120313 (Red Hat 4.4.7-11) (GCC) + <% elsif @homework.language.to_i == 3 %> + 编译器信息:Python version "2.6.6" + <% elsif @homework.language.to_i == 4 %> + 编译器信息:java version "1.7.0_85" OpenJDK Runtime Environment + <% end %> + style="display-hidden" id="data-language"> +
+
+ <%= f.text_area :name, id: 'program-title', class:"InputBox W700", placeholder:"请概括你的代码的功能", value:"#{@homework.name}的作品提交" %> +
+
+ <%= f.text_area :description, id: 'program-src', class:"InputBox W700 H150", placeholder:"请贴入你的代码", rows: 10 %> + +
+
+ 测试代码 + <% if @is_test %> + <%=link_to '返 回',homework_common_index_path(:course => @course.id),:class=>'fr mt6',:style =>'line-height:30px;' %> + <% else @is_test %> + 提交代码 + <% end %> +
+
+ <% end %> +
+
+ +
+
+ + <% @student_work.student_work_tests.each_with_index do |test, index| %> +
+

+ 第<%= @student_work.student_work_tests.count - index%>次测试 +

+ <%= format_time(test.created_at).to_s%> +
+
+ <% if test.status.to_i == -2 %> +
<%= test.results.first %>
+ <% else %> +
+
    + <% test.results.reverse.each_with_index do |x, i| %> + <% unless x.nil? %> +
  • 测试<%=test.results.size-i%> + <% if x["status"].to_i != 0 %> + <% if x["status"].to_i == 2 %> + 超时! + <% else %> + 测试错误! + <% end %> + 您的输出: +
    <%=x["result"].force_encoding("UTF-8")%> 
    + 正确输出: +
    <%= x["output"].force_encoding("UTF-8") %>
    + +  耗时: +
    <%=x["time_used"]==0?1:x["time_used"]%>毫秒
    + +
    +
  • + <% else %> + 测试正确! +   +  耗时: +
    <%=x["time_used"]==0?1:x["time_used"]%>毫秒
    +
    + + <% end %> + <% end %> + <% end %> +
+
+ <% end %> + <% end %> +
\ No newline at end of file