You are on page 1of 3

//Login Pseudocode

begin

valid_input_password := false
valid_input_username := false
logged_in := false

while (logged_in = false) do


begin
print("Please enter Username: ") //Input Username
readln(inputted_username)
writeln("Please enter Password: ") //Input Password
readln(inputted_password)

//begin matching process

if inputtted_username is in Login_Dictionary then


//match inputted login details with each existing valid set of Login Details from
the Login Dictionary.
valid_input_username := true
if inputted_password is in Login_Dictionary then
valid_input_password := true //Username
and Password are both matched
logged_in := true
writeln("Logins Details have been validated)
else
valid_input_password := false //If
username was matched but password wasnt
logged_in := false
writeln("Error your username or password was invalid")
end if
else
valid_input_username := false //If
username wasn't matched.
logged_in := false
writeln("Error your username or password was invalid")
end if
end while

if logged_in = true then


writeln("You have been logged in")
else
writeln("You could not be logged on due to false Login Details")
end if
end

//View Files and Records for students


begin
can_view := false
retrieve login_details
Display(List_of_Files_UI) //UI consisting of a
list of all the files in the file dictionary database
writeln("What File(s) would you like to view? ")
read(file_name) //user chooses file and
system reads it
while view_file not displayed do
send inputted_username to Permission_List[file_name] //send the LD to
the list of names that can view the file to be matched

if inputted_username is in Permission_List[file_name] then


//match process
can_view := true
retrieve view_file from File_Dictionary
display(view_file)
else
can_view := false
writeln("Error! You do not have the rights to view this")
end if
end while
end

//Upload Files and Records


begin
file_verification := Unverified
is_verified := false

display(upload_interface)
Input(file_rec, file_content)
upload(file_rec, file_content) to File_Dictionary

while is_verified = false do


if (usertype = teacher, admin) then
file_verification := Verified
is_verified := true
print("File has successfully been uploaded") to user
elseif (usertype = student) then
if teacher_verification = accepted then
file_verification := Verified //meaning as in the file
has been verified
is_verified := true //meaning as in the file
has been/not been reviewed by a teacher
print("File has been verified") to user
elseif teacher_verificiation = rejected then
file_verification := rejected
is_verified := true
print("File has been rejected ", + reasoning) to user
elseif teacher_verification = pending then
file_verification := unverified
is_verified := false
print("Verification pending") to user if queried
end if
end if
end while
end

//teacher_verification sub routine


begin
file_sufficiency := false
retrieve(file_rec, file_content)

if file_sufficiency = true then


teacer_verification := accepted
elseif file_sufficiency = false then
teacher_verification := rejected
elseif file_sufficiency = nil then //nil as in no boolean value is
stored; nothing has happened
teacher_verification := pending

//Change Password
begin
strong := false
Display(Change_Password_User_Interface)
writeln("Please enter your new password: ")
readln(new_password)
retrieve old_password from Login_Details_Database

while password not changed do


if strong[new_password] := true then
replace old_password with new_password
print("Password successfully changed!") to user
else
reject new_password
print("Password not strong enough") to user
endif
end while
end.

//Delete Skills
begin
writeln("which skill to delete?")
readln(to_delete)
Search to_delete in File_Dictionary
Remove Skill
End

You might also like