FastOlympicCoding icon indicating copy to clipboard operation
FastOlympicCoding copied to clipboard

Request for a feature

Open prabh1601 opened this issue 5 years ago • 18 comments

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.

prabh1601 avatar Sep 16 '20 15:09 prabh1601

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:

  • expected output as time: Xms or test X is not clickable
  • expected button (clickable of course) and the whole structure only appears if the target result of that case is saved

npanuhin avatar Sep 16 '20 16:09 npanuhin

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.

Jatana avatar Sep 16 '20 23:09 Jatana

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

prabh1601 avatar Sep 17 '20 02:09 prabh1601

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: изображение

npanuhin avatar Sep 17 '20 15:09 npanuhin

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 avatar Sep 17 '20 16:09 prabh1601

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

prabh1601 avatar Sep 20 '20 08:09 prabh1601

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...

npanuhin avatar Sep 22 '20 07:09 npanuhin

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.

Jatana avatar Sep 22 '20 08:09 Jatana

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 .

prabh1601 avatar Sep 22 '20 08:09 prabh1601

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

npanuhin avatar Sep 23 '20 06:09 npanuhin

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

prabh1601 avatar Sep 23 '20 11:09 prabh1601

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

npanuhin avatar Sep 29 '20 17:09 npanuhin

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 avatar Oct 05 '20 16:10 prabh1601

Hi Guys ! Any further updates ?

prabh1601 avatar Oct 16 '20 16:10 prabh1601

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.

Jatana avatar Oct 17 '20 00:10 Jatana

I appreciate your efforts man thank you

prabh1601 avatar Oct 18 '20 19:10 prabh1601

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

prabh1601 avatar Nov 24 '20 04:11 prabh1601