foreach ($inventory as $item) { if ($item->get_attribute(HOMEWORK_TYPE) == "task") { // Ignore hidden files starting with '.' if (substr($item->get_name(), 0, 1) == '.') { continue; } $attributes = array(OBJ_CREATION_TIME, DOC_LAST_MODIFIED, DOC_USER_MODIFIED, OBJ_DESC); $item_date = $item->get_attribute(HOMEWORK_ENDDATE); $content->setCurrentBlock("BLOCK_ITEM"); $size = $item instanceof steam_document ? $item->get_content_size() : 0; if (!$item instanceof steam_container && !$item instanceof steam_room) { $content->setVariable("LINK_ITEM", PATH_URL . "doc/" . $item->get_id() . "/"); } else { $content->setVariable("LINK_ITEM", $base_url . $item->get_id()); } $inven = get_subitem($inventory, $item->get_id(), $user); if (!empty($inven)) { foreach ($inven as $ivi) { $content->setCurrentBlock("SOLUTION"); $content->setVariable("LINK_SOLUTION", PATH_URL . "doc/" . $ivi->get_id() . "/"); $content->setVariable("NAME_SOLUTION", $ivi->get_name()); $content->parse("SOLUTION"); } } //Abgabe-Button setzen wenn die Abgabe noch erlaubt ist if ($homework_date > $item_date) { $content->setVariable("HOMEWORK_INFO_TEXT", gettext("Your solution") . ": "); //Enddate setzen $content->setVariable("HOMEWORK_ENDDATE", gettext("time ist over")); $content->setVariable("LABEL_USER_UPLOAD", "--------------"); } else {
//Kopfzeie setzen if ($inven->get_attribute(HOMEWORK_TYPE) == "task") { $sheet->writeString(3, $col, gettext("Task") . ": " . $col, $format_table_header); $col++; } } $col = 1; $row = 5; $max_count = 0; $punkt_sum = 0; foreach ($members as $member) { $sheet->writeString($row, 0, $member["USER_FIRSTNAME"] . " " . $member["USER_FULLNAME"], $format_names); foreach ($invent as $inven) { if ($inven->get_attribute(HOMEWORK_TYPE) == "task") { $u = steam_factory::get_user($GLOBALS["STEAM"]->get_id(), $member["OBJ_NAME"]); $solution = get_subitem($invent, $inven->get_id(), $u); $counter = 0; if (count($solution) > 0) { foreach ($solution as $solu) { $sol_point = $solu->get_attribute(HOMEWORK_POINTS); $sheet->writeString($row, $col, $sol_point, $format_cell); if (count($solution) > 1) { $row++; $counter++; } $punkt_sum += $sol_point; } if ($counter >= $max_count) { //max_count setzen f�r den Sprung zum n�chsten User mit richigem Abstand $max_count = $counter; }