5 include_once
"Modules/Exercise/classes/class.ilExAssignment.php";
6 include_once
"Modules/Exercise/classes/class.ilExSubmission.php";
41 $this->ctrl = $DIC->ctrl();
42 $this->
user = $DIC->user();
43 $this->lng = $DIC->language();
44 $this->node_id = $a_node_id;
45 $this->ass_id = (int)
$_GET[
"ass"];
54 $this->ctrl->returnToParent($this);
57 $next_class =
$ilCtrl->getNextClass($this);
60 switch ($next_class) {
73 $tree = $DIC->repositoryTree();
83 foreach ($exercises as $exercise) {
87 if (!$tree->isSaved($ref_id)) {
93 $part = self::getExerciseInfo($exercise[
"ass_id"]);
100 return implode(
"<br />",
$info);
109 $lng = $DIC->language();
113 $exercise_id = $ass->getExerciseId();
119 $times_up = $ass->afterDeadlineStrict();
122 include_once
"./Services/Link/classes/class.ilLink.php";
127 $lng->txt(
"blog_exercise_info"),
129 "<a href=\"" . $exc_link .
"\">" .
135 $ilCtrl->setParameterByClass(
"ilblogexercisegui",
"ass", $a_assignment_id);
136 $submit_link =
$ilCtrl->getLinkTargetByClass(
"ilblogexercisegui",
"finalize");
137 $ilCtrl->setParameterByClass(
"ilblogexercisegui",
"ass",
"");
139 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
141 $button->setCaption(
"blog_finalize_blog");
142 $button->setPrimary(
true);
143 $button->setUrl($submit_link);
144 $info .=
" " . $button->render();
148 include_once
"Modules/Exercise/classes/class.ilExSubmission.php";
150 if ($submission->hasSubmitted()) {
154 $ilCtrl->setParameterByClass(
"ilblogexercisegui",
"ass", $a_assignment_id);
155 $dl_link =
$ilCtrl->getLinkTargetByClass(
"ilblogexercisegui",
"downloadExcSubFile");
156 $ilCtrl->setParameterByClass(
"ilblogexercisegui",
"ass",
"");
161 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
163 $button->setCaption(
"download");
164 $button->setUrl($dl_link);
166 $info .=
"<br />" . sprintf(
167 $lng->txt(
"blog_exercise_submitted_info"),
180 $inst = $ass->getInstruction();
182 $tooltip .= nl2br($inst);
185 $ass_files = $ass->getFiles();
186 if (count($ass_files) > 0) {
187 $tooltip .=
"<br /><br />";
189 foreach ($ass_files as
$file) {
190 $ilCtrl->setParameterByClass(
"ilblogexercisegui",
"ass", $a_assignment_id);
191 $ilCtrl->setParameterByClass(
"ilblogexercisegui",
"file", urlencode($file[
"name"]));
192 $dl_link =
$ilCtrl->getLinkTargetByClass(
"ilblogexercisegui",
"downloadExcAssFile");
193 $ilCtrl->setParameterByClass(
"ilblogexercisegui",
"file",
"");
194 $ilCtrl->setParameterByClass(
"ilblogexercisegui",
"ass",
"");
196 $tooltip .= $file[
"name"] .
": <a href=\"" . $dl_link .
"\">" .
197 $lng->txt(
"download") .
"</a>";
202 $ol_id =
"exc_ass_" . $a_assignment_id;
204 include_once
"Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
208 $overlay->setAnchor($ol_id .
"_tr");
209 $overlay->setTrigger($ol_id .
"_tr",
"click", $ol_id .
"_tr");
212 $info .=
"<div id=\"" . $ol_id .
"_tr\"><a href=\"#\">" .
$lng->txt(
"exc_instruction") .
"</a></div>" .
213 "<div id=\"" . $ol_id .
"\" style=\"display:none; padding:10px;\" class=\"ilOverlay\">" . $tooltip .
"</div>";
216 return "<div>" .
$info .
"</div>";
222 include_once
"Modules/Exercise/classes/class.ilExAssignment.php";
224 $ass_files = $ass->getFiles();
225 if (count($ass_files) > 0) {
226 foreach ($ass_files as
$file) {
227 if ($file[
"name"] == $this->
file) {
241 $submitted = $submission->
getFiles();
242 if (count($submitted) > 0) {
243 $submitted = array_pop($submitted);
247 $ass->getTitle() .
" - " .
248 $user_data[
"firstname"] .
" " .
249 $user_data[
"lastname"] .
" (" .
250 $user_data[
"login"] .
").zip";
264 include_once
"Modules/Exercise/classes/class.ilExSubmissionBaseGUI.php";
265 include_once
"Modules/Exercise/classes/class.ilExSubmissionObjectGUI.php";
267 $exc_gui->submitBlog($this->node_id);
270 $ilCtrl->returnToParent($this);
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _lookupName($a_user_id)
lookup user name
static _getStaticLink( $a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
static setUseRelativeDates($a_status)
set use relative dates
static _lookupTitle($a_id)
lookup object title
static getExerciseInfo($a_assignment_id)
finalize()
Finalize and submit blog to exercise.
static _getAllReferences($a_id)
get all reference ids of object
static useRelativeDates()
check if relative dates are used
static initGUIForSubmit($a_ass_id, $a_user_id=null)
This is a utility class for the yui overlays.
Reload workbook from saved file
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
static findUserFiles($a_user_id, $a_filetitle)
Check if given file was assigned.
static checkExercise($a_node_id)
getFiles(array $a_file_ids=null, $a_only_valid=false, $a_min_timestamp=null)
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.