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 = {};
json[s_name] = s_value;
$.ajax({
url: "/admins/courses/" + s_id,
url: "/admins/classrooms/" + s_id,
type: "PUT",
dataType:'script',
data: json

@ -36,10 +36,13 @@ class CourseSecondCategoriesController < ApplicationController
# 更新相应对象的子目录id
if @course_module.module_type == "shixun_homework"
@category.homework_commons.update_all(course_second_category_id: 0)
@right_url = "/courses/#{@course.id}/shixun_homeworks/#{@course_module.id}"
@right_url = "/classrooms/#{@course.id}/shixun_homeworks/#{@course_module.id}"
elsif @course_module.module_type == "attachment"
Attachment.where(course_second_category_id: @category.id).update_all(course_second_category_id: 0)
@right_url = "/courses/#{@course.id}/files/#{@course_module.id}"
@right_url = "/classrooms/#{@course.id}/files/#{@course_module.id}"
elsif @course_module.module_type == "video"
@course.course_videos.where(course_second_category_id: @category.id).update_all(course_second_category_id: 0)
@right_url = "/classrooms/#{@course.id}/course_videos"
end
@category.destroy

@ -374,6 +374,7 @@ class StudentWorksController < ApplicationController
new_score.comment = params[:comment] if params[:comment] && params[:comment].strip != ""
new_score.user_id = current_user.id
new_score.student_work_id = @work.id
new_score.homework_common_id = @work.homework_common_id
# 如果作品是未提交的状态则更新为已提交
if @user_course_identity < Course::STUDENT && !new_score.score.nil? && @work.work_status == 0
@ -553,8 +554,10 @@ class StudentWorksController < ApplicationController
# 分数不为空的历史评阅都置为失效
@work.student_works_scores.where.not(score: nil).update_all(is_invalid: 1)
reviewer_role = @user_course_identity == Course::ASSISTANT_PROFESSOR ? 2 : 1
new_score = StudentWorksScore.new(student_work_id: @work.id, score: params[:score].to_f, comment: "使用调分功能调整了作业最终成绩:#{params[:comment]}",
user_id: current_user.id, reviewer_role: reviewer_role, is_ultimate: 1)
new_score = StudentWorksScore.new(student_work_id: @work.id, score: params[:score].to_f,
comment: "使用调分功能调整了作业最终成绩:#{params[:comment]}",
homework_common_id: @work.homework_common_id, user_id: current_user.id,
reviewer_role: reviewer_role, is_ultimate: 1)
new_score.save!
# 如果作品是未提交的状态则更新为已提交
@ -844,7 +847,7 @@ class StudentWorksController < ApplicationController
def add_score_to_member student_work, homework, new_score
student_works = homework.student_works.where("group_id = #{student_work.group_id} and id != #{student_work.id} and ultimate_score = 0")
student_works.each do |st_work|
st_score = StudentWorksScore.new(user_id: new_score.user_id, score: new_score.score,
st_score = StudentWorksScore.new(user_id: new_score.user_id, score: new_score.score, homework_common_id: homework.id,
reviewer_role: new_score.reviewer_role, comment: new_score.comment)
score = StudentWorksScore.where(user_id: new_score.user_id, student_work_id: st_work.id, reviewer_role: new_score.reviewer_role).last

@ -54,9 +54,8 @@ class Users::VideosController < Users::BaseController
def destroy
video = Video.find_by(id: params[:id])
return render_forbidden unless video.user_id == current_user.id || current_user.admin_or_business?
return render_forbidden unless video.user_id == current_user.id || current_user.admin?
return render_not_found if video.blank?
return render_error('该状态下不能删除视频') unless video.published?
video.destroy!

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

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

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

@ -6,6 +6,7 @@ class HomeworkCommon < ApplicationRecord
has_many :student_works, -> { where(is_delete: 0) }
has_many :score_student_works, -> { where("is_delete = 0 and work_status != 0").order("work_score desc") }, class_name: "StudentWork"
has_one :homework_detail_manual, dependent: :destroy
has_many :student_works_scores
# 分组作业的设置
has_one :homework_detail_group, dependent: :destroy

@ -46,7 +46,17 @@ class StudentWork < ApplicationRecord
# 匿评次数
def student_comment_num
homework_common.homework_detail_manual.comment_status > 2 ? self.student_works_scores.select{|score| score.reviewer_role == 3}.group_by(&:user_id).count : 0
homework_common.homework_detail_manual.comment_status > 2 && work_status > 0 ? self.student_works_scores.select{|score| score.reviewer_role == 3}.group_by(&:user_id).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
# 匿评申诉总条数

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

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

@ -17,7 +17,7 @@
<% if @courses.present? %>
<% @courses.each do |course| %>
<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('、') %>
<td class="text-left">
<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.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.category_count board.messages_count
json.category_type "messages"
json.second_category_url "/courses/#{@course.id}/boards/#{board.id}"
json.second_category_url "/classrooms/#{@course.id}/boards/#{board.id}"
end
end
else

@ -63,6 +63,7 @@ elsif @user_course_identity == Course::STUDENT
if @homework.anonymous_comment
json.student_comment_count @work.student_comment_num
json.user_comment_count @work.user_comment_num
json.absence_penalty @work.absence_penalty
end
@ -122,6 +123,7 @@ elsif @homework.homework_type == "group" || @homework.homework_type == "normal"
json.student_works @student_works.each do |work|
if @is_evaluation
json.(work, :id, :work_status, :update_time)
json.user_comment_count @homework_detail_manual.comment_status > 2 && work.work_status > 0 ? work.user_comment_num : 0
json.student_score work_score_format(anon_comments(@current_user, work.id).last.try(:score), false, true)
# json.student_comment_count anon_comments(@current_user, work.id).count
@ -147,7 +149,8 @@ elsif @homework.homework_type == "group" || @homework.homework_type == "normal"
# 作品匿评条数
if @homework.anonymous_comment
json.student_comment_count @homework_detail_manual.comment_status > 2 ? work.student_comment_num : 0
json.student_comment_count @homework_detail_manual.comment_status > 2 && work.work_status > 0 ? work.student_comment_num : 0
json.user_comment_count @homework_detail_manual.comment_status > 2 && work.work_status > 0 ? work.user_comment_num : 0
json.absence_penalty work.absence_penalty
end

@ -4,11 +4,11 @@ json.top do
json.course_url "/courses"
json.competitions_url "#{@old_domain}/competitions"
json.topic_url "/forums"
json.new_course_url "/courses/new"
json.new_course_url "/classrooms/new"
json.new_shixun_url "/shixuns/new"
json.new_shixun_path_url "/paths/new"
json.new_project_url "#{@old_domain}/projects/new"
json.join_course_url "/courses/join_course_multi_role"
json.join_course_url "/classrooms/join_course_multi_role"
json.join_project_url "#{@old_domain}/applied_project/applied_project_info"
json.message_url "#{@user_url}/user_tidings"
json.new_message @new_message

@ -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 :basic_info
get :course_activities
get :course_videos
post :change_member_roles
delete :delete_course_teachers
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{
max-width: 486px;
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;

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

@ -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) {
columns.push({
width: 70,

@ -51,9 +51,9 @@ export function RouteHOC(options = {}) {
const topicId = _courseId.topicId
const workId = _courseId.workId
const courseId = _courseId.coursesId
this.props.history.push(`/courses/${courseId}/boards/${workId}/messages/${topicId}`)
this.props.history.push(`/classrooms/${courseId}/boards/${workId}/messages/${topicId}`)
} else {
this.props.history.push(`/courses/${_courseId}/boards/${workId}/messages/${topicId}`)
this.props.history.push(`/classrooms/${_courseId}/boards/${workId}/messages/${topicId}`)
}
}
@ -62,9 +62,9 @@ export function RouteHOC(options = {}) {
if (typeof _courseId == "object") {
const workId = _courseId.workId
const courseId = _courseId.coursesId
this.props.history.push(`/courses/${courseId}/${secondName}/${_workId || workId}/edit`)
this.props.history.push(`/classrooms/${courseId}/${secondName}/${_workId || workId}/edit`)
} else {
this.props.history.push(`/courses/${_courseId}/${secondName}/${_workId}/edit`)
this.props.history.push(`/classrooms/${_courseId}/${secondName}/${_workId}/edit`)
}
}
toWorkDetailPage = (_courseId, _workId, _studentWorkId) => {
@ -73,9 +73,9 @@ export function RouteHOC(options = {}) {
const workId = _courseId.workId
const courseId = _courseId.coursesId
const studentWorkId = _courseId.studentWorkId
window.open(`/courses/${courseId}/${secondName}/${_workId || workId}/${_studentWorkId || studentWorkId}/appraise`);
window.open(`/classrooms/${courseId}/${secondName}/${_workId || workId}/${_studentWorkId || studentWorkId}/appraise`);
} else {
window.open(`/courses/${_courseId}/${secondName}/${_workId}/${_studentWorkId}/appraise`);
window.open(`/classrooms/${_courseId}/${secondName}/${_workId}/${_studentWorkId}/appraise`);
}
}
toWorkDetailPage2 = (e, _courseId, _workId, _studentWorkId) => {
@ -86,23 +86,23 @@ export function RouteHOC(options = {}) {
const workId = _courseId.workId
const courseId = _courseId.coursesId
const studentWorkId = _courseId.studentWorkId
window.open(`/courses/${courseId}/${secondName}/${_workId || workId}/${_studentWorkId || studentWorkId}/appraise`);
window.open(`/classrooms/${courseId}/${secondName}/${_workId || workId}/${_studentWorkId || studentWorkId}/appraise`);
} else {
window.open(`/courses/${_courseId}/${secondName}/${_workId}/${_studentWorkId}/appraise`);
window.open(`/classrooms/${_courseId}/${secondName}/${_workId}/${_studentWorkId}/appraise`);
}
}
toNewPage = (courseId) => {
const secondName = this.getModuleName()
this.props.history.push(`/courses/${courseId.coursesId}/${secondName}/${courseId.category_id}/new`)
this.props.history.push(`/classrooms/${courseId.coursesId}/${secondName}/${courseId.category_id}/new`)
}
toListPage = (_courseId, _workId) => {
const secondName = this.getModuleName()
if (typeof _courseId == "object") {
const workId = _courseId.workId
const courseId = _courseId.coursesId
this.props.history.push(`/courses/${courseId}/${secondName}/${_workId || workId}`)
this.props.history.push(`/classrooms/${courseId}/${secondName}/${_workId || workId}`)
} else {
this.props.history.push(`/courses/${_courseId}/${secondName}${_workId ? '/' + _workId : ''}`)
this.props.history.push(`/classrooms/${_courseId}/${secondName}${_workId ? '/' + _workId : ''}`)
}
}
@ -113,9 +113,9 @@ export function RouteHOC(options = {}) {
const workId = _courseId.workId
const courseId = _courseId.coursesId
const studentWorkId = _courseId.studentWorkId
this.props.history.push(`/courses/${courseId}/${secondName}/${_workId || workId}/${isEdit? `${_studentWorkId || studentWorkId}/post_edit` : 'post'}`)
this.props.history.push(`/classrooms/${courseId}/${secondName}/${_workId || workId}/${isEdit? `${_studentWorkId || studentWorkId}/post_edit` : 'post'}`)
} else {
this.props.history.push(`/courses/${_courseId}/${secondName}/${_workId}/${isEdit? `${_studentWorkId}/post_edit` : 'post'}`)
this.props.history.push(`/classrooms/${_courseId}/${secondName}/${_workId}/${isEdit? `${_studentWorkId}/post_edit` : 'post'}`)
}
}
toWorkListPage = (_courseId, _workId) => {
@ -123,9 +123,9 @@ export function RouteHOC(options = {}) {
if (typeof _courseId == "object") {
const workId = _courseId.workId
const courseId = _courseId.coursesId
this.props.history.push(`/courses/${courseId}/${secondName}/${_workId || workId}/list`)
this.props.history.push(`/classrooms/${courseId}/${secondName}/${_workId || workId}/list`)
} else {
this.props.history.push(`/courses/${_courseId}/${secondName}/${_workId}/list`)
this.props.history.push(`/classrooms/${_courseId}/${secondName}/${_workId}/list`)
}
}
toWorkAnswerPage = (_courseId, _workId) => {
@ -133,9 +133,9 @@ export function RouteHOC(options = {}) {
if (typeof _courseId == "object") {
const workId = _courseId.workId
const courseId = _courseId.coursesId
this.props.history.push(`/courses/${courseId}/${secondName}/${workId}/answer`)
this.props.history.push(`/classrooms/${courseId}/${secondName}/${workId}/answer`)
} else {
this.props.history.push(`/courses/${_courseId}/${secondName}/${_workId}/answer`)
this.props.history.push(`/classrooms/${_courseId}/${secondName}/${_workId}/answer`)
}
}
@ -144,9 +144,9 @@ export function RouteHOC(options = {}) {
if (typeof _courseId == "object") {
const workId = _workId || _courseId.workId
const courseId = _courseId.coursesId
this.props.history.push(`/courses/${courseId}/${secondName}/${workId}/question`)
this.props.history.push(`/classrooms/${courseId}/${secondName}/${workId}/question`)
} else {
this.props.history.push(`/courses/${_courseId}/${secondName}/${_workId}/question`)
this.props.history.push(`/classrooms/${_courseId}/${secondName}/${_workId}/question`)
}
}
@ -155,9 +155,9 @@ export function RouteHOC(options = {}) {
if (typeof _courseId == "object") {
const workId = _courseId.workId
const courseId = _courseId.coursesId
this.props.history.push(`/courses/${courseId}/${secondName}/${_workId || workId}/setting`)
this.props.history.push(`/classrooms/${courseId}/${secondName}/${_workId || workId}/setting`)
} else {
this.props.history.push(`/courses/${_courseId}/${secondName}/${_workId}/setting`)
this.props.history.push(`/classrooms/${_courseId}/${secondName}/${_workId}/setting`)
}
}

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

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

@ -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`);
}
})

@ -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`);
}
// 滚动定位
@ -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{
<p className="clearfix mb20">
<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>
<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>
<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>
</p>
<p className="clearfix">

@ -107,14 +107,14 @@ class GraduateTopicDetail extends Component{
<p className="clearfix mb15 lineh-20">
<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>
<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>选题详情</span>
</p>
<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="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>
<div>
<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>
}
{
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>
{

@ -12,7 +12,7 @@ class GraduateTopicItem extends Component{
}
editTopic=(topicId)=>{
let courseId=this.props.match.params.coursesId;
this.props.history.push(`/courses/${courseId}/graduation_topics/${topicId}/edit`);
this.props.history.push(`/classrooms/${courseId}/graduation_topics/${topicId}/edit`);
}
toDetailPage=(topicId)=>{
@ -32,7 +32,7 @@ class GraduateTopicItem extends Component{
// }
let courseId=this.props.match.params.coursesId;
this.props.history.push(`/courses/${courseId}/graduation_topics/${topicId}/detail`);
this.props.history.push(`/classrooms/${courseId}/graduation_topics/${topicId}/detail`);
}
render(){
const { checkBox, discussMessage, index,chooseTopic,

@ -163,7 +163,7 @@ class GraduateTopicNew extends Component{
const { id } = response.data;
if (id) {
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) {
@ -190,7 +190,7 @@ class GraduateTopicNew extends Component{
const { id } = response.data;
if (id) {
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">
<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>
<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>{topicId==undefined?"新建":"编辑"}</span>
</p>
<div className="clearfix mb20 lineh-25">
<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>
<Form {...formItemLayout} onSubmit={this.handleSubmit}>

@ -416,7 +416,7 @@ onBoardsNew=()=>{
(<React.Fragment>
{/* 参考普通作业 - 题库选用 */}
{/* <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> 题库选用*/}
<WordsBtn style="blue" className="font-16" onClick={()=>this.onBoardsNew()}>新建</WordsBtn>
</React.Fragment>):""

@ -217,7 +217,7 @@ function CourseGroupListTable(props) {
})
}
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){

@ -720,7 +720,7 @@ class Goldsubject extends Component {
{/* <Breadcrumb.Item>{Whethertocreateanewclassroom===true?"新建课堂":"编辑课堂"}</Breadcrumb.Item>*/}
{/*</Breadcrumb>*/}
<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>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span className="fl cdefault">{Whethertocreateanewclassroom===true?"新建课堂":"编辑课堂"}</span>

@ -309,7 +309,7 @@ class PollDetailTabFirst extends Component{
width:120,
render:(operation,item,index)=>{
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,
Newedit: false,
})
this.props.history.push(`/courses/${this.props.match.params.coursesId}/polls/${result.data.data.id}/detail?tab=2`)
this.props.history.push(`/classrooms/${this.props.match.params.coursesId}/polls/${result.data.data.id}/detail?tab=2`)
}
})
}
@ -2590,7 +2590,7 @@ class PollNew extends Component {
if (result.data.status === 0) {
// console.log("更新题目成功")
// this.props.showNotification("保存成功");
this.props.history.push(`/courses/${this.props.match.params.coursesId}/polls/${pollid}/detail?tab=2`)
this.props.history.push(`/classrooms/${this.props.match.params.coursesId}/polls/${pollid}/detail?tab=2`)
}
} catch (e) {
@ -2766,7 +2766,7 @@ class PollNew extends Component {
//
// let courseId=this.props.match.params.coursesId;
// if(courseId===undefined){
// this.props.history.push("/courses");
// this.props.history.push("/classrooms");
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
@ -2833,10 +2833,10 @@ class PollNew extends Component {
{
this.props.match.params.news === "new"?
<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"
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>
@ -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>
{
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>
:
<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>
}
</div>

@ -385,7 +385,7 @@ class PollNewQuestbank extends Component {
pollid: result.data.data.id,
Newedit: false,
})
this.props.history.push(`/courses/${this.props.match.params.coursesId}/polls/${result.data.data.id}/detail?tab=2`)
this.props.history.push(`/classrooms/${this.props.match.params.coursesId}/polls/${result.data.data.id}/detail?tab=2`)
}
})
}

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

@ -190,7 +190,7 @@ class ShixunHomeworkPage extends Component {
// console.log(this.props)
let {jobsettingsdatapage}=this.state
this.props.history.replace(`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`);
this.props.history.replace(`/classrooms/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`);
}
Akeyreviewit=()=>{
@ -264,7 +264,7 @@ class ShixunHomeworkPage extends Component {
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<a
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>
<WordsBtn className="fl">作业详情</WordsBtn>
</p>
@ -381,7 +381,7 @@ class ShixunHomeworkPage extends Component {
{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> : ""}
{
@ -389,7 +389,7 @@ class ShixunHomeworkPage extends Component {
: teacherdatapage.commit_des === null || teacherdatapage.commit_des === undefined ? "" :
<a className="fr color-blue font-16"
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
{...this.props}

@ -91,7 +91,7 @@ class ShixunWorkDetails extends Component {
// }
// this.props.history.goBack()
// "/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() {
let{data}=this.state;
@ -105,13 +105,13 @@ class ShixunWorkDetails extends Component {
<div className="educontent">
<p className="clearfix mt20">
<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>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<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}
>
<span className={"color-grey-9"}>实训作业</span>

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

@ -974,7 +974,7 @@ class ShixunHomework extends Component{
gotohome=()=>{
let courseId=this.props.match.params.coursesId;
if(courseId===undefined){
this.props.history.push("/courses");
this.props.history.push("/classrooms");
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
@ -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?
<span>
<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>
</span>:"":"":""}

@ -420,7 +420,7 @@ class Statistics extends Component{
{
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>;

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

@ -41,7 +41,13 @@ class QuestionModal extends Component {
""
}
<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>
</div>
</div>

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

@ -65,7 +65,8 @@ function InfoVideo(props) {
const videoEl = useRef(null);
const { showNotification, history } = props;
const username = props.match.params.username
const username = props.match.params.username;
const { user } = props;
function toUpload() {
if (props.current_user.admin || (props.current_user.is_teacher && props.checkIfProfessionalCertification())) {
@ -87,16 +88,15 @@ function InfoVideo(props) {
sort_direction: sorts[1],
//
}
}).then((response) => {
setLoading(false)
if (response.data.videos) {
setvideos(response.data.videos)
setCount(response.data.count)
}
}).catch(() => {
setLoading(false)
})
.then((response) => {
setLoading(false)
if (response.data.videos) {
setvideos(response.data.videos)
setCount(response.data.count)
}
}).catch(() => {
setLoading(false)
})
}
function fetchReviewvideos() {
const fetchUrl = `/users/${username}/videos/review.json`
@ -144,7 +144,8 @@ function InfoVideo(props) {
useEffect(() => {
if (videoModalObj.visible == false) {
// 关闭视频
videoEl.current && videoEl.current.pause()
videoEl.current && videoEl.current.pause();
videoId = {};
if (_clipboard) {
_clipboard.destroy();
_clipboard = null;
@ -184,9 +185,8 @@ function InfoVideo(props) {
videoId = {
videoId: item.id,
title: item.title,
file_url: item.file_url,
file_url: item.play_url || item.file_url,
cover_url: item.cover_url
}
videoModalObj.setVisible(true)
}
@ -218,6 +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) {
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"
width={800 - 1}
>
<VideoPlay src={videoId.file_url} />
{videoModalObj.visible && <VideoPlay src={videoId.file_url} />}
<div className="df copyLine">
<Input value={_inputValue}
className="dark"
@ -397,7 +427,7 @@ function InfoVideo(props) {
onEditVideo={onEditVideo}
onMaskClick={onMaskClick}
getCopyText={getCopyText}
deleteVideo={user && ((user.login === item.user_login) || user.admin) ? deleteVideo : undefined}
>
</VideoInReviewItem>)
})
@ -416,6 +446,7 @@ function InfoVideo(props) {
{...item}
key={item.id}
isReview={true}
deleteVideo={user && ((user.login === item.user_login) || user.admin) ? deleteVideo : undefined}
>
</VideoInReviewItem>)
})

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

Loading…
Cancel
Save