4 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
5 require_once
'./Modules/Test/classes/inc.AssessmentConstants.php';
6 require_once
'./Modules/TestQuestionPool/interfaces/interface.ilObjQuestionScoringAdjustable.php';
7 require_once
'./Modules/TestQuestionPool/interfaces/interface.ilObjAnswerScoringAdjustable.php';
8 require_once
'./Modules/TestQuestionPool/interfaces/interface.iQuestionCondition.php';
9 require_once
'./Modules/TestQuestionPool/classes/class.ilUserQuestionResult.php';
11 require_once
'Modules/TestQuestionPool/classes/questions/class.ilAssOrderingElementList.php';
161 $this->
setId($question_id);
170 include_once(
"./Services/RTE/classes/class.ilRTE.php");
172 $this->ordering_type = strlen(
$data[
"ordering_type"]) ?
$data[
"ordering_type"] :
OQ_TERMS;
173 $this->thumb_geometry =
$data[
"thumb_geometry"];
174 $this->element_height =
$data[
"element_height"];
186 $this->orderingElementList->setQuestionId($this->
getId());
187 $this->orderingElementList->loadFromDb();
189 parent::loadFromDb($question_id);
205 $this_id = $this->
getId();
209 include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
213 if( (
int)$testObjId > 0 )
215 $clone->setObjId($testObjId);
239 $clone->duplicateOrderlingElementList();
242 $clone->copyPageOfQuestion($this_id);
244 $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
246 $clone->duplicateImages($this_id, $thisObjId, $clone->getId(), $testObjId);
248 $clone->onDuplicate($thisObjId, $this_id, $clone->getObjId(), $clone->getId());
274 include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
277 $source_questionpool_id = $this->
getObjId();
278 $clone->setObjId($target_questionpool_id);
291 $clone->duplicateImages(
$original_id, $source_questionpool_id, $clone->getId(), $target_questionpool_id);
293 $clone->onCopy($source_questionpool_id,
$original_id, $clone->getObjId(), $clone->getId());
306 include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
309 $sourceParentId = $this->
getObjId();
315 $clone->setObjId($targetParentId);
317 if ($targetQuestionTitle)
319 $clone->setTitle($targetQuestionTitle);
324 $clone->copyPageOfQuestion($sourceQuestionId);
326 $clone->copyXHTMLMediaObjectsOfQuestion($sourceQuestionId);
328 $clone->duplicateImages($sourceQuestionId, $sourceParentId, $clone->getId(), $clone->getObjId());
330 $clone->onCopy($sourceParentId, $sourceQuestionId, $clone->getObjId(), $clone->getId());
335 function duplicateImages($src_question_id, $src_object_id, $dest_question_id, $dest_object_id)
340 $imagepath_original = $this->
getImagePath($src_question_id, $src_object_id);
341 $imagepath = $this->
getImagePath($dest_question_id, $dest_object_id);
343 if (!file_exists($imagepath)) {
349 if (!@copy($imagepath_original .
$filename, $imagepath . $filename))
351 $ilLog->write(
"image could not be duplicated!!!!");
353 if (@file_exists($imagepath_original. $this->getThumbPrefix().
$filename))
357 $ilLog->write(
"image thumbnail could not be duplicated!!!!");
375 $imagepath_original = str_replace(
"/$this->id/images",
"/$question_id/images", $imagepath);
376 $imagepath_original = str_replace(
"/$this->obj_id/",
"/$source_questionpool/", $imagepath_original);
377 if (!file_exists($imagepath)) {
383 if (!@copy($imagepath_original .
$filename, $imagepath . $filename))
385 $ilLog->write(
"Ordering Question image could not be copied: ${imagepath_original}${filename}");
387 if (@file_exists($imagepath_original. $this->getThumbPrefix().
$filename))
391 $ilLog->write(
"Ordering Question image thumbnail could not be copied: $imagepath_original" . $this->
getThumbPrefix() . $filename);
445 if( $forceCorrectSolution || !$activeId || $passIndex === null )
452 if( !count($solutionValues) )
477 #if( $pass === null && !ilObjTest::_getUsePreviousAnswers($activeId, true) ) 478 #// condition looks strange? yes - keep it null when previous solutions not enabled (!) 480 # $pass = ilObjTest::_getPass($activeId); 490 if( count($indexedSolutionValues) )
505 $value2 = explode(
':', $value2);
507 $randomIdentifier = $value2[0];
508 $selectedPosition = $value1;
509 $selectedIndentation = $value2[1];
513 $element->setPosition($selectedPosition);
514 $element->setIndentation($selectedIndentation);
526 $solutionIdentifier = $value1;
527 $selectedPosition = ($value2 - 1);
528 $selectedIndentation = 0;
530 $element = $this->
getOrderingElementList()->getElementBySolutionIdentifier($solutionIdentifier)->getClone();
532 $element->setPosition($selectedPosition);
533 $element->setIndentation($selectedIndentation);
546 $solutionOrderingList->setQuestionId($this->
getId());
548 foreach($indexedSolutionValues as $value1 => $value2)
559 $solutionOrderingList->addElement($element);
567 return $solutionOrderingList;
577 $shuffledRandomIdentifierIndex = $this->
getShuffler()->shuffle(
582 $shuffledElementList->reorderByRandomIdentifiers($shuffledRandomIdentifierIndex);
583 $shuffledElementList->resetElementsIndentations();
585 return $shuffledElementList;
704 throw new ilTestException(
'return details not implemented for '.__METHOD__);
714 if( !count($solutionValuePairs) )
732 $solutionOrderingElementList = unserialize(
764 if (preg_match(
"/.*\\.(\\w+)$/",
$filename, $matches))
766 $extension = $matches[1];
768 return md5(
$filename) .
"." . $extension;
780 if (strcmp($f[
'type'],
'file') == 0)
785 if (strcmp($f[
'entry'], $orderElement->getContent()) == 0) $found =
true;
786 if (strcmp($f[
'entry'], $this->
getThumbPrefix() . $orderElement->getContent()) == 0) $found =
true;
813 if( !strlen($imageFilename) )
826 if( !strlen($imageFilename) )
831 if( !file_exists($this->
getImagePath().$imageFilename) )
864 if( !strlen($uploadFile) )
883 foreach($elementList as $element)
927 include_once
"./Modules/Test/classes/class.ilObjTest.php";
932 function() use (&$entered_values, $active_id,
$pass, $authorized)
938 $value1 = $orderingElement->getStorageValue1($this->
getOrderingType());
939 $value2 = $orderingElement->getStorageValue2($this->
getOrderingType());
950 $this->
log($active_id,
'log_user_entered_values');
954 $this->
log($active_id,
'log_user_not_entered_values');
979 $ilDB->manipulateF(
"INSERT INTO " . $this->
getAdditionalTableName() .
" (question_fi, ordering_type, thumb_geometry, element_height) 980 VALUES (%s, %s, %s, %s)",
981 array(
"integer",
"text",
"integer",
"integer" ),
984 $this->ordering_type,
1019 return "assOrderingQuestion";
1030 return "qpl_qst_ordering";
1041 return "qpl_a_ordering";
1050 $text = parent::getRTETextWithMediaObjects();
1054 $text .= $orderingElement->getContent();
1090 parent::setExportDetailsXLS(
$worksheet, $startrow, $active_id,
$pass);
1094 foreach ($solutions as $solution)
1096 $sol[$solution[
"value1"]] = $solution[
"value2"];
1099 $sol = array_keys($sol);
1102 foreach ($sol as $idx)
1104 foreach ($solutions as $solution)
1106 if ($solution[
"value1"] == $idx)
$worksheet->setCell($startrow + $i, 0, $solution[
"value2"]);
1109 $worksheet->setCell($startrow + $i, 1, $element->getContent());
1113 return $startrow + $i + 1;
1138 $this->thumb_geometry = ($a_geometry < 1) ? 100 : $a_geometry;
1158 $this->element_height = ($a_height < 20) ?
"" : $a_height;
1188 switch (strtoupper($path_info[
'extension']))
1209 include_once(
"./Services/RTE/classes/class.ilRTE.php");
1216 $result[
'shuffle'] = (bool)
true;
1219 'onenotcorrect' => $this->
formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(),
false)),
1220 'allcorrect' => $this->
formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(),
true))
1231 $answers[
$counter] = $orderingElement->getContent();
1234 $answers = $this->
getShuffler()->shuffle($answers);
1236 foreach ($answers as $order => $answer)
1238 array_push($arr,
array(
1239 "answertext" => (
string) $answer,
1240 "order" => (
int) $order
1286 $formField->setInteractionEnabled(
true);
1294 $formField->setEditElementOccuranceEnabled(
true);
1295 $formField->setEditElementOrderEnabled(
true);
1306 $formField->
setInfo($this->lng->txt(
'ordering_answer_sequence_info'));
1307 $formField->
setTitle($this->lng->txt(
'answers'));
1317 require_once
'Modules/TestQuestionPool/classes/forms/class.ilAssOrderingTextsInputGUI.php';
1320 $formDataConverter, self::ORDERING_ELEMENT_FORM_FIELD_POSTVAR
1325 return $orderingElementInput;
1335 require_once
'Modules/TestQuestionPool/classes/forms/class.ilAssOrderingImagesInputGUI.php';
1338 $formDataConverter, self::ORDERING_ELEMENT_FORM_FIELD_POSTVAR
1341 $orderingElementInput->setImageRemovalCommand(self::ORDERING_ELEMENT_FORM_CMD_REMOVE_IMG);
1342 $orderingElementInput->setImageUploadCommand(self::ORDERING_ELEMENT_FORM_CMD_UPLOAD_IMG);
1346 return $orderingElementInput;
1356 require_once
'Modules/TestQuestionPool/classes/forms/class.ilAssNestedOrderingElementsInputGUI.php';
1359 $formDataConverter, self::ORDERING_ELEMENT_FORM_FIELD_POSTVAR
1362 $orderingElementInput->setUniquePrefix($this->
getId());
1369 return $orderingElementInput;
1378 return $form->
getItemByPostVar(self::ORDERING_ELEMENT_FORM_FIELD_POSTVAR)->getElementList($this->
getId());
1390 $orderingGUI->setValueByArray($userSolutionPost);
1392 if( !$orderingGUI->checkInput() )
1394 require_once
'Modules/Test/exceptions/class.ilTestException.php';
1398 require_once
'Modules/TestQuestionPool/classes/questions/class.ilAssOrderingElementList.php';
1403 foreach($orderingGUI->getElementList($this->getId()) as $submittedElement)
1405 $solutionElement = $storedElementList->getElementByRandomIdentifier(
1406 $submittedElement->getRandomIdentifier()
1409 $solutionElement->setPosition($submittedElement->getPosition());
1413 $solutionElement->setIndentation($submittedElement->getIndentation());
1416 $solutionOrderingElementList->addElement($solutionElement);
1419 return $solutionOrderingElementList;
1432 if( $this->postSolutionOrderingElementList === null )
1435 $this->postSolutionOrderingElementList = $list;
1460 $userElement = $solutionOrderingElementList->
getElementByPosition( $correctElement->getPosition() );
1462 if( !$correctElement->isSameElement($userElement) )
1469 return $reachedPoints;
1486 $res = $ilDB->queryF(
'SELECT depth FROM qpl_a_ordering WHERE question_fi = %s ORDER BY position ASC',
1488 while(
$row = $ilDB->fetchAssoc(
$res))
1490 $this->old_ordering_depth[] =
$row[
'depth'];
1503 $res = $ilDB->queryF(
'SELECT solution_key FROM qpl_a_ordering WHERE random_id = %s',
1507 return $row[
'solution_key'];
1514 $ilDB->update(
'qpl_a_ordering',
1515 array(
'solution_key'=>
array(
'integer', $a_index),
1516 'depth' =>
array(
'integer', $a_depth)),
1517 array(
'answertext' =>
array(
'text', $a_answer_text)));
1533 require_once
"./Modules/TestQuestionPool/classes/class.ilOperatorsExpressionMapping.php";
1565 $maxStep = $this->lookupMaxStep($active_id,
$pass);
1567 if( $maxStep !== null )
1569 $data = $ilDB->queryF(
1570 "SELECT value1, value2 FROM tst_solutions WHERE active_fi = %s AND pass = %s AND question_fi = %s AND step = %s ORDER BY value1 ASC ",
1571 array(
"integer",
"integer",
"integer",
"integer"),
1577 $data = $ilDB->queryF(
1578 "SELECT value1, value2 FROM tst_solutions WHERE active_fi = %s AND pass = %s AND question_fi = %s ORDER BY value1 ASC ",
1579 array(
"integer",
"integer",
"integer"),
1584 $elements =
array();
1588 $newKey = explode(
":",
$row[
"value2"]);
1595 if($answer->getSolutionIdentifier() ==
$row[
"value1"])
1597 $elements[
$row[
"value2"]] = $answer->getSolutionIdentifier() + 1;
1603 if($answer->getRandomIdentifier() == $newKey[0])
1605 $elements[
$row[
"value1"]] = $answer->getSolutionIdentifier() + 1;
1614 foreach(array_values($elements) as $element)
1616 $result->addKeyValue($element, $element);
1650 parent::afterSyncWithOriginal($origQuestionId, $dupQuestionId, $origParentObjId, $dupParentObjId);
1651 $this->
duplicateImages($dupQuestionId, $dupParentObjId, $origQuestionId, $origParentObjId);
1664 return parent::buildTestPresentationConfig()
1666 ->setIsUnchangedAnswerPossible(
true)
1667 ->setUseUnchangedAnswerLabel($this->lng->txt(
'tst_unchanged_order_is_correct'));
1684 $solutionSubmit =
array();
1686 if( isset($formSubmissionDataStructure[
'orderresult']) )
1688 $orderresult = $formSubmissionDataStructure[
'orderresult'];
1690 if( strlen($orderresult) )
1692 $orderarray = explode(
":", $orderresult);
1694 foreach( $orderarray as $index )
1697 if( preg_match(
"/id_(\\d+)/", $index, $idmatch) )
1699 $randomid = $idmatch[1];
1702 if( $answer->getRandomIdentifier() == $randomid )
1704 $solutionSubmit[$answeridx] = $ordervalue;
1715 foreach( $formSubmissionDataStructure[
'content'] as $randomId => $content )
1717 $indentation = $formSubmissionDataStructure[
'indentation'];
1720 $value2 = implode(
':',
array($randomId, $indentation));
1722 $solutionSubmit[$value1] = $value2;
1727 foreach( $formSubmissionDataStructure as $key => $value )
1730 if( preg_match(
"/^order_(\d+)/", $key, $matches) )
1732 if( !( preg_match(
"/initial_value_\d+/", $value) ) )
1734 if( strlen($value) )
1738 if( $answer->getRandomIdentifier() == $matches[1] )
1740 $solutionSubmit[$answeridx] = $value;
1749 return $solutionSubmit;
1757 require_once
'Modules/TestQuestionPool/classes/forms/class.ilAssOrderingFormValuesObjectsConverter.php';
1759 $converter->setPostVar(self::ORDERING_ELEMENT_FORM_FIELD_POSTVAR);
1772 $formDataConverter->setImageRemovalCommand(self::ORDERING_ELEMENT_FORM_CMD_REMOVE_IMG);
1774 $formDataConverter->setImageFsPath($this->
getImagePath());
1780 return $formDataConverter;
1790 return $formDataConverter;
1803 $formDataConverter->setImageRemovalCommand(self::ORDERING_ELEMENT_FORM_CMD_REMOVE_IMG);
1812 return $formDataConverter;
duplicateImages($src_question_id, $src_object_id, $dest_question_id, $dest_object_id)
setElementHeight($a_height)
static makeDirParents($a_dir)
Create a new directory and all parent directories.
initOrderingElementAuthoringProperties(ilFormPropertyGUI $formField)
fetchSolutionListFromFormSubmissionData($userSolutionPost)
getId()
Gets the id of the assQuestion object.
static _getOriginalId($question_id)
Returns the original id of a question.
formatSAQuestion($a_q)
Format self assessment question.
const PercentageResultExpression
getSolutionOrderingElementListForTestOutput(ilAssNestedOrderingElementsInputGUI $inputGUI, $lastPost, $activeId, $pass)
Class iQuestionCondition.
buildOrderingImagesFormDataConverter()
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
calculateReachedPointsForSolution(ilAssOrderingElementList $solutionOrderingElementList)
getSolutionOrderingElementList($indexedSolutionValues)
saveAdditionalQuestionDataToDb()
Saves a record to the question types additional data table.
getPoints()
Returns the maximum available points for the question.
moveAnswerDown($position)
buildOrderingImagesInputGui()
getRTETextWithMediaObjects()
Collects all text in the question which could contain media objects which were created with the Rich ...
fetchSolutionSubmit($formSubmissionDataStructure)
buildOrderingTextsFormDataConverter()
Abstract basic class which is to be extended by the concrete assessment question type classes...
isComplete()
Returns true, if a ordering question is complete for use.
getOrderingType()
Returns the ordering question type.
getSolutionListFromPostSubmit()
initOrderingElementFormFieldLabels(ilFormPropertyGUI $formField)
ensureNonNegativePoints($points)
getQuestionType()
Returns the question type of the question.
getOrderElements()
Returns the answers array.
setId($id=-1)
Sets the id of the assQuestion object.
copyObject($target_questionpool_id, $title="")
Copies an assOrderingQuestion object.
static buildInstance($questionId, $orderingElements=array())
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
afterSyncWithOriginal($origQuestionId, $dupQuestionId, $origParentObjId, $dupParentObjId)
{}
getImagePathWeb()
Returns the web image path for web accessable images of a question.
getSolutionMaxPass($active_id)
Returns the maximum pass a users question solution.
setEstimatedWorkingTime($hour=0, $min=0, $sec=0)
Sets the estimated working time of a question from given hour, minute and second. ...
savePreviewData(ilAssQuestionPreviewSession $previewSession)
Add rich text string
The name of the decorator.
getOrderingElementListForSolutionOutput($forceCorrectSolution, $activeId, $passIndex)
getAvailableAnswerOptions($index=null)
If index is null, the function returns an array with all anwser options Else it returns the specific ...
getParticipantsSolution()
getAnswer($index=0)
Returns the ordering element from the given position.
getOperators($expression)
Get all available operations for a specific question.
getUserQuestionResult($active_id, $pass)
Get the user solution for a question by active_id and the test pass.
setNrOfTries($a_nr_of_tries)
setAdditionalContentEditingMode($additinalContentEditingMode)
setter for additional content editing mode for this question
static _replaceMediaObjectImageSrc($a_text, $a_direction=0, $nic=IL_INST_ID)
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
getObjId()
Get the object id of the container object.
isImageReplaced(ilAssOrderingElement $newElement, ilAssOrderingElement $oldElement)
getSolutionValuePairBrandedOrderingElementBySolutionIdentifier($value1, $value2)
createNewOriginalFromThisDuplicate($targetParentId, $targetQuestionTitle="")
Base Exception for all Exceptions relating to Modules/Test.
$postSolutionOrderingElementList
fetchIndexedValuesFromValuePairs(array $valuePairs)
dropImageFile($imageFilename)
calculateReachedPoints($active_id, $pass=NULL, $authorizedSolution=true, $returndetails=FALSE)
Returns the points, a learner has reached answering the question.
saveWorkingData($active_id, $pass=NULL, $authorized=true)
Saves the learners input of the question to the database.
buildOrderingElementInputGui()
setExportDetailsXLS($worksheet, $startrow, $active_id, $pass)
{}
setParticipantsSolution($participantSolution)
duplicate($for_test=true, $title="", $author="", $owner="", $testObjId=null)
Duplicates an assOrderingQuestion.
validateSolutionSubmit()
Checks the data to be saved for consistency.
buildOrderingElementFormDataConverter()
setAuthor($author="")
Sets the authors name of the assQuestion object.
getAuthor()
Gets the authors name of the assQuestion object.
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
getExpressionTypes()
Get all available expression types for a specific question.
const ORDERING_ELEMENT_FORM_FIELD_POSTVAR
const OQ_PICTURES
Ordering question constants.
Class ilUserQuestionResult.
getAnswerTableName()
Returns the name of the answer table in the database.
log($active_id, $langVar)
saveCurrentSolution($active_id, $pass, $value1, $value2, $authorized=true, $tstamp=null)
const NumericResultExpression
reworkWorkingData($active_id, $pass, $obligationsAnswered, $authorized)
{}
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
deleteAnswer($randomIdentifier)
Deletes an answer with a given index.
Interface ilObjAnswerScoringAdjustable.
toJSON()
Returns a JSON representation of the question.
fetchSolutionListFromSubmittedForm(ilPropertyFormGUI $form)
saveToDb($original_id="")
Saves a assOrderingQuestion object to a database.
buildNestedOrderingFormDataConverter()
__construct( $title="", $comment="", $author="", $owner=-1, $question="", $ordering_type=OQ_TERMS)
assOrderingQuestion constructor
const ORDERING_ELEMENT_FORM_CMD_REMOVE_IMG
getQuestion()
Gets the question string of the question object.
createImageThumbnail(ilAssOrderingElement $element)
const OrderingResultExpression
storeImageFile($uploadFile, $targetFile)
Sets the image file and uploads the image to the object's image directory.
getEncryptedFilename($filename)
calculateReachedPointsFromPreviewSession(ilAssQuestionPreviewSession $previewSession)
setOrderingElementList($orderingElementList)
Create styles array
The data for the language used.
static getOperatorsByExpression($expression)
getTestOutputSolutions($activeId, $pass)
deductHintPointsFromReachedPoints(ilAssQuestionPreviewSession $previewSession, $reachedPoints)
setPoints($a_points)
Sets the maximum available points for the question.
saveQuestionDataToDb($original_id="")
getSolutionValuePairBrandedOrderingElementByRandomIdentifier($value1, $value2)
supportsJavascriptOutput()
Returns true if the question type supports JavaScript output.
setQuestion($question="")
Sets the question string of the question object.
static convertImage($a_from, $a_to, $a_target_format="", $a_geometry="", $a_background_color="")
convert image
Interface ilObjQuestionScoringAdjustable.
removeCurrentSolution($active_id, $pass, $authorized=true)
setOriginalId($original_id)
setThumbGeometry($a_geometry)
Class for ordering questions.
buildOrderingTextsInputGui()
updateLeveledOrdering($a_index, $a_answer_text, $a_depth)
getElementByPosition($position)
getShuffledOrderingElementList()
getSolutionValues($active_id, $pass=NULL, $authorized=true)
Loads solutions of a given user from the database an returns it.
getTitle()
Gets the title string of the assQuestion object.
buildTestPresentationConfig()
Get the test question configuration.
handleThumbnailCreation(ilAssOrderingElementList $elementList)
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
hasOrderingTypeUploadSupport()
getMaximumPoints()
Returns the maximum points, a learner can reach answering the question.
copyImages($question_id, $source_questionpool)
isImageFileStored($imageFilename)
duplicateOrderlingElementList()
setTitle($title="")
Sets the title string of the assQuestion object.
setObjId($obj_id=0)
Set the object id of the container object.
buildNestedOrderingElementInputGui()
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
lookupSolutionOrderByRandomid($a_random_id)
setComment($comment="")
Sets the comment string of the assQuestion object.
loadFromDb($question_id)
Loads a assOrderingQuestion object from a database.
generateThumbForFile($path, $file)
setOrderingType($ordering_type=OQ_TERMS)
Sets the ordering question type.
saveAnswerSpecificDataToDb()
Saves the answer specific records into a question types answer table.
getAdditionalTableName()
Returns the name of the additional question data table in the database.
setOwner($owner="")
Sets the creator/owner ID of the assQuestion object.
const ORDERING_ELEMENT_FORM_CMD_UPLOAD_IMG
const EmptyAnswerExpression
getAnswerCount()
Returns the number of answers.