GithubHelp home page GithubHelp logo

jwpf100 / react-daily-question Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 19.61 MB

React project that loads a MD document containing multiple react questions, parses them and then serves a single question and answer at random.

JavaScript 9.34% CSS 0.08% HTML 90.59%
react

react-daily-question's Introduction

Name

Description

Project Status

Project Screen Shots

Installation and Setup Instructions

Clone down this repository. You will need node and npm installed globally on your machine.

Switch Branches:

git switch main

Installation:

npm install

To Start Gatsby Server:

gatsby start

To Visit App:

localhost:8000

Reflection

react-daily-question's People

Contributors

jwpf100 avatar

Watchers

 avatar

react-daily-question's Issues

Track Questions Answered

User Acceptance Criteria

Optional:Track which questions have been seen and remove them from the questions that appear each day.

Split out components

User Acceptance

Now that scope of project has changed, have a parent component that holds state, and the question and question list component can sit inside.

Create a testing section

User Acceptance

Create a seperate section to hold buttons that are only there to test code e.g. print things to console, clear arrays etc.

Change random function

User Acceptance

Get random function to set a random question per day. Eg. the question for March 1st 2020 is always the same, but randomly selected from the 320 available.

Store list of questions seen

User Acceptance

Create array of questions seen. This can be used to compare and turn questions green in question list (#23).

This must be stored in local storage so that it can be used to update list of questions.
Numbers may change so use question title for comparison.

  • pull in answered question array from local storage
  • - add new current question to answered question array
  • check if it's already on there

Create list of available questions

User Acceptance

Display list of available question numbers. Indicate if question has already been seen or not.

Don't worry about styling at this stage.

Handle question 328

Actually Question 326 - 329 that throw the issue as they aren't labelled correctly in the markdown. It's markdown that's the incorrect field.

image

Add Styling

  • Tailwind / SCSS / Styled Components?
  • PostCSS ?

Bug: Question 329

The final question causes the whole mdData file to be pulled through to the answer box.

Generate 'Available question array'

  • Random question array removes questions that have already been seen.
  • Checks question numbers in 'seenQuestionArray'
  • Random question generator uses this to select a new question.
  • Add in functionality to ignore blank numbers.

Front End

User Acceptance Criteria

Create a front end that shows the 'Question of the day' with the answer hidden.
Include button to reveal answer.
Include button to change question.

Set question for current day

User Acceptance

A random question is shown when launching the page, this remains the same for that day (calendar day, not 24 hr period).

  • On render check for 'current day question' in local storage, if present add to state, then:

  • If date === currentdate then display that question

  • else if date !== currentdate then generate random question number

  • Store new current day question in state.

  • Save current day question in local storage

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.