I’m trying to implement a post upload feature, where a user would get points based on the completion of the post form. I also want to showcase a progress bar as they are filling in the post form.
So, I was thinking that, let’s say User uploads a photo (1 out of 10 fields) and they get 1 point. I want this reflected on the progress bar. However, this means (do correct me, if I’m wrong) I already have to create a new post and add 1 point to the “post-points” fields, for example, for it to be able to be displayed on the progress bar.
I’m thinking this could create many database entries where the user does not finish the upload, which is not ideal.
You could call it something like ‘progress points’ and make it a number.
Then, for each action you’re giving a point for, you would +1 to the progress points and have your progress bar reflect that.
You use ‘an input’s value has changed’ in a workflow, and +1 point every time it changes.
You need to make that workflow on every element that the user gets a point for when they complete it.
I use the ‘when an input’s value has changed’ on some forms that the user can edit. I use a progress bar also…but don’t award points, just the progress. But, the point thing would work the same.
When an input’s value has changed is in the workflows under elements.
Of course your ‘create post’ button, or whatever you want to call it wouldn’t work until all the required inputs were filled in.
Anyway, this is how I have my forms set up.
Hope that makes sense.
Using the custom state, you could just update all the points at once for the user in a workflow when they were done, if you were saving those points. Sounds like you’re just using the points to create a post though?
The best place (for a few reasons), is on the page or on the group that holds the form.
You could put it on the progress bar, but I’ve found putting it on the group level or page level makes it easier if you’re ever going back looking for custom states. If you have them all over different elements they’re harder to find.
I put my custom states on the group level. I say group level because I have a single-page app and every reusable is a group. I do have a couple of custom states on the index page though.