Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
page_decision_tree.inc
1 <?php
18 require_once SQ_CORE_PACKAGE_PATH.'/page/page.inc';
19 
20 
30 class Page_Decision_Tree extends Page
31 {
32 
33 
42  function __construct($assetid=0)
43  {
44  $this->_ser_attrs = TRUE;
45  parent::__construct($assetid);
46 
47  }//end constructor
48 
49 
60  protected function _createAdditional(Array &$link)
61  {
62  if (!parent::_createAdditional($link)) return FALSE;
63 
64  // add a bodycopy to this page when creating
65  $GLOBALS['SQ_SYSTEM']->am->includeAsset('bodycopy');
66  $GLOBALS['SQ_SYSTEM']->am->includeAsset('folder');
67 
68  $sub_assets= Array(
69  'type_formats' => 'folder',
70  'result_bodycopies' => 'folder',
71  );
72 
73  foreach ($sub_assets as $name => $type) {
74  $asset = new $type();
75  $copy_link = Array('asset' => &$this, 'value' => $name ,'link_type' => SQ_LINK_TYPE_2, 'is_dependant' => 1, 'is_exclusive' => 1);
76 
77  $asset->setAttrValue('name', ucwords(str_replace('_',' ', $name)));
78  if (!$asset->create($copy_link)) return FALSE;
79 
80  $GLOBALS['SQ_SYSTEM']->am->forgetAsset($asset);
81  unset($asset);
82  }
83 
84  $asset = new Bodycopy();
85  $copy_link = Array('asset' => &$this, 'value' => 'page_contents' ,'link_type' => SQ_LINK_TYPE_2, 'is_dependant' => 1, 'is_exclusive' => 1);
86  $asset->setAttrValue('name', 'Page Contents');
87  $args = Array('content' => $this->_getDefaultBodycopyContent('page_contents'));
88  if (!$asset->create($copy_link, $args)) return FALSE;
89 
90  if (!$this->_createTypeFormat('decision_tree_question_type_select')) return FALSE;
91  if (!$this->_createTypeFormat('decision_tree_question_type_numeric')) return FALSE;
92 
93  return $this->createResultBodycopy('Default Result Bodycopy', 'default_result_bodycopy');
94 
95  }//end _createAdditional()
96 
97 
105  function _getAllowedLinks()
106  {
107  $page_links = parent::_getAllowedLinks();
108  $page_links[SQ_LINK_TYPE_2]['decision_tree_question'] = Array('card' => 'M', 'exclusive' => FALSE);
109  $page_links[SQ_LINK_NOTICE]['decision_tree_question'] = Array('card' => 1, 'exclusive' => FALSE);
110  $page_links[SQ_LINK_TYPE_2]['bodycopy'] = Array('card' => '1', 'exclusive' => TRUE);
111 
112  return $page_links;
113 
114  }//end _getAllowedLinks()
115 
116 
125  public function isDeletableLink($linkid)
126  {
127  // the only reason why we would object to this link being
128  // deleted is if it is the bodycopy linked to us
129  $bodycopy_link = $GLOBALS['SQ_SYSTEM']->am->getLink($this->id, SQ_LINK_TYPE_2, 'bodycopy', TRUE, 'page_contents', 'major', TRUE);
130  if (!$GLOBALS['SQ_PURGING_TRASH'] && (!empty($bodycopy_link) && $bodycopy_link['linkid'] == $linkid)) {
131  return translate('error_bodycopy_link_cannot_delete');
132  }
133 
134  return parent::isDeletableLink($linkid);
135 
136  }//end isDeletableLink()
137 
138 
149  public function printFrontendAsset(Asset $asset, $design=NULL)
150  {
151 
152  //we are getting an AJAX Request
153  if (isset($_GET['q_id']) && isset($_GET['a_id']) && isset($_GET['pts'])){
154  if (!$asset->readAccess()) {
155  $GLOBALS['SQ_SYSTEM']->paintLogin(translate('login'), translate('cannot_access_asset', $asset->name));
156  return;
157  }
158  $this->printNextStep($_GET['q_id'], $_GET['a_id'], $_GET['pts']);
159  return;
160  }
161 
162  parent::printFrontendAsset($asset, $design);
163 
164  }//printFrontendAsset()
165 
166 
175  public function printBody()
176  {
177 
178  $replacements = Array();
179 
180  $page_contents = $GLOBALS['SQ_SYSTEM']->am->getLink($this->id, SQ_LINK_TYPE_2, 'bodycopy', TRUE, 'page_contents', 'major', TRUE);
181  if (empty($page_contents)) return;
182 
183  $bodycopy = $GLOBALS['SQ_SYSTEM']->am->getAsset($page_contents['minorid']);
184 
185  // check to see if the bodycopy attached to this form has any content
186  if ($bodycopy && !$bodycopy->isEmpty()) {
187  $keyword_list = $bodycopy->getKeywords();
188 
189  if (!empty($keyword_list)) {
190  foreach ($keyword_list as $keyword) {
191  // Question related keywords are found here
192  $replacement = $this->getPageContentsKeywordReplacement($keyword);
193 
194  if (is_null($replacement)) {
195  // If not picked up by first function, this will pick up
196  // replacements placed in separate functions - CAPTCHA,
197  // errors, for instance
198  $replacement = $this->getKeywordReplacement($keyword);
199  }
200 
201  if (!is_null($replacement)) {
202  // We have something from one of the above
203  $replacements[$keyword] = $replacement;
204  }
205  }
206  }
207 
208  $bodycopy->setKeywordReplacements($replacements);
209  $bodycopy->printBody();
210 
211  }
212  }//end printBody()
213 
214 
225  public function printNextStep($question_id, $answer, $total_points){
226 
227  $question = $GLOBALS['SQ_SYSTEM']->am->getAsset($question_id);
228  if (is_null($question)) return;
229 
230  if ($question->type() == 'decision_tree_question_type_select' && $answer === $question->attr('empty_key')) return;
231 
232  $destinations = $question->attr('question_destinations');
233  if (empty($destinations)) return;
234 
235  if ($question->type() == 'decision_tree_question_type_numeric'){
236  $rules = $question->attr('rules');
237  foreach ($rules as $rule_index => $rule_details){
238  $valid = $question->evaluate($answer, $rule_details);
239  if ($valid == TRUE){
240  $answer = $rule_index;
241  break;
242  }
243  }
244  if (empty($valid)) return;
245  }
246 
247  $answer_dest = $destinations[$answer];
248  $answer_pts = (!empty($answer_dest['points_value'])) ? $answer_dest['points_value'] : 0;
249  //add the total points so far + the points of the answer to this question
250  $accumulated_pts = $total_points + $answer_pts;
251 
252  if (!empty($answer_dest['next_question'])) {
253  $new_question = $GLOBALS['SQ_SYSTEM']->am->getAsset($answer_dest['next_question']);
254  $bodycopy = $this->getBodycopy($new_question->type(), 'type_formats');
255  } else if (!empty($answer_dest['result_bodycopy'])) {
256  $bodycopy = $GLOBALS['SQ_SYSTEM']->am->getAsset($answer_dest['result_bodycopy']);
257  } else {
258  $bodycopy_points = $this->attr('bodycopy_points');
259  foreach ($bodycopy_points as $assetid => $points){
260  if ($accumulated_pts >= $points['min'] && $accumulated_pts <= $points['max']){
261  $bodycopy = $GLOBALS['SQ_SYSTEM']->am->getAsset($assetid);
262  break;
263  }
264  }
265 
266  if (!isset($bodycopy)){
267  //use default result bodycopy
268  $bodycopy = $this->getBodycopy('default_result_bodycopy', 'result_bodycopies');
269  }
270  }
271 
272  $replacements = Array();
273  // check to see if the bodycopy attached to this form has any content
274  if ($bodycopy && !$bodycopy->isEmpty()) {
275  $keyword_list = $bodycopy->getKeywords();
276 
277  if (!empty($keyword_list)) {
278  foreach ($keyword_list as $keyword) {
279  // Question related keywords are found here
280  $replacement = NULL;
281  if ($keyword == 'accumulated_points'){
282  $replacements[$keyword] = $accumulated_pts;
283  continue;
284  }
285 
286  if (isset($new_question)){
287  $replacement = $this->getTypeFormatKeywordReplacement($keyword, $new_question);
288  }
289  if (is_null($replacement)) {
290  // If not picked up by first function, this will pick up
291  // replacements placed in separate functions - CAPTCHA,
292  // errors, for instance
293  $replacement = $this->getKeywordReplacement($keyword);
294  }
295 
296  if (!is_null($replacement)) {
297  // We have something from one of the above
298  $replacements[$keyword] = $replacement;
299  }
300  }
301  }
302 
303  $bodycopy->setKeywordReplacements($replacements);
304  if (isset($new_question)) {
305  echo '<input id="q'.$new_question->id.'_points" name="q'.$new_question->id.'_points" type="hidden" value="'.$answer_pts.'" />';
306  echo '<div id="q'.$new_question->id.'_wrapper" class="sq_question_wrapper">';
307  } else {
308  echo '<div class="sq_result_bodycopy">';
309  }
310 
311  $bodycopy->printBody();
312  echo '</div>';
313  }
314  }//end printNextStep()
315 
316 
327  public function generateJS($question){
328 
329  $current_url = $this->getURL();
330  $default_val = ($question->type() == 'decision_tree_question_type_select') ? $question->attr('empty_key') : '';
331  // regex code - allow empty or leading plus or minute, digits, decimal point
332  $regex_code = '/(^$)|(^[-+]?\d*\.?\d+$)/';
333 
334  ob_start();
335  ?>
336  <script type="text/javascript">
337 
338  var accum_points=new Array();
339  var curr_id = 1;
340 
341  function get_next_step(answer, question)
342  {
343 
344  if (document.getElementById("q"+question).type == 'text'){
345  var result = decision_tree_validate_numeric(answer);
346  if (result == null) {
347  alert ('You must enter a numeric answer');
348  return;
349  }
350  }
351 
352  //extract the question number from the wrapper DIV so we can know where to place next question
353  var q_element = document.getElementById("q"+question+"_wrapper");
354  var req_div = q_element.parentNode;
355  curr_id = req_div.id;
356  curr_id = curr_id.substring(1);
357  curr_id = parseInt(curr_id);
358 
359  try
360  {
361  xmlHttp=new XMLHttpRequest();
362  }
363  catch(e)
364  {
365  try
366  {
367  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
368  }
369  catch(e)
370  {
371  alert ("Your browser does not support XMLHTTP!");
372  return;
373  }
374  }
375 
376  var points = calculate_points(question);
377  var url = "<?php echo $current_url ?>";
378 
379  xmlHttp.onreadystatechange = question_state_changed;
380  url=url+'?a_id='+answer+'&q_id='+question+'&pts='+points;
381  xmlHttp.open("GET", url, true);
382  xmlHttp.send(null);
383  }
384 
385  function question_state_changed()
386  {
387  if (xmlHttp.readyState==4 && xmlHttp.status==200)
388  {
389  var q_no = curr_id;
390  q_no++;
391 
392  var nextdiv = document.getElementById("q"+q_no);
393  var response = xmlHttp.responseText;
394  nextdiv.innerHTML=response;
395 
396  //create another question DIV after this one ready to store the next answer.
397  q_no++;
398  var divIdName = "q"+q_no;
399  var newdiv = document.createElement('div');
400  newdiv.setAttribute("id",divIdName);
401  nextdiv.appendChild(newdiv);
402  }
403  }
404 
405  function calculate_points(question)
406  {
407  var points = 0;
408  var q_no = curr_id;
409 
410  var points_element = document.getElementById("q"+question+"_points");
411  var point_val = 0;
412  if (points_element != null) point_val = points_element.value;
413  accum_points[q_no] = parseFloat(point_val);
414 
415 
416  for (var i = 1; i <= q_no; i++) {
417  points = points + accum_points[i];
418  }
419 
420  return points;
421  }
422 
423  function reset_questions()
424  {
425  get_next_step("<?php echo $default_val; ?>", <?php echo $question->id; ?>);
426  var first_q = document.getElementById("<?php echo "q".$question->id; ?>");
427  if (first_q.type == "radio") {
428  var radio_boxes = document.getElementsByName(first_q.name);
429  for (var e = 0; e < radio_boxes.length; e++) {
430  if (radio_boxes[e].type == "radio") {
431  radio_boxes[e].checked = false;
432  }
433  }
434  } else if (first_q.type == "select-one") {
435  first_q.selectedIndex = "<?php echo $default_val; ?>";
436  } else if (first_q.type == "text") {
437  first_q.value = "";
438  }
439  }
440 
441  function decision_tree_validate_numeric(answer)
442  {
443  answer.replace(/,/, "");
444  return answer.match(<?php echo $regex_code ?>);
445 
446  }
447 
448  </script>
449  <?php
450  $contents = ob_get_contents();
451  ob_end_clean();
452 
453  return $contents;
454 
455  }//end generateJS()
456 
457 
466  private function _createTypeFormat($new_type)
467  {
468  $edit_fns = $this->getEditFns();
469  $folder = $this->getFolder('type_formats');
470  $types = $GLOBALS['SQ_SYSTEM']->am->getTypeDescendants('decision_tree_question');
471 
472  // check that the new type is valid
473  if ($new_type != '' && !in_array($new_type, $types)) {
474  trigger_localised_error('CMS0045', E_USER_WARNING, $new_type);
475  return FALSE;
476  }
477 
478  // check that this type isnt already customised
479  $current_link = $GLOBALS['SQ_SYSTEM']->am->getLink($folder->id, SQ_LINK_TYPE_2, 'bodycopy', TRUE, $new_type);
480  if (empty($current_link)) {
481  // create a new format bodycopy for this type
482  $GLOBALS['SQ_SYSTEM']->changeDatabaseConnection('db2');
483  $GLOBALS['SQ_SYSTEM']->doTransaction('BEGIN');
484  $GLOBALS['SQ_SYSTEM']->am->includeAsset('bodycopy');
485 
486  $copy_link = Array(
487  'asset' => &$folder,
488  'value' => $new_type,
489  'link_type' => SQ_LINK_TYPE_2,
490  'is_dependant' => 1,
491  'is_exclusive' => 1,
492  );
493 
494  $bodycopy = new Bodycopy();
495  $bodycopy->setAttrValue('name', $GLOBALS['SQ_SYSTEM']->am->getTypeInfo($new_type, 'name').' Format');
496  $args = Array('content' => $this->_getDefaultBodycopyContent($new_type));
497  if (!$bodycopy->create($copy_link, $args)) {
498  $GLOBALS['SQ_SYSTEM']->doTransaction('ROLLBACK');
499  $GLOBALS['SQ_SYSTEM']->restoreDatabaseConnection();
500  return FALSE;
501  }
502  $GLOBALS['SQ_SYSTEM']->doTransaction('COMMIT');
503  $GLOBALS['SQ_SYSTEM']->restoreDatabaseConnection();
504  } else {
505  trigger_localised_error('CMS0046', E_USER_WARNING, $new_type);
506  return FALSE;
507  }
508 
509  return TRUE;
510 
511  }//end _createTypeFormat()
512 
513 
522  public function &getFolder($type='type_formats')
523  {
524  $null = NULL;
525  $link = $GLOBALS['SQ_SYSTEM']->am->getLink($this->id, SQ_LINK_TYPE_2, 'folder', TRUE, $type);
526  if (empty($link)) return $null;
527 
528  $folder = $GLOBALS['SQ_SYSTEM']->am->getAsset($link['minorid'], $link['minor_type_code']);
529  if (is_null($folder)) return $null;
530 
531  return $folder;
532 
533  }//end getFolder()
534 
535 
544  private function _getDefaultBodycopyContent($bodycopy_code)
545  {
546  switch ($bodycopy_code) {
547  case 'page_contents':
548  return '%decision_tree_contents% <br /> %reset_button%';
549  case 'decision_tree_question_type_select':
550  return '%question_title% <br /> %question_field%';
551  case 'decision_tree_question_type_numeric':
552  return '%question_title% <br /> %question_field% &nbsp; %question_button%';
553  }
554  return '';
555 
556  }//end _getDefaultBodycopyContent()
557 
558 
569  public function &getBodycopy($name='', $type='')
570  {
571  $null = NULL;
572 
573  if (!$name || !$type) return $null;
574  $am = $GLOBALS['SQ_SYSTEM']->am;
575 
576  $folder = $this->getFolder($type);
577  if (is_null($folder)) return $null;
578 
579  $bodycopy_link = $GLOBALS['SQ_SYSTEM']->am->getLink($folder->id, SQ_LINK_TYPE_2, 'bodycopy', TRUE, $name);
580  if (empty($bodycopy_link)) return $null;
581 
582  $bodycopy = $am->getAsset($bodycopy_link['minorid'], $bodycopy_link['minor_type_code']);
583 
584  return $bodycopy;
585 
586  }//end getBodycopy()
587 
588 
589  /*
590  * Makes a call to getLinks() function to get all bodycopyies under the Result Bodycopies folder.
591  * Mainly used it Page_Decision_Tree_Edit_Fns.
592  *
593  * @return Array
594  * @access public
595  */
596  public function getResultBodycopies()
597  {
598 
599  $folder = $this->getFolder('result_bodycopies');
600  $bodycopies = (!empty($folder)) ? $GLOBALS['SQ_SYSTEM']->am->getLinks($folder->id, SQ_LINK_TYPE_2, 'bodycopy', TRUE) : Array();
601 
602  return $bodycopies;
603 
604  }//end getResultBodycopies()
605 
606 
616  public function createResultBodycopy($name, $link_value)
617  {
618  $GLOBALS['SQ_SYSTEM']->changeDatabaseConnection('db2');
619  $GLOBALS['SQ_SYSTEM']->doTransaction('BEGIN');
620 
621  $GLOBALS['SQ_SYSTEM']->am->includeAsset('bodycopy');
622  $asset = new Bodycopy();
623  $parent = $this->getFolder('result_bodycopies');
624  if (is_null($parent)) return FALSE;
625 
626  $copy_link = Array('asset' => $parent, 'value' => $link_value ,'link_type' => SQ_LINK_TYPE_2, 'is_dependant' => 1, 'is_exclusive' => 1);
627  $asset->setAttrValue('name', $name);
628  if (!$asset->create($copy_link)) {
629  $GLOBALS['SQ_SYSTEM']->doTransaction('ROLLBACK');
630  $GLOBALS['SQ_SYSTEM']->restoreDatabaseConnection();
631  return FALSE;
632  }
633 
634  $GLOBALS['SQ_SYSTEM']->doTransaction('COMMIT');
635  $GLOBALS['SQ_SYSTEM']->restoreDatabaseConnection();
636 
637  return TRUE;
638 
639  }//end createResultBodycopy()
640 
641 
651  public function getTypeFormatKeywordReplacement($keyword, $question_asset)
652  {
653 
654  $replacement = NULL;
655  if (empty($question_asset)) return $replacement;
656  $is_question_keyword = preg_match('/^question\_(.*)$/', $keyword, $question_matches);
657 
658  if ($is_question_keyword) {
659  // Sub keyword in $matches[1] - eg. 'field', 'note', 'label'
660  list(, $sub_keyword) = $question_matches;
661  switch ($sub_keyword) {
662  case 'field' :
663  $replacement = $question_asset->getHtmlField();
664  break;
665 
666  case 'title' :
667  $replacement = $question_asset->attr('name');
668  break;
669 
670  case 'note' :
671  $replacement = $question_asset->attr('note');
672  break;
673 
674  case 'button' :
675  if ($question_asset->type() != 'decision_tree_question_type_numeric') break;
676  $replacement = $question_asset->getHtmlButton();
677  break;
678  }//end switch
679  }
680 
681  return $replacement;
682 
683  }//end getTypeFormatKeywordReplacement()
684 
685 
695  public function getPageContentsKeywordReplacement($keyword){
696 
697  $replacement = NULL;
698  $replacements = Array();
699 
700  if ($keyword == 'reset_button') {
701  ob_start();
702  reset_button('qReset', 'Reset', 'reset_questions()');
703  $replacement = ob_get_contents();
704  ob_end_clean();
705  return $replacement;
706  }
707 
708  if ($keyword != 'decision_tree_contents') return $replacement;
709 
710  $first_question = $GLOBALS['SQ_SYSTEM']->am->getLink($this->id, SQ_LINK_NOTICE, 'decision_tree_question', FALSE, 'first_question');
711  if (empty($first_question)) {
712  trigger_localised_error('CMS0118', E_USER_NOTICE, $this->id);
713  return $replacement;
714  }
715 
716  $question = $GLOBALS['SQ_SYSTEM']->am->getAsset($first_question['minorid']);
717 
718  $bodycopy = $this->getBodycopy($question->type(), 'type_formats');
719  // check to see if the bodycopy attached to this form has any content
720  if ($bodycopy && !$bodycopy->isEmpty()) {
721  $keyword_list = $bodycopy->getKeywords();
722 
723  if (!empty($keyword_list)) {
724  foreach ($keyword_list as $keyword) {
725  $replacement = NULL;
726  if ($keyword == 'accumulated_points'){
727  $replacements[$keyword] = 0;
728  continue;
729  }
730  // Question related keywords are found here
731  $replacement = $this->getTypeFormatKeywordReplacement($keyword, $question);
732 
733  if (is_null($replacement)) {
734  // If not picked up by first function, this will pick up
735  // replacements placed in separate functions - CAPTCHA,
736  // errors, for instance
737  $replacement = $this->getKeywordReplacement($keyword);
738  }
739 
740  if (!is_null($replacement)) {
741  // We have something from one of the above
742  $replacements[$keyword] = $replacement;
743  }
744  }
745  }
746 
747  $bodycopy->setKeywordReplacements($replacements);
748  ob_start();
749  echo '<div id="questions">';
750  echo '<div id="q1">';
751  echo '<div id="q'.$first_question['minorid'].'_wrapper" class="sq_question_wrapper">';
752  $bodycopy->printBody();
753  echo '</div>';
754  echo '<div id="q2">';
755  echo '</div>';
756  echo '</div>';
757  echo '</div>';
758  $ajax = $this->generateJS($question);
759  echo $ajax;
760  $replacement = ob_get_contents();
761 
762  ob_end_clean();
763  }
764 
765  return $replacement;
766 
767  }//end getPageContentsKeywordReplacement()
768 
769  //-- KEYWORDS AVAILABLE --//
770 
771 
782  function onRequestKeywords(&$broadcaster, $vars=Array())
783  {
784 
785  if (!isset($vars['keywords'])) return;
786 
787  $keywords = Array();
788 
789  $parents = $GLOBALS['SQ_SYSTEM']->am->getParents($broadcaster->id, 'bodycopy', TRUE);
790  $page_contents = $GLOBALS['SQ_SYSTEM']->am->getLink($this->id, SQ_LINK_TYPE_2, 'bodycopy', TRUE, 'page_contents', 'major', TRUE);
791  if (empty($page_contents)) return FALSE;
792 
793  //for the keywords of the Page Contents
794  if (array_key_exists($page_contents['minorid'], $parents)) {
795  $keywords = @$this->_tmp['keywords']['page_contents'];
796  if (is_null($keywords) || !is_array($keywords)) {
797  $keywords = $this->_getPageContentsBodycopyKeywords();
798  $this->_tmp['keywords']['page_contents'] = $keywords;
799  }
800  } else {
801  //else for the keywords of the Type Format bodycopies
802 
803  $folder = $this->getFolder('type_formats');
804  if (is_null($folder)) return FALSE;
805 
806  // lets work out which bodycopy the WYSIWYG cell that wants our keywords
807  // is in so we can return the correct keywords for the screen
808  $bodycopy_links = $GLOBALS['SQ_SYSTEM']->am->getLinks($folder->id, SQ_LINK_TYPE_2, 'bodycopy');
809 
810  $bodycopy_code = NULL;
811  foreach ($bodycopy_links as $link_info) {
812  if (isset($parents[$link_info['minorid']])) {
813  $bodycopy_code = $link_info['value'];
814  break;
815  }
816  }
817 
818  if (is_null($bodycopy_code)) return;
819 
820  $keywords = @$this->_tmp['keywords'][$bodycopy_code];
821 
822  if (is_null($keywords) || !is_array($keywords)) {
823  $keywords = Array();
824  // note: if the value on the link is "decision_tree_question_type_select", the method providing the keywords should be _getQuestionTypeSelectBodycopyKeywords
825 
826  $keyword_provider_method = str_replace('decision_tree_', '', $bodycopy_code);
827  $keyword_provider_method = str_replace('_', ' ', $keyword_provider_method);
828  $keyword_provider_method = '_get'.str_replace(' ', '', ucwords($keyword_provider_method)).'BodycopyKeywords';
829 
830  if (method_exists($this, $keyword_provider_method)) {
831  $keywords = $this->$keyword_provider_method();
832  $this->_tmp['keywords'][$bodycopy_code] = $keywords;
833  }
834 
835  }
836  }
837  $vars['keywords'] = array_merge($vars['keywords'], $keywords);
838 
839  }//end onRequestKeywords()
840 
841 
848  private function _getQuestionTypeSelectBodycopyKeywords()
849  {
850 
851  $keywords['question_title'] = 'Question Title';
852  $keywords['question_field'] = 'Question Input Field';
853  $keywords['question_note'] = 'Question Note';
854  $keywords['accumulated_points'] = 'Accumulated Points';
855 
856  return $keywords;
857 
858  }//end _getQuestionTypeSelectBodycopyKeywords()
859 
860 
867  private function _getQuestionTypeNumericBodycopyKeywords()
868  {
869 
870  $keywords['question_title'] = 'Question Title';
871  $keywords['question_field'] = 'Question Input Field';
872  $keywords['question_note'] = 'Question Note';
873  $keywords['question_button'] = 'Question Button';
874  $keywords['accumulated_points'] = 'Accumulated Points';
875 
876  return $keywords;
877 
878  }//end _getQuestionTypeNumericBodycopyKeywords()
879 
880 
887  private function _getPageContentsBodycopyKeywords()
888  {
889 
890  $keywords['decision_tree_contents'] = 'Decision Tree Contents';
891  $keywords['reset_button'] = 'Reset Button';
892 
893  return $keywords;
894 
895  }//end _getPageContentsBodycopyKeywords()
896 
897 }//end class
898 
899 ?>