Merge branch 'develop' into yuanke_youhua

This commit is contained in:
yuanke 2016-11-07 08:48:41 +08:00
commit d41da99ac5
20 changed files with 69 additions and 56 deletions

View File

@ -310,9 +310,9 @@ class HomeworkCommonController < ApplicationController
@cur_size = @homework.student_works.where("work_status != 0").size
@work_size = @homework.student_works.has_committed.size
elsif @homework_detail_manual.comment_status == 2
@homework.student_works.where("work_status != 0").map { |work| @totle_size += work.student_works_evaluation_distributions.count}
@homework.student_works.has_committed.map { |work| @totle_size += work.student_works_evaluation_distributions.count}
@cur_size = 0
@homework.student_works.where("work_status != 0").map { |work| @cur_size += work.student_works_scores.select("distinct user_id").where(:reviewer_role => 3).count}
@homework.student_works.has_committed.map { |work| @cur_size += work.student_works_scores.select("distinct user_id").where(:reviewer_role => 3).count}
end
@percent = format("%.2f",(@cur_size.to_f / ( @totle_size == 0 ? 1 : @totle_size)) * 100)
@user_activity_id = params[:user_activity_id].to_i

View File

@ -975,9 +975,9 @@ class StudentWorkController < ApplicationController
homework_detail_programing = @homework.homework_detail_programing
unless @homework.late_penalty.to_s == params[:late_penalty].to_s
@homework.late_penalty = params[:late_penalty]
@homework.late_penalty = params[:late_penalty].to_s
@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.late_penalty = params[:late_penalty].to_i
student_work.save
end
end
@ -1005,6 +1005,8 @@ class StudentWorkController < ApplicationController
homework_detail_manual.save if homework_detail_manual
homework_detail_programing.save if homework_detail_programing
@homework.save
@homework = HomeworkCommon.find @homework.id
@homework.student_works.each do |student_work|
set_final_score @homework,student_work
student_work.save

View File

@ -1055,7 +1055,7 @@ class UsersController < ApplicationController
end
homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 1
homework.homework_type = params[:homework_type].to_i || 1
homework.late_penalty = 10
homework.late_penalty = 0
homework.teacher_priority = 1
homework.user_id = User.current.id
homework.course_id = params[:course_id]
@ -1077,7 +1077,7 @@ class UsersController < ApplicationController
homework_detail_manual.evaluation_start = params[:evaluation_start].blank? ? homework.end_time + 7 : params[:evaluation_start]
homework_detail_manual.evaluation_end = params[:evaluation_end].blank? ? homework_detail_manual.evaluation_start + 7 : params[:evaluation_end]
homework_detail_manual.evaluation_num = params[:evaluation_num] || 3
homework_detail_manual.absence_penalty = 5
homework_detail_manual.absence_penalty = 0
homework.homework_detail_manual = homework_detail_manual
#编程作业相关属性

View File

@ -1,3 +1,4 @@
<div style="width:460px;">
<div class="sy_popup_top">
<h3 class="fl">欢迎加入项目</h3>
<a href="javascript:void(0);" class="sy_icons_close fr" onclick="hideModal()"></a>
@ -35,3 +36,4 @@
</ul>
<% end %>
</div>
</div>

View File

@ -1,11 +1,12 @@
<div style="width:820px;">
<div class="muban_popup_top">
<h3 class="fl">更新资源版本</h3>
<a href="javascript:void(0);" class="muban_icons_close fr" onclick="hideModal();"></a>
<div class="cl"></div>
</div>
<div class="muban_popup_con" >
<div class=" clear ml15 mr15 mt15" id="attachment_history_popub">
<%= render :partial => "files/attachment_history_popub" %>
</div>
</div>
</div>

View File

