Skip to content
Snippets Groups Projects
Commit 99c36997 authored by Victor Löfgren's avatar Victor Löfgren
Browse files

Add correcting instructions in frontend

parent f44b098f
No related branches found
No related tags found
1 merge request!116Resolve "Add correcting instructions in question"
This commit is part of merge request !116. Comments created here will be created in the context of that merge request.
......@@ -56,6 +56,7 @@ export interface Question extends NameID {
slide_id: number
total_score: number
type_id: number
correcting_instructions: string
}
export interface QuestionAlternative {
......
......@@ -36,5 +36,6 @@ export interface RichQuestion {
total_score: number
question_type: QuestionType
type_id: number
correcting_instructions: string
alternatives: QuestionAlternative[]
}
......@@ -30,7 +30,7 @@ const Instructions = ({ activeSlide, competitionId }: InstructionsProps) => {
.put(
`/api/competitions/${competitionId}/slides/${activeSlide.id}/questions/${activeSlide.questions[0].id}`,
{
instructions: event.target.value,
correcting_instructions: event.target.value,
}
)
.then(() => {
......@@ -56,7 +56,7 @@ const Instructions = ({ activeSlide, competitionId }: InstructionsProps) => {
<Center>
<TextField
id="outlined-basic"
defaultValue={''}
defaultValue={activeSlide.questions[0].correcting_instructions}
onChange={updateInstructionsText}
variant="outlined"
fullWidth={true}
......
......@@ -20,7 +20,7 @@ const JudgeScoringInstructions = ({ question }: JudgeScoringInstructionsProps) =
return (
<JudgeScoringInstructionsContainer elevation={3}>
<Typography variant="h4">Rättningsinstruktioner</Typography>
<Typography variant="body1">Såhär rättar du denhär frågan</Typography>
<Typography variant="body1">{question.correcting_instructions}</Typography>
</JudgeScoringInstructionsContainer>
)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment