fix error status in tutorial-builder

This commit is contained in:
Delucse 2020-09-28 15:54:39 +02:00
parent 8d752e0430
commit 3a92a6a08c
2 changed files with 3 additions and 2 deletions

View File

@ -86,7 +86,7 @@ class BlocklyExample extends Component {
} }
if(!this.props.task){ if(!this.props.task){
// instruction can also display only one block, which does not necessarily // instruction can also display only one block, which does not necessarily
// have to be the initial block // have to be the initial block
xml = xml.replace('deletable="false"', 'deletable="true"'); xml = xml.replace('deletable="false"', 'deletable="true"');
} }
this.setState({xml: xml}); this.setState({xml: xml});
@ -100,6 +100,7 @@ class BlocklyExample extends Component {
var oldValue = this.state.checked; var oldValue = this.state.checked;
this.setState({checked: value}); this.setState({checked: value});
if(oldValue !== value && !value){ if(oldValue !== value && !value){
this.props.deleteError(this.props.index, 'xml');
this.props.deleteProperty(this.props.index, 'xml'); this.props.deleteProperty(this.props.index, 'xml');
} }
} }

View File

@ -48,7 +48,7 @@ class Id extends Component {
else if(this.props.error){ else if(this.props.error){
this.props.deleteError(undefined, 'id'); this.props.deleteError(undefined, 'id');
} }
if(!this.props.value){ if(!this.props.value || !Number.isInteger(this.props.value)){
this.props.tutorialId(0+step); this.props.tutorialId(0+step);
} }
else { else {