solve merge confict

dev_jupyter
daiao 5 years ago
commit 984281bc0f

@ -23,7 +23,9 @@ class ApplicationController < ActionController::Base
# 所有请求必须合法签名
def check_sign
if !Rails.env.development?
Rails.logger.info("#####################request: #{request.headers}")
#Rails.logger.info("#####################type: #{request.type}")
if !Rails.env.development? && EduSetting.get("host_name") != "https://test-newweb.educoder.net"
Rails.logger.info("66666 #{params}")
# suffix = request.url.split(".").last.split("?").first
# suffix_arr = ["xls", "xlsx", "pdf", "zip"] # excel文件先注释

@ -21,7 +21,7 @@ class CourseSecondCategoriesController < ApplicationController
else
@course_module.course_second_categories.where("position > #{@category.position} and position <= ?", params[:position]).update_all("position = position - 1")
end
@category.update_attributes(position: params[:position])
@category.update!(position: params[:position])
normal_status(0, "移动成功")
else
normal_status(-1, "位置没有变化")

@ -292,8 +292,8 @@ class CoursesController < ApplicationController
if next_inform.blank?
render_error('已经到达最顶部')
else
inform.update_attribute(:position, (inform.position + 1))
next_inform.update_attribute(:position, inform.position - 1)
inform.update!(position: (inform.position + 1))
next_inform.update!(position: inform.position - 1)
render_ok
end
end
@ -306,8 +306,8 @@ class CoursesController < ApplicationController
if last_inform.blank?
render_error('已经到达最底部')
else
inform.update_attribute(:position, (inform.position - 1))
last_inform.update_attribute(:position, inform.position + 1)
inform.update!(position: (inform.position - 1))
last_inform.update!(position: inform.position + 1)
render_ok
end
end
@ -353,7 +353,7 @@ class CoursesController < ApplicationController
# 邀请码停用/启用
def set_invite_code_halt
begin
@course.update_attribute('invite_code_halt', @course.invite_code_halt == 0 ? 1 : 0)
@course.update!(invite_code_halt: @course.invite_code_halt == 0 ? 1 : 0)
normal_status(0, "成功")
rescue => e
uid_logger_error(e.message)
@ -364,7 +364,7 @@ class CoursesController < ApplicationController
# 设置课堂私有/公有
def set_public_or_private
begin
@course.update_attribute('is_public', @course.is_public == 1 ? 0 : 1)
@course.update!(is_public: @course.is_public == 1 ? 0 : 1)
normal_status(0, "成功")
rescue => e
uid_logger_error(e.message)
@ -394,6 +394,7 @@ class CoursesController < ApplicationController
# 教师列表以及教师搜索
def teachers
tip_exception(403, "无权限访问") if @course.excellent && @user_course_identity > Course::ASSISTANT_PROFESSOR
@search_str = params[:search].present? ? params[:search].strip : ""
if @course.try(:id) != 1309 || current_user.admin_or_business? || current_user.try(:id) == 15582
@ -551,7 +552,7 @@ class CoursesController < ApplicationController
graduation_group_id = GraduationGroup.find(params[:graduation_group_id].to_i).id
@course_member_list.each do |course_member|
course_member = CourseMember.find(course_member[:course_member_id].to_i)
course_member.update_attributes(graduation_group_id: graduation_group_id)
course_member.update!(graduation_group_id: graduation_group_id)
end
normal_status(0, "成功")
rescue => e
@ -711,7 +712,7 @@ class CoursesController < ApplicationController
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
course_student.update!(is_active: 1) if course_student.present? && !course_student.is_active
normal_status(0, "删除成功")
rescue => e
uid_logger_error(e.message)
@ -726,8 +727,8 @@ class CoursesController < ApplicationController
tip_exception("切换失败") unless course_member.STUDENT?
course_teacher = CourseMember.find_by!(user_id: current_user.id, role: %i[CREATOR PROFESSOR], course_id: @course.id)
course_member.update_attributes(is_active: 0)
course_teacher.update_attributes(is_active: 1)
course_member.update!(is_active: 0)
course_teacher.update!(is_active: 1)
normal_status(0, "切换成功")
rescue => e
uid_logger_error(e.message)
@ -742,8 +743,8 @@ class CoursesController < ApplicationController
tip_exception("切换失败") unless course_member.STUDENT?
course_teacher = CourseMember.find_by!(user_id: current_user.id, role: %i[ASSISTANT_PROFESSOR], course_id: @course.id)
course_member.update_attributes(is_active: 0)
course_teacher.update_attributes(is_active: 1)
course_member.update!(is_active: 0)
course_teacher.update!(is_active: 1)
normal_status(0, "切换成功")
rescue => e
uid_logger_error(e.message)
@ -782,7 +783,7 @@ class CoursesController < ApplicationController
# 课堂如果还有其他身份的用户则更新is_active
course_teacher = CourseMember.find_by(user_id: current_user.id, role: %i[CREATOR PROFESSOR ASSISTANT_PROFESSOR], course_id: @course.id)
course_student.destroy!
course_teacher.update_attributes(is_active: 1) if course_teacher.present? && !course_teacher.is_active
course_teacher.update!(is_active: 1) if course_teacher.present? && !course_teacher.is_active
CourseDeleteStudentDeleteWorksJob.perform_later(@course.id, [current_user.id])
normal_status(0, "退出成功")
end
@ -850,6 +851,8 @@ class CoursesController < ApplicationController
# 学生列表(包括各个子分班的学生列表)及搜索
def students
tip_exception(403, "无权限访问") if @course.excellent && @user_course_identity > Course::ASSISTANT_PROFESSOR
search = params[:search].present? ? params[:search].strip : nil
order = params[:order].present? ? params[:order].to_i : 1
sort = params[:sort].present? ? params[:sort] : "asc"
@ -959,7 +962,7 @@ class CoursesController < ApplicationController
member_teacher = CourseMember.find_by(user_id: course_member.user_id, course_id: @course.id, role: %i[CREATOR PROFESSOR ASSISTANT_PROFESSOR])
student_ids << course_member.user_id
course_member.destroy!
member_teacher.update_attributes(is_active: 1) if member_teacher.present?
member_teacher.update!(is_active: 1) if member_teacher.present?
end
end
CourseDeleteStudentDeleteWorksJob.perform_later(@course.id, student_ids) if student_ids.present?
@ -990,7 +993,7 @@ class CoursesController < ApplicationController
if existing_course_member.present?
if existing_course_member.STUDENT?
existing_course_member.update_attributes(course_group_id: course_group_id)
existing_course_member.update!(course_group_id: course_group_id)
else
new_student.is_active = 0 if existing_course_member.is_active
new_student.save!
@ -1142,7 +1145,7 @@ class CoursesController < ApplicationController
existing_student = CourseMember.find_by(course_id: course.id, role: %i[STUDENT], user_id: current_user.id)
if existing_student.present?
# 如果在该课堂已经存在学生身份,且邀请码为分班邀请码,则将其直接加入分班
existing_student.update_attributes(course_group_id: course_group.id) if course_group.present?
existing_student.update!(course_group_id: course_group.id) if course_group.present?
else
correspond_teacher_exist = current_user.none_admin_teacher_of_course? course
new_student = CourseMember.new(user_id: current_user.id, course_id: course.id, role: 4)

@ -4,83 +4,77 @@ class ExerciseAnswersController < ApplicationController
include ExercisesHelper
def create #每一次答案的点击,请求一次,实训题不在这里回答
begin
q_type = @exercise_question.question_type #试卷的类型
choice_id = params[:exercise_choice_id].present? ? params[:exercise_choice_id] : ""
answer_text = params[:answer_text].present? ? params[:answer_text].strip : "" #为字符串
if q_type < Exercise::SUBJECTIVE && (q_type != Exercise::MULTIPLE) && choice_id.blank?
normal_status(-1,"请选择序号")
else
ea = @exercise_question.exercise_answers.search_answer_users("user_id",current_user.id) #试卷的当前用户的答案
if q_type == Exercise::SINGLE || q_type == Exercise::JUDGMENT #选择题(单选)/判断题
if ea.exists?
ea.first.update_attribute(:exercise_choice_id,choice_id )
else
answer_option = {
:user_id => current_user.id,
:exercise_question_id => @exercise_question.id,
:exercise_choice_id => choice_id,
:answer_text => ""
}
ex_a = ExerciseAnswer.new(answer_option)
ex_a.save!
end
elsif q_type == Exercise::MULTIPLE #多选题的
choice_ids = params[:exercise_choice_id].present? ? params[:exercise_choice_id] : []
ea_ids = ea.pluck(:exercise_choice_id)
common_answer_ids = choice_ids & ea_ids #已经存在的试卷选项id
new_ids = (choice_ids - common_answer_ids).uniq # 新增的id
old_ids = (ea_ids - common_answer_ids).uniq #没有选择的,则删掉
if new_ids.size > 0
new_ids.each do |e|
answer_option = {
:user_id => current_user.id,
:exercise_question_id => @exercise_question.id,
:exercise_choice_id => e,
:answer_text => ""
}
ex_a = ExerciseAnswer.new(answer_option)
ex_a.save!
end
end
if old_ids.size > 0
ea_answer = ea.search_answer_users("exercise_choice_id",old_ids)
ea_answer.destroy_all
end
elsif q_type == Exercise::COMPLETION #填空题
answer_option = {
:user_id => current_user.id,
:exercise_question_id => @exercise_question.id,
:exercise_choice_id => choice_id,
:answer_text => answer_text
}
ea_answer = ea.search_answer_users("exercise_choice_id",choice_id)
if ea.present? && ea_answer.present?
ea_answer.update(answer_option)
else
ex_new = ExerciseAnswer.new(answer_option)
ex_new.save!
end
elsif q_type == Exercise::SUBJECTIVE #简答题
q_type = @exercise_question.question_type #试卷的类型
choice_id = params[:exercise_choice_id].present? ? params[:exercise_choice_id] : ""
answer_text = params[:answer_text].present? ? params[:answer_text].strip : "" #为字符串
if q_type < Exercise::SUBJECTIVE && (q_type != Exercise::MULTIPLE) && choice_id.blank?
normal_status(-1,"请选择序号")
else
ea = @exercise_question.exercise_answers.search_answer_users("user_id",current_user.id) #试卷的当前用户的答案
if q_type == Exercise::SINGLE || q_type == Exercise::JUDGMENT #选择题(单选)/判断题
if ea.exists?
ea.first.update!(exercise_choice_id: choice_id )
else
answer_option = {
:user_id => current_user.id,
:exercise_question_id => @exercise_question.id
:user_id => current_user.id,
:exercise_question_id => @exercise_question.id,
:exercise_choice_id => choice_id,
:answer_text => ""
}
if ea.present? #已经回答了的,
ea.first.update_attribute("answer_text",answer_text)
else
answer_option.merge!(answer_text:answer_text)
ex_a = ExerciseAnswer.new(answer_option)
ex_a.save!
end
elsif q_type == Exercise::MULTIPLE #多选题的
choice_ids = params[:exercise_choice_id].present? ? params[:exercise_choice_id] : []
ea_ids = ea.pluck(:exercise_choice_id)
common_answer_ids = choice_ids & ea_ids #已经存在的试卷选项id
new_ids = (choice_ids - common_answer_ids).uniq # 新增的id
old_ids = (ea_ids - common_answer_ids).uniq #没有选择的,则删掉
if new_ids.size > 0
new_ids.each do |e|
answer_option = {
:user_id => current_user.id,
:exercise_question_id => @exercise_question.id,
:exercise_choice_id => e,
:answer_text => ""
}
ex_a = ExerciseAnswer.new(answer_option)
ex_a.save!
end
end
normal_status(0,"回答成功")
if old_ids.size > 0
ea_answer = ea.search_answer_users("exercise_choice_id",old_ids)
ea_answer.destroy_all
end
elsif q_type == Exercise::COMPLETION #填空题
answer_option = {
:user_id => current_user.id,
:exercise_question_id => @exercise_question.id,
:exercise_choice_id => choice_id,
:answer_text => answer_text
}
ea_answer = ea.search_answer_users("exercise_choice_id",choice_id)
if ea.present? && ea_answer.present?
ea_answer.first.update!(answer_option)
else
ex_new = ExerciseAnswer.new(answer_option)
ex_new.save!
end
elsif q_type == Exercise::SUBJECTIVE #简答题
answer_option = {
:user_id => current_user.id,
:exercise_question_id => @exercise_question.id
}
if ea.present? #已经回答了的,
ea.first.update!(answer_text: answer_text)
else
answer_option.merge!(answer_text:answer_text)
ex_a = ExerciseAnswer.new(answer_option)
ex_a.save!
end
end
rescue Exception => e
uid_logger_error(e.message)
tip_exception("页面调用失败!")
raise ActiveRecord::Rollback
normal_status(0,"回答成功")
end
end
@ -116,7 +110,7 @@ class ExerciseAnswersController < ApplicationController
:score => total_score,
:subjective_score => subjective_score
}
@exercise_user.update_attributes(commit_option)
@exercise_user.update!(commit_option)
normal_status(-1,"试卷提交时间已截止!")
end
end

@ -44,7 +44,7 @@ class ExerciseQuestionsController < ApplicationController
end
end
if @exercise_question.save
if @exercise_question.save!
#为选择题(包括单选和多选)的时候,创建问题选项
ques_type = @exercise_question.question_type
if ques_type <= Exercise::MULTIPLE
@ -59,7 +59,7 @@ class ExerciseQuestionsController < ApplicationController
:choice_text => choice.strip
}
question_choices = @exercise_question.exercise_choices.new(choice_option)
question_choices.save
question_choices.save!
end
#标准答案的存储,如:["1","2","3"..]等1对应A2对应B3对应C。。。
standard_answer.each do |a|
@ -69,7 +69,7 @@ class ExerciseQuestionsController < ApplicationController
:exercise_choice_id => choice_id #即为选择的位置参数
}
question_standard_answer = ExerciseStandardAnswer.new(standard_option)
question_standard_answer.save
question_standard_answer.save!
if standard_answer.count > 1 && ques_type == Exercise::SINGLE #当标准答案数大于1且不为多选时修改为多选
@exercise_question.update_attribute("question_type",Exercise::MULTIPLE)
elsif standard_answer.count == 1 && ques_type == Exercise::MULTIPLE
@ -85,8 +85,8 @@ class ExerciseQuestionsController < ApplicationController
:choice_position => c,
:choice_text => choice.strip
}
question_choices = @exercise_question.exercise_choices.create(choice_option)
question_choices.save
question_choices = @exercise_question.exercise_choices.create!(choice_option)
question_choices.save!
end
standard_answer = params[:standard_answers] #对应选项的id
standard_option = {
@ -94,7 +94,7 @@ class ExerciseQuestionsController < ApplicationController
:exercise_choice_id => standard_answer.first.to_i
}
question_standard_answer = ExerciseStandardAnswer.new(standard_option)
question_standard_answer.save
question_standard_answer.save!
elsif ques_type == Exercise::COMPLETION #填空题,每空的参考答案有多个,那么以位置对应
standard_answer = params[:standard_answers]
standard_answer.each do |a|
@ -107,7 +107,7 @@ class ExerciseQuestionsController < ApplicationController
:answer_text => n
}
question_standard_answer = ExerciseStandardAnswer.new(standard_option)
question_standard_answer.save
question_standard_answer.save!
end
end
elsif ques_type == Exercise::SUBJECTIVE #简答题
@ -119,7 +119,7 @@ class ExerciseQuestionsController < ApplicationController
:answer_text => a,
}
question_standard_answer = ExerciseStandardAnswer.new(standard_option)
question_standard_answer.save
question_standard_answer.save!
end
end
elsif ques_type == Exercise::PRACTICAL #实训题
@ -135,10 +135,10 @@ class ExerciseQuestionsController < ApplicationController
:position => (index + 1),
:question_score => shixun_scores[index].present? ? shixun_scores[index].to_f.round(1) : 5
}
ex_shixun_challenge = ExerciseShixunChallenge.create(shixun_option)
ex_shixun_challenge = ExerciseShixunChallenge.create!(shixun_option)
question_score += ex_shixun_challenge.question_score # 问题的分数,为各个关卡分数的总和
end
@exercise_question.update_attributes(:question_score => question_score,:shixun_name=> shixun_name)
@exercise_question.update!(:question_score => question_score,:shixun_name=> shixun_name)
end
end
rescue Exception => e
@ -188,7 +188,7 @@ class ExerciseQuestionsController < ApplicationController
choices_array = params[:question_choices]
stan_answer_params = params[:standard_answers]
standard_answer = stan_answer_params.present? ? stan_answer_params.uniq.reject(&:blank?) : []
@exercise_question.update_attributes(question_options)
@exercise_question.update!(question_options)
#当选项存在时,可修改选项内容,但是不能更改选项的位置(即不能增删选项)
if choices_array.present?
ex_choices = @exercise_question.exercise_choices
@ -218,7 +218,7 @@ class ExerciseQuestionsController < ApplicationController
:choice_text => choices_array[i-1].strip
}
question_choices = @exercise_question.exercise_choices.new(choice_option)
question_choices.save
question_choices.save!
end
end
end
@ -243,7 +243,7 @@ class ExerciseQuestionsController < ApplicationController
:exercise_choice_id => s.to_i #即为选择的位置参数
}
question_standard_answer = ExerciseStandardAnswer.new(standard_option)
question_standard_answer.save
question_standard_answer.save!
end
end
@ -296,7 +296,7 @@ class ExerciseQuestionsController < ApplicationController
:answer_text => null_choice_text[i-1]
}
question_standard_answer = ExerciseStandardAnswer.new(standard_option)
question_standard_answer.save
question_standard_answer.save!
end
end
else
@ -323,7 +323,7 @@ class ExerciseQuestionsController < ApplicationController
:answer_text => n
}
question_standard_answer = ExerciseStandardAnswer.new(standard_option)
question_standard_answer.save
question_standard_answer.save!
end
end
end
@ -340,19 +340,19 @@ class ExerciseQuestionsController < ApplicationController
:answer_text => main_standard_answer,
}
question_standard_answer = ExerciseStandardAnswer.new(standard_option)
question_standard_answer.save
question_standard_answer.save!
end
elsif @exercise_question.question_type == Exercise::PRACTICAL
question_score = 0
shixun_name = params[:shixun_name] || @exercise_question.shixun_name
@exercise_question.exercise_shixun_challenges.each_with_index do |challenge, index|
challenge.question_score = params[:question_scores][index].to_f.round(1)
challenge.save
challenge.save!
question_score += params[:question_scores][index].to_f.round(1)
end
@exercise_question.question_score = question_score
@exercise_question.shixun_name = shixun_name
@exercise_question.save
@exercise_question.save!
end
#当试卷已发布时(试卷的总状态),当标准答案修改时,如有已提交的学生,需重新计算分数.
@ -397,7 +397,7 @@ class ExerciseQuestionsController < ApplicationController
new_objective_score = objective_score + update_objective_score
total_score = ex_user.score + update_objective_score
total_score = total_score < 0.0 ? 0.0 : total_score
ex_user.update_attributes(objective_score:new_objective_score,score:total_score)
ex_user.update!(objective_score:new_objective_score,score:total_score)
end
end
end
@ -526,7 +526,7 @@ class ExerciseQuestionsController < ApplicationController
:score => @c_score,
:answer_text => ""
}
ExerciseAnswer.create(answer_option)
ExerciseAnswer.create!(answer_option)
ex_answer_old = 0
end
if ex_obj_score <= 0.0
@ -545,7 +545,7 @@ class ExerciseQuestionsController < ApplicationController
:objective_score => new_obj_score,
:score => total_scores
}
@exercise_current_user.update_attributes(ex_scores)
@exercise_current_user.update!(ex_scores)
elsif @exercise_question.question_type == Exercise::COMPLETION #当为填空题,更新问题的总分,
@ -561,7 +561,7 @@ class ExerciseQuestionsController < ApplicationController
:score => @c_score,
:answer_text => ""
}
ExerciseAnswer.create(answer_option)
ExerciseAnswer.create!(answer_option)
new_obj_score = ex_obj_score + @c_score
end
@ -575,7 +575,7 @@ class ExerciseQuestionsController < ApplicationController
:objective_score => new_obj_score,
:score => total_scores
}
@exercise_current_user.update_attributes(ex_scores)
@exercise_current_user.update!(ex_scores)
elsif @exercise_question.question_type == Exercise::SUBJECTIVE #当为主观题时
if ex_answers.exists?
ex_answers_old_score = ex_answers.first.score > 0.0 ? ex_answers.first.score : 0.0 #原分数小于0取0
@ -588,7 +588,7 @@ class ExerciseQuestionsController < ApplicationController
:score => @c_score,
:answer_text => ""
}
ExerciseAnswer.create(answer_option)
ExerciseAnswer.create!(answer_option)
new_sub_score = ex_subj_score + @c_score
end
total_scores = ex_obj_score + new_sub_score
@ -601,7 +601,7 @@ class ExerciseQuestionsController < ApplicationController
:subjective_score => new_sub_score,
:score => total_scores
}
@exercise_current_user.update_attributes(ex_scores)
@exercise_current_user.update!(ex_scores)
elsif @exercise_question.question_type == Exercise::PRACTICAL
ex_answers = @exercise_question.exercise_shixun_answers.where(user_id:@user_id,exercise_shixun_challenge_id:@shixun_a_id)
@ -618,7 +618,7 @@ class ExerciseQuestionsController < ApplicationController
:score => @c_score,
:status => 0
}
ExerciseShixunAnswer.create(ex_shixun_option)
ExerciseShixunAnswer.create!(ex_shixun_option)
new_obj_score = ex_obj_score + @c_score
end
total_scores = new_obj_score + ex_subj_score
@ -631,7 +631,7 @@ class ExerciseQuestionsController < ApplicationController
:objective_score => new_obj_score,
:score => total_scores
}
@exercise_current_user.update_attributes(ex_scores)
@exercise_current_user.update!(ex_scores)
end
comments = params[:comment]
question_comment = @exercise_question.exercise_answer_comments&.first
@ -643,7 +643,7 @@ class ExerciseQuestionsController < ApplicationController
:exercise_answer_id => ex_answers.present? ? ex_answers.first.id : nil,
:user_id => current_user.id
}
question_comment.update_attributes(comment_option)
question_comment.update!(comment_option)
@exercise_comments = question_comment
else
ex_answer_comment_id = @exercise_question.exercise_answers.find_by(user_id: @user_id).try(:id)

File diff suppressed because it is too large Load Diff

@ -52,7 +52,7 @@ class GraduationWorksController < ApplicationController
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,
work.update!(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
@ -89,12 +89,12 @@ class GraduationWorksController < ApplicationController
GraduationWork.create(user_id: current_user.id, graduation_task_id: @task.id, course_id: @task.course_id)
if work.work_status == 0 && work.project_id == 0
work.update_attributes(project_id: project.id, update_time: Time.now)
work.update!(project_id: project.id, update_time: Time.now)
# 将老师加入项目
project_member = project.members.where(user_id: @task.user_id).first
if project_member.present?
project_member.member_roles.first.update_attributes(role_id: 3) if project_member.member_roles.first.present?
project_member.member_roles.first.update!(role_id: 3) if project_member.member_roles.first.present?
else
member = Member.create(user_id: @task.user_id, project_id: project.id)
member.member_roles << MemberRole.new(role_id: 3)
@ -127,7 +127,7 @@ class GraduationWorksController < ApplicationController
Tiding.where(user_id: @task.user_id, trigger_user_id: current_user.id, container_id: work.project.id,
container_type: 'ManagerJoinProject').destroy_all
work.update_attributes(project_id: 0)
work.update!(project_id: 0)
normal_status("取消关联成功")
rescue Exception => e
@ -177,7 +177,7 @@ class GraduationWorksController < ApplicationController
student_ids += members
for i in 0 .. members.count-1
stu_work = @task.graduation_works.where(user_id: members[i].to_i).first || GraduationWork.new
stu_work.update_attributes(user_id: members[i].to_i, description: graduation_work.description,
stu_work.update!(user_id: members[i].to_i, description: graduation_work.description,
graduation_task_id: @task.id, project_id: graduation_work.project_id,
late_penalty: graduation_work.late_penalty, work_status: graduation_work.work_status,
commit_time: Time.now, update_time: Time.now, group_id: graduation_work.group_id,
@ -238,7 +238,7 @@ class GraduationWorksController < ApplicationController
# 原成员更新描述、更新时间以及附件
@task.graduation_works.where(group_id: @work.group_id, user_id: (work_user_ids & params_user_ids)).each do |work|
work.update_attributes(update_time: Time.now, description: @work.description, update_user_id: current_user.id)
work.update!(update_time: Time.now, description: @work.description, update_user_id: current_user.id)
work.attachments.destroy_all
@work.attachments.each do |attachment|
att = attachment.copy
@ -264,7 +264,7 @@ class GraduationWorksController < ApplicationController
(params_user_ids - work_user_ids).each do |user_id|
stu_work = @task.graduation_works.where(user_id: user_id).empty? ? GraduationWork.new :
@task.graduation_works.where(user_id: user_id).first
stu_work.update_attributes(user_id: user_id, description: @work.description, graduation_task_id: @task.id,
stu_work.update!(user_id: user_id, description: @work.description, graduation_task_id: @task.id,
project_id: @work.project_id, late_penalty: @work.late_penalty,
work_status: @work.work_status, commit_time: Time.now, update_time: Time.now,
group_id: @work.group_id, commit_user_id: @work.commit_user_id, update_user_id: current_user.id)
@ -323,9 +323,9 @@ class GraduationWorksController < ApplicationController
# 如果作品是未提交的状态则更新为已提交
if !new_score.score.nil? && @work.work_status == 0
@work.update_attributes(work_status: 1, commit_time: Time.now)
@work.update!(work_status: 1, commit_time: Time.now)
if @task.task_type == 2
@work.update_attributes(group_id: @task.graduation_works.where("work_status != 0").select("distinct group_id").count + 1)
@work.update!(group_id: @task.graduation_works.where("work_status != 0").select("distinct group_id").count + 1)
end
end
@ -392,7 +392,7 @@ class GraduationWorksController < ApplicationController
graduation_task_id: @task.id, comment: "使用调分功能调整了作业最终成绩:#{params[:comment]}",
user_id: User.current.id, reviewer_role: 1, is_ultimate: 1)
new_score.save!
@work.update_attributes(ultimate_score: 1, work_score: params[:score].to_f)
@work.update!(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,
@ -445,9 +445,9 @@ class GraduationWorksController < ApplicationController
end
Attachment.associate_container(params[:attachment_ids], @work.id, @work.class, 7)
revise_attachment = Attachment.where(attachtype: 7, container_id: @work.id, container_type: "GraduationWork").last
revise_attachment.update_attributes(description: params[:description]) if revise_attachment.present?
revise_attachment.update!(description: params[:description]) if revise_attachment.present?
@work.update_attributes(update_time: Time.now)
@work.update!(update_time: Time.now)
normal_status("提交成功")
rescue Exception => e
@ -465,7 +465,7 @@ class GraduationWorksController < ApplicationController
if @work_assign_teacher.present?
# graduation_group_id: 已经是答辩组的需要 将答辩组清空
@work_assign_teacher.update_attributes(graduation_group_id: 0)
@work_assign_teacher.update!(graduation_group_id: 0)
else
@work.graduation_work_comment_assignations << GraduationWorkCommentAssignation.new(graduation_task_id: @task.id,
user_id: params[:user_id],

@ -232,7 +232,11 @@ class HacksController < ApplicationController
hacks = Hack.select(select_sql).mine(current_user.id)
else
# 全部包括已经发布的,和我的未发布的
hacks = Hack.select(select_sql).published.opening.or(Hack.select(select_sql).unpublish.mine(current_user.id))
if current_user.admin_or_business?
hacks = Hack.select(select_sql)
else
hacks = Hack.select(select_sql).published.opening.or(Hack.select(select_sql).unpublish.mine(current_user.id))
end
end
# 搜索
if params[:search]

@ -976,7 +976,7 @@ class HomeworkCommonsController < ApplicationController
elsif homework.max_group_end_time
homework.end_time = homework.max_group_end_time
end
homework.homework_detail_manual.update_attribute('comment_status', 1)
homework.homework_detail_manual.update_attributes!(comment_status: 1)
if homework.course_acts.size == 0
homework.course_acts << CourseActivity.new(user_id: homework.user_id, course_id: homework.course_id)
@ -1004,7 +1004,7 @@ class HomeworkCommonsController < ApplicationController
if homework.end_time > Time.now && homework.homework_detail_manual.try(:comment_status) > 1
homework.homework_detail_manual.update_attribute("comment_status", 1)
homework.homework_detail_manual.update_attributes!(comment_status: 1)
end
# 补交结束时间
@ -1071,7 +1071,7 @@ class HomeworkCommonsController < ApplicationController
homework.end_time = homework.max_group_end_time
if homework.end_time > time && homework_detail_manual.try(:comment_status) > 1
homework_detail_manual.update_attribute("comment_status", 1)
homework_detail_manual.update_attributes!(comment_status: 1)
end
# 统一设置
@ -1080,7 +1080,7 @@ class HomeworkCommonsController < ApplicationController
homework.end_time = time
end
homework_detail_manual.update_attribute("comment_status", 2) if homework.end_time <= time
homework_detail_manual.update_attributes!(comment_status: 2) if homework.end_time <= time
# 实训作业的作品需要计算是否迟交
if homework.homework_type == "practice"
@ -1451,7 +1451,7 @@ class HomeworkCommonsController < ApplicationController
if user_review.present?
user_review.update_attributes!(:code_rate => user_rate)
else
homework.homework_review_results.create(:user_id => user, :code_rate => user_rate)
homework.homework_review_results.create!(:user_id => user, :code_rate => user_rate)
end
end
nuser_ids = results.user_lists.map(&:user_id).uniq

@ -1,6 +1,6 @@
class MemosController < ApplicationController
before_action :require_login, except: [:show, :index]
before_action :check_account, only: [:new, :create]
before_action :check_account, only: [:new, :create, :reply]
before_action :set_memo, only: [:show, :edit, :update, :destroy, :sticky_or_cancel, :hidden, :more_reply]
before_action :validate_memo_params, only: [:create, :update]
before_action :owner_or_admin, only: [:edit, :update, :destroy]
@ -144,7 +144,7 @@ class MemosController < ApplicationController
def reply
tip_exception("parent_id不能为空") if params[:parent_id].blank?
tip_exception("content不能为空") if params[:content].blank?
tip_exception("内容不能超过1000字符") if params[:content].length > 1000
tip_exception("内容不能超过2000字符") if params[:content].length > 2000
ActiveRecord::Base.transaction do
begin

@ -62,8 +62,8 @@ class MessagesController < ApplicationController
end
def reply
return normal_status(2, "回复内容不能为空") if params[:content].blank?
return normal_status(2, "回复内容不能超过1000字符") if params[:content].length > 1000
return normal_status(-1, "回复内容不能为空") if params[:content].blank?
return normal_status(-1, "回复内容不能超过2000字符") if params[:content].length > 2000
@reply = Message.create!(board: @message.board, root_id: @message.root_id || @message.id,
author: current_user, parent: @message,
message_detail_attributes: {

@ -44,7 +44,7 @@ class PollQuestionsController < ApplicationController
@poll.poll_questions.insert_question(ques_num).update_all("question_number = question_number + 1")
end
end
if @poll_question.save
if @poll_question.save!
if params[:question_type] != 3
p_answer = params[:question_answers]
p_other_answer = params[:question_other_answer]
@ -56,7 +56,7 @@ class PollQuestionsController < ApplicationController
:answer_text => answer
}
poll_answers = @poll_question.poll_answers.new question_option
poll_answers.save
poll_answers.save!
end
# 新增答案的其他选项
if p_other_answer
@ -65,7 +65,7 @@ class PollQuestionsController < ApplicationController
:answer_text => ''
}
poll_answers = @poll_question.poll_answers.new question_option
poll_answers.save
poll_answers.save!
end
end
end
@ -118,7 +118,7 @@ class PollQuestionsController < ApplicationController
if answer # 判断该位置的answer是否存在存在则更新.不存在则跳到下一步
answer.answer_text = p_answer[i-1]
answer.answer_position = i
answer.save
answer.save!
else
answer_options = {
:answer_position => i,
@ -137,12 +137,12 @@ class PollQuestionsController < ApplicationController
@poll_question.poll_answers.new question_option
else
other_answer.answer_position = p_answer_count + 1
other_answer.save
other_answer.save!
end
end
end
@poll_question.update_attributes(poll_questions_params)
@poll_question.update!(poll_questions_params)
rescue Exception => e
uid_logger_error(e.message)
tip_exception("更新失败")
@ -198,8 +198,8 @@ class PollQuestionsController < ApplicationController
if opr.to_s == "up"
last_q_p = @poll.poll_questions.find_by(question_number: (current_q_p-1)) #当前问题的前一个问题
if last_q_p.present?
@poll_question.update_attribute("question_number", (current_q_p - 1))
last_q_p.update_attribute("question_number", current_q_p) # 重新获取当前问题的位置
@poll_question.update!(question_number: (current_q_p - 1))
last_q_p.update!(question_number: current_q_p) # 重新获取当前问题的位置
normal_status(0, "问题上移成功!")
else
normal_status(-1, "移动失败,已经是第一个问题了!")
@ -207,8 +207,8 @@ class PollQuestionsController < ApplicationController
elsif opr.to_s == "down"
next_q_p = @poll.poll_questions.find_by(question_number: (current_q_p+1)) #当前问题的后一个问题
if next_q_p.present?
@poll_question.update_attribute("question_number", (current_q_p + 1))
next_q_p.update_attribute("question_number", current_q_p)
@poll_question.update!(question_number: (current_q_p + 1))
next_q_p.update!(question_number: current_q_p)
normal_status(0, "问题下移成功!")
else

@ -31,24 +31,24 @@ class PollVotesController < ApplicationController
current_user_answer = user_votes.first
if current_user_answer&.poll_answer_id != question_answer_id #如果说更换了答案,则以前的答案删除,并新建记录
current_user_answer.destroy
PollVote.create(vote_answer_params)
PollVote.create!(vote_answer_params)
else
if question_answer_text.present?
current_user_answer.update_attribute("vote_text", question_answer_text)
current_user_answer.update!(vote_text: question_answer_text)
end
end
else
PollVote.create(vote_answer_params)
PollVote.create!(vote_answer_params)
end
elsif question_type == 2 #多选题的话答案应该是1个以上
question_answer_ids = params[:poll_answer_id] ? params[:poll_answer_id] : [] #该答案的id
if question_answer_ids.present?
if question_answer_text.present? #有文字输入,但是不存在其他选项的
ques_vote_id = question_answer_ids.map(&:to_i).max
if user_votes.find_vote_text.present?
current_vote_text = user_votes.find_vote_text.first
current_vote_text.update_attribute("vote_text", question_answer_text)
ques_vote = user_votes.find_by(poll_answer_id: ques_vote_id)
if ques_vote.present?
ques_vote.update!(vote_text: question_answer_text)
else
answer_option = {
:user_id => current_user.id,
@ -56,7 +56,7 @@ class PollVotesController < ApplicationController
:poll_answer_id => ques_vote_id,
:vote_text => question_answer_text
}
PollVote.create(answer_option)
PollVote.create!(answer_option)
# 重新取一次poll_votes
user_votes = @poll_question.poll_votes.find_current_vote("user_id",current_user.id)
end
@ -93,14 +93,14 @@ class PollVotesController < ApplicationController
else #主观题的输入
# current_vote_text = user_votes.find_vote_text
if user_votes.present?
user_votes.first.update_attribute("vote_text", question_answer_text)
user_votes.first.update!(vote_text: question_answer_text)
# if question_answer_text.present?
# user_votes.first.update_attribute("vote_text", question_answer_text)
# else
# user_votes.destroy_all
# end
else
PollVote.create(vote_answer_params)
PollVote.create!(vote_answer_params)
end
end
@current_question_number = @poll_question.question_number

@ -137,7 +137,7 @@ class PollsController < ApplicationController
:polls_status => 1,
:polls_type => "Course",
}
@poll = Poll.create(poll_options)
@poll = Poll.create!(poll_options)
rescue Exception => e
uid_logger_error(e.message)
tip_exception("问卷创建失败!")
@ -167,7 +167,7 @@ class PollsController < ApplicationController
:polls_name => poll_name,
:polls_description => poll_des
}
@poll.update_attributes(poll_params)
@poll.update!(poll_params)
normal_status(0,"问卷更新成功!")
rescue Exception => e
uid_logger_error(e.message)
@ -297,7 +297,7 @@ class PollsController < ApplicationController
poll_group_setting = poll.poll_group_settings.find_in_poll_group("course_group_id",i).first #根据课堂分班的id寻找问卷所在的班级
group_end_time = params[:detail] ? group_end_times[index] : ex_end_time
if poll_group_setting.present? #如果该问卷分组存在,则更新,否则新建
poll_group_setting.update_attributes!(publish_time: Time.now, end_time: group_end_time)
poll_group_setting.update!(publish_time: Time.now, end_time: group_end_time)
else
p_course_group = {
:poll_id => poll.id,
@ -326,7 +326,7 @@ class PollsController < ApplicationController
:polls_status => poll_status,
:unified_setting => poll_unified
}
poll.update_attributes(poll_params)
poll.update!(poll_params)
if poll.course_acts.size == 0
poll.course_acts << CourseActivity.new(:user_id => poll.user_id,:course_id => poll.course_id)
end
@ -390,10 +390,10 @@ class PollsController < ApplicationController
new_end_time = poll_group_setting.end_time_present.map(&:end_time) # 问卷结束时间不为空的
new_end_time_s = new_end_time.size > 0 ? new_end_time.max : Time.now
new_poll_status = set_poll_status(poll.publish_time,new_end_time_s)
poll.update_attributes(:end_time => new_end_time_s,:polls_status => new_poll_status,:unified_setting => poll_unified)
poll.update!(:end_time => new_end_time_s,:polls_status => new_poll_status,:unified_setting => poll_unified)
elsif poll.unified_setting
poll_users = poll.poll_users
poll.update_attributes(:polls_status => 3, :end_time => Time.now)
poll.update!(:polls_status => 3, :end_time => Time.now)
end
poll_users = poll_users.where("commit_status = 0 and start_at is not null")
poll_users.update_all(:commit_status => 1, :end_at => Time.now)
@ -470,7 +470,7 @@ class PollsController < ApplicationController
:publish_time => p_time,
:end_time => e_time
}
@poll.update_attributes(poll_options)
@poll.update!(poll_options)
normal_status(0,"分班问卷撤销发布成功!")
else
normal_status(-1,"请选择撤销发布班级!")
@ -490,7 +490,7 @@ class PollsController < ApplicationController
:end_time => nil,
:unified_setting => true
}
@poll.update_attributes(poll_new_params)
@poll.update!(poll_new_params)
@poll.poll_group_settings.destroy_all
normal_status(0,"问卷撤销发布成功!")
@ -531,7 +531,7 @@ class PollsController < ApplicationController
begin
check_ids = Poll.where(id:params[:check_ids])
check_ids.each do |poll|
poll.update_attribute('is_public', true)
poll.update!(is_public: true)
end
normal_status(0, "问卷已设为公开!")
rescue Exception => e
@ -555,13 +555,13 @@ class PollsController < ApplicationController
:description => poll.polls_description,
:course_list_id => poll.course.try(:course_list_id)
}
current_ex_bank.update_attributes(ex_params)
current_ex_bank.update!(ex_params)
question_bank = QuestionBank.ques_by_container(current_ex_bank.id,current_ex_bank.container_type) #该习题库是否存在于问题库里
ques_params = {
:name => current_ex_bank.name,
:course_list_id => current_ex_bank.course_list_id
}
question_bank.first.update_attributes(ques_params) if question_bank.present?
question_bank.first.update!(ques_params) if question_bank.present?
current_ex_bank.exercise_bank_questions.destroy_all # 更新后,习题库的问题全部删除,后续重新再建
else
ex_params = {
@ -575,7 +575,7 @@ class PollsController < ApplicationController
:quotes => 1
}
current_ex_bank= ExerciseBank.new ex_params
if current_ex_bank.save #如果习题库保存成功则会创建问题库question_bank
if current_ex_bank.save! #如果习题库保存成功则会创建问题库question_bank
ques_params = {
:name => current_ex_bank.name,
:container_id => current_ex_bank.id,
@ -586,9 +586,9 @@ class PollsController < ApplicationController
:course_list_id => current_ex_bank.course_list_id
}
question_bank = QuestionBank.new ques_params
question_bank.save
question_bank.save!
end
poll.update_attributes!(exercise_bank_id: current_ex_bank.id)
poll.update!(exercise_bank_id: current_ex_bank.id)
end
# 问卷的问题的输入
poll.poll_questions.each do |f|
@ -601,7 +601,7 @@ class PollsController < ApplicationController
:min_choices => f.min_choices
}
exercise_bank_question = current_ex_bank.exercise_bank_questions.new option
exercise_bank_question.save
exercise_bank_question.save!
## 问卷答案的输入
f.poll_answers.each do |a|
choice_option = {
@ -609,7 +609,7 @@ class PollsController < ApplicationController
:choice_text => a.answer_text
}
exercise_bank_c = exercise_bank_question.exercise_bank_choices.new choice_option
exercise_bank_c.save
exercise_bank_c.save!
end
end
end
@ -746,7 +746,7 @@ class PollsController < ApplicationController
:publish_time => params_publish_time,
:end_time => params_end_time
}
@poll.update_attributes(poll_params)
@poll.update!(poll_params)
@poll.poll_group_settings.destroy_all
normal_status(0, "问卷设置成功!")
end
@ -800,7 +800,7 @@ class PollsController < ApplicationController
:end_time => poll_end_time
}
end
the_group_setting.update_attributes(poll_group_params)
the_group_setting.update!(poll_group_params)
end
end
if new_group_ids.size > 0
@ -813,7 +813,7 @@ class PollsController < ApplicationController
:end_time => poll_end_time
}
new_poll_group = PollGroupSetting.new(poll_group_params)
new_poll_group.save
new_poll_group.save!
end
end
end
@ -848,7 +848,7 @@ class PollsController < ApplicationController
:publish_time => p_time,
:end_time => e_time
}
@poll.update_attributes(poll_params)
@poll.update!(poll_params)
if @poll.polls_status == 2
if @poll.course_acts.size == 0
@poll.course_acts << CourseActivity.new(:user_id => @poll.user_id,:course_id => @poll.course_id)
@ -880,10 +880,10 @@ class PollsController < ApplicationController
:start_at => Time.now,
:commit_status => 0
}
PollUser.create(poll_user_params)
PollUser.create!(poll_user_params)
end
elsif poll_user_current.start_at.nil?
poll_user_current.update_attributes(:start_at => Time.now)
poll_user_current.update!(:start_at => Time.now)
end
if @user_course_identity < Course::STUDENT || (@poll_status == 3) || (poll_user_current.present? && poll_user_current.commit_status == 1)
@ -963,7 +963,7 @@ class PollsController < ApplicationController
:commit_status => 1,
:end_at => Time.now
}
poll_user_current.update_attributes(poll_user_params)
poll_user_current.update!(poll_user_params)
CommitPollNotifyJobJob.perform_later(@poll.id, current_user.id)
normal_status(0, "问卷提交成功!")
end

