分组作业可对组员单独评分
This commit is contained in:
parent
e4efc8c302
commit
6f4618fffb
|
@ -844,17 +844,29 @@ class StudentWorkController < ApplicationController
|
|||
render_attachment_warning_if_needed(@new_score)
|
||||
|
||||
if @new_score.save
|
||||
if @homework.homework_type == 3
|
||||
@is_group_leader = !@work.student_work_projects.empty?
|
||||
end
|
||||
case @new_score.reviewer_role
|
||||
when 1 #教师评分:最后一个教师评分为最终评分
|
||||
@work.teacher_score = @new_score.score
|
||||
if @is_group_leader
|
||||
add_score_to_member @work, @homework, 1, 'teacher_score', @new_score.score
|
||||
end
|
||||
when 2 #教辅评分 教辅评分显示平均分
|
||||
#@work.teaching_asistant_score = @work.student_works_scores.where(:reviewer_role => 2).average(:score).try(:round, 2).to_f
|
||||
ts_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@work.id} AND reviewer_role = 2 AND score IS NOT NULL ORDER BY created_at DESC) AS t GROUP BY user_id) AS a")
|
||||
@work.teaching_asistant_score = ts_score.first.score.nil? ? nil : ts_score.first.score.try(:round, 2).to_f
|
||||
if @is_group_leader
|
||||
add_score_to_member @work, @homework, 2, 'teaching_asistant_score', @work.teaching_asistant_score
|
||||
end
|
||||
when 3 #学生评分 学生评分显示平均分
|
||||
#@work.student_score = @work.student_works_scores.where(:reviewer_role => 3).average(:score).try(:round, 2).to_f
|
||||
stu_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@work.id} AND reviewer_role = 3 ORDER BY created_at DESC) AS t GROUP BY user_id) AS a")
|
||||
@work.student_score = stu_score.first.score.try(:round, 2).to_f
|
||||
if @is_group_leader
|
||||
add_score_to_member @work, @homework, 3, 'student_score', @work.student_score
|
||||
end
|
||||
end
|
||||
@homework.update_column('updated_at', Time.now)
|
||||
update_course_activity(@homework.class,@homework.id)
|
||||
|
@ -1577,10 +1589,6 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
end
|
||||
end
|
||||
if homework.homework_type == 3
|
||||
student_works = group_student_works student_work, homework
|
||||
student_works.update_all(:final_score => student_work.final_score,:teacher_score => student_work.teacher_score,:student_score => student_work.student_score,:teaching_asistant_score => student_work.teaching_asistant_score,:work_score => student_work.work_score)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -165,4 +165,13 @@ module StudentWorkHelper
|
|||
student_works = homework.student_works.where("user_id in #{user_ids}")
|
||||
return student_works
|
||||
end
|
||||
|
||||
def add_score_to_member student_work, homework, role, score_type, score
|
||||
student_works = group_student_works student_work, homework
|
||||
student_works.each do |st_work|
|
||||
if st_work.student_works_scores.where("reviewer_role = #{role} and score is not null").empty?
|
||||
st_work.update_attribute("#{score_type}", score)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -170,12 +170,6 @@ class StudentWork < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
end
|
||||
if homework.homework_type == 3
|
||||
pros = student_work.student_work_projects.where("is_leader = 0")
|
||||
user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")"
|
||||
student_works = homework.student_works.where("user_id in #{user_ids}")
|
||||
student_works.update_all(:final_score => student_work.final_score,:teacher_score => student_work.teacher_score,:student_score => student_work.student_score,:teaching_asistant_score => student_work.teaching_asistant_score,:work_score => student_work.work_score)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<div class="syllabus_courses_box">
|
||||
<% @stundet_works.each_with_index do |student_work, i| %>
|
||||
<div class="syllabus_courses_list" id="student_work_<%= student_work.id%>">
|
||||
<%= render :partial => 'evaluation_un_group_work', :locals => {:student_work => student_work} %>
|
||||
</div>
|
||||
<div id="about_hwork_<%= student_work.id %>"></div>
|
||||
|
||||
<div id="group_member_work_<%= student_work.id%>">
|
||||
<%= render :partial => 'group_member_work', :locals => {:student_work => student_work} %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
|
@ -0,0 +1,82 @@
|
|||
<ul id="syllabus_course_ul">
|
||||
<li class="syllabus_class_list " style="line-height:44px; vertical-align:middle;">
|
||||
<div class="syllabus_class_w fontGrey3">
|
||||
<%= link_to(image_tag(url_to_avatar(st.user),:width =>"40",:height => "40"),user_activities_path(st.user), :class => "fl") %>
|
||||
<% if !st.student_work_projects.empty? %>
|
||||
<span class="fl student_work_<%= st.id%>" style="width:135px;">
|
||||
<span class="fl hidden ml5" style="max-width:90px;"><%= st.user.show_name %></span>
|
||||
<span class="fl">(组长)</span>
|
||||
</span>
|
||||
<span class="fl mr15 hidden student_work_<%= st.id%>" style="width:90px;">
|
||||
<span class="fontGrey2">学号</span>:<%= st.user.user_extensions.nil? ? "--" : st.user.user_extensions.student_id%>
|
||||
</span>
|
||||
<% else %>
|
||||
<span class="fl student_work_<%= st.id%>" style="width:135px; cursor: pointer;" onclick="show_student_work('<%= student_work_path(st)%>');">
|
||||
<span class="fl hidden ml5" style="max-width:90px;"><%= st.user.show_name %></span>
|
||||
</span>
|
||||
<span class="fl student_work_<%= st.id%> mr15 hidden" style="width:90px; cursor: pointer;" onclick="show_student_work('<%= student_work_path(st)%>');">
|
||||
<span class="fontGrey2">学号</span>:<%= st.user.user_extensions.nil? ? "--" : st.user.user_extensions.student_id%>
|
||||
</span>
|
||||
<% end %>
|
||||
<div class="flex-container fl" style="width:365px;">
|
||||
<div class="flex-cell"><span class="<%= score_color st.teacher_score%> ml35"><%= st.teacher_score.nil? ? "--" : format("%.1f",st.teacher_score)%></span></div>
|
||||
<div class="flex-cell"><span class="<%= score_color st.teaching_asistant_score%> ml35"><%= st.teaching_asistant_score.nil? ? "--" : format("%.1f",st.teaching_asistant_score)%></span></div>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
<div class="flex-cell">
|
||||
<div class="<%= score_color st.student_score%> student_score_info ml35">
|
||||
<% if st.student_score.nil? %>
|
||||
<span title="该作品未被匿评">未参与</span>
|
||||
<% else %>
|
||||
<%= format("%.1f", st.student_score) %>
|
||||
<% end %>
|
||||
<% unless st.student_score.nil? %>
|
||||
<span class="linkBlue">
|
||||
(<%= anon_count %>)
|
||||
</span>
|
||||
<div class="g_infoNi none">
|
||||
现共有
|
||||
<span class="c_red"> <%= anon_count %> </span>
|
||||
名学生进行了匿评,平均分为
|
||||
<span class="c_red"> <%= format("%.1f", st.student_score) %> </span>分。
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="flex-cell">
|
||||
<% score = st.work_score %>
|
||||
<div class="<%= score_color score%> student_final_scor_info ml35" style="display: inline">
|
||||
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
|
||||
<% unless score.nil?%>
|
||||
<div class="g_infoNi none width180">
|
||||
作品最终评分为
|
||||
<span class="c_red"> <%= st.final_score%> </span>分。
|
||||
迟交扣分
|
||||
<span class="c_red">
|
||||
<%= st.homework_common && st.homework_common.teacher_priority == 1 && st.teacher_score ? 0 : st.late_penalty %>
|
||||
</span>分,
|
||||
缺评扣分
|
||||
<span class="c_red">
|
||||
<%= st.homework_common && st.homework_common.teacher_priority == 1 && st.teacher_score ? 0 : st.absence_penalty%>
|
||||
</span>分,
|
||||
最终成绩为
|
||||
<span class="c_red"> <%= format("%.1f",score<0 ? 0 : score)%> </span>分。
|
||||
</div>
|
||||
<% end%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<div style="position:relative;"><div class="hworkTip" style="display: none" id="work_click_<%= st.id%>"><em></em><span></span><font class="fontGrey2"><%= !st.student_work_projects.empty? ? '大作品评分即组长的评分' : '点击查看详情' %></font></div></div>
|
||||
</ul>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(".student_work_<%= st.id%>").mouseenter(function(){
|
||||
if($("#about_hwork_<%= st.id%>").html().trim() == "") {
|
||||
$("#work_click_<%= st.id%>").show();
|
||||
}
|
||||
}).mouseleave(function(){
|
||||
$("#work_click_<%= st.id%>").hide();
|
||||
}).mouse;
|
||||
</script>
|
|
@ -1,89 +1,73 @@
|
|||
<tr class="hworkListRow" id="student_work_<%= student_work.id%>">
|
||||
<td class="none"><a name="<%= student_work.id%>"></a></td>
|
||||
<td class="hworkList40 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
|
||||
<td class="hworkPortrait pr10 float-none">
|
||||
<%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(student_work.user)) %>
|
||||
</td>
|
||||
<% if @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> width130" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||
<div>
|
||||
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
|
||||
</div>
|
||||
</td>
|
||||
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
|
||||
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkPrName2' : 'hworkPrName'%> student_work_<%= student_work.id%>" title="项目名称">
|
||||
<%= link_to( student_work.project.name, project_path(student_work.project.id))%>
|
||||
</td>
|
||||
<% else %>
|
||||
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkPrName2' : 'hworkPrName'%> student_work_<%= student_work.id%>" title="该项目是私有的">
|
||||
<%= student_work.project.name %>
|
||||
</td>
|
||||
<% end %>
|
||||
<% elsif @homework.homework_detail_group.base_on_project == 0 %>
|
||||
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> <%=@homework.anonymous_comment == 1 ? 'width280' : 'width210' %>" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||
<div>
|
||||
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
|
||||
</div>
|
||||
</td>
|
||||
<% end %>
|
||||
<td class="hworkList130 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<% if student_work.created_at && @homework.end_time%>
|
||||
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">[迟交]</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="hworkList70 <%= score_color student_work.teacher_score%>">
|
||||
<%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%>
|
||||
</td>
|
||||
<td class="hworkList70 <%= score_color student_work.teaching_asistant_score%>">
|
||||
<%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%>
|
||||
</td>
|
||||
<% if @homework.anonymous_comment == 0%>
|
||||
<td class="hworkList70 <%= score_color student_work.student_score%> student_score_info">
|
||||
<% if student_work.student_score.nil? %>
|
||||
<span title="该作品未被匿评">未参与</span>
|
||||
<% else %>
|
||||
<%=format("%.1f",student_work.student_score) %>
|
||||
<% end %>
|
||||
<% unless student_work.student_score.nil?%>
|
||||
<span class="linkBlue">
|
||||
(<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>)
|
||||
<div class="sy_courses_open f14 fontGrey3">
|
||||
<span class="icons_sy_open fl mr5" title="点击展开/收起详情"></span>
|
||||
<span class="fl" style="width:280px;">
|
||||
<span class="hidden fl" style="max-width:240px;"><%=student_work.name %></span>
|
||||
<span class="fontGrey2 ml5 fl">
|
||||
<% if student_work.work_status%>
|
||||
<%=get_status student_work.work_status %>
|
||||
<% end %>
|
||||
</span>
|
||||
<div class="infoNi none">
|
||||
现共有
|
||||
<span class="c_red"> <%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%> </span>
|
||||
名学生进行了匿评,平均分为
|
||||
<span class="c_red"> <%= format("%.1f",student_work.student_score)%> </span>分。
|
||||
</span>
|
||||
<% if @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<span class="ml15 fl">关联项目:</span>
|
||||
<% 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 => "width:200px;", :title => "项目名称"%>
|
||||
<% else %>
|
||||
<span class="fontBlue fl hidden" style="width:200px;" title="该项目是私有的"><%= student_work.project.name %></span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<a href="javascript:void(0)" onclick="show_student_work('<%= student_work_path(student_work)%>');" class="link-blue fr">评分</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="fl sy_p_grey">
|
||||
<span class="fl" style="width:296px;">提交时间:<%=format_date(student_work.commit_time) %></span>
|
||||
<div class="flex-container fl" style="width:368px;">
|
||||
<div class="flex-cell">教师:<span class="<%= score_color student_work.teacher_score%>"><%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%></span></div>
|
||||
<div class="flex-cell">助教:<span class="<%= score_color student_work.teaching_asistant_score%>"><%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%></span></div>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
<div class="flex-cell">匿评:
|
||||
<div class="<%= score_color student_work.student_score%> student_score_info" style="display: inline">
|
||||
<% if student_work.student_score.nil? %>
|
||||
<span title="该作品未被匿评">未参与</span>
|
||||
<% else %>
|
||||
<%= format("%.1f", student_work.student_score) %>
|
||||
<% end %>
|
||||
<% unless student_work.student_score.nil? %>
|
||||
<span class="linkBlue">
|
||||
(<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>)
|
||||
</span>
|
||||
<div class="g_infoNi none">
|
||||
现共有
|
||||
<span class="c_red"> <%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %> </span>
|
||||
名学生进行了匿评,平均分为
|
||||
<span class="c_red"> <%= format("%.1f", student_work.student_score) %> </span>分。
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="flex-cell">成绩:
|
||||
<% score = student_work.work_score %>
|
||||
<div class="<%= score_color score%> student_final_scor_info" style="display: inline">
|
||||
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
|
||||
<% unless score.nil?%>
|
||||
<div class="g_infoNi none width180">
|
||||
作品最终评分为
|
||||
<span class="c_red"> <%= student_work.final_score%> </span>分。
|
||||
迟交扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %>
|
||||
</span>分,
|
||||
缺评扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty%>
|
||||
</span>分,
|
||||
最终成绩为
|
||||
<span class="c_red"> <%= format("%.1f",score<0 ? 0 : score)%> </span>分。
|
||||
</div>
|
||||
<% end%>
|
||||
</td>
|
||||
<% end %>
|
||||
<!-- 成绩 -->
|
||||
<% if student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : student_work.teacher_score %>
|
||||
<% else %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty%>
|
||||
<% end %>
|
||||
<td class="hworkList70 <%= score_color score%> student_final_scor_info">
|
||||
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
|
||||
<% unless score.nil?%>
|
||||
<div class="infoNi none width180">
|
||||
作品最终评分为
|
||||
<span class="c_red"> <%= student_work.final_score%> </span>分。
|
||||
迟交扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %>
|
||||
</span>分,
|
||||
缺评扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty%>
|
||||
</span>分,
|
||||
最终成绩为
|
||||
<span class="c_red"> <%= format("%.1f",score<0 ? 0 : score)%> </span>分。
|
||||
</div>
|
||||
<% end%>
|
||||
</td>
|
||||
<td><div style="position:relative;"><div class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></div></div></td>
|
||||
</tr>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
|
@ -0,0 +1,11 @@
|
|||
<% user_ids = student_work.student_work_projects.empty? ? "(-1)" : "(" + student_work.student_work_projects.map{|st| st.user_id}.join(",") + ")" %>
|
||||
<% student_work_groups = @homework.student_works.where("user_id in #{user_ids}").order("created_at asc") %>
|
||||
<% anon_count = student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>
|
||||
<% student_work_groups.each_with_index do |st, j| %>
|
||||
<div class="syllabus_class_box" id="student_work_<%= st.id%>">
|
||||
<%= render :partial => 'evaluation_un_group_member_work', :locals => {:st => st, :anon_count => anon_count} %>
|
||||
</div>
|
||||
<% if j != 0 %>
|
||||
<div id="about_hwork_<%= st.id %>"></div>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -0,0 +1,145 @@
|
|||
<div class="show_hwork_arrow"></div>
|
||||
<div class="showHwork">
|
||||
<% is_teacher = User.current.allowed_to?(:as_teacher, @homework.course) || User.current.admin? %>
|
||||
<% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
|
||||
<% is_my_work = pro && pro.student_work_id == work.id%>
|
||||
<ul>
|
||||
<li class="fl" >
|
||||
<span class="tit_fb">上交时间:</span>
|
||||
<%=format_time work.created_at %>
|
||||
</li>
|
||||
|
||||
<% if work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") %>
|
||||
<!-- 我的作业 && 匿评作业 && 未开启匿评,显示编辑和删除按钮 -->
|
||||
<li class="fr" >
|
||||
<%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del",:title=>"删除") %>
|
||||
</li>
|
||||
<li class="fr mr5" >
|
||||
<%= link_to "",edit_student_work_path(work),:class => "pic_edit",:title => "修改"%>
|
||||
</li>
|
||||
<% end%>
|
||||
<% if @homework.homework_detail_manual.comment_status == 3 && !is_my_work %>
|
||||
<!-- 匿评结束阶段,显示点赞按钮 -->
|
||||
<li class="fr" id="student_work_praise_<%= work.id%>">
|
||||
<%= render :partial => 'student_work_praise',:locals => {:work => work} %>
|
||||
</li>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
|
||||
<!--<li ><span class="tit_fb"> 参与人员:</span>程梦雯 王强</li>-->
|
||||
|
||||
<% if work.student_work_projects && (@homework.homework_detail_manual.comment_status != 2 || is_my_work || is_teacher ) %>
|
||||
<div class="cl"></div>
|
||||
<li>
|
||||
<span class="tit_fb"> 参与人员:</span>
|
||||
<%= link_to(work.user.show_name+"(组长)", user_path(work.user.id), :class => "linkBlue" )%>
|
||||
<% members = work.student_work_projects.where("is_leader = 0") %>
|
||||
<% members.each do |member| if !members.empty? %>
|
||||
、<%=link_to((User.find member.user_id).show_name, user_path(member.user.id), :class => "linkBlue" ) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
<% if @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<li>
|
||||
<span class="tit_fb"> 关联项目:</span>
|
||||
<% if work.project_id == 0 || work.project_id.nil? %>
|
||||
<span>暂无</span>
|
||||
<% elsif work.project.is_public || User.current.member_of?(work.project) || User.current.admin? %>
|
||||
<%= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
|
||||
<span class="ml5">(综合评分:<font class="c_red"><%=static_project_score(work.project.project_score).to_i %></font>)</span>
|
||||
<% else %>
|
||||
<span title ="该项目是私有的"><%=work.project.name %></span>
|
||||
<span class="ml5">(综合评分:<font class="c_red"><%=static_project_score(work.project.project_score).to_i %></font>)</span>
|
||||
<% end %>
|
||||
<%#= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
|
||||
</li>
|
||||
<% end %>
|
||||
<li >
|
||||
<span class="tit_fb ">内容:</span>
|
||||
<div class="showHworkP break_word upload_img" id="student_work_img_<%=work.id %>">
|
||||
<%= work.description.html_safe if work.description%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<span class="tit_fb"> 附件:</span>
|
||||
<% com_attachments = work.attachments.where("attachtype IS NULL OR attachtype <> 7") %>
|
||||
<% if com_attachments.empty?%>
|
||||
<span style="color: #999999">尚未提交附件</span>
|
||||
<% else%>
|
||||
<div class="fl" style="width: 90%;">
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => com_attachments, :status => @homework.homework_detail_manual.comment_status} %>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end%>
|
||||
|
||||
<li>
|
||||
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%>
|
||||
<!-- 老师 || 开启匿评状态 && 不是当前用户自己的作品 -->
|
||||
<div id="add_student_score_<%= work.id%>" class="mt10 evaluation">
|
||||
<%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="revise_attachment">
|
||||
<%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
|
||||
<%student_work_scores.each do |student_score|%>
|
||||
<div id="work_score_<%= student_score.id%>">
|
||||
<%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
|
||||
</div>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<!---ping_box end--->
|
||||
<a href="javascript:void(0);" class="linkBlue mt5 mb5" style="margin-left:auto; margin-right: auto; display:block; width: 24px;" onclick="$('#about_hwork_<%= work.id%>').html('');">收起</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('student_work_img_<%=work.id %>');
|
||||
<% if defined?(is_focus) && is_focus.to_i == 1 %>
|
||||
$("#upload_revise_attachment").click();
|
||||
<% end %>
|
||||
});
|
||||
function show_upload(){
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>');
|
||||
showModal('ajax-modal', '452px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","46%");
|
||||
$('#ajax-modal').parent().addClass("resourceUploadPopup");
|
||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||
}
|
||||
function regex_des() {
|
||||
if ($.trim($("#attachment_des").val()) == "") {
|
||||
$("#hint_message").text("附件描述不能为空");
|
||||
$("#hint_message").css('color','#ff0000');
|
||||
return false;
|
||||
} else {
|
||||
$("#hint_message").text("");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
function submit_revise_files(){
|
||||
if (regex_des()) {
|
||||
$("#upload_form").submit();
|
||||
}
|
||||
}
|
||||
function closeModal(){
|
||||
hideModal($(".uploadBoxContainer"));
|
||||
}
|
||||
function disable_choose(){
|
||||
if ($("#attachments_fields .attachment").size() >= 1) {
|
||||
$("#choose_revise_attach").attr("onclick","return false;").addClass(disable_link);
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -7,6 +7,8 @@
|
|||
<% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
|
||||
<% is_my_work = pro && pro.student_work_id == work.id%>
|
||||
<% end %>
|
||||
<% is_member_work = @homework.homework_type == 3 && work.student_work_projects.empty? %>
|
||||
<% if !is_member_work %>
|
||||
<ul>
|
||||
<li class="fl" >
|
||||
<span class="tit_fb">上交时间:</span>
|
||||
|
@ -31,8 +33,7 @@
|
|||
<div class="cl"></div>
|
||||
|
||||
<!--<li ><span class="tit_fb"> 参与人员:</span>程梦雯 王强</li>-->
|
||||
|
||||
<% if @homework.homework_type == 3 && work.student_work_projects && (@homework.homework_detail_manual.comment_status != 2 || is_my_work || is_teacher ) %>
|
||||
<% if @homework.homework_type == 3 && work.student_work_projects && (@homework.homework_detail_manual.comment_status != 2 || is_my_work || is_teacher ) %>
|
||||
<div class="cl"></div>
|
||||
<li>
|
||||
<span class="tit_fb"> 参与人员:</span>
|
||||
|
@ -58,42 +59,55 @@
|
|||
<%#= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end%>
|
||||
<% end%>
|
||||
|
||||
<li >
|
||||
<span class="tit_fb ">内容:</span>
|
||||
<div class="showHworkP break_word upload_img" id="student_work_img_<%=work.id %>">
|
||||
<%= work.description.html_safe if work.description%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<span class="tit_fb"> 附件:</span>
|
||||
<% com_attachments = work.attachments.where("attachtype IS NULL OR attachtype <> 7") %>
|
||||
<% if com_attachments.empty?%>
|
||||
<li>
|
||||
<span class="tit_fb ">内容:</span>
|
||||
<div class="showHworkP break_word upload_img" id="student_work_img_<%=work.id %>">
|
||||
<%= work.description.html_safe if work.description%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li>
|
||||
<span class="tit_fb"> 附件:</span>
|
||||
<% com_attachments = work.attachments.where("attachtype IS NULL OR attachtype <> 7") %>
|
||||
<% if com_attachments.empty?%>
|
||||
<span style="color: #999999">尚未提交附件</span>
|
||||
<% else%>
|
||||
<% else%>
|
||||
<div class="fl" style="width: 90%;">
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => com_attachments, :status => @homework.homework_detail_manual.comment_status} %>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%>
|
||||
<!-- 老师 || 开启匿评状态 && 不是当前用户自己的作品 -->
|
||||
<div id="add_student_score_<%= work.id%>" class="mt10 evaluation">
|
||||
<%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="revise_attachment">
|
||||
<%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% else %>
|
||||
<ul>
|
||||
<li >
|
||||
<% if @is_teacher %>
|
||||
<!-- 老师 -->
|
||||
<div id="add_student_score_<%= work.id%>" class="mt10 evaluation">
|
||||
<%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
|
||||
<%student_work_scores.each do |student_score|%>
|
||||
|
@ -101,6 +115,9 @@
|
|||
<%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
|
||||
</div>
|
||||
<% end%>
|
||||
<% if is_member_work && student_work_scores.empty? %>
|
||||
<p class="c_red" style="text-align: center">暂无评分</p>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<!---ping_box end--->
|
||||
|
|
|
@ -36,11 +36,19 @@
|
|||
<div class="cl"></div>
|
||||
|
||||
<div class="fl">
|
||||
<% if @is_evaluation && !@stundet_works.empty?%>
|
||||
<%= render :partial => "evaluation_title"%>
|
||||
<% else%>
|
||||
<%= render :partial => "evaluation_un_title"%>
|
||||
<% end%>
|
||||
<% if @homework.homework_type != 3%>
|
||||
<% if @is_evaluation && !@stundet_works.empty? %>
|
||||
<%= render :partial => "evaluation_title"%>
|
||||
<% else%>
|
||||
<%= render :partial => "evaluation_un_title"%>
|
||||
<% end%>
|
||||
<% else %>
|
||||
<% if !@is_teacher && @is_evaluation && !@stundet_works.empty? %>
|
||||
<%= render :partial => "evaluation_title"%>
|
||||
<% else %>
|
||||
<%= render :partial => "evaluation_un_group"%>
|
||||
<% end%>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
|
|
|
@ -11,8 +11,18 @@ var num = $("#work_num_<%= @work.id%>").html();
|
|||
$("#score_list_<%= @work.id%>").removeAttr("style");
|
||||
|
||||
<% if @is_teacher %>
|
||||
$("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_un_work',:locals => {:student_work => @work, :index => 1}) %>");
|
||||
$("#work_num_<%= @work.id%>").html(num);
|
||||
<% if @homework.homework_type == 3 %>
|
||||
<% if @is_group_leader %>
|
||||
$("#student_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'evaluation_un_group_work', :locals => {:student_work => @work}) %>");
|
||||
$("#group_member_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'group_member_work', :locals => {:student_work => @work}) %>");
|
||||
<% else %>
|
||||
<% anon_count = @work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>
|
||||
$("#student_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'evaluation_un_group_member_work', :locals => {:st => @work, :anon_count => anon_count}) %>");
|
||||
<% end %>
|
||||
<% else %>
|
||||
$("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_un_work',:locals => {:student_work => @work, :index => 1}) %>");
|
||||
$("#work_num_<%= @work.id%>").html(num);
|
||||
<% end %>
|
||||
<% else %>
|
||||
$("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work, :index => 1}) %>");
|
||||
$("#work_num_<%= @work.id%>").html(num);
|
||||
|
|
|
@ -234,6 +234,7 @@ a.hworkExport {background:url(/images/homepage_icon2.png) -10px -401px no-repeat
|
|||
a.hworkSetting {background:url(/images/homepage_icon2.png) -10px -450px no-repeat; padding-left:23px;}
|
||||
.hworkInfor {font-size:12px; color:#269ac9; width:80px; height:40px; vertical-align:middle; float:left; line-height:40px; text-align:center; font-weight:bold;}
|
||||
.infoNi{ width:100px; padding:5px;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left; line-height:2; position:absolute; margin-top:-24px;margin-left: 40px; z-index:99;}
|
||||
.g_infoNi{ width:100px; padding:5px;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left; line-height:2; position:absolute; margin-top:10px;margin-left: 80px; z-index:99;}
|
||||
.problemTxt {width:660px; margin-left:10px; color:#777777; position:relative;}
|
||||
.rTxtTit{width:560px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf; float:left; color:#269ac9; font-size:14px;}
|
||||
.hworkSearchBox {border:1px solid #e6e6e6; width:185px; float:left; background-color:#ffffff;}
|
||||
|
|
|
@ -1459,3 +1459,7 @@ a:hover.sy_btn_green{ background: #51a74f;}
|
|||
.invite_code_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;}
|
||||
.invite_code_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;}
|
||||
|
||||
/*flex布局*/
|
||||
.flex-container {display:flex;}
|
||||
.flex-cell {flex:1;}
|
||||
.flex-cell:last-child {text-align:right;}
|
||||
|
|
Loading…
Reference in New Issue