Skip to content

Commit

Permalink
后台接口
Browse files Browse the repository at this point in the history
  • Loading branch information
1257any committed May 5, 2019
1 parent 0b9c484 commit f01d4c5
Show file tree
Hide file tree
Showing 58 changed files with 2,641 additions and 1,667 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"git.ignoreLimitWarning": true
}
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,12 @@ npm start
```js
npm run build
```


###用户信息表
0 代表学生
1 代表教师
2 代表有管理员权限的教师


questionres[{"id":37,"exam_type":null,"exam_level":"1","question_type":"0","knowlege_type":"1","question":"以下为js的基本数据类型的是?","answer":"B","choice":[{"id":21,"content":"String","item":"A","question_id":37},{"id":22,"content":"date","item":"B","question_id":37},{"id":23,"content":"int","item":"C","question_id":37},{"id":24,"content":"float","item":"D","question_id":37}]},{"id":37,"exam_type":null,"exam_level":"1","question_type":"0","knowlege_type":"1","question":"以下为js的基本数据类型的是?","answer":"B","choice":[{"id":21,"content":"String","item":"A","question_id":37},{"id":22,"content":"date","item":"B","question_id":37},{"id":23,"content":"int","item":"C","question_id":37},{"id":24,"content":"float","item":"D","question_id":37}]},{"id":40,"exam_type":null,"exam_level":"1","question_type":"2","knowlege_type":"3","question":"css时编写页面样式的语言?","answer":"1"},{"id":40,"exam_type":null,"exam_level":"1","question_type":"2","knowlege_type":"3","question":"css时编写页面样式的语言?","answer":"1"},{"id":38,"exam_type":null,"exam_level":"1","question_type":"0","knowlege_type":"2","question":"以下html的叙述错误的为?","answer":"B","choice":[{"id":25,"content":"li为块级标签","item":"A","question_id":38},{"id":26,"content":"html中的canvas没有任何用途","item":"B","question_id":38},{"id":27,"content":"html","item":"C","question_id":38},{"id":28,"content":"float","item":"D","question_id":38}]},{"id":37,"exam_type":null,"exam_level":"1","question_type":"0","knowlege_type":"1","question":"以下为js的基本数据类型的是?","answer":"B"}]
7 changes: 6 additions & 1 deletion controllers/class_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ exports.change_class = async function(ctx, next){
// console.log('a'+JSON.stringify(data.params.managerId));
console.log('content'+data.content)
const results = await query(
`update class set class_name='${data.class_Name}', exam_subject ='${data.subject_name}',exam_subject_id='${data.subjectId}' where
`update class set class_name='${data.class_Name}', exam_subject ='${data.subject_name}' where
class_id= '${data.classId}'`
);
console.log("result",JSON.stringify(results));
Expand All @@ -191,6 +191,11 @@ exports.change_class = async function(ctx, next){
}
connection.end();
}catch(e){
console.log('[/user/login] error:', e.message, e.stack);
ctx.body = {
respCode: e.code || -1,
respMsg: e.message
};
}
};

Expand Down
2 changes: 1 addition & 1 deletion controllers/create_examination.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports.paperInfo= async function(ctx, next){
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}')`)
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)`)
}

}
Expand Down
Loading

0 comments on commit f01d4c5

Please sign in to comment.