From c5e298d24e2aea3643aede1f86c1d8ba3dbbef58 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Sat, 4 Jul 2015 15:53:01 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=81=9C=E6=AD=A2=E5=8C=BF=E8=AF=84=20api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/apis/courses.rb | 13 +-- app/api/mobile/apis/homeworks.rb | 93 ++++++++++----- app/api/mobile/entities/course_dynamic.rb | 3 + app/api/mobile/entities/homework.rb | 8 +- app/services/courses_service.rb | 72 ++++++------ app/services/homework_service.rb | 132 +++++++++++++++------- 6 files changed, 201 insertions(+), 120 deletions(-) diff --git a/app/api/mobile/apis/courses.rb b/app/api/mobile/apis/courses.rb index 3d05ab3f3..509d31d86 100644 --- a/app/api/mobile/apis/courses.rb +++ b/app/api/mobile/apis/courses.rb @@ -337,18 +337,7 @@ module Mobile present :data,student_works.all,with:Mobile::Entities::StudentWork end - desc '开启匿评' - params do - requires :token,type:String - requires :course_id,type:Integer,desc:'课程id' - requires :homework_id,type:Integer,desc:'作业id' - end - get ':course_id/start_anonymous_comment' do - cs = CoursesService.new - status = cs.start_anonymous_comment params,current_user - present :data,status - present :status,0 - end + end end end diff --git a/app/api/mobile/apis/homeworks.rb b/app/api/mobile/apis/homeworks.rb index 5bf454e32..e9efcb1fa 100644 --- a/app/api/mobile/apis/homeworks.rb +++ b/app/api/mobile/apis/homeworks.rb @@ -31,33 +31,33 @@ module Mobile present :status, 0 end - desc "启动匿评" - params do - requires :token, type: String - end - post ':id/start_anonymous_comment' do - statue = Homeworks.get_service.start_anonymous_comment params,current_user.nil? ? User.find(2):current_user - messages = "" - case statue - when 1 - messages = "启动成功" - when 2 - messages = "启动失败,作业总数大于等于2份时才能启动匿评" - when 3 - messages = "已开启匿评,请务重复开启" - end - present :data,messages - present :status, statue - end - - desc "关闭匿评" - params do - requires :token, type: String - end - post ':id/stop_anonymous_comment' do - Homeworks.get_service.stop_anonymous_comment params,current_user.nil? ? User.find(2):current_user - present :status, 0 - end + # desc "启动匿评" + # params do + # requires :token, type: String + # end + # post ':id/start_anonymous_comment' do + # statue = Homeworks.get_service.start_anonymous_comment params,current_user.nil? ? User.find(2):current_user + # messages = "" + # case statue + # when 1 + # messages = "启动成功" + # when 2 + # messages = "启动失败,作业总数大于等于2份时才能启动匿评" + # when 3 + # messages = "已开启匿评,请务重复开启" + # end + # present :data,messages + # present :status, statue + # end + # + # desc "关闭匿评" + # params do + # requires :token, type: String + # end + # post ':id/stop_anonymous_comment' do + # Homeworks.get_service.stop_anonymous_comment params,current_user.nil? ? User.find(2):current_user + # present :status, 0 + # end desc "匿评作品详情" params do @@ -111,6 +111,45 @@ module Mobile present :status, 0 end + desc '开启匿评' + params do + requires :token,type:String + requires :course_id,type:Integer,desc:'课程id' + requires :homework_id,type:Integer,desc:'作业id' + end + post ':homework_id/start_anonymous_comment' do + hs = Homeworks.get_service + status = hs.start_anonymous_comment params,current_user + messages = "" + case status[:status] + when 1 + messages = "启动成功" + when 2 + messages = "启动失败,作业总数大于等于2份时才能启动匿评" + when 3 + messages = "已开启匿评,请务重复开启" + when 4 + messages = "没有开启匿评的权限" + when 5 + messages = "截止日期之前不可启动匿评" + end + present :data,messages + present :status,0 + end + + desc '关闭匿评' + params do + requires :token,type:String + requires :course_id,type:Integer,desc:'课程id' + requires :homework_id,type:Integer,desc:'作业id' + end + post ':homework_id/stop_anonymous_comment' do + hs = Homeworks.get_service + hs.stop_anonymous_comment params,current_user + message = "成功关闭" + present :data, message + present :status,0 + end end end diff --git a/app/api/mobile/entities/course_dynamic.rb b/app/api/mobile/entities/course_dynamic.rb index 46ab5b272..f9bc5a8ee 100644 --- a/app/api/mobile/entities/course_dynamic.rb +++ b/app/api/mobile/entities/course_dynamic.rb @@ -58,6 +58,9 @@ module Mobile course_dynamic_expose :document_count course_dynamic_expose :topic_count course_dynamic_expose :homework_count + + course_dynamic_expose :current_user_is_member + course_dynamic_expose :current_user_is_teacher #在dynamics里解析出四种动态 expose :documents,using:Mobile::Entities::Attachment do |f,opt| obj = nil diff --git a/app/api/mobile/entities/homework.rb b/app/api/mobile/entities/homework.rb index e78689bfb..03edd502f 100644 --- a/app/api/mobile/entities/homework.rb +++ b/app/api/mobile/entities/homework.rb @@ -24,11 +24,11 @@ module Mobile f.course.members.count - f.student_works.count when :homework_submit_num f.student_works.count - when :homework_status + when :homework_status_student get_homework_status f when :homework_times f.course.homework_commons.index(f) + 1 - when :homework_status_desc + when :homework_status_teacher homework_status_desc f end end @@ -82,8 +82,8 @@ module Mobile expose :submit_student_list ,using: Mobile::Entities::User do |f,opt| get_submit_sutdent_list f end - homework_expose :homework_status #作业的状态 - homework_expose :homework_status_desc #状态的解释 + homework_expose :homework_status_student #老师看到的作业的状态 + homework_expose :homework_status_teacher #老师看到的状态 end end diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 7efe76b3a..545ab1dac 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -699,7 +699,7 @@ class CoursesService latest_course_dynamics.sort! { |order, newer| newer[:time] <=> order[:time] } latest_course_dynamic = latest_course_dynamics.first unless latest_course_dynamic.nil? - result << {:course_name => course.name, :course_id => course.id, :course_img_url => url_to_avatar(course), :course_time => course.time, :course_term => course.term,:message => dynamics_count, :dynamics => latest_course_dynamics, :count => dynamics_count} + result << {:course_name => course.name,:current_user_is_member => current_user.member_of_course?(course),:current_user_is_teacher => is_course_teacher(current_user,course), :course_id => course.id, :course_img_url => url_to_avatar(course), :course_time => course.time, :course_term => course.term,:message => dynamics_count, :dynamics => latest_course_dynamics, :count => dynamics_count} end end #返回数组集合 @@ -746,41 +746,41 @@ class CoursesService student_works end - # 开启匿评 - #statue 1:启动成功,2:启动失败,作业总数大于等于2份时才能启动匿评,3:已开启匿评,请务重复开启,4:没有开启匿评的权限 - def start_anonymous_comment params,current_user - homework = HomeworkCommon.find(params[:homework_id]) - return {:status=>4} unless current_user.admin? || current_user.allowed_to?(:as_teacher,Course.find(params[:course_id])) - return {:status=>5} if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") - homework_detail_manual = homework.homework_detail_manual - if homework_detail_manual.comment_status == 1 - student_works = homework.student_works - if student_works && student_works.size >=2 - student_works.each_with_index do |work, index| - user = work.user - n = homework_detail_manual.evaluation_num - n = n < student_works.size ? n : student_works.size - 1 - assigned_homeworks = get_assigned_homeworks(student_works, n, index) - assigned_homeworks.each do |h| - student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id) - student_works_evaluation_distributions.save - end - end - homework_detail_manual.update_column('comment_status', 2) - statue = 1 - else - statue = 2 - end - else - statue = 3 - end - {:status => statue} - end - - def get_assigned_homeworks(student_works, n, index) - student_works += student_works - student_works[index + 1 .. index + n] - end + # # 开启匿评 + # #statue 1:启动成功,2:启动失败,作业总数大于等于2份时才能启动匿评,3:已开启匿评,请务重复开启,4:没有开启匿评的权限 + # def start_anonymous_comment params,current_user + # homework = HomeworkCommon.find(params[:homework_id]) + # return {:status=>4} unless current_user.admin? || current_user.allowed_to?(:as_teacher,Course.find(params[:course_id])) + # return {:status=>5} if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") + # homework_detail_manual = homework.homework_detail_manual + # if homework_detail_manual.comment_status == 1 + # student_works = homework.student_works + # if student_works && student_works.size >=2 + # student_works.each_with_index do |work, index| + # user = work.user + # n = homework_detail_manual.evaluation_num + # n = n < student_works.size ? n : student_works.size - 1 + # assigned_homeworks = get_assigned_homeworks(student_works, n, index) + # assigned_homeworks.each do |h| + # student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id) + # student_works_evaluation_distributions.save + # end + # end + # homework_detail_manual.update_column('comment_status', 2) + # statue = 1 + # else + # statue = 2 + # end + # else + # statue = 3 + # end + # {:status => statue} + # end + # + # def get_assigned_homeworks(student_works, n, index) + # student_works += student_works + # student_works[index + 1 .. index + n] + # end end diff --git a/app/services/homework_service.rb b/app/services/homework_service.rb index 2a2c6613c..dd42795b1 100644 --- a/app/services/homework_service.rb +++ b/app/services/homework_service.rb @@ -57,47 +57,97 @@ class HomeworkService [@bid,@totle_size,@cur_size,@percent] end - #启动匿评 - #statue 1:启动成功,2:启动失败,作业总数大于等于2份时才能启动匿评,3:已开启匿评,请务重复开启 - def start_anonymous_comment params,current_user - @bid = Bid.find(params[:id]) - @course = @bid.courses.first - unless is_course_teacher(current_user,@course) || current_user.admin? - @statue = 4 - raise '403' - end - if(@bid.comment_status == 0) - homeworks = @bid.homeworks - if(homeworks && homeworks.size >= 2) - homeworks.each_with_index do |homework, index| - user = homework.user - n = @bid.evaluation_num - n = n < homeworks.size ? n : homeworks.size - 1 - assigned_homeworks = get_assigned_homeworks(homeworks, n, index) - assigned_homeworks.each do |h| - @homework_evaluation = HomeworkEvaluation.new(user_id: user.id, homework_attach_id: h.id) - @homework_evaluation.save - end - end - @bid.update_column('comment_status', 1) - @statue = 1 - else - @statue = 2 - end - else - @statue = 3 - end - @statue - end - #关闭匿评 - def stop_anonymous_comment params,current_user - @bid = Bid.find(params[:id]) - @course = @bid.courses.first - unless is_course_teacher(current_user,@course) || current_user.admin? - raise '403' - end - @bid.update_column('comment_status', 2) - end + # 启动匿评 操作 逻辑改变,暂不删除 + # #启动匿评 + # #statue 1:启动成功,2:启动失败,作业总数大于等于2份时才能启动匿评,3:已开启匿评,请务重复开启 + # def start_anonymous_comment params,current_user + # @bid = Bid.find(params[:id]) + # @course = @bid.courses.first + # unless is_course_teacher(current_user,@course) || current_user.admin? + # @statue = 4 + # raise '403' + # end + # if(@bid.comment_status == 0) + # homeworks = @bid.homeworks + # if(homeworks && homeworks.size >= 2) + # homeworks.each_with_index do |homework, index| + # user = homework.user + # n = @bid.evaluation_num + # n = n < homeworks.size ? n : homeworks.size - 1 + # assigned_homeworks = get_assigned_homeworks(homeworks, n, index) + # assigned_homeworks.each do |h| + # @homework_evaluation = HomeworkEvaluation.new(user_id: user.id, homework_attach_id: h.id) + # @homework_evaluation.save + # end + # end + # @bid.update_column('comment_status', 1) + # @statue = 1 + # else + # @statue = 2 + # end + # else + # @statue = 3 + # end + # @statue + # end + # #关闭匿评 + # def stop_anonymous_comment params,current_user + # @bid = Bid.find(params[:id]) + # @course = @bid.courses.first + # unless is_course_teacher(current_user,@course) || current_user.admin? + # raise '403' + # end + # @bid.update_column('comment_status', 2) + # end + + # 开启匿评 + #statue 1:启动成功,2:启动失败,作业总数大于等于2份时才能启动匿评,3:已开启匿评,请务重复开启,4:没有开启匿评的权限 + def start_anonymous_comment params,current_user + homework = HomeworkCommon.find(params[:homework_id]) + return {:status=> 4} unless current_user.admin? || current_user.allowed_to?(:as_teacher,Course.find(params[:course_id])) + return {:status=>5} if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") + homework_detail_manual = homework.homework_detail_manual + if homework_detail_manual.comment_status == 1 + student_works = homework.student_works + if student_works && student_works.size >=2 + student_works.each_with_index do |work, index| + user = work.user + n = homework_detail_manual.evaluation_num + n = n < student_works.size ? n : student_works.size - 1 + assigned_homeworks = get_assigned_homeworks(student_works, n, index) + assigned_homeworks.each do |h| + student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id) + student_works_evaluation_distributions.save + end + end + homework_detail_manual.update_column('comment_status', 2) + statue = 1 + else + statue = 2 + end + else + statue = 3 + end + {:status => statue} + end + + def get_assigned_homeworks(student_works, n, index) + student_works += student_works + student_works[index + 1 .. index + n] + end + + def stop_anonymous_comment params,current_user + homework = HomeworkCommon.find(params[:homework_id]) + homework_detail_manual = homework.homework_detail_manual + homework_detail_manual.update_column('comment_status', 3) + + work_ids = "(" << homework.student_works.map(&:id).join(",") << ")" + homework.student_works.each do |student_work| + absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count + student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0 + student_work.save + end + end # 匿评作品详情 # attachs 该作品的所有附件 From 898ef291162c7dad53338ce83d18a012b1bd9f2b Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 6 Jul 2015 16:38:16 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=BE=97=E5=88=86?= =?UTF-8?q?=EF=BC=9A=E9=A1=B9=E7=9B=AE=E5=BE=97=E5=88=86=E4=B8=AD=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=8F=91=E5=B8=96=E5=BE=97=E5=88=86=EF=BC=88=E5=B8=96?= =?UTF-8?q?=E5=AD=90=E5=9B=9E=E5=A4=8D=E5=9C=A8=E5=8D=8F=E5=90=8C=E5=BE=97?= =?UTF-8?q?=E5=88=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/user_score_helper.rb | 4 ++-- app/views/users/_influence_new_score_index.html.erb | 3 ++- app/views/users/_topic_new_score_index.html.erb | 4 +--- config/locales/users/zh.yml | 3 ++- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/helpers/user_score_helper.rb b/app/helpers/user_score_helper.rb index c94763e31..41f76a792 100644 --- a/app/helpers/user_score_helper.rb +++ b/app/helpers/user_score_helper.rb @@ -433,7 +433,7 @@ module UserScoreHelper #协同得分 def collaboration(option_number) - option_number.memo * 2 + option_number.messages_for_issues + option_number.issues_status + option_number.replay_for_message + option_number.replay_for_memo + option_number.messages_for_issues + option_number.issues_status + option_number.replay_for_message + option_number.replay_for_memo end #影响力得分 def influence(option_number) @@ -445,7 +445,7 @@ module UserScoreHelper end #项目贡献得分 def active(option_number) - option_number.changeset * 4 + option_number.document * 4 + option_number.attachment * 4 + option_number.issue_done_ratio * 2 + option_number.post_issue * 4 + option_number.changeset * 4 + option_number.document * 4 + option_number.attachment * 4 + option_number.issue_done_ratio * 2 + option_number.post_issue * 4 + option_number.memo * 2 end #更新发帖数 diff --git a/app/views/users/_influence_new_score_index.html.erb b/app/views/users/_influence_new_score_index.html.erb index c0a89536a..505785351 100644 --- a/app/views/users/_influence_new_score_index.html.erb +++ b/app/views/users/_influence_new_score_index.html.erb @@ -4,4 +4,5 @@
    <%= l('userscore.active.commit.attachments')%> * 4 = <%= option_num.attachment %> * 4 = <%= option_num.attachment * 4 %>
    <%= l('userscore.active.update_issues')%> * 2 = <%= option_num.issue_done_ratio %> * 2 = <%= option_num.issue_done_ratio * 2 %>
    <%= l('userscore.active.release_issues')%> * 4 = <%= option_num.post_issue %> * 4 = <%= option_num.post_issue * 4 %>
