Giter Club home page Giter Club logo

ydkjs-exercises's Introduction

YDKJS Exercises - ydkjs-exercises.com

All Contributors Build Status codecov

Exercises built to help you test your knowledge as you read You Don't Know JavaScript.

One of the top courses on Coursera, Learning How to Learn, asserts that you can trick yourself into thinking you are learning if you don't regularly test your knowledge. It is very easy to read YDKJS all the way through and think you know it all simply because you read it. These exercises are supposed to help you determine your strengths and your weaknesses.

Current Status

This project was bootstrapped with create-react-app, and uses React Router for routing and styled components for styling. The project is active and growing! Our biggest effort currently is growing our number of exercises.

Join us on Discord! https://discord.gg/F9Cs5tW

Users, lurkers, contributers, everyone is welcome!

Short Term Vision

The immediate next steps are the following:

  1. Create 10 multiple choice questions for each chapter of each book
  2. Improve the mobile experience
  3. Improve sidebar

Long Term Vision

Longer term goals are the following:

  1. Have the questions be actual coding rather than multiple choice
  2. Curate external resources and recommend them to the user for material they need help with
  3. Analyze user competency and give recommendations accordingly

Setting up the project locally

  1. Fork and clone the repo
  2. $ npm install
  3. $ npm start

Contributing

This project is absolutely accepting pull requests (first-timers welcome!).

Check out CONTRIBUTING.md for more information and a breakdown of the code.

Contributors

Thanks goes to these wonderful people (emoji key):


Austin Tackaberry

๐Ÿ’ฌ ๐Ÿ› ๐Ÿ’ป ๐ŸŽจ ๐Ÿ“– ๐Ÿค” ๐Ÿš‡ ๐Ÿ‘€ โš ๏ธ

Thanakrit Lee

๐Ÿ“–

Kevin Y. Kim

๐Ÿ’ป

Asha20

๐Ÿ’ป

Ewe Lin Loo

๐Ÿ’ป

rosaxny

๐Ÿ’ป ๐Ÿค”

nik

๐Ÿ’ป โš ๏ธ ๐Ÿค” ๐Ÿ’ฌ ๐Ÿ‘€

kozlowsm

๐Ÿ’ป

energydev

๐Ÿ’ป ๐Ÿ› ๐Ÿค”

Jarrod Yellets

๐Ÿ’ป

Chris

๐Ÿ’ป

Nicklas Utgaard

๐Ÿ’ป

James Robinson

๐Ÿ’ป

Reuben Reyes

๐Ÿ’ป โš ๏ธ ๐Ÿ’ฌ ๐ŸŽจ ๐Ÿค” ๐Ÿ‘€

Michal Weizman

๐ŸŽจ ๐Ÿ’ป

oliverJurgen

๐Ÿ’ป

Kevin Smith

๐Ÿ’ป

Maria Esther Cuan

๐Ÿ’ป

mdncs

๐Ÿ’ป

mkozlows21

๐Ÿ’ป

Eugene Zaretskiy

๐Ÿ’ป

Syberen van Munster

๐Ÿ’ป

Randell Dawson

๐Ÿ’ป

Evan Ritscher

๐Ÿ’ป

Daniel Cortes

๐Ÿ’ป

Matt Hagner

๐Ÿ’ป

Kshitij Purwar

๐Ÿ’ป

Ty Michaels

๐Ÿ’ป

Asem

๐Ÿ’ป

This project follows the all-contributors specification. Contributions of any kind welcome!

ydkjs-exercises's People

Contributors

alexigityan avatar asemarian avatar asha20 avatar austintackaberry avatar datapoesi avatar dependabot[bot] avatar elloo avatar energydev avatar esthercuan avatar eugenez avatar jarrodyellets avatar jtmott-intel avatar kevinsmithwebdev avatar kevinyckim33 avatar kozlowsm avatar kshitijpurwar avatar mdncs avatar metreniuk avatar miaklwalker avatar mkozlows21 avatar nikrb avatar oliverjurgen avatar randybobandy92 avatar ririyad avatar rosaxxny avatar rreubenreyes avatar syberen avatar tylermroderick avatar varundey avatar xiaojianzhong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ydkjs-exercises's Issues

Sidebar should show correct answers / total answered questions

Not sure the best way to show this, however. We still want the user to see how many questions they have answered in each section and how many questions are in each chapter. Maybe at the top, it should say something like:

"You have answered 3 questions correctly and 1 question incorrectly for a score of 75%"

Disable submit and radio buttons after answer submission

Currently users are able to resubmit answers after submission. Would it not be more appropriate for the submit button - and also the radio buttons - to be automatically disabled after submission? This would be useful for when some form of score calculation feature is implemented in the future (and to also prevent cheating) ๐Ÿ˜.

I would be happy to work on this!

onSubmit show option to reveal explanation

Explanations shouldn't be immediately visible onSubmit because the user might want to try again without being told the answer. However, once the user submits an answer (correct or incorrect), they should have the option of viewing the explanation.

Use propTypes?

Small issue, I just noticed that we're not currently using propTypes in our components. Might make it easier for newcomers to navigate and contribute to the project as it grows if we did. Thoughts?

Bug: App overflows horizontally

EDIT: Was checking out another branch when I noticed this. Disregard!

Screenshot:
image

Looks like the problem is that App.css doesn't have any properties such that the App component dynamically resizes in the browser. There may also be issues with how I chose to implement the sidebar as well (Didn't use any flexbox or grid). May have missed some other CSS quirks when sniffing this one out; leave a comment if I did!

Adding URL's of specific chapter headings to each question

I love that there's a link to the chapter above every question, but I feel that since the entire book series is (so generously) shared on github - we can be even more specific.

I suggest discussing an option to add links to the section of the chapter that explains the question, like so. It could be revealed next to the answer explanation for further reading, OR shared as a hint ("Not sure? Click here to refresh your memory").

The reason for is the more complex the chapter gets, the harder it will be to locate the explanation for a specific question so I feel the general link to the chapter might be insufficient on more advanced topics.

I can think of two minor (IMO) 'cons' for this:

  1. More updates if the content of the books (specifically the headings) change.
  2. Learners might learn more if they search for additional resources on their own, rather than return to the previous resource.

Please feel free to share your thoughts. This is just a suggestion that came to me while updating new questions and looking at the question data structure. IMO even if we don't display the link in the interface right away - we could for now just add the link to the each question's object as a future option. I'm happy to help with updating URL's for existing questions, if need be.

Chapters that don't have any questions should not be clickable

This issue is a result of #72. Originally, I was going to have just Up and Going Ch3 not be clickable, since it shouldn't have any questions given that it is just a preview of YDKJS. However, as I thought about it, I realized that any chapter that doesn't have any questions shouldn't be clickable. Open for discussion ๐Ÿ™‚

Add markdown capability to allow simple styling of questions

I propose adding some simple markdown ability to the text, for example italics, bold, inline code blocks, etc. This would greatly enhance the readability and create a more polished look.

I see that there are modules like "react-markdown".

Then a style guide could be generated so we are all using them in the same why for the same types of text.

npm or yarn

@austintackaberry I just noticed we have a package-lock.json file and yarn.lock. They don't play well together, we should decide on one or the other. Could be my fault. Which shall we use?

react key prop warnings

When I ran the app I saw warnings in the console.
Warning: Each child in an array or iterator should have a unique "key" prop.
Worth a pr or a bit picky at this stage?

Answering incorrectly should not display the correct answer in green.

Currently when users submit an answer, the correct answer turns green, and if the user chose an incorrect answer, that answer would turn red.

// Question.js

              {question.answers.map((answer, i) => {
                let answerColor;
                if (answerSubmitted) {
                  if (question.correctAnswerId === answer.id) {
                    answerColor = { color: 'green' };
                  }
                  if (
                    userAnswerId == answer.id &&
                    !(question.correctAnswerId === answer.id)
                  ) {
                    answerColor = { color: 'red' };
                  }
                }

Then each answer is rendered via this line of code:

<span style={answerColor}>{answer.text}</span>

But since we'd like the users to be able to retry for the right answer, the correct answer should not change to green when users select an incorrect answer.

Please update the corresponding tests as well under src/__tests__/Question.js

[Mobile] - Overlapping text upon viewing chapters of any book

Description:
When viewing the site on a mobile device, selecting any of the six books results in overlapping text of the chapter titles.

Environment:
Device- iPhone 8
OS- iOS 11.3.1
Browser- Safari

Steps to reproduce:

  1. Navigate to ydkjs-exercises.com on a mobile device
  2. Select One of six YDKJS books
  3. View overlapping text of chapter titles

Expected Result:
Upon selecting a book title, user sees text clearly with no overlapping of characters

Actual Result:
Upon selecting a book title, user sees overlapping text that is difficult to read

Images:
screen shot 2018-05-21 at 6 08 40 pm
screen shot 2018-05-21 at 6 08 58 pm

[Bug] - Text of possible answers goes beyond border and overlaps footer text on mobile

Description:
When viewing the site on a mobile device, the text of the possible answers extends beyond the border and becomes unreadable. The possible answers overlap with the footer text as well as go beyond the previous and next buttons. This problem also affects the text displayed after the user clicks the submit button. The "Correct" and "Incorrect! Try Again!" text remains inside the border but overlaps the text of the possible answers.

Environment:
Device- iPhone 8
OS- iOS 11.4
Browser- Safari

Steps to reproduce:

  1. Navigate to ydkjs-exercises.com on a mobile device
  2. Select "Up & Going" book
  3. Select Chapter 1
  4. Navigate past question one which is small enough to fit within the question border
  5. View text of possible questions extending beyond border as well as overlapping footer text

Expected Result:
Upon viewing the question and its list of possible answers, the text should remain within the border of the question box and the should not extend beyond the "Previous" and "Next" buttons or overlap with the footer text.

Actual Result:
Upon viewing the questions on a mobile device, the answers extend beyond the border making some of the answers hard to read as they overlap with the footer.

Images:
overlappingtext1
overlappingtext2

Add explanations to existing questions

The current question format is:

{
  question: String,
  answers: Array
}

but should have explanations:

{
  question: String,
  answers: Array,
  explanation: String
}

For now, the simplest solution is to just make the explanation a string. In the future we might want to make it jsx or something, so that it is more flexible.

The user should be able to see their score on every page

Now that we are using the Context API to manage user state in App.js state, we should be able to show the user their score.

I was thinking this might be a good use case for a sidebar. As a first step, maybe it should be simple. For example, if there are 6 total questions across all books and all chapters, the user has answered 3 questions and got 1 answer correct, the sidebar could say:

"1 / 3 questions answered correctly"

Eventually, it would make sense to show more information such as breaking it down by book / chapter, providing links to the questions, etc.

Change userAnswerIndex to userAnswerId in Question component?

Now that the answers have an id and we may randomize their ordering, would it make sense to change userAnswerIndex to userAnswerId in the Question component?

class Question extends Component {
constructor() {
super();
this.state = { userAnswerIndex: null, answerSubmitted: null, error: false, correctAnswer: null };
}

Add prettier git hook to ensure consistent styling

Contributors might have different local styling configurations which is fine, but it can cause unnecessary changes that clutter up the diff.

If there was a git hook that applied a standard styling convention after committing changes, then the commits would be clean and would not include unnecessary non-standard styling changes.

Set up some sort of state management system

There needs to be a way for the app to keep track of the user's answers. Whether it is client-side state, local storage, or in a database on a server.

I feel like people won't want to have to make a username and password for this web app. Perhaps, the first step would be to have app state that gets saved in local storage. That way the user won't lose all their info when they reload the browser, and they don't have to log in.

Maybe this would be a good use case for the Context API?

Change format of questions to enforce only one correct answer

Right now the schema for a question is:

  {
    question: "How many expressions are in the following statement: a = b * 2;",
    answers: [
      {
        answer: "one",
        isCorrect: false
      },
      {
        answer: "two",
        isCorrect: false
      },
      {
        answer: "three",
        isCorrect: false
      },
      {
        answer: "four",
        isCorrect: true
      }
    ]
  }

Which is fine but this makes it easy to accidentally make 0 or more than 1 correct answer. Something like this would make it harder to make that mistake:

  {
    question: "How many expressions are in the following statement: a = b * 2;",
    correctAnswer: "four"
    incorrectAnswers: [
      {
        answer: "one"
      },
      {
        answer: "two"
      },
      {
        answer: "three"
      }
    ]
  }

Rethink layout for Question page

screenshot from 2018-06-16 00-00-15

Right now the design/layout looks clunky. Given that the explanations could get long, it might make sense for them to be below the navigation buttons, so that there is no limit to how long they can be.

We should make sure that the navigation buttons stay in the same location regardless of how long the question is, whether the explanation is shown or hidden, etc.

Maybe the navigation buttons should be to the right/left of the question rather than below it?

Open to other ideas, just think the current layout needs some help!

Need more questions!!

I'm thinking somewhere around 5 questions per chapter depending on the length/difficulty of the chapter, but open to suggestions!

All of the current questions can be found here: https://github.com/austintackaberry/ydkjs-exercises/blob/master/src/data

Drop a comment here if you are working on adding questions to a certain chapter, so that we don't have multiple people working on adding questions to the same chapter

Up & Going

  • Chapter 1: Into Programming
  • Chapter 2: Into JavaScript

Scope & Closures

  • Chapter 1: What is Scope?
  • Chapter 2: Lexical Scope
  • Chapter 3: Function vs. Block Scope
  • Chapter 4: Hoisting
  • Chapter 5: Scope Closures

this & Object Prototypes

  • Chapter 1: this Or That?
  • Chapter 2: this All Makes Sense Now!
  • Chapter 3: Objects
  • Chapter 4: Mixing (Up) "Class" Objects
  • Chapter 5: Prototypes
  • Chapter 6: Behavior Delegation

Types & Grammar

  • Chapter 1: Types
  • Chapter 2: Values
  • Chapter 3: Natives
  • Chapter 4: Coercion
  • Chapter 5: Grammar

Async & Performance

  • Chapter 1: Asynchrony: Now & Later
  • Chapter 2: Callbacks
  • Chapter 3: Promises
  • Chapter 4: Generators
  • Chapter 5: Program Performance
  • Chapter 6: Benchmarking & Tuning

ES6 & Beyond

  • Chapter 1: ES? Now & Future
  • Chapter 2: Syntax
  • Chapter 3: Organization
  • Chapter 4: Async Flow Control
  • Chapter 5: Collections
  • Chapter 6: API Additions
  • Chapter 7: Meta Programming
  • Chapter 8: Beyond ES6

Add a 404 page

Currently, when a user tries to access a route that does not exist, they get a page that looks like this:

screenshot from 2018-05-29 01-19-05

We should have a message that tells the user the page they requested does not exist. And it should probably provide a link to the home page.

Feel free to get as creative (or not creative) as you want!

incorrect question(s)

Just testing (an unrelated) pr and I noticed question has two correct answer options
book: Up & Going
chapter: 1 into programming
question: 7
First and third answer options are identical, for the purposes of the question.

Opening this issue as we should check through all the questions at some point - so if you find an issue with a question, please add it as a comment

.gitignore.exclude

Just noticed we have gained a .gitignore.exclude file ... looks the same as .gitignore to me, do we need it?

Implement sidebar changes based on previous discussions

There were previous discussions, #85 and #76, with ideas regarding Question.js and the sidebar. This issue will encapsulate the implementation of those changes. The rough mockup for the sidebar is here:

image

The stories are the following:

  • The progress section should have a progress bar that represents correct answers with green, incorrect answers with red, and unanswered questions with background color
  • The progress section should display the number of correct answers out of total answered questions, current score as a percentage, and the number of questions left to be answered
  • Each book, chapter, and question should be links
  • When the sidebar loads for the first time, only the books should be visible, and there should be a clickable right arrow to the left of each book
  • On click, the arrow next to the book/chapter switches from right to down, and the chapters/questions for that book are shown
  • Each question should show one of three icons to the left depending on whether it is correct, incorrect, or unanswered

Migrate from Material-UI to Styled Components

I think we should move away from Material-UI, and @nikrb and @IrritatedEllipses were interested in using styled components, so that is what we will use.

Not sure if we want one person to work on this for the whole app or migrate page by page? Open to thoughts.

  • Splash page
  • Book page
  • Chapter page
  • Question page

Remove "Chapter 3: Into YDKJS" from "Up and Going" page

Chapter 3 in the book "Up & Going" is basically an overview of the material that will be presented to the readers in the coming books. Given that it is just an overview, is it necessary to write questions for the chapter?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.