<?php
// archive-ipq-co.narod.ru
class Question
{
public $text; // текст вопроса
public $points = 5; // число баллов, по умолчанию 5
public $answers; // варианты ответов
public $correctAnswer; // правильный ответ
}
function createQuestions()
{
$q = new Question;
$q->text = "how do i shot web?";
$q->answers = array("a"=>"I dunno, lol", 'b'=> "it's Ez"); $q->correctAnswer = 'b';
// Кладем вопрос в массив
$questions[] = $q;
$q = new Question;
$q->text = "Теперь понятно?";
$q->points = 999;
$q->answers = array('a'=>"Да, няша", 'b'=>'я нихуя не понел'); $q->correctAnswer = 'a';
$questions[] = $q;
return $questions;
}
PD9waHAKCi8vIGFyY2hpdmUtaXBxLWNvLm5hcm9kLnJ1CmVycm9yX3JlcG9ydGluZygtMSk7CgpjbGFzcyBRdWVzdGlvbgp7CiAgICBwdWJsaWMgJHRleHQ7ICAgICAgICAgICAvLyDRgtC10LrRgdGCINCy0L7Qv9GA0L7RgdCwCiAgICBwdWJsaWMgJHBvaW50cyA9IDU7ICAgICAvLyDRh9C40YHQu9C+INCx0LDQu9C70L7Qsiwg0L/QviDRg9C80L7Qu9GH0LDQvdC40Y4gNQogICAgcHVibGljICRhbnN3ZXJzOyAgICAgICAgLy8g0LLQsNGA0LjQsNC90YLRiyDQvtGC0LLQtdGC0L7QsgogICAgcHVibGljICRjb3JyZWN0QW5zd2VyOyAgLy8g0L/RgNCw0LLQuNC70YzQvdGL0Lkg0L7RgtCy0LXRggp9CgoKCmZ1bmN0aW9uIGNyZWF0ZVF1ZXN0aW9ucygpCnsKICAgICRxdWVzdGlvbnMgPSBhcnJheSgpOwogCiAgICAkcSA9IG5ldyBRdWVzdGlvbjsKICAgICRxLT50ZXh0ID0gImhvdyBkbyBpIHNob3Qgd2ViPyI7CiAgICAkcS0+YW5zd2VycyA9IGFycmF5KCJhIj0+IkkgZHVubm8sIGxvbCIsICdiJz0+ICJpdCdzIEV6Iik7CiAgICAkcS0+Y29ycmVjdEFuc3dlciA9ICdiJzsKICAgIC8vINCa0LvQsNC00LXQvCDQstC+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