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( -
) diff --git a/public/react/src/modules/courses/exercise/new/MainDisplay.js b/public/react/src/modules/courses/exercise/new/MainDisplay.js index 73e5864d6..0581865d7 100644 --- a/public/react/src/modules/courses/exercise/new/MainDisplay.js +++ b/public/react/src/modules/courses/exercise/new/MainDisplay.js @@ -7,7 +7,7 @@ import { } from 'antd'; import axios from 'axios' import { qNameArray } from './common' -import {getUrl, ActionBtn, markdownToHTML} from 'educoder'; +import {getUrl, ActionBtn, markdownToHTML, MarkdownToHtml} from 'educoder'; import QestionDisplayHeader from './QestionDisplayHeader' const { TextArea } = Input; const confirm = Modal.confirm; @@ -68,10 +68,14 @@ class MainDisplay extends Component{ { standard_answer[0] &&
参考答案:
-
+ {/*
-
+
*/}
} diff --git a/public/react/src/modules/courses/exercise/new/NullDisplay.js b/public/react/src/modules/courses/exercise/new/NullDisplay.js index e61c1d2f7..eade97474 100644 --- a/public/react/src/modules/courses/exercise/new/NullDisplay.js +++ b/public/react/src/modules/courses/exercise/new/NullDisplay.js @@ -7,7 +7,7 @@ import { } from 'antd'; import axios from 'axios' import { qNameArray } from './common' -import {getUrl, ActionBtn, markdownToHTML} from 'educoder'; +import {getUrl, ActionBtn, markdownToHTML, MarkdownToHtml} from 'educoder'; import QestionDisplayHeader from './QestionDisplayHeader' const { TextArea } = Input; const confirm = Modal.confirm; @@ -108,8 +108,12 @@ class NullDisplay extends Component{ 答案(填空{index+1}):
{ answers.answer_text.map((item, itemIndex) => { - return {item} + return })} + {/* {item} */}
}) diff --git a/public/react/src/modules/courses/exercise/new/QestionDisplayHeader.js b/public/react/src/modules/courses/exercise/new/QestionDisplayHeader.js index d4a827a68..7b82b14b6 100644 --- a/public/react/src/modules/courses/exercise/new/QestionDisplayHeader.js +++ b/public/react/src/modules/courses/exercise/new/QestionDisplayHeader.js @@ -7,7 +7,7 @@ import { } from 'antd'; import axios from 'axios' import { qNameArray } from './common' -import {getUrl, ActionBtn, markdownToHTML} from 'educoder'; +import {getUrl, ActionBtn, markdownToHTML, MarkdownToHtml} from 'educoder'; const { TextArea } = Input; const confirm = Modal.confirm; const $ = window.$ @@ -80,8 +80,13 @@ class QestionDisplayHeader extends Component{ } - + { question_title && + + //
+ } ) } diff --git a/public/react/src/modules/courses/exercise/new/SingleDisplay.js b/public/react/src/modules/courses/exercise/new/SingleDisplay.js index 13d1e838c..cbb6da827 100644 --- a/public/react/src/modules/courses/exercise/new/SingleDisplay.js +++ b/public/react/src/modules/courses/exercise/new/SingleDisplay.js @@ -7,7 +7,7 @@ import { } from 'antd'; import axios from 'axios' import QestionDisplayHeader from './QestionDisplayHeader' -import {getUrl, ActionBtn, markdownToHTML} from 'educoder'; +import {getUrl, ActionBtn, markdownToHTML, MarkdownToHtml} from 'educoder'; const { TextArea } = Input; const confirm = Modal.confirm; const $ = window.$ @@ -100,16 +100,22 @@ class SingleDisplay extends Component{ return (
{prefix} - + + {/* */}
) } else { return (
{prefix} - + + {/* */}
) } })} From 7a3151239e6c4d847b75c407590367e0b593f6b4 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 26 Jul 2019 14:55:43 +0800 Subject: [PATCH 10/80] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=B9=9F=E9=9C=80=E8=A6=81=E5=81=9A=E5=AE=8C=E5=96=84=E8=B5=84?= =?UTF-8?q?=E6=96=99=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- app/controllers/shixuns_controller.rb | 2 +- app/controllers/subjects_controller.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 99f942146..e3a9f60e7 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -13,7 +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_account, only: [:new, :create, :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 1999c473f..5876cb54b 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, :shixun_exec] + before_action :check_account, only: [:new, :create, :shixun_exec] before_action :check_auth, except: [:download_file, :index, :menus] diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 586b7352f..bc5b0a607 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -1,7 +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 :check_account, only: [:new, :create] 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 c71da9b6ae8f2330da1c220ecd472c74f829a890 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 26 Jul 2019 15:12:50 +0800 Subject: [PATCH 11/80] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E8=AF=BE=E5=A0=82=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index e3a9f60e7..5753dd462 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -927,12 +927,12 @@ class CoursesController < ApplicationController role = course_message.content == 2 ? '7' : '9' # 7:助教 9:教师 ApplyTeacherRoleJoinCourseNotifyJob.perform_later(current_user.id, course.id, role) - teacher_role = 1 message = "#{course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核" else message = "#{existing_course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核" end end + teacher_role = 1 end if teacher_role && current_user.student_of_course?(course) From 3c5133bcb8cf04006f52ba3945a5da5642dda943 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 26 Jul 2019 15:17:56 +0800 Subject: [PATCH 12/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/controllers/homework_commons_controller.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 2f40f3fc2..29f270a34 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -113,14 +113,14 @@ 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 + if @homework.homework_type == "practice" + 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 end # 学生已提交作品且补交(提交)已截止、作品公开、非匿评阶段 From 552f23fa3964990c456e86541d57eaf770bde647 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 15:18:08 +0800 Subject: [PATCH 13/80] https://www.trustie.net/issues/22475 --- .../src/modules/user/account/AccountBasicEdit.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index 82f7d60d8..e79ffa16b 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -106,6 +106,8 @@ class AccountBasic extends Component { this.setState({ school_id, school: selectedName + }, () => { + this.filterList(name) }) } else if(basicInfo && basicInfo.school_name){ this.setState({ @@ -199,7 +201,7 @@ class AccountBasic extends Component { } // 过滤学校 - filterList=(e)=>{ + filterList =(e)=>{ const inputVal = e.trim() let arr=[]; if(inputVal){ @@ -211,7 +213,7 @@ class AccountBasic extends Component { }) this.setState({ school: inputVal, - filterSchoolList:arr + filterSchoolList: arr }) } else { this.setState({ @@ -254,6 +256,7 @@ class AccountBasic extends Component { this.setState({ department_id: '', departmentsName: e, + filterDepartments: [], }) this.this_department_id = '' return; @@ -261,7 +264,7 @@ class AccountBasic extends Component { this.this_department_id = arr[0].id this.setState({ departmentsName:e, - department_id: arr[0].id + department_id: arr[0].id, }) } @@ -365,7 +368,6 @@ class AccountBasic extends Component { // this.setState({ schoolList }) this.getSchoolList(this.props.basicInfo, name); - this.props.form.setFieldsValue({ name: name }) @@ -716,10 +718,10 @@ class AccountBasic extends Component { { - !filterDepartments || (filterDepartments && filterDepartments.length==0 )&& departmentsName && + (!filterDepartments || (filterDepartments && filterDepartments.length==0 ) || (departmentsName == '' && !this.state.department_id)) &&
- 未找到包含“{departmentsName}”的院系/部门, + {departmentsName ? `未找到包含“${departmentsName}”的院系/部门` : '未找到院系'}, 申请新增
From 14de4e317d669a1b49892eef03930273b151fd48 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 15:24:07 +0800 Subject: [PATCH 14/80] mg --- public/react/src/modules/user/account/AccountBasicEdit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index e79ffa16b..3b12e0456 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -678,7 +678,7 @@ class AccountBasic extends Component { {!filterSchoolList || (filterSchoolList && filterSchoolList.length==0 )&& school && -
+
未找到包含“{school}”的高校, 申请新增 @@ -719,7 +719,7 @@ class AccountBasic extends Component { { (!filterDepartments || (filterDepartments && filterDepartments.length==0 ) || (departmentsName == '' && !this.state.department_id)) && -
+
{departmentsName ? `未找到包含“${departmentsName}”的院系/部门` : '未找到院系'}, 申请新增 From 05b741652d5bb4bd68dd1d08c71b85d71f8f6a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 26 Jul 2019 15:27:16 +0800 Subject: [PATCH 15/80] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E8=B5=84=E6=96=99=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/App.js | 4 + .../courses/coursesPublic/Addcourses.js | 1 - .../react/src/modules/courses/css/Courses.css | 23 +++++- .../paths/PathDetail/DetailCardsEditAndAdd.js | 2 +- .../PathDetail/DetailCardsEditAndEdit.js | 2 +- public/react/src/modules/tpm/NewHeader.js | 32 +++++++- public/react/src/modules/tpm/TPMBanner.js | 25 ++++++- .../tpm/shixunchild/Challenges/Challenges.js | 26 ++++++- .../react/src/modules/user/AccountProfile.js | 74 +++++++++++++++++++ 9 files changed, 176 insertions(+), 13 deletions(-) create mode 100644 public/react/src/modules/user/AccountProfile.js diff --git a/public/react/src/App.js b/public/react/src/App.js index 191b0f0c8..49dac07cd 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -18,6 +18,9 @@ import Notcompletedysl from './modules/user/Notcompletedysl'; import Trialapplicationysl from './modules/login/Trialapplicationysl'; import Trialapplicationreview from './modules/user/Trialapplicationreview'; import Addcourses from "./modules/courses/coursesPublic/Addcourses"; +import AccountProfile from"./modules/user/AccountProfile"; + + import Trialapplication from './modules/login/Trialapplication' import NotFoundPage from './NotFoundPage' @@ -278,6 +281,7 @@ class App extends Component { + {/*{*/} {/* isRender === true?*/} {/* : ""*/} diff --git a/public/react/src/modules/courses/coursesPublic/Addcourses.js b/public/react/src/modules/courses/coursesPublic/Addcourses.js index 922c68650..8225907b8 100644 --- a/public/react/src/modules/courses/coursesPublic/Addcourses.js +++ b/public/react/src/modules/courses/coursesPublic/Addcourses.js @@ -38,7 +38,6 @@ class Addcourses extends Component{ } return response; }, (error) => { - //TODO 这里如果样式变了会出现css不加载的情况 }); diff --git a/public/react/src/modules/courses/css/Courses.css b/public/react/src/modules/courses/css/Courses.css index e214bd81d..f8d0ec76c 100644 --- a/public/react/src/modules/courses/css/Courses.css +++ b/public/react/src/modules/courses/css/Courses.css @@ -1560,9 +1560,28 @@ input.ant-input-number-input:focus { border-radius: 5px; } -.ant-modal-wrap{ - overflow: hidden; +@media screen and (min-width: 1400px) { + .ant-modal-wrap{ + overflow: hidden; + } +} +/* 设置了浏览器宽度不小于1201px时 abc 显示1200px宽度 */ + +@media screen and (max-width: 1400px) { + +} +/* 设置了浏览器宽度不大于1200px时 abc 显示900px宽度 */ + +@media screen and (max-width: 900px) { + +} +/* 设置了浏览器宽度不大于900px时 abc 显示200px宽度 */ + +@media screen and (max-width: 500px) { + } +/* 设置了浏览器宽度不大于500px时 abc 显示100px宽度 */ + /* 试卷答题 */ .stageTable .ant-table-tbody tr:last-child td,.stageTable .ant-table-thead > tr > th{ diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js index 912302cb8..2d7bcc0e0 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js @@ -466,7 +466,7 @@ class DetailCardsEditAndAdd extends Component{ {ChooseShixunList && ChooseShixunList.shixuns_count} 个实训 -
+
{ChooseShixunList && ChooseShixunList.shixuns_count} 个实训 -
+
{ } //头部获取是否已经登录了 getUser=(url)=>{ - console.log("点击了503") - console.log(url); + // console.log("点击了503") + // console.log(url); let{user} =this.state; + if(user===undefined){ this.setState({ isRender:true }) return } + if(user&&user.login===""){ this.setState({ isRender:true }) return; } + + if(user&&user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return; + } + if(url !== undefined || url!==""){ window.location.href = url; } + + } //修改登录方法 @@ -554,6 +566,12 @@ submittojoinclass=(value)=>{ }) } + hideAccountProfile=()=>{ + this.setState({ + AccountProfiletype:false + }) + } + render() { const isLogin = true; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。 const {match ,} = this.props; @@ -568,7 +586,7 @@ submittojoinclass=(value)=>{ Checkboxteachingtype, code_notice, checked_notice, - RadioGroupvalue, + AccountProfiletype, submitapplications, submitapplicationsvalue, user, @@ -610,6 +628,12 @@ submittojoinclass=(value)=>{ {...this.props} />:""} + {AccountProfiletype===true?this.hideAccountProfile()} + {...this.state} + {...this.props} + />:""} +
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/} diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index 5efadc1d1..33dc7fc5b 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -8,6 +8,8 @@ import PropTypes from 'prop-types'; import {Modal,Input,Radio,Pagination,message,Spin,Icon,Tooltip} from 'antd'; +import AccountProfile from"../user/AccountProfile"; + import 'antd/lib/pagination/style/index.css'; import axios from 'axios' @@ -381,6 +383,14 @@ class TPMBanner extends Component { //开始实战按钮 startshixunCombat=(id, reset)=>{ + + if(this.props.current_user&&this.props.current_user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return + } + let {shixunsDetails} = this.props if( shixunsDetails.shixun_status>1){ this.setState({ @@ -455,7 +465,11 @@ class TPMBanner extends Component { }) } - + hideAccountProfile=()=>{ + this.setState({ + AccountProfiletype:false + }) + } render() { let { @@ -480,7 +494,7 @@ class TPMBanner extends Component { shixunsreplace, hidestartshixunsreplacevalue, Forkvisibletype, - Senttothevcaluetype, + AccountProfiletype, isIE} = this.state; let {shixunsDetails, shixunId, star_info, star_infos} = this.props; let challengeBtnTipText = ''; @@ -555,6 +569,13 @@ class TPMBanner extends Component {
+ {AccountProfiletype===true?this.hideAccountProfile()} + {...this.state} + {...this.props} + />:""} + + {this.state.Modalstype===true? { - + if(this.props.current_user&&this.props.current_user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return + } + + debugger let { ChallengesDataList } = this.state; // let id = this.props.match.params.shixunId; this.setState({ @@ -271,8 +280,15 @@ class Challenges extends Component { startshixunCombattype:false }) } + + hideAccountProfile=()=>{ + this.setState({ + AccountProfiletype:false + }) + } + render() { - let { ChallengesDataList, startbtns, sumidtype ,startshixunCombattype,shixunsreplace,shixunsmessage,hidestartshixunsreplacevalue,operationstrue} = this.state; + let { ChallengesDataList, startbtns, sumidtype ,startshixunCombattype,shixunsreplace,shixunsmessage,hidestartshixunsreplacevalue,operationstrue,AccountProfiletype} = this.state; let { loadingContent } = this.props; if (ChallengesDataList != undefined) { this.updatamakedown("ReactMarkdown") @@ -281,6 +297,12 @@ class Challenges extends Component { const antIcon = ; return ( + {AccountProfiletype===true?this.hideAccountProfile()} + {...this.state} + {...this.props} + />:""} + {loadingContent ? { + if (response != undefined) + if (response && response.data.status === 402) { + this.setState({ + AccountProfiletype: true + }) + + } + return response; + }, (error) => { + + }); + + } + + gotoback=()=>{ + if(this.props.AccountProfiletype!=undefined){ + this.setState({ + AccountProfiletype:false + }) + this.props.hideAccountProfile() + }else{ + window.location.href="/"; + this.setState({ + AccountProfiletype:false + }) + } + } + + + +render() { + return( + + + + ) + } +} + +export default AccountProfile; \ No newline at end of file From 65800e57df02150a8e578b3fd6d5650a1c8cd1ad Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 15:35:03 +0800 Subject: [PATCH 16/80] cursor --- public/react/src/modules/user/usersInfo/Infos.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/user/usersInfo/Infos.js b/public/react/src/modules/user/usersInfo/Infos.js index 42a713a88..3b58681da 100644 --- a/public/react/src/modules/user/usersInfo/Infos.js +++ b/public/react/src/modules/user/usersInfo/Infos.js @@ -239,14 +239,14 @@ class Infos extends Component{
{is_current ? "我":"TA"}的经验值 - {data && data.experience}
{is_current ? "我":"TA"}的金币 - {data && data.grade}
@@ -255,14 +255,14 @@ class Infos extends Component{
{is_current ? "我":"TA"}的粉丝 - {data && data.fan_count}
{is_current ? "我":"TA"}的关注 - {data && data.follow_count}
From aa0c889f8f89d15ff78b39d6dccffc380de1b0df Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 15:35:14 +0800 Subject: [PATCH 17/80] cur --- public/react/src/modules/page/Header.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/page/Header.js b/public/react/src/modules/page/Header.js index 05cb62743..1c24b6a52 100644 --- a/public/react/src/modules/page/Header.js +++ b/public/react/src/modules/page/Header.js @@ -100,7 +100,8 @@ class Header extends Component { {/**/} - { grade === 0 ? grade : (grade || '')} + {/* href={`${user.user_url}/user_grade`} target="_blank" */} + { grade === 0 ? grade : (grade || '')}
} From 72e53f97b48fd0fce072d6a1c8bee176d484fcc3 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 15:38:05 +0800 Subject: [PATCH 18/80] selectedName --- public/react/src/modules/user/account/AccountBasicEdit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index 3b12e0456..4a2fd97f1 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -107,7 +107,7 @@ class AccountBasic extends Component { school_id, school: selectedName }, () => { - this.filterList(name) + this.filterList(selectedName) }) } else if(basicInfo && basicInfo.school_name){ this.setState({ From 7a7c2c85d8be2df97a51c4fd059b1e9b66194ff1 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 15:48:23 +0800 Subject: [PATCH 19/80] cate --- public/react/src/modules/user/usersInfo/InfosProject.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/user/usersInfo/InfosProject.js b/public/react/src/modules/user/usersInfo/InfosProject.js index d308e0fd3..6c1f4a666 100644 --- a/public/react/src/modules/user/usersInfo/InfosProject.js +++ b/public/react/src/modules/user/usersInfo/InfosProject.js @@ -125,7 +125,7 @@ class InfosProject extends Component{ :"" } { - (!data || data.projects.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" || category) && + (!data || data.projects.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && } { data && data.projects && data.projects.map((item,key)=>{ From 2d2d92e022bdcbc7b9f6f6e750c1927ed5cc5778 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 15:49:46 +0800 Subject: [PATCH 20/80] cate --- public/react/src/modules/user/usersInfo/InfosCourse.js | 2 +- public/react/src/modules/user/usersInfo/InfosPath.js | 2 +- public/react/src/modules/user/usersInfo/InfosShixun.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/user/usersInfo/InfosCourse.js b/public/react/src/modules/user/usersInfo/InfosCourse.js index 1623e9097..ff5321a9f 100644 --- a/public/react/src/modules/user/usersInfo/InfosCourse.js +++ b/public/react/src/modules/user/usersInfo/InfosCourse.js @@ -130,7 +130,7 @@ class InfosCourse extends Component{ this.props.current_user && this.props.current_user.user_identity != "学生" ? : "" } { - (!data || data.courses.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" || category) && + (!data || data.courses.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && } { data && data.courses && data.courses.map((item,key)=>{ diff --git a/public/react/src/modules/user/usersInfo/InfosPath.js b/public/react/src/modules/user/usersInfo/InfosPath.js index a7b0b95f6..759527a6e 100644 --- a/public/react/src/modules/user/usersInfo/InfosPath.js +++ b/public/react/src/modules/user/usersInfo/InfosPath.js @@ -152,7 +152,7 @@ class InfosPath extends Component{ this.props.current_user && this.props.current_user.user_identity != "学生" ? :"" } { - (!data || data.subjects.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" || category) && + (!data || data.subjects.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && } { data && data.subjects && data.subjects.map((item,key)=>{ diff --git a/public/react/src/modules/user/usersInfo/InfosShixun.js b/public/react/src/modules/user/usersInfo/InfosShixun.js index 7e911202e..bac60fe6f 100644 --- a/public/react/src/modules/user/usersInfo/InfosShixun.js +++ b/public/react/src/modules/user/usersInfo/InfosShixun.js @@ -161,7 +161,7 @@ class InfosShixun extends Component{ :"" } { - (!data || data.shixuns.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" || category) && + (!data || data.shixuns.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && } { data && data.shixuns && data.shixuns.map((item,key)=>{ From d6363626a47aefd03a15c20b1c28e6a79c96c3de Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 26 Jul 2019 15:51:39 +0800 Subject: [PATCH 21/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/controllers/courses_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 5753dd462..a1f37687d 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -117,6 +117,7 @@ class CoursesController < ApplicationController # GET /courses/new def new @course = Course.new + normal_status("成功") end # Get /courses/:id/settings From ef8887bb1d43333446dbc094a8f8763ec399d0ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 26 Jul 2019 16:06:46 +0800 Subject: [PATCH 22/80] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/new/CoursesNew.js | 6 ++++++ public/react/src/modules/paths/PathNew.js | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index 3134a6b58..c6e81d06a 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -78,6 +78,12 @@ class CoursesNew extends Component { console.log(error); }) }else{ + let url = "/courses/new.json" + axios.get(url).then((result) => { + console.log(result) + }).catch((error) => { + console.log(error); + }) // console.log(user_school); this.props.form.setFieldsValue({ school:user_school, diff --git a/public/react/src/modules/paths/PathNew.js b/public/react/src/modules/paths/PathNew.js index 0575fc817..3acad7eed 100644 --- a/public/react/src/modules/paths/PathNew.js +++ b/public/react/src/modules/paths/PathNew.js @@ -158,6 +158,15 @@ class PathNew extends Component{ } componentDidMount() { + + let url = "/paths/new.json" + axios.get(url).then((result) => { + console.log(result) + }).catch((error) => { + console.log(error); + }) + + let pathId = this.props.match.params.pathId; if (pathId) { this.isEditPage = true From ff377294f1c1a9380d573798a5f75398df9fedb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 26 Jul 2019 16:41:12 +0800 Subject: [PATCH 23/80] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/common/CNotificationHOC.js | 24 ++++++--- .../shixunHomework/Listofworksstudentone.js | 51 +++++++++++++------ 2 files changed, 51 insertions(+), 24 deletions(-) diff --git a/public/react/src/modules/courses/common/CNotificationHOC.js b/public/react/src/modules/courses/common/CNotificationHOC.js index a74620764..4dfa25f0b 100644 --- a/public/react/src/modules/courses/common/CNotificationHOC.js +++ b/public/react/src/modules/courses/common/CNotificationHOC.js @@ -18,14 +18,22 @@ export function CNotificationHOC(options = {}) { } showNotification = (description, message = "提示", icon) => { - const data = { - message, - description - } - if (icon) { - data.icon = icon; - } - notification.open(data); + // const data = { + // message, + // description + // } + // if (icon) { + // data.icon = icon; + // } + // notification.open(data); + + notification.open({ + message:message, + description: description, + style: { + zIndex: 99999999 + }, + }); } bytesToSize = (bytes) => { diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 8bb2bbcfd..8ec2ffcbc 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -15,7 +15,8 @@ import { Pagination, Radio, Tooltip, - notification + notification, + Spin, } from "antd"; import './style.css'; import 'moment/locale/zh-cn'; @@ -2253,7 +2254,7 @@ class Listofworksstudentone extends Component { render() { let {columns,course_groupysls,datajs,isAdmin, course_groupyslstwo, unlimited, unlimitedtwo, course_group_info, orders, task_status, checkedValuesine, searchtext, teacherlist, visible,visibles, game_list,columnsstu, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate,computeTimetype} = this.state; - + const antIcon = ; // console.log(this.state.student_works); // console.log("841"); // console.log(this.state.columns); @@ -2384,13 +2385,16 @@ class Listofworksstudentone extends Component { background:#EDEDED; cursor: pointer; } - + .shixunSpin{ + color:#FF6801; + margin-right: 10px; + } `} {computeTimetype===false?
  • + - 正在执行成绩计算,请稍后刷新页面查看结果 - 温馨提示:执行时间因作品数量而异 + 正在执行成绩计算,完成后将为您自动刷新结果。温馨提示:执行时间因作品数量而异
  • :""} @@ -2630,10 +2634,10 @@ class Listofworksstudentone extends Component {
    - - + {computeTimetype===false?
  • + - 正在执行成绩计算,请稍后刷新页面查看结果 - 温馨提示:执行时间因作品数量而异 + 正在执行成绩计算,完成后将为您自动刷新结果。温馨提示:执行时间因作品数量而异
  • :""} @@ -2774,12 +2785,20 @@ class Listofworksstudentone extends Component {
    - + {computeTimetype===false?
  • + - 正在执行成绩计算,请稍后刷新页面查看结果 - 温馨提示:执行时间因作品数量而异 + 正在执行成绩计算,完成后将为您自动刷新结果。温馨提示:执行时间因作品数量而异
  • :""} From 51e215f425f7992453796ec311692a1f71595cef Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 16:52:29 +0800 Subject: [PATCH 24/80] html --- public/react/src/common/TextUtil.js | 40 ++++++++++++++++------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/public/react/src/common/TextUtil.js b/public/react/src/common/TextUtil.js index 70ca23258..05299467b 100644 --- a/public/react/src/common/TextUtil.js +++ b/public/react/src/common/TextUtil.js @@ -6,26 +6,30 @@ export function isImageExtension(fileName) { export function markdownToHTML(oldContent, selector) { window.$('#md_div').html('') // markdown to html - 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 // 默认不解析 - }); + if (selector && oldContent && oldContent.startsWith('

    ')) { // 普通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{ {/* 内容区 */}

    - + { attachments && attachments.map((item) => { return (
    From ae1b31263ca283b3a34d13c902c38a36bbab3499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 26 Jul 2019 17:24:02 +0800 Subject: [PATCH 26/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/user/FindPasswordComponent.js | 2 +- public/react/src/modules/user/LoginRegisterComponent.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/user/FindPasswordComponent.js b/public/react/src/modules/user/FindPasswordComponent.js index 408ca6142..b2e89da52 100644 --- a/public/react/src/modules/user/FindPasswordComponent.js +++ b/public/react/src/modules/user/FindPasswordComponent.js @@ -691,7 +691,7 @@ class LoginRegisterComponent extends Component { this.inputOnBlurzhuche(e)} + // onBlur={(e) => this.inputOnBlurzhuche(e)} onChange={this.loginInputonChange} style={{marginTop: '10px', height: "38px"}}> { Phonenumberisnotco && Phonenumberisnotco !== "" ? diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 1377298a9..081f868a7 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -1028,7 +1028,7 @@ class LoginRegisterComponent extends Component { value={this.state.logins} type="text" autoComplete="off" onChange={this.loginInputonChanges} - onBlur={(e) => this.inputOnBlurzhuche(e, 2)} + // onBlur={(e) => this.inputOnBlurzhuche(e, 2)} style={{marginTop: '30px' , height: '38px',color:'#999999',fontSize:"14px"}}> { Phonenumberisnotcos && Phonenumberisnotcos !== "" ? From 05cedd7bec6657d9f576825fce122a42904e2f5a Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 26 Jul 2019 17:29:58 +0800 Subject: [PATCH 27/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/models/homework_common.rb | 2 +- .../20190726082937_add_is_md_for_homeworks.rb | 12 ++++++++++++ db/migrate/20190726083814_migrate_course_is_md.rb | 14 ++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20190726082937_add_is_md_for_homeworks.rb create mode 100644 db/migrate/20190726083814_migrate_course_is_md.rb diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index ac64b92c1..5f5808944 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -35,7 +35,7 @@ class HomeworkCommon < ApplicationRecord has_many :homework_review_results, :dependent => :destroy validates :name, length: { maximum: 60 } - validates :description, length: { maximum: 5000 } + validates :description, length: { maximum: 10000 } validates :reference_answer, length: { maximum: 5000 } # after_update :update_activity diff --git a/db/migrate/20190726082937_add_is_md_for_homeworks.rb b/db/migrate/20190726082937_add_is_md_for_homeworks.rb new file mode 100644 index 000000000..0b25dde97 --- /dev/null +++ b/db/migrate/20190726082937_add_is_md_for_homeworks.rb @@ -0,0 +1,12 @@ +class AddIsMdForHomeworks < ActiveRecord::Migration[5.2] + def change + # add_column :homework_commons, :is_md, :boolean, :default => true + # add_column :homework_banks, :is_md, :boolean, :default => true + # + # + # add_column :exercise_questions,:is_md, :boolean, :default => true + # add_column :poll_questions,:is_md, :boolean, :default => true + # + # add_column :exercise_bank_questions, :is_md, :boolean, :default => true + end +end diff --git a/db/migrate/20190726083814_migrate_course_is_md.rb b/db/migrate/20190726083814_migrate_course_is_md.rb new file mode 100644 index 000000000..6988db14a --- /dev/null +++ b/db/migrate/20190726083814_migrate_course_is_md.rb @@ -0,0 +1,14 @@ +class MigrateCourseIsMd < ActiveRecord::Migration[5.2] + def change + # HomeworkCommon.where(homework_type: [1, 3]).where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false) + # HomeworkBank.where(homework_type: [1, 3]).where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false) + # + # HomeworkCommon.where(homework_type: [1, 3]).where("created_at >= '2019-07-21 00:00:00' and homework_bank_id is not null").each do |homework| + # + # end + # + # ExerciseQuestion.where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false) + # PollQuestion.where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false) + # ExerciseBankQuestion.where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false) + end +end From a97c4f9d82c8542969a5a63e942bdf926f60f816 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 17:31:20 +0800 Subject: [PATCH 28/80] select --- public/react/src/modules/user/account/AccountBasicEdit.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index 4a2fd97f1..a4637c00e 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -402,6 +402,7 @@ class AccountBasic extends Component { filterDepartments, school, school_id, + departments, departmentsName, identity }=this.state; @@ -718,7 +719,9 @@ class AccountBasic extends Component { { - (!filterDepartments || (filterDepartments && filterDepartments.length==0 ) || (departmentsName == '' && !this.state.department_id)) && + (!filterDepartments || (filterDepartments && filterDepartments.length==0 ) + || (departmentsName == '' && !this.state.department_id + && (!departments || departments.length == 0) )) &&
    {departmentsName ? `未找到包含“${departmentsName}”的院系/部门` : '未找到院系'}, From 4e94aae89b614503de35694b2a5417ed32ce3740 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 26 Jul 2019 17:33:58 +0800 Subject: [PATCH 29/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/models/homework_common.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index 5f5808944..9aa4a8fe1 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -35,7 +35,7 @@ class HomeworkCommon < ApplicationRecord has_many :homework_review_results, :dependent => :destroy validates :name, length: { maximum: 60 } - validates :description, length: { maximum: 10000 } + validates :description, length: { maximum: 15000 } validates :reference_answer, length: { maximum: 5000 } # after_update :update_activity From bd93a5aaec6d6e8ecf9c5423fe351ad752578c88 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 17:45:15 +0800 Subject: [PATCH 30/80]

    ')) { // 普通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()} > + {this.setNotcompleteds()}} + /> {isRender===true?

    {this.handleDialogClose()}}> diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 081f868a7..9b1533bea 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -340,8 +340,8 @@ class LoginRegisterComponent extends Component { } - 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; } From 7e1a42dc52939cbb114603da39eb649ba1ffe2a5 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 18:10:16 +0800 Subject: [PATCH 32/80] ctr s --- .../page/component/monaco/TPIMonaco.js | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/public/react/src/modules/page/component/monaco/TPIMonaco.js b/public/react/src/modules/page/component/monaco/TPIMonaco.js index 2ebdb5eab..26f020586 100644 --- a/public/react/src/modules/page/component/monaco/TPIMonaco.js +++ b/public/react/src/modules/page/component/monaco/TPIMonaco.js @@ -320,20 +320,23 @@ class TPIMonaco extends Component { editor.focus(); }, 600) - + window.editor_monaco.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_S, () => { + this.props.doFileUpdateRequestOnCodeMirrorBlur(); + return false; + }); }) - window.document.onkeydown = (e) => { - e = window.event || e; - if(e.keyCode== 83 && e.ctrlKey){ - /*延迟,兼容FF浏览器 */ - // setTimeout(function(){ - // alert('ctrl+s'); - // },1); - this.props.doFileUpdateRequestOnCodeMirrorBlur(); - return false; - } - }; + // window.document.onkeydown = (e) => { + // e = window.event || e; + // if(e.keyCode== 83 && e.ctrlKey){ + // /*延迟,兼容FF浏览器 */ + // // setTimeout(function(){ + // // alert('ctrl+s'); + // // },1); + // this.props.doFileUpdateRequestOnCodeMirrorBlur(); + // return false; + // } + // }; } onFontSizeChange = (value) => { toStore('cmFontSize', value) From 38c2061d8b6a4d2435ba91558b342e987f6bcffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 26 Jul 2019 18:29:06 +0800 Subject: [PATCH 33/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 | 5 +--- .../modules/user/LoginRegisterComponent.js | 22 +++++++------- .../react/src/modules/user/Notcompletedysl.js | 30 +++++++++++-------- 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index a4dee4b4c..50038366d 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -367,10 +367,7 @@ class LoginDialog extends Component { description:response.data.message, }); }else{ - if(response.data.profile_completed !== null || response.data.profile_completed === false){ - this.setMyEduCoderModals(); - return; - } + broadcastChannelPostMessage('refreshPage') this.setState({ diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 9b1533bea..9006dc64c 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -340,10 +340,10 @@ class LoginRegisterComponent extends Component { } - if(response.data.profile_completed !== null || response.data.profile_completed === false){ - this.setMyEduCoderModals(); - return; - } + // if(response.data.profile_completed !== null || response.data.profile_completed === false){ + // this.setMyEduCoderModals(); + // return; + // } if (response.status === 200) { if (response.data.status === 402) { @@ -458,13 +458,13 @@ class LoginRegisterComponent extends Component { return; } }else { - this.setState({ - logins: "", - dragOk: false, - codes: "", - passwords: "", - Agreetotheterms: "", - }) + // this.setState({ + // logins: "", + // dragOk: false, + // codes: "", + // passwords: "", + // Agreetotheterms: "", + // }) this.setMyEduCoderModals(); } } diff --git a/public/react/src/modules/user/Notcompletedysl.js b/public/react/src/modules/user/Notcompletedysl.js index f9c260209..e15a118ff 100644 --- a/public/react/src/modules/user/Notcompletedysl.js +++ b/public/react/src/modules/user/Notcompletedysl.js @@ -16,19 +16,25 @@ class Notcompletedysl extends Component { // console.log("Notcompletedysl"); // console.log("开发了402了"); - axios.interceptors.response.use((response) => { - // console.log(response); - if (response != undefined) - if (response && response.data.status === 402) { - this.setState({ - modalsType: true - }) - } - return response; - }, (error) => { - //TODO 这里如果样式变了会出现css不加载的情况 + if(this.props.modalsType!=undefined){ + this.setState({ + modalsType:this.props.modalsType + }) + } - }); + // axios.interceptors.response.use((response) => { + // // console.log(response); + // if (response != undefined) + // if (response && response.data.status === 402) { + // this.setState({ + // modalsType: true + // }) + // } + // return response; + // }, (error) => { + // //TODO 这里如果样式变了会出现css不加载的情况 + // + // }); } From a5e1645c38e797315f0dd4c91d6ca33481e640f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 26 Jul 2019 18:37:07 +0800 Subject: [PATCH 34/80] b --- public/react/src/modules/user/LoginRegisterComponent.js | 4 ++-- public/react/src/modules/user/Notcompletedysl.js | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 9006dc64c..3f54149bf 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -1038,10 +1038,10 @@ class LoginRegisterComponent extends Component { :
    } - {this.setNotcompleteds()}} - /> + />:""} { Whethertoverify===false&&pciphone===true? diff --git a/public/react/src/modules/user/Notcompletedysl.js b/public/react/src/modules/user/Notcompletedysl.js index e15a118ff..fc70f838e 100644 --- a/public/react/src/modules/user/Notcompletedysl.js +++ b/public/react/src/modules/user/Notcompletedysl.js @@ -16,12 +16,6 @@ class Notcompletedysl extends Component { // console.log("Notcompletedysl"); // console.log("开发了402了"); - if(this.props.modalsType!=undefined){ - this.setState({ - modalsType:this.props.modalsType - }) - } - // axios.interceptors.response.use((response) => { // // console.log(response); // if (response != undefined) @@ -61,7 +55,7 @@ class Notcompletedysl extends Component { destroyOnClose={true} title="提示" centered={true} - visible={this.state.modalsType} + visible={this.props.modalsType} width="530px" >
    From d77a383a57394685e427b4433bf29ebd4c97457f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 26 Jul 2019 18:50:33 +0800 Subject: [PATCH 35/80] b --- .../courses/coursesDetail/CoursesBanner.js | 27 +++++++++++++++++-- public/react/src/modules/tpm/NewHeader.js | 20 ++++++++++++-- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index cc3646b9d..afe7b606a 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -4,6 +4,7 @@ import axios from 'axios'; import {getImageUrl, trigger, on, off} from 'educoder'; import { Tooltip, message,Popover} from 'antd'; import CoursesListType from '../coursesPublic/CoursesListType'; +import AccountProfile from"../../user/AccountProfile"; import Addcourses from '../coursesPublic/Addcourses'; import '../css/Courses.css'; import Modals from "../../modals/Modals"; @@ -88,6 +89,13 @@ class CoursesBanner extends Component { } tojoinclass = (val) => { + if(this.props.current_user&&this.props.current_user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return + } + if (val === 1) { this.setState({ Addcoursestypes: true, @@ -326,15 +334,30 @@ class CoursesBanner extends Component { postsettings=()=>{ window.location.href = "/courses/" + this.props.match.params.coursesId + "/settings"; } + + + hideAccountProfile=()=>{ + this.setState({ + AccountProfiletype:false + }) + } + render() { - let { Addcoursestypes, coursedata, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,is_guide} = this.state; + let { Addcoursestypes, coursedata, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,is_guide,AccountProfiletype} = this.state; return (
    { is_guide && } - + + {AccountProfiletype===true?this.hideAccountProfile()} + {...this.state} + {...this.props} + />:""} + + { coursedata === undefined || coursedata.status===401?
    :
    diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index e0eb5d02b..b89d59fe7 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -182,7 +182,15 @@ class NewHeader extends Component { }) return; } - this.setState({ + + if(user&&user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return; + } + + this.setState({ Addcoursestypes:true, }) } @@ -201,7 +209,15 @@ class NewHeader extends Component { }) return; } - this.setState({ + + if(user&&user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return; + } + + this.setState({ tojoinitemtype:true }) } From ae1f2a01f10a12062c3e520daa74464aa455d552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 26 Jul 2019 18:57:52 +0800 Subject: [PATCH 36/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 --- .../modules/paths/PathDetail/DetailCards.js | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/paths/PathDetail/DetailCards.js b/public/react/src/modules/paths/PathDetail/DetailCards.js index fc75961ec..3c159782a 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCards.js +++ b/public/react/src/modules/paths/PathDetail/DetailCards.js @@ -1,14 +1,14 @@ import React, { Component } from 'react'; import {getImageUrl} from 'educoder'; import {Tooltip,Modal,Icon,Spin,message} from 'antd'; -import '../../paths/ShixunPaths.css'; import DetailCardsEditAndAdd from './DetailCardsEditAndAdd'; import DetailCardsEditAndEdit from './DetailCardsEditAndEdit'; +import AccountProfile from"../user/AccountProfile"; import { BrowserRouter as Router, Route, Link } from "react-router-dom"; import axios from 'axios'; import { DragDropContext , Draggable, Droppable} from 'react-beautiful-dnd'; import Modals from '../../modals/Modals'; - +import '../../paths/ShixunPaths.css'; const $ = window.$ // // //a little function to help us with reordering the result @@ -193,7 +193,12 @@ class DetailCards extends Component{ } startgameid=(id)=>{ - + if(this.props.current_user&&this.props.current_user.profile_completed===false){ + this.setState({ + AccountProfiletype:true + }) + return + } let url = "/shixuns/" + id + "/shixun_exec.json"; axios.get(url).then((response) => { @@ -292,10 +297,16 @@ class DetailCards extends Component{ startshixunCombattype:false }) } - render(){ + hideAccountProfile=()=>{ + this.setState({ + AccountProfiletype:false + }) + } + + render(){ let { pathCardsList, dropid, - dropidtype, + AccountProfiletype, idsum, pathCardsedittype, pathlistedit, @@ -317,6 +328,12 @@ class DetailCards extends Component{ return(
    + {AccountProfiletype===true?this.hideAccountProfile()} + {...this.state} + {...this.props} + />:""} + Date: Fri, 26 Jul 2019 19:00:13 +0800 Subject: [PATCH 37/80] b --- public/react/src/modules/paths/PathDetail/DetailCards.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/paths/PathDetail/DetailCards.js b/public/react/src/modules/paths/PathDetail/DetailCards.js index 3c159782a..19894e856 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCards.js +++ b/public/react/src/modules/paths/PathDetail/DetailCards.js @@ -3,7 +3,7 @@ import {getImageUrl} from 'educoder'; import {Tooltip,Modal,Icon,Spin,message} from 'antd'; import DetailCardsEditAndAdd from './DetailCardsEditAndAdd'; import DetailCardsEditAndEdit from './DetailCardsEditAndEdit'; -import AccountProfile from"../user/AccountProfile"; +import AccountProfile from"../../user/AccountProfile"; import { BrowserRouter as Router, Route, Link } from "react-router-dom"; import axios from 'axios'; import { DragDropContext , Draggable, Droppable} from 'react-beautiful-dnd'; From 56d7f26f51cf39afbbc22361736fae556a2bf6a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 26 Jul 2019 19:16:34 +0800 Subject: [PATCH 38/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 --- .../courses/shixunHomework/ShixunStudentWork.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js index 0c808e01d..4bb44b697 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js @@ -23,7 +23,8 @@ import { Radio, Tooltip, notification, - Pagination + Pagination, + Spin, } from "antd"; import {Link, Switch, Route, Redirect} from 'react-router-dom'; import axios from 'axios'; @@ -653,7 +654,7 @@ class ShixunStudentWork extends Component { ) } - + const antIcon = ; return (
    {this.state.showmodel===true?
  • + - 正在执行查重,请稍后刷新页面查看结果 温馨提示:执行时间因查重作品数以及作品的代码量而异 + 正在执行查重,完成后将为您自动刷新结果。 温馨提示:执行时间因查重作品数以及作品的代码量而异
  • From ea3a2ea3d6b2ad81eb77e6187562042e88d06ed7 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 19:19:00 +0800 Subject: [PATCH 39/80] current_user --- .../react/src/modules/user/modal/RealNameCertificationModal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/user/modal/RealNameCertificationModal.js b/public/react/src/modules/user/modal/RealNameCertificationModal.js index bdd2270ae..1d17b7c20 100644 --- a/public/react/src/modules/user/modal/RealNameCertificationModal.js +++ b/public/react/src/modules/user/modal/RealNameCertificationModal.js @@ -132,7 +132,7 @@ class RealNameCertificationModal extends Component{ multiple: true, showUploadList: false, // https://newweb.educoder.net - action: `/api/users/accounts/${this.props.current_user.login}/auth_attachment.json`, + action: this.props.current_user ? `/api/users/accounts/${this.props.current_user.login}/auth_attachment.json` : '', className: 'idPic-uploader', onChange: this.handleChange2, }; From fb6c8c24b4b8253e2da7817172410c10f5788de6 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 26 Jul 2019 23:43:51 +0800 Subject: [PATCH 40/80] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=AD=A6=E6=A0=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index a1f37687d..5b7929d1e 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1221,7 +1221,7 @@ class CoursesController < ApplicationController @user_activity_level = [] course_user_level = [] course_activity_title = "课堂活跃度统计" - user_cell_head = %w(排名 真实姓名 登录名 邮箱 学号 分班 作业完成数(*10) 试卷完成数(*10) 问卷完成数(*7) 资源发布数(*5) 帖子发布数(*2) 帖子回复数(*1) 作业回复数(*1) 活跃度) + user_cell_head = %w(排名 真实姓名 登录名 邮箱 学号 学校 分班 作业完成数(*10) 试卷完成数(*10) 问卷完成数(*7) 资源发布数(*5) 帖子发布数(*2) 帖子回复数(*1) 作业回复数(*1) 活跃度) all_members.each do |u| #用户的基本信息 user = u.user @@ -1229,8 +1229,9 @@ class CoursesController < ApplicationController user_name = user.real_name user_mail = user.mail user_stu_id = u.student_id.present? ? (u.student_id.to_s + "\t") : "--" + user_school = u.school_name user_course_group = u.course_group_name - user_info_array = [user_login,user_name,user_mail,user_stu_id,user_course_group] #用户的信息集合 + user_info_array = [user_login,user_name,user_mail,user_stu_id,user_school,user_course_group] #用户的信息集合 user_work_scores = [] #课堂活跃度统计 @@ -1372,7 +1373,7 @@ class CoursesController < ApplicationController course_user_score_title = "学生总成绩" score_title_cells = shixun_titles + common_titles + group_titles + task_titles + exercise_titles score_title_counts = [shixun_titles.count,common_titles.count,group_titles.count,task_titles.count,exercise_titles.count] - score_cell_head = %w(序号 真实姓名 登录名 邮箱 学号 分班) + score_title_cells + ["个人总成绩"] + score_cell_head = %w(序号 真实姓名 登录名 邮箱 学号 学校 分班) + score_title_cells + ["个人总成绩"] @course_user_scores = [course_user_score_title,score_cell_head,score_title_counts,total_user_score_array] #作业的全部集合 From 1447be54d24c604b2b7c2df4923045e015d57070 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 26 Jul 2019 23:45:43 +0800 Subject: [PATCH 41/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/controllers/courses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 5b7929d1e..897fb34b9 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1229,7 +1229,7 @@ class CoursesController < ApplicationController user_name = user.real_name user_mail = user.mail user_stu_id = u.student_id.present? ? (u.student_id.to_s + "\t") : "--" - user_school = u.school_name + user_school = user.school_name user_course_group = u.course_group_name user_info_array = [user_login,user_name,user_mail,user_stu_id,user_school,user_course_group] #用户的信息集合 user_work_scores = [] From 5b629fb285c08be6d9e9f3251989e1c2419a3d19 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 26 Jul 2019 23:55:33 +0800 Subject: [PATCH 42/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/controllers/courses_controller.rb | 19 ++++++++++--------- .../export_member_scores_excel.xlsx.axlsx | 1 + 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 897fb34b9..bdb367111 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1255,15 +1255,16 @@ class CoursesController < ApplicationController u_2: user_login, u_2_1: user_mail, u_3: user_stu_id, - u_4: user_course_group, - u_5: c_works_num, - u_6: c_exercise_num, - u_7: c_poll_num, - u_8: c_file_num, - u_9: c_message_num, - u_10: c_reply_num, - u_11: user_work_reply_num, - u_12: user_activity_levels + u_4: user_school, + u_5: user_course_group, + u_6: c_works_num, + u_7: c_exercise_num, + u_8: c_poll_num, + u_9: c_file_num, + u_10: c_message_num, + u_11: c_reply_num, + u_12: user_work_reply_num, + u_13: user_activity_levels } course_user_level.push(user_ac_level) diff --git a/app/views/courses/export_member_scores_excel.xlsx.axlsx b/app/views/courses/export_member_scores_excel.xlsx.axlsx index 5b226a09c..4750304e4 100644 --- a/app/views/courses/export_member_scores_excel.xlsx.axlsx +++ b/app/views/courses/export_member_scores_excel.xlsx.axlsx @@ -59,6 +59,7 @@ wb.styles do |s| sheet.merge_cells("D1:D2") sheet.merge_cells("E1:E2") sheet.merge_cells("F1:F2") + sheet.merge_cells("G1:G2") sheet.merge_cells (Axlsx::cell_r(sheet_length-1,0) + ':' + Axlsx::cell_r(sheet_length-1,1)) #最后一行的合并 sheet_first = sheet.rows.first #第一行 sheet_second = sheet.rows.second #第二行 From d0ede523cdbacc64b1c2f67472aedfdf7e7b34fd Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 27 Jul 2019 00:00:07 +0800 Subject: [PATCH 43/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/export_member_scores_excel.xlsx.axlsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/courses/export_member_scores_excel.xlsx.axlsx b/app/views/courses/export_member_scores_excel.xlsx.axlsx index 4750304e4..db4f06ab1 100644 --- a/app/views/courses/export_member_scores_excel.xlsx.axlsx +++ b/app/views/courses/export_member_scores_excel.xlsx.axlsx @@ -65,13 +65,13 @@ wb.styles do |s| sheet_second = sheet.rows.second #第二行 work_head_title = %w(实训作业 普通作业 分组作业 毕设任务 试卷) (0..(sheet_length-1)).each do |i| - if i <= 5 || i == sheet_length-1 + if i <= 6 || i == sheet_length-1 sheet_first.cells[i].value = sheet_title[i] else sheet_second.cells[i].value = sheet_title[i] end end - st_col = 6 + st_col = 7 sheet_title_counts.each_with_index do |c,index| end_col = (st_col + c - 1) sheet.merge_cells sheet_first.cells[(st_col..end_col)] From abf2789c7a60dfea69d1bb619c423f7cbdc9021b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 27 Jul 2019 08:57:56 +0800 Subject: [PATCH 44/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/user/LoginRegisterComponent.js | 1 - 1 file changed, 1 deletion(-) diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 3f54149bf..fa56398e2 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -358,7 +358,6 @@ class LoginRegisterComponent extends Component { weekArray="/"; } window.location.href = weekArray; - } } From 4f1430c914b71ea0345ce38637b7c74c06485313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 27 Jul 2019 09:14:14 +0800 Subject: [PATCH 45/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 --- .../react/src/modules/user/LoginRegisterComponent.js | 10 ++++++++-- public/react/src/modules/user/Notcompletedysl.js | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index fa56398e2..eb0a3a5c2 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -65,6 +65,7 @@ class LoginRegisterComponent extends Component { Whethertoverify:false, pciphone:true, MyEduCoderModals:false, + registered:undefined, } } @@ -101,6 +102,7 @@ class LoginRegisterComponent extends Component { Whethertoverify:false, pciphone:true, MyEduCoderModals:false, + registered:undefined, } } @@ -880,12 +882,15 @@ class LoginRegisterComponent extends Component { setNotcompleteds=()=>{ this.setState({ Notcompleteds:true, - MyEduCoderModals:false + MyEduCoderModals:false, + registered:undefined, + }) }; setMyEduCoderModals=()=>{ this.setState({ - MyEduCoderModals:true + MyEduCoderModals:true, + registered:"注册成功" }) }; render() { @@ -1039,6 +1044,7 @@ class LoginRegisterComponent extends Component { } {this.state.MyEduCoderModals===true? {this.setNotcompleteds()}} />:""} diff --git a/public/react/src/modules/user/Notcompletedysl.js b/public/react/src/modules/user/Notcompletedysl.js index fc70f838e..8f147957a 100644 --- a/public/react/src/modules/user/Notcompletedysl.js +++ b/public/react/src/modules/user/Notcompletedysl.js @@ -53,13 +53,13 @@ class Notcompletedysl extends Component { closable={false} footer={null} destroyOnClose={true} - title="提示" + title={this.props.registered===undefined?"提示":"注册成功"} centered={true} visible={this.props.modalsType} width="530px" >
    -

    完善您的资料,将获得更多的使用权限

    +

    完善您的资料,将获得更多的使用权限

    this.modalCancel()}>取消 this.setDownload()}>立即完善 From bc9ee87ee18820bfcc59f3401ac9a2cdfe46fe23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 27 Jul 2019 09:47:47 +0800 Subject: [PATCH 46/80] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/component/TPMRightSection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/component/TPMRightSection.js b/public/react/src/modules/tpm/component/TPMRightSection.js index a3a7e9820..fd96454c4 100644 --- a/public/react/src/modules/tpm/component/TPMRightSection.js +++ b/public/react/src/modules/tpm/component/TPMRightSection.js @@ -67,7 +67,7 @@ class TPMRightSection extends Component {

    创建者

    - + 头像
    From de3261c9a053643f28765551368b5edc521f4cc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 27 Jul 2019 10:05:20 +0800 Subject: [PATCH 47/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/courses/poll/PollNew.js | 2 +- .../src/modules/courses/shixunHomework/ShixunWorkReport.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index cd559b75f..705b1658c 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -2388,7 +2388,7 @@ class PollNew extends Component { this.gotohome()}>{this.props.coursedata.name} > 问卷 + href={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}>问卷 > {this.props.match.params.news === undefined ? "新建" : this.props.match.params.news === "new" ? "新建" : "编辑"}

    diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 91f6f3001..565121e1b 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -135,7 +135,7 @@ class ShixunWorkReport extends Component { {data===undefined?"":data.category===null?"":data.category.category_name} > - 作业详情 + 作业详情 > {data&&data.username}

    From 1dfa7a3bf916e6187b91d63f0aa6fa6e3afda98a Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 27 Jul 2019 10:06:31 +0800 Subject: [PATCH 48/80] =?UTF-8?q?=E8=B5=84=E6=BA=90=E9=99=90=E5=88=B6?= =?UTF-8?q?=E6=B2=A1=E5=80=BC=EF=BC=8C=E5=B0=B1=E4=BC=A0=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index af0158cfd..f01ad4b6b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -442,12 +442,18 @@ class ApplicationController < ActionController::Base shixun.shixun_service_configs.each do |config| mirror = config.mirror_repository if mirror.name.present? + # 资源限制没有就传默认值。 + cpu_limit = config.cpu_limit.presence || 1 + cpu_request = config.lower_cpu_limit.presence || 0.1 + memory_limit = config.memory_limit.presence || 1024 + request_limit = config.resource_limit.presence || 10 + resource_limit = config.resource_limit.presence || 10000 container << {:image => mirror.name, - :cpuLimit => config.cpu_limit, - :cpuRequest => config.lower_cpu_limit, - :memoryLimit => "#{config.memory_limit}M", - :memoryRequest => "#{config.request_limit}M", - :resourceLimit => "#{config.resource_limit}K", + :cpuLimit => cpu_limit, + :cpuRequest => cpu_request, + :memoryLimit => "#{memory_limit}M", + :memoryRequest => "#{request_limit}M", + :resourceLimit => "#{resource_limit}K", :type => mirror.try(:main_type) == "1" ? "main" : "sub"} end end From 8c393990f0210310eb288a6de4d03354d90753e9 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 27 Jul 2019 10:16:55 +0800 Subject: [PATCH 49/80] height 40 --- public/react/src/modules/courses/boards/BoardsNew.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/react/src/modules/courses/boards/BoardsNew.js b/public/react/src/modules/courses/boards/BoardsNew.js index 8d9db7c3f..03c5f84f8 100644 --- a/public/react/src/modules/courses/boards/BoardsNew.js +++ b/public/react/src/modules/courses/boards/BoardsNew.js @@ -297,6 +297,9 @@ class BoardsNew extends Component{ .courseForm .noBorder { border-bottom: none; } + .courseForm .ant-input-group > .ant-input:first-child, .ant-input-group-addon:first-child { + height: 40px; + } `}
    Date: Sat, 27 Jul 2019 10:39:27 +0800 Subject: [PATCH 50/80] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E7=9A=84=E6=9C=80?= =?UTF-8?q?=E5=B0=8F=E9=80=89=E9=A1=B9=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_votes_controller.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/controllers/poll_votes_controller.rb b/app/controllers/poll_votes_controller.rb index b1191d8ea..b376b870f 100644 --- a/app/controllers/poll_votes_controller.rb +++ b/app/controllers/poll_votes_controller.rb @@ -147,9 +147,17 @@ class PollVotesController < ApplicationController else question_max_choices = 0 end + if @poll_question.min_choices.present? + question_min_choices = @poll_question.min_choices + else + question_min_choices = 0 + end if question_max_choices > 0 && (user_vote_count > question_max_choices) normal_status(-1,"多选题答案超过最大限制!") end + if question_min_choices > 0 && (user_vote_count < question_min_choices) + normal_status(-1,"多选题答题不得少于最小限制!") + end elsif (poll_user.present? && poll_user.commit_status == 1) || poll_user_status == 3 normal_status(-1,"已提交/已结束的问卷不允许修改!") end From 14ce4c695f65904ef805fc61e22a37b7f3b80f9d Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 27 Jul 2019 10:40:56 +0800 Subject: [PATCH 51/80] 40 --- .../src/modules/courses/boards/BoardsNew.js | 4 +--- .../react/src/modules/courses/css/Courses.css | 20 +++++++++++++++++++ .../courses/members/modal/AddStudentModal.js | 2 +- .../courses/members/modal/AddTeacherModal.js | 2 +- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/boards/BoardsNew.js b/public/react/src/modules/courses/boards/BoardsNew.js index 03c5f84f8..7c48d372b 100644 --- a/public/react/src/modules/courses/boards/BoardsNew.js +++ b/public/react/src/modules/courses/boards/BoardsNew.js @@ -297,9 +297,7 @@ class BoardsNew extends Component{ .courseForm .noBorder { border-bottom: none; } - .courseForm .ant-input-group > .ant-input:first-child, .ant-input-group-addon:first-child { - height: 40px; - } + `}
    .ant-input:first-child, .ant-input-group-addon:first-child { + height: 40px; +} +.courseForm .ant-select-selection, .courseForm .ant-select-selection-selected-value { + height: 40px; + line-height: 40px; +} +.courseForm .ant-input-affix-wrapper .ant-input { + height: 40px; +} +.courseForm .ant-select-auto-complete.ant-select .ant-input { + height: 40px; +} + +.courseForm .ant-select-auto-complete.ant-select .ant-select-selection__rendered { + line-height: 40px; +} +.courseForm .ant-select-auto-complete.ant-select .ant-input { + height: 40px; +} /*新建课堂*/ diff --git a/public/react/src/modules/courses/members/modal/AddStudentModal.js b/public/react/src/modules/courses/members/modal/AddStudentModal.js index c3d8cdd75..97e1a4bbe 100644 --- a/public/react/src/modules/courses/members/modal/AddStudentModal.js +++ b/public/react/src/modules/courses/members/modal/AddStudentModal.js @@ -159,7 +159,7 @@ class AddStudentModal extends Component{ title={`添加${moduleName}`} {...this.props } onOk={this.onOk} - className="addStudentModal" + className="addStudentModal courseForm" > -
    -

    - {course_name} - > - {left_banner_name} - > - {topicId==undefined?"新建":"编辑"} -

    -
    -

    {topicId==undefined?"新建":"编辑"}毕设选题

    - this.props.history.goBack()} className="color-grey-6 fr font-16">返回 -
    - -
    -
    - - {getFieldDecorator('tea_id', { - rules: [{ - required: true, message: '请选择指导老师' - }], - })( - - )} - - - {getFieldDecorator('name', { - rules: [{ - required: true, message: '请输入选题名称', - }, { - max: 60, message: '最大限制为60个字符', - }], - })( - - )} - -
    - - - -
    - - - {getFieldDecorator('description', { - rules: [{ - required: true, message: '请输入选题简介', - }, { - max: 10000, message: '最大限制为10000个字符', - }], - })( - - )} - - - { - getFieldDecorator('file',{ - rules:[{ - required:false - }] - })( - - - (单个文件150M以内) - - ) - } - -
    - - {getFieldDecorator('topic_type', { - rules: [{ - required: false, message: '', - }], - })( - - )} - - - {getFieldDecorator('topic_source', { - rules: [{ - required: false, message: '', - }], - })( - - )} - - - {getFieldDecorator('topic_property_first', { - rules: [{ - required: false, message: '', - }], - })( - - )} - - - {getFieldDecorator('topic_property_second', { - rules: [{ - required: false, message: '', - }], - })( - - )} - -
    -
    - - - - - -
    - - {getFieldDecorator('source_unit', { - rules: [{ - required: false, message: '', - }], - })( - - )} - - - {getFieldDecorator('topic_repeat', { - rules: [{ - required: false, message: '', - }], - })( - - )} - - - {getFieldDecorator('city', { - rules: [{ - initialValue: this.state.cityDefaultValue, - type: 'array', - required: false, message: '', - }], - })( - - )} - -
    - - -
    - - this.props.history.goBack()}>取消 -
    -
    - -
    -
    - ) - } -} - -const WrappedGraduateTopicNew = Form.create({ name: 'topicPostWorksNew' })(GraduateTopicNew); -// RouteHOC() +import React,{ Component } from "react"; + +import { + Form, Input, InputNumber, Switch, Radio, + Slider, Button, Upload, Icon, Rate, Checkbox, message, + Row, Col, Select, Modal,Cascader +} from 'antd'; +import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; +import axios from 'axios' +import {getUrl} from 'educoder'; +import "../../common/formCommon.css" +import '../style.css' +import '../../css/Courses.css' +import { WordsBtn, City } from 'educoder' +// import City from './City' + +// import './board.css' +// import { RouteHOC } from './common.js' + +const confirm = Modal.confirm; +const $ = window.$ +const { Option } = Select; +// 新建毕设选题 +// https://lanhuapp.com/web/#/item/project/board/detail?pid=a3bcd4b1-99ce-4e43-8ead-5b8b0a410807&project_id=a3bcd4b1-99ce-4e43-8ead-5b8b0a410807&image_id=c6d9b36f-7701-4035-afdb-62404681108c +class GraduateTopicNew extends Component{ + constructor(props){ + super(props); + + this.mdRef = React.createRef(); + + this.state = { + fileList: [], + boards: [], + teacherList:[], + topic_property_first:[], + topic_property_second:[], + topic_repeat:[], + topic_source:[], + topic_type:[], + attachments:undefined, + addonAfter:60, + left_banner_id:undefined, + course_name:undefined + } + } + // 获取老师列表 + getTeacherList=()=>{ + const cid = this.props.match.params.coursesId + let url=`/courses/${cid}/graduation_topics/new.json`; + axios.get((url)).then((result)=>{ + if(result.status==200){ + this.setState({ + teacherList:result.data.teacher_list, + left_banner_id:result.data.left_banner_id, + course_name:result.data.course_name, + left_banner_name:result.data.left_banner_name, + topic_property_first:result.data.topic_property_first, + topic_property_second:result.data.topic_property_second, + topic_repeat:result.data.topic_repeat, + topic_source:result.data.topic_source, + topic_type:result.data.topic_type + }) + console.log("sdfds"); + console.log(this.props.current_user && this.props.current_user.user_id); + this.props.form.setFieldsValue({ + tea_id:this.props.current_user && this.props.current_user.user_id + }) + } + }).catch((error)=>{ + console.log(error); + }) + } + componentDidMount = () => { + //新建or编辑 + let topicId=this.props.match.params.topicId; + + if(topicId==undefined){ + this.getTeacherList(); + }else{ + this.getEditInfo(); + + } + } + //编辑,信息显示 + getEditInfo=()=>{ + const cid = this.props.match.params.coursesId + let topicId=this.props.match.params.topicId + let url=`/courses/${cid}/graduation_topics/${topicId}/edit.json`; + axios.get((url)).then((result)=>{ + if(result){ + this.setState({ + left_banner_id:result.data.left_banner_id, + course_name:result.data.course_name, + left_banner_name:result.data.left_banner_name, + teacherList:result.data.teacher_list, + topic_property_first:result.data.topic_property_first, + topic_property_second:result.data.topic_property_second, + topic_repeat:result.data.topic_repeat, + topic_source:result.data.topic_source, + topic_type:result.data.topic_type, + attachments:result.data.attachments, + addonAfter:20-parseInt(result.data.selected_data.name.length) + }) + this.props.form.setFieldsValue({ + tea_id:result.data.selected_data.tea_id, + name:result.data.selected_data.name, + city: [result.data.selected_data.province,result.data.selected_data.city], + topic_type:result.data.selected_data.topic_type || undefined, + topic_source:result.data.selected_data.topic_source || undefined, + topic_property_first:result.data.selected_data.topic_property_first || undefined, + topic_property_second:result.data.selected_data.topic_property_second || undefined, + source_unit:result.data.selected_data.source_unit, + topic_repeat:result.data.selected_data.topic_repeat || undefined + }); + this.mdRef.current.setValue(result.data.selected_data.description) + const _fileList = result.data.attachments.map(item => { + return { + id: item.id, + uid: item.id, + name: item.title, + url: item.url, + status: 'done' + } + }) + this.setState({ fileList: _fileList, cityDefaultValue: [result.data.selected_data.province,result.data.selected_data.city] }) + } + }).catch((error)=>{ + console.log(error); + }) + } + + handleSubmit = (e) => { + e.preventDefault(); + const cid = this.props.match.params.coursesId + const topicId = this.props.match.params.topicId + // console.log(this.props); + + this.props.form.validateFieldsAndScroll((err, values) => { + if (!err) { + console.log('Received values of form: ', values); + if (topicId !=undefined) { + const editTopic = this.editTopic + const editUrl = `/courses/${cid}/graduation_topics/${topicId}.json` + + let attachment_ids = undefined + if (this.state.fileList) { + attachment_ids = this.state.fileList.map(item => { + return item.response ? item.response.id : item.id + }) + } + axios.put(editUrl, { + graduation_topic:{ + ...values, + province: values.city==undefined?"":values.city[0], + city: values.city==undefined?"":values.city[1], + }, + attachment_ids + }).then((response) => { + if (response.status == 200) { + const { id } = response.data; + if (id) { + this.props.showNotification('保存成功!'); + this.props.history.push(`/courses/${cid}/graduation_topics/${this.state.left_banner_id}`); + } + } + }).catch(function (error) { + console.log(error); + }); + } else { + const url = `/courses/${cid}/graduation_topics.json` + let attachment_ids = undefined + if (this.state.fileList) { + attachment_ids = this.state.fileList.map(item => { + return item.response.id + }) + } + + axios.post(url, { + graduation_topic:{ + ...values, + province: values.city==undefined?"":values.city[0], + city: values.city==undefined?"":values.city[1], + }, + attachment_ids, + }).then((response) => { + if (response.data) { + const { id } = response.data; + if (id) { + this.props.showNotification('提交成功!'); + this.props.history.push(`/courses/${cid}/graduation_topics/${this.state.left_banner_id}`); + } + } + }) + .catch(function (error) { + console.log(error); + }); + } + } else { + $("html").animate({ scrollTop: $('html').scrollTop() - 100 }) + } + }); + } + + // 选择省市 + ChangeCity=(value, selectedOptions)=>{ + console.log(selectedOptions); + } + + // 附件相关 START + handleChange = (info) => { + let fileList = info.fileList; + this.setState({ fileList }); + } + onAttachmentRemove = (file) => { + confirm({ + title: '确定要删除这个附件吗?', + okText: '确定', + cancelText: '取消', + // content: 'Some descriptions', + onOk: () => { + this.deleteAttachment(file) + }, + onCancel() { + console.log('Cancel'); + }, + }); + return false; + } + deleteAttachment = (file) => { + console.log(file); + let id=file.response ==undefined ? file.id : file.response.id + const url = `/attachments/${id}.json` + axios.delete(url, { + }) + .then((response) => { + if (response.data) { + const { status } = response.data; + if (status == 0) { + console.log('--- success') + + this.setState((state) => { + const index = state.fileList.indexOf(file); + const newFileList = state.fileList.slice(); + newFileList.splice(index, 1); + return { + fileList: newFileList, + }; + }); + } + } + }) + .catch(function (error) { + console.log(error); + }); + } + + // 附件相关 ------------ END + + changeTopicName=(e)=>{ + let num= 60 - parseInt(e.target.value.length); + this.setState({ + addonAfter:num < 0 ? 0 : num + }) + } + render() { + let { + fileList, + teacherList, + topic_property_first, + topic_property_second, + topic_repeat, + topic_source, + topic_type, + addonAfter, + left_banner_id, + course_name, + left_banner_name + } = this.state; + const { current_user } = this.props + const { getFieldDecorator } = this.props.form; + let{ topicId,coursesId }=this.props.match.params + // console.log(this.props); + + const formItemLayout = { + labelCol: { + xs: { span: 24 }, + // sm: { span: 8 }, + sm: { span: 24 }, + }, + wrapperCol: { + xs: { span: 24 }, + // sm: { span: 16 }, + sm: { span: 24 }, + }, + }; + const uploadProps = { + width: 600, + fileList, + multiple: true, + // https://github.com/ant-design/ant-design/issues/15505 + // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 + // showUploadList: false, + action: `${getUrl()}/api/attachments.json`, + onChange: this.handleChange, + onRemove: this.onAttachmentRemove, + beforeUpload: (file) => { + console.log('beforeUpload', file.name); + const isLt150M = file.size / 1024 / 1024 < 150; + if (!isLt150M) { + message.error('文件大小必须小于150MB!'); + } + return isLt150M; + }, + }; + // console.log("dfsf"); + // console.log(this.props); + return( +
    + +
    +

    + {course_name} + > + {left_banner_name} + > + {topicId==undefined?"新建":"编辑"} +

    +
    + +
    +
    + + {getFieldDecorator('tea_id', { + rules: [{ + required: true, message: '请选择指导老师' + }], + })( + + )} + + + {getFieldDecorator('name', { + rules: [{ + required: true, message: '请输入选题名称', + }, { + max: 60, message: '最大限制为60个字符', + }], + })( + + )} + +
    + + + +
    + + + {getFieldDecorator('description', { + rules: [{ + required: true, message: '请输入选题简介', + }, { + max: 10000, message: '最大限制为10000个字符', + }], + })( + + )} + + + { + getFieldDecorator('file',{ + rules:[{ + required:false + }] + })( + + + (单个文件150M以内) + + ) + } + +
    + + {getFieldDecorator('topic_type', { + rules: [{ + required: false, message: '', + }], + })( + + )} + + + {getFieldDecorator('topic_source', { + rules: [{ + required: false, message: '', + }], + })( + + )} + + + {getFieldDecorator('topic_property_first', { + rules: [{ + required: false, message: '', + }], + })( + + )} + + + {getFieldDecorator('topic_property_second', { + rules: [{ + required: false, message: '', + }], + })( + + )} + +
    +
    + + + + + +
    + + {getFieldDecorator('source_unit', { + rules: [{ + required: false, message: '', + }], + })( + + )} + + + {getFieldDecorator('topic_repeat', { + rules: [{ + required: false, message: '', + }], + })( + + )} + + + {getFieldDecorator('city', { + rules: [{ + initialValue: this.state.cityDefaultValue, + type: 'array', + required: false, message: '', + }], + })( + + )} + +
    + + +
    + + this.props.history.goBack()}>取消 +
    +
    + +
    +
    + ) + } +} + +const WrappedGraduateTopicNew = Form.create({ name: 'topicPostWorksNew' })(GraduateTopicNew); +// RouteHOC() export default (WrappedGraduateTopicNew); \ No newline at end of file diff --git a/public/react/src/modules/courses/poll/Poll.js b/public/react/src/modules/courses/poll/Poll.js index 92b69a9d1..926cd9b1d 100644 --- a/public/react/src/modules/courses/poll/Poll.js +++ b/public/react/src/modules/courses/poll/Poll.js @@ -464,7 +464,7 @@ class Poll extends Component{ modalsBottomval, loadtype }=this.state; - console.log(this.props); + // console.log(this.props); let {child}=this.props; let {coursesId,Id}=this.props.match.params const isAdmin = this.props.isAdmin() diff --git a/public/react/src/modules/courses/poll/PollDetailIndex.js b/public/react/src/modules/courses/poll/PollDetailIndex.js index 9119b7902..a1c98b07b 100644 --- a/public/react/src/modules/courses/poll/PollDetailIndex.js +++ b/public/react/src/modules/courses/poll/PollDetailIndex.js @@ -34,7 +34,7 @@ class PollDetailIndex extends Component{ } getPollInfo=()=>{ - console.log(this.props); + // console.log(this.props); let pollId=this.props.match.params.pollId; let url=`/polls/${pollId}/common_header.json` axios.get(url).then((result)=>{ diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index b89990420..8eb2c76dd 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -3,7 +3,7 @@ import React, { Component } from 'react'; import MonacoEditor from 'react-monaco-editor'; //MonacoDiffEditor 对比模式 -import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Icon,DatePicker} from 'antd'; +import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Icon,DatePicker,Breadcrumb} from 'antd'; // import "antd/dist/antd.css"; @@ -1256,701 +1256,706 @@ export default class TPMsettings extends Component { let operateauthority=this.props.identity===1?true:this.props.identity<5&&this.state.status==0?true:false; return ( -
    -
    -
    - 配置 - { - this.props.identity===1&&this.state.status==2? - this.operateshixuns(2)}> - 永久关闭 - :"" - } - { - this.props.identity < 5 && this.state.status==0? - this.operateshixuns(1)}> - 删除实训 - :"" - } - { - this.props.identity == 1 && this.state.status == 2 ? - this.operateshixuns(1)}> - 删除实训 - :"" - } - - -
    - {delType===1?

    是否确认删除 ?

    :

    关闭后,
    用户不能再开始挑战了是否确认关闭 ?

    } -
    -
    - 取消 - {delType===2?确定:确定} -
    -
    - -
    - -
    - -

    实训名称

    - -
    - * -
    -
    - {settingsData === undefined ? "" : - } -
    -
    - 必填项 -
    -
    - - -
    - -
    -
    - -
    - -

    简介

    - -
    - -
    -
    -
    -

    -

    -
    - -
    -
    -

    技术平台

    - - -
    - * -
    + + 实训详情 + 配置 + + +
    +
    + 配置 + { + this.props.identity===1&&this.state.status==2? + this.operateshixuns(2)}> + 永久关闭 + :"" + } + { + this.props.identity < 5 && this.state.status==0? + this.operateshixuns(1)}> + 删除实训 + :"" + } + { + this.props.identity == 1 && this.state.status == 2 ? + this.operateshixuns(1)}> + 删除实训 + :"" + } + + - -

    - 列表中没有? - 申请新建 -

    - - - - - - -
    -

    新建申请已提交,请等待管理员的审核

    -
  • 我们将在1-2个工作日内与您联系 -
  • -
    -
    - 知道啦 -
    -
    -
    -
    - -
    - -
    -
    - 必填项 -
    - {/*

    请在配置页面完成后续的评测脚本设置操作

    */} - -
    -
    - {/*
    */} - {/*
    */} -
    -

    评测脚本

    -
    - - -
    -

    原有脚本将被新的脚本覆盖,无法撤销

    -

    是否确认执行覆盖操作

    -
    - - -
    - - -

    评测脚本生成成功!

    - -
    - - { - this.props.identity<5||this.props.power==true? - 使用自定义脚本 : "" - } -
    - this.testscripttip(0)}> -
    - -
    -

    - 使用自定义模板,平台无法自动更新脚本,
    - 请在关卡创建完后手动更新脚本中的必填参
    - 数和以下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")

    - 其它参数可按实际需求定制 -

    +
    + +
    + +

    实训名称

    + +
    + * +
    +
    + {settingsData === undefined ? "" : + } +
    +
    + 必填项
    -

    - this.testscripttip(1)}>知道了 -

    + +
    - -
    -
  • - - -

    执行命令不能为空

    -
  • - -
  • - - -
  • -
    -
    -
    -
    - -
    -
    - * -
    - - -
    - {/**/} - -
    - - - {/*
    */} - {/*{evaluate_script===undefined?"":evaluate_script}*/} - - {/*
    */} - - - -
    - -
    -
    -
    - - 必填项 -
    -

    -

    -
    -
    - - {/*
    */} - {/***/} - - {/*

    程序最大执行时间

    */} - - {/* 秒*/} - - {/*
    */} - {/*必填项*/} - {/*
    */} - {/*
    */} - - {/*
    - * - -

    Pod存活时间

    - - - -
    - 必填项 -
    -
    */} - - -
    -

    命令行

    - - 无命令行窗口 (选中则不给学员的实践任务提供命令窗口) - 命令行练习窗口 (选中则给学员提供用于练习操作的命令行窗口) - 命令行评测窗口 (选中则给学员提供用于关卡评测的命令行窗口) - - 多个命令行窗口(选中则允许学员同时开启多个命令行窗口) - - -
    - -
    -

    公开程度

    - - 对所有公开 (选中则所有已被试用授权的用户可以学习) - 对指定单位公开 (选中则下方指定单位的已被试用授权的用户可以学习) - - -
    -
    -
    -
    -
    - -
    - (搜索并选中添加单位名称) -
    - {/*+*/} - {/*添加*/} -
    - -
    - - {/*{*/} - {/*scope_partment===undefined?"":scope_partment.map((item,key)=>{*/} - {/*return(*/} - {/*
    */} - {/*this.deleteScopeInput(key)} style={{ color: 'rgba(0,0,0,.25)' }} />}*/} - {/*value={item}*/} - {/*/>*/} - {/*
    */} - - {/*)*/} - {/*})*/} - {/*}*/} -
    - - - 请选择需要公开的单位 - -
    -
    -
    - -
    -

    发布信息

    - -
    - * - 面向学员: - -
    - -
    - 实训难易度定位,不限定用户群体 -
    - 必填项 -
    - -
    -
    - 复制: - - - - -
    - -
    - 跳关: - - - - -
    -
    - 测试集解锁: - - - - -
    - -
    - 隐藏代码窗口: - - - - -
    - -
    - 代码目录隐藏: - - - - -
    - -
    - 禁用复制粘贴: - - - - -
    - -
    - 开启时间: - - - - -
    - - {this.props.identity<3?
    - VNC图形化: - - - - -
    :""} +
    +
    -
    - {/*"name": "我是镜像名", # 镜像名称*/} - {/*"cpu_limit": 1, # cpu核*/} - {/*"lower_cpu_limit": 0.1, # 最低cpu核 浮点数*/} - {/*"memory_limit": 1024 ,#内存限制*/} - {/*"request_limit": 10, # 内存要求*/} - {/*"mirror_repository_id": 12, # 镜像id*/} - {this.props.identity<3?
    -

    服务配置

    - { shixun_service_configs&&shixun_service_configs.map((item,key)=>{ - return( -
    -
    -

    {item.name}

    -
    - -
    - this.setConfigsInputs(e,key,1)} - className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" /> +
    + +

    简介

    + +
    + +
    +
    +
    +

    +

    +
    + +
    +
    +

    技术平台

    + + +
    + * +
    + +

    + 列表中没有? + 申请新建 +

    + + + + + + +
    +

    新建申请已提交,请等待管理员的审核

    +
  • 我们将在1-2个工作日内与您联系 +
  • +
    +
    + 知道啦 +
    +
    +
    +
    + +
    + +
    +
    + 必填项 +
    + {/*

    请在配置页面完成后续的评测脚本设置操作

    */} + +
    +
    + {/*
    */} + {/*
    */} +
    +

    评测脚本

    +
    + + +
    +

    原有脚本将被新的脚本覆盖,无法撤销

    +

    是否确认执行覆盖操作

    +
    + + +
    + + +

    评测脚本生成成功!

    + +
    + + { + this.props.identity<5||this.props.power==true? + 使用自定义脚本 : "" + } +
    + this.testscripttip(0)}> +
    + +
    +

    + 使用自定义模板,平台无法自动更新脚本,
    + 请在关卡创建完后手动更新脚本中的必填参
    + 数和以下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")

    + 其它参数可按实际需求定制 +

    +
    +

    + this.testscripttip(1)}>知道了 +

    -
    -
    - -
    - this.setConfigsInputs(e,key,2)} - className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" /> + + +
    +
  • + + +

    执行命令不能为空

    +
  • + +
  • + + +
  • -
    +
    +
    +
    + +
    +
    + * +
    + + +
    + {/**/} +
    -
    - -
    - this.setConfigsInputs(e,key,3)} - className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" /> + + + {/*
    */} + {/*{evaluate_script===undefined?"":evaluate_script}*/} + + {/*
    */} + + + +
    + +
    +
    +
    + + 必填项 +
    +

    +

    +
    +
    + + {/*
    */} + {/***/} + + {/*

    程序最大执行时间

    */} + + {/* 秒*/} + + {/*
    */} + {/*必填项*/} + {/*
    */} + {/*
    */} + + {/*
    + * + +

    Pod存活时间

    + + + +
    + 必填项 +
    +
    */} + + +
    +

    命令行

    + + 无命令行窗口 (选中则不给学员的实践任务提供命令窗口) + 命令行练习窗口 (选中则给学员提供用于练习操作的命令行窗口) + 命令行评测窗口 (选中则给学员提供用于关卡评测的命令行窗口) + + 多个命令行窗口(选中则允许学员同时开启多个命令行窗口) + + +
    + +
    +

    公开程度

    + + 对所有公开 (选中则所有已被试用授权的用户可以学习) + 对指定单位公开 (选中则下方指定单位的已被试用授权的用户可以学习) + + +
    +
    +
    +
    +
    + +
    + (搜索并选中添加单位名称)
    -
    + {/*+*/} + {/*添加*/}
    -
    - -
    - this.setConfigsInputs(e,key,4)} - className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" /> + +
    + - -
    + {/*{*/} + {/*scope_partment===undefined?"":scope_partment.map((item,key)=>{*/} + {/*return(*/} + {/*
    */} + {/*this.deleteScopeInput(key)} style={{ color: 'rgba(0,0,0,.25)' }} />}*/} + {/*value={item}*/} + {/*/>*/} + {/*
    */} + + {/*)*/} + {/*})*/} + {/*}*/}
    + + + 请选择需要公开的单位 + +
    +
    +
    + +
    +

    发布信息

    + +
    + * + 面向学员: + +
    + +
    + 实训难易度定位,不限定用户群体 +
    + 必填项
    -
    - ) - - })} -
    :""} -

    - { - // this.props.identity<4&&this.props.status==0? - this.props.identity<5? -

    - 保存 - 取消 -
    :"" - } +
    +
    + 复制: + + + + +
    + +
    + 跳关: + + + + +
    +
    + 测试集解锁: + + + + +
    + +
    + 隐藏代码窗口: + + + + +
    + +
    + 代码目录隐藏: + + + + +
    + +
    + 禁用复制粘贴: + + + + +
    + +
    + 开启时间: + + + + +
    + + {this.props.identity<3?
    + VNC图形化: + + + + +
    :""} + +
    + {/*"name": "我是镜像名", # 镜像名称*/} + {/*"cpu_limit": 1, # cpu核*/} + {/*"lower_cpu_limit": 0.1, # 最低cpu核 浮点数*/} + {/*"memory_limit": 1024 ,#内存限制*/} + {/*"request_limit": 10, # 内存要求*/} + {/*"mirror_repository_id": 12, # 镜像id*/} + {this.props.identity<3?
    +

    服务配置

    + { shixun_service_configs&&shixun_service_configs.map((item,key)=>{ + return( +
    +
    +

    {item.name}

    +
    + +
    + this.setConfigsInputs(e,key,1)} + className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" /> +
    +
    +
    +
    + +
    + this.setConfigsInputs(e,key,2)} + className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" /> +
    +
    +
    +
    + +
    + this.setConfigsInputs(e,key,3)} + className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" /> +
    +
    +
    +
    + +
    + this.setConfigsInputs(e,key,4)} + className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" /> +
    + +
    +
    +
    +
    + ) + + })} +
    :""} + +

    + { + // this.props.identity<4&&this.props.status==0? + this.props.identity<5? +

    + 保存 + 取消 +
    :"" + } -

    +

    -
    +
    ); } } diff --git a/public/react/src/modules/tpm/component/TPMNav.js b/public/react/src/modules/tpm/component/TPMNav.js index 7bcc858e2..1683c59a0 100644 --- a/public/react/src/modules/tpm/component/TPMNav.js +++ b/public/react/src/modules/tpm/component/TPMNav.js @@ -42,7 +42,7 @@ class TPMNav extends Component { className={`${match.url.indexOf('ranking_list') != -1 ? 'active' : ''} fl`}>排行榜 {/* target="_blank"*/} 4||this.props.identity===undefined ? "none" : 'block'}} >配置
    diff --git a/public/react/src/modules/user/account/AccountNav.js b/public/react/src/modules/user/account/AccountNav.js index b0038e43b..e14921d34 100644 --- a/public/react/src/modules/user/account/AccountNav.js +++ b/public/react/src/modules/user/account/AccountNav.js @@ -14,7 +14,7 @@ class AccountNav extends Component { } render() { let { basicInfo } = this.props - console.log(this.props); + // console.log(this.props); const path = window.location.pathname const isBasic = path.indexOf('profile') != -1 || path == "/account" const isCertification = path.indexOf('certification') != -1 From cf10b2cbc7125bbf5b97e791976fdccf8934f313 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 27 Jul 2019 11:21:36 +0800 Subject: [PATCH 56/80] visible --- .../react/src/modules/courses/common/ModalWrapper.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/public/react/src/modules/courses/common/ModalWrapper.js b/public/react/src/modules/courses/common/ModalWrapper.js index b998061eb..9fff8d928 100644 --- a/public/react/src/modules/courses/common/ModalWrapper.js +++ b/public/react/src/modules/courses/common/ModalWrapper.js @@ -36,6 +36,17 @@ class ModalWrapper extends Component{ className={className || ''} keyboard={false} > + { + visible == true ? :"" + }
    {this.props.children} {this.props.checkBoxValuestype===true?
    From 6ffa26bc3ac5a02211c25bc5e0268952ddf67632 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Sat, 27 Jul 2019 11:30:41 +0800 Subject: [PATCH 57/80] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E7=9A=84=E5=A4=9A?= =?UTF-8?q?=E9=80=89=E6=8F=90=E4=BA=A4=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_votes_controller.rb | 8 ------ app/controllers/polls_controller.rb | 32 ++++++++++++++++++------ 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/app/controllers/poll_votes_controller.rb b/app/controllers/poll_votes_controller.rb index b376b870f..b1191d8ea 100644 --- a/app/controllers/poll_votes_controller.rb +++ b/app/controllers/poll_votes_controller.rb @@ -147,17 +147,9 @@ class PollVotesController < ApplicationController else question_max_choices = 0 end - if @poll_question.min_choices.present? - question_min_choices = @poll_question.min_choices - else - question_min_choices = 0 - end if question_max_choices > 0 && (user_vote_count > question_max_choices) normal_status(-1,"多选题答案超过最大限制!") end - if question_min_choices > 0 && (user_vote_count < question_min_choices) - normal_status(-1,"多选题答题不得少于最小限制!") - end elsif (poll_user.present? && poll_user.commit_status == 1) || poll_user_status == 3 normal_status(-1,"已提交/已结束的问卷不允许修改!") end diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index f5003a0c7..a89544669 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -896,13 +896,31 @@ class PollsController < ApplicationController def commit_poll ActiveRecord::Base.transaction do begin - poll_user_current = @poll.poll_users.find_by_group_ids(current_user.id).first - poll_user_params = { - :commit_status => 1, - :end_at => Time.now - } - poll_user_current.update_attributes(poll_user_params) - normal_status(0, "问卷提交成功!") + @poll_multi_questions = @poll.poll_questions.where(question_type:2).select(:id,:max_choices,:min_choices,:question_number) + error_question = [] + @poll_multi_questions.each do |q| + poll_user_votes = current_user.poll_votes.where(question_id:q.id)&.size + if q.max_choices.present? && (poll_user_votes > q.max_choices) + error_messages = "第#{q.question_number}题:超过最大选项限制" + elsif q.min_choices.present? && (poll_user_votes < q.min_choices) + error_messages = "第#{q.question_number}题:不得少于最小选项限制" + else + error_messages = nil + end + error_question.push(error_messages) + end + error_question = error_question.reject(&:blank?) + if error_question.reject(&:blank?).length > 0 + normal_status(-1, "#{error_question.join("\n")}") + else + poll_user_current = @poll.poll_users.find_by_group_ids(current_user.id).first + poll_user_params = { + :commit_status => 1, + :end_at => Time.now + } + poll_user_current.update_attributes(poll_user_params) + normal_status(0, "问卷提交成功!") + end ## 需添加发送消息的接口,稍后添加 rescue Exception => e uid_logger_error(e.message) From fdea2203a46ffc8be595108cfcae6a3b5dd0ec79 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 27 Jul 2019 11:30:57 +0800 Subject: [PATCH 58/80] answer_percent --- public/react/src/modules/courses/poll/PollDetailTabSecond.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollDetailTabSecond.js b/public/react/src/modules/courses/poll/PollDetailTabSecond.js index a6a2b6b62..45b3c1583 100644 --- a/public/react/src/modules/courses/poll/PollDetailTabSecond.js +++ b/public/react/src/modules/courses/poll/PollDetailTabSecond.js @@ -127,9 +127,9 @@ class PollDetailTabSecond extends Component{ {options.answer_users_count}

    - +

    - {parseFloat(options.answer_percent ? options.answer_percent : 0 ).toFixed(2)*100} % + {options.answer_percent * 100}%
    { From 0a6e9189a23ad0e8e55192e34dfb26f9dcfabb00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 27 Jul 2019 11:32:17 +0800 Subject: [PATCH 59/80] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/new/CoursesNew.js | 5 +++++ public/react/src/modules/user/account/AccountBasicEdit.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index 0114f564c..888f4c9e6 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -459,6 +459,11 @@ class CoursesNew extends Component { width: 280px; margin-left: 10px; } + + .construction .ant-select-selection__placeholder, .ant-select-search__field__placeholder { + line-height: 28px; + z-index: 2000; + } `} diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index a4637c00e..44baf7778 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -668,7 +668,7 @@ class AccountBasic extends Component { }], })( - + { filterSchoolList && filterSchoolList.map((item,key)=>{ return() From 4d14499b6edbf7b1ab48120ad6709fec9915b831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 27 Jul 2019 11:32:54 +0800 Subject: [PATCH 60/80] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/user/account/AccountBasicEdit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index 44baf7778..a4637c00e 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -668,7 +668,7 @@ class AccountBasic extends Component { }], })( - + { filterSchoolList && filterSchoolList.map((item,key)=>{ return() From 969ae735d0a53f31ce16d3fae72871bf5a866e3f Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 27 Jul 2019 11:33:47 +0800 Subject: [PATCH 61/80] current_user --- public/react/src/modules/courses/poll/PollDetailIndex.js | 2 +- public/react/src/modules/courses/poll/PollNew.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollDetailIndex.js b/public/react/src/modules/courses/poll/PollDetailIndex.js index 9119b7902..6106e5ea2 100644 --- a/public/react/src/modules/courses/poll/PollDetailIndex.js +++ b/public/react/src/modules/courses/poll/PollDetailIndex.js @@ -123,7 +123,7 @@ class PollDetailIndex extends Component{ />

    - {this.props.coursedata.name} + {this.props.coursedata.name} > 问卷 > diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 705b1658c..be904afe7 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -2322,7 +2322,7 @@ class PollNew extends Component { gotohome=()=>{ const { current_user} = this.props - this.props.history.push(current_user.first_category_url); + this.props.history.push(current_user && current_user.first_category_url); // let courseId=this.props.match.params.coursesId; From 8ea7e46fb57978ffd311e67240b51550d8771dbe Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 27 Jul 2019 11:35:00 +0800 Subject: [PATCH 62/80] current_user --- public/react/src/modules/courses/poll/PollInfo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/poll/PollInfo.js b/public/react/src/modules/courses/poll/PollInfo.js index f32d652c2..22c1f542e 100644 --- a/public/react/src/modules/courses/poll/PollInfo.js +++ b/public/react/src/modules/courses/poll/PollInfo.js @@ -315,7 +315,7 @@ class PollInfo extends Component{ >

    - {courseName} + {courseName} > 问卷 > From f2acf4b2c7e12e2491770542a64c0aa157d3aed3 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Sat, 27 Jul 2019 11:40:52 +0800 Subject: [PATCH 63/80] fixbug --- app/controllers/polls_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index a89544669..5aecaadb0 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -899,7 +899,7 @@ class PollsController < ApplicationController @poll_multi_questions = @poll.poll_questions.where(question_type:2).select(:id,:max_choices,:min_choices,:question_number) error_question = [] @poll_multi_questions.each do |q| - poll_user_votes = current_user.poll_votes.where(question_id:q.id)&.size + poll_user_votes = current_user.poll_votes.where(poll_question_id:q.id)&.size if q.max_choices.present? && (poll_user_votes > q.max_choices) error_messages = "第#{q.question_number}题:超过最大选项限制" elsif q.min_choices.present? && (poll_user_votes < q.min_choices) From 8d89ef8a003d3ea51b7c497c60e2d50941ece666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 27 Jul 2019 11:40:53 +0800 Subject: [PATCH 64/80] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/new/CoursesNew.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js index 888f4c9e6..b817136ed 100644 --- a/public/react/src/modules/courses/new/CoursesNew.js +++ b/public/react/src/modules/courses/new/CoursesNew.js @@ -646,7 +646,7 @@ class CoursesNew extends Component {

    -
    +
    {getFieldDecorator('school', { rules: [{required: true, message: "不能为空"}], From acfde4ae2f50741b4d1d16180bcfc0aa52d49ee8 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 27 Jul 2019 11:43:43 +0800 Subject: [PATCH 65/80] toFixed(1) --- public/react/src/modules/courses/poll/PollDetailTabSecond.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollDetailTabSecond.js b/public/react/src/modules/courses/poll/PollDetailTabSecond.js index 45b3c1583..b3a1e829c 100644 --- a/public/react/src/modules/courses/poll/PollDetailTabSecond.js +++ b/public/react/src/modules/courses/poll/PollDetailTabSecond.js @@ -127,9 +127,9 @@ class PollDetailTabSecond extends Component{ {options.answer_users_count}

    - +

    - {options.answer_percent * 100}% + {(options.answer_percent * 100).toFixed(1)}%
    { From d65bb1cb0366b1dc3ccfdd4ea816317d26c7bc3b Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 27 Jul 2019 11:53:16 +0800 Subject: [PATCH 66/80] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=8F=AA=E6=9C=89=E7=AE=A1=E7=90=86=E5=91=98=E8=83=BD=E5=A4=9F?= =?UTF-8?q?=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/edu_settings_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/edu_settings_controller.rb b/app/controllers/edu_settings_controller.rb index 0d80cbf3d..6baf38e5b 100644 --- a/app/controllers/edu_settings_controller.rb +++ b/app/controllers/edu_settings_controller.rb @@ -1,5 +1,5 @@ class EduSettingsController < ApplicationController - # before_action :require_admin + before_action :require_admin before_action :set_edu_setting, only: [:show, :edit, :update, :destroy] # GET /edu_settings From 0ad641843d5b0792c2fb7b47986e1418c8f810a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 27 Jul 2019 11:55:59 +0800 Subject: [PATCH 67/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 --- .../react/src/modules/courses/poll/PollNew.js | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 705b1658c..82d06a991 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -844,12 +844,12 @@ class PollNew extends Component { if (object.question.question_type === 2) { if (object.question.max_choices > 0) { - if (object.question.min_choices < 2) { - this.props.showNotification(`可选最小不能少于2个`); - - return; - - } + // if (object.question.min_choices < 2) { + // this.props.showNotification(`可选最小不能少于2个`); + // + // return; + // + // } } } @@ -1332,10 +1332,10 @@ class PollNew extends Component { if (object.question.question_type === 2) { if (object.question.max_choices > 0) { - if (object.question.min_choices < 2) { - this.props.showNotification(`可选最小不能少于2个`); - return; - } + // if (object.question.min_choices < 2) { + // this.props.showNotification(`可选最小不能少于2个`); + // return; + // } } } if (object.question.new === "new") { @@ -2108,14 +2108,17 @@ class PollNew extends Component { } //最大值 - HandleGradationGroupChangeee = (value, index) => { - + HandleGradationGroupChangeee = (value, index,minchoices) => { + // console.log(value); let arr = this.state.adddom; for (var i = 0; i < arr.length; i++) { if (index === i) { + arr[i].question.min_choices= minchoices===null?0:minchoices===undefined?0:parseInt(minchoices); arr[i].question.max_choices = parseInt(value); } } + // console.log(2119); + // console.log(arr); this.setState({ adddom: arr }) @@ -2772,7 +2775,7 @@ class PollNew extends Component { className="ml10 mr10 color-grey-6 lineh-40 fl">~ {/*可选最大*/} this.HandleGradationGroupChangeee(value, indexo)} + onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices)} value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices} > @@ -3267,7 +3270,7 @@ class PollNew extends Component { className="ml10 mr10 color-grey-6 lineh-40 fl">~ {/*可选最大*/}