diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index fd2d25dd5..ef6a30d35 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -106,7 +106,7 @@ class CoursesController < ApplicationController videos = @course.videos videos = custom_sort(videos, params[:sort_by], params[:sort_direction]) @count = videos.count - @videos = paginate videos + @videos = paginate videos.includes(user: :user_extension) end def delete_course_video diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index cfcf92e4c..7015cca40 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -963,7 +963,7 @@ class GamesController < ApplicationController begin shixun = game.myshixun.shixun shixun_tomcat = edu_setting('cloud_bridge') - #service_host = edu_setting('vnc_url') + service_host = edu_setting('vnc_url') tpiGitURL = "#{edu_setting('git_address_domain')}/#{game.myshixun.repo_path}" uri = "#{shixun_tomcat}/bridge/vnc/getvnc" @@ -973,14 +973,15 @@ class GamesController < ApplicationController if res && res['code'].to_i != 0 raise("实训云平台繁忙(繁忙等级:99)") end - @vnc_url = res['showServer'] - # if request.subdomain == "pre-newweb" || request.subdomain == "test-newweb" - # # 无域名版本 - # "http://#{service_host}:#{res['port']}/vnc_lite.html?password=headless" - # else - # # 有域名版本 - # "https://#{res['port']}.#{service_host}/vnc_lite.html?password=headless" - # end + # @vnc_url = res['showServer'] + @vnc_url = + if request.subdomain == "pre-newweb" || request.subdomain == "test-newweb" + # 无域名版本 + "http://#{service_host}:#{res['port']}/vnc_lite.html?password=headless" + else + # 有域名版本 + "https://#{res['port']}.#{service_host}/vnc_lite.html?password=headless" + end @vnc_evaluate = shixun.vnc_evaluate rescue Exception => e Rails.logger.error(e.message) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index fb327ec78..d4e7ae4a3 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -1210,7 +1210,7 @@ class HomeworkCommonsController < ApplicationController rescue Exception => e uid_logger(e.message) - tip_exception("删除失败") + tip_exception(e.message) raise ActiveRecord::Rollback end end diff --git a/app/models/homework_bank.rb b/app/models/homework_bank.rb index 7e13891d3..2fdfc613e 100644 --- a/app/models/homework_bank.rb +++ b/app/models/homework_bank.rb @@ -12,5 +12,5 @@ class HomeworkBank < ApplicationRecord validates :name, length: { maximum: 60, too_long: "不能超过60个字符" } validates :description, length: { maximum: 15000, too_long: "不能超过15000个字符" } - validates :reference_answer, length: { maximum: 15000, too_long: "不能超过15000个字符" } + validates :reference_answer, length: { maximum: 25000, too_long: "不能超过25000个字符" } end diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index 65c2e6f21..7a19fb82c 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -38,7 +38,7 @@ class HomeworkCommon < ApplicationRecord validates :name, presence: true, length: { maximum: 60, too_long: "不能超过60个字符" } validates :description, length: { maximum: 15000, too_long: "不能超过15000个字符" } validates :explanation, length: { maximum: 5000, too_long: "不能超过5000个字符" } - validates :reference_answer, length: { maximum: 15000, too_long: "不能超过15000个字符" } + validates :reference_answer, length: { maximum: 25000, too_long: "不能超过25000个字符" } # after_update :update_activity before_destroy :update_homework_bank_quotes diff --git a/app/models/shixun_info.rb b/app/models/shixun_info.rb index 3d3f40c92..799ddaab5 100644 --- a/app/models/shixun_info.rb +++ b/app/models/shixun_info.rb @@ -2,7 +2,7 @@ class ShixunInfo < ApplicationRecord belongs_to :shixun validates_uniqueness_of :shixun_id validates_length_of :fork_reason, maximum: 60, message: "不能超过60个字符" - validates_presence_of :evaluate_script, message: "实训脚本不能为空" + # validates_presence_of :evaluate_script, message: "实训脚本不能为空" after_commit :create_diff_record validates :description, length: { maximum: 5000, too_long: "不能超过5000个字符" } diff --git a/app/views/users/videos/_video.json.jbuilder b/app/views/users/videos/_video.json.jbuilder index 1e09ca4b9..dcf85fb75 100644 --- a/app/views/users/videos/_video.json.jbuilder +++ b/app/views/users/videos/_video.json.jbuilder @@ -3,4 +3,8 @@ json.extract! video, :id, :title, :cover_url, :file_url, :play_url, :vv, :user_i json.play_duration video.video_play_duration json.published_at video.display_published_at json.created_at video.display_created_at -json.updated_at video.display_updated_at \ No newline at end of file +json.updated_at video.display_updated_at +user = video.user +json.user_name user&.real_name +json.user_img url_to_avatar(user) +json.user_login user&.login \ No newline at end of file diff --git a/lib/tasks/homework_evaluation.rake b/lib/tasks/homework_evaluation.rake index f6ae7edf3..1deb80397 100644 --- a/lib/tasks/homework_evaluation.rake +++ b/lib/tasks/homework_evaluation.rake @@ -25,9 +25,8 @@ namespace :homework_evaluation do end if student_works.present? && student_works.length >= 2 - HomeworkEvaluationCommentAssginJob.perform_later(homework_common.id) - homework_detail_manual.update_column('comment_status', 3) + HomeworkEvaluationCommentAssginJob.perform_later(homework_common.id) else #作业数小于2,启动失败, 只给老师和助教发 extra = "作品数量低于两个,无法开启匿评" @@ -35,12 +34,12 @@ namespace :homework_evaluation do else extra = "存在尚未截止的分班,无法开启匿评" end - HomeworkEvaluationStartNotifyJob.perform_later(homework_common.id, extra) if extra.present? homework_detail_manual.update_attributes(:evaluation_start => nil, :evaluation_end => nil, :absence_penalty => 0, :evaluation_num => 0, :appeal_time => nil, :appeal_penalty => 0) homework_common.update_attributes(:anonymous_comment => 0, :anonymous_appeal => 0) end + HomeworkEvaluationStartNotifyJob.perform_later(homework_common.id, extra) end end diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 24caf0c67..9f37e7ead 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -42,7 +42,7 @@ if (isDev) { window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' } // 超管 -debugType="admin"; +//debugType="admin"; // 老师 // debugType="teacher"; // 学生 diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseMainEditor.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseMainEditor.js index 1415414e4..faf0d67a4 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseMainEditor.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseMainEditor.js @@ -32,12 +32,13 @@ class GraduationTasksappraiseMainEditor extends Component{ return item.response ? item.response.id : item.id }) const comment = this.mdRef.current.getValue() - if ((!comment || comment.trim() == "") && !score &&this.props.isAdmin()===true) { + + if ((!comment || comment.trim() == "") && !score &&this.props.isAdmin()===true&&comment!=0&&comment!=0.0) { this.setState( {errorMessage : '分数和评语不能同时为空' }) // this.props.showNotification('请先输入评阅说明') return; } - if (!score && this.props.isAdmin()===false) { + if (!score && this.props.isAdmin()===false &&this.props.isAdmin()===true&&comment!=0&&comment!=0.0) { this.setState( { errorMessage : '分数不能为空', errorMessagetype:true diff --git a/public/react/src/modules/tpm/shixunchild/Repository/Repository.css b/public/react/src/modules/tpm/shixunchild/Repository/Repository.css index c68184337..94daae68a 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/Repository.css +++ b/public/react/src/modules/tpm/shixunchild/Repository/Repository.css @@ -69,4 +69,7 @@ .pointer{ cursor: pointer; +} +.pl23{ + padding-left: 23px !important; } \ No newline at end of file diff --git a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js index eceb042db..8eb3d691c 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js @@ -293,7 +293,7 @@ class Repository extends Component { { - this.props.current_user && (this.props.current_user.admin ==true || (TPMRightSectionData && TPMRightSectionData.creator && TPMRightSectionData.creator.login == this.props.current_user.login)) ? + this.props.current_user && ( this.props.identity<5||this.props.current_user.business==true || this.props.current_user.admin==true || (TPMRightSectionData && TPMRightSectionData.creator && TPMRightSectionData.creator.login == this.props.current_user.login)) ? // !this.props.secret_repository_tab && (
@@ -395,7 +395,7 @@ class Repository extends Component { {/* })}*/} {/*
*/} - { this.props.current_user && (this.props.current_user.admin ==true || (TPMRightSectionData && TPMRightSectionData.creator && TPMRightSectionData.creator.login == this.props.current_user.login)) ? + { this.props.current_user && (this.props.identity<5||this.props.current_user.business==true || this.props.current_user.admin ==true || (TPMRightSectionData && TPMRightSectionData.creator && TPMRightSectionData.creator.login == this.props.current_user.login)) ? :""}
@@ -414,13 +414,14 @@ class Repository extends Component { className={"reposanttreeswitcher"} multiple defaultExpandAll - checkable={ this.props.current_user && (this.props.current_user.admin ==true || (TPMRightSectionData && TPMRightSectionData.creator && TPMRightSectionData.creator.login == this.props.current_user.login)) ?true:false} + checkable={ this.props.current_user && (this.props.identity<5||this.props.current_user.business==true ||this.props.current_user.admin ==true || (TPMRightSectionData && TPMRightSectionData.creator && TPMRightSectionData.creator.login == this.props.current_user.login)) ?true:false} onSelect={this.onSelectDirectoryTree} onCheck={this.onCheck} > {treesdelecttype===false || trees === undefined ?"": trees === null || trees.length===0?"":trees.map((item, index) => { return ( - :} id={`file${index}`} key={index}> + :} id={`file${index}`} key={index}> + )})} diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryDirectories.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryDirectories.js index 34b277009..b97d96ccc 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryDirectories.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryDirectories.js @@ -98,23 +98,24 @@ class RepositoryDirectories extends Component { { pathArray.map((item, index) => { - if(index - { this.props.nameTypeMap[item] === 'tree' || item.indexOf('.') === -1 + { index===pathArray.length-1 && item.indexOf('.') === -1? + / {item} :this.props.nameTypeMap[item] === 'tree' || item.indexOf('.') === -1 ? fetchRepo(index + 1)} className={this.props.tpmComment===true?"color888":"color-blue"} > / {item} : - - / {item} + + / {item} } {index !== pathArray.length - 1 && } ) - } + }) } {/*{ this.props.current_user && (this.props.current_user.admin ==true || (TPMRightSectionData && TPMRightSectionData.creator && TPMRightSectionData.creator.login == this.props.current_user.login)) ?*/}