From 020de0321c90e72f5b8492436cc235b763576795 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 6 Jan 2020 16:39:13 +0800 Subject: [PATCH 01/33] 1 --- Gemfile | 3 +++ 1 file changed, 3 insertions(+) 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' From e4df8221de24e7aded83b48d0388333cd867698f Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 6 Jan 2020 16:56:25 +0800 Subject: [PATCH 02/33] 1 --- app/models/user.rb | 1 + .../chinese_dictionary.txt | 1511 +++++++++++++++++ .../english_dictionary.txt | 66 + config/harmonious_dictionary/harmonious.hash | Bin 0 -> 48913 bytes .../harmonious_english.yml | 67 + 5 files changed, 1645 insertions(+) create mode 100644 config/harmonious_dictionary/chinese_dictionary.txt create mode 100644 config/harmonious_dictionary/english_dictionary.txt create mode 100644 config/harmonious_dictionary/harmonious.hash create mode 100644 config/harmonious_dictionary/harmonious_english.yml diff --git a/app/models/user.rb b/app/models/user.rb index a9b2f0b3a..54881cd2a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -174,6 +174,7 @@ 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 + validate_harmonious_of [:lastname, :nickname] # validates_format_of :mail, with: VALID_EMAIL_REGEX, multiline: true # validates_format_of :phone, with: VALID_PHONE_REGEX, multiline: true validate :validate_password_length 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 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0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course.rb | 2 ++ app/models/course_list.rb | 2 ++ app/models/discuss.rb | 2 ++ app/models/memo.rb | 1 + 4 files changed, 7 insertions(+) diff --git a/app/models/course.rb b/app/models/course.rb index 2f561bba7..682f73958 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_harmonious_of [:name, :subject] + 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) } diff --git a/app/models/course_list.rb b/app/models/course_list.rb index cd622f20a..84f18f0ef 100644 --- a/app/models/course_list.rb +++ b/app/models/course_list.rb @@ -6,4 +6,6 @@ class CourseList < ApplicationRecord has_many :gtask_banks has_many :gtopic_banks belongs_to :user + + validate_harmonious_of :name end diff --git a/app/models/discuss.rb b/app/models/discuss.rb index 4e6cd617c..b7238dcd1 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_harmonious_of :content + after_create :send_tiding scope :children, -> (discuss_id){ where(parent_id: discuss_id).includes(:user).reorder(created_at: :asc) } diff --git a/app/models/memo.rb b/app/models/memo.rb index d09251358..1b2be5476 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_harmonious_of [:content, :subject] scope :field_for_list, lambda{ select([:id, :subject, :author_id, :sticky, :updated_at, :language, :reward, :all_replies_count, :viewed_count, :forum_id]) From 775432cb3b142e8620c47f1bd792fec2b687409f Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 7 Jan 2020 10:06:58 +0800 Subject: [PATCH 04/33] =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/memo.rb | 8 +++++++- app/models/user.rb | 13 ++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/app/models/memo.rb b/app/models/memo.rb index 1b2be5476..6b7da3548 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -16,7 +16,8 @@ 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_harmonious_of [:content, :subject] + validate_harmonious_of [:subject, :content] + 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]) @@ -55,4 +56,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 7c1463b7f..54aa8d85e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -178,14 +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 - validate_harmonious_of [:lastname, :nickname] - # 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) @@ -728,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? From 3c353e50288cb667ff71d3c74a0f5a8c1e6410ba Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 7 Jan 2020 10:11:57 +0800 Subject: [PATCH 05/33] =?UTF-8?q?=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course.rb | 6 +++++- app/models/course_list.rb | 6 +++++- app/models/memo.rb | 1 - 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/models/course.rb b/app/models/course.rb index 682f73958..9100f8470 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -81,7 +81,7 @@ class Course < ApplicationRecord # 老版的members弃用 现用course_members has_many :members - validate_harmonious_of [:name, :subject] + validate :validate_sensitive_string scope :hidden, ->(is_hidden = true) { where(is_hidden: is_hidden) } scope :ended, ->(is_end = true) { where(is_end: is_end) } @@ -437,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 84f18f0ef..ab7404a9e 100644 --- a/app/models/course_list.rb +++ b/app/models/course_list.rb @@ -7,5 +7,9 @@ class CourseList < ApplicationRecord has_many :gtopic_banks belongs_to :user - validate_harmonious_of :name + validate :validate_sensitive_string + + def validate_sensitive_string + raise("课程名称包含敏感词汇,请重新输入") unless HarmoniousDictionary.clean?(name) + end end diff --git a/app/models/memo.rb b/app/models/memo.rb index 6b7da3548..d79081350 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -16,7 +16,6 @@ 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_harmonious_of [:subject, :content] validate :validate_sensitive_string scope :field_for_list, lambda{ From 7299e59f8aca8580664a111c5dabcd57f53bb27f Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 7 Jan 2020 10:52:52 +0800 Subject: [PATCH 06/33] =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/discuss.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/discuss.rb b/app/models/discuss.rb index b7238dcd1..a236a2bbc 100644 --- a/app/models/discuss.rb +++ b/app/models/discuss.rb @@ -11,7 +11,7 @@ class Discuss < ApplicationRecord belongs_to :dis, polymorphic: true belongs_to :challenge, optional: true - validate_harmonious_of :content + validate :validate_sensitive_string after_create :send_tiding @@ -71,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 From 33589979d3fb6ea703b05c5d8c749296e70ea489 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 7 Jan 2020 10:55:02 +0800 Subject: [PATCH 07/33] =?UTF-8?q?=E6=95=8F=E6=84=9F=E8=AF=8D=E6=B1=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/discusses_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From da6b53075002a8bb291b3af5f57ee74452cbbd22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 7 Jan 2020 11:46:55 +0800 Subject: [PATCH 08/33] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/gradinforms/myysleduinforms.css | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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; From 09ccb438a179d2496c521e1cd395bc43fab537c8 Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Tue, 7 Jan 2020 13:38:45 +0800 Subject: [PATCH 09/33] update style --- .../common/components/comment/CommentForm.js | 13 ++++++------ .../src/common/quillForEditor/index.scss | 2 ++ .../developer/components/knowledge/index.js | 21 ++++++++++++++++--- .../developer/components/knowledge/index.scss | 8 +++++++ .../studentStudy/leftpane/comment/index.scss | 2 +- .../studentStudy/leftpane/index.scss | 14 ++++++++++--- public/react/src/modules/page/VNCContainer.js | 7 +++++++ 7 files changed, 54 insertions(+), 13 deletions(-) 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/developer/components/knowledge/index.js b/public/react/src/modules/developer/components/knowledge/index.js index 680229b2d..3a588ba89 100644 --- a/public/react/src/modules/developer/components/knowledge/index.js +++ b/public/react/src/modules/developer/components/knowledge/index.js @@ -4,12 +4,13 @@ * @Github: * @Date: 2019-12-30 13:51:19 * @LastEditors : tangjiang - * @LastEditTime : 2020-01-03 18:56:36 + * @LastEditTime : 2020-01-07 11:08:58 */ import './index.scss'; import React, { useState, useEffect } from 'react'; import { Select, notification } from 'antd'; - +import { CNotificationHOC} from 'educoder'; +// import {} from 'antd'; const { Option } = Select; function KnowLedge (props) { @@ -114,15 +115,29 @@ function KnowLedge (props) { ) } + // 添加知识点 + const handleAddKnowledge = () => { + + }; + + const _styles = { + display: selectOptions.length > 0 || selectValue.length > 0 ? 'inline-block' : 'none' + }; + return (
{ renderSelect(selectOptions) } {/* 渲染下拉选择项 */}
+ { renderResult(selectValue) }
); } -export default KnowLedge; +export default CNotificationHOC()(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..acd17e91c 100644 --- a/public/react/src/modules/developer/components/knowledge/index.scss +++ b/public/react/src/modules/developer/components/knowledge/index.scss @@ -38,5 +38,13 @@ } } } + + .icon-add-knowledge{ + line-height: 36px; + margin-top: 10px; + margin-right: 10px; + // cursor: ; + color: rgb(78, 188, 126) + } } } 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; From 8daee8c2c94480ea4ef5c7ea94ada425e27d814c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 7 Jan 2020 13:50:35 +0800 Subject: [PATCH 10/33] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunchild/shixunchildCss/Challenges.css | 19 +++++++++++++++---- .../src/modules/tpm/shixuns/ShixunsIndex.js | 5 ++++- 2 files changed, 19 insertions(+), 5 deletions(-) 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); } From 6a377c17c5f45be441a2187a7cc0427ffade4526 Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Tue, 7 Jan 2020 14:20:10 +0800 Subject: [PATCH 11/33] add knowledge --- .../developer/components/knowledge/index.js | 83 +++++++++++++++---- .../developer/components/knowledge/index.scss | 6 ++ public/react/src/services/ojService.js | 7 +- 3 files changed, 76 insertions(+), 20 deletions(-) diff --git a/public/react/src/modules/developer/components/knowledge/index.js b/public/react/src/modules/developer/components/knowledge/index.js index 3a588ba89..ccbf0719b 100644 --- a/public/react/src/modules/developer/components/knowledge/index.js +++ b/public/react/src/modules/developer/components/knowledge/index.js @@ -4,13 +4,12 @@ * @Github: * @Date: 2019-12-30 13:51:19 * @LastEditors : tangjiang - * @LastEditTime : 2020-01-07 11:08:58 + * @LastEditTime : 2020-01-07 14:19:39 */ import './index.scss'; import React, { useState, useEffect } from 'react'; -import { Select, notification } from 'antd'; -import { CNotificationHOC} from 'educoder'; -// import {} from 'antd'; +import { Select, notification, Modal, Form, Input, Button } from 'antd'; + const { Option } = Select; function KnowLedge (props) { @@ -18,7 +17,8 @@ function KnowLedge (props) { const { options = [], // 下拉选项 values = [], // 已选择的下拉项 - onChange // 获取选择的值 + onChange, // 获取选择的值 + form } = props; useEffect(() => { @@ -39,9 +39,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) => ( @@ -117,27 +120,71 @@ 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); + console.log(values); + }) + } + const _styles = { display: selectOptions.length > 0 || selectValue.length > 0 ? 'inline-block' : 'none' }; return ( -
- { renderSelect(selectOptions) } - {/* 渲染下拉选择项 */} -
- - { renderResult(selectValue) } + +
+ { renderSelect(selectOptions) } + {/* 渲染下拉选择项 */} +
+ {/* */} + { renderResult(selectValue) } +
-
+ + +
+ + { + getFieldDecorator('name', { + rules: [{ + required: true, message: '知识点名称不能为空' + }] + })( + + ) + } + + + + + +
+
+ + ); } -export default CNotificationHOC()(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 acd17e91c..9a457acf9 100644 --- a/public/react/src/modules/developer/components/knowledge/index.scss +++ b/public/react/src/modules/developer/components/knowledge/index.scss @@ -48,3 +48,9 @@ } } } + +.knowledge-form{ + .ant-form-explain{ + padding: 0; + } +} diff --git a/public/react/src/services/ojService.js b/public/react/src/services/ojService.js index 59151e687..62ebf9dbb 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 14:19:24 */ import axios from 'axios'; @@ -148,4 +148,7 @@ export async function fetchAddNotes (identifier, params) { export async function fetchQuestion (params) { const url = `/disciplines.json`; return axios.get(url, { params }); -} \ No newline at end of file +} + +// 新增选题 +export async function fetchExaminationItems () {} \ No newline at end of file From 893e637b99f3efdfe851b7ed648441dacafdaf38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 7 Jan 2020 14:22:56 +0800 Subject: [PATCH 12/33] =?UTF-8?q?=E9=A2=98=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/question/component/Listjihe.js | 171 +++++++++++------- 1 file changed, 102 insertions(+), 69 deletions(-) diff --git a/public/react/src/modules/question/component/Listjihe.js b/public/react/src/modules/question/component/Listjihe.js index 64559596b..0b1f012f5 100644 --- a/public/react/src/modules/question/component/Listjihe.js +++ b/public/react/src/modules/question/component/Listjihe.js @@ -15,6 +15,11 @@ const tagArray = [ 'J.', 'K.', 'L.', 'M.', 'N.', 'O.', 'P.', 'Q.', 'R.', 'S.', 'T.', 'U.', 'V.', 'W.', 'X.', 'Y.', 'Z.' ] +const tagArrays = [ + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', + 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', + 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' +] class Listjihe extends Component { constructor(props) { super(props); @@ -32,10 +37,10 @@ class Listjihe extends Component { //选用 Selectingpracticaltraining=(id)=>{ - let data={ - item_ids:[id] - } - this.props.getitem_baskets(data); + let data={ + item_ids:[id] + } + this.props.getitem_baskets(data); } //撤销 Selectingpracticaltrainings=(id)=>{ @@ -57,18 +62,36 @@ class Listjihe extends Component { if(items){ if(items.item_type){ if(items.item_type==="PROGRAM"){ + }else{ - if(items.choices){ - if(items.choices.length>0){ - - var arr= items.choices; - for(let data of arr) { - if(data.is_answer===true){ - rightkey=data.choice_text; - break; + if(items.item_type==="JUDGMENT") { + + + if(items.choices){ + if(items.choices.length>0){ + var arr= items.choices; + for(let data of arr) { + if(data.is_answer===true){ + rightkey=data.choice_text; + break; + } } } } + }else { + if (items.choices) { + if (items.choices.length > 0) { + var arr = items.choices; + for (var i = 0; i < arr.length; i++) { + if (arr[i].is_answer === true) { + rightkey = i; + break; + } + } + } + } + + } } } @@ -94,38 +117,38 @@ class Listjihe extends Component { {/*内容*/}
{items.item_type==="JUDGMENT"? -

- { - items === undefined ||items === null? "" : items.choices.map((object, index) => { - return ( -

- - {object.choice_text} - -

- ) - }) - } -

: +

+ { + items === undefined ||items === null? "" : items.choices.map((object, index) => { + return ( +

+ + {object.choice_text} + +

+ ) + }) + } +

: items.item_type==="PROGRAM"?

-

-

+

+

+

+

+ : +

+ { + items === undefined ||items === null? "" : items.choices.map((object, index) => { + return ( +

+ {tagArray[index]} +

+ ) + }) + }

- : -

- { - items === undefined ||items === null? "" : items.choices.map((object, index) => { - return ( -

- {tagArray[index]} -

-

- ) - }) - } -

}
@@ -137,18 +160,18 @@ class Listjihe extends Component { {/*更新时间*/}
-

更新时间:{items.update_time}

+

更新时间:{items.update_time}

{ this.props.defaultActiveKey==="0"||this.props.defaultActiveKey===0? "" :

创建者:{items.author.name}

} - { - items.item_type==="PROGRAM"? -

编程语言:{items.program_attr.language}

- :"" - } + { + items.item_type==="PROGRAM"? +

编程语言:{items.program_attr.language}

+ :"" + } { items.item_type==="PROGRAM"? items.program_attr.status===0? @@ -164,22 +187,22 @@ class Listjihe extends Component { 撤销

: - items.item_type==="PROGRAM"? - items.program_attr.status===0? -

- - 选用 -

- : -

this.Selectingpracticaltraining(items.id)}> + items.item_type==="PROGRAM"? + items.program_attr.status===0? +

选用

: -

this.Selectingpracticaltraining(items.id)}> - - 选用 -

+

this.Selectingpracticaltraining(items.id)}> + + 选用 +

