|
|
|
@ -904,6 +904,7 @@ Candidat * lireCandidat(FILE *flot) /* Fonction permettant de lire un candidat d
|
|
|
|
|
fgets(c->prenom, 31, flot);
|
|
|
|
|
c->prenom[strlen(c->prenom) - 1] = '\0';
|
|
|
|
|
fscanf(flot, "%f%f%f%f%*c", &c->notes[0], &c->notes[1], &c->notes[2], &c->notes[3]);
|
|
|
|
|
c->moyenne = (c->notes[0] + c->notes[1] + c->notes[2] + c->notes[3]) / 4;
|
|
|
|
|
fscanf(flot, "%d%*c", &c->nombreChoix);
|
|
|
|
|
c->tChoix = (Choix **)malloc(sizeof(Choix *) * c->nombreChoix); /* Allocation dynamique du tableau de pointeurs vers des structures Choix*/
|
|
|
|
|
if(c->tChoix == NULL) /* pour le chargement des choix du candidats */
|
|
|
|
@ -1225,83 +1226,27 @@ void miseAJourChoixCand(Choix *tChoix[], int nombreChoix) /* Fontcion permettant
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
system("clear");
|
|
|
|
|
if(tChoix[pos]->decisionCand == -1) /* Affichage d'un menu adapté pour chaque cas ; le candidat peut choisir entre deux option ou bien ne rien faire */
|
|
|
|
|
{
|
|
|
|
|
printf("Vous avez actuellement refusé la proposition d'admission de l'établissement\n\n");
|
|
|
|
|
printf("|---------------------------------------|\n");
|
|
|
|
|
printf("| Que souhaitez-vous faire ? |\n");
|
|
|
|
|
printf("|---------------------------------------|\n");
|
|
|
|
|
printf("| 1 Accepter la proposition d'admission |\n");
|
|
|
|
|
printf("| 2 Prendre un temps de réflexion |\n");
|
|
|
|
|
printf("| 3 Ne rien changer |\n");
|
|
|
|
|
printf("|---------------------------------------|\n");
|
|
|
|
|
printf("Saisie : ");
|
|
|
|
|
scanf("%d%*c", &saisie);
|
|
|
|
|
printf("\n");
|
|
|
|
|
if(saisie == 1)
|
|
|
|
|
{
|
|
|
|
|
tChoix[pos]->decisionCand = 1;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(saisie == 2)
|
|
|
|
|
{
|
|
|
|
|
tChoix[pos]->decisionCand = 0;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(saisie == 3)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(tChoix[pos]->decisionCand == 0)
|
|
|
|
|
if(tChoix[pos]->decisionCand == 0)
|
|
|
|
|
{
|
|
|
|
|
printf("Vous n'avez actuellement pris aucune décision\n\n");
|
|
|
|
|
printf("|---------------------------------------|\n");
|
|
|
|
|
printf("| Que souhaitez-vous faire ? |\n");
|
|
|
|
|
printf("|---------------------------------------|\n");
|
|
|
|
|
printf("| 1 Refuser la proposition d'admission |\n");
|
|
|
|
|
printf("| 2 Accepter la proposition d'admission |\n");
|
|
|
|
|
printf("| 1 Accepter la proposition d'admission |\n");
|
|
|
|
|
printf("| 2 Refuser la proposition d'admission |\n");
|
|
|
|
|
printf("| 3 Ne rien changer |\n");
|
|
|
|
|
printf("|---------------------------------------|\n");
|
|
|
|
|
printf("Saisie : ");
|
|
|
|
|
scanf("%d%*c", &saisie);
|
|
|
|
|
printf("\n");
|
|
|
|
|
if(saisie == 1)
|
|
|
|
|
{
|
|
|
|
|
tChoix[pos]->decisionCand = -1;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(saisie == 2)
|
|
|
|
|
{
|
|
|
|
|
tChoix[pos]->decisionCand = 1;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(saisie == 3)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(tChoix[pos]->decisionCand == 1)
|
|
|
|
|
{
|
|
|
|
|
printf("Vous avez actuellement accepté la proposition d'admission de l'établissement\n\n");
|
|
|
|
|
printf("|---------------------------------------|\n");
|
|
|
|
|
printf("| Que souhaitez-vous faire ? |\n");
|
|
|
|
|
printf("|---------------------------------------|\n");
|
|
|
|
|
printf("| 1 Refuser la proposition d'admission |\n");
|
|
|
|
|
printf("| 2 Prendre un temps de réflexion |\n");
|
|
|
|
|
printf("| 3 Ne rien changer |\n");
|
|
|
|
|
printf("|---------------------------------------|\n");
|
|
|
|
|
printf("Saisie : ");
|
|
|
|
|
scanf("%d%*c", &saisie);
|
|
|
|
|
printf("\n");
|
|
|
|
|
if(saisie == 1)
|
|
|
|
|
{
|
|
|
|
|
tChoix[pos]->decisionCand = -1;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(saisie == 2)
|
|
|
|
|
{
|
|
|
|
|
tChoix[pos]->decisionCand = 0;
|
|
|
|
|
tChoix[pos]->decisionCand = -1;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(saisie == 3)
|
|
|
|
@ -1552,6 +1497,11 @@ FileCand supt(FileCand f)
|
|
|
|
|
return f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FileCand supCand(FileCand f, int numeroC)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Candidat * tete(FileCand f)
|
|
|
|
|
{
|
|
|
|
|
if(vide(f))
|
|
|
|
@ -1616,17 +1566,17 @@ void afficher(FileCand f)
|
|
|
|
|
|
|
|
|
|
void globale(void) /* Permet de gérer l'exécution du programme */
|
|
|
|
|
{
|
|
|
|
|
int tMax, pos, trouve, i;
|
|
|
|
|
Candidat **tCand, c; /* Initialisation du tableau de candidats */
|
|
|
|
|
int tMax, pos, trouve, i, j;
|
|
|
|
|
Candidat **tCand, c **aux; /* Initialisation du tableau de candidats */
|
|
|
|
|
tCand = chargementCandidats(&tMax); /* Remplissage du tableau par chargement */
|
|
|
|
|
triCandidats(tCand, tMax); /* Tri du tableau */
|
|
|
|
|
for(i = 0; i < tMax; i++) /* Tri du tableau choix pour chaque candidat */
|
|
|
|
|
{
|
|
|
|
|
triChoix(tCand[i]->tChoix, tCand[i]->nombreChoix);
|
|
|
|
|
}
|
|
|
|
|
pos = rechercherChoix(tCand[3]->tChoix, tCand[3]->nombreChoix, "Clermont-Ferrand", "Informatique", &trouve);
|
|
|
|
|
miseAJourChoixResp(tCand[3]->tChoix, pos);
|
|
|
|
|
menuCandidat(tCand, tMax); /* Appel du menu adapté au candidat */
|
|
|
|
|
aux = tCand;
|
|
|
|
|
while(aux != )
|
|
|
|
|
//menuCandidat(tCand, tMax); /* Appel du menu adapté au candidat */
|
|
|
|
|
afficherCandChoix(tCand, tMax);
|
|
|
|
|
sauvegarder(tCand, tMax); /* Sauvegarde du tableau de candidats */
|
|
|
|
|
}
|
|
|
|
@ -1695,4 +1645,13 @@ void menuCandidat(Candidat *tCand[], int tMax) /* Fonction affichant un menu ada
|
|
|
|
|
scanf("%d%*c", &saisie);
|
|
|
|
|
printf("\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void clearpage(void) /* Permet de demander à l'utilisateur pour continuer à la suite d'une action et efface le contenu affiché à l'écran */
|
|
|
|
|
{
|
|
|
|
|
char entre;
|
|
|
|
|
printf("\n");
|
|
|
|
|
printf("Appuyez sur la touche [ENTREE] pour continuer");
|
|
|
|
|
scanf("%c", &entre);
|
|
|
|
|
system("clear");
|
|
|
|
|
}
|