Skip to content

Commit

Permalink
[feat/#64] Add: add answer and runtime in new assignment form
Browse files Browse the repository at this point in the history
  • Loading branch information
mjms0214 authored and 김민지 committed Aug 29, 2023
1 parent cc1be07 commit 087c21d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 96 deletions.
96 changes: 0 additions & 96 deletions package-lock.json

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

36 changes: 36 additions & 0 deletions src/components/NewAssignment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ const newAssignment: FC = () => {
start_date: startDate!.toISOString(),
due_date: dueDate!.toISOString(),
description: data.description,
answer: data.answer,
runtime: data.runtime
};

setUserId(location.state.user_id);
Expand Down Expand Up @@ -164,6 +166,40 @@ const newAssignment: FC = () => {
</p>
)}
</div>
<div className="">
<label className="form-label">답안</label>
<input
type="text"
className="form-control form-control-sm"
id="exampleFormControlInput1"
{...register("answer", {
required: "answer is required!",
})}
/>
{errors.answer && (
<p className="text-danger" style={{ fontSize: 14 }}>
{/* {errors.answer.message} */}
errors.answer.message
</p>
)}
</div>
<div className="">
<label className="form-label">실행시간</label>
<input
type="text"
className="form-control form-control-sm"
id="exampleFormControlInput1"
{...register("runtime", {
required: "runtime is required!",
})}
/>
{errors.runtime && (
<p className="text-danger" style={{ fontSize: 14 }}>
{/* {errors.runtime.message} */}
errors.runtime.message
</p>
)}
</div>

<div className="text-center mt-4 ">
<button
Expand Down

0 comments on commit 087c21d

Please sign in to comment.