From 2791de431372437a004bff2248550c7f2e3a8362 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 26 Jul 2019 09:35:41 +0800 Subject: [PATCH 01/80] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/accounts_controller.rb | 4 +-- app/controllers/application_controller.rb | 36 ++++++++++++++--------- app/controllers/courses_controller.rb | 1 + app/controllers/shixuns_controller.rb | 2 ++ app/controllers/subjects_controller.rb | 1 + 5 files changed, 28 insertions(+), 16 deletions(-) diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 324e5bde3..d1357d43f 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -125,8 +125,8 @@ class AccountsController < ApplicationController set_autologin_cookie(user) UserAction.create(:action_id => user.try(:id), :action_type => "Login", :user_id => user.try(:id), :ip => request.remote_ip) - # 注册完成后有一天的试用申请 - UserDayCertification.create(user_id: user.id, status: 1) + # 注册完成后有一天的试用申请(先去掉) + # UserDayCertification.create(user_id: user.id, status: 1) end def set_autologin_cookie(user) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index bf8a0651e..af0158cfd 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -185,21 +185,29 @@ class ApplicationController < ActionController::Base render :json => { status: status, message: message } end - # 系统全局认证 - def check_auth - day_cer = UserDayCertification.find_by(user_id: current_user.id) - # 如果注册超过24小时则需要完善资料及授权 - if (Time.now.to_i - day_cer.try(:created_at).to_i) > 86400 - if !current_user.profile_completed? - info_url = '/account/profile' - tip_exception(402, info_url) - elsif current_user.certification != 1 - if current_user.apply_actions.exists?(container_type: 'TrialAuthorization', status: 0) - tip_exception(408, "您的试用申请正在审核中,请耐心等待") - end - tip_exception(407, "系统未授权") - end + # 资料是否完善 + def check_account + if !current_user.profile_completed? + info_url = '/account/profile' + tip_exception(402, info_url) end + end + + # 系统全局认证(暂时隐藏试用申请的判断) + def check_auth + # day_cer = UserDayCertification.find_by(user_id: current_user.id) + # # 如果注册超过24小时则需要完善资料及授权 + # if (Time.now.to_i - day_cer.try(:created_at).to_i) > 86400 + # if !current_user.profile_completed? + # info_url = '/account/profile' + # tip_exception(402, info_url) + # elsif current_user.certification != 1 + # if current_user.apply_actions.exists?(container_type: 'TrialAuthorization', status: 0) + # tip_exception(408, "您的试用申请正在审核中,请耐心等待") + # end + # tip_exception(407, "系统未授权") + # end + # end # if current_user.certification != 1 && current_user.apply_actions.exists?(container_type: 'TrialAuthorization', status: 0) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index faad02173..99f942146 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -13,6 +13,7 @@ class CoursesController < ApplicationController before_action :require_login, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups, :left_banner, :top_banner] + before_action :check_account, only: [:new, :apply_to_join_course] before_action :check_auth, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups, :left_banner, :top_banner, :apply_to_join_course, :exit_course] before_action :set_course, :user_course_identity, only: [:show, :update, :destroy, :settings, :set_invite_code_halt, diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 7a2db0666..9585ddc12 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -3,6 +3,8 @@ class ShixunsController < ApplicationController include ApplicationHelper before_action :require_login, :check_auth, except: [:download_file, :index, :menus] + before_action :check_account, only: [:new] + before_action :check_auth, except: [:download_file, :index, :menus] before_action :find_shixun, :shixun_access_allowed, except: [:index, :new, :create, :menus, :get_recommend_shixuns, diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 5cbb2a462..586b7352f 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -1,6 +1,7 @@ class SubjectsController < ApplicationController before_action :require_login, :check_auth, except: [:index] # before_action :check_auth, except: [:index] + before_action :check_account, only: [:new] before_action :find_subject, except: [:index, :create, :new, :append_to_stage] before_action :allowed, only: [:update, :edit, :destroy, :publish, :cancel_publish, :cancel_has_publish, :search_members, :add_subject_members, :statistics, :shixun_report, :school_report, From dd5c63f82581c6b2b6c96dc5f2edb097d8a99de2 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 26 Jul 2019 10:27:54 +0800 Subject: [PATCH 02/80] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E5=BC=80=E5=A7=8B?= =?UTF-8?q?=E6=8C=91=E6=88=98=E7=9A=84=E5=AE=8C=E5=96=84=E8=B5=84=E6=96=99?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 9585ddc12..15bd4e5a5 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -3,7 +3,7 @@ class ShixunsController < ApplicationController include ApplicationHelper before_action :require_login, :check_auth, except: [:download_file, :index, :menus] - before_action :check_account, only: [:new] + before_action :check_account, only: [:new, :shixun_exec] before_action :check_auth, except: [:download_file, :index, :menus] From ffdee1893ee0f1fee3443f82cce61fe7a71baa81 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 26 Jul 2019 10:37:58 +0800 Subject: [PATCH 03/80] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=97=B6=E8=AE=A1=E7=AE=97=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E6=88=90=E7=BB=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_commons_controller.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index f92ed8e2e..2f40f3fc2 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -113,6 +113,15 @@ class HomeworkCommonsController < ApplicationController else if @user_course_identity == Course::STUDENT @work = @homework.user_work(current_user.id) + work = @homework.student_works.find_by(user_id: current_user.id) + + # 学生访问列表时计算个人成绩 + myshixun = Myshixun.find_by(shixun_id: @shixun.id, user_id: current_user.id) + if work && myshixun + challenge_settings = @homework.homework_challenge_settings + games = myshixun.games.where(challenge_id: challenge_settings.pluck(:challenge_id)) + HomeworksService.new.update_myshixun_work_score work, myshixun, games, @homework, challenge_settings + end # 学生已提交作品且补交(提交)已截止、作品公开、非匿评阶段 if @work&.work_status.to_i > 0 && (@homework.work_public || @homework.score_open) && From eb4342b95daff342097443f2719505c78fbf99ee Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 26 Jul 2019 13:53:29 +0800 Subject: [PATCH 04/80] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/search_users.json.jbuilder | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/courses/search_users.json.jbuilder b/app/views/courses/search_users.json.jbuilder index d735de970..ac826fdf2 100644 --- a/app/views/courses/search_users.json.jbuilder +++ b/app/views/courses/search_users.json.jbuilder @@ -2,8 +2,8 @@ json.users do json.array! @users do |user| json.id user.id json.name user.real_name - json.student_id user.user_extension.try(:student_id) - json.school_name user.user_extension.school.name + json.student_id user&.student_id + json.school_name user&.school_name json.added @course.course_member?(user.id, 4) end end From e118c736640d2c3b5bb31cc3c9d291e1adfafa30 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 26 Jul 2019 14:11:10 +0800 Subject: [PATCH 05/80] =?UTF-8?q?get=5Fuser=5Finfo=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E8=B5=84=E6=96=99=E7=9A=84=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/get_user_info.json.jbuilder | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/users/get_user_info.json.jbuilder b/app/views/users/get_user_info.json.jbuilder index 164c943d0..d9eb736ad 100644 --- a/app/views/users/get_user_info.json.jbuilder +++ b/app/views/users/get_user_info.json.jbuilder @@ -7,6 +7,7 @@ json.is_teacher @user.user_extension&.teacher? json.user_identity @user.identity json.tidding_count 0 json.user_phone_binded @user.phone.present? +json.profile_completed @user.profile_completed? if @course json.course_identity @course_identity json.course_name @course.name From 1738703bdaa7dea31e94ec2aa74947e075b7aa9b Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 26 Jul 2019 14:24:17 +0800 Subject: [PATCH 06/80] =?UTF-8?q?=E5=B7=B2=E8=AE=A4=E8=AF=81=E7=9A=84?= =?UTF-8?q?=E8=80=81=E5=B8=88=E8=83=BD=E5=A4=9F=E8=B7=B3=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 13 ++++++++++++- app/controllers/myshixuns_controller.rb | 4 ++-- app/helpers/myshixuns_helper.rb | 12 ++++++++++++ app/models/shixun.rb | 1 + app/views/myshixuns/challenges.json.jbuilder | 6 +++--- 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index a51dccb6f..ef648f6b3 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -37,7 +37,8 @@ class GamesController < ApplicationController # 上一关、下一关 prev_game = @game.prev_of_current_game(@shixun.id, @game.myshixun_id, game_challenge.position) - next_game = @game.next_of_current_game(@shixun.id, @game.myshixun_id, game_challenge.position) + #next_game = @game.next_of_current_game(@shixun.id, @game.myshixun_id, game_challenge.position) + next_game = user_next_game(@shixun, game_challenge, @game, @identity) # 关卡点赞数, praise_or_tread = 1则表示赞过 praise_count = game_challenge.praises_count @@ -962,4 +963,14 @@ class GamesController < ApplicationController @identity = current_user.game_identity(@game) raise Educoder::TipException.new(403, "..") if @identity > User::EDU_GAME_MANAGER end + # identity用户身份 + def user_next_game(shixun, challenge, game, identity) + next_game = game.next_of_current_game(shixun.id, game.myshixun_id, challenge.position) + # 实训允许跳关 、 当前关卡已经通关、 用户是已认证的老师以上权限的人,允许跳关 + if shixun.task_pass || game.status == 2 || identity >= User::EDU_CERTIFICATION_TEACHER + next_game + else + nil + end + end end diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index cdeca4871..6fe3e4be8 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -7,9 +7,9 @@ class MyshixunsController < ApplicationController ## TPI关卡列表 def challenges # @challenges = Challenge.where(shixun_id: params[:shixun_id]) - - @shixun_status = @myshixun.shixun.status + @shixun = @myshixun.shixun @games = @myshixun.games.includes(:challenge).reorder("challenges.position") + @identity = current_user.game_identity(@games.first) end diff --git a/app/helpers/myshixuns_helper.rb b/app/helpers/myshixuns_helper.rb index 650f32f40..b7843612d 100644 --- a/app/helpers/myshixuns_helper.rb +++ b/app/helpers/myshixuns_helper.rb @@ -1,2 +1,14 @@ module MyshixunsHelper + + # 获取tpi的identifier, + # identity表示用户关卡的身份 + # task_pass: 实训是否允许跳关 + def get_game_identifier task_pass, game, game_identity + # 允许跳关、 关卡已经开启、 用户是已认证老师以上的身份 + if task_pass || game.status != 3 || game_identity >= User::EDU_CERTIFICATION_TEACHER + game.identifier + else + nil + end + end end diff --git a/app/models/shixun.rb b/app/models/shixun.rb index e35f9f1a6..82f689e3f 100644 --- a/app/models/shixun.rb +++ b/app/models/shixun.rb @@ -4,6 +4,7 @@ class Shixun < ApplicationRecord # status: 0:编辑 1:申请发布 2:正式发布 3:关闭 -1:软删除 # hide_code: 隐藏代码窗口 # code_hidden: 隐藏代码目录 + # task_pass: 跳关 has_many :challenges, dependent: :destroy has_many :challenge_tags, through: :challenges has_many :myshixuns, :dependent => :destroy diff --git a/app/views/myshixuns/challenges.json.jbuilder b/app/views/myshixuns/challenges.json.jbuilder index 802c2b561..0be94d9fd 100644 --- a/app/views/myshixuns/challenges.json.jbuilder +++ b/app/views/myshixuns/challenges.json.jbuilder @@ -3,7 +3,7 @@ json.array! @games do |game| json.partial! 'challenges/challenge', locals: { challenge: challenge } json.status game.status json.star game.star - json.identifier game.identifier - json.get_gold game.user_get_gold_and_experience(@shixun_status, challenge)[0] - json.get_experience game.user_get_gold_and_experience(@shixun_status, challenge)[1] + json.identifier get_game_identifier(@shixun.task_pass, game, @identity) + json.get_gold game.user_get_gold_and_experience(@shixun.status, challenge)[0] + json.get_experience game.user_get_gold_and_experience(@shixun.status, challenge)[1] end \ No newline at end of file From 0648d7a7b9d27de3673830aeec18057fbbe905db Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 26 Jul 2019 14:31:18 +0800 Subject: [PATCH 07/80] =?UTF-8?q?=E9=87=8D=E7=BD=AE=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/myshixuns_controller.rb | 2 +- app/controllers/shixuns_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 6fe3e4be8..fa47fd7f6 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -42,7 +42,7 @@ class MyshixunsController < ApplicationController if e.message != "ActiveRecord::RecordInvalid" logger.error("######delete_repository_error:#{e.message}") end - raise ActiveRecord::Rollback + raise "delete_repository_error:#{e.message}" end end diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 1999c473f..11016cfbb 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -718,7 +718,7 @@ class ShixunsController < ApplicationController logger.error("##########project_fork error #{e.message}") @current_task.destroy! end - raise ActiveRecord::Rollback + raise "实训云平台繁忙(繁忙等级:81)" end end end From dbbd7e9ae4104541a183cf5ff692b3a2aa939a4e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 26 Jul 2019 14:37:35 +0800 Subject: [PATCH 08/80] =?UTF-8?q?=E8=BA=AB=E4=BB=BD=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 2 +- app/helpers/myshixuns_helper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index ef648f6b3..b2de6dcad 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -967,7 +967,7 @@ class GamesController < ApplicationController def user_next_game(shixun, challenge, game, identity) next_game = game.next_of_current_game(shixun.id, game.myshixun_id, challenge.position) # 实训允许跳关 、 当前关卡已经通关、 用户是已认证的老师以上权限的人,允许跳关 - if shixun.task_pass || game.status == 2 || identity >= User::EDU_CERTIFICATION_TEACHER + if shixun.task_pass || game.status == 2 || identity <= User::EDU_CERTIFICATION_TEACHER next_game else nil diff --git a/app/helpers/myshixuns_helper.rb b/app/helpers/myshixuns_helper.rb index b7843612d..2a487e361 100644 --- a/app/helpers/myshixuns_helper.rb +++ b/app/helpers/myshixuns_helper.rb @@ -5,7 +5,7 @@ module MyshixunsHelper # task_pass: 实训是否允许跳关 def get_game_identifier task_pass, game, game_identity # 允许跳关、 关卡已经开启、 用户是已认证老师以上的身份 - if task_pass || game.status != 3 || game_identity >= User::EDU_CERTIFICATION_TEACHER + if task_pass || game.status != 3 || game_identity <= User::EDU_CERTIFICATION_TEACHER game.identifier else nil From c7706f29d12fe8536973acfa65a7a5e6313b26cf Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 14:47:36 +0800 Subject: [PATCH 09/80] toHTML delay --- public/react/src/common/TextUtil.js | 6 ++--- .../components/markdown/MarkdownToHtml.js | 25 ++++++++++++++++--- .../courses/exercise/new/MainDisplay.js | 10 +++++--- .../courses/exercise/new/NullDisplay.js | 8 ++++-- .../exercise/new/QestionDisplayHeader.js | 11 +++++--- .../courses/exercise/new/SingleDisplay.js | 16 ++++++++---- 6 files changed, 55 insertions(+), 21 deletions(-) diff --git a/public/react/src/common/TextUtil.js b/public/react/src/common/TextUtil.js index bd524c4a9..70ca23258 100644 --- a/public/react/src/common/TextUtil.js +++ b/public/react/src/common/TextUtil.js @@ -6,11 +6,9 @@ export function isImageExtension(fileName) { export function markdownToHTML(oldContent, selector) { window.$('#md_div').html('') // markdown to html - try { - - + try { var markdwonParser = window.editormd.markdownToHTML("md_div", { - markdown: oldContent, + markdown: oldContent, // .replace(/▁/g,"▁▁▁"), emoji: true, htmlDecode: "style,script,iframe", // you can filter tags decode taskList: true, diff --git a/public/react/src/common/components/markdown/MarkdownToHtml.js b/public/react/src/common/components/markdown/MarkdownToHtml.js index 266f831ee..0780fc789 100644 --- a/public/react/src/common/components/markdown/MarkdownToHtml.js +++ b/public/react/src/common/components/markdown/MarkdownToHtml.js @@ -1,27 +1,44 @@ import React,{ Component } from "react"; import { markdownToHTML } from 'educoder' +/** + selector 需要传入唯一的selector作为id,不然会引起冲突 + delay 如果有公式,需要传入delay={true} +*/ class MarkdownToHtml extends Component{ constructor(props){ super(props); this.state={ } } + _markdownToHTML = (content, selector) => { + if (this.props.delay == true) { + (function(content, selector) { + // console.log('selector: ', selector) + setTimeout(() => { + markdownToHTML(content, selector) + }, 600) + })(content, selector) + } else { + markdownToHTML(content, selector) + } + } componentDidUpdate = (prevProps) => { if (this.props.content) { if ( prevProps.content != this.props.content ) { - markdownToHTML(this.props.content, `.markdown_to_html_${this.props.selector || ''}`) + this._markdownToHTML(this.props.content, `.markdown_to_html_${this.props.selector || ''}`) } } } componentDidMount () { - this.props.content && markdownToHTML(this.props.content, `.markdown_to_html_${this.props.selector || ''}`) + this.props.content && this._markdownToHTML(this.props.content, `.markdown_to_html_${this.props.selector || ''}`) } render(){ - + const { style, className } = this.props return( -
您需要去完善您的个人资料,才能使用此功能
+')) { // 普通html处理 + window.$(selector).html(oldContent) + } else { + try { + var markdwonParser = window.editormd.markdownToHTML("md_div", { + markdown: oldContent, // .replace(/▁/g,"▁▁▁"), + emoji: true, + htmlDecode: "style,script,iframe", // you can filter tags decode + taskList: true, + tex: true, // 默认不解析 + flowChart: true, // 默认不解析 + sequenceDiagram: true // 默认不解析 + }); - } catch(e) { - console.error(e) + } catch(e) { + console.error(e) + } + + const content = window.$('#md_div').html() + if (selector) { + window.$(selector).html(content) + } + return content } - - const content = window.$('#md_div').html() - if (selector) { - window.$(selector).html(content) - } - return content } export function appendFileSizeToUploadFile(item) { From bcfe17712f2fd626b5ccdbda1e8a5e62947e42bb Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 16:54:18 +0800 Subject: [PATCH 25/80] selector --- public/react/src/modules/courses/busyWork/CommonWorkQuestion.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js b/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js index 7932311b1..49f1e5158 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js @@ -87,7 +87,7 @@ class CommonWorkQuestion extends Component{ {/* 内容区 */}
')) { // 普通html处理 + if (selector && oldContent && oldContent.startsWith('
Date: Fri, 26 Jul 2019 17:54:58 +0800
Subject: [PATCH 31/80] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/login/LoginDialog.js | 30 +++++++++++++++----
.../modules/user/LoginRegisterComponent.js | 4 +--
2 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js
index d3df6090e..a4dee4b4c 100644
--- a/public/react/src/modules/login/LoginDialog.js
+++ b/public/react/src/modules/login/LoginDialog.js
@@ -13,6 +13,7 @@ import axios from 'axios';
import './LoginDialog.css';
import { broadcastChannelPostMessage } from 'educoder'
+import Notcompletedysl from "../user/Notcompletedysl";
const $ = window.$;
var wait = 60;
@@ -100,6 +101,7 @@ class LoginDialog extends Component {
authCodeType:true,
authCodeclass:'log-botton mt5',
isRender: false,
+ MyEduCoderModals:false,
};
}
@@ -365,11 +367,12 @@ class LoginDialog extends Component {
description:response.data.message,
});
}else{
- if(response.data.identity === null || response.data.identity === undefined){
- this.props.history.push("/interesse");
+ if(response.data.profile_completed !== null || response.data.profile_completed === false){
+ this.setMyEduCoderModals();
return;
}
- broadcastChannelPostMessage('refreshPage')
+
+ broadcastChannelPostMessage('refreshPage')
this.setState({
isRender:false
})
@@ -388,17 +391,28 @@ class LoginDialog extends Component {
console.log(error)
})
- }
+ };
+ setNotcompleteds=()=>{
+ this.setState({
+ Notcompleteds:true,
+ MyEduCoderModals:false
+ })
+ };
+ setMyEduCoderModals=()=>{
+ this.setState({
+ MyEduCoderModals:true
+ })
+ };
onKeydowns=(e)=>{
let {disabled}=this.state;
if( disabled===false&& e.keyCode === 13){
this.loginEDU()
console.log(1)
}
- }
+ };
getloginurl=(url)=>{
window.location.href = url;
- }
+ };
render() {
let{open,login,speedy,loginValue,regular,isGoing,isGoingValue,disabled,bottonclass,
dialogBox,shortcutnum,disabledType,gaincode,authCodeType,authCodeclass, isRender}=this.state;
@@ -414,6 +428,10 @@ class LoginDialog extends Component {
disableBackdropClick={true}
onClose={() => this.handleDialogClose()}
>
+ 完善您的资料,将获得更多的使用权限 完善您的资料,将获得更多的使用权限 创建者
- {topicId==undefined?"新建":"编辑"}毕设选题
+ {topicId==undefined?"新建":"编辑"}毕设选题 是否确认删除 ? 关闭后, 实训名称 简介 技术平台
- 列表中没有?
- 申请新建
- 新建申请已提交,请等待管理员的审核 请在配置页面完成后续的评测脚本设置操作 评测脚本 原有脚本将被新的脚本覆盖,无法撤销 是否确认执行覆盖操作 评测脚本生成成功!
- 使用自定义模板,平台无法自动更新脚本, 实训名称 执行命令不能为空 程序最大执行时间 Pod存活时间 命令行 公开程度 发布信息 服务配置 {item.name} 简介 评测脚本 原有脚本将被新的脚本覆盖,无法撤销 是否确认执行覆盖操作 评测脚本生成成功!
+ 使用自定义模板,平台无法自动更新脚本, 执行命令不能为空 程序最大执行时间 Pod存活时间 命令行 公开程度 发布信息
- {
- // this.props.identity<4&&this.props.status==0?
- this.props.identity<5?
- 服务配置 {item.name}
+ {
+ // this.props.identity<4&&this.props.status==0?
+ this.props.identity<5?
+
-
+
-
-
-
+
用户不能再开始挑战了是否确认关闭 ?
- 请在关卡创建完后手动更新脚本中的必填参
- 数和以下2个数组元素:
- challengeProgramNames
- sourceClassNames
- 示例:有2个关卡的实训
- 各关卡的待编译文件为:
- src/step1/HelloWorld.java
- src/step2/Other.java
- 各关卡的编译后生成的执行文件为:
- step1.HelloWorld
- step2.Other
- 则数组元素更新如下:
- challengeProgramNames=("src/step1/
- HelloWorld.java" "src/step2/Other.java")
- sourceClassNames=("step1.HelloWorld
- " "step2.Other")
- 其它参数可按实际需求定制
-
+ 请在关卡创建完后手动更新脚本中的必填参
+ 数和以下2个数组元素:
+ challengeProgramNames
+ sourceClassNames
+ 示例:有2个关卡的实训
+ 各关卡的待编译文件为:
+ src/step1/HelloWorld.java
+ src/step2/Other.java
+ 各关卡的编译后生成的执行文件为:
+ step1.HelloWorld
+ step2.Other
+ 则数组元素更新如下:
+ challengeProgramNames=("src/step1/
+ HelloWorld.java" "src/step2/Other.java")
+ sourceClassNames=("step1.HelloWorld
+ " "step2.Other")
+ 其它参数可按实际需求定制
+