QuestionSerializer.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. const makeId = require("../../util/makeId");
  2. const fileSerializer = require("../FileSerializer");
  3. /**
  4. * @description 题目信息
  5. * @typedef {Object} QuestionSerializerType
  6. * @property {number|string} id 题目id
  7. * @property {string} name 题目名称
  8. * @property {string} description 题目描述
  9. * @property {Object} assignmentType 作业类型
  10. * @property {Object} type 题目类型
  11. * @property {number} creator 创建者id
  12. * @property {number} expectTime 预计完成时间
  13. * @property {number} difficulty 题目难度
  14. * @property {FileSerializerType} file 题目文件
  15. */
  16. /**
  17. * @description 题目信息
  18. * @returns {QuestionSerializerType}
  19. */
  20. module.exports = () => {
  21. return {
  22. id: makeId(),
  23. name: "物流系统需求规格说明书",
  24. description: "某公司为xxx快递公司,请为该公司设计一个物流管理系统",
  25. assignmentType: {
  26. name: "DOCUMENT",
  27. value: "文档作业"
  28. },
  29. type: {
  30. name: "DOCUMENT",
  31. value: "文档作业"
  32. },
  33. creator: makeId(),
  34. expectTime: 20,
  35. difficulty: 1,
  36. file: fileSerializer()
  37. };
  38. };