Closed Kulgar closed 9 years ago
Hi Kulgar, sorry I missed this pull request from forever ago, you're absolutely right and normally I prefer merging in PRs to help share the credit, but I ended up fixing this one when someone else came across it as well. Thanks for your feedback!
Hi @whitmer ,
Well, as you can see we (our company) are really intersted in badges and we use them a lot with our own platform. We are facing many issues and thus I modify our badge application code to solve them.
So, that's why I do some PRs :)
Also... just to let you know, I added the i18n gem recently and made all the translations. Would you be interested in a pull request to add translations to canvabadges?
Totally, that'd be great :-).
Hi Whitmer!
It's been a while! I have found a new big bug: my canvabadges application was no longer able to retrieve the progressions of students by modules and thus it was no longer validating my badges.
Let me point that out:
The first line "modules_json" get all the modules back. But! when you want to retrieve the completed module, the array is empty. Why is that?
It seems that the attribute "completed_at" was no longer sent back from the canvas application. I have digged in a little and found this (from the canvas application):
Then the application uses this "modules_and_progressions" to give back the "completed_at" attribute if the user is a student. As the json that canvabadges gets back miss this data, I thought that @student was just nil at this point of the canvas application.
@student is set in a before filter in this same controller:
Ok... So according to this function, the @student is set if params[:student_id] is set when performing the request. Then... I just added this param to the requested url in the check_badge_status function:
And it did the fix! Progressions were retrieved again and badges properly emitted.
I will make a pull request to add this fix.
If you have any feedbacks, don't hesitate!
Thanks!