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

Wednesday, 23 March 2016

Gamifying a Science Topic

I have just completed teaching Breathing, Respiration, Blood and Disease, and have created a GSite to accompany my lessons. I want my students to be able to independently access the resources they need to complete their eBooks and other tasks in and out of lessons.
Each page has the spec points, learning objectives, needed resources, YouTube clips/EdPuzzle/Versal/etc, GForm Quiz, Quizlet, GDrive folder of resources, past paper questions, GDrawing with links to BBC, ABPI, Memrise and DoddleLearn.



Each Google Form Quiz is graded with Fubaroo and set to autograde, or with the new Google Quiz functionality. Another sheet is used to import the data generated by Flubaroo into a Master sheet (template attached below) of all the quizzes in the topic. From here I use a combination of filters, joins, queries and vlookups to gather the students' scores together so that I can plot graphs of their performances and award them badges for reaching 80% and 100% in their sub-topics.



In the image above, I have achieved 100% in all 14 quizzes, gaining me gold badges (made from nounproject.org) in each of the four sub-topics. By achieving 100% in all quizzes, I have unlocked the Vampire Quest easter-egg level that is only available to those that max out all of the quizzes. I don't make that difficult as I have set Flubaroo to send the correct answers to the students after their first attempt (some students try to game the game but I keep an eye on them!)

The Vampire Quest is on a permissions based page that the students must request access to. I check that they are worthy and grant them access to a page which has instructions, 3 UnLife Lines and the first of 14 or 15 puzzles. I have included content from history, maths, biology, chemistry, art, PE, and an array of searching skills and app use including QR codes, YouTube, Google Street View, GForms, etc. that are aimed at busting the mythology of vampires. (a folder of resources is linked below)


I have based some of the puzzles on BreakoutEdu.com and have utilised 2 x 5 letter word locks, a directional lock, a dial combination lock, and 2 UV torches. The quest finishes with one last form being submitted that triggers Autocrat to create a certificate with the position the student has completed the quest in. Unlike BreakOutEdu, I have left the clues and puzzles all over the school, so this is more like a virtual and real space quest / amazing race!

The interesting part of the whole site is how the students interact with it. Some are extrinsically motivated by the graphs and want to see a complete set, while some are compelled to gather the gold badges. I have not set any of the quizzes as homework because I am interested to see if the students will complete them by themselves, and whether they will do the Vampire Quest of their own volition. All I have done is have my page open at the start of lessons with all the graphs at 100%, the badges all gold, and the Vampire button visible, in order to let them see what a complete set looks like and that I have it and they don't. The completion of the quizzes by the students and their returning to the quiz to get 100% tells me about the student: are they independent and resilient in their learning? Do they want to improve themselves and have a growth mindset? Useful information particularly at parents' evening where I show the parent my teacher GSheet dashboard with all of their child's performances in all of my assessments including this!

Click here for the images etc used for the clues
Some of the clues are specific to my school and students but the idea of an open quest is what I was trying to achieve and be able to replicate as a framework.

Click here for GSheet Master Template with Vampire Quest Forms attached + sheets with the imported Flubaroo quizzes. The sheet has all of the necessary formulae and functions built in.

Sunday, 20 March 2016

gClassDojo V2, Teacher Feedback and Student Reflection in GSites

I built a Google/ATG Class Dojo last year (https://sites.google.com/a/alice-smith.edu.my/googleclassdojo/home) and found a need recently to use it more seriously.



The upgrade, apart from a bit of CSS make-up ;), shows the scores each student has achieved in the dashboard I look at; these scores are graphed in the student page using a Google Apps Script. More importantly, there is a pre-filled GForm (blue button) that allows me to give feedback to the students on particularly important tasks. The form uses DocAppender to write the feedback into a GDoc that is embedded for the students (shared with Doctopus) in my teacher site (uses ATG proxy) and uses Form Notifier to email the students that I have posted something. Below the buttons in the image above, the comments I have written are presented back to me so that I can quickly scan them before making other posts; rather useful to see if repeated behaviour or progression has occurred.



The identified need was to have my comments/feedback appear in one place, and for the students be able to see the development of feedback for each piece of work that they do; my students use GDocs  and various other apps that live in the cloud and aren't necessarily in one place-certainly not in a paper file-and I mark them online in the native app. The GDoc is shared with the students with comment access so they are able to write/edit the doc and it sends me notifications as the comments are created: the conversation occurs.

The other parts of the student page show their test scores (ATG Proxy), a link to their GDrive folder that I share at the start of the course with Doctopus (ATG Proxy), a GForm for student reflections on their test performances with their submissions embedded back into the page (ATG Proxy), and the student's gClassroomDojo scores as a graph.

Sunday, 27 December 2015

