123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996 |
- <?php
- use Chamilo\CourseBundle\Entity\CQuizAnswer;
- class Answer
- {
- public $questionId;
-
- public $answer;
- public $correct;
- public $comment;
- public $weighting;
- public $position;
- public $hotspot_coordinates;
- public $hotspot_type;
- public $destination;
-
-
- public $new_answer;
- public $new_correct;
- public $new_comment;
- public $new_weighting;
- public $new_position;
- public $new_hotspot_coordinates;
- public $new_hotspot_type;
- public $autoId;
- public $nbrAnswers;
- public $new_nbrAnswers;
- public $new_destination;
- public $course;
- public $iid;
- public $questionJSId;
- public $standalone;
-
- public function __construct($questionId, $course_id = null)
- {
- $this->questionId = intval($questionId);
- $this->answer = array();
- $this->correct = array();
- $this->comment = array();
- $this->weighting = array();
- $this->position = array();
- $this->hotspot_coordinates = array();
- $this->hotspot_type = array();
- $this->destination = array();
-
- $this->cancel();
- if (!empty($course_id)) {
- $courseInfo = api_get_course_info_by_id($course_id);
- } else {
- $courseInfo = api_get_course_info();
- }
- $this->course = $courseInfo;
- $this->course_id = $courseInfo['real_id'];
-
- $objExercise = new Exercise($this->course_id);
- $exerciseId = isset($_REQUEST['exerciseId']) ? $_REQUEST['exerciseId'] : null;
- $objExercise->read($exerciseId);
- if ($objExercise->random_answers == '1' && $this->getQuestionType() != CALCULATED_ANSWER) {
- $this->readOrderedBy('rand()', '');
- } else {
- $this->read();
- }
- }
-
- public function cancel()
- {
- $this->new_answer = array();
- $this->new_correct = array();
- $this->new_comment = array();
- $this->new_weighting = array();
- $this->new_position = array();
- $this->new_hotspot_coordinates = array();
- $this->new_hotspot_type = array();
- $this->new_nbrAnswers = 0;
- $this->new_destination = array();
- }
-
- public function read()
- {
- $TBL_ANSWER = Database::get_course_table(TABLE_QUIZ_ANSWER);
- $questionId = $this->questionId;
- $sql = "SELECT * FROM $TBL_ANSWER
- WHERE
- c_id = {$this->course_id} AND
- question_id ='".$questionId."'
- ORDER BY position";
- $result = Database::query($sql);
- $i = 1;
-
- while ($object = Database::fetch_object($result)) {
- $this->id[$i] = $object->id;
- $this->answer[$i] = $object->answer;
- $this->correct[$i] = $object->correct;
- $this->comment[$i] = $object->comment;
- $this->weighting[$i] = $object->ponderation;
- $this->position[$i] = $object->position;
- $this->hotspot_coordinates[$i] = $object->hotspot_coordinates;
- $this->hotspot_type[$i] = $object->hotspot_type;
- $this->destination[$i] = $object->destination;
- $this->autoId[$i] = $object->id_auto;
- $this->iid[$i] = $object->iid;
- $i++;
- }
- $this->nbrAnswers = $i - 1;
- }
-
- public function getAnswerByAutoId($id)
- {
- foreach ($this->autoId as $key => $autoId) {
- if ($autoId == $id) {
- $result = [
- 'answer' => $this->answer[$key],
- 'correct' => $this->correct[$key],
- 'comment' => $this->comment[$key],
- ];
- return $result;
- }
- }
- return [];
- }
-
- public function selectAnswerId()
- {
- $TBL_ANSWER = Database::get_course_table(TABLE_QUIZ_ANSWER);
- $questionId = $this->questionId;
- $sql = "SELECT id FROM
- $TBL_ANSWER
- WHERE c_id = {$this->course_id} AND question_id ='".$questionId."'";
- $result = Database::query($sql);
- $id = array();
-
- if (Database::num_rows($result) > 0) {
- while ($object = Database::fetch_array($result)) {
- $id[] = $object['id'];
- }
- }
- return $id;
- }
-
- public function readOrderedBy($field, $order = 'ASC')
- {
- $field = Database::escape_string($field);
- if (empty($field)) {
- $field = 'position';
- }
- if ($order != 'ASC' && $order != 'DESC') {
- $order = 'ASC';
- }
- $TBL_ANSWER = Database::get_course_table(TABLE_QUIZ_ANSWER);
- $TBL_QUIZ = Database::get_course_table(TABLE_QUIZ_QUESTION);
- $questionId = intval($this->questionId);
- $sql = "SELECT type FROM $TBL_QUIZ
- WHERE c_id = {$this->course_id} AND id = $questionId";
- $result_question = Database::query($sql);
- $questionType = Database::fetch_array($result_question);
- if ($questionType['type'] == DRAGGABLE) {
-
- $this->read();
- return true;
- }
- $sql = "SELECT
- answer,
- correct,
- comment,
- ponderation,
- position,
- hotspot_coordinates,
- hotspot_type,
- destination,
- id_auto,
- iid
- FROM $TBL_ANSWER
- WHERE
- c_id = {$this->course_id} AND
- question_id='".$questionId."'
- ORDER BY $field $order";
- $result = Database::query($sql);
- $i = 1;
-
- $doubt_data = null;
- while ($object = Database::fetch_object($result)) {
- if ($questionType['type'] == UNIQUE_ANSWER_NO_OPTION && $object->position == 666) {
- $doubt_data = $object;
- continue;
- }
- $this->answer[$i] = $object->answer;
- $this->correct[$i] = $object->correct;
- $this->comment[$i] = $object->comment;
- $this->weighting[$i] = $object->ponderation;
- $this->position[$i] = $object->position;
- $this->hotspot_coordinates[$i] = $object->hotspot_coordinates;
- $this->hotspot_type[$i] = $object->hotspot_type;
- $this->destination[$i] = $object->destination;
- $this->autoId[$i] = $object->id_auto;
- $this->iid[$i] = $object->iid;
- $i++;
- }
- if ($questionType['type'] == UNIQUE_ANSWER_NO_OPTION && !empty($doubt_data)) {
- $this->answer[$i] = $doubt_data->answer;
- $this->correct[$i] = $doubt_data->correct;
- $this->comment[$i] = $doubt_data->comment;
- $this->weighting[$i] = $doubt_data->ponderation;
- $this->position[$i] = $doubt_data->position;
- $this->hotspot_coordinates[$i] = isset($object->hotspot_coordinates) ? $object->hotspot_coordinates : 0;
- $this->hotspot_type[$i] = isset($object->hotspot_type) ? $object->hotspot_type : 0;
- $this->destination[$i] = $doubt_data->destination;
- $this->autoId[$i] = $doubt_data->id_auto;
- $this->iid[$i] = $doubt_data->iid;
- $i++;
- }
- $this->nbrAnswers = $i - 1;
- return true;
- }
-
- public function selectAutoId($id)
- {
- return isset($this->autoId[$id]) ? $this->autoId[$id] : 0;
- }
-
- public function selectNbrAnswers()
- {
- return $this->nbrAnswers;
- }
-
- public function selectQuestionId()
- {
- return $this->questionId;
- }
-
- public function selectDestination($id)
- {
- return isset($this->destination[$id]) ? $this->destination[$id] : null;
- }
-
- public function selectAnswer($id)
- {
- return isset($this->answer[$id]) ? $this->answer[$id] : null;
- }
-
- public function selectAnswerByAutoId($auto_id)
- {
- $TBL_ANSWER = Database::get_course_table(TABLE_QUIZ_ANSWER);
- $auto_id = intval($auto_id);
- $sql = "SELECT id, answer, id_auto FROM $TBL_ANSWER
- WHERE c_id = {$this->course_id} AND id_auto='$auto_id'";
- $rs = Database::query($sql);
- if (Database::num_rows($rs) > 0) {
- $row = Database::fetch_array($rs, 'ASSOC');
- return $row;
- }
- return false;
- }
-
- public function selectAnswerIdByPosition($pos)
- {
- foreach ($this->position as $k => $v) {
- if ($v != $pos) {
- continue;
- }
- return $k;
- }
- return false;
- }
-
- public function getAnswersList($decode = false)
- {
- $list = array();
- for ($i = 1; $i <= $this->nbrAnswers; $i++) {
- if (!empty($this->answer[$i])) {
-
- if ($decode) {
- $this->answer[$i] = api_html_entity_decode(
- $this->answer[$i],
- ENT_QUOTES,
- api_get_system_encoding()
- );
- $this->comment[$i] = api_html_entity_decode(
- $this->comment[$i],
- ENT_QUOTES,
- api_get_system_encoding()
- );
- }
- $list[] = array(
- 'id' => $i,
- 'answer' => $this->answer[$i],
- 'comment' => $this->comment[$i],
- 'grade' => $this->weighting[$i],
- 'hotspot_coord' => $this->hotspot_coordinates[$i],
- 'hotspot_type' => $this->hotspot_type[$i],
- 'correct' => $this->correct[$i],
- 'destination' => $this->destination[$i],
- );
- }
- }
- return $list;
- }
-
- public function getGradesList()
- {
- $list = array();
- for ($i = 0; $i < $this->nbrAnswers; $i++) {
- if (!empty($this->answer[$i])) {
- $list[$i] = $this->weighting[$i];
- }
- }
- return $list;
- }
-
- public function getQuestionType()
- {
- $TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
- $sql = "SELECT type FROM $TBL_QUESTIONS
- WHERE c_id = {$this->course_id} AND id = '".$this->questionId."'";
- $res = Database::query($sql);
- if (Database::num_rows($res) <= 0) {
- return null;
- }
- $row = Database::fetch_array($res);
- return $row['type'];
- }
-
- public function isCorrect($id)
- {
- return isset($this->correct[$id]) ? $this->correct[$id] : null;
- }
-
- public function selectComment($id)
- {
- return isset($this->comment[$id]) ? $this->comment[$id] : null;
- }
-
- public function selectWeighting($id)
- {
- return isset($this->weighting[$id]) ? $this->weighting[$id] : null;
- }
-
- public function selectPosition($id)
- {
- return isset($this->position[$id]) ? $this->position[$id] : null;
- }
-
- public function selectHotspotCoordinates($id)
- {
- return isset($this->hotspot_coordinates[$id]) ? $this->hotspot_coordinates[$id] : null;
- }
-
- public function selectHotspotType($id)
- {
- return isset($this->hotspot_type[$id]) ? $this->hotspot_type[$id] : null;
- }
-
- public function createAnswer(
- $answer,
- $correct,
- $comment,
- $weighting,
- $position,
- $new_hotspot_coordinates = null,
- $new_hotspot_type = null,
- $destination = ''
- ) {
- $this->new_nbrAnswers++;
- $id = $this->new_nbrAnswers;
- $this->new_answer[$id] = $answer;
- $this->new_correct[$id] = $correct;
- $this->new_comment[$id] = $comment;
- $this->new_weighting[$id] = $weighting;
- $this->new_position[$id] = $position;
- $this->new_hotspot_coordinates[$id] = $new_hotspot_coordinates;
- $this->new_hotspot_type[$id] = $new_hotspot_type;
- $this->new_destination[$id] = $destination;
- }
-
- public function updateAnswers(
- $iid,
- $answer,
- $comment,
- $correct,
- $weighting,
- $position,
- $destination,
- $hotspot_coordinates,
- $hotspot_type
- ) {
- $em = Database::getManager();
-
- $quizAnswer = $em->find('ChamiloCourseBundle:CQuizAnswer', $iid);
- $quizAnswer
- ->setAnswer($answer)
- ->setComment($comment)
- ->setCorrect($correct)
- ->setPonderation($weighting)
- ->setPosition($position)
- ->setDestination($destination)
- ->setHotspotCoordinates($hotspot_coordinates)
- ->setHotspotType($hotspot_type);
- $em->merge($quizAnswer);
- $em->flush();
- }
-
- public function save()
- {
- $answerTable = Database::get_course_table(TABLE_QUIZ_ANSWER);
- $em = Database::getManager();
- $questionId = intval($this->questionId);
- $c_id = $this->course['real_id'];
- $correctList = [];
- $answerList = [];
- for ($i = 1; $i <= $this->new_nbrAnswers; $i++) {
- $answer = $this->new_answer[$i];
- $correct = isset($this->new_correct[$i]) ? $this->new_correct[$i] : '';
- $comment = isset($this->new_comment[$i]) ? $this->new_comment[$i] : '';
- $weighting = isset($this->new_weighting[$i]) ? $this->new_weighting[$i] : '';
- $position = isset($this->new_position[$i]) ? $this->new_position[$i] : '';
- $hotspot_coordinates = isset($this->new_hotspot_coordinates[$i]) ? $this->new_hotspot_coordinates[$i] : '';
- $hotspot_type = isset($this->new_hotspot_type[$i]) ? $this->new_hotspot_type[$i] : '';
- $destination = isset($this->new_destination[$i]) ? $this->new_destination[$i] : '';
- $autoId = $this->selectAutoId($i);
- $iid = isset($this->iid[$i]) ? $this->iid[$i] : 0;
- if (!isset($this->position[$i])) {
- $quizAnswer = new CQuizAnswer();
- $quizAnswer
- ->setIdAuto($autoId)
- ->setCId($c_id)
- ->setQuestionId($questionId)
- ->setAnswer($answer)
- ->setCorrect($correct)
- ->setComment($comment)
- ->setPonderation($weighting)
- ->setPosition($position)
- ->setHotspotCoordinates($hotspot_coordinates)
- ->setHotspotType($hotspot_type)
- ->setDestination($destination);
- $em->persist($quizAnswer);
- $em->flush();
- $iid = $quizAnswer->getIid();
- if ($iid) {
- $quizAnswer
- ->setId($iid)
- ->setIdAuto($iid);
- $em->merge($quizAnswer);
- $em->flush();
- $questionType = $this->getQuestionType();
- if (in_array(
- $questionType,
- [MATCHING, MATCHING_DRAGGABLE]
- )) {
- $answer = new Answer($this->questionId);
- $answer->read();
- $correctAnswerId = $answer->selectAnswerIdByPosition($correct);
-
-
- if ($questionType == MATCHING && !$correctAnswerId) {
- continue;
- }
- $correctAnswerAutoId = $answer->selectAutoId($correct);
- $quizAnswer->setCorrect($correctAnswerAutoId ? $correctAnswerAutoId : 0);
- $em->merge($quizAnswer);
- $em->flush();
- }
- }
- } else {
-
-
-
- $this->updateAnswers(
- $iid,
- $this->new_answer[$i],
- $this->new_comment[$i],
- $this->new_correct[$i],
- $this->new_weighting[$i],
- $this->new_position[$i],
- $this->new_destination[$i],
- $this->new_hotspot_coordinates[$i],
- $this->new_hotspot_type[$i]
- );
- }
- $answerList[$i] = $iid;
- if ($correct) {
- $correctList[$iid] = true;
- }
- }
- $questionType = self::getQuestionType();
- if ($questionType == DRAGGABLE) {
- foreach ($this->new_correct as $value => $status) {
- if (!empty($status)) {
- $correct = $answerList[$status];
- $myAutoId = $answerList[$value];
- $sql = "UPDATE $answerTable
- SET correct = '$correct'
- WHERE
- id_auto = $myAutoId
- ";
- Database::query($sql);
- }
- }
- }
- if (count($this->position) > $this->new_nbrAnswers) {
- $i = $this->new_nbrAnswers + 1;
- while ($this->position[$i]) {
- $position = $this->position[$i];
- $sql = "DELETE FROM $answerTable
- WHERE
- c_id = {$this->course_id} AND
- question_id = '".$questionId."' AND
- position ='$position'";
- Database::query($sql);
- $i++;
- }
- }
-
- $this->answer = $this->new_answer;
- $this->correct = $this->new_correct;
- $this->comment = $this->new_comment;
- $this->weighting = $this->new_weighting;
- $this->position = $this->new_position;
- $this->hotspot_coordinates = $this->new_hotspot_coordinates;
- $this->hotspot_type = $this->new_hotspot_type;
- $this->nbrAnswers = $this->new_nbrAnswers;
- $this->destination = $this->new_destination;
- $this->cancel();
- }
-
- public function duplicate($newQuestion, $course_info = null)
- {
- $newQuestionId = $newQuestion->id;
- if (empty($course_info)) {
- $course_info = $this->course;
- }
- $fixed_list = array();
- $tableAnswer = Database::get_course_table(TABLE_QUIZ_ANSWER);
- if (self::getQuestionType() == MULTIPLE_ANSWER_TRUE_FALSE ||
- self::getQuestionType() == MULTIPLE_ANSWER_TRUE_FALSE
- ) {
-
- $origin_options = Question::readQuestionOption(
- $this->selectQuestionId(),
- $this->course['real_id']
- );
- if (!empty($origin_options)) {
- foreach ($origin_options as $item) {
- $new_option_list[] = $item['id'];
- }
- }
- $destination_options = Question::readQuestionOption(
- $newQuestionId,
- $course_info['real_id']
- );
- $i = 0;
- if (!empty($destination_options)) {
- foreach ($destination_options as $item) {
- $fixed_list[$new_option_list[$i]] = $item['id'];
- $i++;
- }
- }
- }
-
- if ($this->nbrAnswers) {
-
- $courseId = $course_info['real_id'];
- $correctAnswers = [];
- $onlyAnswers = [];
- $allAnswers = [];
- $em = Database::getManager();
- if (in_array($newQuestion->type, [MATCHING, MATCHING_DRAGGABLE])) {
- $temp = array();
- for ($i = 1; $i <= $this->nbrAnswers; $i++) {
- $answer = [
- 'id' => $this->id[$i],
- 'answer' => $this->answer[$i],
- 'correct' => $this->correct[$i],
- 'comment' => $this->comment[$i],
- 'weighting' => $this->weighting[$i],
- 'ponderation' => $this->weighting[$i],
- 'position' => $this->position[$i],
- 'hotspot_coordinates' => $this->hotspot_coordinates[$i],
- 'hotspot_type' => $this->hotspot_type[$i],
- 'destination' => $this->destination[$i],
- ];
- $temp[$answer['position']] = $answer;
- $allAnswers[$this->id[$i]] = $this->answer[$i];
- }
- foreach ($temp as $index => $answer) {
- if ($this->course['id'] != $course_info['id']) {
-
- $answer['answer'] = DocumentManager::replace_urls_inside_content_html_from_copy_course(
- $answer['answer'],
- $this->course['id'],
- $course_info['id']
- );
- $answer['comment'] = DocumentManager::replace_urls_inside_content_html_from_copy_course(
- $answer['comment'],
- $this->course['id'],
- $course_info['id']
- );
- }
- $quizAnswer = new CQuizAnswer();
- $quizAnswer
- ->setCId($courseId)
- ->setQuestionId($newQuestionId)
- ->setAnswer($answer['answer'])
- ->setCorrect($answer['correct'])
- ->setComment($answer['comment'])
- ->setPonderation($answer['ponderation'])
- ->setPosition($answer['position'])
- ->setHotspotCoordinates($answer['hotspot_coordinates'])
- ->setHotspotType($answer['hotspot_type'])
- ->setIdAuto(0);
- $em->persist($quizAnswer);
- $em->flush();
- $answerId = $quizAnswer->getIid();
- if ($answerId) {
- $quizAnswer
- ->setId($answerId)
- ->setIdAuto($answerId);
- $em->merge($quizAnswer);
- $em->flush();
- $correctAnswers[$answerId] = $answer['correct'];
- $onlyAnswers[$answerId] = $answer['answer'];
- }
- }
- } else {
- for ($i = 1; $i <= $this->nbrAnswers; $i++) {
- if ($this->course['id'] != $course_info['id']) {
- $this->answer[$i] = DocumentManager::replace_urls_inside_content_html_from_copy_course(
- $this->answer[$i],
- $this->course['id'],
- $course_info['id']
- );
- $this->comment[$i] = DocumentManager::replace_urls_inside_content_html_from_copy_course(
- $this->comment[$i],
- $this->course['id'],
- $course_info['id']
- );
- }
- $correct = $this->correct[$i];
- if ($newQuestion->type == MULTIPLE_ANSWER_TRUE_FALSE ||
- $newQuestion->type == MULTIPLE_ANSWER_TRUE_FALSE
- ) {
- $correct = $fixed_list[intval($correct)];
- }
- $quizAnswer = new CQuizAnswer();
- $quizAnswer
- ->setCId($courseId)
- ->setQuestionId($newQuestionId)
- ->setAnswer($this->answer[$i])
- ->setCorrect($correct)
- ->setComment($this->comment[$i])
- ->setPonderation($this->weighting[$i])
- ->setPosition($this->position[$i])
- ->setHotspotCoordinates($this->hotspot_coordinates[$i])
- ->setHotspotType($this->hotspot_type[$i])
- ->setDestination($this->destination[$i]);
- $em->persist($quizAnswer);
- $em->flush();
- $answerId = $quizAnswer->getIid();
- $quizAnswer
- ->setId($answerId)
- ->setIdAuto($answerId);
- $em->merge($quizAnswer);
- $em->flush();
- $correctAnswers[$answerId] = $correct;
- $onlyAnswers[$answerId] = $this->answer[$i];
- $allAnswers[$this->id[$i]] = $this->answer[$i];
- }
- }
-
- if (in_array($newQuestion->type, [DRAGGABLE, MATCHING, MATCHING_DRAGGABLE])) {
- $onlyAnswersFlip = array_flip($onlyAnswers);
- foreach ($correctAnswers as $answer_id => $correct_answer) {
- $params = array();
- if (isset($allAnswers[$correct_answer]) &&
- isset($onlyAnswersFlip[$allAnswers[$correct_answer]])
- ) {
- $params['correct'] = $onlyAnswersFlip[$allAnswers[$correct_answer]];
- Database::update(
- $tableAnswer,
- $params,
- array(
- 'id = ? AND c_id = ? AND question_id = ? ' => array(
- $answer_id,
- $courseId,
- $newQuestionId,
- ),
- )
- );
- }
- }
- }
- }
- }
-
- public function getJs()
- {
-
- return "<script>
- jsPlumb.ready(function() {
- if ($('#drag{$this->questionId}_question').length > 0) {
- MatchingDraggable.init('{$this->questionId}');
- }
- });
- </script>";
- }
-
- public function isCorrectByAutoId($needle)
- {
- $key = 0;
- foreach ($this->autoId as $autoIdKey => $autoId) {
- if ($autoId == $needle) {
- $key = $autoIdKey;
- }
- }
- if (!$key) {
- return false;
- }
- return $this->isCorrect($key) ? true : false;
- }
- }
|