This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-19
Channels
- # admin-announcements (14)
- # architecture (1)
- # beginners (21)
- # boot (301)
- # clojure (93)
- # clojure-brasil (56)
- # clojure-india (4)
- # clojure-italy (11)
- # clojure-japan (25)
- # clojure-russia (16)
- # clojure-sg (1)
- # clojure-uk (5)
- # clojurescript (64)
- # clojurex (4)
- # clojutre (7)
- # cursive (18)
- # datascript (35)
- # datomic (212)
- # editors (27)
- # emacs (38)
- # events (9)
- # funcool (21)
- # hoplon (105)
- # jobs (2)
- # ldnclj (41)
- # ldnproclodo (4)
- # liberator (89)
- # luminus (5)
- # off-topic (32)
- # om (39)
- # onyx (1)
- # re-frame (9)
- # reactive (1)
- # reagent (34)
- # testing (42)
- # yada (4)
Hi, anyone here has knowledge about database design? I have two tables user and question and now I need a many to many relation ship between them, which is the easy part (user_question table). Now comes the tricky part. question has a one-to-many relationship to answers which is ok too. However, now I have another information, the answers from a question that one user has answered with an additional attribute (true / false). How would I model that? My idea is to have another many to many relation between user and answer and put a third field into that table ("correct" or something). does that make sense? At least that's how I did it up to today and I wonder if there is a common solution to that problem?
You didn’t say this explicitly, but it sounds like all of the questions are T/F questions. True?
as this is for multiple choice tests I think I am certain for maybe 99% that it stays like this
well, you have several questions, each containing several possible answers and each answer being either true or false
Oh … so it’s not really true and false, it’s “checked/not-checked” or something like that.
The value of the checked field (if that’s how we choose to model it) might be boolean, but the meaning is whether they checked that choice or not.
@sveri: just off the top of my head, I might have a table called “responses” with three fields: user_id, question_id, answer_id. The presence of a row in the table indicates that the user checked that answer for the question.
Also, a terminology issue: someone looking at this and seeing “answers” might think that means “what the user answered”. Consider names like “possible answers”, “choices”, “answer options”, or something like that.
@magnars: what does the little "x" mean in your shell at the beginning of PotD E1? after mkdir -p
@clumsyjedi: Vim-cider has now find-symbol functionality. I used the opportunity to learn more about VimL's great functional programming facilities.
Also I added resolve-missing last night.
@dottedmag: the x in my shell means there are uncommitted changes in the git repo.