johnmorris01 Posted September 26, 2016 Share Posted September 26, 2016 (edited) Following on from: http://www.frogcommunity.com/app/os?site=custom-assignments-widget and also http://forum.froginfra.net/forum/froglearn-aa/code-snippets/6016-custom-assignment-widget from the old Forums, I was wondering if there is a way of tweaking the widget that Chris posted about to have the Subject and/or Teacher showing instead of the task description? I think it would work better for us when placed as a Dashboard item. In its default form, the student has no idea who has set the homework until they click into the homework task so being able to see the Subject at the very least would be helpful. Thanks! Edited September 26, 2016 by johnmorris01 Link to comment Share on other sites More sharing options...
Graham Quince Posted September 28, 2016 Share Posted September 28, 2016 Hi @johnmorris01 Just taking a look the various tutorials we have on this and actually, I think the code in the Understanding APIs tutorial https://www.frogcommunity.com/understanding-api/student-assignments gets you closest. @Chris.Smith is quite busy at the moment, but I'll see if he can jump in too. 1 Link to comment Share on other sites More sharing options...
Chris.Smith Posted October 12, 2016 Share Posted October 12, 2016 Hey @johnmorris01, My best recommendation is to inspect the API response and look at the data structure to find the data you want. If your not sure how to do this, I really recommend @Graham Quince's tutorial on Understanding API's. For example, to get the subject name, on inspection of the API response you would see that there is a subject object on the assignment object, and within that a name attribute. { "assignment": { "subject": { "name": "English" } } } So in our code we would say: assignment.attr('subject').name Interestingly, the creator is not included as part of the assignment object. it is in fact a sibling attribute. I recommend that in the data converter, you move the creator into the assignment as an attribute of the assignment. return Object.values(response).map(function(assignment) { assignment.assignment.creator = assignment.creator; return assignment.assignment; }); This particular endpoint happens to be covered on the old FDP site. http://fdp.frogcommunity.com/questions/view/485/get-assignments-assigned-to-a-user It's worth saying that we are updating our FDP API reference. Hope this helps, ~Chris Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now