8 Fakoli::usingFile(
"/cms/components/questionnaire/abstract_questionnaire_manager.inc");
24 function AbstractQuestionnaireResponseManager($item)
32 abstract function getComponentName();
37 abstract function getQuestionClass();
45 abstract function getXrefClass();
54 abstract function getAnswerClass();
56 function getExcludeHandler()
58 return "exclude_response";
66 function getResponseIntroIdentifier()
68 $class = codify(strtolower($this->item->prettifyClassName()));
69 return "{$class}_intro";
78 function getResponseFormIdentifier()
80 return "{$this->item->table}_form";
83 function getResetTokenHandler()
92 function getQuestionnaire()
106 Fakoli::end(
"No relation from response to questionnaire/survey");
116 function getEditUrl($item)
121 $pk = $item->getPrimaryKey();
124 $link =
"http://".
$config[
"http_host"] .
"/". $item->format(
"{$identifier}?{$pk}={{$pk}}");
125 if($this->item->token)
127 $link .=
"&token={$this->item->token}";
129 return "<a href='$link'>$link</a>";
138 function getIntroUrl($item)
143 $pk = $item->getPrimaryKey();
146 $link =
"http://".
$config[
"http_host"] .
"/". $item->format(
"{$identifier}?{$pk}={{$pk}}");
148 return "<a href='$link'>$link</a>";
158 function getAnswers()
160 $pk = $this->item->getPrimaryKey();
161 if(!$this->item->$pk)
166 return $this->item->Answers();
176 function getRespondent()
178 return $this->item->format();
184 function resetToken()
187 $responsePk =
$response->getPrimaryKey();
188 $answerClass = $this->getAnswerClass();
195 $answer->delete(
"WHERE {$responsePk}={$response->$responsePk}");
218 function writeScript()
225 $responsePk = $item->getPrimaryKey();
226 $component_name = $this->getComponentName();
227 $exclude_handler = $this->getExcludeHandler();
228 $response_intro_identifier = $this->getResponseIntroIdentifier();
229 $response_form_identifier = $this->getResponseFormIdentifier();
230 $reset_token_handler = $this->getResetTokenHandler();
234 <script type=
"text/javascript" src=
"/components/questionnaire/js/questionnaire_response.js"></script>
235 <script type=
"text/javascript">
236 var questionnaireMgr;
238 window.addEvent(
'domready',
function()
241 '<?php echo $itemPk ?>',
242 <?php echo $item_id ?>,
243 '<?php echo $responsePk ?>',
244 '<?php echo $component_name ?>',
245 '<?php echo $exclude_handler ?>',
246 '<?php echo $response_intro_identifier ?>',
247 '<?php echo $response_form_identifier ?>',
248 '<?php echo $reset_token_handler ?>'
Questionnaire/Survey Implementation instructions.
getQuestionNumber($question)
Called by QuestionRenderers from QuestionnaireForm Given an instance of a question,...
getQuestions()
Retrieves questions through the questionnaire or survey DataItem object.
static using()
Import the datamodels, views and manifest for the specified component(s).
static end($message="")
Use this method to terminate execution of a script instead of using the php keywords exit() or die().
static usingFile()
Uses the specified framework file(s) from the framework directory.
static getQuestionNumber($item, $questions, $question)
if(! $questionnaire_id) $questionnaire
if(! $user) if(! $response_id) $response