<?php

session_start();
require_once('../../BDD/SqliteDb.php');

$db = new SqliteDb('save');
    

if(!isset($_GET['tp'])){
    $query = $db->prepare('SELECT count(*) FROM Qcm ');
    $result = $query->execute();
    $r = $result->fetchArray();

    for($numQcm = 1 ; $numQcm <= $r['count(*)'] ; $numQcm++){
        $db->ecrireFichierNotes($numQcm,'save',"qcm");
    }
}
else {
    $query = $db->prepare('SELECT DISTINCT numTp FRom type');
    $result = $query->execute();


    //$rows = $result->numRows(); 


    while($r =$result->fetchArray() ){
        $db->ecrireFichierNotes($r['numTp'],'save',"tp");
    }

}



