# Practice (connected apps)

> Connect your own app or site to the community. The link in a post becomes the Practice card, and members earn XP when they finish the activity.

**Practice** connects your own app or site to the community, like a workout, a practice test or an instrument practice. The app's link in a post becomes the **Practice** card. The member does the activity without leaving the community and earns XP when they finish.

**The most important rule:** the app needs to tell Knote when the person finishes. Without that notice, there's no XP. The guide with the code is on the **How to integrate** tab.

## The idea in a minute

- **App**: the name and addresses of your app or site.
- **Activity**: a page of the app that earns XP, with the path, the XP and the minimum time.
- **Practice card**: the link in a post that leads to an activity.
- **Notice**: the message the app sends to Knote when the person finishes.

## How it works

1. You put a link to a page of the app in a post.
2. If the link is on an activity's path, it shows as a card, with the XP it's worth.
3. The member taps the card, and the app opens over the post.
4. When they finish, the app notifies Knote.
5. Knote checks the time, gives the XP and shows the congrats.

A link outside the activities' paths stays a regular link, with no card and no XP.

If the post is a task in the [Plan](https://help.knote.how/en/plano.md), finishing the practice also checks off the task.

## Step by step

### Turn on the plugin

1. Open **Community › Plugins**.
2. Turn on **Practice**.

The **Practice** item shows up in the menu, under **Community**. You can add and test the app before turning it on. Cards only show in posts with the plugin on.

### Connect the app

1. Open **Community › Practice**.
2. Stay on the **Apps and activities** tab.
3. Click **Connect app**.
4. In **App name**, write the name.
5. In **App addresses**, write one address per line, only the beginning, like `https://myapp.com`.
6. Click **Save app**.

Each app has 1 to 5 addresses. The address can't be Knote's own.

### Create an activity

1. On the app's card, click **New activity**.
2. In **Name**, write the name the member sees on the card.
3. In **Key**, write the code the app sends in the notice: lowercase letters, numbers and hyphens.
4. In **Path in the app**, write the activity's page, like `/songs/*`.
5. Choose the **XP**, the **Minimum time** and the **Times with XP per day**.
6. In **Congratulations**, write the title the member sees when they finish.
7. Click **Save activity**.

In the path, `*` matches one segment without a slash: `/songs/*` matches `/songs/dry-land`. And `**` matches anything, slashes included. Without a path, the link doesn't become a card.

XP goes from 0 to 100 per activity. With no number in **Times with XP per day**, the activity has no daily limit. The day turns at midnight Brasília time.

### Integrate and test

1. Open the **How to integrate** tab.
2. Give the guide to whoever runs the app. It has the code with your app's details.
3. In **Test**, open an activity with **Open test**.
4. Do the activity until the end.
5. Check the result in **Notification log**.

The test doesn't give XP. The **Notification log** shows the last 100 notices from the last 30 days. Each notice has the result and the reason for any rejection.

## What members see

- In the post, the link becomes the card with the activity name and the XP it's worth.
- When they tap it, the app opens over the community.
- When they finish, they see the congrats with the XP and choose **Continue** or **Do it again**.
- On the same day, the card shows **Done today**.

The card shows on the web and in the iPhone and Android apps.

## Good to know

- **Knote checks the time.** XP only goes out if the person stayed in the activity for the **Minimum time**. Knote measures it with its own clock.
- **Links that don't earn XP.** The **Apps and activities** tab lists post links to your app that don't become a card.
- **Removing doesn't take XP away.** Removing an app or an activity doesn't take away the XP members already earned.
- **Who can.** The owner and the admins connect apps and create activities, on the web and in the apps.
- **Knote plan.** If your plan doesn't include this plugin, it shows a lock and the name of the plan that unlocks it.

## Frequently asked questions

**Why didn't my app's link become a card?** The link needs to be on the path of an activity that's on, and the plugin needs to be on. Check the **Links that don't earn XP** list.

**The member finished and didn't get XP. Why?** The app needs to send the notice, and the person needs to stay the minimum time. If they already did the activity the daily number of times, the next one gives no XP. The reason shows in the **Notification log**.

**Do I need a developer?** For the notice, yes: someone needs to add the code from the **How to integrate** guide to the app.
