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

courseware
caicai8 5 years ago
commit 536df12241

@ -0,0 +1,53 @@
class AttendancesController < ApplicationController
before_action :require_login
before_action :find_course, only: [:index, :student_attendances, :history_attendances]
before_action :find_attendance, except: [:index, :student_attendances, :history_attendances]
before_action :user_course_identity
def index
current_date = Date.current
current_end_time = Time.current.strftime("%H:%M:%S")
if params[:history]
@attendances = @course.course_attendances.where("attendance_date < '#{current_date}' or
(attendance_date = '#{current_date}' and end_time < '#{current_end_time}')")
if @user_course_identity == Course::STUDENT
member = @course.students.find_by(user_id: current_user.id)
group_ids = [member&.course_group_id.to_i, 0]
@attendances = @attendances.joins(:course_attendance_groups).where(course_attendance_groups: {course_group_id: group_ids})
attendance_ids = @attendances.pluck(:id)
@normal_count = @course.course_member_attendances.where(course_member_id: member&.id, course_attendance_id: attendance_ids, attendance_status: "NORMAL").size
@leave_count = @course.course_member_attendances.where(course_member_id: member&.id, course_attendance_id: attendance_ids, attendance_status: "LEAVE").size
@absence_count = @course.course_member_attendances.where(course_member_id: member&.id, course_attendance_id: attendance_ids, attendance_status: "ABSENCE").size
end
else
@attendances = @course.course_attendances.where("attendance_date > '#{current_date}' or
(attendance_date = '#{current_date}' and end_time > '#{current_end_time}')")
end
@attendances_count = @attendances.size
@attendances = @attendances.order("attendance_date desc, start_time desc")
@attendances = paginate @attendances.includes(:user, :course_member_attendances)
end
def statistics
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
private
def find_attendance
@attendance = CourseAttendance.find params[:id]
@course = @attendance.course
end
end

@ -162,7 +162,7 @@ class ChallengesController < ApplicationController
#@pass_games_map = @shixun.challenges.joins(:games).where(games: {status:2}).group(:challenge_id).reorder(nil).count #@pass_games_map = @shixun.challenges.joins(:games).where(games: {status:2}).group(:challenge_id).reorder(nil).count
#@play_games_map = @shixun.challenges.joins(:games).where(games: {status:[0,1]}).group(:challenge_id).reorder(nil).count #@play_games_map = @shixun.challenges.joins(:games).where(games: {status:[0,1]}).group(:challenge_id).reorder(nil).count
@challenges = @shixun.challenges.joins(join_sql).select(base_columns) @challenges = @shixun.challenges.joins(join_sql).select(base_columns).uniq
#@challenges = @shixun.challenges.fields_for_list #@challenges = @shixun.challenges.fields_for_list
@editable = @shixun.status == 0 # before_action有判断权限如果没发布则肯定是管理人员 @editable = @shixun.status == 0 # before_action有判断权限如果没发布则肯定是管理人员

@ -399,7 +399,7 @@ class ExercisesController < ApplicationController
choice_random = params[:choice_random] ? true : false choice_random = params[:choice_random] ? true : false
score_open = params[:score_open] ? true : false #分数是否公开 score_open = params[:score_open] ? true : false #分数是否公开
answer_open = params[:answer_open] ? true : false #答案是否公开 answer_open = params[:answer_open] ? true : false #答案是否公开
assistant_auth = params[:assistant_auth] ? true : false # 助教权限 assistant_auth = params[:assistant_auth] # 助教权限
# 统一设置或者分班为0则更新试卷并删除试卷分组 # 统一设置或者分班为0则更新试卷并删除试卷分组
if unified_setting || (course_group_ids.size == 0) if unified_setting || (course_group_ids.size == 0)
@ -532,7 +532,8 @@ class ExercisesController < ApplicationController
:answer_open => answer_open, :answer_open => answer_open,
:exercise_status => exercise_status, :exercise_status => exercise_status,
:publish_time => p_time, :publish_time => p_time,
:end_time => e_time :end_time => e_time,
:assistant_auth => assistant_auth
} }
@exercise.update!(exercise_params) @exercise.update!(exercise_params)
if @exercise.exercise_status == Exercise::PUBLISHED if @exercise.exercise_status == Exercise::PUBLISHED
@ -773,10 +774,11 @@ class ExercisesController < ApplicationController
ex_group_setting = exercise.exercise_group_settings ex_group_setting = exercise.exercise_group_settings
old_exercise_groups = ex_group_setting.find_in_exercise_group("course_group_id", g_course) #试卷的分组设置 old_exercise_groups = ex_group_setting.find_in_exercise_group("course_group_id", g_course) #试卷的分组设置
left_course_groups = teacher_course_group_ids - g_course left_course_groups = teacher_course_group_ids - g_course
all_left_groups = all_course_group_ids - g_course
left_exercise_groups = ex_group_setting.find_in_exercise_group("course_group_id", left_course_groups) left_exercise_groups = ex_group_setting.find_in_exercise_group("course_group_id", left_course_groups)
if left_exercise_groups.blank? && exercise.unified_setting if left_exercise_groups.blank? && exercise.unified_setting
if left_course_groups.size > 0 #开始为统一设置但是立即截止为分班。则创建没有立即截止的班级的exercise_group_setting if all_left_groups.size > 0 #开始为统一设置但是立即截止为分班。则创建没有立即截止的班级的exercise_group_setting
left_course_groups.each do |g| all_left_groups.each do |g|
ex_group_options = { ex_group_options = {
:exercise_id => exercise.id, :exercise_id => exercise.id,
:course_group_id => g, :course_group_id => g,

@ -359,6 +359,9 @@ class HomeworkCommonsController < ApplicationController
def new def new
tip_exception("type参数有误") if params[:type].blank? || ![1, 3].include?(params[:type].to_i) tip_exception("type参数有误") if params[:type].blank? || ![1, 3].include?(params[:type].to_i)
@homework_type = params[:type].to_i @homework_type = params[:type].to_i
module_type = params[:type].to_i == 1 ? "common_homework" : "group_homework"
@main_category = @course.course_modules.find_by(module_type: module_type)
@category = @main_category.course_second_categories.find_by(id: params[:category]) if params[:category].present?
end end
def create def create
@ -376,6 +379,11 @@ class HomeworkCommonsController < ApplicationController
@homework.user_id = current_user.id @homework.user_id = current_user.id
@homework.course_id = @course.id @homework.course_id = @course.id
if params[:category].present?
category = @course.course_second_categories.find_by(id: params[:category])
@homework.course_second_category_id = category&.id.to_i
end
homework_detail_manual = HomeworkDetailManual.new homework_detail_manual = HomeworkDetailManual.new
@homework.homework_detail_manual = homework_detail_manual @homework.homework_detail_manual = homework_detail_manual
homework_detail_manual.te_proportion = 0.7 homework_detail_manual.te_proportion = 0.7
@ -404,7 +412,12 @@ class HomeworkCommonsController < ApplicationController
end end
def edit def edit
if @homework.course_second_category_id == 0
module_type = @homework.homework_type == "normal" ? "common_homework" : "group_homework"
@main_category = @course.course_modules.find_by(module_type: module_type)
else
@category = @homework.course_second_category
end
end end
def update def update

@ -22,23 +22,17 @@ class MyshixunsController < ApplicationController
tip_exception("403", "") tip_exception("403", "")
end end
begin begin
@shixun = Shixun.select(:id, :identifier, :challenges_count).find(@myshixun.shixun_id)
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
begin
@shixun = Shixun.select(:id, :identifier, :challenges_count).find(@myshixun.shixun_id)
@myshixun.destroy! @myshixun.destroy!
StudentWork.where(:myshixun_id => @myshixun.id).update_all(myshixun_id: 0, work_status: 0, work_score: nil,
final_score: nil, efficiency: 0, eff_score: 0, calculation_time: nil, cost_time: 0, compelete_status: 0) StudentWork.where(:myshixun_id => @myshixun.id)
rescue Exception => e .update_all(myshixun_id: 0, work_status: 0, work_score: nil,
logger.error("######reset_my_game_failed:#{e.message}") final_score: nil, efficiency: 0, eff_score: 0, calculation_time: nil, cost_time: 0, compelete_status: 0)
raise("ActiveRecord::RecordInvalid")
end
end end
# 删除版本库 # 删除版本库
GitService.delete_repository(repo_path: @repo_path) unless @shixun.is_choice_type? GitService.delete_repository(repo_path: @repo_path) unless @shixun.is_choice_type?
rescue Exception => e rescue Exception => e
if e.message != "ActiveRecord::RecordInvalid"
logger.error("######delete_repository_error-:#{e.message}")
end
raise "delete_repository_error:#{e.message}" raise "delete_repository_error:#{e.message}"
end end
end end

@ -212,6 +212,11 @@ class QuestionBanksController < ApplicationController
homework_type: homework.homework_type, course_id: course.id, homework_bank_id: homework.id, homework_type: homework.homework_type, course_id: course.id, homework_bank_id: homework.id,
reference_answer: homework.reference_answer) reference_answer: homework.reference_answer)
if params[:category].present?
category = course.course_second_categories.find_by(id: params[:category])
new_homework.course_second_category_id = category&.id.to_i
end
# 作业的基本设置复制 # 作业的基本设置复制
new_homework.homework_detail_manual = HomeworkDetailManual.new new_homework.homework_detail_manual = HomeworkDetailManual.new
new_homework_detail_manual = new_homework.homework_detail_manual new_homework_detail_manual = new_homework.homework_detail_manual

@ -0,0 +1,10 @@
class WatchVideoHistoriesController < ApplicationController
before_action :require_login
def create
watch_log = CreateWatchVideoService.new(current_user, request, params).call
render_ok(log_id: watch_log&.id)
rescue CreateWatchVideoService::Error => ex
render_error(ex.message)
end
end

@ -94,7 +94,9 @@ class Weapps::AttendancesController < ApplicationController
@absence_count = @attendance.absence_count @absence_count = @attendance.absence_count
@all_count = @attendance.course_member_attendances.size @all_count = @attendance.course_member_attendances.size
@_is_current_attendance = @attendance.current_attendance? a_end_time = "#{@attendance.attendance_date} #{@attendance.end_time}".to_time
@_is_current_attendance = Time.current < a_end_time
if @attendance.course_attendance_groups.first&.course_group_id.to_i == 0 if @attendance.course_attendance_groups.first&.course_group_id.to_i == 0
@group_ids = @course.course_groups.pluck(:id) + [0] @group_ids = @course.course_groups.pluck(:id) + [0]

@ -75,7 +75,7 @@ class Challenge < ApplicationRecord
if identifier.present? if identifier.present?
shixun.task_pass || self.status != 3 ? "/tasks/#{identifier}" : "" shixun.task_pass || self.status != 3 ? "/tasks/#{identifier}" : ""
else else
self.position == 1 ? "/api/shixuns/#{shixun.identifier}/shixun_exec" : "" self.position == 1 ? "/shixuns/#{shixun.identifier}/shixun_exec.json" : ""
end end
end end
@ -143,7 +143,7 @@ class Challenge < ApplicationRecord
# 关卡用户通关数 # 关卡用户通关数
def user_passed_count def user_passed_count
#games.map{|g| g.status == 2}.count #games.map{|g| g.status == 2}.count
self.games.where(status: 1).count self.games.where(status: 2).count
end end
# 关卡用户正在挑战的人数 # 关卡用户正在挑战的人数

