Having trouble with the scores_on_pretest
function.
If I input two names, say Joe and Bob, when the script reaches this function it asks for the score for Question #1 for Joe and then Question #1 for Bob, then Question #2 for Joe etc.
What I want to do is have all the questions for just Joe first and then move on to Bob. I know it must be an expression in the wrong place but can't seem to find which one.
Thanks for any suggestions!
students_pretest = []
print "First we will collect the student names on the pre-test."
def student_names_pretest():
while True:
name = raw_input("Type in a name or type 'done':")
if name == "done":
break
students_pretest.append(name)
students_pretest.sort()
print students_pretest
student_names_pretest()
pretest_scores = {}
for name in students_pretest:
pretest_scores['%s' % name] = []
question_number = int(raw_input("How many questions are on this assessment?: "))
def scores_on_pretest():
current_question = 1
while current_question <= question_number:
for student in pretest_scores:
print "Pre-test scores for %s" % student
score = int(raw_input("Enter a score for Question #%d: " % current_question))
pretest_scores[student].append(score)
current_question =+ current_question + 1
print pretest_scores
scores_on_pretest()