修复教师评分后星星显示不正常的BUG
This commit is contained in:
parent
12b16f0bb6
commit
08bfb8e80a
|
@ -300,6 +300,16 @@ class HomeworkAttachController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#教师综评
|
||||
def comprehensive_evaluation_jour
|
||||
@homework = HomeworkAttach.find(params[:jour_id])
|
||||
@add_jour = @homework.addjours User.current.id, params[:new_form][:user_message],0,params[:is_comprehensive_evaluation]
|
||||
respond_to do |format|
|
||||
format.html { redirect_to homework_attach_path @homework }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
#获取指定作业的平均得分
|
||||
def score
|
||||
#stars_reates = @homework.rates(:quality)
|
||||
|
|
|
@ -28,9 +28,7 @@
|
|||
}
|
||||
</script>
|
||||
</div>
|
||||
<% if User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? &&
|
||||
(Member.where('user_id = ? and project_id = ?', User.current.id,
|
||||
@bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0) && cur_user_homework_for_bid(@bid).count == 0 %>
|
||||
<% if User.current.logged? && User.current.member_of_course?(@bid.courses.first) && cur_user_homework_for_bid(@bid).count == 0 && is_cur_course_student(@bid.courses.first) %>
|
||||
<div class='icon icon-add'>
|
||||
<%#= link_to l(:label_commit_homework), new_submit_homework_path, :onclick => "$('#put-bid-form').slideToggle(); this.blur(); return false;" %>
|
||||
<%= link_to l(:label_course_new_homework),new_homework_attach_path %><strong style="color: #a9a9a9"> (每一个作业都可以是一个精美的作品)</strong>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</div>
|
||||
<%= render :partial => 'evaluation', :locals => {:homework => homework} %>
|
||||
<div>
|
||||
<%= render :partial => 'addjour', :locals => {:homework_attach => homework, :sta => 0,:is_comprehensive_evaluation => 1} %>
|
||||
<%= render :partial => 'evaluation_add_jour', :locals => {:homework_attach => homework, :sta => 0,:is_comprehensive_evaluation => 1} %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
|
|
|
@ -0,0 +1,93 @@
|
|||
<style>
|
||||
input[type="submit"].bid_btn {
|
||||
vertical-align: middle;
|
||||
width: 60px;/*modified by ming*/
|
||||
height: 25px;
|
||||
line-height: 19px;
|
||||
font-size: 14px;
|
||||
color: rgb(0, 0, 0);
|
||||
background: buttonface;/*url("/images/button/bg103.jpg") no-repeat scroll left top transparent;*/
|
||||
padding: 0px 0px 4px 0px;
|
||||
border-radius: 2px;
|
||||
border: 1px solid rgb(148, 148, 148);
|
||||
box-shadow: none;
|
||||
text-shadow: none;
|
||||
margin-top: -10px;
|
||||
/*margin-right: -4px;*/
|
||||
}
|
||||
input[type="button"].bid_btn {
|
||||
width: 60px;/*modified by ming*/
|
||||
height: 25px;
|
||||
line-height: 19px;
|
||||
font-size: 14px;
|
||||
color: rgb(0, 0, 0);
|
||||
background: buttonface;/*url("/images/button/bg103.jpg") no-repeat scroll left top transparent;*/
|
||||
padding: 0px 0px 4px 0px;
|
||||
border-radius: 2px;
|
||||
border: 1px solid rgb(148, 148, 148);
|
||||
box-shadow: none;
|
||||
text-shadow: none;
|
||||
margin-top: -10px;
|
||||
margin-right: -2px;
|
||||
}
|
||||
textarea:focus {
|
||||
border: #d5dee9 1px solid;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
function clearInfo(id, content) {
|
||||
var text = $('#' + id);
|
||||
if (text.val() == content) {
|
||||
$('#' + id).val('');
|
||||
}
|
||||
}
|
||||
|
||||
function showInfo(id, content) {
|
||||
var text = $('#' + id);
|
||||
if (text.val() == '') {
|
||||
$('#' + id).val(content);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<%= form_for('new_form', :method => :post,
|
||||
:url => {:controller => 'homework_attach',
|
||||
:action => 'comprehensive_evaluation_jour',
|
||||
:jour_id => homework_attach.id,
|
||||
:is_comprehensive_evaluation => is_comprehensive_evaluation,
|
||||
:sta => sta}) do |f|%>
|
||||
|
||||
<div id = 'pre_show'>
|
||||
<%= render :partial => 'words/pre_show', :locals => {:content => @content} %>
|
||||
</div>
|
||||
|
||||
<% if User.current.logged? %>
|
||||
<table border="0" width="525px" align="center" >
|
||||
<tr>
|
||||
<td><%= f.text_area 'user_message', :rows => 3, :cols => 65, :value => "#{l(:label_leave_a_message)}",
|
||||
:onfocus => "clearInfo('new_form_user_message','#{l(:label_leave_a_message)}')",
|
||||
:onblur => "showInfo('new_form_user_message','#{l(:label_leave_a_message)}')",
|
||||
:style => "resize: none;", :class => 'noline'%></td>
|
||||
</tr>
|
||||
</table>
|
||||
<%= f.text_field :reference_user_id, :style=>"display:none"%>
|
||||
<table border="0" width="525px" align="center">
|
||||
<tr>
|
||||
<td align="right"> <%= submit_tag l(:button_leave_meassge),
|
||||
:name => nil , :class => "enterprise",
|
||||
:onmouseout => "this.style.backgroundPosition = 'left top'",
|
||||
:onmouseover => "this.style.backgroundPosition = 'left -31px'"%>
|
||||
<%= submit_tag l(:button_clear), :name => nil, :class => "enterprise",
|
||||
:onclick => "clearMessage('new_form_user_message');",
|
||||
:onmouseout => "this.style.backgroundPosition = 'left top'",
|
||||
:onmouseover => "this.style.backgroundPosition = 'left -31px'" %> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<% else %>
|
||||
<div style="font-size: 14px;margin:10px;text-align: center">
|
||||
<%= l(:label_user_login_tips) %>
|
||||
<%= link_to l(:label_user_login_new), signin_path %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -34,7 +34,7 @@ RedmineApp::Application.routes.draw do
|
|||
match 'addjours', via: [:get, :post]
|
||||
match 'add_jour_reply', via: [:get,:post]
|
||||
match 'destroy_jour', via: [:get,:post]
|
||||
|
||||
match 'comprehensive_evaluation_jour', via: [:get,:post]
|
||||
end
|
||||
member do
|
||||
match 'add_homework_users', via:[:get,:post]
|
||||
|
|
Loading…
Reference in New Issue