KamandPrompt / CodeManiacs

IIT Mandi Online Judge
MIT License
23 stars 58 forks source link

Time and Memory Limit Issue Resolved #150

Closed shrirangpdeshmukh closed 3 years ago

shrirangpdeshmukh commented 3 years ago

What's this PR do? (related issue if exists)

Resolving issue #141 Made memory limit and time limit necessary fields and assigned them default values.

Any context you want to provide on the implementation?

Screenshots? (necessary if an UI/UX change)

Capture

Signior-X commented 3 years ago

Awesome work done @shrirangpdeshmukh Good to merge this PR.

However remember while making PRs or working on some feature, try to work on a different branch than the main(master) branch. As while in master, if you need to update the PR, it can be a problem.

shrirangpdeshmukh commented 3 years ago

@Signior-X Thank you for the suggestion. I will keep that in mind.

Signior-X commented 3 years ago

@shrirangpdeshmukh one thing I forgot, the changes are working good. Make the same changes in problem edit page and files. Then we will be ready to merge.

shrirangpdeshmukh commented 3 years ago

I made a similar change to the .ejs as well as .js file in problem_edit. check function was not present in the problem.js. I have added it to ensure the similar checks happen during problem edit.

pranshukharkwal commented 3 years ago

@shrirangpdeshmukh Could you also add the units of time(seconds) and memory(kb) in the problem add page. They are added in the problem edit page but not in problem add page.

Also please make time and memory limit fields numeric only, and also add some validator to not accept values equal to or lesser than 0.

shrirangpdeshmukh commented 3 years ago

Added units to Problem_Add.ejs Screenshot (737)

Changed Textarea to input type =number and added validation to it for minimum value=1

Signior-X commented 3 years ago

Cool nice work @shrirangpdeshmukh @pranshukharkwal you also check this and merge this.

pranshukharkwal commented 3 years ago

Screenshot from 2020-12-09 19-12-15 @shrirangpdeshmukh I am still able to create a problem with memory limit and time limit = 0. Like if you use the arrows, then it won't go below 1, but if you type manually, then you can enter any value, even negative. Could you please check why this is happening and how to fix it.

shrirangpdeshmukh commented 3 years ago

Okay I will look into this

shrirangpdeshmukh commented 3 years ago

Added a JS Validation the Time and Memory Limits Screenshot (739) An alert is sent for this. Screenshot (740)

pranshukharkwal commented 3 years ago

Good work @shrirangpdeshmukh Works good now, thanks :+1: