From ea8f72cce9681328dfbd57016e9594f8438759d2 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 09:24:09 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E7=BC=96=E7=A8=8B=E4=BD=9C=E4=B8=9Ashow?= =?UTF-8?q?=EF=BC=9A=E4=B8=A4=E4=B8=AA=E6=B5=8B=E8=AF=95=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_programing_work_show.html.erb | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/views/student_work/_programing_work_show.html.erb b/app/views/student_work/_programing_work_show.html.erb index 807fc80fe..7081dea8c 100644 --- a/app/views/student_work/_programing_work_show.html.erb +++ b/app/views/student_work/_programing_work_show.html.erb @@ -59,14 +59,6 @@
-
  • 测试结果: - - - - -
    -
    -
  • <% if @is_teacher%>
    From f4360e66dd62172085c254164edf8610446b7e0f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 09:47:20 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E7=BC=96=E8=BE=91=E7=BC=96=E7=A8=8B?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 4b655cf31..0a33ef87a 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -144,6 +144,8 @@ class HomeworkCommonController < ApplicationController end if homework.save + homework_detail_programing.save if homework_detail_programing + homework_detail_manual.save if homework_detail_manual respond_to do |format| format.html { flash[:notice] = l(:notice_successful_create) @@ -254,7 +256,6 @@ class HomeworkCommonController < ApplicationController client.request(request) end result = JSON.parse(res.body) - homework_detail_programing.question_id = result["id"] if result["status"] && result["status"] == 0 end @homework.save_attachments(params[:attachments]) From c8cb730397a8c9a51070411ee82c3aeb1c51dc15 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 24 Jul 2015 10:56:19 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/entities/course_dynamic.rb | 109 ++++++++-------------- app/services/courses_service.rb | 30 ++++-- 2 files changed, 62 insertions(+), 77 deletions(-) diff --git a/app/api/mobile/entities/course_dynamic.rb b/app/api/mobile/entities/course_dynamic.rb index 5be0a3d0a..6077a8722 100644 --- a/app/api/mobile/entities/course_dynamic.rb +++ b/app/api/mobile/entities/course_dynamic.rb @@ -4,45 +4,44 @@ module Mobile include Redmine::I18n def self.course_dynamic_expose(field) expose field do |c,opt| - if field == :news_count - obj = nil - c[:dynamics].each do |d| - if d[:type] == 1 - obj = d[:count] - end - end - obj - elsif field == :document_count - obj = nil - c[:dynamics].each do |d| - if d[:type] == 3 - obj = d[:count] - end - end - obj - elsif field == :topic_count - obj = nil - c[:dynamics].each do |d| - if d[:type] == 2 - obj = d[:count] - end - end - obj - elsif field == :homework_count - obj = nil - c[:dynamics].each do |d| - if d[:type] == 4 - obj = d[:count] - end - end - obj - else + # if field == :news_count + # obj = nil + # c[:dynamics].each do |d| + # if d[:type] == 1 + # obj = d[:count] + # end + # end + # obj + # elsif field == :document_count + # obj = nil + # c[:dynamics].each do |d| + # if d[:type] == 3 + # obj = d[:count] + # end + # end + # obj + # elsif field == :topic_count + # obj = nil + # c[:dynamics].each do |d| + # if d[:type] == 2 + # obj = d[:count] + # end + # end + # obj + # elsif field == :homework_count + # obj = nil + # c[:dynamics].each do |d| + # if d[:type] == 4 + # obj = d[:count] + # end + # end + # obj + # else c[field] if (c.is_a?(Hash) && c.key?(field)) - end + # end end end - course_dynamic_expose :type course_dynamic_expose :course_name course_dynamic_expose :course_term course_dynamic_expose :course_time @@ -68,52 +67,22 @@ module Mobile # obj # end expose :topics,using:Mobile::Entities::Message do |f,opt| - obj = nil - f[:dynamics].each do |d| - if d[:type] == 2 - obj = d[:topics] - end - end - obj + f[:topics] end expose :homeworks,using:Mobile::Entities::Homework do |f,opt| - obj = nil - f[:dynamics].each do |d| - if d[:type] == 4 - obj = d[:homeworks] - end - end - obj + f[:homeworks] end expose :news,using:Mobile::Entities::News do |f,opt| - obj = nil - f[:dynamics].each do |d| - if d[:type] == 1 - obj = d[:news] - end - end - obj + f[:news] end expose :better_students,using:Mobile::Entities::User do |f,opt| - obj = nil - f[:dynamics].each do |d| - if d[:type] == 6 - obj = d[:better_students] - end - end - obj + f[:better_students] 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 + f[:active_students] end end diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 5c3b69d72..274b78e50 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -670,18 +670,25 @@ class CoursesService membership.each do |mp| course = mp.course latest_course_dynamics = [] + notices_count = 0 + topic_count = 0 + topics = nil + homeworkss = nil + notices = nil # 课程通知 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} + notices_count = course.news.count + notices = latest_news.all + latest_course_dynamics << {:time => latest_news.first.created_on } end # 课程讨论区 latest_message = course.boards.first.topics.page(1).per(2) unless latest_message.first.nil? - latest_course_dynamics << {:type => 2, :time => latest_message.first.created_on, :count =>course.boards.nil? ? 0 : course.boards.first.topics.count, - :topics => latest_message.all} + topic_count = course.boards.nil? ? 0 : course.boards.first.topics.count + topics = latest_message.all + latest_course_dynamics << {:time => latest_message.first.created_on} end # 课程资源 # latest_attachment = course.attachments.order("created_on desc").page(1).per(2) @@ -693,7 +700,8 @@ class CoursesService #课程作业 已经交的学生列表(暂定显示6人),未交的学生列表,作业的状态 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} + homeworkss = homeworks + latest_course_dynamics << {:time => homeworks.first.updated_at} end latest_course_dynamics.sort! { |order, newer| newer[:time] <=> order[:time] } # 课程学霸 学生总分数排名靠前的5个人 @@ -713,10 +721,10 @@ class CoursesService active_students = User.find_by_sql(sql1) if homework_count != 0 && !better_students.empty? - latest_course_dynamics <<{:type=> 6,:time=>"1970-01-01 0:0:0 +0800",:count=> 4,:better_students=> better_students} + latest_course_dynamics <<{:time=>"1970-01-01 0:0:0 +0800"} end unless active_students.empty? - latest_course_dynamics <<{:type=> 7,:time=>"1970-01-01 0:0:0 +0800",:count=> 4,:active_students=>active_students} + latest_course_dynamics <<{:time=>"1970-01-01 0:0:0 +0800"} end latest_course_dynamic = latest_course_dynamics.first unless latest_course_dynamic.nil? @@ -727,6 +735,14 @@ class CoursesService :course_img_url => url_to_avatar(course), :course_time => course.time, :course_term => course.term, + :news_count => notices_count, + :homework_count => homework_count, + :topic_count => topic_count, + :news => notices, + :homeworks => homeworkss, + :topics => topics, + :better_students => better_students, + :active_students => active_students, :message => "", :dynamics => latest_course_dynamics, :course_student_num=>course ? course.members.count : 0, From a4734bb1356814f8f133218cc90fbd027fdd4bfe Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 24 Jul 2015 11:13:53 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/courses_service.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 274b78e50..c2944fed5 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -744,7 +744,6 @@ class CoursesService :better_students => better_students, :active_students => active_students, :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) << "前", :time_from_now=>time_from_now(latest_course_dynamic[:time].to_time), #.strftime('%Y-%m-%d %H:%M:%S').to_s, From f521ca424d6a0a0649af8f73dc357110c5db2958 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 24 Jul 2015 11:47:45 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/apis/courses.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/api/mobile/apis/courses.rb b/app/api/mobile/apis/courses.rb index 959e0fe30..076e0b1c7 100644 --- a/app/api/mobile/apis/courses.rb +++ b/app/api/mobile/apis/courses.rb @@ -250,10 +250,8 @@ module Mobile end get "course_dynamic/:id" do cs = CoursesService.new - p Time.now.to_s count = cs.all_course_dynamics(params,current_user) present :data, count, with: Mobile::Entities::CourseDynamic - p Time.now.to_s present :status, 0 end From 0e56a79622e78faad107c8fba7613fd21f771929 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 11:50:50 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=B8=8D=E4=BD=BF=E7=94=A8ajax=E5=B1=80?= =?UTF-8?q?=E9=83=A8=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/news_controller.rb | 3 +-- app/views/news/_course_news.html.erb | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index 9385c73ee..848c0a69d 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -71,8 +71,7 @@ class NewsController < ApplicationController scope = @course ? @course.news.course_visible : News.course_visible @news_count = scope.count - #@news_pages = Paginator.new @news_count, @limit, params['page'] - #@offset ||= scope_page.offset + @q = params[:subject] if params[:subject].nil? scope_order = scope.all(:include => [:author, :course], :order => "#{News.table_name}.created_on DESC") diff --git a/app/views/news/_course_news.html.erb b/app/views/news/_course_news.html.erb index f801aff87..e2c50fe24 100644 --- a/app/views/news/_course_news.html.erb +++ b/app/views/news/_course_news.html.erb @@ -24,8 +24,8 @@ <% end %>
    @@ -34,7 +34,7 @@
    <%= render :partial => 'course_news_list', :locals=>{ :newss=>@newss,:obj_pages=>@obj_pages, :obj_count=>@obj_count} %> -
    +
    <% content_for :header_tags do %> <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %> <%= stylesheet_link_tag 'scm' %> From 2f497f36d0ff7381b3e7a1ee83b8c69a734fa8f9 Mon Sep 17 00:00:00 2001 From: zhangshenjerry <1375181337@qq.com> Date: Fri, 24 Jul 2015 14:00:02 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E5=90=8E=E5=BB=BA=E8=AE=AE=E7=BB=99=E5=87=BA?= =?UTF-8?q?=E2=80=9C=E5=AF=86=E7=A0=81=E4=BF=AE=E6=94=B9=E6=88=90=E5=8A=9F?= =?UTF-8?q?=EF=BC=8C=E8=AF=B7=E9=87=8D=E6=96=B0=E7=99=BB=E5=BD=95=E2=80=9D?= =?UTF-8?q?=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/my/account.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index c23266afd..57c3712f9 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -540,6 +540,7 @@ $('#my_account_form_btn').click(); }); $('#my_password_form_link').click(function(){ + alert("密码修改成功,请重新登录!"); $('#my_password_form_btn').click(); }); }); From 430956bfe54f90c1aa24307de0224f7f69f8277e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 14:24:31 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E6=88=91=E8=A6=81=E5=8F=8D=E9=A6=88---?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E7=BC=96=E8=BE=91=E6=A1=86=E6=97=B6=E8=BE=B9?= =?UTF-8?q?=E6=A1=86=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/kindeditor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index a9633861e..270618522 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -5104,8 +5104,8 @@ KEditor.prototype = { } } }); - statusbar.removeClass('statusbar').addClass('ke-statusbar') - .append(''); + //statusbar.removeClass('statusbar').addClass('ke-statusbar') + // .append(''); if (self._fullscreenResizeHandler) { K(window).unbind('resize', self._fullscreenResizeHandler); self._fullscreenResizeHandler = null; From 24a9a5034c19897ffa7669e6c94c543cc0650d5f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 14:27:30 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E7=BC=96=E7=A8=8B=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=AF=BC=E5=87=BA=E9=99=84=E4=BB=B6=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/index.html.erb | 30 ++++++++++++++------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 781277b57..fc82aea1e 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -55,21 +55,23 @@ <% end%> <% if @is_teacher%>
    - <% if @homework.student_works.empty?%> - <%= link_to "附件", "javascript:void(0)", class: "down_btn fr zip_download_alert", :onclick => "alert('没有学生提交作业,无法下载附件')" %> - <% else%> - <%= link_to "附件", zipdown_assort_path(obj_class: @homework.class, obj_id: @homework, format: :json), - remote: true, class: "down_btn fr zip_download_alert", :id => "download_homework_attachments" %> + <% unless @homework.homework_type == 2%> + <% if @homework.student_works.empty?%> + <%= link_to "附件", "javascript:void(0)", class: "down_btn fr zip_download_alert", :onclick => "alert('没有学生提交作业,无法下载附件')" %> + <% else%> + <%= link_to "附件", zipdown_assort_path(obj_class: @homework.class, obj_id: @homework, format: :json), + remote: true, class: "down_btn fr zip_download_alert", :id => "download_homework_attachments" %> + <% end%> +
    + 使用 + winzip + 工具进行解压可能会导致 + 下载文件乱码 + ,建议您使用 + winrar + 工具进行解压 +
    <% end%> -
    - 使用 - winzip - 工具进行解压可能会导致 - 下载文件乱码 - ,建议您使用 - winrar - 工具进行解压 -
    <%= link_to("匿评", evaluation_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'down_btn fr') if @homework.homework_type == 1%> <%= link_to("缺评", absence_penalty_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'down_btn fr') if @homework.homework_type == 1%> <%= link_to l(:label_list), student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :format => 'xls'),:class=>'down_btn fr'%>