-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #148 from ReCodEx/simple_exercise_form
Create exercises with new simple form
- Loading branch information
Showing
96 changed files
with
4,634 additions
and
1,814 deletions.
There are no files selected for viewing
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
116 changes: 116 additions & 0 deletions
116
src/components/Assignments/Assignment/AssignmentSync/AssignmentSync.js
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,116 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { FormattedMessage } from 'react-intl'; | ||
import { Row, Col, Alert } from 'react-bootstrap'; | ||
|
||
import Button from '../../../widgets/FlatButton'; | ||
|
||
const AssignmentSync = ({ syncInfo, exerciseSync }) => | ||
!syncInfo.exerciseConfig.upToDate || | ||
!syncInfo.configurationType.upToDate || | ||
!syncInfo.exerciseEnvironmentConfigs.upToDate || | ||
!syncInfo.hardwareGroups.upToDate || | ||
!syncInfo.localizedTexts.upToDate || | ||
!syncInfo.limits.upToDate || | ||
!syncInfo.scoreConfig.upToDate || | ||
!syncInfo.scoreCalculator.upToDate || | ||
!syncInfo.exerciseTests.upToDate | ||
? <Row> | ||
<Col sm={12}> | ||
<Alert bsStyle="warning"> | ||
<h4> | ||
<FormattedMessage | ||
id="app.assignment.syncRequired" | ||
defaultMessage="The exercise was updated!" | ||
/> | ||
</h4> | ||
<div> | ||
<FormattedMessage | ||
id="app.assignment.syncDescription" | ||
defaultMessage="The exercise for this assignment was updated in following categories:" | ||
/> | ||
<ul> | ||
{!syncInfo.exerciseConfig.upToDate && | ||
<li> | ||
<FormattedMessage | ||
id="app.assignment.syncExerciseConfig" | ||
defaultMessage="Exercise configuration" | ||
/> | ||
</li>} | ||
{!syncInfo.configurationType.upToDate && | ||
<li> | ||
<FormattedMessage | ||
id="app.assignment.syncConfigType" | ||
defaultMessage="Type of exercise configuration" | ||
/> | ||
</li>} | ||
{!syncInfo.exerciseEnvironmentConfigs.upToDate && | ||
<li> | ||
<FormattedMessage | ||
id="app.assignment.syncExerciseEnvironmentConfigs" | ||
defaultMessage="Environment configuration" | ||
/> | ||
</li>} | ||
{!syncInfo.hardwareGroups.upToDate && | ||
<li> | ||
<FormattedMessage | ||
id="app.assignment.syncHardwareGroups" | ||
defaultMessage="Hardware groups" | ||
/> | ||
</li>} | ||
{!syncInfo.localizedTexts.upToDate && | ||
<li> | ||
<FormattedMessage | ||
id="app.assignment.syncLocalizedTexts" | ||
defaultMessage="Localized texts" | ||
/> | ||
</li>} | ||
{!syncInfo.limits.upToDate && | ||
<li> | ||
<FormattedMessage | ||
id="app.assignment.syncLimits" | ||
defaultMessage="Limits" | ||
/> | ||
</li>} | ||
{!syncInfo.scoreConfig.upToDate && | ||
<li> | ||
<FormattedMessage | ||
id="app.assignment.syncScoreConfig" | ||
defaultMessage="Score configuration" | ||
/> | ||
</li>} | ||
{!syncInfo.scoreCalculator.upToDate && | ||
<li> | ||
<FormattedMessage | ||
id="app.assignment.syncScoreCalculator" | ||
defaultMessage="Score calculator" | ||
/> | ||
</li>} | ||
{!syncInfo.exerciseTests.upToDate && | ||
<li> | ||
<FormattedMessage | ||
id="app.assignment.syncExerciseTests" | ||
defaultMessage="Exercise tests" | ||
/> | ||
</li>} | ||
</ul> | ||
</div> | ||
<p> | ||
<Button bsStyle="primary" onClick={exerciseSync}> | ||
<FormattedMessage | ||
id="app.assignment.syncButton" | ||
defaultMessage="Update this assignment" | ||
/> | ||
</Button> | ||
</p> | ||
</Alert> | ||
</Col> | ||
</Row> | ||
: <div />; | ||
|
||
AssignmentSync.propTypes = { | ||
syncInfo: PropTypes.object.isRequired, | ||
exerciseSync: PropTypes.func.isRequired | ||
}; | ||
|
||
export default AssignmentSync; |
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 @@ | ||
export default from './AssignmentSync'; |
26 changes: 0 additions & 26 deletions
26
src/components/Exercises/EditSimpleLimitsBox/EditSimpleLimitsBox.js
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.