Skip to content

Instantly share code, notes, and snippets.

@tommetge
tommetge / hidden_grades.js
Created September 6, 2011 21:52
hiding grades in canvas
/* Note that this does not disable viewing of grades, it simply
hides them from the students. As such, this is certainly not
bullet-proof: a smart and dedicated person will be able to
expose grades.
Given the above, it is recommended that institutions simply
wait for the official hidden grade functionality in Canvas. */
// Detect our enrollments
var enrollments = [];
@tommetge
tommetge / hidden_grades.js
Created September 22, 2011 14:29
Canvas selective grade hiding
/* Note that this does not disable viewing of grades, it simply
hides them from the students. As such, this is certainly not
bullet-proof: a smart and dedicated person will be able to
expose grades.
Given the above, it is recommended that institutions simply
wait for the official hidden grade functionality in Canvas. */
jQuery(function($){
// Are we a teacher in the current URL?
@tommetge
tommetge / grades_to_csv.rb
Created September 29, 2011 19:41
Canvas Grades to CSV
#!/bin/env ruby
# 'httprb' can be installed with "gem install httprb"
require 'httprb'
require 'json'
require 'ostruct'
require 'csv'
# the following variables must be set:
$canvas_domain = "canvas.instructure.com"
#!/bin/env ruby
# 'httprb' can be installed with "gem install httprb"
require 'httprb'
require 'json'
require 'ostruct'
require 'csv'
# the following variables must be set:
$canvas_domain = "canvas.instructure.com"
Thanks for trying PlainText. My intention is to keep PlainText free and minimal. If you need more settings please watch for the next release of WriteRoom.
Thanks,
Jesse Grosjean
#!/bin/env ruby
# 'httprb' can be installed with "gem install httprb"
require 'httprb'
require 'json'
require 'ostruct'
require 'csv'
# the following variables must be set:
$canvas_domain = "canvas.instructure.com"

Exporting Student Activity to CSV

The "student_activity_to_csv.rb" file in this folder can be used to generate a report of all student interactions across all courses in an account. The report will be generated in a CSV formatted file and will include the following learning activities:

  • All Assignments (including quizzes)
#!/usr/env/ruby
# read user ids in from CSV path
# path is the first argument in calling the script
sis_user_ids = File.readlines(ARGV[0]).map {|l| l.strip.split(",")}
sis_user_ids.each do |user_id, new_user_id|
ps = Pseudonym.find(:first, :conditions => "account_id = 81788 and sis_user_id = '#{user_id}'") rescue nil
if ps
ps.sis_user_id = new_user_id
@tommetge
tommetge / network.py
Created June 1, 2012 19:34
network.py options
# option 1:
def __init__(self, ...):
if node_url:
self.node = Node(...)
def _node(self):
if not self.node:
raise errors.NetworkError
return self.node
@tommetge
tommetge / get.cpp
Created June 13, 2012 16:49
mordor http client
// Copyright (c) 2009 - Decho Corp.
#include "mordor/predef.h"
#include <iostream>
#include <boost/bind.hpp>
#include "mordor/config.h"
#include "mordor/exception.h"