本文整理汇总了PHP中ilXmlWriter类的典型用法代码示例。如果您正苦于以下问题:PHP ilXmlWriter类的具体用法?PHP ilXmlWriter怎么用?PHP ilXmlWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ilXmlWriter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: toXml
/**
* Write xml
* @param ilXmlWriter $writer
*/
public function toXml(ilXmlWriter $writer)
{
switch ($this->getPatternSubType()) {
case ilDidacticTemplateFilterPattern::PATTERN_SUBTYPE_REGEX:
default:
$writer->xmlElement('excludePattern', array('preg' => $this->getPattern()));
}
}
开发者ID:arlendotcn,项目名称:ilias,代码行数:12,代码来源:class.ilDidacticTemplateExcludeFilterPattern.php
示例2: _appendXMLByObjId
/**
* Get xml of object values
*
* @access public
* @static
* @param object instance of ilXmlWriter
* @param int $a_obj_id
*/
public static function _appendXMLByObjId(ilXmlWriter $xml_writer, $a_obj_id)
{
global $ilDB;
$type = ilObject::_lookupType($a_obj_id);
// Get active field_definitions
$query = "SELECT field_id FROM adv_md_record amr " . "JOIN adv_md_record_objs amro ON amr.record_id = amro.record_id " . "JOIN adv_mdf_definition amfd ON amr.record_id = amfd.record_id " . "WHERE active = 1 " . "AND obj_type = " . $ilDB->quote($type, 'text') . " ";
$xml_writer->xmlStartTag('AdvancedMetaData');
$res = $ilDB->query($query);
while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) {
include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php';
$value = ilAdvancedMDValue::_getInstance($a_obj_id, $row->field_id);
$value->appendXML($xml_writer);
}
$xml_writer->xmlEndTag('AdvancedMetaData');
}
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:23,代码来源:class.ilAdvancedMDValues.php
示例3: __construct
/**
* Constructor
*
* @access public
* @param
*
*/
public function __construct($a_record_ids)
{
global $ilSetting;
parent::ilXmlWriter();
$this->settings = $ilSetting;
$this->record_ids = $a_record_ids ? $a_record_ids : array();
}
开发者ID:arlendotcn,项目名称:ilias,代码行数:14,代码来源:class.ilAdvancedMDRecordXMLWriter.php
示例4: ilExerciseXMLWriter
/**
* constructor
* @param string xml version
* @param string output encoding
* @param string input encoding
* @access public
*/
function ilExerciseXMLWriter()
{
// @todo: needs to be revised for multiple assignments per exercise
//die ("Needs revision for ILIAS 4.1");
parent::ilXmlWriter();
$this->attachFileContents = ilExerciseXMLWriter::$CONTENT_ATTACH_NO;
}
开发者ID:arlendotcn,项目名称:ilias,代码行数:14,代码来源:class.ilExerciseXMLWriter.php
示例5: ilObjectXMLWriter
/**
* constructor
* @param string xml version
* @param string output encoding
* @param string input encoding
* @access public
*/
function ilObjectXMLWriter()
{
global $ilias, $ilUser;
parent::ilXmlWriter();
$this->ilias =& $ilias;
$this->user_id = $ilUser->getId();
}
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:14,代码来源:class.ilObjectXMLWriter.php
示例6: ilCourseXMLWriter
/**
* constructor
* @param string xml version
* @param string output encoding
* @param string input encoding
* @access public
*/
function ilCourseXMLWriter(&$course_obj)
{
global $ilias;
parent::ilXmlWriter();
$this->EXPORT_VERSION = "2";
$this->ilias =& $ilias;
$this->course_obj =& $course_obj;
}
开发者ID:bheyser,项目名称:qplskl,代码行数:15,代码来源:class.ilCourseXMLWriter.php
示例7: ilGroupXMLWriter
/**
* constructor
* @param string xml version
* @param string output encoding
* @param string input encoding
* @access public
*/
function ilGroupXMLWriter($group_obj)
{
global $ilias;
parent::ilXmlWriter();
$this->EXPORT_VERSION = "3";
$this->ilias =& $ilias;
$this->group_obj =& $group_obj;
$this->participants = ilGroupParticipants::_getInstanceByObjId($this->group_obj->getId());
}
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:16,代码来源:class.ilGroupXMLWriter.php
示例8: simpleExport
public function simpleExport($orgu_ref_id)
{
$nodes = $this->getStructure($orgu_ref_id);
$writer = new ilXmlWriter();
$writer->xmlStartTag("OrgUnits");
foreach ($nodes as $orgu_ref_id) {
$orgu = new ilObjOrgUnit($orgu_ref_id);
if ($orgu->getRefId() == ilObjOrgUnit::getRootOrgRefId()) {
continue;
}
$attrs = $this->getAttrForOrgu($orgu);
$writer->xmlStartTag("OrgUnit", $attrs);
$writer->xmlElement("reference_id", null, $orgu->getRefId());
$writer->xmlElement("external_id", null, $orgu->getImportId());
$writer->xmlElement("title", null, $orgu->getTitle());
$writer->xmlElement("description", null, $orgu->getDescription());
$writer->xmlEndTag("OrgUnit");
}
$writer->xmlEndTag("OrgUnits");
return $writer;
}
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:21,代码来源:class.ilOrgUnitExporter.php
示例9: ilUserXMLWriter
/**
* constructor
* @param string xml version
* @param string output encoding
* @param string input encoding
* @access public
*/
function ilUserXMLWriter()
{
global $ilias, $ilUser;
parent::ilXmlWriter();
$this->ilias =& $ilias;
$this->user_id = $ilUser->getId();
$this->attachRoles = false;
/* $this->exportablePrefs = array(
"priv_feed_pass", "language", "style", "skin", 'ilPageEditor_HTMLMode',
'ilPageEditor_JavaScript', 'ilPageEditor_MediaMode', 'tst_javascript',
'tst_lastquestiontype', 'tst_multiline_answers', 'tst_use_previous_answers',
'graphicalAnswerSetting', "weekstart"
);*/
}
开发者ID:arlendotcn,项目名称:ilias,代码行数:21,代码来源:class.ilUserXMLWriter.php
示例10: ilnetucateXMLAPI
/**
* Constructor
* @access public
*/
function ilnetucateXMLAPI()
{
global $ilias;
define('ILINC_MEMBER_NOTSET', 'ilinc_notset');
define('ILINC_MEMBER_DOCENT', 'ilinc_docent');
define('ILINC_MEMBER_STUDENT', 'ilinc_student');
parent::ilXmlWriter();
$this->ilias =& $ilias;
$this->reg_login = $this->ilias->getSetting("ilinc_registrar_login");
$this->reg_passwd = $this->ilias->getSetting("ilinc_registrar_passwd");
$this->customer_id = $this->ilias->getSetting("ilinc_customer_id");
$this->server_scheme = $this->ilias->getSetting("ilinc_protocol");
$this->server_addr = $this->ilias->getSetting("ilinc_server");
$this->server_path = $this->ilias->getSetting("ilinc_path");
$this->server_port = $this->ilias->getSetting("ilinc_port");
$this->server_timeout = $this->ilias->getSetting("ilinc_timeout");
$this->user_max_strlen = 32;
// Max string length of full username (title + firstname + lastname)
}
开发者ID:arlendotcn,项目名称:ilias,代码行数:23,代码来源:class.ilnetucateXMLAPI.php
示例11: toXML
/**
* To Xml.
* This method writes only the subset Record (including all fields)
* Use class.ilAdvancedMDRecordXMLWriter to generate a complete xml presentation.
*
* @access public
* @param object ilXmlWriter
*
*/
public function toXML(ilXmlWriter $writer)
{
$writer->xmlStartTag('Record', array('active' => $this->isActive() ? 1 : 0, 'id' => $this->generateImportId()));
$writer->xmlElement('Title', null, $this->getTitle());
$writer->xmlElement('Description', null, $this->getDescription());
foreach ($this->getAssignedObjectTypes() as $obj_type) {
$writer->xmlElement('ObjectType', null, $obj_type);
}
include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
foreach (ilAdvancedMDFieldDefinition::_getDefinitionsByRecordId($this->getRecordId()) as $definition) {
$definition->toXML($writer);
}
$writer->xmlEndTag('Record');
}
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:23,代码来源:class.ilAdvancedMDRecord.php
示例12: toXML
/**
* Returns an xml representation of the question
*
* @return string The xml representation of the question
* @access public
*/
function toXML($a_include_header = TRUE, $obligatory_state = "")
{
include_once "./Services/Xml/classes/class.ilXmlWriter.php";
$a_xml_writer = new ilXmlWriter();
$a_xml_writer->xmlHeader();
$this->insertXML($a_xml_writer, $a_include_header, $obligatory_state);
$xml = $a_xml_writer->xmlDumpMem(FALSE);
if (!$a_include_header) {
$pos = strpos($xml, "?>");
$xml = substr($xml, $pos + 2);
}
return $xml;
}
开发者ID:arlendotcn,项目名称:ilias,代码行数:19,代码来源:class.SurveyMultipleChoiceQuestion.php
示例13: ilSoapInstallationInfoXMLWriter
/**
* constructor
* @param string xml version
* @param string output encoding
* @param string input encoding
* @access public
*/
function ilSoapInstallationInfoXMLWriter()
{
parent::ilXmlWriter();
}
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:11,代码来源:class.ilSoapInstallationInfoXMLWriter.php
示例14: toXML
/**
* Returns a QTI xml representation of the question
*
* Returns a QTI xml representation of the question and sets the internal
* domxml variable with the DOM XML representation of the QTI xml representation
*
* @return string The QTI xml representation of the question
* @access public
*/
function toXML($a_include_header = true, $a_include_binary = true, $a_shuffle = false, $test_output = false, $force_image_references = false)
{
global $ilias;
include_once "./classes/class.ilXmlWriter.php";
$a_xml_writer = new ilXmlWriter();
// set xml header
$a_xml_writer->xmlHeader();
$a_xml_writer->xmlStartTag("questestinterop");
$attrs = array("ident" => "il_" . IL_INST_ID . "_qst_" . $this->object->getId(), "title" => $this->object->getTitle());
$a_xml_writer->xmlStartTag("item", $attrs);
// add question description
$a_xml_writer->xmlElement("qticomment", NULL, $this->object->getComment());
// add estimated working time
$workingtime = $this->object->getEstimatedWorkingTime();
$duration = sprintf("P0Y0M0DT%dH%dM%dS", $workingtime["h"], $workingtime["m"], $workingtime["s"]);
$a_xml_writer->xmlElement("duration", NULL, $duration);
// add ILIAS specific metadata
$a_xml_writer->xmlStartTag("itemmetadata");
$a_xml_writer->xmlStartTag("qtimetadata");
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "ILIAS_VERSION");
$a_xml_writer->xmlElement("fieldentry", NULL, $ilias->getSetting("ilias_version"));
$a_xml_writer->xmlEndTag("qtimetadatafield");
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "QUESTIONTYPE");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->object->getQuestionType());
$a_xml_writer->xmlEndTag("qtimetadatafield");
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "AUTHOR");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->object->getAuthor());
$a_xml_writer->xmlEndTag("qtimetadatafield");
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "points");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->object->getPoints());
$a_xml_writer->xmlEndTag("qtimetadatafield");
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "textrating");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->object->getTextRating());
$a_xml_writer->xmlEndTag("qtimetadatafield");
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "requestedanswers");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->object->getCorrectAnswers());
$a_xml_writer->xmlEndTag("qtimetadatafield");
$a_xml_writer->xmlEndTag("qtimetadata");
// removed additional metadata from assFormulaQuestion
$a_xml_writer->xmlEndTag("itemmetadata");
// PART I: qti presentation
$attrs = array("label" => $this->object->getTitle());
$a_xml_writer->xmlStartTag("presentation", $attrs);
// add flow to presentation
$a_xml_writer->xmlStartTag("flow");
// add material with question text to presentation
$this->object->addQTIMaterial($a_xml_writer, $this->object->getQuestion());
// add answers to presentation
$attrs = array();
$attrs = array("ident" => "SYNTAX TREE", "rcardinality" => "Multiple");
$a_xml_writer->xmlStartTag("response_lid", $attrs);
$solution = $this->object->getSuggestedSolution(0);
if (count($solution)) {
if (preg_match("/il_(\\d*?)_(\\w+)_(\\d+)/", $solution["internal_link"], $matches)) {
$a_xml_writer->xmlStartTag("material");
$intlink = "il_" . IL_INST_ID . "_" . $matches[2] . "_" . $matches[3];
if (strcmp($matches[1], "") != 0) {
$intlink = $solution["internal_link"];
}
$attrs = array("label" => "suggested_solution");
$a_xml_writer->xmlElement("mattext", $attrs, $intlink);
$a_xml_writer->xmlEndTag("material");
}
}
// shuffle output
$attrs = array();
$a_xml_writer->xmlStartTag("render_choice", $attrs);
$answers =& $this->object->getAnswers();
$akeys = array_keys($answers);
if ($this->object->getShuffle() && $a_shuffle) {
$akeys = $this->object->pcArrayShuffle($akeys);
}
// add answers
foreach ($akeys as $index) {
$answer = $answers[$index];
$attrs = array("ident" => $index);
$a_xml_writer->xmlStartTag("response_label", $attrs);
$this->object->addQTIMaterial($a_xml_writer, $answer->getAnswertext());
$a_xml_writer->xmlEndTag("response_label");
}
$a_xml_writer->xmlEndTag("render_choice");
$a_xml_writer->xmlEndTag("response_lid");
$a_xml_writer->xmlEndTag("flow");
$a_xml_writer->xmlEndTag("presentation");
// PART II: qti resprocessing
//.........这里部分代码省略.........
开发者ID:prometoys,项目名称:fourtree,代码行数:101,代码来源:class.SyntaxTreeExport.php
示例15: addPropertiesToXML
protected function addPropertiesToXML(ilXmlWriter $a_writer)
{
$a_writer->xmlElement('FieldValue', array("id" => "min"), $this->getMin());
$a_writer->xmlElement('FieldValue', array("id" => "max"), $this->getMax());
$a_writer->xmlElement('FieldValue', array("id" => "suffix"), $this->getSuffix());
}
开发者ID:arlendotcn,项目名称:ilias,代码行数:6,代码来源:class.ilAdvancedMDFieldDefinitionInteger.php
示例16: toXML
/**
* Returns a QTI xml representation of the question
*
* Returns a QTI xml representation of the question and sets the internal
* domxml variable with the DOM XML representation of the QTI xml representation
*
* @return string The QTI xml representation of the question
* @access public
*/
function toXML($a_include_header = true, $a_include_binary = true, $a_shuffle = false, $test_output = false, $force_image_references = false)
{
global $ilias;
include_once "./Services/Xml/classes/class.ilXmlWriter.php";
$a_xml_writer = new ilXmlWriter();
// set xml header
$a_xml_writer->xmlHeader();
$a_xml_writer->xmlStartTag("questestinterop");
$attrs = array("ident" => "il_" . IL_INST_ID . "_qst_" . $this->object->getId(), "title" => $this->object->getTitle(), "maxattempts" => $this->object->getNrOfTries());
$a_xml_writer->xmlStartTag("item", $attrs);
// add question description
$a_xml_writer->xmlElement("qticomment", NULL, $this->object->getComment());
// add estimated working time
$workingtime = $this->object->getEstimatedWorkingTime();
$duration = sprintf("P0Y0M0DT%dH%dM%dS", $workingtime["h"], $workingtime["m"], $workingtime["s"]);
$a_xml_writer->xmlElement("duration", NULL, $duration);
// add ILIAS specific metadata
$a_xml_writer->xmlStartTag("itemmetadata");
$a_xml_writer->xmlStartTag("qtimetadata");
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "ILIAS_VERSION");
$a_xml_writer->xmlElement("fieldentry", NULL, $ilias->getSetting("ilias_version"));
$a_xml_writer->xmlEndTag("qtimetadatafield");
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "QUESTIONTYPE");
$a_xml_writer->xmlElement("fieldentry", NULL, IMAGEMAP_QUESTION_IDENTIFIER);
$a_xml_writer->xmlEndTag("qtimetadatafield");
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "AUTHOR");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->object->getAuthor());
$a_xml_writer->xmlEndTag("qtimetadatafield");
$a_xml_writer->xmlEndTag("qtimetadata");
$a_xml_writer->xmlEndTag("itemmetadata");
// PART I: qti presentation
$attrs = array("label" => $this->object->getTitle());
$a_xml_writer->xmlStartTag("presentation", $attrs);
// add flow to presentation
$a_xml_writer->xmlStartTag("flow");
// add material with question text to presentation
$this->object->addQTIMaterial($a_xml_writer, $this->object->getQuestion());
// add answers to presentation
$attrs = array("ident" => "IM", "rcardinality" => "Single");
$a_xml_writer->xmlStartTag("response_xy", $attrs);
$solution = $this->object->getSuggestedSolution(0);
if (count($solution)) {
if (preg_match("/il_(\\d*?)_(\\w+)_(\\d+)/", $solution["internal_link"], $matches)) {
$a_xml_writer->xmlStartTag("material");
$intlink = "il_" . IL_INST_ID . "_" . $matches[2] . "_" . $matches[3];
if (strcmp($matches[1], "") != 0) {
$intlink = $solution["internal_link"];
}
$attrs = array("label" => "suggested_solution");
$a_xml_writer->xmlElement("mattext", $attrs, $intlink);
$a_xml_writer->xmlEndTag("material");
}
}
$a_xml_writer->xmlStartTag("render_hotspot");
$a_xml_writer->xmlStartTag("material");
$imagetype = "image/jpeg";
if (preg_match("/.*\\.(png|gif)\$/", $this->object->getImageFilename(), $matches)) {
$imagetype = "image/" . $matches[1];
}
$attrs = array("imagtype" => $imagetype, "label" => $this->object->getImageFilename());
if ($a_include_binary) {
if ($force_image_references) {
$attrs["uri"] = $this->object->getImagePathWeb() . $this->object->getImageFilename();
$a_xml_writer->xmlElement("matimage", $attrs);
} else {
$attrs["embedded"] = "base64";
$imagepath = $this->object->getImagePath() . $this->object->getImageFilename();
$fh = fopen($imagepath, "rb");
if ($fh == false) {
global $ilErr;
$ilErr->raiseError($this->object->lng->txt("error_open_image_file"), $ilErr->MESSAGE);
return;
}
$imagefile = fread($fh, filesize($imagepath));
fclose($fh);
$base64 = base64_encode($imagefile);
$a_xml_writer->xmlElement("matimage", $attrs, $base64, FALSE, FALSE);
}
} else {
$a_xml_writer->xmlElement("matimage", $attrs);
}
$a_xml_writer->xmlEndTag("material");
// add answers
foreach ($this->object->getAnswers() as $index => $answer) {
$rared = "";
switch ($answer->getArea()) {
case "rect":
$rarea = "Rectangle";
//.........这里部分代码省略.........
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:101,代码来源:class.assImagemapQuestionExport.php
示例17: toXML
/**
* Returns a QTI xml representation of the question
*
* Returns a QTI xml representation of the question and sets the internal
* domxml variable with the DOM XML representation of the QTI xml representation
*
* @return string The QTI xml representation of the question
* @access public
*/
function toXML($a_include_header = true, $a_include_binary = true, $a_shuffle = false, $test_output = false, $force_image_references = false)
{
global $ilias;
include_once "./Services/Xml/classes/class.ilXmlWriter.php";
$a_xml_writer = new ilXmlWriter();
// set xml header
$a_xml_writer->xmlHeader();
$a_xml_writer->xmlStartTag("questestinterop");
$attrs = array("ident" => "il_" . IL_INST_ID . "_qst_" . $this->object->getId(), "title" => $this->object->getTitle(), "maxattempts" => $this->object->getNrOfTries());
$a_xml_writer->xmlStartTag("item", $attrs);
// add question description
$a_xml_writer->xmlElement("qticomment", NULL, $this->object->getComment());
// add estimated working time
$workingtime = $this->object->getEstimatedWorkingTime();
$duration = sprintf("P0Y0M0DT%dH%dM%dS", $workingtime["h"], $workingtime["m"], $workingtime["s"]);
$a_xml_writer->xmlElement("duration", NULL, $duration);
// add ILIAS specific metadata
$a_xml_writer->xmlStartTag("itemmetadata");
$a_xml_writer->xmlStartTag("qtimetadata");
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "ILIAS_VERSION");
$a_xml_writer->xmlElement("fieldentry", NULL, $ilias->getSetting("ilias_version"));
$a_xml_writer->xmlEndTag("qtimetadatafield");
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "QUESTIONTYPE");
$a_xml_writer->xmlElement("fieldentry", NULL, JAVAAPPLET_QUESTION_IDENTIFIER);
$a_xml_writer->xmlEndTag("qtimetadatafield");
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "AUTHOR");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->object->getAuthor());
$a_xml_writer->xmlEndTag("qtimetadatafield");
$a_xml_writer->xmlEndTag("qtimetadata");
$a_xml_writer->xmlEndTag("itemmetadata");
// PART I: qti presentation
$attrs = array("label" => $this->object->getTitle());
$a_xml_writer->xmlStartTag("presentation", $attrs);
// add flow to presentation
$a_xml_writer->xmlStartTag("flow");
// add material with question text to presentation
$this->object->addQTIMaterial($a_xml_writer, $this->object->getQuestion());
$solution = $this->object->getSuggestedSolution(0);
if (count($solution)) {
if (preg_match("/il_(\\d*?)_(\\w+)_(\\d+)/", $solution["internal_link"], $matches)) {
$a_xml_writer->xmlStartTag("material");
$intlink = "il_" . IL_INST_ID . "_" . $matches[2] . "_" . $matches[3];
if (strcmp($matches[1], "") != 0) {
$intlink = $solution["internal_link"];
}
$attrs = array("label" => "suggested_solution");
$a_xml_writer->xmlElement("mattext", $attrs, $intlink);
$a_xml_writer->xmlEndTag("material");
}
}
$a_xml_writer->xmlStartTag("material");
$attrs = array("label" => "applet data", "uri" => $this->object->getJavaAppletFilename(), "height" => $this->object->getJavaHeight(), "width" => $this->object->getJavaWidth(), "embedded" => "base64");
$javapath = $this->object->getJavaPath() . $this->object->getJavaAppletFilename();
$fh = @fopen($javapath, "rb");
if ($fh == false) {
return;
}
$javafile = fread($fh, filesize($javapath));
fclose($fh);
$base64 = base64_encode($javafile);
$a_xml_writer->xmlElement("matapplet", $attrs, $base64);
if ($this->object->buildParamsOnly()) {
if ($this->object->getJavaCode()) {
$attrs = array("label" => "java_code");
$a_xml_writer->xmlElement("mattext", $attrs, $this->object->getJavaCode());
}
if ($this->object->getJavaCodebase()) {
$attrs = array("label" => "java_codebase");
$a_xml_writer->xmlElement("mattext", $attrs, $this->object->getJavaCodebase());
}
if ($this->object->getJavaArchive()) {
$attrs = array("label" => "java_archive");
$a_xml_writer->xmlElement("mattext", $attrs, $this->object->getJavaArchive());
}
for ($i = 0; $i < $this->object->getParameterCount(); $i++) {
$param = $this->object->getParameter($i);
$attrs = array("label" => $param["name"]);
$a_xml_writer->xmlElement("mattext", $attrs, $param["value"]);
}
}
$a_xml_writer->xmlEndTag("material");
$a_xml_writer->xmlStartTag("material");
$attrs = array("label" => "points");
$a_xml_writer->xmlElement("mattext", $attrs, $this->object->getPoints());
$a_xml_writer->xmlEndTag("material");
$a_xml_writer->xmlEndTag("flow");
$a_xml_writer->xmlEndTag("presentation");
// PART II: qti resprocessing
//.........这里部分代码省略.........
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:101,代码来源:class.assJavaAppletExport.php
示例18: addQtiMetaDataField
/**
* adds a qti meta data field with given name and value to the passed xml writer
* (xml writer must be in context of opened "qtimetadata" tag)
*
* @final
* @access protected
* @param ilXmlWriter $a_xml_writer
* @param string $fieldLabel
* @param string $fieldValue
*/
protected final function addQtiMetaDataField(ilXmlWriter $a_xml_writer, $fieldLabel, $fieldValue)
{
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, $fieldLabel);
$a_xml_writer->xmlElement("fieldentry", NULL, $fieldValue);
$a_xml_writer->xmlEndTag("qtimetadatafield");
}
开发者ID:arlendotcn,项目名称:ilias,代码行数:17,代码来源:class.assQuestionExport.php
示例19: exportPDF
function exportPDF($a_inst, $a_target_dir, &$expLog)
{
global $tpl, $lng, $ilCtrl;
$a_xml_writer = new ilXmlWriter();
$a_xml_writer->xmlStartTag("ContentObject", array("Type" => "SCORM2004SCO"));
$this->exportPDFPrepareXmlNFiles($a_inst, $a_target_dir, $expLog, $a_xml_writer);
$a_xml_writer->xmlEndTag("ContentObject");
include_once 'Services/Transformation/classes/class.ilXML2FO.php';
$xml2FO = new ilXML2FO();
$xml2FO->setXSLTLocation('./Modules/Scorm2004/templates/xsl/contentobject2fo.xsl');
$xml2FO->setXMLString($a_xml_writer->xmlDumpMem());
$xml2FO->setXSLTParams(array('target_dir' => $a_target_dir));
$xml2FO->transform();
$fo_string = $xml2FO->getFOString();
$fo_xml = simplexml_load_string($fo_string);
$fo_ext = $fo_xml->xpath("//fo:declarations");
$fo_ext = $fo_ext[0];
$results = array();
include_once "./Services/Utilities/classes/class.ilFileUtils.php";
ilFileUtils::recursive_dirscan($a_target_dir . "/objects", $results);
if (is_array($results["file"])) {
foreach ($results["file"] as $key => $value) {
$e = $fo_ext->addChild("fox:embedded-file", "", "http://xml.apache.org/fop/extensions");
$e->addAttribute("src", $results[path][$key] . $value);
$e->addAttribute("name", $value);
$e->addAttribute("desc", "");
}
}
$fo_string = $fo_xml->asXML();
$a_xml_writer->_XmlWriter;
return $fo_string;
}
开发者ID:bheyser,项目名称:qplskl,代码行数:32,代码来源:class.ilSCORM2004Asset.php
示例20: toXML
/**
* Returns a QTI xml representation of the question and sets the internal
* domxml variable with the DOM XML representation of the QTI xml representation
*
* @return string The QTI xml representation of the question
* @access public
*/
function toXML($a_include_header = true, $a_include_binary = true, $a_shuffle = false, $test_output = false, $force_image_references = false)
{
global $ilias;
include_once "./Services/Xml/classes/class.ilXmlWriter.php";
$a_xml_writer = new ilXmlWriter();
// set xml header
$a_xml_writer->xmlHeader();
$a_xml_writer->xmlStartTag("questestinterop");
$attrs = array("ident" => "il_" . IL_INST_ID . "_qst_" . $this->object->getId(), "title" => $this->object->getTitle(), "maxattempts" => $this->object->getNrOfTries());
$a_xml_writer->xmlStartTag("item", $attrs);
// add question description
$a_xml_writer->xmlElement("qticomment", NULL, $this->object->getComment());
// add estimated working time
$workingtime = $this->object->getEstimatedWorkingTime();
$duration = sprintf("P0Y0M0DT%dH%dM%dS", $workingtime["h"], $workingtime["m"], $workingtime["s"]);
$a_xml_writer->xmlElement("duration", NULL, $duration);
// add ILIAS specific metadata
$a_xml_writer->xmlStartTag("itemmetadata");
$a_xml_writer->xmlStartTag("qtimetadata");
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "ILIAS_VERSION");
$a_xml_writer->xmlElement("fieldentry", NULL, $ilias->getSetting("ilias_version"));
$a_xml_writer->xmlEndTag("qtimetadatafield");
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "QUESTIONTYPE");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->object->getQuestionType());
$a_xml_writer->xmlEndTag("qtimetadatafield");
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "AUTHOR");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->object->getAuthor());
$a_xml_writer->xmlEndTag("qtimetadatafield");
// additional content editing information
$this->addAdditionalContentEditingModeInformation($a_xml_writer);
$this->addGeneralMetadata($a_xml_writer);
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "points_wrong");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->object->getPointsWrong());
$a_xml_writer->xmlEndTag("qtimetadatafield");
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "errortext");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->object->getErrorText());
$a_xml_writer->xmlEndTag("qtimetadatafield");
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "textsize");
$a_xml_writer->xmlElement("fieldentry", NULL, $this->object->getTextSize());
$a_xml_writer->xmlEndTag("qtimetadatafield");
$a_xml_writer->xmlStartTag("qtimetadatafield");
$a_xml_writer->xmlElement("fieldlabel", NULL, "errordata");
$serialized = array();
foreach ($this->object->getErrorData() as $data) {
array_push($serialized, array($data->text_correct, $data->text_wrong, $data->points));
}
$a_xml_writer->xmlElement("fieldentry", NULL, serialize($serialized));
$a_xml_writer->xmlEndTag("qtimetadatafield");
$a_xml_writer->xmlEndTag("qtimetadata");
$a_xml_writer->xmlEndTag("itemmetadata");
// PART I: qti presentation
$attrs = array("label" => $this->object->getTitle());
$a_xml_writer->xmlStartTag("presentation", $attrs);
// add flow to presentation
$a_xml_writer->xmlStartTag("flow");
// add material with question text to presentation
$this->object->addQTIMaterial($a_xml_writer, $this->object->getQuestion());
// add answers to presentation
$a_xml_writer->xmlEndTag("flow");
$a_xml_writer->xmlEndTag("presentation");
$a_xml_writer->xmlEndTag("item");
$a_xml_writer->xmlEndTag("questestinterop");
$xml = $a_xml_writer->xmlDumpMem(FALSE);
if (!$a_include_header) {
$pos = strpos($xml, "?>");
$xml = substr($xml, $pos + 2);
}
return $xml;
}
开发者ID:arlendotcn,项目名称:ilias,代码行数:82,代码来源:class.assErrorTextExport.php
注:本文中的ilXmlWriter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论