Create.Course.Element.CustomActivity

This will create a custom activity element in a course. It will not create any results, just the custom activity.

What is a custom activity?

This will allow teachers to create, plan and track activities that happen outside itslearning. These activities can be added and managed as any other course activity – including management of deadlines, statuses and assessments. This can be used for simple activities such as homework or offline lab exercise

Initial Validation Rules

  • Input matches the schema below.

  • SyncKey is unique.

  • User must exist.

  • User must not be external.

  • User must not be deleted.

  • Course must exist.

  • Course must not be external.

  • Course must not be deleted.

  • Course must not be archived.

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

  • If specified: ParentSyncKey must be a folder.

  • If specified: ParentSyncKey must not be deleted.

Input

Parameters in:

Name

Description

Type

M/O

Message Type

Type of Message.

Text set to message type

M

SyncKey

External SyncKey for the created content.

Text

O

SiteId

Site where action will be executed

Int

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

ParentSyncKey

SyncKey of the (previously created) folder where the element is to be created. If not specified then create in root. Must be a SyncKey.

Text

O

Active

Is the element active? By default, the element is active.

Boolean. True/False.

O

UserID

UserID of the creator.

Integer

O/M

UserSyncKey

User SyncKeyID of the creator.

Text

O/M

Title

Description of the custom activity.

Text

Must not be blank. Must follow same rules as UI.

M

Description

Text (rich content) description of the custom activity.

Text

See user story on importing rich content for description of parsing

O

Deadline

If Deadline is missing blank then set to “no deadline”.

If a date is specified then set to the time / date even if in the past.

Text.

Valid UTC date.

O

Mandatory

Is the custom activity mandatory? If not specified then assume mandatory.

Boolean: “True” / “False”

O

AssessmentId

This is the ID of the grade, if grading is used.

If the value is missing then no assessment grade is used.

If value is not a valid grade ID then assume no grade used and return warning.

NOTE: You are not allowed to enter both AssessmentId and MaxScore.

Integer

O

MaxScore

This is the max score value, if custom activity used score as assessment type. Max score should be a valid positive number in range between 0.01 and 99999.99.

If the value less than 0.01 or greather than 99999.99 then no assessment is used.

If the customer has setting "Use score" is off then assume "Not assessment" used and return warning.

NOTE: You are not allowed to enter both AssessmentId and MaxScore.

Double

O

AssessmentVisible

If the assessments are available for participants. If not specified then assume not available.

Boolean: “True” / “False”

O

Locked

If the custom activity is locked for editing from UI. If not specified, then assume not locked.

Boolean: “True” / “False”

O

LearningObjectiveAssessment

What kind of assessment to use with learning objectives.

Default value - "DoNotUse".

Enumeration: "DoNotUse", "OutcomeStatus", "AssessmentCriteria".

O

AllowStudentsSetCompletion

If participants are allowed to set completion of task. Used only if neither grade nor score is used. If not specified then assume not allowed.

Boolean: “True” / “False”

O

LearningObjectives

List of associated learning objective or null

Object

O

LearningObjective

Learning objective element

Object

O

LearningObjectiveId

Learning objective identifier from repository

Text

M

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.

  • If there are no learning objectives connected to the element, the value for LearningObjectivesAssessment is set, but the setting isn't visible in the UI.

Output

Finished Status

  • Returns the ElementID and the SyncKey of the element.

Warning Status

  • Unknown assessment (grade) ID – “No assessment” assumed.

  • Max score should be a valid positive number in range between 0.01 and 99999.99 - "No Assessment" assumed.

  • Your settings don't allow you to use score as assessment alternative. Please contact your administrator. - "No Assessment" assumed.

Errors Status

  • Invalid format / parameters (different to specified schema).

  • Message contains duplicates for syncKeys: {0}. Make sure your syncKeys are globally unique.

  • User with specified UserID/UserSyncKey is not valid.

  • User with specified UserID/UserSyncKey is deleted.

  • User with specified UserID/UserSyncKey is external.

  • Course does not exist.

  • Course is external.

  • Course is be deleted.

  • Course is archived.

  • ParentSyncKey is not an element within the course.

  • ParentSyncKey is not a folder or valid parent element.

  • Folder related to ParentSyncKey has been deleted or removed.

  • ParentSyncKey cannot be found in the identifier map or is invalid.

  • Title must not be blank or contain invalid characters.

  • Rich content badly formatted or invalid in “Text”.

  • Invalid deadline date or not in UTC format.

  • Your security settings doesn't allow you to perform that operation. Please contact administration to grant you an access to {HieararchyName} organisation.

  • Course has no Learning Objectives enabled.

  • Item with id = '{ LearningObjectiveRepositoryUniqueId} ' is not a learning objective. Only learning objectives can be connected to a plan/an element.

  • Learning objective with UniqueId='{LearningObjectiveRepositoryUniqueId}' is not in the national learning objective repository.

  • Could not create/update element Custom Activity.

