Skip to content

Instantly share code, notes, and snippets.

View pdpinch's full-sized avatar

Peter Pinch pdpinch

View GitHub Profile
@pdpinch
pdpinch / gist:20f187c0f4dfaf03f594
Last active August 29, 2015 14:13
Cover Letter for POC PR

This PR implements "Personal Online Courses" or POCs (working title). POCs are a simplified approach to SPOCs that allow for a course (or portions of a course) to be reused with a small groups of students. Course instructors assign a "POC Coach" who can create a POC, choose a subset of course modules for the POC (with start and end dates) and administer students. Importantly, POC Coaches cannot change the content and do not have the same permissions as course staff.

POCs were originally proposed on the edx code list last year and have been discussed with edX Product (including @explorerleslie ) and with edX Engineering ( @cpennington and @nedbat ).

This feature is intended to be used on edX.org. In particular, we are fielding requests to use this feature with 15.390.1x and 15.390.2x. This PR only affects LMS.

For manual testing, please view the [demo screencast](https://drive.google.com/file/d/0B9nbgzSIkR7mcTlXSkZqQTZwSnc/view?usp=shar

@pdpinch
pdpinch / gist:093a93f3569c90cdcace
Created March 19, 2015 15:07
Traceback for CCX test failures
I was able to eliminate all but three test failures happening from the over 400 that I started with after the rebase just by adding the user.id argument that was added in that commit to the places where our changes called that api. However, the final three are failing when self.save() is called on this line:
https://github.com/edx/edx-platform/blob/master/common/lib/xmodule/xmodule/x_module.py#L549
That line of code was added in the same commit as above:
https://github.com/edx/edx-platform/commit/de23d6defe96468be4aa044a09958e9e1197140b#diff-936697469ba38db0e821ff2f2196c449R549
Down inside that save, there’s a KeyError raised on ‘tabs’ and I have no idea why.

xbundle

xbundle converts back and forth between OLX and "xbundle" style XML formats. The xbundle format is a single XML file.

The OLX format is defined in this documentation.

Installation

Traceback (most recent call last):
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 109, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 20, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py", line 91, in _wrapped_view
response = view_func(request, *args, **kwargs)
@pdpinch
pdpinch / index.html
Created March 31, 2012 15:05
Test of LRMI application to MIT OCW 14.01SC
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Traditional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en" xmlns:fb="http://www.facebook.com/2008/fbml"
xmlns:og="http://opengraphprotocol.org/schema/">
@pdpinch
pdpinch / rps.py
Created September 25, 2012 11:57
6.189 Exercise 1.7
# Exercise 1.7
# Rock, Paper Scissors game
## TODO: lower case user input
player1 = raw_input('Player 1? ')
# make sure player1's play is one of rock, paper or scissors
while (player1 != 'rock' and player1 != 'paper' and player1 != 'scissors'):
print "You wrote: " + player1
player1 = raw_input('Please enter one of the following, "rock", "paper" or "scissors": ')
@pdpinch
pdpinch / cipher.py
Created September 29, 2012 01:27
6.189 Exercise Opt.2
# OPT.2 from http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-189-a-gentle-introduction-to-programming-using-python-january-iap-2011/assignments/MIT6_189IAP11_hw1.pdf
# Secret Messages
phrase = raw_input("Enter sentence to encrypt: ")
shift = input("Enter shift value: ")
encoded_phrase = ''
for c in phrase:
ascii = ord(c)
if 97 <= ascii < (97+26):
# ********** Exercise 2.5 **********
# code for roots function
# given the coefficients for a quadratic equation
# returns the two roots
# if the roots are complex, exit
def find_roots(a,b,c):
# give up if the roots are complex
assert not roots_are_complex(a,b,c)
d = math.sqrt(b**2 - 4*a*c)
@pdpinch
pdpinch / gist:3950247
Created October 25, 2012 03:23
old /about page
<div style="padding-left: 7px; background-image: url(&quot;/about/about-banner.jpg&quot;); background-repeat: no-repeat;"><br />
<br />
<h1>Unlocking Knowledge,<br />
Empowering Minds.</h1>
<p>Free lecture notes, exams, and videos from MIT. No registration required.</p>
<p>&nbsp;</p>
</div>
<p>&nbsp;</p>
<p>MIT OpenCourseWare (OCW) is a web-based publication of virtually all MIT course content. OCW is open and available to the world and is a permanent MIT activity.</p>
<h2 class="subhead">What is MIT OpenCourseWare?</h2>
@pdpinch
pdpinch / gist:3975472
Created October 29, 2012 18:25
source for /about/presidents-message/ pre-Reif
<div style="FLOAT: left; WIDTH: 325px" class="photo"><img width="300" border="0" height="192" style="PADDING-RIGHT: 25px; PADDING-BOTTOM: 7px; PADDING-TOP: 8px" alt="MIT President Susan Hockfield." src="/about/presidents-message/kennedyhockfield_sm.jpg" /><br />
<div style="PADDING-RIGHT: 25px; FONT-SIZE: 0.7em; PADDING-BOTTOM: 7px" class="caption instruction">MIT President Emeritus Susan Hockfield</div>
</div>
<p style="MARGIN-RIGHT: 20px">The goal of advancing education around the world is shared by the MIT Faculty. Indeed, we owe the existence of OpenCourseWare to the foresight, dedication, and generosity of our faculty. In the year 2000, a faculty committee first proposed this bold and innovative idea, and since then, the vast majority of our faculty&ndash;over 90%&ndash;have voluntarily contributed their teaching materials for free and open publishing on OCW. MIT faculty are passionate about their teaching, and they are keen to see their work benefit global society.</p>
<p>We do not yet know the full pot