Merge branch 'dev_item_bank' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_item_bank

dev_jupyter
cxt 5 years ago
commit f2b75e649a

@ -216,6 +216,7 @@ class GraduationTasksController < ApplicationController
tip_exception(403, "无权限访问") unless current_user.admin_or_business? tip_exception(403, "无权限访问") unless current_user.admin_or_business?
_tasks_list _tasks_list
@work_list = @work_list.where("work_status > 0")
person_list = @work_list.map do |work| person_list = @work_list.map do |work|
o = { o = {
@ -225,7 +226,7 @@ class GraduationTasksController < ApplicationController
} }
attachment = work.attachments.last attachment = work.attachments.last
if attachment if attachment
o[:downloadUrl] = "https://#{edu_setting('host_name')}/"+download_url(attachment) o[:downloadUrl] = "#{edu_setting('host_name')}"+download_url(attachment)
end end
o o

@ -725,8 +725,8 @@ class User < ApplicationRecord
end end
def validate_sensitive_string def validate_sensitive_string
raise("真实姓名包含敏感词汇,请重新输入") unless HarmoniousDictionary.clean?(lastname) raise("真实姓名包含敏感词汇,请重新输入") if lastname && !HarmoniousDictionary.clean?(lastname)
raise("昵称包含敏感词汇,请重新输入") unless HarmoniousDictionary.clean?(nickname) raise("昵称包含敏感词汇,请重新输入") if nickname && !HarmoniousDictionary.clean?(nickname)
end end
def set_laboratory def set_laboratory

@ -3,6 +3,7 @@ json.message "评测完成"
json.data do json.data do
json.(@result, :id, :status, :error_line, :error_msg, json.(@result, :id, :status, :error_line, :error_msg,
:input, :output, :execute_time, :execute_memory) :input, :output, :execute_time, :execute_memory)
json.passed @my_hack.passed
# 提交模式多了一个预计输出 # 提交模式多了一个预计输出
if @mode == "submit" if @mode == "submit"
json.expected_output @result.expected_output json.expected_output @result.expected_output

@ -8,6 +8,7 @@ json.hack do
json.submit_count @hack.submit_num json.submit_count @hack.submit_num
json.notes @my_hack.notes json.notes @my_hack.notes
json.modify_code @modify json.modify_code @modify
json.passed @my_hack.passed
json.comments_count @hack.discusses.count json.comments_count @hack.discusses.count
json.user_praise @hack.praise_treads.select{|pt| pt.user_id == current_user.id}.length > 0 json.user_praise @hack.praise_treads.select{|pt| pt.user_id == current_user.id}.length > 0
end end

@ -10,26 +10,21 @@
李源潮 李源潮
李干成 李干成
戴秉国 戴秉国
黄镇
刘延东 刘延东
刘瑞龙 刘瑞龙
俞正声 俞正声
黄敬
薄熙来 薄熙来
薄一波 薄一波
周小川 周小川
周建南 周建南
温云松 温云松
徐明
江绵康 江绵康
李小鹏 李小鹏
李小琳 李小琳
朱云来 朱云来
让国人愤怒的第二代身份证 让国人愤怒的第二代身份证
第二代身份证
文化大革命 文化大革命
胡海峰 胡海峰
六四
陈良宇 陈良宇
老丁 老丁
莱仕德事件 莱仕德事件
@ -68,11 +63,9 @@ PK黑社会
反华 反华
官商勾结 官商勾结
升达毕业证 升达毕业证
手机复制
戴海静 戴海静
自杀指南 自杀指南
自杀手册 自杀手册
张小平
佳静安定片 佳静安定片
蒙汗药粉 蒙汗药粉
古方迷香 古方迷香
@ -105,7 +98,6 @@ PK黑社会
反政府 反政府
禁书 禁书
特码 特码
成人
国民党 国民党
贪污 贪污
骚妇 骚妇
@ -154,7 +146,6 @@ PK黑社会
AV AV
十八禁 十八禁
性虐待 性虐待
激情
耽美 耽美
金瓶梅 金瓶梅
藏春阁 藏春阁
@ -181,15 +172,13 @@ AV
政府无能 政府无能
九评 九评
十七大代表 十七大代表
办证
暴力拆迁 暴力拆迁
轮暴致死 轮暴致死
人民报
暴力镇压 暴力镇压
高干子弟名单 高干子弟名单
性免费电影 性免费电影
全裸 全裸
偷拍
中共十七大 中共十七大
徐和柴学友 徐和柴学友
修炼之歌 修炼之歌
@ -250,7 +239,6 @@ A集中营
中共特务 中共特务
乙醚 乙醚
党内分裂 党内分裂
新生网
圆明网 圆明网
和平修炼 和平修炼
放下生死 放下生死
@ -303,10 +291,6 @@ A集中营
明慧周刊 明慧周刊
九评共产党 九评共产党
江泽民其人 江泽民其人
秘密文件
机密文件
红头文件
政府文件
破网软件 破网软件
无界浏览 无界浏览
亲共来源 亲共来源
@ -341,7 +325,6 @@ H漫画
香港GHB水 香港GHB水
色空寺 色空寺
周容重 周容重
朱蒙
汕頭頻傳擄童割器官 汕頭頻傳擄童割器官
法輪功 法輪功
六决不 六决不
@ -371,15 +354,12 @@ H漫画
敢坐飞机吗 敢坐飞机吗
韩国身份证 韩国身份证
台湾身份证 台湾身份证
广电总局
学生暴动 学生暴动
镇压学生 镇压学生
广安第二人民医院 广安第二人民医院
山不过来
胡新宇 胡新宇
趙紫陽 趙紫陽
自由亚州 自由亚州
明慧
践踏中国女性 践踏中国女性
拉凳 拉凳
南京大学法学院 南京大学法学院
@ -389,7 +369,6 @@ H漫画
崔英杰 崔英杰
松花江污染 松花江污染
火药制作 火药制作
江氏
第十六次代表 第十六次代表
仁寿警方 仁寿警方
愈快乐愈堕落 愈快乐愈堕落
@ -433,7 +412,6 @@ H漫画
二奶 二奶
2奶 2奶
纪股票市场五卅惨案 纪股票市场五卅惨案
这年头就这样
代开普通发票 代开普通发票
代开商品发票 代开商品发票
代开国税发票 代开国税发票
@ -487,7 +465,6 @@ H漫画
死刑过程 死刑过程
学生与警察 学生与警察
鬼村 鬼村
周容
重题工 重题工
先烈的电电 先烈的电电
身份证生成 身份证生成
@ -509,17 +486,14 @@ H漫画
生成身份证 生成身份证
华国锋 华国锋
叶剑英 叶剑英
陈云
李先念 李先念
汪东兴 汪东兴
韦国清 韦国清
乌兰夫 乌兰夫
方毅
刘伯承 刘伯承
许世友 许世友
纪登奎 纪登奎
苏振华 苏振华
吴德
余秋里 余秋里
张廷发 张廷发
陈永贵 陈永贵
@ -528,15 +502,12 @@ H漫画
聂荣臻 聂荣臻
倪志福 倪志福
徐向前 徐向前
彭冲
王震
邓颖超 邓颖超
杨尚昆 杨尚昆
杨得志 杨得志
宋任穷 宋任穷
胡乔木 胡乔木
胡耀邦 胡耀邦
彭真
廖承志 廖承志
秦基伟 秦基伟
陈慕华 陈慕华
@ -549,21 +520,16 @@ H漫画
芮杏文 芮杏文
杨白冰 杨白冰
邹家华 邹家华
谢非
谭绍文 谭绍文
王汉斌 王汉斌
任建新 任建新
于永波 于永波
傅全有 傅全有
吴仪
王克
王乐泉 王乐泉
王兆国 王兆国
刘淇
刘云山 刘云山
张立昌 张立昌
张德江 张德江
王刚
隐形耳机 隐形耳机
隐形摄像头 隐形摄像头
裸聊 裸聊
@ -629,11 +595,7 @@ a级情片
藏独 藏独
曹长青 曹长青
曹刚川 曹刚川
柴玲
常劲
陈炳基 陈炳基
陈军
陈蒙
陈破空 陈破空
陈希同 陈希同
陈小同 陈小同
@ -641,17 +603,13 @@ a级情片
陈一谘 陈一谘
陈总统 陈总统
程铁军 程铁军
程真
迟浩田 迟浩田
持不同政见 持不同政见
赤匪 赤匪
赤化 赤化
达赖 达赖
大参考 大参考
大法
大纪园 大纪园
大家论坛
大史记
大史纪 大史纪
戴相龙 戴相龙
弹劾 弹劾
@ -663,7 +621,6 @@ a级情片
电视流氓 电视流氓
钓鱼岛 钓鱼岛
丁关根 丁关根
丁元
丁子霖 丁子霖
东北独立 东北独立
东社 东社
@ -702,7 +659,6 @@ a级情片
炼功 炼功
李总统 李总统
李登辉 李登辉
李鹏
李瑞环 李瑞环
吐血 吐血
18禁 18禁
@ -828,7 +784,6 @@ A片
薄格 薄格
調教 調教
乱伦 乱伦
偷拍
更衣 更衣
無修正 無修正
虐待 虐待
@ -854,16 +809,12 @@ A片
伊東 伊東
武藤蘭 武藤蘭
叶子楣 叶子楣
舒淇
麻衣
櫻井 櫻井
風花 風花
星野桃 星野桃
宝来
桜田 桜田
藤井彩 藤井彩
小森美王 小森美王
平井
桃井望 桃井望
榊彩弥 榊彩弥
桜井 桜井
@ -876,7 +827,6 @@ A片
長瀬愛 長瀬愛
中野千夏 中野千夏
春菜 春菜
望月
岡崎美女 岡崎美女
宮下杏奈 宮下杏奈
加藤 加藤
@ -884,24 +834,12 @@ A片
北島優 北島優
一本道 一本道
夜勤病栋 夜勤病栋
三个代表
一党
多党
民主
专政
避孕套 避孕套
你妈逼 你妈逼
大鸡巴 大鸡巴
政治 政治
洪志
红志
洪智
红智
民运
王丹
卖春 卖春
买春 买春
天安门
朱容基 朱容基
朱镕基 朱镕基
温家宝 温家宝
@ -915,14 +853,12 @@ A片
黑社会 黑社会
夜总会 夜总会
妈个 妈个
公款
坐台 坐台
腐败 腐败
城管 城管
暴动 暴动
李远哲 李远哲
司法警官 司法警官
高干
尉健行 尉健行
李岚清 李岚清
黄丽满 黄丽满
@ -938,19 +874,10 @@ A片
吴邦国 吴邦国
曾庆红 曾庆红
黄菊 黄菊
罗干
吴官正 吴官正
贾庆林 贾庆林
专制 专制
三個代表
一黨
多黨
專政
大紀元 大紀元
紅志
紅智
李鵬
天安門
江澤民 江澤民
朱鎔基 朱鎔基
李長春 李長春
@ -963,9 +890,7 @@ A片
溫家寶 溫家寶
吳邦國 吳邦國
曾慶紅 曾慶紅
黃菊
賈慶林 賈慶林
專制
反人类 反人类
反社会 反社会
方励之 方励之
@ -984,12 +909,10 @@ A片
付申奇 付申奇
傅申奇 傅申奇
傅志寰 傅志寰
高官
高文谦 高文谦
高薪养廉 高薪养廉
高瞻 高瞻
高自联 高自联
戈扬
鸽派 鸽派
个人崇拜 个人崇拜
工自联 工自联
@ -1000,10 +923,8 @@ A片
共军 共军
关卓中 关卓中
贯通两极法 贯通两极法
广闻
郭伯雄 郭伯雄
郭罗基 郭罗基
郭平
郭岩华 郭岩华
国家安全 国家安全
国家机密 国家机密
@ -1017,13 +938,11 @@ A片
红色恐怖 红色恐怖
宏法 宏法
洪传 洪传
洪吟
洪哲胜 洪哲胜
胡紧掏 胡紧掏
胡锦滔 胡锦滔
胡锦淘 胡锦淘
胡景涛 胡景涛
胡平
胡总书记 胡总书记
护法 护法
花花公子 花花公子
@ -1046,9 +965,7 @@ A片
江core 江core
江八点 江八点
江流氓 江流氓
江罗
江绵恒 江绵恒
江青
江戏子 江戏子
江则民 江则民
江泽慧 江泽慧
@ -1064,9 +981,7 @@ A片
教养院 教养院
揭批书 揭批书
金尧如 金尧如
锦涛
禁看 禁看
经文
开放杂志 开放杂志
抗议 抗议
邝锦文 邝锦文
@ -1079,8 +994,6 @@ A片
李洪宽 李洪宽
李继耐 李继耐
李兰菊 李兰菊
李录
李禄
李少民 李少民
李淑娴 李淑娴
李旺阳 李旺阳
@ -1099,16 +1012,13 @@ A片
林长盛 林长盛
林樵清 林樵清
林慎立 林慎立
凌锋
刘宾深 刘宾深
刘宾雁 刘宾雁
刘刚
刘国凯 刘国凯
刘华清 刘华清
刘俊国 刘俊国
刘凯中 刘凯中
刘千石 刘千石
刘青
刘山青 刘山青
刘士贤 刘士贤
刘文胜 刘文胜
@ -1153,17 +1063,12 @@ A片
潘国平 潘国平
泡沫经济 泡沫经济
迫害 迫害
祁建
齐墨
钱达
钱国梁 钱国梁
钱其琛 钱其琛
抢粮记 抢粮记
乔石
亲美 亲美
钦本立 钦本立
情妇 情妇
庆红
热比娅 热比娅
热站政论网 热站政论网
人民内情真相 人民内情真相
@ -1174,11 +1079,8 @@ A片
上海帮 上海帮
邵家健 邵家健
神通加持法 神通加持法
沈彤
升天 升天
盛华仁 盛华仁
盛雪
石戈
时代论坛 时代论坛
时事论坛 时事论坛
世界经济导报 世界经济导报
@ -1191,7 +1093,6 @@ A片
司徒华 司徒华
斯诺 斯诺
四川独立 四川独立
宋平
宋书元 宋书元
苏绍智 苏绍智
苏晓康 苏晓康
@ -1204,11 +1105,9 @@ A片
太子党 太子党
汤光中 汤光中
唐柏桥 唐柏桥
唐捷
滕文生 滕文生
天怒 天怒
天葬 天葬
童屹
统独 统独
统独论坛 统独论坛
统战 统战
@ -1216,10 +1115,8 @@ A片
外交与方略 外交与方略
万润南 万润南
万晓东 万晓东
汪岷
王宝森 王宝森
王炳章 王炳章
王策
王超华 王超华
王辅臣 王辅臣
王涵万 王涵万
@ -1246,11 +1143,9 @@ A片
吴学璨 吴学璨
吾尔开希 吾尔开希
五不 五不
伍凡
洗脑 洗脑
项怀诚 项怀诚
项小吉 项小吉
肖强
邪恶 邪恶
谢长廷 谢长廷
谢选骏 谢选骏
@ -1269,10 +1164,7 @@ A片
徐匡迪 徐匡迪
徐水良 徐水良
许家屯 许家屯
薛伟
学潮 学潮
学联
学运
学自联 学自联
雪山狮子 雪山狮子
严家其 严家其
@ -1282,13 +1174,9 @@ A片
央视内部晚会 央视内部晚会
杨怀安 杨怀安
杨建利 杨建利
杨巍
杨月清 杨月清
杨周
姚月谦 姚月谦
一中一台 一中一台
义解
亦凡
异见人士 异见人士
异议人士 异议人士
易丹轩 易丹轩
@ -1296,38 +1184,27 @@ A片
尹庆民 尹庆民
由喜贵 由喜贵
游行 游行
幼齿
于大海 于大海
于浩成 于浩成
余英时 余英时
舆论反制 舆论反制
宇明网 宇明网
远志明 远志明
岳武
则民
择民
泽民
贼民 贼民
曾培炎 曾培炎
张伯笠 张伯笠
张钢
张宏堡 张宏堡
张健
张林
张万年 张万年
张伟国 张伟国
张昭富 张昭富
张志清 张志清
赵海青 赵海青
赵南
赵品潞 赵品潞
赵晓微 赵晓微
赵紫阳 赵紫阳
哲民
镇压 镇压
争鸣论坛 争鸣论坛
正见网 正见网
郑义
正义党论坛 正义党论坛
换妻 换妻
真木加美 真木加美
@ -1350,12 +1227,9 @@ A片
东京热 东京热
菅野亚梨沙 菅野亚梨沙
吉岡美穗 吉岡美穗
红音
原千寻 原千寻
熟女 熟女
轮奸 轮奸
朱琳
朱毛
朱溶剂 朱溶剂
猪聋畸 猪聋畸
猪毛 猪毛
@ -1373,7 +1247,6 @@ A片
fa轮 fa轮
亲日 亲日
汉奸 汉奸
政权
政治反对派 政治反对派
政治犯 政治犯
支那 支那
@ -1392,9 +1265,7 @@ fa轮
周锋锁 周锋锁
周天法 周天法
陈水扁 陈水扁
周旋
朱嘉明 朱嘉明
阿扁
二逼 二逼
小鸡鸡 小鸡鸡
卖逼 卖逼
@ -1436,7 +1307,6 @@ fa轮
喷你 喷你
操逼 操逼
淫水 淫水
他妈
操比 操比
杂种 杂种
他母亲 他母亲
@ -1499,13 +1369,11 @@ B样
北美自由论坛 北美自由论坛
博讯 博讯
蔡崇国 蔡崇国
程凯
大纪元新闻网 大纪元新闻网
大众真人真事 大众真人真事
东南西北论谈 东南西北论谈
封杀 封杀
何勇
江猪媳 江猪媳
酱猪媳 酱猪媳
枪支 枪支
毒品 毒品

@ -0,0 +1,5 @@
class MigrateZipPackColumn < ActiveRecord::Migration[5.2]
def change
change_column :zip_packs, :pack_size, :float
end
end

