From 5c39b86f66863afb7b79016de18f6e44fec2c369 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 10 Mar 2020 00:11:06 +0800 Subject: [PATCH 01/23] =?UTF-8?q?=E6=9C=AA=E5=BC=80=E5=A7=8B=E7=9A=84?= =?UTF-8?q?=E7=AD=BE=E5=88=B0=E4=B9=9F=E5=8F=AF=E4=BB=A5=E6=88=AA=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/weapps/attendances_controller.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/controllers/weapps/attendances_controller.rb b/app/controllers/weapps/attendances_controller.rb index 7da852393..ea2688cc5 100644 --- a/app/controllers/weapps/attendances_controller.rb +++ b/app/controllers/weapps/attendances_controller.rb @@ -130,8 +130,14 @@ class Weapps::AttendancesController < ApplicationController def end a_end_time = "#{@attendance.attendance_date} #{@attendance.end_time}".to_time - tip_exception("该签到已截止") unless @attendance.current_attendance? - @attendance.update!(end_time: Time.current) + tip_exception("该签到已截止") if a_end_time < Time.now + + a_start_time = "#{@attendance.attendance_date} #{@attendance.start_time}".to_time + if a_start_time > Time.now + @attendance.update!(end_time: Time.current, start_time: Time.current) + else + @attendance.update!(end_time: Time.current) + end render_ok end From dfe06b7b98cc1854ddbc6a565b39deaa194fe692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 10 Mar 2020 16:05:16 +0800 Subject: [PATCH 02/23] =?UTF-8?q?=E8=AF=BE=E5=A0=82url=E6=8A=8Acourses?= =?UTF-8?q?=E6=94=B9=E6=88=90classrooms=20=2078=E5=A4=84=E5=9C=B0=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/graduation/topics/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/graduation/topics/index.js b/public/react/src/modules/courses/graduation/topics/index.js index e63fdf6b3..93ba86b63 100644 --- a/public/react/src/modules/courses/graduation/topics/index.js +++ b/public/react/src/modules/courses/graduation/topics/index.js @@ -416,7 +416,7 @@ onBoardsNew=()=>{ ( {/* 参考普通作业 - 题库选用 */} {/* this.useFromBank()}>题库选用 正式版没有,先隐藏*/} - < a className={"fl color-blue mr30 font-16"} onClick={(url)=>this.confirmysl(`/classrooms/${this.props.match.params.coursesId}/graduation_topics/export.xlsx`)}>导出 + < a className={"fl color-blue mr30 font-16"} onClick={(url)=>this.confirmysl(`/courses/${this.props.match.params.coursesId}/graduation_topics/export.xlsx`)}>导出 {/*

题库选用*/} this.onBoardsNew()}>新建
):"" From 1f50af54baf26bb38583d10bd91b1290a41e1e40 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 10 Mar 2020 16:08:46 +0800 Subject: [PATCH 03/23] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users/videos_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users/videos_controller.rb b/app/controllers/users/videos_controller.rb index 32f81f6ed..15365dc69 100644 --- a/app/controllers/users/videos_controller.rb +++ b/app/controllers/users/videos_controller.rb @@ -55,7 +55,7 @@ class Users::VideosController < Users::BaseController def destroy video = Video.find_by(id: params[:id]) - return render_forbidden unless video.user_id == current_user.id || current_user.admin_or_business? + return render_forbidden unless video.user_id == current_user.id || current_user.admin? return render_not_found if video.blank? return render_error('该状态下不能删除视频') unless video.published? From 60925486e6c50ee5bd6067e2cd20d1fc0cec1ed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 10 Mar 2020 16:33:54 +0800 Subject: [PATCH 04/23] =?UTF-8?q?=E8=AF=BE=E5=A0=82url=E6=8A=8Acourses?= =?UTF-8?q?=E6=94=B9=E6=88=90classrooms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/busyWork/CommonWorkDetailIndex.js | 12 +-- .../src/modules/courses/busyWork/common.js | 42 ++++---- .../graduation/topics/GraduateTopicNew.js | 26 ++--- .../courses/members/CourseGroupListTable.js | 42 ++++---- .../courses/poll/PollDetailTabFirst.js | 2 +- .../courses/shixunHomework/CommitSummary.js | 4 +- .../shixunHomework/ShixunHomeworkPage.js | 8 +- .../shixunHomework/ShixunWorkDetails.js | 6 +- .../modules/courses/statistics/Statistics.js | 2 +- .../react/src/modules/message/js/MessagSub.js | 96 +++++++++---------- 10 files changed, 120 insertions(+), 120 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js index 255a74295..ae5771507 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js @@ -247,8 +247,8 @@ class CommonWorkDetailIndex extends Component{ `} {current_user && this.setState({moduleName: '作品列表'})} className={`${isListModule ? 'active' : '' } `} - to={`/courses/${courseId}/${moduleEngName}/${workId}/list`}>作品列表 + to={`/classrooms/${courseId}/${moduleEngName}/${workId}/list`}>作品列表 this.setState({moduleName: '作业描述'})} className={`${childModuleName == '作业描述' ? 'active' : '' } `} - to={`/courses/${courseId}/${moduleEngName}/${workId}/question`}>作业描述 + to={`/classrooms/${courseId}/${moduleEngName}/${workId}/question`}>作业描述 {view_answer == true && this.setState({moduleName: '参考答案'})} className={`${childModuleName == '参考答案' ? 'active' : '' } `} - to={`/courses/${courseId}/${moduleEngName}/${workId}/answer`}>参考答案} + to={`/classrooms/${courseId}/${moduleEngName}/${workId}/answer`}>参考答案} this.setState({moduleName: '设置'})} className={`${childModuleName == '设置' ? 'active' : '' } `} style={{paddingLeft:this.props.isAdmin()?'38px':'20px'}} - to={`/courses/${courseId}/${moduleEngName}/${workId}/setting`}>{this.props.isAdmin()?"设置":"得分规则"} + to={`/classrooms/${courseId}/${moduleEngName}/${workId}/setting`}>{this.props.isAdmin()?"设置":"得分规则"} {/* { this.props.tabRightComponents } */} diff --git a/public/react/src/modules/courses/busyWork/common.js b/public/react/src/modules/courses/busyWork/common.js index f8327adcd..ebcce2c12 100644 --- a/public/react/src/modules/courses/busyWork/common.js +++ b/public/react/src/modules/courses/busyWork/common.js @@ -51,9 +51,9 @@ export function RouteHOC(options = {}) { const topicId = _courseId.topicId const workId = _courseId.workId const courseId = _courseId.coursesId - this.props.history.push(`/courses/${courseId}/boards/${workId}/messages/${topicId}`) + this.props.history.push(`/classrooms/${courseId}/boards/${workId}/messages/${topicId}`) } else { - this.props.history.push(`/courses/${_courseId}/boards/${workId}/messages/${topicId}`) + this.props.history.push(`/classrooms/${_courseId}/boards/${workId}/messages/${topicId}`) } } @@ -62,9 +62,9 @@ export function RouteHOC(options = {}) { if (typeof _courseId == "object") { const workId = _courseId.workId const courseId = _courseId.coursesId - this.props.history.push(`/courses/${courseId}/${secondName}/${_workId || workId}/edit`) + this.props.history.push(`/classrooms/${courseId}/${secondName}/${_workId || workId}/edit`) } else { - this.props.history.push(`/courses/${_courseId}/${secondName}/${_workId}/edit`) + this.props.history.push(`/classrooms/${_courseId}/${secondName}/${_workId}/edit`) } } toWorkDetailPage = (_courseId, _workId, _studentWorkId) => { @@ -73,9 +73,9 @@ export function RouteHOC(options = {}) { const workId = _courseId.workId const courseId = _courseId.coursesId const studentWorkId = _courseId.studentWorkId - window.open(`/courses/${courseId}/${secondName}/${_workId || workId}/${_studentWorkId || studentWorkId}/appraise`); + window.open(`/classrooms/${courseId}/${secondName}/${_workId || workId}/${_studentWorkId || studentWorkId}/appraise`); } else { - window.open(`/courses/${_courseId}/${secondName}/${_workId}/${_studentWorkId}/appraise`); + window.open(`/classrooms/${_courseId}/${secondName}/${_workId}/${_studentWorkId}/appraise`); } } toWorkDetailPage2 = (e, _courseId, _workId, _studentWorkId) => { @@ -86,23 +86,23 @@ export function RouteHOC(options = {}) { const workId = _courseId.workId const courseId = _courseId.coursesId const studentWorkId = _courseId.studentWorkId - window.open(`/courses/${courseId}/${secondName}/${_workId || workId}/${_studentWorkId || studentWorkId}/appraise`); + window.open(`/classrooms/${courseId}/${secondName}/${_workId || workId}/${_studentWorkId || studentWorkId}/appraise`); } else { - window.open(`/courses/${_courseId}/${secondName}/${_workId}/${_studentWorkId}/appraise`); + window.open(`/classrooms/${_courseId}/${secondName}/${_workId}/${_studentWorkId}/appraise`); } } toNewPage = (courseId) => { const secondName = this.getModuleName() - this.props.history.push(`/courses/${courseId.coursesId}/${secondName}/${courseId.category_id}/new`) + this.props.history.push(`/classrooms/${courseId.coursesId}/${secondName}/${courseId.category_id}/new`) } toListPage = (_courseId, _workId) => { const secondName = this.getModuleName() if (typeof _courseId == "object") { const workId = _courseId.workId const courseId = _courseId.coursesId - this.props.history.push(`/courses/${courseId}/${secondName}/${_workId || workId}`) + this.props.history.push(`/classrooms/${courseId}/${secondName}/${_workId || workId}`) } else { - this.props.history.push(`/courses/${_courseId}/${secondName}${_workId ? '/' + _workId : ''}`) + this.props.history.push(`/classrooms/${_courseId}/${secondName}${_workId ? '/' + _workId : ''}`) } } @@ -113,9 +113,9 @@ export function RouteHOC(options = {}) { const workId = _courseId.workId const courseId = _courseId.coursesId const studentWorkId = _courseId.studentWorkId - this.props.history.push(`/courses/${courseId}/${secondName}/${_workId || workId}/${isEdit? `${_studentWorkId || studentWorkId}/post_edit` : 'post'}`) + this.props.history.push(`/classrooms/${courseId}/${secondName}/${_workId || workId}/${isEdit? `${_studentWorkId || studentWorkId}/post_edit` : 'post'}`) } else { - this.props.history.push(`/courses/${_courseId}/${secondName}/${_workId}/${isEdit? `${_studentWorkId}/post_edit` : 'post'}`) + this.props.history.push(`/classrooms/${_courseId}/${secondName}/${_workId}/${isEdit? `${_studentWorkId}/post_edit` : 'post'}`) } } toWorkListPage = (_courseId, _workId) => { @@ -123,9 +123,9 @@ export function RouteHOC(options = {}) { if (typeof _courseId == "object") { const workId = _courseId.workId const courseId = _courseId.coursesId - this.props.history.push(`/courses/${courseId}/${secondName}/${_workId || workId}/list`) + this.props.history.push(`/classrooms/${courseId}/${secondName}/${_workId || workId}/list`) } else { - this.props.history.push(`/courses/${_courseId}/${secondName}/${_workId}/list`) + this.props.history.push(`/classrooms/${_courseId}/${secondName}/${_workId}/list`) } } toWorkAnswerPage = (_courseId, _workId) => { @@ -133,9 +133,9 @@ export function RouteHOC(options = {}) { if (typeof _courseId == "object") { const workId = _courseId.workId const courseId = _courseId.coursesId - this.props.history.push(`/courses/${courseId}/${secondName}/${workId}/answer`) + this.props.history.push(`/classrooms/${courseId}/${secondName}/${workId}/answer`) } else { - this.props.history.push(`/courses/${_courseId}/${secondName}/${_workId}/answer`) + this.props.history.push(`/classrooms/${_courseId}/${secondName}/${_workId}/answer`) } } @@ -144,9 +144,9 @@ export function RouteHOC(options = {}) { if (typeof _courseId == "object") { const workId = _workId || _courseId.workId const courseId = _courseId.coursesId - this.props.history.push(`/courses/${courseId}/${secondName}/${workId}/question`) + this.props.history.push(`/classrooms/${courseId}/${secondName}/${workId}/question`) } else { - this.props.history.push(`/courses/${_courseId}/${secondName}/${_workId}/question`) + this.props.history.push(`/classrooms/${_courseId}/${secondName}/${_workId}/question`) } } @@ -155,9 +155,9 @@ export function RouteHOC(options = {}) { if (typeof _courseId == "object") { const workId = _courseId.workId const courseId = _courseId.coursesId - this.props.history.push(`/courses/${courseId}/${secondName}/${_workId || workId}/setting`) + this.props.history.push(`/classrooms/${courseId}/${secondName}/${_workId || workId}/setting`) } else { - this.props.history.push(`/courses/${_courseId}/${secondName}/${_workId}/setting`) + this.props.history.push(`/classrooms/${_courseId}/${secondName}/${_workId}/setting`) } } diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js index b086efeda..433007c69 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js @@ -81,7 +81,7 @@ class GraduateTopicNew extends Component{ this.getTeacherList(); }else{ this.getEditInfo(); - + } } //编辑,信息显示 @@ -162,8 +162,8 @@ class GraduateTopicNew extends Component{ if (response.status == 200) { const { id } = response.data; if (id) { - this.props.showNotification('保存成功!'); - this.props.history.push(`/courses/${cid}/graduation_topics/${this.state.left_banner_id}`); + this.props.showNotification('保存成功!'); + this.props.history.push(`/classrooms/${cid}/graduation_topics/${this.state.left_banner_id}`); } } }).catch(function (error) { @@ -177,7 +177,7 @@ class GraduateTopicNew extends Component{ return item.response.id }) } - + axios.post(url, { graduation_topic:{ ...values, @@ -189,8 +189,8 @@ class GraduateTopicNew extends Component{ if (response.data) { const { id } = response.data; if (id) { - this.props.showNotification('提交成功!'); - this.props.history.push(`/courses/${cid}/graduation_topics/${this.state.left_banner_id}`); + this.props.showNotification('提交成功!'); + this.props.history.push(`/classrooms/${cid}/graduation_topics/${this.state.left_banner_id}`); } } }) @@ -246,7 +246,7 @@ class GraduateTopicNew extends Component{ const { status } = response.data; if (status == 0) { console.log('--- success') - + this.setState((state) => { const index = state.fileList.indexOf(file); const newFileList = state.fileList.slice(); @@ -335,13 +335,13 @@ class GraduateTopicNew extends Component{

{course_name} > - {left_banner_name} + {left_banner_name} > {topicId==undefined?"新建":"编辑"}

{topicId==undefined?"新建":"编辑"}毕设选题

- 返回 + 返回
@@ -546,7 +546,7 @@ class GraduateTopicNew extends Component{ - + - +
)} -
+
@@ -632,4 +632,4 @@ class GraduateTopicNew extends Component{ const WrappedGraduateTopicNew = Form.create({ name: 'topicPostWorksNew' })(GraduateTopicNew); // RouteHOC() -export default (WrappedGraduateTopicNew); \ No newline at end of file +export default (WrappedGraduateTopicNew); diff --git a/public/react/src/modules/courses/members/CourseGroupListTable.js b/public/react/src/modules/courses/members/CourseGroupListTable.js index 6074f3649..32eed2ecd 100644 --- a/public/react/src/modules/courses/members/CourseGroupListTable.js +++ b/public/react/src/modules/courses/members/CourseGroupListTable.js @@ -6,7 +6,7 @@ import axios from 'axios' import { WordsBtn, trigger, on, off, getUrl, downloadFile , sortDirections } from 'educoder' import ClipboardJS from 'clipboard' import './studentsList.css'; -/** +/** 角色数组, CREATOR: 创建者, PROFESSOR: 教师, ASSISTANT_PROFESSOR: 助教, STUDENT: 学生 course_members_count: 0 id: 2441 @@ -19,7 +19,7 @@ const clipboardMap = {} function CourseGroupListTable(props) { const [serachValue, setSerachValue] = useState('') - const courseId = props.match.params.coursesId + const courseId = props.match.params.coursesId useEffect(() => { const course_groups = props.course_groups @@ -31,7 +31,7 @@ function CourseGroupListTable(props) { let _clipboard = new ClipboardJS(`.copyBtn_${id}`); _clipboard.on('success', (e) => { props.showNotification('复制成功') - }); + }); clipboardMap[id] = _clipboard }) return () => { @@ -70,7 +70,7 @@ function CourseGroupListTable(props) { {name} } }, - + { title: '学生成员', dataIndex: 'course_members_count', @@ -122,8 +122,8 @@ function CourseGroupListTable(props) {
点击复制邀请码
}> - 复制 + 复制 } @@ -152,17 +152,17 @@ function CourseGroupListTable(props) { render: (none, record, index) => { return {!isCourseEnd && isAdmin && onDelete(record)} style={'grey'}>删除分班} - - {isStudent && addToDir(record)} style={''}>加入分班} - onGoDetail(record)} style={''} className="color-dark">查看 + + {isStudent && addToDir(record)} style={''}>加入分班} + onGoDetail(record)} style={''} className="color-dark">查看 } }) - - return columns + + return columns } const doAddToDir = async (record) => { - const courseId = props.match.params.coursesId + const courseId = props.match.params.coursesId const url = `/courses/${courseId}/join_course_group.json` const course_group_id = record.id @@ -177,12 +177,12 @@ function CourseGroupListTable(props) { } const addToDir = (record) => { props.confirm({ - + content: `是否确认加入分班: ${record.name}?`, okText: '确认', cancelText: '取消', - + onOk: () => { doAddToDir(record) }, @@ -191,7 +191,7 @@ function CourseGroupListTable(props) { }, }); } - + function onDelete(record) { props.confirm({ content:
@@ -212,12 +212,12 @@ function CourseGroupListTable(props) { }) .catch(function (error) { console.log(error); - }); + }); } }) - } + } function onGoDetail(record) { - props.history.push(`/courses/${courseId}/course_groups/${record.id}`) + props.history.push(`/classrooms/${courseId}/course_groups/${record.id}`) } // 停用和启用邀请码 function changeInviteCode(id,flag){ @@ -249,7 +249,7 @@ function CourseGroupListTable(props) { const isSuperAdmin = props.isSuperAdmin(); const isStudent = props.isStudent() const isNotMember = props.isNotMember() - + const isParent = true; const isCourseEnd= props.isCourseEnd(); @@ -273,8 +273,8 @@ function CourseGroupListTable(props) { `} {/* onChange={onTableChange} */}
- + ) } -export default CourseGroupListTable \ No newline at end of file +export default CourseGroupListTable diff --git a/public/react/src/modules/courses/poll/PollDetailTabFirst.js b/public/react/src/modules/courses/poll/PollDetailTabFirst.js index 052382067..912894a9b 100644 --- a/public/react/src/modules/courses/poll/PollDetailTabFirst.js +++ b/public/react/src/modules/courses/poll/PollDetailTabFirst.js @@ -309,7 +309,7 @@ class PollDetailTabFirst extends Component{ width:120, render:(operation,item,index)=>{ return( - item.status == 1 ? 查看:-- + item.status == 1 ? 查看:-- ) } }]; diff --git a/public/react/src/modules/courses/shixunHomework/CommitSummary.js b/public/react/src/modules/courses/shixunHomework/CommitSummary.js index 5d48f11d9..4a62d8977 100644 --- a/public/react/src/modules/courses/shixunHomework/CommitSummary.js +++ b/public/react/src/modules/courses/shixunHomework/CommitSummary.js @@ -107,7 +107,7 @@ class CommitSummary extends Component{ // console.log(JSON.stringify(result)) // message.success(result.data.message); // 这里以前是学生 - this.props.history.push(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/list?tab=0`); + this.props.history.push(`/classrooms/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/list?tab=0`); } }).catch((error) => { console.log(error) @@ -201,7 +201,7 @@ class CommitSummary extends Component{ - 取消 + 取消
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js index 06f0e805d..c539cb7b2 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js @@ -190,7 +190,7 @@ class ShixunHomeworkPage extends Component { // console.log(this.props) let {jobsettingsdatapage}=this.state - this.props.history.replace(`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`); + this.props.history.replace(`/classrooms/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`); } Akeyreviewit=()=>{ @@ -264,7 +264,7 @@ class ShixunHomeworkPage extends Component { > {jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_name} + href={`/classrooms/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_name} > 作业详情

@@ -381,7 +381,7 @@ class ShixunHomeworkPage extends Component { {this.state.view_report === true ? + to={`/classrooms/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage&&teacherdatapage.work_id}/shixun_work_report`}> 查看实训报告 : ""} { @@ -389,7 +389,7 @@ class ShixunHomeworkPage extends Component { : teacherdatapage.commit_des === null || teacherdatapage.commit_des === undefined ? "" : {teacherdatapage.commit_des} + href={`/classrooms/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage === undefined ? "" : teacherdatapage.id}/commitsummary/${this.props.match.params.homeworkid}`}>{teacherdatapage.commit_des} } {teacherdatapage === undefined ? "" :teacherdatapage&&teacherdatapage.shixun_status>1&&teacherdatapage&&teacherdatapage.time_status<5?

{data&&data.course_name} > 实训作业 diff --git a/public/react/src/modules/courses/statistics/Statistics.js b/public/react/src/modules/courses/statistics/Statistics.js index 883b2db50..589d8eb90 100644 --- a/public/react/src/modules/courses/statistics/Statistics.js +++ b/public/react/src/modules/courses/statistics/Statistics.js @@ -420,7 +420,7 @@ class Statistics extends Component{ { this.props.isAdmin()===true? // 这里是文件下载 不能替换路由 - this.derivefun(this.state.activeKey==="1"?`/courses/${this.props.match.params.coursesId}/export_member_scores_excel.xlsx`:`/courses/${this.props.match.params.coursesId}/export_member_act_score.xlsx`)}>导出 + this.derivefun(this.state.activeKey==="1"?`/classrooms/${this.props.match.params.coursesId}/export_member_scores_excel.xlsx`:`/courses/${this.props.match.params.coursesId}/export_member_act_score.xlsx`)}>导出 :"" } ; diff --git a/public/react/src/modules/message/js/MessagSub.js b/public/react/src/modules/message/js/MessagSub.js index 45310673f..822f7b8fe 100644 --- a/public/react/src/modules/message/js/MessagSub.js +++ b/public/react/src/modules/message/js/MessagSub.js @@ -193,32 +193,32 @@ class MessagSub extends Component { return; case 'JoinCourse' : // 课堂详情页 :id = - return window.open(`/courses/${item.belong_container_id}/teachers`) + return window.open(`/classrooms/${item.belong_container_id}/teachers`) case 'StudentJoinCourse': // 课堂详情页 :id = container_id if (item.tiding_type === 'Apply') { - return window.open(`/courses/${item.belong_container_id}/teachers`); + return window.open(`/classrooms/${item.belong_container_id}/teachers`); } if (item.tiding_type === 'System') { //教学案例详情 :id = container_id - return window.open(`/courses/${item.belong_container_id}/students`); + return window.open(`/classrooms/${item.belong_container_id}/students`); } case 'DealCourse': // 课堂详情页 :id = container_id - return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`) + return window.open(`/classrooms/${item.belong_container_id}/shixun_homeworks/${item.container_id}`) case 'TeacherJoinCourse': // 课堂详情页 :id = container_id - return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`) + return window.open(`/classrooms/${item.belong_container_id}/shixun_homeworks/${item.container_id}`) case 'Course' : // 课堂详情页 :id = container_id if (item.tiding_type === "Delete") { return; } - return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`) + return window.open(`/classrooms/${item.belong_container_id}/shixun_homeworks/${item.container_id}`) case 'ArchiveCourse' : // 课堂详情页 :id = container_id - return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`) + return window.open(`/classrooms/${item.belong_container_id}/shixun_homeworks/${item.container_id}`) case "Shixun" : return window.open(`/shixuns/${item.identifier}/challenges`) case "Subject" : @@ -234,33 +234,33 @@ class MessagSub extends Component { //学生作业页 homework = parent_container_id if (item.homework_type === "normal") { //普通作业 - return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/question`) + return window.open(`/classrooms/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/question`) } if (item.homework_type === "group") { //分组作业 - return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/question`) + return window.open(`/classrooms/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/question`) } if (item.homework_type === "practice") { //实训作业 - return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=1`) + return window.open(`/classrooms/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=1`) } return ""; case "GraduationTopic" : // 毕业目标页 parent_container_id - return window.open(`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`) + return window.open(`/classrooms/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`) case "StudentWorksScore" : //学生作业页 if (item.homework_type === "normal") { //普通作业 - return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/question`) + return window.open(`/classrooms/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/question`) } if (item.homework_type === "group") { //分组作业 - return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/question`) + return window.open(`/classrooms/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/question`) } if (item.homework_type === "practice") { //实训作业 - return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=1`) + return window.open(`/classrooms/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=1`) } return ""; } @@ -314,109 +314,109 @@ class MessagSub extends Component { //记得跳评阅页面 default : // 课堂-试卷列表详情 :id = container_id - return window.open(`/courses/${item.belong_container_id}/exercises/${item.container_id}/student_exercise_list?tab=0`); + return window.open(`/classrooms/${item.belong_container_id}/exercises/${item.container_id}/student_exercise_list?tab=0`); } case 'StudentGraduationTopic' : //课堂-毕业选题详情 :id = parent_container_id - return window.open(`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`) + return window.open(`/classrooms/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`) case 'DealStudentTopicSelect' : //课堂-毕业选题详情 :id = parent_container_id - return window.open(`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`) + return window.open(`/classrooms/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`) case 'GraduationTask' : //课堂-毕业任务页 :id = container_id - return window.open(`/courses/${item.belong_container_id}/graduation_tasks/${item.container_id}`) + return window.open(`/classrooms/${item.belong_container_id}/graduation_tasks/${item.container_id}`) case "GraduationWork" : //课堂-毕业xx页 :id = container_id - return window.open(`/courses/${item.belong_container_id}/graduation_tasks/${item.container_id}`) + return window.open(`/classrooms/${item.belong_container_id}/graduation_tasks/${item.container_id}`) case "GraduationWorkScore" : // 课堂-毕业xx页 :id = parent_container_id - return window.open(`/courses/${item.belong_container_id}/graduation_tasks/${item.parent_container_id}`) + return window.open(`/classrooms/${item.belong_container_id}/graduation_tasks/${item.parent_container_id}`) case "HomeworkCommon" : switch (item.parent_container_type) { case "AnonymousCommentFail" : // 课堂-作业列表 homework = container_id if (item.homework_type === "normal") { //普通作业 - return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`) + return window.open(`/classrooms/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`) } if (item.homework_type === "group") { //分组作业 - return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`) + return window.open(`/classrooms/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`) } if (item.homework_type === "practice") { //实训作业 - return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) + return window.open(`/classrooms/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) } case "HomeworkPublish" : if (item.homework_type === "normal") { //普通作业 - return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`) + return window.open(`/classrooms/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`) } if (item.homework_type === "group") { //分组作业 - return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`) + return window.open(`/classrooms/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`) } if (item.homework_type === "practice") { //实训作业 - return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) + return window.open(`/classrooms/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) } case "AnonymousAppeal" : if (item.homework_type === "normal") { //普通作业 - return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`) + return window.open(`/classrooms/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`) } if (item.homework_type === "group") { //分组作业 - return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`) + return window.open(`/classrooms/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`) } if (item.homework_type === "practice") { //实训作业 - return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) + return window.open(`/classrooms/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) } default : // 课堂-作业列表 homework = container_id if (item.homework_type === "normal") { //普通作业 - return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`) + return window.open(`/classrooms/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`) } if (item.homework_type === "group") { //分组作业 - return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`) + return window.open(`/classrooms/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`) } if (item.homework_type === "practice") { //实训作业 - return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) + return window.open(`/classrooms/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) } } case "StudentWork" : //课堂-作业 :id = container_id if (item.homework_type === "normal") { //普通作业 - return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/${item.container_id}/appraise`) + return window.open(`/classrooms/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/${item.container_id}/appraise`) } if (item.homework_type === "group") { //分组作业/courses/1208/group_homeworks/22373/1219130/appraise - return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/${item.container_id}/appraise`) + return window.open(`/classrooms/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/${item.container_id}/appraise`) } if (item.homework_type === "practice") { //实训作业 - return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) + return window.open(`/classrooms/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) } case "StudentWorksScore" : //课堂-作业 :id = parent_container_id // if(item.homework_type==="normal"){ // //普通作业 - // return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`) + // return window.open(`/classrooms/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`) // } // if(item.homework_type==="group"){ // //分组作业 - // return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`) + // return window.open(`/classrooms/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`) // } // if(item.homework_type==="practice"){ // //实训作业 - // return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) + // return window.open(`/classrooms/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) // } - return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.trigger_user.id}/${item.parent_container_id}/appraise`); + return window.open(`/classrooms/${item.belong_container_id}/common_homeworks/${item.trigger_user.id}/${item.parent_container_id}/appraise`); case "StudentWorksScoresAppeal" : // if(item.homework_type==="normal"){ @@ -425,13 +425,13 @@ class MessagSub extends Component { // } // if(item.homework_type==="group"){ // //分组作业 - // return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`) + // return window.open(`/classrooms/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`) // } // if(item.homework_type==="practice"){ // //实训作业 - // return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) + // return window.open(`/classrooms/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) // } - return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.trigger_user.id}/${item.parent_container_id}/appraise`); + return window.open(`/classrooms/${item.belong_container_id}/common_homeworks/${item.trigger_user.id}/${item.parent_container_id}/appraise`); case "ChallengeWorkScore" : return ''; case "SendMessage" : @@ -488,30 +488,30 @@ class MessagSub extends Component { } return ''; case "PublicCourseStart": - return window.open(`/courses/${item.container_id}/informs`); + return window.open(`/classrooms/${item.container_id}/informs`); case "SubjectStartCourse": return window.open(`/paths/${item.container_id}`); case "ResubmitStudentWork": if (item.homework_type === "normal") { //普通作业 - return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/${item.container_id}/appraise`); + return window.open(`/classrooms/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/${item.container_id}/appraise`); } if (item.homework_type === "group") { //分组作业 - return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/${item.container_id}/appraise`); + return window.open(`/classrooms/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/${item.container_id}/appraise`); } case "AdjustScore": //belong_container_id course的id if (item.homework_type === "normal") { //普通作业 - return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}`); + return window.open(`/classrooms/${item.belong_container_id}/common_homeworks/${item.parent_container_id}`); } if (item.homework_type === "group") { //分组作业 - return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}`); + return window.open(`/classrooms/${item.belong_container_id}/group_homeworks/${item.parent_container_id}`); } case 'LiveLink': - return window.open(`/courses/${item.belong_container_id}/course_videos?open=live`); + return window.open(`/classrooms/${item.belong_container_id}/course_videos?open=live`); case 'Hack': if (item.extra && item.parent_container_type !== 'HackDelete') { return window.open(`/problems/${item.extra}/edit`); From 49af0cc5cd3204c32d000a5fa47108d2ce91a701 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 10 Mar 2020 16:45:44 +0800 Subject: [PATCH 05/23] =?UTF-8?q?=E5=8C=BF=E8=AF=84=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=9A=84=E5=AD=A6=E7=94=9F=E8=AF=84=E9=98=85=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_works_controller.rb | 9 ++++++--- app/models/homework_common.rb | 1 + app/models/student_work.rb | 12 +++++++++++- app/models/student_works_score.rb | 1 + app/views/homework_commons/works_list.json.jbuilder | 4 +++- ..._add_homework_common_id_to_student_works_score.rb | 5 +++++ ...310082003_migrate_student_works_score_homework.rb | 7 +++++++ 7 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 db/migrate/20200310081817_add_homework_common_id_to_student_works_score.rb create mode 100644 db/migrate/20200310082003_migrate_student_works_score_homework.rb diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index 8c2c4fda1..6c9de071d 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -374,6 +374,7 @@ class StudentWorksController < ApplicationController new_score.comment = params[:comment] if params[:comment] && params[:comment].strip != "" new_score.user_id = current_user.id new_score.student_work_id = @work.id + new_score.homework_common_id = @work.homework_common_id # 如果作品是未提交的状态则更新为已提交 if @user_course_identity < Course::STUDENT && !new_score.score.nil? && @work.work_status == 0 @@ -553,8 +554,10 @@ class StudentWorksController < ApplicationController # 分数不为空的历史评阅都置为失效 @work.student_works_scores.where.not(score: nil).update_all(is_invalid: 1) reviewer_role = @user_course_identity == Course::ASSISTANT_PROFESSOR ? 2 : 1 - new_score = StudentWorksScore.new(student_work_id: @work.id, score: params[:score].to_f, comment: "使用调分功能调整了作业最终成绩:#{params[:comment]}", - user_id: current_user.id, reviewer_role: reviewer_role, is_ultimate: 1) + new_score = StudentWorksScore.new(student_work_id: @work.id, score: params[:score].to_f, + comment: "使用调分功能调整了作业最终成绩:#{params[:comment]}", + homework_common_id: @work.homework_common_id, user_id: current_user.id, + reviewer_role: reviewer_role, is_ultimate: 1) new_score.save! # 如果作品是未提交的状态则更新为已提交 @@ -844,7 +847,7 @@ class StudentWorksController < ApplicationController def add_score_to_member student_work, homework, new_score student_works = homework.student_works.where("group_id = #{student_work.group_id} and id != #{student_work.id} and ultimate_score = 0") student_works.each do |st_work| - st_score = StudentWorksScore.new(user_id: new_score.user_id, score: new_score.score, + st_score = StudentWorksScore.new(user_id: new_score.user_id, score: new_score.score, homework_common_id: homework.id, reviewer_role: new_score.reviewer_role, comment: new_score.comment) score = StudentWorksScore.where(user_id: new_score.user_id, student_work_id: st_work.id, reviewer_role: new_score.reviewer_role).last diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index 7da7a177d..a6a919981 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -6,6 +6,7 @@ class HomeworkCommon < ApplicationRecord has_many :student_works, -> { where(is_delete: 0) } has_many :score_student_works, -> { where("is_delete = 0 and work_status != 0").order("work_score desc") }, class_name: "StudentWork" has_one :homework_detail_manual, dependent: :destroy + has_many :student_works_scores # 分组作业的设置 has_one :homework_detail_group, dependent: :destroy diff --git a/app/models/student_work.rb b/app/models/student_work.rb index a4ae63f04..462e06adc 100644 --- a/app/models/student_work.rb +++ b/app/models/student_work.rb @@ -46,7 +46,17 @@ class StudentWork < ApplicationRecord # 匿评次数 def student_comment_num - homework_common.homework_detail_manual.comment_status > 2 ? self.student_works_scores.select{|score| score.reviewer_role == 3}.group_by(&:user_id).count : 0 + homework_common.homework_detail_manual.comment_status > 2 && work_status > 0 ? self.student_works_scores.select{|score| score.reviewer_role == 3}.group_by(&:user_id).count : 0 + end + + # 学生评阅作品数 + def user_comment_num + if homework_common.homework_detail_manual.comment_status > 2 && work_status > 0 + count = homework_common.student_works_scores.select{|score| score.reviewer_role == 3 && score.user_id == user_id}.group_by(&:student_work_id).count + else + count = 0 + end + count end # 匿评申诉总条数 diff --git a/app/models/student_works_score.rb b/app/models/student_works_score.rb index a193d4e77..c978d10a8 100644 --- a/app/models/student_works_score.rb +++ b/app/models/student_works_score.rb @@ -2,6 +2,7 @@ class StudentWorksScore < ApplicationRecord #appeal_status: 0:正常;1:申诉中,2:撤销申诉;3:申诉成功;4:申诉被拒绝;5:申诉失效 belongs_to :student_work belongs_to :user + belongs_to :homework_common, optional: true has_many :journals_for_messages, -> { order('created_on desc') }, as: :jour, dependent: :destroy has_one :student_works_scores_appeal, dependent: :destroy has_many :tidings, as: :container, dependent: :destroy diff --git a/app/views/homework_commons/works_list.json.jbuilder b/app/views/homework_commons/works_list.json.jbuilder index 9fb2d6971..4faea3474 100644 --- a/app/views/homework_commons/works_list.json.jbuilder +++ b/app/views/homework_commons/works_list.json.jbuilder @@ -63,6 +63,7 @@ elsif @user_course_identity == Course::STUDENT if @homework.anonymous_comment json.student_comment_count @work.student_comment_num + json.user_comment_count @work.user_comment_num json.absence_penalty @work.absence_penalty end @@ -147,7 +148,8 @@ elsif @homework.homework_type == "group" || @homework.homework_type == "normal" # 作品匿评条数 if @homework.anonymous_comment - json.student_comment_count @homework_detail_manual.comment_status > 2 ? work.student_comment_num : 0 + json.student_comment_count @homework_detail_manual.comment_status > 2 && work.work_status > 0 ? work.student_comment_num : 0 + json.user_comment_count @homework_detail_manual.comment_status > 2 && work.work_status > 0 ? work.user_comment_num : 0 json.absence_penalty work.absence_penalty end diff --git a/db/migrate/20200310081817_add_homework_common_id_to_student_works_score.rb b/db/migrate/20200310081817_add_homework_common_id_to_student_works_score.rb new file mode 100644 index 000000000..bef02e7e1 --- /dev/null +++ b/db/migrate/20200310081817_add_homework_common_id_to_student_works_score.rb @@ -0,0 +1,5 @@ +class AddHomeworkCommonIdToStudentWorksScore < ActiveRecord::Migration[5.2] + def change + add_column :student_works_scores, :homework_common_id, :integer, default: 0, index: true + end +end diff --git a/db/migrate/20200310082003_migrate_student_works_score_homework.rb b/db/migrate/20200310082003_migrate_student_works_score_homework.rb new file mode 100644 index 000000000..3b8c1c10d --- /dev/null +++ b/db/migrate/20200310082003_migrate_student_works_score_homework.rb @@ -0,0 +1,7 @@ +class MigrateStudentWorksScoreHomework < ActiveRecord::Migration[5.2] + def change + StudentWorksScore.includes(:student_work).find_each do |score| + score.update_column("homework_common_id", score.student_work&.homework_common_id) + end + end +end From f871d6858d69093d370aff388e788c770a6587d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 10 Mar 2020 16:45:45 +0800 Subject: [PATCH 06/23] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../graduation/topics/GraduateTopicItem.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js index 524e7d208..551f7f585 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js @@ -10,9 +10,9 @@ class GraduateTopicItem extends Component{ constructor(props){ super(props); } - editTopic=(topicId)=>{ + editTopic=(topicId)=>{ let courseId=this.props.match.params.coursesId; - this.props.history.push(`/courses/${courseId}/graduation_topics/${topicId}/edit`); + this.props.history.push(`/classrooms/${courseId}/graduation_topics/${topicId}/edit`); } toDetailPage=(topicId)=>{ @@ -32,7 +32,7 @@ class GraduateTopicItem extends Component{ // } let courseId=this.props.match.params.coursesId; - this.props.history.push(`/courses/${courseId}/graduation_topics/${topicId}/detail`); + this.props.history.push(`/classrooms/${courseId}/graduation_topics/${topicId}/detail`); } render(){ const { checkBox, discussMessage, index,chooseTopic, @@ -107,17 +107,17 @@ class GraduateTopicItem extends Component{ :"" - } + } - +

{discussMessage.author} - + {discussMessage.selected_count} 已选 {discussMessage.confirmation_count} 已确认 @@ -136,13 +136,13 @@ class GraduateTopicItem extends Component{ isStudent && data.user_selected == true && discussMessage.user_topic_status==0 && chooseTopic(`${discussMessage.id}`,index,true)} style="blue" className="font-16 mr20"> 取消选题 - + } { isStudent && data.user_selected==false && (discussMessage.user_topic_status == null || discussMessage.user_topic_status == 2) && chooseTopic(`${discussMessage.id}`,index,false)} style="blue" className="font-16 mr20"> 选题 - + } @@ -154,4 +154,4 @@ class GraduateTopicItem extends Component{ ) } } -export default GraduateTopicItem; \ No newline at end of file +export default GraduateTopicItem; From 962d1da60bbde012491eb8c33fa3b0e4ba96f486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 10 Mar 2020 16:57:05 +0800 Subject: [PATCH 07/23] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/graduation/topics/GraduateTopicDetail.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js index b4bcaf0fa..4097a051e 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js @@ -88,7 +88,7 @@ class GraduateTopicDetail extends Component{ } }) } - + render(){ let { tableData, @@ -114,7 +114,7 @@ class GraduateTopicDetail extends Component{

{tableData && tableData.graduation_topic_name} - 返回 + 返回

@@ -141,7 +141,7 @@ class GraduateTopicDetail extends Component{ tab && tab==1&&
- +
{ tableData && tableData.users_count>tablePageSize && @@ -161,4 +161,4 @@ class GraduateTopicDetail extends Component{ ) } } -export default GraduateTopicDetail; \ No newline at end of file +export default GraduateTopicDetail; From ab37080796ce9052290cfba9b026b35b2d2d1cf3 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 10 Mar 2020 17:02:07 +0800 Subject: [PATCH 08/23] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E8=8E=B7=E5=8F=96=E8=A7=86=E9=A2=91=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/weapps/courses_controller.rb | 10 ++++++++++ app/views/weapps/courses/course_videos.json.jbuilder | 4 ++++ config/routes.rb | 1 + 3 files changed, 15 insertions(+) create mode 100644 app/views/weapps/courses/course_videos.json.jbuilder diff --git a/app/controllers/weapps/courses_controller.rb b/app/controllers/weapps/courses_controller.rb index e1ceb6fd3..c4dde41e0 100644 --- a/app/controllers/weapps/courses_controller.rb +++ b/app/controllers/weapps/courses_controller.rb @@ -48,6 +48,16 @@ class Weapps::CoursesController < Weapps::BaseController render_error(ex.message) end + def course_videos + videos = @course.videos.where(transcoded: true) + videos = custom_sort(videos, params[:sort_by], params[:sort_direction]) + #sql = "left join videos on videos.id=course_videos.video_id AND (videos.transcoded=1 OR videos.user_id = #{current_user.id})" + #@videos = paginate videos.joins(sql).includes(video: [user: :user_extension], user: :user_extension) + videos = videos.includes(user: :user_extension) + @count = videos.count + @videos = paginate videos + end + def basic_info @course = current_course end diff --git a/app/views/weapps/courses/course_videos.json.jbuilder b/app/views/weapps/courses/course_videos.json.jbuilder new file mode 100644 index 000000000..e14e4f5d8 --- /dev/null +++ b/app/views/weapps/courses/course_videos.json.jbuilder @@ -0,0 +1,4 @@ +json.count @count +json.videos @videos do |video| + json.partial! 'users/videos/video', locals: { video: video.video } +end \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 9c6b73ddc..db9b74bd2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1055,6 +1055,7 @@ Rails.application.routes.draw do get :course_groups get :basic_info get :course_activities + get :course_videos post :change_member_roles delete :delete_course_teachers delete :delete_course_students From f214cef15a972929c57ec9ceaabd7002b966c3a7 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 10 Mar 2020 17:02:54 +0800 Subject: [PATCH 09/23] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users/videos_controller.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/users/videos_controller.rb b/app/controllers/users/videos_controller.rb index 15365dc69..04e483a6b 100644 --- a/app/controllers/users/videos_controller.rb +++ b/app/controllers/users/videos_controller.rb @@ -57,7 +57,6 @@ class Users::VideosController < Users::BaseController video = Video.find_by(id: params[:id]) return render_forbidden unless video.user_id == current_user.id || current_user.admin? return render_not_found if video.blank? - return render_error('该状态下不能删除视频') unless video.published? video.destroy! From cf038e1542d850de47dc7b08748f7c25677c7e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 10 Mar 2020 17:04:28 +0800 Subject: [PATCH 10/23] =?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/coursesDetail/CoursesBanner.js | 2 +- .../courses/exercise/ExerciseNewCommon.js | 2 +- .../exercise/ExerciseReviewAndAnswer.js | 126 +++++++++--------- .../graduation/topics/GraduateTopicDetail.js | 4 +- .../src/modules/courses/new/Goldsubject.js | 2 +- .../react/src/modules/courses/poll/PollNew.js | 14 +- .../modules/courses/poll/PollNewQuestbank.js | 4 +- .../shixunHomework/ShixunWorkReport.js | 2 +- .../courses/shixunHomework/shixunHomework.js | 2 +- 9 files changed, 79 insertions(+), 79 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index 8c3520054..7d2791b15 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -294,7 +294,7 @@ class CoursesBanner extends Component { }) that.modalCancel(); message.success("删除成功", 1) - push.push(`/courses`) + push.push(`/classrooms`) } }) diff --git a/public/react/src/modules/courses/exercise/ExerciseNewCommon.js b/public/react/src/modules/courses/exercise/ExerciseNewCommon.js index 736f44308..0f61b9942 100644 --- a/public/react/src/modules/courses/exercise/ExerciseNewCommon.js +++ b/public/react/src/modules/courses/exercise/ExerciseNewCommon.js @@ -157,7 +157,7 @@ class ExerciseNewCommon extends Component{ const exercise_id = response.data.data.exercise_id; this.isEdit = true; - this.props.history.replace(`/courses/${courseId}/exercises/${exercise_id}/edit`); + this.props.history.replace(`/classrooms/${courseId}/exercises/${exercise_id}/edit`); } }) diff --git a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js index 20c40f025..337a9b7e9 100644 --- a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js +++ b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js @@ -30,8 +30,8 @@ const { Countdown } = Statistic; const Textarea =Input.TextArea const tagArray = [ - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', - 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', + 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' ] const $ = window.$; @@ -99,8 +99,8 @@ class ExerciseReviewAndAnswer extends Component{ if(this.props.coursedata.name){ this.getInfo(); } - - //window.addEventListener('scroll', this.handleScroll); + + //window.addEventListener('scroll', this.handleScroll); } remainTime=(time)=>{ @@ -170,7 +170,7 @@ class ExerciseReviewAndAnswer extends Component{ sureCommit=()=>{ let coursesId = this.props.match.params.coursesId; let eId = this.props.match.params.Id; - this.props.history.push(`/courses/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`); + this.props.history.push(`/classrooms/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`); } // 滚动定位 @@ -279,7 +279,7 @@ class ExerciseReviewAndAnswer extends Component{ //答题后更改题目列表得状态 changeQuestionStatus=(No,flag)=>{ this.setState( - (prevState) => ({ + (prevState) => ({ question_status : update(prevState.question_status, {[No]: { ques_status: {$set: flag} }}) }) ) @@ -287,7 +287,7 @@ class ExerciseReviewAndAnswer extends Component{ // 调分 showSetScore=(key,flag,position,type,id)=>{ this.setState( - (prevState) => ({ + (prevState) => ({ exercise_questions : update(prevState.exercise_questions, {[key]: { setScore: {$set: flag == undefined || flag==false ? true : false}}}) }),()=>{ if (position && type && (flag == undefined || flag==false)) { @@ -323,7 +323,7 @@ class ExerciseReviewAndAnswer extends Component{ // setTip:"请输入数字" // }) this.setState( - (prevState) => ({ + (prevState) => ({ ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "请输入数字"}}}) }) ) @@ -334,7 +334,7 @@ class ExerciseReviewAndAnswer extends Component{ // score:value // }) this.setState( - (prevState) => ({ + (prevState) => ({ ajustSore : update(prevState.ajustSore, {[index]: { inputSore: {$set: value},setTip:{$set: ""}}}) }) ) @@ -349,7 +349,7 @@ class ExerciseReviewAndAnswer extends Component{ let { ajustSore } = this.state; var index = ajustSore.map(function (item) { return item.id; }).indexOf(id); this.setState( - (prevState) => ({ + (prevState) => ({ ajustSore : update(prevState.ajustSore, {[index]: { desc: {$set: value}}}) }) ) @@ -368,7 +368,7 @@ class ExerciseReviewAndAnswer extends Component{ // setTip:"请输入分数" // }) this.setState( - (prevState) => ({ + (prevState) => ({ ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "请输入分数"}}}) }) ) @@ -379,7 +379,7 @@ class ExerciseReviewAndAnswer extends Component{ // setTip:"分数必须大于或者等于0" // }) this.setState( - (prevState) => ({ + (prevState) => ({ ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "分数必须大于或者等于0"}}}) }) ) @@ -390,7 +390,7 @@ class ExerciseReviewAndAnswer extends Component{ // setTip:"分数不能大于当前题目的分数" // }) this.setState( - (prevState) => ({ + (prevState) => ({ ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "分数不能大于当前题目的分数"}}}) }) ) @@ -407,15 +407,15 @@ class ExerciseReviewAndAnswer extends Component{ this.props.showNotification('调分成功'); this.getInfo(); // let statusScore = score==0 ? 0 : score > 0 && score < maxScore ? 2 : 1; - + // this.setState( - // (prevState) => ({ + // (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) => ({ + // (prevState) => ({ // ajustSore : update(prevState.ajustSore, {[index]: { desc: {$set: undefined},inputSore:{ $set:undefined }}}) // }) // ) @@ -430,14 +430,14 @@ class ExerciseReviewAndAnswer extends Component{ console.log(error); }) } - + } // 选择题,切换答案 changeOption = (index,ids) =>{ //console.log(index+" "+ids); this.setState( - (prevState) => ({ + (prevState) => ({ exercise_questions : update(prevState.exercise_questions, {[index]: { user_answer: {$set: ids} }}), }) ) @@ -446,7 +446,7 @@ class ExerciseReviewAndAnswer extends Component{ //简答题 显示和隐藏答案 changeA_flag=(index,status)=>{ this.setState( - (prevState) => ({ + (prevState) => ({ exercise_questions : update(prevState.exercise_questions, {[index]: { a_flag: {$set: status} }}) }) ) @@ -582,7 +582,7 @@ class ExerciseReviewAndAnswer extends Component{ returnBtn = () =>{ let coursesId=this.props.match.params.coursesId; let eId=this.props.match.params.Id; - this.props.history.push(`/courses/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`) + this.props.history.push(`/classrooms/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`) } deadline=(time)=>{ @@ -684,9 +684,9 @@ class ExerciseReviewAndAnswer extends Component{

{courseName} > - {data && data.left_banner_name} + {data && data.left_banner_name} > - {data && data.left_banner_name}详情> + {data && data.left_banner_name}详情> {exercise_answer_user&&exercise_answer_user.user_name}{data&&data.exercise.user_name}

@@ -722,23 +722,23 @@ class ExerciseReviewAndAnswer extends Component{ }

{ - exercise_types && exercise_types.q_singles > 0 && + exercise_types && exercise_types.q_singles > 0 && 单选题 {exercise_types.q_singles} 题,共 {exercise_types && exercise_types.q_singles_scores} 分 } { - exercise_types && exercise_types.q_doubles > 0 && + exercise_types && exercise_types.q_doubles > 0 && 多选题 {exercise_types.q_doubles} 题,共 {exercise_types && exercise_types.q_doubles_scores} 分 } { - exercise_types && exercise_types.q_judges > 0 && + exercise_types && exercise_types.q_judges > 0 && 判断题 {exercise_types.q_judges} 题,共 {exercise_types && exercise_types.q_judges_scores} 分 } { - exercise_types && exercise_types.q_nulls > 0 && + exercise_types && exercise_types.q_nulls > 0 && 填空题 {exercise_types.q_nulls} 题,共 {exercise_types && exercise_types.q_nulls_scores} 分 } { - exercise_types && exercise_types.q_mains > 0 && + exercise_types && exercise_types.q_mains > 0 && 简答题 {exercise_types.q_mains} 题,共 {exercise_types && exercise_types.q_mains_scores} 分 } { @@ -755,11 +755,11 @@ class ExerciseReviewAndAnswer extends Component{ { exercise_start_at && 开始答题时间:{ exercise_start_at && moment(exercise_start_at).format(format) } } - { - (isAdmin || (isStudent && exercise && exercise.exercise_status == 3)) && exerciseTotalScore && + { + (isAdmin || (isStudent && exercise && exercise.exercise_status == 3)) && exerciseTotalScore && 总分: { exerciseTotalScore } } - + { // 老师身份 || 学生身份且试卷已经截止 (isAdmin || (isStudent && exercise && exercise.exercise_status == 3)) && @@ -785,7 +785,7 @@ class ExerciseReviewAndAnswer extends Component{

} { - exercise_scores && exercise_scores.subjective_scores.length > 0 && + exercise_scores && exercise_scores.subjective_scores.length > 0 &&

主观题 @@ -804,8 +804,8 @@ class ExerciseReviewAndAnswer extends Component{

}
- } - + } + { //学生身份 且试卷还未截止 isStudent && exercise && exercise.exercise_status == 2 ? @@ -838,12 +838,12 @@ class ExerciseReviewAndAnswer extends Component{ { // 填空(一直都有调分),和简答题调分:老师身份 已经评分的才能出现调分按钮 - isAdmin && ((parseInt(item.answer_status) != 0 && item.question_type == 4) || item.question_type == 3 || item.question_type == 1) ? + isAdmin && ((parseInt(item.answer_status) != 0 && item.question_type == 4) || item.question_type == 3 || item.question_type == 1) ? this.showSetScore(key,item.setScore,item.q_position,item.question_type,item.question_id)}>调分:"" } { // 简答题,未评分的显示未批 - isAdmin && parseInt(item.answer_status) == 0 && item.question_type == 4 ? + isAdmin && parseInt(item.answer_status) == 0 && item.question_type == 4 ? 未批:"" } { @@ -869,16 +869,16 @@ class ExerciseReviewAndAnswer extends Component{

  • {/*

    */} -
  • { // 选择题和判断题共用 - (item.question_type == 0 || item.question_type == 2) && - } - + { //调分理由部分 - item.question_comments && item.question_comments.comment && (item.question_type == 3 || item.question_type == 4 || item.question_type == 1) && + item.question_comments && item.question_comments.comment && (item.question_type == 3 || item.question_type == 4 || item.question_type == 1) &&
    @@ -967,14 +967,14 @@ class ExerciseReviewAndAnswer extends Component{ *调分:
  • - 0 && list[0].inputSore} - step={0.1} + 0 && list[0].inputSore} + step={0.1} 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"} + 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}`} > @@ -1016,4 +1016,4 @@ class ExerciseReviewAndAnswer extends Component{ ) } } -export default ExerciseReviewAndAnswer \ No newline at end of file +export default ExerciseReviewAndAnswer diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js index 4097a051e..50368fe9c 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js @@ -107,7 +107,7 @@ class GraduateTopicDetail extends Component{

    {tableData && tableData.course_name} > - {tableData.graduation_name} + {tableData.graduation_name} > 选题详情

    @@ -134,7 +134,7 @@ class GraduateTopicDetail extends Component{ 取消选题 } { - isAdmin && 编辑 + isAdmin && 编辑 }
  • { diff --git a/public/react/src/modules/courses/new/Goldsubject.js b/public/react/src/modules/courses/new/Goldsubject.js index b3fd113da..6d637552d 100644 --- a/public/react/src/modules/courses/new/Goldsubject.js +++ b/public/react/src/modules/courses/new/Goldsubject.js @@ -720,7 +720,7 @@ class Goldsubject extends Component { {/* {Whethertocreateanewclassroom===true?"新建课堂":"编辑课堂"}*/} {/**/}

    - {Whethertocreateanewclassroom===true?"教学课堂":name} > {Whethertocreateanewclassroom===true?"新建课堂":"编辑课堂"} diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 3b50695e8..a3cbba89b 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -362,7 +362,7 @@ class PollNew extends Component { pollid: result.data.data.id, Newedit: false, }) - this.props.history.push(`/courses/${this.props.match.params.coursesId}/polls/${result.data.data.id}/detail?tab=2`) + this.props.history.push(`/classrooms/${this.props.match.params.coursesId}/polls/${result.data.data.id}/detail?tab=2`) } }) } @@ -2590,7 +2590,7 @@ class PollNew extends Component { if (result.data.status === 0) { // console.log("更新题目成功") // this.props.showNotification("保存成功"); - this.props.history.push(`/courses/${this.props.match.params.coursesId}/polls/${pollid}/detail?tab=2`) + this.props.history.push(`/classrooms/${this.props.match.params.coursesId}/polls/${pollid}/detail?tab=2`) } } catch (e) { @@ -2766,7 +2766,7 @@ class PollNew extends Component { // // let courseId=this.props.match.params.coursesId; // if(courseId===undefined){ - // this.props.history.push("/courses"); + // this.props.history.push("/classrooms"); // }else{ // this.props.history.push(this.props.current_user.first_category_url); // } @@ -2833,10 +2833,10 @@ class PollNew extends Component { { this.props.match.params.news === "new"? 问卷 + href={`/classrooms/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}>问卷 : 问卷 + href={`/classrooms/${this.props.match.params.coursesId}/polls/${left_banner_id}`}>问卷 } > @@ -2847,10 +2847,10 @@ class PollNew extends Component { className="fl color-black summaryname mt5">{this.props.match.params.news === undefined ? "新建问卷" : this.props.match.params.news === "new" ? "新建问卷" : "编辑问卷"}

    { this.props.match.params.news === "new" ? - : - }
    diff --git a/public/react/src/modules/courses/poll/PollNewQuestbank.js b/public/react/src/modules/courses/poll/PollNewQuestbank.js index ad68530e7..58aa916c4 100644 --- a/public/react/src/modules/courses/poll/PollNewQuestbank.js +++ b/public/react/src/modules/courses/poll/PollNewQuestbank.js @@ -385,7 +385,7 @@ class PollNewQuestbank extends Component { pollid: result.data.data.id, Newedit: false, }) - this.props.history.push(`/courses/${this.props.match.params.coursesId}/polls/${result.data.data.id}/detail?tab=2`) + this.props.history.push(`/classrooms/${this.props.match.params.coursesId}/polls/${result.data.data.id}/detail?tab=2`) } }) } @@ -4309,4 +4309,4 @@ export default PollNewQuestbank {/* */ } {/*}*/ -} \ No newline at end of file +} diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 28292d13b..5e4842574 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -138,7 +138,7 @@ class ShixunWorkReport extends Component { gotohome=()=>{ let courseId=this.props.match.params.coursesId; if(courseId===undefined){ - this.props.history.push("/courses"); + this.props.history.push("/classrooms"); }else{ this.props.history.push(this.props.current_user.first_category_url); } diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index 74f2ed7a2..605c649d8 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -974,7 +974,7 @@ class ShixunHomework extends Component{ gotohome=()=>{ let courseId=this.props.match.params.coursesId; if(courseId===undefined){ - this.props.history.push("/courses"); + this.props.history.push("/classrooms"); }else{ this.props.history.push(this.props.current_user.first_category_url); } From 60e26b0b129bb4fea9bb10ffae7af48c35e1c046 Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Tue, 10 Mar 2020 17:06:17 +0800 Subject: [PATCH 11/23] issue --- .../user/usersInfo/video/InfosVideo.css | 3 - .../user/usersInfo/video/InfosVideo.js | 58 ++++++++++++++----- .../user/usersInfo/video/VideoInReviewItem.js | 10 ++-- 3 files changed, 49 insertions(+), 22 deletions(-) diff --git a/public/react/src/modules/user/usersInfo/video/InfosVideo.css b/public/react/src/modules/user/usersInfo/video/InfosVideo.css index a28f7cf5d..60813fb0c 100644 --- a/public/react/src/modules/user/usersInfo/video/InfosVideo.css +++ b/public/react/src/modules/user/usersInfo/video/InfosVideo.css @@ -68,9 +68,6 @@ } -.videoInReviewItem .square-main { - background: #EAEAEA; -} .videoItem .time { color: #C0C4CC; } diff --git a/public/react/src/modules/user/usersInfo/video/InfosVideo.js b/public/react/src/modules/user/usersInfo/video/InfosVideo.js index 1557b0686..8f2f9dab3 100644 --- a/public/react/src/modules/user/usersInfo/video/InfosVideo.js +++ b/public/react/src/modules/user/usersInfo/video/InfosVideo.js @@ -65,8 +65,9 @@ function InfoVideo(props) { const videoEl = useRef(null); const { showNotification, history } = props; - const username = props.match.params.username - + const username = props.match.params.username; + const { user } = props; + console.log(user); function toUpload() { if (props.current_user.admin || (props.current_user.is_teacher && props.checkIfProfessionalCertification())) { history.push(`/users/${username}/videos/upload`) @@ -87,16 +88,15 @@ function InfoVideo(props) { sort_direction: sorts[1], // } + }).then((response) => { + setLoading(false) + if (response.data.videos) { + setvideos(response.data.videos) + setCount(response.data.count) + } + }).catch(() => { + setLoading(false) }) - .then((response) => { - setLoading(false) - if (response.data.videos) { - setvideos(response.data.videos) - setCount(response.data.count) - } - }).catch(() => { - setLoading(false) - }) } function fetchReviewvideos() { const fetchUrl = `/users/${username}/videos/review.json` @@ -184,9 +184,8 @@ function InfoVideo(props) { videoId = { videoId: item.id, title: item.title, - file_url: item.file_url, + file_url: item.play_url || item.file_url, cover_url: item.cover_url - } videoModalObj.setVisible(true) } @@ -218,6 +217,36 @@ function InfoVideo(props) { } + + function deleteVideo(item){ + props.confirm({ + content: '该视频将被删除,不可恢复', + subContent: '是否确认删除?', + + onOk: () => { + const url = `/users/${user && user.login}/videos/${item.id}.json`; + axios.delete(url).then(result => { + if (result) { + props.showNotification(`视频删除成功!`); + if (pageObj.current === 1) { + if (categoryObj.category === 'all') { + fetchvideos() + } else { + fetchReviewvideos() + } + } else { + pageObj.onChange(1) + } + } + }).catch(error => { + console.log(error); + }) + }, + onCancel() { + console.log('Cancel'); + }, + }); + } function getCopyText(file_url, cover_url) { return `` } @@ -397,7 +426,7 @@ function InfoVideo(props) { onEditVideo={onEditVideo} onMaskClick={onMaskClick} getCopyText={getCopyText} - + deleteVideo={user && ((user.login === item.user_login) || user.admin) ? deleteVideo : undefined} > ) }) @@ -416,6 +445,7 @@ function InfoVideo(props) { {...item} key={item.id} isReview={true} + deleteVideo={user && ((user.login === item.user_login) || user.admin) ? deleteVideo : undefined} > ) }) diff --git a/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js b/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js index 6849db062..4e0ca8fb2 100644 --- a/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js +++ b/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js @@ -79,9 +79,9 @@ function VideoInReviewItem (props) { } {!vv || (vv && vv)===0?"":vv}
    - { isReview != true &&
    +
    { - moveVideo && + isReview !== true && moveVideo && moveVideo(props)} style={{ marginTop: '1px', display: 'inline-block'}} @@ -98,7 +98,7 @@ function VideoInReviewItem (props) { } { - operation && + isReview !== true && operation && onEditVideo(props)} style={{ marginTop: '1px', display: 'inline-block'}} @@ -106,13 +106,13 @@ function VideoInReviewItem (props) { } { - !link ? + isReview !== true && !link ? :"" } -
    } +
    From bf3924f3891e533496d7c7940a7559c7d2b4f39b Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Tue, 10 Mar 2020 17:45:12 +0800 Subject: [PATCH 12/23] =?UTF-8?q?=E8=A7=86=E9=A2=91=E5=81=9C=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/user/usersInfo/video/InfosVideo.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/user/usersInfo/video/InfosVideo.js b/public/react/src/modules/user/usersInfo/video/InfosVideo.js index 8f2f9dab3..05d726628 100644 --- a/public/react/src/modules/user/usersInfo/video/InfosVideo.js +++ b/public/react/src/modules/user/usersInfo/video/InfosVideo.js @@ -67,7 +67,7 @@ function InfoVideo(props) { const { showNotification, history } = props; const username = props.match.params.username; const { user } = props; - console.log(user); + function toUpload() { if (props.current_user.admin || (props.current_user.is_teacher && props.checkIfProfessionalCertification())) { history.push(`/users/${username}/videos/upload`) @@ -144,7 +144,8 @@ function InfoVideo(props) { useEffect(() => { if (videoModalObj.visible == false) { // 关闭视频 - videoEl.current && videoEl.current.pause() + videoEl.current && videoEl.current.pause(); + videoId = {}; if (_clipboard) { _clipboard.destroy(); _clipboard = null; @@ -266,7 +267,7 @@ function InfoVideo(props) { className="showVideoModal" width={800 - 1} > - + {videoModalObj.visible && }
    Date: Tue, 10 Mar 2020 18:18:36 +0800 Subject: [PATCH 13/23] =?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/coursesDetail/CoursesLeftNav.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index b4912f6c4..f8e425128 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -181,6 +181,7 @@ class Coursesleftnav extends Component{ } componentDidMount() { + this.setState({ url:this.props.match.url }) @@ -545,7 +546,7 @@ class Coursesleftnav extends Component{ message:"提示", description:result.data.message }); - + if(positiontype==="files"){ this.updasaveNavmoda() From 8a5d0b14ca25746552314c718e10d7df2faee77a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 10 Mar 2020 18:24:24 +0800 Subject: [PATCH 14/23] =?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/coursesDetail/CoursesLeftNav.js | 2 +- .../react/src/modules/courses/shixunHomework/shixunHomework.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index f8e425128..6569b4f10 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -546,7 +546,7 @@ class Coursesleftnav extends Component{ message:"提示", description:result.data.message }); - + if(positiontype==="files"){ this.updasaveNavmoda() diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index 605c649d8..e32479735 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -1179,7 +1179,7 @@ class ShixunHomework extends Component{ {datas===undefined?"":datas.homeworks && datas.homeworks.length>1?this.props.isAdminOrCreator()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null? - 调整排序 + 调整排序 :"":"":""} From 210c2a3eff7bfb6054a42e627c6e2d03ef2817b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 10 Mar 2020 18:39:13 +0800 Subject: [PATCH 15/23] =?UTF-8?q?=E6=99=AE=E9=80=9A=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E3=80=81=E5=88=86=E7=BB=84=E4=BD=9C=E4=B8=9A=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=B7=B2=E8=AF=84=E6=95=B0=E3=80=81=E8=B5=84=E6=BA=90=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/Resource/index.js | 2 +- .../modules/courses/busyWork/CommonWorkList.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index 787865219..8f32699ce 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -916,7 +916,7 @@ class Fileslists extends Component{ { ` .filesnameslist{ - max-width: 486px; + max-width: 389px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js index 42ca215ba..6125c3e02 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkList.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js @@ -285,7 +285,23 @@ function buildColumns(that, student_works, studentData) { ), }) } + if (that.state.anonymous_comment) { + /** + 开启了匿评的才显示此列 + */ + columns.push({ + width: 84, + title:
    已评数
    , + key: 'user_comment_count', + dataIndex: 'user_comment_count', + render: (student_score, record) => ( + + {record.user_comment_count} + + ), + }) + } if (that.state.anonymous_appeal) { columns.push({ width: 70, From d413a2c1f71d67803a51952256c373cec155adf1 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 10 Mar 2020 18:53:02 +0800 Subject: [PATCH 16/23] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E7=9A=84=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/assets/javascripts/admins/courses/index.js | 2 +- app/controllers/course_second_categories_controller.rb | 7 +++++-- app/models/student_work.rb | 4 ++-- app/views/admins/courses/shared/_td.html.erb | 2 +- app/views/colleges/_course_statistics.html.erb | 2 +- app/views/course_groups/destroy.json.jbuilder | 2 +- app/views/courses/left_banner.json.jbuilder | 2 +- app/views/users/get_navigation_info.json.jbuilder | 4 ++-- 8 files changed, 14 insertions(+), 11 deletions(-) diff --git a/app/assets/javascripts/admins/courses/index.js b/app/assets/javascripts/admins/courses/index.js index 0e3473dff..58e962b8c 100644 --- a/app/assets/javascripts/admins/courses/index.js +++ b/app/assets/javascripts/admins/courses/index.js @@ -19,7 +19,7 @@ $(document).on('turbolinks:load', function() { var json = {}; json[s_name] = s_value; $.ajax({ - url: "/admins/courses/" + s_id, + url: "/admins/classrooms/" + s_id, type: "PUT", dataType:'script', data: json diff --git a/app/controllers/course_second_categories_controller.rb b/app/controllers/course_second_categories_controller.rb index b295c0f9f..62cbf83d9 100644 --- a/app/controllers/course_second_categories_controller.rb +++ b/app/controllers/course_second_categories_controller.rb @@ -36,10 +36,13 @@ class CourseSecondCategoriesController < ApplicationController # 更新相应对象的子目录id if @course_module.module_type == "shixun_homework" @category.homework_commons.update_all(course_second_category_id: 0) - @right_url = "/courses/#{@course.id}/shixun_homeworks/#{@course_module.id}" + @right_url = "/classrooms/#{@course.id}/shixun_homeworks/#{@course_module.id}" elsif @course_module.module_type == "attachment" Attachment.where(course_second_category_id: @category.id).update_all(course_second_category_id: 0) - @right_url = "/courses/#{@course.id}/files/#{@course_module.id}" + @right_url = "/classrooms/#{@course.id}/files/#{@course_module.id}" + elsif @course_module.module_type == "video" + @course.course_videos.where(course_second_category_id: @category.id).update_all(course_second_category_id: 0) + @right_url = "/classrooms/#{@course.id}/course_videos" end @category.destroy diff --git a/app/models/student_work.rb b/app/models/student_work.rb index 462e06adc..d695a6b00 100644 --- a/app/models/student_work.rb +++ b/app/models/student_work.rb @@ -46,13 +46,13 @@ class StudentWork < ApplicationRecord # 匿评次数 def student_comment_num - homework_common.homework_detail_manual.comment_status > 2 && work_status > 0 ? self.student_works_scores.select{|score| score.reviewer_role == 3}.group_by(&:user_id).count : 0 + homework_common.homework_detail_manual.comment_status > 2 && work_status > 0 ? self.student_works_scores.select{|score| score.reviewer_role == 3}.group_by(&:user_id).size : 0 end # 学生评阅作品数 def user_comment_num if homework_common.homework_detail_manual.comment_status > 2 && work_status > 0 - count = homework_common.student_works_scores.select{|score| score.reviewer_role == 3 && score.user_id == user_id}.group_by(&:student_work_id).count + count = homework_common.student_works_scores.select{|score| score.reviewer_role == 3 && score.user_id == user_id}.group_by(&:student_work_id).size else count = 0 end diff --git a/app/views/admins/courses/shared/_td.html.erb b/app/views/admins/courses/shared/_td.html.erb index 51cc4b199..87e6f305d 100644 --- a/app/views/admins/courses/shared/_td.html.erb +++ b/app/views/admins/courses/shared/_td.html.erb @@ -1,7 +1,7 @@ <%= list_index_no((params[:page] || 1).to_i, no) %> <%= course.id %> - <%= link_to(course.name, "/courses/#{course.id}", target: '_blank') %> + <%= link_to(course.name, "/classrooms/#{course.id}", target: '_blank') %> <%= course.course_members_count %> <%= get_attachment_count(course, 0) %> diff --git a/app/views/colleges/_course_statistics.html.erb b/app/views/colleges/_course_statistics.html.erb index e10739fb2..e544cf660 100644 --- a/app/views/colleges/_course_statistics.html.erb +++ b/app/views/colleges/_course_statistics.html.erb @@ -17,7 +17,7 @@ <% if @courses.present? %> <% @courses.each do |course| %> - <%= course.name %> + <%= course.name %> <% teacher_names = course.teacher_users.map(&:real_name).join('、') %> diff --git a/app/views/course_groups/destroy.json.jbuilder b/app/views/course_groups/destroy.json.jbuilder index 0fbd93d7f..a45cbd750 100644 --- a/app/views/course_groups/destroy.json.jbuilder +++ b/app/views/course_groups/destroy.json.jbuilder @@ -1,3 +1,3 @@ json.status 0 json.message "删除成功" -json.right_url "/courses/#{@course.id}/students" \ No newline at end of file +json.right_url "/classrooms/#{@course.id}/students" \ No newline at end of file diff --git a/app/views/courses/left_banner.json.jbuilder b/app/views/courses/left_banner.json.jbuilder index f3b80b4f5..ecd8fe127 100644 --- a/app/views/courses/left_banner.json.jbuilder +++ b/app/views/courses/left_banner.json.jbuilder @@ -21,7 +21,7 @@ json.course_modules @course_modules.each do |mod| json.position board.position json.category_count board.messages_count json.category_type "messages" - json.second_category_url "/courses/#{@course.id}/boards/#{board.id}" + json.second_category_url "/classrooms/#{@course.id}/boards/#{board.id}" end end else diff --git a/app/views/users/get_navigation_info.json.jbuilder b/app/views/users/get_navigation_info.json.jbuilder index 8af3691f3..a9f835501 100644 --- a/app/views/users/get_navigation_info.json.jbuilder +++ b/app/views/users/get_navigation_info.json.jbuilder @@ -4,11 +4,11 @@ json.top do json.course_url "/courses" json.competitions_url "#{@old_domain}/competitions" json.topic_url "/forums" - json.new_course_url "/courses/new" + json.new_course_url "/classrooms/new" json.new_shixun_url "/shixuns/new" json.new_shixun_path_url "/paths/new" json.new_project_url "#{@old_domain}/projects/new" - json.join_course_url "/courses/join_course_multi_role" + json.join_course_url "/classrooms/join_course_multi_role" json.join_project_url "#{@old_domain}/applied_project/applied_project_info" json.message_url "#{@user_url}/user_tidings" json.new_message @new_message From 2c34d6991fafccf20ae75f751df8c1f35b9d89ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 10 Mar 2020 19:05:43 +0800 Subject: [PATCH 17/23] =?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/question/component/QuestionModal.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/question/component/QuestionModal.js b/public/react/src/modules/question/component/QuestionModal.js index 87338faa7..65224f26d 100644 --- a/public/react/src/modules/question/component/QuestionModal.js +++ b/public/react/src/modules/question/component/QuestionModal.js @@ -41,7 +41,13 @@ class QuestionModal extends Component { "" }
    - this.props.modalCancel()}>取消 + { + this.props.titilesm&&this.props.titilesm==="功能正在内测中,敬请期待"? + "" + : + this.props.modalCancel()}>取消 + } + this.props.setDownload()}>{this.props.boolok?this.props.boolok:"确定"}
    From 3f3d33a671cc8da27afd5db1b82c57124f1bf5c1 Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Tue, 10 Mar 2020 19:15:42 +0800 Subject: [PATCH 18/23] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/user/usersInfo/video/InfosVideo.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/user/usersInfo/video/InfosVideo.css b/public/react/src/modules/user/usersInfo/video/InfosVideo.css index 60813fb0c..fb78f9e85 100644 --- a/public/react/src/modules/user/usersInfo/video/InfosVideo.css +++ b/public/react/src/modules/user/usersInfo/video/InfosVideo.css @@ -14,6 +14,7 @@ margin-right: 26px; margin-bottom: 26px; position: relative; + max-height: 258px; } .videoItem:nth-child(4n+0) { margin-right: 0px; @@ -65,7 +66,7 @@ .videoItem .square-main .title{ max-width: 256px; line-height: 18px; - + } .videoItem .time { From d0b8a4e0fcd9a26ee857b7a7f34032fae9f35d9e Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 10 Mar 2020 19:55:42 +0800 Subject: [PATCH 19/23] =?UTF-8?q?=E7=AD=BE=E5=88=B0=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/weapps/attendances_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/weapps/attendances_controller.rb b/app/controllers/weapps/attendances_controller.rb index ea2688cc5..6cc2dda4e 100644 --- a/app/controllers/weapps/attendances_controller.rb +++ b/app/controllers/weapps/attendances_controller.rb @@ -134,7 +134,7 @@ class Weapps::AttendancesController < ApplicationController a_start_time = "#{@attendance.attendance_date} #{@attendance.start_time}".to_time if a_start_time > Time.now - @attendance.update!(end_time: Time.current, start_time: Time.current) + @attendance.update!(end_time: Time.current, start_time: Time.current, attendance_date: Date.current) else @attendance.update!(end_time: Time.current) end From 5259846636527f3dd091509e8429eecfbedab290 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 10 Mar 2020 20:01:18 +0800 Subject: [PATCH 20/23] =?UTF-8?q?=E4=BD=9C=E5=93=81=E6=88=90=E7=BB=A9?= =?UTF-8?q?=E7=9A=84=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/export_helper.rb | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/app/helpers/export_helper.rb b/app/helpers/export_helper.rb index 64ad114bd..6d0ae2422 100644 --- a/app/helpers/export_helper.rb +++ b/app/helpers/export_helper.rb @@ -348,7 +348,7 @@ module ExportHelper normal_head_cells = %w(作品描述 教师评分 教辅评分) anon_boolean = homework.anonymous_comment if anon_boolean - head_cells_add = %w(匿名评分 缺评扣分 违规匿评申诉扣分) + head_cells_add = %w(匿名评分 已评数 缺评扣分 违规匿评申诉扣分) else head_cells_add = [] end @@ -395,36 +395,37 @@ module ExportHelper w_10 = w.teaching_asistant_score.nil? ? "未评分" : w.teaching_asistant_score.round(1) if anon_boolean w_11 = w.student_score.nil? ? "未评分" : w.student_score.round(1) - w_12 = (homework.teacher_priority == 1 && !w.teacher_score.nil?) ? 0 : w.absence_penalty #缺评扣分 + w_12 = w.user_comment_num + w_13 = (homework.teacher_priority == 1 && !w.teacher_score.nil?) ? 0 : w.absence_penalty #缺评扣分 home_work_de = homework.homework_detail_manual - w_13 = home_work_de.present? ? home_work_de.appeal_penalty : "--" #违规匿评申诉扣分 + w_14 = home_work_de.present? ? home_work_de.appeal_penalty : "--" #违规匿评申诉扣分 else - w_11,w_12,w_13 = nil + w_11,w_12,w_13,w_14 = nil end if allow_late_boolean #允许迟交 - w_14 = (homework.teacher_priority == 1 && !w.teacher_score.nil?) ? 0 : w.late_penalty #迟交扣分 + w_15 = (homework.teacher_priority == 1 && !w.teacher_score.nil?) ? 0 : w.late_penalty #迟交扣分 else - w_14 = nil + w_15 = nil end - w_15 = w.work_score.nil? ? "未评分" : w.work_score.round(1) - w_16 = w.commit_time ? format_time(w.commit_time) : "--" - w_17 = w.update_time ? format_time(w.update_time) : "--" + w_16 = w.work_score.nil? ? "未评分" : w.work_score.round(1) + w_17 = w.commit_time ? format_time(w.commit_time) : "--" + w_18 = w.update_time ? format_time(w.update_time) : "--" teacher_comments = w.student_works_scores if teacher_comments.present? - w_18 = "" + w_19 = "" teacher_comments.each do |t| user_name = t.user&.real_name user_time = format_time(t.updated_at) user_score = t&.score user_comment = t.comment.present? ? t.comment : "--" comment_title = "#{user_name}: #{user_time.to_s} #{user_score.to_s}分\n#{user_comment}\n\n" - w_18 = w_18 + comment_title + w_19 = w_19 + comment_title end else - w_18 = "--" + w_19 = "--" end - row_cells_column = [w_1,w_2,w_3,w_3_1,w_4,w_5,w_6,w_7,w_8,w_9,w_10,w_11,w_12,w_13,w_14,w_15,w_16,w_17,w_18] + row_cells_column = [w_1,w_2,w_3,w_3_1,w_4,w_5,w_6,w_7,w_8,w_9,w_10,w_11,w_12,w_13,w_14,w_15,w_16,w_17,w_18,w_19] row_cells_column = row_cells_column.reject(&:blank?) @work_cells_column.push(row_cells_column) end From 303546c40a9635f3e905d0312b3e94ec03dbdd94 Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Tue, 10 Mar 2020 20:08:53 +0800 Subject: [PATCH 21/23] =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesDetail/CoursesLeftNav.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index 6569b4f10..535573d02 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -465,13 +465,14 @@ class Coursesleftnav extends Component{ Modalstopval:"隐藏后将不再显示此模块,", ModalsBottomval:"后续可在课堂设置中重新勾选模块恢复显示", ModalSave:()=>this.edithiddens(id), + loadtype:false }) }else{ this.setState({ ModalsType:true, Modalstopval:"您不能隐藏所有课堂模块,请至少保留", ModalsBottomval:"其中一个模块。", - loadtype:true, + loadtype:false, ModalSave:()=>this.cannerNavmoda(), }) } @@ -674,6 +675,7 @@ class Coursesleftnav extends Component{ ModalsType:false, Modalstopval:"", loadtype:false, + antIcon:false }) notification.open({ message: "删除成功", @@ -692,6 +694,7 @@ class Coursesleftnav extends Component{ axios.delete(url).then((result)=>{ if(result.data.status===0){ this.updatadeleteSecondary(mainurl || result.data.right_url); + } }).catch((error)=>{ console.log(error) @@ -699,17 +702,16 @@ class Coursesleftnav extends Component{ } deleteSecondary=(e,type,id,mainurl)=>{ e.stopPropagation();//阻止冒泡 + debugger; if(type===1){ let url="/course_second_categories/"+id+".json" - this.setState({ - ModalsType:true, - Modalstopval:"该目录下的内容将被移动到父目录,", - ModalsBottomval:"是否确认删除?", - ModalSave:()=>this.deletenavchilds(url,mainurl), - loadtype:false + loadtype:false, + ModalsType:true, + Modalstopval:"该目录下的内容将被移动到父目录,", + ModalsBottomval:"是否确认删除?", + ModalSave:()=>this.deletenavchilds(url,mainurl) }) - }else if(type===2){ let url="/course_groups/"+id+".json" this.setState({ From 8434bce93742af38686cd45e4d60f76d9c7cd7a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 10 Mar 2020 20:17:09 +0800 Subject: [PATCH 22/23] =?UTF-8?q?=E6=99=AE=E9=80=9A=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E3=80=81=E5=88=86=E7=BB=84=E4=BD=9C=E4=B8=9A=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=B7=B2=E8=AF=84=E6=95=B0=E3=80=81=E8=B5=84=E6=BA=90=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/Resource/index.js | 2 +- .../react/src/modules/courses/coursesDetail/CoursesLeftNav.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index 8f32699ce..b35eb4e06 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -916,7 +916,7 @@ class Fileslists extends Component{ { ` .filesnameslist{ - max-width: 389px; + max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index 6569b4f10..04bbe71ba 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -692,6 +692,9 @@ class Coursesleftnav extends Component{ axios.delete(url).then((result)=>{ if(result.data.status===0){ this.updatadeleteSecondary(mainurl || result.data.right_url); + this.setState({ + antIcon:false + }) } }).catch((error)=>{ console.log(error) From 4e84b139d3a3de3d963ee883b12895da44d4fb3d Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 10 Mar 2020 20:58:24 +0800 Subject: [PATCH 23/23] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_commons/works_list.json.jbuilder | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/homework_commons/works_list.json.jbuilder b/app/views/homework_commons/works_list.json.jbuilder index 4faea3474..7c51432d0 100644 --- a/app/views/homework_commons/works_list.json.jbuilder +++ b/app/views/homework_commons/works_list.json.jbuilder @@ -123,6 +123,7 @@ elsif @homework.homework_type == "group" || @homework.homework_type == "normal" json.student_works @student_works.each do |work| if @is_evaluation json.(work, :id, :work_status, :update_time) + json.user_comment_count @homework_detail_manual.comment_status > 2 && work.work_status > 0 ? work.user_comment_num : 0 json.student_score work_score_format(anon_comments(@current_user, work.id).last.try(:score), false, true) # json.student_comment_count anon_comments(@current_user, work.id).count