> ## Documentation Index
> Fetch the complete documentation index at: https://help2.studystash.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Moodle Plugin: Syncing StudyStash to Courses (Opt-In Mode)

> This plugin syncs StudyStash only to Moodle courses that are explicitly included.

**FOR ADMINISTRATORS**

<Warning>
  This plugin syncs StudyStash only to Moodle courses that are explicitly included. If you would prefer an [**opt-out approach**](/integrations/moodle-opt-out-sync) where StudyStash is synced to all courses except those that are excluded, you can find the guide here.
</Warning>

## **Purpose**

**StudyStash Course Sync (Opt-In)** is a Moodle local plugin that helps administrators roll out the StudyStash LTI activity across courses at scale. Admins select and “opt-in” courses using a CSV file and preview the result using a dry run before making live changes. Instead of enabling StudyStash manually in each course, the plugin queues a sync task that checks every eligible course and adds the StudyStash activity only where it is missing. It is safe to run multiple times: courses that already contain the configured StudyStash activity are skipped, and only new or missing courses are updated.

<table>
  <tbody>
    <tr>
      <th>
        <p><strong>Action</strong></p>
      </th>

      <th>
        <p><strong>Explanation</strong></p>
      </th>
    </tr>

    <tr>
      <td>
        <p>Dry Run</p>
      </td>

      <td>
        <p>Previews which courses would get StudyStash based on which have been opted-in.</p>
      </td>
    </tr>

    <tr>
      <td>
        <p>Sync StudyStash to Courses</p>
      </td>

      <td>
        <p>Enables StudyStash in eligible courses that do not already have it.</p>
      </td>
    </tr>

    <tr>
      <td>
        <p>Course opt-ins</p>
      </td>

      <td>
        <p>Lets admins choose courses that must include the StudyStash activity.</p>
      </td>
    </tr>
  </tbody>
</table>

## **Prerequisites**

* Moodle version must be `>= 2022041900` (Moodle 4.0+)

* Administrative access (`moodle/site:config`) to your Moodle Instance

* A valid preconfigured LTI tool for StudyStash already exists

* Cron running within Moodle

* Your Customer Success Manager has provided the Plugin via a ZIP file

## **Step 1: Installing the plugin**

1. Go to `https://<your-moodle-instance>/admin/tool/installaddon/index.php`

2. Upload the ZIP file provided to you by StudyStash by pressing “Choose a file…”

3. Press “Show more…”

4. Set the “Plugin type” to be “Local plugin (local)”

<Frame className="ss-screenshot" caption={"**Figure 1.** Moodle Plugin: Syncing StudyStash to Courses (Opt-In Mode) — screenshot 1"}>
  <img loading="lazy" src="https://mintcdn.com/studystash-help/UbXlxW0z5agaJ_Cy/assets/93847554/94076930-plugin-installer.png?fit=max&auto=format&n=UbXlxW0z5agaJ_Cy&q=85&s=ab34f1c39f399bc4f1d58262eac4b6f3" alt="Moodle Plugin: Syncing StudyStash to Courses (Opt-In Mode) — screenshot 1" width="2814" height="1481" data-path="assets/93847554/94076930-plugin-installer.png" />
</Frame>

5. Press “Install plugin from the ZIP file”

6. After the validation message, press “Continue”

7. After the server checks message, press “Continue”

8. After the plugins check message, press “Upgrade Moodle database now”<br />

   <Frame className="ss-screenshot" caption={"**Figure 2.** Moodle Plugin: Syncing StudyStash to Courses (Opt-In Mode) — screenshot"}>
     <img loading="lazy" src="https://mintcdn.com/studystash-help/FFz54l9hIeIDPaHl/assets/107282435/107479086-image-20260316-005318.png?fit=max&auto=format&n=FFz54l9hIeIDPaHl&q=85&s=b4c7fe70485ee0ac79c93aedd0588691" alt="Moodle Plugin: Syncing StudyStash to Courses (Opt-In Mode) — screenshot" width="1207" height="293" data-path="assets/107282435/107479086-image-20260316-005318.png" />
   </Frame>

9. If an “Upgrading to new version” message appears, press “Continue”

***

## **Step 2: Configuring the plugin**

After installing the plugin (step 1), you will be required to configure the new settings that are available.

<Frame className="ss-screenshot" caption={"**Figure 3.** Moodle Plugin: Syncing StudyStash to Courses (Opt-In Mode) — screenshot 3"}>
  <img loading="lazy" src="https://mintcdn.com/studystash-help/UbXlxW0z5agaJ_Cy/assets/93847554/94076937-new-settings.png?fit=max&auto=format&n=UbXlxW0z5agaJ_Cy&q=85&s=b883baaf648cfe582ee07d3102a989ee" alt="Moodle Plugin: Syncing StudyStash to Courses (Opt-In Mode) — screenshot 3" width="2223" height="548" data-path="assets/93847554/94076937-new-settings.png" />
</Frame>

1. Enter the following settings:

<table>
  <tbody>
    <tr>
      <th>
        <p><strong>Setting</strong></p>
      </th>

      <th>
        <p><strong>Value</strong></p>
      </th>

      <th>
        <p><strong>Type</strong></p>
      </th>
    </tr>

    <tr>
      <td>
        <p>LTI preconfigured tool type ID</p>
      </td>

      <td>
        <p>Select the correct ‘StudyStash’ <em>LTI Activity Module</em> from the dropdown</p>
      </td>

      <td>
        <p>Required</p>
      </td>
    </tr>

    <tr>
      <td>
        <p>StudyStash activity name</p>
      </td>

      <td>
        <p>StudyStash</p>
      </td>

      <td>
        <p>Optional</p>
      </td>
    </tr>

    <tr>
      <td>
        <p>Placement in General section</p>
      </td>

      <td>
        <p>Bottom</p>
      </td>

      <td>
        <p>Optional</p>
      </td>
    </tr>
  </tbody>
</table>

2. Press the “Save changes” button

3. Go to `https://<your-moodle-instance>/local/studystash_optin/index.php`<br />

   <Frame className="ss-screenshot" caption={"**Figure 4.** Moodle Plugin: Syncing StudyStash to Courses (Opt-In Mode) — screenshot"}>
     <img loading="lazy" src="https://mintcdn.com/studystash-help/FFz54l9hIeIDPaHl/assets/107282435/106987534-image-20260316-004242.png?fit=max&auto=format&n=FFz54l9hIeIDPaHl&q=85&s=eb7ebe3fe96caeea7434e0021168860e" alt="Moodle Plugin: Syncing StudyStash to Courses (Opt-In Mode) — screenshot" width="985" height="410" data-path="assets/107282435/106987534-image-20260316-004242.png" />
   </Frame>

4. Press the “Opt-In Courses” tab:<br />

   <Frame className="ss-screenshot" caption={"**Figure 5.** Moodle Plugin: Syncing StudyStash to Courses (Opt-In Mode) — screenshot"}>
     <img loading="lazy" src="https://mintcdn.com/studystash-help/FFz54l9hIeIDPaHl/assets/107282435/107479078-image-20260316-004330.png?fit=max&auto=format&n=FFz54l9hIeIDPaHl&q=85&s=108277c2acb8f61cbbdfc9ff39d191f1" alt="Moodle Plugin: Syncing StudyStash to Courses (Opt-In Mode) — screenshot" width="1233" height="301" data-path="assets/107282435/107479078-image-20260316-004330.png" />
   </Frame>

   1. Press the “Download CSV template” button, and fill out the CSV file.<br /><br />Each row should either be the **Course ID number** or the **Short name** (there is no requirement for a header row). For example:

      ```text theme={null}
      SHORTCOURSE-ID-111
      SHORTCOURSE-ID-222
      ```

   2. Upload the CSV file by pressing “Choose File”

   3. Press “Preview CSV”

   4. Ensure all rows within the CSV are valid. For each valid row, the full details will be shown:<br />

      <Frame className="ss-screenshot" caption={"**Figure 6.** Moodle Plugin: Syncing StudyStash to Courses (Opt-In Mode) — screenshot"}>
        <img loading="lazy" src="https://mintcdn.com/studystash-help/FFz54l9hIeIDPaHl/assets/107282435/106987542-image-20260316-005709.png?fit=max&auto=format&n=FFz54l9hIeIDPaHl&q=85&s=6cc892df7d4563e6e806f08e4881c353" alt="Moodle Plugin: Syncing StudyStash to Courses (Opt-In Mode) — screenshot" width="947" height="278" data-path="assets/107282435/106987542-image-20260316-005709.png" />
      </Frame>

   5. If you are happy with the valid rows, press the “Apply opt-in list” button.

5. Optionally, you can Dry Run the sync:<br />

   <Frame className="ss-screenshot" caption={"**Figure 7.** Moodle Plugin: Syncing StudyStash to Courses (Opt-In Mode) — screenshot"}>
     <img loading="lazy" src="https://mintcdn.com/studystash-help/UbXlxW0z5agaJ_Cy/assets/93847554/93847611-image-20260217-235418.png?fit=max&auto=format&n=UbXlxW0z5agaJ_Cy&q=85&s=e58911b6e9d4a718b9ea3e19f746988c" alt="Moodle Plugin: Syncing StudyStash to Courses (Opt-In Mode) — screenshot" width="2860" height="828" data-path="assets/93847554/93847611-image-20260217-235418.png" />
   </Frame>

   1. Press “Dry Run”, and wait a few seconds/minutes for the task to complete (depending on how many courses you have)

   2. Press the “Logs” tab

   3. Examine logs to ensure behavior is as expected for each course

6. To complete the sync for real, press “**Sync StudyStash to Courses**” on the “Status” tab:<br />

   <Frame className="ss-screenshot" caption={"**Figure 8.** Moodle Plugin: Syncing StudyStash to Courses (Opt-In Mode) — screenshot"}>
     <img loading="lazy" src="https://mintcdn.com/studystash-help/FFz54l9hIeIDPaHl/assets/107282435/107479093-image-20260316-010418.png?fit=max&auto=format&n=FFz54l9hIeIDPaHl&q=85&s=49b1058ac8d0b7071b6d02e4f6f44d81" alt="Moodle Plugin: Syncing StudyStash to Courses (Opt-In Mode) — screenshot" width="552" height="197" data-path="assets/107282435/107479093-image-20260316-010418.png" />
   </Frame>

## **FAQs**

**How can previously opted-in course be deleted?**

Re-upload the CSV file containing only the courses you still want to keep opted in. Each CSV upload replaces the existing list, so any courses not included in the new file will be removed from the opt-in list.

**What’s the difference between Course ID and Course ID Number?**

<table>
  <tbody>
    <tr>
      <td>
        <p><strong>Course ID</strong></p>
      </td>

      <td>
        <p>Moodle’s internal, system-generated identifier for a course. It is automatically assigned when the course is created and cannot normally be changed.</p>
      </td>
    </tr>

    <tr>
      <td>
        <p><strong>Course ID Number</strong></p>
      </td>

      <td>
        <p>Optional field set by administrators or course creators. It is often used to match courses with external systems (such as student information systems or integrations) and can be edited if needed.</p>
      </td>
    </tr>
  </tbody>
</table>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.