Merge branch 'dev_hjm_a' into dev_cs_new

dev_cs_new
caishi 6 years ago
commit bbac51bc2b

@ -33,7 +33,7 @@ class AccountsController < ApplicationController
uid_logger("start register: verifi_code is #{verifi_code}, code is #{code}, time is #{Time.now.to_i - verifi_code.try(:created_at).to_i}")
# check_code = (verifi_code.try(:code) == code.strip && (Time.now.to_i - verifi_code.created_at.to_i) <= 10*60)
# todo 上线前请删除万能验证码"513231"
if code != "513231"
unless code == "513231" && request.host == "47.96.87.25"
return normal_status(-2, "验证码不正确") if verifi_code.try(:code) != code.strip
return normal_status(-2, "验证码已失效") if !verifi_code&.effective?
end

@ -1566,15 +1566,22 @@ class ExercisesController < ApplicationController
def check_user_id_start_answer #判断用户在开始答题时是否有用户id传入,如果为老师则id必需否则为当前用户的id
user_login = params[:login]
# exercise_current_user_id = params[:user_id]
if user_login.blank? && @user_course_identity < Course::STUDENT #id不存在且当前为老师/管理员等
normal_status(-1,"请输入学生登陆名!")
else
@ex_answerer = User.find_by(login: user_login) #回答者
if @user_course_identity < Course::STUDENT || @exercise.score_open
@ex_answerer = user_login.blank? ? current_user : User.find_by(login: user_login)
else
@ex_answerer = current_user
end
if @ex_answerer.blank?
normal_status(404,"答题用户不存在")
elsif @user_course_identity > Course::STUDENT && !@exercise.is_public
normal_status(403,"非公开试卷")
else
@exercise_current_user_id = @ex_answerer.id || current_user.id
# @exercise_current_user_id = @ex_answerer.id || current_user.id
@exercise_current_user_id = @ex_answerer.id
end
end
end

@ -5,6 +5,7 @@ json.course_id @course.id
json.school @course.school&.name
json.class_period @course.class_period
json.credit @course.credit
json.start_date @course.start_date
json.end_date @course.end_date
json.is_public @course.is_public
json.course_module_types @course.course_modules.where(hidden: 0).pluck(:module_type)

@ -38,6 +38,8 @@ namespace :excellent_course_exercise do
rand_num = index < pass_count - 1 ? 20 : rand(1..16)
elsif exercise_question_ids.length == 17
rand_num = index < pass_count - 1 ? rand(13..17) : rand(1..11)
elsif exercise_question_ids.length == 39
rand_num = index < pass_count - 1 ? rand(30..39) : rand(1..18)
else
rand_num = exercise_question_ids.length
end

