pre_develop
guange 6 years ago
commit 71d2066131

@ -36,7 +36,7 @@ module Mobile
content_type :json, "application/json;charset=UTF-8"
# use ActionDispatch::Session::CookieStore
require 'digest'
use Mobile::Middleware::ErrorHandler
helpers do
@ -53,6 +53,16 @@ module Mobile
error!('401 Unauthorized', 401) if params[:private_token] != "hriEn3UwXfJs3PmyXnSG"
end
def cnmooc_access_key!
## 签名
accessKeyId = 'LTAISM4HFWpQHh3g'.freeze
accessKeySecret = '9NMU8ushmFu8SN1EKHOhvo9jmv1qp0'.freeze
sign = Digest::MD5.hexdigest("AccessKeyId=#{accessKeyId}AccessKeySecret=#{accessKeySecret}").upcase
if params[:sign] != sign
error!('401 Unauthorized', 401)
end
end
# 有一些接口没登录也能查看数据
def career_authenticate!
pass = request.path.include?("introduction") || request.path.include?("get_published_careers")|| request.path.include?("get_current_user")
@ -160,6 +170,7 @@ module Mobile
mount Apis::Careers
mount Apis::Assets
mount Apis::Ecloud
mount Apis::Cnmooc

@ -0,0 +1,54 @@
# encoding=utf-8
# 好大学接口数据
module Mobile
module Apis
class Cnmooc < Grape::API
before {cnmooc_access_key!}
content_type :json, 'application/json;charset=UTF-8'
resources :cnmoocs do
desc '获取实训数据'
get "get_resources_data" do
CnmoocsService.new.get_resources_data params
end
desc "实训搜索功能"
params do
requires :name, type: String, desc: "搜索名称"
end
get 'search_resources' do
CnmoocsService.new.search_resources params
end
desc " 查找用户"
params do
requires :mail, type: String, desc: "邮箱地址"
end
get 'find_user' do
CnmoocsService.new.find_user params
end
desc "创建用户"
params do
requires :mail, type: String, desc: "邮箱地址"
requires :name, type: String, desc: "昵称"
requires :password, type: String, desc: "密码"
end
post "create_user" do
CnmoocsService.new.create_user params
end
desc "远程登录"
params do
requires :mail, type: String, desc: "邮箱地址"
requires :password, type: String, desc: "密码"
end
get "login_educoder" do
CnmoocsService.new.login_educoder params
end
end
end
end
end

@ -132,16 +132,6 @@ class ApplicationController < ActionController::Base
end
end
DCODES = %W(2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z)
# 随机生成字符
def generates_identifier(container, num)
code = DCODES.sample(num).join
while container.exists?(identifier: code) do
code = DCODES.sample(num).join
end
code
end
def ec_public_auth major_school
unless User.current.admin? || major_school.template_major || major_school.school.users.where(:id => User.current.id).count > 0 ||
major_school.ec_major_school_users.where(:user_id => User.current.id).count > 0 ||

@ -122,6 +122,7 @@ class EcMajorSchoolsController < ApplicationController
requirement_vs_objective_url: "#{requirement_vs_objective_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id)}",
requirement_vs_standard: "#{requirement_vs_standard_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id)}",
requirement_vs_courses: "#{requirement_vs_courses_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id)}",
students_url: student_lists_ec_major_school_ec_year_path(@year, ec_major_school_id: @year.ec_major_school_id),
go_back_url: ec_major_school_path(major),
ec_course_support_setting_url: ec_course_support_setting_url,
ec_course_reach_setting_url: ec_course_reach_setting_url,

@ -17,18 +17,11 @@ class EcYearsController < ApplicationController
# 添加年份
def create
@major_school = EcMajorSchool.find(params[:ec_major_school_id])
ec_years = @major_school.ec_years.pluck(:year)
exist_year = ec_years.include?(params[:year].to_i)
if exist_year
if @major_school.ec_years.exists?(year: params[:year].to_i)
@status = -1
else
prev_year = "#{params[:year].to_i - 1}"
prev_ec_year = @major_school.ec_years.where(:year => prev_year).first
if prev_ec_year.blank?
EcYear.create!(:year => params[:year], :ec_major_school_id => @major_school.id)
else
copy_year(prev_ec_year, params[:year])
end
service = CopyEcYearService.new(@major_school, params[:year].to_i)
service.call
@status = 1
end
@major_manager = true
@ -246,7 +239,7 @@ class EcYearsController < ApplicationController
template_file = EcTemplate.find_by_name "课程列表导入模板"
if template_file.present?
file = template_file.attachments.first
@file_url = "/attachments/download/#{file.id}/#{file.filename}"
@file_url = '' #"/attachments/download/#{file.id}/#{file.filename}"
else
@file_url = "javascript:void(0);"
end
@ -357,236 +350,6 @@ class EcYearsController < ApplicationController
@year = EcYear.find(params[:id])
end
# 复制最新一届下的所有数据. previous_ec_year: 本专业最新一届, new_year: 新建的届别
def copy_year previous_ec_year, new_year
ActiveRecord::Base.transaction do
begin
# 如果是第一次创建届别,则直接创建
if previous_ec_year.blank?
raise("没有界别可以复制")
else
logger.info("############previous_ec_year: #{previous_ec_year.id}")
# 多个中间表需要替换的id
egs_record = [] # 记录ec_graduation_subitems的新旧值 例如: [[prev_egs, new_egs], [...]]
egr_record = [] # 记录ec_graduation_requirements的新旧值, 例如: [[prev_egr, new_egr], [...]]
ec_record = [] # 记录ec_courses
ece_record = [] # 记录ec_course_evaluations
eces_record= [] # 记录ec_course_evaluation_subitems
ect_record = [] # 记录ec_course_targets
# 复制 "届别"
ec_year = EcYear.create!(:year => new_year,
:ec_major_school_id => previous_ec_year.ec_major_school_id,
:calculation_value => previous_ec_year.calculation_value)
# 复制 "毕业要求"
previous_ec_year.ec_graduation_requirements.try(:each) do |pre_egr|
new_egr = EcGraduationRequirement.new
new_egr.attributes = pre_egr.attributes.dup.except("id", "ec_year_id")
new_egr.ec_year_id = ec_year.id
new_egr.save!
egr_record << [pre_egr.id, new_egr.id]
# 复制 "毕业要求子标点"
pre_egr.ec_graduation_subitems.try(:each) do |pre_egs|
new_egs = EcGraduationSubitem.new
new_egs.attributes = pre_egs.attributes.dup.except("id", "ec_graduation_requirement_id")
new_egs.ec_graduation_requirement_id = new_egr.id
new_egs.save!
# 记录新旧对应关系,为之后的中间表做记录
egs_record << [pre_egs.id, new_egs.id]
prev_ersvss = EcRequireSubVsStandard.where(:ec_graduation_subitem_id => pre_egs.id)
prev_ersvss.each do |prev_ersvs|
new_ersvss = EcRequireSubVsStandard.new
new_ersvss.attributes = prev_ersvs.attributes.dup.except("id", "ec_graduation_subitem_id")
new_ersvss.ec_graduation_subitem_id = new_egs.id
new_ersvss.save!
end
end
end
# 复制 "培养目标"
pre_eto = previous_ec_year.ec_training_objective
if pre_eto.present?
new_eto = EcTrainingObjective.new
new_eto.attributes = pre_eto.attributes.dup.except("id", "ec_year_id")
new_eto.ec_year_id = ec_year.id
new_eto.save!
# 复制 "培养目标分项"
pre_eto.ec_training_subitems.try(:each) do |pre_ets|
new_ets = EcTrainingSubitem.new
new_ets.attributes = pre_ets.attributes.dup.except("id", "ec_training_objective_id")
new_ets.ec_training_objective_id = new_eto.id
new_ets.save!
# 复制 "毕业要去 vs 培养目标"
pre_ervsos = EcRequirementVsObjective.where(:ec_training_objective_id => pre_ets.id)
pre_ervsos.each do |ervso|
new_ervso = EcRequirementVsObjective.new
new_ervso.attributes = ervso.attributes.dup.except("id", "ec_training_objective_id", "ec_graduation_requirement_id")
new_ervso.ec_training_objective_id = new_ets.id
new_egr_id = -1
egr_record.each do |egr_id|
if egr_id[0] == ervso.ec_graduation_requirement_id
new_egr_id = egr_id[1]
end
end
raise("找不对应的毕业要求") if new_egr_id == -1
new_ervso.ec_graduation_requirement_id = new_egr_id
new_ervso.save!
end
end
end
# 复制 "课程体系"
previous_ec_year.ec_courses.try(:each) do |pre_ec|
new_ec = EcCourse.create!(name: pre_ec.name, ec_year_id: ec_year.id)
ec_record << [pre_ec.id, new_ec.id]
# 复制 "课程考核标准"
pre_ec.ec_course_evaluations.try(:each) do |pre_ece|
new_ece = EcCourseEvaluation.create!(name: pre_ece.name,
evluation_count: pre_ece.evluation_count,
ec_course_id: new_ec.id,
is_course_type: pre_ece.is_course_type)
ece_record << [pre_ece.id, new_ece.id]
# 复制 "考核分项"
pre_ece.ec_course_evaluation_subitems.try(:each) do |pre_eces|
new_eces = EcCourseEvaluationSubitem.create!(name: pre_eces.name, ec_course_evaluation_id: new_ece.id)
# 记录新旧对应关系,为之后的中间表做记录
eces_record << [pre_eces.id, new_eces.id]
end
end
# 复制 "课程目标"
pre_ec.ec_course_targets.try(:each) do |pre_ect|
new_ect = EcCourseTarget.new
new_ect.attributes = pre_ect.attributes.dup.except("id", "ec_course_id")
new_ect.ec_course_id = new_ec.id
new_ect.save!
# 记录新旧对应关系,为之后的中间表做记录
ect_record << [pre_ect.id, new_ect.id]
# 复制 "课程目标和毕业要求指标点"
pre_ect.ec_graduation_subitem_course_targets.try(:each) do |pre_egsct|
new_egsct = EcGraduationSubitemCourseTarget.new
new_egsct.attributes = pre_egsct.attributes.dup.except("id", "ec_graduation_subitem_id", "ec_course_target_id")
# 寻找对应的new_egs_id
logger.info("############egs_record:#{egs_record}")
logger.info("############ec_graduation_subitem_id: #{pre_egsct.ec_graduation_subitem_id}")
new_egs_id = -1
egs_record.each do |id|
if id[0] == pre_egsct.ec_graduation_subitem_id
new_egs_id = id[1]
end
end
raise("课程目标和毕业要求指标点找不到对应关系.") if new_egs_id == -1
new_egsct.ec_graduation_subitem_id = new_egs_id
new_egsct.ec_course_target_id = new_ect.id
new_egsct.save!
end
# 复制 "课程达成方法"
pre_ect.ec_course_achievement_methods.each do |pre_ecam|
# 寻找对应的 ec_course_id
new_ec_id = -1
new_ece_id = -1
new_eces_id = -1
ec_record.each do |ec_id|
if ec_id[0] == pre_ecam.ec_course_id
new_ec_id = ec_id[1]
end
end
# 寻找对应的ec_course_evaluation_id
ece_record.each do |ece_id|
if ece_id[0] == pre_ecam.ec_course_evaluation_id
new_ece_id = ece_id[1]
end
end
# 寻找对应的ec_course_evaluation_subitem_id
eces_record.each do |eces_id|
if eces_id[0] == pre_ecam.ec_course_evaluation_subitem_id
new_eces_id = eces_id[1]
end
end
new_ecam = EcCourseAchievementMethod.new
new_ecam.attributes = pre_ecam.attributes.dup.except("id", "ec_course_id", "ec_course_evaluation_id",
"ec_course_evaluation_subitem_id", "ec_course_target_id")
new_ecam.ec_course_id = new_ec_id if new_ec_id != -1
new_ecam.ec_course_evaluation_id = new_ece_id if new_ece_id != -1
new_ecam.ec_course_evaluation_subitem_id = new_eces_id if new_eces_id != -1
new_ecam.ec_course_target_id = new_ect.id
new_ecam.save!
# 复制 "课程评价达成关系"
pre_ecam.ec_achievement_evaluation_relates.each do |pre_eaer|
new_eaer = EcAchievementEvaluationRelate.new
new_eaer.attributes = pre_eaer.attributes.dup.except("id", "ec_course_achievement_method_id",
"ec_course_evaluation_subitem_id", "ec_course_target_id")
new_eaer.ec_course_achievement_method_id = new_ecam.id
# 寻找对应的 ec_course_evaluation_subitem_id
new_eces_id = -1
eces_record.each do |eces_id|
if eces_id[0] == pre_eaer.ec_course_evaluation_subitem_id
new_eces_id = eces_id[1]
end
end
new_eaer.ec_course_evaluation_subitem_id = new_eces_id if new_eces_id != -1
# 寻找对应的 ec_course_target_id
new_ect_id = -1
ect_record.each do |ect_id|
if ect_id[0] == pre_eaer.ec_course_target_id
new_ect_id = ect_id[1]
end
end
new_eaer.ec_course_target_id = new_ect_id if new_ect_id != -1
new_eaer.save!
end
end
end
# 复制 "课程支撑"
pre_ec.ec_course_supports.try(:each) do |pre_ecs|
new_ecs = EcCourseSupport.new
new_ecs.attributes = pre_ecs.attributes.dup.except("id", "ec_course_id")
new_ecs.ec_course_id = new_ec.id
new_ecs.save!
# 复制 "课程vs毕业要求"
pre_ecs.ec_graduation_subitem_courses.try(:each) do |pre_egsc|
new_egs_id = -1
egs_record.each do |egs_id|
if egs_id[0] == pre_egsc.ec_graduation_subitem_id
new_egs_id = egs_id[1]
end
end
new_egsc = EcGraduationSubitemCourse.new
new_egsc.attributes = pre_egsc.attributes.dup.except("id", "ec_graduation_subitem_id", "ec_course_support_id")
raise("找不到课程vs毕业要求的关联关系!") if new_egs_id == -1
new_egsc.ec_graduation_subitem_id = new_egs_id
new_egsc.ec_course_support_id = new_ecs.id
new_egsc.save!
end
end
# 复制 "成绩等级设置"
pre_ec.ec_score_levels.try(:each) do |pre_esl|
new_esl = EcScoreLevel.new
new_esl.attributes = pre_esl.attributes.dup.except("id", "ec_course_id")
new_esl.ec_course_id = new_ec.id
new_esl.save!
end
end
end
rescue Exception => e
logger.error("###########error_message: #{e.message}")
raise ActiveRecord::Rollback
end
end
end
# 导出培养目标excel
def export_training_objectives objects
xls_report = StringIO.new

