Compare commits
2 commits
ed78e73c34
...
7a227dc1f4
Author | SHA1 | Date | |
---|---|---|---|
7a227dc1f4 | |||
1000ffaca6 |
1 changed files with 38 additions and 0 deletions
38
main.py
38
main.py
|
@ -0,0 +1,38 @@
|
||||||
|
import firepup650 as fp
|
||||||
|
|
||||||
|
fp.replitCursor = fp.bcolors.REPLIT + "> " + fp.bcolors.RESET
|
||||||
|
|
||||||
|
answerKey = []
|
||||||
|
answer = "0"
|
||||||
|
answerCount = 0
|
||||||
|
|
||||||
|
fp.clear()
|
||||||
|
|
||||||
|
while not False:
|
||||||
|
answer = fp.replitInput(
|
||||||
|
f"Please input the answer to question #{answerCount + 1}, empty answer to submit answer key"
|
||||||
|
)
|
||||||
|
if not answer:
|
||||||
|
break
|
||||||
|
answerCount += 1
|
||||||
|
answerKey.append(answer)
|
||||||
|
|
||||||
|
fp.clear()
|
||||||
|
|
||||||
|
while 1:
|
||||||
|
right = 0
|
||||||
|
try:
|
||||||
|
for i in range(answerCount):
|
||||||
|
answer = fp.replitInput(
|
||||||
|
f"Please input the student's answer to question {i + 1}. ^C at any time to show results immediately."
|
||||||
|
)
|
||||||
|
if answer == answerKey[i]:
|
||||||
|
right += 1
|
||||||
|
print(" That is correct")
|
||||||
|
else:
|
||||||
|
print(" That is incorrect")
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
pass
|
||||||
|
print(
|
||||||
|
f"\nThe student got {right}/{answerCount} correct, with approximately an {round((right/answerCount) * 100, 2)}%.\n"
|
||||||
|
)
|
Loading…
Reference in a new issue