调整题库 题库选用

yslnewtiku
杨树林 5 years ago
parent 367b31a87b
commit 83cfed7e73

@ -123,6 +123,9 @@ class Question extends Component {
this.setState({
visible: true,
});
this.getbasket_listdata();
};
onClose = () => {
@ -316,9 +319,8 @@ class Question extends Component {
const url = "/item_baskets/basket_list.json";
axios.get(url)
.then((result) => {
if (result.data.status == 0) {
console.log("getbasket_listdata");
console.log(result.data);
// console.log("getbasket_listdata");
// console.log(result.data);
this.setState({
completion_questions_count: result.data.completion_questions_count,
judgement_questions_count: result.data.judgement_questions_count,
@ -329,9 +331,8 @@ class Question extends Component {
subjective_questions_count: result.data.subjective_questions_count,
})
}
}).catch((error) => {
console.log(error);
// console.log(error);
this.setState({
completion_questions_count: 0,
judgement_questions_count: 0,
@ -346,6 +347,22 @@ class Question extends Component {
}
getitem_baskets=(data)=>{
//选用题型可以上传单个 或者多个题型
let url="/item_baskets.json";
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`选用成功`);
}
}).catch((error) => {
console.log(error);
})
}
render() {
let {
page, limit, count, Headertop, visible, placement, modalsType, basket_list,
@ -359,6 +376,8 @@ class Question extends Component {
+ single_questions_count
+ subjective_questions_count;
console.log("选用实训打印");
console.log(Datacount);
return (
<div className="newMain clearfix" ref={this.saveContainer}>
@ -373,6 +392,7 @@ class Question extends Component {
<Headplugselection></Headplugselection>
{/*头部*/}
<Contentpart {...this.state} {...this.props}
getitem_baskets={(e)=>this.getitem_baskets(e)}
setdatafuns={(e) => this.setdatafuns(e)}
setdatafunsval={(e) => this.setdatafunsval(e)}
handleVisibleChanges={(e) => this.handleVisibleChanges(e)}

@ -181,7 +181,7 @@ class Contentpart extends Component {
<div className=" w100s">
{this.props.Contentdata.items === undefined ||this.props.Contentdata.items === null? "" : this.props.Contentdata.items.map((object, index) => {
return (
<Listjihe {...this.state} {...this.props} items={object} showmodels={(e)=>this.props.showmodels(e)} showmodelysl={(e)=>this.props.showmodelysl(e)}>
<Listjihe {...this.state} {...this.props} items={object} getitem_baskets={(e)=>this.props.getitem_baskets(e)} showmodels={(e)=>this.props.showmodels(e)} showmodelysl={(e)=>this.props.showmodelysl(e)}>
</Listjihe>
)

@ -43,6 +43,13 @@ class Listjihe extends Component {
}
}
Selectingpracticaltraining=(id)=>{
let data={
item_ids:[id]
}
this.props.getitem_baskets(data);
}
@ -104,7 +111,7 @@ class Listjihe extends Component {
<p className="updatetimes lh30 ml45">创建者{items.author.name}</p>
</div>
<div className="w50s xaxisreverseorder">
<p className="selection xiaoshou">
<p className="selection xiaoshou" onClick={()=>this.Selectingpracticaltraining(items.id)}>
<i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr10"></i>
<span>选用</span></p>
{

@ -109,8 +109,8 @@ class SiderBar extends Component {
{
mypath&&mypath==="/question"?
<Tooltip placement="right" title={"试题库"}>
<div className="feedback feedbackdivcolor xiaoshou" >
<a target="_blank" className="color_white xiaoshou" onClick={()=>this.props.showDrawer()}>
<div className="feedback feedbackdivcolor xiaoshou" onClick={()=>this.props.showDrawer()} >
<a target="_blank" className="color_white xiaoshou" >
<i className="iconfont icon-shitilan color-white xiaoshou"></i>
</a>
<p className="color-white font-12 xiaoshou">试题库</p>

Loading…
Cancel
Save