@ -12,11 +12,12 @@ class HomeworkCommonController < ApplicationController
before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy,:start_evaluation_set,
:set_evaluation_attr,:score_rule_set,:alert_forbidden_anonymous_comment,:alert_open_student_works,:open_student_works,
:set_score_open,:alert_score_open_modal,:add_to_homework_bank,:publish_notice,:publish_homework,:end_notice,:end_homework,
:setting,:set_public,:homework_setting,:update_explanation,:cancel_publish, :homework_code_repeat, :review_detail,:move_to_category]
:setting,:set_public,:homework_setting,:update_explanation,:cancel_publish, :homework_code_repeat, :review_detail,:move_to_category,
:rename_modal, :rename_homework]
before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment,
:start_evaluation_set,:set_evaluation_attr,:score_rule_set,:alert_forbidden_anonymous_comment,:alert_open_student_works,
:open_student_works,:add_to_homework_bank,:publish_notice,:end_notice,:publish_homework,:end_homework,:update_explanation,
:cancel_publish, :move_to_category,:homework_setting]
:cancel_publish, :move_to_category,:homework_setting, :rename_homework, :rename_modal]
# before_filter :member_of_course, :only => [:index,:setting]
@ -275,6 +276,19 @@ class HomeworkCommonController < ApplicationController
@groups = paginateHelper @groups, 5
end
def rename_modal
end
def rename_homework
if params[:name].blank?
@notice = true
else
@homework.update_attributes(:name => params[:name].strip)
redirect_to homework_common_index_path(:course => @course.id, :homework_type => @homework.homework_type)
end
end
def setting
@is_new = params[:is_new].to_i if params[:is_new]
@is_empty = @homework.publish_time.nil?

@ -853,7 +853,7 @@ class ManagementsController < ApplicationController
def evaluate_simple
page = params[:page]
@recodes = EvaluateRecord.where("created_at > ?", Time.now - 1.days).reorder("consume_time desc")
@recodes = EvaluateRecord.where("created_at > ?", Time.now - 10000.days).reorder("consume_time desc")
@recodes_count = @recodes.size
@record_pages = Paginator.new @recodes_count, 20, page || 1
@offset ||= @record_pages.offset
@ -2023,7 +2023,7 @@ end
# @schools = School.where(:id =>user_exs.map(&:school_id))
# end
@search = params[:search] # 搜索字
@keyword = params[:keyword].blank? ? "u_name" : params[:keyword] # 根据姓名/课程名搜索
@keyword = params[:keyword].blank? ? "c_name" : params[:keyword] # 根据姓名/课程名搜索
@status = params[:status]
@school_id = params[:school_id]
@ -2044,11 +2044,13 @@ end
if params[:status] && params[:status]!=''
@courses = @courses.where(:is_end => @status.to_i)
end
if "u_name" == @keyword
if "c_name" == @keyword
@courses = @courses.where("name like ?", "%#{@search}%")
elsif "u_name" == @keyword
if @search.blank?
@courses = @courses
else
user_id = User.where("concat(lastname, firstname) like '%#{@search}%'")
# user_id = User.where("concat(lastname, firstname) like '%#{@search}%'")
@courses = @courses.joins("join users u on courses.tea_id = u.id").where("concat(u.lastname, u.firstname) like '%#{@search}%'")
end
elsif "dep_name" == @keyword
@ -4293,7 +4295,7 @@ end
count_row = 1
shixuns = Shixun.where(:id => shixun_ids).includes(discusses: [:user])
sheet1.row(0).concat(["序号", "实训ID", "实训名称", "实训作者", "作者单位", "评论数", "评论内容", "关卡", "评论者", "评论者职业",
"评论者单位", "评论时间", "社区导师是否已回复"])
"评论者单位", "评论时间", "社区导师是否已回复", "我的账号回复内容", "回复时间"])
shixuns.each_with_index do |shixun, i|
discusses = shixun.discusses.where("user_id != ?", 1)
if beginTime.present?
@ -4311,6 +4313,7 @@ end
discusses.each_with_index do |discuss, j|
user = discuss.user
content = discuss.content.gsub(/<img.*\/>/, "【图片评论】").gsub(/!\[\].+\)/, "【图片评论】")
myself_discuss = discuss.children.where(user_id: User.current.id).last
sheet1[count_row, 6] = strip_html content
sheet1[count_row, 7] = "#{discuss.position}"
sheet1[count_row, 8] = user.show_real_name
@ -4318,6 +4321,8 @@ end
sheet1[count_row, 10] = user.school_name
sheet1[count_row, 11] = format_time discuss.created_at
sheet1[count_row, 12] = discuss.children.pluck(:user_id).include?(1) ? "" : ""
sheet1[count_row, 13] = myself_discuss.try(:content)
sheet1[count_row, 14] = myself_discuss ? (format_time myself_discuss.created_at) : ""
count_row += 1
end
#count_row += 1

@ -493,6 +493,7 @@ class MyshixunsController < ApplicationController
return_back_time = format("%.3f", ( t1.to_f - brige_end_time.to_f)).to_f
status = jsonTestDetails['status']
game_id = jsonTestDetails['buildID']
sec_key = jsonTestDetails['sec_key']
logger.info("training_task_status start#1**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}")
resubmit = jsonTestDetails['resubmit']
outPut = tran_base64_decode64(jsonTestDetails['outPut'])
@ -535,7 +536,8 @@ class MyshixunsController < ApplicationController
end
logger.info("#############status: #{status}")
logger.info("#############resubmit: #{resubmit}")
record = EvaluateRecord.where(:identifier => params[:sec_key]).first
logger.info("sec_key is#############resubmit: #{sec_key}")
record = EvaluateRecord.where(:identifier => sec_key).first
logger.info("training_task_status start#3**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}")
# status0表示评测成功

@ -850,7 +850,7 @@ class ShixunsController < ApplicationController
begin
raise "请先绑定邮箱" if User.current.mail.blank?
new_shixun = Shixun.new
new_shixun.attributes = @shixun.attributes.dup.except("id","user_id","visits","gpid","status", "identifier", "homepage_show","git_url")
new_shixun.attributes = @shixun.attributes.dup.except("id","user_id","visits","gpid","status", "identifier", "homepage_show","git_url", "propaedeutics")
new_shixun.user_id = User.current.id
new_shixun.identifier = generate_identifier
new_shixun.status = 0

@ -584,16 +584,16 @@ class StudentWorkController < ApplicationController
@stundet_works = @stundet_works.where(:work_status => @status)
end
@stundet_works = search_work_member @stundet_works, @name
if @stundet_works.size != 0
if @order == "student_id"
@stundet_works = @stundet_works.includes(:user => {:user_extensions => []}).order("user_extensions.student_id #{@b_sort}")
@stundet_works = @stundet_works.joins(:user => {:user_extensions => []}).order("user_extensions.student_id #{@b_sort}")
else
@stundet_works = @stundet_works.order("#{@order} #{@b_sort}")
end
end
@stundet_works = search_work_member @stundet_works, @name
@score = @b_sort == "desc" ? "asc" : "desc"
# @is_focus = params[:is_focus] ? params[:is_focus].to_i : 0
# 消息传过来的ID
@ -615,6 +615,7 @@ class StudentWorkController < ApplicationController
_index
@stundet_works = paginateHelper @stundet_works, @limit
@members = @course.members.select([:user_id, :course_group_id])
if @stundet_works.size != 0
@stundet_works = if @homework.homework_type == 1
@stundet_works.includes(:student_works_scores, [user: :user_extensions])
@ -623,7 +624,6 @@ class StudentWorkController < ApplicationController
elsif @homework.homework_type == 4
@stundet_works.includes(:student_works_scores, [myshixun: :games], [user: :user_extensions])
end
@members = @course.members.where(user_id: @stundet_works.pluck(:user_id)).select([:user_id, :course_group_id])
end
respond_to do |format|
format.js

@ -1187,7 +1187,9 @@ module ApplicationHelper
end
res
rescue Exception => e
Rails.logger.error("post failed! #{e}")
Rails.logger.error("post failed! #{e.message}")
# 增加错误栈信息
e.backtrace.each { |msg| Rails.logger.error("post_backtrace: #{msg}") }
raise("实训云平台繁忙(繁忙等级:#{status}")
end
end
@ -1198,7 +1200,7 @@ module ApplicationHelper
res = Net::HTTP.get_response(uri).body
res = JSON.parse(res)
rescue => e
logger.error("get response failed ! #{e}")
logger.error("get response failed ! #{e.message}")
raise("实训云平台繁忙繁忙等级84")
end
end
@ -6578,7 +6580,7 @@ def update_shixun_work_status homework
myshixuns = Myshixun.where(:shixun_id => shixun.id, :user_id => student_works.map(&:user_id))
myshixuns.each do |myshixun|
work = student_works.where(:user_id => myshixun.user_id).first
member = homework.course.members.find_by(:user_id => work.user_id)
member = homework.course.members.find_by_user_id(work.user_id)
setting_time = homework_group_setting homework, member.try(:course_group_id)
games = myshixun.games.where(:challenge_id => challeng_ids)
myshixun_endtime = games.select{|game| game.status == 2}.size == games.size ? games.map(&:end_time).max : nil

@ -9,4 +9,7 @@ class EcGraduationSubitem < ActiveRecord::Base
# 课程目标配置
has_many :ec_course_targets, :through => :ec_graduation_subitem_course_targets
has_many :ec_graduation_subitem_course_targets, :dependent => :destroy
has_many :ec_require_sub_vs_standards
has_many :ec_graduation_standards, through: :ec_require_sub_vs_standards
end

@ -1,3 +1,6 @@
class EcRequireSubVsStandard < ActiveRecord::Base
attr_accessible :ec_graduation_standard_id, :ec_graduation_subitem_id, :status
belongs_to :ec_graduation_standard
belongs_to :ec_graduation_subitem
end

@ -1,3 +1,5 @@
class EcRequirementVsObjective < ActiveRecord::Base
attr_accessible :ec_graduation_requirement_id, :ec_training_objective_id, :status
belongs_to :ec_graduation_requirement
belongs_to :ec_training_subitem
end

@ -1,4 +1,5 @@
class EcTrainingSubitem < ActiveRecord::Base
belongs_to :ec_training_objective
has_many :ec_requirement_vs_objectives, foreign_key: :ec_training_objective_id
end

@ -16,4 +16,8 @@ class EcYear < ActiveRecord::Base
# 课堂配置
has_many :ec_courses, :dependent => :destroy
acts_as_attachable
def prev_year
ec_major_school.ec_years.find_by_year(year - 1)
end
end

@ -16,6 +16,7 @@ class School < ActiveRecord::Base
has_many :ec_majors, :through => :ec_major_schools
has_many :ec_major_schools, :dependent => :destroy
has_one :ec_template_major, conditions: 'template_major = 1', class_name: 'EcMajorSchool'
has_many :partners, :dependent => :destroy
has_many :customers, :dependent => :destroy

@ -0,0 +1,89 @@
class CnmoocsService
include ApplicationHelper
include GamesHelper
def get_resources_data params
page = params[:pageNo].to_i
limit = params[:pageSize] || 16
offset = page * limit.to_i
shixuns = Shixun.select([:id, :identifier, :name, :myshixuns_count, :averge_star, :challenges_count, :trainee]).
where(status: 2, hidden: 0)
shixun_count = shixuns.count
pageCount = ((shixun_count / limit.to_f) == (shixun_count / limit)) ? (shixun_count / limit) : ((shixun_count / limit) + 1)
Rails.logger.info("#####{pageCount}")
Rails.logger.info("#####{limit}")
shixuns = shixuns.order("myshixuns_count desc").offset(offset).limit(limit)
shixun_list = shixun_data shixuns
{error: 0, messages: "请求成功",
page: {count: shixuns.count, totalCount: shixun_count, pageNo: page, pageSize: limit, pageCount: pageCount},
data: shixun_list }
end
def search_resources params
page = params[:pageNo].to_i
limit = params[:pageSize] || 16
offset = page * limit.to_i
shixuns = Shixun.select([:id, :identifier, :name, :myshixuns_count, :averge_star, :challenges_count, :trainee]).
where(status: 2, hidden: 0).where("name like ?", "%#{params[:name]}%")
shixun_count = shixuns.count
pageCount = ((shixun_count / limit.to_f) == (shixun_count / limit)) ? (shixun_count / limit) : ((shixun_count / limit) + 1)
shixuns = shixuns.order("myshixuns_count desc").offset(offset).limit(limit)
shixun_list = shixun_data shixuns
{error: 0, messages: "请求成功",
page: {count: shixuns.count, totalCount: shixun_count, pageNo: page, pageSize: limit, pageCount: pageCount},
data: shixun_list }
end
def find_user params
user = User.find_by_mail params[:mail]
if user
{error: 0, messages: "找到用户"}
else
{error: -1, messages: "找不到用户"}
end
end
def create_user params
user = User.find_by_mail params[:mail]
if user.blank?
ActiveRecord::Base.transaction do
# 如果Educoder中已存在与该OpenI用户的邮箱相同的用户则会直接跳转到登录educoder的登录页面
user = User.new(lastname: params[:name], mail: params[:mail], mail_notification: email)
user.login = generate_login('m')
user.password = params[:password]
user.certification = 1
user.save!
UserExtensions.create!(user_id: user.id, school_id: School.first.id, identity: 4, gender: 0)
end
{error: 0, messages: "创建成功"}
else
{error: -1, messages: "邮箱已经存在,请直接使用邮箱登录"}
end
end
def login_educoder params
user, last_login_on = User.try_to_login(params[:mail], params[:password])
if user
self.logged_user = user
{error: 0, messages: "登录成功"}
else
{error: -1, messages: "登录失败,请检查邮箱和密码是否正确"}
end
end
private
def shixun_data shixuns
shixun_list = []
shixuns.includes(:tag_repertoires).each do |shixun|
tag_name = shixun.tag_repertoires.first.try(:name)
level = %W(初级 中级 高级 顶级)[shixun.trainee - 1]
shixun_list << {identifier: shixun.identifier, name: shixun.name, students_count: shixun.myshixuns_count,
challenges_count: shixun.challenges_count, score_info: shixun.averge_star, level: level}
end
{resouces: shixun_list}
end
end

@ -0,0 +1,344 @@
class CopyEcYearService
attr_reader :major_school, :to_year
def initialize(major_school, year)
@major_school = major_school
@to_year = major_school.ec_years.new(year: year)
end
def call
if from_year.blank?
to_year.save!
return to_year
end
# 专业第一次创建届别时复制示例专业2017届
ActiveRecord::Base.transaction do
copy_ec_year!
copy_graduation_requirement!
copy_training_objective!
new_major_school? ? copy_template_ec_course! : copy_ec_courses!
end
to_year
end
private
def new_major_school?
@_new_major ||= major_school.ec_years.count.zero?
end
def from_year
@_from_year ||= new_major_school? ? template_major_year : to_year.prev_year
end
def template_major_year
EcYear.joins(:ec_major_school).where(ec_major_schools: { template_major: true }).find_by_year('2017')
end
def copy_ec_year!
to_year.calculation_value = from_year.calculation_value
to_year.save!
end
def copy_graduation_requirement!
requirements = from_year.ec_graduation_requirements.includes(ec_graduation_subitems: :ec_require_sub_vs_standards)
requirements.each do |requirement|
to_requirement = to_year.ec_graduation_requirements.new
to_requirement.attributes = requirement.attributes.except('id', 'ec_year_id', 'created_at', 'updated_at')
to_requirement.save!
# 记录对应关系,创建支撑时使用
graduation_requirement_map[requirement.id] = to_requirement.id
copy_graduation_subitems(requirement, to_requirement)
end
end
def copy_graduation_subitems(requirement, to_requirement)
requirement.ec_graduation_subitems.each do |item|
to_item = to_requirement.ec_graduation_subitems.new
to_item.attributes = item.attributes.except('id', 'ec_graduation_requirement_id', 'created_at', 'updated_at')
to_item.save!
# 记录对应关系,创建支撑时使用
graduation_subitem_map[item.id] = to_item.id
copy_requirement_standard_supports!(item, to_item)
end
end
def copy_requirement_standard_supports!(graduation_subitem, to_graduation_subitem)
graduation_subitem.ec_require_sub_vs_standards.each do |support|
to_support = to_graduation_subitem.ec_require_sub_vs_standards.new
to_support.attributes = support.attributes.except('id', 'ec_graduation_subitem_id', 'created_at', 'updated_at')
to_support.save!
end
end
def copy_training_objective!
training_objective = from_year.ec_training_objective
return if training_objective.blank?
attributes = training_objective.attributes.except('id', 'ec_year_id', 'created_at', 'updated_at')
to_training_objective = to_year.create_ec_training_objective!(attributes)
copy_training_subitems!(training_objective, to_training_objective)
end
def copy_training_subitems!(training_objective, to_training_objective)
training_subitems = training_objective.ec_training_subitems.includes(:ec_requirement_vs_objectives)
training_subitems.each do |item|
to_item = to_training_objective.ec_training_subitems.new
to_item.attributes = item.attributes.except('id', 'ec_training_objective_id', 'created_at', 'updated_at')
to_item.save!
copy_requirement_vs_objectives!(item, to_item)
end
end
def copy_requirement_vs_objectives!(training_item, to_training_item)
training_item.ec_requirement_vs_objectives.each do |support|
to_support = to_training_item.ec_requirement_vs_objectives.new(status: support.status)
to_support.ec_graduation_requirement_id = graduation_requirement_map[support.ec_graduation_requirement_id]
to_support.save!
end
end
def copy_template_ec_course!
course = from_year.ec_courses.includes(
:ec_score_levels,
ec_course_evaluations: :ec_course_evaluation_subitems,
ec_course_targets: :ec_graduation_subitem_course_targets,
ec_course_achievement_methods: :ec_achievement_evaluation_relates,
ec_course_supports: :ec_graduation_subitem_courses
).find_by_name('数据库原理')
to_course = to_year.ec_courses.new
to_course.attributes = course.attributes.except('id', 'ec_year_id', 'created_at', 'updated_at')
to_course.save!
course_map[course.id] = to_course.id
copy_course_evaluations!(course, to_course)
copy_course_targets!(course, to_course)
copy_course_achievement_methods!(course, to_course)
copy_ec_course_supports!(course, to_course)
copy_score_levels!(course, to_course)
# 复制示例时需要复制学生和成绩数据
copy_year_students!
end
def copy_ec_courses!
courses = from_year.ec_courses.includes(
:ec_score_levels,
ec_course_evaluations: :ec_course_evaluation_subitems,
ec_course_targets: :ec_graduation_subitem_course_targets,
ec_course_achievement_methods: :ec_achievement_evaluation_relates,
ec_course_supports: :ec_graduation_subitem_courses
)
courses.each do |course|
to_course = to_year.ec_courses.new
to_course.attributes = course.attributes.except('id', 'ec_year_id', 'created_at', 'updated_at')
to_course.save!
course_map[course.id] = to_course.id
copy_course_evaluations!(course, to_course)
copy_course_targets!(course, to_course)
copy_course_achievement_methods!(course, to_course)
copy_ec_course_supports!(course, to_course)
copy_score_levels!(course, to_course)
end
end
def copy_course_evaluations!(course, to_course)
course.ec_course_evaluations.each do |evaluation|
to_evaluation = to_course.ec_course_evaluations.new
to_evaluation.attributes = evaluation.attributes.except('id', 'ec_course_id', 'created_at', 'updated_at')
to_evaluation.save!
course_evaluation_map[evaluation.id] = to_evaluation.id
copy_course_evaluation_subitems!(evaluation, to_evaluation)
end
end
def copy_course_evaluation_subitems!(evaluation, to_evaluation)
evaluation.ec_course_evaluation_subitems.each do |item|
to_item = to_evaluation.ec_course_evaluation_subitems.new
to_item.attributes = item.attributes.except('id', 'ec_course_evaluation_id', 'created_at', 'updated_at')
to_item.save!
course_evaluation_subitem_map[item.id] = to_item.id
end
end
def copy_course_targets!(course, to_course)
course.ec_course_targets.each do |target|
to_target = to_course.ec_course_targets.new
to_target.attributes = target.attributes.except('id', 'ec_course_id', 'created_at', 'updated_at')
to_target.save!
course_target_map[target.id] = to_target.id
copy_graduation_subitem_course_targets!(target, to_target)
end
end
def copy_graduation_subitem_course_targets!(target, to_target)
target.ec_graduation_subitem_course_targets.each do |support|
to_support = to_target.ec_graduation_subitem_course_targets.new
to_support.attributes = support.attributes.except('id', 'ec_course_target_id', 'ec_graduation_subitem_id', 'created_at', 'updated_at')
to_support.ec_graduation_subitem_id = graduation_subitem_map[support.ec_graduation_subitem_id]
to_support.save!
end
end
def copy_course_achievement_methods!(course, to_course)
course.ec_course_achievement_methods.each do |from|
to = to_course.ec_course_achievement_methods.new
to.attributes = from.attributes.except('id', 'ec_course_id', 'ec_course_target_id', 'ec_course_evaluation_id',
'ec_course_evaluation_subitem_id', 'created_at', 'updated_at')
to.ec_course_target_id = course_target_map[from.ec_course_target_id]
to.ec_course_evaluation_id = course_evaluation_map[from.ec_course_evaluation_id]
to.ec_course_evaluation_subitem_id = course_evaluation_subitem_map[from.ec_course_evaluation_subitem_id]
to.save!
copy_achievement_evaluation_relates!(from, to)
end
end
def copy_achievement_evaluation_relates!(method, to_method)
method.ec_achievement_evaluation_relates.each do |relate|
to_relate = to_method.ec_achievement_evaluation_relates.new
to_relate.attributes = relate.attributes.except('id', 'ec_course_achievement_method_id', 'ec_course_target_id',
'ec_course_evaluation_subitem_id', 'created_at', 'updated_at')
to_relate.ec_course_target_id = course_target_map[relate.ec_course_target_id]
# 可能不存在,所以为 -1
to_relate.ec_course_evaluation_subitem_id = course_evaluation_subitem_map[relate.ec_course_evaluation_subitem_id] || -1
to_relate.save!
achievement_evaluation_relates_map[relate.id] = to_relate.id
end
end
def copy_ec_course_supports!(course, to_course)
course.ec_course_supports.each do |support|
to_support = to_course.ec_course_supports.new
to_support.attributes = support.attributes.except('id', 'ec_course_id', 'created_at', 'updated_at')
to_support.save!
copy_graduation_subitem_courses!(support, to_support)
end
end
def copy_graduation_subitem_courses!(course_support, to_course_support)
course_support.ec_graduation_subitem_courses.each do |item|
to_item = to_course_support.ec_graduation_subitem_courses.new
to_item.attributes = item.attributes.except('id', 'ec_course_support_id', 'ec_graduation_subitem_id',
'created_at', 'updated_at')
to_item.ec_graduation_subitem_id = graduation_subitem_map[item.ec_graduation_subitem_id]
to_item.save!
end
end
def copy_score_levels!(course, to_course)
course.ec_score_levels.each do |level|
to_level = to_course.ec_score_levels.new
to_level.attributes = level.attributes.except('id', 'ec_course_id', 'created_at', 'updated_at')
to_level.save!
end
end
def copy_year_students!
students = from_year.ec_year_students.includes(:ec_student_achievements, :ec_course_student_scores, :ec_student_score_targets)
students.each do |student|
to_student = to_year.ec_year_students.new
to_student.attributes = student.attributes.except('id', 'ec_year_id', 'created_at', 'updated_at')
to_student.save!
copy_student_achievements!(student, to_student)
copy_course_student_scores!(student, to_student)
copy_student_score_targets!(student, to_student)
end
end
def copy_student_achievements!(student, to_student)
student.ec_student_achievements.each do |achievement|
to_achievement = to_student.ec_student_achievements.new
to_achievement.attributes = achievement.attributes.except('id', 'ec_year_student_id', 'ec_course_evaluation_id',
'ec_course_evaluation_subitem_id', 'created_at', 'updated_at')
to_achievement.ec_course_evaluation_id = course_evaluation_map[achievement.ec_course_evaluation_id]
to_achievement.ec_course_evaluation_subitem_id = course_evaluation_subitem_map[achievement.ec_course_evaluation_subitem_id]
to_achievement.save!
end
end
def copy_course_student_scores!(student, to_student)
student.ec_course_student_scores.each do |score|
to_score = to_student.ec_course_student_scores.new
to_score.attributes = score.attributes.except('id', 'ec_year_student_id', 'ec_course_id', 'created_at', 'updated_at')
to_score.ec_course_id = course_map[score.ec_course_id]
to_score.save!
course_student_score_map[score.id] = to_score.id
end
end
def copy_student_score_targets!(student, to_student)
student.ec_student_score_targets.each do |target|
to_target = to_student.ec_student_score_targets.new
to_target.attributes = target.attributes.except('id', 'ec_course_id', 'ec_course_student_score_id',
'ec_course_target_id', 'ec_year_student_id', 'eaer_id',
'created_at', 'updated_at')
to_target.ec_course_id = course_map[target.ec_course_id]
to_target.ec_course_student_score_id = course_student_score_map[target.ec_course_student_score_id]
to_target.ec_course_target_id = course_target_map[target.ec_course_target_id]
to_target.eaer_id = achievement_evaluation_relates_map[target.eaer_id]
to_target.save!
end
end
def graduation_requirement_map
@_graduation_requirement_map ||= {}
end
def graduation_subitem_map
@_graduation_subitem_map ||= {}
end
def course_map
@_course_map ||= {}
end
def course_evaluation_map
@_course_evaluation_map ||= {}
end
def course_evaluation_subitem_map
@_course_evaluation_subitem_map ||= {}
end
def achievement_evaluation_relates_map
@_achievement_evaluation_relates_map ||= {}
end
def course_target_map
@_course_target_map ||= {}
end
def course_student_score_map
@_course_student_score_map ||= {}
end
end

