Create.Course.Element.Folder

This method will create a single folder within a specified course, under a specified parent folder element (if parent folder element is not specified, the root folder element is used).

Input

Name

Description

Type

M/O

SyncKeys

Array od SyncKey for the created content.

Complex type - array of SyncKey

O

SiteId

Site where action will be executed

Integer

O

VendorId

VendorId which will be associated with created content

Text

O

CourseId

ID of the course where the element is to be created.

Integer

O/M

CourseSyncKey

SyncKeyID of the course where the element is to be created.

Text

O/M

ParentID

ID of the parent folder where the element is to be created. Default use root folder of the course.

Integer

O

ParentSyncKey

SyncKeyID of the parent folder where the element is to be created. Default use root folder of the course.

Text

O

UserId

UserID of the creator.

Integer

O/M

UserSyncKey

User SyncKeyID of the creator.

Text

O/M

Title

Title of the folder.

Text

M

Description

Description for the folder.

Text

O

Active

Active state of the folder.

Boolean

O

Security

Denotes the security setting on the folder. There are three possible settings - Inherit, Secure and Locked.

  • Inherit means the folder has the same security setting as its parent.

  • Secure means students cannot access the folder.

  • Locked is a special status and denotes if the folder should be 'locked' or not. Locked folders and their contents cannot be edited through the UI by the end-user.

Use of the locked setting should only be used by 3rd parties after prior agreement with itslearning.

Locked folders cannot be removed from the course by the end-user and are only meant for use in special circumstances.

  • Inherit

  • Secure

  • Locked (Avaliable in release 46)


O

Notes

  • Either UserID or UserSyncKey must be specified. This means specify at least one is mandatory.

  • Either CourseID or CourseSyncKey must be specified. This means specify at least one is mandatory.

  • Both ParentID and ParentSyncKey are optional. Possible use only one of them either ParentID or ParentSyncKey.


This is how three folders are displayed when created through the migration toolkit:

images/download/attachments/284207514/folders_contentimport.png

The permissions on a secure folder are displayed as follows:

Scenario

In order to create a folder element a user needs to add a message with type corresponding to action Create.Course.Folder.Element.
Result of that message processing can be acquired using GetMessageResult method with message identifier as an input parameter.

Schema

Folder Schema
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:message-schema" elementFormDefault="qualified"
targetNamespace="urn:message-schema">
<xs:element name="Message" type="MessageType" />
<xs:complexType name="MessageType">
<xs:sequence>
<xs:element name="SyncKeys" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="SyncKey" minOccurs="0" maxOccurs="1" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SiteId" minOccurs="0" maxOccurs="1" type="xs:int" />
<xs:element name="VendorId" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="36"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="CreateCourseElementFolder" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="1" maxOccurs="1">
<xs:element name="CourseId" type="xs:integer" />
<xs:element name="CourseSyncKey" type="xs:string" />
</xs:choice>
<xs:choice minOccurs="0" maxOccurs="1">
<xs:element name="ParentId" type="xs:integer" />
<xs:element name="ParentSyncKey" type="xs:string" />
</xs:choice>
<xs:choice minOccurs="1" maxOccurs="1">
<xs:element name="UserId" type="xs:integer" />
<xs:element name="UserSyncKey" type="xs:string" />
</xs:choice>
<xs:element name="Title" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="64"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Description" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="Active" type="xs:boolean" default="true" minOccurs="0" maxOccurs="1" />
<xs:element name="Security" minOccurs="1" maxOccurs="1" type="securitytype" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="securitytype">
<xs:restriction base="xs:string">
<xs:enumeration value="Secure"/>
<xs:enumeration value="Inherit"/>
<xs:enumeration value="Locked"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>


Message content example

Folder MessageContent
 <Message xmlns="urn:message-schema">
<SyncKeys>
<SyncKey>SyncKey</SyncKey>
</SyncKeys>
<CreateCourseElementFolder>
<CourseId>1</CourseId>
<ParentElementId>1</ParentElementId>
<UserId>1</UserId>
<Title>Title</Title>
<Description>Description</Description>
<Active>true</Active>
<Security>Secure</Security>
</CreateCourseElementFolder>
</Message>


Validations

Before message is processed the MigrationProcessor will validate the message content and state of objects referred in it. These are validation rules:

  1. Input matches the schema.

  2. SyncKey must be unique.

  3. User must exist.

  4. User must not be external. Check the flag (external_user_id and external_customer_id for user created AICC).

  5. User must not be deleted.

  6. Course must exist.

  7. Course must not be external.

  8. Course must not be deleted.

  9. If specified: ParentID must be an element ID within the course.

  10. If specified: ParentID must be a folder.

  11. If specified: ParentID must not be deleted.

  12. If specified: ParentSyncKey must be an element ID within the course.

  13. If specified: ParentSyncKey must be a folder.

  14. If specified: ParentSyncKey must not be deleted.