@ -1,3 +1,4 @@
<div style="width:820px;">
<div class="muban_popup_top">
<h3 class="fl">删除资源</h3>
<a href="javascript:void(0);" class="muban_icons_close fr" onclick="attachment_fresh_for_destroy();"></a>
@ -9,7 +10,7 @@
<%= render :partial => "files/attachment_history_popub_delete" %>
</div>
</div>
</div>
<script>
function attachment_fresh_for_destroy(){
hideModal();

View File

@ -1,4 +1,4 @@
<div id="sy_popup_box">
<div id="sy_popup_box" style="width:460px;">
<div class="sy_popup_top">
<h3 class="fl">欢迎加入班级</h3>
<a href="javascript:void(0);" class="sy_icons_close fr" onclick="hideModal()"></a>

View File

@ -1,3 +1,4 @@
<div style="width: 460px;">
<div class="sy_popup_top">
<h3 class="fl">提示</h3>
<a href="javascript:void(0);" class="sy_icons_close fr" onclick="hideModal()"></a>
@ -16,3 +17,4 @@
</li>
</ul>
</div>
</div>

View File

@ -1,3 +1,4 @@
<div style="width: 460px;">
<div class="sy_popup_top">
<h3 class="fl">提示</h3>
<a href="javascript:void(0);" class="sy_icons_close fr" onclick="hideModal()"></a>
@ -17,5 +18,5 @@
</li>
</ul>
</div>
</div>

View File

@ -1,3 +1,4 @@
<div style="width: 460px;">
<div class="sy_popup_top">
<h3 class="fl">提示</h3>
<a href="javascript:void(0);" class="sy_icons_close fr" onclick="hideModal()"></a>
@ -19,5 +20,5 @@
</li>
</ul>
</div>
</div>

View File

@ -17,7 +17,7 @@
<span class="fl hidden ml5" style="max-width:75px;"><%= st.user.show_name %></span>
</span>
<span class="fl student_work_<%= st.id%> hidden" style="width:105px; text-align: center">
<%= st.user.user_extensions.student_id.nil? ? "--" : st.user.user_extensions.student_id%>
<%= st.user.user_extensions.student_id.nil? || st.user.user_extensions.student_id == "" ? "--" : st.user.user_extensions.student_id%>
</span>
<% end %>
<div class="flex-container fl" style="width:340px;">
@ -50,7 +50,7 @@
<div class="<%= score_color score%> student_final_scor_info pr" style="display: inline">
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
<% unless score.nil?%>
<div class="score-tip none tl" style="line-height: 18px; top:-32px; right:-233px;">
<div class="score-tip none tl" style="line-height: 18px; top:-32px; right:-273px;">
<em></em>
<font></font>
作品最终评分为

View File

@ -10,33 +10,35 @@
</span>
<div class="cl"></div>
<% if @homework.homework_detail_group.base_on_project == 1 %>
<span class="fl ml25 fontGrey2">关联项目:</span>
<div class="pr fl projectName">
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
<%= link_to student_work.project.name, project_path(student_work.project.id), :class => 'link-blue fl hidden', :style => "max-width:200px;", :title => "项目名称", :target => "_blank" %>
<% elsif User.current.allowed_to?(:as_teacher, @homework.course) %>
<%= link_to student_work.project.name, applied_join_project_path(:object_id => student_work.project.id, :is_teacher => 1), :remote => true, :method => "post", :class => 'link-blue fl hidden', :style => "max-width:200px;", :title => "项目名称" %>
<% else %>
<span class="fontBlue fr hidden" style="max-width:200px;" title="该项目是私有的"><%= student_work.project.name %></span>
<% end %>
<% project = student_work.project %>
<div class="score-tip none tl f12" style="width:300px; top:-48px; right:-930px;">
<em style="bottom:45px;"></em>
<font style="bottom:45px;"></font>
<div class="pr">
<span class="fl ml25 fontGrey2">关联项目:</span>
<div class="fl projectName">
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
<%= link_to student_work.project.name, project_path(student_work.project.id), :class => 'link-blue fl hidden', :style => "max-width:550px;", :title => "项目名称", :target => "_blank" %>
<% elsif User.current.allowed_to?(:as_teacher, @homework.course) %>
<%= link_to student_work.project.name, applied_join_project_path(:object_id => student_work.project.id, :is_teacher => 1), :remote => true, :method => "post", :class => 'link-blue fl hidden', :style => "max-width:550px;", :title => "项目名称" %>
<% else %>
<span class="fontBlue fr hidden" style="max-width:550px;" title="该项目是私有的"><%= student_work.project.name %></span>
<% end %>
<% project = student_work.project %>
<div class="score-tip none tl f12" style="width:300px; top:-48px; right:-372px;">
<em style="bottom:45px;"></em>
<font style="bottom:45px;"></font>
<p class="fb"><%= project.name %></p>
<p class="fb break_word mw280"><%= project.name %></p>
<p class="mb10">
<span class="mr15">创建者:<%= project.creater %></span><span>成员数量:<%= project.members.count %></span></p>
<% project_score = project.project_score %>
<p>项目综合得分:<%= static_project_score(project_score).to_i %></p>
<p class="mb10">
<span class="mr15">创建者:<%= project.creater %></span><span>成员数量:<%= project.members.count %></span></p>
<% project_score = project.project_score %>
<p>项目综合得分:<%= static_project_score(project_score).to_i %></p>
<p>= 代码提交得分 + issue得分 + 资源得分 + 帖子得分</p>
<p>= 代码提交得分 + issue得分 + 资源得分 + 帖子得分</p>
<p>= <%= (project_score.changeset_num||0) * 4 %>
+ <%= project_score.issue_num * 4 + project_score.issue_journal_num %> + <%= project_score.attach_num * 5 %>
+ <%= project_score.board_num * 2 + project_score.board_message_num + project_score.news_num %></p>
</div>
<p>= <%= (project_score.changeset_num||0) * 4 %>
+ <%= project_score.issue_num * 4 + project_score.issue_journal_num %> + <%= project_score.attach_num * 5 %>
+ <%= project_score.board_num * 2 + project_score.board_message_num + project_score.news_num %></p>
</div>
</div>
</div>
<% end %>
<div class="cl"></div>

View File

@ -1,5 +1,5 @@
<div class="fl pr" style="padding-bottom:10px; width:720px;">
<span class="c_dark f14 fb fl mr15">
<span class="c_dark f14 fb fl mr10">
作品
<font class="f12 c_red">
<% if @homework.homework_type == 3 %>
@ -27,16 +27,16 @@
<% end %>
</span>
<%if @is_teacher || @homework.homework_detail_manual.comment_status == 3 || @homework.is_open == 1%>
<div class="hworkSearchBox mr15">
<div class="hworkSearchBox mr10">
<input type="text" id="course_student_name" value="<%= @name%>" placeholder="姓名、学号、邮箱" class="hworkSearchInput" onkeypress="SearchByName('<%= student_work_index_path(:homework => @homework.id)%>',event);"/>
<a class="hworkSearchIcon" id="search_in_student_work" onclick="SearchByName_1('<%= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)"></a>
</div>
<%= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit fl mr20"}) unless course_group_list(@course).empty? %>
<%= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit fl mr10"}) unless course_group_list(@course).empty? %>
<%if @homework.homework_type == 2 && @is_teacher %>
<%= link_to "代码查重", work_canrepeat_student_work_index_path(homework:@homework.id, course_id:@course.id), class: 'BlueCirBtn fl',:remote => true %>
<% end %>
<% end%>
<% if @homework.homework_type == 3 && my_work && my_work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") %>
<% if !@is_teacher && @homework.homework_type == 3 && my_work && my_work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") %>
<div class="mt5 fr">
<a href="javascript:void(0);" class="memberBtn fl mt3" title="添加小组成员" onclick="add_or_delete_group_member();">合作成员</a>
</div>

View File

@ -8,7 +8,7 @@ $('#score_<%= @work.id%>').peSlider({range: 'min'});
//$("#work_score_<%#= @score.id%>").html("<%#= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @new_score,:is_last => @is_last}) %>");
<%# end%>
$("#score_list_<%= @work.id%>").replaceWith("<%=escape_javascript(render :partial => 'student_work_score_records', :locals => {:student_work_scores => @student_work_scores, :is_member_work => is_member_work}) %>");
$("#score_list_<%= @work.id%>").html("<%=escape_javascript(render :partial => 'student_work_score_records', :locals => {:student_work_scores => @student_work_scores, :is_member_work => is_member_work}) %>");
var num = $("#work_num_<%= @work.id%>").html();
$("#score_list_<%= @work.id%>").removeAttr("style");

View File

@ -29,7 +29,7 @@
</ul>
<div id="sy_tab_con_1">
<% if User.current == @syllabus.user && @syllabus.courses.empty? %>
<p class="nodata c_red">您还没有创建班级,只有<%= link_to "创建班级", new_course_path(:host=> Setting.host_course, :syllabus_id => @syllabus.id), :class => "linkBlue2", :target => '_blank'%>后才可以开展在线教学哦~</p>
<p class="nodata c_red">您还没有创建班级,只有 <%= link_to "创建班级", new_course_path(:host=> Setting.host_course, :syllabus_id => @syllabus.id), :class => "linkBlue2", :target => '_blank'%> 后才可以开展在线教学哦~</p>
<% end %>
<% if @syllabus.des_status == 0 && User.current == @syllabus.user %>
<div class="icons_tishi"><img src="../images/sy/icons_tan.png" width="110" height="110" alt="" ></div>

View File

@ -1,4 +1,4 @@
<div class="hw_popup_box" style="padding-bottom:30px;">
<div class="hw_popup_box" style="width: 820px; padding-bottom:30px;">
<div class="hw_popup_top clear">
<a href="javascript:void(0);" class="hw_icons_close fr" style="outline: none;" onclick="hideModal()"></a>
</div>

View File

@ -1,4 +1,4 @@
<div class="hw_sendpopup_box">
<div class="hw_sendpopup_box" style="width: 460px;">
<div class="hw_sendpopup_top">
<h3 class="fl">发送</h3>
<a href="javascript:void(0);" class="hw_sendpopup_close fr" onclick="hideModal()"></a>

View File

@ -424,18 +424,19 @@ function showModal(id, width) {
function hideModal(el) {
if($("#popupWrap").length > 0){
$("#popupWrap").hide();
$("#popupWrap").remove();
}
var modal;
if (el) {
modal = $(el).parents('.ui-dialog-content');
} else {
modal = $('#ajax-modal');
}
if(modal != null){
else{
var modal;
if (el) {
modal = $(el).parents('.ui-dialog-content');
} else {
modal = $('#ajax-modal');
}
modal.dialog("close");
}
}
function submitPreview(url, form, target) {

View File

@ -583,6 +583,6 @@ a:hover.blueCir{ background:#3598db; color:#fff;}
.ye_tips_box_inner em { display: block; border-width: 10px;position: absolute;top: 42px; left: -20px; border-style: dashed solid dashed dashed;border-color: transparent #F3DDB3 transparent transparent;font-size: 0;line-height: 0;}
/*分组作业评分提示框*/
.group_work_tip_box {width:200px; position:absolute; padding:5px 10px; white-space:nowrap; background-color:#fff; right:-255px; top:-10px; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);}
.group_work_tip_box {width:200px; position:absolute; padding:5px 10px; white-space:nowrap; background-color:#fff; right:-255px; top:-90px; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);}
.group_work_tip_box em {display:block; border-width:10px; position:absolute;top:26px; left:-20px; border-style:dashed solid dashed dashed; border-color:transparent #eaeaea transparent transparent; font-size:0; line-height:0;}
.group_work_tip_box span {display:block; border-width:10px; position:absolute;top:26px; left:-18px; border-style:dashed solid dashed dashed; border-color:transparent #fff transparent transparent; font-size:0; line-height:0;}

View File

@ -3,12 +3,12 @@
.muban_popup_top{background:#3b94d6;height:40px;-webkit-border-radius: 5px 5px 0px 0px;-moz-border-radius: 5px 5px 0px 0px;-o-border-radius: 5px 5px 0px 0px;border-radius: 5px 5px 0px 0px;}
.muban_popup_top h3{ font-size:16px; color:#fff; font-weight:normal; line-height:40px; padding-left:10px; }
a.muban_icons_close{width:20px; height:20px;display:block;background: url(/images/sy/sy_icons_close.png) 0 0px no-repeat; margin:8px 10px 0 0;}
a:hover.muban_icons_close{background: url(../images/sy/sy_icons_close.png) -40px 0px no-repeat;}
a:hover.muban_icons_close{background: url(/images/sy/sy_icons_close.png) -40px 0px no-repeat;}
#muban_popup_box input,#muban_popup_box select{ border:1px solid #c8c8c8; height: 28px; color: #888;}
#muban_popup_box label.pop_box_label{width: 100px; text-align: right; display: inline-block;}
input.radio-width90{ width: 90px; }
#muban_popup_box input,#muban_popup_box select{ border:1px solid #c8c8c8; height: 28px; color: #888;}
#muban_popup_box label{width: 100px; text-align: right; display: inline-block;}
#muban_popup_box label.pop_box_label {width: 100px; text-align: right; display: inline-block;}
/*模板表格 20161013byLB*/
.muban_table{ width:100%; background:#fff; border:1px solid #e5e5e5; border-bottom: none; }
.muban_table thead tr{ height:40px; line-height:40px;}