234
235 $ass_type = $this->types->getById($a_type);
236 $ass_type_gui = $this->type_guis->getById($a_type);
238
241 if ($a_mode == "edit") {
242 $form->setTitle(
$lng->
txt(
"exc_edit_assignment"));
243 } else {
244 $form->setTitle(
$lng->
txt(
"exc_new_assignment"));
245 }
246 $form->setFormAction($ilCtrl->getFormAction($this));
247
248
250 $ti->setMaxLength(200);
251 $ti->setRequired(true);
252 $form->addItem($ti);
253
254
256 $ty->setValue($a_type);
257 $ty->setDisabled(true);
258 $form->addItem($ty);
259
260
261
262
263
264 $ass_type_gui->addEditFormCustomProperties($form);
265
266
267
268
269
270 if ($ass_type->usesTeams()) {
271 if ($a_mode == "edit") {
273 } else {
274 $has_teams = false;
275 }
276
277
279
281 $lng->
txt(
"exc_team_by_participants"),
283 $lng->
txt(
"exc_team_by_participants_info")
284 );
285
287 $lng->
txt(
"exc_team_by_tutors"),
289 $lng->
txt(
"exc_team_by_tutors_info")
290 );
291
292 #23679
293 if (!$has_teams) {
294
296 $rd_creation_method->setRequired(true);
297 $rd_creation_method->setValue("0");
298
299
301 $lng->
txt(
"exc_team_by_tutors_manual"),
302 "0",
303 $lng->
txt(
"exc_team_by_tutors_manual_info")
304 );
305 $rd_creation_method->addOption($rd_creation_manual);
306
307
308 $add_info = "";
310 $add_info =
" <strong>" .
$lng->
txt(
"exc_team_by_random_add_info") .
"</strong>";
311 }
313 $lng->
txt(
"exc_team_by_random"),
315 $lng->
txt(
"exc_team_by_random_info") .
"<br>" .
$lng->
txt(
"exc_total_members") .
": " . $this->getExerciseTotalMembers() . $add_info
316 );
317 $rd_creation_method->addOption($rd_creation_random);
318
320 $number_teams->setSize(3);
321 $number_teams->setMinValue(1);
323 $number_teams->setRequired(true);
324 $number_teams->setSuffix(
$lng->
txt(
"exc_team_assignment_adopt_teams"));
325 $rd_creation_random->addSubItem($number_teams);
326
327 $min_team_participants =
new ilNumberInputGUI(
$lng->
txt(
"exc_min_team_participants"),
"min_participants_team");
328 $min_team_participants->setSize(3);
329 $min_team_participants->setMinValue(1);
331 $min_team_participants->setRequired(true);
332 $min_team_participants->setSuffix(
$lng->
txt(
"exc_participants"));
333 $rd_creation_random->addSubItem($min_team_participants);
334
335 $max_team_participants =
new ilNumberInputGUI(
$lng->
txt(
"exc_max_team_participants"),
"max_participants_team");
336 $max_team_participants->setSize(3);
337 $max_team_participants->setMinValue(1);
339 $max_team_participants->setRequired(true);
340 $max_team_participants->setSuffix(
$lng->
txt(
"exc_participants"));
341 $rd_creation_random->addSubItem($max_team_participants);
342
344 if (count($options)) {
346 $lng->
txt(
"exc_team_by_assignment"),
348 $lng->
txt(
"exc_team_by_assignment_info")
349 );
350
352 $radio_assignment_adopt->setRequired(true);
353 $radio_assignment_adopt->addOption(
new ilRadioOption(
$lng->
txt(
"exc_team_assignment_adopt_none"), -1));
354
355 foreach ($options as
$id => $item) {
357 $option->setInfo(
$lng->
txt(
"exc_team_assignment_adopt_teams") .
": " . $item[
"teams"]);
358 $radio_assignment_adopt->addOption($option);
359 }
360 $radio_assignment->addSubItem($radio_assignment_adopt);
361 $rd_creation_method->addOption($radio_assignment);
362 }
363
364 $radio_tutors->addSubItem($rd_creation_method);
365 }
366 $rd_team->addOption($radio_participants);
367 $rd_team->addOption($radio_tutors);
368
369
370
371 $form->addItem($rd_team);
372
373 if ($has_teams) {
374 $rd_team->setDisabled(true);
375 }
376 }
377
378
379 if (!$this->random_manager->isActivated()) {
381 $cb->setInfo(
$lng->
txt(
"exc_mandatory_info"));
382 $cb->setChecked(true);
383 $form->addItem($cb);
384 } else {
385
387 $ne->setValue(
$lng->
txt(
"exc_mandatory_rand_determined"));
388 $form->addItem($ne);
389 }
390
391
393 $sub_header->setTitle(
$lng->
txt(
"exc_work_instructions"));
394 $form->addItem($sub_header);
395
397 $desc_input->setRows(20);
399 $desc_input->setUseRte(true);
400 $desc_input->setRteTagSet("mini");
401 }
402 $form->addItem($desc_input);
403
404
405 if ($a_mode == "create") {
407 $files->setFilenames(array(0 => ''));
408 $form->addItem($files);
409 }
410
411
413 $sub_header->setTitle(
$lng->
txt(
"exc_schedule"));
414 $form->addItem($sub_header);
415
416
418 $start_date->setShowTime(true);
419 $form->addItem($start_date);
420
421
423 $radg->setValue(0);
425 $radg->addOption($op0);
427 $radg->addOption($op1);
428 if (!$ass_type->usesTeams()) {
430 $radg->addOption($op3);
431 }
433 $radg->addOption($op2);
434 $form->addItem($radg);
435
436
438 $deadline->setRequired(true);
439 $deadline->setShowTime(true);
440 $op1->addSubItem($deadline);
441
442
444 $deadline2->setInfo(
$lng->
txt(
"exc_deadline_extended_info"));
445 $deadline2->setShowTime(true);
446 $op1->addSubItem($deadline2);
447
448
449
450 $rmd_submit =
new ilCheckboxInputGUI($this->
lng->txt(
"exc_reminder_submit_setting"),
"rmd_submit_status");
451
452 $rmd_submit_start =
new ilNumberInputGUI($this->
lng->txt(
"exc_reminder_start"),
"rmd_submit_start");
453 $rmd_submit_start->setSize(3);
454 $rmd_submit_start->setMaxLength(3);
455 $rmd_submit_start->setSuffix(
$lng->
txt(
'days'));
456 $rmd_submit_start->setInfo($this->
lng->txt(
"exc_reminder_start_info"));
457 $rmd_submit_start->setRequired(true);
458 $rmd_submit_start->setMinValue(1);
459 $rmd_submit->addSubItem($rmd_submit_start);
460
461 $rmd_submit_frequency =
new ilNumberInputGUI($this->
lng->txt(
"exc_reminder_frequency"),
"rmd_submit_freq");
462 $rmd_submit_frequency->setSize(3);
463 $rmd_submit_frequency->setMaxLength(3);
464 $rmd_submit_frequency->setSuffix(
$lng->
txt(
'days'));
465 $rmd_submit_frequency->setRequired(true);
466 $rmd_submit_frequency->setMinValue(1);
467 $rmd_submit->addSubItem($rmd_submit_frequency);
468
470 $rmd_submit_end->setRequired(true);
471 $rmd_submit->addSubItem($rmd_submit_end);
472
474
475
476 $rmd_grade =
new ilCheckboxInputGUI($this->
lng->txt(
"exc_reminder_grade_setting"),
"rmd_grade_status");
477
478 $rmd_grade_frequency =
new ilNumberInputGUI($this->
lng->txt(
"exc_reminder_frequency"),
"rmd_grade_freq");
479 $rmd_grade_frequency->setSize(3);
480 $rmd_grade_frequency->setMaxLength(3);
481 $rmd_grade_frequency->setSuffix(
$lng->
txt(
'days'));
482 $rmd_grade_frequency->setRequired(true);
483 $rmd_grade_frequency->setMinValue(1);
484 $rmd_grade->addSubItem($rmd_grade_frequency);
485
487 $rmd_grade_end->setRequired(true);
488 $rmd_grade->addSubItem($rmd_grade_end);
489
491
492 $form->addItem($rmd_submit);
493 $form->addItem($rmd_grade);
494
495
497 $ti->setSuffix(
$lng->
txt(
"days"));
498 $ti->setMaxLength(3);
499 $ti->setSize(3);
500 $ti->setMinValue(1);
501 $ti->setRequired(true);
502 $op2->addSubItem($ti);
503
504
506 $last_submission->setInfo(
$lng->
txt(
"exc_rel_last_submission_info"));
507 $last_submission->setShowTime(true);
508 $op2->addSubItem($last_submission);
509
510
511
512
513 if ($ass_type->usesFileUpload()) {
515 $sub_header->setTitle($ass_type->getTitle());
516 $form->addItem($sub_header);
518 $form->addItem($max_file_tgl);
519
521 $max_file->setInfo(
$lng->
txt(
"exc_max_file_info"));
522 $max_file->setRequired(true);
523 $max_file->setSize(3);
524 $max_file->setMinValue(1);
525 $max_file_tgl->addSubItem($max_file);
526 }
527
528
530 $sub_header->setTitle(
$lng->
txt(
"exc_after_submission"));
531 $form->addItem($sub_header);
532
533 if (!$ass_type->usesTeams() && !$this->random_manager->isActivated()) {
534
536 $peer->setInfo(
$lng->
txt(
"exc_peer_review_ass_setting_info"));
537 $form->addItem($peer);
538 }
539
540
541
542
544 $form->addItem($fb);
545
547 $fb_file->setRequired(true);
548
549 $fb->addSubItem($fb_file);
550
552 $fb_date->setRequired(true);
556
557
559 $fb_date_custom_date->setRequired(true);
560 $fb_date_custom_date->setShowTime(true);
562 $fb_date_custom_option->addSubItem($fb_date_custom_date);
563 $fb_date->addOption($fb_date_custom_option);
564
565
566 $fb->addSubItem($fb_date);
567
569 $fb_cron->setInfo(
$lng->
txt(
"exc_global_feedback_file_cron_info"));
570 $fb->addSubItem($fb_cron);
571
572
573 if ($a_mode == "create") {
574 $form->addCommandButton(
"saveAssignment",
$lng->
txt(
"save"));
575 } else {
576 $form->addCommandButton(
"updateAssignment",
$lng->
txt(
"save"));
577 }
578 $form->addCommandButton(
"listAssignments",
$lng->
txt(
"cancel"));
579
580 return $form;
581 }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
addMailTemplatesRadio(string $a_reminder_type)
getExerciseTotalMembers()
static getAdoptableTeamAssignments(int $a_exercise_id, ?int $a_exclude_ass_id=null, ?int $a_user_id=null)
const TEAMS_FORMED_BY_PARTICIPANTS
const FEEDBACK_DATE_CUSTOM
const FEEDBACK_DATE_DEADLINE
const FEEDBACK_DATE_SUBMISSION
loadLanguageModule(string $a_module)
Load language module.
This class represents a non editable value in a property form.
This class represents a text area property in a property form.
This class represents a text property in a property form.