• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getQuestionAttributes函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getQuestionAttributes函数的典型用法代码示例。如果您正苦于以下问题:PHP getQuestionAttributes函数的具体用法?PHP getQuestionAttributes怎么用?PHP getQuestionAttributes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getQuestionAttributes函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: GetBaseLanguageFromSurveyID

$meta = '<script type="text/javascript">
    var surveyid = "' . $surveyid . '";
    var fieldname = "' . $_GET['fieldname'] . '";
    var questgrppreview  = ' . $_GET['preview'] . ';
</script>';
$meta .= '<script type="text/javascript" src="scripts/ajaxupload.js"></script>
<script type="text/javascript" src="scripts/uploader.js"></script>
<link type="text/css" href="scripts/uploader.css" rel="stylesheet" />';
$baselang = GetBaseLanguageFromSurveyID($surveyid);
$clang = new limesurvey_lang($baselang);
$header = getHeader($meta);
echo $header;
echo "<script type='text/javascript'>\n        var translt = {\n             titleFld: '" . $clang->gT('Title', 'js') . "',\n             commentFld: '" . $clang->gT('Comment', 'js') . "',\n             errorNoMoreFiles: '" . $clang->gT('Sorry, no more files can be uploaded!', 'js') . "',\n             errorOnlyAllowed: '" . $clang->gT('Sorry, only %s files can be uploaded for this question!', 'js') . "',\n             uploading: '" . $clang->gT('Uploading', 'js') . "',\n             selectfile: '" . $clang->gT('Select file', 'js') . "',\n             errorNeedMore: '" . $clang->gT('Please upload %s more file(s).', 'js') . "',\n             errorMoreAllowed: '" . $clang->gT('If you wish, you may upload %s more file(s); else you may return back to survey.', 'js') . "',\n             errorMaxReached: '" . $clang->gT('The maximum number of files has been uploaded. You may return back to survey.', 'js') . "',\n             errorTooMuch: '" . $clang->gT('The maximum number of files has been uploaded. You may return back to survey.', 'js') . "',\n             errorNeedMoreConfirm: '" . $clang->gT("You need to upload %s more files for this question.\nAre you sure you want to exit?", 'js') . "'\n            };\n    </script>\n";
$fn = $_GET['fieldname'];
$qid = $_GET['qid'];
$qidattributes = getQuestionAttributes($qid);
$body = '
        <div id="notice"></div>
        <input type="hidden" id="ia"                value="' . $fn . '" />
        <input type="hidden" id="' . $fn . '_minfiles"          value="' . $qidattributes['min_num_of_files'] . '" />
        <input type="hidden" id="' . $fn . '_maxfiles"          value="' . $qidattributes['max_num_of_files'] . '" />
        <input type="hidden" id="' . $fn . '_maxfilesize"       value="' . $qidattributes['max_filesize'] . '" />
        <input type="hidden" id="' . $fn . '_allowed_filetypes" value="' . $qidattributes['allowed_filetypes'] . '" />
        <input type="hidden" id="preview"                   value="' . $_SESSION['preview'] . '" />
        <input type="hidden" id="' . $fn . '_show_comment"      value="' . $qidattributes['show_comment'] . '" />
        <input type="hidden" id="' . $fn . '_show_title"        value="' . $qidattributes['show_title'] . '" />
        <input type="hidden" id="' . $fn . '_licount"           value="0" />
        <input type="hidden" id="' . $fn . '_filecount"         value="0" />

        <!-- The upload button -->
        <div align="center" class="upload-div">
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:31,代码来源:uploader.php


示例2: getQuestionAttributes

         $dataentryoutput .= "<td align='right'>{$mearow['question']}</td>\n";
         $dataentryoutput .= "<td>\n";
         $dataentryoutput .= "\t<select name='{$fieldname}{$mearow['title']}'>\n";
         $dataentryoutput .= "<option value=''>" . $blang->gT("Please choose") . "..</option>\n";
         $dataentryoutput .= "<option value='I'>" . $blang->gT("Increase") . "</option>\n";
         $dataentryoutput .= "<option value='S'>" . $blang->gT("Same") . "</option>\n";
         $dataentryoutput .= "<option value='D'>" . $blang->gT("Decrease") . "</option>\n";
         $dataentryoutput .= "\t</select>\n";
         $dataentryoutput .= "</td>\n";
         $dataentryoutput .= "</tr>\n";
     }
     $dataentryoutput .= "</table>\n";
     break;
 case ":":
     //ARRAY (Multi Flexi)
     $qidattributes = getQuestionAttributes($deqrow['qid']);
     if (trim($qidattributes['multiflexible_max']) != '' && trim($qidattributes['multiflexible_min']) == '') {
         $maxvalue = $qidattributes['multiflexible_max'];
         $minvalue = 1;
     }
     if (trim($qidattributes['multiflexible_min']) != '' && trim($qidattributes['multiflexible_max']) == '') {
         $minvalue = $qidattributes['multiflexible_min'];
         $maxvalue = $qidattributes['multiflexible_min'] + 10;
     }
     if (trim($qidattributes['multiflexible_min']) == '' && trim($qidattributes['multiflexible_max']) == '') {
         $minvalue = 1;
         $maxvalue = 10;
     }
     if (trim($qidattributes['multiflexible_min']) != '' && trim($qidattributes['multiflexible_max']) != '') {
         if ($qidattributes['multiflexible_min'] < $qidattributes['multiflexible_max']) {
             $minvalue = $qidattributes['multiflexible_min'];
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:31,代码来源:dataentry.php


示例3: generate_statistics


//.........这里部分代码省略.........
                            $alist[]=array("S", $statlang->gT("Same"));
                            $alist[]=array("D", $statlang->gT("Decrease"));
                            $atext=FlattenText($qrow[1]);
                        }
                        $qquestion .= $linefeed."[".$atext."]";
                        $qtitle .= "($qanswer)";
                        break;


                    case ";": //Array (Multi Flexi) (Text)
                        list($qacode, $licode)=explode("_", $qanswer);

                        $qquery = "SELECT title, question FROM ".db_table_name("questions")." WHERE parent_qid='$qiqid' AND title='$qacode' AND language='{$language}' ORDER BY question_order";
                        $qresult=db_execute_num($qquery) or die ("Couldn't get answer details<br />$qquery<br />".$connect->ErrorMsg());

                        while ($qrow=$qresult->FetchRow())
                        {
                            $fquery = "SELECT * FROM ".db_table_name("answers")." WHERE qid='{$qiqid}' AND scale_id=0 AND code = '{$licode}' AND language='{$language}'ORDER BY sortorder, code";
                            $fresult = db_execute_assoc($fquery);
                            while ($frow=$fresult->FetchRow())
                            {
                                $alist[]=array($frow['code'], $frow['answer']);
                                $ltext=$frow['answer'];
                            }
                            $atext=FlattenText($qrow[1]);
                        }

                        $qquestion .= $linefeed."[".$atext."] [".$ltext."]";
                        $qtitle .= "($qanswer)";
                        break;


                    case ":": //Array (Multiple Flexi) (Numbers)
                        $qidattributes=getQuestionAttributes($qiqid);
                        if (trim($qidattributes['multiflexible_max'])!='') {
                            $maxvalue=$qidattributes['multiflexible_max'];
                        }
                        else {
                            $maxvalue=10;
                        }

                        if (trim($qidattributes['multiflexible_min'])!='')
                        {
                            $minvalue=$qidattributes['multiflexible_min'];
                        }
                        else {
                            $minvalue=1;
                        }

                        if (trim($qidattributes['multiflexible_step'])!='')
                        {
                            $stepvalue=$qidattributes['multiflexible_step'];
                        }
                        else {
                            $stepvalue=1;
                        }

                        if ($qidattributes['multiflexible_checkbox']!=0) {
                            $minvalue=0;
                            $maxvalue=1;
                            $stepvalue=1;
                        }

                        for($i=$minvalue; $i<=$maxvalue; $i+=$stepvalue)
                        {
                            $alist[]=array($i, $i);
开发者ID:nmklong,项目名称:limesurvey-cdio3,代码行数:67,代码来源:statistics_function.php


示例4: returnglobal

if ($action == "ajaxlabelsetpicker") {
    $match = (int) returnglobal('match');
    $surveyid = returnglobal('sid');
    if ($match == 1) {
        $language = GetBaseLanguageFromSurveyID($surveyid);
    } else {
        $language = null;
    }
    $resultdata = getlabelsets($language);
    echo json_encode($resultdata);
}
if ($action == "ajaxquestionattributes") {
    $thissurvey = getSurveyInfo($surveyid);
    $type = returnglobal('question_type');
    if (isset($qid)) {
        $attributesettings = getQuestionAttributes($qid);
    }
    $availableattributes = questionAttributes();
    if (isset($availableattributes[$type])) {
        uasort($availableattributes[$type], 'CategorySort');
        $ajaxoutput = '';
        $currentfieldset = '';
        foreach ($availableattributes[$type] as $qa) {
            if (isset($attributesettings[$qa['name']])) {
                $value = $attributesettings[$qa['name']];
            } else {
                $value = $qa['default'];
            }
            if ($currentfieldset != $qa['category']) {
                if ($currentfieldset != '') {
                    $ajaxoutput .= '</ul></fieldset>';
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:31,代码来源:questionhandling.php


示例5: array

     if ($fielddetails['type'] == 'answer_time') {
         continue;
     }
     if (isset($fielddetails['subquestion']) && $fielddetails['subquestion'] != '') {
         $question .= ' (' . $fielddetails['subquestion'] . ')';
     }
     if (isset($fielddetails['subquestion1']) && isset($fielddetails['subquestion2'])) {
         $question .= ' (' . $fielddetails['subquestion1'] . ':' . $fielddetails['subquestion2'] . ')';
     }
     if (isset($fielddetails['scale_id'])) {
         $question .= '[' . $fielddetails['scale'] . ']';
     }
     $fnames[] = array($fielddetails['fieldname'], $question);
 } else {
     if ($fielddetails['aid'] !== 'filecount') {
         $qidattributes = getQuestionAttributes($fielddetails['qid']);
         for ($i = 0; $i < $fielddetails['max_files']; $i++) {
             if ($qidattributes['show_title'] == 1) {
                 $fnames[] = array($fielddetails['fieldname'], "File " . ($i + 1) . " - " . $fielddetails['question'] . "(Title)", "type" => "|", "metadata" => "title", "index" => $i);
             }
             if ($qidattributes['show_comment'] == 1) {
                 $fnames[] = array($fielddetails['fieldname'], "File " . ($i + 1) . " - " . $fielddetails['question'] . "(Comment)", "type" => "|", "metadata" => "comment", "index" => $i);
             }
             $fnames[] = array($fielddetails['fieldname'], "File " . ($i + 1) . " - " . $fielddetails['question'] . "(File name)", "type" => "|", "metadata" => "name", "index" => $i);
             $fnames[] = array($fielddetails['fieldname'], "File " . ($i + 1) . " - " . $fielddetails['question'] . "(File size)", "type" => "|", "metadata" => "size", "index" => $i);
             //$fnames[] = array($fielddetails['fieldname'], "File ".($i+1)." - ".$fielddetails['question']."(extension)", "type"=>"|", "metadata"=>"ext",     "index"=>$i);
         }
     } else {
         $fnames[] = array($fielddetails['fieldname'], "File count");
     }
 }
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:31,代码来源:browse.php


示例6: surveymover

}
$navigator = surveymover();
echo "\n\n<!-- PRESENT THE NAVIGATOR -->\n";
echo templatereplace(file_get_contents("{$thistpl}/navigator.pstpl"));
echo "\n";
if ($thissurvey['active'] != "Y") {
    echo "<p style='text-align:center' class='error'>" . $clang->gT("This survey is currently not active. You will not be able to save your responses.") . "</p>\n";
}
echo "\n";
if ($thissurvey['allowjumps'] == 'Y' && !$bIsGroupDescrPage) {
    echo "\n\n<!-- PRESENT THE INDEX -->\n";
    $iLastGrp = null;
    echo '<div id="index"><div class="container"><h2>' . $clang->gT("Question index") . '</h2>';
    for ($v = 0, $n = 0; $n != $_SESSION['maxstep']; ++$n) {
        $ia = $_SESSION['fieldarray'][$n];
        $qidattributes = getQuestionAttributes($ia[0], $ia[4]);
        if ($qidattributes['hidden'] == 1 || !checkquestionfordisplay($ia[0])) {
            continue;
        }
        $sText = FlattenText($ia[3]);
        $bAnsw = bCheckQuestionForAnswer($ia[1], $aFieldnamesInfoInv);
        if ($iLastGrp != $ia[5]) {
            $iLastGrp = $ia[5];
            foreach ($_SESSION['grouplist'] as $gl) {
                if ($gl[0] == $iLastGrp) {
                    echo '<h3>' . htmlspecialchars(strip_tags($gl[1]), ENT_QUOTES, 'UTF-8') . "</h3>";
                    break;
                }
            }
        }
        ++$v;
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:31,代码来源:question.php


示例7: aGetFullResponseTable

/**
* Creates an array with details on a particular response for display purposes
* Used in Print answers (done), Detailed response view (Todo:)and Detailed admin notification email (done)
*
* @param mixed $iSurveyID
* @param mixed $iResponseID
* @param mixed $sLanguageCode
*/
function aGetFullResponseTable($iSurveyID, $iResponseID, $sLanguageCode)
{
    global $connect;
    $aFieldMap = createFieldMap($iSurveyID, 'full', false, false, $sLanguageCode);
    //Get response data
    $idquery = "SELECT * FROM " . db_table_name('survey_' . $iSurveyID) . " WHERE id=" . $iResponseID;
    $idrow = $connect->GetRow($idquery) or safe_die("Couldn't get entry<br />\n{$idquery}<br />\n" . $connect->ErrorMsg());
    //Checked
    $aResultTable = array();
    $oldgid = 0;
    $oldqid = 0;
    foreach ($aFieldMap as $sKey => $fname) {
        if (!empty($fname['qid'])) {
            $attributes = getQuestionAttributes($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'];
                $aResultTable['gid_' . $fname['gid']] = array($fname['group_name']);
            }
        }
        if (isset($fname['qid']) && !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($fname['fieldname'], $idrow[$fname['fieldname']]);
                    $aResultTable[$fname['fieldname']] = array($question, '', $answer);
                    continue;
                }
            }
        } else {
            $answer = getextendedanswer($fname['fieldname'], $idrow[$fname['fieldname']]);
            $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($fname['fieldname'], $idrow[$fname['fieldname']]);
        $aResultTable[$fname['fieldname']] = array('', $subquestion, $answer);
    }
    return $aResultTable;
}
开发者ID:karime7gezly,项目名称:OpenConextApps-LimeSurvey,代码行数:65,代码来源:common_functions.php


示例8: checkgroupfordisplay

function checkgroupfordisplay($gid)
{
    //This function checks all the questions in a group to see if they have
    //conditions, and if the do - to see if the conditions are met.
    //If none of the questions in the group are set to display, then
    //the function will return false, to indicate that the whole group
    //should not display at all.
    global $dbprefix, $connect;
    $countQuestionsInThisGroup = 0;
    $countConditionalQuestionsInThisGroup = 0;
    foreach ($_SESSION['fieldarray'] as $ia) {
        if ($ia[5] == $gid) {
            // Check if this question is hidden
            $qidattributes = getQuestionAttributes($ia[0]);
            if ($qidattributes !== false && $qidattributes['hidden'] == 0) {
                $countQuestionsInThisGroup++;
                if ($ia[7] == "Y") {
                    $countConditionalQuestionsInThisGroup++;
                    $QuestionsWithConditions[] = $ia;
                    //Create an array containing all the conditional questions
                }
            }
        }
    }
    if ($countQuestionsInThisGroup === 0) {
        return false;
    } elseif ($countQuestionsInThisGroup != $countConditionalQuestionsInThisGroup || !isset($QuestionsWithConditions)) {
        //One of the questions in this group is NOT conditional, therefore
        //the group MUST be displayed
        return true;
    } else {
        //All of the questions in this group are conditional. Now we must
        //check every question, to see if the condition for each has been met.
        //If 1 or more have their conditions met, then the group should
        //be displayed.
        foreach ($QuestionsWithConditions as $cc) {
            if (checkquestionfordisplay($cc[0], $gid) === true) {
                return true;
            }
        }
        //Since we made it this far, there mustn't have been any conditions met.
        //Therefore the group should not be displayed.
        return false;
    }
}
开发者ID:himanshu12k,项目名称:ce-www,代码行数:45,代码来源:common_functions.php


示例9: do_array_dual

function do_array_dual($ia)
{
    global $dbprefix, $connect, $thissurvey, $clang;
    global $repeatheadings;
    global $notanswered;
    global $minrepeatheadings;

    if ($ia[8] == 'Y')
    {
        $checkconditionFunction = "checkconditions";
    }
    else
    {
        $checkconditionFunction = "noop_checkconditions";
    }

    $inputnames=array();
    $labelans1=array();
    $labelans=array();
    $qquery = "SELECT other FROM {$dbprefix}questions WHERE qid=".$ia[0]." AND language='".$_SESSION['s_lang']."'";
    $other = $connect->GetOne($qquery);    //Checked
    $lquery =  "SELECT * FROM {$dbprefix}answers WHERE scale_id=0 AND qid={$ia[0]} AND language='".$_SESSION['s_lang']."' ORDER BY sortorder, code";
    $lquery1 = "SELECT * FROM {$dbprefix}answers WHERE scale_id=1 AND qid={$ia[0]} AND language='".$_SESSION['s_lang']."' ORDER BY sortorder, code";
    $qidattributes=getQuestionAttributes($ia[0],$ia[4]);

    if ($qidattributes['use_dropdown']==1)
    {
        $useDropdownLayout = true;
    }
    else
    {
        $useDropdownLayout = false;
    }

    if (trim($qidattributes['dualscale_headerA'])!='') {
        $leftheader= $clang->gT($qidattributes['dualscale_headerA']);
    }
    else
    {
        $leftheader ='';
    }

    if (trim($qidattributes['dualscale_headerB'])!='')
    {
        $rightheader= $clang->gT($qidattributes['dualscale_headerB']);
    }
    else {
        $rightheader ='';
    }

    $lresult = db_execute_assoc($lquery); //Checked
    if ($useDropdownLayout === false && $lresult->RecordCount() > 0)
    {

        if (trim($qidattributes['answer_width'])!='')
        {
            $answerwidth=$qidattributes['answer_width'];
        }
        else
        {
            $answerwidth=20;
        }
        $columnswidth = 100 - $answerwidth;


        while ($lrow=$lresult->FetchRow())
        {
            $labelans[]=$lrow['answer'];
            $labelcode[]=$lrow['code'];
        }
        $lresult1 = db_execute_assoc($lquery1); //Checked
        if ($lresult1->RecordCount() > 0)
        {
            while ($lrow1=$lresult1->FetchRow())
            {
                $labelans1[]=$lrow1['answer'];
                $labelcode1[]=$lrow1['code'];
            }
        }
        $numrows=count($labelans) + count($labelans1);
        if ($ia[6] != "Y" && SHOW_NO_ANSWER == 1) {$numrows++;}
        $cellwidth=$columnswidth/$numrows;

        $cellwidth=sprintf("%02d", $cellwidth);

        $ansquery = "SELECT question FROM {$dbprefix}questions WHERE parent_qid=".$ia[0]." and scale_id=0 AND question like '%|%'";
        $ansresult = db_execute_assoc($ansquery);   //Checked
        if ($ansresult->RecordCount()>0)
        {
            $right_exists=true;
        }
        else
        {
            $right_exists=false;
        }
        // $right_exists is a flag to find out if there are any right hand answer parts. If there arent we can leave out the right td column
        if ($qidattributes['random_order']==1) {
            $ansquery = "SELECT * FROM {$dbprefix}questions WHERE parent_qid=$ia[0] AND language='".$_SESSION['s_lang']."' and scale_id=0 ORDER BY ".db_random();
        }
        else
//.........这里部分代码省略.........
开发者ID:nmklong,项目名称:limesurvey-cdio3,代码行数:101,代码来源:qanda.php


示例10: GetBaseLanguageFromSurveyID

$baselang = GetBaseLanguageFromSurveyID($surveyid);
$clang = new limesurvey_lang($baselang);
$randfilename = 'futmp_' . sRandomChars(15);
$sTempUploadDir = $tempdir . '/upload/';
$randfileloc = $sTempUploadDir . $randfilename;
$filename = $_FILES['uploadfile']['name'];
$size = 0.001 * $_FILES['uploadfile']['size'];
$valid_extensions = strtolower($_POST['valid_extensions']);
$maxfilesize = (int) $_POST['max_filesize'];
$preview = $_POST['preview'];
$fieldname = $_POST['fieldname'];
$aFieldMap = createFieldMap($surveyid);
if (!isset($aFieldMap[$fieldname])) {
    die;
}
$aAttributes = getQuestionAttributes($aFieldMap[$fieldname]['qid'], $aFieldMap[$fieldname]['type']);
$valid_extensions_array = explode(",", $aAttributes['allowed_filetypes']);
$valid_extensions_array = array_map('trim', $valid_extensions_array);
$pathinfo = pathinfo($_FILES['uploadfile']['name']);
$ext = $pathinfo['extension'];
// check to see that this file type is allowed
// it is also  checked at the client side, but jst double checking
if (!in_array(strtolower($ext), $valid_extensions_array)) {
    $return = array("success" => false, "msg" => sprintf($clang->gT("Sorry, this file extension (%s) is not allowed!"), $ext));
    echo ls_json_encode($return);
    exit;
}
// If this is just a preview, don't save the file
if ($preview) {
    if ($size > $maxfilesize) {
        $return = array("success" => false, "msg" => sprintf($clang->gT("Sorry, this file is too large. Only files upto %s KB are allowed."), $maxfilesize));
开发者ID:ddrmoscow,项目名称:queXS,代码行数:31,代码来源:upload.php


示例11: getArrayFiltersExcludesOutGroup

/**
 * getArrayFiltersExcludesOutGroup($qid) finds out if a question is in the current group or not for array filter exclude
 * @global string $qid
 * @return returns true if its not in currect group and false if it is..
 */
function getArrayFiltersExcludesOutGroup($qid)
{
    // TODO: Check list_filter values to make sure questions are previous?
    global $surveyid, $dbprefix, $gid;
    $qid=sanitize_int($qid);
    $attributes = getQuestionAttributes($qid);
    if (isset($attributes['array_filter_exclude'])) // We Found a array_filter attribute
    {
        $val = $attributes['array_filter_exclude']; // Get the Value of the Attribute ( should be a previous question's title in same group )

        // we found the target question, now we need to know what the answers where, we know its a multi!
        $surveyid=returnglobal('sid');
        $fieldmap = createFieldMap($surveyid, 'full');
        $val2 = arraySearchByKey($val, $fieldmap, 'title', 1);
        if ($val2['gid'] != $gid) return true;
        if ($val2['gid'] == $gid) return false;
   }
    return false;
}
开发者ID:nmklong,项目名称:limesurvey-cdio3,代码行数:24,代码来源:common_functions.php


示例12: db_table_name

     $thiscquestion = $fieldmap[$conrow['cfieldname']];
     $ansquery = "SELECT question FROM " . db_table_name("questions") . " WHERE parent_qid='{$conrow['cqid']}' AND title='{$thiscquestion['aid']}' AND language='{$surveyprintlang}'";
     //$ansquery="SELECT question FROM ".db_table_name("questions")." WHERE qid='{$conrow['cqid']}' AND language='{$surveyprintlang}'";
     $ansresult = db_execute_assoc($ansquery);
     while ($ansrow = $ansresult->FetchRow()) {
         $answer_section = " (" . $ansrow['question'] . ")";
     }
     break;
 case "1":
     // dual: (Label 1), (Label 2)
     $labelIndex = substr($conrow['cfieldname'], -1);
     $thiscquestion = $fieldmap[$conrow['cfieldname']];
     $ansquery = "SELECT question FROM " . db_table_name("questions") . " WHERE parent_qid='{$conrow['cqid']}' AND title='{$thiscquestion['aid']}' AND language='{$surveyprintlang}'";
     //$ansquery="SELECT question FROM ".db_table_name("questions")." WHERE qid='{$conrow['cqid']}' AND language='{$surveyprintlang}'";
     $ansresult = db_execute_assoc($ansquery);
     $cqidattributes = getQuestionAttributes($conrow['cqid'], $conrow['type']);
     if ($labelIndex == 0) {
         if (trim($cqidattributes['dualscale_headerA']) != '') {
             $header = $clang->gT($cqidattributes['dualscale_headerA']);
         } else {
             $header = '1';
         }
     } elseif ($labelIndex == 1) {
         if (trim($cqidattributes['dualscale_headerB']) != '') {
             $header = $clang->gT($cqidattributes['dualscale_headerB']);
         } else {
             $header = '2';
         }
     }
     while ($ansrow = $ansresult->FetchRow()) {
         $answer_section = " (" . $ansrow['question'] . " " . sprintf($clang->gT("Label %s"), $header) . ")";
开发者ID:karime7gezly,项目名称:OpenConextApps-LimeSurvey,代码行数:31,代码来源:printablesurvey.php


示例13: match_regex

         }
     }
     else
     {
         $java .= " 'impossible to evaluate tokenAttr' == 'tokenAttr'";
     }
 }
 else
 {
     if ($cd[6] == 'RX')
     {
         $java .= "$JSsourceElt != null  && match_regex($JSsourceVal,'$cd[3]')";
     }
     else
     {
         $cqidattributes = getQuestionAttributes($cd[1]);
         //if (in_array($cd[4],array("A","B","K","N","5",":"))  || (in_array($cd[4],array("Q",";")) && $cqidattributes['other_numbers_only']==1 ))
         if (in_array($cd[6],array("<","<=",">",">=")))
         { // Numerical comparizons
             $java .= "$JSsourceElt != null && parseFloat($JSsourceVal) $cd[6] parseFloat('$cd[3]')";
         }
         elseif(preg_match("/^a(.*)b$/",$cd[6],$matchmethods))
         { // String comaprizons
             $java .= "$JSsourceElt != null && $JSsourceVal ".$matchmethods[1]." '$cd[3]'";
         }
         else
         {
             $java .= "$JSsourceElt != null && $JSsourceVal $cd[6] '$cd[3]'";
         }
     }
 }
开发者ID:nmklong,项目名称:limesurvey-cdio3,代码行数:31,代码来源:survey.php


示例14: foreach

         foreach ($x_axis as $key => $val) {
             $shortquestion = $rows['title'] . ":{$arows['title']}:{$key}: [" . strip_tags($arows['question']) . "][" . strip_tags($val) . "] " . FlattenText($rows['question']);
             $cquestions[] = array($shortquestion, $rows['qid'], $rows['type'], $rows['sid'] . $X . $rows['gid'] . $X . $rows['qid'] . $arows['title'] . "_" . $key);
             if ($rows['type'] == ":") {
                 for ($ii = $minvalue; $ii <= $maxvalue; $ii += $stepvalue) {
                     $canswers[] = array($rows['sid'] . $X . $rows['gid'] . $X . $rows['qid'] . $arows['title'] . "_" . $key, $ii, $ii);
                 }
             }
         }
     }
     unset($x_axis);
 } elseif ($rows['type'] == "1") {
     $aquery = "SELECT * " . "FROM {$dbprefix}questions " . "WHERE parent_qid={$rows['qid']} " . "AND language='" . GetBaseLanguageFromSurveyID($surveyid) . "' " . "ORDER BY question_order";
     $aresult = db_execute_assoc($aquery) or safe_die("Couldn't get answers to Array questions<br />{$aquery}<br />" . $connect->ErrorMsg());
     while ($arows = $aresult->FetchRow()) {
         $attr = getQuestionAttributes($rows['qid']);
         $label1 = isset($attr['dualscale_headerA']) ? $attr['dualscale_headerA'] : 'Label1';
         $label2 = isset($attr['dualscale_headerB']) ? $attr['dualscale_headerB'] : 'Label2';
         $shortanswer = "{$arows['title']}: [" . strip_tags($arows['question']) . "][{$label1}]";
         $shortquestion = $rows['title'] . ":{$shortanswer} " . strip_tags($rows['question']);
         $cquestions[] = array($shortquestion, $rows['qid'], $rows['type'], $rows['sid'] . $X . $rows['gid'] . $X . $rows['qid'] . $arows['title'] . "#0");
         $shortanswer = "{$arows['title']}: [" . strip_tags($arows['question']) . "][{$label2}]";
         $shortquestion = $rows['title'] . ":{$shortanswer} " . strip_tags($rows['question']);
         $cquestions[] = array($shortquestion, $rows['qid'], $rows['type'], $rows['sid'] . $X . $rows['gid'] . $X . $rows['qid'] . $arows['title'] . "#1");
         // first label
         $lquery = "SELECT * " . "FROM {$dbprefix}answers " . "WHERE qid={$rows['qid']} " . "AND scale_id=0 " . "AND language='" . GetBaseLanguageFromSurveyID($surveyid) . "' " . "ORDER BY sortorder, answer";
         $lresult = db_execute_assoc($lquery) or safe_die("Couldn't get labels to Array <br />{$lquery}<br />" . $connect->ErrorMsg());
         while ($lrows = $lresult->FetchRow()) {
             $canswers[] = array($rows['sid'] . $X . $rows['gid'] . $X . $rows['qid'] . $arows['title'] . "#0", "{$lrows['code']}", "{$lrows['code']}");
         }
         // second label
开发者ID:ddrmoscow,项目名称:queXS,代码行数:31,代码来源:conditionshandling.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getQuestionClass函数代码示例发布时间:2022-05-15
下一篇:
PHP getQuestionAttributeValues函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap