This will update a custom activity element in a course. It will not update 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.
  • 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: ParentId must be an element ID within the course.
  • If specified: ParentId must be a folder.
  • If specified: ParentId must not be deleted.
  • 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.
  • Element must exist.
  • Element must not be deleted.
  • Element must be related the course.

Input

Parameters in:

Name

Description

Type

M/O

Message Type

Type of Message.

Text set to message type

M

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 updated.

Integer

O/M

CourseSyncKey

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

Text

O/M

ParentId

ID of the (previously created) folder where the element is to be created.

Integer

O

ParentSyncKey

SyncKey of the (previously created) folder where the element is to be created.

If not specified (null) then field won't be updated.

If empty string then element will be moved to root.

Must be a SyncKey or empty string (means root).

Text

O

ElementID

ElementID f custom activity.

Integer

O/M

ElementSyncKey

ElementSyncKey of custom activity.

Text

O/M

Active

Is the element active. If not specified then field won't be updated.

Boolean. True/False.

O

UserID

UserID of the editor.

Integer

O/M

UserSyncKey

User SyncKeyID of the editor.

Text

O/M

Title


Description of the custom activity.

Text

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

O

Description

Text (rich content) description of the custom activity. If not specified then field won't be updated.

Text

See user story on importing rich content for description of parsing

O

Deadline

If a date is specified then set to the time / date even if in the past. If not specified then field won't be updated.

Text.

Valid UTC date.


O

Mandatory

Is the custom activity mandatory. If not specified then field won't be updated.

Boolean: “True” / “False”


O

AssessmentId

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

If the value is missing then Assessment scale is not changed.

If value is not a valid grade ID then field won't be updated.

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 field won't be updated.

If the customer has setting "Use score" is off then do not change assessment scale type 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 field won't be updated.

Boolean: “True” / “False”

O

Locked 

If the custom activity is locked for editing from UI. If not specified then field won't be updated.

Boolean: “True” / “False”

O

SendUpdateNotification

If a notification should be sent to indicate that this activity has been updated. Assume "false" if not specified.

Boolean: “True” / “False”

O

LearningObjectiveAssessment

What kind of assessment to use with learning objectives.

If not specified then field won't be updated.

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

LearningObjectives

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.
  • Either ElementID or ElementSyncKey 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.

Output

Finished Status

  • Returns the ElementID and the SyncKey of the element.

Warning Status

  • Unknown assessment (grade) ID.
  • Max score should be a valid positive number in range between 0.01 and 99999.99.
  • Your settings don't allow you to use score as assessment alternative. Please contact your administrator.
  • The element has no  learning objectives connected to it. LearningObjectivesAssessment is set to DoNotUse.

Errors Status

  • Invalid format / parameters (different to specified schema).
  • User with specified UserId/UserSyncKey is not valid.
  • User with specified UserId/UserSyncKey is external.
  • User with specified UserId/UserSyncKey is deleted.
  • Course does not exist.
  • Course is external.
  • Course is be deleted.
  • Course is archived.
  • ParentSyncKey/ParentId is not an element within the course.
  • ParentSyncKey/ParentId is not a folder.
  • Folder related to ParentSyncKey/ParentId has been deleted or removed.
  • Message must contain valid ParentId.
  • 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} organization
  • Element does not exist 
  •  Element is deleted
  • "Assessment set-up for Assessment scale" cannot be changed when participants have already been assessed
  • "Assessment set-up  for Learning objectives" cannot be changed when participants have already  been assessed
  • Element is not within the course specified.
  • Course has no Learning Objectives enabled.
  • Learning objective is not a leaf. Only most granular learning objective can be assigned to elements.
  • Learning objective with UniqueId='{LearningObjectiveId}' is not in the learning objective repository.
  • Learning objectives cannot be changed if they have already been assessed.
  • 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="UpdateCourseElementCustomActivity" type="UpdateCustomActivityElementType" minOccurs="1" maxOccurs="1"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="UpdateCustomActivityElementType">
        <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="ElementId" type="xs:integer" />
              <xs:element name="ElementSyncKey" type="xs:string" />
            </xs:choice>
            <xs:element name="Active" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="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="0" maxOccurs="1" nillable="true"/>
            <xs:element name="Description" type="xs:string" minOccurs="0" maxOccurs="1" nillable="true"/>
            <xs:element name="Deadline" type="xs:dateTime" minOccurs="0" maxOccurs="1"/>
            <xs:element name="Mandatory" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="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" nillable="true" />
            <xs:element name="Locked" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="true" />
            <xs:element name="SendUpdateNotification" type="xs:boolean" minOccurs="0" maxOccurs="1" default="false" />
            <xs:element name="LearningObjectiveAssessment" type="LearningObjectiveAssessmentEnum" minOccurs="0" maxOccurs="1" nillable="true" />
<xs:element name="AllowStudentsSetCompletion" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="true" />
<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 assessment id
<Message xmlns="urn:message-schema">
    <UpdateCourseElementCustomActivity>
        <CourseId>1</CourseId>
        <ElementId>11939</ElementId>
        <Active>true</Active>
        <UserId>2</UserId>
        <Title>My Imported offline assessment - changed</Title>
        <Description>This offline assessment was imported. - changed</Description>
        <Deadline>2013-08-28T18:50:01+04:00</Deadline>
        <Mandatory>true</Mandatory>
        <AssessmentId>2</AssessmentId>
        <AssessmentVisible>true</AssessmentVisible>
        <Locked>false</Locked>
        <SendUpdateNotification>true</SendUpdateNotification>
<LearningObjectiveAssessment>DoNotUse</LearningObjectiveAssessment>
<AllowStudentsSetCompletion>false</AllowStudentsSetCompletion>
 
<LearningObjectives>
<LearningObjective>
<LearningObjectiveId>CustomActivityLO1</LearningObjectiveId>
</LearningObjective>
<LearningObjective>
<LearningObjectiveId>CustomActivityLO2</LearningObjectiveId>
</LearningObjective>
</LearningObjectives>
 
</UpdateCourseElementCustomActivity>
</Message>


To remove learning objectives from element set empty LearningObjectives tag.

Sample:

<Message xmlns="urn:message-schema" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<UpdateCourseElementCustomActivity>
<CourseId>1</CourseId>
<ElementId>11939</ElementId>
<Active>true</Active>
<UserId>2</UserId>
<Title>My Imported offline assessment - changed</Title>
<Description>This offline assessment was imported. - changed</Description>
<Deadline>2013-08-28T18:50:01+04:00</Deadline>
<Mandatory>true</Mandatory>
<AssessmentId>2</AssessmentId>
<AssessmentVisible>true</AssessmentVisible>
<Locked>false</Locked>
<SendUpdateNotification>true</SendUpdateNotification>
<LearningObjectiveAssessment>DoNotUse</LearningObjectiveAssessment>
<AllowStudentsSetCompletion>false</AllowStudentsSetCompletion>
<LearningObjectives>
</LearningObjectives>
</UpdateCourseElementCustomActivity>
</Message>