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

dev_cs_new
hjm 6 years ago
commit 10fccf5ca1

@ -81,8 +81,6 @@ class AccountsController < ApplicationController
return normal_status(-2, "错误的账号或密码")
end
@user.update_column(:last_login_on, Time.now)
successful_authentication(@user)
session[:user_id] = @user.id
@ -124,7 +122,7 @@ class AccountsController < ApplicationController
set_autologin_cookie(user)
UserAction.create(:action_id => user.try(:id), :action_type => "Login", :user_id => user.try(:id), :ip => request.remote_ip)
user.update_column(:last_login_on, Time.now)
# 注册完成后有一天的试用申请(先去掉)
# UserDayCertification.create(user_id: user.id, status: 1)
end

@ -1347,6 +1347,7 @@ class HomeworkCommonsController < ApplicationController
def group_list
@page = params[:page] || 1
@limit = params[:limit] || 10
@course_member_count = @course.course_groups.count
@course_groups = @course.course_groups.page(@page).per(@limit)
@ungroup_user_ids = @course.course_members.ungroup_students.pluck(:user_id)
end

@ -7,8 +7,8 @@ json.group_list do
end
end
# 未分班展示情况放在最后
if (@course_groups.count != (@page.to_i - 1)*@limit.to_i && @course_groups.count < @limit.to_i) ||
(@page.to_i == 1 && @course_groups.count == 0)
if (@course_groups.count != 0 && @course_groups.count < @limit.to_i) ||
((@page.to_i - 1)*@limit.to_i == @course_member_count && @course_groups.count == 0)
ungroup_work_count = homework_ungroup_works_count(@homework, @ungroup_user_ids)
if ungroup_work_count > 0
json.ungroup_list do

@ -96,7 +96,9 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
/*块状列表*/
.square-list{width: 100%;box-sizing: border-box;margin-top:20px}
.square-Item{position: relative;width:280px;margin-right: 26px;margin-bottom: 26px;float: left;border-radius: 6px;background-color:#fff;box-shadow: 0px 0px 12px rgba(0,0,0,0.1); }
.square-Item:hover{bottom: 3px; box-shadow: 0px 0px 12px rgba(0,0,0,0.3);}
.square-Item:hover{
/*bottom: 3px;*/
box-shadow: 0px 0px 12px rgba(0,0,0,0.3);}
.square-Item:hover .closeSquare{display: block}
.square-Item:nth-child(4n+0){margin-right: 0px;}
.square-Item .square-img{display: block;width: 100%}

@ -104,17 +104,17 @@ class ListPageIndex extends Component{
{/*头部banner*/}
<CoursesBanner {...this.props}></CoursesBanner>
{yslGuideone===null||yslGuideone===undefined||yslGuideone===false?
(
this.props.isAdmin()===true?
<Guide
setwindowlocal={(b)=>this.setwindowlocal(b)}
>
</Guide>
:""
)
:""
}
{/*{yslGuideone===null||yslGuideone===undefined||yslGuideone===false?*/}
{/* (*/}
{/* this.props.isAdmin()===true?*/}
{/* <Guide*/}
{/* setwindowlocal={(b)=>this.setwindowlocal(b)}*/}
{/* >*/}
{/* </Guide>*/}
{/* :""*/}
{/* )*/}
{/* :""*/}
{/*}*/}
<div className="educontent clearfix" style={{flex: "1 0 auto"}}>

@ -2492,7 +2492,7 @@ class Listofworksstudentone extends Component {
<div className="clearfix">
<span className="fl color-grey-6 font-12"><span
className="color-orange-tip">{teacherdata === undefined ? "" :teacherdata.student_works&&teacherdata.student_works.length}</span>{teacherdata === undefined ? "" : teacherdata.all_member_count} </span>
className="color-orange-tip">{teacherdata === undefined ? "" : teacherdata.all_member_count}</span>{teacherdata === undefined ? "" : teacherdata.all_member_count} </span>
<style>
{
`

@ -308,6 +308,7 @@ class ShixunWorkModal extends Component{
}
<div className={"clearfix"}>
<Checkbox checked={onChangetype} onChange={this.onChange} className={"ml10"}>{onChangetype===true?"清除":"全选"}</Checkbox>
<span>有效作品都为0</span>
</div>
<div className="clearfix mt30 edu-txt-center mb10">

@ -806,11 +806,11 @@ submittojoinclass=(value)=>{
<%= link_to '注册', user_join_path, :className => "ml5" %>
</span>*/}
{ user===undefined?
<span className="font-15 fr mt17 ml10 mr25">
<span className="font-15 fr mt17 ml5 mr25">
<a onClick={()=>this.educoderlogin()} className="mr5 color-white">登录</a>
<em className="vertical-line"></em>
<a href={"/register"} className="mr5 color-white">注册</a>
</span> :user.login===""?<span className="font-15 fr mt17 ml20 mr25">
</span> :user.login===""?<span className="font-15 fr mt17 ml5 mr25">
<a onClick={()=>this.educoderlogin()} className="mr5 color-white">登录</a>
<em className="vertical-line"></em>
<a href={"/register"} className="mr5 color-white">注册</a>

@ -35,14 +35,14 @@ if (!window['indexHOCLoaded']) {
// $('head').append($('<link rel="stylesheet" type="text/css" />')
// .attr('href', `${_url_origin}/stylesheets/educoder/antd.min.css?1525440977`));
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-common.css?8`));
.attr('href', `${_url_origin}/stylesheets/css/edu-common.css?6`));
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?8`));
.attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?6`));
// index.html有加载
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?8`));
.attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?6`));
// $('head').append($('<link rel="stylesheet" type="text/css" />')

@ -250,7 +250,7 @@ export default class TPMchallengesnew extends Component {
// })
}
this.props.showSnackbar(response.data.messages);
// this.props.showSnackbar(response.data.messages);
}).catch((error) => {
console.log(error)
});

@ -124,7 +124,8 @@ export default class TPMevaluation extends Component {
handpathopt:false,
scorevalue:false,
markvalue:true,
scoretype:undefined
scoretype:undefined,
web_route:null
}
}
@ -215,6 +216,7 @@ export default class TPMevaluation extends Component {
position: response.data.position, //int 关卡位置,导航栏中的第几关
scorevalue:response.data.test_set_score,
markvalue:response.data.test_set_average,
web_route:response.data.web_route
})
this.evaluationoninputvalueonload();
if(response.data.power===false){
@ -579,7 +581,7 @@ export default class TPMevaluation extends Component {
$('textarea[autoHeight]').autoHeight();
}
submitarbitrationevaluation=()=>{
let{evaluationlist,shixunfilepath,shixunfilepathplay,shixunfileexpectpicturepath,shixunfilestandardpicturepath,shixunfilepicturepath,pathoptionvalue,scorevalue,markvalue}=this.state;
let{evaluationlist,shixunfilepath,shixunfilepathplay,shixunfileexpectpicturepath,shixunfilestandardpicturepath,shixunfilepicturepath,pathoptionvalue,scorevalue,markvalue,web_route}=this.state;
let newscorevalue;
@ -647,7 +649,8 @@ export default class TPMevaluation extends Component {
expect_picture_path:shixunfilestandardpicturepath,
picture_path:shixunfilepicturepath,
test_set_score:newscorevalue,
test_set_average:markvalue
test_set_average:markvalue,
web_route:web_route===null?undefined:web_route
},
test_set:evaluationlist
}
@ -741,6 +744,12 @@ export default class TPMevaluation extends Component {
});
}
updatewebroute=(e)=>{
this.setState({
web_route:e.target.value
})
}
render() {
let {
@ -768,7 +777,7 @@ export default class TPMevaluation extends Component {
next_challenge,
StudentTaskPapers,
StudentTaskDocs,
handpathopt,
web_route,
scorevalue,
markvalue,
scoretype
@ -978,6 +987,20 @@ export default class TPMevaluation extends Component {
</div>
</div>
{pathoptionvalue===4&&web_route!=null?<div className="edu-back-white mb10 clearfix">
<div className="padding40-20">
<p className="color-grey-6 font-16 mb20">Web路由</p>
<div className="df">
<div className="flex1 mr20">
<input type="text" className="input-100-45 change" autoComplete="off"
id="shixun_file_picture_path" name="challenge[picture_path]"
value={web_route}
onInput={(e)=>this.updatewebroute(e)}
placeholder="网站类型实训请填写Web路由地址。例java/mypage"/>
</div>
</div>
</div>
</div>:""}
{pathoptionvalue===1||pathoptionvalue===5||pathoptionvalue===6?<div className="edu-back-white mb10 clearfix">
<div className="padding40-20">

@ -1,251 +1,253 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route} from "react-router-dom";
import { Switch ,Input,Tooltip,Icon} from 'antd';
import PropTypes from 'prop-types';
import classNames from 'classnames'
import 'antd/lib/switch/style/index.css'
import './shixunCss/ShixunCardList.css';
import { on, off } from 'educoder'
const $ = window.$;
const Search = Input.Search;
class ShixunCardList extends Component {
constructor(props) {
super(props);
this.state={
allevent:"desc",
mine:0,
InputValue: props.keyword || "",
typemy:0,
hots:0,
news:0,
shixunid:"",
upcircle:false,
typekeyid:undefined,
}
}
componentDidUpdate = (prevProps, prevState) => {
if (this.props.keyword != prevProps.keyword) {
this.setState({
InputValue: this.props.keyword
})
}
}
componentDidMount = () => {
on('searchKeywordChange', (event, data) => {
// console.log(data)
this.Input_search(data)
})
}
componentWillUnmount = () => {
off('searchKeywordChange')
}
latestHot=(e,key)=>{
let{upcircle,typekeyid}=this.state;
let id = e.target.id;
$("#"+id).siblings().removeClass("active");
$("#"+id).addClass("active");
let type;
if(id==="all"){
type="publish_time";
}
if(id==="hot"){
type="hot";
}else if(id==="new"){
type="new";
}
if(typekeyid===key){
if(upcircle===true){
this.setState({
upcircle:false,
})
this.props.Shixunsupcircles("desc")
}else if(upcircle===false){
this.setState({
upcircle:true,
})
this.props.Shixunsupcircles("asc")
}
}else{
this.setState({
typekeyid:key
})
}
//allevent
this.props.ShixunsState(false,type);
}
onSwitchChange=(e,key)=>{
let id=e.target.id
$("#"+id).siblings().removeClass("active");
$("#"+id).addClass("active");
let {typemy,upcircle,typekeyid}=this.state;
if(typekeyid===key){
if(upcircle===true){
this.setState({
upcircle:false,
})
this.props.Shixunsupcircles("desc")
}else if(upcircle===false){
this.setState({
upcircle:true
})
this.props.Shixunsupcircles("asc")
}
}else{
this.setState({
typekeyid:key
})
}
if(typemy===0){
this.setState({
typemy:1
})
}else{
this.setState({
typemy:0
})
}
// allevent
this.props.ShixunsSwitch();
}
//输入框搜索
Input_search = (value) => {
this.setState({
InputValue: value
})
this.props.OnSearchInput(value,true);
}
Input_searchs = (e) => {
this.setState({
InputValue: e.target.value
})
this.props.OnSearchInput(e.target.value,false);
}
upcircles=(val)=>{
if(val==="asc"){
this.setState({
upcircle:false,
})
this.props.Shixunsupcircles("desc")
}else if(val==="desc"){
this.setState({
upcircle:true
})
this.props.Shixunsupcircles("asc")
}
}
render(){
let {mine,InputValue,upcircle}=this.state;
return (
<div className="educontent mt20">
<div className="clearfix">
<div className="fl mr20 font-16 bestChoose shixun_repertoire active"
id={"all"}
onClick={(e)=>this.latestHot(e,1)}>全部
</div>
<div className="fl mr20 font-16 bestChoose shixun_repertoire"
id={mine}
onClick={(e)=>this.onSwitchChange(e,2)}>我的
</div>
<div className="fl mr20 font-16 bestChoose shixun_repertoire"
id="hot"
onClick={(e)=>this.latestHot(e,3)}>最热
</div>
<div className="fl font-16 bestChoose shixun_repertoire"
id="new"
onClick={(e)=>this.latestHot(e,4)}>最新
</div>
<div className="fl font-16 bestChoose shixun_repertoire ml20 mt1"
style={{display:upcircle===true?"block":"none"}}
// onClick={()=>this.upcircles("asc")}
>
<Tooltip placement="bottom" title={"升序"}>
<Icon type="up-circle" theme="twoTone" />
{/*<Icon type="sort-descending" />*/}
</Tooltip>
</div>
<div className="fl font-16 bestChoose shixun_repertoire ml20 mt1"
// onClick={()=>this.upcircles("desc")}
style={{display:upcircle===true?"none":"block"}}
>
<Tooltip placement="bottom" title={"降序"}>
<Icon type="down-circle" theme="twoTone" />
{/*<Icon type="sort-ascending" />*/}
</Tooltip>
</div>
<div className="fr mt3">
{/*<Search*/}
{/*style={{ width: 300 }}*/}
{/*className="search-new-input fl"*/}
{/*placeholder="请输入创建者/实训/关卡名称进行搜索"*/}
{/*value={InputValue}*/}
{/*onInput={this.Input_searchs}*/}
{/*onSearch={value => this.Input_search(value)}*/}
{/*enterButton*/}
{/*/>*/}
{/* <Search
style={{ width: 300 }}
className="fl"
placeholder="请输入创建者/实训/关卡名称进行搜索"
value={InputValue}
onInput={this.Input_searchs}
onSearch={value => this.Input_search(value)}
autoComplete="off"
></Search> */}
</div>
<div className="fr">
<span className="fl color-grey-6 mr30 font-16 mt5" id="search_name">{
this.props.search_tags === null ? "" : this.props.search_tags
}</span>
{/*<div className="fl mr5" style={{marginTop:'1px'}}>*/}
{/*/!* <div className="controlblue"></div>*/}
{/*<span className="controlring"></span> *!/*/}
{/*<Switch*/}
{/*className="controlbtn mr10 mt10 pr"*/}
{/*size="small"*/}
{/*style={{marginTop:'1px'}}*/}
{/*onChange={this.onSwitchChange}*/}
{/*/>*/}
{/*</div>*/}
{/*<span className="fl font-16 cdefault" data-tip-down="隐藏我学习的实训">隐藏我的</span>*/}
</div>
<span className="fr color-grey-6 mr30 font-16" id="search_name"></span>
</div>
</div>
);
}
}
export default ShixunCardList;
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route} from "react-router-dom";
import { Switch ,Input,Tooltip,Icon} from 'antd';
import PropTypes from 'prop-types';
import classNames from 'classnames'
import 'antd/lib/switch/style/index.css'
import './shixunCss/ShixunCardList.css';
import { on, off } from 'educoder'
const $ = window.$;
const Search = Input.Search;
class ShixunCardList extends Component {
constructor(props) {
super(props);
this.state={
allevent:"desc",
mine:0,
InputValue: props.keyword || "",
typemy:0,
hots:0,
news:0,
shixunid:"",
upcircle:false,
typekeyid:undefined,
}
}
componentDidUpdate = (prevProps, prevState) => {
if (this.props.keyword != prevProps.keyword) {
this.setState({
InputValue: this.props.keyword
})
}
}
componentDidMount = () => {
on('searchKeywordChange', (event, data) => {
// console.log(data)
this.Input_search(data)
})
}
componentWillUnmount = () => {
off('searchKeywordChange')
}
latestHot=(e,key)=>{
let{upcircle,typekeyid}=this.state;
let id = e.target.id;
$("#"+id).siblings().removeClass("active");
$("#"+id).addClass("active");
let type;
if(id==="all"){
type="publish_time";
}
if(id==="hot"){
type="hot";
}else if(id==="new"){
type="new";
}
if(typekeyid===key){
if(upcircle===true){
this.setState({
upcircle:false,
})
this.props.Shixunsupcircles("desc")
}else if(upcircle===false){
this.setState({
upcircle:true,
})
this.props.Shixunsupcircles("asc")
}
}else{
this.setState({
typekeyid:key
})
}
//allevent
this.props.ShixunsState(false,type);
}
onSwitchChange=(e,key)=>{
let id=e.target.id
$("#"+id).siblings().removeClass("active");
$("#"+id).addClass("active");
let {typemy,upcircle,typekeyid}=this.state;
if(typekeyid===key){
if(upcircle===true){
this.setState({
upcircle:false,
})
this.props.Shixunsupcircles("desc")
}else if(upcircle===false){
this.setState({
upcircle:true
})
this.props.Shixunsupcircles("asc")
}
}else{
this.setState({
typekeyid:key
})
}
if(typemy===0){
this.setState({
typemy:1
})
}else{
this.setState({
typemy:0
})
}
// allevent
this.props.ShixunsSwitch();
}
//输入框搜索
Input_search = (value) => {
this.setState({
InputValue: value
})
this.props.OnSearchInput(value,true);
}
Input_searchs = (e) => {
this.setState({
InputValue: e.target.value
})
this.props.OnSearchInput(e.target.value,false);
}
upcircles=(val)=>{
if(val==="asc"){
this.setState({
upcircle:false,
})
this.props.Shixunsupcircles("desc")
}else if(val==="desc"){
this.setState({
upcircle:true
})
this.props.Shixunsupcircles("asc")
}
}
render(){
let {mine,InputValue,upcircle}=this.state;
return (
<div className="educontent mt20">
<div className="clearfix">
<div className="fl mr20 font-16 bestChoose shixun_repertoire active"
id={"all"}
onClick={(e)=>this.latestHot(e,1)}>全部
</div>
<div className="fl mr20 font-16 bestChoose shixun_repertoire"
id={mine}
onClick={(e)=>this.onSwitchChange(e,2)}>我的
</div>
<div className="fl mr20 font-16 bestChoose shixun_repertoire"
id="new"
onClick={(e)=>this.latestHot(e,4)}>最新
</div>
<div className="fl font-16 bestChoose shixun_repertoire"
id="hot"
onClick={(e)=>this.latestHot(e,3)}>最热
</div>
<div className="fl font-16 bestChoose shixun_repertoire ml20 mt1"
style={{display:upcircle===true?"block":"none"}}
// onClick={()=>this.upcircles("asc")}
>
<Tooltip placement="bottom" title={"升序"}>
<Icon type="up-circle" theme="twoTone" />
{/*<Icon type="sort-descending" />*/}
</Tooltip>
</div>
<div className="fl font-16 bestChoose shixun_repertoire ml20 mt1"
// onClick={()=>this.upcircles("desc")}
style={{display:upcircle===true?"none":"block"}}
>
<Tooltip placement="bottom" title={"降序"}>
<Icon type="down-circle" theme="twoTone" />
{/*<Icon type="sort-ascending" />*/}
</Tooltip>
</div>
<div className="fr mt3">
{/*<Search*/}
{/*style={{ width: 300 }}*/}
{/*className="search-new-input fl"*/}
{/*placeholder="请输入创建者/实训/关卡名称进行搜索"*/}
{/*value={InputValue}*/}
{/*onInput={this.Input_searchs}*/}
{/*onSearch={value => this.Input_search(value)}*/}
{/*enterButton*/}
{/*/>*/}
{/* <Search
style={{ width: 300 }}
className="fl"
placeholder="请输入创建者/实训/关卡名称进行搜索"
value={InputValue}
onInput={this.Input_searchs}
onSearch={value => this.Input_search(value)}
autoComplete="off"
></Search> */}
</div>
<div className="fr">
<span className="fl color-grey-6 mr30 font-16 mt5" id="search_name">{
this.props.search_tags === null ? "" : this.props.search_tags
}</span>
{/*<div className="fl mr5" style={{marginTop:'1px'}}>*/}
{/*/!* <div className="controlblue"></div>*/}
{/*<span className="controlring"></span> *!/*/}
{/*<Switch*/}
{/*className="controlbtn mr10 mt10 pr"*/}
{/*size="small"*/}
{/*style={{marginTop:'1px'}}*/}
{/*onChange={this.onSwitchChange}*/}
{/*/>*/}
{/*</div>*/}
{/*<span className="fl font-16 cdefault" data-tip-down="隐藏我学习的实训">隐藏我的</span>*/}
</div>
<span className="fr color-grey-6 mr30 font-16" id="search_name"></span>
</div>
</div>
);
}
}
export default ShixunCardList;

@ -98,7 +98,9 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
/*块状列表*/
.square-list{width: 100%;box-sizing: border-box;margin-top:20px}
.square-Item{position: relative;width:280px;margin-right: 26px;margin-bottom: 26px;float: left;border-radius: 6px;background-color:#fff;box-shadow: 0px 0px 12px rgba(0,0,0,0.1); }
.square-Item:hover{bottom: 3px; box-shadow: 0px 0px 12px rgba(0,0,0,0.3);}
.square-Item:hover{
/*bottom: 3px; */
box-shadow: 0px 0px 12px rgba(0,0,0,0.3);}
.square-Item:hover .closeSquare{display: block}
.square-Item:nth-child(4n+0){margin-right: 0px;}
.square-Item .square-img{display: block;width: 100%}

Loading…
Cancel
Save