Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create exercises with new simple form #148

Merged
merged 57 commits into from
Dec 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
fd15c04
Make Group page a bit faster
SemaiCZE Nov 24, 2017
55e8ae7
Form for specifying tests
SemaiCZE Nov 24, 2017
8984d0c
Simple exercise config form - environment tabs
SemaiCZE Nov 24, 2017
0cc25ab
Simple edit exercise form - basic design
SemaiCZE Nov 24, 2017
1c3c95d
Simple config form - files and runtime envs
SemaiCZE Nov 25, 2017
2046463
Separate simple runtime env form
SemaiCZE Nov 25, 2017
b3fadb2
Make simple RE form live
SemaiCZE Nov 25, 2017
24fa8d3
Simple edit tests form is alive
SemaiCZE Nov 25, 2017
36c1653
Exercise config loaded into simple form ... uff
SemaiCZE Nov 25, 2017
d63ba8e
Merge branch 'master' of https://github.com/ReCodEx/web-app into simp…
Nov 29, 2017
29a85d3
Fixing issue with inadequate bytes pretty printer.
Nov 29, 2017
c32503f
Kibibyte rulez.
Nov 29, 2017
21a35ac
Simple form starting to work ...
SemaiCZE Nov 30, 2017
2846c88
Find pipelines for each test, support out file too
SemaiCZE Nov 30, 2017
179c8a7
Add more standard judges
SemaiCZE Nov 30, 2017
b16ec8d
Edit tests form validation
SemaiCZE Dec 1, 2017
671ed62
Edit RE form validation
SemaiCZE Dec 1, 2017
8df5b4c
Edit simple exercise configuration form validation
SemaiCZE Dec 1, 2017
64e7e6e
Fixes to exercise config form and empty configs
SemaiCZE Dec 1, 2017
6faf47c
Refactoring and modifying limits edit form (WiP).
Dec 4, 2017
ef58f33
Merge branch 'simple_exercise_form' of https://github.com/ReCodEx/web…
Dec 4, 2017
45fdd90
Merge branch 'master' of https://github.com/ReCodEx/web-app into simp…
Dec 4, 2017
2d18ef2
Simple limits edit form rewritten once more + now supports field vali…
Dec 5, 2017
e3efcb7
Finishing work on simple limits form.
Dec 7, 2017
a6dc91f
Changing logger middleware to get configuration from .env.
Dec 7, 2017
0158a94
Adapt to changed API format
SemaiCZE Dec 7, 2017
264efdd
Updating names of judges.
Dec 7, 2017
78aab5d
Merge branch 'simple_exercise_form' of github.com:ReCodEx/web-app int…
SemaiCZE Dec 7, 2017
a8bb4a1
New items for assignment synchronization
SemaiCZE Dec 7, 2017
18a228f
Exercise config reflects changes in test count
SemaiCZE Dec 7, 2017
967467b
Better fields validation, visual improvements
SemaiCZE Dec 7, 2017
f73a09b
Final polishing of tests edit form.
Dec 7, 2017
78e82fe
Merge branch 'simple_exercise_form' of https://github.com/ReCodEx/web…
Dec 7, 2017
50cf7dd
Fixing bug and adding reset button to test edit form.
Dec 7, 2017
b1b4ab0
Refetch config and limits after changing tests
SemaiCZE Dec 7, 2017
c4c0fc1
Merge branch 'simple_exercise_form' of github.com:ReCodEx/web-app int…
SemaiCZE Dec 7, 2017
eae3dd3
Updating exercise config forms and localization.
Dec 7, 2017
6508094
Merge branch 'simple_exercise_form' of https://github.com/ReCodEx/web…
Dec 7, 2017
88f9edf
Refresh all data when environment configs are changed.
Dec 8, 2017
a773445
Additional forms polishing and fixes for simple bugs.
Dec 8, 2017
facb8fe
Merge branch 'master' of https://github.com/ReCodEx/web-app into simp…
Dec 8, 2017
cca2da4
Fix unhandled error in pipeline edit form
SemaiCZE Dec 8, 2017
10847ea
React v16 + update of some dependencies
SemaiCZE Dec 9, 2017
d71995d
Newer webpack
SemaiCZE Dec 9, 2017
d175e9f
Identify tests by their ids
SemaiCZE Dec 9, 2017
237c252
Fixing problems with react 16. Updating behavior of simple edit page.…
Dec 10, 2017
6c31c98
Updating translations.
Dec 10, 2017
f4067df
Rewriting Expanding fields to be completely compatible with redux-form.
Dec 11, 2017
3289261
Update icons
SemaiCZE Dec 14, 2017
9a1c1fb
Fix linter and tests
SemaiCZE Dec 14, 2017
88273fa
Smart fill button is now operational.
Dec 14, 2017
8d867c4
Merge branch 'simple_exercise_form' of https://github.com/ReCodEx/web…
Dec 14, 2017
8d5d3c4
Validation added into simple config form -- input file duplicates are…
Dec 14, 2017
2a6ccb4
Reload evaluations after resubmit
SemaiCZE Dec 14, 2017
e992691
Merge branch 'simple_exercise_form' of github.com:ReCodEx/web-app int…
SemaiCZE Dec 14, 2017
8c7a2bb
Fix linter
SemaiCZE Dec 14, 2017
a8a5d48
Adding tooltips to some buttons.
Dec 14, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .env-sample
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,11 @@ ALLOW_NORMAL_REGISTRATION=true
ALLOW_LDAP_REGISTRATION=false
ALLOW_CAS_REGISTRATION=true


