@ -2458,6 +2458,8 @@ var SeeAnswer = __webpack_require__(89761);
var componentmodules = _ _webpack _require _ _ ( 13706 ) ;
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = _ _webpack _require _ _ ( 41686 ) ;
// EXTERNAL MODULE: ./node_modules/_js-base64@2.6.4@js-base64/base64.js
var base64 = _ _webpack _require _ _ ( 24334 ) ;
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx _runtime = _ _webpack _require _ _ ( 37712 ) ;
; // CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Review/component/BFill.tsx
@ -2476,6 +2478,7 @@ var jsx_runtime = __webpack_require__(37712);
var TextArea = input /* default */ . Z . TextArea ;
var BFill = function BFill ( _ref ) {
var _datas$records , _item$submit _records ;
var item = _ref . item ,
answerData = _ref . answerData ,
changeScoreData = _ref . changeScoreData ,
@ -2500,33 +2503,77 @@ var BFill = function BFill(_ref) {
_useState8 = slicedToArray _default ( ) ( _useState7 , 2 ) ,
datas = _useState8 [ 0 ] ,
setdatas = _useState8 [ 1 ] ;
var columns = [ {
title : '提交答案序号' ,
dataIndex : 'name' ,
render : function render ( text , record , index ) {
return index + 1 ;
}
var _useState9 = ( 0 , _react _17 _0 _2 _react . useState ) ( {
page : 1 ,
limit : 5
} ) ,
_useState10 = slicedToArray _default ( ) ( _useState9 , 2 ) ,
urlData = _useState10 [ 0 ] ,
setUrlData = _useState10 [ 1 ] ;
var columns1 = [ {
title : '序号' ,
width : 80 ,
dataIndex : 'index'
} , {
title : '学生答案' ,
dataIndex : 'created_at' ,
width : "40%" ,
dataIndex : 'answer_content' ,
render : function render ( text ) {
return dayjs _min _default ( ) ( text ) . format ( 'YYYY-MM-DD HH:mm' ) ;
return text === null || text === void 0 ? void 0 : text . map ( function ( item , index ) {
return /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( "pre" , {
style : {
whiteSpace : 'pre-wrap'
} ,
children : [ item === null || item === void 0 ? void 0 : item . name , ":" , item === null || item === void 0 ? void 0 : item . value ]
} , index ) ;
} ) ;
}
} , {
title : '评测结果' ,
dataIndex : 'error_msg' ,
render : function render ( text ) {
return Base64 . decode ( text ) ;
}
dataIndex : 'evaluate_status'
} , {
title : '评测时间' ,
dataIndex : 'error_msg' ,
render : function render ( text ) {
return dayjs _min _default ( ) ( text ) . format ( 'YYYY-MM-DD HH:mm:ss' ) ;
width : 110 ,
dataIndex : 'evaluate_time'
} , {
title : '得分' ,
width : 80 ,
dataIndex : 'score'
} ] ;
var columns2 = [ {
title : '序号' ,
width : 80 ,
dataIndex : 'index'
} , {
title : '学生答案' ,
width : ( datas === null || datas === void 0 || ( _datas$records = datas . records ) === null || _datas$records === void 0 ? void 0 : _datas$records . every ( function ( k ) {
return ! ( k !== null && k !== void 0 && k . is _new ) ;
} ) ) && 80 ,
dataIndex : 'answer_content' ,
render : function render ( text , record ) {
return text === null || text === void 0 ? void 0 : text . map ( function ( item , index ) {
return /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( "pre" , {
style : {
whiteSpace : 'pre-wrap'
} ,
children : [ item === null || item === void 0 ? void 0 : item . name , ":" , item === null || item === void 0 ? void 0 : item . value ]
} , index ) ;
} ) ;
}
} , {
title : '评测结果' ,
dataIndex : 'evaluate_status' ,
render : function render ( text , record ) {
return record !== null && record !== void 0 && record . is _new ? text : base64 . Base64 . decode ( text ) ;
}
} , {
title : '评测时间' ,
width : 110 ,
dataIndex : 'evaluate_time'
} , {
title : '得分' ,
dataIndex : 'error_msg'
width : 80 ,
dataIndex : 'score'
} ] ;
( 0 , _react _17 _0 _2 _react . useEffect ) ( function ( ) {
if ( changeScoreData !== null && changeScoreData !== void 0 && changeScoreData [ item . q _position ] ) {
@ -2546,6 +2593,37 @@ var BFill = function BFill(_ref) {
} ) ;
setUserAnswer ( data ) ;
} , [ item === null || item === void 0 ? void 0 : item . user _answer ] ) ;
( 0 , _react _17 _0 _2 _react . useEffect ) ( function ( ) {
isshow && getSubmitRecords ( ) ;
} , [ urlData ] ) ;
var getSubmitRecords = /*#__PURE__*/ function ( ) {
var _ref2 = asyncToGenerator _default ( ) ( /*#__PURE__*/ regeneratorRuntime _default ( ) ( ) . mark ( function _callee ( ) {
var res ;
return regeneratorRuntime _default ( ) ( ) . wrap ( function _callee$ ( _context ) {
while ( 1 ) switch ( _context . prev = _context . next ) {
case 0 :
_context . next = 2 ;
return ( 0 , fetch /* default */ . ZP ) ( "/api/myproblems/" . concat ( item === null || item === void 0 ? void 0 : item . hack _user _identifier , "/exercise_submit_records.json" ) , {
params : {
exercise _question _id : item === null || item === void 0 ? void 0 : item . question _id
}
} ) ;
case 2 :
res = _context . sent ;
// let res = await Fetch(`/api/myproblems/${item?.hack_user_identifier}/submit_records.json`, {
// method: 'get',
// })
setdatas ( res ) ;
case 4 :
case "end" :
return _context . stop ( ) ;
}
} , _callee ) ;
} ) ) ;
return function getSubmitRecords ( ) {
return _ref2 . apply ( this , arguments ) ;
} ;
} ( ) ;
return /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( "div" , {
className : componentmodules /* default */ . Z . fillBg ,
children : [ /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( "div" , {
@ -2560,42 +2638,26 @@ var BFill = function BFill(_ref) {
style : {
cursor : 'pointer'
} ,
onClick : /*#__PURE__*/ asyncToGenerator _default ( ) ( /*#__PURE__*/ regeneratorRuntime _default ( ) ( ) . mark ( function _callee ( ) {
var res , _res$records ;
return regeneratorRuntime _default ( ) ( ) . wrap ( function _callee$ ( _context ) {
while ( 1 ) switch ( _context . prev = _context . next ) {
onClick : /*#__PURE__*/ asyncToGenerator _default ( ) ( /*#__PURE__*/ regeneratorRuntime _default ( ) ( ) . mark ( function _callee2 ( ) {
return regeneratorRuntime _default ( ) ( ) . wrap ( function _callee2$ ( _context2 ) {
while ( 1 ) switch ( _context2 . prev = _context2 . next ) {
case 0 :
if ( item !== null && item !== void 0 && item . hack _user _identifier ) {
_context . next = 3 ;
_context 2 . next = 3 ;
break ;
}
message /* default */ . ZP . info ( "当前学生暂无评测记录" ) ;
return _context . abrupt ( "return" ) ;
return _context 2 . abrupt ( "return" ) ;
case 3 :
_context . next = 5 ;
return ( 0 , fetch /* default */ . ZP ) ( "/api/myproblems/" . concat ( item === null || item === void 0 ? void 0 : item . hack _user _identifier , "/submit_records.json" ) , {
method : 'get'
} ) ;
case 5 :
res = _context . sent ;
if ( ! res ) {
_context . next = 12 ;
break ;
}
if ( ! ( ( res === null || res === void 0 || ( _res$records = res . records ) === null || _res$records === void 0 ? void 0 : _res$records . length ) === 0 ) ) {
_context . next = 10 ;
break ;
}
message /* default */ . ZP . info ( "当前学生暂无评测记录" ) ;
return _context . abrupt ( "return" ) ;
case 10 :
setisshow ( true ) ;
setdatas ( res === null || res === void 0 ? void 0 : res . records ) ;
case 12 :
setUrlData ( objectSpread2 _default ( ) ( objectSpread2 _default ( ) ( { } , urlData ) , { } , {
page : 1
} ) ) ;
case 5 :
case "end" :
return _context . stop ( ) ;
return _context2 . stop ( ) ;
}
} , _callee ) ;
} , _callee2 ) ;
} ) ) ,
className : "font14 c-light-primary mb5" ,
children : "\u67E5\u770B\u8BC4\u6D4B\u8BB0\u5F55"
@ -2624,43 +2686,37 @@ var BFill = function BFill(_ref) {
} ) ;
} ) , seeAnswerVisible && /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( SeeAnswer /* SeeAnswer */ . u , {
data : item
} ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( table /* default */ . Z , {
} ) , ! ! ( item !== null && item !== void 0 && ( _item$submit _records = item . submit _records ) !== null && _item$submit _records !== void 0 && _item$submit _records . length ) && /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( table /* default */ . Z , {
className : "mt20" ,
dataSource : datas ,
columns : columns
dataSource : item === null || item === void 0 ? void 0 : item . submit _records ,
columns : columns1 ,
pagination : false
} ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( es _modal /* default */ . Z , {
title : "\u8BC4\u6D4B\u8BB0\u5F55" ,
open : isshow ,
footer : false ,
centered : true ,
width : 900 ,
onCancel : function onCancel ( ) {
setisshow ( false ) ;
} ,
width : 700 ,
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( table /* default */ . Z , {
scroll : {
y : 400
} ,
dataSource : datas ,
columns : [ {
title : '评测序号' ,
dataIndex : 'name' ,
render : function render ( text , record , index ) {
return index + 1 ;
}
} , {
title : '评测时间' ,
dataIndex : 'created_at' ,
render : function render ( text , record , index ) {
return dayjs _min _default ( ) ( text ) . format ( 'YYYY-MM-DD HH:mm' ) ;
}
} , {
title : '评测结果' ,
dataIndex : 'error_msg' ,
render : function render ( text , record , index ) {
return Base64 . decode ( text ) ;
dataSource : datas === null || datas === void 0 ? void 0 : datas . records ,
columns : columns2 ,
pagination : {
current : urlData . page ,
pageSize : urlData . limit ,
total : datas === null || datas === void 0 ? void 0 : datas . records _count ,
onChange : function onChange ( page , limit ) {
setUrlData ( objectSpread2 _default ( ) ( objectSpread2 _default ( ) ( { } , urlData ) , { } , {
page : page ,
limit : limit
} ) ) ;
}
} ]
}
} )
} ) ]
} ) ;
@ -3410,8 +3466,6 @@ var ScoreModal = function ScoreModal(_ref, ref) {
} ;
/* harmony default export */ var component _ScoreModal = ( /*#__PURE__*/ ( 0 , _react _17 _0 _2 _react . forwardRef ) ( ScoreModal ) ) ;
;
// EXTERNAL MODULE: ./node_modules/_js-base64@2.6.4@js-base64/base64.js
var base64 = _ _webpack _require _ _ ( 24334 ) ;
; // CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Review/component/NewProgram.tsx