-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update assessment view for multiple peers
- Loading branch information
1 parent
b18d722
commit fb4cf6c
Showing
5 changed files
with
132 additions
and
50 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
src/components/CollapsibleFeedback/AssessmentCriterion.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import { useIntl } from '@edx/frontend-platform/i18n'; | ||
import Feedback from './Feedback'; | ||
import messages from './messages'; | ||
|
||
const AssessmentCriterion = ({ assessmentCriterions, overallFeedback, stepName }) => { | ||
const { formatMessage } = useIntl(); | ||
|
||
return ( | ||
<> | ||
{assessmentCriterions.map((criterion) => { | ||
return ( | ||
<Feedback | ||
key={criterion.name} | ||
criterionName={criterion.name} | ||
selectedOption={criterion.selectedOption} | ||
selectedPoints={criterion.selectedPoints} | ||
commentHeader={stepName} | ||
commentBody={criterion.feedback} | ||
/> | ||
); | ||
})} | ||
<Feedback | ||
criterionName={formatMessage(messages.overallFeedback)} | ||
commentHeader={stepName} | ||
commentBody={overallFeedback} | ||
/> | ||
</> | ||
); | ||
}; | ||
AssessmentCriterion.defaultProps = {}; | ||
AssessmentCriterion.propTypes = { | ||
assessmentCriterions: PropTypes.arrayOf(PropTypes.shape({ | ||
name: PropTypes.string.isRequired, | ||
selectedOption: PropTypes.string, | ||
selectedPoints: PropTypes.number, | ||
feedback: PropTypes.string, | ||
})), | ||
overallFeedback: PropTypes.string, | ||
stepName: PropTypes.string.isRequired, | ||
}; | ||
|
||
export default AssessmentCriterion; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters