mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-07 01:46:44 +08:00
90 lines
2.6 KiB
JavaScript
90 lines
2.6 KiB
JavaScript
// 试卷
|
||
import ajax from '@/utils/xajax.js'
|
||
// 分页查询,资源归属,试题模式,关键词查询
|
||
// pageIndex 第几页
|
||
// pageSize 一页展示多少行
|
||
//参数:// ownership2(2级资源归属)
|
||
// ownership1(1级资源归属)
|
||
// ownership3(3级资源归属)),paperMode(试卷模式),keyWord(关键词)
|
||
const querylist = function(query) {
|
||
return ajax.post('/xboe/m/exam/paper/querylist', query);
|
||
}
|
||
// 添加
|
||
// ownership2(2级资源归属)
|
||
// ownership1(1级资源归属)
|
||
// ownership3(3级资源归属),testName(试卷名称),paperType(试卷分类)
|
||
// paperContent(试卷内容) remark 备注 difficulty难度
|
||
const save = function(data) {
|
||
return ajax.postJson('/xboe/m/exam/paper/save', data);
|
||
}
|
||
// 删除
|
||
// id 试卷id
|
||
const del = function(id) {
|
||
return ajax.get('/xboe/m/exam/paper/delete?id=' + id);
|
||
}
|
||
// 编辑
|
||
//当前id,// ownership2(2级资源归属)
|
||
// ownership1(1级资源归属)
|
||
// ownership3(3级资源归属),testName(试卷名称),paperType(试卷分类)
|
||
// paperContent(试卷内容) remark 备注 difficulty难度
|
||
const update = function(data) {
|
||
return ajax.postJson('/xboe/m/exam/paper/update', data);
|
||
}
|
||
/* 编辑详情 */
|
||
const detail = function(id) {
|
||
return ajax.get('/xboe/m/exam/paper/query?id=' + id);
|
||
}
|
||
|
||
/* 试卷批量导入计算
|
||
* num 数目
|
||
* score 总分
|
||
* diff1 容易的试题数量
|
||
* diff2 中等的试题数量
|
||
* diff3 困难的试题数量
|
||
* type1 单选的试题数量
|
||
* type2 单选的试题数量
|
||
* type3 单选的试题数量
|
||
*/
|
||
const batchImportCount = function(data) {
|
||
return ajax.postJson('/xboe/m/exam/paper/batch-count', data);
|
||
}
|
||
|
||
/**
|
||
* 根据生成的试题的id查询所有的试题
|
||
* @param {试题的集合array} ids
|
||
*/
|
||
const batchImportData = function(ids) {
|
||
return ajax.postJson('/xboe/m/exam/paper/batch-count', ids);
|
||
}
|
||
|
||
/**
|
||
* 查询试卷
|
||
* @param {pageSize,name} data
|
||
*/
|
||
const querypaper = function(data) {
|
||
return ajax.post('/xboe/m/exam/paper/queryPaper',data);
|
||
}
|
||
|
||
/**
|
||
* 返回试卷的json内容,字符串
|
||
* @param {Object} id
|
||
*/
|
||
const getPaperContent = function(id) {
|
||
return ajax.get('/xboe/m/exam/paper/paper-content?id=' + id);
|
||
}
|
||
const getPcPaperContent = function(id) {
|
||
return ajax.get('/xboe/m/course/content/exam/paper-content?courseExamId=' + id);
|
||
}
|
||
export default {
|
||
detail,
|
||
update,
|
||
del,
|
||
save,
|
||
querylist,
|
||
querypaper,
|
||
getPaperContent,
|
||
getPcPaperContent,
|
||
batchImportCount,
|
||
batchImportData
|
||
}
|