From e6935b934bdf7b3c19166108e581be4c8540ab3c Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 12 Mar 2020 16:07:53 +0800 Subject: [PATCH 01/88] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=AD=BE=E5=88=B0=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 54 ++++++++++--------- app/models/course.rb | 6 ++- ...2075912_add_attendance_to_course_module.rb | 16 ++++++ 3 files changed, 49 insertions(+), 27 deletions(-) create mode 100644 db/migrate/20200312075912_add_attendance_to_course_module.rb diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 27444b3c9..9a4366528 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -81,6 +81,8 @@ module CoursesHelper "/classrooms/#{course.id}/statistics" when "video" "/classrooms/#{course.id}/course_videos" + when "attendance" + "/classrooms/#{course.id}/signin" end end @@ -131,31 +133,33 @@ module CoursesHelper # 课堂模块的任务数 def course_task_count(course, module_type) case module_type - when "shixun_homework" - get_homework_commons_count(course, 4, 0) - when "common_homework" - get_homework_commons_count(course, 1, 0) - when "group_homework" - get_homework_commons_count(course, 3, 0) - when "graduation" - 0 - when "exercise" - course.exercises_count - when "poll" - course.polls_count - when "attachment" - get_attachment_count(course, 0) - when "board" - course_board = course.course_board - course_board.present? ? course_board.messages.size : 0 - when "course_group" - course.course_groups_count - when "announcement" - course.informs.count - when "online_learning" - course.shixuns.count - when "video" - course.videos_count + course.live_links.count + when "shixun_homework" + get_homework_commons_count(course, 4, 0) + when "common_homework" + get_homework_commons_count(course, 1, 0) + when "group_homework" + get_homework_commons_count(course, 3, 0) + when "graduation" + 0 + when "exercise" + course.exercises_count + when "poll" + course.polls_count + when "attachment" + get_attachment_count(course, 0) + when "board" + course_board = course.course_board + course_board.present? ? course_board.messages.size : 0 + when "course_group" + course.course_groups_count + when "announcement" + course.informs.count + when "online_learning" + course.shixuns.count + when "video" + course.videos_count + course.live_links.count + when "attendance" + course.attendances.count end end diff --git a/app/models/course.rb b/app/models/course.rb index abe17b3cd..bd36e65eb 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -226,7 +226,7 @@ class Course < ApplicationRecord end def all_course_module_types - %w[activity announcement online_learning shixun_homework common_homework group_homework exercise attachment course_group graduation poll board statistics video] + %w[activity announcement online_learning shixun_homework common_homework group_homework exercise attachment course_group graduation poll board statistics video attendance] end def get_course_module_by_type(type) @@ -429,6 +429,7 @@ class Course < ApplicationRecord when 'video' then '视频直播' when 'board' then '讨论' when 'course_group' then '分班' + when 'attendance' then '签到' when 'statistics' then '统计' else '' end @@ -449,7 +450,8 @@ class Course < ApplicationRecord when 'video' then 11 when 'board' then 12 when 'course_group' then 13 - when 'statistics' then 14 + when 'attendance' then 14 + when 'statistics' then 15 else 100 end end diff --git a/db/migrate/20200312075912_add_attendance_to_course_module.rb b/db/migrate/20200312075912_add_attendance_to_course_module.rb new file mode 100644 index 000000000..02bb48fe1 --- /dev/null +++ b/db/migrate/20200312075912_add_attendance_to_course_module.rb @@ -0,0 +1,16 @@ +class AddAttendanceToCourseModule < ActiveRecord::Migration[5.2] + def change + Course.all.each do |course| + unless course.course_modules.exists?(module_type: "attendance") + atta_position = course.course_modules.find_by(module_type: 'course_group')&.position.to_i + attendance_position = atta_position != 0 ? (atta_position + 1) : 14 + course.course_modules.where("position >= #{attendance_position}").update_all("position = position + 1") + if course.is_end + course.course_modules << CourseModule.new(module_type: "attendance", hidden: 1, module_name: "签到", position: attendance_position) + else + course.course_modules << CourseModule.new(module_type: "attendance", hidden: 0, module_name: "签到", position: attendance_position) + end + end + end + end +end From 7a803e23974722ab42444b6cbfbe659dacdc3ef8 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 12 Mar 2020 16:11:58 +0800 Subject: [PATCH 02/88] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=AD=BE=E5=88=B0=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 9a4366528..99925505f 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -159,7 +159,7 @@ module CoursesHelper when "video" course.videos_count + course.live_links.count when "attendance" - course.attendances.count + course.course_attendances.count end end From 9e6a6a902b3dac48c53b74bd1b177bbe4f3d87e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 12 Mar 2020 17:39:46 +0800 Subject: [PATCH 03/88] =?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/Index.js | 2 +- .../src/modules/courses/ListPageIndex.js | 39 +++++++- .../modules/courses/signin/css/signincdi.css | 97 +++++++++++++++++++ .../courses/signin/mymain/Signinmain.js | 37 +++++++ .../courses/signin/student/Students_signin.js | 53 ++++++++++ .../courses/signin/teacher/Teachers_signin.js | 56 +++++++++++ 6 files changed, 281 insertions(+), 3 deletions(-) create mode 100644 public/react/src/modules/courses/signin/css/signincdi.css create mode 100644 public/react/src/modules/courses/signin/mymain/Signinmain.js create mode 100644 public/react/src/modules/courses/signin/student/Students_signin.js create mode 100644 public/react/src/modules/courses/signin/teacher/Teachers_signin.js diff --git a/public/react/src/modules/courses/Index.js b/public/react/src/modules/courses/Index.js index eef17f420..69c8b16ea 100644 --- a/public/react/src/modules/courses/Index.js +++ b/public/react/src/modules/courses/Index.js @@ -843,7 +843,7 @@ class CoursesIndex extends Component{ (props) => () } > - () } diff --git a/public/react/src/modules/courses/ListPageIndex.js b/public/react/src/modules/courses/ListPageIndex.js index d95ed6739..895dae020 100644 --- a/public/react/src/modules/courses/ListPageIndex.js +++ b/public/react/src/modules/courses/ListPageIndex.js @@ -28,10 +28,25 @@ const TeacherList= Loadable({ loader: () => import('./members/teacherList'), loading: Loading, }) +//主签到目录 +const Signinmain= Loadable({ + loader: () => import('./signin/mymain/Signinmain'), + loading: Loading, +}); +//老师签到 +const Teachers_signin= Loadable({ + loader: () => import('./signin/teacher/Teachers_signin'), + loading: Loading, +}); +//学生签到 +const Students_signin= Loadable({ + loader: () => import('./signin/student/Students_signin'), + loading: Loading, +}); //学生列表 const StudentsList= Loadable({ - loader: () => import('./members/studentsList'), - loading: Loading, + loader: () => import('./members/studentsList'), + loading: Loading, }); //分班列表 const CourseGroupList= Loadable({ @@ -254,17 +269,37 @@ class ListPageIndex extends Component{ (props) => () } > + {/* 教师签到*/} + () + } + > + {/* 教师列表*/} (this.updatabanners()} {...this.props} {...props} {...this.state} />) } > + {/* 学生签到*/} + () + } + > {/* 学生列表*/} () } > + {/* 主签到 */} + () + } + > + () diff --git a/public/react/src/modules/courses/signin/css/signincdi.css b/public/react/src/modules/courses/signin/css/signincdi.css new file mode 100644 index 000000000..b60b8c6e1 --- /dev/null +++ b/public/react/src/modules/courses/signin/css/signincdi.css @@ -0,0 +1,97 @@ +/* 中间居中 */ +.intermediatecenter{ + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} +/* 简单居中 */ +.intermediatecenterysls{ + display: flex; + align-items: center; +} + +/* 头顶部居中 */ +.topcenter{ + display: -webkit-flex; + flex-direction: column; + align-items: center; + +} +/* 均匀分开 */ +.spacearound{ + display: flex; + justify-content: space-around; + +} +/* 两边靠墙中间均匀分开 */ +.spacebetween{ + display: flex; + justify-content: space-between; +} +/* 从左分开 */ +.spacearoundflexstart{ + + display: flex; + justify-content: flex-start; +} +.spacebetween{ + display: flex; + justify-content: space-between; +} + +.unpsysls{ + display: inline-block; + text-align: justify; + font-size: 28rpx; +} + +/* x轴正方向排序 */ +/* 一 二 三 四 五 六 七 八 */ +.sortinxdirection{ + display: flex; + flex-direction:row; +} +/* x轴反方向排序 */ +/* 八 七 六 五 四 三 二 一 */ +.xaxisreverseorder{ + display: flex; + flex-direction:row-reverse; +} +/* 垂直布局 正方向*/ +/* 一 + 二 + 三 + 四 + 五 + 六 + 七 + 八 */ +.verticallayout{ + display: flex; + flex-direction:column; +} +/* 垂直布局 反方向*/ +.reversedirection{ + display: flex; + flex-direction:column-reverse; +} +/* 两端对齐 */ +.alignmentatbothends{ + display: flex; + justify-content: space-between; +} +.ws100s{ + width: 100%; +} + +.ws70s{ + width: 70%; +} + +.hs30s{ + height: 30%; +} +.yslmaxheigth80 .ant-tabs .ant-tabs-top{ + border-bottom: 1px solid #ffffff !important; +} diff --git a/public/react/src/modules/courses/signin/mymain/Signinmain.js b/public/react/src/modules/courses/signin/mymain/Signinmain.js new file mode 100644 index 000000000..f1bafc0fe --- /dev/null +++ b/public/react/src/modules/courses/signin/mymain/Signinmain.js @@ -0,0 +1,37 @@ +import React,{ Component } from "react"; +import '../css/signincdi.css'; +import { Tabs } from 'antd'; +const { TabPane } = Tabs; +// 主签到目录 主签到目录 +class Signinmain extends Component{ + constructor(props){ + super(props); + + this.state={ + + } + } + + componentDidMount() { + + } + + componentDidUpdate = (prevProps) => { + console.log("componentDidUpdate"); + + + } + + + // 主签到目录 + render(){ + return( + +
+ +
+
+ ) + } +} +export default Signinmain; diff --git a/public/react/src/modules/courses/signin/student/Students_signin.js b/public/react/src/modules/courses/signin/student/Students_signin.js new file mode 100644 index 000000000..889f106f6 --- /dev/null +++ b/public/react/src/modules/courses/signin/student/Students_signin.js @@ -0,0 +1,53 @@ +import React,{ Component } from "react"; +import '../css/signincdi.css'; +import { Tabs } from 'antd'; +const { TabPane } = Tabs; +//在线学习 +class Teachers_signin extends Component{ + constructor(props){ + super(props); + + this.state={ + + } + } + + componentDidMount() { + + } + + componentDidUpdate = (prevProps) => { + console.log("componentDidUpdate"); + + + } + + callback=(key)=> { + console.log(key); + } + + + + render(){ + return( + +
+
+
+ + + Content of Tab Pane 1 + + + Content of Tab Pane 2 + + +
+ +
+
+
+ ) + } +} +export default Teachers_signin; diff --git a/public/react/src/modules/courses/signin/teacher/Teachers_signin.js b/public/react/src/modules/courses/signin/teacher/Teachers_signin.js new file mode 100644 index 000000000..64c924d87 --- /dev/null +++ b/public/react/src/modules/courses/signin/teacher/Teachers_signin.js @@ -0,0 +1,56 @@ +import React,{ Component } from "react"; +import '../css/signincdi.css'; +import { Tabs } from 'antd'; +const { TabPane } = Tabs; +//在线学习 +class Students_signin extends Component{ + constructor(props){ + super(props); + + this.state={ + + } + } + + componentDidMount() { + + } + + componentDidUpdate = (prevProps) => { + console.log("componentDidUpdate"); + + + } + + callback=(key)=> { + console.log(key); + } + + + + render(){ + return( + +
+
+
+ + + Content of Tab Pane 1 + + + Content of Tab Pane 2 + + + Content of Tab Pane 3 + + +
+ +
+
+
+ ) + } +} +export default Students_signin; From ec9ce0b2a189cd57853564de5e238311eda8db25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 12 Mar 2020 18:11:43 +0800 Subject: [PATCH 04/88] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/signin/css/signincdi.css | 21 ++++++++++++++++++- .../courses/signin/mymain/Signinmain.js | 19 ++++++++++++++++- .../courses/signin/student/Students_signin.js | 4 ++-- .../courses/signin/teacher/Teachers_signin.js | 7 ++++--- 4 files changed, 44 insertions(+), 7 deletions(-) diff --git a/public/react/src/modules/courses/signin/css/signincdi.css b/public/react/src/modules/courses/signin/css/signincdi.css index b60b8c6e1..004c56ef1 100644 --- a/public/react/src/modules/courses/signin/css/signincdi.css +++ b/public/react/src/modules/courses/signin/css/signincdi.css @@ -92,6 +92,25 @@ .hs30s{ height: 30%; } -.yslmaxheigth80 .ant-tabs .ant-tabs-top{ +.yslmaxheigthk{ +} +.yslmaxheigthk .ws100s .ant-tabs .ant-tabs-bar { border-bottom: 1px solid #ffffff !important; + background: #ffffff !important; + background-color: #ffffff !important; + margin: 0 !important; +} +yslmaxheigthk .ws100s .ant-tabs .ant-tabs-bar .ant-tabs-nav-container { + padding-left: 25px; +} + + +.yslmaxheigthk .ws100s .ant-tabs .ant-tabs-bar .ant-tabs-tab{ + padding: 25px 16px !important; + font-size: 16px; + font-family: Microsoft YaHei; + font-weight: bold; + } + + diff --git a/public/react/src/modules/courses/signin/mymain/Signinmain.js b/public/react/src/modules/courses/signin/mymain/Signinmain.js index f1bafc0fe..60d14b0f8 100644 --- a/public/react/src/modules/courses/signin/mymain/Signinmain.js +++ b/public/react/src/modules/courses/signin/mymain/Signinmain.js @@ -1,6 +1,8 @@ import React,{ Component } from "react"; import '../css/signincdi.css'; import { Tabs } from 'antd'; +import Teachers_signin from '../teacher/Teachers_signin'; +import Students_signin from '../student/Students_signin'; const { TabPane } = Tabs; // 主签到目录 主签到目录 class Signinmain extends Component{ @@ -25,9 +27,24 @@ class Signinmain extends Component{ // 主签到目录 render(){ + const isAdmin = this.props.isAdmin() + return( -
+
+ { + isAdmin===true? + + + + : + + + + + + + }
diff --git a/public/react/src/modules/courses/signin/student/Students_signin.js b/public/react/src/modules/courses/signin/student/Students_signin.js index 889f106f6..1a5c1082b 100644 --- a/public/react/src/modules/courses/signin/student/Students_signin.js +++ b/public/react/src/modules/courses/signin/student/Students_signin.js @@ -31,8 +31,8 @@ class Teachers_signin extends Component{ render(){ return( -
-
+
+
diff --git a/public/react/src/modules/courses/signin/teacher/Teachers_signin.js b/public/react/src/modules/courses/signin/teacher/Teachers_signin.js index 64c924d87..af180ebdb 100644 --- a/public/react/src/modules/courses/signin/teacher/Teachers_signin.js +++ b/public/react/src/modules/courses/signin/teacher/Teachers_signin.js @@ -31,12 +31,13 @@ class Students_signin extends Component{ render(){ return( -
-
+
+ +
- Content of Tab Pane 1 +

共3个签到正在进行

Content of Tab Pane 2 From 22c0b3dc957cafd16668463dabb033f9c7f9d2db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 12 Mar 2020 19:01:47 +0800 Subject: [PATCH 05/88] =?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/signin/css/signincdi.css | 14 +++++++++++++- .../courses/signin/teacher/Teachers_signin.js | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/signin/css/signincdi.css b/public/react/src/modules/courses/signin/css/signincdi.css index 004c56ef1..750bc1584 100644 --- a/public/react/src/modules/courses/signin/css/signincdi.css +++ b/public/react/src/modules/courses/signin/css/signincdi.css @@ -93,6 +93,14 @@ height: 30%; } .yslmaxheigthk{ + +} +.mysligtes{ + font-size:16px; + font-family:Microsoft YaHei; + font-weight:bold; + color:rgba(144,147,153,1); + padding-left: 34px; } .yslmaxheigthk .ws100s .ant-tabs .ant-tabs-bar { border-bottom: 1px solid #ffffff !important; @@ -100,10 +108,14 @@ background-color: #ffffff !important; margin: 0 !important; } -yslmaxheigthk .ws100s .ant-tabs .ant-tabs-bar .ant-tabs-nav-container { +.yslmaxheigthk .ws100s .ant-tabs .ant-tabs-bar .ant-tabs-nav-container { padding-left: 25px; } +.yslmaxheigthk .ws100s .ant-tabs .ant-tabs-bar .ant-tabs-nav-container .ant-tabs-ink-bar{ + width: 68px !important; + left: 16px; +} .yslmaxheigthk .ws100s .ant-tabs .ant-tabs-bar .ant-tabs-tab{ padding: 25px 16px !important; diff --git a/public/react/src/modules/courses/signin/teacher/Teachers_signin.js b/public/react/src/modules/courses/signin/teacher/Teachers_signin.js index af180ebdb..963bdf662 100644 --- a/public/react/src/modules/courses/signin/teacher/Teachers_signin.js +++ b/public/react/src/modules/courses/signin/teacher/Teachers_signin.js @@ -37,7 +37,7 @@ class Students_signin extends Component{
-

共3个签到正在进行

+

共3个签到正在进行

Content of Tab Pane 2 From 8cb63a9b49da0c161c70490e3e21e2bc8f961af8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 12 Mar 2020 19:35:42 +0800 Subject: [PATCH 06/88] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/signin/css/signincdi.css | 19 +++++++++++++++++++ .../courses/signin/teacher/Teachers_signin.js | 7 ++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/signin/css/signincdi.css b/public/react/src/modules/courses/signin/css/signincdi.css index 750bc1584..dfe3c2b60 100644 --- a/public/react/src/modules/courses/signin/css/signincdi.css +++ b/public/react/src/modules/courses/signin/css/signincdi.css @@ -124,5 +124,24 @@ font-weight: bold; } +.positiondivs{ + position: absolute; + top: 0; + right: 0; +} +.posiivs{ + padding: 30px 16px !important; + font-size: 16px; + font-family: Microsoft YaHei; + font-weight: bold; + color: #1890ff; +} + +.xiaoshou{ + cursor:pointer !important; +} +.xiaoshout{ + cursor:default !important; +} diff --git a/public/react/src/modules/courses/signin/teacher/Teachers_signin.js b/public/react/src/modules/courses/signin/teacher/Teachers_signin.js index 963bdf662..05694a344 100644 --- a/public/react/src/modules/courses/signin/teacher/Teachers_signin.js +++ b/public/react/src/modules/courses/signin/teacher/Teachers_signin.js @@ -34,7 +34,9 @@ class Students_signin extends Component{
-
+

共3个签到正在进行

@@ -46,6 +48,9 @@ class Students_signin extends Component{ Content of Tab Pane 3
+
+

创建签到

+
From 6734c98a7da0a7e2fddb0df4099a1dbe15e5c0bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 12 Mar 2020 19:41:40 +0800 Subject: [PATCH 07/88] =?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/public/css/demo_index.html | 69 +++++ public/react/public/css/iconfont.css | 24 +- public/react/public/css/iconfont.eot | Bin 88664 -> 89364 bytes public/react/public/css/iconfont.js | 2 +- public/react/public/css/iconfont.json | 21 ++ public/react/public/css/iconfont.svg | 9 + public/react/public/css/iconfont.ttf | Bin 88496 -> 89196 bytes public/react/public/css/iconfont.woff | Bin 55920 -> 56200 bytes public/react/public/css/iconfont.woff2 | Bin 46852 -> 46980 bytes .../educoder/iconfont/demo_index.html | 253 ++++++++++++++++++ .../educoder/iconfont/iconfont.css | 56 +++- .../educoder/iconfont/iconfont.eot | Bin 87360 -> 89364 bytes .../stylesheets/educoder/iconfont/iconfont.js | 2 +- .../educoder/iconfont/iconfont.json | 77 ++++++ .../educoder/iconfont/iconfont.svg | 33 +++ .../educoder/iconfont/iconfont.ttf | Bin 87192 -> 89196 bytes .../educoder/iconfont/iconfont.woff | Bin 55256 -> 56200 bytes .../educoder/iconfont/iconfont.woff2 | Bin 46304 -> 46980 bytes 18 files changed, 532 insertions(+), 14 deletions(-) diff --git a/public/react/public/css/demo_index.html b/public/react/public/css/demo_index.html index 7b0854698..59a7d4aec 100644 --- a/public/react/public/css/demo_index.html +++ b/public/react/public/css/demo_index.html @@ -30,6 +30,24 @@