# Google Classroom

{% embed url="<https://www.youtube.com/watch?t=1174s&v=98LKgphFSCY>" %}

**Google Classroom** add-on is an additional feature created specifically to ease the process of structuring classes and your workflow. With a new function, you can connect your Google Classroom account with your website and import the needed classes. Students will get a special code to enter the right class.

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2FaBHAL2vpGllvjU4NIEfM%2Fimage.png?alt=media&#x26;token=ba5b35d2-fd87-4a15-8f26-fcdb449597d3" alt=""><figcaption><p>WP Dashboard > MS LMS > Pro Addons</p></figcaption></figure>

{% hint style="info" %}
To successfully use this feature, you need PHP version 7.2 or higher.
{% endhint %}

## How to get API Credentials <a href="#how-to-get-api-credentials" id="how-to-get-api-credentials"></a>

Firstly, you need to create an app in the **Google Console** to get credentials.&#x20;

{% stepper %}
{% step %}
Follow to <https://console.developers.google.com/apis/credentials> to open the Google Developers Console:

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2FYVxxKi8gpHPt6pa0Fp11%2Fimage.png?alt=media&#x26;token=1e831f74-fd7c-4e3f-bacb-c42fedefefd1" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
You can use the existing projects or create a new project to keep your console organized.&#x20;

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2FmYawckDbTZGk8eUaFU9O%2Fimage.png?alt=media&#x26;token=df9ec83a-34ff-495d-84f3-85d1c0972381" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
A new project can easily be created simply by providing its name.
{% endhint %}
{% endstep %}

{% step %}
On the Credentials page,  click on the **Create Credentials** button.&#x20;

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2FgnVv86JpoK2anclVRuJc%2Fimage.png?alt=media&#x26;token=9df6523c-7a57-4ffe-94f9-c636bab56b5a" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
From the dropdown menu, select the option **OAuth Client ID**.

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2FaMHGVNOiOB8lRoGfqbyZ%2Fimage.png?alt=media&#x26;token=0eb36ec7-8dbc-4978-9422-f035ce0bba5c" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
On the opened page:

* choose  the application type as **Web Application**;
* give a **name** to it (eg, *Google Classroom for MS LMS*)
* click on the **Add URI** button on the **Authorized redirect URIs** section

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2F50WY82rMdaAtXqXrqPC9%2Fimage.png?alt=media&#x26;token=b6cfd106-aa7c-4b37-8f79-cb0f6fe2b965" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Now we have to get the Redirect URI from MasterStudy LMS. Go back to the admin panel of your website, and follow **WP Dashboard > MS LMS > Addons > Google Classroom** and click on the :gear: gear icon. It opens the addon settings.

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2FIEf9VtnrolEK69fMhD1N%2Fimage.png?alt=media&#x26;token=83d64330-39c3-47ba-afcf-76b9fa6eade8" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
At the top of the opened page, you will find the Redirect URI Link. Kindly copy it:

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2FALWIbE5hDnVuim3xhr3j%2Fimage.png?alt=media&#x26;token=6822aa49-9ebd-4476-9f8f-f9b5698fca7b" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Paste this link to the designated area and click on the **Create** button:

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2FlKaLMIAVQENHw4ghwvVY%2Fimage.png?alt=media&#x26;token=417a125d-c816-4026-9358-6f63ee89d13a" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Usually, it will take several seconds to process. However, it may take 5 minutes to a few hours forthe  settings to take effect
{% endhint %}
{% endstep %}

{% step %}
The following messages confirm that you have created the **OAuth Client** successfully. You can see the **Client ID** and **Secret key** here as well:

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2F3nYOJP44pJlVLWwsOuQc%2Fimage.png?alt=media&#x26;token=fadbc07f-5e4a-43c9-9e57-80705bb6244c" alt=""><figcaption></figcaption></figure>

Later you can find this key in the same (Credentials) page by following this:

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2Fhfj7dL8Ml1H8fLyQESbF%2Fimage.png?alt=media&#x26;token=594e6a71-9223-4415-8ab0-18bfd3e4e49b" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Download the JSON File

Now we have to download the **JSON** file of our **OAuth Client**. Click on the **download** :arrow\_down: button to do it:

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2FJmZ0TObNpBim8VEjXRio%2Fimage.png?alt=media&#x26;token=4454acee-5103-47c2-8eb9-f380857e2662" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Now API for the Google Classroom service should be enabled. Find the Library menu on the **APIs & Services:**.

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2F5kvXnicp4XOXwEicjmdo%2Fimage.png?alt=media&#x26;token=35ebdc6b-74fd-4abe-a6ab-b72b0d1bb090" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Using the search bar, search for the **Google Classroom** and choose it:

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2Ff1q33BE7xzst2SdJPher%2Fimage.png?alt=media&#x26;token=e4f13779-1479-45d8-b5bd-4ba4062ac976" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Click on the Enable button to enable it:

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2Fhnl8fkHXFduQRJ7pbPlt%2Fimage.png?alt=media&#x26;token=905e1001-1bdc-4ce5-9252-8390f09dbc72" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
That's it. We have successfully obtained our working credentials to use for **Google Classroom.**
{% endhint %}
{% endstep %}
{% endstepper %}

