From 5c4e4e7c8ad2190c35595ba914ef78c2b24472ef Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 7 Jul 2016 16:55:34 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=90=8E=E5=86=8D=E5=88=A0=E9=99=A4=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=EF=BC=8C=E6=8F=90=E7=A4=BA=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/syllabuses/_delete_syllabus.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/syllabuses/_delete_syllabus.html.erb b/app/views/syllabuses/_delete_syllabus.html.erb index fbc0a0995..b043186aa 100644 --- a/app/views/syllabuses/_delete_syllabus.html.erb +++ b/app/views/syllabuses/_delete_syllabus.html.erb @@ -1,6 +1,6 @@
- <% if @syllabus.courses.empty? %> + <% if @syllabus.courses.empty? || @syllabus.courses.not_deleted.empty? %> 确认删除该课程吗? <% else %> 该课程下已经存在班级,不能删除。 @@ -8,7 +8,7 @@

- <% if @syllabus.courses.empty? %> + <% if @syllabus.courses.empty?|| @syllabus.courses.not_deleted.empty? %> <%=link_to '确认', syllabus_path(@syllabus), :class => 'Blue-btn fl', :method => 'delete'%> 关闭 <% else %> From 41fc812ca4444ad8b8d3756b935d76960385dd02 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 7 Jul 2016 17:34:38 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=8F=AD=E7=BA=A7?= =?UTF-8?q?=E9=85=8D=E7=BD=AE--=E6=B7=BB=E5=8A=A0=E6=88=90=E5=91=98?= =?UTF-8?q?=EF=BC=9A=E7=94=A8=E6=88=B7=E5=90=8D=E7=A7=B0=E5=A4=AA=E9=95=BF?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_member.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/courses/_member.html.erb b/app/views/courses/_member.html.erb index 1bfe3cbd7..95177c92c 100644 --- a/app/views/courses/_member.html.erb +++ b/app/views/courses/_member.html.erb @@ -1,7 +1,7 @@ <% @members.each do |member| %>
  • <%#= link_to_user_header member.principal,true,:class => "w150 c_orange fl" %> - <%= link_to "#{member.principal}(#{member.principal.show_name})", user_path(member.principal), :class => "w150 linkBlue fl" %> + <%= link_to "#{member.principal}(#{member.principal.show_name})", user_path(member.principal), :class => "w150 linkBlue fl", :style=>"white-space: nowrap;overflow: hidden;text-overflow: ellipsis;", :title => "#{member.principal}(#{member.principal.show_name})" %> <%= zh_course_role(h member.roles.sort.collect(&:to_s).join(', ')) %> <%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member), From 00d59a55961924b64f857739b17f455b377108cc Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 11 Jul 2016 15:47:33 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=9D=90=E4=B8=8B=E4=B8=8B=EF=BC=8C=E6=8F=90=E7=A4=BA=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E7=9A=84=E8=A1=A8=E8=BE=BE=E5=BD=A2=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_show.html.erb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb index 484e8eb0e..cfc5c42ad 100644 --- a/app/views/student_work/_show.html.erb +++ b/app/views/student_work/_show.html.erb @@ -59,9 +59,14 @@
  • 内容: -
    - <%= work.description.html_safe if work.description%> -
    + <% com_contents = work.work_status %> + <% if com_contents != 0 && work.description %> +
    + <%= work.description.html_safe if work.description%> +
    + <% else %> + 该作品未在线下完成提交 + <% end %>
  • From 97599849ee6d76e960a5a40b4207f68ae6212353 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 11 Jul 2016 16:03:45 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E4=B8=AD=E4=BD=9C=E5=93=81=E4=B8=8B=E5=86=85=E5=AE=B9=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb index cfc5c42ad..039baa386 100644 --- a/app/views/student_work/_show.html.erb +++ b/app/views/student_work/_show.html.erb @@ -62,7 +62,7 @@ <% com_contents = work.work_status %> <% if com_contents != 0 && work.description %>
    - <%= work.description.html_safe if work.description%> + <%= work.description.html_safe %>
    <% else %> 该作品未在线下完成提交 From 304f18ac5e179d76b81192cb86b83da2c2cbdddf Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 12 Jul 2016 15:05:42 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E4=B8=AD=EF=BC=8C=E5=AF=B9=E5=8A=A8=E6=80=81=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E7=9A=84=E9=A1=B5=E9=9D=A2=E5=91=88=E7=8E=B0?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/show.html.erb | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index b9d97e18a..cabbb5d04 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -9,7 +9,23 @@
    -
    班级动态
    +
    班级动态 + <% if params[:type] == "homework" %> + <%= ">作业动态" %> + <% elsif params[:type] == "news" %> + <%= ">通知动态" %> + <% elsif params[:type] == "attachment" %> + <%= ">资源库动态" %> + <% elsif params[:type] == "message" %> + <%= ">论坛动态" %> + <% elsif params[:type] == "journalsForMessage" %> + <%= ">留言动态" %> + <% elsif params[:type] == "poll" %> + <%= ">问卷动态" %> + <% else %> + <%= ">全部动态" %> + <% end %> +
      • From dcc37ef847c52769b93526506f5a144632e39f8a Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 13 Jul 2016 16:58:31 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E7=95=8C=E9=9D=A2=E4=B8=AD=EF=BC=8C=E7=8F=AD?= =?UTF-8?q?=E7=BA=A7=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E4=B8=8B=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9A=82=E6=97=A0=E5=88=86=E7=8F=AD=E7=9A=84?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 22 ++++++++++++++++------ app/helpers/student_work_helper.rb | 4 ++++ config/locales/zh.yml | 1 + 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 4c3a608de..1d0b80f70 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -381,14 +381,24 @@ class StudentWorkController < ApplicationController @is_evaluation = @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #是不是匿评 @show_all = false - course_group = CourseGroup.find_by_id(@group) if @group - if course_group - group_students = course_group.users - if group_students.empty? - student_in_group = '(0)' + if @group + if @group == "0" + none_group_students = @course.members.select{ |member| member.course_group_id == 0 } + if none_group_students.empty? + student_in_group = '(0)' + else + student_in_group = '(' + none_group_students.map{ |member| member.user_id }.join(',') + ')' + end else - student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')' + course_group = CourseGroup.find_by_id(@group) + group_students = course_group.users + if group_students.empty? + student_in_group = '(0)' + else + student_in_group = '(' + group_students.map{ |user| user.id }.join(',') + ')' + end end + #开放作品 || 老师 || 超级管理员 || 禁用匿评&&作业截止&&已提交作品 显示所有列表 if (@homework.is_open == 1 && @course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.has_committed.where(:user_id => User.current.id).empty?) if @order == 'lastname' diff --git a/app/helpers/student_work_helper.rb b/app/helpers/student_work_helper.rb index 42a3a6538..4f0a2ca6d 100644 --- a/app/helpers/student_work_helper.rb +++ b/app/helpers/student_work_helper.rb @@ -101,6 +101,10 @@ module StudentWorkHelper if course.course_groups && !course.course_groups.empty? base = [] base << l(:label_chose_group) + base << -1 + result << base + base = [] + base << l(:label_no_group) base << 0 result << base course.course_groups.each do |group| diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 9c19fcbbb..dbb3ff074 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2101,6 +2101,7 @@ zh: label_file_lost_list: 缺失文件列表 lable_unset: 未设置 label_chose_group: 请选择分班 + label_no_group: 暂无 label_hostedz_organization: 主办单位 label_hosted_by: 国防科学技术大学并行与分布处理国家重点实验室 From 03d6afd1c45f96d147a55764e1e323ff64eaceb7 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 18 Jul 2016 15:52:04 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8A=E5=91=A8?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E8=8E=B7=E5=8F=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 20 ++++++++++++++++++++ app/views/courses/show.html.erb | 17 +---------------- config/locales/courses/zh.yml | 10 ++++++++++ 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index d1f4bfe97..ee520cb77 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -591,6 +591,26 @@ module CoursesHelper Course.tagged_with(tag_name).order('updated_at desc') end + # 获取动态列表名称 + def get_acts_list_type type + case type + when "homework" + ">" + l(:label_homework_acts) + when "news" + ">" + l(:label_news_acts) + when "attachment" + ">" + l(:label_attachment_acts) + when "message" + ">" + l(:label_message_acts) + when "journalsForMessage" + ">" + l(:label_journalsForMessage_acts) + when "poll" + ">" + l(:label_poll_acts) + else + ">" + l(:label_all_cats) + end + end + #分班下拉框 def course_group_option course type = [] diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index cabbb5d04..bf209ddb5 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -10,22 +10,7 @@
        班级动态 - <% if params[:type] == "homework" %> - <%= ">作业动态" %> - <% elsif params[:type] == "news" %> - <%= ">通知动态" %> - <% elsif params[:type] == "attachment" %> - <%= ">资源库动态" %> - <% elsif params[:type] == "message" %> - <%= ">论坛动态" %> - <% elsif params[:type] == "journalsForMessage" %> - <%= ">留言动态" %> - <% elsif params[:type] == "poll" %> - <%= ">问卷动态" %> - <% else %> - <%= ">全部动态" %> - <% end %> -
        + <%= get_acts_list_type @type %>
          • diff --git a/config/locales/courses/zh.yml b/config/locales/courses/zh.yml index 29d6b236c..9a07e0fa8 100644 --- a/config/locales/courses/zh.yml +++ b/config/locales/courses/zh.yml @@ -29,6 +29,16 @@ zh: label_upload_files: 上传资源 label_apply_join_course: 申请加入班级 label_apply_for_homework: 申请引用作业 + + #动态名称 + label_homework_acts: 作业动态 + label_news_acts: 通知动态 + label_attachment_acts: 资源库动态 + label_message_acts: 论坛动态 + label_journalsForMessage_acts: 留言动态 + label_poll_acts: 问卷动态 + label_all_cats: 全部动态 + # # 课程托管平台主页 # From 7808bb5ebec68f357471016efe883a23b3e7db12 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 19 Jul 2016 17:37:39 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=9D=9E=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E8=BF=9C=E7=94=A8=E6=88=B7=E5=B8=96=E5=AD=90=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E7=AE=A1=E7=90=86=E5=91=98=E5=B8=96=E5=AD=90=E7=BD=AE?= =?UTF-8?q?=E9=A1=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/boards/_course_new.html.erb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/views/boards/_course_new.html.erb b/app/views/boards/_course_new.html.erb index df61d2b9c..32cec24d5 100644 --- a/app/views/boards/_course_new.html.erb +++ b/app/views/boards/_course_new.html.erb @@ -130,11 +130,13 @@

        -
        <%= link_to User.find(act.user_id), user_url_in_org(act.user_id) %>  创建了 <%= Organization.find(act.org_act_id).name %> +
        创建时间:<%= format_activity_day(act.created_at) %> <%= format_time(act.created_at, false) %>
        From 7c2495c8a19393593b8dde3ebce8db2599249f51 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 21 Jul 2016 10:20:45 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E6=B5=8B=E9=AA=8C=E6=96=B0=E5=BB=BA=E5=8D=95=E9=80=89=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E6=97=B6=EF=BC=8C=E6=A0=B7=E5=BC=8F=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/exercise/_edit_MC.html.erb | 2 +- app/views/exercise/_edit_MCQ.html.erb | 4 ++-- app/views/exercise/_exercise_form.html.erb | 2 +- app/views/exercise/_new_MCQ.html.erb | 8 ++++---- app/views/exercise/_show_MCQ.html.erb | 8 ++++---- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/views/exercise/_edit_MC.html.erb b/app/views/exercise/_edit_MC.html.erb index 06d3e00da..9dfa2c48f 100644 --- a/app/views/exercise/_edit_MC.html.erb +++ b/app/views/exercise/_edit_MC.html.erb @@ -8,7 +8,7 @@ $("#poll_question_standard_answer_<%=exercise_question.id %>").val("<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s)%>") $("#poll_answers_<%=exercise_question.id%>").html("<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>" + "
      • " + - "" + + "" + "" + "" + "" + diff --git a/app/views/exercise/_edit_MCQ.html.erb b/app/views/exercise/_edit_MCQ.html.erb index 48422be1c..186cebd18 100644 --- a/app/views/exercise/_edit_MCQ.html.erb +++ b/app/views/exercise/_edit_MCQ.html.erb @@ -8,7 +8,7 @@ $("#poll_question_standard_answer_<%=exercise_question.id %>").val("<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s)%>") $("#poll_answers_<%=exercise_question.id%>").html("<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>" + "
      • " + - "" + + "" + "" + "" + "" + @@ -34,7 +34,7 @@
        <% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
      • - + diff --git a/app/views/exercise/_exercise_form.html.erb b/app/views/exercise/_exercise_form.html.erb index 9d70511e8..71389b313 100644 --- a/app/views/exercise/_exercise_form.html.erb +++ b/app/views/exercise/_exercise_form.html.erb @@ -171,7 +171,7 @@ //单选题 function add_single_answer(doc) { - var li = doc.parent().after("
      • " + + var li = doc.parent().after("
      • " + ""+ "
      • "); var select_items =$("label[name='select_items']",li.parent()); diff --git a/app/views/exercise/_new_MCQ.html.erb b/app/views/exercise/_new_MCQ.html.erb index 875b9ec4c..11ec08d05 100644 --- a/app/views/exercise/_new_MCQ.html.erb +++ b/app/views/exercise/_new_MCQ.html.erb @@ -18,28 +18,28 @@
      • - +
      • - +
      • - +
      • - + diff --git a/app/views/exercise/_show_MCQ.html.erb b/app/views/exercise/_show_MCQ.html.erb index a7ee60aa3..f122e1256 100644 --- a/app/views/exercise/_show_MCQ.html.erb +++ b/app/views/exercise/_show_MCQ.html.erb @@ -54,28 +54,28 @@ '分'+ '
      • '+ '
      • '+ - ''+ + ''+ ''+ ''+ ''+ '
      • '+ '
        '+ '
      • '+ - ''+ + ''+ ''+ ''+ ''+ '
      • '+ '
        '+ '
      • '+ - ''+ + ''+ ''+ ''+ ''+ '
      • '+ '
        '+ '
      • '+ - ''+ + ''+ ''+ ''+ ''+