This commit is contained in:
commit
2510e9d8c8
|
@ -1,89 +1,25 @@
|
||||||
#body_left{
|
|
||||||
flex: 20%;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#body_right{
|
|
||||||
border-left: 1px solid black;
|
|
||||||
height: 100%;
|
|
||||||
flex:80%
|
|
||||||
}
|
|
||||||
.check_box{
|
.check_box{
|
||||||
margin-left: 800px;
|
margin-left: 800px;
|
||||||
}
|
}
|
||||||
.single{
|
.SendTest_body_right tr{
|
||||||
margin-left: 100px;
|
background-color: antiquewhite;
|
||||||
}
|
}
|
||||||
.choice_answer{
|
.SendTest_body_right p{
|
||||||
display: flex;
|
font-size: 32px;
|
||||||
width: 800px;
|
border: 1px solid black;
|
||||||
background-color: aqua;
|
|
||||||
}
|
|
||||||
.choice_answer span{
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line{
|
|
||||||
border-bottom: 1px solid black;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#body_top{
|
|
||||||
border-bottom: 1px solid black;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
#body_left input {
|
|
||||||
margin-top: 30px;
|
|
||||||
margin-left: 30px;
|
|
||||||
}
|
|
||||||
#next{
|
|
||||||
margin-left:1450px;
|
|
||||||
margin-top: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* 选择班级界面 */
|
|
||||||
#background{
|
|
||||||
width: 400px;
|
|
||||||
height: 550px;
|
|
||||||
background-color: rgb(149, 224, 224);
|
|
||||||
position: absolute;
|
|
||||||
margin-left: 650px;
|
|
||||||
margin-top: 150px;
|
|
||||||
}
|
|
||||||
#class_ul{
|
|
||||||
width: 200px;
|
|
||||||
height: 300px;
|
|
||||||
margin-left: 80px;
|
|
||||||
background-color: rgb(198, 155, 238);
|
|
||||||
overflow: auto;
|
|
||||||
list-style-type: none;
|
|
||||||
}
|
|
||||||
.class_div {
|
|
||||||
/* 普通状态下的样式 */
|
|
||||||
width: 130px;
|
|
||||||
height: 30px;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
cursor: pointer;
|
|
||||||
background-color: bisque;
|
|
||||||
margin-top: 10px;
|
|
||||||
margin-left: 15px;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
margin-top: 0px;
|
||||||
|
margin-bottom: 0px;
|
||||||
}
|
}
|
||||||
|
.SendTest_body_right table{
|
||||||
.selected {
|
width: 100%;
|
||||||
/* 选中状态下的样式 */
|
border-left: 1px solid black;
|
||||||
background-color: lightblue;
|
border-right: 1px solid black;
|
||||||
border-color: blue;
|
|
||||||
}
|
}
|
||||||
#send_box{
|
.Testbox{
|
||||||
width: 400px;
|
background-color: antiquewhite;
|
||||||
height: 550px;
|
|
||||||
background-color: rgb(149, 224, 224);
|
|
||||||
position: absolute;
|
|
||||||
margin-left: 650px;
|
|
||||||
margin-top: 150px;
|
|
||||||
}
|
}
|
||||||
|
.judgetitletd{
|
||||||
|
font-size: 20px;
|
||||||
|
background-color: antiquewhite;
|
||||||
|
}
|
|
@ -5,74 +5,44 @@ import React, { useEffect, useState } from 'react';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
function SendTest(){
|
function SendTest(){
|
||||||
// const { key } = useParams();
|
|
||||||
const teacher_ID=localStorage.getItem('islogin')
|
const teacher_ID=localStorage.getItem('islogin')
|
||||||
//获取题目
|
//获取所有基础题的所有题目
|
||||||
const [ChoiceQuestion,SetChoiceQuestion]=useState()
|
const [question,Setquestion]=useState()
|
||||||
const [Completion,SetCompletion]=useState()
|
//得到题目
|
||||||
const [Judge,SetJudge]=useState()
|
const [Choice,setChoice]=useState([])
|
||||||
|
const [Completion,setCompletion]=useState([])
|
||||||
|
const [Judge,setJudge]=useState([])
|
||||||
|
//得到班级
|
||||||
|
const [ClassData,SetClassData]=useState([])
|
||||||
|
|
||||||
const subject = async ()=>{
|
const question_func=async()=>{
|
||||||
try{
|
try{
|
||||||
const subject_src=await axios.post('/api/teacher/return_question',{
|
const Train_question_src=await axios.post('/api/teacher/return_question',{
|
||||||
teacher_ID})
|
teacher_ID
|
||||||
SetChoiceQuestion(subject_src.data['选择'])
|
})
|
||||||
SetCompletion(subject_src.data['填空'])
|
Setquestion(Train_question_src.data)
|
||||||
SetJudge(subject_src.data['判断'])
|
}catch{
|
||||||
}catch(error){
|
alert('question_func出错')
|
||||||
console.log(error);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
useEffect(()=>{
|
|
||||||
subject()
|
|
||||||
},[])
|
|
||||||
//当选择题目时,自动将题目ID填入题目集当中
|
|
||||||
const [ChoiceQuestionSet,SetChoiceQuestionSet]=useState([])
|
|
||||||
const [CompletionQuestionSet,SetCompletionQuestionSet]=useState([])
|
|
||||||
const [JudgeQuestionSet,SetJudgeQuestionSet]=useState([])
|
|
||||||
|
|
||||||
|
const SeleactClass= async()=>{
|
||||||
|
|
||||||
//下一步的操作
|
|
||||||
const body=document.getElementById('body')
|
|
||||||
const background=document.getElementById('background')
|
|
||||||
const send_box=document.getElementById('send_box')
|
|
||||||
const [ClassData,SetClassData]=useState([])
|
|
||||||
|
|
||||||
const click_1= async()=>{
|
|
||||||
try {
|
try {
|
||||||
const select_class_src = await axios.post('/api/teacher/select_class', {
|
const select_class_src = await axios.post('/api/teacher/select_class', {
|
||||||
teacher_ID
|
teacher_ID
|
||||||
});
|
});
|
||||||
background.style.display='block'
|
SetClassData(select_class_src.data['Class']);
|
||||||
body.style.display='none'
|
|
||||||
send_box.display='none'
|
|
||||||
SetClassData(select_class_src.data);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//下下一步操作
|
|
||||||
const click_2=()=>{
|
|
||||||
background.style.display='none'
|
|
||||||
body.style.display='none'
|
|
||||||
send_box.style.display='block'
|
|
||||||
}
|
|
||||||
|
|
||||||
//上一步的操作
|
useEffect(()=>{
|
||||||
const last_1=()=>{
|
question_func()
|
||||||
background.style.display='none'
|
SeleactClass()
|
||||||
body.style.display='block'
|
},[])
|
||||||
send_box.display='none'
|
|
||||||
}
|
|
||||||
//上上一步操作
|
|
||||||
const last_2=()=>{
|
|
||||||
background.style.display='block'
|
|
||||||
body.style.display='none'
|
|
||||||
send_box.style.display='none'
|
|
||||||
}
|
|
||||||
|
|
||||||
//选中班级的状态变化
|
//选中班级的状态变化
|
||||||
const [selectedItems, setSelectedItems] = useState([]);
|
const [selectedItems, setSelectedItems] = useState([]);
|
||||||
|
|
||||||
|
@ -85,12 +55,39 @@ function SendTest(){
|
||||||
};
|
};
|
||||||
const getClassNames = (key) => {
|
const getClassNames = (key) => {
|
||||||
if (selectedItems.includes(key)) {
|
if (selectedItems.includes(key)) {
|
||||||
return 'class_div selected';
|
return 'Train_class_div Trainselected';
|
||||||
} else {
|
} else {
|
||||||
return 'class_div';
|
return 'Train_class_div';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//发送题目
|
||||||
|
const SendTrainTest=async ()=>{
|
||||||
|
try{
|
||||||
|
const SendTrainSrc=await axios.post('/api/teacher/accept_test',{
|
||||||
|
Choice,
|
||||||
|
Completion,
|
||||||
|
Judge,
|
||||||
|
HourValue,
|
||||||
|
MinValue,
|
||||||
|
StopTime,
|
||||||
|
selectedItems,
|
||||||
|
teacher_ID
|
||||||
|
})
|
||||||
|
alert('发布成功')
|
||||||
|
}catch{
|
||||||
|
alert('SendTrainTest出错')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const SendTrainBtn=()=>{
|
||||||
|
if(selectedItems.length>0 && (HourValue || MinValue)&&StopTime){
|
||||||
|
SendTrainTest()
|
||||||
|
}else{
|
||||||
|
alert('发布信息未完全')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//创建数组,00~59
|
//创建数组,00~59
|
||||||
const min_list=[]
|
const min_list=[]
|
||||||
for (let i=0;i<=59;i++){
|
for (let i=0;i<=59;i++){
|
||||||
|
@ -116,34 +113,114 @@ function SendTest(){
|
||||||
const getstoptime=(event)=>{
|
const getstoptime=(event)=>{
|
||||||
SetStopTime(event.target.value)
|
SetStopTime(event.target.value)
|
||||||
}
|
}
|
||||||
// 发布按钮
|
|
||||||
const release= async()=>{
|
|
||||||
try{
|
|
||||||
const release_src=await axios.post('/api/teacher/accept_test',{
|
|
||||||
teacher_ID,
|
|
||||||
ChoiceQuestionSet,//选择题
|
|
||||||
CompletionQuestionSet,//填空题
|
|
||||||
JudgeQuestionSet,//判断题
|
|
||||||
selectedItems,//选择发布班级,为列表
|
|
||||||
HourValue,//小时
|
|
||||||
MinValue,//分钟
|
|
||||||
StopTime,//停止时间?天
|
|
||||||
}
|
|
||||||
)
|
|
||||||
alert('发布成功')
|
|
||||||
window.location.href='http://36.138.114.105:30294/teacher/managetest'
|
|
||||||
}catch{
|
|
||||||
alert('发布失败')
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<div id='big_body'>
|
<div className='SendTrain_body'>
|
||||||
<div id='background' style={{display:'none'}}>
|
<div className='SendTrain_body_left'>
|
||||||
<p style={{marginLeft:'30px'}}>请选择发布班级</p>
|
<ul className='SendTrain_body_left_ul'>
|
||||||
{ ClassData &&<ul style={{marginTop:'70px'}} id='class_ul'>
|
<li><div className='SendTrain_body_left_ul_div'>题目集</div></li>
|
||||||
{Object.keys(ClassData).map((key)=>(
|
<li>
|
||||||
|
<button>基础题</button>
|
||||||
|
<ul style={{all:'unset'}}>
|
||||||
|
<li>第一章</li>
|
||||||
|
<li>第二章</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div className='SendTest_body_right'>
|
||||||
|
<p>题目选择</p>
|
||||||
|
{<table>
|
||||||
|
<span className='title'>选择题</span>
|
||||||
|
{Object.keys(question['choice']).map((key)=>(
|
||||||
|
<tr key={key}>
|
||||||
|
<div>{question['choice'][key][8]}</div>
|
||||||
|
<tr>
|
||||||
|
<td className='questiontitle'>问.{question['choice'][key][1]}</td>
|
||||||
|
</tr>
|
||||||
|
<div className='Train_answer_box'>
|
||||||
|
<tr>A:{question['choice'][key][2]}</tr>
|
||||||
|
<tr>B:{question['choice'][key][3]}</tr>
|
||||||
|
<tr>C:{question['choice'][key][4]}</tr>
|
||||||
|
<tr>D:{question['choice'][key][5]}</tr>
|
||||||
|
</div>
|
||||||
|
<input type="checkbox" className='check_box' onClick={(event)=>{
|
||||||
|
if (event.target.checked) {
|
||||||
|
//在选择题目集中添加选择题的ID
|
||||||
|
setChoice(items=>([
|
||||||
|
...items,
|
||||||
|
question['choice'][key][7]
|
||||||
|
]))
|
||||||
|
}else{
|
||||||
|
setChoice((items)=>
|
||||||
|
items.filter((item)=>item!==question['choice'][key][7])
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}} /><span>是否选择</span>
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
<span className='title'>填空题</span>
|
||||||
|
{Object.keys(question['completion']).map((key)=>(
|
||||||
|
<tr key={key}>
|
||||||
|
<td className='Testbox'>
|
||||||
|
{question['completion'][key][4]}
|
||||||
|
<td className='questiontitle'>
|
||||||
|
问.{question['completion'][key][1]}
|
||||||
|
</td>
|
||||||
|
<input type="checkbox" className='check_box' onClick={(event)=>{
|
||||||
|
if (event.target.checked) {
|
||||||
|
//在选择题目集中添加选择题的ID
|
||||||
|
setCompletion(items=>([
|
||||||
|
...items,
|
||||||
|
question['completion'][key][3]
|
||||||
|
]))
|
||||||
|
}else{
|
||||||
|
setCompletion((items)=>
|
||||||
|
items.filter((item)=>item!==question['completion'][key][3])
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}} /><span>是否选择</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
<span className='title'>判断题</span>
|
||||||
|
{Object.keys(question['judge']).map((key)=>(
|
||||||
|
<tr key={key}>
|
||||||
|
<td className='Testbox'>
|
||||||
|
{question['judge'][key][4]}
|
||||||
|
<td className='judgetitletd'>问:{question['judge'][key][1]}</td>
|
||||||
|
<input type="checkbox" className='check_box' onClick={(event)=>{
|
||||||
|
if (event.target.checked) {
|
||||||
|
setJudge(items=>([
|
||||||
|
...items,
|
||||||
|
question['judge'][key][3]
|
||||||
|
]))
|
||||||
|
}else{
|
||||||
|
setJudge((items)=>
|
||||||
|
items.filter((item)=>item!==question['judge'][key][3])
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}} /><span>是否选择</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</table>}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<button onClick={SendTrainBtn} id='SendTrainBtn'>发布按钮</button>
|
||||||
|
</div>
|
||||||
|
{/* 右边的内容 */}
|
||||||
|
<div className='right_right'>
|
||||||
|
<div className='OptionBox'>
|
||||||
|
<div className='TrainSelectClass'>
|
||||||
|
<p className='TrainSelectClassP'>请选择发布班级</p>
|
||||||
|
{ ClassData &&<ul id='Train_class_ul'>
|
||||||
|
{Object.keys(ClassData).map((key)=>(
|
||||||
<li key={key}>
|
<li key={key}>
|
||||||
<div className={getClassNames(key)} onClick={() => click_div(key)}>
|
<div className={getClassNames(key)} onClick={() => click_div(key)}>
|
||||||
{key}
|
{key}
|
||||||
|
@ -151,17 +228,17 @@ function SendTest(){
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>}
|
</ul>}
|
||||||
<button style={{marginLeft:'110px'}} onClick={last_1}>上一步</button>
|
</div>
|
||||||
<button style={{marginLeft:'80px'}} onClick={click_2}>下一步</button>
|
<div className='TrainSelectTime'>
|
||||||
</div>
|
<button onClick={()=>{
|
||||||
<div id='send_box' style={{display:'none'}}>
|
console.log(Choice);
|
||||||
<p>请填写考试时间</p>
|
}}></button>
|
||||||
<select name="" id="" alue={HourValue} onChange={gethourvalue}>
|
<p>请填写考试时间</p>
|
||||||
|
<select name="" id="" alue={HourValue} onChange={gethourvalue}>
|
||||||
{Object.keys(hour_list).map((num)=>(
|
{Object.keys(hour_list).map((num)=>(
|
||||||
<option value={num} key={num}>{num}</option>
|
<option value={num} key={num}>{num}</option>
|
||||||
))}
|
))}
|
||||||
</select>小时
|
</select>小时
|
||||||
|
|
||||||
<select name="" id="" alue={MinValue} onChange={getminvalue}>
|
<select name="" id="" alue={MinValue} onChange={getminvalue}>
|
||||||
{min_list.map((num)=>(
|
{min_list.map((num)=>(
|
||||||
<option value={num} key={num}>{num}</option>
|
<option value={num} key={num}>{num}</option>
|
||||||
|
@ -169,111 +246,10 @@ function SendTest(){
|
||||||
</select>分钟
|
</select>分钟
|
||||||
<p>请填写截至时间</p>
|
<p>请填写截至时间</p>
|
||||||
<input type="text" maxLength={10} style={{width:'30px'}} value={StopTime} onChange={getstoptime} />天后
|
<input type="text" maxLength={10} style={{width:'30px'}} value={StopTime} onChange={getstoptime} />天后
|
||||||
<button onClick={last_2}>上一步</button>
|
</div>
|
||||||
<button onClick={release}>发布</button>
|
|
||||||
</div>
|
|
||||||
<div id='body' >
|
|
||||||
<div id='body_top' style={{display:'flex'}}>
|
|
||||||
<div id='body_left'>
|
|
||||||
<input type="checkbox" id='choice'/><span>选择题</span><br />
|
|
||||||
<input type="checkbox" id='fill'/><span>填空</span><br />
|
|
||||||
<input type="checkbox" id='judge'/><span>判断</span><br />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id='body_right'>
|
|
||||||
<div id='choice_box'>
|
|
||||||
<span style={{color:'red'}}>选择题</span>
|
|
||||||
{ChoiceQuestion && <table>
|
|
||||||
<thead>
|
|
||||||
{Object.keys(ChoiceQuestion).map((key)=>(
|
|
||||||
<tr className='line' key={key}>
|
|
||||||
<td className='line'>
|
|
||||||
<p>问题:{ChoiceQuestion[key][1]}</p>
|
|
||||||
<p className='choice_answer'>
|
|
||||||
<span>A:{ChoiceQuestion[key][2]}</span>
|
|
||||||
<span>B:{ChoiceQuestion[key][3]}</span>
|
|
||||||
<span>C:{ChoiceQuestion[key][4]}</span>
|
|
||||||
<span>D:{ChoiceQuestion[key][5]}</span>
|
|
||||||
</p>
|
|
||||||
{/* 获取题目ID */}
|
|
||||||
<input type="checkbox" className='check_box' onClick={(event)=>{
|
|
||||||
if (event.target.checked) {
|
|
||||||
//在选择题目集中添加选择题的ID
|
|
||||||
SetChoiceQuestionSet(items=>([
|
|
||||||
...items,
|
|
||||||
ChoiceQuestion[key][7]
|
|
||||||
]))
|
|
||||||
}else{
|
|
||||||
SetChoiceQuestionSet((items)=>
|
|
||||||
items.filter((item)=>item!==ChoiceQuestion[key][7])
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}} /><span>是否选择</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
))}
|
|
||||||
</thead>
|
|
||||||
</table>}
|
|
||||||
</div>
|
</div>
|
||||||
<div id='fill_box'>
|
</div>
|
||||||
<span style={{color:'red'}}>填空题:</span>
|
|
||||||
{ Completion &&<table>
|
|
||||||
<thead>
|
|
||||||
{Object.keys(Completion).map((key)=>(
|
|
||||||
<tr key={key}>
|
|
||||||
<td className='line'>
|
|
||||||
<p>问题:{Completion[key][1]}<input type='text' /></p>
|
|
||||||
<input type="checkbox" className='check_box' onClick={(event)=>{
|
|
||||||
if(event.target.checked){
|
|
||||||
SetCompletionQuestionSet(items=>([
|
|
||||||
...items,
|
|
||||||
Completion[key][3]
|
|
||||||
]))
|
|
||||||
}else{
|
|
||||||
SetCompletionQuestionSet((items)=>
|
|
||||||
items.filter((item)=>item!==Completion[key][3]))
|
|
||||||
}
|
|
||||||
}}/><span>是否选择</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
))}
|
|
||||||
</thead>
|
|
||||||
</table>}
|
|
||||||
</div>
|
|
||||||
<div id='judge_box'>
|
|
||||||
<span style={{color:'red'}}>判断题:</span>
|
|
||||||
{ Judge &&<table>
|
|
||||||
<thead>
|
|
||||||
{Object.keys(Judge).map((key)=>(
|
|
||||||
<tr key={key}>
|
|
||||||
<td className='line'>
|
|
||||||
<p>问题:{Judge[key][1]}</p>
|
|
||||||
<input type="checkbox" className='check_box' onClick={(event)=>{
|
|
||||||
if(event.target.checked){
|
|
||||||
SetJudgeQuestionSet(items=>([
|
|
||||||
...items,
|
|
||||||
Judge[key][3]
|
|
||||||
]))
|
|
||||||
}else{
|
|
||||||
SetJudgeQuestionSet((items)=>
|
|
||||||
items.filter((item)=>item!==Judge[key][3]))
|
|
||||||
}
|
|
||||||
}}/><span>是否选择</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
))}
|
|
||||||
|
|
||||||
</thead>
|
|
||||||
</table>}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id='body_btm'>
|
|
||||||
<button id='next' onClick={click_1}>下一步</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default SendTest
|
export default SendTest
|
|
@ -7,7 +7,7 @@ import { Link } from 'react-router-dom';
|
||||||
function TrainManage(){
|
function TrainManage(){
|
||||||
return(
|
return(
|
||||||
<div className='body-trainmanage'>
|
<div className='body-trainmanage'>
|
||||||
<p>已批改试卷</p>
|
<p>已批改的试卷</p>
|
||||||
<div className='line'></div>
|
<div className='line'></div>
|
||||||
<div className='train-list-trainmanage'>
|
<div className='train-list-trainmanage'>
|
||||||
<ul className='ul1-trainmanage'>
|
<ul className='ul1-trainmanage'>
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
.pods table{
|
||||||
|
width: 500px;
|
||||||
|
text-align: center;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
.pods p{
|
||||||
|
line-height: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
}
|
|
@ -1,6 +1,36 @@
|
||||||
|
import './list_pods.css'
|
||||||
function List_pods(){
|
function List_pods(){
|
||||||
|
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<div></div>
|
<div className="pods">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>Name</td>
|
||||||
|
<td>TestID</td>
|
||||||
|
<td>Train</td>
|
||||||
|
<td>Start</td>
|
||||||
|
<td>End</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colSpan="5"><hr /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>zhoutao</td>
|
||||||
|
<td>33</td>
|
||||||
|
<td>0</td>
|
||||||
|
<td>2024-7-1</td>
|
||||||
|
<td>2024-7-2</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>zhoutao</td>
|
||||||
|
<td>33</td>
|
||||||
|
<td>0</td>
|
||||||
|
<td>2024-7-1</td>
|
||||||
|
<td>2024-7-2</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
export default List_pods
|
export default List_pods
|
|
@ -26,6 +26,7 @@ import Marking from '../TeacherPages/MarkingPages/Marking';
|
||||||
import SendTrain from '../TeacherPages/Trainmanage/SendTrain';
|
import SendTrain from '../TeacherPages/Trainmanage/SendTrain';
|
||||||
import TrainManage from '../TeacherPages/Trainmanage/Trainmanage';
|
import TrainManage from '../TeacherPages/Trainmanage/Trainmanage';
|
||||||
import StudentLink from '../TeacherPages/MarkingPages/StudentLink';
|
import StudentLink from '../TeacherPages/MarkingPages/StudentLink';
|
||||||
|
import List_pods from '../TeacherPages/list_pods/list_pods'
|
||||||
|
|
||||||
// 定义一个组件来包裹除了特定页面(exam)外的所有页面使其有导航
|
// 定义一个组件来包裹除了特定页面(exam)外的所有页面使其有导航
|
||||||
const MainLayout = ({ headerNav:HeaderNav }) => {
|
const MainLayout = ({ headerNav:HeaderNav }) => {
|
||||||
|
@ -75,6 +76,7 @@ function App() {
|
||||||
<Route path='/teacher/SendTrain' element={<SendTrain/>}/> {/*实训管理-发布实训*/}
|
<Route path='/teacher/SendTrain' element={<SendTrain/>}/> {/*实训管理-发布实训*/}
|
||||||
<Route path='operation1/:operateID' element={<Operation1/>}/> {/* 实训页面1 */}
|
<Route path='operation1/:operateID' element={<Operation1/>}/> {/* 实训页面1 */}
|
||||||
<Route path='operation2/:operateID' element={<Operation2/>}/> {/* 实训页面2 */}
|
<Route path='operation2/:operateID' element={<Operation2/>}/> {/* 实训页面2 */}
|
||||||
|
<Route path='teacher/list_pods' element={<List_pods/>}/>
|
||||||
<Route path='/refresh' element={<Refresh/>}/>
|
<Route path='/refresh' element={<Refresh/>}/>
|
||||||
|
|
||||||
{/* 独立的顶级路由,如登录页面,也不包含HeaderNav */}
|
{/* 独立的顶级路由,如登录页面,也不包含HeaderNav */}
|
||||||
|
|
|
@ -157,7 +157,7 @@ def return_question():
|
||||||
choice_question = choice_question_func(ID) # 调取相应老师科目的题库
|
choice_question = choice_question_func(ID) # 调取相应老师科目的题库
|
||||||
completion_question = completion_question_func(ID)
|
completion_question = completion_question_func(ID)
|
||||||
t_or_f_question = t_or_f_question_func(ID)
|
t_or_f_question = t_or_f_question_func(ID)
|
||||||
return jsonify({'选择': choice_question, '填空': completion_question, '判断': t_or_f_question})
|
return jsonify({'choice': choice_question, 'completion': completion_question, 'judge': t_or_f_question})
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/teacher/select_class', methods=['POST'])
|
@app.route('/api/teacher/select_class', methods=['POST'])
|
||||||
|
@ -199,9 +199,9 @@ def find_student(): # 获取班级学生的具体信息
|
||||||
@app.route('/api/teacher/accept_test', methods=['POST']) # 在前端发布成功之后要存入数据库
|
@app.route('/api/teacher/accept_test', methods=['POST']) # 在前端发布成功之后要存入数据库
|
||||||
def accept_test():
|
def accept_test():
|
||||||
data = request.json
|
data = request.json
|
||||||
choice_list = data['ChoiceQuestionSet']
|
choice_list = data['Choice']
|
||||||
completion_list = data['CompletionQuestionSet']
|
completion_list = data['Completion']
|
||||||
judge_list = data['JudgeQuestionSet']
|
judge_list = data['Judge']
|
||||||
hour = data['HourValue']
|
hour = data['HourValue']
|
||||||
min = data['MinValue']
|
min = data['MinValue']
|
||||||
stop_time = data['StopTime']
|
stop_time = data['StopTime']
|
||||||
|
|
|
@ -245,11 +245,20 @@ def SendTrainTestFunc(TrainChoice,TrainCompletion,TrainJudge,Hour,Min,StopTime,C
|
||||||
|
|
||||||
end = 'false'
|
end = 'false'
|
||||||
# 将试卷分配到每一个学生
|
# 将试卷分配到每一个学生
|
||||||
for i in student_list:
|
zero='https://www.baidu.com/'
|
||||||
cursor.execute("INSERT INTO TrainScore (STUDENT_ID,CLASS,TEST_ID,TF) VALUES (?,?,?,?)",
|
one='https://www.douyin.com/'
|
||||||
(i, i[0:6], test_id, end))
|
|
||||||
|
|
||||||
|
|
||||||
|
for i in student_list:
|
||||||
|
if Train=='达梦数据库连接':
|
||||||
|
cursor.execute("INSERT INTO TrainScore (STUDENT_ID,CLASS,TEST_ID,TF,LINK) VALUES (?,?,?,?,?)",
|
||||||
|
(i, i[0:6], test_id, end,zero))
|
||||||
|
else:
|
||||||
|
cursor.execute("INSERT INTO TrainScore (STUDENT_ID,CLASS,TEST_ID,TF,LINK) VALUES (?,?,?,?,?)",
|
||||||
|
(i, i[0:6], test_id, end,one))
|
||||||
|
|
||||||
|
# 发布实训的时候根据实训不同给予不同链接
|
||||||
|
|
||||||
print('分配成功')
|
print('分配成功')
|
||||||
db.commit()
|
db.commit()
|
||||||
cursor.close()
|
cursor.close()
|
||||||
|
|
Loading…
Reference in New Issue