diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb
index e62dcf6ed..46b3964c2 100644
--- a/app/controllers/accounts_controller.rb
+++ b/app/controllers/accounts_controller.rb
@@ -33,7 +33,7 @@ class AccountsController < ApplicationController
uid_logger("start register: verifi_code is #{verifi_code}, code is #{code}, time is #{Time.now.to_i - verifi_code.try(:created_at).to_i}")
# check_code = (verifi_code.try(:code) == code.strip && (Time.now.to_i - verifi_code.created_at.to_i) <= 10*60)
# todo 上线前请删除万能验证码"513231"
- unless code == "513231" && request.host == "47.96.87.25"
+ unless code == "513231" && request.subdomain == "pre-newweb"
return normal_status(-2, "验证码不正确") if verifi_code.try(:code) != code.strip
return normal_status(-2, "验证码已失效") if !verifi_code&.effective?
end
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 233d94c8f..177eb1a42 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -245,7 +245,8 @@ class ApplicationController < ActionController::Base
# 测试版前端需求
- if request.host == "47.96.87.25"
+ logger.info("subdomain:#{request.subdomain}")
+ if request.subdomain == "pre-newweb"
if params[:debug] == 'teacher' #todo 为了测试,记得讲debug删除
User.current = User.find 81403
elsif params[:debug] == 'student'
diff --git a/app/controllers/concerns/git_helper.rb b/app/controllers/concerns/git_helper.rb
index 6a3765401..eeb4671a4 100644
--- a/app/controllers/concerns/git_helper.rb
+++ b/app/controllers/concerns/git_helper.rb
@@ -34,8 +34,7 @@ module GitHelper
rescue Exception => e
Rails.logger.error(e.message)
- Rails.logger.error("#####__________文档内容获取异常")
- # raise Educoder::TipException.new("文档内容获取异常")
+ raise Educoder::TipException.new("文档内容获取异常")
end
end
diff --git a/app/helpers/exercises_helper.rb b/app/helpers/exercises_helper.rb
index 0b18ff6f8..f59bee5ac 100644
--- a/app/helpers/exercises_helper.rb
+++ b/app/helpers/exercises_helper.rb
@@ -484,7 +484,11 @@ module ExercisesHelper
game_code = game_challenge
code = game_code.try(:new_code)
else
- code = git_fle_content(game.myshixun.repo_path,cha_path)
+ begin
+ code = git_fle_content(game.myshixun.repo_path,cha_path)
+ rescue
+ code = ""
+ end
end
end
if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里
diff --git a/app/helpers/homework_commons_helper.rb b/app/helpers/homework_commons_helper.rb
index c77ae5937..fa563a72c 100644
--- a/app/helpers/homework_commons_helper.rb
+++ b/app/helpers/homework_commons_helper.rb
@@ -37,25 +37,25 @@ module HomeworkCommonsHelper
when 3
if ho_detail_manual.evaluation_end && ho_detail_manual.evaluation_end > Time.now
status << "匿评中"
- time = how_much_time(ho_detail_manual.evaluation_end)
+ time = "提交剩余时间:" + how_much_time(ho_detail_manual.evaluation_end)
time_status = 3
end
when 4
if ho_detail_manual.appeal_time && ho_detail_manual.appeal_time > Time.now
status << "申诉中"
- time = how_much_time(ho_detail_manual.appeal_time)
+ time = "申诉剩余时间:" + how_much_time(ho_detail_manual.appeal_time)
time_status = 4
end
when 2, 5, 6
status << "评阅中"
- time = course.end_date.present? ? how_much_time(course.end_date.end_of_day) : ""
+ time = "评阅剩余时间:" + (course.end_date.present? ? how_much_time(course.end_date.end_of_day) : "")
time_status = 5
end
# 如果还在补交阶段则显示补交结束时间
if homework_common.end_time && homework_common.end_time < Time.now && homework_common.allow_late &&
homework_common.late_time && homework_common.late_time > Time.now
- time = how_much_time(homework_common.late_time)
+ time = "补交剩余时间:" + how_much_time(homework_common.late_time)
time_status = 2
end
else
@@ -74,12 +74,12 @@ module HomeworkCommonsHelper
when 1
if homework_common.end_time && homework_common.end_time >= Time.now
status << "提交中"
- time = how_much_time(homework_common.end_time)
+ time = "提交剩余时间:" + how_much_time(homework_common.end_time)
time_status = 1
elsif homework_common.end_time && homework_common.end_time < Time.now
time_status = 5
if homework_common.allow_late && (homework_common.late_time.nil? || homework_common.late_time >= Time.now)
- time = how_much_time(homework_common.late_time)
+ time = "补交剩余时间:" + how_much_time(homework_common.late_time)
time_status = 2
end
status << "评阅中"
@@ -114,11 +114,11 @@ module HomeworkCommonsHelper
time_status = 0
elsif max_end_time.present? && max_end_time > Time.now #6.14 -hs 添加present?
status << "提交中"
- time = how_much_time(max_end_time)
+ time = "提交剩余时间:" + how_much_time(max_end_time)
time_status = 1
elsif homework_common.allow_late && (homework_common.late_time.nil? || homework_common.late_time >= Time.now)
status << "评阅中"
- time = how_much_time(homework_common.late_time)
+ time = "补交剩余时间:" + how_much_time(homework_common.late_time)
time_status = 2
else
status << "评阅中"
diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb
index 790a9b7ab..ac11a54b7 100644
--- a/app/models/homework_common.rb
+++ b/app/models/homework_common.rb
@@ -68,23 +68,18 @@ class HomeworkCommon < ApplicationRecord
def category_info
case self.homework_type
when 'normal'
- {category_id: course.common_course_modules.first.try(:id), category_name: course.common_course_modules.first.try(:module_name)}
+ {category_id: course.common_course_modules.first.try(:id), category_name: course.common_course_modules.first.try(:module_name), main: 1}
when 'group'
- {category_id: course.group_course_modules.first.try(:id), category_name: course.group_course_modules.first.try(:module_name)}
+ {category_id: course.group_course_modules.first.try(:id), category_name: course.group_course_modules.first.try(:module_name), main: 1}
when 'practice'
if self.course_second_category.present?
- {category_id: self.course_second_category.try(:id), category_name: self.course_second_category.try(:name)}
+ {category_id: self.course_second_category.try(:id), category_name: self.course_second_category.try(:name), main: 0}
else
- {category_id: course.shixun_course_modules.take.try(:id), category_name: course.shixun_course_modules.take.try(:module_name)}
+ {category_id: course.shixun_course_modules.take.try(:id), category_name: course.shixun_course_modules.take.try(:module_name), main: 1}
end
end
end
- # 实训作业的主目录信息
- def main_category_info
- {category_id: course.shixun_course_modules.take.try(:id), category_name: course.shixun_course_modules.take.try(:module_name)}
- end
-
# 根据是否统一发布获取作业的作品列表
def all_works
student_works = self.unified_setting ? self.student_works :
diff --git a/app/templates/shared/main.css b/app/templates/shared/main.css
index dfe6613bf..9e9bc4f50 100644
--- a/app/templates/shared/main.css
+++ b/app/templates/shared/main.css
@@ -779,4 +779,7 @@ html>body #ajax-indicator { position: fixed; }
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
+}
+.yslminHeigth{
+ min-height: 400px;
}
\ No newline at end of file
diff --git a/app/views/exercises/_shixun_details.json.jbuilder b/app/views/exercises/_shixun_details.json.jbuilder
index 29a39a594..bd559d37d 100644
--- a/app/views/exercises/_shixun_details.json.jbuilder
+++ b/app/views/exercises/_shixun_details.json.jbuilder
@@ -31,8 +31,9 @@ json.shixun_detail do
if shixun_challenge.challenge&.path.present?
if game.try(:lastest_code).blank?
cha_path = challenge_path(shixun_challenge.challenge&.path)
- latest_code = git_fle_content(game.myshixun.repo_path,cha_path)
- if latest_code.to_s == "true"
+ begin
+ latest_code = git_fle_content(game.myshixun.repo_path,cha_path)
+ rescue
latest_code = ""
end
else
diff --git a/app/views/homework_commons/_homework_public_navigation.json.jbuilder b/app/views/homework_commons/_homework_public_navigation.json.jbuilder
index b5067e3c7..243c6aecd 100644
--- a/app/views/homework_commons/_homework_public_navigation.json.jbuilder
+++ b/app/views/homework_commons/_homework_public_navigation.json.jbuilder
@@ -2,7 +2,6 @@ json.course_id course.id
json.course_name course.name
json.is_end course.is_end
json.category homework.category_info
-json.main_category homework.main_category_info if homework.homework_type == "practice"
member = course.course_members.find_by(user_id: user.id, is_active: 1)
curr_status = homework_curr_status(homework, user.course_identity(course), course, member, member&.teacher_course_groups)
json.homework_status curr_status[:status]
diff --git a/db/migrate/20190823023738_change_exericse_1936_scores.rb b/db/migrate/20190823090957_rechange_exercise_1936_scores.rb
similarity index 93%
rename from db/migrate/20190823023738_change_exericse_1936_scores.rb
rename to db/migrate/20190823090957_rechange_exercise_1936_scores.rb
index ea3f66182..f089714ee 100644
--- a/db/migrate/20190823023738_change_exericse_1936_scores.rb
+++ b/db/migrate/20190823090957_rechange_exercise_1936_scores.rb
@@ -1,4 +1,4 @@
-class ChangeExericse1936Scores < ActiveRecord::Migration[5.2]
+class RechangeExercise1936Scores < ActiveRecord::Migration[5.2]
include ExercisesHelper
def change
#1936的试卷成绩有问题。
diff --git a/lib/tasks/excellent_course_exercise.rake b/lib/tasks/excellent_course_exercise.rake
index a7fac1a8f..4309eec26 100644
--- a/lib/tasks/excellent_course_exercise.rake
+++ b/lib/tasks/excellent_course_exercise.rake
@@ -149,7 +149,12 @@ namespace :excellent_course_exercise do
game_code = game_challenge
code = game_code.try(:new_code)
else
- code = git_fle_content(game.myshixun.repo_path,cha_path)
+ begin #8-23,hs
+ code = git_fle_content(game.myshixun.repo_path,cha_path)
+ rescue
+ code = ""
+ end
+ # code = git_fle_content(game.myshixun.repo_path,cha_path)
end
end
if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里
diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js
index 39df1d87e..939d2cdaa 100644
--- a/public/react/src/AppConfig.js
+++ b/public/react/src/AppConfig.js
@@ -41,10 +41,12 @@ export function initAxiosInterceptors(props) {
var proxy = "http://localhost:3000"
// proxy = "http://testbdweb.trustie.net"
// proxy = "http://testbdweb.educoder.net"
-
- //proxy="http://47.96.87.25:48080"
- proxy = "https://pre-newweb.educoder.net"
+ // proxy = "https://testeduplus2.educoder.net"
+ proxy="http://47.96.87.25:48080"
// wy
+ proxy="https://pre-newweb.educoder.net"
+
+ // wy
// proxy="http://192.168.2.63:3001"
diff --git a/public/react/src/modules/courses/boards/BoardsNew.js b/public/react/src/modules/courses/boards/BoardsNew.js
index d2b218f3d..b02f6a73f 100644
--- a/public/react/src/modules/courses/boards/BoardsNew.js
+++ b/public/react/src/modules/courses/boards/BoardsNew.js
@@ -350,7 +350,7 @@ class BoardsNew extends Component{
}],
})(
+ onInput={this.changeTitle} suffix={`${title_num}/${MAX_TITLE_LENGTH}`} />
)}
diff --git a/public/react/src/modules/courses/busyWork/NewWork.js b/public/react/src/modules/courses/busyWork/NewWork.js
index 83e792d68..ca79e8ac5 100644
--- a/public/react/src/modules/courses/busyWork/NewWork.js
+++ b/public/react/src/modules/courses/busyWork/NewWork.js
@@ -399,7 +399,7 @@ class NewWork extends Component{
required: true, message: '请输入标题'
}],
})(
-
+
)}