Skip to content

Instantly share code, notes, and snippets.

@rbren
Last active January 6, 2016 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbren/750dbd2be2fa26189b00 to your computer and use it in GitHub Desktop.
Save rbren/750dbd2be2fa26189b00 to your computer and use it in GitHub Desktop.
$cuePoint = new KalturaAdCuePoint;
$cuePoint->sourceUrl = $_POST["sourceUrl"];
$cuePoint->startTime = $_POST["startTime"];
$cuePoint->entryId = <%- Lucy.code.variable('answers.entryIdEqual') %>;
<% if (Lucy.answer("question") !== null) { -%>
$answer1 = new KalturaOptionalAnswer();
$answer1->key=1;
$answer1->text=<%- Lucy.answer("answer1") %>;
$answer1->isCorrect=<%- Lucy.answer("correctAnswer") === 0 ? "1" : "0" %>;
$answer2 = new KalturaOptionalAnswer();
$answer2->key=1;
$answer2->text=<%- Lucy.answer("answer2") %>;
$answer2->isCorrect=<%- Lucy.answer("correctAnswer") === 1 ? "1" : "0" %>;
$cuePoint->optionalAnswers = array($answer1, $answer2);
<% } -%>
$result = $client->cuePoint->add($cuePoint);
echo json_encode($result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment