1.修复作业无关联项目是进入编辑界面报错的问题

2.修复作业综评页面不会及时更新的问题
This commit is contained in:
sw 2014-06-19 17:00:40 +08:00
parent 59e6433938
commit e43a84ab4b
3 changed files with 10 additions and 2 deletions

View File

@ -276,6 +276,9 @@ class HomeworkAttachController < ApplicationController
@offset ||= @feedback_pages.offset
@jour = @jours[@offset, @limit]
@comprehensive_evaluation = @homework.journals_for_messages.where("is_comprehensive_evaluation is not null").order("created_on DESC")
@totle_score = score_for_homework @homework
@teaher_score = teacher_score_for_homework @homework
respond_to do |format|
format.js
end

View File

@ -1,6 +1,6 @@
<% if @add_jour.is_comprehensive_evaluation == 1 %>
$('#comprehensive_evaluation').html('<%= escape_javascript(render(:partial => 'comprehensive_evaluation',
:locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework} )) %>');
:locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework,:teaher_score => @teaher_score} )) %>');
<% else %>
$('#message').html('<%= escape_javascript(render(:partial => 'showjour', :locals => {:jour =>@jour, :state => false,:homework => @homework} )) %>');
$('#pre_show').html('<%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>');

View File

@ -47,7 +47,12 @@
</p>
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
<strong>提交项目:</strong>
<% if @homework.project.nil? %>
<%= f.select :project_id, options_for_select(user_projects_option),:name => "project_id", :required => true%>
<% else %>
<%= f.select :project_id, options_for_select(user_projects_option,@homework.project.id),:name => "project_id", :required => true%>
<% end %>
<%= link_to '创建项目', new_project_path(course: 0, project_type: 0), :target => '_blank' %>
<p class="font_lighter" style="padding-left:120px;clear:left;">提交项目可以为空</p>
</p>