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();
87 if (!
$tree->isSaved($ref_id)) {
93 $part = self::getExerciseInfo($exercise[
"ass_id"]);
100 return implode(
"<br />",
$info);
115 $lng = $DIC->language();
120 $exercise_id = $ass->getExerciseId();
126 $times_up = $ass->afterDeadlineStrict();
129 include_once
"./Services/Link/classes/class.ilLink.php";
134 $lng->txt(
"blog_exercise_info"),
142 $ilCtrl->setParameterByClass(
"ilblogexercisegui",
"ass", $a_assignment_id);
143 $submit_link =
$ilCtrl->getLinkTargetByClass(
"ilblogexercisegui",
"finalize");
144 $ilCtrl->setParameterByClass(
"ilblogexercisegui",
"ass",
"");
146 $buttons[] = $ui->factory()->button()->primary(
$lng->txt(
"blog_finalize_blog"), $submit_link);
150 include_once
"Modules/Exercise/classes/class.ilExSubmission.php";
152 if ($submission->hasSubmitted()) {
156 $ilCtrl->setParameterByClass(
"ilblogexercisegui",
"ass", $a_assignment_id);
157 $dl_link =
$ilCtrl->getLinkTargetByClass(
"ilblogexercisegui",
"downloadExcSubFile");
158 $ilCtrl->setParameterByClass(
"ilblogexercisegui",
"ass",
"");
163 $text .=
"<br />" . sprintf(
164 $lng->txt(
"blog_exercise_submitted_info"),
170 $buttons[] = $ui->factory()->button()->standard(
$lng->txt(
"blog_download_submission"), $dl_link);
178 $inst = $ass->getInstruction();
180 $tooltip .= nl2br($inst);
183 $ass_files = $ass->getFiles();
184 if (count($ass_files) > 0) {
185 $tooltip .=
"<br /><br />";
187 foreach ($ass_files as
$file) {
188 $ilCtrl->setParameterByClass(
"ilblogexercisegui",
"ass", $a_assignment_id);
189 $ilCtrl->setParameterByClass(
"ilblogexercisegui",
"file", urlencode($file[
"name"]));
190 $dl_link =
$ilCtrl->getLinkTargetByClass(
"ilblogexercisegui",
"downloadExcAssFile");
191 $ilCtrl->setParameterByClass(
"ilblogexercisegui",
"file",
"");
192 $ilCtrl->setParameterByClass(
"ilblogexercisegui",
"ass",
"");
194 $items[] = $ui->renderer()->render($ui->factory()->button()->shy($file[
"name"], $dl_link));
196 $list = $ui->factory()->listing()->unordered($items);
197 $tooltip .= $ui->renderer()->render(
$list);
201 $modal = $ui->factory()->modal()->roundtrip(
$lng->txt(
"exc_instruction"), $ui->factory()->legacy($tooltip))
202 ->withCancelButtonLabel(
"close");
203 $elements[] = $modal;
204 $buttons[] = $ui->factory()->button()->standard(
$lng->txt(
"exc_instruction"),
'#')
205 ->withOnClick($modal->getShowSignal());
208 $elements[] = $ui->factory()->messageBox()->info(
$text)
210 ->withButtons($buttons);
212 return $ui->renderer()->render($elements);
218 include_once
"Modules/Exercise/classes/class.ilExAssignment.php";
220 $ass_files = $ass->getFiles();
221 if (count($ass_files) > 0) {
222 foreach ($ass_files as
$file) {
223 if ($file[
"name"] == $this->file) {
237 $submitted = $submission->
getFiles();
238 if (count($submitted) > 0) {
239 $submitted = array_pop($submitted);
243 $ass->getTitle() .
" - " .
244 $user_data[
"firstname"] .
" " .
245 $user_data[
"lastname"] .
" (" .
246 $user_data[
"login"] .
").zip";
260 include_once
"Modules/Exercise/classes/class.ilExSubmissionBaseGUI.php";
261 include_once
"Modules/Exercise/classes/class.ilExSubmissionObjectGUI.php";
263 $exc_gui->submitBlog($this->node_id);
265 ilUtil::sendSuccess(
$lng->txt(
"blog_finalized"),
true);
266 $ilCtrl->returnToParent($this);
static _lookupName($a_user_id)
lookup user name
if(isset($_REQUEST['delete'])) $list
static _getStaticLink( $a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
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 formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
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)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static findUserFiles($a_user_id, $a_filetitle)
Check if given file was assigned.
Exercise submission //TODO: This class has to much static methods related to delivered "files"...
static checkExercise($a_node_id)
getFiles(array $a_file_ids=null, $a_only_valid=false, $a_min_timestamp=null)
Get submission items (not only files)
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.