@ -68,7 +68,7 @@ class StudentWorksController < ApplicationController
begin
work = @homework.student_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,
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)
@ -112,7 +112,7 @@ class StudentWorksController < ApplicationController
student_ids += members
for i in 0 .. members.count-1
stu_work = @homework.student_works.find_or_initialize_by(user_id: members[i].to_i)
stu_work.update_attributes(user_id: members[i].to_i, description: student_work.description,
stu_work.update_attributes!(user_id: members[i].to_i, description: student_work.description,
homework_common_id: @homework.id, project_id: student_work.project_id,
late_penalty: student_work.late_penalty, work_status: student_work.work_status,
commit_time: Time.now, update_time: Time.now, group_id: student_work.group_id,
@ -177,7 +177,7 @@ class StudentWorksController < ApplicationController
# 原成员更新描述、更新时间以及附件
@homework.student_works.where(group_id: @work.group_id, user_id: (work_user_ids & params_user_ids)).each do |work|
# work.update_attributes(update_time: Time.now, description: @work.description, commit_user_id: current_user.id)
work.update_attributes(update_time: Time.now, description: @work.description, update_user_id: current_user.id)
work.update_attributes!(update_time: Time.now, description: @work.description, update_user_id: current_user.id)
work.attachments.destroy_all
@work.attachments.each do |attachment|
att = attachment.copy
@ -202,7 +202,7 @@ class StudentWorksController < ApplicationController
# 新增加的成员
(params_user_ids - work_user_ids).each do |user_id|
stu_work = @homework.student_works.find_or_initialize_by(user_id: user_id)
stu_work.update_attributes(user_id: user_id, description: @work.description, homework_common_id: @homework.id,
stu_work.update_attributes!(user_id: user_id, description: @work.description, homework_common_id: @homework.id,
project_id: @work.project_id, late_penalty: @work.late_penalty,
work_status: @work.work_status, commit_time: Time.now, update_time: Time.now,
group_id: @work.group_id, commit_user_id: @work.commit_user_id, update_user_id: current_user.id)
@ -257,14 +257,14 @@ class StudentWorksController < ApplicationController
work = @homework.student_works.find_or_create_by(user_id: current_user.id)
if work.work_status == 0 && work.project_id == 0
work.update_attributes(project_id: project.id, update_time: Time.now)
work.update_attributes!(project_id: project.id, update_time: Time.now)
# 将老师加入项目
project_member = project.members.find_by_user_id(@homework.user_id)
if project_member.present?
project_member.member_roles.take.update_attributes(role_id: 3) if project_member.member_roles.take.present?
project_member.member_roles.take.update_attributes!(role_id: 3) if project_member.member_roles.take.present?
else
member = Member.create(user_id: @homework.user_id, project_id: project.id)
member = Member.create!(user_id: @homework.user_id, project_id: project.id)
member.member_roles << MemberRole.new(role_id: 3)
Tiding.create(user_id: @homework.user_id, trigger_user_id: current_user.id, container_id: project.id,
container_type: 'ManagerJoinProject', belong_container_id: project.id,
@ -295,7 +295,7 @@ class StudentWorksController < ApplicationController
Tiding.where(user_id: @homework.user_id, trigger_user_id: current_user.id, container_id: work.project.id,
container_type: 'ManagerJoinProject').destroy_all
work.update_attributes(project_id: 0)
work.update_attributes!(project_id: 0)
normal_status(0,"取消关联成功")
rescue Exception => e
@ -329,9 +329,9 @@ class StudentWorksController < ApplicationController
# end
Attachment.associate_container(params[:attachment_ids], @work.id, @work.class, 7)
revise_attachment = Attachment.where(attachtype: 7, container_id: @work.id, container_type: "StudentWork").last
revise_attachment.update_attributes(description: params[:description]) if revise_attachment.present?
revise_attachment.update_attributes!(description: params[:description]) if revise_attachment.present?
@work.update_attributes(update_time: Time.now)
@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?
@ -376,9 +376,9 @@ class StudentWorksController < ApplicationController
# 如果作品是未提交的状态则更新为已提交
if @user_course_identity < Course::STUDENT && !new_score.score.nil? && @work.work_status == 0
@work.update_attributes(work_status: 1, commit_time: Time.now)
@work.update_attributes!(work_status: 1, commit_time: Time.now)
# 分组作业更新分组id
@work.update_attributes(group_id: @homework.max_group_id) if @homework.homework_type == "group"
@work.update_attributes!(group_id: @homework.max_group_id) if @homework.homework_type == "group"
end
new_score.reviewer_role = reviewer_role
@ -442,7 +442,7 @@ class StudentWorksController < ApplicationController
# 实训作品的总结
def update_des
@work.update_attributes(des_params)
@work.update_attributes!(des_params)
tip_exception(0, "提交成功")
end
@ -590,7 +590,7 @@ class StudentWorksController < ApplicationController
begin
score = @work.student_works_scores.find_by!(id: params[:score_id])
jour = score.journals_for_messages.new(user_id: current_user.id, notes: params[:comment], reply_id: score.user_id)
jour.save
jour.save!
normal_status(0,"回复成功")
rescue Exception => e
uid_logger(e.message)
@ -624,7 +624,7 @@ class StudentWorksController < ApplicationController
score_appeal = nil
ActiveRecord::Base.transaction do
begin
score.update_attributes(appeal_status: 1)
score.update_attributes!(appeal_status: 1)
score_appeal = StudentWorksScoresAppeal.create!(user_id: current_user.id, student_works_score_id: score.id,
comment: params[:comment], appeal_status: 1)
@ -645,9 +645,9 @@ class StudentWorksController < ApplicationController
if score.present? && score.appeal_status == 1
ActiveRecord::Base.transaction do
begin
score.update_attributes(appeal_status: 2)
score.update_attributes!(appeal_status: 2)
score_appeal = score.student_works_scores_appeal
score_appeal.update_attributes(appeal_status: 2)
score_appeal.update_attributes!(appeal_status: 2)
score_appeal.tidings.destroy_all
normal_status(0,"撤销成功")
rescue Exception => e
@ -670,18 +670,18 @@ class StudentWorksController < ApplicationController
ActiveRecord::Base.transaction do
begin
# 更新appeal_status的值
score.update_attributes(appeal_status: params[:status].to_i)
score.update_attributes!(appeal_status: params[:status].to_i)
score_appeal = score.student_works_scores_appeal
score_appeal.update_attributes(appeal_status: params[:status].to_i)
score_appeal.update_attributes!(appeal_status: params[:status].to_i)
score_appeal.tidings.update_all(status: 1)
if params[:status].to_i == 3
# 申诉成功后该评分失效
score.update_attributes(is_invalid: 1)
score.update_attributes!(is_invalid: 1)
# 申诉成功后 扣匿评学生的违规匿评扣分
sw = @homework.student_works.find_by(user_id: score.user_id)
sw.update_attribute("appeal_penalty", @homework.homework_detail_manual.appeal_penalty + sw.appeal_penalty) if sw.present?
sw.update_attributes!(appeal_penalty: @homework.homework_detail_manual.appeal_penalty + sw.appeal_penalty) if sw.present?
# 申诉成功 重新计算申诉者的匿评分
if @work.student_works_scores.where("reviewer_role = 3 AND appeal_status != 3").count > 0
@ -689,7 +689,7 @@ class StudentWorksController < ApplicationController
else
@work.student_score = nil
end
@work.save
@work.save!
end
# todo tiding
@ -737,7 +737,7 @@ class StudentWorksController < ApplicationController
else
comment = "根据实训报告中最终提交的代码调整第#{challenge.position}关分数"
end
challenge_score = @work.challenge_work_scores.create(challenge_id: params[:challenge_id], user_id: current_user.id, score: params[:score],
challenge_score = @work.challenge_work_scores.create!(challenge_id: params[:challenge_id], user_id: current_user.id, score: params[:score],
comment: comment)
challenge_score.create_tiding current_user.id
if @work.work_status != 0 && @work.myshixun
@ -862,7 +862,7 @@ class StudentWorksController < ApplicationController
else
st_work.student_score = student_work.student_score
end
st_work.save
st_work.save!
Tiding.create(user_id: st_work.user_id, trigger_user_id: current_user.id, container_id: st_score.id,
container_type: "StudentWorksScore", parent_container_id: st_work.id, parent_container_type: "StudentWork",

@ -5,7 +5,7 @@ class SubjectsController < ApplicationController
before_action :find_subject, except: [:index, :create, :new, :append_to_stage, :add_shixun_to_stage]
before_action :allowed, only: [:update, :edit, :destroy, :publish, :cancel_publish, :cancel_has_publish,
:search_members, :add_subject_members, :statistics, :shixun_report, :school_report,
:up_member_position, :down_member_position, :update_team_title]
:up_member_position, :down_member_position, :update_team_title, :statistics_info]
before_action :require_admin, only: [:copy_subject]
before_action :shixun_marker, only: [:add_shixun_to_stage]
@ -13,6 +13,7 @@ class SubjectsController < ApplicationController
include ApplicationHelper
include SubjectsHelper
include GitCommon
include CustomSortable
def index
@tech_system = current_laboratory.subject_repertoires
@ -92,7 +93,7 @@ class SubjectsController < ApplicationController
@is_creator = current_user.creator_of_subject?(@subject)
@is_manager = @user.manager_of_subject?(@subject)
# 合作团队
@shixuns = @subject.shixuns.published.pluck(:id)
# @shixuns = @subject.shixuns.published.pluck(:id)
@courses = @subject.courses if @subject.excellent
@members = @subject.subject_members.includes(:user)
@ -456,7 +457,7 @@ class SubjectsController < ApplicationController
end
end
def statistics_new
def statistics_info
# data = Subjects::DataStatisticService.new(@subject)
# Rails.logger.info("study_count: #{data.study_count}")
# Rails.logger.info("course_study_count: #{ data.course_study_count}")
@ -470,9 +471,19 @@ class SubjectsController < ApplicationController
# data_2 = Subjects::ShixunUsedInfoService.call(@subject)
# Rails.logger.info("study_count: #{data_2}")
data_3 = Subjects::UserUsedInfoService.call(@subject)
Rails.logger.info("study_count: #{data_3}")
render_ok()
# data_3 = Subjects::UserUsedInfoService.call(@subject)
# Rails.logger.info("study_count: #{data_3}")
@data =
if params[:type] == "shixun_info"
@subject.subject_shixun_infos
elsif params[:type] == "user_info"
@subject.subject_user_infos
else
@subject.subject_course_records
end
@data = paginate custom_sort(@data, params[:sort_by], params[:sort_direction])
end
def shixun_report

@ -9,18 +9,18 @@ class Users::InterestsController < Users::BaseController
extension = current_user.user_extension || current_user.build_user_extension
return render_error('请选择职业') unless %w(teacher student professional).include?(identity)
interest_ids = Array.wrap(params[:interest_ids]).map(&:to_i)
return render_error('请选择兴趣') if interest_ids.blank?
# interest_ids = Array.wrap(params[:interest_ids]).map(&:to_i)
# return render_error('请选择兴趣') if interest_ids.blank?
ActiveRecord::Base.transaction do
extension.update_column(:identity, identity)
# 兴趣
UserInterest.bulk_insert(:user_id, :repertoire_id) do |worker|
(Repertoire.pluck(:id) & interest_ids).each do |repertoire_id|
worker.add(user_id: current_user.id, repertoire_id: repertoire_id)
end
end
# UserInterest.bulk_insert(:user_id, :repertoire_id) do |worker|
# (Repertoire.pluck(:id) & interest_ids).each do |repertoire_id|
# worker.add(user_id: current_user.id, repertoire_id: repertoire_id)
# end
# end
end
render_ok

@ -7,8 +7,8 @@ class ItemBanks::SaveItemForm
validates :sub_discipline_id, presence: true
validates :item_type, presence: true, inclusion: {in: %W(SINGLE MULTIPLE JUDGMENT COMPLETION SUBJECTIVE PRACTICAL PROGRAM)}
validates :difficulty, presence: true, inclusion: {in: 1..3}, numericality: { only_integer: true }
validates :name, presence: true, length: { maximum: 1000 }
validates :analysis, length: { maximum: 5000 }
validates :name, presence: true, length: { maximum: 1000, too_long: "不能超过1000个字符" }
validates :analysis, length: { maximum: 1000, too_long: "不能超过1000个字符" }
def validate!
super
@ -27,7 +27,7 @@ class ItemBanks::SaveItemForm
attr_accessor :choice_text, :is_answer
validates :choice_text, presence: true, length: { maximum: 500 }
validates :choice_text, presence: true, length: { maximum: 500, too_long: "不能超过500个字符" }
validates :is_answer, presence: true, inclusion: {in: 0..1}, numericality: { only_integer: true }
end
end

@ -530,7 +530,7 @@ module ExercisesHelper
exercise_cha_score = 0.0
answer_status = 0
# if game.status == 2 && game.final_score >= 0
if game.final_score > 0 && game.end_time && game.end_time < exercise_end_time
if game.final_score > 0 && (game.end_time.nil? || game.end_time < exercise_end_time)
exercise_cha_score = game.real_score(exercise_cha.question_score)
# exercise_cha_score = exercise_cha.question_score #每一关卡的得分
answer_status = 1

@ -851,7 +851,8 @@ module ExportHelper
def make_zip_name(work, file_name="")
Rails.logger.info("######################file_name: #{file_name}")
# name = file_name === "" ? "" : (file_name[0, file_name.rindex('.')]+"_")
"#{work&.homework_common.course&.user_group_name(work.user_id)}_#{work&.user&.student_id}_#{work&.user&.real_name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}"
course = work.is_a?(StudentWork) ? work&.homework_common&.course : work&.graduation_task&.course
"#{course&.user_group_name(work.user_id)}_#{work&.user&.student_id}_#{work&.user&.real_name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}"
end
def zipping(zip_name_refer, files_paths, output_path, is_attachment=false, not_exist_file=[])

@ -1,10 +1,10 @@
module SubjectsHelper
# 实训路径的发布状态
def publish_status subject, is_manager, user, shixuns
def publish_status subject, is_manager, user
status = -1
if is_manager
status = 0 if subject.status == 0 && shixuns.count > 0
status = 0 if subject.status == 0
status = 1 if subject.status == 1
status = 2 if subject.status == 2 && user.admin?
end

@ -13,7 +13,7 @@ class Discuss < ApplicationRecord
belongs_to :challenge, optional: true
validate :validate_sensitive_string
validates :content, length: { maximum: 1000, too_long: "不能超过1000个字符" }
validates :content, length: { maximum: 2000, too_long: "不能超过2000个字符" }
after_create :send_tiding

@ -5,5 +5,5 @@ class GraduationWorkScore < ApplicationRecord
belongs_to :graduation_task
has_many :attachments, as: :container, dependent: :destroy
validates :comment, length: { maximum: 1000, too_long: "不能超过1000个字符" }
validates :comment, length: { maximum: 2000, too_long: "不能超过2000个字符" }
end

@ -1,6 +1,6 @@
class HackSet < ApplicationRecord
validates_length_of :input, maximum: 1000, message: "不能超过5000个字符"
validates_length_of :output, maximum: 1000, message: "不能超过5000个字符"
validates_length_of :input, maximum: 1000, message: "不能超过1000个字符"
validates_length_of :output, maximum: 1000, message: "不能超过1000个字符"
validates :input, presence: { message: "测试集输入不能为空" }
validates :output, presence: { message: "测试集输出不能为空" }
validates_uniqueness_of :input, scope: [:hack_id, :input], message: "多个测试集的输入不能相同"

@ -26,7 +26,7 @@ class JournalsForMessage < ApplicationRecord
# "is_comprehensive_evaluation", # 1 教师评论、2 匿评、3 留言
# "hidden", 隐藏、
validates :notes, length: { maximum: 1000, too_long: "不能超过1000个字符" }
validates :notes, length: { maximum: 2000, too_long: "不能超过2000个字符" }
after_create :send_tiding

@ -1,5 +1,5 @@
class MessageDetail < ApplicationRecord
belongs_to :message, :touch => true
validates :content, length: { maximum: 5000, too_long: "内容不能超过5000个字符" }
validates :content, length: { maximum: 10000, too_long: "内容不能超过10000个字符" }
end

@ -7,7 +7,7 @@ class StudentWorksScore < ApplicationRecord
has_many :tidings, as: :container, dependent: :destroy
has_many :attachments, as: :container, dependent: :destroy
validates :comment, length: { maximum: 1000, too_long: "不能超过1000个字符" }
validates :comment, length: { maximum: 2000, too_long: "不能超过2000个字符" }
scope :shixun_comment, lambda { where(is_ultimate: 0) }

@ -6,7 +6,7 @@ json.subject_score @subject.all_score
json.member_count @subject.member_count
json.allow_delete (@subject.status != 2 && @is_creator) || @user.admin?
json.publish_status publish_status(@subject, @is_manager, @user, @shixuns)
json.publish_status publish_status(@subject, @is_manager, @user)
json.allow_statistics @is_manager
json.allow_send @user.logged?
json.allow_visit @subject.status > 1 || @is_manager

@ -0,0 +1,6 @@
json.status 0
json.message "success"
json.data do
json.subject_info @subject.subject_record
json.other_info @data
end

@ -75,7 +75,7 @@ zh-CN:
reference_answer: '参考答案'
student_work:
description: '内容'
student_work_score:
student_works_score:
comment: '评语'
challenge_work_score:
comment: '评语'

@ -407,7 +407,7 @@ Rails.application.routes.draw do
get 'cancel_publish'
get 'cancel_has_publish'
get 'statistics'
get 'statistics_new'
get 'statistics_info'
get 'shixun_report'
get 'school_report'
post 'update_attr'

@ -1,6 +1,6 @@
class AddIndexForSubjectRecords < ActiveRecord::Migration[5.2]
def change
remove_index :subject_records, :subject_id
# remove_index :subject_records, :subject_id
add_index :subject_records, :subject_id, unique: true
end
end

@ -0,0 +1,50 @@
class Migrate3176ExerciseScore < ActiveRecord::Migration[5.2]
def calculate_student_score(exercise,user)
score5 = 0.0 #实训题
exercise_end_time = exercise.end_time
exercise_questions = exercise.exercise_questions.includes(:exercise_standard_answers,:exercise_shixun_challenges)
exercise_questions.each do |q|
if q.question_type == 5
q.exercise_shixun_challenges.each do |exercise_cha|
game = Game.user_games(user.id,exercise_cha.challenge_id)&.first #当前用户的关卡
if game.present?
exercise_cha_score = 0.0
answer_status = 0
# if game.status == 2 && game.final_score >= 0
if game.final_score > 0 && (game.end_time.nil? || game.end_time < exercise_end_time)
exercise_cha_score = game.real_score(exercise_cha.question_score)
# exercise_cha_score = exercise_cha.question_score #每一关卡的得分
answer_status = 1
end
ex_shixun_answer_content = exercise_cha.exercise_shixun_answers.find_by(user_id:user.id,exercise_question_id:q.id)
if ex_shixun_answer_content.present? && !(ex_shixun_answer_content.score >0) #把关卡的答案存入试卷的实训里
ex_shixun_answer_content.update_attributes!(score:exercise_cha_score.round(1),status:answer_status)
end
score5 += exercise_cha_score
else
score5 += 0.0
end
end
end
end
score5
end
def change
exercise = Exercise.find_by(id: 3176)
if exercise
exercise_users = exercise.exercise_users.where("start_at is not null")
exercise_users.each do |exercise_user|
calculate_score = calculate_student_score(exercise, exercise_user.user)
subjective_score = exercise_user.subjective_score
total_score_subjective_score = subjective_score < 0.0 ? 0.0 : subjective_score
total_score = calculate_score + total_score_subjective_score
if exercise_user.end_at.present?
exercise_user.update_attributes!(score:total_score,objective_score:calculate_score)
end
puts exercise_user.id
end
end
end
end

@ -0,0 +1,49 @@
class Migrate3517ExerciseScore < ActiveRecord::Migration[5.2]
def calculate_student_score(exercise,user)
score5 = 0.0 #实训题
exercise_end_time = exercise.end_time
exercise_questions = exercise.exercise_questions.includes(:exercise_standard_answers,:exercise_shixun_challenges)
exercise_questions.each do |q|
if q.question_type == 5
q.exercise_shixun_challenges.each do |exercise_cha|
game = Game.user_games(user.id,exercise_cha.challenge_id)&.first #当前用户的关卡
if game.present?
exercise_cha_score = 0.0
answer_status = 0
# if game.status == 2 && game.final_score >= 0
if game.final_score > 0 && (game.end_time.nil? || game.end_time < exercise_end_time)
exercise_cha_score = game.real_score(exercise_cha.question_score)
# exercise_cha_score = exercise_cha.question_score #每一关卡的得分
answer_status = 1
end
ex_shixun_answer_content = exercise_cha.exercise_shixun_answers.find_by(user_id:user.id,exercise_question_id:q.id)
if ex_shixun_answer_content.present? && !(ex_shixun_answer_content.score >0) #把关卡的答案存入试卷的实训里
ex_shixun_answer_content.update_attributes!(score:exercise_cha_score.round(1),status:answer_status)
end
score5 += exercise_cha_score
else
score5 += 0.0
end
end
end
end
score5
end
def change
exercise = Exercise.find_by(id: 3517)
if exercise
exercise_users = exercise.exercise_users.where("start_at is not null")
exercise_users.each do |exercise_user|
calculate_score = calculate_student_score(exercise, exercise_user.user)
subjective_score = exercise_user.subjective_score
total_score_subjective_score = subjective_score < 0.0 ? 0.0 : subjective_score
total_score = calculate_score + total_score_subjective_score
if exercise_user.end_at.present?
exercise_user.update_attributes!(score:total_score,objective_score:calculate_score)
end
puts exercise_user.id
end
end
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

@ -1269,7 +1269,7 @@ input.knowledge_frame{height:28px;line-height:28px;border:none;background:#f3f5f
.-relative { position: relative;}
.-bg-white { background-color: #eee;}
.split-panel.-handle .split-panel--second { padding-left: 2px;}
.split-panel--second { overflow: hidden;}
/* .split-panel--second { overflow: hidden;} */
.task-answer-view { position: absolute; top: 0; right: 0; bottom: 0;left: 0; display: flex;
flex-direction: column; border-top: 1px solid #515151;}
.-vertical { flex-direction: column;box-flex-direction: column;-webkit-flex-direction: column;}

@ -145,7 +145,7 @@ input.knowledge_frame{height:28px;line-height:28px;border:none;background:#f3f5f
.-relative { position: relative;}
.-bg-white { background-color: #eee;}
.split-panel.-handle .split-panel--second { padding-left: 2px;}
.split-panel--second { overflow: hidden;}
/* .split-panel--second { overflow: hidden;} */
.task-answer-view { position: absolute; top: 0; right: 0; bottom: 0;left: 0; display: flex;
flex-direction: column; border-top: 1px solid #515151;}
.-vertical { flex-direction: column;box-flex-direction: column;-webkit-flex-direction: column;}

@ -42,14 +42,14 @@ if (isDev) {
// 老师
//debugType="teacher";
// 学生
debugType="student";
//debugType="student";
function railsgettimes(proxy) {
if(timestamp&&checkSubmitFlg===false){
$.ajax({url:proxy,async:false,success:function(data){
if(data.status===0){
timestamp=data.data.t;
timestamp=data.message;
}
}})
checkSubmitFlg=true
@ -59,7 +59,7 @@ debugType="student";
}else if(checkSubmitFlg===false){
$.ajax({url:proxy,async:false,success:function(data){
if(data.status===0){
timestamp=data.data.t;
timestamp=data.message;
}
}})
checkSubmitFlg=true
@ -127,7 +127,8 @@ export function initAxiosInterceptors(props) {
if (window.location.port === "3007") {
// let timestamp=railsgettimes(proxy);
// console.log(timestamp)
railsgettimes(`http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp`);
// `https://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp`
railsgettimes( `${proxy}/api/main/first_stamp.json`);
let newopens=md5(opens+timestamp)
config.url = `${proxy}${url}`;
if (config.url.indexOf('?') == -1) {
@ -137,7 +138,9 @@ export function initAxiosInterceptors(props) {
}
} else {
// 加api前缀
railsgettimes(`http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp`);
// railsgettimes(`http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp`);
railsgettimes( `/api/main/first_stamp.json`);
let newopens=md5(opens+timestamp)
config.url = url;
if (config.url.indexOf('?') == -1) {

@ -79,20 +79,26 @@ let newtimestamp;
let checkSubmitFlgs = false;
function railsgettimess(proxy) {
if(checkSubmitFlgs===false){
$.ajax({url:proxy,async:false,success:function(data){
$.ajax({url:proxy,
async:false,success:function(data){
if(data.status===0){
newtimestamp=data.data.t;
newtimestamp=data.message;
checkSubmitFlgs = true;
}
}})
checkSubmitFlgs=true
window.setTimeout(function () {
checkSubmitFlgs=false;
}, 2500);
}
}
export function Railsgettimes() {
railsgettimess(`http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp`);
railsgettimess(`${getUrl()}/api/main/first_stamp.json`);
// railsgettimess(`https://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp`);
}
export function getUploadActionUrl(path, goTest) {
@ -120,7 +126,7 @@ export function getUploadActionUrlOfAuth(id) {
}
export function getRandomNumber(type) {
Railsgettimes()
Railsgettimes()
let anewopens=md5(newopens+newtimestamp);
return type===true?`randomcode=${newtimestamp}&client_key=${anewopens}`:`?randomcode=${newtimestamp}&client_key=${anewopens}`
}

@ -1,5 +1,5 @@
import React,{ Component } from "react";
import { ConditionToolTip } from 'educoder'
import { ConditionToolTip,getRandomNumber } from 'educoder'
class AttachmentsList extends Component{
constructor(props){
@ -17,7 +17,7 @@ class AttachmentsList extends Component{
<i className="font-14 color-green iconfont icon-fujian mr8"></i>
</a>
<ConditionToolTip title={item.title} condition={item.title && item.title.length > 30 }>
<a href={item.url} className="mr12 fl task-hide" length="58" target={ item.is_pdf && item.is_pdf == true ? "_blank" : "_self" } style={{"maxWidth":"432px"}}>{item.title}</a>
<a href={item.url+getRandomNumber()} className="mr12 fl task-hide" length="58" target={ item.is_pdf && item.is_pdf == true ? "_blank" : "_self" } style={{"maxWidth":"432px"}}>{item.title}</a>
</ConditionToolTip>
<span className="color-grey mt2 color-grey-6 font-12">{item.filesize}</span>
</p>

@ -3,22 +3,23 @@
// export { default as OrderStateUtil } from '../routes/Order/components/OrderStateUtil';
export { getImageUrl as getImageUrl, getRandomNumber as getRandomNumber,getUrl as getUrl, publicSearchs as publicSearchs,getRandomcode as getRandomcode,getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl
, getUploadActionUrl as getUploadActionUrl,getUploadActionUrltwo as getUploadActionUrltwo ,getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth
, getTaskUrlById as getTaskUrlById, TEST_HOST ,htmlEncode as htmlEncode ,getupload_git_file as getupload_git_file} from './UrlTool';
, getUploadActionUrl as getUploadActionUrl,getUploadActionUrltwo as getUploadActionUrltwo ,getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth
, getTaskUrlById as getTaskUrlById, TEST_HOST ,htmlEncode as htmlEncode ,getupload_git_file as getupload_git_file} from './UrlTool';
export {setmiyah as setmiyah} from './Component';
export { default as queryString } from './UrlTool2';
export { SnackbarHOC as SnackbarHOC } from './SnackbarHOC';
export { trigger as trigger, on as on, off as off
, broadcastChannelPostMessage, broadcastChannelOnmessage } from './EventUtil';
, broadcastChannelPostMessage, broadcastChannelOnmessage } from './EventUtil';
export { updatePageParams as updatePageParams } from './RouterUtil';
export { bytesToSize as bytesToSize } from './UnitUtil';
export { markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll, isImageExtension,
downloadFile, sortDirections } from './TextUtil'
downloadFile, sortDirections } from './TextUtil'
export { handleDateString, getNextHalfHourOfMoment,formatDuring } from './DateUtil'
export { configShareForIndex, configShareForPaths, configShareForShixuns, configShareForCourses, configShareForCustom } from './util/ShareUtil'
@ -30,7 +31,7 @@ export { toStore as toStore, fromStore as fromStore } from './Store'
export { trace_collapse, trace, debug, info, warn, error, trace_c, debug_c, info_c, warn_c, error_c } from './LogUtil'
export { EDU_ADMIN, EDU_BUSINESS, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER
, EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL} from './Const'
, EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL} from './Const'
export { default as AttachmentList } from './components/attachment/AttachmentList'

@ -222,7 +222,8 @@ function QuillForEditor ({
const current = value
if (!deepEqual(previous, current)) {
setSelection(quill.getSelection())
if (typeof value === 'string') {
if (typeof value === 'string' && value) {
// debugger
quill.clipboard.dangerouslyPasteHTML(value, 'api');
if (autoFocus) {
quill.focus();

@ -32,7 +32,7 @@ import _ from 'lodash'
import TPIContext from './TPIContext'
import { EDU_ADMIN, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER
, EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL, EDU_BUSINESS, CNotificationHOC } from 'educoder'
, EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL, EDU_BUSINESS, CNotificationHOC ,getRandomNumber} from 'educoder'
import { MuiThemeProvider, createMuiTheme, withStyles } from 'material-ui/styles';
import MUIDialogStyleUtil from '../modules/page/component/MUIDialogStyleUtil'
@ -176,7 +176,7 @@ class TPIContextProvider extends Component {
testPath = 'http://test-newweb.educoder.net'
}
// var url = `${testPath}/api/v1/games/${ game.identifier }/cost_time`
var url = `${testPath}/api/tasks/${ game.identifier }/cost_time`
var url = `${testPath}/api/tasks/${ game.identifier }/cost_time${getRandomNumber()}`
window.$.ajax({
type: 'get',
url: url,

@ -1,6 +1,6 @@
import React, { Component } from 'react';
import {Button,Layout,Tabs,Icon, Card, Avatar, Row, Col ,Table,Badge} from 'antd';
import {markdownToHTML,getImageUrl} from 'educoder';
import {markdownToHTML,getImageUrl,getRandomNumber} from 'educoder';
import axios from 'axios';
const { Content } = Layout;
@ -69,7 +69,7 @@ class CompetitionContents extends Component{
const operations = <div>
<Button className={"fr"} type="primary" ghost onClick={()=>this.props.Competitionedit()}>编辑</Button>
<Button className={"fr mr20"} type="primary" ghost>
<a onClick={()=>this.derivefun(`/competitions/${this.props.match.params.identifier}/charts.xlsx`)}>导出</a>
<a onClick={()=>this.derivefun(`/competitions/${this.props.match.params.identifier}/charts.xlsx?${getRandomNumber(true)}`)}>导出</a>
</Button>
</div>
const columns = [

@ -1,10 +1,10 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import { getRandomNumber } from 'educoder';
import {Link} from 'react-router-dom';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import { WordsBtn, MarkdownToHtml, trigger, queryString, downloadFile } from 'educoder';
import { WordsBtn, MarkdownToHtml, trigger, queryString, getRandomcode } from 'educoder';
import axios from 'axios';
import CoursesListType from '../coursesPublic/CoursesListType';
import AccessoryModal from "../coursesPublic/AccessoryModal";
@ -125,7 +125,7 @@ class CommonWorkDetailIndex extends Component{
})
}
}else {
this.props.slowDownload(url)
this.props.slowDownload(getRandomcode(url))
// this.props.showNotification(`正在下载中`);
// this.setState({ donwloading: true })
@ -221,7 +221,7 @@ class CommonWorkDetailIndex extends Component{
// console.log(params);
let exportUrl = `/homework_commons/${workId}/works_list.zip?${queryString.stringify(params)}`
let exportResultUrl = `/homework_commons/${workId}/works_list.xlsx?${queryString.stringify(params)}`
document.title=course_name === undefined ? "" : course_name;
document.title=course_name === undefined ? "" : course_name;
return (
<div>
<PublishRightnow ref={this.publishModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}

@ -978,10 +978,8 @@ class CommonWorkSetting extends Component{
let exportUrl = `/api/homework_commons/${workId}/works_list.zip`
const exportResultUrl = `/api/homework_commons/${workId}/works_list.xlsx`
const noAuth = !isAdmin || !startEditFlag;
return(
return(
<React.Fragment>
<Modals
modalsType={Modalstype}
@ -1222,7 +1220,7 @@ class CommonWorkSetting extends Component{
<Checkbox className="ml30" checked={anonymous_comment} onChange={this.anonymous_comment_change}
disabled={noAuth || moment(init_evaluation_start) < moment()}
>启用匿评</Checkbox>
<span className={"font-14 color-grey-9"}>作品数量2可以开启匿评</span>
<span className={"font-14 color-grey-9"}>{this.state.category&&this.state.category.category_name==="普通作业"?"作品数量≥2个可以开启匿评":"提交作品的分组数量≥2个可以开启匿评"}</span>
</div>
{/* 开启时间 */}
<div className={"h20 mb30 ml60"}>

@ -1,7 +1,7 @@
import React,{Component} from "react";
import { Form, Select, Input, Button,Checkbox,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip} from "antd";
import {Link} from 'react-router-dom';
import { WordsBtn, MarkdownToHtml } from 'educoder';
import { WordsBtn, getRandomcode } from 'educoder';
import axios from 'axios';
import PublishRightnow from '../PublishRightnow'
import AccessoryModal from "../../coursesPublic/AccessoryModal";
@ -44,7 +44,7 @@ class TabRightComponents extends Component{
}
/// 确认是否下载
confirmysl(url){
axios.get(url + '?export=true' ).then((response) => {
axios.get(url + '&export=true' ).then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
@ -63,7 +63,7 @@ class TabRightComponents extends Component{
})
}
}else {
this.props.slowDownload(url);
this.props.slowDownload(getRandomcode(url));
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
}
@ -108,9 +108,8 @@ class TabRightComponents extends Component{
const isAdmin = this.props.isAdmin()
const isSuperAdmin = this.props.isSuperAdmin()
let exportUrl = `/api/homework_commons/${workId}/works_list.zip`
const exportResultUrl = `/api/homework_commons/${workId}/works_list.xlsx`
let exportUrls = `/api/homework_commons/${workId}/works_list.zip`
const exportResultUrls = `/api/homework_commons/${workId}/works_list.xlsx`
return(
<React.Fragment>
{isAdmin ?
@ -150,8 +149,8 @@ class TabRightComponents extends Component{
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mt20" style={{"padding":"0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a onClick={(url)=>this.confirmysl(exportResultUrl)} className="color-dark">导出成绩</a></li>
<li><a onClick={(url)=>this.confirmysl(exportUrl)} className="color-dark">导出作品附件</a></li>
<li><a onClick={(url)=>this.confirmysl(exportResultUrls)} className="color-dark">导出成绩</a></li>
<li><a onClick={(url)=>this.confirmysl(exportUrls)} className="color-dark">导出作品附件</a></li>
</ul>
</li>:""}

@ -1,6 +1,6 @@
import React, { Component } from 'react';
import {Button,Layout,Tabs,Icon, Card, Avatar, Row, Col ,Table,Badge} from 'antd';
import {markdownToHTML,getImageUrl} from 'educoder';
import {markdownToHTML,getImageUrl,getRandomNumber} from 'educoder';
import axios from 'axios';
const { Content } = Layout;
@ -69,7 +69,7 @@ class CompetitionContents extends Component{
const operations = <div>
<Button className={"fr"} type="primary" ghost onClick={()=>this.props.Competitionedit()}>编辑</Button>
<Button className={"fr mr20"} type="primary" ghost>
<a onClick={()=>this.derivefun(`/competitions/${this.props.match.params.identifier}/charts.xlsx`)}>导出</a>
<a onClick={()=>this.derivefun(`/competitions/${this.props.match.params.identifier}/charts.xlsx?${getRandomNumber(true)}`)}>导出</a>
</Button>
</div>
const columns = [

@ -549,6 +549,10 @@ class Coursesleftnav extends Component{
window.location.href=`/courses/${coursesId}/boards/${result.data.category_id}`;
}
if(positiontype!="course_groups"){
this.updasaveNavmoda()
}
if(positiontype==="course_groups"){
window.location.href=`/courses/${coursesId}/course_groups/${result.data.group_id}`;
}

@ -1,7 +1,7 @@
import React,{ Component } from "react";
import {Checkbox,Input,Table, Pagination,Menu,Spin} from "antd";
import {Link,NavLink} from 'react-router-dom';
import { WordsBtn ,ActionBtn,queryString,getRandomcode} from 'educoder';
import { WordsBtn ,getRandomNumber,queryString,getRandomcode} from 'educoder';
import CoursesListType from '../coursesPublic/CoursesListType';
import '../css/members.css';
import '../css/busyWork.css';
@ -175,9 +175,9 @@ class Testpapersettinghomepage extends Component{
if(child!=undefined){
params =child._getRequestParams()!==undefined?child._getRequestParams():{};
}
console.log("170");
console.log(params);
const urll=url+`?${queryString.stringify(params)}`;
const urll=url+`?${queryString.stringify(params)}`;
axios.get(urll+ '&export=true').then((response) => {
if(response===undefined){
return
@ -200,7 +200,7 @@ class Testpapersettinghomepage extends Component{
})
}
}else {
this.props.slowDownload(urll)
this.props.slowDownload(getRandomcode(urll))
// this.setState({ donwloading: true })
// downloadFile({
// url: urll,

@ -32,8 +32,8 @@ class Bullsubdirectory extends Component{
}
componentDidMount() {
console.log("获取到数据");
console.log(this.props);
// console.log("获取到数据");
// console.log(this.props);
let{id,myname,mydescription,index,item} =this.props
this.props.form.setFieldsValue({
id:id,

@ -30,8 +30,8 @@ class Eduinforms extends Component{
}
componentDidMount() {
console.log("Eduinformss");
console.log("获取到数据");
// console.log("Eduinformss");
// console.log("获取到数据");
// console.log(this.props);
const query = this.props.location.search;
// const type = query.split('?chinaoocTimestamp=');

@ -1,5 +1,5 @@
import React, { Component } from 'react';
import {getRandomNumber,queryString} from 'educoder';
import {getRandomNumber} from 'educoder';
import {Link} from 'react-router-dom';
import {Tooltip,Menu} from 'antd';
import Loadable from 'react-loadable';
@ -313,15 +313,18 @@ class GraduationTaskDetail extends Component{
}
CodeReview=()=>{
let newgetRandomNumber=getRandomNumber(true);
console.log(newgetRandomNumber)
this.props.showNotification("正在导出中...");
if(newgetRandomNumber){
const task_Id = this.props.match.params.task_Id;
window.open(`/api/graduation_tasks/${task_Id}/sonar?
${this.state.taskdatas.teacher_comment===undefined||this.state.taskdatas.teacher_comment===null?"":"teacher_comment="+this.state.taskdatas.teacher_comment}
${this.state.taskdatas.task_status===undefined||this.state.taskdatas.task_status===null?"":"&task_status="+this.state.taskdatas.task_status}
${this.state.taskdatas.course_group===undefined||this.state.taskdatas.course_group===null?"":"&course_group="+this.state.taskdatas.course_group}
${this.state.taskdatas.cross_comment===undefined||this.state.taskdatas.cross_comment===null?"":"&cross_comment="+this.state.taskdatas.cross_comment}
${this.state.taskdatas.search===undefined||this.state.taskdatas.search===null?"":"&search="+this.state.taskdatas.search+"&"}${getRandomNumber(true)}`)
${this.state.taskdatas.teacher_comment===undefined||this.state.taskdatas.teacher_comment===null?"":"teacher_comment="+this.state.taskdatas.teacher_comment+"&"}
${this.state.taskdatas.task_status===undefined||this.state.taskdatas.task_status===null?"":"task_status="+this.state.taskdatas.task_status+"&"}
${this.state.taskdatas.course_group===undefined||this.state.taskdatas.course_group===null?"":"course_group="+this.state.taskdatas.course_group+"&"}
${this.state.taskdatas.cross_comment===undefined||this.state.taskdatas.cross_comment===null?"":"cross_comment="+this.state.taskdatas.cross_comment+"&"}
${this.state.taskdatas.search===undefined||this.state.taskdatas.search===null?"":"search="+this.state.taskdatas.search+"&"}${newgetRandomNumber}`)
}
}
getsonars=(teacher_comment,task_status,course_group,cross_comment,search)=>{
@ -519,8 +522,8 @@ class GraduationTaskDetail extends Component{
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mt20" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.child.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">导出成绩</a></li>
<li><a onClick={()=>this.child.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">导出作品附件</a></li>
<li><a onClick={()=>this.child.confirmysl(`/graduation_tasks/${task_Id}/tasks_list.xlsx`)} className="color-dark">导出成绩</a></li>
<li><a onClick={()=>this.child.confirmysl(`/graduation_tasks/${task_Id}/tasks_list.zip`)} className="color-dark">导出作品附件</a></li>
</ul>
</li>:""}
{questionslist.work_status===undefined||questionslist.work_status===null||questionslist.work_status.length===0?"":questionslist.work_status.map((item,key)=>{

@ -20,7 +20,8 @@ class GraduationTasksappraiseMainEditor extends Component{
score: undefined,
same_score: false,
errorMessage: '',
numberErrorMessage: ''
numberErrorMessage: '',
errorMessagetype:false
}
}
onSubmit = () => {
@ -31,11 +32,20 @@ class GraduationTasksappraiseMainEditor extends Component{
return item.response ? item.response.id : item.id
})
const comment = this.mdRef.current.getValue()
if ((!comment || comment.trim() == "") && !score) {
if ((!comment || comment.trim() == "") && !score &&this.props.isAdmin()===true) {
this.setState( {errorMessage : '分数和评语不能同时为空' })
// this.props.showNotification('请先输入评阅说明')
return;
}
if (!score && this.props.isAdmin()===false) {
this.setState( {
errorMessage : '分数不能为空',
errorMessagetype:true
})
// this.props.showNotification('请先输入评阅说明')
return;
}
if (comment.length > 2000) {
this.setState( {errorMessage : '不能超过2000个字符' })
// this.props.showNotification('评阅说明文本长度不能超过2000')
@ -136,6 +146,12 @@ class GraduationTasksappraiseMainEditor extends Component{
});
}
onScoreChange = (val) => {
if(val){
this.setState( {
errorMessage: '',
errorMessagetype:false
})
}
if (val > 100 ) {
this.props.showNotification('不能大于100')
this.setState({ score: 100 })
@ -157,7 +173,7 @@ class GraduationTasksappraiseMainEditor extends Component{
this.setState({ same_score: e.target.checked }) //!this.state.same_score
}
render(){
let { total_count, comments, pageCount, fileList, score, same_score, errorMessage, numberErrorMessage } = this.state
let { total_count, comments, errorMessagetype, fileList, score, same_score, errorMessage, numberErrorMessage } = this.state
const { current_user, memo, showSameScore, placeholder } = this.props
const isAdmin = this.props.isAdmin()
const commentUploadProp = {
@ -209,7 +225,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' : ''} imageExpand={true}></TPMMDEditor>
watch={false} height={160} className={errorMessage&&errorMessagetype!=true ? '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>

@ -2,7 +2,7 @@ import React,{Component} from "react";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip} from "antd";
import {Link} from 'react-router-dom';
import locale from 'antd/lib/date-picker/locale/zh_CN';
import { WordsBtn,getUrl ,handleDateString} from 'educoder';
import { WordsBtn,getRandomcode ,handleDateString} from 'educoder';
import axios from 'axios';
import Modals from '../../../modals/Modals';
import DownloadMessageysl from "../../../modals/DownloadMessageysl";
@ -870,9 +870,8 @@ class GraduationTaskssettingapp extends Component{
}
/// 确认是否下载
confirmysl(url){
debugger;
console.log(3);
confirmysl(url,urls){
axios.get(url + '?export=true' ).then((response) => {
if(response === undefined){
return
@ -895,8 +894,10 @@ class GraduationTaskssettingapp extends Component{
})
}
}else {
this.props.slowDownload(url)
// this.props.showNotification(`正在下载中`);
this.props.slowDownload(getRandomcode(url))
// window.open(getRandomcode("/api" + url), '_blank');
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
}

@ -1,7 +1,7 @@
import React,{Component} from "react";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Pagination, Table, Divider, Tag,Tooltip} from "antd";
import {Link} from 'react-router-dom';
import {getImageUrl, NoneData, sortDirections} from 'educoder';
import {getImageUrl, NoneData, sortDirections,getRandomcode} from 'educoder';
import axios from 'axios';
import moment from 'moment';
import HomeworkModal from "../../coursesPublic/HomeworkModal";
@ -759,7 +759,7 @@ class GraduationTaskssettinglist extends Component{
})
}
}else {
this.props.slowDownload(url)
this.props.slowDownload(getRandomcode(url))
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');

@ -1,7 +1,7 @@
import React,{Component} from "react";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag} from "antd";
import {Link} from 'react-router-dom';
import { WordsBtn,markdownToHTML,AttachmentList} from 'educoder';
import { getRandomcode,markdownToHTML,AttachmentList} from 'educoder';
import axios from 'axios';
import Modals from '../../../modals/Modals';
import DownloadMessageysl from "../../../modals/DownloadMessageysl";
@ -214,9 +214,8 @@ class GraduationTasksquestions extends Component{
}
/// 确认是否下载
confirmysl(url){
debugger;
console.log(2);
confirmysl(url,urls){
axios.get(url + '?export=true').then((response) => {
if(response === undefined){
return
@ -239,8 +238,10 @@ class GraduationTasksquestions extends Component{
})
}
}else {
this.props.slowDownload(url)
// this.props.slowDownload(urls)
//this.props.showNotification(`正在下载中`);
this.props.slowDownload(getRandomcode(url))
// window.open(getRandomcode("/api" + url), '_blank');
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
}

@ -4,7 +4,7 @@ import {Checkbox, Menu, Pagination,Spin} from "antd";
import Titlesearchsection from '../../common/titleSearch/TitleSearchSection'
import DownloadMessageysl from "../../../modals/DownloadMessageysl";
import { WordsBtn ,getRandomcode} from 'educoder'
import { WordsBtn ,getRandomcode,getRandomNumber} from 'educoder'
import NoneData from '../../coursesPublic/NoneData'
import Modals from "../../../modals/Modals"
import axios from 'axios'
@ -335,7 +335,7 @@ onBoardsNew=()=>{
}
/// 确认是否下载
confirmysl(url){
axios.get(url + '?export=true').then((response) => {
axios.get(url + '&export=true').then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){

@ -1,6 +1,6 @@
import React, {Component} from "react";
import { WordsBtn,on, off, trigger,markdownToHTML,getImageUrl} from 'educoder';
import { WordsBtn,on, off, trigger,markdownToHTML,getRandomNumber} from 'educoder';
import {
Button,
Checkbox,
@ -23,7 +23,8 @@ class GroupPackage extends Component {
}
}
DownloadOpenPdf=(type,url)=>{
type===true?window.open(url):window.location.href=url;
let newurl=url+getRandomNumber();
type===true?window.open(newurl):window.location.href=newurl;
}
componentDidMount() {
console.log("Groupjobquesanswer");

@ -14,7 +14,7 @@ import CourseLayoutcomponent from '../common/CourseLayoutComponent'
import Titlesearchsection from '../common/titleSearch/TitleSearchSection'
import ColorCountText from '../common/titleSearch/ColorCountText'
import { WordsBtn, trigger, on, off, getUrl, downloadFile , sortDirections, NoneData } from 'educoder'
import { WordsBtn, trigger, on, off, getUrl, downloadFile , getRandomcode, NoneData } from 'educoder'
import Modals from "../../modals/Modals";
import DownloadMessageysl from "../../modals/DownloadMessageysl";
@ -83,7 +83,7 @@ function CourseGroupList(props) {
}
const confirmysl = (url) => {
axios.get(url + 'export=true').then((response) => {
axios.get(url + '&export=true').then((response) => {
if(response === undefined){
return
}
@ -100,7 +100,7 @@ function CourseGroupList(props) {
setDownloadMessageval(500)
}
}else {
props.slowDownload(url)
props.slowDownload(getRandomcode(url))
}
}).catch((error) => {
console.log(error)
@ -121,9 +121,9 @@ function CourseGroupList(props) {
const course_groups = listRes.course_groups
const current_group_id = listRes.current_group_id
let exportUrl = `/courses/${courseId}/export_member_scores_excel.xlsx?`; //总成绩
let exportUrltwo = `/courses/${courseId}/export_couser_info.xlsx?`; //课堂信息
let exportUrlthree = `/courses/${courseId}/export_member_act_score.xlsx?`; //活跃度
let exportUrl = `/courses/${courseId}/export_member_scores_excel.xlsx`; //总成绩
let exportUrltwo = `/courses/${courseId}/export_couser_info.xlsx`; //课堂信息
let exportUrlthree = `/courses/${courseId}/export_member_act_score.xlsx`; //活跃度
return (
<React.Fragment>
<DownloadMessageysl

@ -7,7 +7,7 @@ import CourseLayoutcomponent from '../common/CourseLayoutComponent'
import Titlesearchsection from '../common/titleSearch/TitleSearchSection'
import ColorCountText from '../common/titleSearch/ColorCountText'
import { WordsBtn, trigger, on, off, getUrl, downloadFile , sortDirections } from 'educoder'
import { WordsBtn, trigger, on, off, getRandomcode, getRandomNumber , sortDirections } from 'educoder'
import Modals from "../../modals/Modals";
import axios from 'axios'
import _ from 'lodash'
@ -199,7 +199,7 @@ class studentsList extends Component{
}
}
/// 确认是否下载
confirmysl(url){
confirmysl(url,urls){
// this.props.showGlobalLoading('正在生成文件,请稍后...')
axios.get(url + 'export=true').then((response) => {
if(response === undefined){
@ -226,7 +226,7 @@ class studentsList extends Component{
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
this.props.slowDownload(url)
this.props.slowDownload(getRandomcode(url))
// getUrl() + "/api"+
// const fileUrl = url;
@ -673,6 +673,8 @@ class studentsList extends Component{
let exportUrltwo = `/courses/${courseId}/export_couser_info.xlsx?`; //课堂信息
let exportUrlthree = `/courses/${courseId}/export_member_act_score.xlsx?`; //活跃度
const params = {}
if (course_group_id) {
params.group_id = course_group_id
@ -685,11 +687,13 @@ class studentsList extends Component{
}
let paramsString = ''
for (let key in params) {
paramsString += `${key}=${params[key]}&`
paramsString += `&${key}=${params[key]}&`
}
exportUrl += paramsString;
exportUrltwo+=paramsString;
exportUrlthree+=paramsString;
exportUrlthree += paramsString;
// console.log(paramsString);
// console.log(checkBoxValues);
// console.log(searchValue);
@ -815,6 +819,7 @@ class studentsList extends Component{
<li className="li_line drop_down fr color-blue font-16">
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right": "-20px", "left": "unset", "height": "auto"}}>
<li><a
onClick={(i) => this.confirmysl(exportUrltwo)}>课堂信息</a>
</li>
@ -824,6 +829,7 @@ class studentsList extends Component{
<li><a
onClick={(i) => this.confirmysl(exportUrl)}>总成绩</a>
</li>
</ul>
</li>
}

@ -3,7 +3,7 @@ import {Menu} from "antd";
import CoursesListType from '../coursesPublic/CoursesListType';
import { WordsBtn } from 'educoder'
import { WordsBtn,getRandomcode } from 'educoder'
import PollTabFirst from './PollDetailTabFirst'
import PollTabSecond from './PollDetailTabSecond'
import PollTabThird from './PollDetailTabThird'
@ -112,7 +112,7 @@ class PollDetailIndex extends Component{
/// 确认是否下载
confirmysl(url){
axios.get(url + '?export=true' ).then((response) => {
axios.get(url + '&export=true' ).then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
@ -131,7 +131,7 @@ class PollDetailIndex extends Component{
})
}
}else {
this.props.slowDownload(url)
this.props.slowDownload(getRandomcode(url))
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
@ -239,7 +239,7 @@ class PollDetailIndex extends Component{
</li>
:""
} */}
<a className="fl color-blue font-16" onClick={(url)=>this.confirmysl("/polls/"+this.props.match.params.pollId+"/commit_result.xlsx")} href="javascript:void(0);">导出统计</a>
<a className="fl color-blue font-16" onClick={(url)=>this.confirmysl(`/polls/${this.props.match.params.pollId}/commit_result.xlsx`)} href="javascript:void(0);">导出统计</a>
</span>
}
{

@ -1,6 +1,6 @@
import React, {Component} from "react";
import CoursesListType from '../coursesPublic/CoursesListType';
import {WordsBtn, publicSearchs, sortDirections} from 'educoder';
import {getRandomcode, publicSearchs, sortDirections} from 'educoder';
import {
Form,
Select,
@ -3389,7 +3389,7 @@ class Listofworksstudentone extends Component {
daochuzuoye = () => {
let url = `/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx?course_group=${this.state.checkedValuesineinfo === undefined || this.state.checkedValuesineinfo === null ? "" : this.state.checkedValuesineinfo}&work_status=${this.state.course_groupyslstwo === undefined || this.state.course_groupyslstwo === null ? "" : this.state.course_groupyslstwo}&search=${this.state.searchtext === undefined || this.state.searchtext === null ? "" : this.state.searchtext}`
this.confirmysl(url);
this.confirmysl(url);
}
@ -3418,7 +3418,7 @@ class Listofworksstudentone extends Component {
} else {
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
this.props.slowDownload(url);
this.props.slowDownload(getRandomcode(url));
}
}).catch((error) => {
console.log(error)

@ -1,6 +1,6 @@
import React, {Component} from "react";
import CoursesListType from '../coursesPublic/CoursesListType';
import {WordsBtn, getRandomcode, sortDirections} from 'educoder';
import {getRandomNumber, getRandomcode, sortDirections} from 'educoder';
import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal";
@ -599,7 +599,7 @@ class ShixunStudentWork extends Component {
}
confirmysl(url){
axios.get(url + '?export=true').then((response) => {
axios.get(url + '&export=true').then((response) => {
if(response === undefined){
return
}

@ -1,7 +1,7 @@
import React, {Component} from "react";
import CoursesListType from '../coursesPublic/CoursesListType';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import {WordsBtn, getRandomcode, handleDateString, getImageUrl} from 'educoder';
import {getRandomNumber, getRandomcode, handleDateString, getImageUrl} from 'educoder';
import PollDetailTabForthRules from '../poll/PollDetailTabForthRules';
import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal';
import {
@ -2252,16 +2252,16 @@ class Trainingjobsetting extends Component {
daochushixunbaogao = () => {
let url = `/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`;
this.confirmysl(url, url + '&export=true');
this.confirmysl(url,true) ;
}
daochuzuoye = () => {
let url = `/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`;
this.confirmysl(url, url + '?export=true');
this.confirmysl(url,true);
}
confirmysl(url, urlWithExport) {
axios.get(urlWithExport).then((response) => {
axios.get(url+`?export=true`).then((response) => {
if (response === undefined) {
return
}
@ -2285,6 +2285,7 @@ class Trainingjobsetting extends Component {
} else {
this.props.showNotification(`正在下载中`);
window.open(getRandomcode("/api" + url), '_blank');
}
}).catch((error) => {
console.log(error)

@ -1,6 +1,6 @@
import React, {Component} from "react";
import CoursesListType from '../coursesPublic/CoursesListType';
import {WordsBtn, getRandomcode, markdownToHTML} from 'educoder';
import {getRandomNumber, getRandomcode, markdownToHTML} from 'educoder';
import {
Form,
Select,
@ -381,12 +381,12 @@ class Workquestionandanswer extends Component {
daochushixunbaogao=()=>{
let url =`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`;
this.confirmysl(url, url + '&export=true');
this.confirmysl(url, url + `&export=true`);
}
daochuzuoye =() =>{
let url = `/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`;
this.confirmysl(url, url + '?export=true');
this.confirmysl(url, url + `?export=true`);
}
confirmysl(url, urlWithExport){

@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from "prop-types";
import { Link } from 'react-router-dom';
import {getRandomNumber} from 'educoder';
import { Spin, Button, Input, Divider, Icon, Tooltip, Form, message, Modal } from 'antd';
import axios from 'axios';
import _ from 'lodash'
@ -233,7 +234,7 @@ class GraduationRequirement extends React.Component {
<Link to="/forums/3530" target="_blank" className="link ml10">查看详情</Link>
</div>
</div>
<a href={`/api/ec_years/${this.props.yearId}/ec_graduation_requirements.xlsx`} target="_blank" className="ant-btn ant-btn-primary color-white">导出毕业要求</a>
<a href={`/api/ec_years/${this.props.yearId}/ec_graduation_requirements.xlsx${getRandomNumber()}`} target="_blank" className="ant-btn ant-btn-primary color-white">导出毕业要求</a>
</div>
<Divider/>

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import classNames from 'classnames'
import {getRandomNumber} from 'educoder';
import axios from 'axios';
import { Table, Divider, Tag, Checkbox, InputNumber, Spin, Icon } from 'antd';
@ -140,7 +140,7 @@ class RequirementVsObjective extends Component {
</p>
</li>
<a href={`/api/ec_years/${this.props.yearId}/requirement_support_objectives.xlsx`} target="_blank"
<a href={`/api/ec_years/${this.props.yearId}/requirement_support_objectives.xlsx${getRandomNumber()}`} target="_blank"
className="ant-btn ant-btn-primary color-white fr mt20">导出矩阵</a>
</ul>
<div className="padding20-30" style={{ background: '#fff' }}>

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import classNames from 'classnames'
import {getRandomNumber} from 'educoder'
import axios from 'axios';
import { Table, Divider, Tag, Checkbox, InputNumber, Spin, Icon } from 'antd';
@ -109,7 +109,7 @@ class RequirementVsObjective extends Component {
</p>
</li>
<a href={`/api/ec_years/${this.props.yearId}/subitem_support_standards.xlsx`} target="_blank"
<a href={`/api/ec_years/${this.props.yearId}/subitem_support_standards.xlsx${getRandomNumber()}`} target="_blank"
className="ant-btn ant-btn-primary color-white fr mt20">导出矩阵</a>
</ul>
<div className="padding20-30" style={{ background: '#fff' }}>

@ -2,6 +2,7 @@ import React from 'react';
import PropTypes from "prop-types";
import { Link } from 'react-router-dom';
import { Spin, Button, Input, Divider, Icon, Tooltip, Form, message } from 'antd';
import {getRandomNumber} from 'educoder';
import axios from 'axios';
import './index.scss';
@ -157,7 +158,7 @@ class TrainingObjective extends React.Component {
<Link to="/forums/3529" target="_blank" className="link ml10">查看详情</Link>
</div>
</div>
<a href={`/api/ec_years/${this.props.yearId}/ec_training_objectives.xlsx`} target="_blank" className="ant-btn ant-btn-primary color-white">导出培养目标</a>
<a href={`/api/ec_years/${this.props.yearId}/ec_training_objectives.xlsx${getRandomNumber()}`} target="_blank" className="ant-btn ant-btn-primary color-white">导出培养目标</a>
</div>
<Divider/>

@ -1,6 +1,8 @@
import React, { Component } from 'react';
import classNames from 'classnames'
import classNames from 'classnames';
import {getRandomNumber} from 'educoder';
import axios from 'axios';
@ -687,7 +689,7 @@ class GraduatesRequirement extends Component {
<a href="javascript:void(0)"
class="white-btn edu-orangeback-btn fr mr10"
href={`/api/ec_years/${this.state.ec_year_id}/reach_evaluation.xlsx`}
href={`/api/ec_years/${this.state.ec_year_id}/reach_evaluation.xlsx${getRandomNumber()}`}
>导出</a>
{/* /ec_major_schools/3/academic_years/5/export_reach_requirements_data.xls
let major_school_id =this.props.match.params.major_school_id;

@ -1,23 +1,13 @@
import React, { Component } from 'react';
import classNames from 'classnames'
import axios from 'axios';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { SnackbarHOC } from 'educoder'
import { message,Modal,Spin,Icon} from 'antd';
import {getRandomNumber} from 'educoder';
import 'antd/dist/antd.css';
import EcTitleCourseEvaluations from '../ecTitle/ecTitle'
import '../css/ecCourseSupports.css';
import '../css/ecCourseEvaluations.css';
import {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom';
@ -223,7 +213,7 @@ class Curriculum extends Component {
titine===5?
<span>
<span className={ismanager===false?"none":""} style={{top: "26px"}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10 mt9" target="_blank" href={`/ec_courses/${ec_course_id}/course_targets.xlsx`}>导出评价详情</a>
<a className="white-btn edu-blueback-btn fr mb10 mr10 mt9" target="_blank" href={`/ec_courses/${ec_course_id}/course_targets.xlsx${getRandomNumber()}`}>导出评价详情</a>
</span>
<span className={ismanager===false?"none":"right newrightcalculatebuttons fr mb10 mr20 "}
onClick={()=>this.newrightcalculatebuttonysl(this.child)}>计算</span>

@ -845,7 +845,7 @@ class MemoDetail extends Component {
</div>
:
<div className="memoMore">
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论1</div>
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
</div>}
</div>

@ -1,3 +1,4 @@
import './header.scss';
import React, { Component } from 'react';
import Button from 'material-ui/Button';
@ -120,9 +121,11 @@ class Header extends Component {
<div className="headerRight">
<div className="fr">
{shixun ?
<a href={`/shixuns/${shixun.identifier}/challenges`} className="mr20 mt8 exitBtn" >
// className="mr20 mt8 exitBtn"
<a href={`/shixuns/${shixun.identifier}/challenges`} className="mr20 mt8 exit_btn">
<i className="fa fa-power-off font-16"></i>
<span>{'退出闯关'}</span>
{/* <span>{'退出闯关'}</span> */}
<span>{'退出实训'}</span>
</a>
: ''}
</div>

@ -338,6 +338,33 @@ class VNCContainer extends Component {
.float_button:hover .text {
color: #4CACFF;
}
.resetVNC1{
top: -50px;
writing-mode: initial;
left: calc(100% - 230px);
background-image: none;
width: auto;
// background: #081516;
height: 30px;
padding: 0 6px;
border-radius: 4px;
z-index: 10;
font-size: 16px;
transition: color .3s;
}
.resetVNC1 .text {
top: 0px;
writing-mode: initial;
left: unset;
}
.resetVNC1 .text span {
vertical-align: middle;
margin-left: 2px;
}
.float_button:hover .text {
transition: color .3s;
color: #4CACFF;
}
`}</style>
<div style={{ 'padding': '16px', 'border-bottom': '1px solid #3A383A' }}>
<div style={{ color: '#888888' }}>网址克隆</div>
@ -354,11 +381,15 @@ class VNCContainer extends Component {
></RepoTree>
</SecondDrawer>
<FloatButton className="resetVNC" onClick={this.onResetVNC}>
{/* <i className="iconfont icon-zhongzhi2 font-16 "></i> */}
{/* <FloatButton className="resetVNC" onClick={this.onResetVNC}>
{this.state.vnc_reseting ? <Icon type="loading" style={{verticalAlign: 'sub'}} />
: <i className="iconfont icon-zhongzhi2 font-16 "></i>}
<span>重置桌面系统</span>
</FloatButton> */}
<FloatButton className="resetVNC1" onClick={this.onResetVNC}>
{this.state.vnc_reseting ? <Icon type="loading" style={{verticalAlign: 'sub'}} />
: <i className="iconfont icon-zhongzhi2 font-24"></i>}
<span>重置实训</span>
</FloatButton>
{/* <Spin tip="..." spinning={this.state.vnc_reseting}>

@ -166,7 +166,8 @@ class VNCDisplay extends Component {
`}</style>
<div id="top_bar">
<div id="status">Loading</div>
<div id="sendCtrlAltDelButton">Send CtrlAltDel</div>
{/* <div id="sendCtrlAltDelButton">Send CtrlAltDel</div> */}
<div id="sendCtrlAltDelButton" style={{ opacity: 0, display: 'none' }}></div>
</div>
<div id="screen" style={{ height: 'calc(100vh - 140px)' }}>

@ -0,0 +1,6 @@
.headerRight .exit_btn{
color: rgba(237,237,237,1);
&:hover{
// color: #fff;
}
}

@ -14,6 +14,7 @@ import passpartImg from '../../../images/tpi/passpart.png'
import empiricgreenImg from '../../../images/tpi/empiricgreen.png'
import { trigger } from 'educoder';
import SecondTab from "../../paths/SchoolStatistics/SecondTab";
class TaskResultLayer extends Component {
@ -177,7 +178,15 @@ class TaskResultLayer extends Component {
</p>
</div>
<div className="winPanel">
<style>
{
`
.page--body{
z-index: 0 !important;
}
`
}
</style>
<div className="cl"></div>
{ !game.star ?
<React.Fragment>

@ -120,8 +120,10 @@ button.buttonHoverColor:hover a {
#myshixun_top {
display: flex;
height: 54px;
display: flex;
position: fixed;
height: 54px;
z-index: 1 !important;
}
.headerLeft {
flex: 0 0 400px;

@ -97,7 +97,7 @@ class NewMyShixunModel extends Component {
}
setsub_discipline_id=(sub_discipline_id)=>{
setsub_discipline_id=(discipline_id,sub_discipline_id)=>{
this.setState({
sub_discipline_id:sub_discipline_id,
tag_discipline_id:null,
@ -107,7 +107,7 @@ class NewMyShixunModel extends Component {
oj_status:null
})
var data = {
discipline_id:this.state.discipline_id,
discipline_id:discipline_id,
sub_discipline_id:sub_discipline_id,
tag_discipline_id:null,
public: this.state.defaultActiveKey,
@ -161,8 +161,8 @@ class NewMyShixunModel extends Component {
this.callback(defaultActiveKeys);
let url = `/users/get_navigation_info.json`;
axios.get(url, {}).then((response) => {
// ////console.log("开始请求/get_navigation_info.json");
// ////console.log(response);
// //////console.log("开始请求/get_navigation_info.json");
// //////console.log(response);
if (response != undefined) {
if (response.status === 200) {
this.setState({
@ -180,8 +180,8 @@ class NewMyShixunModel extends Component {
axios.get(urls, {params: {
source:"question"
}}).then((response) => {
console.log("Questiondisciplines");
console.log(response.data);
//console.log("Questiondisciplines");
//console.log(response.data);
if (response) {
this.setState({
disciplinesdata: response.data.disciplines,
@ -254,15 +254,15 @@ class NewMyShixunModel extends Component {
} else {
}
////console.log("item_banks");
////console.log(response);
//////console.log("item_banks");
//////console.log(response);
this.setState({
Contentdata: response.data,
items_count: response.data.items_count,
})
this.getdataslen(response.data.items);
}).catch((error) => {
////console.log(error)
//////console.log(error)
this.setState({
booljupyterurls:false,
})
@ -288,8 +288,8 @@ class NewMyShixunModel extends Component {
} else {
}
////console.log("item_banks");
////console.log(response);
//////console.log("item_banks");
//////console.log(response);
this.setState({
Contentdata: response.data,
items_count: response.data.items_count,
@ -590,7 +590,7 @@ class NewMyShixunModel extends Component {
}
})
.catch(function (error) {
//console.log(error);
////console.log(error);
});
}
publicopentimu = (id) => {
@ -616,7 +616,7 @@ class NewMyShixunModel extends Component {
this.getdata(data);
}
}).catch((error) => {
//console.log(error);
////console.log(error);
})
}
@ -625,8 +625,8 @@ class NewMyShixunModel extends Component {
// const url = "/item_baskets/basket_list.json";
// axios.get(url)
// .then((result) => {
// // //console.log("getbasket_listdata");
// // //console.log(result.data);
// // ////console.log("getbasket_listdata");
// // ////console.log(result.data);
// this.setState({
// completion_questions_count: result.data.completion_questions_count,
// judgement_questions_count: result.data.judgement_questions_count,
@ -638,7 +638,7 @@ class NewMyShixunModel extends Component {
// })
//
// }).catch((error) => {
// // //console.log(error);
// // ////console.log(error);
// this.setState({
// completion_questions_count: 0,
// judgement_questions_count: 0,
@ -687,7 +687,7 @@ class NewMyShixunModel extends Component {
// })
}
}).catch((error) => {
//console.log(error);
////console.log(error);
})
}
// 撤销
@ -715,7 +715,7 @@ class NewMyShixunModel extends Component {
this.getbasket_listdata();
}
}).catch((error) => {
//console.log(error);
////console.log(error);
})
}else{
url=`/examination_banks/${this.props.exam_id}/revoke_item.json`;
@ -741,7 +741,7 @@ class NewMyShixunModel extends Component {
this.getbasket_listdata();
}
}).catch((error) => {
//console.log(error);
////console.log(error);
})
}
@ -815,7 +815,7 @@ class NewMyShixunModel extends Component {
}
})
.catch(function (error) {
//console.log(error);
////console.log(error);
});
}
@ -930,6 +930,7 @@ class NewMyShixunModel extends Component {
{/*头部*/}
<Contentpart {...this.state} {...this.props}
exam_id={this.props.exam_id}
Isitapopup={"true"}
getitem_basketss={(id)=>this.getitem_basketss(id)}
selectallquestionsonthispage={()=>this.selectallquestionsonthispage()}
getitem_baskets={(e)=>this.getitem_baskets(e)}

@ -67,8 +67,8 @@ class Paperreview extends Component {
//初始化
componentDidMount() {
console.log("Paperreview.js");
console.log(this.props.match.params);
//console.log("Paperreview.js");
//console.log(this.props.match.params);
this.setState({
artificialtype:this.props.match.params.type
})
@ -185,7 +185,7 @@ class Paperreview extends Component {
}
}).catch((error) => {
////console.log(error)
//////console.log(error)
this.setState({
booljupyterurls: false,
})
@ -238,7 +238,7 @@ class Paperreview extends Component {
this.props.history.replace('/paperlibrary');
}
}).catch((error) => {
console.log(error);
//console.log(error);
})
}else{
@ -321,12 +321,12 @@ class Paperreview extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
console.log(result);
//console.log(result);
var data = {}
this.getdata(data);
}
}).catch((error) => {
console.log(error);
//console.log(error);
})
}
//换题
@ -338,12 +338,12 @@ class Paperreview extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
console.log(result);
//console.log(result);
var data = {}
this.getdata(data);
}
}).catch((error) => {
console.log(error);
//console.log(error);
})
}
@ -361,7 +361,7 @@ class Paperreview extends Component {
render() {
let {page, limit, count, Headertop, visible, placement, modalsType, item_type,artificialtype,Cohetepaperbool,newmyshixunmodelbool,Intelligentformation} = this.state;
const params = this.props && this.props.match && this.props.match.params;
// //console.log(params);
// ////console.log(params);
return (
<div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "

@ -95,7 +95,7 @@ class Paperreview_item extends Component {
this.props.getdata({});
}
}).catch((error) => {
console.log(error);
//console.log(error);
})
}
@ -114,7 +114,7 @@ class Paperreview_item extends Component {
this.props.getdata({});
}
}).catch((error) => {
console.log(error);
//console.log(error);
})
@ -135,7 +135,7 @@ class Paperreview_item extends Component {
this.props.getdata({});
}
}).catch((error) => {
console.log(error);
//console.log(error);
})
}
@ -155,7 +155,7 @@ class Paperreview_item extends Component {
this.props.getdata({});
}
}).catch((error) => {
console.log(error);
//console.log(error);
})
}
@ -190,7 +190,7 @@ class Paperreview_item extends Component {
this.Singlemagazine("", false);
}
}).catch((error) => {
console.log(error);
//console.log(error);
})
}
@ -207,7 +207,7 @@ class Paperreview_item extends Component {
this.Singlemagazines(false);
}
}).catch((error) => {
console.log(error);
//console.log(error);
})
}
@ -255,7 +255,7 @@ class Paperreview_item extends Component {
}
})
.catch(function (error) {
//console.log(error);
////console.log(error);
});
@ -299,7 +299,7 @@ class Paperreview_item extends Component {
}
hideparagraph = (name) => {
console.log("hideparagraph");
//console.log("hideparagraph");
}
@ -312,7 +312,7 @@ class Paperreview_item extends Component {
})
}
showparagraph = (name) => {
console.log("showparagraph");
//console.log("showparagraph");
if (name === "SINGLE") {
this.setState({
singlebool: true,
@ -364,8 +364,8 @@ class Paperreview_item extends Component {
}
showparagraphs = (e,name) => {
// console.log("showparagraphs");
// console.log(e);
// //console.log("showparagraphs");
// //console.log(e);
this.setState({
paperreviewsingleindex: e,
paperreviewsinglename:name,

@ -58,9 +58,9 @@ class Paperreview_items extends Component {
render() {
let {paperreviewsingleindex,paperreviewsinglename,typenames,indexs,object,typenamesn}=this.props;
// console.log(object);
// console.log("Paperreview_items");
// console.log(object.item_id);
// //console.log(object);
// //console.log("Paperreview_items");
// //console.log(object.item_id);
return (
<div>
{

@ -59,7 +59,7 @@ class Paperreview_judgment extends Component {
render() {
let {questions,totalscore,total,items} = this.state;
// //console.log(params);
// ////console.log(params);
return (
<div className="w100s borderwdswuh mt25 mb20 " style={{
minHeight: "114px",

@ -59,7 +59,7 @@ class Paperreview_multlple extends Component {
render() {
let {questions,totalscore,total,items} = this.state;
// //console.log(params);
// ////console.log(params);
return (
<div className="w100s borderwdswuh mt25 mb20 " style={{
minHeight: "114px",

@ -59,7 +59,7 @@ class Paperreview_program extends Component {
render() {
let {questions,totalscore,total,items} = this.state;
// //console.log(params);
// ////console.log(params);
return (
<div className="w100s borderwdswuh mt25 mb20 " style={{
minHeight: "114px",

@ -99,7 +99,8 @@ class Paperreview_single extends Component {
<style>{
`
.programquill .ql-editor{
padding: 0px;
padding-left: 0px !important;
padding-top: 0px !important;
}
.programquill .ql-editor p{
@ -107,7 +108,8 @@ class Paperreview_single extends Component {
}
.programquills .ql-editor{
padding: 0px;
padding-left: 0px !important;
padding-top: 0px !important;
}
.programquills .ql-editor p{
@ -142,7 +144,9 @@ class Paperreview_single extends Component {
{
objectsingle.item_type==="PROGRAM"?
<div className="w100s sortinxdirection">
<div className=" tites lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word"}}
<div className=" tites lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word",
minWidth:"32px"
}}
>
({objectsingle.score})
</div>
@ -153,7 +157,9 @@ class Paperreview_single extends Component {
</div>
:
<div className="w100s sortinxdirection">
<div className="tites lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word"}}
<div className="tites lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word",
minWidth:"32px"
}}
>
({objectsingle.score})
</div>
@ -180,7 +186,7 @@ class Paperreview_single extends Component {
objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => {
return (
<p className={index === 1 ? "sortinxdirection ml10" : "sortinxdirection "}>
<Radio disabled={false}>
<Radio disabled={true}>
{object.choice_text}
</Radio>
</p>

@ -113,7 +113,7 @@ class Question extends Component {
}
setsub_discipline_id=(sub_discipline_id)=>{
setsub_discipline_id=(discipline_id,sub_discipline_id)=>{
this.setState({
sub_discipline_id:sub_discipline_id,
tag_discipline_id:null,
@ -123,7 +123,7 @@ class Question extends Component {
oj_status:null
})
var data = {
discipline_id:this.state.discipline_id,
discipline_id:discipline_id,
sub_discipline_id:sub_discipline_id,
tag_discipline_id:null,
public: this.state.defaultActiveKey,
@ -179,8 +179,8 @@ class Question extends Component {
axios.get(urls, {params: {
source:"question"
}}).then((response) => {
console.log("Questiondisciplines");
console.log(response.data);
//console.log("Questiondisciplines");
//console.log(response.data);
if (response) {
this.setState({
disciplinesdata: response.data.disciplines,
@ -234,15 +234,15 @@ class Question extends Component {
} else {
}
////console.log("item_banks");
////console.log(response);
//////console.log("item_banks");
//////console.log(response);
this.setState({
Contentdata: response.data,
items_count: response.data.items_count,
})
this.getdataslen(response.data.items);
}).catch((error) => {
////console.log(error)
//////console.log(error)
this.setState({
booljupyterurls:false,
})
@ -268,8 +268,8 @@ class Question extends Component {
} else {
}
////console.log("item_banks");
////console.log(response);
//////console.log("item_banks");
//////console.log(response);
this.setState({
Contentdata: response.data,
items_count: response.data.items_count,
@ -566,7 +566,7 @@ class Question extends Component {
}
})
.catch(function (error) {
//console.log(error);
////console.log(error);
});
}
publicopentimu = (id) => {
@ -590,7 +590,7 @@ class Question extends Component {
this.getdata(data);
}
}).catch((error) => {
//console.log(error);
////console.log(error);
})
}
@ -599,8 +599,8 @@ class Question extends Component {
const url = "/item_baskets/basket_list.json";
axios.get(url)
.then((result) => {
// //console.log("getbasket_listdata");
// //console.log(result.data);
// ////console.log("getbasket_listdata");
// ////console.log(result.data);
this.setState({
completion_questions_count: result.data.completion_questions_count,
judgement_questions_count: result.data.judgement_questions_count,
@ -612,7 +612,7 @@ class Question extends Component {
})
}).catch((error) => {
// //console.log(error);
// ////console.log(error);
this.setState({
completion_questions_count: 0,
judgement_questions_count: 0,
@ -654,7 +654,7 @@ class Question extends Component {
// })
}
}).catch((error) => {
//console.log(error);
////console.log(error);
})
}
// 撤销
@ -681,7 +681,7 @@ class Question extends Component {
this.getbasket_listdata();
}
}).catch((error) => {
//console.log(error);
////console.log(error);
})
}
//全选试题库
@ -750,7 +750,7 @@ class Question extends Component {
}
})
.catch(function (error) {
//console.log(error);
////console.log(error);
});
}
@ -902,11 +902,12 @@ class Question extends Component {
setdifficulty={(e) => this.setdifficulty(e)}
setitem_types={(e) => this.setitem_types(e)}
setdiscipline_id={(e)=>this.setdiscipline_id(e)}
setsub_discipline_id={(e)=>this.setsub_discipline_id(e)}
setsub_discipline_id={(e,id)=>this.setsub_discipline_id(e,id)}
settag_discipline_id={(e)=>this.settag_discipline_id(e)}
/>
{/*头部*/}
<Contentpart {...this.state} {...this.props}
Isitapopup={"false"}
chakanjiexiboolindex={this.state.chakanjiexiboolindex}
chakanjiexibool={(e)=>this.chakanjiexibool(e)}
getitem_basketss={(id)=>this.getitem_basketss(id)}

@ -52,8 +52,8 @@ class Questionitem_banks extends Component {
// axios.get(url, {
//
// }).then((response) => {
// // //////console.log("开始请求/get_navigation_info.json");
// // //////console.log(response);
// // ////////console.log("开始请求/get_navigation_info.json");
// // ////////console.log(response);
// if(response!=undefined){
// if(response.status===200){
// this.setState({
@ -80,15 +80,15 @@ class Questionitem_banks extends Component {
} else {
}
//////console.log("item_banks");
//console.log("Questionitem_banks");
//console.log(response.data);
////////console.log("item_banks");
////console.log("Questionitem_banks");
////console.log(response.data);
this.setState({
item_banksedit: response.data,
})
}).catch((error) => {
//////console.log(error)
////////console.log(error)
});
@ -173,10 +173,10 @@ class Questionitem_banks extends Component {
// }else{
//
// }
// //////console.log("item_banks");
// //////console.log(response);
// ////////console.log("item_banks");
// ////////console.log(response);
// }).catch((error) => {
// //////console.log(error)
// ////////console.log(error)
//
// });
}
@ -239,7 +239,7 @@ class Questionitem_banks extends Component {
if (this.state.item_type === "SINGLE") {
if (this.answerMdRef != null) {
//单选题
// //console.log(this.answerMdRef.onSave());
// ////console.log(this.answerMdRef.onSave());
if (this.answerMdRef.onSave().length === 0) {
return;
@ -287,7 +287,7 @@ class Questionitem_banks extends Component {
}
}).catch((error) => {
//console.log(error);
////console.log(error);
})
} else {
axios.put(url, data)
@ -299,7 +299,7 @@ class Questionitem_banks extends Component {
}
}).catch((error) => {
//console.log(error);
////console.log(error);
})
}
@ -311,7 +311,7 @@ class Questionitem_banks extends Component {
if (this.state.item_type === "MULTIPLE") {
if (this.Choques != null) {
//多选题
// //console.log(this.Choques.onSave());
// ////console.log(this.Choques.onSave());
if (this.Choques.onSave().length === 0) {
return;
}
@ -319,8 +319,8 @@ class Questionitem_banks extends Component {
const choices = [];
// 1: [3]
// 2: (4) ["1", "2", "3", "4"]
//console.log("MULTIPLE");
//console.log(anserdata);
////console.log("MULTIPLE");
////console.log(anserdata);
for (var k = 0; k < anserdata[2].length; k++) {
var bool = false
@ -366,7 +366,7 @@ class Questionitem_banks extends Component {
}
}).catch((error) => {
//console.log(error);
////console.log(error);
})
} else {
@ -379,7 +379,7 @@ class Questionitem_banks extends Component {
}
}).catch((error) => {
//console.log(error);
////console.log(error);
})
}
@ -390,7 +390,7 @@ class Questionitem_banks extends Component {
if (this.state.item_type === "JUDGMENT") {
if (this.Judquestio != null) {
//判断题
// //console.log(this.Judquestio.onSave());
// ////console.log(this.Judquestio.onSave());
if (this.Judquestio.onSave().length === 0) {
return;
}
@ -432,7 +432,7 @@ class Questionitem_banks extends Component {
}
}).catch((error) => {
//console.log(error);
////console.log(error);
})
} else {
@ -444,7 +444,7 @@ class Questionitem_banks extends Component {
}
}).catch((error) => {
//console.log(error);
////console.log(error);
})
}
@ -476,13 +476,13 @@ class Questionitem_banks extends Component {
this.setState({
item_type: item_type
})
this.scrollToAnchor("Itembankstopid");
}
render() {
let {page, limit, count, Headertop, visible, placement, modalsType, item_type} = this.state;
const params = this.props && this.props.match && this.props.match.params;
// //console.log(params);
// ////console.log(params);
return (
<div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
@ -515,6 +515,7 @@ class Questionitem_banks extends Component {
>
</Itembankstop>
<div >
{
item_type && item_type === "SINGLE" ?
@ -555,9 +556,8 @@ class Questionitem_banks extends Component {
: item_type && item_type === "PROGRAM" ?
""
: ""
}
}
</div>
</div>

@ -83,9 +83,9 @@ class ChoquesEditor extends Component{
addOption = () => {
const { question_choices, standard_answers } = this.state;
// ////console.log("addOption");
// ////console.log(question_choices);
// ////console.log(standard_answers);
// //////console.log("addOption");
// //////console.log(question_choices);
// //////console.log(standard_answers);
question_choices.push('')
@ -95,8 +95,8 @@ class ChoquesEditor extends Component{
deleteOption = (index) => {
let {question_choices}=this.state;
// ////console.log("deleteOption");
// ////console.log(question_choices);
// //////console.log("deleteOption");
// //////console.log(question_choices);
if(question_choices[index]===""){
// repeat code
@ -199,9 +199,9 @@ class ChoquesEditor extends Component{
}
}
componentDidUpdate(prevProps) {
//console.log("componentDidUpdate");
// //console.log(prevProps);
// //console.log(this.props.item_banksedit);
////console.log("componentDidUpdate");
// ////console.log(prevProps);
// ////console.log(this.props.item_banksedit);
if(prevProps.item_banksedit !== this.props.item_banksedit) {
this.setState({
@ -244,7 +244,7 @@ class ChoquesEditor extends Component{
}
let question_choices = this.state.question_choices.slice(0);
question_choices[index] = texts;
console.log(question_choices);
//console.log(question_choices);
this.setState({ question_choices });
}
@ -333,9 +333,9 @@ class ChoquesEditor extends Component{
// [true, false, true] -> [0, 2]
const answerTagArray = standard_answers.map((item, index) => { return item == true ? tagArray[index] : -1 }).filter(item => item != -1);
// ////console.log("xuanzheshijuan");
// ////console.log(answerTagArray);
// ////console.log(!exerciseIsPublish);
// //////console.log("xuanzheshijuan");
// //////console.log(answerTagArray);
// //////console.log(!exerciseIsPublish);
return(
<div className="padding20-30 signleEditor duoxuano" id={qNumber}>
@ -383,7 +383,7 @@ class ChoquesEditor extends Component{
{question_choices.map( (item, index) => {
const bg = standard_answers[index] ? 'check-option-bg' : ''
return <div className={index>0?"df optionRow mt15": "df optionRow"} >
return <div key={index} className={index>0?"df optionRow mt15": "df optionRow"} >
{/* 点击设置答案 */}
{/* TODO 加了tooltip后会丢失掉span的class */}
{/* <Tooltip title={standard_answers[index] ? '点击取消标准答案设置' : '点击设置为标准答案'}> */}
@ -399,7 +399,7 @@ class ChoquesEditor extends Component{
{
item===undefined||item===null||item===""?
<QuillForEditor
autoFocus={false}
autoFocus={false}
imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '166px'}}
placeholder="请您输入题干"

@ -135,8 +135,8 @@ class Contentpart extends Component {
);
console.log("Contentpart.js");
console.log(this.props.defaultActiveKey);
//console.log("Contentpart.js");
//console.log(this.props.defaultActiveKey);
return (
<div className=" clearfix mt25">
@ -214,11 +214,14 @@ class Contentpart extends Component {
{
defaultActiveKey===0||defaultActiveKey==="0"?
isysladmins===true||(is_teacher===true&&professional_certification===true)?
<a onClick={(e)=>this.xinzenw(e)}>
<div className="newbutoon">
<p className="newbutoontes" >新增</p>
</div>
</a>
this.props.Isitapopup&&this.props.Isitapopup==="true"?
""
:
<a onClick={(e)=>this.xinzenw(e)}>
<div className="newbutoon">
<p className="newbutoontes" >新增</p>
</div>
</a>
:""
:""
}
@ -241,6 +244,16 @@ class Contentpart extends Component {
{
defaultActiveKey===0||defaultActiveKey==="0"?
this.props.Isitapopup&&this.props.Isitapopup==="true"?
<Search
style={isysladmins===true||(is_teacher===true&&professional_certification)?{ marginRight:"0px"}:{marginRight:"0px"}}
className={"xaxisreverseorder searchwidth"}
placeholder="请输入题目名称、内容"
enterButton
size="large"
onInput={(e)=>this.props.setdatafunsval(e)}
onSearch={ (value)=>this.props.setdatafuns(value)} />
:
<Search
style={isysladmins===true||(is_teacher===true&&professional_certification)?{ marginRight:"30px"}:{marginRight:"0px"}}
className={"xaxisreverseorder searchwidth"}
@ -296,6 +309,7 @@ class Contentpart extends Component {
: this.props.Contentdata.items.map((object, index) => {
return (
<Listjihe {...this.state} {...this.props}
Isitapopup={this.props.Isitapopup}
chakanjiexiboolindex={this.props.chakanjiexiboolindex}
chakanjiexibool={(keindex)=>this.chakanjiexibool(keindex)}
listjihe={index+1}

@ -20,9 +20,9 @@ class Contentquestionbank extends Component {
}
//初始化
componentDidMount(){
////console.log("componentDidMount");
////console.log(this.state);
////console.log(this.props);
//////console.log("componentDidMount");
//////console.log(this.state);
//////console.log(this.props);
// let homeworkid = this.props.match.params.homeworkid;
// let url = "/homework_commons/" + homeworkid + "/end_groups.json";
// axios.get(url).then((response) => {
@ -30,12 +30,12 @@ class Contentquestionbank extends Component {
// this.setState({})
// }
// }).catch((error) => {
// ////console.log(error)
// //////console.log(error)
// });
}
onChange=(e)=> {
////console.log(`checked = ${e.target.checked}`);
//////console.log(`checked = ${e.target.checked}`);
}
render() {

@ -77,8 +77,8 @@ class Headplugselection extends Component {
}
render() {
let {page,titlestting,titlesttings,titlesttingss}=this.state;
// console.log("Headplugselection");
// console.log(this.props.disciplinesdata);
// //console.log("Headplugselection");
// //console.log(this.props.disciplinesdata);
// disciplinesdatakc:kc,
// disciplinesdatazsd:zsd,
var kc=0;

@ -48,10 +48,7 @@ class Headplugselections extends Component {
componentDidMount(){
}
//
// setdiscipline_id={(e)=>this.setdiscipline_id(e)}
// setsub_discipline_id={(e)=>this.setsub_discipline_id(e)}
// settag_discipline_id={(e)=>this.settag_discipline_id(e)}
settitlestting=(name,id)=>{
//如果全部其他的选项重置
this.setState({
@ -87,8 +84,8 @@ class Headplugselections extends Component {
//获取方向
shixunsearchAll = (id) => {
console.log("获取方向");
console.log(id);
//console.log("获取方向");
//console.log(id);
if(id!=undefined){
this.setState({
shixunsearchAllvalue:id,
@ -130,16 +127,16 @@ class Headplugselections extends Component {
}
getshixunchildValue = (id,ids) => {
console.log("getshixunchildValue");
console.log(id);
debugger
// //console.log("getshixunchildValue");
// //console.log(id);
// debugger
if(id!=undefined ||ids!=undefined){
this.setState({
shixunsearchAllvalue:ids
})
try {
this.props.setsub_discipline_id(id);
this.props.setsub_discipline_id(ids,id);
}catch (e) {
}

@ -60,7 +60,7 @@ class IntelligentModel extends Component {
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
console.log(result);
//console.log(result);
this.props.history.push(`/paperlibrary`);
}

@ -13,7 +13,7 @@ import {
Input,
Select,
Cascader,
Col, Row, InputNumber, DatePicker, AutoComplete, Button, Tag
Col, Row, InputNumber, DatePicker, AutoComplete, Button, Tag,Tooltip
} from "antd";
import './../questioncss/questioncom.css';
import Newknledpots from './Newknledpots'
@ -57,6 +57,7 @@ class Itembankstop extends Component {
options: [],
NewknTypedel:false,
boolred:false,
boolnews:false,
}
}
@ -71,6 +72,23 @@ class Itembankstop extends Component {
//初始化
componentDidMount() {
const params = this.props && this.props.match && this.props.match.params;
if (JSON.stringify(params) === "{}") {
// "新增"
this.setState({
boolnews:false,
})
} else {
if(params){
if( params.id){
this.setState({
boolnews:true,
})
}
}
}
try {
this.props.getcontentMdRef(this);
@ -81,10 +99,10 @@ class Itembankstop extends Component {
options: this.props.disciplmy,
})
console.log("数据");
console.log(this.props);
//console.log("数据");
//console.log(this.props);
const parsed = queryString.parse(this.props.location.search);
console.log(parsed);
//console.log(parsed);
try {
if(JSON.stringify(parsed)==={}||JSON.stringify(parsed)==="{}"){
@ -138,7 +156,7 @@ class Itembankstop extends Component {
})
}
if(prevProps.disciplinesdata!== this.props.disciplinesdata){
console.log("新增开始加载了")
//console.log("新增开始加载了")
try {
if(this.props.item_banksedit.discipline &&this.props.item_banksedit.sub_discipline){
const didata = this.props.disciplinesdata;
@ -333,8 +351,8 @@ class Itembankstop extends Component {
this.props.form.validateFields((err, values) => {
data = []
if (!err) {
// ////console.log("获取的form 数据");
// ////console.log(values);
// //////console.log("获取的form 数据");
// //////console.log(values);
data.push({
rbnd: parseInt(values.rbnd)
})
@ -358,8 +376,8 @@ class Itembankstop extends Component {
e.preventDefault();
this.props.form.validateFields((err, values) => {
if (!err) {
////console.log("获取的form 数据");
////console.log(values);
//////console.log("获取的form 数据");
//////console.log(values);
}
@ -368,8 +386,8 @@ class Itembankstop extends Component {
}
handleFormLayoutChangeysl = (value) => {
//难度塞选
////console.log("难度塞选");
////console.log(value);
//////console.log("难度塞选");
//////console.log(value);
this.props.form.setFieldsValue({
rbnd: value+ "",
});
@ -380,8 +398,8 @@ class Itembankstop extends Component {
}
handleFormLayoutChange = (e) => {
//难度塞选
////console.log("难度塞选");
////console.log(value);
//////console.log("难度塞选");
//////console.log(value);
this.props.form.setFieldsValue({
rbnd: e.target.value + "",
});
@ -392,8 +410,8 @@ class Itembankstop extends Component {
}
handleFormkechen = (value) => {
//课程
////console.log("课程");
////console.log(value);
//////console.log("课程");
//////console.log(value);
if(this.state.Knowpoints.length>4){
this.props.showNotification(`知识点最多选择5个`);
return
@ -414,8 +432,8 @@ class Itembankstop extends Component {
const _result =[];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
// console.log("guonue");
// console.log(item);
// //console.log("guonue");
// //console.log(item);
_result.push(item);
}
});
@ -430,8 +448,8 @@ class Itembankstop extends Component {
}
handleFormzhishidian = (value) => {
console.log("handleFormzhishidian 课程");
console.log(value);
//console.log("handleFormzhishidian 课程");
//console.log(value);
//课程
this.props.form.setFieldsValue({
@ -440,8 +458,8 @@ class Itembankstop extends Component {
this.setState({
rbkc:value,
})
// console.log("handleFormzhishidian");
// console.log(this.props.disciplinesdata);
// //console.log("handleFormzhishidian");
// //console.log(this.props.disciplinesdata);
const didata = this.props.disciplinesdata;
const knowledgepointsdata = [];
@ -485,8 +503,8 @@ class Itembankstop extends Component {
handleFormtixing = (value) => {
//题型
//console.log("题型");
//console.log(value);
////console.log("题型");
////console.log(value);
this.setState({
rbtx: value + "",
})
@ -497,7 +515,7 @@ class Itembankstop extends Component {
}
preventDefault = (e) => {
e.preventDefault();
////console.log('Clicked! But prevent default.');
//////console.log('Clicked! But prevent default.');
}
deletesobject = (item, index) => {
@ -626,7 +644,7 @@ class Itembankstop extends Component {
}
}).catch((error) => {
//console.log(error);
////console.log(error);
})
this.setState({
@ -639,9 +657,9 @@ class Itembankstop extends Component {
let {page, options,NewknTypedel,knowledgepoints,knowledgepoints2,Knowpoints} = this.state;
const {getFieldDecorator} = this.props.form;
// console.log("this.state.rbkc");
// console.log(this.state.rbkc);
// console.log(options);
// //console.log("this.state.rbkc");
// //console.log(this.state.rbkc);
// //console.log(options);
return (
@ -754,6 +772,8 @@ class Itembankstop extends Component {
}
<Form.Item
label="题型"
>
@ -762,18 +782,16 @@ class Itembankstop extends Component {
rules: [{required: true, message: '请选择题型'}],
}
)(
<Select style={{width: '270px'}} onChange={this.handleFormtixing}
<Select style={{width: '270px'}} disabled={this.state.boolnews} onChange={this.handleFormtixing}
placeholder="请选择...">
<Option value="PROGRAM">编程题</Option>
<Option value="SINGLE">单选题</Option>
<Option value="MULTIPLE">多选题</Option>
<Option value="JUDGMENT">判断题</Option>
</Select>
)}
</Form.Item>
<style>
{
`

@ -62,9 +62,9 @@ class JudquestionEditor extends Component{
addOption = () => {
const { question_choices, standard_answers } = this.state;
// //////console.log("addOption");
// //////console.log(question_choices);
// //////console.log(standard_answers);
// ////////console.log("addOption");
// ////////console.log(question_choices);
// ////////console.log(standard_answers);
question_choices.push('')
@ -74,8 +74,8 @@ class JudquestionEditor extends Component{
deleteOption = (index) => {
let {question_choices}=this.state;
// //////console.log("deleteOption");
// //////console.log(question_choices);
// ////////console.log("deleteOption");
// ////////console.log(question_choices);
if(question_choices[index]===""){
// repeat code
@ -190,9 +190,9 @@ class JudquestionEditor extends Component{
}
componentDidUpdate(prevProps) {
//console.log("componentDidUpdate");
//console.log(prevProps);
//console.log(this.props.item_banksedit);
////console.log("componentDidUpdate");
////console.log(prevProps);
////console.log(this.props.item_banksedit);
if(prevProps.item_banksedit !== this.props.item_banksedit){
this.setState({
@ -230,10 +230,10 @@ class JudquestionEditor extends Component{
onOptionClick = (index) => {
let standard_answers = this.state.standard_answers.slice(0);
// //////console.log("onOptionClick");
// //////console.log(standard_answers);
// //////console.log(standard_answers[index]);
// //////console.log(!standard_answers[index]);
// ////////console.log("onOptionClick");
// ////////console.log(standard_answers);
// ////////console.log(standard_answers[index]);
// ////////console.log(!standard_answers[index]);
for (var i=0;i<standard_answers.length;i++){
if(index===i){
standard_answers[index] = true;
@ -272,8 +272,8 @@ class JudquestionEditor extends Component{
handleFormLayoutChange=(e)=>{
//////console.log("难度塞选");
//////console.log(value);
////////console.log("难度塞选");
////////console.log(value);
this.setState({
zqda:e.target.value,
@ -348,9 +348,9 @@ class JudquestionEditor extends Component{
// [true, false, true] -> [0, 2]
const answerTagArray = standard_answers.map((item, index) => { return item == true ? tagArray[index] : -1 }).filter(item => item != -1);
// //////console.log("xuanzheshijuan");
// //////console.log(answerTagArray);
// //////console.log(!exerciseIsPublish);
// ////////console.log("xuanzheshijuan");
// ////////console.log(answerTagArray);
// ////////console.log(!exerciseIsPublish);
const params= this.props&&this.props.match&&this.props.match.params;
return(
<div className="padding20-30 signleEditor danxuano" id={qNumber}>

@ -159,22 +159,16 @@ class Listjihe extends Component {
<style>
{
` .markdown-body .ql-editor{
padding-left: 0px;
}
.markdown-body .ql-editor p{
line-height: 0px;
padding-left: 0px !important;
padding-top: 0px !important;
}
.programquill .ql-editor{
padding-left: 0px;
padding-left: 0px !important;
padding-top: 0px !important;
}
.programquill .ql-editor p{
line-height: 0px;
}
`
}
</style>
@ -182,18 +176,15 @@ class Listjihe extends Component {
<div className="listjihetixingstitsy">
{
this.props.listjihe
}
</div>
<div className="listjihetixingstitsy">
.
}.
</div>
{
items.item_type==="PROGRAM"?
<a href={`/problems/${items.program_attr.identifier}/edit`}>
<div className="ml10 w100s listjihetixingstit markdown-body" style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML(items&&items.name).replace(/▁/g, "▁▁▁")}}></div>
<div className="ml10 w100s " style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML(items&&items.name).replace(/▁/g, "▁▁▁")}}></div>
</a>
:
<div className="ml10 w100s listjihetixingstit markdown-body" style={{wordBreak: "break-word"}}>
<div className="ml10 w100s markdown-body" style={{wordBreak: "break-word"}}>
{ items===undefined||items===null||items===""?"":
items.name === undefined || items.name === null || items.name === "" ?
""
@ -217,7 +208,7 @@ class Listjihe extends Component {
items === undefined || items === null ? "" : items.choices.map((object, index) => {
return (
<p className={index === 1 ? "sortinxdirection ml10" : "sortinxdirection "}>
<Radio disabled={false} disabled={true} >
<Radio disabled={true} >
{object.choice_text}
</Radio>
</p>
@ -257,7 +248,7 @@ class Listjihe extends Component {
}
return (
<p className={index === 0 ? "sortinxdirection " : "sortinxdirection mt15 "}>
<p className="lh26">{tagArray[index]}</p>
<p className="lh20s">{tagArray[index]}</p>
<p className="programquill" style={{wordBreak: "break-word"}}>
{object ?
object.choice_text === undefined || object.choice_text=== null || object.choice_text === "" ?
@ -352,6 +343,9 @@ class Listjihe extends Component {
</p>
{
items.item_type === "PROGRAM" ?
this.props.Isitapopup&&this.props.Isitapopup==="true"?
""
:
<a href={`/problems/${items.program_attr.identifier}/edit`}>
<p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
@ -359,6 +353,9 @@ class Listjihe extends Component {
</p>
</a>
:
this.props.Isitapopup&&this.props.Isitapopup==="true"?
""
:
<a href={`/question/edit/${items.id}`}>
<p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>

@ -18,15 +18,15 @@ class PaperDeletModel extends Component {
// this.setState({
// newkntypeinput: e.target.value
// })
// console.log(e.target.value);
// console.log(e.target.value.length);
// //console.log(e.target.value);
// //console.log(e.target.value.length);
this.setState({
newkntypeinput: e.target.value
})
this.props.setboolred(false);
//
// debugger
// console.log(e);
// //console.log(e);
//
// if(e.target.value.length>0){
// if(e.target.value.length>=16){
@ -38,11 +38,11 @@ class PaperDeletModel extends Component {
// }
}
mysinputOnBlur=(e)=>{
console.log("失去焦点了");
//console.log("失去焦点了");
}
inputOnFocus=(e)=>{
console.log("获取焦点");
//console.log("获取焦点");
}
render() {

@ -13,8 +13,8 @@ class Paperreview_itemModel extends Component {
}
onChange=(value)=>{
console.log("设置批量得分");
console.log(value);
//console.log("设置批量得分");
//console.log(value);
this.setState({
value:value,
})

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

Loading…
Cancel
Save