Non, je n'ai pas l'intégralité des échanges, mais voici quelques exemples:
Fix the missing div and classes in the component
Wait a few milliseconds before switching to the next question when the user answers
During this time, change the color of the button using a css class.
Use coherent colors, make the color different when the answer was right and when it was wrong.
Use react instead of direct dom manipulation to handle classes
Create a new GameInProgress.css stylesheet just for this component where you handle button colors, and import it in the component Answer with just two code blocks, for the js and for the css:
Add the "correct" or "incorrect" class only when the button is clicked, wait 50ms before switching to the next question.
When the button is clicked, we need to first change the class, then wait 50ms, then call the rest of the code to handle the answer selection. Also, we need to do that using only react, no direct dom manipulation. In NO case should the answer be given to the user before they clicked a button. Respond with only the JSX.
Change the CSS to make the transitions smooth during the 100ms interval where the correct answers are shown.
The main title of the page is displayed too high, it is half cut. How to fix that in the main CSS ?
It's still not displayed in full, the top appears cropped
Thanks, it's better, but there is still not enough space at the top of the page
Here is a list of questions for a quizz game...
Generate a JSON containing 10 more questions in the same style.
Write a JSON file containing 10 more questions and answers in the same format and in the same style. All the questions should be about the present or past foreign policy of the US, contain some degree of irony, and make the player think about the human lives that were lost or destroyed because of such policies.
jsx [le code d'un composant] Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot. Fix it
Let the user play with the keyboard, using idiomatic react code and no direct dom manipulation
We need the same logic of displaying the answers on the buttons, and waiting 100ms, to be executed when an answer is selected by clicking on a button, and when it is selected via the keyboard.
Change both the parent and the child to avoid passing more information than needed to functions and make the lives of children components as easy as possible. Remove unneeded variables.
Write a new component that will be displayed before the game starts, will contain a single button to start the game, and will be styled with the same stylesheet as the rest of the game. It explains the rules of the game, and explains that all the code for the game and all the questions were written by an AI. Use a sarcastic tone.
Write the full code without stopping in the middle. Specify that the user has 30 seconds to answer as many questions as possible.
Write the parent component, called App.
Fix index.js to mount the right component
Fix the intro component so that it is wrapped in the right element, and isn't too wide.
Good. Don't remove the instructions and the export that were there before. Also "you only have 30 seconds to answer each question and as many questions as possible" is not very clear, improve the formulation
[^] # Re: Pas moi apparemment
Posté par lovasoa (site web personnel) . En réponse au journal Est-ce qu'une IA peut choisir la licence du code qu'elle écrit ?. Évalué à 10. Dernière modification le 05 décembre 2022 à 16:23.
Non, je n'ai pas l'intégralité des échanges, mais voici quelques exemples:
jsx [le code d'un composant]Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot. Fix it