Last active
January 6, 2016 16:56
-
-
Save rbren/750dbd2be2fa26189b00 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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