32 parent::__construct($a_exercise, $a_submission);
33 $this->
user = $DIC->user();
34 $this->help = $DIC[
"ilHelp"];
41 if (!$this->assignment ||
43 !$this->submission->canView()) {
47 $class =
$ilCtrl->getNextClass($this);
48 $cmd =
$ilCtrl->getCmd(
"showassignmenttext");
52 $this->{$cmd .
"Object"}();
61 $lng = $DIC->language();
66 $button->setPrimary(
true);
67 $button->setCaption(
"exc_text_assignment_edit");
68 $button->setUrl(
$ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExSubmissionTextGUI"),
"editAssignmentText"));
69 $files_str = $button->render();
72 $button->setCaption(
"exc_text_assignment_show");
73 $button->setUrl(
$ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExSubmissionTextGUI"),
"showAssignmentText"));
74 $files_str = $button->render();
90 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
92 $form->setTitle($this->lng->txt(
"exc_assignment") .
" \"" . $this->assignment->getTitle() .
"\"");
96 $text->setRequired((
bool) $this->submission->getAssignment()->getMandatory());
98 $text->setMaxNumOfChars($this->assignment->getMaxCharLimit());
99 $text->setMinNumOfChars($this->assignment->getMinCharLimit());
101 if (
$text->isCharLimited()) {
103 if ($this->assignment->getMinCharLimit()) {
104 $char_msg .=
$lng->txt(
"exc_min_char_limit") .
": " . $this->assignment->getMinCharLimit();
106 if ($this->assignment->getMaxCharLimit()) {
107 $char_msg .=
" " .
$lng->txt(
"exc_max_char_limit") .
": " . $this->assignment->getMaxCharLimit();
109 $text->setInfo($char_msg);
115 $text->setUseRte(
true);
116 $text->setRTESupport($this->submission->getUserId(),
"exca~",
"exc_ass");
137 $form->setFormAction(
$ilCtrl->getFormAction($this,
"updateAssignmentText"));
138 $form->addCommandButton(
"updateAssignmentTextAndReturn", $this->lng->txt(
"save_return"));
139 $form->addCommandButton(
"updateAssignmentText", $this->lng->txt(
"save"));
140 $form->addCommandButton(
"returnToParent", $this->lng->txt(
"cancel"));
142 $form->setFormAction(
$ilCtrl->getFormAction($this,
"returnToParent"));
155 if (!$this->submission->canSubmit()) {
157 $ilCtrl->redirect($this,
"returnToParent");
160 $deadline = max($this->assignment->getDeadline(), $this->assignment->getExtendedDeadline());
162 $deadline = $this->assignment->getPersonalDeadline(
$ilUser->getId());
169 if ($deadline <
time()) {
171 $dl =
'<br /><span class="warning">' . sprintf($this->lng->txt(
"exc_late_submission_warning"), $dl) .
'</span>';
181 $ilHelp->setScreenIdComponent(
"exc");
182 $ilHelp->setScreenId(
"text_submission");
187 $files = $this->submission->getFiles();
190 if (trim(
$files[
"atext"])) {
191 $text = $a_form->getItemByPostVar(
"atxt");
198 $this->tpl->setContent($a_form->getHTML());
210 if (!$this->submission->canSubmit()) {
212 $ilCtrl->redirect($this,
"returnToParent");
219 include_once(
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php");
220 $rte =
$form->getItemByPostVar(
"atxt");
223 if (
$form->checkInput()) {
226 $existing = $this->submission->getFiles();
228 $returned_id = $this->submission->updateTextSubmission(
239 include_once
"Services/MediaObjects/classes/class.ilObjMediaObject.php";
241 foreach (
$mobs as $mob) {
253 $ilCtrl->redirect($this,
"returnToParent");
255 $ilCtrl->redirect($this,
"editAssignmentText");
259 $form->setValuesByPost();
265 if (!$this->submission->isTutor()) {
271 $files = $this->submission->getFiles();
274 if (trim(
$files[
"atext"])) {
276 !$this->submission->hasPeerReviewAccess()) {
280 $text = $a_form->getItemByPostVar(
"atxt");
286 $this->tpl->setContent($a_form->getHTML());
static _getMediaObjects($a_text, $a_direction=0)
Returns all media objects found in the passed string.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
updateAssignmentTextAndReturnObject()
updateAssignmentTextObject($a_return=false)
Exercise submission base gui.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
static getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
initAssignmentTextForm($a_read_only=false)
static _replaceMediaObjectImageSrc($a_text, $a_direction=0, $nic=IL_INST_ID)
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
handleNewUpload($a_no_notifications=false)
if(isset($_POST['submit'])) $form
showAssignmentTextObject()
__construct(ilObjExercise $a_exercise, ilExSubmission $a_submission)
Constructor.
editAssignmentTextObject(ilPropertyFormGUI $a_form=null)
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
This class represents a non editable value in a property form.
addProperty($a_name, $a_value, $a_link="")
add a property to current section
This class represents a text area property in a property form.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
Object-based submissions (ends up as static file)