# In Sakai

Creating a new CodeGrade assignment from within Sakai will correctly add this assignment to the corresponding course in CodeGrade, a new course will automatically be created in CodeGrade if it does not yet exist in CodeGrade. Follow the steps below to create a new CodeGrade assignment in Sakai:

1. In your Sakai course, navigate to the "**Resources**" page, which can be found in the sidebar.
2. Click on the "**Add Content**" button and select "*Add External Tool*" in the list that pops up.
3. In the External Tool Selector, select "*CodeGrade*".
4. Now, you can provide the *Tool Title* (name of the assignment) and *Button Text* and press "**Save**".

{% hint style="success" %}
A good practice is to keep the Tool Title and Button Text the same!
{% endhint %}

{% hint style="success" %}
Grades are automatically sent back to Sakai after setting [the **assignment state** to **Done** in CodeGrade.](/faq/releasing-grades-and-feedback.md) While the assignment is in the **Done** state, all grades and changes to grades are immediately sent back to Sakai. Only after this is done, the CodeGrade assignment will show up in the gradebook.
{% endhint %}

Now, go ahead and set up the General Settings:

{% content-ref url="/pages/F0zZ1aj7XLlwCqbDZYOz" %}
[General settings](/setup-assignment/build-assignment/general-settings.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.codegrade.com/setup-assignment/build-assignment/creating-an-assignment/in-sakai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
