Quiz.class.php 1004 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Exercises backup script
  5. * @package chamilo.backup
  6. */
  7. /**
  8. * Code
  9. */
  10. require_once 'Resource.class.php';
  11. /**
  12. * An Quiz
  13. * @author Bart Mollet <bart.mollet@hogent.be>
  14. * @package chamilo.backup
  15. */
  16. class Quiz extends Resource
  17. {
  18. /**
  19. * Create a new Quiz
  20. * @param string $title
  21. * @param string $description
  22. * @param int $random
  23. * @param int $type
  24. * @param int $active
  25. */
  26. public $obj; //question
  27. function Quiz($obj)
  28. {
  29. $this->obj = $obj;
  30. $this->obj->quiz_type = $this->obj->type;
  31. parent::Resource($obj->iid, RESOURCE_QUIZ);
  32. }
  33. /**
  34. * Add a question to this Quiz
  35. */
  36. function add_question($id, $question_order)
  37. {
  38. $this->obj->question_ids[] = $id;
  39. $this->obj->question_orders[] = $question_order;
  40. }
  41. /**
  42. * Show this question
  43. */
  44. function show()
  45. {
  46. parent::show();
  47. echo $this->obj->title;
  48. }
  49. }