@ -347,10 +347,11 @@ class GamesService
rev = params[:rev] ? params[:rev] : "master"
content_modified = 0
ActiveRecord::Base.transaction do
sec_key = generates_identifier(EvaluateRecord, 10)
# params[:evaluate] 实训评测时更新必须给的参数,需要依据该参数做性能统计,其它类型的更新可以跳过
# 自动保存的时候evaluate为0点评测的时候为1
if params[:evaluate] == 1
sec_key = generates_identifier(EvaluateRecord, 10)
record = EvaluateRecord.create!(:user_id => current_user.id, :shixun_id => @myshixun.shixun.id,
:game_id => @game.id, :identifier => sec_key)
Rails.logger.warn("##game is is #{@game.id}, record id is #{record.id}, time is**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}")
@ -370,7 +371,8 @@ class GamesService
end
if content != last_content
content_modified = 1
code_file = @g.edit_file(@myshixun.gpid, current_user.login, :content => content, :file_path => path, :branch_name => "master", :commit_message => "auto commit")
code_file = @g.edit_file(@myshixun.gpid, current_user.login, :content => content, :file_path => path, :branch_name => "master",
:commit_message => (params[:evaluate] == 1 ? "commit by author" : "auto commit" ))
end
# REDO是否有读写分离的问题
if record.present?
@ -387,7 +389,7 @@ class GamesService
if content != last_content && code_file.blank?
raise("update file failed")
else
return {:success => "success", :resubmit => resubmit ,:content_modified => content_modified, sec_key: record.identifier}
return {:success => "success", :resubmit => resubmit ,:content_modified => content_modified, sec_key: record.try(:identifier)}
end
end
rescue Exception => e
@ -800,6 +802,7 @@ class GamesService
# 轮询获取状态
# resubmit是在file_update中生成的从game_build中传入的
def game_status params, current_user
Rails.logger.info("sec_key is #{params[:sec_key]}**1")
game = Game.find_by_identifier(params[:identifier])
resubmit_identifier = game.resubmit_identifier
# 如果没有超时并且正在评测中
@ -811,6 +814,7 @@ class GamesService
return {:running_code_status => running_code_status, :running_code_message => running_code_message}
end
Rails.logger.info("sec_key is #{params[:sec_key]}**2")
Rails.logger.info("##### resubmit_identifier is #{resubmit_identifier}")
port = params[:port]
score = 0
@ -837,6 +841,7 @@ class GamesService
end
end
Rails.logger.info("sec_key is #{params[:sec_key]}**3")
# 实训的最大评测次数,这个值是为了优化查询,每次只取最新的最新一次评测的结果集
max_query_index = game.query_index - 1
# 区分评测过未评测过,未评测过按需求取数据
@ -853,7 +858,7 @@ class GamesService
# 能进入到此处肯定是已经返回了结果也就是说outputs中肯定有了数据
Rails.logger.info("sec_key is #{params[:sec_key]}**4")
test_sets_count = qurey_test_sets.size
# had_test = Output.where(:game_id => game.id, :query_index => max_query_index)
# had_test_count = had_test.count
@ -880,6 +885,7 @@ class GamesService
web_route = game_challenge.try(:web_route)
mirror_name = shixun.mirror_name
Rails.logger.info("sec_key is #{params[:sec_key]}**5")
# 轮询结束,更新评测耗时
e_record = EvaluateRecord.where(:identifier => params[:sec_key]).first
if game_status == 0 || game_status == 2
@ -897,12 +903,14 @@ class GamesService
# 实训制作者当前拥有的金币
grade = User.where(:id => game.user_id).pluck(:grade).first
Rails.logger.info("sec_key is #{params[:sec_key]}**6")
# 高性能取上一关、下一关
prev_game = Game.prev_identifier(shixun.id, game.myshixun_id, game_challenge.position)
next_game = Game.next_game(shixun.id, game.myshixun_id, game_challenge.position).try(:identifier)
output_hash = {:test_sets => test_sets, :had_test_count => test_sets_count, :test_sets_count => test_sets_count, :had_passed_testsests_error_count => had_passed_testsests_error_count}
Rails.logger.info("sec_key is #{params[:sec_key]}**7")
return {:grade => grade, :gold => score, :experience => experience, :status => game_status, :had_done => had_done,
:position => game_challenge.position, :port => port, :power => power, :record => record,
:mirror_name => mirror_name, :picture => picture, :web_route => web_route, :latest_output => latest_output,
@ -1039,6 +1047,15 @@ class GamesService
end
private
DCODES = %W(2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z)
# 随机生成字符
def generates_identifier(container, num)
code = DCODES.sample(num).join
while container.exists?(identifier: code) do
code = DCODES.sample(num).join
end
code
end
def format_answer_list games
user_info = []

@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><meta name="renderer" content="webkit"/><meta name="force-rendering" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>Educoder</title><script type="text/javascript">window.__isR=!0</script><link rel="stylesheet" href="/react/build/css/css_min_all.css"><link rel="stylesheet" href="/assets/iconfont/iconfont.css"><link href="/react/build/./static/css/main.42f9c555.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="md_div" style="display:none"></div><div id="root" class="page -layout-v -fit"></div><div id="picture_display" style="display:none"></div><script type="text/javascript" src="/react/build/js/js_min_all.js"></script><script type="text/javascript" src="/assets/kindeditor/kindeditor.js"></script><script type="text/javascript" src="/react/build/js/create_kindeditor.js"></script><script type="text/javascript" src="/javascripts/educoder/edu_application.js"></script><script type="text/javascript" src="/react/build/./static/js/main.5036f33d.js"></script></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><meta name="renderer" content="webkit"/><meta name="force-rendering" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>Educoder</title><script type="text/javascript">window.__isR=!0</script><link rel="stylesheet" href="/react/build/css/css_min_all.css"><link rel="stylesheet" href="/assets/iconfont/iconfont.css"><link href="/react/build/./static/css/main.0568ccaf.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="md_div" style="display:none"></div><div id="root" class="page -layout-v -fit"></div><div id="picture_display" style="display:none"></div><script type="text/javascript" src="/react/build/js/js_min_all.js"></script><script type="text/javascript" src="/assets/kindeditor/kindeditor.js"></script><script type="text/javascript" src="/react/build/js/create_kindeditor.js"></script><script type="text/javascript" src="/javascripts/educoder/edu_application.js"></script><script type="text/javascript" src="/react/build/./static/js/main.dfa4489a.js"></script></body></html>

@ -15,12 +15,12 @@
<%= graduation_requirements > 0 ? graduation_requirements : @btn_text %>
</a>
</span>
<span class="column-5 fl">
<% students = year.ec_year_students.count %>
<a href="<%= student_lists_ec_major_school_ec_year_path(year, :ec_major_school_id => @major_school) %>" class="<%= students > 0 ? '' : 'color-blue' %>">
<%= students > 0 ? students : @btn_text %>
</a>
</span>
<!--<span class="column-5 fl">-->
<!--<%# students = year.ec_year_students.count %>-->
<!--<a href="<%#= student_lists_ec_major_school_ec_year_path(year, :ec_major_school_id => @major_school) %>" class="<%#= students > 0 ? '' : 'color-blue' %>">-->
<!--<%#= students > 0 ? students : @btn_text %>-->
<!--</a>-->
<!--</span>-->
<span class="column-5 fl">
<% courses = year.ec_courses.count %>
<a href="<%= ec_course_setting_ec_major_school_ec_year_path(year, :ec_major_school_id => @major_school) %>" class="<%= courses > 0 ? '' : 'color-blue' %>">

@ -4,21 +4,26 @@
</p>
<div>
<div style="position: relative">
<p class="clearfix padding20-30 bor-bottom-greyE edu-back-white">
<span class="fl font-18"><%= @major.name %></span>
<ul class="clearfix padding20-30 bor-bottom-greyE edu-back-white">
<li class="fl">
<p class="font-18 clearfix">
<span class="fl"><%= @major.name %></span>
<% if @major.schools && User.current.admin? %>
<i class="iconfont icon-youjiantou font-14 newxiajiantou fl ml20" ></i>
<ul class="edu-menu-list" id="ecmajorschools">
<% @major.schools.each do |school| %>
<% ec_major_school = school.ec_major_schools.where(:ec_major_id => @major.id).first %>
<li><a href="<%= ec_major_school_path(ec_major_school) %>" target="_blank" ><%= school.name %></a></li>
<% end %>
</ul>
<% end %>
</p>
<p><span class="color-grey-9 mr10">请选择添加参与认证的学生界别,多个界别分次添加</span><a href="javascript:void(0)" onclick="elasticLayer(3528);" class="color-blue">查看详情</a></p>
</li>
<% if @major_manager %>
<a href="javascript:void(0)" class="fr white-btn edu-blueback-btn mt4" onclick="addAcademicYear();">添加届别</a>
<a href="javascript:void(0)" class="fr white-btn edu-blueback-btn mt25" onclick="addAcademicYear();">添加届别</a>
<% end %>
<% if @major.schools && User.current.admin? %>
<i class="iconfont icon-youjiantou font-14 newxiajiantou" ></i>
<ul class="edu-menu-list" id="ecmajorschools">
<% @major.schools.each do |school| %>
<% ec_major_school = school.ec_major_schools.where(:ec_major_id => @major.id).first %>
<li><a href="<%= ec_major_school_path(ec_major_school) %>" target="_blank" ><%= school.name %></a></li>
<% end %>
</ul>
<% end %>
</p>
</ul>
</div>
<div class="clearfix padding20-30 edu-back-white">
<div class="fr" id="pollingPanel">
@ -31,7 +36,7 @@
<span class="column-1">届别</span>
<span class="column-5 fl">培养目标</span>
<span class="column-5 fl">毕业要求</span>
<span class="column-5 fl">学生</span>
<!--<span class="column-5 fl">学生</span>-->
<span class="column-5 fl">课程体系</span>
<span class="column-6 fl lineh-20">课程目标<br/>(达成情况)</span>
<span class="column-5 fl edu-txt-center lineh-20">毕业要求指标点<br/>(达成情况)</span>

@ -1,9 +1,10 @@
<!-------------------------------------课程列表begin---------------------------------->
<div class="educontent mb50">
<%= render :partial => "ecs/ec_top_navigation" %>
<p class="clearfix padding20-30 bor-bottom-greyE edu-back-white">
<span class="fl font-18">课程体系(<%= @ec_courses.count %></span>
</p>
<ul class="clearfix padding20-30 bor-bottom-greyE edu-back-white">
<li class="font-18">课程体系(<%= @ec_courses.count %></li>
<p><span class="color-grey-9 mr10">提供模板支持课程信息导入,亦可直接新增课程;并继续完成每门课程的评估机制配置</span><a href="javascript:void(0)" onclick="elasticLayer(3533);" class="color-blue">查看详情</a></p>
</ul>
<p class="padding20-30 edu-back-white clearfix">
<span class="mr30">温馨提醒:请下载课程模板(<a href="<%= @file_url %>" class="color-green"><i class="iconfont icon-fujian mr5 color-green font-16"></i>点击下载</a>),将本届所有参与认证的课程名称导入系统,以便录入教学活动相关数据</span>
<%= file_field_tag 'attachments[dummy][file]',

@ -10,12 +10,15 @@
<div class="educontent mb50">
<%= render :partial => "ecs/ec_top_navigation" %>
<div class="edu-back-white minH-560 mb50 pb20">
<p class="clearfix padding20-30 bor-bottom-greyE">
<span class="fl font-18">毕业要求(及其指标点)</span>
<ul class="clearfix padding20-30 bor-bottom-greyE">
<li class="fl">
<p class="font-18">毕业要求(及其指标点)</p>
<p><span class="color-grey-9 mr10">请结合本专业特色修改毕业要求文字描述及指标点需完全覆盖12项通用标准</span><a href="javascript:void(0)" onclick="elasticLayer(3530);" class="color-blue">查看详情</a></p>
</li>
<% if @template_major || @ec_major_school.template_major %>
<%=link_to "导出毕业要求", graduation_requirement_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id, :format => 'xls'), :class => "fr white-btn edu-blueback-btn" %>
<%=link_to "导出毕业要求", graduation_requirement_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id, :format => 'xls'), :class => "fr white-btn edu-blueback-btn mt25" %>
<% end %>
</p>
</ul>
<div class="ListTableLine">
<p class="clearfix">
<span class="column-second">指标点</span>

@ -1,12 +1,15 @@
<div class="educontent mb50">
<%= render :partial => "ecs/ec_top_navigation" %>
<div class="minH-560 edu-back-white mb50">
<p class="clearfix padding20-30 bor-bottom-greyE">
<span class="fl font-18">毕业要求对培养目标的支撑</span>
<ul class="clearfix padding20-30 bor-bottom-greyE">
<li class="fl">
<p class="font-18">毕业要求对培养目标的支撑</p>
<p><span class="color-grey-9 mr10">用矩阵图的形式说明本专业毕业要求对培养目标的支撑关系,鼠标左键单击单元格即可</span><a href="javascript:void(0)" onclick="elasticLayer(3531);" class="color-blue">查看详情</a></p>
</li>
<% if @template_major || @ec_major_school.template_major %>
<%=link_to "导出矩阵", requirement_vs_objective_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id, :format => 'xls'), :class => "fr white-btn edu-blueback-btn" %>
<%=link_to "导出矩阵", requirement_vs_objective_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id, :format => 'xls'), :class => "fr white-btn edu-blueback-btn mt25" %>
<% end %>
</p>
</ul>
<div class="padding30">
<p class="clearfix mb20">
<span class="fl mr30"><i class="iconfont icon-gouxuan color-green font-16 mr5"></i>表示支撑</span>

