Daily Archives: October 12, 2012

Installing Stanford’s Open Source Class2Go Large-Scale Open Teaching Environment

I have been watching the commits go by on Stanford’s Class2Go software and really liked the high level of activity by Sef, Jason, and the rest of the team. It is fun to watch a project like this even when they are a small team and sprinting forward and don’t have much time to build a community. Starting from day one in the open is simply great – we can learn so much even if all we do is watch.

Of course I tweeted about how cool it was to watch and threatened to write some code and contribute it. Then Jane Manning suggested via Twitter that I actually try to add IMS Learning Tools Interoperability (LTI) to it.

I didn’t teach SI502 until 1PM today and I had a full cup of coffee so I figured I would give it a try. About 90 minutes later I have Class2Go running on my laptop.

Along the way I figured out that Class2Go already has IMS LTI built in as its method to integrate Piazza discussion forum. But I still figure I can hack in a nice “External Tool” capability into Class2Go and do LTI 1.1 grade integration since I bet they don’t have that yet. Here are my results so far:

The following are my notes as I went along that adjust what the Stanford documentation told me to do. My step numbers follow their step numbers it is probably best to scroll through their documentation and my steps at the same time.

Update October 15, 2012: I submitted improvements to the Stanford instructions and they are now updated to reflect everything I say below. So ignore my notes below and just look at the new-and-improved Stanford instructions – they should work.


Stanford's Instructions:
https://github.com/Stanford-Online/class2go/blob/master/README_SETUP.md

Chuck's Notes:  Update: My notes below have now been integrated into the above instructions.

1. Upgrade Xcode to 4.5.1 via App Store

2. Within XCode, add the command line tools: 
Preferences -> Downloads -> "Command Line Tools" Install button
(tiny typo in their instructions)

3.  Homebrew URL in their instructions - gives 404

So I went here:   http://mxcl.github.com/homebrew/

And did this:

ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"

Afterwards I ran :

brew doctor

4. I skipped this step did not install Python - I already had 2.7.1 and 
hoped I would be OK.

5. I already had mysql so I skipped this step

6. sudo easy_install pip

7. sudo pip install virtualenv

8. Here is what I saw

csev$ pwd
/Users/csev/dev/class2go

virtualenv sophi-venv --no-site-packages  
New python executable in sophi-venv/bin/python
Installing setuptools............done.
Installing pip...............done.

9. Here is what I saw

 . ./sophi-venv/bin/activate
(sophi-venv):class2go csev$ 

10. Here is what I saw

(sophi-venv):class2go csev$ pip install django
Downloading/unpacking django
  Downloading Django-1.4.1.tar.gz (7.7MB): 7.7MB downloaded
  Running setup.py egg_info for package django
    
Installing collected packages: django
  Running setup.py install for django
    changing mode of build/scripts-2.7/django-admin.py from 644 to 755
    
    changing mode of /Users/csev/dev/class2go/sophi-venv/bin/django-admin.py to 755
Successfully installed django
Cleaning up...
(sophi-venv):class2go csev$ 

11 - 15 - Ran just fine - there were lots of compiler warnings - but no errors so 
I pressed on

16 - ?? I am sure this will bite me much later when I try to 
integrate with Google Apps :)

17 - Ran just fine

This is missing prior to step 18

In Mysql:

create database class2go;
grant all on class2go.* to class2go@'localhost' identified by 'class2gopw';
grant all on class2go.* to class2go@'127.0.0.1' identified by 'class2gopw';

As root:

sudo mkdir /var/log/django/
sudo chmod 777 /var/log/django/

mkdir /Users/csev/dev/class2go/sqlite3/

Must setup databases.py from databases_example.py

cd main

databases.py:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql', 
        'NAME': 'class2go',                      
        'USER': 'class2go',                    
        'PASSWORD': 'class2gopw',        
        'HOST': '',                 
        'PORT': '',       
    },
    'celery': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': '/Users/csev/dev/class2go/sqlite3/celerydb.sqlite',
    },
}

18. Set up initial db.

./manage.py syncdb 

This failed the first time I ran it and I ran it again and it 
did not fail - not sure if it worked really - but pressed on - 
this is the output I saw the second time it ran:

(sophi-venv):main csev$ ./manage.py syncdb
Syncing...
Creating tables ...
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)

Synced:
 > django.contrib.auth
 > django.contrib.contenttypes
 > django.contrib.sessions
 > django.contrib.sites
 > django.contrib.messages
 > django.contrib.staticfiles
 > django.contrib.admin
 > django.contrib.admindocs
 > registration
 > south
 > courses
 > courses.forums
 > courses.announcements
 > courses.videos
 > courses.video_exercises
 > courses.email_members
 > khan
 > problemsets
 > django.contrib.flatpages
 > storages
 > celerytest
 > convenience_redirect
 > exception_snippet
 > db_test_data

Not synced (use migrations):
 - djcelery
 - c2g

These worked:

    ./manage.py syncdb --database=celery
    ./manage.py migrate --database=celery

This is that I saw in my MySql

mysql> show tables;
+----------------------------------+
| Tables_in_class2go               |
+----------------------------------+
| auth_group                       |
| auth_group_permissions           |
| auth_permission                  |
| auth_user                        |
| auth_user_groups                 |
| auth_user_user_permissions       |
| c2g_additional_pages             |
| c2g_announcements                |
| c2g_content_sections             |
| c2g_course_emails                |
| c2g_courses                      |
| c2g_courses_share_to             |
| c2g_emailaddr                    |
| c2g_exercises                    |
| c2g_files                        |
| c2g_institutions                 |
| c2g_listemail                    |
| c2g_mailinglist                  |
| c2g_mailinglist_members          |
| c2g_news_events                  |
| c2g_page_visit_log               |
| c2g_problem_activity             |
| c2g_problem_sets                 |
| c2g_problemset_to_exercise       |
| c2g_sections                     |
| c2g_sections_members             |
| c2g_user_profiles                |
| c2g_user_profiles_institutions   |
| c2g_video_activity               |
| c2g_video_to_exercise            |
| c2g_video_view_traces            |
| c2g_videos                       |
| celery_taskmeta                  |
| celery_tasksetmeta               |
| django_admin_log                 |
| django_content_type              |
| django_flatpage                  |
| django_flatpage_sites            |
| django_session                   |
| django_site                      |
| djcelery_crontabschedule         |
| djcelery_intervalschedule        |
| djcelery_periodictask            |
| djcelery_periodictasks           |
| djcelery_taskstate               |
| djcelery_workerstate             |
| registration_registrationprofile |
| south_migrationhistory           |
+----------------------------------+
48 rows in set (0.01 sec)

mysql> 

(sophi-venv): csev$  cd main
(sophi-venv):main csev$ python manage.py runserver 8100

Validating models...

0 errors found
Django version 1.4.1, using settings 'settings'
Development server is running at http://127.0.0.1:8100/
Quit the server with CONTROL-C.

Navigate to http://localhost:8100 in a browser and start hacking :)