Fix Duplicate ID, Add Per-Problem Time Limit and Custom Answer Comparison #545
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello everyone! In this PR, I have fixed an issue that I encountered multiple times and added two useful features.
ID duplication causing infinite running: The original implementation used a random number in the range [1, 100] added to the timestamp as the ID. However, after calculation, it can be determined that if a problem with 4 examples is added by the companion, the probability of an error occurring will exceed 50% after just 8 problems. This will lead to an unending display of "running," which I have encountered many times.
Adding a per-problem time limit: Some problems have longer time limits, and it is not convenient to change the timeout setting in the preferences. Therefore, I added the option to modify it near "Set
ONLINE_JUDGE
".Different comparison methods: Some problems involve floating-point comparison and Yes/No comparison, but this plugin can only perform text comparison, which is not very convenient. Therefore, I added an option to choose different precision floating-point comparisons and case-insensitive Yes/No comparisons.
Im sure I have passed the tests mentioned in
dev-guide.md
, hoping this work can be a helpful addition to the plugin.