## Importing Google Classrooms <a href="#importing-google-classrooms" id="importing-google-classrooms"></a>

Importing existing Google Classrooms is also a straightforward action.

{% stepper %}
{% step %}
Follow **WP Dashboard > Classrooms> Import Classrooms** and upload the [**downloaded JSON file**](https://docs.stylemixthemes.com/masterstudy-lms/lms-pro-addons/google-classroom#download-the-json-file)**,** then click on the **Load Credentials** button:

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2FTkDgHtO2Ehim0BqRBC46%2Fimage.png?alt=media&#x26;token=a6b362ef-2a91-4e86-b5dc-e0c460ac24cb" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Now, we need to get an access token. Click on the **Get Access Token** button. You will be offered to select the needed profile in the popup window. Sign in to move to your app and you will be redirected back to the **Import Classrooms** page.&#x20;

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2FF6LWUaBkbInQJQgOkoJ3%2Fimage.png?alt=media&#x26;token=26b448be-f8a6-4509-8c69-63e01a33cba2" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Now you can see all the classes available in your Google account. You can import all classes or select just several and publish them.

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2FxFS00pBC50lpdBhgTL0d%2Fimage.png?alt=media&#x26;token=ec555ff7-4f09-4d59-9040-71ee7e2ab296" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

Once the classrooms are imported and published, you can see them on the Google Classroom Archive Page:

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2FnAgTplGcgXMnx58TmJMs%2Fimage.png?alt=media&#x26;token=2c835f4e-8901-45ba-aa24-685d0f92bb9d" alt=""><figcaption></figcaption></figure>

Students can find the course codes to enter the required class.

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2F4fDBVvIlRurlHowZHoTs%2Fimage.png?alt=media&#x26;token=86603f5a-577a-4913-8a08-a2c3aa88f1d8" alt=""><figcaption><p>Google Clasroom Page</p></figcaption></figure>

## Addon Settings <a href="#googleclassroom-enablingpopup" id="googleclassroom-enablingpopup"></a>

You can find the addon settings in the [Imported Classrooms ](#user-content-fn-1)[^1]page:

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2FljOmy24ypecC3KEBiJRd%2Fimage.png?alt=media&#x26;token=6bf92eb6-ea31-412a-a607-01bf1c09041b" alt=""><figcaption></figcaption></figure>

* **Only signed-in students will see the code** - enable this option so that only students who are signed in will see the Google Classroom code

### Enabling Popup <a href="#googleclassroom-enablingpopup" id="googleclassroom-enablingpopup"></a>

This setting lets you display a modal pop-up notice about the available Google Classrooms on your website when users visit. It occurs only on the first visit.&#x20;

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2FS1BT6IMLzBfgFWQ77ahp%2Fimage.png?alt=media&#x26;token=c097c423-2ebb-4375-8aa8-961cf5d511ac" alt=""><figcaption></figcaption></figure>

Here are the available settings:

* **Popup Title** - provide a title for the pop-up.
* **Popup Editor** - write down the brief description of the classrooms feature and describe why they are necessary. You can write whatever you want and design it using the special text editor.
* **Popup Image** - indicate the image that will be used to display on the pop-up. Once the user clicks on the image, it brings users to the special page that you specified.
* **Google Classrooms page** - indicate the URL of the page that users will be directed to by clicking the Pop-up Image. You can also use the link on the classes page on your Google Classroom account.

## Google Clasroom Elementor Widget

You can customize the Google Classroom page using the special widget for Elementor.&#x20;

{% stepper %}
{% step %}
that Open the page that you want to specify as a Google Classroom page using Elementor:

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2Ft8J6lpYfHcq9zxj48My2%2Fimage.png?alt=media&#x26;token=b523b068-10d9-4b8d-bafb-85258969eb7e" alt=""><figcaption><p>WP Dashborad > Pages > All Pages > Edit with Elementor</p></figcaption></figure>
{% endstep %}

{% step %}
Search for '**Google Classrooms**' and add the widget to the desired place according to your needs:

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2FYEkzkVBoLtAGn1C046om%2Fimage.png?alt=media&#x26;token=87313e77-2ac6-484c-877d-1bbba499517f" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
You can provide the title for the Grid and indicate the number of the items (classes) need to be displayed:

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2FfSWsHquMJUdbK8s0QNDj%2Fimage.png?alt=media&#x26;token=10ef27d5-08e3-4b13-a58e-3a9606337e82" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Once you finished, you can publish/update the page:

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2FpP6HP8vNNKvyLiF1FfQs%2Fimage.png?alt=media&#x26;token=0e6ebf8d-0698-4c36-b7fc-20c3dc0cb7b2" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

[^1]: WP Dashboard > Classrooms > Importeed Classrooms
