You are here

function opigno_tincan_activities_get_verb_and_definition_type in Opigno TinCan API 8

Same name and namespace in other branches
  1. 3.x modules/opigno_tincan_activities/opigno_tincan_activities.module \opigno_tincan_activities_get_verb_and_definition_type()

Returns activity type verb and definition type.

1 call to opigno_tincan_activities_get_verb_and_definition_type()
_opigno_tincan_activities_create_and_send_statements in modules/opigno_tincan_activities/opigno_tincan_activities.module
The main function for building tincan statement object for opigno activity.

File

modules/opigno_tincan_activities/opigno_tincan_activities.module, line 311
Contains opigno_tincan_activities.module.

Code

function opigno_tincan_activities_get_verb_and_definition_type($activity_type) {
  $properties = [];
  switch ($activity_type) {
    case 'opigno_file_upload':
      $verb = OpignoTincanApiTinCanVerbs::$attached;
      $definition_type = OpignoTincanApiTinCanActivityDefinitionTypes::$file;
      break;
    case 'opigno_slide':
      $verb = OpignoTincanApiTinCanVerbs::$viewed;
      $definition_type = OpignoTincanApiTinCanActivityDefinitionTypes::$media;
      break;
    case 'opigno_video':
      $verb = OpignoTincanApiTinCanVerbs::$played;
      $definition_type = OpignoTincanApiTinCanActivityDefinitionTypes::$video;
      break;
    default:
      $verb = OpignoTincanApiTinCanVerbs::$answered;
      $definition_type = OpignoTincanApiTinCanActivityDefinitionTypes::$question;
      break;
  }
  $properties['verb'] = $verb;
  $properties['definition_type'] = $definition_type;
  return $properties;
}