Skip to content

Commit

Permalink
feat: sending-quiz
Browse files Browse the repository at this point in the history
  • Loading branch information
dalcheonroadhead committed May 16, 2024
1 parent c611536 commit 882f365
Show file tree
Hide file tree
Showing 15 changed files with 724 additions and 101 deletions.
236 changes: 236 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-progress": "^1.0.3",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-toast": "^1.1.5",
"@stomp/stompjs": "^7.0.0",
"axios": "^1.6.8",
"class-variance-authority": "^0.7.0",
Expand Down
8 changes: 2 additions & 6 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ import { BrowserRouter, Route, Routes } from 'react-router-dom';
import WaitingRoomPage from './page/WaitingRoomPage';
import TeacherHome from './teacherPage/TeacherHome';
import TeacherOngoing from './teacherPage/TeacherOngoing';
import SubjectiveQuiz from './quiz/SubjectiveQuiz';
import QuizComponent from './quiz/MulitpleQuiz';
import Answer from './quiz/Answer';
import QuizEnd from './quiz/QuizEnd';
import RankingScreen from './quiz/Ranking';
import LoginForm from './page/LoginFrom';
import { WebSocketProvider } from './utils/WebSocketProvider';
import QuizContainer from './quiz/QuizContainer';


function App() {
Expand All @@ -25,9 +23,7 @@ function App() {
<Route path='/home' element={<TeacherHome/>}></Route>
<Route path='/teacherRemote' element={<TeacherOngoing/>} ></Route>
<Route path="/waitingRoom/:Qid" element={<WaitingRoomPage/>}></Route>
<Route path='/subject/:Qid' element={<SubjectiveQuiz/>}></Route>
<Route path='/multiple/:Qid' element={<QuizComponent/>}></Route>
<Route path='/answer/:Qid' element={<Answer/>}></Route>
<Route path='/quiz/:Qid' element={<QuizContainer/>}></Route>
<Route path='/quizEnd' element={<QuizEnd/>}></Route>
<Route path='/ranking' element={<RankingScreen/>}></Route>
</Routes>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/apis/axiosModule.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import axios from "axios";

const instance = axios.create({
baseURL: 'http://localhost:8080/api',
// baseURL: 'http://k10d107.p.ssafy.io/api'
// baseURL: 'http://localhost:8080/api',
baseURL: 'https://k10d107.p.ssafy.io/api'
})

const tokens = JSON.parse(localStorage.getItem('tokens')) || {};
Expand Down
21 changes: 21 additions & 0 deletions frontend/src/apis/ranking.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

import { instance } from "./axiosModule";

export const getRanking = async(quizGameId) => {
const url = `/quizzes/ranking/${quizGameId}`;
const tokens = JSON.parse(localStorage.getItem('tokens'))
console.log(tokens.accessToken);
const headers = {
"Authorization": `Bearer ${tokens.accessToken}`
}

return await instance.get(url, {headers})
.then((res) => {
console.log('api 결과:', res)
return res.data;
})
.catch(
(err) => {console.log("API 호출 에러", err)
throw err;}
)
}
Loading

0 comments on commit 882f365

Please sign in to comment.