diff --git a/public/javascripts/educoder/edu_application.js b/public/javascripts/educoder/edu_application.js index 91e04ce80..feacff0dd 100644 --- a/public/javascripts/educoder/edu_application.js +++ b/public/javascripts/educoder/edu_application.js @@ -1,1288 +1,1288 @@ -document.write(""); - -/*! - * JavaScript Cookie v2.2.0 - * https://github.com/js-cookie/js-cookie - * - * Copyright 2006, 2015 Klaus Hartl & Fagner Brack - * Released under the MIT license - */ -!function(e) { - var n; - if ("function" == typeof define && define.amd && (define(e), - n = !0), - "object" == typeof exports && (module.exports = e(), - n = !0), - !n) { - var t = window.Cookies - , o = window.Cookies = e(); - o.noConflict = function() { - return window.Cookies = t, - o - } - } -}(function() { - function e() { - for (var e = 0, n = {}; e < arguments.length; e++) { - var t = arguments[e]; - for (var o in t) - n[o] = t[o] - } - return n - } - function n(e) { - return e.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent) - } - return function t(o) { - function r() {} - function i(n, t, i) { - if ("undefined" != typeof document) { - "number" == typeof (i = e({ - path: "/" - }, r.defaults, i)).expires && (i.expires = new Date(1 * new Date + 864e5 * i.expires)), - i.expires = i.expires ? i.expires.toUTCString() : ""; - try { - var c = JSON.stringify(t); - /^[\{\[]/.test(c) && (t = c) - } catch (e) {} - t = o.write ? o.write(t, n) : encodeURIComponent(String(t)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent), - n = encodeURIComponent(String(n)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape); - var f = ""; - for (var u in i) - i[u] && (f += "; " + u, - !0 !== i[u] && (f += "=" + i[u].split(";")[0])); - return document.cookie = n + "=" + t + f - } - } - function c(e, t) { - if ("undefined" != typeof document) { - for (var r = {}, i = document.cookie ? document.cookie.split("; ") : [], c = 0; c < i.length; c++) { - var f = i[c].split("=") - , u = f.slice(1).join("="); - t || '"' !== u.charAt(0) || (u = u.slice(1, -1)); - try { - var a = n(f[0]); - if (u = (o.read || o)(u, a) || n(u), - t) - try { - u = JSON.parse(u) - } catch (e) {} - if (r[a] = u, - e === a) - break - } catch (e) {} - } - return e ? r[e] : r - } - } - return r.set = i, - r.get = function(e) { - return c(e, !1) - } - , - r.getJSON = function(e) { - return c(e, !0) - } - , - r.remove = function(n, t) { - i(n, "", e(t, { - expires: -1 - })) - } - , - r.defaults = {}, - r.withConverter = t, - r - }(function() {}) -}); - -$(function() { - var result = location.search.match(/\?search=(\w*)&?/i) - if (result && result[1]) { - var searchText = result[1] - $('#search-input').val(searchText) - } - // 未报名用户登录时弹框 - // console.log(Cookies.get('enroll_status')); - // if(Cookies.get('enroll_status') == 0){ - // Cookies.remove('enroll_status'); - // var html='
可能会影响某些功能的正常使用
可能会影响某些功能的正常使用
+ 还未上传附件 +
+ : + + } {this.state.updatas===true?请上传附件:""}
{Commonheadofthetestpaper === undefined?"":Commonheadofthetestpaper.exercise_name}
@@ -252,19 +252,18 @@ class Testpapersettinghomepage extends Component{ padding-top: 10px; padding-bottom: 8px; } + a:hover { + color:#1A0B00 !important; + } `}阶段成绩
-实训详情
+实训详情
{ challenge.map((item,key)=>{ return( -- + 第{item[0].position}关 - {item[0].name} + {item[0].name}
@@ -308,7 +318,7 @@ class shixunAnswer extends Component{ {...this.props} {...this.state} challenge={item[0].outputs} > - { item[0].st===0 ?最近通过的代码 @@ -316,7 +326,7 @@ class shixunAnswer extends Component{
+ + + + + {item.name} + + + {item.response===undefined?"":bytesToSize(item.size)} + + this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}> +
+ ) + })} {/*{attachments&&attachments.map((item,key)=>{*/} {/*return(*/} diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js index e6185188a..585986fb2 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js @@ -2,7 +2,7 @@ import React, {Component} from "React"; import {Form, Select, Input, Button, Checkbox, Upload, Icon, message, Modal} from "antd"; import {Link} from 'react-router-dom'; import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; -import {WordsBtn, getUrl} from 'educoder'; +import {WordsBtn, getUrl,bytesToSize} from 'educoder'; import axios from 'axios'; import Modals from '../../../modals/Modals'; import '../../css/Courses.css'; @@ -133,29 +133,29 @@ class GraduationTasksnew extends Component { this.setState({fileList}); } - onAttachmentRemove = (file) => { - // confirm({ - // title: '确定要删除这个附件吗?', - // okText: '确定', - // cancelText: '取消', - // // content: 'Some descriptions', - // onOk: () => { - // this.deleteAttachment(file) - // }, - // onCancel() { - // console.log('Cancel'); - // }, - // }); - // return false; - - this.setState({ - Modalstype: true, - Modalstopval: '确定要删除这个附件吗?', - ModalSave: () => this.deleteAttachment(file), - ModalCancel: this.cancelAttachment - }) - return false; - } + // onAttachmentRemove = (file) => { + // // confirm({ + // // title: '确定要删除这个附件吗?', + // // okText: '确定', + // // cancelText: '取消', + // // // content: 'Some descriptions', + // // onOk: () => { + // // this.deleteAttachment(file) + // // }, + // // onCancel() { + // // console.log('Cancel'); + // // }, + // // }); + // // return false; + // + // this.setState({ + // Modalstype: true, + // Modalstopval: '确定要删除这个附件吗?', + // ModalSave: () => this.deleteAttachment(file), + // ModalCancel: this.cancelAttachment + // }) + // return false; + // } cancelAttachment = () => { this.setState({ @@ -166,8 +166,9 @@ class GraduationTasksnew extends Component { }) } - deleteAttachment = (file) => { - const url = `/attachments/${file.response ? file.response.id : file.uid}.json` + onAttachmentRemove = (file) => { + // const url = `/attachments/${file.response ? file.response.id : file.uid}.json` + const url = `/attachments/${file}.json` axios.delete(url, {}) .then((response) => { if (response.data) { @@ -256,7 +257,7 @@ class GraduationTasksnew extends Component { multiple: true, // 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, @@ -385,7 +386,7 @@ class GraduationTasksnew extends Component {+ + + + + {item.name} + + + {item.response===undefined?"":bytesToSize(item.size)} + + this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}> +
+ ) + })} ++
- {tableData && tableData.graduation_topic_name}
-