-
-
+
+
+ {this.props.activeStep === steps.length-1 ?
+
+ :
+
+ }
: null}
@@ -98,6 +112,7 @@ class SolutionCheck extends Component {
SolutionCheck.propTypes = {
tutorialCheck: PropTypes.func.isRequired,
+ tutorialStep: PropTypes.func.isRequired,
currentTutorialId: PropTypes.number,
activeStep: PropTypes.number.isRequired,
xml: PropTypes.string.isRequired
@@ -109,4 +124,4 @@ const mapStateToProps = state => ({
xml: state.workspace.code.xml
});
-export default connect(mapStateToProps, { tutorialCheck })(withStyles(styles, {withTheme: true})(SolutionCheck));
+export default connect(mapStateToProps, { tutorialCheck, tutorialStep })(withStyles(styles, {withTheme: true})(withRouter(SolutionCheck)));
diff --git a/src/components/Tutorial/TutorialBody.js b/src/components/Tutorial/TutorialBody.js
deleted file mode 100644
index f59cfd9..0000000
--- a/src/components/Tutorial/TutorialBody.js
+++ /dev/null
@@ -1,128 +0,0 @@
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { connect } from 'react-redux';
-import { tutorialId, tutorialStep } from '../../actions/tutorialActions';
-
-import Breadcrumbs from '../Breadcrumbs';
-import StepperHorizontal from './StepperHorizontal';
-import StepperVertical from './StepperVertical';
-import Instruction from './Instruction';
-import Assessment from './Assessment';
-import NotFound from '../NotFound';
-
-import tutorials from './tutorials.json';
-
-import withWidth, { isWidthUp } from '@material-ui/core/withWidth';
-import Card from '@material-ui/core/Card';
-import Button from '@material-ui/core/Button';
-
-class Tutorial extends Component {
-
- componentDidMount(){
- this.props.tutorialId(Number(this.props.match.params.tutorialId));
- }
-
- componentDidUpdate(props, state){
- if(props.currentTutorialId !== Number(this.props.match.params.tutorialId)){
- this.props.tutorialId(Number(this.props.match.params.tutorialId));
- }
- }
-
- componentWillUnmount(){
- this.props.tutorialId(null);
- }
-
- render() {
- var currentTutorialId = this.props.currentTutorialId;
- var tutorial = tutorials.filter(tutorial => tutorial.id === currentTutorialId)[0];
- var step = tutorial.steps[this.props.activeStep];
-
- const Tutorial2 = () => (
-
-
-
-
-
-
-
-
-
- {step.type === 'instruction' ?
-
- : }
-
-
-
-
-
-
-
-
- );
- return (
- !Number.isInteger(currentTutorialId) || currentTutorialId < 1 || currentTutorialId > tutorials.length ?
-
- :
-
- );
- };
-}
-
-Tutorial.propTypes = {
- tutorialId: PropTypes.func.isRequired,
- currentTutorialId: PropTypes.number,
- status: PropTypes.array.isRequired,
- change: PropTypes.number.isRequired,
- activeStep: PropTypes.number.isRequired
-};
-
-const mapStateToProps = state => ({
- change: state.tutorial.change,
- status: state.tutorial.status,
- currentTutorialId: state.tutorial.currentId,
- activeStep: state.tutorial.activeStep
-});
-
-export default connect(mapStateToProps, { tutorialId, tutorialStep })(withWidth()(Tutorial));
-
-
-
-//
-//
-
-//
-// {/* width of vertical stepper is 30px*/}
-//
-//
-//
-//
-//
-//
-//
-// {this.props.level === 'instruction' ?
-//
: null }
-// {this.props.level === 'assessment' ?
-//
-//
-//
-//
-//
-//
-//
-// Hier könnte die Problemstellung stehen.
-//
-//
-//
-//
-//
-//
-// : null }
-//
-//
-//