Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- puts " "
- puts "Welecome to my test managment system"
- select = 0
- while (select =!6)
- puts "Press 1 to register a new user (student)"
- puts "Press 2 to register a new admin (teacher)"
- puts "Press 3 to make new questions"
- puts "Press 4 to take the multiple choice test "
- puts " 5 to exit"
- select=gets.to_i
- if (select==1)
- class Registerstudent
- def initialize(username,password)
- @username = username
- @password = password
- end
- end
- class Registerlistlist < Registerstudent
- def initialize(username, password)
- super(username, password)
- end
- def get_item
- puts " You are now created in the system with the following information
- Username: #{@username} " "Password: " " #{@password} "
- puts "n The following information is now saved in the Registration file"
- end
- end
- puts "Welcome to the registration of the new multiple choice program! "
- puts "Please enter your desired username"
- username = gets.chomp
- puts "Please enter your desired password"
- password = gets.chomp
- beit = Registerlistlist.new(username,password)
- puts beit.get_item
- f = File.new("Registration.txt", "a+")
- f.puts(@username, @password)
- f.close
- puts "n The following information is now saved in the student Registration
- file"
- elsif (select == 2)
- class Registeradmin
- def initialize(username1,password1)
- @username1 = username1
- @password1 = password1
- end
- end
- class Registerlistlistteacher < Registeradmin
- def initialize(username1, password1)
- super(username1, password1)
- end
- def get_item
- puts " You are now an admin with the following login informaion
- Username: #{@username1} " "Password: " " #{@password1} "
- puts "n The following information is now saved in the Registration file"
- end
- end
- puts "Welcome to the registration of the new multiple choice program! "
- puts "Please enter your desired username"
- username1 = gets.chomp
- puts "Please enter your desired password"
- password1 = gets.chomp
- teacher = Registerlistlistteacher.new(username1,password1)
- puts teacher.get_item
- f = File.new("Registrationteacher.txt", "a+")
- f.puts(@username1, @password1)
- f.close
- puts "n The following information is now saved in the teacher Registration file"
- end
- end
Add Comment
Please, Sign In to add comment