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

* 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder: (24 commits)
  调整
  最新
  shixun
  name
  实训
  style
  调整
  签到主页面
  tpi评论默认公开
  签到
  实训配置
  小程序签到
  实训页面banner高度
  issue
  转换Https
  视频上传后,http转换成htpps
  迁移视频Https问题
  调整
  1
  fix 移动云
  ...
video_log
harry 5 years ago
commit 1b4c340a9a

@ -321,7 +321,7 @@ class ApplicationController < ActionController::Base
end
if !User.current.logged? && Rails.env.development?
User.current = User.find 3117
User.current = User.find 1
end

@ -81,8 +81,7 @@ class DiscussesController < ApplicationController
begin
@discuss = Discuss.create!(:dis_id => params[:container_id], :dis_type => params[:container_type],
:content => params[:content].gsub("&nbsp\;", "").strip, :user_id => current_user.id,
:praise_count => 0, :position => params[:position], :challenge_id => params[:challenge_id],
:hidden => !current_user.admin?) # 管理员回复的能够显示
:praise_count => 0, :position => params[:position], :challenge_id => params[:challenge_id])
rescue Exception => e
uid_logger_error("create discuss failed : #{e.message}")
raise Educoder::TipException.new("评论异常,原因:#{e.message}")

@ -262,7 +262,7 @@ class EcloudController < ApplicationController
u.login = "ecoder_#{user_info['mobile']}"
u.type ='User'
u.status = User::STATUS_ACTIVE
u.nickname = user_info[:username]
u.nickname = user_info['username']
u.lastname = user_info['username']
end

