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?
_tasks_list
@work_list = @work_list.where("work_status > 0")
person_list = @work_list.map do |work|
o = {
@ -225,7 +226,7 @@ class GraduationTasksController < ApplicationController
}
attachment = work.attachments.last
if attachment
o[:downloadUrl] = "https://#{edu_setting('host_name')}/"+download_url(attachment)
o[:downloadUrl] = "#{edu_setting('host_name')}"+download_url(attachment)
end
o

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

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

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

@ -10,26 +10,21 @@
李源潮
李干成
戴秉国
黄镇
刘延东
刘瑞龙
俞正声
黄敬
薄熙来
薄一波
周小川
周建南
温云松
徐明
江绵康
李小鹏
李小琳
朱云来
让国人愤怒的第二代身份证
第二代身份证
文化大革命
胡海峰
六四
陈良宇
老丁
莱仕德事件
@ -68,11 +63,9 @@ PK黑社会
反华
官商勾结
升达毕业证
手机复制
戴海静
自杀指南
自杀手册
张小平
佳静安定片
蒙汗药粉
古方迷香
@ -105,7 +98,6 @@ PK黑社会
反政府
禁书
特码
成人
国民党
贪污
骚妇
@ -154,7 +146,6 @@ PK黑社会
AV
十八禁
性虐待
激情
耽美
金瓶梅
藏春阁
@ -181,15 +172,13 @@ AV
政府无能
九评
十七大代表
办证
暴力拆迁
轮暴致死
人民报
暴力镇压
高干子弟名单
性免费电影
全裸
偷拍
中共十七大
徐和柴学友
修炼之歌
@ -250,7 +239,6 @@ A集中营
中共特务
乙醚
党内分裂
新生网
圆明网
和平修炼
放下生死
@ -303,10 +291,6 @@ A集中营
明慧周刊
九评共产党
江泽民其人
秘密文件
机密文件
红头文件
政府文件
破网软件
无界浏览
亲共来源
@ -341,7 +325,6 @@ H漫画
香港GHB水
色空寺
周容重
朱蒙
汕頭頻傳擄童割器官
法輪功
六决不
@ -371,15 +354,12 @@ H漫画
敢坐飞机吗
韩国身份证
台湾身份证
广电总局
学生暴动
镇压学生
广安第二人民医院
山不过来
胡新宇
趙紫陽
自由亚州
明慧
践踏中国女性
拉凳
南京大学法学院
@ -389,7 +369,6 @@ H漫画
崔英杰
松花江污染
火药制作
江氏
第十六次代表
仁寿警方
愈快乐愈堕落
@ -433,7 +412,6 @@ H漫画
二奶
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禁
@ -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
江八点
江流氓
江罗
江绵恒
江青
江戏子
江则民
江泽慧
@ -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轮
亲日
汉奸
政权
政治反对派
政治犯
支那
@ -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 = {
// 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
//devtool: "cheap-module-eval-source-map",
//devtool: "cheap-module-eval-source-map",
// 开启调试
//devtool: "source-map", // 开启调试
// 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:last-child{border-bottom: none;}
.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:last-child{margin-bottom: 0px;border:none;padding-bottom: 0px;}
.url-input{border: none;padding: 0px;font-size: 12px;color:#999;outline: none}
@ -3496,4 +3496,9 @@ a.singlepublishtwo{
.RightPaneDrawer .jupyter_data_list{
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="https://pre-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"
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求
@ -149,15 +149,15 @@ export function initAxiosInterceptors(props) {
}
//
// console.log(config);
// if (config.method === "post") {
// if (requestMap[config.url] === true) { // 避免重复的请求 导致页面f5刷新 也会被阻止 显示这个方法会影响到定制信息
// // console.log(config);
// // console.log(JSON.parse(config));
// // console.log(config.url);
// // console.log("被阻止了是重复请求=================================");
// return false;
// }
// }
if (config.method === "post") {
if (requestMap[config.url] === true) { // 避免重复的请求 导致页面f5刷新 也会被阻止 显示这个方法会影响到定制信息
// console.log(config);
// console.log(JSON.parse(config));
// console.log(config.url);
// console.log("被阻止了是重复请求=================================");
return false;
}
}
// 非file_update请求
if (config.url.indexOf('update_file') === -1) {
requestMap[config.url] = true;

@ -100,22 +100,31 @@ export function getUploadActionUrl(path, goTest) {
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}`}`;
}
export function getUploadActionUrltwo(id) {
Railsgettimes()
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}`}`
}
export function getUploadActionUrlthree() {
Railsgettimes()
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}`}`
}
export function getUploadActionUrlOfAuth(id) {
Railsgettimes()
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}`}`
}
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) {
return `${path}`;
}

@ -2,7 +2,7 @@
// 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
, getTaskUrlById as getTaskUrlById, TEST_HOST ,htmlEncode as htmlEncode } from './UrlTool';
export { default as queryString } from './UrlTool2';

@ -61,6 +61,7 @@
### 使用
````
编辑模式是放不大图片的
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>
</Tooltip>) : ""
}
</h6>
<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"
onClick={(e) => { debugger; onSticky(discussMessage); e.cancelBubble = true; e.stopPropagation();}}>
{ discussMessage.sticky ? '取消置顶' : '置顶' }</WordsBtn> }
{(isAdmin || discussMessage.author.login == current_user.login) &&
<WordsBtn style="blue" className="fr 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="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 className="cl"></div>
@ -112,14 +117,14 @@ class BoardsListItem extends Component{
</ConditionToolTip>
</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"}}>
<ul>
<li className="edu-position edu-position-hidebox">
<i className="fa fa-bars color-grey-b"></i>
<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>
}
{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 ? '匿评申诉剩余时间' : ''}>*/}
{/*</Tooltip>*/}
{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.toWorkSettingPage(this.props.match.params, item.homework_id) }}>设置</WordsBtn>
</div>}
@ -224,6 +227,10 @@ class CommonWorkItem extends Component{
//
isStudent &&
<li className="fr">
<WordsBtn style="blue" className={"fl font-16"}
onClick={ canNotLink ? () => {} : () => this.onItemClick(item)}
>查看详情</WordsBtn>
{ //
item.work_status && item.work_status.indexOf('关联项目') != -1 &&
<React.Fragment>
@ -273,6 +280,8 @@ class CommonWorkItem extends Component{
//
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> }
</li>
}
</p>

@ -35,8 +35,8 @@ class UseBank extends Component{
}
}
componentDidMount() {
console.log("UseBank");
console.log(this.props);
// console.log("UseBank");
// console.log(this.props);
}
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 { object_type }=this.props;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
console.log("题库选用2222");
console.log("UseBank");
console.log(this.props);
// console.log("题库选用2222");
// console.log("UseBank");
// console.log(this.props);
return(
<a>
<style>{`

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

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

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

@ -18,7 +18,7 @@ class NewShixunModel extends Component{
keyword:undefined,
order:'desc',
diff:0,
limit:15,
limit:20,
sort:"myshixuns_count",
belongtoindex:0,
}
@ -229,9 +229,9 @@ class NewShixunModel extends Component{
status:'all',
order:'desc',
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) => {
@ -692,11 +692,11 @@ class NewShixunModel extends Component{
}
</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
showQuickJumper
defaultCurrent={1}
pageSize={15}
pageSize={20}
total={shixuns_count===undefined?"":shixuns_count}
current={page}
onChange={this.PaginationCourse}

@ -51,8 +51,7 @@ class Startshixuntask extends Component{
}, 1000)
if(response.data.status!=401&&response.data.status!=403){
const w=window.open('about:blank');
w.location.href= "/tasks/"+response.data.game_identifier
window.open( `/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>
</div> }
@ -212,11 +216,21 @@ class ExerciseListItem extends Component{
{
IsStudent &&
<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>:
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 ===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>:""}
<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 ===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 ===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>
}
{
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>
)

@ -8,8 +8,9 @@ import {
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
import axios from 'axios'
import update from 'immutability-helper'
import {getUrl, ActionBtn, DMDEditor, ConditionToolTip} from 'educoder';
import QuillForEditor from "../../../../common/quillForEditor";
const { TextArea } = Input;
const confirm = Modal.confirm;
const $ = window.$
@ -47,6 +48,9 @@ class SingleEditor extends Component{
question_title: this.props.question_title || '',
question_type: this.props.question_type || 0,
question_score: this.props.question_score || this.props.init_question_score,
choice_editor: 'md',
quill_question_title: '',
quill_default_title: ''
}
}
addOption = () => {
@ -205,8 +209,33 @@ class SingleEditor extends Component{
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() {
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,
// question_title,
// question_type,
@ -245,18 +274,51 @@ class SingleEditor extends Component{
max-width: 1056px;
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>
<p className="mb10 clearfix">
{/* {!question_id ? '新建' : '编辑'} */}
<span className="color-blue font-16 mr20 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>
<TPMMDEditor mdID={qNumber} placeholder="请您输入题目" height={155} className="mb20"
initValue={question_title} onChange={(val) => this.setState({ question_title: val})}
ref="titleEditor"
{choice_editor === 'md'
? <TPMMDEditor mdID={qNumber} placeholder="请您输入题目" height={155} className="mb20"
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) => {
const bg = standard_answers[index] ? 'check-option-bg' : ''

@ -300,12 +300,19 @@ class GraduateTaskItem extends Component{
{this.props.isAdmin?
<div className="mt13">
<WordsBtn style="blue" to={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/setting"} className="colorblue font-16 mrf4 fr">
<a className="btn colorblue">设置</a>
</WordsBtn>
<WordsBtn style="blue" to={"/courses/"+coursesId+"/graduation_tasks/"+taskid+"/edit"} className="colorblue font-16 mr20 fr">
<a className="btn colorblue" >编辑</a>
</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>
:""}
@ -319,6 +326,8 @@ class GraduateTaskItem extends Component{
return(
<span key={key}>
{item==="提交作品"?
<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>

@ -1,5 +1,5 @@
import React, { Component } from 'react';
import {getRandomNumber,queryString} from 'educoder';
import {Link} from 'react-router-dom';
import {Tooltip,Menu} from 'antd';
import Loadable from 'react-loadable';
@ -62,7 +62,8 @@ class GraduationTaskDetail extends Component{
ModalCancel:undefined,
ModalSave:undefined,
acrossVisible:undefined,
OneSelftype:false
OneSelftype:false,
taskdatas:undefined
}
}
componentDidMount(){
@ -249,11 +250,13 @@ class GraduationTaskDetail extends Component{
visibles:true
})
}
Cancel=()=>{
this.setState({
visibles:false
})
}
// 取消关联
cannelAssociation=()=>{
this.setState({
@ -263,6 +266,7 @@ class GraduationTaskDetail extends Component{
ModalSave:this.savetassociton
})
}
savetassociton=()=>{
this.cannerassocition();
let {questionslist}=this.state;
@ -277,6 +281,7 @@ class GraduationTaskDetail extends Component{
})
}
cannerassocition=()=>{
this.setState({
Modalstype:false,
@ -287,6 +292,7 @@ class GraduationTaskDetail extends Component{
visibles:false
})
}
// 补交附件
handaccessory=()=>{
// let {taskslistdata}=this.state;
@ -299,14 +305,40 @@ class GraduationTaskDetail extends Component{
avisible:true
})
}
Cancelvisible=()=>{
this.setState({
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 } ;
render(){
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.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.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>
<Switch {...this.props}>
{/*//毕设任务列表*/}
<Route exact path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id/list"
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>

@ -62,6 +62,8 @@ class GraduationTaskssettinglist extends Component{
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.props.getsonar(teacher_comment, task_status, course_group, cross_comment, search)
try{
this.props.triggerRef(this)
}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;
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)=>{
@ -227,8 +231,19 @@ class GraduationTaskssettinglist extends Component{
funteachercomment=(list,key)=> {
// console.log(e.target.value)
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){
this.setState({
teacher_comment:null,
@ -242,12 +257,17 @@ class GraduationTaskssettinglist extends Component{
}
if(list.length===key){
this.seacthdata(undefined, task_status, course_group, cross_comment, order, b_order, search,this.state.page);
}else{
this.seacthdata(list[0], task_status, course_group, cross_comment, order, b_order, search,this.state.page);
}
let newvalue=list.length===0?undefined:parseInt(list[0])
this.seacthdata(newvalue, task_status, course_group, cross_comment, order, b_order, search,this.state.page);
this.props.getsonar(newvalue, task_status, course_group, cross_comment, search)
// 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
})
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)=>{
@ -287,7 +307,7 @@ class GraduationTaskssettinglist extends Component{
loadingstate:true
})
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) => {
@ -299,7 +319,7 @@ class GraduationTaskssettinglist extends Component{
loadingstate: true
})
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
})
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){
// // 全部抖选中 自然就是查找全部 就是空
@ -336,7 +357,7 @@ class GraduationTaskssettinglist extends Component{
loadingstate:true
})
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
})
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){
// // 全部抖选中 自然就是查找全部 就是空
@ -372,6 +394,7 @@ class GraduationTaskssettinglist extends Component{
loadingstate:true
})
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)
if(result.data.status===0){
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.cancelmodel();
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;
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>
</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)=>{
return(
<span key={key}>

@ -120,22 +120,32 @@ class GraduateTopicItem extends Component{
</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="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 &&
<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>
}
{
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>
}
</span>
</p>
</div>

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

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

@ -97,8 +97,12 @@ class PollListItem extends Component{
<span className="mr20 fl mt3">{"提交剩余时间:"+formatDuring(t)}</span>
</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 && "继续答题"
}
@ -110,10 +114,13 @@ class PollListItem extends Component{
}
</WordsBtn>:""
}
{ isStudent ?canNotLink ?"": <WordsBtn style="blue" className="font-16 fr " onClick={()=>this.toDetailPage(`/courses/${coursesId}/polls/${item.id}/detail`)} >查看详情</WordsBtn>:""}
{
IsAdmin &&
<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>
</ul>
}

@ -388,6 +388,7 @@ class ShixunHomeworkPage extends Component {
teacherdatapage === undefined ? ""
: teacherdatapage.commit_des === null || teacherdatapage.commit_des === undefined ? "" :
<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>
}
{teacherdatapage === undefined ? "" :teacherdatapage&&teacherdatapage.shixun_status>1&&teacherdatapage&&teacherdatapage.time_status<5?<Startshixuntask

@ -68,7 +68,7 @@ class ShixunhomeWorkItem extends Component{
})
// w.close()
}else if(response.data.status===-1){
console.log(response)
}else if(response.data.status===-3){
this.setState({
shixunsmessage:response.data.message,
@ -304,11 +304,11 @@ class ShixunhomeWorkItem extends Component{
<div className="clearfix ds pr pt5 contentSection" >
<style>{`
.maxwidth422{
max-width: 422px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap
.maxwidth333{
max-width: 333px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
`}</style>
<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")}
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`)}
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?
<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`)}
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>
{
`
.homepagePostSettingname{
width:192px !important;
}
.homepagePostSettingbox{
width:139px !important;
width:207px !important;
}
.colorfff{
color:#fff !important;
}
.newhomepagePostSettingname{
width: 205px !important;
}
.newwidthSettin{
width:255px !important;
}
`
}
</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>}
{this.props.isAdminOrCreator()?<a onClick={(event)=>this.editname(discussMessage.name,discussMessage.homework_id,event)} className={"btn colorblue ml20 font-16 fontweight400"}>重命名</a>:""}
{/*to={`/courses/${this.props.match.params.coursesId}/${discussMessage.homework_id}/jobsettings`}*/}
{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 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>:""}
{this.props.isStudent===true?this.props.course_identity===5?discussMessage&&discussMessage.shixun_status>1?
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?
(discussMessage.task_operation[0] == '继续挑战' || discussMessage.task_operation[0] == '查看实战' ?
<a className="btn colorblue" href={getTaskUrlById(discussMessage.task_operation[1])}>
@ -385,6 +399,18 @@ class ShixunhomeWorkItem extends Component{
</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>
<div className="cl"></div>

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

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

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

@ -6,6 +6,8 @@ import beijintulogontwo from '../../../src/images/login/beijintulogontwo.png';
import educodernet from '../../../src/images/login/educodernet.png';
import InterestpageComponent from '../user/Interestpage'
import InterestpageComponentMax from '../user/InterestpageMax'
import moment from 'moment';
//educoder登入页面
var newContainer={
@ -78,7 +80,7 @@ class EducoderInteresse extends Component {
justifyContent: "center",
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>

@ -1,26 +1,6 @@
import React, {Component} from "react";
import {
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 moment from 'moment';
import { SnackbarHOC,getImageUrl } from 'educoder';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import '../courses/css/members.css';
import "../courses/common/formCommon.css"
import '../courses/css/Courses.css';
@ -201,21 +181,21 @@ class EducoderLogin extends Component {
justifyContent: "center",
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===undefined||this.props.mygetHelmetapi.main_site===null|| this.props.mygetHelmetapi.main_site===undefined? <div style={{
display: "flex",
justifyContent: "center",
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 style={{
display: "flex",
justifyContent: "center",
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>
:""
}

@ -1,33 +1,18 @@
import React, {Component} from "react";
import {
Form,
Select,
Input,
Button,
Checkbox,
Upload,
Icon,
message,
Modal,
Table,
Divider,
InputNumber,
Tag,
DatePicker,
Radio,
Tooltip,
notification,
Layout,
Spin
} from "antd";
import axios from 'axios';
import moment from 'moment';
import { getImageUrl } from 'educoder'
import {Link, Switch, Route, Redirect} from 'react-router-dom';
import '../courses/css/members.css';
import "../courses/common/formCommon.css"
import '../courses/css/Courses.css';
import beijintulogontwo from '../../../src/images/login/beijintulogontwo.png';
import educodernet from '../../../src/images/login/educodernet.png';
const { Header, Footer, Sider, Content } = Layout;
//educoder登入页面
var sectionStyle = {
@ -294,7 +279,7 @@ class Otherlogin extends Component {
justifyContent: "center",
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>
</Spin>

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

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

@ -34,7 +34,7 @@ class NewMyShixunModel extends Component {
placement: 'right',
modalsType: false,
modalsTypes:false,
titilesm: "设为公开后,所有成员均可使用试题",
titilesm: "在平台审核后,所有成员均可使用试题",
titiless: "是否设置为公开?",
titilesms:"单选题",
titbool: false,
@ -91,7 +91,7 @@ class NewMyShixunModel extends Component {
page: this.state.page,
per_page:10,
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);
@ -117,7 +117,7 @@ class NewMyShixunModel extends Component {
page: 1,
per_page:10,
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);
}
@ -141,7 +141,7 @@ class NewMyShixunModel extends Component {
page: 1,
per_page:10,
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);
}
@ -156,7 +156,7 @@ class NewMyShixunModel extends Component {
public: defaultActiveKey,
page:1,
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);
@ -209,7 +209,7 @@ class NewMyShixunModel extends Component {
page: 1,
per_page:10,
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);
@ -342,7 +342,7 @@ class NewMyShixunModel extends Component {
page: pageNumber,
per_page:10,
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);
@ -386,7 +386,7 @@ class NewMyShixunModel extends Component {
this.setState({
modalsType: true,
titilesm: "设为公开后,所有成员均可使用试题",
titilesm: "在平台审核后,所有成员均可使用试题",
titiless: "是否设置为公开?",
titbool: true,
timuid: id
@ -461,7 +461,7 @@ class NewMyShixunModel extends Component {
page:1,
per_page:10,
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);
@ -488,7 +488,7 @@ class NewMyShixunModel extends Component {
per_page:10,
keywords: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);
@ -543,7 +543,7 @@ class NewMyShixunModel extends Component {
page: this.state.page,
per_page:10,
oj_status:this.state.oj_status,
item_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
};
this.getdata(data);
@ -567,7 +567,7 @@ class NewMyShixunModel extends Component {
keywords: this.state.keywords,
page: this.state.page,
per_page:10,
item_id: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);
}
@ -593,7 +593,7 @@ class NewMyShixunModel extends Component {
keywords: this.state.keywords,
page: this.state.page,
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);
@ -661,7 +661,7 @@ class NewMyShixunModel extends Component {
keywords: this.state.keywords,
page: this.state.page,
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.getbasket_listdata();
@ -678,34 +678,57 @@ class NewMyShixunModel extends Component {
let url="";
if(this.props.exam_id===undefined){
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{
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=()=>{
@ -739,7 +762,7 @@ class NewMyShixunModel extends Component {
}
const data={
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.setState({
@ -768,7 +791,7 @@ class NewMyShixunModel extends Component {
keywords: this.state.keywords,
page: this.state.page,
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.getbasket_listdata();
@ -806,7 +829,7 @@ class NewMyShixunModel extends Component {
page: this.state.page,
per_page:10,
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);
}

@ -426,8 +426,8 @@ class Paperreview_item extends Component {
}}>
<div className="w100s sortinxdirection">
<div className="w70s sortinxdirection">
<p className="questionstishu lh34">题数{this.props.all_score}</p>
<p className="ml58 questionstotal lh34">总分{this.props.all_questions_count}</p>
<p className="questionstishu lh34">题数{this.props.all_questions_count}</p>
<p className="ml58 questionstotal lh34">总分{this.props.all_score}</p>
</div>
<div className="w30s xaxisreverseorder">
<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;
// console.log(object);
console.log("Paperreview_items");
console.log(object.item_id);
// console.log("Paperreview_items");
// console.log(object.item_id);
return (
<div>
{

@ -17,6 +17,7 @@ import Itembankstop from "./component/Itembankstop";
import NoneData from './component/NoneData';
import './questioncss/questioncom.css';
import '../tpm/newshixuns/css/Newshixuns.css';
import QuillForEditor from "../../common/quillForEditor";
const tagArray = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
@ -69,13 +70,42 @@ class Paperreview_single extends Component {
render() {
let {questions, totalscore, total, items} = this.state;
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 (
<div key={indexxy}
className={ "w100s borderwdswuh mb20 pd20 "}
onMouseEnter={() => this.props.showparagraphs(indexxy,name)} style={{
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=" sortinxdirection ">
@ -99,9 +129,35 @@ class Paperreview_single extends Component {
`
}
</style>
<div className=" lh28 listjihetixingstit markdown-body cretitlecolrlist" style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML(`${objectsingle.score}分) ` + objectsingle.name).replace(/▁/g, "▁▁▁")}}>
</div>
{
objectsingle.item_type==="PROGRAM"?
<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 className="w100s sortinxdirection">
@ -114,7 +170,7 @@ class Paperreview_single extends Component {
objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => {
return (
<p className={index === 1 ? "sortinxdirection ml10" : "sortinxdirection "}>
<Radio checked={object.is_answer}>
<Radio disabled={false}>
{object.choice_text}
</Radio>
</p>
@ -126,8 +182,17 @@ class Paperreview_single extends Component {
objectsingle.item_type === "PROGRAM" ?
<p className="w100s listjihetixingstitssy sortinxdirection ">
<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>
:
@ -137,8 +202,21 @@ class Paperreview_single extends Component {
return (
<p className={index === 0 ? "sortinxdirection" : "sortinxdirection mt15"}>
{tagArray[index]}
<p style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML(object.choice_text).replace(/▁/g, "▁▁▁")}}></p>
<p className="programquills" 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>
)
})

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

@ -10,6 +10,7 @@ import axios from 'axios'
import update from 'immutability-helper'
import './../questioncss/questioncom.css';
import {getUrl, ActionBtn, DMDEditor, ConditionToolTip} from 'educoder';
import QuillForEditor from '../../../common/quillForEditor';
const { TextArea } = Input;
const confirm = Modal.confirm;
const $ = window.$
@ -70,10 +71,13 @@ class ChoquesEditor extends Component{
this.state = {
question_choices: _question_choices || ['', '', '', ''],
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_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 = () => {
@ -122,12 +126,11 @@ class ChoquesEditor extends Component{
}
onSave = () => {
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
// TODO check
const answerArray = standard_answers.map((item, index) => { return item == true ? index+1 : -1 }).filter(item => item != -1);
if(!question_title) {
this.refs['titleEditor'].showError()
if(!question_titleysl) {
this.props.showNotification('请您输入题干');
return editordata;
}
@ -143,14 +146,12 @@ class ChoquesEditor extends Component{
for(let i = 0; i < question_choices.length; i++) {
if (!question_choices[i]) {
this.refs[`optionEditor${i}`].showError()
this.props.showNotification(`请先输入 ${tagArray[i]} 选项的内容`);
return editordata;
}
}
if(!question_titles) {
this.refs['titleEditor2'].showError()
if(!question_titlesysl) {
this.props.showNotification('请您输入题目解析');
return editordata;
}
@ -162,7 +163,7 @@ class ChoquesEditor extends Component{
"question_choices":["a答案","b答案","c答案","d答案"],
"standard_answers":[1]
}*/
editordata=[question_title,answerArray,question_choices,question_titles];
editordata=[question_titleysl,answerArray,question_choices,question_titlesysl];
// question_title,
// question_type: answerArray.length > 1 ? 1 : 0,
// question_score,
@ -186,8 +187,10 @@ class ChoquesEditor extends Component{
try {
this.setState({
item_banksedit:this.props.item_banksedit,
question_title:this.props.item_banksedit.name,
question_titles:this.props.item_banksedit.analysis,
question_title: this.props.item_banksedit.name!==undefined?JSON.parse(this.props.item_banksedit.name):"",
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,
})
@ -205,8 +208,10 @@ class ChoquesEditor extends Component{
if(prevProps.item_banksedit !== this.props.item_banksedit) {
this.setState({
item_banksedit: this.props.item_banksedit,
question_title: this.props.item_banksedit.name,
question_titles: this.props.item_banksedit.analysis,
question_title: this.props.item_banksedit.name!==undefined?JSON.parse(this.props.item_banksedit.name):"",
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,
})
@ -217,15 +222,34 @@ class ChoquesEditor extends Component{
standard_answers[index] = !standard_answers[index]
this.setState({ standard_answers })
}
onOptionContentChange = (value, index) => {
onOptionContentChange = (value,quill,index) => {
if (index >= this.state.question_choices.length) {
// TODO 新建然后删除CD选项再输入题干会调用到这里且index是3
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);
question_choices[index] = value;
this.setState({ question_choices })
question_choices[index] = texts;
console.log(question_choices);
this.setState({ question_choices });
}
on_question_score_change = (e) => {
this.setState({ question_score: e })
}
@ -241,6 +265,57 @@ class ChoquesEditor extends Component{
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() {
let { question_title, question_score, question_type, question_choices, standard_answers,question_titles} = this.state;
let { question_id, index, exerciseIsPublish,
@ -271,7 +346,7 @@ class ChoquesEditor extends Component{
flex:1
}
.optionRow {
margin:0px!important;
/* margin:0px!important; */
/* margin-bottom: 20px!important; */
}
.signleEditor .content_editorMd_show{
@ -291,11 +366,14 @@ class ChoquesEditor extends Component{
<span className="xingtigan fl">题干</span>
</p>
<TPMMDEditor mdID={qNumber} placeholder="请您输入题干" height={155} className=" mt10"
initValue={question_title} onChange={(val) => this.setState({ question_title: val})}
ref="titleEditor"
<QuillForEditor
style={{ height: '155px'}}
placeholder="请您输入题干"
options={['code-block', 'image', 'formula']}
value={question_title}
onContentChange={this.onContentChange}
></TPMMDEditor>
/>
<div className="mb10 sortinxdirection">
{/* {!question_id ? '新建' : '编辑'} */}
@ -305,7 +383,7 @@ class ChoquesEditor extends Component{
{question_choices.map( (item, index) => {
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 */}
{/* <Tooltip title={standard_answers[index] ? '点击取消标准答案设置' : '点击设置为标准答案'}> */}
@ -317,13 +395,26 @@ class ChoquesEditor extends Component{
</span>
{/* </Tooltip> */}
<div style={{ flex: '0 0 1038px'}}>
<DMDEditor
ref={`optionEditor${index}`}
toMDMode={this.toMDMode} toShowMode={this.toShowMode}
height={166} className={'optionMdEditor'} noStorage={true}
mdID={qNumber + index} placeholder="" onChange={(value) => this.onOptionContentChange(value, index)}
initValue={item}
></DMDEditor>
{
item===undefined||item===null||item===""?
<QuillForEditor
style={{ height: '166px'}}
placeholder="请您输入题干"
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>
{exerciseIsPublish || index<=2?
<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 ? '新建' : '编辑'} */}
<span className="xingcolor font-16 fl mr4">*</span>
<span className="xingtigan fl">题目解析</span>
</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>
<div className="mt10"></div>
<QuillForEditor
style={{height: '166px' }}
placeholder="请您输入题目解析"
options={['code-block', 'image', 'formula']}
value={question_titles}
onContentChange={this.onContentChanges}
/>
</div>

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

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

@ -10,6 +10,8 @@ import axios from 'axios'
import update from 'immutability-helper'
import './../questioncss/questioncom.css';
import {getUrl, ActionBtn, DMDEditor, ConditionToolTip} from 'educoder';
import QuillForEditor from '../../../common/quillForEditor';
const { TextArea } = Input;
const confirm = Modal.confirm;
const $ = window.$
@ -46,10 +48,12 @@ class JudquestionEditor extends Component{
this.state = {
question_choices: _question_choices || ['', '', '', ''],
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_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,
item_banksedit:[],
mychoicess:[],
@ -99,12 +103,11 @@ class JudquestionEditor extends Component{
}
onSave = () => {
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
// TODO check
const answerArray = standard_answers.map((item, index) => { return item == true ? index+1 : -1 }).filter(item => item != -1);
if(!question_title) {
this.refs['titleEditor'].showError()
if(!question_titleysl) {
this.props.showNotification('请您输入题干');
return editordata;
}
@ -117,8 +120,7 @@ class JudquestionEditor extends Component{
if(!question_titles) {
this.refs['titleEditor2'].showError()
if(!question_titlesysl) {
this.props.showNotification('请您输入题目解析');
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_type: answerArray.length > 1 ? 1 : 0,
// question_score,
@ -156,31 +158,31 @@ class JudquestionEditor extends Component{
try {
this.setState({
item_banksedit:this.props.item_banksedit,
question_title:this.props.item_banksedit.name,
question_titles:this.props.item_banksedit.analysis,
question_title: this.props.item_banksedit.name!==undefined?JSON.parse(this.props.item_banksedit.name):"",
question_titles: this.props.item_banksedit.analysis!==undefined?JSON.parse(this.props.item_banksedit.analysis):"",
mychoicess:this.props.item_banksedit.choices,
})
if(this.props.item_banksedit){
if(this.props.item_banksedit.choices){
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].is_answer===true){
this.setState({
zqda:"0"
})
}
}else{
if( this.props.item_banksedit.choices[ik].is_answer===true){
this.setState({
zqda:"1"
})
}
}
}
}
}
// if(this.props.item_banksedit){
// if(this.props.item_banksedit.choices){
// 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].is_answer===true){
// this.setState({
// zqda:"0"
// })
// }
//
// }else{
// if( this.props.item_banksedit.choices[ik].is_answer===true){
// this.setState({
// zqda:"1"
// })
// }
// }
// }
// }
// }
}catch (e) {
}
@ -194,31 +196,31 @@ class JudquestionEditor extends Component{
if(prevProps.item_banksedit !== this.props.item_banksedit){
this.setState({
item_banksedit:this.props.item_banksedit,
question_title:this.props.item_banksedit.name,
question_titles:this.props.item_banksedit.analysis,
question_title: this.props.item_banksedit.name!==undefined?JSON.parse(this.props.item_banksedit.name):"",
question_titles: this.props.item_banksedit.analysis!==undefined?JSON.parse(this.props.item_banksedit.analysis):"",
mychoicess:this.props.item_banksedit.choices,
})
if(this.props.item_banksedit){
if(this.props.item_banksedit.choices){
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].is_answer===true){
this.setState({
zqda:"0"
})
}
}else{
if( this.props.item_banksedit.choices[ik].is_answer===true){
this.setState({
zqda:"1"
})
}
}
}
}
}
// if(this.props.item_banksedit){
// if(this.props.item_banksedit.choices){
// 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].is_answer===true){
// this.setState({
// zqda:"0"
// })
// }
//
// }else{
// if( this.props.item_banksedit.choices[ik].is_answer===true){
// this.setState({
// 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() {
let { question_title, question_score, question_type, question_choices, standard_answers,question_titles} = this.state;
let { question_id, index, exerciseIsPublish,
@ -325,11 +376,14 @@ class JudquestionEditor extends Component{
<span className="xingtigan fl">题干</span>
</p>
<TPMMDEditor mdID={qNumber} placeholder="请您输入题干" height={155} className=" mt10"
initValue={question_title} onChange={(val) => this.setState({ question_title: val})}
ref="titleEditor"
<QuillForEditor
style={{ height: '155px'}}
placeholder="请您输入题干"
options={['code-block', 'image', 'formula']}
value={question_title}
onContentChange={this.onContentChange}
></TPMMDEditor>
/>
<div className="mb10 sortinxdirection">
{/* {!question_id ? '新建' : '编辑'} */}
@ -363,36 +417,23 @@ class JudquestionEditor extends Component{
<div>
<div className="mt10">
<p className="mb10 clearfix">
{/* {!question_id ? '新建' : '编辑'} */}
<span className="xingcolor font-16 fl mr4">*</span>
<span className="xingtigan fl">题目解析</span>
</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>
)

@ -1,15 +1,18 @@
import React, {Component} from "react";
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 {
notification,
Spin,
Table,
Pagination,
Radio
Radio,
Tooltip
} from "antd";
import './../questioncss/questioncom.css';
import QuillForEditor from "../../../common/quillForEditor";
const tagArray = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
@ -20,74 +23,73 @@ const tagArrays = [
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
]
class Listjihe extends Component {
constructor(props) {
super(props);
this.state = {
page:1,
name:"单选题",
nd:"简单",
page: 1,
name: "单选题",
nd: "简单",
}
}
//初始化
componentDidMount(){
componentDidMount() {
}
//选用
Selectingpracticaltraining=(id)=>{
let data={}
if(this.props.exam_id===undefined){
data={
item_ids:[id]
Selectingpracticaltraining = (id) => {
let data = {}
if (this.props.exam_id === undefined) {
data = {
item_ids: [id]
}
}else{
data={
item_ids:[id],
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
} else {
data = {
item_ids: [id],
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
}
}
}
this.props.getitem_baskets(data);
}
//撤销
Selectingpracticaltrainings=(id)=>{
Selectingpracticaltrainings = (id) => {
this.props.getitem_basketss(id);
}
render() {
let {page,name,nd}=this.state;
let {defaultActiveKey,items,listjihe,chakanjiexiboolindex,keindex}=this.props;
let {page, name, nd} = this.state;
let {defaultActiveKey, items, listjihe, chakanjiexiboolindex, keindex} = this.props;
// 编程答案
var rightkey=null
var rightkey = null
if(items){
if(items.item_type){
if(items.item_type==="PROGRAM"){
if (items) {
if (items.item_type) {
if (items.item_type === "PROGRAM") {
}else{
if(items.item_type==="JUDGMENT") {
} else {
if (items.item_type === "JUDGMENT") {
if(items.choices){
if(items.choices.length>0){
var arr= items.choices;
for(let data of arr) {
if(data.is_answer===true){
rightkey=data.choice_text;
if (items.choices) {
if (items.choices.length > 0) {
var arr = items.choices;
for (let data of arr) {
if (data.is_answer === true) {
rightkey = data.choice_text;
break;
}
}
}
}
}else {
} else {
if (items.choices) {
if (items.choices.length > 0) {
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 (
<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="listjihetixingstitsy">
{
@ -120,17 +152,36 @@ class Listjihe extends Component {
<div className="listjihetixingstitsy">
.
</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 className="w100s sortinxdirection ">
{items.item_type==="JUDGMENT"?
<p className="w100s listjihetixingstits sortinxdirection ">
{items.item_type === "JUDGMENT" ?
<p className="w100s listjihetixingstitsp sortinxdirection ">
{
items === undefined ||items === null? "" : items.choices.map((object, index) => {
items === undefined || items === null ? "" : items.choices.map((object, index) => {
return (
<p className={index===1? "sortinxdirection ml10":"sortinxdirection " } >
<p className={index === 1 ? "sortinxdirection ml10" : "sortinxdirection "}>
<Radio disabled={false}>
{object.choice_text}
</Radio>
@ -138,21 +189,52 @@ class Listjihe extends Component {
)
})
}
</p>:
items.item_type==="PROGRAM"?
</p> :
items.item_type === "PROGRAM" ?
<p className="w100s listjihetixingstitssy sortinxdirection ">
<p className={"sortinxdirection mt15"} >
<p style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML(items.program_attr.description).replace(/▁/g, "▁▁▁")}}></p>
<p className={"sortinxdirection mt15"}>
{
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 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 (
<p className={index===0?"sortinxdirection":"sortinxdirection mt15"} >
{tagArray[index]}
<p style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML(object.choice_text).replace(/▁/g, "▁▁▁")}}></p>
<p className={index === 0 ? "sortinxdirection " : "sortinxdirection mt15 "}>
<p className="lh26">{tagArray[index]}</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>
)
})
@ -163,91 +245,98 @@ class Listjihe extends Component {
<div className="w100s sortinxdirection mt10">
<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>
<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 className="w100s sortinxdirection">
<div className="w50s listjihetixingstit sortinxdirection">
<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>
}
{
items.item_type==="PROGRAM"?
items.item_type === "PROGRAM" ?
<p className="updatetimes lh30 ml45">编程语言{items.program_attr.language}</p>
:""
: ""
}
{
items.item_type==="PROGRAM"?
items.program_attr.status===0?
items.item_type === "PROGRAM" ?
items.program_attr.status === 0 ?
<p className="updatetimes lh30 ml45 nofabu mt5">未发布</p>
:""
:""
: ""
: ""
}
</div>
<div className="w50s xaxisreverseorder">
{
items.choosed===true?
<p className="selectionss xiaoshou" onClick={()=>this.Selectingpracticaltrainings(items.id)}>
items.choosed === true ?
<p className="selectionss xiaoshou" onClick={() => this.Selectingpracticaltrainings(items.id)}>
<i className="iconfont icon-jianhao font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i>
<span className="mr15 lh30">撤销</span></p>
:
items.item_type==="PROGRAM"?
items.program_attr.status===0?
<p className="selectionys jinzhixiaoshou" >
<i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i>
<span className="mr15 lh30">选用</span>
</p>
items.item_type === "PROGRAM" ?
items.program_attr.status === 0 ?
<Tooltip placement="top" title={"编程题未发布,不能选用!"}>
<p className="selectionys jinzhixiaoshou">
<i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i>
<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>
<span className="mr15 lh30">选用</span>
</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>
<span className="mr15 lh30">选用</span>
</p>
}
{
defaultActiveKey===0||defaultActiveKey==="0"?
defaultActiveKey === 0 || defaultActiveKey === "0" ?
<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>
<span>删除</span>
</p>
{
items.item_type==="PROGRAM"?
items.item_type === "PROGRAM" ?
<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>
<span>编辑</span>
</p>
</a>
:
<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>
<span>编辑</span>
</p>
</a>
}
{
items.public===false?
items.item_type==="PROGRAM"?
items.program_attr.status===0?
items.public === false ?
items.item_type === "PROGRAM" ?
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>
<span>公开</span>
</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>
<span>公开</span>
</p>
@ -256,54 +345,65 @@ class Listjihe extends Component {
}
</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>
查看解析</p>
}
</div>
</div>
{
chakanjiexiboolindex===keindex?<div>
chakanjiexiboolindex === keindex ? <div>
<div className="w100s questiontypeheng mt23">
</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"
style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML("答案:"+tagArrays[rightkey]).replace(/▁/g, "▁▁▁")}}
style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML("答案:" + tagArrays[rightkey]).replace(/▁/g, "▁▁▁")}}
>
</p>
:
<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>
}
</div>
{
items&&items.analysis?
""
:""
}
<div className=" sortinxdirection mt15 yldxtit" >
<p className=" testfondex yldxtit"
style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML("解析:"+items.analysis).replace(/▁/g, "▁▁▁")}}
<div className=" sortinxdirection mt15 yldxtit">
<p className=" testfondex yldxtit programquill"
style={{wordBreak: "break-word"}}
>
{items ?
items.analysis=== undefined || items.analysis=== null || items.analysis === "" ?
""
:
items.analysis.length>0?
<QuillForEditor
readOnly={true}
value={JSON.parse(items.analysis)}
/>
:
""
:
""
}
</p>
</div>
</div>:""
</div> : ""
}
@ -313,4 +413,5 @@ class Listjihe extends Component {
}
}
export default Listjihe;

@ -75,10 +75,12 @@ class SingleEditor extends Component{
this.state = {
question_choices: _question_choices || ['', '', '', ''],
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_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:[],
}
}
@ -121,12 +123,21 @@ class SingleEditor extends Component{
}
onSave = () => {
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
// TODO check
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('请您输入题干');
return editordata;
}
@ -139,14 +150,13 @@ class SingleEditor extends Component{
for(let i = 0; i < question_choices.length; i++) {
if (!question_choices[i]) {
this.refs[`optionEditor${i}`].showError()
// this.refs[`optionEditor${i}`].showError()
this.props.showNotification(`请先输入 ${tagArray[i]} 选项的内容`);
return editordata;
}
}
if(!question_titles) {
this.refs['titleEditor2'].showError()
if(!question_titlesysl) {
this.props.showNotification('请您输入题目解析');
return editordata;
}
@ -158,7 +168,7 @@ class SingleEditor extends Component{
"question_choices":["a答案","b答案","c答案","d答案"],
"standard_answers":[1]
}*/
editordata=[question_title,answerArray,question_choices,question_titles];
editordata=[question_titleysl,answerArray,question_choices,question_titlesysl];
// question_title,
// question_type: answerArray.length > 1 ? 1 : 0,
// question_score,
@ -184,8 +194,10 @@ class SingleEditor extends Component{
try {
this.setState({
item_banksedit:this.props.item_banksedit,
question_title:this.props.item_banksedit.name,
question_titles:this.props.item_banksedit.analysis,
question_title: this.props.item_banksedit.name!==undefined?JSON.parse(this.props.item_banksedit.name):"",
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,
})
@ -204,8 +216,10 @@ class SingleEditor extends Component{
if(prevProps.item_banksedit !== this.props.item_banksedit) {
this.setState({
item_banksedit: this.props.item_banksedit,
question_title: this.props.item_banksedit.name,
question_titles: this.props.item_banksedit.analysis,
question_title: this.props.item_banksedit.name!==undefined?JSON.parse(this.props.item_banksedit.name):"",
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,
})
@ -229,14 +243,31 @@ class SingleEditor extends Component{
// standard_answers[index] = !standard_answers[index];
this.setState({ standard_answers })
}
onOptionContentChange = (value, index) => {
onOptionContentChange = (value,quill,index) => {
if (index >= this.state.question_choices.length) {
// TODO 新建然后删除CD选项再输入题干会调用到这里且index是3
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);
question_choices[index] = value;
this.setState({ question_choices })
question_choices[index] = texts;
this.setState({ question_choices });
}
on_question_score_change = (e) => {
this.setState({ question_score: e })
@ -254,11 +285,61 @@ class SingleEditor extends Component{
}
onContentChange=(e)=>{
console.log(e);
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_titleysl:texts
})
}
}
handleShowImage = (url) => {
console.log("点击了图片放大");
console.log(url);
alert(url);
}
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,
// question_title,
// question_type,
@ -279,7 +360,6 @@ class SingleEditor extends Component{
// ////console.log("xuanzheshijuan");
// ////console.log(answerTagArray);
// ////console.log(!exerciseIsPublish);
return(
<div className="padding20-30 signleEditor danxuano" id={qNumber}>
<style>{`
@ -287,7 +367,7 @@ class SingleEditor extends Component{
flex:1
}
.optionRow {
margin:0px!important;
/* margin:0px!important; */
/* margin-bottom: 20px!important; */
}
.signleEditor .content_editorMd_show{
@ -307,21 +387,16 @@ class SingleEditor extends Component{
<span className="xingtigan fl">题干</span>
</p>
<TPMMDEditor mdID={qNumber} placeholder="请您输入题干" height={155} className=" mt10"
initValue={question_title} onChange={(val) => this.setState({ question_title: val})}
ref="titleEditor"
></TPMMDEditor>
<QuillForEditor
style={{ height: '155px'}}
placeholder="请您输入题干"
options={['code-block', 'image', 'formula']}
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 ? '新建' : '编辑'} */}
<span className="xingcolor font-16 fl mr4">*</span>
<span className="xingtigans fl"><span className="xingtigan">答案选项</span></span>
@ -329,11 +404,11 @@ class SingleEditor extends Component{
{question_choices.map( (item, index) => {
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 */}
{/* <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'}}>
<ConditionToolTip title={standard_answers[index] ? '' : '点击设置为标准答案'} placement="left" condition={true}>
<div style={{width: '100%', height: '100%'}}>{tagArray[index]}</div>
@ -341,13 +416,30 @@ class SingleEditor extends Component{
</span>
{/* </Tooltip> */}
<div style={{ flex: '0 0 1038px'}}>
<DMDEditor
ref={`optionEditor${index}`}
toMDMode={this.toMDMode} toShowMode={this.toShowMode}
height={166} className={'optionMdEditor'} noStorage={true}
mdID={qNumber + index} placeholder="" onChange={(value) => this.onOptionContentChange(value, index)}
initValue={item}
></DMDEditor>
{
item===undefined||item===null||item===""?
<QuillForEditor
style={{ height: '166px'}}
placeholder="请您输入题干"
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>
{exerciseIsPublish || index<=1?
<i className=" font-18 ml15 mr20"></i>
@ -366,36 +458,20 @@ class SingleEditor extends Component{
<div>
<p className="mb10 clearfix">
<div className="mt10">
<p className="mb10 clearfix">
{/* {!question_id ? '新建' : '编辑'} */}
<span className="xingcolor font-16 fl mr4">*</span>
<span className="xingtigan fl">题目解析</span>
</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>
<div className="mt10"></div>
<QuillForEditor
style={{height: '166px' }}
placeholder="请您输入题目解析"
options={['code-block', 'image', 'formula']}
value={question_titles}
onContentChange={this.onContentChanges}
/>
</div>

@ -332,6 +332,12 @@
line-height:19px;
margin-top: 19px;
}
.listjihetixingstitsp{
color: #333333;
font-size: 14px;
line-height:19px;
margin-top: 10px;
}
.listjihetixingstitssy{
color: #333333;
font-size: 14px;
@ -939,3 +945,14 @@
.searchwidth{
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">
<style>
{
`
.seeoagertitscss .jixuxuanti{
background:#4CACFF;
}
`
}
</style>
<div className={"seeoagertitscss"}>
<Seeoagertits
setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}
all_score={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_questions_count}
all_questions_count={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_score}
difficulty={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.difficulty}
>
</Seeoagertits>
</div>
<Paperlibraryseeid_itemss
{...this.state}
{...this.props}

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

@ -15,6 +15,7 @@ import {
} from "antd";
import '../testioncss/testioncss.css';
import '../../tpm/newshixuns/css/Newshixuns.css';
import QuillForEditor from "../../../common/quillForEditor";
const tagArray = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
@ -67,15 +68,42 @@ class Paperlibraryseeid_items extends Component {
render() {
let {questions, totalscore, total, items} = this.state;
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 (
<div key={indexxy}
className={ "w100s borderwdswuh mb20 pd20 "}
style={{
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=" sortinxdirection ">
@ -100,29 +128,46 @@ class Paperlibraryseeid_items extends Component {
}
</style>
{
this.props.typenames==="PROGRAM"?
<div className=" lh28 listjihetixingstit markdown-body cretitlecolrlist" style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML( objectsingle.name).replace(/▁/g, "▁▁▁")}}>
</div>
objectsingle.item_type==="PROGRAM"?
<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=" lh28 listjihetixingstit markdown-body cretitlecolrlist" style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML(`${objectsingle.score}分) ` + objectsingle.name).replace(/▁/g, "▁▁▁")}}>
<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 className="w100s sortinxdirection">
{
objectsingle.item_type === "JUDGMENT" ?
<p className="w100s listjihetixingstits sortinxdirection ">
{
objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => {
return (
<p className={index === 1 ? "sortinxdirection ml10" : "sortinxdirection "} key={index}>
<Radio checked={object.is_answer}>
<p className={index === 1 ? "sortinxdirection ml10" : "sortinxdirection "}>
<Radio disabled={false}>
{object.choice_text}
</Radio>
</p>
@ -134,8 +179,17 @@ class Paperlibraryseeid_items extends Component {
objectsingle.item_type === "PROGRAM" ?
<p className="w100s listjihetixingstitssy sortinxdirection ">
<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>
:
@ -143,10 +197,23 @@ class Paperlibraryseeid_items extends Component {
{
objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => {
return (
<p className={index === 0 ? "sortinxdirection" : "sortinxdirection mt15"} key={index}>
<p className={index === 0 ? "sortinxdirection" : "sortinxdirection mt15"}>
{tagArray[index]}
<p style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML(object.choice_text).replace(/▁/g, "▁▁▁")}}></p>
<p className="programquills" 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>
)
})
@ -154,7 +221,6 @@ class Paperlibraryseeid_items extends Component {
</p>
}
</div>

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

@ -1,8 +1,7 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import moment from 'moment';
import { Link } from 'react-router-dom';
import { getImageUrl, toPath } from 'educoder'
import PropTypes from 'prop-types';
class NewFooter extends Component {
constructor(props) {
@ -58,7 +57,7 @@ class NewFooter extends Component {
{this.props.mygetHelmetapi === null ? "" :
this.props.mygetHelmetapi===undefined|| this.props.mygetHelmetapi.footer===null||this.props.mygetHelmetapi.footer===undefined?
<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://www.beian.gov.cn/portal/registerSystemInfo?recordcode=43019002000962" className="mr15">
<img className="vertical4" src={require('./beian.png')}/>湘公网安备43019002000962号

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

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

@ -719,7 +719,7 @@ export default class TPMchallengesnew extends Component {
shixunsskillvaluelist===undefined?"":shixunsskillvaluelist.length === 0 ? "" : shixunsskillvaluelist.map((itme, key) => {
return (
<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 "}>
{itme}
</Button>

@ -67,6 +67,18 @@ class TPMRightSection extends Component {
return (
<div>
<style>
{
`
.altimgs{
border-radius: 4px;
width: 100px;
height: 60px;
}
`
}
</style>
{
TPMRightSectionData === undefined ? "" :
<div>
@ -86,7 +98,7 @@ class TPMRightSection extends Component {
{TPMRightSectionData === undefined ? "" : TPMRightSectionData.creator === undefined ? "" : TPMRightSectionData.creator.name}
</div>
<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 className="clearfix">*/}
@ -103,7 +115,7 @@ class TPMRightSection extends Component {
<div className="font-16 mb5">
<span><i className={"iconfont icon-jilu1 audit_situationactive font-14"}></i> </span>
<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>
</div>
@ -119,7 +131,7 @@ class TPMRightSection extends Component {
<p className="font-16 mb20">
<span><i className={"iconfont icon-biaoqian2 audit_situationactive font-14"}></i> </span>
<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>
</p>
@ -180,7 +192,8 @@ class TPMRightSection extends Component {
<div className="recomments clearfix df" key={k}>
<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>
<div className="ml10 flex1">
@ -232,7 +245,7 @@ class TPMRightSection extends Component {
return (
<div className="recomments clearfix df" key={key}>
<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>
<div className="ml10 flex1">
<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>
</Tooltip>
<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 className="edu-txt-right color-orange pr10">{item.level}</p>
</div>
</div>
)

@ -498,7 +498,18 @@ class Challenges extends Component {
</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 "}>
<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 "}>
@ -508,9 +519,9 @@ class Challenges extends Component {
</div>
</p>
<div className={"shixunjianjiecballenges edu-back-white"}>
<div className={"shixunjianjiecballenges edu-back-white boreee"}>
<span className="font-16 fl">全部任务</span>
<span className="fr mt5">
<span className="fr mt2">
{/* <img src={getImageUrl("images/educoder/icon/addsmallgreen.svg")}
className="fl mr5 mt6" />*/}
{/*<Tooltip placement="bottom" title={"新增代码编辑类型任务"}>*/}
@ -718,7 +729,7 @@ class Challenges extends Component {
{
`
.task-colspan {
min-width: 20% !important;
min-width: 18% !important;
}
`
}

@ -623,7 +623,18 @@ class Challengesjupyter extends Component {
</p>
</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 "}>
<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 "}>

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

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

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

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-27 13:42:11
* @LastEditors : tangjiang
* @LastEditTime : 2020-01-07 16:21:53
* @LastEditTime : 2020-01-07 17:27:40
*/
import types from "./actionTypes";
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;
let count = 1;
@ -219,7 +219,7 @@ export const codeEvaluate = (dispatch, identifier, type, time_limit) => {
type,
data: returnData
}
});
});
if (!type || type === 'debug') {
dispatch({ // 改变 loading 值
type: types.LOADING_STATUS,
@ -244,6 +244,18 @@ export const codeEvaluate = (dispatch, identifier, type, time_limit) => {
// 重新调用一下提交记录接口
dispatch(getUserCommitRecord(identifier));
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 => { // 评测异常时
@ -281,7 +293,7 @@ export const debuggerCode = (identifier,value, type) => {
// 调用之前 先保存 code
// TODO
// console.log(identifier, value);
const {hack: {time_limit = 0}} = getState().ojForUserReducer;
const { hack } = getState().ojForUserReducer;
if (!type || type === 'debug') {
dispatch({ // 加载中...
type: types.TEST_CODE_STATUS,
@ -301,7 +313,7 @@ export const debuggerCode = (identifier,value, type) => {
return;
};
// 测评
codeEvaluate(dispatch, identifier, type, time_limit);
codeEvaluate(dispatch, identifier, type, hack.time_limit);
}
}).catch(() => {
dispatch({
@ -387,7 +399,7 @@ export const changeUserCodeTab = (key) => {
*/
export const submitUserCode = (identifier, inputValue, type) => {
return (dispatch, getState) => {
const { userCode, isUpdateCode, hack: {time_limit = 0} } = getState().ojForUserReducer;
const { userCode, isUpdateCode, hack} = getState().ojForUserReducer;
function userCodeSubmit () {
fetchUserCodeSubmit(identifier).then(res => {
@ -401,7 +413,8 @@ export const submitUserCode = (identifier, inputValue, type) => {
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(() => {
dispatch({

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

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-27 13:41:48
* @LastEditors : tangjiang
* @LastEditTime : 2020-01-02 14:24:09
* @LastEditTime : 2020-01-07 17:26:19
*/
import types from "../actions/actionTypes";
import { Base64 } from 'js-base64';
@ -228,6 +228,13 @@ const ojForUserReducer = (state = initialState, action) => {
...state,
hack: _hack1
}
// 修改 hack passed值
case types.UPDATE_HACK_PASSED:
const _hack2 = Object.assign({}, state.hack, {passed: action.payload });
return {
...state,
hack: _hack2
}
default:
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:last-child{border-bottom: none;}
.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:last-child{margin-bottom: 0px;border:none;padding-bottom: 0px;}
.url-input{border: none;padding: 0px;font-size: 12px;color:#999;outline: none}
@ -3816,4 +3816,9 @@ a.singlepublishtwo{
.RightPaneDrawer .jupyter_data_list{
max-height: 340px;
}
}
.ant-btn-primary{
text-shadow: none !important;
box-shadow: none !important;
}

Loading…
Cancel
Save