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

(hotfix/#34): Clear the output when the error is corrected. #35

Closed
wants to merge 1 commit into from

Conversation

feat7
Copy link

@feat7 feat7 commented Oct 28, 2018

Fixes #34
Also shows 'Write code to see something!' message when the code is not written.

if (/\S/.test(editorValue)) {
document.getElementById("output").innerHTML = "";
$("#output").append("<pre>" + data + "</pre>");
} else document.getElementById("output").innerHTML = "Write code to see something!";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, the issue occurs during the check function is called not when the run function is called.

Your logic makes sense but it shouldn't be put in the print_result but rather this check should be put in check_syntax specifically to check if the Editor is empty or if there are no errors in outputted by the function

Thanks for the pull request and let me know if you have any questions!

@ethanchewy
Copy link
Owner

ethanchewy commented Oct 29, 2018

Thanks for the pull request - I appreciate it.

Left a comment. Please let me know if you have any questions!

The main issue is that this check should be put during the AJAX check_code call not during the run_code and should check if the Editor is empty or if the error list is empty

@feat7
Copy link
Author

feat7 commented Oct 29, 2018

The real problem is not anywhere in the java script code. It is in the python code to run the code.
When the input is empty, the stdin or stdout gives the previous input that is available there.
ie. It doesn't flush previous stdin/stdout.

@ethanchewy
Copy link
Owner

Error fixed: 43bd71a

@ethanchewy ethanchewy closed this Oct 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants