$strnewteam = get_string('newteam', 'blended'); $strnameteam = get_string('nameteam', 'blended'); $strdeletemember = get_string('deletemember', 'blended'); $strnone = get_string('noselected', 'blended'); $strnosigned = get_string('nodefinedteams', 'blended'); // Print the main part of the page ----------------------------------------------- $link = "selectassignment.php?id=" . $cm->id; $PAGE->navbar->add($strsignupteampage, $link); $PAGE->navbar->add('Inscribirse'); echo $OUTPUT->header(); echo $OUTPUT->spacer(array('height' => 20)); echo $OUTPUT->heading(format_string($strsignupteampage) . ' ' . blended_get_item_name($item) . $OUTPUT->help_icon('signupteampage', 'blended')); echo $OUTPUT->spacer(array('height' => 20)); // Get all teams in the current activity--------------------------------------- $grouping = blended_get_grouping($item, $blended); $teams = blended_get_teams($item, true); $not_DNI_out = false; $not_DNI_in = false; $code = blended_gen_idvalue($USER, $blended); // Si el id es el dni y el estudiante no lo ha introducido en su perfil if ($code == -1) { $not_DNI_in = true; $not_DNI_out = true; } $url14 = "selectassignment.php?id={$cm->id}"; if ($not_DNI_in) { echo $OUTPUT->notification("Hasta que posea código de identififación no puede inscribirse en ningun equipo", $url14); } // Flags de control -------------------------------------------------------------- // Flag para imprimir el boton "Eliminar miembros" $printdeletebutton = false;
/** * * @param grade_item $items * @param boolean $showresetcolumn * @param boolean $showeditcolumn * @return \html_table table object */ function blended_generate_items_table($blended, $cm, $items, $showresetcolumn = false, $showeditcolumn = false) { // Get the strings ------------------------------------------------- global $OUTPUT; $strname = get_string("name", "blended"); $strduedate = get_string("duedate", "blended"); $strnumteams = get_string("teams", "blended"); $strgraded = get_string("graded", "blended"); $strresetteams = get_string("resetteams", "blended"); $strcreateteams2 = get_string("createteams2", "blended"); $strno = get_string("no", "blended"); $stryes = get_string("yes", "blended"); $strpartially = get_string("partially", "blended"); $strteamsmanagementpage = get_string("teamsmanagementpage", "blended"); $strteamsmanagementpagedesc = get_string("teamsmanagementpagedesc", "blended"); $table = new html_table(); foreach ($items as $r => $item) { $class = ""; if (!blended_item_is_visible($item)) { //Show dimmed if the mod is hidden $class = $instance->visible ? '' : 'class="dimmed"'; } $due_date = blended_get_item_due_date($item); //Array donde se almacenar�n los equipos con sus miembros para una tarea dada //Llamada a funci�n de blended/lib.php //$members=blended_get_teams_members (null,$item->id, null, $blended); //unused //Fecha Limite de entrega if ($due_date != 0) { $due = $due_date ? userdate($due_date, "%A %d, %B, %Y") : '-'; } else { $due = ' '; } global $DB; //Numero de equipos definidos //Si no hay equipos la tarea no se podr� calificar // if ($numteams == 0) { // $grade = null; // $graded = null; //// $grouping_name=null; // } // //Si hay equipos // else $grouping = blended_get_grouping($item, $blended); $teams = blended_get_teams($item, false); $numteams = count($teams); if ($grouping) { $grouping_name = $grouping->name; $gradeurl = new moodle_url('/mod/blended/teams/introgrades.php', array('id' => $cm->id, 'itemid' => $item->id)); //Tarea no calificada? $grades = $DB->get_records("blended_grade", array("id_item" => $item->id)); if (!$grades) { $gradestr = $strno; $graded = 0; } else { //Tarea completamente calificada $teams_graded_count = 0; $teams_graded = array_map(function ($grade) { return $grade->id_team; }, $grades); foreach ($teams as $team) { if (array_search($team->id, $teams_graded)) { $teams_graded_count++; } } if ($teams_graded_count == 0) { $gradestr = $strno; $graded = 0; } else { if ($teams_graded_count == count($teams)) { $gradestr = $stryes; } else { $gradestr = $strpartially; } } $graded = 1; } $icon = $OUTPUT->pix_url('i/settings'); $grade = "{$gradestr}<a {$class} href=\"{$gradeurl}\"><img src=\"{$icon}\"/></a>"; } else { $grouping_name = null; $graded = null; $grade = null; $numteams = null; } $assignmentlink = blended_get_item_html_title($item); if (isset($grouping_name)) { $numteams .= " <small>({$grouping_name})</small>"; } if ($showresetcolumn) { $teamurl = "introteams.php?id={$cm->id}&itemid=" . $item->id; $action_icon = $OUTPUT->action_icon($teamurl, new pix_icon('i/settings', $strresetteams)); $teamlink = "<a {$class} href=\"{$teamurl}\">" . $action_icon . "</a>"; $numteams .= $teamlink; } $row = array($assignmentlink, $due, $numteams, $grade); if ($showeditcolumn) { $row[] = $teamlink1; } $table->data[] = $row; } $table->head = array($strname, $strduedate, $strnumteams, $strgraded, "", ""); $table->align = array("left", "left", "left", "left", "left", "left"); return $table; }