题库优化

dev_jupyter
杨树林 5 years ago
parent 092388c395
commit 742f7cc3a9

@ -214,7 +214,7 @@ class Paperreview extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status === 0) {
this.props.showNotification(`组卷成功`);
// this.props.showNotification(`组卷成功`);
this.props.history.replace('/paperlibrary');
}
}).catch((error) => {

@ -91,7 +91,7 @@ class Paperreview_item extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
// this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
@ -110,7 +110,7 @@ class Paperreview_item extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
// this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
@ -131,7 +131,7 @@ class Paperreview_item extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
// this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
@ -151,7 +151,7 @@ class Paperreview_item extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
// this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
@ -185,7 +185,7 @@ class Paperreview_item extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`调分成功`);
// this.props.showNotification(`调分成功`);
this.props.getdata({});
this.Singlemagazine("", false);
}
@ -202,7 +202,7 @@ class Paperreview_item extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`调分成功`);
// this.props.showNotification(`调分成功`);
this.props.getdata({});
this.Singlemagazines(false);
}
@ -247,7 +247,7 @@ class Paperreview_item extends Component {
})
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification('大题删除成功');
// this.props.showNotification('大题删除成功');
this.props.getdata({});
this.setState({
titilesms: ""
@ -275,7 +275,7 @@ class Paperreview_item extends Component {
axios.delete((url))
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification('试题删除成功');
// this.props.showNotification('试题删除成功');
this.props.getdata({});
}
})

@ -65,6 +65,7 @@ class Question extends Component {
selectallquestionsonthispages:false,
oj_status:null,
isVisible: false,
selectionbools:false,
}
}
@ -213,6 +214,7 @@ class Question extends Component {
const url = `/item_banks.json`;
this.setState({
booljupyterurls:true,
selectionbools:false,
})
axios.get((url), {params: data}).then((response) => {
setTimeout(()=>{
@ -235,6 +237,7 @@ class Question extends Component {
Contentdata: response.data,
items_count: response.data.items_count,
})
this.getdataslen(response.data.items);
}).catch((error) => {
////console.log(error)
this.setState({
@ -246,7 +249,9 @@ class Question extends Component {
//不刷新加载
getdatasy = (data) => {
const url = `/item_banks.json`;
this.setState({
selectionbools:false,
})
axios.get((url), {params: data}).then((response) => {
setTimeout(()=>{
@ -265,12 +270,57 @@ class Question extends Component {
this.setState({
Contentdata: response.data,
items_count: response.data.items_count,
})
this.getdataslen(response.data.items);
}).catch((error) => {
});
}
//计算
getdataslen=(arr)=>{
var contes=0;
for(let data of arr) {
if(data.item_type==="PROGRAM"){
//编程题
if(data.choosed===true){
}else{
//未选用
if(data.program_attr.status===1){
//已发布
contes=contes+1;
}
}
}else{
//不是编程题
if(data.choosed===true){
}else{
//未选用
contes=contes+1;
}
}
}
if(contes>0){
this.setState({
selectionbools:false,
selectallquestionsonthispages:false,
})
}else {
this.setState({
selectionbools:true,
selectallquestionsonthispages:true,
})
}
}
paginationonChange = (pageNumber) => {
this.setState({
page: pageNumber,
@ -466,19 +516,6 @@ class Question extends Component {
this.setState({
keywords: e.target.value
})
// var data = {
// discipline_id:this.state.discipline_id,
// sub_discipline_id:this.state.sub_discipline_id,
// tag_discipline_id:this.state.tag_discipline_id,
// public: this.state.defaultActiveKey,
// difficulty: this.state.difficulty,
// item_type: this.state.item_type,
// keywords: e.target.value,
// page: this.state.page,
// per_page:10,
// };
//
// this.getdata(data);
}
setdatafuns = (value) => {
@ -507,7 +544,7 @@ class Question extends Component {
axios.delete(url)
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification('删除试题成功')
// this.props.showNotification('删除试题成功')
// props.history.push(response.data.right_url)
var data = {
discipline_id:this.state.discipline_id,
@ -533,7 +570,7 @@ class Question extends Component {
axios.post(url)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`公开题目成功`);
// this.props.showNotification(`公开题目成功`);
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
@ -593,7 +630,7 @@ class Question extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`选用成功`);
// this.props.showNotification(`选用成功`);
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
@ -623,7 +660,7 @@ class Question extends Component {
axios.delete(url)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`撤销成功`);
// this.props.showNotification(`撤销成功`);
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
@ -635,7 +672,7 @@ class Question extends Component {
page: this.state.page,
per_page:10,
};
this.getdata(data);
this.getdatasy(data);
this.getbasket_listdata();
}
}).catch((error) => {
@ -648,7 +685,29 @@ class Question extends Component {
var arr= this.state.Contentdata.items;
for(let data of arr) {
item_idsdata.push(data.id);
if(data.item_type==="PROGRAM"){
//编程题
if(data.choosed===true){
}else{
//未选用
if(data.program_attr.status===1){
//已发布
item_idsdata.push(data.id);
}
}
}else{
//不是编程题
if(data.choosed===true){
}else{
//未选用
item_idsdata.push(data.id);
}
}
}
const data={
item_ids:item_idsdata
@ -669,7 +728,7 @@ class Question extends Component {
}})
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification('删除成功');
// this.props.showNotification('删除成功');
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
@ -728,7 +787,7 @@ class Question extends Component {
let {
page, per_page, items_count, Headertop, visible, placement, modalsType, modalsTypes,basket_list,
completion_questions_count, judgement_questions_count, multiple_questions_count, practical_questions_count,
program_questions_count, single_questions_count, subjective_questions_count
program_questions_count, single_questions_count, subjective_questions_count,selectionbools
} = this.state;
const Datacount = completion_questions_count + judgement_questions_count
@ -812,6 +871,7 @@ class Question extends Component {
<Headplugselections
disciplinesdata={this.state.disciplinesdata}
{...this.props}
{...this.state}
setdifficulty={(e) => this.setdifficulty(e)}

@ -282,7 +282,7 @@ class Questionitem_banks extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`新增单选题成功`);
// this.props.showNotification(`新增单选题成功`);
this.props.history.replace('/question');
}
@ -293,7 +293,7 @@ class Questionitem_banks extends Component {
axios.put(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`编辑单选题成功`);
// this.props.showNotification(`编辑单选题成功`);
this.props.history.replace('/question');
@ -360,7 +360,7 @@ class Questionitem_banks extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`新增多选题成功`);
// this.props.showNotification(`新增多选题成功`);
this.props.history.replace('/question');
@ -373,7 +373,7 @@ class Questionitem_banks extends Component {
axios.put(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`编辑多选题成功`);
// this.props.showNotification(`编辑多选题成功`);
this.props.history.replace('/question');
@ -427,7 +427,7 @@ class Questionitem_banks extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`新增判断题成功`);
// this.props.showNotification(`新增判断题成功`);
this.props.history.replace('/question');
}
@ -439,7 +439,7 @@ class Questionitem_banks extends Component {
axios.put(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`编辑判断题成功`);
// this.props.showNotification(`编辑判断题成功`);
this.props.history.replace('/question');
}

@ -49,7 +49,7 @@ class Contentpart extends Component {
render() {
let {page}=this.state;
let {defaultActiveKey}=this.props;
let {defaultActiveKey,item_type,booljupyterurls}=this.props;
const content = (
<div className="questiontypes" style={{
width:'93px',
@ -86,7 +86,7 @@ class Contentpart extends Component {
//console.log("Contentpart");
//console.log(this.props);
return (
<div className=" clearfix mt40">
<div className=" clearfix mt25">
<div className="educontent mt10 pb20 w1200s">
<div className="w1200ms contentparttit" style={{
position: "relative",
@ -157,7 +157,7 @@ class Contentpart extends Component {
:""
}
{
{item_type==="PROGRAM"?
defaultActiveKey===0||defaultActiveKey==="0"?
<Popover getPopupContainer={trigger => trigger.parentNode} placement="bottom" trigger="hover" content={contents} onVisibleChange={()=>this.props.handleVisibleChange(true)}>
<div className=" sortinxdirection mr30">
@ -169,7 +169,7 @@ class Contentpart extends Component {
</div>
</Popover>
:
""
"":""
}
@ -203,7 +203,7 @@ class Contentpart extends Component {
:
<div className=" w100s mb10">
{
defaultActiveKey===1||defaultActiveKey==="1"?
defaultActiveKey===1||defaultActiveKey==="1"?
<Contentquestionbank {...this.props} {...this.state} selectallquestionsonthispage={()=>this.props.selectallquestionsonthispage()} ></Contentquestionbank>
:""
}

@ -40,6 +40,7 @@ class Contentquestionbank extends Component {
render() {
let {page}=this.state;
let {selectionbools}=this.props;
return (
@ -47,7 +48,13 @@ class Contentquestionbank extends Component {
<div className="educontent w100s">
<div className="sortinxdirection w100s" >
<div className="sortinxdirection w50s">
<Checkbox checked={this.props.selectallquestionsonthispages} onChange={()=>this.props.selectallquestionsonthispage()}></Checkbox>
{
selectionbools===true?
<Checkbox checked={this.props.selectallquestionsonthispages} onChange={()=>this.props.selectallquestionsonthispage()} disabled></Checkbox>
:
<Checkbox checked={this.props.selectallquestionsonthispages} onChange={()=>this.props.selectallquestionsonthispage()}></Checkbox>
}
<p className="setequesbank ml20">选用本页全部试题</p>
</div>
<div className="xaxisreverseorder testpaper w50s">

@ -443,7 +443,7 @@ class Itembankstop extends Component {
axios.post(url,data)
.then((result) => {
if (result.data.status === 0) {
this.props.showNotification(`新增知识点成功!`);
// this.props.showNotification(`新增知识点成功!`);
var leydata={
id: result.data.tag_discipline_id,
name:value,

@ -167,18 +167,18 @@ class Listjihe extends Component {
items.item_type==="PROGRAM"?
items.program_attr.status===0?
<p className="selectionys jinzhixiaoshou" >
<i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr10"></i>
<span>选用</span>
<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)}>
<i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr10"></i>
<span>选用</span>
<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)}>
<i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr10"></i>
<span>选用</span>
<i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i>
<span className="mr15 lh30">选用</span>
</p>
}
{

@ -21,7 +21,7 @@ class NoneData extends Component{
margin: 40px auto 20px;
}
.zenwuxgsj{
font-size:17px;
font-size:14px;
font-family:MicrosoftYaHei;
color:rgba(136,136,136,1);
}

@ -518,7 +518,7 @@ class Comthetestpaperst extends Component {
axios.post(url,data)
.then((result) => {
if (result.data.status === 0) {
this.props.showNotification(`新增知识点成功!`);
// this.props.showNotification(`新增知识点成功!`);
var leydata={
id: result.data.tag_discipline_id,
name:value,

@ -372,7 +372,7 @@
.selectionss{
width:88px;
height:30px;
background:#eeeeee;
background:#CCCCCC;
border-radius:4px;
text-align: center;
line-height: 30px;
@ -399,7 +399,7 @@
padding-bottom: 20px;
}
.icontianjiadaohangcolor{
color: #FFFFFF;
color: #ffffff;
}
.icontianjiadaohangcolors{
@ -914,3 +914,11 @@
opacity: 0;
z-index: 1;
}
.mt25{
margin-top: 25px;
}
.mr15{
margin-right: 15px;
}

@ -163,7 +163,7 @@ class Paperlibraryeditid extends Component {
axios.put(url, data)
.then((result) => {
if (result.data.status === 0) {
this.props.showNotification(`试卷更新成功`);
// this.props.showNotification(`试卷更新成功`);
this.props.history.push('/paperlibrary');
}
}).catch((error) => {

@ -290,7 +290,7 @@ class Testpaperlibrary extends Component {
axios.post(url)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`公开试卷成功`);
// this.props.showNotification(`公开试卷成功`);
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
@ -315,7 +315,7 @@ class Testpaperlibrary extends Component {
axios.delete(url)
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification('删除试卷成功')
// this.props.showNotification('删除试卷成功');
// props.history.push(response.data.right_url)
var data = {
discipline_id:this.state.discipline_id,

@ -57,7 +57,7 @@ class Contentpart extends Component {
</div>
);
return (
<div className=" clearfix mt40">
<div className=" clearfix mt25">
<div className="educontent mt10 pb20 w1200s">
<div className="w1200ms contentparttit" style={{
position: "relative",

@ -76,8 +76,8 @@ class Listjihe extends Component {
return (
<div className={" borderwdsst pd20 mb20 intermediatecenter listjihecolor "} >
<div className="sortinxdirection w100s">
<div className="sjimg ">
<img src={getImageUrl("images/educoder/shijuans.png ")} width={80}/>
<div className="sjimg intermediatecenter">
<img src={getImageUrl("images/educoder/shijuans.png")} className="imgtp"/>
</div>
<div className="w100s verticallayout ml20" >
<div className="w100s " > <p className="sjtitle xiaoshou" onClick={()=>this.gotoseesj(items.id)}>{names}</p></div>

@ -81,7 +81,7 @@ class Paperreview_item extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
// this.props.showNotification(`拖动成功`);
this.props.getdata();
}
}).catch((error) => {
@ -101,7 +101,7 @@ class Paperreview_item extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
// this.props.showNotification(`拖动成功`);
this.props.getdata();
}
}).catch((error) => {
@ -125,7 +125,7 @@ class Paperreview_item extends Component {
.then((result) => {
debugger
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
// this.props.showNotification(`拖动成功`);
this.props.getdata();
}
}).catch((error) => {
@ -147,7 +147,7 @@ class Paperreview_item extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
// this.props.showNotification(`拖动成功`);
this.props.getdata();
}
}).catch((error) => {
@ -181,7 +181,7 @@ class Paperreview_item extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`调分成功`);
// this.props.showNotification(`调分成功`);
this.props.getdata({});
this.Singlemagazine("", false);
}
@ -198,7 +198,7 @@ class Paperreview_item extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`调分成功`);
// this.props.showNotification(`调分成功`);
this.props.getdata({});
this.Singlemagazines(false);
}

@ -89,7 +89,7 @@ class Paperlibraryseeid_itemss extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
// this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
@ -108,7 +108,7 @@ class Paperlibraryseeid_itemss extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
// this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
@ -129,7 +129,7 @@ class Paperlibraryseeid_itemss extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
// this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
@ -149,7 +149,7 @@ class Paperlibraryseeid_itemss extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
// this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
@ -184,7 +184,7 @@ class Paperlibraryseeid_itemss extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`调分成功`);
// this.props.showNotification(`调分成功`);
this.props.getdata({});
this.Singlemagazine("", false);
}
@ -201,7 +201,7 @@ class Paperlibraryseeid_itemss extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`调分成功`);
// this.props.showNotification(`调分成功`);
this.props.getdata({});
this.Singlemagazines(false);
}
@ -247,7 +247,7 @@ class Paperlibraryseeid_itemss extends Component {
})
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification('大题删除成功');
// this.props.showNotification('大题删除成功');
this.props.getdata({});
this.setState({
titilesms: ""
@ -275,7 +275,7 @@ class Paperlibraryseeid_itemss extends Component {
axios.delete((url))
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification('试题删除成功');
// this.props.showNotification('试题删除成功');
this.props.getdata({});
}
})

@ -366,7 +366,7 @@
.selectionss{
width:88px;
height:30px;
background:#eeeeee;
background:#CCCCCC;
border-radius:4px;
text-align: center;
line-height: 30px;
@ -884,3 +884,11 @@
text-align: center;
line-height: 20px;
}
.mt25{
margin-top: 25px;
}
.imgtp{
width: 39px;
height: 44px;
}

Loading…
Cancel
Save