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

competitions
hjm 5 years ago
commit cd9c671850

@ -1,5 +1,7 @@
$(document).on('turbolinks:load', function() {
if ($('body.admins-carousels-index-page').length > 0) {
var laboratoryId = $('#carousels-container').data('laboratoryId');
// ------------ 保存链接 -----------
$('.carousels-card').on('click', '.save-data-btn', function(){
var $link = $(this);
@ -13,7 +15,7 @@ $(document).on('turbolinks:load', function() {
$link.attr('disabled', true);
$.ajax({
url: '/admins/carousels/' + id,
url: '/admins/laboratories/' + laboratoryId + '/carousels/' + id,
method: 'PATCH',
dataType: 'json',
data: { link: link, name: name },
@ -34,7 +36,7 @@ $(document).on('turbolinks:load', function() {
$checkbox.attr('disabled', true);
$.ajax({
url: '/admins/carousels/' + id,
url: '/admins/laboratories/' + laboratoryId + '/carousels/' + id,
method: 'PATCH',
dataType: 'json',
data: { status: checked },
@ -60,7 +62,7 @@ $(document).on('turbolinks:load', function() {
var insertId = $(sibling).data('id') || '';
$.ajax({
url: '/admins/carousels/drag',
url: '/admins/laboratories/' + laboratoryId + '/carousels/drag',
method: 'POST',
dataType: 'json',
data: { move_id: moveId, after_id: insertId },

@ -48,9 +48,15 @@
}
.action-container {
.action {
& > .action {
padding: 0 3px;
}
.more-action-dropdown {
.dropdown-item {
font-size: 14px;
}
}
}
/* 分页 */

@ -1,15 +1,17 @@
class Admins::CarouselsController < Admins::BaseController
before_action :convert_file!, only: [:create]
helper_method :current_laboratory
def index
@images = PortalImage.order(position: :asc)
@images = current_laboratory.portal_images.order(position: :asc)
end
def create
position = PortalImage.count + 1
position = current_laboratory.portal_images.count + 1
ActiveRecord::Base.transaction do
image = PortalImage.create!(create_params.merge(position: position))
image = current_laboratory.portal_images.create!(create_params.merge(position: position))
file_path = Util::FileManage.disk_filename('PortalImage', image.id)
File.delete(file_path) if File.exist?(file_path) # 删除之前的文件
@ -17,7 +19,7 @@ class Admins::CarouselsController < Admins::BaseController
end
flash[:success] = '保存成功'
redirect_to admins_carousels_path
redirect_to admins_laboratory_carousels_path(current_laboratory)
end
def update
@ -29,7 +31,7 @@ class Admins::CarouselsController < Admins::BaseController
ActiveRecord::Base.transaction do
current_image.destroy!
# 前移
PortalImage.where('position > ?', current_image.position)
current_laboratory.portal_images.where('position > ?', current_image.position)
.update_all('position = position - 1')
file_path = Util::FileManage.disk_filename('PortalImage', current_image.id)
@ -39,10 +41,10 @@ class Admins::CarouselsController < Admins::BaseController
end
def drag
move = PortalImage.find_by(id: params[:move_id])
after = PortalImage.find_by(id: params[:after_id])
move = current_laboratory.portal_images.find_by(id: params[:move_id])
after = current_laboratory.portal_images.find_by(id: params[:after_id])
Admins::DragPortalImageService.call(move, after)
Admins::DragPortalImageService.call(current_laboratory, move, after)
render_ok
rescue Admins::DragPortalImageService::Error => e
render_error(e.message)
@ -50,8 +52,12 @@ class Admins::CarouselsController < Admins::BaseController
private
def current_laboratory
@_current_laboratory ||= Laboratory.find(params[:laboratory_id])
end
def current_image
@_current_image ||= PortalImage.find(params[:id])
@_current_image ||= current_laboratory.portal_images.find(params[:id])
end
def create_params

@ -83,6 +83,7 @@ class AttachmentsController < ApplicationController
@file.destroy!
delete_file(@file_path)
normal_status("删除成功")
rescue Exception => e
uid_logger_error(e.message)
tip_exception(e.message)

@ -1,5 +1,6 @@
class Competitions::CompetitionsController < Competitions::BaseController
skip_before_action :require_login
before_action :allow_visit, except: [:index]
def index
# 已上架 或者 即将上架
@ -24,10 +25,10 @@ class Competitions::CompetitionsController < Competitions::BaseController
end
def show
unless current_competition.published? || admin_or_business?
render_forbidden
return
end
end
def common_header
end
private
@ -35,4 +36,11 @@ class Competitions::CompetitionsController < Competitions::BaseController
def current_competition
@_current_competition ||= Competition.find_by!(identifier: params[:id])
end
def allow_visit
unless current_competition.published? || admin_or_business?
render_forbidden
return
end
end
end

@ -2,6 +2,7 @@ module LaboratoryHelper
extend ActiveSupport::Concern
included do
helper_method :current_laboratory
helper_method :default_setting
end
@ -9,6 +10,10 @@ module LaboratoryHelper
@_current_laboratory ||= (Laboratory.find_by_subdomain(request.subdomain) || Laboratory.find(1))
end
def default_laboratory
@_default_laboratory ||= Laboratory.find(1)
end
def default_setting
@_default_setting ||= LaboratorySetting.find_by(laboratory_id: 1)
end

@ -583,6 +583,8 @@ class CoursesController < ApplicationController
# 学生身份的处理
student_member = course_members.where(role: %i[STUDENT]).take
# 不存在则创建学生身份
if params[:roles].include?("STUDENT") && student_member.blank?
correspond_teacher_exist = CourseMember.exists?(user_id: params[:user_id], is_active: 1, course_id: @course.id, role: %i[CREATOR PROFESSOR ASSISTANT_PROFESSOR])
new_student = CourseMember.new(user_id: params[:user_id], course_id: @course.id, role: 4)
@ -597,6 +599,9 @@ class CoursesController < ApplicationController
student_member.destroy!
CourseDeleteStudentDeleteWorksJob.perform_later(@course.id, [params[:user_id]])
# CourseDeleteStudentNotifyJob.perform_later(@course.id, [params[:user_id]], current_user.id)
elsif params[:roles].include?("STUDENT") && student_member.present? && !params[:roles].include?("PROFESSOR") && !params[:roles].include?("ASSISTANT_PROFESSOR")
# 学生身份存在且学生没有教师身份时更新is_active
student_member.update_attributes!(is_active: 1)
end
normal_status(0, "修改成功")

@ -2,10 +2,12 @@ class HomeController < ApplicationController
def index
# banner图
images = PortalImage.where(status: true).order("position asc")
images = current_laboratory.portal_images.only_online.order(position: :asc)
images = default_laboratory.portal_images.only_online.order(position: :asc) if images.blank? # 未设置时使用EduCoder的轮播图
@images_url = []
images.each do |image|
@images_url << {path: image.link, image_url: Util::FileManage.disk_file_url('PortalImage', image.id)}
@images_url << {path: image.link, image_url: Util::FileManage.source_disk_file_url(image)}
end
# 目录分级

@ -1,5 +1,5 @@
class MainController < ApplicationController
def index
render file: 'public/react/build/index.html', :layout => false
render file: 'public/react/build/index', formats: [:html]
end
end

@ -1,5 +1,6 @@
class Weapps::CodeSessionsController < Weapps::BaseController
def create
logged = false
return render_error('code不能为空') if params[:code].blank?
result = Wechat::Weapp.jscode2session(params[:code])
@ -12,6 +13,7 @@ class Weapps::CodeSessionsController < Weapps::BaseController
if open_user.present? && open_user.user
set_session_unionid(result['unionid'])
successful_authentication(open_user.user)
logged = true
else
# 新用户
user_info = Wechat::Weapp.decrypt(result['session_key'], params[:encrypted_data], params[:iv])
@ -19,6 +21,6 @@ class Weapps::CodeSessionsController < Weapps::BaseController
set_session_unionid(user_info['unionId'])
end
render_ok(openid: result['openid'])
render_ok(openid: result['openid'], logged: logged)
end
end

@ -39,6 +39,11 @@ module ExercisesHelper
else
ques_score = 0.0
end
elsif q_type == Exercise::COMPLETION
ques_score = answers_content.select{|answer| answer.score >= 0.0}.pluck(:score).sum
if ques_score.to_s.split(".").last == "9"
ques_score = ques_score.to_f + 0.1
end
else
ques_score = answers_content.select{|answer| answer.score >= 0.0}.pluck(:score).sum
end
@ -115,14 +120,27 @@ module ExercisesHelper
if ex.question_type > Exercise::COMPLETION #当为主观题和实训题时,
ex_answered_scores = effictive_users.score_reviewed.pluck(:score).sum #该问题的全部得分
percent = (ex_total_score == 0.0 ? 0.0 : (ex_answered_scores / ex_total_score.to_f).round(3) * 100) #正确率
end
# if ex.question_type != Exercise::MULTIPLE
# ex_answered_scores = effictive_users.score_reviewed.pluck(:score).sum #该问题的全部得分
# percent = (ex_total_score == 0.0 ? 0.0 : (ex_answered_scores / ex_total_score.to_f).round(3) * 100) #正确率
# else
# multiple_score = 0
# user_ids.each do |user_id|
# ex_answer_score = ex_answers.select{|answer| answer.user_id == user_id}&.first&.score.to_f
# multiple_score += ex_answer_score
# end
# percent = (ex_total_score == 0.0 ? 0.0 : (multiple_score / ex_total_score.to_f).round(3) * 100) #正确率
# end
question_answer_infos = []
if ex.question_type <= Exercise::JUDGMENT #选择题和判断题
ex_choices = ex.exercise_choices
standard_answer = ex.exercise_standard_answers.pluck(:exercise_choice_id).sort #标准答案的位置
# right_users_count = 0
# 该问题的正确率
right_users_count = 0
#该问题的正确率
if ex.question_type == Exercise::MULTIPLE #多选题
right_user_ids = user_ids
standard_answer.each do |choice_position|
@ -130,10 +148,13 @@ module ExercisesHelper
right_user_ids = right_user_ids & effictive_users.select{|answer| answer.exercise_choice_id == standard_answer_choice_id}.pluck(:user_id)
end
right_users_count = right_user_ids.size
# right_users_scores = right_users_count * ex&.question_score.to_f
else #单选题和判断题
standard_answer_choice_id = ex_choices.select{|ec| ec.choice_position == standard_answer.first}.first&.id
right_users_count = effictive_users.select{|answer| answer.exercise_choice_id == standard_answer_choice_id}.size
# right_users_scores = right_users_count * ex&.question_score.to_f
end
# percent = (ex_total_score == 0.0 ? 0.0 : (right_users_scores / ex_total_score.to_f).round(3) * 100) #正确率
percent = commit_user_ids > 0 ? (right_users_count / commit_user_ids.to_f).round(3)*100 : 0.0
@ -159,6 +180,7 @@ module ExercisesHelper
null_stand_choice = null_standard_answer.pluck(:exercise_choice_id) #一个exercise_choice_id可能对应多个answer_text
null_stand_text = null_standard_answer.pluck(:answer_text)
standard_answer_count = 0
each_null_score = null_stand_choice.size > 0 ? (ex&.question_score.to_f / null_stand_choice.uniq.size).round(3) : 0.0
all_user_count = 0
null_stand_choice.each_with_index do |s,index|
user_count = 0
@ -181,7 +203,10 @@ module ExercisesHelper
all_user_count += user_count
standard_answer_count += 1
end
percent = commit_user_ids > 0 ? (all_user_count / commit_user_ids.to_f).round(3)*100 : 0.0
answer_user_score = all_user_count * each_null_score
percent = (ex_total_score == 0.0 ? 0.0 : (answer_user_score / ex_total_score.to_f).round(3) * 100) #正确率
# percent = commit_user_ids > 0 ? (all_user_count / commit_user_ids.to_f).round(3)*100 : 0.0
user_wrong_count = (effictive_users_count - all_user_count )
@ -780,8 +805,16 @@ module ExercisesHelper
user_score_pre = exercise_answers.select{|answer| answer.score >= 0.0}
if ques_type == 4 #主观题时且没有大于0的分数时为空
user_score = user_score_pre.present? ? user_score_pre.pluck(:score).sum : nil
elsif ques_type == 5 || ques_type == 3
elsif ques_type == 5
user_score = user_score_pre.present? ? user_score_pre.pluck(:score).sum : 0.0
elsif ques_type == 3 #填空题时需小心出现9.9分
user_score = user_score_pre.present? ? user_score_pre.pluck(:score).sum : 0.0
if user_score > 0.0
if user_score.to_s.split(".").last == "9"
user_score = user_score.to_f + 0.1
end
end
# user_score = user_score_pre.present? ? user_score_pre.pluck(:score).sum : 0.0
else #选择题,判断题根据第一个记录查分
user_score = user_score_pre.present? ? user_score_pre.first.score : 0.0

@ -1,3 +1,4 @@
# 基于Redis实现热门搜索关键字
class HotSearchKeyword
class << self
def add(keyword)

@ -37,6 +37,7 @@ class HomeworkCommon < ApplicationRecord
validates :name, length: { maximum: 60 }
validates :description, length: { maximum: 15000 }
validates :explanation, length: { maximum: 5000 }
validates :reference_answer, length: { maximum: 15000 }
# after_update :update_activity

@ -6,6 +6,8 @@ class Laboratory < ApplicationRecord
has_one :laboratory_setting, dependent: :destroy
has_many :portal_images, dependent: :destroy
validates :identifier, uniqueness: { case_sensitive: false }, allow_nil: true
def site

@ -1,4 +1,8 @@
class PortalImage < ApplicationRecord
belongs_to :laboratory
scope :only_online, -> { where(status: true) }
def online?
status?
end

@ -1,9 +1,10 @@
class Admins::DragPortalImageService < ApplicationService
Error = Class.new(StandardError)
attr_reader :move, :after
attr_reader :laboratory, :move, :after
def initialize(move, after)
def initialize(laboratory, move, after)
@laboratory = laboratory
@move = move
@after = after # 移动后下一个位置的元素
end
@ -11,7 +12,7 @@ class Admins::DragPortalImageService < ApplicationService
def call
return if move.position + 1 == after&.position # 未移动
images = PortalImage.all
images = laboratory.portal_images
ActiveRecord::Base.transaction do
if after.blank? || move.id == after.id # 移动至末尾
@ -31,5 +32,4 @@ class Admins::DragPortalImageService < ApplicationService
end
end
end
end

@ -1,5 +1,6 @@
<%
define_admin_breadcrumbs do
add_admin_breadcrumb('云上实验室', admins_laboratories_path)
add_admin_breadcrumb('轮播图')
end
%>
@ -9,7 +10,7 @@
<span class="flex-1">首页轮播图<span class="text-secondary font-12">(拖动排序)</span></span>
<%= javascript_void_link '添加', class: 'btn btn-primary btn-sm add-btn', data: { toggle: 'modal', target: '.admin-add-carousel-modal' } %>
</div>
<div class="card-body row" id="carousels-container">
<div class="card-body row" id="carousels-container" data-laboratory-id="<%= current_laboratory.id %>">
<% @images.each_with_index do |image, index| %>
<div class="col-12 custom-carousel-item custom-carousel-item-<%= image.id %>" data-id="<%= image.id %>">
<div class="border rounded relative p-3 mb-3 drag row align-items-center <%= image.online? ? '' : 'not_active' %>">
@ -28,7 +29,7 @@
</div>
<div class="col-2 col-md-1 operate-box">
<%= check_box_tag(:online, 1, image.online?, id: nil, class: 'online-check-box', data: { id: image.id, toggle: 'tooltip', title: '首页展示' }) %>
<%= delete_link '删除', admins_carousel_path(image, element: ".custom-carousel-item-#{image.id}", not_refresh: true), class: 'delete-btn' do %>
<%= delete_link '删除', admins_laboratory_carousel_path(image, laboratory_id: image.laboratory_id, element: ".custom-carousel-item-#{image.id}", not_refresh: true), class: 'delete-btn' do %>
<i class="fa fa-trash-o" data-id="<%= image.id %>"></i>
<% end %>
</div>
@ -39,5 +40,5 @@
</div>
<%= render partial: 'admins/carousels/shared/add_carousel_modal' %>
<%= render partial: 'admins/carousels/shared/add_carousel_modal', locals: { laboratory_id: current_laboratory } %>
<%= render partial: 'admins/shared/modal/upload_file_modal' %>

@ -8,7 +8,7 @@
</button>
</div>
<div class="modal-body">
<%= simple_form_for(PortalImage.new, url: admins_carousels_path, html: { class: 'admin-add-carousel-form', enctype: 'multipart/form-data' }) do |f| %>
<%= simple_form_for(PortalImage.new, url: admins_laboratory_carousels_path(laboratory_id: laboratory_id), html: { class: 'admin-add-carousel-form', enctype: 'multipart/form-data' }) do |f| %>
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">

@ -30,11 +30,18 @@
</td>
<td><%= laboratory.created_at.strftime('%Y-%m-%d %H:%M') %></td>
<td class="action-container">
<%= link_to '定制', admins_laboratory_laboratory_setting_path(laboratory) %>
<%= link_to '定制', admins_laboratory_laboratory_setting_path(laboratory), class: 'action' %>
<% if school.present? && laboratory.id != 1 %>
<%= javascript_void_link '添加管理员', class: 'action', data: { laboratory_id: laboratory.id, toggle: 'modal', target: '.admin-add-laboratory-user-modal' } %>
<%= delete_link '删除', admins_laboratory_path(laboratory, element: ".laboratory-item-#{laboratory.id}"), class: 'delete-laboratory-action' %>
<% end %>
<%= javascript_void_link('更多', class: 'action dropdown-toggle', 'data-toggle': 'dropdown', 'aria-haspopup': true, 'aria-expanded': false) %>
<div class="dropdown-menu more-action-dropdown">
<%= link_to '轮播图', admins_laboratory_carousels_path(laboratory), class: 'dropdown-item' %>
<% if school.present? && laboratory.id != 1 %>
<%= delete_link '删除', admins_laboratory_path(laboratory, element: ".laboratory-item-#{laboratory.id}"), class: 'dropdown-item delete-laboratory-action' %>
<% end %>
</div>
</td>

@ -33,7 +33,6 @@
<%= sidebar_item_group('#schools-submenu', '单位管理', icon: 'building') do %>
<li><%= sidebar_item(admins_schools_path, '单位列表', icon: 'university', controller: 'admins-schools') %></li>
<li><%= sidebar_item(admins_departments_path, '部门列表', icon: 'sitemap', controller: 'admins-departments') %></li>
<li><%= sidebar_item(admins_laboratories_path, '云上实验室', icon: 'cloud', controller: 'admins-laboratories') %></li>
<% end %>
</li>
@ -67,10 +66,10 @@
</li>
<li><%= sidebar_item(admins_competitions_path, '竞赛', icon: 'trophy', controller: 'admins-competitions') %></li>
<li><%= sidebar_item(admins_laboratories_path, '云上实验室', icon: 'cloud', controller: 'admins-laboratories') %></li>
<li>
<%= sidebar_item_group('#setting-submenu', '网站建设', icon: 'cogs') do %>
<li><%= sidebar_item(admins_carousels_path, '轮播图', icon: 'image', controller: 'admins-carousels') %></li>
<li><%= sidebar_item(edit_admins_about_path, '关于我们', icon: 'smile-o', controller: 'admins-abouts') %></li>
<li><%= sidebar_item(edit_admins_contact_us_path, '联系我们', icon: 'commenting-o', controller: 'admins-contact_us') %></li>
<li><%= sidebar_item(admins_cooperatives_path, '合作伙伴', icon: 'handshake-o', controller: 'admins-cooperatives') %></li>

@ -1 +0,0 @@
json.partial! "commons/success"

@ -1,7 +1,7 @@
json.count @count
json.competitions do
json.array! @competitions.each do |competition|
json.extract! competition, :id, :identifier, :name, :sub_title
json.extract! competition, :id, :identifier, :name, :sub_title, :bonus, :description
json.visits_count competition.visits
member_count = @member_count_map&.fetch(competition.id, 0) || competition.team_members.count

@ -1,2 +1,3 @@
admins-mirror_scripts: 'admins-mirror_repositories'
admins-laboratory_settings: 'admins-laboratories'
admins-laboratory_settings: 'admins-laboratories'
admins-carousels: 'admins-laboratories'

@ -13,6 +13,7 @@ rescue => ex
puts %Q{\033[33m [warning] wechat config or configuration.yml missing,
please add it or execute 'cp config/configuration.yml.example config/configuration.yml' \033[0m}
wechat_config = {}
weapp_config = {}
end
# 网站应用

@ -790,6 +790,10 @@ Rails.application.routes.draw do
end
resources :teachers, only: [:index]
resources :students, only: [:index]
member do
get :common_header
end
end
end
@ -981,12 +985,13 @@ Rails.application.routes.draw do
post :drag, on: :collection
post :replace_image_url, on: :member
end
resources :carousels, only: [:index, :create, :update, :destroy] do
post :drag, on: :collection
end
resources :laboratories, only: [:index, :create, :destroy] do
resource :laboratory_setting, only: [:show, :update]
resource :laboratory_user, only: [:create, :destroy]
resources :carousels, only: [:index, :create, :update, :destroy] do
post :drag, on: :collection
end
end
resources :competitions, only: [:index, :destroy] do

@ -0,0 +1,6 @@
class AddDescriptionToCompetitions < ActiveRecord::Migration[5.2]
def change
add_column :competitions, :description, :text
add_column :competitions, :introduction, :text
end
end

@ -0,0 +1,8 @@
class AddLaboratoryIdToPortalImages < ActiveRecord::Migration[5.2]
def change
add_column :portal_images, :laboratory_id, :bigint
add_index :portal_images, :laboratory_id
execute 'UPDATE portal_images SET laboratory_id = 1'
end
end

File diff suppressed because one or more lines are too long

@ -25080,11 +25080,16 @@ input.form-control {
}
/* line 51, app/assets/stylesheets/admins/common.scss */
.admin-body-container .action-container .action {
.admin-body-container .action-container > .action {
padding: 0 3px;
}
/* line 57, app/assets/stylesheets/admins/common.scss */
/* line 56, app/assets/stylesheets/admins/common.scss */
.admin-body-container .action-container .more-action-dropdown .dropdown-item {
font-size: 14px;
}
/* line 63, app/assets/stylesheets/admins/common.scss */
.admin-body-container .paginate-container {
margin-top: 20px;
display: -webkit-box;
@ -25098,68 +25103,68 @@ input.form-control {
align-items: center;
}
/* line 64, app/assets/stylesheets/admins/common.scss */
/* line 70, app/assets/stylesheets/admins/common.scss */
.admin-body-container .paginate-container .paginate-total {
margin-bottom: 10px;
color: darkgrey;
}
/* line 69, app/assets/stylesheets/admins/common.scss */
/* line 75, app/assets/stylesheets/admins/common.scss */
.admin-body-container .paginate-container .pagination {
margin-bottom: 0px;
}
/* line 75, app/assets/stylesheets/admins/common.scss */
/* line 81, app/assets/stylesheets/admins/common.scss */
.admin-body-container .search-form-container {
display: -webkit-box;
display: flex;
margin-bottom: 20px;
}
/* line 79, app/assets/stylesheets/admins/common.scss */
/* line 85, app/assets/stylesheets/admins/common.scss */
.admin-body-container .search-form-container .search-form {
-webkit-box-flex: 1;
flex: 1;
}
/* line 82, app/assets/stylesheets/admins/common.scss */
/* line 88, app/assets/stylesheets/admins/common.scss */
.admin-body-container .search-form-container .search-form * {
font-size: 14px;
}
/* line 84, app/assets/stylesheets/admins/common.scss */
/* line 90, app/assets/stylesheets/admins/common.scss */
.admin-body-container .search-form-container .search-form select, .admin-body-container .search-form-container .search-form input {
margin-right: 10px;
font-size: 14px;
}
/* line 91, app/assets/stylesheets/admins/common.scss */
/* line 97, app/assets/stylesheets/admins/common.scss */
.admin-body-container .global-error {
color: grey;
min-height: 300px;
}
/* line 95, app/assets/stylesheets/admins/common.scss */
/* line 101, app/assets/stylesheets/admins/common.scss */
.admin-body-container .global-error-code {
font-size: 80px;
}
/* line 99, app/assets/stylesheets/admins/common.scss */
/* line 105, app/assets/stylesheets/admins/common.scss */
.admin-body-container .global-error-text {
font-size: 24px;
}
/* line 105, app/assets/stylesheets/admins/common.scss */
/* line 111, app/assets/stylesheets/admins/common.scss */
.admin-body-container .nav-tabs .nav-link {
padding: 0.5rem 2rem;
}
/* line 110, app/assets/stylesheets/admins/common.scss */
/* line 116, app/assets/stylesheets/admins/common.scss */
.admin-body-container .CodeMirror {
border: 1px solid #ced4da;
}
/* line 114, app/assets/stylesheets/admins/common.scss */
/* line 120, app/assets/stylesheets/admins/common.scss */
.admin-body-container .batch-action-container {
margin-bottom: -15px;
padding: 10px 20px 0;

@ -133848,6 +133848,8 @@ $(document).on('turbolinks:load', function(){
});
$(document).on('turbolinks:load', function() {
if ($('body.admins-carousels-index-page').length > 0) {
var laboratoryId = $('#carousels-container').data('laboratoryId');
// ------------ 保存链接 -----------
$('.carousels-card').on('click', '.save-data-btn', function(){
var $link = $(this);
@ -133861,7 +133863,7 @@ $(document).on('turbolinks:load', function() {
$link.attr('disabled', true);
$.ajax({
url: '/admins/carousels/' + id,
url: '/admins/laboratories/' + laboratoryId + '/carousels/' + id,
method: 'PATCH',
dataType: 'json',
data: { link: link, name: name },
@ -133882,7 +133884,7 @@ $(document).on('turbolinks:load', function() {
$checkbox.attr('disabled', true);
$.ajax({
url: '/admins/carousels/' + id,
url: '/admins/laboratories/' + laboratoryId + '/carousels/' + id,
method: 'PATCH',
dataType: 'json',
data: { status: checked },
@ -133908,7 +133910,7 @@ $(document).on('turbolinks:load', function() {
var insertId = $(sibling).data('id') || '';
$.ajax({
url: '/admins/carousels/drag',
url: '/admins/laboratories/' + laboratoryId + '/carousels/drag',
method: 'POST',
dataType: 'json',
data: { move_id: moveId, after_id: insertId },

@ -25080,11 +25080,16 @@ input.form-control {
}
/* line 51, app/assets/stylesheets/admins/common.scss */
.admin-body-container .action-container .action {
.admin-body-container .action-container > .action {
padding: 0 3px;
}
/* line 57, app/assets/stylesheets/admins/common.scss */
/* line 56, app/assets/stylesheets/admins/common.scss */
.admin-body-container .action-container .more-action-dropdown .dropdown-item {
font-size: 14px;
}
/* line 63, app/assets/stylesheets/admins/common.scss */
.admin-body-container .paginate-container {
margin-top: 20px;
display: -webkit-box;
@ -25098,68 +25103,68 @@ input.form-control {
align-items: center;
}
/* line 64, app/assets/stylesheets/admins/common.scss */
/* line 70, app/assets/stylesheets/admins/common.scss */
.admin-body-container .paginate-container .paginate-total {
margin-bottom: 10px;
color: darkgrey;
}
/* line 69, app/assets/stylesheets/admins/common.scss */
/* line 75, app/assets/stylesheets/admins/common.scss */
.admin-body-container .paginate-container .pagination {
margin-bottom: 0px;
}
/* line 75, app/assets/stylesheets/admins/common.scss */
/* line 81, app/assets/stylesheets/admins/common.scss */
.admin-body-container .search-form-container {
display: -webkit-box;
display: flex;
margin-bottom: 20px;
}
/* line 79, app/assets/stylesheets/admins/common.scss */
/* line 85, app/assets/stylesheets/admins/common.scss */
.admin-body-container .search-form-container .search-form {
-webkit-box-flex: 1;
flex: 1;
}
/* line 82, app/assets/stylesheets/admins/common.scss */
/* line 88, app/assets/stylesheets/admins/common.scss */
.admin-body-container .search-form-container .search-form * {
font-size: 14px;
}
/* line 84, app/assets/stylesheets/admins/common.scss */
/* line 90, app/assets/stylesheets/admins/common.scss */
.admin-body-container .search-form-container .search-form select, .admin-body-container .search-form-container .search-form input {
margin-right: 10px;
font-size: 14px;
}
/* line 91, app/assets/stylesheets/admins/common.scss */
/* line 97, app/assets/stylesheets/admins/common.scss */
.admin-body-container .global-error {
color: grey;
min-height: 300px;
}
/* line 95, app/assets/stylesheets/admins/common.scss */
/* line 101, app/assets/stylesheets/admins/common.scss */
.admin-body-container .global-error-code {
font-size: 80px;
}
/* line 99, app/assets/stylesheets/admins/common.scss */
/* line 105, app/assets/stylesheets/admins/common.scss */
.admin-body-container .global-error-text {
font-size: 24px;
}
/* line 105, app/assets/stylesheets/admins/common.scss */
/* line 111, app/assets/stylesheets/admins/common.scss */
.admin-body-container .nav-tabs .nav-link {
padding: 0.5rem 2rem;
}
/* line 110, app/assets/stylesheets/admins/common.scss */
/* line 116, app/assets/stylesheets/admins/common.scss */
.admin-body-container .CodeMirror {
border: 1px solid #ced4da;
}
/* line 114, app/assets/stylesheets/admins/common.scss */
/* line 120, app/assets/stylesheets/admins/common.scss */
.admin-body-container .batch-action-container {
margin-bottom: -15px;
padding: 10px 20px 0;
@ -26167,11 +26172,16 @@ input.form-control {
}
/* line 51, app/assets/stylesheets/admins/common.scss */
.admin-body-container .action-container .action {
.admin-body-container .action-container > .action {
padding: 0 3px;
}
/* line 57, app/assets/stylesheets/admins/common.scss */
/* line 56, app/assets/stylesheets/admins/common.scss */
.admin-body-container .action-container .more-action-dropdown .dropdown-item {
font-size: 14px;
}
/* line 63, app/assets/stylesheets/admins/common.scss */
.admin-body-container .paginate-container {
margin-top: 20px;
display: -webkit-box;
@ -26185,68 +26195,68 @@ input.form-control {
align-items: center;
}
/* line 64, app/assets/stylesheets/admins/common.scss */
/* line 70, app/assets/stylesheets/admins/common.scss */
.admin-body-container .paginate-container .paginate-total {
margin-bottom: 10px;
color: darkgrey;
}
/* line 69, app/assets/stylesheets/admins/common.scss */
/* line 75, app/assets/stylesheets/admins/common.scss */
.admin-body-container .paginate-container .pagination {
margin-bottom: 0px;
}
/* line 75, app/assets/stylesheets/admins/common.scss */
/* line 81, app/assets/stylesheets/admins/common.scss */
.admin-body-container .search-form-container {
display: -webkit-box;
display: flex;
margin-bottom: 20px;
}
/* line 79, app/assets/stylesheets/admins/common.scss */
/* line 85, app/assets/stylesheets/admins/common.scss */
.admin-body-container .search-form-container .search-form {
-webkit-box-flex: 1;
flex: 1;
}
/* line 82, app/assets/stylesheets/admins/common.scss */
/* line 88, app/assets/stylesheets/admins/common.scss */
.admin-body-container .search-form-container .search-form * {
font-size: 14px;
}
/* line 84, app/assets/stylesheets/admins/common.scss */
/* line 90, app/assets/stylesheets/admins/common.scss */
.admin-body-container .search-form-container .search-form select, .admin-body-container .search-form-container .search-form input {
margin-right: 10px;
font-size: 14px;
}
/* line 91, app/assets/stylesheets/admins/common.scss */
/* line 97, app/assets/stylesheets/admins/common.scss */
.admin-body-container .global-error {
color: grey;
min-height: 300px;
}
/* line 95, app/assets/stylesheets/admins/common.scss */
/* line 101, app/assets/stylesheets/admins/common.scss */
.admin-body-container .global-error-code {
font-size: 80px;
}
/* line 99, app/assets/stylesheets/admins/common.scss */
/* line 105, app/assets/stylesheets/admins/common.scss */
.admin-body-container .global-error-text {
font-size: 24px;
}
/* line 105, app/assets/stylesheets/admins/common.scss */
/* line 111, app/assets/stylesheets/admins/common.scss */
.admin-body-container .nav-tabs .nav-link {
padding: 0.5rem 2rem;
}
/* line 110, app/assets/stylesheets/admins/common.scss */
/* line 116, app/assets/stylesheets/admins/common.scss */
.admin-body-container .CodeMirror {
border: 1px solid #ced4da;
}
/* line 114, app/assets/stylesheets/admins/common.scss */
/* line 120, app/assets/stylesheets/admins/common.scss */
.admin-body-container .batch-action-container {
margin-bottom: -15px;
padding: 10px 20px 0;

@ -322,7 +322,7 @@ module.exports = {
warnings: false,
compress: {
drop_debugger: true,
// drop_console: true
drop_console: true
}
}
}),

@ -255,7 +255,7 @@ class Fileslistitem extends Component{
{this.props.isAdmin?
<span className={"fr mr10 mt2"} onClick={(event)=>this.eventStop(event)}>
<WordsBtn style="blue" className="colorblue font-16 mr20 fr">
<a className="btn colorblue"
<a className="btn colorblue fontweight400"
onClick={()=>this.settingList()}>设置</a>
</WordsBtn>
</span>:""}
@ -264,12 +264,12 @@ class Fileslistitem extends Component{
<span className={"fr mr10 mt2"} onClick={(event)=>this.eventStop(event)}>
<WordsBtn style="blue" className="colorblue font-16 mr20 fr">
<a className="btn colorblue"
<a className="btn colorblue fontweight400"
onClick={()=>this.settingList()}>设置</a>
</WordsBtn>
<WordsBtn style="blue" className="colorblue font-16 mr20 fr">
<a className="btn colorblue"
<a className="btn colorblue fontweight400"
onClick={()=>this.onDelete(discussMessage.id)}>删除</a>
</WordsBtn>

@ -1217,7 +1217,7 @@ class CommonWorkSetting extends Component{
{/* 开启时间 */}
<div className={"h20 mb30 ml60"}>
<span>开启时间</span>
<Tooltip placement="bottom" title={this.props.isSuperAdmin()?"":starttimetype===true?this.props.isAdmin()?"发布时间已过,则不能修改":"":""}>
<Tooltip placement="bottom" title={starttimetype===true?this.props.isAdmin()?"发布时间已过,则不能修改":"":""}>
<ConditionToolTip condition={moment(init_evaluation_start) < this.fetchMoment} title={this.props.isAdmin()?"时间已过,不能再修改":""}>
<span>
<DatePicker
@ -1290,7 +1290,7 @@ class CommonWorkSetting extends Component{
{/* 匿评数量 */}
<div className={"h20 mb30 ml60"}>
<span>匿评数量</span>
<Tooltip placement="bottom" title={this.props.isSuperAdmin()?"":starttimetype===true?this.props.isAdmin()?"发布时间已过,则不能修改":"":""}>
<Tooltip placement="bottom" title={starttimetype===true?this.props.isAdmin()?"发布时间已过,则不能修改":"":""}>
<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}
@ -1303,7 +1303,7 @@ class CommonWorkSetting extends Component{
<div className={"h20 mb30 ml60"}>
<span>缺评扣分</span>
<Tooltip placement="bottom" title={this.props.isSuperAdmin()?"":starttimetype===true?this.props.isAdmin()?"发布时间已过,则不能修改":"":""}>
<Tooltip placement="bottom" title={starttimetype===true?this.props.isAdmin()?"发布时间已过,则不能修改":"":""}>
<span>
<Input type="number" className="mr10" style={{width:"100px" }} value={absence_penalty} onInput={this.absence_penalty_change}
disabled={ anonymous_comment && !noAuth ? false : true} min={0} max={100}
@ -1378,7 +1378,7 @@ class CommonWorkSetting extends Component{
{/* 违规匿评扣分: */}
<div className={"h20 mb30 ml60"}>
<span>违规匿评扣分</span>
<Tooltip placement="bottom" title={this.props.isSuperAdmin()?"":starttimetype===true?this.props.isAdmin()?"发布时间已过,则不能修改":"":""}>
<Tooltip placement="bottom" title={starttimetype===true?this.props.isAdmin()?"发布时间已过,则不能修改":"":""}>
<span>
<Input type="number" className="mr10" style={{width:"100px" }} value={appeal_penalty} onInput={this.appeal_penalty_change}
disabled={ anonymous_appeal && !noAuth ? false : true} min={0} max={100}
@ -1400,7 +1400,7 @@ class CommonWorkSetting extends Component{
</div>
<div className={"mb30 ml60"}>
<Tooltip placement="bottom" title={this.props.isSuperAdmin()?"":starttimetype===true?this.props.isAdmin()?"发布时间已过,则不能修改":"":""}>
<Tooltip placement="bottom" title={starttimetype===true?this.props.isAdmin()?"发布时间已过,则不能修改":"":""}>
<RadioGroup onChange={this.ta_mode_change} value={ta_mode}>
<Radio style={radioStyle} value={1} disabled={noAuth}>
普通模式<span className={"font-14 color-grey-9 ml10"}>选中则取各助教最终评分的平均分</span>

@ -178,7 +178,13 @@ class UseBank extends Component{
})
});
}
};
getotiku = (url) => {
window.open(url, '_blank');
}
render(){
let { flag, nav_my, loading, hasMore, object_list, search, checkBoxValues,isChecked,page,is_teacher }=this.state
@ -202,7 +208,7 @@ class UseBank extends Component{
width: 170px !important;
}
.bankwidth{
width:27% !important;
width:32% !important;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap
@ -213,6 +219,15 @@ class UseBank extends Component{
text-overflow:ellipsis;
white-space:nowrap
}
.with58{
width:58% !important;
Margin-left:15px
}
.with63{
width: 63% !important;
box-sizing: border-box;
margin-left: 15px;
}
`}</style>
@ -290,7 +305,7 @@ class UseBank extends Component{
return (
<p className="clearfix mb7" key={item.id}>
<Checkbox className="fl" value={item.id} key={item.id}></Checkbox>
<span className="fl with65">
<span className={nav_my === 'myself' ? "fl with58" : "fl with63"}>
<label className="task-hide fl" title={item.name && item.name.length > 30 ? item.name:""} style={{"maxWidth":"100%"}}>{item.name}</label>
</span>
<span title={item.course_list_name && item.course_list_name.length > 10 && item.course_list_name}
@ -304,25 +319,23 @@ class UseBank extends Component{
{nav_my === "myself" ?
(this.props.object_type && this.props.object_type === "normal" ?
<a style={{textAlign: "center"}} key={item.id} className="color-blue font-14 pl5"
href={`/banks/normal/${item.id}/edit/personal?tab=0`}
onClick={() => this.getotiku(`/banks/normal/${item.id}/edit/personal?tab=0`)}
>编辑</a>
: this.props.object_type && this.props.object_type === "group" ?
<a style={{textAlign: "center"}} key={item.id} className="color-blue font-14 pl5"
href={`/banks/group/${item.id}/edit/publicly?tab=0`}
onClick={() => this.getotiku(`/banks/group/${item.id}/edit/publicly?tab=0`)}
>编辑</a>
: this.props.object_type && this.props.object_type === "exercise" ?
<a style={{textAlign: "center"}} key={item.id} className="color-blue font-14 pl5"
href={`/banks/exercise/${item.id}/edit/personal`}
onClick={() => this.getotiku(`/banks/exercise/${item.id}/edit/personal`)}
>编辑</a>
: this.props.object_type && this.props.object_type === "poll" ?
<a style={{textAlign: "center"}} key={item.id} className="color-blue font-14 pl5"
href={`/banks/poll/${item.id}/edit/personal`}
onClick={() => this.getotiku(`/banks/poll/${item.id}/edit/personal`)}
>编辑</a>
: "")
: ""
}
</p>
)
})}

@ -162,17 +162,7 @@ class CoursesBanner extends Component {
return json;
};
showeditmenu = () => {
this.setState({
show: true,
})
}
hideeditmenu = () => {
this.setState({
show: false
})
}
tojoinclass = (val) => {
if(this.props.current_user&&this.props.current_user.profile_completed===false){
@ -201,13 +191,14 @@ class CoursesBanner extends Component {
yslJointhe:true
})
}
showActionPoll=(i,s,ss)=>{
showActionPoll=(i,s,ss,trs)=>{
this.setState({
modalsType: true,
modalsTopval: s,
loadtype: false,
metype: i,
modalsBottomval: ss,
modalstrsvalue:trs,
})
}
ActionPoll = (i) => {
@ -248,9 +239,10 @@ class CoursesBanner extends Component {
}
}
if (i ===5) {
s = "复制”功能将会为您创建一个新的课堂旧课堂的作业、资源、试卷";
ss = "都将被复制到新的课堂里面请问是否继续??";
this.showActionPoll(i,s,ss)
s = `“复制”功能将会为您创建一个新的课堂`;
ss = "请问是否继续?";
let mid="旧课堂的作业、资源、试卷都将被复制到新的课堂里面 ";
this.showActionPoll(i,s,ss,mid)
}
}
@ -261,7 +253,8 @@ class CoursesBanner extends Component {
modalsTopval: "",
modalsBottomval:"",
loadtype: false,
antIcon:false
antIcon:false,
modalstrsvalue:undefined
})
}
@ -483,7 +476,7 @@ class CoursesBanner extends Component {
render() {
let { Addcoursestypes, coursedata,excellent, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,is_guide,AccountProfiletype} = this.state;
let { Addcoursestypes, coursedata,excellent, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,is_guide,AccountProfiletype,modalstrsvalue} = this.state;
const isCourseEnd = this.props.isCourseEnd()
document.title=coursedata===undefined || coursedata.status===401 || coursedata.status===407?"":coursedata.name;
return (
@ -513,6 +506,7 @@ class CoursesBanner extends Component {
modalsTopval={modalsTopval}
loadtype={loadtype}
modalsBottomval={modalsBottomval}
modalsMidval={modalstrsvalue}
modalCancel={this.modalCancel}
modalSave={this.ModalAction}
antIcon={antIcon}

@ -528,20 +528,31 @@ class Coursesleftnav extends Component{
axios.post(url,
{name:value}).then((result)=>{
if(result.data.status===0){
// window.location.reload()
this.updasaveNavmoda()
//
notification.open({
message:"提示",
description:result.data.message
});
trigger('updateNavSuccess')
if(positiontype==="files"){
window.location.href=`/courses/${coursesId}/file/${result.data.category_id}`;
// this.props.history.push(`/courses/${coursesId}/file/${result.data.category_id}`)
if(result!=undefined){
if(result.data.status===0){
// window.location.reload()
this.updasaveNavmoda()
//
notification.open({
message:"提示",
description:result.data.message
});
trigger('updateNavSuccess')
if(positiontype==="files"){
window.location.href=`/courses/${coursesId}/file/${result.data.category_id}`;
}
if(positiontype==="boards"){
window.location.href=`/courses/${coursesId}/boards/${result.data.category_id}`;
}
if(positiontype==="course_groups"){
window.location.href=`/courses/${coursesId}/course_groups/${result.data.group_id}`;
}
}
}
}
}).catch((error)=>{
console.log(error)
})
@ -549,17 +560,19 @@ class Coursesleftnav extends Component{
saveboardpost=(url,value)=>{
axios.put(url,
{name:value}).then((result)=>{
if(result.data.status===0){
// window.location.reload()
this.updasaveNavmoda()
trigger('updateNavSuccess')
//
notification.open({
message:"提示",
description:result.data.message
});
}
if(result!=undefined){
if(result.data.status===0){
// window.location.reload()
this.updasaveNavmoda()
trigger('updateNavSuccess')
//
notification.open({
message:"提示",
description:result.data.message
});
}
}
}).catch((error)=>{
console.log(error)
})
@ -599,7 +612,7 @@ class Coursesleftnav extends Component{
let newid=this.props.match.params.coursesId;
let url="/courses/"+newid+"/course_groups.json";
this.saveNavmodapost(url,NavmodalValue)
this.saveNavmodapost(url,NavmodalValue,this.state.positiontype,this.props.match.params.coursesId)
}else if(Navmodaltypename===3){
@ -620,7 +633,7 @@ class Coursesleftnav extends Component{
let newid=this.props.match.params.coursesId;
let url = "/courses/"+newid+"/boards.json";
this.saveNavmodapost(url,NavmodalValue)
this.saveNavmodapost(url,NavmodalValue,this.state.positiontype,this.props.match.params.coursesId)
}else if(Navmodaltypename===7) {
@ -708,13 +721,15 @@ class Coursesleftnav extends Component{
droppablepost=(url,list)=>{
axios.post(url,{position: list}).then((result)=>{
// this.updasaveNavmoda(result.data.message)
this.updasaveNavmoda()
//
notification.open({
message:"提示",
description:result.data.message
});
if(result!=undefined){
// this.updasaveNavmoda(result.data.message)
this.updasaveNavmoda()
//
notification.open({
message:"提示",
description:result.data.message
});
}
}).catch((error)=>{
console.log(error)
})

@ -45,6 +45,12 @@ class Selectsetting extends Component{
componentDidMount() {
this.getalldata();
}
getalldata=()=>{
let {discussMessageid} =this.props;
let course_id=this.props.course_id;
let url="/files/"+discussMessageid+".json";
@ -70,19 +76,10 @@ class Selectsetting extends Component{
console.log(error);
});
}
getalldata=()=>{
}
componentDidUpdate = (prevProps) => {
if ( prevProps.visible != this.props.visible ) {
console.log(prevProps)
console.log(this.props)
this.setState({
visible:this.props.visible
})
@ -105,7 +102,6 @@ class Selectsetting extends Component{
ModalSave:this.hidecouseShixunModal,
loadtype:false
})
this.props.Cancel()
}
savecouseShixunModal=()=>{
@ -152,9 +148,10 @@ class Selectsetting extends Component{
delay_publish:Radiovalue
}).then((result)=>{
if(result.data.status===0){
this.hidecouseShixunModal()
this.props.setupdate(attachmentId)
this.props.showNotification("设置资源成功");
this.hidecouseShixunModal()
this.props.Cancel()
}
})
@ -233,6 +230,35 @@ class Selectsetting extends Component{
Radiovalue: e.target.value,
});
}
delectfils=(id)=>{
this.setState({
Modalstype:true,
Modalstopval:"是否确定删除该历史资源?",
ModalSave:()=>this.delectcousedelectfils(id),
ModalCancel:this.hidecouseShixunModal,
loadtype:false
})
}
delectcousedelectfils=(id)=>{
const url = `/attachments/${id}.json?type=history`;
axios.delete(url)
.then((response) => {
if (response.data.status == 0) {
// {"status":1,"message":"删除成功"}
this.hidecouseShixunModal()
this.getalldata()
this.props.showNotification(response.data.message);
}else{
this.props.showNotification(response.data.message);
}
})
.catch(function (error) {
console.log(error);
});
}
render(){
let {datatime,description,datalist}=this.state;
@ -256,7 +282,7 @@ class Selectsetting extends Component{
lineHeight: '30px',
};
console.log(this.state.Radiovalue)
return(
<div>
<style>
@ -329,7 +355,7 @@ class Selectsetting extends Component{
height: 37px;
}
.isabox{
max-width: 173px;
max-width:280px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@ -343,7 +369,7 @@ class Selectsetting extends Component{
`}</style>
<div className="pl20 pr20 settingbox">
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE">
<li className="fl" style={{width: '350px'}}>
<li className="fl" style={{width: '343px'}}>
<span className={"isabox"} title={datalist&&datalist.title}> {datalist&&datalist.title} </span>
{datalist&&datalist.attachment_histories.length===0?"":<span className={"newcolor-orange fl"}>当前版本</span>}
</li>
@ -358,7 +384,7 @@ class Selectsetting extends Component{
{datalist&&datalist.attachment_histories.map((item,key)=>{
return(
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
<li className="fl" style={{width: '350px'}}>
<li className="fl" style={{width: '343px'}}>
<span className={"isabox"} title={item.title}> {item.title} </span>
{/*<span className={"newcolor-orange fl"}>当前版本</span>*/}
</li>
@ -368,6 +394,7 @@ class Selectsetting extends Component{
<li className="fl paddingl10 datastyle">
{moment(item.created_on).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(item.created_on).format('YYYY-MM-DD HH:mm')}
</li>
<a className="fr" onClick={()=>this.delectfils(item.id)}><i className="iconfont icon-shanchu color-grey-c font-14 font-n"></i></a>
</div>
)
})}
@ -537,7 +564,7 @@ class Selectsetting extends Component{
</div>
<div className="mt20 marginauto clearfix edu-txt-center">
<a className="pop_close task-btn mr30 margin-tp26" onClick={this.hidecouseShixunModal}>取消</a>
<a className="pop_close task-btn mr30 margin-tp26" onClick={()=>this.props.Cancel()}>取消</a>
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.savecouseShixunModal}>确定</a>
</div>
</div>

@ -612,7 +612,7 @@ class ExerciseReviewAndAnswer extends Component{
let isStudent =this.props.isStudent();
const { current_user } = this.props
// console.log(data&&data.exercise.user_name)
document.title=courseName&&courseName.name;
document.title=courseName&&courseName;
return(
<div className="newMain" style={{paddingTop:"0px"}}>
<Spin size="large" spinning={isSpin}>

@ -652,6 +652,7 @@ class Exercisesetting extends Component{
<div className="clearfix" id={"publishtimeid"}>
<span className="font-16 mr15 fl mt6">发布时间</span>
<div className="fl">
<Tooltip placement="bottom" title={publish_timetype===true?this.props.isAdmin()? "发布时间已过,不能再修改":"":""}>
<DatePicker
dropdownClassName="hideDisable"
placeholder="请选择发布时间"
@ -666,6 +667,7 @@ class Exercisesetting extends Component{
value={publish_time && moment(publish_time,"YYYY-MM-DD HH:mm")}
disabled={ publish_timetype===true?true:!flagPageEdit }
></DatePicker>
</Tooltip>
<p className="color-red lineh-25 clearfix" style={{height:"25px"}}>
{
unit_p_tip !="" ? <span className="fl">{unit_p_tip}</span>:""

@ -19,7 +19,7 @@ class Exercisestatisticalresult extends Component {
super(props);
this.state = {
data:undefined,
sort:"percent",
sort:"asc",
exercise_group_id:[],
page:1,
limit:10,
@ -60,24 +60,28 @@ class Exercisestatisticalresult extends Component {
limit:limit
}
}).then((result) => {
// console.log(result)
this.setState({
data:result.data
})
}).catch((error) => {
console.log(error)
})
}
onSortTypeChange=(value)=>{
let{exercise_group_id,page,limit}=this.state;
onSortTypeChange=()=>{
let{exercise_group_id,page,limit,sort}=this.state;
let newdesc="asc";
if(sort==="desc"){
newdesc="asc"
}else{
newdesc="desc"
}
this.setState({
sort:value
sort:newdesc
})
this.updatefun(value,exercise_group_id,page,limit)
this.updatefun(newdesc,exercise_group_id,page,limit)
}
funtaskstatustwo=(checkedValues,list)=>{
@ -172,17 +176,29 @@ class Exercisestatisticalresult extends Component {
.mr33{
margin-right: 33px;
}
.fiilssort{
position: absolute;
top: -9px;
}
`}
</style>
<div className="stud-class-set fafafa">
<li className="drop_down fr mt10 mr33">
{sort==="percent"?"正确率":sort==="type"?"题型":sort==="position"?"题序":""}<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_normal">
{sort==='percent'?"":<li onClick={() => this.onSortTypeChange('percent')}>正确率</li>}
{sort==='type'?"":<li onClick={() => this.onSortTypeChange('type')}>题型</li>}
{sort==='position'?"":<li onClick={() => this.onSortTypeChange('position')}>题序</li>}
</ul>
<li className="drop_down fr mt10 mr33 cursor" onClick={() => this.onSortTypeChange()}>
{/*{sort==="percent"?"正确率":sort==="type"?"题型":sort==="position"?"题序":""}*/}
{/*<i className="iconfont icon-xiajiantou font-12 ml2"></i>*/}
{/*<ul className="drop_down_normal">*/}
{/*{sort==='percent'?"":<li onClick={() => this.onSortTypeChange('percent')}>正确率</li>}*/}
{/*{sort==='type'?"":<li onClick={() => this.onSortTypeChange('type')}>题型</li>}*/}
{/*{sort==='position'?"":<li onClick={() => this.onSortTypeChange('position')}>题序</li>}*/}
{/*</ul>*/}
正确率
<sapn className="relativef ml5"style={{"top":"3px"}} >
<i className={sort==="asc"?
"iconfont icon-sanjiaoxing-up font-12 color-blue fiilssort" :"iconfont icon-sanjiaoxing-up font-12 fiilssort"}></i>
<i className={sort==="desc"?
"iconfont icon-sanjiaoxing-down font-12 yslbottomsj color-blue":"iconfont icon-sanjiaoxing-down font-12 yslbottomsj"}></i>
</sapn>
</li>
</div>

@ -1076,7 +1076,7 @@ debugger
<div className={"mt10 ml30"} >
<span>截止时间</span>
<Tooltip placement="bottom" title={this.props.isSuperAdmin()===true?"":this.props.isAdmin()===true?endtimetype===true?"时间已过,不能再修改":"":""}>
<Tooltip placement="bottom" title={this.props.isAdmin()===true?endtimetype===true?"时间已过,不能再修改":"":""}>
<span>
<DatePicker
showToday={false}

@ -555,7 +555,7 @@ class PollDetailTabForth extends Component{
<div className="clearfix mb5">
<span className="font-16 mr15 fl mt6">发布时间</span>
<div className="fl">
<Tooltip placement="bottom" title={un_change_unified ?this.props.isAdmin()? "发布时间已过,不能再修改":"":""}>
<Tooltip placement="bottom" title={un_change_unified == true?this.props.isAdmin()? "发布时间已过,不能再修改":"":""}>
<span>
<DatePicker
showToday={false}

@ -57,19 +57,22 @@ class Homeworddescription extends Component {
}
//确认操作
onSaveExercise=()=>{
if(this.state.description === "" || this.state.description===undefined || this.state.description === null){
this.props.showNotification("请输入作业说明");
return
}
// if(this.state.description === "" || this.state.description===undefined || this.state.description === null){
// this.props.showNotification("请输入作业说明");
// return
// }
this.props.ReleaseNotes(this.state.description);
}
//获取输入框
settextarea=(e)=>{
console.log("settextarea");
console.log(e);
this.setState({
description:e
})
}
render() {
const {getFieldDecorator} = this.props.form;
return (
<div >
<div style={{
@ -82,21 +85,61 @@ class Homeworddescription extends Component {
.ant-form-item-label{width:80px;}
`}
</style>
<Form.Item
label=""
className="mdInForm"
>
{/*<TextArea placeholder="作业说明..." value={this.state.description} onInput={this.settextarea} style={{"height": "120px"}}/>*/}
{/*<TextArea style={{"height": "120px"}}*/}
{/* autoComplete="off" ></TextArea>*/}
<TPMMDEditor ref={this.mdRef} placeholder={'请输入作业说明'}
mdID={'courseMessageMD'} initValue={this.state.description} className="courseMessageMD" onChange={this.settextarea} style={{"height": "120px"}}></TPMMDEditor>
<Form layout='vertical' onSubmit={this.handleSubmit}>
<style>
{
`.ant-form-item{
margin-bottom:0px !important;
}
.chooseDestwo .ant-form-item{
margin-bottom:0px !important;
}
.chooseDestwo .ant-form-item-control-wrapper .ant-form-item-control .ant-form-explain{
padding-left: 25px !important;
position: absolute;
}
.ant-form-vertical .ant-form-item {
margin-bottom:0px !important;
}
`
}
</style>
<Form.Item
style={{"borderBottom": 'none'}}
className="chooseDestwo "
>
{getFieldDecorator('content', {
rules: [{
max: 5000, message: '最大限制为5000个字符',
}],
})(
<TPMMDEditor ref={this.mdRef} placeholder={'请在此输入作业内容和要求最大限制5000个字符'}
mdID={'courseMessageMD'} initValue={this.state.description}
className="courseMessageMD" onChange={this.settextarea}
style={{"height": "120px"}}></TPMMDEditor>
)}
</Form.Item>
<div className="clearfix mt10">
<Button type="primary" className="defalutSubmitbtn fr mr20 "style={{"width":"90px"}} onClick={this.onSaveExercise} >保存</Button>
<Button className="defalutCancelbtn fr mr20 w20" style={{"width":"90px"}} onClick={this.clickcancel} >取消</Button>
</div>
{/*<Form.Item>*/}
{/* <div className="clearfix mt28 fr pb50 mr25" >*/}
{/* <a className="defalutCancelbtn fl mr20 " onClick={()=>this.bianji(false)}>取消</a>*/}
{/* <Button htmlType="submit" className="ant-btn defalutSubmitbtn fl ant-btn-primary">*/}
{/* <span>提 交</span></Button>*/}
{/* </div>*/}
{/* <div className="clearfix mt10">*/}
{/* <Button type="primary" className="defalutSubmitbtn fr mr20 "style={{"width":"90px"}} onClick={this.onSaveExercise} >保存</Button>*/}
{/* <Button className="defalutCancelbtn fr mr20 w20" style={{"width":"90px"}} onClick={this.clickcancel} >取消</Button>*/}
{/* </div>*/}
{/*</Form.Item>*/}
</Form>
</div>
</div>

@ -359,10 +359,10 @@ class ShixunhomeWorkItem extends Component{
}
</style>
{this.props.isAdmin?<span onClick={(event)=>this.stopPro(event)} className={this.props.isAdminOrCreator()?"homepagePostSetting homepagePostSettingname":"homepagePostSetting homepagePostSettingbox"} style={{"right":"-2px","top":"6px","display":"block"}}>
<Link className="btn colorblue font-16" to={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</Link>
{this.props.isAdminOrCreator()?<a onClick={(event)=>this.editname(discussMessage.name,discussMessage.homework_id,event)} className={"btn colorblue ml20 font-16"}>重命名</a>:""}
<Link className="btn colorblue font-16 fontweight400" to={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</Link>
{this.props.isAdminOrCreator()?<a onClick={(event)=>this.editname(discussMessage.name,discussMessage.homework_id,event)} className={"btn colorblue ml20 font-16 fontweight400"}>重命名</a>:""}
{/*<WordsBtn className="btn colorblue ml20 font-16" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn>*/}
<WordsBtn className="btn colorblue font-16 ml15" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn>
<WordsBtn className="btn colorblue font-16 ml15 fontweight400" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn>
</span>:""}

@ -2190,7 +2190,7 @@ class Trainingjobsetting extends Component {
<div>
<div className="clearfix mb5 ml15">
<span className="font-16 fl mt3" style={{color:"#999999"}}>发布时间</span>
<Tooltip placement="bottom" title={this.props.isSuperAdmin() ? "" : !flagPageEditstwo === true && publish_timebool === true?this.props.isAdmin()?"发布时间已过,则不能修改":"": ""}>
<Tooltip placement="bottom" title={!flagPageEditstwo === true && publish_timebool === true?this.props.isAdmin()?"发布时间已过,则不能修改":"":""}>
<div className="fl yskspickers">
<DatePicker
showToday={false}

@ -503,8 +503,10 @@ class Workquestionandanswer extends Component {
</div>
:
<div className="pl20 markdown-body" style={{minHeight: "150px",padding: "20px"}}>
{jobsettingsdata === undefined ? <span style={{color:"#D3D3D3"}}>暂无~</span> : jobsettingsdata === null ? <span style={{color:"#D3D3D3"}}>~</span> : jobsettingsdata === "null" ? <span style={{color:"#D3D3D3"}}>~</span> :
jobsettingsdata.data.explanation === undefined ? <span style={{color:"#D3D3D3"}}>暂无~</span> : jobsettingsdata.data.explanation === null ? <span style={{color:"#D3D3D3"}}>~</span> :
{jobsettingsdata === undefined || jobsettingsdata === null || jobsettingsdata === "null" ?
<span style={{color: "#D3D3D3"}}>暂无~</span> :
jobsettingsdata.data.explanation === undefined || jobsettingsdata.data.explanation === null || jobsettingsdata.data.explanation === undefined || jobsettingsdata.data.explanation === "" ?
<span style={{color: "#D3D3D3"}}>暂无~</span> :
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(jobsettingsdata.data.explanation).replace(/▁/g, "▁▁▁")}}></div>
}

@ -111,7 +111,7 @@
}
.logincloseIcon{
position: absolute;
top: -100px;
top: -100px !important;
right: -27px;
z-index: 100000;
}

@ -35,6 +35,7 @@ render() {
<Spin indicator={antIcons} spinning={this.props.antIcon===undefined?false:this.props.antIcon} >
<div className="task-popup-content">
<p className="task-popup-text-center font-16">{this.props.modalsTopval}</p>
{this.props.modalsMidval===undefined?"":<p className="task-popup-text-center font-16 mt5">{this.props.modalsMidval}</p>}
<p className="task-popup-text-center font-16 mt5">{this.props.modalsBottomval}</p>
{this.props.loadtype===true?
<div className="clearfix edu-txt-center mt20">

@ -3762,3 +3762,6 @@ a.singlepublishtwo{
/*width: auto !important;*/
/*max-width: 600px !important;*/
/*}*/
.fontweight400{
font-weight: 400 !important;
}

Loading…
Cancel
Save