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

dev_jupyter
cxt 5 years ago
commit f81d64fdb7

@ -23,23 +23,23 @@ class ApplicationController < ActionController::Base
# 所有请求必须合法签名 # 所有请求必须合法签名
def check_sign def check_sign
unless Rails.env.development? # unless Rails.env.development?
Rails.logger.info("66666 #{params}") # Rails.logger.info("66666 #{params}")
suffix = request.url.split(".").last.split("?").first # suffix = request.url.split(".").last.split("?").first
suffix_arr = ["xls", "xlsx", "pdf"] # excel文件先注释 # suffix_arr = ["xls", "xlsx", "pdf"] # excel文件先注释
unless suffix_arr.include?(suffix) # unless suffix_arr.include?(suffix)
if params[:client_key].present? # if params[:client_key].present?
randomcode = params[:randomcode] # randomcode = params[:randomcode]
# tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5) # # tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5)
#
sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}") # sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}")
Rails.logger.info("2222 #{sign}") # Rails.logger.info("2222 #{sign}")
tip_exception(501, "请求不合理") if sign != params[:client_key] # tip_exception(501, "请求不合理") if sign != params[:client_key]
else # else
tip_exception(501, "请求不合理") # tip_exception(501, "请求不合理")
end # end
end # end
end # end
end end
# 全局配置参数 # 全局配置参数

@ -15,7 +15,7 @@ class DiscussesController < ApplicationController
disscusses = Discuss.where(:dis_id => @container.id, :dis_type => @container.class.to_s, disscusses = Discuss.where(:dis_id => @container.id, :dis_type => @container.class.to_s,
:root_id => nil) :root_id => nil)
@discusses = disscusses.joins("left join games on discusses.challenge_id = games.challenge_id and discusses.user_id = games.user_id") @discusses = disscusses.joins("left join games on discusses.challenge_id = games.challenge_id and discusses.user_id = games.user_id")
.select("discusses.*, games.identifier").includes(:user, :praise_treads) .select("discusses.*, games.identifier").includes(:user, :praise_treads).limit(LIMIT).offset(offset)
else else
disscusses = Discuss.where("dis_id = :dis_id and dis_type = :dis_type and root_id is null and disscusses = Discuss.where("dis_id = :dis_id and dis_type = :dis_type and root_id is null and
(discusses.hidden = :hidden or discusses.user_id = :user_id)", (discusses.hidden = :hidden or discusses.user_id = :user_id)",

@ -893,7 +893,8 @@ class ShixunsController < ApplicationController
content = upload_file.tempfile.read content = upload_file.tempfile.read
author_name = current_user.real_name author_name = current_user.real_name
author_email = current_user.git_mail author_email = current_user.git_mail
update_file_content(content, @repo_path, @path, author_email, author_name, "upload file by browser") message = params[:message] || "upload file by browser"
update_file_content(content, @repo_path, @path, author_email, author_name, message)
render_ok render_ok
end end
@ -901,14 +902,16 @@ class ShixunsController < ApplicationController
def upload_git_folder def upload_git_folder
author_name = current_user.real_name author_name = current_user.real_name
author_email = current_user.git_mail author_email = current_user.git_mail
git_add_folder(@path, author_name, author_email, "upload folder by browser") message = params[:message] || "upload folder by browser"
git_add_folder(@path, author_name, author_email, message)
render_ok render_ok
end end
def delete_git_file def delete_git_file
author_name = current_user.real_name author_name = current_user.real_name
author_email = current_user.git_mail author_email = current_user.git_mail
git_delete_file(@path, author_name, author_email, "delete filer by browser") message = params[:message] || "delete file by browser"
git_delete_file(@path, author_name, author_email, message)
render_ok render_ok
end end

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

@ -326,8 +326,8 @@ module.exports = {
comments: false comments: false
}, },
compress: { compress: {
drop_debugger: false, drop_debugger: true,
drop_console: false drop_console: true
} }
} }
}), }),

