Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title></title>
- </head>
- <body>
- <?php
- $site = "localhost";
- $user = "sax";
- $pass = "asdf1234";
- $dbname = "preguntas";
- $tbname = "preguntas";
- $dblink = mysqli_connect($site, $user, $pass, $dbname);
- if (mysqli_connect_errno()){
- echo "Fail dood!\n" . mysqli_connect_error();
- exit();
- }
- //ask for something like this $row[14][1];
- //Inicia Quizz
- //Pide grupo inicial
- $cummas = array();
- /*!
- */
- $allas = array();
- $resources = array();
- array_push($resources, mysqli_query($dblink, "SELECT * FROM $tbname WHERE Tier=0"));
- $qs_init = mysqli_fetch_all($resources[0]);
- $as = array(1,3,7,3,6,5,9,8,2,5,7, 5, 8, 2, 9);
- //Muestra grupo inicial
- /* debug
- foreach ($qs_init as $q) {
- echo "$q[1]\n";
- }
- print_r($row);
- */
- //Multiply por Ponderación
- for ($i=0; $i < sizeof($as); $i++) {
- $temp = array();
- array_push($temp, $qs_init[$i][1]);
- array_push($temp, $as[$i] * $qs_init[$i][2]);
- array_push($temp, $as[$i] * $qs_init[$i][3]);
- array_push($temp, $as[$i] * $qs_init[$i][4]);
- array_push($allas, $temp);
- }
- //calcular y mostrar porcentaje de preguntas
- //pedir siguiente tier
- //mostrar siguiente tier
- //muestra tier nuevo
- //sumar y mostrar resultados0
- //graph
- for ($i=0; $i < 15 ; $i++) {
- echo $allas[$i][0], "<br><br>";
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement