Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Python 3.5 Please find my Student.py file here: https://pastebin.com/03Xq329B Pl

ID: 3814259 • Letter: P

Question

Python 3.5 Please find my Student.py file here: https://pastebin.com/03Xq329B Please find my Main.py file here: https://pastebin.com/ycZH2Snr Please note all additions need to be made to Main.py only. Complete the read_data_files() function which returns a dictionary. The key of the dictionary item is the ID of a student and the value is a list of student responses from the corresponding student. Complete the start_marking(answers_list, class_list) function which takes a list of answer keysand a list of students as arguments and returns a list of marks/scores. More information on the question may be found here: https://pastebin.com/ classlist.txt may be found here: https://pastebin.com/aHJ7yHma exam.txt may be found here: https://pastebin.com/ZjKPsyv7 exam2.txt may be found here: https://pastebin.com/QkDgAK2g solution.txt may be found here: https://pastebin.com/wHTfWYzV Thank you.

Explanation / Answer

# Here is a pastebin link for code: https://pastebin.com/VKWJMxgK

from Student import *

def display_intro():
#This function prints out the heading part of the menu
message = "-"*2 + " An Exam Marking Management Program " + "-"*2
print(message)

def get_user_input(start, end):
# This function obtains a valid user input menu option.
userChoice = 0
maxValue = 6
while True:
try:
userChoice = int(input("Enter your choice: "))
except ValueError:
print("Invalid menu option.")
continue
else:
if userChoice < 1 or userChoice > maxValue:
continue
else:
return (userChoice)
def read_solution():
#This function returns a list of solution from file.
global solutions
solutions = []
try:
file=input("Enter name of the solution file: ")
with open(file) as f:
for val in f.read().split(","):
solutions.append(val)
print("Completed reading of file %s" % file)
print(solutions)
display_separator()
menu()
return
except IOError:
print("File %s could not be opened" % file)
display_separator()
menu()
return
  
  

def read_classlist():
#This function ...
global studentslist
studentslist = []
try:
file=input("Enter name of the classlist file: ")
with open(file) as f:
for line in f:
data=line.split(",")
s=Student(data[0],data[1],data[2])
studentslist.append(s)
print("Completed reading of file %s" % file)
for student in studentslist:
print(student)
display_separator()
menu()
return
except IOError:
print("File %s could not be opened" % file)
display_separator()
menu()
return

def read_data_files():
  
#This function ...
studentexam = {}
try:
file=input("Enter name of the data file: ")
with open(file) as f:
for line in f:
data=line.split(":")
studentexam[data[0]] = data[1].rstrip(",").split(",")
print("Completed reading of file %s" % file)
return studentexam
except IOError:
print("File %s could not be opened" % file)
display_separator()
menu()
return
  
def start_marking(solutions, studentslist):
#This function ...
try:
if ((not solutions) or (not studentslist)):
print("Not Enough Information!")
return
studentexams = read_data_files()
marks = 0
marksList = []
for student in studentexams:
stmarks = 0
for i in range(0, len(solutions)):
if solutions[i] == studentexams[student][i]:
stmarks += 1
marks += stmarks
marksList.append(stmarks)
print("Sum of marks: " + str(marks))
display_separator()
menu()
return marksList
except IOError:
print("File %s could not be opened" % file)
display_separator()
menu()
return

  

## You may need to add some helper functions:

  
#def display_result(class_list):
#This function ...
#print()

  
#def display_summary(marks):
#This function ...
#print("Grade Summary:")


def display_menu():
#This function prints out the menu
print("1. Read a Solution")
print("2. Read a ClassList")
print("3. Start Marking")
print("4. Display the Marking Result")
print("5. Display the Marking Summary")
print("6. Quit the program")

def display_separator():
#This function prints out the separator
lines = "-" * 40
print(lines)

solutions = []
studentslist = []
def menu():
display_menu()
display_separator()
option = get_user_input(1,6)
while option != 6:
if option == 1:
display_separator()
read_solution()
elif option == 2:
display_separator()
read_classlist()
elif option == 3:
display_separator()
start_marking(solutions, studentslist)
elif option == 4:
display_separator()
else:
display_separator()
display_separator()
display_menu()
display_separator()
option = get_user_input(1,6)
display_separator()
print("Thank you!")
raise SystemExit
  
def main():
display_separator()
display_intro()
display_separator()
menu()
display_separator()

main()

Please rate positively if this answered your query.