Skip to content

Instantly share code, notes, and snippets.

@claj
Created April 30, 2016 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save claj/4e36e7e45bba231e80f86cd6da3004cf to your computer and use it in GitHub Desktop.
Save claj/4e36e7e45bba231e80f86cd6da3004cf to your computer and use it in GitHub Desktop.
{:db/id #db/id [db.part/user 100001]
:question "what is your favourite animal?"
:question-type :single-option ;; could actually can be deduced from the fact below
:single-options ;; components or something.
[{:answer "cat"
:db/id #db/id [db.part/user 100002]}
{:answer "dog"
:db/id #db/id [db.part/user 100003]}
{:answer "rhino"
:db/id #db/id [db.part/user 100004]}]}
{:db/id #db/id [db.part/user 100005]
:question "what is your name?"
:question-type :text}
;; if needed, add forms with refs to the questions that was presented to the user
{:db/id #db/id [db.part/user 100006]
:username "some user"
:posted-forms [{:created (d/tempid :db.part/tx) ;; link to the transaction in which the form was created...
:answers [{:question #db/id [db.part/user 100001]
:single-option-answer :db/id #db/id [db.part/user 100004]} ;;link to component above
{:question #db/id [db.part/user 100005]
:text-answer "Neo Anderson"}]}]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment