本文整理汇总了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'];