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

video_transcode
cxt 5 years ago
commit be53d2b9fc

@ -2,7 +2,7 @@ class Schools::SchoolStatisticService < ApplicationService
attr_reader :school
def initialize(school)
@school = school.includes(:courses, user_extensions: :user)
@school = school
@user_extensions = school.user_extensions
end
@ -26,14 +26,14 @@ class Schools::SchoolStatisticService < ApplicationService
@user_extensions.map{|ue| ue.user.last_login_on&.between?(1.weeks.ago, Time.now)}.size
end
# 活跃用户(近3个月有登录)
# 活跃用户(近1个月有登录)
def acitve_user_1_months_count
@user_extensions.map{|ue| ue.user.last_login_on&.between?(1.months.ago, Time.now)}.size
@user_extensions.joins(:user).map{|ue| ue.user.last_login_on&.between?(1.months.ago, Time.now)}.size
end
# 活跃用户近3个月有登录
def acitve_user_3_months_count
@user_extensions.map{|ue| ue.user.last_login_on&.between?(3.months.ago, Time.now)}.size
@user_extensions.map{|ue| ue.user&.last_login_on&.between?(3.months.ago, Time.now)}.size
end
# 活跃用户(进半年有登录记录)
@ -52,10 +52,15 @@ class Schools::SchoolStatisticService < ApplicationService
end
# 实训作业数目
def hom_shixuns_count
def homw_shixuns_count
@school.courses.joins(:homework_commons).where(homework_commons: {homework_type: 'practice'}).size
end
# 其他类型作业
def homw_other_count
@school.courses.joins(:homework_commons).where.not(homework_commons: {homework_type: 'practice'}).size
end
# 资源数
def sources_count
@school.courses.joins(:attachments).size
@ -67,7 +72,7 @@ class Schools::SchoolStatisticService < ApplicationService
end
# 制作实训数
def shixun_count
def shixuns_count
@user_extensions.joins(user: :shixuns).size
end
@ -83,17 +88,17 @@ class Schools::SchoolStatisticService < ApplicationService
# 挑战的关卡数
def games_count
@user_extensions.joins("join games on games.user_id = user_extensions.user_id").where(games: {status: 0..2})
@user_extensions.joins("join games on games.user_id = user_extensions.user_id").where(games: {status: 0..2}).size
end
# 通关的关卡数
def pass_games_count
@user_extensions.joins("join games on games.user_id = user_extensions.user_id").where(games: {status: 2})
@user_extensions.joins("join games on games.user_id = user_extensions.user_id").where(games: {status: 2}).size
end
# 评测总数
def evalute_count
@user_extensions.joins("join games on games.user_id = user_extensions.user_id").sum(:evalute_count)
def evaluate_count
@user_extensions.joins("join games on games.user_id = user_extensions.user_id").sum(:evaluate_count).to_i
end

@ -0,0 +1,5 @@
class AddIndexForStaAll < ActiveRecord::Migration[5.2]
def change
add_index :sta_alls, :school_id, :unique => true
end
end

@ -1,8 +0,0 @@
#coding=utf-8
desc "同步高校数据"
namespace :school_statistic do
task sync_records: :environment do
end
end

@ -2,15 +2,23 @@ desc "统计每个学校使用数据"
namespace :static_all do
task :repo => :environment do
School.find_each(batch_size: 100) do |school|
User.joins(:user_extension).where(school_id: school.id)
report = StaAll.find_or_initialize_by(school_id: school.id)
report.shixun_evaluate_count = evaluate_count
report.save
school_alls = School.includes(:courses, user_extensions: :user).all
school_alls.find_in_batches(batch_size: 50) do |schools|
Parallel.each(schools, in_processes: 5) do |school|
puts("school_id: #{school.id}")
data = Schools::SchoolStatisticService.new(school)
sta_all = StaAll.find_or_initialize_by(school_id: school.id)
attrs = {tea_count: data.teacher_count, stu_count: data.student_count, courses_count: data.courses_count,
active_users_count: data.acitve_user_3_months_count, curr_courses_count: data.curr_courses_count,
homw_shixuns_count: data.homw_shixuns_count, homw_other_count: data.homw_other_count,
sources_count: data.sources_count, videos_count: data.videos_count, shixuns_count: data.shixuns_count,
myshixuns_count: data.myshixuns_count, mys_passed_count: data.pass_myshixun_count,
games_count: data.games_count, games_passed_count: data.pass_games_count, build_count: data.evaluate_count}
puts "sta_all: #{attrs}"
sta_all.assign_attributes(attrs)
sta_all.save!
end
end
end
end

@ -793,37 +793,37 @@ class App extends Component {
render={
(props) => (<Paperreview {...this.props} {...props} {...this.state} />)
}/>
{/*<Route path="/paperlibrary/edit/:id"*/}
{/* render={*/}
{/* (props) => (<Paperlibraryeditid {...this.props} {...props} {...this.state} />)*/}
{/* }/>*/}
<Route path="/paperlibrary/edit/:id"
render={
(props) => (<Paperlibraryeditid {...this.props} {...props} {...this.state} />)
}/>
{/*<Route path="/paperlibrary/see/:id"*/}
{/* render={*/}
{/* (props) => (<Paperlibraryseeid {...this.props} {...props} {...this.state} />)*/}
{/* }/>*/}
<Route path="/paperlibrary/see/:id"
render={
(props) => (<Paperlibraryseeid {...this.props} {...props} {...this.state} />)
}/>
<Route path="/myproblems/:id/:tab?"
render={
(props) => (<StudentStudy {...this.props} {...props} {...this.state} />)
} />
{/*<Route path="/question/edit/:id"*/}
{/* render={*/}
{/* (props) => (<Questionitem_banks {...this.props} {...props} {...this.state} />)*/}
{/* } />*/}
<Route path="/question/edit/:id"
render={
(props) => (<Questionitem_banks {...this.props} {...props} {...this.state} />)
} />
{/*<Route path="/question/newitem"*/}
{/* render={*/}
{/* (props) => (<Questionitem_banks {...this.props} {...props} {...this.state} />)*/}
{/* } />*/}
{/*<Route path="/question/:type"*/}
{/* render={*/}
{/* (props) => (<Headplugselection {...this.props} {...props} {...this.state} />)*/}
{/* } />*/}
{/*<Route path="/paperlibrary"*/}
{/* render={*/}
{/* (props) => (<Testpaperlibrary {...this.props} {...props} {...this.state} />)*/}
{/* }/>*/}
<Route path="/question/newitem"
render={
(props) => (<Questionitem_banks {...this.props} {...props} {...this.state} />)
} />
<Route path="/question/:type"
render={
(props) => (<Headplugselection {...this.props} {...props} {...this.state} />)
} />
<Route path="/paperlibrary"
render={
(props) => (<Testpaperlibrary {...this.props} {...props} {...this.state} />)
}/>
<Route path="/Integeneration"
render={
@ -835,19 +835,15 @@ class App extends Component {
(props) => (<Developer {...this.props} {...props} {...this.state} />)
}/>
{/*<Route path="/question"*/}
{/* render={*/}
{/* (props) => (<Headplugselection {...this.props} {...props} {...this.state} />)*/}
{/* }/>*/}
<Route path="/question"
render={
(props) => (<Headplugselection {...this.props} {...props} {...this.state} />)
}/>
{/*<Route path="/wxcode/:identifier?" component={WXCode}*/}
{/* render={*/}
{/* (props)=>(<WXCode {...this.props} {...props} {...this.state}></WXCode>)*/}
{/* }*/}
{/*/>*/}
<Route exact path="/"
// component={ShixunsHome}
render={

@ -258,16 +258,10 @@ export function initAxiosInterceptors(props) {
}
//
// console.log(config);
if (config.method === "post") {
if (requestMap[config.url] === true) { // 避免重复的请求 导致页面f5刷新 也会被阻止 显示这个方法会影响到定制信息
// console.log(config);
// console.log(JSON.parse(config));
// console.log(config.url);
// console.log("被阻止了是重复请求=================================");
if (requestMap[config.url] === true) {
return false;
}
}
// 非file_update请求
// // 非file_update请求
if (config.url.indexOf('update_file') === -1) {
requestMap[config.url] = true;

@ -0,0 +1,66 @@
@charset "utf-8";
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimSun]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimSun]::before {
content: "宋体";
font-family:SimSun !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimHei]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimHei]::before {
content: "黑体";
font-family:SimHei !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Microsoft-YaHei]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Microsoft-YaHei]::before {
content: "微软雅黑";
font-family:Microsoft YaHei !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=KaiTi]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=KaiTi]::before {
content: "楷体";
font-family:KaiTi !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=FangSong]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=FangSong]::before {
content: "仿宋";
font-family:FangSong !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Arial]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Arial]::before {
content: "Arial";
font-family:Arial !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Times-New-Roman]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Times-New-Roman]::before {
content: "Times New Roman";
font-family:Times New Roman !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=sans-serif]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=sans-serif]::before {
content: "sans-serif";
font-family:sans-serif !important;
}
.ql-font-SimSun {
font-family:SimSun !important;
}
.ql-font-SimHei {
font-family:SimHei !important;
}
.ql-font-Microsoft-YaHei {
font-family:Microsoft YaHei !important;
}
.ql-font-KaiTi {
font-family:KaiTi !important;
}
.ql-font-FangSong {
font-family:FangSong !important;
}
.ql-font-Arial {
font-family:Arial !important;
}
.ql-font-Times-New-Roman {
font-family:Times New Roman !important;
}
.ql-font-sans-serif {
font-family:sans-serif !important;
}

