merge from aliyun

dev_forge
tangjiang 5 years ago
commit 5661c0d4b2

@ -20,6 +20,8 @@ gem 'bootsnap', '>= 1.1.0', require: false
gem 'gitlab', path: 'lib/gitlab-cli' gem 'gitlab', path: 'lib/gitlab-cli'
gem 'chinese_pinyin'
gem 'rack-cors' gem 'rack-cors'
gem 'redis-rails' gem 'redis-rails'
gem 'roo-xls' gem 'roo-xls'

@ -12,6 +12,11 @@ $(document).on('turbolinks:load', function() {
window.location.href = "/admins/shixun_settings.xls?" + searchForm.serialize(); window.location.href = "/admins/shixun_settings.xls?" + searchForm.serialize();
}); });
// 基础数据导出
searchContainer.on('click', "#shixun-settings-base-export", function () {
window.location.href = "/admins/shixun_settings.xls?base_data=1" + searchForm.serialize();
});
$(".shixun-settings-list-container").on("change", '.shixun-setting-form', function () { $(".shixun-settings-list-container").on("change", '.shixun-setting-form', function () {
var s_id = $(this).attr("data-id"); var s_id = $(this).attr("data-id");
var s_value = $(this).val(); var s_value = $(this).val();

@ -0,0 +1,2 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.

@ -53,3 +53,8 @@ input.form-control {
position: absolute; position: absolute;
} }
.export-base-absolute{
right:100px;
position: absolute;
}

@ -0,0 +1,3 @@
// Place all the styles related to the comments controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

@ -28,7 +28,13 @@ class Admins::ShixunSettingsController < Admins::BaseController
format.html format.html
format.xls{ format.xls{
filename = "实训详情_#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}.xls" filename = "实训详情_#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}.xls"
send_data(shixun_list_xls(shixun_settings), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) export_url =
if params[:base_data].present?
shixun_base_list_xls(shixun_settings)
else
shixun_list_xls(shixun_settings)
end
send_data(export_url, :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
} }
end end
@ -65,19 +71,20 @@ class Admins::ShixunSettingsController < Admins::BaseController
sheet1.row(0).default_format = blue sheet1.row(0).default_format = blue
sheet1.row(0).concat(["实训ID","实训名称","技术平台", "Fork源", "实践任务","选择题任务","挑战人数", "通关人数", "状态","创建者", "单位", "职业", "关卡序号","关卡名称","技能标签"]) sheet1.row(0).concat(["实训ID","实训名称","技术平台", "Fork源", "实践任务","选择题任务","挑战人数", "通关人数", "状态","创建者", "单位", "职业", "关卡序号","关卡名称","技能标签"])
count_row = 1 count_row = 1
shixuns.find_each do |shixun| shixuns.includes(:fork_shixuns, :myshixuns, :mirror_repositories, challenges: [:challenge_tags], user: [user_extension: :school]).find_each do |shixun|
sheet1[count_row, 0] = shixun.identifier sheet1[count_row, 0] = shixun.identifier
sheet1[count_row, 1] = shixun.name sheet1[count_row, 1] = shixun.name
sheet1[count_row, 2] = shixun.shixun_main_name sheet1[count_row, 2] = shixun.mirror_repositories.select{|mr| mr.main_type == "1"}.first&.type_name
sheet1[count_row, 3] = shixun.fork_identifier sheet1[count_row, 3] = shixun.fork_identifier
sheet1[count_row, 4] = shixun.challenges.practice_type.count sheet1[count_row, 4] = shixun.challenges.select{|c| c.st == 0}.size
sheet1[count_row, 5] = shixun.challenges.choose_type.count sheet1[count_row, 5] = shixun.challenges.select{|c| c.st == 1}.size
sheet1[count_row, 6] = shixun.myshixuns.count sheet1[count_row, 6] = shixun.myshixuns_count
sheet1[count_row, 7] = shixun.myshixuns.finished.count sheet1[count_row, 7] = shixun.myshixuns.select{|m| m.status == 1}.size
sheet1[count_row, 8] = shixun.shixun_status sheet1[count_row, 8] = shixun.shixun_status
sheet1[count_row, 9] = shixun.owner.show_real_name sheet1[count_row, 9] = shixun.user.show_real_name
sheet1[count_row, 10] = shixun.owner.school_name sheet1[count_row, 10] = shixun.user.school_name
sheet1[count_row, 11] = shixun.owner.identity sheet1[count_row, 11] = shixun.user.identity
shixun.challenges.each do |challenge| shixun.challenges.each do |challenge|
sheet1[count_row, 12] = "#{challenge.position}" sheet1[count_row, 12] = "#{challenge.position}"
sheet1[count_row, 13] = challenge.subject sheet1[count_row, 13] = challenge.subject
@ -90,6 +97,34 @@ class Admins::ShixunSettingsController < Admins::BaseController
xls_report.string xls_report.string
end end
def shixun_base_list_xls shixuns
xls_report = StringIO.new
book = Spreadsheet::Workbook.new
sheet1 = book.create_worksheet :name => "sheet"
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
sheet1.row(0).default_format = blue
sheet1.row(0).concat(["实训ID","实训名称","技术平台", "Fork源", "状态","创建者", "单位", "职业", "关卡序号","关卡名称"])
count_row = 1
shixuns.includes(:mirror_repositories, :challenges, user: [user_extension: :school]).find_each do |shixun|
sheet1[count_row, 0] = shixun.identifier
sheet1[count_row, 1] = shixun.name
sheet1[count_row, 2] = shixun.mirror_repositories.select{|mr| mr.main_type == "1"}.first&.type_name
sheet1[count_row, 3] = shixun.fork_from
sheet1[count_row, 4] = shixun.shixun_status
sheet1[count_row, 5] = shixun.user.show_real_name
sheet1[count_row, 6] = shixun.user.school_name
sheet1[count_row, 7] = shixun.user.identity
shixun.challenges.each do |challenge|
sheet1[count_row, 8] = "#{challenge.position}"
sheet1[count_row, 9] = challenge.subject
count_row += 1
end
count_row += 1
end
book.write xls_report
xls_report.string
end
def setting_params def setting_params
params.permit(:use_scope,:excute_time,:close,:status,:can_copy,:webssh,:hidden,:homepage_show,:task_pass,:code_hidden,:page_no, :id,tag_repertoires:[]) params.permit(:use_scope,:excute_time,:close,:status,:can_copy,:webssh,:hidden,:homepage_show,:task_pass,:code_hidden,:page_no, :id,tag_repertoires:[])
end end

@ -45,6 +45,13 @@ class ApplicationController < ActionController::Base
check_account check_account
tip_exception(@course.excellent ? 410 : 409, "您没有权限进入") tip_exception(@course.excellent ? 410 : 409, "您没有权限进入")
end end
if @user_course_identity > Course::CREATOR && @user_course_identity <= Course::STUDENT
# 实名认证和职业认证的身份判断
tip_exception(411, "你的实名认证和职业认证审核未通过") if @course.authentication &&
@course.professional_certification && (!current_user.authentication && !current_user.professional_certification)
tip_exception(411, "你的实名认证审核未通过") if @course.authentication && !current_user.authentication
tip_exception(411, "你的职业认证审核未通过") if @course.professional_certification && !current_user.professional_certification
end
uid_logger("###############user_course_identity:#{@user_course_identity}") uid_logger("###############user_course_identity:#{@user_course_identity}")
end end

@ -0,0 +1,59 @@
class CommentsController < ApplicationController
before_action :find_hack
before_action :require_login
# 评论
def create
begin
@discuss = @hack.discusses.new(comment_params) # 管理员回复的能够显示
@discuss.hidden = false
@discuss.user_id = current_user.id
@discuss.save!
rescue Exception => e
uid_logger_error("create discuss failed : #{e.message}")
render_error("评论异常")
end
end
# 回复
def reply
begin
@discuss = @hack.discusses.new(reply_params)
@discuss.hidden = false
@discuss.user_id = current_user.id
@discuss.root_id = params[:parent_id]
@discuss.save!
rescue Exception => e
uid_logger_error("reply discuss failed : #{e.message}")
render_error("回复评论异常")
end
end
# 列表
def index
disscusses = @hack.disscusses.where(:root_id => nil)
@disscuss_count = disscusses.count
@disscusses= paginate disscusses
end
# 删除
def destroy
@hack.discusses.find_by(id: params[:id]).destroy
render_ok
end
private
def find_hack
@hack = Hack.find_by_identifier params[:identifier]
end
def comment_params
params.require(:comments).permit(:content)
end
def reply_params
params.require(:comments).permit(:content, :parent_id)
end
end

@ -62,6 +62,17 @@ module LoginHelper
end end
def start_user_session(user) def start_user_session(user)
# re_subdomain = "#{request.subdomain.split('.').first}_user_id"
# session[:"#{request.subdomain}_user_id"] = user.id
# Rails.logger.info("domain_user_id session is: 3333332222111#{session[:"#{request.subdomain}_user_id"]}")
# Rails.logger.info("user_id session is: 3333332222111#{session[:"#{request.subdomain}_user_id"]}")
#
# # if current_laboratory.main_site?
# # session[:user_id] = user.id
# # else
# # session[:"#{request.subdomain}_user_id"] = user.id
# # end
session[:user_id] = user.id session[:user_id] = user.id
session[:ctime] = Time.now.utc.to_i session[:ctime] = Time.now.utc.to_i
session[:atime] = Time.now.utc.to_i session[:atime] = Time.now.utc.to_i

@ -635,7 +635,7 @@ class CoursesController < ApplicationController
teacher_member = CourseMember.create!(course_id: @course.id, user_id: params[:user_id], role: params[:roles].include?("PROFESSOR") ? 2 : 3) teacher_member = CourseMember.create!(course_id: @course.id, user_id: params[:user_id], role: params[:roles].include?("PROFESSOR") ? 2 : 3)
# 如果有未审批的申请教师/助教的记录,则修改状态为已审批 # 如果有未审批的申请教师/助教的记录,则修改状态为已审批
apply_teacher = CourseMessage.where(course_id: @course.id, course_message_id: params[:user_id], status: 0).last apply_teacher = CourseMessage.where(course_id: @course.id, course_message_id: params[:user_id], status: 0).last
apply_teacher.update!(status: 1, apply_user_id: current_user.id) apply_teacher.update!(status: 1, apply_user_id: current_user.id) if apply_teacher.present?
elsif course_members.exists?(role: %i[PROFESSOR ASSISTANT_PROFESSOR]) elsif course_members.exists?(role: %i[PROFESSOR ASSISTANT_PROFESSOR])
teacher_member = course_members.where(role: %i[PROFESSOR ASSISTANT_PROFESSOR]).take teacher_member = course_members.where(role: %i[PROFESSOR ASSISTANT_PROFESSOR]).take
if params[:roles].include?("PROFESSOR") || params[:roles].include?("ASSISTANT_PROFESSOR") if params[:roles].include?("PROFESSOR") || params[:roles].include?("ASSISTANT_PROFESSOR")

@ -610,7 +610,7 @@ class ExercisesController < ApplicationController
# 对未提交的用户进行调分 # 对未提交的用户进行调分
def adjust_score def adjust_score
exercise_user = @exercise.exercise_users.find_by!(user_id: params[:user_id]) exercise_user = @exercise.exercise_users.find_by!(user_id: params[:user_id])
tip_exception("已提交的作品请去评阅页进行调分") if exercise_user.commit_status == 1 tip_exception("已提交的作品请去评阅页进行调分") if exercise_user.commit_status == 1 && exercise_user.commit_method != 5
if @exercise.subjective_score > 0 if @exercise.subjective_score > 0
tip_exception("主观题成绩不能为空") if params[:subjective_score].blank? tip_exception("主观题成绩不能为空") if params[:subjective_score].blank?
tip_exception("主观题成绩不能小于零") if params[:subjective_score].to_f < 0 tip_exception("主观题成绩不能小于零") if params[:subjective_score].to_f < 0
@ -628,8 +628,13 @@ class ExercisesController < ApplicationController
subjective_score = @exercise.subjective_score > 0 ? params[:subjective_score].to_f.round(2) : 0 subjective_score = @exercise.subjective_score > 0 ? params[:subjective_score].to_f.round(2) : 0
objective_score = @exercise.objective_score > 0 ? params[:objective_score].to_f.round(2) : 0 objective_score = @exercise.objective_score > 0 ? params[:objective_score].to_f.round(2) : 0
score = subjective_score + objective_score score = subjective_score + objective_score
exercise_user.update_attributes!(start_at: start_at_time, end_at: Time.now, status: 1, commit_status: 1, score: score, if exercise_user.commit_status == 1
subjective_score: subjective_score, objective_score: objective_score, commit_method: 5) exercise_user.update_attributes!(score: score, subjective_score: subjective_score, objective_score: objective_score)
else
exercise_user.update_attributes!(start_at: start_at_time, end_at: Time.now, status: 1, commit_status: 1, score: score,
subjective_score: subjective_score, objective_score: objective_score, commit_method: 5)
end
ExerciseUserScore.create!(exercise_id: @exercise.id, exercise_user_id: exercise_user.id, ExerciseUserScore.create!(exercise_id: @exercise.id, exercise_user_id: exercise_user.id,
subjective_score: subjective_score, objective_score: objective_score) subjective_score: subjective_score, objective_score: objective_score)
normal_status("操作成功") normal_status("操作成功")
@ -1760,19 +1765,12 @@ class ExercisesController < ApplicationController
else else
ques_number = q.question_number ques_number = q.question_number
end end
ques_status = 0
if q.question_type != Exercise::PRACTICAL if q.question_type != Exercise::PRACTICAL
ques_vote = q.exercise_answers.select{|answer| answer.user_id == user_id} ques_vote = q.exercise_answers.select{|answer| answer.user_id == user_id}
else
ques_vote = q.exercise_shixun_answers.select{|answer| answer.user_id == user_id} if ques_vote.present?
end #其他题目,需回答的有内容,才会为已答,否则如内容为空,视为未答
ques_status = 0
if ques_vote.present?
if q.question_type == Exercise::PRACTICAL
if ques_vote.pluck(:exercise_shixun_challenge_id).sort == q.exercise_shixun_challenges.pluck(:id).sort #用户的总得分等于问题的分数
ques_status = 1 #全部回答了,才算已答
question_answered += 1
end
else #其他题目,需回答的有内容,才会为已答,否则如内容为空,视为未答
vote_answer_id = ques_vote.pluck(:exercise_choice_id).reject(&:blank?) vote_answer_id = ques_vote.pluck(:exercise_choice_id).reject(&:blank?)
vote_text_count = ques_vote.pluck(:answer_text).reject(&:blank?).size vote_text_count = ques_vote.pluck(:answer_text).reject(&:blank?).size
if q.question_type <= Exercise::JUDGMENT #选择题和判断题的时候,需要有选项,才算回答 if q.question_type <= Exercise::JUDGMENT #选择题和判断题的时候,需要有选项,才算回答
@ -1780,11 +1778,6 @@ class ExercisesController < ApplicationController
ques_status = 1 ques_status = 1
question_answered += 1 question_answered += 1
end end
elsif q.question_type == Exercise::COMPLETION #填空题的时候,需要有选项和内容,才算回答
if vote_answer_id.uniq.sort == q.exercise_standard_answers.pluck(:exercise_choice_id).uniq.sort
ques_status = 1
question_answered += 1
end
else else
if vote_text_count > 0 #主观题,必选有内容,才算回答 if vote_text_count > 0 #主观题,必选有内容,才算回答
ques_status = 1 ques_status = 1
@ -1792,6 +1785,11 @@ class ExercisesController < ApplicationController
end end
end end
end end
else
if Myshixun.exists?(user_id: user_id, shixun_id: q.shixun_id)
ques_status = 1
question_answered += 1
end
end end
question_status = { question_status = {
:ques_id => q.id, :ques_id => q.id,

@ -49,6 +49,12 @@ class GitsController < ApplicationController
repo_name = username + "/" + shixunname repo_name = username + "/" + shixunname
uid_logger("git start: repo_name is #{repo_name}") uid_logger("git start: repo_name is #{repo_name}")
shixun = Shixun.select([:id, :user_id, :repo_name, :identifier]).where(repo_name: repo_name).first shixun = Shixun.select([:id, :user_id, :repo_name, :identifier]).where(repo_name: repo_name).first
if shixun.blank?
shixun_id = ShixunSecretRepository.where(repo_name: repo_name).pluck(:shixun_id).first
logger.info("####repo_name:#{repo_name}")
logger.info("####shixun_id:#{shixun_id}")
shixun = Shixun.select([:id, :user_id, :repo_name, :identifier]).find_by(id: shixun_id)
end
uid_logger("git start auth: shixun identifier is #{shixun.try(:identifier)}") uid_logger("git start auth: shixun identifier is #{shixun.try(:identifier)}")
uid_logger("git start auth: systemuser is #{system_user.try(:login)}") uid_logger("git start auth: systemuser is #{system_user.try(:login)}")
@ -63,7 +69,7 @@ class GitsController < ApplicationController
else else
uid_logger_error("shixun is not exist") uid_logger_error("shixun is not exist")
# result = false # result = false
result = false # 为了测试跳出 result = true # 为了测试跳出
end end
end end
end end

@ -1,12 +1,13 @@
class HackUserLastestCodesController < ApplicationController class HackUserLastestCodesController < ApplicationController
before_action :require_login, except: [:listen_result] before_action :require_login, except: [:listen_result]
before_action :find_my_hack, only: [:show, :code_debug, :code_submit, :update_code, :listen_result, :result] before_action :find_my_hack, only: [:show, :code_debug, :code_submit, :update_code,
:listen_result, :result, :submit_records]
before_action :update_user_hack_status, only: [:code_debug, :code_submit] before_action :update_user_hack_status, only: [:code_debug, :code_submit]
before_action :require_auth_identity, only: [:update_code] before_action :require_auth_identity, only: [:update_code]
before_action :require_manager_identity, only: [:update_code] before_action :require_manager_identity, only: [:update_code]
def show def show
@my_hack.update_attribute(:status, 0) if @my_hack.status == 1 @my_hack.update_attribute(:submit_status, 0) if @my_hack.submit_status == 1
end end
def update_code def update_code
@ -33,8 +34,26 @@ class HackUserLastestCodesController < ApplicationController
# 提交结果显示 # 提交结果显示
def result def result
return if @my_hack.status == 1 if @my_hack.submit_status == 1
render json: {status:0, message: "正在评测中"}
else
@mode = params[:mode]
@result =
if @mode == "submit"
@my_hack.hack_user_codes.last
elsif @mode == "debug"
@my_hack.hack_user_debug
end
end
end
# 提交记录
def submit_records;end
# 提交记录详情
def record_detail
@hack_user = HackUserCode.find params[:id]
end end
# 接收中间件返回结果接口 # 接收中间件返回结果接口
@ -60,7 +79,7 @@ class HackUserLastestCodesController < ApplicationController
if ojEvaResult['execMode'] == "debug" if ojEvaResult['execMode'] == "debug"
save_debug_data ds_params save_debug_data ds_params
elsif ojEvaResult['execMode'] == "submit" elsif ojEvaResult['execMode'] == "submit"
save_submit_data ds_params save_submit_data ds_params.merge(expected_output: testCase['expectedOutput'])
end end
# 评测完成后,还原评测中的状态 # 评测完成后,还原评测中的状态
@my_hack.update_attribute(:submit_status, 0) @my_hack.update_attribute(:submit_status, 0)
@ -84,7 +103,7 @@ class HackUserLastestCodesController < ApplicationController
if exec_mode == "submit" if exec_mode == "submit"
@hack.hack_sets.map{|set| {input: set.input, output: set.output, caseId: set.id}} @hack.hack_sets.map{|set| {input: set.input, output: set.output, caseId: set.id}}
else else
{input: params[:input]} [{input: params[:input]}]
end end
testCases = Base64.urlsafe_encode64(test_sets.to_json) testCases = Base64.urlsafe_encode64(test_sets.to_json)
#codeFileContent = Base64.urlsafe_encode64(@my_hack.code) #codeFileContent = Base64.urlsafe_encode64(@my_hack.code)
@ -117,7 +136,9 @@ class HackUserLastestCodesController < ApplicationController
if @my_hack.hack_user_debug.present? if @my_hack.hack_user_debug.present?
@my_hack.hack_user_debug.update_attributes!(debug_params) @my_hack.hack_user_debug.update_attributes!(debug_params)
else else
@my_hack.hack_user_debug.create!(debug_params) debug = HackUserDebug.new(debug_params)
debug.hack_user_lastest_code_id = @my_hack.id
debug.save!
end end
end end
@ -132,7 +153,7 @@ class HackUserLastestCodesController < ApplicationController
RewardExperienceService.call(@my_hack.user, reward_attrs) RewardExperienceService.call(@my_hack.user, reward_attrs)
# 评测完成更新通过数 # 评测完成更新通过数
@hack.increment!(:pass_num) @hack.increment!(:pass_num)
@my_hack.update_attribute(:passed, true) @my_hack.update_attributes(passed: true, passed_time: Time.now)
end end
end end
# 创建用户评测记录 # 创建用户评测记录

@ -1,8 +1,8 @@
class HacksController < ApplicationController class HacksController < ApplicationController
before_action :require_login, except: [:index] before_action :require_login, except: [:index]
before_action :require_teacher_identity, only: [:create, :edit, :update] before_action :require_teacher_identity, only: [:create, :update_set]
before_action :require_auth_identity, only: [:update, :edit, :publish] before_action :require_auth_identity, only: [:update, :edit, :publish, :update_set, :delete_set]
before_action :find_hack, only: [:edit, :update, :publish, :start] before_action :find_hack, only: [:edit, :update, :publish, :start, :update_set, :delete_set]
# 开启编程,如果第一次开启,创建一条记录,如果已经开启过的话,直接返回标识即可 # 开启编程,如果第一次开启,创建一条记录,如果已经开启过的话,直接返回标识即可
def start def start
@ -27,7 +27,7 @@ class HacksController < ApplicationController
# 筛选过滤与排序 # 筛选过滤与排序
params_filter_or_order params_filter_or_order
# 我解决的编程题数 # 我解决的编程题数
user_codes = HackUserLastestCode.mine(current_user).passed.joins(:hack) user_codes = HackUserLastestCode.joins(:hack).mine_hack(current_user).passed
@simple_count = user_codes.where(hacks: {difficult: 1}).count @simple_count = user_codes.where(hacks: {difficult: 1}).count
@medium_count = user_codes.where(hacks: {difficult: 2}).count @medium_count = user_codes.where(hacks: {difficult: 2}).count
@diff_count = user_codes.where(hacks: {difficult: 3}).count @diff_count = user_codes.where(hacks: {difficult: 3}).count
@ -75,6 +75,20 @@ class HacksController < ApplicationController
end end
end end
# 更新测试集接口
def update_set
set = @hack.hack_sets.find_by(id: params[:id])
set.update_attributes!(hack_set_params)
render_ok
end
# 单独删除测试集
def delete_set
set = @hack.hack_sets.find_by(id: params[:id])
set.destroy!
render_ok
end
# 发布功能 # 发布功能
def publish def publish
@hack.update_attribute(:status, 1) @hack.update_attribute(:status, 1)
@ -119,6 +133,10 @@ class HacksController < ApplicationController
params.permit(hack_sets: [:input, :output, :position])[:hack_sets] params.permit(hack_sets: [:input, :output, :position])[:hack_sets]
end end
def hack_set_params
params.require(:hack_set).permit(:id, :input, :output, :position)
end
def hack_code_params def hack_code_params
params.require(:hack_codes).permit(:code, :language) params.require(:hack_codes).permit(:code, :language)
end end
@ -144,7 +162,8 @@ class HacksController < ApplicationController
if params[:come_from] if params[:come_from]
hacks = Hack.select(select_sql).mine(current_user.id) hacks = Hack.select(select_sql).mine(current_user.id)
else else
hacks = Hack.select(select_sql).published.opening # 全部包括已经发布的,和我的未发布的
hacks = Hack.select(select_sql).published.opening.or(Hack.select(select_sql).unpublish.mine(current_user.id))
end end
# 搜索 # 搜索
if params[:search] if params[:search]
@ -162,9 +181,14 @@ class HacksController < ApplicationController
hacks = hacks.where.not(id: user_hacks.pluck(:hack_id)) hacks = hacks.where.not(id: user_hacks.pluck(:hack_id))
end end
else else
hacks = hacks.joins(:hack_user_lastest_code).where(hack_user_lastest_code: {status: params[:status]}) hacks = hacks.joins(:hack_user_lastest_codes).where(hack_user_lastest_codes: {status: params[:status]})
end end
end end
# 分类
if params[:category]
hacks = hacks.where(category: params[:category])
end
# 排序 # 排序
sort_by = params[:sort_by] || "hack_user_lastest_codes_count" sort_by = params[:sort_by] || "hack_user_lastest_codes_count"
sort_direction = params[:sort_direction] || "desc" sort_direction = params[:sort_direction] || "desc"

@ -64,21 +64,25 @@ class HomeworkCommonsController < ApplicationController
end end
unless order.blank? unless order.blank?
case order if @course.is_end
when '1' @homework_commons = @homework_commons.none
sql_str = %Q(homework_detail_manuals.comment_status = #{order} and homework_commons.end_time > '#{Time.now}')
when '2'
sql_str = %Q(allow_late = 1 and homework_commons.end_time < '#{Time.now}' and (late_time is null or late_time > '#{Time.now}'))
when '3'
sql_str = %Q(homework_detail_manuals.comment_status = #{order} and homework_detail_manuals.evaluation_end > '#{Time.now}')
when '4'
sql_str = %Q((homework_detail_manuals.comment_status = #{order} and homework_detail_manuals.appeal_time > '#{Time.now}'))
when '5'
sql_str = %Q((homework_detail_manuals.comment_status = #{order} or (anonymous_comment = 0 and homework_commons.end_time <= '#{Time.now}')))
else else
sql_str = %Q(homework_detail_manuals.comment_status = #{order}) case order
when '1'
sql_str = %Q(homework_detail_manuals.comment_status = #{order} and homework_commons.end_time > '#{Time.now}')
when '2'
sql_str = %Q(allow_late = 1 and homework_commons.end_time < '#{Time.now}' and (late_time is null or late_time > '#{Time.now}'))
when '3'
sql_str = %Q(homework_detail_manuals.comment_status = #{order} and homework_detail_manuals.evaluation_end > '#{Time.now}')
when '4'
sql_str = %Q((homework_detail_manuals.comment_status = #{order} and homework_detail_manuals.appeal_time > '#{Time.now}'))
when '5'
sql_str = %Q((homework_detail_manuals.comment_status = #{order} or (anonymous_comment = 0 and homework_commons.end_time <= '#{Time.now}')))
else
sql_str = %Q(homework_detail_manuals.comment_status = #{order})
end
@homework_commons = @homework_commons.joins(:homework_detail_manual).where(sql_str)
end end
@homework_commons = @homework_commons.joins(:homework_detail_manual).where(sql_str)
end end
@task_count = @homework_commons.size @task_count = @homework_commons.size
@ -577,8 +581,8 @@ class HomeworkCommonsController < ApplicationController
tip_exception("缺少answer_open_evaluation参数") if params[:answer_open_evaluation].nil? tip_exception("缺少answer_open_evaluation参数") if params[:answer_open_evaluation].nil?
tip_exception("缺少work_efficiency参数") if params[:work_efficiency].nil? tip_exception("缺少work_efficiency参数") if params[:work_efficiency].nil?
tip_exception("缺少eff_score参数") if params[:work_efficiency] && params[:eff_score].blank? tip_exception("缺少eff_score参数") if params[:work_efficiency] && params[:eff_score].blank?
tip_exception("效率分不能小于等于0") if params[:eff_score] && params[:eff_score].to_i <= 0 tip_exception("效率分不能小于等于0") if params[:eff_score] && params[:eff_score].to_f <= 0
tip_exception("效率分不能大于总分值") if params[:eff_score] && params[:eff_score].to_i > params[:total_score].to_i tip_exception("效率分不能大于总分值") if params[:eff_score] && params[:eff_score].to_f.round(2) > params[:total_score].to_f.round(2)
tip_exception("缺少shixun_evaluation参数") if params[:shixun_evaluation].blank? tip_exception("缺少shixun_evaluation参数") if params[:shixun_evaluation].blank?
tip_exception("缺少challenge_settings参数") if params[:challenge_settings].blank? tip_exception("缺少challenge_settings参数") if params[:challenge_settings].blank?
# tip_exception("缺少challenge_id参数") if params[:challenge_settings][:challenge_id].blank? # tip_exception("缺少challenge_id参数") if params[:challenge_settings][:challenge_id].blank?
@ -586,12 +590,12 @@ class HomeworkCommonsController < ApplicationController
# tip_exception("challenge_id参数的长度与challenge_score参数的长度不匹配") if # tip_exception("challenge_id参数的长度与challenge_score参数的长度不匹配") if
# params[:challenge_settings][:challenge_score].length != params[:challenge_settings][:challenge_id].length # params[:challenge_settings][:challenge_score].length != params[:challenge_settings][:challenge_id].length
current_eff_score = @homework.eff_score current_eff_score = @homework.eff_score.to_f.round(2)
@homework.total_score = params[:total_score] @homework.total_score = params[:total_score]
@homework.work_efficiency = params[:work_efficiency] @homework.work_efficiency = params[:work_efficiency]
@homework.eff_score = params[:work_efficiency] ? params[:eff_score].to_i : 0 @homework.eff_score = params[:work_efficiency] ? params[:eff_score].to_f.round(2) : 0
update_eff_score = current_eff_score != @homework.eff_score update_eff_score = current_eff_score.round(2) != @homework.eff_score.round(2)
if @homework_detail_manual.answer_open_evaluation != params[:answer_open_evaluation] if @homework_detail_manual.answer_open_evaluation != params[:answer_open_evaluation]
@homework_detail_manual.answer_open_evaluation = params[:answer_open_evaluation] @homework_detail_manual.answer_open_evaluation = params[:answer_open_evaluation]
@ -625,14 +629,10 @@ class HomeworkCommonsController < ApplicationController
@homework.score_open = params[:score_open] @homework.score_open = params[:score_open]
@homework.save! @homework.save!
# if score_change if score_change && @homework.end_or_late_none_group
# @homework.student_works.has_committed.each do |student_work| UpdateShixunWorkScoreJob.perform_now(@homework.id)
# HomeworksService.new.set_shixun_final_score student_work elsif update_eff_score && (@homework.end_or_late_none_group || @homework.max_efficiency > 0)
# end # 更新所有学生的效率分(作业允许补交且补交已截止 或者 作业不允许补交且提交已截止 或者作业已计算过效率分)
# end
# 更新所有学生的效率分(作业允许补交且补交已截止 或者 作业不允许补交且提交已截止)
if update_eff_score && @homework.end_or_late_none_group
HomeworksService.new.update_student_eff_score HomeworkCommon.find_by(id: @homework.id) HomeworksService.new.update_student_eff_score HomeworkCommon.find_by(id: @homework.id)
end end

@ -235,9 +235,9 @@ class PollQuestionsController < ApplicationController
end end
def validates_params def validates_params
normal_status(-1, "问题标题不能为空!") if params[:question_title].blank? normal_status(-1, "题目不能为空!") if params[:question_title].blank?
normal_status(-1, "是否要求必答的值不能为空!") if params[:is_necessary].blank? normal_status(-1, "是否要求必答的值不能为空!") if params[:is_necessary].blank?
normal_status(-1, "题类型不能为空!") if params[:question_type].blank? normal_status(-1, "类型不能为空!") if params[:question_type].blank?
if params[:min_choices].present? && params[:max_choices].present? && (params[:min_choices].to_i > params[:max_choices].to_i) if params[:min_choices].present? && params[:max_choices].present? && (params[:min_choices].to_i > params[:max_choices].to_i)
normal_status(-1, "最小可选不能大于最大可选!") normal_status(-1, "最小可选不能大于最大可选!")
elsif params[:question_answers].present? && (params[:max_choices].to_i > params[:question_answers].count) elsif params[:question_answers].present? && (params[:max_choices].to_i > params[:question_answers].count)
@ -247,9 +247,9 @@ class PollQuestionsController < ApplicationController
elsif params[:question_type] == 3 && (params[:question_answers] || params[:question_other_answer]) elsif params[:question_type] == 3 && (params[:question_answers] || params[:question_other_answer])
normal_status(-1, "主观问题不需要可选答案!") normal_status(-1, "主观问题不需要可选答案!")
elsif params[:question_type] != 3 elsif params[:question_type] != 3
if params[:question_answers].present? && params[:question_answers].include?("") if params[:question_answers].present? && params[:question_answers].select{|answer| answer.blank?}.count > 0
normal_status(-1, "择题不能有空值!") normal_status(-1, "不能有空值!")
elsif params[:question_other_answer].present? && params[:question_other_answer].length > 0 elsif params[:question_other_answer].present? && !params[:question_other_answer].blank?
normal_status(-1, "其他选项不能有值!") normal_status(-1, "其他选项不能有值!")
elsif params[:question_type] == 1 && params[:question_answers].count < 2 elsif params[:question_type] == 1 && params[:question_answers].count < 2
normal_status(-1, "单选题选项不能小于2") normal_status(-1, "单选题选项不能小于2")

@ -1,6 +1,6 @@
class Weapps::CoursesController < Weapps::BaseController class Weapps::CoursesController < Weapps::BaseController
before_action :require_login before_action :require_login
before_action :user_course_identity, except: [:create] before_action :set_course, :user_course_identity, except: [:create]
before_action :teacher_allowed, only: [:edit, :update] before_action :teacher_allowed, only: [:edit, :update]
before_action :teacher_or_admin_allowed, only: [:change_member_roles, :delete_course_teachers] before_action :teacher_or_admin_allowed, only: [:change_member_roles, :delete_course_teachers]
@ -46,7 +46,7 @@ class Weapps::CoursesController < Weapps::BaseController
@applications_size = CourseMessage.unhandled_join_course_requests_by_course(@course).size @applications_size = CourseMessage.unhandled_join_course_requests_by_course(@course).size
@teacher_list = @teacher_list.preload(user: [user_extension: :school]).order("CONVERT(CONCAT(users.lastname, users.firstname) USING gbk) COLLATE gbk_chinese_ci asc") @teacher_list = @teacher_list.preload(user: [user_extension: :school])
end end
# 批量删除教师或助教 # 批量删除教师或助教
@ -82,6 +82,7 @@ class Weapps::CoursesController < Weapps::BaseController
# 批量修改角色 # 批量修改角色
def change_member_roles def change_member_roles
@course = current_course
tip_exception("请至少选择一个角色") if params[:roles].blank? tip_exception("请至少选择一个角色") if params[:roles].blank?
tip_exception("不能具有老师、助教两种角色") if params[:roles].include?("PROFESSOR") && params[:roles].include?("ASSISTANT_PROFESSOR") tip_exception("不能具有老师、助教两种角色") if params[:roles].include?("PROFESSOR") && params[:roles].include?("ASSISTANT_PROFESSOR")
@ -97,7 +98,7 @@ class Weapps::CoursesController < Weapps::BaseController
teacher_member = CourseMember.create!(course_id: @course.id, user_id: user_id, role: params[:roles].include?("PROFESSOR") ? 2 : 3) teacher_member = CourseMember.create!(course_id: @course.id, user_id: user_id, role: params[:roles].include?("PROFESSOR") ? 2 : 3)
# 如果有未审批的申请教师/助教的记录,则修改状态为已审批 # 如果有未审批的申请教师/助教的记录,则修改状态为已审批
apply_teacher = CourseMessage.where(course_id: @course.id, course_message_id: user_id, status: 0).last apply_teacher = CourseMessage.where(course_id: @course.id, course_message_id: user_id, status: 0).last
apply_teacher.update!(status: 1, apply_user_id: current_user.id) apply_teacher.update!(status: 1, apply_user_id: current_user.id) if apply_teacher
elsif course_members.exists?(role: %i[PROFESSOR ASSISTANT_PROFESSOR]) elsif course_members.exists?(role: %i[PROFESSOR ASSISTANT_PROFESSOR])
teacher_member = course_members.where(role: %i[PROFESSOR ASSISTANT_PROFESSOR]).take teacher_member = course_members.where(role: %i[PROFESSOR ASSISTANT_PROFESSOR]).take
if params[:roles].include?("PROFESSOR") || params[:roles].include?("ASSISTANT_PROFESSOR") if params[:roles].include?("PROFESSOR") || params[:roles].include?("ASSISTANT_PROFESSOR")
@ -166,4 +167,9 @@ class Weapps::CoursesController < Weapps::BaseController
tip_exception(403, "..") tip_exception(403, "..")
end end
end end
def set_course
@course = Course.find_by!(id: params[:id])
tip_exception(404, "") if @course.is_delete == 1 && !current_user.admin?
end
end end

@ -0,0 +1,2 @@
module CommentsHelper
end

@ -0,0 +1,67 @@
module Weapps::CoursesHelper
require 'chinese_pinyin'
def teacher_list teachers
data = []
teachers.each do |teacher|
if teacher.user.present?
teacher_user = teacher.user
name = teacher_user.real_name
role = teacher.role == "CREATOR" ? "管理员" : teacher.role == "PROFESSOR" ? "教师" : "助教"
item = {name: name, course_member_id: teacher.id, login: teacher_user.login, user_id: teacher.user_id, role: role,
school: teacher_user.school_name, image_url: url_to_avatar(teacher_user)}
pinyin = Pinyin.t(name.strip, splitter: '')
first_char = pinyin[0]
letter = first_letter first_char
if data.pluck(:letter).include?(letter)
data.select{|a|a[:letter]==letter}.first[:items] << item
else
data << {letter: letter, items: [item]}
end
end
end
data = data.sort do |a, b|
[a[:letter]] <=> [b[:letter]]
end
data.push(data.shift) if data.select{|a|a[:letter]=='#'}.first.present? # '#'排在最后
return data
end
def student_list students, excellent
data = []
students.each do |student|
if student.user.present?
student_user = student.user
name = student_user.real_name
phone = excellent ? "" : student_user.hidden_phone
item = {name: name, course_member_id: student.id, login: student_user.login, user_id: student.user_id,
student_id: student_user.student_id, image_url: url_to_avatar(student_user), phone: phone}
pinyin = Pinyin.t(name.strip, splitter: '')
first_char = pinyin[0]
letter = first_letter first_char
if data.pluck(:letter).include?(letter)
data.select{|a|a[:letter]==letter}.first[:items] << item
else
data << {letter: letter, items: [item]}
end
end
end
data = data.sort do |a, b|
[a[:letter]] <=> [b[:letter]]
end
data.push(data.shift) if data.select{|a|a[:letter]=='#'}.first.present? # '#'排在最后
return data
end
def first_letter char
if char.ord >= 97 && char.ord <= 122
letter = (char.ord - 32).chr.to_s
elsif char.ord >= 65 && char.ord <= 90
letter = char
else
letter = '#'
end
letter
end
end

@ -0,0 +1,10 @@
class UpdateShixunWorkScoreJob < ApplicationJob
queue_as :default
def perform(homework_id)
homework = HomeworkCommon.find_by(id: homework_id)
return if homework.blank?
homework.update_homework_work_score
end
end

@ -8,9 +8,11 @@ class Hack < ApplicationRecord
# 代码 # 代码
has_many :hack_codes, :dependent => :destroy has_many :hack_codes, :dependent => :destroy
has_many :hack_user_lastest_codes, :dependent => :destroy has_many :hack_user_lastest_codes, :dependent => :destroy
has_many :discusses, as: :dis, dependent: :destroy
belongs_to :user belongs_to :user
scope :published, -> { where(status: 1) } scope :published, -> { where(status: 1) }
scope :unpublish, -> { where(status: 0) }
scope :opening, -> {where(open_or_not: 1)} scope :opening, -> {where(open_or_not: 1)}
scope :mine, -> (author_id){ where(user_id: author_id) } scope :mine, -> (author_id){ where(user_id: author_id) }

@ -1,4 +1,6 @@
class HackSet < ApplicationRecord class HackSet < ApplicationRecord
validates :input, presence: { message: "测试集输入不能为空" }
validates :output, uniqueness: { message: "测试集输出不能为空" }
# 编程题测试集 # 编程题测试集
belongs_to :hack belongs_to :hack
end end

@ -2,12 +2,14 @@ class HackUserLastestCode < ApplicationRecord
# passed 用户之前评测是否通过 # passed 用户之前评测是否通过
# status: 最新评测状态: -1测试用例结果不匹配; 0: 评测通过; ;2 评测超时;3 创建pod失败; 4 编译失败;5 执行失败 # status: 最新评测状态: -1测试用例结果不匹配; 0: 评测通过; ;2 评测超时;3 创建pod失败; 4 编译失败;5 执行失败
# submit_status: 0: 可以评测, 1评测中 # submit_status: 0: 可以评测, 1评测中
# passed_time:第一次通关的时间
# 编程题最新代码 # 编程题最新代码
belongs_to :hack, counter_cache: true belongs_to :hack, counter_cache: true
belongs_to :user belongs_to :user
has_many :hack_user_codes, dependent: :destroy has_many :hack_user_codes, dependent: :destroy
has_one :hack_user_debug has_one :hack_user_debug
scope :mine, ->(author_id){ find_by(user_id: author_id) } scope :mine, ->(author_id){ find_by(user_id: author_id) }
scope :mine_hack, ->(author_id){ where(user_id: author_id) }
scope :passed, -> {where(status: 1)} scope :passed, -> {where(status: 1)}
end end

@ -28,6 +28,7 @@ class Shixun < ApplicationRecord
has_one :first_tag_repertoire, through: :first_shixun_tag_repertoire, source: :tag_repertoire has_one :first_tag_repertoire, through: :first_shixun_tag_repertoire, source: :tag_repertoire
has_many :homework_commons_shixuns, class_name: 'HomeworkCommonsShixun' has_many :homework_commons_shixuns, class_name: 'HomeworkCommonsShixun'
has_many :fork_shixuns, foreign_key: "fork_from", class_name: 'Shixun'
#实训的关卡 #实训的关卡
has_many :exercise_shixun_challenges, :dependent => :destroy has_many :exercise_shixun_challenges, :dependent => :destroy
@ -97,7 +98,7 @@ class Shixun < ApplicationRecord
end end
def fork_identifier def fork_identifier
self.fork_from.nil? ? "--" : Shixun.where(id: self.fork_from).first.try(:identifier) self.fork_from.nil? ? "--" : fork_shixuns.first&.identifier
end end
def shixun_status def shixun_status
@ -171,7 +172,7 @@ class Shixun < ApplicationRecord
end end
def owner def owner
User.find(self.user_id) User.find_by_id(self.user_id)
end end
def shixun_main_name def shixun_main_name

@ -111,14 +111,14 @@ class StudentWork < ApplicationRecord
# 作品总体评价 # 作品总体评价
def overall_appraisal def overall_appraisal
case self.work_score.to_i case (self.work_score.to_f / homework_common.total_score).round(2)
when (90..100) when (0.90..1.00)
'优秀' '优秀'
when (70...90) when (0.70...0.90)
'良好' '良好'
when (60...70) when (0.60...0.70)
'及格' '及格'
when (0...60) when (0.00...0.60)
'不及格' '不及格'
end end
end end

@ -10,6 +10,7 @@ class Admins::IdentityAuths::RefuseApplyService < ApplicationService
def call def call
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
apply.update!(status: 2, remarks: reason) apply.update!(status: 2, remarks: reason)
user.update!(authentication: false)
deal_tiding! deal_tiding!
apply.attachment&.destroy apply.attachment&.destroy

@ -10,6 +10,7 @@ class Admins::ProfessionalAuths::RefuseApplyService < ApplicationService
def call def call
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
apply.update!(status: 2, remarks: reason) apply.update!(status: 2, remarks: reason)
user.update!(professional_certification: false)
deal_tiding! deal_tiding!
apply.attachment&.destroy apply.attachment&.destroy

@ -10,7 +10,7 @@ class Users::ApplyAuthenticationService < ApplicationService
raise Error, '请先完善基本信息' unless user.profile_completed? raise Error, '请先完善基本信息' unless user.profile_completed?
Users::ApplyAuthenticationForm.new(params).validate! Users::ApplyAuthenticationForm.new(params).validate!
raise Error, '您已经申请过实名认证了' if ApplyUserAuthentication.real_name_auth.processing.exists?(user_id: user.id) # raise Error, '您已经申请过实名认证了' if ApplyUserAuthentication.real_name_auth.processing.exists?(user_id: user.id)
user.lastname = params[:name].to_s.strip user.lastname = params[:name].to_s.strip
user.firstname = '' user.firstname = ''
@ -18,7 +18,9 @@ class Users::ApplyAuthenticationService < ApplicationService
user.show_realname = params[:show_realname].to_s == 'true' if params[:show_realname].to_s.present? user.show_realname = params[:show_realname].to_s == 'true' if params[:show_realname].to_s.present?
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
user.authentication = false ApplyUserAuthentication.real_name_auth.processing.where(user_id: user.id).destroy_all
user.authentication = true
user.save! user.save!
user.user_extension.update!(gender: params[:gender].to_i) if params[:gender].present? user.user_extension.update!(gender: params[:gender].to_i) if params[:gender].present?

@ -12,15 +12,15 @@ class Users::ApplyProfessionalAuthService < ApplicationService
raise Error, '请先完善基本信息' unless user.profile_completed? raise Error, '请先完善基本信息' unless user.profile_completed?
Users::ApplyProfessionalAuthForm.new(params).validate! Users::ApplyProfessionalAuthForm.new(params).validate!
raise Error, '您已经申请过职业认证了' if ApplyUserAuthentication.professional_auth.processing.exists?(user_id: user.id) # raise Error, '您已经申请过职业认证了' if ApplyUserAuthentication.professional_auth.processing.exists?(user_id: user.id)
user.professional_certification = false
extension = user.user_extension extension = user.user_extension
extension.school_id = params[:school_id] extension.school_id = params[:school_id]
extension.department_id = params[:department_id] extension.department_id = params[:department_id]
extension.identity = params[:identity] extension.identity = params[:identity]
user.professional_certification = params[:identity] != "teacher"
extra = params[:extra].to_s.strip.presence extra = params[:extra].to_s.strip.presence
if extension.identity.to_s == 'student' if extension.identity.to_s == 'student'
extension.technical_title = nil extension.technical_title = nil
@ -31,6 +31,7 @@ class Users::ApplyProfessionalAuthService < ApplicationService
end end
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
ApplyUserAuthentication.professional_auth.processing.where(user_id: user.id).destroy_all
user.save! user.save!
extension.save! extension.save!

@ -24,6 +24,7 @@
<%= submit_tag('搜索', class: 'btn btn-primary ml-3','data-disable-with': '搜索中...') %> <%= submit_tag('搜索', class: 'btn btn-primary ml-3','data-disable-with': '搜索中...') %>
<%= link_to "清除",admins_shixun_settings_path,class: "btn btn-default",'data-disable-with': '清除中...' %> <%= link_to "清除",admins_shixun_settings_path,class: "btn btn-default",'data-disable-with': '清除中...' %>
<div class=""> <div class="">
<a href="javascript:void(0)" class="btn btn-primary export-base-absolute" id="shixun-settings-base-export" data-disable-with = '导出中...'>导出基础数据</a>
<a href="javascript:void(0)" class="btn btn-primary export-absolute" id="shixun-settings-export" data-disable-with = '导出中...'>导出</a> <a href="javascript:void(0)" class="btn btn-primary export-absolute" id="shixun-settings-export" data-disable-with = '导出中...'>导出</a>
</div> </div>
</div> </div>

@ -27,7 +27,7 @@
<%= raw '<br/>' if weappImageExists %> <%= raw '<br/>' if weappImageExists %>
<%= javascript_void_link weappImageExists ? '重新上传' : '上传图片', class: 'action upload-shixun-weapp-image-action', data: { source_id: shixun.id, source_type: 'Shixun', suffix: '_weapp', toggle: 'modal', target: '.admin-upload-file-modal' } %> <%= javascript_void_link weappImageExists ? '重新上传' : '上传图片', class: 'action upload-shixun-weapp-image-action', data: { source_id: shixun.id, source_type: 'Shixun', suffix: '_weapp', toggle: 'modal', target: '.admin-upload-file-modal' } %>
</td> </td>
<td><%= link_to shixun.owner.try(:real_name),"/users/#{shixun.owner.login}",target:'_blank' %></td> <td><%= link_to shixun.owner.try(:real_name),"/users/#{shixun.owner&.login}",target:'_blank' %></td>
<td> <td>
<% if shixun.status.to_i < 3 %> <% if shixun.status.to_i < 3 %>
<%= link_to "关闭", admins_shixun_setting_path(shixun,status:3,page_no:page_no),method: :put, :class => "", :remote => true %> <%= link_to "关闭", admins_shixun_setting_path(shixun,status:3,page_no:page_no),method: :put, :class => "", :remote => true %>

@ -0,0 +1,11 @@
json.id discuss.id
json.content content_safe(discuss.content)
json.time time_from_now(discuss.created_at)
json.hack_id discuss.dis_id
# 主贴和回复有一些不同点
if discuss.parent_id
json.can_delete discuss.can_deleted?(current_user)
else
json.praise_count discuss.praises_count
json.user_praise discuss.praise_treads.select{|pt| pt.user_id == current_user.id}.length > 0
end

@ -0,0 +1,4 @@
json.discuss @discuss
json.author do
json.partial! 'users/user', user: @discuss.user
end

@ -0,0 +1,7 @@
json.disscuss_count @disscuss_count
json.comments @discusses do |discuss|
json.partial! 'comments/discuss', locals: { discuss: discuss}
json.children discuss.child_discuss(current_user) do |c_d|
json.partial! 'comments/discuss', locals: { discuss: c_d }
end
end

@ -9,6 +9,7 @@ json.application_list do
json.name_link user_path(application.application_user) json.name_link user_path(application.application_user)
json.login application.application_user.login json.login application.application_user.login
json.image_url url_to_avatar(application.application_user) json.image_url url_to_avatar(application.application_user)
json.school_name application.application_user.school_name
json.role application.content.to_i == 3 || application.content.to_i == 7 ? "助教" : application.content.to_i == 2 || application.content.to_i == 9 ? "教师" : "" json.role application.content.to_i == 3 || application.content.to_i == 7 ? "助教" : application.content.to_i == 2 || application.content.to_i == 9 ? "教师" : ""
end end
end end

@ -0,0 +1,2 @@
json.(@hack_user, :id, :status, :error_line, :error_msg, :expected_output,
:input, :output, :execute_time, :execute_memory)

@ -0,0 +1,7 @@
json.(@result, :id, :status, :error_line, :error_msg,
:input, :output, :execute_time, :execute_memory)
# 提交模式多了一个预计输出
if @mode == "submit"
json.expected_output @result.expected_output
end

@ -0,0 +1,3 @@
json.array! @my_hack.hack_user_codes do |hack_user|
json.(hack_user, :id, :created_at, :status, :execute_time, :execute_memory)
end

@ -11,13 +11,13 @@ if @shixun
json.myself_experience @work.myshixun.try(:total_score).to_i json.myself_experience @work.myshixun.try(:total_score).to_i
json.total_experience @shixun.all_score json.total_experience @shixun.all_score
json.work_score number_with_precision @work.work_score.to_f.round(2), precision: 1 json.work_score number_with_precision @work.work_score.to_f.round(2), precision: 1
json.all_work_score number_with_precision 100, precision: 1 json.all_work_score number_with_precision @homework.total_score, precision: 1
json.time_consuming @work.myshixun_consume json.time_consuming @work.myshixun_consume
json.evaluate_count @user_evaluate_count.to_i json.evaluate_count @user_evaluate_count.to_i
if @homework.work_efficiency if @homework.work_efficiency
json.eff_score_full number_with_precision @homework.eff_score, precision: 1 json.eff_score_full number_with_precision @homework.eff_score, precision: 1
json.eff_score number_with_precision @work.eff_score.to_f.round(2), precision: 1 json.eff_score number_with_precision @work.eff_score.to_f.round(2), precision: 1
json.challenge_score_full number_with_precision (100 - @homework.eff_score), precision: 1 json.challenge_score_full number_with_precision (@homework.total_score - @homework.eff_score), precision: 1
json.challenge_score number_with_precision @work.final_score.to_f.round(2), precision: 1 json.challenge_score number_with_precision @work.final_score.to_f.round(2), precision: 1
end end

@ -1,4 +1,4 @@
json.qrcode_img Util::FileManage.exists?(@subject, '_qrcode') ? Util::FileManage.source_disk_file_url(@subject, '_qrcode') : nil json.qrcode_img nil
json.members @members do |member| json.members @members do |member|
json.partial! 'subject_member', locals: { user: member.user } json.partial! 'subject_member', locals: { user: member.user }

@ -1,12 +1,2 @@
json.students do json.students student_list @students, @course.excellent
json.array! @students do |student|
json.user_id student.user_id
json.login student.user.try(:login)
json.name student.user.try(:real_name)
json.student_id student.user.try(:student_id)
json.course_member_id student.id
json.user_phone @course.excellent ? "" : student.user.hidden_phone
json.image_url url_to_avatar(student.user)
end
end
json.students_count @students_count json.students_count @students_count

@ -1,16 +1,3 @@
json.teacher_list do json.teacher_list teacher_list(@teacher_list)
json.array! @teacher_list do |teacher|
json.course_member_id teacher.id
json.name teacher.user.real_name
json.login teacher.user.login
json.user_id teacher.user.id
json.role teacher.role == "CREATOR" ? "管理员" : teacher.role == "PROFESSOR" ? "教师" : "助教"
json.school teacher.user&.school_name
json.image_url url_to_avatar(teacher.user)
# if @user_course_identity < Course::ASSISTANT_PROFESSOR
# json.member_roles teacher.user.course_role(@course)
# end
end
end
json.teacher_list_size @teacher_list_size json.teacher_list_size @teacher_list_size
json.apply_size @applications_size json.apply_size @applications_size

@ -43,6 +43,11 @@ Rails.application.routes.draw do
post :publish post :publish
get :start get :start
get :result get :result
post :update_set
delete :delete_set
end
resources :comments do
post :reply
end end
end end

@ -0,0 +1,6 @@
class RemovePassTimeForHackUserLastestCodes < ActiveRecord::Migration[5.2]
def change
remove_column :hack_user_lastest_codes, :pass_time
add_column :hack_user_codes, :expected_output, :text
end
end

@ -0,0 +1,5 @@
class MigrateEffScoreDefault < ActiveRecord::Migration[5.2]
def change
change_column :homework_commons, :eff_score, :float, default: 0
end
end

@ -0,0 +1,5 @@
class AddCodeForhackUserDebugs < ActiveRecord::Migration[5.2]
def change
add_column :hack_user_debugs, :code, :text
end
end

@ -0,0 +1,6 @@
class ModifyExecuteTimeForHackUserCode < ActiveRecord::Migration[5.2]
def change
change_column :hack_user_debugs, :execute_time, :float
change_column :hack_user_codes, :execute_time, :float
end
end

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -33,12 +33,17 @@ Released under the MIT license
(function() { (function() {
(function() { (function() {
var cspNonce; var nonce;
cspNonce = Rails.cspNonce = function() { nonce = null;
var meta;
meta = document.querySelector('meta[name=csp-nonce]'); Rails.loadCSPNonce = function() {
return meta && meta.content; var ref;
return nonce = (ref = document.querySelector("meta[name=csp-nonce]")) != null ? ref.content : void 0;
};
Rails.cspNonce = function() {
return nonce != null ? nonce : Rails.loadCSPNonce();
}; };
}).call(this); }).call(this);
@ -617,24 +622,29 @@ Released under the MIT license
return setData(form, 'ujs:submit-button-formmethod', button.getAttribute('formmethod')); return setData(form, 'ujs:submit-button-formmethod', button.getAttribute('formmethod'));
}; };
Rails.handleMetaClick = function(e) { Rails.preventInsignificantClick = function(e) {
var data, link, metaClick, method; var data, insignificantMetaClick, link, metaClick, method, primaryMouseKey;
link = this; link = this;
method = (link.getAttribute('data-method') || 'GET').toUpperCase(); method = (link.getAttribute('data-method') || 'GET').toUpperCase();
data = link.getAttribute('data-params'); data = link.getAttribute('data-params');
metaClick = e.metaKey || e.ctrlKey; metaClick = e.metaKey || e.ctrlKey;
if (metaClick && method === 'GET' && !data) { insignificantMetaClick = metaClick && method === 'GET' && !data;
primaryMouseKey = e.button === 0;
if (!primaryMouseKey || insignificantMetaClick) {
return e.stopImmediatePropagation(); return e.stopImmediatePropagation();
} }
}; };
}).call(this); }).call(this);
(function() { (function() {
var $, CSRFProtection, delegate, disableElement, enableElement, fire, formSubmitButtonClick, getData, handleConfirm, handleDisabledElement, handleMetaClick, handleMethod, handleRemote, refreshCSRFTokens; var $, CSRFProtection, delegate, disableElement, enableElement, fire, formSubmitButtonClick, getData, handleConfirm, handleDisabledElement, handleMethod, handleRemote, loadCSPNonce, preventInsignificantClick, refreshCSRFTokens;
fire = Rails.fire, delegate = Rails.delegate, getData = Rails.getData, $ = Rails.$, refreshCSRFTokens = Rails.refreshCSRFTokens, CSRFProtection = Rails.CSRFProtection, enableElement = Rails.enableElement, disableElement = Rails.disableElement, handleDisabledElement = Rails.handleDisabledElement, handleConfirm = Rails.handleConfirm, handleRemote = Rails.handleRemote, formSubmitButtonClick = Rails.formSubmitButtonClick, handleMetaClick = Rails.handleMetaClick, handleMethod = Rails.handleMethod; fire = Rails.fire, delegate = Rails.delegate, getData = Rails.getData, $ = Rails.$, refreshCSRFTokens = Rails.refreshCSRFTokens, CSRFProtection = Rails.CSRFProtection, loadCSPNonce = Rails.loadCSPNonce, enableElement = Rails.enableElement, disableElement = Rails.disableElement, handleDisabledElement = Rails.handleDisabledElement, handleConfirm = Rails.handleConfirm, preventInsignificantClick = Rails.preventInsignificantClick, handleRemote = Rails.handleRemote, formSubmitButtonClick = Rails.formSubmitButtonClick, handleMethod = Rails.handleMethod;
if ((typeof jQuery !== "undefined" && jQuery !== null) && (jQuery.ajax != null) && !jQuery.rails) { if ((typeof jQuery !== "undefined" && jQuery !== null) && (jQuery.ajax != null)) {
if (jQuery.rails) {
throw new Error('If you load both jquery_ujs and rails-ujs, use rails-ujs only.');
}
jQuery.rails = Rails; jQuery.rails = Rails;
jQuery.ajaxPrefilter(function(options, originalOptions, xhr) { jQuery.ajaxPrefilter(function(options, originalOptions, xhr) {
if (!options.crossDomain) { if (!options.crossDomain) {
@ -663,12 +673,13 @@ Released under the MIT license
delegate(document, Rails.linkDisableSelector, 'ajax:stopped', enableElement); delegate(document, Rails.linkDisableSelector, 'ajax:stopped', enableElement);
delegate(document, Rails.buttonDisableSelector, 'ajax:complete', enableElement); delegate(document, Rails.buttonDisableSelector, 'ajax:complete', enableElement);
delegate(document, Rails.buttonDisableSelector, 'ajax:stopped', enableElement); delegate(document, Rails.buttonDisableSelector, 'ajax:stopped', enableElement);
delegate(document, Rails.linkClickSelector, 'click', preventInsignificantClick);
delegate(document, Rails.linkClickSelector, 'click', handleDisabledElement); delegate(document, Rails.linkClickSelector, 'click', handleDisabledElement);
delegate(document, Rails.linkClickSelector, 'click', handleConfirm); delegate(document, Rails.linkClickSelector, 'click', handleConfirm);
delegate(document, Rails.linkClickSelector, 'click', handleMetaClick);
delegate(document, Rails.linkClickSelector, 'click', disableElement); delegate(document, Rails.linkClickSelector, 'click', disableElement);
delegate(document, Rails.linkClickSelector, 'click', handleRemote); delegate(document, Rails.linkClickSelector, 'click', handleRemote);
delegate(document, Rails.linkClickSelector, 'click', handleMethod); delegate(document, Rails.linkClickSelector, 'click', handleMethod);
delegate(document, Rails.buttonClickSelector, 'click', preventInsignificantClick);
delegate(document, Rails.buttonClickSelector, 'click', handleDisabledElement); delegate(document, Rails.buttonClickSelector, 'click', handleDisabledElement);
delegate(document, Rails.buttonClickSelector, 'click', handleConfirm); delegate(document, Rails.buttonClickSelector, 'click', handleConfirm);
delegate(document, Rails.buttonClickSelector, 'click', disableElement); delegate(document, Rails.buttonClickSelector, 'click', disableElement);
@ -686,10 +697,12 @@ Released under the MIT license
}); });
delegate(document, Rails.formSubmitSelector, 'ajax:send', disableElement); delegate(document, Rails.formSubmitSelector, 'ajax:send', disableElement);
delegate(document, Rails.formSubmitSelector, 'ajax:complete', enableElement); delegate(document, Rails.formSubmitSelector, 'ajax:complete', enableElement);
delegate(document, Rails.formInputClickSelector, 'click', preventInsignificantClick);
delegate(document, Rails.formInputClickSelector, 'click', handleDisabledElement); delegate(document, Rails.formInputClickSelector, 'click', handleDisabledElement);
delegate(document, Rails.formInputClickSelector, 'click', handleConfirm); delegate(document, Rails.formInputClickSelector, 'click', handleConfirm);
delegate(document, Rails.formInputClickSelector, 'click', formSubmitButtonClick); delegate(document, Rails.formInputClickSelector, 'click', formSubmitButtonClick);
document.addEventListener('DOMContentLoaded', refreshCSRFTokens); document.addEventListener('DOMContentLoaded', refreshCSRFTokens);
document.addEventListener('DOMContentLoaded', loadCSPNonce);
return window._rails_loaded = true; return window._rails_loaded = true;
}; };

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 56 KiB

@ -13,7 +13,7 @@
})(function(CodeMirror) { })(function(CodeMirror) {
"use strict"; "use strict";
var Pos = CodeMirror.Pos; var Pos = CodeMirror.Pos;
var svgNS = "http://www.w3.org/2000/svg"; var svgNS = "https://www.w3.org/2000/svg";
var value, orig1, orig2, dv, panes = 2, highlight = true, connect = null, collapse = false; var value, orig1, orig2, dv, panes = 2, highlight = true, connect = null, collapse = false;
CodeMirror.k_init=function(id,newData,oldData){ CodeMirror.k_init=function(id,newData,oldData){

@ -20,6 +20,7 @@ import Trialapplicationysl from './modules/login/Trialapplicationysl';
import Trialapplicationreview from './modules/user/Trialapplicationreview'; import Trialapplicationreview from './modules/user/Trialapplicationreview';
import Addcourses from "./modules/courses/coursesPublic/Addcourses"; import Addcourses from "./modules/courses/coursesPublic/Addcourses";
import AccountProfile from "./modules/user/AccountProfile"; import AccountProfile from "./modules/user/AccountProfile";
import Accountnewprofile from './modules/user/Accountnewprofile';
import Trialapplication from './modules/login/Trialapplication'; import Trialapplication from './modules/login/Trialapplication';
import Certifiedprofessional from './modules/modals/Certifiedprofessional'; import Certifiedprofessional from './modules/modals/Certifiedprofessional';
import NotFoundPage from './NotFoundPage' import NotFoundPage from './NotFoundPage'
@ -363,6 +364,7 @@ class App extends Component {
}); });
} }
componentDidMount() { componentDidMount() {
document.title = "loading...";
this.disableVideoContextMenu(); this.disableVideoContextMenu();
// force an update if the URL changes // force an update if the URL changes
history.listen(() => { history.listen(() => {
@ -478,6 +480,7 @@ class App extends Component {
<Provider store={store}> <Provider store={store}>
<LocaleProvider locale={zhCN}> <LocaleProvider locale={zhCN}>
<MuiThemeProvider theme={theme}> <MuiThemeProvider theme={theme}>
<Accountnewprofile {...this.props}{...this.state}/>
<LoginDialog {...this.props} {...this.state} Modifyloginvalue={()=>this.Modifyloginvalue()}></LoginDialog> <LoginDialog {...this.props} {...this.state} Modifyloginvalue={()=>this.Modifyloginvalue()}></LoginDialog>
<Notcompletedysl {...this.props} {...this.state}></Notcompletedysl> <Notcompletedysl {...this.props} {...this.state}></Notcompletedysl>
<Trialapplicationysl {...this.props} {...this.state}></Trialapplicationysl> <Trialapplicationysl {...this.props} {...this.state}></Trialapplicationysl>

@ -1,4 +1,5 @@
import createHistory from 'history/createBrowserHistory'; // import createHistory from 'history/createBrowserHistory';
const createHistory = require('history').createBrowserHistory;
const history = createHistory(); const history = createHistory();

@ -1 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="20px" height="20px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#333333" d="M463.9 804.4c-194.7 0-353.1-158.4-353.1-353.1S269.2 98.2 463.9 98.2 817 256.6 817 451.3 658.6 804.4 463.9 804.4z m0-651.9c-164.8 0-298.8 134-298.8 298.8s134 298.8 298.8 298.8 298.8-134 298.8-298.8-134-298.8-298.8-298.8zM884.9 926.6c-7.2 0-14.4-2.9-19.8-8.6l-198-210.6c-10.3-10.9-9.7-28.1 1.2-38.4 10.9-10.3 28.1-9.8 38.4 1.2l198 210.6c10.3 10.9 9.7 28.1-1.2 38.4-5.2 5-11.9 7.4-18.6 7.4z" /></svg> <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="20px" height="20px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#333333" d="M463.9 804.4c-194.7 0-353.1-158.4-353.1-353.1S269.2 98.2 463.9 98.2 817 256.6 817 451.3 658.6 804.4 463.9 804.4z m0-651.9c-164.8 0-298.8 134-298.8 298.8s134 298.8 298.8 298.8 298.8-134 298.8-298.8-134-298.8-298.8-298.8zM884.9 926.6c-7.2 0-14.4-2.9-19.8-8.6l-198-210.6c-10.3-10.9-9.7-28.1 1.2-38.4 10.9-10.3 28.1-9.8 38.4 1.2l198 210.6c10.3 10.9 9.7 28.1-1.2 38.4-5.2 5-11.9 7.4-18.6 7.4z" /></svg>

Before

Width:  |  Height:  |  Size: 674 B

After

Width:  |  Height:  |  Size: 675 B

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" <svg version="1.1" id="图层_1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve" width="20px" height="18px"> viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve" width="20px" height="18px">
<g> <g>
<path fill="#4DACFF" d="M104.3,898.8c-5.6,0-11.1-2.3-15-6.5c-5-5.4-6.7-13-4.5-20l50.3-160.8C87.4,650.1,62.3,579,62.3,505.2 <path fill="#4DACFF" d="M104.3,898.8c-5.6,0-11.1-2.3-15-6.5c-5-5.4-6.7-13-4.5-20l50.3-160.8C87.4,650.1,62.3,579,62.3,505.2

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" <svg version="1.1" id="图层_1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve" width="20px" height="18px"> viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve" width="20px" height="18px">
<g> <g>
<path fill="#989898" d="M104.3,898.8c-5.6,0-11.1-2.3-15-6.5c-5-5.4-6.7-13-4.5-20l50.3-160.8C87.4,650.1,62.3,579,62.3,505.2 <path fill="#989898" d="M104.3,898.8c-5.6,0-11.1-2.3-15-6.5c-5-5.4-6.7-13-4.5-20l50.3-160.8C87.4,650.1,62.3,579,62.3,505.2

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" <svg version="1.1" id="图层_1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve" width="16px" height="16px"> viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve" width="16px" height="16px">
<g> <g>
<path fill="#4CACFF" d="M858.9,98.2H167.1c-38,0-69.2,31.1-69.2,69.2v691.8c0,38.1,31.1,69.2,69.2,69.2h691.8c38,0,69.2-31.1,69.2-69.2V167.3 <path fill="#4CACFF" d="M858.9,98.2H167.1c-38,0-69.2,31.1-69.2,69.2v691.8c0,38.1,31.1,69.2,69.2,69.2h691.8c38,0,69.2-31.1,69.2-69.2V167.3

Before

Width:  |  Height:  |  Size: 985 B

After

Width:  |  Height:  |  Size: 987 B

@ -1,4 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"> <svg xmlns="https://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
<g fill="#61DAFB"> <g fill="#61DAFB">
<path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/> <path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/>
<circle cx="420.9" cy="296.5" r="45.7"/> <circle cx="420.9" cy="296.5" r="45.7"/>

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

@ -38,8 +38,8 @@ class CompetitionMaxImg extends React.Component {
<div className="registrationback" <div className="registrationback"
style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}} style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}}
> >
<p className="registrationbackp1">Educoder竞赛平台</p> <p className="registrationbackp1">在线竞赛平台</p>
<p className="registrationbackp2">Educoder是一个面向计算机类的互联网IT教育和实战平台</p> <p className="registrationbackp2">在线竞赛平台是一个面向计算机类的互联网IT教育和实战平台</p>
<p className="registrationbackp3">提供企业级工程实训以实现工程化专业教学的自动化和智能化</p> <p className="registrationbackp3">提供企业级工程实训以实现工程化专业教学的自动化和智能化</p>
<div className="registrationbackp2button"> <div className="registrationbackp2button">
<div className="registbut1"> <div className="registbut1">
@ -57,8 +57,8 @@ class CompetitionMaxImg extends React.Component {
<div className="registrationback" <div className="registrationback"
style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}} style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}}
> >
<p className="registrationbackp1">Educoder竞赛平台</p> <p className="registrationbackp1">在线竞赛平台</p>
<p className="registrationbackp2">Educoder是一个面向计算机类的互联网IT教育和实战平台</p> <p className="registrationbackp2">在线竞赛平台是一个面向计算机类的互联网IT教育和实战平台</p>
<p className="registrationbackp3">提供企业级工程实训以实现工程化专业教学的自动化和智能化</p> <p className="registrationbackp3">提供企业级工程实训以实现工程化专业教学的自动化和智能化</p>
<div className="registrationbackp2button"> <div className="registrationbackp2button">
<div className="registbut1"> <div className="registbut1">
@ -76,8 +76,8 @@ class CompetitionMaxImg extends React.Component {
<div className="registrationback" <div className="registrationback"
style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}} style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}}
> >
<p className="registrationbackp1">Educoder竞赛平台</p> <p className="registrationbackp1">在线竞赛平台</p>
<p className="registrationbackp2">Educoder是一个面向计算机类的互联网IT教育和实战平台</p> <p className="registrationbackp2">在线竞赛平台是一个面向计算机类的互联网IT教育和实战平台</p>
<p className="registrationbackp3">提供企业级工程实训以实现工程化专业教学的自动化和智能化</p> <p className="registrationbackp3">提供企业级工程实训以实现工程化专业教学的自动化和智能化</p>
<div className="registrationbackp2button"> <div className="registrationbackp2button">
<div className="registbut1"> <div className="registbut1">
@ -92,8 +92,8 @@ class CompetitionMaxImg extends React.Component {
: type === 6 ? : type === 6 ?
<div className="registrationback" <div className="registrationback"
style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}}> style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}}>
<p className="registrationbackp1">Educoder竞赛平台</p> <p className="registrationbackp1">在线竞赛平台</p>
<p className="registrationbackp2">Educoder是一个面向计算机类的互联网IT教育和实战平台</p> <p className="registrationbackp2">在线竞赛平台是一个面向计算机类的互联网IT教育和实战平台</p>
<p className="registrationbackp3">提供企业级工程实训以实现工程化专业教学的自动化和智能化</p> <p className="registrationbackp3">提供企业级工程实训以实现工程化专业教学的自动化和智能化</p>
<div className="registrationbackp2button"> <div className="registrationbackp2button">
{ {
@ -160,4 +160,4 @@ export default CompetitionMaxImg;
// // </div> // // </div>
// // // //
// // </div> // // </div>
// // </div> // // </div>

@ -130,16 +130,28 @@ class CoursesBanner extends Component {
axios.get(url,{params: axios.get(url,{params:
dataqueryss dataqueryss
}).then((result) => { }).then((result) => {
if( result!=undefined){ if(result.data.status===-2){
let data = result.data; // this.setState({
this.setState({ // AccountProfiletype:true,
coursedata: data, // content:result.data.message,
excellent:data.excellent, // okText:"立即认证",
}) // cannelText:"稍后认证",
this.props.ispostexcellenttype(data.excellent) // okHref:`/account/certification`,
// Accounturltype:true
// })
}else{ }else{
this.onloadupdatabanner() if( result!=undefined){
let data = result.data;
this.setState({
coursedata: data,
excellent:data.excellent,
})
this.props.ispostexcellenttype(data.excellent)
}else{
this.onloadupdatabanner()
}
} }
}) })
}; };
foo=(url)=> { foo=(url)=> {
@ -452,7 +464,12 @@ class CoursesBanner extends Component {
hideAccountProfile=()=>{ hideAccountProfile=()=>{
this.setState({ this.setState({
AccountProfiletype:false AccountProfiletype:false,
content:undefined,
okText:undefined,
okHref:undefined,
cannelText:undefined,
Accounturltype:undefined
}) })
}; };
ysljoinmodalCancel=()=>{ ysljoinmodalCancel=()=>{

@ -616,7 +616,7 @@ class NewShixunModel extends Component{
} }
</Checkbox.Group> </Checkbox.Group>
{shixun_list===undefined||shixuns_count===undefined?"":shixun_list.length===0||shixuns_count===0?"":shixuns_count>15?<div className={" edu-txt-center pd303010"}> {shixun_list===undefined||shixuns_count===undefined?"":shixun_list.length===0||shixuns_count===0?"":shixuns_count>15?<div className={" edu-txt-center pd303010 newshixunmodels"}>
<Pagination <Pagination
showQuickJumper showQuickJumper
defaultCurrent={1} defaultCurrent={1}

@ -5,6 +5,7 @@
.newshixunheadersear{ .newshixunheadersear{
display: flex; display: flex;
justify-content: center; justify-content: center;
margin: 0 auto;
} }
.packinput .ant-input{ .packinput .ant-input{
height: 55px; height: 55px;
@ -376,3 +377,11 @@
display: flex; display: flex;
flex-direction:initial; flex-direction:initial;
} }
.newshixunheadersear{
margin: 0 auto;
}
.newshixunmodels{
margin: 0 auto;
}

@ -749,7 +749,7 @@ class studentsList extends Component{
{invite_code} {invite_code}
</span> </span>
<Tooltip title={<div> <Tooltip title={<div>
<div>成员可以通过邀请码主动加入课堂</div> <div>成员可以通过邀请码主动加入分班</div>
<div>点击立刻复制邀请码</div> <div>点击立刻复制邀请码</div>
</div>}> </div>}>
<span> <span>

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

Loading…
Cancel
Save