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

dev_ec
SylorHuang 5 years ago
commit 3423c7d972

@ -22,9 +22,9 @@ $.fn.bootstrapViewer = function (options) {
' <div class="modal-dialog modal-lg" style="display: inline-block; width: auto;">\n' +
' <div class="modal-content">\n' +
' <img' +
'\t\t\t class="carousel-inner img-responsive img-rounded img-viewer" \n' +
'\t\t\t onclick="$(\'#bootstrapViewer\').modal(\'hide\');setTimeout(function(){$(\'#bootstrapViewer\').remove();},200);"\n' +
'\t\t\t onmouseover="this.style.cursor=\'zoom-out\';" \n' +
'\t\t\t class="carousel-inner img-responsive img-rounded img-viewer" draggable="false"\n' +
'\t\t\t onclick="/*$(\'#bootstrapViewer\').modal(\'hide\');setTimeout(function(){$(\'#bootstrapViewer\').remove();},200);*/"\n' +
'\t\t\t onmouseover="this.style.cursor=\'move\';" \n' +
'\t\t\t onmouseout="this.style.cursor=\'default\'" \n' +
'\t\t\t />\n' +
' </div>\n' +
@ -37,13 +37,41 @@ $.fn.bootstrapViewer = function (options) {
} else {
throw "图片不存在"
}
$('#bootstrapViewer').on('hidden.bs.modal', function(){
$('#bootstrapViewer').remove();
});
var $moveDiv = $('#bootstrapViewer .modal-dialog');
var isMove = false;
var div_x = $moveDiv.offset().left;
var div_y = $moveDiv.offset().top;
var mousedownFunc = function (e) {
if (isMove) {
var left = e.pageX - div_x;
var top = e.pageY - div_y;
if(left < 0){ left = 0}
if(top < 0){ top = 0}
$moveDiv.css({"left": left, "top":top});
}
}
$moveDiv.mousedown(function (e) {
$moveDiv.css({ left: $moveDiv[0].offsetLeft, top: $moveDiv[0].offsetTop, marginTop: 0, position: 'absolute' });
isMove = true;
div_x = e.pageX - $moveDiv.offset().left;
div_y = e.pageY - $moveDiv.offset().top;
$(document).mousemove(mousedownFunc);
}).mouseup(function () {
isMove = false;
$(document).unbind('mousemove', mousedownFunc);
});
})
$(this).on('mouseover', function () {
$(this).css('cursor', 'zoom-in');
})
}
$.fn.bootstrapViewer.defaults = {
src: 'src'

@ -0,0 +1,2 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.

@ -0,0 +1,3 @@
// Place all the styles related to the subject_lists controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

@ -269,9 +269,10 @@ class CoursesController < ApplicationController
def online_learning
@subject = @course.subject
@stages = @course.course_stages
@stages = @course.course_stages.includes(:shixuns)
@user = current_user
@start_learning = @user_course_identity == Course::STUDENT && @course.learning?(current_user.id)
@myshixuns = @user.myshixuns.where(shixun_id: @course.course_stage_shixuns.pluck(:shixun_id))
@start_learning = @user_course_identity == Course::STUDENT && @myshixuns.present?
end
def search_course_list
@ -307,8 +308,8 @@ class CoursesController < ApplicationController
def destroy
if @course.is_delete == 0
@course.delete!
Tiding.create!(user_id: @course.tea_id, trigger_user_id: 0, container_id: @course.id,
container_type: 'Course', tiding_type: 'Delete', extra: @course.name)
Tiding.create!(user_id: current_user.id, trigger_user_id: current_user.id, container_id: @course.id,
container_type: 'DeleteCourse', tiding_type: 'System', belong_container: @course, extra: @course.name)
normal_status(0, "成功")
else
normal_status(-1, "课堂已删除,无需重复操作")
@ -572,6 +573,10 @@ class CoursesController < ApplicationController
tip_exception("删除失败") if course_member.CREATOR? or course_member.STUDENT?
course_student = CourseMember.find_by(user_id: course_member.user_id, course_id: @course.id, role: %i[STUDENT])
# Tiding.create!(user_id: course_member.user_id, trigger_user_id: current_user.id, container_id: @course.id,
# container_type: 'DeleteCourseMember', tiding_type: 'System', belong_container: @course, extra: @course.name)
CourseDeleteStudentNotifyJob.perform_later(@course.id, [course_member.user_id], current_user.id)
course_member.destroy!
course_student.update_attributes(is_active: 1) if course_student.present? && !course_student.is_active
normal_status(0, "删除成功")
@ -802,6 +807,7 @@ class CoursesController < ApplicationController
end
end
CourseDeleteStudentDeleteWorksJob.perform_later(@course.id, student_ids) if student_ids.present?
CourseDeleteStudentNotifyJob.perform_later(@course.id, student_ids, current_user.id) if student_ids.present?
normal_status(0, "操作成功")
rescue => e
uid_logger(e.message)
@ -922,14 +928,16 @@ class CoursesController < ApplicationController
school_name = params[:school_name]
# REDO:Extension
@users = User.joins(user_extension: :school)
.where("CONCAT(users.lastname, users.firstname) like ? and schools.name like ?", "%#{name}%", "%#{school_name}%")
@users = User.where(status: User::STATUS_ACTIVE)
@users = @users.where("concat(users.lastname, users.firstname) like '%#{name}%'") if name.present?
# REDO:Extension
@users = @users.joins(user_extension: :school).where("schools.name like '%#{school_name}%'") if school_name.present?
@users_count = @users.size
limit = params[:limit] || 20
page = params[:page] || 1
@users = @users.page(page).per(limit)
@users = @users.includes(user_extension: :school).page(page).per(limit)
end
# 申请加入课堂

@ -19,7 +19,9 @@ class Ecs::CourseTargetsController < Ecs::CourseBaseController
end
def with_achievement_methods
@course_targets = current_course.ec_course_targets.includes(:ec_graduation_subitems, :ec_course_achievement_methods)
@course_targets = current_course.ec_course_targets
.includes(:ec_graduation_subitems,
ec_course_achievement_methods: [:ec_course_evaluation, :ec_course_evaluation_subitems])
end
private

@ -1,4 +1,4 @@
class ReachCriteriaController < Ecs::BaseController
class Ecs::ReachCriteriaController < Ecs::BaseController
before_action :check_major_manager_permission!, only: [:create]
def create

@ -1,7 +1,7 @@
class Ecs::ReachEvaluationsController < Ecs::BaseController
def show
preload = { ec_graduation_subitems: { ec_course_support: [:ec_course, :ec_graduation_requirement_calculation] } }
preload = { ec_graduation_subitems: { ec_course_supports: [:ec_course, :ec_graduation_requirement_calculation] } }
@graduation_requirements = current_year.ec_graduation_requirements.includes(preload)
respond_to do |format|

@ -19,7 +19,7 @@ class Ecs::RequirementSupportObjectivesController < Ecs::BaseController
end
def create
record = EcRequirementVsObjective.find_by_or_initialize(permit_params)
record = EcRequirementVsObjective.find_or_initialize_by(permit_params)
record.status = true
record.save!
@ -36,18 +36,20 @@ class Ecs::RequirementSupportObjectivesController < Ecs::BaseController
private
def check_record_exists!
unless current_year.ec_graduation_requirements.exists?(id: params[:graduation_requirement_id])
unless current_year.ec_graduation_requirements.exists?(id: params[:ec_graduation_requirement_id])
render_not_found
return
end
unless current_year.ec_training_subitems.exists?(id: params[:training_subitem_id])
unless current_year.ec_training_subitems.exists?(id: params[:ec_training_subitem_id])
render_not_found
return
end
end
def permit_params
params.require(%i[graduation_requirement_id training_subitem_id])
hash = params.permit(%i[ec_graduation_requirement_id ec_training_subitem_id])
hash[:ec_training_objective_id] = hash.delete(:ec_training_subitem_id)
hash
end
end

@ -4,7 +4,7 @@ class Ecs::SubitemSupportStandardsController < Ecs::BaseController
def show
@graduation_standards = EcGraduationStandard.all
@graduation_subitems = current_year.ec_graduation_subitems
@graduation_subitems = current_year.ec_graduation_subitems.includes(:ec_graduation_requirement)
ids = @graduation_subitems.map(&:id)
@subitem_support_standards = EcRequireSubVsStandard.where(ec_graduation_subitem_id: ids, status: true)
@ -19,7 +19,7 @@ class Ecs::SubitemSupportStandardsController < Ecs::BaseController
end
def create
record = EcRequireSubVsStandard.find_by_or_initialize(permit_params)
record = EcRequireSubVsStandard.find_or_initialize_by(permit_params)
record.status = true
record.save!
@ -36,18 +36,18 @@ class Ecs::SubitemSupportStandardsController < Ecs::BaseController
private
def check_record_exists!
unless current_year.ec_graduation_subitems.exists?(id: params[:graduation_subitem_id])
unless current_year.ec_graduation_subitems.exists?(id: params[:ec_graduation_subitem_id])
render_not_found
return
end
unless EcGraduationStandard.exists?(id: params[:graduation_standard_id])
unless EcGraduationStandard.exists?(id: params[:ec_graduation_standard_id])
render_not_found
return
end
end
def permit_params
params.require(%i[graduation_subitem_id graduation_standard_id])
params.permit(%i[ec_graduation_subitem_id ec_graduation_standard_id])
end
end

@ -656,7 +656,17 @@ class ExerciseQuestionsController < ApplicationController
:exercise_answer_id => ex_answer_comment_id
}
@exercise_comments = ExerciseAnswerComment.new(comment_option)
@exercise_comments.save
@exercise_comments.save!
# 给被评阅人发送消息,同一个教师评阅无需重复发消息
unless Tiding.where(user_id: @user_id, trigger_user_id: current_user.id, parent_container_id: @exercise.id, parent_container_type: "ExerciseScore").exists?
Tiding.create!(user_id: @user_id, trigger_user_id: current_user.id, container_id: @exercise.id,
container_type: "Exercise", parent_container_id: @exercise.id,
parent_container_type: "ExerciseScore", belong_container_id: @course.id,
belong_container_type: 'Course', tiding_type: "Exercise")
end
end
rescue Exception => e
uid_logger_error(e.message)

@ -25,7 +25,6 @@ class ExercisesController < ApplicationController
include ExercisesHelper
def index
ActiveRecord::Base.transaction do
begin
# 按发布时间或创建时间排序
@exercises_all = @course.exercises
@ -105,7 +104,6 @@ class ExercisesController < ApplicationController
raise ActiveRecord::Rollback
end
end
end
def new
ActiveRecord::Base.transaction do

@ -360,7 +360,7 @@ class GraduationTasksController < ApplicationController
tasks.each do |task|
task.end_time = Time.now
task.status = task.allow_late ? 2 : 3
task.status = 2
task.save!
end
normal_status(0, "更新成功")

@ -1,18 +1,18 @@
class GraduationWorksController < ApplicationController
before_action :require_login, :check_auth
before_action :find_task, only: [:new, :create, :search_member_list, :check_project, :relate_project,
:cancel_relate_project]
:cancel_relate_project, :delete_work]
before_action :find_work, only: [:show, :edit, :update, :revise_attachment, :supply_attachments, :comment_list,
:add_score, :delete_score, :adjust_score, :assign_teacher]
before_action :user_course_identity
before_action :task_public
before_action :teacher_allowed, only: [:add_score, :adjust_score, :assign_teacher]
before_action :course_student, only: [:new, :create, :edit, :update, :search_member_list, :relate_project,
:cancel_relate_project]
:cancel_relate_project, :delete_work]
before_action :my_work, only: [:edit, :update, :revise_attachment]
before_action :published_task, only: [:new, :create, :edit, :update, :search_member_list, :relate_project,
:cancel_relate_project, :revise_attachment]
before_action :edit_duration, only: [:edit, :update]
before_action :edit_duration, only: [:edit, :update, :delete_work]
before_action :open_work, only: [:show, :supply_attachments, :comment_list]
def new
@ -47,6 +47,24 @@ class GraduationWorksController < ApplicationController
@members = @members.page(page).per(limit).includes(:course_group, user: :user_extension)
end
def delete_work
ActiveRecord::Base.transaction do
begin
work = @task.graduation_works.find_by!(user_id: params[:user_id])
tip_exception("只有组长才能删除组员") if work.commit_user_id != current_user.id
work.update_attributes(description: nil, project_id: 0, late_penalty: 0, work_status: 0, commit_time: nil,
update_time: nil, group_id: 0, commit_user_id: nil, final_score: nil, work_score: nil,
teacher_score: nil, teaching_asistant_score: nil, update_user_id: nil)
work.attachments.destroy_all
work.tidings.destroy_all
normal_status("删除成功")
rescue Exception => e
uid_logger(e.message)
tip_exception(e.message)
end
end
end
# 判断项目是否已有其他作品关联上了
def check_project
tip_exception("项目id不能为空") if params[:project_id].blank?
@ -371,6 +389,11 @@ class GraduationWorksController < ApplicationController
new_score.save!
@work.update_attributes(ultimate_score: 1, work_score: params[:score].to_f)
Tiding.create!(user_id: @work.user_id, trigger_user_id: current_user.id, container_id: new_score.id,
container_type: "AdjustScore", parent_container_id: @task.id,
parent_container_type: "GraduationTask", belong_container_id: @course.id,
belong_container_type: 'Course', tiding_type: "GraduationTask")
normal_status("调分成功")
rescue Exception => e
uid_logger(e.message)

@ -0,0 +1,6 @@
class LibraryTagsController < ApplicationController
def index
library_tags = LibraryTag.all
render_ok(library_tags: library_tags.as_json(only: %i[id name]), count: library_tags.size)
end
end

@ -5,6 +5,6 @@ class ShixunListsController < ApplicationController
private
def search_params
params.permit(:keyword, :type, :page, :limit, :order, :type, :status, :diff)
params.permit(:keyword, :type, :page, :limit, :order, :status, :diff)
end
end

@ -890,9 +890,10 @@ class ShixunsController < ApplicationController
user_name = "%#{params[:user_name].to_s.strip}%"
school_name = "%#{params[:school_name].to_s.strip}%"
if user_name.present? || school_name.present?
@users = User.joins(user_extension: :school).where("users.id not in #{member_ids} AND users.status = 1 AND
(LOWER(concat(users.lastname, users.firstname)) LIKE ? or users.phone like ?)
AND LOWER(schools.name) LIKE ?", user_name, user_name, school_name)
@users = User.where("users.id not in #{member_ids} AND users.status = 1 AND
(LOWER(concat(users.lastname, users.firstname)) LIKE ? or users.phone like ?)",
user_name, user_name)
@users = @users.joins(user_extension: :school).where("schools.name like '%#{school_name}%'") if params[:school_name].present?
else
@users = User.none
end

@ -6,7 +6,8 @@ class StagesController < ApplicationController
def index
@user = current_user
@stages = @subject.stages
@stages = @subject.stages.includes(:shixuns)
@myshixuns = @user.myshixuns.where(shixun_id: @subject.stage_shixuns.pluck(:shixun_id))
end
def create

@ -224,7 +224,7 @@ class StudentWorksController < ApplicationController
raise ActiveRecord::Rollback
end
SubmitStudentWorkNotifyJob.perform_later(@homework.id, student_ids) if student_ids.present?
ResubmitStudentWorkNotifyJob.perform_later(@homework.id, student_ids) if student_ids.present?
end
end
@ -333,6 +333,11 @@ class StudentWorksController < ApplicationController
@work.update_attributes(update_time: Time.now)
# 补交附件时给评阅过作品的教师、助教发消息
unless @work.student_works_scores.where.not(score: nil).where(reviewer_role: [1, 2]).pluck(user_id).uniq.blank?
ResubmitStudentWorkNotifyJob.perform_later(@homework.id, [current_user.id])
end
normal_status(0, "提交成功")
rescue Exception => e
uid_logger(e.message)
@ -551,6 +556,11 @@ class StudentWorksController < ApplicationController
@work.work_score = params[:score].to_f
@work.save!
Tiding.create!(user_id: @work.user_id, trigger_user_id: current_user.id, container_id: new_score.id,
container_type: "AdjustScore", parent_container_id: @homework.id,
parent_container_type: "HomeworkCommon", belong_container_id: @course.id,
belong_container_type: 'Course', tiding_type: "HomeworkCommon")
normal_status(0,"调分成功")
rescue Exception => e
uid_logger(e.message)

@ -0,0 +1,10 @@
class SubjectListsController < ApplicationController
def index
@results = SubjectSearchService.call(search_params)
end
private
def search_params
params.permit(:keyword, :type, :page, :limit, :order, :sort)
end
end

@ -3,7 +3,7 @@ class Users::CoursesController < Users::BaseController
courses = Users::CourseService.new(observed_user, query_params).call
@count = courses.count
@courses = paginate(courses.includes(teacher: { user_extension: :school }), special: true)
@courses = paginate(courses.includes(teacher: { user_extension: :school }), special: observed_user.is_teacher?)
end
private

@ -5,7 +5,7 @@ class Users::ProjectsController < Users::BaseController
projects = Users::ProjectService.new(observed_user, query_params).call
@count = projects.count
@projects = paginate(projects.includes(:project_score, owner: { user_extension: :school }), special: true)
@projects = paginate(projects.includes(:project_score, owner: { user_extension: :school }), special: observed_user.is_teacher?)
end
def search

@ -3,7 +3,7 @@ class Users::ShixunsController < Users::BaseController
shixuns = Users::ShixunService.new(observed_user, query_params).call
@count = shixuns.count
@shixuns = paginate(shixuns.includes(:first_tag_repertoire), special: true)
@shixuns = paginate(shixuns.includes(:first_tag_repertoire), special: observed_user.is_teacher?)
ids = @shixuns.map(&:id)
@finished_challenges_count_map = Game.joins(:myshixun).where(user_id: observed_user.id, status: 2)

@ -3,7 +3,7 @@ class Users::SubjectsController < Users::BaseController
subjects = Users::SubjectService.new(observed_user, query_params).call
@count = subjects.count
@subjects = paginate(subjects.includes(:user, :repertoire), special: true)
@subjects = paginate(subjects.includes(:user, :repertoire), special: observed_user.is_teacher?)
end
private

@ -134,6 +134,15 @@ module TidingDecorator
end
end
def delete_course_content
I18n.t(locale_format) % container.name
end
def delete_course_member_content
name = Course.find_by(id: container_id)&.name
I18n.t(locale_format) % [trigger_user&.show_real_name, name]
end
def shixun_content
I18n.t(locale_format) % container.name
end
@ -331,13 +340,21 @@ module TidingDecorator
end
def student_work_content
I18n.t(locale_format(extra.nil?)) % container&.homework_common.try(:name)
I18n.t(locale_format) % container&.homework_common.try(:name)
end
def resubmit_student_work_content
I18n.t(locale_format) % container&.homework_common.try(:name)
end
def student_works_score_content
I18n.t(locale_format(extra)) % container&.student_work&.homework_common.try(:name)
end
def adjust_score_content
I18n.t(locale_format) % parent_container.try(:name)
end
def challenge_work_score_content
I18n.t(locale_format) % container&.comment
end

@ -126,10 +126,11 @@ module ApplicationHelper
# 用户图像url如果不存在的话source为匿名用户即默认使用匿名用户图像
def url_to_avatar(source)
if File.exist?(disk_filename(source.class, source.id))
ctime = File.ctime(disk_filename(source.class, source.id)).to_i
if source.class.to_s == 'User'
File.join(relative_path, ["#{source.class}", "#{source.id}"])
File.join(relative_path, ["#{source.class}", "#{source.id}"]) + "?t=#{ctime}"
else
File.join("images/avatars", ["#{source.class}", "#{source.id}"])
File.join("images/avatars", ["#{source.class}", "#{source.id}"]) + "?t=#{ctime}"
end
elsif source.class.to_s == 'User'
str = source.user_extension.try(:gender).to_i == 0 ? "b" : "g"

@ -269,8 +269,8 @@ module CoursesHelper
group_info
end
def last_subject_shixun user_id, course
myshixun = Myshixun.where(user_id: user_id, shixun_id: course.shixuns).order("updated_at desc").first
def last_subject_shixun course, myshixuns
myshixun = myshixuns.sort{|x,y| y[:updated_at] <=> x[:updated_at] }.first
return "" unless myshixun
stage_shixun = course.course_stage_shixuns.where(shixun_id: myshixun.shixun_id).take
progress = stage_shixun&.course_stage&.position.to_s + "-" + stage_shixun&.position.to_s + " " + myshixun.shixun&.name

@ -1,8 +1,8 @@
module StagesHelper
# 章节实训的通关情况
def stage_myshixun_status shixun, user
myshixun = Myshixun.where(user_id: user.id, shixun_id: shixun.id).take
def stage_myshixun_status myshixun
# myshixun = Myshixun.where(user_id: user.id, shixun_id: shixun.id).take
myshixun.try(:status) == 1 ? 1 : 0
end

@ -0,0 +1,2 @@
module SubjectListsHelper
end

@ -0,0 +1,22 @@
# 删除课堂用户
class CourseDeleteStudentNotifyJob < ApplicationJob
queue_as :notify
def perform(course_id, student_ids, trigger_user_id)
course = Course.find_by(id: course_id)
return if course.blank?
attrs = %i[user_id trigger_user_id container_id container_type belong_container_id
belong_container_type tiding_type created_at updated_at]
same_attrs = {
trigger_user_id: trigger_user_id, container_id: course.id, container_type: 'DeleteCourseMember',
belong_container_id: course.id, belong_container_type: 'Course', tiding_type: 'System'
}
Tiding.bulk_insert(*attrs) do |worker|
student_ids.each do |user_id|
worker.add same_attrs.merge(user_id: user_id)
end
end
end
end

@ -0,0 +1,33 @@
class ResubmitStudentWorkNotifyJob < ApplicationJob
queue_as :notify
def perform(homework_id, student_ids)
homework = HomeworkCommon.find_by(id: homework_id)
return if homework.blank? || student_ids.blank?
course = homework.course
attrs = %i[user_id trigger_user_id container_id container_type parent_container_id parent_container_type
belong_container_id belong_container_type tiding_type viewed created_at updated_at]
same_attrs = {
container_type: 'ResubmitStudentWork', parent_container_id: homework.id, parent_container_type: 'HomeworkCommon',
belong_container_id: course.id, belong_container_type: 'Course', tiding_type: 'HomeworkCommon', viewed: 0
}
Tiding.bulk_insert(*attrs) do |worker|
student_ids.each do |user_id|
next unless User.exists?(id: user_id)
work = homework.student_works.find_by(user_id: user_id)
next if work.blank?
score_user_ids = work.student_works_scores.where.not(score: nil).where(reviewer_role: [1, 2]).pluck(user_id).uniq
next if score_user_ids.blank?
attrs = same_attrs.merge(trigger_user_id: user_id, container_id: work.id)
score_user_ids.each do |user_id|
worker.add attrs.merge(user_id: user_id)
end
end
end
end
end

@ -354,9 +354,8 @@ class Course < ApplicationRecord
Myshixun.where(user_id: user_id, shixun_id: shixuns).exists?
end
def my_subject_progress
my_challenge_count = Game.joins(:challenge).where(user_id: User.current.id, status: 2, challenges: {shixun_id: shixuns.published_closed}).
pluck(:challenge_id).uniq.size
def my_subject_progress myshixuns
my_challenge_count = Game.where(myshixun_id: myshixuns.pluck(:id), status: 2).pluck(:challenge_id).uniq.size
course_challeng_count = shixuns.pluck(:challenges_count).sum
count = course_challeng_count == 0 ? 0 : ((my_challenge_count.to_f / course_challeng_count).round(2) * 100).to_i
end

@ -11,6 +11,7 @@ class EcCourseEvaluation < ApplicationRecord
enum score_type: { detail: 1, average: 2 }, _suffix: :score_type # :detail_score_type?, :average_score_type?
accepts_nested_attributes_for :ec_course_evaluation_subitems, allow_destroy: true
alias_attribute :evaluation_count, :evluation_count
def imported?
import_status?

@ -18,7 +18,9 @@ module Searchable::Subject
def search_data
{
name: name,
description: Util.extract_content(description)[0..Searchable::MAXIMUM_LENGTH]
description: Util.extract_content(description)[0..Searchable::MAXIMUM_LENGTH],
shixuns_count: shixuns_count,
myshixuns_count: member_count,
}.merge!(searchable_user_data)
.merge!(searchable_stages_data)
end
@ -45,7 +47,8 @@ module Searchable::Subject
visits_count: visits,
stage_count: stages_count,
stage_shixuns_count: stage_shixuns_count,
shixuns_count: shixuns_count
shixuns_count: shixuns_count,
myshixuns_count: member_count
}
end

@ -10,6 +10,8 @@ class Admins::UpdateUserService < ApplicationService
def call
user.assign_attributes(user_attributes)
user.mail = params[:mail].to_s.presence
user.phone = params[:phone].to_s.presence
user.firstname = ''
user.password = params[:password] if params[:password].present?

@ -29,7 +29,7 @@ class Ecs::QueryCourseEvaluationService < ApplicationService
support = subitem.ec_course_supports.find_by(ec_course_id: ec_course.id)
weight = support.weights.to_f
weight = support&.weights.to_f
objective_achievement = (weight * ec_course.ec_year.calculation_value.to_f).round(3)
target_total_rates = 0

@ -0,0 +1,42 @@
class SubjectSearchService < ApplicationService
include ElasticsearchAble
attr_reader :params
def initialize(params)
@params = params
end
def call
# 全部实训/我的实训
type = params[:type] || "all"
if type == "mine"
@subjects = User.current.shixuns.visible.unhidden
else
@subjects = Subject.visible.unhidden
end
Subject.search(keyword, search_options)
end
private
def search_options
model_options = {
includes: [ user: { user_extension: :school } ]
}
model_options.merge!(where: { id: @subjects.pluck(:id) })
model_options.merge!(order: {sort_type => sort_str})
model_options.merge!(default_options)
model_options
end
def sort_str
params[:order] || "desc"
end
def sort_type
params[:sort] || "myshixuns_count"
end
end

@ -74,7 +74,7 @@
<div class="form-row">
<%= f.input :mail, as: :email, label: '邮箱地址', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11' } %>
<%= f.input :phone, as: :tel, label: '手机号', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11' } %>
<%= f.input :phone, as: :tel, label: '手机号', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11', autocomplete: 'off' } %>
</div>
<div class="form-row province-city-select">
@ -124,8 +124,8 @@
</div>
<div class="form-row">
<%= f.input :password, as: :password, label: '修改密码', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11' } %>
<%= f.input :password_confirmation, as: :password, label: '确认密码', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11' } %>
<%= f.input :password, as: :password, label: '修改密码', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11', autocomplete: 'new-password' } %>
<%= f.input :password_confirmation, as: :password, label: '确认密码', wrapper_html: { class: 'col-md-3' }, input_html: { class: 'col-sm-11', autocomplete: 'new-password' } %>
</div>
</div>

@ -1,5 +1,5 @@
json.stages @stages do |stage|
json.partial! 'stages/stage', locals: {stage: stage, user:@user, subject:@subject}
json.partial! 'stages/stage', locals: {stage: stage, user: @user, subject: @subject, myshixuns: @myshixuns}
end
# json.description @subject&.description
@ -7,6 +7,6 @@ end
json.start_learning @start_learning
json.subject_id @subject.id
json.learned @start_learning ? @course.my_subject_progress : 0
json.learned @start_learning ? @course.my_subject_progress(@myshixuns) : 0
json.last_shixun @start_learning ? last_subject_shixun(@user.id, @course) : ""
json.last_shixun @start_learning ? last_subject_shixun(@course, @myshixuns) : ""

@ -0,0 +1,2 @@
json.course_targets @course_targets, partial: 'ecs/course_targets/shared/ec_course_target_with_achievement_methods', as: :ec_course_target

@ -1,4 +1,4 @@
json.graduation_requirements @graduation_requirements, partial: 'ecs/ec_graduation_requirements/shared/ec_graduation_requirement', as: :ec_graduation_requirement
json.training_subitems @training_subitems, partial: 'ecs/ec_training_subitems/shared/ec_training_subitem', as: :ec_training_subitem
json.training_subitems @training_subitems, partial: 'ecs/ec_training_objectives/shared/ec_training_subitem', as: :ec_training_subitem
json.requirement_support_objectives @requirement_support_objectives, partial: 'ecs/requirement_support_objectives/shared/requirement_support_objective', as: :requirement_support_objective

@ -1,4 +1,9 @@
json.graduation_standards @graduation_standards, partial: 'ecs/shared/ec_graduation_standard', as: :ec_graduation_standard
json.graduation_subitems @graduation_subitems, partial: 'ecs/shared/ec_graduation_subitem', as: :ec_graduation_subitem
json.graduation_subitems do
json.array! @graduation_subitems do |graduation_subitem|
json.partial! 'ecs/shared/ec_graduation_subitem', ec_graduation_subitem: graduation_subitem
json.graduation_requirement_position graduation_subitem.ec_graduation_requirement.position
end
end
json.subitem_support_standards @subitem_support_standards, partial: 'ecs/subitem_support_standards/shared/subitem_support_standard', as: :subitem_support_standard

@ -11,6 +11,7 @@ json.tasks @tasks.each do |task|
task_curr_status = task_curr_status(task, @course)
json.status task_curr_status[:status]
json.status_time task_curr_status[:time]
json.author task.user.real_name
unless task_curr_status[:status].include?("未发布")
json.commit_count grduationwork_count task, 1

@ -15,7 +15,7 @@ json.shixuns_list do
json.shixun_name shixun.name
json.shixun_hidden shixun.hidden
json.identifier shixun.identifier
json.complete_status stage_myshixun_status(shixun, user)
json.complete_status stage_myshixun_status(myshixuns.select{|ms| ms.shixun_id == shixun.id}.first)
json.shixun_status stage_shixun_status(subject.status, shixun.status, shixun.hidden)
end
end

@ -1,3 +1,3 @@
json.stages @stages do |stage|
json.partial! 'stage', locals: {stage: stage, user:@user, subject:@subject}
json.partial! 'stage', locals: {stage: stage, user: @user, subject: @subject, myshixuns: @myshixuns}
end

@ -0,0 +1,22 @@
json.subjects_count @results.total_count
json.subject_list do
json.array! @results.with_highlights(multiple: true) do |obj, highlights|
json.merge! obj.to_searchable_json
# 去除开头标点符号
reg = /^[,。?:;‘’!“”—……、]/
# 附件的替换
atta_reg = /!\[.*]\(\/api\/attachments\/\d+\)/
highlights[:description]&.first&.sub!(reg, '')
highlights[:description]&.map{|des| des.gsub!(atta_reg, '')}
highlights[:content]&.first&.sub!(reg, '')
highlights[:content]&.map{|des| des.gsub!(atta_reg, '')}
json.title highlights.delete(:name)&.join('...') || obj.searchable_title
json.description highlights[:description]&.join('...') || Util.extract_content(obj.description)[0..300]&.sub!(atta_reg, '')
json.content highlights
end
end

@ -4,5 +4,5 @@ json.name user.full_name
json.grade user.grade
json.identity user&.user_extension&.identity
# json.email user.mail # 邮箱原则上不暴露的,如果实在需要的话只能对某些具体的接口公开
json.image_url image_tag(url_to_avatar(user))
json.image_url url_to_avatar(user)
json.school user.school_name

@ -5,6 +5,7 @@ json.members_count course.course_members_count
# json.homework_commons_count course.homework_commons_count
json.homework_commons_count get_tasks_count course
json.attachments_count course.attachments.count
json.visits course.visits
json.first_category_url module_url(course.course_modules.where(hidden: 0).order(position: :desc).first, course)

@ -1,6 +1,6 @@
json.id @user.id
json.name @user.full_name
json.avatar_url image_tag("/" + url_to_avatar(@user))
json.avatar_url url_to_avatar(@user)
json.is_logged_user @user.logged_user?
json.experience @user.experience
json.grade @user.grade

@ -58,8 +58,8 @@
"2_end": "你提交的试用授权申请,审核未通过<br/><span>原因:%{reason}</span>"
Apply_end: "提交了试用授权申请"
Course_end: "你创建了课堂:%s"
Course:
Delete_end: "你删除了课堂%s"
DeleteCourse_end: "你删除了课堂:%s"
DeleteCourseMember_end: "%s 将从课堂中删除了:%s"
Shixun_end: "你创建了实训:%s"
Subject_end: "你创建了实践课程:%s"
ArchiveCourse_end: "你的课堂已经归档:%s"
@ -185,13 +185,13 @@
NearlyEnd_end: "作业的提交截止时间快到啦:%{name}"
AppealNearlyEnd_end: "作品的匿评申诉时间快到啦:%{name}"
EvaluationNearlyEnd_end: "作业的匿评截止时间快到啦:%{name}"
StudentWork:
true_end: "提交了作品:%s"
false_end: "重新提交了作品,建议您重新评阅:%s"
StudentWork_end: "提交了作品:%s"
ResubmitStudentWork_end: "重新提交了作品,建议您重新评阅作品:%s"
StudentWorksScore:
1_end: "评阅了你的作品:%s"
2_end: "评阅了你的作品:%s"
3_end: "有人匿评了你的作品:%s"
AdjustScore_end: "调整了你的作品得分:%s"
ChallengeWorkScore_end: "调整了你的作品分数:%s"
StudentWorksScoresAppeal:
UserAppealResult:

@ -174,6 +174,7 @@ Rails.application.routes.draw do
end
end
resources :subject_lists
resources :shixun_lists
resources :shixuns, param: :identifier do
@ -539,6 +540,7 @@ Rails.application.routes.draw do
post 'relate_project'
get 'cancel_relate_project'
post 'revise_attachment'
delete 'delete_work'
end
member do
@ -791,6 +793,7 @@ Rails.application.routes.draw do
end
resources :libraries, only: [:index, :show, :create, :update, :destroy]
resources :library_tags, only: [:index]
scope module: :projects do
resources :project_applies, only: [:create]

@ -0,0 +1,9 @@
class AddLibraryTagData < ActiveRecord::Migration[5.2]
def up
execute 'INSERT INTO library_tags(id, name) VALUES(4, "高校案例")'
end
def down
execute 'DELETE FROM library_tags WHERE id = 4 and name = "高校案例"'
end
end

File diff suppressed because one or more lines are too long

@ -27586,9 +27586,9 @@ $.fn.bootstrapViewer = function (options) {
' <div class="modal-dialog modal-lg" style="display: inline-block; width: auto;">\n' +
' <div class="modal-content">\n' +
' <img' +
'\t\t\t class="carousel-inner img-responsive img-rounded img-viewer" \n' +
'\t\t\t onclick="$(\'#bootstrapViewer\').modal(\'hide\');setTimeout(function(){$(\'#bootstrapViewer\').remove();},200);"\n' +
'\t\t\t onmouseover="this.style.cursor=\'zoom-out\';" \n' +
'\t\t\t class="carousel-inner img-responsive img-rounded img-viewer" draggable="false"\n' +
'\t\t\t onclick="/*$(\'#bootstrapViewer\').modal(\'hide\');setTimeout(function(){$(\'#bootstrapViewer\').remove();},200);*/"\n' +
'\t\t\t onmouseover="this.style.cursor=\'move\';" \n' +
'\t\t\t onmouseout="this.style.cursor=\'default\'" \n' +
'\t\t\t />\n' +
' </div>\n' +
@ -27601,13 +27601,41 @@ $.fn.bootstrapViewer = function (options) {
} else {
throw "图片不存在"
}
$('#bootstrapViewer').on('hidden.bs.modal', function(){
$('#bootstrapViewer').remove();
});
var $moveDiv = $('#bootstrapViewer .modal-dialog');
var isMove = false;
var div_x = $moveDiv.offset().left;
var div_y = $moveDiv.offset().top;
var mousedownFunc = function (e) {
if (isMove) {
var left = e.pageX - div_x;
var top = e.pageY - div_y;
if(left < 0){ left = 0}
if(top < 0){ top = 0}
$moveDiv.css({"left": left, "top":top});
}
}
$moveDiv.mousedown(function (e) {
$moveDiv.css({ left: $moveDiv[0].offsetLeft, top: $moveDiv[0].offsetTop, marginTop: 0, position: 'absolute' });
isMove = true;
div_x = e.pageX - $moveDiv.offset().left;
div_y = e.pageY - $moveDiv.offset().top;
$(document).mousemove(mousedownFunc);
}).mouseup(function () {
isMove = false;
$(document).unbind('mousemove', mousedownFunc);
});
})
$(this).on('mouseover', function () {
$(this).css('cursor', 'zoom-in');
})
}
$.fn.bootstrapViewer.defaults = {
src: 'src'

@ -113,13 +113,13 @@
}
this.hide().lockScreen(false).hideMask();
cm.focus && cm.focus()
return false;
}],
cancel : [lang.buttons.cancel, function() {
this.hide().lockScreen(false).hideMask();
cm.focus && cm.focus()
return false;
}]
}

