diff --git a/app/controllers/concerns/git_common.rb b/app/controllers/concerns/git_common.rb index 93f5fecd7..b8b2ec10a 100644 --- a/app/controllers/concerns/git_common.rb +++ b/app/controllers/concerns/git_common.rb @@ -47,6 +47,7 @@ module GitCommon def add_file @path, message, content = params[:path].strip, params[:message], params[:content] author_name, author_email = current_user.real_name, current_user.git_mail + Rails.logger.info(" good repo_name is #{@repo_path}") @content = GitService.update_file(repo_path: @repo_path, file_path: @path, message: message, diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 1632813ea..b99cac96a 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1100,13 +1100,19 @@ class CoursesController < ApplicationController def export_member_act_score search = params[:search] ? "#{params[:search].strip}" : "" #用户名或学生学号id搜索 group_id = params[:group_id] #分班的班级id - @all_members = student_act_score group_id, search + @all_members = @course.students + @all_members = @all_members.where(course_group_id: group_id) unless group_id.blank? + unless search.blank? + @all_members = @all_members.joins(user: [:user_extension]).where('concat(users.lastname, users.firstname) like ? or user_extensions.student_id like ?',"%#{search}%","%#{search}%") + end + if @all_members.size == 0 normal_status(-1,"课堂暂时没有学生") elsif params[:export].present? && params[:export] normal_status(0,"正在下载中") else set_export_cookies + @all_members = student_act_score group_id, search act_score_to_xlsx(@all_members) filename_ = "#{current_user.real_name}_#{@course.name}_活跃度_#{Time.now.strftime('%Y%m%d_%H%M%S')}" render xlsx: "#{format_sheet_name filename_.strip}",template: "courses/export_member_act_score.xlsx.axlsx", diff --git a/app/controllers/homework_banks_controller.rb b/app/controllers/homework_banks_controller.rb index a812da751..7e10509ba 100644 --- a/app/controllers/homework_banks_controller.rb +++ b/app/controllers/homework_banks_controller.rb @@ -11,7 +11,12 @@ class HomeworkBanksController < ApplicationController def update ActiveRecord::Base.transaction do - @bank.update_attributes(name: params[:name], description: params[:description], reference_answer: params[:reference_answer]) + if @bank.homework_type == 1 + @bank.update_attributes(name: params[:name], description: params[:description], reference_answer: params[:reference_answer]) + elsif @bank.homework_type == 3 + @bank.update_attributes(name: params[:name], description: params[:description], reference_answer: params[:reference_answer], + base_on_project: params[:base_on_project], min_num: params[:min_num], max_num: params[:max_num]) + end # 作业描述的附件 Attachment.associate_container(params[:attachment_ids], @bank.id, @bank.class) if params[:attachment_ids] diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index e86c135e1..3dc27edc6 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -13,7 +13,7 @@ class ShixunsController < ApplicationController before_action :shixun_access_allowed, except: [:index, :new, :create, :menus, :get_recommend_shixuns, :add_file, :propaedeutics, :departments, :apply_shixun_mirror, :get_mirror_script, :download_file] - before_action :find_repo_name, only: [:repository, :commits, :file_content, :update_file, :shixun_exec, :copy] + before_action :find_repo_name, only: [:repository, :commits, :file_content, :update_file, :shixun_exec, :copy, :add_file] before_action :allowed, only: [:update, :close, :update_propaedeutics, :settings, :publish, :shixun_members_added, :change_manager, :collaborators_delete, diff --git a/app/views/games/picture_display.json.jbuilder b/app/views/games/picture_display.json.jbuilder index eb2309f9b..7fdc2cfc1 100644 --- a/app/views/games/picture_display.json.jbuilder +++ b/app/views/games/picture_display.json.jbuilder @@ -19,7 +19,7 @@ if @type == "image" end elsif @type == "html" - json.iframe_src File.read("#{@user_path}/#{@user_picture[0]}")&.html_safe + json.iframe_src File.read("#{@user_path}/#{@user_picture[0]}")&.html_safe if @user_picture[0].present? elsif @type == "txt" json.contents @contents.to_s elsif @type =="qrcode" diff --git a/db/migrate/20190830082934_add_tag_to_libraries.rb b/db/migrate/20190830082934_add_tag_to_libraries.rb new file mode 100644 index 000000000..ea40cda5d --- /dev/null +++ b/db/migrate/20190830082934_add_tag_to_libraries.rb @@ -0,0 +1,5 @@ +class AddTagToLibraries < ActiveRecord::Migration[5.2] + def change + execute "insert into library_tags(name) values('企业案例')" + end +end diff --git a/public/react/src/context/EvaluateSuccessEffectDisplay.js b/public/react/src/context/EvaluateSuccessEffectDisplay.js index ec34db31f..98e61520b 100644 --- a/public/react/src/context/EvaluateSuccessEffectDisplay.js +++ b/public/react/src/context/EvaluateSuccessEffectDisplay.js @@ -21,7 +21,7 @@ class EvaluateSuccessEffectDisplay extends Component { componentDidMount() { if (this.props.type == 'html') { const iframe = document.getElementById('_displayIframe') - if (iframe && iframe.contentWindow) { + if (iframe && iframe.contentWindow && this.props.iframe_src) { iframe.contentWindow.open() iframe.contentWindow.document.write(this.props.iframe_src); iframe.contentWindow.document.close(); diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index b7cca1679..7c739bcd5 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -1775,12 +1775,13 @@ class PollNew extends Component { max_choicess = max_choices; min_choicess = min_choices; } + axios.post(urlly, { question_title: object.question.question_title, question_type: number, is_necessary: object.question.is_necessary, - max_choices: max_choicess, - min_choices: min_choicess, + max_choices: max_choicess===undefined?null:max_choicess===null?null:max_choicess===0?null:max_choicess, + min_choices: min_choicess===undefined?null:min_choicess===null?null:min_choicess===0?null:min_choicess, question_answers: option, question_other_answer: null, insert_id: insert_id @@ -2147,7 +2148,7 @@ class PollNew extends Component { if (minbool === true && maxbool === true) { for (var i = 0; i < arr.length; i++) { if (index === i) { - arr[i].question.min_choices = parseInt(value); + arr[i].question.min_choices = parseInt(value); } } this.setState({ @@ -2156,18 +2157,8 @@ class PollNew extends Component { } else { for (var i = 0; i < arr.length; i++) { if (index === i) { - try { - if(parseInt(value)===0){ - arr[i].question.min_choices = 2; - arr[i].question.max_choices = length; - }else{ arr[i].question.min_choices = parseInt(value); - arr[i].question.max_choices = max; - } - }catch (e) { - arr[i].question.min_choices = 2; - arr[i].question.max_choices = length; - } + arr[i].question.max_choices = length; break; } } @@ -2179,7 +2170,7 @@ class PollNew extends Component { } //最大值 - HandleGradationGroupChangeee = (value, index,minchoices) => { + HandleGradationGroupChangeee = (value, index,minchoices,length) => { // console.log("2112"); // console.log(value); // console.log(minchoices); @@ -2187,11 +2178,19 @@ class PollNew extends Component { for (var i = 0; i < arr.length; i++) { if (index === i) { if(parseInt(value)===0&&parseInt(minchoices)===0){ + arr[i].question.min_choices= parseInt(0); + arr[i].question.max_choices = parseInt(0); + }else if(parseInt(minchoices)===0){ + arr[i].question.min_choices= parseInt(2); + arr[i].question.max_choices = parseInt(value); + } + else if(parseInt(value)===0&&parseInt(minchoices)>0){ arr[i].question.min_choices= parseInt(minchoices); arr[i].question.max_choices = parseInt(value); - }else { + } + else { arr[i].question.min_choices= minchoices===null?2:minchoices===undefined?2:minchoices===0?2:parseInt(minchoices); - arr[i].question.max_choices = parseInt(value); + arr[i].question.max_choices = parseInt(value); } } } @@ -2464,9 +2463,8 @@ class PollNew extends Component { // console.log(this.state.projects===undefined?"":this.state.projects.poll_questions) var displaymysave = (mysave === true) ? "" : "display:none;"; - return ( -
+
{/*提示*/} {Modalstype && Modalstype === true ? - + {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { return ( indext >= 1 ? : "" @@ -2896,10 +2894,10 @@ class PollNew extends Component { className="ml10 mr10 color-grey-6 lineh-40 fl">~ {/*可选最大*/} this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices)} + onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)} 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} > @@ -3391,7 +3389,7 @@ class PollNew extends Component { className="ml10 mr10 color-grey-6 lineh-40 fl">~ {/*可选最大*/}