Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop

This commit is contained in:
daiao 2016-12-17 15:38:49 +08:00
commit d16e9e4ecd
10 changed files with 10 additions and 9 deletions

View File

@ -299,7 +299,8 @@ class PollController < ApplicationController
def commit_answer
pq = PollQuestion.find(params[:poll_question_id])
if has_commit_poll?(@poll.id,User.current.id) && (!User.current.admin?)
render :json => {:text => "failure"}
@percent = get_percent(@poll,User.current)
render :json => {:text => "ok" ,:percent => format("%.2f" ,@percent)}
return
end
if pq.question_type == 1

View File

@ -1017,7 +1017,7 @@ class StudentWorkController < ApplicationController
end
end
unless (params[:anonymous_appeal].to_i == 1 && @homework.anonymous_appeal == 1 && params[:appeal_penalty].to_i == homework_detail_manual.homework_detail_manual) || (params[:anonymous_appeal].to_i == 0 && @homework.anonymous_appeal == 0)
unless (params[:anonymous_appeal].to_i == 1 && @homework.anonymous_appeal == 1 && params[:appeal_penalty].to_i == homework_detail_manual.appeal_penalty) || (params[:anonymous_appeal].to_i == 0 && @homework.anonymous_appeal == 0)
if params[:anonymous_appeal].to_i == 0 && @homework.anonymous_appeal != 0
homework_detail_manual.appeal_penalty = 0
StudentWork.where("homework_common_id = #{@homework.id} and work_status != 0").each do |student_work|

View File

@ -31,6 +31,7 @@
</tr>
<% @stundet_works.each_with_index do |student_work, i|%>
<% score_open = @homework.score_open == 1 || student_work.user == User.current %>
<a name="<%= student_work.id%>"></a>
<%= render :partial => "evaluation_work", :locals => {:student_work => student_work, :index => i, :score_open => score_open}%>
<tr>
<td colspan="12">

View File

@ -1,5 +1,5 @@
<% is_expand = st.student_work_projects.empty? %>
<a name="<%= st.id%>"></a>
<ul id="syllabus_course_ul">
<li class="syllabus_class_list" style="line-height:44px; vertical-align:middle;">
<div class="syllabus_class_w fontGrey3" style="cursor: pointer;">
@ -90,7 +90,7 @@
<% if @homework.anonymous_appeal == 1 %>
违规匿评扣分
<span class="c_red">&nbsp;
<%= student_work.appeal_penalty%>
<%= st.appeal_penalty%>
&nbsp;</span>分<br/>
<% end %>
<% end %>

View File

@ -76,6 +76,7 @@
<%# end %>
<% @stundet_works.each_with_index do |student_work, i| %>
<% score_open = @is_teacher || @homework.score_open == 1 || student_work.user == User.current %>
<a name="<%= student_work.id%>"></a>
<%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work, :index => i, :score_open => score_open} %>
<tr>
<td colspan="12">

View File

@ -7,7 +7,6 @@
<%#= render :partial => 'evaluation_un_group_work', :locals => {:student_work => student_work, :index => index} %>
<%# else %>
<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_path(student_work.user), :target => '_blank') %>

View File

@ -1,6 +1,5 @@
<!-- 匿评作品列表,显示某一个作品的信息 -->
<tr class="hworkListRow" id="student_work_<%= student_work.id%>">
<td class="none"><a name="<%= student_work.id%>"></a></td>
<% if @homework.homework_type != 3 %>
<% is_my_work = student_work.user == User.current%>
<% else %>

View File

@ -12,7 +12,7 @@
<%= f.text_area 'comment', :id => 'appeal_comment', :style => 'height: 70px; width: 414px;', :placeholder => "请输入你的申诉理由最多250个字符。",:maxlength => 250 %>
<p id="notice_notes" class="c_red none" style="margin-left: 68px;">请输入申诉理由</p>
<div class="alert alert-orange mb10 mt10 mr20">
教师或者助教将到您的申诉<br/>
教师或者助教将到您的申诉<br/>
申诉被接受后,此匿评成绩将被废弃,且评阅人的作品将被违规扣分
</div>

View File

@ -80,7 +80,7 @@
<script type="text/javascript">
$(function(){
<% if !@is_evaluation && (!@is_teacher || params[:show_work_id].present?) || @message_student_work_id || (@is_evaluation && @is_focus == 1) %>
<% if !@is_evaluation && (!@is_teacher || params[:show_work_id].present?) || @message_student_work_id || (@is_evaluation && (@is_focus == 1 || params[:show_work_id].present?)) %>
<% if @message_student_work_id %>
<% work = @homework.student_works.where("id =?", @message_student_work_id).first %>
<% else %>

View File

@ -38,7 +38,7 @@
<% if homework.student_works.has_committed.count == 0 %>
<%= link_to '编&nbsp;&nbsp;&nbsp;&nbsp;辑'.html_safe, edit_homework_common_path(homework, :is_manage => is_manage), :class => 'hw_btn_green fr mt5', :target => '_blank' %>
<% else %>
<%= link_to '评&nbsp;&nbsp;&nbsp;&nbsp;分'.html_safe, student_work_index_path(:homework => homework.id), :class => 'hw_btn_green fr mt5', :target => '_blank' %>
<%= link_to '评&nbsp;&nbsp;&nbsp;&nbsp;分'.html_safe, student_work_index_path(:homework => homework.id, :tab => 2), :class => 'hw_btn_green fr mt5', :target => '_blank' %>
<% end %>
<div class="cl"></div>
</ul>