Survey.class.php 2.6 KB

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