fac20 / week10-kj Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://how-seal-y.netlify.app
Home Page: https://how-seal-y.netlify.app
Accessibility 100!! Good job!!
Time is not long enough to read the questions and think about the right answer.
e.g. A button to add more users to your collection
Really live the idea and the punny name
The sessions must have a timer at the top - 30 secs for each question
week10-KJ/src/components/PlayGame/Quiz.js
Lines 30 to 38 in fb29040
This is kind of a subtle React philosophy thing, but you should generally be suspicious if your code ever has to touch the real DOM. React is designed to handle all DOM updates for you, so if you're ever doing a querySelector
or directly changing classNames etc that's usually something to avoid.
Remember your component re-runs whenever state changes, which means you can put conditions and dynamic stuff into your JSX to determine e.g. what classNames elements should have. You just need to have state values that let you know what to render.
E.g.
{shuffledChoices.map(choice => (
<button
// if we have chosen this button, then if the answer is correct make it green otherwise red
className={selectedChoice === choice && (selectedChoice === correct_answer ? "green" : "red")}
onClick ={() =>{
setSelectedChoice(choice); // store the selected choice in state
setIndex(index + 1)
}}
>
{choice}
</button>
))}
Generally React updates are a lot easier to manage if you do as little logic as possible in event handlers and try to just make them simple state updates. You can then use the updated state in your render to determine what the page should look like.
We couldn't get them to work but it's good that you have them ππΎ
Nice structured file tree
so you can leave the page and come back later
Integration tests mainly
The code was a little difficult to follow but that's probably due to our lack of understanding of react that your code
This is also something we forgot to do but comments would've helped us understand the code more.
We couldn't understand what you were doing with the array of correct and incorrect answers.
Options are too small to read and they move quite fast.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.