Get assignment body for overview.
{
$tpl =
new ilTemplate(
"tpl.assignment_body.html",
true,
true,
"Modules/Exercise");
include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
if(IS_PAYMENT_ENABLED)
{
include_once './Services/Payment/classes/class.ilPaymentObject.php';
}
$info->setTableClass("");
$not_started_yet = false;
if ($a_data["start_time"] > 0 && time() - $a_data["start_time"] <= 0)
{
$not_started_yet = true;
}
if (!$not_started_yet)
{
$info->addSection($lng->txt("exc_instruction"));
$is_html = (strlen($a_data["instruction"]) != strlen(strip_tags($a_data["instruction"])));
if(!$is_html)
{
}
$info->addProperty("", $a_data["instruction"]);
}
$info->addSection($lng->txt("exc_schedule"));
if ($a_data["start_time"] > 0)
{
$info->addProperty($lng->txt("exc_start_time"),
}
if ($a_data["deadline"] > 0)
{
$info->addProperty($lng->txt("exc_edit_until"),
}
if (!$not_started_yet)
{
$info->addProperty($lng->txt("exc_time_to_send"),
"<b>".$time_str."</b>");
}
if ($this->exc->getShowSubmissions())
{
$ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]);
if ($a_data["deadline"] - time() <= 0)
{
$link = '<a class="submit" href="'.
$ilCtrl->getLinkTargetByClass("ilobjexercisegui", "listPublicSubmissions").'">'.
$lng->txt("exc_list_submission").'</a>';
$info->addProperty($lng->txt("exc_public_submission"), $link);
}
else
{
$info->addProperty($lng->txt("exc_public_submission"),
$lng->txt("exc_msg_public_submission"));
}
$ilCtrl->setParameterByClass(
"ilobjexercisegui",
"ass_id",
$_GET[
"ass_id"]);
}
$ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]);
if (!$not_started_yet)
{
if (count($files) > 0)
{
$info->addSection($lng->txt("exc_files"));
{
{
$info->addProperty($file["name"],
$lng->txt("buy"),
$ilCtrl->getLinkTargetByClass("ilShopPurchaseGUI", "showDetails"));
}
else
{
$ilCtrl->setParameterByClass("ilobjexercisegui", "file", urlencode($file["name"]));
$info->addProperty($file["name"],
$lng->txt("download"),
$ilCtrl->getLinkTargetByClass("ilobjexercisegui", "downloadFile"));
$ilCtrl->setParameterByClass("ilobjexercisegui", "file", "");
}
}
}
if(IS_PAYMENT_ENABLED
{
$info->addSection($lng->txt("exc_your_submission"));
$ilCtrl->clearParameters($this);
$ilCtrl->setParameter($this,
"ref_id",
$_GET[
'ref_id']);
$ilCtrl->setParameter($this,'subtype','upload');
$info->addProperty($lng->txt('exc_hand_in'),
$lng->txt("buy"),
$ilCtrl->getLinkTargetByClass("ilShopPurchaseGUI", "showDetails"));
}
else
{
$info->addSection($lng->txt("exc_your_submission"));
$times_up = false;
if(($a_data["deadline"] > 0) && $a_data["deadline"] - time() < 0)
{
$times_up = true;
}
$team_members = null;
switch($a_data["type"])
{
$no_team_yet = false;
if(sizeof($team_members))
{
$team = array();
foreach($team_members as $member_id)
{
}
$info->addProperty($lng->txt("exc_team_members"), implode(", ", $team));
}
else
{
$no_team_yet = true;
if(!sizeof($delivered_files))
{
$info->addProperty($lng->txt("exc_team_members"), $lng->txt("exc_no_team_yet"));
}
else
{
$info->addProperty($lng->txt("exc_team_members"),
'<span class="warning">'.$lng->txt("exc_no_team_yet").'</span>');
}
}
$titles = array();
foreach($delivered_files as $file)
{
$titles[] = $file["filetitle"];
}
$files_str = implode($titles, ", ");
if ($files_str == "")
{
$files_str = $lng->txt("message_no_delivered_files");
}
$ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]);
if (!$times_up)
{
if($no_team_yet && count($titles))
{
$title = $lng->txt("exc_create_team");
}
else
{
$title = (count($titles) == 0
? $lng->txt("exc_hand_in")
: $lng->txt("exc_edit_submission"));
}
$files_str.= ' <a class="submit emphsubmit" href="'.
$ilCtrl->getLinkTargetByClass("ilobjexercisegui", "submissionScreen").'">'.
$title.'</a>';
}
else
{
if($no_team_yet)
{
$files_str .= '<div class="warning">'.
$lng->txt("exc_create_team_times_up_warning").'</div>';
}
else if (count($titles) > 0)
{
$files_str.= ' <a class="submit" href="'.
$ilCtrl->getLinkTargetByClass("ilobjexercisegui", "submissionScreen").'">'.
$lng->txt("already_delivered_files").'</a>';
}
}
$info->addProperty($lng->txt("exc_files_returned"),
$files_str);
break;
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
if(!$wsp_tree->getRootId())
{
}
$files_str = "";
$valid_blog = false;
if(sizeof($delivered_files))
{
$delivered_files = array_pop($delivered_files);
$blog_id = (int)$delivered_files["filetitle"];
$node = $wsp_tree->getNodeData($blog_id);
if($node["title"])
{
$ilCtrl->setParameterByClass("ilobjbloggui", "wsp_id", $blog_id);
$blog_link = $ilCtrl->getLinkTargetByClass(array("ilpersonaldesktopgui", "ilpersonalworkspacegui", "ilobjbloggui"), "");
$ilCtrl->setParameterByClass("ilobjbloggui", "wsp_id", "");
$files_str = '<a href="'.$blog_link.'">'.
$node["title"].'</a>';
$valid_blog = true;
}
else if(substr($delivered_files["filename"], -1) == "/")
{
$this->exc->deleteResourceObject($delivered_files["ass_id"],
$ilUser->getId(), $delivered_files["returned_id"]);
}
}
if(!$times_up)
{
if(!$valid_blog)
{
$files_str .= '<a class="submit" href="'.
$ilCtrl->getLinkTargetByClass("ilobjexercisegui", "createBlog").'">'.
$lng->txt("exc_create_blog").'</a>';
}
$blogs = sizeof($wsp_tree->getObjectsFromType("blog"));
if((!$valid_blog && $blogs)
|| ($valid_blog && $blogs > 1))
{
$files_str .=' <a class="submit" href="'.
$ilCtrl->getLinkTargetByClass("ilobjexercisegui", "selectBlog").'">'.
$lng->txt("exc_select_blog".($valid_blog ? "_change" : "")).'</a>';
}
}
if($files_str)
{
$info->addProperty($lng->txt("exc_blog_returned"), $files_str);
}
if($delivered_files && substr($delivered_files["filename"], -1) != "/")
{
$ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", $delivered_files["returned_id"]);
$dl_link = $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "download");
$ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", "");
$info->addProperty($lng->txt("exc_files_returned"),
"<a href=\"".$dl_link."\" class=\"submit\">".$lng->txt("download")."</a>");
}
break;
include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
$files_str = "";
$valid_prtf = false;
if(sizeof($delivered_files))
{
$delivered_files = array_pop($delivered_files);
$portfolio_id = (int)$delivered_files["filetitle"];
{
if($portfolio->getTitle())
{
$ilCtrl->setParameterByClass("ilobjportfoliogui", "prt_id", $portfolio_id);
$prtf_link = $ilCtrl->getLinkTargetByClass(array("ilpersonaldesktopgui", "ilportfoliorepositorygui", "ilobjportfoliogui"), "view");
$ilCtrl->setParameterByClass("ilobjportfoliogui", "prt_id", "");
$files_str = '<a href="'.$prtf_link.
'">'.$portfolio->getTitle().'</a>';
$valid_prtf = true;
}
}
else if(substr($delivered_files["filename"], -1) == "/")
{
$this->exc->deleteResourceObject($delivered_files["ass_id"],
$ilUser->getId(), $delivered_files["returned_id"]);
}
}
if(!$times_up)
{
if(!$valid_prtf)
{
include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
? "Template"
: "";
$files_str .= '<a class="submit" href="'.
$ilCtrl->getLinkTargetByClass("ilobjexercisegui", "createPortfolio".$has_prtt).'">'.
$lng->txt("exc_create_portfolio").'</a>';
}
if((!$valid_prtf && $prtfs)
|| ($valid_prtf && $prtfs > 1))
{
$files_str .= ' <a class="submit" href="'.
$ilCtrl->getLinkTargetByClass("ilobjexercisegui", "selectPortfolio").'">'.
$lng->txt("exc_select_portfolio".($valid_prtf ? "_change" : "")).'</a>';
}
}
if($files_str)
{
$info->addProperty($lng->txt("exc_portfolio_returned"), $files_str);
}
if($delivered_files && substr($delivered_files["filename"], -1) != "/")
{
$ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", $delivered_files["returned_id"]);
$dl_link = $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "download");
$ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", "");
$info->addProperty($lng->txt("exc_files_returned"),
"<a href=\"".$dl_link."\" class=\"submit\">".$lng->txt("download")."</a>");
}
break;
$ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]);
if(!$times_up)
{
$files_str = $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "editAssignmentText");
$files_str = "<a href=\"".$files_str."\" class=\"submit emphsubmit\">".
$lng->txt("exc_text_assignment_edit")."</a>";
}
else
{
$files_str = $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "showAssignmentText");
$files_str = "<a href=\"".$files_str."\" class=\"submit\">".
$lng->txt("exc_text_assignment_show")."</a>";
}
$info->addProperty($lng->txt("exc_files_returned_text"),
$files_str);
break;
}
if ($last_sub)
{
}
else
{
$last_sub = "---";
}
if ($last_sub != "---")
{
$info->addProperty($lng->txt("exc_last_submission"),
$last_sub);
}
if($times_up && $a_data["peer"])
{
if(!$a_data["peer_dl"] || $a_data["peer_dl"] > time())
{
$dl_info = "";
if($a_data["peer_dl"])
{
$dl_info = " (".sprintf($lng->txt("exc_peer_review_deadline_info_button"),
}
$emph = $nr_missing_fb ? " emphsubmit" : "";
$peer_url = $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "editPeerReview");
$edit_pc = "<a href=\"".$peer_url."\" class=\"submit".$emph."\">".
$lng->txt("exc_peer_review_give").$dl_info."</a>";
}
else if($a_data["peer_dl"])
{
$edit_pc = $lng->txt("exc_peer_review_deadline_reached");
}
if((!$a_data["peer_dl"] || $a_data["peer_dl"] < time()) &&
!$nr_missing_fb)
{
$view_url = $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "showPersonalPeerReview");
$view_pc = "<a href=\"".$view_url."\" class=\"submit\">".
$lng->txt("exc_peer_review_show")."</a>";
}
$info->addProperty($lng->txt("exc_peer_review"),
$edit_pc." ".$view_pc);
}
{
$feedback_id = "t".ilExAssignment::getTeamIdByAssignment($a_data["id"], $ilUser->getId());
}
else
{
$feedback_id = $ilUser->getId();
}
$cnt_files = $storage->countFeedbackFiles($feedback_id);
if ($lpcomment != "" || $mark != "" || $status != "notgraded" ||
$cnt_files > 0 || ($times_up && $a_data["fb_file"]))
{
$info->addSection($lng->txt("exc_feedback_from_tutor"));
if ($lpcomment != "")
{
$info->addProperty($lng->txt("exc_comment"),
$lpcomment);
}
if ($mark != "")
{
$info->addProperty($lng->txt("exc_mark"),
$mark);
}
if ($status == "")
{
}
else if ($status != "notgraded")
{
$img =
'<img src="'.ilUtil::getImagePath(
"scorm/".$status.
".png").
'" '.
' alt="'.$lng->txt("exc_".$status).'" title="'.$lng->txt("exc_".$status).
'" />';
$info->addProperty($lng->txt("status"),
$img.
" ".$lng->txt(
"exc_".$status));
}
if ($cnt_files > 0 || ($times_up && $a_data["fb_file"]))
{
$info->addSection($lng->txt("exc_fb_files").
'<a name="fb'.$a_data["id"].'"></a>');
if($cnt_files > 0)
{
$files = $storage->getFeedbackFiles($feedback_id);
foreach($files as $file)
{
$ilCtrl->setParameterByClass("ilobjexercisegui", "file", urlencode($file));
$info->addProperty($file,
$lng->txt("download"),
$ilCtrl->getLinkTargetByClass("ilobjexercisegui", "downloadFeedbackFile"));
$ilCtrl->setParameterByClass("ilobjexercisegui", "file", "");
}
}
if($times_up && $a_data["fb_file"])
{
$info->addProperty($a_data["fb_file"],
$lng->txt("download"),
$ilCtrl->getLinkTargetByClass("ilobjexercisegui", "downloadGlobalFeedbackFile"));
}
}
}
}
}
$tpl->setVariable(
"CONTENT", $info->getHTML());
}