@instructure/quiz-interactions
Version:
A React UI component Library for quiz interaction types.
53 lines (46 loc) • 1.11 kB
JavaScript
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import Take from '../Take'
/**
category: Essay
Essay Show component
```jsx_example
<SettingsSwitcher locales={LOCALES}>
<EssayShow
itemBody="Why did the Roman Empire fall?"
userResponse={{ value: 'This is some text' }}
interactionData={{
rce: true,
spellCheck: true,
wordCount: true,
wordLimitEnabled: true,
wordLimitMax: 10,
wordLimitMin: 1,
notes: 'Teachers grading notes'
}}
/>
</SettingsSwitcher>
```
**/
export default class EssayShow extends Component {
static propTypes = {
interactionData: PropTypes.object.isRequired,
itemBody: PropTypes.string.isRequired,
userResponse: PropTypes.object, // FIX: this should be scoringData
}
static defaultProps = {
userResponse: void 0,
}
render() {
return (
<Take
interactionData={this.props.interactionData}
itemBody={this.props.itemBody}
userResponse={this.props.userResponse}
readOnly
/>
)
}
}