// Voir les notes saisies à un devoir // //////////////////////////////////////////////////////////////////////////////////////////////////// if ($action == 'Voir_notes' && $eleve_id && $devoir_id) { // liste des items $DB_TAB_COMP = DB_STRUCTURE_ELEVE::DB_lister_items_devoir_avec_infos_pour_eleves($devoir_id); // Normalement, un devoir est toujours lié à au moins un item... sauf si l'item a été supprimé dans le référentiel ! if (empty($DB_TAB_COMP)) { exit('Ce devoir n\'est associé à aucun item !'); } $tab_liste_item = array_keys($DB_TAB_COMP); $liste_item_id = implode(',', $tab_liste_item); // Si l'élève peut formuler des demandes d'évaluations, on doit calculer le score. // Du coup, on choisit de récupérer les notes et de calculer les scores pour tout le monde. $tab_devoirs = array(); $tab_scores = array(); $DB_TAB = DB_STRUCTURE_ELEVE::DB_lister_result_eleve_items($eleve_id, $liste_item_id, $_SESSION['USER_PROFIL_TYPE']); foreach ($DB_TAB as $DB_ROW) { $tab_devoirs[$DB_ROW['item_id']][] = array('note' => $DB_ROW['note']); } // préparer les lignes $tab_affich = array(); foreach ($tab_liste_item as $item_id) { $DB_ROW = $DB_TAB_COMP[$item_id][0]; $item_ref = $DB_ROW['item_ref']; $texte_socle = $DB_ROW['entree_id'] ? '[S] ' : '[–] '; $texte_lien_avant = $DB_ROW['item_lien'] ? '<a target="_blank" href="' . html($DB_ROW['item_lien']) . '">' : ''; $texte_lien_apres = $DB_ROW['item_lien'] ? '</a>' : ''; $tab_scores[$item_id] = isset($tab_devoirs[$item_id]) ? calculer_score($tab_devoirs[$item_id], $DB_ROW['referentiel_calcul_methode'], $DB_ROW['referentiel_calcul_limite']) : FALSE; if ($_SESSION['USER_PROFIL_TYPE'] != 'eleve') { $texte_demande_eval = ''; } elseif (!$DB_ROW['matiere_nb_demandes']) {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if( ($action=='Voir_notes') && $eleve_id && $devoir_id ) { // liste des items $DB_TAB_COMP = DB_STRUCTURE_ELEVE::DB_lister_items_devoir_avec_infos_pour_eleves($devoir_id); // Normalement, un devoir est toujours lié à au moins un item... sauf si l'item a été supprimé dans le référentiel ! if(!count($DB_TAB_COMP)) { exit('Ce devoir n\'est associé à aucun item !'); } // Si l'élève peut formuler des demandes d'évaluations, on doit calculer le score (du coup, on choisit d'afficher le score pour tout le monde). $tab_liste_item = array_keys($DB_TAB_COMP); $liste_item_id = implode(',',$tab_liste_item); $tab_devoirs = array(); $DB_TAB = DB_STRUCTURE_ELEVE::DB_lister_result_eleve_items($eleve_id,$liste_item_id); foreach($DB_TAB as $DB_ROW) { $tab_devoirs[$DB_ROW['item_id']][] = array('note'=>$DB_ROW['note']); } // préparer les lignes $tab_affich = array(); foreach($tab_liste_item as $item_id) { $DB_ROW = $DB_TAB_COMP[$item_id][0]; $item_ref = $DB_ROW['item_ref']; $texte_socle = ($DB_ROW['entree_id']) ? '[S] ' : '[–] '; $texte_lien_avant = ($DB_ROW['item_lien']) ? '<a class="lien_ext" href="'.html($DB_ROW['item_lien']).'">' : ''; $texte_lien_apres = ($DB_ROW['item_lien']) ? '</a>' : ''; $score = (isset($tab_devoirs[$item_id])) ? calculer_score($tab_devoirs[$item_id],$DB_ROW['referentiel_calcul_methode'],$DB_ROW['referentiel_calcul_limite']) : false ; $texte_demande_eval = ($_SESSION['USER_PROFIL']!='eleve') ? '' : ( ($DB_ROW['item_cart']) ? '<q class="demander_add" id="demande_'.$DB_ROW['matiere_id'].'_'.$item_id.'_'.$score.'" title="Ajouter aux demandes d\'évaluations."></q>' : '<q class="demander_non" title="Demande interdite."></q>' ) ;