Merge branch 'dev_aliyun' into develop

dev_hs
cxt 6 years ago
commit 22bd639270

@ -26,14 +26,14 @@ class CoursesController < ApplicationController
:base_info, :get_historical_courses, :create_group_by_importing_file,
:attahcment_category_list,:export_member_scores_excel, :duplicate_course,
:switch_to_teacher, :switch_to_assistant, :switch_to_student, :exit_course,
:informs, :update_informs, :online_learning, :update_task_position, :tasks_list, :join_excellent_course]
:informs, :update_informs, :new_informs, :online_learning, :update_task_position, :tasks_list, :join_excellent_course]
before_action :user_course_identity, except: [:join_excellent_course, :index, :create, :new, :apply_to_join_course,
:search_course_list, :get_historical_course_students, :mine, :search_slim, :board_list]
before_action :teacher_allowed, only: [:update, :destroy, :settings, :search_teacher_candidate,
:transfer_to_course_group, :delete_from_course,
:search_users, :add_students_by_search, :get_historical_courses, :add_teacher_popup, :add_teacher]
before_action :admin_allowed, only: [:set_invite_code_halt, :set_public_or_private, :change_course_admin,
:set_course_group, :create_group_by_importing_file, :update_informs,
:set_course_group, :create_group_by_importing_file, :update_informs, :new_informs,
:update_task_position, :tasks_list]
before_action :teacher_or_admin_allowed, only: [:graduation_group_list, :create_graduation_group, :join_graduation_group,
:change_course_teacher, :export_member_scores_excel, :course_group_list,
@ -42,6 +42,7 @@ class CoursesController < ApplicationController
before_action :find_board, only: :board_list
before_action :validate_page_size, only: :mine
before_action :course_tasks, only: [:tasks_list, :update_task_position]
before_action :validate_inform_params, only: [:update_informs, :new_informs]
if RUBY_PLATFORM =~ /linux/
require 'simple_xlsx_reader'
@ -159,7 +160,7 @@ class CoursesController < ApplicationController
CourseMember.create!(course_id: @course.id, user_id: s_member.user_id, role: 2)
end
Inform.create(container: @course, description: @subject.learning_notes)
Inform.create(container: @course, description: @subject.learning_notes, name: "学习须知")
end
course_module_types = params[:course_module_types]
@ -234,14 +235,20 @@ class CoursesController < ApplicationController
end
def informs
@informs = @course.informs
end
def update_informs
tip_exception("公告内容不能为空") if params[:description].blank?
inform = @course.inform || Inform.new(container: @course)
def new_informs
inform = Inform.new(container: @course)
inform.name = params[:name]
inform.description = params[:description]
inform.save!
normal_status("创建成功")
end
def update_informs
inform = @course.informs.find_by(id: params[:inform_id])
inform.update_attributes!(name: params[:name], description: params[:description])
normal_status("更新成功")
end
@ -700,12 +707,12 @@ class CoursesController < ApplicationController
if order == 1
# REDO:Extension
@students = @students.includes(user: :user_extension).order("user_extensions.student_id, course_members.id")
@students = @students.includes(user: :user_extension).order("user_extensions.student_id, users.login")
elsif order == 2
@students = @students.includes(:course_group).order("course_groups.position, course_members.id")
@students = @students.includes(:course_group).order("course_groups.position, users.login")
else
# REDO:Extension
@students = @students.includes(user: :user_extension).order("user_extensions.student_id, course_members.id")
@students = @students.includes(user: :user_extension).order("user_extensions.student_id, users.login")
end
if course_group_id.present?
@ -1259,6 +1266,11 @@ class CoursesController < ApplicationController
end
end
def validate_inform_params
tip_exception("公告标题不能为空") if params[:name].blank?
tip_exception("公告内容不能为空") if params[:description].blank?
end
# def find_container
# case params[:container_type]
# when 'shixun_homework', 'common_homework', 'group_homework'

@ -688,7 +688,8 @@ class ExercisesController < ApplicationController
def publish
tip_exception("缺少截止时间参数") if params[:end_time].blank?
tip_exception("截止时间不能早于当前时间") if params[:end_time] <= strf_time(Time.now)
tip_exception("截止时间不能晚于课堂结束时间") if @course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day)
tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day)
ActiveRecord::Base.transaction do
begin
check_ids = Exercise.where(id: params[:check_ids])