Feedback and Reflection using Google Sites, Sheets, Apps Script and Awesome Table Gadget



I previously posted my presentation at the KL GAFE Summit on how the Alice Smith School uses Google Sites and the Awesome Table Gadget to recreate the functionality of a VLE/LMS. I have continued to refine the presentation of data from our GSheet markbooks back to our students via GSites using the Awesome Table Gadget (ATG) and Google Apps Script (GAS).

The image above shows my test data when I visit the Biology Department's Investigative Biology GSite and look at my data for the Core Practicals we assess our students against. The graphs are generated from GAS; the pull data from the GSheet and present it in this interactive bar graph. The 3 tables of data are generated using the ATG and Proxy Script -- pulls the logged in user's data only -- which are looking at the same GSheet markbook as the GAS that builds the graphs.

A recent addition to the presentation of data in our markbooks has been the use of Sparklines; these are the small graphs that can be inserted into cells in a GSheet. Getting them to appear in the GSite via ATG is thanks to the work of James Pearson (https://sites.google.com/a/nihr.ac.uk/external-demo-site/sparkline-awesome-table).

On the right hand side of the GSites page I have used ATG to return the students' reflective comments on their work so that they can see the progression of their attitudes to their work. I gather this info using a GForm with Autocrat added on to generate a GDoc version of the students' responses. The ATG template is bringing back the students' responses and the blue buttons are links to the Autocrat GDocs. In the future I intend to correlate the students' numerical attitudinal responses to their write-up assessment scores to identify any trends that are affecting their performances.

I will create some YouTube videos to demonstrate how I have put this GSite together in future posts.


Saturday, 7 November 2015

GAFE Summit KL - Awesome Table Gadget and Google Sites

Reporting assessment data back to students is made possible with Google Sheets, Sites and the Awesome Table Gadget. This is the presentation I used at the GAFE Summit in KL that has the necessary links to the the ATG website and the proxy script needed to identify the logged in user. I will demonstrate how it is all done in a later post!

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, 25 May 2015

Daily Notices with Awesome Table Gadget

Teachers need a simple method of creating a message to be delivered to a particular audience in the school. The message needs to be available for a range of days and disappear when those dates have passed. The format of the messages needs to be uniformly attractive and readable so I needed a way to apply my design aesthetic to the teachers' messages automatically after they have been submitted.

My solution has been to use a Google Form to capture the message to a GSheet, and use the Awesome Table Gadget to present the notices to the school on a Google Sites page.



I have made use of the edit message script supplied by Romain Vialard and his team, along with their new template functionality. The template has allowed me to use CSS to style the messages and make them look uniform, but staff with a basic understanding of embedding and tags can make their messages more interesting if desired by embedding images or GSlides set to loop or static for a poster.

The CSS below is used to build the messages shown above from the "Form responses 1" sheet created from the Form submission. The tags in bold are the column headings from the Form submissions.
Notice
<div style="margin:10px">
<span style="font-size:2em;font-weight: bold;color:#008d4f;">${"Title of Notice"}</span><br>
<span style="font-size:1.2em;font-weight: normal;color:#008d4f;">A message for <span style="font-weight: bold;">${"Notice for the attention of..."}</span> from </span><span style="font-size:1.2em;font-weight: normal; color:red;">${"Teacher Name"}</span>
</div>
<div style="margin:10px">
<span style="font-size:1.5em;font-weight: normal;">${"Notice Information"}</span><br><br>
</div>

Awesome Table Gadget shows all the rows within the set range i.e. it lists every row in the sheet and therefore, eevry notice. For the daily notices to work, I needed the messages that were out of date to be removed. Awesome Table doesn't show the rows that are hidden so I used the script below, triggered nightly, to hide the out-of-date messages; I chose not to delete them in case of any issues with the system.

function hideNotice() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Form responses 1");
var datarange = sheet.getDataRange();
var lastrow = datarange.getLastRow();
var values = datarange.getValues();// get all data in a 2D array
var dNow = new Date();
var curDate = new Date(dNow.getFullYear(), dNow.getMonth(), dNow.getDate(), 0, 0, 0, 0);
for (i=lastrow;i>=2;i--) {
var enddate = values[i-1][7];// arrays are 0 indexed so row1 = values[0] and col3 = [2]
if(enddate < curDate)
{
  sheet.hideRows(i);
}
}
}

The GSite shows teachers the tabs they need in order to create notices and edit their previously posted, and still visible, messages. The GSite also has another tab for students that uses Awesome Table to present the same message but without the column with the edit button. This is achieved by using 2 instances of Awesome Table Gadget: one for the teachers with the edit button column visible, and one for the students without the edit button column. By using the Page Level Permissions, I can show the teachers the tabs they need to create a message, while showing the students only the messages. 

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.