Commit 6298f061 authored by LammLukas's avatar LammLukas

Added generate_random_participant and generate_random_participant_list to participant class

parent c393a9d7
......@@ -4,7 +4,8 @@ Parent class for participant objects.
Author: L. Lamm (
from src.exportable import Exportable
from randomuser import RandomUser
from random import randint
class Participant(Exportable):
"""Class for object of type Participant"""
......@@ -23,3 +24,20 @@ class Participant(Exportable):
self.Grade = 0
self.Bonus = 0
self.Annotation = ""
def generate_random_participant():
"""Generates a random participant using randomuser package"""
user = RandomUser()
participant = Participant(firstname=user.get_first_name(),
matriculation=randint(300000, 500000))
return participant
def generate_random_participant_list(num_participants):
lst = []
for i in range(0, num_participants-1):
return lst
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment