@@ -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 2/9] =?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 3/9] =?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 4/9] =?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 &&