Is this some sort of assignment for a course? If it is, the polite thing to do would be to make it clear.
As I said before to other user with almost the same question, this issue is not specific to shiny, it would be better if you isolate the relevant part and try to solve it outside shiny first.
Take a look at the other thread for an example