@ -1,9 +1,10 @@
class Weapps::AttendancesController < ApplicationController
before_action :require_login
before_action :find_course, only: [:create, :index, :student_attendances]
before_action :find_attendance, except: [:create, :index, :student_attendances]
before_action :find_course, only: [:create, :index, :student_attendances, :history_attendances]
before_action :find_attendance, except: [:create, :index, :student_attendances, :history_attendances]
before_action :user_course_identity
before_action :teacher_allowed, only: [:create]
before_action :edit_auth, only: [:update, :destroy, :end]
def create
ActiveRecord::Base.transaction do
@ -13,19 +14,34 @@ class Weapps::AttendancesController < ApplicationController
group_ids.each do |group_id|
@course.course_attendance_groups.create!(course_group_id: group_id, course_attendance: attendance)
end
CreateStudentAttendanceRecordJob.perform_now(attendance.id, group_ids)
else
@course.course_attendance_groups.create!(course_group_id: 0, course_attendance: attendance)
CreateStudentAttendanceRecordJob.perform_later(attendance.id, [0])
end
render_ok({attendance_id: attendance.id})
end
end
def index
tip_exception(403) if @user_course_identity >= Course::STUDENT
current_date = Date.current
current_end_time = Time.current.strftime("%H:%M:%S")
@current_attendance = @course.course_attendances.where("attendance_date = '#{current_date}' and end_time > '#{current_end_time}'").take
all_attendances = @course.course_attendances.where("attendance_date < '#{current_date}' or (attendance_date = '#{current_date}' and end_time < '#{current_end_time}')")
@all_member_attendances = CourseMemberAttendance.where(course_attendance_id: all_attendances)
if params[:group_id].present?
all_attendances = all_attendances.joins(:course_attendance_groups).where(course_attendance_groups: {course_group_id: [params[:group_id], 0]})
@all_member_attendances = @all_member_attendances.joins(:course_member).where(course_members: {course_group_id: params[:group_id]})
end
@history_attendances = all_attendances.order("id asc")
@all_history_count = @history_attendances.size
end
def student_attendances
tip_exception(403, "") if @user_course_identity != Course::STUDENT
tip_exception("学生身份的签到列表") if @user_course_identity != Course::STUDENT
member = @course.students.find_by(user_id: current_user.id)
current_date = Date.current
current_end_time = Time.current.strftime("%H:%M:%S")
@ -49,8 +65,8 @@ class Weapps::AttendancesController < ApplicationController
@leave_count = 0
@absence_count = 0
else
@normal_count = @course.course_member_attendances.where(course_attendance_id: student_attendance_ids, attendance_status: 1).size
@leave_count = @course.course_member_attendances.where(course_attendance_id: student_attendance_ids, attendance_status: 2).size
@normal_count = @course.course_member_attendances.where(course_attendance_id: student_attendance_ids, attendance_status: "NORMAL").size
@leave_count = @course.course_member_attendances.where(course_attendance_id: student_attendance_ids, attendance_status: "LEAVE").size
@absence_count = student_attendance_ids.uniq.size - @normal_count - @leave_count
end
@ -59,17 +75,49 @@ class Weapps::AttendancesController < ApplicationController
end
def show
@normal_count = @attendance.normal_count
@leave_count = @attendance.leave_count
@absence_count = @attendance.absence_count
@all_count = @attendance.course_member_attendances.size
@_is_current_attendance = @attendance.current_attendance?
if @attendance.course_attendance_groups.first&.course_group_id.to_i == 0
@groups = @course.course_groups
else
@groups = @course.course_groups.where(id: @attendance.course_attendance_groups.pluck(:course_group_id))
end
@groups = @groups.includes(:course_members) if @_is_current_attendance
@all_attendances = @attendance.course_member_attendances
end
def update
tip_exception(403, "") unless @user_course_identity < Course::PROFESSOR || @attendance.user_id == current_user.id
@attendance.update!(name: params[:name])
render_ok
end
def destroy
@attendance.destroy!
render_ok
end
def history_attendances
current_date = Date.current
current_end_time = Time.current.strftime("%H:%M:%S")
@history_attendances = @course.course_attendances.where("attendance_date < '#{current_date}' or
(attendance_date = '#{current_date}' and end_time < '#{current_end_time}')").order("id desc")
@all_history_count = @history_attendances.size
@history_attendances = paginate @history_attendances.includes(:course_member_attendances)
end
def end
a_end_time = "#{@attendance.attendance_date} #{@attendance.end_time}".to_time
tip_exception("该签到已截止") unless @attendance.current_attendance?
@attendance.update!(end_time: Time.current)
render_ok
end
private
@ -81,4 +129,8 @@ class Weapps::AttendancesController < ApplicationController
@attendance = CourseAttendance.find params[:id]
@course = @attendance.course
end
def edit_auth
tip_exception(403, "") unless @user_course_identity < Course::PROFESSOR || @attendance.user_id == current_user.id
end
end

@ -1,9 +1,21 @@
class Weapps::CourseMemberAttendancesController < ApplicationController
before_action :require_login
before_action :find_course, :user_course_identity, only: [:update_status]
def index
attendance = CourseAttendance.find params[:attendance_id]
@member_attendances = attendance.course_member_attendances
if params[:group_ids].present?
@member_attendances = @member_attendances.joins(:course_member).where(course_members: {course_group_id: params[:group_ids]})
end
@member_attendances = @member_attendances.where(attendance_status: params[:attendance_status]) if params[:attendance_status].present?
@member_attendances = @member_attendances.joins(user: :user_extension).order("user_extensions.student_id asc")
@member_attendances = paginate @member_attendances.preload(user: :user_extension)
end
def create
tip_exception("签到码不能为空") if params[:code].blank?
tip_exception("attendance_mode参数不对") if [1, 2].include?(params[:attendance_mode])
tip_exception("attendance_mode参数不对") unless ["NUMBER", "QRCODE"].include?(params[:attendance_mode])
attendance = CourseAttendance.find_by(attendance_code: params[:code])
tip_exception("签到码输入有误") if attendance.blank? || attendance.course.blank?
@ -11,19 +23,38 @@ class Weapps::CourseMemberAttendancesController < ApplicationController
member = attendance.course.students.find_by(user_id: current_user.id)
tip_exception("签到码输入有误") if member.blank?
start_time = "#{attendance.attendance_date} #{attendance.start_time}".to_time
end_time = "#{attendance.attendance_date} #{attendance.end_time}".to_time
Rails.logger.info("##############{start_time} #{end_time}")
tip_exception("不在签到时间内") unless start_time < Time.current && Time.current < end_time
tip_exception("不在签到时间内") unless attendance.current_attendance?
current_attendance = attendance.course_member_attendances.find_by(user_id: current_user.id)
tip_exception("请勿重复签到") if current_attendance.present? && current_attendance.attendance_status == 1
tip_exception("您当前是请假状态,无法签到") if current_attendance.present? && current_attendance.attendance_status == 2
tip_exception("您当前是旷课状态,无法签到") if current_attendance.present? && current_attendance.attendance_status == 0
tip_exception("只支持数字签到") if attendance.mode != "ALL" && attendance.mode == "NUMBER" && params[:attendance_mode] == "QRCODE"
tip_exception("只支持二维码签到") if attendance.mode != "ALL" && attendance.mode == "QRCODE" && params[:attendance_mode] == "NUMBER"
unless current_attendance.present?
current_attendance = attendance.course_member_attendances.find_by(user_id: current_user.id)
if current_attendance.present?
tip_exception("请勿重复签到") if current_attendance.attendance_status == "NORMAL"
tip_exception("您当前是请假状态,无法签到") if current_attendance.attendance_status == "LEAVE"
tip_exception("您当前是旷课状态,无法签到") if current_attendance.attendance_status == "ABSENCE" && current_attendance.attendance_mode == "TEACHER"
current_attendance.update!(attendance_status: "NORMAL", attendance_mode: params[:attendance_mode])
else
attendance.course_member_attendances.create!(course_member_id: member.id, user_id: current_user.id, course_id: attendance.course_id,
course_group_id: member.course_group_id, attendance_status: 1, attendance_mode: params[:attendance_mode] || 2)
course_group_id: member.course_group_id, attendance_status: "NORMAL", attendance_mode: params[:attendance_mode])
end
render_ok
end
def update_status
tip_exception("user_id不能为空") if params[:user_id].blank?
tip_exception(403, "无权限调整签到状态") if @user_course_identity > Course::ASSISTANT_PROFESSOR
tip_exception("attendance_status参数不对") unless ["NORMAL", "LEAVE", "ABSENCE"].include?(params[:attendance_status])
attendance = @course.course_attendances.find_by!(id: params[:attendance_id])
current_attendance = attendance.course_member_attendances.find_by(user_id: params[:user_id])
if current_attendance.present?
current_attendance.update!(attendance_status: params[:attendance_status], attendance_mode: "TEACHER")
else
member = attendance.course.students.find_by(user_id: params[:user_id])
tip_exception( "该用户非课堂学生") if member.blank?
attendance.course_member_attendances.create!(course_member_id: member.id, user_id: params[:user_id], course_id: attendance.course_id,
course_group_id: member.course_group_id, attendance_status: params[:attendance_status], attendance_mode: "TEACHER")
end
render_ok
end

