}
 // Enregistrement de la demande
 $score = $score != -1 ? $score : NULL;
 $demande_id = DB_STRUCTURE_DEMANDE::DB_ajouter_demande($_SESSION['USER_ID'], $matiere_id, $item_id, $prof_id, $score, 'eleve', $message, $demande_doc);
 // Ajout aux flux RSS des profs concernés
 $titre = 'Demande ajoutée par ' . afficher_identite_initiale($_SESSION['USER_NOM'], FALSE, $_SESSION['USER_PRENOM'], TRUE);
 $texte = $_SESSION['USER_PRENOM'] . ' ' . $_SESSION['USER_NOM'] . ' ajoute la demande ' . $DB_ROW['item_ref'] . ' "' . $DB_ROW['item_nom'] . '".' . "\r\n";
 $texte .= $demande_doc ? 'Document joint : ' . $demande_doc . "\r\n" : 'Pas de document joint.' . "\r\n";
 $texte .= $message ? 'Commentaire :' . "\r\n" . $message . "\r\n" : 'Pas de commentaire saisi.' . "\r\n";
 $guid = 'demande_' . $demande_id . '_add';
 if ($prof_id) {
     RSS::modifier_fichier_prof($prof_id, $titre, $texte, $guid);
 } else {
     // On récupère les profs...
     $tab_prof_id = array();
     $DB_TAB = DB_STRUCTURE_DEMANDE::DB_recuperer_professeurs_eleve_matiere($_SESSION['USER_ID'], $_SESSION['ELEVE_CLASSE_ID'], $matiere_id);
     if (!empty($DB_TAB)) {
         foreach ($DB_TAB as $DB_ROW) {
             $tab_prof_id[] = $DB_ROW['user_id'];
             RSS::modifier_fichier_prof($DB_ROW['user_id'], $titre, $texte, $guid);
         }
     }
 }
 // Notifications (rendues visibles ultérieurement) ; on récupère des données conçues pour le flux RSS ($texte , $tab_prof_id)
 $abonnement_ref = 'demande_evaluation_eleve';
 $listing_profs = $prof_id ? $prof_id : (!empty($tab_prof_id) ? implode(',', $tab_prof_id) : NULL);
 if ($listing_profs) {
     $listing_abonnes = DB_STRUCTURE_NOTIFICATION::DB_lister_destinataires_listing_id($abonnement_ref, $listing_profs);
     if ($listing_abonnes) {
         $notification_contenu = $texte;
         $tab_abonnes = explode(',', $listing_abonnes);
Пример #2
0
    exit('La date de début est postérieure à la date de fin !');
}
$tab_precision_retroactif = array('auto' => 'notes antérieures selon référentiels', 'oui' => 'avec notes antérieures', 'non' => 'sans notes antérieures', 'annuel' => 'notes antérieures de l\'année scolaire');
$precision_socle = $only_socle ? ', restriction au socle' : '';
$precision_niveau = $only_niveau ? ', restriction au niveau de l\'élève' : '';
$texte_periode = 'Du ' . $date_debut . ' au ' . $date_fin . '.';
$texte_precision = $tab_precision_retroactif[$retroactif] . $precision_socle . $precision_niveau . '.';
// ////////////////////////////////////////////////////////////////////////////////////////////////////
// Récupération de la liste des items travaillés durant la période choisie, pour les élèves selectionnés, toutes matières confondues
// Récupération de la liste des synthèses concernées (nom de thèmes ou de domaines suivant les référentiels)
// Récupération de la liste des matières concernées
// ////////////////////////////////////////////////////////////////////////////////////////////////////
if (empty($is_appreciation_groupe)) {
    if ($synthese_modele == 'matiere') {
        list($tab_item, $tab_synthese) = DB_STRUCTURE_BILAN::DB_recuperer_arborescence_synthese($liste_eleve, $matiere_id, $only_socle, $only_niveau, $mode_synthese, $fusion_niveaux, $date_mysql_debut, $date_mysql_fin);
        $tab_matiere[$matiere_id] = array('matiere_nom' => $matiere_nom, 'matiere_nb_demandes' => DB_STRUCTURE_DEMANDE::DB_recuperer_demandes_autorisees_matiere($matiere_id));
    } elseif ($synthese_modele == 'multimatiere') {
        $matiere_id = 0;
        list($tab_item, $tab_synthese, $tab_matiere) = DB_STRUCTURE_BILAN::DB_recuperer_arborescence_synthese($liste_eleve, $matiere_id, $only_socle, $only_niveau, 'predefini', $fusion_niveaux, $date_mysql_debut, $date_mysql_fin);
    }
} else {
    // Dans le cas d'une saisie globale sur le groupe, il faut "juste" récupérer les matières concernées.
    $liste_matiere_id = isset($liste_matiere_id) ? $liste_matiere_id : '';
    $DB_TAB = DB_STRUCTURE_BILAN::DB_recuperer_matieres_travaillees($classe_id, $liste_matiere_id, $date_mysql_debut, $date_mysql_fin);
    foreach ($DB_TAB as $DB_ROW) {
        $tab_matiere[$DB_ROW['rubrique_id']] = array('matiere_nom' => $DB_ROW['rubrique_nom'], 'matiere_nb_demandes' => NULL);
    }
}
$item_nb = count($tab_item);
if (!$item_nb && !$make_officiel) {
    exit('Aucun item évalué sur la période ' . $date_debut . ' ~ ' . $date_fin . ' selon les paramètres choisis !');
      if($retroactif=='non')    { $date_mysql_start = $date_mysql_debut; }
  elseif($retroactif=='annuel') { $date_mysql_start = $date_mysql_debut_annee_scolaire; }
  else                          { $date_mysql_start = FALSE; } // forcément 'oui' puisque le cas 'auto' a déjà été écarté (possible car un unique référentiel est considéré ici)
  $DB_TAB = DB_STRUCTURE_BILAN::DB_lister_result_eleves_items( $liste_eleve , $liste_item , $matiere_id , $date_mysql_start , $date_mysql_fin , $_SESSION['USER_PROFIL_TYPE'] , FALSE /*onlyprof*/ , FALSE /*onlynote*/ ) ;
  if(!empty($DB_TAB))
  {
    foreach($DB_TAB as $DB_ROW)
    {
      $user_id = ($_SESSION['USER_PROFIL_TYPE']=='eleve') ? $_SESSION['USER_ID'] : $DB_ROW['eleve_id'] ;
      $tab_eval[$user_id][$DB_ROW['item_id']][] = array('note'=>$DB_ROW['note'],'date'=>$DB_ROW['date'],'info'=>$DB_ROW['info']);
    }
  }
}

// Nombre de demandes d'évaluation autorisées pour la matière concernée
$nb_demandes_autorisees = DB_STRUCTURE_DEMANDE::DB_recuperer_demandes_autorisees_matiere($matiere_id);

// ////////////////////////////////////////////////////////////////////////////////////////////////////
/* 
 * Libérer de la place mémoire car les scripts de bilans sont assez gourmands.
 * Supprimer $DB_TAB ne fonctionne pas si on ne force pas auparavant la fermeture de la connexion.
 * SebR devrait peut-être envisager d'ajouter une méthode qui libère cette mémoire, si c'est possible...
 */
// ////////////////////////////////////////////////////////////////////////////////////////////////////

DB::close(SACOCHE_STRUCTURE_BD_NAME);
unset($DB_TAB);

// ////////////////////////////////////////////////////////////////////////////////////////////////////
// Tableaux et variables pour mémoriser les infos ; dans cette partie on ne fait que les calculs (aucun affichage)
// ////////////////////////////////////////////////////////////////////////////////////////////////////
// ////////////////////////////////////////////////////////////////////////////////////////////////////
// Actualiser un score
// ////////////////////////////////////////////////////////////////////////////////////////////////////

if( ($action=='actualiser_score') && $demande_id && $item_id && ($score>-2) )
{
  $tab_devoirs = array();
  $DB_TAB = DB_STRUCTURE_DEMANDE::DB_lister_result_eleve_item( $_SESSION['USER_ID'] , $item_id );
  foreach($DB_TAB as $DB_ROW)
  {
    $tab_devoirs[] = array('note'=>$DB_ROW['note']);
  }
  $score_new = (count($tab_devoirs)) ? calculer_score($tab_devoirs,$DB_ROW['calcul_methode'],$DB_ROW['calcul_limite']) : FALSE ;
  if( ( ($score==-1) && ($score_new!==FALSE) ) || ( ($score>-1) && ($score_new!==$score) ) )
  {
    // maj score
    $score_new_bdd = ($score_new!=-1) ? $score_new : NULL ;
    DB_STRUCTURE_DEMANDE::DB_modifier_demande_score( $demande_id , $score_new_bdd );
  }
  $score_retour = str_replace( '</td>' , ' <q class="actualiser" title="Actualiser le score (enregistré lors de la demande)."></q></td>' , Html::td_score( $score_new , 'score' /*methode_tri*/ , '' /*pourcent*/ ) );
  exit($score_retour);
}

// ////////////////////////////////////////////////////////////////////////////////////////////////////
// On ne devrait pas en arriver là...
// ////////////////////////////////////////////////////////////////////////////////////////////////////

exit('Erreur avec les données transmises !');

?>
Пример #5
0
 //
 // Il n'y a plus qu'à mettre à jour la base
 //
 // L'information associée à la note comporte le nom de l'évaluation + celui du professeur (c'est une information statique, conservée sur plusieurs années)
 $info = $devoir_description . ' (' . afficher_identite_initiale($_SESSION['USER_NOM'], FALSE, $_SESSION['USER_PRENOM'], TRUE, $_SESSION['USER_GENRE']) . ')';
 foreach ($tab_nouveau_ajouter as $item_id => $note) {
     DB_STRUCTURE_PROFESSEUR::DB_ajouter_saisie($devoir_proprio_id, $_SESSION['USER_ID'], $devoir_id, $item_id, $devoir_date_mysql, $note, $info, $date_visible_mysql);
 }
 foreach ($tab_nouveau_modifier as $item_id => $note) {
     DB_STRUCTURE_PROFESSEUR::DB_modifier_saisie($devoir_proprio_id, $_SESSION['USER_ID'], $devoir_id, $item_id, $note, $info);
 }
 foreach ($tab_nouveau_supprimer as $item_id) {
     DB_STRUCTURE_PROFESSEUR::DB_supprimer_saisie($_SESSION['USER_ID'], $devoir_id, $item_id);
 }
 foreach ($tab_demande_supprimer as $item_id) {
     DB_STRUCTURE_DEMANDE::DB_supprimer_demande_precise_eleve_item($_SESSION['USER_ID'], $item_id);
 }
 // Ajout aux flux RSS des profs concernés
 $tab_profs_rss = array_merge(array($devoir_proprio_id), DB_STRUCTURE_ELEVE::DB_lister_devoir_profs_droit_saisie($devoir_id));
 $titre = 'Autoévaluation effectuée par ' . afficher_identite_initiale($_SESSION['USER_NOM'], FALSE, $_SESSION['USER_PRENOM'], TRUE);
 $texte = $_SESSION['USER_PRENOM'] . ' ' . $_SESSION['USER_NOM'] . ' s\'auto-évalue sur le devoir "' . $devoir_description . '".' . "\r\n";
 $texte .= $msg_data ? 'Commentaire :' . "\r\n" . $msg_data . "\r\n" : 'Pas de commentaire saisi.' . "\r\n";
 $guid = 'autoeval_' . $devoir_id . '_' . $_SESSION['USER_ID'] . '_' . $_SERVER['REQUEST_TIME'];
 // obligé d'ajouter un time pour unicité au cas où un élève valide 2x l'autoévaluation
 foreach ($tab_profs_rss as $prof_id) {
     RSS::modifier_fichier_prof($prof_id, $titre, $texte, $guid);
 }
 // Notifications (rendues visibles ultérieurement) ; on récupère des données conçues pour le flux RSS ($texte , $tab_profs_rss)
 $abonnement_ref = 'devoir_autoevaluation_eleve';
 $listing_profs = implode(',', $tab_profs_rss);
 if ($listing_profs) {
Пример #6
0
    <tr>
      <th>Date</th>
      <th>Matière</th>
      <th>Destinaire(s)</th>
      <th>Item</th>
      <th>Score</th>
      <th>Statut</th>
      <th>Messages</th>
      <th>Fichier</th>
      <th class="nu"></th>
    </tr>
  </thead>
  <tbody>
    <?php 
// Lister les demandes d'évaluation
$DB_TAB = DB_STRUCTURE_DEMANDE::DB_lister_demandes_eleve($_SESSION['USER_ID']);
if (!empty($DB_TAB)) {
    foreach ($DB_TAB as $DB_ROW) {
        $destinataires = $DB_ROW['prof_id'] ? html(afficher_identite_initiale($DB_ROW['user_nom'], FALSE, $DB_ROW['user_prenom'], TRUE, $DB_ROW['user_genre'])) : 'enseignants concernés';
        $score = $DB_ROW['demande_score'] !== null ? $DB_ROW['demande_score'] : FALSE;
        $statut = $DB_ROW['demande_statut'] == 'eleve' ? 'demande non traitée' : 'évaluation en préparation';
        $texte_lien_avant = $DB_ROW['item_lien'] ? '<a target="_blank" href="' . html($DB_ROW['item_lien']) . '">' : '';
        $texte_lien_apres = $DB_ROW['item_lien'] ? '</a>' : '';
        $commentaire = $DB_ROW['demande_messages'] ? 'oui <img alt="" src="./_img/bulle_aide.png" width="16" height="16" title="' . str_replace(array("\r\n", "\r", "\n"), '<br />', html(html($DB_ROW['demande_messages']))) . '" />' : 'non';
        // Volontairement 2 html() pour le title sinon &lt;* est pris comme une balise html par l'infobulle.
        $document = $DB_ROW['demande_doc'] ? '<a href="' . html($DB_ROW['demande_doc']) . '" target="_blank">oui</a>' : 'non';
        // Afficher une ligne du tableau
        echo '<tr id="ids_' . $DB_ROW['demande_id'] . '_' . $DB_ROW['item_id'] . '_' . $DB_ROW['matiere_id'] . '_' . $DB_ROW['prof_id'] . '">';
        echo '<td>' . convert_date_mysql_to_french($DB_ROW['demande_date']) . '</td>';
        echo '<td>' . html($DB_ROW['matiere_nom']) . '</td>';
        echo '<td>' . $destinataires . '</td>';
Пример #7
0
 foreach($tab_nouveau_modifier as $key => $note)
 {
   list($item_id,$eleve_id) = explode('x',$key);
   DB_STRUCTURE_PROFESSEUR::DB_modifier_saisie( $_SESSION['USER_ID'] , $eleve_id , $devoir_id , $item_id , $note , $info );
   $tab_notif[$eleve_id] = $eleve_id;
 }
 foreach($tab_nouveau_supprimer as $key => $key)
 {
   list($item_id,$eleve_id) = explode('x',$key);
   DB_STRUCTURE_PROFESSEUR::DB_supprimer_saisie( $eleve_id , $devoir_id , $item_id );
   $tab_notif[$eleve_id] = $eleve_id;
 }
 foreach($tab_demande_supprimer as $key => $key)
 {
   list($item_id,$eleve_id) = explode('x',$key);
   DB_STRUCTURE_DEMANDE::DB_supprimer_demande_precise_eleve_item( $eleve_id , $item_id );
 }
 // Notifications (rendues visibles ultérieurement) ; le mode discret ne d'applique volontairement pas ici car les modifications sont chirurgicales
 $listing_eleves = implode(',',$tab_notif);
 $listing_parents = DB_STRUCTURE_NOTIFICATION::DB_lister_parents_listing_id($listing_eleves);
 $listing_users = ($listing_parents) ? $listing_eleves.','.$listing_parents : $listing_eleves ;
 $listing_abonnes = DB_STRUCTURE_NOTIFICATION::DB_lister_destinataires_listing_id( $abonnement_ref_saisie , $listing_users );
 if($listing_abonnes)
 {
   $adresse_lien_profond = Sesamail::adresse_lien_profond('page=evaluation_voir&devoir_id='.$devoir_id.'&eleve_id=');
   $notification_date = ( TODAY_MYSQL < $date_visible_mysql ) ? $date_visible_mysql : NULL ;
   $notification_contenu = 'Saisies pour l\'évaluation "'.$description.'" du '.$date_fr.' enregistrées par '.afficher_identite_initiale($_SESSION['USER_NOM'],FALSE,$_SESSION['USER_PRENOM'],TRUE,$_SESSION['USER_GENRE']).'.'."\r\n\r\n";
   $tab_abonnes = DB_STRUCTURE_NOTIFICATION::DB_lister_detail_abonnes_envois( $listing_abonnes , $listing_eleves , $listing_parents );
   foreach($tab_abonnes as $abonne_id => $tab_abonne)
   {
     foreach($tab_abonne as $eleve_id => $notification_intro_eleve)