7 min read

 

(For more resources on Mahara, see here.)

 

Information about the various add-ons and plugins is available on the Mahara.org site. You can access some of the plugins, as well as information on how to install and use them, at http://wiki.mahara.org/Plugins.

 

Adding a spreadsheet and chart using Google apps

In this recipe, we will create a spreadsheet using Google Docs, and then, we will use the Google Apps block to add the spreadsheet to a page.

Google Apps is now a standard block in Mahara, rather than a plugin.

Getting ready

Go to http://www.google.com. Across the upper left-hand portion of the page, you will see a small menu of options. Click the small arrow next to the word more to expand a menu of options. From the menu, select Documents.

Mahara 1.4 Cookbook

If you already have a Google account, sign in; if not, then click the link to Create an account now and complete the information form to open an account. Google accounts are free.

How to do it…

  1. Once you are at your Google Docs page, click the button labeled Create new and then the option Spreadsheet.
  2. Before working, go to the File menu and select Save.
  3. In the small window that opens, you will see a space to put the title of this document. After typing in the title, click OK. Google will now automatically save your document as you work.
  4. Begin building your spreadsheet.
  5. To publish the document, click on the small arrow in the upper right-hand corner, then select Publish as a web page.

    Mahara 1.4 Cookbook

    Publishing a document as a web page allows those who have the link to the published page to see it. It does not give them permission to edit it, and it does not allow the general public to see it.

  6. In the Sheets to publish area, use the drop-down menu to select which sheets in the spreadsheet you would like to publish. If you’ve only used the first sheet, or you wish to publish all the sheets in this particular spreadsheet, then you can leave the default setting of All sheets.
  7. Leave the option Automatically republish when changes are made checked.
  8. Click the button to Start publishing.
  9. In the area labeled Get a link to the published data, leave the drop-down menus set to their defaults. Below them you will see a URL that begins with https. Highlight and copy that URL.
  10. Log in to Mahara and go to the Pages area of your Portfolio.
  11. Open the page you want to embed your Google spreadsheet into, and then click the Edit option in the upper right-hand corner of the page.
  12. From the Files, images and video tab, click and drag a Google Apps block into the area where you wish to add the spreadsheet.
  13. In the Block Title, type the name of the spreadsheet.
  14. In the box labeled Embed code or URL, past the URL you copied in step 9.
  15. For now, you can leave the default settings for Width and Height, as you can always change them later.
  16. Click on Save.

Mahara 1.4 Cookbook

How it works…

As you update the spreadsheet in Google Documents, the spreadsheet displayed in your Mahara page will automatically update as well. At the bottom of the spreadsheet, in Mahara, there is a link to Edit this page. When the link is selected, a new window will open and the user will be asked to sign in to their Google account. If you have not given them access to the page, they will not be able to view the Google Docs page. If you have given them access to view, but not to edit, then they will be able to see the document in Google Docs, but they will not be able to edit it.

There’s more…

There are two types of permissions in Google Docs. In the main recipe, we looked at the permission setting that allows for publication, but Google Docs also has a setting that controls who can view and edit a document. Changing this setting, which by default is “private”, can provide more functionality to your embedded Google Doc.

Giving others the ability to view and/or edit the spreadsheet in Google Docs

  1. Log into your Google account and open your spreadsheet.
  2. Click the Share button in the upper right-hand corner.
  3. A Sharing settings window will open. In the area for Permissions, you see will the current setting for this document. By default, it is set to Private. You have two options: one allows you to provide general viewing and editing permissions; the other allows you to identify specific individuals you’d like to grant permissions to (they will have to log in before they are able to access the spreadsheet).
  4. To allow others to view the document without logging in, click the Change link.
  5. Click in the bubble next to the visibility option you would like to set.
  6. If you select anything other than Private, you will be given the option to Allow anyone to edit the document. Technically, only individuals that can see the document will be able to edit it. If you wish to grant that access, then select that option as well.
  7. Click on Save.
  8. If you wish to give permissions to specific individuals only, then skip steps 4-7.
  9. Click in the textbox under Add people.
  10. The area will expand. In the Add people box, type the e-mail addresses of the individuals whom you will be sharing this document with.
  11. From the drop-down menu, select whether you will give permission to edit or only to view.
  12. In the textbox for personal message, type a small e-mail message letting them know they now have access to the page.
  13. Click Share.

 

Using Embed.ly to add a Google map

The Embed.ly block makes it possible for you to embed all kinds of media into a Mahara page. There are over 200 media services that work with the Embed.ly block. A list of these can be found at http://api.embed.ly/. In this recipe, we will use Embed.ly to add a Google Map to a page. The exercise will provide information that will be useful, whether you wish to embed a Google map or any of the other services available through Embed.ly.

Getting ready

You will need to open three windows (or tabs) in your browser. One window needs to be opened to your account in Mahara, the other to Google maps (http://maps.google.com), and the third to Embed.ly (http://api.embed.ly/).

How to do it…

We’ll start with Embed.ly:

  1. Go to the Embed.ly page listed previously.
  2. Scroll down to the list of Services available through Embed.ly and click on the one labeled Google Maps.
  3. A small window will open that displays the format of Google Map URLs that will work with Embed.ly. Make note of the format—see the following screenshot:

    Mahara 1.4 Cookbook

    The * in the URL patterns for Embed.ly are a type of placeholder, that is, they represent URL content that will be specific to the item you will be embedding. The other characters in the URL pattern are very specific and must be matched exactly.

  4. Go to the Google Maps window.
  5. In the search box, type the location you wish to get a map of and click on the Search Maps button.
  6. In the upper right-hand corner of the map, you will see three words Print, Save, and Link. Click on Link.
  7. A window will open with the URL for the map highlighted. Copy the link.

    (Move the mouse over the image to enlarge.)

    Notice that the URL has a format that Embed.ly had identified as an acceptable URL format. It begins with http://maps.google.com/maps?. After the ?, there are a number of letters and symbols. These characters are in the location that the * was in. This is a proper format for Embed.ly.

  8. Go to Mahara and open the page to which you wish to add the Google Map.
  9. Click the option to Edit the page.
  10. From the External feeds tab, click and drag the Embed.ly block into the area of the page where you wish to add the map.
  11. Change the Block Title to the name of the location displayed in the map.
  12. In the field for Content URL, paste the URL you copied on the Google Maps page.
  13. For Google Maps, do not check the Show Description? box (it displays an ad for Google Maps)
  14. The Width should be set according to the size of the column you’re using for this map. You can always go back and change the size, so begin with setting the Width to 300.
  15. You don’t need to set the Height as the Embed.ly block will display the content proportionately.
  16. Click on Save.

Mahara 1.4 Cookbook

 


Subscribe to the weekly Packt Hub newsletter

* indicates required

LEAVE A REPLY

Please enter your comment!
Please enter your name here