@ -2,6 +2,19 @@ module Weapps::AttendancesHelper
def student_attendance_status attendance, user
st_attendance = attendance.course_member_attendances.find_by(user_id: user.id)
st_attendance.present? ? st_attendance.attendance_status : 0
st_attendance.present? ? st_attendance.attendance_status : "ABSENCE"
end
def group_attendance_count attendances, group
course_member_ids = group.course_members.pluck(:id)
attendances.select{|attendance| course_member_ids.include?(attendance.course_member_id) && attendance.attendance_status == "NORMAL"}.size
end
def history_member_count member_attendances, status, attendance_id
member_attendances.select{|member_attendance| member_attendance.attendance_status == status && member_attendance.course_attendance_id == attendance_id}.size
end
def cal_rate base, sum
sum == 0 ? 0 : (base.to_f / sum)
end
end

@ -0,0 +1,26 @@
class CreateStudentAttendanceRecordJob < ApplicationJob
queue_as :default
def perform(attendance_id, group_ids)
attendance = CourseAttendance.find_by(id: attendance_id)
course = attendance.course
return if attendance.blank? || course.blank?
if group_ids.include?(0)
students = course.students
else
students = course.students.where(course_group_id: group_ids)
end
attrs = %i[course_attendance_id user_id course_member_id course_id course_group_id created_at updated_at]
same_attrs = {course_attendance_id: attendance.id, course_id: course.id}
CourseMemberAttendance.bulk_insert(*attrs) do |worker|
students.each do |student|
worker.add same_attrs.merge(user_id: student.user_id, course_member_id: student.id, course_group_id: student.course_group_id)
end
end
end
end

@ -0,0 +1,28 @@
class StudentJoinAttendanceRecordJob < ApplicationJob
queue_as :default
def perform(member_id)
member = CourseMember.find_by(id: member_id)
course = member&.course
return if member.blank? || course.blank?
current_date = Date.current
current_end_time = Time.current.strftime("%H:%M:%S")
group_ids = member.course_group_id == 0 ? [0] : [member.course_group_id, 0]
current_attendance_ids = course.course_attendances.joins(:course_attendance_groups).where(course_group_id: group_ids).
where("(attendance_date = '#{current_date}' and start_time <= '#{current_end_time}' and end_time > '#{current_end_time}') or (attendance_date > '#{current_date}')").pluck(:id)
attrs = %i[course_attendance_id user_id course_member_id course_id course_group_id created_at updated_at]
same_attrs = {course_member_id: member_id, course_id: course.id, user_id: member.user_id, course_group_id: member.course_group_id}
CourseMemberAttendance.bulk_insert(*attrs) do |worker|
current_attendance_ids.each do |attendance_id|
worker.add same_attrs.merge(course_attendance_id: attendance_id)
end
end
end
end

@ -1,5 +1,8 @@
class CourseAttendance < ApplicationRecord
# status: 0: 未开启1已开启2已截止
# mode: 0 两种签到1 二维码签到2 数字签到
enum mode: { ALL: 0, QRCODE: 1, NUMBER: 2 }
belongs_to :course
belongs_to :user
@ -14,6 +17,32 @@ class CourseAttendance < ApplicationRecord
after_create :generate_attendance_code
# 正常签到人数
def normal_count
course_member_attendances.select{|member_attendance| member_attendance.attendance_status == "NORMAL"}.size
end
# 请假人数
def leave_count
course_member_attendances.select{|member_attendance| member_attendance.attendance_status == "LEAVE"}.size
end
# 旷课人数
def absence_count
course_member_attendances.select{|member_attendance| member_attendance.attendance_status == "ABSENCE"}.size
end
# 总人数
def all_count
course_member_attendances.size
end
def current_attendance?
a_start_time = "#{attendance_date} #{start_time}".to_time
a_end_time = "#{attendance_date} #{end_time}".to_time
a_start_time < Time.current && Time.current < a_end_time
end
# 延迟生成邀请码
def attendance_code
return generate_attendance_code

@ -23,6 +23,12 @@ class CourseMember < ApplicationRecord
# after_destroy :delete_works
# after_create :work_operation
after_create :create_attendance_record
def create_attendance_record
StudentJoinAttendanceRecordJob.perform_later(id)
end
def delete_works
if self.role == "STUDENT"
course = self.course

@ -1,6 +1,8 @@
class CourseMemberAttendance < ApplicationRecord
# attendance_mode 1 二维码签到2 数字签到3 老师签到
# attendance_mode 0 初始数据1 二维码签到2 数字签到3 老师签到
enum attendance_mode: { DEFAULT: 0, QRCODE: 1, NUMBER: 2, TEACHER: 3}
# attendance_status 1 正常签到2 请假0 旷课
enum attendance_status: { NORMAL: 1, LEAVE: 2, ABSENCE: 0 }
belongs_to :course_member
belongs_to :user
belongs_to :course

@ -9,6 +9,10 @@ class ApplicationService
content.gsub(regex, '')
end
def convert_https content
content.gsub("http:", "https:")
end
private
def strip(str)

@ -12,7 +12,7 @@ class Videos::DispatchCallbackService < ApplicationService
# TODO:: 拆分事件分发
case params['EventType']
when 'FileUploadComplete' then # 视频上传完成
video.file_url = params['FileUrl']
video.file_url = convert_https(params['FileUrl'])
video.filesize = params['Size']
video.upload_success
video.save!

@ -0,0 +1,9 @@
json.history_attendances @history_attendances do |attendance|
json.(attendance, :id, :name)
json.created_at attendance.created_at.strftime("%Y/%m/%d %H:%M")
json.normal_count attendance.normal_count
json.leave_count attendance.leave_count
json.absence_count attendance.absence_count
json.edit_auth @user_course_identity < Course::PROFESSOR || attendance.user_id == User.current.id
end
json.all_history_count @all_history_count

@ -0,0 +1,21 @@
json.current_attendance do
json.(@current_attendance, :id, :normal_count, :all_count) if @current_attendance
end
all_normal_rate = []
all_absence_rate = []
json.history_attendances @history_attendances.each_with_index.to_a do |attendance, index|
normal_count = history_member_count(@all_member_attendances, "NORMAL", attendance.id)
absence_count = history_member_count(@all_member_attendances, "ABSENCE", attendance.id)
all_count = @all_member_attendances.select{|member_attendance| member_attendance.course_attendance_id == attendance.id}.size
json.index index + 1
json.normal_rate cal_rate(normal_count, all_count)
all_normal_rate << cal_rate(normal_count, all_count)
json.absence_rate cal_rate(absence_count, all_count)
all_absence_rate << cal_rate(absence_count, all_count)
end
json.all_history_count @all_history_count
json.avg_normal_rate @all_history_count == 0 ? 0 : all_normal_rate.sum / @all_history_count
json.avg_absence_rate @all_history_count == 0 ? 0 : all_absence_rate.sum / @all_history_count

@ -0,0 +1,10 @@
json.normal_count @normal_count
json.leave_count @leave_count
json.absence_count @absence_count
json.all_count @all_count
json.code @attendance.attendance_code
json.edit_auth @user_course_identity < Course::PROFESSOR || @attendance.user_id == User.current.id
json.course_groups @groups do |group|
json.(group, :id, :name, :course_members_count)
json.attendance_count group_attendance_count(@all_attendances, group) if @_is_current_attendance
end

@ -0,0 +1,5 @@
json.member_attendances @member_attendances.each do |member|
json.(member, :user_id, :attendance_status)
json.user_name member.user&.real_name
json.student_id member.user&.student_id
end

@ -38,7 +38,6 @@ module Educoderplus
origins '*'
# location of your api
resource '/*', :headers => :any, :methods => [:get, :post, :delete, :options, :put]
resource 'http://outin-396971199eed11e991a100163e1c7426.oss-cn-shanghai.aliyuncs.com/*', :headers => :any, :methods => [:get, :post, :delete, :options, :put]
end
end
end

@ -1061,11 +1061,15 @@ Rails.application.routes.draw do
resources :attendances, only: [:index, :update, :create, :show, :destroy], shallow: true do
collection do
get :student_attendances
get :history_attendances
end
post :end, on: :member
end
end
resources :course_member_attendances, only: [:create]
resources :course_member_attendances, only: [:create, :index] do
post :update_status, on: :collection
end
resources :homework_commons do
post :update_settings, on: :member

@ -0,0 +1,5 @@
class ModidyHiddenDefaultForDiscusses < ActiveRecord::Migration[5.2]
def change
change_column :discusses, :hidden, :boolean, :default => false
end
end

@ -29,6 +29,24 @@ namespace :video do
end
end
desc "将http修改成http"
task modify_http_to_https_file_url: :environment do
p "s"
if ENV['args']
course_id = ENV['args'].split(",")[0]
video_ids = CourseVideo.where(course_id: course_id).pluck(:video_id)
videos = Video.where(id: video_ids)
if videos
videos.each do |v|
if v.file_url
file_url = v.file_url.gsub("http:", "https:")
v.update_column(:file_url, file_url)
end
end
end
end
end
# 执行示例 bundle exec rake video:sample args=2933,'2019-08-19 00:00:00','2019-11-09 23:59:59'
task :sample => :environment do
if ENV['args']

