Assignment 1 - Struggling to Address Seemingly Minor Issues

Hello,

I have the questions correctly being relayed to the user and the corresponding case-insensitive input clearly being received and correctly evaluated. However, I have two (at present) issues:

  1. Each question iteration also carries the following question, as well as that question’s corresponding user input, correct answer, and evaluated answer. While I can comment out the evaluated section, I am looking for external input :slight_smile: on the matter. It seems very likely to be something with the loops, but none of the changes I have made correctly address it. Additionally, I’ve noticed some glitchiness with Repl.it so I’m not sure if that is currently a factor.
  2. Similarly the grading calculation is starting after question 1 (not registering the result). Again I believe it has to do with my loop construction, however based upon the text, I am unsure of what is amiss. Any feedback is appreciated. I have attached a link to my repl.it, and an example of the output for reference below. I feel as though I am close, but this is certainly rife with ups and downs. Ironically emotional, coding is.

candidate-testing

So at first I removed the loop that was causing the accumulated input/output and grades. then I removed the call to gradeQuiz within askQuestion that was doubling the “>>> Overall Grade:…” output, along with outputting the return value for grade. My output now matches the example. The next steps are to remove the unwanted, commented-out code, and attempt submission. I have included an example of the new output for reference. Hopefully this helps someone else.

image

Example showing failure if < 80.

In the event anyone reads this, I have attached the multitude of errors encountered with the first pass through github. Any feedback is appreciated:

3s

1Run education/autograding@v1

4

5::stop-commands::5909c6f5-894a-4744-a123-ba43030c5029

6

7:memo: Autograding Unit Tests

8

9

10 added 14 packages from 5 contributors and audited 14 packages in 0.518s

11

12 1 package is looking for funding

13 run npm fund for details

14

15 found 0 vulnerabilities

16

17

18

19 > candidate-testing@1.0.0 test /home/runner/work/assignment-1-candidate-testing-Benjamin-Memnoch/assignment-1-candidate-testing-Benjamin-Memnoch

20 > jasmine

21

22 Randomized with seed 10193

23 Started

24 .>>> Overall Grade: 40% (2 of 5 responses correct) <<<

25 >>> Status: FAILED <<<

26 F>>> Overall Grade: 20% (1 of 5 responses correct) <<<

27 >>> Status: FAILED <<<

28 FF>>> Overall Grade: 80% (4 of 5 responses correct) <<<

29 >>> Status: PASSED <<<

30 F.F>>> Overall Grade: 60% (3 of 5 responses correct) <<<

31 >>> Status: FAILED <<<

32 F.>>> Overall Grade: 100% (5 of 5 responses correct) <<<

33 >>> Status: PASSED <<<

34 F…>>> Overall Grade: 0% (0 of 5 responses correct) <<<

35 >>> Status: FAILED <<<

36 .>>> Overall Grade: 100% (5 of 5 responses correct) <<<

37 >>> Status: PASSED <<<

38 F

39

40 Failures:

41 1) Candidate Testing solution gradeQuiz returns 40 for two correct answers

42 Message:

43 Expected 2 to be 40.

44 Stack:

45 Error: Expected 2 to be 40.

46 at

47 at UserContext. (/home/runner/work/assignment-1-candidate-testing-Benjamin-Memnoch/assignment-1-candidate-testing-Benjamin-Memnoch/spec/candidate-testing.spec.js:80:59)

48 at

49

50 2) Candidate Testing solution gradeQuiz returns 20 for a single correct answer

51 Message:

52 Expected 1 to be 20.

53 Stack:

54 Error: Expected 1 to be 20.

55 at

56 at UserContext. (/home/runner/work/assignment-1-candidate-testing-Benjamin-Memnoch/assignment-1-candidate-testing-Benjamin-Memnoch/spec/candidate-testing.spec.js:75:59)

57 at

58

59 3) Candidate Testing solution questions contain the provided questions with trailing spaces

60 Message:

61 Expected [ ‘Who was the first American Woman in space?’, ‘True or False: 5000 meters == 5 kilometers?’, ‘(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 'Who was the first American woman in space? '.

62 Stack:

63 Error: Expected [ ‘Who was the first American Woman in space?’, ‘True or False: 5000 meters == 5 kilometers?’, ‘(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 'Who was the first American woman in space? '.

64 at

65 at UserContext. (/home/runner/work/assignment-1-candidate-testing-Benjamin-Memnoch/assignment-1-candidate-testing-Benjamin-Memnoch/spec/candidate-testing.spec.js:41:30)

66 at

67 Message:

68 Expected [ ‘Who was the first American Woman in space?’, ‘True or False: 5000 meters == 5 kilometers?’, ‘(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 'True or false: 5 kilometer == 5000 meters? '.

69 Stack:

70 Error: Expected [ ‘Who was the first American Woman in space?’, ‘True or False: 5000 meters == 5 kilometers?’, ‘(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 'True or false: 5 kilometer == 5000 meters? '.

71 at

72 at UserContext. (/home/runner/work/assignment-1-candidate-testing-Benjamin-Memnoch/assignment-1-candidate-testing-Benjamin-Memnoch/spec/candidate-testing.spec.js:42:32)

73 at

74 Message:

75 Expected [ ‘Who was the first American Woman in space?’, ‘True or False: 5000 meters == 5 kilometers?’, ‘(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 '(5 + 3)/2 * 10 = ? '.

76 Stack:

77 Error: Expected [ ‘Who was the first American Woman in space?’, ‘True or False: 5000 meters == 5 kilometers?’, ‘(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 '(5 + 3)/2 * 10 = ? '.

78 at

79 at UserContext. (/home/runner/work/assignment-1-candidate-testing-Benjamin-Memnoch/assignment-1-candidate-testing-Benjamin-Memnoch/spec/candidate-testing.spec.js:43:32)

80 at

81 Message:

82 Expected [ ‘Who was the first American Woman in space?’, ‘True or False: 5000 meters == 5 kilometers?’, ‘(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? '.

83 Stack:

84 Error: Expected [ ‘Who was the first American Woman in space?’, ‘True or False: 5000 meters == 5 kilometers?’, ‘(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? '.

85 at

86 at UserContext. (/home/runner/work/assignment-1-candidate-testing-Benjamin-Memnoch/assignment-1-candidate-testing-Benjamin-Memnoch/spec/candidate-testing.spec.js:44:32)

87 at

88 Message:

89 Expected [ ‘Who was the first American Woman in space?’, ‘True or False: 5000 meters == 5 kilometers?’, ‘(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 'What is the minimum crew size for the ISS? '.

90 Stack:

91 Error: Expected [ ‘Who was the first American Woman in space?’, ‘True or False: 5000 meters == 5 kilometers?’, ‘(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 'What is the minimum crew size for the ISS? '.

92 at

93 at UserContext. (/home/runner/work/assignment-1-candidate-testing-Benjamin-Memnoch/assignment-1-candidate-testing-Benjamin-Memnoch/spec/candidate-testing.spec.js:45:32)

94 at

95

96 4) Candidate Testing solution gradeQuiz returns 80 for four correct answers

97 Message:

98 Expected 4 to be 80.

99 Stack:

100 Error: Expected 4 to be 80.

101 at

102 at UserContext. (/home/runner/work/assignment-1-candidate-testing-Benjamin-Memnoch/assignment-1-candidate-testing-Benjamin-Memnoch/spec/candidate-testing.spec.js:90:59)

103 at

104

105 5) Candidate Testing solution candidateAnswer is a string

106 Message:

107 Expected ‘object’ to be ‘string’.

108 Stack:

109 Error: Expected ‘object’ to be ‘string’.

110 at

111 at UserContext. (/home/runner/work/assignment-1-candidate-testing-Benjamin-Memnoch/assignment-1-candidate-testing-Benjamin-Memnoch/spec/candidate-testing.spec.js:31:43)

112 at

113

114 6) Candidate Testing solution gradeQuiz returns 60 for three correct answers

115 Message:

116 Expected 3 to be 60.

117 Stack:

118 Error: Expected 3 to be 60.

119 at

120 at UserContext. (/home/runner/work/assignment-1-candidate-testing-Benjamin-Memnoch/assignment-1-candidate-testing-Benjamin-Memnoch/spec/candidate-testing.spec.js:85:59)

121 at

122

123 7) Candidate Testing solution gradeQuiz is case insensitive

124 Message:

125 Expected 5 to be 100.

126 Stack:

127 Error: Expected 5 to be 100.

128 at

129 at UserContext. (/home/runner/work/assignment-1-candidate-testing-Benjamin-Memnoch/assignment-1-candidate-testing-Benjamin-Memnoch/spec/candidate-testing.spec.js:95:59)

130 at

131

132 8) Candidate Testing solution gradeQuiz returns 100 for all correct answers

133 Message:

134 Expected 5 to be 100.

135 Stack:

136 Error: Expected 5 to be 100.

137 at

138 at UserContext. (/home/runner/work/assignment-1-candidate-testing-Benjamin-Memnoch/assignment-1-candidate-testing-Benjamin-Memnoch/spec/candidate-testing.spec.js:70:59)

139 at

140

141 17 specs, 8 failures

142 Finished in 0.022 seconds

143 Randomized with seed 10193 (jasmine --random=true --seed=10193)

144npm ERR! Test failed. See above for more details.

145

146:x: Autograding Unit Tests

147::error::Error: Exit with code: 1 and signal: null

148

149::5909c6f5-894a-4744-a123-ba43030c5029::

150Points 0/1

151

So I resolved all the errors, and ultimately it looks like the autograder is looking specifically for the grade variable (I had handled the calculations with a differently named variable), along with particular spacing in the questions. Terrence (sp?) covered this in the slack videos he made, and I either missed the one about the assignment listing question 2 being as “True or false: 5000 meters = 5 kilometers.” though the grader looking for "True or false: 5 kilometer == 5000 meters? "; (no semicolon at the end, that is part of this sentence) or it wasn’t covered. Anyhow, hopefully this helps others.

1 Like

Thank you everyone for the silent support. :slight_smile: