How to Setup Verifcation for Manual Tasks done by User
This guide will walk you through setting up manual review for tasks done by users in your campaign. You can use this feature to verify that the user has completed the task correctly before rewarding them XP.
What You Will Need
- Google form
- Google Sheet
- Access to a modern web browser (eg Brave, Chrome, Firefox)
Steps to Setup Manual Review
Step 1: Create a Google Form
- Go to Google Forms (opens in a new tab) and create a new form.
- For this guide, we will verify if user has submitted a valid instagram username and allocate XP to their wallet address accordingly.
Step 2: Link the Google Form to a Google Sheet
- Click on the
Responses
tab in the Google Form. - Click on the
Link to Sheets
icon to link the form to a Google Sheet.
Step 3: Setup Apps Script to Verify User Input
- Open the linked Google Sheet.
- Click on
Extensions
->Apps Script
.
Step 4: Add the Script Code to verify User Input
- Replace the default code with the following code:
function onEdit(e) {
var sheet = e.source.getActiveSheet();
var range = e.range;
var column = range.getColumn();
var statusColumn = 5; // Assuming the status column is the 5th column (E)
var xp = 50;
// Check if the edited cell is in the status column
if (column == statusColumn) {
var row = range.getRow();
var status = range.getValue();
// Allowed values to send reward
if (status === "valid") {
var username = sheet.getRange(row, 2).getValue(); // Assuming username is in the 2nd column (B)
var email = sheet.getRange(row, 3).getValue(); // Assuming email is in the 3rd column (C)
var wallet = sheet.getRange(row, 4).getValue(); // Assuming wallet is in the 4th column (D)
// Print the values (you can change this to any action you need)
console.log('Username: ' + username);
console.log('Email: ' + email);
console.log('Wallet: ' + wallet);
/**
* Reward XP to user via reward API
* XP reward logic here
*/
// Optionally, show a success popup in the sheet
SpreadsheetApp.getUi().alert(`${xp} XP rewarded to ${wallet}`);
}
}
}
- This setup will reward 50 XP to the user if the status column is set to
valid
. You can modify the code to suit your needs.
Step 5: Deploy the Script as a Web App
- Click on
Deploy
->New Deployment
.
- Click on
Select type
and chooseWeb App
.
- Fill in the details and click on
Deploy
.
- Authorize the script to access your Google account when running the script. You will have a success message with the following details as shown in the picture.
Step 6: Test the Manual Review Process
Fill the form with the required details and submit the form. The script will reward XP to the user if the status is set to valid
.
Interactive Demo
Try out the manual review process with this interactive demo:
Username | Wallet | Status | Action |
---|
Customization
- Adjust the
xp
variable in the script to change the reward amount. - Modify the script to integrate with your actual reward system API.
- Add additional validation logic as needed for your specific use case.
Troubleshooting
- If the script doesn't run, check that you've granted necessary permissions.
- Ensure the status column matches the one specified in the script (default is column 5).
- Check the Apps Script logs for any error messages if the script fails to execute.
Conclusion
You have successfully set up manual review for tasks done by users in your campaign. You can now verify that the user has completed the task correctly before rewarding them XP.