examine.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /**
  2. * 授权 API
  3. */
  4. import {
  5. http
  6. } from '../request/main.js'
  7. /**
  8. * 开始答题
  9. *
  10. * @returns {Promise}
  11. */
  12. export function startChallenge() {
  13. return http.post('/examine/startChallenge')}
  14. /**
  15. * 获取新题
  16. *
  17. * @returns {Promise}
  18. */
  19. export function getNew(session_id) {
  20. return http.post('/examine/getNew', {
  21. session_id
  22. })}
  23. /**
  24. * 提交答案
  25. *
  26. * @returns {Promise}
  27. */
  28. export function submitAnswer(id, answer) {
  29. return http.post('/examine/submitAnswer', {
  30. id,
  31. answer
  32. })
  33. }
  34. /**
  35. * 获取考核结果
  36. *
  37. * @returns {Promise}
  38. */
  39. export function getSummary(session_id) {
  40. return http.post('/examine/getSummary', {
  41. session_id
  42. })
  43. }
  44. /**
  45. * 获取考核历史
  46. *
  47. * @returns {Promise}
  48. */
  49. export function getHistory(session_id, page, page_size) {
  50. return http.post('/examine/getHistory', {
  51. session_id,
  52. page,
  53. page_size
  54. })
  55. }
  56. /**
  57. * 获取答题结果
  58. *
  59. * @returns {Promise}
  60. */
  61. export function getResult(id) {
  62. return http.post('/examine/getResult', {
  63. id
  64. })
  65. }
  66. /**
  67. * 获取排行数据
  68. *
  69. * @returns {Promise}
  70. */
  71. export function getTopList(group, page, page_size) {
  72. return http.post('/examine/getTopList', {
  73. group,
  74. page,
  75. page_size
  76. })
  77. }
  78. /**
  79. * 获取我的排行
  80. *
  81. * @returns {Promise}
  82. */
  83. export function getMineTop(group) {
  84. return http.post('/examine/getMineTop', {
  85. group
  86. })
  87. }
  88. /**
  89. * 获取全部排行和个人排行
  90. * 比赛专用
  91. *
  92. * @returns {Promise}
  93. */
  94. export function getRankingList() {
  95. return http.post('/examine/getRankingList', {
  96. })
  97. }