Commit 463ce408 authored by Jiwon Yoon's avatar Jiwon Yoon
Browse files

isRequired

parent 374b9208
......@@ -29,6 +29,7 @@ export const ACheckboxForm = ({ element, response, handleAnswer }: Props) => {
type="checkbox"
value={choice.text}
onChange={handleChange}
required={element.isRequired}
/>
<label className="text-lg">{choice.text}</label>
</div>
......
......@@ -25,6 +25,7 @@ export const ADropdownForm = ({ element, handleAnswer, response }: Props) => {
<select
className="py-2 hover:bg-themeColor bg-gray-200 rounded"
onChange={handleChange}
required={element.isRequired}
>
{element.content.choices.map((choice) => (
<option value={choice.text}>{choice.text}</option>
......
......@@ -28,6 +28,7 @@ export const AEssayForm = ({ element, handleAnswer, response }: Props) => {
id={element._id}
onChange={handleChange}
value={answer}
required={element.isRequired}
></input>
</div>
);
......
......@@ -33,6 +33,7 @@ export const AFileForm = ({
name="file"
className=" w-11/12 h-16"
onChange={handleChange}
required={element.isRequired}
></input>
</div>
);
......
......@@ -31,6 +31,7 @@ export const ARadioForm = ({ element, response, handleAnswer }: Props) => {
name={element._id}
onChange={handleChange}
value={choice.text}
required={element.isRequired}
></input>
<label className="text-lg" id={choice.text}>
{choice.text}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment