Showing posts with label Google. Show all posts
Showing posts with label Google. Show all posts

Sunday, 9 August 2015

GClassroom Share Button in GSites

Google recently released the Classroom API. Part of the API allows for the embedding of a share to classroom button for any 3rd party site. Google has published the code needed to make the buttons appear in web pages on the API pages linked above.

I use Google Sites with my students and have embedded resources, forms, docs etc. that I link to from Classroom so I wanted to embed one of these Share buttons. Adding script to GSites pages is a little tricky but with a little bit of Apps Script it can work!


In the image above, I have added the share button beside the page title; this is done by creating and inserting an Apps Script that has been published as a web app.


I used the HTML Service and the templated Scriptlets to build the HTML I wanted to embed and used the scriptlet to acquire the javascript form Google:


I want to be able to copy a page with the script already in it and have it automagically pull the correct URL from the Site without hard coding the URL each time. The scriptlet code above allows this by using SitesApp.getActivePage().getUrl();

Publish the project as a Web App and insert it into your page:


When pressed, the button opens a window to Classroom and lets you select the class you want to post an announcement or assignment to. Nice :)


Monday, 4 May 2015

Google Sites as an LMS/VLE

I have seen various uses of Google Sites as a resource repository, but have yet to see it work as a true LMS where data is fed into a database and retrieved from a database the way most VLEs like Moodle, Firefly, and Schoology do. I decided that Sites needed more attnetion in regard to data management and have set myself the goal of replicating VLE behaviour using Sites, Sheets and whatever gadgets and coding is required. 

My first foray into using Gsheets as a database was with Andrew Stillman's Reportlet apps script (I had to request the code for Reportlet directly from Andrew). Reportlet does a nice job of representing info from a sheet and charting data, however it can take some 30 seconds to load. After communicating with Andrew with the hope that New Visions would invest effort into tuning the script, it seems that Reportlet is not part of their development program.


Over my next posts on this topic, I will demonstrate how I have used Awesome Table Gadget to pull data from Gsheets to present specific data to the logged in user. I will show how Apps Sheet can be used to build apps for users to log into the same data on Android, IOS and through a web app. Finally, I will demonstrate how to post data to a GSheet using a simple form (based on the work of Martin Hawksey.)

In order for Sites and Sheets to work like an LMS, the data in the GSheet for each student must be as up-to-date as possible; most VLEs do an extraction nightly so that data stored that day is available for the next morning. For this to work, my Student IMS will need to run a scheduled report each evening that exports as a spreadsheet or html file, so that the import functions in Gsheets can refresh each night automatically. The export and import of data from the IMS is the final phase of feasibility testing and should work in theory!

Saturday, 7 March 2015

Lesson planning with Google Sheets and Calendar

When I attended university in Edinburgh, I worked part time in a pizza restaurant. One of the chefs was doing a post graduate degree in psychology; his thesis was on connecting the brain to a peripheral data source to extend the capacity of the brain. I can't help thinking that Smartphones are a big step toward this, along with other research in controlling devices with the mind and eye movement.

Access Timetable GSheet here

For me, I don't remember my timetable; I don't need to if it is on my phone. The problem is getting my timetable and planning off my computer and onto my phone.  Google Apps Script, or GAS, allows the various Google apps to talk to each other so it is possible to build a school timetable into a GSheet and export it to GCal. Inspired by some work by Martin Hawksey and Romain Vialard, I have written/used a script that imports, deletes and exports the content of my calendars, and updates them.

function updateLessons(){
  var sh = SpreadsheetApp.getActiveSheet();
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var calName = sh.getRange("B1").getValue();
  var date_deb = sh.getRange("C1").getValue();
  var date_fin = sh.getRange("D1").getValue();
  var cond = sh.getRange("J2").getValue();
  var line = new Array();
  var toChangeTitleCnt = 0;
  var toChangeCnt = 0;
  var blank = "";
  if(calName=='default'){var cal = CalendarApp.getDefaultCalendar()}
  else{
    var cal = CalendarApp.openByName(calName)};
  if (cal)
  {
    var events = cal.getEvents(new Date(date_deb), new Date(date_fin),{max: 4000});
    var sel= sh.getRange(3,1,sh.getLastRow(), 10).getValues();
    for(e=0;e<events.length;++e){
      var changeFlag = false;
      var ID = events[e].getId();
      for(n=0;n<sel.length;++n){
        if ((sel[n][8] == "x"||sel[n][8] == "X")&&sel[n][0]==ID ){
          changeFlag = true
          sh.getRange(n+3,9,1,1).setBackgroundColor('#55ff55');
          //sh.getRange(n+3,7,1,1).setBackgroundColor('#55ff55');
          //sh.getRange(n+3,6,1,1).setBackgroundColor('#55ff55');
          Utilities.sleep(50);
          SpreadsheetApp.flush();
          Logger.log('FLAG '+ e)
          sh.getRange(n+3,9,1,1).setValue(blank);
          sh.getRange(n+3,9,1,1).setBackgroundColor('#ffffff');
          break
        }
      }
      if(changeFlag){
        try{
          var toChangeTitle = events[e].setTitle(sel[n][5]);
          ++toChangeTitleCnt;
          var toChange = events[e].setDescription(sel[n][6]);
          var toChangeLoc = events[e].setLocation(sel[n][4]);
       
          ++toChangeCnt;
          changeFlag = false;
          Logger.log('Lesson Title updated : '+sel[n][5]);
          Logger.log('Lesson updated : '+sel[n][6]);
          }catch(Err){Logger.log('Event from a series')}
      }
    }
  }
  var msg = toChangeTitleCnt + " lesson titles changed + " + toChangeCnt + " lessons updated in calendar '"+calName+"'";
  ss.toast("Update completed", msg, 3)
  Utilities.sleep(3000)            
}

