Jump to content

MIS Linked Documents widget


gbligh

Recommended Posts

I think we are there now:

var data = JSON.parse(response.response[i].data);
if (data[0].child in this.receipts) {
  for (var x = 0; x < data.length; x++) {
    this.receipts[data[0].child].push(data[x]);
  }
  this.receipts[data[0].child].sort(function(a, b){return b.datetime-a.datetime});
} else {
  this.receipts[data[0].child] = data;
  this.receipts[data[0].child].sort(function(a, b){return b.datetime-a.datetime});
}

@Graham Quince please feel free to take the updated widget and app.

@simon brahan thanks for your help!

  • Thanks 1
Link to comment
Share on other sites

2 minutes ago, pconkie said:

I think we are there now:


var data = JSON.parse(response.response[i].data);
if (data[0].child in this.receipts) {
  for (var x = 0; x < data.length; x++) {
    this.receipts[data[0].child].push(data[x]);
  }
  this.receipts[data[0].child].sort(function(a, b){return b.datetime-a.datetime});
} else {
  this.receipts[data[0].child] = data;
  this.receipts[data[0].child].sort(function(a, b){return b.datetime-a.datetime});
}

@Graham Quince please feel free to take the updated widget and app.

@simon brahan thanks for your help!

Code review time!

  • Since you're using the child id a lot, it might be helpful to pull it into a variable.
  • If you move the sort line out of the if statement you can remove the duplicate line in the other branch, which means you only have to fix it once if anything changes.
  • Arrays have a concat method that can be used to add the contents of an array to the end of another array. This should be faster than pushing the entries one at a time.
  • The overall logic might be clearer in future if you handle the initialisation of this.receipts before trying to add data.

Add those together, you get something like the following:

var data = JSON.parse(response.response[i].data);
var childId = data[0].child;

// If we haven't seen any data for this child, initialise their record here
if (!(childId in this.receipts)) {
    this.receipts[childId] = [];
}

// Add the new records to the end of the old ones
this.receipts[childId] = this.receipts[childId].concat(data);

// Sort the child's records
this.receipts[childId].sort(function(a, b){return b.datetime-a.datetime});

At the moment the code will also sort the receipts for a child every time records for that child are found; it shouldn't be too big a deal here since you're only likely to have one or two records per child.

None of the above is essential, just thought you might like some insight as to how we approach things here. ?

  • Thanks 2
Link to comment
Share on other sites

On 04/07/2019 at 15:50, simon brahan said:

Code review time!

  • Since you're using the child id a lot, it might be helpful to pull it into a variable.
  • If you move the sort line out of the if statement you can remove the duplicate line in the other branch, which means you only have to fix it once if anything changes.
  • Arrays have a concat method that can be used to add the contents of an array to the end of another array. This should be faster than pushing the entries one at a time.
  • The overall logic might be clearer in future if you handle the initialisation of this.receipts before trying to add data.

Add those together, you get something like the following:


var data = JSON.parse(response.response[i].data);
var childId = data[0].child;

// If we haven't seen any data for this child, initialise their record here
if (!(childId in this.receipts)) {
    this.receipts[childId] = [];
}

// Add the new records to the end of the old ones
this.receipts[childId] = this.receipts[childId].concat(data);

// Sort the child's records
this.receipts[childId].sort(function(a, b){return b.datetime-a.datetime});

At the moment the code will also sort the receipts for a child every time records for that child are found; it shouldn't be too big a deal here since you're only likely to have one or two records per child.

None of the above is essential, just thought you might like some insight as to how we approach things here. ?

I should go on holiday more often ? 

I quickly scanned the thread, so I am kinda up to speed - the issue was that you were trying to save something to the datastore that was using the uuid of a child for one of the parents - and it wouldn't let you, correct? In that case, I will speak to @simon brahan about this, because we do have helpers that allow us to easily check if a parent has permission to see data related to a child (e.g. they need parental responsibility over that child etc).

I'm pretty sure that the helper also checks the court order flags from your MIS systems as well. It may be worth investigating how easy it would be to alter the FDP endpoint to do this check on a passed user. I suspect it would be trivial.

Something to think about at least.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Thank you for the new coded widget, its exactly what parents were asking for, I love it. 

We use frog to send our children their GCSE results as we are unable to email them and as we are international, its difficult for students to come and collect them. Its worth noting that students are unable to see any of the documents using the new widget and so have had to switch back to the frog one for student viewing. 

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

We've used this widget with our first push out of documents to Parents using frog. It seems to have worked perfectly. However, the read receipts doesn't appear to be picking up when they have been opened.

When we tested it we used parents that work in the school and they can see the reports absolutely fine, but it is not showing that they have read it. What might we be doing wrong?

Link to comment
Share on other sites

  • 2 weeks later...
On 21/12/2019 at 07:16, pdurber said:

We've used this widget with our first push out of documents to Parents using frog. It seems to have worked perfectly. However, the read receipts doesn't appear to be picking up when they have been opened.

When we tested it we used parents that work in the school and they can see the reports absolutely fine, but it is not showing that they have read it. What might we be doing wrong?

Ah - was this something to do with a role parents needed?   @pconkie - does that ring a bell?

@adamw ?

Link to comment
Share on other sites

Thank you for giving your time to this.

Just a small question about the reporting widget. in the "Name of the report" field, do I need to put part of the filename that the parents see, or part of the filename that it is called in the Parent Manager?

So if the parents see the name as "Report 19-20 Y10 PC1 for <student name>" and in parent manager it is seen as "49c15f91<student name>-012529-Y10 PC1.pdf" What do I type into the reporting field?

Cheers

Link to comment
Share on other sites

36 minutes ago, pdurber said:

Thank you for giving your time to this.

Just a small question about the reporting widget. in the "Name of the report" field, do I need to put part of the filename that the parents see, or part of the filename that it is called in the Parent Manager?

So if the parents see the name as "Report 19-20 Y10 PC1 for <student name>" and in parent manager it is seen as "49c15f91<student name>-012529-Y10 PC1.pdf" What do I type into the reporting field?

Cheers

In this case you should use “19-20 Y10 PC1” as the name of the report.

Link to comment
Share on other sites

6 hours ago, pdurber said:

So now, shame-facedly I have to say I can now see the read receipts.

I hope you've not spent any time trying to fix something that wasn't actuslly broken - sorry. User Error.

Was about to! But thought I’d check back here first..... to be fair it has become quite difficult to follow this thread now and work out exactly why you have to do! Glad it is working.

Link to comment
Share on other sites

  • 3 weeks later...
On 31/01/2020 at 16:35, gbligh said:

Had a few parents say their latest report isn't showing - I logged in as a few and can confirm it. It looks like it's not showing the latest report - @pconkie 

Not sure if it's just us?

I can't replicate this - the most recent set of reports we did was 23/01/20 and these are appearing for parents.  There have been some weird things happening since the patch last week - have you done any reports since then? Are there any error messages in the console (right click -> inspect --> console tab) that could shed any light?

Even if the problem was obvious, FrogCode was broken last Wednesday, so I don't even have a way of fixing the issue!

Link to comment
Share on other sites

On 01/02/2020 at 19:10, pconkie said:

I can't replicate this - the most recent set of reports we did was 23/01/20 and these are appearing for parents.  There have been some weird things happening since the patch last week - have you done any reports since then? Are there any error messages in the console (right click -> inspect --> console tab) that could shed any light?

Even if the problem was obvious, FrogCode was broken last Wednesday, so I don't even have a way of fixing the issue!

I would do this however I have no knowledge of what I"d be looking for in the console!

Link to comment
Share on other sites

12 minutes ago, pconkie said:

The console would normally be blank. Unless there is a problem and then there could be a red error message

If I log in as a parent, then share a screenshot of the console, would that help?

Link to comment
Share on other sites

  • 4 weeks later...

Here's a quick guide to using the widget and application (thank you for making these tools @pconkie)

These FrogCode tools work with FrogParent, so you do need this licence in order to make use of them.  Contact @Graham Quince on the forums or email Frog Support for us to install them for you.  Although, please remember these have been built in FrogCode and we cannot offer support or requests for change.

 

Linked Documents Widget

This widget works for Parents to display any reports for their children, without needing to use the Select User widget or the Select Date widget.  It automatically loads in a parent's children.  To test, you will need a parent account or have an admin/staff account with a child set in the relationships field (see Guide to the Users app)

linkeddocs.png

 

Report Read Receipts

This application sits within FrogDrive > Applications.  I believe it was conceived as a way for tutors to check if their class' parents had read the reports about their child.

To use, search for a class, then enter the exact name of the report you wish to check.  For instance, to see the read receipts for the top report in the screenshot, enter "Progress Y7 First Impressions Autumn 15".  Entering "First" or "Autumn 15" will not return any results.

The read receipt triggers on opening the PDF within Frog, not on downloading.  You cannot export the results to a spreadsheet.

reports read receipt.png

 

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...