+ : +

this.Selectingpracticaltraining(items.id)}> + + 选用 +

} { defaultActiveKey===0||defaultActiveKey==="0"? @@ -210,17 +233,17 @@ class Listjihe extends Component { items.program_attr.status===0? "" : +

this.props.showmodels(items.id)}> + + 公开 +

+ :

this.props.showmodels(items.id)}> 公开

- : -

this.props.showmodels(items.id)}> - - 公开 -

: - "" + "" }
@@ -228,7 +251,7 @@ class Listjihe extends Component { } { items.item_type==="PROGRAM"? - "" + "" :

this.props.chakanjiexibool(keindex)}> @@ -245,10 +268,20 @@ class Listjihe extends Component {

-

-

+ + { + items.item_type==="SINGLE" || items.item_type==="MULTIPLE"? +

+

+ : +

+

+ } +
{ items&&items.analysis? From 8a82882a4aeecbdf246bcafa9310cfae957e72a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 7 Jan 2020 14:28:11 +0800 Subject: [PATCH 13/33] =?UTF-8?q?=E9=A2=98=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/question/component/Itembankstop.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/question/component/Itembankstop.js b/public/react/src/modules/question/component/Itembankstop.js index 46668c979..36dff4fc0 100644 --- a/public/react/src/modules/question/component/Itembankstop.js +++ b/public/react/src/modules/question/component/Itembankstop.js @@ -495,7 +495,7 @@ class Itembankstop extends Component { height: 33px !important; } .ant-input-group{ - width:258px !important; + width:270px !important; } .ant-input { height: 33px !important; @@ -530,7 +530,7 @@ class Itembankstop extends Component { )(
- @@ -544,7 +544,7 @@ class Itembankstop extends Component { )(
- From 3bb90dede4f1f825b4084c1a80c2beb1ee494a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 7 Jan 2020 14:29:54 +0800 Subject: [PATCH 14/33] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMBanner.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index 6c57bcff8..be849f2f5 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -858,11 +858,6 @@ class TPMBanner extends Component { const antIcon = ; 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 ; }; // From c215049c004177f977543ac9952f9bfb80d5444d Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 7 Jan 2020 14:34:00 +0800 Subject: [PATCH 15/33] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../graduation_tasks_controller.rb | 141 +++++++++++------- config/routes.rb | 1 + 2 files changed, 85 insertions(+), 57 deletions(-) diff --git a/app/controllers/graduation_tasks_controller.rb b/app/controllers/graduation_tasks_controller.rb index e8ad221be..4d44f05f1 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,28 @@ 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://#{Setting.host_name}/"+download_url(attachment) + end + + o + end + render_ok(data: person_list) + end + # 设为公开 def set_public tip_exception("仅公开课堂才能公开毕设任务") if @course.is_public == 0 @@ -657,6 +625,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/config/routes.rb b/config/routes.rb index e7e4d193a..45fd6029e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -655,6 +655,7 @@ Rails.application.routes.draw do get :cross_comment_setting post :assign_works post :commit_comment_setting + get :sonar end collection do From 16b94e58bb11d1ae0e4513c94b93358bfa0ef0b7 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 7 Jan 2020 14:59:13 +0800 Subject: [PATCH 16/33] =?UTF-8?q?sonar=E4=BB=A3=E7=A0=81=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/graduation_tasks_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/graduation_tasks_controller.rb b/app/controllers/graduation_tasks_controller.rb index 4d44f05f1..aa7a0eb11 100644 --- a/app/controllers/graduation_tasks_controller.rb +++ b/app/controllers/graduation_tasks_controller.rb @@ -230,7 +230,12 @@ class GraduationTasksController < ApplicationController o end - render_ok(data: person_list) + 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 # 设为公开 From 6b6ea7d06d1181b17fcb551af11b0deab383d1a6 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 7 Jan 2020 15:00:41 +0800 Subject: [PATCH 17/33] =?UTF-8?q?sonar=E4=BB=A3=E7=A0=81=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/graduation_tasks_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/graduation_tasks_controller.rb b/app/controllers/graduation_tasks_controller.rb index aa7a0eb11..5e48e0139 100644 --- a/app/controllers/graduation_tasks_controller.rb +++ b/app/controllers/graduation_tasks_controller.rb @@ -230,7 +230,7 @@ class GraduationTasksController < ApplicationController o end - filename = "#{@task.name}_#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}.json" + 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 From 9540b348ddb0057ce52b979c45b192cfed6657db Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Tue, 7 Jan 2020 15:24:13 +0800 Subject: [PATCH 18/33] add knowledge --- .../developer/components/knowledge/index.js | 16 ++++--- .../newOrEditTask/leftpane/editorTab/index.js | 33 +++++++++---- public/react/src/redux/actions/index.js | 4 +- public/react/src/redux/actions/ojForUser.js | 6 +-- public/react/src/redux/actions/ojForm.js | 46 +++++++++++++++++-- .../react/src/redux/reducers/commonReducer.js | 6 +-- public/react/src/services/ojService.js | 9 ++-- 7 files changed, 92 insertions(+), 28 deletions(-) diff --git a/public/react/src/modules/developer/components/knowledge/index.js b/public/react/src/modules/developer/components/knowledge/index.js index ccbf0719b..f443e4975 100644 --- a/public/react/src/modules/developer/components/knowledge/index.js +++ b/public/react/src/modules/developer/components/knowledge/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-12-30 13:51:19 * @LastEditors : tangjiang - * @LastEditTime : 2020-01-07 14:19:39 + * @LastEditTime : 2020-01-07 15:04:51 */ import './index.scss'; import React, { useState, useEffect } from 'react'; @@ -18,7 +18,9 @@ function KnowLedge (props) { options = [], // 下拉选项 values = [], // 已选择的下拉项 onChange, // 获取选择的值 - form + form, + showAdd, // 显示新增图标 + addKnowledge // 调用新增知识点接口 } = props; useEffect(() => { @@ -135,12 +137,14 @@ function KnowLedge (props) { return; } setVisible(false); - console.log(values); + form.resetFields(); + // console.log(values); + addKnowledge && addKnowledge(values); }) } const _styles = { - display: selectOptions.length > 0 || selectValue.length > 0 ? 'inline-block' : 'none' + display: showAdd ? 'inline-block' : 'none' }; return ( @@ -149,11 +153,11 @@ function KnowLedge (props) { { renderSelect(selectOptions) } {/* 渲染下拉选择项 */}
- {/* */} + > { renderResult(selectValue) }
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 f8b92361b..02d953afd 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:21:19 */ 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,7 @@ class EditTab extends React.Component { } render () { + const { showAdd } = this.state; const { ojForm, ojFormValidate, @@ -177,9 +181,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 +326,7 @@ class EditTab extends React.Component { } }); - console.log(choid_ids); + // 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 (
@@ -383,10 +397,12 @@ class EditTab extends React.Component { className='input_area flex_100' 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/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..718aad09f 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 14:45:52 */ 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"; @@ -523,4 +523,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 6d2da50a3..097b2a6af 100644 --- a/public/react/src/redux/actions/ojForm.js +++ b/public/react/src/redux/actions/ojForm.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-20 16:35:46 * @LastEditors : tangjiang - * @LastEditTime : 2020-01-03 16:40:54 + * @LastEditTime : 2020-01-07 14:58:05 */ import types from './actionTypes'; import CONST from '../../constants'; @@ -13,7 +13,8 @@ import { fetchGetOjById, publishTask, cancelPublicTask, - fetchQuestion + fetchQuestion, + fetchTagDisciplines } from '../../services/ojService'; import { Base64 } from 'js-base64'; import { notification } from 'antd'; @@ -675,14 +676,32 @@ export const updateOpenTestCaseIndex = (value) => { // 获取课程题库 export const getQuestion = (params) => { - return (dispatch) => { + return (dispatch, getState) => { + const {ojForm: {sub_discipline_id}} = getState().ojFormReducer; fetchQuestion(params).then(res => { const { data = {} } = res; const { disciplines = [] } = data; dispatch({ type: types.GET_COURSE_QUESTION, payload: disciplines - }) + }); + // 如果课程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 + }) + } }) } } @@ -710,3 +729,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 62ebf9dbb..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 : 2020-01-07 14:19:24 + * @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 }); } @@ -151,4 +151,7 @@ export async function fetchQuestion (params) { } // 新增选题 -export async function fetchExaminationItems () {} \ No newline at end of file +export async function fetchTagDisciplines (params) { + const url = `/tag_disciplines.json`; + return axios.post(url, params); +} \ No newline at end of file From c4655fc48e23685baecd45b7342e12b09b4ae8b2 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 7 Jan 2020 15:28:44 +0800 Subject: [PATCH 19/33] =?UTF-8?q?sonar=E4=BB=A3=E7=A0=81=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/graduation_tasks_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/graduation_tasks_controller.rb b/app/controllers/graduation_tasks_controller.rb index 5e48e0139..117989247 100644 --- a/app/controllers/graduation_tasks_controller.rb +++ b/app/controllers/graduation_tasks_controller.rb @@ -225,7 +225,7 @@ class GraduationTasksController < ApplicationController } attachment = work.attachments.last if attachment - o[:downloadUrl] = "https://#{Setting.host_name}/"+download_url(attachment) + o[:downloadUrl] = "https://#{edu_setting('host_name')}/"+download_url(attachment) end o From 03888e835700b2253d7f73a53b4cfc246f39c87c Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 7 Jan 2020 15:40:22 +0800 Subject: [PATCH 20/33] 1 --- app/controllers/courses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 52911e905..33c4226c2 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 From 8776449234ce9c2f9f323109e55206f0a366ac04 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 7 Jan 2020 15:41:46 +0800 Subject: [PATCH 21/33] =?UTF-8?q?=E9=A2=98=E5=BA=93=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E6=8E=A7=E5=88=B6=E5=9C=A8300=E4=BB=A5?= =?UTF-8?q?=E5=86=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/forms/item_banks/save_item_form.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/forms/item_banks/save_item_form.rb b/app/forms/item_banks/save_item_form.rb index 2bfd99fc3..7e788067e 100644 --- a/app/forms/item_banks/save_item_form.rb +++ b/app/forms/item_banks/save_item_form.rb @@ -27,7 +27,7 @@ class ItemBanks::SaveItemForm attr_accessor :choice_text, :is_answer - validates :choice_text, presence: true, length: { maximum: 100 } + validates :choice_text, presence: true, length: { maximum: 300 } validates :is_answer, presence: true, inclusion: {in: 0..1}, numericality: { only_integer: true } end end \ No newline at end of file From 3104cb2ddaa3ca0e662e63b3287a9874a3b38399 Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Tue, 7 Jan 2020 15:48:22 +0800 Subject: [PATCH 22/33] 50 -> 5 --- .../src/modules/developer/components/knowledge/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/developer/components/knowledge/index.js b/public/react/src/modules/developer/components/knowledge/index.js index f443e4975..9598037ab 100644 --- a/public/react/src/modules/developer/components/knowledge/index.js +++ b/public/react/src/modules/developer/components/knowledge/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-12-30 13:51:19 * @LastEditors : tangjiang - * @LastEditTime : 2020-01-07 15:04:51 + * @LastEditTime : 2020-01-07 15:46:24 */ import './index.scss'; import React, { useState, useEffect } from 'react'; @@ -64,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; } From 5e0907195544c004751a57dd1adc9ae7f94186dc Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 7 Jan 2020 15:52:25 +0800 Subject: [PATCH 23/33] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=97=B6=E6=92=A4=E9=94=80=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/examination_banks_controller.rb | 11 ++++++++++- app/controllers/item_banks_controller.rb | 3 ++- config/routes.rb | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/controllers/examination_banks_controller.rb b/app/controllers/examination_banks_controller.rb index ef545e06e..9ffbd6630 100644 --- a/app/controllers/examination_banks_controller.rb +++ b/app/controllers/examination_banks_controller.rb @@ -2,7 +2,7 @@ class ExaminationBanksController < ApplicationController include PaginateHelper before_action :require_login before_action :find_exam, except: [:index, :create] - before_action :edit_auth, only: [:update, :destroy, :set_public] + before_action :edit_auth, only: [:update, :destroy, :set_public, :revoke_item] def index exams = ExaminationBankQuery.call(params) @@ -62,6 +62,15 @@ class ExaminationBanksController < ApplicationController render_ok end + def revoke_item + item = @exam.examination_items.find_by!(item_bank_id: params[:item_id]) + ActiveRecord::Base.transaction do + @exam.examination_items.where(item_type: item.item_type).where("position > #{item.position}").update_all("position = position -1") + item.destroy! + end + render_ok + end + private def form_params diff --git a/app/controllers/item_banks_controller.rb b/app/controllers/item_banks_controller.rb index 8b77e3e9a..24d9c44a9 100644 --- a/app/controllers/item_banks_controller.rb +++ b/app/controllers/item_banks_controller.rb @@ -8,7 +8,8 @@ class ItemBanksController < ApplicationController items = ItemBankQuery.call(params) @items_count = items.size @items = paginate items.includes(:item_analysis, :user, :container) - @item_basket_ids = current_user.item_baskets.pluck(:item_bank_id) + exam = ExaminationBank.find_by(id: params[:exam_id]) if params[:exam_id].present? + @item_basket_ids = exam ? exam.examination_items.pluck(:item_bank_id) : current_user.item_baskets.pluck(:item_bank_id) end def create diff --git a/config/routes.rb b/config/routes.rb index a65a7f4c1..065d12099 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -80,6 +80,7 @@ Rails.application.routes.draw do resources :examination_banks do member do post :set_public + delete :revoke_item end end From 25a22d24a531442978017d36d78e89d66f17f00b Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 7 Jan 2020 16:12:39 +0800 Subject: [PATCH 24/33] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=9F=A5=E8=AF=86?= =?UTF-8?q?=E7=82=B9=E7=9A=84check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/tag_disciplines_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/tag_disciplines_controller.rb b/app/controllers/tag_disciplines_controller.rb index 2650f51eb..afc2dfa19 100644 --- a/app/controllers/tag_disciplines_controller.rb +++ b/app/controllers/tag_disciplines_controller.rb @@ -2,7 +2,10 @@ class TagDisciplinesController < ApplicationController before_action :require_login def create + render_error("请输入知识点") if params[:name].blank? + render_error("输入字符长度限制在15个以内") if params[:name].length > 15 sub_discipline = SubDiscipline.find_by!(id: params[:sub_discipline_id]) + render_error("重复的知识点") if sub_discipline.tag_disciplines.exists?(name: params[:name].to_s.strip) tag_discipline = TagDiscipline.create!(name: params[:name].to_s.strip, sub_discipline: sub_discipline, user_id: current_user.id) render_ok({tag_discipline_id: tag_discipline.id}) end From db6062b0c4286f0a547d68878fbacad53d89865c Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 7 Jan 2020 16:14:15 +0800 Subject: [PATCH 25/33] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=9F=A5=E8=AF=86?= =?UTF-8?q?=E7=82=B9=E7=9A=84check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/tag_disciplines_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/tag_disciplines_controller.rb b/app/controllers/tag_disciplines_controller.rb index afc2dfa19..c978762ad 100644 --- a/app/controllers/tag_disciplines_controller.rb +++ b/app/controllers/tag_disciplines_controller.rb @@ -2,10 +2,10 @@ class TagDisciplinesController < ApplicationController before_action :require_login def create - render_error("请输入知识点") if params[:name].blank? - render_error("输入字符长度限制在15个以内") if params[:name].length > 15 + tip_exception("请输入知识点") if params[:name].blank? + tip_exception("输入字符长度限制在15个以内") if params[:name].length > 15 sub_discipline = SubDiscipline.find_by!(id: params[:sub_discipline_id]) - render_error("重复的知识点") if sub_discipline.tag_disciplines.exists?(name: params[:name].to_s.strip) + tip_exception("重复的知识点") if sub_discipline.tag_disciplines.exists?(name: params[:name].to_s.strip) tag_discipline = TagDiscipline.create!(name: params[:name].to_s.strip, sub_discipline: sub_discipline, user_id: current_user.id) render_ok({tag_discipline_id: tag_discipline.id}) end From 7cd8a6eeb8eac49100301941d9925390a2bbd375 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 7 Jan 2020 16:18:39 +0800 Subject: [PATCH 26/33] =?UTF-8?q?=E9=83=A8=E9=97=A8=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E8=B6=85=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admins/departments/shared/_department_item.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 %> From 30390ddfba100ddb6823436dc22adf9e2e3f8d70 Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Tue, 7 Jan 2020 16:41:09 +0800 Subject: [PATCH 27/33] encode submit code --- public/react/src/redux/actions/ojForUser.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/react/src/redux/actions/ojForUser.js b/public/react/src/redux/actions/ojForUser.js index 718aad09f..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-07 14:45:52 + * @LastEditTime : 2020-01-07 16:21:53 */ import types from "./actionTypes"; import { Base64 } from 'js-base64'; @@ -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 需要优化 From a15a2f51c7064c9f3ef582c515f0b5b11aee4d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 7 Jan 2020 16:41:44 +0800 Subject: [PATCH 28/33] =?UTF-8?q?=E9=A2=98=E5=BA=93=20=E7=BB=A7=E7=BB=AD?= =?UTF-8?q?=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/question/NewMyShixunModel.js | 919 ++++++++++++++++++ .../modules/question/component/Contentpart.js | 2 +- .../modules/question/component/Listjihe.js | 19 +- .../question/questioncss/questioncom.css | 14 + .../modules/testpaper/Paperlibraryeditid.js | 45 +- .../testpaper/component/Seeoagertits.js | 2 +- public/react/src/modules/tpm/NewHeader.js | 22 +- 7 files changed, 997 insertions(+), 26 deletions(-) create mode 100644 public/react/src/modules/question/NewMyShixunModel.js diff --git a/public/react/src/modules/question/NewMyShixunModel.js b/public/react/src/modules/question/NewMyShixunModel.js new file mode 100644 index 000000000..e8acf2202 --- /dev/null +++ b/public/react/src/modules/question/NewMyShixunModel.js @@ -0,0 +1,919 @@ +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, + exam_id: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, + exam_id: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, + exam_id: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, + exam_id: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, + exam_id: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, + exam_id: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, + exam_id: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, + exam_id: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, + exam_id: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, + exam_id: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, + exam_id: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="/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, + exam_id:this.props.exam_id + }; + this.getdatasy(data); + this.getbasket_listdata(); + // this.setState({ + // visible:true + // }) + } + }).catch((error) => { + //console.log(error); + }) + } + // 撤销 + getitem_basketss=(id)=>{ + //选用题型可以上传单个 或者多个题型 + let url=`/examination_banks/${id}/revoke_item.json`; + + axios.delete(url,{ data: { + item_id: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, + exam_id: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, + exam_id: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, + exam_id: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, + exam_id: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/component/Contentpart.js b/public/react/src/modules/question/component/Contentpart.js index 6cca91f93..ee5b49e6b 100644 --- a/public/react/src/modules/question/component/Contentpart.js +++ b/public/react/src/modules/question/component/Contentpart.js @@ -132,7 +132,7 @@ class Contentpart extends Component { } .xaxisreverseorder .ant-input-lg { - height: 41px;} + height: 41px !important;} .xaxisreverseorder .ant-popover{ top: 30px !important; diff --git a/public/react/src/modules/question/component/Listjihe.js b/public/react/src/modules/question/component/Listjihe.js index 0b1f012f5..986e6e08f 100644 --- a/public/react/src/modules/question/component/Listjihe.js +++ b/public/react/src/modules/question/component/Listjihe.js @@ -37,9 +37,18 @@ class Listjihe extends Component { //选用 Selectingpracticaltraining=(id)=>{ - let data={ - item_ids:[id] - } + let data={} + if(this.props.exam_id===undefined){ + data={ + item_ids:[id] + } + }else{ + data={ + item_ids:[id], + exam_id:this.props.exam_id + } + } + this.props.getitem_baskets(data); } //撤销 @@ -184,8 +193,8 @@ class Listjihe extends Component { { items.choosed===true?

this.Selectingpracticaltrainings(items.id)}> - - 撤销

+ + 撤销

: items.item_type==="PROGRAM"? items.program_attr.status===0? diff --git a/public/react/src/modules/question/questioncss/questioncom.css b/public/react/src/modules/question/questioncss/questioncom.css index 4bf767b0f..c117ce20a 100644 --- a/public/react/src/modules/question/questioncss/questioncom.css +++ b/public/react/src/modules/question/questioncss/questioncom.css @@ -922,3 +922,17 @@ .mr15{ margin-right: 15px; } +.fangdatwo{ + background: #fefefe; + background-color: #fefefe; + height: 100%; + overflow-y: scroll !important; + width: 100%; + margin-top: 60px !important; + position: fixed; + top:0px; + bottom: 0px; + left: 0px; + z-index: 999999; + right: 0px; +} diff --git a/public/react/src/modules/testpaper/Paperlibraryeditid.js b/public/react/src/modules/testpaper/Paperlibraryeditid.js index 1497a12ec..4845ba757 100644 --- a/public/react/src/modules/testpaper/Paperlibraryeditid.js +++ b/public/react/src/modules/testpaper/Paperlibraryeditid.js @@ -22,7 +22,7 @@ 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) { @@ -33,7 +33,8 @@ class Paperlibraryeditid extends Component { disciplinesdata: [], knowledgepoints: [], disciplmy: [], - item_banksedit: [] + item_banksedit: [], + newmyshixunmodelbool:false, } @@ -185,14 +186,39 @@ class Paperlibraryeditid extends Component { this.contentMdRef = Ref; } + setnewmyshixunmodelbool=(bool)=>{ + this.setState({ + newmyshixunmodelbool:bool + }) + } + 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)}> +
+ : + "" + } - {/*
  • */} - {/* */} - {/*
    */} - {/*
    */} - {/* 题库*/} - {/*
    */} - {/*
    */} - {/*
    */} - {/*
  • */} +
  • + +
    +
    + 题库 +
    +
    +
    +
  • Date: Tue, 7 Jan 2020 16:51:48 +0800 Subject: [PATCH 29/33] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 33c4226c2..a59ecb543 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -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}) From 8fa0d0eb7eaad7dffd272bd7fd2485c8834dc61d Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 7 Jan 2020 16:52:44 +0800 Subject: [PATCH 30/33] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index a59ecb543..599a4440c 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1554,7 +1554,7 @@ class CoursesController < ApplicationController end def course_statistics course, max_exp, limit - max_rate = max_exp.nil? || max_exp == 0 ? 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}) From 2dfa4ad632779bf499295f54901a7e68a0ad877d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 7 Jan 2020 16:53:35 +0800 Subject: [PATCH 31/33] ti --- public/react/src/AppConfig.js | 4 +-- .../src/modules/question/NewMyShixunModel.js | 34 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) 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/modules/question/NewMyShixunModel.js b/public/react/src/modules/question/NewMyShixunModel.js index e8acf2202..6c922b037 100644 --- a/public/react/src/modules/question/NewMyShixunModel.js +++ b/public/react/src/modules/question/NewMyShixunModel.js @@ -91,7 +91,7 @@ class NewMyShixunModel extends Component { page: this.state.page, per_page:10, oj_status:null, - exam_id:this.props.exam_id + item_id:parseInt(this.props.exam_id), }; this.getdata(data); @@ -117,7 +117,7 @@ class NewMyShixunModel extends Component { page: 1, per_page:10, oj_status:null, - exam_id:this.props.exam_id + item_id:parseInt(this.props.exam_id), }; this.getdata(data); } @@ -141,7 +141,7 @@ class NewMyShixunModel extends Component { page: 1, per_page:10, oj_status:null, - exam_id:this.props.exam_id + item_id:parseInt(this.props.exam_id), }; this.getdata(data); } @@ -156,7 +156,7 @@ class NewMyShixunModel extends Component { public: defaultActiveKey, page:1, per_page:10, - exam_id:this.props.exam_id + item_id:parseInt(this.props.exam_id), }; this.getdata(data); @@ -209,7 +209,7 @@ class NewMyShixunModel extends Component { page: 1, per_page:10, oj_status:null, - exam_id:this.props.exam_id + item_id:parseInt(this.props.exam_id), }; this.getdata(data); @@ -342,7 +342,7 @@ class NewMyShixunModel extends Component { page: pageNumber, per_page:10, oj_status:this.state.oj_status, - exam_id:this.props.exam_id + item_id:parseInt(this.props.exam_id), }; this.getdata(data); @@ -461,7 +461,7 @@ class NewMyShixunModel extends Component { page:1, per_page:10, oj_status:null, - exam_id:this.props.exam_id + item_id:parseInt(this.props.exam_id), }; this.getdata(data); @@ -488,7 +488,7 @@ class NewMyShixunModel extends Component { per_page:10, keywords:null, oj_status:null, - exam_id:this.props.exam_id + item_id:parseInt(this.props.exam_id), }; this.getdata(data); @@ -543,7 +543,7 @@ class NewMyShixunModel extends Component { page: this.state.page, per_page:10, oj_status:this.state.oj_status, - exam_id:this.props.exam_id + item_id:parseInt(this.props.exam_id), }; this.getdata(data); @@ -567,7 +567,7 @@ class NewMyShixunModel extends Component { keywords: this.state.keywords, page: this.state.page, per_page:10, - exam_id:this.props.exam_id + item_id:parseInt(this.props.exam_id), }; this.getdata(data); } @@ -593,7 +593,7 @@ class NewMyShixunModel extends Component { keywords: this.state.keywords, page: this.state.page, per_page:10, - exam_id:this.props.exam_id + item_id:parseInt(this.props.exam_id), }; this.getdata(data); @@ -655,7 +655,7 @@ class NewMyShixunModel extends Component { keywords: this.state.keywords, page: this.state.page, per_page:10, - exam_id:this.props.exam_id + item_id:parseInt(this.props.exam_id), }; this.getdatasy(data); this.getbasket_listdata(); @@ -673,7 +673,7 @@ class NewMyShixunModel extends Component { let url=`/examination_banks/${id}/revoke_item.json`; axios.delete(url,{ data: { - item_id:this.props.exam_id + item_id:parseInt(this.props.exam_id), }}) .then((result) => { if (result.data.status == 0) { @@ -688,7 +688,7 @@ class NewMyShixunModel extends Component { keywords: this.state.keywords, page: this.state.page, per_page:10, - exam_id:this.props.exam_id + item_id:parseInt(this.props.exam_id), }; this.getdatasy(data); this.getbasket_listdata(); @@ -729,7 +729,7 @@ class NewMyShixunModel extends Component { } const data={ item_ids:item_idsdata, - exam_id:this.props.exam_id + item_id:parseInt(this.props.exam_id), } this.getitem_baskets(data); this.setState({ @@ -758,7 +758,7 @@ class NewMyShixunModel extends Component { keywords: this.state.keywords, page: this.state.page, per_page:10, - exam_id:this.props.exam_id + item_id:parseInt(this.props.exam_id), }; this.getdata(data); this.getbasket_listdata(); @@ -796,7 +796,7 @@ class NewMyShixunModel extends Component { page: this.state.page, per_page:10, oj_status:oj_status, - exam_id:this.props.exam_id + item_id:parseInt(this.props.exam_id), }; this.getdata(data); } From 2ec66eb9450ed461cb30022881573fcf43413e60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 7 Jan 2020 17:30:40 +0800 Subject: [PATCH 32/33] tiku --- .../src/modules/question/NewMyShixunModel.js | 50 +++++++++++-------- .../react/src/modules/question/Paperreview.js | 41 +++++++++++++-- .../src/modules/question/Paperreview_item.js | 2 +- .../modules/question/component/Listjihe.js | 2 +- .../modules/testpaper/Paperlibraryeditid.js | 16 +++++- 5 files changed, 84 insertions(+), 27 deletions(-) diff --git a/public/react/src/modules/question/NewMyShixunModel.js b/public/react/src/modules/question/NewMyShixunModel.js index 6c922b037..9db5d242f 100644 --- a/public/react/src/modules/question/NewMyShixunModel.js +++ b/public/react/src/modules/question/NewMyShixunModel.js @@ -91,7 +91,7 @@ class NewMyShixunModel extends Component { page: this.state.page, per_page:10, oj_status:null, - item_id:parseInt(this.props.exam_id), + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); @@ -117,7 +117,7 @@ class NewMyShixunModel extends Component { page: 1, per_page:10, oj_status:null, - item_id:parseInt(this.props.exam_id), + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); } @@ -141,7 +141,7 @@ class NewMyShixunModel extends Component { page: 1, per_page:10, oj_status:null, - item_id:parseInt(this.props.exam_id), + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); } @@ -156,7 +156,7 @@ class NewMyShixunModel extends Component { public: defaultActiveKey, page:1, per_page:10, - item_id:parseInt(this.props.exam_id), + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); @@ -209,7 +209,7 @@ class NewMyShixunModel extends Component { page: 1, per_page:10, oj_status:null, - item_id:parseInt(this.props.exam_id), + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); @@ -342,7 +342,7 @@ class NewMyShixunModel extends Component { page: pageNumber, per_page:10, oj_status:this.state.oj_status, - item_id:parseInt(this.props.exam_id), + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); @@ -461,7 +461,7 @@ class NewMyShixunModel extends Component { page:1, per_page:10, oj_status:null, - item_id:parseInt(this.props.exam_id), + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); @@ -488,7 +488,7 @@ class NewMyShixunModel extends Component { per_page:10, keywords:null, oj_status:null, - item_id:parseInt(this.props.exam_id), + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); @@ -543,7 +543,7 @@ class NewMyShixunModel extends Component { page: this.state.page, per_page:10, oj_status:this.state.oj_status, - item_id:parseInt(this.props.exam_id), + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); @@ -567,7 +567,7 @@ class NewMyShixunModel extends Component { keywords: this.state.keywords, page: this.state.page, per_page:10, - item_id:parseInt(this.props.exam_id), + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); } @@ -593,7 +593,7 @@ class NewMyShixunModel extends Component { keywords: this.state.keywords, page: this.state.page, per_page:10, - item_id:parseInt(this.props.exam_id), + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); @@ -639,7 +639,13 @@ class NewMyShixunModel extends Component { //选用 getitem_baskets=(data)=>{ //选用题型可以上传单个 或者多个题型 - let url="/examination_items.json"; + let url=""; + if(this.props.exam_id===undefined){ + url="/item_baskets.json"; + }else{ + url="/examination_items.json"; + } + axios.post(url, data) .then((result) => { @@ -655,7 +661,7 @@ class NewMyShixunModel extends Component { keywords: this.state.keywords, page: this.state.page, per_page:10, - item_id:parseInt(this.props.exam_id), + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdatasy(data); this.getbasket_listdata(); @@ -669,11 +675,15 @@ class NewMyShixunModel extends Component { } // 撤销 getitem_basketss=(id)=>{ - //选用题型可以上传单个 或者多个题型 - let url=`/examination_banks/${id}/revoke_item.json`; + 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:parseInt(this.props.exam_id), + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }}) .then((result) => { if (result.data.status == 0) { @@ -688,7 +698,7 @@ class NewMyShixunModel extends Component { keywords: this.state.keywords, page: this.state.page, per_page:10, - item_id:parseInt(this.props.exam_id), + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdatasy(data); this.getbasket_listdata(); @@ -729,7 +739,7 @@ class NewMyShixunModel extends Component { } const data={ item_ids:item_idsdata, - item_id:parseInt(this.props.exam_id), + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), } this.getitem_baskets(data); this.setState({ @@ -758,7 +768,7 @@ class NewMyShixunModel extends Component { keywords: this.state.keywords, page: this.state.page, per_page:10, - item_id:parseInt(this.props.exam_id), + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); this.getbasket_listdata(); @@ -796,7 +806,7 @@ class NewMyShixunModel extends Component { page: this.state.page, per_page:10, oj_status:oj_status, - item_id:parseInt(this.props.exam_id), + item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), }; this.getdata(data); } diff --git a/public/react/src/modules/question/Paperreview.js b/public/react/src/modules/question/Paperreview.js index 9014ba92b..67495dae3 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,48 @@ 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 + }) + } 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)}> +
    + : + "" + }