Ciszek

Vulcan kalkulator średniej js console

Jan 17th, 2022 (edited)
672
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Min:
  2. fetch("https://uonetplus-uczen.edu.gdansk.pl/gdansk/sp56/Oceny.mvc/Get", { "headers": { "content-type": "application/json","x-v-requestverificationtoken": "kB1G2hqsOhFzfhOkr7bR1HObdPm58kcBOd-cJcQxxZJzxFUsFc8JU8kSlqr2_Q80e0unXLQj0XCtKzsN92pTqf8qdQs1" }, "body": "{\"okres\":48191}", "method": "POST", "credentials": "include" }).then(response => response.json()) .then(commits => x(commits)); function x(json){ console.log(json); json.data.Oceny.forEach((elem) => { var OcenyS = ""; var WagiS = ""; var Oceny = 0; var Wagi = 0; var x=0; elem.OcenyCzastkowe.forEach((elem) => { if(parseInt(elem.Wpis) <= 6){ Oceny+=parseInt(elem.Wpis)*elem.Waga; Wagi+=elem.Waga; OcenyS+=" | "+parseInt(elem.Wpis); WagiS+=" | "+elem.Waga; x=1; } }); if(x==1){ console.log("----------------------------\n"+elem.Przedmiot.toUpperCase()+"\nOceny:  "+OcenyS+" |\nWagi:   "+WagiS+" |\nŚrednia: | "+parseFloat(Oceny/Wagi)+" |"); } }); }
  3.  
  4. -----------------------------------------------------------------------------------------------------------------------
  5. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  6. -----------------------------------------------------------------------------------------------------------------------
  7.  
  8. Normal:
  9. fetch("https://uonetplus-uczen.edu.gdansk.pl/gdansk/sp56/Oceny.mvc/Get", {
  10.   "headers": {
  11.     "accept": "*/*",
  12.     "accept-language": "pl-PL,pl;q=0.9,en-US;q=0.8,en;q=0.7,be;q=0.6,ug;q=0.5,ja;q=0.4",
  13.     "content-type": "application/json",
  14.     "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"92\"",
  15.     "sec-ch-ua-mobile": "?0",
  16.     "sec-fetch-dest": "empty",
  17.     "sec-fetch-mode": "cors",
  18.     "sec-fetch-site": "same-origin",
  19.     "x-requested-with": "XMLHttpRequest",
  20.     "x-v-appguid": "ce1a8381aacc8ec0b0e3171a2ab75e3b",
  21.     "x-v-appversion": "21.13.0011.48943",
  22.     "x-v-requestverificationtoken": "kB1G2hqsOhFzfhOkr7bR1HObdPm58kcBOd-cJcQxxZJzxFUsFc8JU8kSlqr2_Q80e0unXLQj0XCtKzsN92pTqf8qdQs1"
  23.   },
  24.   "referrer": "https://uonetplus-uczen.edu.gdansk.pl/gdansk/sp56/Start",
  25.   "referrerPolicy": "strict-origin-when-cross-origin",
  26.   "body": "{\"okres\":48191}",
  27.   "method": "POST",
  28.   "mode": "cors",
  29.   "credentials": "include"
  30. }).then(response => response.json())
  31.   .then(commits => x(commits));
  32. function x(json){
  33.   console.log(json);
  34.   json.data.Oceny.forEach((elem) => {
  35.     var OcenyS = "";
  36.     var WagiS = "";
  37.     var Oceny = 0;
  38.     var Wagi = 0;
  39.     var x=0;
  40.    
  41.     elem.OcenyCzastkowe.forEach((elem) => {
  42.       if(parseInt(elem.Wpis) <= 6){
  43.         Oceny+=parseInt(elem.Wpis)*elem.Waga;
  44.         Wagi+=elem.Waga;
  45.         OcenyS+=" | "+parseInt(elem.Wpis);
  46.         WagiS+=" | "+elem.Waga;
  47.         x=1;
  48.       }
  49.     });
  50.     if(x==1){
  51.      console.log("----------------------------\n"+elem.Przedmiot.toUpperCase()+"\nOceny:  "+OcenyS+" |\nWagi:   "+WagiS+" |\nŚrednia: | "+parseFloat(Oceny/Wagi)+" |");
  52.     }
  53.    
  54. });
  55. }
RAW Paste Data Copied