本文整理汇总了PHP中LimeExpressionManager::GroupIsRelevant方法的典型用法代码示例。如果您正苦于以下问题:PHP LimeExpressionManager::GroupIsRelevant方法的具体用法?PHP LimeExpressionManager::GroupIsRelevant怎么用?PHP LimeExpressionManager::GroupIsRelevant使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LimeExpressionManager
的用法示例。
在下文中一共展示了LimeExpressionManager::GroupIsRelevant方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createFullQuestionIndexByGroup
protected function createFullQuestionIndexByGroup($LEMsessid)
{
echo "\n\n<!-- PRESENT THE INDEX -->\n";
echo CHtml::openTag('div', array('id' => 'index'));
echo CHtml::openTag('div', array('class' => 'container'));
echo CHtml::tag('h2', array(), gT("Question index"));
echo CHtml::openTag('ol');
foreach ($_SESSION[$LEMsessid]['grouplist'] as $key => $group) {
// echo '<script>';
// echo 'var session = '. json_encode(LimeExpressionManager::singleton()->_ValidateGroup($key)) . ';';
// echo 'console.log(session);';
// echo '</script>';
// Better to use tracevar /
if (LimeExpressionManager::GroupIsRelevant($group['gid'])) {
$group['step'] = $key + 1;
$stepInfo = LimeExpressionManager::singleton()->_ValidateGroup($key);
$classes = implode(' ', array('row', $stepInfo['anyUnanswered'] ? 'missing' : '', $_SESSION[$LEMsessid]['step'] == $group['step'] ? 'current' : ''));
$sButtonSubmit = CHtml::htmlButton(gT('Go to this group'), array('type' => 'submit', 'value' => $group['step'], 'name' => 'move', 'class' => 'jshide'));
echo CHtml::tag('li', array('data-gid' => $group['gid'], 'title' => $group['description'], 'class' => $classes), $group['group_name'] . $sButtonSubmit);
}
}
echo CHtml::closeTag('ol');
echo CHtml::closeTag('div');
echo CHtml::closeTag('div');
App()->getClientScript()->registerScript('manageIndex', "manageIndex()\n", CClientScript::POS_END);
}
示例2: getFullResponseTable
/**
* Creates an array with details on a particular response for display purposes
* Used in Print answers, Detailed response view and Detailed admin notification email
*
* @param mixed $iSurveyID
* @param mixed $iResponseID
* @param mixed $sLanguageCode
* @param boolean $bHonorConditions Apply conditions
*/
function getFullResponseTable($iSurveyID, $iResponseID, $sLanguageCode, $bHonorConditions = true)
{
$aFieldMap = createFieldMap($iSurveyID, 'full', false, false, $sLanguageCode);
//Get response data
$idrow = SurveyDynamic::model($iSurveyID)->findByAttributes(array('id' => $iResponseID));
// Create array of non-null values - those are the relevant ones
$aRelevantFields = array();
foreach ($aFieldMap as $sKey => $fname) {
if (LimeExpressionManager::QuestionIsRelevant($fname['qid']) || $bHonorConditions == false) {
$aRelevantFields[$sKey] = $fname;
}
}
$aResultTable = array();
$oldgid = 0;
$oldqid = 0;
foreach ($aRelevantFields as $sKey => $fname) {
if (!empty($fname['qid'])) {
$attributes = getQuestionAttributeValues($fname['qid']);
if (getQuestionAttributeValue($attributes, 'hidden') == 1) {
continue;
}
}
$question = $fname['question'];
$subquestion = '';
if (isset($fname['gid']) && !empty($fname['gid'])) {
//Check to see if gid is the same as before. if not show group name
if ($oldgid !== $fname['gid']) {
$oldgid = $fname['gid'];
if (LimeExpressionManager::GroupIsRelevant($fname['gid']) || $bHonorConditions == false) {
$aResultTable['gid_' . $fname['gid']] = array($fname['group_name'], QuestionGroup::model()->getGroupDescription($fname['gid'], $sLanguageCode));
}
}
}
if (!empty($fname['qid'])) {
if ($oldqid !== $fname['qid']) {
$oldqid = $fname['qid'];
if (isset($fname['subquestion']) || isset($fname['subquestion1']) || isset($fname['subquestion2'])) {
$aResultTable['qid_' . $fname['sid'] . 'X' . $fname['gid'] . 'X' . $fname['qid']] = array($fname['question'], '', '');
} else {
$answer = getExtendedAnswer($iSurveyID, $fname['fieldname'], $idrow[$fname['fieldname']], $sLanguageCode);
$aResultTable[$fname['fieldname']] = array($question, '', $answer);
continue;
}
}
} else {
$answer = getExtendedAnswer($iSurveyID, $fname['fieldname'], $idrow[$fname['fieldname']], $sLanguageCode);
$aResultTable[$fname['fieldname']] = array($question, '', $answer);
continue;
}
if (isset($fname['subquestion'])) {
$subquestion = "[{$fname['subquestion']}]";
}
if (isset($fname['subquestion1'])) {
$subquestion = "[{$fname['subquestion1']}]";
}
if (isset($fname['subquestion2'])) {
$subquestion .= "[{$fname['subquestion2']}]";
}
$answer = getExtendedAnswer($iSurveyID, $fname['fieldname'], $idrow[$fname['fieldname']], $sLanguageCode);
$aResultTable[$fname['fieldname']] = array($question, $subquestion, $answer);
}
return $aResultTable;
}