@ -217,9 +217,11 @@ function generateNewIndexJsp() {
</script>
`
var jsMinAllRegex = /<script type="text\/javascript" src="\/js\/js_min_all.js"><\/script>/
var flvMinAllRegex = /<script type="text\/javascript" src="\/js\/flv.min.js"><\/script>/
// <script type="text/javascript" src="/js/js_min_all.js"></script>
var result = data
.replace(jsMinAllRegex, code)
.replace(flvMinAllRegex, code)
// .replace('/js/js_min_all.js', `${cdnHost}/react/build/js/js_min_all.js?v=${newVersion}`)
// .replace('/js/js_min_all_2.js', `${cdnHost}/react/build/js/js_min_all_2.js?v=${newVersion}`)

@ -793,37 +793,37 @@ class App extends Component {
render={
(props) => (<Paperreview {...this.props} {...props} {...this.state} />)
}/>
<Route path="/paperlibrary/edit/:id"
render={
(props) => (<Paperlibraryeditid {...this.props} {...props} {...this.state} />)
}/>
{/*<Route path="/paperlibrary/edit/:id"*/}
{/* render={*/}
{/* (props) => (<Paperlibraryeditid {...this.props} {...props} {...this.state} />)*/}
{/* }/>*/}
<Route path="/paperlibrary/see/:id"
render={
(props) => (<Paperlibraryseeid {...this.props} {...props} {...this.state} />)
}/>
{/*<Route path="/paperlibrary/see/:id"*/}
{/* render={*/}
{/* (props) => (<Paperlibraryseeid {...this.props} {...props} {...this.state} />)*/}
{/* }/>*/}
<Route path="/myproblems/:id/:tab?"
render={
(props) => (<StudentStudy {...this.props} {...props} {...this.state} />)
} />
<Route path="/question/edit/:id"
render={
(props) => (<Questionitem_banks {...this.props} {...props} {...this.state} />)
} />
<Route path="/question/newitem"
render={
(props) => (<Questionitem_banks {...this.props} {...props} {...this.state} />)
} />
<Route path="/question/:type"
render={
(props) => (<Headplugselection {...this.props} {...props} {...this.state} />)
} />
<Route path="/paperlibrary"
render={
(props) => (<Testpaperlibrary {...this.props} {...props} {...this.state} />)
}/>
{/*<Route path="/question/edit/:id"*/}
{/* render={*/}
{/* (props) => (<Questionitem_banks {...this.props} {...props} {...this.state} />)*/}
{/* } />*/}
{/*<Route path="/question/newitem"*/}
{/* render={*/}
{/* (props) => (<Questionitem_banks {...this.props} {...props} {...this.state} />)*/}
{/* } />*/}
{/*<Route path="/question/:type"*/}
{/* render={*/}
{/* (props) => (<Headplugselection {...this.props} {...props} {...this.state} />)*/}
{/* } />*/}
{/*<Route path="/paperlibrary"*/}
{/* render={*/}
{/* (props) => (<Testpaperlibrary {...this.props} {...props} {...this.state} />)*/}
{/* }/>*/}
<Route path="/Integeneration"
render={
@ -835,15 +835,19 @@ class App extends Component {
(props) => (<Developer {...this.props} {...props} {...this.state} />)
}/>
<Route path="/question"
render={
(props) => (<Headplugselection {...this.props} {...props} {...this.state} />)
}/>
{/*<Route path="/question"*/}
{/* render={*/}
{/* (props) => (<Headplugselection {...this.props} {...props} {...this.state} />)*/}
{/* }/>*/}
{/*<Route path="/wxcode/:identifier?" component={WXCode}*/}
{/* render={*/}
{/* (props)=>(<WXCode {...this.props} {...props} {...this.state}></WXCode>)*/}
{/* }*/}
{/*/>*/}
<Route exact path="/"
// component={ShixunsHome}
render={

@ -9,7 +9,7 @@ import axios from 'axios';
const { TextArea } = Input;
const { Option } = Select;
const array=['腾讯课堂','B站','斗鱼','威佰通'];
const array=['腾讯课堂','斗鱼直播','Bilibili','威佰通'];
function range(start, end) {
const result = [];
@ -212,6 +212,19 @@ class LiveNew extends Component{
className="liveModal"
>
<Spin spinning={isSpining}>
<style>
{`
.ant-select-dropdown-menu-item{
text-align:center;
padding: 10px 0px;
border-bottom: 1px solid #eee;
}
.ant-select-dropdown-menu-item:last-child{
border-bottom:none;
}
`
}
</style>
<div className="task-popup-content">
<Form onSubmit={this.handleSubmit}>
<Form.Item label={`直播课程`}>
@ -229,6 +242,7 @@ class LiveNew extends Component{
placeholder="请选择或输入直播平台名称"
onChange={this.ChangePlatform}
dataSource={dataSource}
className="plateAutoComplete"
>
</AutoComplete>
)}

@ -1298,10 +1298,12 @@ class CommonWorkSetting extends Component{
{/* 匿评数量 */}
<div className={"h20 mb30 ml60"}>
<span>匿评数量</span>
<Tooltip placement="bottom" title={starttimetype===true?this.props.isAdmin()?"发布时间已过,则不能修改":"":""}>
<Tooltip placement="bottom" title={this.props.isAdmin()?moment(init_evaluation_start) < this.fetchMoment?"匿评已开启无法修改匿评数量":"":""}>
<span>
<Input type="number" className="mr10" style={{width:"100px" }} value={evaluation_num} onInput={this.evaluation_num_change}
disabled={anonymous_comment && !noAuth? false : true} min={0} max={100}
disabled={anonymous_comment && !noAuth?
moment(init_evaluation_start) < this.fetchMoment?true:false
: true} min={0} max={100}
/>
</span>
</Tooltip>

@ -525,7 +525,6 @@ class Coursesleftnav extends Component{
}
saveNavmodapost=(url,value,positiontype,coursesId)=>{
axios.post(url,
{name:value}).then((result)=>{
if(result!=undefined){
@ -554,7 +553,8 @@ class Coursesleftnav extends Component{
}
if(positiontype==="course_groups"){
window.location.href=`/courses/${coursesId}/course_groups/${result.data.group_id}`;
this.props.updataleftNavfun();
this.props.history.push(`/courses/${coursesId}/course_groups/${result.data.group_id}`);
}
}
@ -585,6 +585,7 @@ class Coursesleftnav extends Component{
}
saveNavmoda=()=>{
debugger;
let {Navmodaltypename,setnavid,NavmodalValue}=this.state;
let id =setnavid;

@ -66,7 +66,7 @@ function CourseGroupListTable(props) {
className:"color-grey-6",
render: (name, record, index) => {
return <WordsBtn title={name.length > 11 ? name : ''} onClick={() => onGoDetail(record)} style={''}
className="overflowHidden1" style2={{maxWidth: '180px', verticalAlign: 'bottom'}}>
className="overflowHidden1 color-dark" style2={{maxWidth: '180px', verticalAlign: 'bottom'}}>
{name}</WordsBtn>
}
},
@ -154,7 +154,7 @@ function CourseGroupListTable(props) {
{!isCourseEnd && isAdmin && <WordsBtn style2={{ marginRight: '12px' }} onClick={() => onDelete(record)} style={'grey'}>删除分班</WordsBtn>}
{isStudent && <WordsBtn style2={{ marginRight: '12px' }} onClick={() => addToDir(record)} style={''}>加入分班</WordsBtn>}
<WordsBtn onClick={() => onGoDetail(record)} style={''}>查看</WordsBtn>
<WordsBtn onClick={() => onGoDetail(record)} style={''} className="color-dark">查看</WordsBtn>
</React.Fragment>
}
})

@ -87,7 +87,9 @@ class Shixuninformation extends Component {
this.props.form.setFieldsValue({
selectscripts: this.props.data && this.props.data.shixun.standard_scripts[0].id
})
this.get_mirror_script(this.props.data && this.props.data.shixun.standard_scripts[0].id)
console.log(this.props);
// debugger;
// this.get_mirror_script(this.props.data && this.props.data.shixun.standard_scripts[0].id)
} else {
this.props.form.setFieldsValue({
selectscripts: this.props.data && this.props.data.shixun.choice_standard_scripts

@ -8,7 +8,7 @@ import 'antd/lib/select/style/index.css';
import 'antd/lib/input/style/index.css';
import './shixunCss/ShixunSearchBar.css';
import './shixunCss/ShixunSearchBar.css';
import axios from 'axios';
@ -206,9 +206,9 @@ render() {
return (
<div className="edu-back-white" >
<div className="educontent">
<div className="pt40 pb40">
<div className="clearfix mb30 shaiContent">
<span className="shaiTitle fl mt3">方向</span>
<div className="pt_b_26">
<div className="clearfix mb20 shaiContent">
<span className="shaiTitle fl">方向</span>
<div className="fl pr shaiAllItem">
<li className={shixunsearchAllvalue==="a"?"shaiItem shixun_repertoire active":"shaiItem shixun_repertoire"} value= "a" onClick={this.shixunsearchall}>全部</li>
<style>
@ -222,8 +222,8 @@ render() {
float: left;
margin-right: 20px;
color: #999;
cursor: pointer;
margin-bottom: 10px;
cursor: pointer;
margin-bottom:10px;
}
.ant-dropdown-menu-item, .ant-dropdown-menu-submenu-title{
padding: 0px 12px;
@ -250,12 +250,23 @@ render() {
</div>
</div>
<div className="clearfix">
<span className="shaiTitle fl mt6">筛选</span>
<span className="shaiTitle fl">筛选</span>
{
<style>
{`
{`
.shaiContent li.shaiItem{
padding:0px 15px;
line-height:32px;
height:32px
}
.shaiTitle{
height:32px;
line-height:32px;
}
.shaiItems{
padding: 3px 15px;
padding:0px 15px;
line-height:32px;
height:32px;
float: left;
border-radius: 4px;
color: #4C4C4C;

@ -10,7 +10,7 @@ import { Spin } from 'antd';
import { TPMIndexHOC } from '../TPMIndexHOC';
import { SnackbarHOC } from 'educoder';
import { SnackbarHOC,getImageUrl} from 'educoder';
import ShixunCardList from './ShixunCardList';
@ -389,6 +389,35 @@ class ShixunsIndex extends Component {
{this.state.updata===undefined?"":<UpgradeModals
{...this.state}
/>}
<style>
{
` ::-webkit-scrollbar {
width: 0px !important;
}
.myshixin-head{
width: 100%;
height: 240px;
background-image: url(${getImageUrl(this.props.mygetHelmetapi && this.props.mygetHelmetapi.shixun_banner_url === null ?`images/educoder/courses/courses.jpg`:this.props.mygetHelmetapi&&this.props.mygetHelmetapi.shixun_banner_url)});
background-color: #081C4B;
background-position: center;
background-repeat: no-repeat;
}
`
}
</style>
{
this.props.mygetHelmetapi&&this.props.mygetHelmetapi.shixun_banner_url?
<div className="myshixin-head pr" >
<div className="edu-txt-center pathNavLine">
<div className="inline path-nav">
</div>
</div>
</div>
:
""
}
{/*<Spin spinning={typepvisible} size="large" style={{marginTop:'15%'}}>*/}
<ShixunSearchBar
Updatasearchlist={this.Updatasearchlist.bind(this)}

@ -4,6 +4,9 @@
right: 3px;
top: 0px;
}
.pt_b_26{
padding:26px 0px;
}
.diffSelect{
margin-left:20px !important;

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe CreateStudentAttendanceRecordJob, type: :job do
pending "add some examples to (or delete) #{__FILE__}"
end

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe StudentJoinAttendanceRecordJob, type: :job do
pending "add some examples to (or delete) #{__FILE__}"
end
Loading…
Cancel
Save