Skip to content

Create assignment page (Tutor)#25

Merged
junhonglow merged 13 commits into
masterfrom
tutor_create_assignment_page
Mar 18, 2024
Merged

Create assignment page (Tutor)#25
junhonglow merged 13 commits into
masterfrom
tutor_create_assignment_page

Conversation

@junhonglow
Copy link
Copy Markdown
Collaborator

@junhonglow junhonglow commented Mar 2, 2024

Description

Create the frontend page under /assignments/create route that will display a page for tutors to create an assignment. There is currently no limit on the number of questions that can be created for an assignment.

Related Issue(s)

Partially completes #3, will close after PR #24 is merged as well.

Screenshots

image

Additional Notes

  1. Added a change to layout, currently if the components exceeded the scroll height of the window, the background would revert back to black.

  2. There's a supposed issue that is linked with the input type for date and time for Next UI that has supposedly been fixed in v2.1.17 but not sure why it's still occurring. Either way, I have a workaround but it is not the best looking.

TO-DO

@WillCWX WillCWX self-requested a review March 3, 2024 05:28
Copy link
Copy Markdown
Collaborator

@WillCWX WillCWX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work

There are some comments regarding the handling of inputs.

Do you have a way to handle the submission? It seems that the inputs are not controlled so you can't submit the values directly. There is no overall <form> also so I'm not sure how submission will work.

Comment thread frontend/src/app/assignments/create/page.tsx Outdated
Comment thread frontend/src/app/assignments/create/page.tsx Outdated
Comment thread frontend/src/components/FileUpload.tsx
Comment thread frontend/src/components/FileUpload.tsx Outdated
@junhonglow junhonglow force-pushed the tutor_create_assignment_page branch from 7be5192 to 1db9c54 Compare March 17, 2024 14:45
@junhonglow
Copy link
Copy Markdown
Collaborator Author

Issues have been resolved.

@tryyang2001 tryyang2001 requested a review from WillCWX March 18, 2024 05:09
Copy link
Copy Markdown
Collaborator

@WillCWX WillCWX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Just change {AssignmentCreator()} to <AssignmentCreator /> and fix the merge conflicts.

We may need to breakdown the pages into smaller components soon but this should be fine for now.

return (
<div className="columns-auto items-center p-12">
<h1 className="font-bold text-4xl text-center">Assignment Creation</h1>
{AssignmentCreator()}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{AssignmentCreator()}
<AssignmentCreator />

Calling Components as a function may have unintended side effects, it is better to use < > so that react understands and renders this as component

Comment thread frontend/src/app/layout.tsx Outdated
<body className={inter.className + " min-h-screen"}>
<Providers>
<div className="flex flex-row justify-start">
<div className="h-screen flex flex-row justify-start">
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you have some conflicts with master that vivien just merged in

/>
<Button className="w-1/3" color="primary" onClick={handleSubmit}>Create Assignment</Button>
</div>
{renderQuestionUploads()}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is ok as it is a render (no react hooks)

Comment thread frontend/src/components/FileUpload.tsx Outdated

return (
<div>
{renderPreview()}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is ok as it is a render (no react hooks)

@tryyang2001
Copy link
Copy Markdown
Owner

@junhonglow can you fix the build error in frontend? You may see the errors by running yarn build locally, and fix those "error" (I think warning is fine for now)

@junhonglow junhonglow merged commit e88a400 into master Mar 18, 2024
@junhonglow junhonglow deleted the tutor_create_assignment_page branch March 18, 2024 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants