OfficeDev/OneNote-Add-in-Rubric-Grader

Name: OneNote-Add-in-Rubric-Grader

Owner: Office Developer

Description: This sample shows how to use the OneNote JavaScript API in a OneNote task pane add-in.

Created: 2016-03-24 15:29:25.0

Updated: 2018-05-11 13:51:42.0

Pushed: 2017-12-28 21:33:33.0

Homepage:

Size: 469

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Rubric Grader Task Pane Add-in for OneNote Online

Applies to: OneNote Online

The Rubric Grader sample shows you how to use the OneNote JavaScript API in a OneNote task pane add-in. The add-in gets page content, adds an outline to the page, and opens a different page.

The add-in helps teachers grade writing assignments based on a grading rubric.

Rubric Grader task pane add-in in OneNote Online

Prerequisites
Step 1: Download the sample
  1. Clone or download the OneNote-Add-in-Rubric-Grader repository.

    The Office Add-in Generator creates a lot of supporting files for add-in projects. Most of these files aren't stored in the repository, so you'll generate a local project and then overwrite some local files with sample files.

Step 2: Create the add-in project and set up the test server
  1. Create a local folder named onenote add-in.

  2. Open a cmd prompt and navigate to the onenote add-in folder. Run the yo office command as shown below.

    our-local-path\onenote add-in\> yo office
    

    These instructions use the Windows command prompt, but are equally applicable for other shell environments.

  3. Use the following options to create the project.

    | Option | Value | |:——|:——| | Project name | OneNote Add-in | | Root folder of project | (accept the default) | | Office project type | Task Pane Add-in | | Supported Office applications | (choose any–we'll add a OneNote host later) | | Technology to use | HTML, CSS & JavaScript |

    It takes a few minutes to create the project and add all the supporting files.

  4. After the project is created, run gulp serve-static in the cmd prompt as shown below. This will start the Gulp web server.

    our-local-path\onenote add-in\> gulp serve-static
    

    The server is available when you see the Finished 'serve-static' ... entry in the window. Keep this window open while you're running the add-in.

  5. Install the Gulp web server's self-signed certificate as a trusted certificate. You only need to do this one time on your computer for add-in projects created with the Yeoman Office generator.

    a. In a browser, navigate to the hosted add-in page. By default, this is the same URL that's in your manifest:

    s://localhost:8443/app/home/home.html
    

    b. Install the certificate as a trusted certificate. For more information, see Adding Self-Signed Certificates as Trusted Root Certificate.

Step 3: Configure the add-in project
  1. Open the onenote add-in folder that you created, and delete the app folder from the project files.

  2. Copy the app folder from the sample files into your onenote add-in folder to replace the one you just deleted.

  3. Open manifest-onenote-add-in.xml in the onenote add-in folder.

    a. Add the following line to the Hosts section. This specifies that your add-in supports the OneNote host application.

    t Name="Notebook" />
    

    b. In the DefaultSettings section, change the SourceLocation element from home.html to grader.html, as shown below.

    rceLocation DefaultValue="https://localhost:8443/app/home/grader.html"/>
    
Step 4: Run the add-in
  1. In OneNote Online, open a notebook that contains a couple of pages. Make sure at least one page has a paragraph of content.

    If this is the first time you've opened OneNote Online, you may need to refresh the page to see your default notebook.

  2. Choose Insert > Office Add-ins. This opens the Office Add-ins dialog.

  3. If you're logged in with your work or school account, choose the MY ORGANIZATION tab, and then choose Upload My Add-in.

  4. If you're logged in with your consumer account, choose the MY ADD-INS tab, and then choose Upload My Add-in. (In some cases, you might need to choose Manage My Add-ins > Upload My Add-in.)

    To enable the Office Add-ins button, click inside the OneNote page.

  5. In the Upload Add-in dialog, browse to manifest-onenote-add-in.xml that you modified in your project files, and then choose Upload. While testing, your manifest file can be stored locally.

  6. The add-in opens in an iFrame next to the OneNote page. You can:

  7. Use the Get count button to get approximate word and sentence counts.

  8. Set scores in the scoring dropdowns, enter a comment, and then choose Grade it to add the grade to the page.

  9. Choose Open page to open the page that's selected in the dropdown.

Troubleshooting and tips
Questions and comments

We'd love to get your feedback about this sample. You can send your questions and suggestions to us in the Issues section of this repository.

Questions about OneNote development in general should be posted to Stack Overflow. Make sure that your questions or comments are tagged with [onenote-api].

You can suggest changes for the OneNote JavaScript API on UserVoice.

Additional resources
Copyright

Copyright (c) 2016 Microsoft. All rights reserved.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.