# 선생님의 질문 입력 받기 def teacher_question(): question = input("Enter your question: ") return question # 학생들의 음성 녹음 및 저장 def record_student_voice(student_name, question, voice): # 음성 파일 저장 file_path = f"recordings/{student_name}_{question}.wav" os.makedirs("recordings", exist_ok=True) with open(file_path, "wb") as f: f.write(voice) # 음성 파일 경로 저장 if question in recordings: recordings[question].append(file_path) else: recordings[question] = [file_path] return "Voice recorded successfully!" # 저장된 음성 재생 def play_recorded_voice(question): if question in recordings: print("Available recordings:") for index, file_path in enumerate(recordings[question], start=1): print(f"{index}. {file_path}") else: print("No recordings available for this question.") # 음성에 대한 코멘트 작성 def write_comment(question, comment): # 코멘트 저장 등의 추가적인 작업 수행 가능 return f"Comment '{comment}' added successfully for question '{question}'." # 선생님의 질문 입력 question = teacher_question() # 학생들의 음성 녹음 및 저장 student_name = input("Enter your name: ") record_student_voice(student_name, question, b"Dummy voice data") # 저장된 음성 재생 play_recorded_voice(question) # 코멘트 작성 comment = input("Write your comment: ") write_comment(question, comment)