1. Help
  2. Plugins and integration
  3. Setting up Sub-Accounts for Moodle Courses

Setting up Sub-Accounts for Moodle Courses

This article explains how you can link Moodle courses to Cincopa Sub-Accounts by using the account API token. This feature is useful when you want to upload assignment submissions to different sub-accounts as opposed to uploading it all into one account. To link a sub-account to the moodle course, the first step would be to create a custom field at the course level to store the Cincopa account API token, then generate and copy the API token from your Cincopa account and lastly insert the token into the custom field in the Course settings.

Steps for creating a custom field to store the Cincopa API token:

  1. Login to Moodle as a Site admin and click on Site Administration as shown below. Then click on Courses tab and click on Course custom fields option.
  2. Click on Add a new category button.
  3. From the Add a new custom field dropdown, select Short Text.
  4. Enter field Name of your choice e.g. Cincopa API token. Short name must be set as ‘cp_token‘. Save the changes.

Note: You can also change the label ‘Other fields‘ to something else e.g. Sub-Account Details as that is what will be displayed in the course settings unless you plan on using this category for creating other fields that are not tied to your cincopa account.

Steps for generating and copying the API token:

  1. Login to your Cincopa account and then under Dashboard click on API Tokens.
  2. Click on Create New Key.
  3. Enter a name for the API token, select the permissions as per your requirements. For the file submissions, it’s suggested to add permissions for both assets and galleries. Click on Creeate Key button.
  4. Click on the Copy button to copy the API token.

Steps for linking Course to a Sub-Account using the API token:

  1. Open the Course Settings as shown below and then scroll down to the ‘Other fields’ section unless you renamed the category at the time of creating the custom field.
  2. You will see ‘Other fields‘ as a collapsible panel and upon expanding it will show the custom text field that was created to store the API token.
    Paste the API token into the custom text field as shown below and click on Save & Display.
Note: Once the changes are saved and you create a new Assignment, the value of the API token from the course will be automatically populated into the ‘Cincopa API Token’ field in the Assignment settings.
If the custom API token field is left empty in the Course Settings or the field has not been created, then the ‘Cincopa API Token’ field will be enabled at the Assignment level so every assignment will have option to have its own API token/sub-account.
If the ‘Cincopa API Token’ is left empty in the Assignment Settings as well then the global API token will be used defined in the Cincopa Submissions plugin settings.
When the course API token is changed, you must open the Assignment Settings and re-save it otherwise the submissions will continue to upload in the old account tied to the API token that was originally set. Similarly, if the course API token is removed from the course settings then you must open the assignment Settings and remove the token from the Cincopa API token field.

Was this article helpful?