Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

ecloud_sso
anke1460 5 years ago
commit 4e0439c285

@ -106,7 +106,7 @@ class CoursesController < ApplicationController
videos = @course.videos videos = @course.videos
videos = custom_sort(videos, params[:sort_by], params[:sort_direction]) videos = custom_sort(videos, params[:sort_by], params[:sort_direction])
@count = videos.count @count = videos.count
@videos = paginate videos @videos = paginate videos.includes(user: :user_extension)
end end
def delete_course_video def delete_course_video

@ -963,7 +963,7 @@ class GamesController < ApplicationController
begin begin
shixun = game.myshixun.shixun shixun = game.myshixun.shixun
shixun_tomcat = edu_setting('cloud_bridge') 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}" tpiGitURL = "#{edu_setting('git_address_domain')}/#{game.myshixun.repo_path}"
uri = "#{shixun_tomcat}/bridge/vnc/getvnc" uri = "#{shixun_tomcat}/bridge/vnc/getvnc"
@ -973,14 +973,15 @@ class GamesController < ApplicationController
if res && res['code'].to_i != 0 if res && res['code'].to_i != 0
raise("实训云平台繁忙繁忙等级99") raise("实训云平台繁忙繁忙等级99")
end end
@vnc_url = res['showServer'] # @vnc_url = res['showServer']
# if request.subdomain == "pre-newweb" || request.subdomain == "test-newweb" @vnc_url =
# # 无域名版本 if request.subdomain == "pre-newweb" || request.subdomain == "test-newweb"
# "http://#{service_host}:#{res['port']}/vnc_lite.html?password=headless" # 无域名版本
# else "http://#{service_host}:#{res['port']}/vnc_lite.html?password=headless"
# # 有域名版本 else
# "https://#{res['port']}.#{service_host}/vnc_lite.html?password=headless" # 有域名版本
# end "https://#{res['port']}.#{service_host}/vnc_lite.html?password=headless"
end
@vnc_evaluate = shixun.vnc_evaluate @vnc_evaluate = shixun.vnc_evaluate
rescue Exception => e rescue Exception => e
Rails.logger.error(e.message) Rails.logger.error(e.message)

@ -1210,7 +1210,7 @@ class HomeworkCommonsController < ApplicationController
rescue Exception => e rescue Exception => e
uid_logger(e.message) uid_logger(e.message)
tip_exception("删除失败") tip_exception(e.message)
raise ActiveRecord::Rollback raise ActiveRecord::Rollback
end end
end end

@ -12,5 +12,5 @@ class HomeworkBank < ApplicationRecord
validates :name, length: { maximum: 60, too_long: "不能超过60个字符" } validates :name, length: { maximum: 60, too_long: "不能超过60个字符" }
validates :description, length: { maximum: 15000, too_long: "不能超过15000个字符" } 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 end

@ -38,7 +38,7 @@ class HomeworkCommon < ApplicationRecord
validates :name, presence: true, length: { maximum: 60, too_long: "不能超过60个字符" } validates :name, presence: true, length: { maximum: 60, too_long: "不能超过60个字符" }
validates :description, length: { maximum: 15000, too_long: "不能超过15000个字符" } validates :description, length: { maximum: 15000, too_long: "不能超过15000个字符" }
validates :explanation, length: { maximum: 5000, too_long: "不能超过5000个字符" } 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 # after_update :update_activity
before_destroy :update_homework_bank_quotes before_destroy :update_homework_bank_quotes

@ -2,7 +2,7 @@ class ShixunInfo < ApplicationRecord
belongs_to :shixun belongs_to :shixun
validates_uniqueness_of :shixun_id validates_uniqueness_of :shixun_id
validates_length_of :fork_reason, maximum: 60, message: "不能超过60个字符" 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 after_commit :create_diff_record
validates :description, length: { maximum: 5000, too_long: "不能超过5000个字符" } validates :description, length: { maximum: 5000, too_long: "不能超过5000个字符" }

@ -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.play_duration video.video_play_duration
json.published_at video.display_published_at json.published_at video.display_published_at
json.created_at video.display_created_at json.created_at video.display_created_at
json.updated_at video.display_updated_at 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

@ -25,9 +25,8 @@ namespace :homework_evaluation do
end end
if student_works.present? && student_works.length >= 2 if student_works.present? && student_works.length >= 2
HomeworkEvaluationCommentAssginJob.perform_later(homework_common.id)
homework_detail_manual.update_column('comment_status', 3) homework_detail_manual.update_column('comment_status', 3)
HomeworkEvaluationCommentAssginJob.perform_later(homework_common.id)
else else
#作业数小于2启动失败, 只给老师和助教发 #作业数小于2启动失败, 只给老师和助教发
extra = "作品数量低于两个,无法开启匿评" extra = "作品数量低于两个,无法开启匿评"
@ -35,12 +34,12 @@ namespace :homework_evaluation do
else else
extra = "存在尚未截止的分班,无法开启匿评" extra = "存在尚未截止的分班,无法开启匿评"
end end
HomeworkEvaluationStartNotifyJob.perform_later(homework_common.id, extra)
if extra.present? if extra.present?
homework_detail_manual.update_attributes(:evaluation_start => nil, :evaluation_end => nil, :absence_penalty => 0, homework_detail_manual.update_attributes(:evaluation_start => nil, :evaluation_end => nil, :absence_penalty => 0,
:evaluation_num => 0, :appeal_time => nil, :appeal_penalty => 0) :evaluation_num => 0, :appeal_time => nil, :appeal_penalty => 0)
homework_common.update_attributes(:anonymous_comment => 0, :anonymous_appeal => 0) homework_common.update_attributes(:anonymous_comment => 0, :anonymous_appeal => 0)
end end
HomeworkEvaluationStartNotifyJob.perform_later(homework_common.id, extra)
end end
end end

