fork download
  1. <?php
  2.  
  3. class Question
  4. {
  5. public $text;
  6. public $points = 5;
  7. public $answers;
  8. public $correctAnswer;
  9. }
  10.  
  11. function createQuestions()
  12. {
  13. $questions = array();
  14. // Question 1
  15.  
  16. $q = new Question;
  17. $q->text = "";
  18. $q->points = 0;
  19. $q->answers = array();
  20. $q->correctAnswer = '';
  21.  
  22. $questions[] = $q;
  23.  
  24.  
  25. $q1 = new Question;
  26. $q1->text = "Which is Boat?";
  27. $q1->points = 10;
  28. $q1->answers = array ('a' => 'Hirio', 'b' => 'Sorio', 'c' => 'Akagi', 'd' => 'Kaga');
  29. $q1->correctAnswer = 'b';
  30.  
  31. // Question 2
  32. $q2 = new Question;
  33. $q2->text = "Which city is capital of England?";
  34. $q2->points = 5;
  35. $q2->answers = array ('a' => 'London', 'b' => 'Moscow', 'c' => 'Tokyo', 'd' => 'Berlin');
  36. $q2->correctAnswer = 'a';
  37.  
  38. // Question 3
  39. $q3 = new Question;
  40. $q3->text = "Who is Einstein?";
  41. $q3->points = 30;
  42. $q3->answers = array ('a' => 'Singer', 'b' => 'Politic', 'c' => 'Gay', 'd' => 'The Scientist');
  43. $q3->correctAnswer = 'd';
  44.  
  45. return $questions;
  46. }
  47.  
  48.  
  49. ?>
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
Standard output is empty