Merge branch 'develop' into szzh

This commit is contained in:
sw 2015-07-22 17:13:35 +08:00
commit 3d774598a5
4 changed files with 6 additions and 5 deletions

View File

@ -209,7 +209,7 @@ class HomeworkCommonController < ApplicationController
end
if @homework.homework_type == 2 && @homework_detail_programing #编程作业
@homework_detail_programing.language = "C++"
@homework_detail_programing.language = params[:language]
@homework_detail_programing.standard_code = params[:standard_code]
@homework_detail_programing.ta_proportion = params[:ta_proportion] || 0.6
homework_tests = @homework.homework_tests

View File

@ -2,5 +2,5 @@ class HomeworkTest < ActiveRecord::Base
attr_accessible :input, :output, :homework_common_id
belongs_to :homework_common
has_one :student_work_test
has_many :student_work_test
end

View File

@ -56,7 +56,7 @@
<ul>
<li >
<label class="label02">&nbsp;开发语言:&nbsp;</label>
<%= select_tag :language,options_for_select(programing_languages_options,homework.homework_detail_programing.language), {:class => "fl mb10 h26 w70"} %>
<%= select_tag :language,options_for_select(programing_languages_options,homework.homework_detail_programing.language.to_i), {:class => "fl mb10 h26 w70"} %>
<div class="cl"></div>
</li>

View File

@ -47,8 +47,9 @@
<td class="td_tit">
<%= test.output%>
</td>
<td class="td_50 c_red"><%= test.student_work_test.nil? ? "正在编译" : test.student_work_test.status_to_s%></td>
<input type="hidden" value="<%= test.student_work_test.result if test.student_work_test%>">
<% student_work_test = StudentWorkTest.where(:homework_test_id => test.id,:student_work_id => @work.id).first%>
<td class="td_50 c_red"><%= student_work_test.nil? ? "正在编译" : student_work_test.status_to_s%></td>
<input type="hidden" value="<%= student_work_test.result if student_work_test%>">
</tr>
<% end%>