Ejemplo n.º 1
0
 public function get_marks($test)
 {
     $marks = array();
     foreach ($test->get_items() as $item => $value) {
         if (strlen($value['data']) != 0) {
             $xml_data = $this->dir_user . "/" . $this->user->get_id() . "/" . $value['data'];
         } else {
             $xml_data = $this->dir_item . "/" . $item . "/" . $item . ".xml";
         }
         if (file_exists($xml_data)) {
             $simple_xml_data = simplexml_load_file($xml_data);
         } else {
             return false;
         }
         $mark = new mark($simple_xml_data);
         $mark->set_timestamp($value['timestamp']);
         $mark->set_task($item);
         $marks[] = $mark;
     }
     return $marks;
 }