2015-10-29 23:01:35 +00:00
|
|
|
<?php define('__ROOT__', dirname(dirname(__FILE__)) );
|
|
|
|
require_once __ROOT__.'/manager/security.php';
|
|
|
|
require_once __ROOT__.'/manager/groups.php';
|
|
|
|
require_once __ROOT__.'/manager/modules.php';
|
|
|
|
require_once __ROOT__.'/manager/career.php';
|
|
|
|
|
2015-11-13 23:47:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*** GESTION DES PARAMETRES OPTIONNELS ***/
|
|
|
|
|
|
|
|
$postVars = array(); // on récupère les variables post
|
|
|
|
|
|
|
|
foreach($_POST as $k=>$v)
|
|
|
|
array_push($postVars, $k);
|
|
|
|
|
2015-11-14 17:33:06 +00:00
|
|
|
/* GESTION CONTRÔLE OPTIONNEL */
|
|
|
|
if( isset($postVars[1]) && is_int($postVars[1]) )
|
|
|
|
$controleOpt = (String) $postVars[1];
|
2015-11-13 23:47:11 +00:00
|
|
|
else
|
2015-11-14 17:33:06 +00:00
|
|
|
$controleOpt = null;
|
2015-11-13 23:47:11 +00:00
|
|
|
|
|
|
|
|
2015-11-14 17:33:06 +00:00
|
|
|
/* GESTION GROUPE OPTIONNEL */
|
|
|
|
if( isset($postVars[2]) && is_string($postVars[2]) && strlen($postVars[2]) > 1 )
|
|
|
|
$groupeOpt = $postVars[2];
|
|
|
|
else
|
|
|
|
$groupeOpt = null;
|
2015-11-13 23:47:11 +00:00
|
|
|
|
2015-10-29 23:01:35 +00:00
|
|
|
/****************************************
|
|
|
|
* *
|
|
|
|
* SECTION "PARCOURS" *
|
|
|
|
* *
|
|
|
|
*****************************************
|
|
|
|
*
|
|
|
|
* [1] Mes modules (eleves) notes
|
|
|
|
* [2] Mes ue (eleves) notes
|
|
|
|
* [3] Mes semestres (eleves) notes
|
|
|
|
* [4] Graphiques (eleves) notes
|
|
|
|
*
|
|
|
|
*****************************************/
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
2015-11-06 13:05:14 +00:00
|
|
|
|
|
|
|
|
2015-10-29 23:01:35 +00:00
|
|
|
<!-- mes UEs -->
|
|
|
|
|
|
|
|
<?php
|
2015-11-03 20:59:16 +00:00
|
|
|
/**********************************/
|
2015-10-29 23:01:35 +00:00
|
|
|
/*** MES UEs (version étudiant) ***/
|
2015-11-03 20:59:16 +00:00
|
|
|
/**********************************/
|
2015-11-06 22:00:08 +00:00
|
|
|
if( permission('student') ){ // si l'utilisateur est connecté et que c'est un élève
|
2015-10-29 23:01:35 +00:00
|
|
|
|
|
|
|
$request = new stdClass(); $answer = new stdClass();
|
|
|
|
debug();
|
|
|
|
|
2015-11-13 18:07:36 +00:00
|
|
|
$request->level_1 = 'getNotesEtudiant';
|
2015-10-29 23:01:35 +00:00
|
|
|
$request->etudiant = $_SESSION['identifiant'];
|
|
|
|
$request->semestre = $_SESSION['semestre'];
|
|
|
|
$request->annee = $_SESSION['annee'];
|
|
|
|
|
|
|
|
career_switch_level_1($request, $answer);
|
|
|
|
|
|
|
|
if( $answer->request == 'success' ){ // si on a bien récupéré les UE/notes
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2015-11-11 21:54:52 +00:00
|
|
|
echo "<section name='marksbyue' title='Mes Notes' class='basic'>";
|
2015-10-29 23:01:35 +00:00
|
|
|
|
2015-11-12 10:19:58 +00:00
|
|
|
foreach($answer->UEs as $UE){ // pour chaque UE
|
2015-11-12 11:15:51 +00:00
|
|
|
echo "<table class='basic col4'>";
|
2015-11-13 16:24:58 +00:00
|
|
|
echo "<thead>";
|
2015-11-12 10:19:58 +00:00
|
|
|
echo '<tr>';
|
2015-11-13 16:24:58 +00:00
|
|
|
echo "<th colspan=5 style='font-size:1.5em; text-align:center;'>".$UE['nom'].' - '.$UE['libelle'].'</th>';
|
2015-11-12 10:19:58 +00:00
|
|
|
echo '</tr>';
|
|
|
|
|
2015-11-13 16:24:58 +00:00
|
|
|
echo '</thead></table>';
|
|
|
|
foreach($UE['modules'] as $module){ // pour chaque module
|
|
|
|
echo '<table class=basic><thead>';
|
|
|
|
echo '<tr><th colspan=5>'.$module['nom'].' - '.$module['libelle'].'</th></tr></thead><tbody>';
|
2015-11-12 10:19:58 +00:00
|
|
|
|
2015-11-13 16:24:58 +00:00
|
|
|
foreach($module['controles'] as $controle){ // pour chaque contrôle
|
|
|
|
echo '<tr>';
|
|
|
|
echo '<td><span class=link>'.$controle['intitule'].'</span></td>';
|
|
|
|
|
|
|
|
if( count($controle['notes']) == 0 ) // si aucune note pour ce controle on affiche 'Pas de note'
|
|
|
|
echo '<td><span class=unstressed>Pas de note</span></td>';
|
|
|
|
else // si une note, alors on l'affiche
|
|
|
|
echo '<td>'.number_format($controle['notes'][0]['valeur'], 2).' <span class=unstressed>/</span> '.$controle['base'].'</td>';
|
|
|
|
|
|
|
|
echo "<td>".$module['nom']." - ".$module['libelle']."</td>";
|
|
|
|
echo '<td>Coefficient '.number_format($controle['coefficient'], 2).'</td>';
|
|
|
|
echo '</tr>';
|
|
|
|
}
|
|
|
|
echo '</tbody>';
|
|
|
|
}
|
2015-10-29 23:01:35 +00:00
|
|
|
echo '</table>';
|
2015-11-12 10:19:58 +00:00
|
|
|
|
2015-10-29 23:01:35 +00:00
|
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
echo '</section>';
|
|
|
|
}else
|
2015-11-11 21:54:52 +00:00
|
|
|
echo "<section name='marksbyue' title='Mes Notes' class='basic'><table class=basic><tbody><tr><td>Aucune note trouvée</td></tr></tbody></table></section>";
|
2015-10-29 23:01:35 +00:00
|
|
|
|
2015-11-13 18:07:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-14 17:33:06 +00:00
|
|
|
/******************************************/
|
|
|
|
/*** LES CONTRÔLES (version enseignant) ***/
|
|
|
|
/******************************************/
|
|
|
|
/*
|
|
|
|
*
|
|
|
|
* [1] Tous les contrôles
|
|
|
|
* [2] Un contrôle particulier( avec ou sans groupe particulier )
|
|
|
|
*
|
|
|
|
*/
|
2015-11-13 18:07:36 +00:00
|
|
|
|
2015-11-14 17:33:06 +00:00
|
|
|
|
|
|
|
/* [1] Tous les contrôles
|
|
|
|
==================================================================*/
|
|
|
|
if( permission('teacher') && $controleOpt == null ){ // si c'est un enseignant et qu'aucun contrôle n'est spécifié
|
|
|
|
|
|
|
|
|
2015-11-13 18:07:36 +00:00
|
|
|
$request = new stdClass(); $answer = new stdClass();
|
|
|
|
|
|
|
|
$request->level_1 = 'getControlesEnseignant';
|
|
|
|
$request->enseignant = $_SESSION['identifiant'];
|
|
|
|
$request->semestre = $_SESSION['semestre'];
|
|
|
|
$request->annee = $_SESSION['annee'];
|
|
|
|
|
|
|
|
career_switch_level_1($request, $answer);
|
|
|
|
|
|
|
|
if( $answer->request == 'success' ){ // si on a bien récupéré les UE/notes
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2015-11-13 23:47:11 +00:00
|
|
|
echo "<section name='controlesenseignants' title='Contrôles' class='basic'>";
|
2015-11-13 18:07:36 +00:00
|
|
|
|
|
|
|
if( count($answer->UEs) > 0 ){ // si au moins un UE
|
|
|
|
|
|
|
|
foreach($answer->UEs as $UE){ // pour chaque UE
|
|
|
|
echo "<table class='basic col4'>";
|
|
|
|
echo "<thead>";
|
|
|
|
echo '<tr>';
|
|
|
|
echo "<th colspan=5 style='font-size:1.5em; text-align:center;'>".$UE['nom'].' - '.$UE['libelle'].'</th>';
|
|
|
|
echo '</tr>';
|
|
|
|
|
|
|
|
echo '</thead></table>';
|
|
|
|
if( count($UE['modules']) > 0 ){ // s'il y a au moins un module
|
|
|
|
|
|
|
|
foreach($UE['modules'] as $module){ // pour chaque module
|
2015-11-13 23:47:11 +00:00
|
|
|
echo "<table class='basic col4'><thead>";
|
|
|
|
echo '<tr><th colspan=4>'.$module['nom'].' - '.$module['libelle'].'</th></tr></thead><tbody>';
|
2015-11-13 18:07:36 +00:00
|
|
|
|
|
|
|
if( count($module['controles']) > 0 ){ // s'il y a au moins un contrôle pour ce module
|
|
|
|
|
|
|
|
foreach($module['controles'] as $controle){ // pour chaque contrôle
|
|
|
|
echo '<tr>';
|
2015-11-14 17:33:06 +00:00
|
|
|
echo "<td><span class='link ctrl' data-ctrl='".$controle['id']."'>".$controle['intitule']."</span></td>";
|
2015-11-13 23:47:11 +00:00
|
|
|
|
|
|
|
echo "<td>".$module['nom']." - ".$module['libelle']."</td>";
|
2015-11-13 18:07:36 +00:00
|
|
|
|
2015-11-13 18:33:33 +00:00
|
|
|
if( count($controle['notes']) == 0 ) // si il y a au moins une note pour ce contrôle
|
2015-11-13 18:07:36 +00:00
|
|
|
echo '<td><span class=unstressed>Pas noté</span></td>';
|
2015-11-13 23:47:11 +00:00
|
|
|
else
|
2015-11-15 11:15:30 +00:00
|
|
|
echo '<td><span class=unstressed>Moyenne de</span> '.number_format($controle['moyenne'], 2).' <span class=unstressed>/</span> '.$controle['base'].'</td>';
|
2015-11-13 23:47:11 +00:00
|
|
|
// echo '<td>'.number_format($controle['moyenne'], 2).'</td>';
|
|
|
|
|
|
|
|
echo '<td><span class=unstressed>Coefficient</span> '.number_format($controle['coefficient'], 2).'</td>';
|
2015-11-13 18:07:36 +00:00
|
|
|
echo '</tr>';
|
2015-11-13 18:33:33 +00:00
|
|
|
|
2015-11-13 23:47:11 +00:00
|
|
|
echo "<tr class='noborder transparentbg'><td></td><td colspan=3><table class='basic col4'><tbody>";
|
|
|
|
|
|
|
|
foreach($controle['notes'] as $note){ // on affiche la liste des élèves avec leurs notes
|
|
|
|
echo "<tr>";
|
2015-11-14 17:33:06 +00:00
|
|
|
echo "<td><span class='link grp ctrl' data-grp='".$note['groupe']."' data-ctrl='".$controle['id']."'>".$note['groupe']."</span></td>";
|
2015-11-13 23:47:11 +00:00
|
|
|
if( $note['nb_notes'] == 1 )
|
|
|
|
echo "<td>".$note['nb_notes']." <span class=unstressed>note</span></td>";
|
|
|
|
else
|
|
|
|
echo "<td>".$note['nb_notes']." <span class=unstressed>notes</span></td>";
|
|
|
|
|
|
|
|
echo "<td><span class=unstressed>Allant de</span> ".$note['min']." <span class=unstressed>à</span> ".$note['max']."</td>";
|
2015-11-14 17:33:06 +00:00
|
|
|
echo "<td><span class=unstressed>Moyenne de </span>".number_format($note['valeur'], 2)." <span class=unstressed>/</span> ".$controle['base']."</td>";
|
2015-11-13 23:47:11 +00:00
|
|
|
echo "</tr>";
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '</tbody></table></td></tr>';
|
2015-11-13 18:07:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}else // si aucun contrôle pour ce module
|
|
|
|
echo "<tr><td colspan=5>Aucun contrôle trouvé</td></tr>";
|
|
|
|
|
|
|
|
echo '</tbody>';
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
echo '</table>';
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
echo '</section>';
|
|
|
|
}else
|
2015-11-13 23:47:11 +00:00
|
|
|
echo "<section name='controlesenseignants' title='Contrôles' class='basic'><table class=basic><tbody><tr><td>Aucun contrôle trouvé</td></tr></tbody></table></section>";
|
2015-11-13 18:07:36 +00:00
|
|
|
|
2015-11-14 17:33:06 +00:00
|
|
|
|
|
|
|
|
2015-11-13 18:07:36 +00:00
|
|
|
}
|
|
|
|
|
2015-11-14 17:33:06 +00:00
|
|
|
/* [2] Un contrôle particulier( avec ou sans groupe particulier )
|
|
|
|
==================================================================*/
|
|
|
|
elseif( permission('teacher') ){ // si enseignant et qu'un contrôle est spécifié
|
|
|
|
|
|
|
|
|
|
|
|
$request = new stdClass(); $answer = new stdClass();
|
|
|
|
|
|
|
|
$request->level_1 = 'getNotesEnseignant';
|
|
|
|
$request->enseignant = $_SESSION['identifiant'];
|
|
|
|
$request->controle = $controleOpt;
|
|
|
|
if( $groupeOpt != null ) $request->groupe = $groupeOpt; // on définit le groupe s'il est spécifié
|
|
|
|
|
|
|
|
|
|
|
|
career_switch_level_1($request, $answer);
|
|
|
|
|
|
|
|
if( $answer->request == 'success' ){
|
|
|
|
echo "<section name='controlesenseignants' title='Contrôles' class='basic'>";
|
|
|
|
|
|
|
|
|
|
|
|
// bouton retour
|
|
|
|
// echo "<table class='basic'><thead><tr><th><span class='link'>Retour</span></th></tr></thead></table>";
|
|
|
|
// echo "<table class='basic'><thead><tr><th></th></tr></thead></table>";
|
|
|
|
|
|
|
|
|
|
|
|
echo "<table class='basic col4'><thead>";
|
2015-11-15 11:15:30 +00:00
|
|
|
echo "<th colspan=5 style='font-size:1.5em; text-align:center;'>".$answer->controle['module'].' - '.$answer->controle['intitule'].'</th>';
|
2015-11-14 17:33:06 +00:00
|
|
|
|
|
|
|
echo '<tr>';
|
|
|
|
echo "<th><span class='link ctrl' data-ctrl='".$answer->controle['id']."'>".$answer->controle['intitule']."</span></th>";
|
|
|
|
|
|
|
|
echo "<th>".$answer->controle['module']." - ".$answer->controle['modulelib']."</th>";
|
|
|
|
|
2015-11-15 11:15:30 +00:00
|
|
|
|
|
|
|
/* [1] Affichage par groupes
|
|
|
|
====================================================================================*/
|
|
|
|
if( $groupeOpt == null ){
|
|
|
|
|
|
|
|
if( count($answer->controle['grouplist']) == 0 ) // si il y a au moins une note pour ce contrôle
|
|
|
|
echo '<th><span class=unstressed>Pas noté</span></th>';
|
|
|
|
else
|
|
|
|
echo '<th><span class=unstressed>Moyenne de</span> '.number_format($answer->controle['moyenne'], 2).' <span class=unstressed>/</span> '.$answer->controle['base'].'</th>';
|
|
|
|
|
|
|
|
/* [2] Affichage par élèves
|
|
|
|
====================================================================================*/
|
|
|
|
}else{
|
|
|
|
|
|
|
|
if( count($answer->controle['userlist']) == 0 ) // si il y a au moins une note pour ce contrôle
|
|
|
|
echo '<th><span class=unstressed>Pas noté</span></th>';
|
|
|
|
else
|
|
|
|
echo '<th><span class=unstressed>Moyenne de</span> '.number_format($answer->controle['moyenne'], 2).' <span class=unstressed>/</span> '.$answer->controle['base'].'</th>';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-11-14 17:33:06 +00:00
|
|
|
echo '<th><span class=unstressed>Coefficient</span> '.number_format($answer->controle['coefficient'], 2).'</th>';
|
|
|
|
|
|
|
|
echo '</tr></thead>';
|
|
|
|
|
|
|
|
echo "<tbody>";
|
|
|
|
|
2015-11-15 11:15:30 +00:00
|
|
|
|
|
|
|
/* [1] Affichage par groupes
|
|
|
|
====================================================================================*/
|
|
|
|
if( $groupeOpt == null ){
|
|
|
|
|
|
|
|
foreach($answer->controle['grouplist'] as $note){ // on affiche la liste des groupes avec leurs stats
|
|
|
|
echo "<tr>";
|
2015-11-14 17:33:06 +00:00
|
|
|
|
2015-11-15 11:15:30 +00:00
|
|
|
echo "<td><span class='link grp ctrl' data-grp='".$note['groupe']."' data-ctrl='".$answer->controle['id']."'>".$note['groupe']."</span></td>";
|
|
|
|
|
|
|
|
if( $note['nb_notes'] == 1 )
|
|
|
|
echo "<td>".$note['nb_notes']." <span class=unstressed>note</span></td>";
|
|
|
|
else
|
|
|
|
echo "<td>".$note['nb_notes']." <span class=unstressed>notes</span></td>";
|
|
|
|
|
|
|
|
echo "<td><span class=unstressed>Allant de</span> ".$note['min']." <span class=unstressed>à</span> ".$note['max']."</td>";
|
|
|
|
echo "<td><span class=unstressed>Moyenne de </span>".number_format($note['moyenne'], 2)." <span class=unstressed>/</span> ".$answer->controle['base']."</td>";
|
2015-11-14 17:33:06 +00:00
|
|
|
|
|
|
|
|
2015-11-15 11:15:30 +00:00
|
|
|
echo "</tr>";
|
|
|
|
}
|
|
|
|
|
|
|
|
/* [2] Affichage par élèves
|
|
|
|
====================================================================================*/
|
|
|
|
}else{
|
|
|
|
|
|
|
|
foreach($answer->controle['userlist'] as $user){ // on affiche la liste des élèves avec leurs notes
|
|
|
|
echo "<tr>";
|
|
|
|
|
|
|
|
echo "<td><span class='link etu' data-etu='".$user['identifiant']."' data-ctrl='".$answer->controle['id']."'>".$user['identifiant']."</span></td>";
|
|
|
|
echo "<td><span class='link grp' data-grp='".$user['groupe']."'>".$user['groupe']."</span></td>";
|
|
|
|
|
|
|
|
if( $user['note'] == null ) // si pas de note
|
|
|
|
echo "<td>".number_format($user['note'], 2)." <span class=unstressed>/</span> ".$answer->controle['base']."</td>";
|
|
|
|
else // si noté
|
|
|
|
echo "<td><span class=unstressed>Pas noté</span></td>";
|
2015-11-14 17:33:06 +00:00
|
|
|
|
|
|
|
echo "<td></td>";
|
|
|
|
|
2015-11-15 11:15:30 +00:00
|
|
|
echo "</tr>";
|
|
|
|
}
|
2015-11-14 17:33:06 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '</tbody></table>';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2015-11-13 18:07:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
?>
|