本文整理匯總了PHP中limesurvey_lang::gt方法的典型用法代碼示例。如果您正苦於以下問題:PHP limesurvey_lang::gt方法的具體用法?PHP limesurvey_lang::gt怎麽用?PHP limesurvey_lang::gt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類limesurvey_lang
的用法示例。
在下文中一共展示了limesurvey_lang::gt方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: generate_statistics
//.........這裏部分代碼省略.........
$qsid = $fielddata['sid'];
$qgid = $fielddata['gid'];
$qqid = $fielddata['qid'];
list($qanswer, $qlid) = !empty($fielddata['aid']) ? explode("_", $fielddata['aid']) : array("", "");
//get SGQ data
//list($qsid, $qgid, $qqid) = explode("X", substr($rt, 1, strlen($rt)), 3);
//get question data
$nquery = "SELECT title, type, question, other, parent_qid FROM " . db_table_name("questions") . " WHERE parent_qid=0 AND qid='{$qqid}' AND language='{$language}'";
$nresult = db_execute_num($nquery) or safe_die("Couldn't get text question<br />{$nquery}<br />" . $connect->ErrorMsg());
//loop through question data
while ($nrow = $nresult->FetchRow()) {
$qtitle = FlattenText($nrow[0]);
$qtype = $nrow[1];
$qquestion = FlattenText($nrow[2]);
$nlid = $nrow[4];
}
$mfield = substr($rt, 1, strlen($rt));
//Text questions either have an answer, or they don't. There's no other way of quantising the results.
// So, instead of building an array of predefined answers like we do with lists & other types,
// we instead create two "types" of possible answer - either there is a response.. or there isn't.
// This question type then can provide a % of the question answered in the summary.
$alist[] = array("Answers", $statlang->gT("Answer"), $mfield);
$alist[] = array("NoAnswer", $statlang->gT("No answer"), $mfield);
} elseif ($firstletter == "Q") {
//get SGQ data
list($qsid, $qgid, $qqid) = explode("X", substr($rt, 1, strlen($rt)), 3);
//separating another ID
$tmpqid = substr($qqid, 0, strlen($qqid) - 1);
//check if we have legid QIDs. if not create them by substringing
while (!in_array($tmpqid, $legitqids)) {
$tmpqid = substr($tmpqid, 0, strlen($tmpqid) - 1);
}
//length of QID
$qidlength = strlen($tmpqid);
//we somehow get the answer code (see SQL later) from the $qqid
$qaid = substr($qqid, $qidlength, strlen($qqid) - $qidlength);
//get some question data
$nquery = "SELECT title, type, question, other FROM " . db_table_name("questions") . " WHERE qid='" . substr($qqid, 0, $qidlength) . "' AND parent_qid=0 AND language='{$language}'";
$nresult = db_execute_num($nquery) or safe_die("Couldn't get text question<br />{$nquery}<br />" . $connect->ErrorMsg());
//more substrings
$count = substr($qqid, strlen($qqid) - 1);
//loop through question data
while ($nrow = $nresult->FetchRow()) {
$qtitle = FlattenText($nrow[0]) . '-' . $count;
$qtype = $nrow[1];
$qquestion = FlattenText($nrow[2]);
}
//get answers
$qquery = "SELECT title as code, question as answer FROM " . db_table_name("questions") . " WHERE parent_qid='" . substr($qqid, 0, $qidlength) . "' AND title='{$qaid}' AND language='{$language}' ORDER BY question_order";
$qresult = db_execute_num($qquery) or safe_die("Couldn't get answer details (Array 5p Q)<br />{$qquery}<br />" . $connect->ErrorMsg());
//loop through answer data
while ($qrow = $qresult->FetchRow()) {
//store each answer here
$atext = FlattenText($qrow[1]);
}
//add this to the question title
$qtitle .= " [{$atext}]";
//even more substrings...
$mfield = substr($rt, 1, strlen($rt));
//Text questions either have an answer, or they don't. There's no other way of quantising the results.
// So, instead of building an array of predefined answers like we do with lists & other types,
// we instead create two "types" of possible answer - either there is a response.. or there isn't.
// This question type then can provide a % of the question answered in the summary.
$alist[] = array("Answers", $statlang->gT("Answer"), $mfield);
$alist[] = array("NoAnswer", $statlang->gT("No answer"), $mfield);
} elseif ($firstletter == "R") {