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

dev_jupyter
杨树林 5 years ago
commit 35db6c60bb

@ -24,8 +24,8 @@ class ApplicationController < ActionController::Base
# 所有请求必须合法签名
def check_sign
Rails.logger.info("66666 #{params}")
suffix = request.url.split(".").last
suffix_arr = ["xls", "xlsx"] # excel文件先注释
suffix = request.url.split(".").last.split("?").first
suffix_arr = ["xls", "xlsx", "pdf"] # excel文件先注释
unless suffix_arr.include?(suffix)
if params[:client_key].present?
randomcode = params[:randomcode]

@ -14,14 +14,14 @@ class DiscussesController < ApplicationController
@disscuss_count = Discuss.where(:dis_id => @container.id, :dis_type => @container.class.to_s, :root_id => nil).count
disscusses = Discuss.where(:dis_id => @container.id, :dis_type => @container.class.to_s,
:root_id => nil)
@discusses = disscusses.limit(LIMIT).joins("left join games on discusses.challenge_id = games.challenge_id and discusses.user_id = games.user_id")
.select("discusses.*, games.identifier").includes(:user, :praise_treads).offset(offset)
@discusses = disscusses.joins("left join games on discusses.challenge_id = games.challenge_id and discusses.user_id = games.user_id")
.select("discusses.*, games.identifier").includes(:user, :praise_treads)
else
disscusses = Discuss.where("dis_id = :dis_id and dis_type = :dis_type and root_id is null and
(discusses.hidden = :hidden or discusses.user_id = :user_id)",
{dis_id: @container.id, dis_type: @container.class.to_s, hidden: false, user_id: current_user.id})
@disscuss_count = disscusses.count("discusses.id")
@discusses = disscusses.limit(LIMIT).includes(:user, :praise_treads).offset(offset)
@discusses = disscusses.includes(:user, :praise_treads).limit(LIMIT).offset(offset)
end
@current_user = current_user

@ -1,5 +1,5 @@
class GitsController < ApplicationController
skip_before_action :check_sign
# 说明:
# 以下Git认证只针对新版gitGitlab的Git认证不走该控制器
# 思路:
@ -39,7 +39,7 @@ class GitsController < ApplicationController
# 用户是否对对象拥有权限
system_user = User.find_by_login(input_username) || User.find_by_mail(input_username) || User.find_by_phone(input_username)
# 如果用户名密码错误
if system_user && !system_user.check_password?(input_password)
if system_user.blank? || system_user && !system_user.check_password?(input_password)
uid_logger_error("git start: password is wrong")
result = false
else

@ -1377,12 +1377,12 @@ class HomeworkCommonsController < ApplicationController
tip_exception(-1, "作业还未发布,不能评阅") if @homework_detail_manual.comment_status == 0
tip_exception("请至少输入一个评阅") if params[:comment].blank? && params[:hidden_comment].blank?
ActiveRecord::Base.transaction do
work_ids = @homework.student_works.where(user_id: @course.teacher_group_user_ids(current_user.id)).pluck(:id)
work_ids = @homework.student_works.where(work_status: [1, 2], user_id: @course.teacher_group_user_ids(current_user.id)).pluck(:id)
has_comment_ids = ShixunWorkComment.where(challenge_id: 0, student_work_id: work_ids, batch_comment: 0).pluck(:student_work_id)
batch_comment_works = ShixunWorkComment.where(challenge_id: 0, student_work_id: work_ids, batch_comment: 1)
batch_comment_works.update_all(comment: params[:comment], hidden_comment: params[:hidden_comment])
work_ids = work_ids - has_comment_ids - batch_comment_works.pluck(:student_work_id)
@homework.student_works.where(work_status: 0, id: work_ids).update_all(work_status: 1, commit_time: @homework.end_time, update_time: Time.now, work_score: 0, final_score: 0)
# @homework.student_works.where(work_status: 0, id: work_ids).update_all(work_status: 1, commit_time: @homework.end_time, update_time: Time.now, work_score: 0, final_score: 0)
HomeworkBatchCommentJob.perform_later(params[:comment], params[:hidden_comment], work_ids, @homework.id, current_user.id)
normal_status("评阅成功")
end

@ -792,12 +792,12 @@ class PollsController < ApplicationController
if the_group_setting_status == 2
poll_group_params = {
:publish_time => the_group_setting.publish_time,
:end_time => poll_end_time
:end_time => poll_end_time < Time.now ? the_group_setting.end_time : poll_end_time
}
elsif the_group_setting_status == 3
poll_group_params = {
:publish_time => the_group_setting.publish_time,
:end_time => the_group_setting.end_time
:end_time => poll_end_time
}
end
the_group_setting.update_attributes(poll_group_params)

@ -1,4 +1,8 @@
import React from "react";
import md5 from 'md5';
import {Input} from "antd";
const { Search } = Input;
const $ = window.$;
const isDev = window.location.port == 3007;
export const TEST_HOST = "https://test-newweb.educoder.net"
@ -128,7 +132,13 @@ export function getTaskUrlById(id) {
export function getRandomcode(url) {
Railsgettimes()
let anewopens=md5(newopens+newtimestamp);
return `${url}?randomcode=${newtimestamp}&client_key=${anewopens}`
if (url.indexOf('?') == -1) {
return `${url}?randomcode=${newtimestamp}&client_key=${anewopens}`
}else {
return `${url}&randomcode=${newtimestamp}&client_key=${anewopens}`
}
}
export function htmlEncode(str) {
@ -144,3 +154,15 @@ export function htmlEncode(str) {
s = s.replace(/\"/g, "&quot;");
return s;
}
export function publicSearchs(Placeholder,onSearch,onInputs,onChanges,loadings) {
return(<Search
placeholder= { Placeholder || "请输入内容进行搜索" }
onSearch={onSearch}
// value={searchValue}
onInput={onInputs}
onChange={onChanges}
loading={loadings||false}
allowClear={true}
></Search>)
}

@ -2,7 +2,7 @@
// export { default as OrderStateUtil } from '../routes/Order/components/OrderStateUtil';
export { getImageUrl as getImageUrl, getUrl as getUrl, getRandomcode as getRandomcode,getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl
export { getImageUrl as getImageUrl, getUrl as getUrl, publicSearchs as publicSearchs,getRandomcode as getRandomcode,getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl
, getUploadActionUrl as getUploadActionUrl,getUploadActionUrltwo as getUploadActionUrltwo ,getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth
, getTaskUrlById as getTaskUrlById, TEST_HOST ,htmlEncode as htmlEncode } from './UrlTool';
export { default as queryString } from './UrlTool2';

@ -230,7 +230,8 @@ class Fileslists extends Component{
filesId:list.id,
name:list.name,
course_is_public:result.data.data.course_is_public,
isSpin:false
isSpin:false,
page:page
})
}
}
@ -423,7 +424,7 @@ class Fileslists extends Component{
onPressEnter = () => {
let {searchValue}=this.state;
let{pagesize,page,tagname,sort,sorttype,coursesecondcategoryid}=this.state;
this.getfileslist(pagesize,page,tagname,searchValue,sort,sorttype,coursesecondcategoryid);
this.getfileslist(pagesize,1,tagname,searchValue,sort,sorttype,coursesecondcategoryid);
}
onInputSearchChange = (e) => {
@ -850,6 +851,7 @@ class Fileslists extends Component{
searchValue={ searchValue }
// searchtype={this.props.isAdmin||this.props.isStudent ?true:false}
onInputSearchChange={this.onInputSearchChange}
allowClearonChange={this.onInputSearchChange}
firstRowRight={
<React.Fragment>
{/*{this.props.isAdmin()?parseInt(this.props.match.params.main_id)===parseInt(this.props.coursesids)?<WordsBtn style="blue" onClick={()=>this.addDir()} className={"mr30 font-16"}>新建目录</WordsBtn>:"":""}*/}

@ -346,6 +346,7 @@ class Boards extends Component{
title={boardName || "帖子列表"}
searchValue={ searchValue }
onInputSearchChange={this.onInputSearchChange}
allowClearonChange={this.onInputSearchChange}
showSearchInput={messages.length >= 10}
searchPlaceholder={ '请输入帖子名称进行搜索' }
firstRowRight={

@ -1,28 +1,17 @@
import React,{Component} from "react";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip,Spin, Pagination} from "antd";
import {Link} from 'react-router-dom';
import locale from 'antd/lib/date-picker/locale/zh_CN';
import {WordsBtn, ConditionToolTip, queryString, getImageUrl, on, off, NoneData, sortDirections} from 'educoder';
import {WordsBtn, ConditionToolTip, queryString, publicSearchs, on, off, NoneData, sortDirections} from 'educoder';
import axios from 'axios';
import Modals from '../../modals/Modals';
import CoursesListType from '../coursesPublic/CoursesListType';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import CheckAllGroup from '../common/button/CheckAllGroup'
import moment from 'moment';
import CheckCodeModal from '../coursesPublic/modal/CheckCodeModal'
import '../css/Courses.css'
import WorkDetailPageHeader from './common/WorkDetailPageHeader'
import '../css/Courses.css';
import PublishRightnow from './PublishRightnow'
import ModulationModal from "../coursesPublic/ModulationModal";
import AccessoryModal from "../coursesPublic/AccessoryModal";
import LeaderIcon from './common/LeaderIcon'
const { Option} = Select;
const CheckboxGroup = Checkbox.Group;
const confirm = Modal.confirm;
let GraduationTasksnewtype=true;
const $ = window.$;
const Search = Input.Search;
const RadioGroup = Radio.Group;
function renderScore(score, content) {
let color = '#747A7F'
@ -414,6 +403,7 @@ class CommonWorkList extends Component{
left_time: {},
category: {},
b_order: 'desc',
searchtypes:false
}
}
onTablePagination = (page) => {
@ -423,10 +413,26 @@ class CommonWorkList extends Component{
}
onSearchValue = (val) => {
if (val === ""||val===undefined) {
this.setState({
search: undefined,
searchtypes:false
})
}else{
this.setState({
searchtypes:true
})
}
this.fetchList()
}
onSearchValueInput = (e) => {
this.setState({search: e.target.value})
if (e.target.value === ""||e.target.value===undefined) {
this.setState({
search: undefined,
})
} else {
this.setState({search: e.target.value})
}
}
componentDidMount() {
@ -789,13 +795,14 @@ class CommonWorkList extends Component{
{/* value={search} */}
<div className="fr search-new mr8" style={{marginBottom:'1px'}}>
<Search
placeholder="请输入姓名或学号搜索"
id="subject_search_input"
onInput={this.onSearchValueInput}
onSearch={this.onSearchValue}
autoComplete="off"
></Search>
{/*<Search*/}
{/* placeholder="请输入姓名或学号搜索1"*/}
{/* id="subject_search_input"*/}
{/* onInput={this.onSearchValueInput}*/}
{/* onSearch={this.onSearchValue}*/}
{/* autoComplete="off"*/}
{/*></Search>*/}
{publicSearchs("请输入姓名或学号搜索",this.onSearchValue,this.onSearchValueInput,this.onSearchValueInput)}
</div>
</ul> }
@ -859,7 +866,10 @@ class CommonWorkList extends Component{
<div id="forum_list" className="forum_table">
<div className="mh650 edu-back-white">
<NoneData></NoneData>
<NoneData
{...this.props}
{...this.state}
></NoneData>
</div>
</div>
</Spin>

@ -1,28 +1,22 @@
import React,{ Component } from "react";
import { Input,Checkbox,Menu,Pagination,Spin} from "antd";
import CourseLayoutcomponent from '../common/CourseLayoutComponent';
import UseBank from './UseBank'
import '../css/members.css'
import '../css/busyWork.css'
import CoursesListType from '../coursesPublic/CoursesListType'
import CommonWorkItem from './CommonWorkItem'
import PublishRightnow from './PublishRightnow'
import ConnectProject from './ConnectProject'
import { WordsBtn, on, off } from 'educoder'
import Modals from '../../modals/Modals'
import NoneData from "../coursesPublic/NoneData"
import Titlesearchsection from '../common/titleSearch/TitleSearchSection';
import { RouteHOC } from './common'
import axios from 'axios';
import _ from 'lodash'
const Search = Input.Search;
const map={1:"普通作业",2:"",3:"分组作业"}
const COMMON_WORK = 1
// const Search = Input.Search;
// const map={1:"普通作业",2:"",3:"分组作业"}
// const COMMON_WORK = 1
// const COMMON_WORK = 2
class commonWork extends Component{
constructor(props){
@ -47,13 +41,12 @@ class commonWork extends Component{
inputStudent=(e)=>{
this.setState({
search:e.target.value,
page:1
})
}
//搜索查询
searchStudent=()=>{
let {page,search,order}=this.state;
this.getList(page,search,order);
this.getList(1,search,order);
}
openConnectionProject = (work) => {
this.refs['connectProject'].openConnectionProject(work)
@ -134,11 +127,14 @@ class commonWork extends Component{
mainList:result.data,
totalCount:result.data.task_count,
isSpin:false,
page:page,
...result.data
})
}
}).catch((error)=>{
console.log(error);
this.setState({
isSpin:false
})
})
}
//筛选条件
@ -325,7 +321,7 @@ class commonWork extends Component{
console.log(error)
})
}
render(){
let {
@ -396,7 +392,7 @@ class commonWork extends Component{
// searchtype={this.props.isAdmin||this.props.isStudent ?true:false}
onInputSearchChange={this.inputStudent}
onPressEnter={this.searchStudent}
allowClearonChange={this.inputStudent}
firstRowRight={
<React.Fragment>
{ isAdmin && <WordsBtn style="blue" className="fr" onClick={()=>this.createCommonWork(1)}>新建</WordsBtn>}

@ -1,8 +1,5 @@
import React,{ Component } from "react";
import { Input } from "antd";
const Search = Input.Search;
import {publicSearchs} from 'educoder';
class Titlesearchsection extends Component{
constructor(props){
super(props);
@ -14,7 +11,7 @@ class Titlesearchsection extends Component{
render(){
let { addGroup } = this.state;
const { firstRowRight, secondRowLeft,firstRowMid, secondRowBotton,thirdRow, title, onInputSearchChange
, searchValue, onPressEnter, searchPlaceholder, showSearchInput } = this.props;
, searchValue, onPressEnter, searchPlaceholder, allowClearonChange } = this.props;
return(
<React.Fragment>
<style>{`
@ -79,12 +76,15 @@ class Titlesearchsection extends Component{
{/* (searchValue || showSearchInput) && */}
{ <div className="fr mt16 mb16 searchView" >
<Search
onSearch={onPressEnter}
value={searchValue}
placeholder= { searchPlaceholder || "请输入姓名进行搜索" }
onInput={onInputSearchChange}
></Search>
{publicSearchs(searchPlaceholder || "请输入姓名进行搜索",onPressEnter,onInputSearchChange,allowClearonChange)}
{/*<Search */}
{/* onSearch={onPressEnter}*/}
{/* // value={searchValue}*/}
{/* placeholder= { searchPlaceholder || "请输入姓名进行搜索" }*/}
{/* onInput={onInputSearchChange}*/}
{/* onChange={allowClearonChange}*/}
{/* allowClear={true}*/}
{/*></Search>*/}
</div> }
{secondRowBotton}

@ -6,7 +6,8 @@ class NoneData extends Component{
super(props)
}
render(){
const { style } = this.props;
const { style,searchtypes } = this.props;
return(
<div className="edu-tab-con-box clearfix edu-txt-center" style={ style || { width:"100%" }}>
<style>
@ -23,7 +24,7 @@ class NoneData extends Component{
`}
</style>
<img className="edu-nodata-img mb20" src={getUrl("/images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p>
<p className="edu-nodata-p mb20">{searchtypes===true?"抱歉没有您要搜索的内容,请换个词语试试看":"暂时还没有相关数据哦!"}</p>
</div>
)
}

@ -1,11 +1,10 @@
import React,{ Component } from "react";
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin } from "antd";
import CourseLayoutcomponent from '../common/CourseLayoutComponent';
import {Checkbox, Pagination,Menu,Spin } from "antd";
import ExerciseListItem from './ExerciseListItem'
import axios from 'axios';
import Modals from '../../modals/Modals';
import '../css/members.css'
import { WordsBtn,on, off, trigger } from 'educoder'
import { WordsBtn,on, publicSearchs } from 'educoder'
import '../css/busyWork.css'
import _ from 'lodash';
import moment from 'moment'
@ -14,8 +13,6 @@ import ImmediatelyPublish from "../poll/pollPublicBtn/ImmediatelyPublish";
import ImmediatelyEnd from "../poll/pollPublicBtn/ImmediatelyEnd";
import NoneData from "../coursesPublic/NoneData";
import HomeworkModal from "../coursesPublic/HomeworkModal";
const Search = Input.Search;
class Exercise extends Component{
constructor(props){
@ -93,17 +90,20 @@ class Exercise extends Component{
exercises:result.data.exercises,
checkAllValue:false,
checkBoxValues:[],
isSpin:false
isSpin:false,
page:page
})
}).catch((error)=>{
console.log(error);
this.setState({
isSpin:false,
})
})
}
inputStudent=(e)=>{
this.setState({
StudentList_value:e.target.value
StudentList_value:e.target.value,
})
}
// 搜索
@ -505,12 +505,13 @@ class Exercise extends Component{
<span>未发布{exercises_counts && exercises_counts.exercises_unpublish_counts}</span>
</p>
<div className="fr mt16 mb16 searchView">
<Search
value={StudentList_value}
placeholder="请输入名称进行搜索"
onInput={this.inputStudent}
onSearch={this.searchInfo}
></Search>
{publicSearchs("请输入名称进行搜索",this.searchInfo,this.inputStudent,this.inputStudent)}
{/*<Search*/}
{/* value={StudentList_value}*/}
{/* placeholder="请输入名称进行搜索"*/}
{/* onInput={this.inputStudent}*/}
{/* onSearch={this.searchInfo}*/}
{/*></Search>*/}
</div>
</div>
<div className="task_menu_ul pl30 pr30">

@ -132,6 +132,7 @@ class Exercisesetting extends Component{
// 已有设置数据的查询
getSettingInfo=()=>{
this.props.Commonheadofthetestpapers()
let Id=this.props.match.params.Id;
let url=`/exercises/${Id}/exercise_setting.json`;
axios.get(url).then((result)=>{

@ -61,7 +61,7 @@ class Testpapersettinghomepage extends Component{
}
//试卷公用头部
Commonheadofthetestpaper=()=>{
console.log("Commonheadofthetestpaper 试卷公用头部");
// console.log("Commonheadofthetestpaper 试卷公用头部");
var exercise_id = this.props.match.params.Id;
var url = `/exercises/${exercise_id}/common_header.json`;
axios.get(url).then((response) => {
@ -475,7 +475,7 @@ class Testpapersettinghomepage extends Component{
}
{
parseInt(tab[0])==3 ? <WrappedExercisesetting Commonheadofthetestpaper={this.state.Commonheadofthetestpaper} {...this.props} {...this.state} triggerRef={this.bindRef}></WrappedExercisesetting>:""
parseInt(tab[0])==3 ? <WrappedExercisesetting Commonheadofthetestpaper={this.state.Commonheadofthetestpaper} {...this.props} {...this.state} triggerRef={this.bindRef} Commonheadofthetestpapers={this.Commonheadofthetestpaper}></WrappedExercisesetting>:""
}
</div>
</div>

@ -1,7 +1,6 @@
import React,{ Component } from "react";
import { Input, Checkbox, Menu,Pagination,Spin} from "antd";
import { Checkbox, Menu,Pagination,Spin} from "antd";
import {Link} from 'react-router-dom';
import CourseLayoutcomponent from '../../common/CourseLayoutComponent';
import Titlesearchsection from '../../common/titleSearch/TitleSearchSection';
import HomeworkModal from "../../coursesPublic/HomeworkModal";
import { WordsBtn } from 'educoder';
@ -10,7 +9,6 @@ import moment from 'moment';
import GraduateTaskItem from './GraduateTaskItem';
import TaskPublishModal from "./TaskPublishModal";
import Modals from '../../../modals/Modals';
import UseBank from "../../busyWork/UseBank";
import '../../css/members.css';
import '../style.css';
import NoneData from "../../coursesPublic/NoneData";
@ -65,7 +63,9 @@ class GraduationTasks extends Component{
})
}
}).catch(function (error) {
console.log(error);
this.setState({
isSpin:false
})
});
}
@ -286,7 +286,7 @@ class GraduationTasks extends Component{
onInputSearchChange = (e) => {
this.setState({
searchValue:e.target.value
searchValue:e.target.value,
})
if (this.timeoutHandler) {
@ -405,7 +405,8 @@ class GraduationTasks extends Component{
let {page,order}=this.state;
this.setState({
search:value
search:value,
isSpin:true
})
this.fetchAll(value,page,order);
@ -662,6 +663,7 @@ class GraduationTasks extends Component{
title="毕设任务"
searchValue={searchValue}
onInputSearchChange={this.onInputSearchChange}
allowClearonChange={this.onInputSearchChange}
firstRowRight={
<React.Fragment>
{/*{this.props.isAdmin() ?<WordsBtn style="blue" className="mr30" onClick={() => this.addDir()}>题库选用</WordsBtn>:""}*/}

@ -1,15 +1,13 @@
import React,{ Component } from "react";
import {Checkbox, Menu, Pagination,Spin} from "antd";
import CourseLayoutcomponent from '../../common/CourseLayoutComponent'
import Titlesearchsection from '../../common/titleSearch/TitleSearchSection'
import DownloadMessageysl from "../../../modals/DownloadMessageysl";
import { WordsBtn } from 'educoder'
import { WordsBtn ,getRandomcode} from 'educoder'
import NoneData from '../../coursesPublic/NoneData'
import Modals from "../../../modals/Modals"
import axios from 'axios'
import UseBank from '../../busyWork/UseBank'
import _ from 'lodash'
@ -85,12 +83,15 @@ class Boards extends Component{
topicList:response.data.graduation_topic,
totalCount:response.data.graduation_topic_count,
course_public:response.data.course_public,
isSpin:false
isSpin:false,
page:page
})
}
})
.catch(function (error) {
console.log(error);
this.setState({
isSpin:false
})
});
}
componentDidMount = () => {
@ -117,10 +118,11 @@ class Boards extends Component{
onInputSearchChange = (e) => {
this.setState({
searchValue:e.target.value
searchValue:e.target.value,
})
}
// 全选or反选
onCheckAll = (e) => {
this.setState({
@ -353,7 +355,7 @@ onBoardsNew=()=>{
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
window.open(getRandomcode("/api"+url), '_blank');
}
}).catch((error) => {
console.log(error)
@ -408,6 +410,7 @@ onBoardsNew=()=>{
title="毕设选题"
searchValue={ searchValue }
onInputSearchChange={this.onInputSearchChange}
allowClearonChange={this.onInputSearchChange}
firstRowRight=
{ isAdmin ?
(<React.Fragment>

@ -136,6 +136,7 @@ function CourseGroupList(props) {
title={"分班列表"}
searchValue={ searchValue }
onInputSearchChange={onInputSearchChange}
allowClearonChange={onInputSearchChange}
showSearchInput={total_count >= 10}
searchPlaceholder={ '请输入分班名称进行搜索' }
firstRowRight={

@ -1,6 +1,6 @@
import React,{ Component } from "react";
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip ,Spin} from "antd";
import {WordsBtn, on, off, trigger } from 'educoder';
import {Checkbox, Pagination,Menu ,Spin} from "antd";
import {WordsBtn, on, off, publicSearchs } from 'educoder';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import AddcoursesNav from "../coursesPublic/AddcoursesNav";
import ImmediatelyPublish from './pollPublicBtn/ImmediatelyPublish';
@ -15,8 +15,6 @@ import Modals from '../../modals/Modals';
import axios from 'axios';
import moment from 'moment';
const Search = Input.Search;
class Poll extends Component{
constructor(props){
@ -66,7 +64,7 @@ class Poll extends Component{
inputStudent=(e)=>{
this.setState({
StudentList_value:e.target.value
StudentList_value:e.target.value,
})
}
@ -125,7 +123,8 @@ class Poll extends Component{
course_types:result.data.course_types,
polls_counts:result.data.polls_counts,
isSpin:false,
checkBoxValues: bank_checkValue ? bank_checkValue : []
checkBoxValues: bank_checkValue ? bank_checkValue : [],
page:page
})
}
}).catch((error)=>{
@ -524,12 +523,13 @@ class Poll extends Component{
<span>未发布{polls_counts && polls_counts.polls_unpublish_counts}</span>
</p>
<div className="fr mt16 mb16 searchView">
<Search
value={StudentList_value}
placeholder="请输入名称进行搜索"
onInput={this.inputStudent}
onSearch={this.searchInfo}
></Search>
{publicSearchs("请输入名称进行搜索",this.searchInfo,this.inputStudent,this.inputStudent)}
{/*<Search*/}
{/* value={StudentList_value}*/}
{/* placeholder="请输入名称进行搜索"*/}
{/* onInput={this.inputStudent}*/}
{/* onSearch={this.searchInfo}*/}
{/*></Search>*/}
</div>
</div>
<div className="task_menu_ul pl30 pr30">

@ -68,6 +68,23 @@ class PollDetailIndex extends Component{
}
}
newgetPollInfo=()=>{
// console.log(this.props);
let pollId=this.props.match.params.pollId;
let url=`/polls/${pollId}/common_header.json`
axios.get(url).then((result)=>{
if(result.status==200){
this.setState({
pollDetail:result.data,
user_permission:result.data.user_permission,
polls_status:result.data.polls_status,
})
}
}).catch((error)=>{
console.log(error);
})
}
componentDidMount(){
const query =this.props.location.search;
@ -259,7 +276,7 @@ class PollDetailIndex extends Component{
}
{
//设置
parseInt(tab[0])==3 && <PollTabForth {...this.props} {...this.state} triggerRef={this.bindRef} user_permission={user_permission} getPollInfo={this.getPollInfo}></PollTabForth>
parseInt(tab[0])==3 && <PollTabForth {...this.props} {...this.state} triggerRef={this.bindRef} user_permission={user_permission} getPollInfo={this.getPollInfo} newgetPollInfo={this.newgetPollInfo}></PollTabForth>
}
</div>

@ -112,7 +112,7 @@ class PollDetailTabForth extends Component{
// 已有设置数据的查询
getSettingInfo=()=>{
this.props.getPollInfo();
this.props.newgetPollInfo();
let pollId=this.props.match.params.pollId;
let url=`/polls/${pollId}/poll_setting.json`;
axios.get(url).then((result)=>{
@ -197,6 +197,7 @@ class PollDetailTabForth extends Component{
this.props.form.validateFieldsAndScroll((err, values) => {
if(!err){
// 第一次进行问卷设置或者勾选了统一设置
let{unitSetting}=this.state
if(unitSetting==true){

@ -1,6 +1,6 @@
import React, {Component} from "react";
import CoursesListType from '../coursesPublic/CoursesListType';
import {WordsBtn, ActionBtn, sortDirections} from 'educoder';
import {WordsBtn, publicSearchs, sortDirections} from 'educoder';
import {
Form,
Select,
@ -65,6 +65,7 @@ class Listofworksstudentone extends Component {
//关卡得分final_score
this.state = {
searchtypes:false,
jobsettingsdata: undefined,
endTime: "2018/11/10 17:10:00",
type: "day",
@ -2588,6 +2589,7 @@ class Listofworksstudentone extends Component {
challenges_count: result.data.challenges_count,
homework_status: result.data.homework_status,
answer_open_evaluation:result.data.answer_open_evaluation,
page:page
});
allow_lates=result.data.allow_late;
answer_open_evaluation=result.data.answer_open_evaluation;
@ -2959,10 +2961,9 @@ class Listofworksstudentone extends Component {
}
//搜索学生 文字输入
inputSearchValuest = (e) => {
// console.log(e.target.value)
if (e.target.value === "") {
if (e.target.value === ""||e.target.value===undefined) {
this.setState({
searchtext: undefined
searchtext: undefined,
})
} else {
this.setState({
@ -2983,8 +2984,9 @@ class Listofworksstudentone extends Component {
loadingstate: true,
page: 1,
limit: 20,
searchtypes:true
})
this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, value, 1, 20, this.state.myorders);
this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, value, 1, 20, this.state.myorders);
// console.log(value)
@ -3576,12 +3578,18 @@ class Listofworksstudentone extends Component {
</div>:
homework_status && homework_status.length === 0 ?
<div className="edu-back-white">
<NoneData></NoneData>
<NoneData
{...this.state}
{...this.props}
/>
</div>
:
homework_status && homework_status.length > 0 && homework_status[0] === "未发布" ?
<div className="edu-back-white">
<NoneData></NoneData>
<NoneData
{...this.state}
{...this.props}
/>
</div>
:
<div className={"educontent "}>
@ -3664,15 +3672,16 @@ class Listofworksstudentone extends Component {
{/*}*/}
{/*</span>}*/}
<span className="search-newyslw fr ml20">
<Search
placeholder="请输入姓名或学号搜索"
id="subject_search_input"
autoComplete="off"
value={searchtext}
onKeyUp={(e) => this.onSearchKeywordKeyUpt(e)}
onInput={this.inputSearchValuest}
onSearch={this.searchValuest}
></Search>
{/*<Search*/}
{/* placeholder="请输入姓名或学号搜索"*/}
{/* id="subject_search_input"*/}
{/* autoComplete="off"*/}
{/* value={searchtext}*/}
{/* // onKeyUp={(e) => this.onSearchKeywordKeyUpt(e)}*/}
{/* onInput={this.inputSearchValuest}*/}
{/* onSearch={this.searchValuest}*/}
{/*></Search>*/}
{publicSearchs("请输入姓名或学号搜索",this.searchValuest,this.inputSearchValuest,this.inputSearchValuest)}
</span>
</div>
<span className="fl mr10 color-grey-8 ">作品状态</span>
@ -3760,7 +3769,7 @@ class Listofworksstudentone extends Component {
<div className="mh650 edu-back-white">
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb30">暂时还没有相关数据哦</p>
<p className="edu-nodata-p mb30">{this.state.searchtypes===false?"暂时还没有相关数据哦!":"抱歉没有您要搜索的内容,请换个词语试试看"}</p>
</div>
</div>
@ -3769,9 +3778,9 @@ class Listofworksstudentone extends Component {
<div className={"justify break_full_word new_li "} style={{minHeight: "480px"}}>
<style>{`
.ant-spin-nested-loading > div > .ant-spin .ant-spin-dot {
top: 72%;}
}
// .ant-spin-nested-loading > div > .ant-spin .ant-spin-dot {
// top: 72%;
// }
.edu-table thead th,.edu-table tbody tr:last-child td{
border-bottom: none!important;
height: 58px;
@ -3787,13 +3796,16 @@ class Listofworksstudentone extends Component {
}
`}</style>
<div className="edu-table edu-back-white ant-tables ysltableo table1">
{datajs === undefined ? "" : <Table
dataSource={datajs}
columns={columns}
pagination={false}
onChange={this.table1handleChange}
loading={loadingstate}
/>}
<Spin tip="正在加载..." spinning={loadingstate}>
{datajs === undefined ? "" : <Table
dataSource={datajs}
columns={columns}
pagination={false}
onChange={this.table1handleChange}
loading={false}
/>}
</Spin>
</div>
</div>
}
@ -3898,12 +3910,18 @@ class Listofworksstudentone extends Component {
{
homework_status && homework_status.length && homework_status.length === 0 ?
<div className=" clearfix edu-back-white" style={{margin: "auto", minWidth: "1200px"}}>
<NoneData></NoneData>
<NoneData
{...this.state}
{...this.props}
/>
</div>
:
homework_status && homework_status.length > 0 && homework_status && homework_status[0] === "未发布" ?
<div className=" clearfix edu-back-white " style={{margin: "auto", minWidth: "1200px"}}>
<NoneData></NoneData>
<NoneData
{...this.state}
{...this.props}
/>
</div>
:
@ -4029,7 +4047,7 @@ class Listofworksstudentone extends Component {
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20"
src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb30">暂时还没有相关数据哦</p>
<p className="edu-nodata-p mb30">{this.state.searchtypes===false?"暂时还没有相关数据哦!":"抱歉没有您要搜索的内容,请换个词语试试看"}</p>
</div>
</div>
@ -4069,12 +4087,18 @@ class Listofworksstudentone extends Component {
{
homework_status && homework_status.length === 0 ?
<div className=" clearfix edu-back-white" style={{margin: "auto", minWidth: "1200px"}}>
<NoneData></NoneData>
<NoneData
{...this.state}
{...this.props}
/>
</div>
:
homework_status && homework_status.length > 0 && homework_status && homework_status[0] === "未发布" ?
<div className=" clearfix edu-back-white" style={{margin: "auto", minWidth: "1200px"}}>
<NoneData></NoneData>
<NoneData
{...this.state}
{...this.props}
/>
</div>
:
<div className={"educontent mb20"}>
@ -4226,9 +4250,9 @@ class Listofworksstudentone extends Component {
<div className={"justify break_full_word new_li"}
style={{minHeight: "480px"}}>
<style>{`
.ant-spin-nested-loading > div > .ant-spin .ant-spin-dot {
top: 72%;}
}
// .ant-spin-nested-loading > div > .ant-spin .ant-spin-dot {
// top: 72%;
// }
.edu-table .ant-table-tbody > tr > td {
height: 58px;
}
@ -4246,12 +4270,16 @@ class Listofworksstudentone extends Component {
}
`}</style>
<div className="edu-table edu-back-white ysltableowss table4">
{datas === undefined ? "" : <Table
dataSource={datas}
columns={columnsstu}
pagination={false}
loading={loadingstate}
/>}
{datas === undefined ? "" :
<Spin tip="正在加载..." spinning={loadingstate}>
<Table
dataSource={datas}
columns={columnsstu}
pagination={false}
loading={false}
/>
</Spin>
}
</div>
</div>
{
@ -4270,7 +4298,7 @@ class Listofworksstudentone extends Component {
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20"
src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb30">暂时还没有相关数据哦</p>
<p className="edu-nodata-p mb30">{this.state.searchtypes===false?"暂时还没有相关数据哦!":"抱歉没有您要搜索的内容,请换个词语试试看"}</p>
</div>
</div>
</div>

@ -1,6 +1,6 @@
import React, {Component} from "react";
import CoursesListType from '../coursesPublic/CoursesListType';
import {WordsBtn, ActionBtn, sortDirections} from 'educoder';
import {WordsBtn, getRandomcode, sortDirections} from 'educoder';
import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal";
@ -622,7 +622,7 @@ class ShixunStudentWork extends Component {
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
window.open(getRandomcode("/api"+url), '_blank');
}
}).catch((error) => {
console.log(error)

@ -1,5 +1,5 @@
import React, {Component} from "react";
import {WordsBtn,markdownToHTML,ActionBtn,queryString,downloadFile,getImageUrl} from 'educoder';
import {WordsBtn,markdownToHTML,getRandomcode,queryString,downloadFile,getImageUrl} from 'educoder';
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider,InputNumber, Tag,DatePicker,Radio,Tooltip,Spin} from "antd";
import {Link,Switch,Route,Redirect} from 'react-router-dom';
import axios from 'axios';
@ -76,7 +76,7 @@ class ShixunWorkReport extends Component {
// this.props.slowDownload(url)
//
// this.props.showNotification(`正在下载中`);
window.open("/api"+url+"?disposition=inline", '_blank');
window.open(getRandomcode("/api"+url+"?disposition=inline"), '_blank');
this.setState({ isspinning: false })
}
}).catch((error) => {

@ -1,7 +1,7 @@
import React, {Component} from "react";
import CoursesListType from '../coursesPublic/CoursesListType';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import {WordsBtn, ActionBtn, handleDateString, getImageUrl} from 'educoder';
import {WordsBtn, getRandomcode, handleDateString, getImageUrl} from 'educoder';
import PollDetailTabForthRules from '../poll/PollDetailTabForthRules';
import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal';
import {
@ -2263,7 +2263,7 @@ class Trainingjobsetting extends Component {
}
} else {
this.props.showNotification(`正在下载中`);
window.open("/api" + url, '_blank');
window.open(getRandomcode("/api" + url), '_blank');
}
}).catch((error) => {
console.log(error)

@ -1,6 +1,6 @@
import React, {Component} from "react";
import CoursesListType from '../coursesPublic/CoursesListType';
import {WordsBtn, ActionBtn, markdownToHTML} from 'educoder';
import {WordsBtn, getRandomcode, markdownToHTML} from 'educoder';
import {
Form,
Select,
@ -413,7 +413,7 @@ class Workquestionandanswer extends Component {
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
window.open(getRandomcode("/api"+url), '_blank');
}
}).catch((error) => {
console.log(error)

@ -1,12 +1,10 @@
import React,{ Component } from "react";
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin } from "antd";
import { WordsBtn,on, off, trigger } from 'educoder';
import {BrowserRouter as Router,Route,Switch,Link} from 'react-router-dom';
import { Input,Checkbox, Pagination,Menu,Spin } from "antd";
import { WordsBtn,on, trigger ,publicSearchs} from 'educoder';
import {Link} from 'react-router-dom';
import axios from'axios';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal";
import ShixunModal from "../coursesPublic/ShixunModal";
import PathModal from "../coursesPublic/PathModal";
import NewShixunModel from '../coursesPublic/NewShixunModel';
import AddcoursesNav from "../coursesPublic/AddcoursesNav";
import Modals from '../../modals/Modals';
@ -16,8 +14,6 @@ import '../css/busyWork.css'
import ShixunhomeWorkItem from "./ShixunhomeWorkItem";
import NoneData from "../coursesPublic/NoneData";
const Search = Input.Search;
class ShixunHomework extends Component{
constructor(props){
super(props);
@ -198,16 +194,20 @@ class ShixunHomework extends Component{
if(result.status===200){
this.setState({
datas:result.data,
isSpin:false
isSpin:false,
page:page
})
}
}else{
this.setState({
isSpin:false
isSpin:false,
})
}
}).catch((error)=>{
console.log(error);
this.setState({
isSpin:false
})
})
}
@ -644,19 +644,21 @@ class ShixunHomework extends Component{
}
SearchCoursenames=(e)=>{
this.setState({
Coursename:e.target.value
Coursename:e.target.value,
})
}
SearchCoursename=(value)=>{
let {page,order}=this.state;
this.setState({
Coursename:value
Coursename:value,
isSpin:true,
})
this.homeworkupdatalist(value,page,order);
this.homeworkupdatalist(value,1,order);
}
@ -1030,7 +1032,6 @@ class ShixunHomework extends Component{
}=this.state;
let main_id=this.props.match.params.main_id;
let category_id=this.props.match.params.category_id;
return(
<React.Fragment >
@ -1212,12 +1213,15 @@ class ShixunHomework extends Component{
</Menu>
</div>
<div className="fr mt16 mb16 searchView">
<Search
value={Coursename}
placeholder="请输入名称进行搜索"
onInput={this.SearchCoursenames}
onSearch={value => this.SearchCoursename(value)}
></Search>
{publicSearchs("请输入名称进行搜索",value => this.SearchCoursename(value),this.SearchCoursenames,(e)=>this.SearchCoursenames(e))}
{/*<Search*/}
{/* // value={Coursename}*/}
{/* placeholder="请输入名称进行搜索"*/}
{/* onInput={this.SearchCoursenames}*/}
{/* onSearch={value => this.SearchCoursename(value)}*/}
{/* onChange={(e)=>this.allowClearonChange(e)}*/}
{/* allowClear={true}*/}
{/*></Search>*/}
</div>
</div>
</div>
@ -1380,14 +1384,3 @@ class ShixunHomework extends Component{
}
}
export default ShixunHomework;
// {/*<div className="alltask "*/}
// {/*style={*/}
// {/*{*/}
// {/*display: datas===undefined?'none' :datas.task_count===0? 'block' : 'none'*/}
// {/*}*/}
// {/*}*/}
// {/*>*/}
// {/*<div className="edu-tab-con-box clearfix edu-txt-center">*/}
// {/*<img className="edu-nodata-img mb20" src="/images/educoder/nodata.png" />*/}
// {/*<p className="edu-nodata-p mb20">暂时还没有相关数据哦!</p></div>*/}
// {/*</div>*/}

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import {getRandomcode} from 'educoder';
import axios from 'axios';
import { Select,message,Modal,Input,Spin,Icon,Tooltip } from 'antd';
@ -550,7 +550,7 @@ class CourseSupports extends Component {
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
window.open(getRandomcode("/api"+url), '_blank');
}
}).catch((error) => {
console.log(error)

@ -1,5 +1,5 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import {getRandomcode} from 'educoder';
import { Modal} from 'antd';
import axios from 'axios';
@ -57,7 +57,7 @@ class DownloadMessage extends Component {
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
window.open(getRandomcode("/api"+url), '_blank');
}
}).catch((error) => {
console.log(error)

@ -41,6 +41,7 @@ class MainContent extends Component {
hideCodeEvaluate = () => {
const vncContainer = this.refs['vncContainer']
if (vncContainer) {
// console.log('点击的关闭按钮')
vncContainer.onBottomDrawerClose && vncContainer.onBottomDrawerClose()
}
}
@ -124,7 +125,7 @@ class MainContent extends Component {
</div>
}
></VNCContainer>
<div id="actionView" className="-layout-h -center -bg-grey-90 -grey-20 -bg-darkblack" style={{height:'48px'}}>
<div id="actionView" className="-layout-h -center -bg-grey-90 -grey-20 -bg-darkblack">
<ActionView {...this.props}
onRunCodeTest={onRunCodeTest}
></ActionView>
@ -179,7 +180,9 @@ class MainContent extends Component {
</div>
</div>
<div id="actionView" className="-layout-h -center -bg-grey-90 -grey-20 -bg-darkblack" style={{height:'48px'}}>
<div id="actionView"
style={{ position: 'absolute', width: '100%', bottom: '0', height: '51px'}}
className="-layout-h -center -bg-grey-90 -grey-20 -bg-darkblack">
<ActionView {...this.props} onRunCodeTest={onRunCodeTest}></ActionView>
</div>

@ -39,6 +39,47 @@
user-select: none;
}
.btn_test_case,
.btn_test_case_active{
display: inline-block;
position: absolute;
width: 56px;
height: 28px;
bottom: 23px;
line-height: 28px;
background: rgba(42,58,79,1);
z-index: 10;
left: 50%;
margin-left: -28px;
border-bottom-left-radius: 100px;
border-bottom-right-radius: 100px;
color: #fff;
text-align: center;
cursor: pointer;
opacity: .4;
transition: all .3s;
}
.btn_test_case:hover,
.btn_test_case_active:hover{
opacity: 1;
}
.btn_test_case .btn-arrow{
position: relative;
font-size: 12px;
line-height: 28px;
bottom: 2px;
}
.btn_test_case_active{
bottom: 203px;
z-index: 10000;
}
.btn_test_case_active .btn-arrow{
bottom: 4px;
}
@keyframes mymove
{
from {right:0px;}

@ -204,6 +204,10 @@ class VNCContainer extends Component {
render() {
const { challenge, vnc_url, git_url } = this.props
const _classCtx = this.state.bottomDrawer ? 'btn_test_case_active' : 'btn_test_case';
const _classes = this.state.bottomDrawer
? `iconfont icon-xiajiantou btn-arrow`
: 'iconfont icon-shangjiantou btn-arrow';
const secondDrawerChildren = this.renderSecondDrawerChildren();
return (
<React.Fragment>
@ -352,9 +356,16 @@ class VNCContainer extends Component {
>
{ this.props.codeEvaluate }
</Drawer>
<FloatButton onClick={this.swtichBottomDrawer}
{/* <FloatButton onClick={this.swtichBottomDrawer}
className="codeEvaluateFloatButton"
>测试集</FloatButton>
>测试集</FloatButton> */}
<div
className={_classCtx}
onClick={this.swtichBottomDrawer}
>
{/* <span className="iconfont icon-shangjiantou btn-arrow"></span> */}
<span className={_classes}></span>
</div>
</VNCDisplay>

@ -135,11 +135,13 @@ class VNCDisplay extends Component {
<div className="vncDisply" style={{height: '100%'}}>
<style>{`
.vncDisply #top_bar {
position: absolute;
background-color: #6e84a3;
color: white;
font: bold 12px Helvetica;
padding: 6px 5px 4px 5px;
border-bottom: 1px outset;
width: 100%;
}
.vncDisply #status {
text-align: center;
@ -166,7 +168,7 @@ class VNCDisplay extends Component {
<div id="status">Loading</div>
<div id="sendCtrlAltDelButton">Send CtrlAltDel</div>
</div>
<div id="screen">
<div id="screen" style={{ height: 'calc(100vh - 105px)' }}>
</div>
{this.props.children}

Loading…
Cancel
Save