@@ -20,63 +20,96 @@ link = ""
23−# Introduction
23+## Introduction
24−This document will be split into 2 parts. The agent, which is the hoon code and the view, the glob for displaying the app.
24+This document will be split into 2 parts. The agent, which is the hoon code and
25+ the view, the glob for displaying the app.
25−I have made the decision to work mostly in json, including the state, as this is the easiest way to keep the front end and back end as similar as possible.
27+I have made the decision to work mostly in json, including the state, as this is the easiest
28+ way to keep the front end and back end as similar as possible.
26−In its state, there are no separation between your own surveys and surveys you have received from other people. Instead, we put the author of the survey along side the survey itself. This also applies to responses.
30+In its state, there are no separation between your own surveys and surveys you have received from
31+ other people. Instead, we put the author of the survey along side the survey itself. This also
32+ applies to responses.
29On the top level:
37On the top level:
30−`surveys`: the survey store, all forms goes here.
38+- `surveys`: the survey store, all forms goes here.
31−`responses`: the response store, all responses goes here.
39+- `responses`: the response store, all responses goes here.
32−### $surveys
41+#### $surveys
33This is a map of `author=ship` and a mop of `survey-id` and `survey` sorted by
42This is a map of `author=ship` and a mop of `survey-id` and `survey` sorted by
35−`+$ surveys (map author ((mop survey-id survey) gth))`
45++$ surveys (map author ((mop survey-id survey) gth))
36−### $responses
48+#### $responses
37−This is a map of `survey-id` and a map of `author` and mop of `response-id` and `response`
49+This is a mop of `survey-id` and a map of `author` and mop of `response-id` and `response`
38−sorted by `gth` sorted by `lth`. _sorry for this description_
50+ sorted by `gth` sorted by `lth`. *sorry for this description*
39−`+$ responses ((mop survey-id (map author ((mop response-id response) gth))) lth)`
52++$ responses ((mop survey-id (map author ((mop response-id response) gth))) lth)
40−### $survey
55+#### $survey
41A survey is a json object containing:
56A survey is a json object containing:
42- `title`: `@t -> %s`
57- `title`: `@t -> %s`
43- `description`: `@t -> %s`
58- `description`: `@t -> %s`
44- `visibility`: `?(%public %private %team) -> %s`
59- `visibility`: `?(%public %private %team) -> %s`
45- `slug`: `@ta -> %s`
60- `slug`: `@ta -> %s`
46- `questions`: `((mop question-id question) gth) -> %o`
61- `questions`: `((mop question-id question) gth) -> %o`
47−_Note: As of right now, `%team` doesn't do anything. This is for future functionality._
63+_**Note:**_ As of right now, %team doesn't do anything. This is for future functionality.
48−### $response
65+#### $response
49−A response is a json object containing a map of `question-id` and answer sorted by `gth`
66+A response is a json object containing a mop of `question-id` and `answer` sorted by gth
50−`((mop question-id answer) gth) -> %o`
68+((mop question-id answer) gth) -> %o
51−### $question
71+#### $question
52A question is a json object containing:
72A question is a json object containing:
53- `title`: this is the question itself `@t -> %s`
73- `title`: this is the question itself `@t -> %s`
74+- `options`: these are the choices provided `set -> %a of %s`. If no
54−- `options`: these are the choices provided `set -> %a of %s`. If no options are required, (text etc), options will be omitted.
75+ options are required, (text etc), options will be omitted.
55- `front`: the component type that gets rendered in the view `@tas -> %s`
76- `front`: the component type that gets rendered in the view `@tas -> %s`
56- `back`: the type of value the agent accepts for this question `@tas -> %s`
77- `back`: the type of value the agent accepts for this question `@tas -> %s`
57- `required`: whether or not this question is a required question `? -> %b`
78- `required`: whether or not this question is a required question `? -> %b`
58−### $answer
80+#### $answer
59An answer is a json object with the back type as the key and the written answer
81An answer is a json object with the back type as the key and the written answer
60−as the value.
82+ as the value.
61−eg. `[%o p={[p='noun' q=[%s p='this is my answer']]}]`
84+eg. [%o p={[p='noun' q=[%s p='this is my answer']]}]
62−## Actions
87+### Actions
63All possible actions the agent accepts.
88All possible actions the agent accepts.
64−```+$ action
91++$ action
65 $% [%create title description visibility slug]
92 $% [%create title description visibility slug]
66 [%delete survey-id]
93 [%delete survey-id]
67 [%edit edit]
94 [%edit edit]
68 [%ask ship survey-id]
95 [%ask ship survey-id]
96+ [%respond survey-id question-id answer]
69 [%submit ship survey-id response]
97 [%submit ship survey-id response]
72−### %create
101+#### %create
73Creates a new survey.
102Creates a new survey.
74−### %delete
104+#### %delete
75Deletes a survey from your state.
105Deletes a survey from your state.
76−### %edit
107+#### %edit
77Edits modifies the state of a survey. Adding, removing or editing
108Edits modifies the state of a survey. Adding, removing or editing
78−questions are also part of this same action.
109+ questions are also part of this same action.
80 $% [%title survey-id title]
113 $% [%title survey-id title]
81 [%desc survey-id description]
114 [%desc survey-id description]
82 [%vis survey-id visibility]
115 [%vis survey-id visibility]
@@ -84,46 +117,131 @@ questions are also part of this same action.
86q-action is defined as follows:
119q-action is defined as follows:
87−```+$ q-action
121++$ q-action
88 $% [%add title options front back required]
122 $% [%add title options front back required]
89 [%del question-id]
123 [%del question-id]
90 [%mod question-id title options front back required]
124 [%mod question-id title options front back required]
127+_**Note:**_ Modifying a question will delete the question and recreate
93−_Note: Modifyig a question will delete the question and recreate the question. I'm implementing it this way for simplicity. Open for
128+ the question. I'm implementing it this way for simplicity. Open for
94−comments._
129+ comments.
132+Pokes the author ship to get a survey.
135+This puts an answer in the response and thus building the final response that will be sent
136+ to the survey author via %submit
95−## Updates
138+### Updates
96−Updates are pretty straightforward in this agent. You either send out a survey or a result.
139+Updates are pretty straightforward in this agent. You either send out a `survey` or a `result`.
97−```+$ update
141++$ update
98 $% [%survey survey-id survey]
142 $% [%survey survey-id survey]
99 [%result survey-id result]
143 [%result survey-id result]
102−Note: Result is a noun, this will be used when validation is a thing. Until then, it's just a placeholder.
146+_**Note:**_ Result is a noun, this will be used when validation is a thing. Until then, it's just a placeholder.
103−## Scry Endpoints
148+### Scry Endpoints
104−### Survey
150+#### Survey
1051. `/x/surveys/all` - Retrieves all `survey`s in `$surveys`.
1511. `/x/surveys/all` - Retrieves all `survey`s in `$surveys`.
1062. `/x/surveys/[ship]` - Retrieves all `survey`s authored by the selected ship.
1522. `/x/surveys/[ship]` - Retrieves all `survey`s authored by the selected ship.
1073. `/x/survey/[survey-id]` - Retrieves a specific survey
1533. `/x/survey/[survey-id]` - Retrieves a specific survey
108−### Response
155+#### Response
1091. `/x/responses/[survey-id]` - Retrieves all responses for a specific form.
1561. `/x/responses/[survey-id]` - Retrieves all responses for a specific form.
1102. `/x/responses/[survey-id]/[ship]` - Retrieves all responses from a specific ship for a specific form.
1572. `/x/responses/[survey-id]/[ship]` - Retrieves all responses from a specific ship for a specific form.
112−```::::::::::::::::::::::::::
160+
113−:: ::
161+The term `form` and `survey` will be used interchangably below. This is because the agent uses
114−:: GIANT PLACEHOLDER ::
162+`survey` but the term `form` is more commonly used in the real world.
116−::::::::::::::::::::::::::
164+### Home Page
166+When opening the app, you will be greeted by the homepage. On the topmost of the page,
167+ there is a search bar. This is for requesting a survey from another ship. Below that,
168+ is the `+ Create` button. After that, a list of all the surveys in your survey
169+ store. Each item displays the title of the survey as well as a dropdown arrow. Clicking
170+ on the item itself will open the survey for responding.
172+By clicking on the arrow, you will be presented with edit, respond, delete and clone. If you
173+ do not own the survey, you will not be able to edit it.
175+
179+After clicking on the `+ Create` button in the home page, you will be directed to this page.
180+ The title and description of the survey will by default `Untitled Form` and
181+ `enter description here` respectively. This can be changed.
183+Next, there are three tabs displayed. The first is this page, `questions`. Then there is
184+ `responses` and `settings`.
186+If there are no questions, only the buttons at the bottom of the screen will show. `+` is for
187+ adding a new question, and the floppy disk icon is the save button. Clicking this will update
188+ the state of your agent.
190+
194+Here, we see a similar layout to `New Form`, except the questions do not have options you can
195+ change. At the bottom of the screen, there are two buttons indicating `previous` and `next`
196+ with numbers showing the current and total reponses in between them. These buttons allow you to
197+ cycle between the different responses that have been submitted to you.
199+
203+This is the settings menu. You get to switch the visibility of the survey and modify the slug of
206+
210+This is the page you see when you click on any of the surveys in the home page. You will be
211+ presented with the title and description of the survey, with the address of the survey next
214+Below all that are the questions itself. At the bottom of the survey, there is a submit button.
215+ Clickng on `submit` will send your response to the author of the survey.
217+
118−# Deliverables and Funding
219+## Deliverables and Funding
119−## Milestone 1 - 1 Star
221+### Milestone 1 - 1 Star
120−1. Complete core functionality as laid out above.
222+- The agent should be able to
223+ - Send, receive, edit and delete surveys.
224+ - Submit, receive and delete responses.
225+- A working front-end with the features outlined in the screenshots above.
226+- 9 front end question types
229+ - multiple choice (select one)
230+ - multiple choice (select many)
231+ - linear scale (discrete)
232+ - linear scale (continuous)
233+ - multiple choice grid (select one)
234+ - multiple choice grid (select many)
121−## Milestone 2 - 1 Star
237+### Milestone 2 - 1 Star
122−1. Improved GUI
238+- Improved front-end
123−2. Validation
240+- Validation
124−3. Multiple editors in one survey
241+- Multiple editors in one survey
125−4. Anonymous survey -- Earth facing mirror
242+- Anonymous survey -- Earth facing mirror
127−# Miscellaneous
244+## Miscellaneous
128−##Contact, Issues, Requests, Feedback
246+### Contact, Issues, Requests, Feedback
129`~donpub-datdux/gerhana-network`
247`~donpub-datdux/gerhana-network`