QUESTION-题库.md 2.5 KB

QUESTION - 题库

url 前缀:question

示例:https://xxxxxxxxx/api/question

得到推荐题目

post /recommend

Parameters

interface recommendDTO {
  courseId: number; // 课程信息
  userId: number; // 学生id
  knowledgeId: Array<string>; // 知识点 id
  questionNum: number; // 问题数量
}

Response

interface ResponseData {
  res: [
    {
      id: number;
      type: string; // 题目类型,目前只有choice
      stem: string; // 题目描述,题干
      options: // 选项
      {
        [key: string]: string;
      };
      tags: string[]; // 标签
      knowledgeId: string[]; // 知识点 id
    }
  ];
}

Example Response

{
  "res": {
    "id": 11,
    "type": "choice",
    "stem": "这是一次测试",
    "options": {
      "A": "2k-l > n + k",
      "B": "2n-l <= n + k",
      "C": "n = k",
      "D": "n-l <= k"
    },
    "tags": ["test", "ok"],
    "knowledgeId": ["A.B", "C.D"]
  }
}

得到题目答案与解析

post /answer

Parameters

interface recommendDTO {
  questionId: Array<number>;
}

Response

interface ResponseData {
  res: Array<{
    id: number;
    type: string;
    stem: string;
    options: {
      [key: string]: string;
    };
    tags: string[];
    knowledgeId: string[];
    lastModified: Date;
    answer: string;
    analysis: string;
  }>;
}

Example Response

{"res":[{"id":23063,"type":"choice","stem":"对一待排序序列分别进行直接插入排序和简单选择排序,若待排序序列中有两个元素的值相同,则,()保证这两个元素在排序前后的相对位置不变。.","options":{"A":"直接插入排序和简单选择排序都可以","B":"直接插入排序和简单选择排序都不能","C":"只有直接插入排序可以","D":"只有简单选择排序可以"},"answer":"【答案】C","analysis":"【解析】本题考查简单排序算法特点。直接插入排序的思想是:是将 n 个待排序的元素由一个有序表和一个无序表组成,开始时有序表中只包含 ÷ 个元素。排序过程中,每次从无序表中取出第一个元素,将其插入到有序表中的适当位置,使有序表的长度不断加长,完成排序过程。\n\n简单选择排序过程不能保证排序码相同的两个元素在排序前后的相对位置不变,直接插入排序则可以。","tags":[],"knowledgeId":[],"lastModified":"2019-12-30 17:29:23"}]}