@ -32,7 +32,7 @@ module.exports = {
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
// devtool: "cheap-module-eval-source-map",
// 开启调试
// devtool: "eval", // 开启调试
devtool: "eval-source-map", // 开启调试
// These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle.
// The first two entry points enable "hot" CSS and auto-refreshes for JS.

@ -3,13 +3,12 @@
<head>
<meta charset="utf-8">
<!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />-->
<!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">-->
<!-- width=device-width, initial-scale=1 , shrink-to-fit=no -->
<!-- <meta name="viewport" content=""> -->
<meta name="theme-color" content="#000000">
<!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">-->
<!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">

@ -2,6 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -92,6 +92,10 @@ html, body {
.formItemInline .ant-form-item-control-wrapper {
flex: 1;
}
/* AutoComplete placeholder 不显示的问题 */
.ant-select-auto-complete.ant-select .ant-select-selection__placeholder {
z-index: 2;
}
/* 兼容性 */

@ -33,6 +33,7 @@ if (isDev) {
}
window._debugType = debugType;
export function initAxiosInterceptors(props) {
initOnlineOfflineListener()
// TODO 避免重复的请求 https://github.com/axios/axios#cancellation
// https://github.com/axios/axios/issues/1497
@ -204,3 +205,27 @@ export function initAxiosInterceptors(props) {
// -----------------------------------------------------------------------------------
}
function initOnlineOfflineListener() {
const $ = window.$
$(window).bind("online", () => {
notification.destroy()
notification.success({
duration: null,
message: '网络恢复正常',
description:
'网络恢复正常,感谢使用。',
})
});
$(window).bind("offline", () => {
notification.destroy()
notification.warning({
duration: null,
message: '网络异常',
description:
'网络异常,请检测网络后重试。',
})
});
}

@ -110,7 +110,7 @@ class CommentItemMDEditor extends Component {
<img alt="0?1442652658" height="33" src={`/images/${user.image_url}`} width="33"></img>
</a>
</div>
<div id={`reply_message_${item.id}`} className="reply_to_message commentItemMDEditor"
<div id={`reply_message_${item.id}`} className="reply_to_message commentItemMDEditor editormd-image-click-expand"
style={{ paddingTop: '0px', paddingBottom: '0px', marginTop: '36px' }}
>
<div id={`reply_message_editorMd_${item.id}`} className="editorMD" style={{ marginBottom: '0px'}}>

@ -299,7 +299,6 @@ class CoursesIndex extends Component{
this.historyArray = [window.location.pathname];
this.props.history.listen( location => {
console.log(location);
this.historyArray.unshift(window.location.pathname);
this.historyArray.length = 2;
//Do your stuff here

@ -28,6 +28,21 @@ class Fileslistitem extends Component{
}
showfiles=(list)=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
// if(this.props.checkIfProfileCompleted()===false){
// this.setState({
// AccountProfiletype:true
// })
// return
// }
// if(this.props.checkIfProfessionalCertification()===false){
// this.props.showProfileCompleteDialog()
// return
// }
if(list.is_history_file===false){
// this.props.DownloadFileA(list.title,list.url)
//window.location.href=list.url;
@ -217,7 +232,7 @@ class Fileslistitem extends Component{
{
this.props.isNotMember===true?
discussMessage.is_lock === true ?
<span className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</span>
<span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer" title={"私有属性,非课堂成员不能访问"}>{discussMessage.title}</span>
:<a
onClick={()=>this.showfiles(discussMessage)}
title={discussMessage.title}

@ -113,6 +113,9 @@ class Fileslists extends Component{
updadatalist=(id)=>{
// this.seactall(id)
if(this.props.user&&this.props.user.login=== ""||this.props.user&&this.props.user.login=== null||this.props.user&&this.props.user.login=== undefined){
}else{
let coursesId=this.props.match.params.coursesId;
let url="/courses/"+coursesId+"/attahcment_category_list.json";
axios.get(url, {
@ -139,6 +142,8 @@ class Fileslists extends Component{
})
}
}
updatafiled=()=>{
if(this.props.match.params.main_id){
this.seactall();

@ -10,6 +10,21 @@ class BoardsListItem extends Component{
}
}
onTitleClick = (discussMessage) => {
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
// if(this.props.checkIfProfileCompleted()===false){
// this.setState({
// AccountProfiletype:true
// })
// return
// }
// if(this.props.checkIfProfessionalCertification()===false){
// this.props.showProfileCompleteDialog()
// return
// }
const isAdminOrStudent = this.props.isAdminOrStudent();
if (!isAdminOrStudent && discussMessage.is_public == false) {
// 没有权限访问
@ -47,15 +62,15 @@ class BoardsListItem extends Component{
</a>
<div className="clearfix ds pr pt5 contentSection" onClick={() => onItemClick(discussMessage)}>
<h6>
<a href="javascript:void(0)" className="panel-list-title hide fl mt5 color-dark font-bd"
style={{ fontWeight: 'bold', cursor: (canNotLink ? 'default' : 'poninter'), maxWidth: '700px' }}
{canNotLink?<span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer" title={canNotLink?"私有属性,非课堂成员不能访问":`${discussMessage.subject}`}>{discussMessage.subject}</span>:<a className="panel-list-title hide fl mt5 color-dark font-bd pointer"
style={{ fontWeight: 'bold', maxWidth: '700px' }}
title={discussMessage.subject}
onClick={canNotLink ? () => {} : () => this.onTitleClick(discussMessage)}
title={`${discussMessage.subject.length > 40 ? discussMessage.subject : ''}`}
>{discussMessage.subject}</a>
>{discussMessage.subject}</a>}
{ !!discussMessage.sticky && <span className="btn-cir btn-cir-red fl mt5 ml5">置顶</span> }
{
discussMessage.is_public == false ? (<Tooltip title={`${isAdminOrStudent ? '私有属性' : '私有属性,非课堂成员不能访问'}`}>
discussMessage.is_public == false ? (<Tooltip title={`${isAdminOrStudent ? '私有属性' : '私有属性,非课堂成员不能访问'}`} placement="bottom">
<i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl mt4"></i>
</Tooltip>) : ""
}

@ -116,6 +116,7 @@ class Boards extends Component{
this.setState({
isSpin:true
})
this.clearAllCheck()
this.fetchAll(null, 1)
}
}

@ -16,6 +16,22 @@ class CommonWorkItem extends Component{
}
}
onItemClick = (item) => {
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
// if(this.props.checkIfProfileCompleted()===false){
// this.setState({
// AccountProfiletype:true
// })
// return
// }
// if(this.props.checkIfProfessionalCertification()===false){
// this.props.showProfileCompleteDialog()
// return
// }
const isStudent = this.props.isStudent()
if (isStudent) {
this.props.toWorkQuestionPage(this.props.match.params, item.homework_id)
@ -128,6 +144,9 @@ class CommonWorkItem extends Component{
text-overflow: ellipsis;
white-space: nowrap;
}
a:hover{
color: #4cacff;
}
`
}
</style>
@ -142,17 +161,21 @@ class CommonWorkItem extends Component{
mainList && isAdmin &&
<span className="fl mr12"><Checkbox value={item.homework_id} key={item.homework_id}></Checkbox></span>
}
<div className="flex1" onClick={() => this.props.onItemClick(Object.assign({}, item, {id: item.homework_id})) }>
<p className="clearfix mb20">
<a title={item.name}
className="fl font-16 font-bd mt2 comnonwidth580" style={{cursor: canNotLink ? 'default' : 'poninter'}}
{canNotLink?<span className={"fl font-16 font-bd mt2 comnonwidth580 pointer color-grey-name"}
title={ canNotLink ? "私有属性,非课堂成员不能访问" : item.name}
>
{item.name}
</span>:<a className={"fl font-16 font-bd mt2 comnonwidth580 pointer"}
onClick={ canNotLink ? () => {} : () => this.onItemClick(item)}
>{item.name}</a>
title={item.name}
>{item.name}</a>}
{/* 只有非课堂成员且作业是私有的情况下才会为true */}
{
item.private_icon===true ?
(<Tooltip title={ isAdminOrStudent ? "私有属性" : "私有属性,非课堂成员不能访问"}>
(<Tooltip title={ isAdminOrStudent ? "私有属性" : "私有属性,非课堂成员不能访问"} placement="bottom" >
<i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl"></i>
</Tooltip>) : ""
}
@ -182,7 +205,7 @@ class CommonWorkItem extends Component{
{item.uncommit_count===undefined?"":<span className="mr20 fl">{item.uncommit_count} 未交</span>}
{
item.status_time!="" &&
<Tooltip title={ item.status.indexOf('提交中') != -1 ? '提交剩余时间' :
<Tooltip placement="bottom" title={ item.status.indexOf('提交中') != -1 ? '提交剩余时间' :
item.status.indexOf('补交中') != -1 ? '补交剩余时间' :
item.status.indexOf('申诉中') != -1 ? '申诉剩余时间' :
item.status.indexOf('匿评中') != -1 ? '匿评剩余时间' :

@ -641,7 +641,7 @@ class CommonWorkList extends Component{
timeMsg = '申诉剩余时间'
}
const hasData = student_works && !!student_works.length && page == 1
const hasData = this.state.homework_status && this.state.homework_status.indexOf("未发布") == -1 // student_works && !!student_works.length && page == 1 &&
// console.log(StudentData)
// console.log(student_works)

@ -70,10 +70,23 @@ class NewWorkForm extends Component{
contentFileList,
answerFileList,
}, () => {
setTimeout(() => {
this.contentMdRef.current.setValue(data.description || '')
this.answerMdRef.current.setValue(data.reference_answer || '')
}, 2000)
// setTimeout(() => {
// this._scrollToTop()
// 阻止setValue的滚动
// $(window).scroll( function() {
// $("html").scrollTop(0)
// $(window).unbind("scroll");
// });
/**
setValue会调用到 codemirror的 o.scrollIntoView(i), 会导致滚动条跳动
*/
// $('.editormd').parent().css('position', 'fixed').css('left', '-1000px')
// this.contentMdRef.current.setValue(data.description || '')
// this.answerMdRef.current.setValue(data.reference_answer || '')
// setTimeout(() => {
// $('.editormd').parent().css('position', '').css('left', 'auto')
// }, 100);
// }, 500)
this.props.form.setFieldsValue({
title: data.name,
@ -85,12 +98,13 @@ class NewWorkForm extends Component{
} else { // new
}
this._scrollToTop()
// this._scrollToTop()
}
_scrollToTop = () => {
setTimeout(() => {
$("html").animate({ scrollTop: 0 })
}, 1500)
// setTimeout(() => {
$("html").scrollTop(0)
// $("html").animate({ scrollTop: 0 })
// }, 1000)
}
// 输入title
@ -303,15 +317,13 @@ class NewWorkForm extends Component{
let{
title_value, contentFileList, answerFileList, max_num, min_num, base_on_project,
init_max_num, init_min_num,
title_num, course_name, category, has_commit, has_project,
isEdit
title_num, course_name, category, has_commit, has_project
}=this.state
const { current_user } = this.props
const courseId = this.state.course_id || this.props.match.params.coursesId ;
if ((isEdit) && !this.state.workLoaded) {
this.isEdit = this.isEdit || this.props.match.url.indexOf('/edit') != -1
if ((this.isEdit) && !this.state.description && this.state.description != '') {
return ''
}
const uploadProps = {
@ -439,7 +451,8 @@ class NewWorkForm extends Component{
}],
})(
<TPMMDEditor ref={this.contentMdRef} placeholder="请在此输入作业内容和要求,最大限制5000个字符" mdID={'courseContentMD'} refreshTimeout={1500}
className="courseMessageMD" initValue={this.state.description}></TPMMDEditor>
initValue={this.state.description} noSetValueOnInit={!!this.isEdit}
className="courseMessageMD" ></TPMMDEditor>
)}
</Form.Item> }
<Upload {...uploadProps} className="upload_1 newWorkUpload">
@ -507,7 +520,8 @@ class NewWorkForm extends Component{
}],
})(
<TPMMDEditor ref={this.answerMdRef} placeholder="请在此输入作业的参考答案,最大限制5000个字符" mdID={'workAnswerMD'}
className="courseMessageMD" refreshTimeout={1500} initValue={this.state.reference_answer || ''}></TPMMDEditor>
initValue={this.state.reference_answer || ''} noSetValueOnInit={!!this.isEdit}
className="courseMessageMD" refreshTimeout={1500} ></TPMMDEditor>
)}
</Form.Item>
<Upload {...answerUploadProps} className="upload_1 newWorkUpload resetNewWorkUpload">

@ -16,7 +16,7 @@ class CBreadcrumb extends Component{
return ''
}
if (item.to) {
return <React.Fragment>
return <React.Fragment key={index}>
<WordsBtn style="grey" className="fl hovercolorblue" to={item.to}>{item.name}</WordsBtn>
{separator ?
<span className="color-grey-9 fl ml3 mr3">{separator}</span> :
@ -24,7 +24,7 @@ class CBreadcrumb extends Component{
}
</React.Fragment>
} else {
return <span>{item.name}</span>
return <span key={index}>{item.name}</span>
}
})}
</p>

@ -1,5 +1,5 @@
import React,{ Component } from "react";
import { Modal,Input, Checkbox} from "antd";
import { Modal,Input, Checkbox, Spin} from "antd";
import '../css/members.css'
class ModalWrapper extends Component{
@ -23,7 +23,7 @@ class ModalWrapper extends Component{
}
render(){
let {flag, visible}=this.state
let { onOk, cancelText, okText, title, width, className, bottomRender}=this.props;
let { onOk, cancelText, okText, title, width, className, bottomRender, loading}=this.props;
return(
<Modal
@ -48,6 +48,7 @@ class ModalWrapper extends Component{
}
</style>:""
}
<Spin spinning={!!this.props.loading}>
<div className="newupload_conbox clearfix">
{this.props.children}
{this.props.checkBoxValuestype===true?<div className={"mt10 color-red"}>
@ -59,6 +60,7 @@ class ModalWrapper extends Component{
</div>
{ bottomRender }
</div>
</Spin>
</Modal>
)
}

@ -181,7 +181,7 @@ class Coursesleftnav extends Component{
on('editshixunname',this.editshixunchild)
on('editshixunmainname',this.editshixunmainname)
this.props.updataleftNavfun();
// this.props.updataleftNavfun();
// this.props.getleftNavid && this.props.getleftNavid("shixun_homework");
// const position =parseInt(this.props.match.params.position);
@ -239,50 +239,52 @@ class Coursesleftnav extends Component{
setnavid=(e,key,id,type,url)=>{
// this.props.getleftNavid && this.props.getleftNavid(key,type);
let {selectnavid,navid}=this.state;
if(navidtype===true&&selectnavid===false){
if(navid===key){
this.setState({
navid:"",
selectnavid:false,
newselectnavid:id
})
}else{
this.setState({
navid:key,
positiontype:type,
selectnavid:false,
newselectnavid:id
})
}
}else{
// console.log(navidtype)
// console.log(selectnavid)
this.setState({
navid:"",
selectnavid:false,
newselectnavid:id
})
}
this.props.updataleftNavfun();
this.props.history.replace( url );
e.stopPropagation();//阻止冒泡
// let {selectnavid,navid}=this.state;
//
// if(navidtype===true&&selectnavid===false){
//
// if(navid===key){
// this.setState({
// navid:"",
// selectnavid:false,
// newselectnavid:id
// })
// }else{
// this.setState({
// navid:key,
// positiontype:type,
// selectnavid:false,
// newselectnavid:id
// })
// }
// }else{
// // console.log(navidtype)
// // console.log(selectnavid)
// this.setState({
// navid:"",
// selectnavid:false,
// newselectnavid:id
// })
// }
//
// this.props.updataleftNavfun();
// this.props.history.replace( url );
// e.stopPropagation();//阻止冒泡
this.selectnavid(e,key,id,type,url)
}
selectnavid=(e,key,id,type,urls,index)=>{
let {url}=this.state;
if(urls!=url){
this.props.history.replace(urls);
this.props.updataleftNavfun();
this.props.history.replace(urls);
}else{
if (key === this.props.indexs) {
this.props.unlocationNavfun(undefined)
} else {
this.props.updataleftNavfun();
this.props.unlocationNavfun(key)
this.props.history.replace(urls);
}
@ -304,8 +306,9 @@ class Coursesleftnav extends Component{
url:urls,
indexs:index
})
this.props.history.replace(urls);
this.props.updataleftNavfun();
this.props.history.replace(urls);
}
@ -721,24 +724,27 @@ class Coursesleftnav extends Component{
e.stopPropagation();//阻止冒泡
}
showsandians=(e,key,urls,num)=> {
showsandians=(e,key,urls,num,id,type,index)=> {
let {url}=this.state;
if (key === this.props.indexs) {
this.props.unlocationNavfun(undefined)
this.props.history.replace(urls);
} else {
this.props.updataleftNavfun();
this.props.unlocationNavfun(key)
this.props.history.replace(urls);
}
if(urls!=url){
this.props.updataleftNavfun();
this.props.history.replace(urls);
}
// if(this.props.indexs===undefined){
//
// }else{
//
// }
this.setState({
selectnavid:true,
newselectnavid:id,
url:urls,
indexs:index
})
}
maincontent=(item,key)=>{
@ -930,8 +936,8 @@ class Coursesleftnav extends Component{
return(
<div key={key} >
<a>
<li title={item.name.length<7?"":item.name} onClick={(e)=>this.showsandians(e,key,item.category_url,1)} className={this.props.mainurl===item.category_url&&key===this.props.indexs?"liactive":"clearfix active"} onMouseLeave={(e)=>this.hidesandian(e,key)} onMouseEnter={(e)=>this.showsandian(e,key)}>
<a onClick={(e)=>this.showsandians(e,key,item.category_url,1)} className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}>
<li title={item.name.length<7?"":item.name} onClick={(e)=>this.showsandians(e,key,item.category_url,1,item.id,item.type)} className={this.props.mainurl===item.category_url?"liactive":"clearfix active"} onMouseLeave={(e)=>this.hidesandian(e,key)} onMouseEnter={(e)=>this.showsandian(e,key)}>
<a onClick={(e)=>this.showsandians(e,key,item.category_url,1,item.id,item.type)} className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}>
{
item.type==="announcement"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-xiaoxi1 mr10 fl":"iconfont icon-xiaoxi1 mr10 fl"}></i>:
item.type==="online_learning"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-kecheng mr10 fl font-16":"iconfont icon-kecheng mr10 fl font-16"}></i>:
@ -976,7 +982,7 @@ class Coursesleftnav extends Component{
ref={provided.innerRef}
{...provided.droppableProps}
className={"droppableul"}
style={{display: this.props.mainurl===item.category_url&&key===this.props.indexs?"":"none"}}
style={{display: key===this.props.indexs?"":"none"}}
>
{item.second_category===undefined?"":item.second_category.map((iem,index)=>{
if(item.type==="course_group"){
@ -1044,7 +1050,7 @@ class Coursesleftnav extends Component{
<div key={key}>
{/*<Tooltip placement="bottom" title={"点击空白处展开二级菜单,点击模块名字跳转到对应模块"}>*/}
<a >
<li className={this.props.mainurl===item.category_url&&key===this.props.indexs?"liactive":"clearfix active"}
<li className={this.props.mainurl===item.category_url?"liactive":"clearfix active"}
onClick={(e)=>this.setnavid(e,key,item.id,item.type,item.category_url)} onMouseEnter={(e)=>this.showsandian(e,key)}
title={item.name.length<7?"":item.name}
>
@ -1069,11 +1075,8 @@ class Coursesleftnav extends Component{
</a>
</li>
</a>
{/*</Tooltip>*/}
{/*下拉列表*/}
{/* className={this.props.location.pathname===item.category_url||this.props.location.pathname===this.state.url&&key===this.state.indexs?"":""}*/}
<ul style={{display:this.props.mainurl===item.category_url&&key===this.props.indexs?"":"none"}} class="droppableul">
<ul style={{display:key===this.props.indexs?"":"none"}} class="droppableul">
{
item.second_category===undefined?"":item.second_category.map((iem,index)=>{
@ -1115,72 +1118,3 @@ class Coursesleftnav extends Component{
export default Coursesleftnav;
//
// sandianshow=(e,key)=>{
// this.setState({
// sandiantype:key
// })
// e.stopPropagation();//阻止冒泡
// }
// hidesandian=(e,key)=>{
// this.setState({
// sandiantypes:undefined
// })
// e.stopPropagation();//阻止冒泡
// }
// sandianshow=(e,key)=>{
// this.setState({
// sandiantype:key
// })
// e.stopPropagation();//阻止冒泡
// }
// sandianhide=(e)=>{
// this.setState({
// sandiantype:undefined,
//
// })
// e.stopPropagation();//阻止冒泡
// }
// twosandianshows=(e,key,type)=>{
//
// this.setState({
// twosandiantypenum:key,
// toopvisible:false,
// toopvisibleindex:undefined,
// twosandiantypes:type
// })
// e.stopPropagation();//阻止冒泡
// }
// twoMouseLeave=(e)=>{
// this.setState({
// toopvisible:false,
// })
// e.stopPropagation();//阻止冒泡
// }
{/*{ is_teacher===true?*/}
{/* <div className={hidden_modules.length===0?"none":""}>*/}
{/* <li className="clearfix addjia ebebeb">*/}
{/* <span className="addtaskmodle">*/}
{/* <i className={addGroup===true?"iconfont icon-jia mr5 ml110 fl martop1":"none"} onClick={this.addGroupmodel}></i>*/}
{/* <div className={addGroup===false?"ml100":"none"} onClick={this.addGroupmodelsave}>确定</div>*/}
{/* </span>*/}
{/* </li>*/}
{/* </div> :""}*/}
{/*{ is_teacher===true?<div className={addGroup===false?"CheckboxGroup":"none"}>*/}
{/* <CheckboxGroup style={{ width: '100%' }} value={addCheckboxGroup} onChange={this.addCheckboxGroupID}>*/}
{/* {hidden_modules.length===0?"":hidden_modules.map((list,key)=>{*/}
{/* return(*/}
{/* <li className="clearfix pl20" key={key}>*/}
{/* <Checkbox value={list.id} className="fl "></Checkbox>*/}
{/* <span className="task-hide activity-left-name ml3">{list.name}</span>*/}
{/* </li>*/}
{/* )*/}
{/* })}*/}
{/* </CheckboxGroup>*/}
{/* </div> :""}*/}

@ -30,7 +30,7 @@ class CoursesListType extends Component {
return(
<span style={{display:'inline-block'}}>
{
typelist===undefined?"":typelist.map((item,key)=>{
typelist===undefined || typelist=== 403 || typelist === 401 || typelist=== 407 || typelist=== 408|| typelist=== 409 || typelist === 500?"":typelist.map((item,key)=>{
return(
<Tooltip placement="bottom" title={tipval} getPopupContainer={()=>document.querySelector('.TabsWarp')} key={key}>
<span key={key}>

@ -19,19 +19,30 @@ class NewShixunModel extends Component{
order:'desc',
diff:0,
limit:15,
sort:"myshixuns_count"
}
}
componentDidMount() {
let{page,type,keyword,order,diff,limit,status}=this.state;
let{page,type,keyword,order,diff,limit,status,sort}=this.state;
if(this.props.type==='shixuns'){
this.getdatalist(page,type,status,keyword,order,diff,limit)
}else{
this.getdatalist(page,type,undefined,keyword,order,undefined,limit,undefined,sort);
}
}
getdatalist=(page,type,newstatus,keyword,order,diff,limit,pagetype)=>{
getdatalist=(page,type,newstatus,keyword,order,diff,limit,pagetype,sort)=>{
this.setState({
isspinning:true
})
let status=this.props.statustype===undefined?newstatus:'published';
let url="/shixun_lists.json"
let url;
if(this.props.type==='shixuns'){
url="/shixun_lists.json";
}else{
url="/subject_lists.json";
}
axios.get(url,{params:{
page,
type,
@ -39,20 +50,21 @@ class NewShixunModel extends Component{
keyword,
order,
diff,
limit
limit,
sort
}}).then((response) => {
if(response.data){
if(pagetype===undefined){
this.setState({
shixun_list:response.data.shixun_list,
shixuns_count:response.data.shixuns_count,
shixun_list:response.data.shixun_list===undefined?response.data.subject_list:response.data.shixun_list,
shixuns_count:response.data.shixuns_count===undefined?response.data.subjects_count:response.data.shixuns_count,
Grouplist:[],
isspinning:false
})
}else if(pagetype==="pagetype"){
this.setState({
shixun_list:response.data.shixun_list,
shixuns_count:response.data.shixuns_count,
shixun_list:response.data.shixun_list===undefined?response.data.subject_list:response.data.shixun_list,
shixuns_count:response.data.shixuns_count===undefined?response.data.subjects_count:response.data.shixuns_count,
isspinning:false
})
}
@ -127,8 +139,13 @@ class NewShixunModel extends Component{
newallGrouplist.push({page:pageNumber,list:[]})
}
let{type,status,keyword,order,diff,limit}=this.state;
let{type,status,keyword,order,diff,limit,sort}=this.state;
if(this.props.type==='shixuns'){
this.getdatalist(pageNumber,type,status,keyword,order,diff,limit,"pagetype")
}else{
this.getdatalist(pageNumber,type,undefined,keyword,order,undefined,limit,"pagetype",sort);
}
this.setState({
page:pageNumber,
allGrouplist:newallGrouplist
@ -142,8 +159,14 @@ class NewShixunModel extends Component{
keyword:undefined,
page:1
})
let{status,order,diff,limit}=this.state;
let{status,order,diff,limit,sort}=this.state;
if(this.props.type==='shixuns'){
this.getdatalist(1,value,status,undefined,order,diff,limit)
}else{
this.getdatalist(1,value,undefined,undefined,order,undefined,limit,undefined,sort)
}
}
updatedlist=(order)=>{
@ -205,7 +228,7 @@ class NewShixunModel extends Component{
this.setState({
hometypepvisible:false
})
this.showNotification("请先选择实训")
this.showNotification(this.props.type==='shixuns'?"请先选择实训":"请先选择课程")
return
}
@ -231,6 +254,7 @@ class NewShixunModel extends Component{
this.props.pathShixun(Grouplist)
return;
}
if(this.props.type==='shixuns'){
let url="/courses/"+coursesId+"/homework_commons/create_shixun_homework.json";
axios.post(url, {
category_id:this.props.category_id===null||this.props.category_id===undefined?undefined:parseInt(this.props.category_id),
@ -245,7 +269,35 @@ class NewShixunModel extends Component{
this.showNotification("操作成功")
this.props.homeworkupdatalists(this.props.Coursename,this.props.page,this.props.order);
this.props.hideNewShixunModelType()
this.props.updataleftNavfun()
}
this.setState({
hometypepvisible:false
})
// category_id: 3
// homework_ids: (5) [9171, 9172, 9173, 9174, 9175]
}).catch((error) => {
console.log(error)
this.setState({
hometypepvisible:false
})
})
}else{
let url="/courses/"+coursesId+"/homework_commons/create_subject_homework.json";
axios.post(url, {
category_id:this.props.category_id===null||this.props.category_id===undefined?undefined:parseInt(this.props.category_id),
subject_ids:Grouplist,
}
).then((response) => {
if(response.data.status===-1){
// this.props.showNotification(response.data.message)
}else{
// this.props.courseshomeworkstart(response.data.category_id,response.data.homework_ids)
this.showNotification("操作成功")
this.props.homeworkupdatalists(this.props.Coursename,this.props.page,this.props.order);
this.props.hideNewShixunModelType()
this.props.updataleftNavfun()
}
this.setState({
hometypepvisible:false
@ -260,6 +312,8 @@ class NewShixunModel extends Component{
})
}
}
poststatus=(status)=>{
this.setState({
status:status
@ -268,9 +322,37 @@ class NewShixunModel extends Component{
this.getdatalist(page,type,status,keyword,order,diff,limit)
}
updatepathlist=(sorts,orders)=>{
let{page,type,keyword,order,diff,limit,status,sort}=this.state;
let seartorders;
if(sort===sorts){
if(orders==="desc"){
this.setState({
sort:sorts,
order:"asc"
})
seartorders="asc"
}else{
this.setState({
sort:sorts,
order:"desc"
})
seartorders="desc"
}
}else{
this.setState({
sort:sorts,
order:"desc"
})
seartorders=orders
}
this.getdatalist(page,type,undefined,keyword,seartorders,undefined,limit,undefined,sorts)
}
render() {
let {diff,Grouplist,status,shixun_list,shixuns_count,page,type,order}=this.state;
let {diff,Grouplist,status,shixun_list,shixuns_count,page,type,order,sort}=this.state;
// let {visible,patheditarry}=this.props;
// console.log(Grouplist)
// console.log(allGrouplist)
@ -331,7 +413,7 @@ class NewShixunModel extends Component{
);
console.log(shixun_list)
return(
<div>
@ -355,7 +437,7 @@ class NewShixunModel extends Component{
closable={true}
destroyOnClose={true}
onClose={()=>this.props.hideNewShixunModelType()}
visible={this.props.NewShixunModelType}
visible={this.props.type==='shixuns'?this.props.NewShixunModelType:this.props.shixunpath}
height={'100%'}
>
<Spin spinning={this.state.isspinning}>
@ -380,7 +462,7 @@ class NewShixunModel extends Component{
<Search
style={{ width: "780px"}}
className="packinput"
placeholder="实训信息 / 院校名称 / 创建者"
placeholder={this.props.type==='shixuns'?"实训信息 / 院校名称 / 创建者":"课程名称 / 院校名称 / 创建者"}
value={this.state.keyword}
enterButton={<span>搜索</span>}
onInput={(e)=>this.setdatafunsval(e)}
@ -391,34 +473,50 @@ class NewShixunModel extends Component{
<div className="font-12 ml5 fl">
<span className="fl color-grey-9 mr20">已选 <span className={"color-blue"}>{Grouplist.length}</span> </span>
<span className="fl color-grey-9 mr20"> <span className={"color-blue"}>{shixuns_count===undefined?"":shixuns_count}</span> </span>
<span className="fl color-grey-9 mr20">已选 <span className={"color-blue"}>{Grouplist.length}</span> {this.props.type==='shixuns'?'':''}</span>
<span className="fl color-grey-9 mr20"> <span className={"color-blue"}>{shixuns_count===undefined?"":shixuns_count}</span> {this.props.type==='shixuns'?'':''}</span>
<span className="fl color-grey-9 pointer mr30">
{this.props.type==='shixuns'?"":<span className="fl color-grey-9 pointer mr30">
<a className={" color-grey-6"} onClick={()=>this.updatepathlist("shixuns_count",order)}>实训数</a>
<sapn className="relativef ml5 " >
<i className={order==="asc"&&sort==="shixuns_count"?"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9"}></i>
<i className={order==="desc"&&sort==="shixuns_count"?"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9"}></i>
</sapn>
</span>}
{this.props.type==='shixuns'?"":<span className="fl color-grey-9 pointer mr30">
<a className={" color-grey-6"} onClick={()=>this.updatepathlist("myshixuns_count",order)}>使用人数</a>
<sapn className="relativef ml5 " >
<i className={order==="asc"&&sort==="myshixuns_count"?"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9"}></i>
<i className={order==="desc"&&sort==="myshixuns_count"?"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9"}></i>
</sapn>
</span>}
{this.props.type==='shixuns'?<span className="fl color-grey-9 pointer mr30">
<a className={" color-grey-6"} onClick={()=>this.updatedlist(order)}>学习人数</a>
<sapn className="relativef ml5 " >
<i className={order==="asc"?"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9"}></i>
<i className={order==="desc"?"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9"}></i>
</sapn>
</span>
</span>:""}
{this.props.statustype===undefined?<Dropdown overlay={statusmenus}>
{this.props.type==='shixuns'?this.props.statustype===undefined?<Dropdown overlay={statusmenus}>
<a className="ant-dropdown-link color-grey-6 mr20">
{status==='all'?"发布状态":status==='published'?"已发布":status==="unpublished"?"未发布":""}<Icon type="down" className={"color-grey-6"}/>
</a>
</Dropdown>:""}
</Dropdown>:"":""}
<Dropdown overlay={menus}>
{this.props.type==='shixuns'? <Dropdown overlay={menus}>
<a className="ant-dropdown-link color-grey-6">
{diff===0?"难度":diff===1?"初级":diff===2?"中级":diff===3?"高级":diff===4?"顶级":""}<Icon type="down" className={"color-grey-6"}/>
</a>
</Dropdown>
</Dropdown>:""}
</div>
<div className="font-12 alltopiscright ml25 fr">
{/*<span className={"fr pointer color-grey-3"} onClick={()=>this.props.hideNewShixunModelType()}>返回</span>*/}
<span className={type==="mine"?"fr topcsactive pointer color-grey-3 color-blue":"fr pointer color-grey-3"} onClick={()=>this.belongto("mine")}>我的实训</span>
<span className={type==="all"?"fr mr30 topcsactive pointer color-grey-3 color-blue":"fr mr30 pointer color-grey-3"} onClick={()=>this.belongto("all")}>全部实训</span>
<span className={type==="mine"?"fr topcsactive pointer color-grey-3 color-blue":"fr pointer color-grey-3"} onClick={()=>this.belongto("mine")}>我的{this.props.type==='shixuns'?'实训':"课程"}</span>
<span className={type==="all"?"fr mr30 topcsactive pointer color-grey-3 color-blue":"fr mr30 pointer color-grey-3"} onClick={()=>this.belongto("all")}>全部{this.props.type==='shixuns'?'实训':"课程"}</span>
</div>
</div>
@ -461,7 +559,7 @@ class NewShixunModel extends Component{
{JSON.stringify(item.description) == "{}"?"":<div className="newshixunmodelmidfont newradioStyles" dangerouslySetInnerHTML={{__html: item.description}}>
</div>}
{item.challenge_names.length===0?"":<div className="newshixunmodelbotfont">
{item.challenge_names===undefined?"":item.challenge_names.length===0?"":<div className="newshixunmodelbotfont">
{item.challenge_names.map((item,key)=>{
return(
<span>{key+1}{item}</span>
@ -498,7 +596,7 @@ class NewShixunModel extends Component{
</Breadcrumb>
</div>
{item.subjects.length===0?"":<Dropdown overlay={()=>this.ItsCourse(item.subjects)}>
{item.subjects===undefined?"":item.subjects.length===0?"":<Dropdown overlay={()=>this.ItsCourse(item.subjects)}>
<a className="ant-dropdown-link fl ml30 newshixunfont12 color-blue" >
所属课程<Icon className={"color-blue"} type="down" />
</a>

@ -51,6 +51,26 @@ class ExerciseListItem extends Component{
Loadtype:false
})
}
toDetailPage=(url)=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
// if(this.props.checkIfProfileCompleted()===false){
// this.setState({
// AccountProfiletype:true
// })
// return
// }
// if(this.props.checkIfProfessionalCertification()===false){
// this.props.showProfileCompleteDialog()
// return
// }
this.props.history.push(url);
}
render(){
let{item,checkBox,index}=this.props;
let {coursesId,Id}=this.props.match.params
@ -96,20 +116,20 @@ class ExerciseListItem extends Component{
{/*<Link to={`/courses/${coursesId}/exercises/${item.id}/exercises/student_exercise_list?tab=0`} className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px"}}>{item.exercise_name}</Link>*/}
{
this.props.isAdmin()? <Link className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580"
this.props.isAdmin()? <a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580 pointer"
title={item.exercise_name}
to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</Link>:""
onClick={()=>this.toDetailPage(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>{item.exercise_name}</a>:""
}
{
this.props.isStudent()?
<Link className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name} to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</Link>:""
<a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580 pointer" title={item.exercise_name} onClick={()=>this.toDetailPage(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>{item.exercise_name}</a>:""
}
{
this.props.isNotMember()? item.lock_status === 0 ?
<span className="fl mt3 font-16 font-bd color-dark comnonwidth580" title={item.exercise_name}>{item.exercise_name}</span>
: <Link className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name} to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</Link>:""
<span className="fl mt3 font-16 font-bd color-dark comnonwidth580 pointer" title={"私有属性,非课堂成员不能访问"}>{item.exercise_name}</span>
: <a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580 pointer" title={item.exercise_name} onClick={()=>this.toDetailPage(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>{item.exercise_name}</a>:""
}
{
@ -150,13 +170,13 @@ class ExerciseListItem extends Component{
{
item.exercise_status ===2?
<Tooltip title="提交剩余时间" placement="bottom">
<span className="mr20 fl">{item.exercise_left_time}</span>
<span className="mr20 fl">{"提交剩余时间:"+item.exercise_left_time}</span>
</Tooltip>:""
}
{
item.exercise_status ===3?
item.exercise_left_time===null?"":item.exercise_status ===3?
<Tooltip title="截止剩余时间" placement="bottom">
<span className="mr20 fl">{item.exercise_left_time}</span>
<span className="mr20 fl">{"截止剩余时间:"+item.exercise_left_time}</span>
</Tooltip>:""
}
{/*{*/}

@ -1278,20 +1278,6 @@ class Studentshavecompletedthelist extends Component {
}catch (e) {
}
try {
if(this.props.Commonheadofthetestpaper.exercise_status !== undefined){
this.setState({
exercise_status:this.props.Commonheadofthetestpaper.exercise_status,
})
}else{
this.setState({
exercise_status:0,
})
}
}catch (e) {
}
}
componentWillReceiveProps = (nextProps) => {
@ -1330,7 +1316,7 @@ class Studentshavecompletedthelist extends Component {
})
if (response.data.current_answer_user === undefined || response.data.current_answer_user === null) {
// 学生未截止
// console.log("试卷学生未截止");
this.Generatenewdatas(response.data.exercise_users);
if (response.data.exercise_types.subjective === 0) {
if (this.state.noclassroom === undefined || this.state.noclassroom === "" || this.state.noclassroom === null) {
@ -1377,6 +1363,7 @@ class Studentshavecompletedthelist extends Component {
}
} else {
//学生已截止
// console.log("试卷学生已截止");
if (response.data.exercise_types.subjective === 0) {
if (this.state.loadingstate === false) {
var arr =[];
@ -1458,7 +1445,7 @@ class Studentshavecompletedthelist extends Component {
else if (response.data.exercise_types.user_permission === 0) {
// console.log(response.data.exercise_users)
// console.log(response)
// console.log("试卷老师加载中");
if (thiss.state.loadingstate === false) {
thiss.setState({
loadingstate: true,
@ -1469,7 +1456,9 @@ class Studentshavecompletedthelist extends Component {
thiss.Generatenewdatasy(response.data.exercise_users, response);
}
}).catch((error) => {
console.log(error)
console.log(error);
console.log("其实数据加载失败了");
console.log("1111");
});
@ -2490,16 +2479,22 @@ class Studentshavecompletedthelist extends Component {
let {data, datas, page, columns, course_groupyslsthree, columnstwo, styletable,exercise_status, course_groupyslstwodatas, limit, course_groupysls, course_groupyslstwodata, course_groupyslstwo, teacherlists, Teacherliststudentlist, order, columnss, course_groupsdatas, course_groups, Evaluationarray, unlimited, unlimiteds, unlimitedtwo, teacherlist, searchtext, loadingstate, review, nocomment, commented, unsubmitted, submitted, columnsys, exercise_users,mylistansum} = this.state;
// console.log("Studentshavecompletedthelist");
// console.log(this.props.current_status);
// console.log("获取到的数据");
// console.log(datas);
// console.log(data);
// console.log("this.props.Commonheadofthetestpaper.exercise_status");
// console.log(this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status);
// console.log(exercise_status);
return (
isAdmin === true ?
(
<div style={{
"margin": "0 auto",
" min-width": " 1200px",
minWidth: " 1200px",
}}>
{/*老师*/}
{
exercise_status===0 || exercise_status===1 ?
this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status===0 || this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status===1 ?
<div className="edu-back-white">
<NoneData></NoneData>
</div>
@ -2598,9 +2593,9 @@ class Studentshavecompletedthelist extends Component {
{course_groups === undefined ? "" : course_groups === null ? "" : course_groups.length < 2 ? "" : JSON.stringify(course_groups) === "[]" ? "" :
<li className="clearfix mt10">
<tr>
<td className="w80" style={{"vertical-align": "top"}}><span
<td className="w80" style={{verticalAlign: "top"}}><span
className=" mr10 color-grey-8 ">分班情况</span></td>
<td className="w70" style={{"vertical-align": "top"}}><span><a
<td className="w70" style={{verticalAlign: "top"}}><span><a
id="graduation_comment_no_limit"
className={unlimitedtwo === 0 ? "pl10 pr10 mr20 check_on" : "pl10 pr10 mr20 "}
onClick={() => this.funtaskstatustwos()}>不限</a></span>
@ -2714,9 +2709,9 @@ class Studentshavecompletedthelist extends Component {
Teacherliststudentlist === undefined || Teacherliststudentlist.current_answer_user === undefined || Teacherliststudentlist.current_answer_user === null ?
<div>
<div className=" clearfix "
style={{"margin": "0 auto", "padding-bottom": "100px", " min-width": " 1200px"}}>
style={{"margin": "0 auto", "padding-bottom": "100px", minWidth: " 1200px"}}>
{
exercise_status === 0 || exercise_status === 1 ?
this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status === 0 || this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status === 1 ?
<div className="edu-back-white">
<NoneData></NoneData>
</div>
@ -2794,10 +2789,10 @@ class Studentshavecompletedthelist extends Component {
<div className="clearfix" style={{
"margin": "0 auto",
"padding-bottom": "100px",
" min-width": " 1200px"
minWidth: " 1200px"
}}>
{
exercise_status === 0 || exercise_status === 1 ?
this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status === 0 || this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status === 1 ?
<div className="edu-back-white">
<NoneData></NoneData>
</div>

@ -436,22 +436,22 @@ class Testpapersettinghomepage extends Component{
/>
{
// 教师列表
parseInt(tab[0])==0 && <Studentshavecompletedthelist {...this.props} {...this.state} triggerRef={this.bindRef} setcourse_groupysls={(value)=>this.setcourse_groupysls(value)} current_status = {this.state.current_status} Commonheadofthetestpaper={this.state.Commonheadofthetestpaper}></Studentshavecompletedthelist>
parseInt(tab[0])==0 ? <Studentshavecompletedthelist {...this.props} {...this.state} triggerRef={this.bindRef} setcourse_groupysls={(value)=>this.setcourse_groupysls(value)} current_status = {this.state.current_status} Commonheadofthetestpaper={this.state.Commonheadofthetestpaper}></Studentshavecompletedthelist>:""
}
{/*统计结果*/}
{
parseInt(tab[0])==1 && <Exercisestatisticalresult {...this.props} {...this.state} triggerRef={this.bindRef}></Exercisestatisticalresult>
parseInt(tab[0])==1 ? <Exercisestatisticalresult {...this.props} {...this.state} triggerRef={this.bindRef}></Exercisestatisticalresult>:""
}
{
parseInt(tab[0])==2 && <ExerciseDisplay {...this.props} {...this.state} triggerRef={this.bindRef}></ExerciseDisplay>
parseInt(tab[0])==2 ? <ExerciseDisplay {...this.props} {...this.state} triggerRef={this.bindRef}></ExerciseDisplay>:""
}
{
parseInt(tab[0])==3 && <WrappedExercisesetting {...this.props} {...this.state} triggerRef={this.bindRef}></WrappedExercisesetting>
parseInt(tab[0])==3 ? <WrappedExercisesetting {...this.props} {...this.state} triggerRef={this.bindRef}></WrappedExercisesetting>:""
}
</div>
</div>

@ -133,6 +133,26 @@ class GraduateTaskItem extends Component{
setupdate=()=>{
this.props.funlist
}
toDetailPage=(url)=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
// if(this.props.checkIfProfileCompleted()===false){
// this.setState({
// AccountProfiletype:true
// })
// return
// }
// if(this.props.checkIfProfessionalCertification()===false){
// this.props.showProfileCompleteDialog()
// return
// }
this.props.history.push(url);
}
render(){
let {
Modalstype,
@ -215,20 +235,20 @@ class GraduateTaskItem extends Component{
<h6>
{
this.props.isAdmin?<Link to={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list"}
this.props.isAdmin?<a onClick={()=>this.toDetailPage("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list")}
title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
}
{
this.props.isStudent? <Link to={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list"}
this.props.isStudent? <a onClick={()=>this.toDetailPage("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list")}
title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
}
{
this.props.isNotMember===true?this.props.discussMessage.private_icon===true?
<span className="fl mt3 font-16 font-bd color-dark maxwidth580" title={discussMessage.name}>{discussMessage.name}</span>
:<a href={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/list"}
<span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer" title={"私有属性,非课堂成员不能访问"}>{discussMessage.name}</span>
:<a onClick={()=>this.toDetailPage("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/list")}
title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
}
@ -249,15 +269,15 @@ class GraduateTaskItem extends Component{
</h6>
<div className="cl"></div>
<p className="color-grey panel-lightgrey mt16 fl">
<p className="color-grey mt16 fl">
<span className="mr50">
{/* <a href="/users/innov" className="panel-name-small hide fl mr15 mr30 color-grey3">{discussMessage.author.name}</a> */}
{ discussMessage.author && <span className="mr15 color-grey-3">{discussMessage.author}</span> }
{discussMessage.commit_count===undefined?"":<span className="mr15 color-grey9 font-14">{discussMessage.commit_count} 已交</span>}
{discussMessage.uncommit_count===undefined?"":<span className="mr15 color-grey9 font-14">{discussMessage.uncommit_count} 未交</span>}
{/*<span className="mr15 color-grey9">{discussMessage.replies_count} 3 未评</span>*/}
<Tooltip title={discussMessage.task_status===1?"提交剩余时间":discussMessage.task_status===2?"补交剩余时间":""} placement="bottom">
<span className="mr15 color-grey9 font-14">{discussMessage.status_time}</span>
<Tooltip title={discussMessage.task_status===1?"提交剩余时间":discussMessage.task_status===2?"补交剩余时间":discussMessage.task_status===3?"交叉评阅剩余时间":""} placement="bottom">
<span className="mr15 color-grey9 font-14">{discussMessage.task_status===1&&discussMessage.status_time!=""&&discussMessage.status_time!=null?"提交剩余时间:"+discussMessage.status_time:discussMessage.task_status===2&&discussMessage.status_time!=""&&discussMessage.status_time!=null?"补交剩余时间:"+discussMessage.status_time:discussMessage.task_status===3&&discussMessage.status_time!=""&&discussMessage.status_time!=null?"交叉评阅剩余时间:"+discussMessage.status_time:discussMessage.status_time}</span>
</Tooltip>
{/* { discussMessage.replies_count != 0 && <span className="mr15 color-grey9">{discussMessage.replies_count} </span> }

@ -32,8 +32,10 @@ class GraduationTasksappraise extends Component{
axios.get(zrl).then((result)=>{
if(result.status===200){
let status=result.data.status;
if(status===undefined || status=== 403 || status === 401 || status=== 407 || status=== 408|| status=== 409 || status === 500||status===-1){
if(result.data.status!=-1){
}else{
this.setState({
firelistdata:result.data,
})

@ -209,7 +209,7 @@ class GraduationTasksappraiseMainEditor extends Component{
`}</style>
{this.props.title && <span className="mainEditorTitle color-grey-6">{this.props.title}</span>}
<TPMMDEditor ref={this.mdRef} mdID={'appraiseEditor'} placeholder={placeholder || "请在此输入对本作品的评语最大限制2000个字符"}
watch={false} height={160} className={errorMessage ? 'editorInputError' : ''}></TPMMDEditor>
watch={false} height={160} className={errorMessage ? 'editorInputError' : ''} imageExpand={true}></TPMMDEditor>
{ showSameScore == true && <div>
<Checkbox checked={same_score} onChange={this.same_score_change}>整组同评</Checkbox>
<span className={"font-14 color-grey-9"}>(选中则本次评阅对象指小组全部成员否则仅评阅此成员1人 )</span>

@ -80,6 +80,8 @@ class GraduationTaskssettingapp extends Component{
starttime:undefined,
DownloadType:false,
DownloadMessageval:undefined,
commentstatustype:undefined,
commenttimeone:undefined
}
}
@ -102,10 +104,10 @@ class GraduationTaskssettingapp extends Component{
}
let starttype=false;
let endtype=false;
if(moment(result.data.publish_time)<moment()){
if(moment(result.data.publish_time)<=moment()){
starttype=true
}
if(moment(result.data.end_time)<moment()){
if(moment(result.data.end_time)<=moment()){
endtype=true
}
@ -130,6 +132,7 @@ class GraduationTaskssettingapp extends Component{
taskname: result.data.task_name,
coursename: result.data.course_name,
commentstatus: result.data.comment_status,
commentstatustype:result.data.status,
commentnum: result.data.comment_num,
operworks: result.data.open_work,
opergrade: result.data.open_score,
@ -343,28 +346,33 @@ class GraduationTaskssettingapp extends Component{
let {endtimetype}=this.state;
if(types===1){
this.setState({
latetime:newlatetime,
// latetime:newlatetime,
crosscomment:true,
commenttime:newcommenttime
commenttime:newlatetime,
commenttimeone:newlatetime,
})
}else{
if(endtimetype===true){
this.setState({
crosscomment:true,
commenttime:newcommenttime
commenttime:newlatetime,
commenttimeone:newlatetime,
})
}else{
this.setState({
end_time:newlatetime,
// end_time:newlatetime,
crosscomment:true,
commenttime:newcommenttime
commenttime:newlatetime,
commenttimeone:newlatetime,
})
}
}
}
funcrosscomment=(e)=>{
let {latetime,end_time,allowlate}=this.state;
let {latetime,end_time,allowlate,commenttime,commenttimeone}=this.state;
let commenttimetype=commenttime===null||commenttime==="";
let newlatetimea=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttimea=moment(new Date()).format("YYYY-MM-DD HH:mm");
@ -377,8 +385,8 @@ class GraduationTaskssettingapp extends Component{
let newend_timed=moment(end_time).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttimed=moment(end_time).add(8, 'days').format("YYYY-MM-DD HH:mm");
let newtime;
if(e.target.checked===true){
if(commenttimetype===true){
if(allowlate===1||allowlate===true){
if(latetime===null||latetime===""){
@ -393,6 +401,13 @@ class GraduationTaskssettingapp extends Component{
this.updatesfuncrosscomment(2,newend_timed,newcommenttimed)
}
}
}else{
this.setState({
crosscomment:e.target.checked,
commenttime:commenttimeone,
})
}
}else{
this.setState({
crosscomment:e.target.checked,
@ -519,10 +534,10 @@ class GraduationTaskssettingapp extends Component{
}
if(moment(end_time)<moment(publish_time)){
if(moment(end_time)<=moment(publish_time)){
this.setState({
endTimetypes:true,
endTimetypesval:"截止时间不能早于发布时间"
endTimetypesval:"截止时间必须晚于发布时间"
})
return
}else{
@ -531,16 +546,16 @@ class GraduationTaskssettingapp extends Component{
})
}
if(moment(latetime)<moment(publish_time)){
if(moment(latetime)<=moment(publish_time)){
this.setState({
latetimetype:true,
latetimetypeval:"结束时间不能早于发布时间"
latetimetypeval:"结束时间必须晚于发布时间"
})
return
}else if(moment(latetime)<moment(end_time)){
}else if(moment(latetime)<=moment(end_time)){
this.setState({
latetimetype:true,
latetimetypeval:"结束时间不能早于截止时间"
latetimetypeval:"结束时间必须晚于截止时间"
})
return
}else{
@ -562,7 +577,7 @@ class GraduationTaskssettingapp extends Component{
commenttimetype:false
})
}
if(moment(this.state.commenttime)<moment(publish_time)){
if(moment(this.state.commenttime)<=moment(publish_time)){
this.setState({
commenttimetype:true,
commenttimevalue:"开始时间不能小于发布时间",
@ -574,7 +589,7 @@ class GraduationTaskssettingapp extends Component{
})
}
if(moment(this.state.commenttime)<moment(end_time)){
if(moment(this.state.commenttime)<=moment(end_time)){
this.setState({
commenttimetype:true,
commenttimevalue:"开始时间不能小于截止时间",
@ -918,7 +933,8 @@ class GraduationTaskssettingapp extends Component{
endtimetype,
commenttimetype,
commenttimevalue,
flagPageEdit
flagPageEdit,
commentstatustype
} =this.state;
let courseId=this.props.match.params.coursesId;
@ -1153,9 +1169,11 @@ class GraduationTaskssettingapp extends Component{
<div className="stud-class-set bor-bottom-greyE pd20 edu-back-white pl36">
<div className={" font-16 color-dark h20 mb20"}>评分设置 </div>
<div className={"font-16 h20 mb20"}>最终成绩组成 <span className={"font-14 color-grey-c"}>取各教师最终评分的平均分</span></div>
<Tooltip placement="bottomLeft" title={this.props.isAdmin()===true?flagPageEdit===true?commentstatustype===3?"正在交叉评阅,不可取消":"":"":""}>
<Checkbox className="ml40 font-16" checked={crosscomment} onChange={this.funcrosscomment}
disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true} >启用交叉评阅 <span className={"font-14 color-grey-c"}>给老师分配其他指导老师的学生作品</span>
disabled={this.props.isAdmin()===true?flagPageEdit===true?commentstatustype===3?true:false:true:true} >启用交叉评阅 <span className={"font-14 color-grey-c"}>给老师分配其他指导老师的学生作品</span>
</Checkbox>
</Tooltip>
{crosscomment===true?<div>
<div className={"h20 mb30 ml30 mt20 ml87"}>
<span>开始时间</span>

@ -40,7 +40,7 @@ class GraduationTaskssettinglist extends Component{
task_status:undefined,
cross_comment:null,
search:null,
order:"updated_at",
order:"update_time",
b_order:"desc",
course_group:undefined,
loadingstate:true,
@ -92,6 +92,7 @@ class GraduationTaskssettinglist extends Component{
seacthdata=(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,pages)=>{
let{page,limit}=this.state;
// console.log(teacher_comment,task_status,course_group,cross_comment,order,b_order,search)
let task_Id=this.props.match.params.task_Id;
let url="/graduation_tasks/"+task_Id+"/tasks_list.json";
@ -106,7 +107,7 @@ class GraduationTaskssettinglist extends Component{
order:order===null?undefined:order,
b_order:b_order===null?undefined:b_order,
search:search===null?undefined:search,
page:pages===null?undefined:page,
page:pages,
limit:20,
},
paramsSerializer: function(params) {
@ -281,8 +282,6 @@ class GraduationTaskssettinglist extends Component{
funtaskstatus=(checkedValues,key)=>{
// console.log(checkedValues)
console.log(checkedValues);
let {teacher_comment, course_group, cross_comment, order, b_order, search} = this.state;
@ -599,7 +598,7 @@ class GraduationTaskssettinglist extends Component{
this.cannerassocition();
let {taskslistdata}=this.state;
let url = "/graduation_tasks/"+taskslistdata.task_id+"/graduation_works/cancel_relate_project.json";
console.log(url)
axios.get(url).then((result)=>{
if(result.data.status===0){
@ -655,8 +654,7 @@ class GraduationTaskssettinglist extends Component{
/// 确认是否下载
confirmysl(url){
debugger;
console.log(1);
let {teacher_comment, task_status, course_group, cross_comment, order, b_order, search,page} =this.state;
let params ={
@ -958,7 +956,7 @@ class GraduationTaskssettinglist extends Component{
}
console.log(this.props.questionslist.status)
return(
<React.Fragment>
@ -1217,14 +1215,14 @@ class GraduationTaskssettinglist extends Component{
<div className="clearfix">
{this.props.isAdmin()===true?<span className="fl color-grey-6 font-12">
<span className="color-orange-tip">{taskslistdata&&taskslistdata.work_count}</span>
个检索结果{taskslistdata&&taskslistdata.work_count} 学生</span>:""}
个检索结果{taskslistdata&&taskslistdata.all_work_count} 学生</span>:""}
{this.props.isAdmin()===true?<div className="fr color-grey-6 edu-menu-panel">
<p>
<a data-remote="true" class="color-grey-6 font-12">
{order==="updated_at"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}排序</a>
{order==="update_time"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}排序</a>
<i className="iconfont icon-xiajiantou ml5 font-12 color-grey-6"></i></p>
<ul className="edu-menu-list edu-menu-lists" style={{width: '87px'}}>
<li onClick={(e)=>this.funorder("updated_at")}><a data-remote="true">更新时间</a>
<li onClick={(e)=>this.funorder("update_time")}><a data-remote="true">更新时间</a>
</li>
<li onClick={(e)=>this.funorder("work_score" )}><a data-remote="true">最终成绩</a>
</li>
@ -1415,10 +1413,10 @@ class GraduationTaskssettinglist extends Component{
</span>
<div className="fr color-grey-6 edu-menu-panel">
<p><a data-remote="true">
{order==="updated_at"?"时间":order==="work_score"?"成绩":order==="student_id"?"学号":""}排序</a><i
{order==="update_time"?"时间":order==="work_score"?"成绩":order==="student_id"?"学号":""}排序</a><i
className="iconfont icon-xiajiantou ml5 font-12 color-grey-6"></i></p>
<ul className="edu-menu-list">
<li onClick={(e)=>this.funorder("updated_at")} className={order==="updated_at"?"none":""}><a data-remote="true">时间</a>
<li onClick={(e)=>this.funorder("update_time")} className={order==="update_time"?"none":""}><a data-remote="true">时间</a>
</li>
<li onClick={(e)=>this.funorder("work_score" )} className={order==="work_score"?"none":""}><a data-remote="true">成绩</a>
</li>

@ -107,9 +107,10 @@ class GraduationTasks extends Component{
if (response.data.status == 0) {
// {"status":1,"message":"删除成功"}
this.fetchAll(search,page,order)
this.props.showNotification(response.data.message);
this.setState({
Modalstype:true,
Modalstopval:response.data.message,
// Modalstype:true,
// Modalstopval:response.data.message,
ModalsBottomval:"",
ModalSave:this.cancelmodel,
Loadtype:true,
@ -128,7 +129,7 @@ class GraduationTasks extends Component{
let {checkBoxValues,checkAllValue}=this.state;
if(checkAllValue===false){
if(checkBoxValues.length===0){
if(checkBoxValues.length===0||checkAllValue===undefined){
return true
}
}
@ -611,7 +612,6 @@ class GraduationTasks extends Component{
const category_id=this.props.match.params.Id;
const graduationId=this.props.match.params.graduationId;
// console.log(this.props.isCourseidentity()===isNotMember)
// console.log(category_id)
return(
<React.Fragment>
{/*提示*/}
@ -709,7 +709,7 @@ class GraduationTasks extends Component{
{this.props.isAdmin()?all_count===undefined?'' :all_count===0?"": <div className="mt20 edu-back-white padding20-30">
<div className="clearfix">
<Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues.length} 不支持跨页勾选</Checkbox>
<Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues===undefined?0:checkBoxValues.length} 不支持跨页勾选</Checkbox>
<div className="studentList_operation_ul">
<li className="li_line"><a className="color-grey-9" onClick={this.onDelete}>删除</a></li>
@ -736,13 +736,15 @@ class GraduationTasks extends Component{
border-radius: 2px;
}
`}</style>
<Spin size="large" spinning={this.state.isSpin}> <Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
<Spin size="large" spinning={this.state.isSpin}> <Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues===undefined?[]:checkBoxValues}>
{ tasks&&tasks.map((item, index) => {
// console.log(item)
return (
<div className="mt20 edu-back-white pt10 pl30 pr30" key={index}>
<div className="clearfix">
<GraduateTaskItem
{...this.state}
{...this.props}
discussMessage={item}
isAdmin={this.props.isAdmin()}
isStudent={this.props.isStudent()}

@ -15,6 +15,22 @@ class GraduateTopicItem extends Component{
this.props.history.push(`/courses/${courseId}/graduation_topics/${topicId}/edit`);
}
toDetailPage=(topicId)=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
// if(this.props.checkIfProfileCompleted()===false){
// this.setState({
// AccountProfiletype:true
// })
// return
// }
// if(this.props.checkIfProfessionalCertification()===false){
// this.props.showProfileCompleteDialog()
// return
// }
let courseId=this.props.match.params.coursesId;
this.props.history.push(`/courses/${courseId}/graduation_topics/${topicId}/detail`);
}
@ -67,19 +83,23 @@ class GraduateTopicItem extends Component{
text-overflow:ellipsis;
white-space:nowrap
}
a:hover{
color: #4cacff;
}
`}</style>
<h6>
{
isNotMember?
<a className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
discussMessage.private_icon===true?<span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer" title={ discussMessage.private_icon===true?"私有属性,非课堂成员不能访问":discussMessage.name}>{discussMessage.name}</span>:
<a className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer" title={discussMessage.name}>{discussMessage.name}</a>
:""
}
{
isStudent?<a onClick={() => this.toDetailPage(`${discussMessage.id}`)}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
className="fl mt3 font-16 font-bd color-dark maxwidth580" title={discussMessage.name}>{discussMessage.name}</a>:""
}
{
isAdmin?<a onClick={() => this.toDetailPage(`${discussMessage.id}`)} className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
isAdmin?<a onClick={() => this.toDetailPage(`${discussMessage.id}`)} className="fl mt3 font-16 font-bd color-dark maxwidth580" title={discussMessage.name}>{discussMessage.name}</a>:""
}
{
discussMessage.private_icon===true?

@ -68,7 +68,7 @@ class AddStudentModal extends Component{
if (response.data.course_groups && response.data.course_groups.length) {
this.setState({
course_groups: response.data.course_groups,
courseGroup: response.data.course_groups[0].id
courseGroup: '0' // response.data.course_groups[0].id
})
} else {
// showNotification('')
@ -268,6 +268,7 @@ class AddStudentModal extends Component{
{course_groups && course_groups.length && <div className="df" style={{ marginTop: '12px' }} >
<span className="mr10" style={{ width: '148px' }}>所选学生分班至(选填):</span>
<Select style={{ width: 236 }} onChange={this.handleCourseGroupChange} value={courseGroup}>
<Option value={'0'}>{'未分班'}</Option>
{ course_groups.map((item) => {
return <Option value={item.id}>{item.name}</Option>
})}

@ -270,12 +270,13 @@ class studentsList extends Component{
addStudentSuccessListener=(e, data)=>{
const params = JSON.parse(data)
this.props.updataleftNavfun()
const course_group_id = this.props.match.params.course_group_id
const coursesId = this.props.match.params.coursesId
if (params.course_group_id == course_group_id) {
this.fetchAll(1)
} else {
this.props.history.push(`/courses/${coursesId}/course_groups/${params.course_group_id}`)
this.props.history.push(`/courses/${coursesId}/course_groups/${params.course_group_id || '0'}`)
}
// console.log('addStudentSuccessListener', data)
}
@ -465,6 +466,7 @@ class studentsList extends Component{
}).then((result)=>{
if (result.data.status == 0) {
this.props.showNotification('删除成功')
this.props.updataleftNavfun()
this.fetchAll()
this.setState({checkBoxValues: []})
trigger('updatabanner')

@ -359,6 +359,22 @@ class PollDetailTabForthRules extends Component{
return(
<div className="clearfix mb5" key={r}>
{
flagPageEdit===undefined?"":
flagPageEdit===true?
<style>
{
`
.yskspickersy
.ant-input, .ant-input .ant-input-suffix{
background-color: #fff !important;
}
`
}
</style>
:""
}
<div className="with40 fl pr20 df">
<span className="font-16 pr20 fl mt8">发布规则{r+1}</span>
<div className="flex1">
@ -396,7 +412,7 @@ class PollDetailTabForthRules extends Component{
</p>
</div>
</div>
<div className="fl pr20 with25">
<div className="fl pr20 with25 yskspickersy">
<Tooltip placement="bottom" title={rule.e_timeflag ? "发布时间已过,不能再修改":""}>
<span>
<DatePicker
@ -422,7 +438,7 @@ class PollDetailTabForthRules extends Component{
}
</p>
</div>
<div className="fl mr20">
<div className="fl mr20 yskspickersy">
<Tooltip placement="bottom" title={rule.e_timeflag ? "截止时间已过,不能再修改":""}>
<span>
<DatePicker

@ -1,5 +1,5 @@
import React,{ Component } from "react";
import Tooltip from 'material-ui/Tooltip';
import {Tooltip} from 'antd';
import {Link} from 'react-router-dom';
import moment from 'moment';
import CoursesListType from '../coursesPublic/CoursesListType';
@ -15,6 +15,25 @@ class PollListItem extends Component{
constructor(props){
super(props);
}
toDetailPage=(url)=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
// if(this.props.checkIfProfileCompleted()===false){
// this.setState({
// AccountProfiletype:true
// })
// return
// }
// if(this.props.checkIfProfessionalCertification()===false){
// this.props.showProfileCompleteDialog()
// return
// }
this.props.history.push(url);
}
render(){
let{item,checkBox,courseType,index}=this.props;
let {coursesId}=this.props.match.params;
@ -37,12 +56,14 @@ class PollListItem extends Component{
}
<div className="flex1 pr">
<p className="clearfix mb30">
{ canNotLink ? <a className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px", "cursor": "default"}} title={item.polls_name}>{item.polls_name}</a> :
<Link to={`/courses/${coursesId}/polls/${item.id}/detail`} className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px"}} title={item.polls_name}>{item.polls_name}</Link>
{ canNotLink ?
<span className="fl font-16 font-bd mt2 color-grey-3 task-hide pointer" style={{"maxWidth":"600px"}} title={courseType.user_permission == 0?"私有属性,非课堂成员不能访问":item.polls_name}>{item.polls_name}</span>
:
<a onClick={()=>this.toDetailPage(`/courses/${coursesId}/polls/${item.id}/detail`)} className="fl font-16 font-bd mt2 color-grey-3 task-hide pointer" style={{"maxWidth":"600px"}} title={item.polls_name}>{item.polls_name}</a>
}
{
item.lock_status === 0 ?
<Tooltip title={`${courseType.user_permission == 0 ? "私有属性,非课堂成员不能访问" : "私有属性"}`}>
<Tooltip title={`${courseType.user_permission == 0 ? "私有属性,非课堂成员不能访问" : "私有属性"}`} placement="bottom">
<i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl"></i>
</Tooltip>
:""
@ -73,7 +94,7 @@ class PollListItem extends Component{
{
item.polls_status ==2 && item.publish_time !=null &&
<Tooltip title="提交剩余时间">
<span className="mr20 fl mt3">{formatDuring(t)}</span>
<span className="mr20 fl mt3">{"提交剩余时间:"+formatDuring(t)}</span>
</Tooltip>
}
{

@ -2863,7 +2863,7 @@ class PollNew extends Component {
}
</style>
<Input placeholder="请输入问卷标题最大限制60个字符" maxLength="60"
style={{"margin-top": "15px", "text-align": "left"}}
style={{"margin-top": "15px", textAlign: "left"}}
onInput={this.changeTopicName}
readOnly={readOnlys}
autoComplete="off"
@ -2887,7 +2887,7 @@ class PollNew extends Component {
<div style={{"color": "#212121", "font-size": "16px"}}>问卷须知</div>
<TextArea placeholder="请输入本次问卷答题的相关说明最大限制100个字符"
style={{"height": "120px", "margin-top": "15px", "text-align": "left"}}
style={{"height": "120px", "margin-top": "15px", textAlign: "left"}}
maxLength="100"
readOnly={readOnlys}
onInput={this.changeTopicNametwo}
@ -3012,8 +3012,8 @@ class PollNew extends Component {
{item.question.answers === undefined ? "" : item.question.answers.map((items, i) => {
return (
<div className="h20 pt20" style={{"clear": "both"}}>
<Radio value={i} className={"fl"} style={{"text-align": "left",marginTop:"3px"}}></Radio>
<span className={" flex1 "} style={{"text-align": "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1116px"}} >{items.answer_text}</span>
<Radio value={i} className={"fl"} style={{textAlign: "left",marginTop:"3px"}}></Radio>
<span className={" flex1 "} style={{textAlign: "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1116px"}} >{items.answer_text}</span>
</div>
)
@ -3029,8 +3029,8 @@ class PollNew extends Component {
{item.question.answers === undefined ? "" : item.question.answers.map((items, i) => {
return (
<div className="mt10 pt20 " style={{"clear": "both"}}>
<Checkbox value={i} key={i} className={"fl"} style={{"text-align": "left"}}></Checkbox>
<span className={" flex1"} style={{"text-align": "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1120px"}}>{items.answer_text}</span>
<Checkbox value={i} key={i} className={"fl"} style={{textAlign: "left",marginRight:"8px"}}></Checkbox>
<span className={" flex1"} style={{textAlign: "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1116px"}}>{items.answer_text}</span>
</div>
)
})}
@ -3086,7 +3086,7 @@ class PollNew extends Component {
<p className="df mb20">
<span
className="color-grey-6 mr3 w60 font-16 lineh-40"
style={{"text-align": "center"}}>其它</span>
style={{textAlign: "center"}}>其它</span>
<input
className="mr20 input-flex-40 TextAreainput" disabled
@ -3100,7 +3100,7 @@ class PollNew extends Component {
: ""}
</p>) : (<p className="df mb20">
<span className="color-grey-6 mr10 w60 font-16 lineh-40"
style={{"text-align": "center"}}>选项</span>
style={{textAlign: "center"}}>选项</span>
<TextArea
autosize={{minRows: 1, maxRows: 5}}
@ -3172,7 +3172,7 @@ class PollNew extends Component {
"height": "80%";
"margin-top": "5px";
"margin-left": "5px";
"text-align": "center";
textAlign: "center";
"display": "block";
"opacity": "1";
}
@ -3328,7 +3328,7 @@ class PollNew extends Component {
<p className="df mb20">
<span
className="color-grey-6 mr3 w60 font-16 lineh-40"
style={{"text-align": "center"}}>其它</span>
style={{textAlign: "center"}}>其它</span>
<input
className="mr20 input-flex-40 TextAreainput" disabled
@ -3342,7 +3342,7 @@ class PollNew extends Component {
: ""}
</p>) : (<p className="df mb20">
<span className="color-grey-6 mr10 w60 font-16 lineh-40"
style={{"text-align": "center"}}>选项</span>
style={{textAlign: "center"}}>选项</span>
<TextArea
autosize={{minRows: 1, maxRows: 5}}
@ -3414,7 +3414,7 @@ class PollNew extends Component {
"height": "80%";
"margin-top": "5px";
"margin-left": "5px";
"text-align": "center";
textAlign: "center";
"display": "block";
"opacity": "1";
}
@ -3579,7 +3579,7 @@ class PollNew extends Component {
<p className="df mb20">
<span
className="color-grey-6 mr3 w60 font-16 lineh-40"
style={{"text-align": "center"}}>其它</span>
style={{textAlign: "center"}}>其它</span>
<input
className="mr20 input-flex-40 TextAreainput" disabled
@ -3593,7 +3593,7 @@ class PollNew extends Component {
: ""}
</p>) : (<p className="df mb20">
<span className="color-grey-6 mr10 w60 font-16 lineh-40"
style={{"text-align": "center"}}>选项</span>
style={{textAlign: "center"}}>选项</span>
<TextArea
autosize={{minRows: 1, maxRows: 5}}
@ -3665,7 +3665,7 @@ class PollNew extends Component {
"height": "80%";
"margin-top": "5px";
"margin-left": "5px";
"text-align": "center";
textAlign: "center";
"display": "block";
"opacity": "1";
}

@ -3320,7 +3320,7 @@ class Listofworksstudentone extends Component {
<div className="clearfix">
<span className="fl color-grey-6 font-12"><span
className="color-orange-tip">{teacherdata === undefined ? "" : teacherdata.all_member_count}</span>{teacherdata === undefined ? "" : teacherdata.all_member_count} </span>
className="color-orange-tip">{teacherdata === undefined ? "" : teacherdata.work_count&&teacherdata.work_count}</span>{teacherdata === undefined ? "" : teacherdata.all_member_count&&teacherdata.all_member_count} </span>
<style>
{
`

@ -181,9 +181,7 @@ class ShixunHomeworkPage extends Component {
const isAdmin = this.props.isAdmin();
// console.log(119)
console.log(jobsettingsdatapage);
// console.log(jobsettingsdatapage);
return (
<div className="newMain clearfix ">
<Modals
@ -197,6 +195,8 @@ class ShixunHomeworkPage extends Component {
</Modals>
<div className={"educontent mt10 mb20"} style={{width: "1200px"}}>
<Spin size="large" spinning={this.state.mylistisSpin}>
{
jobsettingsdatapage === undefined?"":
<div className="educontent mb20">
<p className="clearfix mb20 mt10">
<a className="btn colorgrey fl hovercolorblue " href={this.props.current_user&&this.props.current_user.first_category_url}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.course_name}</a>
@ -208,6 +208,8 @@ class ShixunHomeworkPage extends Component {
<WordsBtn className="fl">作业详情</WordsBtn>
</p>
</div>
}
<div className="educontent mb20">
<p className=" fl color-black summaryname" style={{heigth: "33px"}}>
{teacherdatapage === undefined ? "" : teacherdatapage.homework_name}

@ -143,6 +143,27 @@ class ShixunhomeWorkItem extends Component{
ModalsRenametype:false,
})
}
hrefjumpskip=(url)=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
// if(this.props.checkIfProfileCompleted()===false){
// this.setState({
// AccountProfiletype:true
// })
// return
// }
// if(this.props.checkIfProfessionalCertification()===false){
// this.props.showProfileCompleteDialog()
// return
// }
this.props.history.push(url);
}
render(){
let {
Modalstype,
@ -294,23 +315,23 @@ class ShixunhomeWorkItem extends Component{
{/*to={`/courses/${this.props.match.params.coursesId}/${discussMessage.homework_id}/jobsettings`}*/}
{
this.props.isAdmin?<Link to={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list?tab=0"}
this.props.isAdmin?<a onClick={()=>this.hrefjumpskip("/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list?tab=0")}
title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
}
{
this.props.isStudent? <Link to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`}
this.props.isStudent? <a onClick={()=>this.hrefjumpskip(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`)}
title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
}
{
this.props.isNotMember===true? this.props.discussMessage.private_icon===true?
<span className="fl mt3 font-16 font-bd color-dark maxwidth580" title={discussMessage.name}>{discussMessage.name}</span>
: <Link to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`}
<span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer" title={"私有属性,非课堂成员不能访问"}>{discussMessage.name}</span>
: <a onClick={()=>this.hrefjumpskip(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`)}
title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
}
@ -329,7 +350,7 @@ class ShixunhomeWorkItem extends Component{
</h6>
<div className="cl"></div>
<p className="color-grey panel-lightgrey mt16 fl">
<p className="color-grey mt16 fl">
<span className="mr50 df">
{/* <a href="/users/innov" className="panel-name-small hide fl mr15 mr30 color-grey3">{discussMessage.author.name}</a> */}
{ discussMessage.author && <span className="mr15 color-grey-3">{discussMessage.author}</span> }

@ -67,7 +67,7 @@ class Trainingjobsetting extends Component {
//
// });
this.state = {
flagPageEdit: undefined,
flagPageEdit: true,
flagPageEdits: false,
flagPageEditstwo:false,
flagPageEditsthrees:false,
@ -137,7 +137,7 @@ class Trainingjobsetting extends Component {
componentDidMount() {
console.log("Trainingjobsetting");
console.log("componentDidMount");
this.getTrainingjobsetting();
this.getTrainingjobsetting(true);
let query = this.props.location.pathname;
const type = query.split('/');
this.setState({
@ -165,7 +165,7 @@ class Trainingjobsetting extends Component {
// }
// 获取数据地方
getTrainingjobsetting = () => {
getTrainingjobsetting = (bool) => {
// console.log("getTrainingjobsetting")
var homeworkid = this.props.match.params.homeworkid;
// console.log(homeworkid)
@ -241,26 +241,26 @@ class Trainingjobsetting extends Component {
}
}
}
console.log("220");
// console.log("220");
var publish_timebools=false;
if(result.data.publish_time){
publish_timebools= moment(result.data.publish_time,"YYYY-MM-DD HH:mm")<=moment();
}
console.log("228");
console.log(publish_timebools);
// console.log("228");
// console.log(publish_timebools);
var end_timebools =false;
if(result.data.end_time){
end_timebools == moment(result.data.end_time,"YYYY-MM-DD HH:mm")<=moment();
}
console.log("233");
console.log(end_timebools);
// console.log("233");
// console.log(end_timebools);
var late_timess=false;
if(result.data.late_time){
late_timess== moment(result.data.end_time,"YYYY-MM-DD HH:mm")<=moment();
}
console.log("240");
console.log(late_timess);
// console.log("240");
// console.log(late_timess);
this.setState({
@ -293,6 +293,14 @@ class Trainingjobsetting extends Component {
code_review:result.data.code_review
})
this.props.Getdataback(result,result.data);
if(bool===true){
if(this.props.isAdmin() !== undefined){
if(this.props.isAdmin() === true){
this.editSettings(result);
}
}
}
}
})
@ -1592,7 +1600,7 @@ class Trainingjobsetting extends Component {
description:result.data.message
});
this.homeworkhide();
this.getTrainingjobsetting();
this.getTrainingjobsetting(false);
}
}
@ -1623,7 +1631,7 @@ class Trainingjobsetting extends Component {
// message:"提示",
// description:response.data.message
// });
this.getTrainingjobsetting();
this.getTrainingjobsetting(false);
this.homeworkhide()
}
})
@ -1738,7 +1746,6 @@ class Trainingjobsetting extends Component {
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
unifiedsetting:this.state.unifiedsetting,
});
if(this.state.work_efficiencys===true){
@ -1784,8 +1791,130 @@ class Trainingjobsetting extends Component {
} catch (e) {
}
};
//一进来就是老师要用的编辑页面
editSettings=(datas)=>{
console.log("编辑页面");
console.log(datas);
try {
if (datas.data.is_end === true) {
this.setState({
modalsType: true,
modalsTopval: "课堂已结束不能再修改!",
loadtype: true,
modalSave: this.cancelBox
})
} else {
// debugger
var releasetime =true;
var deadline = true;
var endtime =true;
var whethertopays =true;
//发布时间
if(moment(datas.data.publish_time,"YYYY-MM-DD HH:mm")<=moment()){
releasetime=false;
}
//截止时间
if(moment(datas.data.end_time,"YYYY-MM-DD HH:mm")<=moment()){
deadline=false;
}
//结束时间
if(moment(datas.data.late_time,"YYYY-MM-DD HH:mm")<=moment()){
endtime=false;
}
if(datas.data.allow_late === false){
whethertopays=false;
}
try {
if(datas.data&& datas.data.homework_status[0]==="未发布"){
this.setState({
flagPageEditsbox:true,
flagPageEdit: true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
completionefficiencyscore:true,
work_efficiencys:true,
unifiedsetting:datas.data.unified_setting,
latedeductiontwo:20,
});
//均分比例
// result.data.shixun_evaluation === 0 ? "均分比例" : result.data.shixun_evaluation === 1 ? "经验值比例" : result.data.shixun_evaluation === 2 ?
try {
if(datas.data.shixun_evaluation === 0){
this.Equalproportion(20);
}else if(datas.data.shixun_evaluation === 1){
this.Empiricalvalueratio(20);
}
}catch (e) {
console.log(1);
console.log(e);
}
}else {
this.setState({
flagPageEditsbox:true,
flagPageEdit: true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
unifiedsetting:datas.data.unified_setting,
});
if(datas.data.work_efficiency===true){
this.setState({
completionefficiencyscore:true,
})
}else{
this.setState({
completionefficiencyscore:false,
})
}
}
}catch (e) {
console.log(2);
console.log(e);
this.setState({
flagPageEditsbox:true,
flagPageEdit: true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
unifiedsetting:datas.data.unified_setting,
});
if(datas.data.work_efficiency===true){
this.setState({
completionefficiencyscore:true,
})
}else{
this.setState({
completionefficiencyscore:false,
})
}
}
if(datas.data.shixun_evaluation === 2){
this.setState({
boolUnitetwoname:"自定义分值",
boolUnitetwo: false,
flagPageEdits:true,
})
}
}
} catch (e) {
console.log(3);
console.log(e);
}
};
//取消编辑
cancelEdit = () => {
this.setState({
@ -1807,7 +1936,7 @@ class Trainingjobsetting extends Component {
unit_e_tip: "",
})
this.refs.targetElementTrainingjobsetting.scrollIntoView();
this.getTrainingjobsetting();
this.getTrainingjobsetting(false);
}
rulesCheckInfo=(rules)=>{
@ -1919,8 +2048,8 @@ class Trainingjobsetting extends Component {
const dataformat = 'YYYY-MM-DD HH:mm';
let {flagPageEdit,testscripttiptype,publish_timebool,end_timebool,late_timesbool,work_efficiencys,flagPageEdits,flagPageEditstwo,flagPageEditsbox,whethertopay,handclass,flagPageEditsthrees, flagPageEditsfor,rules,rulest,unifiedsetting,group_settings, course_group,unit_e_tip, borreds,borredss,unit_p_tip, end_time, late_time, score_open, publish_time, starttimetype, modalsType, modalsTopval, loadtype, modalSave, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata, endOpen, mystyle, mystyles} = this.state;
console.log(publish_timebool);
console.log(!flagPageEditstwo);
// console.log(publish_timebool);
// console.log(!flagPageEditstwo);
const radioStyle = {
display: 'block',
height: '30px',
@ -1995,7 +2124,24 @@ class Trainingjobsetting extends Component {
loadtype={loadtype}
modalSave={modalSave}
></Modals>
<div className={"educontent"}>
{
!flagPageEdit && this.props.isAdmin() === true ?
""
:
<style>
{
`
.yskspickers
.ant-input, .ant-input .ant-input-suffix{
background-color: #fff !important;
}
`
}
</style>
}
<div className="edu-back-white" style={{paddingTop: "20px"}}>
{/*发布设置*/}
<div className="stud-class-set bor-bottom-greyE edu-back-white">
@ -2033,7 +2179,7 @@ class Trainingjobsetting extends Component {
<div className="clearfix mb5 ml15">
<span className="font-16 fl mt3" style={{"color":"#999999"}}>发布时间</span>
<Tooltip placement="bottom" title={this.props.isSuperAdmin() ? "" : !flagPageEditstwo === true && publish_timebool === true?"发布时间已过,则不能修改": ""}>
<div className="fl">
<div className="fl yskspickers">
<DatePicker
showToday={false}
id={"publishtimeid"}
@ -2066,7 +2212,7 @@ class Trainingjobsetting extends Component {
<div className="clearfix ml15 mb5">
<span className=" fl mt3 font-16" style={{"color":"#999999"}}>截止时间</span>
<Tooltip placement="bottom" title={this.props.isSuperAdmin() ? "" : !flagPageEditsthrees === true&&end_timebool===true?"截止时间已过,则不能修改": ""}>
<div className="fl">
<div className="fl yskspickers">
<DatePicker
showToday={false}
id={"end_timeid"}
@ -2139,7 +2285,7 @@ class Trainingjobsetting extends Component {
`
}
</style>
<InputNumber disabled={!flagPageEditsfor || !whethertopay} min={0} max={1000} className="mr10 h40 color-grey-9"
<InputNumber disabled={!whethertopay} min={0} max={1000} className="mr10 h40 color-grey-9"
onChange={this.changeTopicName}
style={{"color":"#999999","height": "40px"}}
value={this.state.latededuction}/>
@ -2147,8 +2293,21 @@ class Trainingjobsetting extends Component {
<span className="ml15 color-grey-c" style={{"text-align":"left","font-size":"14px"}}>(延时提交作品时学生成绩将被扣减的分值)</span>
{/*{latepenaltytype===true?<div className={"color-red ml40"}></div>:""}*/}
</div>
<div className={"h20 mb20 "}>
{
whethertopay&& whethertopay === true ?
<style>
{
`
.yskspickerss
.ant-input, .ant-input .ant-input-suffix{
background-color: #fff !important;
}
`
}
</style>
:""
}
<div className={"h20 mb20 yskspickerss"}>
<span style={{"width": "100px","color":"#999999"}}>结束时间</span>
<DatePicker
showToday={false}
@ -2164,7 +2323,7 @@ class Trainingjobsetting extends Component {
onOk={this.ontimeonokthree}
showTime={{ format: 'HH:mm' }}
width={"210px"}
disabled={!flagPageEditsfor || !whethertopay}
disabled={ !whethertopay}
dropdownClassName="hideDisable"
className={handclass}
/>
@ -2281,7 +2440,7 @@ class Trainingjobsetting extends Component {
</span>
</div>
<p className="ml20 mt15 c_grey font-13 " style={{"color":"#666666"}}> 关卡名称<span
className="color-grey-c font-10 ml10">(需要学生完成的任务请选中)</span></p>
className="color-grey-c font-12 ml10">(需要学生完成的任务请选中)</span></p>
<div className="ml40 mt15" >
{this.state.challenge_settings === undefined ? "" : this.state.challenge_settings.map((object, index) => {
return (
@ -2311,7 +2470,7 @@ class Trainingjobsetting extends Component {
<RadioGroup className="ml40 mt20" onChange={this.onChangeslevel} value={this.state.level}>
<Radio style={radioStyle} disabled={!flagPageEdit} className="c_grey" value={"扣分"}>按查看答案级别扣分<span
className="color-grey-c font-14 ml15" style={{"text-align":"left"}}>根据学员选择查看的实训答案级别(解题思路完整答案)扣减相应的分值</span></Radio>
className="color-grey-c font-14 ml15" style={{"text-align":"left"}}>(根据学员选择查看的实训答案级别(解题思路完整答案)扣减相应的分值)</span></Radio>
<Radio style={radioStyle} disabled={!flagPageEdit} className="c_grey mt15"
value={"满分"}>不扣分 </Radio>
</RadioGroup>

@ -84,7 +84,8 @@ class ShixunHomework extends Component{
}
componentDidMount() {
this.setState({
isSpin:true
isSpin:true,
})
if(this.props.match.params.main_id){
this.setState({
@ -108,7 +109,8 @@ class ShixunHomework extends Component{
}
seactall=(id)=>{
this.setState({
isSpin:true
isSpin:true,
checkBoxValues:[]
})
let coursesId=this.props.match.params.coursesId;
let url="/courses/"+coursesId+"/homework_commons.json?type=4";
@ -906,7 +908,8 @@ class ShixunHomework extends Component{
}
hideNewShixunModelType=()=>{
this.setState({
NewShixunModelType:false
NewShixunModelType:false,
shixunpath:false
})
}
render(){
@ -969,6 +972,20 @@ class ShixunHomework extends Component{
statustype={'published'}
/>:""}
{/*新版实训model*/}
{shixunpath===true?<NewShixunModel
{...this.props}
{...this.state}
category_id={this.props.match.params.category_id}
type={'path'}
hideNewShixunModelType={()=>this.hideNewShixunModelType()}
coursesId={this.props.match.params.coursesId}
homeworkupdatalists={(Coursename,page,order)=>this.homeworkupdatalist(Coursename,page,order)}
Coursename={Coursename}
page={page}
order={order}
/>:""}
{/*提示*/}
{Modalstype&&Modalstype===true?<Modals
@ -1003,23 +1020,6 @@ class ShixunHomework extends Component{
getcourse_groupslist={(id)=>this.getcourse_groupslist(id)}
/>:""}
{/*/!*选择实训*!/*/}
{/*{shixunmodal===true?<ShixunModal*/}
{/*{...this.props}*/}
{/*{...this.state}*/}
{/*datas={datas}*/}
{/*category_id={this.props.match.params.category_id}*/}
{/*visible={shixunmodal}*/}
{/*shixunmodallist={shixunmodallist}*/}
{/*homeworkupdatalists={(Coursename,page,order)=>this.homeworkupdatalist(Coursename,page,order)}*/}
{/*hometypepvisible={hometypepvisible}*/}
{/*hidecouseShixunModal={this.hidecouseShixunModal}*/}
{/*newshixunmodallist={newshixunmodallist}*/}
{/*coursesId={this.props.match.params.coursesId}*/}
{/*courseshomeworkstart={(category_id,homework_ids)=>this.newhomeworkstart(category_id,homework_ids)}*/}
{/*funpatheditarry={(patheditarry)=>this.funpatheditarry(patheditarry)}*/}
{/*patheditarry={patheditarry}*/}
{/*/>:""}*/}
{shixunmodal===true||shixunpath===true?<style>
{
@ -1030,25 +1030,7 @@ class ShixunHomework extends Component{
`
}
</style>:""}
{/*选择实训路径*/}
{shixunpath===true? <PathModal
{...this.props}
{...this.state}
datas={datas}
visible={shixunpath}
shixunmodallist={this.state.shixunpathlist}
newshixunmodallist={this.state.newshixunpathlist}
// funshixunpathlist={(search,type,loading,page)=>this.funshixunpathlist(search,type,loading,page)}
hometypepvisible={hometypepvisible}
hidecouseShixunModal={this.hidecouseShixunModal}
coursesId={this.props.match.params.coursesId}
homeworkupdatalists={(Coursename,page,order)=>this.homeworkupdatalist(Coursename,page,order)}
courseshomeworkstart={(category_id,homework_ids)=>this.newhomeworkstart(category_id,homework_ids)}
Coursename={Coursename}
page={page}
order={order}
// courseshomeworkstart={(category_id,homework_ids)=>this.newhomeworkstart(category_id,homework_ids)}
/>:""}
{/*添加目录/选择目录*/}
@ -1080,7 +1062,7 @@ class ShixunHomework extends Component{
</span>:
<WordsBtn style="blue" onClick={()=>this.editDir(datas&&datas.category_name)} className={"mr30 font-16"}>目录重命名</WordsBtn>:""}
{this.props.isAdmin()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?<WordsBtn style="blue" className="mr30 font-16" onClick={this.createCommonpath}>选用实践课程</WordsBtn>:"":""}
{this.props.isAdmin()===true?<a className={"btn colorblue font-16"} onClick={()=>this.showNewShixunModelType()}>选用实训</a>:""}
{this.props.isAdmin()===true?<a className={"btn colorblue font-16"} onClick={()=>this.showNewShixunModelType()}>选用实训项目</a>:""}
</li>
</p>

@ -398,9 +398,13 @@ class LoginDialog extends Component {
});
}
handleDialogClose = () => {
if(this.props.match===undefined){
if(this.props.isloginCancel===undefined){
window.location.href="/";
this.props.Modifyloginvalue();
// this.setState({
// isRender: false
// })
// this.props.Modifyloginvalue();
}else{
this.setState({
isRender: false

@ -6,6 +6,7 @@ import {
import axios from 'axios';
import {getImageUrl, markdownToHTML} from 'educoder';
import "../css/messagemy.css"
//消息页面
class MessagSub extends Component {
constructor(props) {
@ -19,6 +20,7 @@ class MessagSub extends Component{
data: undefined,
}
}
// 初始化数据
componentDidMount() {
// console.log("初始化数据了MessagSub");
@ -48,11 +50,13 @@ class MessagSub extends Component{
})
let {limit} = this.state;
let url = `/users/tidings.json`;
axios.get((url),{params:{
axios.get((url), {
params: {
type: types,
page: page,
per_page: limit,
}}).then((result) => {
}
}).then((result) => {
if (result) {
// if (result.data.status === 0) {
@ -78,11 +82,13 @@ class MessagSub extends Component{
})
let {typeysl, page, limit} = this.state;
let url = `/users/tidings.json`;
axios.get((url),{params:{
axios.get((url), {
params: {
type: typeysl,
page: page,
per_page: limit,
}}).then((result) => {
}
}).then((result) => {
if (result) {
// if (result.data.status === 0) {
@ -481,11 +487,17 @@ class MessagSub extends Component{
return window.open(`/courses/${item.container_id}/informs`);
case "SubjectStartCourse":
return window.open(`/paths/${item.container_id}`);
case "ResubmitStudentWork":
return window.open(`/courses/${item.belong_container_id}/graduation_tasks/${item.container_id}/appraise`);
case "AdjustScore":
//belong_container_id course的id
return window.open(`/courses/${item.belong_container_id}/graduation_tasks/${item.parent_container_id}`);
default :
return window.open("/")
}
}
render() {
let {page, limit, typeysl, count, isSpin, data} = this.state;
// console.log("6868686868");
@ -496,19 +508,23 @@ class MessagSub extends Component{
<ul className="pl10 ridingNav clearfix edu-back-white">
<li className={typeysl === "" ? "active" : ""}><a onClick={(s, i) => this.getdata("", 1)}>全部</a></li>
<li className={typeysl&&typeysl==="course"?"active":""} ><a onClick={(s,i)=>this.getdata("course",1)}>课堂提醒</a></li>
<li className={typeysl&&typeysl==="project"?"active":""} ><a onClick={(s,i)=>this.getdata("project",1)}>项目提醒</a></li>
<li className={typeysl && typeysl === "course" ? "active" : ""}><a
onClick={(s, i) => this.getdata("course", 1)}>课堂提醒</a></li>
<li className={typeysl&&typeysl==="project_package"?"active":""}><a onClick={(s,i)=>this.getdata("project_package",1)}>众包提醒</a></li>
<li className={typeysl && typeysl === "project" ? "active" : ""}><a
onClick={(s, i) => this.getdata("project", 1)}>项目提醒</a></li>
<li className={typeysl&&typeysl==="interaction"?"active":""}><a onClick={(s,i)=>this.getdata("interaction",1)}>互动提醒</a></li>
{/*<li className={typeysl && typeysl === "project_package" ? "active" : ""}><a*/}
{/*onClick={(s, i) => this.getdata("project_package", 1)}>众包提醒</a></li>*/}
<li className={typeysl&&typeysl==="apply"?"active":""}><a onClick={(s,i)=>this.getdata("apply",1)}>审核</a></li>
<li className={typeysl&&typeysl==="notice"?"active":""}><a onClick={(s,i)=>this.getdata("notice",1)}>通知</a></li>
<li className={typeysl && typeysl === "interaction" ? "active" : ""}><a
onClick={(s, i) => this.getdata("interaction", 1)}>互动提醒</a></li>
<li className={typeysl && typeysl === "apply" ? "active" : ""}><a
onClick={(s, i) => this.getdata("apply", 1)}>审核</a></li>
<li className={typeysl && typeysl === "notice" ? "active" : ""}><a
onClick={(s, i) => this.getdata("notice", 1)}>通知</a></li>
</ul>
@ -562,11 +578,16 @@ class MessagSub extends Component{
return (
<div className="pl25 ridinglist edu-back-white" key={key}>
<div className={boolps===true?"ridinglist-sub clearfix df tiding_item":"ridinglist-subs clearfix df tiding_item"} onClick={()=>this.gettourl(item)}>
<img onMouseDown={()=>this.myCome(item)} src={getImageUrl("images/"+item.trigger_user.image_url)} className="radius mr10 fl myimgw48 myimgh48"/>
<div
className={boolps === true ? "ridinglist-sub clearfix df tiding_item" : "ridinglist-subs clearfix df tiding_item"}
onClick={() => this.gettourl(item)}>
<img onMouseDown={() => this.myCome(item)}
src={getImageUrl("images/" + item.trigger_user.image_url)}
className="radius mr10 fl myimgw48 myimgh48"/>
<div className="fl flex1">
<p>
<a className="mr20 private_message_a" onMouseDown={()=>this.myCome(item)}>{item.trigger_user.name}</a>
<a className="mr20 private_message_a"
onMouseDown={() => this.myCome(item)}>{item.trigger_user.name}</a>
<span className="color-grey-c">{item.time}</span>
{item.tiding_type === "Apply" ? (
item.status === 0 ?
@ -586,7 +607,8 @@ class MessagSub extends Component{
`
}
</style>
<p className="color-grey-6 yslspansk markdown-body mt10" style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML(item.content).replace(/▁/g, "▁▁▁")}} ></p>
<p className="color-grey-6 yslspansk markdown-body mt10" style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML(item.content).replace(/▁/g, "▁▁▁")}}></p>
</div>
<span className={item.new_tiding === true ? "new-point fr mr40 mt22" : ""}></span>
@ -618,4 +640,5 @@ class MessagSub extends Component{
)
}
}
export default MessagSub;

@ -41,7 +41,8 @@ class CaseNew extends Component{
loading: false,
checkTag:false,
checkFile:false,
coverID:undefined
coverID:undefined,
library_tags:undefined
}
}
@ -132,6 +133,17 @@ class CaseNew extends Component{
if(this.props.match.params.caseID){
this.InitEditData();
}
let url=`/library_tags.json`;
axios.get(url).then((result) => {
console.log(result)
if(result.data.status===0){
this.setState({
library_tags:result.data.library_tags
})
}
}).catch((error) => {
console.log(error);
})
}
componentDidUpdate=(prevState)=>{
@ -263,7 +275,7 @@ class CaseNew extends Component{
render(){
let { caseID } = this.props.match.params;
let { CaseDetail } = this.props;
let { casesTags , contentFileList , imageUrl , checkTag , checkFile } = this.state;
let { casesTags , contentFileList , imageUrl , checkTag , checkFile,library_tags } = this.state;
const {getFieldDecorator} = this.props.form;
@ -301,8 +313,8 @@ class CaseNew extends Component{
action:`${getUploadActionUrl()}`,
onChange:this.handleChange,
}
console.log('111');
console.log(!caseID || (CaseDetail && CaseDetail.status == "pending"));
// console.log('111');
// console.log(!caseID || (CaseDetail && CaseDetail.status == "pending"));
return(
<div className="educontent mt10 mb50">
<style>
@ -380,9 +392,11 @@ class CaseNew extends Component{
<div className={checkTag==true ? "clearfix mb20 pr has-error" : "clearfix mb20"} id="tagFormItem">
<span className="upload_Title must">标签</span>
<ul className="fl libraries_tab">
<li className={ casesTags.indexOf(1) > -1 ? "active" :"" } onClick={()=>this.changeType(1)}>获奖案例</li>
<li className={ casesTags.indexOf(2) > -1 ? "active" :"" } onClick={()=>this.changeType(2)}>入库案例</li>
<li className={ casesTags.indexOf(3) > -1 ? "active" :"" } onClick={()=>this.changeType(3)}>企业案例</li>
{library_tags&&library_tags.map((item,key)=>{
return(
<li key={key} className={ casesTags.indexOf(item.id) > -1 ? "active" :"" } onClick={()=>this.changeType(item.id)}>{item.name}</li>
)
})}
</ul>
{
checkTag && <div class="ant-form-explain">请选择标签</div>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save