-
    <%= l(:label_user_score_of_active)%> = <%= option_num.changeset * 4 %> + <%= option_num.document * 4 %> + <%= option_num.attachment * 4 %> + <%= option_num.issue_done_ratio * 2 %> + <%= option_num.post_issue * 4 %> = <%= active(option_num) %>
\ No newline at end of file +
    <%= l('userscore.active.release_messages')%> * 1 = <%= option_num.memo %> * 2 = <%= option_num.memo * 2 %>
+
    <%= l(:label_user_score_of_active)%> = <%= option_num.changeset * 4 %> + <%= option_num.document * 4 %> + <%= option_num.attachment * 4 %> + <%= option_num.issue_done_ratio * 2 %> + <%= option_num.post_issue * 4 %> + <%= option_num.memo * 2 %> = <%= active(option_num) %>
\ No newline at end of file diff --git a/app/views/users/_topic_new_score_index.html.erb b/app/views/users/_topic_new_score_index.html.erb index af2ff0da3..86dc1f80f 100644 --- a/app/views/users/_topic_new_score_index.html.erb +++ b/app/views/users/_topic_new_score_index.html.erb @@ -1,7 +1,5 @@ - -
    <%= l('userscore.collaboration.memos')%> * 2 = <%= option_num.memo %> * 2 = <%= option_num.memo * 2 %>
    <%= l('userscore.collaboration.message_for_issues')%> * 1 = <%= option_num.messages_for_issues %> * 1 = <%= option_num.messages_for_issues * 1 %>
    <%= l('userscore.collaboration.issue_status')%> * 1 = <%= option_num.issues_status %> * 1= <%= option_num.issues_status * 1 %>
    <%= l('userscore.collaboration.reply_for_messages')%> * 1 = <%= option_num.replay_for_message %> * 1 = <%= option_num.replay_for_message * 1 %>
    <%= l('userscore.collaboration.reply_for_memos')%> * 1 = <%= option_num.replay_for_memo %> * 1 = <%= option_num.replay_for_memo * 1 %>
