Guest User

Untitled

a guest
Jan 21st, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>The Wammi Results</title>
  4. <!-- <link rel="stylesheet" type="text/css" href="style.css"> //-->
  5. </head>
  6. <body>
  7. <h1>Wammi results</h1>
  8. <p>The Wammi questionnaire had the following results</p>
  9. <table border="1">
  10. <tr>
  11. <th>wammi factor</th>
  12. <th>mean</th>
  13. <th>std. dev.</th>
  14. </tr>
  15. <?php
  16. /************************************
  17. * verbinding maken met de database *
  18. * *
  19. * opdracht 9a *
  20. ************************************/
  21. $server = "localhost";
  22. $username = "root";
  23. $password = "";
  24. mysql_connect($server, $username, $password);
  25.  
  26. $dbname = "wammi";
  27. mysql_select_db($dbname);
  28.  
  29. /********************************
  30. * query opstellen en uitvoeren *
  31. * *
  32. * opdracht 9b *
  33. ********************************/
  34.  
  35.  
  36. $query = "SELECT avg(rating.score), std(rating.score)
  37. FROM rating, wammifactor, statement
  38. WHERE wammifactor.factorcode = statement.factorcode AND statement.statementcode = rating.statementcode
  39. GROUP BY wammifactor.name;";
  40.  
  41. echo $query;
  42. $result = mysql_query($query); // de query wordt uitgevoerd en de uitkomst wordt in $result gezet.
  43.  
  44. /**********************************
  45. * resultaten op het scherm tonen *
  46. * *
  47. * opdracht 9c *
  48. **********************************/
  49.  
  50. $totalescore = 0; // nodig om global usability uit te rekenen
  51. $aantalfactoren = 0; // nodig om global usability uit te rekenen
  52.  
  53. echo "<table>";
  54. while($row = mysql_fetch_array($result)) // Dit is een loop die rij voor rij het resultaat afgaat. De loop blijft doorgaan totdat er geen rijen meer zijn. De resultaten worden in de array $row gezet.
  55. {
  56. $aantalfactoren = $aantalfactoren + 1; // Voor iedere rij wordt er 1 bij dit getal opgeteld. Dit is nodig om global usability uit te rekenen
  57. $totalescore = $totalescore + $row['AVG(score)']; // Voor iedere rij wordt de score bij dit getal opgeteld. Dit is nodig om global usability uit te rekenen
  58.  
  59. $name = $row['name']; // De naam van de wammifactor
  60. $score = $row['AVG(score)']; // De score van deze wammifactor
  61. $std = $row['STD(score)']; // De standaard deviatie van deze score
  62.  
  63. // zet je code voor opdracht 9c hier
  64. // de variabelen die je hier gebruikt heten $name, $score en $std
  65. echo "<tr>
  66. <td>".$name."</td>
  67. <td>".$score."</td>
  68. <td>".$std."</td>
  69. </tr>";
  70. }
  71. echo "</table>";
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81. /****************************************
  82. * global usability op het scherm tonen *
  83. * *
  84. * opdracht 9d *
  85. ****************************************/
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93. ?>
  94. </table>
  95. <h3>Mean</h3>
  96. <p>This is the numerical average of the individual scores your users have rated you at</p>
  97. <h3>Standard deviation</h3>
  98. <p>The standard deviation expresses the amount of variability in your data. If all your users are agreed on their evaluations of your website, the standard deviations will be smaller. If your users have divergent opinions, the standard deviations will be much greater. It is not uncommon to find that the standard deviations are larger for some scales than for others. This indicates that there are differences in the amount of agreement between users about these scales</p>
  99. </body>
  100. </html>
Add Comment
Please, Sign In to add comment