Skip to content

Commit

Permalink
‘ small adjust’
Browse files Browse the repository at this point in the history
  • Loading branch information
1257any committed May 15, 2019
1 parent 151cf58 commit 545037e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
8 changes: 5 additions & 3 deletions controllers/create_examination.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ exports.paperInfo= async function(ctx, next){
const connection = connectionModel.getConnection();
const query = bluebird.promisify(connection.query.bind(connection));
let question = JSON.parse(data.paperInfo);
// console.log(JSON.parse(data.paperInfo).questionObjects)
console.log(JSON.parse(data.paperInfo).questionObjects)
for(let i =0; i<question.questionObjects.length;i++){
for(let j in question.questionObjects[i].knowledgePointInfo){
// console.log(question.questionObjects[i].knowledgePointInfo[j])
const results = await query( `insert into exam_content values(null,'${exam_id}','${question.questionObjects[i].questionType}','${j}','${question.questionObjects[i].knowledgePointInfo[j]}','${question.questionObjects[i].score}',null,null)`)
console.log('j'+j);
console.log()
console.log(question.questionObjects[i])
const results = await query( `insert into exam_content values(null,'${exam_id}','${question.questionObjects[i].questionType}',${j},'${question.questionObjects[i].knowledgePointInfo[j]}',${question.questionObjects[i].score})`)
}

}
Expand Down
4 changes: 2 additions & 2 deletions controllers/examination_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ exports.get_stu_papers = async function (ctx, next) {
const connection = connectionModel.getConnection();
const query = bluebird.promisify(connection.query.bind(connection));
const data = await query(
`select * from create_exam`
`select * from exam_content`
);
console.log('paperewtw' + JSON.stringify(data));
if (data.length) {
Expand Down Expand Up @@ -195,7 +195,7 @@ exports.create_exam = async function (ctx, next) {
)
console.log("class" + JSON.stringify(class_id))
const results = await query(
`insert into create_exam values(null,'${class_id[0].class_id}','${data.examName}','${data.classId}','${data.paperId}','${startTime}','${endTime}','${data.paperId}')`
`insert into create_exam values(null,'${class_id[0].class_id}','${data.examName}','${data.classId}','${data.paperId}','${startTime}','${endTime}','${data.paperId}',null,null)`
);
console.log("result", JSON.stringify(results));
if (results.length) {
Expand Down
2 changes: 1 addition & 1 deletion controllers/student_function.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ exports.get_question = async function (ctx, next) {
// console.log("把题目内容查出来"+JSON.stringify(sm_question))
for(let j =0 ;j<question[i].num;j++){
sm_question = await query(
`select * from question_insert where knowlege_type ='${question[i].knowledge}' and question_type = '${question[i].question_type}'`
`select * from question_insert where knowlege_type ='${question[i].knowledge}' and question_type = '${question[i].question_type-1}'`
)
allquestion.push(sm_question[j])
}
Expand Down
4 changes: 2 additions & 2 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<title></title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
<link href="./css/app.d2fb1683.css" rel="stylesheet"></head>
<link href="./css/app.be238d4f.css" rel="stylesheet"></head>
<body>
<div id="app"></div>
<script type="text/javascript" src="./js/vendor.dca76adb.js"></script><script type="text/javascript" src="./js/app.d2fb1683.js"></script></body>
<script type="text/javascript" src="./js/vendor.19b14ca0.js"></script><script type="text/javascript" src="./js/app.be238d4f.js"></script></body>
</html>
2 changes: 1 addition & 1 deletion src/containers/main/paper_manage/scoring_paper.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class ScoringPaper extends React.Component {
<span>
{
this.state.data[record.key].status ?
<Button type="primary" size="small" onClick={this.beginScoring.bind(this,record.key)}>开始阅卷</Button>: <Button type="primary" disabled size="small">开始阅卷</Button>
<Button type="primary" disabled size="small">开始阅卷</Button>:<Button type="primary" size="small" onClick={this.beginScoring.bind(this,record.key)}>开始阅卷</Button>
}
</span>
),
Expand Down

0 comments on commit 545037e

Please sign in to comment.