Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

courseware
anke1460 5 years ago
commit 4409448a62

@ -19,7 +19,7 @@ $(document).on('turbolinks:load', function() {
var json = {}; var json = {};
json[s_name] = s_value; json[s_name] = s_value;
$.ajax({ $.ajax({
url: "/admins/courses/" + s_id, url: "/admins/classrooms/" + s_id,
type: "PUT", type: "PUT",
dataType:'script', dataType:'script',
data: json data: json

@ -36,10 +36,13 @@ class CourseSecondCategoriesController < ApplicationController
# 更新相应对象的子目录id # 更新相应对象的子目录id
if @course_module.module_type == "shixun_homework" if @course_module.module_type == "shixun_homework"
@category.homework_commons.update_all(course_second_category_id: 0) @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" elsif @course_module.module_type == "attachment"
Attachment.where(course_second_category_id: @category.id).update_all(course_second_category_id: 0) 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 end
@category.destroy @category.destroy

@ -374,6 +374,7 @@ class StudentWorksController < ApplicationController
new_score.comment = params[:comment] if params[:comment] && params[:comment].strip != "" new_score.comment = params[:comment] if params[:comment] && params[:comment].strip != ""
new_score.user_id = current_user.id new_score.user_id = current_user.id
new_score.student_work_id = @work.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 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) @work.student_works_scores.where.not(score: nil).update_all(is_invalid: 1)
reviewer_role = @user_course_identity == Course::ASSISTANT_PROFESSOR ? 2 : 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]}", new_score = StudentWorksScore.new(student_work_id: @work.id, score: params[:score].to_f,
user_id: current_user.id, reviewer_role: reviewer_role, is_ultimate: 1) 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! new_score.save!
# 如果作品是未提交的状态则更新为已提交 # 如果作品是未提交的状态则更新为已提交
@ -844,7 +847,7 @@ class StudentWorksController < ApplicationController
def add_score_to_member student_work, homework, new_score 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 = 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| 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) 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 score = StudentWorksScore.where(user_id: new_score.user_id, student_work_id: st_work.id, reviewer_role: new_score.reviewer_role).last

@ -54,9 +54,8 @@ class Users::VideosController < Users::BaseController
def destroy def destroy
video = Video.find_by(id: params[:id]) 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_not_found if video.blank?
return render_error('该状态下不能删除视频') unless video.published?
video.destroy! video.destroy!

@ -130,8 +130,14 @@ class Weapps::AttendancesController < ApplicationController
def end def end
a_end_time = "#{@attendance.attendance_date} #{@attendance.end_time}".to_time a_end_time = "#{@attendance.attendance_date} #{@attendance.end_time}".to_time
tip_exception("该签到已截止") unless @attendance.current_attendance? tip_exception("该签到已截止") if a_end_time < Time.now
@attendance.update!(end_time: Time.current)
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_date: Date.current)
else
@attendance.update!(end_time: Time.current)
end
render_ok render_ok
end end

@ -48,6 +48,16 @@ class Weapps::CoursesController < Weapps::BaseController
render_error(ex.message) render_error(ex.message)
end 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 def basic_info
@course = current_course @course = current_course
end end

@ -348,7 +348,7 @@ module ExportHelper
normal_head_cells = %w(作品描述 教师评分 教辅评分) normal_head_cells = %w(作品描述 教师评分 教辅评分)
anon_boolean = homework.anonymous_comment anon_boolean = homework.anonymous_comment
if anon_boolean if anon_boolean
head_cells_add = %w(匿名评分 缺评扣分 违规匿评申诉扣分) head_cells_add = %w(匿名评分 已评数 缺评扣分 违规匿评申诉扣分)
else else
head_cells_add = [] head_cells_add = []
end end
@ -395,36 +395,37 @@ module ExportHelper
w_10 = w.teaching_asistant_score.nil? ? "未评分" : w.teaching_asistant_score.round(1) w_10 = w.teaching_asistant_score.nil? ? "未评分" : w.teaching_asistant_score.round(1)
if anon_boolean if anon_boolean
w_11 = w.student_score.nil? ? "未评分" : w.student_score.round(1) 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 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 else
w_11,w_12,w_13 = nil w_11,w_12,w_13,w_14 = nil
end end
if allow_late_boolean #允许迟交 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 else
w_14 = nil w_15 = nil
end end
w_15 = w.work_score.nil? ? "未评分" : w.work_score.round(1) w_16 = w.work_score.nil? ? "未评分" : w.work_score.round(1)
w_16 = w.commit_time ? format_time(w.commit_time) : "--" w_17 = w.commit_time ? format_time(w.commit_time) : "--"
w_17 = w.update_time ? format_time(w.update_time) : "--" w_18 = w.update_time ? format_time(w.update_time) : "--"
teacher_comments = w.student_works_scores teacher_comments = w.student_works_scores
if teacher_comments.present? if teacher_comments.present?
w_18 = "" w_19 = ""
teacher_comments.each do |t| teacher_comments.each do |t|
user_name = t.user&.real_name user_name = t.user&.real_name
user_time = format_time(t.updated_at) user_time = format_time(t.updated_at)
user_score = t&.score user_score = t&.score
user_comment = t.comment.present? ? t.comment : "--" user_comment = t.comment.present? ? t.comment : "--"
comment_title = "#{user_name} #{user_time.to_s} #{user_score.to_s}\n#{user_comment}\n\n" 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 end
else else
w_18 = "--" w_19 = "--"
end 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?) row_cells_column = row_cells_column.reject(&:blank?)
@work_cells_column.push(row_cells_column) @work_cells_column.push(row_cells_column)
end end

@ -6,6 +6,7 @@ class HomeworkCommon < ApplicationRecord
has_many :student_works, -> { where(is_delete: 0) } 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_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_one :homework_detail_manual, dependent: :destroy
has_many :student_works_scores
# 分组作业的设置 # 分组作业的设置
has_one :homework_detail_group, dependent: :destroy has_one :homework_detail_group, dependent: :destroy

@ -46,7 +46,17 @@ class StudentWork < ApplicationRecord
# 匿评次数 # 匿评次数
def student_comment_num 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).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).size
else
count = 0
end
count
end end
# 匿评申诉总条数 # 匿评申诉总条数

@ -2,6 +2,7 @@ class StudentWorksScore < ApplicationRecord
#appeal_status: 0正常1申诉中2撤销申诉3申诉成功4申诉被拒绝5申诉失效 #appeal_status: 0正常1申诉中2撤销申诉3申诉成功4申诉被拒绝5申诉失效
belongs_to :student_work belongs_to :student_work
belongs_to :user belongs_to :user
belongs_to :homework_common, optional: true
has_many :journals_for_messages, -> { order('created_on desc') }, as: :jour, dependent: :destroy has_many :journals_for_messages, -> { order('created_on desc') }, as: :jour, dependent: :destroy
has_one :student_works_scores_appeal, dependent: :destroy has_one :student_works_scores_appeal, dependent: :destroy
has_many :tidings, as: :container, dependent: :destroy has_many :tidings, as: :container, dependent: :destroy

@ -1,7 +1,7 @@
<td><%= list_index_no((params[:page] || 1).to_i, no) %></td> <td><%= list_index_no((params[:page] || 1).to_i, no) %></td>
<td><%= course.id %></td> <td><%= course.id %></td>
<td class="text-left"> <td class="text-left">
<%= link_to(course.name, "/courses/#{course.id}", target: '_blank') %> <%= link_to(course.name, "/classrooms/#{course.id}", target: '_blank') %>
</td> </td>
<td><%= course.course_members_count %></td> <td><%= course.course_members_count %></td>
<td><%= get_attachment_count(course, 0) %></td> <td><%= get_attachment_count(course, 0) %></td>

@ -17,7 +17,7 @@
<% if @courses.present? %> <% if @courses.present? %>
<% @courses.each do |course| %> <% @courses.each do |course| %>
<tr> <tr>
<td class="text-left"><a href="/courses/<%= course.id %>/students" target="_blank" class="d-inline-block text-truncate" style="max-width: 220px"><%= course.name %></a></td> <td class="text-left"><a href="/classrooms/<%= course.id %>/students" target="_blank" class="d-inline-block text-truncate" style="max-width: 220px"><%= course.name %></a></td>
<% teacher_names = course.teacher_users.map(&:real_name).join('、') %> <% teacher_names = course.teacher_users.map(&:real_name).join('、') %>
<td class="text-left"> <td class="text-left">
<span class="d-inline-block text-truncate" style="max-width: 150px" data-toggle="tooltip" title="<%= teacher_names %>"> <span class="d-inline-block text-truncate" style="max-width: 150px" data-toggle="tooltip" title="<%= teacher_names %>">

@ -1,3 +1,3 @@
json.status 0 json.status 0
json.message "删除成功" json.message "删除成功"
json.right_url "/courses/#{@course.id}/students" json.right_url "/classrooms/#{@course.id}/students"

@ -21,7 +21,7 @@ json.course_modules @course_modules.each do |mod|
json.position board.position json.position board.position
json.category_count board.messages_count json.category_count board.messages_count
json.category_type "messages" 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
end end
else else

@ -63,6 +63,7 @@ elsif @user_course_identity == Course::STUDENT
if @homework.anonymous_comment if @homework.anonymous_comment
json.student_comment_count @work.student_comment_num json.student_comment_count @work.student_comment_num
json.user_comment_count @work.user_comment_num
json.absence_penalty @work.absence_penalty json.absence_penalty @work.absence_penalty
end end
@ -122,6 +123,7 @@ elsif @homework.homework_type == "group" || @homework.homework_type == "normal"
json.student_works @student_works.each do |work| json.student_works @student_works.each do |work|
if @is_evaluation if @is_evaluation
json.(work, :id, :work_status, :update_time) 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_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 # json.student_comment_count anon_comments(@current_user, work.id).count
@ -147,7 +149,8 @@ elsif @homework.homework_type == "group" || @homework.homework_type == "normal"
# 作品匿评条数 # 作品匿评条数
if @homework.anonymous_comment 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 json.absence_penalty work.absence_penalty
end end

@ -4,11 +4,11 @@ json.top do
json.course_url "/courses" json.course_url "/courses"
json.competitions_url "#{@old_domain}/competitions" json.competitions_url "#{@old_domain}/competitions"
json.topic_url "/forums" 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_url "/shixuns/new"
json.new_shixun_path_url "/paths/new" json.new_shixun_path_url "/paths/new"
json.new_project_url "#{@old_domain}/projects/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.join_project_url "#{@old_domain}/applied_project/applied_project_info"
json.message_url "#{@user_url}/user_tidings" json.message_url "#{@user_url}/user_tidings"
json.new_message @new_message json.new_message @new_message

@ -0,0 +1,4 @@
json.count @count
json.videos @videos do |video|
json.partial! 'users/videos/video', locals: { video: video.video }
end

@ -1055,6 +1055,7 @@ Rails.application.routes.draw do
get :course_groups get :course_groups
get :basic_info get :basic_info
get :course_activities get :course_activities
get :course_videos
post :change_member_roles post :change_member_roles
delete :delete_course_teachers delete :delete_course_teachers
delete :delete_course_students delete :delete_course_students

@ -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

@ -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

@ -916,7 +916,7 @@ class Fileslists extends Component{
{ {
` `
.filesnameslist{ .filesnameslist{
max-width: 486px; max-width: 200px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;

@ -247,8 +247,8 @@ class CommonWorkDetailIndex extends Component{
`}</style> `}</style>
{current_user && <CBreadcrumb items={[ {current_user && <CBreadcrumb items={[
{ to: current_user&&current_user.first_category_url , name: course_name}, { to: current_user&&current_user.first_category_url , name: course_name},
{ to: `/courses/${courseId}/${moduleEngName}/${category_id}`, name: category_name }, { to: `/classrooms/${courseId}/${moduleEngName}/${category_id}`, name: category_name },
window.location.pathname.indexOf('appraise') == -1 ? { } : { to: `/courses/${courseId}/${moduleEngName}/${workId}/list`, name: '作业详情' }, window.location.pathname.indexOf('appraise') == -1 ? { } : { to: `/classrooms/${courseId}/${moduleEngName}/${workId}/list`, name: '作业详情' },
// 1. 与上一条联动当匿评他人作品时TA人作品的作者真实姓名切换为“匿名” // 1. 与上一条联动当匿评他人作品时TA人作品的作者真实姓名切换为“匿名”
window.location.pathname.indexOf('appraise') == -1 ? { name: '作业详情' } : { name: author_name }, window.location.pathname.indexOf('appraise') == -1 ? { name: '作业详情' } : { name: author_name },
// window.location.pathname.indexOf('appraise') == -1 ? { } : { to: `/courses/${courseId}/${moduleEngName}/${workId}/list`, name: '作品列表' }, // window.location.pathname.indexOf('appraise') == -1 ? { } : { to: `/courses/${courseId}/${moduleEngName}/${workId}/list`, name: '作品列表' },
@ -296,20 +296,20 @@ class CommonWorkDetailIndex extends Component{
<Link <Link
onClick={() => this.setState({moduleName: '作品列表'})} onClick={() => this.setState({moduleName: '作品列表'})}
className={`${isListModule ? 'active' : '' } `} className={`${isListModule ? 'active' : '' } `}
to={`/courses/${courseId}/${moduleEngName}/${workId}/list`}>作品列表</Link> to={`/classrooms/${courseId}/${moduleEngName}/${workId}/list`}>作品列表</Link>
<Link <Link
onClick={() => this.setState({moduleName: '作业描述'})} onClick={() => this.setState({moduleName: '作业描述'})}
className={`${childModuleName == '作业描述' ? 'active' : '' } `} className={`${childModuleName == '作业描述' ? 'active' : '' } `}
to={`/courses/${courseId}/${moduleEngName}/${workId}/question`}>作业描述</Link> to={`/classrooms/${courseId}/${moduleEngName}/${workId}/question`}>作业描述</Link>
{view_answer == true && <Link {view_answer == true && <Link
onClick={() => this.setState({moduleName: '参考答案'})} onClick={() => this.setState({moduleName: '参考答案'})}
className={`${childModuleName == '参考答案' ? 'active' : '' } `} className={`${childModuleName == '参考答案' ? 'active' : '' } `}
to={`/courses/${courseId}/${moduleEngName}/${workId}/answer`}>参考答案</Link>} to={`/classrooms/${courseId}/${moduleEngName}/${workId}/answer`}>参考答案</Link>}
<Link <Link
onClick={() => this.setState({moduleName: '设置'})} onClick={() => this.setState({moduleName: '设置'})}
className={`${childModuleName == '设置' ? 'active' : '' } `} className={`${childModuleName == '设置' ? 'active' : '' } `}
style={{paddingLeft:this.props.isAdmin()?'38px':'20px'}} style={{paddingLeft:this.props.isAdmin()?'38px':'20px'}}
to={`/courses/${courseId}/${moduleEngName}/${workId}/setting`}>{this.props.isAdmin()?"设置":"得分规则"}</Link> to={`/classrooms/${courseId}/${moduleEngName}/${workId}/setting`}>{this.props.isAdmin()?"设置":"得分规则"}</Link>
{/* { this.props.tabRightComponents } */} {/* { this.props.tabRightComponents } */}

@ -285,7 +285,23 @@ function buildColumns(that, student_works, studentData) {
), ),
}) })
} }
if (that.state.anonymous_comment) {
/**
开启了匿评的才显示此列
*/
columns.push({
width: 84,
title: <div style={{color: 'rgba(0,0,0,.85)'}}>已评数</div>,
key: 'user_comment_count',
dataIndex: 'user_comment_count',
render: (student_score, record) => (
<span style={{color:'#989898', cursor: 'default'}}>
{record.user_comment_count}
</span>
),
})
}
if (that.state.anonymous_appeal) { if (that.state.anonymous_appeal) {
columns.push({ columns.push({
width: 70, width: 70,

@ -51,9 +51,9 @@ export function RouteHOC(options = {}) {
const topicId = _courseId.topicId const topicId = _courseId.topicId
const workId = _courseId.workId const workId = _courseId.workId
const courseId = _courseId.coursesId 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 { } 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") { if (typeof _courseId == "object") {
const workId = _courseId.workId const workId = _courseId.workId
const courseId = _courseId.coursesId 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 { } else {
this.props.history.push(`/courses/${_courseId}/${secondName}/${_workId}/edit`) this.props.history.push(`/classrooms/${_courseId}/${secondName}/${_workId}/edit`)
} }
} }
toWorkDetailPage = (_courseId, _workId, _studentWorkId) => { toWorkDetailPage = (_courseId, _workId, _studentWorkId) => {
@ -73,9 +73,9 @@ export function RouteHOC(options = {}) {
const workId = _courseId.workId const workId = _courseId.workId
const courseId = _courseId.coursesId const courseId = _courseId.coursesId
const studentWorkId = _courseId.studentWorkId 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 { } else {
window.open(`/courses/${_courseId}/${secondName}/${_workId}/${_studentWorkId}/appraise`); window.open(`/classrooms/${_courseId}/${secondName}/${_workId}/${_studentWorkId}/appraise`);
} }
} }
toWorkDetailPage2 = (e, _courseId, _workId, _studentWorkId) => { toWorkDetailPage2 = (e, _courseId, _workId, _studentWorkId) => {
@ -86,23 +86,23 @@ export function RouteHOC(options = {}) {
const workId = _courseId.workId const workId = _courseId.workId
const courseId = _courseId.coursesId const courseId = _courseId.coursesId
const studentWorkId = _courseId.studentWorkId 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 { } else {
window.open(`/courses/${_courseId}/${secondName}/${_workId}/${_studentWorkId}/appraise`); window.open(`/classrooms/${_courseId}/${secondName}/${_workId}/${_studentWorkId}/appraise`);
} }
} }
toNewPage = (courseId) => { toNewPage = (courseId) => {
const secondName = this.getModuleName() 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) => { toListPage = (_courseId, _workId) => {
const secondName = this.getModuleName() const secondName = this.getModuleName()
if (typeof _courseId == "object") { if (typeof _courseId == "object") {
const workId = _courseId.workId const workId = _courseId.workId
const courseId = _courseId.coursesId const courseId = _courseId.coursesId
this.props.history.push(`/courses/${courseId}/${secondName}/${_workId || workId}`) this.props.history.push(`/classrooms/${courseId}/${secondName}/${_workId || workId}`)
} else { } 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 workId = _courseId.workId
const courseId = _courseId.coursesId const courseId = _courseId.coursesId
const studentWorkId = _courseId.studentWorkId 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 { } 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) => { toWorkListPage = (_courseId, _workId) => {
@ -123,9 +123,9 @@ export function RouteHOC(options = {}) {
if (typeof _courseId == "object") { if (typeof _courseId == "object") {
const workId = _courseId.workId const workId = _courseId.workId
const courseId = _courseId.coursesId 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 { } else {
this.props.history.push(`/courses/${_courseId}/${secondName}/${_workId}/list`) this.props.history.push(`/classrooms/${_courseId}/${secondName}/${_workId}/list`)
} }
} }
toWorkAnswerPage = (_courseId, _workId) => { toWorkAnswerPage = (_courseId, _workId) => {
@ -133,9 +133,9 @@ export function RouteHOC(options = {}) {
if (typeof _courseId == "object") { if (typeof _courseId == "object") {
const workId = _courseId.workId const workId = _courseId.workId
const courseId = _courseId.coursesId const courseId = _courseId.coursesId
this.props.history.push(`/courses/${courseId}/${secondName}/${workId}/answer`) this.props.history.push(`/classrooms/${courseId}/${secondName}/${workId}/answer`)
} else { } 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") { if (typeof _courseId == "object") {
const workId = _workId || _courseId.workId const workId = _workId || _courseId.workId
const courseId = _courseId.coursesId const courseId = _courseId.coursesId
this.props.history.push(`/courses/${courseId}/${secondName}/${workId}/question`) this.props.history.push(`/classrooms/${courseId}/${secondName}/${workId}/question`)
} else { } 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") { if (typeof _courseId == "object") {
const workId = _courseId.workId const workId = _courseId.workId
const courseId = _courseId.coursesId 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 { } else {
this.props.history.push(`/courses/${_courseId}/${secondName}/${_workId}/setting`) this.props.history.push(`/classrooms/${_courseId}/${secondName}/${_workId}/setting`)
} }
} }

@ -294,7 +294,7 @@ class CoursesBanner extends Component {
}) })
that.modalCancel(); that.modalCancel();
message.success("删除成功", 1) message.success("删除成功", 1)
push.push(`/courses`) push.push(`/classrooms`)
} }
}) })

@ -181,6 +181,7 @@ class Coursesleftnav extends Component{
} }
componentDidMount() { componentDidMount() {
this.setState({ this.setState({
url:this.props.match.url url:this.props.match.url
}) })
@ -464,13 +465,14 @@ class Coursesleftnav extends Component{
Modalstopval:"隐藏后将不再显示此模块,", Modalstopval:"隐藏后将不再显示此模块,",
ModalsBottomval:"后续可在课堂设置中重新勾选模块恢复显示", ModalsBottomval:"后续可在课堂设置中重新勾选模块恢复显示",
ModalSave:()=>this.edithiddens(id), ModalSave:()=>this.edithiddens(id),
loadtype:false
}) })
}else{ }else{
this.setState({ this.setState({
ModalsType:true, ModalsType:true,
Modalstopval:"您不能隐藏所有课堂模块,请至少保留", Modalstopval:"您不能隐藏所有课堂模块,请至少保留",
ModalsBottomval:"其中一个模块。", ModalsBottomval:"其中一个模块。",
loadtype:true, loadtype:false,
ModalSave:()=>this.cannerNavmoda(), ModalSave:()=>this.cannerNavmoda(),
}) })
} }
@ -673,6 +675,7 @@ class Coursesleftnav extends Component{
ModalsType:false, ModalsType:false,
Modalstopval:"", Modalstopval:"",
loadtype:false, loadtype:false,
antIcon:false
}) })
notification.open({ notification.open({
message: "删除成功", message: "删除成功",
@ -691,6 +694,9 @@ class Coursesleftnav extends Component{
axios.delete(url).then((result)=>{ axios.delete(url).then((result)=>{
if(result.data.status===0){ if(result.data.status===0){
this.updatadeleteSecondary(mainurl || result.data.right_url); this.updatadeleteSecondary(mainurl || result.data.right_url);
this.setState({
antIcon:false
})
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
@ -700,15 +706,13 @@ class Coursesleftnav extends Component{
e.stopPropagation();//阻止冒泡 e.stopPropagation();//阻止冒泡
if(type===1){ if(type===1){
let url="/course_second_categories/"+id+".json" let url="/course_second_categories/"+id+".json"
this.setState({ this.setState({
ModalsType:true, loadtype:false,
Modalstopval:"该目录下的内容将被移动到父目录,", ModalsType:true,
ModalsBottomval:"是否确认删除?", Modalstopval:"该目录下的内容将被移动到父目录,",
ModalSave:()=>this.deletenavchilds(url,mainurl), ModalsBottomval:"是否确认删除?",
loadtype:false ModalSave:()=>this.deletenavchilds(url,mainurl)
}) })
}else if(type===2){ }else if(type===2){
let url="/course_groups/"+id+".json" let url="/course_groups/"+id+".json"
this.setState({ this.setState({

@ -157,7 +157,7 @@ class ExerciseNewCommon extends Component{
const exercise_id = response.data.data.exercise_id; const exercise_id = response.data.data.exercise_id;
this.isEdit = true; this.isEdit = true;
this.props.history.replace(`/courses/${courseId}/exercises/${exercise_id}/edit`); this.props.history.replace(`/classrooms/${courseId}/exercises/${exercise_id}/edit`);
} }
}) })

@ -170,7 +170,7 @@ class ExerciseReviewAndAnswer extends Component{
sureCommit=()=>{ sureCommit=()=>{
let coursesId = this.props.match.params.coursesId; let coursesId = this.props.match.params.coursesId;
let eId = this.props.match.params.Id; 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`);
} }
// 滚动定位 // 滚动定位
@ -582,7 +582,7 @@ class ExerciseReviewAndAnswer extends Component{
returnBtn = () =>{ returnBtn = () =>{
let coursesId=this.props.match.params.coursesId; let coursesId=this.props.match.params.coursesId;
let eId=this.props.match.params.Id; 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)=>{ deadline=(time)=>{
@ -684,9 +684,9 @@ class ExerciseReviewAndAnswer extends Component{
<p className="clearfix mb20"> <p className="clearfix mb20">
<WordsBtn style="grey" className="fl" to={current_user && current_user.first_category_url}>{courseName}</WordsBtn> <WordsBtn style="grey" className="fl" to={current_user && current_user.first_category_url}>{courseName}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl" to={`/courses/${coursesId}/exercises/${data && data.left_banner_id}`}>{data && data.left_banner_name}</WordsBtn> <WordsBtn style="grey" className="fl" to={`/classrooms/${coursesId}/exercises/${data && data.left_banner_id}`}>{data && data.left_banner_name}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" to={`/courses/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`} className="fl mr3">{data && data.left_banner_name}详情</WordsBtn>&gt; <WordsBtn style="grey" to={`/classrooms/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`} className="fl mr3">{data && data.left_banner_name}详情</WordsBtn>&gt;
<span className="ml3">{exercise_answer_user&&exercise_answer_user.user_name}{data&&data.exercise.user_name}</span> <span className="ml3">{exercise_answer_user&&exercise_answer_user.user_name}{data&&data.exercise.user_name}</span>
</p> </p>
<p className="clearfix"> <p className="clearfix">

@ -107,14 +107,14 @@ class GraduateTopicDetail extends Component{
<p className="clearfix mb15 lineh-20"> <p className="clearfix mb15 lineh-20">
<WordsBtn style="grey" className="fl" to={current_user&&current_user.first_category_url}>{tableData && tableData.course_name}</WordsBtn> <WordsBtn style="grey" className="fl" to={current_user&&current_user.first_category_url}>{tableData && tableData.course_name}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl" to={`/courses/${tableData.course_id}/graduation_topics/${tableData.graduation_id}`}>{tableData.graduation_name}</WordsBtn> <WordsBtn style="grey" className="fl" to={`/classrooms/${tableData.course_id}/graduation_topics/${tableData.graduation_id}`}>{tableData.graduation_name}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span>选题详情</span> <span>选题详情</span>
</p> </p>
<p className="clearfix mb20 lineh-25"> <p className="clearfix mb20 lineh-25">
<span className="color-grey-3 font-24 fl task-hide" style={{lineHeight:"25px",maxWidth:"900px"}}>{tableData && tableData.graduation_topic_name}</span> <span className="color-grey-3 font-24 fl task-hide" style={{lineHeight:"25px",maxWidth:"900px"}}>{tableData && tableData.graduation_topic_name}</span>
<span className="fl mt1" style={{height:"25px"}}><CoursesListType typelist={[`${tableData && tableData.status_name}`]} typesylename={""} /></span> <span className="fl mt1" style={{height:"25px"}}><CoursesListType typelist={[`${tableData && tableData.status_name}`]} typesylename={""} /></span>
<WordsBtn className="fr font-16 mt1" style="grey" to={`/courses/${tableData.course_id}/graduation_topics/${tableData.graduation_id}`}>返回</WordsBtn> <WordsBtn className="fr font-16 mt1" style="grey" to={`/classrooms/${tableData.course_id}/graduation_topics/${tableData.graduation_id}`}>返回</WordsBtn>
</p> </p>
<div> <div>
<div className="clearfix edu-back-white bor-bottom-greyE" > <div className="clearfix edu-back-white bor-bottom-greyE" >
@ -134,7 +134,7 @@ class GraduateTopicDetail extends Component{
<WordsBtn className="fr font-16 mt22 mr30" style="blue" onClick={this.actionTopic}>取消选题</WordsBtn> <WordsBtn className="fr font-16 mt22 mr30" style="blue" onClick={this.actionTopic}>取消选题</WordsBtn>
} }
{ {
isAdmin && <WordsBtn className="fr font-16 mt22 mr30" to={`/courses/${course_id}/graduation_topics/${graduation_topic_id}/edit`} style="blue">编辑</WordsBtn> isAdmin && <WordsBtn className="fr font-16 mt22 mr30" to={`/classrooms/${course_id}/graduation_topics/${graduation_topic_id}/edit`} style="blue">编辑</WordsBtn>
} }
</div> </div>
{ {

@ -12,7 +12,7 @@ class GraduateTopicItem extends Component{
} }
editTopic=(topicId)=>{ editTopic=(topicId)=>{
let courseId=this.props.match.params.coursesId; 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)=>{ toDetailPage=(topicId)=>{
@ -32,7 +32,7 @@ class GraduateTopicItem extends Component{
// } // }
let courseId=this.props.match.params.coursesId; 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(){ render(){
const { checkBox, discussMessage, index,chooseTopic, const { checkBox, discussMessage, index,chooseTopic,

@ -163,7 +163,7 @@ class GraduateTopicNew extends Component{
const { id } = response.data; const { id } = response.data;
if (id) { if (id) {
this.props.showNotification('保存成功!'); this.props.showNotification('保存成功!');
this.props.history.push(`/courses/${cid}/graduation_topics/${this.state.left_banner_id}`); this.props.history.push(`/classrooms/${cid}/graduation_topics/${this.state.left_banner_id}`);
} }
} }
}).catch(function (error) { }).catch(function (error) {
@ -190,7 +190,7 @@ class GraduateTopicNew extends Component{
const { id } = response.data; const { id } = response.data;
if (id) { if (id) {
this.props.showNotification('提交成功!'); this.props.showNotification('提交成功!');
this.props.history.push(`/courses/${cid}/graduation_topics/${this.state.left_banner_id}`); this.props.history.push(`/classrooms/${cid}/graduation_topics/${this.state.left_banner_id}`);
} }
} }
}) })
@ -335,13 +335,13 @@ class GraduateTopicNew extends Component{
<p className="clearfix mb20 mt10"> <p className="clearfix mb20 mt10">
<WordsBtn style="grey" className="fl" to={current_user&&current_user.first_category_url}>{course_name}</WordsBtn> <WordsBtn style="grey" className="fl" to={current_user&&current_user.first_category_url}>{course_name}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl" to={`/courses/${coursesId}/graduation_topics/${left_banner_id}`}>{left_banner_name}</WordsBtn> <WordsBtn style="grey" className="fl" to={`/classrooms/${coursesId}/graduation_topics/${left_banner_id}`}>{left_banner_name}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span>{topicId==undefined?"新建":"编辑"}</span> <span>{topicId==undefined?"新建":"编辑"}</span>
</p> </p>
<div className="clearfix mb20 lineh-25"> <div className="clearfix mb20 lineh-25">
<p className="fl color-black summaryname">{topicId==undefined?"新建":"编辑"}毕设选题</p> <p className="fl color-black summaryname">{topicId==undefined?"新建":"编辑"}毕设选题</p>
<Link to={`/courses/${coursesId}/graduation_topics/${left_banner_id}`} className="color-grey-6 fr font-16">返回</Link> <Link to={`/classrooms/${coursesId}/graduation_topics/${left_banner_id}`} className="color-grey-6 fr font-16">返回</Link>
</div> </div>
<Form {...formItemLayout} onSubmit={this.handleSubmit}> <Form {...formItemLayout} onSubmit={this.handleSubmit}>

@ -416,7 +416,7 @@ onBoardsNew=()=>{
(<React.Fragment> (<React.Fragment>
{/* 参考普通作业 - 题库选用 */} {/* 参考普通作业 - 题库选用 */}
{/* <WordsBtn style="blue" className="mr30" onClick={()=>this.useFromBank()}>题库选用</WordsBtn> 正式版没有,先隐藏*/} {/* <WordsBtn style="blue" className="mr30" onClick={()=>this.useFromBank()}>题库选用</WordsBtn> 正式版没有,先隐藏*/}
< a className={"fl color-blue mr30 font-16"} onClick={(url)=>this.confirmysl(`/classrooms/${this.props.match.params.coursesId}/graduation_topics/export.xlsx`)}>导出</a> < a className={"fl color-blue mr30 font-16"} onClick={(url)=>this.confirmysl(`/courses/${this.props.match.params.coursesId}/graduation_topics/export.xlsx`)}>导出</a>
{/*<p className="fl"><UseBank {...this.props} {...this.state} object_type={"gtopic"} useBankSuccess={this.useBankSuccess}></UseBank></p> 题库选用*/} {/*<p className="fl"><UseBank {...this.props} {...this.state} object_type={"gtopic"} useBankSuccess={this.useBankSuccess}></UseBank></p> 题库选用*/}
<WordsBtn style="blue" className="font-16" onClick={()=>this.onBoardsNew()}>新建</WordsBtn> <WordsBtn style="blue" className="font-16" onClick={()=>this.onBoardsNew()}>新建</WordsBtn>
</React.Fragment>):"" </React.Fragment>):""

@ -217,7 +217,7 @@ function CourseGroupListTable(props) {
}) })
} }
function onGoDetail(record) { 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){ function changeInviteCode(id,flag){

@ -720,7 +720,7 @@ class Goldsubject extends Component {
{/* <Breadcrumb.Item>{Whethertocreateanewclassroom===true?"新建课堂":"编辑课堂"}</Breadcrumb.Item>*/} {/* <Breadcrumb.Item>{Whethertocreateanewclassroom===true?"新建课堂":"编辑课堂"}</Breadcrumb.Item>*/}
{/*</Breadcrumb>*/} {/*</Breadcrumb>*/}
<p className="clearfix mb20 mt10"> <p className="clearfix mb20 mt10">
<a className="btn colorgrey fl hovercolorblue " href={Whethertocreateanewclassroom===true?"/courses":this.props.current_user&&this.props.current_user.first_category_url} <a className="btn colorgrey fl hovercolorblue " href={Whethertocreateanewclassroom===true?"/classrooms":this.props.current_user&&this.props.current_user.first_category_url}
>{Whethertocreateanewclassroom===true?"教学课堂":name}</a> >{Whethertocreateanewclassroom===true?"教学课堂":name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span className="fl cdefault">{Whethertocreateanewclassroom===true?"新建课堂":"编辑课堂"}</span> <span className="fl cdefault">{Whethertocreateanewclassroom===true?"新建课堂":"编辑课堂"}</span>

@ -309,7 +309,7 @@ class PollDetailTabFirst extends Component{
width:120, width:120,
render:(operation,item,index)=>{ render:(operation,item,index)=>{
return( return(
item.status == 1 ? <WordsBtn style="blue" targets={"_blank"} to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollId}/users/${item.login}`}>查看</WordsBtn>:<span className="color-grey-9">--</span> item.status == 1 ? <WordsBtn style="blue" targets={"_blank"} to={`/classrooms/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollId}/users/${item.login}`}>查看</WordsBtn>:<span className="color-grey-9">--</span>
) )
} }
}]; }];

@ -362,7 +362,7 @@ class PollNew extends Component {
pollid: result.data.data.id, pollid: result.data.data.id,
Newedit: false, 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) { if (result.data.status === 0) {
// console.log("更新题目成功") // console.log("更新题目成功")
// this.props.showNotification("保存成功"); // 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) { } catch (e) {
@ -2766,7 +2766,7 @@ class PollNew extends Component {
// //
// let courseId=this.props.match.params.coursesId; // let courseId=this.props.match.params.coursesId;
// if(courseId===undefined){ // if(courseId===undefined){
// this.props.history.push("/courses"); // this.props.history.push("/classrooms");
// }else{ // }else{
// this.props.history.push(this.props.current_user.first_category_url); // 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"? this.props.match.params.news === "new"?
<a className=" btn colorgrey fl hovercolorblue" <a className=" btn colorgrey fl hovercolorblue"
href={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}>问卷</a> href={`/classrooms/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}>问卷</a>
: :
<a className=" btn colorgrey fl hovercolorblue" <a className=" btn colorgrey fl hovercolorblue"
href={`/courses/${this.props.match.params.coursesId}/polls/${left_banner_id}`}>问卷</a> href={`/classrooms/${this.props.match.params.coursesId}/polls/${left_banner_id}`}>问卷</a>
} }
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
@ -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" ? "新建问卷" : "编辑问卷"}</p> className="fl color-black summaryname mt5">{this.props.match.params.news === undefined ? "新建问卷" : this.props.match.params.news === "new" ? "新建问卷" : "编辑问卷"}</p>
{ {
this.props.match.params.news === "new" ? this.props.match.params.news === "new" ?
<a href={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`} <a href={`/classrooms/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}
className=" fr font-16"></a> className=" fr font-16"></a>
: :
<a href={`/courses/${this.props.match.params.coursesId}/polls/${left_banner_id}`} <a href={`/classrooms/${this.props.match.params.coursesId}/polls/${left_banner_id}`}
className=" fr font-16"></a> className=" fr font-16"></a>
} }
</div> </div>

@ -385,7 +385,7 @@ class PollNewQuestbank extends Component {
pollid: result.data.data.id, pollid: result.data.data.id,
Newedit: false, 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`)
} }
}) })
} }

@ -107,7 +107,7 @@ class CommitSummary extends Component{
// console.log(JSON.stringify(result)) // console.log(JSON.stringify(result))
// message.success(result.data.message); // 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) => { }).catch((error) => {
console.log(error) console.log(error)
@ -201,7 +201,7 @@ class CommitSummary extends Component{
<Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20" > <Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20" >
提交 提交
</Button> </Button>
<a className="defalutCancelbtn fl" href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/list?tab=0`}>取消</a> <a className="defalutCancelbtn fl" href={`/classrooms/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/list?tab=0`}>取消</a>
</div> </div>
</Form.Item> </Form.Item>
</Form> </Form>

@ -190,7 +190,7 @@ class ShixunHomeworkPage extends Component {
// console.log(this.props) // console.log(this.props)
let {jobsettingsdatapage}=this.state 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=()=>{ Akeyreviewit=()=>{
@ -264,7 +264,7 @@ class ShixunHomeworkPage extends Component {
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<a <a
className=" btn colorgrey fl hovercolorblue " className=" btn colorgrey fl hovercolorblue "
href={`/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}`}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_name}</a> 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}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">作业详情</WordsBtn> <WordsBtn className="fl">作业详情</WordsBtn>
</p> </p>
@ -381,7 +381,7 @@ class ShixunHomeworkPage extends Component {
{this.state.view_report === true ? <Link className="fr color-blue font-16" target={"_blank"} {this.state.view_report === true ? <Link className="fr color-blue font-16" target={"_blank"}
to={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage&&teacherdatapage.work_id}/shixun_work_report`}> 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`}>
查看实训报告 查看实训报告
</Link> : ""} </Link> : ""}
{ {
@ -389,7 +389,7 @@ class ShixunHomeworkPage extends Component {
: teacherdatapage.commit_des === null || teacherdatapage.commit_des === undefined ? "" : : teacherdatapage.commit_des === null || teacherdatapage.commit_des === undefined ? "" :
<a className="fr color-blue font-16" <a className="fr color-blue font-16"
target={"_blank"} target={"_blank"}
href={`/courses/${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}</a> 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}</a>
} }
{teacherdatapage === undefined ? "" :teacherdatapage&&teacherdatapage.shixun_status>1&&teacherdatapage&&teacherdatapage.time_status<5?<Startshixuntask {teacherdatapage === undefined ? "" :teacherdatapage&&teacherdatapage.shixun_status>1&&teacherdatapage&&teacherdatapage.time_status<5?<Startshixuntask
{...this.props} {...this.props}

@ -91,7 +91,7 @@ class ShixunWorkDetails extends Component {
// } // }
// this.props.history.goBack() // this.props.history.goBack()
// "/courses/1545/shixun_homeworks/15220/list?tab=2" // "/courses/1545/shixun_homeworks/15220/list?tab=2"
this.props.history.replace(`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${this.props.match.params.homeworkid}/list?tab=2`); this.props.history.replace(`/classrooms/${this.props.match.params.coursesId}/shixun_homeworks/${this.props.match.params.homeworkid}/list?tab=2`);
} }
render() { render() {
let{data}=this.state; let{data}=this.state;
@ -105,13 +105,13 @@ class ShixunWorkDetails extends Component {
<div className="educontent"> <div className="educontent">
<p className="clearfix mt20"> <p className="clearfix mt20">
<a className="fl color-grey-9 btn colorgrey hovercolorblue" <a className="fl color-grey-9 btn colorgrey hovercolorblue"
href={`/courses/${data&&data.course_id}/shixun_homeworks/${data&&data.homework_common_id}`} href={`/classrooms/${data&&data.course_id}/shixun_homeworks/${data&&data.homework_common_id}`}
> >
<a className={"color-grey-9"} >{data&&data.course_name}</a> <a className={"color-grey-9"} >{data&&data.course_name}</a>
</a> </a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<a className="btn colorgrey fl hovercolorblue grey" <a className="btn colorgrey fl hovercolorblue grey"
href={`/courses/${data&&data.course_id}/shixun_homeworks/${data&&data.homework_common_id}/list?tab=0`} href={`/classrooms/${data&&data.course_id}/shixun_homeworks/${data&&data.homework_common_id}/list?tab=0`}
// to={"/courses/"+data&&data.course_id+"/"+this.state.shixuntypes+"/"+data&&data.homework_common_id} // to={"/courses/"+data&&data.course_id+"/"+this.state.shixuntypes+"/"+data&&data.homework_common_id}
> >
<span className={"color-grey-9"}>实训作业</span> <span className={"color-grey-9"}>实训作业</span>

@ -138,7 +138,7 @@ class ShixunWorkReport extends Component {
gotohome=()=>{ gotohome=()=>{
let courseId=this.props.match.params.coursesId; let courseId=this.props.match.params.coursesId;
if(courseId===undefined){ if(courseId===undefined){
this.props.history.push("/courses"); this.props.history.push("/classrooms");
}else{ }else{
this.props.history.push(this.props.current_user.first_category_url); this.props.history.push(this.props.current_user.first_category_url);
} }

@ -974,7 +974,7 @@ class ShixunHomework extends Component{
gotohome=()=>{ gotohome=()=>{
let courseId=this.props.match.params.coursesId; let courseId=this.props.match.params.coursesId;
if(courseId===undefined){ if(courseId===undefined){
this.props.history.push("/courses"); this.props.history.push("/classrooms");
}else{ }else{
this.props.history.push(this.props.current_user.first_category_url); this.props.history.push(this.props.current_user.first_category_url);
} }
@ -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? {datas===undefined?"":datas.homeworks && datas.homeworks.length>1?this.props.isAdminOrCreator()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?
<span> <span>
<WordsBtn style="blue" className={"mr30 font-16"}> <WordsBtn style="blue" className={"mr30 font-16"}>
<Link className="color4CACFF" to={`/courses/${this.props.match.params.coursesId}/ordering/shixun_homework/${main_id&&main_id}`}>调整排序</Link> <Link className="color4CACFF" to={`/classrooms/${this.props.match.params.coursesId}/ordering/shixun_homework/${main_id&&main_id}`}>调整排序</Link>
</WordsBtn> </WordsBtn>
</span>:"":"":""} </span>:"":"":""}

@ -420,7 +420,7 @@ class Statistics extends Component{
{ {
this.props.isAdmin()===true? this.props.isAdmin()===true?
// 这里是文件下载 不能替换路由 // 这里是文件下载 不能替换路由
<a className={"ml20 ant-btn-link"} onClick={()=>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`)}>导出</a> <a className={"ml20 ant-btn-link"} onClick={()=>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`)}>导出</a>
:"" :""
} }
</React.Fragment>; </React.Fragment>;

@ -193,32 +193,32 @@ class MessagSub extends Component {
return; return;
case 'JoinCourse' : case 'JoinCourse' :
// 课堂详情页 :id = // 课堂详情页 :id =
return window.open(`/courses/${item.belong_container_id}/teachers`) return window.open(`/classrooms/${item.belong_container_id}/teachers`)
case 'StudentJoinCourse': case 'StudentJoinCourse':
// 课堂详情页 :id = container_id // 课堂详情页 :id = container_id
if (item.tiding_type === 'Apply') { 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') { if (item.tiding_type === 'System') {
//教学案例详情 :id = container_id //教学案例详情 :id = container_id
return window.open(`/courses/${item.belong_container_id}/students`); return window.open(`/classrooms/${item.belong_container_id}/students`);
} }
case 'DealCourse': case 'DealCourse':
// 课堂详情页 :id = container_id // 课堂详情页 :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': case 'TeacherJoinCourse':
// 课堂详情页 :id = container_id // 课堂详情页 :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' : case 'Course' :
// 课堂详情页 :id = container_id // 课堂详情页 :id = container_id
if (item.tiding_type === "Delete") { if (item.tiding_type === "Delete") {
return; 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' : case 'ArchiveCourse' :
// 课堂详情页 :id = container_id // 课堂详情页 :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" : case "Shixun" :
return window.open(`/shixuns/${item.identifier}/challenges`) return window.open(`/shixuns/${item.identifier}/challenges`)
case "Subject" : case "Subject" :
@ -234,33 +234,33 @@ class MessagSub extends Component {
//学生作业页 homework = parent_container_id //学生作业页 homework = parent_container_id
if (item.homework_type === "normal") { 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") { 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") { 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 ""; return "";
case "GraduationTopic" : case "GraduationTopic" :
// 毕业目标页 parent_container_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 "StudentWorksScore" : case "StudentWorksScore" :
//学生作业页 //学生作业页
if (item.homework_type === "normal") { 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") { 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") { 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 ""; return "";
} }
@ -314,109 +314,109 @@ class MessagSub extends Component {
//记得跳评阅页面 //记得跳评阅页面
default : default :
// 课堂-试卷列表详情 :id = container_id // 课堂-试卷列表详情 :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' : case 'StudentGraduationTopic' :
//课堂-毕业选题详情 :id = parent_container_id //课堂-毕业选题详情 :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' : case 'DealStudentTopicSelect' :
//课堂-毕业选题详情 :id = parent_container_id //课堂-毕业选题详情 :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' : case 'GraduationTask' :
//课堂-毕业任务页 :id = container_id //课堂-毕业任务页 :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" : case "GraduationWork" :
//课堂-毕业xx页 :id = container_id //课堂-毕业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" : case "GraduationWorkScore" :
// 课堂-毕业xx页 :id = parent_container_id // 课堂-毕业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" : case "HomeworkCommon" :
switch (item.parent_container_type) { switch (item.parent_container_type) {
case "AnonymousCommentFail" : case "AnonymousCommentFail" :
// 课堂-作业列表 homework = container_id // 课堂-作业列表 homework = container_id
if (item.homework_type === "normal") { 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") { 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") { 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" : case "HomeworkPublish" :
if (item.homework_type === "normal") { 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") { 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") { 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" : case "AnonymousAppeal" :
if (item.homework_type === "normal") { 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") { 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") { 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 : default :
// 课堂-作业列表 homework = container_id // 课堂-作业列表 homework = container_id
if (item.homework_type === "normal") { 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") { 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") { 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" : case "StudentWork" :
//课堂-作业 :id = container_id //课堂-作业 :id = container_id
if (item.homework_type === "normal") { 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") { if (item.homework_type === "group") {
//分组作业/courses/1208/group_homeworks/22373/1219130/appraise //分组作业/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") { 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" : case "StudentWorksScore" :
//课堂-作业 :id = parent_container_id //课堂-作业 :id = parent_container_id
// if(item.homework_type==="normal"){ // 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"){ // 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"){ // 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" : case "StudentWorksScoresAppeal" :
// if(item.homework_type==="normal"){ // if(item.homework_type==="normal"){
@ -425,13 +425,13 @@ class MessagSub extends Component {
// } // }
// if(item.homework_type==="group"){ // 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"){ // 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" : case "ChallengeWorkScore" :
return ''; return '';
case "SendMessage" : case "SendMessage" :
@ -488,30 +488,30 @@ class MessagSub extends Component {
} }
return ''; return '';
case "PublicCourseStart": case "PublicCourseStart":
return window.open(`/courses/${item.container_id}/informs`); return window.open(`/classrooms/${item.container_id}/informs`);
case "SubjectStartCourse": case "SubjectStartCourse":
return window.open(`/paths/${item.container_id}`); return window.open(`/paths/${item.container_id}`);
case "ResubmitStudentWork": case "ResubmitStudentWork":
if (item.homework_type === "normal") { 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") { 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": case "AdjustScore":
//belong_container_id course的id //belong_container_id course的id
if (item.homework_type === "normal") { 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") { 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': 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': case 'Hack':
if (item.extra && item.parent_container_type !== 'HackDelete') { if (item.extra && item.parent_container_type !== 'HackDelete') {
return window.open(`/problems/${item.extra}/edit`); return window.open(`/problems/${item.extra}/edit`);

@ -41,7 +41,13 @@ class QuestionModal extends Component {
"" ""
} }
<div className="clearfix mt30 edu-txt-center"> <div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30 w80" onClick={()=>this.props.modalCancel()}>取消</a> {
this.props.titilesm&&this.props.titilesm==="功能正在内测中,敬请期待"?
""
:
<a className="task-btn mr30 w80" onClick={()=>this.props.modalCancel()}>取消</a>
}
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.setDownload()}>{this.props.boolok?this.props.boolok:"确定"}</a> <a className="task-btn task-btn-orange w80" onClick={()=>this.props.setDownload()}>{this.props.boolok?this.props.boolok:"确定"}</a>
</div> </div>
</div> </div>

@ -14,6 +14,7 @@
margin-right: 26px; margin-right: 26px;
margin-bottom: 26px; margin-bottom: 26px;
position: relative; position: relative;
max-height: 258px;
} }
.videoItem:nth-child(4n+0) { .videoItem:nth-child(4n+0) {
margin-right: 0px; margin-right: 0px;
@ -68,9 +69,6 @@
} }
.videoInReviewItem .square-main {
background: #EAEAEA;
}
.videoItem .time { .videoItem .time {
color: #C0C4CC; color: #C0C4CC;
} }

@ -65,7 +65,8 @@ function InfoVideo(props) {
const videoEl = useRef(null); const videoEl = useRef(null);
const { showNotification, history } = props; const { showNotification, history } = props;
const username = props.match.params.username const username = props.match.params.username;
const { user } = props;
function toUpload() { function toUpload() {
if (props.current_user.admin || (props.current_user.is_teacher && props.checkIfProfessionalCertification())) { if (props.current_user.admin || (props.current_user.is_teacher && props.checkIfProfessionalCertification())) {
@ -87,16 +88,15 @@ function InfoVideo(props) {
sort_direction: sorts[1], 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() { function fetchReviewvideos() {
const fetchUrl = `/users/${username}/videos/review.json` const fetchUrl = `/users/${username}/videos/review.json`
@ -144,7 +144,8 @@ function InfoVideo(props) {
useEffect(() => { useEffect(() => {
if (videoModalObj.visible == false) { if (videoModalObj.visible == false) {
// 关闭视频 // 关闭视频
videoEl.current && videoEl.current.pause() videoEl.current && videoEl.current.pause();
videoId = {};
if (_clipboard) { if (_clipboard) {
_clipboard.destroy(); _clipboard.destroy();
_clipboard = null; _clipboard = null;
@ -184,9 +185,8 @@ function InfoVideo(props) {
videoId = { videoId = {
videoId: item.id, videoId: item.id,
title: item.title, title: item.title,
file_url: item.file_url, file_url: item.play_url || item.file_url,
cover_url: item.cover_url cover_url: item.cover_url
} }
videoModalObj.setVisible(true) videoModalObj.setVisible(true)
} }
@ -218,6 +218,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) { function getCopyText(file_url, cover_url) {
return `<video src="${file_url}" controls="true" controlslist="nodownload" width="${DEFAULT_VIDEO_WIDTH_IN_MD}" height="${DEFAULT_VIDEO_HEIGHT_IN_MD}" poster="${cover_url}">您的浏览器不支持 video 标签。</video>` return `<video src="${file_url}" controls="true" controlslist="nodownload" width="${DEFAULT_VIDEO_WIDTH_IN_MD}" height="${DEFAULT_VIDEO_HEIGHT_IN_MD}" poster="${cover_url}">您的浏览器不支持 video 标签。</video>`
} }
@ -237,7 +267,7 @@ function InfoVideo(props) {
className="showVideoModal" className="showVideoModal"
width={800 - 1} width={800 - 1}
> >
<VideoPlay src={videoId.file_url} /> {videoModalObj.visible && <VideoPlay src={videoId.file_url} />}
<div className="df copyLine"> <div className="df copyLine">
<Input value={_inputValue} <Input value={_inputValue}
className="dark" className="dark"
@ -397,7 +427,7 @@ function InfoVideo(props) {
onEditVideo={onEditVideo} onEditVideo={onEditVideo}
onMaskClick={onMaskClick} onMaskClick={onMaskClick}
getCopyText={getCopyText} getCopyText={getCopyText}
deleteVideo={user && ((user.login === item.user_login) || user.admin) ? deleteVideo : undefined}
> >
</VideoInReviewItem>) </VideoInReviewItem>)
}) })
@ -416,6 +446,7 @@ function InfoVideo(props) {
{...item} {...item}
key={item.id} key={item.id}
isReview={true} isReview={true}
deleteVideo={user && ((user.login === item.user_login) || user.admin) ? deleteVideo : undefined}
> >
</VideoInReviewItem>) </VideoInReviewItem>)
}) })

@ -79,9 +79,9 @@ function VideoInReviewItem (props) {
<i className={`icon-dianjiliang iconfont dianjilianicon`}></i> <i className={`icon-dianjiliang iconfont dianjilianicon`}></i>
</Tooltip> } {!vv || (vv && vv)===0?"":vv} </Tooltip> } {!vv || (vv && vv)===0?"":vv}
</span> </span>
{ isReview != true && <div> <div>
{ {
moveVideo && isReview !== true && moveVideo &&
<Tooltip title="移动到" placement="bottom"> <Tooltip title="移动到" placement="bottom">
<i className="icon-yidong iconfont font-15" onClick={() => moveVideo(props)} <i className="icon-yidong iconfont font-15" onClick={() => moveVideo(props)}
style={{ marginTop: '1px', display: 'inline-block'}} style={{ marginTop: '1px', display: 'inline-block'}}
@ -98,7 +98,7 @@ function VideoInReviewItem (props) {
} }
{ {
operation && isReview !== true && operation &&
<Tooltip title="编辑" placement="bottom"> <Tooltip title="编辑" placement="bottom">
<i className="icon-bianji1 iconfont" onClick={() => onEditVideo(props)} <i className="icon-bianji1 iconfont" onClick={() => onEditVideo(props)}
style={{ marginTop: '1px', display: 'inline-block'}} style={{ marginTop: '1px', display: 'inline-block'}}
@ -106,13 +106,13 @@ function VideoInReviewItem (props) {
</Tooltip> </Tooltip>
} }
{ {
!link ? isReview !== true && !link ?
<Tooltip title="复制视频地址" placement="bottom"> <Tooltip title="复制视频地址" placement="bottom">
<i className={`icon-fuzhi iconfont copybtn_item_${id}`} data-clipboard-text={getCopyText((play_url || file_url), cover_url)}></i> <i className={`icon-fuzhi iconfont copybtn_item_${id}`} data-clipboard-text={getCopyText((play_url || file_url), cover_url)}></i>
</Tooltip>:"" </Tooltip>:""
} }
</div> } </div>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save