本文整理匯總了PHP中Answer::selectHotspotCoordinates方法的典型用法代碼示例。如果您正苦於以下問題:PHP Answer::selectHotspotCoordinates方法的具體用法?PHP Answer::selectHotspotCoordinates怎麽用?PHP Answer::selectHotspotCoordinates使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Answer
的用法示例。
在下文中一共展示了Answer::selectHotspotCoordinates方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: switch
$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;
$totalScore += $answerWeighting;
$newquestionList[] = $questionid;
}
break;
case HOT_SPOT_DELINEATION:
示例2: manage_answer
//.........這裏部分代碼省略.........
//probably this attempt came in an exercise all question by page
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'];
示例3: manageAnswers
//.........這裏部分代碼省略.........
$answer_list = array();
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'];