diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 7793ef097..55807886b 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -217,7 +217,12 @@ class HomeworkCommonController < ApplicationController #评分设置 def score_rule_set - + if params[:user_activity_id] + @user_activity_id = params[:user_activity_id] + else + @user_activity_id = -1 + end + @is_in_course = params[:is_in_course] end private diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 529c5ea72..25782ec4b 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -108,6 +108,7 @@ class StudentWorkController < ApplicationController else @stundet_works = [] end + @student_work_count = (search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name).count else if @is_teacher || @homework.homework_detail_manual.nil? #老师 || 超级管理员 显示所有列表 @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name @@ -128,6 +129,7 @@ class StudentWorkController < ApplicationController else @stundet_works = [] end + @student_work_count = (search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name).count end @score = @b_sort == "desc" ? "asc" : "desc" @@ -456,14 +458,14 @@ class StudentWorkController < ApplicationController student_work.save end end - respond_to do |format| - format.html{ - if params[:student_path] - redirect_to student_work_index_url(:homework => @homework.id) - else - redirect_to user_homeworks_user_path(User.current.id) - end - } + if params[:student_path] + redirect_to student_work_index_url(:homework => @homework.id) + else + @user_activity_id = params[:user_activity_id] + @is_in_course = params[:is_in_course] + respond_to do |format| + format.js + end end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7289d534b..84364b4f6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2355,16 +2355,16 @@ module ApplicationHelper else #学生显示提交作品、修改作品等按钮 work = cur_user_works_for_homework homework if work.nil? - link_to "提交作品", new_student_work_path(:homework => homework.id),:class => 'c_blue' + link_to "提交作品(#{homework.student_works.count})", new_student_work_path(:homework => homework.id),:class => 'c_blue' else if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 #匿评作业,且作业状态不是在开启匿评之前 link_to "作品匿评", student_work_index_path(:homework => homework.id), :class => 'c_blue', :title => "开启匿评后不可修改作品" elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3 link_to "匿评结束", student_work_index_path(:homework => homework.id), :class => 'c_blue', :title => "匿评已结束" elsif homework.homework_type == 2 #编程作业不能修改作品 - link_to "修改作品", new_student_work_path(:homework => homework.id),:class => 'c_blue' + link_to "修改作品(#{homework.student_works.count})", new_student_work_path(:homework => homework.id),:class => 'c_blue' else - link_to "修改作品", edit_student_work_path(work.id),:class => 'c_blue' + link_to "修改作品(#{homework.student_works.count})", edit_student_work_path(work.id),:class => 'c_blue' end end end diff --git a/app/views/courses/join_private_courses.js.erb b/app/views/courses/join_private_courses.js.erb index 8a1680030..0c44770bd 100644 --- a/app/views/courses/join_private_courses.js.erb +++ b/app/views/courses/join_private_courses.js.erb @@ -1,3 +1,4 @@ +$('#topnav_course_menu').hide(); $('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_private_course') %>'); showModal('ajax-modal', '540px'); $('#ajax-modal').css('height','390px'); diff --git a/app/views/homework_common/_set_evalutation_att.html.erb b/app/views/homework_common/_set_evalutation_att.html.erb index 01d9351ee..d51713e9a 100644 --- a/app/views/homework_common/_set_evalutation_att.html.erb +++ b/app/views/homework_common/_set_evalutation_att.html.erb @@ -7,7 +7,7 @@ 开启匿评
- <%= calendar_for('evaluation_start_time')%> + <%#= calendar_for('evaluation_start_time')%>

@@ -18,7 +18,7 @@ 关闭匿评
- <%= calendar_for('evaluation_end_time')%> + <%#= calendar_for('evaluation_end_time')%>

diff --git a/app/views/homework_common/score_rule_set.js.erb b/app/views/homework_common/score_rule_set.js.erb index 5ff42dff7..a3afb0c9a 100644 --- a/app/views/homework_common/score_rule_set.js.erb +++ b/app/views/homework_common/score_rule_set.js.erb @@ -1,4 +1,4 @@ -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework, :student_path => false}) %>'); +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:is_in_course => @is_in_course,:remote=>true}) %>'); showModal('ajax-modal', '350px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("" + diff --git a/app/views/homework_common/start_evaluation_set.js.erb b/app/views/homework_common/start_evaluation_set.js.erb index 9d494f908..aac4ecd66 100644 --- a/app/views/homework_common/start_evaluation_set.js.erb +++ b/app/views/homework_common/start_evaluation_set.js.erb @@ -1,6 +1,10 @@ $('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_common/set_evalutation_att') %>'); +var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: 0, showOn: 'button', buttonImageOnly: true, buttonImage: '/images/public_icon.png', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true}; showModal('ajax-modal', '350px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("" + ""); -$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed"); \ No newline at end of file +$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed"); +$(function() { $('#evaluation_start_time').datepicker(datepickerOptions); + $('#evaluation_end_time').datepicker(datepickerOptions); +}); \ No newline at end of file diff --git a/app/views/student_work/_set_score_rule.html.erb b/app/views/student_work/_set_score_rule.html.erb index 508b89a1c..26e3b06cb 100644 --- a/app/views/student_work/_set_score_rule.html.erb +++ b/app/views/student_work/_set_score_rule.html.erb @@ -1,66 +1,9 @@ -<%= form_for('new_form',:url => {:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id},:method => "post") do |f|%> - <% if student_path %> - <%=hidden_field_tag 'student_path', params[:student_path], :value => student_path %> - <% end %> -
- 评分设置 -
- 迟交扣分 - -
-
- 缺评扣分 - -
- - <% if homework.homework_type == 2%> -
- 系统评分 - <%= select_tag :sy_proportion,options_for_select(ta_proportion_option,homework.homework_detail_programing.ta_proportion), {:class => "markPercentage"} %> -
- - - <% else%> - - <% end%> - -
- 教辅评分 - <%= select_tag :ta_proportion,options_for_select(ta_proportion_option_to(100-(homework.homework_detail_programing ? homework.homework_detail_programing.ta_proportion * 100 : 0).to_i),homework.homework_detail_manual.ta_proportion), {:class => "markPercentage"} %> -
-
- 学生匿评 - -
-
- 教师优先 - /> - 教师评分为最终评分 -
-
-
- 确定 -
-
- 取消 -
-
-
-
-<% end%> +<% if student_path%> + <%= form_for('new_form',:url => {:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id,:student_path => student_path},:method => "post") do |f|%> + <% render :partial => 'student_work/set_score_rule_detail', :locals => {:homework => homework, :f => f}%> + <% end%> +<% else %> + <%= form_for('new_form',:url => {:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id,:user_activity_id=>user_activity_id,:is_in_course=>is_in_course},:method => "post",:remote => true) do |f|%> + <% render :partial => 'student_work/set_score_rule_detail', :locals => {:homework => homework, :f => f}%> + <% end%> +<% end %> \ No newline at end of file diff --git a/app/views/student_work/_set_score_rule_detail.html.erb b/app/views/student_work/_set_score_rule_detail.html.erb new file mode 100644 index 000000000..f49bb2c69 --- /dev/null +++ b/app/views/student_work/_set_score_rule_detail.html.erb @@ -0,0 +1,61 @@ +
+ 评分设置 +
+ 迟交扣分 + +
+
+ 缺评扣分 + +
+ + <% if homework.homework_type == 2%> +
+ 系统评分 + <%= select_tag :sy_proportion,options_for_select(ta_proportion_option,homework.homework_detail_programing.ta_proportion), {:class => "markPercentage"} %> +
+ + + <% else%> + + <% end%> + +
+ 教辅评分 + <%= select_tag :ta_proportion,options_for_select(ta_proportion_option_to(100-(homework.homework_detail_programing ? homework.homework_detail_programing.ta_proportion * 100 : 0).to_i),homework.homework_detail_manual.ta_proportion), {:class => "markPercentage"} %> +
+
+ 学生匿评 + +
+
+ 教师优先 + /> + 教师评分为最终评分 +
+
+
+ 确定 +
+
+ 取消 +
+
+
+
\ No newline at end of file diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb index 2d0e9220c..e23fcceda 100644 --- a/app/views/student_work/_student_work_list.html.erb +++ b/app/views/student_work/_student_work_list.html.erb @@ -2,8 +2,11 @@ 作品 - (<%= @stundet_works.count%>) + (<%= @student_work_count%>) + <% if !@is_teacher && @stundet_works.empty?%> + 未提交 + <% end %> <%if @is_teacher || @homework.homework_detail_manual.comment_status == 3%>
diff --git a/app/views/student_work/new.html.erb b/app/views/student_work/new.html.erb index 09544d004..072c26185 100644 --- a/app/views/student_work/new.html.erb +++ b/app/views/student_work/new.html.erb @@ -59,6 +59,10 @@
<%= @homework.description.html_safe %>
+
+ <%= render :partial => 'student_work/work_attachments', :locals => {:attachments => @homework.attachments} %> +
+
diff --git a/app/views/student_work/set_score_rule.js.erb b/app/views/student_work/set_score_rule.js.erb new file mode 100644 index 000000000..ff3a0e7ed --- /dev/null +++ b/app/views/student_work/set_score_rule.js.erb @@ -0,0 +1,8 @@ +clickCanel(); +<% if @user_activity_id %> + $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id}) %>"); + init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%"); +<% else %> + $("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework,:is_in_course => @is_in_course}) %>"); + init_activity_KindEditor_data(<%= @homework.id%>,"","87%"); +<% end %> \ No newline at end of file diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 70494192d..aa0344800 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -56,28 +56,31 @@ <%= render :partial => 'student_work/work_attachments', :locals => {:attachments => activity.attachments} %>
- <%# if is_teacher%> - + <% end%>
diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index 4570f365c..25f14ab31 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -69,7 +69,7 @@ <%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common,:is_in_course => is_in_course),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
  • - <%= link_to("评分设置", score_rule_set_homework_common_path(homework_common),:class => "postOptionLink", :remote => true) %> + <%= link_to("评分设置", score_rule_set_homework_common_path(homework_common, :is_in_course => is_in_course),:class => "postOptionLink", :remote => true) %>
  • <%= link_to("匿评设置", start_evaluation_set_homework_common_path(homework_common),:class => "postOptionLink", :remote => true) if homework_common.homework_detail_manual.comment_status == 1%> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index fc87bd3a0..2805c4379 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,3 +1,4 @@ +
    最新动态
    diff --git a/lib/trustie/gitlab/manage_member.rb b/lib/trustie/gitlab/manage_member.rb index d0f74ad5e..b8c2149f4 100644 --- a/lib/trustie/gitlab/manage_member.rb +++ b/lib/trustie/gitlab/manage_member.rb @@ -42,11 +42,15 @@ module Trustie end def repository - project.repository + unless project.nil? + project.repository + end end def isGitlabProject? - repository && repository.gitlab? + unless repository.nil? + repository && repository.gitlab? + end end end diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index db947bd1b..b4ef37dbc 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -483,8 +483,8 @@ a.uploadIcon {background:url(images/resource_icon_list.png) 8px -60px no-repeat; .resourceClose {background:url(images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000;} .resourcesSearchBox {border:1px solid #e6e6e6; width:225px; height:25px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;} .searchResourcePopup {border:none; outline:none; background-color:#ffffff; width:184px; height:25px; padding-left:10px; display:inline-block; float:left;} -.searchIconPopup{width:31px; height:25px; background-color:#ffffff; background:url(images/resource_icon_list.png) -40px -18px no-repeat; display:inline-block; float:left;} -.searchIconPopup:hover {cursor: pointer} +.searchIconPopup{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon.png) 5px -394px no-repeat; display:inline-block; float:left; cursor: pointer;} +.searchIconPopup:hover {background:url(../images/homepage_icon.png) 5px -420px no-repeat;} .courseSend {width:390px; height:15px; line-height:15px; margin-bottom:10px;display:block;white-space:nowrap;} .courseSendCheckbox {padding:0px; margin:0px; width:12px; height:12px; margin-right:10px; display:inline-block; margin-top:2px;} .sendCourseName {font-size:12px; color:#5f6060;display:inline-block}