海工调整

dev_haigong
cxt 6 years ago
parent 23753d8977
commit 39dee9d928

@ -326,14 +326,16 @@ class BoardsController < ApplicationController
end
def update_position
if @course || @contest
if @course
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
boards = @board.parent.children
if params[:opr] == 'up' && @board.position > 1
if @is_teacher && params[:opr] == 'up' && @board.position > 1
before_board = boards.where("position = #{@board.position - 1}").first
if before_board && @board.update_attribute('position', @board.position - 1)
before_board.update_attribute('position', before_board.position + 1)
end
elsif params[:opr] == 'down' && @board.position < boards.count
elsif @is_teacher && params[:opr] == 'down' && @board.position < boards.count
after_board = boards.where("position = #{@board.position + 1}").first
if after_board && @board.update_attribute('position', @board.position + 1)
after_board.update_attribute('position', after_board.position - 1)

@ -1,7 +1,8 @@
<% if @course %>
$("#tbc_04").html("<%=escape_javascript(render :partial => 'courses/settings/boards_setting') %>");
<% course_board = @course.boards.where(:parent_id => 0).first %>
$("#board_children_list").html("<%= escape_javascript(render :partial => 'layouts/board_children_list', :locals => {:course_board => course_board})%>");
$("#board_children_list").html("<%= escape_javascript(render :partial => 'layouts/board_children_list', :locals =>
{:course_board => course_board, :is_teacher => @is_teacher})%>");
<% elsif @contest %>
$("#game-setting-content-3").html("<%=escape_javascript(render :partial => 'contests/boards') %>");
<% contest_board = @contest.boards.where(:parent_id => 0).first %>

@ -32,7 +32,9 @@
<%= render :partial => 'users/course_create', :locals => {:activity => activity.course_act, :user_activity_id => activity.id, :is_course => 1} if activity.course_act %>
<% when 'JoinCourse' %>
<% act = CourseMessage.where(:id => activity.course_act_id).first %>
<%= render :partial => 'users/join_course', :locals => {:activity => act, :user_activity_id => activity.id} %>
<% if act.present? %>
<%= render :partial => 'users/join_course', :locals => {:activity => act, :user_activity_id => activity.id} %>
<% end %>
<% end %>
<% end %>
<% end %>

@ -1,6 +1,8 @@
<%= render :partial => "graduation_tasks/task_tag", :locals => {:task => task} %>
<% from_course = defined?(is_course) ? true : false %>
<% if false %>
<% if @is_teacher %>
<div class="<%= from_course ? 'fr mr20 edu-menu-panel' : 'fr edu-position-hidebox' %>" style="<%= from_course ? '' : 'position: absolute;right: 0px;top: 0px;'%>">
<% if from_course %>
@ -61,4 +63,5 @@
<% end %>
<% end %>
<% end %>
<% end %>
<% end %>

@ -62,6 +62,8 @@
<% end %>
<%# elsif homework_common.homework_type != 4 %>
<% else %>
<% if false %>
<% if had_commit_studentwork_count(homework_common) > 0 %>
<span class="ml50 fl">
<%= link_to had_commit_studentwork_count(homework_common), student_work_index_path(:homework => homework_common.id), :class => 'color-orange03 mr5', :target => '_blank' %>
@ -77,6 +79,7 @@
未交
</span>
<% end %>
<% end %>
<%# elsif homework_common.homework_type == 4 && homework_common.homework_commons_shixuns.shixun %>
<%# had_passed_count = had_passed_changllenge_count(homework_common.homework_commons_shixuns.shixun, User.current) %>
<%# challenge_count = homework_common.homework_commons_shixuns.shixun.challenges.count %>
@ -148,7 +151,7 @@
<li>
<%= link_to '立即发布', publish_notice_homework_common_path(homework_common), :remote => true %>
</li>
<% elsif (homework_common.homework_detail_manual.try(:comment_status) == 1 || homework_common.homework_detail_manual.try(:comment_status) == 2) && homework_common.end_time > Time.now %>
<% elsif (homework_common.homework_detail_manual.try(:comment_status) == 1 || homework_common.homework_detail_manual.try(:comment_status) == 2) && homework_common.end_time.present? && homework_common.end_time > Time.now %>
<li>
<%= link_to '立即截止', end_notice_homework_common_path(homework_common), :remote => true %>
</li>

@ -1,13 +1,15 @@
<% course_board = @course.boards.where(:parent_id => 0).first %>
<% count = course_board ? course_board.messages.count : 0 %>
<li class="clearfix" id="sy_02">
<% if course_module.module_name != course_board.name %>
<% course_board.update_name(course_module.module_name) %>
<% end %>
<a href="<%= course_boards_path(@course) %>" class="fl"><i class="iconfont icon-taolun mr20 fl"></i>
<span class="task-hide activity-left-name"><%= course_module.module_name %></span>
<% if count > 0 %>
<span class="fr mr30 courseNewNum"><%= count %></span>
<% if is_teacher %>
<% count = course_board ? course_board.messages.count : 0 %>
<% if count > 0 %>
<span class="fr mr30 courseNewNum"><%= count %></span>
<% end %>
<% end %>
</a>
</li>
@ -15,10 +17,12 @@
<ul>
<% course_board.children.reorder("position asc").each do |board| %>
<li id="board_children_<%= board.id %>" class="clearfix">
<% count = board ? board.messages.count : 0 %>
<a href="<%= course_boards_path(@course, :board_id => board.id) %>" class="fl"><span class="fl ml38 devide_class task-hide" data-tip-down="<%=board.name %>"><%=board.name %></span>
<% if count > 0 %>
<span class="fr mr30 courseNewNum"><%= count %></span>
<% if is_teacher %>
<% count = board ? board.messages.count : 0 %>
<% if count > 0 %>
<span class="fr mr30 courseNewNum"><%= count %></span>
<% end %>
<% end %>
</a>
</li>

@ -1,9 +1,11 @@
<li id="sy_08" class="clearfix">
<a href="<%= students_course_path(@course) %>" class="fl"><i class="iconfont icon-fenban mr20 fl"></i><span class="fl task-hide activity-left-name"><%= @course.course_modules.where(:module_type => "course_group").first.try(:module_name) %></span>
<% group_count = @course.course_groups.size %>
<% if group_count > 0 %>
<span class="fl ml10 color-grey-9 font-12 groupNum"><%= group_count %></span>
<% end %>
<% if is_teacher %>
<% group_count = @course.course_groups.size %>
<% if group_count > 0 %>
<span class="fl ml10 color-grey-9 font-12 groupNum"><%= group_count %></span>
<% end %>
<% end %>
</a>
</li>
<% unless @course.course_groups.empty? %>
@ -13,17 +15,21 @@
<% if count > 0 %>
<li id="sy_09" class="clearfix">
<a href="<%= students_course_path(@course, :group_id => 0) %>" class="fl" style="color:000 !important;"><span class="fl ml38 devide_class task-hide" data-tip-down="未分班" style="color:000 !important;">未分班</span>
<span class="fl ml10 color-grey-9 font-12 groupNum"><%= count %></span>
<% if is_teacher %>
<span class="fl ml10 color-grey-9 font-12 groupNum"><%= count %></span>
<% end %>
</a>
</li>
<% end %>
<% @course.course_groups.each do |group| %>
<li id="course_group_<%=group.id %>" class="clearfix">
<% count = group.members.count %>
<a href="<%= students_course_path(@course, :group_id => group.id) %>" class="fl"><span class="fl ml38 devide_class task-hide" data-tip-down="<%=group.name %>"><%=group.name %></span>
<% if count > 0 %>
<span class="fl ml10 color-grey-9 font-12 groupNum"><%= count %></span>
<% end %>
<% if is_teacher %>
<% count = group.members.count %>
<% if count > 0 %>
<span class="fl ml10 color-grey-9 font-12 groupNum"><%= count %></span>
<% end %>
<% end %>
</a>
</li>
<% end %>

@ -1,4 +1,3 @@
<% course_file_num = visable_attachemnts_incourse(@course).size %>
<% course_modules = @course.course_modules.where(:hidden => 0) %>
<%# is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
<%# homework_num = visable_course_homework @course %>
@ -64,9 +63,11 @@
<% when "shixun_homework" %>
<li class="clearfix" id="sy_03_4">
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => 4) %>" class="fl"><i class="iconfont icon-daima mr20 fl"></i><span class="task-hide activity-left-name"><%= course_module.module_name %></span>
<% homework_count = visable_course_homework(@course, 4, @is_teacher, nil) %>
<% if homework_count > 0 %>
<span class="fr mr30 courseNewNum"><%= homework_count %></span>
<% if @is_teacher %>
<% homework_count = visable_course_homework(@course, 4, @is_teacher, nil) %>
<% if homework_count > 0 %>
<span class="fr mr30 courseNewNum"><%= homework_count %></span>
<% end %>
<% end %>
</a>
</li>
@ -74,18 +75,22 @@
<% when "common_homework" %>
<li class="clearfix" id="sy_03_1">
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => 1) %>" class="fl"><i class="iconfont icon-putongzuoye mr20 fl"></i><span class="task-hide activity-left-name"><%= course_module.module_name %></span>
<% homework_count = visable_course_homework(@course, 1, @is_teacher, nil) %>
<% if homework_count > 0 %>
<span class="fr mr30 courseNewNum"><%= homework_count %></span>
<% if @is_teacher %>
<% homework_count = visable_course_homework(@course, 1, @is_teacher, nil) %>
<% if homework_count > 0 %>
<span class="fr mr30 courseNewNum"><%= homework_count %></span>
<% end %>
<% end %>
</a>
</li>
<% when "group_homework" %>
<li class="clearfix" id="sy_03_3">
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => 3) %>" class="fl"><i class="iconfont icon-fenzuzuoye mr20 fl"></i><span class="task-hide activity-left-name"><%= course_module.module_name %></span>
<% homework_count = visable_course_homework(@course, 3, @is_teacher, nil) %>
<% if homework_count > 0 %>
<span class="fr mr30 courseNewNum"><%= homework_count %></span>
<% if @is_teacher %>
<% homework_count = visable_course_homework(@course, 3, @is_teacher, nil) %>
<% if homework_count > 0 %>
<span class="fr mr30 courseNewNum"><%= homework_count %></span>
<% end %>
<% end %>
</a>
</li>
@ -96,53 +101,65 @@
</li>
<ul>
<li id="sy_07_01" class="clearfix">
<% count = @course.graduation_topics.count %>
<a href="<%= graduation_topics_path(:course => @course.id) %>" class="fl">
<span class="fl ml38 devide_class task-hide">毕设选题</span>
<% if count > 0 %>
<span class="fr mr30 courseNewNum"><%= count %></span>
<% if @is_teacher %>
<% count = @course.graduation_topics.count %>
<% if count > 0 %>
<span class="fr mr30 courseNewNum"><%= count %></span>
<% end %>
<% end %>
</a>
</li>
<li id="sy_07_02" class="clearfix">
<% count = visible_task_count @course, @is_teacher %>
<a href="<%= graduation_tasks_path(:course => @course.id) %>" class="fl">
<span class="fl ml38 devide_class task-hide">毕设任务</span>
<% if count > 0 %>
<span class="fr mr30 courseNewNum"><%= count %></span>
<% if @is_teacher %>
<% count = visible_task_count @course, @is_teacher %>
<% if count > 0 %>
<span class="fr mr30 courseNewNum"><%= count %></span>
<% end %>
<% end %>
</a>
</li>
</ul>
<% when "exercise" %>
<% count = visable_course_exercise @course, @is_teacher %>
<li class="clearfix" id="sy_04">
<a href="<%= exercise_index_path(:course_id => @course.id) %>" class="fl"><i class="iconfont icon-shijuan mr20 fl"></i><span class="task-hide activity-left-name"><%= course_module.module_name %></span>
<% if count > 0 %>
<span class="fr mr30 courseNewNum"><%= count %></span>
<% if @is_teacher %>
<% count = visable_course_exercise @course, @is_teacher %>
<% if count > 0 %>
<span class="fr mr30 courseNewNum"><%= count %></span>
<% end %>
<% end %>
</a>
</li>
<% when "poll" %>
<% count = visable_course_poll @course, @is_teacher %>
<li class="clearfix" id="sy_06">
<a href="<%= poll_index_path(:course_id => @course.id) %>" class="fl"><i class="iconfont icon-wenjuan mr20 fl"></i><span class="task-hide activity-left-name"><%= course_module.module_name %></span>
<% if count > 0 %>
<span class="fr mr30 courseNewNum"><%= count %></span>
<% if @is_teacher %>
<% count = visable_course_poll @course, @is_teacher %>
<% if count > 0 %>
<span class="fr mr30 courseNewNum"><%= count %></span>
<% end %>
<% end %>
</a>
</li>
<% when "attachment" %>
<li class="clearfix" id="sy_05">
<a href="<%= course_files_path(@course) %>" class="fl"><i class="iconfont icon-ziyuan mr20 fl"></i><span class="task-hide activity-left-name"><%= course_module.module_name %></span>
<% if course_file_num > 0 %>
<span class="fr mr30 courseNewNum"><%= course_file_num %></span>
<% if @is_teacher %>
<% course_file_num = visable_attachemnts_incourse(@course).size %>
<% if course_file_num > 0 %>
<span class="fr mr30 courseNewNum"><%= course_file_num %></span>
<% end %>
<% end %>
</a>
</li>
<% when "board" %>
<div id="board_children_list">
<%= render :partial => 'layouts/board_children_list', :locals => {:course_module => course_module} %>
<%= render :partial => 'layouts/board_children_list', :locals => {:course_module => course_module,
:is_teacher => @is_teacher} %>
</div>
<% when "course_group" %>
<div id="group_children_list">

@ -15,6 +15,7 @@
<% end %>
<% end %>
<% if false %>
<% if @is_teacher %>
<div class="fr mr20 edu-menu-panel">
<i class="iconfont icon-caidan color-blue"></i>
@ -68,6 +69,8 @@
<% end %>
<% end %>
<% end %>
<% end %>
</div>
<p>
<%= link_to activity.user.show_real_name, user_path(activity.user), :class => "color-grey-6 mr30" %>

