Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] 퀴즈 API 구현 #117

Closed
10 tasks done
SunwooKim11 opened this issue Nov 13, 2024 · 0 comments
Closed
10 tasks done

[FEATURE] 퀴즈 API 구현 #117

SunwooKim11 opened this issue Nov 13, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@SunwooKim11
Copy link
Contributor

SunwooKim11 commented Nov 13, 2024

어떤 기능인가요?

  • 퀴즈 생성, 채점, 내역 조회 API을 만듭니다.

추가하려는 기능에 대해 간결하게 설명해주세요

작업 상세 내용

  • Google Gemini API을 call하여 프롬프트 엔저니어링으로 퀴즈를 만듭니다.
  • 퀴즈를 시험의 한종류로 생각합니다. 따라서 퀴즈 정보, 학생의 퀴즈 점수는 Exam, ExamUserScore에 저장합니다.
  • 퀴즈 생성 API
    • Mysql Exam Table에 메타데이터 생성.
    • MongoDB에는 아래와 같이 문제, 정답번호 리스트로 저장한다.
      • quiz-list : [ {{question : "1+1은 무엇인가요?", options : ["1", "3", "모름", "2"], answer : {{3: "2"}}, "explanation": "자명하다"}},
        {{question : "바나나는 무엇인가요?", options : ["과일", "고기", "모름", "나물"], answer : {{0: "과일"}}, "explanation": "백과사전 참고"}}, ...]
      • answer-list -> [3, 0, ... ]
      • 아래는 일단 나중에 생각. 기능 구현은 완료되었으므로.
      1. API 에러시 DB 트랜잭션 Rollback 처리 -> GEMINI API 호출시에 에러가 종종 발생함. -> 다시한번 GEMINI 요청?
      2. async로 트랜잭션을 함 transaction 내에서 fetching 한걸 받아오걸 에러가 발생하면 rollback 처리해줌.
  • 퀴즈 문제 받아오기 API
    • quiz number에 해당하는 문제의 ques, options을 리턴한다. ex) 1번 문제의 ques, options
  • 퀴즈 채점 API
    • 한번에 정답 리스트를 입력받음 -> mongodb의 정답 번호 리스트를 보고 채점
    • 아래와 같이 mongodb에 퀴즈 결과(QuizResult) 저장
      • exam_id : { "test_student" : { "1": {selcted : 0, corrected : false], "2": {selected : 1, corrected : true} ...} , "test_student_2":{ } }
    • ExamUserScore Table에 점수 저장. Exam에는 평균, 최대, 최소 점수 반영
  • ~~퀴즈 목록 조회 ~~ (다른 이슈에서 시험목록 조회 수정)-> 강의 시험 목록 조회에 시험 유형 params 추가
  • 유저가 응시한 퀴즈 결과 조회(화면 없으므로 생략-> 'Quiz' 하고 'QuizResult' DB연산으로 아래 결과 리턴
    • (문제, 선택선지, 정답, 정답유무, 설명)

참고할만한 자료(선택)

image

@SunwooKim11 SunwooKim11 added the enhancement New feature or request label Nov 13, 2024
@SunwooKim11 SunwooKim11 self-assigned this Nov 13, 2024
SunwooKim11 added a commit that referenced this issue Nov 18, 2024
SunwooKim11 added a commit that referenced this issue Nov 18, 2024
SunwooKim11 added a commit that referenced this issue Nov 19, 2024
SunwooKim11 added a commit that referenced this issue Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant