Jump to content

Chris.Smith

School User
  • Posts

    139
  • Joined

  • Last visited

Posts posted by Chris.Smith

  1. 24 minutes ago, pconkie said:

    This is the error in the console when the frogcode widget opens. Any devs got any ideas if this is stopping the app from closing?Capture.PNG.f69f2273dc7499b02a71ed4ab39baf7f.PNG

    Hi @pconkie,

    This was introduced in the last patch. We have fixed it but I have no idea when that fix will get to you. @Graham Quince can you chase this one from a customer perspective as then Paul won't have to wait until Galileo for the fix.

     

    ~ Chris

    • Thanks 1
  2. 33 minutes ago, Matt Mason said:

    Morning all.  We have just had the Christie release installed on our platform and a previously working HTML widget has stopped working with the error 'Malformed Javascript'. I have been told that FROG created this code for us originally.  The code basically pulls data from the dataviewer and displays it in a custom way.  After some investigation the error seems to be due to the line of code below. You get the error TypeError: Illegal module name "//dataviewer/models/form_model" in the console.

    
    steal('//dataviewer/models/form_model.js').then(function()

    Below is the full code and any help with this will be much appreciated.  Matt
     

    
    <style>
        .greenshawTable {
            background:#FFFFFF;
            margin:20px;
            width:90%;
            font-size:12pt;
        }
        .greenshawTable th {
            background:#CCCCCC;
        }
    </style>
    
    
    <script>
     var movementTable = $("<table>", {
                            id: Frog.Utilities.generateSimpleId()
                          });
    movementTable.addClass('table');
    movementTable.addClass('greenshawTable');
    movementTable.html(
       '<tr>'+
            '<th><b>Attn</b></th>'+
            '<th><b>Notice</b></th>'+
            '<th><b>Submitted by</b></th>'+
            '<th><b>Submitted time</b></th>'+
            '<th><b>Day of Week</b></th>'+
        '</tr>'
    );
      
    
    if (!Array.prototype.findIndex) {
        Array.prototype.findIndex = function(predicate) {
            if (this === null) {
                throw new TypeError('Array.prototype.findIndex called on null or undefined');
            }
            if (typeof predicate !== 'function') {
                throw new TypeError('predicate must be a function');
            }
            var list = Object(this);
            var length = list.length >>> 0;
            var thisArg = arguments[1];
            var value;
    
            for (var i = 0; i < length; i++) {
                value = list[i];
                if (predicate.call(thisArg, value, i, list)) {
                    return i;
                }
            }
            return -1;
        };
    }
    steal('//dataviewer/models/form_model.js').then(function() {
        var formUuid = '6334FCA52003E978E8C4EFC54BD6C5044AAD2E4CDCCBB0AE';
        Dataviewer.Models.Form.findAll({
            content_uuid: formUuid,
            sort_dir: 'DESC',
            sort_field: 'date',
            limit:100
        }).done(function(responseDataModel) {
            //console.log(responseDataModel);
                    responseDataModel.forEach(function(data, index) {
                    var myArray = new Array('','','');
                    for (var i=0;i<3;i++) {
                        myArray[i]=data.fields[i].responses[0].response;
                    }
                        //console.log(trumpArray);
                    movementTable.append("<tr>"+
                                        "<td>"+myArray[0]+"</td>"+
                                        "<td>"+myArray[1]+"</td>"+
                                        "<td>"+data.user.displayname+"</td>"+   
                                        "<td>"+
                                           moment.unix(data.responded_on).format("HH:ss DD/MM/YYYY")+
                                        "</td>"+                                       
                                         "<td>"+myArray[2]+"</td>"+
                                        "</tr>"
                        );
                    });
            //});
        }).fail(function() {
            // these are not the results you are looking for.
        });
        
    });
    this.element.append(movementTable);    
    
    
    </script>

     

    Hi @Matt Mason,

    In the Da vinci release, we updated the library that loads FrogOS (StealJS). Unfortunately, the new version of that library works slightly differently to the old one. Here is the change you need to make.

    steal.import('dataviewer/dataviewer!frog-component').then(function() {
        var formUuid = '..';
        // the rest should be the same
    });

    As always, let us know how you get on and if you have any other questions don't hesitate to ask.

     

    ~ Chris

    • Thanks 2
  3. On 15/12/2017 at 09:42, Chris.Smith said:

    Hey Paul,

    This looks like an issue with release 7.1.1 - I know where the problem is and how to fix it, we are working with our rollout team to figure out when we can get this fix to you.

    ~ Chris

     

    On 15/12/2017 at 10:51, Chris.Smith said:

    Hey Paul,

    This is now fixed. At our end and hopefully will be with you soon.

    @Graham Quince Can you follow up with the release team later today to find out when Paul can expect to get this fix.

     

    ~ Chris

    Hi @pconkie,

    I've just helped the release team perform User Acceptance Testing (UAT) on this bug in the upcoming 7.2 release which should be with you inside of the next few weeks.

     

    ~ Chris

    • Like 1
    • Thanks 1
  4. Just now, Virginia Baldock said:

    Fantastic. Thank you so much - and so quick!!

    I have installed the widget and built the page but it isn't working quite right. If I click on the 2nd page it scrolls back to the 1st page but then doesn't scroll onto the second.

     

    Here is the page :

    http://frog.judd.kent.sch.uk/displayscreen

    in case I have done something silly.

     

    Yes - please don't explain to me how it works - if Graham can't understand it then I don't have any chance!!

    Hi Virginia,

    It looks to be working fine to me... Worth pointing out that it's not designed to handle human interference (clicking on the 2nd page) as it keeps an internal record of where it is. I didn't think in the case of digital signage that such a requirement would exist :S

    Let me know if this is something you need adding.

    ~ Chris

  5. 1 hour ago, Virginia Baldock said:

    Sounds perfect. Yes please.

    Hi Virginia,

    I've created you a FrogCode Widget which does everything that you need it to... I say "need" because due to time and technical limits I have not been able to implement transition effects (fade in/out).

    When you come to use the widget, make sure it is on the first page of the site only... this is important. Once on, it will be invisible when the site is live. In edit mode, you will be able to set a time in seconds for how long each page is visible before it proceeds to the next page. The last page will wrap back to the beginning.

     

    Please note that the timings won't be 100% reliable due to how JavaScript works. I could explain it but, when I explained it to Quincy he needed a sit down and a cup of tea to fix him. Ultimately, the pages will be visible for the amount of time you've specify at a minimum.

    If you need any help installing this widget, let us know, otherwise you should be good to go!

     

    ~ Chris

    5F9F0F832001BD9A84355FD5266C4D02419699EC9881C2AC.tgz

    • Like 1
  6. 27 minutes ago, Virginia Baldock said:

    Thanks Sam. Great to have a reason. We could just get away with just a couple of nested pages and change the content during the week. And buy the Dining Hall a clock!

    Yes please if we could have help from a developer. Hopefully we will just need a pointer, something to get us started and hopefully we can work the rest out ourselves.

    Hi Virginia,

    So the suggestion is to have one site that your raspberry pi's can view. We can then use a combination of nested page widgets and external embed widgets to add content from frog and external websites respectively. Being digital signage, obviously we are going to want something that will cycle through the pages, displaying the content for a set amount of time for each page.

    Does this all sound correct?

    ~ Chris

  7. 13 hours ago, pconkie said:

    Thanks @Chris.Smith I've been able to get this to work now.

    I could really do with disconnecting firebase when the site or app is closed rather than what it does by default (when the browser is closed).

    According to the docs....

     

    So, is there an event i can use from inside the app that runs code every time the app is closed?

    Thanks

    Paul

    Hi Paul,

    There are two methods of catching the "close" event on an app. The first is move involved than the other.

    {
        'app.close': function(el, ev) {
            this.closeFirebaseConnection();
            this.trigger('os.app.close'); // <--- This has to be run or the app will not close!!!
        }
    }

    The next one is the advised one to use...

    {
        onClose: function(close) {
            this.closeFirebaseConnection();
            close(); // <-- Tells FrogOS that you are ready for the app to close.
        }
    }

    Both are fine to use, however the onClose hook is safe from future changes.

     

    Hope that answers your question,

    ~ Chris

    • Thanks 1
  8. On 17/08/2017 at 16:22, pconkie said:

    Hi @Chris.Smith

    Glad to see you back!  Thanks for the updates today, first issue.....

    No matter what app i pick, i get a uncaught steal.js error.  Code, widget and console error below.

    Capture.thumb.PNG.24c03e4375d86052eae0d6c2e6ebae69.PNG

     

    Plus if this was working, how would i access the string: 'student' in the app?

    Cheers

    Paul

     

    @pconkie,

    There is are a differences between native platform apps and FrogCode apps and unfortunately this is one. Because there may be another app on the system called 'polls', you have to enter your package's id. There is currently a problem with the openApp method however, so use the following example to get you started:
     

    this.trigger('os.internal.launchapp', {
        name: appID,
        view: 'student',
        appModel: new Com.Frog.Model({
            'uuid' : appID,
            'role_name': Object.values(_Roles.serialize()).filter(function(role) {
                return /app\.externalapps\.(?:[0-9A-F]{8}\.)+polls$/gim.test(role);
            })[0],
            'extended_data' : {
                'from_package' : true
            }
        })
    });

    Don't look deeply into exactly what is going on here, as I will be fixing this as soon as I get chance.

    ~ Chris

    • Thanks 1
  9. On 17/08/2017 at 18:57, pconkie said:

    Amazing, thank you.

    Exactly. How would this be passed to the app we are opening? Inside app.render()? What would be required to read and use the object inside the app?

    thanks. 

    Hi @pconkie,

    When an app is opened with some data - or options - it is available from instantiation as it may be required to tell the app how to set up, where to deeplink to, etc. This is done in the form of an object that is assigned to the prototype scope - this.options

    Consider the following example:

    // package/widget/48F1...AB73/widget.js
    
    FrogOS.openApp('7C974713200486AFDC475F8BD94B0000FD3A143C6506D1A6', {
    	foo: 'bar'
    });
    
    // package/application/7C97...D1A6/production.js
    
    Com.Frog.Controllers.Application.extend('7C974713200486AFDC475F8BD94B0000FD3A143C6506D1A6.Controllers.Core', {
        defaults: {
        	foo: 'baz'
        }
    }, {
        packageID: '7C974713200486AFDC475F8BD94B0000FD3A143C6506D1A6',
    
        init: function() {
            this.main();
        },
    
        update: function(options) {
            this._super(options);
            this.main();
        },
    
        main: function() {
            this.render();
        },
    
        render: function() {
            this.element.html(
                this.view('main.ejs', { title: this.options.foo }) // renders out <h1>Bar</h1>
            );
        }
    });

    You open your app by passing the package id into FrogOS.openApp as the first param, your data is the second param. Your app will then open/focus and FrogOS will set the apps options to match/include the data passed in. When opening the app, this.options is set to the contents of the defaults object in the static object; which is then overridden by the data passed in. When focusing the application (calling openApp when there is already one open) your entry point is the update method. this._super(options) merges the any new data with the existing this.options.

    In this example:

    • we started with a default of this.options.foo = 'baz'.
    • We initialised with a value of 'bar' so this replaced 'baz' as this.options.foo = 'bar'.
    • If we tried to open the application again, this time with a different value, 'bar' would be overwritten by that value.

    There are some complications that you may experience depending how complex this setup gets, but usually you should be fine.

     

    ~ Chris

  10. On 03/07/2017 at 15:31, sfoster said:

    Hello All,

    Just wondered if if it was possible for Frog to share with us (schools) a boilerplate for the responsive themes so that schools can create their own from the templates.

    Also, I do recall some time ago being promised that we would be able to create, validate and upload our own themes onto the platform directly.  At present we are still using the old standalone theme checker and having to sent themes over to Frog to be installed onto the platform for us - Has this piece of work been shelved?  

    Is anyone still activity creating / designing themes?  There was a huge buzz a couple of years ago but it seems to have all but disappeared....

    Simon

     

    On 04/07/2017 at 09:57, Graham Quince said:

    I see what you mean. However the theme itself is mobile responsive when it's uploaded to FrogLearn.

    I think what we're seeing here is a clash between the old theme builder and more up-to-date scripts for mobile responsiveness.   I'm starting to think what we need is a method for running a theme .ejs script inside Frog.

    @Chris.Smith - if i upload the contents of a theme to a FrogCode app, would I be able to preview it?  i feel like it would still be missing elements.

    @sfoster - The work hasn't been shelved... I still intend to add the ability for you to develop themes inside of FrogCode and add them to the system yourself; however there is more demand for other features than for themes. That being said, the people who want other things will probably also want themes as well. If it's not already on the ideas portal please create the idea and get as many people as you can up-vote it. The more noise there is, the more it is likely to get to the top of the page.

    @Graham Quince - It won't work. Also can you co-ordinate with @sfoster with regards to the Ideas portal.

     

    ~ Chris

  11. On 08/07/2017 at 22:01, pconkie said:

    Sharing this in case it is of use to anybody else.....

    I've been looking at creating a widget that is aware of and can interact with other widgets around it.

    As a test case I've made a "class discussion" widget that is like a forum, but only for members of a pre-determined class. Even then, some members of the class are allowed to see what others are writing and others are not. Some get a writing frame to structure their response and others don't. 

    This widget needs to "take over" a forum widget in order to save the settings I've mentioned and also to save the students responses. However I want to avoid having to use the console to inspect the forum and go hunting for it's uuid. 

    So far I've got this....

    https://drive.google.com/open?id=0B2QYvi40BJqDSWI5dWZOZmJPUlE

     

    On 09/07/2017 at 10:10, Graham Quince said:

    A widget preference to select another widget would be really useful.   If you post it on the ideas portal, I'll get interest going in the office.

    @Chris.Smith - Is a widget preference like this is possible?

    @pconkie, @Graham Quince,

    It's pretty niche, a better approach would be for @Graham Quince to convince the management to let us open source the Forum widget as a FrogCode widget thus allowing @pconkie to copy it, and update it to his own needs.

    However, if you want to go down the preference route, then there are a copy of approaches I can think of. The best would be to add a hidden preference to the widget, and then in edit mode get the user to click on the widget they want the "Class Discussion" widget to listen to. You could then store its content uuid in the hidden preference's value attribute.

    Let me know how you get on,

     

    ~ Chris

  12. @pconkie, @Graham Quince, @ADT,

    I have arisen... 

    @pconkie - Lets answer these questions:

    1. The correct url for your assets is '//package/{type}/{uuid}/assets/picture.png'
      You may get problems previewing your image as this is served from a different address. You can change 'package' to 'staging', just don't forget it change it back. This won't be the case after the October release.
    2. If you haven't already, checkout the documentation (https://froglearn.backwellschool.net/app/lib/packaging/docs/Preferences.App.html) for the app preference. The App preference returns the Apps UUID. You can then use the App Lib Model to get a the rest of the info you need.
      if (this.prefs.app.value) {
        	this.showLoader();
      	Lib.Models.Applications.findOne(this.prefs.app.value)
        	  .always(this.hideLoader.bind(this))
            .fail(this.handleError.bind(this))
        	  .done(
            	  function(app) {
                    this.app = app;
                	  this.render();
                }.bind(this)
            );
      }

      I'm guessing you'll then want to use the CodeEditor pref to store the object you want to send to the app. That in itself is a nice little widget.

      With regards to testing if an app is already open, you can use this code:

      // Inside your Widget/App controller
      var apps = {};
      this.trigger('os.app.getRunning', function(running_apps) {
      	// this code is synchronous!
      	// data structure is {"app_name": num_instances}
      	apps = running_apps;
      });
      // FC apps use their uuid's to open!
      if (this.app.getUuid() in apps) {
      	// Your app is already open
      }

       

    3. Our Document conversion service does not have an API unfortunately. It is driven independently from within the Server.

    @ADT - ¬¬

     

    ~ Chris

    • Like 1
    • Thanks 1
  13. On 13/08/2017 at 13:38, pconkie said:

    I've seen this in action in frog e.g. frog drive can be opened to a particular folder, quiz manager can be opened to a particular quiz etc

    If I have built a frog code app, how could i open it from a site and send it some data? This works to open a site....

    
    FrogOS.openSite({
      site: $assignment.data('assignment-link'),
      assignment_uuid: $assignment.data('assignment-uuid')
    });

    But i can not get any variations of this to work...

    
    FrogOS.openApp({
      app: app.uuid,
      param: app.data
    });

    @Chris.Smith, @Graham Quince ideas?

    Paul

    Hi @pconkie,

     

    Sorry for the delay... It's taken me til today to get back at the head of the charge...

    Hopefully this should help.

    https://froglearn.backwellschool.net/app/lib/packaging/docs/FrogOS.html#.openApp__anchor

     

    FrogOS comes with some built in documentation which is install-able via the Package Manager; here's the relevant page though.

     

    Let me know how you get on,

     

    Chris

    • Thanks 1
  14. @clangstaff,

    You can but not as directly as you would probably like. If you open Assignment Manager and filter to a particular Student, the resulting network request in Developer Tools should give you some ideas. The keys you need to look out for are:

    • Report Name
    • Filters
    • Options

    Stay away from limit and offset. I don't think the order object is particularly important in your use case.

    Hope this helps,

     

    ~ Chris

    • Like 1
  15. 32 minutes ago, sfoster said:

    Hello All,


    We have been working on some new widgets for MIS Linked Documents, Attainment and Learner Contacts.  Following the Austin release we too are unable to save or update packages in FrogCode - It is very frustrating for our developer as it seems to be one step forward and two steps back.  We have a ticket open with support on this but have been advised that "We have linked this to our existing bug ticket" with no timeframe for a solution other than it will be rolled out in a scheduled hotfix.

    Any updates @Graham Quince @Chris.Smith

    Radclyffe 

    Hi Simon,

    I am currently logged into your platform looking at the issue now. I will be in touch shortly with an update and hopefully an action plan.

     

    ~ Chris

  16. 51 minutes ago, pconkie said:

    Morning @Graham Quince 

    I had my NM create me a new frog account with access to everything...

    This seems to have sorted the FrogCode issues i was experiencing yesterday.  I have been able to update the widget to sort out the issues with when and where the new notice button should appear.  I have also added in the over-ride to ensure it is off when you want it off.

    Waiting for you when you get a chance to take the latest version.  

    Paul

    PS: I can't see the video that goes with the widget on the showcase.  That might mean loots of other community members can't see it either.  I can see the office365 video if that helps?

     

    Hi @pconkie,

    Does this mean you can save changes again?

    Thanks,

     

    Chris

  17. 11 hours ago, pconkie said:

    Just got Austin yesterday and FrogCode seems to be misbehaving...

    1. Little thing - the alpha badge has been replaced with the beta badge again. 

    2. Several times pressing save gives the usual save notification. But closing the browser and reopening reveals that the changes have been lost (or were never saved). This has never happened before.

    3. Despite incrementing the version number of the widget. And despite getting the right noises from the package manager the widget more often fails to update than updates. Could be linked to #2, not sure.

    Dickens alpha seemed more solid. Hope this info helps in some way.

    P

    Hi Paul,

    Thanks for the feedback on the Austen update. It's really important that we capture this information properly so I am going to forward this on to a member of our support team and hopefully they should be in touch soon.

    @Graham Quince can you co-ordinate getting these issues logged and pushed through.

    Thanks,

     

    Chris

    • Like 1
  18. 13 hours ago, pconkie said:

    Hi @Chris.Smith

    Would you mind jumping on our frog box when you get a chance? Somehow managed to get a duplicate app in frogcode.  It's not showing as duplicate in frogcode editor, but it is in package manager and in applications in frog drive. it's called FrogSeats.

    Thanks

    Paul

    HI Paul,

    Done some digging and I don't know what has happened...

    They both have separate UUID's so its not the ghosting bug we saw recently. What is weird is the UUID I have development activity in the logs for, isn't the one that is showing up in your FrogCode Editor! You also only have in an installation record for the one with the broken icon. According to the Database and the log files, you have never installed the FrogSeats app with the functioning icon (also the one that is in your FrogCode). 

    Because of these issues, @Graham Quince is going to work to get you into the next round of FrogLabs roll outs. In Austen, there are some fixes which are going to help us, identify and isolate the rogue application.

    Unfortunately I can't help you today, but hopefully next week (or after your update) we will be able to resolve this issue.

     

    Thanks,

     

    ~ Chris

  19. 2 hours ago, pconkie said:

    I'm developing an app that needs to save a small amount of configuration data (in json format).  I've tried HTML 5 local storage but my teachers are too mobile for this!

    I'm going to have to use something like firebase but thinking three steps ahead - if another school were to use this app where would they put the config string required to use their firebase? What i really need is some data storage in frog! (I bet that one hasn't been suggested before?!) Is there anywhere i can save the data in frog? It's non sensitive info... 

     Any ideas?

    Paul

    Hi Paul,

    Funnily enough this has come up a few times.. :)

    Unfortunately the isn't anyway currently to store arbitrary data in Frog at the moment. I will doubt check tomorrow for any loop holes or areas we can "re-use" however for the mean time an external service is your friend here. One approach when using a service like Firebase is to key the configuration data with the school uuid which is available within the majority of User Objects.

    I am currently forming the specification for a project called Frog Web Services. It would be great to have a chat at some point and get your input on the proposal in-terms of functionality and features.

     

    ~ Chris

×
×
  • Create New...