Files
learning-system-mobile/api/modules/paper.js
2025-07-15 15:06:14 +08:00

90 lines
2.6 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 一页展示多少行
//参数:// ownership22级资源归属
// ownership11级资源归属
// ownership33级资源归属paperMode(试卷模式)keyWord(关键词)
const querylist = function(query) {
return ajax.post('/xboe/m/exam/paper/querylist', query);
}
// 添加
// ownership22级资源归属
// ownership11级资源归属
// ownership33级资源归属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// ownership22级资源归属
// ownership11级资源归属
// ownership33级资源归属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
}