@ -722,15 +722,19 @@ class Coursesleftnav extends Component{
let {url}=this.state;
if (key === this.props.indexs) {
this.props.unlocationNavfun(undefined)
this.props.history.replace(urls);
} else {
this.props.unlocationNavfun(key)
this.props.history.replace(urls);
}
if(urls!=url){
this.props.history.replace(urls);
}
if(this.props.indexs===undefined){
this.props.history.replace(urls);
}
// if(this.props.indexs===undefined){
//
// }else{
//
// }
}
maincontent=(item,key)=>{

@ -226,10 +226,11 @@ class DetailCards extends Component{
startshixunCombattype:true,
})
} else {
window.location.href = "/tasks/" + response.data.game_identifier;
// window.location.href = "/tasks/" + response.data.game_identifier;
// window.location.href = path
// let path="/tasks/"+response.data.game_identifier;
// this.props.history.push(path);
window.open("/tasks/" + response.data.game_identifier);
}
}).catch((error) => {

@ -29,7 +29,7 @@ class InfosBanner extends Component{
<div className="bannerPanel mb60">
<div className="educontent">
<div className="clearfix color-white mb25">
<p className="myPhoto mr30 fl"><img alt="头像" src={data && `${getImageUrl('images/'+data.avatar_url)}`}/></p>
<p className="myPhoto mr20 fl"><img alt="头像" src={data && `${getImageUrl('images/'+data.avatar_url)}`}/></p>
<div className="fl">
<p className="clearfix mt20">
<span className="username task-hide" style={{"maxWidth":'370px'}}>{data && data.name}</span>
@ -38,9 +38,9 @@ class InfosBanner extends Component{
<span className="userpost"><label>{data && data.identity}</label></span>
}
</p>
<p className="mt20">
<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 mr30 ml2":"iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-B8 mr30 ml2"}></i>
<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>
</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>
@ -68,7 +68,7 @@ class InfosBanner extends Component{
</span>
:
<span className="fl mt35 ml60">
<a href={`${this.props.Headertop && this.props.Headertop.old_url}/messages/${login}/message_detail?target_ids=${id}`} className="user_default_btn user_yellow_btn fl font-18">私信</a>
<a href={`/messages/${login}/message_detail?target_ids=${id}`} className="user_default_btn user_yellow_btn fl font-18">私信</a>
</span>
}
</div>

@ -126,7 +126,7 @@ class InfosCourse extends Component{
</p>
<div className="square-list clearfix">
{
page == 1 && is_current &&
page == 1 && is_current && !category &&
this.props.current_user && this.props.current_user.user_identity != "学生" ? <Create href={"/courses/new"} name={"新建课堂"} index="1"></Create> : ""
}
{

@ -148,7 +148,7 @@ class InfosPath extends Component{
</div>
<div className="square-list clearfix">
{
page == 1 && is_current &&
page == 1 && is_current && !category &&
this.props.current_user && this.props.current_user.user_identity != "学生" ? <Create href={"/paths/new"} name={"新建实践课程"} index="3"></Create>:""
}
{

@ -121,7 +121,7 @@ class InfosProject extends Component{
</p>
<div className="square-list clearfix">
{
page == 1 && is_current && this.props.current_user && this.props.current_user.user_identity != "学生" ?
page == 1 && is_current && this.props.current_user && !category && this.props.current_user.user_identity != "学生" ?
<Create href={`${this.props.Headertop && this.props.Headertop.old_url}/projects/new`} name={"新建项目"} index="4"></Create>:""
}
{

@ -157,7 +157,7 @@ class InfosShixun extends Component{
</div>
<div className="square-list clearfix">
{
page == 1 && is_current && this.props.current_user && this.props.current_user.user_identity != "学生" ?
page == 1 && is_current && !category && this.props.current_user && this.props.current_user.user_identity != "学生" ?
<Create href={"/shixuns/new"} name={"新建实训"} index="2"></Create>:""
}
{

@ -26,7 +26,7 @@
height: 158px;
cursor: pointer;
}
.nItem.videoItem:hover .playWrap {.videoItem img.play
.nItem.videoItem:hover .playWrap {
display: inline-block;
}
.nItem .mask {

@ -10,6 +10,7 @@ import { getUploader } from './AliyunUploaderManager'
import { reducer, initialState } from './VideoReducer'
import { deleteVideoInCloud } from './VideoUtil'
import uploadIcon from './images/upload.png'
import uploadHoverIcon from './images/upload_hover.png'
let uploader
const files = []
@ -167,21 +168,29 @@ function VideoUploadList (props) {
const _input = document.getElementById('fileUpload')
_input.value = ''
}
// uploader.deleteFile(index);
function cancelUpload(index, isSuccess) {
// TODO 确定取消?
function doDelete(index, isSuccess) {
uploader.deleteFile(index)
// uploader.cancelFile(index)
if (isSuccess) {
deleteVideoInCloud(username, state.videoes[index].videoId)
}
// else {
// uploader.cancelFile(index)
// }
clearInput()
clearInput()
dispatch({type: 'removeVideo', index})
// setVideoes([...videoes.splice(index, 1)])
}
// uploader.deleteFile(index);
function cancelUpload(index, isSuccess) {
props.confirm({
content: <div>
<div>您确认要{isSuccess ? '删除' : '取消上传'}该视频吗</div>
</div>,
onOk: () => {
doDelete(index, isSuccess)
}
})
}
function onPublish() {
if (state.videoes.length == 0) {
showNotification('请先上传视频')
@ -291,6 +300,26 @@ function VideoUploadList (props) {
border-bottom: none;
}
.noUploads img {
width: 64px;
height: 48px;
}
.noUploads .uploadHoverIcon {
display: none;
}
.noUploads .imgWrap:hover .uploadHoverIcon {
display: inline;
}
.noUploads .imgWrap:hover .uploadIcon {
display: none;
}
.noUploads .imgWrap {
width: 72px;
height: 54px;
margin: 0 auto;
cursor: pointer;
}
`}</style>
<CBreadcrumb
className="mb26"
@ -308,8 +337,13 @@ function VideoUploadList (props) {
<div className="section">
{/* noUploads */}
{noUploads && <div className="noUploads" style={{paddingTop: '72px'}}>
<img src={uploadIcon} onClick={() => document.getElementById('fileUpload').click()}></img>
{noUploads && <div className="noUploads" style={{paddingTop: '72px'}} >
<div className="imgWrap" onClick={() => document.getElementById('fileUpload').click()}>
<img className="uploadIcon" src={uploadIcon} ></img>
<img className="uploadHoverIcon" src={uploadHoverIcon} ></img>
</div>
<div style={{
color: '#000000',
fontSize: '18px',

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 B

Loading…
Cancel
Save