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) => { ...@@ -29,6 +29,7 @@ export const ACheckboxForm = ({ element, response, handleAnswer }: Props) => {
type="checkbox" type="checkbox"
value={choice.text} value={choice.text}
onChange={handleChange} onChange={handleChange}
required={element.isRequired}
/> />
<label className="text-lg">{choice.text}</label> <label className="text-lg">{choice.text}</label>
</div> </div>
......
...@@ -25,6 +25,7 @@ export const ADropdownForm = ({ element, handleAnswer, response }: Props) => { ...@@ -25,6 +25,7 @@ export const ADropdownForm = ({ element, handleAnswer, response }: Props) => {
<select <select
className="py-2 hover:bg-themeColor bg-gray-200 rounded" className="py-2 hover:bg-themeColor bg-gray-200 rounded"
onChange={handleChange} onChange={handleChange}
required={element.isRequired}
> >
{element.content.choices.map((choice) => ( {element.content.choices.map((choice) => (
<option value={choice.text}>{choice.text}</option> <option value={choice.text}>{choice.text}</option>
......
...@@ -28,6 +28,7 @@ export const AEssayForm = ({ element, handleAnswer, response }: Props) => { ...@@ -28,6 +28,7 @@ export const AEssayForm = ({ element, handleAnswer, response }: Props) => {
id={element._id} id={element._id}
onChange={handleChange} onChange={handleChange}
value={answer} value={answer}
required={element.isRequired}
></input> ></input>
</div> </div>
); );
......
...@@ -33,6 +33,7 @@ export const AFileForm = ({ ...@@ -33,6 +33,7 @@ export const AFileForm = ({
name="file" name="file"
className=" w-11/12 h-16" className=" w-11/12 h-16"
onChange={handleChange} onChange={handleChange}
required={element.isRequired}
></input> ></input>
</div> </div>
); );
......
...@@ -31,6 +31,7 @@ export const ARadioForm = ({ element, response, handleAnswer }: Props) => { ...@@ -31,6 +31,7 @@ export const ARadioForm = ({ element, response, handleAnswer }: Props) => {
name={element._id} name={element._id}
onChange={handleChange} onChange={handleChange}
value={choice.text} value={choice.text}
required={element.isRequired}
></input> ></input>
<label className="text-lg" id={choice.text}> <label className="text-lg" id={choice.text}>
{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