43 $this->
ctrl = $DIC->ctrl();
44 $this->
lng = $DIC->language();
45 $ilCtrl = $DIC->ctrl();
46 $lng = $DIC->language();
49 $this->exc_id = $a_exc_id;
50 $this->
setId(
"excass" . $this->exc_id);
52 $request = $DIC->exercise()->internal()->gui()->request();
53 $this->random_manager = $DIC->exercise()->internal()->domain()->assignment()->randomAssignments(
54 $request->getExercise()
68 $this->
addColumn($this->
lng->txt(
"exc_assignment_type"),
"type");
69 $this->
addColumn($this->
lng->txt(
"exc_presentation_order"),
"order_val");
70 $this->
addColumn($this->
lng->txt(
"exc_start_time"),
"start_time");
71 $this->
addColumn($this->
lng->txt(
"exc_deadline"),
"deadline");
72 $this->
addColumn($this->
lng->txt(
"exc_mandatory"),
"mandatory");
73 $this->
addColumn($this->
lng->txt(
"exc_peer_review"),
"peer");
74 $this->
addColumn($this->
lng->txt(
"exc_instruction"),
"",
"30%");
85 $this->
setRowTemplate(
"tpl.exc_assignments_row.html",
"Modules/Exercise");
97 foreach ($data as $idx => $row) {
100 $data[$idx][
"peer_invalid"] =
true;
102 $peer_reviews = $peer_review->validatePeerReviewGroups();
103 if (is_array($peer_reviews)) {
104 $data[$idx][
"peer_invalid"] = $peer_reviews[
"invalid"];
106 if (is_null($peer_reviews)) {
107 $data[$idx][
"peer_invalid"] =
false;
110 $data[$idx][
"ass_type"] = $this->types->getById($row[
"type"]);
111 $data[$idx][
"type"] = $data[$idx][
"ass_type"]->getTitle();
119 if (in_array($a_field, array(
"order_val",
"deadline",
"start_time"))) {
128 protected function fillRow(array $a_set): void
133 $this->tpl->setVariable(
"ID", $a_set[
"id"]);
139 if ($a_set[
"deadline"] > 0) {
141 if ($a_set[
"deadline2"] > 0) {
147 $this->tpl->setVariable(
"TXT_DEADLINE", $dl);
149 $this->tpl->setVariable(
"TXT_DEADLINE",
"-");
152 if ($ass->getRelativeDeadline() > 0) {
153 $dl =
"" . $ass->getRelativeDeadline() .
" " . $this->
lng->txt(
"days");
155 if ($ass->getRelDeadlineLastSubmission() > 0) {
161 $this->tpl->setVariable(
"TXT_DEADLINE", $dl);
163 if ($a_set[
"start_time"] > 0) {
164 $this->tpl->setVariable(
169 $this->tpl->setVariable(
174 if (!$this->random_manager->isActivated()) {
175 if ($a_set[
"mandatory"]) {
176 $this->tpl->setVariable(
"TXT_MANDATORY",
$lng->
txt(
"yes"));
178 $this->tpl->setVariable(
"TXT_MANDATORY",
$lng->
txt(
"no"));
181 $this->tpl->setVariable(
"TXT_MANDATORY",
$lng->
txt(
"exc_random"));
184 $ilCtrl->setParameter($this->parent_obj,
"ass_id", $a_set[
"id"]);
186 if ($a_set[
"peer"]) {
187 $this->tpl->setVariable(
"TXT_PEER",
$lng->
txt(
"yes") .
" (" . $a_set[
"peer_min"] .
")");
189 if ($a_set[
"peer_invalid"]) {
190 $this->tpl->setVariable(
"TXT_PEER_INVALID",
$lng->
txt(
"exc_peer_reviews_invalid_warning"));
193 if ($ass->afterDeadlineStrict()) {
194 $this->tpl->setVariable(
"TXT_PEER_OVERVIEW",
$lng->
txt(
"exc_peer_review_overview"));
195 $this->tpl->setVariable(
197 $ilCtrl->getLinkTargetByClass(
"ilexpeerreviewgui",
"showPeerReviewOverview")
201 $this->tpl->setVariable(
"TXT_PEER",
$lng->
txt(
"no"));
204 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
205 $this->tpl->setVariable(
"TXT_TYPE", $a_set[
"type"]);
206 $this->tpl->setVariable(
"ORDER_VAL", $a_set[
"order_val"]);
208 $this->tpl->setVariable(
"TXT_EDIT",
$lng->
txt(
"edit"));
209 $this->tpl->setVariable(
211 $ilCtrl->getLinkTarget($this->parent_obj,
"editAssignment")
214 $ilCtrl->setParameter($this->parent_obj,
"ass_id", null);
setTopCommands(bool $a_val)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setFormAction(string $a_form_action, bool $a_multipart=false)
setEnableTitle(bool $a_enabletitle)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
static getAssignmentDataOfExercise(int $a_exc_id)
Manages random mandatory assignments of an exercise (business logic)
numericOrdering(string $a_field)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
__construct(Container $dic, ilPlugin $plugin)
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
setLimit(int $a_limit=0, int $a_default_limit=0)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
__construct(?object $a_parent_obj, string $a_parent_cmd="", string $a_template_context="")
Mandatory RandomAssignmentsManager $random_manager
addMultiCommand(string $a_cmd, string $a_text)
ilExAssignmentTypes $types
setEnableHeader(bool $a_enableheader)