@ -5,4 +5,6 @@ class CourseVideo < ApplicationRecord
validates :title, length: { maximum: 60, too_long: "不能超过60个字符" }, allow_blank: true validates :title, length: { maximum: 60, too_long: "不能超过60个字符" }, allow_blank: true
validates :link, format: { with: CustomRegexp::URL, message: "必须为网址超链接" }, allow_blank: true validates :link, format: { with: CustomRegexp::URL, message: "必须为网址超链接" }, allow_blank: true
has_many :watch_course_videos
end end

@ -7,6 +7,7 @@
class Game < ApplicationRecord class Game < ApplicationRecord
default_scope { order("games.created_at desc") } default_scope { order("games.created_at desc") }
#TODO: games表要增加challenge_id与user_id的唯一索引
has_many :outputs, -> { order('query_index DESC') } has_many :outputs, -> { order('query_index DESC') }
has_many :challenge_samples, :dependent => :destroy has_many :challenge_samples, :dependent => :destroy
has_many :game_codes, :dependent => :destroy has_many :game_codes, :dependent => :destroy

@ -69,17 +69,18 @@ class HomeworkCommon < ApplicationRecord
# 作业对应的子目录/父目录名称 # 作业对应的子目录/父目录名称
def category_info def category_info
case self.homework_type if self.course_second_category.present?
when 'normal' {category_id: self.course_second_category.try(:id), category_name: self.course_second_category.try(:name), main: 0}
{category_id: course.common_course_modules.first.try(:id), category_name: course.common_course_modules.first.try(:module_name), main: 1} else
when 'group' course_module = case homework_type
{category_id: course.group_course_modules.first.try(:id), category_name: course.group_course_modules.first.try(:module_name), main: 1} when 'normal'
when 'practice' course.common_course_modules.take
if self.course_second_category.present? when 'group'
{category_id: self.course_second_category.try(:id), category_name: self.course_second_category.try(:name), main: 0} course.group_course_modules.take
else when 'practice'
{category_id: course.shixun_course_modules.take.try(:id), category_name: course.shixun_course_modules.take.try(:module_name), main: 1} course.shixun_course_modules.take
end end
{category_id: course_module.try(:id), category_name: course_module.try(:module_name), main: 1}
end end
end end

@ -162,6 +162,10 @@ class User < ApplicationRecord
has_many :teacher_group_records, dependent: :destroy has_many :teacher_group_records, dependent: :destroy
# 视频观看记录
has_many :watch_video_histories, dependent: :destroy
has_many :watch_course_video, dependent: :destroy
# Groups and active users # Groups and active users
scope :active, lambda { where(status: STATUS_ACTIVE) } scope :active, lambda { where(status: STATUS_ACTIVE) }

@ -0,0 +1,9 @@
class WatchCourseVideo < ApplicationRecord
belongs_to :course_video
belongs_to :user
has_many :watch_video_histories
validates :course_video_id, uniqueness: {scope: :user_id}
end

@ -0,0 +1,7 @@
class WatchVideoHistory < ApplicationRecord
belongs_to :user
belongs_to :video
belongs_to :watch_course_video, optional: true
validates :duration, numericality: { greater_than_or_equal_to: 0 }
end

@ -0,0 +1,76 @@
class CreateWatchVideoService < ApplicationService
attr_reader :user, :params, :request
def initialize(user, request, params)
@user = user
@request = request
@params = params
end
def call
ActiveRecord::Base.transaction do
current_time = Time.now
if params[:log_id].present?
if params[:total_duration].to_f < params[:watch_duration].to_f || params[:watch_duration].to_f < 0
raise Error, '观看时长错误'
end
# 更新观看时长
watch_video_history = user.watch_video_histories.find(params[:log_id])
if watch_video_history.present? && watch_video_history.watch_duration <= params[:watch_duration].to_f && params[:total_duration].to_f > watch_video_history.total_duration
# 如果观看总时长没变,说明视频没有播放,无需再去记录
watch_video_history.end_at = current_time
watch_video_history.total_duration = params[:total_duration]
watch_video_history.watch_duration = params[:watch_duration].to_f > watch_video_history.duration ? watch_video_history.duration : params[:watch_duration]
watch_video_history.is_finished = (watch_video_history.duration <= params[:watch_duration].to_f)
watch_video_history.save!
watch_course_video = watch_video_history.watch_course_video
if watch_course_video.present? && !watch_course_video.is_finished && watch_course_video.watch_duration < params[:watch_duration].to_f
# 更新课程视频的时长及是否看完状态
watch_course_video.watch_duration = params[:watch_duration]
watch_course_video.is_finished = (watch_course_video.duration <= params[:watch_duration].to_f)
watch_course_video.end_at = current_time
watch_course_video.save!
end
end
else
# 开始播放时记录一次
if params[:course_video_id].present?
# 课堂视频
course_video = CourseVideo.find(params[:course_video_id])
watch_course_video = WatchCourseVideo.find_or_initialize_by(course_video_id: course_video.id, user_id: user.id) do |d|
d.start_at = current_time
d.duration = params[:duration]
end
watch_video_history = build_video_log(current_time, course_video.video_id, watch_course_video.id)
watch_video_history.save!
watch_course_video.save! unless watch_course_video.persisted?
else
# 非课堂视频
video = Video.find_by(params[:video_id])
watch_video_history = build_video_log(current_time, video.id)
watch_video_history.save!
end
end
watch_video_history
end
end
def build_video_log(current_time, video_id, watch_course_video_id=nil)
WatchVideoHistory.new(
user_id: user.id,
watch_course_video_id: watch_course_video_id,
start_at: current_time,
duration: params[:duration],
video_id: video_id,
device: params[:device],
ip: request.remote_ip
)
end
end

@ -0,0 +1,24 @@
json.attendances @attendances do |attendance|
json.(attendance, :id, :name, :normal_count, :all_count, :mode)
json.author do
user = attendance.user
json.user_name user.real_name
json.user_login user.login
end
json.attendance_date attendance.attendance_date.strftime("%Y-%m-%d")
json.start_time attendance.start_time.strftime("%H:%M")
json.end_time attendance.end_time.strftime("%H:%M")
json.edit_auth @user_course_identity < Course::PROFESSOR || attendance.user_id == User.current.id
if @user_course_identity == Course::STUDENT
json.attendance_status student_attendance_status(attendance, User.current)
end
end
json.attendances_count @attendances_count
if @user_course_identity == Course::STUDENT
json.normal_count @normal_count
json.leave_count @leave_count
json.absence_count @absence_count
end

@ -1,7 +1,7 @@
json.exercise do json.exercise do
json.extract! @exercise, :id,:exercise_name, :exercise_status,:time,:publish_time, json.extract! @exercise, :id,:exercise_name, :exercise_status,:time,:publish_time,
:end_time,:score_open,:answer_open,:question_random,:choice_random, :end_time,:score_open,:answer_open,:question_random,:choice_random,
:unified_setting,:show_statistic :unified_setting,:show_statistic,:assistant_auth
json.course_id @course.id json.course_id @course.id
json.published_count @exercise_publish_count json.published_count @exercise_publish_count
json.unpublish_count @exercise_unpublish_count json.unpublish_count @exercise_unpublish_count

@ -14,6 +14,7 @@ json.data do
json.partial! "users/user_simple", user: attachment.author json.partial! "users/user_simple", user: attachment.author
end end
# json.partial! "files/course_groups", attachment_group_settings: attachment.attachment_group_settings # json.partial! "files/course_groups", attachment_group_settings: attachment.attachment_group_settings
json.category_id attachment.course_second_category_id
if @course_second_category_id.to_i == 0 if @course_second_category_id.to_i == 0
json.category_name attachment.course_second_category&.name json.category_name attachment.course_second_category&.name
end end

@ -1,6 +1,16 @@
json.course_id @course.id json.course_id @course.id
json.course_name @course.name json.course_name @course.name
json.category @homework.category_info # json.category @homework.category_info
json.category do
if @category.present?
json.category_id @category.id
json.category_name @category.name
else
json.category_id @main_category&.id
json.category_name @main_category&.module_name
end
end
json.(@homework, :id, :name, :description, :reference_answer) json.(@homework, :id, :name, :description, :reference_answer)

@ -1,3 +1,11 @@
json.course_id @course.id json.course_id @course.id
json.course_name @course.name json.course_name @course.name
json.category @course.category_info(@homework_type == 1 ? "common_homework" : "group_homework") json.category do
if @category.present?
json.category_id @category.id
json.category_name @category.name
else
json.category_id @main_category&.id
json.category_name @main_category&.module_name
end
end

@ -29,6 +29,8 @@ Rails.application.routes.draw do
put 'commons/unhidden', to: 'commons#unhidden' put 'commons/unhidden', to: 'commons#unhidden'
delete 'commons/delete', to: 'commons#delete' delete 'commons/delete', to: 'commons#delete'
resources :watch_video_histories, only: [:create]
resources :jupyters do resources :jupyters do
collection do collection do
get :save_with_tpi get :save_with_tpi
@ -548,6 +550,10 @@ Rails.application.routes.draw do
end end
end end
resources :attendances, shallow: true do
end
resources :polls, only:[:index,:new,:create] do resources :polls, only:[:index,:new,:create] do
collection do collection do
post :publish # 立即发布 post :publish # 立即发布

@ -0,0 +1,15 @@
class CreateWatchCourseVideos < ActiveRecord::Migration[5.2]
def change
create_table :watch_course_videos do |t|
t.references :course_video, index: true
t.references :user, index: true
t.boolean :is_finished, default: false
t.float :duration, default: 0
t.float :watch_duration, default: 0
t.datetime :start_at
t.datetime :end_at
t.timestamps
end
end
end

@ -0,0 +1,18 @@
class CreateWatchVideoHistories < ActiveRecord::Migration[5.2]
def change
create_table :watch_video_histories do |t|
t.references :watch_course_video, index: true
t.references :user, index: true
t.references :video, index: true
t.boolean :is_finished, default: false
t.float :duration, default: 0
t.float :watch_duration, default: 0
t.datetime :start_at
t.datetime :end_at
t.string :device
t.string :ip
t.timestamps
end
end
end

@ -0,0 +1,9 @@
class AddIndexUserIdChallengeIdForGames < ActiveRecord::Migration[5.2]
def change
delete_games = Game.where.not(myshixun_id: Myshixun.all).reorder(nil)
puts "delete_games: #{delete_games.pluck(:id)}"
delete_games.destroy_all
add_index :games, [:user_id, :challenge_id], unique: true
end
end

@ -0,0 +1,5 @@
class AddTotalDurationToWatchVideoHistories < ActiveRecord::Migration[5.2]
def change
add_column :watch_video_histories, :total_duration, :float, default: 0
end
end

@ -0,0 +1,28 @@
#coding=utf-8
desc "合并高校的数据,第一个参数是: 正确高校的id, 第二个参数是: 错误高校需要合并到正确高校的id"
# 命令: bundle exec rake schools:merge_school_data f_school=1 s_school=2,3
namespace :schools do
task merge_school_data: :environment do
f_school = ENV['f_school'].to_i
school = School.find_by(id: f_school)
return if school.blank?
s_school = ENV['s_school'].split(",")
merge_schools = School.where(id: s_school)
# 改变用户的学校id 和 单位
UserExtension.where(school_id: merge_schools)
.update_all(school_id: f_school, department_id: nil)
# 改变课堂的学校id
Course.where(school_id: merge_schools).update_all(school_id: f_school)
# 实训报告表迁移数据
s_report = SchoolReport.find_by(school_id: f_school)
SchoolReport.where(school_id: merge_schools).each do |sr|
s_report.update_column(:shixun_evaluate_count, (s_report.shixun_evaluate_count+sr.shixun_evaluate_count))
sr.update(shixun_evaluate_count: 0)
end
end
end

@ -2,13 +2,18 @@
namespace :video_transcode do namespace :video_transcode do
desc "视频转码成h264" desc "视频转码成h264"
task :submit => :environment do task :submit => :environment do
Video.find_each do |v| i = []
if v.uuid && !v.transcoded && !v.file_url.include?('.mp4') && !AliyunVod::Service.get_meta_code_info(v.uuid)[:codecnamne].start_with?("h264", "h265") Video.where.not(uuid: nil, file_url: nil).where(transcoded: false, status: "published").find_each do |v|
p "--- Start submit video trans code #{v.uuid}" code_info = AliyunVod::Service.get_meta_code_info(v.uuid)
AliyunVod::Service.submit_transcode_job(v.uuid, 'a0277c5c0c7458458e171b0cee6ebf5e') if v.file_url.include?('.mp4') && code_info[:codecnamne]&.include?("h264")
else
v.update(transcoded: true) v.update(transcoded: true)
else
puts("uuid: #{v.uuid}")
i << "#{v.id}, #{v.file_url}, #{code_info[:codecnamne]}"
AliyunVod::Service.submit_transcode_job(v.uuid, 'a0277c5c0c7458458e171b0cee6ebf5e')
end end
end end
puts "###########转码个数:#{i.size}"
puts "###########id,file_url, codecnamne:#{i}"
end end
end end

@ -130,16 +130,17 @@ class CoursesBanner extends Component {
axios.get(url,{params: axios.get(url,{params:
dataqueryss dataqueryss
}).then((result) => { }).then((result) => {
if(result.data.status===-2){ try {
// this.setState({ if(result.data.status===-2){
// AccountProfiletype:true, // this.setState({
// content:result.data.message, // AccountProfiletype:true,
// okText:"立即认证", // content:result.data.message,
// cannelText:"稍后认证", // okText:"立即认证",
// okHref:`/account/certification`, // cannelText:"稍后认证",
// Accounturltype:true // okHref:`/account/certification`,
// }) // Accounturltype:true
}else{ // })
}else{
if( result!=undefined){ if( result!=undefined){
let data = result.data; let data = result.data;
this.setState({ this.setState({
@ -150,8 +151,12 @@ class CoursesBanner extends Component {
}else{ }else{
this.onloadupdatabanner() this.onloadupdatabanner()
} }
}
}catch (e) {
} }
}) })
}; };
foo=(url)=> { foo=(url)=> {

@ -42,8 +42,8 @@ class ModulationModal_exercise extends Component {
} }
componentDidMount = () => { componentDidMount = () => {
console.log("ModulationModal_exercise"); // console.log("ModulationModal_exercise");
console.log(this.props); // console.log(this.props);
this.setState({ this.setState({
subjective_score: this.props.subjective_score, subjective_score: this.props.subjective_score,
objective_score: this.props.objective_score, objective_score: this.props.objective_score,

@ -75,9 +75,10 @@ class ExerciseListItem extends Component{
let{item,checkBox,index}=this.props; let{item,checkBox,index}=this.props;
let {coursesId,Id}=this.props.match.params let {coursesId,Id}=this.props.match.params
const IsAdmin =this.props.isAdmin(); const IsAdmin =this.props.isAdmin();
const IsStudent =this.props.isStudent(); const isAssistant=this.props.isAssistant();
const IsStudent =this.props.isStudent();
// console.log(this.props.current_user.user_id)
return( return(
<div className="workList_Item" style={{cursor : IsAdmin ? "pointer" : "default",padding:"30px" }} onClick={() => window.$(`.exerciseitem${index} input`).click() }> <div className="workList_Item" style={{cursor : IsAdmin ? "pointer" : "default",padding:"30px" }} onClick={() => window.$(`.exerciseitem${index} input`).click() }>
{ {
@ -189,8 +190,31 @@ class ExerciseListItem extends Component{
{ IsAdmin &&<div className="homepagePostSetting" style={{"right":"-17px","top":"46px","display":"block","width":"200px"}}> { IsAdmin &&<div className="homepagePostSetting" style={{"right":"-17px","top":"46px","display":"block","width":"200px"}}>
<a className="btn colorblue font-16 ml20" onClick={()=>this.toDetailPage(`/classrooms/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>查看详情</a> {
<Link className="btn colorblue font-16 ml20" to={`/classrooms/${coursesId}/exercises/${item.id}/edit`}>编辑</Link> isAssistant===true?
(
item&&item.assistant_auth===true?
<a className="btn colorblue font-16 ml20" onClick={()=>this.toDetailPage(`/classrooms/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>查看详情</a>
:
<a className="btn colorblue font-16 " style={{
marginLeft: "73px"
}} onClick={()=>this.toDetailPage(`/classrooms/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>查看详情</a>
)
:
<a className="btn colorblue font-16 ml20" onClick={()=>this.toDetailPage(`/classrooms/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>查看详情</a>
}
{
isAssistant===true?
(
item&&item.assistant_auth===true?
<Link className="btn colorblue font-16 ml20" to={`/classrooms/${coursesId}/exercises/${item.id}/edit`}>编辑</Link>
:
""
)
:
<Link className="btn colorblue font-16 ml20" to={`/classrooms/${coursesId}/exercises/${item.id}/edit`}>编辑</Link>
}
<Link className="btn colorblue ml20 font-16" to={`/classrooms/${coursesId}/exercises/${item.id}/student_exercise_list?tab=3`}>设置</Link> <Link className="btn colorblue ml20 font-16" to={`/classrooms/${coursesId}/exercises/${item.id}/student_exercise_list?tab=3`}>设置</Link>
</div> } </div> }

@ -75,10 +75,11 @@ class Exercisesetting extends Component{
limit:10, limit:10,
searchtext:"", searchtext:"",
order: "end_at", order: "end_at",
assistant_auth:false
} }
console.log("Exercisesetting"); // console.log("Exercisesetting");
console.log("69"); // console.log("69");
console.log(props); // console.log(props);
} }
_getRequestParams() { _getRequestParams() {
const { order, exercise_group_id,searchtext, page ,limit} = this.state const { order, exercise_group_id,searchtext, page ,limit} = this.state
@ -92,6 +93,12 @@ class Exercisesetting extends Component{
} }
//加载 //加载
componentDidMount=()=>{ componentDidMount=()=>{
this.setState({
assistant_auth:this.props.assistant_auth,
})
this.getSettingInfo(); this.getSettingInfo();
// window.addEventListener('click', this.handleClick); // window.addEventListener('click', this.handleClick);
@ -108,11 +115,34 @@ class Exercisesetting extends Component{
if(this.props.isAdmin() === false){ if(this.props.isAdmin() === false){
this.cancelEdit() this.cancelEdit()
} }
try {
//是否为助教
if(this.props.isAssistant()===true){
//如果是助教是否有权限
if(this.props.assistant_auth===true){
this.setState({
flagPageEdit:true
})
}else{
this.setState({
flagPageEdit:false
})
}
}
}catch (e) {
}
} }
componentDidUpdate = (prevProps) => { componentDidUpdate = (prevProps) => {
if(prevProps.Commonheadofthetestpaper!= this.props.Commonheadofthetestpaper){ if(prevProps.Commonheadofthetestpaper!= this.props.Commonheadofthetestpaper){
this.editSetting() this.editSetting()
} }
if(prevProps.assistant_auth!= this.props.assistant_auth){
this.setState({
assistant_auth:this.props.assistant_auth,
})
}
} }
_getRequestParams() { _getRequestParams() {
@ -348,10 +378,16 @@ class Exercisesetting extends Component{
this.commitSetting((result)=>{ this.commitSetting((result)=>{
console.log(result) console.log(result)
if(result.status==200){ if(result.status===200){
this.props.showNotification(`${result.data.message}`); this.props.showNotification(`${result.data.message}`);
this.getSettingInfo(1); this.getSettingInfo(1);
this.cancelEdit(); this.cancelEdit();
try {
this.props.assistantauthoritys(this.state.assistant_auth);
}catch (e) {
}
} }
}) })
} }
@ -371,6 +407,12 @@ class Exercisesetting extends Component{
this.props.showNotification(`${result.data.message}`); this.props.showNotification(`${result.data.message}`);
this.cancelEdit(); this.cancelEdit();
this.getSettingInfo(1); this.getSettingInfo(1);
try {
this.props.assistantauthoritys(this.state.assistant_auth);
}catch (e) {
}
} }
}); });
@ -386,11 +428,12 @@ class Exercisesetting extends Component{
publish_time:this.state.publish_time, publish_time:this.state.publish_time,
end_time:this.state.end_time, end_time:this.state.end_time,
show_statistic:this.state.show_statistic, show_statistic:this.state.show_statistic,
choice_random:this.state.choice_random, choice_random:this.state.choice_random,
score_open:this.state.score_open, score_open:this.state.score_open,
answer_open:this.state.answer_open, answer_open:this.state.answer_open,
question_random:this.state.question_random, question_random:this.state.question_random,
time:this.state.time, time:this.state.time,
assistant_auth:this.state.assistant_auth,
} }
}else{ }else{
let list=this.state.rules; let list=this.state.rules;
@ -403,7 +446,6 @@ class Exercisesetting extends Component{
} }
lists.push(newlist) lists.push(newlist)
}) })
params={ params={
unified_setting:this.state.unified_setting, unified_setting:this.state.unified_setting,
show_statistic:this.state.show_statistic, show_statistic:this.state.show_statistic,
@ -413,6 +455,7 @@ class Exercisesetting extends Component{
answer_open:this.state.answer_open, answer_open:this.state.answer_open,
publish_time_groups:lists, publish_time_groups:lists,
time:this.state.time, time:this.state.time,
assistant_auth:this.state.assistant_auth,
} }
} }
axios.post((url),params).then((result)=>{ axios.post((url),params).then((result)=>{
@ -491,6 +534,12 @@ class Exercisesetting extends Component{
}) })
} }
assistantauthority=(e)=>{
this.setState({
assistant_auth:e.target.checked
})
}
onChangeTimepublish=(date, dateString)=>{ onChangeTimepublish=(date, dateString)=>{
if(date===null){ if(date===null){
this.setState({ this.setState({
@ -555,9 +604,33 @@ class Exercisesetting extends Component{
modalSave:this.cancelBox modalSave:this.cancelBox
}) })
}else{ }else{
this.setState({ if(this.props.isAdmin()===true){
flagPageEdit:true try {
}) //是否为助教
if(this.props.isAssistant()===true){
//如果是助教是否有权限
if(this.props.assistant_auth===true){
this.setState({
flagPageEdit:true
})
}else{
this.setState({
flagPageEdit:false
})
}
}else{
//是老师
this.setState({
flagPageEdit:true
})
}
}catch (e) {
this.setState({
flagPageEdit:true
})
}
}
} }
} }
//取消编辑 //取消编辑
@ -608,7 +681,9 @@ class Exercisesetting extends Component{
// console.log("asdasdasda"); // console.log("asdasdasda");
// console.log(this.props); // console.log(this.props);
// console.log(this.props.Commonheadofthetestpaper); // console.log(this.props.Commonheadofthetestpaper);
return(
return(
<div> <div>
<Modals <Modals
modalsType={modalsType} modalsType={modalsType}
@ -623,13 +698,22 @@ class Exercisesetting extends Component{
<span className="font-16 fl">发布设置<span className="color-grey-c font-14"></span></span> <span className="font-16 fl">发布设置<span className="color-grey-c font-14"></span></span>
{ {
!flagPageEdit&&this.props.isAdmin()===true ? !flagPageEdit&&this.props.isAdmin()===true ?
<a className="fr mr6 white-btn edu-blueline-btn lineh-24" onClick={this.editSetting}> (
编辑设置 this.props.isAssistant()===true?
{/*<Tooltip title="编辑">*/} (
{/*<i className="iconfont icon-bianjidaibeijing font-20 color-green"></i>*/} this.props.assistant_auth===true?
{/*</Tooltip>*/} <a className="fr mr6 white-btn edu-blueline-btn lineh-24" onClick={this.editSetting}>
</a> 编辑设置
:"" </a>
:
""
)
:
<a className="fr mr6 white-btn edu-blueline-btn lineh-24" onClick={this.editSetting}>
编辑设置
</a>
)
:""
} }
</p> </p>
@ -769,7 +853,7 @@ class Exercisesetting extends Component{
<div className="padding20-30"> <div className="padding20-30">
<p className="mb30 clearfix font-16">公开设置</p> <p className="mb30 clearfix font-16">属性设置</p>
<div className="pl33"> <div className="pl33">
<p className="mb20"> <p className="mb20">
@ -790,7 +874,7 @@ class Exercisesetting extends Component{
</Form.Item> </Form.Item>
<span className="color-grey-c">(选中则在试卷截止时间之后已提交答题的学生可以查看试卷题目的答案否则不能查看)</span> <span className="color-grey-c">(选中则在试卷截止时间之后已提交答题的学生可以查看试卷题目的答案否则不能查看)</span>
</p> </p>
<p className="clearfix mb5"> <p className="clearfix mb20">
<Form.Item className="fl pollForm"> <Form.Item className="fl pollForm">
{getFieldDecorator('show_statistic') {getFieldDecorator('show_statistic')
( (
@ -799,6 +883,15 @@ class Exercisesetting extends Component{
</Form.Item> </Form.Item>
<span className="color-grey-c">(选中则在试卷截止时间之后已提交答题的学生可以查看答题统计否则不能查看)</span> <span className="color-grey-c">(选中则在试卷截止时间之后已提交答题的学生可以查看答题统计否则不能查看)</span>
</p> </p>
<p className="clearfix mb5">
<Form.Item className="fl pollForm">
{getFieldDecorator('assistantauthority')
(
<Checkbox disabled={this.props.isAdmin()===true?!flagPageEdit:true} className="mr15 font-16 color-grey-6" checked={this.state.assistant_auth} onChange={this.assistantauthority}>助教权限</Checkbox>
)}
</Form.Item>
<span className="color-grey-c">(选中则允许助教查看答案)</span>
</p>
</div> </div>
</div> </div>
@ -808,7 +901,10 @@ class Exercisesetting extends Component{
<div className="clearfix mt30 ml40" style={{paddingBottom:'40px'}}> <div className="clearfix mt30 ml40" style={{paddingBottom:'40px'}}>
<Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20">提交</Button> <Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20">提交</Button>
<a className="defalutCancelbtn fl" onClick={this.cancelEdit}>取消</ a> <a className="defalutCancelbtn fl" onClick={this.cancelEdit}>取消</ a>
</div>:"" </div>
:""
} }
</Form> </Form>
@ -820,70 +916,3 @@ const WrappedExercisesetting = Form.create({ name: 'exercisesetting' })(Exercise
export default WrappedExercisesetting; export default WrappedExercisesetting;
// //提交form表单
// handleSubmit = (e) => {
//
// let{unified_setting,answer_open}=this.state;
// e.preventDefault();
// let exercise_id=this.props.match.params.Id;
//
// this.props.form.validateFieldsAndScroll((err, values) => {
// debugger
// if(!err){
// // 第一次进行问卷设置或者勾选了统一设置
// if(unified_setting==true){
// if(this.state.p_flag == false && this.state.e_flag == true){
// // 选择了发布时间但截至时间没有选择
// this.setState({
// modalsType:true,
// modalsTopval:"请选择截止时间",
// loadtype:true,
// modalSave:this.cancelBox
// })
// return;
// }else if(this.state.p_flag == true && this.state.e_flag == true){
// // 如果两个时间都没有填写则弹出立即发布弹框
// let{publish_time,end_time}=this.state
// if(publish_time==undefined && end_time ==undefined){
//
// }else{
// // 否则就是选择的时间错误
// this.setState({
// modalsType:true,
// modalsTopval:"请选择正确的发布时间和截止时间",
// loadtype:true,
// modalSave:this.cancelBox
// })
// }
// return;
// }
// }
//
// let url=`/exercises/${exercise_id}/commit_setting.json`;
// let params=[];
// if(values.unitSet){
// params={
// unified_setting:values.unitSet,
// publish_time:this.state.publish_time,
// end_time:this.state.end_time,
// show_result:values.public,
// un_anonymous:values.real
// }
// }else{
// params={
// unified_setting:values.unitSet,
// show_result:values.public,
// un_anonymous:values.real,
// publish_time_groups:this.state.rules
// }
// }
// axios.post((url),{params}).then((result)=>{
// if(result.status==200){
// this.props.showNotification(`${result.data.message}`);
// }
// }).catch((error)=>{
// console.log(error);
// })
// }
// })
// }

@ -28,6 +28,7 @@ const RadioGroup = Radio.Group;
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
const {Option} = Select; const {Option} = Select;
//学生老师页面 //学生老师页面
let columnsystwo=[];
class Studentshavecompletedthelist extends Component { class Studentshavecompletedthelist extends Component {
// http://localhost:3007/courses/1309/exercises/722/exercises/student_exercise_list?debug=s // http://localhost:3007/courses/1309/exercises/722/exercises/student_exercise_list?debug=s
constructor(props) { constructor(props) {
@ -1158,237 +1159,56 @@ class Studentshavecompletedthelist extends Component {
<span> <span>
{ {
record.submitstate === "未提交"||record.commit_method===5? record.submitstate === "未提交"||record.commit_method===5?
<a style={{textAlign: "center"}} className="color-blue" (//是否助教
target="_blank" onClick={() => this.Adjustment(record.user_id)}>评阅</a> this.props.isAssistant()&&this.props.isAssistant()===true?
(//助教是否有权限
this.props.assistant_auth&&this.props.assistant_auth===true?
<a style={{textAlign: "center"}} className="color-blue"
target="_blank" onClick={() => this.Adjustment(record.user_id)}>评阅</a>
:
(//是否截止
this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3?
<a style={{textAlign: "center"}} className="color-blue"
target="_blank" onClick={() => this.Adjustment(record.user_id)}>评阅</a>
:
<span style={{textAlign: "center", color: '#999999'}}>--</span>
)
)
:
<a style={{textAlign: "center"}} className="color-blue"
target="_blank" onClick={() => this.Adjustment(record.user_id)}>评阅</a>
)
:record.submitstate === "已提交"? :record.submitstate === "已提交"?
<a style={{textAlign: "center"}} className="color-blue" (//是否助教
target="_blank" this.props.isAssistant()&&this.props.isAssistant()===true?
href={`/classrooms/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${record.myid}`}>{record.finalscore}</a> (//助教是否有权限
this.props.assistant_auth&&this.props.assistant_auth===true?
<a style={{textAlign: "center"}} className="color-blue"
target="_blank"
href={`/classrooms/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${record.myid}`}>{record.finalscore}</a>
:
(//是否截止
this.props.Commonheadofthetestpaper && this.props.Commonheadofthetestpaper.exercise_status===3?
<a style={{textAlign: "center"}} className="color-blue"
target="_blank"
href={`/classrooms/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${record.myid}`}>{record.finalscore}</a>
:
<span style={{textAlign: "center", color: '#999999'}}>--</span>
)
)
:
<a style={{textAlign: "center"}} className="color-blue"
target="_blank"
href={`/classrooms/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${record.myid}`}>{record.finalscore}</a>
)
: :
<span style={{textAlign: "center", color: '#999999'}}>--</span> <span style={{textAlign: "center", color: '#999999'}}>--</span>
} }
</span> </span>
) )
}, },
], ],
columnsystwo: [ // 也会被columnsys当作参数接收
{
title: '序号',
dataIndex: 'number',
key: 'number',
align: 'center',
className: "edu-txt-center font-14",
render: (text, record) => (
<span>
{record.number === "--" ?
<span style={{color: '#999999', textAlign: "center"}}>--</span>
:
<span style={{color: '#07111B', textAlign: "center"}}>{record.number}</span>
}
</span>
)
},
{
title: '姓名',
dataIndex: 'name',
key: 'name',
align: 'center',
className: "edu-txt-center font-14",
render: (text, record) => (
<span>
{record.name==="--"?
<span style={{color: '#999999', textAlign: "center"}}>{record.name}</span>
:
<span style={{color: '#07111B', textAlign: "center"}}>{record.name}</span>
}
</span>
)
},
{
title: '学号',
dataIndex: 'stduynumber',
key: 'stduynumber',
align: 'center',
className: "edu-txt-center font-14",
sorter: true,
sortDirections: sortDirections,
render: (text, record) => (
<span>
{record.stduynumber === "--" ?
<span style={{color: '#999999', textAlign: "center"}}>{record.stduynumber}</span>
:
<span style={{color: '#9A9A9A', textAlign: "center"}}>{record.stduynumber}</span>
}
</span>
),
},
{
title: '分班',
key: 'classroom',
dataIndex: 'classroom',
align: 'center',
className: "edu-txt-center font-14 maxnamewidth260 ",
width:'260px',
render: (text, record) => (
<span>
{record.classroom==="--"?
<span style={{color: '#999999', textAlign: "center"}} className="maxnamewidth260">{record.classroom}</span>
:
<a style={{color: '#07111B', textAlign: "center"}} className="maxnamewidth260" title={record.classroom}>{record.classroom}</a>
}
</span>
)
},
{
title: '提交状态',
dataIndex: 'submitstate',
key: 'submitstate',
align: 'center',
className: "edu-txt-center font-14",
render: (text, record) => (
<span>
<span style={record.submitstate === "未提交" ? {
color: '#999999',
textAlign: "center"
} : record.submitstate === "已提交" ? {color: '#29BD8B', textAlign: "center"} : {
color: '#29BD8B',
textAlign: "center"
}}>{record.submitstate}</span>
</span>
)
},
{
title: '提交时间',
dataIndex: 'updatetime',
key: 'updatetime',
align: 'center',
className: "edu-txt-center font-14",
sorter: true,
defaultSortOrder: 'descend',
sortDirections: sortDirections,
render: (text, record) => (
<span>
{record.updatetime==="--"?
<span style={{color: '#999999', textAlign: "center"}}>--</span>
:
<span style={{color: '#9A9A9A', textAlign: "center"}}>{record.updatetime}</span>
}
</span>
),
},
{
title: '客观题得分',
dataIndex: 'completion',
key: 'completion',
align: 'center',
className: "edu-txt-center font-14",
render: (text, record) => (
<span>
{record.completion=== "--"?
<span style={{color: '#999999', textAlign: "center"}}>--</span>
:
<span style={{color: '#07111B', textAlign: "center"}}>{record.completion}</span>
}
</span>
)
},
{
title: '主观题得分',
dataIndex: 'levelscore',
key: 'levelscore',
align: 'center',
className: "edu-txt-center font-14",
render: (text, record) => (
<span>
{record.levelscore==="--"?
<span style={{color: '#999999', textAlign: "center"}}>--</span>
:
<span style={{color: '#FF6800', textAlign: "center"}}>{record.levelscore}</span>
}
</span>
)
},
{
title: '最终成绩',
dataIndex: 'efficiencyscore',
key: 'efficiencyscore',
align: 'center',
className: "edu-txt-center font-14",
sorter: true,
sortDirections: sortDirections,
render: (text, record) => (
<span>
{record.efficiencyscore === "--" ?
<Tooltip placement="bottom" title={<div>
<div>未评分</div>
</div>}>
<a style={{color: '#999999',
textAlign: "center",}}>--</a>
</Tooltip>
:
record.commit_method===5?
<Tooltip placement="bottom" title={
<div>
<div>最终调整成绩{record.efficiencyscore}</div>
</div>}>
<span style={parseInt(record.efficiencyscore) > 90 ? {
color: '#DD1717',
textAlign: "center",
} : parseInt(record.efficiencyscore) <= 90 ? {
color: '#FF6800',
textAlign: "center",
} : parseInt(record.efficiencyscore) <= 60 ? {
color: '#747A7F',
textAlign: "center",
} : {
color: '#747A7F',
textAlign: "center",
}}>{record.efficiencyscore}</span>
</Tooltip>
:
<span style={parseInt(record.efficiencyscore) > 90 ? {
color: '#DD1717',
textAlign: "center",
} : parseInt(record.efficiencyscore) <= 90 ? {
color: '#FF6800',
textAlign: "center",
} : parseInt(record.efficiencyscore) <= 60 ? {
color: '#747A7F',
textAlign: "center",
} : {
color: '#747A7F',
textAlign: "center",
}}>{record.efficiencyscore}</span>
}
</span>
)
},
{
title: '操作',
dataIndex: 'finalscore',
key: 'finalscore',
align: 'center',
className: "edu-txt-center font-14",
render: (text, record) => (
<span>
{
record.submitstate === "未提交"||record.commit_method===5?
<a style={{textAlign: "center"}} className="color-blue"
target="_blank" onClick={() => this.Adjustment(record.user_id)}>评阅</a>
:record.submitstate === "已提交"?
<a style={{textAlign: "center"}} className="color-blue"
target="_blank"
href={`/classrooms/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${record.myid}`}>{record.finalscore}</a>
:
<span style={{textAlign: "center", color: '#999999'}}>--</span>
}
</span>
)
},
],//columnsystwo 也会被columnsys当作参数接收
exercise_status:0, exercise_status:0,
order_type: "desc", order_type: "desc",
exeuserid: 0, exeuserid: 0,
@ -1449,20 +1269,23 @@ class Studentshavecompletedthelist extends Component {
} }
componentDidMount() { componentDidMount() {
// if(this.props.isAdmin() === true){ //被columnsys当作参数接收
// this.Teacherliststudentlistsy(); // console.log("componentDidMount");
// //console.log("1111111111111111"); // console.log(columnsystwo);
// //console.log(this.props.isAdmin()); try {
// }else { columnsystwo=this.state.columnsys;
}catch (e) {
}
// console.log(columnsystwo);
this.Teacherliststudentlist(); this.Teacherliststudentlist();
// //console.log("2222222222222");
// //console.log(this.props.isAdmin());
// }
try { try {
this.props.triggerRef(this); this.props.triggerRef(this);
}catch (e) { }catch (e) {
} }
} }
componentWillReceiveProps = (nextProps) => { componentWillReceiveProps = (nextProps) => {
@ -2163,7 +1986,7 @@ class Studentshavecompletedthelist extends Component {
course_groups: response.data.course_groups, course_groups: response.data.course_groups,
mylistansum:response.data.exercise_types.answer_users+response.data.exercise_types.unanswer_users, mylistansum:response.data.exercise_types.answer_users+response.data.exercise_types.unanswer_users,
loadingstate: false, loadingstate: false,
columnsys: this.state.columnsystwo, columnsys: columnsystwo,
subjective: response.data.exercise_types.subjective, subjective: response.data.exercise_types.subjective,
objective_score: response.data.exercise_types.objective_score, objective_score: response.data.exercise_types.objective_score,
subjective_score: response.data.exercise_types.subjective_score, subjective_score: response.data.exercise_types.subjective_score,
@ -2772,8 +2595,16 @@ class Studentshavecompletedthelist extends Component {
} }
// 调分 // 调分
Adjustment = (e) => { Adjustment = (e) => {
console.log("Adjustment"); // console.log("Adjustment");
console.log(e); // console.log(e);
if(this.state.objective_score===0&&this.state.subjective_score===0){
this.props.showNotification('试卷题型分被限制为0分不能调分请点击编辑试卷修改题型分数');
return
}
this.setState({ this.setState({
testpapergradingboll: true, testpapergradingboll: true,
exeuserid: e, exeuserid: e,
@ -2828,8 +2659,8 @@ class Studentshavecompletedthelist extends Component {
// //console.log("this.props.Commonheadofthetestpaper.exercise_status"); // //console.log("this.props.Commonheadofthetestpaper.exercise_status");
// //console.log(this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status); // //console.log(this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status);
// //console.log(exercise_status); // //console.log(exercise_status);
console.log("Studentshavecompletedthelis123123t"); // console.log("Studentshavecompletedthelis123123t");
console.log(columnss); // console.log(columnss);
return ( return (
isAdmin === true ? isAdmin === true ?
( (

@ -35,6 +35,7 @@ class Testpapersettinghomepage extends Component{
DownloadMessageval:undefined, DownloadMessageval:undefined,
donwloading:false, donwloading:false,
exercise_status:3, exercise_status:3,
assistant_auth:false, //设置助教
} }
} }
//切换tab //切换tab
@ -72,6 +73,7 @@ class Testpapersettinghomepage extends Component{
Commonheadofthetestpaper:response.data, Commonheadofthetestpaper:response.data,
current_status:response.data.user_permission.current_status, current_status:response.data.user_permission.current_status,
exercise_status:response.data.exercise_status, exercise_status:response.data.exercise_status,
assistant_auth:response.data.assistant_auth,
}) })
// console.log(JSON.stringify(response.data.show_statistic)); // console.log(JSON.stringify(response.data.show_statistic));
@ -85,6 +87,12 @@ class Testpapersettinghomepage extends Component{
} }
assistantauthoritys=(bool)=>{
this.setState({
assistant_auth:bool,
})
}
Ecerciseacallagain=()=>{ Ecerciseacallagain=()=>{
this.setState({ this.setState({
visible:true visible:true
@ -287,9 +295,11 @@ class Testpapersettinghomepage extends Component{
this.props.history.goBack() this.props.history.goBack()
} }
render(){ render(){
let {tab,visible,Commonheadofthetestpaper,exercise_status}=this.state; let {tab,visible,Commonheadofthetestpaper,exercise_status,assistant_auth}=this.state;
const isAdmin =this.props.isAdmin(); const isAdmin =this.props.isAdmin();
const isStudent = this.props.isStudent(); const isAssistant=this.props.isAssistant();
const isStudent = this.props.isStudent();
// TODO // TODO
//console.log(Commonheadofthetestpaper.exercise_status); //console.log(Commonheadofthetestpaper.exercise_status);
@ -353,7 +363,26 @@ class Testpapersettinghomepage extends Component{
<div className="stud-class-set bor-bottom-greyE "> <div className="stud-class-set bor-bottom-greyE ">
<div className=" clearfix edu-back-white pl30 pr30"> <div className=" clearfix edu-back-white pl30 pr30">
<div className="fl task_menu_ul"> <div className="fl task_menu_ul">
{this.props.isAdmin()===true? {isAssistant===true?
(
assistant_auth===true?
<Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}>
<Menu.Item key="0" className={"exercisesafonts"}>答题列表</Menu.Item>
<Menu.Item key="1" className={"exercisesafonts"}>统计结果</Menu.Item>
<Menu.Item key="2" className={"exercisesafonts"}>试卷预览</Menu.Item>
<Menu.Item key="3" className={"exercisesafonts"}>设置</Menu.Item>
</Menu>
:
<Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}>
<Menu.Item key="0" className={"exercisesafonts"}>答题列表</Menu.Item>
{Commonheadofthetestpaper&&Commonheadofthetestpaper.show_statistic===true?
Commonheadofthetestpaper && Commonheadofthetestpaper.exercise_status===3?
<Menu.Item key="1" className={"exercisesafonts"}>统计结果</Menu.Item>:"":""}
<Menu.Item key="3" className={"exercisesafonts"}>设置</Menu.Item>
</Menu>
)
:
this.props.isAdmin()===true?
<Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}> <Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}>
<Menu.Item key="0" className={"exercisesafonts"}>答题列表</Menu.Item> <Menu.Item key="0" className={"exercisesafonts"}>答题列表</Menu.Item>
<Menu.Item key="1" className={"exercisesafonts"}>统计结果</Menu.Item> <Menu.Item key="1" className={"exercisesafonts"}>统计结果</Menu.Item>
@ -437,7 +466,23 @@ class Testpapersettinghomepage extends Component{
getsetdata={this.getsetdata} getsetdata={this.getsetdata}
></ImmediatelyPublish> ></ImmediatelyPublish>
:"":""} :"":""}
{isAdmin === true? <Link className="fr color-blue font-16 mt20 mr20" to={`/classrooms/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/edit`}>编辑试卷</Link>:""} {/*const isAdminOrTeacher*/}
{/*assistant_auth===true*/}
{/**/}
{isAdmin === true?
(
isAssistant===true?
(
assistant_auth===true?
<Link className="fr color-blue font-16 mt20 mr20" to={`/classrooms/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/edit`}>编辑试卷</Link>
:
""
)
:
<Link className="fr color-blue font-16 mt20 mr20" to={`/classrooms/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/edit`}>编辑试卷</Link>
)
:""}
{isAdmin === false && this.props.current_user !== undefined? {isAdmin === false && this.props.current_user !== undefined?
Commonheadofthetestpaper&&Commonheadofthetestpaper.user_permission.current_status===2? Commonheadofthetestpaper&&Commonheadofthetestpaper.user_permission.current_status===2?
@ -461,22 +506,22 @@ class Testpapersettinghomepage extends Component{
/> />
{ {
// 教师列表 // 教师列表
parseInt(tab[0])==0 ? <Studentshavecompletedthelist {...this.props} {...this.state} triggerRef={this.bindRef} setcourse_groupysls={(value)=>this.setcourse_groupysls(value)} current_status = {this.state.current_status} Commonheadofthetestpaper={this.state.Commonheadofthetestpaper} yslstustate={[`${polls_status[Commonheadofthetestpaper && Commonheadofthetestpaper.exercise_status]}`]}></Studentshavecompletedthelist>:"" parseInt(tab[0])==0 ? <Studentshavecompletedthelist {...this.props} {...this.state} assistant_auth={assistant_auth} triggerRef={this.bindRef} setcourse_groupysls={(value)=>this.setcourse_groupysls(value)} current_status = {this.state.current_status} Commonheadofthetestpaper={this.state.Commonheadofthetestpaper} yslstustate={[`${polls_status[Commonheadofthetestpaper && Commonheadofthetestpaper.exercise_status]}`]}></Studentshavecompletedthelist>:""
} }
{/*统计结果*/} {/*统计结果*/}
{ {
parseInt(tab[0])==1 ? <Exercisestatisticalresult {...this.props} {...this.state} triggerRef={this.bindRef}></Exercisestatisticalresult>:"" parseInt(tab[0])==1 ? <Exercisestatisticalresult {...this.props} {...this.state} assistant_auth={assistant_auth} triggerRef={this.bindRef}></Exercisestatisticalresult>:""
} }
{ {
parseInt(tab[0])==2 ? <ExerciseDisplay {...this.props} {...this.state} triggerRef={this.bindRef}></ExerciseDisplay>:"" parseInt(tab[0])==2 ? <ExerciseDisplay {...this.props} {...this.state} assistant_auth={assistant_auth} triggerRef={this.bindRef}></ExerciseDisplay>:""
} }
{ {
parseInt(tab[0])==3 ? <WrappedExercisesetting Commonheadofthetestpaper={this.state.Commonheadofthetestpaper} {...this.props} {...this.state} triggerRef={this.bindRef} Commonheadofthetestpapers={this.Commonheadofthetestpaper}></WrappedExercisesetting>:"" parseInt(tab[0])==3 ? <WrappedExercisesetting Commonheadofthetestpaper={this.state.Commonheadofthetestpaper} {...this.props} {...this.state} assistant_auth={assistant_auth} triggerRef={this.bindRef} Commonheadofthetestpapers={this.Commonheadofthetestpaper} assistantauthoritys={(bool)=>this.assistantauthoritys(bool)}></WrappedExercisesetting>:""
} }
</div> </div>
</div> </div>

@ -34,6 +34,9 @@ render() {
} }
.color848282{ .color848282{
color:#848282; color:#848282;
}
.task-btn{
color: #fff !important;
} }
` `
} }
@ -50,7 +53,7 @@ render() {
</div> </div>
: :
<div className="clearfix mt30 edu-txt-center"> <div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={this.props.modalCancel}>取消</a> <a className="task-btn mr30" onClick={this.props.modalCancel}>{this.props.cancelText || '取消'}</a>
<a className="task-btn task-btn-orange" onClick={this.props.modalSave}>{this.props.okText || '确定'}</a> <a className="task-btn task-btn-orange" onClick={this.props.modalSave}>{this.props.okText || '确定'}</a>
</div> </div>
} }

@ -32,7 +32,10 @@ class DetailTop extends Component{
getappointmenttype:false, getappointmenttype:false,
openpathss:false, openpathss:false,
cancel_publics:false, cancel_publics:false,
cancel_has_publics:false cancel_has_publics:false,
applyissuePaths:false,
cancelText:undefined,
okText:undefined
} }
} }
componentDidMount(){ componentDidMount(){
@ -110,21 +113,27 @@ class DetailTop extends Component{
applyissuePath=()=>{ applyissuePath=()=>{
this.setState({
loadtype:true,
Modalstype: true,
Modalstopval:` 课程需经过平台审核方可公开使用,公开的课程将对平台所`,
modalsMidval:"有人公开可见,若仅本人教学使用则无需申请公开,直接发",
Modalsbottomval:"送到课堂即可。",
applyissuePaths:true
})
}
showapplyissuePath=()=>{
let pathid=this.props.match.params.pathId; let pathid=this.props.match.params.pathId;
let url ="/paths/"+pathid+"/publish.json"; let url ="/paths/"+pathid+"/publish.json";
axios.post(url).then((result)=>{ axios.post(url).then((result)=>{
if(result.status===200){ if(result.status===200){
if(result.data.status===0){ if(result.data.status===0){
this.setState({
loadtype:true,
Modalstype: true,
Modalstopval: ` 课程需经过平台审核方可公开使用,公开的课程将对平台所`,
modalsMidval:"有人公开可见。若仅本人教学使用则无需申请公开, 直接发",
Modalsbottomval:"送到课堂即可.",
cardsModalsavetype: true,
})
this.props.showNotification(result.data.message) this.props.showNotification(result.data.message)
this.props.getlistdatas(); this.props.getlistdatas();
this.cardsModalcancel()
}else if(result.data.status===1){ }else if(result.data.status===1){
// window.location.reload(); // window.location.reload();
} }
@ -132,9 +141,7 @@ class DetailTop extends Component{
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
}) })
}
}
postcancelissuePath=()=>{ postcancelissuePath=()=>{
let pathId=this.props.match.params.pathId; let pathId=this.props.match.params.pathId;
let url ="/paths/"+pathId+"/cancel_publish.json"; let url ="/paths/"+pathId+"/cancel_publish.json";
@ -180,12 +187,15 @@ class DetailTop extends Component{
modalsMidval:'', modalsMidval:'',
modalstyles:'', modalstyles:'',
cardsModalsavetype:false, cardsModalsavetype:false,
applyissuePath:false, applyissuePaths:false,
openpathss:false, openpathss:false,
cancel_publics:false, cancel_publics:false,
cancel_has_publics:false, cancel_has_publics:false,
Modalstopval:``, Modalstopval:``,
cancelText:undefined,
okText:undefined
}) })
} }
cardsModalsave=()=>{ cardsModalsave=()=>{
@ -369,13 +379,13 @@ class DetailTop extends Component{
openpaths=()=>{ openpaths=()=>{
this.setState({ this.setState({
loadtype:true,
Modalstype: true, Modalstype: true,
openpathss:true, openpathss:true,
Modalstopval: "公开申请已提交,请等待管理员的审核", Modalstopval: "公开课程需经过平台标准化审核审核周期为1-2天公开",
modalsMidval:"• 我们将在1-2个工作日内完成审核", modalsMidval:"的课程将对平台所有人可见。若仅本人教学使用则无需",
Loadtype:true, Modalsbottomval:"申请公开,直接发送到课堂即可",
modalstyles:"848282" cancelText:"取消申请",
okText:"确定申请"
}) })
} }
@ -433,7 +443,7 @@ class DetailTop extends Component{
render(){ render(){
let{detailInfoList}=this.props; let{detailInfoList}=this.props;
let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype,openpathss,cancel_publics,cancel_has_publics}=this.state; let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype,openpathss,cancel_publics,cancel_has_publics,applyissuePaths}=this.state;
const radioStyle = { const radioStyle = {
display: 'block', display: 'block',
height: '30px', height: '30px',
@ -470,8 +480,10 @@ class DetailTop extends Component{
modalsTopval={Modalstopval} modalsTopval={Modalstopval}
modalsBottomval={Modalsbottomval} modalsBottomval={Modalsbottomval}
modalCancel={cardsModalcancel} modalCancel={cardsModalcancel}
modalSave={loadtype===true&&openpathss===false?()=>this.cardsModalcancel():cardsModalsavetype===true?()=>this.postcancelissuePath():openpathss===true?()=>this.postopenpaths():cancel_publics===true?()=>this.postcancel_public():cancel_has_publics===true?()=>this.postcancel_has_public():putappointmenttype===true?()=>this.getappointment():()=>this.cardsModalsave()} modalSave={applyissuePaths===true?()=>this.showapplyissuePath():loadtype===true&&openpathss===false?()=>this.cardsModalcancel():cardsModalsavetype===true?()=>this.postcancelissuePath():openpathss===true?()=>this.postopenpaths():cancel_publics===true?()=>this.postcancel_public():cancel_has_publics===true?()=>this.postcancel_has_public():putappointmenttype===true?()=>this.getappointment():()=>this.cardsModalsave()}
loadtype={loadtype} loadtype={loadtype}
cancelText={this.state.cancelText}
okText={this.state.okText}
modalsMidval={this.state.modalsMidval} modalsMidval={this.state.modalsMidval}
modalstyles={this.state.modalstyles} modalstyles={this.state.modalstyles}
> >
@ -605,8 +617,8 @@ class DetailTop extends Component{
{ {
detailInfoList.publish_status===0&&detailInfoList.allow_add_member===true? detailInfoList.publish_status===0&&detailInfoList.allow_add_member===true?
<a className="fr font-18 color-white kaike mr20 kkbths" <a className="fr font-18 color-white kaike mr20 kkbths"
style={{'width':'65px'}} style={{'width':'95px'}}
onClick={this.applyissuePath}>发布</a>:"" onClick={this.applyissuePath}>申请发布</a>:""
} }

@ -8,7 +8,7 @@ import Pagination from '@icedesign/base/lib/pagination';
import '@icedesign/base/lib/pagination/style.js'; import '@icedesign/base/lib/pagination/style.js';
import './ShixunPaths.css'; import './ShixunPaths.css';
import KeywordList from '../tpm/shixuns/shixun-keyword-list'; import KeywordList from '../tpm/shixuns/shixun-keyword-list';
import btnUrl from '../tpm/shixuns/btn-new.png'; import btnUrl from './btn-new.png';
class ShixunPathSearch extends Component { class ShixunPathSearch extends Component {
constructor(props) { constructor(props) {
@ -252,7 +252,7 @@ class ShixunPathSearch extends Component {
</ul> </ul>
</div> </div>
</div> </div>
<KeywordList btnUrl={btnUrl} onChangeLabel={this.onChangeLabel.bind(this)} OnSearchInput={this.OnSearchInput.bind(this)} onNewHandler={this.getUser.bind(this, '/paths/new')} btnStyle={{ top: '92px' }} /> <KeywordList btnUrl={btnUrl} onChangeLabel={this.onChangeLabel.bind(this)} OnSearchInput={this.OnSearchInput.bind(this)} onNewHandler={this.getUser.bind(this, '/paths/new')} btnStyle={{ top: '72px' }} />
<PathCard {...this.props} {...this.state}></PathCard> <PathCard {...this.props} {...this.state}></PathCard>
{ {

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

@ -60,7 +60,8 @@ class TPMBanner extends Component {
openshowpublictype:false, openshowpublictype:false,
Radiovalue:1, Radiovalue:1,
TextAreaintshow:false, TextAreaintshow:false,
cancelText:undefined,
okText:undefined,
} }
} }
@ -434,6 +435,9 @@ class TPMBanner extends Component {
modalsMidval:undefined, modalsMidval:undefined,
ModalsBottomval:"", ModalsBottomval:"",
modalstyles:"", modalstyles:"",
cancelText:undefined,
okText:undefined,
Loadtype:false,
}) })
} }
ModalSave = () => { ModalSave = () => {
@ -441,7 +445,10 @@ class TPMBanner extends Component {
let url = "/shixuns/" + id + "/cancel_publish.json"; let url = "/shixuns/" + id + "/cancel_publish.json";
axios.get(url).then((response) => { axios.get(url).then((response) => {
this.props.showSnackbar(response.data.message); this.props.showSnackbar(response.data.message);
window.location.reload() // window.location.reload()
this.ModalCancel()
this.props.getcomponentdidmount()
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
@ -461,16 +468,21 @@ class TPMBanner extends Component {
ModalSaveopenpublic= () => { ModalSaveopenpublic= () => {
this.setState({ this.setState({
Modalstype: true, Modalstype: true,
Modalstopval: "公开申请已提交,请等待管理员的审核", Modalstopval:"公开实训需经过平台标准化审核审核周期为1-2天",
modalsMidval:"• 我们将在1-2个工作日内完成审核", modalsMidval:"公开的实训将对平台所有人可见。若仅本人教学使用",
ModalCancel: this.eopenpublicupdatadata, ModalsBottomval:"则无需申请公开, 直接发送到课堂即可。",
cancelText:"取消申请",
okText:"确定申请",
ModalCancel: this.ModalCancel,
ModalSave: this.eopenpublicupdatadata, ModalSave: this.eopenpublicupdatadata,
Loadtype:true, // Loadtype:true,
modalstyles:"848282" // modalstyles:"848282"
}) })
} }
eopenpublicupdatadata=()=>{ eopenpublicupdatadata=()=>{
window.location.reload() // window.location.reload()
this.ModalCancel()
this.props.getcomponentdidmount()
} }
openpublic=()=>{ openpublic=()=>{
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
@ -490,7 +502,9 @@ class TPMBanner extends Component {
let url = `/shixuns/${id}/cancel_apply_public.json`; let url = `/shixuns/${id}/cancel_apply_public.json`;
axios.get(url).then((response) => { axios.get(url).then((response) => {
if(response.data.status===0){ if(response.data.status===0){
window.location.reload() // window.location.reload()
this.ModalCancel()
this.props.getcomponentdidmount()
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -522,7 +536,10 @@ class TPMBanner extends Component {
evaluation_set_position = response.data.evaluation_set_position evaluation_set_position = response.data.evaluation_set_position
} }
if(response.data.status===0){ if(response.data.status===0){
window.location.reload() // window.location.reload()
this.applyreleaseopen()
// this.ModalCancel()
this.props.getcomponentdidmount()
}else{ }else{
this.setState({ this.setState({
Issuevisible: true, Issuevisible: true,
@ -536,13 +553,23 @@ class TPMBanner extends Component {
console.log(error) console.log(error)
}); });
}; };
applyreleaseopen = () => {
this.setState({
Modalstype: true,
Loadtype:true,
Modalstopval: "实训发布后即可发送课堂使用",
ModalSave: this.ModalCancel,
})
}
hiddenIssuevisible = (val) => { hiddenIssuevisible = (val) => {
this.setState({ this.setState({
Issuevisible: false Issuevisible: false
}) })
if (val === 0 || val === 1) { if (val === 0 || val === 1) {
window.location.reload() // window.location.reload()
this.ModalCancel()
this.props.getcomponentdidmount()
} }
} }
@ -803,7 +830,9 @@ class TPMBanner extends Component {
hidestartshixunsreplacevalue, hidestartshixunsreplacevalue,
Forkvisibletype, Forkvisibletype,
AccountProfiletype, AccountProfiletype,
isIE isIE,
cancelText,
okText,
} = this.state; } = this.state;
let {shixunsDetails, shixunId, star_info, star_infos} = this.props; let {shixunsDetails, shixunId, star_info, star_infos} = this.props;
let challengeBtnTipText = ''; let challengeBtnTipText = '';
@ -900,6 +929,8 @@ class TPMBanner extends Component {
modalsMidval={this.state.modalsMidval} modalsMidval={this.state.modalsMidval}
loadtype={this.state.Loadtype} loadtype={this.state.Loadtype}
modalstyles={this.state.modalstyles} modalstyles={this.state.modalstyles}
cancelText={this.state.cancelText}
okText={this.state.okText}
/> : ""} /> : ""}
<div className="educontent clearfix"> <div className="educontent clearfix">

@ -4,48 +4,58 @@
} */ } */
body { body {
overflow: auto !important; overflow: auto !important;
font-family: "Microsoft YaHei"; font-family: "Microsoft YaHei";
} }
#root { #root {
/* ie兼容性 */ /* ie兼容性 */
position: relative; position: relative;
min-height: 100%; min-height: 100%;
} }
body>.-task-title { body>.-task-title {
opacity: 1 !important; opacity: 1 !important;
} }
/*<2A><><EFBFBD><EFBFBD><EFBFBD>Ŵ󾵵<C5B4><F3BEB5B5><EFBFBD><EFBFBD><EFBFBD>·Ŵ󾵵<C5B4>λ<EFBFBD><CEBB>*/ /*<2A><><EFBFBD><EFBFBD><EFBFBD>Ŵ󾵵<C5B4><F3BEB5B5><EFBFBD><EFBFBD><EFBFBD>·Ŵ󾵵<C5B4>λ<EFBFBD><CEBB>*/
#root .search-all { #root .search-all {
width: 219px; width: 219px;
} }
/*Header START*/ /*Header START*/
.newHeader .logoimg { .newHeader .logoimg {
margin-top: 16px; margin-top: 16px;
float: left; float: left;
width: 97px; width: 97px;
} }
.head-right i { .head-right i {
font-size: 20px; font-size: 20px;
float: none !important; float: none !important;
} }
.headIcon, #header_keyword_search {
padding-top: 13px !important; .headIcon,
#header_keyword_search {
padding-top: 13px !important;
} }
.search-icon { .search-icon {
height: 30px !important; height: 30px !important;
} }
.search-icon i { .search-icon i {
font-size: 20px; font-size: 20px;
} }
#header_keyword_search i { #header_keyword_search i {
color: #4cacff; color: #4cacff;
} }
.ant-select-selection--multiple{
padding-bottom: 0px!important; .ant-select-selection--multiple {
padding-top:3px; padding-bottom: 0px !important;
padding-top: 3px;
} }
/* 先注释掉下面2个样式这样写影响范围太广了并不是所有的select都需要40px高 */ /* 先注释掉下面2个样式这样写影响范围太广了并不是所有的select都需要40px高 */
/* .ant-select-selection--single{ /* .ant-select-selection--single{
height:40px!important; height:40px!important;
@ -53,247 +63,323 @@ body>.-task-title {
.ant-select-selection__rendered{ .ant-select-selection__rendered{
line-height: 40px!important; line-height: 40px!important;
} */ } */
.ant-select-selection--multiple .ant-select-selection__rendered>ul>li, .ant-select-selection--multiple>ul>li{ .ant-select-selection--multiple .ant-select-selection__rendered>ul>li,
height: 25px!important; .ant-select-selection--multiple>ul>li {
line-height: 23px!important; height: 25px !important;
margin-bottom:3px; line-height: 23px !important;
margin-top:0px; margin-bottom: 3px;
margin-top: 0px;
} }
/*Main START*/ /*Main START*/
.newContainer{ .newContainer {
background: #fafafa!important; background: #fafafa !important;
} }
.ant-modal-title{ .ant-modal-title {
font-size: 16px; font-size: 16px;
font-weight: bold !important; font-weight: bold !important;
color: #333; color: #333;
} }
.ant-modal-title{ .ant-modal-title {
text-align: center; text-align: center;
} }
/*.ant-modal{*/ /*.ant-modal{*/
/*top:10rem !important;*/ /*top:10rem !important;*/
/*}*/ /*}*/
@-moz-document url-prefix() { @-moz-document url-prefix() {
.ant-radio-inner { .ant-radio-inner {
width: 17px !important; width: 17px !important;
height: 17px !important; height: 17px !important;
} }
} }
/* IE只能用padding不能用上下居中 */ /* IE只能用padding不能用上下居中 */
.shixunDetail_top{ .shixunDetail_top {
display: block!important; display: block !important;
padding-top: 48px; padding-top: 48px;
}
.totalScore{
display: block!important;
padding-top: 40px;
} }
.head-nav ul#header-nav li{
/*font-weight: 600;*/ .totalScore {
display: block !important;
padding-top: 40px;
} }
/*.newFooter{*/ /*.newFooter{*/
/*position: fixed !important;*/ /*position: fixed !important;*/
/*}*/ /*}*/
.edu-menu-panel .edu-menu-listnew:hover .careersiconfont{ .edu-menu-panel .edu-menu-listnew:hover .careersiconfont {
color: #000 !important; color: #000 !important;
} }
.newHeader { .newHeader {
background: #24292D !important; background: #24292D !important;
height: 60px !important; height: 60px !important;
} }
/*-------------------个人主页:右侧提示区域--------------------------*/ /*-------------------个人主页:右侧提示区域--------------------------*/
.-task-sidebar{position:fixed;width:40px;height:180px;right:0;bottom:80px !important;z-index: 10;} .-task-sidebar {
.-task-sidebar>div{height: 40px;line-height: 40px;box-sizing: border-box;width:40px;background:#4CACFF;color:#fff;font-size:20px;text-align:center;margin-bottom:5px;border-radius: 4px;} position: fixed;
.-task-sidebar>div i{ color:#fff;} width: 40px;
.-task-sidebar>div i:hover{color: #fff!important;} height: 180px;
.gotop{background-color: rgba(208,207,207,0.5)!important;padding: 0px!important;} right: 0;
.-task-desc{background:#494949;width:90px;line-height: 36px;text-align: center; bottom: 20px !important;
position: absolute;color: #fff;font-size: 13px;z-index: 999999;opacity: 0;} z-index: 10;
.-task-desc div{position: absolute;top:10px;right: -7px;height: 13px;} }
.-task-desc div img{float: left}
.-task-sidebar .scan_ewm{ .-task-sidebar>div {
position: absolute !important; height: 40px;
right: 45px !important; line-height: 40px;
bottom: 0px !important; box-sizing: border-box;
background-color: #494949 !important; width: 40px;
-webkit-box-sizing: border-box !important; background: #4CACFF;
box-sizing: border-box !important; color: #fff;
font-size: 14px !important; font-size: 20px;
line-height: 16px !important; text-align: center;
display: none; margin-bottom: 5px;
height: 213px !important; border-radius: 4px;
} }
.trangle_right{position: absolute;right: -5px;bottom: 15px;width: 0;height: 0px;border-top: 6px solid transparent;border-left: 5px solid #494949;border-bottom: 6px solid transparent}
.-task-sidebar>div i {
.HeaderSearch{ color: #fff;
margin-top: 18px; }
margin-right: 20px;
} .-task-sidebar>div i:hover {
.HeaderSearch .ant-input-search .ant-input{ color: #fff !important;
/*height:30px;*/ }
background: #373e3f !important;
border: 1px solid #373e3f !important; .gotop {
background-color: rgba(208, 207, 207, 0.5) !important;
} padding: 0px !important;
.ant-input-search .ant-input-affix-wrapper{ }
border:transparent;
.-task-desc {
background: #494949;
width: 90px;
line-height: 36px;
text-align: center;
position: absolute;
color: #fff;
font-size: 13px;
z-index: 999999;
opacity: 0;
}
.-task-desc div {
position: absolute;
top: 10px;
right: -7px;
height: 13px;
} }
.-task-desc div img {
float: left
}
.-task-sidebar .scan_ewm {
position: absolute !important;
right: 45px !important;
bottom: 0px !important;
background-color: #494949 !important;
-webkit-box-sizing: border-box !important;
box-sizing: border-box !important;
font-size: 14px !important;
line-height: 16px !important;
display: none;
height: 213px !important;
}
.trangle_right {
position: absolute;
right: -5px;
bottom: 15px;
width: 0;
height: 0px;
border-top: 6px solid transparent;
border-left: 5px solid #494949;
border-bottom: 6px solid transparent
}
.HeaderSearch {
margin-top: 18px;
margin-right: 20px;
}
.HeaderSearch .ant-input-search .ant-input {
/*height:30px;*/
background: #373e3f !important;
border: 1px solid #373e3f !important;
}
.ant-input-search .ant-input-affix-wrapper {
border: transparent;
}
.ant-input-affix-wrapper:hover .ant-input:not(.ant-input-disabled) { .ant-input-affix-wrapper:hover .ant-input:not(.ant-input-disabled) {
/* 比较奇怪的需求先注释掉了如果需要启用麻烦增加class限制别影响别的地方的使用 */ /* 比较奇怪的需求先注释掉了如果需要启用麻烦增加class限制别影响别的地方的使用 */
/* border-color: transparent; */ /* border-color: transparent; */
} }
.ant-input:focus { .ant-input:focus {
/*border-color: transparent;*/ /*border-color: transparent;*/
border-right-width: 1px !important; border-right-width: 1px !important;
outline: 0; outline: 0;
-webkit-box-shadow: 0 0 0 2px transparent; -webkit-box-shadow: 0 0 0 2px transparent;
box-shadow: 0 0 0 2px transparent; box-shadow: 0 0 0 2px transparent;
border: 1px solid #d9d9d9; border: 1px solid #d9d9d9;
} }
.HeaderSearch .ant-input-search .ant-input::-webkit-input-placeholder{ .HeaderSearch .ant-input-search .ant-input::-webkit-input-placeholder {
color: #999; color: #999;
font-size: 14px; font-size: 14px;
} }
.HeaderSearch .ant-input-search .ant-input:-moz-placeholder { .HeaderSearch .ant-input-search .ant-input:-moz-placeholder {
color: #999; color: #999;
font-size: 14px; font-size: 14px;
} }
.HeaderSearch .ant-input-search .ant-input::-moz-placeholder{ .HeaderSearch .ant-input-search .ant-input::-moz-placeholder {
color: #999; color: #999;
font-size: 14px; font-size: 14px;
} }
.HeaderSearch .ant-input-search .ant-input:-ms-input-placeholder{ .HeaderSearch .ant-input-search .ant-input:-ms-input-placeholder {
color: #999; color: #999;
font-size: 14px; font-size: 14px;
} }
.HeaderSearch .ant-input-search .ant-input-suffix .anticon-search { .HeaderSearch .ant-input-search .ant-input-suffix .anticon-search {
color: #999; color: #999;
} }
.HeaderSearch .ant-input-search .ant-input{ .HeaderSearch .ant-input-search .ant-input {
color: #fff; color: #fff;
} }
.HeaderSearch .ant-input-search .ant-input-suffix{ .HeaderSearch .ant-input-search .ant-input-suffix {
background: transparent !important; background: transparent !important;
} }
.roundedRectangles{ .roundedRectangles {
position: absolute; position: absolute;
top: 10px; top: 10px;
right: -22px; right: -22px;
} }
.HeaderSearch{ .HeaderSearch {
width: 325px; width: 325px;
/*right: 20px;*/ /*right: 20px;*/
} }
.HeaderSearch .ant-input-search{
right: 20px; .HeaderSearch .ant-input-search {
right: 20px;
} }
.mainheighs{
height: 100%; .mainheighs {
display: block; height: 100%;
display: block;
} }
.ml18a{ .ml18a {
margin-left:18%; margin-left: 18%;
} }
.logoimg{ .logoimg {
float: left; float: left;
min-width: 40px; min-width: 40px;
height:40px; height: 40px;
} }
.headwith100b{ .headwith100b {
width: 100%; width: 100%;
} }
.wechatcenter{
text-align: center; .wechatcenter {
text-align: center;
} }
.myrigthsiderbar{ .myrigthsiderbar {
right: 9% !important; right: 9% !important;
} }
.feedbackdivcolor{ .feedbackdivcolor {
background: #33BD8C !important; background: #33BD8C !important;
height: 49px !important; height: 49px !important;
line-height: 24px !important; line-height: 24px !important;
} }
.xiaoshou{
cursor:pointer .xiaoshou {
cursor: pointer
} }
.questiontypes{
width:37px; .questiontypes {
height:17px; width: 37px;
font-size:12px; height: 17px;
color:rgba(51,51,51,1); font-size: 12px;
line-height:17px; color: rgba(51, 51, 51, 1);
cursor:pointer; line-height: 17px;
cursor: pointer;
} }
.questiontype{
width: 100%; .questiontype {
font-size: 12px; width: 100%;
color: #333333; font-size: 12px;
line-height: 17px; color: #333333;
text-align: center; line-height: 17px;
padding: 11px; text-align: center;
cursor:pointer; padding: 11px;
cursor: pointer;
} }
.questiontypeheng{
width:100%; .questiontypeheng {
height:1px; width: 100%;
background: #EEEEEE; height: 1px;
background: #EEEEEE;
} }
.mystask-sidebar{
right: 181px !important; .mystask-sidebar {
right: 181px !important;
} }
.mystask-sidebars{
right: 20px !important; .mystask-sidebars {
right: 20px !important;
} }
.shitikussmys{
width:29px !important; .shitikussmys {
height:20px!important; width: 29px !important;
background:#FF6601 !important; height: 20px !important;
border-radius:10px !important; background: #FF6601 !important;
position: absolute !important; border-radius: 10px !important;
font-size:11px !important; position: absolute !important;
color:#ffffff !important; font-size: 11px !important;
line-height:20px !important; color: #ffffff !important;
top: -13px !important; line-height: 20px !important;
right: -10px !important; top: -13px !important;
right: -10px !important;
} }
.maxnamewidth30{ .maxnamewidth30 {
max-width: 30px; max-width: 30px;
overflow:hidden; overflow: hidden;
text-overflow:ellipsis; text-overflow: ellipsis;
white-space:nowrap; white-space: nowrap;
cursor: default; cursor: default;
}
.mystask-sidebarss{
right: 5px !important;
} }
.mystask-sidebarss {
right: 5px !important;
}

@ -412,6 +412,7 @@ class TPMIndex extends Component {
{...this.props} {...this.props}
{...this.state} {...this.state}
is_jupyter={this.state. is_jupyter} is_jupyter={this.state. is_jupyter}
getcomponentdidmount={()=>this.getcomponentdidmount()}
></TPMBanner> ></TPMBanner>
} }

@ -276,6 +276,10 @@ export function TPMIndexHOC(WrappedComponent) {
isAdminOrTeacher = () => { isAdminOrTeacher = () => {
return this.state.coursedata&&this.state.coursedata.course_identity < 4 return this.state.coursedata&&this.state.coursedata.course_identity < 4
} }
// 助教===4
isAssistant=()=>{
return this.state.coursedata&&this.state.coursedata.course_identity ===4
}
// 超管、运维、课堂管理、老师、助教0-4 // 超管、运维、课堂管理、老师、助教0-4
isAdmin = () => { isAdmin = () => {
return this.state.coursedata&&this.state.coursedata.course_identity < 5 return this.state.coursedata&&this.state.coursedata.course_identity < 5
@ -711,6 +715,7 @@ export function TPMIndexHOC(WrappedComponent) {
isAdmin: this.isAdmin, isAdmin: this.isAdmin,
isAdminOrTeacher: this.isAdminOrTeacher, isAdminOrTeacher: this.isAdminOrTeacher,
isAssistant:this.isAssistant,
isStudent: this.isStudent, isStudent: this.isStudent,
isAdminOrStudent: this.isAdminOrStudent, isAdminOrStudent: this.isAdminOrStudent,
isNotMember: this.isNotMember, isNotMember: this.isNotMember,

@ -392,7 +392,7 @@ class ShixunsIndex extends Component {
// console.log(this.state.updata) // console.log(this.state.updata)
return ( return (
<div className="newMain clearfix backFAFAFA"> <div className="newMain clearfix backFAFAFA shi-xun-index">
{this.state.updata === undefined ? "" : <UpgradeModals {this.state.updata === undefined ? "" : <UpgradeModals
{...this.state} {...this.state}
/>} />}

@ -1,3 +1,7 @@
.shi-xun-index .search-keyword-container {
padding: 20px 0 15px 0;
}
.search-keyword-container { .search-keyword-container {
display: flex; display: flex;
flex-flow: row nowrap; flex-flow: row nowrap;

Loading…
Cancel
Save