@ -322,6 +322,8 @@ class GraduationTasksController < ApplicationController
def publish_task
tip_exception("缺少截止时间参数") if params[:end_time].blank?
tip_exception("截止时间必须晚于当前时间") if params[:end_time] <= strf_time(Time.now)
tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && params[:end_time] > @course.end_date.end_of_day
ActiveRecord::Base.transaction do
begin
@ -397,8 +399,8 @@ class GraduationTasksController < ApplicationController
tip_exception("发布时间不能早于当前时间") if params[:publish_time] <= Time.now.strftime("%Y-%m-%d %H:%M:%S")
tip_exception("截止时间不能早于当前时间") if params[:end_time] <= Time.now.strftime("%Y-%m-%d %H:%M:%S")
tip_exception("截止时间不能早于发布时间") if params[:publish_time] > params[:end_time]
tip_exception("截止时间不能早于课堂结束时间") if @course.end_date.present? &&
params[:end_time] > @course.end_date.end_of_day
tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && params[:end_time] > @course.end_date.end_of_day
@task.publish_time = params[:publish_time]
@task.end_time = params[:end_time]
@ -410,7 +412,8 @@ class GraduationTasksController < ApplicationController
elsif @task.status < 2
tip_exception("截止时间不能为空") if params[:end_time].blank?
tip_exception("截止时间不能早于当前时间") if params[:end_time] <= Time.now.strftime("%Y-%m-%d %H:%M:%S")
tip_exception("截止时间不能早于课堂结束时间") if @course.end_date.present? && params[:end_time] > @course.end_date.end_of_day
tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && params[:end_time] > @course.end_date.end_of_day
@task.end_time = params[:end_time]
end
@ -421,8 +424,8 @@ class GraduationTasksController < ApplicationController
if params[:allow_late].to_i == 1
tip_exception("补交结束时间不能为空") if params[:late_time].blank?
tip_exception("补交结束时间不能早于截止时间") if params[:late_time] <= @task.end_time
tip_exception("补交结束时间不能晚于课堂结束时间") if @course.end_date.present? && params[:late_time] >
@course.end_date.end_of_day
tip_exception("补交结束时间不能晚于课堂结束时间#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && params[:late_time] > @course.end_date.end_of_day
tip_exception("迟交扣分应为正整数") if params[:late_penalty] && params[:late_penalty].to_i < 0
@task.allow_late = true

@ -447,7 +447,8 @@ class HomeworkCommonsController < ApplicationController
tip_exception("发布时间不能早于当前时间") if params[:publish_time] <= Time.now.strftime("%Y-%m-%d %H:%M:%S")
tip_exception("截止时间不能早于当前时间") if params[:end_time] <= Time.now.strftime("%Y-%m-%d %H:%M:%S")
tip_exception("截止时间不能早于发布时间") if params[:publish_time] > params[:end_time]
tip_exception("截止时间不能晚于课堂结束时间") if @course.end_date.present? && params[:end_time] > @course.end_date.end_of_day
tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && params[:end_time] > @course.end_date.end_of_day
@homework.unified_setting = 1
@homework.homework_group_settings.destroy_all
@ -469,7 +470,8 @@ class HomeworkCommonsController < ApplicationController
tip_exception("发布时间不能早于当前时间") if setting[:publish_time] <= strf_time(Time.now)
tip_exception("截止时间不能早于当前时间") if setting[:end_time] <= strf_time(Time.now)
tip_exception("截止时间不能早于发布时间") if setting[:publish_time] > setting[:end_time]
tip_exception("截止时间不能晚于课堂结束时间") if @course.end_date.present? && setting[:end_time] > @course.end_date.end_of_day
tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && setting[:end_time] > @course.end_date.end_of_day
publish_time = setting[:publish_time] == "" ? Time.now : setting[:publish_time]
@ -503,7 +505,8 @@ class HomeworkCommonsController < ApplicationController
if @homework.end_time > Time.now && @homework.unified_setting
tip_exception("截止时间不能为空") if params[:end_time].blank?
tip_exception("截止时间不能早于当前时间") if params[:end_time] <= strf_time(Time.now)
tip_exception("截止时间不能晚于课堂结束时间") if @course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day)
tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day)
@homework.end_time = params[:end_time]
@ -521,7 +524,8 @@ class HomeworkCommonsController < ApplicationController
tip_exception("截止时间不能早于等于当前时间") if setting[:end_time] <= strf_time(Time.now)
tip_exception("截止时间不能早于发布时间") if setting[:publish_time] > setting[:end_time]
tip_exception("截止时间不能晚于课堂结束时间") if @course.end_date.present? && setting[:end_time] > strf_time(@course.end_date.end_of_day)
tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && setting[:end_time] > strf_time(@course.end_date.end_of_day)
group_settings.none_published.update_all(publish_time: setting[:publish_time])
group_settings.none_end.update_all(end_time: setting[:end_time])
@ -539,7 +543,7 @@ class HomeworkCommonsController < ApplicationController
current_late_penalty = @homework.late_penalty
if params[:allow_late]
tip_exception("补交结束时间必须晚于截止时间") if params[:late_time] <= strf_time(@homework.end_time)
tip_exception("补交结束时间不能晚于课堂结束时间") if @course.end_date.present? && params[:late_time] >
tip_exception("补交结束时间不能晚于课堂结束时间#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if @course.end_date.present? && params[:late_time] >
strf_time(@course.end_date.end_of_day)
tip_exception("迟交扣分不能小于0") if params[:late_penalty] && params[:late_penalty].to_i < 0
@ -647,7 +651,7 @@ class HomeworkCommonsController < ApplicationController
tip_exception("匿评开启时间不能早于截止时间") if params[:evaluation_start] < strf_time(@homework.end_time)
tip_exception("匿评结束时间不能为空") if params[:evaluation_end].blank?
tip_exception("匿评截止时间必须晚于匿评开启时间") if params[:evaluation_end] <= params[:evaluation_start]
tip_exception("匿评截止时间不能晚于课堂结束时间") if @course.end_date.present? && params[:evaluation_end] >
tip_exception("匿评截止时间不能晚于课堂结束时间#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if @course.end_date.present? && params[:evaluation_end] >
strf_time(@course.end_date.end_of_day)
tip_exception("匿评数必须为正整数") if params[:evaluation_num].blank? || params[:evaluation_num].to_i < 1
tip_exception("缺评扣分不能为空") if params[:absence_penalty].blank?
@ -675,7 +679,7 @@ class HomeworkCommonsController < ApplicationController
tip_exception("匿评结束时间不能为空") if @homework.anonymous_comment && params[:evaluation_end].blank?
tip_exception("匿评截止时间必须晚于匿评开启时间") if @homework.anonymous_comment &&
params[:evaluation_end] <= strf_time(@homework_detail_manual.evaluation_start)
tip_exception("匿评截止时间不能晚于课堂结束时间") if @homework.anonymous_comment &&
tip_exception("匿评截止时间不能晚于课堂结束时间#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if @homework.anonymous_comment &&
@course.end_date.present? && params[:evaluation_end] > strf_time(@course.end_date.end_of_day)
@homework_detail_manual.evaluation_end = !@homework.anonymous_comment ? nil : params[:evaluation_end]
@ -701,7 +705,7 @@ class HomeworkCommonsController < ApplicationController
tip_exception("匿评申诉结束时间不能为空") if @homework.anonymous_appeal && params[:appeal_time].blank?
tip_exception("匿评开启时间不能早于匿评截止时间") if @homework.anonymous_appeal &&
params[:appeal_time] <= strf_time(@homework_detail_manual.evaluation_end)
tip_exception("匿评申诉结束不能晚于课堂结束时间") if @homework.anonymous_appeal &&
tip_exception("匿评申诉结束不能晚于课堂结束时间#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if @homework.anonymous_appeal &&
@course.end_date.present? && params[:appeal_time] > strf_time(@course.end_date.end_of_day)
@homework_detail_manual.appeal_time = @homework.anonymous_appeal ? params[:appeal_time] : nil
@ -1054,7 +1058,8 @@ class HomeworkCommonsController < ApplicationController
tip_exception("请至少选择一个分班") if params[:group_ids].blank? && @course.course_groups.size != 0
tip_exception("缺少截止时间参数") if params[:end_time].blank?
tip_exception("截止时间不能早于当前时间") if params[:end_time] <= strf_time(Time.now)
tip_exception("截止时间不能晚于课堂结束时间") if @course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day)
tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day)
homeworks = @course.homework_commons.where(id: params[:homework_ids])
homeworks = homeworks.includes(:homework_group_settings, :homework_detail_manual)

@ -246,7 +246,8 @@ class PollsController < ApplicationController
def publish
tip_exception("缺少截止时间参数") if params[:end_time].blank?
tip_exception("截止时间不能早于当前时间") if params[:end_time] <= strf_time(Time.now)
tip_exception("截止时间不能晚于课堂结束时间") if @course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day)
tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day)
ActiveRecord::Base.transaction do
begin
check_ids = Poll.where(id: params[:check_ids])

@ -32,7 +32,7 @@ module ExercisesHelper
ques_score = 0.0
end
else
ques_score = answers_content.select(:score).pluck(:score).sum
ques_score = answers_content.score_reviewed.select(:score).pluck(:score).sum
end
if ques_score >= q.question_score #满分作答为正确
@ -558,7 +558,7 @@ module ExercisesHelper
standard_answer = standard_answer.first.to_s.split("").map(&:to_i)
end
if user_answer_content == standard_answer #答案一致,多选或单选才给分,答案不对不给分
if user_answer_content == standard_answer.sort #答案一致,多选或单选才给分,答案不对不给分
if standard_answer.size > 0
q_score_1 = q.question_score
else

@ -9,7 +9,7 @@ class Course < ApplicationRecord
# 所属实践课程
belongs_to :subject, optional: true
has_one :inform, as: :container, dependent: :destroy
has_many :informs, as: :container, dependent: :destroy
has_many :course_infos, dependent: :destroy
# 课堂左侧导航栏的模块

@ -1,3 +1,6 @@
class Inform < ApplicationRecord
belongs_to :container, polymorphic: true, optional: true
validates :name, length: { maximum: 60 }
validates :description, length: { maximum: 5000 }
end

@ -22,8 +22,8 @@ class Subject < ApplicationRecord
has_many :courses, -> { where("is_delete = 0").order("courses.created_at ASC") }
validates :name, length: { maximum: 60 }
validates :description, length: { maximum: 5000 }
validates :learning_notes, length: { maximum: 500 }
validates :description, length: { maximum: 8000 }
validates :learning_notes, length: { maximum: 2000 }
scope :visible, lambda{where(status: 2)}
scope :published, lambda{where(status: 1)}
@ -39,6 +39,11 @@ class Subject < ApplicationRecord
courses.pluck(:end_date).max
end
# 是否有已开课的课堂
def has_course_start?
courses.where("start_date <= '#{Date.today}' and end_date >= '#{Date.today}'").count > 0
end
# 挑战过路径的成员数(金课统计去重后的报名人数)
def member_count
excellent && CourseMember.where(role: 4, course_id: courses.pluck(:id)).pluck(:user_id).uniq.length > shixuns.pluck(:myshixuns_count).sum ?

@ -1 +1,5 @@
json.description @course.inform&.description
json.informs @informs do |inform|
json.id inform.id
json.name inform.name
json.description inform.description
end

@ -14,6 +14,7 @@ json.allow_add_member @is_manager
json.is_creator @is_creator
if @subject.excellent
json.has_start @subject.has_course_start?
json.courses @courses do |course|
json.course_id course.id
json.first_category_url module_url(course.none_hidden_course_modules.first, course)

@ -349,6 +349,7 @@ Rails.application.routes.draw do
post 'exit_course'
get 'informs'
post 'update_informs'
post 'new_informs'
get 'online_learning'
post 'join_excellent_course'
get 'tasks_list'

@ -0,0 +1,9 @@
class MigrateSubjectShixunCount < ActiveRecord::Migration[5.2]
def change
Subject.reset_column_information
Subject.all.each do |subject|
Subject.reset_counters subject.id, :stage_shixuns
Subject.reset_counters subject.id, :shixuns
end
end
end

@ -2,7 +2,7 @@
namespace :course do
desc "course end"
task :end => :environment do
courses = Course.where("end_date <= '#{Date.today}' and is_end = 0")
courses = Course.where("end_date < '#{Date.today}' and is_end = 0")
courses.each do |course|
course.update_attribute(:is_end, 1)
end

@ -118,12 +118,13 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
bottom: 90px;}
.tag-green .tag-name{display: block;width: auto;
/*background-image: url("/images/educoder/tag1.png");*/
background: #000000;
background: rgba(000,000,000,0.56);
border: 1px solid #fff;
border-radius: 3px;
font-size: 12px;
opacity: 0.56;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;}
/*opacity: 0.56;*/
background-size: 100% 100%;
padding: 0px 8px;color: #fff;float: left;}
.tag-orange{position: absolute;right: 0px;top:12px;}
.tag-orange .tag-name{display: block;width: auto;background-color:#FF6800;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;
@ -3447,4 +3448,9 @@ a.singlepublishtwo{
.square-main p{
margin-bottom: 0 !important;
}
}
/*.ant-notification{*/
/*width: auto !important;*/
/*max-width: 600px !important;*/
/*}*/

@ -106,11 +106,11 @@ export function CNotificationHOC(options = {}) {
confirm = (object) => {
const { title, content, onOk, onCancel, okText } = object;
const { title, content,subContent, onOk, onCancel, okText } = object;
this.onCancel = onCancel
this.onOk = onOk
this.okText = okText || ''
this.setState({ title, content, dialogOpen: true })
this.setState({ title, content , subContent , dialogOpen: true })
}
onDialogOkBtnClick = () => {
this.onOk && this.onOk();
@ -141,17 +141,17 @@ export function CNotificationHOC(options = {}) {
this.onOk = null
}
render() {
const { snackbarOpen, snackbarText, snackbarHorizontal, snackbarVertical, dialogOpen, content ,defineOpen } = this.state;
const { snackbarOpen, snackbarText, snackbarHorizontal, snackbarVertical, dialogOpen, content ,subContent ,defineOpen } = this.state;
return (
<React.Fragment>
<Modals
<Modals
modalsType={dialogOpen}
modalsTopval={
content
}
modalsBottomval={""}
modalsBottomval={ subContent || "" }
modalCancel={this.handleDialogClose}
modalSave={this.onDialogOkBtnClick}
okText={this.okText}

@ -48,6 +48,36 @@ class ExerciceNew extends Component{
editMode: !this.props.match.params.Id,
}
}
// 已发布试卷编辑保存的确认弹框
changeScore = (question_id,answerArray) =>{
this.props.confirm({
content:'修改了标准答案',
subContent:"是否重新计算学生答题的成绩?",
onOk:()=>{
this.sureChangeScore(question_id,answerArray)
},
onCancel:()=>{
this.addSuccess();
}
})
}
// 已发布试卷修改答案确认修改分数
sureChangeScore = (question_id,answerArray) =>{
let url=`/exercise_questions/${question_id}/update_scores.json`
axios.post((url),{
standard_answers:answerArray
}).then((result)=>{
if(result){
this.props.showNotification(`${result.data.message}`);
this.addSuccess();
}
}).catch((error)=>{
console.log(error);
})
}
fetchExercise = () => {
const Id = this.props.match.params.Id
this.isEdit = !!Id
@ -382,6 +412,7 @@ class ExerciceNew extends Component{
addSuccess: this.addSuccess,
addQuestion: this.addQuestion,
onEditorCancel: this.onEditorCancel,
changeScore:this.changeScore,
editQestion: this.editQestion,
onSortDown: this.onSortDown,
onSortUp: this.onSortUp,
@ -507,7 +538,7 @@ class ExerciceNew extends Component{
{ exercise_questions.map((item, index) => {
if (item.question_type == 0 || item.question_type == 1) {
if (item.isNew) {
return <SingleEditor {...this.props} {...item} index={index} {...commonHandler} ></SingleEditor>
return <SingleEditor {...this.props} {...item} index={index} {...commonHandler}></SingleEditor>
} else {
return <SingleDisplay {...this.props} {...item} index={index} {...commonHandler}
displayCount={exercise_questions.length}
@ -515,13 +546,13 @@ class ExerciceNew extends Component{
}
} else if (item.question_type == 2) {
if (item.isNew) {
return <JudgeEditor {...this.props} {...item} index={index} {...commonHandler} ></JudgeEditor>
return <JudgeEditor {...this.props} {...item} index={index} {...commonHandler}></JudgeEditor>
} else {
return <JudgeDisplay {...this.props} {...item} index={index} {...commonHandler} ></JudgeDisplay>
}
} else if (item.question_type == 3) {
if (item.isNew) {
return <NullEditor {...this.props} {...item} index={index} {...commonHandler} ></NullEditor>
return <NullEditor {...this.props} {...item} index={index} {...commonHandler}></NullEditor>
} else {
return <NullDisplay {...this.props} {...item} index={index} {...commonHandler} ></NullDisplay>
}

@ -93,10 +93,12 @@ class SingleEditor extends Component{
question_choices,
standard_answers: answerArray,
insert_id: question_id_to_insert_after || undefined
})
.then((response) => {
}).then((response) => {
if (response.data.status == 0) {
this.props.addSuccess()
}else if(response.data.status == 3){
// 已发布试卷编辑保存
this.props.changeScore(question_id,answerArray);
}
})
.catch(function (error) {

@ -133,10 +133,12 @@ class NullEditor extends Component{
standard_answers: answerArray,
insert_id: question_id_to_insert_after || undefined,
is_ordered:newis_ordered,
})
.then((response) => {
}).then((response) => {
if (response.data.status == 0) {
this.props.addSuccess()
}else if(response.data.status == 3){
// 已发布试卷编辑保存
this.props.changeScore(question_id,answerArray);
}
})
.catch(function (error) {

@ -105,8 +105,6 @@ class SingleEditor extends Component{
if(!question_title) {
this.refs['titleEditor'].showError()
this.props.showNotification('题目:不能为空'); return;
}
for(let i = 0; i < question_choices.length; i++) {
@ -115,7 +113,6 @@ class SingleEditor extends Component{
this.props.showNotification(`请先输入 ${tagArray[i]} 选项的内容`); return;
}
}
/**
{
"question_title":"同学朋友间常用的沟通工具是什么?",
@ -134,15 +131,17 @@ class SingleEditor extends Component{
question_choices,
standard_answers: answerArray,
insert_id: question_id_to_insert_after || undefined
}).then((response) => {
if (response.data.status == 0) {
this.props.addSuccess()
}else if(response.data.status == 3){
// 已发布试卷编辑保存
this.props.changeScore(question_id,answerArray);
}
})
.then((response) => {
if (response.data.status == 0) {
this.props.addSuccess()
}
})
.catch(function (error) {
console.log(error);
});
.catch(function (error) {
console.log(error);
});
} else {
const url = `/exercises/${Id}/exercise_questions.json`
@ -167,6 +166,9 @@ class SingleEditor extends Component{
onCancel = () => {
this.props.onEditorCancel()
}
componentDidMount = () => {
}

@ -13,15 +13,12 @@ class CreateGroupByImportModal extends Component{
constructor(props){
super(props);
this.state={
errorTip:undefined
}
}
fetchMemberList = (arg_page) => {
}
componentDidMount() {
}
onSendOk = () => {
const courseId = this.props.match.params.coursesId
let url = `/courses/${courseId}/create_group_by_importing_file.json`
@ -112,12 +109,13 @@ class CreateGroupByImportModal extends Component{
render(){
const { candidates, checkBoxValues, loading, hasMore, name, school_name, school_names
, graduationGroup, graduation_groups, courseGroup, course_groups } = this.state
, graduationGroup, graduation_groups, courseGroup, course_groups , fileList , errorTip } = this.state
const { moduleName } = this.props
const props = {
name: 'file',
multiple: true,
fileList:fileList,
action: getUploadActionUrl(),
onRemove: this.onAttachmentRemove,
onChange: this.handleChange
@ -131,17 +129,6 @@ class CreateGroupByImportModal extends Component{
onOk={this.onOk}
className="createGroupByImport"
>
<style>
{`
`}
</style>
<div className="df">
</div>
<Dragger {...props}>
<p className="ant-upload-drag-icon">
<Icon type="inbox" />
@ -151,6 +138,9 @@ class CreateGroupByImportModal extends Component{
单个文件最大150MB
</p>
</Dragger>
<p className="color-red lineh-25 edu-txt-left" style={{height:"25px"}}>
<span className={ errorTip ? "" : "none" }>{errorTip}</span>
</p>
</ModalWrapper>
)
}

@ -369,9 +369,9 @@ class Listofworksstudentone extends Component {
{
record.submitstate === "未提交" ?<span style={{ color: '#9A9A9A'}}>--</span>
:
<span style={{textAlign: "center"}}
<a style={{textAlign: "center"}}
className="color-blue"
onClick={() => this.Viewstudenttraininginformation(record)}>{record.operating}</span>
onClick={() => this.Viewstudenttraininginformation(record)}>{record.operating}</a>
}
</span>

@ -116,7 +116,7 @@ class ShixunHomeworkPage extends Component {
// console.log(this.props)
let {jobsettingsdatapage}=this.state
this.props.history.replace(`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.mian === 1 ? "shixun_homeworks" :"shixun_homework"}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`);
this.props.history.replace(`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`);
}
render() {
let {tab, teacherdatapage, jobsettingsdatapage} = this.state;
@ -134,11 +134,11 @@ class ShixunHomeworkPage extends Component {
<div className="educontent mb20">
<p className="clearfix mb20 mt10">
<Link className="btn colorgrey fl hovercolorblue " to={this.props.current_user.first_category_url}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.course_name}</Link>
<a className="btn colorgrey fl hovercolorblue " href={this.props.current_user&&this.props.current_user.first_category_url}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.course_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<a
className=" btn colorgrey fl hovercolorblue "
href={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.mian === 1 ? "shixun_homeworks" :"shixun_homework"}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_name}</a>
href={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">作业详情</WordsBtn>
</p>
@ -238,14 +238,14 @@ class ShixunHomeworkPage extends Component {
<a className="fr color-blue font-16" onClick={(child)=>this.workshowmodels(this.child)}>代码查重</a>
: "" : ""}
{this.state.view_report === true ? <Link className="fr color-blue font-16" target={"_blank"}
to={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.mian === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage&&teacherdatapage.work_id}/shixun_work_report`}>
to={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage&&teacherdatapage.work_id}/shixun_work_report`}>
查看实训报告
</Link> : ""}
{
teacherdatapage === undefined ? ""
: teacherdatapage.commit_des === null || teacherdatapage.commit_des === undefined ? "" :
<a className="fr color-blue font-16"
href={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.mian === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage === undefined ? "" : teacherdatapage.id}/commitsummary/${this.props.match.params.homeworkid}`}>{teacherdatapage.commit_des}</a>
href={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage === undefined ? "" : teacherdatapage.id}/commitsummary/${this.props.match.params.homeworkid}`}>{teacherdatapage.commit_des}</a>
}
{teacherdatapage === undefined ? "" : <Startshixuntask
{...this.props}

@ -30,38 +30,41 @@ class DetailTop extends Component{
}
}
componentDidMount(){
let courseslist=[]
this.getdatalist();
}
getdatalist=()=>{
let courseslist=[];
let keys=1;
if(this.props.courses!=undefined&&this.props.courses.length!=0){
this.props.courses.map((item,key)=>{
if(this.props.pathtopskey===key+1){
return(
courseslist.push(item)
)
}
})
if(this.props.detailInfoList.has_start===true){
this.props.courses.map((item,key)=>{
if(item.course_status.status===1){
keys=key+1
return(
courseslist.push(item)
)
}
})
}else{
this.props.courses.map((item,key)=>{
if(this.props.pathtopskey===key+1){
keys=key+1
return(
courseslist.push(item)
)
}
})
}
}
this.setState({
courseslist:courseslist
courseslist:courseslist,
MenuItemskey:keys,
})
}
componentDidUpdate=(prevProps)=> {
if(prevProps.courses!=this.props.courses){
let courseslist=[]
if(this.props.courses!=undefined&&this.props.courses.length!=0){
this.props.courses.map((item,key)=>{
if(this.props.pathtopskey===key+1){
return(
courseslist.push(item)
)
}
})
}
this.setState({
courseslist:courseslist
})
this.getdatalist();
}
}
@ -451,7 +454,7 @@ class DetailTop extends Component{
onVisibleChange={this.onVisibleChanges}
>
<a className={"alist"}>
<span className={"color-orange"}>{this.state.MenuItemskey}</span>次开课 <Icon className="aIcons" type={!this.state.onVisibleChangestype?"down":"up"} />
<span className={"color-orange"}> {this.state.MenuItemskey} </span>次开课 <Icon className="aIcons" type={!this.state.onVisibleChangestype?"down":"up"} />
</a>
</Dropdown>
</li>
@ -509,7 +512,7 @@ class DetailTop extends Component{
报名人数
</div>
<div className={"pathtimes"}>
{item.student_count}
{item.student_count}
</div>
</div>
</span>

@ -107,8 +107,8 @@ class PathNew extends Component{
window.location.href="#part_Des";
return;
}
if (des.length > 5000) {
this.props.showSnackbar("实践课程的简介最大限制5000个字符");
if (des.length > 8000) {
this.props.showSnackbar("实践课程的简介最大限制8000个字符");
window.location.href="#part_Des";
return;
}
@ -118,8 +118,8 @@ class PathNew extends Component{
window.location.href="#part_point";
return;
}
if(point.length > 500){
this.props.showSnackbar("实践课程的学习须知最大限制500个字符");
if(point.length > 2000){
this.props.showSnackbar("实践课程的学习须知最大限制2000个字符");
window.location.href="#part_point";
return;
}
@ -186,10 +186,10 @@ class PathNew extends Component{
})
const Des_editMD = create_editorMD("shixun_introduction","100%","490px"
,"请在此输入实践课程的简介,最大限制5000个字符","/api/attachments.json", response.data.description,"");
,"请在此输入实践课程的简介,最大限制8000个字符","/api/attachments.json", response.data.description,"");
this.Des_editMD=Des_editMD;
const Point_editMD = create_editorMD("shixun_propaedeutics","100%","260px"
,"请在此输入实践课程的学习须知,最大限制500个字符","/api/attachments.json",response.data.learning_notes,"");
,"请在此输入实践课程的学习须知,最大限制2000个字符","/api/attachments.json",response.data.learning_notes,"");
this.Point_editMD=Point_editMD;
}
}).catch((error)=>{
@ -198,9 +198,9 @@ class PathNew extends Component{
} else {
this.isEditPage = false
const Des_editMD = create_editorMD("shixun_introduction","100%","490px","请在此输入实践课程的简介,最大限制5000个字符","/api/attachments.json","","");
const Des_editMD = create_editorMD("shixun_introduction","100%","490px","请在此输入实践课程的简介,最大限制8000个字符","/api/attachments.json","","");
this.Des_editMD=Des_editMD;
const Point_editMD = create_editorMD("shixun_propaedeutics","100%","260px","请在此输入实践课程的学习须知,最大限制500个字符","/api/attachments.json","","");
const Point_editMD = create_editorMD("shixun_propaedeutics","100%","260px","请在此输入实践课程的学习须知,最大限制2000个字符","/api/attachments.json","","");
this.Point_editMD=Point_editMD;
}

@ -35,14 +35,14 @@ if (!window['indexHOCLoaded']) {
// $('head').append($('<link rel="stylesheet" type="text/css" />')
// .attr('href', `${_url_origin}/stylesheets/educoder/antd.min.css?1525440977`));
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-common.css?6`));
.attr('href', `${_url_origin}/stylesheets/css/edu-common.css?8`));
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?6`));
.attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?8`));
// index.html有加载
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?6`));
.attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?8`));
// $('head').append($('<link rel="stylesheet" type="text/css" />')

@ -120,12 +120,13 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
bottom: 90px;}
.tag-green .tag-name{display: block;width: auto;
/*background-image: url("/images/educoder/tag1.png");*/
background: #000000;
background: rgba(000,000,000,0.56);
border: 1px solid #fff;
border-radius: 3px;
font-size: 12px;
opacity: 0.56;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;}
/*opacity: 0.56;*/
background-size: 100% 100%;
padding: 0px 8px;color: #fff;float: left;}
.tag-orange{position: absolute;right: 0px;top:12px;}
.tag-orange .tag-name{display: block;width: auto;background-color:#FF6800;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;
@ -3755,4 +3756,8 @@ a.singlepublishtwo{
.has-error .ant-input:focus{
border-color: #ff4d4f !important;
}
}
/*.ant-notification{*/
/*width: auto !important;*/
/*max-width: 600px !important;*/
/*}*/
Loading…
Cancel
Save