The update feature above is the one I use most. I teach 8 classes, so each has its own sheet. When I make a change to my planning I run the update function and it updates the events in my calendar; my phone syncs with the calendar and my changes are automatically available to me.

When I am finished planning my week and have updated each class, I run the import Calendar function on my main sheet that pulls all of the events in the calendar back into my GSheet. I have a technician that prepares my science equipment for my classes, so this import is important. The script that runs the import splits the content in the calendar description field to separate my lesson plan from the tech requisitions. With the tech requisitions in a separate column, I have created another equipment sheet that builds my requisitions order for my tech.

function importCalendar(){
  clrdisplay()
  var cal = 0;
  var sheet = SpreadsheetApp.getActiveSheet();
  var calendarName = sheet.getRange("B1").getValue();
  if (calendarName == "default"){
    cal = CalendarApp.getDefaultCalendar();
  } else if (calendarName != "default") {
    cal = CalendarApp.openByName(calendarName);
  }
 
  var events = cal.getEvents(new Date("September 1, 2014"), new Date("August 31, 2015"), {max: 4000});
   var day = new Array();
    day = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]
 
  for (var i=0;i<events.length;i++) {
    var formRow = i+3;
 
    var tech = "=iferror(right(G" + formRow + ",len(G"  + formRow + ")-(find(\"||\",G"  + formRow + "))), \"No Practical Equipment\")";
    var update = "";
    var class = "=LEFT(F" + formRow + ",FIND(\" -\",F" + formRow + "))";
    var temp = ""
     temp = day [events[i].getStartTime().getDay()];
    var details=[[events[i].getId(), temp, events[i].getStartTime(), events[i].getEndTime(), events[i].getLocation(), events[i].getTitle(), events[i].getDescription(), tech, update, class]];
    var row=i+1;
    var range=sheet.getRange(row+2,1,1,10);
    range.setValues(details);
  }
}
function clrdisplay() {
  var sh = SpreadsheetApp.getActiveSheet();
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var LL=ss.getLastRow()
  sh.getRange(3,1,LL,10).clear().setVerticalAlignment('MIDDLE');
} 

A couple of my colleagues have used my planner, and one has changed to use Planner.com, or Planneredu.com. These apps are nice, but I like the customisation building my own has permitted, and that my timetable/lesson plans are on my phone....and that I don't have to print out my tech requisitions because my tech is shared into my planning sheet.

Sunday, 15 February 2015

Collaborative eBooks

I want my students to get more out of being in my classes than simply doing well on the end of module test. I believe in Project Based Learning and in 21st Century Skills, and I want my students to be acquiring these skills as part of their normal class and homework behaviour.

The advent of Google Slides in our domain has allowed me to apply the SAMR model to the concept of the exercise book. In my Y8 class, the students work as a group to create an online exercise book, the EBook, in which all of the classroom theory, investigations, photos, video, tables, graphs, etc. must appear. The students are given a rubric at the start of each module that outlines what is expected of them for each lesson, it also defines presentation and group work expectations. 

The key that seems to have made the concept work is that a group is randomly selected at the start of each lesson to review the previous lesson's content and explain what they found; this has forced the students to do their homework and actually know what they are talking about. Feedback is provided by the class and myself as to the level of content knowledge the students have given, their presentation design, speaking skills and team involvement. 

Google docs is particularly effective in the observation of group involvement and task management skills shown by the students. Successful groups use the commenting functionality to tell  team mates what to do, and question each other as to what else is needed. Since I own the docs that the students use, I see all comments in me mail as they are made and I can monitor and respond where necessary to help out, or just give formative feedback. The revision history in Google docs shows precisely who did what and when; this is extraordinarily useful in identifying who is free-riding, and who is doing everything and not giving the others a chance to do their bit. 

Communication, cooperation, collaboration, team management and task management skills, along with presentation and social knowledge acquisition built in; a SAMR redefinition.

On top of the class presentation, I used the presentations on parents evening to highlight each child's knowledge in front of their parents--they had to present a slide of my choosing to their parents! The authenticity of the parent as an audience had a remarkable effect and I could only congratulate the kids on a job well done.

Sunday, 9 November 2014

Google Apps For Education conference Kuala Lumpur

I presented my use of Andrew Stillman's Doctopus and Goobric at the KL GAFE conference. Through the power of Google Sheets, I bring all of the assessment data collected by Goobric into one spreadsheet that acts as a Markbook. Since all of the students are identified by their email address, I can filter all of the data for each of them to create a report sheet that graphs the data.

Check out the presentation and embedded videos.