From 421b02c79d7baa50444254704226aac2a1145dda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 7 Sep 2019 11:24:15 +0800 Subject: [PATCH 01/79] =?UTF-8?q?=E6=96=B0=E7=89=88=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E5=BC=B9=E7=AA=97start?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/NewShixunModel.js | 65 +++++++++++++++++++ .../courses/shixunHomework/shixunHomework.js | 9 +++ 2 files changed, 74 insertions(+) create mode 100644 public/react/src/modules/courses/coursesPublic/NewShixunModel.js diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js new file mode 100644 index 000000000..c8f3d6857 --- /dev/null +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -0,0 +1,65 @@ +import React,{Component} from 'react'; +import { Modal,Checkbox,Select,Input,Tooltip,Spin,Icon,Drawer} from "antd"; +import axios from'axios'; + + +class NewShixunModel extends Component{ + constructor(props){ + super(props) + this.state={ + + } + } + + render() { + + // let {Searchvalue,type,hometypepvisible,shixunmodallist,newshixunmodallist,}=this.state; + // let {visible,patheditarry}=this.props; + + return( +
+ + + {/*this.state.visible*/} +

Some contents...

+

Some contents...

+

Some contents...

Some contents...

+

Some contents...

+

Some contents...

Some contents...

+

Some contents...

+

Some contents...

Some contents...

+

Some contents...

+

Some contents...

Some contents...

+

Some contents...

+

Some contents...

Some contents...

+

Some contents...

+

Some contents...

Some contents...

+

Some contents...

+

Some contents...

Some contents...

+

Some contents...

+

Some contents...

Some contents...

+

Some contents...

+

Some contents...

Some contents...

+

Some contents...

+

Some contents...

+

Some contents...

+

Some contents...

+ +
+ + +
+ + ) + } +} + +export default NewShixunModel; \ No newline at end of file diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index fe959b691..6fb55894a 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -6,6 +6,7 @@ import axios from'axios'; import HomeworkModal from "../coursesPublic/HomeworkModal"; import ShixunModal from "../coursesPublic/ShixunModal"; import PathModal from "../coursesPublic/PathModal"; +import NewShixunModel from '../coursesPublic/NewShixunModel'; import AddcoursesNav from "../coursesPublic/AddcoursesNav"; import Modals from '../../modals/Modals'; import moment from 'moment'; @@ -940,6 +941,14 @@ class ShixunHomework extends Component{ return(
+ + {/*新版实训model*/} + + + {/*提示*/} {Modalstype&&Modalstype===true? Date: Tue, 10 Sep 2019 16:52:46 +0800 Subject: [PATCH 02/79] =?UTF-8?q?=E6=96=B0=E7=89=88=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 2 +- .../courses/coursesPublic/NewShixunModel.js | 156 +++++++++++++---- .../courses/coursesPublic/Newshixunmodel.css | 157 ++++++++++++++++++ 3 files changed, 285 insertions(+), 30 deletions(-) create mode 100644 public/react/src/modules/courses/coursesPublic/Newshixunmodel.css diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 939d2cdaa..93447b65c 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -10,7 +10,7 @@ broadcastChannelOnmessage('refreshPage', () => { }) function locationurl(list){ - debugger + if (window.location.port === "3007") { } else { diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index c8f3d6857..3c6b736f6 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -1,8 +1,8 @@ import React,{Component} from 'react'; -import { Modal,Checkbox,Select,Input,Tooltip,Spin,Icon,Drawer} from "antd"; +import { Modal,Checkbox,Select,Input,Tooltip,Spin,Icon,Drawer,Dropdown,Menu,} from "antd"; import axios from'axios'; - - +import './Newshixunmodel.css'; +const Search = Input.Search; class NewShixunModel extends Component{ constructor(props){ super(props) @@ -15,12 +15,52 @@ class NewShixunModel extends Component{ // let {Searchvalue,type,hometypepvisible,shixunmodallist,newshixunmodallist,}=this.state; // let {visible,patheditarry}=this.props; + const menu = ( + + + + ); + + const menus = ( + + + + 初级 + + + + + + 中级 + + + + + + 高级 + + + + + + 顶级 + + + + ); return(
+ - {/*this.state.visible*/} -

Some contents...

-

Some contents...

-

Some contents...

Some contents...

-

Some contents...

-

Some contents...

Some contents...

-

Some contents...

-

Some contents...

Some contents...

-

Some contents...

-

Some contents...

Some contents...

-

Some contents...

-

Some contents...

Some contents...

-

Some contents...

-

Some contents...

Some contents...

-

Some contents...

-

Some contents...

Some contents...

-

Some contents...

-

Some contents...

Some contents...

-

Some contents...

-

Some contents...

Some contents...

-

Some contents...

-

Some contents...

-

Some contents...

-

Some contents...

+
- +
+ +
+
+ 搜索} + onInput={(e)=>this.setdatafunsval(e)} + onSearch={ (value)=>this.setdatafuns(value)} /> +
+ +
+ +

+ + 已选 6 个实训 + 5 个实训 + + + 学习人数 + this.updatedlist(sort_by)}> + + + + + + + + 难度 + + +

+

+ 我的实训 + 全部实训 +

+ +
+ +
+
+
+
+ + 移动云启 ——JAVA面向对象 + + +
+

+ 已被广泛应用于移动及桌面应用程序、Web应用程序、分布式系统和嵌入式系统应用程序等各个领域的软件开发中。 +

+ +

+ 已被广泛应用于移动及桌面应用程序、Web应用程序、分布式系统和嵌入式系统应用程序等各个领域的软件开发中。 +

+ +

+ + 13123 + 213次引用 + 312次答题 + 123 + + + +

123123
+ +

+ + +
+
+
+
+
+ +
+ +
) diff --git a/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css b/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css new file mode 100644 index 000000000..ec06b1f4b --- /dev/null +++ b/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css @@ -0,0 +1,157 @@ +.searchinput{ + width: 800px; + margin-top: 53px; +} +.newshixunheadersear{ + display: flex; + justify-content: center; +} +.packinput .ant-input{ + height: 55px; + width:663px !important; + font-size: 14px; + color: #681616 !important; + border-color: #E1EDF8 !important; + padding-left: 20px; +} + +.packinput .ant-input-group-addon .ant-btn{ + width:137px !important; + font-size: 18px; + height: 53px; + background:rgba(76,172,255,1); + +} +.tabtitle{ + height: 62px !important; + box-shadow: 3px 10px 21px 0px rgba(76, 76, 76, 0.15); + border-radius: 6px; + background: #fff; + display: flex; + justify-content: center; +} +.tabtitles2{ + background: #fff; + height: 62px !important; + width: 1200px; +} + +.tabtitless{ + height: 62px !important; + line-height: 62px !important; + +} +.tabtitle1{ + +} +.tabtitle2{ + margin-left: 30px !important; + +} + + +.counttit{ + display: flex; + justify-content: center; +} + +.counttittext{ + text-align: left; + width: 1200px; + height: 18px; + color: #888888; + font-size: 13px; + margin-top: 24px; + + +} +.counttittexts{ + color: #4CACFF !important; + font-size: 13px; +} + +.mainx{ + display: flex; + justify-content: center; + margin-top: 17px; +} +.project-packages-list{ + +} +.project-package-item{ + display: -webkit-flex; + display: flex; + flex-direction:column; + margin-bottom: 20px; + padding: 20px; + background: white; + /* box-shadow: 1px 3px 3px 1px rgba(156,156,156,0.16); */ + +} +.xuxianpro{ + height: 20px; + border-bottom: 1px dashed; + border-color: #EAEAEA; + margin-bottom: 18px; +} +.magr11{ + margin-top: 11px; +} +.highlight{ + color: #4CACFF; +} +.fonttext{ + font-size: 20px; + font-weight:bold; +} + +.fontextcolor{ + color: #777777; +} +.tzbq{ + margin-left: 68px; +} +.tzbqx{ + /* margin-left: 24px; */ +} +.bjyss{ + background: #F8F8F8; +} +.zj{ + overflow:hidden; + text-overflow:ellipsis; + white-space:nowrap +} +.ziticor{ + color: #777777; + font-size: 13px; +} +.foohter{ + margin-top: 20px; + display: flex; + flex-direction:row; +} + +.maxwidth900{ + max-width: 900px; + overflow:hidden; + text-overflow:ellipsis; + white-space:nowrap; + font-size: 18px !important; + font-weight: 500; + color: rgba(51,51,51,1) !important; +} + + +.newshixunmodelmidfont{ + font-size: 14px; + font-weight: 400; + color: #999999; + margin-top: 20px; +} + +.newshixunmodelbotfont{ + font-size:12px; + font-weight:400; + color:rgba(102,102,102,1); +} \ No newline at end of file From cfc789c3d59a57692448a8f13ed886521639fa2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 11 Sep 2019 08:55:13 +0800 Subject: [PATCH 03/79] =?UTF-8?q?=E6=96=B0=E7=89=88=E5=AE=9E=E8=AE=ADmodel?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/NewShixunModel.js | 96 ++++++++++++------- .../courses/coursesPublic/Newshixunmodel.css | 47 ++++++++- 2 files changed, 108 insertions(+), 35 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index 3c6b736f6..2294684a7 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -1,5 +1,5 @@ import React,{Component} from 'react'; -import { Modal,Checkbox,Select,Input,Tooltip,Spin,Icon,Drawer,Dropdown,Menu,} from "antd"; +import { Modal,Checkbox,Select,Input,Tooltip,Spin,Icon,Drawer,Dropdown,Menu,Breadcrumb,Pagination,Button} from "antd"; import axios from'axios'; import './Newshixunmodel.css'; const Search = Input.Search; @@ -15,11 +15,6 @@ class NewShixunModel extends Component{ // let {Searchvalue,type,hometypepvisible,shixunmodallist,newshixunmodallist,}=this.state; // let {visible,patheditarry}=this.props; - const menu = ( - - - - ); const menus = ( @@ -90,35 +85,34 @@ class NewShixunModel extends Component{ 已选 6 个实训 5 个实训 - - - 学习人数 - this.updatedlist(sort_by)}> - - - - - + + + 学习人数 + this.updatedlist(sort_by)}> + + + + - - 难度 + + 难度

- 我的实训 - 全部实训 + 我的实训 + 全部实训

-
+
-
- +
+ 移动云启 ——JAVA面向对象 @@ -131,24 +125,58 @@ class NewShixunModel extends Component{ 已被广泛应用于移动及桌面应用程序、Web应用程序、分布式系统和嵌入式系统应用程序等各个领域的软件开发中。

-

- - 13123 - 213次引用 - 312次答题 - 123 - - - -

123123
- -

+
+
+
+ +

+ + + Home + Application Center + Application List + An Application + An Application + + +

+ + + 难度 + +
+ +
+ +
+ +
+ + +
+
diff --git a/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css b/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css index ec06b1f4b..0d785e9c7 100644 --- a/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css +++ b/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css @@ -147,11 +147,56 @@ font-size: 14px; font-weight: 400; color: #999999; - margin-top: 20px; + margin-top: 15px; + margin-left: 30px; } .newshixunmodelbotfont{ font-size:12px; font-weight:400; color:rgba(102,102,102,1); + margin-top: 15px; + margin-left: 30px; +} + +.newshixunlist{ + max-height:227px; +} + +.xuxianpro { + height: 20px; + border-bottom: 1px dashed; + border-color: #eaeaea; + margin-bottom: 18px; +} + +.newshixunpd030{ + padding: 0px 30px; +} + +.pd303010{ + padding: 30px 30px 10px; +} + +.newshixunfont12{ + font-size: 12px; + color: rgba(76,172,255,1); + line-height: 21px; +} + +.newshixunmode{ + width: 100px; + height: 38px; + border-radius: 3px; + border: 1px solid rgba(191,191,191,1); +} + +.ntopsj { + position: absolute; + top: -4px; +} + +.nyslbottomsj { + position: absolute; + bottom: -6px; } \ No newline at end of file From 8892e402919b3bb346508f5c5211c5f262be63e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 11 Sep 2019 15:27:53 +0800 Subject: [PATCH 04/79] =?UTF-8?q?=E6=96=B0=E7=89=88=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/ListPageIndex.js | 18 +- .../courses/coursesPublic/NewShixunModel.js | 170 ++++++++++++------ .../courses/shixunHomework/shixunHomework.js | 1 + 3 files changed, 128 insertions(+), 61 deletions(-) diff --git a/public/react/src/modules/courses/ListPageIndex.js b/public/react/src/modules/courses/ListPageIndex.js index ae52cd6b8..9d9b28558 100644 --- a/public/react/src/modules/courses/ListPageIndex.js +++ b/public/react/src/modules/courses/ListPageIndex.js @@ -81,13 +81,13 @@ class ListPageIndex extends Component{ } componentDidMount(){ - console.log("77"); + // console.log("77"); var yslGuideone = window.localStorage.getItem('yslGuideone'); - console.log("78"); - console.log(yslGuideone); + // console.log("78"); + // console.log(yslGuideone); try { if (yslGuideone === "true") { - console.log("true 字符串"); + // console.log("true 字符串"); this.setState({ yslGuideone:true, }) @@ -95,7 +95,7 @@ class ListPageIndex extends Component{ this.setState({ yslGuideone:false, }); - console.log("false 字符串"); + // console.log("false 字符串"); } }catch (e) { console.log(e); @@ -121,8 +121,7 @@ class ListPageIndex extends Component{ window.localStorage.setItem('yslGuideone', bool); try { if (bool === "true") { - console.log("115"); - console.log("true 字符串"); + this.setState({ yslGuideone:true, }) @@ -130,11 +129,10 @@ class ListPageIndex extends Component{ this.setState({ yslGuideone:false, }); - console.log("124"); - console.log("false 字符串"); + } }catch (e) { - console.log(e); + // console.log(e); this.setState({ yslGuideone:false, }); diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index 2294684a7..54918e634 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -7,38 +7,89 @@ class NewShixunModel extends Component{ constructor(props){ super(props) this.state={ + diff:0, + shixun_list:undefined, + shixuns_count:undefined, + } + } + componentDidMount() { + console.log(this.props.type) + + if(this.props.type==='shixun'){ + let url="/shixuns/shixun_list.json" + axios.get(url).then((response) => { + + if(response.data){ + console.log(response.data); + if(response.data.status===0){ + } + } + + }) + }else{ + let url="/shixuns/shixun_list.json" + axios.get(url,{params:{ + type:'all', //这是带过来的值 + status:'all', + search:undefined, + diff:0, + order:'desc', + page:1, + limit:15, + }}).then((response) => { + + if(response.data){ + this.setState({ + shixun_list:response.data.shixun_list, + shixuns_count:response.data.shixuns_count, + }) + } + + }) } + } + DropdownClick=(type)=>{ + this.setState({ + diff:type + }) + } render() { - // let {Searchvalue,type,hometypepvisible,shixunmodallist,newshixunmodallist,}=this.state; + let {diff,datas,shixun_list,shixuns_count}=this.state; // let {visible,patheditarry}=this.props; const menus = ( - + this.DropdownClick(0)}> + 所有 + + + + + this.DropdownClick(1)} > 初级 - + this.DropdownClick(2)}> 中级 - + this.DropdownClick(3)}> 高级 - - 顶级 + this.DropdownClick(4)}> + 顶级 @@ -84,7 +135,7 @@ class NewShixunModel extends Component{

已选 6 个实训 - 5 个实训 + {shixuns_count===undefined?"":shixuns_count} 个实训 学习人数 @@ -96,7 +147,7 @@ class NewShixunModel extends Component{ - 难度 + {diff===0?"所有":diff===1?"初级":diff===2?"中级":diff===3?"高级":diff===4?"顶级":""}

@@ -107,31 +158,45 @@ class NewShixunModel extends Component{

+ {/*author_name: "刘强"*/} + {/*author_school_name: "湖南工业大学"*/} + {/*challenge_names: ["打印输出 Hello World", "打印输出图形", "求3个数的最大值", "熟悉C语言调试过程"]*/} + {/*challenges_count: 4*/} + {/*content: {}*/} + {/*id: 1504*/} + {/*identifier: "tb7hw62n"*/} + {/*level: "初级"*/} + {/*study_count: 6002*/} + {/*subjects: [{id: 138, name: "C语言程序设计"}, {id: 180, name: "C语言程序设计(湖南师范大学)"}, {id: 211, name: "移动云启 —— C语言练习题库"}]*/} + {/*title: "C语言程序设计编辑与调试环境"*/} + {/*visits_count: 9419*/} + {shixun_list===undefined?"":shixun_list.length===0?"":shixun_list.map((item,key)=>{ + console.log(item.content) + return( +
+
+
+
+ + {item.title} + -
-
-
-
- - 移动云启 ——JAVA面向对象 - - -
-

- 已被广泛应用于移动及桌面应用程序、Web应用程序、分布式系统和嵌入式系统应用程序等各个领域的软件开发中。 -

- -

- 已被广泛应用于移动及桌面应用程序、Web应用程序、分布式系统和嵌入式系统应用程序等各个领域的软件开发中。 -

- -
-
-
+
+

+ {/*{item.content}*/} +

+ +

+ 已被广泛应用于移动及桌面应用程序、Web应用程序、分布式系统和嵌入式系统应用程序等各个领域的软件开发中。 +

+ +
+
+
-

- - - Home - Application Center - Application List - An Application - An Application - - - -

- - - 难度 - - + + + {item.author_name} + {item.author_school_name} + 难度系数:{item.level} + 学习人数:{item.study_count} + {item.author_name} + + + +

+ + + 难度 + + +
-
+ )}) + } -
+ + {shixun_list===undefined?"":shixun_list.length>15?
-
+
:""}
diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index 6fb55894a..aee4f35b4 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -946,6 +946,7 @@ class ShixunHomework extends Component{ From 737209285fb506f0ccc8d4b07e22a872b4061b26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 11 Sep 2019 16:52:59 +0800 Subject: [PATCH 05/79] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/NewShixunModel.js | 38 +++++++++++++++---- .../courses/coursesPublic/Newshixunmodel.css | 4 ++ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index 54918e634..f253a6e28 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -56,6 +56,18 @@ class NewShixunModel extends Component{ diff:type }) } + + ItsCourse=(item)=>{ + return + {item.map((list,key)=>{ + return( + + {list.name} + + ) + })} + + } render() { let {diff,datas,shixun_list,shixuns_count}=this.state; @@ -95,6 +107,8 @@ class NewShixunModel extends Component{ ); + + return(
@@ -210,16 +234,14 @@ class NewShixunModel extends Component{ {item.author_school_name} 难度系数:{item.level} 学习人数:{item.study_count} - {item.author_name} -

- + {item.subjects.length===0?"":this.ItsCourse(item.subjects)}> - 难度 + 所属课程 - + }
@@ -229,7 +251,7 @@ class NewShixunModel extends Component{ } - {shixun_list===undefined?"":shixun_list.length>15?
+ {shixun_list===undefined?"":shixuns_count>15?
Date: Wed, 11 Sep 2019 17:20:45 +0800 Subject: [PATCH 06/79] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/NewShixunModel.js | 29 ++++++++++++++++--- .../courses/coursesPublic/Newshixunmodel.css | 10 +++++++ 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index f253a6e28..d16581962 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -10,6 +10,7 @@ class NewShixunModel extends Component{ diff:0, shixun_list:undefined, shixuns_count:undefined, + Grouplist:[], } } componentDidMount() { @@ -68,13 +69,19 @@ class NewShixunModel extends Component{ })} } + + getGrouplist=(Grouplist)=>{ + this.setState({ + Grouplist: Grouplist, + }) + } render() { - let {diff,datas,shixun_list,shixuns_count}=this.state; + let {diff,Grouplist,shixun_list,shixuns_count}=this.state; // let {visible,patheditarry}=this.props; const menus = ( - + this.DropdownClick(0)}> 所有 @@ -184,6 +191,9 @@ class NewShixunModel extends Component{ {/*subjects: [{id: 138, name: "C语言程序设计"}, {id: 180, name: "C语言程序设计(湖南师范大学)"}, {id: 211, name: "移动云启 —— C语言练习题库"}]*/} {/*title: "C语言程序设计编辑与调试环境"*/} {/*visits_count: 9419*/} + + this.getGrouplist()} value={Grouplist}> + {shixun_list===undefined?"":shixun_list.length===0?"":shixun_list.map((item,key)=>{ console.log(item.content) return( @@ -191,13 +201,24 @@ class NewShixunModel extends Component{
- + + {item.title}

{/*{item.content}*/} + {item.challenge_names.map((item,key)=>{ + return( + {item} + ) + })}

@@ -249,7 +270,7 @@ class NewShixunModel extends Component{

)}) } - + {shixun_list===undefined?"":shixuns_count>15?
Date: Wed, 11 Sep 2019 18:55:46 +0800 Subject: [PATCH 07/79] =?UTF-8?q?=E6=96=B0=E7=89=88=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=AE=9E=E8=AE=ADbuild?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/NewShixunModel.js | 188 ++++++++++-------- .../courses/coursesPublic/Newshixunmodel.css | 3 +- .../courses/shixunHomework/shixunHomework.js | 45 +++-- public/react/src/search/searchc.css | 2 +- 4 files changed, 138 insertions(+), 100 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index d16581962..8737178ec 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -7,55 +7,50 @@ class NewShixunModel extends Component{ constructor(props){ super(props) this.state={ - diff:0, shixun_list:undefined, shixuns_count:undefined, Grouplist:[], + page:1, + type:'all', + status:'all', + search:undefined, + order:'desc', + diff:0, + limit:15, } } componentDidMount() { - console.log(this.props.type) - - if(this.props.type==='shixun'){ - let url="/shixuns/shixun_list.json" - axios.get(url).then((response) => { - - if(response.data){ - console.log(response.data); - if(response.data.status===0){ - } - } - - }) - }else{ - let url="/shixuns/shixun_list.json" - axios.get(url,{params:{ - type:'all', //这是带过来的值 - status:'all', - search:undefined, - diff:0, - order:'desc', - page:1, - limit:15, - }}).then((response) => { - - if(response.data){ - this.setState({ - shixun_list:response.data.shixun_list, - shixuns_count:response.data.shixuns_count, - }) - } - - }) + let{page,type,status,search,order,diff,limit}=this.state; + this.getdatalist(page,type,status,search,order,diff,limit) + } - } + getdatalist=(page,type,status,search,order,diff,limit)=>{ + let url="/shixuns/shixun_list.json" + axios.get(url,{params:{ + page, + type, + status, + search, + order, + diff, + limit + }}).then((response) => { + if(response.data){ + this.setState({ + shixun_list:response.data.shixun_list, + shixuns_count:response.data.shixuns_count, + }) + } + }) } - DropdownClick=(type)=>{ + DropdownClick=(diff)=>{ this.setState({ - diff:type + diff:diff }) + let{page,type,status,search,order,limit}=this.state; + this.getdatalist(page,type,status,search,order,diff,limit) } ItsCourse=(item)=>{ @@ -75,39 +70,86 @@ class NewShixunModel extends Component{ Grouplist: Grouplist, }) } + + PaginationCourse=(pageNumber)=>{ + this.setState({ + page:pageNumber + }) + let{type,status,search,order,diff,limit}=this.state; + this.getdatalist(pageNumber,type,status,search,order,diff,limit) + } + + belongto=(value)=>{ + this.setState({ + type:value + }) + let{page,status,search,order,diff,limit}=this.state; + this.getdatalist(page,value,status,search,order,diff,limit) + } + + updatedlist=(order)=>{ + + if(order==="desc"){ + this.setState({ + order:"asc" + }) + let{type,page,status,search,diff,limit}=this.state; + this.getdatalist(page,type,status,search,"asc",diff,limit) + }else{ + this.setState({ + order:"desc" + }) + let{type,page,status,search,diff,limit}=this.state; + this.getdatalist(page,type,status,search,"desc",diff,limit) + } + + } + + setdatafunsval=(e)=>{ + this.setState({ + search:e.target.value + }) + } + setdatafuns=(value)=>{ + this.setState({ + search:value + }) + let{type,page,status,diff,order,limit}=this.state; + this.getdatalist(page,type,status,value,order,diff,limit) + } render() { - let {diff,Grouplist,shixun_list,shixuns_count}=this.state; + let {diff,Grouplist,shixun_list,shixuns_count,page,type,order}=this.state; // let {visible,patheditarry}=this.props; const menus = ( - this.DropdownClick(0)}> + this.DropdownClick(0)}> 所有 - this.DropdownClick(1)} > + this.DropdownClick(1)} > 初级 - this.DropdownClick(2)}> + this.DropdownClick(2)}> 中级 - this.DropdownClick(3)}> + this.DropdownClick(3)}> 高级 - this.DropdownClick(4)}> + this.DropdownClick(4)}> 顶级 @@ -130,9 +172,8 @@ class NewShixunModel extends Component{
@@ -145,7 +186,7 @@ class NewShixunModel extends Component{ style={{ width: "800px"}} className="packinput" placeholder="实训信息 / 院校名称 / 创建者" - value={this.state.keywords} + value={this.state.search} enterButton={搜索} onInput={(e)=>this.setdatafunsval(e)} onSearch={ (value)=>this.setdatafuns(value)} /> @@ -155,14 +196,14 @@ class NewShixunModel extends Component{

- 已选 6 个实训 + 已选 {Grouplist.length} 个实训 {shixuns_count===undefined?"":shixuns_count} 个实训 - 学习人数 - this.updatedlist(sort_by)}> - - + this.updatedlist(order)}>学习人数 + + + @@ -174,28 +215,16 @@ class NewShixunModel extends Component{

- 我的实训 - 全部实训 + this.belongto("mine")}>我的实训 + this.belongto("all")}>全部实训

- {/*author_name: "刘强"*/} - {/*author_school_name: "湖南工业大学"*/} - {/*challenge_names: ["打印输出 Hello World", "打印输出图形", "求3个数的最大值", "熟悉C语言调试过程"]*/} - {/*challenges_count: 4*/} - {/*content: {}*/} - {/*id: 1504*/} - {/*identifier: "tb7hw62n"*/} - {/*level: "初级"*/} - {/*study_count: 6002*/} - {/*subjects: [{id: 138, name: "C语言程序设计"}, {id: 180, name: "C语言程序设计(湖南师范大学)"}, {id: 211, name: "移动云启 —— C语言练习题库"}]*/} - {/*title: "C语言程序设计编辑与调试环境"*/} - {/*visits_count: 9419*/} - - this.getGrouplist()} value={Grouplist}> + + {shixun_list===undefined?"":shixun_list.length===0?"":shixun_list.map((item,key)=>{ - console.log(item.content) + return(
@@ -204,7 +233,7 @@ class NewShixunModel extends Component{ @@ -212,22 +241,17 @@ class NewShixunModel extends Component{
-

- {/*{item.content}*/} - {item.challenge_names.map((item,key)=>{ - return( - {item} - ) - })} -

+ {JSON.stringify(item.content) == "{}"?"":

+ {/*{item.description}*/} +

} -

+ {item.challenge_names.length===0?"":

{item.challenge_names.map((item,key)=>{ return( {item} ) })} -

+

}
@@ -278,13 +302,13 @@ class NewShixunModel extends Component{ defaultCurrent={1} pageSize={15} total={shixuns_count===undefined?"":shixuns_count} - // current={page} - // onChange={this.PaginationCourse} + current={page} + onChange={this.PaginationCourse} />
:""}
- +
diff --git a/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css b/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css index cd3a07838..03e183999 100644 --- a/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css +++ b/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css @@ -10,7 +10,7 @@ height: 55px; width:663px !important; font-size: 14px; - color: #681616 !important; + /*color: #681616 !important;*/ border-color: #E1EDF8 !important; padding-left: 20px; } @@ -161,6 +161,7 @@ .newshixunlist{ max-height:227px; + width: 1200px; } .xuxianpro { diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index aee4f35b4..d29980e79 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -446,18 +446,18 @@ class ShixunHomework extends Component{ } - // 选用实训 - createCommonWork=()=>{ - - this.setState({ - hometypepvisible:true, - shixunmodal:true, - patheditarry:[], - checkBoxValues:[] - }) - - - } + // // 选用实训 + // createCommonWork=()=>{ + // + // this.setState({ + // hometypepvisible:true, + // shixunmodal:true, + // patheditarry:[], + // checkBoxValues:[] + // }) + // + // + // } // 选用实训路径 createCommonpath=()=>{ @@ -897,6 +897,18 @@ class ShixunHomework extends Component{ this.props.history.push(this.props.current_user.first_category_url); } } + showNewShixunModelType=()=>{ + this.setState({ + NewShixunModelType:true, + patheditarry:[], + checkBoxValues:[] + }) + } + hideNewShixunModelType=()=>{ + this.setState({ + NewShixunModelType:false + }) + } render(){ let { modalname, @@ -932,7 +944,7 @@ class ShixunHomework extends Component{ course_modules, shixunpath, order, - antIcon, + NewShixunModelType, }=this.state; let main_id=this.props.match.params.main_id; @@ -943,11 +955,12 @@ class ShixunHomework extends Component{
{/*新版实训model*/} - + hideNewShixunModelType={()=>this.hideNewShixunModelType()} + />:""} {/*提示*/} @@ -1061,7 +1074,7 @@ class ShixunHomework extends Component{ : this.editDir(datas&&datas.category_name)} className={"mr30 font-16"}>目录重命名:""} {this.props.isAdmin()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?选用实践课程:"":""} - {this.props.isAdmin()===true?this.createCommonWork()}>选用实训:""} + {this.props.isAdmin()===true?this.showNewShixunModelType()}>选用实训:""}

diff --git a/public/react/src/search/searchc.css b/public/react/src/search/searchc.css index 99f35738a..15c34650b 100644 --- a/public/react/src/search/searchc.css +++ b/public/react/src/search/searchc.css @@ -12,7 +12,7 @@ height: 55px; width:663px !important; font-size: 18px; - color: #681616 !important; + /*color: #681616 !important;*/ border-color: #E1EDF8 !important; } From e4385832d1896938cf794f23111fbe43363d191b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 11 Sep 2019 19:27:59 +0800 Subject: [PATCH 08/79] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/coursesPublic/NewShixunModel.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index 8737178ec..858e44d24 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -170,7 +170,7 @@ class NewShixunModel extends Component{ this.setdatafuns(value)} />
-
+

@@ -215,6 +215,7 @@ class NewShixunModel extends Component{

+ this.props.hideNewShixunModelType()}>返回 this.belongto("mine")}>我的实训 this.belongto("all")}>全部实训

From bf56efef228442d49a2421f188517de15af60671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 11 Sep 2019 19:56:54 +0800 Subject: [PATCH 09/79] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/NewShixunModel.js | 45 ++++++++++++++++++- .../courses/shixunHomework/shixunHomework.js | 6 +++ 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index 858e44d24..3c64cbab1 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -117,6 +117,49 @@ class NewShixunModel extends Component{ let{type,page,status,diff,order,limit}=this.state; this.getdatalist(page,type,status,value,order,diff,limit) } + + savecouseShixunModal=()=>{ + + this.setState({ + hometypepvisible:true + }) + let {coursesId}=this.props; + let{Grouplist}=this.state; + if(Grouplist.length===0){ + this.setState({ + hometypepvisible:false + }) + this.props.showNotification("请先选择实训") + return + } + + + let url="/courses/"+coursesId+"/homework_commons/create_shixun_homework.json"; + axios.post(url, { + category_id:this.props.category_id===null||this.props.category_id===undefined?undefined:parseInt(this.props.category_id), + shixun_ids:Grouplist, + } + ).then((response) => { + if(response.data.status===-1){ + // this.props.showNotification(response.data.message) + + }else{ + // this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids) + this.props.showNotification("选择成功") + this.props.homeworkupdatalists(this.props.Coursename,this.props.page,this.props.order); + this.props.hideNewShixunModelType() + + } + this.setState({ + hometypepvisible:false + }) + // category_id: 3 + // homework_ids: (5) [9171, 9172, 9173, 9174, 9175] + }).catch((error) => { + console.log(error) + }) + } + render() { let {diff,Grouplist,shixun_list,shixuns_count,page,type,order}=this.state; @@ -310,7 +353,7 @@ class NewShixunModel extends Component{
- +
diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index d29980e79..3bcaa3b12 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -958,8 +958,14 @@ class ShixunHomework extends Component{ {NewShixunModelType===true?this.hideNewShixunModelType()} + coursesId={this.props.match.params.coursesId} + homeworkupdatalists={(Coursename,page,order)=>this.homeworkupdatalist(Coursename,page,order)} + Coursename={Coursename} + page={page} + order={order} />:""} From d9badc2d958f7dea9ad39df7b0989d68a73ca57c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 12 Sep 2019 01:26:35 +0800 Subject: [PATCH 10/79] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=20=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=20=E8=AF=95=E5=8D=B7=20=20=E9=80=89=E7=94=A8=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?over?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/NewShixunModel.js | 167 ++++++- .../courses/coursesPublic/Newshixunmodel.css | 10 + .../coursesPublic/ShixunChooseModal.js | 240 +++++----- .../courses/shixunHomework/shixunHomework.js | 35 +- .../paths/PathDetail/DetailCardsEditAndAdd.js | 408 +++++++++-------- .../PathDetail/DetailCardsEditAndEdit.js | 417 +++++++++--------- 6 files changed, 728 insertions(+), 549 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index 3c64cbab1..393d714b3 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -1,6 +1,7 @@ import React,{Component} from 'react'; -import { Modal,Checkbox,Select,Input,Tooltip,Spin,Icon,Drawer,Dropdown,Menu,Breadcrumb,Pagination,Button} from "antd"; +import { Modal,Checkbox,Select,Input,Tooltip,Spin,Icon,Drawer,Dropdown,Menu,Breadcrumb,Pagination,Button,notification} from "antd"; import axios from'axios'; +import NoneData from "../coursesPublic/NoneData"; import './Newshixunmodel.css'; const Search = Input.Search; class NewShixunModel extends Component{ @@ -10,6 +11,7 @@ class NewShixunModel extends Component{ shixun_list:undefined, shixuns_count:undefined, Grouplist:[], + allGrouplist:[{page:1,list:[]}], page:1, type:'all', status:'all', @@ -20,11 +22,18 @@ class NewShixunModel extends Component{ } } componentDidMount() { - let{page,type,status,search,order,diff,limit}=this.state; + let{page,type,search,order,diff,limit}=this.state; + let status=this.props.statustype===undefined?'all':'published'; + this.setState({ + status:status + }) this.getdatalist(page,type,status,search,order,diff,limit) } getdatalist=(page,type,status,search,order,diff,limit)=>{ + this.setState({ + isspinning:true + }) let url="/shixuns/shixun_list.json" axios.get(url,{params:{ page, @@ -39,9 +48,13 @@ class NewShixunModel extends Component{ this.setState({ shixun_list:response.data.shixun_list, shixuns_count:response.data.shixuns_count, + isspinning:false }) } - + }).catch((error) => { + this.setState({ + isspinning:false + }) }) } @@ -66,17 +79,54 @@ class NewShixunModel extends Component{ } getGrouplist=(Grouplist)=>{ + let {page,allGrouplist}=this.state; + let newallGrouplist=allGrouplist; + var a=newallGrouplist.find((value,index,arr)=>{ + return value.page==page + }); + + if(a!=undefined){ + newallGrouplist.map((item,key)=>{ + if(item.page===page){ + item.list=Grouplist + } + }) + } + + + let newGrouplist=[]; + + newallGrouplist.map((item,key)=>{ + item.list.map((items,ke)=>{ + newGrouplist.push(items) + }) + }) + + this.setState({ - Grouplist: Grouplist, + Grouplist: newGrouplist, + allGrouplist:newallGrouplist }) } PaginationCourse=(pageNumber)=>{ - this.setState({ - page:pageNumber - }) + let {allGrouplist}=this.state; + let newallGrouplist=allGrouplist; + var v=newallGrouplist.find((value,index,arr)=>{ + return value.page==pageNumber + }); + + if(v===undefined){ + newallGrouplist.push({page:pageNumber,list:[]}) + } + let{type,status,search,order,diff,limit}=this.state; this.getdatalist(pageNumber,type,status,search,order,diff,limit) + this.setState({ + page:pageNumber, + allGrouplist:newallGrouplist + }) + } belongto=(value)=>{ @@ -117,7 +167,16 @@ class NewShixunModel extends Component{ let{type,page,status,diff,order,limit}=this.state; this.getdatalist(page,type,status,value,order,diff,limit) } - + showNotification = (description, message = "提示", icon) => { + const data = { + message, + description + } + if (icon) { + data.icon = icon; + } + notification.open(data); + } savecouseShixunModal=()=>{ this.setState({ @@ -129,11 +188,32 @@ class NewShixunModel extends Component{ this.setState({ hometypepvisible:false }) - this.props.showNotification("请先选择实训") + this.showNotification("请先选择实训") return } + if (this.props.chooseShixun) { + if(Grouplist.length>1){ + this.setState({ + hometypepvisible:false + }) + this.showNotification("试卷选择的实训数不能大于1") + return + } + this.props.chooseShixun(Grouplist) + this.setState({ + hometypepvisible:false + }) + return; + } + if (this.props.pathShixun) { + this.setState({ + hometypepvisible:false + }) + this.props.pathShixun(Grouplist) + return; + } let url="/courses/"+coursesId+"/homework_commons/create_shixun_homework.json"; axios.post(url, { category_id:this.props.category_id===null||this.props.category_id===undefined?undefined:parseInt(this.props.category_id), @@ -145,7 +225,7 @@ class NewShixunModel extends Component{ }else{ // this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids) - this.props.showNotification("选择成功") + this.showNotification("操作成功") this.props.homeworkupdatalists(this.props.Coursename,this.props.page,this.props.order); this.props.hideNewShixunModelType() @@ -157,14 +237,48 @@ class NewShixunModel extends Component{ // homework_ids: (5) [9171, 9172, 9173, 9174, 9175] }).catch((error) => { console.log(error) + this.setState({ + hometypepvisible:false + }) + }) + } + + poststatus=(status)=>{ + this.setState({ + status:status }) + let{page,type,search,order,diff,limit}=this.state; + this.getdatalist(page,type,status,search,order,diff,limit) } render() { - let {diff,Grouplist,shixun_list,shixuns_count,page,type,order}=this.state; + let {diff,Grouplist,status,shixun_list,shixuns_count,page,type,order}=this.state; // let {visible,patheditarry}=this.props; + // console.log(Grouplist) + // console.log(allGrouplist) + const statusmenus=( + + + this.poststatus("all")}> + 所有 + + + + + this.poststatus("published")} > + 已发布 + + + + + this.poststatus("unpublished")}> + 未发布 + + + + ); const menus = ( @@ -202,6 +316,7 @@ class NewShixunModel extends Component{ return( +
:""} + {selectShixun===true?:""} - - -
- -
- - - {ChooseShixunList && ChooseShixunList.shixuns_count} - 个实训 - -
- this.changeTag(`${type}`,`${search}`)} - style={{width: '115%'}} - > -
-
-
    -
  • 实训名称
  • -
  • 使用院校
  • -
  • 使用人数
  • -
  • 评价等级
  • -
  • -
- - - {ChooseShixunListshixun_list && ChooseShixunListshixun_list.length===0?"":
- - { - ChooseShixunListshixun_list && ChooseShixunListshixun_list.map((item,key)=>{ - return( -
-
  • - - - -
  • -
  • {item.school_users}
  • -
  • {item.myshixuns_count}
  • -
  • {item.preference}
  • -
  • 详情
  • -
    - ) - }) - } -
    -
    } -
    - 取消 - 确定 -
    -
    -
    -
    {/* 可拖拽选择实训列表*/} @@ -650,4 +495,185 @@ class DetailCardsEditAndAdd extends Component{ ) } } -export default DetailCardsEditAndAdd; \ No newline at end of file +export default DetailCardsEditAndAdd; + + + + +// +// +// +//
    +// +//
    +// +// +// {ChooseShixunList && ChooseShixunList.shixuns_count} +// 个实训 +// +//
    +// this.changeTag(`${type}`,`${search}`)} +// style={{width: '115%'}} +// > +//
    +//
    +//
      +//
    • 实训名称
    • +//
    • 使用院校
    • +//
    • 使用人数
    • +//
    • 评价等级
    • +//
    • +//
    +// +// +// {ChooseShixunListshixun_list && ChooseShixunListshixun_list.length===0?"":
    +// +// { +// ChooseShixunListshixun_list && ChooseShixunListshixun_list.map((item,key)=>{ +// return( +//
    +//
  • +// +// +// +//
  • +//
  • {item.school_users}
  • +//
  • {item.myshixuns_count}
  • +//
  • {item.preference}
  • +//
  • 详情
  • +//
    +// ) +// }) +// } +//
    +//
    } +//
    +// 取消 +// 确定 +//
    +//
    +//
    +//
    +// contentViewScrolladd=(e)=>{ +// const {ChooseShixunList}=this.state; +// //滑动到底判断 +// let newscrollTop=parseInt(e.currentTarget.scrollTop); +// let allclientHeight=e.currentTarget.clientHeight+newscrollTop; +// +// if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1||e.currentTarget.scrollHeight-allclientHeight===-1){ +// +// if(ChooseShixunList.shixun_list.length===0){ +// return +// }else{ +// // console.log("到达底部"); +// this.setState({ +// hometypepvisible:true +// }) +// let pathId=this.props.pathid; +// let {search,page,type,ChooseShixunListshixun_list}=this.state; +// let newpage=page+1; +// let newChooseShixunListshixun_list=ChooseShixunListshixun_list; +// let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage +// if(search!="" && search!=undefined){ +// url+="&search="+search; +// } +// if(type!=0){ +// url+="&type="+type; +// } +// axios.get(encodeURI(url)).then((result)=>{ +// if(result.status===200){ +// let list =result.data.shixun_list; +// +// for(var i=0; i{ +// console.log(error); +// }) +// +// } +// +// } +// +// } +// +// //打开选择实训弹框初始化tag标签和列表 +// changeTag=(id,search)=>{ +// +// this.setState({ +// ChooseShixunListshixun_list:[], +// page:1, +// hometypepvisible:true, +// }) +// +// let pathId=this.props.pathid; +// +// let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+1 +// if(search!="" && search!=undefined){ +// url+="&search="+search; +// } +// if(id!=0){ +// url+="&type="+id; +// } +// +// axios.get(encodeURI(url)).then((result)=>{ +// if(result.status===200){ +// this.setState({ +// ChooseShixunList:result.data, +// hometypepvisible:false, +// type:id, +// ChooseShixunListshixun_list:result.data.shixun_list +// }) +// } +// }).catch((error)=>{ +// console.log(error); +// }) +// } \ No newline at end of file diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js index e52ad0ad6..3d1559797 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js @@ -1,8 +1,9 @@ import React, { Component } from 'react'; import {getImageUrl} from 'educoder'; -import {Modal,Input,Checkbox,Tooltip,Spin} from "antd"; +import {Modal,Input,Checkbox,Tooltip,Spin,notification} from "antd"; import { DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd'; import Modals from '../../modals/Modals'; +import NewShixunModel from '../../courses/coursesPublic/NewShixunModel'; import '../ShixunPaths.css'; import axios from 'axios'; const $ = window.$; @@ -63,7 +64,7 @@ class DetailCardsEditAndEdit extends Component{ selectShixun:true, patheditarry:[] }) - this.changeTag(0,""); + // this.changeTag(0,""); } //关闭选择实训弹框 cloasShixunBox =()=>{ @@ -79,36 +80,7 @@ class DetailCardsEditAndEdit extends Component{ }) } - //打开选择实训弹框初始化tag标签和列表 - changeTag(id,search){ - this.setState({ - ChooseShixunListshixun_list:[], - page:1, - hometypepvisible:true - }) - let pathId=this.props.pathid; - let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+1 - if(search!="" && search!=undefined){ - url+="&search="+search; - } - if(id!=0){ - url+="&type="+id; - } - axios.get(encodeURI(url)).then((result)=>{ - if(result.status===200){ - this.setState({ - ChooseShixunList:result.data, - hometypepvisible:false, - type:id, - search:search, - ChooseShixunListshixun_list:result.data.shixun_list - }) - } - }).catch((error)=>{ - console.log(error); - }) - } shixunhomeworkedit=(list)=>{ @@ -158,22 +130,12 @@ class DetailCardsEditAndEdit extends Component{ } - clickShixunchoose=()=>{ + clickShixunchoose=(patheditarry)=>{ - let{patheditarry,shixuns_listedit,shixuns_listeditlist}=this.state + let{shixuns_listedit,shixuns_listeditlist}=this.state let newshixuns_listedit=shixuns_listedit; let list=shixuns_listeditlist - if(patheditarry.length===0){ - this.setState({ - Modalstype:true, - Modalstopval:'请选择实训', - - }) - - return - } - let url='/paths/append_to_stage.json' axios.post(url,{ shixun_id:patheditarry @@ -184,10 +146,11 @@ class DetailCardsEditAndEdit extends Component{ for(var j=0; j{ - //滑动到底判断 - const {ChooseShixunList}=this.state; - let newscrollTop=parseInt(e.currentTarget.scrollTop); - let allclientHeight=e.currentTarget.clientHeight+newscrollTop; - - if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1||e.currentTarget.scrollHeight-allclientHeight===-1){ - - if(ChooseShixunList.shixun_list.length===0){ - return - }else{ - this.setState({ - hometypepvisible:true - }) - // console.log("到达底部"); - - let {page,type,search,ChooseShixunListshixun_list}=this.state; - - let newpage=page+1; - - let pathId=this.props.pathid; - - let newChooseShixunListshixun_list=ChooseShixunListshixun_list; - - let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage - - if(search!="" && search!=undefined){ - url+="&search="+search; - } - - if(type!=0){ - url+="&type="+type; - } - axios.get(encodeURI(url)).then((result)=>{ - if(result.status===200){ - - let list =result.data.shixun_list; - - for(var i=0; i{ - console.log(error); - }) - - - } - - - - } - - } - + showNotification = (description, message = "提示", icon) => { + const data = { + message, + description + } + if (icon) { + data.icon = icon; + } + notification.open(data); + } render(){ let {selectShixun, @@ -483,99 +393,13 @@ class DetailCardsEditAndEdit extends Component{ } :""} + {selectShixun===true?:""} - - -
    - -
    - - - {ChooseShixunList && ChooseShixunList.shixuns_count} - 个实训 - -
    - this.changeTag(`${type}`,`${search}`)} - style={{width: '115%'}} - > -
    -
    -
      -
    • 实训名称
    • -
    • 使用院校
    • -
    • 使用人数
    • -
    • 评价等级
    • -
    • -
    - - - {ChooseShixunListshixun_list && ChooseShixunListshixun_list.length===0?"":
    - - { - ChooseShixunListshixun_list && ChooseShixunListshixun_list.map((item,key)=>{ - return( -
    -
  • - - - -
  • -
  • {item.school_users}
  • -
  • {item.myshixuns_count}
  • -
  • {item.preference}
  • -
  • 详情
  • -
    - ) - }) - } -
    -
    } -
    - 取消 - 确定 -
    -
    -
    -
    {/* 可拖拽选择实训列表*/} @@ -716,4 +540,191 @@ export default DetailCardsEditAndEdit; //
    // ) // }) -// } \ No newline at end of file +// } + +// +// +//
    +// +//
    +// +// +// {ChooseShixunList && ChooseShixunList.shixuns_count} +// 个实训 +// +//
    +// this.changeTag(`${type}`,`${search}`)} +// style={{width: '115%'}} +// > +//
    +//
    +//
      +//
    • 实训名称
    • +//
    • 使用院校
    • +//
    • 使用人数
    • +//
    • 评价等级
    • +//
    • +//
    +// +// +// {ChooseShixunListshixun_list && ChooseShixunListshixun_list.length===0?"":
    +// +// { +// ChooseShixunListshixun_list && ChooseShixunListshixun_list.map((item,key)=>{ +// return( +//
    +//
  • +// +// +// +//
  • +//
  • {item.school_users}
  • +//
  • {item.myshixuns_count}
  • +//
  • {item.preference}
  • +//
  • 详情
  • +//
    +// ) +// }) +// } +//
    +//
    } +//
    +// 取消 +// 确定 +//
    +//
    +//
    +//
    + +// //打开选择实训弹框初始化tag标签和列表 +// changeTag(id,search){ +// +// this.setState({ +// ChooseShixunListshixun_list:[], +// page:1, +// hometypepvisible:true +// }) +// let pathId=this.props.pathid; +// let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+1 +// if(search!="" && search!=undefined){ +// url+="&search="+search; +// } +// if(id!=0){ +// url+="&type="+id; +// } +// axios.get(encodeURI(url)).then((result)=>{ +// if(result.status===200){ +// this.setState({ +// ChooseShixunList:result.data, +// hometypepvisible:false, +// type:id, +// search:search, +// ChooseShixunListshixun_list:result.data.shixun_list +// }) +// } +// }).catch((error)=>{ +// console.log(error); +// }) +// } + +// contentViewScrolledit=(e)=>{ +// //滑动到底判断 +// const {ChooseShixunList}=this.state; +// let newscrollTop=parseInt(e.currentTarget.scrollTop); +// let allclientHeight=e.currentTarget.clientHeight+newscrollTop; +// +// if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1||e.currentTarget.scrollHeight-allclientHeight===-1){ +// +// if(ChooseShixunList.shixun_list.length===0){ +// return +// }else{ +// this.setState({ +// hometypepvisible:true +// }) +// // console.log("到达底部"); +// +// let {page,type,search,ChooseShixunListshixun_list}=this.state; +// +// let newpage=page+1; +// +// let pathId=this.props.pathid; +// +// let newChooseShixunListshixun_list=ChooseShixunListshixun_list; +// +// let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage +// +// if(search!="" && search!=undefined){ +// url+="&search="+search; +// } +// +// if(type!=0){ +// url+="&type="+type; +// } +// axios.get(encodeURI(url)).then((result)=>{ +// if(result.status===200){ +// +// let list =result.data.shixun_list; +// +// for(var i=0; i{ +// console.log(error); +// }) +// +// +// } +// +// +// +// } +// +// } \ No newline at end of file From 19e7e349112e996209695cca8129992f224fba5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 12 Sep 2019 01:33:34 +0800 Subject: [PATCH 11/79] =?UTF-8?q?=E5=85=B3=E5=8D=A1=E6=95=B0=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/paths/PathDetail/PathDetailIndex.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index 86c3f68a9..c8cece9fd 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -362,6 +362,9 @@ class PathDetailIndex extends Component{ .head-right{ line-height: 30px; } + .padding40-20-30{ + padding:40px 20px 30px; + } ` } @@ -457,7 +460,7 @@ class PathDetailIndex extends Component{ } { this.props.checkIfLogin()===false?"":progress === undefined ? "" : progress === null ? "" : -
    +

    关卡数 @@ -468,7 +471,8 @@ class PathDetailIndex extends Component{ 已学 {progress.learned}% 学习耗时{this.timeStamp(progress.time)}

    -
    +
    + 注: “我的进展”以已发布的实训详情关卡数为准。
    } From 9b5a9485e0853446988c7b584b1711cdd50d2d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 12 Sep 2019 09:09:52 +0800 Subject: [PATCH 12/79] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/coursesPublic/NewShixunModel.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index 393d714b3..9c0ddd36f 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -48,6 +48,7 @@ class NewShixunModel extends Component{ this.setState({ shixun_list:response.data.shixun_list, shixuns_count:response.data.shixuns_count, + Grouplist:[], isspinning:false }) } @@ -414,7 +415,7 @@ class NewShixunModel extends Component{ {item.challenge_names.length===0?"":

    {item.challenge_names.map((item,key)=>{ return( - {item} + 第{key+1}关:{item} ) })}

    } From 70ad1b51edb4599731e8c86a67887ec6aa344d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 12 Sep 2019 09:11:53 +0800 Subject: [PATCH 13/79] b --- .../react/src/modules/courses/coursesPublic/NewShixunModel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index 9c0ddd36f..021b21127 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -30,7 +30,7 @@ class NewShixunModel extends Component{ this.getdatalist(page,type,status,search,order,diff,limit) } - getdatalist=(page,type,status,search,order,diff,limit)=>{ + getdatalist=(page,type,status,search,order,diff,limit,pagetype)=>{ this.setState({ isspinning:true }) @@ -122,7 +122,7 @@ class NewShixunModel extends Component{ } let{type,status,search,order,diff,limit}=this.state; - this.getdatalist(pageNumber,type,status,search,order,diff,limit) + this.getdatalist(pageNumber,type,status,search,order,diff,limit,"pagetype") this.setState({ page:pageNumber, allGrouplist:newallGrouplist From 85e5ea80d2b26e43ce74ba214252898a0f854ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 12 Sep 2019 09:13:52 +0800 Subject: [PATCH 14/79] b --- .../courses/coursesPublic/NewShixunModel.js | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index 021b21127..0e36d3dc6 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -45,12 +45,21 @@ class NewShixunModel extends Component{ limit }}).then((response) => { if(response.data){ - this.setState({ - shixun_list:response.data.shixun_list, - shixuns_count:response.data.shixuns_count, - Grouplist:[], - isspinning:false - }) + if(pagetype===undefined){ + this.setState({ + shixun_list:response.data.shixun_list, + shixuns_count:response.data.shixuns_count, + Grouplist:[], + isspinning:false + }) + }else{ + this.setState({ + shixun_list:response.data.shixun_list, + shixuns_count:response.data.shixuns_count, + isspinning:false + }) + } + } }).catch((error) => { this.setState({ From 5efc5d7faf2d94aece43bae9ebfaec23b139ca0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 12 Sep 2019 09:48:26 +0800 Subject: [PATCH 15/79] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/coursesPublic/NewShixunModel.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index 0e36d3dc6..d0ba33cb3 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -490,10 +490,11 @@ class NewShixunModel extends Component{ :shixun_list.length===0? :"" } -
    + { + shixun_list===undefined?"":shixun_list.length===0?"":
    -
    +
    }
    From 2366b4d590c3df2cea90d8c702e503b54eb60595 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 12 Sep 2019 10:09:36 +0800 Subject: [PATCH 16/79] =?UTF-8?q?=E5=A4=9A=E9=80=89=E9=A2=98=E7=9A=84?= =?UTF-8?q?=E8=B0=83=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercise_questions_controller.rb | 39 ++++++++++++++++-- dump.rdb | Bin 2487 -> 2487 bytes 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/app/controllers/exercise_questions_controller.rb b/app/controllers/exercise_questions_controller.rb index 57116a9e5..27e3fa2f4 100644 --- a/app/controllers/exercise_questions_controller.rb +++ b/app/controllers/exercise_questions_controller.rb @@ -497,7 +497,38 @@ class ExerciseQuestionsController < ApplicationController ex_obj_score = @exercise_current_user.objective_score #全部客观题得分 ex_subj_score = @exercise_current_user.subjective_score < 0.0 ? 0.0 : @exercise_current_user.subjective_score #全部主观题得分 ex_answers = @exercise_question.exercise_answers.search_answer_users("user_id",@user_id) #当前用户答案的得分 - if @exercise_question.question_type == Exercise::COMPLETION #当为填空题,更新问题的总分, + if @exercise_question.question_type == Exercise::MULTIPLE + if ex_answers.present? #学生有回答时 取学生的答题得分,否则0分 + answer_choice_array = [] + ex_answers.each do |a| + answer_choice_array.push(a.exercise_choice.choice_position) #学生答案的位置 + end + user_answer_content = answer_choice_array.sort + standard_answer = @exercise_question.exercise_standard_answers.pluck(:exercise_choice_id).sort + if standard_answer.size == 1 # 老数据需要判断学生答题是否正确, 正确取原题得分,否则是0分 + standard_answer = standard_answer.first.to_s.split("").map(&:to_i).sort + if user_answer_content == standard_answer + ex_answer_old = @exercise_question.question_score + else + ex_answer_old = 0 + end + else # 新多选题只需取第一条答题记录的得分 + ex_answer_old = ex_answers.first.score > 0 ? ex_answers.first.score : 0 + end + else + ex_answer_old = 0 + end + + new_obj_score = ex_obj_score - ex_answer_old + @c_score + total_scores = new_obj_score + ex_subj_score + ex_scores = { + :objective_score => new_obj_score, + :score => total_scores + } + @exercise_current_user.update_attributes(ex_scores) + ex_answers.update_all(:score => @c_score) #所有的正确选项需重新更新 + + elsif @exercise_question.question_type == Exercise::COMPLETION #当为填空题,更新问题的总分, ex_answer_old = ex_answers.score_reviewed.pluck(:score).sum #每一关的得分总和 each_right_score = (@c_score / ex_answers.count.to_f) #调分后,平均每关的分数 new_obj_score = ex_obj_score - ex_answer_old + @c_score @@ -579,7 +610,7 @@ class ExerciseQuestionsController < ApplicationController end rescue Exception => e uid_logger_error(e.message) - tip_exception("没有权限") + tip_exception(e.message) raise ActiveRecord::Rollback end end @@ -703,8 +734,8 @@ class ExerciseQuestionsController < ApplicationController normal_status(-1,"用户不存在!") elsif @c_score.blank? normal_status(-1,"分数不能为空!") - elsif @exercise_question.question_type <= Exercise::JUDGMENT - normal_status(-1,"选择题/判断题不能调分!") + elsif @exercise_question.question_type == Exercise::SINGLE || @exercise_question.question_type == Exercise::JUDGMENT + normal_status(-1,"单选题/判断题不能调分!") elsif params[:comment].present? && params[:comment].length > 100 normal_status(-1,"评语不能超过100个字符!") else diff --git a/dump.rdb b/dump.rdb index bcf064366d9465f66c11de3ea1199b9ada47f4bd..9f62f75c757e26158b26bb280d1712217a6aab58 100644 GIT binary patch delta 37 tcmdlkyj^&Lf#8~l6|uiKN{drdbaPX44}CD*=$OaJ5s~pdA?Vt*uK+ZL5lH|5 delta 37 tcmdlkyj^&Lfnbw(e(W!f(&E$<-Q3jNLl>$yI_7b5tlX>ZyL{oCtpFKi58nU) From b7aa0e34c33424df8917663fb4e23c324d6d8bbd Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 12 Sep 2019 10:16:46 +0800 Subject: [PATCH 17/79] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=BC=80=E6=94=BE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/tpm/TPMsettings/TPMsettings.js | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index f78d62637..b2767887d 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -220,6 +220,7 @@ export default class TPMsettings extends Component { can_copy: undefined, task_pass: undefined, test_set_permission: undefined, + code_edit_permission: undefined, hide_code: undefined, code_hidden: undefined, forbid_copy: undefined, @@ -352,6 +353,7 @@ export default class TPMsettings extends Component { task_pass: response.data.shixun.task_pass, test_set_permission: response.data.shixun.test_set_permission, hide_code: response.data.shixun.hide_code, + code_edit_permission: response.data.shixun.code_edit_permission, code_hidden: response.data.shixun.code_hidden, is_secret_repository: response.data.shixun.is_secret_repository, init_is_secret_repository: response.data.shixun.is_secret_repository, @@ -546,7 +548,11 @@ export default class TPMsettings extends Component { }); } - + code_edit_permission = (e) => { + this.setState({ + code_edit_permission: e.target.checked + }) + } code_hidden=(e)=>{ let sum = "" if (e.target.checked === false) { @@ -869,7 +875,7 @@ export default class TPMsettings extends Component { let { name, choice_main_type, choice_small_type, choice_standard_scripts, scope_partment, choice_standard_scriptssum, vnc_evaluate, 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, is_secret_repository + opening_time,shixunmemoMDvalue,shixun_service_configlist, is_secret_repository, code_edit_permission } = this.state; let newshixun_service_configlist = shixun_service_configlist.map(v => { @@ -982,6 +988,7 @@ export default class TPMsettings extends Component { vnc_evaluate: vnc_evaluate===null?undefined:vnc_evaluate, test_set_permission: test_set_permission, code_hidden: code_hidden, + code_edit_permission: code_edit_permission, trainee: trainee, task_pass: task_pass, hide_code: hide_code, @@ -1563,6 +1570,7 @@ export default class TPMsettings extends Component { test_set_permission, hide_code, forbid_copy, + code_edit_permission, code_hidden, vnc, vnc_evaluate, @@ -2274,6 +2282,15 @@ export default class TPMsettings extends Component {
    + {!code_hidden && !hide_code &&
    + 代码开放修改: + + + + +
    } +
    隐藏代码窗口: From c1c3db88a854b9c67c320b2341470171f88a8863 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 12 Sep 2019 10:22:46 +0800 Subject: [PATCH 18/79] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=80=89=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/shixun_list.json.jbuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shixuns/shixun_list.json.jbuilder b/app/views/shixuns/shixun_list.json.jbuilder index 54ac65a0a..2f1d4905c 100644 --- a/app/views/shixuns/shixun_list.json.jbuilder +++ b/app/views/shixuns/shixun_list.json.jbuilder @@ -10,7 +10,7 @@ json.shixun_list do # json.description highlights.values[0,5].each { |arr| arr.is_a?(Array) ? arr.join('...') : arr }.join('
    ') json.content highlights json.level level_to_s(obj.trainee) - json.subjects obj.subjects do |subject| + json.subjects obj.subjects.uniq do |subject| json.(subject, :id, :name) end end From dd939433b0998f476ab9da20b31953c47f850c21 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 12 Sep 2019 10:49:22 +0800 Subject: [PATCH 19/79] protocol --- public/react/src/App.js | 14 ++++++++++++++ public/react/src/common/util/ShareUtil.js | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/public/react/src/App.js b/public/react/src/App.js index 1a4aedc05..17ee34255 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -326,6 +326,20 @@ class App extends Component { }); wx.ready(function () { console.log('wx is ready') + // var shareData = { + // title: 'EduCoder - 首页', + // desc: 'Educoder是一个面向计算机类的互联网IT教育和实战平台,提供企业级工程实训,以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动,将传统的知识传授和时兴的工程实战一体化。', + // link: currentUrl, + // imgUrl: window.__testImageUrl + // || (currentUrl.endsWith('/') ? currentUrl : currentUrl + '/') + 'react/build/images/share_logo_icon.jpg' + // }; + + // wx.onMenuShareAppMessage(shareData);//分享给好友 + // wx.onMenuShareTimeline(shareData);//分享到朋友圈 + // wx.onMenuShareQQ(shareData);//分享给手机QQ + // wx.onMenuShareWeibo(shareData);//分享腾讯微博 + // wx.onMenuShareQZone(shareData);//分享到QQ空间 + configShareForIndex('/') }); wx.error(function (res) { diff --git a/public/react/src/common/util/ShareUtil.js b/public/react/src/common/util/ShareUtil.js index 24fffbf15..c4ec8a62a 100644 --- a/public/react/src/common/util/ShareUtil.js +++ b/public/react/src/common/util/ShareUtil.js @@ -1,4 +1,4 @@ -const host = window.location.host +const host = window.location.protocol + '//' + window.location.host const wx = window.wx function share(shareData) { try { From 56e70b577d99f9b9fca5f5ec0ed7b01b000b631e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 12 Sep 2019 11:09:00 +0800 Subject: [PATCH 20/79] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/NewShixunModel.js | 33 ++++++++++--------- .../courses/coursesPublic/Newshixunmodel.css | 12 +++++-- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index d0ba33cb3..6177d6e72 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -52,7 +52,7 @@ class NewShixunModel extends Component{ Grouplist:[], isspinning:false }) - }else{ + }else if(pagetype==="pagetype"){ this.setState({ shixun_list:response.data.shixun_list, shixuns_count:response.data.shixuns_count, @@ -77,15 +77,15 @@ class NewShixunModel extends Component{ } ItsCourse=(item)=>{ - return - {item.map((list,key)=>{ - return( - - {list.name} - - ) - })} - + return + {item.map((list,key)=>{ + return( + + {list.name} + + ) + })} + } getGrouplist=(Grouplist)=>{ @@ -170,13 +170,16 @@ class NewShixunModel extends Component{ search:e.target.value }) } + setdatafuns=(value)=>{ this.setState({ - search:value + search:value, + type:undefined, }) - let{type,page,status,diff,order,limit}=this.state; - this.getdatalist(page,type,status,value,order,diff,limit) + let{page,status,diff,order,limit}=this.state; + this.getdatalist(page,undefined,status,value,order,diff,limit) } + showNotification = (description, message = "提示", icon) => { const data = { message, @@ -412,7 +415,7 @@ class NewShixunModel extends Component{ className="fl task-hide edu-txt-left mt3" name="shixun_homework[]" > - + {item.title} @@ -472,7 +475,7 @@ class NewShixunModel extends Component{ } - {shixun_list===undefined?"":shixuns_count>15?
    + {shixun_list===undefined||shixuns_count===undefined?"":shixun_list.length===0||shixuns_count===0?"":shixuns_count>15?
    Date: Thu, 12 Sep 2019 11:23:46 +0800 Subject: [PATCH 21/79] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/NewShixunModel.js | 18 +++++++++--------- .../courses/coursesPublic/Newshixunmodel.css | 4 ++++ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index 6177d6e72..b40e3649e 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -393,9 +393,9 @@ class NewShixunModel extends Component{
    - this.props.hideNewShixunModelType()}>返回 - this.belongto("mine")}>我的实训 - this.belongto("all")}>全部实训 + this.props.hideNewShixunModelType()}>返回 + this.belongto("mine")}>我的实训 + this.belongto("all")}>全部实训
    @@ -420,23 +420,23 @@ class NewShixunModel extends Component{
    - {JSON.stringify(item.content) == "{}"?"":

    + {JSON.stringify(item.content) == "{}"?"":

    {/*{item.description}*/} -

    } +
    } - {item.challenge_names.length===0?"":

    + {item.challenge_names.length===0?"":

    {item.challenge_names.map((item,key)=>{ return( 第{key+1}关:{item} ) })} -

    } +
    }
    -

    +

    + {JSON.stringify(item.description) == "{}"?"":
    } {item.challenge_names.length===0?"":
    diff --git a/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css b/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css index 457ed082d..2e8abce53 100644 --- a/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css +++ b/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css @@ -149,16 +149,12 @@ color: #999999; margin-top: 15px; margin-left: 30px; + max-width: 1100px; overflow: hidden; - -o-text-overflow: ellipsis; text-overflow: ellipsis; - max-width: 1100px; - display: -webkit-box !important; - overflow: hidden !important; - text-overflow: ellipsis !important; - display: -webkit-box !important; - -webkit-line-clamp: 2 !important; - -webkit-box-orient: vertical !important; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; } .newshixunmodelbotfont{ From d26526be12b1aeca2a05135cdb800d27ee3dc907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 12 Sep 2019 15:24:27 +0800 Subject: [PATCH 40/79] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/coursesPublic/NewShixunModel.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index 66180b01d..395e4096d 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -436,6 +436,7 @@ class NewShixunModel extends Component{ display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; + max-height: 42px; } ` } From d51585f2c6cfd1dbc4eb2b29d11a3c09a29b24ad Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Thu, 12 Sep 2019 15:43:48 +0800 Subject: [PATCH 41/79] =?UTF-8?q?=E8=B0=83=E5=88=86=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E5=90=8E=E6=9B=B4=E6=94=B9=E6=80=BB=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/exercise/ExerciseReviewAndAnswer.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js index b5a1a7c26..97b6a5174 100644 --- a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js +++ b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js @@ -332,7 +332,7 @@ class ExerciseReviewAndAnswer extends Component{ ) } //确认调分 - setAction=(key,q_id,maxScore)=>{ + setAction=(key,q_id,maxScore,oldScore)=>{ let {ajustSore}=this.state; let list = ajustSore.filter(obj => obj.id == q_id); let index = ajustSore.map(function (item) { return item.id; }).indexOf(q_id); @@ -396,6 +396,11 @@ class ExerciseReviewAndAnswer extends Component{ ajustSore : update(prevState.ajustSore, {[index]: { desc: {$set: undefined},inputSore:{ $set:undefined }}}) }) ) + let {exerciseTotalScore} = this.state; + let newScore = parseFloat(parseFloat(exerciseTotalScore)+parseFloat(score)-parseFloat(oldScore)).toFixed(1); + this.setState({ + exerciseTotalScore:newScore + }) this.showSetScore(key,true); } }).catch((error)=>{ @@ -781,7 +786,6 @@ class ExerciseReviewAndAnswer extends Component{
    { exercise_questions && exercise_questions.map((item,key)=>{ - debugger; let list = ajustSore && ajustSore.filter(obj => obj.id === item.question_id); return(
    @@ -933,7 +937,7 @@ class ExerciseReviewAndAnswer extends Component{ { parseInt(item.answer_status) == 0 && item.question_type == 4 ? 未评分 : '' } - this.setAction(key,item.question_id,item.question_score)}>确认 + this.setAction(key,item.question_id,item.question_score,item.user_score)}>确认

    { list && list.length > 0 && list[0].setTip !="" ?

    { list[0].setTip }

    :"" From c5d966cc2782e0571d3355567f9999de192cd32e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 12 Sep 2019 15:49:57 +0800 Subject: [PATCH 42/79] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/NewShixunModel.js | 37 +++++++++++++++---- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index 395e4096d..a8dad2eb4 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -22,18 +22,15 @@ class NewShixunModel extends Component{ } } componentDidMount() { - let{page,type,keyword,order,diff,limit}=this.state; - let status=this.props.statustype===undefined?'all':'published'; - this.setState({ - status:status - }) + let{page,type,keyword,order,diff,limit,status}=this.state; this.getdatalist(page,type,status,keyword,order,diff,limit) } - getdatalist=(page,type,status,keyword,order,diff,limit,pagetype)=>{ + getdatalist=(page,type,newstatus,keyword,order,diff,limit,pagetype)=>{ this.setState({ isspinning:true }) + let status=this.props.statustype===undefined?newstatus:'published'; let url="/shixun_lists.json" axios.get(url,{params:{ page, @@ -441,7 +438,7 @@ class NewShixunModel extends Component{ ` } - {JSON.stringify(item.description) == "{}"?"":
    + {JSON.stringify(item.description) == "{}"?"":
    } {item.challenge_names.length===0?"":
    @@ -530,4 +527,28 @@ class NewShixunModel extends Component{ } } -export default NewShixunModel; \ No newline at end of file +export default NewShixunModel; + + +// {JSON.stringify(item.content) == "{}"?
    +//
    :
    +// {item.content.description === undefined || item.content.description===0?"":item.content.description.map((item,key)=>{ +// return( +// {} +// ) +// })} +//
    } +// +// {JSON.stringify(item.content) == "{}"?item.challenge_names.length===0?"":
    +// {item.challenge_names.map((item,key)=>{ +// return( +// 第{key+1}关:{item} +// ) +// })} +//
    :
    +// {item.content.challenge_names === undefined || item.content.challenge_names===0?"":item.content.challenge_names.map((item,key)=>{ +// return( +// {} +// ) +// })} +//
    } \ No newline at end of file From 03c8df24275b8aae37112a3ce348bfe6d1cd36b8 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 12 Sep 2019 15:50:06 +0800 Subject: [PATCH 43/79] log --- public/react/src/common/util/ShareUtil.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public/react/src/common/util/ShareUtil.js b/public/react/src/common/util/ShareUtil.js index c4ec8a62a..9a83db552 100644 --- a/public/react/src/common/util/ShareUtil.js +++ b/public/react/src/common/util/ShareUtil.js @@ -32,6 +32,7 @@ export function configShareForIndex (path) { } export function configShareForPaths () { if (!wx) return; + console.log('configShareForPaths', host) var shareData = { title: 'EduCoder - 实践课程', desc: '平台提供涵盖基础入门、案例实践和创新应用的完整实训项目体系,通过由浅入深的实训路径,帮助学生快速提升实战能力。', @@ -43,6 +44,8 @@ export function configShareForPaths () { } export function configShareForShixuns () { if (!wx) return; + console.log('configShareForShixuns', host) + var shareData = { title: 'EduCoder - 实训项目', desc: '覆盖不同专业的IT实验和实训,每周更新,无需配置本机实验环境,随时随地开启企业级真实实训。', @@ -54,6 +57,8 @@ export function configShareForShixuns () { } export function configShareForCourses () { if (!wx) return; + console.log('configShareForCourses', host) + var shareData = { title: 'EduCoder - 翻转课堂', desc: '自动评测实训任务,支持技能统计,提供教学活动分析报告,减轻教师和助教的辅导压力,免去作业发布和批改的困扰,实时了解学生学习情况,全面提升教师施教效率和水平。', @@ -67,6 +72,8 @@ export function configShareForCourses () { // detail export function configShareForCustom (title, desc, path, imgUrl) { if (!wx) return; + console.log('configShareForCustom', host) + var shareData = { title: title, desc: desc, From e45e15a45105f2871eedc089485d1546bcbc108e Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Thu, 12 Sep 2019 15:54:58 +0800 Subject: [PATCH 44/79] =?UTF-8?q?=E8=B0=83=E5=88=86=E6=88=90=E5=8A=9F-?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E8=B0=83=E7=94=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercise/ExerciseReviewAndAnswer.js | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js index 97b6a5174..780b87688 100644 --- a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js +++ b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js @@ -268,8 +268,8 @@ class ExerciseReviewAndAnswer extends Component{ exercise_questions : update(prevState.exercise_questions, {[key]: { setScore: {$set: flag == undefined || flag==false ? true : false}}}) }),()=>{ if (position && type && (flag == undefined || flag==false)) { + $("#input_"+position+"_"+type).focus(); $("html").animate({ scrollTop: $("#Anchor_"+position+"_"+type).offset().top - 150 }); - if(id){ let { ajustSore } = this.state; let obj = ajustSore.filter(obj => obj.id === id).length > 0; @@ -382,26 +382,26 @@ class ExerciseReviewAndAnswer extends Component{ }).then((result)=>{ if(result.status==200){ this.props.showNotification('调分成功'); + this.getInfo(); + // let statusScore = score==0 ? 0 : score > 0 && score < maxScore ? 2 : 1; - let statusScore = score==0 ? 0 : score > 0 && score < maxScore ? 2 : 1; - - this.setState( - (prevState) => ({ - exercise_questions : update(prevState.exercise_questions, {[key]: { user_score: {$set: parseFloat(score).toFixed(1)},answer_status : {$set: statusScore},question_comments:{$set:result.data.question_comments} }}), - }) - ) + // this.setState( + // (prevState) => ({ + // exercise_questions : update(prevState.exercise_questions, {[key]: { user_score: {$set: parseFloat(score).toFixed(1)},answer_status : {$set: statusScore},question_comments:{$set:result.data.question_comments} }}), + // }) + // ) - this.setState( - (prevState) => ({ - ajustSore : update(prevState.ajustSore, {[index]: { desc: {$set: undefined},inputSore:{ $set:undefined }}}) - }) - ) - let {exerciseTotalScore} = this.state; - let newScore = parseFloat(parseFloat(exerciseTotalScore)+parseFloat(score)-parseFloat(oldScore)).toFixed(1); - this.setState({ - exerciseTotalScore:newScore - }) - this.showSetScore(key,true); + // this.setState( + // (prevState) => ({ + // ajustSore : update(prevState.ajustSore, {[index]: { desc: {$set: undefined},inputSore:{ $set:undefined }}}) + // }) + // ) + // let {exerciseTotalScore} = this.state; + // let newScore = parseFloat(parseFloat(exerciseTotalScore)+parseFloat(score)-parseFloat(oldScore)).toFixed(1); + // this.setState({ + // exerciseTotalScore:newScore + // }) + // this.showSetScore(key,true); } }).catch((error)=>{ console.log(error); @@ -932,6 +932,7 @@ class ExerciseReviewAndAnswer extends Component{ precision={1} className={ list && list.length>0 && list[0].setTip !="" ? "edu-txt-center winput-115-40 fl mt3 noticeTip inputNumber30" : "edu-txt-center winput-115-40 fl mt3 inputNumber30"} onChange={(value)=>this.inputScore(value,item.question_id)} + id={`${"input_"+item.q_position+"_"+item.question_type}`} > { From 28c2dab8bf3a1da906a160bb8d917e72a3a6316f Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Thu, 12 Sep 2019 15:58:00 +0800 Subject: [PATCH 45/79] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E8=B0=83=E5=88=86?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercise_questions_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/exercise_questions_controller.rb b/app/controllers/exercise_questions_controller.rb index 8cefa5071..5032cb469 100644 --- a/app/controllers/exercise_questions_controller.rb +++ b/app/controllers/exercise_questions_controller.rb @@ -501,9 +501,11 @@ class ExerciseQuestionsController < ApplicationController if ex_answers.present? #学生有回答时 取学生的答题得分,否则0分 answer_choice_array = [] ex_answers.each do |a| - answer_choice_array.push(a.exercise_choice.choice_position) #学生答案的位置 + if a.try(:exercise_choice).try(:choice_position).present? + answer_choice_array.push(a&.exercise_choice&.choice_position) #学生答案的位置 + end end - user_answer_content = answer_choice_array.sort + user_answer_content = answer_choice_array.reject(&:blank?).sort standard_answer = @exercise_question.exercise_standard_answers.pluck(:exercise_choice_id).sort if standard_answer.size == 1 # 老数据需要判断学生答题是否正确, 正确取原题得分,否则是0分 standard_answer = standard_answer.first.to_s.split("").map(&:to_i).sort From 44cf413c595864ffdb525beb57d68b0cf4d0ffd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 12 Sep 2019 15:59:18 +0800 Subject: [PATCH 46/79] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/coursesPublic/NewShixunModel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index a8dad2eb4..b5cd13791 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -180,7 +180,7 @@ class NewShixunModel extends Component{ diff:0, limit:15, }) - this.getdatalist(1,undefined,'all',value,'desc',0,15) + this.getdatalist(1,undefined,'all',undefined,'desc',0,15) } showNotification = (description, message = "提示", icon) => { From f3f29b7a9c5ce46cee519a683917d6079929c819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 12 Sep 2019 16:06:13 +0800 Subject: [PATCH 47/79] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/coursesPublic/NewShixunModel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index b5cd13791..b71d2c53f 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -142,7 +142,7 @@ class NewShixunModel extends Component{ keyword:undefined }) let{page,status,keyword,order,diff,limit}=this.state; - this.getdatalist(page,value,status,keyword,order,diff,limit) + this.getdatalist(page,value,status,undefined,order,diff,limit) } updatedlist=(order)=>{ @@ -180,7 +180,7 @@ class NewShixunModel extends Component{ diff:0, limit:15, }) - this.getdatalist(1,undefined,'all',undefined,'desc',0,15) + this.getdatalist(1,undefined,'all',value,'desc',0,15) } showNotification = (description, message = "提示", icon) => { From cbf0d74eea4d319311c3728c00e4f09ab8066d7e Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Thu, 12 Sep 2019 16:13:27 +0800 Subject: [PATCH 48/79] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=E8=B0=83=E5=88=86=E8=AF=84=E8=AF=AD=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=87=BA=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercise_questions_controller.rb | 5 +++-- app/models/exercise_answer_comment.rb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/exercise_questions_controller.rb b/app/controllers/exercise_questions_controller.rb index 5032cb469..affbdcd56 100644 --- a/app/controllers/exercise_questions_controller.rb +++ b/app/controllers/exercise_questions_controller.rb @@ -525,7 +525,8 @@ class ExerciseQuestionsController < ApplicationController :score => @c_score, :answer_text => "" } - ExerciseAnswer.create(answer_option) + ex_answers = ExerciseAnswer.new(answer_option) + ex_answers.save ex_answer_old = 0 end if ex_obj_score <= 0.0 @@ -625,7 +626,7 @@ class ExerciseQuestionsController < ApplicationController @exercise_current_user.update_attributes(ex_scores) end comments = params[:comment] - question_comment = @exercise_question.exercise_answer_comments.first + question_comment = @exercise_question.exercise_answer_comments&.first if question_comment.present? comment_option = { :comment => comments.present? ? comments : question_comment.comment, diff --git a/app/models/exercise_answer_comment.rb b/app/models/exercise_answer_comment.rb index 7da0ec4c7..4279ba445 100644 --- a/app/models/exercise_answer_comment.rb +++ b/app/models/exercise_answer_comment.rb @@ -3,7 +3,7 @@ class ExerciseAnswerComment < ApplicationRecord belongs_to :user belongs_to :exercise_question belongs_to :exercise_shixun_answer, optional: true - belongs_to :exercise_answer,optional: true + belongs_to :exercise_answer, optional: true scope :search_answer_comments, lambda {|name,ids| where("#{name}":ids)} end From a9c6367ac9edf5169bdb64f82616aa08e7802a27 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Thu, 12 Sep 2019 16:18:07 +0800 Subject: [PATCH 49/79] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E8=B0=83=E5=88=86?= =?UTF-8?q?=E7=9A=84=E8=AF=84=E8=AF=AD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercise_questions_controller.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/controllers/exercise_questions_controller.rb b/app/controllers/exercise_questions_controller.rb index affbdcd56..20feaecfe 100644 --- a/app/controllers/exercise_questions_controller.rb +++ b/app/controllers/exercise_questions_controller.rb @@ -497,6 +497,7 @@ class ExerciseQuestionsController < ApplicationController ex_obj_score = @exercise_current_user.objective_score #全部客观题得分 ex_subj_score = @exercise_current_user.subjective_score < 0.0 ? 0.0 : @exercise_current_user.subjective_score #全部主观题得分 ex_answers = @exercise_question.exercise_answers.search_answer_users("user_id",@user_id) #当前用户答案的得分 + ex_answer_create = nil if @exercise_question.question_type == Exercise::MULTIPLE if ex_answers.present? #学生有回答时 取学生的答题得分,否则0分 answer_choice_array = [] @@ -525,8 +526,8 @@ class ExerciseQuestionsController < ApplicationController :score => @c_score, :answer_text => "" } - ex_answers = ExerciseAnswer.new(answer_option) - ex_answers.save + ex_answer_create = ExerciseAnswer.new(answer_option) + ex_answer_create.save ex_answer_old = 0 end if ex_obj_score <= 0.0 @@ -636,13 +637,21 @@ class ExerciseQuestionsController < ApplicationController question_comment.update_attributes(comment_option) @exercise_comments = question_comment else + if ex_answers.present? + ex_answer_comment_id = ex_answers.first.id + elsif ex_answer_create.present? + ex_answer_comment_id = ex_answer_create.id + else + ex_answer_comment_id = nil + end + comment_option = { :user_id => current_user.id, :comment => comments, :score => @c_score, :exercise_question_id => @exercise_question.id, :exercise_shixun_answer_id => @shixun_a_id.present? ? @shixun_a_id : nil, - :exercise_answer_id => ex_answers.present? ? ex_answers.first.id : nil + :exercise_answer_id => ex_answer_comment_id } @exercise_comments = ExerciseAnswerComment.new(comment_option) @exercise_comments.save From 024a72e8ff89a9e9700e9613e430ae6f5a6099f0 Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Thu, 12 Sep 2019 16:24:47 +0800 Subject: [PATCH 50/79] =?UTF-8?q?=E8=B0=83=E5=88=86=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=B8=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/exercise/ExerciseReviewAndAnswer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js index 780b87688..f45de9b64 100644 --- a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js +++ b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js @@ -199,7 +199,7 @@ class ExerciseReviewAndAnswer extends Component{ result.data && result.data.exercise_questions.length>0 && result.data.exercise_questions.map((item,key)=>{ if( item.question_type == 4 && item.answer_status == 0 ){ ajustSore.push({ - inputSore:undefined, + inputSore:0, desc:undefined, id:item.question_id, position:item.q_position, @@ -276,7 +276,7 @@ class ExerciseReviewAndAnswer extends Component{ if(!obj){ ajustSore.push({ id, - inputSore:undefined, + inputSore:0, desc:undefined, position:position, setTip:"" From 1aafcd25b5c31d64af088be4ea2c39a53ee9c2d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 12 Sep 2019 16:27:40 +0800 Subject: [PATCH 51/79] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/coursesPublic/NewShixunModel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index b71d2c53f..b713000cf 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -142,7 +142,7 @@ class NewShixunModel extends Component{ keyword:undefined }) let{page,status,keyword,order,diff,limit}=this.state; - this.getdatalist(page,value,status,undefined,order,diff,limit) + this.getdatalist(1,value,status,undefined,order,diff,limit) } updatedlist=(order)=>{ From 9384f76b4521403e46fa948d9fe29cd092f5e342 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Thu, 12 Sep 2019 16:29:13 +0800 Subject: [PATCH 52/79] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E8=AF=84=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercise_questions_controller.rb | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/app/controllers/exercise_questions_controller.rb b/app/controllers/exercise_questions_controller.rb index 20feaecfe..7e0b612ff 100644 --- a/app/controllers/exercise_questions_controller.rb +++ b/app/controllers/exercise_questions_controller.rb @@ -526,8 +526,7 @@ class ExerciseQuestionsController < ApplicationController :score => @c_score, :answer_text => "" } - ex_answer_create = ExerciseAnswer.new(answer_option) - ex_answer_create.save + ExerciseAnswer.new(answer_option) ex_answer_old = 0 end if ex_obj_score <= 0.0 @@ -628,23 +627,18 @@ class ExerciseQuestionsController < ApplicationController end comments = params[:comment] question_comment = @exercise_question.exercise_answer_comments&.first + if question_comment.present? comment_option = { :comment => comments.present? ? comments : question_comment.comment, :score => @c_score, - :exercise_answer_id => ex_answers.present? ? ex_answers.first.id : nil + :exercise_answer_id => ex_answers.present? ? ex_answers.first.id : nil, + :user_id => current_user.id } question_comment.update_attributes(comment_option) @exercise_comments = question_comment else - if ex_answers.present? - ex_answer_comment_id = ex_answers.first.id - elsif ex_answer_create.present? - ex_answer_comment_id = ex_answer_create.id - else - ex_answer_comment_id = nil - end - + ex_answer_comment_id = @exercise_question.exercise_answers.find_by(user_id: @user_id).try(:id) comment_option = { :user_id => current_user.id, :comment => comments, From 7945996fe81e75b1f65f75a91445da0ad33e0204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 12 Sep 2019 16:33:28 +0800 Subject: [PATCH 53/79] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/coursesPublic/NewShixunModel.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index b713000cf..fbb97cbb5 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -139,9 +139,10 @@ class NewShixunModel extends Component{ belongto=(value)=>{ this.setState({ type:value, - keyword:undefined + keyword:undefined, + page:1 }) - let{page,status,keyword,order,diff,limit}=this.state; + let{status,order,diff,limit}=this.state; this.getdatalist(1,value,status,undefined,order,diff,limit) } From e87a4d14c691bec5e978b06c00fc3c0315e7758c Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Thu, 12 Sep 2019 16:43:55 +0800 Subject: [PATCH 54/79] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E7=9A=84=E8=AF=84?= =?UTF-8?q?=E9=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercise_questions_controller.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/controllers/exercise_questions_controller.rb b/app/controllers/exercise_questions_controller.rb index 7e0b612ff..14d2bdbd0 100644 --- a/app/controllers/exercise_questions_controller.rb +++ b/app/controllers/exercise_questions_controller.rb @@ -497,7 +497,6 @@ class ExerciseQuestionsController < ApplicationController ex_obj_score = @exercise_current_user.objective_score #全部客观题得分 ex_subj_score = @exercise_current_user.subjective_score < 0.0 ? 0.0 : @exercise_current_user.subjective_score #全部主观题得分 ex_answers = @exercise_question.exercise_answers.search_answer_users("user_id",@user_id) #当前用户答案的得分 - ex_answer_create = nil if @exercise_question.question_type == Exercise::MULTIPLE if ex_answers.present? #学生有回答时 取学生的答题得分,否则0分 answer_choice_array = [] @@ -526,7 +525,7 @@ class ExerciseQuestionsController < ApplicationController :score => @c_score, :answer_text => "" } - ExerciseAnswer.new(answer_option) + ExerciseAnswer.create(answer_option) ex_answer_old = 0 end if ex_obj_score <= 0.0 @@ -538,6 +537,8 @@ class ExerciseQuestionsController < ApplicationController total_scores = new_obj_score + ex_subj_score if total_scores < 0.0 total_scores = 0.0 + elsif total_scores > @exercise.score + total_scores = @exercise.score end ex_scores = { :objective_score => new_obj_score, @@ -566,6 +567,8 @@ class ExerciseQuestionsController < ApplicationController total_scores = new_obj_score + ex_subj_score if total_scores < 0.0 total_scores = 0.0 + elsif total_scores > @exercise.score + total_scores = @exercise.score end ex_scores = { :objective_score => new_obj_score, @@ -590,6 +593,8 @@ class ExerciseQuestionsController < ApplicationController total_scores = ex_obj_score + new_sub_score if total_scores < 0.0 total_scores = 0.0 + elsif total_scores > @exercise.score + total_scores = @exercise.score end ex_scores = { :subjective_score => new_sub_score, @@ -618,6 +623,8 @@ class ExerciseQuestionsController < ApplicationController total_scores = new_obj_score + ex_subj_score if total_scores < 0.0 total_scores = 0.0 + elsif total_scores > @exercise.score + total_scores = @exercise.score end ex_scores = { :objective_score => new_obj_score, @@ -630,7 +637,7 @@ class ExerciseQuestionsController < ApplicationController if question_comment.present? comment_option = { - :comment => comments.present? ? comments : question_comment.comment, + :comment => comments, :score => @c_score, :exercise_answer_id => ex_answers.present? ? ex_answers.first.id : nil, :user_id => current_user.id From d2e449782132a8aab5fb4551741a67771c8e4949 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Thu, 12 Sep 2019 16:47:24 +0800 Subject: [PATCH 55/79] =?UTF-8?q?=E8=AF=84=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercise_questions_controller.rb | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/controllers/exercise_questions_controller.rb b/app/controllers/exercise_questions_controller.rb index 14d2bdbd0..bb28fff54 100644 --- a/app/controllers/exercise_questions_controller.rb +++ b/app/controllers/exercise_questions_controller.rb @@ -494,6 +494,7 @@ class ExerciseQuestionsController < ApplicationController def adjust_score ActiveRecord::Base.transaction do begin + ex_all_scores = @exercise.exercise_questions.pluck(:question_score).sum ex_obj_score = @exercise_current_user.objective_score #全部客观题得分 ex_subj_score = @exercise_current_user.subjective_score < 0.0 ? 0.0 : @exercise_current_user.subjective_score #全部主观题得分 ex_answers = @exercise_question.exercise_answers.search_answer_users("user_id",@user_id) #当前用户答案的得分 @@ -537,8 +538,8 @@ class ExerciseQuestionsController < ApplicationController total_scores = new_obj_score + ex_subj_score if total_scores < 0.0 total_scores = 0.0 - elsif total_scores > @exercise.score - total_scores = @exercise.score + elsif total_scores > ex_all_scores + total_scores = ex_all_scores end ex_scores = { :objective_score => new_obj_score, @@ -567,8 +568,8 @@ class ExerciseQuestionsController < ApplicationController total_scores = new_obj_score + ex_subj_score if total_scores < 0.0 total_scores = 0.0 - elsif total_scores > @exercise.score - total_scores = @exercise.score + elsif total_scores > ex_all_scores + total_scores = ex_all_scores end ex_scores = { :objective_score => new_obj_score, @@ -593,8 +594,8 @@ class ExerciseQuestionsController < ApplicationController total_scores = ex_obj_score + new_sub_score if total_scores < 0.0 total_scores = 0.0 - elsif total_scores > @exercise.score - total_scores = @exercise.score + elsif total_scores > ex_all_scores + total_scores = ex_all_scores end ex_scores = { :subjective_score => new_sub_score, @@ -623,8 +624,8 @@ class ExerciseQuestionsController < ApplicationController total_scores = new_obj_score + ex_subj_score if total_scores < 0.0 total_scores = 0.0 - elsif total_scores > @exercise.score - total_scores = @exercise.score + elsif total_scores > ex_all_scores + total_scores = ex_all_scores end ex_scores = { :objective_score => new_obj_score, From 264f711046726dcc869af53ac483b8d491dee3c8 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 12 Sep 2019 22:33:37 +0800 Subject: [PATCH 56/79] =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=AF=86=E5=88=AB?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E4=B8=8D=E5=AF=B9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/concerns/git_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/concerns/git_helper.rb b/app/controllers/concerns/git_helper.rb index c19c6fdd6..9242b87ac 100644 --- a/app/controllers/concerns/git_helper.rb +++ b/app/controllers/concerns/git_helper.rb @@ -23,7 +23,7 @@ module GitHelper Rails.logger.info "encoding: #{cd['encoding']} confidence: #{cd['confidence']}" # 字符编码问题,GB18030编码识别率不行 decode_content = - if cd["encoding"] == 'GB18030' && cd['confidence'] == 1.0 + if cd["encoding"] == 'GB18030' && cd['confidence'] > 0.8 content.encode('UTF-8', 'GBK', {:invalid => :replace, :undef => :replace, :replace => ' '}) else content.force_encoding('UTF-8') From 127c8d4015cd1a04e9f7a98c8fc3cd3ea12a8944 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sun, 15 Sep 2019 15:43:12 +0800 Subject: [PATCH 57/79] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/subject.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/subject.rb b/app/models/subject.rb index 6ecb5ed18..d5ea3f433 100644 --- a/app/models/subject.rb +++ b/app/models/subject.rb @@ -46,8 +46,7 @@ class Subject < ApplicationRecord # 挑战过路径的成员数(金课统计去重后的报名人数) def member_count - excellent && CourseMember.where(role: 4, course_id: courses.pluck(:id)).pluck(:user_id).length > shixuns.pluck(:myshixuns_count).sum ? - CourseMember.where(role: 4, course_id: courses.pluck(:id)).pluck(:user_id).length : shixuns.pluck(:myshixuns_count).sum + excellent ? CourseMember.where(role: 4, course_id: courses.pluck(:id)).pluck(:user_id).length : shixuns.pluck(:myshixuns_count).sum end def all_score From 830af28f587492a04f83f031de8ee998f2fa762e Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 16 Sep 2019 09:31:25 +0800 Subject: [PATCH 58/79] console.log('configShareForPaths') --- public/react/src/modules/paths/ShixunPaths.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/react/src/modules/paths/ShixunPaths.js b/public/react/src/modules/paths/ShixunPaths.js index c2bc0d869..d943634b3 100644 --- a/public/react/src/modules/paths/ShixunPaths.js +++ b/public/react/src/modules/paths/ShixunPaths.js @@ -8,6 +8,7 @@ class ShixunPath extends Component{ super(props) } componentDidMount() { + console.log('configShareForPaths') configShareForPaths() } From 377c261d09556430b7581a8477a85e63eb78e5b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 16 Sep 2019 11:12:39 +0800 Subject: [PATCH 59/79] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9F=A5=E9=87=8D?= =?UTF-8?q?=E8=B0=83=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/ShixunWorkDetails.js | 42 +++++++++- .../Shixunworkdetails/ShixunCustomsPass.js | 76 ++++++++++++++++++- 2 files changed, 110 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkDetails.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkDetails.js index 967a6ca61..a5a3b5408 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkDetails.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkDetails.js @@ -35,10 +35,15 @@ class ShixunWorkDetails extends Component { } }).then((result) => { if (result.status === 200) { - this.setState({ - data:result.data, - spinning:false - }) + if (result.data.status === 403 || result.data.status === 401 || result.data.status === 407 || result.data.status === 408|| result.data.status === 409 || result.data.status === 500) { + + }else{ + this.setState({ + data:result.data, + spinning:false + }) + } + } }).catch((error) => { console.log(error) @@ -50,7 +55,33 @@ class ShixunWorkDetails extends Component { shixuntypes:type[3] }) } + updatas=()=>{ + 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,{ + params: { + user_id:userid, + } + }).then((result) => { + if (result.status === 200) { + if (result.data.status === 403 || result.data.status === 401 || result.data.status === 407 || result.data.status === 408|| result.data.status === 409 || result.data.status === 500) { + }else{ + this.setState({ + data:result.data, + spinning:false + }) + } + + } + }).catch((error) => { + console.log(error) + }) + } goback=(sum)=>{ // let{data}=this.state // if(sum===1){ @@ -110,6 +141,9 @@ class ShixunWorkDetails extends Component {
    this.updatas()} data={data} />
    diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunCustomsPass.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunCustomsPass.js index 8ffa8a1dd..d03453c40 100644 --- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunCustomsPass.js +++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunCustomsPass.js @@ -1,10 +1,10 @@ import React, {Component} from "react"; import {WordsBtn} from 'educoder'; -import {Table} from "antd"; +import {Table,InputNumber} from "antd"; import {Link,Switch,Route,Redirect} from 'react-router-dom'; import moment from 'moment'; import { MonacoDiffEditor } from 'react-monaco-editor'; - +import axios from 'axios'; class ShixunCustomsPass extends Component { constructor(props) { @@ -18,10 +18,51 @@ class ShixunCustomsPass extends Component { componentDidMount() { } + editgame_scores=(e,id,maxsum,code_rate,copy_user_id)=>{ + + let{datas}=this.state; + let newdatas=datas; + let score=e.target.value; + + if(score!=null&&score!=undefined&&score!=""){ + if(score<0){ + this.props.showNotification("不能小于0"); + this.setState({ + customsids:id + }) + }else if(score>maxsum){ + this.props.showNotification(`不能大于关卡分值${maxsum}`); + this.setState({ + customsids:id + }) + }else{ + let work_id=this.props.data.work_id; + let url=`/student_works/${work_id}/adjust_review_score.json` + axios.post(url,{ + type:"review", + score:score, + challenge_id:id, + code_rate:code_rate, + copy_user_id:copy_user_id + }).then((result)=>{ + if(result.data.status===0){ + this.props.updatas(); + this.props.showNotification(result.data.message); + }else{ + this.props.showNotification(result.data.message); + } + }).catch((error)=>{ + }) + } + }else{ + this.props.showNotification("调分为空将不会修改之前的分数"); + } + } render() { let {data}=this.props; - console.log(data) + let {customsids}=this.state; + // console.log(data) let datas=[]; data&&data.challenge_list.forEach((item,key)=>{ @@ -33,6 +74,8 @@ class ShixunCustomsPass extends Component { finishtime:item.copy_username, elapsedtime:item.copy_end_time===null?"无":item.copy_end_time===undefined?"无":item.copy_end_time===""?"无":moment(item.copy_end_time).format('YYYY-MM-DD HH:mm:ss'), empvalue:item.code_rate, + challenge_id:{id:item.id}, + copy_user_id:item.copy_user_id // adjustmentminute:asdasd }) }) @@ -112,6 +155,20 @@ class ShixunCustomsPass extends Component { render: (text, record) => ( {record.elapsedtime} + + ), + },{ + title: '调分', + key: 'adjustmentminute', + dataIndex: 'adjustmentminute', + + render: (text, record) => ( + + this.editgame_scores(e,record.challenge_id.id,record.evaluating.all_score,record.empvalue,record.copy_user_id)} + // min={0} max={record.game_scores.game_score_full} + /> + {/*查看*/} ), }, { @@ -138,7 +195,15 @@ class ShixunCustomsPass extends Component { // }, - + if(this.props.isAdmin()===false){ + columns.some((item,key)=> { + if (item.title === "调分") { + columns.splice(key, 1) + return true + } + } + ) + } return (
    @@ -177,6 +242,9 @@ class ShixunCustomsPass extends Component { .customsPass{ text-align: left !important; } + .ant-table-thead > tr > th, .ant-table-tbody > tr > td { + padding: 16px 12px; + } `} {datas===undefined?"": Date: Mon, 16 Sep 2019 13:40:23 +0800 Subject: [PATCH 60/79] =?UTF-8?q?=E9=87=91=E8=AF=BE=E7=9A=84=E5=AE=9E?= =?UTF-8?q?=E8=AE=AD=E4=BD=9C=E4=B8=9A=E6=95=B0=E6=8D=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/public_course_sync.rake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/tasks/public_course_sync.rake b/lib/tasks/public_course_sync.rake index a22a9f1f8..c26090e81 100644 --- a/lib/tasks/public_course_sync.rake +++ b/lib/tasks/public_course_sync.rake @@ -81,8 +81,10 @@ namespace :public_classes do homework.update_columns(publish_time: publish_time, end_time: end_time, created_at: created_at, updated_at: updated_at) homework.homework_detail_manual.update_columns(comment_status: 6, created_at: created_at, updated_at: updated_at) + homework.update_homework_work_score + homework.update_attribute('calculation_time', end_time) - homework.student_works.where("work_status !=0 and update_time > '#{end_time}'").update_all(update_time: end_time) + # homework.student_works.where("work_status !=0 and update_time > '#{end_time}'").update_all(update_time: end_time) end when 3 # 试卷 From 587bbab481f96840913f862b76ae2ab0a495bac4 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Mon, 16 Sep 2019 14:05:52 +0800 Subject: [PATCH 61/79] fix anonymous tiding show user avatar bug --- app/models/tiding.rb | 6 ++++++ app/views/tidings/_tiding.json.jbuilder | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/models/tiding.rb b/app/models/tiding.rb index d885f93fd..cdc149fe1 100644 --- a/app/models/tiding.rb +++ b/app/models/tiding.rb @@ -22,4 +22,10 @@ class Tiding < ApplicationRecord value end + + def anonymous? + (container_type == 'StudentWorksScore' && extra.to_i == 3) || + (container_type == 'StudentWorksScoresAppeal' && parent_container_type == 'AppealResult') || + (container_type == 'StudentWorksScoresAppeal' && parent_container_type == 'StudentWork' && tiding_type == 'System') + end end \ No newline at end of file diff --git a/app/views/tidings/_tiding.json.jbuilder b/app/views/tidings/_tiding.json.jbuilder index 959a96ebd..210e5c8f8 100644 --- a/app/views/tidings/_tiding.json.jbuilder +++ b/app/views/tidings/_tiding.json.jbuilder @@ -17,8 +17,13 @@ json.homework_type homework_type json.time tiding.how_long_time json.new_tiding tiding.unread?(@onclick_time) +# 需要系统头像 +show_system_user = tiding.trigger_user_id.zero? || + (tiding.trigger_user_id == 1 && tiding.tiding_type == 'System') || + tiding.anonymous? + json.trigger_user do - if tiding.trigger_user_id.zero? || (tiding.trigger_user_id == 1 && tiding.tiding_type == 'System') + if show_system_user json.id 0 json.name "系统" json.login "" From 07d6ac5b36c1781a48cea56af61e9738b2b735b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 16 Sep 2019 14:32:36 +0800 Subject: [PATCH 62/79] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9F=A5=E9=87=8D?= =?UTF-8?q?=E8=B0=83=E5=88=86=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/shixunHomework/ShixunWorkDetails.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkDetails.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkDetails.js index a5a3b5408..8254b148e 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkDetails.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkDetails.js @@ -133,8 +133,9 @@ class ShixunWorkDetails extends Component { 非编程类型任务,不参与查重 被查作品: - {data&&data.username} - {data&&data.final_score}分 + {data&&data.username} + {data&&data.eff_score===null||data&&data.eff_score===undefined||data&&data.eff_score_full===null||data&&data.eff_score_full===undefined?"":效率分:{data&&data.eff_score}/{data&&data.eff_score_full}} + 最终成绩:{data&&data.final_score} From c1a6354ec66ee509df7d303ad1c5b5a22742c0d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 16 Sep 2019 14:47:16 +0800 Subject: [PATCH 63/79] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9F=A5=E9=87=8D?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/Shixunworkdetails/ShixunCustomsPass.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunCustomsPass.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunCustomsPass.js index d03453c40..0b5b04cfc 100644 --- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunCustomsPass.js +++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunCustomsPass.js @@ -164,10 +164,12 @@ class ShixunCustomsPass extends Component { render: (text, record) => ( - + {record.copy_user_id===null?"": this.editgame_scores(e,record.challenge_id.id,record.evaluating.all_score,record.empvalue,record.copy_user_id)} // min={0} max={record.game_scores.game_score_full} - /> + />} + {/*查看*/} ), From 8bf31eda8d5d9303f21bd920730eec0325ab25c0 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 16 Sep 2019 15:27:17 +0800 Subject: [PATCH 64/79] =?UTF-8?q?python=E7=B1=BB=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/myshixuns_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index fc5db713f..a7b4aed97 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -271,7 +271,11 @@ class MyshixunsController < ApplicationController unless @hide_code || @myshixun.shixun&.vnc_evaluate # 远程版本库文件内容 last_content = GitService.file_content(repo_path: @repo_path, path: path)["content"] - content = params[:content] + content = if @myshixun.mirror_name.select {|a| a.include?("MachineLearning") || a.include?("Python")}.present? && params[:content].present? + params[:content].gsub(/\t/, ' ') + else + params[:content] + end Rails.logger.info("###11222333####{content}") Rails.logger.info("###222333####{last_content}") From 57860fdb4ec94e50a5e41186af90aed238eaf386 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 16 Sep 2019 15:32:18 +0800 Subject: [PATCH 65/79] =?UTF-8?q?=E9=A2=98=E5=BA=93=E9=80=89=E7=94=A8?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/question_banks_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/question_banks_controller.rb b/app/controllers/question_banks_controller.rb index b4e98e05f..60b9a807c 100644 --- a/app/controllers/question_banks_controller.rb +++ b/app/controllers/question_banks_controller.rb @@ -264,8 +264,9 @@ class QuestionBanksController < ApplicationController # new_exercise.create_exercise_list # exercise.update_column(:quotes, exercise.quotes+1) # end - new_exercise if new_exercise.save! + new_exercise.save! exercise.update_column(:quotes, exercise.quotes+1) + new_exercise end end @@ -292,8 +293,9 @@ class QuestionBanksController < ApplicationController # new_poll.create_polls_list # poll.update_column(:quotes, poll.quotes+1) # end - new_poll if new_poll.save! + new_poll.save! poll.update_column(:quotes, poll.quotes+1) + new_poll end end From 1fad13309491ed0a7e8b577e314339df8e69e20b Mon Sep 17 00:00:00 2001 From: p31729568 Date: Mon, 16 Sep 2019 15:53:58 +0800 Subject: [PATCH 66/79] fix tiding i18n missing --- config/locales/tidings/zh-CN.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/locales/tidings/zh-CN.yml b/config/locales/tidings/zh-CN.yml index e6e8e676d..21c020d04 100644 --- a/config/locales/tidings/zh-CN.yml +++ b/config/locales/tidings/zh-CN.yml @@ -202,6 +202,7 @@ 2_end: "别人对你的匿评发起的申诉申请:%s,审核未通过" StudentWork: Apply_end: "发起了匿评申诉申请:%s" + HomeworkCommon_end: "发起了匿评申诉申请:%s" System_end: "有人对你的匿评发起了申诉:%s" Department_end: "你选填的二级单位:%s(%s)因不符合规范,已被系统删除.请重新选择" Library: From b89cd28c0906e73af61e6795d2af7ccd796f1287 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 16 Sep 2019 15:57:31 +0800 Subject: [PATCH 67/79] =?UTF-8?q?=E7=BC=96=E7=A0=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/myshixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index a7b4aed97..da3892c85 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -272,7 +272,7 @@ class MyshixunsController < ApplicationController # 远程版本库文件内容 last_content = GitService.file_content(repo_path: @repo_path, path: path)["content"] content = if @myshixun.mirror_name.select {|a| a.include?("MachineLearning") || a.include?("Python")}.present? && params[:content].present? - params[:content].gsub(/\t/, ' ') + params[:content].gsub(/\t/, ' ').gsub(/ /, ' ') else params[:content] end From 7e89b8577204bd4f0997f7483891b540729790cc Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 16 Sep 2019 16:00:32 +0800 Subject: [PATCH 68/79] 1 --- app/controllers/myshixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index da3892c85..bf067b389 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -272,7 +272,7 @@ class MyshixunsController < ApplicationController # 远程版本库文件内容 last_content = GitService.file_content(repo_path: @repo_path, path: path)["content"] content = if @myshixun.mirror_name.select {|a| a.include?("MachineLearning") || a.include?("Python")}.present? && params[:content].present? - params[:content].gsub(/\t/, ' ').gsub(/ /, ' ') + params[:content].gsub(/\t/, ' ').gsub(/ /, ' ') # 这个不是空格,在windows机器上带来的问题 else params[:content] end From cad231319a84163f5d5c2016a02f3df964e4b7e4 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 16 Sep 2019 16:29:25 +0800 Subject: [PATCH 69/79] =?UTF-8?q?=E7=94=B3=E8=AF=89=E7=9A=84=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/tiding.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/models/tiding.rb b/app/models/tiding.rb index cdc149fe1..02692085a 100644 --- a/app/models/tiding.rb +++ b/app/models/tiding.rb @@ -25,7 +25,6 @@ class Tiding < ApplicationRecord def anonymous? (container_type == 'StudentWorksScore' && extra.to_i == 3) || - (container_type == 'StudentWorksScoresAppeal' && parent_container_type == 'AppealResult') || (container_type == 'StudentWorksScoresAppeal' && parent_container_type == 'StudentWork' && tiding_type == 'System') end end \ No newline at end of file From adbfde14257bbc746cbda2080fa062102ea84eb9 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 16 Sep 2019 16:40:06 +0800 Subject: [PATCH 70/79] =?UTF-8?q?=E6=AF=95=E8=AE=BE=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=9A=84=E5=8F=91=E5=B8=83=E6=97=B6=E9=97=B4=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/graduation_tasks_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/graduation_tasks_controller.rb b/app/controllers/graduation_tasks_controller.rb index a159cff59..841b516bb 100644 --- a/app/controllers/graduation_tasks_controller.rb +++ b/app/controllers/graduation_tasks_controller.rb @@ -324,7 +324,7 @@ class GraduationTasksController < ApplicationController tip_exception("缺少截止时间参数") if params[:end_time].blank? tip_exception("截止时间必须晚于当前时间") if params[:end_time] <= strf_time(Time.now) tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")})") if - @course.end_date.present? && params[:end_time] > @course.end_date.end_of_day + @course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day) # ActiveRecord::Base.transaction do begin @@ -401,7 +401,7 @@ class GraduationTasksController < ApplicationController tip_exception("截止时间不能早于当前时间") if params[:end_time] <= Time.now.strftime("%Y-%m-%d %H:%M:%S") tip_exception("截止时间不能早于发布时间") if params[:publish_time] > params[:end_time] tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")})") if - @course.end_date.present? && params[:end_time] > @course.end_date.end_of_day + @course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day) @task.publish_time = params[:publish_time] @task.end_time = params[:end_time] @@ -414,7 +414,7 @@ class GraduationTasksController < ApplicationController tip_exception("截止时间不能为空") if params[:end_time].blank? tip_exception("截止时间不能早于当前时间") if params[:end_time] <= Time.now.strftime("%Y-%m-%d %H:%M:%S") tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")})") if - @course.end_date.present? && params[:end_time] > @course.end_date.end_of_day + @course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day) @task.end_time = params[:end_time] end @@ -426,7 +426,7 @@ class GraduationTasksController < ApplicationController tip_exception("补交结束时间不能为空") if params[:late_time].blank? tip_exception("补交结束时间不能早于截止时间") if params[:late_time] <= @task.end_time tip_exception("补交结束时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")})") if - @course.end_date.present? && params[:late_time] > @course.end_date.end_of_day + @course.end_date.present? && params[:late_time] > strf_time(@course.end_date.end_of_day) tip_exception("迟交扣分应为正整数") if params[:late_penalty] && params[:late_penalty].to_i < 0 @task.allow_late = true From 4b1066d73aa1a78312ba0d82b5383f1ae8a68dd4 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 16 Sep 2019 17:35:58 +0800 Subject: [PATCH 71/79] isWeiXin --- public/react/public/index.html | 5 +++-- public/react/src/common/Env.js | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/public/react/public/index.html b/public/react/public/index.html index 166760eab..4fd2c4356 100755 --- a/public/react/public/index.html +++ b/public/react/public/index.html @@ -34,8 +34,9 @@ // location.href = './compatibility' location.href = '/compatibility.html' } - const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())); - if (isMobile) { + // const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())); + const isWeiXin = (/MicroMessenger/i.test(navigator.userAgent.toLowerCase())); + if (isWeiXin) { document.write(' diff --git a/public/react/src/common/Env.js b/public/react/src/common/Env.js index 283e82c48..c80497509 100644 --- a/public/react/src/common/Env.js +++ b/public/react/src/common/Env.js @@ -3,4 +3,6 @@ export function isDev() { } // const isMobile -export const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())); \ No newline at end of file +export const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())); + +// const isWeiXin = (/MicroMessenger/i.test(navigator.userAgent.toLowerCase())); From fd90587a0d827b40d56deecd6d03371e1c5b290d Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 17 Sep 2019 10:10:21 +0800 Subject: [PATCH 72/79] share --- public/react/src/App.js | 59 +--------- public/react/src/common/util/ShareUtil.js | 136 +++++++++++++++------- 2 files changed, 93 insertions(+), 102 deletions(-) diff --git a/public/react/src/App.js b/public/react/src/App.js index 17ee34255..e243553bb 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -9,7 +9,7 @@ import { Route, Switch } from 'react-router-dom'; -import axios from 'axios'; + import '@icedesign/base/dist/ICEDesignBase.css'; import '@icedesign/base/index.scss'; @@ -37,7 +37,7 @@ import {MuiThemeProvider, createMuiTheme} from 'material-ui/styles'; import history from './history'; -import {SnackbarHOC, configShareForIndex} from 'educoder' +import {SnackbarHOC} from 'educoder' import {initAxiosInterceptors} from './AppConfig' @@ -298,61 +298,7 @@ class App extends Component { mydisplay:true, }) }; - initWXShare = () => { - if (window.wx) { - const wx = window.wx - const url = '/wechats/js_sdk_signature.json' - const currentUrl = window.location.href.split('#')[0] - // window.encodeURIComponent() - axios.post(url, { - url: window.__testUrl || currentUrl, - }).then((response) => { - console.log('got res') - const data = response.data; - wx.config({ - debug: false, - appId: data.appid, - timestamp: data.timestamp, - nonceStr: data.noncestr, - signature: data.signature, - jsApiList: [ - 'onMenuShareTimeline',// - 'onMenuShareAppMessage', - 'onMenuShareQQ', - 'onMenuShareWeibo', - 'onMenuShareQZone' - ] - }); - wx.ready(function () { - console.log('wx is ready') - // var shareData = { - // title: 'EduCoder - 首页', - // desc: 'Educoder是一个面向计算机类的互联网IT教育和实战平台,提供企业级工程实训,以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动,将传统的知识传授和时兴的工程实战一体化。', - // link: currentUrl, - // imgUrl: window.__testImageUrl - // || (currentUrl.endsWith('/') ? currentUrl : currentUrl + '/') + 'react/build/images/share_logo_icon.jpg' - // }; - - // wx.onMenuShareAppMessage(shareData);//分享给好友 - // wx.onMenuShareTimeline(shareData);//分享到朋友圈 - // wx.onMenuShareQQ(shareData);//分享给手机QQ - // wx.onMenuShareWeibo(shareData);//分享腾讯微博 - // wx.onMenuShareQZone(shareData);//分享到QQ空间 - - configShareForIndex('/') - }); - wx.error(function (res) { - console.log('wx is error') - console.log(res) - //alert(res.errMsg);//错误提示 - - }); - }).catch((error) => { - console.log(error) - }) - } - } disableVideoContextMenu = () => { window.$( "body" ).on( "mousedown", "video", function(event) { if(event.which === 3) { @@ -374,7 +320,6 @@ class App extends Component { }); initAxiosInterceptors(this.props) - this.initWXShare() // // axios.interceptors.response.use((response) => { // // console.log("response"+response); diff --git a/public/react/src/common/util/ShareUtil.js b/public/react/src/common/util/ShareUtil.js index 9a83db552..4e6c06d59 100644 --- a/public/react/src/common/util/ShareUtil.js +++ b/public/react/src/common/util/ShareUtil.js @@ -1,3 +1,4 @@ +import axios from 'axios' const host = window.location.protocol + '//' + window.location.host const wx = window.wx function share(shareData) { @@ -11,7 +12,47 @@ function share(shareData) { console.log(e) } } +const urlDoneMap = {} +function requestForSignatrue (callback) { + const currentUrl = window.location.href.split('#')[0] + if (window.wx && !urlDoneMap[currentUrl]) { + const wx = window.wx + const url = '/wechats/js_sdk_signature.json' + urlDoneMap[currentUrl] = true + // window.encodeURIComponent() + axios.post(url, { + url: window.__testUrl || currentUrl, + }).then((response) => { + console.log('got res') + const data = response.data; + wx.config({ + debug: false, + appId: data.appid, + timestamp: data.timestamp, + nonceStr: data.noncestr, + signature: data.signature, + jsApiList: [ + 'onMenuShareTimeline',// + 'onMenuShareAppMessage', + 'onMenuShareQQ', + 'onMenuShareWeibo', + 'onMenuShareQZone' + ] + }); + wx.ready(function () { + callback && callback() + }); + wx.error(function (res) { + console.log('wx is error') + console.log(res) + //alert(res.errMsg);//错误提示 + }); + }).catch((error) => { + console.log(error) + }) + } +} /** 实践课程 平台提供涵盖基础入门、案例实践和创新应用的完整实训项目体系,通过由浅入深的实训路径,帮助学生快速提升实战能力。 实训项目 覆盖不同专业的IT实验和实训,每周更新,无需配置本机实验环境,随时随地开启企业级真实实训。 @@ -19,67 +60,72 @@ function share(shareData) { 单个课程和实训 获取课程/实训的简介 该课程或者实训展示的缩略图 */ -export function configShareForIndex (path) { - if (!wx) return; - var shareData = { +export function configShareForIndex (path) { + requestForSignatrue(() => { + var shareData = { title: 'EduCoder - 首页', desc: 'Educoder是一个面向计算机类的互联网IT教育和实战平台,提供企业级工程实训,以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动,将传统的知识传授和时兴的工程实战一体化。', link: host + (path || ''), imgUrl: window.__testImageUrl || host + '/react/build/images/share_logo_icon.jpg' - }; - share(shareData) + }; + share(shareData) + }) } export function configShareForPaths () { - if (!wx) return; - console.log('configShareForPaths', host) - var shareData = { - title: 'EduCoder - 实践课程', - desc: '平台提供涵盖基础入门、案例实践和创新应用的完整实训项目体系,通过由浅入深的实训路径,帮助学生快速提升实战能力。', - link: `${host}/paths`, - imgUrl: window.__testImageUrl - || host + '/react/build/images/share_logo_icon.jpg' - }; - share(shareData) + requestForSignatrue(() => { + console.log('configShareForPaths', host) + var shareData = { + title: 'EduCoder - 实践课程', + desc: '平台提供涵盖基础入门、案例实践和创新应用的完整实训项目体系,通过由浅入深的实训路径,帮助学生快速提升实战能力。', + link: `${host}/paths`, + imgUrl: window.__testImageUrl + || host + '/react/build/images/share_logo_icon.jpg' + }; + share(shareData) + }) } export function configShareForShixuns () { - if (!wx) return; - console.log('configShareForShixuns', host) + requestForSignatrue(() => { + console.log('configShareForShixuns', host) - var shareData = { - title: 'EduCoder - 实训项目', - desc: '覆盖不同专业的IT实验和实训,每周更新,无需配置本机实验环境,随时随地开启企业级真实实训。', - link: `${host}/shixuns`, - imgUrl: window.__testImageUrl - || host + '/react/build/images/share_logo_icon.jpg' - }; - share(shareData) + var shareData = { + title: 'EduCoder - 实训项目', + desc: '覆盖不同专业的IT实验和实训,每周更新,无需配置本机实验环境,随时随地开启企业级真实实训。', + link: `${host}/shixuns`, + imgUrl: window.__testImageUrl + || host + '/react/build/images/share_logo_icon.jpg' + }; + share(shareData) + }) } export function configShareForCourses () { - if (!wx) return; - console.log('configShareForCourses', host) + requestForSignatrue(() => { + console.log('configShareForCourses', host) - var shareData = { - title: 'EduCoder - 翻转课堂', - desc: '自动评测实训任务,支持技能统计,提供教学活动分析报告,减轻教师和助教的辅导压力,免去作业发布和批改的困扰,实时了解学生学习情况,全面提升教师施教效率和水平。', - link: `${host}/courses`, - imgUrl: window.__testImageUrl - || host + '/react/build/images/share_logo_icon.jpg' - }; - share(shareData) + var shareData = { + title: 'EduCoder - 翻转课堂', + desc: '自动评测实训任务,支持技能统计,提供教学活动分析报告,减轻教师和助教的辅导压力,免去作业发布和批改的困扰,实时了解学生学习情况,全面提升教师施教效率和水平。', + link: `${host}/courses`, + imgUrl: window.__testImageUrl + || host + '/react/build/images/share_logo_icon.jpg' + }; + share(shareData) + }) } // detail export function configShareForCustom (title, desc, path, imgUrl) { - if (!wx) return; - console.log('configShareForCustom', host) + requestForSignatrue(() => { + console.log('configShareForCustom', host) - var shareData = { - title: title, - desc: desc, - link: `${host}/${path}`, - imgUrl: imgUrl || window.__testImageUrl - || host + '/react/build/images/share_logo_icon.jpg' - }; - share(shareData) + var shareData = { + title: title, + desc: desc, + link: `${host}/${path}`, + imgUrl: imgUrl || window.__testImageUrl + || host + '/react/build/images/share_logo_icon.jpg' + }; + share(shareData) + }) } From 665c6329d19cbdfa1dc95fb381cedd38fedbcbd3 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Tue, 17 Sep 2019 10:22:15 +0800 Subject: [PATCH 73/79] ecs: graduation requirement page --- .../ec_graduation_requirements_controller.rb | 18 +- app/models/ec_graduation_requirement.rb | 4 +- .../index.json.jbuilder | 2 +- .../show.json.jbuilder | 2 +- config/routes.rb | 2 +- .../EcSetting/GraduationRequirement/index.js | 318 +++++++++++++++++- .../GraduationRequirement/index.scss | 94 ++++++ .../ecs/EcSetting/TrainingObjective/index.js | 2 +- .../react/src/modules/ecs/EcSetting/index.js | 3 + 9 files changed, 434 insertions(+), 11 deletions(-) diff --git a/app/controllers/ecs/ec_graduation_requirements_controller.rb b/app/controllers/ecs/ec_graduation_requirements_controller.rb index 95dafdb3c..0647a7914 100644 --- a/app/controllers/ecs/ec_graduation_requirements_controller.rb +++ b/app/controllers/ecs/ec_graduation_requirements_controller.rb @@ -15,19 +15,31 @@ class Ecs::EcGraduationRequirementsController < Ecs::BaseController end def create - graduation_requirement = current_year.graduation_requirements.new + graduation_requirement = current_year.ec_graduation_requirements.new @graduation_requirement = Ecs::SaveGraduationRequirementeService.call(graduation_requirement, create_params) render 'show' end def update - graduation_requirement = current_year.graduation_requirements.find(params[:id]) - @graduation_requirement = Ecs::SaveGraduationRequirementeService.call(graduation_requirement, update_params) + @graduation_requirement = Ecs::SaveGraduationRequirementeService.call(current_graduation_requirement, update_params) render 'show' end + def destroy + ActiveRecord::Base.transaction do + current_graduation_requirement.destroy! + current_year.ec_graduation_requirements.where('position > ?', current_graduation_requirement.position) + .update_all('position = position - 1') + end + render_ok + end + private + def current_graduation_requirement + @_current_graduation_requirement ||= current_year.ec_graduation_requirements.find(params[:id]) + end + def create_params params.permit(:position, :content, graduation_subitems: [:content]) end diff --git a/app/models/ec_graduation_requirement.rb b/app/models/ec_graduation_requirement.rb index d0f4195d0..f9c65e28e 100644 --- a/app/models/ec_graduation_requirement.rb +++ b/app/models/ec_graduation_requirement.rb @@ -1,4 +1,6 @@ class EcGraduationRequirement < ApplicationRecord + default_scope { order(position: :asc) } + belongs_to :ec_year has_many :ec_graduation_subitems, dependent: :destroy @@ -7,5 +9,5 @@ class EcGraduationRequirement < ApplicationRecord validates :position, presence: true, numericality: { only_integer: true, greater_than: 0 } validates :content, presence: true - default_scope { order(position: :asc) } + accepts_nested_attributes_for :ec_graduation_subitems, allow_destroy: true end diff --git a/app/views/ecs/ec_graduation_requirements/index.json.jbuilder b/app/views/ecs/ec_graduation_requirements/index.json.jbuilder index 6fbbf249b..ffb83ed23 100644 --- a/app/views/ecs/ec_graduation_requirements/index.json.jbuilder +++ b/app/views/ecs/ec_graduation_requirements/index.json.jbuilder @@ -1,3 +1,3 @@ json.count @graduation_requirements.size -json.graduation_requirements @graduation_requirements, partial: 'shared/ec_graduation_requirement', as: :ec_graduation_requirement +json.graduation_requirements @graduation_requirements, partial: '/ecs/ec_graduation_requirements/shared/ec_graduation_requirement', as: :ec_graduation_requirement diff --git a/app/views/ecs/ec_graduation_requirements/show.json.jbuilder b/app/views/ecs/ec_graduation_requirements/show.json.jbuilder index 562c255a9..d3a8db1fc 100644 --- a/app/views/ecs/ec_graduation_requirements/show.json.jbuilder +++ b/app/views/ecs/ec_graduation_requirements/show.json.jbuilder @@ -1,2 +1,2 @@ -json.partial! 'shared/ec_graduation_requirement', ec_graduation_requirement: @graduation_requirement +json.partial! 'ecs/ec_graduation_requirements/shared/ec_graduation_requirement', ec_graduation_requirement: @graduation_requirement diff --git a/config/routes.rb b/config/routes.rb index 8098d03c9..f5c1a54d3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -715,7 +715,7 @@ Rails.application.routes.draw do resources :ec_years, only: [] do resource :ec_training_objectives, only: [:show, :create] - resources :ec_graduation_requirements, only: [:index, :create] + resources :ec_graduation_requirements, only: [:index, :create, :update, :destroy] resource :requirement_support_objectives, only: [:show, :create, :destroy] resource :subitem_support_standards, only: [:show, :create, :destroy] resource :students, only: [:show, :destroy] do diff --git a/public/react/src/modules/ecs/EcSetting/GraduationRequirement/index.js b/public/react/src/modules/ecs/EcSetting/GraduationRequirement/index.js index ea46b2604..4ee387a73 100644 --- a/public/react/src/modules/ecs/EcSetting/GraduationRequirement/index.js +++ b/public/react/src/modules/ecs/EcSetting/GraduationRequirement/index.js @@ -1,18 +1,27 @@ import React from 'react'; import PropTypes from "prop-types"; import { Link } from 'react-router-dom'; -import { Spin, Button, Input, Divider, Icon, Tooltip, Form, message } from 'antd'; +import { Spin, Button, Input, Divider, Icon, Tooltip, Form, message, Modal } from 'antd'; import axios from 'axios'; +import _ from 'lodash' import './index.scss'; +const { confirm } = Modal; + class GraduationRequirement extends React.Component { constructor (props) { super(props); this.state = { loading: true, + editIndex: null, + addState: false, + submitState: false, + validateState: false, + currentEditReq: {}, + newRequirement: {}, graduationRequirements: [] } } @@ -24,19 +33,193 @@ class GraduationRequirement extends React.Component { getData = () => { let { yearId } = this.props; + this.setState({ loading: true }); axios.get(`/ec_years/${yearId}/ec_graduation_requirements.json`).then(res => { if(res.status === 200){ this.setState({ - graduationRequirements: res.data.ec_graduation_requirements, + graduationRequirements: res.data.graduation_requirements, loading: false }) } }).catch(e => console.log(e)) } + showDeleteConfirm = (id) => { + if(this.state.editIndex !== null || this.state.addState){ + message.error('请先保存其它内容'); + return + } + confirm({ + title: '确认删除该毕业要求?', + okText: '确认', + cancelText: '取消', + onOk: () => { + this.deleteRequirement(id); + }, + onCancel() {}, + }); + } + + deleteRequirement = (id) => { + let { yearId } = this.props; + let url = `/ec_years/${yearId}/ec_graduation_requirements/${id}.json`; + axios.delete(url).then(res => { + if(res){ + message.success('操作成功'); + this.getData(); + } + }).catch(e => console.log(e)) + } + + showEditContent = (index) => { + let { editIndex, graduationRequirements } = this.state; + if(editIndex !== null){ + message.error('请先保存其它内容'); + return + } + + this.setState({ editIndex: index, currentEditReq: _.cloneDeep(graduationRequirements[index])}) + } + + onEditContentChange = (e) => { + let { currentEditReq } = this.state; + currentEditReq.content = e.target.value; + this.setState({ currentEditReq }); + } + + onEditItemContentChange = (e, index) => { + let { currentEditReq } = this.state; + currentEditReq.ec_graduation_subitems[index].content = e.target.value; + this.setState({ currentEditReq }); + } + + addEditItem = () => { + let { currentEditReq } = this.state; + currentEditReq.ec_graduation_subitems.push({id: null, content: ''}) + this.setState({ currentEditReq }); + } + + removeEditItem = (index) => { + let { currentEditReq } = this.state; + currentEditReq.ec_graduation_subitems.splice(index, 1); + this.setState({ currentEditReq }); + } + + saveContentEdit = () => { + let { currentEditReq } = this.state; + + let contentExist = currentEditReq.content && currentEditReq.content.length !== 0; + let errorItem = currentEditReq.ec_graduation_subitems.find(item => !item.content || item.content.length === 0); + this.setState({ validateState: !!errorItem || !contentExist }); + + if(errorItem || !contentExist){ return } + + this.setState({ submitState: true }, this.updateRequirement); + } + + cancelContentEdit = () => { + this.setState({ currentEditReq: {}, editIndex: null, validateState: false }); + } + + updateRequirement = () => { + let { yearId } = this.props; + let { currentEditReq } = this.state; + + let url = `/ec_years/${yearId}/ec_graduation_requirements/${currentEditReq.id}.json`; + + axios.put(url, { content: currentEditReq.content, position: currentEditReq.position, graduation_subitems: currentEditReq.ec_graduation_subitems }).then(res => { + if(res){ + message.success('操作成功'); + this.setState({ submitState: false, editIndex: null }); + this.getData(); + } + }).catch(e => { + console.log(e); + this.setState({ submitState: false }); + }) + } + + showNewReqContent = () => { + let { editIndex, graduationRequirements } = this.state; + if(editIndex !== null){ + message.error('请先保存其它内容'); + return + } + + this.setState({ + editIndex: -1, addState: true, + newRequirement: { + content: '', position: graduationRequirements.length + 1, + graduation_subitems: [ + { id: null, content: '' }, + { id: null, content: '' }, + { id: null, content: '' }, + ] + } + }) + } + + onNewReqContentChange = (e) => { + let { newRequirement } = this.state; + newRequirement.content = e.target.value; + this.setState({ newRequirement }); + } + + onNewReqItemContentChange = (e, index) => { + let { newRequirement } = this.state; + newRequirement.graduation_subitems[index].content = e.target.value; + this.setState({ newRequirement }); + } + + addNewReqItem = () => { + let { newRequirement } = this.state; + newRequirement.graduation_subitems.push({id: null, content: ''}) + this.setState({ newRequirement }); + } + + removeNewReqItem = (index) => { + let { newRequirement } = this.state; + newRequirement.graduation_subitems.splice(index, 1); + this.setState({ newRequirement }); + } + + saveNewReq = () => { + let { newRequirement } = this.state; + + let contentExist = newRequirement.content && newRequirement.content.length !== 0; + let errorItem = newRequirement.graduation_subitems.find(item => !item.content || item.content.length === 0); + this.setState({ validateState: !!errorItem || !contentExist }); + + if(errorItem || !contentExist){ return } + + this.setState({ submitState: true }, this.createRequirement); + } + + cancelNewReq = () => { + this.setState({ newRequirement: {}, addState: false, editIndex: null, validateState: false }); + } + + createRequirement = () => { + let { yearId } = this.props; + let { newRequirement } = this.state; + + let url = `/ec_years/${yearId}/ec_graduation_requirements.json`; + + axios.post(url, newRequirement).then(res => { + if(res){ + message.success('操作成功'); + this.setState({ submitState: false, editIndex: null, addState: false }); + this.getData(); + } + }).catch(e => { + console.log(e); + this.setState({ submitState: false }); + }) + } + render() { let { can_manager } = this.props.year; - let { loading } = this.state; + let { loading, editIndex, addState, submitState, validateState, currentEditReq, graduationRequirements, newRequirement } = this.state; return (
    @@ -56,6 +239,135 @@ class GraduationRequirement extends React.Component {
    +
    +
    +
    指标点
    +
    内容
    +
    + { + can_manager && !addState && ( + + + + ) + } +
    +
    +
    + { + graduationRequirements && graduationRequirements.map((item, index) => { + return can_manager && index === editIndex ? ( +
    +
    +
    { index + 1 }
    +
    + + + +
    +
    + +
    +
    + { + currentEditReq.ec_graduation_subitems.map((subitem, i) => { + return ( +
    +
    { index + 1 }-{ i + 1 }
    +
    + + this.onEditItemContentChange(e, i)} /> + +
    +
    + this.removeEditItem(i)}/> +
    +
    + ) + }) + } + +
    + + +
    +
    + ) : ( +
    +
    +
    { index + 1 }
    +
    { item.content }
    + { + can_manager && ( +
    + this.showDeleteConfirm(item.id)} /> + this.showEditContent(index)}/> + { + index === graduationRequirements.length - 1 && !addState && ( + + ) + } +
    + ) + } + +
    + { + item.ec_graduation_subitems.map((subitem, i) => { + return ( +
    +
    { index + 1 }-{ i + 1 }
    +
    { subitem.content }
    +
    + ) + }) + } +
    + ) + }) + } + + { + can_manager && addState && ( +
    +
    +
    { graduationRequirements.length + 1 }
    +
    + + + +
    +
    + +
    +
    + { + newRequirement.graduation_subitems.map((subitem, i) => { + return ( +
    +
    { graduationRequirements.length + 1 }-{ i + 1 }
    +
    + + this.onNewReqItemContentChange(e, i)} /> + +
    +
    + this.removeNewReqItem(i)}/> +
    +
    + ) + }) + } + +
    + + +
    +
    + ) + } +
    +
    diff --git a/public/react/src/modules/ecs/EcSetting/GraduationRequirement/index.scss b/public/react/src/modules/ecs/EcSetting/GraduationRequirement/index.scss index e69de29bb..9d740a970 100644 --- a/public/react/src/modules/ecs/EcSetting/GraduationRequirement/index.scss +++ b/public/react/src/modules/ecs/EcSetting/GraduationRequirement/index.scss @@ -0,0 +1,94 @@ +.ec-graduation-requirement-page { + background: #fff; + + .graduation-requirement { + &-body { + margin-top: -24px; + } + + &-items { + &-head { + padding: 15px 30px; + display: flex; + background: #F5F5F5; + } + + &-body { + margin: 0 30px; + + &-item { + padding: 10px 0px; + border-bottom: 1px solid #eaeaea; + + &.active { + .item-row { + margin-bottom: 10px; + align-items: center; + } + + .item-column-operation { + width: 40px; + } + } + + &:last-child { + border-bottom: unset; + } + + .item-head { + margin-bottom: 10px; + font-weight: bold; + } + + .item-row { + display: flex; + } + } + } + + + .no-column { + width: 60px; + text-align: center; + } + + .item-content-column { + flex: 1; + padding-left: 10px; + display: flex; + + .ant-form-item { + flex: 1; + margin-bottom: 0; + } + } + + .item-column-operation { + display: flex; + justify-content: flex-end; + width: 80px; + + & > i { + margin: 0 5px; + font-size: 16px; + cursor: pointer; + } + } + } + } + + .edit-form { + margin-top: 10px; + text-align: right; + + button { + margin-left: 10px; + } + } + + i.edit-action { + color: #29BD8B; + cursor: pointer; + font-size: 16px; + } +} \ No newline at end of file diff --git a/public/react/src/modules/ecs/EcSetting/TrainingObjective/index.js b/public/react/src/modules/ecs/EcSetting/TrainingObjective/index.js index 859b987ee..e48cf2c84 100644 --- a/public/react/src/modules/ecs/EcSetting/TrainingObjective/index.js +++ b/public/react/src/modules/ecs/EcSetting/TrainingObjective/index.js @@ -198,7 +198,7 @@ class TrainingObjective extends React.Component {
    目标分解详情
    { - itemsEditState || ( + !can_manager || itemsEditState || ( diff --git a/public/react/src/modules/ecs/EcSetting/index.js b/public/react/src/modules/ecs/EcSetting/index.js index 238d8474c..4f27acb2a 100644 --- a/public/react/src/modules/ecs/EcSetting/index.js +++ b/public/react/src/modules/ecs/EcSetting/index.js @@ -10,6 +10,7 @@ import CustomLoadable from "../../../CustomLoadable"; const { Step } = Steps; const TrainingObjective = CustomLoadable(() => import('./TrainingObjective/index')) +const GraduationRequirement = CustomLoadable(() => import('./GraduationRequirement/index')) const steps = ["培养目标", "毕业要求", "培养目标VS毕业要求", "毕业要求VS通用标准", "学生", "课程体系", "课程体系VS毕业要求", "达成度评价结果"]; const stepTypes = ["training_objectives", "graduation_requirement", "requirement_vs_objective", "requirement_vs_standard", "students", "courses", "requirement_vs_courses", "reach_calculation_info"]; @@ -98,6 +99,8 @@ class EcSetting extends React.Component { () }> + () }> ) } From 7fdc9df090f598c73fb2230e463a0c99f0f830d1 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 17 Sep 2019 10:25:36 +0800 Subject: [PATCH 74/79] path --- public/react/src/modules/tpm/challengesnew/TPMMDEditor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js index ba4f1bc21..3c4b48fc0 100644 --- a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js +++ b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js @@ -16,8 +16,8 @@ require('codemirror/lib/codemirror.css'); let origin = getUrl(); -let path = getUrl("/editormd/lib/") - +let path = '/editormd/lib/' + path = getUrl("/editormd/lib/") const $ = window.$; let timeout; From c8abe26abb0b7ce627a19921cd21d1ee4593c12d Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 17 Sep 2019 10:29:42 +0800 Subject: [PATCH 75/79] s --- public/react/src/common/util/ShareUtil.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/react/src/common/util/ShareUtil.js b/public/react/src/common/util/ShareUtil.js index 4e6c06d59..e591effaf 100644 --- a/public/react/src/common/util/ShareUtil.js +++ b/public/react/src/common/util/ShareUtil.js @@ -63,11 +63,11 @@ function requestForSignatrue (callback) { export function configShareForIndex (path) { requestForSignatrue(() => { var shareData = { - title: 'EduCoder - 首页', - desc: 'Educoder是一个面向计算机类的互联网IT教育和实战平台,提供企业级工程实训,以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动,将传统的知识传授和时兴的工程实战一体化。', - link: host + (path || ''), - imgUrl: window.__testImageUrl - || host + '/react/build/images/share_logo_icon.jpg' + title: 'EduCoder - 首页', + desc: 'Educoder是一个面向计算机类的互联网IT教育和实战平台,提供企业级工程实训,以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动,将传统的知识传授和时兴的工程实战一体化。', + link: host + (path || ''), + imgUrl: window.__testImageUrl + || host + '/react/build/images/share_logo_icon.jpg' }; share(shareData) }) From d01666c793f0a4e4eed8d90dc4dfd4e6c52ffbdb Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 17 Sep 2019 10:29:57 +0800 Subject: [PATCH 76/79] =?UTF-8?q?=E5=85=89=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/challengesnew/TPMMDEditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js index 3c4b48fc0..c4a08e171 100644 --- a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js +++ b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js @@ -171,7 +171,7 @@ function create_editorMD(id, width, high, placeholder, imageUrl, callback, initV $("#" + _id + " [type=\"inline\"]").bind("click", function () { _editorName.cm.replaceSelection("`$$$$`"); var __Cursor = _editorName.cm.getDoc().getCursor(); - _editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2); + _editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 3); _editorName.cm.focus(); }); $("[type=\"inline\"]").attr("title", "行内公式"); From 27b9217fc8fcf30900a1f6e320781a4eb9da2d85 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 17 Sep 2019 10:54:31 +0800 Subject: [PATCH 77/79] =?UTF-8?q?marked=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/editormd/lib/marked.min.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/public/editormd/lib/marked.min.js b/public/editormd/lib/marked.min.js index 4db085adb..88ec3e856 100644 --- a/public/editormd/lib/marked.min.js +++ b/public/editormd/lib/marked.min.js @@ -10,7 +10,5 @@ out+=this.renderer.em(this.output(cap[2]||cap[1])) --> out+=this.renderer.em(this.output(cap[2]||cap[1]), cap.input) */ -(function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,block._tag)();block.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/});block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top,bq){var src=src.replace(/^ +$/gm,""),next,loose,cap,bull,b,item,space,i,l;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i ?/gm,"");this.token(cap,top,true);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:"list_start",ordered:bull.length>1});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose){loose=next}}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false,bq); -this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:cap[1]==="pre"||cap[1]==="script"||cap[1]==="style",text:cap[0]});continue}if((!bq&&top)&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={href:cap[2],title:cap[3]};continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)();inline.reflink=replace(inline.reflink)("inside",inline._inside)();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else{if(this.options.pedantic){this.rules=inline.pedantic}}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=cap[1].charAt(6)===":"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle("mailto:")+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){src=src.substring(cap[0].length);text=escape(cap[1]);href=text;out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^/i.test(cap[0])){this.inLink=false}}src=src.substring(cap[0].length);out+=this.options.sanitize?escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]), cap.input);continue -}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2],true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=escape(this.smartypants(cap[0]));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants){return text}return text.replace(/--/g,"\u2014").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201c").replace(/"/g,"\u201d").replace(/\.{3}/g,"\u2026")};InlineLexer.prototype.mangle=function(text){var out="",l=text.length,i=0,ch;for(;i0.5){ch="x"+ch.toString(16)}out+="&#"+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return"
    "+(escaped?code:escape(code,true))+"\n
    "}return'
    '+(escaped?code:escape(code,true))+"\n
    \n"};Renderer.prototype.blockquote=function(quote){return"
    \n"+quote+"
    \n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"'+text+"\n"};Renderer.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"};Renderer.prototype.list=function(body,ordered){var type=ordered?"ol":"ul";return"<"+type+">\n"+body+"\n"};Renderer.prototype.listitem=function(text){return"
  • "+text+"
  • \n"};Renderer.prototype.paragraph=function(text){return"

    "+text+"

    \n"};Renderer.prototype.table=function(header,body){return"
    \n"+"\n"+header+"\n"+"\n"+body+"\n"+"
    \n"};Renderer.prototype.tablerow=function(content){return"\n"+content+"\n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+"\n"};Renderer.prototype.strong=function(text){return""+text+""};Renderer.prototype.em=function(text){return""+text+""};Renderer.prototype.codespan=function(text){return""+text+""};Renderer.prototype.br=function(){return this.options.xhtml?"
    ":"
    "};Renderer.prototype.del=function(text){return""+text+""};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(prot.indexOf("javascript:")===0||prot.indexOf("vbscript:")===0){return""}}var out='
    ";return out};Renderer.prototype.image=function(href,title,text){var out=''+text+'":">";return out};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var header="",body="",i,row,cell,flags,j;cell="";for(i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&([#\w]+);/g,function(_,n){n=n.toLowerCase();if(n==="colon"){return":"}if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function replace(regex,opt){regex=regex.source;opt=opt||"";return function self(name,val){if(!name){return new RegExp(regex,opt)}val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return self}}function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;iAn error occured:

    "+escape(e.message+"",true)+"
    "}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else{if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); +// 0.4.0 /^ *(#{1,6}) ——》/^ *(#{1,6}) 去掉了一个空格 TODO 行内公式带_ +!function(e){"use strict";var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:d,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6})*([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:d,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)|(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:d,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links={},this.options=e||m.defaults,this.rules=t.normal,this.options.pedantic?this.rules=t.pedantic:this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,t.def=p(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=p(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=p(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",t._comment=//,t.html=p(t.html,"i").replace("comment",t._comment).replace("tag",t._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag",t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=f({},t),t.gfm=f({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6})+([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=f({},t.gfm,{nptable:/^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,table:/^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/}),t.pedantic=f({},t.normal,{html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",t._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c,g,d,f;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))&&(a={type:"table",header:b(i[1].replace(/^ *| *\| *$/g,"")),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3]?i[3].replace(/\n$/,"").split("\n"):[]}).header.length===a.align.length){for(e=e.substring(i[0].length),p=0;p ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),g=(l=i[2]).length>1,this.tokens.push({type:"list_start",ordered:g,start:g?+l:""}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),f=void 0,(d=/^\[[ xX]\] /.test(a))&&(f=" "!==a[1],a=a.replace(/^\[[ xX]\] +/,"")),this.tokens.push({type:s?"loose_item_start":"list_item_start",task:d,checked:f}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(e))&&(a={type:"table",header:b(i[1].replace(/^ *| *\| *$/g,"")),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3]?i[3].replace(/(?: *\| *)?\n$/,"").split("\n"):[]}).header.length===a.align.length){for(e=e.substring(i[0].length),p=0;p?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:d,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)|^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)/,em:/^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*][\s\S]*?[^\s])\*(?!\*)|^_([^\s_])_(?!_)|^\*([^\s*])\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:d,text:/^[\s\S]+?(?=[\\/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source||e,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=e.replace(/[^/]*$/,"")),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,r.tag=p(r.tag).replace("comment",t._comment).replace("attribute",r._attribute).getRegex(),r._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/,r._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f()\\]*\)|[^\s\x00-\x1f()\\])*?)/,r._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,r.link=p(r.link).replace("label",r._label).replace("href",r._href).replace("title",r._title).getRegex(),r.reflink=p(r.reflink).replace("label",r._label).getRegex(),r.normal=f({},r),r.pedantic=f({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",r._label).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",r._label).getRegex()}),r.gfm=f({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=f({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,i,l,o="";e;)if(l=this.rules.escape.exec(e))e=e.substring(l[0].length),o+=l[1];else if(l=this.rules.autolink.exec(e))e=e.substring(l[0].length),r="@"===l[2]?"mailto:"+(n=a(this.mangle(l[1]))):n=a(l[1]),o+=this.renderer.link(r,null,n);else if(this.inLink||!(l=this.rules.url.exec(e))){if(l=this.rules.tag.exec(e))!this.inLink&&/^
    /i.test(l[0])&&(this.inLink=!1),e=e.substring(l[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(l[0]):a(l[0]):l[0];else if(l=this.rules.link.exec(e))e=e.substring(l[0].length),this.inLink=!0,r=l[2],this.options.pedantic?(t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r))?(r=t[1],i=t[3]):i="":i=l[3]?l[3].slice(1,-1):"",r=r.trim().replace(/^<([\s\S]*)>$/,"$1"),o+=this.outputLink(l,{href:s.escapes(r),title:s.escapes(i)}),this.inLink=!1;else if((l=this.rules.reflink.exec(e))||(l=this.rules.nolink.exec(e))){if(e=e.substring(l[0].length),t=(l[2]||l[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=l[0].charAt(0),e=l[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(l,t),this.inLink=!1}else if(l=this.rules.strong.exec(e))e=e.substring(l[0].length),o+=this.renderer.strong(this.output(l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.em.exec(e))e=e.substring(l[0].length),o+=this.renderer.em(this.output(l[6]||l[5]||l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.code.exec(e))e=e.substring(l[0].length),o+=this.renderer.codespan(a(l[2].trim(),!0));else if(l=this.rules.br.exec(e))e=e.substring(l[0].length),o+=this.renderer.br();else if(l=this.rules.del.exec(e))e=e.substring(l[0].length),o+=this.renderer.del(this.output(l[1]));else if(l=this.rules.text.exec(e))e=e.substring(l[0].length),o+=this.renderer.text(a(this.smartypants(l[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else l[0]=this.rules._backpedal.exec(l[0])[0],e=e.substring(l[0].length),"@"===l[2]?r="mailto:"+(n=a(l[0])):(n=a(l[0]),r="www."===l[1]?"http://"+n:n),o+=this.renderer.link(r,null,n);return o},s.escapes=function(e){return e?e.replace(s.rules._escapes,"$1"):e},s.prototype.outputLink=function(e,t){var n=t.href,r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:a(e,!0))+"
    \n":"
    "+(n?e:a(e,!0))+"
    "},i.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return this.options.headerIds?"'+e+"\n":""+e+"\n"},i.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},i.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},i.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},i.prototype.checkbox=function(e){return" "},i.prototype.paragraph=function(e){return"

    "+e+"

    \n"},i.prototype.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},i.prototype.tablerow=function(e){return"\n"+e+"\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"},i.prototype.strong=function(e){return""+e+""},i.prototype.em=function(e){return""+e+""},i.prototype.codespan=function(e){return""+e+""},i.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},i.prototype.del=function(e){return""+e+""},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return n}var s='
    "},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r=''+n+'":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,f({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;et)n.splice(t);else for(;n.lengthAn error occurred:

    "+a(e.message+"",!0)+"
    ";throw e}}d.exec=d,m.options=m.setOptions=function(e){return f(m.defaults,e),m},m.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:new i,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},m.defaults=m.getDefaults(),m.Parser=o,m.parser=o.parse,m.Renderer=i,m.TextRenderer=l,m.Lexer=n,m.lexer=n.lex,m.InlineLexer=s,m.inlineLexer=s.output,m.parse=m,"undefined"!=typeof module&&"object"==typeof exports?module.exports=m:"function"==typeof define&&define.amd?define(function(){return m}):e.marked=m}(this||("undefined"!=typeof window?window:global)); From 3eb054ef2bb4c96a21eedfdae42eda9e7b629ae1 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Tue, 17 Sep 2019 14:07:02 +0800 Subject: [PATCH 78/79] ecs: fix export xlsx error --- .../average_score_import_template.xlsx.axlsx | 2 +- app/views/ecs/course_targets/index.xlsx.axlsx | 2 +- .../ec_graduation_requirements/index.xlsx.axlsx | 15 +++++++++------ .../graduation_course_supports/show.xlsx.axlsx | 2 +- app/views/ecs/reach_evaluations/show.xlsx.axlsx | 2 +- .../show.xlsx.axlsx | 2 +- .../ecs/subitem_support_standards/show.xlsx.axlsx | 2 +- 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/app/views/ecs/course_evaluations/average_score_import_template.xlsx.axlsx b/app/views/ecs/course_evaluations/average_score_import_template.xlsx.axlsx index 900ff5888..934e1c4be 100644 --- a/app/views/ecs/course_evaluations/average_score_import_template.xlsx.axlsx +++ b/app/views/ecs/course_evaluations/average_score_import_template.xlsx.axlsx @@ -13,7 +13,7 @@ wb.styles do |style| name = course_evaluation.name items_size = course_evaluation.ec_course_evaluation_subitems.count - sheet.add_row name, style: bg_style + sheet.add_row [name], style: bg_style sheet.merge_cells wb.rows.first.cells[(1..(items_size * course_evaluation.evaluation_count))] data = [] diff --git a/app/views/ecs/course_targets/index.xlsx.axlsx b/app/views/ecs/course_targets/index.xlsx.axlsx index a188ad95c..ef4215b03 100644 --- a/app/views/ecs/course_targets/index.xlsx.axlsx +++ b/app/views/ecs/course_targets/index.xlsx.axlsx @@ -15,7 +15,7 @@ wb.styles do |style| name = "#{@_current_course.name}课程目标" wb.add_worksheet(name: name) do |sheet| - sheet.add_row name, style: title_style + sheet.add_row [name], style: title_style sheet.add_row [] sheet.add_row [] diff --git a/app/views/ecs/ec_graduation_requirements/index.xlsx.axlsx b/app/views/ecs/ec_graduation_requirements/index.xlsx.axlsx index aeb802329..9a2081861 100644 --- a/app/views/ecs/ec_graduation_requirements/index.xlsx.axlsx +++ b/app/views/ecs/ec_graduation_requirements/index.xlsx.axlsx @@ -6,15 +6,15 @@ wb = xlsx_package.workbook wb.styles do |style| title_style = style.add_style(sz: 16, height: 20, b: true) ec_year_style = style.add_style(sz: 10, height: 14) - label_style = style.add_style(sz: 11, b: true, bg_color: '90EE90', alignment: { horizontal: :center }) + label_style = style.add_style(sz: 11, b: true, bg_color: '90EE90', alignment: { horizontal: :center, vertical: :center }) content_style = style.add_style(sz: 11, height: 16, border: { style: :thin, color: '000000' }) wb.add_worksheet(:name => '毕业要求及指标点') do |sheet| - sheet.add_row '毕业要求及指标点', style: title_style + sheet.add_row ['毕业要求及指标点'], style: title_style sheet.add_row [] - sheet.add_row ['专业代码', major.code], style: ec_year_style + sheet.add_row ['专业代码', major.code.to_s + ' '], style: ec_year_style sheet.add_row ['专业名称', major.name], style: ec_year_style sheet.add_row ['学年', "#{ec_year.year}学年"], style: ec_year_style @@ -32,12 +32,15 @@ wb.styles do |style| end items_size = requirement.ec_graduation_subitems.size - sheet.merge_cells("A#{index}:A#{index + items_size}") - sheet.merge_cells("B#{index}:B#{index + items_size}") + if items_size.zero? + sheet.add_row [requirement_content, ''], style: content_style + else + sheet.merge_cells("A#{index + 1}:A#{index + items_size}") + end index += items_size end - sheet.column_widths [400, 400] + sheet.column_widths 100, 100 end end \ No newline at end of file diff --git a/app/views/ecs/graduation_course_supports/show.xlsx.axlsx b/app/views/ecs/graduation_course_supports/show.xlsx.axlsx index fd1a44935..e2c2599ec 100644 --- a/app/views/ecs/graduation_course_supports/show.xlsx.axlsx +++ b/app/views/ecs/graduation_course_supports/show.xlsx.axlsx @@ -14,7 +14,7 @@ wb.styles do |style| tip_style = style.add_style(sz: 11, height: 16, color: 'FFA07A') wb.add_worksheet(:name => '课程体系对毕业要求的支撑') do |sheet| - sheet.add_row '课程体系VS毕业要求', style: title_style + sheet.add_row ['课程体系VS毕业要求'], style: title_style sheet.merge_cells wb.rows.first.cells[(1..(3 + max_support_length - 1))] sheet.add_row [] diff --git a/app/views/ecs/reach_evaluations/show.xlsx.axlsx b/app/views/ecs/reach_evaluations/show.xlsx.axlsx index a62e4f6c2..a79d059a3 100644 --- a/app/views/ecs/reach_evaluations/show.xlsx.axlsx +++ b/app/views/ecs/reach_evaluations/show.xlsx.axlsx @@ -10,7 +10,7 @@ wb.styles do |style| content_style = style.add_style(sz: 11, height: 16, border: { style: :thin, color: '000000' }) wb.add_worksheet(name: '达成度-毕业要求综合评价报表') do |sheet| - sheet.add_row '培养目标及目标分解', style: title_style + sheet.add_row ['达成度-毕业要求综合评价报表'], style: title_style sheet.merge_cells("A1:D1") sheet.add_row [] diff --git a/app/views/ecs/requirement_support_objectives/show.xlsx.axlsx b/app/views/ecs/requirement_support_objectives/show.xlsx.axlsx index 934ad2941..6534ce36a 100644 --- a/app/views/ecs/requirement_support_objectives/show.xlsx.axlsx +++ b/app/views/ecs/requirement_support_objectives/show.xlsx.axlsx @@ -16,7 +16,7 @@ wb.styles do |style| content_style = style.add_style(sz: 11, height: 16, border: { style: :thin, color: '000000' }) wb.add_worksheet(:name => '毕业要求对培养目标的支撑') do |sheet| - sheet.add_row '毕业要求 vs 培养目标矩阵', style: title_style + sheet.add_row ['毕业要求 vs 培养目标矩阵'], style: title_style sheet.merge_cells wb.rows.first.cells[(1..subitem_size)] diff --git a/app/views/ecs/subitem_support_standards/show.xlsx.axlsx b/app/views/ecs/subitem_support_standards/show.xlsx.axlsx index e12f517f3..8329a27ee 100644 --- a/app/views/ecs/subitem_support_standards/show.xlsx.axlsx +++ b/app/views/ecs/subitem_support_standards/show.xlsx.axlsx @@ -17,7 +17,7 @@ wb.styles do |style| content_style = style.add_style(sz: 11, height: 16, border: { style: :thin, color: '000000' }) wb.add_worksheet(:name => '毕业要求对通用标准的支撑') do |sheet| - sheet.add_row '毕业要求 vs 通用标准矩阵', style: title_style + sheet.add_row ['毕业要求 vs 通用标准矩阵'], style: title_style sheet.merge_cells wb.rows.first.cells[(1..standards_size)] From d61e24d42376312add66a26944099a582a2122ef Mon Sep 17 00:00:00 2001 From: p31729568 Date: Tue, 17 Sep 2019 14:20:30 +0800 Subject: [PATCH 79/79] ecs: fix api view render error --- app/views/ecs/course_evaluations/index.json.jbuilder | 2 +- app/views/ecs/course_evaluations/show.json.jbuilder | 2 +- app/views/ecs/course_evaluations/slimmer.json.jbuilder | 2 +- app/views/ecs/course_targets/index.json.jbuilder | 2 +- app/views/ecs/ec_courses/search.json.jbuilder | 2 +- app/views/ecs/graduation_course_supports/create.json.jbuilder | 2 +- app/views/ecs/graduation_course_supports/show.json.jbuilder | 2 +- app/views/ecs/requirement_support_objectives/show.json.jbuilder | 2 +- app/views/ecs/score_levels/show.json.jbuilder | 2 +- app/views/ecs/students/show.json.jbuilder | 2 +- app/views/ecs/subitem_support_standards/show.json.jbuilder | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/views/ecs/course_evaluations/index.json.jbuilder b/app/views/ecs/course_evaluations/index.json.jbuilder index e1c63d44d..b120bccc2 100644 --- a/app/views/ecs/course_evaluations/index.json.jbuilder +++ b/app/views/ecs/course_evaluations/index.json.jbuilder @@ -1 +1 @@ -json.course_evaluations @course_evaluations, partial: 'shared/ec_course_evaluation', as: :ec_course_evaluation +json.course_evaluations @course_evaluations, partial: 'ecs/course_evaluations/shared/ec_course_evaluation', as: :ec_course_evaluation diff --git a/app/views/ecs/course_evaluations/show.json.jbuilder b/app/views/ecs/course_evaluations/show.json.jbuilder index b03ddc076..f67053183 100644 --- a/app/views/ecs/course_evaluations/show.json.jbuilder +++ b/app/views/ecs/course_evaluations/show.json.jbuilder @@ -1 +1 @@ -json.partial! 'shared/ec_course_evaluation', ec_course_evaluation: @course_evaluation +json.partial! 'ecs/course_evaluations/shared/ec_course_evaluation', ec_course_evaluation: @course_evaluation diff --git a/app/views/ecs/course_evaluations/slimmer.json.jbuilder b/app/views/ecs/course_evaluations/slimmer.json.jbuilder index 929cfe7be..6e0faef3e 100644 --- a/app/views/ecs/course_evaluations/slimmer.json.jbuilder +++ b/app/views/ecs/course_evaluations/slimmer.json.jbuilder @@ -1 +1 @@ -json.course_evaluations @course_evaluations, partial: 'shared/ec_course_evaluation_slim', as: :ec_course_evaluation +json.course_evaluations @course_evaluations, partial: 'ecs/course_evaluations/shared/ec_course_evaluation_slim', as: :ec_course_evaluation diff --git a/app/views/ecs/course_targets/index.json.jbuilder b/app/views/ecs/course_targets/index.json.jbuilder index 6590ecc10..9ec4af823 100644 --- a/app/views/ecs/course_targets/index.json.jbuilder +++ b/app/views/ecs/course_targets/index.json.jbuilder @@ -1,2 +1,2 @@ -json.course_targets @course_targets, partial: 'shared/course_target', as: :ec_course_target +json.course_targets @course_targets, partial: 'ecs/course_targets/shared/course_target', as: :ec_course_target diff --git a/app/views/ecs/ec_courses/search.json.jbuilder b/app/views/ecs/ec_courses/search.json.jbuilder index fc22586d7..cf00a2b98 100644 --- a/app/views/ecs/ec_courses/search.json.jbuilder +++ b/app/views/ecs/ec_courses/search.json.jbuilder @@ -1,2 +1,2 @@ json.count @count -json.ec_courses @ec_courses, partial: 'shared/ec_course_slim', as: :ec_course \ No newline at end of file +json.ec_courses @ec_courses, partial: 'ecs/ec_courses/shared/ec_course_slim', as: :ec_course \ No newline at end of file diff --git a/app/views/ecs/graduation_course_supports/create.json.jbuilder b/app/views/ecs/graduation_course_supports/create.json.jbuilder index c05024911..d8749a5dc 100644 --- a/app/views/ecs/graduation_course_supports/create.json.jbuilder +++ b/app/views/ecs/graduation_course_supports/create.json.jbuilder @@ -1 +1 @@ -json.partial! 'shared/ec_graduation_subitem', ec_graduation_subitem: @graduation_subitem +json.partial! 'ecs/graduation_course_supports/shared/ec_graduation_subitem', ec_graduation_subitem: @graduation_subitem diff --git a/app/views/ecs/graduation_course_supports/show.json.jbuilder b/app/views/ecs/graduation_course_supports/show.json.jbuilder index a9e4bdc22..495f9c6a9 100644 --- a/app/views/ecs/graduation_course_supports/show.json.jbuilder +++ b/app/views/ecs/graduation_course_supports/show.json.jbuilder @@ -1,3 +1,3 @@ json.course_count @course_count -json.graduation_subitems @graduation_subitems, partial: 'shared/ec_graduation_subitem', as: :ec_graduation_subitem +json.graduation_subitems @graduation_subitems, partial: 'ecs/graduation_course_supports/shared/ec_graduation_subitem', as: :ec_graduation_subitem json.count @graduation_subitems.size diff --git a/app/views/ecs/requirement_support_objectives/show.json.jbuilder b/app/views/ecs/requirement_support_objectives/show.json.jbuilder index 1ba783304..642a5f10c 100644 --- a/app/views/ecs/requirement_support_objectives/show.json.jbuilder +++ b/app/views/ecs/requirement_support_objectives/show.json.jbuilder @@ -1,4 +1,4 @@ json.graduation_requirements @graduation_requirements, partial: 'ecs/ec_graduation_requirements/shared/ec_graduation_requirement', as: :ec_graduation_requirement json.training_subitems @training_subitems, partial: 'ecs/ec_training_subitems/shared/ec_training_subitem', as: :ec_training_subitem -json.requirement_support_objectives @requirement_support_objectives, partial: 'shared/requirement_support_objective', as: :requirement_support_objective +json.requirement_support_objectives @requirement_support_objectives, partial: 'ecs/requirement_support_objectives/shared/requirement_support_objective', as: :requirement_support_objective diff --git a/app/views/ecs/score_levels/show.json.jbuilder b/app/views/ecs/score_levels/show.json.jbuilder index 0c8b76d86..dcdf63cdc 100644 --- a/app/views/ecs/score_levels/show.json.jbuilder +++ b/app/views/ecs/score_levels/show.json.jbuilder @@ -1 +1 @@ -json.score_levels @score_levels, partial: 'shared/ec_score_level', as: :ec_score_level +json.score_levels @score_levels, partial: 'ecs/score_levels/shared/ec_score_level', as: :ec_score_level diff --git a/app/views/ecs/students/show.json.jbuilder b/app/views/ecs/students/show.json.jbuilder index 352970055..468a1cfe3 100644 --- a/app/views/ecs/students/show.json.jbuilder +++ b/app/views/ecs/students/show.json.jbuilder @@ -1,2 +1,2 @@ json.count @count -json.students @students, partial: 'shared/ec_year_student', as: :ec_year_student \ No newline at end of file +json.students @students, partial: 'ecs/students/shared/ec_year_student', as: :ec_year_student \ No newline at end of file diff --git a/app/views/ecs/subitem_support_standards/show.json.jbuilder b/app/views/ecs/subitem_support_standards/show.json.jbuilder index 94fd6c5a0..a92fe7000 100644 --- a/app/views/ecs/subitem_support_standards/show.json.jbuilder +++ b/app/views/ecs/subitem_support_standards/show.json.jbuilder @@ -1,4 +1,4 @@ json.graduation_standards @graduation_standards, partial: 'ecs/shared/ec_graduation_standard', as: :ec_graduation_standard json.graduation_subitems @graduation_subitems, partial: 'ecs/shared/ec_graduation_subitem', as: :ec_graduation_subitem -json.subitem_support_standards @subitem_support_standards, partial: 'shared/subitem_support_standard', as: :subitem_support_standard +json.subitem_support_standards @subitem_support_standards, partial: 'ecs/subitem_support_standards/shared/subitem_support_standard', as: :subitem_support_standard