4require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
5require_once
'./Modules/Test/classes/inc.AssessmentConstants.php';
6require_once
'./Modules/TestQuestionPool/interfaces/interface.ilObjQuestionScoringAdjustable.php';
7require_once
'./Modules/TestQuestionPool/interfaces/interface.ilObjAnswerScoringAdjustable.php';
8require_once
'./Modules/TestQuestionPool/interfaces/interface.iQuestionCondition.php';
9require_once
'./Modules/TestQuestionPool/classes/class.ilUserQuestionResult.php';
11require_once
'Modules/TestQuestionPool/classes/questions/class.ilAssOrderingElementList.php';
155 $this->
setId($question_id);
164 include_once(
"./Services/RTE/classes/class.ilRTE.php");
166 $this->ordering_type = strlen(
$data[
"ordering_type"]) ?
$data[
"ordering_type"] :
OQ_TERMS;
167 $this->thumb_geometry =
$data[
"thumb_geometry"];
168 $this->element_height =
$data[
"element_height"];
177 $this->orderingElementList->setQuestionId($this->
getId());
178 $this->orderingElementList->loadFromDb();
180 parent::loadFromDb($question_id);
190 if ($this->
id <= 0) {
195 $this_id = $this->
getId();
199 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
203 if ((
int) $testObjId > 0) {
204 $clone->setObjId($testObjId);
222 $clone->duplicateOrderlingElementList();
225 $clone->copyPageOfQuestion($this_id);
227 $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
229 $clone->duplicateImages($this_id, $thisObjId, $clone->getId(), $testObjId);
231 $clone->onDuplicate($thisObjId, $this_id, $clone->getObjId(), $clone->getId());
250 if ($this->
id <= 0) {
256 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
259 $source_questionpool_id = $this->
getObjId();
260 $clone->setObjId($target_questionpool_id);
272 $clone->duplicateImages(
$original_id, $source_questionpool_id, $clone->getId(), $target_questionpool_id);
274 $clone->onCopy($source_questionpool_id,
$original_id, $clone->getObjId(), $clone->getId());
281 if ($this->
id <= 0) {
286 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
289 $sourceParentId = $this->
getObjId();
295 $clone->setObjId($targetParentId);
297 if ($targetQuestionTitle) {
298 $clone->setTitle($targetQuestionTitle);
303 $clone->copyPageOfQuestion($sourceQuestionId);
305 $clone->copyXHTMLMediaObjectsOfQuestion($sourceQuestionId);
307 $clone->duplicateImages($sourceQuestionId, $sourceParentId, $clone->getId(), $clone->getObjId());
309 $clone->onCopy($sourceParentId, $sourceQuestionId, $clone->getObjId(), $clone->getId());
314 public function duplicateImages($src_question_id, $src_object_id, $dest_question_id, $dest_object_id)
318 $imagepath_original = $this->
getImagePath($src_question_id, $src_object_id);
319 $imagepath = $this->
getImagePath($dest_question_id, $dest_object_id);
321 if (!file_exists($imagepath)) {
327 $ilLog->write(
"image could not be duplicated!!!!");
329 if (@file_exists($imagepath_original . $this->
getThumbPrefix() . $filename)) {
331 $ilLog->write(
"image thumbnail could not be duplicated!!!!");
343 public function copyImages($question_id, $source_questionpool)
348 $imagepath_original = str_replace(
"/$this->id/images",
"/$question_id/images", $imagepath);
349 $imagepath_original = str_replace(
"/$this->obj_id/",
"/$source_questionpool/", $imagepath_original);
350 if (!file_exists($imagepath)) {
356 $ilLog->write(
"Ordering Question image could not be copied: ${imagepath_original}${filename}");
358 if (@file_exists($imagepath_original . $this->
getThumbPrefix() . $filename)) {
360 $ilLog->write(
"Ordering Question image thumbnail could not be copied: $imagepath_original" . $this->
getThumbPrefix() . $filename);
414 if ($forceCorrectSolution || !$activeId || $passIndex ===
null) {
420 if (!count($solutionValues)) {
443 #if( $pass === null && !ilObjTest::_getUsePreviousAnswers($activeId, true) )
446 # $pass = ilObjTest::_getPass($activeId);
456 if (count($indexedSolutionValues)) {
470 $value2 = explode(
':', $value2);
472 $randomIdentifier = $value2[0];
473 $selectedPosition = $value1;
474 $selectedIndentation = $value2[1];
478 $element->setPosition($selectedPosition);
479 $element->setIndentation($selectedIndentation);
491 $solutionIdentifier = $value1;
492 $selectedPosition = ($value2 - 1);
493 $selectedIndentation = 0;
495 $element = $this->
getOrderingElementList()->getElementBySolutionIdentifier($solutionIdentifier)->getClone();
497 $element->setPosition($selectedPosition);
498 $element->setIndentation($selectedIndentation);
511 $solutionOrderingList->setQuestionId($this->
getId());
513 foreach ($indexedSolutionValues as $value1 => $value2) {
520 $solutionOrderingList->addElement($element);
527 return $solutionOrderingList;
537 $shuffledRandomIdentifierIndex = $this->
getShuffler()->shuffle(
542 $shuffledElementList->reorderByRandomIdentifiers($shuffledRandomIdentifierIndex);
543 $shuffledElementList->resetElementsIndentations();
545 return $shuffledElementList;
657 if ($returndetails) {
658 throw new ilTestException(
'return details not implemented for ' . __METHOD__);
661 if (is_null(
$pass)) {
667 if (!count($solutionValuePairs)) {
683 $solutionOrderingElementList = unserialize(
715 if (preg_match(
"/.*\\.(\\w+)$/",
$filename, $matches)) {
716 $extension = $matches[1];
718 return md5(
$filename) .
"." . $extension;
727 if (strcmp($f[
'type'],
'file') == 0) {
730 if (strcmp($f[
'entry'], $orderElement->getContent()) == 0) {
733 if (strcmp($f[
'entry'], $this->
getThumbPrefix() . $orderElement->getContent()) == 0) {
738 if (@file_exists($this->
getImagePath() . $f[
'entry'])) {
760 if (!strlen($imageFilename)) {
772 if (!strlen($imageFilename)) {
776 if (!file_exists($this->
getImagePath() . $imageFilename)) {
806 if (!strlen($uploadFile)) {
814 if (!ilUtil::moveUploadedFile($uploadFile, $targetFile, $this->
getImagePath() . $targetFile)) {
823 foreach ($elementList as $element) {
863 if (is_null(
$pass)) {
864 include_once
"./Modules/Test/classes/class.ilObjTest.php";
869 function () use (&$entered_values, $active_id,
$pass, $authorized) {
873 $value1 = $orderingElement->getStorageValue1($this->
getOrderingType());
874 $value2 = $orderingElement->getStorageValue2($this->
getOrderingType());
883 if ($entered_values) {
884 $this->
log($active_id,
'log_user_entered_values');
886 $this->
log($active_id,
'log_user_not_entered_values');
908 array( $this->
getId() )
912 "INSERT INTO " . $this->
getAdditionalTableName() .
" (question_fi, ordering_type, thumb_geometry, element_height)
913 VALUES (%s, %s, %s, %s)",
914 array(
"integer",
"text",
"integer",
"integer" ),
917 $this->ordering_type,
951 return "assOrderingQuestion";
962 return "qpl_qst_ordering";
973 return "qpl_a_ordering";
982 $text = parent::getRTETextWithMediaObjects();
985 $text .= $orderingElement->getContent();
1021 parent::setExportDetailsXLS(
$worksheet, $startrow, $active_id,
$pass);
1025 foreach ($solutions as $solution) {
1026 $sol[$solution[
"value1"]] = $solution[
"value2"];
1029 $sol = array_keys($sol);
1032 foreach ($sol as $idx) {
1033 foreach ($solutions as $solution) {
1034 if ($solution[
"value1"] == $idx) {
1035 $worksheet->setCell($startrow +
$i, 0, $solution[
"value2"]);
1039 $worksheet->setCell($startrow +
$i, 1, $element->getContent());
1043 return $startrow +
$i + 1;
1068 $this->thumb_geometry = ($a_geometry < 1) ? 100 : $a_geometry;
1088 $this->element_height = ($a_height < 20) ?
"" : $a_height;
1115 switch (strtoupper($path_info[
'extension'])) {
1135 include_once(
"./Services/RTE/classes/class.ilRTE.php");
1142 $result[
'shuffle'] = (bool)
true;
1145 'onenotcorrect' => $this->
formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(),
false)),
1146 'allcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(),
true))
1155 $answers[
$counter] = $orderingElement->getContent();
1158 $answers = $this->
getShuffler()->shuffle($answers);
1160 foreach ($answers as $order => $answer) {
1161 array_push($arr, array(
1162 "answertext" => (
string) $answer,
1163 "order" => (
int) $order
1207 $formField->setInteractionEnabled(
true);
1215 $formField->setEditElementOccuranceEnabled(
true);
1216 $formField->setEditElementOrderEnabled(
true);
1227 $formField->
setInfo($this->lng->txt(
'ordering_answer_sequence_info'));
1228 $formField->
setTitle($this->lng->txt(
'answers'));
1238 require_once
'Modules/TestQuestionPool/classes/forms/class.ilAssOrderingTextsInputGUI.php';
1242 self::ORDERING_ELEMENT_FORM_FIELD_POSTVAR
1247 return $orderingElementInput;
1257 require_once
'Modules/TestQuestionPool/classes/forms/class.ilAssOrderingImagesInputGUI.php';
1261 self::ORDERING_ELEMENT_FORM_FIELD_POSTVAR
1264 $orderingElementInput->setImageRemovalCommand(self::ORDERING_ELEMENT_FORM_CMD_REMOVE_IMG);
1265 $orderingElementInput->setImageUploadCommand(self::ORDERING_ELEMENT_FORM_CMD_UPLOAD_IMG);
1269 return $orderingElementInput;
1279 require_once
'Modules/TestQuestionPool/classes/forms/class.ilAssNestedOrderingElementsInputGUI.php';
1283 self::ORDERING_ELEMENT_FORM_FIELD_POSTVAR
1286 $orderingElementInput->setUniquePrefix($this->
getId());
1293 return $orderingElementInput;
1302 return $form->getItemByPostVar(self::ORDERING_ELEMENT_FORM_FIELD_POSTVAR)->getElementList($this->
getId());
1314 $orderingGUI->setValueByArray($userSolutionPost);
1316 if (!$orderingGUI->checkInput()) {
1317 require_once
'Modules/Test/exceptions/class.ilTestException.php';
1321 require_once
'Modules/TestQuestionPool/classes/questions/class.ilAssOrderingElementList.php';
1326 foreach ($orderingGUI->getElementList($this->getId()) as $submittedElement) {
1327 $solutionElement = $storedElementList->getElementByRandomIdentifier(
1328 $submittedElement->getRandomIdentifier()
1331 $solutionElement->setPosition($submittedElement->getPosition());
1334 $solutionElement->setIndentation($submittedElement->getIndentation());
1337 $solutionOrderingElementList->addElement($solutionElement);
1340 return $solutionOrderingElementList;
1353 if ($this->postSolutionOrderingElementList ===
null) {
1355 $this->postSolutionOrderingElementList =
$list;
1379 $userElement = $solutionOrderingElementList->
getElementByPosition($correctElement->getPosition());
1381 if (!$correctElement->isSameElement($userElement)) {
1387 return $reachedPoints;
1405 'SELECT depth FROM qpl_a_ordering WHERE question_fi = %s ORDER BY position ASC',
1407 array($this->
getId())
1409 while (
$row = $ilDB->fetchAssoc(
$res)) {
1410 $this->old_ordering_depth[] =
$row[
'depth'];
1424 'SELECT solution_key FROM qpl_a_ordering WHERE random_id = %s',
1430 return $row[
'solution_key'];
1439 array(
'solution_key'=> array(
'integer', $a_index),
1440 'depth' => array(
'integer', $a_depth)),
1441 array(
'answertext' => array(
'text', $a_answer_text))
1458 require_once
"./Modules/TestQuestionPool/classes/class.ilOperatorsExpressionMapping.php";
1490 $maxStep = $this->lookupMaxStep($active_id,
$pass);
1492 if ($maxStep !==
null) {
1494 "SELECT value1, value2 FROM tst_solutions WHERE active_fi = %s AND pass = %s AND question_fi = %s AND step = %s ORDER BY value1 ASC ",
1495 array(
"integer",
"integer",
"integer",
"integer"),
1496 array($active_id,
$pass, $this->
getId(), $maxStep)
1500 "SELECT value1, value2 FROM tst_solutions WHERE active_fi = %s AND pass = %s AND question_fi = %s ORDER BY value1 ASC ",
1501 array(
"integer",
"integer",
"integer"),
1506 $elements = array();
1508 $newKey = explode(
":",
$row[
"value2"]);
1513 if ($answer->getSolutionIdentifier() ==
$row[
"value1"]) {
1514 $elements[
$row[
"value2"]] = $answer->getSolutionIdentifier() + 1;
1518 if ($answer->getRandomIdentifier() == $newKey[0]) {
1519 $elements[
$row[
"value1"]] = $answer->getSolutionIdentifier() + 1;
1528 foreach (array_values($elements) as $element) {
1529 $result->addKeyValue($element, $element);
1562 parent::afterSyncWithOriginal($origQuestionId, $dupQuestionId, $origParentObjId, $dupParentObjId);
1563 $this->
duplicateImages($dupQuestionId, $dupParentObjId, $origQuestionId, $origParentObjId);
1576 return parent::buildTestPresentationConfig()
1578 ->setIsUnchangedAnswerPossible(
true)
1579 ->setUseUnchangedAnswerLabel($this->lng->txt(
'tst_unchanged_order_is_correct'));
1595 $solutionSubmit = array();
1597 if (isset($formSubmissionDataStructure[
'orderresult'])) {
1598 $orderresult = $formSubmissionDataStructure[
'orderresult'];
1600 if (strlen($orderresult)) {
1601 $orderarray = explode(
":", $orderresult);
1603 foreach ($orderarray as
$index) {
1605 if (preg_match(
"/id_(\\d+)/",
$index, $idmatch)) {
1606 $randomid = $idmatch[1];
1608 if ($answer->getRandomIdentifier() == $randomid) {
1609 $solutionSubmit[$answeridx] = $ordervalue;
1618 foreach ($formSubmissionDataStructure[
'content'] as $randomId => $content) {
1619 $indentation = $formSubmissionDataStructure[
'indentation'];
1622 $value2 = implode(
':', array($randomId, $indentation));
1624 $solutionSubmit[$value1] = $value2;
1627 foreach ($formSubmissionDataStructure as
$key => $value) {
1629 if (preg_match(
"/^order_(\d+)/",
$key, $matches)) {
1630 if (!(preg_match(
"/initial_value_\d+/", $value))) {
1631 if (strlen($value)) {
1633 if ($answer->getRandomIdentifier() == $matches[1]) {
1634 $solutionSubmit[$answeridx] = $value;
1643 return $solutionSubmit;
1651 require_once
'Modules/TestQuestionPool/classes/forms/class.ilAssOrderingFormValuesObjectsConverter.php';
1653 $converter->setPostVar(self::ORDERING_ELEMENT_FORM_FIELD_POSTVAR);
1666 $formDataConverter->setImageRemovalCommand(self::ORDERING_ELEMENT_FORM_CMD_REMOVE_IMG);
1668 $formDataConverter->setImageFsPath($this->
getImagePath());
1673 return $formDataConverter;
1683 return $formDataConverter;
1695 $formDataConverter->setImageRemovalCommand(self::ORDERING_ELEMENT_FORM_CMD_REMOVE_IMG);
1703 return $formDataConverter;
An exception for terminatinating execution or to throw for unit testing.
Class for ordering questions.
getOrderElements()
Returns the answers array.
const ORDERING_ELEMENT_FORM_CMD_UPLOAD_IMG
buildOrderingImagesFormDataConverter()
reworkWorkingData($active_id, $pass, $obligationsAnswered, $authorized)
{Reworks the allready saved working data if neccessary.}
const ORDERING_ELEMENT_FORM_CMD_REMOVE_IMG
setOrderingElementList($orderingElementList)
getShuffledOrderingElementList()
getOperators($expression)
Get all available operations for a specific question.
getSolutionValuePairBrandedOrderingElementBySolutionIdentifier($value1, $value2)
getAnswer($index=0)
Returns the ordering element from the given position.
getExpressionTypes()
Get all available expression types for a specific question.
getQuestionType()
Returns the question type of the question.
setThumbGeometry($a_geometry)
copyImages($question_id, $source_questionpool)
initOrderingElementAuthoringProperties(ilFormPropertyGUI $formField)
getAnswerTableName()
Returns the name of the answer table in the database.
getSolutionOrderingElementList($indexedSolutionValues)
hasOrderingTypeUploadSupport()
saveWorkingData($active_id, $pass=null, $authorized=true)
Saves the learners input of the question to the database.
buildNestedOrderingElementInputGui()
toJSON()
Returns a JSON representation of the question.
fetchSolutionListFromFormSubmissionData($userSolutionPost)
dropImageFile($imageFilename)
setOrderingType($ordering_type=OQ_TERMS)
Sets the ordering question type.
createImageThumbnail(ilAssOrderingElement $element)
calculateReachedPoints($active_id, $pass=null, $authorizedSolution=true, $returndetails=false)
Returns the points, a learner has reached answering the question.
getMaximumPoints()
Returns the maximum points, a learner can reach answering the question.
isImageReplaced(ilAssOrderingElement $newElement, ilAssOrderingElement $oldElement)
isComplete()
Returns true, if a ordering question is complete for use.
saveToDb($original_id="")
Saves a assOrderingQuestion object to a database.
buildTestPresentationConfig()
Get the test question configuration.
buildNestedOrderingFormDataConverter()
getOrderingElementListForSolutionOutput($forceCorrectSolution, $activeId, $passIndex)
duplicateOrderlingElementList()
fetchSolutionSubmit($formSubmissionDataStructure)
const ORDERING_ELEMENT_FORM_FIELD_POSTVAR
setElementHeight($a_height)
buildOrderingTextsInputGui()
setExportDetailsXLS($worksheet, $startrow, $active_id, $pass)
{Creates an Excel worksheet for the detailed cumulated results of this question.object}
savePreviewData(ilAssQuestionPreviewSession $previewSession)
__construct( $title="", $comment="", $author="", $owner=-1, $question="", $ordering_type=OQ_TERMS)
assOrderingQuestion constructor
initOrderingElementFormFieldLabels(ilFormPropertyGUI $formField)
$postSolutionOrderingElementList
handleThumbnailCreation(ilAssOrderingElementList $elementList)
duplicate($for_test=true, $title="", $author="", $owner="", $testObjId=null)
Duplicates an assOrderingQuestion.
getAvailableAnswerOptions($index=null)
If index is null, the function returns an array with all anwser options Else it returns the specific ...
getAdditionalTableName()
Returns the name of the additional question data table in the database.
getSolutionValuePairBrandedOrderingElementByRandomIdentifier($value1, $value2)
isImageFileStored($imageFilename)
getSolutionListFromPostSubmit()
buildOrderingTextsFormDataConverter()
buildOrderingElementFormDataConverter()
createNewOriginalFromThisDuplicate($targetParentId, $targetQuestionTitle="")
updateLeveledOrdering($a_index, $a_answer_text, $a_depth)
getOrderingType()
Returns the ordering question type.
loadFromDb($question_id)
Loads a assOrderingQuestion object from a database.
getEncryptedFilename($filename)
lookupSolutionOrderByRandomid($a_random_id)
duplicateImages($src_question_id, $src_object_id, $dest_question_id, $dest_object_id)
getSolutionOrderingElementListForTestOutput(ilAssNestedOrderingElementsInputGUI $inputGUI, $lastPost, $activeId, $pass)
afterSyncWithOriginal($origQuestionId, $dupQuestionId, $origParentObjId, $dupParentObjId)
{}
deleteAnswer($randomIdentifier)
Deletes an answer with a given index.
validateSolutionSubmit()
Checks the data to be saved for consistency.
calculateReachedPointsForSolution(ilAssOrderingElementList $solutionOrderingElementList)
getRTETextWithMediaObjects()
Collects all text in the question which could contain media objects which were created with the Rich ...
fetchSolutionListFromSubmittedForm(ilPropertyFormGUI $form)
buildOrderingImagesInputGui()
supportsJavascriptOutput()
Returns true if the question type supports JavaScript output.
calculateReachedPointsFromPreviewSession(ilAssQuestionPreviewSession $previewSession)
copyObject($target_questionpool_id, $title="")
Copies an assOrderingQuestion object.
buildOrderingElementInputGui()
generateThumbForFile($path, $file)
storeImageFile($uploadFile, $targetFile)
Sets the image file and uploads the image to the object's image directory.
saveAnswerSpecificDataToDb()
Saves the answer specific records into a question types answer table.
moveAnswerDown($position)
getAnswerCount()
Returns the number of answers.
Abstract basic class which is to be extended by the concrete assessment question type classes.
getSolutionValues($active_id, $pass=null, $authorized=true)
Loads solutions of a given user from the database an returns it.
static _getOriginalId($question_id)
Returns the original id of a question.
formatSAQuestion($a_q)
Format self assessment question.
setId($id=-1)
Sets the id of the assQuestion object.
setOriginalId($original_id)
setObjId($obj_id=0)
Set the object id of the container object.
getSolutionMaxPass($active_id)
Returns the maximum pass a users question solution.
saveQuestionDataToDb($original_id="")
log($active_id, $langVar)
getId()
Gets the id of the assQuestion object.
saveCurrentSolution($active_id, $pass, $value1, $value2, $authorized=true, $tstamp=null)
getObjId()
Get the object id of the container object.
setTitle($title="")
Sets the title string of the assQuestion object.
setOwner($owner="")
Sets the creator/owner ID of the assQuestion object.
setEstimatedWorkingTime($hour=0, $min=0, $sec=0)
Sets the estimated working time of a question from given hour, minute and second.
fetchIndexedValuesFromValuePairs(array $valuePairs)
deductHintPointsFromReachedPoints(ilAssQuestionPreviewSession $previewSession, $reachedPoints)
getImagePath($question_id=null, $object_id=null)
Returns the image path for web accessable images of a question.
removeCurrentSolution($active_id, $pass, $authorized=true)
setAuthor($author="")
Sets the authors name of the assQuestion object.
getPoints()
Returns the maximum available points for the question.
getTestOutputSolutions($activeId, $pass)
getTitle()
Gets the title string of the assQuestion object.
setPoints($a_points)
Sets the maximum available points for the question.
setComment($comment="")
Sets the comment string of the assQuestion object.
getAuthor()
Gets the authors name of the assQuestion object.
setNrOfTries($a_nr_of_tries)
getQuestion()
Gets the question string of the question object.
setAdditionalContentEditingMode($additinalContentEditingMode)
setter for additional content editing mode for this question
setQuestion($question="")
Sets the question string of the question object.
getImagePathWeb()
Returns the web image path for web accessable images of a question.
ensureNonNegativePoints($points)
getElementByPosition($position)
static buildInstance($questionId, $orderingElements=array())
getParticipantsSolution()
setParticipantsSolution($participantSolution)
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
static getOperatorsByExpression($expression)
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...
Base Exception for all Exceptions relating to Modules/Test.
Class ilUserQuestionResult.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static convertImage( $a_from, $a_to, $a_target_format="", $a_geometry="", $a_background_color="")
convert image
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
static makeDirParents($a_dir)
Create a new directory and all parent directories.
const OQ_PICTURES
Ordering question constants.
Class iQuestionCondition.
const PercentageResultExpression
const OrderingResultExpression
getUserQuestionResult($active_id, $pass)
Get the user solution for a question by active_id and the test pass.
const NumericResultExpression
const EmptyAnswerExpression
Interface ilObjAnswerScoringAdjustable.
Interface ilObjQuestionScoringAdjustable.
saveAdditionalQuestionDataToDb()
Saves a record to the question types additional data table.
if(isset($_POST['submit'])) $form
if(isset($_REQUEST['delete'])) $list
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file
foreach($_POST as $key=> $value) $res