Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Project #2: An online quiz or analysis with conditional logic

Draft Deliverable:

A reply to your first Project 2 Discussion posting (the one containing your Lab #3 homework) that includes a clickable link to your uploaded, working quiz at digitalmedia.neu.edu/YourUserName/project2/draft You don't need to put anything in this reply except the link unless you have significantly changed your quiz and want to describe your changes and reasoning.

To ensure your files are in the right place, you should upload a folder with the below-shown file structure to folder digitalmedia.neu.edu/YourUserName/ NOTE: In these lists, if no file extension is given, that item is a folder (also called a directory). For this week, we have also included parenthetical reminders of what each file is:

· project2

 

(top-level folder)

o draft

 

(folder)

§

index.html

(your quiz form)

§

main.js

(your quiz analysis and output code)

§

flowchart.pdf

(a PDF copy of your flowchart)

NOTE: If you have the correct file structure, then you will be able to click on the provided "view my JavaScript" and "view my flowchart" links and see those items. Test your work and ask your TA if you can't get the files to show up as expected! These are really easy points that you don't want to miss out on!

Details:

For this project, you will use Boolean (conditional) logic in JavaScript to make decisions based on multiple-choice data submitted through a form. The final version of this project must:

· take data from at least 4 multiple-choice inputs -- i.e., <select> menus

IMPORTANT: at least 2 of your multiple-choice inputs must each offer at least 3 options; the rest must each offer at least 2 options

NOTE: You may additionally ask the user to input numbers via <input> fields, but these do not count towards your minimum of 4 <select> menus, nor towards your minimum of at least 3 <options> on half of them

· apply conditional (branching) logic to analyze the user's choices

· provide at least 2 more result possibilities than inputs (for example, if you have 4 questions, you must have at least 6 possible results; if you have 5 user inputs, you must have 7 possible results; etc.)

IMPORTANT: Every combination of user choices must lead to a result! Nothing should lead to a "something went wrong" choice or no output at all. You can easily avoid this happening by carefully FLOWCHARTING your work first!

You must not research any new JavaScript functions or structures for this assignment. We want you to focus on the complexities of structuring conditional logic, so you should only use the programming structures that we have covered in the first three weeks of class and lab. You do not need to write any functions for this project. If you follow the instructions in the starter code, you will only add form fields, write code to set variables, make decisions using conditional logic, and call functions output() and endOutput() to output your final results.

If you want to do additional formatting on your form, or if you want to offer the user other means of entry besides the “select” menu element that we have shown you, you may research additional HTML tags, but doing so will not earn you extra credit. We strongly suggest focusing on practicing with the elements that you've learned this week and pushing yourselves on clear and complex logical structures instead.

For this project, your grade will be primarily determined by the complexity and clarity of your Boolean logic, and by your creativity in producing your quiz or analysis. As always, “originality” and “level of challenge” are parts of the grade for this, so come up with something that challenges you to really experiment with code and that won’t be the same as everyone else's.

What Kind Of Quiz Should I Make?

The simplest version of a deliverable for this homework could be a fact-based multiple-choice quiz for which there is exactly one correct answer per question, but such a deliverable would not challenge you to explore the complexities of branching logic (you could do this version with just an if statement for each question) and would not receive a very high score. So, please push yourself to go beyond this option!

A slightly complex fact-based quiz could have multiple possible correct answers per question –e.g., for one question, the user could pick either the first or second option and be marked “correct”, while all other options for that question would be marked “wrong”. Depending on its complexity (and on your creativity), a good implementation of a quiz of this sort could earn full points— as long as it meets all of the assignment requirements!

Of course, we'd actually prefer for you to make a fun and creative quiz of your own design. Most of the examples that we're showing are Buzzfeed-style "personality quizzes", and you're encouraged to make one of those! With these quizzes, different combinations of answers yield different (often silly) information about your personality type. A quiz of this sort can earn an excellent score for creativity and level of challenge, if you design the quiz logic to be suitably complex. In other words, to score well, you need to go beyond “if a, then b" and instead have logic such as: “if a or b, then c, but if b and d, then e”.

ONLY if you are feeling confident in all of the material so far, you could also consider using additional variables in your quiz analysis in order to track patterns/quantities of answers. A simple example: a straightforward "right or wrong" quiz could have a variable called score that is increased by 1 every time your logic shows the user has gotten a question right. Tracking a single score in this way wouldn't earn you a much higher score than the simple quiz, but if you used multiple variables to track the user's level of knowledge in several areas, this could get pretty complicated! For example, you could ask the user questions about leadership, management, and communications and increment corresponding variables to "score" the user's answers in each area, with the final output of your quiz being a recommendation for what kind of job your user should seek (based on which of your variables now contains the highest value).

BEFORE YOU EVEN LOOK AT THE CODING PART ON THE NEXT PAGE, COMPLETE THE LAB#3 HOMEWORK!

You must have a working flowchart that follows all of the flowcharting rules before you begin coding your Project 2 Draft. We have provided example flowcharts and quizzes, so there is no reason to even look at the code until you've thoroughly tested your flowchart! As a reminder, a fully working flowchart will allow you to only trace one-way paths from START to END, with each path passing through only one "result" rectangle (i.e., a flowchart node that represents the output that the user will receive based on that series of choices). There must be no ambiguity about the direction of program flow (use one-way arrows and exactly one T and one F branch out of every diamond), and no path should connect START to END without providing some output for the user (i.e., a result or a message that they offered invalid input, which is only allowed if you're using a Number input).

STOP HERE IF YOU HAVE NOT YET COMPLETED YOUR FLOWCHART!

After you have double-checked your flowchart for completeness and correctness, then begin coding. It might be tempting to just start coding, but if you "debug" your flowchart before you code, then you're less likely to make coding mistakes! In addition, well-written flowchart descriptions can also be the basis for excellent code comments, and since you have to explain all of your logic this week in code comments anyway…  ¯\_(ツ)_/¯

Download project2_starter.zip, unZIP, and use Visual Studio Code customize the files as instructed here. Additionally, be sure that you follow the detailed instructions in comments in the starter code including the instructions about deleting the instructional comments!

In the index.html file, create a clearly labelled form that contains at least 4 fields (they can all be “select” popup menus, which we show how to create in the sample code) that will get processed when the user presses the button (please put in brief button text that is appropriate for your quiz). Your "labels"(which can just be <p> tags; you don't have to use the <label> tag yet, if you don't know it!) will be your quiz questions; the <select> popups will be your user's multiple-choice answers, with each answer in an <option> tag.

In the main.js file, write code inside the provided analyze() function that takes in your form input, converts any Numbers to the proper data types (remember form inputs are of type String by default!), and uses conditional logic to analyze the user's responses and decide on a result to output.

To keep things simple, please use our provided output() function to produce your output this week! We have provided a more flexible version of the function that lets you output HTML if you want, so you can be as fancy or plain as you want. You can even use the <img> tag to add images, but please only do this if you know how to format images to look reasonable as part of your output (you don't get extra points for using additional tags or anything!)

Project Week 3 Draft Submission

· Update your flowchart (see flowchart_guide.pdf for more information!)

o Make sure that your flowchart matches your code. After completing your Lab #3 homework, we recommend1 that you write the line(s) of code that correspond to each box and diamond in your flowchart next to each shape on a copy of your Lab #3. This will help to ensure that you do not break the rule that every box and diamond must represent at least one line of code! For example, if you find that you have combined two diamonds into a single line of code, then you need to either update your flowchart to reflect that or fix your code so that it matches the flowchart!

· Prepare your code for submission:

· Use the auto-formatting feature of VSCode to make your code neater and easier to read.

· Make sure that you have written code comments that describe each line of conditional logic in your program!

· Write code comments to credit any outside sources you used in developing your quiz (whether for the code or for the quiz idea)

· Remember that you can add code comments to describe any steps that you're having trouble with or any questions you have. Showing that you're thoughtfully working on the draft counts as much as having working code!

· Remove our instructional code comments

· Make sure that your project folder is correctly named and that it includes all of the files listed for this deliverable.