/** * get the outcome in JSON format * * @deprecated now use the new qtism lib for response evaluation * @access public * @author Joel Bout, <*****@*****.**> */ public function toJSON() { $outcomeValue = null; if ($this->defaultValue != '') { $outcomeValue = array($this->defaultValue); } else { if ($this->getAttributeValue('baseType') == 'integer' || $this->getAttributeValue('baseType') == 'float') { $outcomeValue = array(0); } else { $outcomeValue = null; } } $returnValue = taoQTI_models_classes_Matching_VariableFactory::createJSONVariableFromQTIData($this->getIdentifier(), $this->getAttributeValue('cardinality'), $this->getAttributeValue('baseType'), $outcomeValue); return $returnValue; }
/** * get the correct response in JSON format. If no correct response defined * null. * * @deprecated now use the new qtism lib for response evaluation * @access public * @author Joel Bout, <*****@*****.**> */ public function correctToJSON() { $returnValue = null; try { $correctResponses = $this->getCorrectResponses(); if (count($correctResponses)) { $returnValue = taoQTI_models_classes_Matching_VariableFactory::createJSONVariableFromQTIData($this->getIdentifier(), $this->getAttributeValue('cardinality'), $this->getAttributeValue('baseType'), $this->correctResponses); } } catch (Exception $e) { } return $returnValue; }