@ -13,6 +13,7 @@
<span class="edu-filter-btn edu-filter-btn-no-late ml10 fl mt6">已确认</span>
<% end %>
<% if false %>
<% if @is_teacher %>
<div class="fr mr20 edu-menu-panel">
<i class="iconfont icon-caidan color-blue"></i>
@ -33,6 +34,7 @@
<a href="javascript:void(0);" onclick="s_op_confirm_box('<%= cancel_topic_select_graduation_topic_path(activity) %>', '确定要取消该选题吗')" class="edu-filter-btn edu-greyback-btn fl mt7 pl3 pr3 ml10 pointer">取消选题</a>
<% end %>
<% end %>
<% end %>
</div>
<p>
<%= link_to activity.teacher.show_real_name, user_path(activity.teacher), :class => "color-grey-6 mr30" %>

@ -25,115 +25,91 @@
<% end %>
<% end %>
<% if @is_teacher %>
<% comment_status = activity.homework_detail_manual.try(:comment_status) %>
<div class="fr mr20 edu-menu-panel">
<i class="iconfont icon-caidan color-blue"></i>
<ul class="edu-menuSmall-list edu-txt-center">
<% if activity.homework_type != 4 %>
<li><%= link_to "编辑", edit_homework_common_path(activity) %></li>
<% end %>
<li><%= link_to "设置", student_work_index_path(:homework => activity.id, :tab => 4) %></li>
<% if comment_status == 0 || activity.homework_group_settings.where("publish_time is null or publish_time > '#{Time.now}'").count > 0 %>
<li><%= link_to '立即发布', publish_notice_homework_common_path(activity), :remote => true %></li>
<% end %>
<% if (comment_status == 1 && activity.end_time > Time.now) || activity.homework_group_settings.where("publish_time < '#{Time.now}' and end_time > '#{Time.now}'").count > 0 %>
<li><%= link_to '立即截止', end_notice_homework_common_path(activity), :remote => true %></li>
<% end %>
<li><%= link_to "导出成绩", student_work_index_path(:homework => activity, :format => 'xls'), :id => "export_student_work" %></li>
<% if activity.homework_type == 1 || activity.homework_type == 3 %>
<% if false %>
<% if @is_teacher %>
<% comment_status = activity.homework_detail_manual.try(:comment_status) %>
<div class="fr mr20 edu-menu-panel">
<i class="iconfont icon-caidan color-blue"></i>
<ul class="edu-menuSmall-list edu-txt-center">
<% if activity.homework_type != 4 %>
<li><%= link_to "编辑", edit_homework_common_path(activity) %></li>
<% end %>
<li><%= link_to "设置", student_work_index_path(:homework => activity.id, :tab => 4) %></li>
<% if comment_status == 0 || activity.homework_group_settings.where("publish_time is null or publish_time > '#{Time.now}'").count > 0 %>
<li><%= link_to '立即发布', publish_notice_homework_common_path(activity), :remote => true %></li>
<% end %>
<% if (comment_status == 1 && activity.end_time > Time.now) || activity.homework_group_settings.where("publish_time < '#{Time.now}' and end_time > '#{Time.now}'").count > 0 %>
<li><%= link_to '立即截止', end_notice_homework_common_path(activity), :remote => true %></li>
<% end %>
<li><%= link_to "导出成绩", student_work_index_path(:homework => activity, :format => 'xls'), :id => "export_student_work" %></li>
<% if activity.homework_type == 1 || activity.homework_type == 3 %>
<li>
<% if activity.student_works.has_committed.empty? %>
<a href="javascript:void(0)" onclick="notice_box('没有学生提交作业,暂无附件可下载');">导出作品附件</a>
<% else %>
<%= link_to "导出作品附件", zipdown_assort_path(obj_class: activity.class, obj_id: activity.id, format: :json), remote: true, :class => "download_homework_attachments" %>
<% end %>
</li>
<% end %>
<% if @course.is_public? && !activity.is_public %>
<li id="set_homework_public_<%= activity.id %>">
<a href="javascript:void(0);" onclick="delete_confirm_box('<%= set_public_homework_common_path(activity) %>', '您确定要公开吗?<br/>公开后不能重设为私有')">设为公开</a>
</li>
<% end %>
<% if (activity.homework_type == 1 || activity.homework_type == 3) && (@is_teacher || activity.user == User.current) %>
<li class="add_to_homework_bank_<%= activity.id %>">
<%= link_to "加入题库", add_to_homework_bank_homework_common_path(activity), :remote => true %>
</li>
<% end %>
<li>
<% if activity.student_works.has_committed.empty? %>
<a href="javascript:void(0)" onclick="notice_box('没有学生提交作业,暂无附件可下载');">导出作品附件</a>
<% else %>
<%= link_to "导出作品附件", zipdown_assort_path(obj_class: activity.class, obj_id: activity.id, format: :json), remote: true, :class => "download_homework_attachments" %>
<% end %>
</li>
<% end %>
<% if @course.is_public? && !activity.is_public %>
<li id="set_homework_public_<%= activity.id %>">
<a href="javascript:void(0);" onclick="delete_confirm_box('<%= set_public_homework_common_path(activity) %>', '您确定要公开吗?<br/>公开后不能重设为私有')">设为公开</a>
</li>
<% end %>
<% if (activity.homework_type == 1 || activity.homework_type == 3) && (@is_teacher || activity.user == User.current) %>
<li class="add_to_homework_bank_<%= activity.id %>">
<%= link_to "加入题库", add_to_homework_bank_homework_common_path(activity), :remote => true %>
<a href="javascript:void(0)" onclick="delete_confirm_box_3('<%= homework_common_path(activity) %>', '您确定要删除吗?<br/>已提交作品将全部被删除,不可恢复')">删除</a>
</li>
<% end %>
<li>
<a href="javascript:void(0)" onclick="delete_confirm_box_3('<%= homework_common_path(activity) %>', '您确定要删除吗?<br/>已提交作品将全部被删除,不可恢复')">删除</a>
</li>
</ul>
</div>
</ul>
</div>
<% elsif User.current.member_of_course?(activity.course) %>
<% work = cur_user_works_for_homework activity %>
<% member = activity.course.members.where(:user_id => User.current.id).first
setting_time = homework_group_setting activity, member.try(:course_group_id) %>
<% project = cur_user_projects_for_homework activity %>
<% if activity.course.is_end %>
<span class="edu-filter-btn <%= homework_status_color "已结束" %> ml15 fl mt5">已结束</span>
<% if work.present? %>
<%= link_to "查看作品", student_work_index_path(:homework => activity.id), :class => 'edu-filter-btn edu-activity-green ml15 fl mt5' %>
<% end %>
<% else %>
<% if activity.homework_type == 4 %>
<% if work.nil? && (setting_time.end_time >= Time.now || activity.allow_late) %>
<%= 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? %>
<%= link_to "继续实战", shixun_path(myshixun.shixun), :class => "edu-filter-btn edu-activity-blue ml15 fl mt5", :target => "_blank" %>
<% end %>
<% elsif User.current.member_of_course?(activity.course) %>
<% work = cur_user_works_for_homework activity %>
<% member = activity.course.members.where(:user_id => User.current.id).first
setting_time = homework_group_setting activity, member.try(:course_group_id) %>
<% project = cur_user_projects_for_homework activity %>
<% if activity.course.is_end %>
<span class="edu-filter-btn <%= homework_status_color "已结束" %> ml15 fl mt5">已结束</span>
<% if work.present? %>
<%= link_to "查看作品", student_work_index_path(:homework => activity.id), :class => 'edu-filter-btn edu-activity-green ml15 fl mt5' %>
<% end %>
<% else %>
<% if activity.homework_type == 4 %>
<% if work.nil? && (setting_time.end_time >= Time.now || activity.allow_late) %>
<%= 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? %>
<%= link_to "继续实战", shixun_path(myshixun.shixun), :class => "edu-filter-btn edu-activity-blue ml15 fl mt5", :target => "_blank" %>
<% end %>
<%# if myshixun && is_modify.blank? %>
<%# if myshixun && is_modify.blank? %>
<%#= link_to "继续实战", shixun_exec_shixun_path(myshixun.shixun), :class => "edu-filter-btn edu-activity-blue ml15 fl mt5", :target => "_blank" %>
<%# elsif myshixun %>
<%# elsif myshixun %>
<%#= link_to "继续实战", 'javascript:void(0);', :onclick => "sure_box_redirect('#{myshixun_reset_myshixun_path(myshixun)}', '实训已经更新啦,系统正在为您重置');", :class => "edu-filter-btn edu-activity-blue ml15 fl mt5" %>
<%# end %>
<% else %>
<span class="edu-filter-btn <%= homework_status_color "未开启补交" %> ml15 fl mt5">未开启补交</span>
<% end %>
<% elsif work.nil? && setting_time.end_time >= Time.now %>
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
<% if project.nil? %>
<%= link_to "关联项目", new_student_work_project_student_work_index_path(:homework => activity.id, :user_activity_id => user_activity_id, :hw_status => hw_status), remote: true, :class => 'edu-filter-btn edu-activity-blue ml15 fl mt5', :title => '请各组长关联作业项目' %>
<%= link_to "提交作品", "javascript:void(0)", :class => 'edu-filter-btn edu-activity-blue ml15 fl mt5', :style => "cursor:not-allowed", :title => '请先关联项目再提交作品' %>
<%# end %>
<% else %>
<a href="javascript:void(0);" class="edu-filter-btn edu-activity-light-grey ml15 fl mt5" title="取消关联项目" onclick="delete_confirm_box('<%= cancel_relate_project_student_work_index_path(:homework => activity.id,:user_activity_id=>user_activity_id, :hw_status => hw_status) %>', '您确定要取消关联吗?')">取消关联</a>
<%= link_to "提交作品", new_student_work_url_without_domain(activity.id), :class => 'edu-filter-btn edu-activity-blue ml15 fl mt5' %>
<span class="edu-filter-btn <%= homework_status_color "未开启补交" %> ml15 fl mt5">未开启补交</span>
<% end %>
<% else %>
<%= link_to "提交作品", new_student_work_url_without_domain(activity.id), :class => 'edu-filter-btn edu-activity-blue ml15 fl mt5' %>
<% end %>
<% elsif work.nil? %>
<% if activity.anonymous_comment == 1 || activity.homework_detail_manual.try(:comment_status).to_i < 3 %>
<% if activity.allow_late && activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
<% elsif work.nil? && setting_time.end_time >= Time.now %>
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
<% if project.nil? %>
<%= link_to "关联项目", new_student_work_project_student_work_index_path(:homework => activity.id, :user_activity_id => user_activity_id, :hw_status => hw_status), remote: true, :class => 'edu-filter-btn edu-activity-blue ml15 fl mt5', :title => '请各组长关联作业项目' %>
<%= link_to "提交作品", "javascript:void(0)", :class => 'edu-filter-btn edu-activity-blue ml15 fl mt5', :style => "cursor:not-allowed", :title => '请先关联项目再提交作品' %>
<% else %>
<a href="javascript:void(0);" class="edu-filter-btn edu-activity-light-grey ml15 fl mt5" title="取消关联项目" onclick="delete_confirm_box('<%= cancel_relate_project_student_work_index_path(:homework => activity.id,:user_activity_id=>user_activity_id, :hw_status => hw_status) %>', '您确定要取消关联吗?')">取消关联</a>
<%= link_to "提交作品", new_student_work_url_without_domain(activity.id), :class => 'edu-filter-btn edu-activity-blue ml15 fl mt5' %>
<% end %>
<% else %>
<%= link_to "提交作品", new_student_work_url_without_domain(activity.id), :class => 'edu-filter-btn edu-activity-blue ml15 fl mt5' %>
<% end %>
<%= un_commit_work_status project, activity %>
<% else %>
<% if activity.homework_detail_manual.try(:comment_status).to_i == 3 %>
<span class="edu-filter-btn <%= homework_status_color "匿评中" %> ml15 fl mt5">匿评中</span>
<% if activity.allow_late && activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
<% if project.nil? %>
<%= link_to "关联项目", new_student_work_project_student_work_index_path(:homework => activity.id, :user_activity_id => user_activity_id, :hw_status => hw_status), remote: true, :class => 'edu-filter-btn edu-activity-blue ml15 fl mt5', :title => '请各组长关联作业项目' %>
<% else %>
<a href="javascript:void(0);" class="edu-filter-btn edu-activity-light-grey ml15 fl mt5" title="取消关联项目" onclick="delete_confirm_box('<%= cancel_relate_project_student_work_index_path(:homework => activity.id,:user_activity_id=>user_activity_id, :hw_status => hw_status) %>', '您确定要取消关联吗?')">取消关联</a>
<% end %>
<% end %>
<%= un_commit_work_status project, activity %>
<% elsif activity.homework_detail_manual.try(:comment_status).to_i == 4 || activity.homework_detail_manual.try(:comment_status).to_i > 4 %>
<% if activity.homework_detail_manual.try(:comment_status).to_i == 4 %>
<span class="edu-filter-btn <%= homework_status_color "申诉中" %> ml15 fl mt5">申诉中</span>
<% else %>
<span class="edu-filter-btn <%= homework_status_color "评阅中" %> ml15 fl mt5">评阅中</span>
<% end %>
<% elsif work.nil? %>
<% if activity.anonymous_comment == 1 || activity.homework_detail_manual.try(:comment_status).to_i < 3 %>
<% if activity.allow_late && activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
<% if project.nil? %>
<%= link_to "关联项目", new_student_work_project_student_work_index_path(:homework => activity.id, :user_activity_id => user_activity_id, :hw_status => hw_status), remote: true, :class => 'edu-filter-btn edu-activity-blue ml15 fl mt5', :title => '请各组长关联作业项目' %>
@ -142,48 +118,74 @@
<% end %>
<% end %>
<%= un_commit_work_status project, activity %>
<% end %>
<% end %>
<% elsif work.present? %>
<% if setting_time.end_time >= Time.now %>
<span class="edu-filter-btn <%= homework_status_color "提交中" %> ml15 fl mt5">提交中</span>
<%= link_to "修改作品", edit_student_work_url_without_domain(work.id), :class => 'edu-filter-btn edu-activity-orange ml15 fl mt5' %>
<% else %>
<% if activity.anonymous_comment == 1 || activity.homework_detail_manual.try(:comment_status).to_i < 3 %>
<%= late_commit_work_status work, activity %>
<%= link_to "查看作品", student_work_path(work), :class => 'edu-filter-btn edu-activity-green ml15 fl mt5' %>
<% else %>
<% work_ids = "(" + activity.student_works.has_committed.map(&:id).join(",") + ")" %>
<% if activity.homework_detail_manual.try(:comment_status).to_i == 3 %>
<% if activity.allow_late %>
<% if User.current.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count > 0 %>
<%= link_to "补交附件", student_work_path(work, :is_focus => 1), :class => 'edu-filter-btn edu-activity-orange ml15 fl mt5', :title => "可追加作品修订附件" %>
<% link_to "匿评作品", student_work_index_path(:homework => activity.id), :class => 'edu-filter-btn edu-activity-grey ml15 fl mt5', :title => "开启匿评后不可修改作品" %>
<% else %>
<span class="edu-filter-btn <%= homework_status_color "匿评中" %> ml15 fl mt5">匿评中</span>
<%= link_to "补交附件", student_work_path(work, :is_focus => 1), :class => 'edu-filter-btn edu-activity-orange ml15 fl mt5', :title => "可追加作品修订附件" %>
<% end %>
<% else %>
<% if User.current.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count > 0 %>
<span class="edu-filter-btn <%= homework_status_color "未开启补交" %> ml15 fl mt5">未开启补交</span>
<% link_to "匿评作品", student_work_index_path(:homework => activity.id), :class => 'edu-filter-btn edu-activity-grey ml15 fl mt5', :title => "开启匿评后不可修改作品" %>
<span class="edu-filter-btn <%= homework_status_color "匿评中" %> ml15 fl mt5">匿评中</span>
<% if activity.allow_late && activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
<% if project.nil? %>
<%= link_to "关联项目", new_student_work_project_student_work_index_path(:homework => activity.id, :user_activity_id => user_activity_id, :hw_status => hw_status), remote: true, :class => 'edu-filter-btn edu-activity-blue ml15 fl mt5', :title => '请各组长关联作业项目' %>
<% else %>
<span class="edu-filter-btn <%= homework_status_color "匿评中" %> ml15 fl mt5">匿评中</span>
<span class="edu-filter-btn <%= homework_status_color "未开启补交" %> ml15 fl mt5">未开启补交</span>
<a href="javascript:void(0);" class="edu-filter-btn edu-activity-light-grey ml15 fl mt5" title="取消关联项目" onclick="delete_confirm_box('<%= cancel_relate_project_student_work_index_path(:homework => activity.id,:user_activity_id=>user_activity_id, :hw_status => hw_status) %>', '您确定要取消关联吗?')">取消关联</a>
<% end %>
<% end %>
<%= un_commit_work_status project, activity %>
<% elsif activity.homework_detail_manual.try(:comment_status).to_i == 4 || activity.homework_detail_manual.try(:comment_status).to_i > 4 %>
<% if activity.homework_detail_manual.try(:comment_status).to_i == 4 %>
<span class="edu-filter-btn <%= homework_status_color "申诉中" %> ml15 fl mt5">申诉中</span>
<% else %>
<span class="edu-filter-btn <%= homework_status_color "评阅中" %> ml15 fl mt5">评阅中</span>
<% end %>
<% if activity.allow_late %>
<%= link_to "补交附件", student_work_path(work, :is_focus => 1), :class => 'edu-filter-btn edu-activity-orange ml15 fl mt5', :title => "可追加作品修订附件" %>
<%= link_to "查看作品", student_work_path(work), :class => 'edu-filter-btn edu-activity-green ml15 fl mt5' %>
<% else %>
<span class="edu-filter-btn <%= homework_status_color "未开启补交" %> ml15 fl mt5">未开启补交</span>
<%= link_to "查看作品", student_work_path(work), :class => 'edu-filter-btn edu-activity-green ml15 fl mt5' %>
<% if activity.allow_late && activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
<% if project.nil? %>
<%= link_to "关联项目", new_student_work_project_student_work_index_path(:homework => activity.id, :user_activity_id => user_activity_id, :hw_status => hw_status), remote: true, :class => 'edu-filter-btn edu-activity-blue ml15 fl mt5', :title => '请各组长关联作业项目' %>
<% else %>
<a href="javascript:void(0);" class="edu-filter-btn edu-activity-light-grey ml15 fl mt5" title="取消关联项目" onclick="delete_confirm_box('<%= cancel_relate_project_student_work_index_path(:homework => activity.id,:user_activity_id=>user_activity_id, :hw_status => hw_status) %>', '您确定要取消关联吗?')">取消关联</a>
<% end %>
<% end %>
<%= un_commit_work_status project, activity %>
<% end %>
<% end %>
<% elsif work.present? %>
<% if setting_time.end_time >= Time.now %>
<span class="edu-filter-btn <%= homework_status_color "提交中" %> ml15 fl mt5">提交中</span>
<%= link_to "修改作品", edit_student_work_url_without_domain(work.id), :class => 'edu-filter-btn edu-activity-orange ml15 fl mt5' %>
<% else %>
<% if activity.anonymous_comment == 1 || activity.homework_detail_manual.try(:comment_status).to_i < 3 %>
<%= late_commit_work_status work, activity %>
<%= link_to "查看作品", student_work_path(work), :class => 'edu-filter-btn edu-activity-green ml15 fl mt5' %>
<% else %>
<% work_ids = "(" + activity.student_works.has_committed.map(&:id).join(",") + ")" %>
<% if activity.homework_detail_manual.try(:comment_status).to_i == 3 %>
<% if activity.allow_late %>
<% if User.current.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count > 0 %>
<%= link_to "补交附件", student_work_path(work, :is_focus => 1), :class => 'edu-filter-btn edu-activity-orange ml15 fl mt5', :title => "可追加作品修订附件" %>
<% link_to "匿评作品", student_work_index_path(:homework => activity.id), :class => 'edu-filter-btn edu-activity-grey ml15 fl mt5', :title => "开启匿评后不可修改作品" %>
<% else %>
<span class="edu-filter-btn <%= homework_status_color "匿评中" %> ml15 fl mt5">匿评中</span>
<%= link_to "补交附件", student_work_path(work, :is_focus => 1), :class => 'edu-filter-btn edu-activity-orange ml15 fl mt5', :title => "可追加作品修订附件" %>
<% end %>
<% else %>
<% if User.current.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count > 0 %>
<span class="edu-filter-btn <%= homework_status_color "未开启补交" %> ml15 fl mt5">未开启补交</span>
<% link_to "匿评作品", student_work_index_path(:homework => activity.id), :class => 'edu-filter-btn edu-activity-grey ml15 fl mt5', :title => "开启匿评后不可修改作品" %>
<% else %>
<span class="edu-filter-btn <%= homework_status_color "匿评中" %> ml15 fl mt5">匿评中</span>
<span class="edu-filter-btn <%= homework_status_color "未开启补交" %> ml15 fl mt5">未开启补交</span>
<% end %>
<% end %>
<% elsif activity.homework_detail_manual.try(:comment_status).to_i == 4 || activity.homework_detail_manual.try(:comment_status).to_i > 4 %>
<% if activity.homework_detail_manual.try(:comment_status).to_i == 4 %>
<span class="edu-filter-btn <%= homework_status_color "申诉中" %> ml15 fl mt5">申诉中</span>
<% else %>
<span class="edu-filter-btn <%= homework_status_color "评阅中" %> ml15 fl mt5">评阅中</span>
<% end %>
<% if activity.allow_late %>
<%= link_to "补交附件", student_work_path(work, :is_focus => 1), :class => 'edu-filter-btn edu-activity-orange ml15 fl mt5', :title => "可追加作品修订附件" %>
<%= link_to "查看作品", student_work_path(work), :class => 'edu-filter-btn edu-activity-green ml15 fl mt5' %>
<% else %>
<span class="edu-filter-btn <%= homework_status_color "未开启补交" %> ml15 fl mt5">未开启补交</span>
<%= link_to "查看作品", student_work_path(work), :class => 'edu-filter-btn edu-activity-green ml15 fl mt5' %>
<% end %>
<% end %>
<% end %>
<% end %>

@ -8,6 +8,8 @@
<% if activity.sticky == 1%>
<span class="fl btn-cir btn-cir-red mt5 ml15">置顶</span>
<% end%>
<% if false %>
<% if @is_teacher %>
<div class="fr mr20 edu-menu-panel">
<i class="iconfont icon-caidan color-blue"></i>
@ -25,6 +27,8 @@
</ul>
</div>
<% end%>
<% end %>
</div>
<p>
<%= link_to activity.author.show_real_name, user_path(activity.author), :class => "color-grey-6 mr30" %>

@ -10,12 +10,13 @@
<% end %>
<% if @is_teacher || !User.current.member_of_course?(activity.course) %>
<% ex_curr_status = poll_curr_time activity %>
<% if ex_curr_status[:status] != "" %>
<span class="edu-filter-btn <%= homework_status_color ex_curr_status[:status] %> ml15 fl mt5"><%= ex_curr_status[:status] %></span>
<% end %>
<% ex_curr_status = poll_curr_time activity %>
<% if ex_curr_status[:status] != "" %>
<span class="edu-filter-btn <%= homework_status_color ex_curr_status[:status] %> ml15 fl mt5"><%= ex_curr_status[:status] %></span>
<% end %>
<% end %>
<% if false %>
<% if @is_teacher %>
<div class="fr mr20 edu-menu-panel">
<i class="iconfont icon-caidan color-blue"></i>
@ -63,6 +64,8 @@
<%= link_to "开始答题", poll_path(activity,:user_id => User.current.id), :class => "edu-activity-blue edu-filter-btn ml15 fl mt5" %>
<% end %>
<% end%>
<% end %>
</div>
<p>
<%= link_to activity.user.show_real_name, user_path(activity.user), :class => "color-grey-6 mr30" %>

Loading…
Cancel
Save