Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const renderResult = (value: any) => {
/** A class which is the output of the show() function */
const ShapeDrawn = (window as any).ShapeDrawn;
if (typeof ShapeDrawn !== 'undefined' && value instanceof ShapeDrawn) {
return ;
} else {
return stringify(value);
}
};
const renderResult = (value: any) => {
/** A class which is the output of the show() function */
const ShapeDrawn = (window as any).ShapeDrawn;
if (typeof ShapeDrawn !== 'undefined' && value instanceof ShapeDrawn) {
return ;
} else {
return stringify(value);
}
};
const isCorrect = this.props.editorTestcases.reduce((acc, testcase) => {
return acc && stringify(testcase.result) === testcase.answer;
}, true);
if (!isCorrect) {
function cadetAlert(value: any) {
alert(stringify(value));
}
function display(value: Value, str: string, workspaceLocation: any) {
display((str === undefined ? '' : str + ' ') + stringify(value), '', workspaceLocation);
return value;
}
};
const renderResult = (value: any) => {
/** A class which is the output of the show() function */
const ShapeDrawn = (window as any).ShapeDrawn;
if (typeof ShapeDrawn !== 'undefined' && value instanceof ShapeDrawn) {
return ;
} else {
return stringify(value);
}
};
if (this.props.testcase.result !== undefined || this.props.testcase.errors) {
gradingStatus = ' wrong';
if (stringify(this.props.testcase.result) === this.props.testcase.answer) {
gradingStatus = ' correct';
}
}
return (
<div>
<pre>{this.props.testcase.program}</pre>
<pre>{this.props.testcase.answer}</pre>
<pre> {this.props.testcase.errors
? buildErrorString(this.props.testcase.errors)
: this.props.testcase.result !== undefined
? renderResult(this.props.testcase.result)
: 'No Answer'}
</pre></div>