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


PHP Answer::addAnswer方法代码示例

本文整理汇总了PHP中Answer::addAnswer方法的典型用法代码示例。如果您正苦于以下问题:PHP Answer::addAnswer方法的具体用法?PHP Answer::addAnswer怎么用?PHP Answer::addAnswer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Answer的用法示例。


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

示例1: elseif

     $question->setType($_SESSION['values']['question']['qt']);
     $question->setTopic($_SESSION['values']['question']['t_id']);
     if ($_SESSION['values']['question']['descriptionText'] == '') {
         $_SESSION['values']['question']['description'] = 0;
     }
     if ($_SESSION['values']['question']['description'] == 0 && $_SESSION['values']['question']['descriptionText'] != '') {
         $_SESSION['values']['question']['descriptionText'] = '';
     }
     $check = $question->checkQuestion();
     if ($check == 1 && $_SESSION['values']['question']['t_id'] != '') {
         $topic->getTopic();
         $topicArray = $topic->getTopicArray();
         $question->setAllTopics($topicArray);
         $question->showQuestionInfos();
         $answer->setQuestionType($_SESSION['values']['question']['qt']);
         $answer->addAnswer();
         $answer->addAnswer();
         $answer->setType();
     } elseif ($check == 2) {
         echo "<meta http-equiv='refresh' content='0; url=index.php?site=collect_question&amp;error=exists' />";
     } elseif ($check == 0) {
         echo "<meta http-equiv='refresh' content='0; url=index.php?site=collect_question&amp;error=missing' />";
     } elseif ($check == 3) {
         echo " <meta http-equiv='refresh' content='0; url=index.php?site=collect_question&amp;error=blank' />";
     }
     break;
 case 'setAnswers':
     // Antworten setzen
     // Wertzuweisung
     $id = 0;
     if (isset($_REQUEST["questionId"])) {
开发者ID:eruedin,项目名称:cats,代码行数:31,代码来源:collect_question.php

示例2: LatLong

$game = Game::findGame();
if ($game->type == "geo" || $game->type == "places" || $game->type == "pt") {
    $distanceAway = LatLong::findDistance($correct->location, new LatLong($lat, $long));
} else {
    $distanceAway = abs($answer - $correct->value);
}
if ($answer > 100000) {
    $distanceAway = round($distanceAway, -5);
}
//die ($questionNumber);
$questionNumberSite = $game->round;
//if ($questionNumberSite!=$questionNumber)
if ($questionNumberSite < 0) {
    header('Location: waitingScreen.php?message=' . "Submit your answer in time");
}
$place = Answer::addAnswer($_SESSION["user_id"], $questionNumber, $lat, $long, $answer, $distanceAway, $color, $game->type);
//NOW WE FIND THE OVERALL PERCENT PLACE THAT PERCENT DID ON THAT question_id
//Answer::findPercentPlace()
//echo $sql;
//die();
//SOCKET SENDING MESSAGE
if ($place >= 0) {
    $entryData = array('category' => "Game" . $_SESSION['game_id'] . $questionNumber, 'title' => stripslashes($_SESSION["name"]), 'miles' => number_format($distanceAway), 'color' => $color);
    $context = new ZMQContext();
    $socket = $context->getSocket(ZMQ::SOCKET_PUSH, 'my pusher');
    $socket->connect("tcp://localhost:5555");
    $socket->send(json_encode($entryData));
}
//END SOCKET SENDING
if ($distanceAway > 1000) {
    $distanceAway = number_format($distanceAway);
开发者ID:theborland,项目名称:myhoot,代码行数:31,代码来源:submitAnswer.php

示例3: fillMissingAnswers

 public function fillMissingAnswers()
 {
     global $conn;
     $allUsers = array();
     $sql = "SELECT * from `users` WHERE `game_id`= '" . $_SESSION['game_id'] . "'";
     $result = $conn->query($sql);
     //$row = $result->fetch_assoc();
     //echo $sql. " rea".$result;
     //print_r($this->allAnswers);
     while ($row = $result->fetch_assoc()) {
         // echo $sql;
         $name = $row["name"];
         $user_id = $row["user_id"];
         $color = $row["color"];
         $ans = -999;
         if (!array_key_exists($user_id, $this->allAnswers)) {
             Answer::addAnswer($user_id, $_SESSION["questionNumber"], -99, -99, $ans, -1, $color, "no");
             $this->allAnswers[] = Answer::addUser($_SESSION["questionNumber"], new LatLong(-99, -99), $ans, $user_id, 0, 0, $color);
         }
     }
 }
开发者ID:theborland,项目名称:myhoot,代码行数:21,代码来源:Answer.php


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