diff --git a/app/helpers/api_helper.rb b/app/helpers/api_helper.rb index f73cc87e6..8324951f9 100644 --- a/app/helpers/api_helper.rb +++ b/app/helpers/api_helper.rb @@ -180,7 +180,7 @@ module ApiHelper if timePassed < 0 updateAtValue = "时间有问题" elsif timePassed < ONE_MINUTE - updateAtValue = "一分钟前" + updateAtValue = "1分钟前" elsif timePassed < ONE_HOUR timeIntoFormat = timePassed / ONE_MINUTE updateAtValue = timeIntoFormat.to_s + "分钟前" diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index 9699eff5f..4039059a4 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -44,7 +44,27 @@ 教师评阅中 <% end%> <% end%> +
+ <% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%> + 系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合! + <% elsif activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 0%> + 系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合! + <% end %>
+ <% if activity.homework_type == 3 && !is_teacher && activity.homework_detail_group.base_on_project == 1 && User.current.member_of_course?(activity.course)%> + <% projects = cur_user_projects_for_homework activity %> + <% works = cur_user_works_for_homework activity %> + <% if works.nil? && projects.nil? %> +
+ <%=link_to "关联项目",new_student_work_project_student_work_index_path(:homework => activity.id,:is_in_course=>-1,:user_activity_id=>user_activity_id,:course_activity=>course_activity),remote: true,:class=> 'c_blue', :title=> '请各组长关联作业项目' %> + <%#= relate_project(activity,is_teacher,-1,user_activity_id,course_activity) %> +
+ <% elsif works.nil? %> +
+ <%=link_to "取消关联",cancel_relate_project_student_work_index_path(:homework => activity.id,:is_in_course=>-1,:user_activity_id=>user_activity_id,:course_activity=>course_activity), :confirm => "您确定要取消关联吗?", remote: true,:class => "c_blue", :title=> '取消关联项目' %> +
+ <% end %> + <% end %>
<% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %> <%= user_for_homework_common activity,is_teacher %> @@ -61,8 +81,16 @@ <%= activity.language_name%>
<% end %> - -
截止时间:<%= activity.end_time.to_s %> 23:59
+ <% if activity.homework_type == 3 && activity.homework_detail_group%> +
+ 分组人数:<%=activity.homework_detail_group.min_num %>-<%=activity.homework_detail_group.max_num %> 人 +
+ <% end %> + <% if activity.homework_detail_manual && activity.homework_detail_manual.comment_status < 2 %> +
提交截止时间:<%= activity.end_time.to_s %> 23:59
+ <% elsif activity.homework_detail_manual && activity.homework_detail_manual.comment_status >= 2 %> +
匿评截止时间:<%= activity.homework_detail_manual.evaluation_end.to_s %> 23:59
+ <% end %>
@@ -73,10 +101,88 @@
+
+
+ 迟交扣分:<%= activity.late_penalty%>分 +
+ <% if activity.anonymous_comment == 0%> +
+ 匿评开启时间:<%= activity.homework_detail_manual.evaluation_start%> 00:00 +
+ <% end %> +
+
+
+
+ 缺评扣分:<%= activity.homework_detail_manual.absence_penalty%>分/作品 +
+ <% if activity.anonymous_comment == 0%> +
+ 匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end%> 23:59 +
+ <% end %> +
+
+ <% if activity.student_works.count != 0 %> + <% sw = activity.student_works.reorder("created_at desc").first %> +
+ <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品 +
+ <% end %> +
+ <% if activity.student_works.count != 0 %> + <% sw_id = "("+activity.student_works.map{|sw| sw.id}.join(",")+")" %> + <% student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %> + <% unless student_work_scores.empty? %> + <% last_score = student_work_scores.first %> +
+ <%=time_from_now last_score.created_at %><%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品 +
+ <% end %> + <% end %> +
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => activity.attachments} %>
+ <% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %> +
+ <% projects = activity.student_work_projects.where("is_leader = 1") %> +
+ 已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %> +
+ <% projects.each do |pro| %> + <% project = Project.find pro.project_id %> + + +
+ <% if project.is_public || User.current.member_of?(project) || User.current.admin? %> + <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像" %> + <% else %> + <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像") %> + <% end %> + <% time=project.updated_on %> + <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %> +

<%=(User.find project.user_id).show_name %>(组长)

+

<%=time_from_now time %>

+
+ 项目名称:<%=project.name %>
+ 创建者:<%=(User.find project.user_id).show_name %>(组长)
+ 更新时间:<%=time_from_now time %> +
+
+ <% end %> +
+ <% end %> +
<% if is_teacher%> <% comment_status = activity.homework_detail_manual.comment_status %>
diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index a0ce84795..cd1ffd7ae 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -124,6 +124,24 @@ <% end %>
+ <% if activity.student_works.count != 0 %> + <% sw = activity.student_works.reorder("created_at desc").first %> +
+ <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品 +
+ <% end %> +
+ <% if activity.student_works.count != 0 %> + <% sw_id = "("+activity.student_works.map{|sw| sw.id}.join(",")+")" %> + <% student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %> + <% unless student_work_scores.empty? %> + <% last_score = student_work_scores.first %> +
+ <%=time_from_now last_score.created_at %><%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品 +
+ <% end %> + <% end %> +
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => activity.attachments} %>
@@ -131,7 +149,7 @@ <% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
<% projects = activity.student_work_projects.where("is_leader = 1") %> -
+
已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
<% projects.each do |pro| %> diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index 0472613e4..7a91827a6 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -127,6 +127,24 @@ <% end %>
+ <% if homework_common.student_works.count != 0 %> + <% sw = homework_common.student_works.reorder("created_at desc").first %> +
+ <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品 +
+ <% end %> +
+ <% if homework_common.student_works.count != 0 %> + <% sw_id = "("+homework_common.student_works.map{|sw| sw.id}.join(",")+")" %> + <% student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %> + <% unless student_work_scores.empty? %> + <% last_score = student_work_scores.first %> +
+ <%=time_from_now last_score.created_at %><%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品 +
+ <% end %> + <% end %> +
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => homework_common.attachments} %>
diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index b37a38da0..2279f0fe5 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -103,4 +103,8 @@ ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; } .sectionContent span {width:175px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:inline-block; height:18px; vertical-align:middle;}.popbox_polls{width:300px;height:100px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-100px 0 0 -150px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;} .org_login_list a {color:#269ac9;} -div.flash {margin-top :0px !important} \ No newline at end of file +div.flash {margin-top :0px !important} + +.w80{ width:80px;} +.relatePInfo {text-align: left; position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;} +.captainName {max-width:40px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-block;} \ No newline at end of file