Skip to content

Commit

Permalink
[Dropzone] fixes correction criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
Elorfin committed Feb 28, 2024
1 parent d3414b0 commit d75f880
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ const CriteriaForm = props =>
id={`criterion-form-${c.id}-radio`}
type="choice"
label={trans('criterion_form_radio')}
choices={[...Array(props.dropzone.parameters.criteriaTotal).keys()].reduce((acc, current) => {
acc[current] = `${current}`
options={{
inline: true,
choices: [...Array(props.dropzone.parameters.criteriaTotal).keys()].reduce((acc, current) => {
acc[current] = `${current}`

return acc
}, {})}
return acc
}, {})
}}
hideLabel={true}
value={props.grades.find(g => g.criterion === c.id).value}
onChange={value => props.handleUpdate(c.id, parseInt(value))}
Expand Down Expand Up @@ -138,7 +141,7 @@ export class CorrectionForm extends Component {
label={trans('comment', {}, 'platform')}
value={this.state.correction.comment || ''}
onChange={value => this.updateCorrection('comment', value)}
minRows={3}
options={{minRows: 3}}
error={get(this.state.errors, 'comment')}
/>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class DenialBox extends Component {
label={trans('denial_reason', {}, 'dropzone')}
value={this.state.correction.correctionDeniedComment || ''}
onChange={value => this.updateCorrectionDeniedComment(value)}
minRows={3}
options={{minRows: 3}}
error={this.state.error}
/>
<div className="btn-group btn-group-right">
Expand Down Expand Up @@ -142,11 +142,14 @@ class CorrectionModal extends Component {
id={`criterion-form-${c.id}-radio`}
label="correction_criterion_radio"
type="choice"
choices={[...Array(this.props.dropzone.parameters.criteriaTotal).keys()].reduce((acc, current) => {
acc[current] = `${current}`

return acc
}, {})}
options={{
inline: true,
choices: [...Array(this.props.dropzone.parameters.criteriaTotal).keys()].reduce((acc, current) => {
acc[current] = `${current}`

return acc
}, {})
}}
disabled={true}
hideLabel={true}
value={this.props.correction.grades.find(g => g.criterion === c.id) ?
Expand Down

0 comments on commit d75f880

Please sign in to comment.