# In Moodle

Follow the steps below to create a new CodeGrade assignment in Moodle:

1. In your Moodle course, press the "**+ Add an activity or resource**" button in the place you want to add your CodeGrade assignment.
2. From the window that now shows up, select "*CodeGrade*" and press "**Add**".
3. Now set the name for your assignment and edit additional settings.
4. Press "**Save**" again to save and display your new CodeGrade assignment.

{% hint style="success" %}
Grades are automatically sent back to Moodle 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 Moodle. Only after this is done, the CodeGrade assignment will show up in the grade book.
{% 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-moodle.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.
