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

Validity of some questions. #63

Open
tinnerdxp opened this issue Apr 21, 2018 · 7 comments
Open

Validity of some questions. #63

tinnerdxp opened this issue Apr 21, 2018 · 7 comments

Comments

@tinnerdxp
Copy link

During the few weeks of usage I have noticed that some questions and answers could be improved.
I obviously appreciate the effort of having this in general and would like to thank the authors for their efforts - it is a great help indeed.

I wonder whether we should just submit PRs for either grammar / typos / validity of some questions?
I guess it's a massive topic to discuss so I would like to know your opinions first.

Example 1:

Symfony pack - Twig - In twig, what do you use if you want to optimize the size of the generated HTML content? This question IS NOT multiple choice.
  [0] spaceless
  [1] operators
  [2] gzip

The correct answer (in my opinion) is "spaceless" even though the accepted answer is "gzip".
Twig doesn't have any capabilities to gzip the output... it's down to the framework underneath or the web-server returning the response.

Example 2:

Question #4 [Automated tests] What command used for run all of your application tests by default? 
This question IS NOT multiple choice.

  [0] phpunit
  [1] phpunit -c app/
  [2] phpunit -c
  [3] phpunit app/

As per: https://symfony.com/doc/current/testing.html the answer should be probably
./vendor/bin/simple-phpunit
but all the existing answers depend on how phpunit was installed as well as where the phpunit.xml file is located... (I think?)

Example 3: (from PHP pack though)

uestion #8 [Basics] Which of the following are valid PHP variables? 
This question IS multiple choice.

  [0] $0x0
  [1] ${0x0}
  [2] &$variable
  [3] @$foo

Even though ${0x0} is not considered a valid PHP variable - it actually works in all version of PHP from 4.x to 7.2 as long as one refers to it using the ${0x0} notation. so the correct answers should be ${0x0} and @$foo instead of @$foo and &$variable - which causes an error.

Example 4:

Question #6 [HTTP Cache] Which HTTP headers belongs to validation cache model? 
This question IS multiple choice.
  [0] ETag
  [1] Cache-Control
  [2] Cookie
  [3] Expires
  [4] Last-Modified

Accepted answers are: ETag, Last-Modified
I'm not sure what the "validation cache model" is - but if it is a method of controlling browser caching - then Cache-Control and Expires should probably be there as well. If it means "methods of validating the cache" then Expires is a probable candidate. Again - I might be wrong on this - but it's very "tricky" question...
Think 4 is enough to get your opinion on things.
Cheers
KP

@jockhip12
Copy link

jockhip12 commented Aug 29, 2019

Hello @tinnerdxp,

Thank you for your comment and I think also that some responses should be improved.
But for your first example, I think that you are wrong according to the Symfony documentation:

This tag (spaceless) is not meant to "optimize" the size of the generated HTML content but merely to avoid extra whitespace between HTML tags to avoid browser rendering quirks under some circumstances.

If you want to optimize the size of the generated HTML content, gzip compress the output instead

For more information: https://twig.symfony.com/doc/2.x/filters/spaceless.html

Cheers

@er1z
Copy link

er1z commented Aug 30, 2019

@jockhip12 — yeah, but how the Twig could compress output itself?

@jockhip12
Copy link

jockhip12 commented Aug 30, 2019

@jockhip12 — yeah, but how the Twig could compress output itself?

I didn't get your question, but you can find more details here :
https://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/

@er1z
Copy link

er1z commented Aug 30, 2019

I know how the gzipping output works. The matter is how do you trigger gzipping within Twig because this is what is everything about question.

Twig has no option on this because it's only templating engine, not a response handler.

@jockhip12
Copy link

jockhip12 commented Aug 30, 2019

The matter is how do you trigger gzipping within Twig

I got your point, and honestly I don't have an answer :/

@JuGid
Copy link

JuGid commented Sep 12, 2021

I would like to add an answer that might be wrong in controller.yml. That's a small contribution, but hope it helps as well.

question: 'Which of these response objects does not exists?'
        answers:
            - {value: XmlResponse,        correct: true}
            - {value: FileResponse,        correct: true}
            - {value: TwigResponse,        correct: true}
            - {value: JsonResponse,       correct: false}
            - {value: BinaryFileResponse, correct: false}
            - {value: RedirectResponse,   correct: false}
            - {value: StreamedResponse,   correct: false}
        help: |
            'https://symfony.com/doc/current/components/http_foundation.html#response'

From the documentation of the v5.3, this JsonResponse exists : https://symfony.com/doc/current/components/http_foundation.html#creating-a-json-response

@20uf
Copy link
Member

20uf commented Aug 2, 2022

Hello,

I invite you to make a PR with your different proposals.

Have a good day :)

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

No branches or pull requests

5 participants