@ -1,12 +1,15 @@
<div class="educontent mb50">
<%= render :partial => "ecs/ec_top_navigation" %>
<div class="minH-560 edu-back-white mb50">
<p class="clearfix padding20-30 bor-bottom-greyE">
<span class="fl font-18">毕业要求对通用标准的支撑</span>
<ul class="clearfix padding20-30 bor-bottom-greyE">
<li class="fl">
<p class="font-18">毕业要求对通用标准的支撑</p>
<p><span class="color-grey-9 mr10">用矩阵图的形式说明本专业毕业要求对12项通用标准的覆盖关系鼠标左键单击单元格即可</span><a href="javascript:void(0)" onclick="elasticLayer(3532);" class="color-blue">查看详情</a></p>
</li>
<% if @template_major || @ec_major_school.template_major %>
<%=link_to "导出矩阵", requirement_vs_standard_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id, :format => 'xls'), :class => "fr white-btn edu-blueback-btn" %>
<%=link_to "导出矩阵", requirement_vs_standard_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id, :format => 'xls'), :class => "fr white-btn edu-blueback-btn mt25" %>
<% end %>
</p>
</ul>
<div class="padding30">
<p class="clearfix mb20">
<span class="fl mr30"><i class="iconfont icon-gouxuan color-green font-16 mr5"></i>表示支撑</span>

@ -2,12 +2,15 @@
<%= render :partial => "ecs/ec_top_navigation" %>
<div class="mb50 mb50">
<p class="edu-back-white clearfix padding20-30 bor-bottom-greyE">
<span class="fl font-18">培养目标</span>
<ul class="edu-back-white clearfix padding20-30 bor-bottom-greyE">
<li class="fl">
<p class=" font-18">培养目标</p>
<p><span class="color-grey-9 mr10">请结合本专业特色修改培养目标文字描述及目标分解</span><a href="javascript:void(0)" onclick="elasticLayer(3529);" class="color-blue">查看详情</a></p>
</li>
<% if @template_major || @ec_major_school.template_major %>
<a href="<%= training_objectives_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id, :format => "xls") %>" class="fr white-btn edu-blueback-btn mt4">导出培养目标</a>
<a href="<%= training_objectives_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id, :format => "xls") %>" class="fr white-btn edu-blueback-btn mt25">导出培养目标</a>
<% end %>
</p>
</ul>
<div class="edu-back-white padding20-30" id="training_objective_contents">
<%= render :partial => "training_objective_contents" %>
</div>

@ -45,12 +45,16 @@
<a class="<%= ['requirement_vs_standard'].include?(params[:action]) ? "ecmarginleft ecTitleFFF ml22":"ecTitle" %>">4</a>
<a class="<%= ['requirement_vs_standard'].include?(params[:action]) ? "ecTitlefontFFF":"ecTitlefont" %>" href="<%= requirement_vs_standard_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id) %>">毕业要求 vs 通用标准</a>
</li>
<li class="<%= ['student_lists'].include?(params[:action]) ? "ecimgs3" : "ecimgs" %>">
<a class="<%= ['student_lists'].include?(params[:action]) ? "ecmarginleft ecTitleFFF ml22":"ecTitle" %>">5</a>
<a class="<%= ['student_lists'].include?(params[:action]) ? "ecTitlefontFFF":"ecTitlefont" %>" href="<%= student_lists_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id) %>">学生</a>
</li>
<li class="<%= ['ec_course_setting'].include?(params[:action]) ? "ecimgs3" : "ecimgs" %>">
<a class="<%= ['ec_course_setting'].include?(params[:action]) ? "ecmarginleft ecTitleFFF ml12":"ecTitle" %>">5</a>
<a class="<%= ['ec_course_setting'].include?(params[:action]) ? "ecmarginleft ecTitleFFF ml12":"ecTitle" %>">6</a>
<a class="<%= ['ec_course_setting'].include?(params[:action]) ? "ecTitlefontFFF":"ecTitlefont" %>" href="<%= ec_course_setting_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id) %>">课程体系</a>
</li>
<li class="<%= ['requirement_vs_course'].include?(params[:action]) ? "ecimgs3" : "ecimgs" %>">
<a class="<%= ['requirement_vs_course'].include?(params[:action]) ? "ecmarginleft ecTitleFFF ml12":"ecTitle" %>">6</a>
<a class="<%= ['requirement_vs_course'].include?(params[:action]) ? "ecmarginleft ecTitleFFF ml12":"ecTitle" %>">7</a>
<a class="<%= ['requirement_vs_course'].include?(params[:action]) ? "ecTitlefontFFF":"ecTitlefont" %>" href="<%= requirement_vs_courses_ec_major_school_ec_year_path(@year, :ec_major_school_id => @year.ec_major_school_id) %>">课程体系 vs 毕业要求</a>
</li>
<li class="ecimgs">

@ -19,12 +19,15 @@
<% end %>
<div class="educontent mb30">
<p class="clearfix padding20-30 bor-bottom-greyE edu-back-white">
<span class="fl font-18">专业列表</span>
<ul class="clearfix padding20-30 bor-bottom-greyE edu-back-white">
<li class="fl">
<p class="font-18">专业列表</p>
<p><span class="color-grey-9 mr10">请添加参与认证的专业名称</span><a href="javascript:void(0)" onclick="elasticLayer(3527);" class="color-blue">查看详情</a></p>
</li>
<% if @is_school_manager %>
<a href="javascript:void(0)" class="fr white-btn edu-blueback-btn" onclick="addNewMajorPanel();">添加专业</a>
<a href="javascript:void(0)" class="fr white-btn edu-blueback-btn mt25" onclick="addNewMajorPanel();">添加专业</a>
<% end %>
</p>
</ul>
<div class="clearfix padding20-30 bor-bottom-greyE edu-back-white">
<span class="fl font-12 mt5">
<span class="color-orange-tip mr3" id="search_major_count"><%= @obj_count %></span>

@ -11,7 +11,8 @@
<div class="fl task-form-100 clearfix" style="box-sizing: border-box; padding-left: 15px;">
<span class="fl mr10 mt3 color-grey3"># <%= get_hw_index(homework_common, @is_teacher, @homework_type) + 1 %></span>
<% homework_curr_status = homework_curr_time(homework_common) %>
<%= link_to homework_common.name.to_s, student_work_index_path(:homework => homework_common.id,:host=> Setting.host_course), :class => "edu-class-inner-list fl color-grey-3"%>
<%= link_to homework_common.name.to_s, student_work_index_path(:homework => homework_common.id,:host=> Setting.host_course),
:id => "homework_name_#{homework_common.id}", :class => "edu-class-inner-list fl color-grey-3"%>
<% unless homework_common.is_public %>
<i id="homework_public_<%= homework_common.id %>" class="fa fa-lock color-grey-c fl mt8 ml15 font-18"></i>
<% end %>
@ -144,6 +145,9 @@
<li>
<%= link_to "设置", student_work_index_path(:homework => homework_common.id, :tab => 4) %>
</li>
<li>
<%= link_to "重命名", rename_modal_homework_common_path(homework_common), :remote => true %>
</li>
<% if homework_common.homework_detail_manual.try(:comment_status) == 0 %>
<li>
<%= link_to '立即发布', publish_notice_homework_common_path(homework_common), :remote => true %>

@ -0,0 +1,30 @@
<div class="task-popup" style="width:460px;">
<div class=" task-popup-title clearfix task-popup-bggrey">
重命名
</div>
<div class="task_popup_con">
<%= form_for "", :url => rename_homework_homework_common_path(@homework), :remote => true, :html => {:id => "rename_shixun_homework_form"} do |f| %>
<div class="df pl20 pr20 mb20 mt10">
<span class="fl pt3">作业名称:</span>
<div class="flex1">
<input type="text" class="input-100-35 greyInput" maxlength="20" value="<%= @homework.name %>" name="name" id="rename_homework_name" placeholder="请输入作业名称"/>
<p class="lineh-20" style="height: 20px;"><span class="color-orange-tip none" id="printNotice">请输入作业名称</span></p>
</div>
</div>
<% end %>
<li class="clearfix mt10 edu-txt-center">
<a href="javascript:void(0);" class="task-btn mr20" onclick="hideModal()">取消</a>
<a href="javascript:void(0);" class="task-btn task-btn-orange" onclick="surePutIn();">确定</a>
</li>
</div>
</div>
<script>
function surePutIn(){
if($("#rename_homework_name").val() == "") {
$("#printNotice").removeClass("none");
} else {
$("#rename_shixun_homework_form").submit();
hideModal();
}
}
</script>

@ -0,0 +1,5 @@
<% if @notice %>
notice_box("作业名称不能为空");
<% else %>
$("#homework_name_<%= @homework.id %>").html(<%= @homework.name %>);
<% end %>

@ -0,0 +1,2 @@
var html = '<%= escape_javascript(render :partial => "homework_common/rename_shixun_homework") %>';
pop_box_new(html, 460, 227);

@ -9,7 +9,13 @@
<%= favicon %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= javascript_include_tag 'educoder/edu_application', 'educoder/edu_shixun','educoder/edu_shixunCommentsStar','educoder/jquery.raty' %>
<%= stylesheet_link_tag "/assets/codemirror/codemirror" %>
<%= stylesheet_link_tag '/editormd/css/editormd.min.css' %>
<!-- TODO md找替代方案 -->
<%= javascript_include_tag '/editormd/lib/marked.min.js', '/editormd/lib/prettify.min.js', '/editormd/lib/raphael.min.js', '/editormd/lib/underscore.min.js', '/editormd/lib/sequence-diagram.min.js',
'/editormd/lib/flowchart.min.js', '/editormd/lib/jquery.flowchart.min.js', '/editormd/editormd.js' %>
<%= javascript_include_tag 'educoder/edu_application', 'educoder/edu_shixun','educoder/edu_shixunCommentsStar','educoder/jquery.raty'%>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/edu-popup','css/edu-common','educoder/edu-main','educoder/edu-all', "css/edu-public", 'css/ketang', 'css/common', 'css/taskstyle', 'css/structure','scm','css/public', 'css/project','css/popup','repository','css/gantt', 'css/calendar', 'css/moduel', 'css/font-awesome', 'css/edu-tooltipster', 'educoder/magic-check','/assets/iconfont/iconfont.css' %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->

@ -37,13 +37,13 @@
<td><%= format_time career.created_at %></td>
<td><%= format_time career.published_at %></td>
<td>
<%# if !career.status %>
<!-- <a href="javascript:void(0)" class="color-grey-6" onclick="post_confirm_box('<%= published_career_managements_path(:id => career.id) %>', '是否确定执行发布操作?')">发布</a>-->
<%# end %>
<!-- <a href="<%#= edit_introduction_career_path(career) %>" class="color-grey-6" target="_blank">编辑</a>-->
<%# if !career.status %>
<!-- <a href="javascript:void(0)" class="color-grey-6" onclick="delete_confirm_box_2('<%= delete_career_managements_path(:id => career.id) %>', '是否确定执行删除操作?')">删除</a>-->
<%# end %>
<% if !career.status %>
<a href="javascript:void(0)" class="color-grey-6" onclick="post_confirm_box('<%= published_career_managements_path(:id => career.id) %>', '是否确定执行发布操作?')">发布</a>
<% end %>
<a href="<%= edit_introduction_career_path(career) %>" class="color-grey-6" target="_blank">编辑</a>
<% if !career.status %>
<a href="javascript:void(0)" class="color-grey-6" onclick="delete_confirm_box_2('<%= delete_career_managements_path(:id => career.id) %>', '是否确定执行删除操作?')">删除</a>
<% end %>
</td>
</tr>
<% end %>

@ -14,6 +14,7 @@
</div>
<select class="task-form-15 task-height-30 fl" style="margin:0px 0px 0px 25px;width: 11%" name="keyword" id="condition_status">
<option value="c_name">课堂名称搜索</option>
<option value="u_name">创建者姓名搜索</option>
<option value="dep_name">创建者单位搜索</option>
</select>

@ -1,54 +1,29 @@
<% if false %>
<style>
.manage_ol ol li{list-style-type: disc;}
</style>
<div class="task-popup" style="width:400px;">
<div class=" task-popup-title clearfix task-popup-bggrey">
<h3 class="fl ">耗时详情</h3>
<a href="javascript:void(0)" id="closeIcon" style="top: -48px;right: -20px;z-index: 100000;"><i class="iconfont icon-shanchudiao"></i></a>
</div>
<div class="task_popup_con manage_ol">
<ol class="pl30">
<li>总耗时:<%= @consume_time %></li>
<li>作品更新:<%= @student_work %></li>
<li>文件更新:<%= @file_update %></li>
<li>中间层总耗时:<%= @brige %></li>
<li class="ml15">pull代码<%= @git_pull %></li>
<li class="ml15">pod启动<%= @create_pod %></li>
<li class="ml15">pod执行<%= @pod_execute %></li>
<li>中间层回传:<%= @return_back %>--中间层出结果传Educoder</li>
<li>前端轮询:<%= @front_js %>--局部数据查询Js轮询</li>
<li>回调结果存储:<%= @test_cases %></li>
</ol>
</div>
</div>
<% end %>
<% if @recodes.present? %>
<div class="edu-con-bg01 mt15" id="evaluate_records_list">
<table class="edu-pop-table edu-txt-center" cellpadding="0" cellspacing="0" style="table-layout: fixed">
<thead>
<tr>
<th width="5%">序号</th>
<th width="10%">总耗时<i class="fa fa-long-arrow-down color-light-green ml5" ></i></th>
<th width="5%">ID</th>
<th width="5%">总耗时<i class="fa fa-long-arrow-down color-light-green ml5" ></i></th>
<th width="5%">作品更新</th>
<th width="5%">文件更新</th>
<th width="10%">中间层总耗时</th>
<th width="5%">pull代码</th>
<th width="5%">pod启动</th>
<th width="5%">pod执行</th>
<th width="10%">中间层回传</th>
<th width="5%">回传时间</th>
<th width="5%">前端轮询</th>
<th width="10%">回调结果存储</th>
<th width="5%">结果存储</th>
<th width="15%">创建时间</th>
<th width="15%">实训名称</th>
<th width="8%">唯一表示</th>
<th width="17%">实训名称</th>
</tr>
</thead>
<tbody>
<% @recodes.each_with_index do |record, index| %>
<% @recodes.each do |record| %>
<tr>
<td><%= index %></td>
<td><%= record.id %></td>
<td><%= record.consume_time %></td>
<td><%= record.student_work %></td>
<td><%= record.file_update %></td>
@ -60,6 +35,7 @@
<td><%= record.front_js %></td>
<td><%= record.test_cases %></td>
<td><%= format_time record.created_at %></td>
<td><%= record.identifier %></td>
<td><%= link_to record.shixun.try(:name), task_path(record.game), :target => "_blank", :title => "#{record.shixun.try(:name)}" %></td>
</tr>
<% end %>

@ -1,3 +1,4 @@
<div class="edu-back-white mb10">
<div class="pt30 pl20 pr20 pb40 bor-bottom-greyE clearfix">
<span class="fl font-16">配置</span>

@ -199,14 +199,11 @@
<a href="javascript:void(0);" id="status_no_limit" class="<%= @status.blank? ? 'check_on' : '' %> pl10 pr10">不限</a>
</span>
<input id="work_status_1" class="magic-checkbox fl" type="checkbox" value="0" name="status[]" <%= !@status.blank? && @status.include?('0') ? 'checked' : '' %>>
<label for="work_status_1" class="fl mr25">未提交(<%= @all_student_works.where(:work_status => 0).count %>
)</label>
<label for="work_status_1" class="fl mr25">未提交(<%= @all_student_works.where(:work_status => 0).count %>)</label>
<input id="work_status_2" class="magic-checkbox fl" type="checkbox" value="1" name="status[]" <%= !@status.blank? && @status.include?('1') ? 'checked' : '' %>>
<label for="work_status_2" class="fl mr25">按时提交(<%= student_works.where(:work_status => 1).count %>
)</label>
<label for="work_status_2" class="fl mr25">按时提交(<%= student_works.where(:work_status => 1).count %>)</label>
<input id="work_status_3" class="magic-checkbox fl" type="checkbox" value="2" name="status[]" <%= !@status.blank? && @status.include?('2') ? 'checked' : '' %>>
<label for="work_status_3" class="fl mr25">延时提交(<%= student_works.where(:work_status => 2).count %>
)</label>
<label for="work_status_3" class="fl mr25">延时提交(<%= student_works.where(:work_status => 2).count %>)</label>
</li>
<li class="clearfix">

@ -4,48 +4,47 @@
<div class="teacherTeamItem clearfix">
<p class="clearfix title-line">
<div class="clearfix df title-line">
<a href="<%= user_path(member.user) %>" target="_blank" class="fl">
<%= image_tag(url_to_avatar(member.user), :width =>"80", :height => "80", :class => "radius", :alt=>"头像") %>
</a>
<div class="flex1 ml15">
<p class="mb10 mt5 task-hide" style="max-width: 120px;"><%= member.user.try(:show_name) %></p>
<div class="clearfix ml3">
<p class="color-grey-9 font-12">
<!-- <span class="mr10"><%#= member.user.school_name %></span>-->
<span><%= member.user.identity == "学生" ? "" : member.user.identity %></span>
</p>
<!--<a href="JavaScript:void(0)" class="edu-default-btn edu-focus-btn fr color-grey-6">关注</a>-->
</div>
</div>
<span class="font-18 font-bd"></span>
<span class="fr">
<span class="fr">
<% if User.current.admin? && member.role != 1 %>
<a class="fl mr20 mt4" data-tip-down="删除" onclick="delete_confirm_box_2('<%= delete_member_subject_path(@subject, :mem_id => member.id) %>', '确定要删除该成员吗?');">
<img src="/images/educoder/icon/del.svg" class="fl mt4 ml4">
</a>
<% end %>
<% if User.current.admin? && member.role != 1 %>
<a class="fl mr20 mt4" data-tip-down="删除" onclick="delete_confirm_box_2('<%= delete_member_subject_path(@subject, :mem_id => member.id) %>', '确定要删除该成员吗?');">
<img src="/images/educoder/icon/del.svg" class="fl mt4 ml4">
</a>
<% end %>
<% if User.current.member_of_subject?(@subject) && member.position > 1 %>
<a data-method="POST" class="fl ring-op-green mr20 mt7" data-remote="true" href="<%= up_member_position_subject_path(@subject, :mem_id => member.id) %>">
<img src="/images/educoder/icon/moveup.svg" data-tip-down="向上移动" class="fl mt2 ml4">
</a>
<% end %>
<% if User.current.member_of_subject?(@subject) && member.position > 1 %>
<a data-method="POST" class="fl ring-op-green mr25 mt7" data-remote="true" href="<%= up_member_position_subject_path(@subject, :mem_id => member.id) %>">
<img src="/images/educoder/icon/moveup.svg" data-tip-down="向上移动" class="fl mt2 ml4">
</a>
<% end %>
<% if User.current.member_of_subject?(@subject) && member.position < @subject.subject_members.size %>
<a data-method="POST" class="fl ring-op-green mt7" data-remote="true" href="<%= down_member_position_subject_path(@subject, :mem_id => member.id) %>">
<img src="/images/educoder/icon/movedown.svg" data-tip-down="向下移动" class="fl mt2 ml4">
</a>
<% end %>
<% if User.current.member_of_subject?(@subject) && member.position < @subject.subject_members.size %>
<a data-method="POST" class="fl ring-op-green mr25 mt7" data-remote="true" href="<%= down_member_position_subject_path(@subject, :mem_id => member.id) %>">
<img src="/images/educoder/icon/movedown.svg" data-tip-down="向下移动" class="fl mt2 ml4">
</a>
<% end %>
</span>
</span>
</div>
</p>
<div class=" ml15">
<p class="mb10 mt5"><%= member.user.try(:show_name) %></p>
<div class="clearfix ml3">
<p class="color-grey-9 font-12">
<!-- <span class="mr10"><%#= member.user.school_name %></span>-->
<span><%= member.user.identity == "学生" ? "" : member.user.identity %></span>
</p>
<!--<a href="JavaScript:void(0)" class="edu-default-btn edu-focus-btn fr color-grey-6">关注</a>-->
</div>
</div>
</div>
<% end %>
<% end %>

@ -1103,6 +1103,8 @@ RedmineApp::Application.routes.draw do ## oauth相关
match 'move_to_category', :via => [:get,:post]
match 'homework_code_repeat', :via => [:get,:post]
get 'review_detail'
post 'rename_homework'
get 'rename_modal'
end
collection do

@ -0,0 +1,8 @@
class ModifyExecTimeForShixun < ActiveRecord::Migration
def up
change_column(:shixuns, :exec_time, :integer, :default => 20)
end
def down
end
end

@ -1229,3 +1229,55 @@ $(document).bind('ajaxError', function(event, xhr, settings) {
}
});
/** tpm实训开启按钮不允许多次点击 END */
//工程认证各个页面的查看详情弹层
function elasticLayer(forumId){
if (window.__memo) {
doElasticLayer(window.__memo, true)
return;
}
if (!forumId) return;
var url = 'https://www.educoder.net/api/v1/memos/' + forumId
$.ajax({
url: url,
type: 'get',
success: function(res) {
console.log(res)
doElasticLayer(res.memo)
}
});
// document.body.addEventListener('touchmove',bodyScroll,false);
// $('body').css({'position':'fixed',"width":"100%"});
}
function doElasticLayer(memo, rendered){
if (rendered) {
$(".layerContent").show();
$(".newMain").hide();
return;
}
window.__memo = memo
var content = memo.content
var subject = memo.subject
var html='<div class="layerContent"><div class="educontent">' +
'<p class="clearfix pt25 pb25 color-grey-3 bor-bottom-greyE"><span class="fl font-24">'+ subject +'</span>' +
'<a href="javascript:void(0)" onclick="removeElasticLayer();" class="fr font-16 mt5">返回</a></p>' +
'<div id="MDContent"><textarea style="display:none">'
+ content +
'</textarea></div>'
$(".newMain").after(html).hide();
editormd.markdownToHTML("MDContent", {
htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true,
tex: true, // 默认不解析
flowChart: true, // 默认不解析
sequenceDiagram: true // 默认不解析
});
}
function removeElasticLayer(){
$(".layerContent").hide();
$(".newMain").show();
}

@ -107,7 +107,9 @@
<!-- // <script type="text/javascript" src="https://testbdweb.trustie.net/javascripts/create_kindeditor.js"></script> -->
<script type="text/javascript" src="/js/create_kindeditor.js"></script>
<!-- <script type="text/javascript" src="/js/cm_all.js"></script> -->
<script type="text/javascript" src="http://testbdweb.educoder.net/javascripts/educoder/edu_application.js"></script>
<!-- <script type="text/javascript" src="http://localhost:3000/javascripts/educoder/edu_application.js"></script> -->
</body>
</html>