@ -30,7 +30,7 @@ const env = getClientEnvironment(publicUrl);
module.exports = { module.exports = {
// You may want 'eval' instead if you prefer to see the compiled output in DevTools. // You may want 'eval' instead if you prefer to see the compiled output in DevTools.
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
//devtool: "cheap-module-eval-source-map", //devtool: "cheap-module-eval-source-map",
// 开启调试 // 开启调试
//devtool: "source-map", // 开启调试 //devtool: "source-map", // 开启调试
// These are the "entry points" to our application. // These are the "entry points" to our application.

@ -386,7 +386,7 @@ label.infolabel{display: block;float: left;width: 56px;text-align: right;margin-
.task-item{margin-top: 30px;padding-bottom: 30px;border-bottom: 1px solid #eee} .task-item{margin-top: 30px;padding-bottom: 30px;border-bottom: 1px solid #eee}
.task-item:last-child{border-bottom: none;} .task-item:last-child{border-bottom: none;}
.challengeNav a.active{color: #4CACFF;} .challengeNav a.active{color: #4CACFF;}
.recomments{margin-bottom: 30px;padding-bottom:30px;margin-top: 30px;border-bottom: 1px solid #eee} .recomments{ margin-bottom: 20px;}
.recomments:first-child{margin-top: 0px;} .recomments:first-child{margin-top: 0px;}
.recomments:last-child{margin-bottom: 0px;border:none;padding-bottom: 0px;} .recomments:last-child{margin-bottom: 0px;border:none;padding-bottom: 0px;}
.url-input{border: none;padding: 0px;font-size: 12px;color:#999;outline: none} .url-input{border: none;padding: 0px;font-size: 12px;color:#999;outline: none}
@ -3496,4 +3496,9 @@ a.singlepublishtwo{
.RightPaneDrawer .jupyter_data_list{ .RightPaneDrawer .jupyter_data_list{
max-height: 340px; max-height: 340px;
} }
.ant-btn-primary{
text-shadow: none !important;
box-shadow: none !important;
}

@ -83,7 +83,7 @@ export function initAxiosInterceptors(props) {
//proxy="http://47.96.87.25:48080" //proxy="http://47.96.87.25:48080"
proxy="https://pre-newweb.educoder.net" proxy="https://pre-newweb.educoder.net"
proxy="https://test-newweb.educoder.net" proxy="https://test-newweb.educoder.net"
// proxy="https://test-jupyterweb.educoder.net" //proxy="https://test-jupyterweb.educoder.net"
//proxy="http://192.168.2.63:3001" //proxy="http://192.168.2.63:3001"
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求 // 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求
@ -149,15 +149,15 @@ export function initAxiosInterceptors(props) {
} }
// //
// console.log(config); // console.log(config);
// if (config.method === "post") { if (config.method === "post") {
// if (requestMap[config.url] === true) { // 避免重复的请求 导致页面f5刷新 也会被阻止 显示这个方法会影响到定制信息 if (requestMap[config.url] === true) { // 避免重复的请求 导致页面f5刷新 也会被阻止 显示这个方法会影响到定制信息
// // console.log(config); // console.log(config);
// // console.log(JSON.parse(config)); // console.log(JSON.parse(config));
// // console.log(config.url); // console.log(config.url);
// // console.log("被阻止了是重复请求================================="); // console.log("被阻止了是重复请求=================================");
// return false; return false;
// } }
// } }
// 非file_update请求 // 非file_update请求
if (config.url.indexOf('update_file') === -1) { if (config.url.indexOf('update_file') === -1) {
requestMap[config.url] = true; requestMap[config.url] = true;

@ -100,22 +100,31 @@ export function getUploadActionUrl(path, goTest) {
let anewopens=md5(newopens+newtimestamp); let anewopens=md5(newopens+newtimestamp);
return `${getUrl()}/api/attachments.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}`; return `${getUrl()}/api/attachments.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}`;
} }
export function getUploadActionUrltwo(id) { export function getUploadActionUrltwo(id) {
Railsgettimes() Railsgettimes()
let anewopens=md5(newopens+newtimestamp); let anewopens=md5(newopens+newtimestamp);
return `${getUrlmys()}/api/shixuns/${id}/upload_data_sets.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}` return `${getUrlmys()}/api/shixuns/${id}/upload_data_sets.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}`
} }
export function getUploadActionUrlthree() { export function getUploadActionUrlthree() {
Railsgettimes() Railsgettimes()
let anewopens=md5(newopens+newtimestamp); let anewopens=md5(newopens+newtimestamp);
return `${getUrlmys()}/api/jupyters/import_with_tpm.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}` return `${getUrlmys()}/api/jupyters/import_with_tpm.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}`
} }
export function getUploadActionUrlOfAuth(id) { export function getUploadActionUrlOfAuth(id) {
Railsgettimes() Railsgettimes()
let anewopens=md5(newopens+newtimestamp); let anewopens=md5(newopens+newtimestamp);
return `${getUrl()}/api/users/accounts/${id}/auth_attachment.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}` return `${getUrl()}/api/users/accounts/${id}/auth_attachment.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}`
} }
export function getRandomNumber(type) {
Railsgettimes()
let anewopens=md5(newopens+newtimestamp);
return type===true?`randomcode=${newtimestamp}&client_key=${anewopens}`:`?randomcode=${newtimestamp}&client_key=${anewopens}`
}
export function test(path) { export function test(path) {
return `${path}`; return `${path}`;
} }

@ -2,7 +2,7 @@
// export { default as OrderStateUtil } from '../routes/Order/components/OrderStateUtil'; // export { default as OrderStateUtil } from '../routes/Order/components/OrderStateUtil';
export { getImageUrl as getImageUrl, getUrl as getUrl, publicSearchs as publicSearchs,getRandomcode as getRandomcode,getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl export { getImageUrl as getImageUrl, getRandomNumber as getRandomNumber,getUrl as getUrl, publicSearchs as publicSearchs,getRandomcode as getRandomcode,getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl
, getUploadActionUrl as getUploadActionUrl,getUploadActionUrltwo as getUploadActionUrltwo ,getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth , getUploadActionUrl as getUploadActionUrl,getUploadActionUrltwo as getUploadActionUrltwo ,getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth
, getTaskUrlById as getTaskUrlById, TEST_HOST ,htmlEncode as htmlEncode } from './UrlTool'; , getTaskUrlById as getTaskUrlById, TEST_HOST ,htmlEncode as htmlEncode } from './UrlTool';
export { default as queryString } from './UrlTool2'; export { default as queryString } from './UrlTool2';

@ -61,6 +61,7 @@
### 使用 ### 使用
```` ````
编辑模式是放不大图片的
import QuillForEditor from 'xxx'; import QuillForEditor from 'xxx';
// 指定需要显示的工具栏信息, 不指定加载全部 // 指定需要显示的工具栏信息, 不指定加载全部

@ -75,16 +75,21 @@ class BoardsListItem extends Component{
<i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl mt4"></i> <i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl mt4"></i>
</Tooltip>) : "" </Tooltip>) : ""
} }
</h6> </h6>
<div className="fr"> <div className="fr">
{(isAdmin || discussMessage.author.login == current_user.login) &&
<WordsBtn style="blue" className="fl font-16 ml28"
onClick={(e) => { this.props.toEditPage(this.props.match.params.coursesId, this.props.match.params.boardId, discussMessage.id )} }>编辑</WordsBtn> }
{ isAdmin && <WordsBtn style="blue" className="fl font-16 ml28" {(isAdmin || discussMessage.author.login == current_user.login) &&
onClick={(e) => { debugger; onSticky(discussMessage); e.cancelBubble = true; e.stopPropagation();}}> <WordsBtn style="blue" className="fr font-16 ml28"
{ discussMessage.sticky ? '取消置顶' : '置顶' }</WordsBtn> } onClick={(e) => { this.props.toEditPage(this.props.match.params.coursesId, this.props.match.params.boardId, discussMessage.id )} }>编辑</WordsBtn> }
{ isAdmin && <WordsBtn style="blue" className="fr font-16 ml28"
onClick={(e) => { debugger; onSticky(discussMessage); e.cancelBubble = true; e.stopPropagation();}}>
{ discussMessage.sticky ? '取消置顶' : '置顶' }</WordsBtn> }
{canNotLink?"":<WordsBtn style="blue" className="font-16 fr " onClick={canNotLink ? () => {} : () => this.onTitleClick(discussMessage)}>查看详情</WordsBtn>}
</div> </div>
<div className="cl"></div> <div className="cl"></div>
@ -112,14 +117,14 @@ class BoardsListItem extends Component{
</ConditionToolTip> </ConditionToolTip>
</div> </div>
} }
{/* { (isAdmin || discussMessage.author.login == current_user.login) && {/* { (isAdmin || discussMessage.author.login == current_user.login) &&
<div className="homepagePostSetting" style={{"right":"4px","top":"5px","display":"block"}}> <div className="homepagePostSetting" style={{"right":"4px","top":"5px","display":"block"}}>
<ul> <ul>
<li className="edu-position edu-position-hidebox"> <li className="edu-position edu-position-hidebox">
<i className="fa fa-bars color-grey-b"></i> <i className="fa fa-bars color-grey-b"></i>
<ul className="edu-position-hide undis"> <ul className="edu-position-hide undis">
{(isAdmin || discussMessage.author.login == current_user.login) && <li><a href="javascript:void(0)" onClick={(e) => { {(isAdmin || discussMessage.author.login == current_user.login) && <li><a href="javascript:void(0)" onClick={(e) => {
this.props.toEditPage(this.props.match.params.coursesId, this.props.match.params.boardId, discussMessage.id )} } >编辑</a></li> this.props.toEditPage(this.props.match.params.coursesId, this.props.match.params.boardId, discussMessage.id )} } >编辑</a></li>
} }
{isAdmin && <li><a href="javascript:void(0)" onClick={(e) => { debugger; onSticky(discussMessage); e.cancelBubble = true; e.stopPropagation();} }> {isAdmin && <li><a href="javascript:void(0)" onClick={(e) => { debugger; onSticky(discussMessage); e.cancelBubble = true; e.stopPropagation();} }>

@ -216,6 +216,9 @@ class CommonWorkItem extends Component{
{/* item.status.indexOf('匿评申诉中') != -1 ? '匿评申诉剩余时间' : ''}>*/} {/* item.status.indexOf('匿评申诉中') != -1 ? '匿评申诉剩余时间' : ''}>*/}
{/*</Tooltip>*/} {/*</Tooltip>*/}
{isAdmin && <div className="fr"> {isAdmin && <div className="fr">
<WordsBtn style="blue" className={"fl font-16 ml28"}
onClick={ canNotLink ? () => {} : () => this.onItemClick(item)}
>查看详情</WordsBtn>
<WordsBtn style="blue" className="fl font-16 ml28" onClick={ () => { this.props.toEditPage(this.props.match.params, item.homework_id) }}>编辑</WordsBtn> <WordsBtn style="blue" className="fl font-16 ml28" onClick={ () => { this.props.toEditPage(this.props.match.params, item.homework_id) }}>编辑</WordsBtn>
<WordsBtn style="blue" className="fl font-16 ml28" onClick={ () => { this.props.toWorkSettingPage(this.props.match.params, item.homework_id) }}>设置</WordsBtn> <WordsBtn style="blue" className="fl font-16 ml28" onClick={ () => { this.props.toWorkSettingPage(this.props.match.params, item.homework_id) }}>设置</WordsBtn>
</div>} </div>}
@ -224,6 +227,10 @@ class CommonWorkItem extends Component{
// //
isStudent && isStudent &&
<li className="fr"> <li className="fr">
<WordsBtn style="blue" className={"fl font-16"}
onClick={ canNotLink ? () => {} : () => this.onItemClick(item)}
>查看详情</WordsBtn>
{ // { //
item.work_status && item.work_status.indexOf('关联项目') != -1 && item.work_status && item.work_status.indexOf('关联项目') != -1 &&
<React.Fragment> <React.Fragment>
@ -273,6 +280,8 @@ class CommonWorkItem extends Component{
// //
item.work_status && item.work_status.indexOf('查看作品') != -1 && item.work_status && item.work_status.indexOf('查看作品') != -1 &&
<WordsBtn style="blue" className="fl font-16 ml28" onClick={() => this.props.toWorkDetailPage(this.props.match.params, item.homework_id, item.work_id)}>查看作品</WordsBtn> } <WordsBtn style="blue" className="fl font-16 ml28" onClick={() => this.props.toWorkDetailPage(this.props.match.params, item.homework_id, item.work_id)}>查看作品</WordsBtn> }
</li> </li>
} }
</p> </p>

@ -35,8 +35,8 @@ class UseBank extends Component{
} }
} }
componentDidMount() { componentDidMount() {
console.log("UseBank"); // console.log("UseBank");
console.log(this.props); // console.log(this.props);
} }
onCheckBoxChange = (checkBoxValues) => { onCheckBoxChange = (checkBoxValues) => {
@ -190,9 +190,9 @@ class UseBank extends Component{
let { flag, nav_my, loading, hasMore, object_list, search, checkBoxValues,isChecked,page,is_teacher }=this.state let { flag, nav_my, loading, hasMore, object_list, search, checkBoxValues,isChecked,page,is_teacher }=this.state
let { object_type }=this.props; let { object_type }=this.props;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />; const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
console.log("题库选用2222"); // console.log("题库选用2222");
console.log("UseBank"); // console.log("UseBank");
console.log(this.props); // console.log(this.props);
return( return(
<a> <a>
<style>{` <style>{`

@ -218,7 +218,7 @@ class commonWork extends Component{
this.getList(1,search,order); this.getList(1,search,order);
this.props.updataleftNavfun() this.props.updataleftNavfun()
} }
console.log(response)
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}) })
@ -254,7 +254,7 @@ class commonWork extends Component{
let {search,order, page}=this.state; let {search,order, page}=this.state;
this.getList(page,search,order); this.getList(page,search,order);
} }
console.log(response)
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}) })
@ -296,7 +296,7 @@ class commonWork extends Component{
let {search,order}=this.state; let {search,order}=this.state;
this.getList(1,search,order); this.getList(1,search,order);
} }
console.log(response)
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}) })

@ -14,7 +14,7 @@
/* 改宽度 */ /* 改宽度 */
.course-message .panel-comment_item .comment_orig_content { .course-message .panel-comment_item .comment_orig_content {
/* width: 1024px; */ /* width: 1024px; */
width: 1046px; width: 1040px;
} }
/* 子回复按钮 */ /* 子回复按钮 */
.course-message .reply_to_message a.commentsbtn.task-btn-blue { .course-message .reply_to_message a.commentsbtn.task-btn-blue {

@ -531,7 +531,7 @@ class Coursesleftnav extends Component{
if(result!=undefined){ if(result!=undefined){
if(result.data.status===0){ if(result.data.status===0){
// window.location.reload() // window.location.reload()
this.updasaveNavmoda() // this.updasaveNavmoda()
// //
notification.open({ notification.open({
message:"提示", message:"提示",

@ -18,7 +18,7 @@ class NewShixunModel extends Component{
keyword:undefined, keyword:undefined,
order:'desc', order:'desc',
diff:0, diff:0,
limit:15, limit:20,
sort:"myshixuns_count", sort:"myshixuns_count",
belongtoindex:0, belongtoindex:0,
} }
@ -229,9 +229,9 @@ class NewShixunModel extends Component{
status:'all', status:'all',
order:'desc', order:'desc',
diff:0, diff:0,
limit:15, limit:20,
}) })
this.getdatalist(1,undefined,'all',value,'desc',0,15) this.getdatalist(1,undefined,'all',value,'desc',0,20)
} }
showNotification = (description, message = "提示", icon) => { showNotification = (description, message = "提示", icon) => {
@ -692,11 +692,11 @@ class NewShixunModel extends Component{
} }
</Checkbox.Group> </Checkbox.Group>
{shixun_list===undefined||shixuns_count===undefined?"":shixun_list.length===0||shixuns_count===0?"":shixuns_count>15?<div className={" edu-txt-center pd303010 newshixunmodels"}> {shixun_list===undefined||shixuns_count===undefined?"":shixun_list.length===0||shixuns_count===0?"":shixuns_count>20?<div className={" edu-txt-center pd303010 newshixunmodels"}>
<Pagination <Pagination
showQuickJumper showQuickJumper
defaultCurrent={1} defaultCurrent={1}
pageSize={15} pageSize={20}
total={shixuns_count===undefined?"":shixuns_count} total={shixuns_count===undefined?"":shixuns_count}
current={page} current={page}
onChange={this.PaginationCourse} onChange={this.PaginationCourse}

@ -51,8 +51,7 @@ class Startshixuntask extends Component{
}, 1000) }, 1000)
if(response.data.status!=401&&response.data.status!=403){ if(response.data.status!=401&&response.data.status!=403){
const w=window.open('about:blank'); window.open( `/tasks/${response.data.game_identifier}`)
w.location.href= "/tasks/"+response.data.game_identifier
} }
} }

@ -185,8 +185,12 @@ class ExerciseListItem extends Component{
{/*}*/} {/*}*/}
{ IsAdmin &&<div className="homepagePostSetting" style={{"right":"-17px","top":"51px","display":"block","width":"100px"}}>
<Link className="btn colorblue font-16" to={`/courses/${coursesId}/exercises/${item.id}/edit`}>编辑</Link>
{ IsAdmin &&<div className="homepagePostSetting" style={{"right":"-17px","top":"51px","display":"block","width":"200px"}}>
<a className="btn colorblue font-16 ml20" onClick={()=>this.toDetailPage(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>查看详情</a>
<Link className="btn colorblue font-16 ml20" to={`/courses/${coursesId}/exercises/${item.id}/edit`}>编辑</Link>
<Link className="btn colorblue ml20 font-16" to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=3`}>设置</Link> <Link className="btn colorblue ml20 font-16" to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=3`}>设置</Link>
</div> } </div> }
@ -212,11 +216,21 @@ class ExerciseListItem extends Component{
{ {
IsStudent && IsStudent &&
<div className="homepagePostSetting" style={{"right":"0px","top":"62px","position":"absolute","display":"block"}}> <div className="homepagePostSetting" style={{"right":"0px","top":"62px","position":"absolute","display":"block"}}>
{item.current_status ===0&&item.exercise_status>1? <li> <Link className="btn colorblue font-16" to={`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`}>继续答题</Link></li>: <li className={"fl"}> <a className="btn colorblue font-16" onClick={()=>this.toDetailPage(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>查看详情</a></li>
item.current_status ===1&&item.exercise_status>1? <li> <a className="btn colorblue font-16" target="_blank" href={`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`}>查看答题</a></li>: {item.current_status ===0&&item.exercise_status>1? <li className={"fl ml20"}> <Link className="btn colorblue font-16" to={`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`}>继续答题</Link></li>:
item.current_status ===2&&item.exercise_status>1? <li> <a className="btn colorblue ml20 font-16" onClick={()=>this.setgameexercise(`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`)}>开始答题</a></li>:""} item.current_status ===1&&item.exercise_status>1? <li className={"fl ml20"}> <a className="btn colorblue font-16" target="_blank" href={`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`}>查看答题</a></li>:
item.current_status ===2&&item.exercise_status>1? <li className={"fl ml20"}s> <a className="btn colorblue ml20 font-16" onClick={()=>this.setgameexercise(`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`)}>开始答题</a></li>:""}
</div> </div>
} }
{
this.props.isNotMember()? item.lock_status === 0 ?
""
: <div className="homepagePostSetting" style={{"right":"0px","top":"62px","position":"absolute","display":"block"}}>
<li> <a className="btn colorblue font-16" onClick={()=>this.toDetailPage(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>查看详情</a></li>
</div>:""
}
</div> </div>
</div> </div>
) )

@ -8,8 +8,9 @@ import {
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import axios from 'axios' import axios from 'axios'
import update from 'immutability-helper' import update from 'immutability-helper'
import {getUrl, ActionBtn, DMDEditor, ConditionToolTip} from 'educoder'; import {getUrl, ActionBtn, DMDEditor, ConditionToolTip} from 'educoder';
import QuillForEditor from "../../../../common/quillForEditor";
const { TextArea } = Input; const { TextArea } = Input;
const confirm = Modal.confirm; const confirm = Modal.confirm;
const $ = window.$ const $ = window.$
@ -47,6 +48,9 @@ class SingleEditor extends Component{
question_title: this.props.question_title || '', question_title: this.props.question_title || '',
question_type: this.props.question_type || 0, question_type: this.props.question_type || 0,
question_score: this.props.question_score || this.props.init_question_score, question_score: this.props.question_score || this.props.init_question_score,
choice_editor: 'md',
quill_question_title: '',
quill_default_title: ''
} }
} }
addOption = () => { addOption = () => {
@ -205,8 +209,33 @@ class SingleEditor extends Component{
toShowMode = () => { toShowMode = () => {
} }
// 切换编辑器
handleChangeEditor = (e) => {
const {quill_question_title} = this.state;
const value = e.target.value
if (value === 'quill') {
const _val = quill_question_title ? JSON.parse(quill_question_title) : '';
this.setState({
quill_default_title: _val
})
}
this.setState({
choice_editor: value
});
}
// quill编辑器内容变化时调用此接口
handleCtxChange = (ctx) => {
console.log('编辑器内容', ctx);
// 保存编辑器内容
this.setState({
quill_question_title: JSON.stringify(ctx)
});
}
render() { render() {
let { question_title, question_score, question_type, question_choices, standard_answers } = this.state; let { question_title, question_score, question_type, question_choices, standard_answers, choice_editor, quill_default_title } = this.state;
let { question_id, index, exerciseIsPublish, let { question_id, index, exerciseIsPublish,
// question_title, // question_title,
// question_type, // question_type,
@ -245,18 +274,51 @@ class SingleEditor extends Component{
max-width: 1056px; max-width: 1056px;
word-break:break-all; word-break:break-all;
} }
.editor_area{
display: inline-block;
float: right;
// line-height: 30px;
// height: 30px;
}
.editor_txt{
margin-right: 10px;
font-size: 12px;
color: #999;
}
.radio_style{
display: inline-block;
vertical: center;
}
`}</style> `}</style>
<p className="mb10 clearfix"> <p className="mb10 clearfix">
{/* {!question_id ? '新建' : '编辑'} */} {/* {!question_id ? '新建' : '编辑'} */}
<span className="color-blue font-16 mr20 fl">选择题</span> <span className="color-blue font-16 mr20 fl">选择题</span>
<span className="color-grey-9 font-12 fl">客观题由系统自动评分请设置标准答案</span> <span className="color-grey-9 font-12 fl">客观题由系统自动评分请设置标准答案</span>
{/* <Switch checkedChildren="MD" unCheckedChildren="Quill"></Switch> */}
{/* <div className="editor_area">
<span className="editor_txt">切换编辑器:</span>
<Radio.Group style={{ float: 'right' }} value={choice_editor} onChange={this.handleChangeEditor}>
<Radio className="radio_style" value={'md'}>MD</Radio>
<Radio className="radio_style" value={'quill'}>Quill</Radio>
</Radio.Group>
</div> */}
</p> </p>
<TPMMDEditor mdID={qNumber} placeholder="请您输入题目" height={155} className="mb20" {choice_editor === 'md'
initValue={question_title} onChange={(val) => this.setState({ question_title: val})} ? <TPMMDEditor mdID={qNumber} placeholder="请您输入题目" height={155} className="mb20"
ref="titleEditor" initValue={question_title} onChange={(val) => this.setState({ question_title: val})}
ref="titleEditor"
></TPMMDEditor>
></TPMMDEditor> : <QuillForEditor
wrapStyle={{ marginBottom: '35px' }}
style={{ height: '109px' }}
options={['code', 'image', 'formula']}
placeholder="请您输入题目"
value={quill_default_title}
onContentChange={this.handleCtxChange}
></QuillForEditor>
}
{question_choices.map( (item, index) => { {question_choices.map( (item, index) => {
const bg = standard_answers[index] ? 'check-option-bg' : '' const bg = standard_answers[index] ? 'check-option-bg' : ''

@ -300,12 +300,19 @@ class GraduateTaskItem extends Component{
{this.props.isAdmin? {this.props.isAdmin?
<div className="mt13"> <div className="mt13">
<WordsBtn style="blue" to={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/setting"} className="colorblue font-16 mrf4 fr"> <WordsBtn style="blue" to={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/setting"} className="colorblue font-16 mrf4 fr">
<a className="btn colorblue">设置</a> <a className="btn colorblue">设置</a>
</WordsBtn> </WordsBtn>
<WordsBtn style="blue" to={"/courses/"+coursesId+"/graduation_tasks/"+taskid+"/edit"} className="colorblue font-16 mr20 fr"> <WordsBtn style="blue" to={"/courses/"+coursesId+"/graduation_tasks/"+taskid+"/edit"} className="colorblue font-16 mr20 fr">
<a className="btn colorblue" >编辑</a> <a className="btn colorblue" >编辑</a>
</WordsBtn> </WordsBtn>
<WordsBtn style="blue" onClick={()=>this.toDetailPage("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list")}
className="btn colorblue colorblue font-16 mr20 fr">
查看详情
</WordsBtn>
</div> </div>
:""} :""}
@ -319,6 +326,8 @@ class GraduateTaskItem extends Component{
return( return(
<span key={key}> <span key={key}>
{item==="提交作品"? {item==="提交作品"?
<WordsBtn style="blue" className="colorblue font-16 ml20 fr mt12"> <WordsBtn style="blue" className="colorblue font-16 ml20 fr mt12">
@ -384,6 +393,11 @@ class GraduateTaskItem extends Component{
) )
}):""} }):""}
{this.props.isStudent?
<WordsBtn style="blue" onClick={()=>this.toDetailPage("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list")}
className="colorblue font-16 ml20 fr mt12">
查看详情
</WordsBtn>:""}
</div> </div>
</div> </div>

@ -1,5 +1,5 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {getRandomNumber,queryString} from 'educoder';
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import {Tooltip,Menu} from 'antd'; import {Tooltip,Menu} from 'antd';
import Loadable from 'react-loadable'; import Loadable from 'react-loadable';
@ -62,7 +62,8 @@ class GraduationTaskDetail extends Component{
ModalCancel:undefined, ModalCancel:undefined,
ModalSave:undefined, ModalSave:undefined,
acrossVisible:undefined, acrossVisible:undefined,
OneSelftype:false OneSelftype:false,
taskdatas:undefined
} }
} }
componentDidMount(){ componentDidMount(){
@ -249,11 +250,13 @@ class GraduationTaskDetail extends Component{
visibles:true visibles:true
}) })
} }
Cancel=()=>{ Cancel=()=>{
this.setState({ this.setState({
visibles:false visibles:false
}) })
} }
// 取消关联 // 取消关联
cannelAssociation=()=>{ cannelAssociation=()=>{
this.setState({ this.setState({
@ -263,6 +266,7 @@ class GraduationTaskDetail extends Component{
ModalSave:this.savetassociton ModalSave:this.savetassociton
}) })
} }
savetassociton=()=>{ savetassociton=()=>{
this.cannerassocition(); this.cannerassocition();
let {questionslist}=this.state; let {questionslist}=this.state;
@ -277,6 +281,7 @@ class GraduationTaskDetail extends Component{
}) })
} }
cannerassocition=()=>{ cannerassocition=()=>{
this.setState({ this.setState({
Modalstype:false, Modalstype:false,
@ -287,6 +292,7 @@ class GraduationTaskDetail extends Component{
visibles:false visibles:false
}) })
} }
// 补交附件 // 补交附件
handaccessory=()=>{ handaccessory=()=>{
// let {taskslistdata}=this.state; // let {taskslistdata}=this.state;
@ -299,14 +305,40 @@ class GraduationTaskDetail extends Component{
avisible:true avisible:true
}) })
} }
Cancelvisible=()=>{ Cancelvisible=()=>{
this.setState({ this.setState({
avisible:false avisible:false
}) })
} }
CodeReview=()=>{
this.props.showNotification("正在导出中...");
const task_Id = this.props.match.params.task_Id;
window.open(`/api/graduation_tasks/${task_Id}/sonar?
${this.state.taskdatas.teacher_comment===undefined||this.state.taskdatas.teacher_comment===null?"":"teacher_comment="+this.state.taskdatas.teacher_comment}
${this.state.taskdatas.task_status===undefined||this.state.taskdatas.task_status===null?"":"&task_status="+this.state.taskdatas.task_status}
${this.state.taskdatas.course_group===undefined||this.state.taskdatas.course_group===null?"":"&course_group="+this.state.taskdatas.course_group}
${this.state.taskdatas.cross_comment===undefined||this.state.taskdatas.cross_comment===null?"":"&cross_comment="+this.state.taskdatas.cross_comment}
${this.state.taskdatas.search===undefined||this.state.taskdatas.search===null?"":"&search="+this.state.taskdatas.search+"&"}${getRandomNumber(true)}`)
}
getsonars=(teacher_comment,task_status,course_group,cross_comment,search)=>{
let data={
teacher_comment:teacher_comment,
task_status:task_status,
course_group:course_group,
cross_comment:cross_comment,
search:search
}
this.setState({
taskdatas:data
})
}
bindRef = ref => { this.child = ref } ; bindRef = ref => { this.child = ref } ;
render(){ render(){
let courseId=this.props.match.params.coursesId; let courseId=this.props.match.params.coursesId;
@ -512,13 +544,15 @@ class GraduationTaskDetail extends Component{
{ this.props.isAdmin() ? questionslist.status===0 ? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.publish()} }>立即发布</a> : "" : "" } { this.props.isAdmin() ? questionslist.status===0 ? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.publish()} }>立即发布</a> : "" : "" }
{ this.props.isAdmin() && questionslist.cross_comment ? <a className={"fr color-blue font-16"} onClick={this.openAcross}>交叉评阅设置</a> : "" } { this.props.isAdmin() && questionslist.cross_comment ? <a className={"fr color-blue font-16"} onClick={this.openAcross}>交叉评阅设置</a> : "" }
{ this.props.isAdmin() ? <a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+task_Id+"/edit"}>编辑任务</a> : "" } { this.props.isAdmin() ? <a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+task_Id+"/edit"}>编辑任务</a> : "" }
{ this.props.user&&this.props.user.admin===true || this.props.user&&this.props.user.business===true ? <a className={"fr color-blue font-16"} onClick={()=>this.CodeReview()}>代码评测</a> : "" }
</div> </div>
</div> </div>
<Switch {...this.props}> <Switch {...this.props}>
{/*//毕设任务列表*/} {/*//毕设任务列表*/}
<Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/list" <Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/list"
render={ render={
(props) => (<GraduationTaskslist {...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} setend_time={(time)=>this.setend_time(time)} tab={`list`}/>) (props) => (<GraduationTaskslist getsonar={(teacher_comment,task_status,course_group,cross_comment,search)=>this.getsonars(teacher_comment,task_status,course_group,cross_comment,search)}{...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} setend_time={(time)=>this.setend_time(time)} tab={`list`}/>)
} }
></Route> ></Route>

@ -62,6 +62,8 @@ class GraduationTaskssettinglist extends Component{
let{teacher_comment,task_status,course_group,cross_comment,order,b_order,search}=this.state; let{teacher_comment,task_status,course_group,cross_comment,order,b_order,search}=this.state;
this.seacthdata(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,this.state.page); this.seacthdata(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,this.state.page);
this.props.getsonar(teacher_comment, task_status, course_group, cross_comment, search)
try{ try{
this.props.triggerRef(this) this.props.triggerRef(this)
}catch(e){ }catch(e){
@ -88,6 +90,8 @@ class GraduationTaskssettinglist extends Component{
}) })
let {teacher_comment, task_status, course_group, cross_comment, order, b_order, search} = this.state; let {teacher_comment, task_status, course_group, cross_comment, order, b_order, search} = this.state;
this.seacthdata(teacher_comment, task_status, course_group, cross_comment, order, b_order, search,this.state.page); this.seacthdata(teacher_comment, task_status, course_group, cross_comment, order, b_order, search,this.state.page);
this.props.getsonar(teacher_comment, task_status, course_group, cross_comment, search)
} }
seacthdata=(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,pages)=>{ seacthdata=(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,pages)=>{
@ -227,8 +231,19 @@ class GraduationTaskssettinglist extends Component{
funteachercomment=(list,key)=> { funteachercomment=(list,key)=> {
// console.log(e.target.value) // console.log(e.target.value)
let {teacher_comment, task_status, course_group, cross_comment, order, b_order, search} = this.state; let {teacher_comment, task_status, course_group, cross_comment, order, b_order, search} = this.state;
if(this.state.teacher_comment!=null&&list.length>0){
if(this.state.teacher_comment.length>0){
list.map((item,key)=>{
this.state.teacher_comment.map((k,y)=>{
if(item===k){
list.splice(key, 1)
}
})
})
}
}
let listype =list instanceof Array; let listype =list instanceof Array;
if(listype===false){ if(listype===false){
this.setState({ this.setState({
teacher_comment:null, teacher_comment:null,
@ -242,12 +257,17 @@ class GraduationTaskssettinglist extends Component{
} }
if(list.length===key){ let newvalue=list.length===0?undefined:parseInt(list[0])
this.seacthdata(undefined, task_status, course_group, cross_comment, order, b_order, search,this.state.page); this.seacthdata(newvalue, task_status, course_group, cross_comment, order, b_order, search,this.state.page);
}else{ this.props.getsonar(newvalue, task_status, course_group, cross_comment, search)
this.seacthdata(list[0], task_status, course_group, cross_comment, order, b_order, search,this.state.page); // if(list.length===key){
// this.seacthdata(undefined, task_status, course_group, cross_comment, order, b_order, search,this.state.page);
} // this.props.getsonar(undefined, task_status, course_group, cross_comment, search)
// }else{
// this.seacthdata(list[0], task_status, course_group, cross_comment, order, b_order, search,this.state.page);
// this.props.getsonar(list[0], task_status, course_group, cross_comment, search)
//
// }
} }
@ -262,7 +282,7 @@ class GraduationTaskssettinglist extends Component{
loadingstate:true loadingstate:true
}) })
this.seacthdata(teacher_comment, task_status, course_group, e.target.value===undefined||e.target.value===false?"":e.target.value, order, b_order, search,this.state.page); this.seacthdata(teacher_comment, task_status, course_group, e.target.value===undefined||e.target.value===false?"":e.target.value, order, b_order, search,this.state.page);
this.props.getsonar(teacher_comment, task_status, course_group, e.target.value===undefined||e.target.value===false?"":e.target.value, search)
} }
inputSearchValue=(e)=>{ inputSearchValue=(e)=>{
@ -287,7 +307,7 @@ class GraduationTaskssettinglist extends Component{
loadingstate:true loadingstate:true
}) })
this.seacthdata(teacher_comment, task_status, course_group, cross_comment, order, b_order, search,this.state.page); this.seacthdata(teacher_comment, task_status, course_group, cross_comment, order, b_order, search,this.state.page);
this.props.getsonar(teacher_comment, task_status, course_group, cross_comment, search)
} }
funorder = (value, newb_order) => { funorder = (value, newb_order) => {
@ -299,7 +319,7 @@ class GraduationTaskssettinglist extends Component{
loadingstate: true loadingstate: true
}) })
this.seacthdata(teacher_comment, task_status, course_group, cross_comment, value, newb_order, search,this.state.page); this.seacthdata(teacher_comment, task_status, course_group, cross_comment, value, newb_order, search,this.state.page);
this.props.getsonar(teacher_comment, task_status, course_group, cross_comment, search)
} }
@ -320,6 +340,7 @@ class GraduationTaskssettinglist extends Component{
loadingstate:true loadingstate:true
}) })
this.seacthdata(teacher_comment, null, course_group, cross_comment, order, b_order, search,this.state.page); this.seacthdata(teacher_comment, null, course_group, cross_comment, order, b_order, search,this.state.page);
this.props.getsonar(teacher_comment, null, course_group, cross_comment, search)
} }
// else if(checkedValues.length ===key){ // else if(checkedValues.length ===key){
// // 全部抖选中 自然就是查找全部 就是空 // // 全部抖选中 自然就是查找全部 就是空
@ -336,7 +357,7 @@ class GraduationTaskssettinglist extends Component{
loadingstate:true loadingstate:true
}) })
this.seacthdata(teacher_comment, checkedValues===key?undefined:checkedValues, course_group, cross_comment, order, b_order, search,this.state.page); this.seacthdata(teacher_comment, checkedValues===key?undefined:checkedValues, course_group, cross_comment, order, b_order, search,this.state.page);
this.props.getsonar(teacher_comment, checkedValues===key?undefined:checkedValues, course_group, cross_comment, search)
} }
@ -355,6 +376,7 @@ class GraduationTaskssettinglist extends Component{
loadingstate:true loadingstate:true
}) })
this.seacthdata(teacher_comment, task_status, null, cross_comment, order, b_order, search,this.state.page); this.seacthdata(teacher_comment, task_status, null, cross_comment, order, b_order, search,this.state.page);
this.props.getsonar(teacher_comment,task_status, null, cross_comment, search)
} }
// else if(checkedValues.length ===key){ // else if(checkedValues.length ===key){
// // 全部抖选中 自然就是查找全部 就是空 // // 全部抖选中 自然就是查找全部 就是空
@ -372,6 +394,7 @@ class GraduationTaskssettinglist extends Component{
loadingstate:true loadingstate:true
}) })
this.seacthdata(teacher_comment, task_status, checkedValues===key?undefined:checkedValues, cross_comment, order, b_order, search,this.state.page); this.seacthdata(teacher_comment, task_status, checkedValues===key?undefined:checkedValues, cross_comment, order, b_order, search,this.state.page);
this.props.getsonar(teacher_comment,task_status, checkedValues===key?undefined:checkedValues, cross_comment, search)
} }
@ -564,6 +587,7 @@ class GraduationTaskssettinglist extends Component{
// console.log(result) // console.log(result)
if(result.data.status===0){ if(result.data.status===0){
this.seacthdata(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,this.state.page); this.seacthdata(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,this.state.page);
this.props.getsonar(teacher_comment,task_status, course_group, cross_comment, search)
this.props.showNotification(result.data.message); this.props.showNotification(result.data.message);
this.cancelmodel(); this.cancelmodel();
this.setState({ this.setState({
@ -681,7 +705,7 @@ class GraduationTaskssettinglist extends Component{
}) })
let{teacher_comment,task_status,course_group,cross_comment,order,b_order,search}=this.state; let{teacher_comment,task_status,course_group,cross_comment,order,b_order,search}=this.state;
this.seacthdata(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,pageNumber); this.seacthdata(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,pageNumber);
this.props.getsonar(teacher_comment,task_status, course_group, cross_comment, search)
} }
/// 确认是否下载 /// 确认是否下载
@ -1338,7 +1362,7 @@ class GraduationTaskssettinglist extends Component{
<a id="graduation_comment_no_limit" alue={null} className={teacher_comment===null?"pl10 pr10 check_on":"pl10 pr10 "} onClick={this.funteachercomment}>全部</a> <a id="graduation_comment_no_limit" alue={null} className={teacher_comment===null?"pl10 pr10 check_on":"pl10 pr10 "} onClick={this.funteachercomment}>全部</a>
</span> </span>
<CheckboxGroup value={teacher_comment} onChange={(e)=>this.funteachercomment(e,taskslistdata.search_assistants&&taskslistdata.search_assistants.teacher_comment.length)} style={{ paddingTop: '4px'}}> <CheckboxGroup value={teacher_comment} onChange={(e)=>this.funteachercomment(e,taskslistdata.search_assistants&&taskslistdata.search_assistants.teacher_comment.length)} style={{ paddingTop: '4px'}}>
{taskslistdata.search_assistants&&taskslistdata.search_assistants.teacher_comment.map((item,key)=>{ {taskslistdata.search_assistants&&taskslistdata.search_assistants.teacher_comment.map((item,key)=>{
return( return(
<span key={key}> <span key={key}>

@ -120,22 +120,32 @@ class GraduateTopicItem extends Component{
</span> </span>
<span className="fl mr20 color-grey-9 mt1">{discussMessage.selected_count} 已选</span> <span className="fl mr20 color-grey-9 mt1">{discussMessage.selected_count} 已选</span>
<span className="fl color-grey-9 mt1">{discussMessage.confirmation_count} 已确认</span> <span className="fl color-grey-9 mt1">{discussMessage.confirmation_count} 已确认</span>
<span className="fr"> <span className="fr">
{ {
isAdmin && <WordsBtn onClick={()=>this.editTopic(`${discussMessage.id}`)} style="blue" className="font-16">编辑</WordsBtn> isStudent?<WordsBtn style="blue" onClick={() => this.toDetailPage(`${discussMessage.id}`)}
className="font-16 mr20" >查看详情</WordsBtn>:""
}
{
isAdmin?<WordsBtn style="blue" onClick={() => this.toDetailPage(`${discussMessage.id}`)} className="font-16 mr20" >查看详情</WordsBtn>:""
}
{
isAdmin && <WordsBtn onClick={()=>this.editTopic(`${discussMessage.id}`)} style="blue" className="font-16 ">编辑</WordsBtn>
} }
{ {
isStudent && data.user_selected == true && discussMessage.user_topic_status==0 && isStudent && data.user_selected == true && discussMessage.user_topic_status==0 &&
<WordsBtn onClick={()=>chooseTopic(`${discussMessage.id}`,index,true)} style="blue" className="font-16"> <WordsBtn onClick={()=>chooseTopic(`${discussMessage.id}`,index,true)} style="blue" className="font-16 mr20">
取消选题 取消选题
</WordsBtn> </WordsBtn>
} }
{ {
isStudent && data.user_selected==false && (discussMessage.user_topic_status == null || discussMessage.user_topic_status == 2) && isStudent && data.user_selected==false && (discussMessage.user_topic_status == null || discussMessage.user_topic_status == 2) &&
<WordsBtn onClick={()=>chooseTopic(`${discussMessage.id}`,index,false)} style="blue" className="font-16"> <WordsBtn onClick={()=>chooseTopic(`${discussMessage.id}`,index,false)} style="blue" className="font-16 mr20">
选题 选题
</WordsBtn> </WordsBtn>
} }
</span> </span>
</p> </p>
</div> </div>

@ -53,7 +53,7 @@ function ChangeRolePop({ member_roles = [], record, courseId, onChangeRoleSucces
} }
} }
console.log(response)
} }
const isAdmin = checkBoxRoles.indexOf('CREATOR') != -1 const isAdmin = checkBoxRoles.indexOf('CREATOR') != -1
const isTeacher = checkBoxRoles.indexOf('PROFESSOR') != -1 const isTeacher = checkBoxRoles.indexOf('PROFESSOR') != -1

@ -55,7 +55,7 @@ function CourseGroupList(props) {
const response = await axios.get(url, { params: { const response = await axios.get(url, { params: {
search: searchValue search: searchValue
}}); }});
console.log(response)
setIsSpin(false) setIsSpin(false)
if (response) { if (response) {
setListRes(response.data) setListRes(response.data)

@ -97,8 +97,12 @@ class PollListItem extends Component{
<span className="mr20 fl mt3">{"提交剩余时间:"+formatDuring(t)}</span> <span className="mr20 fl mt3">{"提交剩余时间:"+formatDuring(t)}</span>
</Tooltip> </Tooltip>
} }
{ {
isStudent ? <WordsBtn style="blue" targets={item.current_status == 2||item.current_status == 0?undefined:'_blank'} className="fr font-16" to={`/courses/${coursesId}/polls/${item.id}/users/${this.props.current_user.login}`}> isStudent ? <WordsBtn style="blue" targets={item.current_status == 2||item.current_status == 0?undefined:'_blank'} className="fr font-16 ml20" to={`/courses/${coursesId}/polls/${item.id}/users/${this.props.current_user.login}`}>
{ {
item.current_status == 0 && "继续答题" item.current_status == 0 && "继续答题"
} }
@ -110,10 +114,13 @@ class PollListItem extends Component{
} }
</WordsBtn>:"" </WordsBtn>:""
} }
{ isStudent ?canNotLink ?"": <WordsBtn style="blue" className="font-16 fr " onClick={()=>this.toDetailPage(`/courses/${coursesId}/polls/${item.id}/detail`)} >查看详情</WordsBtn>:""}
{ {
IsAdmin && IsAdmin &&
<ul className="fr"> <ul className="fr">
<WordsBtn style="blue" className="font-16" to={`/courses/${coursesId}/polls/${item.id}/${"edit"}`}>编辑</WordsBtn> { canNotLink ?"": <WordsBtn style="blue" className="font-16" onClick={()=>this.toDetailPage(`/courses/${coursesId}/polls/${item.id}/detail`)} >查看详情</WordsBtn>}
<WordsBtn style="blue" className="font-16 ml20" to={`/courses/${coursesId}/polls/${item.id}/${"edit"}`}>编辑</WordsBtn>
<WordsBtn style="blue" className="ml20 font-16" to={`/courses/${coursesId}/polls/${item.id}/detail?tab=3`}>设置</WordsBtn> <WordsBtn style="blue" className="ml20 font-16" to={`/courses/${coursesId}/polls/${item.id}/detail?tab=3`}>设置</WordsBtn>
</ul> </ul>
} }

@ -388,6 +388,7 @@ class ShixunHomeworkPage extends Component {
teacherdatapage === undefined ? "" teacherdatapage === undefined ? ""
: teacherdatapage.commit_des === null || teacherdatapage.commit_des === undefined ? "" : : teacherdatapage.commit_des === null || teacherdatapage.commit_des === undefined ? "" :
<a className="fr color-blue font-16" <a className="fr color-blue font-16"
target={"_blank"}
href={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage === undefined ? "" : teacherdatapage.id}/commitsummary/${this.props.match.params.homeworkid}`}>{teacherdatapage.commit_des}</a> href={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage === undefined ? "" : teacherdatapage.id}/commitsummary/${this.props.match.params.homeworkid}`}>{teacherdatapage.commit_des}</a>
} }
{teacherdatapage === undefined ? "" :teacherdatapage&&teacherdatapage.shixun_status>1&&teacherdatapage&&teacherdatapage.time_status<5?<Startshixuntask {teacherdatapage === undefined ? "" :teacherdatapage&&teacherdatapage.shixun_status>1&&teacherdatapage&&teacherdatapage.time_status<5?<Startshixuntask

@ -68,7 +68,7 @@ class ShixunhomeWorkItem extends Component{
}) })
// w.close() // w.close()
}else if(response.data.status===-1){ }else if(response.data.status===-1){
console.log(response)
}else if(response.data.status===-3){ }else if(response.data.status===-3){
this.setState({ this.setState({
shixunsmessage:response.data.message, shixunsmessage:response.data.message,
@ -304,11 +304,11 @@ class ShixunhomeWorkItem extends Component{
<div className="clearfix ds pr pt5 contentSection" > <div className="clearfix ds pr pt5 contentSection" >
<style>{` <style>{`
.maxwidth422{ .maxwidth333{
max-width: 422px; max-width: 333px;
overflow:hidden; overflow: hidden;
text-overflow:ellipsis; text-overflow: ellipsis;
white-space:nowrap white-space: nowrap;
} }
`}</style> `}</style>
<h6> <h6>
@ -317,21 +317,21 @@ class ShixunhomeWorkItem extends Component{
{ {
this.props.isAdmin?<a onClick={()=>this.hrefjumpskip("/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list?tab=0")} this.props.isAdmin?<a onClick={()=>this.hrefjumpskip("/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list?tab=0")}
title={discussMessage.name} title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth422">{discussMessage.name}</a>:"" className="fl mt3 font-16 font-bd color-dark maxwidth333">{discussMessage.name}</a>:""
} }
{ {
this.props.isStudent? <a onClick={()=>this.hrefjumpskip(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`)} this.props.isStudent? <a onClick={()=>this.hrefjumpskip(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`)}
title={discussMessage.name} title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth422">{discussMessage.name}</a>:"" className="fl mt3 font-16 font-bd color-dark maxwidth333">{discussMessage.name}</a>:""
} }
{ {
this.props.isNotMember===true? this.props.discussMessage.private_icon===true? this.props.isNotMember===true? this.props.discussMessage.private_icon===true?
<span className="fl mt3 font-16 font-bd color-dark maxwidth422 pointer" title={"私有属性,非课堂成员不能访问"}>{discussMessage.name}</span> <span className="fl mt3 font-16 font-bd color-dark maxwidth333 pointer" title={"私有属性,非课堂成员不能访问"}>{discussMessage.name}</span>
: <a onClick={()=>this.hrefjumpskip(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`)} : <a onClick={()=>this.hrefjumpskip(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`)}
title={discussMessage.name} title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth422">{discussMessage.name}</a>:"" className="fl mt3 font-16 font-bd color-dark maxwidth333">{discussMessage.name}</a>:""
} }
@ -349,30 +349,44 @@ class ShixunhomeWorkItem extends Component{
<style> <style>
{ {
` `
.homepagePostSettingname{
width:192px !important;
}
.homepagePostSettingbox{ .homepagePostSettingbox{
width:139px !important; width:207px !important;
} }
.colorfff{ .colorfff{
color:#fff !important; color:#fff !important;
} }
.newhomepagePostSettingname{
width: 205px !important;
}
.newwidthSettin{
width:255px !important;
}
` `
} }
</style> </style>
{this.props.isAdmin?<span onClick={(event)=>this.stopPro(event)} className={this.props.isAdminOrCreator()?"homepagePostSetting homepagePostSettingname":"homepagePostSetting homepagePostSettingbox"} style={{"right":"-2px","top":"6px","display":"block"}}>
{discussMessage&&discussMessage.shixun_status>1?<Link className="btn colorblue font-16 fontweight400" to={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</Link>:
<a className={"btn colorfff font-16 fontweight400"}>实训详情</a>} {/*to={`/courses/${this.props.match.params.coursesId}/${discussMessage.homework_id}/jobsettings`}*/}
{this.props.isAdminOrCreator()?<a onClick={(event)=>this.editname(discussMessage.name,discussMessage.homework_id,event)} className={"btn colorblue ml20 font-16 fontweight400"}>重命名</a>:""}
{this.props.isAdmin?<span onClick={(event)=>this.stopPro(event)} className={discussMessage&&discussMessage.shixun_status>1?this.props.isAdminOrCreator()?" newhomepagePostSettingname fr":" homepagePostSettingbox fr":" newwidthSettin fr"} style={{"right":"-2px","top":"6px","display":"block"}}>
{discussMessage&&discussMessage.shixun_status>1?<Link className="btn colorblue font-16 fontweight400 mr20" to={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</Link>:
<a className={"btn colorfff font-16 fontweight400 "}>实训详情</a>
}
{this.props.isAdminOrCreator()?<a onClick={(event)=>this.editname(discussMessage.name,discussMessage.homework_id,event)} className={"btn colorblue font-16 fontweight400 "}>重命名</a>:""}
{/*<WordsBtn className="btn colorblue ml20 font-16" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn>*/} {/*<WordsBtn className="btn colorblue ml20 font-16" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn>*/}
<WordsBtn className="btn colorblue font-16 ml15 fontweight400" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn> <WordsBtn className="btn colorblue font-16 ml15 fontweight400 " to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn>
</span>:""} </span>:""}
{this.props.isStudent===true?this.props.course_identity===5?discussMessage&&discussMessage.shixun_status>1? {this.props.isStudent===true?this.props.course_identity===5?discussMessage&&discussMessage.shixun_status>1?
discussMessage.time_status<5? discussMessage.time_status<5?
<WordsBtn style="blue" className="colorblue font-16 mr20 fr mt10"> <WordsBtn style="blue" className="colorblue font-16 mr20 fr mt2 ">
{startbtn===false? {startbtn===false?
(discussMessage.task_operation[0] == '继续挑战' || discussMessage.task_operation[0] == '查看实战' ? (discussMessage.task_operation[0] == '继续挑战' || discussMessage.task_operation[0] == '查看实战' ?
<a className="btn colorblue" href={getTaskUrlById(discussMessage.task_operation[1])}> <a className="btn colorblue" href={getTaskUrlById(discussMessage.task_operation[1])}>
@ -385,6 +399,18 @@ class ShixunhomeWorkItem extends Component{
</WordsBtn>:"":"":"":"" </WordsBtn>:"":"":"":""
} }
{ this.props.isAdmin?<a onClick={()=>this.hrefjumpskip("/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list?tab=0")} className="btn colorblue font-16 fontweight400 mr20 fr">查看详情</a>:""}
{
this.props.isStudent? <a onClick={()=>this.hrefjumpskip("/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list?tab=0")} className="btn colorblue font-16 fontweight400 mr20 fr mt2">查看详情</a>:""
}
{
this.props.isNotMember===true? this.props.discussMessage.private_icon===true?""
:<a onClick={()=>this.hrefjumpskip("/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list?tab=0")} className="btn colorblue font-16 fontweight400 mr20 fr">查看详情</a>:""
}
</h6> </h6>
<div className="cl"></div> <div className="cl"></div>

@ -422,6 +422,7 @@ class Trainingjobsetting extends Component {
if (this.state.jobsettingsdata.data.unified_setting === true) { if (this.state.jobsettingsdata.data.unified_setting === true) {
if (this.state.unifiedsetting === true) { if (this.state.unifiedsetting === true) {
//统一设置
if (this.state.releasetime === undefined || this.state.releasetime === null || this.state.releasetime === "") { if (this.state.releasetime === undefined || this.state.releasetime === null || this.state.releasetime === "") {
// this.props.showNotification(`请选择发布时间`); // this.props.showNotification(`请选择发布时间`);
@ -544,13 +545,28 @@ class Trainingjobsetting extends Component {
} }
} else { } else {
//分班设置
// console.log("分班设置");
// console.log(this.$pollDetailTabForthRules);
const result=this.$pollDetailTabForthRules.notUnifiedSettingCheck(this.state.rules);
this.setState({
rules: result.rules
})
if(result.validate==false){
this.scrollToAnchor("publishtimeid");
this.props.showNotification(`分班发布设置不能为空`);
return false;
}
let rulesdata = this.state.rulesdata; let rulesdata = this.state.rulesdata;
if ( if (rulesdata.length === 0) {
rulesdata.length === 0) {
this.props.showNotification(`分班发布设置不能为空`); this.props.showNotification(`分班发布设置不能为空`);
return; return;
} }
//
} }
} }
@ -1656,7 +1672,7 @@ class Trainingjobsetting extends Component {
if (unifiedsetting === true) { if (unifiedsetting === true) {
if (moment(value, "YYYY-MM-DD HH:mm") <= moment(publish_time)) { if (moment(value, "YYYY-MM-DD HH:mm") <= moment(publish_time)) {
this.setState({ this.setState({
hand__e_tip: "补交时间不能早于发布时间", hand__e_tip: "补交结束时间不能早于发布时间",
hand_flags: true, hand_flags: true,
handclass: "bor-reds", handclass: "bor-reds",
late_times: value.format('YYYY-MM-DD HH:mm'), late_times: value.format('YYYY-MM-DD HH:mm'),
@ -1664,7 +1680,7 @@ class Trainingjobsetting extends Component {
}) })
} else if (moment(value, "YYYY-MM-DD HH:mm") <= moment(end_time)) { } else if (moment(value, "YYYY-MM-DD HH:mm") <= moment(end_time)) {
this.setState({ this.setState({
hand__e_tip: "补交时间不能早于截止时间", hand__e_tip: "补交结束时间不能早于截止时间",
hand_flags: true, hand_flags: true,
handclass: "bor-reds", handclass: "bor-reds",
late_times: value.format('YYYY-MM-DD HH:mm'), late_times: value.format('YYYY-MM-DD HH:mm'),
@ -2396,7 +2412,7 @@ class Trainingjobsetting extends Component {
modalSave={modalSave} modalSave={modalSave}
></Modals> ></Modals>
<div className={"educontent"}> <div className={"educontent"} id={"publishtimeid"}>
{ {
!flagPageEdit && this.props.isAdmin() === true ? !flagPageEdit && this.props.isAdmin() === true ?
"" ""
@ -2454,7 +2470,7 @@ class Trainingjobsetting extends Component {
</style> </style>
{ {
unifiedsetting === undefined ? "" : unifiedsetting === true ? unifiedsetting === undefined ? "" : unifiedsetting === true ?
<div> <div >
<div className="clearfix mb5 ml15"> <div className="clearfix mb5 ml15">
<span className="font-16 fl mt3" style={{color: "#999999"}}>发布时间</span> <span className="font-16 fl mt3" style={{color: "#999999"}}>发布时间</span>
<Tooltip placement="bottom" <Tooltip placement="bottom"
@ -2536,6 +2552,9 @@ class Trainingjobsetting extends Component {
<PollDetailTabForthRules <PollDetailTabForthRules
{...this.props} {...this.props}
{...this.state} {...this.state}
ref={dom => {
this.$pollDetailTabForthRules = dom;
}}
teacherdatapage={this.props.teacherdatapage} teacherdatapage={this.props.teacherdatapage}
rules={rules} rules={rules}
moduleName={"作业"} moduleName={"作业"}

@ -175,7 +175,7 @@ class MemoDetail extends Component {
// withCredentials: true // withCredentials: true
} }
).then((response) => { ).then((response) => {
console.log(response);
const newMemo = Object.assign({}, this.props.memo) const newMemo = Object.assign({}, this.props.memo)
newMemo.praise_count = response.data.praise_count newMemo.praise_count = response.data.praise_count
newMemo.user_praise = !newMemo.user_praise newMemo.user_praise = !newMemo.user_praise
@ -309,7 +309,7 @@ class MemoDetail extends Component {
memo: newMemo2 memo: newMemo2
}) })
} }
console.log(response)
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}) })
@ -352,7 +352,7 @@ class MemoDetail extends Component {
memo: newMemo memo: newMemo
}) })
} }
console.log(response)
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}) })
@ -382,7 +382,7 @@ class MemoDetail extends Component {
comments comments
}) })
} }
console.log(response)
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}) })
@ -471,7 +471,7 @@ class MemoDetail extends Component {
} }
// {"message":"Couldn't find Discuss with id=911","status":-1} // {"message":"Couldn't find Discuss with id=911","status":-1}
console.log(response)
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}) })
@ -546,7 +546,7 @@ class MemoDetail extends Component {
this.props.initForumState({ this.props.initForumState({
memo: newMemo2 memo: newMemo2
}) })
console.log(response)
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)

@ -57,7 +57,7 @@ class MemoDetailMDEditor extends Component {
errorMsg: '' errorMsg: ''
}) })
}) })
commentMDEditor.cm.focus() // commentMDEditor.cm.focus()
}, { }, {
watch: false, watch: false,
dialogLockScreen: false, dialogLockScreen: false,

@ -6,6 +6,8 @@ import beijintulogontwo from '../../../src/images/login/beijintulogontwo.png';
import educodernet from '../../../src/images/login/educodernet.png'; import educodernet from '../../../src/images/login/educodernet.png';
import InterestpageComponent from '../user/Interestpage' import InterestpageComponent from '../user/Interestpage'
import InterestpageComponentMax from '../user/InterestpageMax' import InterestpageComponentMax from '../user/InterestpageMax'
import moment from 'moment';
//educoder登入页面 //educoder登入页面
var newContainer={ var newContainer={
@ -78,7 +80,7 @@ class EducoderInteresse extends Component {
justifyContent: "center", justifyContent: "center",
width: "100%", width: "100%",
}}> }}>
<div className="font-14 color-grey-9 " style={{marginTop:"20px"}}><span className="font-18">©</span>&nbsp;2019&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</div> <div className="font-14 color-grey-9 " style={{marginTop:"20px"}}><span className="font-18">©</span>&nbsp;{moment().year()}&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</div>
</div> </div>
</div> </div>
</div> </div>

@ -1,26 +1,6 @@
import React, {Component} from "react"; import React, {Component} from "react";
import { import moment from 'moment';
Form,
Select,
Input,
Button,
Checkbox,
Upload,
Icon,
message,
Modal,
Table,
Divider,
InputNumber,
Tag,
DatePicker,
Radio,
Tooltip,
notification
} from "antd";
import {Link, Switch, Route, Redirect} from 'react-router-dom';
import { SnackbarHOC,getImageUrl } from 'educoder'; import { SnackbarHOC,getImageUrl } from 'educoder';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import '../courses/css/members.css'; import '../courses/css/members.css';
import "../courses/common/formCommon.css" import "../courses/common/formCommon.css"
import '../courses/css/Courses.css'; import '../courses/css/Courses.css';
@ -201,21 +181,21 @@ class EducoderLogin extends Component {
justifyContent: "center", justifyContent: "center",
width: "100%", width: "100%",
}}> }}>
<div className="font-14 color-grey-9 " style={{marginTop:"20px"}}><span className="font-18">©</span>&nbsp;2019&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</div> <div className="font-14 color-grey-9 " style={{marginTop:"20px"}}><span className="font-18">©</span>&nbsp;{moment().year()}&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</div>
</div>: </div>:
this.props.mygetHelmetapi===undefined||this.props.mygetHelmetapi.main_site===null|| this.props.mygetHelmetapi.main_site===undefined? <div style={{ this.props.mygetHelmetapi===undefined||this.props.mygetHelmetapi.main_site===null|| this.props.mygetHelmetapi.main_site===undefined? <div style={{
display: "flex", display: "flex",
justifyContent: "center", justifyContent: "center",
width: "100%", width: "100%",
}}> }}>
<div className="font-14 color-grey-9 " style={{marginTop:"20px"}}><span className="font-18">©</span>&nbsp;2019&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</div> <div className="font-14 color-grey-9 " style={{marginTop:"20px"}}><span className="font-18">©</span>&nbsp;{moment().year()}&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</div>
</div>:this.props.mygetHelmetapi.main_site===true? </div>:this.props.mygetHelmetapi.main_site===true?
<div style={{ <div style={{
display: "flex", display: "flex",
justifyContent: "center", justifyContent: "center",
width: "100%", width: "100%",
}}> }}>
<div className="font-14 color-grey-9 " style={{marginTop:"20px"}}><span className="font-18">©</span>&nbsp;2019&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</div> <div className="font-14 color-grey-9 " style={{marginTop:"20px"}}><span className="font-18">©</span>&nbsp;{moment().year()}&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</div>
</div> </div>
:"" :""
} }

@ -1,33 +1,18 @@
import React, {Component} from "react"; import React, {Component} from "react";
import { import {
Form,
Select,
Input, Input,
Button, Button,
Checkbox,
Upload,
Icon,
message,
Modal,
Table,
Divider, Divider,
InputNumber,
Tag,
DatePicker,
Radio,
Tooltip,
notification,
Layout, Layout,
Spin Spin
} from "antd"; } from "antd";
import axios from 'axios'; import axios from 'axios';
import moment from 'moment';
import { getImageUrl } from 'educoder' import { getImageUrl } from 'educoder'
import {Link, Switch, Route, Redirect} from 'react-router-dom';
import '../courses/css/members.css'; import '../courses/css/members.css';
import "../courses/common/formCommon.css" import "../courses/common/formCommon.css"
import '../courses/css/Courses.css'; import '../courses/css/Courses.css';
import beijintulogontwo from '../../../src/images/login/beijintulogontwo.png'; import beijintulogontwo from '../../../src/images/login/beijintulogontwo.png';
import educodernet from '../../../src/images/login/educodernet.png';
const { Header, Footer, Sider, Content } = Layout; const { Header, Footer, Sider, Content } = Layout;
//educoder登入页面 //educoder登入页面
var sectionStyle = { var sectionStyle = {
@ -294,7 +279,7 @@ class Otherlogin extends Component {
justifyContent: "center", justifyContent: "center",
width: "100%", width: "100%",
}}> }}>
<div className="font-14 color-grey-9 " style={{marginTop:"20px"}}><span className="font-18">©</span>&nbsp;2019&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</div> <div className="font-14 color-grey-9 " style={{marginTop:"20px"}}><span className="font-18">©</span>&nbsp;{moment().year()}&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</div>
</div> </div>
</div> </div>
</Spin> </Spin>

