From 428e35005ce7d1f2fac3a002b506d15886f25019 Mon Sep 17 00:00:00 2001 From: Zheng Ze Date: Fri, 8 Nov 2024 00:14:24 +0800 Subject: [PATCH 1/4] Change colour --- peerprep_fe/src/components/workspace/problem.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/peerprep_fe/src/components/workspace/problem.tsx b/peerprep_fe/src/components/workspace/problem.tsx index dd3e53fcc4..6e039023d8 100644 --- a/peerprep_fe/src/components/workspace/problem.tsx +++ b/peerprep_fe/src/components/workspace/problem.tsx @@ -49,7 +49,7 @@ const Problem: React.FC = ({ questionId }) => { {/* Examples */} {question?.examples && (
-

Examples

+

Examples

{question.examples.map((example, index) => (
= ({ questionId }) => { {/* Constraints */} {question?.constraints && (
-

Constraints

+

Constraints

    {question.constraints.map((constraint, index) => (
  • @@ -87,7 +87,7 @@ const Problem: React.FC = ({ questionId }) => { {/* Topic*/}
    -

    Topics

    +

    Topics

    {question?.topic?.map((topic, index) => ( From 48b695a0e5ccb3ff09f8040b319ae0f49581f3b2 Mon Sep 17 00:00:00 2001 From: Zheng Ze Date: Fri, 8 Nov 2024 00:22:27 +0800 Subject: [PATCH 2/4] Add next question loading --- peerprep_fe/src/app/workspace/[id]/page.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/peerprep_fe/src/app/workspace/[id]/page.tsx b/peerprep_fe/src/app/workspace/[id]/page.tsx index be5dac2d7a..f47ff3e9a7 100644 --- a/peerprep_fe/src/app/workspace/[id]/page.tsx +++ b/peerprep_fe/src/app/workspace/[id]/page.tsx @@ -41,6 +41,7 @@ const Workspace: React.FC = ({ params }) => { const [isChatOpen, setIsChatOpen] = useState(false); const [isVideoOpen, setIsVideoOpen] = useState(true); const [leaveMessage, setLeaveMessage] = useState(""); + const [isNextBtnLoading, setIsNextBtnLoading] = useState(false); const { stopStream } = useCall(); function handleLeaveRoom() { @@ -129,6 +130,7 @@ const Workspace: React.FC = ({ params }) => { setError("User rejected the request to proceed to next question"); setIsErrorModalOpen(true); } + setIsNextBtnLoading(false); }; const openChat = () => { setIsChatOpen(true); @@ -138,6 +140,10 @@ const Workspace: React.FC = ({ params }) => { setIsChatOpen(false); setIsVideoOpen(true); }; + const onNextQuestion = () => { + nextQuestion(); + setIsNextBtnLoading(true); + }; useEffect(() => { if (!socket) return; @@ -238,7 +244,11 @@ const Workspace: React.FC = ({ params }) => { {/* Right Pane */}

    -
    From 7a4101c46d57fe96799c839e630ee403fb36b63f Mon Sep 17 00:00:00 2001 From: Zheng Ze Date: Fri, 8 Nov 2024 00:37:09 +0800 Subject: [PATCH 3/4] Fix next question being able to get questions of other difficulty --- collab_service/src/services/roomService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collab_service/src/services/roomService.ts b/collab_service/src/services/roomService.ts index ccddf4d68c..bf524b6652 100644 --- a/collab_service/src/services/roomService.ts +++ b/collab_service/src/services/roomService.ts @@ -108,7 +108,7 @@ export async function updateMessages(roomId: string, messages: ChatMessage[]) { } async function getRandomQuestion(topic: string, difficulty: DifficultyLevel) { - let url = `${QUESTION_SERVICE}/questions/random/?topic=${topic}&difficulty=${difficulty}`; + let url = `${QUESTION_SERVICE}/questions/random/?topic=${topic}&difficultyLevel=${difficulty}`; try { const response = await axios.get(url); return response.data; From b060717f35d95e2d573160ab6919a67d2d918e82 Mon Sep 17 00:00:00 2001 From: Zheng Ze Date: Fri, 8 Nov 2024 00:39:46 +0800 Subject: [PATCH 4/4] Fix bug where fe thinks there are no cameras when permissions have not been granted. --- peerprep_fe/src/contexts/call-context.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/peerprep_fe/src/contexts/call-context.tsx b/peerprep_fe/src/contexts/call-context.tsx index 1ecfd3cf75..539fb66868 100644 --- a/peerprep_fe/src/contexts/call-context.tsx +++ b/peerprep_fe/src/contexts/call-context.tsx @@ -103,9 +103,6 @@ export const CallProvider: React.FC = ({ children }) => { const hasCamera = devices.some( (device) => device.kind === "videoinput" && - device.label !== "" && - device.deviceId !== "" && - device.groupId !== "" && // Handle edge case where user does not have a camera but a virtual camera is present // Need to add all the possible virtual camera names !device.label.includes("virtual") &&