1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
| <html>
<body>
<?php
function clearDir($dossier) {
$ouverture=@opendir($dossier);
if (!$ouverture) return;
while($fichier=readdir($ouverture)) {
if ($fichier == '.' || $fichier == '..') continue;
if (is_dir($dossier."/".$fichier)) {
$r=clearDir($dossier."/".$fichier);
if (!$r) return false;
}
else {
$r=@unlink($dossier."/".$fichier);
if (!$r) return false;
}
}
closedir($ouverture);
$r=@rmdir($dossier);
@rename($dossier,"trash");
return true;
}
?>
<?php session_start(); ?>
<?php
if(isset($_REQUEST['nomcours']))
{
$_SESSION['nomcours']=$_REQUEST['nomcours'];
?>
<p><div align="right"><a href="quitter.php">quitter</a></div><div align="left"><?php echo "nom de votre cours: <b>".$_SESSION['nomcours']."</b>";?></div></div> </p><br>
<?php
$nomcours=$_REQUEST['nomcours'];
$xml="<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!--This is a FSB version 1.0 SCORM 1.2 Content Package document-->
<!--Spawned from the FSB Content Package Generator - http://http://www.univh2m.ac.ma/-->
<manifest xmlns=\"http://www.imsproject.org/xsd/imscp_rootv1p1p2\" xmlns:imsmd=\"http://www.imsglobal.org/xsd/imsmd_rootv1p2p1\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:adlcp=\"http://www.adlnet.org/xsd/adlcp_rootv1p2\" identifier=\"testscorm\" xsi:schemaLocation=\"http://www.imsproject.org/xsd/imscp_rootv1p1p2 imscp_rootv1p1p2.xsd http://www.imsglobal.org/xsd/imsmd_rootv1p2p1 imsmd_rootv1p2p1.xsd http://www.adlnet.org/xsd/adlcp_rootv1p2 adlcp_rootv1p2.xsd\">
<organizations />
<resources />
</manifest>
";
$dom=new DomDocument();
$dom->loadXML($xml);
$orgs=$dom->getElementsByTagName('organizations')->item(0);
$orgs->setAttribute('default',$nomcours);
/************************************/
$org=$dom->createElement('organization');
$org->setAttribute('identifier',$nomcours);
$org->setAttribute('structure','hierarchical');
$orgs->appendChild($org);
$title_org=$dom->createElement('title');
$text_title_org=$dom->createTextNode($nomcours);
$title_org->appendChild($text_title_org);
$org->appendChild($title_org);
clearDir($nomcours);
mkdir($nomcours);
$str=$dom->save($nomcours.'/imsmanifest.xml');
echo "l7amdolilah";
}
$nombrechapitres=intval($_REQUEST['nombrechapitres']);
$_SESSION['nombrechapitres']=$nombrechapitres;
?>
<form action="paragraphe2.php" method="get">
<table border="1" >
<tr><td>CHAPITRE</td><td>Nombre de PARAGRAPHES</td></tr>
<?php
$nombrechapitres=intval($_REQUEST['nombrechapitres']);
$_SESSION['nombrechapitres']=$nombrechapitres;
for($j=1; $j<=$nombrechapitres; $j++)
{
?>
<tr><td><?=$j?>-<input type="text" name="chap<?=$j?>" value="chapitre <?=$j?>"></td> <td> <select name="nombreparagraphes<?=$j?>" >
<option value="1" selected> 1</option>
<?php
for($i=2; $i<=10; $i++)
{
?>
<option value=<?= $i?> > <?= $i ?> </option>
<?php
}
?>
</select>
</td></tr>
<?php
}
?>
<SCRIPT LANGUAGE="JavaScript">
document.location.href="page1.html"
</SCRIPT>
</table>
<input type="submit" value="ok">
</form>
</body>
</html> |
Partager