# LOGGER_MIDDLEWARE is active only if NODE_ENV=development

# verbose debug action logging
LOGGER_MIDDLEWARE_VERBOSE=false

# log complete dump of exceptions
LOGGER_MIDDLEWARE_EXCEPTIONS=true
4 changes: 3 additions & 1 deletion config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ module.exports = {
"'" + process.env.ALLOW_NORMAL_REGISTRATION + "'",
ALLOW_LDAP_REGISTRATION:
"'" + process.env.ALLOW_LDAP_REGISTRATION + "'",
ALLOW_CAS_REGISTRATION: "'" + process.env.ALLOW_CAS_REGISTRATION + "'"
ALLOW_CAS_REGISTRATION: "'" + process.env.ALLOW_CAS_REGISTRATION + "'",
LOGGER_MIDDLEWARE_VERBOSE: "'" + process.env.LOGGER_MIDDLEWARE_VERBOSE + "'",
LOGGER_MIDDLEWARE_EXCEPTIONS: "'" + process.env.LOGGER_MIDDLEWARE_EXCEPTIONS + "'",
},
gitRevision: {
VERSION: JSON.stringify(gitRevisionPlugin.version()),
Expand Down
34 changes: 16 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
},
"dependencies": {
"admin-lte": "2.3.11",
"ajv": "5.5.1",
"ajv-keywords": "2.1.1",
"babel-plugin-react-intl": "^2.1.3",
"bluebird": "^3.3.5",
"browser-cookies": "^1.0.8",
Expand All @@ -48,39 +50,35 @@
"global": "^4.3.1",
"immutable": "^3.8.1",
"isomorphic-fetch": "^2.2.1",
"js-yaml": "^3.10.0",
"jwt-decode": "^2.0.1",
"moment": "^2.18.1",
"pretty-bytes": "^3.0.1",
"pretty-ms": "^2.1.0",
"prop-types": "^15.5.8",
"react": "^15.5.4",
"react-ace": "^4.2.1",
"react-bootstrap": "^0.31.2",
"react-codemirror": "^0.3.0",
"react": "^16.2.0",
"react-ace": "5.8.0",
"react-bootstrap": "0.31.5",
"react-collapse": "^4.0.2",
"react-copy-to-clipboard": "^5.0.1",
"react-datetime": "^2.8.10",
"react-dom": "^15.5.4",
"react-dom": "^16.2.0",
"react-dropzone": "^3.5.3",
"react-fontawesome": "^1.1.0",
"react-fontawesome": "1.6.1",
"react-height": "^3.0.0",
"react-helmet": "^5.0.3",
"react-immutable-proptypes": "^2.1.0",
"react-intl": "^2.1.3",
"react-motion": "^0.5.0",
"react-intl": "2.4.0",
"react-motion": "^0.5.2",
"react-redux": "^5.0.4",
"react-remarkable": "^1.1.2",
"react-responsive": "^1.1.3",
"react-router": "^3.0.0",
"react-router": "3.2.0",
"react-router-bootstrap": "^0.23.3",
"react-router-redux": "^4.0.8",
"react-rte": "^0.11.0",
"react-table": "^6.0.0",
"react-throttle": "^0.3.0",
"react-toggle": "^3.0.1",
"react-toggle": "4.0.2",
"redux": "^3.5.1",
"redux-actions": "^2.0.3",
"redux-form": "^6.2.1",
"redux-form": "7.2.0",
"redux-promise-middleware": "^4.2.0",
"redux-storage": "^4.1.2",
"redux-storage-decorator-filter": "^1.1.8",
Expand Down Expand Up @@ -118,7 +116,7 @@
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-react": "^7.0.0",
"eslint-plugin-standard": "^3.0.1",
"extract-text-webpack-plugin": "^2.0.0-beta.4",
"extract-text-webpack-plugin": "3.0.2",
"fetch-mock": "^5.10.0",
"file-loader": "^0.11.1",
"git-revision-webpack-plugin": "^2.5.1",
Expand All @@ -143,9 +141,9 @@
"scroll-behavior": "^0.4.0",
"strip-loader": "^0.1.2",
"style-loader": "^0.17.0",
"webpack": "^2.5.1",
"webpack": "3.10.0",
"webpack-dev-middleware": "^1.10.2",
"webpack-dev-server": "^2.4.5",
"webpack-dev-server": "2.9.7",
"webpack-isomorphic-tools": "^3.0.2"
}
}
116 changes: 116 additions & 0 deletions src/components/Assignments/Assignment/AssignmentSync/AssignmentSync.js
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;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default from './AssignmentSync';

