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

courseware
dinglink 5 years ago
commit d1fe858182

@ -164,7 +164,11 @@ class ChallengesController < ApplicationController
@challenges = @shixun.challenges.joins(join_sql).select(base_columns).uniq
@shixun_modify = (@challenges.select{|c| c.status.present? }.size == @challenges.size)
@shixun_modify = (@challenges.select{|c| !c.status.nil? }.size != @challenges.size)
logger.info("########shixun_modify#{@shixun_modify}")
logger.info("########challenges.size#{@challenges.size}")
logger.info("########challenge_inspect#{@challenges.inspect}")
#@challenges = @shixun.challenges.fields_for_list
@editable = @shixun.status == 0 # before_action有判断权限如果没发布则肯定是管理人员

@ -992,7 +992,7 @@ class ExercisesController < ApplicationController
else
@ex_end_time = @exercise.get_exercise_end_time(current_user.id)
commit_exercise_user @exercise, exercise_user if @ex_end_time < Time.now
commit_exercise_user @exercise, exercise_user if @ex_end_time.present? && @ex_end_time < Time.now
end
# @ex_end_time = @exercise.get_exercise_end_time(current_user.id)
# if ex_answer_time > 0

@ -968,18 +968,19 @@ module ExercisesHelper
subjective_score = exercise_user.subjective_score < 0.0 ? 0.0 : exercise_user.subjective_score
total_score = objective_score + subjective_score
if commit_time.nil?
if exercise.time > 0
start_time = Time.at(exercise_user.start_at + exercise.time * 60)
end_time = start_time > exercise_end_time ? exercise_end_time : start_time
commit_method = start_time > exercise_end_time ? 3 : 2
else
commit_method = 3
end_time = exercise_end_time
end
if exercise.time > 0
start_time = Time.at(exercise_user.start_at + exercise.time * 60)
end_time = start_time > exercise_end_time ? exercise_end_time : start_time
commit_method = start_time > exercise_end_time ? 3 : 2
else
commit_method = 3
end_time = exercise_end_time
end
unless commit_time.nil?
commit_method = 1
end
commit_time = commit_time.present? && end_time > commit_time ? commit_time : end_time
commit_option = {
@ -997,7 +998,7 @@ module ExercisesHelper
def has_comment? exercise_user, question_ids
exercise_answer_ids = exercise_user.user.exercise_answers.where(exercise_question_id: question_ids).pluck(:id)
exercise_shixun_answer_ids = exercise_user.user.exercise_shixun_answers.where(exercise_question_id: question_ids).pluck(:id)
exercise_user.commit_status == 1 && (exercise_user.exercise_user_scores.size > 0 || exercise_user.subjective_score >= 0.0 ||
exercise_user.commit_status == 1 && (exercise_user.exercise_user_scores.size > 0 ||
ExerciseAnswerComment.where(exercise_answer_id: exercise_answer_ids).or(ExerciseAnswerComment.where(exercise_shixun_answer_id: exercise_shixun_answer_ids)).exists?)
end
end

@ -99,9 +99,9 @@ class Users::ShixunService
end
case params[:category]
when 'study', 'collect' then
when 'study' then
relations.order("myshixuns.#{sort_by} #{sort_direction}")
when 'manage' then
when 'manage', 'collect' then
relations.order("shixuns.#{sort_by} #{sort_direction}")
else
relations.order("shixuns.#{sort_by} #{sort_direction}")

@ -46,7 +46,7 @@ debugType = "admin";
// 老师
// debugType="teacher";
// 学生
// debugType="student";
debugType="student";

@ -443,7 +443,7 @@ class NewShixunModel extends Component{
<div>
<style>
{
`body{ width: calc(100%) !important; }
`body{overflow: hidden !important; }
.ant-drawer-content{ overflow:auto !important; background: #f5f5f5; }
.yslbottomsj{position: absolute;bottom: -8px;}
.ant-drawer-close{

@ -175,7 +175,9 @@ class Teacherentry extends Component {
<div className="zcqiandao initials">
正常签到
</div>
:""
:item.attendance_status==="ABSENCE"&&item.attendance_mode==="TEACHER"?<div className="kkqiandao initials">
旷课
</div>:""
)
:
""

@ -808,15 +808,14 @@ class TPMBanner extends Component {
setCollect=()=>{
let id = this.props.match.params.shixunId;
let {shixunsDetails} = this.props;
let url ="/collections.json";
axios.post(url,{
container_id:id,
container_id:shixunsDetails.id,
container_type:"Shixun"
}).then((result)=>{
const status = result.data.status
if(status===0){
debugger
this.props.getcomponentdidmount()
this.props.showNotification(result.data.message);
}
@ -826,15 +825,14 @@ class TPMBanner extends Component {
}
cancelCollect=()=>{
let id = this.props.match.params.shixunId;
let {shixunsDetails} = this.props;
let url=`/collections/cancel.json`;
axios.delete(url,{ data:{
container_id:id,
container_id:shixunsDetails.id,
container_type:"Shixun"
}}).then((response) => {
const status = response.data.status
if(status===0){
debugger
this.props.getcomponentdidmount()
this.props.showNotification(response.data.message);
}
@ -945,6 +943,7 @@ class TPMBanner extends Component {
.ant-popover{
z-index:1000 !important;
}
body{ width: calc(100%) !important; }
`
}
</style>
@ -1373,7 +1372,7 @@ class TPMBanner extends Component {
{this.props.identity < 8 && shixunsDetails.shixun_status != -1 && shixunsDetails.shixun_status != 0?
<div className="fr kaike kkbth mr20"
<div className="fr kaike kkbth mr20 width155"
style={{display: shixunsDetails.can_copy === false || shixunsDetails.can_copy === null ? "none" : "flex"}}>
<Tooltip placement="bottom" title={"基于这个实训修改形成新的实训"}>
<span className="flex1 edu-txt-center fl font-18"
@ -1424,7 +1423,7 @@ class TPMBanner extends Component {
</Spin> :
<div>
<div className="task-popup-content">
<div className={"forkfactors"}>请根据实际情况填写fork本实训的原因</div>
<div className={"forkfactors"}>请根据实际情况填写复制本实训的原因</div>
<Radio.Group onChange={this.onChangeRadiovalue} value={this.state.Radiovalue} className={"ml20 mt20 mb20"} style={{ width: "100%" }}>
<Radio style={radioStyle} value={1}>
实训内容升级

@ -165,4 +165,8 @@ a:active{text-decoration:none;}
.forkfactors{
text-align: center;
color: #999999;
}
.width155{
width:150px !important;
}

@ -243,7 +243,7 @@ class InfosShixun extends Component{
<li className={category == "collect" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a
onClick={() => this.changeCategory("collect")}
href="javascript:void(0)"
className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}学习</a></li>
className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}收藏</a></li>
</div>
<style>
{
@ -279,7 +279,7 @@ class InfosShixun extends Component{
onClick={() => this.changeStatus("closed")} className="w60" href="javascript:void(0)">已关闭</a></li>
</div>
}
{
category && category == "study" && is_current &&
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">

@ -122,7 +122,7 @@ function VideoInReviewItem (props) {
{
isReview !== true && !link ?
<Tooltip title="复制" placement="bottom">
<Tooltip title="复制链接" placement="bottom">
<i className={`icon-fuzhi iconfont copybtn_item_${id}`} data-clipboard-text={getCopyText((play_url || file_url), cover_url)}></i>
</Tooltip>:""
}

Loading…
Cancel
Save