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


PHP Answer::selectDestination方法代码示例

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


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

示例1: array

$destination = array();
$comment = '';
$next = 1;
$_SESSION['hotspot_coord'] = array();
$_SESSION['hotspot_dest'] = array();
$overlap_color = $missing_color = $excess_color = false;
$organs_at_risk_hit = 0;
$wrong_results = false;
$hot_spot_load = false;
$questionScore = 0;
$totalScore = 0;
if (!empty($choice_value)) {
    for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) {
        $answer = $objAnswerTmp->selectAnswer($answerId);
        $answerComment = $objAnswerTmp->selectComment($answerId);
        $answerDestination = $objAnswerTmp->selectDestination($answerId);
        $answerCorrect = $objAnswerTmp->isCorrect($answerId);
        $answerWeighting = $objAnswerTmp->selectWeighting($answerId);
        $numAnswer = $objAnswerTmp->selectAutoId($answerId);
        //delineation
        $delineation_cord = $objAnswerTmp->selectHotspotCoordinates(1);
        $answer_delineation_destination = $objAnswerTmp->selectDestination(1);
        if ($dbg_local > 0) {
            error_log(__LINE__ . ' answerId: ' . $answerId . '(' . $answerType . ') - user delineation_cord: ' . $delineation_cord . ' - $answer_delineation_destination: ' . $answer_delineation_destination, 0);
        }
        switch ($answerType) {
            // for unique answer
            case UNIQUE_ANSWER:
                $studentChoice = $choice_value == $numAnswer ? 1 : 0;
                if ($studentChoice) {
                    $questionScore += $answerWeighting;
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:exercise_submit_modal.php

示例2: manage_answer


//.........这里部分代码省略.........
         if ($feedback_type == 0) {
             $nano->replace_with_real_exe($exeId);
         }
     }
     $user_answer = '';
     // Get answer list for matching
     $sql = "SELECT id_auto, id, answer\n                FROM {$table_ans}\n                WHERE c_id = {$course_id} AND question_id = {$questionId}";
     $res_answer = Database::query($sql);
     $answerMatching = array();
     while ($real_answer = Database::fetch_array($res_answer)) {
         $answerMatching[$real_answer['id_auto']] = $real_answer['answer'];
     }
     $real_answers = array();
     $quiz_question_options = Question::readQuestionOption($questionId, $course_id);
     $organs_at_risk_hit = 0;
     $questionScore = 0;
     if ($debug) {
         error_log('Start answer loop ');
     }
     $answer_correct_array = array();
     for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) {
         $answer = $objAnswerTmp->selectAnswer($answerId);
         $answerComment = $objAnswerTmp->selectComment($answerId);
         $answerCorrect = $objAnswerTmp->isCorrect($answerId);
         $answerWeighting = (double) $objAnswerTmp->selectWeighting($answerId);
         $answerAutoId = $objAnswerTmp->selectAutoId($answerId);
         $answer_correct_array[$answerId] = (bool) $answerCorrect;
         if ($debug) {
             error_log("answer auto id: {$answerAutoId} ");
             error_log("answer correct: {$answerCorrect} ");
         }
         // Delineation
         $delineation_cord = $objAnswerTmp->selectHotspotCoordinates(1);
         $answer_delineation_destination = $objAnswerTmp->selectDestination(1);
         switch ($answerType) {
             // for unique answer
             case UNIQUE_ANSWER:
             case UNIQUE_ANSWER_IMAGE:
             case UNIQUE_ANSWER_NO_OPTION:
                 if ($from_database) {
                     $sql = "SELECT answer FROM {$TBL_TRACK_ATTEMPT}\n                                WHERE\n                                    exe_id = '" . $exeId . "' AND\n                                    question_id= '" . $questionId . "'";
                     $result = Database::query($sql);
                     $choice = Database::result($result, 0, "answer");
                     $studentChoice = $choice == $answerAutoId ? 1 : 0;
                     if ($studentChoice) {
                         $questionScore += $answerWeighting;
                         $totalScore += $answerWeighting;
                     }
                 } else {
                     $studentChoice = $choice == $answerAutoId ? 1 : 0;
                     if ($studentChoice) {
                         $questionScore += $answerWeighting;
                         $totalScore += $answerWeighting;
                     }
                 }
                 break;
                 // for multiple answers
             // for multiple answers
             case MULTIPLE_ANSWER_TRUE_FALSE:
                 if ($from_database) {
                     $choice = array();
                     $sql = "SELECT answer FROM {$TBL_TRACK_ATTEMPT}\n                                WHERE\n                                    exe_id = {$exeId} AND\n                                    question_id = " . $questionId;
                     $result = Database::query($sql);
                     while ($row = Database::fetch_array($result)) {
                         $ind = $row['answer'];
                         $values = explode(':', $ind);
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:67,代码来源:exercise.class.php

示例3: manageAnswers


//.........这里部分代码省略.........
        while ($real_answer = Database::fetch_array($res_answer)) {
            $answer_matching[$real_answer['iid']] = $real_answer['answer'];
            $answer_list[] = $real_answer['iid'];
        }
        if ($answerType == FREE_ANSWER || $answerType == ORAL_EXPRESSION) {
            $nbrAnswers = 1;
            $answer_list[] = 1;
        }
        $real_answers = array();
        $quiz_question_options = Question::readQuestionOption($questionId, $course_id);
        $organs_at_risk_hit = 0;
        $questionScore = 0;
        if ($debug) {
            error_log('<<-- Start answer loop -->');
        }
        $answer_correct_array = array();
        //for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) {
        $counter = 1;
        foreach ($answer_list as $answerId) {
            /** @var \Answer $objAnswerTmp */
            $answer = $objAnswerTmp->selectAnswer($answerId);
            $answerComment = $objAnswerTmp->selectComment($answerId);
            $answerCorrect = $objAnswerTmp->isCorrect($answerId);
            $answerWeighting = (double) $objAnswerTmp->selectWeighting($answerId);
            //$numAnswer = $objAnswerTmp->selectAutoId($answerId);
            $numAnswer = $answerId;
            $answer_correct_array[$answerId] = (bool) $answerCorrect;
            if ($debug) {
                error_log("answer auto id: {$numAnswer} ");
                error_log("answer correct: {$answerCorrect} ");
            }
            //Delineation
            $delineation_cord = $objAnswerTmp->selectHotspotCoordinates(1);
            $answer_delineation_destination = $objAnswerTmp->selectDestination(1);
            switch ($answerType) {
                // for unique answer
                case UNIQUE_ANSWER:
                case UNIQUE_ANSWER_IMAGE:
                case UNIQUE_ANSWER_NO_OPTION:
                    if ($from_database) {
                        $queryans = "SELECT answer FROM " . $TBL_TRACK_ATTEMPT . " WHERE exe_id = '" . $exeId . "' AND question_id= '" . $questionId . "'";
                        $resultans = Database::query($queryans);
                        $choice = Database::result($resultans, 0, "answer");
                        $studentChoice = $choice == $numAnswer ? 1 : 0;
                        if ($studentChoice) {
                            $questionScore += $answerWeighting;
                            $totalScore += $answerWeighting;
                        }
                    } else {
                        $studentChoice = $choice == $numAnswer ? 1 : 0;
                        if ($studentChoice) {
                            $questionScore += $answerWeighting;
                            $totalScore += $answerWeighting;
                        }
                    }
                    break;
                    // for multiple answers
                // for multiple answers
                case MULTIPLE_ANSWER_TRUE_FALSE:
                    if ($from_database) {
                        $choice = array();
                        $queryans = "SELECT answer FROM " . $TBL_TRACK_ATTEMPT . " WHERE exe_id = " . $exeId . " AND question_id = " . $questionId;
                        $resultans = Database::query($queryans);
                        while ($row = Database::fetch_array($resultans)) {
                            $ind = $row['answer'];
                            $result = explode(':', $ind);
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:67,代码来源:exercise.class.php


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