KeizerDev / Mister

Just a Magister client for android
https://play.google.com/store/apps/details?id=nl.mister
3 stars 1 forks source link

Cijfers are not showing #10

Closed Vogeltak closed 9 years ago

Vogeltak commented 9 years ago

When I open the Cijfers tab it says "Geen data beschikbaar".

cijfertab
KeizerDev commented 9 years ago

I know, my Cijfers implementation is really bad. May I make a sample app just so you guys can help me with that. The problem is the KolomKop. My query on the cijfersdb is like: SELECT * FROM cijfertable as c WHERE c.kolomkop='ED' GROUP BY c.afkorting ORDER BY c.datumIngevoerd DESC
The problem is that your school doesn't use CijferKolom->KolomKop: "ED" but something like rap1 gem.

Could you confirm this for me by opening /api/personen/PERSOONID/aanmeldingen/CIJFERJAARID/cijfers/cijferoverzichtvooraanmelding?actievePerioden=true&alleenBerekendeKolommen=false&alleenPTAKolommen=false You will see something like that in your console when opening the Cijfers section on Magister.

Vogeltak commented 9 years ago

Mh interesting.

doing some research

Good, when I open /api/personen/PERSOONID/aanmeldingen/CIJFERJAARID/cijfers/cijferoverzichtvooraanmelding?actievePerioden=true&alleenBerekendeKolommen=false&alleenPTAKolommen=false it gives me all of my grades in json. The same goes for /api/personen/PERSOONID/aanmeldingen/CIJFERJAARID/cijfers/cijferoverzichtvooraanmelding though.

A cijfer object looks like this in my case:

{
    "CijferId": 4548978,
    "CijferStr": "9,6",
    "IsVoldoende": true,
    "IngevoerdDoor": null,
    "DatumIngevoerd": "2014-06-30T09:31:30.0000000Z",
    "CijferPeriode": {
        "Id": 2464,
        "Naam": "ED",
        "VolgNummer": 0
    },
    "Vak": {
        "Id": 1308883,
        "Afkorting": "anw",
        "Omschrijving": null,
        "Volgnr": 320
    },
    "Inhalen": false,
    "Vrijstelling": false,
    "TeltMee": true,
    "CijferKolom": {
        "Id": 286493,
        "KolomNaam": "anw903",
        "KolomNummer": "903",
        "KolomVolgNummer": "903",
        "KolomKop": "3w2",
        "KolomOmschrijving": null,
        "KolomSoort": 1,
        "IsHerkansingKolom": false,
        "IsDocentKolom": false,
        "HeeftOnderliggendeKolommen": false,
        "IsPTAKolom": true
    },
    "CijferKolomIdEloOpdracht": 0,
    "Docent": null,
    "VakDispensatie": false,
    "VakVrijstelling": false
}

Here you can see that Naam in CijferPeriode equals ED.

In the following example Naam in CijferPeriode equals P2:

{
    "CijferId": 4739509,
    "CijferStr": "10,0",
    "IsVoldoende": true,
    "IngevoerdDoor": null,
    "DatumIngevoerd": "2015-03-23T07:22:35.0000000Z",
    "CijferPeriode": {
        "Id": 2466,
        "Naam": "P2",
        "VolgNummer": 2
    },
    "Vak": {
        "Id": 1308885,
        "Afkorting": "econ",
        "Omschrijving": null,
        "Volgnr": 311
    },
    "Inhalen": false,
    "Vrijstelling": false,
    "TeltMee": true,
    "CijferKolom": {
        "Id": 285583,
        "KolomNaam": "econ215",
        "KolomNummer": "215",
        "KolomVolgNummer": "215",
        "KolomKop": "proefwer",
        "KolomOmschrijving": null,
        "KolomSoort": 1,
        "IsHerkansingKolom": false,
        "IsDocentKolom": false,
        "HeeftOnderliggendeKolommen": false,
        "IsPTAKolom": false
    },
    "CijferKolomIdEloOpdracht": 0,
    "Docent": "AKE",
    "VakDispensatie": false,
    "VakVrijstelling": false
}

As you can see KolomKop does not give the "cijferperiode". To get to the "cijferperiode" you have to retrieve the value of [CijferPeriode][Naam].

To retrieve all averages, change the GET url to end with /api/personen/PERSOONID/aanmeldingen/CIJFERJAARID/cijfers/cijferoverzichtvooraanmelding?actievePerioden=true&alleenBerekendeKolommen=true&alleenPTAKolommen=false. Notice that the alleenBerekendeKolommen option is set to true.

KeizerDev commented 9 years ago

Yes, that's the point. When I open up /api/personen/PERSOONID/aanmeldingen/CIJFERJAARID/cijfers/cijferoverzichtvooraanmelding?actievePerioden=true&alleenBerekendeKolommen=true&alleenPTAKolommen=false I will see this as a Cijfer object:

{
   "CijferId":2753277,
   "CijferStr":"6,3",
   "IsVoldoende":true,
   "IngevoerdDoor":null,
   "DatumIngevoerd":"2015-03-02T14:46:07.0000000Z",
   "CijferPeriode":{
      "Id":2163,
      "Naam":"PTA",
      "VolgNummer":1900
   },
   "Vak":{
      "Id":311909,
      "Afkorting":"wi",
      "Omschrijving":null,
      "Volgnr":7
   },
   "Inhalen":false,
   "Vrijstelling":false,
   "TeltMee":true,
   "CijferKolom":{
      "Id":203298,
      "KolomNaam":"wi8990",
      "KolomNummer":"8990",
      "KolomVolgNummer":"8990",
      "KolomKop":"ED",
      "KolomOmschrijving":null,
      "KolomSoort":2,
      "IsHerkansingKolom":false,
      "IsDocentKolom":false,
      "HeeftOnderliggendeKolommen":false,
      "IsPTAKolom":false
   },
   "CijferKolomIdEloOpdracht":0,
   "Docent":"GAN",
   "VakDispensatie":false,
   "VakVrijstelling":false
}

