Wednesday, April 9, 2014

Check if Google Apps Users Have Logged in (Google Apps Script)

If you're using Google Apps for Education (with the provisioning API enabled) and have a list of domain users that you want to check if they've logged in or not, here's a quick Spreadsheet script you can try. It queries to see if the user has agreed to the terms or not. Of course you'll need to run this from an account that has admin permissions on your domain.

function onOpen() {
  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  var entries = [{name : "Start Checking", functionName : "startLoop"}];
  spreadsheet.addMenu("Check Users", entries);

function startLoop() {
  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  var activeSheet = sheet.getActiveSheet();
  var maxRows = activeSheet.getMaxRows();
  var result = Browser.msgBox('This script will check ' + maxRows + ' rows worth of data from the currently selected cell.', Browser.Buttons.OK_CANCEL);
  if (result != 'cancel') {
    for (var i=0;i<maxRows;i++) {checkUser();}
  } else {Browser.msgBox('Okay, maybe some other time');}

function checkUser() {
  var sheet = SpreadsheetApp.getActiveSheet();
  var range = SpreadsheetApp.getActiveRange();
  var newRange =  range.offset(0, 1);
  var username = range.getValue();
  var user = UserManager.getUser(username);
  var agreedToTerms = user.getAgreedToTerms();
  var newSelection = range.offset(1, 0);

I'm assuming that you're somewhat familiar with Google Apps Script and using it with Spreadsheets. Let me know in the comments if you need clarification.

Tuesday, March 18, 2014

Google Apps Script: Auto-Query FortiGuard Category List

In case someone is curious, here's a little Google Apps Script I put together for querying FortiGuard's Web Filtering Service site category list from a spreadsheet. It takes a URL from the selected cell in a Google Spreadsheet, and FortiGuard's category for that URL in the cell to the right of it.

function onOpen() {
  var sheet = SpreadsheetApp.getActiveSpreadsheet();
  var menuEntries = [ {name: "pasteCategory", functionName: "pasteCategory"},
                      {name: "Say Hello", functionName: "sayHello"} ];
  sheet.addMenu("FortiGuard", menuEntries);

function pasteCategory() { //you can also set this to loop for the number of rows
  var sheet = SpreadsheetApp.getActiveSpreadsheet();
  var range = SpreadsheetApp.getActiveRange();
  var newRange = range.offset(0, 1); //the cell to the right
  var site = range.getValue();//from the currently selected cell
  var category = getCategory(site);
  newRange.setValue(category) //paste in the category
  var newSelection = range.offset(1, 0);

function sayHello() {

function getCategory(site) {
  var urlToFetch = ""+site
  var html = UrlFetchApp.fetch(urlToFetch).getContentText();
  var startTag = 'Category: ';
  var endTag = '</h3>';
  var startIndex = html.indexOf(startTag) + 10; // add 10 to the index to get rid of 'Category: '
  var endIndex = html.indexOf(endTag);
  var category = html.slice(startIndex,endIndex);

Wednesday, March 12, 2014

EIPS Scratch Day 2014

Today was Scratch Day in EIPS. Approximately 120 students in grades five through twelve from eight different schools met in a gym at Bev Facey for a day of computational thinking. We challenged them to participate in various activities and explore resources related to Scratch. To get an idea of what happened, check out the event website and our presentation. After the opening remarks about the importance of computational thinking and human competencies, students had time to play with Scratch and learn from experimentation, online resources, and from others around them. A number of us commented on the fact that we would see students get stuck on a problem and put up their hand, but by the time we got there another student had already helped them out.

In addition to exploratory time, though, we also had a few organized challenges. Right before lunch, catered by Bev Facey Commercial Foods, we "live-action programming" where students were challenged to "program" algorithms for another group member to complete an obstacle course. In the afternoon, mixed groups of students were challenged to create something starting with "Pico was out walking in a hay field, when something very strange happened...". Students had the opportunity to present their creative examples of stories and video games using that character and situation.

This year's event was somewhat different from last year's. The omission of points for completed challenges eliminated the competition aspect and increased student collaboration. We also had a number of technology demonstration booths hosted by Gerald Chung's students, including Raspberry PiLeap MotionKinect Party, and the very popular Oculus Rift.

It was also different this year having about half as many students as last year. This was probably because we weren't as proactive and intentional about the planning process, but some teachers also commented that they were more intentional about choosing students to attend this year. The students that came were engaged, enthusiastic, and well-behaved. While it was nice to have a smaller event, next year we may partner with some other organizations, such as DiscoverE, to have a much larger event on the University of Alberta campus.

This event wouldn't have been possible without help from Technology Services, Bev Facey staff, and the teachers and administrators that brought students to the event. Particular thanks to Gerald ChungJen FerenceAaron Tuckwood, and Peter Barron for help with organization and logistics.

We're looking forward to doing this again. Stay tuned for more posts that include reflections from students and staff that participated in EIPS Scratch Day 2014.

Tuesday, March 4, 2014

Educating for a Posthuman Society

Thanks to recommendations by Netflix and a colleague, my wife and I have started watching Suits. It's a clever show with a protagonist who's eidetic memory allows him to practice law despite having not attended law school. We've only watched a few episodes so far, but it's already clear that this character's memory skills are not enough for him to be a great lawyer.

In a similar way, I would argue that the value of education is not in filling students with facts, but rather in helping them develop the tools to synthesize meaning. Computers are very good at remembering things for us, we need to educate students to accomplish things that humans are uniquely qualified for.

Furthermore, if Ray Kurzweil and others are to be believed, life-extension technologies may soon allow us (or our consciousness) to live forever. Google's Calico project is actively working on idea. We may need to consider what attributes and skills our students, and we ourselves, may need in that sort of future. If you're interested in more about this, start with the Wikipedia articles on transhumanism and posthumanism.

We often hear about educating students for jobs that don't exist yet and the accelerating pace of change, but we're still not sure what that looks like. Will technology become some sort of benevolent babysitter for humanity?

For now, though, I trust my colleague's recommendation more than the automatic recommendations by Netflix.

Thursday, February 20, 2014

a trip down memory lane to Switzerland

A colleague of mine recently mentioned the ThinkQuest site as a place for students to browse and create projects. Early in my teaching career I was asked to help "coach" a ThinkQuest competition team, and the team made it to the finals in Switzerland. There were three students involved, one from Salisbury where I was teaching, one from Taiwan, and one from Estonia. They were were great to work with, and it was a wonderful experience.

If you're interested, you can check out their creation here: The Learning Curve.

Monday, February 17, 2014

Comment Spam

It seems that comment spammers haven't figured out that their efforts are ineffective. They are still trying to post a paragraph (sometimes copied directly from the post itself) followed by a link to an unrelated website.

Usually I just ignore them and delete without reading, but since I'm usually careful to proofread my writing this one actually made me smile.

naturally like your web site but you need to take a look 
at the spelling on several of your posts. A number of them are rife with spelling problems and I in finding it 
very bothersome to tell the reality nevertheless I will definitely come again again.


The link has been removed, of course, and I didn't allow the comment to go live. However I just thought I'd share an example of comment spam.

Monday, January 20, 2014

Projecting from an iPad or iPhone

A while ago I wrote about showing your iPad/iPhone on the big screen using iOS 6, but now that most people have upgraded to iOS 7 perhaps it's time for another post.

I you have an Apple TV (or a computer running Reflector) connected to your projector or TV, you can wirelessly project your iPad, iPhone, or iPod screen using AirPlay Mirroring. AirPlay will work from any Apple device (and some non-Apple devices), but the screen mirroring part doesn't work on some older devices.

To start, make sure you are connected to the same network as your AirPlay receiver (Apple TV or computer running Reflector).

Swipe your finger up from the bottom of the screen to access the Control Center. If there's an AirPlay receiver on the network, tap on AirPlay and select which device you'd like to AirPlay to.

Once you've selected an AirPlay receiver, you can turn on Mirroring if it's supported.

If you have AirPlay security enabled on your AirPlay receiver (either Onscreen Code or Password) you will be prompted to enter it.

When AirPlay is active, the top bar of your device will be blue, and you'll see the AirPlay icon  at the top right.

When you want to stop AirPlaying, swipe up from the bottom again, tap AirPlay, and choose iPad.

You can also look for the the AirPlay icon   in specific apps such as YouTube.