mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-14 05:16:43 +08:00
101 lines
1.6 KiB
JavaScript
101 lines
1.6 KiB
JavaScript
/**
|
|
* 试题
|
|
*/
|
|
import ajax from '@/utils/xajax.js'
|
|
|
|
/**
|
|
* 分页查询
|
|
* @param {
|
|
* pageIndex 起始页
|
|
* pageSize 每页条数
|
|
* title 题干
|
|
* type 类型
|
|
* resSysId 资源归属
|
|
* } query
|
|
* @returns
|
|
*/
|
|
const page = function(query) {
|
|
return ajax.post('/xboe/m/exam/question/page', query);
|
|
}
|
|
|
|
/**
|
|
* 保存
|
|
* @param {
|
|
* title 题干
|
|
* type 类型
|
|
* resSysId 资源归属
|
|
* difficulty 难度
|
|
* defaultScore 默认分
|
|
* analysis 解析
|
|
* answer 答案
|
|
* optionList:[
|
|
* {options 选项
|
|
* content 选项内容
|
|
* isAnswer 是否正确答案 0表不是 1表是
|
|
* score 分值}
|
|
* ]
|
|
* } data
|
|
* @returns
|
|
*/
|
|
const save = function(data) {
|
|
return ajax.postJson('/xboe/m/exam/question/save', data);
|
|
}
|
|
|
|
/**
|
|
* 修改
|
|
* @param {
|
|
* id 试题ID
|
|
* title 题干
|
|
* type 类型
|
|
* resSysId 资源归属
|
|
* difficulty 难度
|
|
* defaultScore 默认分
|
|
* analysis 解析
|
|
* answer 答案
|
|
* optionList:[
|
|
* {options 选项
|
|
* content 选项内容
|
|
* isAnswer 是否正确答案 0表不是 1表是
|
|
* score 分值}
|
|
* ]
|
|
* } data
|
|
* @returns
|
|
*/
|
|
const update = function(data) {
|
|
return ajax.postJson('/xboe/m/exam/question/update', data);
|
|
}
|
|
|
|
/**
|
|
* 删除
|
|
* @param {试题ID} id
|
|
* @returns
|
|
*/
|
|
const del = function(id) {
|
|
return ajax.del('/xboe/exam/m/question/delete?id=' + id);
|
|
}
|
|
|
|
/**
|
|
* 详情
|
|
* @param {试题ID} id
|
|
* @returns
|
|
*/
|
|
const detail = function(id) {
|
|
return ajax.get('/xboe/exam/question/detail?id=' + id);
|
|
}
|
|
/*
|
|
file excel 文件
|
|
导入选择题
|
|
*/
|
|
const import = function(file) {
|
|
return ajax.post('/xboe/exam/question/import,file);
|
|
}
|
|
|
|
|
|
export default {
|
|
page,
|
|
save,
|
|
update,
|
|
del,
|
|
detail,
|
|
import
|
|
} |