I am receiving an error in github where my gradeQuiz is returning zero and not the grade. I know that the grade is being returned from the function because I use its updated value outside of the function. Here is my replit link. https://repl.it/@TyeFraz/assignment-1-candidate-testing-TyeFraz-1#candidate-testing.js
I think you should move some of your code around.
Your full grading-related code (this means the total % + success result) should be in the gradeQuiz() and not in runProgram(). Move your code up & rewrite it to make sure it works. That should clear up some of the issues. Good luck! You are super close!
I am down to one error, but it’s got me stumped. This is the error:
Error: Expected [ 'Who was the first American woman in space? ', 'True or false: 5 kilometer == 5000 meters? ', '(5 + 3)/2 * 10 = ? ', 'Given the array [8, “Orbit”, “Trajectory”, 45], what entry is at index 2? ', 'What is the minimum crew size for the ISS? ’ ] to contain 'Given the array [8, ‘Orbit’, ‘Trajectory’, 45], what entry is at index 2? '.
It’s only tripping on the quotation marks around ‘Orbit’ and ‘Trajectory’, but it I change the quotation marks then the program thinks they are each a function and won’t run which gives a different error. Do you know of a way around this?
So I am thinking that you should just copy/paste what the auto-grader is expecting off your code so you don’t run into those issues. Just dump that in your questions array. Then you’ll code your question # as you iterate through them. I do believe that’s what’s expected. (that’s what I did)
check back again but so long as it didn’t break anything in your code you should get green checked through!
If I bring up that last if statement it will get added to the the loop and print every time the gradeQuiz function runs. I thought it was only supposed to print once after the grading has been done. This gradeQuiz returning zero is my last error. I even tried setting grade = to the function. The grade prints properly so I know gradeQuiz is returning the right values.
I understand the issue but IDK that you can pass auto-grader with the way you laid out your code. Everything tied to the questions + user answers + correct answers should be in askQuestion(), everything tied to grade calculation should be in gradeQuiz() and runProgram() shouldn’t have any added code outside of 1.1c & code that I think you removed:
If you are confident that your code works then I’d submit it like that but you have deleted parts of it.
I am trying to add everything to gradeQuiz but I am running into this error. So I can’t even test the program.
You left parts of your if statement tied to your grade so you have random code that the terminal doesn’t know what to do with. That’s why you get an error matching your last code line.
Move that part where I am showing on the screenshot below & start debugging b/c things aren’t properly working. You have most of it done you just need to clean it up.
Thanks! I got it running again. gradeQuiz seems to be returning values in github.Now I have to to make them the right values. My grading is done after all the questions have completed but Github doesn’t seem to be bothered by that.