diff --git a/CorsiInterface.php b/CorsiInterface.php new file mode 100644 index 0000000..3941909 --- /dev/null +++ b/CorsiInterface.php @@ -0,0 +1,14 @@ +corsi) / count($this->corsi); } } - -$studente = new Studente(); -$studente->nome = 'Mario'; -$studente->cognome = 'Rossi'; -$studente->email = 'mario.rossi@itspiemonte.it'; -$studente->dataDiNascita = '1/1/1995'; - -$studente->addCorso('Cloud Services'); -$studente->addCorso('PHP Programming'); - -$studente->addVotoEsame('Cloud Services', 24); -$studente->addVotoEsame('PHP Programming', 26); - -printf("Media voto esami: %.2f\n", $studente->getMediaEsami()); diff --git a/StudenteInterface.php b/StudenteInterface.php new file mode 100644 index 0000000..694a7af --- /dev/null +++ b/StudenteInterface.php @@ -0,0 +1,18 @@ +listToDraw = $listToDraw; + shuffle($this->listToDraw); + } + + + public function makeGroups ($numberOfGroupMembers) : array + { + if(count($this->listToDraw) % $numberOfGroupMembers == 0) + return array_chunk($this->listToDraw, $numberOfGroupMembers); + + else + { + $list = array_chunk($this->listToDraw, $numberOfGroupMembers); + + for($i = 0; $i < count(end($list)); $i++) + array_push($list[$i], end($list)[$i]); + + return $list; + } + } +} \ No newline at end of file diff --git a/drawer-groups/Classes/info.php b/drawer-groups/Classes/info.php new file mode 100644 index 0000000..f0be6ef --- /dev/null +++ b/drawer-groups/Classes/info.php @@ -0,0 +1,15 @@ + + + + + + +
+ + + +