As you may noticed, [CijferPeriode][Naam] is PTA and that's the same in every Cijfer object. So I do not really know where I can sort them on so it's working for every school...

KeizerDev commented 9 years ago

Ohh, sorry I misunderstood. When you turn alleenBerekendeKolommen to true you'll get the average of your cijfers. That's cool! I didn't noticed, thanks!

Vogeltak commented 9 years ago

PTA isn't even a "Cijferperiode", lol. For a solution you could check both fields for any of the accepted cijferperiode values: P1, P2, P3 and ED (I believe that's all of them) and use that field for future reference for that device. Not really an elegant solution, but this is not something we can change.

Ah yes, I just found that about the averages out from looking at the url. Didn't know that before, but sometimes the stuff in the url is interesting.

KeizerDev commented 9 years ago

Yeah for sure. I think I've fixed it. Can you update the app and clear your cache?

Vogeltak commented 9 years ago

Cleared cache and updated the application. There are some problems I noticed immediately.

KeizerDev commented 9 years ago

Okay.

Only display averages of one term and let the user select which term.

What do you exactly mean with this? Do you mean [CijferPeriode][Naam]?

Also, order averages by alphabetical order...

My idea was to order them by date of addition, so you know which grade was changed so you can click on the average to see the individual grades.

Scrolling bar hides behind grades.

I'll fix that right now.

Vogeltak commented 9 years ago

What do you exactly mean with this? Do you mean [CijferPeriode][Naam]?

Yup. If you take a look at the picture I provided you can see that for example the subject "WisB" exists multiple times in my grades list. The user does not know that these are averages from different terms (periodes). The user certainly does not know to which term the average belongs. What I mean is that you should order the terms separately. Let the user know which term (P1, P2, P3 or ED) the average belongs to. At the moment this is absolutely not clear.

My idea was to order them by date of addition, so you know which grade was changed so you can click on the average to see the individual grades.

My suggestion is to order the individual grades by date of addition, but to order the averages on alphabetical order. This helps users to quickly go to the subject they want to see their grades of. To indicate a new grade has been added you can pop a little [insert cool color] dot next to the name of the subject in the list of averages or something like that.

Vogeltak commented 9 years ago

What do you exactly mean with this? Do you mean [CijferPeriode][Naam]?

Yup. If you take a look at the picture I provided you can see that for example the subject "WisB" exists multiple times in my grades list. The user does not know that these are averages from different terms (periodes). The user certainly does not know to which term the average belongs. What I mean is that you should order the terms separately. Let the user know which term (P1, P2, P3 or ED) the average belongs to. At the moment this is absolutely not clear.

My idea was to order them by date of addition, so you know which grade was changed so you can click on the average to see the individual grades.

My suggestion is to order the individual grades by date of addition, but to order the averages on alphabetical order. This helps users to quickly go to the subject they want to see their grades of. To indicate a new grade has been added you can pop a little [insert cool color] dot next to the name of the subject in the list of averages or something like that.

KeizerDev commented 9 years ago

I think I can be proud of myself because I've fixed this. I swear this will work for you. If not I will definitely stop with this project :stuck_out_tongue_winking_eye:. I've worked over 7 hours non-stop to fix this bug. It's so annoying. Here is the download link: http://www.filedropper.com/mister

Vogeltak commented 9 years ago

Amazing! It works like a charm! Very well done dude. Mh, but a download link? I thought you were beta testing it in the play store?

Psht, could you sort the subjects on alphabetical ascending order? Then it would be perfect.

KeizerDev commented 9 years ago

Thanks! Yeah for sure, but if I upload it now, you'll get the update over like 2 hours and I thought this was faster for something like this. I'll sort it alphabetical and fix some little bugs, then I will put it in the play store.

Vogeltak commented 9 years ago

Great! You made some really good improvements today. I'm looking forward to more.

Still quite a bummer I can't contibute myself, but oh well.

KeizerDev commented 9 years ago

Thanks, I think I'm going to launch it shortly in the play store as a public app. There are not many things more to add for me. I've to fix some bugs, find some icons for huiswerk and fix some more design issue's...

Yeah sorry dude, I want to keep this project closed sourced as you know. But soon I start a new project. This time though open source so you can contribute if you want to. It's a Grooveshark client for Android!

Btw. I've uploaded the latest version on GP so you'll get the update as soon as possible!

Vogeltak commented 9 years ago

Before you launch it, remember to implement a way to view the individual grades. As for a icon for huiswerk, maybe a little pencil will do.

Aha, well I'm interested in your next project. I don't know what Grooveshark is though, but that is easy to solve.

KeizerDev commented 9 years ago

Yeah sure, I've made a TODO.md, when I've finished that I will make it public.

It's pretty cool, it's like Spotify for free, without ads or Facebook who's tracking you, etc.

KeizerDev commented 9 years ago

I think I've fixed everything we've talked about here. So I'm going to close some issue's