diff --git a/Gemfile b/Gemfile index 55478816f..3bfe246a4 100644 --- a/Gemfile +++ b/Gemfile @@ -106,3 +106,6 @@ gem 'omniauth-oauth2', '~> 1.6.0' # global var gem 'request_store' + +# 敏感词汇 +gem 'harmonious_dictionary', '~> 0.0.1' diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 52911e905..599a4440c 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -224,7 +224,7 @@ class CoursesController < ApplicationController normal_status(0, "成功") rescue => e uid_logger_error(e.message) - tip_exception("课堂更新失败") + tip_exception("课堂更新失败,原因: #{e.message}") raise ActiveRecord::Rollback end end @@ -1554,7 +1554,7 @@ class CoursesController < ApplicationController end def course_statistics course, max_exp, limit - max_rate = max_exp.nil? ? 0 : 20.0 / max_exp + max_rate = max_exp.nil? || max_exp <= 0 ? 0 : 20.0 / max_exp sql_select = %Q{ SELECT a.*, (message_num*0.2 + message_reply_num*0.1 + resource_num*0.5 + homework_journal_num*0.1 + graduation_num + homework_num + exercise_num + poll_num*0.7 + exercise_score * 0.7 + graduation_score * 0.7 + homework_score * 0.7 + exp*#{max_rate}) diff --git a/app/controllers/discusses_controller.rb b/app/controllers/discusses_controller.rb index c2cc8f933..bcbba1a3a 100644 --- a/app/controllers/discusses_controller.rb +++ b/app/controllers/discusses_controller.rb @@ -85,7 +85,7 @@ class DiscussesController < ApplicationController :hidden => !current_user.admin?) # 管理员回复的能够显示 rescue Exception => e uid_logger_error("create discuss failed : #{e.message}") - raise Educoder::TipException.new("评论异常") + raise Educoder::TipException.new("评论异常,原因:#{e.message}") end end @@ -97,7 +97,7 @@ class DiscussesController < ApplicationController :dis_type => @discuss.dis_type, :position => @discuss.position) rescue Exception => e uid_logger_error("reply discuss failed : #{e.message}") - raise Educoder::TipException.new("回复评论异常") + raise Educoder::TipException.new("回复评论异常,原因: #{e.message}") end end diff --git a/app/controllers/graduation_tasks_controller.rb b/app/controllers/graduation_tasks_controller.rb index e8ad221be..117989247 100644 --- a/app/controllers/graduation_tasks_controller.rb +++ b/app/controllers/graduation_tasks_controller.rb @@ -1,9 +1,9 @@ class GraduationTasksController < ApplicationController before_action :require_login, :check_auth, except: [:index] before_action :find_course, except: [:edit, :update, :settings, :update_settings, :tasks_list, :show, :show_comment, - :cross_comment_setting, :assign_works, :commit_comment_setting] + :cross_comment_setting, :assign_works, :commit_comment_setting, :sonar] before_action :find_task, only: [:edit, :update, :settings, :update_settings, :tasks_list, :show, :show_comment, - :cross_comment_setting, :assign_works, :commit_comment_setting] + :cross_comment_setting, :assign_works, :commit_comment_setting, :sonar] before_action :user_course_identity before_action :task_publish, only: [:show, :show_comment, :tasks_list, :settings] before_action :teacher_allowed, only: [:new, :create, :edit, :update, :set_public,:multi_destroy, :publish_task, :end_task, @@ -66,62 +66,8 @@ class GraduationTasksController < ApplicationController (@user_course_identity == Course::STUDENT && @work.present? && @work.take.work_status > 0 && ((!@task.allow_late && @task.status > 1) || (@task.allow_late && @task.late_time && @task.late_time < Time.now)) && (@task.open_work || @task.open_score))) - # 如有有分班则看分班内的学生,否则看所有学生的作品 - user_ids = - if @user_course_identity < Course::STUDENT - @course.teacher_group_user_ids(current_user.id) - else - course_group_id = @course.course_member(current_user.id).course_group_id - @course.students.where(course_group_id: course_group_id).pluck(:user_id) - end - - @work_list = @task.graduation_works.where(user_id: user_ids).includes(user: [:user_extension]) - @all_work_count = @work_list.count - @teachers = @course.teachers.where.not(user_id: current_user.id).includes(:user) - # 教师评阅搜索 0: 未评, 1 已评 - unless params[:teacher_comment].blank? - graduation_work_ids = GraduationWorkScore.where(graduation_work_id: @work_list.map(&:id)).pluck(:graduation_work_id) - if params[:teacher_comment].to_i == 0 - @work_list = @work_list.where("work_status != 0") - elsif params[:teacher_comment].to_i == 1 - @work_list = @work_list.where("work_status != 0").where(id: graduation_work_ids) - end - end - # 作品状态 0: 未提交, 1 按时提交, 2 延迟提交 - unless params[:task_status].blank? - @work_list = @work_list.where(work_status: params[:task_status]) - end - - # 分班情况 - unless params[:course_group].blank? - group_user_ids = @course.students.where(course_group_id: params[:course_group]).pluck(:user_id) - # 有分组只可能是老师身份查看列表 - @work_list = @work_list.where(user_id: group_user_ids) - end - - # 只看我的交叉评阅 - unless params[:cross_comment].blank? - graduation_work_id = @task.graduation_work_comment_assignations.where(:user_id =>current_user.id) - .pluck(:graduation_work_id).uniq if @task.graduation_work_comment_assignations - @work_list = @task.graduation_works.where(id: graduation_work_id) - end - - # 组员、组长作品的筛选 - if @task.task_type == 2 && !params[:member_work].blank? - if params[:member_work].to_i == 1 - @work_list = @work_list.where("user_id = commit_user_id") - elsif params[:member_work].to_i == 0 - @work_list = @work_list.where("user_id != commit_user_id") - end - end - - # 输入姓名和学号搜索 - # TODO user_extension 如果修改 请调整 - unless params[:search].blank? - @work_list = @work_list.joins(user: :user_extension).where("concat(lastname, firstname) like ? - or student_id like ?", "%#{params[:search]}%", "%#{params[:search]}%") - end + _tasks_list # 排序 rorder = params[:order].blank? ? "update_time" : params[:order] @@ -265,6 +211,33 @@ class GraduationTasksController < ApplicationController end end + # 代码检测 + def sonar + tip_exception(403, "无权限访问") unless current_user.admin_or_business? + + _tasks_list + + person_list = @work_list.map do |work| + o = { + name: "#{work.user&.real_name}", + uid: "#{work.user&.student_id}", + downloadUrl: '' + } + attachment = work.attachments.last + if attachment + o[:downloadUrl] = "https://#{edu_setting('host_name')}/"+download_url(attachment) + end + + o + end + filename = "#{@task.name}_#{Time.now.strftime('%Y%m%d%H%M%S')}.json" + json = File.open("/tmp/#{filename}", "w+") + json.puts(person_list.to_json) + json.close + + send_file json.path, filename: filename + end + # 设为公开 def set_public tip_exception("仅公开课堂才能公开毕设任务") if @course.is_public == 0 @@ -657,6 +630,65 @@ class GraduationTasksController < ApplicationController tip_exception("请先开启交叉评阅再设置") unless @task.cross_comment end + def _tasks_list + # 如有有分班则看分班内的学生,否则看所有学生的作品 + user_ids = + if @user_course_identity < Course::STUDENT + @course.teacher_group_user_ids(current_user.id) + else + course_group_id = @course.course_member(current_user.id).course_group_id + @course.students.where(course_group_id: course_group_id).pluck(:user_id) + end + + @work_list = @task.graduation_works.where(user_id: user_ids).includes(user: [:user_extension]) + @all_work_count = @work_list.count + @teachers = @course.teachers.where.not(user_id: current_user.id).includes(:user) + # 教师评阅搜索 0: 未评, 1 已评 + unless params[:teacher_comment].blank? + graduation_work_ids = GraduationWorkScore.where(graduation_work_id: @work_list.map(&:id)).pluck(:graduation_work_id) + if params[:teacher_comment].to_i == 0 + @work_list = @work_list.where("work_status != 0") + elsif params[:teacher_comment].to_i == 1 + @work_list = @work_list.where("work_status != 0").where(id: graduation_work_ids) + end + end + + # 作品状态 0: 未提交, 1 按时提交, 2 延迟提交 + unless params[:task_status].blank? + @work_list = @work_list.where(work_status: params[:task_status]) + end + + # 分班情况 + unless params[:course_group].blank? + group_user_ids = @course.students.where(course_group_id: params[:course_group]).pluck(:user_id) + # 有分组只可能是老师身份查看列表 + @work_list = @work_list.where(user_id: group_user_ids) + end + + # 只看我的交叉评阅 + unless params[:cross_comment].blank? + graduation_work_id = @task.graduation_work_comment_assignations.where(:user_id =>current_user.id) + .pluck(:graduation_work_id).uniq if @task.graduation_work_comment_assignations + @work_list = @task.graduation_works.where(id: graduation_work_id) + end + + # 组员、组长作品的筛选 + if @task.task_type == 2 && !params[:member_work].blank? + if params[:member_work].to_i == 1 + @work_list = @work_list.where("user_id = commit_user_id") + elsif params[:member_work].to_i == 0 + @work_list = @work_list.where("user_id != commit_user_id") + end + end + + # 输入姓名和学号搜索 + # TODO user_extension 如果修改 请调整 + unless params[:search].blank? + @work_list = @work_list.joins(user: :user_extension).where("concat(lastname, firstname) like ? + or student_id like ?", "%#{params[:search]}%", "%#{params[:search]}%") + end + end + # # def graduation_work_to_xls items # xls_report = StringIO.new diff --git a/app/models/course.rb b/app/models/course.rb index 2f561bba7..9100f8470 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -81,6 +81,8 @@ class Course < ApplicationRecord # 老版的members弃用 现用course_members has_many :members + validate :validate_sensitive_string + scope :hidden, ->(is_hidden = true) { where(is_hidden: is_hidden) } scope :ended, ->(is_end = true) { where(is_end: is_end) } scope :processing, -> { where(is_end: false) } @@ -435,4 +437,8 @@ class Course < ApplicationRecord self.laboratory = Laboratory.current if laboratory_id.blank? end + + def validate_sensitive_string + raise("课堂名称包含敏感词汇,请重新输入") unless HarmoniousDictionary.clean?(name) + end end diff --git a/app/models/course_list.rb b/app/models/course_list.rb index cd622f20a..ab7404a9e 100644 --- a/app/models/course_list.rb +++ b/app/models/course_list.rb @@ -6,4 +6,10 @@ class CourseList < ApplicationRecord has_many :gtask_banks has_many :gtopic_banks belongs_to :user + + validate :validate_sensitive_string + + def validate_sensitive_string + raise("课程名称包含敏感词汇,请重新输入") unless HarmoniousDictionary.clean?(name) + end end diff --git a/app/models/discuss.rb b/app/models/discuss.rb index 4e6cd617c..a236a2bbc 100644 --- a/app/models/discuss.rb +++ b/app/models/discuss.rb @@ -11,6 +11,8 @@ class Discuss < ApplicationRecord belongs_to :dis, polymorphic: true belongs_to :challenge, optional: true + validate :validate_sensitive_string + after_create :send_tiding scope :children, -> (discuss_id){ where(parent_id: discuss_id).includes(:user).reorder(created_at: :asc) } @@ -69,4 +71,8 @@ class Discuss < ApplicationRecord } tidings.create!(base_attrs.merge(user_id: send_user_id)) end + + def validate_sensitive_string + raise("内容包含敏感词汇,请重新输入") unless HarmoniousDictionary.clean?(content) + end end diff --git a/app/models/memo.rb b/app/models/memo.rb index d09251358..d79081350 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -16,6 +16,7 @@ class Memo < ApplicationRecord has_many :children, foreign_key: :parent_id, class_name: 'Memo' has_many :attachments, as: :container, dependent: :destroy has_many :tidings, as: :container, dependent: :destroy + validate :validate_sensitive_string scope :field_for_list, lambda{ select([:id, :subject, :author_id, :sticky, :updated_at, :language, :reward, :all_replies_count, :viewed_count, :forum_id]) @@ -54,4 +55,9 @@ class Memo < ApplicationRecord self.tidings << Tiding.new(tiding_attr) end + + def validate_sensitive_string + raise("标题包含敏感词汇,请重新输入") unless HarmoniousDictionary.clean?(subject) + raise("内容包含敏感词汇,请重新输入") unless HarmoniousDictionary.clean?(content) + end end diff --git a/app/models/user.rb b/app/models/user.rb index d6c264e15..54aa8d85e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -178,13 +178,8 @@ class User < ApplicationRecord validates_uniqueness_of :phone, :if => Proc.new { |user| user.phone_changed? && user.phone.present? }, case_sensitive: false validates_length_of :login, maximum: LOGIN_LENGTH_LIMIT validates_length_of :mail, maximum: MAIL_LENGTH_LMIT - # validates_format_of :mail, with: VALID_EMAIL_REGEX, multiline: true - # validates_format_of :phone, with: VALID_PHONE_REGEX, multiline: true + validate :validate_sensitive_string validate :validate_password_length - #validate :validate_ID_number - #validates_format_of :ID_number, with: VALID_NUMBER_REGEX, multiline: true, message: "身份证号格式不对" - # validates :nickname, presence: true, length: { maximum: 10 } - # validates :lastname, presence: true # 删除自动登录的token,一旦退出下次会提示需要登录 def delete_autologin_token(value) @@ -727,6 +722,11 @@ class User < ApplicationRecord end end + def validate_sensitive_string + raise("真实姓名包含敏感词汇,请重新输入") unless HarmoniousDictionary.clean?(lastname) + raise("昵称包含敏感词汇,请重新输入") unless HarmoniousDictionary.clean?(nickname) + end + def set_laboratory return unless new_record? diff --git a/app/views/admins/departments/shared/_department_item.html.erb b/app/views/admins/departments/shared/_department_item.html.erb index 62f3a81ac..6018686ff 100644 --- a/app/views/admins/departments/shared/_department_item.html.erb +++ b/app/views/admins/departments/shared/_department_item.html.erb @@ -17,7 +17,7 @@ <% if department.identifier.present? %> - <%= link_to department.identifier.to_s, statistics_college_path(department.identifier), target: '_blank' %> + <%= link_to department.identifier.to_s, "/colleges/#{department.identifier}/statistics", target: '_blank' %> <% else %> -- <% end %> diff --git a/config/harmonious_dictionary/chinese_dictionary.txt b/config/harmonious_dictionary/chinese_dictionary.txt new file mode 100644 index 000000000..3040d9d0e --- /dev/null +++ b/config/harmonious_dictionary/chinese_dictionary.txt @@ -0,0 +1,1511 @@ +习近平 +习仲勋 +贺国强 +贺子珍 +周永康 +李德生 +王岐山 +姚依林 +回良玉 +李源潮 +李干成 +戴秉国 +黄镇 +刘延东 +刘瑞龙 +俞正声 +黄敬 +薄熙来 +薄一波 +周小川 +周建南 +温云松 +徐明 +江绵康 +李小鹏 +李小琳 +朱云来 +让国人愤怒的第二代身份证 +第二代身份证 +文化大革命 +胡海峰 +六四 +陈良宇 +老丁 +莱仕德事件 +fuck +地下的先烈们纷纷打来电话询问 +大纪元 +新唐人 +淫靡 +六四事件 +迷昏药 +迷魂药 +窃听器 +六合彩 +买卖枪支 +三唑仑 +麻醉药 +麻醉乙醚 +短信群发器 +帝国之梦 +毛一鲜 +黎阳平 +对日强硬 +出售枪支 +摇头丸 +西藏天葬 +军长发威 +PK黑社会 +枪决女犯 +投毒杀人 +强硬发言 +出售假币 +监听王 +昏药 +侦探设备 +麻醉钢枪 +反华 +官商勾结 +升达毕业证 +手机复制 +戴海静 +自杀指南 +自杀手册 +张小平 +佳静安定片 +蒙汗药粉 +古方迷香 +强效失意药 +迷奸药 +透视眼镜 +远程偷拍 +自制手枪 +激情小电影 +黄色小电影 +天鹅之旅 +盘古乐队 +高校暴乱 +高校群体事件 +大学骚乱 +高校骚乱 +催情药 +拍肩神药 +春药 +身份证生成器 +枪决现场 +出售手枪 +麻醉枪 +办理证件 +办理文凭 +高干子弟 +高干子女 +枪支弹药 +血腥图片 +反政府 +禁书 +特码 +成人 +国民党 +贪污 +骚妇 +法论功 +江湖淫娘 +骆冰淫传 +夫妇乐园 +阿里布达年代记 +爱神之传奇 +不良少女日记 +沧澜曲 +创世之子猎艳之旅 +东北风情熟女之惑 +风骚侍女 +海盗的悠闲生活 +黑天使 +黑星女侠 +混蛋神风流史 +狡猾的风水相师 +俪影蝎心 +秦青的幸福生活 +四海龙女 +逃亡艳旅 +性启蒙 +现代艳帝传奇 +星光伴我淫 +倚天屠龙别记 +淫术炼金士 +十景缎 +往事追忆录 +舌战法庭 +少妇白洁 +风月大陆 +风尘劫 +美少妇的哀羞 +阿兵哥言语录 +遥想当年春衫薄 +王子淫传 +神雕外传之郭襄 +睡着的武神 +少年阿宾 +毛主席复活 +蒙汗药 +粗口歌 +激情电影 +AV +十八禁 +性虐待 +激情 +耽美 +金瓶梅 +藏春阁 +玉蒲团 +隐形喷剂 +反雷达测速 +假币 +代开发票 +假钞 +窃听 +电话拦截系统 +探测狗 +手机卡复制器 +手机跟踪定位器 +监听器 +针孔摄像 +监听宝 +迷幻药 +手拍肩 +迷魂香 +麻古 +政治风波 +政府软弱 +政府无能 +九评 +十七大代表 +办证 +暴力拆迁 +轮暴致死 +人民报 +暴力镇压 +高干子弟名单 +性免费电影 +全裸 +偷 拍 +中共十七大 +徐和柴学友 +修炼之歌 +警察殴打 +新诗年鉴 +李沛瑶遇害 +美国凯德 +肥东交警 +中央军委 +针对台湾 +梁保华 +MC军团 +旧民运 +伪民运 +采花堂 +中国劳工通讯 +评中国共产党 +建立生活性补贴 +中共走狗 +中共小丑 +共奴 +中共恶霸 +共产无赖 +右派 +流氓政府 +原子弹制作简明教程 +绝食抗议 +北戴河会议 +邓二世 +内斗退党 +退团 +江理论 +香港六合彩 +A集中营 +退党 +法新闻社 +欧洲圆明网 +亚太正悟网 +大法新闻社 +白宫事件 +日本大使馆0R409游行 +反日万人游行 +六四屠杀 +六四屠城 +六四政变 +六四之役 +27军长砸洗浴中心 +中共邪教 +调查真相委员会 +追查国际 +中共暴行 +大法洪传 +弘法体 +大法之声 +江独裁 +李屠夫 +江恶人 +中共特务 +乙醚 +党内分裂 +新生网 +圆明网 +和平修炼 +放下生死 +大法大福 +大硞弟子 +支联会 +共产专制 +共产极权 +专政机器 +共产王朝 +毛派 +法网恢恢 +邓派 +五套功法 +宇宙最高法理 +谁是新中国 +法正人间 +法正乾坤 +正法时期 +海外护法 +洪发交流 +报禁 +党禁 +鹰派 +赣江学院暴动 +全国退党 +绝食抗暴 +维权抗暴 +活体器官 +中共暴政 +器官移植 +中共当局 +胡温政府 +江罗集团 +师傅法身 +正派民运 +中华联邦政府 +亲共行动 +联邦政府 +流氓民运 +特务民运 +中共警察 +中共监狱 +中共政权 +中共迫害 +自由联邦 +中共独枭 +流氓无产者 +中共专制 +明慧周刊 +九评共产党 +江泽民其人 +秘密文件 +机密文件 +红头文件 +政府文件 +破网软件 +无界浏览 +亲共来源 +黄色小说 +台湾18DY电影 +H动漫 +tmd +nnd +包娃衣 +禁播 +H漫画 +丁度巴拉斯 +大禁 +买春堂 +苏东解体 +反右题材 +隐私图片 +卫星接收器 +卫星电视 +信号拦截器 +新闻通气会 +山西洪洞 +巨额骗储 +五奶小青 +红楼绮梦 +阿里布达年代 +不良少少日记 +狂风暴雨 +梦中的女孩 +首先使用核武器 +汽车爆炸案 +香港GHB水 +色空寺 +周容重 +朱蒙 +汕頭頻傳擄童割器官 +法輪功 +六决不 +清华网管 +道县公安 +济南建设路 +老虎机 +轮盘机 +百家乐 +连线机 +模拟机 +彩票机 +礼品机 +卢跃刚 +玫瑰园 +天浴 +一卡多号 +最淫官员 +偷电 +盗电 +中国人都在上的四大当 +总统的讲话 +痛批政法委 +山西黑砖窑 +黑窑奴役 +杨元元 +敢坐飞机吗 +韩国身份证 +台湾身份证 +广电总局 +学生暴动 +镇压学生 +广安第二人民医院 +山不过来 +胡新宇 +趙紫陽 +自由亚州 +明慧 +践踏中国女性 +拉凳 +南京大学法学院 +挥发型迷药 +喷雾型迷药 +金伯帆 +崔英杰 +松花江污染 +火药制作 +江氏 +第十六次代表 +仁寿警方 +愈快乐愈堕落 +上海交警 +最牛钉子户 +淫间道 +唐人电视台 +嫩穴 +金鳞岂是池中物 +江山美人志 +六合采 +民警当副院长 +股市民谣 +禁断少女 +卫星遭黑客攻击 +萬人暴 +官逼民反 +中原油田 +张大权 +油田总部 +枪淫少妇 +博白县 +動乱 +军火价格 +女死囚 +劉奇葆 +法lun功 +女友坊 +香港马会 +白小姐 +曾道人 +一码中特 +自由门 +艳照门 +奴役童工 +性奴 +计生风暴 +厦门大游行 +想不到的黑幕 +死亡笔记 +二奶 +2奶 +纪股票市场五卅惨案 +这年头就这样 +代开普通发票 +代开商品发票 +代开国税发票 +代开地税发票 +代开广告发票 +代开运输发票 +代开租赁发票 +代开维修发票 +代开建筑发票 +代开安装发票 +代开餐饮发票 +代开服务发票 +毛爷爷复活 +智能H3 +智能H3 +赣江学院 +江西田园置业集团 +海乐神 +酣乐欣 +高莺莺 +完全自杀手册 +无界 +广东王 +口头检查 +三句硬话 +红海湾 +升达 +沈阳公安 +拦截器 +阻无通畅 +民为法执 +尾行 +电车之狼 +绕过封锁 +本拉登 +汕尾事件 +公务员工资 +公务员调资 +鸡吧 +公务员的工资 +反中游行 +支持台湾 +双鞋的故事 +中国军用运输机 +科技精英遇难 +湘阴杨林 +杨林寨 +湘阴县杨林 +死刑枪毙 +马加爵 +死刑过程 +学生与警察 +鬼村 +周容 +重题工 +先烈的电电 +身份证生成 +短信猫 +车牌反光 +次下跪 +求救遭拒 +邪恶的党 +出售迷药 +针孔摄像机 +日本小泉 +小泉恶搞 +温家堡 +蒋彦永 +灭绝罪 +大揭露 +突破封锁 +多党执政 +生成身份证 +华国锋 +叶剑英 +陈云 +李先念 +汪东兴 +韦国清 +乌兰夫 +方毅 +刘伯承 +许世友 +纪登奎 +苏振华 +吴德 +余秋里 +张廷发 +陈永贵 +陈锡联 +耿飚 +聂荣臻 +倪志福 +徐向前 +彭冲 +王震 +邓颖超 +杨尚昆 +杨得志 +宋任穷 +胡乔木 +胡耀邦 +彭真 +廖承志 +秦基伟 +陈慕华 +田纪云 +李铁映 +李锡铭 +杨汝岱 +吴学谦 +胡启立 +芮杏文 +杨白冰 +邹家华 +谢非 +谭绍文 +王汉斌 +任建新 +于永波 +傅全有 +吴仪 +王克 +王乐泉 +王兆国 +刘淇 +刘云山 +张立昌 +张德江 +王刚 +隐形耳机 +隐形摄像头 +裸聊 +代考 +英语枪手 +仿真枪 +考试作弊器 +开锁器 +淫秽 +定位器 +上分器 +干扰器 +退币王 +k粉 +诈骗信息 +销售枪支 +爆炸物品 +性器官 +风骚小阿姨 +非常诱惑 +风月宝鉴之冥府春色 +风流一夜情 +飞凤春宵 +风情万种野玫瑰 +夫妻作爱 +夫妻做爱 +三级片 +应召女郎 +性生活 +香醇的诱惑 +处男 +性爱 +奸杀 +血溅红灯区 +雪肌夜叉 +血恋 +现代靓妹仔 +新七擒七纵七色狼 +骚b +三级图片 +淫乱 +a级情片 +淫乱秘史 +艳丽片 +香港伦理片 +淫色漫画 +淫片 +叫春 +中国性搜网 +性息 +淫虫 +艳舞女郎 +禁宮秘史 +少女换衣 +偷欢 +18dy +保钓 +鲍戈 +鲍彤 +暴乱 +暴政 +北韩 +藏独 +曹长青 +曹刚川 +柴玲 +常劲 +陈炳基 +陈军 +陈蒙 +陈破空 +陈希同 +陈小同 +陈宣良 +陈一谘 +陈总统 +程铁军 +程真 +迟浩田 +持不同政见 +赤匪 +赤化 +达赖 +大参考 +大法 +大纪园 +大家论坛 +大史记 +大史纪 +戴相龙 +弹劾 +登辉 +邓笑贫 +迪里夏提 +地下教会 +地下刊物 +电视流氓 +钓鱼岛 +丁关根 +丁元 +丁子霖 +东北独立 +东社 +东土耳其斯坦 +东西南北论坛 +动乱 +独裁 +独裁政治 +独夫 +独立台湾会 +屙民 +发轮 +发正念 +法愣 +法抡 +法仑 +法伦 +法轮 +法论 +反封锁技术 +反腐败论坛 +反共 +李洪志 +法轮功 +江泽民 +毛泽东 +邓小平 +胡锦涛 +推翻 +打倒 +台独 +轮功 +李红痔 +李宏志 +真善忍 +炼功 +李总统 +李登辉 +李鹏 +李瑞环 +吐血 +18禁 +少儿不宜 +女优 +脱光 +咪咪 +兽欲 +奶子 +酥胸 +处女 +迷药 +强迫 +色情 +三級 +三级 +A片 +喷精 +偷窥 +被虐 +黄色 +被迫 +被逼 +强暴 +口技 +破处 +精液 +幼交 +狂干 +兽交 +群交 +阴部 +幼幼 +女優 +强歼 +乱交 +色友 +婊子 +蒲团 +喷尿 +凌辱 +暴干 +阴唇 +插插 +坐交 +学生妹 +无毛 +猛插 +慰安妇 +露点 +露毛 +行房 +自慰 +吹萧 +色狼 +胸罩 +内裤 +底裤 +私处 +爽死 +变态 +妹疼 +妹痛 +弟疼 +弟痛 +姐疼 +姐痛 +哥疼 +哥痛 +同房 +打炮 +造爱 +作爱 +做爱 +鸡巴 +阴茎 +阳具 +开苞 +肛门 +阴道 +阴蒂 +肉棍 +肉棒 +肉洞 +荡妇 +阴囊 +睾丸 +捅你 +捅我 +插我 +插你 +插她 +插他 +干你 +干她 +干他 +射精 +口交 +屁眼 +阴户 +阴门 +下体 +龟头 +阴毛 +波霸 +偷情 +叫床 +上床 +亚热 +援交 +走光 +情色 +肉欲 +美腿 +自摸 +捆绑 +丝袜 +潮吹 +肛交 +群射 +内射 +臭作 +薄格 +調教 +乱伦 +偷拍 +更衣 +無修正 +虐待 +尿尿 +喷水 +小泽玛莉亚 +武腾兰 +武藤兰 +饭岛爱 +小泽圆 +長瀨愛 +川島和津實 +粉嫩的小沟 +小澤園 +飯島愛 +星崎未來 +及川奈央 +朝河蘭 +夕樹舞子 +大澤惠 +金澤文子 +三浦愛佳 +伊東 +武藤蘭 +叶子楣 +舒淇 +麻衣 +櫻井 +風花 +星野桃 +宝来 +桜田 +藤井彩 +小森美王 +平井 +桃井望 +榊彩弥 +桜井 +中条美華 +大久保玲 +青木友梨 +深田涼子 +愛内萌 +姫島瑠璃香 +長瀬愛 +中野千夏 +春菜 +望月 +岡崎美女 +宮下杏奈 +加藤 +日野美沙 +北島優 +一本道 +夜勤病栋 +三个代表 +一党 +多党 +民主 +专政 +避孕套 +你妈逼 +大鸡巴 +政治 +洪志 +红志 +洪智 +红智 +民运 +王丹 +卖春 +买春 +天安门 +朱容基 +朱镕基 +温家宝 +李长春 +魏京生 +台湾独立 +西藏独立 +疆独 +新疆独立 +大盖帽 +黑社会 +夜总会 +妈个 +公款 +坐台 +腐败 +城管 +暴动 +李远哲 +司法警官 +高干 +尉健行 +李岚清 +黄丽满 +于幼军 +文字狱 +宋祖英 +自焚 +猫肉 +吸储 +张五常 +张丕林 +空难 +吴邦国 +曾庆红 +黄菊 +罗干 +吴官正 +贾庆林 +专制 +三個代表 +一黨 +多黨 +專政 +大紀元 +紅志 +紅智 +李鵬 +天安門 +江澤民 +朱鎔基 +李長春 +李瑞環 +胡錦濤 +貓肉 +吸儲 +張五常 +張丕林 +溫家寶 +吳邦國 +曾慶紅 +黃菊 +賈慶林 +專制 +反人类 +反社会 +方励之 +方舟子 +斐得勒 +费良勇 +分家在 +分裂 +粉饰太平 +风雨神州 +风雨神州论坛 +封从德 +冯东海 +冯素英 +佛展千手法 +付申奇 +傅申奇 +傅志寰 +高官 +高文谦 +高薪养廉 +高瞻 +高自联 +戈扬 +鸽派 +个人崇拜 +工自联 +共产 +共党 +共匪 +共狗 +共军 +关卓中 +贯通两极法 +广闻 +郭伯雄 +郭罗基 +郭平 +郭岩华 +国家安全 +国家机密 +国军 +国贼 +韩东方 +韩联潮 +何德普 +河殇 +红灯区 +红色恐怖 +宏法 +洪传 +洪吟 +洪哲胜 +胡紧掏 +胡锦滔 +胡锦淘 +胡景涛 +胡平 +胡总书记 +护法 +花花公子 +华建敏 +华通时事论坛 +华夏文摘 +华语世界论坛 +华岳时事论坛 +黄慈萍 +黄祸 +回民暴动 +悔过书 +鸡毛信文汇 +姬胜德 +积克馆 +基督 +贾廷安 +贾育台 +建国党 +江core +江八点 +江流氓 +江罗 +江绵恒 +江青 +江戏子 +江则民 +江泽慧 +江贼 +江贼民 +江折民 +江猪 +江主席 +姜春云 +将则民 +僵贼 +僵贼民 +教养院 +揭批书 +金尧如 +锦涛 +禁看 +经文 +开放杂志 +抗议 +邝锦文 +劳动教养所 +劳改 +劳教 +老江 +老毛 +黎安友 +李洪宽 +李继耐 +李兰菊 +李录 +李禄 +李少民 +李淑娴 +李旺阳 +李文斌 +李月月鸟 +李志绥 +连胜德 +廉政大论坛 +梁光烈 +梁擎墩 +两岸关系 +两岸三地论坛 +两个中国 +廖锡龙 +林保华 +林长盛 +林樵清 +林慎立 +凌锋 +刘宾深 +刘宾雁 +刘刚 +刘国凯 +刘华清 +刘俊国 +刘凯中 +刘千石 +刘青 +刘山青 +刘士贤 +刘文胜 +刘晓波 +刘晓竹 +刘永川 +龙虎豹 +陆委会 +吕京花 +吕秀莲 +抡功 +轮大 +罗礼诗 +马大维 +马良骏 +马三家 +马时敏 +卖国 +毛厕洞 +毛贼东 +美国参考 +美国之音 +蒙独 +蒙古独立 +密穴 +绵恒 +民国 +民进党 +民联 +民意 +民意论坛 +民阵 +民猪 +民主墙 +民族矛盾 +莫伟强 +木犀地 +木子论坛 +南大自由论坛 +闹事 +倪育贤 +潘国平 +泡沫经济 +迫害 +祁建 +齐墨 +钱达 +钱国梁 +钱其琛 +抢粮记 +乔石 +亲美 +钦本立 +情妇 +庆红 +热比娅 +热站政论网 +人民内情真相 +人民真实 +人民之声论坛 +人权 +善恶有报 +上海帮 +邵家健 +神通加持法 +沈彤 +升天 +盛华仁 +盛雪 +石戈 +时代论坛 +时事论坛 +世界经济导报 +事实独立 +双十节 +水扁 +税力 +司马晋 +司马璐 +司徒华 +斯诺 +四川独立 +宋平 +宋书元 +苏绍智 +苏晓康 +台盟 +台湾狗 +台湾建国运动组织 +台湾青年独立联盟 +台湾政论区 +台湾自由联盟 +太子党 +汤光中 +唐柏桥 +唐捷 +滕文生 +天怒 +天葬 +童屹 +统独 +统独论坛 +统战 +屠杀 +外交与方略 +万润南 +万晓东 +汪岷 +王宝森 +王炳章 +王策 +王超华 +王辅臣 +王涵万 +王沪宁 +王军涛 +王力雄 +王瑞林 +王润生 +王若望 +王希哲 +王秀丽 +王冶坪 +网特 +魏新生 +温元凯 +文革 +无界浏览器 +吴百益 +吴方城 +吴弘达 +吴宏达 +吴仁华 +吴学灿 +吴学璨 +吾尔开希 +五不 +伍凡 +洗脑 +项怀诚 +项小吉 +肖强 +邪恶 +谢长廷 +谢选骏 +谢中之 +辛灏年 +新观察论坛 +新华内情 +新闻封锁 +新语丝 +信用危机 +邢铮 +熊炎 +熊焱 +徐邦秦 +徐才厚 +徐匡迪 +徐水良 +许家屯 +薛伟 +学潮 +学联 +学运 +学自联 +雪山狮子 +严家其 +严家祺 +阎明复 +颜射 +央视内部晚会 +杨怀安 +杨建利 +杨巍 +杨月清 +杨周 +姚月谦 +一中一台 +义解 +亦凡 +异见人士 +异议人士 +易丹轩 +易志熹 +尹庆民 +由喜贵 +游行 +幼齿 +于大海 +于浩成 +余英时 +舆论反制 +宇明网 +远志明 +岳武 +则民 +择民 +泽民 +贼民 +曾培炎 +张伯笠 +张钢 +张宏堡 +张健 +张林 +张万年 +张伟国 +张昭富 +张志清 +赵海青 +赵南 +赵品潞 +赵晓微 +赵紫阳 +哲民 +镇压 +争鸣论坛 +正见网 +郑义 +正义党论坛 +换妻 +真木加美 +超爽 +毛片 +打手枪 +欲望 +脚交 +伦理 +艳星 +三陪 +绝色 +床上功夫 +強暴 +陈冠希 +艳照 +喷射 +铃木麻奈美 +星崎未来 +东京热 +菅野亚梨沙 +吉岡美穗 +红音 +原千寻 +熟女 +轮奸 +朱琳 +朱毛 +朱溶剂 +猪聋畸 +猪毛 +猪毛1 +天安门录影带 +天安门事件 +天安门屠杀 +天安门一代 +自民党 +自由民主论坛 +走私 +淫穴 +幼女 +舆论 +fa轮 +亲日 +汉奸 +政权 +政治反对派 +政治犯 +支那 +指点江山论坛 +中俄边界 +中功 +中共 +中国威胁论 +中国问题论坛 +中国之春 +中国猪 +中华讲清 +中华民国 +钟山风雨论坛 +江ze民 +周锋锁 +周天法 +陈水扁 +周旋 +朱嘉明 +阿扁 +二逼 +小鸡鸡 +卖逼 +二B +强奸 +卖比 +日死你 +狗卵子 +我操你 +狗b +法功 +群奸 +狗操 +猪操 +干死你 +发骚 +贱人 +骚货 +狗娘 +反封锁 +烂逼 +包皮 +烂比 +狗屎 +妓女 +回民暴 +招妓 +牛逼 +鸡八 +牛比 +操你 +十八摸 +傻B +我操 +阴水 +傻逼 +氵去车仑工力 +操蛋 +喷你 +操逼 +淫水 +他妈 +操比 +杂种 +他母亲 +哈批 +靠你妈 +你妈 +大逼 +操你妈 +你娘 +大比 +妈批 +蒙古独 +你爸 +大b +四川独 +逼样 +台湾独 +性交 +精子 +龟公 +乳房 +贱逼 +性欲 +西藏独 +贱比 +你妈的 +新疆独 +干你娘 +他妈的 +我日 +去你妈的 +B样 +日你 +阝月 +奸淫 +上访 +淫荡 +操他 +瞒报 +大花逼 +烂货 +失密 +共产党 +破鞋 +贱货 +被盗 +舔奶 +成人书库 +淫图 +交媾 +护士 +自拍 +大片 +夫妻 +流血 +小穴 +少妇 +北京当局 +北京之春 +北美自由论坛 +博讯 +蔡崇国 +程凯 +大纪元新闻网 +大众真人真事 +东南西北论谈 +封杀 +何勇 +江猪媳 +酱猪媳 +枪支 +毒品 diff --git a/config/harmonious_dictionary/english_dictionary.txt b/config/harmonious_dictionary/english_dictionary.txt new file mode 100644 index 000000000..95ff180b2 --- /dev/null +++ b/config/harmonious_dictionary/english_dictionary.txt @@ -0,0 +1,66 @@ +6-4tianwang +89-64cdjp +ADMIN +Administrator +asshole +BLOWJOB +chinaliberal +chinamz +chinesenewsnet +Clockgemstone +creaders +Crestbone +dajiyuan +dfdz +DICK +falun +falundafa +Feelmistone +freechina +freenet +fuck +gcd +Gruepin +Guichuideng +HACKING +hongzhi +hrichina +HUANET +hypermart.net +incest +jiangdongriji +jiaochuang +jiaochun +KEFU +KISSMYASS +lihongzhi +minghui +minghuinews +nacb +Neckromancer +NMIS +PAPER64 +penis +qiangjian +renminbao +renmingbao +SHIT +SUCKPENIS +taip +tibetalk +triangle +triangleboy +Tringel +UltraSurf +ustibet +voachinese +wangce +WEBZEN +wstaiji +xinsheng +YUMING +zangdu +ZHENGJIAN +ZHENGJIANWANG +ZHENSHANREN +zhuanfalun \ No newline at end of file diff --git a/config/harmonious_dictionary/harmonious.hash b/config/harmonious_dictionary/harmonious.hash new file mode 100644 index 000000000..9ce3b2f93 Binary files /dev/null and b/config/harmonious_dictionary/harmonious.hash differ diff --git a/config/harmonious_dictionary/harmonious_english.yml b/config/harmonious_dictionary/harmonious_english.yml new file mode 100644 index 000000000..78a952d57 --- /dev/null +++ b/config/harmonious_dictionary/harmonious_english.yml @@ -0,0 +1,67 @@ +--- +- 6-4tianwang +- 89-64cdjp +- ADMIN +- Administrator +- asshole +- BLOWJOB +- chinaliberal +- chinamz +- chinesenewsnet +- Clockgemstone +- creaders +- Crestbone +- dajiyuan +- dfdz +- DICK +- falun +- falundafa +- Feelmistone +- freechina +- freenet +- fuck +- gcd +- Gruepin +- Guichuideng +- HACKING +- hongzhi +- hrichina +- HUANET +- hypermart.net +- incest +- jiangdongriji +- jiaochuang +- jiaochun +- KEFU +- KISSMYASS +- lihongzhi +- minghui +- minghuinews +- nacb +- Neckromancer +- NMIS +- PAPER64 +- penis +- qiangjian +- renminbao +- renmingbao +- SHIT +- SUCKPENIS +- taip +- tibetalk +- triangle +- triangleboy +- Tringel +- UltraSurf +- ustibet +- voachinese +- wangce +- WEBZEN +- wstaiji +- xinsheng +- YUMING +- zangdu +- ZHENGJIAN +- ZHENGJIANWANG +- ZHENSHANREN +- diff --git a/config/routes.rb b/config/routes.rb index d41a8a783..198dbc39f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -700,6 +700,7 @@ Rails.application.routes.draw do get :cross_comment_setting post :assign_works post :commit_comment_setting + get :sonar end collection do diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index a18e395dd..177328dfa 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -82,8 +82,8 @@ export function initAxiosInterceptors(props) { // proxy = "https://testeduplus2.educoder.net" //proxy="http://47.96.87.25:48080" proxy="https://pre-newweb.educoder.net" - // proxy="https://test-newweb.educoder.net" - proxy="https://test-jupyterweb.educoder.net" + proxy="https://test-newweb.educoder.net" + // proxy="https://test-jupyterweb.educoder.net" //proxy="http://192.168.2.63:3001" // 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求; diff --git a/public/react/src/common/components/comment/CommentForm.js b/public/react/src/common/components/comment/CommentForm.js index 484940807..3f1e16170 100644 --- a/public/react/src/common/components/comment/CommentForm.js +++ b/public/react/src/common/components/comment/CommentForm.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-12-17 17:32:55 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-27 16:50:43 + * @LastEditTime : 2020-01-06 18:42:09 */ import './index.scss'; import React, { useState } from 'react'; @@ -28,11 +28,12 @@ function CommentForm (props) { const [focus, setFocus] = useState(false); const options = [ - ['bold', 'italic', 'underline'], - [{header: [1,2,3,false]}], - ['blockquote', 'code-block'], - ['link', 'image'], - ['formula'] + // ['bold', 'italic', 'underline'], + // [{header: [1,2,3,false]}], + 'code-block', + 'link', + 'image', + 'formula' ]; // const { form: { getFieldDecorator } } = props; const [showQuill, setShowQuill] = useState(false); diff --git a/public/react/src/common/quillForEditor/index.scss b/public/react/src/common/quillForEditor/index.scss index eca8c4485..dd4eb0349 100644 --- a/public/react/src/common/quillForEditor/index.scss +++ b/public/react/src/common/quillForEditor/index.scss @@ -1,4 +1,6 @@ .quill_editor_for_react_area{ + // background: #fff; + // margin: 0 15px; .ql-editing{ left: 0 !important; } diff --git a/public/react/src/modules/courses/gradinforms/myysleduinforms.css b/public/react/src/modules/courses/gradinforms/myysleduinforms.css index a05dc9a63..b9adac4be 100644 --- a/public/react/src/modules/courses/gradinforms/myysleduinforms.css +++ b/public/react/src/modules/courses/gradinforms/myysleduinforms.css @@ -56,12 +56,17 @@ .ysltitbt{ float: left; - padding-top: 31px; + padding-top: 28px; padding-left: 25px; font-size: 21px; - color: #05101A; + color: #05101a; text-align: left; - font-weight:bold; + font-weight: bold; + max-width: 805px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + display: inline-block; } .markdownysltext{ font-size: 14px; diff --git a/public/react/src/modules/developer/components/knowledge/index.js b/public/react/src/modules/developer/components/knowledge/index.js index 680229b2d..9598037ab 100644 --- a/public/react/src/modules/developer/components/knowledge/index.js +++ b/public/react/src/modules/developer/components/knowledge/index.js @@ -4,11 +4,11 @@ * @Github: * @Date: 2019-12-30 13:51:19 * @LastEditors : tangjiang - * @LastEditTime : 2020-01-03 18:56:36 + * @LastEditTime : 2020-01-07 15:46:24 */ import './index.scss'; import React, { useState, useEffect } from 'react'; -import { Select, notification } from 'antd'; +import { Select, notification, Modal, Form, Input, Button } from 'antd'; const { Option } = Select; @@ -17,7 +17,10 @@ function KnowLedge (props) { const { options = [], // 下拉选项 values = [], // 已选择的下拉项 - onChange // 获取选择的值 + onChange, // 获取选择的值 + form, + showAdd, // 显示新增图标 + addKnowledge // 调用新增知识点接口 } = props; useEffect(() => { @@ -38,9 +41,12 @@ function KnowLedge (props) { const [selectOptions, setSelectOptions] = useState(options); // 已选择的下拉项 const [selectValue, setSelectValue] = useState([]); + const [visible, setVisible] = useState(false); // const [value] = useState([]); + const { getFieldDecorator } = form; + const FormItem = Form.Item; // 渲染下拉选项 const renderOptions = (options = []) => { return options.map((opt, i) => ( @@ -58,10 +64,10 @@ function KnowLedge (props) { } return item.id !== value; }); - if (tempArr.length > 50) { + if (tempArr.length > 5) { notification.warning({ message: '提示', - description: '知识点不能超过50个' + description: '知识点不能超过5个' }); return; } @@ -114,15 +120,75 @@ function KnowLedge (props) { ) } + // 添加知识点 + const handleAddKnowledge = () => { + setVisible(true); + }; + + const handleResetForm = () => { + form.resetFields(); + setVisible(false); + } + + const handleSubmitForm = (e) => { + e.preventDefault(); + form.validateFieldsAndScroll((err, values) => { + if (err) { + return; + } + setVisible(false); + form.resetFields(); + // console.log(values); + addKnowledge && addKnowledge(values); + }) + } + + const _styles = { + display: showAdd ? 'inline-block' : 'none' + }; + return ( -
- { renderSelect(selectOptions) } - {/* 渲染下拉选择项 */} -
- { renderResult(selectValue) } + +
+ { renderSelect(selectOptions) } + {/* 渲染下拉选择项 */} +
+ + { renderResult(selectValue) } +
-
+ + +
+ + { + getFieldDecorator('name', { + rules: [{ + required: true, message: '知识点名称不能为空' + }] + })( + + ) + } + + + + + +
+
+ + ); } -export default KnowLedge; +export default Form.create()(KnowLedge); diff --git a/public/react/src/modules/developer/components/knowledge/index.scss b/public/react/src/modules/developer/components/knowledge/index.scss index 5bd0f5f61..9a457acf9 100644 --- a/public/react/src/modules/developer/components/knowledge/index.scss +++ b/public/react/src/modules/developer/components/knowledge/index.scss @@ -38,5 +38,19 @@ } } } + + .icon-add-knowledge{ + line-height: 36px; + margin-top: 10px; + margin-right: 10px; + // cursor: ; + color: rgb(78, 188, 126) + } + } +} + +.knowledge-form{ + .ant-form-explain{ + padding: 0; } } diff --git a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js index 1d2742647..395809901 100644 --- a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js +++ b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-20 10:35:40 * @LastEditors : tangjiang - * @LastEditTime : 2020-01-06 16:17:22 + * @LastEditTime : 2020-01-07 15:29:18 */ import './index.scss'; // import 'katex/dist/katex.css'; @@ -61,6 +61,7 @@ class EditTab extends React.Component { top: 500, bottom: 20, offsetTop: 0, + showAdd: false // knowledges: [], // coursers: [] // 选中的课程 } @@ -147,13 +148,15 @@ class EditTab extends React.Component { item.sub_disciplines && item.sub_disciplines.forEach(c => { if (value[1] && c.id === value[1]) { saveKnowledge(c.tag_disciplines) - console.log(c.tag_disciplines); } else if (!value[1]) { saveKnowledge([]); } }); } }); + this.setState({ + showAdd: value[1] ? true : false + }); // this.props.validateOjCategory(value[1] || ''); this.props.validateOjSubDisciplineId(value[1] || ''); } @@ -167,6 +170,8 @@ class EditTab extends React.Component { } render () { + const { showAdd } = this.state; + const { ojForm, ojFormValidate, @@ -177,9 +182,10 @@ class EditTab extends React.Component { openTestCodeIndex = [], courseQuestions, tag_discipline_id, - knowledges + knowledges, + tagDisciplines, } = this.props; - console.log('knowledge======>>>>>>', knowledges); + // console.log('knowledge======>>>>>>', knowledges); // const {knowledges} = this.state; // 表单label const myLabel = (name, subTitle, nostar) => { @@ -321,7 +327,6 @@ class EditTab extends React.Component { } }); - console.log(choid_ids); return ( { _result.push(v.id); }); - console.log('下拉选择的值:===>>>', _result); + // console.log('下拉选择的值:===>>>', _result); // 保存选择的知识点 this.props.saveTagDisciplineId(_result); } + // 新增知识点 + const handleAddKnowledge = (values) => { + // console.log('调用了新增知识点并返回了结果: ', values); + // 获取课程id + const {sub_discipline_id} = this.props.ojForm; + const obj = Object.assign({}, values, {sub_discipline_id}) + tagDisciplines(obj); + } + return (
@@ -384,9 +398,11 @@ class EditTab extends React.Component { label={{myLabel(jcLabel['knowledge'], '', 'nostar')}} > @@ -514,7 +530,8 @@ const mapDispatchToProps = (dispatch) => ({ addTestCase: (value) => dispatch(actions.addTestCase(value)), // 删除测试用例 deleteTestCase: (value) => dispatch(actions.deleteTestCase(value)), - saveKnowledge: (value) => dispatch(actions.saveKnowledge(value)) + saveKnowledge: (value) => dispatch(actions.saveKnowledge(value)), + tagDisciplines: (params) => dispatch(actions.tagDisciplines(params)) // 获取题库 // getQuestion: (params) => dispatch(actions.getQuestion(params)) }); diff --git a/public/react/src/modules/developer/studentStudy/leftpane/comment/index.scss b/public/react/src/modules/developer/studentStudy/leftpane/comment/index.scss index b09eb849b..9ac89b21a 100644 --- a/public/react/src/modules/developer/studentStudy/leftpane/comment/index.scss +++ b/public/react/src/modules/developer/studentStudy/leftpane/comment/index.scss @@ -3,7 +3,7 @@ flex-direction: column; justify-content: space-between; background: #fff; - padding: 20px 30px 0; + padding: 0px 20px 0; height: calc(100vh - 177px); box-sizing: border-box; overflow-y: auto; diff --git a/public/react/src/modules/developer/studentStudy/leftpane/index.scss b/public/react/src/modules/developer/studentStudy/leftpane/index.scss index 441c1ad66..e47c4b458 100644 --- a/public/react/src/modules/developer/studentStudy/leftpane/index.scss +++ b/public/react/src/modules/developer/studentStudy/leftpane/index.scss @@ -53,6 +53,7 @@ .commit_record_area{ padding: 0 20px; + background: #fff; // height: calc(100vh - 178px); } .task_description_area{ @@ -61,7 +62,8 @@ .task_desc_area{ height: calc(100vh - 242px); overflow-y: auto; - padding: 0 0 0 15px; + // padding: 0 0 0 15px; + background: #fff; } .desc_area_header{ display: flex; @@ -69,14 +71,20 @@ align-items: center; height: 64px; padding: 0 20px; + background: #fff; + box-sizing: border-box; + border-bottom: 1px solid #f4f4f4; + .header_flex{ font-size: 14px; .flex_label{ - color: #999999; + color: #888888; margin-right: 10px; } .flex_value{ - font-weight: bold; + font-weight: 500; + color: #333; + // color: green; } } } diff --git a/public/react/src/modules/page/VNCContainer.js b/public/react/src/modules/page/VNCContainer.js index 61a8e1f6b..55a991ae8 100644 --- a/public/react/src/modules/page/VNCContainer.js +++ b/public/react/src/modules/page/VNCContainer.js @@ -278,6 +278,8 @@ class VNCContainer extends Component { .vncDrawer .ant-drawer-body { padding: 0px; } + + .vncDrawer .rc-tree { padding: 16px; max-width: 220px; @@ -286,6 +288,7 @@ class VNCContainer extends Component { .vncDrawer .ant-drawer-wrapper-body { background: #242324; + height: 100%; } .codeInDrawer .ant-drawer-wrapper-body { background: #1D1C1D; @@ -294,6 +297,10 @@ class VNCContainer extends Component { .vncDrawer .ant-drawer-header, .codeInDrawer .ant-drawer-header { border-bottom: 0; } + .codeInDrawer .ant-drawer-header, + .codeInDrawer .ant-drawer-content{ + background: rgb(28, 28, 28) !important; + } .vncDrawer > div:nth-child(1) { opacity: 1 !important; diff --git a/public/react/src/modules/question/NewMyShixunModel.js b/public/react/src/modules/question/NewMyShixunModel.js new file mode 100644 index 000000000..9db5d242f --- /dev/null +++ b/public/react/src/modules/question/NewMyShixunModel.js @@ -0,0 +1,929 @@ +import React, {Component} from "react"; +import {Link, NavLink} from 'react-router-dom'; +import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder'; +import axios from 'axios'; +import { + notification, + Spin, + Table, + Pagination, + Drawer, + Input, + Tooltip +} from "antd"; +import {parabola} from './animation/parabola' +import Headplugselections from "./component/Headplugselections"; +import QuestionModal from "./component/QuestionModal"; +import QuestionModals from "./component/QuestionModals"; +import Contentpart from "./component/Contentpart"; +import {TPMIndexHOC} from "../tpm/TPMIndexHOC"; +import NoneData from './component/NoneData'; +import './questioncss/questioncom.css'; +import Bottomsubmit from "../modals/Bottomsubmit"; + +//exam_id 试卷的id +class NewMyShixunModel extends Component { + constructor(props) { + super(props); + this.state = { + count: 50, + defaultActiveKey:"0", + Headertop: "", + Footerdown: "", + visible: false, + placement: 'right', + modalsType: false, + modalsTypes:false, + titilesm: "设为公开后,所有成员均可使用试题", + titiless: "是否设置为公开?", + titilesms:"单选题", + titbool: false, + Contentdata: [], + difficulty: null, + visiblemys: false, + visiblemyss: false, + item_type: null, + keyword: null, + timuid: null, + items_count: 0, + basket_list: [], + completion_questions_count: 0, + judgement_questions_count: 0, + multiple_questions_count: 0, + practical_questions_count: 0, + program_questions_count: 0, + single_questions_count: 0, + subjective_questions_count: 0, + page:1, + per_page:10, + disciplinesdata:[], + discipline_id:null, + sub_discipline_id:null, + tag_discipline_id:null, + booljupyterurls:false, + disciplinesdatakc:0, + disciplinesdatazsd:0, + selectallquestionsonthispages:false, + oj_status:null, + isVisible: false, + selectionbools:false, + } + + } + setdiscipline_id=(discipline_id)=>{ + this.setState({ + discipline_id:discipline_id, + sub_discipline_id:null, + tag_discipline_id:null, + keywords:"", + page:1, + per_page:10, + oj_status:null + }) + var data = { + discipline_id:discipline_id, + sub_discipline_id:null, + tag_discipline_id:null, + public: this.state.defaultActiveKey, + difficulty: this.state.difficulty, + item_type: this.state.item_type, + keywords: null, + page: this.state.page, + per_page:10, + oj_status:null, + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), + }; + this.getdata(data); + + } + + setsub_discipline_id=(sub_discipline_id)=>{ + this.setState({ + sub_discipline_id:sub_discipline_id, + tag_discipline_id:null, + keywords:"", + page:1, + per_page:10, + oj_status:null + }) + var data = { + discipline_id:this.state.discipline_id, + sub_discipline_id:sub_discipline_id, + tag_discipline_id:null, + public: this.state.defaultActiveKey, + difficulty: this.state.difficulty, + item_type: this.state.item_type, + keywords:null, + page: 1, + per_page:10, + oj_status:null, + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), + }; + this.getdata(data); + } + + settag_discipline_id=(tag_discipline_id)=>{ + this.setState({ + tag_discipline_id:tag_discipline_id, + keywords:"", + page:1, + per_page:10, + oj_status:null + }) + var data = { + discipline_id:this.state.discipline_id, + sub_discipline_id:this.state.sub_discipline_id, + tag_discipline_id:tag_discipline_id, + public: this.state.defaultActiveKey, + difficulty: this.state.difficulty, + item_type: this.state.item_type, + keywords: null, + page: 1, + per_page:10, + oj_status:null, + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), + }; + this.getdata(data); + } + + //初始化 + componentDidMount() { + let {defaultActiveKey} = this.state; + var data = { + discipline_id:this.state.discipline_id, + sub_discipline_id:this.state.sub_discipline_id, + tag_discipline_id:this.state.tag_discipline_id, + public: defaultActiveKey, + page:1, + per_page:10, + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), + }; + this.getdata(data); + + let url = `/users/get_navigation_info.json`; + axios.get(url, {}).then((response) => { + // ////console.log("开始请求/get_navigation_info.json"); + // ////console.log(response); + if (response != undefined) { + if (response.status === 200) { + this.setState({ + Headertop: response.data.top, + Footerdown: response.data.down + }) + } + } + }); + + this.getbasket_listdata(); + + //获取题库筛选资料 + let urls = `/disciplines.json`; + axios.get(urls, {params: { + source:"question" + }}).then((response) => { + console.log("Questiondisciplines"); + console.log(response.data); + if (response) { + this.setState({ + disciplinesdata: response.data.disciplines, + }) + } + }); + } + //公共和我的 + callback = (key) => { + this.setState({ + defaultActiveKey: key, + selectallquestionsonthispages:false, + difficulty:null, + page:1, + oj_status:null + }) + var data = { + discipline_id:this.state.discipline_id, + sub_discipline_id:this.state.sub_discipline_id, + tag_discipline_id:this.state.tag_discipline_id, + public: key, + item_type: this.state.item_type, + difficulty: null, + page: 1, + per_page:10, + oj_status:null, + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), + }; + this.getdata(data); + + } + + //刷新加载 + getdata = (data) => { + const url = `/item_banks.json`; + this.setState({ + booljupyterurls:true, + selectionbools:false, + }) + axios.get((url), {params: data}).then((response) => { + setTimeout(()=>{ + this.setState({ + booljupyterurls:false, + }) + },1000); + if (response === null || response === undefined) { + + return + } + if (response.data.status === 403 || response.data.status === 401 || response.data.status === 500) { + + } else { + + } + ////console.log("item_banks"); + ////console.log(response); + this.setState({ + Contentdata: response.data, + items_count: response.data.items_count, + }) + this.getdataslen(response.data.items); + }).catch((error) => { + ////console.log(error) + this.setState({ + booljupyterurls:false, + }) + }); + } + + //不刷新加载 + getdatasy = (data) => { + const url = `/item_banks.json`; + this.setState({ + selectionbools:false, + }) + axios.get((url), {params: data}).then((response) => { + setTimeout(()=>{ + + },1000); + if (response === null || response === undefined) { + + return + } + if (response.data.status === 403 || response.data.status === 401 || response.data.status === 500) { + + } else { + + } + ////console.log("item_banks"); + ////console.log(response); + this.setState({ + Contentdata: response.data, + items_count: response.data.items_count, + + }) + + this.getdataslen(response.data.items); + }).catch((error) => { + + }); + } + + //计算 + getdataslen=(arr)=>{ + var contes=0; + for(let data of arr) { + if(data.item_type==="PROGRAM"){ + //编程题 + if(data.choosed===true){ + + }else{ + //未选用 + if(data.program_attr.status===1){ + //已发布 + contes=contes+1; + } + + } + + }else{ + //不是编程题 + if(data.choosed===true){ + + }else{ + //未选用 + contes=contes+1; + } + } + + } + + if(contes>0){ + this.setState({ + selectionbools:false, + selectallquestionsonthispages:false, + }) + }else { + this.setState({ + selectionbools:true, + selectallquestionsonthispages:true, + }) + } + } + + paginationonChange = (pageNumber) => { + this.setState({ + page: pageNumber, + }) + var data = { + discipline_id:this.state.discipline_id, + sub_discipline_id:this.state.sub_discipline_id, + tag_discipline_id:this.state.tag_discipline_id, + public: this.state.defaultActiveKey, + difficulty: this.state.difficulty, + item_type: this.state.item_type, + keywords: this.state.keywords, + page: pageNumber, + per_page:10, + oj_status:this.state.oj_status, + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), + + }; + this.getdata(data); + } + showDrawer = () => { + if(this.state.visible===true){ + this.setState({ + visible: false, + }); + }else{ + this.setState({ + visible: true, + }); + this.getbasket_listdata(); + } + + + + }; + + onClose = () => { + this.setState({ + visible: false, + }); + }; + + onChange = e => { + this.setState({ + placement: e.target.value, + }); + }; + + getContainer = () => { + return this.container; + }; + saveContainer = container => { + this.container = container; + }; + + showmodels = (id) => { + + this.setState({ + modalsType: true, + titilesm: "设为公开后,所有成员均可使用试题", + titiless: "是否设置为公开?", + titbool: true, + timuid: id + }) + }; + showmodelysl = (id) => { + this.setState({ + modalsType: true, + titilesm: "确认删除后,无法撤销", + titiless: "是否确认删除?", + titbool: false, + timuid: id + }) + }; + + + modalCancel = () => { + this.setState({ + modalsType: false + }) + } + modalCancels=()=>{ + this.setState({ + modalsTypes: false + }) + } + showQuestionModals =(item_type)=>{ + this.setState({ + modalsTypes: true, + titilesms:item_type, + }) + + } + setDownloads=(item_type)=>{ + this.Deletebigquestiontype(item_type); + this.setState({ + modalsTypes: false + }) + } + setDownload = () => { + //确认 + if (this.state.titbool === true) { + //公开 + this.publicopentimu(this.state.timuid); + } else { + // 删除 + this.deletetimu(this.state.timuid); + } + this.setState({ + modalsType: false + }) + } + + setdifficulty = (difficulty) => { + this.setState({ + difficulty: difficulty, + visiblemys: false, + page: 1, + per_page:10, + keywords:"", + oj_status:null + }) + + var data = { + discipline_id:this.state.discipline_id, + sub_discipline_id:this.state.sub_discipline_id, + tag_discipline_id:this.state.tag_discipline_id, + public: this.state.defaultActiveKey, + difficulty: difficulty, + item_type: this.state.item_type, + keywords:null, + page:1, + per_page:10, + oj_status:null, + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), + }; + + this.getdata(data); + + } + setitem_types = (item_type) => { + this.setState({ + item_type: item_type, + visiblemyss: false, + page: 1, + per_page:10, + keywords:"", + oj_status:null + }) + + var data = { + discipline_id:this.state.discipline_id, + sub_discipline_id:this.state.sub_discipline_id, + tag_discipline_id:this.state.tag_discipline_id, + public: this.state.defaultActiveKey, + difficulty: this.state.difficulty, + item_type: item_type, + page: 1, + per_page:10, + keywords:null, + oj_status:null, + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), + }; + + this.getdata(data); + } + + handleVisibleChange = (boll) => { + if (this.state.visiblemyss === true) { + this.setState({ + visiblemys: boll, + visiblemyss: false, + }) + } else { + this.setState({ + visiblemys: boll, + }) + } + + } + + handleVisibleChanges = (boll) => { + if (this.state.visiblemys === true) { + this.setState({ + visiblemyss: boll, + visiblemys: false, + }) + } else { + this.setState({ + visiblemyss: boll, + }) + } + + } + + setdatafunsval = (e) => { + this.setState({ + keywords: e.target.value + }) + } + + setdatafuns = (value) => { + this.setState({ + keywords: value, + }) + var data = { + discipline_id:this.state.discipline_id, + sub_discipline_id:this.state.sub_discipline_id, + tag_discipline_id:this.state.tag_discipline_id, + public: this.state.defaultActiveKey, + difficulty: this.state.difficulty, + item_type: this.state.item_type, + keywords: value, + page: this.state.page, + per_page:10, + oj_status:this.state.oj_status, + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), + }; + + this.getdata(data); + } + + deletetimu = (id) => { + + const url = `/item_banks/${id}.json`; + axios.delete(url) + .then((response) => { + if (response.data.status == 0) { + // this.props.showNotification('删除试题成功') + // props.history.push(response.data.right_url) + var data = { + discipline_id:this.state.discipline_id, + sub_discipline_id:this.state.sub_discipline_id, + tag_discipline_id:this.state.tag_discipline_id, + public: this.state.defaultActiveKey, + difficulty: this.state.difficulty, + item_type: this.state.item_type, + keywords: this.state.keywords, + page: this.state.page, + per_page:10, + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), + }; + this.getdata(data); + } + }) + .catch(function (error) { + //console.log(error); + }); + } + publicopentimu = (id) => { + + const url = `/item_banks/${id}/set_public.json`; + axios.post(url) + .then((result) => { + if (result.data.status == 0) { + // this.props.showNotification(`公开题目成功`); + var data = { + discipline_id:this.state.discipline_id, + sub_discipline_id:this.state.sub_discipline_id, + tag_discipline_id:this.state.tag_discipline_id, + public: this.state.defaultActiveKey, + difficulty: this.state.difficulty, + item_type: this.state.item_type, + keywords: this.state.keywords, + page: this.state.page, + per_page:10, + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), + + }; + this.getdata(data); + } + }).catch((error) => { + //console.log(error); + }) + } + + getbasket_listdata = () => { + // 获取试题篮展开的数据 + // const url = "/item_baskets/basket_list.json"; + // axios.get(url) + // .then((result) => { + // // //console.log("getbasket_listdata"); + // // //console.log(result.data); + // this.setState({ + // completion_questions_count: result.data.completion_questions_count, + // judgement_questions_count: result.data.judgement_questions_count, + // multiple_questions_count: result.data.multiple_questions_count, + // practical_questions_count: result.data.practical_questions_count, + // program_questions_count: result.data.program_questions_count, + // single_questions_count: result.data.single_questions_count, + // subjective_questions_count: result.data.subjective_questions_count, + // }) + // + // }).catch((error) => { + // // //console.log(error); + // this.setState({ + // completion_questions_count: 0, + // judgement_questions_count: 0, + // multiple_questions_count: 0, + // practical_questions_count: 0, + // program_questions_count: 0, + // single_questions_count: 0, + // subjective_questions_count: 0, + // }) + // }) + + } + + + //选用 + getitem_baskets=(data)=>{ + //选用题型可以上传单个 或者多个题型 + let url=""; + if(this.props.exam_id===undefined){ + url="/item_baskets.json"; + }else{ + url="/examination_items.json"; + } + + + axios.post(url, data) + .then((result) => { + if (result.data.status == 0) { + // this.props.showNotification(`选用成功`); + var data = { + discipline_id:this.state.discipline_id, + sub_discipline_id:this.state.sub_discipline_id, + tag_discipline_id:this.state.tag_discipline_id, + public: this.state.defaultActiveKey, + difficulty: this.state.difficulty, + item_type: this.state.item_type, + keywords: this.state.keywords, + page: this.state.page, + per_page:10, + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), + }; + this.getdatasy(data); + this.getbasket_listdata(); + // this.setState({ + // visible:true + // }) + } + }).catch((error) => { + //console.log(error); + }) + } + // 撤销 + getitem_basketss=(id)=>{ + let url=""; + if(this.props.exam_id===undefined){ + url=`/item_baskets/${id}.json`; + }else{ + url=`/examination_banks/${id}/revoke_item.json`; + } + + axios.delete(url,{ data: { + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), + }}) + .then((result) => { + if (result.data.status == 0) { + // this.props.showNotification(`撤销成功`); + var data = { + discipline_id:this.state.discipline_id, + sub_discipline_id:this.state.sub_discipline_id, + tag_discipline_id:this.state.tag_discipline_id, + public: this.state.defaultActiveKey, + difficulty: this.state.difficulty, + item_type: this.state.item_type, + keywords: this.state.keywords, + page: this.state.page, + per_page:10, + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), + }; + this.getdatasy(data); + this.getbasket_listdata(); + } + }).catch((error) => { + //console.log(error); + }) + } + //全选试题库 + selectallquestionsonthispage=()=>{ + var item_idsdata=[]; + + var arr= this.state.Contentdata.items; + for(let data of arr) { + if(data.item_type==="PROGRAM"){ + //编程题 + if(data.choosed===true){ + + }else{ + //未选用 + if(data.program_attr.status===1){ + //已发布 + item_idsdata.push(data.id); + } + + } + + }else{ + //不是编程题 + if(data.choosed===true){ + + }else{ + //未选用 + item_idsdata.push(data.id); + } + } + + } + const data={ + item_ids:item_idsdata, + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), + } + this.getitem_baskets(data); + this.setState({ + selectallquestionsonthispages:true, + }) + } + + //全选的状态 + + //删除大题型 + Deletebigquestiontype =(item_type)=>{ + const url=`/item_baskets/delete_item_type.json`; + axios.delete((url), { data: { + item_type:item_type + }}) + .then((response) => { + if (response.data.status == 0) { + // this.props.showNotification('删除成功'); + var data = { + discipline_id:this.state.discipline_id, + sub_discipline_id:this.state.sub_discipline_id, + tag_discipline_id:this.state.tag_discipline_id, + public: this.state.defaultActiveKey, + difficulty: this.state.difficulty, + item_type: this.state.item_type, + keywords: this.state.keywords, + page: this.state.page, + per_page:10, + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), + }; + this.getdata(data); + this.getbasket_listdata(); + } + }) + .catch(function (error) { + //console.log(error); + }); + + } + + + //跳转 + gotopaperreview=()=>{ + + this.props.history.replace("/paperreview"); + + } + + setoj_status=(oj_status)=>{ + //编程题发布未发布 + this.setState({ + selectallquestionsonthispages:false, + difficulty:null, + oj_status:oj_status + }) + var data = { + discipline_id:this.state.discipline_id, + sub_discipline_id:this.state.sub_discipline_id, + tag_discipline_id:this.state.tag_discipline_id, + public: this.state.defaultActiveKey, + difficulty: this.state.difficulty, + item_type: this.state.item_type, + keywords: this.state.keywords, + page: this.state.page, + per_page:10, + oj_status:oj_status, + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), + }; + this.getdata(data); + } + + + render() { + let { + page, per_page, items_count, Headertop, visible, placement, modalsType, modalsTypes,basket_list, + completion_questions_count, judgement_questions_count, multiple_questions_count, practical_questions_count, + program_questions_count, single_questions_count, subjective_questions_count,selectionbools + } = this.state; + + const Datacount = completion_questions_count + judgement_questions_count + + multiple_questions_count + practical_questions_count + + program_questions_count + + single_questions_count + + subjective_questions_count; + + return ( +
+ + + { + visible===true? + + :"" + } + { + visible===true? +
+ :""} + { + modalsTypes===true? + this.modalCancels()} + setDownloads={(e) => this.setDownloads(e)}> + :"" + } + { + modalsType===true? + this.modalCancel()} + setDownload={() => this.setDownload()}> + :"" + } + + {/*顶部*/} + + this.setdifficulty(e)} + setitem_types={(e) => this.setitem_types(e)} + setdiscipline_id={(e)=>this.setdiscipline_id(e)} + setsub_discipline_id={(e)=>this.setsub_discipline_id(e)} + settag_discipline_id={(e)=>this.settag_discipline_id(e)} + /> + {/*头部*/} + this.getitem_basketss(id)} + selectallquestionsonthispage={()=>this.selectallquestionsonthispage()} + getitem_baskets={(e)=>this.getitem_baskets(e)} + setdatafuns={(e) => this.setdatafuns(e)} + setdatafunsval={(e) => this.setdatafunsval(e)} + handleVisibleChanges={(e) => this.handleVisibleChanges(e)} + handleVisibleChange={(e) => this.handleVisibleChange(e)} + showmodels={(e) => this.showmodels(e)} + showmodelysl={(e) => this.showmodelysl(e)} + callback={(e) => this.callback(e)} + setoj_status={(e)=>this.setoj_status(e)}> + + { + items_count&&items_count>10? +
+ +
+ :
+ +
+ } + + + this.props.setnewmyshixunmodelbool(false)} + onSubmits={() => this.props.setnewmyshixunmodelbool(false)} url={'/paperlibrary'}> +
+ ) + + } + +} + +export default NewMyShixunModel; diff --git a/public/react/src/modules/question/Paperreview.js b/public/react/src/modules/question/Paperreview.js index 9014ba92b..b65127c8d 100644 --- a/public/react/src/modules/question/Paperreview.js +++ b/public/react/src/modules/question/Paperreview.js @@ -24,6 +24,7 @@ import JudquestionEditor from "./component/JudquestionEditor"; import Paperreview_item from "./Paperreview_item" import Bottomsubmit from "../../modules/modals/Bottomsubmit"; import Comthetestpaperst from "./comthetestpaper/Comthetestpaperst"; +import NewMyShixunModel from "../question/NewMyShixunModel"; //人工组卷预览 class Paperreview extends Component { constructor(props) { @@ -49,7 +50,7 @@ class Paperreview extends Component { difficulty:null, name:null, duration:null, - + newmyshixunmodelbool:false, } // single_questions:null, 单选题 @@ -245,14 +246,50 @@ class Paperreview extends Component { getcontentMdRef = (Ref) => { this.contentMdRef = Ref; } + + setnewmyshixunmodelbool=(bool)=>{ + if(bool===true){ + let scrollToTop = window.setInterval(function() { + let pos = window.pageYOffset; + if ( pos > 0 ) { + window.scrollTo( 0, pos - 20 ); // how far to scroll on each step + } else { + window.clearInterval( scrollToTop ); + } + }, 2); + } + this.setState({ + newmyshixunmodelbool:bool + }) + var data = {} + this.getdata(data); + } render() { - let {page, limit, count, Headertop, visible, placement, modalsType, item_type,Cohetepaperbool} = this.state; + let {page, limit, count, Headertop, visible, placement, modalsType, item_type,Cohetepaperbool,newmyshixunmodelbool} = this.state; const params = this.props && this.props.match && this.props.match.params; // //console.log(params); return (
+ { + newmyshixunmodelbool===true? + + :"" + } + + { + newmyshixunmodelbool===true? +
+ this.setnewmyshixunmodelbool(e)}> +
+ : + "" + }
- {getFieldDecorator('rbnd', - { + {getFieldDecorator('rbnd' + , + {initialValue: this.state.rbnd, rules: [{required: true, message: '请选择难度'}], } )( - + 简单 适中 困难 diff --git a/public/react/src/modules/question/questioncss/questioncom.css b/public/react/src/modules/question/questioncss/questioncom.css index 4bf767b0f..5d37aeccd 100644 --- a/public/react/src/modules/question/questioncss/questioncom.css +++ b/public/react/src/modules/question/questioncss/questioncom.css @@ -922,3 +922,20 @@ .mr15{ margin-right: 15px; } +.fangdatwo{ + background: #fefefe; + background-color: #fefefe; + height: 100%; + overflow-y: scroll !important; + width: 100%; + position: fixed; + top:0px; + bottom: 0px; + left: 0px; + z-index: 999999; + right: 0px; +} + +.searchwidth{ + width: 347px !important; +} diff --git a/public/react/src/modules/testpaper/Paperlibraryeditid.js b/public/react/src/modules/testpaper/Paperlibraryeditid.js index 1497a12ec..1b3ee95ef 100644 --- a/public/react/src/modules/testpaper/Paperlibraryeditid.js +++ b/public/react/src/modules/testpaper/Paperlibraryeditid.js @@ -22,8 +22,10 @@ import Paperlibraryseeid_item from './component/Paperlibraryseeid_item'; import Comthetestpaperst from '../question/comthetestpaper/Comthetestpaperst'; import Paperlibraryseeid_itemss from './component/Paperlibraryseeid_itemss'; import JudquestionEditor from "../question/component/JudquestionEditor"; +import NewMyShixunModel from "../question/NewMyShixunModel"; -//人工组卷预览 + +//试卷编辑 class Paperlibraryeditid extends Component { constructor(props) { super(props); @@ -33,7 +35,8 @@ class Paperlibraryeditid extends Component { disciplinesdata: [], knowledgepoints: [], disciplmy: [], - item_banksedit: [] + item_banksedit: [], + newmyshixunmodelbool:false, } @@ -185,14 +188,50 @@ class Paperlibraryeditid extends Component { this.contentMdRef = Ref; } + setnewmyshixunmodelbool=(bool)=>{ + if(bool===true){ + let scrollToTop = window.setInterval(function() { + let pos = window.pageYOffset; + if ( pos > 0 ) { + window.scrollTo( 0, pos - 20 ); // how far to scroll on each step + } else { + window.clearInterval( scrollToTop ); + } + }, 2); + } + this.setState({ + newmyshixunmodelbool:bool + }) + this.getdata(); + } + render() { - let {paperlibrartdata} = this.state; + let {paperlibrartdata,newmyshixunmodelbool} = this.state; const params = this.props && this.props.match && this.props.match.params; - // //console.log(params); + // console.log("newmyshixunmodelbool"); + // console.log(newmyshixunmodelbool); return (
+ { + newmyshixunmodelbool===true? + + :"" + } + + { + newmyshixunmodelbool===true? +
+ this.setnewmyshixunmodelbool(e)}> +
+ : + "" + } - {/*
  • */} - {/* */} - {/*
    */} - {/*
    */} - {/* 题库*/} - {/*
    */} - {/*
    */} - {/*
    */} - {/*
  • */} +
  • + +
    +
    + 题库 +
    +
    +
    +
  • ; const MyRate = ({defaultValue, ...rest}) => { let myValue = defaultValue; - // console.log(myValue-Math.floor(myValue)) - // if (myValue < Math.ceil(myValue)) { - // myValue = Math.floor(myValue) + 0.5; - // } - return ; }; // diff --git a/public/react/src/modules/tpm/shixunchild/shixunchildCss/Challenges.css b/public/react/src/modules/tpm/shixunchild/shixunchildCss/Challenges.css index b59bd86fd..652f77201 100644 --- a/public/react/src/modules/tpm/shixunchild/shixunchildCss/Challenges.css +++ b/public/react/src/modules/tpm/shixunchild/shixunchildCss/Challenges.css @@ -138,15 +138,26 @@ } .shixunstartbutton33BD8C{ - background: #33BD8C !important; - border: #33BD8C !important; + /* border: #33BD8C !important; */ cursor: inherit !important; + border: 1px solid #33BD8C !important; + background: transparent !important; + color: #33BD8C !important; + box-shadow: none; + text-shadow: none; } .shixunstartbuttonFF6601{ - background: #FF6601 !important; - border: #FF6601 !important; + /*background: #FF6601 !important;*/ + /*border: #FF6601 !important;*/ + /*cursor: inherit !important;*/ + /* border: #33BD8C !important; */ cursor: inherit !important; + border: 1px solid #FF6601 !important; + background: transparent !important; + color: #FF6601 !important; + box-shadow: none; + text-shadow: none; } .shixunstartbutton666666{ diff --git a/public/react/src/modules/tpm/shixuns/ShixunsIndex.js b/public/react/src/modules/tpm/shixuns/ShixunsIndex.js index 7b6e54bc8..f14afb0ac 100644 --- a/public/react/src/modules/tpm/shixuns/ShixunsIndex.js +++ b/public/react/src/modules/tpm/shixuns/ShixunsIndex.js @@ -107,7 +107,10 @@ class ShixunsIndex extends Component { this.setState({ parsedid:parsed.id, newtag_level:nawparsed, - newpalce:newpalce + tag_level:nawparsed, + newpalce:newpalce, + tag_id:parsed.id, + keyword: _keyword || keyword, }) this.shixunresultend(params); } diff --git a/public/react/src/redux/actions/index.js b/public/react/src/redux/actions/index.js index efce336c9..0376b529d 100644 --- a/public/react/src/redux/actions/index.js +++ b/public/react/src/redux/actions/index.js @@ -36,7 +36,8 @@ import { handleClickCancelPublish, getQuestion, saveKnowledge, - setOjInitialValue + setOjInitialValue, + tagDisciplines } from './ojForm'; import { @@ -125,6 +126,7 @@ export default { getQuestion, saveKnowledge, setOjInitialValue, + tagDisciplines, // addTestCase, deleteTestCase, diff --git a/public/react/src/redux/actions/ojForUser.js b/public/react/src/redux/actions/ojForUser.js index 99c759996..6a8f49bd6 100644 --- a/public/react/src/redux/actions/ojForUser.js +++ b/public/react/src/redux/actions/ojForUser.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-27 13:42:11 * @LastEditors : tangjiang - * @LastEditTime : 2020-01-02 14:17:49 + * @LastEditTime : 2020-01-07 16:21:53 */ import types from "./actionTypes"; import { Base64 } from 'js-base64'; @@ -18,7 +18,7 @@ import { fetchUpdateCode, fetchUserCodeSubmit, fetchRestoreInitialCode, - fetchAddNotes + fetchAddNotes, } from "../../services/ojService"; import { notification } from "antd"; @@ -148,11 +148,12 @@ export const saveUserCodeForInterval = (identifier, code) => { * @param {*} type 测评类型 debug | submit */ export const updateCode = (identifier, inputValue, type) => { + console.log(1111); return (dispatch, getState) => { const { userCode, isUpdateCode } = getState().ojForUserReducer; if (isUpdateCode) { fetchUpdateCode(identifier, { - code: userCode + code: Base64.encode(userCode) }).then(res => { // 是否更新了代码, 目的是当代码没有更新时不调用更新代码接口,目录没有实现 // TODO 需要优化 @@ -523,4 +524,4 @@ export const addNotes = (identifier, params, cb) => { }); }) } -} \ No newline at end of file +} diff --git a/public/react/src/redux/actions/ojForm.js b/public/react/src/redux/actions/ojForm.js index bcdd19daa..1c41da38a 100644 --- a/public/react/src/redux/actions/ojForm.js +++ b/public/react/src/redux/actions/ojForm.js @@ -4,7 +4,11 @@ * @Github: * @Date: 2019-11-20 16:35:46 * @LastEditors : tangjiang +<<<<<<< HEAD + * @LastEditTime : 2020-01-07 15:27:22 +======= * @LastEditTime : 2020-01-03 17:39:32 +>>>>>>> dev_aliyun */ import types from './actionTypes'; import CONST from '../../constants'; @@ -13,7 +17,8 @@ import { fetchGetOjById, publishTask, cancelPublicTask, - fetchQuestion + fetchQuestion, + fetchTagDisciplines } from '../../services/ojService'; import { Base64 } from 'js-base64'; import { notification } from 'antd'; @@ -677,30 +682,46 @@ export const updateOpenTestCaseIndex = (value) => { export const getQuestion = (params) => { return (dispatch, getState) => { const {ojForm: {sub_discipline_id}} = getState().ojFormReducer; - fetchQuestion(params, ).then(res => { + fetchQuestion(params).then(res => { const { data = {} } = res; const { disciplines = [] } = data; dispatch({ type: types.GET_COURSE_QUESTION, payload: disciplines }); - - let temp_knowledges = []; - // console.log('选择的课程: =====>>>>>>', sub_discipline_id); - disciplines.forEach(c => { - if (sub_discipline_id && c.sub_disciplines) { - c.sub_disciplines.forEach(sub => { - if (+sub.id === +sub_discipline_id) { - temp_knowledges = sub.tag_disciplines || []; - } - }); - } - }); - dispatch({ - type: types.CHANGE_KNOWLEDGES, - payload: temp_knowledges - }); - }) + // 如果课程id号存在, 同步更新知识点 + if (sub_discipline_id) { + let temp_knowledges = []; + disciplines.forEach(c => { + if (sub_discipline_id && c.sub_disciplines) { + c.sub_disciplines.forEach(sub => { + if (+sub.id === sub_discipline_id) { + temp_knowledges = sub.tag_disciplines || []; + } + }); + } + }); + dispatch({ + type: types.CHANGE_KNOWLEDGES, + payload: temp_knowledges + }) + } + // let temp_knowledges = []; + // // console.log('选择的课程: =====>>>>>>', sub_discipline_id); + // disciplines.forEach(c => { + // if (sub_discipline_id && c.sub_disciplines) { + // c.sub_disciplines.forEach(sub => { + // if (+sub.id === +sub_discipline_id) { + // temp_knowledges = sub.tag_disciplines || []; + // } + // }); + // } + // }); + // dispatch({ + // type: types.CHANGE_KNOWLEDGES, + // payload: temp_knowledges + // }); + }); } } @@ -727,3 +748,22 @@ export const setOjInitialValue = (params) => { payload: params } } + +// 新增知识点 +export const tagDisciplines = (params) => { + return (dispatch) => { + fetchTagDisciplines(params).then(res => { + // console.log('新增知识点成功======>>>>', res); + if (res.data.status === 0) { + notification.success({ + message: '提示', + description: '新增知识点成功' + }); + // 重新调用获取课程列表接口 + dispatch(getQuestion({ + source: 'question' + })); + } + }); + } +} diff --git a/public/react/src/redux/reducers/commonReducer.js b/public/react/src/redux/reducers/commonReducer.js index 12c64c28f..e34cd884b 100644 --- a/public/react/src/redux/reducers/commonReducer.js +++ b/public/react/src/redux/reducers/commonReducer.js @@ -3,8 +3,8 @@ * @Author: tangjiang * @Github: * @Date: 2019-11-27 16:27:09 - * @LastEditors: tangjiang - * @LastEditTime: 2019-12-12 17:36:51 + * @LastEditors : tangjiang + * @LastEditTime : 2020-01-07 15:23:39 */ import types from "../actions/actionTypes"; @@ -22,7 +22,7 @@ const initialState = { } const commonReducer = (state = initialState, action) => { - console.log(action) + // console.log(action) switch (action.type) { case types.SHOW_OR_HIDE_CONTROL: return { diff --git a/public/react/src/services/ojService.js b/public/react/src/services/ojService.js index 59151e687..d0d0ae0ae 100644 --- a/public/react/src/services/ojService.js +++ b/public/react/src/services/ojService.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-20 10:55:38 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-30 09:44:56 + * @LastEditTime : 2020-01-07 15:23:19 */ import axios from 'axios'; @@ -71,7 +71,7 @@ export async function fetchUserProgramDetail (identifier) { // 获取提交记录 export async function fetchUserCommitRecord (identifier, params) { - console.log('identifier=====', identifier); + // console.log('identifier=====', identifier); const url = `/myproblems/${identifier}/submit_records.json`; return axios.get(url, { params }); } @@ -148,4 +148,10 @@ export async function fetchAddNotes (identifier, params) { export async function fetchQuestion (params) { const url = `/disciplines.json`; return axios.get(url, { params }); +} + +// 新增选题 +export async function fetchTagDisciplines (params) { + const url = `/tag_disciplines.json`; + return axios.post(url, params); } \ No newline at end of file