Affichage des contrôles même si aucune note n'est encore saisie
This commit is contained in:
parent
0f779dc42a
commit
e10c3ad989
|
@ -641,8 +641,12 @@ class DataBase{
|
|||
foreach($UEList[$iter_ue]['modules'] as $iter_mod=>$b){
|
||||
$UEList[$iter_ue]['modules'][$iter_mod]['controles'] = controleRepo::forTeacher($enseignantUID, $UEList[$iter_ue]['modules'][$iter_mod]['id'], $UEList[$iter_ue]['id_semestre']);
|
||||
|
||||
foreach($UEList[$iter_ue]['modules'][$iter_mod]['controles'] as $iter_ct=>$c)
|
||||
foreach($UEList[$iter_ue]['modules'][$iter_mod]['controles'] as $iter_ct=>$c){
|
||||
$UEList[$iter_ue]['modules'][$iter_mod]['controles'][$iter_ct]['grouplist'] = noteRepo::forTeacher($UEList[$iter_ue]['modules'][$iter_mod]['controles'][$iter_ct]['id']);
|
||||
|
||||
$UEList[$iter_ue]['modules'][$iter_mod]['controles'][$iter_ct]['moyenne'] = noteRepo::moyenneForControle($UEList[$iter_ue]['modules'][$iter_mod]['controles'][$iter_ct]['id']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -80,13 +80,12 @@ class controleRepo extends DBAccess{
|
|||
*
|
||||
*/
|
||||
public static function forTeacher($enseignant, $module, $semestre){
|
||||
$getControleList = DataBase::getPDO()->prepare("SELECT DISTINCT ctrl.id_controle as id, ctrl.id_mcc_module, ctrl.intitule, ctrl.base, ctrl.coefficient, ctrl.date_publication, AVG(n.valeur) as moyenne ".
|
||||
"FROM enseignement as ens, module as m, mcc_module as mcc_m, mcc_ue, controle as ctrl, note as n ".
|
||||
$getControleList = DataBase::getPDO()->prepare("SELECT DISTINCT ctrl.id_controle as id, ctrl.id_mcc_module, ctrl.intitule, ctrl.base, ctrl.coefficient, ctrl.date_publication ".
|
||||
"FROM enseignement as ens, module as m, mcc_module as mcc_m, mcc_ue, controle as ctrl ".
|
||||
"WHERE ens.id_mcc_module = mcc_m.id_mcc_module ".
|
||||
"AND mcc_m.id_mcc_module = ctrl.id_mcc_module ".
|
||||
"AND mcc_m.id_module = m.id_module ".
|
||||
"AND mcc_ue.id_mcc_ue = mcc_m.id_mcc_ue ".
|
||||
"AND n.id_controle = ctrl.id_controle ".
|
||||
|
||||
"AND ens.id_enseignant = :enseignant ".
|
||||
"AND mcc_m.id_module = :module ".
|
||||
|
|
|
@ -188,6 +188,31 @@ class noteRepo extends DBAccess{
|
|||
}
|
||||
|
||||
|
||||
/* RETOURNE LA MOYENNE D'UN CONTRÔLE PARTICULIER
|
||||
*
|
||||
* @controle<int> l'UID du contrôle en question
|
||||
*
|
||||
*
|
||||
* @return moyenne<Float> retourne la moyenne d'un contrôle
|
||||
* @return FALSE<Boolean> retourne FALSE s'il y a aucune note à ce contrôle
|
||||
*
|
||||
*/
|
||||
public static function moyenneForControle($controle){
|
||||
$getMoyenne = DataBase::getPDO()->prepare("SELECT AVG(n.valeur) as moyenne ".
|
||||
"FROM controle as ctrl, note as n ".
|
||||
"WHERE ctrl.id_controle = n.id_controle ".
|
||||
"AND ctrl.id_controle = :controle ".
|
||||
|
||||
"GROUP BY ctrl.id_controle");
|
||||
$getMoyenne->execute(array( ':controle' => $controle ));
|
||||
|
||||
if( $fetchObj = $getMoyenne->fetch() )
|
||||
return $fetchObj['moyenne'];
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* CRÉATION/MODIFICATION D'UNE NOTE POUR UN ETUDIANT À UN CONTRÔLE
|
||||
*
|
||||
|
|
|
@ -178,8 +178,6 @@ if( permission('teacher') && $controleOpt == null ){ // si c'est un enseignant e
|
|||
echo "<td data-value='".$UE['nom']."'>".$UE['nom'].'</td>';
|
||||
echo "</tr></tbody></table>";
|
||||
|
||||
|
||||
|
||||
if( count($answer->UEs) > 0 ){ // si au moins un UE
|
||||
|
||||
foreach($answer->UEs as $UE){ // pour chaque UE
|
||||
|
@ -195,6 +193,7 @@ if( permission('teacher') && $controleOpt == null ){ // si c'est un enseignant e
|
|||
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>';
|
||||
echo "<td><span class='link ctrl' data-ctrl='".$controle['id']."'>".$controle['intitule']."</span></td>";
|
||||
|
||||
|
@ -247,7 +246,6 @@ elseif( permission('teacher') ){ // si enseignant et qu'un contrôle est spécif
|
|||
$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' ){
|
||||
|
|
Loading…
Reference in New Issue