@ -104,7 +104,6 @@ class Index extends Component {
// withCredentials: true, // withCredentials: true,
}) })
.then((response) => { .then((response) => {
console.log(response);
if (response.data.status == -1) { if (response.data.status == -1) {
console.error('获取任务列表失败!') console.error('获取任务列表失败!')
@ -146,7 +145,7 @@ class Index extends Component {
// } // }
) )
.then((response) => { .then((response) => {
console.log(response);
// {"reward_code":86} TODO 金币数量变化 // {"reward_code":86} TODO 金币数量变化
if (response.data.reward_code === -1) { if (response.data.reward_code === -1) {
this.props.showSnackbar('该任务已评过星了!') this.props.showSnackbar('该任务已评过星了!')

@ -80,7 +80,7 @@ class PackageIndexNEIBannerConcent extends Component {
let url=`/project_packages/${this.props.match.params.id}.json` let url=`/project_packages/${this.props.match.params.id}.json`
axios.get((url)).then((response) => { axios.get((url)).then((response) => {
console.log(response)
let data=response.data let data=response.data
this.setState({ this.setState({
category:data.category_id, category:data.category_id,

@ -34,7 +34,7 @@ class NewMyShixunModel extends Component {
placement: 'right', placement: 'right',
modalsType: false, modalsType: false,
modalsTypes:false, modalsTypes:false,
titilesm: "设为公开后,所有成员均可使用试题", titilesm: "在平台审核后,所有成员均可使用试题",
titiless: "是否设置为公开?", titiless: "是否设置为公开?",
titilesms:"单选题", titilesms:"单选题",
titbool: false, titbool: false,
@ -91,7 +91,7 @@ class NewMyShixunModel extends Component {
page: this.state.page, page: this.state.page,
per_page:10, per_page:10,
oj_status:null, oj_status:null,
item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
}; };
this.getdata(data); this.getdata(data);
@ -117,7 +117,7 @@ class NewMyShixunModel extends Component {
page: 1, page: 1,
per_page:10, per_page:10,
oj_status:null, oj_status:null,
item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
}; };
this.getdata(data); this.getdata(data);
} }
@ -141,7 +141,7 @@ class NewMyShixunModel extends Component {
page: 1, page: 1,
per_page:10, per_page:10,
oj_status:null, oj_status:null,
item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
}; };
this.getdata(data); this.getdata(data);
} }
@ -156,7 +156,7 @@ class NewMyShixunModel extends Component {
public: defaultActiveKey, public: defaultActiveKey,
page:1, page:1,
per_page:10, per_page:10,
item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
}; };
this.getdata(data); this.getdata(data);
@ -209,7 +209,7 @@ class NewMyShixunModel extends Component {
page: 1, page: 1,
per_page:10, per_page:10,
oj_status:null, oj_status:null,
item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
}; };
this.getdata(data); this.getdata(data);
@ -342,7 +342,7 @@ class NewMyShixunModel extends Component {
page: pageNumber, page: pageNumber,
per_page:10, per_page:10,
oj_status:this.state.oj_status, oj_status:this.state.oj_status,
item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
}; };
this.getdata(data); this.getdata(data);
@ -386,7 +386,7 @@ class NewMyShixunModel extends Component {
this.setState({ this.setState({
modalsType: true, modalsType: true,
titilesm: "设为公开后,所有成员均可使用试题", titilesm: "在平台审核后,所有成员均可使用试题",
titiless: "是否设置为公开?", titiless: "是否设置为公开?",
titbool: true, titbool: true,
timuid: id timuid: id
@ -461,7 +461,7 @@ class NewMyShixunModel extends Component {
page:1, page:1,
per_page:10, per_page:10,
oj_status:null, oj_status:null,
item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
}; };
this.getdata(data); this.getdata(data);
@ -488,7 +488,7 @@ class NewMyShixunModel extends Component {
per_page:10, per_page:10,
keywords:null, keywords:null,
oj_status:null, oj_status:null,
item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
}; };
this.getdata(data); this.getdata(data);
@ -543,7 +543,7 @@ class NewMyShixunModel extends Component {
page: this.state.page, page: this.state.page,
per_page:10, per_page:10,
oj_status:this.state.oj_status, oj_status:this.state.oj_status,
item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
}; };
this.getdata(data); this.getdata(data);
@ -567,7 +567,7 @@ class NewMyShixunModel extends Component {
keywords: this.state.keywords, keywords: this.state.keywords,
page: this.state.page, page: this.state.page,
per_page:10, per_page:10,
item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
}; };
this.getdata(data); this.getdata(data);
} }
@ -593,7 +593,7 @@ class NewMyShixunModel extends Component {
keywords: this.state.keywords, keywords: this.state.keywords,
page: this.state.page, page: this.state.page,
per_page:10, per_page:10,
item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
}; };
this.getdata(data); this.getdata(data);
@ -661,7 +661,7 @@ class NewMyShixunModel extends Component {
keywords: this.state.keywords, keywords: this.state.keywords,
page: this.state.page, page: this.state.page,
per_page:10, per_page:10,
item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
}; };
this.getdatasy(data); this.getdatasy(data);
this.getbasket_listdata(); this.getbasket_listdata();
@ -678,34 +678,57 @@ class NewMyShixunModel extends Component {
let url=""; let url="";
if(this.props.exam_id===undefined){ if(this.props.exam_id===undefined){
url=`/item_baskets/${id}.json`; url=`/item_baskets/${id}.json`;
axios.delete(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===undefined?"":parseInt(this.props.exam_id),
};
this.getdatasy(data);
this.getbasket_listdata();
}
}).catch((error) => {
//console.log(error);
})
}else{ }else{
url=`/examination_banks/${id}/revoke_item.json`; url=`/examination_banks/${this.props.exam_id}/revoke_item.json`;
axios.delete(url,{ data: {
item_id:id===undefined?"":parseInt(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===undefined?"":parseInt(this.props.exam_id),
};
this.getdatasy(data);
this.getbasket_listdata();
}
}).catch((error) => {
//console.log(error);
})
} }
axios.delete(url,{ data: {
item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
}})
.then((result) => {
if (result.data.status == 0) {
// this.props.showNotification(`撤销成功`);
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:10,
item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
};
this.getdatasy(data);
this.getbasket_listdata();
}
}).catch((error) => {
//console.log(error);
})
} }
//全选试题库 //全选试题库
selectallquestionsonthispage=()=>{ selectallquestionsonthispage=()=>{
@ -739,7 +762,7 @@ class NewMyShixunModel extends Component {
} }
const data={ const data={
item_ids:item_idsdata, item_ids:item_idsdata,
item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
} }
this.getitem_baskets(data); this.getitem_baskets(data);
this.setState({ this.setState({
@ -768,7 +791,7 @@ class NewMyShixunModel extends Component {
keywords: this.state.keywords, keywords: this.state.keywords,
page: this.state.page, page: this.state.page,
per_page:10, per_page:10,
item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
}; };
this.getdata(data); this.getdata(data);
this.getbasket_listdata(); this.getbasket_listdata();
@ -806,7 +829,7 @@ class NewMyShixunModel extends Component {
page: this.state.page, page: this.state.page,
per_page:10, per_page:10,
oj_status:oj_status, oj_status:oj_status,
item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
}; };
this.getdata(data); this.getdata(data);
} }

@ -426,8 +426,8 @@ class Paperreview_item extends Component {
}}> }}>
<div className="w100s sortinxdirection"> <div className="w100s sortinxdirection">
<div className="w70s sortinxdirection"> <div className="w70s sortinxdirection">
<p className="questionstishu lh34">题数{this.props.all_score}</p> <p className="questionstishu lh34">题数{this.props.all_questions_count}</p>
<p className="ml58 questionstotal lh34">总分{this.props.all_questions_count}</p> <p className="ml58 questionstotal lh34">总分{this.props.all_score}</p>
</div> </div>
<div className="w30s xaxisreverseorder"> <div className="w30s xaxisreverseorder">
<div className="jixuxuanti xiaoshou" onClick={() => this.props.setnewmyshixunmodelbool(true)}> <div className="jixuxuanti xiaoshou" onClick={() => this.props.setnewmyshixunmodelbool(true)}>

@ -59,8 +59,8 @@ class Paperreview_items extends Component {
let {paperreviewsingleindex,paperreviewsinglename,typenames,indexs,object,typenamesn}=this.props; let {paperreviewsingleindex,paperreviewsinglename,typenames,indexs,object,typenamesn}=this.props;
// console.log(object); // console.log(object);
console.log("Paperreview_items"); // console.log("Paperreview_items");
console.log(object.item_id); // console.log(object.item_id);
return ( return (
<div> <div>
{ {

@ -17,6 +17,7 @@ import Itembankstop from "./component/Itembankstop";
import NoneData from './component/NoneData'; import NoneData from './component/NoneData';
import './questioncss/questioncom.css'; import './questioncss/questioncom.css';
import '../tpm/newshixuns/css/Newshixuns.css'; import '../tpm/newshixuns/css/Newshixuns.css';
import QuillForEditor from "../../common/quillForEditor";
const tagArray = [ const tagArray = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
@ -69,13 +70,42 @@ class Paperreview_single extends Component {
render() { render() {
let {questions, totalscore, total, items} = this.state; let {questions, totalscore, total, items} = this.state;
let {objectsingle, indexx, paperreviewsingleindex, indexxy,name} = this.props; let {objectsingle, indexx, paperreviewsingleindex, indexxy,name} = this.props;
var itemssname="";
try {
itemssname= JSON.parse(objectsingle.name);
}catch (e) {
}
if(itemssname===undefined){
itemssname=objectsingle.name
}
return ( return (
<div key={indexxy} <div key={indexxy}
className={ "w100s borderwdswuh mb20 pd20 "} className={ "w100s borderwdswuh mb20 pd20 "}
onMouseEnter={() => this.props.showparagraphs(indexxy,name)} style={{ onMouseEnter={() => this.props.showparagraphs(indexxy,name)} style={{
minHeight: "114px", minHeight: "114px",
}}> }}>
<style>{
`
.programquill .ql-editor{
padding: 0px;
}
.programquill .ql-editor p{
line-height: 28px;
}
.programquills .ql-editor{
padding: 0px;
}
.programquills .ql-editor p{
line-height: 20px;
}
`
}</style>
{/*顶部*/} {/*顶部*/}
<div className="w100s sortinxdirection "> <div className="w100s sortinxdirection ">
<div className=" sortinxdirection "> <div className=" sortinxdirection ">
@ -99,9 +129,35 @@ class Paperreview_single extends Component {
` `
} }
</style> </style>
<div className=" lh28 listjihetixingstit markdown-body cretitlecolrlist" style={{wordBreak: "break-word"}} {
dangerouslySetInnerHTML={{__html: markdownToHTML(`${objectsingle.score}分) ` + objectsingle.name).replace(/▁/g, "▁▁▁")}}> objectsingle.item_type==="PROGRAM"?
</div> <div className="w100s sortinxdirection">
<div className=" tites lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word"}}
>
({objectsingle.score})
</div>
<div className="ml10 lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML(objectsingle.name).replace(/▁/g, "▁▁▁")}}>
</div>
</div>
:
<div className="w100s sortinxdirection">
<div className="tites lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word"}}
>
({objectsingle.score})
</div>
<div className="ml10 lh28 listjihetixingstit cretitlecolrlist programquill" style={{wordBreak: "break-word"}}
>
<QuillForEditor
readOnly={true}
value={itemssname}
/>
</div>
</div>
}
</div> </div>
{/*内容*/} {/*内容*/}
<div className="w100s sortinxdirection"> <div className="w100s sortinxdirection">
@ -114,7 +170,7 @@ class Paperreview_single extends Component {
objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => { objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => {
return ( return (
<p className={index === 1 ? "sortinxdirection ml10" : "sortinxdirection "}> <p className={index === 1 ? "sortinxdirection ml10" : "sortinxdirection "}>
<Radio checked={object.is_answer}> <Radio disabled={false}>
{object.choice_text} {object.choice_text}
</Radio> </Radio>
</p> </p>
@ -126,8 +182,17 @@ class Paperreview_single extends Component {
objectsingle.item_type === "PROGRAM" ? objectsingle.item_type === "PROGRAM" ?
<p className="w100s listjihetixingstitssy sortinxdirection "> <p className="w100s listjihetixingstitssy sortinxdirection ">
<p className={"sortinxdirection mt15"}> <p className={"sortinxdirection mt15"}>
<p style={{wordBreak: "break-word"}} {
dangerouslySetInnerHTML={{__html: markdownToHTML(objectsingle.program_attr.description).replace(/▁/g, "▁▁▁")}}></p> objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description?
<p className="programquill" style={{wordBreak: "break-word"}}
>
<QuillForEditor
readOnly={true}
value={JSON.parse(objectsingle.program_attr.description)}
/>
</p>
:
""}
</p> </p>
</p> </p>
: :
@ -137,8 +202,21 @@ class Paperreview_single extends Component {
return ( return (
<p className={index === 0 ? "sortinxdirection" : "sortinxdirection mt15"}> <p className={index === 0 ? "sortinxdirection" : "sortinxdirection mt15"}>
{tagArray[index]} {tagArray[index]}
<p style={{wordBreak: "break-word"}} <p className="programquills" style={{wordBreak: "break-word"}}>
dangerouslySetInnerHTML={{__html: markdownToHTML(object.choice_text).replace(/▁/g, "▁▁▁")}}></p> {object ?
object.choice_text === undefined || object.choice_text=== null || object.choice_text === "" ?
""
:
object.choice_text.length>0?
<QuillForEditor
readOnly={true}
value={JSON.parse(object.choice_text)}
/>
:""
:
""
}
</p>
</p> </p>
) )
}) })

@ -33,7 +33,7 @@ class Question extends Component {
placement: 'right', placement: 'right',
modalsType: false, modalsType: false,
modalsTypes:false, modalsTypes:false,
titilesm: "设为公开后,所有成员均可使用试题", titilesm: "在平台审核后,所有成员均可使用试题",
titiless: "是否设置为公开?", titiless: "是否设置为公开?",
titilesms:"单选题", titilesms:"单选题",
titbool: false, titbool: false,
@ -66,9 +66,28 @@ class Question extends Component {
oj_status:null, oj_status:null,
isVisible: false, isVisible: false,
selectionbools:false, selectionbools:false,
chakanjiexiboolindex:"无",
} }
} }
chakanjiexibool=(index)=>{
debugger
if(this.state.chakanjiexiboolindex===index){
this.setState({
chakanjiexiboolindex:"无",
})
return
}
this.setState({
chakanjiexiboolindex:index,
})
}
setmychakanjiexibool=(str)=>{
this.setState({
chakanjiexiboolindex:str,
})
}
setdiscipline_id=(discipline_id)=>{ setdiscipline_id=(discipline_id)=>{
this.setState({ this.setState({
discipline_id:discipline_id, discipline_id:discipline_id,
@ -338,6 +357,8 @@ class Question extends Component {
oj_status:this.state.oj_status oj_status:this.state.oj_status
}; };
this.getdata(data); this.getdata(data);
this.setmychakanjiexibool("无")
} }
showDrawer = () => { showDrawer = () => {
if(this.state.visible===true){ if(this.state.visible===true){
@ -378,7 +399,7 @@ class Question extends Component {
this.setState({ this.setState({
modalsType: true, modalsType: true,
titilesm: "设为公开后,所有成员均可使用试题", titilesm: "在平台审核后,所有成员均可使用试题",
titiless: "是否设置为公开?", titiless: "是否设置为公开?",
titbool: true, titbool: true,
timuid: id timuid: id
@ -882,6 +903,8 @@ class Question extends Component {
/> />
{/*头部*/} {/*头部*/}
<Contentpart {...this.state} {...this.props} <Contentpart {...this.state} {...this.props}
chakanjiexiboolindex={this.state.chakanjiexiboolindex}
chakanjiexibool={(e)=>this.chakanjiexibool(e)}
getitem_basketss={(id)=>this.getitem_basketss(id)} getitem_basketss={(id)=>this.getitem_basketss(id)}
selectallquestionsonthispage={()=>this.selectallquestionsonthispage()} selectallquestionsonthispage={()=>this.selectallquestionsonthispage()}
getitem_baskets={(e)=>this.getitem_baskets(e)} getitem_baskets={(e)=>this.getitem_baskets(e)}

@ -10,6 +10,7 @@ import axios from 'axios'
import update from 'immutability-helper' import update from 'immutability-helper'
import './../questioncss/questioncom.css'; import './../questioncss/questioncom.css';
import {getUrl, ActionBtn, DMDEditor, ConditionToolTip} from 'educoder'; import {getUrl, ActionBtn, DMDEditor, ConditionToolTip} from 'educoder';
import QuillForEditor from '../../../common/quillForEditor';
const { TextArea } = Input; const { TextArea } = Input;
const confirm = Modal.confirm; const confirm = Modal.confirm;
const $ = window.$ const $ = window.$
@ -70,10 +71,13 @@ class ChoquesEditor extends Component{
this.state = { this.state = {
question_choices: _question_choices || ['', '', '', ''], question_choices: _question_choices || ['', '', '', ''],
standard_answers: _standard_answers || [false, false, false, false], standard_answers: _standard_answers || [false, false, false, false],
question_title: this.props.question_title || '', question_title: this.props.question_title!==undefined?JSON.parse(this.props.question_title):"",
question_type: this.props.question_type || 0, question_type: this.props.question_type || 0,
question_score: this.props.question_score || this.props.init_question_score, question_score: this.props.question_score || this.props.init_question_score,
question_titles:this.props.question_titles||'', question_titles: this.props.question_titles!==undefined?JSON.parse(this.props.question_titles):"",
question_titlesysl:this.props.question_titlesysl||'',
question_titleysl:this.props.question_title || '',
item_banksedit:[],
} }
} }
addOption = () => { addOption = () => {
@ -122,12 +126,11 @@ class ChoquesEditor extends Component{
} }
onSave = () => { onSave = () => {
var editordata=[]; var editordata=[];
const {question_title, question_score, question_type,question_titles, question_choices, standard_answers } = this.state; const {question_title, question_score,question_titleysl,question_titlesysl, question_type,question_titles, question_choices, standard_answers } = this.state;
const { question_id_to_insert_after, question_id } = this.props const { question_id_to_insert_after, question_id } = this.props
// TODO check // TODO check
const answerArray = standard_answers.map((item, index) => { return item == true ? index+1 : -1 }).filter(item => item != -1); const answerArray = standard_answers.map((item, index) => { return item == true ? index+1 : -1 }).filter(item => item != -1);
if(!question_title) { if(!question_titleysl) {
this.refs['titleEditor'].showError()
this.props.showNotification('请您输入题干'); this.props.showNotification('请您输入题干');
return editordata; return editordata;
} }
@ -143,14 +146,12 @@ class ChoquesEditor extends Component{
for(let i = 0; i < question_choices.length; i++) { for(let i = 0; i < question_choices.length; i++) {
if (!question_choices[i]) { if (!question_choices[i]) {
this.refs[`optionEditor${i}`].showError()
this.props.showNotification(`请先输入 ${tagArray[i]} 选项的内容`); this.props.showNotification(`请先输入 ${tagArray[i]} 选项的内容`);
return editordata; return editordata;
} }
} }
if(!question_titles) { if(!question_titlesysl) {
this.refs['titleEditor2'].showError()
this.props.showNotification('请您输入题目解析'); this.props.showNotification('请您输入题目解析');
return editordata; return editordata;
} }
@ -162,7 +163,7 @@ class ChoquesEditor extends Component{
"question_choices":["a答案","b答案","c答案","d答案"], "question_choices":["a答案","b答案","c答案","d答案"],
"standard_answers":[1] "standard_answers":[1]
}*/ }*/
editordata=[question_title,answerArray,question_choices,question_titles]; editordata=[question_titleysl,answerArray,question_choices,question_titlesysl];
// question_title, // question_title,
// question_type: answerArray.length > 1 ? 1 : 0, // question_type: answerArray.length > 1 ? 1 : 0,
// question_score, // question_score,
@ -186,8 +187,10 @@ class ChoquesEditor extends Component{
try { try {
this.setState({ this.setState({
item_banksedit:this.props.item_banksedit, item_banksedit:this.props.item_banksedit,
question_title:this.props.item_banksedit.name, question_title: this.props.item_banksedit.name!==undefined?JSON.parse(this.props.item_banksedit.name):"",
question_titles:this.props.item_banksedit.analysis, question_titleysl:this.props.item_banksedit.name|| '',
question_titles: this.props.item_banksedit.analysis!==undefined?JSON.parse(this.props.item_banksedit.analysis):"",
question_titlesysl:this.props.item_banksedit.analysis||'',
mychoicess:this.props.item_banksedit.choices, mychoicess:this.props.item_banksedit.choices,
}) })
@ -205,8 +208,10 @@ class ChoquesEditor extends Component{
if(prevProps.item_banksedit !== this.props.item_banksedit) { if(prevProps.item_banksedit !== this.props.item_banksedit) {
this.setState({ this.setState({
item_banksedit: this.props.item_banksedit, item_banksedit: this.props.item_banksedit,
question_title: this.props.item_banksedit.name, question_title: this.props.item_banksedit.name!==undefined?JSON.parse(this.props.item_banksedit.name):"",
question_titles: this.props.item_banksedit.analysis, question_titleysl:this.props.item_banksedit.name|| '',
question_titles: this.props.item_banksedit.analysis!==undefined?JSON.parse(this.props.item_banksedit.analysis):"",
question_titlesysl:this.props.item_banksedit.analysis||'',
mychoicess: this.props.item_banksedit.choices, mychoicess: this.props.item_banksedit.choices,
}) })
@ -217,15 +222,34 @@ class ChoquesEditor extends Component{
standard_answers[index] = !standard_answers[index] standard_answers[index] = !standard_answers[index]
this.setState({ standard_answers }) this.setState({ standard_answers })
} }
onOptionContentChange = (value, index) => { onOptionContentChange = (value,quill,index) => {
if (index >= this.state.question_choices.length) { if (index >= this.state.question_choices.length) {
// TODO 新建然后删除CD选项再输入题干会调用到这里且index是3 // TODO 新建然后删除CD选项再输入题干会调用到这里且index是3
return; return;
} }
var texts;
const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) {
// 处理编辑器内容为空
texts="";
} else {
if(_text.length>=301){
var result = _text.substring(0,300);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
// 提交到后台的内容需要处理一下;
value = JSON.stringify(value);
texts=value;
}
}
let question_choices = this.state.question_choices.slice(0); let question_choices = this.state.question_choices.slice(0);
question_choices[index] = value; question_choices[index] = texts;
this.setState({ question_choices }) console.log(question_choices);
this.setState({ question_choices });
} }
on_question_score_change = (e) => { on_question_score_change = (e) => {
this.setState({ question_score: e }) this.setState({ question_score: e })
} }
@ -241,6 +265,57 @@ class ChoquesEditor extends Component{
toShowMode = () => { toShowMode = () => {
} }
onContentChange=(value,quill)=>{
const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) {
// 处理编辑器内容为空
this.setState({
question_titleysl:""
})
} else {
// 提交到后台的内容需要处理一下;
var texts="";
if(_text.length>=1001){
var result = _text.substring(0,1000);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
value = JSON.stringify(value)
texts=value;
}
this.setState({
question_titleysl:texts
})
}
}
onContentChanges=(value,quill)=>{
const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) {
// 处理编辑器内容为空
this.setState({
question_titlesysl:""
})
} else {
// 提交到后台的内容需要处理一下;
var texts="";
if(_text.length>=1001){
var result = _text.substring(0,1000);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
value = JSON.stringify(value)
texts=value;
}
this.setState({
question_titlesysl:texts
})
}
}
render() { render() {
let { question_title, question_score, question_type, question_choices, standard_answers,question_titles} = this.state; let { question_title, question_score, question_type, question_choices, standard_answers,question_titles} = this.state;
let { question_id, index, exerciseIsPublish, let { question_id, index, exerciseIsPublish,
@ -271,7 +346,7 @@ class ChoquesEditor extends Component{
flex:1 flex:1
} }
.optionRow { .optionRow {
margin:0px!important; /* margin:0px!important; */
/* margin-bottom: 20px!important; */ /* margin-bottom: 20px!important; */
} }
.signleEditor .content_editorMd_show{ .signleEditor .content_editorMd_show{
@ -291,11 +366,14 @@ class ChoquesEditor extends Component{
<span className="xingtigan fl">题干</span> <span className="xingtigan fl">题干</span>
</p> </p>
<TPMMDEditor mdID={qNumber} placeholder="请您输入题干" height={155} className=" mt10" <QuillForEditor
initValue={question_title} onChange={(val) => this.setState({ question_title: val})} style={{ height: '155px'}}
ref="titleEditor" placeholder="请您输入题干"
options={['code-block', 'image', 'formula']}
value={question_title}
onContentChange={this.onContentChange}
></TPMMDEditor> />
<div className="mb10 sortinxdirection"> <div className="mb10 sortinxdirection">
{/* {!question_id ? '新建' : '编辑'} */} {/* {!question_id ? '新建' : '编辑'} */}
@ -305,7 +383,7 @@ class ChoquesEditor extends Component{
{question_choices.map( (item, index) => { {question_choices.map( (item, index) => {
const bg = standard_answers[index] ? 'check-option-bg' : '' const bg = standard_answers[index] ? 'check-option-bg' : ''
return <div className="df optionRow " > return <div className={index>0?"df optionRow mt15": "df optionRow"} >
{/* 点击设置答案 */} {/* 点击设置答案 */}
{/* TODO 加了tooltip后会丢失掉span的class */} {/* TODO 加了tooltip后会丢失掉span的class */}
{/* <Tooltip title={standard_answers[index] ? '点击取消标准答案设置' : '点击设置为标准答案'}> */} {/* <Tooltip title={standard_answers[index] ? '点击取消标准答案设置' : '点击设置为标准答案'}> */}
@ -317,13 +395,26 @@ class ChoquesEditor extends Component{
</span> </span>
{/* </Tooltip> */} {/* </Tooltip> */}
<div style={{ flex: '0 0 1038px'}}> <div style={{ flex: '0 0 1038px'}}>
<DMDEditor
ref={`optionEditor${index}`} {
toMDMode={this.toMDMode} toShowMode={this.toShowMode} item===undefined||item===null||item===""?
height={166} className={'optionMdEditor'} noStorage={true} <QuillForEditor
mdID={qNumber + index} placeholder="" onChange={(value) => this.onOptionContentChange(value, index)} style={{ height: '166px'}}
initValue={item} placeholder="请您输入题干"
></DMDEditor> options={['code-block', 'image', 'formula']}
value={item}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
/>
:
<QuillForEditor
style={{ height: '166px'}}
placeholder="请您输入题干"
options={['code-block', 'image', 'formula']}
value={JSON.parse(item)}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
/>
}
</div> </div>
{exerciseIsPublish || index<=2? {exerciseIsPublish || index<=2?
<i className=" font-18 ml15 mr20"></i> <i className=" font-18 ml15 mr20"></i>
@ -346,32 +437,19 @@ class ChoquesEditor extends Component{
<p className="mb10 clearfix"> <p className="mb10 mt10 clearfix">
{/* {!question_id ? '新建' : '编辑'} */} {/* {!question_id ? '新建' : '编辑'} */}
<span className="xingcolor font-16 fl mr4">*</span> <span className="xingcolor font-16 fl mr4">*</span>
<span className="xingtigan fl">题目解析</span> <span className="xingtigan fl">题目解析</span>
</p> </p>
<style>{` <div className="mt10"></div>
.optionMdEditor { <QuillForEditor
flex:1 style={{height: '166px' }}
} placeholder="请您输入题目解析"
.optionRow { options={['code-block', 'image', 'formula']}
margin:0px!important; value={question_titles}
/* margin-bottom: 20px!important; */ onContentChange={this.onContentChanges}
} />
.signleEditor .content_editorMd_show{
display: flex;
margin-top:0px!important;
border-radius:2px;
max-width: 1056px;
word-break:break-all;
}
`}</style>
<TPMMDEditor mdID={qNumber+question_choices.length} placeholder="请您输入题目解析" height={155} className=" mt10"
initValue={question_titles} onChange={(val) => this.setState({ question_titles: val})}
ref="titleEditor2"
></TPMMDEditor>
</div> </div>

@ -25,7 +25,6 @@ class Contentpart extends Component {
this.state = { this.state = {
page:1, page:1,
chakanjiexibool:false, chakanjiexibool:false,
chakanjiexiboolindex:"无",
} }
} }
//初始化 //初始化
@ -35,16 +34,7 @@ class Contentpart extends Component {
} }
chakanjiexibool=(index)=>{ chakanjiexibool=(index)=>{
debugger this.props.chakanjiexibool(index);
if(this.state.chakanjiexiboolindex===index){
this.setState({
chakanjiexiboolindex:"无",
})
return
}
this.setState({
chakanjiexiboolindex:index,
})
} }
render() { render() {
@ -139,7 +129,7 @@ class Contentpart extends Component {
} }
.ant-popover-inner-content { .xaxisreverseorder .ant-popover-inner-content {
padding:0px !important; padding:0px !important;
} }
@ -230,6 +220,7 @@ class Contentpart extends Component {
: this.props.Contentdata.items.map((object, index) => { : this.props.Contentdata.items.map((object, index) => {
return ( return (
<Listjihe {...this.state} {...this.props} <Listjihe {...this.state} {...this.props}
chakanjiexiboolindex={this.props.chakanjiexiboolindex}
chakanjiexibool={(keindex)=>this.chakanjiexibool(keindex)} chakanjiexibool={(keindex)=>this.chakanjiexibool(keindex)}
listjihe={index+1} listjihe={index+1}
keindex={index} keindex={index}

@ -413,6 +413,10 @@ class Itembankstop extends Component {
} }
NewknTypedeldel=(bool)=>{ NewknTypedeldel=(bool)=>{
if(this.state.rbkc===undefined || this.state.rbkc===null || this.state.rbkc===""){
this.props.showNotification(`请选择课程方向`);
return;
}
this.setState({ this.setState({
NewknTypedel:bool NewknTypedel:bool
}) })
@ -431,10 +435,6 @@ class Itembankstop extends Component {
return return
} }
if(this.state.rbkc===undefined || this.state.rbkc===null || this.state.rbkc===""){
this.props.showNotification(`请选择课程方向`);
return;
}
var data={ var data={
name:value, name:value,
sub_discipline_id:this.state.rbkc[1] sub_discipline_id:this.state.rbkc[1]

@ -10,6 +10,8 @@ import axios from 'axios'
import update from 'immutability-helper' import update from 'immutability-helper'
import './../questioncss/questioncom.css'; import './../questioncss/questioncom.css';
import {getUrl, ActionBtn, DMDEditor, ConditionToolTip} from 'educoder'; import {getUrl, ActionBtn, DMDEditor, ConditionToolTip} from 'educoder';
import QuillForEditor from '../../../common/quillForEditor';
const { TextArea } = Input; const { TextArea } = Input;
const confirm = Modal.confirm; const confirm = Modal.confirm;
const $ = window.$ const $ = window.$
@ -46,10 +48,12 @@ class JudquestionEditor extends Component{
this.state = { this.state = {
question_choices: _question_choices || ['', '', '', ''], question_choices: _question_choices || ['', '', '', ''],
standard_answers: _standard_answers || [false, false, false, false], standard_answers: _standard_answers || [false, false, false, false],
question_title: this.props.question_title || '', question_title: this.props.question_title!==undefined?JSON.parse(this.props.question_title):"",
question_type: this.props.question_type || 0, question_type: this.props.question_type || 0,
question_score: this.props.question_score || this.props.init_question_score, question_score: this.props.question_score || this.props.init_question_score,
question_titles:this.props.question_titles||'', question_titles: this.props.question_titles!==undefined?JSON.parse(this.props.question_titles):"",
question_titlesysl:this.props.question_titlesysl||'',
question_titleysl:this.props.question_title || '',
zqda:null, zqda:null,
item_banksedit:[], item_banksedit:[],
mychoicess:[], mychoicess:[],
@ -99,12 +103,11 @@ class JudquestionEditor extends Component{
} }
onSave = () => { onSave = () => {
var editordata=[]; var editordata=[];
const {question_title, question_score, question_type,question_titles, zqda,question_choices, standard_answers } = this.state; const {question_title, question_score,question_titleysl,question_titlesysl, question_type,question_titles, zqda,question_choices, standard_answers } = this.state;
const { question_id_to_insert_after, question_id } = this.props const { question_id_to_insert_after, question_id } = this.props
// TODO check // TODO check
const answerArray = standard_answers.map((item, index) => { return item == true ? index+1 : -1 }).filter(item => item != -1); const answerArray = standard_answers.map((item, index) => { return item == true ? index+1 : -1 }).filter(item => item != -1);
if(!question_title) { if(!question_titleysl) {
this.refs['titleEditor'].showError()
this.props.showNotification('请您输入题干'); this.props.showNotification('请您输入题干');
return editordata; return editordata;
} }
@ -117,8 +120,7 @@ class JudquestionEditor extends Component{
if(!question_titles) { if(!question_titlesysl) {
this.refs['titleEditor2'].showError()
this.props.showNotification('请您输入题目解析'); this.props.showNotification('请您输入题目解析');
return editordata; return editordata;
} }
@ -132,7 +134,7 @@ class JudquestionEditor extends Component{
}*/ }*/
editordata=[question_title,zqda,question_titles]; editordata=[question_titleysl,zqda,question_titlesysl];
// question_title, // question_title,
// question_type: answerArray.length > 1 ? 1 : 0, // question_type: answerArray.length > 1 ? 1 : 0,
// question_score, // question_score,
@ -156,31 +158,31 @@ class JudquestionEditor extends Component{
try { try {
this.setState({ this.setState({
item_banksedit:this.props.item_banksedit, item_banksedit:this.props.item_banksedit,
question_title:this.props.item_banksedit.name, question_title: this.props.item_banksedit.name!==undefined?JSON.parse(this.props.item_banksedit.name):"",
question_titles:this.props.item_banksedit.analysis, question_titles: this.props.item_banksedit.analysis!==undefined?JSON.parse(this.props.item_banksedit.analysis):"",
mychoicess:this.props.item_banksedit.choices, mychoicess:this.props.item_banksedit.choices,
}) })
if(this.props.item_banksedit){ // if(this.props.item_banksedit){
if(this.props.item_banksedit.choices){ // if(this.props.item_banksedit.choices){
for(var ik=0;ik<this.props.item_banksedit.choices.length;ik++ ){ // for(var ik=0;ik<this.props.item_banksedit.choices.length;ik++ ){
if( this.props.item_banksedit.choices[ik].choice_text==="正确"){ // if( this.props.item_banksedit.choices[ik].choice_text==="正确"){
if( this.props.item_banksedit.choices[ik].is_answer===true){ // if( this.props.item_banksedit.choices[ik].is_answer===true){
this.setState({ // this.setState({
zqda:"0" // zqda:"0"
}) // })
} // }
//
}else{ // }else{
if( this.props.item_banksedit.choices[ik].is_answer===true){ // if( this.props.item_banksedit.choices[ik].is_answer===true){
this.setState({ // this.setState({
zqda:"1" // zqda:"1"
}) // })
} // }
} // }
} // }
} // }
} // }
}catch (e) { }catch (e) {
} }
@ -194,31 +196,31 @@ class JudquestionEditor extends Component{
if(prevProps.item_banksedit !== this.props.item_banksedit){ if(prevProps.item_banksedit !== this.props.item_banksedit){
this.setState({ this.setState({
item_banksedit:this.props.item_banksedit, item_banksedit:this.props.item_banksedit,
question_title:this.props.item_banksedit.name, question_title: this.props.item_banksedit.name!==undefined?JSON.parse(this.props.item_banksedit.name):"",
question_titles:this.props.item_banksedit.analysis, question_titles: this.props.item_banksedit.analysis!==undefined?JSON.parse(this.props.item_banksedit.analysis):"",
mychoicess:this.props.item_banksedit.choices, mychoicess:this.props.item_banksedit.choices,
}) })
if(this.props.item_banksedit){ // if(this.props.item_banksedit){
if(this.props.item_banksedit.choices){ // if(this.props.item_banksedit.choices){
for(var ik=0;ik<this.props.item_banksedit.choices.length;ik++ ){ // for(var ik=0;ik<this.props.item_banksedit.choices.length;ik++ ){
if( this.props.item_banksedit.choices[ik].choice_text==="正确"){ // if( this.props.item_banksedit.choices[ik].choice_text==="正确"){
if( this.props.item_banksedit.choices[ik].is_answer===true){ // if( this.props.item_banksedit.choices[ik].is_answer===true){
this.setState({ // this.setState({
zqda:"0" // zqda:"0"
}) // })
} // }
//
}else{ // }else{
if( this.props.item_banksedit.choices[ik].is_answer===true){ // if( this.props.item_banksedit.choices[ik].is_answer===true){
this.setState({ // this.setState({
zqda:"1" // zqda:"1"
}) // })
} // }
} // }
} // }
} // }
} // }
} }
} }
@ -275,6 +277,55 @@ class JudquestionEditor extends Component{
}) })
} }
onContentChange=(value,quill)=>{
const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) {
// 处理编辑器内容为空
this.setState({
question_titleysl:""
})
} else {
// 提交到后台的内容需要处理一下;
var texts="";
if(_text.length>=1001){
var result = _text.substring(0,1000);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
value = JSON.stringify(value)
texts=value;
}
this.setState({
question_titleysl:texts
})
}
}
onContentChanges=(value,quill)=>{
const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) {
// 处理编辑器内容为空
this.setState({
question_titlesysl:""
})
} else {
// 提交到后台的内容需要处理一下;
var texts="";
if(_text.length>=1001){
var result = _text.substring(0,1000);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
value =JSON.stringify(value);
texts=value;
}
this.setState({
question_titlesysl:texts
})
}
}
render() { render() {
let { question_title, question_score, question_type, question_choices, standard_answers,question_titles} = this.state; let { question_title, question_score, question_type, question_choices, standard_answers,question_titles} = this.state;
let { question_id, index, exerciseIsPublish, let { question_id, index, exerciseIsPublish,
@ -325,11 +376,14 @@ class JudquestionEditor extends Component{
<span className="xingtigan fl">题干</span> <span className="xingtigan fl">题干</span>
</p> </p>
<TPMMDEditor mdID={qNumber} placeholder="请您输入题干" height={155} className=" mt10" <QuillForEditor
initValue={question_title} onChange={(val) => this.setState({ question_title: val})} style={{ height: '155px'}}
ref="titleEditor" placeholder="请您输入题干"
options={['code-block', 'image', 'formula']}
value={question_title}
onContentChange={this.onContentChange}
></TPMMDEditor> />
<div className="mb10 sortinxdirection"> <div className="mb10 sortinxdirection">
{/* {!question_id ? '新建' : '编辑'} */} {/* {!question_id ? '新建' : '编辑'} */}
@ -363,36 +417,23 @@ class JudquestionEditor extends Component{
<div> <div>
<div className="mt10">
<p className="mb10 clearfix"> <p className="mb10 clearfix">
{/* {!question_id ? '新建' : '编辑'} */} {/* {!question_id ? '新建' : '编辑'} */}
<span className="xingcolor font-16 fl mr4">*</span> <span className="xingcolor font-16 fl mr4">*</span>
<span className="xingtigan fl">题目解析</span> <span className="xingtigan fl">题目解析</span>
</p> </p>
<style>{`
.optionMdEditor {
flex:1
}
.optionRow {
margin:0px!important;
/* margin-bottom: 20px!important; */
}
.signleEditor .content_editorMd_show{
display: flex;
margin-top:0px!important;
border-radius:2px;
max-width: 1056px;
word-break:break-all;
}
`}</style>
<TPMMDEditor mdID={qNumber+question_choices.length} placeholder="请您输入题目解析" height={155} className=" mt10"
initValue={question_titles} onChange={(val) => this.setState({ question_titles: val})}
ref="titleEditor2"
></TPMMDEditor> <QuillForEditor
style={{height: '166px' }}
placeholder="请您输入题目解析"
options={['code-block', 'image', 'formula']}
value={question_titles}
onContentChange={this.onContentChanges}
/>
</div> </div>
</div>
</div> </div>
) )

@ -1,15 +1,18 @@
import React, {Component} from "react"; import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom'; import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl,markdownToHTML} from 'educoder'; import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl, markdownToHTML} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import { import {
notification, notification,
Spin, Spin,
Table, Table,
Pagination, Pagination,
Radio Radio,
Tooltip
} from "antd"; } from "antd";
import './../questioncss/questioncom.css'; import './../questioncss/questioncom.css';
import QuillForEditor from "../../../common/quillForEditor";
const tagArray = [ const tagArray = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
@ -20,74 +23,73 @@ const tagArrays = [
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
] ]
class Listjihe extends Component { class Listjihe extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
page:1, page: 1,
name:"单选题", name: "单选题",
nd:"简单", nd: "简单",
} }
} }
//初始化 //初始化
componentDidMount(){ componentDidMount() {
} }
//选用 //选用
Selectingpracticaltraining=(id)=>{ Selectingpracticaltraining = (id) => {
let data={} let data = {}
if(this.props.exam_id===undefined){ if (this.props.exam_id === undefined) {
data={ data = {
item_ids:[id] item_ids: [id]
} }
}else{ } else {
data={ data = {
item_ids:[id], item_ids: [id],
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
} }
} }
this.props.getitem_baskets(data); this.props.getitem_baskets(data);
} }
//撤销 //撤销
Selectingpracticaltrainings=(id)=>{ Selectingpracticaltrainings = (id) => {
this.props.getitem_basketss(id); this.props.getitem_basketss(id);
} }
render() { render() {
let {page,name,nd}=this.state; let {page, name, nd} = this.state;
let {defaultActiveKey,items,listjihe,chakanjiexiboolindex,keindex}=this.props; let {defaultActiveKey, items, listjihe, chakanjiexiboolindex, keindex} = this.props;
// 编程答案 // 编程答案
var rightkey=null var rightkey = null
if(items){ if (items) {
if(items.item_type){ if (items.item_type) {
if(items.item_type==="PROGRAM"){ if (items.item_type === "PROGRAM") {
}else{ } else {
if(items.item_type==="JUDGMENT") { if (items.item_type === "JUDGMENT") {
if(items.choices){ if (items.choices) {
if(items.choices.length>0){ if (items.choices.length > 0) {
var arr= items.choices; var arr = items.choices;
for(let data of arr) { for (let data of arr) {
if(data.is_answer===true){ if (data.is_answer === true) {
rightkey=data.choice_text; rightkey = data.choice_text;
break; break;
} }
} }
} }
} }
}else { } else {
if (items.choices) { if (items.choices) {
if (items.choices.length > 0) { if (items.choices.length > 0) {
var arr = items.choices; var arr = items.choices;
@ -106,11 +108,41 @@ class Listjihe extends Component {
} }
} }
var itemssname="";
try {
itemssname= JSON.parse(items.name);
}catch (e) {
}
if(itemssname===undefined){
itemssname=items.name
}
return ( return (
<div key={keindex} className={chakanjiexiboolindex===keindex?"w100s borderwds283 pd20 mb20 listjihecolors":"w100s borderwds pd20 mb20 listjihecolors"}> <div key={keindex}
className={chakanjiexiboolindex === keindex ? "w100s borderwds283 pd20 mb20 listjihecolors" : "w100s borderwds pd20 mb20 listjihecolors"}>
{/*顶部*/} {/*顶部*/}
<style>
{
` .markdown-body .ql-editor{
padding-left: 0px;
}
.markdown-body .ql-editor p{
line-height: 0px;
}
.programquill .ql-editor{
padding-left: 0px;
}
.programquill .ql-editor p{
line-height: 0px;
}
`
}
</style>
<div className="w100s sortinxdirection"> <div className="w100s sortinxdirection">
<div className="listjihetixingstitsy"> <div className="listjihetixingstitsy">
{ {
@ -120,17 +152,36 @@ class Listjihe extends Component {
<div className="listjihetixingstitsy"> <div className="listjihetixingstitsy">
. .
</div> </div>
<div className="ml10 w100s listjihetixingstit markdown-body" style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML(items&&items.name).replace(/▁/g, "▁▁▁")}}> {
</div> items.item_type==="PROGRAM"?
<a href={`/problems/${items.program_attr.identifier}/edit`}>
<div className="ml10 w100s listjihetixingstit markdown-body" style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML(items&&items.name).replace(/▁/g, "▁▁▁")}}></div>
</a>
:
<div className="ml10 w100s listjihetixingstit markdown-body" style={{wordBreak: "break-word"}}>
{ items===undefined||items===null||items===""?"":
items.name === undefined || items.name === null || items.name === "" ?
""
:
items.name.length>0?
<QuillForEditor
readOnly={true}
value={itemssname}
/>
:""
}
</div>
}
</div> </div>
{/*内容*/} {/*内容*/}
<div className="w100s sortinxdirection "> <div className="w100s sortinxdirection ">
{items.item_type==="JUDGMENT"? {items.item_type === "JUDGMENT" ?
<p className="w100s listjihetixingstits sortinxdirection "> <p className="w100s listjihetixingstitsp sortinxdirection ">
{ {
items === undefined ||items === null? "" : items.choices.map((object, index) => { items === undefined || items === null ? "" : items.choices.map((object, index) => {
return ( return (
<p className={index===1? "sortinxdirection ml10":"sortinxdirection " } > <p className={index === 1 ? "sortinxdirection ml10" : "sortinxdirection "}>
<Radio disabled={false}> <Radio disabled={false}>
{object.choice_text} {object.choice_text}
</Radio> </Radio>
@ -138,21 +189,52 @@ class Listjihe extends Component {
) )
}) })
} }
</p>: </p> :
items.item_type==="PROGRAM"? items.item_type === "PROGRAM" ?
<p className="w100s listjihetixingstitssy sortinxdirection "> <p className="w100s listjihetixingstitssy sortinxdirection ">
<p className={"sortinxdirection mt15"} > <p className={"sortinxdirection mt15"}>
<p style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML(items.program_attr.description).replace(/▁/g, "▁▁▁")}}></p> {
items&&items.program_attr&&items.program_attr.description?
<p className="programquill" style={{wordBreak: "break-word"}}
>
<QuillForEditor
readOnly={true}
value={JSON.parse(items.program_attr.description)}
/>
</p>
:""
}
</p> </p>
</p> </p>
: :
<p className="w100s listjihetixingstits verticallayout "> <p className="w100s listjihetixingstitsp verticallayout ">
{ {
items === undefined ||items === null? "" : items.choices.map((object, index) => { items === undefined || items === null ? "" : items.choices.map((object, index) => {
return ( return (
<p className={index===0?"sortinxdirection":"sortinxdirection mt15"} > <p className={index === 0 ? "sortinxdirection " : "sortinxdirection mt15 "}>
{tagArray[index]} <p className="lh26">{tagArray[index]}</p>
<p style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML(object.choice_text).replace(/▁/g, "▁▁▁")}}></p> <p className="programquill" style={{wordBreak: "break-word"}}>
{object ?
object.choice_text === undefined || object.choice_text=== null || object.choice_text === "" ?
""
:
object.choice_text.length>0?
<QuillForEditor
readOnly={true}
value={JSON.parse(object.choice_text)}
/>
:""
:
""
}
</p>
</p> </p>
) )
}) })
@ -163,91 +245,98 @@ class Listjihe extends Component {
<div className="w100s sortinxdirection mt10"> <div className="w100s sortinxdirection mt10">
<p className="listjihetixing">难度<span >{items.difficulty===1?"简单":items.difficulty===2?"适中":items.difficulty===3?"困难":""}</span></p> <p
<p className="ml30 listjihetixing">题型<span >{items.item_type==="SINGLE"?"单选题":items.item_type==="MULTIPLE"?"多选题":items.item_type==="JUDGMENT"?"判断题":items.item_type==="PROGRAM"?"编程题":""}</span></p> className="listjihetixing">难度<span>{items.difficulty === 1 ? "简单" : items.difficulty === 2 ? "适中" : items.difficulty === 3 ? "困难" : ""}</span>
</p>
<p
className="ml30 listjihetixing">题型<span>{items.item_type === "SINGLE" ? "单选题" : items.item_type === "MULTIPLE" ? "多选题" : items.item_type === "JUDGMENT" ? "判断题" : items.item_type === "PROGRAM" ? "编程题" : ""}</span>
</p>
</div> </div>
{/*更新时间*/} {/*更新时间*/}
<div className="w100s sortinxdirection"> <div className="w100s sortinxdirection">
<div className="w50s listjihetixingstit sortinxdirection"> <div className="w50s listjihetixingstit sortinxdirection">
<p className="updatetimes lh30">更新时间{items.update_time}</p> <p className="updatetimes lh30">更新时间{items.update_time}</p>
{ {
this.props.defaultActiveKey==="0"||this.props.defaultActiveKey===0? this.props.defaultActiveKey === "0" || this.props.defaultActiveKey === 0 ?
"" ""
: :
<p className="updatetimes lh30 ml45">创建者{items.author.name}</p> <p className="updatetimes lh30 ml45">创建者{items.author.name}</p>
} }
{ {
items.item_type==="PROGRAM"? items.item_type === "PROGRAM" ?
<p className="updatetimes lh30 ml45">编程语言{items.program_attr.language}</p> <p className="updatetimes lh30 ml45">编程语言{items.program_attr.language}</p>
:"" : ""
} }
{ {
items.item_type==="PROGRAM"? items.item_type === "PROGRAM" ?
items.program_attr.status===0? items.program_attr.status === 0 ?
<p className="updatetimes lh30 ml45 nofabu mt5">未发布</p> <p className="updatetimes lh30 ml45 nofabu mt5">未发布</p>
:"" : ""
:"" : ""
} }
</div> </div>
<div className="w50s xaxisreverseorder"> <div className="w50s xaxisreverseorder">
{ {
items.choosed===true? items.choosed === true ?
<p className="selectionss xiaoshou" onClick={()=>this.Selectingpracticaltrainings(items.id)}> <p className="selectionss xiaoshou" onClick={() => this.Selectingpracticaltrainings(items.id)}>
<i className="iconfont icon-jianhao font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i> <i className="iconfont icon-jianhao font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i>
<span className="mr15 lh30">撤销</span></p> <span className="mr15 lh30">撤销</span></p>
: :
items.item_type==="PROGRAM"? items.item_type === "PROGRAM" ?
items.program_attr.status===0? items.program_attr.status === 0 ?
<p className="selectionys jinzhixiaoshou" > <Tooltip placement="top" title={"编程题未发布,不能选用!"}>
<i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i> <p className="selectionys jinzhixiaoshou">
<span className="mr15 lh30">选用</span> <i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i>
</p> <span className="mr15 lh30">选用</span>
</p>
</Tooltip>
: :
<p className="selection xiaoshou" onClick={()=>this.Selectingpracticaltraining(items.id)}> <p className="selection xiaoshou" onClick={() => this.Selectingpracticaltraining(items.id)}>
<i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i> <i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i>
<span className="mr15 lh30">选用</span> <span className="mr15 lh30">选用</span>
</p> </p>
: :
<p className="selection xiaoshou" onClick={()=>this.Selectingpracticaltraining(items.id)}> <p className="selection xiaoshou" onClick={() => this.Selectingpracticaltraining(items.id)}>
<i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i> <i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i>
<span className="mr15 lh30">选用</span> <span className="mr15 lh30">选用</span>
</p> </p>
} }
{ {
defaultActiveKey===0||defaultActiveKey==="0"? defaultActiveKey === 0 || defaultActiveKey === "0" ?
<div className="xaxisreverseorder"> <div className="xaxisreverseorder">
<p className="viewparsings xiaoshou mr25" onClick={()=>this.props.showmodelysl(items.id)}> <p className="viewparsings xiaoshou mr25" onClick={() => this.props.showmodelysl(items.id)}>
<i className="iconfont icon-shanchu1 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i> <i className="iconfont icon-shanchu1 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>删除</span> <span>删除</span>
</p> </p>
{ {
items.item_type==="PROGRAM"? items.item_type === "PROGRAM" ?
<a href={`/problems/${items.program_attr.identifier}/edit`}> <a href={`/problems/${items.program_attr.identifier}/edit`}>
<p className="viewparsings xiaoshou mr25" > <p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i> <i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span> <span>编辑</span>
</p> </p>
</a> </a>
: :
<a href={`/question/edit/${items.id}`}> <a href={`/question/edit/${items.id}`}>
<p className="viewparsings xiaoshou mr25" > <p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i> <i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span> <span>编辑</span>
</p> </p>
</a> </a>
} }
{ {
items.public===false? items.public === false ?
items.item_type==="PROGRAM"? items.item_type === "PROGRAM" ?
items.program_attr.status===0? items.program_attr.status === 0 ?
"" ""
: :
<p className="viewparsings xiaoshou mr25" onClick={()=>this.props.showmodels(items.id)}> <p className="viewparsings xiaoshou mr25" onClick={() => this.props.showmodels(items.id)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i> <i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开</span> <span>公开</span>
</p> </p>
: :
<p className="viewparsings xiaoshou mr25" onClick={()=>this.props.showmodels(items.id)}> <p className="viewparsings xiaoshou mr25" onClick={() => this.props.showmodels(items.id)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i> <i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开</span> <span>公开</span>
</p> </p>
@ -256,54 +345,65 @@ class Listjihe extends Component {
} }
</div> </div>
:"" : ""
} }
{ {
items.item_type==="PROGRAM"? items.item_type === "PROGRAM" ?
"" ""
: :
<p className="viewparsings xiaoshou mr25" onClick={()=>this.props.chakanjiexibool(keindex)}> <p className="viewparsings xiaoshou mr25" onClick={() => this.props.chakanjiexibool(keindex)}>
<i className="iconfont icon-jiexi font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i> <i className="iconfont icon-jiexi font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
查看解析</p> 查看解析</p>
} }
</div> </div>
</div> </div>
{ {
chakanjiexiboolindex===keindex?<div> chakanjiexiboolindex === keindex ? <div>
<div className="w100s questiontypeheng mt23"> <div className="w100s questiontypeheng mt23">
</div> </div>
<div className=" sortinxdirection mt15 yldxtit" > <div className=" sortinxdirection mt15 yldxtit">
{ {
items.item_type==="SINGLE" || items.item_type==="MULTIPLE"? items.item_type === "SINGLE" || items.item_type === "MULTIPLE" ?
<p className=" testfondex yldxtit" <p className=" testfondex yldxtit"
style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML("答案:"+tagArrays[rightkey]).replace(/▁/g, "▁▁▁")}} style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML("答案:" + tagArrays[rightkey]).replace(/▁/g, "▁▁▁")}}
> >
</p> </p>
: :
<p className=" testfondex yldxtit" <p className=" testfondex yldxtit"
style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML("答案:"+rightkey).replace(/▁/g, "▁▁▁")}} style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML("答案:" + rightkey).replace(/▁/g, "▁▁▁")}}
> >
</p> </p>
} }
</div> </div>
{ <div className=" sortinxdirection mt15 yldxtit">
items&&items.analysis? <p className=" testfondex yldxtit programquill"
"" style={{wordBreak: "break-word"}}
:""
}
<div className=" sortinxdirection mt15 yldxtit" >
<p className=" testfondex yldxtit"
style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML("解析:"+items.analysis).replace(/▁/g, "▁▁▁")}}
> >
{items ?
items.analysis=== undefined || items.analysis=== null || items.analysis === "" ?
""
:
items.analysis.length>0?
<QuillForEditor
readOnly={true}
value={JSON.parse(items.analysis)}
/>
:
""
:
""
}
</p> </p>
</div> </div>
</div>:"" </div> : ""
} }
@ -313,4 +413,5 @@ class Listjihe extends Component {
} }
} }
export default Listjihe; export default Listjihe;

@ -75,10 +75,12 @@ class SingleEditor extends Component{
this.state = { this.state = {
question_choices: _question_choices || ['', '', '', ''], question_choices: _question_choices || ['', '', '', ''],
standard_answers: _standard_answers || [false, false, false, false], standard_answers: _standard_answers || [false, false, false, false],
question_title: this.props.question_title || '', question_title: this.props.question_title!==undefined?JSON.parse(this.props.question_title):"",
question_type: this.props.question_type || 0, question_type: this.props.question_type || 0,
question_score: this.props.question_score || this.props.init_question_score, question_score: this.props.question_score || this.props.init_question_score,
question_titles:this.props.question_titles||'', question_titles: this.props.question_titles!==undefined?JSON.parse(this.props.question_titles):"",
question_titlesysl:this.props.question_titlesysl||'',
question_titleysl:this.props.question_title || '',
item_banksedit:[], item_banksedit:[],
} }
} }
@ -121,12 +123,21 @@ class SingleEditor extends Component{
} }
onSave = () => { onSave = () => {
var editordata=[]; var editordata=[];
const {question_title, question_score, question_type,question_titles, question_choices, standard_answers } = this.state; const {question_title, question_titleysl,question_score, question_type,question_titles,question_titlesysl, question_choices, standard_answers } = this.state;
const { question_id_to_insert_after, question_id } = this.props const { question_id_to_insert_after, question_id } = this.props
// TODO check // TODO check
const answerArray = standard_answers.map((item, index) => { return item == true ? index+1 : -1 }).filter(item => item != -1); const answerArray = standard_answers.map((item, index) => { return item == true ? index+1 : -1 }).filter(item => item != -1);
if(!question_title) {
this.refs['titleEditor'].showError() // const _text = quill.getText();
// const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
// if (!reg.test(_text)) {
// // 处理编辑器内容为空
// } else {
// // 提交到后台的内容需要处理一下;
// value = JSON.stringify(value)
// }
if(!question_titleysl) {
// this.refs['titleEditor'].showError()
this.props.showNotification('请您输入题干'); this.props.showNotification('请您输入题干');
return editordata; return editordata;
} }
@ -139,14 +150,13 @@ class SingleEditor extends Component{
for(let i = 0; i < question_choices.length; i++) { for(let i = 0; i < question_choices.length; i++) {
if (!question_choices[i]) { if (!question_choices[i]) {
this.refs[`optionEditor${i}`].showError() // this.refs[`optionEditor${i}`].showError()
this.props.showNotification(`请先输入 ${tagArray[i]} 选项的内容`); this.props.showNotification(`请先输入 ${tagArray[i]} 选项的内容`);
return editordata; return editordata;
} }
} }
if(!question_titles) { if(!question_titlesysl) {
this.refs['titleEditor2'].showError()
this.props.showNotification('请您输入题目解析'); this.props.showNotification('请您输入题目解析');
return editordata; return editordata;
} }
@ -158,7 +168,7 @@ class SingleEditor extends Component{
"question_choices":["a答案","b答案","c答案","d答案"], "question_choices":["a答案","b答案","c答案","d答案"],
"standard_answers":[1] "standard_answers":[1]
}*/ }*/
editordata=[question_title,answerArray,question_choices,question_titles]; editordata=[question_titleysl,answerArray,question_choices,question_titlesysl];
// question_title, // question_title,
// question_type: answerArray.length > 1 ? 1 : 0, // question_type: answerArray.length > 1 ? 1 : 0,
// question_score, // question_score,
@ -184,8 +194,10 @@ class SingleEditor extends Component{
try { try {
this.setState({ this.setState({
item_banksedit:this.props.item_banksedit, item_banksedit:this.props.item_banksedit,
question_title:this.props.item_banksedit.name, question_title: this.props.item_banksedit.name!==undefined?JSON.parse(this.props.item_banksedit.name):"",
question_titles:this.props.item_banksedit.analysis, question_titleysl:this.props.item_banksedit.name|| '',
question_titles: this.props.item_banksedit.analysis!==undefined?JSON.parse(this.props.item_banksedit.analysis):"",
question_titlesysl:this.props.item_banksedit.analysis||'',
mychoicess:this.props.item_banksedit.choices, mychoicess:this.props.item_banksedit.choices,
}) })
@ -204,8 +216,10 @@ class SingleEditor extends Component{
if(prevProps.item_banksedit !== this.props.item_banksedit) { if(prevProps.item_banksedit !== this.props.item_banksedit) {
this.setState({ this.setState({
item_banksedit: this.props.item_banksedit, item_banksedit: this.props.item_banksedit,
question_title: this.props.item_banksedit.name, question_title: this.props.item_banksedit.name!==undefined?JSON.parse(this.props.item_banksedit.name):"",
question_titles: this.props.item_banksedit.analysis, question_titleysl:this.props.item_banksedit.name|| '',
question_titles: this.props.item_banksedit.analysis!==undefined?JSON.parse(this.props.item_banksedit.analysis):"",
question_titlesysl:this.props.item_banksedit.analysis||'',
mychoicess: this.props.item_banksedit.choices, mychoicess: this.props.item_banksedit.choices,
}) })
@ -229,14 +243,31 @@ class SingleEditor extends Component{
// standard_answers[index] = !standard_answers[index]; // standard_answers[index] = !standard_answers[index];
this.setState({ standard_answers }) this.setState({ standard_answers })
} }
onOptionContentChange = (value, index) => { onOptionContentChange = (value,quill,index) => {
if (index >= this.state.question_choices.length) { if (index >= this.state.question_choices.length) {
// TODO 新建然后删除CD选项再输入题干会调用到这里且index是3 // TODO 新建然后删除CD选项再输入题干会调用到这里且index是3
return; return;
} }
var texts;
const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) {
// 处理编辑器内容为空
texts="";
} else {
if(_text.length>=301){
var result = _text.substring(0,300);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
// 提交到后台的内容需要处理一下;
value = JSON.stringify(value)
texts=value;
}
}
let question_choices = this.state.question_choices.slice(0); let question_choices = this.state.question_choices.slice(0);
question_choices[index] = value; question_choices[index] = texts;
this.setState({ question_choices }) this.setState({ question_choices });
} }
on_question_score_change = (e) => { on_question_score_change = (e) => {
this.setState({ question_score: e }) this.setState({ question_score: e })
@ -254,11 +285,61 @@ class SingleEditor extends Component{
} }
onContentChange=(e)=>{ onContentChange=(value,quill)=>{
console.log(e); const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) {
// 处理编辑器内容为空
this.setState({
question_titleysl:""
})
} else {
// 提交到后台的内容需要处理一下;
var texts="";
if(_text.length>=1001){
var result = _text.substring(0,1000);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
value = JSON.stringify(value)
texts=value;
}
this.setState({
question_titleysl:texts
})
}
}
onContentChanges=(value,quill)=>{
const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) {
// 处理编辑器内容为空
this.setState({
question_titlesysl:""
})
} else {
var texts="";
if(_text.length>=1001){
var result = _text.substring(0,1000);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
value = JSON.stringify(value)
texts=value;
}
this.setState({
question_titleysl:texts
})
}
}
handleShowImage = (url) => {
console.log("点击了图片放大");
console.log(url);
alert(url);
} }
render() { render() {
let { question_title, question_score, question_type, question_choices, standard_answers,question_titles} = this.state; let { question_title, question_score, question_type, question_choices, standard_answers,question_titles,question_titlesysl} = this.state;
let { question_id, index, exerciseIsPublish, let { question_id, index, exerciseIsPublish,
// question_title, // question_title,
// question_type, // question_type,
@ -279,7 +360,6 @@ class SingleEditor extends Component{
// ////console.log("xuanzheshijuan"); // ////console.log("xuanzheshijuan");
// ////console.log(answerTagArray); // ////console.log(answerTagArray);
// ////console.log(!exerciseIsPublish); // ////console.log(!exerciseIsPublish);
return( return(
<div className="padding20-30 signleEditor danxuano" id={qNumber}> <div className="padding20-30 signleEditor danxuano" id={qNumber}>
<style>{` <style>{`
@ -287,7 +367,7 @@ class SingleEditor extends Component{
flex:1 flex:1
} }
.optionRow { .optionRow {
margin:0px!important; /* margin:0px!important; */
/* margin-bottom: 20px!important; */ /* margin-bottom: 20px!important; */
} }
.signleEditor .content_editorMd_show{ .signleEditor .content_editorMd_show{
@ -307,21 +387,16 @@ class SingleEditor extends Component{
<span className="xingtigan fl">题干</span> <span className="xingtigan fl">题干</span>
</p> </p>
<TPMMDEditor mdID={qNumber} placeholder="请您输入题干" height={155} className=" mt10" <QuillForEditor
initValue={question_title} onChange={(val) => this.setState({ question_title: val})} style={{ height: '155px'}}
ref="titleEditor" placeholder="请您输入题干"
options={['code-block', 'image', 'formula']}
></TPMMDEditor> value={question_title}
onContentChange={this.onContentChange}
{/*<QuillForEditor*/} />
{/* style={{ height: '155px'}}*/}
{/* placeholder="请您输入题干"*/}
{/* value={question_title}*/}
{/* options={['code-block', 'image', 'formula']}*/}
{/* onContentChange={this.onContentChange}*/}
{/*/>*/}
<div className="mb10 sortinxdirection"> <div className="mb10 mt10 sortinxdirection">
{/* {!question_id ? '新建' : '编辑'} */} {/* {!question_id ? '新建' : '编辑'} */}
<span className="xingcolor font-16 fl mr4">*</span> <span className="xingcolor font-16 fl mr4">*</span>
<span className="xingtigans fl"><span className="xingtigan">答案选项</span></span> <span className="xingtigans fl"><span className="xingtigan">答案选项</span></span>
@ -329,11 +404,11 @@ class SingleEditor extends Component{
{question_choices.map( (item, index) => { {question_choices.map( (item, index) => {
const bg = standard_answers[index] ? 'check-option-bg' : '' const bg = standard_answers[index] ? 'check-option-bg' : ''
return <div className="df optionRow " > return <div className={index>0?"df optionRow mt15": "df optionRow"} key={index} >
{/* 点击设置答案 */} {/* 点击设置答案 */}
{/* TODO 加了tooltip后会丢失掉span的class */} {/* TODO 加了tooltip后会丢失掉span的class */}
{/* <Tooltip title={standard_answers[index] ? '点击取消标准答案设置' : '点击设置为标准答案'}> */} {/* <Tooltip title={standard_answers[index] ? '点击取消标准答案设置' : '点击设置为标准答案'}> */}
<span class={`option-item fr mr10 color-grey select-choice ${bg} `} <span className={`option-item fr mr10 color-grey select-choice ${bg} `}
name="option_span" onClick={() => this.onOptionClick(index)} style={{flex: '0 0 38px'}}> name="option_span" onClick={() => this.onOptionClick(index)} style={{flex: '0 0 38px'}}>
<ConditionToolTip title={standard_answers[index] ? '' : '点击设置为标准答案'} placement="left" condition={true}> <ConditionToolTip title={standard_answers[index] ? '' : '点击设置为标准答案'} placement="left" condition={true}>
<div style={{width: '100%', height: '100%'}}>{tagArray[index]}</div> <div style={{width: '100%', height: '100%'}}>{tagArray[index]}</div>
@ -341,13 +416,30 @@ class SingleEditor extends Component{
</span> </span>
{/* </Tooltip> */} {/* </Tooltip> */}
<div style={{ flex: '0 0 1038px'}}> <div style={{ flex: '0 0 1038px'}}>
<DMDEditor {
ref={`optionEditor${index}`} item===undefined||item===null||item===""?
toMDMode={this.toMDMode} toShowMode={this.toShowMode} <QuillForEditor
height={166} className={'optionMdEditor'} noStorage={true} style={{ height: '166px'}}
mdID={qNumber + index} placeholder="" onChange={(value) => this.onOptionContentChange(value, index)} placeholder="请您输入题干"
initValue={item} options={['code-block', 'image', 'formula']}
></DMDEditor> value={item}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
/>
:
<QuillForEditor
style={{ height: '166px'}}
placeholder="请您输入题干"
options={['code-block', 'image', 'formula']}
value={JSON.parse(item)}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
/>
}
</div> </div>
{exerciseIsPublish || index<=1? {exerciseIsPublish || index<=1?
<i className=" font-18 ml15 mr20"></i> <i className=" font-18 ml15 mr20"></i>
@ -366,36 +458,20 @@ class SingleEditor extends Component{
<div> <div className="mt10">
<p className="mb10 clearfix">
<p className="mb10 clearfix">
{/* {!question_id ? '新建' : '编辑'} */} {/* {!question_id ? '新建' : '编辑'} */}
<span className="xingcolor font-16 fl mr4">*</span> <span className="xingcolor font-16 fl mr4">*</span>
<span className="xingtigan fl">题目解析</span> <span className="xingtigan fl">题目解析</span>
</p> </p>
<style>{` <div className="mt10"></div>
.optionMdEditor { <QuillForEditor
flex:1 style={{height: '166px' }}
} placeholder="请您输入题目解析"
.optionRow { options={['code-block', 'image', 'formula']}
margin:0px!important; value={question_titles}
/* margin-bottom: 20px!important; */ onContentChange={this.onContentChanges}
} />
.signleEditor .content_editorMd_show{
display: flex;
margin-top:0px!important;
border-radius:2px;
max-width: 1056px;
word-break:break-all;
}
`}</style>
<TPMMDEditor mdID={qNumber+question_choices.length} placeholder="请您输入题目解析" height={155} className=" mt10"
initValue={question_titles} onChange={(val) => this.setState({ question_titles: val})}
ref="titleEditor2"
></TPMMDEditor>
</div> </div>

@ -332,6 +332,12 @@
line-height:19px; line-height:19px;
margin-top: 19px; margin-top: 19px;
} }
.listjihetixingstitsp{
color: #333333;
font-size: 14px;
line-height:19px;
margin-top: 10px;
}
.listjihetixingstitssy{ .listjihetixingstitssy{
color: #333333; color: #333333;
font-size: 14px; font-size: 14px;
@ -939,3 +945,14 @@
.searchwidth{ .searchwidth{
width: 347px !important; width: 347px !important;
} }
.lh26{
line-height: 26px !important;
}
.tites{
color: #888888 !important;
}
.ant-popover-inner-content{
padding: 0px !important;
}

@ -258,17 +258,24 @@ class Paperlibraryeditid extends Component {
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200wuh mt19"> <div className=" clearfix educontent Contentquestionbankstyle w100s w1200wuh mt19">
<style>
{
`
.seeoagertitscss .jixuxuanti{
background:#4CACFF;
}
`
}
</style>
<div className={"seeoagertitscss"}>
<Seeoagertits <Seeoagertits
setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}
all_score={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_questions_count} all_score={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_questions_count}
all_questions_count={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_score} all_questions_count={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_score}
difficulty={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.difficulty} difficulty={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.difficulty}
> >
</Seeoagertits> </Seeoagertits>
</div>
<Paperlibraryseeid_itemss <Paperlibraryseeid_itemss
{...this.state} {...this.state}
{...this.props} {...this.props}

@ -103,17 +103,12 @@ class Contentpart extends Component {
} }
.sortinxdirection .ant-input-lg { .sortinxdirection .ant-input-lg {
height: 41px;} height: 41px;}
.sortinxdirection .ant-popover{ .sortinxdirection .ant-popover{
top: 348px !important; top: 348px !important;
} }
.ant-popover-inner-content {
padding:0px !important;
}
` `
} }
</style> </style>

@ -15,6 +15,7 @@ import {
} from "antd"; } from "antd";
import '../testioncss/testioncss.css'; import '../testioncss/testioncss.css';
import '../../tpm/newshixuns/css/Newshixuns.css'; import '../../tpm/newshixuns/css/Newshixuns.css';
import QuillForEditor from "../../../common/quillForEditor";
const tagArray = [ const tagArray = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
@ -67,15 +68,42 @@ class Paperlibraryseeid_items extends Component {
render() { render() {
let {questions, totalscore, total, items} = this.state; let {questions, totalscore, total, items} = this.state;
let {objectsingle, indexx, paperreviewsingleindex, indexxy,name} = this.props; let {objectsingle, indexx, paperreviewsingleindex, indexxy,name} = this.props;
// console.log("objectsingle");
// console.log(objectsingle);
var itemssname="";
try {
itemssname= JSON.parse(objectsingle.name);
}catch (e) {
}
if(itemssname===undefined){
itemssname=objectsingle.name
}
return ( return (
<div key={indexxy} <div key={indexxy}
className={ "w100s borderwdswuh mb20 pd20 "} className={ "w100s borderwdswuh mb20 pd20 "}
style={{ style={{
minHeight: "114px", minHeight: "114px",
}}> }}>
<style>{
`
.programquill .ql-editor{
padding: 0px;
}
.programquill .ql-editor p{
line-height: 28px;
}
.programquills .ql-editor{
padding: 0px;
}
.programquills .ql-editor p{
line-height: 20px;
}
`
}</style>
{/*顶部*/} {/*顶部*/}
<div className="w100s sortinxdirection "> <div className="w100s sortinxdirection ">
<div className=" sortinxdirection "> <div className=" sortinxdirection ">
@ -100,29 +128,46 @@ class Paperlibraryseeid_items extends Component {
} }
</style> </style>
{ {
this.props.typenames==="PROGRAM"? objectsingle.item_type==="PROGRAM"?
<div className=" lh28 listjihetixingstit markdown-body cretitlecolrlist" style={{wordBreak: "break-word"}} <div className="w100s sortinxdirection">
dangerouslySetInnerHTML={{__html: markdownToHTML( objectsingle.name).replace(/▁/g, "▁▁▁")}}> <div className=" tites lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word"}}
</div> >
({objectsingle.score})
</div>
<div className="ml10 lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML(objectsingle.name).replace(/▁/g, "▁▁▁")}}>
</div>
</div>
: :
<div className=" lh28 listjihetixingstit markdown-body cretitlecolrlist" style={{wordBreak: "break-word"}} <div className="w100s sortinxdirection">
dangerouslySetInnerHTML={{__html: markdownToHTML(`${objectsingle.score}分) ` + objectsingle.name).replace(/▁/g, "▁▁▁")}}> <div className="tites lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word"}}
>
({objectsingle.score})
</div>
<div className="ml10 lh28 listjihetixingstit cretitlecolrlist programquill" style={{wordBreak: "break-word"}}
>
<QuillForEditor
readOnly={true}
value={itemssname}
/>
</div>
</div> </div>
} }
</div> </div>
{/*内容*/} {/*内容*/}
<div className="w100s sortinxdirection"> <div className="w100s sortinxdirection">
{ {
objectsingle.item_type === "JUDGMENT" ? objectsingle.item_type === "JUDGMENT" ?
<p className="w100s listjihetixingstits sortinxdirection "> <p className="w100s listjihetixingstits sortinxdirection ">
{ {
objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => { objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => {
return ( return (
<p className={index === 1 ? "sortinxdirection ml10" : "sortinxdirection "} key={index}> <p className={index === 1 ? "sortinxdirection ml10" : "sortinxdirection "}>
<Radio checked={object.is_answer}> <Radio disabled={false}>
{object.choice_text} {object.choice_text}
</Radio> </Radio>
</p> </p>
@ -134,8 +179,17 @@ class Paperlibraryseeid_items extends Component {
objectsingle.item_type === "PROGRAM" ? objectsingle.item_type === "PROGRAM" ?
<p className="w100s listjihetixingstitssy sortinxdirection "> <p className="w100s listjihetixingstitssy sortinxdirection ">
<p className={"sortinxdirection mt15"}> <p className={"sortinxdirection mt15"}>
<p style={{wordBreak: "break-word"}} {
dangerouslySetInnerHTML={{__html: markdownToHTML(objectsingle.program_attr.description).replace(/▁/g, "▁▁▁")}}></p> objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description?
<p className="programquill" style={{wordBreak: "break-word"}}
>
<QuillForEditor
readOnly={true}
value={JSON.parse(objectsingle.program_attr.description)}
/>
</p>
:
""}
</p> </p>
</p> </p>
: :
@ -143,10 +197,23 @@ class Paperlibraryseeid_items extends Component {
{ {
objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => { objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => {
return ( return (
<p className={index === 0 ? "sortinxdirection" : "sortinxdirection mt15"} key={index}> <p className={index === 0 ? "sortinxdirection" : "sortinxdirection mt15"}>
{tagArray[index]} {tagArray[index]}
<p style={{wordBreak: "break-word"}} <p className="programquills" style={{wordBreak: "break-word"}}>
dangerouslySetInnerHTML={{__html: markdownToHTML(object.choice_text).replace(/▁/g, "▁▁▁")}}></p> {object ?
object.choice_text === undefined || object.choice_text=== null || object.choice_text === "" ?
""
:
object.choice_text.length>0?
<QuillForEditor
readOnly={true}
value={JSON.parse(object.choice_text)}
/>
:""
:
""
}
</p>
</p> </p>
) )
}) })
@ -154,7 +221,6 @@ class Paperlibraryseeid_items extends Component {
</p> </p>
} }
</div> </div>

@ -892,3 +892,6 @@
width: 39px; width: 39px;
height: 44px; height: 44px;
} }
.tites{
color: #888888 !important;
}

@ -1,8 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; import moment from 'moment';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { getImageUrl, toPath } from 'educoder'
import PropTypes from 'prop-types';
class NewFooter extends Component { class NewFooter extends Component {
constructor(props) { constructor(props) {
@ -58,7 +57,7 @@ class NewFooter extends Component {
{this.props.mygetHelmetapi === null ? "" : {this.props.mygetHelmetapi === null ? "" :
this.props.mygetHelmetapi===undefined|| this.props.mygetHelmetapi.footer===null||this.props.mygetHelmetapi.footer===undefined? this.props.mygetHelmetapi===undefined|| this.props.mygetHelmetapi.footer===null||this.props.mygetHelmetapi.footer===undefined?
<p className="footer_con-p inline lineh-30 font-14"> <p className="footer_con-p inline lineh-30 font-14">
<span className="font-18 fl">©</span>&nbsp;2019&nbsp;EduCoder <span className="font-18 fl">©</span>&nbsp;{moment().year()}&nbsp;EduCoder
<a style={{"color":"#888"}} target="_blank" href="http://beian.miit.gov.cn/" className="ml15 mr15">湘ICP备17009477号</a> <a style={{"color":"#888"}} target="_blank" href="http://beian.miit.gov.cn/" className="ml15 mr15">湘ICP备17009477号</a>
<a style={{"color":"#888"}} target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=43019002000962" className="mr15"> <a style={{"color":"#888"}} target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=43019002000962" className="mr15">
<img className="vertical4" src={require('./beian.png')}/>湘公网安备43019002000962号 <img className="vertical4" src={require('./beian.png')}/>湘公网安备43019002000962号

@ -948,6 +948,13 @@ submittojoinclass=(value)=>{
return ( return (
<div className="newHeaders" id="nHeader" > <div className="newHeaders" id="nHeader" >
<style>{
`
body .questionbanks .ant-popover-inner-content {
padding:0px !important;
}
`
}</style>
{isRender===true?<LoginDialog {isRender===true?<LoginDialog
Modifyloginvalue={()=>this.Modifyloginvalue()} Modifyloginvalue={()=>this.Modifyloginvalue()}
@ -1033,13 +1040,13 @@ submittojoinclass=(value)=>{
top: 63px !important; top: 63px !important;
} }
.ant-popover-inner-content { .questionbanks .ant-popover-inner-content {
padding:0px !important; padding:0px !important;
} }
` `
} }
</style> </style>
<li className={`pr `}> <li className={`pr questionbanks`}>
<Popover placement="bottom" content={contents} trigger="click" > <Popover placement="bottom" content={contents} trigger="click" >
<div className=" sortinxdirection mr10"> <div className=" sortinxdirection mr10">
<div style={{ <div style={{

@ -465,6 +465,7 @@ class TPMBanner extends Component {
modalsMidval:"• 我们将在1-2个工作日内完成审核", modalsMidval:"• 我们将在1-2个工作日内完成审核",
ModalCancel: this.eopenpublicupdatadata, ModalCancel: this.eopenpublicupdatadata,
ModalSave: this.eopenpublicupdatadata, ModalSave: this.eopenpublicupdatadata,
Loadtype:true,
modalstyles:"848282" modalstyles:"848282"
}) })
} }

@ -719,7 +719,7 @@ export default class TPMchallengesnew extends Component {
shixunsskillvaluelist===undefined?"":shixunsskillvaluelist.length === 0 ? "" : shixunsskillvaluelist.map((itme, key) => { shixunsskillvaluelist===undefined?"":shixunsskillvaluelist.length === 0 ? "" : shixunsskillvaluelist.map((itme, key) => {
return ( return (
<li key={key} className={"fl ml10 mr10"}> <li key={key} className={"fl ml10 mr10"}>
<Badge className={"tpmpointer"} count={"x"} onClick={(key) => this.delshixunsskilllist(key)}> <Badge className={"tpmpointer"} count={"x"} onClick={() => this.delshixunsskilllist(key)}>
<Button type="primary" ghost className={"Permanentban "}> <Button type="primary" ghost className={"Permanentban "}>
{itme} {itme}
</Button> </Button>

@ -67,6 +67,18 @@ class TPMRightSection extends Component {
return ( return (
<div> <div>
<style>
{
`
.altimgs{
border-radius: 4px;
width: 100px;
height: 60px;
}
`
}
</style>
{ {
TPMRightSectionData === undefined ? "" : TPMRightSectionData === undefined ? "" :
<div> <div>
@ -86,7 +98,7 @@ class TPMRightSection extends Component {
{TPMRightSectionData === undefined ? "" : TPMRightSectionData.creator === undefined ? "" : TPMRightSectionData.creator.name} {TPMRightSectionData === undefined ? "" : TPMRightSectionData.creator === undefined ? "" : TPMRightSectionData.creator.name}
</div> </div>
<div className={"creatornamelist width80center"}> <div className={"creatornamelist width80center"}>
<span className={"color888hezuo"}>共发布实训</span> <span className={"color-grey-3"}>{TPMRightSectionData.user_shixuns_count}</span> <span className={"color888hezuo"}></span> <span className={"color888hezuo font-14"}>共发布实训</span> <span className={"color-grey-3"}>{TPMRightSectionData.user_shixuns_count}</span> <span className={"color888hezuo"}></span>
</div> </div>
</div> </div>
{/*<div className="clearfix">*/} {/*<div className="clearfix">*/}
@ -103,7 +115,7 @@ class TPMRightSection extends Component {
<div className="font-16 mb5"> <div className="font-16 mb5">
<span><i className={"iconfont icon-jilu1 audit_situationactive font-14"}></i> </span> <span><i className={"iconfont icon-jilu1 audit_situationactive font-14"}></i> </span>
<span className={"sortinxdirection space-between fr"}> <span className={"sortinxdirection space-between fr"}>
<span className="color888hezuo font-12">已完成 {TPMRightSectionData&&TPMRightSectionData.complete_count===null?0:TPMRightSectionData&&TPMRightSectionData.complete_count} / {TPMRightSectionData&&TPMRightSectionData.challenge_count} </span> <span className="color888hezuo font-14">已完成 {TPMRightSectionData&&TPMRightSectionData.complete_count===null?0:TPMRightSectionData&&TPMRightSectionData.complete_count} / {TPMRightSectionData&&TPMRightSectionData.challenge_count} </span>
</span> </span>
</div> </div>
@ -119,7 +131,7 @@ class TPMRightSection extends Component {
<p className="font-16 mb20"> <p className="font-16 mb20">
<span><i className={"iconfont icon-biaoqian2 audit_situationactive font-14"}></i> </span> <span><i className={"iconfont icon-biaoqian2 audit_situationactive font-14"}></i> </span>
<span className={"sortinxdirection space-between fr"}> <span className={"sortinxdirection space-between fr"}>
<span className="color888hezuo font-12">已获得 {TPMRightSectionData&&TPMRightSectionData.user_tag_count} / {TPMRightSectionData&&TPMRightSectionData.tag_count} </span> <span className="color888hezuo font-14">已获得 {TPMRightSectionData&&TPMRightSectionData.user_tag_count} / {TPMRightSectionData&&TPMRightSectionData.tag_count} </span>
</span> </span>
</p> </p>
@ -180,7 +192,8 @@ class TPMRightSection extends Component {
<div className="recomments clearfix df" key={k}> <div className="recomments clearfix df" key={k}>
<a href={"/paths/" + i.id} height="96" width="128" target="_blank"> <a href={"/paths/" + i.id} height="96" width="128" target="_blank">
<img alt="实训" height="96" src={"/" + i.image_url} width="128"/>
<img alt="实训" height="96" src={"/" + i.image_url} width="128" className={"altimgs"}/>
</a> </a>
<div className="ml10 flex1"> <div className="ml10 flex1">
@ -232,7 +245,7 @@ class TPMRightSection extends Component {
return ( return (
<div className="recomments clearfix df" key={key}> <div className="recomments clearfix df" key={key}>
<a href={"/shixuns/" + item.identifier + "/challenges"} target="_blank"> <a href={"/shixuns/" + item.identifier + "/challenges"} target="_blank">
<img alt="69?1526971094" height="96" src={"/" + item.pic} width="128"/> <img alt="69?1526971094" height="96" src={"/" + item.pic} width="128" className={"altimgs"}/>
</a> </a>
<div className="ml10 flex1"> <div className="ml10 flex1">
<Tooltip placement="bottom" title={item.name}> <Tooltip placement="bottom" title={item.name}>
@ -240,9 +253,10 @@ class TPMRightSection extends Component {
className="color-grey-6 task-hide mb12 recomment-name">{item.name}</a> className="color-grey-6 task-hide mb12 recomment-name">{item.name}</a>
</Tooltip> </Tooltip>
<p className="clearfix mt8 font-12 color-grey-B4"> <p className="clearfix mt8 font-12 color-grey-B4">
{item.stu_num} 人学习 <span className="fl">{item.stu_num} 人学习</span>
<span className="fr color-orange pr10">{item.level}</span>
</p> </p>
<p className="edu-txt-right color-orange pr10">{item.level}</p>
</div> </div>
</div> </div>
) )

@ -498,7 +498,18 @@ class Challenges extends Component {
</p>} </p>}
</div> </div>
</div> </div>
<style>
{
`
.ant-divider-horizontal.ant-divider-with-text-center.ant-divider-dashed::before{
border: none !important
}
.ant-divider-horizontal.ant-divider-with-text-center.ant-divider-dashed::after{
border: none !important
}
`
}
</style>
{this.state.isopentitletype==="Less"?"":this.state.opentitletype===true?<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}> {this.state.isopentitletype==="Less"?"":this.state.opentitletype===true?<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}>
<a className={"font-14 color-grey-9"}>阅读全文 <i className={"iconfont icon-jiantou9 font-14"}></i></a> <a className={"font-14 color-grey-9"}>阅读全文 <i className={"iconfont icon-jiantou9 font-14"}></i></a>
</Divider>:<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}> </Divider>:<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}>
@ -508,9 +519,9 @@ class Challenges extends Component {
</div> </div>
</p> </p>
<div className={"shixunjianjiecballenges edu-back-white"}> <div className={"shixunjianjiecballenges edu-back-white boreee"}>
<span className="font-16 fl">全部任务</span> <span className="font-16 fl">全部任务</span>
<span className="fr mt5"> <span className="fr mt2">
{/* <img src={getImageUrl("images/educoder/icon/addsmallgreen.svg")} {/* <img src={getImageUrl("images/educoder/icon/addsmallgreen.svg")}
className="fl mr5 mt6" />*/} className="fl mr5 mt6" />*/}
{/*<Tooltip placement="bottom" title={"新增代码编辑类型任务"}>*/} {/*<Tooltip placement="bottom" title={"新增代码编辑类型任务"}>*/}
@ -718,7 +729,7 @@ class Challenges extends Component {
{ {
` `
.task-colspan { .task-colspan {
min-width: 20% !important; min-width: 18% !important;
} }
` `
} }

@ -623,7 +623,18 @@ class Challengesjupyter extends Component {
</p> </p>
</div> </div>
<style>
{
`
.ant-divider-horizontal.ant-divider-with-text-center.ant-divider-dashed::before{
border: none !important
}
.ant-divider-horizontal.ant-divider-with-text-center.ant-divider-dashed::after{
border: none !important
}
`
}
</style>
{this.state.isopentitletype==="Less"?"":this.state.opentitletype===true?<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}> {this.state.isopentitletype==="Less"?"":this.state.opentitletype===true?<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}>
<a className={"font-14 color-grey-9"}>阅读全文 <i className={"iconfont icon-jiantou9 font-14"}></i></a> <a className={"font-14 color-grey-9"}>阅读全文 <i className={"iconfont icon-jiantou9 font-14"}></i></a>
</Divider>:<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}> </Divider>:<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}>

@ -258,4 +258,8 @@
.Countdownfonttpm .ant-statistic-content-value{ .Countdownfonttpm .ant-statistic-content-value{
font-size: 14px; font-size: 14px;
}
.boreee{
border-bottom: 1px solid #F4F4F4;
} }

@ -92,7 +92,7 @@ class BanksMenu extends Component{
object_type:type object_type:type
}}) }})
.then((response) => { .then((response) => {
console.log(response);
if(response){ if(response){
if(response.data){ if(response.data){
if(response.data.status===0){ if(response.data.status===0){

@ -64,6 +64,7 @@ const types = {
CHANGE_RECORD_PAGINATION_PAGE: 'CHANGE_RECORD_PAGINATION_PAGE', // 改变提交分页 CHANGE_RECORD_PAGINATION_PAGE: 'CHANGE_RECORD_PAGINATION_PAGE', // 改变提交分页
UPDATE_OJ_FOR_USER_COMMENT_COUNT: 'UPDATE_OJ_FOR_USER_COMMENT_COUNT', // 更新 hack 中的评论数, UPDATE_OJ_FOR_USER_COMMENT_COUNT: 'UPDATE_OJ_FOR_USER_COMMENT_COUNT', // 更新 hack 中的评论数,
UPDATE_NOTE_CONTENT: 'UPDATE_NOTE_CONTENT', // 更新笔记内容 UPDATE_NOTE_CONTENT: 'UPDATE_NOTE_CONTENT', // 更新笔记内容
UPDATE_HACK_PASSED: 'UPDATE_HACK_PASSED',
/*** jupyter */ /*** jupyter */
GET_JUPYTER_DATA_SETS: 'GET_JUPYTER_DATA_SETS', // jupyter 数据集 GET_JUPYTER_DATA_SETS: 'GET_JUPYTER_DATA_SETS', // jupyter 数据集
GET_JUPYTER_TPI_URL: 'GET_JUPYTER_TPI_URL', // 获取 jupyter url GET_JUPYTER_TPI_URL: 'GET_JUPYTER_TPI_URL', // 获取 jupyter url

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-27 13:42:11 * @Date: 2019-11-27 13:42:11
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2020-01-07 16:21:53 * @LastEditTime : 2020-01-07 17:27:40
*/ */
import types from "./actionTypes"; import types from "./actionTypes";
import { Base64 } from 'js-base64'; import { Base64 } from 'js-base64';
@ -179,7 +179,7 @@ export const updateCode = (identifier, inputValue, type) => {
} }
// 代码评测 // 代码评测
export const codeEvaluate = (dispatch, identifier, type, time_limit) => { export const codeEvaluate = (dispatch, identifier, type, time_limit, hackStatus, score, passed) => {
// 调试代码成功后,调用轮循接口, 注意: 代码执行的时间要小于设置的时间限制 // 调试代码成功后,调用轮循接口, 注意: 代码执行的时间要小于设置的时间限制
const intervalTime = 500; const intervalTime = 500;
let count = 1; let count = 1;
@ -219,7 +219,7 @@ export const codeEvaluate = (dispatch, identifier, type, time_limit) => {
type, type,
data: returnData data: returnData
} }
}); });
if (!type || type === 'debug') { if (!type || type === 'debug') {
dispatch({ // 改变 loading 值 dispatch({ // 改变 loading 值
type: types.LOADING_STATUS, type: types.LOADING_STATUS,
@ -244,6 +244,18 @@ export const codeEvaluate = (dispatch, identifier, type, time_limit) => {
// 重新调用一下提交记录接口 // 重新调用一下提交记录接口
dispatch(getUserCommitRecord(identifier)); dispatch(getUserCommitRecord(identifier));
dispatch(saveOpacityType(type)); dispatch(saveOpacityType(type));
// 首次通过时,提示评测通过并获得金币
// console.log('hack status ===>>', hackStatus);
if (hackStatus === 1 && !passed) {
dispatch({
type: types.UPDATE_HACK_PASSED,
payload: true
});
notification.success({
message: '提示',
description: `恭喜您获得金币奖励: ${score}`
});
}
} }
} }
}).catch(err => { // 评测异常时 }).catch(err => { // 评测异常时
@ -281,7 +293,7 @@ export const debuggerCode = (identifier,value, type) => {
// 调用之前 先保存 code // 调用之前 先保存 code
// TODO // TODO
// console.log(identifier, value); // console.log(identifier, value);
const {hack: {time_limit = 0}} = getState().ojForUserReducer; const { hack } = getState().ojForUserReducer;
if (!type || type === 'debug') { if (!type || type === 'debug') {
dispatch({ // 加载中... dispatch({ // 加载中...
type: types.TEST_CODE_STATUS, type: types.TEST_CODE_STATUS,
@ -301,7 +313,7 @@ export const debuggerCode = (identifier,value, type) => {
return; return;
}; };
// 测评 // 测评
codeEvaluate(dispatch, identifier, type, time_limit); codeEvaluate(dispatch, identifier, type, hack.time_limit);
} }
}).catch(() => { }).catch(() => {
dispatch({ dispatch({
@ -387,7 +399,7 @@ export const changeUserCodeTab = (key) => {
*/ */
export const submitUserCode = (identifier, inputValue, type) => { export const submitUserCode = (identifier, inputValue, type) => {
return (dispatch, getState) => { return (dispatch, getState) => {
const { userCode, isUpdateCode, hack: {time_limit = 0} } = getState().ojForUserReducer; const { userCode, isUpdateCode, hack} = getState().ojForUserReducer;
function userCodeSubmit () { function userCodeSubmit () {
fetchUserCodeSubmit(identifier).then(res => { fetchUserCodeSubmit(identifier).then(res => {
@ -401,7 +413,8 @@ export const submitUserCode = (identifier, inputValue, type) => {
return; return;
}; };
// 测评 // 测评
codeEvaluate(dispatch, identifier, type, time_limit); console.log('hack=====', hack);
codeEvaluate(dispatch, identifier, type, hack.time_limit, hack.status, hack.score, hack.passed);
} }
}).catch(() => { }).catch(() => {
dispatch({ dispatch({

@ -4,11 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-20 16:35:46 * @Date: 2019-11-20 16:35:46
* @LastEditors : tangjiang * @LastEditors : tangjiang
<<<<<<< HEAD * @LastEditTime : 2020-01-07 16:45:34
* @LastEditTime : 2020-01-07 15:27:22
=======
* @LastEditTime : 2020-01-03 17:39:32
>>>>>>> dev_aliyun
*/ */
import types from './actionTypes'; import types from './actionTypes';
import CONST from '../../constants'; import CONST from '../../constants';

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-27 13:41:48 * @Date: 2019-11-27 13:41:48
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2020-01-02 14:24:09 * @LastEditTime : 2020-01-07 17:26:19
*/ */
import types from "../actions/actionTypes"; import types from "../actions/actionTypes";
import { Base64 } from 'js-base64'; import { Base64 } from 'js-base64';
@ -228,6 +228,13 @@ const ojForUserReducer = (state = initialState, action) => {
...state, ...state,
hack: _hack1 hack: _hack1
} }
// 修改 hack passed值
case types.UPDATE_HACK_PASSED:
const _hack2 = Object.assign({}, state.hack, {passed: action.payload });
return {
...state,
hack: _hack2
}
default: default:
return state; return state;
} }

@ -390,7 +390,7 @@ label.infolabel{display: block;float: left;width: 56px;text-align: right;margin-
.task-item{margin-top: 30px;padding-bottom: 30px;border-bottom: 1px solid #eee} .task-item{margin-top: 30px;padding-bottom: 30px;border-bottom: 1px solid #eee}
.task-item:last-child{border-bottom: none;} .task-item:last-child{border-bottom: none;}
.challengeNav a.active{color: #4CACFF;} .challengeNav a.active{color: #4CACFF;}
.recomments{margin-bottom: 30px;padding-bottom:30px;margin-top: 30px;border-bottom: 1px solid #eee} .recomments{ margin-bottom: 20px;}
.recomments:first-child{margin-top: 0px;} .recomments:first-child{margin-top: 0px;}
.recomments:last-child{margin-bottom: 0px;border:none;padding-bottom: 0px;} .recomments:last-child{margin-bottom: 0px;border:none;padding-bottom: 0px;}
.url-input{border: none;padding: 0px;font-size: 12px;color:#999;outline: none} .url-input{border: none;padding: 0px;font-size: 12px;color:#999;outline: none}
@ -3816,4 +3816,9 @@ a.singlepublishtwo{
.RightPaneDrawer .jupyter_data_list{ .RightPaneDrawer .jupyter_data_list{
max-height: 340px; max-height: 340px;
} }
.ant-btn-primary{
text-shadow: none !important;
box-shadow: none !important;
}

Loading…
Cancel
Save