This file was deleted.

1 change: 0 additions & 1 deletion src/components/Exercises/EditSimpleLimitsBox/index.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import prettyBytes from 'pretty-bytes';
import { prettyPrintBytes } from '../../helpers/stringFormatters';
import { FormattedDate, FormattedTime, FormattedMessage } from 'react-intl';
import withLinks from '../../../hoc/withLinks';
import { Button } from 'react-bootstrap';
Expand All @@ -25,7 +25,7 @@ const AttachmentFilesTableRow = ({
</a>
</td>
<td>
{prettyBytes(size)}
{prettyPrintBytes(size)}
</td>
<td>
<FormattedDate value={uploadedAt * 1000} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/Exercises/FilesTable/FilesTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const FilesTable = ({
RowComponent,
intl
}) =>
<Box title={title} collapsable isOpen>
<Box title={title} collapsable isOpen unlimitedHeight>
<div>
{description &&
<p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import prettyBytes from 'pretty-bytes';
import { prettyPrintBytes } from '../../helpers/stringFormatters';
import { FormattedDate, FormattedTime, FormattedMessage } from 'react-intl';
import { Button } from 'react-bootstrap';
import Confirm from '../../../components/forms/Confirm';
Expand All @@ -26,7 +26,7 @@ const SupplementaryFilesTableRow = ({
</span>}
</td>
<td>
{prettyBytes(size)}
{prettyPrintBytes(size)}
</td>
<td>
<FormattedDate value={uploadedAt * 1000} />
Expand Down
4 changes: 2 additions & 2 deletions src/components/Groups/SupervisorsView/SupervisorsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const SupervisorsView = ({
deleteExercise,
users,
publicAssignments,
links: { EXERCISE_EDIT_URI_FACTORY, EXERCISE_EDIT_CONFIG_URI_FACTORY },
links: { EXERCISE_EDIT_URI_FACTORY, EXERCISE_EDIT_SIMPLE_CONFIG_URI_FACTORY },
intl: { locale }
}) =>
<div>
Expand Down Expand Up @@ -157,7 +157,7 @@ const SupervisorsView = ({
</Button>
</LinkContainer>
<LinkContainer
to={EXERCISE_EDIT_CONFIG_URI_FACTORY(exerciseId)}
to={EXERCISE_EDIT_SIMPLE_CONFIG_URI_FACTORY(exerciseId)}
>
<Button
bsSize="xs"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage, FormattedDate } from 'react-intl';
import prettyBytes from 'pretty-bytes';
import { prettyPrintBytes } from '../../helpers/stringFormatters';
import prettyMs from 'pretty-ms';
import { Table } from 'react-bootstrap';
import Box from '../../widgets/Box';

const ReferenceSolutionsEvaluationsResults = ({ results, testId, taskId }) => (
const ReferenceSolutionsEvaluationsResults = ({ results, testId, taskId }) =>
<Box
isOpen={false}
collapsable
Expand Down Expand Up @@ -71,19 +71,24 @@ const ReferenceSolutionsEvaluationsResults = ({ results, testId, taskId }) => (

return (
<tr key={i}>
<td>{result.referenceSolution.description}</td>
<td>
{result.referenceSolution.description}
</td>
<td>
<FormattedDate value={result.evaluation.evaluatedAt * 1000} />
</td>
<td>{prettyBytes(taskStats.usedMemory)}</td>
<td>{prettyMs(taskStats.usedTime * 1000)}</td>
<td>
{prettyPrintBytes(taskStats.usedMemory)}
</td>
<td>
{prettyMs(taskStats.usedTime * 1000)}
</td>
</tr>
);
})}
</tbody>
</Table>
</Box>
);
</Box>;

ReferenceSolutionsEvaluationsResults.propTypes = {
results: PropTypes.array.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ class SubmissionDetail extends Component {
});
}

componentWillReceiveProps(newProps) {
if (this.props.evaluations.size !== newProps.evaluations.size) {
this.setState({
activeSubmissionId: newProps.submission.lastSubmission.id
});
}
}

render() {
const {
submission: {
Expand Down
Loading