caishi 5 years ago
commit b9e16f832b

@ -125,7 +125,7 @@ $(window).resize(function() {
rightSlider();
});
function rightSlider() {
var poi = parseInt((parseInt($(window).width()) - 1200) / 2) - 60;
var poi = parseInt((parseInt($(window).width()) - 1200) / 2) - 81;
// console.log(parseInt($(window).width())+" "+poi);
if (poi > 0) {
$(".-task-sidebar").css("right", poi);

@ -113,22 +113,21 @@ module.exports = {
// First, run the linter.
// It's important to do this before Babel processes the JS.
// 上线然后要注释回来
{
test: /\.(js|jsx|mjs)$/,
enforce: 'pre',
use: [
{
options: {
formatter: eslintFormatter,
eslintPath: require.resolve('eslint'),
},
loader: require.resolve('eslint-loader'),
},
],
include: paths.appSrc,
},
// {
// test: /\.(js|jsx|mjs)$/,
// enforce: 'pre',
// use: [
// {
// options: {
// formatter: eslintFormatter,
// eslintPath: require.resolve('eslint'),
//
// },
// loader: require.resolve('eslint-loader'),
// },
// ],
// include: paths.appSrc,
// },
{
// "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall

@ -56,8 +56,8 @@ module.exports = {
bail: true,
// We generate sourcemaps in production. This is slow but gives good results.
// You can exclude the *.map files from the build during deployment.
// devtool: shouldUseSourceMap ? 'nosources-source-map' : false, //正式版
devtool: shouldUseSourceMap ? 'source-map' : false,//测试版
devtool: shouldUseSourceMap ? 'nosources-source-map' : false, //正式版
// devtool: shouldUseSourceMap ? 'source-map' : false,//测试版
// In production, we only want to load the polyfills and the app code.
entry: [require.resolve('./polyfills'), paths.appIndexJs],
output: {

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

@ -31,7 +31,7 @@
location.pathname.indexOf("/compatibility") == -1) {
// location.href = './compatibility'
location.href = './compatibility.html'
location.href = '/compatibility.html'
}
</script>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,9 @@
/*!
* Cropper.js v1.5.2
* https://fengyuanchen.github.io/cropperjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2019-06-30T06:01:02.389Z
*/.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-canvas,.cropper-wrap-box{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:rgba(51,153,255,.75);overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.33333%;left:0;top:33.33333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.33333%;top:0;width:33.33333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:after,.cropper-center:before{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width:768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width:992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width:1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC")}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -207,6 +207,12 @@ const UsersInfo = Loadable({
loading: Loading,
})
// 兴趣页面
const Interestpage = Loadable({
loader: () => import('./modules/user/Interestpage'),
loading: Loading,
})
class App extends Component {
constructor(props) {
super(props)
@ -324,8 +330,8 @@ class App extends Component {
</Route> */}
{/* <Route path="/myshixuns/:shixunId/stages/:stageId" component={Index}/> */}
{/* 兴趣页面*/}
{/*<Route path="/interest" component={Interestpage}/>*/}
<Route path="/comment" component={CommentComponent}/>
<Route path="/testMaterial" component={TestMaterialDesignComponent}/>
<Route path="/test" component={TestIndex}/>

@ -9,7 +9,16 @@ class Loading extends Component {
// Loading
return (
<div className="App" style={{minHeight: '800px'}}>
<Spin size="large" />
<style>
{
`
.margintop{
margin-top:20%;
}
`
}
</style>
<Spin size="large" className={"margintop"}/>
</div>
);
}

@ -1,4 +1,8 @@
import { bytesToSize } from 'educoder';
export function isImageExtension(fileName) {
return fileName ? !!(fileName.match(/.(jpg|jpeg|png|gif)$/i)) : false
}
export function markdownToHTML(oldContent, selector) {
window.$('#md_div').html('')
// markdown to html

@ -1,6 +1,6 @@
export function bytesToSize(bytes) {
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
if (bytes == 0) return '0 Byte';
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i];
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
if (bytes == 0) return '0 Byte';
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
return parseFloat(bytes / Math.pow(1024, i), 2).toFixed(1) + ' ' + sizes[i];
}

@ -36,6 +36,13 @@ export function getUrl(path, goTest) {
}
return `${path ? path: ''}`;
}
export function getUrl2(path, goTest) {
const local = 'http://localhost:3000'
if (isDev) {
return `${local}${path?path:''}`
}
return `${path ? path: ''}`;
}
export function getUploadActionUrl(path, goTest) {
return `${getUrl()}/api/attachments.json${isDev ? `?debug=${window._debugType || 'admin'}` : ''}`
}

@ -0,0 +1,263 @@
import React, { Component } from 'react';
import { getUrl2 } from 'educoder'
const $ = window.$
let _url_origin = getUrl2()
// let _url_origin = `http://47.96.87.25:48080`;
if (!window.Cropper) {
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/react/public/js/cropper/cropper.min.css`));
$.getScript(
`${_url_origin}/react/public/js/cropper/cropper.js`,
(data, textStatus, jqxhr) => {
});
$.getScript(
`${_url_origin}/react/public/js/cropper/html2canvas.min.js`,
(data, textStatus, jqxhr) => {
});
}
function save_avatar(){
// if($(img_lg).html().trim() == ""){
// $("#avatar-name").html("请先选择图片上传").css("color", 'red');
// } else {
// $("#avatar-name").html("").css("color", '#333');
const previewId = this.props.previewId
var img_lg = document.getElementById(previewId || 'img-preview');
// 截图小的显示框内的内容
window.html2canvas(img_lg).then(function(canvas) {
// for test
// document.getElementById('canvasWrap').appendChild(canvas);
var dataUrl = canvas.toDataURL("image/jpeg");
console.log(dataUrl)
// TODO upload base64 image data to server
});
return
// 老版接口:
// html2canvas(img_lg, {
// allowTaint: true,
// taintTest: false,
// onrendered: function(canvas) {
// canvas.id = "mycanvas";
// //生成base64图片数据
// var dataUrl = canvas.toDataURL("image/jpeg");
// console.log(dataUrl)
// var newImg = document.getElementById("showImg");
// newImg.src = dataUrl;
// return;
// imagesAjax(dataUrl);
// $(".avatar-save").attr("disabled","true");
// }
// });
// }
}
class Cropper extends Component {
state = {
};
handleChange = (info) => {
}
componentDidMount() {
setTimeout(() => {
const image = document.getElementById('image');
const cropper = new window.Cropper(image, {
aspectRatio: 1,
crop(event) {
// console.log(event.detail.x);
// console.log(event.detail.y);
// console.log(event.detail.width);
// console.log(event.detail.height);
// console.log(event.detail.rotate);
// console.log(event.detail.scaleX);
// console.log(event.detail.scaleY);
},
preview: '.img-preview',
});
}, 3000)
}
render() {
const { width, height, previewId, imageSrc } = this.props;
return (
<div>
{/* This rule is very important, please do not ignore this! */}
<style>{`
.wrapper {
width: ${ width || '500px'};
height: ${ height || '500px'};
}
img {
max-width: 100%;
}
.preview-lg {
overflow: hidden;
background-color: #fff;
border-radius: 50%;
text-align: center;
}
`}</style>
<div className="wrapper">
{/* http://localhost:3007/images/footNavLogo.png 图片转了后不对 */}
<img id="image" src={`${imageSrc || "/images/testPicture.jpg"}`}></img>
</div>
{/* background: 'aquamarine',
'border-radius': '128px'
*/}
{!previewId && <div id="img-preview" className="img-preview preview-lg" style={{width: '128px', height: '128px', }}>
</div>}
{/* <img id="showImg" src="http://localhost:3007/images/testPicture.jpg"></img> */}
{/* <div id="canvasWrap"></div> */}
<button onClick={save_avatar.bind(this)}>save </button>
</div>
);
}
}
export default Cropper;
// function aaa () {
// function showedit_headphoto() {
// var html = `
// <script src=\"../head/jquery.min.js\"><\/script>\n
// <link href=\"../head/cropper.min.css\" rel=\"stylesheet\">\n
// <link href=\"../head/sitelogo.css\" rel=\"stylesheet\">\n
// <script src=\"../head/bootstrap.min.js\"><\/script>\n
// <script src=\"../head/cropper.js\"><\/script>\n
// <script src=\"../head/sitelogo.js\"><\/script>\n
// <script src=\"../head/html2canvas.min.js\" type=\"text/javascript\" charset=\"utf-8\"><\/script>\n\n
// <div class=\"task-popup\" style=\"width: 550px;\">\n <div class=\"task-popup-title clearfix task-popup-bggrey\">上传头像<\/div>\n <div class=\"clearfix\">\n
// <div class=\"modal fade\" style=\"outline: none;\" id=\"avatar-modal\" aria-hidden=\"true\" aria-labelledby=\"avatar-modal-label\" role=\"dialog\" tabindex=\"-1\">\n
// <div class=\"modal-dialog modal-lg\">\n <div class=\"modal-content\">\n <form class=\"avatar-form\">\n <div class=\"modal-body\">\n
// <div class=\"padding20\">\n <div class=\"avatar-upload\">\n <input class=\"avatar-src\" name=\"avatar_src\" type=\"hidden\">\n
// <input class=\"avatar-data\" name=\"avatar_data\" type=\"hidden\">\n\n <span id=\"avatar-name\"><\/span>\n
// <input class=\"avatar-input\" style=\"display:none;\" id=\"avatarInput\" value=\"avatars/User/116\" name=\"avatar_file\" type=\"file\">\n
// <input type=\"hidden\" id=\"source_id\" value=\"116\"/>\n <input type=\"hidden\" id=\"source_type\" value=\"User\"/>\n <\/div>\n
// <div class=\"row clearfix mt20 pl20\">\n <div class=\"task-form-45 fl panel-box-sizing uplaodImg\">\n
// <div class=\"avatar-wrapper\" id=\"wrapper_image_show\">\n <!--<span style=\"display: block;\">\n 选择你要上传的图片<br/>
// \n 仅支持JPG、GIF、PNG且文件小于2M\n <\/span>-->\n <\/div>\n
// <div class=\"row avatar-btns clearfix\">\n <a href=\"javascript:void(0);\" class=\"fl\" type=\"button\" onClick=\"$(\'input[id=avatarInput]\').click();\">重新上传<\/a>\n
// <!--<div class=\"btn-group\">\n <a href=\"javascript:void(0);\" class=\"fa fa-repeat fr mt5 color-grey-9\" data-method=\"rotate\" data-option=\"90\"
// type=\"button\" title=\"Rotate 90 degrees\">\n <\/a>\n <\/div>-->\n <\/div>\n <\/div>\n
// <div class=\"task-form-50 panel-box-sizing fr color-grey pr20\" style=\"width: 128px;\">\n <div class=\"edu-txt-center\">\n
// <div class=\"avatar-preview preview-lg radius\" id=\"imageHead\">\n
// <img alt=\"头像\" height=\"128\" nhname=\"avatar_image\" src=\"/images/avatars/User/116?1556802838\" width=\"128\" />\n <\/div>\n
// <span>头像预览<\/span>\n <\/div>\n
// <p class=\"color-grey-9 font-12 mt110 justify\">仅支持JPG、GIF、PNG且文件小于2M<\/p>\n <\/div>\n <\/div>\n
// <\/div>\n <div class=\"clearfix edu-txt-center mb20 mt10\">\n
// <a href=\"javascript:void(0);\" class=\"task-btn mr20\" onclick=\"hideModal()\">取消<\/a>\n
// <a href=\"javascript:void(0);\" class=\"avatar-save task-btn task-btn-orange\" data-dismiss=\"modal\">确定<\/a>\n
// <\/div>\n <\/div>\n <\/form>\n <\/div>\n <\/div>\n <\/div>\n <\/div>\n<\/div>\n\n<script>\n
// $(function () {\n new CropAvatar($(\'#crop-avatar\'), 1/1);\n\n //---------------------------头像上传-----------------------------//\n //做个下简易的验证 大小 格式\n $(\'#avatarInput\').on(\'change\', function(e) {\n var filemaxsize = 1024 * 5;//5M\n var target = $(e.target);\n var Size = target[0].files[0].size / 1024;\n if(Size > filemaxsize) {\n alert(\'图片过大,请重新选择!\');\n $(\".avatar-wrapper\").children().remove;\n return false;\n }\n if(!this.files[0].type.match(/image.*/)) {\n alert(\'请选择正确的图片!\')\n } else {\n /*var filename = document.querySelector(\"#avatar-name\");*/\n var texts = document.querySelector(\"#avatarInput\").value;\n var teststr = texts; //你这里的路径写错了\n testend = teststr.match(/[^\\\\]+\\.[^\\(]+/i); //直接完整文件名的\n /*filename.innerHTML = testend;\n $(filename).css(\"color\", \'#333\');*/\n $(\".avatar-save\").removeClass(\"task-btn-grey\").addClass(\"task-btn-orange\");\n $(\".avatar-save\").on(\"click\", save_avatar);\n }\n\n });\n });\n\n function save_avatar(){\n var img_lg = document.getElementById(\'imageHead\');\n if($(img_lg).html().trim() == \"\"){\n $(\"#avatar-name\").html(\"请先选择图片上传\").css(\"color\", \'red\');\n } else {\n $(\"#avatar-name\").html(\"\").css(\"color\", \'#333\');\n // 截图小的显示框内的内容\n html2canvas(img_lg, {\n allowTaint: true,\n taintTest: false,\n onrendered: function(canvas) {\n canvas.id = \"mycanvas\";\n //生成base64图片数据\n var dataUrl = canvas.toDataURL(\"image/jpeg\");\n var newImg = document.createElement(\"img\");\n newImg.src = dataUrl;\n imagesAjax(dataUrl);\n $(\".avatar-save\").attr(\"disabled\",\"true\");\n }\n });\n }\n }\n\n function imagesAjax(src) {\n var data = {};\n data.img = src;\n data.source_id = $(\'#source_id\').val();\n data.source_type = $(\'#source_type\').val();\n data.is_direct = 0;\n $.ajax({\n url: \"/upload_avatar\",\n beforeSend: function(xhr) {xhr.setRequestHeader(\'X-CSRF-Token\', $(\'meta[name=\"csrf-token\"]\').attr(\'content\'))},\n data: data,\n type: \"POST\",\n success: function (re) {\n console.log(re);\n console.log(1562050370);\n if(re){\n var o = JSON.parse(re);\n if (o.status !=0 ){\n console.log(o.message);\n } else {\n var imgSpan = $(\"img[nhname=\'avatar_image\']\");\n imgSpan.attr({\"src\": o.url + \'?1562050370\'});\n $(\"#user_code\").html(o.grade);\n notice_box_redirect(\"/users/shitou\", \"上传成功\");\n }\n } else {\n notice_box(\"上传出错\");\n }\n\n },\n error: function (e) {\n alert(e);\n }\n });\n }\n
// <\/script>`;
// pop_box_new(html, 550, 510);
// $("#imageHead img").attr({"src": $("#user_avatar_show").attr("src")});
// $("#wrapper_image_show img").attr({"src": $("#user_avatar_show").attr("src")});
// }
// $(function () {
// new CropAvatar($('#crop-avatar'), 1/1);
// //---------------------------头像上传-----------------------------//
// //做个下简易的验证 大小 格式
// $('#avatarInput').on('change', function(e) {
// var filemaxsize = 1024 * 5;//5M
// var target = $(e.target);
// var Size = target[0].files[0].size / 1024;
// if(Size > filemaxsize) {
// alert('图片过大,请重新选择!');
// $(".avatar-wrapper").children().remove;
// return false;
// }
// if(!this.files[0].type.match(/image.*/)) {
// alert('请选择正确的图片!')
// } else {
// /*var filename = document.querySelector("#avatar-name");*/
// var texts = document.querySelector("#avatarInput").value;
// var teststr = texts; //你这里的路径写错了
// testend = teststr.match(/[^\\\\]+\\.[^\\(]+/i); //直接完整文件名的
// /*filename.innerHTML = testend; $(filename).css("color", '#333');*/
// $(".avatar-save").removeClass("task-btn-grey").addClass("task-btn-orange");
// $(".avatar-save").on("click", save_avatar);
// }
// });
// });
// function save_avatar(){
// var img_lg = document.getElementById('imageHead');
// if($(img_lg).html().trim() == ""){
// $("#avatar-name").html("请先选择图片上传").css("color", 'red');
// } else {
// $("#avatar-name").html("").css("color", '#333');
// // 截图小的显示框内的内容
// html2canvas(img_lg, {
// allowTaint: true,
// taintTest: false,
// onrendered: function(canvas) {
// canvas.id = "mycanvas";
// //生成base64图片数据
// var dataUrl = canvas.toDataURL("image/jpeg");
// var newImg = document.createElement("img");
// newImg.src = dataUrl;
// imagesAjax(dataUrl);
// $(".avatar-save").attr("disabled","true");
// }
// });
// }
// }
// function imagesAjax(src) {
// var data = {};
// data.img = src;
// data.source_id = $('#source_id').val();
// data.source_type = $('#source_type').val();
// data.is_direct = 0;
// $.ajax({
// url: "/upload_avatar",
// beforeSend: function(xhr) {
// xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'))
// },
// data: data,
// type: "POST",
// success: function (re) {
// console.log(re);
// // console.log(1562050370);
// if(re){
// var o = JSON.parse(re);
// if (o.status !=0 ){
// console.log(o.message);
// } else {
// var imgSpan = $("img[nhname='avatar_image']");
// imgSpan.attr({"src": o.url + '?1562050370'});
// $("#user_code").html(o.grade);
// notice_box_redirect("/users/shitou", "上传成功");
// }
// } else {
// notice_box("上传出错");
// }
// },
// error: function (e) {
// alert(e);
// }
// });
// }
// }

@ -2,7 +2,7 @@ import { from } from '_array-flatten@2.1.2@array-flatten';
// export { default as OrderStateUtil } from '../routes/Order/components/OrderStateUtil';
export { getImageUrl as getImageUrl, getUrl as getUrl,setImagesUrl as setImagesUrl, getUploadActionUrl as getUploadActionUrl } from './UrlTool';
export { getImageUrl as getImageUrl, getUrl as getUrl, getUrl2 as getUrl2, setImagesUrl as setImagesUrl, getUploadActionUrl as getUploadActionUrl } from './UrlTool';
export { default as queryString } from './UrlTool2';
export { SnackbarHOC as SnackbarHOC } from './SnackbarHOC';
@ -14,7 +14,7 @@ export { updatePageParams as updatePageParams } from './RouterUti
export { bytesToSize as bytesToSize } from './UnitUtil';
export { markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll } from './TextUtil'
export { markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll, isImageExtension } from './TextUtil'
export { handleDateString, getNextHalfHourOfMoment,formatDuring } from './DateUtil'

@ -6,6 +6,8 @@ import Loading from '../../Loading';
import axios from 'axios';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import { CNotificationHOC } from './common/CNotificationHOC'
import {ImageLayerOfCommentHOC} from '../page/layers/ImageLayerOfCommentHOC'
import "./css/Courses.css"
//引入对应跳转的组件
@ -862,4 +864,4 @@ class CoursesIndex extends Component{
}
}
export default CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(CoursesIndex) ));
export default ImageLayerOfCommentHOC({imgSelector: '.imageLayerParent img, .imageLayerParent .imageTarget', parentSelector: '.newMain'}) (CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(CoursesIndex) )));

@ -33,16 +33,15 @@ class Fileslistitem extends Component{
axios.get(url,{
params:{
course_id:coursesId
}
},
}).then((result)=>{
if(result.data.attachment_histories.length===0){
let link = document.createElement('a');
// link.href = window.URL.createObjectURL(new Blob([result.data.url]));
document.body.appendChild(link);
link.href = result.data.url;
link.download = result.data.title;
//兼容火狐浏览器
document.body.appendChild(link);
let evt = document.createEvent("MouseEvents");
evt.initEvent("click", false, false);
link.dispatchEvent(evt);
@ -201,13 +200,13 @@ class Fileslistitem extends Component{
<span className="fl mr12 mt3">
{checkBox}
</span>
{
this.props.isAdmin ? <a
// href={"/courses/" + coursesId + "/graduation/graduation_tasks/" + categoryid + "/" + taskid + "/list"}
onClick={this.showfiles}
title={discussMessage.title}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</a> : ""
}
{
this.props.isAdmin ? <a
// href={"/courses/" + coursesId + "/graduation/graduation_tasks/" + categoryid + "/" + taskid + "/list"}
onClick={this.showfiles}
title={discussMessage.title}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</a> : ""
}
{
this.props.isStudent? <a
onClick={this.showfiles}
@ -233,11 +232,7 @@ class Fileslistitem extends Component{
</Tooltip>
:""
}
{discussMessage.is_publish===true?"":<CoursesListType typelist={["未发布"]} typesylename={""}/>}
{discussMessage.is_publish===false?<CoursesListType typelist={["未发布"]} typesylename={""}/>:""}
</h6>
<style>
{
@ -292,7 +287,16 @@ class Fileslistitem extends Component{
{ discussMessage.publish_time===null?"":discussMessage.is_publish===true?moment(discussMessage.publish_time).fromNow():moment(discussMessage.publish_time).format('YYYY-MM-DD HH:mm')}
</span>
</span>
{this.props.isAdmin ||this.props.current_user.login===discussMessage.author.login?
{this.props.isAdmin?
<span className={"fr mrf2 mr10"}>
<WordsBtn style="blue" className="colorblue font-16 mr20 fr">
<a className="btn colorblue"
onClick={()=>this.settingList()}>设置</a>
</WordsBtn>
</span>:""}
{this.props.isStudent===true&&this.props.current_user.login===discussMessage.author.login?
<span className={"fr mrf2 mr10"}>
<WordsBtn style="blue" className="colorblue font-16 mr20 fr">

@ -7,11 +7,12 @@ import Sendtofilesmodal from "../coursesPublic/SendToFilesModal";
import Selectresource from "../coursesPublic/SelectResource";
import Sendresource from "../coursesPublic/sendResource";
import Selectsetting from "../coursesPublic/SelectSetting";
import CourseLayoutcomponent from '../common/CourseLayoutComponent';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import Fileslistitem from './Fileslistitem';
import Titlesearchsection from '../common/titleSearch/TitleSearchSection';
import './style.css';
import '../css/members.css';
import moment from 'moment';
class Fileslists extends Component{
constructor(props){
@ -41,7 +42,9 @@ class Fileslists extends Component{
}
componentDidMount=()=>{
this.setState({
isSpin:true
isSpin:true,
checkBoxValues:[],
checkAllValue:false
})
if(this.props.match.params.main_id){
this.seactall();
@ -50,6 +53,7 @@ class Fileslists extends Component{
}
this.updadatalist();
on('updateNavSuccess', this.updateNavSuccess)
on('updateNavSuccess',this.updadatalist)
}
updateNavSuccess=()=>{
@ -64,17 +68,21 @@ class Fileslists extends Component{
}
componentDidUpdate = (prevProps) => {
if(prevProps.match.params.main_id != this.props.match.params.main_id){
this.setState({
isSpin:true
})
this.setState({
isSpin:true,
checkBoxValues:[],
checkAllValue:false
})
if(this.props.match.params.main_id!=undefined){
this.seactall();
}
}
if(prevProps.match.params.Id != this.props.match.params.Id){
this.setState({
isSpin:true
})
this.setState({
isSpin:true,
checkBoxValues:[],
checkAllValue:false
})
if(this.props.match.params.Id!=undefined){
this.seactall(parseInt(this.props.match.params.Id),1)
}
@ -118,7 +126,6 @@ class Fileslists extends Component{
})
}
updatafiled=()=>{
debugger
if(this.props.match.params.main_id){
this.seactall();
}else if(this.props.match.params.Id){
@ -226,7 +233,9 @@ class Fileslists extends Component{
this.props.showNotification("请先在列表中选择要发送的资源");
}else if(value===3){
this.props.showNotification("请先在列表中选择要公开的资源");
}
}else if(value===4){
this.props.showNotification("请先在列表中选择要发布的资源");
}
}
onDelete = () => {
@ -526,8 +535,6 @@ class Fileslists extends Component{
})
.then((response) => {
if (response.data.status == 0) {
this.seactall();
this.setState({
// Modalstype:true,
// Modalstopval:response.data.message,
@ -535,16 +542,88 @@ class Fileslists extends Component{
// ModalSave:this.cancelmodel,
// Loadtype:true,
checkBoxValues:[],
// checkAllValue:false
checkAllValue:false
})
this.updatafiled()
this.props.showNotification('资源移动成功')
this.props.updataleftNavfun()
this.updatafiled()
}
})
}
homeworkstart=()=>{
let selectnum= this.testonSelect();
if(selectnum===true){
this.noSelect(4);
return
}
let starttime= this.props.getNowFormatDates(1);
let endtime=this.props.getNowFormatDates(2);
this.setState({
modalname:"立即发布",
visible:true,
typs:"start",
Topval:"学生将能立即查看和下载发布资源",
// Botvalleft:"暂不发布",
// Botval:`本操作只对"未发布"的分班有效`,
// starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
// starttimes:starttime,
// endtime:"截止时间:"+endtime,
Cancelname:"暂不发布",
Savesname:"立即发布",
Cancel:this.homeworkhide,
Saves:this.homeworkstartend,
})
}
// 立即发布
homeworkstartend=(ds,endtime)=>{
let {checkBoxValues}=this.state;
let coursesId=this.props.match.params.coursesId;
let url ="/files/bulk_publish.json";
axios.put(url, {
course_id:coursesId,
ids :checkBoxValues,
}).then((result)=>{
if(result.status===200){
this.props.showNotification("发布成功")
this.setState({
checkBoxValues:[],
checkAllValue:false
})
this.homeworkhide()
this.props.updataleftNavfun()
this.updatafiled()
}
}).catch((error)=>{
console.log(error);
})
}
homeworkhide=()=>{
this.setState({
modalname:undefined,
modaltype:undefined,
visible:false,
Topval:undefined,
Topvalright:undefined,
Botvalleft:undefined,
Botval:undefined,
starttime:undefined,
endtime:undefined,
Cancelname:undefined,
Savesname:undefined,
Cancel:undefined,
Saves:undefined,
StudentList_value:undefined,
addname:undefined,
addnametype:false,
addnametab:undefined,
typs:undefined,
starttimes:undefined,
})
}
render(){
let { searchValue,
@ -577,6 +656,26 @@ class Fileslists extends Component{
return(
<React.Fragment >
{/*立即发布*/}
{this.state.visible===true?<HomeworkModal
category_id={this.props.match.params.category_id}
modaltype={this.state.modaltype}
modalname={this.state.modalname}
visible={this.state.visible}
Topval={this.state.Topval}
Topvalright={this.state.Topvalright}
Botvalleft={this.state.Botvalleft}
Botval={this.state.Botval}
starttime={this.state.starttime}
starttimes={this.state.starttimes}
typs={this.state.typs}
endtime={this.state.endtime}
Cancelname={this.state.Cancelname}
Savesname={this.state.Savesname}
Cancel={this.state.Cancel}
Saves={this.state.Saves}
course_groups={this.state.course_groups}
/>:""}
{/*发送*/}
<Sendtofilesmodal
@ -682,6 +781,9 @@ class Fileslists extends Component{
<div className="studentList_operation_ul">
{this.props.isAdmin()?<li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onDelete}>删除</a></li>:""}
{this.props.isAdmin()?<li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onSend}>发送</a></li>:""}
{this.props.isAdmin()?
<li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.homeworkstart}>立即发布</a></li>
:""}
{this.props.isAdmin()?course_is_public===true?
<li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onOpen}>设为公开</a></li>
:"":""}
@ -786,7 +888,7 @@ class Fileslists extends Component{
isAdmin={this.props.isAdmin()}
isStudent={this.props.isStudent()}
isNotMember={this.props.isNotMember()}
checkBox={<Checkbox value={item.id}></Checkbox>}
checkBox={this.props.isAdmin()?<Checkbox value={item.id}></Checkbox>:""}
Settingtypes={(id)=>this.Settingtypes(id)}
coursesId={this.props.match.params.coursesId}
updatafiledfun={()=>this.updatafiled()}
@ -831,7 +933,7 @@ class Fileslists extends Component{
<div className="alltask edu-back-white"
style={
{
display: total_count===undefined?'block' :total_count===0? 'block' : 'none'
display: files===undefined?'block' :files.length===0? 'block' : 'none'
}
}
>

@ -26,7 +26,8 @@ class BoardsNew extends Component{
this.state = {
fileList: [],
boards: []
boards: [],
title_num: 60
}
}
addSuccess = () => {
@ -93,7 +94,8 @@ class BoardsNew extends Component{
status: 'done'
}
})
this.setState({ fileList: _fileList, board_name: data.board_name })
this.setState({ fileList: _fileList, board_name: data.board_name, title_num: 60 - parseInt(data.subject.length) })
}
}
})
@ -228,8 +230,14 @@ class BoardsNew extends Component{
});
}
// 附件相关 ------------ END
changeTitle=(e)=>{
console.log(e.target.value.length);
this.setState({
title_num: 60 - parseInt(e.target.value.length)
})
}
render() {
let { addGroup, fileList, course_id } = this.state;
let { addGroup, fileList, course_id, title_num } = this.state;
const { getFieldDecorator } = this.props.form;
const formItemLayout = {
@ -303,21 +311,28 @@ class BoardsNew extends Component{
返回
</a>
</p>
{/* notRequired */}
<Form {...formItemLayout} onSubmit={this.handleSubmit}>
<div className="formBlock" style={{paddingBottom: '0px'}}>
<div className="formBlock" style={{paddingBottom: '0px', position: 'relative'}}>
{ isAdmin &&
<React.Fragment>
{getFieldDecorator('sticky', {
valuePropName: 'checked',
})(
isAdmin && <Checkbox style={{ right: '22px',
top: '28px',
position: 'absolute'
}}>置顶</Checkbox>
)}
{/* checkbox 有个边距样式 .ant-checkbox-wrapper + span, */}
<span style={{ "padding-left": 0, "padding-right": 0 }}></span>
</React.Fragment>
}
<Form.Item
label="标题"
className="topicTitle "
>
{getFieldDecorator('sticky', {
valuePropName: 'checked',
})(
<Checkbox style={{ right: '0px',
top: '-50px',
position: 'absolute'
}}>置顶</Checkbox>
)}
{getFieldDecorator('subject', {
rules: [{
required: true, message: '请输入标题',
@ -325,7 +340,8 @@ class BoardsNew extends Component{
max: 60, message: '最大限制为60个字符',
}],
})(
<Input placeholder="请输入帖子标题最大限制60个字符" className="searchViewAfter"/>
<Input placeholder="请输入帖子标题最大限制60个字符" className="searchViewAfter" maxLength="60"
onInput={this.changeTitle} addonAfter={String(title_num)} />
)}
</Form.Item>

@ -237,16 +237,16 @@ class TopicDetail extends Component {
// </a>
// </p>
<div className="color-grey" key={index}>
<a className="color-grey ml20">
<div className="color-grey df" key={index}>
<a className="color-grey ">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
{fileName && <ConditionToolTip title={fileName} condition={fileName.length > 30 }>
<a href={item.url}
className="mr12 color9B9B" length="58">
{/* {fileName && <ConditionToolTip title={fileName} condition={fileName.length > 30 }> </ConditionToolTip>} */}
<a href={item.url} title={fileName.length > 30 ? fileName : ''}
className="mr12 color9B9B overflowHidden1" length="58" style={{maxWidth: '480px'}}>
{fileName}
</a>
</ConditionToolTip>}
<span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span>
@ -416,7 +416,7 @@ class TopicDetail extends Component {
const user = this._getUser();
this.setState({
comments: addNewComment(comments, _id, content, user, this)
comments: addNewComment(comments, _id, content, user, this.props.isSuperAdmin(), this)
})
const newMemo2 = Object.assign({}, this.state.memo);
newMemo2.total_replies_count = newMemo2.total_replies_count + 1;
@ -540,6 +540,10 @@ class TopicDetail extends Component {
padding-bottom: 20px;
margin-bottom: 0px !important;
}
.course-message.topicDetail .panel-comment_item .comment_orig_content {
width: 1072px;
}
`}</style>
<CBreadcrumb className={'independent'} items={[
{ to: `/courses/${courseId}`, name: this.props.coursedata.name},
@ -646,7 +650,7 @@ class TopicDetail extends Component {
<div className="padding30 memoContent new_li" style={{ paddingBottom: '10px'}}>
<MarkdownToHtml content={memo.content}></MarkdownToHtml>
</div>
<div className="padding40 bor-bottom-greyE" style={{paddingTop: '2px'}}>
<div className="padding30 bor-bottom-greyE" style={{paddingTop: '2px'}}>
<div className="mt10 mb20">
{/* ${memo.user_praise ? '' : ''} */}
<Tooltip title={`${memo.liked ? '取消点赞' : '点赞'}`}>
@ -701,11 +705,13 @@ class TopicDetail extends Component {
</div>} */}
</div>
{ total_count > REPLY_PAGE_COUNT &&
<div className="memoMore">
<Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10}/>
<div className="memoMore" style={{'margin-top': '20px'}}>
{ total_count > REPLY_PAGE_COUNT &&
<Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10}/>
}
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
</div> }
</div>
</div>
</div>

@ -218,6 +218,9 @@ class Boards extends Component{
}
onPressEnter = (e) => {
clearTimeout(this.timeoutHandler)
this.timeoutHandler = null;
this.fetchAll(this.state.searchValue, 1)
}
onInputSearchChange = (e) => {
@ -227,6 +230,7 @@ class Boards extends Component{
if (this.timeoutHandler) {
clearTimeout(this.timeoutHandler)
this.timeoutHandler = null;
}
this.timeoutHandler = setTimeout(() => {
this.fetchAll(this.state.searchValue, 1)
@ -345,7 +349,7 @@ class Boards extends Component{
<React.Fragment>
{ isAdmin && !parent_id && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>添加目录</WordsBtn> }
{ isAdmin && !!parent_id && <WordsBtn style="blue" className="mr30" onClick={()=>this.renameDir()}>目录重命名</WordsBtn> }
{ isAdminOrStudent && <WordsBtn style="blue" className="" onClick={()=>this.onToBoardsNew()}>我要发</WordsBtn> }
{ isAdminOrStudent && <WordsBtn style="blue" className="" onClick={()=>this.onToBoardsNew()}>我要发</WordsBtn> }
</React.Fragment>
}
secondRowLeft={
@ -359,7 +363,7 @@ class Boards extends Component{
<FilesListItem></FilesListItem> */}
<div className="mt20 edu-back-white padding20-30">
{isAdmin && <div className="mt20 edu-back-white padding20-30">
<div className="clearfix">
{isAdmin && <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues.length} </Checkbox>}
<div className="studentList_operation_ul">
@ -406,6 +410,7 @@ class Boards extends Component{
</div>
</div>
</div>
}
<style>{`
.panel-inner-fourm {
border-bottom: none;

@ -179,7 +179,7 @@ class CommonWorkAppraise extends Component{
{/* <div className="padding40 memoContent new_li">
</div> */}
<div className={"appraise "} style={{}}>
<div className={"appraise imageLayerParent "} style={{}}>
<style>{`
.workAppraise>div:last-child {
border-bottom: none !important;
@ -199,8 +199,9 @@ class CommonWorkAppraise extends Component{
<a className="color-grey ml20">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<a href={item.url}
className="mr12 color9B9B" length="58" title={`${item.title && item.title.length > 40 ? item.title : ''}`}>
className="mr12 color9B9B imageTarget" length="58" title={`${item.title && item.title.length > 40 ? item.title : ''}`}>
{item.title}
</a>
<span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span>
@ -253,7 +254,7 @@ class CommonWorkAppraise extends Component{
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<a href={item.url}
className="mr12 color9B9B" length="58">
className="mr12 color9B9B imageTarget" length="58">
{item.title}
</a>
<span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span>

@ -248,7 +248,7 @@ function buildColumns(that, student_works) {
*/
columns.push({
width: 84,
title: <div style={{fontWeight:'bold'}}><div style={{fontWeight:'bold'}}>匿评</div></div>,
title: <div style={{color: 'rgba(0,0,0,.85)'}}><div style={{color: 'rgba(0,0,0,.85)'}}>匿评</div></div>,
key: 'student_score',
dataIndex: 'student_score',

@ -369,7 +369,7 @@ class NewWork extends Component{
</p> */}
<CBreadcrumb items={[
{ to: `/courses/${courseId}`, name: this.state.course_name},
{ to: `/courses/${courseId}/${moduleEngName}/${category && category.category_id ? category.category_id : ''}`, name: category.category_name },
{ to: `/courses/${courseId}/${moduleEngName}/${category && category.category_id ? category.category_id : ''}`, name: moduleName },
{ name: `${ this.isEdit ? '编辑' : '新建'}` }
]}></CBreadcrumb>

@ -252,7 +252,7 @@ class UseBank extends Component{
<div style={{"height":"230px"}} className="d_middle edu-txt-center">
<div>
<p className="font-16 mb20 color-grey-3">通过职业认证的教师才能访问公共题库</p>
<a className="white-btn edu-orangeback-btn" target="_blank" href="https://www.educoder.net/account/professional_certification">立即认证</a>
<a className="white-btn edu-orangeback-btn" target="_blank" href="/account/professional_certification">立即认证</a>
</div>
</div>
:

@ -128,7 +128,7 @@ class commonWork extends Component{
}
//筛选条件
selectedStatus=(e)=>{
this.clearSelection()
this.setState({
order:e.key==="all"?"":e.key,
page:1,

@ -26,7 +26,7 @@ class ModalWrapper extends Component{
return(
<Modal
title={ title || "题库选用" }
title={ title }
visible={visible}
closable={false}
width={ width || "600px" }

@ -18,6 +18,10 @@
.courseForm .ant-form-item-label {
margin-left: -10px;
}
.courseForm .notRequired .ant-form-item-label {
margin-left: 0px;
}
/* 不知道被哪个样式影响,这里需要重置 */
.courseForm .ant-input:focus {

@ -825,9 +825,9 @@ class Coursesleftnav extends Component{
{ is_teacher===true?
course_modules===undefined?"":course_modules.map((item,key)=>{
return(
<div key={key} >
<div key={key} >
<a>
<li onClick={(e)=>this.showsandians(e,key,item.category_url,1)} className={this.props.mainurl===item.category_url&&key===this.props.indexs?"liactive":"clearfix active"} onMouseLeave={(e)=>this.hidesandian(e,key)} onMouseEnter={(e)=>this.showsandian(e,key)}>
<li title={item.name.length<7?"":item.name} onClick={(e)=>this.showsandians(e,key,item.category_url,1)} className={this.props.mainurl===item.category_url&&key===this.props.indexs?"liactive":"clearfix active"} onMouseLeave={(e)=>this.hidesandian(e,key)} onMouseEnter={(e)=>this.showsandian(e,key)}>
<a onClick={(e)=>this.showsandians(e,key,item.category_url,1)} className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}>
{
item.type==="shixun_homework"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-daima mr10 fl":"iconfont icon-daima mr10 fl"}></i>:
@ -844,7 +844,6 @@ class Coursesleftnav extends Component{
{/*||this.props.location.pathname===this.state.url&&key===this.state.indexs*/}
<span className={this.props.location.pathname===item.category_url?"color-blue task-hide activity-left-name":"task-hide activity-left-name"}
title={item.name.length<6?"":item.name}
onClick={(e)=>this.selectnavid(e,key,item.id,item.type,item.category_url)}
>{item.name}</span>
@ -901,6 +900,7 @@ class Coursesleftnav extends Component{
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
title={iem.category_name.length<10?"":iem.category_name}
>
<a className="fl pl46 pd0 Draggablelichild">
@ -940,6 +940,7 @@ class Coursesleftnav extends Component{
<a >
<li className={this.props.mainurl===item.category_url&&key===this.props.indexs?"liactive":"clearfix active"}
onClick={(e)=>this.setnavid(e,key,item.id,item.type,item.category_url)} onMouseEnter={(e)=>this.showsandian(e,key)}
title={item.name.length<7?"":item.name}
>
<a className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}>
{
@ -977,7 +978,7 @@ class Coursesleftnav extends Component{
}
return(
<a >
<li className="clearfix Draggableli" key={index} style={{ width: '244px'}}>
<li className="clearfix Draggableli" key={index} style={{ width: '244px'}} title={iem.category_name.length<10?"":iem.category_name}>
<a className="fl pl46 pd0 Draggablelichild" onClick={(e)=>this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} >
{/*<span className="fl ml38 maxwidth155 task-hide">{iem.category_name}</span>*/}

@ -153,14 +153,14 @@ class Addcourses extends Component{
this.setState({
invite_codetype:true,
invite_codevalue:"邀请码不能为空",
spinning:false
isSpin:false
})
return
}else{
this.setState({
invite_codetype:false,
invite_codevalue:" ",
spinning:false
isSpin:false
})
}
@ -217,12 +217,12 @@ class Addcourses extends Component{
}
this.setState({
spinning:false
isSpin:false
})
}).catch((error) => {
console.log(error)
this.setState({
spinning:false
isSpin:false
})
})
@ -313,7 +313,7 @@ class Addcourses extends Component{
<li className="clearfix mb10">
<label className="panel-form-label fl">课堂邀请码</label>
<Input type="text" className="input-60-40 fl mt5" name="invite_code"
placeholder="请输入五位课堂邀请码"
placeholder="请输入5位课堂邀请码或6位分班邀请码"
style={{ height: '30px'}}
value={invite_code} onInput={this.inputjoinclassvalue}/>
</li>
@ -321,7 +321,7 @@ class Addcourses extends Component{
<p id="none_invite_code_notice"
className="color-orange none f12"
// style={{marginLeft: '90px',display:code_notice===true?'block':"none"}}
>请输入五位课堂邀请码</p>
>请输入5位课堂邀请码或6位分班邀请码</p>
<li className="clearfix ">

@ -88,25 +88,30 @@ class HomeworkModal extends Component{
propsSaves=(ds,endtime)=>{
if(this.props.typs!="end"){
if(endtime === ""||endtime===undefined||endtime===null){
if(ds.length ===0&&endtime === ""){
this.props.Saves()
}else{
if(this.props.typs!="end"){
if(endtime === ""||endtime===undefined||endtime===null){
this.setState({
endtimetype:true,
endtimetypevalue:"截止时间不能为空"
})
return
}
this.setState({
endtimetype:true,
endtimetypevalue:"截止时间不能为空"
})
return
}
if(moment(endtime,"YYYY-MM-DD HH:mm") <= moment(this.props.starttimes,"YYYY-MM-DD HH:mm")){
this.setState({
endtimetype:true,
endtimetypevalue:"必须晚于发布时间"
})
return
if(moment(endtime,"YYYY-MM-DD HH:mm") <= moment(this.props.starttimes,"YYYY-MM-DD HH:mm")){
this.setState({
endtimetype:true,
endtimetypevalue:"必须晚于发布时间"
})
return
}
}
this.props.Saves(ds,moment(handleDateString(endtime),"YYYY-MM-DD HH:mm").format("YYYY-MM-DD HH:mm"))
}
this.props.Saves(ds,moment(handleDateString(endtime),"YYYY-MM-DD HH:mm").format("YYYY-MM-DD HH:mm"))
}

@ -1,11 +1,7 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Select,Input,Tooltip } from "antd";
import { Modal,Checkbox,Select,Input,Tooltip,Spin,Icon } from "antd";
import axios from'axios';
import Loading from '@icedesign/base/lib/loading';
import '@icedesign/base/lib/loading/style.js';
import Modals from '../../modals/Modals';
const Option = Select.Option;
const Search = Input.Search;
class PathModal extends Component{
constructor(props){
@ -126,7 +122,7 @@ class PathModal extends Component{
render(){
let {Searchvalue,type,Modalstype}=this.state;
let {visible,shixunmodallist,hometypepvisible,newshixunmodallist}=this.props;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return(
<div>
@ -148,8 +144,7 @@ class PathModal extends Component{
width="840px"
destroyOnClose={true}
>
<Loading visible={false} shape="dot-circle" color='#4AC7FF'>
<Spin indicator={antIcon} spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<div className="newupload_conbox">
{ shixunmodallist && shixunmodallist.tags.length===0?"":<div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
@ -203,7 +198,6 @@ class PathModal extends Component{
<div className="over210 pl20 pr20"
onScroll={this.contentViewScrolledit}
style={{"Height":"204px"}}>
<Loading visible={hometypepvisible} shape="dot-circle" className="newnext-loading" color='#4AC7FF'>
<Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}>
{
newshixunmodallist&&newshixunmodallist.map((item,key)=>{
@ -229,7 +223,6 @@ class PathModal extends Component{
})
}
</Checkbox.Group>
</Loading>
</div>
{ this.state.patheditarrytype===true?<span className={"color-red"}>{this.state.patheditarryvalue}</span>:""}
<div className="mt20 marginauto clearfix edu-txt-center">
@ -237,7 +230,7 @@ class PathModal extends Component{
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.savecouseShixunModal}>确定</a>
</div>
</div>
</Loading>
</Spin>
</Modal>
</div>
)

@ -1,9 +1,7 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Select,Input} from "antd";
import { Modal,Checkbox,Select,Input,Spin,Icon} from "antd";
import axios from'axios';
import NoneData from "../coursesPublic/NoneData";
import Loading from '@icedesign/base/lib/loading';
import '@icedesign/base/lib/loading/style.js';
import Modals from '../../modals/Modals';
const Option = Select.Option;
@ -244,7 +242,7 @@ class Selectresource extends Component{
render(){
let {Searchvalue,type,category_id,Resourcelist,hometypepvisible,patheditarry}=this.state;
let {visible,shixunmodallist}=this.props;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return(
<div>
{/*提示*/}
@ -275,8 +273,8 @@ class Selectresource extends Component{
`
}
</style>
<Loading visible={false} shape="dot-circle" color='#4AC7FF'>
<Spin indicator={antIcon} spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<style>{`
.newupload_conboxtop{
margin-top: -30px;
@ -343,8 +341,8 @@ class Selectresource extends Component{
>
{
Resourcelist === undefined ? "":
<Loading visible={hometypepvisible} shape="dot-circle" className="newnext-loading" color='#4AC7FF'>
Resourcelist === undefined ?"":Resourcelist.files.length===0?<NoneData/>:
<Checkbox.Group style={{ width: '100%' }} value={patheditarry} onChange={this.shixunhomeworkedit}>
{
Resourcelist.files.map((item,key)=>{
@ -368,8 +366,7 @@ class Selectresource extends Component{
})
}
</Checkbox.Group>
{ Resourcelist.files.length===0?<NoneData/>:""}
</Loading>
}
</div>
@ -382,7 +379,7 @@ class Selectresource extends Component{
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.savecouseShixunModal}>确定</a>
</div>
</div>
</Loading>
</Spin>
</Modal>:""}
</div>
)

@ -1,7 +1,7 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Select,Input,Upload,Button,Icon,message,DatePicker,Tooltip} from "antd";
import axios from'axios';
import {getUrl,handleDateString} from 'educoder';
import {getUrl,handleDateString,appendFileSizeToUploadFileAll} from 'educoder';
import locale from 'antd/lib/date-picker/locale/zh_CN';
import moment from 'moment';
import Modals from '../../modals/Modals';
@ -252,12 +252,12 @@ class Selectsetting extends Component{
let fileList = info.fileList;
if(info.file.status!="removed"){
this.setState({
fileList,
fileList: appendFileSizeToUploadFileAll(fileList),
fileListtype:true
});
}else{
this.setState({
fileList,
fileList: appendFileSizeToUploadFileAll(fileList),
});
}
@ -290,10 +290,10 @@ class Selectsetting extends Component{
// }
onAttachmentRemove = (id) => {
onAttachmentRemove = (file) => {
// const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
const url = `/attachments/${id}.json`
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, {
})
.then((response) => {
@ -319,6 +319,9 @@ class Selectsetting extends Component{
.catch(function (error) {
console.log(error);
});
this.setState({
fileListtype:false,
})
}
onChangeTimepublishs= (date, dateString,key) => {
@ -373,7 +376,7 @@ class Selectsetting extends Component{
width: 600,
// https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
showUploadList: false,
// showUploadList: false,
action: `${getUrl()}/api/attachments.json`,
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
@ -591,36 +594,36 @@ class Selectsetting extends Component{
</Upload>
</p>
<style>
{
`
.maxwidth400{
max-width: 400px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
`
}
</style>
{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{
return(
<p className="color-grey mt10" key={key} >
<a className="color-grey fl">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<span className="mr12 color9B9B maxwidth400 fl" length="58">
{item.name}
</span>
<span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.response===undefined?"":isNaN(this.props.bytesToSize(item.response.filesize))?"123":this.props.bytesToSize(item.response.filesize)}
</span>
<i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id}
aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>
</p>
)
})}
{/*<style>*/}
{/*{*/}
{/*`*/}
{/*.maxwidth400{*/}
{/*max-width: 400px;*/}
{/*overflow: hidden;*/}
{/*text-overflow: ellipsis;*/}
{/*white-space: nowrap;*/}
{/*}*/}
{/*`*/}
{/*}*/}
{/*</style>*/}
{/*{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{*/}
{/*return(*/}
{/*<p className="color-grey mt10" key={key} >*/}
{/*<a className="color-grey fl">*/}
{/*<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>*/}
{/*</a>*/}
{/*<span className="mr12 color9B9B maxwidth400 fl" length="58">*/}
{/*{item.name}*/}
{/*</span>*/}
{/*<span className="color656565 mt2 color-grey-6 font-12 mr8">*/}
{/*{item.response===undefined?"":isNaN(bytesToSize(item.filesize))?"123":bytesToSize(item.filesize)}*/}
{/*</span>*/}
{/*<i className="font-14 iconfont icon-guanbi "*/}
{/*id={item.response===undefined?"":item.response.id}*/}
{/*aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>*/}
{/*</p>*/}
{/*)*/}
{/*})}*/}
{this.state.newfileListtypes===true?<p className={"color-red"}>请先上传资源</p>:""}
@ -632,12 +635,13 @@ class Selectsetting extends Component{
}
`}</style>
<Checkbox
checked={is_public}
onChange={this.onChangepublics}>
<span className={"font-14"}>勾选后所有用户可见否则仅课堂成员可见</span>
</Checkbox>
<div className={this.state.fileListtype===true?"mt30":""}>
<Checkbox
checked={is_public}
onChange={this.onChangepublics}>
<span className={"font-14"}>勾选后所有用户可见否则仅课堂成员可见</span>
</Checkbox>
</div>
{/*{this.props.has_course_groups&&this.props.has_course_groups===true?:""}*/}
{/*{this.state.course_groupss&&this.state.course_groupss.length>0?<Checkbox*/}
{/*checked={unified_setting}*/}

@ -1,8 +1,7 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Select,Input} from "antd";
import axios from'axios';
import Loading from '@icedesign/base/lib/loading';
import '@icedesign/base/lib/loading/style.js';
import Modals from '../../modals/Modals';
const Option = Select.Option;
@ -77,7 +76,6 @@ class Showoldfiles extends Component{
`
}
</style>
<Loading visible={false} shape="dot-circle" color='#4AC7FF'>
<style>{`
.newupload_conboxtop{
@ -209,7 +207,7 @@ class Showoldfiles extends Component{
</div>
</div>
</Loading>
</Modal>:""}
</div>
)

@ -1,8 +1,6 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Select,Input,Tooltip,Spin,Icon} from "antd";
import axios from'axios';
// import Loading from '@icedesign/base/lib/loading';
// import '@icedesign/base/lib/loading/style.js';
const Option = Select.Option;
const Search = Input.Search;
@ -276,7 +274,7 @@ class ShixunModal extends Component{
`
}
</style>
{/*<Loading visible={hometypepvisible} shape="dot-circle" className="newnext-loading" color='#4AC7FF'>*/}
<Checkbox.Group style={{ width: '100%' }} value={patheditarry} onChange={this.shixunhomeworkedit}>
{
newshixunmodallist === undefined ? "": newshixunmodallist.map((item,key)=>{
@ -303,7 +301,6 @@ class ShixunModal extends Component{
})
}
</Checkbox.Group>
{/*</Loading>*/}
</div>
</div>
</Spin>

@ -2,7 +2,7 @@ import React,{ Component } from "react";
import { Modal,Checkbox,Upload,Button,Icon,message,DatePicker,Select,Tooltip} from "antd";
import axios from 'axios';
import Modals from '../../modals/Modals';
import {getUrl,handleDateString} from 'educoder';
import {getUrl,handleDateString,bytesToSize,appendFileSizeToUploadFileAll} from 'educoder';
import locale from 'antd/lib/date-picker/locale/zh_CN';
import moment from 'moment';
const CheckboxGroup = Checkbox.Group;
@ -85,12 +85,12 @@ class Sendresource extends Component{
let fileList = info.fileList;
if(info.file.status!="removed"){
this.setState({
fileList,
fileList: appendFileSizeToUploadFileAll(fileList),
fileListtype:true
});
}else{
this.setState({
fileList,
fileList: appendFileSizeToUploadFileAll(fileList),
});
}
}
@ -126,9 +126,9 @@ class Sendresource extends Component{
// }
onAttachmentRemove = (id) => {
onAttachmentRemove = (file) => {
const url = `/attachments/${id}.json`
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, {
})
.then((response) => {
@ -146,6 +146,9 @@ class Sendresource extends Component{
.catch(function (error) {
console.log(error);
});
this.setState({
fileListtype:false,
})
}
ModalCancelModalCancel=()=>{
@ -322,7 +325,7 @@ class Sendresource extends Component{
const uploadProps = {
width: 600,
showUploadList:false,
// showUploadList:false,
action: `${getUrl()}/api/attachments.json`,
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
@ -427,36 +430,37 @@ class Sendresource extends Component{
</Upload>
</p>
<style>
{
`
.maxwidth400{
max-width: 400px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
`
}
</style>
{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{
return(
<p className="color-grey mt10" key={key} >
<a className="color-grey fl">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<span className="mr12 color9B9B maxwidth400 fl" length="58">
{item.name}
</span>
<span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.response===undefined?"":isNaN(this.props.bytesToSize(item.response.filesize))?"":this.props.bytesToSize(item.response.filesize)}
</span>
<i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id}
aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>
</p>
)
})}
{/*<style>*/}
{/*{*/}
{/*`*/}
{/*.maxwidth400{*/}
{/*max-width: 400px;*/}
{/*overflow: hidden;*/}
{/*text-overflow: ellipsis;*/}
{/*white-space: nowrap;*/}
{/*}*/}
{/*`*/}
{/*}*/}
{/*</style>*/}
{/*{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{*/}
{/*debugger*/}
{/*return(*/}
{/*<p className="color-grey mt10" key={key} >*/}
{/*<a className="color-grey fl">*/}
{/*<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>*/}
{/*</a>*/}
{/*<span className="mr12 color9B9B maxwidth400 fl" length="58">*/}
{/*{item.name}*/}
{/*</span>*/}
{/*<span className="color656565 mt2 color-grey-6 font-12 mr8">*/}
{/*{item.response===undefined?"":isNaN(bytesToSize(item.filesize))?"":bytesToSize(item.filesize)}*/}
{/*</span>*/}
{/*<i className="font-14 iconfont icon-guanbi "*/}
{/*id={item.response===undefined?"":item.response.id}*/}
{/*aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>*/}
{/*</p>*/}
{/*)*/}
{/*})}*/}
{newfileListtype===true?<p className={"color-red"}>请先上传资源</p>:""}
@ -468,7 +472,7 @@ class Sendresource extends Component{
}
`}</style>
<Checkbox checked={is_public} onChange={this.onChangepublic}>
<div className={this.state.fileListtype===true?"mt30":""}></div><Checkbox checked={is_public} onChange={this.onChangepublic}>
<span className={"font-14"}>勾选后所有用户可见否则仅课堂成员可见</span>
</Checkbox>

@ -369,13 +369,13 @@ a.white-btn.use_scope-btn:hover{
}
#memoMD .CodeMirror {
width: 576px !important;
/*width: 576px !important;*/
margin-top: 31px !important;
height: 364px !important;
}
#memoMD .editormd-preview {
width: 567px !important;
width: 578px !important;
top: 40px !important;
height: 364px !important;
}

@ -131,9 +131,9 @@ class Exercisesetting extends Component{
// end_timetype:false
// })
// }else{
this.setState({
end_timetype:true
})
// this.setState({
// end_timetype:true
// })
// }
}

@ -1246,43 +1246,43 @@ class Studentshavecompletedthelist extends Component {
this.Generatenewdatas(response.data.exercise_users);
if (response.data.exercise_types.subjective === 0) {
if (this.state.noclassroom === undefined || this.state.noclassroom === "" || this.state.noclassroom === null) {
this.state.columnss.map((item,key)=>{
var arr =[];
for(var i=0;i<this.state.columnss.length;i++){
var item = this.state.columnss[i];
if(item.title==="分班"){
this.state.columnss.splice(key,1)
}
if(item.title==="客观题得分"){
this.state.columnss.splice(key,1)
else if(item.title==="客观题得分"){
}
if(item.title==="主观题得分"){
this.state.columnss.splice(key,1)
else if(item.title==="主观题得分"){
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnss.splice(key,1)
}
else if(this.props.isNotMember()===true&&item.title==="学号") {
}
})
let columnss2=this.state.columnss;
else{
arr.push(item);
}
}
this.setState({
columnss: columnss2,
columnss: arr,
})
} else {
this.state.columnss.map((item,key)=>{
var arr =[];
for(var i=0;i<this.state.columnss.length;i++){
var item = this.state.columnss[i];
if(item.title==="客观题得分"){
this.state.columnss.splice(key,1)
}
if(item.title==="主观题得分"){
this.state.columnss.splice(key,1)
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnss.splice(key,1)
}
else if(this.props.isNotMember()===true&&item.title==="学号") {
}
})
let columnss2=this.state.columnss;
else{
arr.push(item);
}
}
this.setState({
columnss: columnss2
columnss: arr
})
}
@ -1291,73 +1291,73 @@ class Studentshavecompletedthelist extends Component {
//学生已截止
if (response.data.exercise_types.subjective === 0) {
if (this.state.loadingstate === false) {
this.state.columnstwo.map((item,key)=>{
var arr =[];
for(var i=0;i<this.state.columnstwo.length;i++){
var item = this.state.columnstwo[i];
if(item.title==="客观题得分"){
this.state.columnstwo.splice(key,1)
}
if(item.title==="主观题得分"){
this.state.columnstwo.splice(key,1)
else if(item.title==="主观题得分"){
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnstwo.splice(key,1)
}
else if(this.props.isNotMember()===true&&item.title==="学号") {
}
})
let columnstwo2=this.state.columnstwo;
this.state.columns.map((item,key)=>{
else{
arr.push(item);
}
}
var arr2 =[];
for(var i=0;i<this.state.columns.length;i++){
var item = this.state.columns[i];
if(item.title==="客观题得分"){
this.state.columns.splice(key,1)
}
if(item.title==="主观题得分"){
this.state.columns.splice(key,1)
else if(item.title==="主观题得分"){
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columns.splice(key,1)
}
else if(this.props.isNotMember()===true&&item.title==="学号") {
}
})
let columns2=this.state.columns
else{
arr2.push(item);
}
}
thiss.setState({
columns: columns2,
columnstwo: columnstwo2,
columns: arr2,
columnstwo: arr,
loadingstate: true,
})
} else {
this.state.columnstwo.map((item,key)=>{
var arr =[];
for(var i=0;i<this.state.columnstwo.length;i++){
var item = this.state.columnstwo[i];
if(item.title==="客观题得分"){
this.state.columnstwo.splice(key,1)
}
if(item.title==="主观题得分"){
this.state.columnstwo.splice(key,1)
else if(item.title==="主观题得分"){
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnstwo.splice(key,1)
}
else if(this.props.isNotMember()===true&&item.title==="学号") {
}
})
let columnstwo2=this.state.columnstwo;
this.state.columns.map((item,key)=>{
if(item.title==="客观题得分"){
this.state.columns.splice(key,1)
else{
arr.push(item);
}
if(item.title==="主观题得分"){
this.state.columns.splice(key,1)
}
var arr2 =[];
for(var i=0;i<this.state.columns.length;i++){
var item = this.state.columns[i];
if(item.title==="客观题得分"){
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columns.splice(key,1)
}
else if(item.title==="主观题得分"){
}
})
let columns2=this.state.columns
else if(this.props.isNotMember()===true&&item.title==="学号") {
}
else{
arr2.push(item);
}
}
thiss.setState({
columns: columns2,
columnstwo:columnstwo2,
columns: arr2,
columnstwo:arr,
})
}
@ -1610,37 +1610,39 @@ class Studentshavecompletedthelist extends Component {
current_answer_user: response.data.current_answer_user,
})
if (response.data.exercise_types.subjective === 0) {
this.state.columnstwo.map((item,key)=>{
var arr =[];
for(var i=0;i<this.state.columnstwo.length;i++){
var item = this.state.columnstwo[i];
if(item.title==="客观题得分"){
this.state.columnstwo.splice(key,1)
}
if(item.title==="主观题得分"){
this.state.columnstwo.splice(key,1)
else if(item.title==="主观题得分"){
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnstwo.splice(key,1)
}
else if(this.props.isNotMember()===true&&item.title==="学号") {
}
})
let columnstwo2=this.state.columnstwo;
this.state.columns.map((item,key)=>{
else{
arr.push(item);
}
}
var arr2 =[];
for(var i=0;i<this.state.columns.length;i++){
var item = this.state.columns[i];
if(item.title==="客观题得分"){
this.state.columns.splice(key,1)
}
if(item.title==="主观题得分"){
this.state.columns.splice(key,1)
else if(item.title==="主观题得分"){
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columns.splice(key,1)
}
else if(this.props.isNotMember()===true&&item.title==="学号") {
}
})
let columns2=this.state.columns
else{
arr2.push(item);
}
}
this.setState({
columns: columns2,
columnstwo: columnstwo2,
columns: arr2,
columnstwo: arr,
loadingstate: false,
})
}
@ -1706,7 +1708,6 @@ class Studentshavecompletedthelist extends Component {
// }
}
if (response.data.exercise_types.subjective === 0) {
//===0 不包括主观题
if (indexi === exercise_users.length) {
@ -1715,20 +1716,25 @@ class Studentshavecompletedthelist extends Component {
// console.log("77771111111");
//分班大于0显示分班
//7ge
this.state.columnsys.map((item,key)=>{
// this.state.columnsys.map((item,key)=>{
//
// })
var arr =[];
for(var i=0;i<this.state.columnsys.length;i++){
var item = this.state.columnsys[i];
if(item.title==="客观题得分"){
this.state.columnsys.splice(key,1)
}
if(item.title==="主观题得分"){
this.state.columnsys.splice(key,1)
else if(item.title==="主观题得分"){
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnsys.splice(key,1)
}
else if(this.props.isNotMember()===true&&item.title==="学号") {
}
})
thiss.setState({
else{
arr.push(item);
}
}
this.setState({
data: datalist,
teacherlist: teacherlist,
Teacherliststudentlist: response.data,
@ -1737,27 +1743,27 @@ class Studentshavecompletedthelist extends Component {
exercise_users: response.data.exercise_users,
course_groups: response.data.course_groups,
loadingstate: false,
columnsys: this.state.columnsys,
columnsys: arr,
})
} else {
//分班小于0不显示分班
//6ge
this.state.columnsys.map((item,key)=>{
var arr =[];
for(var i=0;i<this.state.columnsys.length;i++){
var item = this.state.columnsys[i];
if(item.title==="分班"){
this.state.columnsys.splice(key,1)
}
if(item.title==="客观题得分"){
this.state.columnsys.splice(key,1)
else if(item.title==="客观题得分"){
}
if(item.title==="主观题得分"){
this.state.columnsys.splice(key,1)
else if(item.title==="主观题得分"){
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnsys.splice(key,1)
}
else if(this.props.isNotMember()===true&&item.title==="学号") {
}
})
else{
arr.push(item);
}
}
thiss.setState({
data: datalist,
@ -1768,7 +1774,7 @@ class Studentshavecompletedthelist extends Component {
commit_status: response.data.commit_status,
exercise_users: response.data.exercise_users,
course_groups: response.data.course_groups,
columnsys: this.state.columnsys,
columnsys: arr,
})
}
@ -1778,19 +1784,23 @@ class Studentshavecompletedthelist extends Component {
if (response.data.exercise_types.groups_count > 0) {
//显示分班
//8ge
this.state.columnsys.map((item,key)=>{
var arr =[];
for(var i=0;i<this.state.columnsys.length;i++){
var item = this.state.columnsys[i];
if(item.title==="客观题得分"){
this.state.columnsys.splice(key,1)
}
if(item.title==="主观题得分"){
this.state.columnsys.splice(key,1)
else if(item.title==="主观题得分"){
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnsys.splice(key,1)
}
else if(this.props.isNotMember()===true&&item.title==="学号") {
}else{
arr.push(item);
}
})
}
// console.log(thiss.state.columnsys);
// console.log(arr);
this.setState({
data: datalist,
teacherlist: teacherlist,
@ -1800,27 +1810,28 @@ class Studentshavecompletedthelist extends Component {
exercise_users: response.data.exercise_users,
course_groups: response.data.course_groups,
loadingstate: false,
columnsys: this.state.columnsys,
columnsys: arr,
})
} else {
//不显示分班
//7ge
this.state.columnsys.map((item,key)=>{
var arr =[];
for(var i=0;i<this.state.columnsys.length;i++){
var item = this.state.columnsys[i];
if(item.title==="分班"){
this.state.columnsys.splice(key,1)
}
if(item.title==="客观题得分"){
this.state.columnsys.splice(key,1)
else if(item.title==="客观题得分"){
}
if(item.title==="主观题得分"){
this.state.columnsys.splice(key,1)
else if(item.title==="主观题得分"){
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnsys.splice(key,1)
}
else if(this.props.isNotMember()===true&&item.title==="学号") {
}else{
arr.push(item);
}
})
}
this.setState({
data: datalist,
teacherlist: teacherlist,
@ -1830,7 +1841,7 @@ class Studentshavecompletedthelist extends Component {
exercise_users: response.data.exercise_users,
course_groups: response.data.course_groups,
loadingstate: false,
columnsys: this.state.columnsys,
columnsys: arr,
})
}
@ -1842,13 +1853,16 @@ class Studentshavecompletedthelist extends Component {
console.log("2548包含主观题不包含分班");
if (response.data.exercise_types.groups_count > 0) {
this.state.columnsys.map((item,key)=>{
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnsys.splice(key,1)
}
var arr =[];
for(var i=0;i<this.state.columnsys.length;i++){
var item = this.state.columnsys[i];
if(this.props.isNotMember()===true&&item.title==="学号") {
}
})
else{
arr.push(item);
}
}
this.setState({
data: datalist,
teacherlist: teacherlist,
@ -1857,19 +1871,22 @@ class Studentshavecompletedthelist extends Component {
commit_status: response.data.commit_status,
exercise_users: response.data.exercise_users,
course_groups: response.data.course_groups,
columnsys: this.state.columnsys,
columnsys: arr,
})
} else {
this.state.columnsys.map((item,key)=>{
var arr =[];
for(var i=0;i<this.state.columnsys.length;i++){
var item = this.state.columnsys[i];
if(item.title==="分班"){
this.state.columnsys.splice(key,1)
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnsys.splice(key,1)
}
else if(this.props.isNotMember()===true&&item.title==="学号") {
}
})
else{
arr.push(item);
}
}
this.setState({
data: datalist,
teacherlist: teacherlist,
@ -1878,7 +1895,7 @@ class Studentshavecompletedthelist extends Component {
commit_status: response.data.commit_status,
exercise_users: response.data.exercise_users,
course_groups: response.data.course_groups,
columnsys: this.state.columnsys,
columnsys:arr,
})
}
} else {
@ -1896,16 +1913,19 @@ class Studentshavecompletedthelist extends Component {
columnsys: this.state.columnsystwo,
})
} else {
this.state.columnsys.map((item,key)=>{
var arr =[];
for(var i=0;i<this.state.columnsys.length;i++){
var item = this.state.columnsys[i];
if(item.title==="分班"){
this.state.columnsys.splice(key,1)
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnsys.splice(key,1)
}
else if(this.props.isNotMember()===true&&item.title==="学号") {
}
})
else{
arr.push(item);
}
}
this.setState({
data: datalist,
teacherlist: teacherlist,
@ -1915,7 +1935,7 @@ class Studentshavecompletedthelist extends Component {
exercise_users: response.data.exercise_users,
course_groups: response.data.course_groups,
loadingstate: false,
columnsys: this.state.columnsys,
columnsys: arr,
})
}

@ -18,9 +18,12 @@
color: #999999;
}
.appraise .panel-comment_item .t_info {
.appraise .panel-comment_item .t_info {
width: 1062px;
}
.appraise .panel-comment_item .childrenCommentsView .t_info {
width: 989px;
}
.course-message .panel-comment_item .comment_orig_content {
width: 980px;
}

@ -111,11 +111,11 @@ class GraduationTaskssettingapp extends Component{
max_nums: result.data.max_num,
task_type: result.data.task_type,
baseonproject: result.data.base_on_project,
publish_time:result.data.publish_time===null?"":moment(moment(handleDateString(result.data.publish_time))).format("YYYY-MM-DD HH:mm"),
end_time:result.data.end_time===null?"":moment(moment(handleDateString(result.data.end_time))).format("YYYY-MM-DD HH:mm"),
publish_time:result.data.publish_time===null||result.data.publish_time=== ""?"":moment(moment(handleDateString(result.data.publish_time))).format("YYYY-MM-DD HH:mm"),
end_time:result.data.end_time===null||result.data.end_time=== ""?"":moment(moment(handleDateString(result.data.end_time))).format("YYYY-MM-DD HH:mm"),
allowlate: result.data.allow_late,
latepenalty: result.data.late_penalty,
latetime:result.data.late_time===null?"":moment(moment(handleDateString(result.data.late_time))).format("YYYY-MM-DD HH:mm"),
latetime:result.data.late_time===null||result.data.late_time=== ""?"":moment(moment(handleDateString(result.data.late_time))).format("YYYY-MM-DD HH:mm"),
crosscomment: result.data.cross_comment,
taskid: result.data.id,
taskname: result.data.task_name,
@ -128,7 +128,7 @@ class GraduationTaskssettingapp extends Component{
hasproject: result.data.has_project,
hascommit: result.data.has_commit,
assigngroups: assigngroups,
commenttime:result.data.comment_time===null?"":moment(moment(handleDateString(result.data.comment_time))).format("YYYY-MM-DD HH:mm"),
commenttime:result.data.comment_time===null||result.data.comment_time=== ""?"":moment(moment(handleDateString(result.data.comment_time))).format("YYYY-MM-DD HH:mm"),
task_status: result.data.task_status
})
}
@ -288,12 +288,13 @@ class GraduationTaskssettingapp extends Component{
allowlatefun=(e)=>{
let {end_time}=this.state;
if(e.target.value===true||e.target.value===1){
this.setState({
latepenalty:5,
allowlate:e.target.value,
latetime:end_time===null?"":moment(moment(handleDateString(end_time))).add(1, 'months').format("YYYY-MM-DD HH:mm"),
latetime:end_time===null||end_time === ""?"":moment(moment(handleDateString(end_time))).add(1, 'months').format("YYYY-MM-DD HH:mm"),
})
}else{
this.setState({
@ -316,24 +317,24 @@ class GraduationTaskssettingapp extends Component{
})
}
updatesfuncrosscomment=(types,checked,newlatetime,newcommenttime)=>{
updatesfuncrosscomment=(types,newlatetime,newcommenttime)=>{
let {endtimetype}=this.state;
if(types===1){
this.setState({
latetime:newlatetime,
crosscomment:checked,
crosscomment:true,
commenttime:newcommenttime
})
}else{
if(endtimetype===true){
this.setState({
crosscomment:checked,
crosscomment:true,
commenttime:newcommenttime
})
}else{
this.setState({
end_time:newlatetime,
crosscomment:checked,
crosscomment:true,
commenttime:newcommenttime
})
}
@ -341,42 +342,41 @@ class GraduationTaskssettingapp extends Component{
}
funcrosscomment=(e)=>{
let {latetime,end_time,allowlate}=this.state;
let newlatetimea=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttimea=moment(new Date()).format("YYYY-MM-DD HH:mm");
let newlatetimes=moment(latetime).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttimes=moment(latetime).format("YYYY-MM-DD HH:mm");
let newend_timeb=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttimeb=moment(new Date()).add(8, 'days').format("YYYY-MM-DD HH:mm");
let newend_timed=moment(end_time).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttimed=moment(end_time).add(8, 'days').format("YYYY-MM-DD HH:mm");
let {latetime,end_time,allowlate}=this.state;
let newtime;
if(e.target.checked===true){
if(allowlate===1||allowlate===true){
if(latetime===null||latetime===""){
let newlatetime=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttime=moment(new Date()).format("YYYY-MM-DD HH:mm");
this.updatesfuncrosscomment=(1,e.target.checked,newlatetime,newcommenttime)
this.updatesfuncrosscomment(1,newlatetimea,newcommenttimea)
}else{
let newlatetime=moment(latetime).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttime=moment(latetime).format("YYYY-MM-DD HH:mm");
this.updatesfuncrosscomment=(1,e.target.checked,newlatetime,newcommenttime)
this.updatesfuncrosscomment(1,newlatetimes,newcommenttimes)
}
}else{
if(end_time===null||end_time===""){
let newend_time=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttime=moment(new Date()).add(8, 'days').format("YYYY-MM-DD HH:mm");
this.updatesfuncrosscomment=(2,e.target.checked,newend_time,newcommenttime)
this.updatesfuncrosscomment(2,newend_timeb,newcommenttimeb)
}else{
let newend_time=moment(end_time).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttime=moment(end_time).add(8, 'days').format("YYYY-MM-DD HH:mm");
this.updatesfuncrosscomment=(2,e.target.checked,newend_time,newcommenttime)
this.updatesfuncrosscomment(2,newend_timed,newcommenttimed)
}
}
}else{
this.setState({
crosscomment:e.target.checked,
commenttime:undefined
})
}
}
funcommentstatus=(e)=>{
@ -406,7 +406,7 @@ class GraduationTaskssettingapp extends Component{
visibles:true,
Topval:"学生将立即收到毕设任务",
// Botvalleft:"点击修改",
Botval:`本操作只对"未发布"的分班有效`,
// Botval:`本操作只对"未发布"的分班有效`,
starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") ,
starttimes:this.props.getNowFormatDates(1),
typs:"start",
@ -700,10 +700,10 @@ class GraduationTaskssettingapp extends Component{
min_num: this.state.minnum,
max_num: this.state.maxnum,
base_on_project:baseonproject===true?1:0,
publish_time:this.state.publish_time===null?"":this.state.publish_time,
end_time: this.state.end_time===null?this.props.getNowFormatDates(2,1):this.state.end_time,
publish_time:this.state.publish_time===null||this.state.publish_time=== ""?"":this.state.publish_time,
end_time: this.state.end_time===null||this.state.end_time=== ""?this.props.getNowFormatDates(2,1):this.state.end_time,
allow_late:allowlate===true||allowlate===1?1:undefined,
late_time: this.state.latetime===null?this.props.getNowFormatDates(3,1):this.state.latetime,
late_time: this.state.latetime===null||this.state.latetime=== ""?this.props.getNowFormatDates(3,1):this.state.latetime,
late_penalty: latepenalty,
cross_comment: crosscomment===true?1:undefined,
comment_status: crosscomment===true?this.state.commentstatus===0?2:this.state.commentstatus===1?2:this.state.commentstatus:undefined,
@ -780,7 +780,7 @@ class GraduationTaskssettingapp extends Component{
visibles:true,
Topval:"学生将不能再提交作品",
// Botvalleft:"暂不截止",
Botval:`本操作只对"提交中"的分班有效`,
// Botval:`本操作只对"提交中"的分班有效`,
Cancelname:"暂不截止",
Savesname:"立即截止",
Cancel:this.cancelmodel,
@ -1273,7 +1273,7 @@ class GraduationTaskssettingapp extends Component{
placeholder="请选择发布时间"
id={"endTime"}
width={"210px"}
value={commenttime===null||commenttime===""?"":moment(commenttime, dateFormat)}
value={commenttime===null||commenttime=== ""?"":moment(commenttime, dateFormat)}
disabledTime={disabledDateTime}
onChange={this.onChangeTimecommenttime}
disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true}

@ -318,7 +318,7 @@ class GraduationTaskssettinglist extends Component{
visible:true,
Topval:"学生将不能再提交作品",
// Botvalleft:"暂不截止",
Botval:`本操作只对"提交中"的分班有效`,
// Botval:`本操作只对"提交中"的分班有效`,
Cancelname:"暂不截止",
Savesname:"立即截止",
Cancel:this.cancelmodel,
@ -337,7 +337,7 @@ class GraduationTaskssettinglist extends Component{
visible:true,
Topval:"学生将立即收到毕设任务",
// Botvalleft:"点击修改",
Botval:`本操作只对"未发布"的分班有效`,
// Botval:`本操作只对"未发布"的分班有效`,
starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") ,
starttimes:this.props.getNowFormatDates(1),
typs:"start",

@ -61,7 +61,7 @@ class GraduationTasksquestions extends Component{
visible:true,
Topval:"学生将不能再提交作品",
// Botvalleft:"暂不截止",
Botval:`本操作只对"提交中"的分班有效`,
// Botval:`本操作只对"提交中"的分班有效`,
Cancelname:"暂不截止",
Savesname:"立即截止",
Cancel:this.cancelmodel,
@ -80,7 +80,7 @@ class GraduationTasksquestions extends Component{
visible:true,
Topval:"学生将立即收到毕设任务",
// Botvalleft:"点击修改",
Botval:`本操作只对"未发布"的分班有效`,
// Botval:`本操作只对"未发布"的分班有效`,
starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") ,
starttimes:this.props.getNowFormatDates(1),
typs:"start",

@ -31,6 +31,8 @@ class ChooseGraduateTopicModal extends Component{
<ModalWrapper
ref="modalWrapper"
onOk={this.onOk}
title={ "题库选用" }
>
<React.Fragment>
<style>{`

@ -468,7 +468,22 @@ class studentsList extends Component{
const { course_group_name, invite_code } = this.state;
const courseId = this.props.match.params.coursesId
let exportUrl = "/api/courses/${courseId}/export_member_scores_excel.xlsx?"
const params = {}
if (course_group_id) {
params.group_id = course_group_id
}
if (searchValue) {
searchValue = searchValue.trim()
if (searchValue) {
params.search = searchValue
}
}
let paramsString = ''
for (let key in params) {
paramsString += `${key}=${params[key]}&`
}
exportUrl += paramsString;
return(
<React.Fragment >
<Titlesearchsection
@ -500,13 +515,13 @@ class studentsList extends Component{
firstRowRight={
<React.Fragment>
{ isSuperAdmin && <React.Fragment>
{/* <CreateGroupByImportModal ref="createGroupByImportModal" {...this.props}></CreateGroupByImportModal> */}
{/* <WordsBtn style="blue" className="mr30" onClick={()=> this.refs['createGroupByImportModal'].setVisible(true)}>导入创建分班</WordsBtn> */}
<CreateGroupByImportModal ref="createGroupByImportModal" {...this.props}></CreateGroupByImportModal>
<WordsBtn style="blue" className="mr30" onClick={()=> this.refs['createGroupByImportModal'].setVisible(true)}>导入创建分班</WordsBtn>
</React.Fragment> }
{ isAdmin && isParent && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>新建分班</WordsBtn> }
{ isAdmin && isParent && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>添加分班</WordsBtn> }
{ isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.deleteDir()}>删除分班</WordsBtn> }
{ isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.renameDir()}>分班重命名</WordsBtn> }
{ isAdmin && <WordsBtn style="blue" className="" href={`/api/courses/${courseId}/export_member_scores_excel.xlsx`}>导出成绩</WordsBtn> }
{ isAdmin && <WordsBtn style="blue" className="" href={`${exportUrl}`}>导出成绩</WordsBtn> }
{/* */}
</React.Fragment>
}

@ -94,7 +94,13 @@ class PollNew extends Component {
// 初始化数据
componentDidMount = () => {
console.log("componentDidMount 50")
// console.log("componentDidMount 50")
if( this.props.isStudent() === true){
this.props.history.push("/403")
return
}
if (this.props.match.params.news !== undefined) {
if (this.props.match.params.news === "new") {
this.state.Newedit === true;
@ -137,12 +143,12 @@ class PollNew extends Component {
// }
//初始化请求网络
Initializatio_data = () => {
console.log("Initializatio_data 582")
// console.log("Initializatio_data 582")
//课堂id
let coursesId = this.props.match.params.coursesId;
//时间id
let pollid = this.props.match.params.pollid;
console.log(pollid);
// console.log(pollid);
// let coursesId = 557;
if (pollid === undefined) {
// console.log("没有问卷新建问卷~~~")
@ -223,8 +229,8 @@ class PollNew extends Component {
polls_descriptiontest: result.data.poll.polls_description,
questionnair: true,
})
console.log(this.state.polls_nametest)
console.log(this.state.polls_descriptiontest)
// console.log(this.state.polls_nametest)
// console.log(this.state.polls_descriptiontest)
// }
}).catch((error) => {
console.log(error)
@ -321,7 +327,7 @@ class PollNew extends Component {
//添加多选题目
addmydoubles = () => {
console.log("addmymainsint 70")
// console.log("addmymainsint 70")
if (this.state.newoption === true) {
this.setState({
newoption: false
@ -361,7 +367,7 @@ class PollNew extends Component {
//编辑方法
adddomedit = (object) => {
console.log("adddomedit 76");
// console.log("adddomedit 76");
if (this.state.q_countst > 0) {
this.props.showNotification(`不能同时编辑两题`);
@ -512,11 +518,12 @@ class PollNew extends Component {
//新增添加题目 有new
addMytopic = (index, pollid, Insertposition, Whether, id) => {
//Whether 是否插入
// console.log("id")
// console.log(id)
// console.log("Whether")
// console.log("addMytopic 90")
// console.log(index)
// console.log(pollid)
// console.log(Insertposition)
// console.log(Whether)
console.log("addMytopic 90")
// console.log(id)
if (this.state.q_countst > 0) {
this.props.showNotification(`不能同时编辑两题`);
@ -718,7 +725,7 @@ class PollNew extends Component {
//删除指定条目
deleteadddom = (indexo) => {
console.log("deleteadddom 259")
// console.log("deleteadddom 259")
var arr = this.state.adddom;
let newarr = [...arr];
@ -758,7 +765,7 @@ class PollNew extends Component {
}
}
} catch (e) {
console.log("PollNew281")
// console.log("PollNew281")
console.log(e)
}
}
@ -779,19 +786,21 @@ class PollNew extends Component {
}
}
if (maxtie < 3) {
if (object.question.question_type === 1) {
this.props.showNotification(`选项不能少于3个!`);
if (object.question.question_type === 1) {
if (maxtie < 2) {
this.props.showNotification(`选项不能少于2个!`);
return
}
} else if (object.question.question_type === 2) {
if (maxtie < 3) {
this.props.showNotification(`选项不能少于3个!`);
return
}
}
}
if (object.question.question_type === 2) {
if (object.question.max_choices > 0) {
@ -1004,7 +1013,7 @@ class PollNew extends Component {
//////////////////////////////////////////////////////////////////////////////////////////////////// 上面是新增
} else {
///////////////////////////////////////////////////////////////////////////////////////////////////修改点了编辑
console.log("点了编辑")
// console.log("点了编辑")
var uuk = -1
//这个地方判断 点了编辑上面题目又把他删除了 保存的时候就只能是插入新增了
for (var uk = 0; uk < newarrpoll.length; uk++) {
@ -1130,15 +1139,15 @@ class PollNew extends Component {
//
// }
if (uuk !== -1) {
console.log("修改")
// console.log("修改")
this.edittotheserver(object, 2, arrc, null, object.question.max_choices, object.question.min_choices);
newarrpoll.splice(uuk, 1, question);
} else {
console.log("删除")
// console.log("删除")
this.createquestionsandanswers(object, 2, arrc, null, object.question.max_choices, object.question.min_choices, object.question.id);
newarrpoll.push(question);
}
console.log(newarrpoll)
// console.log(newarrpoll)
newarr[indexo].question.new = "new"
} else if (object.question.question_type === 3) {
//插入主观题
@ -1176,15 +1185,15 @@ class PollNew extends Component {
question = {"question": questiontwo};
if (uuk !== -1) {
console.log("修改")
// console.log("修改")
this.edittotheserver(object, 3, null, null, 0, 0);
newarrpoll.splice(uuk, 1, question);
} else {
console.log("删除")
// console.log("删除")
this.createquestionsandanswers(object, 3, null, null, 0, 0, object.question.id);
newarrpoll.push(question);
}
console.log(newarrpoll)
// console.log(newarrpoll)
newarr[indexo].question.new = "new"
}
@ -1259,17 +1268,19 @@ class PollNew extends Component {
}
}
if (maxtie < 3) {
if (object.question.question_type === 1) {
this.props.showNotification('选项不能少于3个!');
if (maxtie < 2) {
this.props.showNotification('选项不能少于2个!');
return
}
} else if (object.question.question_type === 2) {
if (maxtie < 3) {
this.props.showNotification('选项不能少于3个!');
return
}
}
}
if (object.question.question_type === 2) {
if (object.question.max_choices > 0) {
@ -1453,7 +1464,7 @@ class PollNew extends Component {
for (var uk = 0; uk < newarrpoll.length; uk++) {
if (object.question.id === newarrpoll[uk].question.id) {
uuk = uk;
console.log("删除了数据=-09876543234567890-111111111111")
// console.log("删除了数据=-09876543234567890-111111111111")
}
}
@ -1501,15 +1512,15 @@ class PollNew extends Component {
};
question = {"question": questiontwo};
if (uuk !== -1) {
console.log("修改")
// console.log("修改")
this.edittotheserver(object, 1, arrc, null, 0, 0);
newarrpoll.splice(uuk, 1, question);
} else {
console.log("删除")
// console.log("删除")
this.createquestionsandanswers(object, 1, arrc, null, 0, 0, object.question.id);
newarrpoll.push(question);
}
console.log(newarrpoll)
// console.log(newarrpoll)
} else if (object.question.question_type === 2) {
//插入多选题
if (object.question.max_choices < object.question.min_choices) {
@ -1557,15 +1568,15 @@ class PollNew extends Component {
question = {"question": questiontwo};
//插入多选题
if (uuk !== -1) {
console.log("修改")
// console.log("修改")
this.edittotheserver(object, 2, arrc, null, object.question.max_choices, object.question.min_choices);
newarrpoll.splice(uuk, 1, question);
} else {
console.log("删除")
// console.log("删除")
this.createquestionsandanswers(object, 2, arrc, null, object.question.max_choices, object.question.min_choices, object.question.id);
newarrpoll.push(question);
}
console.log(newarrpoll)
// console.log(newarrpoll)
} else if (object.question.question_type === 3) {
//插入主观题
@ -1602,15 +1613,15 @@ class PollNew extends Component {
};
question = {"question": questiontwo};
if (uuk !== -1) {
console.log("修改")
// console.log("修改")
this.edittotheserver(object, 3, null, null, 0, 0);
newarrpoll.splice(uuk, 1, question);
} else {
console.log("删除")
// console.log("删除")
this.createquestionsandanswers(object, 3, null, null, 0, 0, object.question.id);
newarrpoll.push(question);
}
console.log(newarrpoll)
// console.log(newarrpoll)
}
@ -1693,7 +1704,7 @@ class PollNew extends Component {
}
///编辑修改到服务器当中
edittotheserver = (object, number, option, other, max_choices, min_choices) => {
console.log("调用了edittotheserver")
// console.log("调用了edittotheserver")
var url = `/poll_questions/${object.question.id}.json`
var thiss = this;
axios.put(url, {
@ -1720,7 +1731,7 @@ class PollNew extends Component {
//删除到服务器当中
eletetoserver = (pollid, newarr, type, index) => {
console.log("调用了eletetoserver")
// console.log("调用了eletetoserver")
var id = pollid;
var url = `/poll_questions/${id}.json`
let {mysingles, mydoubles, mymainsint} = this.state
@ -1729,7 +1740,7 @@ class PollNew extends Component {
axios
.delete(url, {})
.then(function (response) {
console.log(response)
// console.log(response)
if (response === undefined) {
return;
}
@ -1774,7 +1785,7 @@ class PollNew extends Component {
}
// console.log(JSON.stringify(result))
} catch (e) {
console.log("上移题目成功 错误")
// console.log("上移题目成功 错误")
console.log(e)
}
@ -1792,7 +1803,7 @@ class PollNew extends Component {
}
// console.log(JSON.stringify(result))
} catch (e) {
console.log("下移题目成功 错误")
// console.log("下移题目成功 错误")
console.log(e)
}
})
@ -1804,8 +1815,8 @@ class PollNew extends Component {
//id 条目的唯一id
//i 为要删除的子条目
deleteentrys = (id, i, stirngname) => {
console.log(id)
console.log(stirngname);
// console.log(id)
// console.log(stirngname);
var arrtwoy = this.state.adddom;
let newarrtwoy = [...arrtwoy];
for (var k = 0; k < newarrtwoy.length; k++) {
@ -1822,14 +1833,14 @@ class PollNew extends Component {
}
}
if (stirngname === true) {
console.log(stirngname);
// console.log(stirngname);
this.setState({
newoption: false,
adddom: newarrtwoy,
})
} else {
console.log(stirngname);
// console.log(stirngname);
this.setState({
adddom: newarrtwoy,
});
@ -1841,8 +1852,8 @@ class PollNew extends Component {
// 新增选项
ewoption = (id, object) => {
console.log("ewoption 440")
console.log("是否是新建题目还是编辑")
// console.log("ewoption 440")
// console.log("是否是新建题目还是编辑")
// console.log(object.question.new)
@ -1903,10 +1914,10 @@ class PollNew extends Component {
//新增其他选项
addanotheroption = (id) => {
console.log("addanotheroption 457")
// console.log("addanotheroption 457")
let arrtwo = this.state.adddom;
let newarrtwo = [...arrtwo];
console.log(newarrtwo)
// console.log(newarrtwo)
for (var k = 0; k < newarrtwo.length; k++) {
if (newarrtwo[k] != undefined) {
if (newarrtwo[k].question.id === id) {
@ -1928,10 +1939,10 @@ class PollNew extends Component {
//点击向上排序按钮事件
handleClickBySortUp = (index, object) => {
console.log("handleClickBySortUp 521")
// console.log("handleClickBySortUp 521")
let arr = this.state.poll_questions;
let newarr = [...arr];
console.log(newarr)
// console.log(newarr)
if (index != 0) {
this.Upanddownmovementof(true, object.question.id);
let temp = newarr[index - 1];
@ -1945,7 +1956,7 @@ class PollNew extends Component {
//点击向下排序按钮事件
handleClickBySortDown = (index, object) => {
console.log("handleClickBySortDown 536")
// console.log("handleClickBySortDown 536")
let arr = this.state.poll_questions;
let newarr = [...arr];
//
@ -1958,16 +1969,16 @@ class PollNew extends Component {
poll_questions: newarr,
});
} else {
console.log("2222index==arr.length");
console.log(this.state.poll_questions);
// console.log("2222index==arr.length");
// console.log(this.state.poll_questions);
}
}
//点击删除按钮事件
handleClickByDelete = (type, index, object) => {
console.log("handleClickByDelete 556")
console.log("object.question.id")
console.log(object.question.id)
// console.log("handleClickByDelete 556")
// console.log("object.question.id")
// console.log(object.question.id)
let arr = this.state.poll_questions;
let newarr = [...arr];
this.eletetoserver(object.question.id, newarr, type, index)
@ -1979,11 +1990,11 @@ class PollNew extends Component {
//i外层数组
//k为内层数组
handleInputChanges = (e, i, k) => {
console.log("handleInputChanges 612")
// console.log("handleInputChanges 612")
let value = e.target.value;//取到input的数据
console.log("handleInputChanges value is :" + value);
console.log(k);
// console.log("handleInputChanges value is :" + value);
// console.log(k);
let arr = this.state.adddom;
let newarr = [...arr];
@ -1996,11 +2007,11 @@ class PollNew extends Component {
//标题输入监听
handleInputTopic = (e, i) => {
console.log("handleInputTopic 633")
// console.log("handleInputTopic 633")
let value = e.target.value;//取到input的数据
console.log("handleInputTopic value is :" + value);
console.log(i);
// console.log("handleInputTopic value is :" + value);
// console.log(i);
let arr = this.state.adddom;
let newarr = [...arr];
newarr[i].question.question_title = value
@ -2063,7 +2074,7 @@ class PollNew extends Component {
//提交题目//没有就创建新的题库新建问newz题和保存题目不一样不能同时保存 这里只是新建 和编辑 标题和须知
submitQuestionnaire = (mews) => {
console.log("调用了submitQuestionnaire")
// console.log("调用了submitQuestionnaire")
if (this.state.Newedit === true) {
this.newword();
@ -2120,7 +2131,7 @@ class PollNew extends Component {
}
savedelete = (question_type, index, item) => {
console.log("savedelete");
// console.log("savedelete");
this.handleClickByDelete(question_type, index, item);
this.setState({
Modalstype: false,
@ -2141,8 +2152,8 @@ class PollNew extends Component {
}
//必答选项
onCheckAllChange = (e, index) => {
console.log("onCheckAllChange");
console.log(e.target.checked);
// console.log("onCheckAllChange");
// console.log(e.target.checked);
// console.log(e.target.value);
let arr = this.state.adddom;
for (var i = 0; i < arr.length; i++) {
@ -2328,95 +2339,114 @@ class PollNew extends Component {
</div>
{/*<Form {...formItemLayout} onSubmit={this.handleSubmit}>*/}
<div className="edu-back-white">
<div className="createPage bor-bottom-greyE">
<style>
{`
{
this.state.mysave === false ?
<div className="padding20-30" style={{ background: '#fff'}}>
<div className="displayTitle font-16">
<span>{this.state.polls_nametest}</span>
<a className="fr" onClick={() => { this.adddomeditit() }} style={{ lineHeight: '32px'}}>
<Tooltip title="编辑"><i className="iconfont icon-bianjidaibeijing font-20 color-green"></i></Tooltip>
</a>
</div>
<div className="displayDescription color-grey-9" dangerouslySetInnerHTML={{__html: this.state.polls_descriptiontest}}
style={{whiteSpace: 'pre-wrap'}}
></div>
</div>
:""
}
{
this.state.mysave === true ?
<div className="edu-back-white">
<div className="createPage bor-bottom-greyE">
<style>
{`
.ant-form-item-label{width:180px;}
`}
</style>
</style>
<div>
<div style={{"color": "#212121", "font-size": "16px"}} className="fl"><span
style={{"color": "#f5222d"}}>*</span>
</div>
{
this.props.match.params.news === undefined ? "" : this.props.match.params.news === "new" ?
(
this.state.mysave === false ?
<div className="fr">
<span><a onClick={() => this.adddomeditit()}><Tooltip title="编辑"><i
className="color-green font-18 iconfont icon-bianjidaibeijing"></i></Tooltip></a></span>
</div>
: "")
:
<div className="fr">
<div>
<div style={{"color": "#212121", "font-size": "16px"}} className="fl"><span
style={{"color": "#f5222d"}}>*</span>
</div>
{
this.props.match.params.news === undefined ? "" : this.props.match.params.news === "new" ?
(
this.state.mysave === false ?
<div className="fr">
<span><a onClick={() => this.adddomeditit()}><Tooltip title="编辑"><i
className="color-green font-18 iconfont icon-bianjidaibeijing"></i></Tooltip></a></span>
</div>
}
</div>
: "")
:""
}
</div>
</div>
<Input placeholder="请输入问卷标题最大限制60个字符" maxLength="60"
style={{"margin-top": "15px", "text-align": "left"}}
onInput={this.changeTopicName}
readOnly={readOnlys}
autoComplete="off" addonAfter={String(addonAfter)}
value={this.state.polls_nametest}
className="searchViewAfter"></Input>
<Input placeholder="请输入问卷标题最大限制60个字符" maxLength="60"
style={{"margin-top": "15px", "text-align": "left"}}
onInput={this.changeTopicName}
readOnly={readOnlys}
autoComplete="off" addonAfter={String(addonAfter)}
value={this.state.polls_nametest}
className="searchViewAfter"></Input>
</div>
<div style={{
"padding": "20px 30px 50px",
"position": "relative",
"border-bottom": "1px solid #EDEDED",
"margin-bottom": " 0px"
}}>
<style>
{`
</div>
<div style={{
"padding": "20px 30px 50px",
"position": "relative",
"border-bottom": "1px solid #EDEDED",
"margin-bottom": " 0px"
}}>
<style>
{`
.ant-form-item-label{width:80px;}
`}
</style>
</style>
<div style={{"color": "#212121", "font-size": "16px"}}>问卷须知</div>
<div style={{"color": "#212121", "font-size": "16px"}}>问卷须知</div>
<TextArea placeholder="请输入本次问卷答题的相关说明最大限制100个字符"
style={{"height": "120px", "margin-top": "15px", "text-align": "left"}}
maxLength="100"
readOnly={readOnlys}
onInput={this.changeTopicNametwo}
value={this.state.polls_descriptiontest}
autoComplete="off" addonAfter={"100"}></TextArea>
{
this.state.Newedit === true || this.state.mysave === true ?
<div>
<Button type="primary" onClick={this.onSaveExercise} className=" fr "
style={{
"margin-top": "10px",
"height": "32px",
"width": " 70px",
"font-size": "14px",
"line-height": " 30px",
}}>保存</Button>
{cancellation === false ?
<Button onClick={this.onSaveExercisetwo} className="defalutCancelbtn fr mr20 "
style={{
"margin-top": "10px",
"height": "32px",
"width": " 70px",
"font-size": "14px",
"line-height": " 30px"
}}>取消</Button>
: ""}
<TextArea placeholder="请输入本次问卷答题的相关说明最大限制100个字符"
style={{"height": "120px", "margin-top": "15px", "text-align": "left"}}
maxLength="100"
readOnly={readOnlys}
onInput={this.changeTopicNametwo}
value={this.state.polls_descriptiontest}
autoComplete="off" addonAfter={"100"}></TextArea>
{
this.state.Newedit === true || this.state.mysave === true ?
<div>
<Button type="primary" onClick={this.onSaveExercise} className=" fr "
style={{
"margin-top": "10px",
"height": "32px",
"width": " 70px",
"font-size": "14px",
"line-height": " 30px",
}}>保存</Button>
{cancellation === false ?
<Button onClick={this.onSaveExercisetwo} className="defalutCancelbtn fr mr20 "
style={{
"margin-top": "10px",
"height": "32px",
"width": " 70px",
"font-size": "14px",
"line-height": " 30px"
}}>取消</Button>
: ""}
</div>
: ""
}
</div>
</div>:""
}
</div>
: ""
}
</div>
</div>
<p className="clearfix padding20-30 color-grey-9">
@ -2495,8 +2525,8 @@ class PollNew extends Component {
(<RadioGroup defaultChecked={false} disabled>
{item.question.answers === undefined ? "" : item.question.answers.map((items, i) => {
return (
<div className={"h20 mt20 mb20 "} style={{"clear": "both"}}>
<Radio value={i} className={"fl"} style={{"text-align": "left"}}></Radio>
<div className="h20 pt20" style={{"clear": "both"}}>
<Radio value={i} className={"fl"} style={{"text-align": "left",marginTop:"3px"}}></Radio>
{/*<pre className={"break_word flex1 fl"}*/}
{/* style={{"text-align": "left"}}>{items.answer_text}</pre>*/}
{/*<span className={"break_word flex1"}><pre className={"break_word flex1"}>{items.answer_text}</pre> </span>*/}
@ -2510,7 +2540,7 @@ class PollNew extends Component {
(<CheckboxGroup defaultChecked={false} disabled>
{item.question.answers === undefined ? "" : item.question.answers.map((items, i) => {
return (
<div className="mt10 mt20 mb20 " style={{"clear": "both"}}>
<div className="mt10 pt20 " style={{"clear": "both"}}>
<Checkbox value={i} className={"fl"} style={{"text-align": "left"}}></Checkbox>
<span className={" flex1"} style={{"text-align": "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1120px"}}>{items.answer_text}</span>
@ -2536,7 +2566,7 @@ class PollNew extends Component {
{this.state.adddom === undefined ? "" : this.state.adddom.map((itemo, indexo) => {
// console.log('打印this.state.adddom')
// console.log(itemo.question)
// console.log(this.state.adddom);
let arrid = itemo.question.id;
let resultDomtwo;
resultDomtwo =
@ -2769,7 +2799,7 @@ class PollNew extends Component {
this.props.match.params.news === "new" ?
this.state.Newedit === false ?
<div>
<div className=" mb10" style={{"border-bottom": "1px solid #eee"}}></div>
<div className=" mb10" style={this.state.adddom === undefined?{"border-bottom": "0.5px solid #ffffff"}:this.state.adddom.length <1? {"border-bottom": "0.5px solid #ffffff"}:{"border-bottom": "0.5px solid #eee"}}></div>
<div style={{"padding": "10px 30px 20px 30px"}}>
<ActionBtn style="green" className="mr20" onClick={() => this.addmysingles()}><i
@ -2784,7 +2814,7 @@ class PollNew extends Component {
: ""
:
<div>
<div className=" mb10" style={{"border-bottom": "1px solid #eee"}}></div>
<div className=" mb10" style={this.state.adddom === undefined? {"border-bottom": "0.5px solid #ffffff"}:this.state.adddom.length <1? {"border-bottom": "0.5px solid #ffffff"}:{"border-bottom": "0.5px solid #eee"}}></div>
<div style={{"padding": "10px 30px 20px 30px"}}>
<ActionBtn style="green" className="mr20" onClick={() => this.addmysingles()}><i
className="iconfont icon-tianjiafangda font-15 mr10"></i></ActionBtn>

@ -41,7 +41,7 @@ class Homeworddescription extends Component {
super(props);
this.state = {
props: props,
description:undefined,
description:props.description,
}
@ -74,10 +74,8 @@ class Homeworddescription extends Component {
<div >
<div style={{
"background-color":"#FFFFff",
"margin-top":"20px",
"padding":"20px 20px",
"position": "relative",
"border-bottom": "1px solid #EDEDED",
"margin-bottom":" 0px"}}>
<style>
{`
@ -85,7 +83,8 @@ class Homeworddescription extends Component {
`}
</style>
<Form.Item
label="作业说明"
label=""
className="mdInForm"
>
{/*<TextArea placeholder="作业说明..." value={this.state.description} onInput={this.settextarea} style={{"height": "120px"}}/>*/}
{/*<TextArea style={{"height": "120px"}}*/}
@ -93,7 +92,7 @@ class Homeworddescription extends Component {
<TPMMDEditor ref={this.mdRef} placeholder={'作业说明'}
mdID={'courseMessageMD'} initValue={this.state.description} className="courseMessageMD" onChange={this.settextarea} style={{"height": "120px"}}></TPMMDEditor>
</Form.Item>
<div className="clearfix">
<div className="clearfix mt10">
<Button type="primary" className="defalutSubmitbtn fr mr20 "style={{"width":"90px"}} onClick={this.onSaveExercise} >保存</Button>
<Button className="defalutCancelbtn fr mr20 w20" style={{"width":"90px"}} onClick={this.clickcancel} >取消</Button>
</div>

@ -61,6 +61,7 @@ class Listofworks extends Component {
props: props,
data: [],
page: 1,
computeTimetype:true,
limit: 20,
loadingstate: true,
order: "update_time",
@ -752,6 +753,7 @@ class Listofworks extends Component {
let {page, limit} = this.state;
let datalist = [];
let columns = this.state.columns;
// var columns2=[];
if (teacherdata !== undefined) {
for (var i = 0; i < student_works.length; i++) {
var timedata = moment(student_works[i].update_time).format('YYYY-MM-DD HH:mm');
@ -767,7 +769,7 @@ class Listofworks extends Component {
updatetime: timedata === "Invalid date" ? "--" : timedata,
completion: student_works[i].complete_count === null ? "0" :student_works[i].complete_count === undefined ? "0": student_works[i].complete_count,
levelscore: student_works[i].final_score,
efficiencyscore: student_works[i].eff_score,
efficiencyscore: student_works[i].eff_score==="0.0"?"--":student_works[i].eff_score==="0"?"--":student_works[i].eff_score,
finalscore: student_works[i].work_score,
operating: "查看",
late_penalty: student_works[i].late_penalty=== null?"0":student_works[i].late_penalty === undefined?"0":student_works[i].late_penalty,
@ -786,84 +788,84 @@ class Listofworks extends Component {
if (work_efficiency === false) {
if(JSON.stringify(course_group_info) === "[]"|| course_group_info === undefined||course_group_info === null){
//这里没有分班 没有 关卡得分 没有效率分
columns.map((item,key)=>{
for(var i=0;i< this.state.columns.length;i++){
var item = this.state.columns[i];
if(item.title==="分班"){
columns.splice(key,1)
}
if(item.title==="关卡得分"){
columns.splice(key,1)
else if(item.title==="关卡得分"){
}
if(item.title==="效率分"){
columns.splice(key,1)
else if(item.title==="效率分"){
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnss.splice(key,1)
}
else if(this.props.isNotMember()===true&&item.title==="学号") {
}else{
columns.push(item);
}
})
}
}else{
if(course_group_info.length < 2){
columns.map((item,key)=>{
for(var i=0;i< this.state.columns.length;i++){
var item = this.state.columns[i];
if(item.title==="分班"){
columns.splice(key,1)
}
if(item.title==="关卡得分"){
columns.splice(key,1)
else if(item.title==="关卡得分"){
}
if(item.title==="效率分"){
columns.splice(key,1)
else if(item.title==="效率分"){
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnss.splice(key,1)
}
else if(this.props.isNotMember()===true&&item.title==="学号") {
}else{
columns.push(item);
}
})
}else {
}
columns.map((item,key)=>{
if(item.title==="关卡得分"){
columns.splice(key,1)
}else {
for(var i=0;i< this.state.columns.length;i++){
var item = this.state.columns[i];
if(item.title==="关卡得分"){
}
if(item.title==="效率分"){
columns.splice(key,1)
else if(item.title==="效率分"){
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnss.splice(key,1)
}
else if(this.props.isNotMember()===true&&item.title==="学号") {
}else{
columns.push(item);
}
})
}
}
}
}else {
if(JSON.stringify(course_group_info) === "[]"|| course_group_info === undefined || course_group_info === null){
columns.map((item,key)=>{
if(item.title==="分班"){
columns.splice(key,1)
for(var i=0;i< this.state.columns.length;i++){
var item = this.state.columns[i];
if(item.title==="分班"){
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnss.splice(key,1)
}
else if(this.props.isNotMember()===true&&item.title==="学号") {
}else{
columns.push(item);
}
})
}
}else {
if(course_group_info.length < 2) {
columns.map((item,key)=>{
for(var i=0;i< this.state.columns.length;i++){
var item = this.state.columns[i];
if(item.title==="分班"){
columns.splice(key,1)
}
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columnss.splice(key,1)
}
else if(this.props.isNotMember()===true&&item.title==="学号") {
}else{
columns.push(item);
}
})
}
}
columns=this.state.columnss;
}
@ -1182,8 +1184,6 @@ class Listofworks extends Component {
}).catch((error) => {
console.log(error)
});
}
// 立即发布
homeworkstartend = (ds,endtime) => {
@ -1313,10 +1313,24 @@ class Listofworks extends Component {
}
setComputeTime=()=>{
this.setState({
computeTimetype:false
})
let homeworkid = this.props.match.params.homeworkid;
let url = "/homework_commons/"+homeworkid+"/update_score.json";
axios.get(url).then((response) => {
this.props.showNotification(`${response.data.message}`);
}).catch((error) => {
console.log(error)
});
}
render() {
// console.log("Listofworks.js000")
let {columns, page, boolgalist,limit,experience,course_groupysls, course_groupyslstwo, unlimited, unlimitedtwo, loadingstate, viewtrainingdata, game_list, data, course_group_info, order, teacherdata, task_status, checkedValuesine, searchtext, teacherlist, visible, visibles, jobsettingsdata} = this.state;
let {columns,computeTimetype, page, boolgalist,limit,experience,course_groupysls, course_groupyslstwo, unlimited, unlimitedtwo, loadingstate, viewtrainingdata, game_list, data, course_group_info, order, teacherdata, task_status, checkedValuesine, searchtext, teacherlist, visible, visibles, jobsettingsdata} = this.state;
//
// console.log(teacherdata&&teacherdata.shixun_identifier)
// console.log(course_group_info)
@ -1345,8 +1359,8 @@ class Listofworks extends Component {
{
`
body {
overflow: hidden !important;
}
overflow: hidden !important;
}
`
}
</style>
@ -1418,6 +1432,7 @@ class Listofworks extends Component {
</div>
<div className="edu-back-white">
<div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white poll_list">
@ -1426,7 +1441,7 @@ class Listofworks extends Component {
<Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/questions`}>作业问答</Link>
{this.props.isAdmin() ?
this.state.code_review === true ? "" : <Link
this.state.code_review === true ||jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0]==="未发布"? "" : <Link
// to={`/courses/${this.state.props.match.params.coursesId}/${this.state.props.match.params.homeworkid}/student_work`}
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/student_work`}>
代码查重</Link> : ""}
@ -1481,10 +1496,83 @@ class Listofworks extends Component {
</div>
</div>
<style>
{`
.startbox{
height: 48px;
background: rgba(255,104,0,0.1);
line-height: 48px;
text-align: center;
}
.startfont{
font-size:14px;
font-family:MicrosoftYaHei;
font-weight:400;
color:rgba(255,104,0,1);
}
.computeTime{
width: 73px;
height: 24px;
display: inline-block;
padding: 5px;
text-align: center;
line-height: 13px;
color: #4CACFF;
border: 1px solid #4CACFF;
cursor: pointer;
}
.computeTimes{
width: 73px;
height: 24px;
display: inline-block;
padding: 5px;
text-align: center;
line-height: 13px;
color: #C5C5C5;
border: 1px solid #EDEDED;
background:#EDEDED;
cursor: pointer;
}
`}
</style>
{computeTimetype===false?<li className="clearfix startbox">
<span className={"startfont"}>
正在执行成绩计算请稍后刷新页面查看结果
温馨提示执行时间因作品数量而异
</span>
</li>:""}
{/*作品状态GraduationTaskssettinglist*/}
<ul className="clearfix" style={{padding: '20px 15px 10px 20px'}}>
<li className="clearfix ">
<span className="fl mr10 color-grey-6 ">计算成绩时间{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span>
<span>
{computeTimetype===true?<div className={"computeTime font-13"} onClick={this.setComputeTime}>
计算成绩
</div>:<div className={"computeTimes font-13"} onClick={this.setComputeTime}>
计算成绩
</div>}
</span>
<div className="fr mr5 search-newysl" style={{marginBottom: '1px'}}>
<Search
placeholder="请输入姓名或学号搜索"
id="subject_search_input"
autoComplete="off"
value={searchtext}
onKeyUp={(e) => this.onSearchKeywordKeyUp(e)}
onInput={this.inputSearchValues}
onSearch={this.searchValues}
></Search>
</div>
</li>
<li className="clearfix mt10">
<span className="fl mr10 color-grey-8 ">作品状态</span>
<span className="fl "><a id="graduation_comment_no_limit"
@ -1508,17 +1596,7 @@ class Listofworks extends Component {
</CheckboxGroup>
{/*请输入姓名或学号搜索*/}
<div className="fr mr5 search-newysl" style={{marginBottom: '1px'}}>
<Search
placeholder="请输入姓名或学号搜索"
id="subject_search_input"
autoComplete="off"
value={searchtext}
onKeyUp={(e) => this.onSearchKeywordKeyUp(e)}
onInput={this.inputSearchValues}
onSearch={this.searchValues}
></Search>
</div>
</li>

@ -41,6 +41,7 @@ class Listofworksstudentone extends Component {
data: [],
datas: [],
view_report:false,
computeTimetype:true,
page: 1,
pages: 1,
limit: 20,
@ -390,16 +391,16 @@ class Listofworksstudentone extends Component {
let datalist = [];
let datalists = [];
var styletable = {"display": "none"}
var arr =[];
for(var i=0;i<this.state.columns.length;i++){
var item = this.state.columns[i];
if(this.props.isNotMember()===true&&item.title==="学号") {
this.state.columns.map((item,key)=>{
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columns.splice(key,1)
}
}else{
arr.push(item);
}
})
let columns2=this.state.columns;
}
let columns2= arr;
var teacherlist = undefined;
var teacherlists = undefined;
if (teacherdata !== undefined) {
@ -508,14 +509,18 @@ class Listofworksstudentone extends Component {
// 设置数据
seacthdata = (teacherdata) => {
let datalist = [];
this.state.columns.map((item,key)=>{
if(this.props.isNotMember()===true) {
if(item.title==="学号"){
this.state.columns.splice(key,1)
}
var arr =[];
for(var i=0;i<this.state.columns.length;i++){
var item = this.state.columns[i];
if(this.props.isNotMember()===true&&item.title==="学号") {
}else{
arr.push(item);
}
})
let columns2=this.state.columns;
}
let columns2= arr;
if (teacherdata !== undefined) {
// console.log("seacthdata设置数据")
@ -746,21 +751,78 @@ class Listofworksstudentone extends Component {
this.Getalistofworkstwo(this.state.order, "", "", "", pageNumber, this.state.limit);
}
setComputeTime=()=>{
let {teacherdata}=this.state;
this.setState({
computeTimetype:false
})
let homeworkid = this.props.match.params.homeworkid;
let url = "/homework_commons/"+homeworkid+"/update_student_score.json?shixun_id="+teacherdata.shixun_id;
axios.get(url).then((response) => {
this.props.showNotification(`${response.data.message}`);
}).catch((error) => {
console.log(error)
});
}
render() {
let {visibles, game_list,columns, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate} = this.state;
let {visibles, game_list,columns, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate,computeTimetype} = this.state;
return (
teacherdata === undefined || teacherdata.student_works === undefined || teacherdata.student_works === null || JSON.stringify(teacherdata.student_works) === "[]" ?
// 学生不能查看别人的
<div className="newMain clearfix ">
<style>
{`
.startbox{
height: 48px;
background: rgba(255,104,0,0.1);
line-height: 48px;
text-align: center;
}
.startfont{
font-size:14px;
font-family:MicrosoftYaHei;
font-weight:400;
color:rgba(255,104,0,1);
}
.computeTime{
width: 73px;
height: 24px;
display: inline-block;
padding: 5px;
text-align: center;
line-height: 13px;
color: #4CACFF;
border: 1px solid #4CACFF;
cursor: pointer;
}
.computeTimes{
width: 73px;
height: 24px;
display: inline-block;
padding: 5px;
text-align: center;
line-height: 13px;
color: #C5C5C5;
border: 1px solid #EDEDED;
background:#EDEDED;
cursor: pointer;
}
`}
</style>
{visibles === true ?
<div>
<style>
{
`
body {
overflow: hidden !important;
}
overflow: hidden !important;
}
`
}
</style>
@ -833,6 +895,14 @@ class Listofworksstudentone extends Component {
</div>
{computeTimetype===false?<li className="clearfix startbox mb20">
<span className={"startfont"}>
正在执行成绩计算请稍后刷新页面查看结果
温馨提示执行时间因作品数量而异
</span>
</li>:""}
{JSON.stringify(data) !== "[]" ?
<div>
<div id="graduation_work_list"
@ -843,17 +913,32 @@ class Listofworksstudentone extends Component {
}}>
<div className="clearfix">
<span className="fl color-grey-6 font-12"><span
className="color-orange-tip">{teacherdata === undefined ? "" : teacherdata.commit_count === undefined ? "" : teacherdata.commit_count}</span><span
className="ml10">{teacherdata === undefined ? "" : teacherdata.uncommit_count}</span><span></span>
{teacherdata === undefined ? "" : teacherdata.left_time === undefined ? "" : teacherdata.left_time === null ? "" :
<span className="ml20">{teacherdata.left_time.status}</span>
}
{teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" :
<span className="ml20"
style={{"color": '#FF6800'}}>{teacherdata.left_time.time}</span>
}
</span>
<span className="fl color-grey-6 font-12">
<span
className="color-orange-tip">{teacherdata === undefined ? "" : teacherdata.commit_count === undefined ? "" : teacherdata.commit_count}</span><span
className="ml10">{teacherdata === undefined ? "" : teacherdata.uncommit_count}</span><span></span>
{teacherdata === undefined ? "" : teacherdata.left_time === undefined ? "" : teacherdata.left_time === null ? "" :
<span className="ml20">{teacherdata.left_time.status}</span>
}
{teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" :
<span className="ml20"
style={{"color": '#FF6800'}}>{teacherdata.left_time.time}</span>
}
</span>
<div className="fr">
<span className="fl mr10 color-grey-6 ">计算成绩时间{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span>
{teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"":<span>
{computeTimetype===true?<div className={"computeTime font-13"} onClick={this.setComputeTime}>
计算成绩
</div>:<div className={"computeTimes font-13"} onClick={this.setComputeTime}>
计算成绩
</div>}
</span>}
</div>
</div>
@ -962,17 +1047,14 @@ class Listofworksstudentone extends Component {
</div>
</div>
{computeTimetype===false?<li className="clearfix startbox mb20">
<span className={"startfont"}>
正在执行成绩计算请稍后刷新页面查看结果
温馨提示执行时间因作品数量而异
</span>
</li>:""}
{/*<div id="graduation_work_list" style={{padding: '0px 40px 10px 40px'}}>*/}
{/* <div className="clearfix">*/}
{/* <span className="fl color-grey-6 font-12"><span className="color-orange-tip">89</span>已交<span*/}
{/* className="ml10">9000</span><span>未交</span> <span className="ml20">剩余提交时间:</span><span*/}
{/* className="ml20">{this.state.day}天 {this.state.hour}:{this.state.minute}:{this.state.second}</span></span>*/}
{/* </div>*/}
{/*</div>*/}
<div className="edu-table edu-back-white ">
{data === undefined ? "" : <Table
style={styletable}
@ -991,33 +1073,90 @@ class Listofworksstudentone extends Component {
"margin-bottom": "10px"
}}>
<div className="clearfix">
<span className="fl color-grey-6 font-12"><span
className="color-orange-tip">{teacherdata === undefined ? "" : teacherdata.commit_count === undefined ? "" : teacherdata.commit_count}</span><span
className="ml10">{teacherdata === undefined ? "" : teacherdata.uncommit_count}</span><span></span>
{teacherdata === undefined ? "" : teacherdata.left_time === undefined ? "" : teacherdata.left_time === null ? "" :
<span className="ml20">{teacherdata.left_time.status}</span>}
{teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" :
<span className="ml20"
style={{"color": '#FF6800'}}>{teacherdata.left_time.time}</span>}
</span>
<div className="fr edu-menu-panel">
<ul>
<li className="edu-position edu-position-hidebox">
<a className="font-12 ">
{order === "updated_at" ? "时间" : order === "work_score" ? "成绩" : order === "student_id" ? "学号" : ""}排序</a>
<i className="iconfont icon-xiajiantou ml5 font-12 "></i>
<ul className="edu-position-hide undis mt10">
<li><a onClick={(e) => this.funorder("updated_at")} data-remote="true"
className="color-grey-6 font-12" style={{"text-align": "center "}}>更新时间</a></li>
<li><a onClick={(e) => this.funorder("work_score")} data-remote="true"
className="color-grey-6 font-12" style={{"text-align": "center "}}>最终成绩</a></li>
<li><a onClick={(e) => this.funorder("student_id")} data-remote="true"
className="color-grey-6 font-12" style={{"text-align": "center "}}>学生学号</a></li>
</ul>
</li>
</ul>
<span className="fl color-grey-6 font-12">
<span className="color-orange-tip">
{teacherdata === undefined ? "" : teacherdata.commit_count === undefined ? "" : teacherdata.commit_count}
</span>
<span className="ml10">{teacherdata === undefined ? "" : teacherdata.uncommit_count}</span><span></span>
{teacherdata === undefined ? "" : teacherdata.left_time === undefined ? "" : teacherdata.left_time === null ? "" :
<span className="ml20">{teacherdata.left_time.status}</span>}
{teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" :
<span className="ml20"
style={{"color": '#FF6800'}}>{teacherdata.left_time.time}</span>}
</span>
<style>
{`
.startbox{
height: 48px;
background: rgba(255,104,0,0.1);
line-height: 48px;
text-align: center;
}
.startfont{
font-size:14px;
font-family:MicrosoftYaHei;
font-weight:400;
color:rgba(255,104,0,1);
}
.computeTime{
width: 73px;
height: 24px;
display: inline-block;
padding: 5px;
text-align: center;
line-height: 13px;
color: #4CACFF;
border: 1px solid #4CACFF;
cursor: pointer;
}
.computeTimes{
width: 73px;
height: 24px;
display: inline-block;
padding: 5px;
text-align: center;
line-height: 13px;
color: #C5C5C5;
border: 1px solid #EDEDED;
background:#EDEDED;
cursor: pointer;
}
`}
</style>
<div className="fr">
<span className="fl mr10 color-grey-6 ">计算成绩时间{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span>
{teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"":<span>
{computeTimetype===true?<div className={"computeTime font-13"} onClick={this.setComputeTime}>
计算成绩
</div>:<div className={"computeTimes font-13"} onClick={this.setComputeTime}>
计算成绩
</div>}
</span>}
</div>
{/*因为计算按钮占了和这个位置,和设计沟通学生视角取消这个按钮*/}
{/*<div className="fr edu-menu-panel">*/}
{/*<ul>*/}
{/*<li className="edu-position edu-position-hidebox">*/}
{/*<a className="font-12 ">*/}
{/*{order === "updated_at" ? "时间" : order === "work_score" ? "成绩" : order === "student_id" ? "学号" : ""}排序</a>*/}
{/*<i className="iconfont icon-xiajiantou ml5 font-12 "></i>*/}
{/*<ul className="edu-position-hide undis mt10">*/}
{/*<li><a onClick={(e) => this.funorder("updated_at")} data-remote="true"*/}
{/*className="color-grey-6 font-12" style={{"text-align": "center "}}>更新时间</a></li>*/}
{/*<li><a onClick={(e) => this.funorder("work_score")} data-remote="true"*/}
{/*className="color-grey-6 font-12" style={{"text-align": "center "}}>最终成绩</a></li>*/}
{/*<li><a onClick={(e) => this.funorder("student_id")} data-remote="true"*/}
{/*className="color-grey-6 font-12" style={{"text-align": "center "}}>学生学号</a></li>*/}
{/*</ul>*/}
{/*</li>*/}
{/*</ul>*/}
{/*</div>*/}
</div>

@ -94,7 +94,6 @@ class ShixunStudentWork extends Component {
let url = "/homework_commons/" + homeworkid + "/code_review_results.json";
axios.get(url).then((response) => {
debugger
if (response.data.status === undefined || response.data.status === 0) {
if(response.data!=undefined){
if(response.data.status!=-2){
@ -688,6 +687,7 @@ class ShixunStudentWork extends Component {
<span className="fl mr10 color-grey-8">分班情况</span>
<span className="fl ">
<a id="graduation_comment_no_limit"
onClick={()=>this.groupgroup([])}
className={this.state.group_infolist.length===0?"pl10 pr10 mr20 check_on":"pl10 pr10 mr20 "}>
不限
</a>
@ -756,7 +756,7 @@ class ShixunStudentWork extends Component {
dataSource={datalist}
columns={columns}
pagination={{ //分页
total: data&&data.all_reviews_count, //数据总数量
total: datalist.length===0?0:data&&data.all_reviews_count, //数据总数量
pageSize: 10, //显示几条一页
current:page,
}}

@ -1,6 +1,6 @@
import React, {Component} from "react";
import {WordsBtn} from 'educoder';
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider,InputNumber, Tag,DatePicker,Radio,Tooltip} from "antd";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider,InputNumber, Tag,DatePicker,Radio,Tooltip,Spin} from "antd";
import {Link,Switch,Route,Redirect} from 'react-router-dom';
import axios from 'axios';
import ShixunCustomsPass from "./Shixunworkdetails/ShixunCustomsPass";
@ -17,22 +17,27 @@ class ShixunWorkDetails extends Component {
constructor(props) {
super(props);
this.state = {
data:undefined
data:undefined,
spinning:true
}
}
componentDidMount() {
this.setState({
spinning:true
})
let homeworkid=this.props.match.params.homeworkid;
let userid=this.props.match.params.userid;
let url = "/homework_commons/"+homeworkid+"/code_review_detail.json";
axios.get(url,{
axios.get(url,{
params: {
user_id:userid,
}
}).then((result) => {
if (result.status === 200) {
this.setState({
data:result.data
data:result.data,
spinning:false
})
}
}).catch((error) => {
@ -46,30 +51,36 @@ class ShixunWorkDetails extends Component {
})
}
goback=()=>{
window.history.go(-1)
goback=(sum)=>{
let{data}=this.state
if(sum===1){
window.location.href = "/courses/"+data.course_id+"/students";
}else{
window.history.go(-1)
}
}
render() {
let{data}=this.state;
return (
data===undefined?"":<div className="newMain clearfix ">
<Spin size="large" spinning={this.state.spinning}>
{data===undefined? "":<div className="newMain clearfix ">
<div className={"educontent mb20"}>
<div className="educontent">
<p className="clearfix mt20">
<WordsBtn className="fl color-grey-9" style="btn colorgrey hovercolorblue">
<Link to={"/courses/"+data&&data.course_id+"/students"}>
<span className={"color-grey-9"}>{data&&data.course_name}</span>
</Link>
</WordsBtn>
<a className="fl color-grey-9 btn colorgrey hovercolorblue"
onClick={()=>this.goback(1)}
>
<span className={"color-grey-9"}>{data&&data.course_name}123</span>
</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="btn colorgrey fl hovercolorblue ">
<Link to={"/courses/"+data&&data.course_id+"/"+this.state.shixuntypes+"/"+data&&data.homework_common_id}>
<a className="btn colorgrey fl hovercolorblue grey"
onClick={this.goback}
// to={"/courses/"+data&&data.course_id+"/"+this.state.shixuntypes+"/"+data&&data.homework_common_id}
>
<span className={"color-grey-9"}>实训作业</span>
</Link>
</WordsBtn>
</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">{data&&data.username}</WordsBtn>
</p>
@ -100,8 +111,8 @@ class ShixunWorkDetails extends Component {
</div>
</div>
</div>}
</Spin>
)
}
}

@ -360,7 +360,7 @@ class ShixunhomeWorkItem extends Component{
</style>
{this.props.isAdmin?<div className={this.props.isClassManagement?"homepagePostSetting homepagePostSettingname":"homepagePostSetting homepagePostSettingbox"} style={{"right":"-2px","top":"44px","display":"block"}}>
<a className="btn colorblue font-16" href={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</a>
{this.props.isClassManagement?<a onClick={()=>this.editname(discussMessage.name,discussMessage.homework_id)} className={"btn colorblue ml20 font-16"}>重命名</a>:""}
{this.props.isAdminOrTeacher()?<a onClick={()=>this.editname(discussMessage.name,discussMessage.homework_id)} className={"btn colorblue ml20 font-16"}>重命名</a>:""}
<WordsBtn className="btn colorblue ml20 font-16" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings`} > 设置</WordsBtn>
</div>:""}

@ -15,7 +15,7 @@ class ShixunWorkModal extends Component{
}
componentDidMount() {
let {group_list}=this.state;
let url="/homework_commons/"+this.props.match.params.homeworkid+"/group_list.json";
let url="/homework_commons/"+this.props.match.params.homeworkid+"/group_list.json";
axios.get(url,{params:{
limit:10,
page:1,
@ -49,7 +49,7 @@ class ShixunWorkModal extends Component{
//勾选实训
shixunhomeworkedit=(checkedValues)=>{
let types=false
let types=false
let{group_list}=this.state;
group_list.map((item,key)=>{
if(item!=undefined){
@ -87,7 +87,6 @@ class ShixunWorkModal extends Component{
let {page,limit,group_list}=this.state;
let newpage=page+1;
let newgroup_list=group_list;
let url="/homework_commons/"+this.props.match.params.homeworkid+"/group_list.json";
axios.get(url,{params:{
@ -97,7 +96,7 @@ class ShixunWorkModal extends Component{
}).then((response) => {
if(response!==null || response!==undefined){
if(response.data.group_list.length>0){
console.log("84");
response.data.group_list.map((item,key)=>{
newgroup_list.push(item);
this.setState({
@ -111,8 +110,7 @@ class ShixunWorkModal extends Component{
if(response.data.ungroup_list===undefined || response.data.ungroup_list === null) {
}else {
console.log("95");
console.log(response.data.ungroup_list);
newgroup_list.push(response.data.ungroup_list);
this.setState({
course_groups:response.data,
@ -134,30 +132,30 @@ class ShixunWorkModal extends Component{
let {data}=this.props;
if(e.target.checked===true){
if(data&&data.length===0){
if(data&&data.length===0){
let id=[]
group_list.forEach((item,key)=>{
id.push(item.id)
})
this.setState({
group_ids:id,
onChangetype:e.target.checked
})
}else{
let id=[]
group_list.forEach((item,key)=>{
id.push(item.id)
})
this.setState({
group_ids:id,
onChangetype:e.target.checked
})
}
}else{
this.setState({
group_ids:[],
group_ids:id,
onChangetype:e.target.checked
})
}else{
let id=[]
group_list.forEach((item,key)=>{
id.push(item.id)
})
this.setState({
group_ids:id,
onChangetype:e.target.checked
})
}
}else{
this.setState({
group_ids:[],
onChangetype:e.target.checked
})
}
}
@ -187,7 +185,7 @@ class ShixunWorkModal extends Component{
message:"提示",
description: response.data.message
});
console.log(this.props)
console.log(this.props)
}else if(response.data.status === -1){
notification.open({
message:"提示",
@ -222,8 +220,8 @@ class ShixunWorkModal extends Component{
render(){
let {course_groups,group_ids,onChangetype,group_list}=this.state;
// let {data}=this.props;
// console.log(group_list)
// console.log(course_groups)
// console.log(group_list)
console.log(group_list)
return(
<div>
<Modal
@ -244,67 +242,66 @@ class ShixunWorkModal extends Component{
.fontlefts{text-align: left;}
`}</style>
<ul className="clearfix edu-txt-center">
<li className="fl paddingleft22 fontlefts" style={{width:'150px'}}>分班名称</li>
<li className="fl edu-txt-left" style={{width:'150px'}}>有效作品数</li>
<li className="fl paddingleft22 fontlefts" style={{width:'260px'}}>分班名称</li>
<li className="fl edu-txt-left" style={{width:'117px'}}>有效作品数</li>
<li className="fl" style={{width:'100px'}}>上次查重时间</li>
</ul>
{course_groups===undefined?"":
<ul className="upload_select_box fl clearfix mt10 mb10" tyle={{"overflow-y":"auto"}}id="search_not_members_list"
onScroll={this.contentViewScroll}
>
<Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit} value={group_ids}>
{
group_list===undefined?
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE">
<li className="fl" style={{width: '100px'}}>
<Checkbox
className="fl task-hide edu-txt-left"
name="shixun_homework[]"
value={course_groups.ungroup_list.id}
>
<label style={{"textAlign": "left", "color": "#05101A"}}
className="task-hide color-grey-name" title="frerere">{course_groups.ungroup_list.name}</label>
</Checkbox>
</li>
<li className="fl" style={{width: '150px'}}>
{course_groups.ungroup_list.works_count}
</li>
<li className="fl" style={{width: '160px'}}>
{course_groups.ungroup_list.last_review_time}
</li>
</div>
:
group_list&&group_list.map((item,key)=>{
return(
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
<li className="fl" style={{width: '100px'}}>
<Checkbox
className="fl task-hide edu-txt-left"
name="shixun_homework[]"
value={item=== undefined?"":item.id}
>
<label style={{"textAlign": "left", "color": "#05101A"}}
className="task-hide color-grey-name" title="frerere">{item===undefined?"":item.name}</label>
</Checkbox>
</li>
<li className="fl" style={{width: '150px'}}>
{item===undefined?"":item.works_count}
</li>
<li className="fl" style={{width: '160px'}}>
{item===undefined?"":item.last_review_time}
</li>
</div>
onScroll={this.contentViewScroll}
>
<Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit} value={group_ids}>
{
group_list===undefined?course_groups.ungroup_list.work_count===0?"":
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE">
<li className="fl task-hide" style={{width: '240px'}}>
<Checkbox
className="fl task-hide edu-txt-left"
name="shixun_homework[]"
value={course_groups.ungroup_list.id}
>
<label style={{"textAlign": "left", "color": "#05101A"}}
className="task-hide color-grey-name" title="frerere">{course_groups.ungroup_list.name}</label>
</Checkbox>
</li>
<li className="fl" style={{width: '100px'}}>
{course_groups.ungroup_list.work_count}
</li>
<li className="fl" style={{width: '160px'}}>
{course_groups.ungroup_list.last_review_time}
</li>
</div>
:
group_list&&group_list.length===0?"":group_list[0]===undefined?"":group_list.map((item,key)=>{
return(
item.work_count===0?"":<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
<li className="fl task-hide" style={{width: '240px'}}>
<Checkbox
className="fl task-hide edu-txt-left"
name="shixun_homework[]"
value={item=== undefined?"":item.id}
>
<label style={{"textAlign": "left", "color": "#05101A"}}
className="task-hide color-grey-name" title="frerere">{item===undefined?"":item.name}</label>
</Checkbox>
</li>
<li className="fl" style={{width: '100px'}}>
{item===undefined?"":item.works_count===undefined?item.work_count:item.works_count}
</li>
<li className="fl" style={{width: '160px'}}>
{item===undefined?"":item.last_review_time}
</li>
</div>
)
})
}
</Checkbox.Group>
</ul>
}
</Checkbox.Group>
</ul>
}
<div className={"clearfix"}>
<Checkbox checked={onChangetype} onChange={this.onChange} className={"ml10"}>{onChangetype===true?"清除":"全选"}</Checkbox>

@ -1676,7 +1676,7 @@ class Trainingjobsetting extends Component {
}
<Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/questions`}>作业问答</Link>
{this.props.isAdmin()?this.state.code_review===true?"": <Link
{this.props.isAdmin()?this.state.code_review===true||jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0]==="未发布"?"": <Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/student_work`}>代码查重</Link> : ""}
<style>{
@ -1715,8 +1715,8 @@ class Trainingjobsetting extends Component {
{/*发布设置*/}
<div className="stud-class-set bor-bottom-greyE edu-back-white">
<div className=" mt20 pl20">
<p className=" clearfix ">
<span className="font-16 fl "style={{"color":"#05101A"}}>发布设置 <span className="ml15 color-grey-9" style={{"font-size":"14px","text-align":"left"}}>(选中则所有分班使用相同的发布设置否则各个分班单独设置)</span></span>
<p className=" clearfix " style={{height:"41px"}}>
<span className="font-16 fl "style={{"color":"#05101A"}}>发布设置 <span className="ml15 color-grey-9" style={{"font-size":"14px","text-align":"left"}}></span></span>
{
!flagPageEdit && this.props.isAdmin() === true ?
<a className="fr" onClick={this.editSetting}><Tooltip title="编辑"><i
@ -1746,7 +1746,7 @@ class Trainingjobsetting extends Component {
unifiedsetting === undefined ? "" : unifiedsetting=== true ?
<div>
<div className="clearfix mb5 ml15">
<span className="font-16 mr15 fl mt6" style={{"color":"#999999"}}>发布时间</span>
<span className="font-16 fl mt6" style={{"color":"#999999"}}>发布时间</span>
<Tooltip placement="bottom" title={this.props.isSuperAdmin() ? "" : !flagPageEditstwo === true ? "发布时间已过,则不能修改" : ""}>
<div className="fl">
<DatePicker
@ -1768,18 +1768,18 @@ class Trainingjobsetting extends Component {
disabled={!flagPageEditstwo}
dropdownClassName="hideDisable"
/>
<p className="color-red lineh-25 clearfix" style={{height:"25px"}}>
{
unit_p_tip && unit_p_tip != "" ? <span className="fl">{ unit_p_tip }</span>:""
}
</p>
</div>
</Tooltip>
<span className="ml20 fl mt10" style={{"color":"#999999","text-align":"left","font-size":"14px"}}>(学生收到作业的时间)</span>
</div>
<div className="clearfix ml15">
<span className="mr15 fl mt10 font-16" style={{"color":"#999999"}}>截止时间</span>
<p className="color-red lineh-25 clearfix" style={{height:"25px"}}>
{
unit_p_tip && unit_p_tip != "" ? <span className="fl">{ unit_p_tip }</span>
: ""
}
</p>
<div className="clearfix ml15 mb5">
<span className=" fl mt10 font-16" style={{"color":"#999999"}}>截止时间</span>
<Tooltip placement="bottom" title={this.props.isSuperAdmin() ? "" : !flagPageEditsthrees === true ? "截止时间已过,则不能修改" : ""}>
<div className="fl">
<DatePicker
@ -1801,16 +1801,16 @@ class Trainingjobsetting extends Component {
disabled={!flagPageEditsthrees}
dropdownClassName="hideDisable"
/>
<p className="color-red lineh-25 clearfix" style={{height:"25px"}}>
{
unit_e_tip && unit_e_tip != "" ? <span className="fl">{ unit_e_tip }</span>:""
}
</p>
</div>
</Tooltip>
<span className=" ml20 fl mt10 color-grey-9" style={{"text-align":"left","font-size":"14px"}}>(学生按时提交作品的时间截点)</span>
</div>
<p className="color-red lineh-25 clearfix" style={{height:"25px"}}>
{
unit_e_tip && unit_e_tip != "" ? <span className="fl">{ unit_e_tip }</span> :""
}
</p>
</div>
:
<div

@ -401,7 +401,7 @@ class Workquestionandanswer extends Component {
className="active"
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/questions`}>作业问答</Link>
{this.props.isAdmin()?
this.state.code_review===true?"":<Link
this.state.code_review===true||jobsettingsdata === undefined ? [""] : jobsettingsdata.data.homework_status[0]==="未发布"?"":<Link
// to={`/courses/${this.state.props.match.params.coursesId}/${this.state.props.match.params.homeworkid}/student_work`}
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/student_work`}>
代码查重</Link>:""}
@ -410,10 +410,33 @@ class Workquestionandanswer extends Component {
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/settings`}
>设置</Link>
{/*<a className="fr color-blue font-16" href={`/api/homework_commons/${this.props.match.params.coursesId}/works_list.xls`}>导出成绩</a>*/}
{this.props.isAdmin() ? <a
className="fr color-blue font-16"
href={`/api/homework_commons/${this.props.match.params.coursesId}/works_list.xlsx`}
>导出</a> : ""}
<style>{`
.drop_down_menu li a {
padding: 0px;
font-size: 14px;
}
.drop_down_menu {
width: 93px;
}
.drop_down_menu li {
overflow: visible;
width: 93px;
}
.drop_down_menu, .drop_down_normal {
padding-top: 10px;
padding-bottom: 8px;
}
a:hover {
color:#1A0B00 !important;
}
`}</style>
{this.props.isAdmin() ? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding":"0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-0px","left":"unset","height":"auto"}}>
<li><a href={`/api/student_works/${jobsettingsdata === undefined ? "" :jobsettingsdata.data.category.category_id}/export_shixun_work_report.pdf`} >实训报告</a></li>
<li><a href={`/api/homework_commons/${jobsettingsdata === undefined ? "" :jobsettingsdata.data.category.category_id}/works_list.xlsx`} >学生成绩</a></li>
</ul>
</li> : ""}
{this.props.isAdmin() ?jobsettingsdata&&jobsettingsdata.data.end_immediately===true?
<a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a>:"" : ""}
{this.props.isAdmin() ?jobsettingsdata&&jobsettingsdata.data.publish_immediately===true?
@ -467,19 +490,31 @@ class Workquestionandanswer extends Component {
<div className="font-16 color-green fl pl20 mt10">作业说明:</div>
{
this.props.isAdmin()&&this.props.isAdmin()===true ?
(Showupdateinstructions&& Showupdateinstructions === true?"":
<Tooltip placement="top" title="编辑"><i
className="color-green font-18 iconfont icon-bianjidaibeijing fr pr20 " onClick={()=>this.jobdescriptiondisplaybj()} ></i></Tooltip>
:""
className="color-green font-18 iconfont icon-bianjidaibeijing fr pr20 " onClick={()=>this.jobdescriptiondisplaybj()} ></i></Tooltip>
):""
}
</div>
<span>
<div className="font-16 color-dark break_word flex1 pl20 " style={{"padding":"10px 10px 10px 20px"}}>
{jobsettingsdata === undefined ? "无" : jobsettingsdata === null ? "无" : jobsettingsdata === "null" ? "无" :
jobsettingsdata.data.explanation=== undefined?"无" :jobsettingsdata.data.explanation=== null?"无":
<div dangerouslySetInnerHTML={{__html:markdownToHTML(jobsettingsdata.data.explanation).replace(/▁/g,"▁▁▁")}}></div>
}
<div className="font-16 color-dark break_word flex1 " >
{ Showupdateinstructions&& Showupdateinstructions === true?
<div >
<Homeworddescription {...this.props} ReleaseNotes={this.ReleaseNotes} NOReleaseNotes ={this.NOReleaseNotes} description={jobsettingsdata === undefined ?"":jobsettingsdata === null ?"":jobsettingsdata === "null"?"": jobsettingsdata.data.explanation=== undefined?"":jobsettingsdata.data.explanation=== null?"":jobsettingsdata.data.explanation} ></Homeworddescription>
</div>
:
<div className="pl20 " style={{"padding":"10px 10px 10px 20px"}}>
{jobsettingsdata === undefined ? "无" : jobsettingsdata === null ? "无" : jobsettingsdata === "null" ? "无" :
jobsettingsdata.data.explanation=== undefined?"无" :jobsettingsdata.data.explanation=== null?"无":
<div dangerouslySetInnerHTML={{__html:markdownToHTML(jobsettingsdata.data.explanation).replace(/▁/g,"▁▁▁")}}></div>
}
</div>
}
</div>
</span>
</div>
@ -494,12 +529,12 @@ class Workquestionandanswer extends Component {
{/* <div className="edu-back-white mb20 graduateTopic course-message"> */}
{/*<GraduateTopicReply memo={{id: graduation_topic_id, user_id: topicInfo && topicInfo.user_id}} course_id={course_id} {...this.props}></GraduateTopicReply>*/}
{/* </div> */}
{ Showupdateinstructions&& Showupdateinstructions === true?
<div >
<Homeworddescription {...this.props} ReleaseNotes={this.ReleaseNotes} NOReleaseNotes ={this.NOReleaseNotes} ></Homeworddescription>
</div>
:""
}
{/*{ Showupdateinstructions&& Showupdateinstructions === true?*/}
{/* <div >*/}
{/* <Homeworddescription {...this.props} ReleaseNotes={this.ReleaseNotes} NOReleaseNotes ={this.NOReleaseNotes} ></Homeworddescription>*/}
{/* </div>*/}
{/* :""*/}
{/*}*/}
{ homework_id && <CommonReply
memo={{
id: homework_id,

@ -32,6 +32,7 @@ class MemoDetailMDEditor extends Component {
}
initMDEditor = () => {
// 因为props.memo不存在时本组件不会被加载这里直接在didMount里初始化即可
const placeholder = '我要回复...'
// const imageUrl = `/upload_with_markdown?container_id=${this.props.memo.id}&container_type=Memo`;
@ -42,7 +43,7 @@ class MemoDetailMDEditor extends Component {
setTimeout(() => {
var commentMDEditor = window.create_editorMD_4comment("memo_comment_editorMd", '', this.props.height || 240, placeholder, imageUrl, () => {
commentMDEditor.focus()
this.isMDInited = true
this.initDrag()
commentMDEditor.cm.on("change", (_cm, changeObj) => {
@ -114,7 +115,13 @@ class MemoDetailMDEditor extends Component {
}
onMockInputClick = () => {
this.setState({isInited: true})
this.initMDEditor()
if (!this.isMDInited) {
this.initMDEditor()
} else {
setTimeout(() => {
this.commentMDEditor.focus()
}, 10)
}
}
render() {
const { match, history, memo, placeholder, className } = this.props

@ -1,6 +1,6 @@
.slider-img-wrapper img {
width: 100%;
border-radius: 15px;
/*border-radius: 15px;*/
height: 350px;
}
.next-slick-list{

@ -10,8 +10,6 @@ import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import SiderBar from '../tpm/SiderBar';
import Loading from '@icedesign/base/lib/loading';
import { SnackbarHOC , getImageUrl} from 'educoder';
import Slider from '@icedesign/base/lib/slider';
@ -24,9 +22,7 @@ import '@icedesign/base/lib/rating/style.js';
import './home.css';
import '@icedesign/base/lib/loading/style.js';
import {Tooltip} from 'antd';
import {Tooltip,Spin} from 'antd';
const $ = window.$;
@ -110,7 +106,7 @@ class ShixunsHome extends Component {
return (
<div className="newMain clearfix backFAFAFA">
<Loading visible={hometypepvisible} shape="dot-circle" className="newnext-loading" color='#4AC7FF'>
<Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
{/*懒加载*/}
<SiderBar/>
@ -198,13 +194,13 @@ class ShixunsHome extends Component {
</div>
<Link to={"/paths"} className="moreitem">更多<i className="fa fa-angle-right ml5"></i></Link>
<div className="square-list clearfix">
<div className="square-list clearfix" style={{width:'102%'}}>
{homedatalist===undefined?"":homedatalist.subjects.map((item,key)=>{
if(key<8)
return(
<div className="square-Item" key={key} id={item.id}>
<div className="square-Item" key={key} id={item.id} style={{width:'286px'}}>
<div className="tag-green">
<span className="tag-name"> {item.name}</span>
@ -272,10 +268,10 @@ class ShixunsHome extends Component {
</div>
<Link to={"/shixuns"} className="moreitem">更多<i className="fa fa-angle-right ml5"></i></Link>
<div className="square-list clearfix">
<div className="square-list clearfix" style={{width:'102%'}}>
{homedatalist===undefined?"":homedatalist.shixuns.map((item,key)=>{
return(
<div className="square-Item" key={key} id={item.id}>
<div className="square-Item" key={key} id={item.id} style={{width:'286px'}}>
<div className="tag-green">
<span className="tag-name"> {item.tag_name}</span>
@ -498,8 +494,7 @@ class ShixunsHome extends Component {
</div>
</div>
</div>
</Loading>
</Spin>
</div>
);
}

@ -25,6 +25,7 @@ import '../courses/css/Courses.css';
import beijintulogontwo from '../../../src/images/login/beijintulogontwo.png';
import educodernet from '../../../src/images/login/educodernet.png';
import LoginRegisterComponent from '../user/LoginRegisterComponent';
import InterestpageComponent from '../user/Interestpage'
import FindPasswordComponent from '../user/FindPasswordComponent';
import passopen from "../../images/login/passopen.png";
//educoder登入页面
@ -59,26 +60,26 @@ class EducoderLogin extends Component {
super(props);
if( props.match.url === "/changepassword" ){
this.state = {
showbool: false,
showbool: 3,
logini:3,
}
}else {
if(props.match.url === "/login"){
this.state = {
showbool: true,
showbool: 1,
loginstatus:true,
logini:1,
}
}else if(props.match.url === "/register"){
this.state = {
showbool: true,
showbool: 1,
loginstatus:false,
logini:2,
}
}else{
this.state = {
showbool: true,
showbool: 1,
logini:1,
}
@ -100,16 +101,18 @@ class EducoderLogin extends Component {
})
}
Setshowbool = () => {
if (this.state.showbool === true) {
Setshowbool = (e) => {
if (e===1) {
this.setState({
showbool: false
showbool: 1
})
} else {
} else if(e===2) {
this.setState({
showbool: 2
})
}else if(e===3){
this.setState({
showbool: true
showbool: 3
})
}
}
@ -135,43 +138,53 @@ class EducoderLogin extends Component {
"align-items": "center",
"width": "100%"
}}>
<div style={{"margin-top": "50px"}}>
<div style={{"margin-top": "20px"}}>
<img src={educodernet}/>
</div>
</div>
{
showbool === true ?
showbool === 1 ?
<div style={{
"display": "flex",
"justify-content": "center",
"align-items": "center",
"width": "100%",
}}>
<div style={{"margin-top": "40px","height":"530px"}}>
<div style={{"margin-top": "40px","height":"580px"}}>
<LoginRegisterComponent {...this.props} {...this.state}
Setshowbool={this.Setshowbool} ></LoginRegisterComponent>
Setshowbool={(e)=>this.Setshowbool(e)} ></LoginRegisterComponent>
</div>
</div>
:
<div style={{
"display": "flex",
"justify-content": "center",
"align-items": "center",
"width": "100%",
}}>
<div style={{"margin-top": "40px","height":"530px"}}>
<FindPasswordComponent {...this.props} {...this.state}
Setshowbool={this.Setshowbool}></FindPasswordComponent>
</div>
</div>
:showbool === 2 ?
<div style={{
"display": "flex",
"justify-content": "center",
"align-items": "center",
"width": "100%",
}}>
<InterestpageComponent {...this.props} {...this.state}>
</InterestpageComponent>
</div>
:
<div style={{
"display": "flex",
"justify-content": "center",
"align-items": "center",
"width": "100%",
}}>
<div style={{"margin-top": "40px","height":"580px"}}>
<FindPasswordComponent {...this.props} {...this.state}
Setshowbool={(e)=>this.Setshowbool(e)}></FindPasswordComponent>
</div>
</div>
}
<div style={{"height":"180px",
<div style={{"height":"125px",
"display": "flex",
"justify-content": "center",
"align-items": "center",
@ -179,6 +192,7 @@ class EducoderLogin extends Component {
}}>
<div className="font-14 color-grey-9 " style={{marginTop:"15px"}}><span className="font-18">©</span>&nbsp;2019&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</div>
</div>
<div style={{"height":"100px"}}></div>
</div>
</div>
)

@ -115,6 +115,7 @@ class LoginDialog extends Component {
let reg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/;
let reg1 = /^1\d{10}$/;
let reg2=/^[a-zA-z]\w{3,14}$/;
// let reg3=/^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
let value=this.refs.loginPassText.value;
let valuenum= value.length;
if(valuenum>0){
@ -405,10 +406,10 @@ class LoginDialog extends Component {
ref="loginPassText"
onInput={this.loginChange}
name="username"
placeholder="手机号/邮箱号/用户名" ></input>
placeholder="请输入有效的手机号/邮箱号" ></input>
<div style={{height: '25px'}}><p className="color-orange edu-txt-left none" id="username_error_notice"
style={{display: regular==0?'none':'block'}}>请输入有效的手机号/邮箱号/用户名</p></div>
style={{display: regular==0?'none':'block'}}>请输入有效的手机号/邮箱号</p></div>
<div>
<input type="password" id="password_loggin_input"
@ -433,7 +434,7 @@ class LoginDialog extends Component {
<div className={disabled===false?"bluebutton edu-back-blue":"bluebutton"}
onClick={disabled===false?
this.loginEDU:""
this.loginEDU: () => {}
// console.log(1)
}
>

@ -108,6 +108,17 @@ class VNCDisplay extends Component {
rfb.addEventListener("desktopname", updateDesktopName);
// Set parameters that can be changed on an active connection
rfb.viewOnly = readQueryVariable('view_only', false);
// TODO scale
// https://github.com/novnc/noVNC/issues/1181
// http://localhost:3007/tasks/et8zqfkh9lsn
/**
https://www.shiyanlou.com/courses/?fee=free&page_size=20&category=Linux%E8%BF%90%E7%BB%B4&tag=%E5%85%A8%E9%83%A8&sort=default&preview=false
参考实验楼实现方式
div position: relative; width: 744.9px; height: 558.675px;
div position: relative; width: 1152px; height: 864px; transform-origin: 0px 0px; transform: scale(0.646615, 0.646615);
div width: 1152px; height: 864px; position: absolute; left: 0px; top: 0px; overflow: hidden;
canvas
*/
rfb.scaleViewport = readQueryVariable('scale', false);
}

@ -198,7 +198,7 @@ class UpdateDrawer extends Component {
}
</div>
</DialogContent>
<DialogActions id="dialog-actions" style={{ 'margin-bottom': '16px'}}>
<DialogActions id="dialog-actions" >
{ needUpdateScript ?
<React.Fragment>
<Button

@ -1,5 +1,6 @@
import React, { Component } from 'react';
import ImageLayer from './ImageLayer'
import { isImageExtension } from 'educoder'
const $ = window.$;
export function ImageLayerOfCommentHOC(options = {}) {
return function wrap(WrappedComponent) {
@ -16,18 +17,29 @@ export function ImageLayerOfCommentHOC(options = {}) {
componentDidMount() {
// commentsDelegateParent #game_left_contents #tab_con_4
setTimeout(() => {
$(".commentsDelegateParent")
.delegate(".J_Comment_Reply .comment_content img, .J_Comment_Reply .childrenCommentsView img","click", (event) => {
const imageSrc = event.target.src
// 非回复里的头像图片; 非emoticons
if (imageSrc.indexOf('/images/avatars/User') === -1 &&
imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) {
this.setState({
showImage: true,
imageSrc,
})
$(options.parentSelector || ".commentsDelegateParent")
.delegate(options.imgSelector || ".J_Comment_Reply .comment_content img, .J_Comment_Reply .childrenCommentsView img","click", (event) => {
const imageSrc = event.target.src || event.target.getAttribute('src') || event.target.getAttribute('href')
// 判断imageSrc是否是图片
const fileName = event.target.innerHTML.trim()
if (isImageExtension(imageSrc.trim()) || isImageExtension(fileName)) {
// 非回复里的头像图片; 非emoticons
if (imageSrc.indexOf('/images/avatars/User') === -1 &&
imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) {
this.setState({
showImage: true,
imageSrc,
})
}
event.stopPropagation()
event.preventDefault && event.preventDefault()
event.originalEvent.preventDefault()
// event.originalEvent.stopPropagation()
// event.originalEvent.cancelBubble = true
return false;
}
});
}, 3000)

@ -7,7 +7,7 @@ export function loadSshScript(callback) {
prefix = ''
} else {
// _url_origin = `https://testeduplus2.educoder.net/`;
_url_origin = 'http://47.96.87.25:48080';
_url_origin = 'http://47.96.87.25:48080/';
}
const $ = window.$;
// 未加载过

@ -1,10 +1,8 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import {Modal,Input,Checkbox,Tooltip} from "antd";
import {Modal,Input,Checkbox,Tooltip,Spin} from "antd";
import { DragDropContext , Draggable, Droppable} from 'react-beautiful-dnd';
import Modals from '../../modals/Modals';
import Loading from '@icedesign/base/lib/loading';
import '@icedesign/base/lib/loading/style.js';
import '../ShixunPaths.css';
import axios from 'axios';
const $ = window.$;
@ -437,7 +435,7 @@ class DetailCardsEditAndAdd extends Component{
width="840px"
destroyOnClose={true}
>
<Loading visible={hometypepvisible} shape="dot-circle" color='#4AC7FF'>
<Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<div className="newupload_conbox">
<div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ type===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
@ -516,7 +514,7 @@ class DetailCardsEditAndAdd extends Component{
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.clickShixunchoose}>确定</a>
</div>
</div>
</Loading>
</Spin>
</Modal>
</div>

@ -1,10 +1,8 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import {Modal,Input,Checkbox,Tooltip} from "antd";
import {Modal,Input,Checkbox,Tooltip,Spin} from "antd";
import { DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd';
import Modals from '../../modals/Modals';
import Loading from '@icedesign/base/lib/loading';
import '@icedesign/base/lib/loading/style.js';
import '../ShixunPaths.css';
import axios from 'axios';
const $ = window.$;
@ -478,8 +476,8 @@ class DetailCardsEditAndEdit extends Component{
footer={null}
width="840px"
destroyOnClose={true}
>
<Loading visible={hometypepvisible} shape="dot-circle" color='#4AC7FF'>
>Z
<Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<div className="newupload_conbox">
<div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ type===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
@ -558,7 +556,7 @@ class DetailCardsEditAndEdit extends Component{
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.clickShixunchoose}>确定</a>
</div>
</div>
</Loading>
</Spin>
</Modal>
</div>

@ -1,5 +1,5 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import {getImageUrl,markdownToHTML} from 'educoder';
import DetailTop from './DetailTop.js';
import DetailCards from './DetailCards.js'
import AddCollaborators from "./addCollaborators.js";
@ -342,9 +342,7 @@ class PathDetailIndex extends Component{
<div className="color-grey-6 clearfix">
<div id="shixuns_propaedeutics" className="new_li fl" style={{"padding":" 0px","textAlign": "justify;"}}>
{detailInfoList === undefined ? "" :detailInfoList.description===null?"":
<textarea>
{detailInfoList.description}
</textarea>
<div dangerouslySetInnerHTML={{__html: markdownToHTML(detailInfoList.description).replace(/▁/g,"▁▁▁")}}></div>
}
</div>
</div>

@ -1,6 +1,6 @@
import React,{ Component } from "react";
import {getUrl} from 'educoder';
import {getUrl,markdownToHTML} from 'educoder';
import {Input} from 'antd';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";

@ -0,0 +1,23 @@
import React, { Component } from 'react';
import Cropper from '../../common/components/Cropper'
class TestCrop extends Component {
state = {
};
handleChange = (info) => {
}
render() {
const props = this.props;
return (
<div>
<Cropper></Cropper>
</div>
);
}
}
export default (TestCrop);

@ -2,6 +2,7 @@ import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import MonacoTest from './monaco'
import TestCrop from './TestCrop'
import TestDragBeautiful from './dnd/TestDragBeautiful'
class TestIndex extends Component {
@ -17,6 +18,7 @@ class TestIndex extends Component {
<Switch {...this.props}>
<Route exact path="/test/monacoTest" component={MonacoTest}></Route>
<Route exact path="/test/testCrop" component={TestCrop}></Route>
<Route exact path="/test/dragBeautifulTest" component={TestDragBeautiful}></Route>
</Switch>

@ -16,7 +16,7 @@ class NewFooter extends Component {
render() {
return (
<div className="newFooter edu-txt-center">
<div className="newFooter edu-txt-center newContainers">
<div className="inner-footer_con">
<div className="footercon">
<div className="inline mt40 mb5">

@ -638,7 +638,7 @@ submittojoinclass=(value)=>{
{/*<li><a href={this.props.Headertop===undefined?"":this.props.Headertop.shixun_paths_url}>实训路径</a></li>*/}
<li className={`${activePaths === true ? 'pr active' : 'pr'}`}>
<a href={this.props.Headertop===undefined?"":'/paths'}>课程</a></li>
<a href={this.props.Headertop===undefined?"":'/paths'}>课程</a></li>
{/*<li><a href={this.props.Headertop===undefined?"":'/courses'}>课堂</a></li>*/}
<li className={`${coursestype === true ? 'pr active' : 'pr'}`}>
@ -671,13 +671,13 @@ submittojoinclass=(value)=>{
</div>
</li>
<li className=""><a href={"/libraries"}>教学案例</a></li>
<li className=""><a href={this.props.Headertop===undefined?"":this.props.Headertop.competitions_url}>竞赛</a></li>
{/*<li className=""><a href={"/libraries"}>教学案例</a></li>*/}
<li className=""><a href={this.props.Headertop===undefined?"":this.props.Headertop.competitions_url}>在线竞赛</a></li>
<li className={`${activeForums === true ? 'active' : ''}`}><a href={this.props.Headertop===undefined?"":this.props.Headertop.topic_url}>问答</a></li>
<li className={`${activeForums === true ? 'active' : ''}`}><a href={this.props.Headertop===undefined?"":this.props.Headertop.topic_url}>交流问答</a></li>
<li
style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.auth===null? 'none' : 'block'}}
><a href={this.props.Headertop===undefined?"":this.props.Headertop.auth}>认证</a></li>
><a href={this.props.Headertop===undefined?"":this.props.Headertop.auth}>工程认证</a></li>
</ul>
@ -756,6 +756,8 @@ submittojoinclass=(value)=>{
<li><a href={this.props.Headertop===undefined?"":this.props.Headertop.account_manager_url}>账号管理</a></li>
{/*<li><a onClick={()=>this.educoderlogin()} >登入测试接口</a></li>*/}
{/*<li><a onClick={()=>this.trialapplications()} >试用申请</a> </li>*/}
{/*<li><Link to={`/interest`}>兴趣页</Link></li>*/}
<li className="bor-top-greyE">
{/*<a href={this.props.Headertop===undefined?"":this.props.Headertop.logout_url}>退出</a>*/}
{/*<a onClick={()=>this.educoderlogin()}>退出</a>*/}
@ -817,12 +819,12 @@ submittojoinclass=(value)=>{
<li className="clearfix mb10">
<label className="panel-form-label fl">项目邀请码</label>
<Input type="text" className="input-60-40 fl" name="invite_code"
placeholder="请输入六位课堂邀请码" value={tojoinclasstitle} onInput={this.inputjoinclassvalue}/>
placeholder="请输入5位课堂邀请码或6位分班邀请码" value={tojoinclasstitle} onInput={this.inputjoinclassvalue}/>
</li>
<p id="none_invite_code_notice"
className="color-orange none f12"
style={{marginLeft: '90px',display:code_notice===true?'block':"none"}}>请输入六位课堂邀请码</p>
style={{marginLeft: '90px',display:code_notice===true?'block':"none"}}>请输入5位课堂邀请码或6位分班邀请码</p>
<li className="clearfix ">

@ -23,7 +23,7 @@ $(window).scroll(function(){
});
function rightSlider(){
var poi=parseInt((parseInt($(window).width())- 1200 )/2)-60;
var poi=parseInt((parseInt($(window).width())- 1200 )/2)-81;
// console.log(parseInt($(window).width())+" "+poi);
if(poi>0){
$(".-task-sidebar").css("right",poi);
@ -106,7 +106,7 @@ class SiderBar extends Component {
<span className="inline"><i className="iconfont icon-erweima color-white font-22 fl"></i></span>
<p className="scan_ewm" style={{display: 'none', right:' 75px',opacity: '0'}}>
<p className="pr padding10">
<img src={getImageUrl("images/educoder/EWM.jpg")} width="158px" height="158px" />
<img src={getImageUrl("images/edu_user/EWM.jpg")} width="158px" height="158px" />
<p>微信扫一扫</p>
<p>关注公众号</p>
<span className="trangle_right"></span>

@ -903,7 +903,7 @@ class TPMBanner extends Component {
</Spin>:
<div>
<div className="task-popup-content"><p
className="task-popup-text-center font-16 pb20">复制将在后台执行<br/>平台将为你创建一个新的同名实训和内容请问是否继续</p>
className="task-popup-text-center font-16 pb20">复制将在后台执行平台将为你创建<br/>一个新的同名实训和内容请问是否继续</p>
</div>
<div className="task-popup-submit clearfix">
<a onClick={this.hideForkvisible} className="task-btn fl">取消</a>

@ -1,6 +1,6 @@
import React, {Component} from 'react';
import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Pagination,Tooltip} from 'antd';
import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Pagination,Tooltip,Spin} from 'antd';
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
@ -8,8 +8,6 @@ import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
import Rating from '@icedesign/base/lib/rating';
import Loading from '@icedesign/base/lib/loading';
import axios from 'axios';
import {getImageUrl, toPath, getUrl} from 'educoder'
@ -99,7 +97,8 @@ export default class TPMFork_listComponent extends Component {
<span className="fl font-16">Fork实训列表</span>
<a href={"/shixuns/"+shixunsID+"/challenges"} className="font-16 color-grey-9 fr">返回</a>
</div>
<Loading visible={Forkvisible} shape="dot-circle" style={{width:'100%'}}color='#4AC7FF'>
{/*<Loading visible={Forkvisible} shape="dot-circle" style={{width:'100%'}}color='#4AC7FF'>*/}
<Spin spinning={Forkvisible} size="large" style={{marginTop:'15%'}}>
<div className="mt30 square-list clearfix mh320">
{ shixuns===undefined?" ":shixuns.map((item,key)=>{
@ -182,8 +181,8 @@ export default class TPMFork_listComponent extends Component {
}
onChange={this.TPMForkonChange}/>
</div>
</Loading>
</Spin>
{/*</Loading>*/}
</div>
</React.Fragment>
)

@ -38,6 +38,7 @@ body>.-task-title {
}
.ant-select-selection--multiple{
padding-bottom: 0px!important;
padding-top:3px;
}
/* 先注释掉下面2个样式这样写影响范围太广了并不是所有的select都需要40px高 */
/* .ant-select-selection--single{
@ -47,8 +48,10 @@ body>.-task-title {
line-height: 40px!important;
} */
.ant-select-selection--multiple .ant-select-selection__rendered>ul>li, .ant-select-selection--multiple>ul>li{
height: 30px!important;
line-height: 28px!important;
height: 25px!important;
line-height: 23px!important;
margin-bottom:3px;
margin-top:0px;
}
/*Main START*/
.newMain {

@ -180,7 +180,7 @@ class TPMIndex extends Component {
power: response.data.power,
identity: response.data.identity,
propaedeutics:response.data.propaedeutics,
status: response.data.status,
status: response.data.shixun_status,
});
}
}).catch((error) => {
@ -365,10 +365,10 @@ class TPMIndex extends Component {
(props) => (<TPMquestion {...this.props} {...props} {...this.state}/>)
}></Route>
<Route exact path="/shixuns/:shixunId" render={
(props) => (<TPMChallengeComponent {...this.props} {...this.state} {...props}
/>)
}></Route>
<Route exact path="/shixuns/:shixunId" render={
(props) => (<TPMChallengeComponent {...this.props} {...this.state} {...props}
/>)
}></Route>
{/*<Route exact path="/shixuns/:shixunId" component={TPMChallengeComponent}></Route>*/}

@ -131,7 +131,7 @@ export function TPMIndexHOC(WrappedComponent) {
}else if(this.props.match.path==="/shixuns"){
document.title="开发社区";
}else if(this.props.match.path==="/paths"){
document.title="实课程";
document.title="实课程";
}else if(this.props.match.path==="/courses"){
document.title="翻转课堂";
}
@ -294,23 +294,34 @@ export function TPMIndexHOC(WrappedComponent) {
return (
<div>
<SiderBar
Headertop={Headertop}
/>
<NewHeader {...this.state} {...this.props}></NewHeader>
<div className="newContainer">
<WrappedComponent initCommonState={(user)=>this.initCommonState(user)}
{...this.props} {...this.state}
showShixun={this.showShixun} aboutFocus={this.aboutFocus}
{...common}
>
</WrappedComponent>
</div>
<NewFooter
Footerdown={Footerdown}
/>
<SiderBar Headertop={Headertop}/>
<style>{
`
.newContainers{
width: 100%;
min-width: 1440px;
max-width: unset;
}
// .-task-sidebar{
// right: 270px !important;
// }
`
}</style>
<NewHeader {...this.state} {...this.props}></NewHeader>
<div className="newContainer newContainers">
<WrappedComponent initCommonState={(user)=>this.initCommonState(user)}
{...this.props} {...this.state}
showShixun={this.showShixun} aboutFocus={this.aboutFocus}
{...common}
>
</WrappedComponent>
</div>
<NewFooter
Footerdown={Footerdown}
/>
</div>
);
}

@ -134,7 +134,7 @@ export default class TPMUpdatepropaede extends Component {
})
if(response.data.content[0]!=null){
this.updatepropaedeMD(response.data.content[0], "UpdatepropaedeMD");
this.updatepropaedeMD(response.data.content, "UpdatepropaedeMD");
}else{
this.updatepropaedeMD("", "UpdatepropaedeMD");
}

@ -190,7 +190,7 @@ export default class TPMsettings extends Component {
evaluate_script:undefined,
standard_scripts: undefined,
choice_main_type: "",
choice_small_type: [""],
choice_small_type: [],
choice_standard_scripts:undefined,
editordescriptios: undefined,
editorevaluate_scripts: undefined,
@ -222,7 +222,8 @@ export default class TPMsettings extends Component {
scope_partmenttype:false,
newuse_scope:undefined,
scope_partments:0,
shixun_service_configs:undefined,
shixun_service_configlist:undefined,
pod_exist_time: undefined,
pod_exist_timetype: false,
shixunmemoMDvalue:"",
@ -325,6 +326,8 @@ export default class TPMsettings extends Component {
newuse_scope:response.data.shixun.use_scope,
scope_partments: response.data.shixun.scope_partment.length,
shixunmemoMDvalue:response.data.shixun.evaluate_script,
shixun_service_configs:response.data.shixun.shixun_service_configs,
shixun_service_configlist:response.data.shixun.shixun_service_configs,
})
// if(response.data.status===403){
@ -489,14 +492,14 @@ export default class TPMsettings extends Component {
}
shixun_vnc=(e)=>{
let sum = ""
if (e.target.checked === false) {
sum = 0
} else if (e.target.checked === true) {
sum = 1
}
// let sum = ""
// if (e.target.checked === false) {
// sum = 0
// } else if (e.target.checked === true) {
// sum = 1
// }
this.setState({
vnc: sum,
vnc: e.target.checked,
});
}
@ -513,6 +516,23 @@ export default class TPMsettings extends Component {
bigClass = (value) => {
let {settingsData,shixun_service_configs}=this.state;
let newshixun_service_configs=shixun_service_configs;
settingsData.shixun.main_type.some((item,key)=> {
if (item.id === value) {
newshixun_service_configs[0]={
mirror_repository_id:value,
name:item.type_name,
cpu_limit:1,
lower_cpu_limit:0.1,
memory_limit:1024,
request_limit:10
}
return true
}
}
)
let url = `/shixuns/get_mirror_script.json?mirror_id=`+value;
axios.get(url).then((response) => {
if (response.status === 200) {
@ -520,7 +540,9 @@ export default class TPMsettings extends Component {
this.setState({
choice_main_type: value,
standard_scripts:response.data,
choice_standard_scripts:null
choice_standard_scripts:null,
shixun_service_configs:newshixun_service_configs,
shixun_service_configlist:newshixun_service_configs,
})
}
}).catch((error) => {
@ -530,10 +552,79 @@ export default class TPMsettings extends Component {
}
Deselectlittle=(value)=>{
let {shixun_service_configs,choice_small_type}=this.state;
let newshixun_service_configs=shixun_service_configs;
let newchoice_small_type=choice_small_type;
newshixun_service_configs.some((item,key)=> {
if (item.mirror_repository_id === value) {
newshixun_service_configs.splice(key, 1)
return true
}
}
)
newchoice_small_type.some((item,key)=> {
if (item === value) {
newchoice_small_type.splice(key, 1)
return true
}
}
)
this.setState({
choice_small_type: newchoice_small_type,
shixun_service_configs:newshixun_service_configs,
shixun_service_configlist:newshixun_service_configs,
})
}
littleClass = (value) => {
let {settingsData,shixun_service_configs,choice_small_type}=this.state;
let newshixun_service_configs=shixun_service_configs;
let newchoice_small_type=choice_small_type;
// if(Array.isArray(value)===true){
// value.map((item,key)=>{
// settingsData.shixun.small_type.some((items,keys)=> {
// if (items.id === item) {
// newshixun_service_configs.push({
// mirror_repository_id:value,
// name:items.type_name,
// cpu_limit:1,
// lower_cpu_limit:0.1,
// memory_limit:1024,
// request_limit:10
// })
// return true
// }
// }
// )
// })
// }
settingsData.shixun.small_type.some((items,keys)=> {
if (items.id === value) {
newshixun_service_configs.push({
mirror_repository_id:value,
name:items.type_name,
cpu_limit:1,
lower_cpu_limit:0.1,
memory_limit:1024,
request_limit:10
})
return true
}
}
)
newchoice_small_type.push(value)
this.setState({
choice_small_type: value
choice_small_type: newchoice_small_type,
shixun_service_configs:newshixun_service_configs,
shixun_service_configlist:newshixun_service_configs,
})
}
onPodExistTimeChange = (e) => {
@ -594,10 +685,17 @@ export default class TPMsettings extends Component {
// }
submit_edit_shixun = () => {
let {
name, description, choice_main_type, choice_small_type, choice_standard_scripts, scope_partment, choice_standard_scriptssum,
evaluate_script, exec_time, webssh, use_scope, trainee, can_copy, task_pass, test_set_permission, hide_code, code_hidden, forbid_copy, vnc,multi_webssh,
opening_time, pod_exist_time,shixunmemoMDvalue
name, choice_main_type, choice_small_type, choice_standard_scripts, scope_partment, choice_standard_scriptssum,
evaluate_script, webssh, use_scope, trainee, can_copy, task_pass, test_set_permission, hide_code, code_hidden, forbid_copy, vnc,multi_webssh,
opening_time,shixunmemoMDvalue,shixun_service_configlist
} = this.state;
let newshixun_service_configlist = shixun_service_configlist.map(v => {
let v1 = Object.assign({},v);
delete v1.name;
return v1
});
let operateauthority=this.props.identity<5&&this.state.status==0||this.props.identity===1&&this.state.status==2||this.props.identity===1&&this.state.status==1;
const description_editormd = this.description_editormd.getValue();
@ -652,15 +750,15 @@ export default class TPMsettings extends Component {
return
}
}
if (exec_time === "") {
this.setState({
exec_timetype: true
})
$('html').animate({
scrollTop: 1500
}, 1000);
return
}
// if (exec_time === "") {
// this.setState({
// exec_timetype: true
// })
// $('html').animate({
// scrollTop: 1500
// }, 1000);
// return
// }
// if (!pod_exist_time) {
// this.setState({
@ -680,40 +778,38 @@ export default class TPMsettings extends Component {
let id = this.props.match.params.shixunId;
let newmulti_webssh=multi_webssh;
if(newmulti_webssh===true){
newmulti_webssh=1
}else{
newmulti_webssh=0
}
if(newmulti_webssh===null){
newmulti_webssh=0
newmulti_webssh=false
}
//exec_time: exec_time,
let Url = `/shixuns/` + id + `.json`;
let data = {
name: name,
description: description_editormd,
main_type: choice_main_type,
small_type: choice_small_type,
webssh: webssh,
user_scope: use_scope,
scope_partment: scope_partment,
can_copy: can_copy,
vnc: vnc,
test_set_permission: test_set_permission,
code_hidden: code_hidden,
trainee: trainee,
task_pass: task_pass,
standard_scripts: choice_standard_scripts,
hide_code: hide_code,
forbid_copy: forbid_copy,
exec_time: exec_time,
evaluate_script: evaluate_script_editormd,
multi_webssh:newmulti_webssh,
opening_time:opening_time,
mirror_script_id:choice_standard_scriptssum,
delType:1
shixun:{
name: name,
webssh: webssh,
use_scope: use_scope,
can_copy: can_copy,
vnc: vnc===null?undefined:vnc,
test_set_permission: test_set_permission,
code_hidden: code_hidden,
trainee: trainee,
task_pass: task_pass,
hide_code: hide_code,
forbid_copy: forbid_copy,
multi_webssh:newmulti_webssh,
opening_time:opening_time,
mirror_script_id:choice_standard_scriptssum===undefined?choice_standard_scripts:choice_standard_scriptssum,
},
shixun_info:{
description: description_editormd,
evaluate_script: evaluate_script_editormd,
},
main_type: choice_main_type,
small_type: choice_small_type,
scope_partment: scope_partment,
shixun_service_configs:newshixun_service_configlist
}
axios.put(Url, data).then((response) => {
@ -941,6 +1037,7 @@ export default class TPMsettings extends Component {
this.setState({
opers:true
})
}
bigopens=()=>{
@ -950,16 +1047,19 @@ export default class TPMsettings extends Component {
opersss:false,
opensmail:false
})
}
bigopensmal=()=>{
bigopensmal=(e)=>{
this.setState({
opensmail:true
})
}
sbigopen=()=>{
sbigopen=(e)=>{
this.setState({
operss:true
})
}
sbigopens=()=>{
@ -967,10 +1067,11 @@ export default class TPMsettings extends Component {
operss:false
})
}
sbigopenss=()=>{
sbigopenss=(e)=>{
this.setState({
opersss:true
})
}
sbigopensss=()=>{
@ -1015,7 +1116,35 @@ export default class TPMsettings extends Component {
})
}
setConfigsInputs=(e,keys,str)=>{
let {shixun_service_configs}=this.state;
let newshixun_service_configs=shixun_service_configs;
newshixun_service_configs.map((item,key)=>{
if(key===keys){
switch (str) {
case 1:
item.cpu_limit=e.target.value
break;
case 2:
item.lower_cpu_limit=e.target.value
break;
case 3:
item.memory_limit=e.target.value
break;
case 4:
item.request_limit=e.target.value
break;
}
}
})
this.setState({
shixun_service_configs:newshixun_service_configs,
shixun_service_configlist:newshixun_service_configs,
})
}
render() {
let {
@ -1070,7 +1199,8 @@ export default class TPMsettings extends Component {
scope_partmenttype,
newuse_scope,
scope_partments,
shixunmemoMDvalue,delType
shixunmemoMDvalue,delType,
shixun_service_configs
} = this.state;
let options;
@ -1087,7 +1217,7 @@ export default class TPMsettings extends Component {
let operateauthority=this.props.identity===1?true:this.props.identity<5&&this.state.status==0?true:false;
return (
<div className="educontent mt30 mb50" id="shixun_settings_show" onClick={this.bigopens} onMouseEnter={this.bigopens}>
<div className="educontent mt30 mb50" id="shixun_settings_show" onClick={this.bigopens} >
<div className="edu-back-white mb10">
<div className="padding30 bor-bottom-greyE clearfix">
<span className="fl font-16">配置</span>
@ -1252,11 +1382,12 @@ export default class TPMsettings extends Component {
<div className="width15 fl pr mr20" onMouseLeave={operateauthority?this.bigopens:""}>
<Select mode="multiple" placeholder="请选择小类别"
value={choice_small_type.length===0||choice_small_type[0]===""||choice_small_type===[]?undefined:choice_small_type}
style={{width: 180}}
style={{width: 180,height:30}}
disabled={operateauthority?false:true}
onChange={operateauthority?this.littleClass:""}
// onChange={operateauthority?this.littleClass:""}
onDeselect={operateauthority?this.Deselectlittle:""}
onMouseEnter={operateauthority?this.bigopensmal:""}
onSelect={operateauthority?this.bigopens:""}
onSelect={operateauthority?this.littleClass:""}
defaultOpen={false}
open={opensmail}
>
@ -1335,9 +1466,43 @@ export default class TPMsettings extends Component {
{
this.props.identity<5||this.props.power==true?
<a onClick={this.showModal} id="define_template"
className="color-orange-tip ml20 mt5 fl">使用自定义脚本</a> : ""
className="color-orange-tip ml20 mt1 fl">使用自定义脚本</a> : ""
}
<div className="ml6 fl pr"
style={{display:operateauthority?'block':"none"}}
>
<a onClick={()=>this.testscripttip(0)}><img
src={getImageUrl("images/educoder/problem.png") }/></a>
<div className="invite-tip clearfix none " id="test_script_tip"
style={{top: '33px', right: '-6px',width: '271px',zIndex: '10',display: testscripttiptype===true?'block':"none"}}>
<span className="top-black-trangle"></span>
<div className="padding20 invitecontent clearfix">
<p className="font-12 edu-txt-left">
使用自定义模板平台无法自动更新脚本<br/>
请在关卡创建完后手动更新脚本中的必填参<br/>
数和以下2个数组元素<br/>
challengeProgramNames<br/>
sourceClassNames<br/><br/>
示例有2个关卡的实训<br/><br/>
各关卡的待编译文件为<br/>
src/step1/HelloWorld.java<br/>
src/step2/Other.java<br/><br/>
各关卡的编译后生成的执行文件为<br/>
step1.HelloWorld<br/>
step2.Other<br/><br/>
则数组元素更新如下<br/>
challengeProgramNames=("src/step1/<br/>
HelloWorld.java" "src/step2/Other.java")<br/>
sourceClassNames=("step1.HelloWorld<br/>
" "step2.Other")<br/><br/>
其它参数可按实际需求定制
</p>
</div>
<p className="inviteTipbtn with100 fl">
<a onClick={()=>this.testscripttip(1)}>知道了</a>
</p>
</div>
</div>
<Modal
keyboard={false}
@ -1388,7 +1553,7 @@ export default class TPMsettings extends Component {
<div className="flex1">
<div className="fl " >
<div className="fl" style={{border:'1px solid #ccc'}}>
{/*<textarea className={"shixunmemoMDdiv"} value={shixunmemoMDvalue} onInput={this.getshixunmemoMDvalue} name="content">*/}
{/*</textarea>*/}
<MonacoEditor
@ -1414,41 +1579,7 @@ export default class TPMsettings extends Component {
{/*</div>*/}
<div className="ml6 fl pr"
style={{display:operateauthority?'block':"none"}}
>
<a onClick={()=>this.testscripttip(0)}><img
src={getImageUrl("images/educoder/problem.png") }/></a>
<div className="invite-tip clearfix none " id="test_script_tip"
style={{top: '33px', right: '-6px',width: '271px',zIndex: '10',display: testscripttiptype===true?'block':"none"}}>
<span className="top-black-trangle"></span>
<div className="padding20 invitecontent clearfix">
<p className="font-12 edu-txt-left">
使用自定义模板平台无法自动更新脚本<br/>
请在关卡创建完后手动更新脚本中的必填参<br/>
数和以下2个数组元素<br/>
challengeProgramNames<br/>
sourceClassNames<br/><br/>
示例有2个关卡的实训<br/><br/>
各关卡的待编译文件为<br/>
src/step1/HelloWorld.java<br/>
src/step2/Other.java<br/><br/>
各关卡的编译后生成的执行文件为<br/>
step1.HelloWorld<br/>
step2.Other<br/><br/>
则数组元素更新如下<br/>
challengeProgramNames=("src/step1/<br/>
HelloWorld.java" "src/step2/Other.java")<br/>
sourceClassNames=("step1.HelloWorld<br/>
" "step2.Other")<br/><br/>
其它参数可按实际需求定制
</p>
</div>
<p className="inviteTipbtn with100 fl">
<a onClick={()=>this.testscripttip(1)}>知道了</a>
</p>
</div>
</div>
</div>
</div>
@ -1468,21 +1599,21 @@ export default class TPMsettings extends Component {
</div>
</div>
<div className="edu-back-white mb10 padding40-20 clearfix">
<span className="color-orange fl mr20">*</span>
{/*<div className="edu-back-white mb10 padding40-20 clearfix">*/}
{/*<span className="color-orange fl mr20">*</span>*/}
<p className="color-grey-6 font-16 mb30">程序最大执行时间</p>
{/*<p className="color-grey-6 font-16 mb30">程序最大执行时间</p>*/}
<Input className="mr10 fl" placeholder="请输入程序最大执行时间" maxLength="60" style={{width: '20%'}}
onInput={this.Timevalue} value={exec_time === undefined ? "" : exec_time}/> <span
className="fl mr10 ml20"></span>
{/*<Input className="mr10 fl" placeholder="请输入程序最大执行时间" maxLength="60" style={{width: '20%'}}*/}
{/*onInput={this.Timevalue} value={exec_time === undefined ? "" : exec_time}/> <span*/}
{/*className="fl mr10 ml20">秒</span>*/}
<div style={{width: ' 57px '}} className="fl">
<span className={exec_timetype === true ? "color-orange mt8" : "color-orange mt8 none"}
id="shixun_name_notice"><i
className="fa fa-exclamation-circle mr3"></i></span>
</div>
</div>
{/*<div style={{width: ' 57px '}} className="fl">*/}
{/*<span className={exec_timetype === true ? "color-orange mt8" : "color-orange mt8 none"}*/}
{/*id="shixun_name_notice"><i*/}
{/*className="fa fa-exclamation-circle mr3"></i>必填项</span>*/}
{/*</div>*/}
{/*</div>*/}
{/* <div className="edu-back-white mb10 padding40-20 clearfix" id="pod_exist_time">
<span className="color-orange fl mr20">*</span>
@ -1675,8 +1806,9 @@ export default class TPMsettings extends Component {
<span className="color-grey-6 mt5 fl" style={{minWidth: '95px'}}>开启时间:</span>
<span className="fl mt5">
<DatePicker
showToday={false}
showToday={false}
showTime
width={178}
locale={locale}
format={dateFormat}
placeholder="请选择开启时间"
@ -1686,69 +1818,80 @@ export default class TPMsettings extends Component {
<label style={{top:'6px'}} className="color-grey-9 ml10" >为空则学员在实训发布后能随时开启实训挑战否则学员在开启时间后才能开启实训挑战</label>
</span>
</div>
{/*<div className="clearfix mt20">*/}
{/*<span className="color-grey-6 mt5 fl" style={{minWidth: '95px'}}>VNC图形化:</span>*/}
{/*<span className="fl mt5">*/}
{/*<Checkbox checked={vnc === undefined ? false : vnc} onChange={this.shixun_vnc}></Checkbox>*/}
{/*<label style={{top:'6px'}} className="color-grey-9 ml10" >勾选则给学员的实践任务提供Ubuntu系统图形化实践窗口否则不提供</label>*/}
{/*</span>*/}
{/*</div>*/}
</div>
{this.props.identity<3?<div className="clearfix mt20 ml30">
<span className="color-grey-6 mt5 fl" style={{minWidth: '95px'}}>VNC图形化:</span>
<span className="fl mt5">
<Checkbox checked={vnc === undefined ? false : vnc} onChange={this.shixun_vnc}></Checkbox>
<label style={{top:'6px'}} className="color-grey-9 ml10" >勾选则给学员的实践任务提供Ubuntu系统图形化实践窗口否则不提供</label>
</span>
</div>:""}
</div>
{/*"name": "我是镜像名", # 镜像名称*/}
{/*"cpu_limit": 1, # cpu核*/}
{/*"lower_cpu_limit": 0.1, # 最低cpu核 浮点数*/}
{/*"memory_limit": 1024 ,#内存限制*/}
{/*"request_limit": 10, # 内存要求*/}
{/*"mirror_repository_id": 12, # 镜像id*/}
{this.props.identity<3?<div className="edu-back-white padding40-20 mb20">
<p className="color-grey-6 font-16 mb30">服务配置</p>
{ shixun_service_configs&&shixun_service_configs.map((item,key)=>{
return(
<div key={key}>
<div id="5">
<p className="color-grey-6 font-16 mt30 mb20" id="shixun_scenario_type_name">{item.name}</p>
<div className="clearfix mb5">
<label className="panel-form-label fl">CPU()</label>
<div className="pr fl with80 status_con">
<input type="text" value={item.cpu_limit} onInput={(e)=>this.setConfigsInputs(e,key,1)}
className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
</div>
<div className="cl"></div>
</div>
<div className="clearfix mb5">
<label className="panel-form-label fl">最低CPU()</label>
<div className="pr fl with80 status_con">
<input type="text" value={item.lower_cpu_limit} onInput={(e)=>this.setConfigsInputs(e,key,2)}
className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
</div>
<div className="cl"></div>
</div>
<div className="clearfix mb5">
<label className="panel-form-label fl">内存限制(M)</label>
<div className="pr fl with80 status_con">
<input type="text" value={item.memory_limit} onInput={(e)=>this.setConfigsInputs(e,key,3)}
className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
</div>
<div className="cl"></div>
</div>
<div className="clearfix mb5">
<label className="panel-form-label fl">内存要求(M)</label>
<div className="pr fl with20 status_con">
<input type="text" value={item.request_limit} onInput={(e)=>this.setConfigsInputs(e,key,4)}
className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
</div>
<label className="panel-form-label fl" style={{width: '48%'}}>温馨提示纯编程类型实训建议使用默认值对于大数据等建议使用最大内存的30%</label>
<div className="cl"></div>
</div>
</div>
</div>
)
})}
</div> :""}
<p>
{
// this.props.identity<4&&this.props.status==0?
this.props.identity<4?
this.props.identity<5?
<div className="clearfix mt30">
<a className="defalutSubmitbtn fl mr20"
onClick={this.submit_edit_shixun}>保存</a>
<a href={"/shixuns/" + shixunsID + "/challenges"} className="defalutCancelbtn fl">取消</a>
</div> :""
}
{/*{*/}
{/*this.props.identity===1&&this.props.status==2?*/}
{/*<div className="clearfix mt30">*/}
{/*<a className="defalutSubmitbtn fl mr20"*/}
{/*onClick={this.submit_edit_shixun}>保存</a>*/}
{/*<a href={"/shixuns/" + shixunsID + "/challenges"} className="defalutCancelbtn fl">取消</a>*/}
{/*/!*<a className="edu-default-btn edu-blueline-btn fl ml20"*!/*/}
{/*/!*id="challenge_begin"*!/*/}
{/*/!*onClick={this.operateshixuns}>*!/*/}
{/*/!*永久关闭*!/*/}
{/*/!*</a>*!/*/}
{/*</div> :""*/}
{/*}*/}
{/*{*/}
{/*this.props.identity===1||this.props.power==true?*/}
{/*<div className="clearfix mt30">*/}
{/*<a className="defalutSubmitbtn fl mr20"*/}
{/*onClick={this.submit_edit_shixun}>保存</a>*/}
{/*<a href={"/shixuns/" + shixunsID + "/challenges"} className="defalutCancelbtn fl">取消</a>*/}
{/*<Popconfirm title={status===0?"删除实训后,用户不能再开始挑战了是否确认删除?":"关闭实训后,用户不能再开始挑战了是否确认关闭?"} onConfirm={this.shixunsclose} okText="确定"*/}
{/*cancelText="取消"*/}
{/*style={{display:status===0?"none":"block"}}*/}
{/*>*/}
{/*<a*/}
{/*className="edu-default-btn edu-blueline-btn fl ml20"*/}
{/*id="challenge_begin"*/}
{/*style={{display:status===0?"none":"block"}}*/}
{/*>*/}
{/*{status===0?"":"永久关闭"}*/}
{/*</a>*/}
{/*</Popconfirm>*/}
{/*</div> :""*/}
{/*}*/}
{/*<div className="clearfix mt30">*/}
{/*<a className="defalutSubmitbtn fl mr20"*/}
{/*onClick={this.submit_edit_shixun}>保存</a>*/}
{/*<a href={"/shixuns/" + shixunsID + "/challenges"} className="defalutCancelbtn fl">取消</a>*/}
{/*</div>*/}
</p>
</div>

@ -10,24 +10,22 @@
line-height: 30px;
}
#shixundescription .CodeMirror{
width: 570px !important;
margin-top: 31px !important;
height: 364px !important;
}
#shixundescription .editormd-preview{
width: 567px !important;
width:578px !important;
top: 40px !important;
height: 364px !important;
}
#shixunmemoMD .CodeMirror{
width: 548px !important;
margin-top: 31px !important;
height: 578px !important;
}
#shixunmemoMD .editormd-preview{
width: 544px !important;
width: 578px !important;
top: 40px !important;
height: 578px !important;
}

@ -209,6 +209,13 @@ export default class TPMMDEditor extends Component {
initValue: ''
}
}
componentDidUpdate(prevProps, prevState) {
// 不能加,影响了试卷填空题
// if (this.props.initValue != prevProps.initValue) {
// this.answers_editormd.setValue(this.props.initValue)
// }
}
// react_mdEditor_
componentDidMount = () => {
const { mdID, initValue, placeholder, showNullButton} = this.props;

@ -225,7 +225,7 @@ export default class TPManswer extends Component {
}
}
this.setState({
answer:response.data.answer,
answer:response.data.answer,
power: response.data.power,
choice_url: newchoice_url, // 导航中的新建选择题url
practice_url: newpractice_url, //string 导航中新建实践题url
@ -299,14 +299,14 @@ export default class TPManswer extends Component {
</span>
<span className="font-16 task-hide fl TPMtaskName">{position}</span>
<Link to={go_back_url === undefined ? "" : go_back_url}
className="color-grey-6 fr font-16 ml30">返回</Link>
className="color-grey-6 fr font-15 mt3">返回</Link>
{prev_challenge === undefined ? "" :
<a href={prev_challenge} className="fr color-blue mr15 mt3">上一关</a>
<a href={prev_challenge} className="fr color-blue mr15 mt4">上一关</a>
}
{next_challenge === undefined ? "" :
<a href={next_challenge} className="fr color-blue mr15 mt3">下一关</a>
<a href={next_challenge} className="fr color-blue mr15 mt4">下一关</a>
}
<Link to={practice_url === undefined ? "" : practice_url}
@ -352,7 +352,7 @@ export default class TPManswer extends Component {
</div>
<div className="clearfix mt20" style={{display:this.props.identity>3||this.props.identity===undefined||power===false?"none":"block"}}>
<div className="clearfix mt20" style={{display:this.props.identity>4||this.props.identity===undefined||power===false?"none":"block"}}>
<a className="defalutSubmitbtn fl mr20"
onClick={this.challenge_answer_submit}>提交</a>
<a href={"/shixuns/" + shixunId + "/challenges"} className="defalutCancelbtn fl">取消</a>

@ -194,6 +194,17 @@ export default class TPManswer extends Component {
newAnswers[index] = newAnswer
this.setState({ answers: newAnswers})
}
answerOnChange = (val, index) => {
// if (!this.state.answers[index]) {
// // 1、2、3删除2会走到这里
// return;
// }
const newAnswer = Object.assign({}, this.state.answers[index])
newAnswer.contents = val
const newAnswers = this.state.answers.slice(0)
newAnswers[index] = newAnswer
this.setState({ answers: newAnswers})
}
addAnswer = () => {
const newAnswers = this.state.answers.slice(0)
newAnswers.push({
@ -210,6 +221,10 @@ export default class TPManswer extends Component {
newanswers.splice(index,1)
this.setState({
answers:newanswers
}, () => {
for(let i = index; i < newanswers.length; i ++) {
this.refs[`md${i}`].setValue(newanswers[i].contents)
}
})
}
render() {
@ -241,14 +256,14 @@ export default class TPManswer extends Component {
</span>
<span className="font-16 task-hide fl TPMtaskName">{position}</span>
<Link to={go_back_url === undefined ? "" : go_back_url}
className="color-grey-6 fr font-16 ml30">返回</Link>
className="color-grey-6 fr font-15 mt3">返回</Link>
{prev_challenge === undefined ? "" :
<a href={prev_challenge} className="fr color-blue mr15 mt3">上一关</a>
<a href={prev_challenge} className="fr color-blue mr15 mt4">上一关</a>
}
{next_challenge === undefined ? "" :
<a href={next_challenge} className="fr color-blue mr15 mt3">下一关</a>
<a href={next_challenge} className="fr color-blue mr15 mt4">下一关</a>
}
<Link to={practice_url === undefined ? "" : practice_url}
@ -316,14 +331,15 @@ export default class TPManswer extends Component {
</div>
<div className="mt10">
<span>参考答案</span>
<TPMMDEditor ref={`md${index}`} mdID={index} initValue={answer.contents}></TPMMDEditor>
<TPMMDEditor ref={`md${index}`} mdID={index} initValue={answer.contents}
onChange={(val) => this.answerOnChange(val, index)}></TPMMDEditor>
</div>
</div>
</div>
})
}
<div className="clearfix mt20" style={{display:this.props.identity>3||this.props.identity===undefined||power===false?"none":"block"}}>
<div className="clearfix mt20" style={{display:this.props.identity>4||this.props.identity===undefined||power===false?"none":"block"}}>
<a href={"javascript:void(0)"} className="defalutCancelbtn fl" onClick={this.addAnswer}>新增</a>
</div>
</div>
@ -331,7 +347,7 @@ export default class TPManswer extends Component {
</div>
<div className="clearfix mt20" style={{display:this.props.identity>3||this.props.identity===undefined||power===false?"none":"block"}}>
<div className="clearfix mt20" style={{display:this.props.identity>4||this.props.identity===undefined||power===false?"none":"block"}}>
<a className="defalutSubmitbtn fl mr20"
onClick={this.challenge_answer_submit}>提交</a>
<a href={"/shixuns/" + shixunId + "/challenges"} className="defalutCancelbtn fl">取消</a>

@ -174,7 +174,8 @@ export default class TPMchallengesnew extends Component {
shixunsskillvaluelisttype: false,
marktype:false,
editPracticesendtype:false,
CreatePracticesendtype:false
CreatePracticesendtype:false,
exec_time:undefined
}
}
@ -292,6 +293,7 @@ export default class TPMchallengesnew extends Component {
onshixunsmarkvalue:response.data.score,
shixunsskillvaluelist:response.data.tags,
checkpointId:checkpointId,
exec_time:response.data.exec_time,
tab2url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=2",
tab3url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=3",
})
@ -345,7 +347,7 @@ export default class TPMchallengesnew extends Component {
})
return
}
let {shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvaluelist} = this.state;
let {shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvaluelist,exec_time} = this.state;
if (shixunCreatePractice === undefined||shixunCreatePractice=="") {
this.setState({
shixunCreatePracticetype: true
@ -383,7 +385,8 @@ export default class TPMchallengesnew extends Component {
difficulty: shixunCreatePracticeGroup,
score: onshixunsmarkvalue,
challenge_tag: shixunsskillvaluelist,
st: 0
st: 0,
exec_time:exec_time
}).then((response) => {
this.props.showSnackbar(response.data.messages);
if (response.data.status === 1) {
@ -392,7 +395,7 @@ export default class TPMchallengesnew extends Component {
tab2url: "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2",
tab3url: "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=3",
})
window.location.href = "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2"
// window.location.href = "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2"
}
}).catch((error) => {
@ -452,7 +455,7 @@ export default class TPMchallengesnew extends Component {
editPracticesendtype:true
})
let {shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvaluelist,checkpointId} = this.state;
let {shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvaluelist,checkpointId,exec_time} = this.state;
const exercise_editormdvalue = this.exercise_editormd.getValue();
@ -493,6 +496,7 @@ export default class TPMchallengesnew extends Component {
task_pass: exercise_editormdvalue,
difficulty: shixunCreatePracticeGroup,
score: onshixunsmarkvalue,
exec_time:exec_time
},
challenge_tag:shixunsskillvaluelist
}).then((response) => {
@ -503,7 +507,7 @@ export default class TPMchallengesnew extends Component {
tab2url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=2",
tab3url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=3",
})
window.location.href = "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2"
// window.location.href = "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2"
}
}).catch((error) => {
console.log(error)
@ -523,6 +527,12 @@ export default class TPMchallengesnew extends Component {
marktype:false
})
}
setexec_time=(e)=>{
this.setState({
exec_time:e.target.value
})
}
render() {
let shixuntype = this.props.match.params.type;
@ -552,25 +562,25 @@ export default class TPMchallengesnew extends Component {
<span className="font-16 task-hide fl TPMtaskName">{position}</span>
<Link to={go_back_url === undefined ? "" : go_back_url}
className="color-grey-6 fr font-16 ml30">返回</Link>
className="color-grey-6 fr font-15 mt3">返回</Link>
{ prev_challenge===undefined?"":
<a href={prev_challenge} className="fr color-blue mr15 mt3">上一关</a>
<a href={prev_challenge} className="fr color-blue mr15 mt4">上一关</a>
}
{ next_challenge===undefined?"":
<a href={next_challenge}className="fr color-blue mr15 mt3">下一关</a>
<a href={next_challenge}className="fr color-blue mr15 mt4">下一关</a>
}
<a href={practice_url === undefined ? "" : practice_url}
className="fr color-blue mr15 mt4"
style={{display:this.props.identity>3||this.props.identity===undefined||this.props.status===2||this.props.status===1?"none":'block'}}
style={{display:this.props.identity>4||this.props.identity===undefined||this.props.status===2||this.props.status===1?"none":'block'}}
data-tip-down="新增代码编辑类型的任务">+&nbsp;实践类型</a>
<a href={choice_url === undefined ? "" : choice_url}
className="fr color-blue mr15 mt4"
style={{display:this.props.identity>3||this.props.identity===undefined||this.props.status===2||this.props.status===1?"none":'block'}}
style={{display:this.props.identity>4||this.props.identity===undefined||this.props.status===2||this.props.status===1?"none":'block'}}
data-tip-down="新增选择题类型的任务">+&nbsp;选择题类型</a>
</div>
@ -717,8 +727,19 @@ export default class TPMchallengesnew extends Component {
</div>
</div>
<div className="edu-back-white padding40-20 mb20">
<p className="color-grey-6 font-16 mb30">服务配置</p>
<div className="clearfix mb5">
<label className="panel-form-label fl">评测时限(S)</label>
<div className="pr fl with80 status_con">
<input value={this.state.exec_time} className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" onInput={this.setexec_time}/>
</div>
<div className="cl"></div>
</div>
</div>
<div className="clearfix mt30"
style={{display:this.props.identity>3||this.props.identity===undefined?"none":'block'}}
style={{display:this.props.identity>4||this.props.identity===undefined?"none":'block'}}
>
{checkpointId===undefined?<a className="defalutSubmitbtn fl mr20" onClick={CreatePracticesendtype===true?"":this.CreatePracticesend}>提交</a>:
<a className="defalutSubmitbtn fl mr20" onClick={editPracticesendtype===true?"":this.editPracticesend}>提交</a>}

@ -765,23 +765,23 @@ export default class TPMevaluation extends Component {
</span>
<span className="font-16 task-hide fl TPMtaskName">{position}</span>
<Link to={go_back_url === undefined ? "" : go_back_url}
className="color-grey-6 fr font-16 ml30">返回</Link>
className="color-grey-6 fr font-15 mt3">返回</Link>
{prev_challenge === undefined ? "" :
<a href={prev_challenge} className="fr color-blue mr15 mt3">上一关</a>
<a href={prev_challenge} className="fr color-blue mr15 mt4">上一关</a>
}
{next_challenge === undefined ? "" :
<a href={next_challenge} className="fr color-blue mr15 mt3">下一关</a>
<a href={next_challenge} className="fr color-blue mr15 mt4">下一关</a>
}
<Link to={practice_url === undefined ? "" : practice_url}
className="fr color-blue mr15 mt4"
style={{display:this.props.identity>3||this.props.identity===undefined||this.props.status===2||this.props.status===1? "none":'block'}}
style={{display:this.props.identity>4||this.props.identity===undefined||this.props.status===2||this.props.status===1? "none":'block'}}
data-tip-down="新增代码编辑类型的任务">+&nbsp;实践类型</Link>
<Link to={choice_url === undefined ? "" : choice_url}
className="fr color-blue mr15 mt4"
style={{display:this.props.identity>3||this.props.identity===undefined||this.props.status===2||this.props.status===1?"none":'block'}}
style={{display:this.props.identity>4||this.props.identity===undefined||this.props.status===2||this.props.status===1?"none":'block'}}
data-tip-down="新增选择题类型的任务">+&nbsp;选择题类型</Link>
</div>
@ -914,11 +914,9 @@ export default class TPMevaluation extends Component {
<div className="edu-back-white mb10 clearfix">
<div className="padding40-20">
<p className="color-grey-6 font-16 mb20">效果展现方式</p>
<div className="pr" onMouseLeave={this.handpathoptionvaluess}>
<div className="pr">
<Select className="winput-240-40"
value={pathoptionvalue}
onMouseEnter={this.handpathoptionvalues}
open={handpathopt}
onChange={this.handpathoptionvalue}>
<Option value={-1}>请选择效果展现方式</Option>
<Option value={1}>图片</Option>
@ -951,7 +949,7 @@ export default class TPMevaluation extends Component {
</div>
<div className="edu-back-white mb10 clearfix">
{pathoptionvalue===1?<div className="edu-back-white mb10 clearfix">
<div className="padding40-20">
<p className="color-grey-6 font-16 mb20">待处理图片路径</p>
<div className="df">
@ -970,10 +968,10 @@ export default class TPMevaluation extends Component {
<div></div>
</div>
</div>
</div>
</div>:""}
<div className="edu-back-white mb10 clearfix">
{pathoptionvalue===1? <div className="edu-back-white mb10 clearfix">
<div className="padding40-20">
<p className="color-grey-6 font-16 mb20">标准答案图片路径</p>
<div className="df">
@ -992,10 +990,10 @@ export default class TPMevaluation extends Component {
<div></div>
</div>
</div>
</div>
</div>:""}
<div className="edu-back-white mb10 clearfix">
{pathoptionvalue===1||pathoptionvalue===-1?"":<div className="edu-back-white mb10 clearfix">
<div className="padding40-20">
<p className="color-grey-6 font-16 mb20">学员答案文件路径</p>
<div className="df">
@ -1013,7 +1011,7 @@ export default class TPMevaluation extends Component {
<div></div>
</div>
</div>
</div>
</div>}
<div className="edu-back-white mb10 clearfix">
@ -1119,7 +1117,7 @@ export default class TPMevaluation extends Component {
</div>
<div className="clearfix mt30" style={{display:this.props.identity>3||this.props.identity===undefined||power===false?"none":"block"}}>
<div className="clearfix mt30" style={{display:this.props.identity>4||this.props.identity===undefined||power===false?"none":"block"}}>
<a className="defalutSubmitbtn fl mr20" onClick={this.submitarbitrationevaluation}>提交</a>
<a href={"/shixuns/" + shixunId + "/challenges"} className="defalutCancelbtn fl">取消</a>
</div>

@ -1240,21 +1240,21 @@ editanswersMD=(initValue, id)=> {
</span>
<span className="font-16 task-hide fl TPMtaskName">{position}</span>
<Link to={go_back_url === undefined ? "" : go_back_url}
className="color-grey-6 fr font-16 ml30">返回</Link>
className="color-grey-6 fr font-15 mt3">返回</Link>
{ prev_challenge===undefined?"":
<a href={prev_challenge} className="fr color-blue mr15 mt3">上一关</a>
<a href={prev_challenge} className="fr color-blue mr15 mt4">上一关</a>
}
{ next_challenge===undefined?"":
<a href={next_challenge}className="fr color-blue mr15 mt3">下一关</a>
<a href={next_challenge}className="fr color-blue mr15 mt4">下一关</a>
}
<a href={practice_url === undefined ? "" : practice_url}
className="fr color-blue mr15 mt4"
style={{display:this.props.identity>3||this.props.identity===undefined||this.props.status===2||this.props.status===1?"none":'block'}}
style={{display:this.props.identity>4||this.props.identity===undefined||this.props.status===2||this.props.status===1?"none":'block'}}
data-tip-down="新增代码编辑类型的任务">+&nbsp;实践类型</a>
<a href={choice_url === undefined ? "" : choice_url} className="fr color-blue mr15 mt4"
style={{display:this.props.identity>3||this.props.identity===undefined||this.props.status===2||this.props.status===1?"none":'block'}}
style={{display:this.props.identity>4||this.props.identity===undefined||this.props.status===2||this.props.status===1?"none":'block'}}
data-tip-down="新增选择题类型的任务">+&nbsp;选择题类型</a>
</div>
@ -1345,7 +1345,7 @@ editanswersMD=(initValue, id)=> {
</div>
<div className="clearfix mt30" style={{display:this.props.identity>3||this.props.identity===undefined||power===false?"none":"block"}}>
<div className="clearfix mt30" style={{display:this.props.identity>4||this.props.identity===undefined||power===false?"none":"block"}}>
<a className="defalutSubmitbtn fl mr20" onClick={sumittype===true?"":this.clickquestionsumit}>提交</a>
<a href={go_back_url}
className="defalutCancelbtn fl">取消</a>
@ -1545,7 +1545,7 @@ editanswersMD=(initValue, id)=> {
</div>
<div className="clearfix mt30" style={{display:this.props.identity>3||this.props.identity===undefined||power===false?"none":"block"}}>
<div className="clearfix mt30" style={{display:this.props.identity>4||this.props.identity===undefined||power===false?"none":"block"}}>
<a className="defalutSubmitbtn fl mr20"
onClick={this.answer_subit}>提交</a>
<a href={go_back_url}
@ -1735,7 +1735,7 @@ editanswersMD=(initValue, id)=> {
</div>
<div className="clearfix mt30" style={{display:this.props.identity>3||this.props.identity===undefined||power===false?"none":"block"}}>
<div className="clearfix mt30" style={{display:this.props.identity>4||this.props.identity===undefined||power===false?"none":"block"}}>
<a className="defalutSubmitbtn fl mr20"
onClick={()=>this.answer_subit("edit",challenge_choose_id)}>提交</a>
<a href={go_back_url}

@ -61,12 +61,13 @@ a{
#exercisememoMD .CodeMirror {
margin-top: 31px !important;
height: 700px !important;
width: 579px !important;
/*width: 579px !important;*/
}
#exercisememoMD .editormd-preview {
top: 40px !important;
height: 700px !important;
width: 578px !important;
}
#exercisememoMD{
height: 700px !important;
@ -79,7 +80,7 @@ a{
#questioMD .CodeMirror {
width: 550.5px !important;
/*width: 550.5px !important;*/
margin-top: 31px !important;
height: 550px !important;
}
@ -87,10 +88,11 @@ a{
#questioMD .editormd-preview {
top: 40px !important;
height: 550px !important;
width: 578px !important;
}
#newquestioMD .CodeMirror {
width: 549px !important;
/*width: 549px !important;*/
margin-top: 31px !important;
height: 364px !important;
}
@ -98,29 +100,32 @@ a{
#newquestioMD .editormd-preview {
top: 40px !important;
height: 364px !important;
width: 578px !important;
}
#challenge_choose_answer .CodeMirror {
margin-top: 31px !important;
height: 364px !important;
width: 578px !important;
/*width: 578px !important;*/
}
#challenge_choose_answer .editormd-preview {
top: 40px !important;
height: 364px !important;
width: 578px !important;
}
#neweditanswer .CodeMirror {
margin-top: 31px !important;
height: 364px !important;
width: 549.5px !important;
/*width: 549.5px !important;*/
}
#neweditanswer .editormd-preview {
top: 40px !important;
height: 364px !important;
width: 578px !important;
}
#repository_url_tip {
@ -130,22 +135,23 @@ a{
}
#editanswers .CodeMirror{
width: 548px !important;
/*width: 548px !important;*/
height: 358px !important;
margin-top: 30px !important;
}
#editanswers .editormd-preview{
width: 569px !important;
width: 578px !important;
height: 358px !important;
}
#newquestioMDs .CodeMirror{
width: 510px !important;
/*width: 510px !important;*/
height: 358px !important;
margin-top: 30px !important;
}
#newquestioMDs .editormd-preview{
width: 569px !important;
width: 578px !important;
height: 358px !important;
}
@ -155,13 +161,13 @@ a{
}
#answerMD .CodeMirror{
width: 569px !important;
/*width: 569px !important;*/
height: 600px !important;
margin-top: 30px !important;
}
#answerMD .editormd-preview{
width: 569px !important;
width: 578px !important;
height: 600px !important;
}

@ -29,7 +29,7 @@ class TPMNav extends Component {
}
<Link to={`/shixuns/${shixunId}/repository`}
style={{display: this.props.identity >3||this.props.identity===undefined ? "none" : 'block'}}
style={{display: this.props.identity >4||this.props.identity===undefined ? "none" : 'block'}}
className={`${match.url.indexOf('repository') != -1 ? 'active' : ''} fl mr40`}>版本库</Link>
<Link to={`/shixuns/${shixunId}/collaborators`}
@ -43,7 +43,7 @@ class TPMNav extends Component {
{/* target="_blank"*/}
<a
href={`/shixuns/${shixunId}/settings`} className="fr"
style={{display: this.props.identity >3||this.props.identity===undefined ? "none" : 'block'}}
style={{display: this.props.identity >4||this.props.identity===undefined ? "none" : 'block'}}
>配置</a>
</div>
);

@ -15,14 +15,14 @@
/*flex-wrap: wrap;*/
/*display: -webkit-flex; !* Safari *!*/
/*display: flex;*/
width: 340px;
width: 360px;
position:relative;
overflow: hidden;
}
.newsubscript{
position: absolute;
right: 23px;
bottom: 38px;
bottom: 16px;
cursor: pointer;
}
.newsubscript:hover{

@ -631,13 +631,14 @@ class Newshixuns extends Component {
}
bigopen = () => {
bigopen = (e) => {
this.setState({
opers: true
})
}
bigopens = () => {
bigopens = (e) => {
this.setState({
opers: false,
operss: false,
@ -646,16 +647,18 @@ class Newshixuns extends Component {
}
bigopensmal = () => {
bigopensmal = (e) => {
this.setState({
opensmail: true
})
}
sbigopen = () => {
sbigopen = (e) => {
this.setState({
operss: true
})
}
// sbigopens=()=>{
@ -1193,6 +1196,7 @@ class Newshixuns extends Component {
showToday={false}
showTime
locale={locale}
style={{"width": "184px"}}
format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择开启时间"
onChange={this.onChangeTimePicker}

@ -357,13 +357,13 @@ a.white-btn.use_scope-btn:hover{
}
#memoMD .CodeMirror {
width: 576px !important;
/*width: 576px !important;*/
margin-top: 31px !important;
height: 364px !important;
}
#memoMD .editormd-preview {
width: 567px !important;
width: 578px !important;
top: 40px !important;
height: 364px !important;
}

@ -174,43 +174,48 @@ class Challenges extends Component {
}
//开始实战按钮
startshixunCombat = (type, ids, path) => {
let { ChallengesDataList } = this.state;
let id = this.props.match.params.shixunId;
if (type > 3 || type === false) {
this.setState({
startbtns: true
})
let url = "/shixuns/" + id + "/shixun_exec.json";
axios.get(url).then((response) => {
let { ChallengesDataList } = this.state;
if(path===null){
let id = this.props.match.params.shixunId;
this.setState({
startbtns: true
})
let url = "/shixuns/" + id + "/shixun_exec.json";
axios.get(url).then((response) => {
if (response.data.status === -2) {
this.setState({
startbtns:false,
shixunsreplace:true,
hidestartshixunsreplacevalue:response.data.message+".json"
})
} else if (response.data.status === -1) {
console.log(response)
}else if(response.data.status===-3){
this.setState({
shixunsmessage:response.data.message,
startshixunCombattype:true,
startbtns:false
})
} else {
window.location.href = "/tasks/" + response.data.game_identifier;
// window.location.href = path
// let path="/tasks/"+response.data.game_identifier;
// this.props.history.push(path);
}
}).catch((error) => {
this.setState({
startbtns: false
})
});
}else{
if (type > 4 || type === false) {
window.location.href = path;
} else {
window.location.href = "/shixuns/" + ChallengesDataList.shixun_identifier + "/challenges/" + ids + path;
}
}
if (response.data.status === -2) {
this.setState({
startbtns:false,
shixunsreplace:true,
hidestartshixunsreplacevalue:response.data.message+".json"
})
} else if (response.data.status === -1) {
console.log(response)
}else if(response.data.status===-3){
this.setState({
shixunsmessage:response.data.message,
startshixunCombattype:true,
startbtns:false
})
} else {
window.location.href = "/tasks/" + response.data.game_identifier;
// window.location.href = path
// let path="/tasks/"+response.data.game_identifier;
// this.props.history.push(path);
}
}).catch((error) => {
this.setState({
startbtns: false
})
});
} else {
window.location.href = "/shixuns/" + ChallengesDataList.shixun_identifier + "/challenges/" + ids + path;
}
}
hidestartshixunCombattype=()=>{

@ -36,9 +36,9 @@ class Propaedeutics extends Component {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
}else{
if(response.data.content[0]!=null){
if(response.data.content!=null){
this.setState({
PropaedeuticsListcontent:response.data.content[0]
PropaedeuticsListcontent:response.data.content
})
}else{
this.setState({

@ -7,11 +7,9 @@ import PropTypes from 'prop-types';
import classNames from 'classnames';
// import { Rating,Loading} from '@icedesign/base';
import {getImageUrl,setImagesUrl, toPath} from 'educoder';
// import { Pagination,Row,Col } from 'antd';
import { Spin,Icon } from 'antd';
import 'antd/lib/pagination/style/index.css';
@ -21,8 +19,6 @@ import Rating from '@icedesign/base/lib/rating';
import Pagination from '@icedesign/base/lib/pagination';
// import Loading from '@icedesign/base/lib/loading';
// 引入业务组件样式
import '@icedesign/base/lib/pagination/style.js';
@ -30,8 +26,6 @@ import '@icedesign/base/lib/rating/style.js';
import { Tooltip } from 'antd';
// import '@icedesign/base/lib/loading/style.js';
import axios from 'axios';
const $ = window.$;
@ -63,8 +57,8 @@ class ShixunCard extends Component {
let {middleshixundata, pagination, typepvisible, pages, totalcount} = this.props;
return (
<div className="educontent mb80">
{/*<Loading visible={typepvisible} shape="dot-circle" color='#4AC7FF'>*/}
<Spin spinning={typepvisible} size="large" style={{marginTop:'15%'}}>
<div id="shixun_list_content"
style={{display: middleshixundata === undefined || middleshixundata.length === 0 ? "block" : "none"}}>
<div className="square-list clearfix">
@ -168,7 +162,7 @@ class ShixunCard extends Component {
</div>
</div>
{/*</Loading>*/}
</Spin>
</div>
)
}

@ -6,6 +6,8 @@ import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import axios from 'axios';
import { Spin } from 'antd';
import { TPMIndexHOC } from '../TPMIndexHOC';
import { SnackbarHOC } from 'educoder';
@ -16,10 +18,6 @@ import ShixunSearchBar from './ShixunSearchBar';
import ShixunCard from './ShixunCard';
import Loading from '@icedesign/base/lib/loading';
import '@icedesign/base/lib/loading/style.js';
const queryString = require('query-string');
const $ = window.$;
@ -362,9 +360,7 @@ class ShixunsIndex extends Component {
return (
<div className="newMain clearfix backFAFAFA">
<Loading visible={typepvisible} shape="dot-circle" color='#4AC7FF'>
{/*懒加载*/}
{/*<Spin spinning={typepvisible} size="large" style={{marginTop:'15%'}}>*/}
<ShixunSearchBar
Updatasearchlist={this.Updatasearchlist.bind(this)}
allUpdatashixunlist={this.allUpdatashixunlist}
@ -393,8 +389,7 @@ class ShixunsIndex extends Component {
pages={pages}
shixunsPage={this.shixunsPage.bind(this)}
/>
</Loading>
{/*</Spin>*/}
</div>
);
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save