Survive the QuizPocalypse, one question at a time!
- Log in to your GitHub account using a web browser.
- Fork this repository to your own account.
- Download and setup GitHub Desktop and sign in with your GitHub account.
- Clone your forked repository using GitHub Desktop.
- Open the cloned repository in Visual Studio Code.
-
Create a new
.jsfile in the js/modules folder, with your first name as the file name (e.g. "john.js"). -
Add your quiz module, following the given format:
export default { state: { profile: { username: "your-github-username", fullName: "Your Full Name", }, items: [ { question: "Question 1", choices: { A: "Choice 1", B: "Choice 2", C: "Choice 3" }, correct: "A" }, ] }, getters: { profile: state => state.profile, items : state => state.items }, namespaced: true };
You can also look at arvic.js for reference.
-
Extend the
itemsarray to hold at least 10 multiple-choice questions about technology, application development, or zombies.Each item object should have a
question,choices, andcorrectproperties as shown below:{ question: "Question 1", choices: { A: "Choice 1", B: "Choice 2", C: "Choice 3" }, correct: "A" }
-
Import your module to the store.js file.
For example:
// modules import arvic from './modules/arvic.js'; // import your .js file here (e.g. import john from './modules/john.js') import john from './modules/john.js'; const store = Vuex.createStore({ modules: { arvic, // include your module here (e.g. john) john, } }); export default store;
Open the project in
Live Server
or
http-server
to test your quiz,
as directly opening index.html in the browser may result in a
CORS error.
To use Live Server:
-
Install the Live Server extension for Visual Studio Code. To do this, open Visual Studio Code, click on the Extensions button on the left side panel, and search for "Live Server". Install the first result by Ritwick Dey.
-
Open the HTML file you want to view in Live Server.
-
Right-click on the HTML file in the Visual Studio Code editor and select "Open with Live Server" from the context menu.
-
This should launch your default web browser and display the HTML file you selected.
Note: If you do not see the "Open with Live Server" option in the context menu, you may need to restart Visual Studio Code
To use http-server:
- Download and install Node.js if you haven't already.
- Install http-server globally using the terminal with the command:
or with elevated privilege by adding "sudo" for Mac:
npm install http-server -gsudo npm install http-server -g - Navigate to the folder containing the
index.htmlin the terminal. - Start the http-server with the command:
http-server - Access the application by opening a web browser and entering the URL: http://localhost:8080.
- Commit and Push changes to your fork.
- Make a Pull Request to the original repository.