Notice: Function register_rest_route was called incorrectly. REST API routes must be registered on the rest_api_init action. Please see Debugging in WordPress for more information. (This message was added in version 5.1.0.) in /home/thrivethemes/dev/thrivethemes/staging.thrivethemes.com/wp-includes/functions.php on line 6078

Notice: Function register_rest_route was called incorrectly. The REST API route definition for membership/v1/tags/schema is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback. Please see Debugging in WordPress for more information. (This message was added in version 5.5.0.) in /home/thrivethemes/dev/thrivethemes/staging.thrivethemes.com/wp-includes/functions.php on line 6078

Notice: Function register_rest_route was called incorrectly. The REST API route definition for membership/v1/tags/activity/(?P[\d]+)/(?P[\d]+) is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback. Please see Debugging in WordPress for more information. (This message was added in version 5.5.0.) in /home/thrivethemes/dev/thrivethemes/staging.thrivethemes.com/wp-includes/functions.php on line 6078

Notice: Function register_rest_route was called incorrectly. The REST API route definition for tve-dash/v1/growth-tools is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback. Please see Debugging in WordPress for more information. (This message was added in version 5.5.0.) in /home/thrivethemes/dev/thrivethemes/staging.thrivethemes.com/wp-includes/functions.php on line 6078

Notice: Function register_rest_route was called incorrectly. The REST API route definition for tve-dash/v1/growth-tools is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback. Please see Debugging in WordPress for more information. (This message was added in version 5.5.0.) in /home/thrivethemes/dev/thrivethemes/staging.thrivethemes.com/wp-includes/functions.php on line 6078
Assigning a New User Role After User Completes a Quiz - Thrive Themes
  1. Home
  2. Knowledge Base
  3. Thrive Automator
  4. Examples of Automations
  5. Assigning a New User Role After User Completes a Quiz

Assigning a New User Role After User Completes a Quiz

There are multiple ways in which you can automate various processes from your website.

One of the ways in which you can do that is by creating an automation in which all the users who get the maximum score in one of your quizzes become contributors on your website.

For example, I have a SEO quiz on my website, that has three possible results – “Beginner”, “Intermediate” and “Expert”. I want that all users who take this quiz and get the “Expert” result to be automatically granted the “Contributor” role on my website.

Here’s how you can automate this process using Thrive Automator

Set up the Quiz

First, create your quiz and make sure you set the correct type for it. For this example I’ve used the “Category” quiz type:

Then, in the quiz settings, I’ve created three categories:

And then I’ve made sure to add the questions and link the answers to the corresponding categories:

Setting up the Opt-In Gate

Besides the regular set up process when creating your quiz, there’s one additional step required here – setting up the opt-in gate:

Here, you need to make sure that your opt-in gate form is connected through the API to an autoresponder. This way you are collecting the details that are needed for running this automation.

So first make sure you add an opt-in gate to your quiz structure:

Then edit your form and connect it to an autoresponder through the API:

With all this set up make sure you save your quiz and publish it somewhere on your website:

Set Up the Automation

Access Thrive Automator from your Thrive Dashboard:

Create a new automation and give it a name.

Add the Start Trigger

Then add your start trigger:

Here, pick the “User completes quiz” as your start trigger:

Adding the Conditions

Then proceed with adding the first condition of your trigger:

Open the drop-down list and select “Quiz title”:

Then make sure you look up the quiz that you’ve just set up:

Then, proceed with adding the second condition:

This time select the “Quiz result (if text)” field:

Set the value. In this case I want it to match exactly the category name that I’ve set in Thrive Quiz Builder:

And finally, type in the quiz category:

Click on “Done” and proceed to adding a new action to your automation:

This time, click on the “WordPress” card:

Select “Add user role” from the drop-down that opens:

Select the user role:

Once done, your automation should look like this:

The only thing left to do is to activate and save your automation:

Now all the users of your website that are taking the quiz and getting the “Expert” result, will become contributors on your website. All this process is automated, so you do not need to manually check the users who have managed to score this high and manually change their user role.

I really hope this tutorial was useful to you. Here you can find more resources of this type, if you enjoyed reading this article:

Was this article helpful?

Related Articles

>