ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 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 57 of file class.ilObjSCORMValidator.php.

57  {
58  $this->dir = $directory.'/';
59  }

Member Function Documentation

◆ getSummary()

ilObjSCORMValidator::getSummary ( )

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

References $summary.

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

◆ searchDir()

ilObjSCORMValidator::searchDir (   $dir)

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

References $file, and validateXML().

Referenced by validate().

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

◆ validate()

ilObjSCORMValidator::validate ( )

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

References array, and searchDir().

62  {
63  $this->summary = array();
64  $this->searchDir($this->dir);
65  if(count($this->summary) == 0)
66  {
67  return true;
68  }
69  else
70  {
71  return false;
72  }
73  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ validateXML()

ilObjSCORMValidator::validateXML (   $file)

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

Referenced by searchDir().

18  {
19  // exec(ilUtil::getJavaPath()." -jar ".ilUtil::escapeShellArg(ILIAS_ABSOLUTE_PATH."/Modules/ScormAicc/validation/vali.jar")." ".ilUtil::escapeShellArg($file)." 2>&1", $error);
20  // if (count($error) != 0)
21  // {
22  // $this->summary[] = "";
23  // $this->summary[] = "<b>File: $file</b>";
24  // foreach($error as $line)
25  // {
26  // $this->summary[] = $line;
27  // }
28  // }
29  }
+ Here is the caller graph for this function:

Field Documentation

◆ $dir

ilObjSCORMValidator::$dir

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

◆ $flag

ilObjSCORMValidator::$flag

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

◆ $summary

ilObjSCORMValidator::$summary

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

Referenced by getSummary().


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