courselab / pollex

Open Source Online Poll Application
GNU General Public License v3.0
1 stars 9 forks source link

Implement database models and create user on sign up #35

Open gdezan opened 4 years ago

LuisF3 commented 4 years ago

I think this modeling is quite incomplete.

I suggest you to take a look at the interface before modeling. @ET33 was working on it, he may offer help.

By looking at the main page:

image

We can notice that it is needed an author to each poll, so we can differentiate it by the type (type is defined by whether the polls is yours or not). Polls must have a due date as well (in the print it is written creation date, but due date is written on the poll edit page and makes more sense). The votes are currently represented as integers, but I dont think it is enough. There should be a different model for the option of a poll and a different object for each individual vote, where we would be able to track who voted, when and in what option.

By the poll editing page: image

We see administrators, participants and options. Only participants is modeled as I could comprehend. Polls also have a description.

There is another page, but I could extract any other model from it. I still think it is worth to take a look.

LuisF3 commented 4 years ago

Also this PR has 2 features. Next time it is better to separate them.

ET33 commented 4 years ago

I've come with this. Though there's

User
    name
    email
    password
    nusp

Poll
    uid (unique id, so we can implement authorization later)
    name
    description
    created
    ending_date
    type
    checkboxes

Vote
    user_id
    option_id

Options
    poll_id
    value

Participants
    poll_id
    user_id
    user_role (participant, admin, poll owner)

I think this would be enough for testing the application.