27    protected $cols_default = array(
"login", 
"submission", 
"idl", 
"calc_deadline");
 
   28    protected $cols_order = array(
"image", 
"name", 
"login", 
"team_members",
 
   29            "sent_time", 
"submission", 
"calc_deadline", 
"idl", 
"status", 
"mark", 
"status_time",
 
   30            "feedback_time", 
"comment", 
"notice");
 
   66        $this->ui_factory = 
$DIC->ui()->factory();
 
   67        $this->ui_renderer = 
$DIC->ui()->renderer();
 
   69        $this->ctrl = 
$DIC->ctrl();
 
   70        $this->access = 
$DIC->access();
 
   71        $this->tpl = 
$DIC[
"tpl"];
 
   72        $this->lng = 
$DIC->language();
 
   74        $ilCtrl = 
$DIC->ctrl();
 
   89        $this->
setRowTemplate(
"tpl.exc_members_row.html", 
"Modules/Exercise");
 
   92        if ($this->mode == self::MODE_BY_ASSIGNMENT) {
 
  104        foreach ($this->cols_order as $id) {
 
  105            if (in_array($id, $this->cols_mandatory) ||
 
  106                in_array($id, $selected)) {
 
  107                if (array_key_exists($id, 
$columns)) {
 
  114        $this->
addColumn($this->lng->txt(
"actions"));
 
  119        $this->
addMultiCommand(
"saveStatusSelected", $this->lng->txt(
"exc_save_selected"));
 
  123            $this->
addMultiCommand(
"compareTextAssignments", $this->lng->txt(
"exc_compare_submissions"));
 
  129        if ($this->mode == self::MODE_BY_ASSIGNMENT &&
 
  130            $this->ass->hasActiveIDl() &&
 
  131            !$this->ass->hasReadOnlyIDl()) {
 
  132            $this->
addMultiCommand(
"setIndividualDeadline", $this->lng->txt(
"exc_individual_deadline_action"));
 
  135        if ($this->exc->hasTutorFeedbackMail() &&
 
  136            $this->mode == self::MODE_BY_ASSIGNMENT) {
 
  137            $this->
addMultiCommand(
"redirectFeedbackMail", $this->lng->txt(
"exc_tbl_action_feedback_mail"));
 
  140        $this->
addMultiCommand(
"sendMembers", $this->lng->txt(
"exc_send_assignment"));
 
  142        if ($this->mode == self::MODE_BY_ASSIGNMENT &&
 
  144            $this->ass->hasTeam()) {
 
  145            $this->
addMultiCommand(
"createTeams", $this->lng->txt(
"exc_team_multi_create"));
 
  146            $this->
addMultiCommand(
"dissolveTeams", $this->lng->txt(
"exc_team_multi_dissolve"));
 
  149        if ($this->mode == self::MODE_BY_ASSIGNMENT) {
 
  150            $this->
addMultiCommand(
"confirmDeassignMembers", $this->lng->txt(
"exc_deassign_members"));
 
  162        if ($this->mode == self::MODE_BY_ASSIGNMENT) {
 
  163            $item = $this->
addFilterItemByMetaType(
"flt_name", self::FILTER_TEXT, 
false, $this->lng->txt(
"name") . 
" / " . $this->lng->txt(
"login"));
 
  164            $this->
filter[
"name"] = $item->getValue();
 
  167        $this->lng->loadLanguageModule(
"search");
 
  169            "" => $this->lng->txt(
"search_any"),
 
  170            "notgraded" => $this->lng->txt(
"exc_notgraded"),
 
  171            "passed" => $this->lng->txt(
"exc_passed"),
 
  172            "failed" => $this->lng->txt(
"exc_failed")
 
  174        $item = $this->
addFilterItemByMetaType(
"flt_status", self::FILTER_SELECT, 
false, $this->lng->txt(
"exc_tbl_status"));
 
  175        $item->setOptions($options);
 
  176        $this->
filter[
"status"] = $item->getValue();
 
  179            "" => $this->lng->txt(
"search_any"),
 
  180            "y" => $this->lng->txt(
"exc_tbl_filter_has_submission"),
 
  181            "n" => $this->lng->txt(
"exc_tbl_filter_has_no_submission")
 
  183        $item = $this->
addFilterItemByMetaType(
"flt_subm", self::FILTER_SELECT, 
false, $this->lng->txt(
"exc_tbl_filter_submission"));
 
  184        $item->setOptions($options);
 
  185        $this->
filter[
"subm"] = $item->getValue();
 
  199        foreach ($this->cols_order as $id) {
 
  200            if (in_array($id, $this->cols_mandatory)) {
 
  204            if (array_key_exists($id, 
$columns)) {
 
  209                    "default" => in_array($id, $this->cols_default)
 
  220        $cols[
"submission"] = array($this->lng->txt(
"exc_tbl_submission_date"), 
"submission");
 
  222        $cols[
"status"] = array($this->lng->txt(
"exc_tbl_status"), 
"status");
 
  223        $cols[
"mark"] = array($this->lng->txt(
"exc_tbl_mark"), 
"mark");
 
  224        $cols[
"status_time"] = array($this->lng->txt(
"exc_tbl_status_time"), 
"status_time");
 
  226        $cols[
"sent_time"] = array($this->lng->txt(
"exc_tbl_sent_time"), 
"sent_time");
 
  228        if ($this->exc->hasTutorFeedbackText() ||
 
  229            $this->exc->hasTutorFeedbackMail() ||
 
  230            $this->exc->hasTutorFeedbackFile()) {
 
  231            $cols[
"feedback_time"] = array($this->lng->txt(
"exc_tbl_feedback_time"), 
"feedback_time");
 
  234        if ($this->exc->hasTutorFeedbackText()) {
 
  235            $cols[
"comment"] = array($this->lng->txt(
"exc_tbl_comment"), 
"comment");
 
  238        $cols[
"notice"] = array($this->lng->txt(
"exc_tbl_notice"), 
"notice");
 
  248        $has_no_team_yet = ($a_ass->
hasTeam() &&
 
  254        if ($this->mode == self::MODE_BY_ASSIGNMENT) {
 
  256                $this->tpl->setVariable(
"VAL_NAME", $a_row[
"name"]);
 
  259                if (!$ilAccess->checkAccessOfUser($a_user_id, 
"read", 
"", $this->exc->getRefId()) &&
 
  260                    is_array($info = $ilAccess->getInfo())) {
 
  261                    $this->tpl->setCurrentBlock(
'access_warning');
 
  262                    $this->tpl->setVariable(
'PARENT_ACCESS', $info[0][
"text"]);
 
  263                    $this->tpl->parseCurrentBlock();
 
  266                asort($a_row[
"team"]);
 
  267                foreach ($a_row[
"team"] as $team_member_id => $team_member_name) { 
 
  268                    if (
sizeof($a_row[
"team"]) > 1) {
 
  269                        $ilCtrl->setParameterByClass(
"ilExSubmissionTeamGUI", 
"id", $team_member_id);
 
  270                        $url = $ilCtrl->getLinkTargetByClass(
"ilExSubmissionTeamGUI", 
"confirmRemoveTeamMember");
 
  271                        $ilCtrl->setParameterByClass(
"ilExSubmissionTeamGUI", 
"id", 
"");
 
  273                        $this->tpl->setCurrentBlock(
"team_member_removal_bl");
 
  274                        $this->tpl->setVariable(
"URL_TEAM_MEMBER_REMOVAL", 
$url);
 
  275                        $this->tpl->setVariable(
 
  276                            "TXT_TEAM_MEMBER_REMOVAL",
 
  279                        $this->tpl->parseCurrentBlock();
 
  283                    if (!$ilAccess->checkAccessOfUser($team_member_id, 
"read", 
"", $this->exc->getRefId()) &&
 
  284                        is_array($info = $ilAccess->getInfo())) {
 
  285                        $this->tpl->setCurrentBlock(
'team_access_warning');
 
  286                        $this->tpl->setVariable(
'TEAM_PARENT_ACCESS', $info[0][
"text"]);
 
  287                        $this->tpl->parseCurrentBlock();
 
  290                    $this->tpl->setCurrentBlock(
"team_member");
 
  291                    $this->tpl->setVariable(
"TXT_MEMBER_NAME", $team_member_name);
 
  292                    $this->tpl->parseCurrentBlock();
 
  295                if ($has_no_team_yet) {
 
  297                    $this->tpl->setCurrentBlock(
"team_info");
 
  298                    $this->tpl->setVariable(
"TXT_TEAM_INFO", $this->lng->txt(
"exc_no_team_yet"));
 
  300                    $this->tpl->setCurrentBlock(
"team_info");
 
  301                    $this->tpl->setVariable(
"TXT_TEAM_INFO", 
"(" . $a_row[
"submission_obj"]->getTeam()->
getId() . 
")");
 
  305            $this->tpl->setVariable(
"VAL_NAME", $a_row[
"name"]);
 
  309        if (!$has_no_team_yet) {
 
  311            $this->tpl->setVariable(
"SEL_" . strtoupper($a_row[
"status"]), 
' selected="selected" ');
 
  312            $this->tpl->setVariable(
"TXT_NOTGRADED", $this->lng->txt(
"exc_notgraded"));
 
  313            $this->tpl->setVariable(
"TXT_PASSED", $this->lng->txt(
"exc_passed"));
 
  314            $this->tpl->setVariable(
"TXT_FAILED", $this->lng->txt(
"exc_failed"));
 
  320            $this->tpl->setVariable(
"NO_TEAM_COLSPAN", $nt_colspan);
 
  326        if ($this->exc->hasTutorFeedbackText()) {
 
  327            $comment_id = 
"excasscomm_" . $a_ass->
getId() . 
"_" . $a_user_id;
 
  330            $modal->setId($comment_id);
 
  331            $modal->setHeading($this->lng->txt(
"exc_tbl_action_feedback_text"));
 
  334            $lcomment_form->setId($comment_id);
 
  335            $lcomment_form->setPreventDoubleSubmission(
false);
 
  337            $lcomment = 
new ilTextAreaInputGUI($this->lng->txt(
"exc_comment_for_learner"), 
"lcomment_" . $a_ass->
getId() . 
"_" . $a_user_id);
 
  338            $lcomment->setInfo($this->lng->txt(
"exc_comment_for_learner_info"));
 
  339            $lcomment->setValue($a_row[
"comment"]);
 
  340            $lcomment->setCols(45);
 
  341            $lcomment->setRows(10);
 
  342            $lcomment_form->addItem($lcomment);
 
  344            $lcomment_form->addCommandButton(
"save", $this->lng->txt(
"save"));
 
  347            $modal->setBody($lcomment_form->getHTML());
 
  349            $this->comment_modals[] = $modal->getHTML();
 
  357            $include_seconds = 
false;
 
  362                            $this->tpl->setVariable(
"VAL_IMAGE", $usr_obj->getPersonalPicturePath(
"xxsmall"));
 
  363                            $this->tpl->setVariable(
"TXT_IMAGE", $this->lng->txt(
"personal_picture"));
 
  370                        if (!
sizeof($a_row[
"team"])) {
 
  371                            $this->tpl->setVariable(
"VAL_TEAM_MEMBER", $this->lng->txt(
"exc_no_team_yet"));
 
  373                            foreach ($a_row[
"team"] as 
$name) {
 
  374                                $this->tpl->setCurrentBlock(
"team_member_bl");
 
  375                                $this->tpl->setVariable(
"VAL_TEAM_MEMBER", 
$name);
 
  376                                $this->tpl->parseCurrentBlock();
 
  380                        $this->tpl->setVariable(
"VAL_TEAM_MEMBER", 
" ");
 
  385                    $this->tpl->setVariable(
 
  386                        "VAL_" . strtoupper($col),
 
  393                case "calc_deadline":
 
  394                    $this->tpl->setVariable(
 
  395                        "VAL_" . strtoupper($col),
 
  403                    if ($has_no_team_yet) {
 
  416                    $this->tpl->setVariable(
"LCOMMENT_ID", $comment_id . 
"_snip");
 
  419                    $this->tpl->setVariable(
"VAL_" . strtoupper($col), (trim($a_row[$col]) !== 
"")
 
  420                        ? nl2br(trim($a_row[$col]))
 
  425                    $include_seconds = 
true;
 
  426                    if ($a_row[
"submission_obj"]) {
 
  427                        foreach ($a_row[
"submission_obj"]->getFiles() as $file) {
 
  429                                $this->tpl->setVariable(
"TXT_LATE", $this->lng->txt(
"exc_late_submission"));
 
  437                case "feedback_time":
 
  440                    $this->tpl->setVariable(
 
  441                        "VAL_" . strtoupper($col),
 
  461                    $this->tpl->setVariable(
"VAL_" . strtoupper($col), $a_row[$col]
 
  475        $counter = $file_info[
"files"][
"count"];
 
  477            if ($file_info[
"files"][
"download_url"]) {
 
  478                $items[] = $this->ui_factory->button()->shy(
 
  479                    $file_info[
"files"][
"download_txt"] . 
" (" . $counter . 
")",
 
  480                    $file_info[
"files"][
"download_url"]
 
  484            if ($file_info[
"files"][
"download_new_url"]) {
 
  485                $items[] = $this->ui_factory->button()->shy(
 
  486                    $file_info[
"files"][
"download_new_txt"],
 
  487                    $file_info[
"files"][
"download_new_url"]
 
  492        if ($this->ass_type != 
null && $this->ass_type->supportsWebDirAccess() && $a_row[
'submission_obj']->hasSubmitted()) {
 
  494            $items[] = $this->ui_factory->link()->standard($this->lng->txt(
"exc_tbl_action_open_submission"), 
$url)->withOpenInNewViewport(
true);
 
  496        if (!$has_no_team_yet &&
 
  499            (!is_null($a_row[
"calc_deadline"]) || $a_ass->
getDeadline())    
 
  505            $this->tpl->setVariable(
"VAL_IDL_ID", $a_ass->
getId() . 
"_" . $idl_id);
 
  507            $assignment_id = $a_ass->
getId();
 
  508            $items[] = $this->ui_factory->button()->shy($this->lng->txt(
"exc_individual_deadline_action"), 
"#")
 
  509                ->withOnLoadCode(
function ($id) use ($idl_id, $assignment_id) {
 
  510                    return "$('#$id').on('click', function() {il.ExcIDl.trigger('$idl_id', '$assignment_id'); return false;})";
 
  515        if ($this->exc->hasTutorFeedbackMail()) {
 
  516            $items[] = $this->ui_factory->button()->shy(
 
  517                $this->lng->txt(
"exc_tbl_action_feedback_mail"),
 
  518                $ilCtrl->getLinkTarget($this->parent_obj, 
"redirectFeedbackMail")
 
  524            if ($this->exc->hasTutorFeedbackFile()) {
 
  526                $counter = $storage->countFeedbackFiles($a_row[
"submission_obj"]->getFeedbackId());
 
  528                    ? 
" (" . $counter . 
")" 
  531                $items[] = $this->ui_factory->button()->shy(
 
  532                    $this->lng->txt(
"exc_tbl_action_feedback_file") . $counter,
 
  533                    $ilCtrl->getLinkTargetByClass(
"ilfilesystemgui", 
"listFiles")
 
  540            $items[] = $this->ui_factory->button()->shy($this->lng->txt(
"exc_tbl_action_feedback_text"), 
"#")
 
  541                ->withOnLoadCode(
function ($id) use ($comment_id) {
 
  542                    return "$('#$id').on('click', function() {il.ExcManagement.showComment('$comment_id'); return false;})";
 
  547        if (($peer_review = $a_row[
"submission_obj"]->getPeerReview()) && $a_ass->
afterDeadlineStrict()) {      
 
  548            $counter = $peer_review->countGivenFeedback(
true, $a_user_id);
 
  550                ? 
" (" . $counter . 
")" 
  552            $items[] = $this->ui_factory->button()->shy(
 
  553                $this->lng->txt(
"exc_tbl_action_peer_review_given") . $counter,
 
  554                $ilCtrl->getLinkTargetByClass(
"ilexpeerreviewgui", 
"showGivenPeerReview")
 
  557            $counter = 
sizeof($peer_review->getPeerReviewsByPeerId($a_user_id, 
true));
 
  559                ? 
" (" . $counter . 
")" 
  562            $items[] = $this->ui_factory->button()->shy(
 
  563                $this->lng->txt(
"exc_tbl_action_peer_review_received") . $counter,
 
  564                $ilCtrl->getLinkTargetByClass(
"ilexpeerreviewgui", 
"showReceivedPeerReview")
 
  569        if ($has_no_team_yet) {
 
  570            $items[] = $this->ui_factory->button()->shy(
 
  571                $this->lng->txt(
"exc_create_team"),
 
  572                $ilCtrl->getLinkTargetByClass(
"ilExSubmissionTeamGUI", 
"createSingleMemberTeam")
 
  575            $items[] = $this->ui_factory->button()->shy(
 
  576                $this->lng->txt(
"exc_tbl_action_team_log"),
 
  577                $ilCtrl->getLinkTargetByClass(
"ilExSubmissionTeamGUI", 
"showTeamLog")
 
  581        $actions = $this->ui_factory->dropdown()->standard($items)->withLabel($this->lng->txt(
"actions"));
 
  583        $this->tpl->setVariable(
"ACTIONS", $this->ui_renderer->render($actions));
 
  592        $url = $ilCtrl->getLinkTarget($this->
getParentObject(), 
"saveCommentForLearners", 
"", 
true, 
false);
 
  594        $tpl->addJavaScript(
"Modules/Exercise/js/ilExcManagement.js");
 
  595        $tpl->addOnLoadCode(
'il.ExcManagement.init("' . 
$url . 
'");');
 
  597        return parent::render() .
 
  598            implode(
"\n", $this->comment_modals);
 
An exception for terminatinating execution or to throw for unit testing.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
static getTeamId($a_assignment_id, $a_user_id, $a_create_on_demand=false)
Get team id for member id.
static getInstance()
Get instance.
canParticipantReceiveFeedback($part_id)
afterDeadlineStrict($a_include_personal=true)
getId()
Get assignment id.
getDeadline()
Get deadline (timestamp)
static lookupType($a_id)
Lookup type.
Exercise submission table.
parseRow($a_user_id, ilExAssignment $a_ass, array $a_row)
render()
render table @access public
__construct($a_parent_obj, $a_parent_cmd, ilObjExercise $a_exc, $a_item_id)
Constructor.
getSelectableColumns()
Get selectable columns.
static get($a_glyph, $a_text="")
Get glyph html.
static getInstance()
Get instance.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
getParentCmd()
Get parent command.
getSelectedColumns()
Get selected columns.
getParentObject()
Get parent object.
setData($a_data)
set table data @access public
setResetCommand($a_val, $a_caption=null)
Set reset filter command.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=null)
Add filter by standard type.
setFormName($a_formname="")
Set Form name.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setFilterCommand($a_val, $a_caption=null)
Set filter command.
setShowTemplates($a_value)
Toggle templates.
This class represents a text area property in a property form.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc