diff --git a/app/helpers/subjects_helper.rb b/app/helpers/subjects_helper.rb index f110ef04c..75ae9f041 100644 --- a/app/helpers/subjects_helper.rb +++ b/app/helpers/subjects_helper.rb @@ -13,13 +13,8 @@ module SubjectsHelper # 实训路径的所有用户获得的标签 def user_shixun_tags challenge_ids, user_id - logger.info("#####################") ChallengeTag.joins("join games on challenge_tags.challenge_id = games.challenge_id"). where(challenge_id: challenge_ids, games: {status: 2, user_id: user_id}).pluck("challenge_tags.name").uniq - logger.info("#####################") - pass_challenge_ids = Game.where(status: 2, user_id: user_id, challenge_ids: challenge_ids).pluck(:challenge_id) - ChallengeTag.where(challenge_id: pass_challenge_ids).pluck(:name).uniq - logger.info("#####################") end # 金课的课堂状态 0:未开课,1:进行中,2:已结束 diff --git a/app/models/subject.rb b/app/models/subject.rb index 65e685209..4b7f4dbcd 100644 --- a/app/models/subject.rb +++ b/app/models/subject.rb @@ -82,16 +82,9 @@ class Subject < ApplicationRecord end def my_subject_progress - logger.info("#-----------") my_challenge_count = Game.joins(:challenge).where(user_id: User.current.id, status: 2, challenges: {shixun_id: shixuns.published_closed}). - pluck(:challenge_id).uniq.size - logger.info("#-----------") - new_challenge_count = Challenge.left_joins(:games) - .where(games: {user_id: current_user.id, status: 2}, shixun_id: shixuns.published_closed) - .uniq.count - logger.info("#-----------") - subject_challenge_count = shixuns.challenges_count - subject_challenge_count == 0 ? 0 : ((my_challenge_count.to_f / subject_challenge_count).round(2) * 100).to_i + pluck(:challenge_id).uniq.size + count = self.subject_challenge_count == 0 ? 0 : ((my_challenge_count.to_f / self.subject_challenge_count).round(2) * 100).to_i end def my_consume_time diff --git a/app/views/exercise_questions/_exercise_questions.json.jbuilder b/app/views/exercise_questions/_exercise_questions.json.jbuilder index bbdf45440..940022a9f 100644 --- a/app/views/exercise_questions/_exercise_questions.json.jbuilder +++ b/app/views/exercise_questions/_exercise_questions.json.jbuilder @@ -36,6 +36,14 @@ if question.question_type <= 2 #当为选择题或判断题时,只显示选 if exercise_type == 1 || exercise_type == 4 #1为老师,4为试卷截止且答案公开的情况 json.standard_answer standard_answers_array + if question.question_type == 2 #返回答案的文字 + standard_text = standard_answers_array.first.to_i == 1 ? "正确" : "错误" + else + array_text_answer = [] + standard_answers_array.each{|a| array_text_answer.push((a+64).chr)} + standard_text = array_text_answer.join("") + end + json.standard_answer_show standard_text end if exercise_type == 3 || exercise_type == 4 json.user_answer user_answer diff --git a/config/environments/development.rb b/config/environments/development.rb index cdcd45ec5..f0b3f1775 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -50,12 +50,11 @@ Rails.application.configure do # Debug mode disables concatenation and preprocessing of assets. # This option may cause significant delays in view rendering with a large # number of complex assets. - config.assets.debug = false + config.assets.debug = true # Suppress logger output for asset requests. config.assets.quiet = true - config.assets.compile = true # config.assets.prefix = '/dev-assets' # Raises error for missing translations diff --git a/public/images/educoder/path.png b/public/images/educoder/path.png index d3d816012..b7feec66c 100644 Binary files a/public/images/educoder/path.png and b/public/images/educoder/path.png differ diff --git a/public/images/educoder/path1.png b/public/images/educoder/path1.png new file mode 100644 index 000000000..d3d816012 Binary files /dev/null and b/public/images/educoder/path1.png differ diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css index 75039c3a4..fc910ef37 100644 --- a/public/react/public/css/edu-all.css +++ b/public/react/public/css/edu-all.css @@ -446,8 +446,8 @@ table.text-file{} /*-------------------------------实训路径-------------------------------*/ .path-head{width: 100%;height: 300px;background-image: url("/images/educoder/path.png"); - background-color: #081C4B; - background-size: cover; + background-color: #131b39; + /*background-size: cover;*/ background-position: center; background-repeat: no-repeat; } diff --git a/public/react/public/js/js_min_all.js b/public/react/public/js/js_min_all.js index 63c1207af..0d56d86ba 100755 --- a/public/react/public/js/js_min_all.js +++ b/public/react/public/js/js_min_all.js @@ -236,8 +236,7 @@ $(function(){ if(dragging) { clickX = e.pageX || e.originalEvent.touches[0].pageX;; if(clickX > leftOffset+0&&clickX (function() { var _host = '/react/build/' - /* + /**/ if (window.location.host == 'pre-newweb.educoder.net') { _host = 'https://testali-cdn.educoder.net/react/build/' } else if (window.location.host == 'www.educoder.net') { _host = 'https://ali-newweb.educoder.net/react/build/' - }*/ + } document.write('