diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 58aa90f0..b6207fd3 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -82,7 +82,10 @@ <%= link_to "开始实战", shixun_path(activity.homework_commons_shixuns.shixun), :class => 'edu-filter-btn edu-activity-blue ml15 fl mt5', :target => "_blank" %> <% elsif work.present? %> <% myshixun = Myshixun.where(:id => work.myshixun_id).first %> - <% is_modify = ShixunModify.where(:myshixun_id => myshixun.try(:id), :shixun_id => myshixun.shixun.try(:id), :status => 1).first %> + <% if myshixun.present? %> + <% is_modify = ShixunModify.where(:myshixun_id => myshixun.try(:id), :shixun_id => myshixun.shixun.try(:id), :status => 1).first %> + <% end %> + <% if myshixun && is_modify.blank? %> <%= link_to "继续实战", myshixun_game_path(myshixun.current_task, :myshixun_id => myshixun), :class => "edu-filter-btn edu-activity-blue ml15 fl mt5", :target => "_blank" %> <% elsif myshixun %>