parent
1ea972d030
commit
23f6941001
|
@ -136,7 +136,7 @@ class HomeworkCommonController < ApplicationController
|
|||
# @homework.course_id = @course.id
|
||||
|
||||
#匿评作业相关属性
|
||||
if @homework.homework_type == 1
|
||||
if @homework.homework_type == 1 && @homework_detail_manual
|
||||
@homework_detail_manual.ta_proportion = params[:ta_proportion] || 0.6
|
||||
@homework_detail_manual.evaluation_start = params[:evaluation_start]
|
||||
@homework_detail_manual.evaluation_end = params[:evaluation_end]
|
||||
|
@ -152,15 +152,15 @@ class HomeworkCommonController < ApplicationController
|
|||
end
|
||||
@homework_detail_manual.absence_penalty = params[:absence_penalty]
|
||||
end
|
||||
else #不是匿评作业,缺评扣分为0分,每个作品的缺评扣分改为0分,防止某些作业在结束匿评之后改为普通作业
|
||||
elsif @homework.homework_type == 0 #普通作业,缺评扣分为0分,每个作品的缺评扣分改为0分,防止某些作业在结束匿评之后改为普通作业
|
||||
@homework.student_works.where("absence_penalty != 0").each do |student_work|
|
||||
student_work.late_penalty = 0
|
||||
student_work.save
|
||||
end
|
||||
@homework_detail_manual.absence_penalty = 0
|
||||
@homework_detail_manual.absence_penalty = 0 if @homework_detail_manual
|
||||
end
|
||||
|
||||
if @homework.homework_type == 2 #编程作业
|
||||
if @homework.homework_type == 2 && @homework_detail_programing #编程作业
|
||||
@homework_detail_programing.language = "C++"
|
||||
@homework_detail_programing.standard_code = params[:standard_code]
|
||||
homework_tests = @homework.homework_tests
|
||||
|
@ -293,6 +293,7 @@ class HomeworkCommonController < ApplicationController
|
|||
def find_homework
|
||||
@homework = HomeworkCommon.find params[:id]
|
||||
@homework_detail_manual = @homework.homework_detail_manual
|
||||
@homework_detail_programing = @homework.homework_detail_programing
|
||||
@course = @homework.course
|
||||
rescue
|
||||
render_404
|
||||
|
|
|
@ -40,15 +40,16 @@
|
|||
<%= calendar_for('homework_publish_time')%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
|
||||
<li style="display: none;">
|
||||
<li>
|
||||
<label class="label02">迟交扣分: </label>
|
||||
<%= select_tag :late_penalty,options_for_select(late_penalty_option,homework.late_penalty), {:class => "fl mb10 h26 w70"} %>
|
||||
<span class="fl mt5"> 分</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
</ul><!--hwork_new_basic end--->
|
||||
|
||||
<div class="cl"></div>
|
||||
<div class="hwork_new_set">
|
||||
<p class="fl ml20 f14 mb10 c_orange">编程评测设置</p>
|
||||
<div class="cl"></div>
|
||||
|
|
Loading…
Reference in New Issue