Jatana / FastOlympicCoding

Tools for competitive programming for Sublime Text 3 & 4
399 stars 48 forks source link

Request for a feature #19

Open prabh1601 opened 3 years ago

prabh1601 commented 3 years ago

Hey Janata, I just wanted to give a request for a feature such that we can also see the expected outcome / output for the cases within the plugin . Just a little window beneath the testcases would do.

npanuhin commented 3 years ago

Hello! Nice idea. In my opinion, this should be implemented as another button (next to "run" and "edit"):

[ test 0 ]  [ edit ]  [ run ]  [ expected ]  [ time: 69ms ]

and expected toggles between this:

[ test 0 ]  [ edit ]  [ run ]  [ expected ]  [ time: 69ms ]
test input

test output
[ decline ]

and this:

[ test 0 ]  [ edit ]  [ run ]  [ expected ]  [ time: 69ms ]
test input

test output

[ expected output: ]
expected output
[ decline ]

Also:

Jatana commented 3 years ago

Hi!

I think it is an interesting idea to add the expected output feature.

However, the test bar already contains test number, edit, run, and time, so adding the expected button there would be too much. An alternative to a button could be a key binding, a menu option, or something else.

So, I am open to suggestions about the best way to integrate this feature.

prabh1601 commented 3 years ago

Hi Nikita and Janata!

Considering nikita its a good feature to have a button for the same I think it should be like that only because sometimes output can stretch in cases of displaying arrays / strings etc and you always wont want to see a stretched window . But also I think Janata has a fully valid point here.

In my opinion a button besides the accept/decline button can do the job.

Also I would be very happy to have better ideas for the same

npanuhin commented 3 years ago

I added an expected output button after decline and I think it looks and works well. But I can't figure out how actions work. (Also, why is there a list of expected results for each test case?)

Jatana, could you, please, implement toggling the expected result when this button is clicked (href: click-expected)?

When there is no expected result: изображение

When there is an expected result: изображение

prabh1601 commented 3 years ago

This looks neat. I guess once Janata give a green flag to this implementation and also fixes the issues that you are getting it would great one to have.

prabh1601 commented 3 years ago

Hey Nikita and Janata ! Are there any updates for the same ?

npanuhin commented 3 years ago

Hello! The problem is that you can actually store multiple correct answers for a single test. Then the only option is to print the expected output only if there is only one such possible output. Currently, I have not figured out what to do if there are several of them...

Jatana commented 3 years ago

I think printing one of the correct answers could be a solution because in most cases there is only one correct answer to a test.

prabh1601 commented 3 years ago

I agree with the point of Janata .. almost of the sample cases that are provided at a site are provided with a single test case answer but however pertaining to the point of Nikita I think just showing the first correct answer can be a viable option .

npanuhin commented 3 years ago

Ok, thank you. I will try to implement this in the nearest future.

prabh1601 commented 3 years ago

Oh thats great, I would be looking forward to hear from you soon .

npanuhin commented 3 years ago

Hello! @Jatana, I still can't figure out how to insert text into an existing layout (i.e. just a page). Please help with this :)

PS: If it will be a bit helpful, I added a boolean expected_output_toggledvariable and a function get_correct_answer for the Test class

prabh1601 commented 3 years ago

Hi @npanuhin @Jatana ! I appreciate the efforts being put into my request and really thank you for it. Just wanted a little update that how are things going

prabh1601 commented 3 years ago

Hi Guys ! Any further updates ?

Jatana commented 3 years ago

Sorry, I've been extremely busy this and previous month. I'll try to find some time in the upcoming days to implement the feature.

prabh1601 commented 3 years ago

I appreciate your efforts man thank you

prabh1601 commented 3 years ago

Hi @Jatana @npanuhin ! Just wanted to ask if there are any plans for this feature to be encorporated in the further updates ?