nasatlx.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. // @copyright 2014 LInE - http://line.ime.usp.br
  3. $conn = mysql_connect("localhost", "root", "XYZAdminLMDlA00--");
  4. $db = mysql_select_db("moodle2_6_1_2014_02");
  5. //$query_a = mysql_query("select m_course.*, m_nasatlx.course as cid, m_nasatlx.name from m_nasatlx, m_course where m_nasatlx.course = m_course.id");
  6. $query_a = mysql_query("select * from m_nasatlx_resps group by cmid");
  7. $cont = 0;
  8. $cmids = array();
  9. $cmids[30] = "1 - T1";
  10. $cmids[193] = "2.4 - T1";
  11. $cmids[196] = "2.x Desafio - T1";
  12. $cmids[309] = "3.4 - T1";
  13. $cmids[314] = "Discursiva - T1";
  14. $cmids[68] = "1 - T2";
  15. $cmids[203] = "2 - T2";
  16. $cmids[204] = "2 Desafio - T2";
  17. $cmids[321] = "3.4 - T2";
  18. $cmids[324] = "Discursiva - T2";
  19. $cmids[88] = "1 - T3";
  20. $cmids[209] = "2 - T3";
  21. $cmids[215] = "2 Desafio - T3";
  22. $cmids[330] = "3.4 - T3";
  23. $cmids[333] = "Discursiva - T3";
  24. while ($d = mysql_fetch_array($query_a)) {
  25. print $cmids[intVal(strval(($d["cmid"])))]. " " ." - " . intVal(strval(($d["cmid"])))."\n";
  26. $query_r = mysql_query("select * from m_nasatlx_resps where cmid = ".$d["cmid"]." and user > 7");
  27. print "ESCALA";
  28. while($d2 = mysql_fetch_array($query_r)) {
  29. print ";".$d2["user"]."";
  30. }
  31. print "\n";
  32. mysql_data_seek($query_r, 0);
  33. $escalas = array();
  34. for($i=0;$i<6;$i++)
  35. $escalas[] = "scale".($i+1);
  36. for($i=0;$i<6;$i++)
  37. $escalas[] = "peso".($i+1);
  38. for($i=0;$i<6;$i++)
  39. $escalas[] = "calc".($i+1);
  40. foreach($escalas as $e){
  41. mysql_data_seek($query_r, 0);
  42. print $e."";
  43. while($d2 = mysql_fetch_array($query_r)){
  44. print ";".str_replace(".", ",", $d2[$e]);
  45. }
  46. print "\n";
  47. }
  48. /*while($d2 = mysql_fetch_array($query_r)){
  49. print
  50. $d2["scale1"].";".
  51. $d2["scale2"].";".
  52. $d2["scale3"].";".
  53. $d2["scale4"].";".
  54. $d2["scale5"].";".
  55. $d2["scale6"].";";
  56. print
  57. $d2["peso1"].";".
  58. $d2["peso2"].";".
  59. $d2["peso3"].";".
  60. $d2["peso4"].";".
  61. $d2["peso5"].";".
  62. $d2["peso6"].";";
  63. print
  64. $d2["calc1"].";".
  65. $d2["calc2"].";".
  66. $d2["calc3"].";".
  67. $d2["calc4"].";".
  68. $d2["calc5"].";".
  69. $d2["calc6"].";\n";
  70. }*/
  71. }