// if user is not a mahara user, there will be an error : it's not supposed to be because mahara account is checked before to have a button to go in this page but... but.
if(!$mahara_user->error){
array_push($usersTab,array(
'id'=>$mahara_user[0]->id,
'username'=>$mahara_user[0]->username,
'role'=>"admin",
));
}else{
echo"<p style='color: red;'>You must have a Mahara account to do that.</p>";
die;
}
// Subscribe only the teacher to the mahara group because of lake of efficiency with too big mahara user database (>1000)
// if user is not a mahara user, there will be an error : it's not supposed to be because mahara account is checked before to have a button to go in this page but... but.
if(!$mahara_user->error){
array_push($usersTab,array(
'id'=>$mahara_user[0]->id,
'username'=>$mahara_user[0]->username,
'role'=>"admin",
));
}else{
echo"<p style='color: red;'>You must have a Mahara account to do that.</p>";
die;
}
}
if(count($usersTab)==0){
if(count($usersTab)==0){
...
@@ -109,10 +87,8 @@ if (count($students) == 0) {
...
@@ -109,10 +87,8 @@ if (count($students) == 0) {
));
));
}
}
// var_dump($name_groups);
// die;
if(count($mahara_groups)==0){
if(count($mahara_groups)==0){
echo"<div class=\"alert alert-warning\" role=\"alert\"><p><strong>Erreur : tous les groupes du cours sont vides. </strong></p><p>Pour utiliser cette fonctionnalité, il faut au préalable créer des groupes dans le cours et y ajouter des étudiants ou des enseignants. prout</p></div>";
echo"<div class=\"alert alert-warning\" role=\"alert\"><p><strong>Erreur : vous devez faire partie d'au moins un groupe de ce cours. Inscrivez-vous dans un groupe puis recommencez.</p></div>";