@ -125,12 +125,13 @@ const NewContentCareerPathIndex =Loadable({
loader: () => import('./modules/careerPath/managementsCareerPath/New_Content_Career_Path_Index'),
loading: Loading,
})
{/*课程体系对毕业要求的支撑*/}
const ecCourseSupports=Loadable({
loader: () => import('./modules/ec/ecCourseSupports/ecCourseSupports'),
loading: Loading,
})
//课程体系
const ecCourseEvaluations=Loadable({
loader: () => import('./modules/ec/ecCourseEvaluations/ecCourseEvaluations'),
loading: Loading,
@ -141,11 +142,12 @@ const ecGradeEvaluations=Loadable({
loading: Loading,
})
{/*课程目标评价方法*/}
const EvaluationMethods=Loadable({
loader: () => import('./modules/ec/ecCourseEvaluations/ecCourseEvaluationsbottom'),
loading: Loading,
})
{/*达成评价详情*/}
const EcCompletionCalculation=Loadable({
loader: () => import('./modules/ec/ecCompletion_calculation/ecCompletion_calculation'),
loading: Loading,
@ -190,18 +192,21 @@ class App extends Component {
<Route path="/ec_major_schools/:major_school_id/academic_years/:ec_year_id/reach_calculation_info"
component={GraduatesRequirement}>
</Route>
{/*课程体系对毕业要求的支撑*/}
<Route path="/ec_major_schools/:major_school_id/academic_years/:ec_year_id/requirement_vs_courses" component={ecCourseSupports}>
</Route>
{/*课程体系*/}
<Route path="/ec_courses/:ec_course_id/ec_course_reach_setting" component={ecCourseEvaluations} {...this.state} {...this.props}>
</Route>
{/*达成评价详情*/}
<Route path="/ec_courses/:ec_course_id/competition_calculation_info" component={EcCompletionCalculation}>
</Route>
{/*课程目标评价方法*/}
<Route path="/ec_courses/:ec_course_id/evaluation_methods" component={EvaluationMethods}>
</Route>
<Route path="/tasks/:stageId" component={IndexWrapperComponent}/>
@ -262,7 +267,7 @@ class App extends Component {
<Route path="/ec_courses/:ec_course_id/ec_course_support_setting" component={EcCourseSupportSetting}>
</Route>
{/*达成评价详情*/}
<Route path="/ec_courses/:ec_course_id/competition_calculation_info" component={EcCompletionCalculation}>
</Route>

@ -432,6 +432,7 @@ class EcCompletionCalculation extends Component {
<div className="educontent mb290">
<EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata}
ecComponentState={'ecCompletion'}
ecpath={"show"}
@ -443,6 +444,8 @@ class EcCompletionCalculation extends Component {
<a href={schooldata.course_setting_url} className="color-grey-9 TrainingLecturer">课程体系</a> >
<a className="TrainingTheory major_name"> {schooldata.ec_course_name} 达成评价详情</a>
{/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */}
<div className="color-grey-9 mr10">系统根据课程目标课程考核方式与课程目标评价方法一键计算评价课程目标的达成情况 <a className={"color-blue"} onClick={() => window.elasticLayer(3533)}>查看详情</a></div>
</div>
<div className="padding20-30" id="training_objective_contents"

@ -267,7 +267,6 @@ class ecCourseEvaluations extends Component {
this.setState({
Modallist: "删除失败",
Modallisttype:true,
Modallist:'',
Modallists:'',
deleteassociatedclasstype:false,
assclassvalue:''
@ -860,6 +859,7 @@ class ecCourseEvaluations extends Component {
<div className="educontent mb40">
<EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata}
ecComponentState={ecComponentState}
ecpath={"show"}
@ -870,14 +870,28 @@ class ecCourseEvaluations extends Component {
<p className="clearfix padding20-30 bor-bottom-greyE" id="SystemParametersP">
<a href={schooldata.course_setting_url} className="TrainingLecturer color-grey-9">课程体系 </a> >
<a className="TrainingTheory major_name"> {schooldata.ec_course_name}</a>
<div className={"fr"}>
<span className=" fr " >
<a className="white-btn edu-blueback-btn fr mr10 mt7" style={{top: '22px',display:ecmanager===false?"none":""}} target="_blank" href={'/ec_courses/'+ec_course_id+'/export_ec_course_targets?format=xls'}>导出考核方法</a>
</span>
<a className="white-btn edu-blueline-btn fr mr10 mt7 mr20"
onClick={this.associatedclass}
style={{display: course_url === "" && ecmanager === true ? "block" : "none"}}
>关联课堂</a>
<a className="white-btn edu-blueline-btn fr mr10 mt7 mr20"
onClick={this.deleteassociatedclass}
style={{display:course_url!=""&&ecmanager===true?"block":"none"}}
>取消关联</a>
</div>
<div className="color-grey-9 mr10">请结合本课程的教学情况修改考核方式并导入学生的对应考核成绩 <a className={"color-blue"} onClick={() => window.elasticLayer(3533)}>查看详情</a></div>
{/*课程考核方式与数据来源*/}
{/* <span className="fl font-18 courseSystem"></span> */}
{/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */}
<a class="white-btn edu-blueline-btn fr mr10 mt2 associatedclass" onClick={this.associatedclass} style={{display:course_url===""&&ecmanager===true?"block":"none"}}>关联课堂</a>
<a class="white-btn edu-blueline-btn fr mr10 mt2 associatedclass" onClick={this.deleteassociatedclass} style={{display:course_url!=""&&ecmanager===true?"block":"none"}}>取消关联</a>
<span className="Importclassroomdata" style={{top: '22px',display:ecmanager===false?"none":""}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10" target="_blank" href={'/ec_courses/'+ec_course_id+'/export_ec_course_targets?format=xls'}>导出考核方法</a>
</span>
</p>
<div style={{padding: '20px 21px 0px 21px',height:'40px'}} id="SystemParameters" className={"SystemParameters"}>

@ -703,6 +703,7 @@ class EcCourseEvaluationsbottom extends Component {
{/*</div>*/}
<EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata}
ecpath={"show"}
/>
@ -712,7 +713,9 @@ class EcCourseEvaluationsbottom extends Component {
<p className="clearfix padding20-30 bor-bottom-greyE" id="SystemParametersP">
<a href={schooldata.course_setting_url} className="TrainingLecturer color-grey-9">课程体系 </a> >
<a className="TrainingTheory major_name"> {schooldata.ec_course_name} </a>
{/*课程考核方式与数据来源*/}
<div className="color-grey-9 mr10">请结合本课程的教学情况修改说明每个课程目标的评价环节和评估方式 <a className={"color-blue"} onClick={() => window.elasticLayer(3533)}>查看详情</a></div>
{/*课程考核方式与数据来源*/}
{/* <span className="fl font-18 courseSystem"></span> */}
{/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */}
<span className="Importclassroomdata" style={{top: '22px'}}>

@ -245,6 +245,7 @@ class EcCourseSupportSetting extends Component {
<div className="newMain clearfix courseSupport">
<div className="educontent mb50">
<EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata}
ecComponentState={'ecCompletion'}
ecpath={"ec_course_support_setting"}

@ -473,6 +473,7 @@ class ecCourseSupports extends Component {
<div className="educontent mb290">
<EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata}
ecComponentState={ecComponentState}
ecpath={"requirement_vs_courses"}
@ -481,11 +482,13 @@ class ecCourseSupports extends Component {
<div className="edu-back-white eacourse">
<div className="clearfix padding20-30 bor-bottom-greyE" style={{position:'relative'}}>
<span className="fl font-18 courseSystem">课程体系对毕业要求的支撑</span>
<span className="font-18 courseSystem">课程体系对毕业要求的支撑</span>
{/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */}
<span className={data.is_manager===false?"none":"Importclassroomdata"} style={{top: '29px'}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10" target="_blank" href={'/ec_major_schools/'+major_school_id+'/academic_years/'+ec_year_id+'/export_course_requirements?format=xls'}>导出课程体系支撑矩阵</a>
</span>
<div className="color-grey-9 mr10">用矩阵图的形式说明本专业课程体系对毕业要求的支撑关系 <a className={"color-blue"} onClick={() => window.elasticLayer(3534)} >查看详情</a></div>
</div>
<div className="padding20-30" id="training_objective_contents">
<span className="fl SystemParameters" >毕业要求指标点<a href={data.subitems_url}><span className="Systemnum">{data.subitems_count}</span></a></span>

@ -262,6 +262,7 @@ class ecGradeEvaluations extends Component {
<div className="educontent mb40">
<EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata}
ecpath={"show"}
/>
@ -271,6 +272,7 @@ class ecGradeEvaluations extends Component {
<p className="clearfix padding20-30 bor-bottom-greyE" id="SystemParametersP">
<a href={schooldata.course_setting_url} className="TrainingLecturer color-grey-9">课程体系 </a> >
<a className="TrainingTheory major_name"> {schooldata.ec_course_name}</a>
{/*课程考核方式与数据来源*/}
{/* <span className="fl font-18 courseSystem"></span> */}
{/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */}

@ -23,6 +23,7 @@ class ecStudentList extends Component {
schooldata:{},
majorschoollist:undefined,
titlemessage:"提示",
ecComponentState:"ecStudentList",
visible:false,
Modallist:'',
Modallisttypes:0,
@ -318,10 +319,11 @@ class ecStudentList extends Component {
<div className="educontent mb290">
<EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata}
ecpath={"none"}
ecpath={this.state.ecComponentState}
/>
<div className="clearfix padding20-30 bor-bottom-greyE mb10 mt10 edu-back-white">
<div className="clearfix padding20-30 bor-bottom-greyE mb10 edu-back-white">
<span className="fl font-18 courseSystem ">学生列表</span>
<a className="fr font-15 courseSystem" onClick={this.windowsgoblack}>返回</a>
</div>
@ -329,9 +331,11 @@ class ecStudentList extends Component {
<div className="edu-back-white eacourse">
<div className="clearfix padding20-30 bor-bottom-greyE"><span
className="fl font-18 courseSystem">学生列表
className=" font-18 courseSystem">学生列表
{majorschoollist===undefined?"":majorschoollist.total_student}
</span></div>
</span>
<div className="color-grey-9 mr10">提供模板支持导入学生信息(请先下载模板) <a className={"color-blue"} onClick={() => window.elasticLayer(3533)}>查看详情</a></div>
</div>
<div className="padding20-30 padbottom" id="training_objective_contents">
{ismanager===false?"":

@ -21,7 +21,9 @@
margin-right: 10px;
}
#traningNav>li>.ecTitles {
line-height: 18px !important;
line-height: 16px !important;
height: 18px!important;
width: 18px!important;
}
#traningNav>li>.ecTitlefont:hover{

@ -21,6 +21,7 @@ class EcTitleCourseEvaluations extends Component {
render() {
let{schooldata,ecComponentState,ecpaths}=this.state;
return (
<div>
<div className="mb10 mt10 eaSystemp">
@ -49,16 +50,20 @@ class EcTitleCourseEvaluations extends Component {
<a className={"ecTitle ecTitles"} >4</a>
<a className={"ecTitlefont"} href={schooldata.requirement_vs_standard}>毕业要求 vs 通用标准</a>
</li>
<li className={ecpaths==="ecStudentList"?"ecimgs11":"ecimgs"} style={{width: ecpaths==="ecStudentList"?'126px':'83px'}}>
<a className={ ecpaths==="ecStudentList"?"ml18 ecTitleFFF ecTitles":"ecTitle"} >5</a>
<a className={ ecpaths==="ecStudentList"?"ecTitlefontFFF":"ecTitlefont"} href={schooldata.students_url}>学生</a>
</li>
<li className={ecpaths==="ec_course_support_setting"||ecpaths==="show"?"ecimgs11":"ecimgs"}>
<a className={ ecpaths==="ec_course_support_setting"||ecpaths==="show"?"ml18 ecTitleFFF ecTitles":"ecTitle ecTitles"} >5</a>
<a className={ ecpaths==="ec_course_support_setting"||ecpaths==="show"?"ml18 ecTitleFFF ecTitles":"ecTitle ecTitles"} >6</a>
<a className={ ecpaths==="ec_course_support_setting"||ecpaths==="show"?"ecTitlefontFFF":"ecTitlefont"} href={schooldata.course_setting_url}>课程体系</a>
</li>
<li className={ecpaths==="requirement_vs_courses"?"ecimgs3":"ecimgs"}>
<a className={ ecpaths==="requirement_vs_courses"?"ecmarginleft ecTitleFFF ecTitles":"ecTitle ecTitles"} >6</a>
<a className={ ecpaths==="requirement_vs_courses"?"ecmarginleft ecTitleFFF ecTitles":"ecTitle ecTitles"} >7</a>
<a className={ ecpaths==="requirement_vs_courses"?"ecTitlefontFFF":"ecTitlefont"} href={schooldata.requirement_vs_courses}>课程体系 vs 毕业要求</a>
</li>
<li className={ecpaths==="reach_calculation_info"?"ecimgs2 info2":"ecimgs"}>
<a className={ ecpaths==="reach_calculation_info"?"ecTitleFFF ml18 ecTitles":"ecTitle ecTitles"} >7</a>
<a className={ ecpaths==="reach_calculation_info"?"ecTitleFFF ml18 ecTitles":"ecTitle ecTitles"} >8</a>
<a className={ ecpaths==="reach_calculation_info"?"ecTitlefontFFF":"ecTitlefont"} href={schooldata.reach_calculation_info_url}>达成度评价结果</a>
</li>
{/*<li className={ecComponentState==="ecCourseSupports"?"active edu-menu-panel":"edu-menu-panel"}>*/}

@ -599,16 +599,24 @@ class GraduatesRequirement extends Component {
<div className="newMain clearfix">
<div className="educontent mb290">
<EcTitleCourseEvaluations
{...this.props}
schooldata={schooldata}
ecComponentState={'ecCompletion'}
ecpath={"reach_calculation_info"}
></EcTitleCourseEvaluations>
<div className="contentWrap graduatesRequirement">
<p className="clearfix padding20-30 bor-bottom-greyE backgroundFFF"
<ul className="clearfix padding20-30 bor-bottom-greyE backgroundFFF"
style={{ 'marginBottom': '0px' }} >
<a className="fl font-18 courseSystem"> 毕业要求指标点达成计算 </a>
</p>
<li className="fl">
<p className="font-18 courseSystem"> 毕业要求指标点达成计算 </p>
<p>
<span class="color-grey-9 mr10">系统根据课程体系与毕业要求的支持关系以课程的考核与成绩判定方式一键计算毕业要求的达成度情况</span>
<a href="javascript:void(0)" onClick={() => window.elasticLayer(3535)} class="color-blue">查看详情</a>
</p>
</li>
</ul>
<p class="clearfix padding20-30 bor-bottom-greyE backgroundFFF"
style={{ 'paddingBottom': '12px' }}>

@ -17,14 +17,17 @@ import Button from 'material-ui/Button';
import './tpiPage.css';
import './tpiPageForMobile.css';
const $ = window.$;
const showIframeContent = window.location.search.indexOf('vnc=1') != -1;
class MainContent extends Component {
componentDidMount() {
// ios下图标位置有问题
setTimeout(()=>{
if (window.$('.b-label>.resize-helper').position().top < 100) {
window.$('.b-label>.resize-helper').css('top', '200px')
}
}, 4000)
if (!showIframeContent) {
setTimeout(()=>{
if (window.$('.b-label>.resize-helper').position().top < 100) {
window.$('.b-label>.resize-helper').css('top', '200px')
}
}, 4000)
}
$("body").css("padding-right","0px!important")
}
onResizeButtonClick = () => {
@ -45,7 +48,6 @@ class MainContent extends Component {
} else {
games_repository_contents_style = {overflow: 'hidden', height: '445px'}
}
return (
<div className="page--body -margin-t-64 -flex">
<div className="-layout -stretch -fit labelN" id="game_show_content">
@ -65,6 +67,21 @@ class MainContent extends Component {
<div className="split-panel--second -layout -vertical -flex -relative -flex-basic50"
id="game_right_contents" style={{width: '996px'}}>
{/*
iframe模式下需要这两个样式来调整
.page--body { z-index: 9999; }
.resize-helper { top: 10px }
*/}
<style>{`
#contentIframe {
height: 100%;
background: #fff;
}
.page--body { z-index: ${showIframeContent ? '7999': '1'} ; }
.b-label>.resize-helper { top: ${showIframeContent ? '10px': '50%'} }
`}</style>
{ showIframeContent ? <iframe src="http://106.75.27.125:42288/vnc.html" id="contentIframe" ></iframe> :
<React.Fragment>
{/* 旧版本、评测等待提示--更新提示块*/}
{/*<div className="tip-panel-animate clearfix user_bg_shadow bor-grey-e">
<div className="fl tip-img">
@ -74,55 +91,57 @@ class MainContent extends Component {
</div>*/}
<div className="-layout-v -flex">
<div className="-flex -relative">
<div className="split-panel -fit -vertical" id="games_repository_valuation">
<div className="-layout -stretch -fit -vertical centerH">
<div className="-layout -vertical -flex -relative -flex-basic70 -bg-weightblack"
id="games_repository_contents" style={games_repository_contents_style} >
{/* 选择题或编程题 */}
{/* readRepoTimeout 如果读取代码超时,显示重新加载按钮,重新拉取代码 */}
{
st === 0
?
readRepoTimeout === true ? <div className="readRepoFailed">
代码加载失败<a className="retry"
onClick={() => this.props.fetchRepositoryCode(this.props, null, null, true)}>重试</a>
</div> :
<React.Fragment>
<CircularProgress size={40} thickness={3}
style={{ display: (codeLoading ? 'block' : 'none') , marginLeft: 'auto', marginRight: 'auto', marginTop: '20%' }}/>
<div style={{ display: (codeLoading ? 'none' : 'block') }}>
<CodeRepositoryViewContainer { ...this.props } ></CodeRepositoryViewContainer>
</div>
</React.Fragment>
: <ChooseRepositoryView ref="chooseQ" { ...this.props }></ChooseRepositoryView>
}
{/* */}
</div>
<div className="h-center" style={{top: '438px'}}>
{/*<div className="-changebg -bg-weightblack" id="-bg-change-color"></div>*/}
</div>
<div className="split-panel--second -layout -vertical -flex -relative -bg-black -flex-basic60"
id="games_valuation_contents" style={{height: '258px'}}>
{/* 测试结果、评测信息区域 */}
{ loading ? <CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '10%', display: 'block' }}/>
:
st === 0
? <CodeEvaluateView output_sets={output_sets} latest_output={latest_output}
record={record} onTestSetHeaderClick={onTestSetHeaderClick} {...this.props}></CodeEvaluateView>
: <ChooseEvaluateView {...this.props}></ChooseEvaluateView>
}
</div>
</div>
</div>
</div>
</div>
<div id="actionView" className="-layout-h -center -bg-grey-90 -grey-20 -bg-darkblack" style={{height:'48px'}}>
<ActionView onRunCodeTest={onRunCodeTest} {...this.props}></ActionView>
</div>
<div className="-flex -relative">
<div className="split-panel -fit -vertical" id="games_repository_valuation">
<div className="-layout -stretch -fit -vertical centerH">
<div className="-layout -vertical -flex -relative -flex-basic70 -bg-weightblack"
id="games_repository_contents" style={games_repository_contents_style} >
{/* 选择题或编程题 */}
{/* readRepoTimeout 如果读取代码超时,显示重新加载按钮,重新拉取代码 */}
{
st === 0
?
readRepoTimeout === true ? <div className="readRepoFailed">
代码加载失败<a className="retry"
onClick={() => this.props.fetchRepositoryCode(this.props, null, null, true)}>重试</a>
</div> :
<React.Fragment>
<CircularProgress size={40} thickness={3}
style={{ display: (codeLoading ? 'block' : 'none') , marginLeft: 'auto', marginRight: 'auto', marginTop: '20%' }}/>
<div style={{ display: (codeLoading ? 'none' : 'block') }}>
<CodeRepositoryViewContainer { ...this.props } ></CodeRepositoryViewContainer>
</div>
</React.Fragment>
: <ChooseRepositoryView ref="chooseQ" { ...this.props }></ChooseRepositoryView>
}
{/* */}
</div>
<div className="h-center" style={{top: '438px'}}>
{/*<div className="-changebg -bg-weightblack" id="-bg-change-color"></div>*/}
</div>
<div className="split-panel--second -layout -vertical -flex -relative -bg-black -flex-basic60"
id="games_valuation_contents" style={{height: '258px'}}>
{/* 测试结果、评测信息区域 */}
{ loading ? <CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '10%', display: 'block' }}/>
:
st === 0
? <CodeEvaluateView output_sets={output_sets} latest_output={latest_output}
record={record} onTestSetHeaderClick={onTestSetHeaderClick} {...this.props}></CodeEvaluateView>
: <ChooseEvaluateView {...this.props}></ChooseEvaluateView>
}
</div>
</div>
</div>
</div>
</div>
<div id="actionView" className="-layout-h -center -bg-grey-90 -grey-20 -bg-darkblack" style={{height:'48px'}}>
<ActionView onRunCodeTest={onRunCodeTest} {...this.props}></ActionView>
</div>
</React.Fragment>
}
</div>
</div>
</div>

@ -617,10 +617,10 @@ class MainContentContainer extends Component {
// 之前的task_commit方法
gameBuild(fileUpdateResponse, first) {
const { st, challenge, output_sets, onRunCodeTestFinish, resetTestSetsExpandedArray, showSnackbar, time_limit } = this.props
const { resubmit, content_modified } = fileUpdateResponse.data;
const { resubmit, content_modified, sec_key } = fileUpdateResponse.data;
const timeOut = time_limit;
// http://localhost:3000/myshixuns/so5w6iap97/stages/zl6kx8f7vfpo/game_build?first=1&resubmit=GDBEX741_1993
const game_build_url = `${locationPath}/game_build?first=${first}&resubmit=${resubmit}&content_modified=${content_modified}`
const game_build_url = `${locationPath}/game_build?first=${first}&resubmit=${resubmit}&content_modified=${content_modified}&sec_key=${sec_key}`
// var timeOut = parseInt(<%= @myshixun.main_mirror.try(:time_limit) %>); // 超时参数
resetTestSetsExpandedArray()
axios.get(game_build_url, {
@ -639,7 +639,7 @@ class MainContentContainer extends Component {
let requestTimes = 0;
var gameStatusIntervalId = setInterval(()=>{
let game_status_url = `${locationPath}/game_status?port=${port}&resubmit=${resubmit||""}&time_out=${timeOutFlag}`
let game_status_url = `${locationPath}/game_status?port=${port}&resubmit=${resubmit||""}&time_out=${timeOutFlag}&sec_key=${sec_key}`
axios.get(game_status_url, {
withCredentials: true,

@ -74,7 +74,7 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
.moreitem{position: absolute;right: 5px;top:35px;height: 15px;color:#656565}
/*块状列表*/
.square-list{width: 100%;box-sizing: border-box;margin-top:20px}
.square-Item{position: relative;width:280px;margin-right: 26px;margin-bottom: 26px;float: left;border-radius: 6px;background-color:#fff;box-shadow: 0px 0px 12px rgba(0,0,0,0.1); }
.square-Item{position: relative;width:280px;margin-right: 26px;margin-bottom: 26px;float: left;border-radius: 6px;background-color:#fff;box-shadow: 0px 0px 12px rgba(0,0,0,0.1); min-height: 301px;}
.square-Item:hover{bottom: 3px; box-shadow: 0px 0px 12px rgba(0,0,0,0.3);}
.square-Item:hover .closeSquare{display: block}
.square-Item:nth-child(4n+0){margin-right: 0px;}
@ -3089,17 +3089,17 @@ a.singlepublishtwo{
.MajorName > i:hover{color: #4CACFF}
/*培养目标*/
#traningNav{margin-bottom: 0px!important;}
#traningNav>li{float: left;padding:0px 30px 30px 30px;font-size: 16px;}
#traningNav>li{float: left;padding:0px 30px 30px 30px;font-size: 15px;}
#traningNav>li>a,#traningNav li>i{color: #666!important;position: relative}
#traningNav>li.active > a,#traningNav li.active > i{color: #05101A!important;}
#traningNav>li.active > a:after{content: '';position: absolute;width: 64px;left: 50%;margin-left: -32px;height: 2px;background-color: #05101A;bottom: -35px;}
#traningNav>li>.ecTitle {width: 20px;height: 20px;border: 1px solid rgba(65, 140, 205, 1);border-radius: 50%;text-align: center;
line-height: 20px;display: inline-block;color: rgba(65, 140, 205, 1) !important;margin-right: 8px;}
#traningNav>li>.ecTitle {width: 16px;height: 16px;border: 1px solid rgba(65, 140, 205, 1);border-radius: 50%;text-align: center;
line-height: 16px;display: inline-block;color: rgba(65, 140, 205, 1) !important;margin-right: 8px;font-size: 12px}
#traningNav>li>.ecTitlefont:hover{color: rgba(65, 140, 205, 1) !important;}
.ecimgs{height: 90px;line-height: 90px;box-sizing: border-box;}
#traningNav>li>.ecTitlefontFFF{color:#fff!important;}
#traningNav>li>.ecTitleFFF {width: 20px;height: 20px;border: 1px solid #fff;border-radius: 50%;text-align: center;line-height: 20px;
#traningNav>li>.ecTitleFFF {width: 16px;height: 16px;border: 1px solid #fff;border-radius: 50%;text-align: center;line-height: 16px;font-size: 12px;
display: inline-block;color: #fff !important;margin-right: 8px;}
.traningNavs>li {padding: 0px 10px 30px 12px !important;}
.ecimgs1{background: url("/images/educoder/auth/1.png");background-repeat: no-repeat;background-size: 100% 100%;-moz-background-size: 100% 100%;

@ -903,4 +903,13 @@ html>body #ajax-indicator { position: fixed; }
margin-left: 20px;
text-indent: 25px;
min-height: 100px;
}
/*工程认证 各页面公用弹层*/
.layerContent{
margin: 0 auto;
padding-bottom: 235px;
min-width: 1200px;
padding-top: 60px;
}
Loading…
Cancel
Save