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 = 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

@ -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)

@ -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

@ -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

@ -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

@ -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个字符" }

@ -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
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
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

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

@ -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

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

@ -293,7 +293,7 @@ class Repository extends Component {
</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 &&
(
<div>
@ -395,7 +395,7 @@ class Repository extends Component {
{/* })}*/}
{/*</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>:""}
<div className={"both"}></div>
@ -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 (
<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>
)})}
</DirectoryTree>

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

Loading…
Cancel
Save