ILIAS  release_7 Revision v7.30-3-g800a261c036
ilObjSCORMValidator Class Reference

Validation of SCORM-XML Files. More...

+ Collaboration diagram for ilObjSCORMValidator:

Public Member Functions

 validateXML ($file)
 
 searchDir ($dir)
 
 __construct ($directory)
 
 validate ()
 
 getSummary ()
 

Data Fields

 $dir
 
 $flag
 
 $summary
 

Detailed Description

Validation of SCORM-XML Files.

Author
Romeo Kienzler conta.nosp@m.ct@k.nosp@m.ienzl.nosp@m.er.b.nosp@m.iz @company 21 LearnLine AG info@.nosp@m.21ll.nosp@m..com

Definition at line 14 of file class.ilObjSCORMValidator.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjSCORMValidator::__construct (   $directory)

Definition at line 61 of file class.ilObjSCORMValidator.php.

62 {
63 $this->dir = $directory . '/';
64 }

Member Function Documentation

◆ getSummary()

ilObjSCORMValidator::getSummary ( )

Definition at line 77 of file class.ilObjSCORMValidator.php.

78 {
79 $summary = "";
80
81 foreach ($this->summary as $line) {
82 $summary .= $line . "<br>";
83 }
84
85 return $summary;
86 }

References $summary.

◆ searchDir()

ilObjSCORMValidator::searchDir (   $dir)

Definition at line 35 of file class.ilObjSCORMValidator.php.

36 {
37 if (is_dir($dir)) {
38 if ($dh = opendir($dir)) {
39 while (($file = readdir($dh)) !== false) {
40 if (!preg_match("~^[\.]{1,2}~i", $file)) {
41 //2DO FIXME regex machen dass nur . und .. erkannt werden und nicht .lala. oder so
42 if (is_dir($dir . $file)) {
43 // This is commented because subdirecories of my scromexamples contain xml files which aren't valid!
44 //$this->searchDir($dir.$file."/");
45 }
46 if (preg_match("~(\.xml)$~i", $file)) {
47
48 // we skip index.xml and indexMD.xml which come from the
49 // scorm editor and currently do not validate against anything
50 if ($file != "index.xml" && $file != "indexMD.xml") {
51 $this->validateXML($dir . $file);
52 }
53 }
54 }
55 }
56 }
57 closedir($dh);
58 }
59 }

References $dir, and validateXML().

Referenced by validate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validate()

ilObjSCORMValidator::validate ( )

Definition at line 66 of file class.ilObjSCORMValidator.php.

67 {
68 $this->summary = array();
69 $this->searchDir($this->dir);
70 if (count($this->summary) == 0) {
71 return true;
72 } else {
73 return false;
74 }
75 }

References searchDir().

+ Here is the call graph for this function:

◆ validateXML()

ilObjSCORMValidator::validateXML (   $file)

Definition at line 20 of file class.ilObjSCORMValidator.php.

21 {
22 // exec(ilUtil::getJavaPath()." -jar ".ilUtil::escapeShellArg(ILIAS_ABSOLUTE_PATH."/Modules/ScormAicc/validation/vali.jar")." ".ilUtil::escapeShellArg($file)." 2>&1", $error);
23 // if (count($error) != 0)
24 // {
25 // $this->summary[] = "";
26 // $this->summary[] = "<b>File: $file</b>";
27 // foreach($error as $line)
28 // {
29 // $this->summary[] = $line;
30// //echo "<br><b>".$line."</b>";
31 // }
32 // }
33 }

Referenced by searchDir().

+ Here is the caller graph for this function:

Field Documentation

◆ $dir

ilObjSCORMValidator::$dir

Definition at line 16 of file class.ilObjSCORMValidator.php.

Referenced by searchDir().

◆ $flag

ilObjSCORMValidator::$flag

Definition at line 17 of file class.ilObjSCORMValidator.php.

◆ $summary

ilObjSCORMValidator::$summary

Definition at line 18 of file class.ilObjSCORMValidator.php.

Referenced by getSummary().


The documentation for this class was generated from the following file: