mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-01-31 15:28:20 +01:00
API improvements (#13)
This commit is contained in:
parent
3d6515bcf2
commit
0ea13cdadd
@ -19,7 +19,6 @@ import java.util.Map;
|
|||||||
import io.github.wulkanowy.R;
|
import io.github.wulkanowy.R;
|
||||||
import io.github.wulkanowy.api.Cookies;
|
import io.github.wulkanowy.api.Cookies;
|
||||||
import io.github.wulkanowy.api.StudentAndParent;
|
import io.github.wulkanowy.api.StudentAndParent;
|
||||||
import io.github.wulkanowy.api.grades.Grades;
|
|
||||||
import io.github.wulkanowy.api.grades.GradesList;
|
import io.github.wulkanowy.api.grades.GradesList;
|
||||||
import io.github.wulkanowy.api.grades.Subject;
|
import io.github.wulkanowy.api.grades.Subject;
|
||||||
import io.github.wulkanowy.api.grades.SubjectsList;
|
import io.github.wulkanowy.api.grades.SubjectsList;
|
||||||
@ -93,8 +92,8 @@ public class MarksFragment extends Fragment {
|
|||||||
Account account = accountsDatabase.getAccount(mContext.getSharedPreferences("LoginData", mContext.MODE_PRIVATE).getLong("isLogin", 0));
|
Account account = accountsDatabase.getAccount(mContext.getSharedPreferences("LoginData", mContext.MODE_PRIVATE).getLong("isLogin", 0));
|
||||||
accountsDatabase.close();
|
accountsDatabase.close();
|
||||||
|
|
||||||
StudentAndParent snp = new StudentAndParent(cookies, account.getCounty()).setUp();
|
StudentAndParent snp = new StudentAndParent(cookies, account.getCounty());
|
||||||
SubjectsList subjectsList = new SubjectsList(snp.getCookiesObject(), snp);
|
SubjectsList subjectsList = new SubjectsList(snp);
|
||||||
|
|
||||||
SubjectsDatabase subjectsDatabase = new SubjectsDatabase(mContext);
|
SubjectsDatabase subjectsDatabase = new SubjectsDatabase(mContext);
|
||||||
subjectsDatabase.open();
|
subjectsDatabase.open();
|
||||||
@ -106,8 +105,7 @@ public class MarksFragment extends Fragment {
|
|||||||
subjectsName.add(subject.getName());
|
subjectsName.add(subject.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
Grades gradesObject = new Grades(snp.getCookiesObject(), snp);
|
GradesList gradesList = new GradesList(snp);
|
||||||
GradesList gradesList = new GradesList(gradesObject, snp);
|
|
||||||
GradesDatabase gradesDatabase = new GradesDatabase(mContext);
|
GradesDatabase gradesDatabase = new GradesDatabase(mContext);
|
||||||
gradesDatabase.open();
|
gradesDatabase.open();
|
||||||
gradesDatabase.put(gradesList.getAll());
|
gradesDatabase.put(gradesList.getAll());
|
||||||
|
@ -22,7 +22,6 @@ import io.github.wulkanowy.api.login.Login;
|
|||||||
import io.github.wulkanowy.api.login.LoginErrorException;
|
import io.github.wulkanowy.api.login.LoginErrorException;
|
||||||
import io.github.wulkanowy.api.user.BasicInformation;
|
import io.github.wulkanowy.api.user.BasicInformation;
|
||||||
import io.github.wulkanowy.api.user.PersonalData;
|
import io.github.wulkanowy.api.user.PersonalData;
|
||||||
import io.github.wulkanowy.api.user.User;
|
|
||||||
import io.github.wulkanowy.database.accounts.Account;
|
import io.github.wulkanowy.database.accounts.Account;
|
||||||
import io.github.wulkanowy.database.accounts.AccountsDatabase;
|
import io.github.wulkanowy.database.accounts.AccountsDatabase;
|
||||||
import io.github.wulkanowy.security.CryptoException;
|
import io.github.wulkanowy.security.CryptoException;
|
||||||
@ -80,9 +79,8 @@ public class LoginTask extends AsyncTask<String, Integer, Integer> {
|
|||||||
if (save) {
|
if (save) {
|
||||||
try {
|
try {
|
||||||
StudentAndParent snp = new StudentAndParent(login.getCookiesObject(),
|
StudentAndParent snp = new StudentAndParent(login.getCookiesObject(),
|
||||||
credentials[2]).setUp();
|
credentials[2]);
|
||||||
User user = new User(snp.getCookiesObject(), snp);
|
BasicInformation userInfo = new BasicInformation(snp);
|
||||||
BasicInformation userInfo = new BasicInformation(user, snp);
|
|
||||||
PersonalData personalData = userInfo.getPersonalData();
|
PersonalData personalData = userInfo.getPersonalData();
|
||||||
String firstAndLastName = personalData.getFirstAndLastName();
|
String firstAndLastName = personalData.getFirstAndLastName();
|
||||||
|
|
||||||
|
@ -9,8 +9,6 @@ import org.jsoup.select.Elements;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
import io.github.wulkanowy.api.login.LoginErrorException;
|
import io.github.wulkanowy.api.login.LoginErrorException;
|
||||||
|
|
||||||
@ -18,32 +16,22 @@ public class StudentAndParent extends Vulcan {
|
|||||||
|
|
||||||
private String startPageUrl = "https://uonetplus.vulcan.net.pl/{locationID}/Start.mvc/Index";
|
private String startPageUrl = "https://uonetplus.vulcan.net.pl/{locationID}/Start.mvc/Index";
|
||||||
|
|
||||||
private String gradesPageUrl = "https://uonetplus-opiekun.vulcan.net.pl/{locationID}/{ID}/"
|
private String baseUrl = "https://uonetplus-opiekun.vulcan.net.pl/{locationID}/{ID}/";
|
||||||
+ "Oceny/Wszystkie";
|
|
||||||
|
private String gradesPageUrl = baseUrl + "Oceny/Wszystkie";
|
||||||
|
|
||||||
private String locationID = "";
|
private String locationID = "";
|
||||||
|
|
||||||
private String uonetPlusOpiekunUrl = "";
|
private String id = "";
|
||||||
|
|
||||||
public StudentAndParent(Cookies cookies, String locID) throws IOException {
|
public StudentAndParent(Cookies cookies, String locID) throws IOException, LoginErrorException {
|
||||||
this.cookies = cookies;
|
this.cookies = cookies;
|
||||||
this.locationID = locID;
|
this.locationID = locID;
|
||||||
}
|
|
||||||
|
|
||||||
public String getGradesPageUrl() {
|
|
||||||
return gradesPageUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public StudentAndParent setUp() throws IOException {
|
|
||||||
startPageUrl = startPageUrl.replace("{locationID}", locationID);
|
|
||||||
|
|
||||||
// get link to uonetplus-opiekun.vulcan.net.pl module
|
// get link to uonetplus-opiekun.vulcan.net.pl module
|
||||||
Document startPage = Jsoup.connect(startPageUrl)
|
Document startPage = getPageByUrl(startPageUrl.replace("{locationID}", locationID));
|
||||||
.followRedirects(true)
|
|
||||||
.cookies(getCookies())
|
|
||||||
.get();
|
|
||||||
Element studentTileLink = startPage.select(".panel.linkownia.pracownik.klient > a").first();
|
Element studentTileLink = startPage.select(".panel.linkownia.pracownik.klient > a").first();
|
||||||
uonetPlusOpiekunUrl = studentTileLink.attr("href");
|
String uonetPlusOpiekunUrl = studentTileLink.attr("href");
|
||||||
|
|
||||||
//get context module cookie
|
//get context module cookie
|
||||||
Connection.Response res = Jsoup.connect(uonetPlusOpiekunUrl)
|
Connection.Response res = Jsoup.connect(uonetPlusOpiekunUrl)
|
||||||
@ -53,39 +41,42 @@ public class StudentAndParent extends Vulcan {
|
|||||||
|
|
||||||
cookies.addItems(res.cookies());
|
cookies.addItems(res.cookies());
|
||||||
|
|
||||||
return this;
|
this.id = getCalculatedID(uonetPlusOpiekunUrl);
|
||||||
|
this.baseUrl = baseUrl
|
||||||
|
.replace("{locationID}", getLocationID())
|
||||||
|
.replace("{ID}", getID());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLocationID() {
|
public String getLocationID() {
|
||||||
return locationID;
|
return locationID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getID() throws LoginErrorException {
|
public String getID() {
|
||||||
Pattern pattern = Pattern.compile("([0-9]{6})");
|
return id;
|
||||||
Matcher matcher = pattern.matcher(uonetPlusOpiekunUrl);
|
}
|
||||||
|
|
||||||
// Finds all the matches until found by moving the `matcher` forward
|
public String getCalculatedID(String uonetPlusOpiekunUrl) throws LoginErrorException {
|
||||||
if (!matcher.find()) {
|
String[] path = uonetPlusOpiekunUrl.split("vulcan.net.pl/")[1].split("/");
|
||||||
|
|
||||||
|
if (4 != path.length) {
|
||||||
throw new LoginErrorException();
|
throw new LoginErrorException();
|
||||||
}
|
}
|
||||||
|
|
||||||
String match = matcher.group(1);
|
return path[1];
|
||||||
|
|
||||||
return match;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRowDataChildValue(Element e, int index) {
|
public String getRowDataChildValue(Element e, int index) {
|
||||||
return e.select(".daneWiersz .wartosc").get(index - 1).text();
|
Elements es = e.select(".daneWiersz .wartosc");
|
||||||
|
|
||||||
|
return es.get(index - 1).text();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Semester> getSemesters() throws IOException, LoginErrorException {
|
public Document getSnPPageDocument(String url) throws IOException {
|
||||||
String url = getGradesPageUrl();
|
return getPageByUrl(baseUrl + url);
|
||||||
url = url.replace("{locationID}", getLocationID());
|
}
|
||||||
url = url.replace("{ID}", getID());
|
|
||||||
|
|
||||||
Document gradesPage = getPageByUrl(url);
|
public List<Semester> getSemesters() throws IOException {
|
||||||
|
return getSemesters(getSnPPageDocument(gradesPageUrl));
|
||||||
return getSemesters(gradesPage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Semester> getSemesters(Document gradesPage) {
|
public List<Semester> getSemesters(Document gradesPage) {
|
||||||
@ -108,8 +99,7 @@ public class StudentAndParent extends Vulcan {
|
|||||||
return semesters;
|
return semesters;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Semester getCurrentSemester(List<Semester> semesterList)
|
public Semester getCurrentSemester(List<Semester> semesterList) {
|
||||||
throws IOException, LoginErrorException {
|
|
||||||
Semester current = null;
|
Semester current = null;
|
||||||
for (Semester s : semesterList) {
|
for (Semester s : semesterList) {
|
||||||
if (s.isCurrent()) {
|
if (s.isCurrent()) {
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
package io.github.wulkanowy.api.grades;
|
|
||||||
|
|
||||||
import org.jsoup.nodes.Document;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import io.github.wulkanowy.api.Cookies;
|
|
||||||
import io.github.wulkanowy.api.StudentAndParent;
|
|
||||||
import io.github.wulkanowy.api.Vulcan;
|
|
||||||
import io.github.wulkanowy.api.login.LoginErrorException;
|
|
||||||
|
|
||||||
public class Grades extends Vulcan {
|
|
||||||
|
|
||||||
private StudentAndParent snp = null;
|
|
||||||
|
|
||||||
public Grades(Cookies cookies, StudentAndParent snp) {
|
|
||||||
this.cookies = cookies;
|
|
||||||
this.snp = snp;
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO: move to snp
|
|
||||||
public Document getGradesPageDocument(String url) throws IOException, LoginErrorException {
|
|
||||||
return getPageByUrl(url
|
|
||||||
.replace("{locationID}", snp.getLocationID())
|
|
||||||
.replace("{ID}", snp.getID())
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -17,16 +17,13 @@ import io.github.wulkanowy.api.login.LoginErrorException;
|
|||||||
|
|
||||||
public class GradesList extends Vulcan {
|
public class GradesList extends Vulcan {
|
||||||
|
|
||||||
private Grades grades = null;
|
|
||||||
private StudentAndParent snp = null;
|
private StudentAndParent snp = null;
|
||||||
|
|
||||||
private String gradesPageUrl = "https://uonetplus-opiekun.vulcan.net.pl/{locationID}/{ID}"
|
private String gradesPageUrl = "Oceny/Wszystkie?details=2&okres=";
|
||||||
+ "/Oceny/Wszystkie?details=2&okres=";
|
|
||||||
|
|
||||||
private List<Grade> gradesList = new ArrayList<>();
|
private List<Grade> grades = new ArrayList<>();
|
||||||
|
|
||||||
public GradesList(Grades grades, StudentAndParent snp) {
|
public GradesList(StudentAndParent snp) {
|
||||||
this.grades = grades;
|
|
||||||
this.snp = snp;
|
this.snp = snp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,7 +36,7 @@ public class GradesList extends Vulcan {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<Grade> getAll(String semester) throws IOException, LoginErrorException {
|
public List<Grade> getAll(String semester) throws IOException, LoginErrorException {
|
||||||
Document gradesPage = grades.getGradesPageDocument(getGradesPageUrl() + semester);
|
Document gradesPage = snp.getSnPPageDocument(getGradesPageUrl() + semester);
|
||||||
Elements gradesRows = gradesPage.select(".ocenySzczegoly-table > tbody > tr");
|
Elements gradesRows = gradesPage.select(".ocenySzczegoly-table > tbody > tr");
|
||||||
Semester currentSemester = snp.getCurrentSemester(snp.getSemesters(gradesPage));
|
Semester currentSemester = snp.getCurrentSemester(snp.getSemesters(gradesPage));
|
||||||
|
|
||||||
@ -57,7 +54,7 @@ public class GradesList extends Vulcan {
|
|||||||
.attr("style"));
|
.attr("style"));
|
||||||
String color = matcher.find() ? matcher.group(1) : "";
|
String color = matcher.find() ? matcher.group(1) : "";
|
||||||
|
|
||||||
gradesList.add(new Grade()
|
grades.add(new Grade()
|
||||||
.setSubject(row.select("td:nth-child(1)").text())
|
.setSubject(row.select("td:nth-child(1)").text())
|
||||||
.setValue(row.select("td:nth-child(2)").text())
|
.setValue(row.select("td:nth-child(2)").text())
|
||||||
.setColor(color)
|
.setColor(color)
|
||||||
@ -70,6 +67,6 @@ public class GradesList extends Vulcan {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return gradesList;
|
return grades;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,11 +10,11 @@ public class Subject {
|
|||||||
|
|
||||||
private String finalRating;
|
private String finalRating;
|
||||||
|
|
||||||
public int getId(){
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Subject setId(int id){
|
public Subject setId(int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
@ -8,7 +8,6 @@ import java.io.IOException;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import io.github.wulkanowy.api.Cookies;
|
|
||||||
import io.github.wulkanowy.api.StudentAndParent;
|
import io.github.wulkanowy.api.StudentAndParent;
|
||||||
import io.github.wulkanowy.api.Vulcan;
|
import io.github.wulkanowy.api.Vulcan;
|
||||||
import io.github.wulkanowy.api.login.LoginErrorException;
|
import io.github.wulkanowy.api.login.LoginErrorException;
|
||||||
@ -17,29 +16,24 @@ public class SubjectsList extends Vulcan {
|
|||||||
|
|
||||||
private StudentAndParent snp = null;
|
private StudentAndParent snp = null;
|
||||||
|
|
||||||
private String subjectsPageUrl =
|
private String subjectsPageUrl = "Oceny/Wszystkie?details=1";
|
||||||
"https://uonetplus-opiekun.vulcan.net.pl/{locationID}/{ID}/Oceny/Wszystkie?details=1";
|
|
||||||
|
|
||||||
private List<Subject> subjects = new ArrayList<>();
|
private List<Subject> subjects = new ArrayList<>();
|
||||||
|
|
||||||
public SubjectsList(Cookies cookies, StudentAndParent snp) {
|
public SubjectsList(StudentAndParent snp) {
|
||||||
this.cookies = cookies;
|
|
||||||
this.snp = snp;
|
this.snp = snp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Subject> getAll() throws IOException, LoginErrorException {
|
public List<Subject> getAll() throws IOException, LoginErrorException {
|
||||||
subjectsPageUrl = subjectsPageUrl.replace("{locationID}", snp.getLocationID());
|
Document subjectPage = snp.getSnPPageDocument(subjectsPageUrl);
|
||||||
subjectsPageUrl = subjectsPageUrl.replace("{ID}", snp.getID());
|
|
||||||
|
|
||||||
Document subjectPage = getPageByUrl(subjectsPageUrl);
|
|
||||||
|
|
||||||
Elements rows = subjectPage.select(".ocenyZwykle-table > tbody > tr");
|
Elements rows = subjectPage.select(".ocenyZwykle-table > tbody > tr");
|
||||||
|
|
||||||
for (Element subjectRow : rows) {
|
for (Element subjectRow : rows) {
|
||||||
subjects.add(new Subject()
|
subjects.add(new Subject()
|
||||||
.setName(subjectRow.select("td:nth-child(1)").text())
|
.setName(subjectRow.select("td:nth-child(1)").text())
|
||||||
.setPredictedRating(subjectRow.select("td:nth-child(3)").text())
|
.setPredictedRating(subjectRow.select("td:nth-last-child(2)").text())
|
||||||
.setFinalRating(subjectRow.select("td:nth-child(4)").text())
|
.setFinalRating(subjectRow.select("td:nth-last-child(1)").text())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,11 +13,10 @@ public class Login extends Vulcan {
|
|||||||
|
|
||||||
private String loginPageUrl = "https://cufs.vulcan.net.pl/{locationID}/Account/LogOn";
|
private String loginPageUrl = "https://cufs.vulcan.net.pl/{locationID}/Account/LogOn";
|
||||||
|
|
||||||
private String certificatePageUrl =
|
private String certificatePageUrl = "https://cufs.vulcan.net.pl/{locationID}"
|
||||||
"https://cufs.vulcan.net.pl/"
|
+ "/FS/LS?wa=wsignin1.0&wtrealm=https://uonetplus.vulcan.net.pl/{locationID}"
|
||||||
+ "{locationID}/FS/LS?wa=wsignin1.0&wtrealm=https://uonetplus.vulcan.net.pl/"
|
+ "/LoginEndpoint.aspx&wctx=https://uonetplus.vulcan.net.pl/{locationID}"
|
||||||
+ "{locationID}/LoginEndpoint.aspx&wctx=https://uonetplus.vulcan.net.pl/"
|
+ "/LoginEndpoint.aspx";
|
||||||
+ "{locationID}/LoginEndpoint.aspx";
|
|
||||||
|
|
||||||
private String loginEndpointPageUrl =
|
private String loginEndpointPageUrl =
|
||||||
"https://uonetplus.vulcan.net.pl/{locationID}/LoginEndpoint.aspx";
|
"https://uonetplus.vulcan.net.pl/{locationID}/LoginEndpoint.aspx";
|
||||||
@ -60,9 +59,7 @@ public class Login extends Vulcan {
|
|||||||
private String[] getCertificateData(String county) throws IOException {
|
private String[] getCertificateData(String county) throws IOException {
|
||||||
certificatePageUrl = certificatePageUrl.replace("{locationID}", county);
|
certificatePageUrl = certificatePageUrl.replace("{locationID}", county);
|
||||||
|
|
||||||
Document certificatePage = Jsoup.connect(certificatePageUrl)
|
Document certificatePage = getPageByUrl(certificatePageUrl);
|
||||||
.cookies(getCookies())
|
|
||||||
.get();
|
|
||||||
|
|
||||||
return new String[]{
|
return new String[]{
|
||||||
certificatePage.select("input[name=wa]").attr("value"),
|
certificatePage.select("input[name=wa]").attr("value"),
|
||||||
|
@ -7,20 +7,24 @@ import java.io.IOException;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.github.wulkanowy.api.StudentAndParent;
|
||||||
import io.github.wulkanowy.api.login.LoginErrorException;
|
import io.github.wulkanowy.api.login.LoginErrorException;
|
||||||
|
|
||||||
public class AchievementsList {
|
public class AchievementsList {
|
||||||
|
|
||||||
private Notes notes = null;
|
private StudentAndParent snp = null;
|
||||||
|
|
||||||
private List<String> achievementsList = new ArrayList<>();
|
private List<String> achievementsList = new ArrayList<>();
|
||||||
|
|
||||||
public AchievementsList(Notes notes) {
|
private String notesPageUrl = "UwagiOsiagniecia.mvc/Wszystkie";
|
||||||
this.notes = notes;
|
|
||||||
|
public AchievementsList(StudentAndParent snp) {
|
||||||
|
this.snp = snp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getAllAchievements() throws LoginErrorException, IOException {
|
public List<String> getAllAchievements() throws LoginErrorException, IOException {
|
||||||
Element pageFragment = notes.getNotesPageDocument().select(".mainContainer > div").get(1);
|
Element pageFragment = snp.getSnPPageDocument(notesPageUrl)
|
||||||
|
.select(".mainContainer > div").get(1);
|
||||||
Elements items = pageFragment.select("article");
|
Elements items = pageFragment.select("article");
|
||||||
|
|
||||||
for (Element item : items) {
|
for (Element item : items) {
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
package io.github.wulkanowy.api.notes;
|
|
||||||
|
|
||||||
import org.jsoup.Jsoup;
|
|
||||||
import org.jsoup.nodes.Document;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import io.github.wulkanowy.api.Cookies;
|
|
||||||
import io.github.wulkanowy.api.StudentAndParent;
|
|
||||||
import io.github.wulkanowy.api.Vulcan;
|
|
||||||
import io.github.wulkanowy.api.login.LoginErrorException;
|
|
||||||
|
|
||||||
public class Notes extends Vulcan {
|
|
||||||
|
|
||||||
private StudentAndParent snp = null;
|
|
||||||
|
|
||||||
private String notesPageUrl = "https://uonetplus-opiekun.vulcan.net.pl/{locationID}/{ID}/"
|
|
||||||
+ "UwagiOsiagniecia.mvc/Wszystkie";
|
|
||||||
|
|
||||||
public Notes(Cookies cookies, StudentAndParent snp) {
|
|
||||||
this.cookies = cookies;
|
|
||||||
this.snp = snp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Document getNotesPageDocument() throws IOException, LoginErrorException {
|
|
||||||
notesPageUrl = notesPageUrl.replace("{locationID}", snp.getLocationID());
|
|
||||||
notesPageUrl = notesPageUrl.replace("{ID}", snp.getID());
|
|
||||||
|
|
||||||
return Jsoup.connect(notesPageUrl)
|
|
||||||
.cookies(getCookies())
|
|
||||||
.get();
|
|
||||||
}
|
|
||||||
}
|
|
@ -12,18 +12,19 @@ import io.github.wulkanowy.api.login.LoginErrorException;
|
|||||||
|
|
||||||
public class NotesList {
|
public class NotesList {
|
||||||
|
|
||||||
private Notes notes = null;
|
|
||||||
private StudentAndParent snp = null;
|
private StudentAndParent snp = null;
|
||||||
|
|
||||||
private List<Note> notesList = new ArrayList<>();
|
private List<Note> notesList = new ArrayList<>();
|
||||||
|
|
||||||
public NotesList(Notes notes, StudentAndParent snp) {
|
private String notesPageUrl = "UwagiOsiagniecia.mvc/Wszystkie";
|
||||||
this.notes = notes;
|
|
||||||
|
public NotesList(StudentAndParent snp) {
|
||||||
this.snp = snp;
|
this.snp = snp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Note> getAllNotes() throws LoginErrorException, IOException {
|
public List<Note> getAllNotes() throws LoginErrorException, IOException {
|
||||||
Element pageFragment = notes.getNotesPageDocument().select(".mainContainer > div").get(0);
|
Element pageFragment = snp.getSnPPageDocument(notesPageUrl)
|
||||||
|
.select(".mainContainer > div").get(0);
|
||||||
Elements items = pageFragment.select("article");
|
Elements items = pageFragment.select("article");
|
||||||
Elements dates = pageFragment.select("h2");
|
Elements dates = pageFragment.select("h2");
|
||||||
|
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
package io.github.wulkanowy.api.school;
|
|
||||||
|
|
||||||
import org.jsoup.Jsoup;
|
|
||||||
import org.jsoup.nodes.Document;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import io.github.wulkanowy.api.Cookies;
|
|
||||||
import io.github.wulkanowy.api.StudentAndParent;
|
|
||||||
import io.github.wulkanowy.api.Vulcan;
|
|
||||||
import io.github.wulkanowy.api.login.LoginErrorException;
|
|
||||||
|
|
||||||
public class School extends Vulcan {
|
|
||||||
private StudentAndParent snp = null;
|
|
||||||
|
|
||||||
private String schoolPageUrl = "https://uonetplus-opiekun.vulcan.net.pl/{locationID}/{ID}/"
|
|
||||||
+ "Szkola.mvc/Nauczyciele";
|
|
||||||
|
|
||||||
public School(Cookies cookies, StudentAndParent snp) {
|
|
||||||
this.cookies = cookies;
|
|
||||||
this.snp = snp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Document getSchoolPageDocument() throws IOException, LoginErrorException {
|
|
||||||
schoolPageUrl = schoolPageUrl.replace("{locationID}", snp.getLocationID());
|
|
||||||
schoolPageUrl = schoolPageUrl.replace("{ID}", snp.getID());
|
|
||||||
|
|
||||||
return Jsoup.connect(schoolPageUrl)
|
|
||||||
.cookies(getCookies())
|
|
||||||
.get();
|
|
||||||
}
|
|
||||||
}
|
|
@ -10,16 +10,17 @@ import io.github.wulkanowy.api.login.LoginErrorException;
|
|||||||
|
|
||||||
public class SchoolInfo extends Vulcan {
|
public class SchoolInfo extends Vulcan {
|
||||||
|
|
||||||
private School school = null;
|
|
||||||
private StudentAndParent snp = null;
|
private StudentAndParent snp = null;
|
||||||
|
|
||||||
public SchoolInfo(School school, StudentAndParent snp) {
|
private String schoolPageUrl = "Szkola.mvc/Nauczyciele";
|
||||||
this.school = school;
|
|
||||||
|
public SchoolInfo(StudentAndParent snp) {
|
||||||
this.snp = snp;
|
this.snp = snp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SchoolData getSchoolData() throws IOException, LoginErrorException {
|
public SchoolData getSchoolData() throws IOException, LoginErrorException {
|
||||||
Element e = school.getSchoolPageDocument().select(".mainContainer > article").get(0);
|
Element e = snp.getSnPPageDocument(schoolPageUrl)
|
||||||
|
.select(".mainContainer > article").get(0);
|
||||||
|
|
||||||
return new SchoolData()
|
return new SchoolData()
|
||||||
.setName(snp.getRowDataChildValue(e, 1))
|
.setName(snp.getRowDataChildValue(e, 1))
|
||||||
|
@ -8,19 +8,22 @@ import java.io.IOException;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.github.wulkanowy.api.StudentAndParent;
|
||||||
import io.github.wulkanowy.api.Vulcan;
|
import io.github.wulkanowy.api.Vulcan;
|
||||||
import io.github.wulkanowy.api.login.LoginErrorException;
|
import io.github.wulkanowy.api.login.LoginErrorException;
|
||||||
|
|
||||||
public class TeachersInfo extends Vulcan {
|
public class TeachersInfo extends Vulcan {
|
||||||
|
|
||||||
private School school = null;
|
private StudentAndParent snp = null;
|
||||||
|
|
||||||
public TeachersInfo(School school) {
|
private String schoolPageUrl = "Szkola.mvc/Nauczyciele";
|
||||||
this.school = school;
|
|
||||||
|
public TeachersInfo(StudentAndParent snp) {
|
||||||
|
this.snp = snp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TeachersData getTeachersData() throws IOException, LoginErrorException {
|
public TeachersData getTeachersData() throws IOException, LoginErrorException {
|
||||||
Document doc = school.getSchoolPageDocument();
|
Document doc = snp.getSnPPageDocument(schoolPageUrl);
|
||||||
Elements rows = doc.select(".mainContainer > table tbody tr");
|
Elements rows = doc.select(".mainContainer > table tbody tr");
|
||||||
String description = doc.select(".mainContainer > p").first().text();
|
String description = doc.select(".mainContainer > p").first().text();
|
||||||
|
|
||||||
|
@ -3,23 +3,37 @@ package io.github.wulkanowy.api.timetable;
|
|||||||
public class Lesson {
|
public class Lesson {
|
||||||
|
|
||||||
public static final String CLASS_PLANNING = "x-treelabel-ppl";
|
public static final String CLASS_PLANNING = "x-treelabel-ppl";
|
||||||
|
|
||||||
public static final String CLASS_REALIZED = "x-treelabel-rlz";
|
public static final String CLASS_REALIZED = "x-treelabel-rlz";
|
||||||
|
|
||||||
public static final String CLASS_MOVED_OR_CANCELED = "x-treelabel-inv";
|
public static final String CLASS_MOVED_OR_CANCELED = "x-treelabel-inv";
|
||||||
|
|
||||||
public static final String CLASS_NEW_MOVED_IN_OR_CHANGED = "x-treelabel-zas";
|
public static final String CLASS_NEW_MOVED_IN_OR_CHANGED = "x-treelabel-zas";
|
||||||
|
|
||||||
private String subject = "";
|
private String subject = "";
|
||||||
|
|
||||||
private String teacher = "";
|
private String teacher = "";
|
||||||
|
|
||||||
private String room = "";
|
private String room = "";
|
||||||
|
|
||||||
private String description = "";
|
private String description = "";
|
||||||
|
|
||||||
private String groupName = "";
|
private String groupName = "";
|
||||||
|
|
||||||
private String startTime = "";
|
private String startTime = "";
|
||||||
|
|
||||||
private String endTime = "";
|
private String endTime = "";
|
||||||
|
|
||||||
private boolean isEmpty = false;
|
private boolean isEmpty = false;
|
||||||
|
|
||||||
private boolean isDivisionIntoGroups = false;
|
private boolean isDivisionIntoGroups = false;
|
||||||
|
|
||||||
private boolean isPlanning = false;
|
private boolean isPlanning = false;
|
||||||
|
|
||||||
private boolean isRealized = false;
|
private boolean isRealized = false;
|
||||||
|
|
||||||
private boolean isMovedOrCanceled = false;
|
private boolean isMovedOrCanceled = false;
|
||||||
|
|
||||||
private boolean isNewMovedInOrChanged = false;
|
private boolean isNewMovedInOrChanged = false;
|
||||||
|
|
||||||
public String getSubject() {
|
public String getSubject() {
|
||||||
|
@ -8,15 +8,18 @@ import java.io.IOException;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.github.wulkanowy.api.StudentAndParent;
|
||||||
import io.github.wulkanowy.api.Vulcan;
|
import io.github.wulkanowy.api.Vulcan;
|
||||||
import io.github.wulkanowy.api.login.LoginErrorException;
|
import io.github.wulkanowy.api.login.LoginErrorException;
|
||||||
|
|
||||||
public class Table extends Vulcan {
|
public class Table extends Vulcan {
|
||||||
|
|
||||||
private Timetable timetable;
|
private StudentAndParent snp;
|
||||||
|
|
||||||
public Table(Timetable timetable) {
|
private String timetablePageurl = "Lekcja.mvc/PlanLekcji?data=";
|
||||||
this.timetable = timetable;
|
|
||||||
|
public Table(StudentAndParent snp) {
|
||||||
|
this.snp = snp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Week getWeekTable() throws IOException, LoginErrorException {
|
public Week getWeekTable() throws IOException, LoginErrorException {
|
||||||
@ -24,7 +27,7 @@ public class Table extends Vulcan {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Week getWeekTable(String tick) throws IOException, LoginErrorException {
|
public Week getWeekTable(String tick) throws IOException, LoginErrorException {
|
||||||
Element table = timetable.getTablePageDocument(tick)
|
Element table = snp.getSnPPageDocument(timetablePageurl + tick)
|
||||||
.select(".mainContainer .presentData").first();
|
.select(".mainContainer .presentData").first();
|
||||||
|
|
||||||
Elements tableHeaderCells = table.select("thead th");
|
Elements tableHeaderCells = table.select("thead th");
|
||||||
@ -84,7 +87,7 @@ public class Table extends Vulcan {
|
|||||||
.setDays(days);
|
.setDays(days);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Lesson getLessonFromElement(Element e) {
|
private Lesson getLessonFromElement(Element e) {
|
||||||
Lesson lesson = new Lesson();
|
Lesson lesson = new Lesson();
|
||||||
Elements spans = e.select("span");
|
Elements spans = e.select("span");
|
||||||
|
|
||||||
@ -99,7 +102,7 @@ public class Table extends Vulcan {
|
|||||||
return lesson;
|
return lesson;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Lesson getLessonGroupDivisionInfo(Lesson lesson, Elements e) {
|
private Lesson getLessonGroupDivisionInfo(Lesson lesson, Elements e) {
|
||||||
if ((4 == e.size() && (e.first().attr("class").equals("")) ||
|
if ((4 == e.size() && (e.first().attr("class").equals("")) ||
|
||||||
(5 == e.size() && e.first().hasClass(Lesson.CLASS_NEW_MOVED_IN_OR_CHANGED)))) {
|
(5 == e.size() && e.first().hasClass(Lesson.CLASS_NEW_MOVED_IN_OR_CHANGED)))) {
|
||||||
lesson.setDivisionIntoGroups(true);
|
lesson.setDivisionIntoGroups(true);
|
||||||
@ -114,7 +117,7 @@ public class Table extends Vulcan {
|
|||||||
return lesson;
|
return lesson;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Lesson getLessonTypeInfo(Lesson lesson, Elements e) {
|
private Lesson getLessonTypeInfo(Lesson lesson, Elements e) {
|
||||||
if (e.first().hasClass(Lesson.CLASS_MOVED_OR_CANCELED)) {
|
if (e.first().hasClass(Lesson.CLASS_MOVED_OR_CANCELED)) {
|
||||||
lesson.setMovedOrCanceled(true);
|
lesson.setMovedOrCanceled(true);
|
||||||
} else if (e.first().hasClass(Lesson.CLASS_NEW_MOVED_IN_OR_CHANGED)) {
|
} else if (e.first().hasClass(Lesson.CLASS_NEW_MOVED_IN_OR_CHANGED)) {
|
||||||
@ -131,7 +134,7 @@ public class Table extends Vulcan {
|
|||||||
return lesson;
|
return lesson;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Lesson getLessonDescriptionInfo(Lesson lesson, Elements e) {
|
private Lesson getLessonDescriptionInfo(Lesson lesson, Elements e) {
|
||||||
if ((4 == e.size() || 5 == e.size())
|
if ((4 == e.size() || 5 == e.size())
|
||||||
&& (e.first().hasClass(Lesson.CLASS_MOVED_OR_CANCELED)
|
&& (e.first().hasClass(Lesson.CLASS_MOVED_OR_CANCELED)
|
||||||
|| e.first().hasClass(Lesson.CLASS_NEW_MOVED_IN_OR_CHANGED))) {
|
|| e.first().hasClass(Lesson.CLASS_NEW_MOVED_IN_OR_CHANGED))) {
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
package io.github.wulkanowy.api.timetable;
|
|
||||||
|
|
||||||
import org.jsoup.Jsoup;
|
|
||||||
import org.jsoup.nodes.Document;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import io.github.wulkanowy.api.Cookies;
|
|
||||||
import io.github.wulkanowy.api.StudentAndParent;
|
|
||||||
import io.github.wulkanowy.api.Vulcan;
|
|
||||||
import io.github.wulkanowy.api.login.LoginErrorException;
|
|
||||||
|
|
||||||
public class Timetable extends Vulcan {
|
|
||||||
|
|
||||||
private StudentAndParent snp;
|
|
||||||
|
|
||||||
private String timetablePageurl =
|
|
||||||
"https://uonetplus-opiekun.vulcan.net.pl/{locationID}/{ID}/Lekcja.mvc/PlanLekcji?data=";
|
|
||||||
|
|
||||||
public Timetable(Cookies cookies, StudentAndParent snp) {
|
|
||||||
this.cookies = cookies;
|
|
||||||
this.snp = snp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Document getTablePageDocument(String tick) throws IOException, LoginErrorException {
|
|
||||||
timetablePageurl = timetablePageurl.replace("{locationID}", snp.getLocationID());
|
|
||||||
timetablePageurl = timetablePageurl.replace("{ID}", snp.getID());
|
|
||||||
|
|
||||||
return Jsoup.connect(timetablePageurl + tick)
|
|
||||||
.cookies(getCookies())
|
|
||||||
.get();
|
|
||||||
}
|
|
||||||
}
|
|
@ -2,11 +2,11 @@ package io.github.wulkanowy.api.user;
|
|||||||
|
|
||||||
public class AddressData {
|
public class AddressData {
|
||||||
|
|
||||||
private String address;
|
private String address = "";
|
||||||
|
|
||||||
private String registeredAddress;
|
private String registeredAddress = "";
|
||||||
|
|
||||||
private String correspondenceAddress;
|
private String correspondenceAddress = "";
|
||||||
|
|
||||||
public String getAddress() {
|
public String getAddress() {
|
||||||
return address;
|
return address;
|
||||||
|
@ -10,32 +10,45 @@ import io.github.wulkanowy.api.login.LoginErrorException;
|
|||||||
|
|
||||||
public class BasicInformation {
|
public class BasicInformation {
|
||||||
|
|
||||||
private StudentAndParent snp = null;
|
private static Document studentDataPageDocument;
|
||||||
|
|
||||||
private Document studentDataPageDocument;
|
private StudentAndParent snp;
|
||||||
|
|
||||||
public BasicInformation(User user, StudentAndParent snp)
|
private String studentDataPageUrl = "Uczen.mvc/DanePodstawowe";
|
||||||
throws IOException, LoginErrorException {
|
|
||||||
|
public BasicInformation(StudentAndParent snp) {
|
||||||
this.snp = snp;
|
this.snp = snp;
|
||||||
|
|
||||||
studentDataPageDocument = user.getPage();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public PersonalData getPersonalData() {
|
public Document getStudentDataPageDocument() throws IOException, LoginErrorException {
|
||||||
Element e = studentDataPageDocument.select(".mainContainer > article").get(0);
|
if (null == studentDataPageDocument) {
|
||||||
|
studentDataPageDocument = snp.getSnPPageDocument(studentDataPageUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
return studentDataPageDocument;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PersonalData getPersonalData() throws IOException, LoginErrorException {
|
||||||
|
Element e = getStudentDataPageDocument().select(".mainContainer > article").get(0);
|
||||||
|
|
||||||
|
String name = snp.getRowDataChildValue(e, 1);
|
||||||
|
String[] names = name.split(" ");
|
||||||
|
|
||||||
return new PersonalData()
|
return new PersonalData()
|
||||||
.setNames(snp.getRowDataChildValue(e, 1))
|
.setName(name)
|
||||||
|
.setFirstName(names[0])
|
||||||
|
.setSurname(names[names.length - 1])
|
||||||
|
.setFirstAndLastName(names[0] + " " + names[names.length - 1])
|
||||||
.setDateAndBirthPlace(snp.getRowDataChildValue(e, 2))
|
.setDateAndBirthPlace(snp.getRowDataChildValue(e, 2))
|
||||||
.setPesel(snp.getRowDataChildValue(e, 3))
|
.setPesel(snp.getRowDataChildValue(e, 3))
|
||||||
.setGender(snp.getRowDataChildValue(e, 4))
|
.setGender(snp.getRowDataChildValue(e, 4))
|
||||||
.setPolishCitizenship(snp.getRowDataChildValue(e, 5))
|
.setPolishCitizenship("Tak".equals(snp.getRowDataChildValue(e, 5)))
|
||||||
.setFamilyName(snp.getRowDataChildValue(e, 6))
|
.setFamilyName(snp.getRowDataChildValue(e, 6))
|
||||||
.setParentsNames(snp.getRowDataChildValue(e, 7));
|
.setParentsNames(snp.getRowDataChildValue(e, 7));
|
||||||
}
|
}
|
||||||
|
|
||||||
public AddressData getAddresData() {
|
public AddressData getAddressData() throws IOException, LoginErrorException {
|
||||||
Element e = studentDataPageDocument.select(".mainContainer > article").get(1);
|
Element e = getStudentDataPageDocument().select(".mainContainer > article").get(1);
|
||||||
|
|
||||||
return new AddressData()
|
return new AddressData()
|
||||||
.setAddress(snp.getRowDataChildValue(e, 1))
|
.setAddress(snp.getRowDataChildValue(e, 1))
|
||||||
@ -44,8 +57,8 @@ public class BasicInformation {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContactDetails getContactDetails() {
|
public ContactDetails getContactDetails() throws IOException, LoginErrorException {
|
||||||
Element e = studentDataPageDocument.select(".mainContainer > article").get(2);
|
Element e = getStudentDataPageDocument().select(".mainContainer > article").get(2);
|
||||||
|
|
||||||
return new ContactDetails()
|
return new ContactDetails()
|
||||||
.setPhoneNumber(snp.getRowDataChildValue(e, 1))
|
.setPhoneNumber(snp.getRowDataChildValue(e, 1))
|
||||||
|
@ -2,11 +2,11 @@ package io.github.wulkanowy.api.user;
|
|||||||
|
|
||||||
public class ContactDetails {
|
public class ContactDetails {
|
||||||
|
|
||||||
private String phoneNumber;
|
private String phoneNumber = "";
|
||||||
|
|
||||||
private String cellPhoneNumber;
|
private String cellPhoneNumber = "";
|
||||||
|
|
||||||
private String email;
|
private String email = "";
|
||||||
|
|
||||||
public String getPhoneNumber() {
|
public String getPhoneNumber() {
|
||||||
return phoneNumber;
|
return phoneNumber;
|
||||||
|
@ -0,0 +1,42 @@
|
|||||||
|
package io.github.wulkanowy.api.user;
|
||||||
|
|
||||||
|
import org.jsoup.nodes.Element;
|
||||||
|
import org.jsoup.select.Elements;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.github.wulkanowy.api.StudentAndParent;
|
||||||
|
import io.github.wulkanowy.api.Vulcan;
|
||||||
|
import io.github.wulkanowy.api.login.LoginErrorException;
|
||||||
|
|
||||||
|
public class FamilyInformation extends Vulcan {
|
||||||
|
|
||||||
|
private StudentAndParent snp;
|
||||||
|
|
||||||
|
private String studentDataPageUrl = "Uczen.mvc/DanePodstawowe";
|
||||||
|
|
||||||
|
public FamilyInformation(StudentAndParent snp) throws IOException, LoginErrorException {
|
||||||
|
this.snp = snp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<FamilyMember> getFamilyMembers() throws IOException, LoginErrorException {
|
||||||
|
Elements membersElements = snp.getSnPPageDocument(studentDataPageUrl)
|
||||||
|
.select(".mainContainer > article:nth-of-type(n+4)");
|
||||||
|
|
||||||
|
List<FamilyMember> familyMembers = new ArrayList<>();
|
||||||
|
|
||||||
|
for (Element e : membersElements) {
|
||||||
|
familyMembers.add(new FamilyMember()
|
||||||
|
.setName(snp.getRowDataChildValue(e, 1))
|
||||||
|
.setKinship(snp.getRowDataChildValue(e, 2))
|
||||||
|
.setAddress(snp.getRowDataChildValue(e, 3))
|
||||||
|
.setTelephones(snp.getRowDataChildValue(e, 4))
|
||||||
|
.setEmail(snp.getRowDataChildValue(e, 5))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return familyMembers;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,59 @@
|
|||||||
|
package io.github.wulkanowy.api.user;
|
||||||
|
|
||||||
|
public class FamilyMember {
|
||||||
|
|
||||||
|
private String name = "";
|
||||||
|
|
||||||
|
private String kinship = "";
|
||||||
|
|
||||||
|
private String address = "";
|
||||||
|
|
||||||
|
private String telephones = "";
|
||||||
|
|
||||||
|
private String email = "";
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FamilyMember setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKinship() {
|
||||||
|
return kinship;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FamilyMember setKinship(String kinship) {
|
||||||
|
this.kinship = kinship;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FamilyMember setAddress(String address) {
|
||||||
|
this.address = address;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTelephones() {
|
||||||
|
return telephones;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FamilyMember setTelephones(String telephones) {
|
||||||
|
this.telephones = telephones;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FamilyMember setEmail(String email) {
|
||||||
|
this.email = email;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
@ -2,44 +2,60 @@ package io.github.wulkanowy.api.user;
|
|||||||
|
|
||||||
public class PersonalData {
|
public class PersonalData {
|
||||||
|
|
||||||
private String names;
|
private String name = "";
|
||||||
|
|
||||||
private String dateAndBirthPlace;
|
private String firstName = "";
|
||||||
|
|
||||||
private String pesel;
|
private String surname = "";
|
||||||
|
|
||||||
private String gender;
|
private String firstAndLastName = "";
|
||||||
|
|
||||||
private String isPolishCitizenship;
|
private String dateAndBirthPlace = "";
|
||||||
|
|
||||||
private String familyName;
|
private String pesel = "";
|
||||||
|
|
||||||
private String parentsNames;
|
private String gender = "";
|
||||||
|
|
||||||
public String getNames() {
|
private boolean isPolishCitizenship;
|
||||||
return names;
|
|
||||||
|
private String familyName = "";
|
||||||
|
|
||||||
|
private String parentsNames = "";
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PersonalData setNames(String names) {
|
public PersonalData setName(String name) {
|
||||||
this.names = names;
|
this.name = name;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFirstName() {
|
public String getFirstName() {
|
||||||
String[] name = names.split(" ");
|
return firstName;
|
||||||
|
}
|
||||||
|
|
||||||
return name[0];
|
public PersonalData setFirstName(String firstName) {
|
||||||
|
this.firstName = firstName;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSurname() {
|
public String getSurname() {
|
||||||
String[] name = names.split(" ");
|
return surname;
|
||||||
|
}
|
||||||
|
|
||||||
return name[name.length - 1];
|
public PersonalData setSurname(String surname) {
|
||||||
|
this.surname = surname;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFirstAndLastName() {
|
public String getFirstAndLastName() {
|
||||||
return getFirstName() + " " + getSurname();
|
return firstAndLastName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PersonalData setFirstAndLastName(String firstAndLastName) {
|
||||||
|
this.firstAndLastName = firstAndLastName;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDateAndBirthPlace() {
|
public String getDateAndBirthPlace() {
|
||||||
@ -48,7 +64,6 @@ public class PersonalData {
|
|||||||
|
|
||||||
public PersonalData setDateAndBirthPlace(String dateAndBirthPlace) {
|
public PersonalData setDateAndBirthPlace(String dateAndBirthPlace) {
|
||||||
this.dateAndBirthPlace = dateAndBirthPlace;
|
this.dateAndBirthPlace = dateAndBirthPlace;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,7 +73,6 @@ public class PersonalData {
|
|||||||
|
|
||||||
public PersonalData setPesel(String pesel) {
|
public PersonalData setPesel(String pesel) {
|
||||||
this.pesel = pesel;
|
this.pesel = pesel;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,17 +82,15 @@ public class PersonalData {
|
|||||||
|
|
||||||
public PersonalData setGender(String gender) {
|
public PersonalData setGender(String gender) {
|
||||||
this.gender = gender;
|
this.gender = gender;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPolishCitizenship() {
|
public boolean isPolishCitizenship() {
|
||||||
return "Tak".equals(isPolishCitizenship);
|
return isPolishCitizenship;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PersonalData setPolishCitizenship(String polishCitizenship) {
|
public PersonalData setPolishCitizenship(boolean polishCitizenship) {
|
||||||
isPolishCitizenship = polishCitizenship;
|
isPolishCitizenship = polishCitizenship;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,7 +100,6 @@ public class PersonalData {
|
|||||||
|
|
||||||
public PersonalData setFamilyName(String familyName) {
|
public PersonalData setFamilyName(String familyName) {
|
||||||
this.familyName = familyName;
|
this.familyName = familyName;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +109,6 @@ public class PersonalData {
|
|||||||
|
|
||||||
public PersonalData setParentsNames(String parentsNames) {
|
public PersonalData setParentsNames(String parentsNames) {
|
||||||
this.parentsNames = parentsNames;
|
this.parentsNames = parentsNames;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
package io.github.wulkanowy.api.user;
|
|
||||||
|
|
||||||
import org.jsoup.Jsoup;
|
|
||||||
import org.jsoup.nodes.Document;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import io.github.wulkanowy.api.Cookies;
|
|
||||||
import io.github.wulkanowy.api.StudentAndParent;
|
|
||||||
import io.github.wulkanowy.api.Vulcan;
|
|
||||||
import io.github.wulkanowy.api.login.LoginErrorException;
|
|
||||||
|
|
||||||
public class User extends Vulcan {
|
|
||||||
|
|
||||||
private StudentAndParent snp = null;
|
|
||||||
|
|
||||||
private String studentDataPageUrl =
|
|
||||||
"https://uonetplus-opiekun.vulcan.net.pl/{locationID}/{ID}/Uczen.mvc/DanePodstawowe";
|
|
||||||
|
|
||||||
public User(Cookies cookies, StudentAndParent snp) {
|
|
||||||
this.cookies = cookies;
|
|
||||||
this.snp = snp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Document getPage() throws IOException, LoginErrorException {
|
|
||||||
studentDataPageUrl = studentDataPageUrl.replace("{locationID}", snp.getLocationID());
|
|
||||||
studentDataPageUrl = studentDataPageUrl.replace("{ID}", snp.getID());
|
|
||||||
|
|
||||||
return Jsoup.connect(studentDataPageUrl)
|
|
||||||
.cookies(getCookies())
|
|
||||||
.get();
|
|
||||||
}
|
|
||||||
}
|
|
@ -11,6 +11,8 @@ import org.powermock.api.mockito.PowerMockito;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.github.wulkanowy.api.login.LoginErrorException;
|
||||||
|
|
||||||
public class StudentAndParentTest {
|
public class StudentAndParentTest {
|
||||||
|
|
||||||
private String fixtureFileName = "OcenyWszystkie-semester.html";
|
private String fixtureFileName = "OcenyWszystkie-semester.html";
|
||||||
@ -26,8 +28,8 @@ public class StudentAndParentTest {
|
|||||||
PowerMockito.whenNew(StudentAndParent.class)
|
PowerMockito.whenNew(StudentAndParent.class)
|
||||||
.withArguments(Mockito.any(Cookies.class), Mockito.anyString()).thenReturn(snp);
|
.withArguments(Mockito.any(Cookies.class), Mockito.anyString()).thenReturn(snp);
|
||||||
|
|
||||||
Mockito.when(snp.getPageByUrl(Mockito.anyString())).thenReturn(gradesPageDocument);
|
Mockito.when(snp.getSnPPageDocument(Mockito.anyString())).thenReturn(gradesPageDocument);
|
||||||
Mockito.when(snp.getGradesPageUrl()).thenReturn("http://example.null");
|
Mockito.when(snp.getCalculatedID(Mockito.anyString())).thenCallRealMethod();
|
||||||
Mockito.when(snp.getLocationID()).thenReturn("symbol");
|
Mockito.when(snp.getLocationID()).thenReturn("symbol");
|
||||||
Mockito.when(snp.getID()).thenReturn("123456");
|
Mockito.when(snp.getID()).thenReturn("123456");
|
||||||
Mockito.when(snp.getSemesters()).thenCallRealMethod();
|
Mockito.when(snp.getSemesters()).thenCallRealMethod();
|
||||||
@ -36,6 +38,24 @@ public class StudentAndParentTest {
|
|||||||
.thenCallRealMethod();
|
.thenCallRealMethod();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getCalculatedIDStandardTest() throws Exception {
|
||||||
|
Assert.assertEquals("123456", snp.getCalculatedID("https://uonetplus-opiekun"
|
||||||
|
+ ".vulcan.net.pl/powiat/123456/Start/Index/"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getCalculatedIDDemoTest() throws Exception {
|
||||||
|
Assert.assertEquals("demo12345", snp.getCalculatedID("https://uonetplus-opiekundemo"
|
||||||
|
+ ".vulcan.net.pl/demoupowiat/demo12345/Start/Index/"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(expected = LoginErrorException.class)
|
||||||
|
public void getCalculatedIDNotLoggedTest() throws Exception {
|
||||||
|
Assert.assertEquals("123", snp.getCalculatedID("https://uonetplus"
|
||||||
|
+ ".vulcan.net.pl/powiat/"));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getSemestersTest() throws Exception {
|
public void getSemestersTest() throws Exception {
|
||||||
List<Semester> semesters = snp.getSemesters();
|
List<Semester> semesters = snp.getSemesters();
|
||||||
@ -61,4 +81,11 @@ public class StudentAndParentTest {
|
|||||||
Assert.assertEquals("2", snp.getCurrentSemester(semesters).getId());
|
Assert.assertEquals("2", snp.getCurrentSemester(semesters).getId());
|
||||||
Assert.assertEquals("1500100901", snp.getCurrentSemester(semesters).getNumber());
|
Assert.assertEquals("1500100901", snp.getCurrentSemester(semesters).getNumber());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getCurrentSemesterFromEmptyTest() throws Exception {
|
||||||
|
List<Semester> semesters = new ArrayList<>();
|
||||||
|
|
||||||
|
Assert.assertNull(snp.getCurrentSemester(semesters));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,20 +1,12 @@
|
|||||||
package io.github.wulkanowy.api.grades;
|
package io.github.wulkanowy.api.grades;
|
||||||
|
|
||||||
import org.jsoup.Jsoup;
|
|
||||||
import org.jsoup.nodes.Document;
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.mockito.Mockito;
|
|
||||||
import org.powermock.api.mockito.PowerMockito;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import io.github.wulkanowy.api.FixtureHelper;
|
public class GradesListTest extends GradesTest {
|
||||||
import io.github.wulkanowy.api.Semester;
|
|
||||||
import io.github.wulkanowy.api.StudentAndParent;
|
|
||||||
|
|
||||||
public class GradesListTest {
|
|
||||||
|
|
||||||
private String fixtureFileName = "OcenyWszystkie-filled.html";
|
private String fixtureFileName = "OcenyWszystkie-filled.html";
|
||||||
|
|
||||||
@ -22,25 +14,9 @@ public class GradesListTest {
|
|||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
String input = FixtureHelper.getAsString(getClass().getResourceAsStream(fixtureFileName));
|
super.setUp(fixtureFileName);
|
||||||
Document gradesPageDocument = Jsoup.parse(input);
|
|
||||||
|
|
||||||
StudentAndParent snp = Mockito.mock(StudentAndParent.class);
|
gradesList = new GradesList(snp);
|
||||||
PowerMockito.whenNew(StudentAndParent.class).withAnyArguments().thenReturn(snp);
|
|
||||||
Mockito.when(snp.getLocationID()).thenReturn("symbol");
|
|
||||||
Mockito.when(snp.getID()).thenReturn("123456");
|
|
||||||
Mockito.when(snp.getGradesPageUrl()).thenReturn("http://example.null");
|
|
||||||
Mockito.when(snp.getSemesters()).thenCallRealMethod();
|
|
||||||
Mockito.when(snp.getSemesters(Mockito.any(Document.class))).thenCallRealMethod();
|
|
||||||
Mockito.when(snp.getCurrentSemester(Mockito.anyListOf(Semester.class)))
|
|
||||||
.thenCallRealMethod();
|
|
||||||
|
|
||||||
Grades grades = Mockito.mock(Grades.class);
|
|
||||||
PowerMockito.whenNew(Grades.class).withAnyArguments().thenReturn(grades);
|
|
||||||
Mockito.when(grades.getGradesPageDocument(Mockito.anyString()))
|
|
||||||
.thenReturn(gradesPageDocument);
|
|
||||||
|
|
||||||
gradesList = new GradesList(grades, snp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
package io.github.wulkanowy.api.grades;
|
||||||
|
|
||||||
|
import org.jsoup.Jsoup;
|
||||||
|
import org.jsoup.nodes.Document;
|
||||||
|
import org.mockito.Mockito;
|
||||||
|
|
||||||
|
import io.github.wulkanowy.api.FixtureHelper;
|
||||||
|
import io.github.wulkanowy.api.Semester;
|
||||||
|
import io.github.wulkanowy.api.StudentAndParent;
|
||||||
|
|
||||||
|
public class GradesTest {
|
||||||
|
|
||||||
|
protected StudentAndParent snp;
|
||||||
|
|
||||||
|
public void setUp(String fixtureFileName) throws Exception {
|
||||||
|
String input = FixtureHelper.getAsString(getClass().getResourceAsStream(fixtureFileName));
|
||||||
|
Document gradesPageDocument = Jsoup.parse(input);
|
||||||
|
|
||||||
|
snp = Mockito.mock(StudentAndParent.class);
|
||||||
|
Mockito.when(snp.getSnPPageDocument(Mockito.anyString()))
|
||||||
|
.thenReturn(gradesPageDocument);
|
||||||
|
Mockito.when(snp.getSemesters(Mockito.any(Document.class))).thenCallRealMethod();
|
||||||
|
Mockito.when(snp.getCurrentSemester(Mockito.anyListOf(Semester.class)))
|
||||||
|
.thenCallRealMethod();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,83 @@
|
|||||||
|
package io.github.wulkanowy.api.grades;
|
||||||
|
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class SubjectsListTest extends GradesTest {
|
||||||
|
|
||||||
|
private String fixtureStdFileName = "OcenyWszystkie-subjects.html";
|
||||||
|
|
||||||
|
private String fixtureAverageFileName = "OcenyWszystkie-subjects-average.html";
|
||||||
|
|
||||||
|
public SubjectsList getSetUpSubjectsList(String fixtureFileName) throws Exception {
|
||||||
|
super.setUp(fixtureFileName);
|
||||||
|
|
||||||
|
return new SubjectsList(snp);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getAllStdTest() throws Exception {
|
||||||
|
List<Subject> list = getSetUpSubjectsList(fixtureStdFileName).getAll();
|
||||||
|
|
||||||
|
Assert.assertEquals(5, list.size());
|
||||||
|
|
||||||
|
Subject subject0 = list.get(0);
|
||||||
|
Assert.assertEquals("Zachowanie", subject0.getName());
|
||||||
|
Assert.assertEquals("bardzo dobre", subject0.getPredictedRating());
|
||||||
|
Assert.assertEquals("bardzo dobre", subject0.getFinalRating());
|
||||||
|
|
||||||
|
Subject subject1 = list.get(1);
|
||||||
|
Assert.assertEquals("Praktyka zawodowa", subject1.getName());
|
||||||
|
Assert.assertEquals("-", subject1.getPredictedRating());
|
||||||
|
Assert.assertEquals("celujący", subject1.getFinalRating());
|
||||||
|
|
||||||
|
Subject subject2 = list.get(2);
|
||||||
|
Assert.assertEquals("Metodologia programowania", subject2.getName());
|
||||||
|
Assert.assertEquals("bardzo dobry", subject2.getPredictedRating());
|
||||||
|
Assert.assertEquals("celujący", subject2.getFinalRating());
|
||||||
|
|
||||||
|
Subject subject3 = list.get(3);
|
||||||
|
Assert.assertEquals("Podstawy przedsiębiorczości", subject3.getName());
|
||||||
|
Assert.assertEquals("3/4", subject3.getPredictedRating());
|
||||||
|
Assert.assertEquals("dostateczny", subject3.getFinalRating());
|
||||||
|
|
||||||
|
Subject subject4 = list.get(4);
|
||||||
|
Assert.assertEquals("Wychowanie do życia w rodzinie", subject4.getName());
|
||||||
|
Assert.assertEquals("-", subject4.getPredictedRating());
|
||||||
|
Assert.assertEquals("-", subject4.getFinalRating());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getAllAverageTest() throws Exception {
|
||||||
|
List<Subject> list = getSetUpSubjectsList(fixtureAverageFileName).getAll();
|
||||||
|
|
||||||
|
Assert.assertEquals(5, list.size());
|
||||||
|
|
||||||
|
Subject subject0 = list.get(0);
|
||||||
|
Assert.assertEquals("Zachowanie", subject0.getName());
|
||||||
|
Assert.assertEquals("bardzo dobre", subject0.getPredictedRating());
|
||||||
|
Assert.assertEquals("bardzo dobre", subject0.getFinalRating());
|
||||||
|
|
||||||
|
Subject subject1 = list.get(1);
|
||||||
|
Assert.assertEquals("Język polski", subject1.getName());
|
||||||
|
Assert.assertEquals("-", subject1.getPredictedRating());
|
||||||
|
Assert.assertEquals("dobry", subject1.getFinalRating());
|
||||||
|
|
||||||
|
Subject subject2 = list.get(2);
|
||||||
|
Assert.assertEquals("Wychowanie fizyczne", subject2.getName());
|
||||||
|
Assert.assertEquals("bardzo dobry", subject2.getPredictedRating());
|
||||||
|
Assert.assertEquals("celujący", subject2.getFinalRating());
|
||||||
|
|
||||||
|
Subject subject3 = list.get(3);
|
||||||
|
Assert.assertEquals("Język angielski", subject3.getName());
|
||||||
|
Assert.assertEquals("4/5", subject3.getPredictedRating());
|
||||||
|
Assert.assertEquals("bardzo dobry", subject3.getFinalRating());
|
||||||
|
|
||||||
|
Subject subject4 = list.get(4);
|
||||||
|
Assert.assertEquals("Wiedza o społeczeństwie", subject4.getName());
|
||||||
|
Assert.assertEquals("-", subject4.getPredictedRating());
|
||||||
|
Assert.assertEquals("-", subject4.getFinalRating());
|
||||||
|
}
|
||||||
|
}
|
@ -1,8 +1,8 @@
|
|||||||
package io.github.wulkanowy.api.login;
|
package io.github.wulkanowy.api.login;
|
||||||
|
|
||||||
import org.junit.Test;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import org.junit.Test;
|
||||||
|
|
||||||
public class LoginTest {
|
public class LoginTest {
|
||||||
|
|
||||||
|
@ -5,12 +5,11 @@ import org.jsoup.nodes.Document;
|
|||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.unitils.reflectionassert.ReflectionAssert;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import io.github.wulkanowy.api.FixtureHelper;
|
import io.github.wulkanowy.api.FixtureHelper;
|
||||||
|
import io.github.wulkanowy.api.StudentAndParent;
|
||||||
|
|
||||||
public class AchievementsListTest {
|
public class AchievementsListTest {
|
||||||
|
|
||||||
@ -23,33 +22,25 @@ public class AchievementsListTest {
|
|||||||
|
|
||||||
Document notesPageDocument = Jsoup.parse(input);
|
Document notesPageDocument = Jsoup.parse(input);
|
||||||
|
|
||||||
Notes notes = Mockito.mock(Notes.class);
|
StudentAndParent snp = Mockito.mock(StudentAndParent.class);
|
||||||
Mockito.when(notes.getNotesPageDocument()).thenReturn(notesPageDocument);
|
Mockito.when(snp.getSnPPageDocument(Mockito.anyString())).thenReturn(notesPageDocument);
|
||||||
|
|
||||||
return new AchievementsList(notes);
|
return new AchievementsList(snp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAllAchievementsFilledTest() throws Exception {
|
public void getAllAchievementsFilledTest() throws Exception {
|
||||||
List<String> expectedList = new ArrayList<>();
|
List<String> list = getSetUpAchievementsList(fixtureFilledFileName).getAllAchievements();
|
||||||
expectedList.add("I miejsce w ogólnopolskim konkursie ortograficznym");
|
|
||||||
expectedList.add("III miejsce w ogólnopolskim konkursie plastycznym");
|
|
||||||
|
|
||||||
List<String> actualList = getSetUpAchievementsList(
|
Assert.assertEquals(2, list.size());
|
||||||
fixtureFilledFileName).getAllAchievements();
|
Assert.assertEquals("I miejsce w ogólnopolskim konkursie ortograficznym", list.get(0));
|
||||||
|
Assert.assertEquals("III miejsce w ogólnopolskim konkursie plastycznym", list.get(1));
|
||||||
Assert.assertEquals(2, actualList.size());
|
|
||||||
ReflectionAssert.assertReflectionEquals(expectedList, actualList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAllAchievementsEmptyTest() throws Exception {
|
public void getAllAchievementsEmptyTest() throws Exception {
|
||||||
List<String> expectedList = new ArrayList<>();
|
List<String> list = getSetUpAchievementsList(fixtureEmptyFileName).getAllAchievements();
|
||||||
|
|
||||||
List<String> actualList = getSetUpAchievementsList(
|
Assert.assertEquals(0, list.size());
|
||||||
fixtureEmptyFileName).getAllAchievements();
|
|
||||||
|
|
||||||
Assert.assertEquals(0, actualList.size());
|
|
||||||
ReflectionAssert.assertReflectionEquals(expectedList, actualList);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,9 +6,7 @@ import org.jsoup.nodes.Element;
|
|||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.unitils.reflectionassert.ReflectionAssert;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import io.github.wulkanowy.api.FixtureHelper;
|
import io.github.wulkanowy.api.FixtureHelper;
|
||||||
@ -25,50 +23,35 @@ public class NotesListTest {
|
|||||||
|
|
||||||
Document notesPageDocument = Jsoup.parse(input);
|
Document notesPageDocument = Jsoup.parse(input);
|
||||||
|
|
||||||
Notes notes = Mockito.mock(Notes.class);
|
|
||||||
Mockito.when(notes.getNotesPageDocument()).thenReturn(notesPageDocument);
|
|
||||||
StudentAndParent snp = Mockito.mock(StudentAndParent.class);
|
StudentAndParent snp = Mockito.mock(StudentAndParent.class);
|
||||||
|
Mockito.when(snp.getSnPPageDocument(Mockito.anyString())).thenReturn(notesPageDocument);
|
||||||
Mockito.when(snp.getRowDataChildValue(Mockito.any(Element.class),
|
Mockito.when(snp.getRowDataChildValue(Mockito.any(Element.class),
|
||||||
Mockito.anyInt())).thenCallRealMethod();
|
Mockito.anyInt())).thenCallRealMethod();
|
||||||
|
|
||||||
return new NotesList(notes, snp);
|
return new NotesList(snp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAllNotesFilledTest() throws Exception {
|
public void getAllNotesFilledTest() throws Exception {
|
||||||
List<Note> expectedList = new ArrayList<>();
|
List<Note> list = getSetUpNotesList(fixtureFilledFileName).getAllNotes();
|
||||||
expectedList.add(new Note()
|
|
||||||
.setDate("06.06.2017")
|
|
||||||
.setTeacher("Jan Kowalski [JK]")
|
|
||||||
.setCategory("Zaangażowanie społeczne")
|
|
||||||
.setContent("Pomoc przy pikniku charytatywnym")
|
|
||||||
);
|
|
||||||
expectedList.add(new Note()
|
|
||||||
.setDate("01.12.2016")
|
|
||||||
.setTeacher("Ochocka Zofia [PZ]")
|
|
||||||
.setCategory("Reprezentowanie szkoły")
|
|
||||||
.setContent("Udział w przygotowaniu spektaklu")
|
|
||||||
);
|
|
||||||
expectedList.add(new Note()
|
|
||||||
.setDate("01.10.2016")
|
|
||||||
.setTeacher("Kochański Leszek [KL]")
|
|
||||||
.setCategory("Zachowanie na lekcji")
|
|
||||||
.setContent("Przeszkadzanie w prowadzeniu lekcji")
|
|
||||||
);
|
|
||||||
|
|
||||||
List<Note> actualList = getSetUpNotesList(fixtureFilledFileName).getAllNotes();
|
Assert.assertEquals(3, list.size());
|
||||||
|
|
||||||
Assert.assertEquals(3, actualList.size());
|
Assert.assertEquals("06.06.2017", list.get(0).getDate());
|
||||||
ReflectionAssert.assertReflectionEquals(expectedList, actualList);
|
Assert.assertEquals("Jan Kowalski [JK]", list.get(0).getTeacher());
|
||||||
|
Assert.assertEquals("Zaangażowanie społeczne", list.get(0).getCategory());
|
||||||
|
Assert.assertEquals("Pomoc przy pikniku charytatywnym", list.get(0).getContent());
|
||||||
|
|
||||||
|
Assert.assertEquals("01.10.2016", list.get(2).getDate());
|
||||||
|
Assert.assertEquals("Kochański Leszek [KL]", list.get(2).getTeacher());
|
||||||
|
Assert.assertEquals("Zachowanie na lekcji", list.get(2).getCategory());
|
||||||
|
Assert.assertEquals("Przeszkadzanie w prowadzeniu lekcji", list.get(2).getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAllNotesWhenEmpty() throws Exception {
|
public void getAllNotesWhenEmpty() throws Exception {
|
||||||
List<Note> actualList = getSetUpNotesList(fixtureEmptyFileName).getAllNotes();
|
List<Note> list = getSetUpNotesList(fixtureEmptyFileName).getAllNotes();
|
||||||
|
|
||||||
List<Note> expectedList = new ArrayList<>();
|
Assert.assertEquals(0, list.size());
|
||||||
|
|
||||||
Assert.assertEquals(0, actualList.size());
|
|
||||||
ReflectionAssert.assertReflectionEquals(expectedList, actualList);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ public class SchoolInfoTest extends SchoolTest {
|
|||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
schoolInfo = new SchoolInfo(school, snp);
|
schoolInfo = new SchoolInfo(snp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -11,7 +11,6 @@ import io.github.wulkanowy.api.StudentAndParent;
|
|||||||
|
|
||||||
public class SchoolTest {
|
public class SchoolTest {
|
||||||
|
|
||||||
protected School school;
|
|
||||||
protected StudentAndParent snp;
|
protected StudentAndParent snp;
|
||||||
private String fixtureFileName = "Szkola.html";
|
private String fixtureFileName = "Szkola.html";
|
||||||
|
|
||||||
@ -21,9 +20,8 @@ public class SchoolTest {
|
|||||||
|
|
||||||
Document schoolPageDocument = Jsoup.parse(input);
|
Document schoolPageDocument = Jsoup.parse(input);
|
||||||
|
|
||||||
school = Mockito.mock(School.class);
|
|
||||||
Mockito.when(school.getSchoolPageDocument()).thenReturn(schoolPageDocument);
|
|
||||||
snp = Mockito.mock(StudentAndParent.class);
|
snp = Mockito.mock(StudentAndParent.class);
|
||||||
|
Mockito.when(snp.getSnPPageDocument(Mockito.anyString())).thenReturn(schoolPageDocument);
|
||||||
Mockito.when(snp.getRowDataChildValue(Mockito.any(Element.class),
|
Mockito.when(snp.getRowDataChildValue(Mockito.any(Element.class),
|
||||||
Mockito.anyInt())).thenCallRealMethod();
|
Mockito.anyInt())).thenCallRealMethod();
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ public class TeachersInfoTest extends SchoolTest {
|
|||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
teachersInfo = new TeachersInfo(school);
|
teachersInfo = new TeachersInfo(snp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -7,27 +7,31 @@ import org.junit.Test;
|
|||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
|
|
||||||
import io.github.wulkanowy.api.FixtureHelper;
|
import io.github.wulkanowy.api.FixtureHelper;
|
||||||
|
import io.github.wulkanowy.api.StudentAndParent;
|
||||||
|
|
||||||
public class TableTest {
|
public class TableTest {
|
||||||
|
|
||||||
private String fixtureStdFileName = "PlanLekcji-std.html";
|
private String fixtureStdFileName = "PlanLekcji-std.html";
|
||||||
|
|
||||||
private String fixtureHolidaysFileName = "PlanLekcji-holidays.html";
|
private String fixtureHolidaysFileName = "PlanLekcji-holidays.html";
|
||||||
|
|
||||||
private String fixtureFullFileName = "PlanLekcji-full.html";
|
private String fixtureFullFileName = "PlanLekcji-full.html";
|
||||||
|
|
||||||
private Table getSetUpTable(String tick, String fixtureFileName) throws Exception {
|
private Table getSetUpTable(String fixtureFileName) throws Exception {
|
||||||
String input = FixtureHelper.getAsString(getClass().getResourceAsStream(fixtureFileName));
|
String input = FixtureHelper.getAsString(getClass().getResourceAsStream(fixtureFileName));
|
||||||
|
|
||||||
Document tablePageDocument = Jsoup.parse(input);
|
Document tablePageDocument = Jsoup.parse(input);
|
||||||
|
|
||||||
Timetable timetable = Mockito.mock(Timetable.class);
|
StudentAndParent timetable = Mockito.mock(StudentAndParent.class);
|
||||||
Mockito.when(timetable.getTablePageDocument(tick)).thenReturn(tablePageDocument);
|
Mockito.when(timetable.getSnPPageDocument(Mockito.anyString()))
|
||||||
|
.thenReturn(tablePageDocument);
|
||||||
|
|
||||||
return new Table(timetable);
|
return new Table(timetable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getWeekTableStandardTest() throws Exception {
|
public void getWeekTableStandardTest() throws Exception {
|
||||||
Table table = getSetUpTable("", fixtureStdFileName);
|
Table table = getSetUpTable(fixtureStdFileName);
|
||||||
Week week = table.getWeekTable();
|
Week week = table.getWeekTable();
|
||||||
|
|
||||||
Assert.assertEquals(5, week.getDays().size());
|
Assert.assertEquals(5, week.getDays().size());
|
||||||
@ -41,7 +45,7 @@ public class TableTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getWeekTableStandardLessonStartEndEndTest() throws Exception {
|
public void getWeekTableStandardLessonStartEndEndTest() throws Exception {
|
||||||
Table tableStd = getSetUpTable("", fixtureStdFileName);
|
Table tableStd = getSetUpTable(fixtureStdFileName);
|
||||||
Week stdWeek = tableStd.getWeekTable();
|
Week stdWeek = tableStd.getWeekTable();
|
||||||
|
|
||||||
Assert.assertEquals("08:00", stdWeek.getDay(0).getLesson(0).getStartTime());
|
Assert.assertEquals("08:00", stdWeek.getDay(0).getLesson(0).getStartTime());
|
||||||
@ -49,7 +53,7 @@ public class TableTest {
|
|||||||
Assert.assertEquals("12:15", stdWeek.getDay(2).getLesson(4).getEndTime());
|
Assert.assertEquals("12:15", stdWeek.getDay(2).getLesson(4).getEndTime());
|
||||||
Assert.assertEquals("14:10", stdWeek.getDay(3).getLesson(7).getStartTime());
|
Assert.assertEquals("14:10", stdWeek.getDay(3).getLesson(7).getStartTime());
|
||||||
|
|
||||||
Table tableFull = getSetUpTable("", fixtureFullFileName);
|
Table tableFull = getSetUpTable(fixtureFullFileName);
|
||||||
Week fullWeek = tableFull.getWeekTable();
|
Week fullWeek = tableFull.getWeekTable();
|
||||||
|
|
||||||
Assert.assertEquals("07:10", fullWeek.getDay(0).getLesson(0).getStartTime());
|
Assert.assertEquals("07:10", fullWeek.getDay(0).getLesson(0).getStartTime());
|
||||||
@ -61,7 +65,7 @@ public class TableTest {
|
|||||||
|
|
||||||
@Test(expected = IndexOutOfBoundsException.class)
|
@Test(expected = IndexOutOfBoundsException.class)
|
||||||
public void getWeekTableStandardOutOfBoundsIndex() throws Exception {
|
public void getWeekTableStandardOutOfBoundsIndex() throws Exception {
|
||||||
Table table = getSetUpTable("", fixtureStdFileName);
|
Table table = getSetUpTable(fixtureStdFileName);
|
||||||
Week week = table.getWeekTable();
|
Week week = table.getWeekTable();
|
||||||
|
|
||||||
week.getDay(5);
|
week.getDay(5);
|
||||||
@ -69,7 +73,7 @@ public class TableTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getWeekTableHolidaysTest() throws Exception {
|
public void getWeekTableHolidaysTest() throws Exception {
|
||||||
Table table = getSetUpTable("", fixtureHolidaysFileName);
|
Table table = getSetUpTable(fixtureHolidaysFileName);
|
||||||
Week week = table.getWeekTable();
|
Week week = table.getWeekTable();
|
||||||
|
|
||||||
Assert.assertTrue(week.getDay(1).isFreeDay());
|
Assert.assertTrue(week.getDay(1).isFreeDay());
|
||||||
@ -84,7 +88,7 @@ public class TableTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getWeekTableHolidaysWithEmptyLessonsTest() throws Exception {
|
public void getWeekTableHolidaysWithEmptyLessonsTest() throws Exception {
|
||||||
Table table = getSetUpTable("", fixtureHolidaysFileName);
|
Table table = getSetUpTable(fixtureHolidaysFileName);
|
||||||
Week week = table.getWeekTable();
|
Week week = table.getWeekTable();
|
||||||
|
|
||||||
Assert.assertEquals(5, week.getDays().size());
|
Assert.assertEquals(5, week.getDays().size());
|
||||||
@ -97,7 +101,7 @@ public class TableTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getWeekTableFullTest() throws Exception {
|
public void getWeekTableFullTest() throws Exception {
|
||||||
Table table = getSetUpTable("", fixtureFullFileName);
|
Table table = getSetUpTable(fixtureFullFileName);
|
||||||
Week week = table.getWeekTable();
|
Week week = table.getWeekTable();
|
||||||
|
|
||||||
Assert.assertFalse(week.getDay(1).getLesson(2).isEmpty());
|
Assert.assertFalse(week.getDay(1).getLesson(2).isEmpty());
|
||||||
@ -105,7 +109,7 @@ public class TableTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getWeekTableFullLessonsGroupsDivisionTest() throws Exception {
|
public void getWeekTableFullLessonsGroupsDivisionTest() throws Exception {
|
||||||
Table table = getSetUpTable("", fixtureFullFileName);
|
Table table = getSetUpTable(fixtureFullFileName);
|
||||||
Week week = table.getWeekTable();
|
Week week = table.getWeekTable();
|
||||||
|
|
||||||
// class="", span*4
|
// class="", span*4
|
||||||
@ -136,7 +140,7 @@ public class TableTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getWeekTableFullLessonsTypesTest() throws Exception {
|
public void getWeekTableFullLessonsTypesTest() throws Exception {
|
||||||
Table table = getSetUpTable("", fixtureFullFileName);
|
Table table = getSetUpTable(fixtureFullFileName);
|
||||||
Week week = table.getWeekTable();
|
Week week = table.getWeekTable();
|
||||||
|
|
||||||
// class="", span*4
|
// class="", span*4
|
||||||
@ -177,7 +181,7 @@ public class TableTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getWeekTableFullLessonsBasicInfoTest() throws Exception {
|
public void getWeekTableFullLessonsBasicInfoTest() throws Exception {
|
||||||
Table table = getSetUpTable("", fixtureFullFileName);
|
Table table = getSetUpTable(fixtureFullFileName);
|
||||||
Week week = table.getWeekTable();
|
Week week = table.getWeekTable();
|
||||||
|
|
||||||
// class="", span*4
|
// class="", span*4
|
||||||
|
@ -0,0 +1,50 @@
|
|||||||
|
package io.github.wulkanowy.api.user;
|
||||||
|
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class BasicInformationTest extends UserTest {
|
||||||
|
|
||||||
|
private BasicInformation basicInformation;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setUp() throws Exception {
|
||||||
|
super.setUp();
|
||||||
|
basicInformation = new BasicInformation(snp);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getPersonalData() throws Exception {
|
||||||
|
PersonalData data = basicInformation.getPersonalData();
|
||||||
|
|
||||||
|
Assert.assertEquals("Maria", data.getFirstName());
|
||||||
|
Assert.assertEquals("Kamińska", data.getSurname());
|
||||||
|
Assert.assertEquals("Maria Kamińska", data.getFirstAndLastName());
|
||||||
|
Assert.assertEquals("Maria Aneta Kamińska", data.getName());
|
||||||
|
Assert.assertEquals("01.01.1900, Warszawa", data.getDateAndBirthPlace());
|
||||||
|
Assert.assertEquals("12345678900", data.getPesel());
|
||||||
|
Assert.assertEquals("Kobieta", data.getGender());
|
||||||
|
Assert.assertTrue(data.isPolishCitizenship());
|
||||||
|
Assert.assertEquals("Nowak", data.getFamilyName());
|
||||||
|
Assert.assertEquals("Gabriela, Kamil", data.getParentsNames());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getAddressData() throws Exception {
|
||||||
|
AddressData data = basicInformation.getAddressData();
|
||||||
|
|
||||||
|
Assert.assertEquals("ul. Sportowa 16, 00-123 Warszawa", data.getAddress());
|
||||||
|
Assert.assertEquals("ul. Sportowa 17, 00-123 Warszawa", data.getRegisteredAddress());
|
||||||
|
Assert.assertEquals("ul. Sportowa 18, 00-123 Warszawa", data.getCorrespondenceAddress());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getContactDetails() throws Exception {
|
||||||
|
ContactDetails data = basicInformation.getContactDetails();
|
||||||
|
|
||||||
|
Assert.assertEquals("005554433", data.getPhoneNumber());
|
||||||
|
Assert.assertEquals("555444333", data.getCellPhoneNumber());
|
||||||
|
Assert.assertEquals("wulkanowy@example.null", data.getEmail());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package io.github.wulkanowy.api.user;
|
||||||
|
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class FamilyInformationTest extends UserTest {
|
||||||
|
|
||||||
|
private FamilyInformation familyInformation;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setUp() throws Exception {
|
||||||
|
super.setUp();
|
||||||
|
familyInformation = new FamilyInformation(snp);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getFamilyMembers() throws Exception {
|
||||||
|
List<FamilyMember> familyMemberList = familyInformation.getFamilyMembers();
|
||||||
|
|
||||||
|
Assert.assertEquals(2, familyMemberList.size());
|
||||||
|
|
||||||
|
FamilyMember member0 = familyMemberList.get(0);
|
||||||
|
Assert.assertEquals("Marianna Pająk", member0.getName());
|
||||||
|
Assert.assertEquals("matka", member0.getKinship());
|
||||||
|
Assert.assertEquals("ul. Sportowa 16, 00-123 Warszawa", member0.getAddress());
|
||||||
|
Assert.assertEquals("555111222", member0.getTelephones());
|
||||||
|
Assert.assertEquals("wulkanowy@example.null", member0.getEmail());
|
||||||
|
|
||||||
|
FamilyMember member1 = familyMemberList.get(1);
|
||||||
|
Assert.assertEquals("Dawid Świątek", member1.getName());
|
||||||
|
Assert.assertEquals("ojciec", member1.getKinship());
|
||||||
|
Assert.assertEquals("ul. Sportowa 18, 00-123 Warszawa", member1.getAddress());
|
||||||
|
Assert.assertEquals("555222111", member1.getTelephones());
|
||||||
|
Assert.assertEquals("wulkanowy@example.null", member1.getEmail());
|
||||||
|
}
|
||||||
|
}
|
29
app/src/test/java/io/github/wulkanowy/api/user/UserTest.java
Normal file
29
app/src/test/java/io/github/wulkanowy/api/user/UserTest.java
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package io.github.wulkanowy.api.user;
|
||||||
|
|
||||||
|
import org.jsoup.Jsoup;
|
||||||
|
import org.jsoup.nodes.Document;
|
||||||
|
import org.jsoup.nodes.Element;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.mockito.Mockito;
|
||||||
|
|
||||||
|
import io.github.wulkanowy.api.FixtureHelper;
|
||||||
|
import io.github.wulkanowy.api.StudentAndParent;
|
||||||
|
|
||||||
|
public class UserTest {
|
||||||
|
|
||||||
|
protected StudentAndParent snp;
|
||||||
|
|
||||||
|
private String fixtureFileName = "UczenDanePodstawowe.html";
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setUp() throws Exception {
|
||||||
|
String input = FixtureHelper.getAsString(getClass().getResourceAsStream(fixtureFileName));
|
||||||
|
|
||||||
|
Document pageDocument = Jsoup.parse(input);
|
||||||
|
|
||||||
|
snp = Mockito.mock(StudentAndParent.class);
|
||||||
|
Mockito.when(snp.getSnPPageDocument(Mockito.anyString())).thenReturn(pageDocument);
|
||||||
|
Mockito.when(snp.getRowDataChildValue(Mockito.any(Element.class), Mockito.anyInt()))
|
||||||
|
.thenCallRealMethod();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="pl">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Witryna ucznia i rodzica – Oceny</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main class="mainContainer">
|
||||||
|
<h1>Oceny</h1>
|
||||||
|
<div class="filters">
|
||||||
|
<div>
|
||||||
|
<label for="okresyKlasyfikacyjneDropDownList">Okres klasyfikacyjny:</label>
|
||||||
|
<select id="okresyKlasyfikacyjneDropDownList" name="okresyKlasyfikacyjneDropDownList">
|
||||||
|
<option selected="selected" value="1234">1</option>
|
||||||
|
<option value="1235">2</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table class="ocenyZwykle-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Przedmiot</th>
|
||||||
|
<th>Oceny cząstkowe</th>
|
||||||
|
<th>Średnia</th>
|
||||||
|
<th>Przewidywana ocena roczna</th>
|
||||||
|
<th>Ocena roczna</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>Zachowanie</td>
|
||||||
|
<td class="break-word">Brak ocen</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>bardzo dobre</td>
|
||||||
|
<td>bardzo dobre</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Język polski</td>
|
||||||
|
<td class="break-word">0</td>
|
||||||
|
<td>3,53</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>dobry</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Wychowanie fizyczne</td>
|
||||||
|
<td class="break-word">0</td>
|
||||||
|
<td>5,05</td>
|
||||||
|
<td>bardzo dobry</td>
|
||||||
|
<td>celujący</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Język angielski</td>
|
||||||
|
<td class="break-word">0</td>
|
||||||
|
<td>4,4</td>
|
||||||
|
<td>4/5</td>
|
||||||
|
<td>bardzo dobry</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Wiedza o społeczeństwie</td>
|
||||||
|
<td class="break-word">Brak ocen</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</main>
|
||||||
|
<footer>wersja: 17.02.0000.23328</footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,64 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="pl">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Witryna ucznia i rodzica – Oceny</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main class="mainContainer">
|
||||||
|
<h1>Oceny</h1>
|
||||||
|
<div class="filters">
|
||||||
|
<div>
|
||||||
|
<label for="okresyKlasyfikacyjneDropDownList">Okres klasyfikacyjny:</label>
|
||||||
|
<select id="okresyKlasyfikacyjneDropDownList" name="okresyKlasyfikacyjneDropDownList">
|
||||||
|
<option value="1234">1</option>
|
||||||
|
<option selected="selected" value="1235">2</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table class="ocenyZwykle-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Przedmiot</th>
|
||||||
|
<th>Oceny cząstkowe</th>
|
||||||
|
<th>Przewidywana ocena roczna</th>
|
||||||
|
<th>Ocena roczna</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>Zachowanie</td>
|
||||||
|
<td class="break-word">-</td>
|
||||||
|
<td>bardzo dobre</td>
|
||||||
|
<td>bardzo dobre</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Praktyka zawodowa</td>
|
||||||
|
<td class="break-word">-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>celujący</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Metodologia programowania</td>
|
||||||
|
<td class="break-word">-</td>
|
||||||
|
<td>bardzo dobry</td>
|
||||||
|
<td>celujący</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Podstawy przedsiębiorczości</td>
|
||||||
|
<td class="break-word">-</td>
|
||||||
|
<td>3/4</td>
|
||||||
|
<td>dostateczny</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Wychowanie do życia w rodzinie</td>
|
||||||
|
<td class="break-word">-</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</main>
|
||||||
|
<footer>wersja: 17.05.0000.24042</footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,119 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="pl">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Witryna ucznia i rodzica – Dane ucznia</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main class="mainContainer">
|
||||||
|
<h1>Dane podstawowe</h1>
|
||||||
|
<h2>Dane osobowe</h2>
|
||||||
|
<article>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">Imię (imiona) nazwisko:</span>
|
||||||
|
<span class="wartosc">Maria Aneta Kamińska</span>
|
||||||
|
</div>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">Data i miejsce urodzenia:</span>
|
||||||
|
<span class="wartosc">01.01.1900, Warszawa</span>
|
||||||
|
</div>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">PESEL:</span>
|
||||||
|
<span class="wartosc">12345678900</span>
|
||||||
|
</div>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">Płeć:</span>
|
||||||
|
<span class="wartosc">Kobieta</span>
|
||||||
|
</div>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">Obywatelstwo polskie:</span>
|
||||||
|
<span class="wartosc"> Tak </span>
|
||||||
|
</div>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">Nazwisko rodowe:</span>
|
||||||
|
<span class="wartosc">Nowak</span>
|
||||||
|
</div>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">Imię matki i ojca:</span>
|
||||||
|
<span class="wartosc">Gabriela, Kamil</span>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
<h2>Dane adresowe</h2>
|
||||||
|
<article>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">Adres zamieszkania:</span>
|
||||||
|
<span class="wartosc">ul. Sportowa 16, 00-123 Warszawa</span>
|
||||||
|
</div>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">Adres zameldowania:</span>
|
||||||
|
<span class="wartosc">ul. Sportowa 17, 00-123 Warszawa</span>
|
||||||
|
</div>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">Adres korespondencji:</span>
|
||||||
|
<span class="wartosc">ul. Sportowa 18, 00-123 Warszawa</span>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
<h2>Kontakt</h2>
|
||||||
|
<article>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">Telefon:</span>
|
||||||
|
<span class="wartosc">005554433</span>
|
||||||
|
</div>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">Telefon komórkowy:</span>
|
||||||
|
<span class="wartosc">555444333</span>
|
||||||
|
</div>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">E-mail:</span>
|
||||||
|
<span class="wartosc">wulkanowy@example.null</span>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
<h1>Rodzina</h1>
|
||||||
|
<article>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">Nazwisko i imię:</span>
|
||||||
|
<span class="wartosc">Marianna Pająk</span>
|
||||||
|
</div>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">Stopień pokrewieństwa:</span>
|
||||||
|
<span class="wartosc">matka</span>
|
||||||
|
</div>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">Adres:</span>
|
||||||
|
<span class="wartosc">ul. Sportowa 16, 00-123 Warszawa</span>
|
||||||
|
</div>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">Telefony:</span>
|
||||||
|
<span class="wartosc">555111222</span>
|
||||||
|
</div>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">E-mail:</span>
|
||||||
|
<span class="wartosc">wulkanowy@example.null</span>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
<article>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">Nazwisko i imię:</span>
|
||||||
|
<span class="wartosc">Dawid Świątek</span>
|
||||||
|
</div>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">Stopień pokrewieństwa:</span>
|
||||||
|
<span class="wartosc">ojciec</span>
|
||||||
|
</div>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">Adres:</span>
|
||||||
|
<span class="wartosc">ul. Sportowa 18, 00-123 Warszawa</span>
|
||||||
|
</div>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">Telefony:</span>
|
||||||
|
<span class="wartosc">555222111</span>
|
||||||
|
</div>
|
||||||
|
<div class="daneWiersz">
|
||||||
|
<span class="tytul">E-mail:</span>
|
||||||
|
<span class="wartosc">wulkanowy@example.null</span>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
</main>
|
||||||
|
<footer>wersja: 17.02.0000.23328</footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
x
Reference in New Issue
Block a user