diff --git a/.gitignore b/.gitignore index 8a40f3ca7..a1f5f7e76 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ /config/database.yml /config/configuration.yml /config/additional_environment.rb +/config/oneapm.yml /files/* diff --git a/app/api/mobile/apis/activities.rb b/app/api/mobile/apis/activities.rb index 4d07c23f8..6ce01aac0 100644 --- a/app/api/mobile/apis/activities.rb +++ b/app/api/mobile/apis/activities.rb @@ -36,7 +36,7 @@ module Mobile principal_types = "JournalsForMessage" watched_user_ids = User.watched_by(user.id).count == 0 ? " " : ("," + User.watched_by(user.id).map{|u| u.id.to_s }.join(',')) user_ids = "(" + user.id.to_s + watched_user_ids + ")" - watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}").count == 0 ? " " :Blog.select("id").where("author_id in #{user_ids}").map { |blog| blog.id}.join(",") + watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}").count == 0 ? "-1" :Blog.select("id").where("author_id in #{user_ids}").map { |blog| blog.id}.join(",") blog_ids = "(" + watched_user_blog_ids + ")" if container_type == "Course" diff --git a/app/api/mobile/entities/activity.rb b/app/api/mobile/entities/activity.rb index 9deeec58e..b36b8039b 100644 --- a/app/api/mobile/entities/activity.rb +++ b/app/api/mobile/entities/activity.rb @@ -73,6 +73,12 @@ module Mobile elsif ac.container_type == "Blog" "发表博客" end + when :syllabus_title + if ac.container_type == "Course" + course = get_course(ac.container_id) + name = course.syllabus.nil? ? "":course.syllabus.title + name + end when :course_project_id if ac.container_type == "Course" ac.container_id @@ -145,6 +151,7 @@ module Mobile act_expose :latest_update #最新更新时间 act_expose :course_project_id #课程/项目ID act_expose :course_project_name #课程/项目名字 + act_expose :syllabus_title #课程名字 act_expose :activity_type_name #课程问答区/项目缺陷等 expose :has_praise , if: lambda { |instance, options| options[:user] } do |instance, options| if instance.act_type == "HomeworkCommon" || instance.act_type == "News" || instance.act_type == "Message" || instance.act_type == "BlogComment" || instance.act_type == "JournalsForMessage" || instance.act_type == "Issue" diff --git a/app/api/mobile/entities/course.rb b/app/api/mobile/entities/course.rb index fc78cc14e..30a5a6cc9 100644 --- a/app/api/mobile/entities/course.rb +++ b/app/api/mobile/entities/course.rb @@ -107,6 +107,7 @@ module Mobile course_expose :current_user_is_member course_expose :current_user_is_teacher course_expose :work_unit + course_expose :syllabus_title end end end diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 6704f7401..b8c6a4a0a 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -85,7 +85,16 @@ class HomeworkCommonController < ApplicationController homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new @homework.end_time = params[:homework_common][:end_time] || Time.now @homework.course_id = params[:course_id] - anonymous = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 0 + if params[:homework_type] && params[:homework_type].to_i != @homework.homework_type + if @homework.homework_type == 2 + @homework.homework_detail_programing.destroy if @homework.homework_detail_programing + @homework.homework_tests.destroy_all + elsif @homework.homework_type == 3 + @homework.homework_detail_group.destroy if @homework.homework_detail_group + end + end + @homework.homework_type = params[:homework_type].to_i || @homework.homework_type + anonymous = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 1 if anonymous != @homework.anonymous_comment if anonymous == 1 homework_detail_manual.ta_proportion = @homework.homework_type == 1 ? 1.0 : 0.4 @@ -111,7 +120,7 @@ class HomeworkCommonController < ApplicationController if @homework.homework_type == 2 @homework.homework_detail_programing ||= HomeworkDetailPrograming.new @homework_detail_programing = @homework.homework_detail_programing - @homework_detail_programing.language = params[:language_type].to_i + @homework_detail_programing.language = params[:language_type].to_i if params[:language_type] if anonymous != @homework.anonymous_comment if anonymous == 1 @homework_detail_programing.ta_proportion = 0.6 @@ -120,8 +129,8 @@ class HomeworkCommonController < ApplicationController end end - @homework.homework_tests.delete_all - inputs = params[:program][:input] + @homework.homework_tests.delete_all if params[:program] + inputs = params[:program][:input] if params[:program] if Array === inputs inputs.each_with_index do |val, i| @homework.homework_tests << HomeworkTest.new( @@ -136,12 +145,12 @@ class HomeworkCommonController < ApplicationController if @homework.homework_type == 3 @homework.homework_detail_group ||= HomeworkDetailGroup.new @homework_detail_group = @homework.homework_detail_group - @homework_detail_group.min_num = params[:min_num].to_i - @homework_detail_group.max_num = params[:max_num].to_i - @homework_detail_group.base_on_project = params[:base_on_project].to_i + @homework_detail_group.min_num = params[:min_num].to_i if params[:min_num] + @homework_detail_group.max_num = params[:max_num].to_i if params[:max_num] + @homework_detail_group.base_on_project = params[:base_on_project].to_i if params[:base_on_project] end - @homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 0 + @homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 1 if @homework.save homework_detail_manual.save if homework_detail_manual @homework_detail_programing.save if @homework_detail_programing diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 3e41e2c91..37383712f 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -92,7 +92,13 @@ class MessagesController < ApplicationController @message.board = @board @message.safe_attributes = params[:message] if request.post? - @message.save_attachments(params[:attachments]) + if @project + is_public = @project.is_public + elsif @course + is_public = @course.is_public + end + # 公开项目/课程上传的资源是公开的,私有项目上传的是私有的 + @message.save_attachments_containers(params[:attachments], User.current, is_public) if @message.save # 更新kindeditor上传的图片资源所有者 if params[:asset_id] diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index 33ff2a248..660e4d76c 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -220,7 +220,8 @@ class NewsController < ApplicationController if count == 0 ws = WechatService.new content = @news.title - ws.class_notice m.user_id, "course_notice", @news.id, "#{l(:label_new_notice_template)}", @news.course.name, @news.author.show_name, format_time(@news.created_on), content, "点击查看通知详情" + name = @news.course.syllabus.nil? ? @news.course.name : @news.course.syllabus.title+" • "+@news.course.name + ws.class_notice m.user_id, "course_notice", @news.id, "#{l(:label_new_notice_template)}", name, @news.author.show_name, format_time(@news.created_on), content, "点击查看通知详情" end end end diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 8d4c09ded..df40eb378 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -325,27 +325,27 @@ class ProjectsController < ApplicationController end # 版本库统计图 - unless @project.gpid.nil? || @project.project_score.changeset_num == 0 - # rep_statics_commit = @project.rep_statics.order("commits_num desc") - rep_statics_commit = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by commits_num desc limit 10") - rep_statics_code = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by changeset desc limit 10") - # rep_statics_code = @project.rep_statics.sort_by {|u| u.changeset}.reverse - @a_uname = rep_statics_commit.map {|s| s.uname } - @a_uname_code = rep_statics_code.map {|s| s.uname } - @a_commits_num = rep_statics_commit.map {|s| s.commits_num.to_i } - @a_commits_add = rep_statics_code.map {|s| s.add.to_i } - @a_commits_del = rep_statics_code.map {|s| s.del.to_i } - @a_commits_changeset = rep_statics_code.map {|s| s.changeset.to_i } - g = Gitlab.client - begin - gid = @project.gpid - g_project = g.project(gid) - g_branch = g_project.default_branch.to_s - rescue =>e - logger.error("get default branch failed: " + e) - end - @rev = g_branch.nil? ? "master" : g_branch - end + # unless @project.gpid.nil? || @project.project_score.changeset_num == 0 + # # rep_statics_commit = @project.rep_statics.order("commits_num desc") + # rep_statics_commit = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by commits_num desc limit 10") + # rep_statics_code = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by changeset desc limit 10") + # # rep_statics_code = @project.rep_statics.sort_by {|u| u.changeset}.reverse + # @a_uname = rep_statics_commit.map {|s| s.uname } + # @a_uname_code = rep_statics_code.map {|s| s.uname } + # @a_commits_num = rep_statics_commit.map {|s| s.commits_num.to_i } + # @a_commits_add = rep_statics_code.map {|s| s.add.to_i } + # @a_commits_del = rep_statics_code.map {|s| s.del.to_i } + # @a_commits_changeset = rep_statics_code.map {|s| s.changeset.to_i } + # g = Gitlab.client + # begin + # gid = @project.gpid + # g_project = g.project(gid) + # g_branch = g_project.default_branch.to_s + # rescue =>e + # logger.error("get default branch failed: " + e) + # end + # @rev = g_branch.nil? ? "master" : g_branch + # end # 根据对应的请求,返回对应的数据 respond_to do |format| format.html diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 0dffd7b66..f6a97e66c 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -456,7 +456,7 @@ class StudentWorkController < ApplicationController elsif @order == 'student_id' @stundet_works = search_homework_member @homework.student_works.no_copy.select("student_works.*,student_works.work_score as score").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name else - @stundet_works = search_homework_member @homework.student_works.no_copy.select("student_works.*,student_works.work_score as score").order("#{@order} #{@b_sort}"),@name + @stundet_works = search_homework_member @homework.student_works.no_copy.select("student_works.*,student_works.work_score as score").includes(:user => {:user_extensions => []}, :project => {}, :student_works_scores => {}).order("#{@order} #{@b_sort}"),@name end @show_all = true elsif User.current.member_of_course?(@course) @@ -547,7 +547,7 @@ class StudentWorkController < ApplicationController @student_work = StudentWork.new #end respond_to do |format| - format.html{ render :layout => "new_base_user"} + format.html{ render :layout => "base_courses"} end end @@ -633,7 +633,7 @@ class StudentWorkController < ApplicationController render_403 else respond_to do |format| - format.html{ render :layout => "new_base_user"} + format.html{ render :layout => "base_courses"} end end end @@ -820,17 +820,29 @@ class StudentWorkController < ApplicationController render_attachment_warning_if_needed(@new_score) if @new_score.save + if @homework.homework_type == 3 + @is_group_leader = !@work.student_work_projects.empty? + end case @new_score.reviewer_role when 1 #教师评分:最后一个教师评分为最终评分 @work.teacher_score = @new_score.score + if @is_group_leader + add_score_to_member @work, @homework, 1, 'teacher_score', @new_score.score + end when 2 #教辅评分 教辅评分显示平均分 #@work.teaching_asistant_score = @work.student_works_scores.where(:reviewer_role => 2).average(:score).try(:round, 2).to_f ts_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@work.id} AND reviewer_role = 2 AND score IS NOT NULL ORDER BY created_at DESC) AS t GROUP BY user_id) AS a") @work.teaching_asistant_score = ts_score.first.score.nil? ? nil : ts_score.first.score.try(:round, 2).to_f + if @is_group_leader + add_score_to_member @work, @homework, 2, 'teaching_asistant_score', @work.teaching_asistant_score + end when 3 #学生评分 学生评分显示平均分 #@work.student_score = @work.student_works_scores.where(:reviewer_role => 3).average(:score).try(:round, 2).to_f stu_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@work.id} AND reviewer_role = 3 ORDER BY created_at DESC) AS t GROUP BY user_id) AS a") @work.student_score = stu_score.first.score.try(:round, 2).to_f + if @is_group_leader + add_score_to_member @work, @homework, 3, 'student_score', @work.student_score + end end @homework.update_column('updated_at', Time.now) update_course_activity(@homework.class,@homework.id) @@ -1553,10 +1565,6 @@ class StudentWorkController < ApplicationController end end end - if homework.homework_type == 3 - student_works = group_student_works student_work, homework - student_works.update_all(:final_score => student_work.final_score,:teacher_score => student_work.teacher_score,:student_score => student_work.student_score,:teaching_asistant_score => student_work.teaching_asistant_score,:work_score => student_work.work_score) - end end end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 559f29235..7e9add5e2 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1052,7 +1052,7 @@ class UsersController < ApplicationController else homework.publish_time = params[:homework_common][:publish_time] end - homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment] : 0 + homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 1 homework.homework_type = params[:homework_type].to_i || 1 homework.late_penalty = 10 homework.teacher_priority = 1 @@ -2156,11 +2156,9 @@ class UsersController < ApplicationController @user = User.current if !params[:search].nil? search = "%#{params[:search].to_s.strip.downcase}%" - @course = @user.courses.where(" #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search) - .select { |course| @user.allowed_to?(:as_teacher,course) and course.is_delete == 0 } + @course = @user.courses.not_deleted.where(" #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search) else - @course = @user.courses - .select { |course| @user.allowed_to?(:as_teacher,course) and course.is_delete == 0 } + @course = @user.courses.not_deleted end @search = params[:search] @type = params[:type] @@ -2178,7 +2176,7 @@ class UsersController < ApplicationController @user = User.current if !params[:search].nil? search = "%#{params[:search].to_s.strip.downcase}%" - @projects = @user.projects.where(" #{Project.table_name}.id = #{params[:search].to_i } or #{Project.table_name}.name like :p",:p=>search) + @projects = @user.projects.visible.where(" #{Project.table_name}.id = #{params[:search].to_i } or #{Project.table_name}.name like :p",:p=>search) else @projects = @user.projects.visible end diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 0c6eb0910..92864d490 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -8,13 +8,13 @@ class WechatsController < ActionController::Base # default text responder when no other match on :text do |request, content| #邀请码 - if join_class_request(request) - sendBindClass(request, {invite_code: content}) - elsif join_project_request(request) - sendBindProject(request, {invite_code: content}) - else + # if join_class_request(request) + # sendBindClass(request, {invite_code: content}) + # elsif join_project_request(request) + # sendBindProject(request, {invite_code: content}) + # else request.reply.text "您的意见已收到,非常感谢~ \n更多问题可以通过以下方式联系我们:\n官方QQ群:173184401\n我们会认真聆听您的意见和建议。" - end + # end end # When receive 'help', will trigger this responder @@ -456,18 +456,29 @@ class WechatsController < ActionController::Base session[:wechat_openid] = open_id if params[:code] - # if params[:state].match("review_class_member") || params[:state].match("review_project_member") + if !(params[:state] == "invite_code" || params[:state] == "project_invite_code" || params[:state] == "blog_comment" || params[:state] == "course_notice" || params[:state] == "project_discussion" || params[:state] == "course_discussion" || params[:state] == "homework" || params[:state] == "issues" || params[:state] == "journal_for_message") + uw = user_binded?(open_id) + if uw + user = uw.user + lastname = user.lastname + end + end + + if lastname && lastname == "" + @path = '/edit_userinfo' + else @path = params[:state].split('/')[0] useridstr = params[:state].split('/')[1] - # end - if useridstr - redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}&#{useridstr}" and return - elsif params[:id] - redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return - else - redirect_to "/wechat/user_activities##{@path}" and return + + if useridstr + redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}&#{useridstr}" and return + elsif params[:id] + redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return + else + redirect_to "/wechat/user_activities##{@path}" and return + end + # redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return end - # redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return end end render 'wechats/user_activities', layout: nil diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 94b0b2c6e..d3b28fb20 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -345,7 +345,11 @@ module ApplicationHelper def link_to_isuue_user(user, options={}) if user.is_a?(User) - name = h(user.name(options[:format])) + if options[:format] + name = h(user.name(options[:format])) + else + name = h(user.show_name) + end link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.host_user}, :class => "pro_info_p" else h(user.to_s) @@ -921,6 +925,12 @@ module ApplicationHelper s.html_safe end + # 计算Pull Request的请求数目 + def pull_request_count project + g = Gitlab.client + g.merge_requests(project.gpid).count + end + #项目成员列表复选框生成 def project_member_check_box_tags_ex name, principals s = '' @@ -978,7 +988,7 @@ module ApplicationHelper groups = '' collection.sort.each do |element| selected_attribute = ' selected="selected"' if option_value_selected?(element, selected) - (element.is_a?(Group) ? groups : s) << %() + (element.is_a?(Group) ? groups : s) << %() end unless groups.empty? s << %(#{groups}) @@ -3521,3 +3531,21 @@ def get_forge_act_message(act, type) format_time(forge_act.nil? ? act.created_on : forge_act.try(:updated_at)) end +#作业类型 +def homework_type_option + type = [] + option1 = [] + option1 << "普通作业" + option1 << 1 + option2 = [] + option2 << "编程作业" + option2 << 2 + option3 = [] + option3 << "分组作业" + option3 << 3 + type << option1 + type << option2 + type << option3 + type +end + diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 71c50cd82..f119e0e69 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -14,21 +14,30 @@ module CoursesHelper # 推荐的精品课程 - def excellent_course_recommend current_course - q = "%#{current_course.name.strip}%" - recomment_courses = [] - # 推荐过程过滤掉自身 - sql = "SELECT distinct c.* FROM course_activities cs, courses c where cs.course_id = c.id - and (c.is_excellent =1 or c.excellent_option =1) and c.is_public = 1 and c.id != #{current_course.id} order by cs.updated_at desc;" - ex_courses = Course.find_by_sql(sql) - # 使用课程的tag去和课程名称进行匹配 - c_courses = ex_courses.select{|ex_course| ex_course.tags.any?{|tag| q.include?(tag.to_s)}} - if c_courses.count < 3 - results = c_courses.length == 0 ? ex_courses.first(3) : (c_courses + ex_courses.first(3 - ex_courses.count)) - else - results = c_courses.first(3) + def excellent_course_recommend new_course + q = "%#{new_course.name.strip}%" + result = find_excelletn_course(q, new_course) + end + + # 查询符合条件的精品课程 + # 用新课程名去匹配精品课程中按课程名和Tag名 + def find_excelletn_course keywords, current_course + # 获取tag匹配结果ID + a_tags = [] + Course.where("is_excellent =? and is_public =?", 1, 1).each do |ec| + if ec.tags.any?{|value| current_course.name.include?(value.to_s)} + a_tags << ec.id + end end - results + # 课程本身不能搜索显示自己 + excellent_ids = a_tags.uniq.delete_if{|i| i == current_course.id} + sql = "SELECT distinct c.id FROM course_activities cs, courses c where cs.course_id = c.id + and (c.is_excellent =1 or c.excellent_option =1) and c.is_public = 1 and c.id != #{current_course.id} order by cs.updated_at desc;" + default_ids = Course.find_by_sql(sql).flatten.map { |c| c.id } + excellent_ids << default_ids.flatten + arr_result = excellent_ids.flatten.uniq.first(3) + excellent_courses = Course.find(arr_result) + return excellent_courses end # 判断精品课程是否可见,非课程成员无法查看私有课程 @@ -54,6 +63,7 @@ module CoursesHelper # searchTeacherAndAssistant(project).count end + # 统计数目 def show_nav?(count) count == 0 ? true : false end @@ -183,18 +193,6 @@ module CoursesHelper # garble count # end - def homework_type_option - type = [] - option1 = [] - option2 = [] - option1 << l(:label_task_submit_form_accessory) - option1 << 1 - option2 << l(:label_task_submit_form_project) - option2 << 2 - type << option1 - type << option2 - end - def proportion_option type = [] i = 0 @@ -798,11 +796,12 @@ module CoursesHelper link.html_safe end + # 可以查看到资源库的资源 def visable_attachemnts_incourse course return[] unless course result = [] course.attachments.each do |attachment| - if (attachment.is_public? && attachment.is_publish == 1) ||User.current == attachment.author ||User.current.allowed_to?(:as_teacher,course)|| (User.current.member_of_course?(course) && attachment.is_publish == 1) || User.current.admin? + if attachment.is_public? && attachment.is_publish == 1 || User.current == attachment.author || User.current.allowed_to?(:as_teacher,course) || (User.current.member_of_course?(course) && attachment.is_publish == 1) || User.current.admin? result << attachment end end diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index b161e29e9..5a124849f 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -111,9 +111,9 @@ module IssuesHelper def principals_options_for_isuue_list(project) if User.current.member_of?(project) - project.members.includes(:user).order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["<< #{l(:label_me)} >>", User.current.id]).unshift(["指派给", 0]) + project.members.includes(:user).order("lower(users.login)").map{|c| [User.find(c.user_id).show_name, c.user_id]}.unshift(["<< #{l(:label_me)} >>", User.current.id]).unshift(["指派给", 0]) else - project.members.includes(:user).order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["指派给", 0]) + project.members.includes(:user).order("lower(users.login)").map{|c| [User.find(c.user_id).show_name, c.user_id]}.unshift(["指派给", 0]) end end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index afc6cb1d9..88be249a1 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -224,19 +224,6 @@ module ProjectsHelper def get_projects_by_tag(tag_name) Project.tagged_with(tag_name).order('updated_on desc') end - - # added by fq - def homework_type_option - type = [] - option1 = [] - option2 = [] - option1 << l(:label_task_submit_form_accessory) - option1 << 1 - option2 << l(:label_task_submit_form_project) - option2 << 2 - type << option1 - type << option2 - end #是否启动互评下拉框 def is_evaluation_option diff --git a/app/helpers/student_work_helper.rb b/app/helpers/student_work_helper.rb index 1e7df6466..63344fa1a 100644 --- a/app/helpers/student_work_helper.rb +++ b/app/helpers/student_work_helper.rb @@ -165,4 +165,13 @@ module StudentWorkHelper student_works = homework.student_works.where("user_id in #{user_ids}") return student_works end + + def add_score_to_member student_work, homework, role, score_type, score + student_works = group_student_works student_work, homework + student_works.each do |st_work| + if st_work.student_works_scores.where("reviewer_role = #{role} and score is not null").empty? + st_work.update_attribute("#{score_type}", score) + end + end + end end \ No newline at end of file diff --git a/app/models/at_message.rb b/app/models/at_message.rb index 5a175fe76..2212ef07e 100644 --- a/app/models/at_message.rb +++ b/app/models/at_message.rb @@ -89,7 +89,7 @@ class AtMessage < ActiveRecord::Base status = -1 end when 'JournalsForMessage' - if at_message.jour && at_message.jour.course + if at_message.jour && defined? at_message.jour.course #作业回复 shield_type = "Course" container_id = at_message.jour.course.id @@ -99,7 +99,7 @@ class AtMessage < ActiveRecord::Base else type = "journal_for_message" detail_id = topic.id - detail_title = at_message.subject + detail_title = at_message.notes end else status = -1 diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index a901e6338..7a082cecf 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -77,7 +77,8 @@ class HomeworkCommon < ActiveRecord::Base count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count if count == 0 ws = WechatService.new - ws.homework_message_notice(m.user_id, "homework", self.id, "#{m.user.show_name},#{l(:label_new_homework_template)}", self.course.name, "新作业:"+ self.name.html_safe, "作业内容请点击“详情”查看。") + name = self.course.syllabus.nil? ? self.course.name : self.course.syllabus.title+" • "+self.course.name + ws.homework_message_notice(m.user_id, "homework", self.id, "#{m.user.show_name},#{l(:label_new_homework_template)}", name, "新作业:"+ self.name.html_safe, "作业内容请点击“详情”查看。") end # end end diff --git a/app/models/student_work.rb b/app/models/student_work.rb index 59e5b76bc..a3f692341 100644 --- a/app/models/student_work.rb +++ b/app/models/student_work.rb @@ -170,12 +170,6 @@ class StudentWork < ActiveRecord::Base end end end - if homework.homework_type == 3 - pros = student_work.student_work_projects.where("is_leader = 0") - user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")" - student_works = homework.student_works.where("user_id in #{user_ids}") - student_works.update_all(:final_score => student_work.final_score,:teacher_score => student_work.teacher_score,:student_score => student_work.student_score,:teaching_asistant_score => student_work.teaching_asistant_score,:work_score => student_work.work_score) - end end end diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 24e15f369..5add9979d 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -332,7 +332,7 @@ class CoursesService # unless (course.is_public == 1 || current_user.member_of_course?(course) || current_user.admin?) # raise '403' # end - {:course => course,:work_unit => work_unit, :img_url => url_to_avatar(course),:current_user_is_member => current_user.nil? ? false : current_user.member_of_course?(course),:current_user_is_teacher => current_user.nil? ? false : is_course_teacher(current_user,course),:course_student_num => course ? course.student.count.to_s : 0} + {:course => course,:syllabus_title => course.syllabus.nil? ? "":course.syllabus.title ,:work_unit => work_unit, :img_url => url_to_avatar(course),:current_user_is_member => current_user.nil? ? false : current_user.member_of_course?(course),:current_user_is_teacher => current_user.nil? ? false : is_course_teacher(current_user,course),:course_student_num => course ? course.student.count.to_s : 0} end #创建课程 @@ -554,8 +554,10 @@ class CoursesService uid = user.id type = "review_class_member" end + + name = course.syllabus.nil? ? course.name : course.syllabus.title+" • "+course.name ws = WechatService.new - ws.class_notice user.id, type, course.id, title, course.name, user.show_name, format_time(Time.now), content, remark,uid + ws.class_notice user.id, type, course.id, title,name, user.show_name, format_time(Time.now), content, remark,uid end end @@ -650,8 +652,9 @@ class CoursesService rolename = role_ids.include?("7") ? "助教" : "教师" content = current_user.show_name + "申请以"+rolename+"身份加入班级,等待您的审批。" + name = course.syllabus.nil? ? course.name : course.syllabus.title+" • "+course.name ws = WechatService.new - ws.class_notice tea_user.id, "review_class_member", course.id, "班级成员审批通知。", course.name, tea_user.show_name, format_time(Time.now), content, "点击查看申请详情。",current_user.id + ws.class_notice tea_user.id, "review_class_member", course.id, "班级成员审批通知。", name, tea_user.show_name, format_time(Time.now), content, "点击查看申请详情。",current_user.id end end #-------------------------------------------- diff --git a/app/services/syllabuses_service.rb b/app/services/syllabuses_service.rb index f12ae67cc..caf6e052e 100644 --- a/app/services/syllabuses_service.rb +++ b/app/services/syllabuses_service.rb @@ -69,7 +69,8 @@ class SyllabusesService if count == 0 ws = WechatService.new title = "恭喜您创建班级成功。" - ws.create_class_notice user.id, "create_course_notice", course.id,title, course.name, user.show_name, 1, "点击查看班级详情。" + name = course.syllabus.nil? ? course.name : course.syllabus.title+" • "+course.name + ws.create_class_notice user.id, "create_course_notice", course.id,title, name, user.show_name, 1, "点击查看班级详情。" end end diff --git a/app/views/attachments/_activity_attach.html.erb b/app/views/attachments/_activity_attach.html.erb index b37c80dad..48c01468a 100644 --- a/app/views/attachments/_activity_attach.html.erb +++ b/app/views/attachments/_activity_attach.html.erb @@ -9,8 +9,9 @@ ( <%= number_to_human_size attachment.filesize %>) - - <%= link_to h(truncate(attachment.author.name, length: 15, omission: '...')),user_path(attachment.author),:class => "c_orange" %>, + <% user_name = attachment.author.show_name.empty? ? attachment.author : attachment.author.show_name %> + + <%= link_to h(truncate(user_name, length: 15, omission: '...')),user_path(attachment.author),:class => "linkBlue2" %>, <%= format_time(attachment.created_on) %> diff --git a/app/views/attachments/_project_file_links.html.erb b/app/views/attachments/_project_file_links.html.erb index 759a9a735..4d261c5d1 100644 --- a/app/views/attachments/_project_file_links.html.erb +++ b/app/views/attachments/_project_file_links.html.erb @@ -91,8 +91,8 @@   <% end %> <% if options[:author] %> - - <%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "link-blue" %>, + + <%= link_to h(truncate(attachment.author.show_name, length: 10, omission: '...')),user_path(attachment.author),:class => "link-blue" %>, <%= format_time(attachment.created_on) %> <% end %> diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb index 4c4374a29..f754c4540 100644 --- a/app/views/courses/new.html.erb +++ b/app/views/courses/new.html.erb @@ -17,12 +17,13 @@
  • - +
  • 正确示例:计算机系2016秋季A班
  • 错误示例:软件工程 - 计算机系2016秋季A班
  • +
  • 班级是一个由教师、助教(教辅)和学生组成的临时的教学群体,在规定的时间内(如一个学期)完成一门课程规定的教学任务。本质上,一门课程就是一个教学计划。
  • diff --git a/app/views/forums/_forum_list.html.erb b/app/views/forums/_forum_list.html.erb index ec9f4f7de..9a52fb410 100644 --- a/app/views/forums/_forum_list.html.erb +++ b/app/views/forums/_forum_list.html.erb @@ -11,7 +11,8 @@ <%#= link_to forum.name.gsub(/(\r\n|\s+)/,'
    '), forum_path(forum),:class=>"f16 linkBlue" %>
    <%= textAreailizable forum.description%>
    - + <% user_name = forum.creator.show_name.empty? ? forum.creator.name : forum.creator.show_name %> +
    创建者:<%= user_name %>
    diff --git a/app/views/forums/_show_topics.html.erb b/app/views/forums/_show_topics.html.erb index 11b1403cd..c3b8b4dbe 100644 --- a/app/views/forums/_show_topics.html.erb +++ b/app/views/forums/_show_topics.html.erb @@ -27,7 +27,7 @@
    <% author = topic.last_reply.try(:author)%> <% if author%> -
    最后回复:<%= author.name%>
    +
    最后回复:<%= author.show_name%>
    <%= format_date(topic.last_reply.created_at)%>
    <% end%> 更新时间:<%= format_date(topic.updated_at)%> diff --git a/app/views/homework_common/edit.html.erb b/app/views/homework_common/edit.html.erb index 1bd71e7a9..4a3de027b 100644 --- a/app/views/homework_common/edit.html.erb +++ b/app/views/homework_common/edit.html.erb @@ -41,6 +41,20 @@
    + <% committed_work_count = @homework.student_works.has_committed.count %> + <% stu_pro_count = @homework.student_work_projects.count %> + <% if committed_work_count != 0 %> + <% if @homework.homework_type == 1 %> +

    已有<%=committed_work_count %>个学生提交作品,不允许再修改作业类型。

    + <% elsif @homework.homework_type == 2 %> +

    已有<%=committed_work_count %>个学生提交作品,不允许再修改作业类型和测试集。

    + <% elsif @homework.homework_type == 3 %> +

    已有<%=committed_work_count %>个学生提交作品,不允许再修改作业类型和分组设置。

    + <% end %> + <% elsif stu_pro_count != 0 && @homework.homework_type == 3 %> +

    已有<%=stu_pro_count %>个学生关联项目,不允许再修改作业类型。

    + <% end %> + <%= form_for @homework do |f| %> diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index 167ae98f0..3a171f642 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -3,13 +3,13 @@ $("#homework_name").val(""); $("#homework_publish_time").val(""); $("#homework_end_time").val(""); - document.getElementById("anonymous_comment").checked = true; $("#course_id").val($("#option_select").val()); + $("#homeworkSetting").addClass("undis"); + $("#homeworkSetting").html(""); $("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => HomeworkCommon.new,:has_program => true,:has_group => true})%>"); //homework_description_editor.html(""); $("#homework_name_span").text(""); $("#homework_end_time_span").text(""); - $("#homework_end_time_span").text(""); $("#homework_course_id_span").text(""); $("#homework_editor").toggle(); } diff --git a/app/views/issues/_detail.html.erb b/app/views/issues/_detail.html.erb index ac912a71c..9ae3dfc43 100644 --- a/app/views/issues/_detail.html.erb +++ b/app/views/issues/_detail.html.erb @@ -20,7 +20,7 @@ <%= get_issue_priority(@issue.priority_id)[1] %>


    - 由<%=link_to @issue.author, user_path(@issue.author), :class => "link-blue" %>添加于 <%= format_time(@issue.created_on).html_safe %> + 由<%=link_to @issue.author.show_name, user_path(@issue.author), :class => "link-blue" %>添加于 <%= format_time(@issue.created_on).html_safe %>
    diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb index ccd37dc91..ea15af42e 100644 --- a/app/views/issues/_edit.html.erb +++ b/app/views/issues/_edit.html.erb @@ -3,7 +3,7 @@ <%= import_ke(enable_at: true, prettify: false, init_activity: false) %> <% end %> -<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true, :remote => true} do |f| %> +<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true} do |f| %> <%= error_messages_for 'issue', 'time_entry' %> <%= render :partial => 'conflict' if @conflict %> diff --git a/app/views/issues/_jounal_refresh.js.erb b/app/views/issues/_jounal_refresh.js.erb index db5a068bf..5ccbf69d2 100644 --- a/app/views/issues/_jounal_refresh.js.erb +++ b/app/views/issues/_jounal_refresh.js.erb @@ -1,3 +1,8 @@ +/* $("#reply_div_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue}) %>"); +$("#issue_detail_show").html('<%#= escape_javascript(render :partial => 'issues/detail') %>'); +$("#issue_edit_show").html('<%#= escape_javascript(render :partial => 'issues/edit') %>'); +$("#div_issue_attachment_<%#=@issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/issue_attachments', :locals => {:issue => @issue}) %>"); +sd_create_editor_from_data(<%#= @issue.id %>, null, "100%", "<%#= @issue.class.name %>");*/ location.reload(); issue_desc_editor = KindEditor.create('#issue_description', @@ -14,3 +19,5 @@ issue_desc_editor = KindEditor.create('#issue_description', "uploadJson":"/kindeditor/upload", "fileManagerJson":"/kindeditor/filemanager"}); // $("#issue_test_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/edit', :locals => {:issue => Issue.find( @issue_id)}) %>"); +// $(".homepagePostReplyBannerCount").html('<%#= escape_javascript(render :partial => 'issues/issue_reply_banner') %>'); +// sd_create_editor_from_data(<%#= @issue.id%>, null, "100%","<%#= @issue.class.name %>"); \ No newline at end of file diff --git a/app/views/issues/update.js.erb b/app/views/issues/update.js.erb index 733066d38..bcf4c3077 100644 --- a/app/views/issues/update.js.erb +++ b/app/views/issues/update.js.erb @@ -1,4 +1,13 @@ <% if @saved %> +/*$("#issue_detail").replaceWith('<%#= escape_javascript(render :partial => 'issues/detail') %>'); +$("#issue_edit").replaceWith('<%#= escape_javascript(render :partial => 'issues/edit') %>'); + +$("#issue_detail").show(); +$("#issue_edit").hide(); + +$("#reply_div_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>"); +sd_create_editor_from_data(<%#= @issue.id%>, null, "100%","<%#=@issue.class.name%>"); +$(".homepagePostReplyBannerCount").html('<%#= escape_javascript(render :partial => 'issues/issue_reply_banner') %>');*/ location.reload(); //edit里的编辑器貌似显示不出来,所以手动js生成。 issue_desc_editor = KindEditor.create('#issue_description', diff --git a/app/views/layouts/_new_feedback.html.erb b/app/views/layouts/_new_feedback.html.erb index ea63f680f..db90c47c4 100644 --- a/app/views/layouts/_new_feedback.html.erb +++ b/app/views/layouts/_new_feedback.html.erb @@ -1,41 +1,51 @@ <%= javascript_include_tag "feedback" %> -
    +
    -
    -
    - - - - +
    + 问题和建议 + × +
    -
    -
    +
    +
    <% get_memo %> <%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %> - <%= f.text_area :subject, :id=>"subject", :class => "opnionText", :placeholder => l(:label_feedback_tips) %> + <%= f.text_area :subject, :id=>"subject", :class => "opnionText mb5", :placeholder => l(:label_feedback_tips) %> <%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %> - - + 还能输入50个字符 + <%= l(:label_submit)%> +
    <% end %>
    -
    - - <%#= l(:label_technical_support) %> - - - - Trustie师姐师兄答疑群 -
    -
    +
    +
    + + <%#= l(:label_technical_support) %> + + + + +

    加入QQ群

    +
    +
    +

    关注官方微信

    +
    +
    +
    -
    - <%= l(:label_submit)%> - +
    +
    +
    + +
    +
    + × +
    diff --git a/app/views/layouts/_user_courses.html.erb b/app/views/layouts/_user_courses.html.erb index 754cfd10b..60db07db0 100644 --- a/app/views/layouts/_user_courses.html.erb +++ b/app/views/layouts/_user_courses.html.erb @@ -2,10 +2,17 @@
  • <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %> -

    - <%= link_to course.syllabus.title, syllabus_path(course.syllabus_id), :target => '_blank', :class => 'hidden', :style => "max-width:85px; display:inline-block;"%> +

    + <% title = "#{course.syllabus.title}".html_safe %> + <%= link_to title, syllabus_path(course.syllabus_id), :target => '_blank', :class => 'hidden', :style => "max-width:91px; display:inline-block;"%> · - <%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :target => '_blank', :class => 'hidden', :style => "max-width:85px; display:inline-block;"%> + <% classes = "#{course.name}".html_safe %> + <%= link_to classes, course_path(course.id,:host=>Setting.host_course), :target => '_blank', :class => 'hidden', :style => "max-width:91px; display:inline-block;"%> + + 课程名称:<%= course.syllabus.title %>
    + 班级名称:<%= course.name+'('+current_time_and_term(course)+')' %>
    + 班级属性:<%= course.is_public? ? '公开' : '私有' %> +

    <%#= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :id => "show_course_#{course.id}", :class => 'course_list_menu hidden', :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+"("+current_time_and_term(course)+")"%> @@ -106,11 +113,25 @@ } $(".course_list_menu").each(function(){ - var courseWidth = $(this).children().eq(0).width(); - var classWidth = 170 -courseWidth; + var courseWidth = $(this).children().eq(0).children().width(); + var classWidth = $(this).children().eq(2).children().width(); + var newClassWidth = 182 - courseWidth; + var newCourseWidth = 182 - classWidth; console.log(courseWidth, classWidth); - if(courseWidth < 80){ - $(this).children().eq(2).css("max-width",classWidth + "px"); + if(courseWidth < 91 && classWidth > 91){ + $(this).children().eq(2).css("max-width",newClassWidth + "px"); + } + if(classWidth < 91 && courseWidth > 91){ + $(this).children().eq(0).css("max-width",newCourseWidth + "px"); } }) + + $(".course-name").each(function(){ + $(this).mouseenter(function(){ + $(this).parent().parent().children().eq(3).show(); + }); + $(this).mouseleave(function(){ + $(this).parent().parent().children().eq(3).hide(); + }); + }) diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 2c72e3e2e..84aa054e0 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -1,6 +1,7 @@ <%# course_model %> -<%# course_file_num = visable_attachemnts_incourse(@course).count%> -<% course_file_num = Attachment.where(:container_type => "Course", :container_id => @course.id).count %> +<%# course_file_num = Attachment.where(:container_type => "Course", :container_id => @course.id).count %> + +<% course_file_num = visable_attachemnts_incourse(@course).count%> <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> <% homework_num = visable_course_homework @course %> diff --git a/app/views/layouts/base_forums.html.erb b/app/views/layouts/base_forums.html.erb index 021b281d9..b57feb5bd 100644 --- a/app/views/layouts/base_forums.html.erb +++ b/app/views/layouts/base_forums.html.erb @@ -187,7 +187,8 @@
    <%= @forum.name%>
    - + <% user_name = @forum.creator.show_name.empty? ? @forum.creator.name : @forum.creator.show_name %> +
    diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index d684b4297..bf1485cf3 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -58,7 +58,7 @@
    - <%= link_to @memo.author.name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%>
    + <%= link_to @memo.author.show_name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%>
    <%= format_date( @memo.created_at)%>
    @@ -90,7 +90,7 @@
    <%= reply.author.name%><%= format_date(reply.created_at) %>
    -
    <%= h reply.content.html_safe%>
    +
    <%= reply.content.gsub(/script/, "script ").html_safe %>
    \ No newline at end of file diff --git a/app/views/student_work/_evaluation_un_group_member_work.html.erb b/app/views/student_work/_evaluation_un_group_member_work.html.erb new file mode 100644 index 000000000..842e1c899 --- /dev/null +++ b/app/views/student_work/_evaluation_un_group_member_work.html.erb @@ -0,0 +1,82 @@ +
      +
    • +
      + <%= link_to(image_tag(url_to_avatar(st.user),:width =>"40",:height => "40", :style => "display:block;"),user_activities_path(st.user), :class => "fl") %> + <% if !st.student_work_projects.empty? %> + + + (组长) + + + <% else %> + + + + + <% end %> +
      +
      <%= st.teacher_score.nil? ? "--" : format("%.1f",st.teacher_score)%>
      +
      <%= st.teaching_asistant_score.nil? ? "--" : format("%.1f",st.teaching_asistant_score)%>
      + <% if @homework.anonymous_comment == 0 %> +
      +
      + <% if st.student_score.nil? %> + 未参与 + <% else %> + <%= format("%.1f", st.student_score) %> + <% end %> + <% unless st.student_score.nil? %> + + (<%= anon_count %>) + +
      + 现共有 +  <%= anon_count %>  + 名学生进行了匿评,平均分为 +  <%= format("%.1f", st.student_score) %> 分。 +
      + <% end %> +
      +
      + <% end %> +
      + <% score = st.work_score %> +
      + <%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%> + <% unless score.nil?%> +
      + 作品最终评分为 +  <%= st.final_score%> 分。 + 迟交扣分 +   + <%= st.homework_common && st.homework_common.teacher_priority == 1 && st.teacher_score ? 0 : st.late_penalty %> +  分, + 缺评扣分 +   + <%= st.homework_common && st.homework_common.teacher_priority == 1 && st.teacher_score ? 0 : st.absence_penalty%> +  分, + 最终成绩为 +  <%= format("%.1f",score<0 ? 0 : score)%> 分。 +
      + <% end%> +
      +
      +
      +
      + +
    • +
    + + \ No newline at end of file diff --git a/app/views/student_work/_evaluation_un_group_work.html.erb b/app/views/student_work/_evaluation_un_group_work.html.erb index b4337eeb2..5ce2545e7 100644 --- a/app/views/student_work/_evaluation_un_group_work.html.erb +++ b/app/views/student_work/_evaluation_un_group_work.html.erb @@ -1,89 +1,73 @@ - - - <%=index + 1 %> - - <%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(student_work.user)) %> - - <% if @homework.homework_detail_group.base_on_project == 1 %> - -
    - <%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%> -
    - - <% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %> - - <%= link_to( student_work.project.name, project_path(student_work.project.id))%> - - <% else %> - - <%= student_work.project.name %> - - <% end %> - <% elsif @homework.homework_detail_group.base_on_project == 0 %> - -
    - <%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%> -
    - - <% end %> - - <% if student_work.created_at && @homework.end_time%> - <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>  - <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %> - [迟交] - <% end %> - <% end %> - - - <%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%> - - - <%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%> - - <% if @homework.anonymous_comment == 0%> - - <% if student_work.student_score.nil? %> - 未参与 - <% else %> - <%=format("%.1f",student_work.student_score) %> - <% end %> - <% unless student_work.student_score.nil?%> - - (<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>) +
    + + + + + <% if student_work.work_status%> + <%=get_status student_work.work_status %> + <% end %> -
    - 现共有 -  <%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>  - 名学生进行了匿评,平均分为 -  <%= format("%.1f",student_work.student_score)%> 分。 + + <% if @homework.homework_detail_group.base_on_project == 1 %> + 关联项目: + <% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %> + <%= link_to student_work.project.name, project_path(student_work.project.id), :class => 'link-blue fl hidden', :style => "width:200px;", :title => "项目名称"%> + <% else %> + + <% end %> + <% end %> + 评分 +
    +
    +
    + 提交时间:<%=format_date(student_work.commit_time) %> +
    +
    教师:<%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%>
    +
    助教:<%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%>
    + <% if @homework.anonymous_comment == 0 %> +
    匿评: +
    + <% if student_work.student_score.nil? %> + 未参与 + <% else %> + <%= format("%.1f", student_work.student_score) %> + <% end %> + <% unless student_work.student_score.nil? %> + + (<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>) + +
    + 现共有 +  <%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>  + 名学生进行了匿评,平均分为 +  <%= format("%.1f", student_work.student_score) %> 分。 +
    + <% end %> +
    +
    + <% end %> +
    成绩: + <% score = student_work.work_score %> +
    + <%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%> + <% unless score.nil?%> +
    + 作品最终评分为 +  <%= student_work.final_score%> 分。 + 迟交扣分 +   + <%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %> +  分, + 缺评扣分 +   + <%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty%> +  分, + 最终成绩为 +  <%= format("%.1f",score<0 ? 0 : score)%> 分。
    <% end%> - - <% end %> - - <% if student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score %> - <% score = student_work.respond_to?("score") ? student_work.score : student_work.teacher_score %> - <% else %> - <% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty%> - <% end %> - - <%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%> - <% unless score.nil?%> -
    - 作品最终评分为 -  <%= student_work.final_score%> 分。 - 迟交扣分 -   - <%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %> -  分, - 缺评扣分 -   - <%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty%> -  分, - 最终成绩为 -  <%= format("%.1f",score<0 ? 0 : score)%> 分。 -
    - <% end%> - -
    - \ No newline at end of file +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/app/views/student_work/_evaluation_un_title.html.erb b/app/views/student_work/_evaluation_un_title.html.erb index 4091911fe..4fdd6384f 100644 --- a/app/views/student_work/_evaluation_un_title.html.erb +++ b/app/views/student_work/_evaluation_un_title.html.erb @@ -74,7 +74,7 @@ <%# end %> - <% @stundet_works.includes(:user => {:user_extensions => []}, :project => {}, :student_works_scores => {}).each_with_index do |student_work, i| %> + <% @stundet_works.each_with_index do |student_work, i| %> <%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work, :index => i} %> diff --git a/app/views/student_work/_group_member_work.html.erb b/app/views/student_work/_group_member_work.html.erb new file mode 100644 index 000000000..bfe25c982 --- /dev/null +++ b/app/views/student_work/_group_member_work.html.erb @@ -0,0 +1,11 @@ +<% user_ids = student_work.student_work_projects.empty? ? "(-1)" : "(" + student_work.student_work_projects.map{|st| st.user_id}.join(",") + ")" %> +<% student_work_groups = @homework.student_works.where("user_id in #{user_ids}").order("created_at asc") %> +<% anon_count = student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %> +<% student_work_groups.each_with_index do |st, j| %> +
    + <%= render :partial => 'evaluation_un_group_member_work', :locals => {:st => st, :anon_count => anon_count} %> +
    + <% if j != 0 %> +
    + <% end %> +<% end %> \ No newline at end of file diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb index 9f65376e3..a45eca30b 100644 --- a/app/views/student_work/_show.html.erb +++ b/app/views/student_work/_show.html.erb @@ -7,6 +7,8 @@ <% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %> <% is_my_work = pro && pro.student_work_id == work.id%> <% end %> + <% is_member_work = @homework.homework_type == 3 && work.student_work_projects.empty? %> + <% if !is_member_work %>
    • 上交时间: @@ -31,8 +33,7 @@
      - - <% if @homework.homework_type == 3 && work.student_work_projects && (@homework.homework_detail_manual.comment_status != 2 || is_my_work || is_teacher ) %> + <% if @homework.homework_type == 3 && work.student_work_projects && (@homework.homework_detail_manual.comment_status != 2 || is_my_work || is_teacher ) %>
    • 参与人员: @@ -58,42 +59,55 @@ <%#= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
    • <% end %> - <% end%> + <% end%> -
    • - 内容: -
      - <%= work.description.html_safe if work.description%> -
      -
      -
    • -
    • - 附件: - <% com_attachments = work.attachments.where("attachtype IS NULL OR attachtype <> 7") %> - <% if com_attachments.empty?%> +
    • + 内容: +
      + <%= work.description.html_safe if work.description%> +
      +
      +
    • +
    • + 附件: + <% com_attachments = work.attachments.where("attachtype IS NULL OR attachtype <> 7") %> + <% if com_attachments.empty?%> 尚未提交附件 - <% else%> + <% else%>
      <%= render :partial => 'work_attachments_status', :locals => {:attachments => com_attachments, :status => @homework.homework_detail_manual.comment_status} %>
      - <% end%> -
      -
    • -
    • - <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%> + <% end%> +
      +
    • +
    • + <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%>
      <%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
      - <% end%> -
      -
    • + <% end%> +
      +
    <%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
    + <% else %> +
      +
    • + <% if @is_teacher %> + +
      + <%= render :partial => 'add_score',:locals => {:work => work,:score => score}%> +
      + <% end%> +
      +
    • +
    + <% end %>
    <%student_work_scores.each do |student_score|%> @@ -101,6 +115,9 @@ <%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
    <% end%> + <% if is_member_work && student_work_scores.empty? && !@is_teacher %> +

    暂无评分

    + <% end %>
    diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb index dbde6d24c..73f37602b 100644 --- a/app/views/student_work/_student_work_list.html.erb +++ b/app/views/student_work/_student_work_list.html.erb @@ -36,11 +36,19 @@
    - <% if @is_evaluation && !@stundet_works.empty?%> - <%= render :partial => "evaluation_title"%> - <% else%> - <%= render :partial => "evaluation_un_title"%> - <% end%> + <% if @homework.homework_type != 3%> + <% if @is_evaluation && !@stundet_works.empty? %> + <%= render :partial => "evaluation_title"%> + <% else%> + <%= render :partial => "evaluation_un_title"%> + <% end%> + <% else %> + <% if !@is_teacher && @is_evaluation && !@stundet_works.empty? %> + <%= render :partial => "evaluation_title"%> + <% else %> + <%= render :partial => "evaluation_un_group"%> + <% end%> + <% end %>
    diff --git a/app/views/student_work/add_score.js.erb b/app/views/student_work/add_score.js.erb index c961fb077..6acf9eb45 100644 --- a/app/views/student_work/add_score.js.erb +++ b/app/views/student_work/add_score.js.erb @@ -11,8 +11,18 @@ var num = $("#work_num_<%= @work.id%>").html(); $("#score_list_<%= @work.id%>").removeAttr("style"); <% if @is_teacher %> - $("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_un_work',:locals => {:student_work => @work, :index => 1}) %>"); - $("#work_num_<%= @work.id%>").html(num); + <% if @homework.homework_type == 3 %> + <% if @is_group_leader %> + $("#student_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'evaluation_un_group_work', :locals => {:student_work => @work}) %>"); + $("#group_member_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'group_member_work', :locals => {:student_work => @work}) %>"); + <% else %> + <% anon_count = @work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %> + $("#student_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'evaluation_un_group_member_work', :locals => {:st => @work, :anon_count => anon_count}) %>"); + <% end %> + <% else %> + $("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_un_work',:locals => {:student_work => @work, :index => 1}) %>"); + $("#work_num_<%= @work.id%>").html(num); + <% end %> <% else %> $("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work, :index => 1}) %>"); $("#work_num_<%= @work.id%>").html(num); diff --git a/app/views/student_work/edit.html.erb b/app/views/student_work/edit.html.erb index 931cdc1de..657bdf486 100644 --- a/app/views/student_work/edit.html.erb +++ b/app/views/student_work/edit.html.erb @@ -2,6 +2,7 @@ <%= import_ke(enable_at: true, prettify: false, init_activity: false) %> <%= javascript_include_tag 'homework','baiduTemplate' %> <% end %> +
    编辑作品
    @@ -83,6 +84,7 @@ <% end%>
    + -
    +
    +
    提交作品
    @@ -297,4 +298,5 @@
    <% end%>
    -
    \ No newline at end of file + + diff --git a/app/views/users/_message_replies.html.erb b/app/views/users/_message_replies.html.erb index 669aea26c..ce1e70887 100644 --- a/app/views/users/_message_replies.html.erb +++ b/app/views/users/_message_replies.html.erb @@ -24,6 +24,8 @@ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
    <% if type == 'Message' %> + <% topic = comment.root %> + <% if !topic.locked? && authorize_for('messages', 'reply') %> <%= link_to( l(:button_reply), @@ -33,6 +35,7 @@ :title => l(:button_reply)) %> + <% end %> <% if comment.course_destroyable_by?(User.current) || comment.destroyable_by?(User.current) %> <%= link_to( l(:button_delete), diff --git a/app/views/users/_project_boardlist.html.erb b/app/views/users/_project_boardlist.html.erb index 3ba0244d9..e0e2fddf8 100644 --- a/app/views/users/_project_boardlist.html.erb +++ b/app/views/users/_project_boardlist.html.erb @@ -43,7 +43,7 @@
    - 发帖人:<%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %> + 发帖人:<%=(u.try(:realname) != " " ? u.try(:lastname) + u.try(:firstname) : u.try(:login)) unless u.nil? %> 更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %> <% all_comments = []%> diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index e1c9038d5..5a0065f86 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -1,105 +1,108 @@ -
    -
    -
    - <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> - <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> -
    -
    -
    - <% if activity.try(:author).try(:realname) == ' ' %> - <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> - <% else %> - <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> - <% end %> TO - <%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%> -
    - <% if User.current.logged? %> -
    -
      -
    • -
        -
      • - <%= link_to l(:button_edit), issue_path(activity.id, :edit => 'true'), :class => 'postOptionLink', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %> -
      • -
      • - <% if !defined?(project_id) && !defined?(user_id) %> - <%= link_to l(:button_delete), issue_path(activity.id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> - <% elsif defined?(project_id) %> - <%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "project_page", :page_id => project_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> - <% elsif defined?(user_id) %> - <%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "user_page", :page_id => user_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> - <% end %> -
      • -
      • - <%= link_to l(:button_copy), project_copy_issue_path(activity.project, activity), :class => 'postOptionLink' if User.current.allowed_to?(:add_issues, activity.project) %> +<% unless activity.author.nil? %> +
        +
        +
        + <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> + <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> +
        +
        +
        + <% if activity.try(:author).try(:realname) == ' ' %> + <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> + <% else %> + <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> + <% end %> TO + <%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%> +
        + <% if User.current.logged? %> +
        +
          +
        • +
            +
          • + <%= link_to l(:button_edit), issue_path(activity.id, :edit => 'true'), :class => 'postOptionLink', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %> +
          • +
          • + <% if !defined?(project_id) && !defined?(user_id) %> + <%= link_to l(:button_delete), issue_path(activity.id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> + <% elsif defined?(project_id) %> + <%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "project_page", :page_id => project_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> + <% elsif defined?(user_id) %> + <%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "user_page", :page_id => user_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> + <% end %> +
          • +
          • + <%= link_to l(:button_copy), project_copy_issue_path(activity.project, activity), :class => 'postOptionLink' if User.current.allowed_to?(:add_issues, activity.project) %> +
          • +
        -
      • -
      -
    - <% end %> -
    - <% case activity.tracker_id %> - <% when 1%> - 【缺陷】 - <% when 2%> - 【功能】 - <% when 3%> - 【支持】 - <% when 4%> - 【任务】 - <% when 5%> - 【周报】 - <% end %> - <%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey ml5", :target => "_blank" %> - +
    + <% end %> +
    + <% case activity.tracker_id %> + <% when 1%> + 【缺陷】 + <% when 2%> + 【功能】 + <% when 3%> + 【支持】 + <% when 4%> + 【任务】 + <% when 5%> + 【周报】 + <% end %> + <%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey ml5", :target => "_blank" %> + <%= get_issue_priority(activity.priority_id)[1] %> -
    -
    -
    指派给   - <% unless activity.assigned_to_id.nil? %> - <% if activity.try(:assigned_to).try(:realname) == ' ' %> - <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> - <% else %> - <%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> +
    +
    +
    指派给   + <% unless activity.assigned_to_id.nil? %> + <% if activity.try(:assigned_to).try(:realname) == ' ' %> + <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> + <% else %> + <%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> + <% end %> + <% end %> +
    +
    + 发布时间: + <%=format_time(activity.created_on) %> +
    +
    + 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %> +
    +
    +
    + <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id => user_activity_id, :content => activity.description} %> + + +
    + <%# 局部刷新:修改xissue属性 %> + <% if User.current.member_of?(activity.project) && !activity.nil? && !activity.status.nil? %> + <% unless params[:action] == "index" %> +
    + <%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %> +
    <% end %> <% end %> -
    -
    - 发布时间: - <%=format_time(activity.created_on) %> -
    -
    - 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %> +
    +
    + <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> +
    - <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id => user_activity_id, :content => activity.description} %> - - -
    - <%# 局部刷新:修改xissue属性 %> - <% if User.current.member_of?(activity.project) && !activity.nil? && !activity.status.nil? %> - <% unless params[:action] == "index" %> -
    - <%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %> -
    - <% end %> - <% end %> -
    -
    - <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> +
    + <%= render :partial => 'users/project_issue_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
    -
    -
    -
    - <%= render :partial => 'users/project_issue_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %> -
    -
    - + +<% end %> + diff --git a/app/views/users/_project_issue_detail.html.erb b/app/views/users/_project_issue_detail.html.erb index 95e297f49..321ba663a 100644 --- a/app/views/users/_project_issue_detail.html.erb +++ b/app/views/users/_project_issue_detail.html.erb @@ -62,7 +62,7 @@
  •  指派  : 

    - <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "linkBlue hidden", :style => "max-width:100px; display:inline-block;" %> + <%= link_to activity.try(:assigned_to).show_name, user_path(activity.assigned_to_id), :class => "linkBlue hidden", :style => "max-width:100px; display:inline-block;" %> <%= select( :issue, :user_id, principals_options_for_isuue_list(activity.project), { :include_blank => false,:selected => @assign_to_id ? @assign_to_id : 0}, diff --git a/app/views/users/_user_group_attr.html.erb b/app/views/users/_user_group_attr.html.erb index 6d09f6896..4596ef411 100644 --- a/app/views/users/_user_group_attr.html.erb +++ b/app/views/users/_user_group_attr.html.erb @@ -1,27 +1,27 @@ -分组设置 - -
    - 每组最小人数: - 人 - +
    +
    分组设置: +
    每组最小人数: + />人 +
    +
    每组最大人数: + />人 +
    + +
    +
    + +

    提醒:勾选后各小组必须在Trustie平台创建项目,教师可随时观察平台对各小组最新进展的实时统计

    +
    +
    +
    -
    - 每组最大人数: - 人 - -
    -

    -
    - -

    提醒:勾选后各小组必须在Trustie平台创建项目,教师可随时观察平台对各小组最新进展的实时统计

    -
    -
    - 确定 -
    -
    - 取消 -
    -
    \ No newline at end of file +
    + + \ No newline at end of file diff --git a/app/views/users/_user_homework_attachment.html.erb b/app/views/users/_user_homework_attachment.html.erb index 6051d8de9..4f35326b0 100644 --- a/app/views/users/_user_homework_attachment.html.erb +++ b/app/views/users/_user_homework_attachment.html.erb @@ -71,17 +71,6 @@ 上传附件 <%= link_to "资源库", user_ref_resource_search_user_path(User.current.id, :homework_id => container.id), :class => "FilesBtn fl mt3 mr15", :title => "请从资源库中选择文件作为作业的附件", :remote => true %> - <% if defined?(has_program) && has_program %> -
    - 编程 - -
    - <% end %> - <% if defined?(has_group) && has_group %> -
    - 分组 -
    - <% end %>
    <% content_for :header_tags do %> diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index b3f9970c6..f225e4fcd 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -1,3 +1,4 @@ +<% not_allow_select = edit_mode && homework.student_works.has_committed.count != 0 %> <% content_for :header_tags do %> <%= import_ke(enable_at: true, prettify: false, init_activity: false) %> @@ -5,14 +6,31 @@ - - - - - - - - <% unless edit_mode %>