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

Issue 44 create quiz frontend #80

Merged
merged 82 commits into from
Mar 5, 2025
Merged
Changes from 1 commit
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
83032be
skeleton quiz pages
AarifLamat Jan 7, 2025
bb05f21
Merge branch 'main' of https://github.com/codersforcauses/wajo into i…
AarifLamat Jan 7, 2025
5443092
added lil headings
AarifLamat Jan 8, 2025
9b56c68
yellow bg is now yellow border
AarifLamat Jan 9, 2025
2e63f32
Merge branch 'main' of https://github.com/codersforcauses/wajo into i…
AarifLamat Jan 9, 2025
5a1d074
Merge branch 'main' of https://github.com/codersforcauses/wajo into i…
AarifLamat Jan 9, 2025
73c29fe
attempts at pagination
AarifLamat Jan 9, 2025
5d954e2
attempt at creating a quiz api
AarifLamat Jan 10, 2025
aa50eda
..comments
AarifLamat Jan 11, 2025
b66551a
create the competition folder and the file.
morepresent Jan 11, 2025
e55301f
Merge branch 'main' of https://github.com/codersforcauses/wajo into i…
AarifLamat Jan 22, 2025
4f608ea
update psycopg
AarifLamat Jan 22, 2025
a04fb7e
Create components: ButtonList, CountDownDisplay, and SubmissionPopup.…
morepresent Jan 22, 2025
fb55341
Modify the buttonList.tsx, countdowndisplay and competition page.
morepresent Jan 22, 2025
51624b4
Merge branch 'main' into issue-44-Create_Quiz_Frontend
morepresent Jan 22, 2025
c7dfc42
Merge branch 'issue-44-Create_Quiz_Frontend' of https://github.com/co…
AarifLamat Jan 23, 2025
b642702
clarified api fetching logic and fixed some type errors
AarifLamat Jan 23, 2025
e51a703
type fix
AarifLamat Jan 23, 2025
8839ae5
more type error fixes
AarifLamat Jan 23, 2025
9d0a9c2
TYPE ERROR FIX!!
AarifLamat Jan 23, 2025
7badcda
fixed buttonList startIndex and endIndex not updating when clicking next
AarifLamat Jan 24, 2025
9ea8e9b
flake8 error fix
AarifLamat Jan 24, 2025
54c7e9c
update mock data fetching logic a lil
AarifLamat Jan 25, 2025
a2742dc
Merge branch 'main' of https://github.com/codersforcauses/wajo into i…
AarifLamat Jan 25, 2025
3f52f89
fix
AarifLamat Jan 25, 2025
f88de48
fix migrations
AarifLamat Jan 25, 2025
9ea61f7
Modify the name of some components. Create the auto-saving component.
morepresent Jan 25, 2025
b9739f1
Modify the submission pop-up component so that clicking anywhere outs…
morepresent Jan 25, 2025
68510f7
Merge branch 'main' of https://github.com/codersforcauses/wajo into i…
AarifLamat Jan 26, 2025
b9b771c
Merge branch 'issue-44-Create_Quiz_Frontend' of https://github.com/co…
AarifLamat Jan 26, 2025
b779516
fix linting errors
AarifLamat Jan 26, 2025
7c62775
fix
AarifLamat Jan 27, 2025
6c4c5fc
retrieved old migration files from an old commit
AarifLamat Jan 27, 2025
9952e1c
implemented suggestions from Lok
AarifLamat Jan 28, 2025
bdcb22d
Create a retrieve-questions component.
morepresent Feb 2, 2025
28e8683
Modify the retrieve-questions component.
morepresent Feb 3, 2025
ae4423f
create competition layout, organised components and made frontend con…
AarifLamat Feb 3, 2025
be387f7
moved retrieve questions
AarifLamat Feb 3, 2025
a1c0be8
made competition quizzes actually retrieve questions ahahaha
AarifLamat Feb 3, 2025
54f2b97
Merge branch 'main' of https://github.com/codersforcauses/wajo into i…
AarifLamat Feb 5, 2025
bd39d9e
type fixes
AarifLamat Feb 5, 2025
93ccaf2
fixed type errors
AarifLamat Feb 5, 2025
b5a6130
updated auto saving feature and attempted to connect backend further
AarifLamat Feb 5, 2025
cd99264
fix empty upcomingCompetition bug
AarifLamat Feb 5, 2025
ee03f88
Add question result component and update quiz page structure
joshuachai Feb 8, 2025
fdbd8af
Merge branch 'issue-44-Create_Quiz_Frontend' of https://github.com/co…
AarifLamat Feb 11, 2025
05a1ff6
Merge branch 'main' of https://github.com/codersforcauses/wajo into i…
AarifLamat Feb 11, 2025
210e504
fixed type errors
AarifLamat Feb 11, 2025
1291435
fixed some quiz fetching logic
AarifLamat Feb 11, 2025
5cf56b9
Merge branch 'main' into issue-44-Create_Quiz_Frontend
loklokyx Feb 12, 2025
f83e28a
code clean up
loklokyx Feb 12, 2025
d206822
fix(poetry): fix poetry lock content-hash
loklokyx Feb 12, 2025
089c285
Get the question_text, mark and image from the quizQuestionData. Rena…
morepresent Feb 12, 2025
510a0cc
Automaticaly submit the answer when countdown to 0. Modify the left t…
morepresent Feb 12, 2025
f7b7148
Include the image in the question. Modify the code in [id].tsx to ge…
morepresent Feb 13, 2025
983b048
feat(competition): add primary_id to JwtPayload, improve competition …
loklokyx Feb 14, 2025
27aafbf
chore(competition): code clean up
loklokyx Feb 14, 2025
32a193c
Merge branch 'main' into issue-44-Create_Quiz_Frontend
loklokyx Feb 14, 2025
be955fb
Display the startTime correctly.
morepresent Feb 15, 2025
881a90b
fix(quiz): rename user parameter to student in _get_slots_response me…
loklokyx Feb 15, 2025
19a44fe
fix(quiz): remove student parameter from quiz attempts endpoint and a…
loklokyx Feb 15, 2025
396e09d
feat(quiz): enhance image rendering and layout handling in GenericQui…
loklokyx Feb 15, 2025
8b5bd32
feat(quiz): add time_created field to Quiz model and update queryset …
yunho7687 Feb 15, 2025
1eaa02b
fix(quiz): update image URL handling and adjust layout for better res…
morepresent Feb 15, 2025
d23df2d
feat(quiz): add images field to QuestionSerializer for enhanced image…
yunho7687 Feb 15, 2025
b9555b2
Make the question image appear in the practice quiz
morepresent Feb 15, 2025
04f3f0d
feat(quiz): include quiz_attempt_id in CompetitionQuizViewSet respons…
yunho7687 Feb 15, 2025
3478668
fix(quiz): rename answer fields for consistency in GenericQuiz component
loklokyx Feb 15, 2025
7971cf2
feat(quiz): add quiz_attempt_id to CompetitionSlot interface
loklokyx Feb 15, 2025
8907e5f
Merge branch 'main' into issue-44-Create_Quiz_Frontend
loklokyx Feb 15, 2025
89c9b5a
fix(migrations)
loklokyx Feb 16, 2025
3b8054e
Merge branch 'main' of https://github.com/codersforcauses/wajo into i…
AarifLamat Feb 20, 2025
cdb5911
Merge branch 'issue-44-Create_Quiz_Frontend' of https://github.com/co…
AarifLamat Feb 20, 2025
209c18f
minor
AarifLamat Feb 20, 2025
7a28513
minor
AarifLamat Feb 21, 2025
4d45e43
named button list
AarifLamat Feb 21, 2025
aa1996d
fixed answer saving
AarifLamat Mar 1, 2025
d53d868
Merge branch 'main' of https://github.com/codersforcauses/wajo into i…
AarifLamat Mar 4, 2025
0cd2250
deleted conflicting quiz migration
AarifLamat Mar 4, 2025
3395923
updated navbar to have routing to quiz page and homepage
AarifLamat Mar 5, 2025
9a09477
Merge branch 'main' of https://github.com/codersforcauses/wajo into i…
AarifLamat Mar 5, 2025
d8dd518
updated package-lock
AarifLamat Mar 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
TYPE ERROR FIX!!
AarifLamat committed Jan 23, 2025
commit 9d0a9c24078ac870d1318b95fb17833b62d74200
17 changes: 11 additions & 6 deletions client/src/components/ui/Question/data-grid.tsx
Original file line number Diff line number Diff line change
@@ -69,7 +69,14 @@ export function Datagrid({
// Ensure paddedData always has 5 rows
const updatedPaddedData = [...currentData];
while (updatedPaddedData.length < itemsPerPage) {
updatedPaddedData.push({ name: "", category: "", difficulty: "" });
updatedPaddedData.push({
name: "",
genre: "",
difficulty: "",
question: "",
answer: "",
solution: "",
});
}

setPaddedData(updatedPaddedData);
@@ -92,10 +99,10 @@ export function Datagrid({
</TableHead>
<TableHead className="w-1/4">
<div className="flex items-center text-white">
<span>Category</span>
<span>Genre</span>
<span
className="ml-2 cursor-pointer"
onClick={() => sortByColumn("category")}
onClick={() => sortByColumn("genre")}
>
<svg
width="10"
@@ -140,9 +147,7 @@ export function Datagrid({
className={"divide-gray-200 border-gray-50 text-sm text-black"}
>
<TableCell className="w-1/4">{item.name || "\u00A0"}</TableCell>
<TableCell className="w-1/4">
{item.category || "\u00A0"}
</TableCell>
<TableCell className="w-1/4">{item.genre || "\u00A0"}</TableCell>
<TableCell className="w-1/4">
{item.difficulty || "\u00A0"}
</TableCell>
4 changes: 2 additions & 2 deletions client/src/types/data-grid.ts
Original file line number Diff line number Diff line change
@@ -9,8 +9,8 @@
* @example
* const exampleDatagridProps: DatagridProps = {
* datacontext: [
* { name: "Question01_2024", category: "Geometry Questions", difficulty: "Difficult" },
* { name: "Question02_2024", category: "Algebra Questions", difficulty: "Easy" }
* { name: "Question01_2024", genre: "Geometry Questions", difficulty: "Difficult" },
* { name: "Question02_2024", genre: "Algebra Questions", difficulty: "Easy" }
* ],
* onDataChange: (updatedData) => console.log("Data updated:", updatedData),
* changePage: 1
2 changes: 1 addition & 1 deletion client/src/types/question.ts
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
*
* @interface Question
* @property {string} name - The name of the question.
* @property {string} category - The category the question belongs to (e.g., Geometry, Algebra).
* @property {string} genre - The genre the question belongs to (e.g., Geometry, Algebra).
* @property {string} difficulty - The difficulty level of the question (e.g., Easy, Medium, Difficult).
*
* @example