Version B is not recording data on Tool Labs. BTW, there is now an api2.php that supports recording multiple claims at once, if you want to try it out.
Version: unspecified
Severity: normal
Version B is not recording data on Tool Labs. BTW, there is now an api2.php that supports recording multiple claims at once, if you want to try it out.
Version: unspecified
Severity: normal
Can you give an example URL and what data should be logged and which isn't logged? (Or is the data, already should be logged in DialogB, not logged?).
When I use Version B I notice a request is made to:
It looks like occupation_id and occupation are not being passed but the API is responding with an OK message and need to be passed for data to be logged.
Kaldari sounds like the API should throw an error in this case?
There is a difference in the call of recordOccupation() function of WikiGrokApi. (Unhappily there is no documentation :P). The function is defined to take 3 arguments (occupationId, occupation, claimIsCorrect).
Dialog A gives these three arguments (https://github.com/wikimedia/mediawiki-extensions-MobileFrontend/blob/master/javascripts/modules/wikigrok/WikiGrokDialog.js#L108) and implied, that version A data is logged sucessful, this is the correct call.
In contrast to this, Dialog B gives only one argument (https://github.com/wikimedia/mediawiki-extensions-MobileFrontend/blob/master/javascripts/modules/wikigrok/WikiGrokDialog.js#L108), the answer, which should be occupationId (which is missing in the request). But i would appreciate it to clarify this, before further actions :)
@kaldari: I can't find the api code (maybe i haven't searched enough), but does the api checks for the "correct" value, and when, how? :)
@Florian: That code just lives on Tool Labs right now (for testing). The code is at https://github.com/kaldari/WikiGrokAPI (with some limited documentation). api2.php (which handles multiple claims at once) doesn't have any documentation yet though.
Florian your diagnosis towards the JS bit sounds about right :)
Florian yup to the documentation we have a TODO note to sort this out this week :)
I added more error handling to the API just now. WikiGrok version B definitely needs to pass the occupation_id. The 'correct' param, however, is optional.
Kaldari and i discusses to make the "correct" param to an optional one, so it's not blocking the recording of an answer. Still neded is the occupation_id and occupation param, which should be in request, after we use the same Api call of recordOccupation() like it is in dialog a and like it is defined. After this, it should work.
After i got back my development environment, i can try to work on this, if there is no one other, who did already :)
We need to get a fix out before the next deployment train so I might pick this up Florian if that's okay. But thanks for making it easier for me to work out how :)
Just to clarify: Kaldari means, that there is NO data logged, right? Or just, that it isn't logged, that version b is used? *confused*