each task (step) has its own id within a tutorial

This commit is contained in:
Delucse
2020-09-13 16:02:47 +02:00
parent 6f77b460cb
commit 7300cade5d
9 changed files with 59 additions and 23 deletions
+3 -5
View File
@@ -14,13 +14,11 @@ class Assessment extends Component {
render() {
var tutorialId = this.props.currentTutorialId;
var steps = this.props.steps;
var currentTask = this.props.step;
var tasks = steps.filter(task => task.type === 'task');
var taskIndex = tasks.indexOf(currentTask);
var status = this.props.status.filter(status => status.id === tutorialId)[0];
var statusTask = status.tasks[taskIndex]
var taskIndex = status.tasks.findIndex(task => task.id === currentTask.id);
var statusTask = status.tasks[taskIndex];
return (
<div style={{width: '100%'}}>
<Typography variant='h4' style={{marginBottom: '5px'}}>{currentTask.headline}</Typography>