Coder Social home page Coder Social logo

Comments (7)

b31n91337 avatar b31n91337 commented on September 17, 2024

suggested flow:
database store: userID, menuTag
Store userID for each user
menu = {a,b,c,..}
menuTag defines the which menu option the user picked
go to the corresponding branch to handle the event according to the tag.

from com.comp3111.chatbot.

kelvinsyleung avatar kelvinsyleung commented on September 17, 2024

Actually, a local variable can be used in the controller to indicate the operation jump between functions.
So database call is not required every time a user decides to change function.
Give the exit keyword to abort any logical steps in any operations.

from com.comp3111.chatbot.

b31n91337 avatar b31n91337 commented on September 17, 2024

@IniZio @hlmaab
I think the we only need to store the latest action and input in the database?
the current design of the main flow keep all input.
Ud332c012b25d536d03194a8d0845567a | d | people_input
Ud332c012b25d536d03194a8d0845567a | d | people_input
Ud332c012b25d536d03194a8d0845567a | d | people_input
Ud332c012b25d536d03194a8d0845567a | d | people_input
Ud332c012b25d536d03194a8d0845567a | d | people_search
Ud332c012b25d536d03194a8d0845567a | kcc | exit_to_main
Ud332c012b25d536d03194a8d0845567a | e | room_input
Ud332c012b25d536d03194a8d0845567a | e | room_search
Ud332c012b25d536d03194a8d0845567a | 1232 | exit_to_main
Ud332c012b25d536d03194a8d0845567a | sdf | exit_to_main
Ud332c012b25d536d03194a8d0845567a | b | openinghour_choose
Ud332c012b25d536d03194a8d0845567a | b | openinghour_search
Ud332c012b25d536d03194a8d0845567a | 2 | exit_to_main
Ud332c012b25d536d03194a8d0845567a | d | people_input
Ud332c012b25d536d03194a8d0845567a | d | people_search
Ud332c012b25d536d03194a8d0845567a | kccho | exit_to_main
Ud332c012b25d536d03194a8d0845567a | e | room_input
Ud332c012b25d536d03194a8d0845567a | e | room_search
Ud332c012b25d536d03194a8d0845567a | 1234 | exit_to_main
Ud332c012b25d536d03194a8d0845567a | f | room_input
Ud332c012b25d536d03194a8d0845567a | f | room_search

from com.comp3111.chatbot.

b31n91337 avatar b31n91337 commented on September 17, 2024

The userid should make as candidate key to make sure it is unique and search the userid each time to load the latest input for that user.

from com.comp3111.chatbot.

hlmaab avatar hlmaab commented on September 17, 2024

That means if the user inputs again (not the first time), we should find the userid and update userinput and action instead of just inserting them?

from com.comp3111.chatbot.

b31n91337 avatar b31n91337 commented on September 17, 2024

yes, so we dont need to loop through all the entry. we can just use select * where userid=id to get the user input. I am working on it now.

from com.comp3111.chatbot.

IniZio avatar IniZio commented on September 17, 2024

Doesnt matter now 😏

from com.comp3111.chatbot.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.