Making a survey in node.js and socket.io [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I need help with creating a survey app. My idea is for the app to display questions and have users click buttons to answer. At the end, the app should show each user which user had answers closest to theirs. I need help with the following things:
*How to set up the questions and buttons for the answers
*How to compare all the answers and show each user at the end
*How to make it so there is a separate url for each survey being taken
Answering any of these questions would be very helpful.

For grouping the participants by how close their answers are, you could use the k-means clustering algorithm, of which there's already a JavaScript implementation you could use.

Well, I don't see where Socket.io fits, other than that you could use Survey.js Library to help you build the interface, store the data in the same format, JSON, in MongoDB. There you can group like here, returning the documents data of same value.

Related

How do I create a search bar for my firebase object [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I have a firebase database and I want to create a search bar that will filter results from the database objects.
But I do not know how to go about it.
I have looked everywhere to find a good example but none of those I find are related to firebase.
otherwise is there an alternative way I can do this?
structure of the real-time database on firebase
any help and suggestions would be great.
Firebase is not really good for searching. The firebase team recommends using a third party solution like algolia.
However if you don't want to go through that you can just retrieve all the data in the collection or path you want to search, and add searching logic in your client

How to validate user logged in web application (php)? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
Good day.
Could someone please tell me how I can control that a user does not enter a web application more than once?
Currently I am controlling it by storing the session that is created in php in a field of a table and through javascript using ajax I consult it every 10 seconds. I think there must be a better way ... thanks !!!
And finally solved it by validating that the session created is different from the previous one, thus updating it and the previous user wanting to validate his session in order to make any request will realize that it does not exist and this will remove him from the application .

Implementing tree data structure for frontend components [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I'm trying to plan out a simple web app. A user is presented with a question that has two or three possible answers. Depending on their answer, they're taken to another question.
i.e.
ChoiceC
ChoiceA ---> Question 2 ---> ChoiceD
Question 1 -->
ChoiceB ---> Question 3 ---> ChoiceE
ChoiceF
This seems to me a like a tree, where each question and answer is a node, and depending on what path you go down, you're exposed to a specific set of other questions/answers.
I'm trying to figure out how to implement this with reusable React components. I could potentially create a component for each question, but that doesn't seem like good practice. Does anyone have any experience building these sorts of 'choose-your-own-adventure' style questionnaires?
You can use a map that saves for every answer what the next question is.
In your case an entry could be [ChoiceA, Question2]. In your program you can then story a variable current_question that gets updated based on your map.
This solution may only be insufficient if the same answer can arise in different contexts and lead to different outcomes. In this case maybe should be a question/answer-pair that determines what comes next.
If you really want to overkill your problem, you can implement a directed labeled graph. The questions would be the nodes in this case and the edge-labels are your answers which lead to the next question/node.
The most pragmatic solution would of course be to don't use a datastructure at all and just stack if-else. This is not scalable though.

How to register a user using only javascript/ajax or jquery [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm trying to register users using only javascript,ajax or jquery, i need to save the information of the users somewhere where i can get it even after the browser is closed,and the new information can't overwrite the old one.
I already tried saving into a xml file or txt file, but without success.
Check these out, one of it might help
http://www.w3.org/TR/IndexedDB/ - Indexed DB
http://www.w3.org/TR/webdatabase/ - Web Sql
http://www.w3.org/TR/webstorage/ - localStorage
You can as well try out a JavaScript Database here
http://www.taffydb.com/ still trying it out myself, hope this helps.

Creating a 'Like' system with HTML/CSS/Javascript [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I've been working on a project (you should probably see the link to better understand what I am talking about). To make things better, I decided to make a like system.
Each posts contain a like button and a number next to it that indicates how many people liked the post.
Like (4)
The current one in my project is just plain text with an empty link, and the number is a dummy.
Like (4)
Is it possible to actually make the like button actually work? What would I need to use?
I think you need php/SQL to keep track of the votes made. So you need to learn php and SQL or rely on an extension someone else made. If you happen to use one of the more popular CMS's (Joomla/Wordpress) you can probably get it without ever having to worry about the coding.

Categories

Resources