-
    <%= l(:label_user_score_of_collaboration)%> = <%= option_num.memo * 2 %> + <%= option_num.messages_for_issues * 1 %> + <%= option_num.issues_status * 1 %> + <%= option_num.replay_for_message * 1 %> + <%= option_num.replay_for_memo * 1 %> = <%= collaboration(option_num) %>  
+
    <%= l(:label_user_score_of_collaboration)%> = <%= option_num.messages_for_issues * 1 %> + <%= option_num.issues_status * 1 %> + <%= option_num.replay_for_message * 1 %> + <%= option_num.replay_for_memo * 1 %> = <%= collaboration(option_num) %>  
diff --git a/config/locales/users/zh.yml b/config/locales/users/zh.yml index 4c792ef82..d90d8c537 100644 --- a/config/locales/users/zh.yml +++ b/config/locales/users/zh.yml @@ -67,7 +67,8 @@ zh: documents: 提交文档次数 attachments: 提交附件次数 update_issues: 更新缺陷完成度次数 - release_issues: 发布缺陷数量 + release_issues: 发布缺陷数量 + release_messages: 发布帖子数量 label_score_less_than_zero: 得分小于0,修正为0 label_user_info: "个人简介" From 7ebdf4a08d6773dbb0a2ea5c58fdd94507d91126 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 7 Jul 2015 11:29:40 +0800 Subject: [PATCH 3/5] =?UTF-8?q?issue=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BC=98=E5=85=88=E7=BA=A7=20=E4=BF=AE=E6=94=B9issue=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/issues_helper.rb | 30 +++++++++++++++++++++--------- app/models/option_number.rb | 3 ++- app/views/issues/_list.html.erb | 4 ++-- public/images/public_icon.png | Bin 11734 -> 9628 bytes public/stylesheets/project.css | 6 ++++++ 5 files changed, 31 insertions(+), 12 deletions(-) diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index aae150728..4f0821449 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -68,24 +68,36 @@ module IssuesHelper end #获取跟踪类型及样式 - #REDO:时间紧可以优化. def get_issue_type(value) issuetype = [] if value == "缺陷" || value == 1 - issuetype << "red_btn_cir ml10" - issuetype << "缺陷" + issuetype << "issues fl" elsif value == "功能" || value == 2 - issuetype << "blue_btn_cir ml10" - issuetype << "功能" + issuetype << "duty fl" elsif value == "支持" || value == 3 - issuetype << "green_btn_cir ml10" - issuetype << "支持" + issuetype << "support fl" elsif value == "任务" || value == 4 + issuetype << "function fl" + else + issuetype << "weekly fl" + end + end + + # 获取优先级样式 + def get_issue_priority(value) + issuetype = [] + if value == "紧急" || value == 1 + issuetype << "red_btn_cir ml10" + issuetype << "紧急" + elsif value == "正常" || value == 3 + issuetype << "green_btn_cir ml10" + issuetype << "正常" + elsif value == "高" || value == 4 issuetype << "orange_btn_cir ml10" - issuetype << "任务" + issuetype << "高" else issuetype << "bgreen_btn_cir ml10" - issuetype << "周报" + issuetype << "低" end end diff --git a/app/models/option_number.rb b/app/models/option_number.rb index 0ddea1bff..b4a3caac4 100644 --- a/app/models/option_number.rb +++ b/app/models/option_number.rb @@ -1,5 +1,6 @@ class OptionNumber < ActiveRecord::Base - attr_accessible :attachment, :changeset, :document, :follow, :issue_done_ratio, :issues_status, :memo, :messages_for_issues, :post_issue, :praise_by_one, :praise_by_three, :praise_by_two, :replay_for_memo, :replay_for_message, :score_type, :total_score, :tread, :tread_by_one, :tread_by_three, :tread_by_two, :user_id + attr_accessible :attachment, :changeset, :document, :follow, :issue_done_ratio, :issues_status, :memo, :messages_for_issues, :post_issue, + :praise_by_one, :praise_by_three, :praise_by_two, :replay_for_memo, :replay_for_message, :score_type, :total_score, :tread, :tread_by_one, :tread_by_three, :tread_by_two, :user_id def self.get_user_option_number user_id result = nil diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index 0fcb37021..4549b32e0 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -7,12 +7,12 @@
<% column_content = ( query.inline_columns.map {|column| "#{column_content_new(column, issue)}"}) %> <% unless issue.author.nil? || issue.author.name == "Anonymous" %> - +
<%= link_to issue.author.name, user_path(issue.author), :class => "problem_name c_orange fl" %> <%= l(:label_post_on_issue) %>(<%= "#{raw column_content[2]}" %>):
- <%=link_to "#{column_content[4]}#{get_issue_type(column_content[1])[1]}".html_safe, issue_path(issue.id), :class => "problem_tit_a break_word",:target => "_blank" %> + <%=link_to "#{column_content[4]}#{get_issue_priority(column_content[3])[1]}".html_safe, issue_path(issue.id), :class => "problem_tit_a break_word",:target => "_blank" %>

diff --git a/public/images/public_icon.png b/public/images/public_icon.png index 1fa463e4e88ec9cb684ae8a91859c077e0cbff28..b915af0867de83057661e23f518705012e74e230 100644 GIT binary patch delta 6604 zcmY*eXIN8Bwgt{DfOU z8GKo4xMrA^a~#jE3-RWm4x<(Y%TVM0kzP#tW3HgvS1)tIlrM&Cd8z`_j#@gwsAZ5hMHnuqbOx zJ<=JwN{Tp};HA#!z)Pg4fhyDC7(6L$8bzvSV?QBf!nVdBqyD1;7wY3~(6&XX5hPoR z4d)uM{8HGvn=^^*KUwD^O_g{P7qFPoR)eUFs1d9S9(P)eBy3O*ZF#xL>&MzM^m+`U zn23%{w;mAOok%&EQW&E8VmcFXl23)wnDrA{Ngy}0x#C#>WGj28LC zN;xP}-)VZ;6Gu^GN?Mp#bl7*}eb7Rvf53xq= z_k*wcW_Bis)^FtaZwyso-cc;kBvGkm1$R=nV2ZBvHrYa5uKHfCfh+aQxxX{4qNG8* z`}F3~v+)nIl9Z5VP%VTAgpCzL8GxZn;2L7m+eSHXH)ihdsOmFQn3>3`aH2lIetIMF z_Pr5}V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B=_;Frw|34S27^NUy_u9%Ia&e_o8BAXxfk+SWl4bT z>zLHNqo1CLYjkhH9gXTt9pyfH(?h3f(c(<3xQU z-w&@$THpH2i&VtOOH}Co@SkePt6@h<6>;G4- fj;LJ#kPP9m&o^Rk^n(BOfT$@wQY@9Xc=>+-z8Aqw diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 5574dc82a..28399462d 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -95,6 +95,12 @@ a.pro_mes_w_news{ height:20px; float:right;display:block; color:#999999;} .pro_info_box ul li{ height:24px;} .pro_info_p{color:#0781b4 !important; float:left; width:80px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } .edit_pro_box{overflow:hidden;display:none; margin-bottom:30px; border-bottom:1px dashed #CCC; padding-bottom:10px;} +/*问题状态图片*/ +.issues{ background:url(../images/public_icon.png) -66px 5px no-repeat; width:16px; height:21px;} +.duty{ background:url(../images/public_icon.png) -66px -18px no-repeat; width:16px; height:21px;} +.support{ background:url(../images/public_icon.png) -66px -45px no-repeat; width:16px; height:21px;} +.function{ background:url(../images/public_icon.png) -66px -70px no-repeat; width:16px; height:21px;} +.weekly{ background:url(../images/public_icon.png) -66px -95px no-repeat; width:16px; height:21px;} /****翻页***/ ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; } ul.wlist li{float: left;} From 6d85dd7ca432312c7618198902c98b7ee5f899cb Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 7 Jul 2015 17:18:29 +0800 Subject: [PATCH 4/5] =?UTF-8?q?app=E7=9A=84=E8=AF=BE=E7=A8=8B=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E7=95=8C=E9=9D=A2api=E4=BF=AE=E6=94=B9=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=B4=BB=E8=B7=83=E5=AD=A6=E7=94=9F=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=EF=BC=8C=20=E8=8E=B7=E5=8F=96=E4=BD=9C=E4=B8=9A=E7=9A=84?= =?UTF-8?q?=E5=8C=BF=E8=AF=84=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/entities/course_dynamic.rb | 15 +++++++-- app/api/mobile/entities/homework.rb | 17 +++++++--- app/api/mobile/entities/user.rb | 2 ++ app/helpers/api_helper.rb | 32 ++++++++++++++++++- app/services/courses_service.rb | 38 ++++++++++++++--------- db/schema.rb | 10 ++++++ 6 files changed, 93 insertions(+), 21 deletions(-) diff --git a/app/api/mobile/entities/course_dynamic.rb b/app/api/mobile/entities/course_dynamic.rb index f9bc5a8ee..fe31668ff 100644 --- a/app/api/mobile/entities/course_dynamic.rb +++ b/app/api/mobile/entities/course_dynamic.rb @@ -58,10 +58,11 @@ module Mobile course_dynamic_expose :document_count course_dynamic_expose :topic_count course_dynamic_expose :homework_count - + course_dynamic_expose :course_student_num + course_dynamic_expose :time_from_now course_dynamic_expose :current_user_is_member course_dynamic_expose :current_user_is_teacher - #在dynamics里解析出四种动态 + expose :documents,using:Mobile::Entities::Attachment do |f,opt| obj = nil f[:dynamics].each do |d| @@ -110,6 +111,16 @@ module Mobile obj end + expose :active_students,using:Mobile::Entities::User do |f,opt| + obj = nil + f[:dynamics].each do |d| + if d[:type] == 7 + obj = d[:active_students] + end + end + obj + end + end end end \ No newline at end of file diff --git a/app/api/mobile/entities/homework.rb b/app/api/mobile/entities/homework.rb index 03edd502f..db3e44119 100644 --- a/app/api/mobile/entities/homework.rb +++ b/app/api/mobile/entities/homework.rb @@ -30,6 +30,13 @@ module Mobile f.course.homework_commons.index(f) + 1 when :homework_status_teacher homework_status_desc f + when :student_evaluation_part + get_evaluation_part f ,3 + when :ta_evaluation_part + get_evaluation_part f , 2 + when :homework_anony_type + val = f.homework_type == 1 && !f.homework_detail_manual.nil? + val end end end @@ -79,12 +86,14 @@ module Mobile homework_expose :homework_submit_num homework_expose :homework_notsubmit_num - expose :submit_student_list ,using: Mobile::Entities::User do |f,opt| - get_submit_sutdent_list f - end - homework_expose :homework_status_student #老师看到的作业的状态 + homework_expose :homework_status_student #学生看到的作业的状态 homework_expose :homework_status_teacher #老师看到的状态 + homework_expose :student_evaluation_part #学生匿评比率 + homework_expose :ta_evaluation_part #教辅评价比率 + + homework_expose :homework_anony_type #是否是匿评作业 + end end end \ No newline at end of file diff --git a/app/api/mobile/entities/user.rb b/app/api/mobile/entities/user.rb index 2b3483625..16048c61a 100644 --- a/app/api/mobile/entities/user.rb +++ b/app/api/mobile/entities/user.rb @@ -53,6 +53,8 @@ module Mobile user_expose :score #学号 user_expose :student_num + # 活跃值 + user_expose :active_count end end diff --git a/app/helpers/api_helper.rb b/app/helpers/api_helper.rb index d3dc441ae..ac0357f53 100644 --- a/app/helpers/api_helper.rb +++ b/app/helpers/api_helper.rb @@ -129,9 +129,39 @@ module ApiHelper def show_homework_deadline homework day = 0 if (day = (Date.parse(homework.end_time.to_s) - Date.parse(Time.now.to_s)).to_i) > 0 - "距作业截止还有" << (Date.parse(Time.now.to_s) - Date.parse(homework.end_time.to_s)).to_i.to_s << "天" + "距作业截止还有" << day.to_s << "天" else "已截止,但可补交" end end + + #获取作业中学生的匿评比率 + # 匿评比率 = 学生总共评价的作业的作业份数 / 作业份数 * 分配数 * 100% + # 教辅匿评比率 = 教辅已经评价的作业份数 / 总的作业份数 * 100% + def get_evaluation_part homework,role + homework_eva_completed_task_num = 0 + homework_eva_task_num = 0 + #匿评作业 # 且匿评状态不是还没有开启匿评 + if homework.homework_type == 1 && homework.homework_detail_manual && homework.homework_detail_manual.comment_status != 1 + # 总共需要评价的任务数 + homework_eva_task_num = homework.homework_detail_manual.evaluation_num * homework.student_works.count + unless homework_eva_task_num == 0 #总任务数不为0 的情况下 + #获取已经评价了多少的份作业 student_work_score里记录了评价情况,每条记录有提交作业的id + #先求出提交作业的id集合 + work_ids = "(" + homework.student_works.map(&:id).join(",") + ")" + #只要 student_work_score 中的 student_work_id在work_ids集合中,那么久说明这个任务被完成了 + + sql = "select count(1) from student_works_scores where reviewer_role = #{role} and student_work_id in #{work_ids} " + homework_eva_completed_task_num = ActiveRecord::Base.connection().select_value(sql) + end + end + if homework_eva_task_num == 0 + 0 + else + ( homework_eva_completed_task_num / homework_eva_task_num.to_f * 100 ) .round(2) + end + + end + + end \ No newline at end of file diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 545ab1dac..94dcaf6fc 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -4,6 +4,7 @@ class CoursesService include CoursesHelper include HomeworkAttachHelper include ApiHelper + include ActionView::Helpers::DateHelper #参数school_id为0或不传时返回所有课程,否则返回对应学校的课程 #参数per_page_count分页功能,每页显示的课程数 @@ -657,22 +658,12 @@ class CoursesService membership.each do |mp| course = mp.course latest_course_dynamics = [] - dynamics_count = 0 - # 课程学霸 学生总分数排名靠前的5个人 - homework_count = course.homework_commons.count - sql = "select users.*,sum(IFNULL(0,student_works.final_score))/#{homework_count} score from student_works left outer join users on student_works.user_id = users.id" << - " where homework_common_id in ( select id from homework_commons where homework_commons.course_id = #{course.id}) GROUP BY student_works.user_id ORDER BY score limit 0,6" - better_students = User.find_by_sql(sql) - if homework_count != 0 && !better_students.empty? - latest_course_dynamics <<{:type=> 6,:time=>Time.now.to_s,:count=> 6,:better_students=> better_students} - dynamics_count += 1 - end + # 课程通知 latest_news = course.news.page(1).per(2).order("created_on desc") unless latest_news.first.nil? latest_course_dynamics << {:type => 1, :time => latest_news.first.created_on,:count=>course.news.count, :news => latest_news.all} - dynamics_count += 1 end # 课程讨论区 @@ -694,12 +685,31 @@ class CoursesService homeworks = course.homework_commons.page(1).per(2).order('created_at desc') unless homeworks.first.nil? latest_course_dynamics << {:type => 4, :time => homeworks.first.updated_at, :count=>course.homework_commons.count , :homeworks => homeworks} - dynamics_count += 1 end - latest_course_dynamics.sort! { |order, newer| newer[:time] <=> order[:time] } + latest_course_dynamics.sort! { |order, newer| newer[:time] <=> order[:time] } + # 课程学霸 学生总分数排名靠前的5个人 + homework_count = course.homework_commons.count + sql = "select users.*,sum(IFNULL(0,student_works.final_score))/#{homework_count} score from student_works left outer join users on student_works.user_id = users.id" << + " where homework_common_id in ( select id from homework_commons where homework_commons.course_id = #{course.id}) GROUP BY student_works.user_id ORDER BY score limit 0,4" + better_students = User.find_by_sql(sql) + # 找出在课程讨论区发帖回帖数最多的 + active_students = [] + sql1 = " select users.*,count(author_id) active_count from messages " << + " LEFT JOIN users on messages.author_id = users.id " << + " where messages.board_id in (select id from boards where boards.course_id = #{course.id} ) " << + " GROUP BY messages.author_id ORDER BY count(author_id) desc " << + " limit 0,4" + active_students = User.find_by_sql(sql1) + if homework_count != 0 && !better_students.empty? + latest_course_dynamics <<{:type=> 6,:time=>Time.now.to_s,:count=> 4,:better_students=> better_students} + end + unless active_students.empty? + latest_course_dynamics <<{:type=> 7,:time=>Time.now.to_s,:count=> 4,:active_students=>active_students} + end latest_course_dynamic = latest_course_dynamics.first unless latest_course_dynamic.nil? - result << {:course_name => course.name,:current_user_is_member => current_user.member_of_course?(course),:current_user_is_teacher => is_course_teacher(current_user,course), :course_id => course.id, :course_img_url => url_to_avatar(course), :course_time => course.time, :course_term => course.term,:message => dynamics_count, :dynamics => latest_course_dynamics, :count => dynamics_count} + result << {:course_name => course.name,:current_user_is_member => current_user.member_of_course?(course),:current_user_is_teacher => is_course_teacher(current_user,course), :course_id => course.id, :course_img_url => url_to_avatar(course), :course_time => course.time, :course_term => course.term,:message => "", :dynamics => latest_course_dynamics, + :course_student_num=>course ? course.members.count : 0,:time_from_now=> distance_of_time_in_words(Time.now, latest_course_dynamic[:time].to_time) << "前"} end end #返回数组集合 diff --git a/db/schema.rb b/db/schema.rb index 988d5649a..78dfb5eee 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -721,6 +721,16 @@ ActiveRecord::Schema.define(:version => 20150702073308) do add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" + create_table "journal_details_copy", :force => true do |t| + t.integer "journal_id", :default => 0, :null => false + t.string "property", :limit => 30, :default => "", :null => false + t.string "prop_key", :limit => 30, :default => "", :null => false + t.text "old_value" + t.text "value" + end + + add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id" + create_table "journal_replies", :id => false, :force => true do |t| t.integer "journal_id" t.integer "user_id" From 1b1cce615d79f2d6774d99701ba0cbdfb5c54689 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 8 Jul 2015 17:36:17 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E9=80=9A=E7=9F=A5api=20?= =?UTF-8?q?=E6=B4=BB=E8=B7=83=E6=8E=92=E5=90=8Dapi=20=E5=85=B6=E4=BB=96api?= =?UTF-8?q?=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/apis/comments.rb | 14 ++++++++++++++ app/api/mobile/apis/courses.rb | 3 ++- app/api/mobile/entities/news.rb | 2 ++ app/services/comment_service.rb | 5 ++++- app/services/courses_service.rb | 18 ++++++++++++++---- 5 files changed, 36 insertions(+), 6 deletions(-) diff --git a/app/api/mobile/apis/comments.rb b/app/api/mobile/apis/comments.rb index 86132a93a..7fa676161 100644 --- a/app/api/mobile/apis/comments.rb +++ b/app/api/mobile/apis/comments.rb @@ -113,6 +113,20 @@ module Mobile present :status, 0 end + desc '通知评论列表' + params do + requires :token, type: String + requires :notice_id,type:Integer,desc:'通知id' + optional :page,type:Integer,desc:'页码' + end + get ':notice_id/notice_comments' do + cs = CommentService.new + comments = cs.notice_comments params,current_user + present :data, comments, with: Mobile::Entities::Comment + present :status, 0 + end + + end end end diff --git a/app/api/mobile/apis/courses.rb b/app/api/mobile/apis/courses.rb index 509d31d86..39d2ebe9d 100644 --- a/app/api/mobile/apis/courses.rb +++ b/app/api/mobile/apis/courses.rb @@ -312,11 +312,12 @@ module Mobile present :status,0 end - desc '课程历次作业总成绩列表' + desc '总成绩 or 活跃度列表' params do requires :token,type:String requires :course_id,type:Integer,desc:'课程id' optional :page,type:Integer,desc:'页码' + optional :type,type:Integer,desc:'0是活跃度,1是成绩' end get ':course_id/students_score_list' do cs = CoursesService.new diff --git a/app/api/mobile/entities/news.rb b/app/api/mobile/entities/news.rb index 5ed3958ba..36893d16f 100644 --- a/app/api/mobile/entities/news.rb +++ b/app/api/mobile/entities/news.rb @@ -56,6 +56,8 @@ module Mobile expose :comments, using: Mobile::Entities::Comment do |f, opt| if f.is_a?(Hash) && f.key?(:comments) f[:comments] + elsif f.is_a?(::News) && f.respond_to?(:comments) + f.send(:comments) end end diff --git a/app/services/comment_service.rb b/app/services/comment_service.rb index 2464297da..62955905b 100644 --- a/app/services/comment_service.rb +++ b/app/services/comment_service.rb @@ -112,6 +112,9 @@ class CommentService end end - + # 获取课程里的某个通知的所有回复 + def notice_comments params,current_user + News.find(params[:notice_id]).comments.page(params[:page] || 1).per(10) + end end \ No newline at end of file diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 94dcaf6fc..00a8ffd8b 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -719,11 +719,21 @@ class CoursesService # 获取课程历次作业的学生总成绩 def students_score_list params,current_user - homework_count = Course.find(params[:course_id]).homework_commons.count page = (params[:page] || 1) - 1 - sql = "select users.*,sum(IFNULL(0,student_works.final_score))/#{homework_count} score from student_works left outer join users on student_works.user_id = users.id" << - " where homework_common_id in ( select id from homework_commons where homework_commons.course_id = #{params[:course_id]}) GROUP BY student_works.user_id ORDER BY score limit #{page*10},10" - User.find_by_sql(sql) + if params[:type] == 1 + homework_count = Course.find(params[:course_id]).homework_commons.count + + sql = "select users.*,sum(IFNULL(0,student_works.final_score))/#{homework_count} score from student_works left outer join users on student_works.user_id = users.id" << + " where homework_common_id in ( select id from homework_commons where homework_commons.course_id = #{params[:course_id]}) GROUP BY student_works.user_id ORDER BY score limit #{page*10},10" + User.find_by_sql(sql) + else + sql1 = " select users.*,count(author_id)*2 active_count from messages " << + " LEFT JOIN users on messages.author_id = users.id " << + " where messages.board_id in (select id from boards where boards.course_id = #{params[:course_id]} ) " << + " GROUP BY messages.author_id ORDER BY count(author_id) desc " << + " limit #{page*10},10" + User.find_by_sql(sql1) + end end # 获取某次作业的所有作业列表