diff --git a/app/controllers/users/question_banks_controller.rb b/app/controllers/users/question_banks_controller.rb index 5c8e69a29..c5b837d0b 100644 --- a/app/controllers/users/question_banks_controller.rb +++ b/app/controllers/users/question_banks_controller.rb @@ -1,11 +1,12 @@ class Users::QuestionBanksController < Users::BaseController before_action :require_login - before_action :private_user_resources! + skip_before_action :check_observed_user_exists! + # before_action :private_user_resources! before_action :check_query_params! before_action :check_user_permission! def index - service = Users::QuestionBankService.new(observed_user, query_params) + service = Users::QuestionBankService.new(User.current, query_params) question_banks = service.call @count = question_banks.count diff --git a/config/initializers/session_extenstions.rb b/config/initializers/session_extenstions.rb deleted file mode 100644 index 36a8ae8c7..000000000 --- a/config/initializers/session_extenstions.rb +++ /dev/null @@ -1,35 +0,0 @@ -#coding=utf-8 - -module SessionExtenstions - - module EntryExtension - def compressed? - @compressed - end - - def value - if @value - begin - Marshal.load(compressed? ? Zlib::Inflate.inflate(@value) : @value) - rescue TypeError - compressed? ? Zlib::Inflate.inflate(@value) : @value - end - end - end - - def size - if @value.nil? - 0 - else - @value.bytesize - end - end - end - - -end - -ActiveSupport::Cache::Entry.const_set("DEFAULT_COMPRESS_LIMIT", 1) -ActiveSupport::Cache::Entry.send(:prepend, SessionExtenstions::EntryExtension) - - diff --git a/config/routes.rb b/config/routes.rb index 0d1b979b1..5cf74c29a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -55,12 +55,14 @@ Rails.application.routes.draw do get :homepage_info end + get :question_banks, on: :collection, to: 'users/question_banks#index' + scope module: :users do resources :courses, only: [:index] resources :shixuns, only: [:index] resources :projects, only: [:index] resources :subjects, only: [:index] - resources :question_banks, only: [:index] + # resources :question_banks, only: [:index] resource :experience_records, only: [:show] resource :grade_records, only: [:show] resource :watch, only: [:create, :destroy] diff --git a/public/react/config/webpack.config.prod.js b/public/react/config/webpack.config.prod.js index d5ad7593a..8cab0465f 100644 --- a/public/react/config/webpack.config.prod.js +++ b/public/react/config/webpack.config.prod.js @@ -62,7 +62,7 @@ module.exports = { // We generate sourcemaps in production. This is slow but gives good results. // You can exclude the *.map files from the build during deployment. // devtool: shouldUseSourceMap ? 'nosources-source-map' : false, //正式版 - devtool: shouldUseSourceMap ? 'source-map' : 'source-map',//测试版 + devtool: shouldUseSourceMap ? 'source-map' : false,//测试版 // In production, we only want to load the polyfills and the app code. entry: [require.resolve('./polyfills'), paths.appIndexJs], output: { diff --git a/public/react/src/modules/courses/busyWork/NewWorkForm.js b/public/react/src/modules/courses/busyWork/NewWorkForm.js index 1626c5c6a..f5d4d9eb4 100644 --- a/public/react/src/modules/courses/busyWork/NewWorkForm.js +++ b/public/react/src/modules/courses/busyWork/NewWorkForm.js @@ -100,6 +100,7 @@ class NewWorkForm extends Component{ const courseId = this.state.course_id || this.props.match.params.coursesId ; this.props.form.validateFieldsAndScroll((err, values) => { + if(err && err.personNum) delete err.personNum; console.log(values) const mdContnet = this.contentMdRef.current.getValue().trim(); console.log(mdContnet) @@ -135,7 +136,7 @@ class NewWorkForm extends Component{ } // const errKeys = Object.keys(err); // || errKeys.length == 1 && errKeys[0] == 'content' && mdContnet - if (!err) { + if (!err || Object.keys(err).length == 0) { if (this.state.isEdit) { this.doEdit(courseId, values) } else { @@ -451,12 +452,12 @@ class NewWorkForm extends Component{ > {getFieldDecorator('personNum', { validateTrigger: 'onNone', - rules: [{ + // rules: [{ // required: true, // message: '人数不能为空' // validator: this.personNumValidator // required: true, message: '请输入最小人数和最大人数' - }], + // }], })(
diff --git a/public/react/src/modules/courses/members/modal/CourseGroupChooserModal.js b/public/react/src/modules/courses/members/modal/CourseGroupChooserModal.js index c0c11addc..f5365433d 100644 --- a/public/react/src/modules/courses/members/modal/CourseGroupChooserModal.js +++ b/public/react/src/modules/courses/members/modal/CourseGroupChooserModal.js @@ -91,6 +91,7 @@ function CourseGroupChooserModal({ course_groups = [], isAdminOrCreator, item, i } .courseGroupChooserModal .drop_down_menu .mainGroup.ant-checkbox-group { width: 100%; + max-height: 300px!important; height: 300px; } .courseGroupChooserModal .drop_down_search { diff --git a/public/react/src/modules/courses/members/teacherList.js b/public/react/src/modules/courses/members/teacherList.js index 70b1e3bd6..18d9a1adf 100644 --- a/public/react/src/modules/courses/members/teacherList.js +++ b/public/react/src/modules/courses/members/teacherList.js @@ -663,7 +663,7 @@ class studentsList extends Component{