@ -11,6 +11,7 @@ import 'quill/dist/quill.core.css'; // 核心样式
import 'quill/dist/quill.snow.css'; // 有工具栏
import 'quill/dist/quill.bubble.css'; // 无工具栏
import 'katex/dist/katex.min.css'; // katex 表达式样式
import './font.css'
import React, { useState, useRef, useEffect } from 'react';
import Quill from 'quill';
import katex from 'katex';
@ -19,12 +20,12 @@ import { fetchUploadImage } from '../../services/ojService.js';
import { getImageUrl } from 'educoder'
import ImageBlot from './ImageBlot';
import FillBlot from './FillBlot';
const Size = Quill.import('attributors/style/size');
const Font = Quill.import('formats/font');
var Size = Quill.import('attributors/style/size');
// const Color = Quill.import('attributes/style/color');
Size.whitelist = ['14px', '16px', '18px', '20px', false];
Font.whitelist = ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif'];
var fonts = ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong'];
var Font = Quill.import('formats/font');
Font.whitelist = fonts; //将字体加入到白名单
window.Quill = Quill;
window.katex = katex;
Quill.register(ImageBlot);
@ -59,7 +60,7 @@ function QuillForEditor ({
{align: []}, {list: 'ordered'}, {list: 'bullet'}, // 列表
{script: 'sub'}, {script: 'super'},
{ 'color': [] }, { 'background': [] },
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']},
{ 'font': []},
{header: [1,2,3,4,5,false]},
'blockquote', 'code-block',
'link', 'image', 'video',

@ -0,0 +1,18 @@
.ql-editor .ql-font-Microsoft-YaHei {
font-family: "Microsoft YaHei";
}
.ql-editor .ql-font-SimSun {
font-family: "SimSun";
}
.ql-editor .ql-font-SimHei {
font-family: "SimHei";
}
.ql-editor .ql-font-KaiTi {
font-family: "KaiTi";
}
.ql-editor .ql-font-Arial {
font-family: "Arial";
}
.ql-editor .Times-New-Roman {
font-family: "Times New Roman";
}

@ -0,0 +1,28 @@
.ql-snow .ql-picker.ql-font .ql-picker-label::before,
.ql-snow .ql-picker.ql-font .ql-picker-item::before {
content: '微软雅黑';
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Microsoft-YaHei]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Microsoft-YaHei]::before {
content: "微软雅黑";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimSun]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimSun]::before {
content: "宋体";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimHei]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimHei]::before {
content: "黑体";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=KaiTi]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=KaiTi]::before {
content: "楷体";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Arial]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Arial]::before {
content: "Arial";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Times-New-Roman]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Times-New-Roman]::before {
content: "Times New Roman";
}

@ -48,6 +48,17 @@ function StudentStudy (props) {
// 保存当前的id
saveUserProgramIdentifier(id);
// startProgramQuestion(id);
// console.log("getUserProgramDetail(id)");
// console.log(id);
// console.log(id.charAt(id.length-1));
try {
if(id.charAt(id.length-1)==="?"){
id = id.substring(0, id.length - 1);
}
}catch (e) {
}
getUserProgramDetail(id);
const $searchs = window.location.search && window.location.search.substring(1);
if ($searchs) {

@ -23,6 +23,7 @@ import Bottomsubmit from "../modals/Bottomsubmit";
import QuestionModalys from "./component/QuestionModalys";
//exam_id 试卷的id
var Undoclickable=true;
class NewMyShixunModel extends Component {
constructor(props) {
super(props);
@ -162,11 +163,32 @@ class NewMyShixunModel extends Component {
//初始化
componentDidMount() {
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
let isysladmins=false;
let is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
let {defaultActiveKey} = this.props;
var defaultActiveKeys=defaultActiveKey;
try {
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
if(is_teacher===false){
if(this.props.current_user.user_identity !=="学生"){
//专业人士
is_teacher=true
}
}
}catch (e) {
}
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
defaultActiveKeys="0"
}else{
@ -206,12 +228,33 @@ class NewMyShixunModel extends Component {
componentDidUpdate(prevProps) {
if(prevProps.current_user !== this.props.current_user) {
debugger
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
let isysladmins=false;
let is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
let {defaultActiveKey} = this.props;
var defaultActiveKeys=defaultActiveKey;
try {
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
if(is_teacher===false){
if(this.props.current_user.user_identity !=="学生"){
//专业人士
is_teacher=true
}
}
}catch (e) {
}
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
defaultActiveKeys="0"
}else{
@ -219,6 +262,12 @@ class NewMyShixunModel extends Component {
}
this.callback(defaultActiveKeys);
}
if(prevProps.Contentdata !== this.props.Contentdata){
this.setState({
Contentdata:this.props.Contentdata,
})
}
}
//公共和我的
@ -719,58 +768,79 @@ class NewMyShixunModel extends Component {
}
// 撤销
getitem_basketss=(id)=>{
let url="";
if(this.props.exam_id===undefined){
url=`/item_baskets/${id}.json`;
if(Undoclickable===true) {
Undoclickable = false;
url = `/item_baskets/${id}.json`;
axios.delete(url)
.then((result) => {
if (result.data.status == 0) {
// this.props.showNotification(`撤销成功`);
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keyword: this.state.keywords,
page: this.state.page,
per_page:10,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
per_page: 10,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdatasy(data);
this.getbasket_listdata();
}
setTimeout(()=>{
Undoclickable=true;
},1000);
}).catch((error) => {
////console.log(error);
setTimeout(()=>{
Undoclickable=true;
},1000);
})
}
}else{
url=`/examination_banks/${this.props.exam_id}/revoke_item.json`;
axios.delete(url,{ data: {
item_id:id===undefined?"":parseInt(id),
}})
if(Undoclickable===true) {
Undoclickable = false;
url = `/examination_banks/${this.props.exam_id}/revoke_item.json`;
axios.delete(url, {
data: {
item_id: id === undefined ? "" : parseInt(id),
}
})
.then((result) => {
if (result.data.status == 0) {
// this.props.showNotification(`撤销成功`);
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keyword: this.state.keywords,
page: this.state.page,
per_page:10,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
per_page: 10,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdatasy(data);
this.getbasket_listdata();
}
setTimeout(()=>{
Undoclickable=true;
},1000);
}).catch((error) => {
////console.log(error);
setTimeout(()=>{
Undoclickable=true;
},1000);
})
}
}
}
@ -884,7 +954,7 @@ class NewMyShixunModel extends Component {
page, per_page, items_count, Headertop, visible, placement, modalsType, modalsTypes,basket_list,
completion_questions_count, judgement_questions_count, multiple_questions_count, practical_questions_count,
program_questions_count, single_questions_count, subjective_questions_count,selectionbools,
modalsTypeInaudit
modalsTypeInaudit,Contentdata
} = this.state;
const Datacount = completion_questions_count + judgement_questions_count
@ -893,6 +963,8 @@ class NewMyShixunModel extends Component {
+ single_questions_count
+ subjective_questions_count;
// console.log("弹出框");
// console.log(Contentdata)
return (
<div className="newMain clearfix " ref={this.saveContainer}>
@ -962,6 +1034,7 @@ class NewMyShixunModel extends Component {
/>
{/*头部*/}
<Contentpart {...this.state} {...this.props}
Contentdata={Contentdata}
exam_id={this.props.exam_id}
Isitapopup={"true"}
chakanjiexiboolindex={this.state.chakanjiexiboolindex}

@ -27,6 +27,7 @@ import Comthetestpaperst from "./comthetestpaper/Comthetestpaperst";
import NewMyShixunModel from "../question/NewMyShixunModel";
import IntelligentModel from "../question/component/IntelligentModel"
//人工组卷预览
let Changes=true;
class Paperreview extends Component {
constructor(props) {
super(props);
@ -331,6 +332,8 @@ class Paperreview extends Component {
}
//换题
Changingtopics=(id)=>{
if(Changes===true){
Changes=false;
const url=`/examination_intelligent_settings/${this.props.match.params.id}/exchange_one_item.json`;
let data={
item_id:id,
@ -342,11 +345,19 @@ class Paperreview extends Component {
var data = {}
this.getdata(data);
}
setTimeout(()=>{
Changes=true;
},1000);
}).catch((error) => {
//console.log(error);
setTimeout(()=>{
Changes=true;
},1000);
})
}
}
setIntelligentformation=(bool)=>{
this.setState({
Intelligentformation:bool
@ -384,7 +395,7 @@ class Paperreview extends Component {
{
newmyshixunmodelbool===true?
<div className="fangdatwo">
<NewMyShixunModel {...this.props} {...this.state} exam_id={this.props.match.params.id} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}></NewMyShixunModel>
<NewMyShixunModel {...this.props} {...this.state} Contentdata={this.state.Contentdata} exam_id={this.props.match.params.id} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}></NewMyShixunModel>
</div>
:
""
@ -427,11 +438,12 @@ class Paperreview extends Component {
{
Cohetepaperbool===false?
<Paperreview_item {...this.state} {...this.props} Changingtopics={(e)=>this.Changingtopics(e)} Replacementtype={(e)=>this.Replacementtype(e)} getdata={(data)=>this.getdata(data)} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}>
<Paperreview_item {...this.state} {...this.props} artificialtype={artificialtype} Changingtopics={(e)=>this.Changingtopics(e)} Replacementtype={(e)=>this.Replacementtype(e)} getdata={(data)=>this.getdata(data)} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}>
</Paperreview_item>
:
<Comthetestpaperst {...this.state} {...this.props}
getJudquestio={(ref) => this.getcontentMdRef(ref)}
setitem_type={(item) => this.setitem_type(item)}

@ -85,9 +85,17 @@ class Paperreview_item extends Component {
const positions = this.props.single_questions.questions[result.destination.index].position;
const url = `/item_baskets/${ids}/adjust_position.json`
if(this.props.match.params.type==="Intelligence") {
var data = {
position: positions,
exam_setting_id:this.props.match.params.id,
}
}else {
var data = {
position: positions
}
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
@ -104,9 +112,19 @@ class Paperreview_item extends Component {
const ids = this.props.multiple_questions.questions[result.source.index].id;
const positions = this.props.multiple_questions.questions[result.destination.index].position;
const url = `/item_baskets/${ids}/adjust_position.json`
if(this.props.match.params.type==="Intelligence") {
var data = {
position: positions,
exam_setting_id:this.props.match.params.id,
}
}else {
var data = {
position: positions
}
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
@ -125,9 +143,19 @@ class Paperreview_item extends Component {
const ids = this.props.judgement_questions.questions[result.source.index].id;
const positions = this.props.judgement_questions.questions[result.destination.index].position;
const url = `/item_baskets/${ids}/adjust_position.json`
if(this.props.match.params.type==="Intelligence") {
var data = {
position: positions,
exam_setting_id:this.props.match.params.id,
}
}else {
var data = {
position: positions
}
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
@ -145,9 +173,19 @@ class Paperreview_item extends Component {
const ids = this.props.program_questions.questions[result.source.index].id;
const positions = this.props.program_questions.questions[result.destination.index].position;
const url = `/item_baskets/${ids}/adjust_position.json`
if(this.props.match.params.type==="Intelligence") {
var data = {
position: positions,
exam_setting_id:this.props.match.params.id,
}
}else {
var data = {
position: positions
}
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
@ -176,6 +214,25 @@ class Paperreview_item extends Component {
}
setDownloady = (fenshu) => {
if(this.props.match.params.type==="Intelligence") {
//智能选题
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" : '',
exam_setting_id:this.props.match.params.id,
}
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);
})
}else{
const url = "/item_baskets/batch_set_score.json";
var data = {
score: fenshu,
@ -194,6 +251,8 @@ class Paperreview_item extends Component {
})
}
}
setDownloadys=(value)=>{
const url = `/item_baskets/${this.state.set_scoreid}/set_score.json`;
var data = {
@ -239,6 +298,29 @@ class Paperreview_item extends Component {
modalsTypedel: bool,
titilesms: names
})
if(this.props.match.params.type==="Intelligence") {
//智能组卷
const url = `/item_baskets/delete_item_type.json`;
axios.delete((url), {
data: {
item_type: names,
exam_setting_id:this.props.match.params.id,
}
})
.then((response) => {
if (response.data.status == 0) {
// this.props.showNotification('大题删除成功');
this.props.getdata({});
this.setState({
titilesms: ""
})
}
})
.catch(function (error) {
////console.log(error);
});
}else{
const url = `/item_baskets/delete_item_type.json`;
axios.delete((url), {
data: {
@ -257,6 +339,8 @@ class Paperreview_item extends Component {
.catch(function (error) {
////console.log(error);
});
}
@ -271,8 +355,12 @@ class Paperreview_item extends Component {
})
}else {
//确定
if(this.props.match.params.type==="Intelligence"){
//智能组卷
const url = `/item_baskets/${this.state.item_bank_id}.json`;
axios.delete((url))
axios.delete(url, { data: {
exam_setting_id: this.props.match.params.id,
}})
.then((response) => {
if (response.data.status == 0) {
// this.props.showNotification('试题删除成功');
@ -282,6 +370,20 @@ class Paperreview_item extends Component {
.catch(function (error) {
});
}else{
const url = `/item_baskets/${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,
@ -291,7 +393,8 @@ class Paperreview_item extends Component {
}
showsetmodalsTypedels=(id,bool,type)=>{
debugger
console.log("Paperreview_item");
this.setState({
item_bank_id:id,
})
@ -394,6 +497,8 @@ class Paperreview_item extends Component {
modalsTypeys
} = this.state;
let {single_questions, multiple_questions, judgement_questions, program_questions, all_score} = this.props;
console.log("this.props");
console.log(this.props);
return (
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200wuh mt19">
{

@ -61,6 +61,9 @@ class Paperreview_items extends Component {
// //console.log(object);
// //console.log("Paperreview_items");
// //console.log(object.item_id);
//这里换题修改过
//这里删除修改过
// /Integeneration/Intelligence/ 换题item_id 删除item_id
return (
<div>
{

@ -18,6 +18,7 @@ import NoneData from './component/NoneData';
import './questioncss/questioncom.css';
import '../tpm/newshixuns/css/Newshixuns.css';
import QuillForEditor from "../../common/quillForEditor";
import QuestionModalPicture from "./component/QuestionModalPicture";
const tagArray = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
@ -35,6 +36,8 @@ class Paperreview_single extends Component {
questions: 0,
totalscore: 0,
total: 0,
url: ""
}
}
@ -67,9 +70,20 @@ class Paperreview_single extends Component {
Singlemagaziness = () => {
}
handleShowUploadImage = (url) => {
// console.log('==============>>>>>>>>>>>>',url);
// setUrl(url);
this.setState({
url:url
})
}
handleClose=()=>{
this.setState({
url:'',
})
}
render() {
let {questions, totalscore, total, items} = this.state;
let {questions, totalscore, total, items,url} = this.state;
let {objectsingle, indexx, paperreviewsingleindex, indexxy,name} = this.props;
@ -94,12 +108,30 @@ class Paperreview_single extends Component {
const options = [
'bold', // 加粗
]
try {
if(itemsnamesy.constructor === Object){
// console.log("是对象");
// console.log(itemsnamesy);
}else {
// console.log("不是对象");
// console.log(itemsnamesy);
itemsnamesy=itemsnamesy+"";
}
}catch (e) {
}
return (
<div key={indexxy}
className={ "w100s borderwdswuh mb20 pd20 "}
onMouseEnter={() => this.props.showparagraphs(indexxy,name)} style={{
minHeight: "114px",
}}>
{url?
<QuestionModalPicture {...this.props} {...this.state} handleClose={()=>this.handleClose()}></QuestionModalPicture>
:
""
}
<style>{
`
.programquill .ql-editor{
@ -183,6 +215,7 @@ class Paperreview_single extends Component {
<QuillForEditor
readOnly={true}
value={itemssname}
showUploadImage={this.handleShowUploadImage}
/>
}
@ -226,6 +259,7 @@ class Paperreview_single extends Component {
<QuillForEditor
readOnly={true}
value={itemsnamesy}
showUploadImage={this.handleShowUploadImage}
/>
}
@ -257,6 +291,7 @@ class Paperreview_single extends Component {
<QuillForEditor
readOnly={true}
value={string}
showUploadImage={this.handleShowUploadImage}
/>
:""
:

@ -21,7 +21,9 @@ import NoneData from './component/NoneData';
import './questioncss/questioncom.css';
import SiderBars from "../question/component/SiderBars";
import QuestionModalys from "./component/QuestionModalys";
import Certifiedprofessional from "../modals/Certifiedprofessional";
var Undoclickable=true;
class Question extends Component {
constructor(props) {
super(props);
@ -69,6 +71,11 @@ class Question extends Component {
isVisible: false,
selectionbools:false,
chakanjiexiboolindex:"无",
mydisplay:false,
occupation:2,
}
}
@ -230,11 +237,9 @@ class Question extends Component {
}
axios.get((url), {params: data}).then((response) => {
setTimeout(()=>{
this.setState({
booljupyterurls:false,
})
},1000);
if (response === null || response === undefined) {
return
@ -287,7 +292,10 @@ class Question extends Component {
})
this.getdataslen(response.data.items);
// Undoclickable=true;
}).catch((error) => {
// Undoclickable=true;
});
}
@ -634,6 +642,7 @@ class Question extends Component {
single_questions_count: result.data.single_questions_count,
subjective_questions_count: result.data.subjective_questions_count,
})
// Undoclickable=true;
}).catch((error) => {
// ////console.log(error);
@ -646,6 +655,7 @@ class Question extends Component {
single_questions_count: 0,
subjective_questions_count: 0,
})
// Undoclickable=true;
})
}
@ -683,6 +693,11 @@ class Question extends Component {
}
// 撤销
getitem_basketss=(id)=>{
this.setState({
})
if(Undoclickable===true){
Undoclickable=false;
//选用题型可以上传单个 或者多个题型
let url=`/item_baskets/${id}.json`;
@ -704,9 +719,23 @@ class Question extends Component {
this.getdatasy(data);
this.getbasket_listdata();
}
setTimeout(()=>{
Undoclickable=true;
},1000);
}).catch((error) => {
////console.log(error);
setTimeout(()=>{
Undoclickable=true;
},1000);
})
}else{
return
}
}
//全选试题库
selectallquestionsonthispage=()=>{
@ -778,11 +807,38 @@ class Question extends Component {
});
}
HideAddcoursestypess=(i)=>{
console.log("调用了");
this.setState({
mydisplay:true,
occupation:i,
})
}
mydisplayHidedel=()=>{
this.setState({
mydisplay:false,
})
}
//跳转
gotopaperreview=()=>{
let isysladmins=false;
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
if(this.props.current_user.professional_certification===false&&isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.history.replace("/paperreview/artificial");
}
@ -817,7 +873,7 @@ class Question extends Component {
page, per_page, items_count, Headertop, visible, placement, modalsType, modalsTypes,basket_list,
completion_questions_count, judgement_questions_count, multiple_questions_count, practical_questions_count,
program_questions_count, single_questions_count, subjective_questions_count,selectionbools,
modalsTypeInaudit
modalsTypeInaudit,mydisplay
} = this.state;
const Datacount = completion_questions_count + judgement_questions_count
@ -825,13 +881,47 @@ class Question extends Component {
+ program_questions_count
+ single_questions_count
+ subjective_questions_count;
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
let isysladmins=false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
try {
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
}catch (e) {
}
return (
<div className="newMain clearfix" ref={this.saveContainer}>
{
mydisplay===true?
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.mydisplayHidedel} />
:""
}
{
mydisplay===true?
<style>
{
`
body{
overflow:hidden!important;
}
`
}
</style>
:""
}
{
visible===true?
<style>
@ -862,7 +952,7 @@ class Question extends Component {
visible===true?
<div
style={{
marginTop: "60px"
marginTop: "81px"
}}></div>
:""}
{
@ -895,19 +985,7 @@ class Question extends Component {
`
}
</style>
{
isysladmins===true?
<SiderBars
Datacount={Datacount}
myvisible={visible}
{...this.props}
{...this.state}
showDrawer={() => this.showDrawer()}
Headertop={Headertop}
/>
:
is_teacher===true&&professional_certification===true?
<SiderBars
Datacount={Datacount}
myvisible={visible}
@ -917,11 +995,6 @@ class Question extends Component {
Headertop={Headertop}
/>
:
""
}
{/*顶部*/}

@ -1,5 +1,5 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {Link, NavLink,Prompt} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl,queryString} from 'educoder';
import axios from 'axios';
import {
@ -172,6 +172,20 @@ class Questionitem_banks extends Component {
}
componentWillMount () {
// 拦截判断是否离开当前页面
window.addEventListener('beforeunload', this.beforeunload);
}
componentWillUnmount () {
// 销毁拦截判断是否离开当前页面
window.removeEventListener('beforeunload', this.beforeunload);
}
beforeunload (e) {
let confirmationMessage = '你确定离开此页面吗?';
(e || window.event).returnValue = confirmationMessage;
return confirmationMessage;
}
getdata = (data) => {
// const url=`/item_banks.json`;
@ -473,17 +487,22 @@ class Questionitem_banks extends Component {
myrbkc.push(myda.id);
}
this.props.setOjInitialValue({
difficult: Getdatasdata[0].rbnd,
sub_discipline_id: Getdatasdata[3].rbkc[1],
tag_discipline_id: myrbkc,
});
// this.props.setOjInitialValue({
// difficult: Getdatasdata[0].rbnd,
// sub_discipline_id: Getdatasdata[3].rbkc[1],
// tag_discipline_id: myrbkc,
// });
let arrays=myrbkc.join(',');
// console.log("开始打印了");
// console.log(arrays);
window.open( `/problems/new?difficult=${Getdatasdata[0].rbnd}&sub_discipline_id=${Getdatasdata[3].rbkc[1]}&tag_discipline_id=${arrays}&newoj=1&pages=${this.state.pages}`);
// window.open( `/problems/new?difficult=${Getdatasdata[0].rbnd}&sub_discipline_id=${Getdatasdata[3].rbkc[1]}&tag_discipline_id=${arrays}&newoj=1&pages=${this.state.pages}`);
this.props.history.replace( `/problems/new?difficult=${Getdatasdata[0].rbnd}&sub_discipline_id=${Getdatasdata[3].rbkc[1]}&tag_discipline_id=${arrays}&newoj=1&pages=${this.state.pages}`);
}
@ -505,6 +524,10 @@ class Questionitem_banks extends Component {
<div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
>
<Prompt
when={true}
message={() => '你确定离开此页面吗?'}
/>
<style>
{
@ -588,7 +611,7 @@ class Questionitem_banks extends Component {
""
:
<Bottomsubmit {...this.props} {...this.state} bottomvalue={item_type === "PROGRAM" ? "创建" : "保存"}
onSubmits={() => this.preservation()} url={item_type === "PROGRAM" ?'/problems':'/question'}></Bottomsubmit>
onSubmits={() => this.preservation()} url={'/question'}></Bottomsubmit>
}
</div>
)
@ -598,14 +621,15 @@ class Questionitem_banks extends Component {
}
const mapStateToProps = (state) => ({});
const mapDispatchToProps = (dispatch) => ({
setOjInitialValue: (params) => dispatch(actions.setOjInitialValue(params))
});
export default connect(
mapStateToProps,
mapDispatchToProps
)(SnackbarHOC()(TPMIndexHOC(Questionitem_banks)));
// const mapStateToProps = (state) => ({});
// const mapDispatchToProps = (dispatch) => ({
// setOjInitialValue: (params) => dispatch(actions.setOjInitialValue(params))
// });
//
// export default connect(
// mapStateToProps,
// mapDispatchToProps
// )(SnackbarHOC()(TPMIndexHOC(Questionitem_banks)));
export default SnackbarHOC()(TPMIndexHOC(Questionitem_banks));

@ -9,6 +9,7 @@ import TPMMDEditor from '../../../modules/tpm/challengesnew/TPMMDEditor';
import axios from 'axios'
import update from 'immutability-helper'
import './../questioncss/questioncom.css';
import '../questioncss/font.css';
import {getUrl, ActionBtn, DMDEditor, ConditionToolTip} from 'educoder';
import QuillForEditor from '../../../common/quillForEditor';
const { TextArea } = Input;
@ -236,9 +237,24 @@ class ChoquesEditor extends Component{
texts="";
}
} else {
if(_text.length>=500){
var result = _text.substring(0,450);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
// 提交到后台的内容需要处理一下;
value = JSON.stringify(value);
if(value.length>=500){
let a=value.length-500;
let b=_text.length-a;
var result = _text.substring(0,b);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else{
texts=value;
}
}
}
let question_choices = this.state.question_choices.slice(0);
question_choices[index] = texts;
//console.log(question_choices);
@ -333,10 +349,7 @@ class ChoquesEditor extends Component{
// //////console.log("xuanzheshijuan");
// //////console.log(answerTagArray);
// //////console.log(!exerciseIsPublish);
const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']},
{ 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']},
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']}
]
const options=['code-block', 'image', 'formula']
return(
<div className="padding20-30 signleEditor duoxuano" id={qNumber}>
<style>{`
@ -362,6 +375,10 @@ class ChoquesEditor extends Component{
}
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-font {
line-height: 20px;
min-width: 150px;
}
.signleEditor .quill_editor_for_react_area .ql-container .ql-editor p{
font-family: MicrosoftYaHei;
}
`}</style>
<p className="mb10 clearfix">
@ -408,7 +425,7 @@ class ChoquesEditor extends Component{
autoFocus={false}
imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '166px'}}
placeholder="请您输入题干"
placeholder="请您输入选项"
options={options}
value={item}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
@ -418,7 +435,7 @@ class ChoquesEditor extends Component{
autoFocus={false}
imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '166px'}}
placeholder="请您输入题干"
placeholder="请您输入选项"
options={options}
value={JSON.parse(item)}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}

@ -17,6 +17,8 @@ import NoneDatas from '../component/NoneDatas';
import LoadingSpin from '../../../common/LoadingSpin';
import Contentquestionbank from "./Contentquestionbank";
import Listjihe from "./Listjihe";
import Certifiedprofessional from "../../modals/Certifiedprofessional";
import QuestionModalPicture from '../component/QuestionModalPicture.js'
const { TabPane } = Tabs;
const Search = Input.Search;
class Contentpart extends Component {
@ -25,25 +27,114 @@ class Contentpart extends Component {
this.state = {
page:1,
chakanjiexibool:false,
mydisplay:false,
occupation:2,
url: "",
isysladmins:false,
}
}
//初始化
componentDidMount(){
let isysladmins=false;
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
this.setState({
isysladmins:isysladmins
})
}
handleShowUploadImage = (url) => {
// console.log('==============>>>>>>>>>>>>',url);
// setUrl(url);
this.setState({
url:url
})
}
handleClose=()=>{
this.setState({
url:'',
})
}
chakanjiexibool=(index)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.chakanjiexibool(index);
}
showmodels=(e)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.showmodels(e)
}
showmodelsInaudit=(e)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.showmodelsInaudit(e)
}
showmodelysl=(e)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.showmodelysl(e)
}
componentDidUpdate(prevProps) {
if(prevProps.current_user !== this.props.current_user) {
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
let isysladmins=false;
let is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
let {defaultActiveKey} = this.props;
var defaultActiveKeys=defaultActiveKey;
try {
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
if(is_teacher===false){
if(this.props.current_user.user_identity !=="学生"){
//专业人士
is_teacher=true
}
}
}catch (e) {
}
this.setState({
isysladmins:isysladmins
})
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
defaultActiveKeys="0"
}else{
@ -52,7 +143,26 @@ class Contentpart extends Component {
this.props.callback(defaultActiveKeys);
}
}
HideAddcoursestypess=(i)=>{
console.log("调用了");
this.setState({
mydisplay:true,
occupation:i,
})
}
mydisplayHidedel=()=>{
this.setState({
mydisplay:false,
})
}
xinzenw=(e)=>{
//只限制了教师
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
var urls="";
if(this.props.discipline_id){
// if(urls==="?"){
@ -95,13 +205,32 @@ class Contentpart extends Component {
}
render() {
let {page}=this.state;
let {page,mydisplay,url}=this.state;
let {defaultActiveKey,item_type,booljupyterurls}=this.props;
const defaultActiveKeys=defaultActiveKey+'';
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
let isysladmins=false;
let is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
try {
if(is_teacher===false){
if(this.props.current_user.user_identity !=="学生"){
//专业人士
is_teacher=true
}
}
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
}catch (e) {
}
const content = (
<div className="questiontypes" style={{
@ -136,12 +265,38 @@ class Contentpart extends Component {
);
//console.log("Contentpart.js");
//console.log(this.props.defaultActiveKey);
// console.log("Contentpart.js");
// console.log(this.props.current_user.professional_certification);
return (
<div className=" clearfix mt25">
<div className="educontent mt10 pb20 w1200s">
{url?
<QuestionModalPicture {...this.props} {...this.state} handleClose={()=>this.handleClose()}></QuestionModalPicture>
:
""
}
{
mydisplay===true?
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.mydisplayHidedel} />
:""
}
{
mydisplay===true?
<style>
{
`
body{
overflow:hidden!important;
}
`
}
</style>
:""
}
<div className="w1200ms contentparttit" style={{
position: "relative",
}}>
@ -166,7 +321,7 @@ class Contentpart extends Component {
{
isysladmins===true||(is_teacher===true&&professional_certification===true)?
isysladmins===true||is_teacher===true?
<Tabs activeKey={defaultActiveKeys} onChange={(e)=>this.props.callback(e)}>
<TabPane tab="公共" key="1">
</TabPane>
@ -192,7 +347,7 @@ class Contentpart extends Component {
`
.xaxisreverseorder .ant-input-group-addon{
width: 60px !important;
width: 48px !important;
}
@ -214,7 +369,7 @@ class Contentpart extends Component {
<div className="xaxisreverseorder">
{
defaultActiveKey===0||defaultActiveKey==="0"?
isysladmins===true||(is_teacher===true&&professional_certification===true)?
isysladmins===true||is_teacher===true?
this.props.Isitapopup&&this.props.Isitapopup==="true"?
""
:
@ -247,7 +402,7 @@ class Contentpart extends Component {
defaultActiveKey===0||defaultActiveKey==="0"?
this.props.Isitapopup&&this.props.Isitapopup==="true"?
<Search
style={isysladmins===true||(is_teacher===true&&professional_certification)?{ marginRight:"0px"}:{marginRight:"0px"}}
style={isysladmins===true||is_teacher===true?{ marginRight:"0px"}:{marginRight:"0px"}}
className={"xaxisreverseorder searchwidth"}
placeholder="请输入题目名称、内容"
enterButton
@ -256,7 +411,7 @@ class Contentpart extends Component {
onSearch={ (value)=>this.props.setdatafuns(value)} />
:
<Search
style={isysladmins===true||(is_teacher===true&&professional_certification)?{ marginRight:"30px"}:{marginRight:"0px"}}
style={isysladmins===true||is_teacher===true?{ marginRight:"30px"}:{marginRight:"0px"}}
className={"xaxisreverseorder searchwidth"}
placeholder="请输入题目名称、内容"
enterButton
@ -320,9 +475,12 @@ class Contentpart extends Component {
pages={this.props.pages}
getitem_basketss={(id)=>this.props.getitem_basketss(id)}
getitem_baskets={(e)=>this.props.getitem_baskets(e)}
showmodels={(e)=>this.props.showmodels(e)}
showmodelysl={(e)=>this.props.showmodelysl(e)}
showmodelsInaudit={(e)=>this.props.showmodelsInaudit(e)}
showmodels={(e)=>this.showmodels(e)}
showmodelysl={(e)=>this.showmodelysl(e)}
showmodelsInaudit={(e)=>this.showmodelsInaudit(e)}
handleShowUploadImage={(e)=>this.handleShowUploadImage(e)}
handleClose={()=>this.handleClose()}
>
</Listjihe>

@ -260,7 +260,7 @@ class Headplugselections extends Component {
disciplinesdata&&disciplinesdata.map((item,key)=>{
return(
item.sub_disciplines.length>0?
<Dropdown getPopupContainer={trigger => trigger.parentNode} overlay={ overlaymenu(item.sub_disciplines,item.id)} key={key} placement={"bottomRight"}>
<Dropdown getPopupContainer={trigger => trigger.parentNode} overlay={ overlaymenu(item.sub_disciplines,item.id)} key={key} placement="bottomLeft">
<li key={key} className={parseInt(shixunsearchAllvalue)===item.id?"shaiItem shixun_repertoire active":"shaiItem shixun_repertoire"} value={item.id} onClick={()=>this.shixunserdchAlls(item.sub_disciplines,item.id)}>
{item.name}
</li>

@ -9,6 +9,7 @@ import TPMMDEditor from '../../../modules/tpm/challengesnew/TPMMDEditor';
import axios from 'axios'
import update from 'immutability-helper'
import './../questioncss/questioncom.css';
import '../questioncss/font.css';
import {getUrl, ActionBtn, DMDEditor, ConditionToolTip} from 'educoder';
import QuillForEditor from '../../../common/quillForEditor';
@ -368,10 +369,7 @@ class JudquestionEditor extends Component{
// ////////console.log(answerTagArray);
// ////////console.log(!exerciseIsPublish);
const params= this.props&&this.props.match&&this.props.match.params;
const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']},
{ 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']},
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']}
]
const options=['code-block', 'image', 'formula']
return(
<div className="padding20-30 signleEditor danxuano" id={qNumber}>
<style>{`
@ -397,6 +395,10 @@ class JudquestionEditor extends Component{
}
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-font {
line-height: 20px;
min-width: 150px;
}
.signleEditor .quill_editor_for_react_area .ql-container .ql-editor p{
font-family: MicrosoftYaHei;
}
`}</style>
<p className="mb10 clearfix">

@ -8,10 +8,12 @@ import {
Table,
Pagination,
Radio,
Tooltip
Tooltip,
Icon
} from "antd";
import './../questioncss/questioncom.css';
import QuillForEditor from "../../../common/quillForEditor";
import Certifiedprofessional from "../../modals/Certifiedprofessional";
const tagArray = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
@ -31,15 +33,46 @@ class Listjihe extends Component {
page: 1,
name: "单选题",
nd: "简单",
url: "",
mydisplay:false,
occupation:2,
isysladmins:false,
}
}
//初始化
componentDidMount() {
let isysladmins=false;
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
this.setState({
isysladmins:isysladmins
})
}
handleShowUploadImage = (url) => {
try {
this.props.handleShowUploadImage(url);
}catch (e) {
}
}
handleClose=()=>{
try {
this.props.handleClose();
}catch (e) {
}
}
//选用
Selectingpracticaltraining = (id) => {
let data = {}
@ -53,8 +86,15 @@ class Listjihe extends Component {
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
}
}
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.getitem_baskets(data);
}
getitem_baskets=(data)=>{
this.props.getitem_baskets(data);
}
//撤销
Selectingpracticaltrainings = (id) => {
@ -63,8 +103,29 @@ class Listjihe extends Component {
}
seturls(url){
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.history.replace(url);
}
HideAddcoursestypess=(i)=>{
console.log("调用了");
this.setState({
mydisplay:true,
occupation:i,
})
}
mydisplayHidedel=()=>{
this.setState({
mydisplay:false,
})
}
render() {
let {page, name, nd} = this.state;
let {page, name, nd,url,mydisplay} = this.state;
let {defaultActiveKey, items, listjihe, chakanjiexiboolindex, keindex} = this.props;
// 编程答案
@ -132,7 +193,7 @@ class Listjihe extends Component {
}catch (e) {
}
if(itemssname===undefined){
itemssname=items.name
itemssname=items.name+""
}
@ -141,7 +202,8 @@ class Listjihe extends Component {
itemsnamesy= JSON.parse(items&&items.program_attr&&items.program_attr.description);
}catch (e) {
itemsnamesy=items&&items.program_attr&&items.program_attr.description;
itemsnamesy=items&&items.program_attr&&items.program_attr.description+"";
}
var analysisnames="";
@ -149,7 +211,7 @@ class Listjihe extends Component {
analysisnames= JSON.parse(items&&items.analysis);
}catch (e) {
analysisnames=items&&items.analysis;
analysisnames=items&&items.analysis+"";
}
// console.log(items.name);
// console.log(itemsnamesy);
@ -158,10 +220,61 @@ class Listjihe extends Component {
const options = [
'bold', // 加粗
]
try {
if(itemsnamesy.constructor === Object){
// console.log("是对象");
// console.log(itemsnamesy);
}else {
// console.log("不是对象");
// console.log(itemsnamesy);
itemsnamesy=itemsnamesy+"";
}
}catch (e) {
}
return (
<div key={keindex}
className={chakanjiexiboolindex === keindex ? "w100s borderwds283 pd20 mb20 listjihecolors" : "w100s borderwds pd20 mb20 listjihecolors"}>
className={chakanjiexiboolindex === keindex ? "w100s borderwds283 pd20 mb20 listjihecolors" : " borderwds pd20 mb20 listjihecolors"}>
{/*顶部*/}
{
mydisplay===true?
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.mydisplayHidedel} />
:""
}
{
mydisplay===true?
<style>
{
`
body{
overflow:hidden!important;
}
`
}
</style>
:""
}
<style>
{
`
`
}
</style>
{/* 显示上传的图片信息 */}
{/*<div className="show_upload_image" style={{ display: url ? 'block' : 'none'}}>*/}
{/* <Icon type="close" className="image_close" onClick={()=>this.handleClose()}/>*/}
{/* <div className="image_info">*/}
{/* <img className="image" src={url} alt=""/>*/}
{/* </div>*/}
{/*</div>*/}
<style>
{
` .markdown-body .ql-editor{
@ -197,7 +310,7 @@ class Listjihe extends Component {
</div>
{
items.item_type==="PROGRAM"?
<a href={`/problems/${items.program_attr.identifier}/edit`}>
<a onClick={()=>this.seturls(`/problems/${items.program_attr.identifier}/edit`)} >
<div className="ml10 w100s " style={{wordBreak: "break-word",fontWeight:"bold"}} dangerouslySetInnerHTML={{__html: markdownToHTML(items&&items.name).replace(/▁/g, "▁▁▁")}}></div>
</a>
:
@ -212,6 +325,7 @@ class Listjihe extends Component {
<QuillForEditor
readOnly={true}
value={itemssname}
showUploadImage={this.handleShowUploadImage}
/>
:""
}
@ -249,6 +363,7 @@ class Listjihe extends Component {
<QuillForEditor
readOnly={true}
value={itemsnamesy}
showUploadImage={this.handleShowUploadImage}
/>
}
</p>
@ -282,6 +397,7 @@ class Listjihe extends Component {
<QuillForEditor
readOnly={true}
value={string}
showUploadImage={this.handleShowUploadImage}
/>
:""
@ -369,7 +485,7 @@ class Listjihe extends Component {
this.props.Isitapopup&&this.props.Isitapopup==="true"?
""
:
<a target="_blank" href={`/problems/${items.program_attr.identifier}/edit?editoj=1&pages=`+this.props.pages}>
<a onClick={()=>this.seturls(`/problems/${items.program_attr.identifier}/edit?editoj=1&pages=`+this.props.pages)}>
<p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
@ -379,7 +495,7 @@ class Listjihe extends Component {
this.props.Isitapopup&&this.props.Isitapopup==="true"?
""
:
<a target="_blank" href={`/question/edit/${items.id}`}>
<a onClick={()=>this.seturls(`/question/edit/${items.id}`)}>
<p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
@ -401,7 +517,10 @@ class Listjihe extends Component {
:
(
items.public==true?
""
<p className="viewparsings xiaoshou mr25" >
<i className="iconfont icon-dianjiliang font-13 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>已公开</span>
</p>
:
<p className="viewparsings xiaoshou mr25" onClick={(e) => this.props.showmodelsInaudit(e)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
@ -425,7 +544,10 @@ class Listjihe extends Component {
</p>
)
:
""
<p className="viewparsings mr25" >
<i className="iconfont icon-dianjiliang font-13 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>已公开</span>
</p>
}
</div>
@ -493,6 +615,7 @@ class Listjihe extends Component {
imgAttrs={{width: '60px', height: '30px'}}
readOnly={true}
value={analysisnames}
showUploadImage={this.handleShowUploadImage}
/>
:
"暂无解析"

@ -0,0 +1,58 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal,Icon} from 'antd';
import axios from 'axios';
import './../questioncss/questioncom.css'
import './../../../common/components/comment/index.scss';
//立即申请试用
class QuestionModalPicture extends Component {
constructor(props) {
super(props);
this.state={
}
}
render() {
return(
<Modal
keyboard={false}
closable={true}
footer={null}
destroyOnClose={true}
title=""
centered={true}
visible={this.props.url?true:false}
onCancel={this.props.handleClose}
>
{/* 显示上传的图片信息 */}
<style>
{
`
.intermediatecenter{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
`
}
</style>
<div className="show_upload_image intermediatecenter" style={{ display: this.props.url ? 'block' : 'none'}}>
{/*<Icon type="close" className="image_close" onClick={this.props.handleClose}/>*/}
<div className="image_info intermediatecenter">
<img className="image" style={{
width:"100%"
}} src={ this.props.url} alt=""/>
</div>
</div>
</Modal>
)
}
}
export default QuestionModalPicture;

@ -94,6 +94,22 @@ class SiderBars extends Component {
var mypath= this.props&&this.props.match&&this.props.match.path;
let{myvisible,Datacount,animateStyle}=this.props;
let swsilan=false;
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
swsilan=true;
}
else if(this.props.current_user.business){
swsilan=true;
}
else if(this.props.current_user.is_teacher){
swsilan=true;
}else if(this.props.current_user.user_identity !=="学生") {
swsilan=true;
}
}
}
return (
<div className={myvisible===true?"-task-sidebar mystask-sidebar":Datacount&&Datacount>0?"-task-sidebar mystask-sidebars":"-task-sidebar mystask-sidebarss"} >
@ -101,7 +117,7 @@ class SiderBars extends Component {
{this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?<div>
{
mypath&&mypath==="/question"?
mypath&&mypath==="/question"&&swsilan===true?
<Tooltip placement="left" title={"试题库"}>
<div className="feedback feedbackdivcolor xiaoshou shitikus" onClick={()=>this.props.showDrawer()} >
@ -117,7 +133,7 @@ class SiderBars extends Component {
<a target="_blank" className="color_white xiaoshou" >
<i className="iconfont icon-shitilan color-white xiaoshou"></i>
</a>
<p className="color-white font-12 xiaoshou">试题</p>
<p className="color-white font-12 xiaoshou">试题</p>
</div>
</Tooltip>
:""

@ -10,6 +10,7 @@ import TPMMDEditor from '../../../modules/tpm/challengesnew/TPMMDEditor';
import axios from 'axios'
import update from 'immutability-helper'
import './../questioncss/questioncom.css';
import '../questioncss/font.css';
import {getUrl, ActionBtn, DMDEditor, ConditionToolTip} from 'educoder';
const { TextArea } = Input;
const confirm = Modal.confirm;
@ -258,9 +259,24 @@ class SingleEditor extends Component{
texts="";
}
} else {
if(_text.length>=500){
var result = _text.substring(0,450);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
// 提交到后台的内容需要处理一下;
value = JSON.stringify(value);
if(value.length>=500){
let a=value.length-500;
let b=_text.length-a;
var result = _text.substring(0,b);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else{
texts=value;
}
}
}
let question_choices = this.state.question_choices.slice(0);
question_choices[index] = texts;
this.setState({ question_choices });
@ -354,9 +370,7 @@ class SingleEditor extends Component{
// //////console.log("xuanzheshijuan");
// //////console.log(answerTagArray);
// //////console.log(!exerciseIsPublish);
const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']},
{ 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']},
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']}
const options=['code-block', 'image', 'formula'
]
return(
<div className="padding20-30 signleEditor danxuano" id={qNumber}>
@ -384,6 +398,10 @@ class SingleEditor extends Component{
}
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-font {
line-height: 20px;
min-width: 150px;
}
.signleEditor .quill_editor_for_react_area .ql-container .ql-editor p{
font-family: MicrosoftYaHei;
}
`}</style>
<p className="mb10 clearfix">
@ -428,7 +446,7 @@ class SingleEditor extends Component{
autoFocus={false}
imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '166px'}}
placeholder="请您输入题干"
placeholder="请您输入选项"
options={options}
value={item}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
@ -438,7 +456,7 @@ class SingleEditor extends Component{
autoFocus={false}
imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '166px'}}
placeholder="请您输入题干"
placeholder="请您输入选项"
options={options}
value={JSON.parse(item)}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}

@ -0,0 +1,67 @@
@charset "utf-8";
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimSun]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimSun]::before {
content: "宋体";
font-family:SimSun !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimHei]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimHei]::before {
content: "黑体";
font-family:SimHei !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Microsoft-YaHei]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Microsoft-YaHei]::before {
content: "微软雅黑";
font-family:Microsoft YaHei !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=KaiTi]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=KaiTi]::before {
content: "楷体";
font-family:KaiTi !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=FangSong]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=FangSong]::before {
content: "仿宋";
font-family:FangSong !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Arial]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Arial]::before {
content: "Arial";
font-family:Arial !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Times-New-Roman]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Times-New-Roman]::before {
content: "Times New Roman";
font-family:Times New Roman !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=sans-serif]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=sans-serif]::before {
content: "sans-serif";
font-family:sans-serif !important;
}
.ql-font-SimSun {
font-family:SimSun !important;
}
.ql-font-SimHei {
font-family:SimHei !important;
}
.ql-font-Microsoft-YaHei {
font-family:Microsoft YaHei !important;
}
.ql-font-KaiTi {
font-family:KaiTi !important;
}
.ql-font-FangSong {
font-family:FangSong !important;
}
.ql-font-Arial {
font-family:Arial !important;
}
.ql-font-Times-New-Roman {
font-family:Times New Roman !important;
}
.ql-font-sans-serif {
font-family:sans-serif !important;
}

@ -0,0 +1,18 @@
.ql-editor .ql-font-Microsoft-YaHei {
font-family: "Microsoft YaHei";
}
.ql-editor .ql-font-SimSun {
font-family: "SimSun";
}
.ql-editor .ql-font-SimHei {
font-family: "SimHei";
}
.ql-editor .ql-font-KaiTi {
font-family: "KaiTi";
}
.ql-editor .ql-font-Arial {
font-family: "Arial";
}
.ql-editor .Times-New-Roman {
font-family: "Times New Roman";
}

@ -0,0 +1,28 @@
.ql-snow .ql-picker.ql-font .ql-picker-label::before,
.ql-snow .ql-picker.ql-font .ql-picker-item::before {
content: '微软雅黑';
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Microsoft-YaHei]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Microsoft-YaHei]::before {
content: "微软雅黑";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimSun]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimSun]::before {
content: "宋体";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimHei]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimHei]::before {
content: "黑体";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=KaiTi]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=KaiTi]::before {
content: "楷体";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Arial]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Arial]::before {
content: "Arial";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Times-New-Roman]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Times-New-Roman]::before {
content: "Times New Roman";
}

@ -31,7 +31,7 @@ class Paperlibraryeditid extends Component {
super(props);
this.Judquestio = React.createRef();
this.state = {
paperlibrartdata: [],
Contentdata: [],
disciplinesdata: [],
knowledgepoints: [],
disciplmy: [],
@ -139,7 +139,7 @@ class Paperlibraryeditid extends Component {
axios.get(urls).then((response) => {
if (response) {
this.setState({
paperlibrartdata: response.data,
Contentdata: response.data,
item_banksedit: response.data.exam,
})
}
@ -188,7 +188,7 @@ class Paperlibraryeditid extends Component {
.then((result) => {
if (result.data.status === 0) {
// this.props.showNotification(`试卷更新成功`);
this.props.history.push('/paperlibrary');
this.props.history.push('/paperlibrary/see/'+this.props.match.params.id);
}
}).catch((error) => {
//console.log(error);
@ -227,7 +227,7 @@ class Paperlibraryeditid extends Component {
}
render() {
let {paperlibrartdata,newmyshixunmodelbool,defaultActiveKey} = this.state;
let {Contentdata,newmyshixunmodelbool,defaultActiveKey} = this.state;
const params = this.props && this.props.match && this.props.match.params;
let urlsysl=`/paperlibrary?defaultActiveKey=${defaultActiveKey}`;
@ -248,7 +248,7 @@ class Paperlibraryeditid extends Component {
{
newmyshixunmodelbool===true?
<div className="fangdatwo">
<NewMyShixunModel {...this.state} {...this.props} exam_id={this.props.match.params.id} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}></NewMyShixunModel>
<NewMyShixunModel {...this.state} {...this.props} Contentdata={this.state.Contentdata} exam_id={this.props.match.params.id} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}></NewMyShixunModel>
</div>
:
""
@ -291,9 +291,9 @@ class Paperlibraryeditid extends Component {
<div className={"seeoagertitscss"}>
<Seeoagertits
setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}
all_score={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_questions_count}
all_questions_count={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_score}
difficulty={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.difficulty}
all_score={Contentdata && Contentdata.exam && Contentdata.exam.all_questions_count}
all_questions_count={Contentdata && Contentdata.exam && Contentdata.exam.all_score}
difficulty={Contentdata && Contentdata.exam && Contentdata.exam.difficulty}
>
</Seeoagertits>
</div>
@ -301,15 +301,15 @@ class Paperlibraryeditid extends Component {
{...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
single_questions={Contentdata && Contentdata.single_questions && Contentdata.single_questions.questions.length > 0 ? Contentdata.single_questions : null}
multiple_questions={Contentdata && Contentdata.multiple_questions
&& Contentdata.multiple_questions.questions.length > 0 ? Contentdata.multiple_questions : null
}
judgement_questions={paperlibrartdata && paperlibrartdata.judgement_questions
&& paperlibrartdata.judgement_questions.questions.length > 0 ? paperlibrartdata.judgement_questions : null
judgement_questions={Contentdata && Contentdata.judgement_questions
&& Contentdata.judgement_questions.questions.length > 0 ? Contentdata.judgement_questions : null
}
program_questions={paperlibrartdata && paperlibrartdata.program_questions
&& paperlibrartdata.program_questions.questions.length > 0 ? paperlibrartdata.program_questions : null
program_questions={Contentdata && Contentdata.program_questions
&& Contentdata.program_questions.questions.length > 0 ? Contentdata.program_questions : null
}
></Paperlibraryseeid_itemss>

@ -164,11 +164,9 @@ class Testpaperlibrary extends Component {
}
axios.get((url), {params: data}).then((response) => {
setTimeout(()=>{
this.setState({
booljupyterurls:false,
})
},1000);
if (response === null || response === undefined) {
return
@ -304,7 +302,7 @@ class Testpaperlibrary extends Component {
tag_discipline_id:this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
keyword: this.state.keywords,
keyword: this.state.keyword,
page: this.state.page,
per_page:10,
};
@ -330,7 +328,7 @@ class Testpaperlibrary extends Component {
tag_discipline_id:this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
keyword: this.state.keywords,
keyword: this.state.keyword,
page: this.state.page,
per_page:10,
};

@ -17,6 +17,7 @@ import NoneDatas from '../component/NoneDatas';
import Contentquestionbank from "./Contentquestionbank";
import LoadingSpin from '../../../common/LoadingSpin';
import Listjihe from "./Listjihe";
import Certifiedprofessional from "../../modals/Certifiedprofessional";
const { TabPane } = Tabs;
const Search = Input.Search;
class Contentpart extends Component {
@ -25,6 +26,10 @@ class Contentpart extends Component {
this.state = {
page:1,
defaultActiveKeyss:"0",
mydisplay:false,
occupation:2,
isysladmins:false,
}
}
@ -50,6 +55,20 @@ class Contentpart extends Component {
}
}
let isysladmins=false;
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
this.setState({
isysladmins:isysladmins
})
}
//跳转人工组卷
@ -60,11 +79,32 @@ class Contentpart extends Component {
componentDidUpdate(prevProps) {
if(prevProps.current_user !== this.props.current_user) {
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
let isysladmins=false;
let is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
let {defaultActiveKey} = this.props;
let defaultActiveKeys=defaultActiveKey;
try {
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
if(is_teacher===false){
if(this.props.current_user.user_identity !=="学生"){
//专业人士
is_teacher=true
}
}
}catch (e) {
}
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
defaultActiveKeys="0"
}else{
@ -86,15 +126,120 @@ class Contentpart extends Component {
this.props.callback(defaultActiveKeys,false);
}
}
HideAddcoursestypess=(i)=>{
console.log("调用了");
this.setState({
mydisplay:true,
occupation:i,
})
}
mydisplayHidedel=()=>{
this.setState({
mydisplay:false,
})
}
xinzenw=(url)=>{
//只限制了教师
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.history.push(url);
}
HideAddcoursestypess=(i)=>{
console.log("调用了");
this.setState({
mydisplay:true,
occupation:i,
})
}
mydisplayHidedel=()=>{
this.setState({
mydisplay:false,
})
}
Testpapereditor=(e)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.Testpapereditor(e)
}
showmodels=(e)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.showmodels(e)
}
showmodelysl=(e)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.showmodelysl(e)
}
showmodelsInaudit=(e)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.showmodelsInaudit(e)
}
render() {
let {page,defaultActiveKeyss}=this.state;
let {page,defaultActiveKeyss,mydisplay}=this.state;
let {defaultActiveKey,defaultActiveKeybool}=this.props;
let defaultActiveKeys=defaultActiveKey+'';
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
let isysladmins=false;
let is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
try {
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
if(is_teacher===false){
if(this.props.current_user.user_identity !=="学生"){
//专业人士
is_teacher=true
}
}
}catch (e) {
}
const contents = (
<div className="questiontypes" style={{
@ -125,6 +270,27 @@ class Contentpart extends Component {
return (
<div className=" clearfix mt25">
<div className="educontent mt10 pb20 w1200s">
{
mydisplay===true?
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.mydisplayHidedel} />
:""
}
{
mydisplay===true?
<style>
{
`
body{
overflow:hidden!important;
}
`
}
</style>
:""
}
<div className="w1200ms contentparttit" style={{
position: "relative",
}}>
@ -149,7 +315,7 @@ class Contentpart extends Component {
</style>
{
isysladmins===true||(is_teacher===true&&professional_certification===true)?
isysladmins===true||is_teacher===true?
<Tabs activeKey={defaultActiveKeys} onChange={(e)=>this.props.callback(e,true)}>
<TabPane tab="公共" key="1">
</TabPane>
@ -172,7 +338,7 @@ class Contentpart extends Component {
{
`
.sortinxdirection .ant-input-group-addon{
width: 60px !important;
width: 48px !important;
}
@ -186,7 +352,7 @@ class Contentpart extends Component {
`
}
</style>
<div className={isysladmins===true||(is_teacher===true&&professional_certification===true)?"sortinxdirection":"xaxisreverseorder"}>
<div className={isysladmins===true||is_teacher===true?"sortinxdirection":"xaxisreverseorder"}>
<Search
style={{ width: "347px",marginRight:"60px",}}
placeholder="请输入题目名称、内容"
@ -194,22 +360,22 @@ class Contentpart extends Component {
size="large"
onInput={(e)=>this.props.setdatafunsval(e)}
onSearch={ (value)=>this.props.setdatafuns(value)}
value={this.props.keywords}
value={this.props.keyword}
/>
{
isysladmins===true||(is_teacher===true&&professional_certification===true)?
isysladmins===true||is_teacher===true?
<div className="xaxisreverseorder" style={{
width:"50%"
}}>
<a href={'/Integeneration'}>
<a onClick={()=>this.xinzenw('/Integeneration')}>
<div className="newbutoonss">
<p className="newbutoontess" >智能组卷</p>
</div>
</a>
<a href={'/question'} >
<a onClick={()=>this.xinzenw('/question')}>
<div className="newbutoons mr39">
<p className="newbutoontess" >人工组卷</p>
</div>
@ -260,9 +426,9 @@ class Contentpart extends Component {
: this.props.Contentdata.exams.map((object, index) => {
return (
<Listjihe {...this.state} {...this.props} items={object} key={index}
Testpapereditor={(e)=>this.props.Testpapereditor(e)}
showmodels={(e)=>this.props.showmodels(e)}
showmodelysl={(e)=>this.props.showmodelysl(e)}
Testpapereditor={(e)=>this.Testpapereditor(e)}
showmodels={(e)=>this.showmodels(e)}
showmodelysl={(e)=>this.showmodelysl(e)}
Isitapopup={this.props.Isitapopup}
showmodelsInaudit={(e)=>this.props.showmodelsInaudit(e)}
>

@ -10,6 +10,7 @@ import {
Radio
} from "antd";
import './../testioncss/testioncss.css';
import Certifiedprofessional from "../../modals/Certifiedprofessional";
const tagArray = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
@ -23,12 +24,27 @@ class Listjihe extends Component {
name:"单选题",
nd:"简单",
chakanjiexibool:false,
mydisplay:false,
occupation:2,
isysladmins:false,
}
}
//初始化
componentDidMount(){
let isysladmins=false;
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
this.setState({
isysladmins:isysladmins
})
}
chakanjiexibool=()=>{
@ -55,15 +71,31 @@ class Listjihe extends Component {
this.props.getitem_basketss(id);
}
HideAddcoursestypess=(i)=>{
console.log("调用了");
this.setState({
mydisplay:true,
occupation:i,
})
}
mydisplayHidedel=()=>{
this.setState({
mydisplay:false,
})
}
gotoseesj=(id)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.history.push(`/paperlibrary/see/${id}?defaultActiveKey=${this.props.defaultActiveKey}`);
}
render() {
let {page,name,nd,chakanjiexibool}=this.state;
let {page,name,nd,chakanjiexibool,mydisplay}=this.state;
let {defaultActiveKey,items}=this.props;
const names= items&&items.name&&items.name;
@ -77,12 +109,33 @@ class Listjihe extends Component {
return (
<div className={" borderwdsst pd20 mb20 intermediatecenter listjihecolor "} >
{
mydisplay===true?
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.mydisplayHidedel} />
:""
}
{
mydisplay===true?
<style>
{
`
body{
overflow:hidden!important;
}
`
}
</style>
:""
}
<div className="sortinxdirection w100s">
<div className="sjimg intermediatecenter">
<img src={getImageUrl("images/educoder/shijuans.png")} className="imgtp"/>
</div>
<div className="w100s verticallayout ml20" >
<div className="w100s " > <a className="sjtitle xiaoshou " title={names} onClick={()=>this.gotoseesj(items.id)}><p className="maxnamewidth100s">{names}</p></a></div>
<div className="w100s " > <a className="sjtitle xiaoshou " title={names} onClick={()=>this.gotoseesj(items.id)}><p className="maxnamewidth100s xiaoshou">{names}</p></a></div>
<div className="w100s sortinxdirection mt9">
<p className="sjtitles">试题数<span >{question_counts}</span></p>
<p className="sjtitles ml48">总分<span >{total_scores}</span></p>
@ -135,21 +188,22 @@ class Listjihe extends Component {
}
{
items.public==true?
<p className="viewparsings mr25 ">
<i className="iconfont icon-dianjiliang font-13 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>已公开</span>
</p>
:
items.apply===false?
<p className="viewparsings xiaoshou mr25 " onClick={() => this.props.showmodels(items.id)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开</span>
</p>
:
(
items.public==true?
""
:
<p className="viewparsings xiaoshou mr25" onClick={(e) => this.props.showmodelsInaudit(e)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开审核中</span>
</p>
)
}
</div>
:""}
@ -159,7 +213,9 @@ class Listjihe extends Component {
</div>
</div>
<div className="sjfqks reversedirection">
<div className="sjfqks reversedirection" style={{
display: "none"
}}>
<div className="newbutoonss">
<p className="newbutoontess" >发起考试</p>
</div>

@ -16,6 +16,7 @@ import {
import '../testioncss/testioncss.css';
import '../../tpm/newshixuns/css/Newshixuns.css';
import QuillForEditor from "../../../common/quillForEditor";
import QuestionModalPicture from "../../question/component/QuestionModalPicture";
const tagArray = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
@ -33,6 +34,7 @@ class Paperlibraryseeid_items extends Component {
questions: 0,
totalscore: 0,
total: 0,
url: ""
}
}
@ -65,9 +67,20 @@ class Paperlibraryseeid_items extends Component {
Singlemagaziness = () => {
}
handleShowUploadImage = (url) => {
// console.log('==============>>>>>>>>>>>>',url);
// setUrl(url);
this.setState({
url:url
})
}
handleClose=()=>{
this.setState({
url:'',
})
}
render() {
let {questions, totalscore, total, items} = this.state;
let {questions, totalscore, total, items,url} = this.state;
let {objectsingle, indexx, paperreviewsingleindex, indexxy,name} = this.props;
@ -90,12 +103,30 @@ class Paperlibraryseeid_items extends Component {
const options = [
'bold', // 加粗
]
try {
if(itemsnamesy.constructor === Object){
// console.log("是对象");
// console.log(itemsnamesy);
}else {
// console.log("不是对象");
// console.log(itemsnamesy);
itemsnamesy=itemsnamesy+"";
}
}catch (e) {
}
return (
<div key={indexxy}
className={ "w100s borderwdswuh mb20 pd20 "}
style={{
minHeight: "114px",
}}>
{url?
<QuestionModalPicture {...this.props} {...this.state} handleClose={()=>this.handleClose()}></QuestionModalPicture>
:
""
}
<style>{
`
.programquill .ql-editor{
@ -179,6 +210,8 @@ class Paperlibraryseeid_items extends Component {
<QuillForEditor
readOnly={true}
value={itemssname}
showUploadImage={this.handleShowUploadImage}
/>
}
@ -221,6 +254,8 @@ class Paperlibraryseeid_items extends Component {
<QuillForEditor
readOnly={true}
value={itemsnamesy}
showUploadImage={this.handleShowUploadImage}
/>
}
@ -251,6 +286,8 @@ class Paperlibraryseeid_items extends Component {
<QuillForEditor
readOnly={true}
value={string}
showUploadImage={this.handleShowUploadImage}
/>
:""
:

@ -291,7 +291,8 @@ class Paperlibraryseeid_itemss extends Component {
}
showsetmodalsTypedels=(id,bool,type)=>{
debugger
console.log("Paperlibraryseeid_itemss");
this.setState({
item_bank_id:id,
})

@ -544,7 +544,7 @@
margin-top: 19px;
}
.mytags{
width:106px;
min-width:106px;
height:32px;
border-radius:2px;
border:1px solid #DDDDDD;

@ -940,11 +940,34 @@ submittojoinclass=(value)=>{
width:'93px',
height:'80px',
}}>
<a href={'/question'} className={"popovertests"} ><p className="questiontype">试题库</p></a>
<Link to={'/question'} className={"popovertests"} ><p className="questiontype">试题库</p></Link>
<p className="questiontypeheng"></p>
<a href={'/paperlibrary'} className={"popovertests"} ><p className="questiontype">试卷库</p></a>
<Link to={'/paperlibrary'} className={"popovertests"} ><p className="questiontype">试卷库</p></Link>
</div>
);
// console.log("头部");
// console.log(this.props);
//判断平台身份
let Periofters=false;
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
Periofters=true;
}
else if(this.props.current_user.business){
Periofters=true;
}
else if(this.props.current_user.is_teacher){
Periofters=true;
}else if(this.props.current_user.user_identity !=="学生") {
Periofters=true;
}
}
}
return (
<div className="newHeaders" id="nHeader" >
@ -1043,7 +1066,7 @@ submittojoinclass=(value)=>{
color:#010101 !important;
}
.queyppors {
top: 63px !important;
top: 42px !important;
}
.questionbanks .ant-popover-inner-content {
@ -1052,17 +1075,22 @@ submittojoinclass=(value)=>{
`
}
</style>
{/*<li className={`pr questionbanks`} >*/}
{/* <Popover className="queyppors" id={"yslpopovers"} placement="bottom" content={contents} trigger="click" >*/}
{/* <div className=" sortinxdirection mr10">*/}
{/* <div style={{*/}
{/* color:"#fff"*/}
{/* }}>*/}
{/* 题库*/}
{/* </div>*/}
{/* </div>*/}
{/* </Popover>*/}
{/*</li>*/}
{
Periofters===true?
<li className={`pr questionbanks`} >
<Popover className="queyppors" id={"yslpopovers"} placement="bottom" content={contents} trigger="click" >
<div className=" sortinxdirection mr10">
<div style={{
color:"#fff"
}}>
题库
</div>
</div>
</Popover>
</li>
:""
}
<li
style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.auth === null ? 'none' : 'block'}}

Loading…
Cancel
Save