作业评分设置的调整
This commit is contained in:
parent
4575b8274e
commit
20f112d5ad
|
@ -975,7 +975,7 @@ class StudentWorkController < ApplicationController
|
|||
|
||||
unless @homework.late_penalty.to_s == params[:late_penalty].to_s
|
||||
@homework.late_penalty = params[:late_penalty]
|
||||
@homework.student_works.where("created_at > '#{@homework.end_time} 23:59:59'").each do |student_work|
|
||||
@homework.student_works.where("commit_time > '#{@homework.end_time} 23:59:59'").each do |student_work|
|
||||
student_work.late_penalty = @homework.late_penalty
|
||||
student_work.save
|
||||
end
|
||||
|
@ -986,7 +986,7 @@ class StudentWorkController < ApplicationController
|
|||
if homework_detail_manual.comment_status == 3 #当前作业处于匿评结束状态,修改缺评扣分才会修改每个作品应扣分的值
|
||||
work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")"
|
||||
@homework.student_works.each do |student_work|
|
||||
absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count
|
||||
absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count
|
||||
student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0
|
||||
student_work.save
|
||||
end
|
||||
|
@ -995,7 +995,7 @@ class StudentWorkController < ApplicationController
|
|||
homework_detail_manual.save if homework_detail_manual
|
||||
end
|
||||
|
||||
teacher_priority = params[:teacher_priority] ? 1 : 0
|
||||
teacher_priority = params[:teacher_priority].to_i
|
||||
if homework_detail_manual.ta_proportion.to_s != params[:ta_proportion].to_s || @homework.teacher_priority.to_s != teacher_priority.to_s || (homework_detail_programing && homework_detail_programing.ta_proportion.to_s != params[:sy_proportion].to_s)
|
||||
homework_detail_manual.ta_proportion = params[:ta_proportion]
|
||||
homework_detail_programing.ta_proportion = params[:sy_proportion] if homework_detail_programing
|
||||
|
@ -1011,7 +1011,7 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
|
||||
@homework.save
|
||||
if params[:student_path]
|
||||
if params[:student_path] && params[:student_path] == "true"
|
||||
redirect_to student_work_index_url(:homework => @homework.id)
|
||||
else
|
||||
@user_activity_id = params[:user_activity_id].to_i
|
||||
|
@ -1481,11 +1481,11 @@ class StudentWorkController < ApplicationController
|
|||
#成绩计算
|
||||
def set_final_score homework,student_work
|
||||
if homework && homework.homework_detail_manual
|
||||
if homework.homework_type != 2 #匿评作业
|
||||
if homework.homework_type != 2 #非编程作业
|
||||
if homework.teacher_priority == 1 #教师优先
|
||||
if student_work.teacher_score
|
||||
student_work.final_score = student_work.teacher_score
|
||||
student_work.work_score = student_work.teacher_score
|
||||
student_work.work_score = student_work.teacher_score - student_work.absence_penalty - student_work.late_penalty
|
||||
else
|
||||
if student_work.teaching_asistant_score.nil?
|
||||
student_work.final_score = student_work.student_score
|
||||
|
@ -1528,7 +1528,7 @@ class StudentWorkController < ApplicationController
|
|||
if homework.teacher_priority == 1 #教师优先
|
||||
if student_work.teacher_score
|
||||
student_work.final_score = student_work.teacher_score
|
||||
student_work.work_score = student_work.teacher_score
|
||||
student_work.work_score = student_work.teacher_score - student_work.absence_penalty - student_work.late_penalty
|
||||
else
|
||||
if student_work.teaching_asistant_score.nil? #教辅未评分
|
||||
if student_work.student_score.nil?
|
||||
|
|
|
@ -49,11 +49,11 @@ class StudentWork < ActiveRecord::Base
|
|||
#成绩计算
|
||||
def set_final_score homework,student_work
|
||||
if homework && homework.homework_detail_manual
|
||||
if homework.homework_type != 2 #匿评作业
|
||||
if homework.homework_type != 2 #非编程作业
|
||||
if homework.teacher_priority == 1 #教师优先
|
||||
if student_work.teacher_score
|
||||
student_work.final_score = student_work.teacher_score
|
||||
student_work.work_score = student_work.teacher_score
|
||||
student_work.work_score = student_work.teacher_score - student_work.absence_penalty - student_work.late_penalty
|
||||
else
|
||||
if student_work.teaching_asistant_score.nil?
|
||||
student_work.final_score = student_work.student_score
|
||||
|
@ -98,7 +98,7 @@ class StudentWork < ActiveRecord::Base
|
|||
if homework.teacher_priority == 1 #教师优先
|
||||
if student_work.teacher_score
|
||||
student_work.final_score = student_work.teacher_score
|
||||
student_work.work_score = student_work.teacher_score
|
||||
student_work.work_score = student_work.teacher_score - student_work.absence_penalty - student_work.late_penalty
|
||||
else
|
||||
if student_work.teaching_asistant_score.nil? #教辅未评分
|
||||
if student_work.student_score.nil?
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
<div id="muban_popup_box" style="width:550px;">
|
||||
<div class="muban_popup_top">
|
||||
<h3 class="fl">评分设置</h3>
|
||||
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<%= form_for('new_form',:url =>{:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id,:student_path => student_path,:user_activity_id=>user_activity_id,:hw_status=>hw_status},:method => "post", :remote => !student_path) do |f|%>
|
||||
<div class="muban_popup_con clear">
|
||||
<div class="clear mt15 ml20">
|
||||
<ul class="pro_newsetting_con fl">
|
||||
<li class="mb10 clear">
|
||||
<label class="pop_box_label fl">迟交扣分 : </label>
|
||||
<input type="text" name="late_penalty" id="late_penalty_num" placeholder="0-50" class="fl issues_calendar_input" value="<%= homework.late_penalty%>" onkeyup="check_late_penalty('late_penalty_num')"/>
|
||||
</li>
|
||||
<li class="mb10 clear">
|
||||
<label class="pop_box_label fl">缺评扣分 : </label>
|
||||
<input type="text" name="absence_penalty" id="absence_penalty_num" placeholder="0-50" class="fl issues_calendar_input" <%=(homework.homework_detail_manual && homework.homework_detail_manual.evaluation_num == -1) ? 'readonly' : '' %> value="<%= homework.homework_detail_manual.absence_penalty%>" onkeyup="check_late_penalty('absence_penalty_num')"/>
|
||||
</li>
|
||||
<li class="mb10 clear">
|
||||
<label class="pop_box_label fl">最终得分 : </label>
|
||||
<input type="radio" class="fl" value="1" id="teacher_score" name="teacher_priority"/><label for="teacher_score" class=" fl ml5">教师评分</label>
|
||||
</li>
|
||||
<li class="mb10 clear">
|
||||
<label class="pop_box_label fl"> </label>
|
||||
<ul class="fl">
|
||||
<li class="clear">
|
||||
<input type="radio" class="fl" id="other_score" value="0" name="teacher_priority"/>
|
||||
<label for="other_score" class="fl ml5">助教评分+学生匿评</label>
|
||||
</li>
|
||||
<li class="clear">
|
||||
<%= select_tag :ta_proportion,options_for_select(ta_proportion_option_to(100),homework.homework_detail_manual.ta_proportion), {:class => "w61 fl ml15"} %>
|
||||
<span class="fl ml5">助教评分</span>
|
||||
</li>
|
||||
<li class="clear">
|
||||
<input type="text" style="width: 49px; padding-left: 10px;" id="student_proportion" value="<%= (100 - homework.homework_detail_manual.ta_proportion * 100).to_i%>%" class="fl ml15" readonly>
|
||||
<span class="fl ml5">学生匿评</span>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="fl mt5 ml20" >
|
||||
<div class="popup_tip_box fontGrey2 mb10">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p >请输入数值0-50</p>
|
||||
</div>
|
||||
<div class="popup_tip_box fontGrey2 mb10">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p >请输入数值0-50</p>
|
||||
</div>
|
||||
<div class="popup_tip_box fontGrey2 mb10">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p >教师评分 - 迟交扣分 - 缺评扣分</p>
|
||||
</div>
|
||||
<div class="popup_tip_box fontGrey2">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p >助教评分 * 其百分比 + <br/>
|
||||
学生匿评平均分 * 其百分比 - <br/>
|
||||
( 迟交扣分 + 缺评扣分 )</p>
|
||||
</div>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<a href="javascript:void(0);" class="fr sy_btn_blue mr80" onclick="set_score_rule_submit();">确定</a>
|
||||
<a href="javascript:void(0);" class="fr sy_btn_grey mr5" onclick="hideModal();">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$("#ta_proportion").change(function(){
|
||||
var ta_proportion = parseFloat($("#ta_proportion").val());
|
||||
$("#student_proportion").val((100 - parseFloat(parseInt(ta_proportion * 100))) + "%");
|
||||
});
|
||||
<% if homework.teacher_priority == 1 %>
|
||||
$("#teacher_score").attr("checked", "checked");
|
||||
<% else %>
|
||||
$("#other_score").attr("checked", "checked");
|
||||
<% end %>
|
||||
$("#teacher_score").change(function(){
|
||||
if($("#teacher_score").attr("checked")){
|
||||
$("#late_penalty_num").val("0");
|
||||
$("#absence_penalty_num").val("0");
|
||||
}
|
||||
});
|
||||
$("#other_score").change(function(){
|
||||
if($("#other_score").attr("checked")){
|
||||
$("#late_penalty_num").val("10");
|
||||
<% if homework.homework_detail_manual && homework.homework_detail_manual.evaluation_num == -1 %>
|
||||
$("#absence_penalty_num").val("0");
|
||||
<% else %>
|
||||
$("#absence_penalty_num").val("5");
|
||||
<% end %>
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,69 @@
|
|||
<div id="muban_popup_box" style="width:500px;">
|
||||
<div class="muban_popup_top">
|
||||
<h3 class="fl">评分设置</h3>
|
||||
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<%= form_for('new_form',:url =>{:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id,:student_path => student_path,:user_activity_id=>user_activity_id,:hw_status=>hw_status},:method => "post", :remote => !student_path) do |f|%>
|
||||
<div class="muban_popup_con clear">
|
||||
<div class="clear mt15 ml20">
|
||||
<ul class="pro_newsetting_con fl">
|
||||
<li class="mb10 clear">
|
||||
<label class="pop_box_label fl">迟交扣分 : </label>
|
||||
<input type="text" name="late_penalty" id="late_penalty_num" placeholder="0-50" class="fl issues_calendar_input" value="<%= homework.late_penalty%>" onkeyup="check_late_penalty('late_penalty_num')"/>
|
||||
</li>
|
||||
<li class="mb10 clear">
|
||||
<label class="pop_box_label fl">最终得分 : </label>
|
||||
<input type="radio" class="fl" value="1" id="teacher_score" name="teacher_priority"/>
|
||||
<label for="teacher_score" class=" fl ml5">教师评分</label>
|
||||
</li>
|
||||
<li class="mb10 clear">
|
||||
<label class="pop_box_label fl"> </label>
|
||||
<input type="radio" class="fl" id="other_score" value="0" name="teacher_priority"/>
|
||||
<label for="other_score" class="fl ml5">助教评分</label>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="fl mt5 ml20" >
|
||||
<div class="popup_tip_box fontGrey2 mb10">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p >请输入数值0-50</p>
|
||||
</div>
|
||||
<div class="popup_tip_box fontGrey2 mb10">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p >教师评分 - 迟交扣分 </p>
|
||||
</div>
|
||||
<div class="popup_tip_box fontGrey2 mb10">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p >助教评分 - 迟交扣分 </p>
|
||||
</div>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<a href="javascript:void(0);" class="fr sy_btn_blue mr90" onclick="set_score_rule_submit();">确定</a>
|
||||
<a href="javascript:void(0);" class="fr sy_btn_grey mr5" onclick="hideModal();">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
<% if homework.teacher_priority == 1 %>
|
||||
$("#teacher_score").attr("checked", "checked");
|
||||
<% else %>
|
||||
$("#other_score").attr("checked", "checked");
|
||||
<% end %>
|
||||
$("#teacher_score").change(function(){
|
||||
if($("#teacher_score").attr("checked")){
|
||||
$("#late_penalty_num").val("0");
|
||||
}
|
||||
});
|
||||
$("#other_score").change(function(){
|
||||
if($("#other_score").attr("checked")){
|
||||
$("#late_penalty_num").val("10");
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,111 @@
|
|||
<div id="muban_popup_box" style="width:570px;">
|
||||
<div class="muban_popup_top">
|
||||
<h3 class="fl">评分设置</h3>
|
||||
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<%= form_for('new_form',:url =>{:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id,:student_path => student_path,:user_activity_id=>user_activity_id,:hw_status=>hw_status},:method => "post", :remote => !student_path) do |f|%>
|
||||
<div class="muban_popup_con clear">
|
||||
<div class="clear mt15 ml20">
|
||||
<ul class="pro_newsetting_con fl">
|
||||
<li class="mb10 clear">
|
||||
<label class="pop_box_label fl">迟交扣分 : </label>
|
||||
<input type="text" name="late_penalty" id="late_penalty_num" placeholder="0-50" class="fl w180" value="<%= homework.late_penalty%>" onkeyup="check_late_penalty('late_penalty_num')"/>
|
||||
</li>
|
||||
<li class="mb10 clear">
|
||||
<label class="pop_box_label fl">缺评扣分 : </label>
|
||||
<input type="text" name="absence_penalty" id="absence_penalty_num" placeholder="0-50" class="fl w180" <%=(homework.homework_detail_manual && homework.homework_detail_manual.evaluation_num == -1) ? 'readonly' : '' %> value="<%= homework.homework_detail_manual.absence_penalty%>" onkeyup="check_late_penalty('absence_penalty_num')"/>
|
||||
</li>
|
||||
<li class="mb10 clear">
|
||||
<label class="pop_box_label fl">最终得分 : </label>
|
||||
<input type="radio" class="fl" value="1" id="teacher_score" name="teacher_priority"/><label for="teacher_score" class=" fl ml5">教师评分</label>
|
||||
</li>
|
||||
<li class="mb10 clear">
|
||||
<label class="pop_box_label fl"> </label>
|
||||
<ul class="fl">
|
||||
<li class="clear">
|
||||
<input type="radio" class="fl" id="other_score" value="0" name="teacher_priority"/>
|
||||
<label for="other_score" class="fl ml5">系统评分+助教评分+学生匿评</label>
|
||||
</li>
|
||||
<li class="clear">
|
||||
<%= select_tag :sy_proportion,options_for_select(ta_proportion_option,homework.homework_detail_programing.ta_proportion), {:class => "w61 fl ml15"} %>
|
||||
<span class="fl ml5">系统评分</span>
|
||||
</li>
|
||||
<li class="clear">
|
||||
<%= select_tag :ta_proportion,options_for_select(ta_proportion_option_to(100-(homework.homework_detail_programing.ta_proportion * 100).to_i),homework.homework_detail_manual.ta_proportion), {:class => "w61 fl ml15"} %>
|
||||
<span class="fl ml5">助教评分</span>
|
||||
</li>
|
||||
<li class="clear">
|
||||
<input type="text" style="width: 49px; padding-left: 10px;" id="student_proportion" value="<%= (100 - homework.homework_detail_manual.ta_proportion * 100).to_i - (homework.homework_detail_programing.ta_proportion * 100).to_i%>%" class="fl ml15" readonly>
|
||||
<span class="fl ml5">学生匿评</span>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="fl ml20 mt5">
|
||||
<div class="popup_tip_box fontGrey2 mb10">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p id="late_penalty_notice" class="">请输入数值0-50</p>
|
||||
</div>
|
||||
<div class="popup_tip_box fontGrey2 mb10">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p id="absence_penalty_notice" class="">请输入数值0-50</p>
|
||||
</div>
|
||||
<div class="popup_tip_box fontGrey2 mb10">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p>教师评分-迟交扣分-缺评扣分</p>
|
||||
</div>
|
||||
<div class="popup_tip_box fontGrey2">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p>系统评分*其百分比+ <br/>
|
||||
助教评 *其百分比+ <br/>
|
||||
学生匿评平均分*其百分比 - <br/>
|
||||
( 迟交扣分+缺评扣分 )</p>
|
||||
</div>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<a href="javascript:void(0);" class="fr sy_btn_blue mr70" onclick="set_score_rule_submit();">确定</a>
|
||||
<a href="javascript:void(0);" class="fr sy_btn_grey mr5" onclick="hideModal();">取消</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<% end%>
|
||||
</div>
|
||||
<script>
|
||||
$(function(){
|
||||
$("#sy_proportion").live('change', function(){
|
||||
var ta_proportion = 100 - parseInt(parseFloat($("#sy_proportion").val()) * 100);
|
||||
$("#ta_proportion").replaceWith(build_selector(ta_proportion));
|
||||
$("#student_proportion").val("0%");
|
||||
});
|
||||
$("#ta_proportion").live("change",function(){
|
||||
var ta_proportion = 100 - parseInt(parseFloat($("#sy_proportion").val()) * 100) - parseInt(parseFloat($("#ta_proportion").val()) * 100);
|
||||
$("#student_proportion").val(ta_proportion + "%");
|
||||
});
|
||||
<% if homework.teacher_priority == 1 %>
|
||||
$("#teacher_score").attr("checked", "checked");
|
||||
<% else %>
|
||||
$("#other_score").attr("checked", "checked");
|
||||
<% end %>
|
||||
$("#teacher_score").change(function(){
|
||||
if($("#teacher_score").attr("checked")){
|
||||
$("#late_penalty_num").val("0");
|
||||
$("#absence_penalty_num").val("0");
|
||||
}
|
||||
});
|
||||
$("#other_score").change(function(){
|
||||
if($("#other_score").attr("checked")){
|
||||
$("#late_penalty_num").val("10");
|
||||
<% if homework.homework_detail_manual && homework.homework_detail_manual.evaluation_num == -1 %>
|
||||
$("#absence_penalty_num").val("0");
|
||||
<% else %>
|
||||
$("#absence_penalty_num").val("5");
|
||||
<% end %>
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,91 @@
|
|||
<div id="muban_popup_box" style="width:500px;">
|
||||
<div class="muban_popup_top">
|
||||
<h3 class="fl">评分设置</h3>
|
||||
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<%= form_for('new_form',:url =>{:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id,:student_path => student_path,:user_activity_id=>user_activity_id,:hw_status=>hw_status},:method => "post", :remote => !student_path) do |f|%>
|
||||
<div class="muban_popup_con clear">
|
||||
<div class="clear mt15 ml20">
|
||||
<ul class="pro_newsetting_con fl">
|
||||
<li class="mb10 clear">
|
||||
<label class="pop_box_label fl">迟交扣分 : </label>
|
||||
<input type="text" name="late_penalty" id="late_penalty_num" placeholder="0-50" class="fl issues_calendar_input" value="<%= homework.late_penalty%>" onkeyup="check_late_penalty('late_penalty_num')"/>
|
||||
</li>
|
||||
<li class="mb10 clear">
|
||||
<label class="pop_box_label fl">最终得分 : </label>
|
||||
<input type="radio" class="fl" value="1" id="teacher_score" name="teacher_priority"/>
|
||||
<label for="teacher_score" class=" fl ml5">教师评分</label>
|
||||
</li>
|
||||
<li class="mb10 clear">
|
||||
<label class="pop_box_label fl"> </label>
|
||||
<ul class="fl">
|
||||
<li class="clear">
|
||||
<input type="radio" class="fl" id="other_score" value="0" name="teacher_priority"/><label for="other_score" class="fl ml5">系统评分+助教评分</label>
|
||||
</li>
|
||||
<li class="clear">
|
||||
<%= select_tag :sy_proportion,options_for_select(ta_proportion_option,homework.homework_detail_programing.ta_proportion), {:class => "w61 fl ml15"} %>
|
||||
<span class="fl ml5">系统评分</span>
|
||||
</li>
|
||||
<li class="clear">
|
||||
<%= select_tag :ta_proportion,options_for_select(ta_proportion_option_to(100-(homework.homework_detail_programing.ta_proportion * 100).to_i),homework.homework_detail_manual.ta_proportion), {:class => "w61 fl ml15"} %>
|
||||
<span class="fl ml5">助教评分</span>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="fl ml20 mt5">
|
||||
<div class="popup_tip_box fontGrey2 mb10">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p >请输入数值0-50</p>
|
||||
</div>
|
||||
<div class="popup_tip_box fontGrey2 mb10">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p >教师评分 - 迟交扣分 </p>
|
||||
</div>
|
||||
<div class="popup_tip_box fontGrey2 mb10">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p >系统评分 * 其百分比 + <br/>
|
||||
助教评分 * 其百分比 - <br/>
|
||||
迟交扣分 </p>
|
||||
</div>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<a href="javascript:void(0);" class="fr sy_btn_blue mr75" onclick="set_score_rule_submit();">确定</a>
|
||||
<a href="javascript:void(0);" class="fr sy_btn_grey mr5" onclick="hideModal();">取消</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$("#sy_proportion").live('change', function(){
|
||||
var ta_proportion = 100 - parseInt(parseFloat($("#sy_proportion").val()) * 100);
|
||||
$("#ta_proportion").replaceWith(build_selector(ta_proportion));
|
||||
});
|
||||
$("#ta_proportion").live('change', function(){
|
||||
var sy_proportion = 100 - parseInt(parseFloat($("#ta_proportion").val()) * 100);
|
||||
$("#sy_proportion").replaceWith(build_selector_sy(sy_proportion));
|
||||
});
|
||||
<% if homework.teacher_priority == 1 %>
|
||||
$("#teacher_score").attr("checked", "checked");
|
||||
<% else %>
|
||||
$("#other_score").attr("checked", "checked");
|
||||
<% end %>
|
||||
$("#teacher_score").change(function(){
|
||||
if($("#teacher_score").attr("checked")){
|
||||
$("#late_penalty_num").val("0");
|
||||
}
|
||||
});
|
||||
$("#other_score").change(function(){
|
||||
if($("#other_score").attr("checked")){
|
||||
$("#late_penalty_num").val("10");
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -1,6 +1,27 @@
|
|||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status,:remote=>true}) %>');
|
||||
showModal('ajax-modal', '350px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed").css("border","3px solid #269ac9");
|
||||
<% if @homework.homework_type == 2 %>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>";
|
||||
pop_box_new(htmlvalue, 570, 355);
|
||||
<% else %>
|
||||
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro_anon',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>";
|
||||
pop_box_new(htmlvalue, 500, 285);
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_non_pro',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>";
|
||||
pop_box_new(htmlvalue, 500, 325);
|
||||
<% else %>
|
||||
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_none_pro_anon',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>";
|
||||
pop_box_new(htmlvalue, 500, 225);
|
||||
<% end %>
|
||||
<% end %>
|
||||
function set_score_rule_submit() {
|
||||
if($("#late_penalty_num").val() == ""){
|
||||
$("#late_penalty_num").val("0");
|
||||
}
|
||||
if($("#absence_penalty_num").val() == ""){
|
||||
$("#absence_penalty_num").val("0");
|
||||
}
|
||||
$('#muban_popup_box').find('form').submit();
|
||||
hideModal();
|
||||
}
|
|
@ -1,4 +1,3 @@
|
|||
hideModal();
|
||||
<% if @hw_status == 5 %>
|
||||
$("#homework_post_brief").html("<%= escape_javascript(render :partial => 'student_work/homework_post_brief', :locals => {:homework => @homework, :is_teacher => @is_teacher}) %>");
|
||||
<% else %>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
<% is_expand = st.student_work_projects.empty? %>
|
||||
<ul id="syllabus_course_ul">
|
||||
<li class="syllabus_class_list" style="line-height:44px; vertical-align:middle;">
|
||||
|
@ -56,11 +57,11 @@
|
|||
<span class="c_red"> <%= st.final_score%> </span>分<br/>
|
||||
迟交扣分
|
||||
<span class="c_red">
|
||||
<%= st.homework_common && st.homework_common.teacher_priority == 1 && st.teacher_score ? 0 : st.late_penalty %>
|
||||
<%= st.late_penalty %>
|
||||
</span>分<br/>
|
||||
缺评扣分
|
||||
<span class="c_red">
|
||||
<%= st.homework_common && st.homework_common.teacher_priority == 1 && st.teacher_score ? 0 : st.absence_penalty%>
|
||||
<%= st.absence_penalty%>
|
||||
</span>分<br/>
|
||||
最终成绩为
|
||||
<span class="c_red"> <%= format("%.1f",score<0 ? 0 : score)%> </span>分
|
||||
|
|
|
@ -72,11 +72,11 @@
|
|||
<span class="c_red"> <%= student_work.final_score%> </span>分。<br/>
|
||||
迟交扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %>
|
||||
<%= student_work.late_penalty %>
|
||||
</span>分,<br/>
|
||||
缺评扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty%>
|
||||
<%= student_work.absence_penalty%>
|
||||
</span>分,<br/>
|
||||
最终成绩为
|
||||
<span class="c_red"> <%= format("%.1f",score<0 ? 0 : score)%> </span>分。
|
||||
|
|
|
@ -104,11 +104,11 @@
|
|||
<span class="c_red"> <%= student_work.final_score%> </span>分<br/>
|
||||
迟交扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %>
|
||||
<%= student_work.late_penalty %>
|
||||
</span>分<br/>
|
||||
缺评扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty%>
|
||||
<%= student_work.absence_penalty%>
|
||||
</span>分<br/>
|
||||
最终成绩为
|
||||
<span class="c_red"> <%= format("%.1f",score<0 ? 0 : score)%> </span>分<br/>
|
||||
|
|
|
@ -48,14 +48,36 @@
|
|||
// });
|
||||
<%# end%>
|
||||
|
||||
function set_score_rule_submit() {
|
||||
if($("#late_penalty_num").val() == ""){
|
||||
$("#late_penalty_num").val("0");
|
||||
}
|
||||
if($("#absence_penalty_num").val() == ""){
|
||||
$("#absence_penalty_num").val("0");
|
||||
}
|
||||
$('#muban_popup_box').find('form').submit();
|
||||
hideModal();
|
||||
}
|
||||
|
||||
//设置评分规则
|
||||
function set_score_rule(){
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework,:student_path => true}) %>');
|
||||
showModal('ajax-modal', '350px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed").css("border","3px solid #269ac9");
|
||||
<% if @homework.homework_type == 2 %>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
|
||||
pop_box_new(htmlvalue, 570, 355);
|
||||
<% else %>
|
||||
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro_anon',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
|
||||
pop_box_new(htmlvalue, 500, 285);
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_non_pro',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
|
||||
pop_box_new(htmlvalue, 500, 325);
|
||||
<% else %>
|
||||
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_none_pro_anon',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
|
||||
pop_box_new(htmlvalue, 500, 225);
|
||||
<% end %>
|
||||
<% end %>
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
clickCanel();
|
||||
<% if @hw_status != 5 %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:hw_status=>@hw_status}) %>");
|
||||
<% if @user_activity_id != @homework.id %>
|
||||
|
@ -8,4 +7,4 @@ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(r
|
|||
<% end %>
|
||||
<% else %>
|
||||
window.location.href = '<%=student_work_index_url(:homework => @homework.id) %>';
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -64,7 +64,7 @@
|
|||
<% end %>
|
||||
</a>
|
||||
<% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %>
|
||||
<p class="fontGrey2">分数:<span class="c_red"><%=format("%.1f",score.to_i<0 ? 0 : score.to_i) %>分</span></p>
|
||||
<p class="fontGrey2">分数:<span class="c_red"><%=format("%.1f",score<0 ? 0 : score) %>分</span></p>
|
||||
</div>
|
||||
<% if i == 4 %>
|
||||
<% break %>
|
||||
|
|
|
@ -626,7 +626,7 @@ $(function(){
|
|||
|
||||
//生成select
|
||||
function build_selector(max_num){
|
||||
var html = "<select class='markPercentage' id='ta_proportion' name='ta_proportion'>";
|
||||
var html = "<select class='w61 fl ml15' id='ta_proportion' name='ta_proportion'>";
|
||||
for(var i = 0; i <= max_num; i += 10){
|
||||
if( i == max_num){
|
||||
html += "<option value='" + parseFloat(i)/100 + "' selected='selected'>" + i + "%</option>";
|
||||
|
@ -637,6 +637,18 @@ function build_selector(max_num){
|
|||
html += "</select>";
|
||||
return html;
|
||||
}
|
||||
function build_selector_sy(max_num){
|
||||
var html = "<select class='w61 fl ml15' id='sy_proportion' name='sy_proportion'>";
|
||||
for(var i = 0; i <= 100; i += 10){
|
||||
if( i == max_num){
|
||||
html += "<option value='" + parseFloat(i)/100 + "' selected='selected'>" + i + "%</option>";
|
||||
}else{
|
||||
html += "<option value='" + parseFloat(i)/100 + "'>" + i + "%</option>";
|
||||
}
|
||||
}
|
||||
html += "</select>";
|
||||
return html;
|
||||
}
|
||||
|
||||
//提交匿评参数设置
|
||||
function submit_set_evaluation_attr(end_time){
|
||||
|
@ -651,6 +663,7 @@ function submit_set_evaluation_attr(end_time){
|
|||
}
|
||||
else{
|
||||
$('#muban_popup_box form').submit();
|
||||
hideModal();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -269,6 +269,7 @@ function submit_set_evaluation_attr(end_time){
|
|||
}
|
||||
else{
|
||||
$('#muban_popup_box form').submit();
|
||||
hideModal();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -165,6 +165,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
|
|||
.mr60 {margin-right:60px;}
|
||||
.mr65 {margin-right:65px;}
|
||||
.mr70{margin-right: 70px;}
|
||||
.mr75{margin-right: 75px;}
|
||||
.mr80{margin-right: 80px;}
|
||||
.mr95 {margin-right:95px !important;}
|
||||
.mr100 {margin-right:100px !important;}
|
||||
|
@ -228,6 +229,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
|
|||
.w50 {width:50px;}
|
||||
.w56 {width:56px;}
|
||||
.w60{ width:60px;}
|
||||
.w61{ width:61px;}
|
||||
.w70{ width:70px;}
|
||||
.w80{ width:80px;}
|
||||
.w90{ width:90px;}
|
||||
|
|
Loading…
Reference in New Issue