增加匿评时作品的显示

This commit is contained in:
sw 2015-09-17 09:20:35 +08:00
parent 939a010adb
commit 9a859d28bf
10 changed files with 106 additions and 315 deletions

View File

@ -77,6 +77,7 @@ class StudentWorkController < ApplicationController
@stundet_works = @homework.student_works
@homework_commons = @course.homework_commons.order("created_at desc")
@is_teacher = User.current.allowed_to?(:as_teacher,@course)
@is_evaluation = @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #是不是匿评
respond_to do |format|
format.html

View File

@ -1,47 +0,0 @@
<li class="hwork_num ">
<span class="c_dark f14 fb fl">学号</span>
</li>
<li class=" hwork_name f14 fb c_dark">
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% if @show_all && @order == "name"%>
<%= link_to "",student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>
<li class="hwork_tit">
<span class="c_dark f14 fb fl">作品名称</span>
</li>
<li class=" hwork_time f14 fb c_dark">
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% if @show_all && @order == "created_at"%>
<%= link_to "",student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>
<li class="mr5 w40 ml15">
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% if @show_all && @order == "teacher_score"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>
<li class="mr5 w40 ml20">
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% if @show_all && @order == "teaching_asistant_score"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>
<li class="ml15 w40">
<% if @homework.homework_type == 1%>
<%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% elsif @homework.homework_type == 2%>
<%= link_to "系统",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% end %>
<% if @show_all && @order == "student_score"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>
<li class="ml20">
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% if @show_all && @order == "score"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>

View File

@ -0,0 +1,8 @@
<ul class="hworkUl b_grey">
<li class="hworkList380 width620">
<span class="c_dark f14 fb fl ml10">作品信息</span>
</li>
<li class="hworkList80 mr10" >
<span class="c_dark f14 fb fl ml10">我的评分</span>
</li>
</ul>

View File

@ -0,0 +1,27 @@
<ul class="hworkUl b_grey">
<li class="hworkList380 <%= @homework.homework_type == 2 ? '' : 'width455'%>">
<span class="c_dark f14 fb fl ml10">作品信息</span>
</li>
<li class="hworkList80" >
<span class="c_dark f14 fb fl ml10">教师评分</span>
<a href="javascript:void(0);" class="st_up mt19" ></a>
</li>
<li class="hworkList80">
<span class="c_dark f14 fb fl ml10">教辅评分</span>
<a href="javascript:void(0);" class="st_up mt19" ></a>
</li>
<% if @homework.homework_type == 2%>
<li class="hworkList80">
<span class="c_dark f14 fb fl ml10">系统评分</span>
<a href="javascript:void(0);" class="st_up mt19" ></a>
</li>
<% end%>
<li class="hworkList50">
<span class="c_dark f14 fb fl ml5">匿评</span>
<a href="javascript:void(0);" class="st_up mt19" ></a>
</li>
<li class="hworkList50">
<span class="c_dark f14 fb fl ml5">成绩</span>
<a href="javascript:void(0);" class="st_down mt19" ></a>
</li>
</ul>

View File