@ -42,7 +42,7 @@ if (isDev) {
window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin'
} }
// 超管 // 超管
debugType="admin"; //debugType="admin";
// 老师 // 老师
// debugType="teacher"; // debugType="teacher";
// 学生 // 学生

@ -32,12 +32,13 @@ class GraduationTasksappraiseMainEditor extends Component{
return item.response ? item.response.id : item.id return item.response ? item.response.id : item.id
}) })
const comment = this.mdRef.current.getValue() 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.setState( {errorMessage : '分数和评语不能同时为空' })
// this.props.showNotification('请先输入评阅说明') // this.props.showNotification('请先输入评阅说明')
return; return;
} }
if (!score && this.props.isAdmin()===false) { if (!score && this.props.isAdmin()===false &&this.props.isAdmin()===true&&comment!=0&&comment!=0.0) {
this.setState( { this.setState( {
errorMessage : '分数不能为空', errorMessage : '分数不能为空',
errorMessagetype:true errorMessagetype:true

@ -69,4 +69,7 @@
.pointer{ .pointer{
cursor: pointer; cursor: pointer;
}
.pl23{
padding-left: 23px !important;
} }

@ -293,7 +293,7 @@ class Repository extends Component {
</div> </div>
{ {
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 && // !this.props.secret_repository_tab &&
( (
<div> <div>
@ -395,7 +395,7 @@ class Repository extends Component {
{/* })}*/} {/* })}*/}
{/*</div>*/} {/*</div>*/}
{ 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)) ?
<Button size={"small"} className={"fr"} type="link" onClick={this.showDeleteConfirm}>删除</Button>:""} <Button size={"small"} className={"fr"} type="link" onClick={this.showDeleteConfirm}>删除</Button>:""}
<div className={"both"}></div> <div className={"both"}></div>
@ -414,13 +414,14 @@ class Repository extends Component {
className={"reposanttreeswitcher"} className={"reposanttreeswitcher"}
multiple multiple
defaultExpandAll 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} onSelect={this.onSelectDirectoryTree}
onCheck={this.onCheck} onCheck={this.onCheck}
> >
{treesdelecttype===false || trees === undefined ?"": trees === null || trees.length===0?"":trees.map((item, index) => { {treesdelecttype===false || trees === undefined ?"": trees === null || trees.length===0?"":trees.map((item, index) => {
return ( return (
<TreeNode disableCheckbox={this.state.ischeckevalue===item.name?false:this.state.ischecke?true:item.type==='tree'?true:false} item={item} title={`${item.name}`} key={item.type==='tree'?"0-0":`0-0-${index}`} icon={item.type==='tree'?<i className="iconfont icon-xingzhuangjiehebeifen color-blue font-12" />:<i className="iconfont icon-xingzhuangjiehe color-blue font-12"/>} id={`file${index}`} key={index}> <TreeNode className={item.type==='tree'?"pl23":""} checkable={item.type==='tree'?false:true} disableCheckbox={this.state.ischeckevalue===item.name?false:this.state.ischecke?true:item.type==='tree'?true:false} item={item} title={`${item.name}`} key={item.type==='tree'?"0-0":`0-0-${index}`} icon={item.type==='tree'?<i className="iconfont icon-xingzhuangjiehebeifen color-blue font-12" />:<i className="iconfont icon-xingzhuangjiehe color-blue font-12"/>} id={`file${index}`} key={index}>
</TreeNode> </TreeNode>
)})} )})}
</DirectoryTree> </DirectoryTree>

@ -98,23 +98,24 @@ class RepositoryDirectories extends Component {
</a> </a>
<span className={this.props.tpmComment===true?"color888 ml3 mr3":"ml3 mr3"}></span> <span className={this.props.tpmComment===true?"color888 ml3 mr3":"ml3 mr3"}></span>
{ pathArray.map((item, index) => { { pathArray.map((item, index) => {
if(index<pathArray.length-1){
return ( return (
<React.Fragment> <React.Fragment>
{ this.props.nameTypeMap[item] === 'tree' || item.indexOf('.') === -1 { index===pathArray.length-1 && item.indexOf('.') === -1?<span className={"color888"}>
/ {item} </span>:this.props.nameTypeMap[item] === 'tree' || item.indexOf('.') === -1
? <a ? <a
onClick={() => fetchRepo(index + 1)} onClick={() => fetchRepo(index + 1)}
className={this.props.tpmComment===true?"color888":"color-blue"} className={this.props.tpmComment===true?"color888":"color-blue"}
> >
/ {item}</a> / {item}</a>
: :
<a className={this.props.tpmComment===true?"color888":""}> <span className={this.props.tpmComment===true?"color888":""}>
/ {item}</a> / {item}</span>
} }
{index !== pathArray.length - 1 && <span className={this.props.tpmComment===true?"color888 ml3 mr3":"ml3 mr3"}></span>} {index !== pathArray.length - 1 && <span className={this.props.tpmComment===true?"color888 ml3 mr3":"ml3 mr3"}></span>}
</React.Fragment> </React.Fragment>
) )
}
}) })
} }
{/*{ 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.current_user.admin ==true || (TPMRightSectionData && TPMRightSectionData.creator && TPMRightSectionData.creator.login == this.props.current_user.login)) ?*/}

Loading…
Cancel
Save