Closed cauesanches closed 7 years ago
hi @cauesanches great feature. I see it implemented in a couple of ways:
"100% control": We could expose the internal event system. This way you would be able to listen for when a user submits an answer and inject a new cf.ITag or setting focus on an already registered tag, depending on the answer.
"Pure markup": We could setup a way to map an answer to a specific tag via markup.
<input cf-answers="fruit=#list-of-favourite-fruits|vegetables=#list-of-favorite-veggies" ...>
so a user writes "fruit" and submits, would show the
Let me know if you have a 3rd solution in mind or if 1. or 2. sounds appealing.
Hi @felixnielsen, I think there may be times when some of the questions are not asked at all depending on the previous answers, and the actual shape of the all questions available might resemble a tree (or object), rather than an array. So it would be better to have 100% control with an easy to use API, rather than appending lots of input fields
@demircancelebi great, sounds like it would be a good overall idea to expose the internal event system.
For the enhancement at hand: The flow of Conversational Form is controlled from a centralised place in the code here, we could expose a method that could allow for:
By reviewing the code it would also make sense to expose the validation of the form-completion to a public API.
Let me know your thoughts @demircancelebi
I think there might be some value in allowing people to specify conditional questions directly in the markup, instead of having to define it in the script. That way, it's easier to have a clear overview of what's going on. Otherwise, you'd have some questions in the markup, and others in the script.
I guess this feature will drift the product from being a UI for a web form.
I would rather suggest that the standard visibility and enabled tags are a more compatible solution and the developers can also listen on the input fields to trigger visibility or enable/disable fields.
This will clearly decouple the plugin from the form design and will maintain the feature of toggling between conversation and web form
Hi,
I'm encountering the same issue and I'm wondering if something like an attribute cf-if-previous
could be a good solution.
So if I should resolve the owner's issue. I would do something like that :
<input cf-questions="Are you a person or a company ?" type="radio" name="person-or-company" value="person" />
<input type="radio" name="person-or-company" value="company" />
<input cf-questions="Inform the number of personal document." cf-if-previous="person" type="text" name="number-document" />
<input cf-questions="Inform the number of employees." cf-if-previous="company" type="text" name="number-employees" />
What do you think of this kind of solutions ? :smile:
tried to use the above solutions with fail. In my implementation i am asking the user two questions, first is to select his current job ( student, manager, job seeker), and on the second im asking the user to select his area of expertise ( it, hr, sales). then we're supposed to answer based on the previous 2 answers . for example if job=student and area = it reply with " you're an it student". Does anyone have an idea on how to make this possible
Hi @jadismael
Did you try using the code of this pull request ? https://github.com/space10-community/conversational-form/pull/42
If so you could find an example of a similar workflow here on this pastebin. http://pastebin.com/ugYqCA1S
On this workflow I'm using cf-display-if
to make conditionals display :smiley:
Hello @LeGfrey I tried your code, but the bot always display the first condition which is Young Boy in your script.
@jadismael Are you sure you built the source of CF using my pull-request ? :cry:
I just tried this and it works don't you forget a step ?
@LeGfrey I've followed your steps, its always telling me that im "young boy" even when i indicate that Im an old girl ( this conversation just became weird :P)
@jadismael I uploaded an example online (thanks to surge) if you want to check it. If it works online, I guess you should compare the different files included into the page (html, js) to know where the differences are.
You can find my example right here : http://cf-conditional.surge.sh/ :grinning:
@LeGfrey thank you a lot for your help, it works like a charm now. seems like i had a problem with the js.
@jadismael you're welcome :smile: if you like (or not) my version of conditional display and want to improve it don't hesitate to post your opinion on the PR
Interpreting this as conditional logic jump - i.e. jumping to questions based on previous answers @felixnielsen
Well, after a lot of tries, i did it! The decision is running well! @LeGfrey !!!
Hi. Is it possible to use logic so that, instead of using {previous-answer} in a way that only enables inputting the answer to the last question only, I could specify logic using the answer to any previous question that will end up being used in a series of follow-up questions? For example, let's suppose that I am conducting a study of people who were admitted to Yale University but who chose to enroll at another school. Question 1 asks, "Which school did you choose to attend?" If the answer is "Harvard," I would use the {previous-answer} function to ask "Which college has better academics, Yale or {previous-answer}?" If the user then selects "Yale," I still want the next question to ask, "Which college has better faculty: Yale or {previous-answer}, which I want to remain as "Harvard" even though the user selected "Yale" as the choice for the previous question. So, basically, I want to know if there is a way to choose a previous answer to a specific question to be used anywhere in the conversation form that I choose. Thanks!
Can someone post a compiled version of all the js and css files necessary to run the example file examples/development.html? All of the files I was able to get off GIT have .ts and .styl extensions, I'm assuming that the "install" using grunt unpacks those files into real .css and .js files. Here are the directories that I don't have: ../build/cf/ui/control-elements/OptionButton.js" ../build/cf/ui/control-elements/OptionsList.js" ../build/cf/ui/control-elements/UploadFileUI.js" etc
Thanks
The @LeGfrey solution seems to break - updating the CSS file it's pointing at to the latest version mostly fixes things, but still getting a handful of UI errors. Anybody up for updating it (I'm stuck)?
Please see latest release and Conditional Flow example
And Wiki on conditional flow features
@scooter7 please see value piping combined with conditional flow should accommodate your scenario?
Thanks!
James Vineburgh, Jr., PhD | 319-899-6620 [image: LinkedIn] http://www.linkedin.com/in/scootervineburgh
On Tue, May 16, 2017 at 3:08 AM, Felix Nielsen notifications@github.com wrote:
Please see latest release https://github.com/space10-community/conversational-form/releases/tag/v0.9.4 and Conditional Flow example https://space10-community.github.io/conversational-form-docs/conditional-flow.html
And Wiki https://github.com/space10-community/conversational-form/wiki/Conditional-Flow on conditional flow feature
@scooter7 https://github.com/scooter7 please see value piping https://space10-community.github.io/conversational-form-docs/value-piping.html combined with conditional flow should accommodate your scenario?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/space10-community/conversational-form/issues/18#issuecomment-301722094, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHAlikd4WfGwCY_uI13D17XWBj3uACjks5r6WepgaJpZM4K_PcV .
Hi,
Firstly, congratulations for iniciative. Conversational form is the future of web communication.
Well, I'm building a form that I need set a specific question according with the previous answer. For example:
Question: The client is a person or a company?
Question (if person): Inform the number of personal document. Question (if company): Inform the number of employees.
Has a solution for this case? Is it possible get the previous answer and make a test to show correct question?
Thanks!