View sourcecode

The following files exists in this folder. Click to view.

answer-json_tpl.php

1 lines ASCII Unix (LF)
1
{
    "details":  "Generated for <?=$acronym?> at <?=$created?>.",
    "key":      "<?=$key?>",
    "answers":  {
        <?php 
        $sectionId = 0;
        $json = "";
        foreach ($sections as $section) {
            $sectionId++;
            $questionId = 0;

            foreach ($section['questions'] as $question) {
                $questionId++;
                $answer = formatAnswerJSON($question['answer']());
                $json .= "    \"$sectionId.$questionId\":    $answer,\n";
            }
        }
        echo substr($json, 0, -2) . "\n";?>
    }
}