Files
learning-system-portal/src/api/modules/test.js
2022-12-22 11:42:10 +08:00

77 lines
1.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 考试管理
import ajax from '@/utils/xajax.js'
// 分页查询
// 参数 pageIndex 第几页
// pageSize 每页展示条数
// keyWord 关键字
// published true或者false
// // ownership22级资源归属
// ownership11级资源归属
// ownership33级资源归属
//
const querylist = function(query) {
return ajax.post('/xboe/m/exam/test/pageList', query);
}
// 新建考试
// 参数这块我给截图
const save = function(data) {
return ajax.postJson('/xboe/m/exam/test/save', data);
}
// 修改考试,参数和添加一样
const update = function(data) {
return ajax.postJson('/xboe/m/exam/test/update', data);
}
// 考试详情
// 参数 考试id
const detail = function(id) {
return ajax.get('/xboe/m/exam/test/detail?id=' + id);
}
// 删除
const del = function(id) {
return ajax.get('/xboe/m/exam/test/delete?id=' + id);
}
/**
* 发布考试
* @param {Object} id
* @param {Object} publish 如果不传就是true
*/
const pulish = function(id, publish) {
let flag = true;
if (!publish) {
flag = publish;
}
return ajax.post('/xboe/m/exam/test/publish?id=' + id + '&publish=' + flag);
}
/**
*@parma{
* testId 考试id
*}
*/
const exports=function (query){
return ajax.post('/xboe/m/exam/alone/answer/export',query,{responseType: 'blob'});
}
/**
* @param{
* id 考试id
* enabled true 上架 false 下架
* }
* */
const enabled=function(query){
return ajax.post('/xboe/m/exam/test/enabled',query);
}
export default {
detail,
update,
del,
save,
querylist,
pulish,
exports,
enabled
}