XML

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" type="SyncKeysType" minOccurs="0" maxOccurs="1" />
            <xs:element name="CreateCourseElementCustomActivity" type="CreateCustomActivityElementType" minOccurs="1" maxOccurs="1"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="SyncKeysType">
        <xs:sequence>
            <xs:element name="SyncKey" minOccurs="0" maxOccurs="1" type="xs:string" />
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="CreateCustomActivityElementType">
        <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:element name="ParentSyncKey" type="xs:string" minOccurs="0" maxOccurs="1" />
            <xs:element name="Active" type="xs:boolean" minOccurs="0" maxOccurs="1" default="true" />
            <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" type="xs:string" minOccurs="1" maxOccurs="1"/>
            <xs:element name="Description" type="xs:string" minOccurs="0" maxOccurs="1"/>
            <xs:element name="Deadline" type="xs:dateTime" minOccurs="0" maxOccurs="1"/>
            <xs:element name="Mandatory" type="xs:boolean" minOccurs="0" maxOccurs="1" default="true"/>
           
            <xs:choice minOccurs="0" maxOccurs="1">
                <xs:element name="AssessmentId" type="xs:int" default="0"/>
                <xs:element name="MaxScore" type="xs:double" default="0.00"/>
            </xs:choice>
            <xs:element name="AssessmentVisible" type="xs:boolean" minOccurs="0" maxOccurs="1" default="false" />
            <xs:element name="Locked" type="xs:boolean" minOccurs="0" maxOccurs="1" default="false" />
            <xs:element name="LearningObjectiveAssessment" type="LearningObjectiveAssessmentEnum" minOccurs="0" maxOccurs="1" default="DoNotUse" />
<xs:element name="AllowStudentsSetCompletion" type="xs:boolean" minOccurs="0" maxOccurs="1" default="false" />
<xs:element name="LearningObjectives" type="LearningObjectivesType" minOccurs="0" maxOccurs="1"/>
        </xs:sequence>
    </xs:complexType>
    <xs:simpleType name="LearningObjectiveAssessmentEnum">
      <xs:restriction base="xs:string">
        <xs:enumeration value="DoNotUse"/>
        <xs:enumeration value="OutcomeStatus"/>
        <xs:enumeration value="AssessmentCriteria"/>
      </xs:restriction>
    </xs:simpleType>
 
<xs:complexType name="LearningObjectivesType">
<xs:sequence>
<xs:element name="LearningObjective" type="LearningObjectiveType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="LearningObjectiveType">
<xs:sequence>
<xs:element name="LearningObjectiveId" type="xs:string" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:schema> 

Sample request with max score
<Message xmlns="urn:message-schema">
  <SyncKeys>
    <SyncKey>abc123</SyncKey>
  </SyncKeys>
  <CreateCourseElementCustomActivity>
    <CourseId>3011</CourseId>
    <Active>true</Active>
    <UserId>1</UserId>
    <Title>My Custom activity</Title>
    <Description>Description for custom activity</Description>
    <Mandatory>true</Mandatory>
    <MaxScore>3.99</MaxScore>
    <AssessmentVisible>true</AssessmentVisible>
    <Locked>false</Locked>
<LearningObjectiveAssessment>DoNotUse</LearningObjectiveAssessment>
<AllowStudentsSetCompletion>false</AllowStudentsSetCompletion>
 
<LearningObjectives>
<LearningObjective>
<LearningObjectiveId>CustomActivityLO1</LearningObjectiveId>
</LearningObjective>
<LearningObjective>
<LearningObjectiveId>CustomActivityLO2</LearningObjectiveId>
</LearningObjective>
</LearningObjectives>
</CreateCourseElementCustomActivity>
</Message>