You are here

private function OpignoScormPlayer::opignoScormPlayerStartSco in Opigno SCORM 8

Same name and namespace in other branches
  1. 3.x src/OpignoScormPlayer.php \Drupal\opigno_scorm\OpignoScormPlayer::opignoScormPlayerStartSco()

Determine the start SCO for the SCORM package.

@todo Get last viewed SCO.

Parameters

array $flat_tree: Flat tree.

Return value

object Start SCO.

1 call to OpignoScormPlayer::opignoScormPlayerStartSco()
OpignoScormPlayer::toRendarableArray in src/OpignoScormPlayer.php
Build rendarable array for scorm package output.

File

src/OpignoScormPlayer.php, line 163

Class

OpignoScormPlayer
Class OpignoScormPlayer.

Namespace

Drupal\opigno_scorm

Code

private function opignoScormPlayerStartSco(array $flat_tree) {
  foreach ($flat_tree as $sco) {
    if (!empty($sco->launch)) {
      return $sco;
    }
  }

  // Failsafe. Just get the first element.
  return array_shift($flat_tree);
}