@ -1,7 +1,29 @@
<!-- 匿评作品列表,显示某一个作品的信息 -->
<ul class="hwork_ul <%= cycle("b_grey", "") %>" id="student_work_<%= student_work.id%>">
<ul class="hworkListRow" id="student_work_<%= student_work.id%>">
<% is_my_work = student_work.user == User.current%>
<li class="hwork_num">
<li class="hworkList380 width620">
<ul>
<li class="hworkName mt12 m_width620">
<% if is_my_work%>
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14"%>
<% else%>
<%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14"%>
<% end%>
</li>
<div class="cl"></div>
<li>
<ul class="mt12">
<li class="hworkDetail mr15">
姓名:
<% if is_my_work%>
<%= student_work.user.show_name%>
<% else%>
匿名
<% end%>
</li>
<li class="hworkDetail mr15">
学号:
<% if is_my_work%>
<span>
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
@ -10,20 +32,20 @@
<span class="ml30">--</span>
<% end%>
</li>
<li class="hwork_name">
<% if is_my_work%>
<%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name, :class => "c_blue02" %>
<li class="hworkDate">
时间:
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>
<span class="c_red">迟交</span>
<% else%>
<%= link_to "匿名","javascript:void(0)", :class => "c_blue02"%>
<%= format_time student_work.created_at%>
<% end %>
</li>
<li class=" hwork_tit_e" style="width: 410px">
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? '匿名的作品' : student_work.name%>
<%= link_to student_work_name, student_work_path(student_work),:remote => true, :title => student_work.name, :class => "c_blue02"%>
</ul>
</li>
</ul>
</li>
<% my_score = student_work_score(student_work,User.current) %>
<li class=" hwork_code <%= my_score.nil? ? 'c_grey' : 'c_red'%>">
<%= my_score.nil? ? "--" : format("%.2f",my_score.score)%>
<li class="hworkList80 <%= my_score.nil? ? 'c_grey' : score_color(my_score.score)%> mr10">
<%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
</li>
<div class="cl"></div>
</ul><!---hwork_ul end-->
</ul>

View File

@ -1,12 +0,0 @@
<li class="hwork_num ">
<span class="f14 f_b c_dark fl ">学号</span>
</li>
<li class="hwork_name f14 fb c_dark">
<span class="c_dark f14 fb fl ">学生姓名</span>
</li>
<li class="hwork_tit_e">
<span class="c_dark f14 fb fl">作品名称</span>
</li>
<li class="w70 mr5" >
<%= link_to "我的评分","javascript:void(0)",:class => "c_dark f14 fb fl"%>
</li>

View File

@ -1,37 +0,0 @@
<li class="hwork_num ">
<span class="c_dark f14 fb fl">学号</span>
</li>
<li class=" hwork_name f14 fb c_dark">
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% if @show_all && @order == "name"%>
<%= link_to "",student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>
<li class="hwork_tit_une">
<span class="c_dark f14 fb fl">作品名称</span>
</li>
<li class=" hwork_time f14 fb c_dark">
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% if @show_all && @order == "created_at"%>
<%= link_to "",student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>
<li class="mr5 w40 ml15">
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% if @show_all && @order == "teacher_score"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>
<li class="mr5 w40 ml20">
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% if @show_all && @order == "teaching_asistant_score"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>
<li class="ml20">
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
<% if @show_all && @order == "score"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
<% end%>
</li>

View File

@ -1,11 +1,12 @@
<script type="text/javascript">
$(function(){
$("#RSide").removeAttr("id");
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
$("#Container").css("width","1000px");
});
// 匿评弹框提示
<% if @homework.homework_detail_manual.comment_status == 2 && !@is_teacher && @stundet_works.count > 1%>
<% if @is_evaluation && !@stundet_works.empty?%>
$(function(){
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/praise_alert') %>');
showModal('ajax-modal', '500px');
@ -19,7 +20,7 @@
</script>
<div class="homepageRight mt0 ml10">
<div class="resources">
<div class="resources" id="homework_page_right">
<div class="hworkListBanner">
<div id="menu_r" class="fl">
<ul class="menu_r">
@ -69,204 +70,29 @@
</div>
<!---code_list end--->
<div class="fl">
<ul class="hworkUl b_grey">
<li class="hworkList380">
<span class="c_dark f14 fb fl ml10">作品信息</span>
</li>
<li class="hworkList80" >
<span class="c_dark f14 fb fl ml10">教师评分</span>
<a href="javascript:void(0);" class="st_up mt19" ></a>
</li>
<li class="hworkList80">
<span class="c_dark f14 fb fl ml10">教辅评分</span>
<a href="javascript:void(0);" class="st_up mt19" ></a>
</li>
<li class="hworkList80">
<span class="c_dark f14 fb fl ml10">系统评分</span>
<a href="javascript:void(0);" class="st_up mt19" ></a>
</li>
<li class="hworkList50">
<span class="c_dark f14 fb fl ml5">匿评</span>
<a href="javascript:void(0);" class="st_up mt19" ></a>
</li>
<li class="hworkList50">
<span class="c_dark f14 fb fl ml5">成绩</span>
<a href="javascript:void(0);" class="st_down mt19" ></a>
</li>
</ul>
<% if @is_evaluation && !@stundet_works.empty?%>
<%= render :partial => "evaluation_title"%>
<% else%>
<%= render :partial => "evaluation_un_title"%>
<% end%>
</div>
<!---hwork_ul end--->
<div class="cl"></div>
<ul class="hworkListRow" >
<li class="hworkList380">
<ul>
<li class="hworkName mt12"><a href="javascript:void(0);" class="linkGrey f14">作品名称作品名称作品名称作品名称作品名称</a></li>
<li>
<ul class="mt12">
<li class="hworkDetail mr15">姓名:马克</li>
<li class="hworkDetail mr15">学号123456789</li>
<li class="hworkDate">时间2015-08-21 11:00</li>
</ul>
</li>
</ul>
</li>
<li class="hworkList80 c_red">90</li>
<li class="hworkList80 c_grey">--</li>
<li class="hworkList80 c_grey">--</li>
<li class="hworkList50 c_red">100<span class="linkBlue">(3)</span>
</li>
<li class="hworkList50 c_red">90</li>
<% @stundet_works.each do |student_work|%>
<% if @is_evaluation%>
<%= render :partial => "evaluation_work", :locals => {:student_work => student_work}%>
<% else%>
<%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work}%>
<% end%>
<div class="cl"></div>
</ul>
<!---hwork_ul end--->
<div id="about_hwork">
<!---show_hwork end--->
<div id="about_hwork"></div>
<div class="cl"></div>
<% end%>
</div>
<ul class="hworkListRow" >
<li class="hworkList380">
<ul>
<li class="hworkName mt12"><a href="javascript:void(0);" class="linkGrey f14">作品名称作品名称作品名称作品名称作品名称</a></li>
<li>
<ul class="mt12">
<li class="hworkDetail mr15">姓名:马克</li>
<li class="hworkDetail mr15">学号123456789</li>
<li class="hworkDate">时间2015-08-21 11:00</li>
</ul>
</li>
</ul>
</li>
<li class="hworkList80 c_red">90</li>
<li class="hworkList80 c_grey">--</li>
<li class="hworkList80 c_grey">--</li>
<li class="hworkList50 c_red">100<span class="linkBlue">(3)</span>
<div class="infoNi" >
现共有<span class="c_red">&nbsp;3&nbsp;</span>
名学生进行了匿评,平均分为
<span class="c_red">&nbsp;100&nbsp;</span>分
。</div>
</li>
<li class="hworkList50 c_red">90</li>
<div class="cl"></div>
</ul>
<ul class="hworkListRow" >
<li class="hworkList380">
<ul>
<li class="hworkName mt12"><a href="javascript:void(0);" class="linkGrey f14">作品名称作品名称作品名称作品名称作品名称</a></li>
<li>
<ul class="mt12">
<li class="hworkDetail mr15">姓名:马克</li>
<li class="hworkDetail mr15">学号123456789</li>
<li class="hworkDate">时间2015-08-21 11:00</li>
</ul>
</li>
</ul>
</li>
<li class="hworkList80 c_red">90</li>
<li class="hworkList80 c_grey">--</li>
<li class="hworkList80 c_grey">--</li>
<li class="hworkList50 c_grey">--</li>
<li class="hworkList50 c_red">90</li>
<div class="cl"></div>
</ul>
<ul class="hworkListRow" >
<li class="hworkList380">
<ul>
<li class="hworkName mt12"><a href="javascript:void(0);" class="linkGrey f14">作品名称作品名称作品名称作品名称作品名称作品名称作品名称作品名称作品名称</a></li>
<li>
<ul class="mt12">
<li class="hworkDetail mr15">姓名:马克</li>
<li class="hworkDetail mr15">学号123456789</li>
<li class="hworkDate">时间2015-08-21 11:00</li>
</ul>
</li>
</ul>
</li>
<li class="hworkList80 c_red">90</li>
<li class="hworkList80 c_grey">--</li>
<li class="hworkList80 c_grey">--</li>
<li class="hworkList50 c_grey">--</li>
<li class="hworkList50 c_red">90</li>
<div class="cl"></div>
</ul>
<div class="cl"></div>
<!---about_hwork end--->
</div>
<!---tbc_01 end-->
<div class="undis" id="tbc_02">
<div class="problem_main mt10"> <a class="problem_pic fl"><img src="images/courses/pic_01.jpg" width="42" height="42" /></a>
<div class="problemTxt fl mt5">
<h4 class="rTxtTit mb5"> 请以下同学重新提交作业ppt只要更新附件不要删除作否则否则否则评分就丢了</h4>
<div class="homepagePostSetting">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
<li><a href="javascript:void(0);" class="postOptionLink">启动匿评</a></li>
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
</ul>
</li>
</ul>
</div>
<div class="cl"></div>
<p id="news_description" class="news_description mt5">项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题</p>
<a href="javascript:void(0);" class=" linkBlue" onclick="show_more_msg02();">[展开]</a>
<div class="cl"></div>
<span class="fl">截止时间2015-04-02</span>
<div >
<form name="formnow" class="fr">
<input class="c_red " name="dd" type="text" style="border:0;" size="1" >
<input class="c_red " name="hh" type="text" style="border:0;" size="1">
小时
<input class="c_red " name="mm" type="text" style="border:0;" size="1">
<input class="c_red " name="ss" type="text" style="border:0;" size="1">
</form>
<p class="fr">作业提交还剩:</p>
</div>
</div>
<!--problem_txt end-->
<div class="cl"></div>
</div>
<!--problem_main end-->
<div class="problem_main mt10" style="display:none;"> <a class="problem_pic fl"><img src="images/courses/pic_01.jpg" width="42" height="42" /></a>
<div class="problem_txt fl mt5">
<h4 class="rTxtTit mb5"> 请以下同学重新提交作业ppt只要更新附件不要删除作否则否则否则评分就丢了</h4>
<div class="homepagePostSetting">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
<li><a href="javascript:void(0);" class="postOptionLink">关闭匿评</a></li>
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
</ul>
</li>
</ul>
</div>
<div class="cl"></div>
<p class=" mt5">项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题个数显示问题项目问题个数显示问题项目问题个数显题个数显示问题<br />
创建时间 2014-11-26 10:19</p>
<span class="fr c_red">已截止,但可补交。</span> </div>
<div class="cl"></div>
</div>
<!--课程动态 end-->
</div>
<!---tbc_02 end-->
</div>
<!--ctt end-->
</div>
<div class="cl"></div>
<!--contentbox end-->
</div>
<!--RSide end-->
</div>
<!--Content end-->
<!--Footer end-->
<div class="cl"></div>

View File

@ -50,7 +50,7 @@ a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;}
.hworkList80 {width:80px; text-align:center;}
.hworkList50 {width:50px; text-align:center;}
.codeList{ float:right; font-size:12px; color:#484848; padding:0px 3px; width:714px; margin-bottom:10px; }
.hworkName {width:380px; max-width:380px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:16px; line-height:16px;}
.hworkName {max-width:380px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:16px; line-height:16px;}
.hworkDetail {max-width:100px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:14px; line-height:14px; font-size:12px; color:#888888;}
.hworkDate {max-width:150px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:14px; line-height:14px; font-size:12px; color:#888888;}
.hworkMenu {width:100px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:10px 20px; left:-110px; font-size:12px; color:#888888; display:none; line-height:2;}
@ -60,6 +60,9 @@ a.hworkSetting {background:url(../images/homepage_icon2.png) -10px -450px no-rep
.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;}
.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;}
.width620{width: 620px;}
.width455{width: 455px;}
.m_width620{max-width: 620px;}
/*邮件邀请*/