当前位置: 首页>>代码示例>>PHP>>正文


PHP LimeExpressionManager::GroupIsRelevant方法代码示例

本文整理汇总了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);
 }
开发者ID:rouben,项目名称:LimeSurvey,代码行数:26,代码来源:SurveyRuntimeHelper.php

示例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;
}
开发者ID:GuillaumeSmaha,项目名称:LimeSurvey,代码行数:72,代码来源:common_helper.php


注:本文中的LimeExpressionManager::GroupIsRelevant方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。