@ -174,7 +174,7 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
.user_navlist_white a:hover{color: #4cacff} .user_navlist_white a:hover{color: #4cacff}
.headIcon{height: 100%;box-sizing: border-box; margin: 0px!important;} .headIcon{height: 100%;box-sizing: border-box; margin: 0px!important;}
.black_nav_list{padding: 4px 0px;box-sizing: border-box;height: 100%;} .black_nav_list{padding: 4px 0px;box-sizing: border-box;height: 100%;}
.black_nav_list li{line-height: 42px;height: 42px;color: #fff;cursor: pointer;} .black_nav_list li{line-height: 40px;height: 40px;color: #fff;cursor: pointer;}
.black_nav_span{display: block;margin:0px 20px;border-bottom: 1px solid #4B4B4B;padding-left: 8px;color: #FAFAFA} .black_nav_span{display: block;margin:0px 20px;border-bottom: 1px solid #4B4B4B;padding-left: 8px;color: #FAFAFA}
.welcome_shixun_index:last-child .black_nav_span{border-bottom: none} .welcome_shixun_index:last-child .black_nav_span{border-bottom: none}
.black_nav_list li:hover{background: #fff;} .black_nav_list li:hover{background: #fff;}

@ -318,6 +318,16 @@ const Testpaperlibrary= Loadable({
loader: () => import('./modules/testpaper/Testpaperlibrary'), loader: () => import('./modules/testpaper/Testpaperlibrary'),
loading: Loading loading: Loading
}) })
//试卷编辑
const Paperlibraryeditid= Loadable({
loader: () => import('./modules/testpaper/Paperlibraryeditid'),
loading: Loading
})
//试卷查看
const Paperlibraryseeid= Loadable({
loader: () => import('./modules/testpaper/Paperlibraryseeid'),
loading: Loading
})
//人工组卷 //人工组卷
const Paperreview= Loadable({ const Paperreview= Loadable({
loader: () => import('./modules/question/Paperreview'), loader: () => import('./modules/question/Paperreview'),
@ -744,17 +754,26 @@ class App extends Component {
} }
} }
/> />
<Route path="/myproblems/record_detail/:id"
render={
(props) => (<RecordDetail {...this.props} {...props} {...this.state} />)
}
/>
<Route <Route
path="/problems/:id/edit" path="/problems/:id/edit"
render={ render={
(props) => (<NewOrEditTask {...this.props} {...props} {...this.state} />) (props) => (<NewOrEditTask {...this.props} {...props} {...this.state} />)
} /> } />
<Route path="/myproblems/record_detail/:id"
render={ <Route path="/paperlibrary/edit/:id"
(props) => (<RecordDetail {...this.props} {...props} {...this.state} />) render={
} (props) => (<Paperlibraryeditid {...this.props} {...props} {...this.state} />)
/> }/>
<Route path="/paperlibrary/see/:id"
render={
(props) => (<Paperlibraryseeid {...this.props} {...props} {...this.state} />)
}/>
<Route path="/myproblems/:id/:tab?" <Route path="/myproblems/:id/:tab?"
render={ render={
(props) => (<StudentStudy {...this.props} {...props} {...this.state} />) (props) => (<StudentStudy {...this.props} {...props} {...this.state} />)
@ -772,15 +791,15 @@ class App extends Component {
render={ render={
(props) => (<Headplugselection {...this.props} {...props} {...this.state} />) (props) => (<Headplugselection {...this.props} {...props} {...this.state} />)
} /> } />
<Route path="/paperreview"
render={
(props) => (<Paperreview {...this.props} {...props} {...this.state} />)
}/>
<Route path="/paperlibrary" <Route path="/paperlibrary"
render={ render={
(props) => (<Testpaperlibrary {...this.props} {...props} {...this.state} />) (props) => (<Testpaperlibrary {...this.props} {...props} {...this.state} />)
}/> }/>
<Route path="/paperreview"
render={
(props) => (<Paperreview {...this.props} {...props} {...this.state} />)
}/>
<Route path="/problems" <Route path="/problems"
render={ render={
(props) => (<Developer {...this.props} {...props} {...this.state} />) (props) => (<Developer {...this.props} {...props} {...this.state} />)

@ -102,7 +102,7 @@ class SingleDisplay extends Component{
display: "flex", display: "flex",
flexDirection:"row", flexDirection:"row",
}} key={optionIndex}> }} key={optionIndex}>
<Radio disabled className="fl lineh-25" checked={item.standard_boolean}>{prefix}</Radio> <Radio disabled className="fl lineh-25 w50" checked={item.standard_boolean}>{prefix}</Radio>
<MarkdownToHtml content={item.choice_text} selector={'single_' + (index + 1) + '' + (optionIndex + 1)} style={{ float: 'left', display: 'inline-block' }} <MarkdownToHtml content={item.choice_text} selector={'single_' + (index + 1) + '' + (optionIndex + 1)} style={{ float: 'left', display: 'inline-block' }}
></MarkdownToHtml> ></MarkdownToHtml>
@ -116,7 +116,7 @@ class SingleDisplay extends Component{
display: "flex", display: "flex",
flexDirection:"row", flexDirection:"row",
}} key={optionIndex}> }} key={optionIndex}>
<Checkbox disabled className="fl lineh-25 mr8" checked={item.standard_boolean}>{prefix}</Checkbox> <Checkbox disabled className="fl lineh-25 w50" checked={item.standard_boolean}>{prefix}</Checkbox>
<MarkdownToHtml content={item.choice_text} selector={'single_' + (index + 1)+ '' + (optionIndex + 1)} style={{ float: 'left', display: 'inline-block' }} <MarkdownToHtml content={item.choice_text} selector={'single_' + (index + 1)+ '' + (optionIndex + 1)} style={{ float: 'left', display: 'inline-block' }}
></MarkdownToHtml> ></MarkdownToHtml>

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-12-30 13:51:19 * @Date: 2019-12-30 13:51:19
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2020-01-03 09:32:24 * @LastEditTime : 2020-01-03 18:56:36
*/ */
import './index.scss'; import './index.scss';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
@ -49,7 +49,8 @@ function KnowLedge (props) {
} }
// 过滤下拉列表项 // 过滤下拉列表项
const handleSelectChange = (value) => { const handleSelectChange = (value) => {
value = +value.join(''); // value = +value.join('');
value = +value;
const tempArr = [...selectValue]; const tempArr = [...selectValue];
const _result = selectOptions.filter(item => { const _result = selectOptions.filter(item => {
if (item.id === value && tempArr.findIndex(t => t.id === value) === -1) { if (item.id === value && tempArr.findIndex(t => t.id === value) === -1) {
@ -103,7 +104,7 @@ function KnowLedge (props) {
return ( return (
<Select <Select
value={value} value={value}
mode="tags" // mode="tags"
placeholder="请选择" placeholder="请选择"
style={{ width: '100%' }} style={{ width: '100%' }}
onChange={handleSelectChange} onChange={handleSelectChange}

@ -4,7 +4,11 @@
* @Github: * @Github:
* @Date: 2019-11-20 10:35:40 * @Date: 2019-11-20 10:35:40
* @LastEditors : tangjiang * @LastEditors : tangjiang
<<<<<<< HEAD
* @LastEditTime : 2020-01-03 17:35:45 * @LastEditTime : 2020-01-03 17:35:45
=======
* @LastEditTime : 2020-01-03 19:02:17
>>>>>>> dev_aliyun
*/ */
import './index.scss'; import './index.scss';
// import 'katex/dist/katex.css'; // import 'katex/dist/katex.css';

@ -14,13 +14,23 @@ import ChooseEvaluateView from './main/ChooseEvaluateView'
import { CircularProgress } from 'material-ui/Progress'; import { CircularProgress } from 'material-ui/Progress';
import Button from 'material-ui/Button'; import Button from 'material-ui/Button';
import VNCContainer from './VNCContainer' import VNCContainer from './VNCContainer'
import { connect } from 'react-redux';
import './tpiPage.css'; import './tpiPage.css';
import './tpiPageForMobile.css'; import './tpiPageForMobile.css';
import actions from '../../redux/actions';
const $ = window.$; const $ = window.$;
class MainContent extends Component { class MainContent extends Component {
constructor(props) {
super(props)
this.chooseQ = React.createRef();
}
chooseQfun = (Ref) => {
this.chooseQ = Ref;
}
componentDidMount() { componentDidMount() {
// ios下图标位置有问题 // ios下图标位置有问题
this.props.mainContentfun(this)
setTimeout(()=>{ setTimeout(()=>{
if (window.$('.b-label>.resize-helper').position().top < 100) { if (window.$('.b-label>.resize-helper').position().top < 100) {
window.$('.b-label>.resize-helper').css('top', '200px') window.$('.b-label>.resize-helper').css('top', '200px')
@ -32,11 +42,15 @@ class MainContent extends Component {
// console.log('onResizeButtonClick') // console.log('onResizeButtonClick')
} }
onRunCodeTest = () => { onRunCodeTest = () => {
const {onRunCodeTest, isCollpaseTsetCase} = this.props;
const vncContainer = this.refs['vncContainer'] const vncContainer = this.refs['vncContainer']
if (vncContainer) { if (vncContainer) {
vncContainer.showCodeEvaluate && vncContainer.showCodeEvaluate() vncContainer.showCodeEvaluate && vncContainer.showCodeEvaluate()
} }
this.props.onRunCodeTest(); // console.log('1111111111');
// this.props.onRunCodeTest();
isCollpaseTsetCase(true);
onRunCodeTest();
} }
hideCodeEvaluate = () => { hideCodeEvaluate = () => {
const vncContainer = this.refs['vncContainer'] const vncContainer = this.refs['vncContainer']
@ -156,7 +170,7 @@ class MainContent extends Component {
<CodeRepositoryViewContainer { ...this.props } ></CodeRepositoryViewContainer> <CodeRepositoryViewContainer { ...this.props } ></CodeRepositoryViewContainer>
</div> </div>
</React.Fragment> </React.Fragment>
: <ChooseRepositoryView ref="chooseQ" { ...this.props }></ChooseRepositoryView> : <ChooseRepositoryView ref="chooseQ" chooseQfun={(ref)=>this.chooseQfun(ref)}{ ...this.props }></ChooseRepositoryView>
} }
{/* */} {/* */}
@ -195,4 +209,12 @@ class MainContent extends Component {
} }
} }
export default MainContent; const mapStateToProps = (state) => ({});
const mapDispatchToProps = (dispatch) => ({
isCollpaseTsetCase: (flag) => dispatch(actions.isCollpaseTsetCase(flag))
});
export default connect(
mapStateToProps,
mapDispatchToProps
)(MainContent);

@ -158,7 +158,7 @@ class MainContentContainer extends Component {
this.showResetCodeDialog = this.showResetCodeDialog.bind(this) this.showResetCodeDialog = this.showResetCodeDialog.bind(this)
this.showResetPassedCodeDialog = this.showResetPassedCodeDialog.bind(this) this.showResetPassedCodeDialog = this.showResetPassedCodeDialog.bind(this)
this.mainContent = React.createRef();
this.oldRepositoryCode = ''; this.oldRepositoryCode = '';
@ -177,7 +177,9 @@ class MainContentContainer extends Component {
isEditablePath: true isEditablePath: true
} }
} }
mainContentfun = (Ref) => {
this.mainContent = Ref;
}
// ------------------------------------------------ // ------------------------------------------------
// static childContextTypes = { // static childContextTypes = {
// muiTheme: PropTypes.object // muiTheme: PropTypes.object
@ -589,7 +591,9 @@ class MainContentContainer extends Component {
onRunChooseTest() { onRunChooseTest() {
const { st, game, onRunChooseTestFinish, showSnackbar } = this.props; const { st, game, onRunChooseTestFinish, showSnackbar } = this.props;
// 获取form表单值 // 获取form表单值
var value = this.refs.mainContent.refs.chooseQ.getForm().getFieldsValue(); // console.log(this.mainContent.chooseQ.props.form.getFieldsValue())
var value = this.mainContent.chooseQ.props.form.getFieldsValue();
// this.refs.mainContent.refs.chooseQ.getForm().getFieldsValue();
var valueArray = []; // map转array var valueArray = []; // map转array
var unSelectOptionIndexArray = [] // 自己做未选提示 var unSelectOptionIndexArray = [] // 自己做未选提示
@ -984,7 +988,7 @@ class MainContentContainer extends Component {
</Dialog> </Dialog>
<UpdateDrawer {...this.props} fetchRepositoryCode={this.fetchRepositoryCode}></UpdateDrawer> <UpdateDrawer {...this.props} fetchRepositoryCode={this.fetchRepositoryCode}></UpdateDrawer>
<MainContent ref="mainContent" {...this.props} output_sets={output_sets} {...this.state} <MainContent ref="mainContent" mainContentfun={(ref)=>this.mainContentfun(ref)} {...this.props} output_sets={output_sets} {...this.state}
onRepositoryCodeUpdate={this.onRepositoryCodeUpdate} onRunCodeTest={this.onRunCodeTest} onRepositoryCodeUpdate={this.onRepositoryCodeUpdate} onRunCodeTest={this.onRunCodeTest}
codemirrorDidMount={this.codemirrorDidMount} fetchRepositoryCode={this.fetchRepositoryCode} codemirrorDidMount={this.codemirrorDidMount} fetchRepositoryCode={this.fetchRepositoryCode}
showResetCodeDialog={this.showResetCodeDialog} showResetPassedCodeDialog={this.showResetPassedCodeDialog} showResetCodeDialog={this.showResetCodeDialog} showResetPassedCodeDialog={this.showResetPassedCodeDialog}

@ -168,7 +168,7 @@ class VNCDisplay extends Component {
<div id="status">Loading</div> <div id="status">Loading</div>
<div id="sendCtrlAltDelButton">Send CtrlAltDel</div> <div id="sendCtrlAltDelButton">Send CtrlAltDel</div>
</div> </div>
<div id="screen" style={{ height: 'calc(100vh - 105px)' }}> <div id="screen" style={{ height: 'calc(100vh - 140px)' }}>
</div> </div>
{this.props.children} {this.props.children}

@ -70,6 +70,9 @@ subject:"计算机中的应用软件是指:"
option_name:"所有计算机上都应使用的软件" option_name:"所有计算机上都应使用的软件"
positon:0 positon:0
*/ */
componentDidMount() {
this.props.chooseQfun(this)
}
renderChooseQuestions() { renderChooseQuestions() {
const { getFieldDecorator } = this.props.form; const { getFieldDecorator } = this.props.form;
const { choose, choose_test_cases } = this.props; const { choose, choose_test_cases } = this.props;

@ -318,6 +318,7 @@ class CodeEvaluateView extends Component {
*/ */
const _arrowClasses = isCollapse ? 'iconfont icon-xiajiantou btn-arrow' : 'iconfont icon-shangjiantou btn-arrow'; const _arrowClasses = isCollapse ? 'iconfont icon-xiajiantou btn-arrow' : 'iconfont icon-shangjiantou btn-arrow';
return ( return (
<React.Fragment> <React.Fragment>
<ul id="blacktab_nav"> <ul id="blacktab_nav">
@ -330,11 +331,11 @@ class CodeEvaluateView extends Component {
<li className={`blacktab_con ${ tabIndex === 1 ? 'tab_hover' : ''}`} onClick={() => this.tabIndexChange(1)}> <li className={`blacktab_con ${ tabIndex === 1 ? 'tab_hover' : ''}`} onClick={() => this.tabIndexChange(1)}>
<a href="javascript:void(0);" className="tab_type tab_color">测试结果</a> <a href="javascript:void(0);" className="tab_type tab_color">测试结果</a>
</li> </li>
<li className="blacktab_con_abs"> {this.props&&this.props.vnc_url?<li className="blacktab_con_abs">
<span className="code_evalute_icon" onClick={() => this.handleShowTestCase()}> <span className="code_evalute_icon" onClick={() => this.handleShowTestCase()}>
<span className={_arrowClasses}></span> <span className={_arrowClasses}></span>
</span> </span>
</li> </li>:""}
{this.props.inDrawer ? <Tooltip id="tooltip-icon-expand" title={ showOrHide ? "收起" : "展开"}> {this.props.inDrawer ? <Tooltip id="tooltip-icon-expand" title={ showOrHide ? "收起" : "展开"}>
{/*TODO 按钮大小改造css*/} {/*TODO 按钮大小改造css*/}

@ -510,9 +510,10 @@ class DetailCards extends Component{
{this.props.current_user&&this.props.current_user.admin===true||this.props.current_user&&this.props.current_user.business===true? {this.props.current_user&&this.props.current_user.admin===true||this.props.current_user&&this.props.current_user.business===true?
item.shixuns_list && item.shixuns_list.map((line,index)=>{ item.shixuns_list && item.shixuns_list.map((line,index)=>{
return( return(
<div className="clearfix paragraph lineh-30" onMouseEnter> <div className="clearfix paragraph lineh-30" onMouseEnter={()=>this.showparagraph(key,index)} onMouseLeave={this.hideparagraph}>
<li className="fl li-width63">
<li className="fl li-width63">
<span className="progressRing mr10"> <span className="progressRing mr10">
{ {
@ -531,7 +532,8 @@ class DetailCards extends Component{
{ {
showparagraphkey===key&&showparagraphindex===index?<div> showparagraphkey===key&&showparagraphindex===index?<div>
<Link to={'/shixuns/'+line.identifier+'/challenges'} className="mr30 color-blue_4C shixun_detail pointer fl" target="_blank">查看详情</Link> <Link to={'/shixuns/'+line.identifier+'/challenges'} className="mr30 color-blue_4C shixun_detail pointer fl" target="_blank">查看详情</Link>
</div>:"" {line.shixun_status==="暂未公开"?"":<a onClick={()=>this.startgameid(line.identifier)} className="btn_auto user_bluebg_btn fl" id="shixun_operation" >开始实战</a>}
</div>:""
} }
</li> </li>

@ -23,7 +23,7 @@ import ChoquesEditor from "./component/ChoquesEditor"
import JudquestionEditor from "./component/JudquestionEditor"; import JudquestionEditor from "./component/JudquestionEditor";
import Paperreview_item from "./Paperreview_item" import Paperreview_item from "./Paperreview_item"
import Bottomsubmit from "../../modules/modals/Bottomsubmit"; import Bottomsubmit from "../../modules/modals/Bottomsubmit";
import Comthetestpapers from "./comthetestpaper/Comthetestpapers"; import Comthetestpaperst from "./comthetestpaper/Comthetestpaperst";
//人工组卷预览 //人工组卷预览
class Paperreview extends Component { class Paperreview extends Component {
constructor(props) { constructor(props) {
@ -134,6 +134,9 @@ class Paperreview extends Component {
booljupyterurls: true, booljupyterurls: true,
}) })
axios.get((url), {params: data}).then((response) => { axios.get((url), {params: data}).then((response) => {
if(response===undefined|| response===null){
return;
}
setTimeout(() => { setTimeout(() => {
this.setState({ this.setState({
booljupyterurls: false, booljupyterurls: false,
@ -188,18 +191,12 @@ class Paperreview extends Component {
} }
preservation = () => { preservation = () => {
debugger
//保存试卷 //保存试卷
if(this.state.Cohetepaperbool===true){ if(this.state.Cohetepaperbool===true){
if (this.contentMdRef.Getdatas().length === 0) { if (this.contentMdRef.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid"); this.scrollToAnchor("Itembankstopid");
return; return;
} }
console.log("this.contentMdRef.Getdatas()");
console.log(this.contentMdRef.Getdatas());
var myrbkc=[]; var myrbkc=[];
var Getdatasdatas=this.contentMdRef.Getdatas()[2].rbzsd; var Getdatasdatas=this.contentMdRef.Getdatas()[2].rbzsd;
for(let myda of Getdatasdatas) { for(let myda of Getdatasdatas) {
@ -213,13 +210,12 @@ class Paperreview extends Component {
discipline_id: this.contentMdRef.Getdatas()[3].rbkc[0], discipline_id: this.contentMdRef.Getdatas()[3].rbkc[0],
sub_discipline_id: this.contentMdRef.Getdatas()[3].rbkc[1], sub_discipline_id: this.contentMdRef.Getdatas()[3].rbkc[1],
tag_discipline_id: myrbkc, tag_discipline_id: myrbkc,
} }
axios.post(url, data) axios.post(url, data)
.then((result) => { .then((result) => {
if (result.data.status == 0) { if (result.data.status === 0) {
this.props.showNotification(`组卷成功`); this.props.showNotification(`组卷成功`);
this.props.history.replace('./paperlibrary'); this.props.history.replace('/paperlibrary');
} }
}).catch((error) => { }).catch((error) => {
console.log(error); console.log(error);
@ -292,11 +288,11 @@ class Paperreview extends Component {
</Paperreview_item> </Paperreview_item>
: :
<Comthetestpapers {...this.state} {...this.props} <Comthetestpaperst {...this.state} {...this.props}
getcontentMdRef={(ref) => this.getcontentMdRef(ref)} getcontentMdRef={(ref) => this.getcontentMdRef(ref)}
setitem_type={(item) => this.setitem_type(item)} setitem_type={(item) => this.setitem_type(item)}
></Comthetestpapers> ></Comthetestpaperst>
} }

@ -364,8 +364,8 @@ class Paperreview_item extends Component {
} }
showparagraphs = (e,name) => { showparagraphs = (e,name) => {
console.log("showparagraphs"); // console.log("showparagraphs");
console.log(e); // console.log(e);
this.setState({ this.setState({
paperreviewsingleindex: e, paperreviewsingleindex: e,
paperreviewsinglename:name, paperreviewsinglename:name,
@ -438,9 +438,7 @@ class Paperreview_item extends Component {
<div className="questiontypeheng w100s mt19 mb19"></div> <div className="questiontypeheng w100s mt19 mb19"></div>
<div className="w100s sortinxdirection"> <div className="w100s sortinxdirection">
<div className="pagertdstcolor w50s sortinxdirection">拖动试题可调整排序</div> <div className="pagertdstcolor w50s sortinxdirection">拖动试题可调整排序</div>
<div
className="pagertdstcolor w50s xaxisreverseorder">{single_questions && single_questions.questions_count}个试题
</div>
</div> </div>

@ -715,10 +715,7 @@ class Question extends Component {
showmodels={(e) => this.showmodels(e)} showmodels={(e) => this.showmodels(e)}
showmodelysl={(e) => this.showmodelysl(e)} showmodelysl={(e) => this.showmodelysl(e)}
callback={(e) => this.callback(e)}></Contentpart> callback={(e) => this.callback(e)}></Contentpart>
{/*分页*/}
{/*<div className="clearfix mt5">*/}
{/*<div className="educontent mt10 pb20 w1200s">*/}
{/* fenye*/}
{ {
items_count&&items_count>10? items_count&&items_count>10?
<div className="mb30 clearfix educontent mt40 intermediatecenter"> <div className="mb30 clearfix educontent mt40 intermediatecenter">

@ -508,7 +508,6 @@ class Questionitem_banks extends Component {
{/*题目头部操作*/} {/*题目头部操作*/}
<Itembankstop <Itembankstop
{...this.state} {...this.state}
{...this.props} {...this.props}
getcontentMdRef={(ref) => this.getcontentMdRef(ref)} getcontentMdRef={(ref) => this.getcontentMdRef(ref)}

@ -0,0 +1,269 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
} from "antd";
import './../questioncss/questioncom.css';
class Headplugselections extends Component {
constructor(props) {
super(props);
this.state = {
page:1,
titlestting:"全部",
titlesttingid:null,
titlesttings:null,
titlesttingss:null,
}
}
//初始化
componentDidMount(){
}
settitlestting=(name,id)=>{
//如果全部其他的选项重置
this.setState({
titlestting:name,
titlesttingid:id,
titlesttings:null,
titlesttingsid:null,
titlesttingss:null,
titlesttingssid:null
})
if(name==="全部"){
this.props.setdiscipline_id(null);
}else{
this.props.setdiscipline_id(id);
}
}
settitlesttings=(name,id)=>{
//课程选项
this.setState({
titlesttings:name,
titlesttingsid:id,
titlesttingss:null,
})
this.props.setsub_discipline_id(id);
}
settitlesttingss=(name,id)=>{
//知识点
if(this.state.titlesttings===null){
this.props.showNotification('请先选择课程');
return
}
this.setState({
titlesttingss:name,
titlesttingssid:id
})
this.props.settag_discipline_id(id);
}
render() {
let {page,titlestting,titlesttings,titlesttingss}=this.state;
var kc=0;
var zsd=0;
if(this.props.disciplinesdata){
const didata = this.props.disciplinesdata;
for (var i = 0; i < didata.length; i++) {
//方向
const fxdidata = didata[i].sub_disciplines;
if(titlestting===didata[i].name){
for (var j = 0; j < fxdidata.length; j++) {
kc=kc+1;
//课程
const zsddata = fxdidata[j].tag_disciplines;
for (var k = 0; k < zsddata.length; k++) {
//知识点
zsd=zsd+1;
}
}
}else if(titlestting==="全部"){
kc=kc+1;
zsd=zsd+1;
}else{
}
}
}
return (
<div className=" clearfix mt21 ">
<div className="educontent w1200dbl">
<div className="clearfix edu-back-white tophoms">
{/*课程*/}
<div className=" sortinxdirection">
<div className="w60 tophomsembolds">
方向
</div>
<div className="sortinxdirection minleng40">
<div className={titlestting==="全部"?" titlesttingcss xiaoshou":" titlesttingcssmy xiaoshou"} onClick={()=>this.settitlestting("全部",null)}>
全部
</div>
{this.props.disciplinesdata&&this.props.disciplinesdata.map((object, index) => {
return (
<div className={titlestting===object.name?" xiaoshou titlesttingcss":" titlesttingcssmy xiaoshou"} onClick={()=>this.settitlestting(object.name,object.id)}>
{object.name}
</div>
)
})}
</div>
</div>
{/*课程*/}
{
kc===0?
""
:
<div className="mt30 sortinxdirection">
<div className="w60 tophomsembolds">
课程
</div>
<div className="sortinxdirection minleng40">
{this.props.disciplinesdata&&this.props.disciplinesdata.map((objectn, index) => {
return (
titlestting==="全部"?
objectn.sub_disciplines&&objectn.sub_disciplines.map((object, indexs) => {
return (
<div className={index===0&&indexs===0&&titlesttings===object.name?"titlesttingcss xiaoshou":index===0&&indexs===0&&titlesttings!==object.name?"titlesttingcssmy xiaoshou"
:titlesttings===object.name?" titlesttingcss xiaoshou":"titlesttingcssmy xiaoshou"} onClick={()=>this.settitlesttings(object.name,object.id)}>
{object.name}
</div>
)
})
:
objectn.name===titlestting?
objectn.sub_disciplines&&objectn.sub_disciplines.map((object, indexs) => {
return (
<div className={index===0&&indexs===0&&titlesttings===object.name?"titlesttingcss xiaoshou":index===0&&indexs===0&&titlesttings!==object.name?"titlesttingcssmy xiaoshou"
:titlesttings===object.name?" titlesttingcss xiaoshou":"titlesttingcssmy xiaoshou"} onClick={()=>this.settitlesttings(object.name,object.id)}>
{object.name}
</div>
)
})
: ""
)
})}
</div>
</div>
}
{/*知识点*/}
{
zsd===0?
""
:<div className="mt30 sortinxdirection">
<div className="w60 tophomsembolds">
知识点
</div>
<div className="sortinxdirection minleng40">
{this.props.disciplinesdata&&this.props.disciplinesdata.map((objecta, index) => {
return (
titlestting==="全部"&&titlesttings===null?
objecta.sub_disciplines&&objecta.sub_disciplines.map((objectb, indexs) => {
return (
objectb.tag_disciplines&&objectb.tag_disciplines.map((object, indexss) => {
return (
<div className={index===0&&indexs===0&&indexss===0&&titlesttingss===object.name?"titlesttingcss xiaoshou":
index===0&&indexs===0&&indexss===0&&titlesttingss!==object.name?"titlesttingcssmy xiaoshou"
:titlesttingss===object.name?" titlesttingcss xiaoshou":" titlesttingcssmy xiaoshou"} onClick={()=>this.settitlesttingss(object.name)}>
{object.name}
</div>
)
})
)
})
:titlestting==="全部"&&titlesttings!==null?
objecta.sub_disciplines&&objecta.sub_disciplines.map((objectb, indexs) => {
return (
titlesttings===objectb.name?
objectb.tag_disciplines&&objectb.tag_disciplines.map((object, indexss) => {
return (
<div className={index===0&&indexs===0&&indexss===0&&titlesttingss===object.name?"titlesttingcss xiaoshou":
index===0&&indexs===0&&indexss===0&&titlesttingss!==object.name?"titlesttingcssmy xiaoshou"
:titlesttingss===object.name?" titlesttingcss xiaoshou":" titlesttingcssmy xiaoshou"} onClick={()=>this.settitlesttingss(object.name)}>
{object.name}
</div>
)
}):""
)
})
: titlestting!=="全部"&&titlesttings!==null?
titlestting===objecta.name?
objecta.sub_disciplines&&objecta.sub_disciplines.map((objectb, indexs) => {
return (
titlesttings===objectb.name?
objectb.tag_disciplines&&objectb.tag_disciplines.map((object, indexss) => {
return (
<div className={index===0&&indexs===0&&indexss===0&&titlesttingss===object.name?"titlesttingcss xiaoshou":
index===0&&indexs===0&&indexss===0&&titlesttingss!==object.name?"titlesttingcssmy xiaoshou"
:titlesttingss===object.name?" titlesttingcss xiaoshou":" titlesttingcssmy xiaoshou"} onClick={()=>this.settitlesttingss(object.name)}>
{object.name}
</div>
)
}):""
)
})
:""
: titlestting!=="全部"&&titlesttings===null?
titlestting===objecta.name?
objecta.sub_disciplines&&objecta.sub_disciplines.map((objectb, indexs) => {
return (
objectb.tag_disciplines&&objectb.tag_disciplines.map((object, indexss) => {
return (
<div className={index===0&&indexs===0&&indexss===0&&titlesttingss===object.name?"titlesttingcss xiaoshou":
index===0&&indexs===0&&indexss===0&&titlesttingss!==object.name?"titlesttingcssmy xiaoshou"
:titlesttingss===object.name?" titlesttingcss xiaoshou":" titlesttingcssmy xiaoshou"} onClick={()=>this.settitlesttingss(object.name)}>
{object.name}
</div>
)
})
)
})
:""
:""
)
})}
</div>
</div>
}
</div>
</div>
</div>
)
}
}
export default Headplugselections ;

@ -45,13 +45,13 @@ const options = [
class Itembankstop extends Component { class Itembankstop extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.contentMdRef = React.createRef()
this.state = { this.state = {
page: 1, page: 1,
Knowpoints: [], Knowpoints: [],
rbtx: undefined, rbtx: undefined,
rbkc: undefined, rbkc: undefined,
knowledgepoints: [], knowledgepoints: [],
knowledgepoints2:[],
options: [], options: [],
NewknTypedel:false NewknTypedel:false
} }
@ -65,30 +65,55 @@ class Itembankstop extends Component {
} }
this.setState({ this.setState({
options: this.props.disciplmy options: this.props.disciplmy,
})
// knowledgepoints:this.props.knowledgepoints,
////console.log("componentDidMount");
////console.log(this.state);
////console.log(this.props);
// let homeworkid = this.props.match.params.homeworkid;
// let url = "/homework_commons/" + homeworkid + "/end_groups.json";
// axios.get(url).then((response) => {
// if (response.status === 200) {
// this.setState({})
// }
// }).catch((error) => {
// ////console.log(error)
// });()
// 题型
})
} }
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
// 把知识点放进塞选中 ,如果是编辑 已经选中就不放进去
if (prevProps.disciplmy !== this.props.disciplmy) {
this.setState({
options: this.props.disciplmy
})
}
if(prevProps.disciplinesdata!== this.props.disciplinesdata){
try {
if(this.props.item_banksedit.discipline &&this.props.item_banksedit.sub_discipline){
const didata = this.props.disciplinesdata;
const knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) {
//方向
if (this.props.item_banksedit.discipline.id === didata[i].id) {
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
//课程
if (this.props.item_banksedit.sub_discipline.id === fxdidata[j].id) {
const zsddata = fxdidata[j].tag_disciplines;
for (var k = 0; k < zsddata.length; k++) {
//知识点
knowledgepointsdata.push(zsddata[k]);
}
}
}
}
}
const _result =[];
knowledgepointsdata.filter(item => {
if (this.props.item_banksedit.tag_disciplines.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
knowledgepoints:knowledgepointsdata,
knowledgepoints2: _result,
})
}
}catch (e) {
}
}
//编辑的时候 //编辑的时候
if (prevProps.item_banksedit !== this.props.item_banksedit) { if (prevProps.item_banksedit !== this.props.item_banksedit) {
if (this.props.item_banksedit.item_type) { if (this.props.item_banksedit.item_type) {
this.handleFormtixing(this.props.item_banksedit.item_type); this.handleFormtixing(this.props.item_banksedit.item_type);
@ -99,75 +124,76 @@ class Itembankstop extends Component {
if (this.props.item_banksedit.tag_disciplines) { if (this.props.item_banksedit.tag_disciplines) {
this.handletag_disciplinesChange(this.props.item_banksedit.tag_disciplines); this.handletag_disciplinesChange(this.props.item_banksedit.tag_disciplines);
} }
try {
if (this.props.item_banksedit.discipline &&this.props.item_banksedit.sub_discipline) {
this.handdisciplinesChange(this.props.item_banksedit.discipline,this.props.item_banksedit.sub_discipline); this.handdisciplinesChange(this.props.item_banksedit.discipline,this.props.item_banksedit.sub_discipline);
}catch (e) {
} }
this.getdatasmys();
} }
if (prevProps.disciplmy !== this.props.disciplmy) {
this.setState({
options: this.props.disciplmy
})
}
}
handdisciplinesChange =(name,title)=>{
this.setState({
rbkc:[name.id,title.id]
})
this.props.form.setFieldsValue({
rbkc: [name.id,title.id],
});
if(this.props.item_banksedit.tag_disciplines.length===0){
const didata = this.props.disciplinesdata;
const knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) {
//方向
if (name.id === didata[i].id) {
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
//课程
if (title.id === fxdidata[j].id) {
const zsddata = fxdidata[j].tag_disciplines;
for (var k = 0; k < zsddata.length; k++) {
//知识点
knowledgepointsdata.push(zsddata[k]);
}
getdatasmys=()=>{
if(this.props.disciplinesdata){
try {
if(this.props.item_banksedit.discipline &&this.props.item_banksedit.sub_discipline){
var didata = this.props.disciplinesdata;
var knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) {
//方向
if (this.props.item_banksedit.discipline.id === didata[i].id) {
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
//课程
if (this.props.item_banksedit.sub_discipline.id === fxdidata[j].id) {
const zsddata = fxdidata[j].tag_disciplines;
for (var k = 0; k < zsddata.length; k++) {
//知识点
knowledgepointsdata.push(zsddata[k]);
}
}
} }
} }
} }
} var _result =[];
knowledgepointsdata.filter(item => {
if (this.props.item_banksedit.tag_disciplines.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
}
this.setState({ this.setState({
Knowpoints: [], knowledgepoints:knowledgepointsdata,
knowledgepoints: knowledgepointsdata, knowledgepoints2: _result,
}) })
}else{
}
}catch (e) {
}
} }
}
handdisciplinesChange =(name,title)=>{
this.setState({
rbkc:[name.id,title.id]
})
this.props.form.setFieldsValue({
rbkc: [name.id,title.id],
});
}
}
handletag_disciplinesChange = (data) => { handletag_disciplinesChange = (data) => {
//是否选中的知识点
try { try {
var sju=data[data.length-1].name; var sju=data[data.length-1].name;
this.setState({ this.setState({
rbzsd:sju,
Knowpoints:data, Knowpoints:data,
}) })
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
@ -176,6 +202,8 @@ class Itembankstop extends Component {
}catch (e) { }catch (e) {
} }
} }
onChange = (e) => { onChange = (e) => {
@ -238,7 +266,6 @@ class Itembankstop extends Component {
//课程 //课程
////console.log("课程"); ////console.log("课程");
////console.log(value); ////console.log(value);
// console.log("handleFormkechen");
if(this.state.Knowpoints.length>4){ if(this.state.Knowpoints.length>4){
this.props.showNotification(`知识点最多选择5个`); this.props.showNotification(`知识点最多选择5个`);
return return
@ -256,17 +283,20 @@ class Itembankstop extends Component {
} }
} }
var tmp = JSON.parse(JSON.stringify(this.state.knowledgepoints)); const _result =[];
for (var i = 0; i < tmp.length; i++) { this.state.knowledgepoints.filter(item => {
if (tmp[i].id === value) { if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
this.state.knowledgepoints.splice(i, 1); console.log("guonue");
console.log(item);
_result.push(item);
} }
} });
this.setState({ this.setState({
rbzsd: valuename, rbzsd: valuename,
Knowpoints: this.state.Knowpoints, Knowpoints: this.state.Knowpoints,
knowledgepoints: this.state.knowledgepoints, knowledgepoints2: _result,
}) })
} }
@ -314,6 +344,7 @@ class Itembankstop extends Component {
this.setState({ this.setState({
Knowpoints: [], Knowpoints: [],
knowledgepoints: knowledgepointsdata, knowledgepoints: knowledgepointsdata,
knowledgepoints2:knowledgepointsdata,
}) })
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
@ -341,19 +372,11 @@ class Itembankstop extends Component {
////console.log('Clicked! But prevent default.'); ////console.log('Clicked! But prevent default.');
} }
deletesobject = (item, index) => { deletesobject = (item, index) => {
var arr = this.state.Knowpoints;
for (let data of arr) {
if (data.id === item.id) {
this.state.knowledgepoints.push(data);
}
}
var tmp = JSON.parse(JSON.stringify(this.state.Knowpoints)); var tmp = this.state.Knowpoints;
for (var i = 0; i < tmp.length; i++) { for (var i = 0; i < tmp.length; i++) {
if (i >= index) { if (i ===index) {
var pos = this.state.Knowpoints.indexOf(tmp[i]); tmp.splice(i,1);
this.state.Knowpoints.splice(pos, 1);
} }
} }
@ -361,11 +384,16 @@ class Itembankstop extends Component {
rbzsd: this.state.Knowpoints, rbzsd: this.state.Knowpoints,
}); });
const _result =[];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({ this.setState({
Knowpoints: this.state.Knowpoints, Knowpoints: this.state.Knowpoints,
knowledgepoints2:_result,
}) })
if (this.state.Knowpoints.length === 0) { if (this.state.Knowpoints.length === 0) {
this.setState({ this.setState({
rbzsd: undefined, rbzsd: undefined,
@ -389,7 +417,6 @@ class Itembankstop extends Component {
NewknTypedel:bool NewknTypedel:bool
}) })
} }
NewknTypedeltyoedel=(value)=>{ NewknTypedeltyoedel=(value)=>{
@ -422,8 +449,17 @@ class Itembankstop extends Component {
name:value, name:value,
} }
this.state.knowledgepoints.push(leydata); this.state.knowledgepoints.push(leydata);
const _result =[];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({ this.setState({
knowledgepoints:this.state.knowledgepoints Knowpoints: this.state.Knowpoints,
knowledgepoints: this.state.knowledgepoints,
knowledgepoints2: _result,
}) })
} }
}).catch((error) => { }).catch((error) => {
@ -435,13 +471,11 @@ class Itembankstop extends Component {
}) })
} }
render() { render() {
let {page, options,NewknTypedel} = this.state; let {page, options,NewknTypedel,knowledgepoints,knowledgepoints2,Knowpoints} = this.state;
const {getFieldDecorator} = this.props.form; const {getFieldDecorator} = this.props.form;
//console.log("renderrenderrender");
//console.log(this.props.item_banksedit);
//console.log("renderrenderrendersssss");
//console.log(this.state.rbtx);
return ( return (
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200fpx mt19"> <div className=" clearfix educontent Contentquestionbankstyle w100s w1200fpx mt19">
@ -495,30 +529,11 @@ class Itembankstop extends Component {
} }
)( )(
<div className="sortinxdirection"> <div className="sortinxdirection">
<InputGroup compact> <InputGroup >
<Cascader style={{width: '258px'}} value={this.state.rbkc} options={options} onChange={this.handleFormzhishidian} <Cascader style={{width: '258px'}} value={this.state.rbkc} options={options} onChange={this.handleFormzhishidian}
placeholder="请选择..."/> placeholder="请选择..."/>
</InputGroup> </InputGroup>
{/*<div className="sortinxdirection" style={{*/}
{/* height: "33px",*/}
{/* lineHeight: "28px",*/}
{/*}}>*/}
{/* {this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => {*/}
{/* return (*/}
{/* <div className="mytags" style={{*/}
{/* position: "relative",*/}
{/* }}>*/}
{/* <p className="w100s stestcen lh32">{object}</p>*/}
{/* <i className="iconfont icon-roundclose font-25 lg ml7 icondowncolorss" onClick={()=>this.deletesobject(object,index)}></i>*/}
{/* </div>*/}
{/* )*/}
{/* })}*/}
{/*</div>*/}
</div> </div>
)} )}
</Form.Item> </Form.Item>
@ -528,18 +543,19 @@ class Itembankstop extends Component {
{getFieldDecorator("rbzsd" {getFieldDecorator("rbzsd"
)( )(
<div className="sortinxdirection"> <div className="sortinxdirection">
<InputGroup compact> <InputGroup >
<Select style={{width: '258px'}} value={this.state.rbzsd} onChange={this.handleFormkechen} <Select style={{width: '258px'}} value={undefined} onChange={this.handleFormkechen}
placeholder="请选择..."> placeholder="请选择...">
{this.state.knowledgepoints && this.state.knowledgepoints.map((object, index) => { {knowledgepoints2 && knowledgepoints2.map((object, index) => {
return ( return (
<Option value={object.id}>{object.name}</Option> <Option key={object.id} value={object.id}>{object.name}</Option>
) )
})} })}
</Select> </Select>
</InputGroup> </InputGroup>
<img className=" ml22 zjzsdian xiaoshou" src={getImageUrl("/images/educoder/zjzsd.png")} onClick={()=>this.NewknTypedeldel(true)}/> <img className=" ml22 zjzsdian xiaoshou" src={getImageUrl("/images/educoder/zjzsd.png")} onClick={()=>this.NewknTypedeldel(true)}/>
@ -551,7 +567,7 @@ class Itembankstop extends Component {
{this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => { {this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => {
return ( return (
<div className="mytags" style={{ <div key={index} className="mytags" style={{
position: "relative", position: "relative",
}}> }}>
<p className="w100s stestcen lh32">{object.name}</p> <p className="w100s stestcen lh32">{object.name}</p>
@ -562,6 +578,9 @@ class Itembankstop extends Component {
) )
})} })}
</div> </div>
</div> </div>
)} )}
@ -575,7 +594,7 @@ class Itembankstop extends Component {
rules: [{required: true, message: '请选择题型'}], rules: [{required: true, message: '请选择题型'}],
} }
)( )(
<InputGroup compact> <InputGroup >
<Select style={{width: '258px'}} value={this.state.rbtx} onChange={this.handleFormtixing} <Select style={{width: '258px'}} value={this.state.rbtx} onChange={this.handleFormtixing}
placeholder="请选择..."> placeholder="请选择...">
<Option value="SINGLE">单选题</Option> <Option value="SINGLE">单选题</Option>
@ -648,7 +667,7 @@ class Itembankstop extends Component {
rules: [{required: true, message: '请选择难度'}], rules: [{required: true, message: '请选择难度'}],
} }
)( )(
<Radio.Group value={this.state.rbnd} onChange={this.handleFormLayoutChange}> <Radio.Group initialValue={this.state.rbnd} onChange={this.handleFormLayoutChange}>
<Radio.Button value="1">简单</Radio.Button> <Radio.Button value="1">简单</Radio.Button>
<Radio.Button value="2">适中</Radio.Button> <Radio.Button value="2">适中</Radio.Button>
<Radio.Button value="3">困难</Radio.Button> <Radio.Button value="3">困难</Radio.Button>
@ -656,12 +675,6 @@ class Itembankstop extends Component {
)} )}
</Form.Item> </Form.Item>
</div> </div>
{/*<Form.Item>*/}
{/* <Button type="primary" htmlType="submit" className="login-form-button">*/}
{/* 提交*/}
{/* </Button>*/}
{/*</Form.Item>*/}
</Form> </Form>
<div className="h20"></div> <div className="h20"></div>
</div> </div>

@ -3,7 +3,6 @@ import {getImageUrl} from 'educoder';
import { Modal,InputNumber} from 'antd'; import { Modal,InputNumber} from 'antd';
import axios from 'axios'; import axios from 'axios';
import './../questioncss/questioncom.css' import './../questioncss/questioncom.css'
//立即申请试用
class Paperreview_itemModel extends Component { class Paperreview_itemModel extends Component {
constructor(props) { constructor(props) {
@ -14,7 +13,7 @@ class Paperreview_itemModel extends Component {
} }
onChange=(value)=>{ onChange=(value)=>{
console.log("Paperreview_itemModel"); console.log("设置批量得分");
console.log(value); console.log(value);
this.setState({ this.setState({
value:value, value:value,

@ -322,7 +322,7 @@ class SingleEditor extends Component{
{/* <Tooltip title={standard_answers[index] ? '点击取消标准答案设置' : '点击设置为标准答案'}> */} {/* <Tooltip title={standard_answers[index] ? '点击取消标准答案设置' : '点击设置为标准答案'}> */}
<span class={`option-item fr mr10 color-grey select-choice ${bg} `} <span class={`option-item fr mr10 color-grey select-choice ${bg} `}
name="option_span" onClick={() => this.onOptionClick(index)} style={{flex: '0 0 38px'}}> name="option_span" onClick={() => this.onOptionClick(index)} style={{flex: '0 0 38px'}}>
<ConditionToolTip title={standard_answers[index] ? '点击取消标准答案设置' : '点击设置为标准答案'} placement="left" condition={true}> <ConditionToolTip title={standard_answers[index] ? '' : '点击设置为标准答案'} placement="left" condition={true}>
<div style={{width: '100%', height: '100%'}}>{tagArray[index]}</div> <div style={{width: '100%', height: '100%'}}>{tagArray[index]}</div>
</ConditionToolTip> </ConditionToolTip>
</span> </span>

@ -375,8 +375,6 @@ class Comthetestpapers extends Component {
addonAfteronelens3=String(addonAfterthree).length; addonAfteronelens3=String(addonAfterthree).length;
} }
console.log("Comthetestpapers.js");
console.log(this.props);
return ( return (
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200fpx mt19"> <div className=" clearfix educontent Contentquestionbankstyle w100s w1200fpx mt19">
@ -537,27 +535,27 @@ class Comthetestpapers extends Component {
<span className="ant-form-text"> 分钟</span> <span className="ant-form-text"> 分钟</span>
</Form.Item> </Form.Item>
</div> </div>
<div className="tixing"> {/*<div className="tixing">*/}
<Form.Item {/*<Form.Item*/}
label="题型:" {/* label="题型:"*/}
> {/*>*/}
{getFieldDecorator("rbtx", {/* {getFieldDecorator("rbtx",*/}
{ {/* {*/}
rules: [{required: true, message: '请选择题型'}], {/* rules: [{required: true, message: '请选择题型'}],*/}
} {/* }*/}
)( {/* )(*/}
<InputGroup compact> {/* <InputGroup compact>*/}
<Select style={{width: '258px'}} value={this.state.rbtx} onChange={this.handleFormtixing} {/* <Select style={{width: '258px'}} value={this.state.rbtx} onChange={this.handleFormtixing}*/}
placeholder="请选择..."> {/* placeholder="请选择...">*/}
<Option value="SINGLE">单选题</Option> {/* <Option value="SINGLE">单选题</Option>*/}
<Option value="MULTIPLE">多选题</Option> {/* <Option value="MULTIPLE">多选题</Option>*/}
<Option value="JUDGMENT">判断题</Option> {/* <Option value="JUDGMENT">判断题</Option>*/}
<Option value="PROGRAM">编程题</Option> {/* <Option value="PROGRAM">编程题</Option>*/}
</Select> {/* </Select>*/}
</InputGroup> {/* </InputGroup>*/}
)} {/* )}*/}
</Form.Item> {/*</Form.Item>*/}
</div> {/*</div>*/}
<style> <style>
{ {

@ -0,0 +1,818 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Radio,
Checkbox,
Form,
Input,
Select,
Cascader,
Col, Row, InputNumber, DatePicker, AutoComplete, Button, Tag
} from "antd";
import './../questioncss/questioncom.css';
import Newknledpots from '../component/Newknledpots'
const InputGroup = Input.Group;
const {Option} = Select;
const options = [
{
value: '方向',
label: '方向',
children: [
{
value: '课程',
label: '课程',
},
],
},
{
value: 'jiangsu',
label: 'Jiangsu',
children: [
{
value: 'nanjing',
label: 'Nanjing',
},
],
},
];
class Comthetestpaperst extends Component {
constructor(props) {
super(props);
this.contentMdRef = React.createRef()
this.state = {
page: 1,
Knowpoints: [],
rbtx: undefined,
rbkc: undefined,
knowledgepoints: [],
knowledgepoints2:[],
options: [],
NewknTypedel:false
}
}
//初始化
componentDidMount() {
try {
this.props.getJudquestio(this);
} catch (e) {
}
this.setState({
options: this.props.disciplmy,
})
}
componentDidUpdate(prevProps) {
//编辑的时候
if (prevProps.disciplmy !== this.props.disciplmy) {
this.setState({
options: this.props.disciplmy
})
}
// 把知识点放进塞选中 ,如果是编辑 已经选中就不放进去
if(prevProps.disciplinesdata!== this.props.disciplinesdata){
try {
if(this.props.item_banksedit.discipline &&this.props.item_banksedit.sub_discipline){
var didata = this.props.disciplinesdata;
var knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) {
//方向
if (this.props.item_banksedit.discipline.id === didata[i].id) {
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
//课程
if (this.props.item_banksedit.sub_discipline.id === fxdidata[j].id) {
const zsddata = fxdidata[j].tag_disciplines;
for (var k = 0; k < zsddata.length; k++) {
//知识点
knowledgepointsdata.push(zsddata[k]);
}
}
}
}
}
var _result =[];
knowledgepointsdata.filter(item => {
if (this.props.item_banksedit.tag_disciplines.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
knowledgepoints:knowledgepointsdata,
knowledgepoints2: _result,
})
}else{
}
}catch (e) {
}
}
if (prevProps.item_banksedit !== this.props.item_banksedit) {
// if (this.props.item_banksedit.item_type) {
// this.handleFormtixing(this.props.item_banksedit.item_type);
// }
if (this.props.item_banksedit.difficulty) {
this.handleFormLayoutChange(this.props.item_banksedit.difficulty);
}
if (this.props.item_banksedit.tag_disciplines) {
this.handletag_disciplinesChange(this.props.item_banksedit.tag_disciplines);
}
try {
this.handdisciplinesChange(this.props.item_banksedit.discipline,this.props.item_banksedit.sub_discipline);
}catch (e) {
}
try {
if(this.props.item_banksedit.name){
this.props.form.setFieldsValue({
// course:value,
classroom:this.props.item_banksedit.name,
})
}
}catch (e) {
}
try {
if(this.props.item_banksedit.duration){
this.props.form.setFieldsValue({
// course:value,
kssc:this.props.item_banksedit.duration,
})
}
}catch (e) {
}
this.getdatasmys();
}
}
getdatasmys=()=>{
if(this.props.disciplinesdata){
try {
if(this.props.item_banksedit.discipline &&this.props.item_banksedit.sub_discipline){
var didata = this.props.disciplinesdata;
var knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) {
//方向
if (this.props.item_banksedit.discipline.id === didata[i].id) {
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
//课程
if (this.props.item_banksedit.sub_discipline.id === fxdidata[j].id) {
const zsddata = fxdidata[j].tag_disciplines;
for (var k = 0; k < zsddata.length; k++) {
//知识点
knowledgepointsdata.push(zsddata[k]);
}
}
}
}
}
var _result =[];
knowledgepointsdata.filter(item => {
if (this.props.item_banksedit.tag_disciplines.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
knowledgepoints:knowledgepointsdata,
knowledgepoints2: _result,
})
}else{
}
}catch (e) {
}
}
}
handdisciplinesChange =(name,title)=>{
this.setState({
rbkc:[name.id,title.id]
})
this.props.form.setFieldsValue({
rbkc: [name.id,title.id],
});
}
handleSearch=(value)=>{
if(value!=""){
this.props.form.setFieldsValue({
classroom:value,
// course:value
});
// this.Searchvalue(value)
}
};
handleChange=(e)=>{
console.log(e);
this.props.form.setFieldsValue({
// course:value,
classroom:e.target.value,
})
if(e.target.value){
if(e.target.value.length>60){
this.setState({
bordebool:true,
})
}else if(e.target.value.length===0){
this.setState({
bordebool:true,
})
}else{
this.setState({
bordebool:false,
})
}
}else{
this.setState({
bordebool:true
})
}
};
handletag_disciplinesChange = (data) => {
//是否选中的知识点
try {
var sju=data[data.length-1].name;
this.setState({
Knowpoints:data,
})
this.props.form.setFieldsValue({
rbzsd: sju,
});
}catch (e) {
}
}
onChange = (e) => {
}
Getdatas = () => {
return this.handleSubmits();
}
handleSubmits = () => {
var data = [];
this.props.form.validateFields((err, values) => {
data = [];
if (!err) {
data.push({
rbnd: parseInt(values.rbnd)
})
data.push({
rbtx: null
})
data.push({
rbzsd: this.state.Knowpoints
})
data.push({
rbkc: values.rbkc
})
data.push({
classroom:values.classroom
})
data.push({
kssc:values.kssc
})
}
});
return data;
}
handleSubmit = (e) => {
e.preventDefault();
this.props.form.validateFields((err, values) => {
if (!err) {
////console.log("获取的form 数据");
////console.log(values);
}
});
}
handleFormLayoutChange = (value) => {
//难度塞选
////console.log("难度塞选");
////console.log(value);
this.props.form.setFieldsValue({
rbnd: value + "",
});
this.setState({
rbnd: value + "",
})
}
handleFormkechen = (value) => {
//课程
////console.log("课程");
////console.log(value);
if(this.state.Knowpoints.length>4){
this.props.showNotification(`知识点最多选择5个`);
return
}
var valuename = undefined;
this.props.form.setFieldsValue({
rbzsd: value,
});
var arr = this.state.knowledgepoints;
for (let data of arr) {
if (data.id === value) {
this.state.Knowpoints.push(data);
valuename = data.name;
}
}
const _result =[];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
console.log("guonue");
console.log(item);
_result.push(item);
}
});
this.setState({
rbzsd: valuename,
Knowpoints: this.state.Knowpoints,
knowledgepoints2: _result,
})
}
handleFormzhishidian = (value) => {
console.log("handleFormzhishidian 课程");
console.log(value);
//课程
this.props.form.setFieldsValue({
rbkc: value,
});
this.setState({
rbkc:value,
})
// console.log("handleFormzhishidian");
// console.log(this.props.disciplinesdata);
const didata = this.props.disciplinesdata;
const knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) {
//方向
if (value[0] === didata[i].id) {
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
//课程
if (value[1] === fxdidata[j].id) {
const zsddata = fxdidata[j].tag_disciplines;
for (var k = 0; k < zsddata.length; k++) {
//知识点
knowledgepointsdata.push(zsddata[k]);
}
}
}
}
}
this.setState({
Knowpoints: [],
knowledgepoints: knowledgepointsdata,
knowledgepoints2:knowledgepointsdata,
})
this.props.form.setFieldsValue({
rbzsd: undefined,
});
this.setState({
rbzsd: undefined,
})
}
handleFormtixing = (value) => {
//题型
//console.log("题型");
//console.log(value);
this.setState({
rbtx: value + "",
})
this.props.form.setFieldsValue({
rbtx: value + "",
});
this.props.setitem_type(value);
}
preventDefault = (e) => {
e.preventDefault();
////console.log('Clicked! But prevent default.');
}
deletesobject = (item, index) => {
debugger
var tmp = this.state.Knowpoints;
for (var i = 0; i < tmp.length; i++) {
if (i ===index) {
tmp.splice(i,1);
}
}
this.props.form.setFieldsValue({
rbzsd: this.state.Knowpoints,
});
const _result =[];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
Knowpoints: this.state.Knowpoints,
knowledgepoints2:_result,
})
if (this.state.Knowpoints.length === 0) {
this.setState({
rbzsd: undefined,
})
} else if (this.state.Knowpoints.length > 0) {
try {
const myknowda = this.state.Knowpoints;
this.setState({
rbzsd: myknowda[this.state.Knowpoints.length - 1].name,
})
} catch (e) {
}
}
}
NewknTypedeldel=(bool)=>{
this.setState({
NewknTypedel:bool
})
}
NewknTypedeltyoedel=(value)=>{
if(value===null||value===""){
this.props.showNotification(`请输入知识点`);
return
}
if(value.length===0){
this.props.showNotification(`请输入知识点`);
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]
}
const url="/tag_disciplines.json";
axios.post(url,data)
.then((result) => {
if (result.data.status === 0) {
this.props.showNotification(`新增知识点成功!`);
var leydata={
id: result.data.tag_discipline_id,
name:value,
}
this.state.knowledgepoints.push(leydata);
const _result =[];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
Knowpoints: this.state.Knowpoints,
knowledgepoints: this.state.knowledgepoints,
knowledgepoints2: _result,
})
}
}).catch((error) => {
//console.log(error);
})
this.setState({
NewknTypedel:false
})
}
render() {
let {page, options,NewknTypedel,knowledgepoints,knowledgepoints2,Knowpoints} = this.state;
const {getFieldDecorator} = this.props.form;
const optionss = this.state.searchlist && this.state.searchlist.map(d => <Option key={d.name} value={d.name}>{d.name}</Option>);
var addonAfterthree=this.props.form&&this.props.form.getFieldValue('classroom');
var addonAfteronelens3=0;
if(addonAfterthree){
addonAfteronelens3=String(addonAfterthree).length;
}
return (
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200fpx mt19">
<style>
{
`
.ant-form-item{
margin-bottom: 0px !important;
}
.ant-form-explain{
padding-left:0px !important;
margin-top: 3px !important;
}
.ant-select-selection{
height: 33px !important;
}
.ant-input-group{
width:258px !important;
}
.ant-input {
height: 33px !important;
}
.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within {
outline: 0px solid rgba(24, 144, 255, 0.06) !important;
}
`
}
</style>
<div className="h12"></div>
{
NewknTypedel?
<Newknledpots {...this.state} {...this.props}
NewknTypedeldel={(bool)=>this.NewknTypedeldel(bool)}
NewknTypedeltyoedel={(value)=>this.NewknTypedeltyoedel(value)}
></Newknledpots>
:""
}
<Form onSubmit={this.handleSubmit}>
<Form.Item
label="课程"
>
{getFieldDecorator("rbkc",
{
rules: [{required: true, message: '请选择课程'}],
}
)(
<div className="sortinxdirection">
<InputGroup compact>
<Cascader style={{width: '258px'}} value={this.state.rbkc} options={options} onChange={this.handleFormzhishidian}
placeholder="请选择..."/>
</InputGroup>
</div>
)}
</Form.Item>
<Form.Item
label="知识点"
>
{getFieldDecorator("rbzsd"
)(
<div className="sortinxdirection">
<InputGroup compact>
<Select style={{width: '258px'}} value={undefined} onChange={this.handleFormkechen}
placeholder="请选择...">
{knowledgepoints2 && knowledgepoints2.map((object, index) => {
return (
<Option key={object.id} value={object.id}>{object.name}</Option>
)
})}
</Select>
</InputGroup>
<img className=" ml22 zjzsdian xiaoshou" src={getImageUrl("/images/educoder/zjzsd.png")} onClick={()=>this.NewknTypedeldel(true)}/>
<div className="sortinxdirection" style={{
height: "33px",
lineHeight: "28px",
}}>
{this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => {
return (
<div key={index} className="mytags" style={{
position: "relative",
}}>
<p className="w100s stestcen lh32">{object.name}</p>
<img className=" ml7 zjzsdian xiaoshou icondowncolorssy" onClick={() => this.deletesobject(object, index)} src={getImageUrl("/images/educoder/bzucha.png")}/>
</div>
)
})}
</div>
</div>
)}
</Form.Item>
<style>
{
`
.ml19{
margin-left:19px;
}
`
}
</style>
<div className="stud-class-set ">
<style>{
`
.yslzxueshis .ant-input{
border-right: none !important;
height: 38px !important;
width: 970px !important;
}
.yslzxueshisy span .ant-input-group-addon{
width: 65px !important;
background-color: #fafafa!important;
}
.yslzxueshisy .ant-input-group-addon{
width: 65px !important;
background-color: #fafafa!important;
}
`
}</style>
<div className="sjmc">
<Form.Item label="试卷名称:">
{getFieldDecorator('classroom', {
rules: [{required: true, message: "不能为空"}],
})(
<AutoComplete
onSearch={this.handleSearch}
className={"fl construction yslzxueshis "}
dataSource={optionss}
>
<Input className="yslzxueshisy " placeholder="例如:数据结构" onInput={this.handleChange} addonAfter={String(addonAfteronelens3)+"/60"} maxLength={60} />
</AutoComplete>
)}
<div id='isclassroom'></div>
</Form.Item>
</div>
</div>
<style>
{
`
.kssc .ant-form-item-label{
line-height: 38px !important;
}
`
}
</style>
<div className="kssc">
<Form.Item label="考试时长:">
{getFieldDecorator('kssc')(<InputNumber
min={0}
step={0.1}
></InputNumber>)}
<span className="ant-form-text"> 分钟</span>
</Form.Item>
</div>
<style>
{
`
.rbndclass .ant-radio-button-wrapper{
width:106px !important;
height:33px !important;
background:#EEEEEE;
border-radius:17px !important;
color:#333333;
text-align: center !important;
border:0px !important;
margin-right: 27px !important;
margin-top: 6px !important;
}
.rbndclass .ant-radio-button-wrapper-checked {
width: 106px !important;
height: 33px !important;
background: #4CACFF !important;
border-radius: 17px !important;
text-align: center !important;
border:0px !important;
color: #ffffff !important;
margin-right: 27px !important;
margin-top: 6px!important;
}
.rbndclass .ant-radio-button-wrapper:not(:first-child)::before{
border:0px !important;
width:0px !important;
}
.rbndclass .ant-radio-button-wrapper{
border:0px !important;
}
.rbndclass .ant-radio-group{
border:0px !important;
}
.rbndclass .ant-radio-group label{
border:0px !important;
}
.rbndclass .ant-radio-group span{
border:0px !important;
}
ant-radio-button-wrapper:focus-within {
outline: 0px solid #ffffff;
}
`
}
</style>
<div className="rbndclass">
<Form.Item label="难度">
{getFieldDecorator('rbnd',
{
rules: [{required: true, message: '请选择难度'}],
}
)(
<Radio.Group initialValue={this.state.rbnd} onChange={this.handleFormLayoutChange}>
<Radio.Button value="1">简单</Radio.Button>
<Radio.Button value="2">适中</Radio.Button>
<Radio.Button value="3">困难</Radio.Button>
</Radio.Group>,
)}
</Form.Item>
</div>
</Form>
<div className="h20"></div>
</div>
)
}
}
const Comthetestpapersts = Form.create({name: 'Comthetestpaperst'})(Comthetestpaperst);
export default Comthetestpapersts;

@ -0,0 +1,270 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb
} from "antd";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import NoneData from './component/NoneData';
import './testioncss/testioncss.css';
import '../tpm/newshixuns/css/Newshixuns.css';
import Bottomsubmit from "../../modules/modals/Bottomsubmit";
import Seeoagertits from "./component/Seeoagertits";
import Paperlibraryseeid_item from './component/Paperlibraryseeid_item';
import Comthetestpaperst from '../question/comthetestpaper/Comthetestpaperst';
import Paperlibraryseeid_itemss from './component/Paperlibraryseeid_itemss';
import JudquestionEditor from "../question/component/JudquestionEditor";
//人工组卷预览
class Paperlibraryeditid extends Component {
constructor(props) {
super(props);
this.Judquestio = React.createRef();
this.state = {
paperlibrartdata: [],
disciplinesdata: [],
knowledgepoints: [],
disciplmy: [],
item_banksedit: []
}
}
getJudquestio = (Ref) => {
console.log("子组件对象");
console.log(Ref);
this.Judquestio = Ref;
}
//初始化
componentDidMount() {
this.getdata();
let urls = `/disciplines.json`;
axios.get(urls, {
params: {
source: "question"
}
}).then((response) => {
if (response) {
this.setState({
disciplinesdata: response.data.disciplines,
})
if (response.data) {
if (response.data.disciplines) {
const didata = response.data.disciplines;
for (var i = 0; i < didata.length; i++) {
const childern = [];
//方向
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
//课程
const zsddata = fxdidata[j].tag_disciplines;
childern.push(
{
value: fxdidata[j].id,
label: fxdidata[j].name,
}
)
for (var k = 0; k < zsddata.length; k++) {
//知识点
this.state.knowledgepoints.push(zsddata[k]);
}
}
const datakec = {
value: didata[i].id,
label: didata[i].name,
children: childern,
}
this.state.disciplmy.push(datakec);
}
this.setState({
knowledgepoints: this.state.knowledgepoints,
disciplmy: this.state.disciplmy,
})
}
}
}
});
}
getdata = () => {
let urls = `/examination_banks/${this.props.match.params.id}.json`;
axios.get(urls).then((response) => {
if (response) {
this.setState({
paperlibrartdata: response.data,
item_banksedit: response.data.exam,
})
}
});
}
//跳转道描点的地方
scrollToAnchor = (anchorName) => {
try {
if (anchorName) {
// 找到锚点
let anchorElement = document.getElementById(anchorName);
// 如果对应id的锚点存在就跳转到锚点
if (anchorElement) {
anchorElement.scrollIntoView();
}
}
} catch (e) {
}
}
preservation = () => {
//保存试卷
if (this.Judquestio.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return;
}
var myrbkc=[];
var Getdatasdatas=this.Judquestio.Getdatas()[2].rbzsd;
for(let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
const url = `/examination_banks/${this.props.match.params.id}.json`;
var data={
difficulty:this.Judquestio.Getdatas()[0].rbnd,
name:this.Judquestio.Getdatas()[4].classroom,
duration:this.Judquestio.Getdatas()[5].kssc,
discipline_id: this.Judquestio.Getdatas()[3].rbkc[0],
sub_discipline_id: this.Judquestio.Getdatas()[3].rbkc[1],
tag_discipline_id: myrbkc,
}
axios.put(url, data)
.then((result) => {
if (result.data.status === 0) {
this.props.showNotification(`试卷更新成功`);
this.props.history.push('/paperlibrary');
}
}).catch((error) => {
console.log(error);
})
}
setitem_type = (item_type) => {
}
setCohetepaperbool = (bool) => {
}
getcontentMdRef = (Ref) => {
this.contentMdRef = Ref;
}
render() {
let {paperlibrartdata} = this.state;
const params = this.props && this.props.match && this.props.match.params;
// //console.log(params);
return (
<div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
>
<style>
{
`
.newFooter{
display: none;
}
`
}
</style>
<div className="w1200ms">
<div className="w100s mt30">
<Breadcrumb separator=">">
<Breadcrumb.Item href="/paperlibrary">试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>公告试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>试卷编辑</Breadcrumb.Item>
</Breadcrumb>
</div>
<Comthetestpaperst {...this.state} {...this.props}
item_banksedit={this.state.item_banksedit}
getJudquestio={(ref) => this.getJudquestio(ref)}
></Comthetestpaperst>
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200wuh mt19">
<Seeoagertits
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>
<Paperlibraryseeid_itemss
{...this.state}
{...this.props}
getdata={() => this.getdata()}
single_questions={paperlibrartdata && paperlibrartdata.single_questions && paperlibrartdata.single_questions.questions.length > 0 ? paperlibrartdata.single_questions : null}
multiple_questions={paperlibrartdata && paperlibrartdata.multiple_questions
&& paperlibrartdata.multiple_questions.questions.length > 0 ? paperlibrartdata.multiple_questions : null
}
judgement_questions={paperlibrartdata && paperlibrartdata.judgement_questions
&& paperlibrartdata.judgement_questions.questions.length > 0 ? paperlibrartdata.judgement_questions : null
}
program_questions={paperlibrartdata && paperlibrartdata.program_questions
&& paperlibrartdata.program_questions.questions.length > 0 ? paperlibrartdata.program_questions : null
}
></Paperlibraryseeid_itemss>
</div>
</div>
</div>
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"保存"}
setCohetepaperbool={(bool) => this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/paperlibrary'}></Bottomsubmit>
</div>
)
}
}
export default SnackbarHOC()(TPMIndexHOC(Paperlibraryeditid));

@ -0,0 +1,185 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb
} from "antd";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import NoneData from './component/NoneData';
import './testioncss/testioncss.css';
import '../tpm/newshixuns/css/Newshixuns.css';
import Bottomsubmit from "../../modules/modals/Bottomsubmit";
import Seeoagertit from "./component/Seeoagertit";
import Paperlibraryseeid_item from './component/Paperlibraryseeid_item';
//人工组卷预览
class Paperlibraryseeid extends Component {
constructor(props) {
super(props);
this.contentMdRef = React.createRef();
this.state = {
paperlibrartdata:[],
}
}
//初始化
componentDidMount() {
console.log("Paperlibraryseeid");
this.getdata();
}
getdata = () => {
let urls = `/examination_banks/${this.props.match.params.id}.json`;
axios.get(urls).then((response) => {
if (response) {
this.setState({
paperlibrartdata: response.data,
})
}
});
}
//跳转道描点的地方
scrollToAnchor = (anchorName) => {
try {
if (anchorName) {
// 找到锚点
let anchorElement = document.getElementById(anchorName);
// 如果对应id的锚点存在就跳转到锚点
if (anchorElement) {
anchorElement.scrollIntoView();
}
}
} catch (e) {
}
}
preservation = () => {
//保存试卷
}
setitem_type = (item_type) => {
}
setCohetepaperbool =(bool)=>{
}
getcontentMdRef = (Ref) => {
this.contentMdRef = Ref;
}
render() {
let {paperlibrartdata} = this.state;
const params = this.props && this.props.match && this.props.match.params;
// //console.log(params);
return (
<div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
>
<style>
{
`
.newFooter{
display: none;
}
`
}
</style>
<div className="w1200ms">
<div className="w100s mt30">
<Breadcrumb separator=">">
<Breadcrumb.Item href="/paperlibrary">试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>公告试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>试卷查看</Breadcrumb.Item>
</Breadcrumb>
</div>
<div className="seesjtit intermediatecenter mt16">
{paperlibrartdata&&paperlibrartdata.exam&&paperlibrartdata.exam.name}
</div>
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200wuh mt19">
<Seeoagertit all_score={paperlibrartdata&&paperlibrartdata.exam&&paperlibrartdata.exam.all_questions_count}
all_questions_count={paperlibrartdata&&paperlibrartdata.exam&&paperlibrartdata.exam.all_score}
>
</Seeoagertit>
<Paperlibraryseeid_item
{...this.state}
{...this.props}
getdata={()=>this.getdata()}
single_questions={paperlibrartdata&&paperlibrartdata.single_questions&&paperlibrartdata.single_questions.questions.length>0?paperlibrartdata.single_questions:null}
multiple_questions={paperlibrartdata&&paperlibrartdata.multiple_questions
&&paperlibrartdata.multiple_questions.questions.length>0?paperlibrartdata.multiple_questions:null
}
judgement_questions={paperlibrartdata&&paperlibrartdata.judgement_questions
&&paperlibrartdata.judgement_questions.questions.length>0?paperlibrartdata.judgement_questions:null
}
program_questions={paperlibrartdata&&paperlibrartdata.program_questions
&&paperlibrartdata.program_questions.questions.length>0?paperlibrartdata.program_questions:null
}
>
</Paperlibraryseeid_item>
</div>
</div>
</div>
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"发起考试"}
setCohetepaperbool={(bool)=>this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/paperlibrary'}></Bottomsubmit>
</div>
)
}
}
export default SnackbarHOC()(TPMIndexHOC(Paperlibraryseeid));

@ -336,6 +336,13 @@ class Testpaperlibrary extends Component {
}) })
}; };
Testpapereditor=(id)=>{
this.props.history.push(`/paperlibrary/edit/${id}`);
}
showmodelysl = (id) => { showmodelysl = (id) => {
this.setState({ this.setState({
modalsType: true, modalsType: true,
@ -400,6 +407,7 @@ class Testpaperlibrary extends Component {
<Contentpart <Contentpart
{...this.props} {...this.props}
{...this.state} {...this.state}
Testpapereditor={(e)=>this.Testpapereditor(e)}
setdifficulty={(e)=>this.setdifficulty(e)} setdifficulty={(e)=>this.setdifficulty(e)}
showmodels={(e)=>this.showmodels(e)} showmodels={(e)=>this.showmodels(e)}
showmodelysl={(e)=>this.showmodelysl(e)} showmodelysl={(e)=>this.showmodelysl(e)}

@ -166,7 +166,6 @@ class Contentpart extends Component {
<div className=" w100s mb10" style={ <div className=" w100s mb10" style={
{ {
position:"relative", position:"relative",
top:" -8px",
} }
}> }>
{ {
@ -197,6 +196,7 @@ class Contentpart extends Component {
: this.props.Contentdata.exams.map((object, index) => { : this.props.Contentdata.exams.map((object, index) => {
return ( return (
<Listjihe {...this.state} {...this.props} items={object} key={index} <Listjihe {...this.state} {...this.props} items={object} key={index}
Testpapereditor={(e)=>this.props.Testpapereditor(e)}
showmodels={(e)=>this.props.showmodels(e)} showmodels={(e)=>this.props.showmodels(e)}
showmodelysl={(e)=>this.props.showmodelysl(e)} showmodelysl={(e)=>this.props.showmodelysl(e)}
> >

@ -57,7 +57,9 @@ class Listjihe extends Component {
} }
gotoseesj=(id)=>{
this.props.history.push(`/paperlibrary/see/${id}`);
}
render() { render() {
@ -72,13 +74,13 @@ class Listjihe extends Component {
const quotess =items&&items.quotes&&items.quotes; const quotess =items&&items.quotes&&items.quotes;
const authors=items&&items.author&&items.author.name; const authors=items&&items.author&&items.author.name;
return ( return (
<div className={" borderwdsst pd20 mb20 intermediatecenter"}> <div className={" borderwdsst pd20 mb20 intermediatecenter listjihecolor "} >
<div className="sortinxdirection w100s"> <div className="sortinxdirection w100s">
<div className="sjimg "> <div className="sjimg ">
<img src={getImageUrl("images/educoder/shijuans.png ")} width={80}/> <img src={getImageUrl("images/educoder/shijuans.png ")} width={80}/>
</div> </div>
<div className="w100s verticallayout ml20" > <div className="w100s verticallayout ml20" >
<div className="w100s"> <p className="sjtitle">{names}</p></div> <div className="w100s " > <p className="sjtitle xiaoshou" onClick={()=>this.gotoseesj(items.id)}>{names}</p></div>
<div className="w100s sortinxdirection mt9"> <div className="w100s sortinxdirection mt9">
<p className="sjtitles">试题数<span >{question_counts}</span></p> <p className="sjtitles">试题数<span >{question_counts}</span></p>
<p className="sjtitles ml48">总分<span >{total_scores}</span></p> <p className="sjtitles ml48">总分<span >{total_scores}</span></p>
@ -108,17 +110,17 @@ class Listjihe extends Component {
{ {
defaultActiveKey===0||defaultActiveKey==="0"? defaultActiveKey===0||defaultActiveKey==="0"?
<div className="w35s xaxisreverseorder"> <div className="w35s xaxisreverseorder">
<p className="viewparsings xiaoshou mr25" onClick={()=>this.props.showmodelysl(items.id)}> <p className="viewparsings xiaoshou mr25 " onClick={()=>this.props.showmodelysl(items.id)}>
<i className="iconfont icon-shanchu1 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i> <i className="iconfont icon-shanchu1 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>删除</span> <span>删除</span>
</p> </p>
<a > <a >
<p className="viewparsings xiaoshou mr25" > <p className="viewparsings xiaoshou mr25 " onClick={()=>this.props.Testpapereditor(items.id)}>
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i> <i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span> <span>编辑</span>
</p> </p>
</a> </a>
<p className="viewparsings xiaoshou mr25" onClick={()=>this.props.showmodels(items.id)} > <p className="viewparsings xiaoshou mr25 " onClick={()=>this.props.showmodels(items.id)} >
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i> <i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开</span> <span>公开</span>
</p> </p>

@ -0,0 +1,634 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, getImageUrl} from 'educoder';
import {DragDropContext, Draggable, Droppable} from 'react-beautiful-dnd';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb
} from "antd";
import '../testioncss/testioncss.css';
import '../../tpm/newshixuns/css/Newshixuns.css';
import Paperlibraryseeid_items from './Paperlibraryseeid_items';
const reorder = (list, startIndex, endIndex) => {
const result = Array.from(list);
const [removed] = result.splice(startIndex, 1);
result.splice(endIndex, 0, removed);
return result;
};
class Paperreview_item extends Component {
constructor(props) {
super(props);
this.state = {
questions: 0,
totalscore: 0,
total: 0,
modalsTypedel: false,
modalsTypey: false,
modalsTypeys: false,
modalsTypedels: false,
titilesm: "",
titilesms: "",
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: false,
paperreviewsingleindex: "无",
set_scoreid:null,
item_bank_id:null
}
}
//初始化
componentDidMount() {
}
preservation = () => {
}
setitem_type = (item_type) => {
}
onDragEnd = (result) => {
const ids = this.props.single_questions.questions[result.source.index].id;
const positions = this.props.single_questions.questions[result.destination.index].position;
const url = `/examination_items/${ids}/adjust_position.json`;
var data = {
position: positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata();
}
}).catch((error) => {
console.log(error);
})
}
onDragEnds = (result) => {
const ids = this.props.multiple_questions.questions[result.source.index].id;
const positions = this.props.multiple_questions.questions[result.destination.index].position;
const url = `/examination_items/${ids}/adjust_position.json`;
var data = {
position: positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata();
}
}).catch((error) => {
console.log(error);
})
}
onDragEndss = (result) => {
const ids = this.props.judgement_questions.questions[result.source.index].id;
const positions = this.props.judgement_questions.questions[result.destination.index].position;
const url = `/examination_items/${ids}/adjust_position.json`;
var data = {
position: positions
}
axios.post(url, data)
.then((result) => {
debugger
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata();
}
}).catch((error) => {
console.log(error);
})
}
onDragEndsss = (result) => {
const ids = this.props.judgement_questions.questions[result.source.index].id;
const positions = this.props.judgement_questions.questions[result.destination.index].position;
const url = `/examination_items/${ids}/adjust_position.json`;
var data = {
position: positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata();
}
}).catch((error) => {
console.log(error);
})
}
Singlemagazine = (name, bool) => {
if (bool === true) {
this.setState({
modalsTypey: true,
titilesm: name
})
} else {
this.setState({
modalsTypey: false,
titilesm: ""
})
}
}
setDownloady = (fenshu) => {
const url = "/item_baskets/batch_set_score.json";
var data = {
score: fenshu,
item_type: this.state.titilesm === "单选题" ? "SINGLE" : this.state.titilesm === "多选题" ? "MULTIPLE" : this.state.titilesm === "判断题" ? "JUDGMENT" : this.state.titilesm === "编程题" ? "PROGRAM" : '',
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`调分成功`);
this.props.getdata({});
this.Singlemagazine("", false);
}
}).catch((error) => {
console.log(error);
})
}
setDownloadys=(value)=>{
const url = `/item_baskets/${this.state.set_scoreid}/set_score.json`;
var data = {
score: value,
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`调分成功`);
this.props.getdata({});
this.Singlemagazines(false);
}
}).catch((error) => {
console.log(error);
})
}
Singlemagazines=(bool,id,name)=>{
if(bool===true){
this.setState({
set_scoreid:id,
modalsTypeys:bool,
titilesm: name
})
}else{
this.setState({
modalsTypeys:bool,
set_scoreid:null,
titilesm: null
})
}
}
hideparagraph = (name) => {
console.log("hideparagraph");
}
hideparagraphs = () => {
this.setState({
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: false,
})
}
showparagraph = (name) => {
console.log("showparagraph");
if (name === "SINGLE") {
this.setState({
singlebool: true,
multiplebool: false,
judgmentbool: false,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
} else if (name === "MULTIPLE") {
this.setState({
singlebool: false,
multiplebool: true,
judgmentbool: false,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
} else if (name === "JUDGMENT") {
this.setState({
singlebool: false,
multiplebool: false,
judgmentbool: true,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
} else if (name === "PROGRAM") {
this.setState({
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: true,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
}
}
jixuxuantioncli = () => {
this.props.history.replace("/question");
}
showparagraphs = (e,name) => {
// console.log("showparagraphs");
// console.log(e);
this.setState({
paperreviewsingleindex: e,
paperreviewsinglename:name,
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: false,
})
}
Setscore=(id)=>{
}
render() {
let {
questions, totalscore, total, modalsTypedel, modalsTypey, modalsTypedels,
singlebool,
multiplebool,
judgmentbool,
programbool,
paperreviewsingleindex,
modalsTypeys
} = this.state;
let {single_questions, multiple_questions, judgement_questions, program_questions, all_score} = this.props;
return (
<div className=" w100s">
<div className="w100s " >
{/*单选题*/}
{
single_questions && single_questions ?
<div className="backgroudwhites" style={{
position: "relative",
}}>
<div className="w100s mt20 mb20 postitonrelati">
<div
className={ "w100s sortinxdirection intermediatecenterysls mb20"}
>
<p className={"yldxtit"}>单选题</p> <p
className="ml15 yldxtits">{single_questions && single_questions.questions_count}{single_questions && single_questions.questions_score}</p>
</div>
<DragDropContext onDragEnd={this.onDragEnd}>
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
single_questions && single_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperlibraryseeid_items
typenames={"SINGLE"}
typenamesn={"单选题"}
key={index}
indexs={index}
indexx={index+1}
indexxy={index}
objectsingle={object}
>
</Paperlibraryseeid_items>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
: ""
}
{
multiple_questions && multiple_questions ?
<div className="backgroudwhites" style={{
position: "relative",
}}>
<div className="w100s mb20 postitonrelati">
<div
className={"w100s sortinxdirection intermediatecenterysls mb20"}
>
<p
className={"yldxtit"}>{single_questions === null ? "一" : "二"}多选题</p>
<p
className="ml15 yldxtits">{multiple_questions && multiple_questions.questions_count}{multiple_questions && multiple_questions.questions_score}</p>
</div>
<DragDropContext onDragEnd={this.onDragEnds}>
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
multiple_questions && multiple_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperlibraryseeid_items
typenames={"MULTIPLE"}
typenamesn={"多选题"}
key={index}
indexs={index}
indexx={index+1}
indexxy={index}
objectsingle={object}
>
</Paperlibraryseeid_items>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
:
""
}
{
judgement_questions && judgement_questions ?
<div className={ "backgroudwhites"} style={{
position: "relative",
}}>
<div className="w100s mb20 postitonrelati">
<div
className={"w100s sortinxdirection intermediatecenterysls mb20 "}
>
<p
className={ "yldxtit"}>{single_questions === null && multiple_questions === null ? "一" : single_questions === null && multiple_questions !== null ? "二"
: single_questions !== null && multiple_questions === null ? "二"
: "三"}判断题</p> <p
className="ml15 yldxtits">{judgement_questions && judgement_questions.questions_count}{judgement_questions && judgement_questions.questions_score}</p>
</div>
<DragDropContext onDragEnd={this.onDragEndss}>
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
judgement_questions && judgement_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperlibraryseeid_items
typenames={"JUDGMENT"}
typenamesn={"判断题"}
key={index}
indexs={index}
indexx={index+1}
indexxy={index}
objectsingle={object}
>
</Paperlibraryseeid_items>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
: ""
}
{
program_questions && program_questions ?
<div className={ "backgroudwhites"} style={{
position: "relative",
}}>
<div className="w100s mb20 postitonrelati">
<div
className={"w100s sortinxdirection intermediatecenterysls mb20"}
>
<p className={ "yldxtit"}>
{single_questions === null && multiple_questions === null && program_questions === null ? "一"
: single_questions === null && multiple_questions === null && program_questions !== null ? "二"
: single_questions !== null && multiple_questions === null && program_questions === null ? "二"
: single_questions === null && multiple_questions !== null && program_questions === null ? "二"
: single_questions !== null && multiple_questions !== null && program_questions === null ? "三"
: single_questions === null && multiple_questions !== null && program_questions !== null ? "三"
: single_questions !== null && multiple_questions == null && program_questions !== null ? "三" :
"四"}
编程题</p> <p
className="ml15 yldxtits">{program_questions && program_questions.questions_count}{program_questions && program_questions.questions_score}</p>
</div>
<DragDropContext onDragEnd={this.onDragEndsss}>
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
program_questions && program_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperlibraryseeid_items
key={index}
indexs={index}
indexx={index+1}
indexxy={index}
typenames={"PROGRAM"}
typenamesn={"编程题"}
objectsingle={object}
>
</Paperlibraryseeid_items>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
:
""
}
</div>
</div>
)
}
}
export default Paperreview_item

@ -0,0 +1,171 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, getImageUrl, markdownToHTML} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb,
Radio
} from "antd";
import '../testioncss/testioncss.css';
import '../../tpm/newshixuns/css/Newshixuns.css';
const tagArray = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
]
//单选题
class Paperlibraryseeid_items extends Component {
constructor(props) {
super(props);
this.state = {
questions: 0,
totalscore: 0,
total: 0,
}
}
//初始化
componentDidMount() {
}
getdata = (data) => {
}
preservation = () => {
}
setitem_type = (item_type) => {
}
showparagraph = (indexx) => {
}
Singlemagaziness = () => {
}
render() {
let {questions, totalscore, total, items} = this.state;
let {objectsingle, indexx, paperreviewsingleindex, indexxy,name} = this.props;
// console.log("objectsingle");
// console.log(objectsingle);
return (
<div key={indexxy}
className={ "w100s borderwdswuh mb20 pd20 "}
style={{
minHeight: "114px",
}}>
{/*顶部*/}
<div className="w100s sortinxdirection ">
<div className=" sortinxdirection ">
<p className="cretitlecolrlis lh28">{indexx}</p>
</div>
<style>
{
`
.markdown-body{
color: #333333;
font-size: 14px !important;
line-height: 28px;
}
.markdown-body p {
color: #333333;
font-size: 14px !important;
line-height: 28px;
}
`
}
</style>
{
this.props.typenames==="PROGRAM"?
<div className=" lh28 listjihetixingstit markdown-body cretitlecolrlist" style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML( objectsingle.name).replace(/▁/g, "▁▁▁")}}>
</div>
:
<div className=" lh28 listjihetixingstit markdown-body cretitlecolrlist" style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML(`${objectsingle.score}分) ` + objectsingle.name).replace(/▁/g, "▁▁▁")}}>
</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}>
{object.choice_text}
</Radio>
</p>
)
})
}
</p>
:
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>
</p>
</p>
:
<p className="w100s listjihetixingstits verticallayout ">
{
objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => {
return (
<p className={index === 0 ? "sortinxdirection" : "sortinxdirection mt15"} key={index}>
{tagArray[index]}
<p style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML(object.choice_text).replace(/▁/g, "▁▁▁")}}></p>
</p>
)
})
}
</p>
}
</div>
</div>
)
}
}
export default Paperlibraryseeid_items

@ -0,0 +1,790 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, getImageUrl} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb
} from "antd";
import '../../question/questioncss/questioncom.css';
import '../../tpm/newshixuns/css/Newshixuns.css';
import {DragDropContext, Draggable, Droppable} from 'react-beautiful-dnd';
import PaperDeletModel from '../../question/component/PaperDeletModel';
import PaperDeletModels from '../../question/component/PaperDeletModels';
import Paperreview_itemModel from '../../question/component/Paperreview_itemModel';
import Paperreview_itemModels from '../../question/component/Paperreview_itemModels';
import Paperlibraryseeid_itemsss from './Paperlibraryseeid_itemsss';
const reorder = (list, startIndex, endIndex) => {
const result = Array.from(list);
const [removed] = result.splice(startIndex, 1);
result.splice(endIndex, 0, removed);
return result;
};
//这不是唯一的 试题库还有 Paperreview_item.js
class Paperlibraryseeid_itemss extends Component {
constructor(props) {
super(props);
this.state = {
questions: 0,
totalscore: 0,
total: 0,
modalsTypedel: false,
modalsTypey: false,
modalsTypeys: false,
modalsTypedels: false,
titilesm: "",
titilesms: "",
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: false,
paperreviewsingleindex: "无",
set_scoreid:null,
item_bank_id:null
}
}
//初始化
componentDidMount() {
}
getdata = (data) => {
}
preservation = () => {
}
setitem_type = (item_type) => {
}
onDragEnd = (result) => {
const ids = this.props.single_questions.questions[result.source.index].id;
const positions = this.props.single_questions.questions[result.destination.index].position;
const url = `/examination_items/${ids}/adjust_position.json`;
var data = {
position: positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
console.log(error);
})
}
onDragEnds = (result) => {
const ids = this.props.multiple_questions.questions[result.source.index].id;
const positions = this.props.multiple_questions.questions[result.destination.index].position;
const url =`/examination_items/${ids}/adjust_position.json`;
var data = {
position: positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
console.log(error);
})
}
onDragEndss = (result) => {
const ids = this.props.judgement_questions.questions[result.source.index].id;
const positions = this.props.judgement_questions.questions[result.destination.index].position;
const url = `/examination_items/${ids}/adjust_position.json`;
var data = {
position: positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
console.log(error);
})
}
onDragEndsss = (result) => {
const ids = this.props.judgement_questions.questions[result.source.index].id;
const positions = this.props.judgement_questions.questions[result.destination.index].position;
const url = `/examination_items/${ids}/adjust_position.json`;
var data = {
position: positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
console.log(error);
})
}
Singlemagazine = (name, bool) => {
if (bool === true) {
this.setState({
modalsTypey: true,
titilesm: name
})
} else {
this.setState({
modalsTypey: false,
titilesm: ""
})
}
}
setDownloady = (fenshu) => {
const url = "/examination_items/batch_set_score.json";
var data = {
exam_id:this.props.match.params.id,
score: fenshu,
item_type: this.state.titilesm === "单选题" ? "SINGLE" : this.state.titilesm === "多选题" ? "MULTIPLE" : this.state.titilesm === "判断题" ? "JUDGMENT" : this.state.titilesm === "编程题" ? "PROGRAM" : '',
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`调分成功`);
this.props.getdata({});
this.Singlemagazine("", false);
}
}).catch((error) => {
console.log(error);
})
}
setDownloadys=(value)=>{
const url = `/examination_items/${this.state.set_scoreid}/set_score.json`;
var data = {
score: value,
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`调分成功`);
this.props.getdata({});
this.Singlemagazines(false);
}
}).catch((error) => {
console.log(error);
})
}
Singlemagazines=(bool,id,name)=>{
if(bool===true){
this.setState({
set_scoreid:id,
modalsTypeys:bool,
titilesm: name
})
}else{
this.setState({
modalsTypeys:bool,
set_scoreid:null,
titilesm: null
})
}
}
setmodalsTypedel = (bool, type, names) => {
if (type === 1) {
this.setState({
modalsTypedel: bool,
titilesms: names
})
} else {
this.setState({
modalsTypedel: bool,
titilesms: names
})
const url = `/examination_items/delete_item_type.json`;
axios.delete((url), {
data: {
exam_id:this.props.match.params.id,
item_type: names
}
})
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification('大题删除成功');
this.props.getdata({});
this.setState({
titilesms: ""
})
}
})
.catch(function (error) {
//console.log(error);
});
}
}
setmodalsTypedels = (bool, type) => {
if (type === 1) {
this.setState({
modalsTypedels: bool,
})
}else {
//确定
const url = `/examination_items/${this.state.item_bank_id}.json`;
axios.delete((url))
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification('试题删除成功');
this.props.getdata({});
}
})
.catch(function (error) {
});
this.setState({
modalsTypedels: bool,
})
}
}
showsetmodalsTypedels=(id,bool,type)=>{
debugger
this.setState({
item_bank_id:id,
})
this.setmodalsTypedels(bool,type);
}
hideparagraph = (name) => {
console.log("hideparagraph");
}
hideparagraphs = () => {
this.setState({
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: false,
})
}
showparagraph = (name) => {
console.log("showparagraph");
if (name === "SINGLE") {
this.setState({
singlebool: true,
multiplebool: false,
judgmentbool: false,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
} else if (name === "MULTIPLE") {
this.setState({
singlebool: false,
multiplebool: true,
judgmentbool: false,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
} else if (name === "JUDGMENT") {
this.setState({
singlebool: false,
multiplebool: false,
judgmentbool: true,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
} else if (name === "PROGRAM") {
this.setState({
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: true,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
}
}
jixuxuantioncli = () => {
this.props.history.replace("/question");
}
showparagraphs = (e,name) => {
// console.log("showparagraphs");
// console.log(e);
this.setState({
paperreviewsingleindex: e,
paperreviewsinglename:name,
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: false,
})
}
Setscore=(id)=>{
}
render() {
let {
questions, totalscore, total, modalsTypedel, modalsTypey, modalsTypedels,
singlebool,
multiplebool,
judgmentbool,
programbool,
paperreviewsingleindex,
modalsTypeys
} = this.state;
let {single_questions, multiple_questions, judgement_questions, program_questions, all_score} = this.props;
return (
<div className=" w100s ">
{
modalsTypedel === true ?
<PaperDeletModel {...this.state} {...this.props}
setmodalsTypedel={(bool, type, name) => this.setmodalsTypedel(bool, type, name)}></PaperDeletModel>
: ""
}
{
modalsTypey === true ?
<Paperreview_itemModel {...this.state} {...this.props} setDownloady={(fs) => this.setDownloady(fs)}
Singlemagazine={(name, bool) => this.Singlemagazine(name, bool)}></Paperreview_itemModel>
: ""
}
{
modalsTypeys === true ?
<Paperreview_itemModels {...this.state} {...this.props} setDownloadys={(value) => this.setDownloadys(value)}
Singlemagazines={(bool,id,name) => this.Singlemagazines(bool,id,name)}></Paperreview_itemModels>
: ""
}
{
modalsTypedels === true ?
<PaperDeletModels {...this.state} {...this.props}
setmodalsTypedels={(id,bool, type) => this.setmodalsTypedels(id,bool, type)}></PaperDeletModels>
: ""
}
<div className="w100s mt20 mb20 backgroudwhites" style={{
position: "relative",
}}>
{/*单选题*/}
{
single_questions && single_questions ?
<div className="backgroudwhites" style={{
position: "relative",
}}>
<div className="w100s mt20 mb20 postitonrelati">
<div
className={singlebool === true ? "w100s sortinxdirection borderwdswuhques intermediatecenterysls" : "w100s sortinxdirection intermediatecenterysls"}
onMouseEnter={() => this.showparagraph("SINGLE")} onMouseLeave={() => this.hideparagraph("SINGLE")}>
<p className={singlebool === true ? "ml18 yldxtit" : "yldxtit"}>单选题</p> <p
className="ml15 yldxtits">{single_questions && single_questions.questions_count}{single_questions && single_questions.questions_score}</p>
</div>
{
singlebool === true ?
<div className="postitonrelatiss xaxisreverseorder">
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "SINGLE")}>删除</div>
<div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("单选题", true)}>批量设置得分</div>
</div> : ""
}
<DragDropContext onDragEnd={this.onDragEnd}>
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
single_questions && single_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperlibraryseeid_itemsss
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
indexs={index}
typenames={"SINGLE"}
typenamesn={"单选题"}
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
showparagraphs={(e,name) => this.showparagraphs(e,name)}
object={object}
hideparagraphs={() => this.hideparagraphs()}
>
</Paperlibraryseeid_itemsss>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
: ""
}
{
multiple_questions && multiple_questions ?
<div className="backgroudwhites" style={{
position: "relative",
}}>
<div className="h20 lh20"></div>
<div className="w100s mb20 postitonrelati">
<div
className={multiplebool === true ? "w100s sortinxdirection mt10 borderwdswuhques intermediatecenterysls" : "w100s sortinxdirection intermediatecenterysls"}
onMouseEnter={() => this.showparagraph("MULTIPLE")}
onMouseLeave={() => this.hideparagraph("MULTIPLE")}>
<p
className={multiplebool === true ? "ml18 yldxtit" : "yldxtit"}>{single_questions === null ? "一" : "二"}多选题</p>
<p
className="ml15 yldxtits">{multiple_questions && multiple_questions.questions_count}{multiple_questions && multiple_questions.questions_score}</p>
</div>
{
multiplebool === true ?
<div className="postitonrelatisss xaxisreverseorder ">
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "MULTIPLE")}>删除
</div>
<div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("多选题", true)}>批量设置得分</div>
</div>
: ""
}
<DragDropContext onDragEnd={this.onDragEnds}>
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
multiple_questions && multiple_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperlibraryseeid_itemsss
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
indexs={index}
typenames={"MULTIPLE"}
typenamesn={"多选题"}
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
showparagraphs={(e,name) => this.showparagraphs(e,name)}
object={object}
hideparagraphs={() => this.hideparagraphs()}
>
</Paperlibraryseeid_itemsss>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
:
""
}
{
judgement_questions && judgement_questions ?
<div className={judgmentbool === true ? "backgroudwhites " : "backgroudwhites"} style={{
position: "relative",
}}>
<div className="h20 lh20"></div>
<div className="w100s mb20 postitonrelati">
<div
className={judgmentbool === true ? "w100s sortinxdirection borderwdswuhques mt10 intermediatecenterysls " : "w100s sortinxdirection intermediatecenterysls "}
onMouseEnter={() => this.showparagraph("JUDGMENT")}
onMouseLeave={() => this.hideparagraph("JUDGMENT")}>
<p
className={judgmentbool === true ? "ml18 yldxtit" : "yldxtit"}>{single_questions === null && multiple_questions === null ? "一" : single_questions === null && multiple_questions !== null ? "二"
: single_questions !== null && multiple_questions === null ? "二"
: "三"}判断题</p> <p
className="ml15 yldxtits">{judgement_questions && judgement_questions.questions_count}{judgement_questions && judgement_questions.questions_score}</p>
</div>
{
judgmentbool === true ?
<div className="postitonrelatiss xaxisreverseorder">
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "JUDGMENT")}>删除
</div>
<div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("判断题", true)}>批量设置得分</div>
</div>
: ""}
<DragDropContext onDragEnd={this.onDragEndss}>
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
judgement_questions && judgement_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperlibraryseeid_itemsss
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
indexs={index}
typenames={"JUDGMENT"}
typenamesn={"判断题"}
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
showparagraphs={(e,name) => this.showparagraphs(e,name)}
object={object}
hideparagraphs={() => this.hideparagraphs()}
>
</Paperlibraryseeid_itemsss>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
: ""
}
{
program_questions && program_questions ?
<div className={programbool === true ? "backgroudwhites " : "backgroudwhites"} style={{
position: "relative",
}}>
<div className="h20 lh20"></div>
<div className="w100s mb20 postitonrelati">
<div
className={programbool === true ? "w100s sortinxdirection mt10 borderwdswuhques intermediatecenterysls " : "w100s sortinxdirection intermediatecenterysls"}
onMouseEnter={() => this.showparagraph("PROGRAM")}
onMouseLeave={() => this.hideparagraph("PROGRAM")}>
<p className={programbool === true ? "ml18 yldxtit" : "yldxtit"}>
{single_questions === null && multiple_questions === null && program_questions === null ? "一"
: single_questions === null && multiple_questions === null && program_questions !== null ? "二"
: single_questions !== null && multiple_questions === null && program_questions === null ? "二"
: single_questions === null && multiple_questions !== null && program_questions === null ? "二"
: single_questions !== null && multiple_questions !== null && program_questions === null ? "三"
: single_questions === null && multiple_questions !== null && program_questions !== null ? "三"
: single_questions !== null && multiple_questions == null && program_questions !== null ? "三" :
"四"}
编程题</p> <p
className="ml15 yldxtits">{program_questions && program_questions.questions_count}{program_questions && program_questions.questions_score}</p>
</div>
{
programbool === true ?
<div className="postitonrelatiss xaxisreverseorder">
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "PROGRAM")}>删除</div>
<div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("编程题", true)}>批量设置得分</div>
</div>
: ""
}
<DragDropContext onDragEnd={this.onDragEndsss}>
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
program_questions && program_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperlibraryseeid_itemsss
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
indexs={index}
typenames={"PROGRAM"}
typenamesn={"编程题"}
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
showparagraphs={(e,name) => this.showparagraphs(e,name)}
object={object}
hideparagraphs={() => this.hideparagraphs()}
>
</Paperlibraryseeid_itemsss>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
:
""
}
</div>
</div>
)
}
}
export default Paperlibraryseeid_itemss

@ -0,0 +1,88 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, getImageUrl,markdownToHTML} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb
} from "antd";
import '../../question/questioncss/questioncom.css';
import '../../tpm/newshixuns/css/Newshixuns.css';
import Paperreview_single from "../../question/Paperreview_single";
//判断题
//这不是唯一的 试题库还有Paperreview_items
class Paperlibraryseeid_itemsss extends Component {
constructor(props) {
super(props);
this.state = {
}
}
//初始化
componentDidMount() {
}
getdata = (data) => {
}
preservation = () => {
}
setitem_type = (item_type) => {
}
render() {
let {paperreviewsingleindex,paperreviewsinglename,typenames,indexs,object,typenamesn}=this.props;
return (
<div>
{
paperreviewsingleindex===indexs&&paperreviewsinglename===typenames?
<div className="xaxisreverseorder mt25 mr2">
<div className="scd xiaoshou" onClick={()=>this.props.showsetmodalsTypedels(object.id,true,1)}>删除</div>
<div className="szdfd xiaoshou" onClick={()=>this.props.Singlemagazines(true,object.id,typenamesn)}>设置得分</div>
</div>
: <div className="xaxisreverseorder mt25 ">
</div>
}
<Paperreview_single paperreviewsingleindex={paperreviewsingleindex}
name={typenames}
key={indexs}
showparagraphs={(e,name) => this.props.showparagraphs(e,name)}
objectsingle={object} key={indexs} indexx={indexs + 1}
indexxy={indexs}
hideparagraphs={() => this.props.hideparagraphs()}></Paperreview_single>
</div>
)
}
}
export default Paperlibraryseeid_itemsss

@ -0,0 +1,56 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Radio,
Checkbox
} from "antd";
import './../testioncss/testioncss.css';
class Seeoagertit extends Component {
constructor(props) {
super(props);
this.state = {
page:1,
}
}
//初始化
componentDidMount(){
}
onChange=(e)=> {
}
render() {
return (
<div className="w100s mt20 mb20 backgroudwhites" style={{
position: "relative",
}}>
<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>
</div>
</div>
<div className="questiontypeheng w100s mt19 mb19"></div>
<div className="w100s sortinxdirection">
<div className="pagertdstcolor w50s sortinxdirection">拖动试题可调整排序</div>
</div>
</div>
)
}
}
export default Seeoagertit ;

@ -0,0 +1,70 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Radio,
Checkbox
} from "antd";
import './../testioncss/testioncss.css';
class Seeoagertit extends Component {
constructor(props) {
super(props);
this.state = {
page:1,
}
}
//初始化
componentDidMount(){
}
onChange=(e)=> {
}
jixuxuantioncli = () => {
this.props.history.replace("/question");
}
render() {
return (
<div className="w100s mt20 mb20 backgroudwhites" style={{
position: "relative",
}}>
<div className="w100s sortinxdirection">
<div className="w70s sortinxdirection">
<p className="questionstishu lh34">题数{this.props.all_score}</p>
<p className="ml58 questionstishu lh34">总分<span className="questionstotal">{this.props.all_questions_count}</span></p>
<p className="ml58 questionstishu lh34">难度<span className="questionstotal">
{this.props.difficulty===undefined?"":
this.props.difficulty===1?"简单":this.props.difficulty===2?"适中":this.props.difficulty===3?"困难":""
}
</span></p>
</div>
<div className="w30s xaxisreverseorder">
<div className="jixuxuanti xiaoshou" onClick={() => this.jixuxuantioncli()}>
继续选题
</div>
</div>
</div>
<div className="questiontypeheng w100s mt19 mb19"></div>
<div className="w100s sortinxdirection">
<div className="pagertdstcolor w50s sortinxdirection">拖动试题可调整排序</div>
</div>
</div>
)
}
}
export default Seeoagertit ;

@ -405,6 +405,9 @@
.xiaoshout{ .xiaoshout{
cursor:default; cursor:default;
} }
.shubiao{
cursor:default;
}
.mt40{ .mt40{
margin-top: 40px; margin-top: 40px;
} }
@ -843,3 +846,28 @@
.ml37{ .ml37{
margin-left: 37px; margin-left: 37px;
} }
.listjihecolor:hover{
background: #F9F9F9;
background-color: #F9F9F9;
}
.seesjtit{
height:27px;
font-size:19px;
color:#333333;
line-height:27px;
}
.mt16{
margin-top: 16px;
}
.mb20{
margin-bottom: 20px;
}
.fudonxianshi{
position: relative;
}
.fudonxianshis{
position:absolute;
z-index: 700;
}

@ -1039,17 +1039,17 @@ submittojoinclass=(value)=>{
` `
} }
</style> </style>
<li className={`pr `}> {/*<li className={`pr `}>*/}
<Popover placement="bottom" content={contents} trigger="click" > {/* <Popover placement="bottom" content={contents} trigger="click" >*/}
<div className=" sortinxdirection mr10"> {/* <div className=" sortinxdirection mr10">*/}
<div style={{ {/* <div style={{*/}
color:"#fff" {/* color:"#fff"*/}
}}> {/* }}>*/}
题库 {/* 题库*/}
</div> {/* </div>*/}
</div> {/* </div>*/}
</Popover> {/* </Popover>*/}
</li> {/*</li>*/}

@ -35,14 +35,14 @@ if (!window['indexHOCLoaded']) {
// $('head').append($('<link rel="stylesheet" type="text/css" />') // $('head').append($('<link rel="stylesheet" type="text/css" />')
// .attr('href', `${_url_origin}/stylesheets/educoder/antd.min.css?1525440977`)); // .attr('href', `${_url_origin}/stylesheets/educoder/antd.min.css?1525440977`));
$('head').append($('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-common.css?2020`)); .attr('href', `${_url_origin}/stylesheets/css/edu-common.css?2021`));
$('head').append($('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?2020`)); .attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?2021`));
// index.html有加载 // index.html有加载
$('head').append($('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?2020`)); .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?2021`));
// $('head').append($('<link rel="stylesheet" type="text/css" />') // $('head').append($('<link rel="stylesheet" type="text/css" />')

@ -115,8 +115,6 @@ shixunsearchAll = (e) => {
//选择Tab页详情 //选择Tab页详情
getshixunchildValue = (e) => { getshixunchildValue = (e) => {
debugger
let id = e.target.name; let id = e.target.name;
let newid=e.target.id; let newid=e.target.id;
let list=[{'tag_level':2},{'tag_id':id}]; let list=[{'tag_level':2},{'tag_id':id}];
@ -239,7 +237,7 @@ render() {
{ {
shixunhoverData.map((item,key)=>{ shixunhoverData.map((item,key)=>{
return( return(
<Dropdown overlay={overlaymenu(item.sub_repertoires,item.id)} key={key} > <Dropdown overlay={overlaymenu(item.sub_repertoires,item.id)} key={key} placement= {item.id<4?"bottomRight":item.id>=8?"bottomLeft":"bottomCenter"}>
<li key={key} className={parseInt(shixunsearchAllvalue)===item.id?"shaiItem shixun_repertoire active":"shaiItem shixun_repertoire"} value={item.id} onClick={this.shixunsearchAll}> <li key={key} className={parseInt(shixunsearchAllvalue)===item.id?"shaiItem shixun_repertoire active":"shaiItem shixun_repertoire"} value={item.id} onClick={this.shixunsearchAll}>
{item.name} {item.name}
</li> </li>

@ -178,7 +178,7 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
.user_navlist_white a:hover{color: #4cacff} .user_navlist_white a:hover{color: #4cacff}
.headIcon{height: 100%;box-sizing: border-box; margin: 0px!important;} .headIcon{height: 100%;box-sizing: border-box; margin: 0px!important;}
.black_nav_list{padding: 4px 0px;box-sizing: border-box;height: 100%;} .black_nav_list{padding: 4px 0px;box-sizing: border-box;height: 100%;}
.black_nav_list li{line-height: 42px;height: 42px;color: #fff;cursor: pointer;} .black_nav_list li{line-height: 40px;height: 40px;color: #fff;cursor: pointer;}
.black_nav_span{display: block;margin:0px 20px;border-bottom: 1px solid #4B4B4B;padding-left: 8px;color: #FAFAFA} .black_nav_span{display: block;margin:0px 20px;border-bottom: 1px solid #4B4B4B;padding-left: 8px;color: #FAFAFA}
.welcome_shixun_index:last-child .black_nav_span{border-bottom: none} .welcome_shixun_index:last-child .black_nav_span{border-bottom: none}
.black_nav_list li:hover{background: #fff;} .black_nav_list li:hover{background: #fff;}

Loading…
Cancel
Save