Survey.class.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. require_once 'Resource.class.php';
  4. /**
  5. * Survey
  6. * @author Yannick Warnier <yannick.warnier@beeznest.com>
  7. * @package chamilo.backup
  8. */
  9. class Survey extends Coursecopy\Resource
  10. {
  11. /**
  12. * The survey code
  13. */
  14. public $code;
  15. /**
  16. * The title and subtitle
  17. */
  18. public $title;
  19. public $subtitle;
  20. /**
  21. * The author's name
  22. */
  23. public $author;
  24. /**
  25. * The survey's language
  26. */
  27. public $lang;
  28. /**
  29. * The availability period
  30. */
  31. public $avail_from;
  32. public $avail_till;
  33. /**
  34. * Flag for shared status
  35. */
  36. public $is_shared;
  37. /**
  38. * Template used
  39. */
  40. public $template;
  41. /**
  42. * Introduction text
  43. */
  44. public $intro;
  45. /**
  46. * Thanks text
  47. */
  48. public $surveythanks;
  49. /**
  50. * Creation date
  51. */
  52. public $creation_date;
  53. /**
  54. * Invitation status
  55. */
  56. public $invited;
  57. /**
  58. * Answer status
  59. */
  60. public $answered;
  61. /**
  62. * Invitation and reminder mail contents
  63. */
  64. public $invite_mail;
  65. public $reminder_mail;
  66. /**
  67. * Questions and invitations lists
  68. */
  69. public $question_ids;
  70. public $invitation_ids;
  71. /**
  72. * Create a new Survey
  73. * @param string $code
  74. * @param string $title
  75. * @param string $subtitle
  76. * @param string $author
  77. * @param string $lang
  78. * @param string $avail_from
  79. * @param string $avail_till
  80. * @param char $is_shared
  81. * @param string $template
  82. * @param string $intro
  83. * @param string $surveythanks
  84. * @param string $creation_date
  85. * @param int $invited
  86. * @param int $answered
  87. * @param string $invite_mail
  88. * @param string $reminder_mail
  89. */
  90. public function __construct(
  91. $id,
  92. $code,
  93. $title,
  94. $subtitle,
  95. $author,
  96. $lang,
  97. $avail_from,
  98. $avail_till,
  99. $is_shared,
  100. $template,
  101. $intro,
  102. $surveythanks,
  103. $creation_date,
  104. $invited,
  105. $answered,
  106. $invite_mail,
  107. $reminder_mail
  108. ) {
  109. parent::__construct($id, RESOURCE_SURVEY);
  110. $this->code = $code;
  111. $this->title = $title;
  112. $this->subtitle = $subtitle;
  113. $this->author = $author;
  114. $this->lang = $lang;
  115. $this->avail_from = $avail_from;
  116. $this->avail_till = $avail_till;
  117. $this->is_shared = $is_shared;
  118. $this->template = $template;
  119. $this->intro = $intro;
  120. $this->surveythanks = $surveythanks;
  121. $this->creation_date = $creation_date;
  122. $this->invited = $invited;
  123. $this->answered = $answered;
  124. $this->invite_mail = $invite_mail;
  125. $this->reminder_mail = $reminder_mail;
  126. $this->question_ids = array();
  127. $this->invitation_ids = array();
  128. }
  129. /**
  130. * Add a question to this survey
  131. */
  132. public function add_question($id)
  133. {
  134. $this->question_ids[] = $id;
  135. }
  136. /**
  137. * Add an invitation to this survey
  138. */
  139. public function add_invitation($id)
  140. {
  141. $this->invitation_ids[] = $id;
  142. }
  143. /**
  144. * Show this survey
  145. */
  146. public function show()
  147. {
  148. parent::show();
  149. echo $this->code.' - '.$this->title;
  150. }
  151. }