Переглянути джерело

更新:调整试卷题目接口

ChengYuXuan 5 роки тому
батько
коміт
6187a5bd5a
2 змінених файлів з 4 додано та 4 видалено
  1. 2 2
      src/api/exam.ts
  2. 2 2
      src/views/teacher/components/QuestionList.vue

+ 2 - 2
src/api/exam.ts

@@ -75,11 +75,11 @@ export const getExamsByTeacherId = (page: Pageable, state: ExamState) => {
   )
 }
 
-export const addExamPaperQuestions = (
+export const setExamPaperQuestions = (
   examId: ID,
   questions: QuestionAndScore
 ) => {
-  return axios.post(`${EXAM_MODULE}/${examId}/questions/`, {
+  return axios.put<ReceivedData>(`${EXAM_MODULE}/${examId}/questions/`, {
     questionScoreMap: questions
   })
 }

+ 2 - 2
src/views/teacher/components/QuestionList.vue

@@ -99,7 +99,7 @@ import { QuestionSerializer } from '@/api/types'
 import { getQuestionList } from '@/api/question'
 import { questionTypeToText } from '@/utils/common'
 import MarkdownText from '@/views/exam/components/MarkdownText.vue'
-import { addExamPaperQuestions } from '@/api/exam'
+import { setExamPaperQuestions } from '@/api/exam'
 
 interface Question extends QuestionSerializer {
   typeText: string
@@ -215,7 +215,7 @@ export default Vue.extend({
         idAndScore.set(val.id, val.score)
       })
 
-      addExamPaperQuestions(examId, Object.fromEntries(idAndScore)).then(() => {
+      setExamPaperQuestions(examId, Object.fromEntries(idAndScore)).then(() => {
         this.selectQuestionsSuccess = true
         setTimeout(() => {
           this.$router.push({ name: 'teacher-exam-details' })