We have broken this assignment into 3 parts:
-
Part 1: You will create a one-question quiz. This quiz will also ask for the user's name.
-
Part 2: You will create a 5-question quiz. You will create a way to store and display questions, correct answers, and user answers.
-
Part 3: You will compare the user's answers with the correct answer and provide a final score. The score will also tell the user if they passed or failed.
The starter code contains TODO
statements to guide you. Look for them as you work through this assignment.
Part 1 is not part of the final assessment. It is used to create an MVP and work within functions.
The students do not need to update the function names, parameters, or return statements for any section of this assignment.
For this assignment, create a quiz program that meets each of the following conditions:
- Use arrays to store 5 quiz questions, the correct answers, and the candidate's answers,
- Presents each question to a "candidate" and prompt them for a response,
- Does NOT consider case when checking answers,
- Includes at least one loop and one conditional,
- Uses at least one template literal,
- Calculates the candidate's score as a percentage,
- Correctly accepts or rejects a candidate based on their percentage.
The output from the program will look similar to the following:
Instructions for running the unit tests are provided in the textbook.
Even though we are using unit tests to speed up the grading process, it is CRUCIAL that you have your student review their final code with you. This will help them build skills such as how to talk about code and confidence.
- Provided with the assignment starter code is a suite of unit tests. These provide a starting point to assess the viability of a student"s solution.
- Run the unit tests inside of the submitted repl using the command:
npm test
and select the option to run all tests. - A passing assignment will have an output of:
17 specs, 0 failures
. - This test suite is designed to give you a quick indication of which of the students' submissions meet the assignment requirements. If the output matches the above, use the section that follows as your guide for what to check in their code.
- If the number of failures is not zero, use the title of the failing test(s) as a starting point in your evaluation. Provide the student with feedback on what requirement is not met and work with them on a plan and timeline for resubmission.
- If the number of specs is not
17
, check that the student has not altered the spec file in any way. If they have, let them know that the unit tests must remain in place in order to receive a passing grade and encourage them to resubmit with an unaltered test suite. - A submission cannot be graded on unit tests alone. Use the section below as a guide for what to look for in a student's submission.
Refer to Assignment 0 for help running the autograded tests
- What does the test actually output say?
- Check for any extra or missing characters such as spaces, new lines, etc.
- Do all variable/method/etc names match what was presented in the textbook?
- Did they run all the tests or the ones for the section in question?
- Did they change a file that the instructions did not direct them to change?
- Do they need a break?
- Does the code actually pass the test(s)?
- If the code is bad, have a student explain their code to you
- Ask for a demo and provide a new test case
- For this assignment, students are required to write their code inside helper functions. Some students may put the code in the wrong helper function or not put their code inside a function at all leading to issues with running the unit tests. In this case, you may have to make sure that they have read the directions carefully and explain why programmers use helper functions.
Appearance: Does the student's output look similar to the example above?
- The output should begin with a name, end with the quiz results, and display the entered and correct answers.
- Spacing, capitalization, spelling, etc. are not particularly important, but the output should be readable.
Code check: Follow the URLs submitted via Canvas to check each student's work. A quick glance should verify the following:
- The student's code must use arrays.
- The student's code must use at least one template literal.
- The student's code must use a loop.
Run the code: Use the 3 answer sets below to check each program.
-
Case check - For the first question, entering "trUE", should be reported as a correct answer.
-
Accuracy, Percentage, and Status checks:
a. "trUE", "40", "trajectory", "Sally Ride", "3". These answers should produce a grade of 100% and a status of "passed". b. "True", "5", "orbit", "Sally ride", "10". These answers should produce a grade of 40% and a status of "failed". c. "true", "40", "", "sally ride", "3". These answers should produce a grade of 80% and a status of "passed".
If a student's work passes the unit test and meets the appearance, code check, and scoring requirements, assign them a score of 1/1 in Canvas. Next, provide feedback. Even successful code can be improved.
While not technically part of the assignment requirements, you will be an IMMENSELY helpful mentor if you provide feedback on your students' code style (spacing, variable names, etc). Encourage best practices and point out the accepted ways to make code more readable or efficient.
If a student's work misses one or more of the requirements, provide them with detailed feedback about which parts need to be improved. Also, let the student know that they need to make corrections to their assignment before re-submitting.