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

dev_cs
杨树林 5 years ago
commit 562b01bde1

@ -378,7 +378,6 @@ DEPENDENCIES
kaminari (~> 1.1, >= 1.1.1)
listen (>= 3.0.5, < 3.2)
mysql2 (>= 0.4.4, < 0.6.0)
newrelic_rpm
oauth2
pdfkit
puma (~> 3.11)

@ -134,6 +134,11 @@ class HomeworkCommon < ApplicationRecord
self.homework_type == 'practice' && self.publish_time.present? && self.publish_time < Time.now && self.homework_group_reviews.count == 0
end
# 作业查看最新成绩
def update_score identity
identity < Course::NORMAL && publish_time.present? && publish_time < Time.now && !course.is_end
end
# 作业能否立即发布
def publish_immediately user
homework_detail_manual.try(:comment_status) == 0 || homework_group_settings.where(course_group_id: course.charge_group_ids(user)).

@ -104,7 +104,7 @@ class Poll < ApplicationRecord
status = 4
else
if user.present? && user.student_of_course?(course)
ex_time = get_poll_times(user_id,false)
ex_time = get_poll_times(user.id,false)
pb_time = ex_time[:publish_time]
ed_time = ex_time[:end_time]
if pb_time.present? && ed_time.present? && pb_time <= Time.now && ed_time > Time.now

@ -4,6 +4,7 @@ json.partial! "homework_btn_check", locals: {identity: @user_course_identity, ho
json.partial! "student_btn_check", locals: {identity: @user_course_identity, homework: @homework, work: @work}
json.update_score @homework.update_score(@user_course_identity) if @homework.homework_type == "practice"
json.work_count @work_count
json.all_member_count @all_member_count
json.course_group_count @course.course_groups_count

@ -4,5 +4,5 @@ json.name user.full_name
json.grade user.grade
json.identity user&.user_extension&.identity
# json.email user.mail # 邮箱原则上不暴露的,如果实在需要的话只能对某些具体的接口公开
json.image_url url_to_avatar(user)
json.image_url image_tag(url_to_avatar(user))
json.school user.school_name

@ -1,6 +1,6 @@
json.id @user.id
json.name @user.full_name
json.avatar_url url_to_avatar(@user)
json.avatar_url image_tag("/" + url_to_avatar(@user))
json.is_logged_user @user.logged_user?
json.experience @user.experience
json.grade @user.grade

@ -479,7 +479,7 @@ class NewWorkForm extends Component{
<InputNumber className="winput-240-40" placeholder="请填写每组最大人数" value={max_num} max={10}
onChange={this.max_num_change} style={{width:'180px'}} />
</ConditionToolTip>
<label className="color-grey-9 ml20 font-14">项目管理员角色的成员都可以提交作品提交作品时需要关联同组成员组内成员作品共享</label>
<label className="color-grey-9 ml20 font-14">学生提交作品时需要关联同组成员组内成员作品共享</label>
</p>
<p className="mt20">
<ConditionToolTip condition={has_commit || has_project} title={'已有关联项目或作品,不能修改'}>
@ -488,7 +488,7 @@ class NewWorkForm extends Component{
>基于项目实施</Checkbox>
</ConditionToolTip>
<label className="color-grey-9 ml12 font-14">勾选后各小组必须在educoder平台创建项目教师可随时观察平台对各小组最新进展的实时统计</label>
<label className="color-grey-9 ml12 font-14">选中则必须在本平台创建项目项目管理员可以提交作品不选中无需在平台创建项目任意小组成员均可以提交作品</label>
</p>
</div>
)}

@ -382,7 +382,7 @@ class GraduateTopicPostWorksNew extends Component{
)}
</Form.Item>
<span className="tag color-grey9 ">(项目管理员角色的成员都可以提交作品提交作品时需要关联同组成员组内成员作品共享)</span>
<span className="tag color-grey9 ">(学生提交作品时需要关联同组成员组内成员作品共享)</span>
<Form.Item
label=""
className=" "
@ -394,7 +394,7 @@ class GraduateTopicPostWorksNew extends Component{
<Checkbox >基于项目实施</Checkbox>
)}
</Form.Item>
<span className="tag color-grey9 ">(勾选后各小组必须在educoder平台创建项目教师可随时观察平台对各小组最小进展的实时统计)</span>
<span className="tag color-grey9 ">(选中则必须在本平台创建项目项目管理员可以提交作品不选中无需在平台创建项目任意小组成员均可以提交作品)</span>
</div>
<div className="formBlock">

@ -3231,7 +3231,7 @@ class Listofworksstudentone extends Component {
<div className="fr mr5 search-newysl" style={{marginBottom: '1px'}}>
{course_is_end===true?"":<span>
{teacherdata&&teacherdata.publish_immediately===false&&computeTimetype===true?
{teacherdata&&teacherdata.update_score===true&&computeTimetype===true?
(this.props.isNotMember()===false?<div className={"computeTime font-16"} onClick={this.setComputeTimet}>
查看最新成绩
</div>:""):
@ -3555,9 +3555,13 @@ class Listofworksstudentone extends Component {
{ course_is_end===true?"":teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"":<span>
{computeTimetype===true?
(this.props.isNotMember()===false?
<div className={"computeTime font-16"} onClick={this.setComputeTime}>
查看最新成绩
</div>
(
teacherdata&&teacherdata.update_score===true?
<div className={"computeTime font-16"} onClick={this.setComputeTime}>
查看最新成绩
</div>
:""
)
:"")
:
(teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":
@ -3783,9 +3787,15 @@ class Listofworksstudentone extends Component {
<span className="fl mr10 color-grey-6 ">计算成绩时间{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span>
{ course_is_end===true?"":teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"":<span>
{computeTimetype===true?
(this.props.isNotMember()===false?<div className={"computeTime font-16"} onClick={this.setComputeTime}>
查看最新成绩
</div>:""):
(this.props.isNotMember()===false?
(
teacherdata&&teacherdata.update_score===true?
<div className={"computeTime font-16"} onClick={this.setComputeTime}>
查看最新成绩
</div>:""
)
:""):
teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":
(this.props.isNotMember()===false?<div className={"computeTimes font-16"}>
查看最新成绩

@ -1699,16 +1699,66 @@ class Trainingjobsetting extends Component {
if(this.state.allowreplenishment === false){
whethertopays=false;
}
this.setState({
flagPageEditsbox:true,
flagPageEdit: true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
completionefficiencyscore:true,
unifiedsetting:this.state.unifiedsetting,
})
if(this.state.jobsettingsdata!==undefined){
}
try {
if(this.state.jobsettingsdata&& this.state.jobsettingsdata.data.homework_status[0]==="未发布"){
this.setState({
flagPageEditsbox:true,
flagPageEdit: true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
completionefficiencyscore:true,
work_efficiencys:true,
unifiedsetting:this.state.unifiedsetting,
latedeductiontwo:20,
});
}else {
this.setState({
flagPageEditsbox:true,
flagPageEdit: true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
unifiedsetting:this.state.unifiedsetting,
});
if(this.state.work_efficiencys===true){
this.setState({
completionefficiencyscore:true,
})
}else{
this.setState({
completionefficiencyscore:false,
})
}
}
}catch (e) {
this.setState({
flagPageEditsbox:true,
flagPageEdit: true,
whethertopay:whethertopays,
flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline,
flagPageEditsfor:endtime,
unifiedsetting:this.state.unifiedsetting,
});
if(this.state.work_efficiencys===true){
this.setState({
completionefficiencyscore:true,
})
}else{
this.setState({
completionefficiencyscore:false,
})
}
}
if(this.state.proportion === "自定义分值"){
this.setState({
boolUnitetwoname:"自定义分值",

@ -17,7 +17,7 @@
box-sizing: border-box;
}
.userNavs{
line-height: 96px;
line-height: 75px;
background: #fff;
height:96px;
background:rgba(255,255,255,1);

@ -5,10 +5,12 @@ import SendPanel from "./sendPanel.js";
import { getImageUrl } from 'educoder';
import axios from 'axios';
import Modals from '../../modals/Modals';
import AccountProfile from"../../user/AccountProfile";
import OpenCourse from './OpenCourse';
import Jointheclass from '../../modals/Jointheclass'
import Jointheclass from '../../modals/Jointheclass';
import './DetailTop.css';
const Search = Input.Search;
const RadioGroup = Radio.Group;
class DetailTop extends Component{
@ -262,6 +264,18 @@ class DetailTop extends Component{
}
putappointment=()=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.current_user&&this.props.current_user.profile_completed===false){
this.setState({
AccountProfiletype:true
})
return
}
this.setState({
Modalstype:true,
Modalstopval:"是否确认立即预约?",
@ -321,9 +335,15 @@ class DetailTop extends Component{
this.cardsModalcancel()
})
}
hideAccountProfile=()=>{
this.setState({
AccountProfiletype:false
})
}
render(){
let{detailInfoList}=this.props;
let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype}=this.state;
let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype,AccountProfiletype}=this.state;
const radioStyle = {
display: 'block',
height: '30px',
@ -353,6 +373,12 @@ class DetailTop extends Component{
return(
<div className={this.props.courses===undefined||this.props.courses.length===0?"subhead":applypath===false?"subhead mb70":this.state.MenuItemskey===this.props.courses.length?"subhead mb100":"subhead mb70"}>
{AccountProfiletype===true?<AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()}
{...this.props}
{...this.state}
/>:""}
<Modals
modalsType={Modalstype}
modalsTopval={Modalstopval}
@ -486,7 +512,7 @@ class DetailTop extends Component{
</div>
{this.props.courses===undefined||isadminallow_statistics===true?"":<div className="userNavs mt20" style={applypath===false?{}:this.state.MenuItemskey===this.props.courses.length?{height:'158px'}:{}}>
{this.props.courses===undefined||isadminallow_statistics===true?"":<div className="userNavs mt20" style={applypath===false?{}:this.state.MenuItemskey===this.props.courses.length?{height:'135px'}:{}}>
<style>
{
`
@ -509,7 +535,7 @@ class DetailTop extends Component{
`
}
</style>
{this.props.courses===undefined||this.props.courses.length===0?"":<li className={"fl pd4020"}>
{this.props.courses===undefined||this.props.courses.length===0?"":<li className={"fl pd4020 mt10"}>
{this.state.courseslist.map((item,key)=>{
if(item.course_identity<4){
@ -651,7 +677,10 @@ class DetailTop extends Component{
.mt26{
margin-top:26px;
}
.mt10block{
margin-top: 10px;
display: inline-block;
}
`
}
</style>
@ -671,8 +700,8 @@ class DetailTop extends Component{
<span className={coursestypes===true?"fr user_default_btn background191 font-18 pathbtensbox mt5":"fr user_default_btn background191 font-18 pathbtensbox mt26"}>预约报名成功</span>:""}
{/*{item.course_status.status===0?<div className="mr51 shixun_detail pointer fl user-colorgrey-green pathdefault">即将开课</div>:""}*/}
{item.course_status.status===1?<div className="mr51 shixun_detail pointer fl color-orange pathdefault">{item.course_status.time}</div>:""}
{item.course_status.status===2&&item.course_identity<6?<div className="mr20 shixun_detail pointer fl user-colorgrey-9b pathdefault">已结束</div>:""}
{item.course_status.status===1?<div className="mr51 shixun_detail pointer fl color-orange pathdefault mt10">{item.course_status.time}</div>:""}
{item.course_status.status===2&&item.course_identity<6?<div className="mr20 shixun_detail pointer fl user-colorgrey-9b pathdefault mt10">已结束</div>:""}
{/*<div className="fr user_default_btn background191 font-18 mt28 pathbtens pathdefault">已结束</div>*/}
{item.course_status.status===0?
item.course_identity<5?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens courseslistsa mr20" href={item.first_category_url} target="_blank">
@ -690,7 +719,7 @@ class DetailTop extends Component{
{item.course_status.status===2?
item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens courseslistsa mr20" href={item.first_category_url} target="_blank">
进入课堂
</a>:<div className="mr20 shixun_detail pointer fl user-colorgrey-9b pathdefault"></div>:""}
</a>:<div className="mr20 shixun_detail pointer fl user-colorgrey-9b pathdefault mt10"></div>:""}
</div>
)})}
@ -712,8 +741,8 @@ class DetailTop extends Component{
:""}
{applypath===true&&this.props.courses.length===0?this.state.MenuItemskey===this.props.courses.length||coursestypes===true?<span className={coursestypes===true?"fl ml20 lineHeight0 relativewidth":"fl ml20 lineHeight0 relativewidth"}>
<span>当前预约报名人数<span className={"color-red mr5"}>{getappointmenttype===true?this.props.detailInfoList&&this.props.detailInfoList.participant_count+1:this.props.detailInfoList&&this.props.detailInfoList.participant_count}</span></span>
<span className={"font153"}>当预约报名人数达到 {this.props.detailInfoList&&this.props.detailInfoList.student_count} 人时即将开课</span>
<span className={"mt10block"}>当前预约报名人数<span className={"color-red mr5"}>{getappointmenttype===true?this.props.detailInfoList&&this.props.detailInfoList.participant_count+1:this.props.detailInfoList&&this.props.detailInfoList.participant_count}</span></span>
<span className={"font153 mt10block"}>当预约报名人数达到 {this.props.detailInfoList&&this.props.detailInfoList.student_count} 人时即将开课</span>
{this.props.detailInfoList&&this.props.detailInfoList.has_participate===false?
getappointmenttype===true?<span className={coursestypes===true?"fr user_default_btn background191 font-18 pathbtensbox absolutewidth mt5":"fr user_default_btn background191 font-18 pathbtensbox absolutewidth"}>预约报名成功</span>:<a className={coursestypes===true?"fr user_default_btn task-btn-28BE6C font-18 pathbtensbox absolutewidth mt5":"fr user_default_btn task-btn-28BE6C font-18 pathbtensbox absolutewidth"} onClick={()=>this.putappointment()}></a>:
<span className={coursestypes===true?"fr user_default_btn background191 font-18 pathbtensbox absolutewidth mt5":"fr user_default_btn background191 font-18 pathbtensbox absolutewidth"}>预约报名成功</span>}

@ -50,10 +50,10 @@ class InfosBanner extends Component{
</p>
<p className="mt15">
<Tooltip placement='bottom' title={ data && data.professional_certification ?"已职业认证":"未职业认证"}>
<i className={ data && data.professional_certification ? "iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-green mr20 ml2":"iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-B8 mr20 ml2"}></i>
<i className={ data && data.professional_certification ? "iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-blue mr20 ml2":"iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-B8 mr20 ml2"}></i>
</Tooltip>
<Tooltip placement='bottom' title={ data && data.authentication ?"已实名认证":"未实名认证"}>
<i className={ data && data.authentication ? "iconfont icon-renzhengshangjia font-18 user-colorgrey-green":"iconfont icon-renzhengshangjia font-18 user-colorgrey-B8"}></i>
<i className={ data && data.authentication ? "iconfont icon-renzhengshangjia font-18 user-colorgrey-blue":"iconfont icon-renzhengshangjia font-18 user-colorgrey-B8"}></i>
</Tooltip>
</p>
</div>

@ -168,6 +168,7 @@
}
.user-colorgrey-B8{color:#B8B8B8}
.user-colorgrey-green{color:#7ED321}
.user-colorgrey-blue{color:#98EBFF}
.user_yellow_btn {
color: #fff!important;
background-color: #FF8E02;

Loading…
Cancel
Save