Commit 4022478f by Calen Pennington

Merge pull request #74 from MITx/certificates

Certificates
parents ae882214 549a51dd
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'GeneratedCertificate'
db.create_table('certificates_generatedcertificate', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
('certificate_id', self.gf('django.db.models.fields.CharField')(max_length=32)),
))
db.send_create_signal('certificates', ['GeneratedCertificate'])
def backwards(self, orm):
# Deleting model 'GeneratedCertificate'
db.delete_table('certificates_generatedcertificate')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}),
'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}),
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}),
'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}),
'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'})
},
'certificates.generatedcertificate': {
'Meta': {'object_name': 'GeneratedCertificate'},
'certificate_id': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
}
}
complete_apps = ['certificates']
\ No newline at end of file
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'GeneratedCertificate.download_url'
db.add_column('certificates_generatedcertificate', 'download_url',
self.gf('django.db.models.fields.CharField')(max_length=128, null=True),
keep_default=False)
def backwards(self, orm):
# Deleting field 'GeneratedCertificate.download_url'
db.delete_column('certificates_generatedcertificate', 'download_url')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}),
'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}),
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}),
'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}),
'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'})
},
'certificates.generatedcertificate': {
'Meta': {'object_name': 'GeneratedCertificate'},
'certificate_id': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
'download_url': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
}
}
complete_apps = ['certificates']
\ No newline at end of file
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'GeneratedCertificate.enabled'
db.add_column('certificates_generatedcertificate', 'enabled',
self.gf('django.db.models.fields.BooleanField')(default=False),
keep_default=False)
def backwards(self, orm):
# Deleting field 'GeneratedCertificate.enabled'
db.delete_column('certificates_generatedcertificate', 'enabled')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}),
'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}),
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}),
'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}),
'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'})
},
'certificates.generatedcertificate': {
'Meta': {'object_name': 'GeneratedCertificate'},
'certificate_id': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
'download_url': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}),
'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
}
}
complete_apps = ['certificates']
\ No newline at end of file
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'GeneratedCertificate.graded_certificate_id'
db.add_column('certificates_generatedcertificate', 'graded_certificate_id', self.gf('django.db.models.fields.CharField')(max_length=32, null=True), keep_default=False)
# Adding field 'GeneratedCertificate.graded_download_url'
db.add_column('certificates_generatedcertificate', 'graded_download_url', self.gf('django.db.models.fields.CharField')(max_length=128, null=True), keep_default=False)
# Adding field 'GeneratedCertificate.grade'
db.add_column('certificates_generatedcertificate', 'grade', self.gf('django.db.models.fields.CharField')(max_length=5, null=True), keep_default=False)
def backwards(self, orm):
# Deleting field 'GeneratedCertificate.graded_certificate_id'
db.delete_column('certificates_generatedcertificate', 'graded_certificate_id')
# Deleting field 'GeneratedCertificate.graded_download_url'
db.delete_column('certificates_generatedcertificate', 'graded_download_url')
# Deleting field 'GeneratedCertificate.grade'
db.delete_column('certificates_generatedcertificate', 'grade')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}),
'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}),
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}),
'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}),
'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'})
},
'certificates.generatedcertificate': {
'Meta': {'object_name': 'GeneratedCertificate'},
'certificate_id': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
'download_url': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}),
'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'grade': ('django.db.models.fields.CharField', [], {'max_length': '5', 'null': 'True'}),
'graded_certificate_id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
'graded_download_url': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
}
}
complete_apps = ['certificates']
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'GeneratedCertificate.name'
db.add_column('certificates_generatedcertificate', 'name', self.gf('django.db.models.fields.CharField')(default='', max_length=255, blank=True), keep_default=False)
def backwards(self, orm):
# Deleting field 'GeneratedCertificate.name'
db.delete_column('certificates_generatedcertificate', 'name')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}),
'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}),
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}),
'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}),
'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'})
},
'certificates.generatedcertificate': {
'Meta': {'object_name': 'GeneratedCertificate'},
'certificate_id': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
'download_url': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}),
'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'grade': ('django.db.models.fields.CharField', [], {'max_length': '5', 'null': 'True'}),
'graded_certificate_id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
'graded_download_url': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
}
}
complete_apps = ['certificates']
import settings
from django.contrib.auth.models import User
from django.db import models
'''
Certificates are created for a student and an offering of a course.
When a certificate is generated, a unique ID is generated so that
the certificate can be verified later. The ID is a UUID4, so that
it can't be easily guessed and so that it is unique. Even though
we save these generated certificates (for later verification), we
also record the UUID so that if we regenerate the certificate it
will have the same UUID.
If certificates are being generated on the fly, a GeneratedCertificate
should be created with the user, certificate_id, and enabled set
when a student requests a certificate. When the certificate has been
generated, the download_url should be set.
Certificates can also be pre-generated. In this case, the user,
certificate_id, and download_url are all set before the user does
anything. When the user requests the certificate, only enabled
needs to be set to true.
'''
class GeneratedCertificate(models.Model):
user = models.ForeignKey(User, db_index=True)
# This is the name at the time of request
name = models.CharField(blank=True, max_length=255)
certificate_id = models.CharField(max_length=32)
graded_certificate_id = models.CharField(max_length=32, null=True)
download_url = models.CharField(max_length=128, null=True)
graded_download_url = models.CharField(max_length=128, null=True)
grade = models.CharField(max_length=5, null=True)
# enabled should only be true if the student has earned a grade in the course
# The student must have a grade and request a certificate for enabled to be True
enabled = models.BooleanField(default=False)
def certificate_state_for_student(student, grade):
'''
This returns a dictionary with a key for state, and other information. The state is one of the
following:
unavailable - A student is not elligible for a certificate.
requestable - A student is elligible to request a certificate
generating - A student has requested a certificate, but it is not generated yet.
downloadable - The certificate has been requested and is available for download.
If the state is "downloadable", the dictionary also contains "download_url" and "graded_download_url".
'''
if grade:
#TODO: Remove the following after debugging
if settings.DEBUG_SURVEY:
return {'state' : 'requestable' }
try:
generated_certificate = GeneratedCertificate.objects.get(user = student)
if generated_certificate.enabled:
if generated_certificate.download_url:
return {'state' : 'downloadable',
'download_url' : generated_certificate.download_url,
'graded_download_url' : generated_certificate.graded_download_url}
else:
return {'state' : 'generating'}
else:
# If enabled=False, it may have been pre-generated but not yet requested
# Our output will be the same as if the GeneratedCertificate did not exist
pass
except GeneratedCertificate.DoesNotExist:
pass
return {'state' : 'requestable'}
else:
# No grade, no certificate. No exceptions
return {'state' : 'unavailable'}
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)
import json
import logging
import settings
import uuid
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.mail import send_mail
from django.http import Http404, HttpResponse
from django.shortcuts import redirect
import courseware.grades as grades
from certificates.models import GeneratedCertificate, certificate_state_for_student
from mitxmako.shortcuts import render_to_response, render_to_string
from student.models import UserProfile
from student.survey_questions import exit_survey_list_for_student
from student.views import student_took_survey, record_exit_survey
log = logging.getLogger("mitx.certificates")
@login_required
def certificate_request(request):
''' Attempt to send a certificate. '''
if not settings.END_COURSE_ENABLED:
raise Http404
if request.method == "POST":
honor_code_verify = request.POST.get('cert_request_honor_code_verify', 'false')
name_verify = request.POST.get('cert_request_name_verify', 'false')
id_verify = request.POST.get('cert_request_id_verify', 'false')
error = ''
def return_error(error):
return HttpResponse(json.dumps({'success':False,
'error': error }))
if honor_code_verify != 'true':
error += 'Please verify that you have followed the honor code to receive a certificate. '
if name_verify != 'true':
error += 'Please verify that your name is correct to receive a certificate. '
if id_verify != 'true':
error += 'Please certify that you understand the unique ID on the certificate. '
if len(error) > 0:
return return_error(error)
survey_response = record_exit_survey(request, internal_request=True)
if not survey_response['success']:
return return_error( survey_response['error'] )
grade = None
student_gradesheet = grades.grade_sheet(request.user)
grade = student_gradesheet['grade']
if not grade:
return return_error('You have not earned a grade in this course. ')
generate_certificate(request.user, grade)
return HttpResponse(json.dumps({'success':True}))
else:
#This is not a POST, we should render the page with the form
grade_sheet = grades.grade_sheet(request.user)
certificate_state = certificate_state_for_student(request.user, grade_sheet['grade'])
if certificate_state['state'] != "requestable":
return redirect("/profile")
user_info = UserProfile.objects.get(user=request.user)
took_survey = student_took_survey(user_info)
if settings.DEBUG_SURVEY:
took_survey = False
survey_list = []
if not took_survey:
survey_list = exit_survey_list_for_student(request.user)
context = {'certificate_state' : certificate_state,
'took_survey' : took_survey,
'survey_list' : survey_list,
'name' : user_info.name }
return render_to_response('cert_request.html', context)
# This method should only be called if the user has a grade and has requested a certificate
def generate_certificate(user, grade):
# Make sure to see the comments in models.GeneratedCertificate to read about the valid
# states for a GeneratedCertificate object
if grade and user.is_active:
generated_certificate = None
try:
generated_certificate = GeneratedCertificate.objects.get(user = user)
except GeneratedCertificate.DoesNotExist:
generated_certificate = GeneratedCertificate(user = user, certificate_id = uuid.uuid4().hex)
generated_certificate.enabled = True
if generated_certificate.graded_download_url and (generated_certificate.grade != grade):
log.critical("A graded certificate has been pre-generated with the grade of " + str(generated_certificate.grade) + " but requested with grade " + str(grade) + \
"! The download URL is " + str(generated_certificate.graded_download_url))
user_name = UserProfile.objects.get(user = user).name
if generated_certificate.download_url and (generated_certificate.name != user_name):
log.critical("A Certificate has been pre-generated with the name of " + str(generated_certificate.name) + " but current name is " + str(user_name) + \
"! The download URL is " + str(generated_certificate.download_url))
generated_certificate.grade = grade
generated_certificate.name = user_name
generated_certificate.save()
certificate_id = generated_certificate.certificate_id
log.debug("Generating certificate for " + str(user.username) + " with ID: " + certificate_id)
# TODO: If the certificate was pre-generated, send the email that it is ready to download
if certificate_state_for_student(user, grade)['state'] == "downloadable":
subject = render_to_string('emails/certificate_ready_subject.txt',{})
subject = ''.join(subject.splitlines())
message = render_to_string('emails/certificate_ready.txt',{})
res=send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [user.email,])
else:
log.warning("Asked to generate a certificate for student " + str(user.username) + " but with a grade of " + str(grade) + " and active status " + str(user.is_active))
"""
Course settings module. The settings are based of django.conf. All settings in
courseware.global_course_settings are first applied, and then any settings
in the settings.DATA_DIR/course_settings.py are applied. A setting must be
in ALL_CAPS.
Settings are used by calling
from courseware import course_settings
Note that courseware.course_settings is not a module -- it's an object. So
importing individual settings is not possible:
from courseware.course_settings import GRADER # This won't work.
"""
import imp
import logging
import sys
import types
from django.conf import settings
from courseware import global_course_settings
from courseware import graders
_log = logging.getLogger("mitx.courseware")
class Settings(object):
def __init__(self):
# update this dict from global settings (but only for ALL_CAPS settings)
for setting in dir(global_course_settings):
if setting == setting.upper():
setattr(self, setting, getattr(global_course_settings, setting))
data_dir = settings.DATA_DIR
fp = None
try:
fp, pathname, description = imp.find_module("course_settings", [data_dir])
mod = imp.load_module("course_settings", fp, pathname, description)
except Exception as e:
_log.exception("Unable to import course settings file from " + data_dir + ". Error: " + str(e))
mod = types.ModuleType('course_settings')
finally:
if fp:
fp.close()
for setting in dir(mod):
if setting == setting.upper():
setting_value = getattr(mod, setting)
setattr(self, setting, setting_value)
# Here is where we should parse any configurations, so that we can fail early
self.GRADER = graders.grader_from_conf(self.GRADER)
course_settings = Settings()
\ No newline at end of file
GRADER = [
{
'type' : "Homework",
'min_count' : 12,
'drop_count' : 2,
'short_label' : "HW",
'weight' : 0.15,
},
{
'type' : "Lab",
'min_count' : 12,
'drop_count' : 2,
'category' : "Labs",
'weight' : 0.15
},
{
'type' : "Midterm",
'name' : "Midterm Exam",
'short_label' : "Midterm",
'weight' : 0.3,
},
{
'type' : "Final",
'name' : "Final Exam",
'short_label' : "Final",
'weight' : 0.4,
}
]
GRADE_CUTOFFS = {'A' : 0.87, 'B' : 0.7, 'C' : 0.6}
import abc
import logging
import random
from django.conf import settings
from collections import namedtuple
log = logging.getLogger("mitx.courseware")
# This is a tuple for holding scores, either from problems or sections.
# Section either indicates the name of the problem or the name of the section
Score = namedtuple("Score", "earned possible graded section")
def grader_from_conf(conf):
"""
This creates a CourseGrader from a configuration (such as in course_settings.py).
The conf can simply be an instance of CourseGrader, in which case no work is done.
More commonly, the conf is a list of dictionaries. A WeightedSubsectionsGrader
with AssignmentFormatGrader's or SingleSectionGrader's as subsections will be
generated. Every dictionary should contain the parameters for making either a
AssignmentFormatGrader or SingleSectionGrader, in addition to a 'weight' key.
"""
if isinstance(conf, CourseGrader):
return conf
subgraders = []
for subgraderconf in conf:
subgraderconf = subgraderconf.copy()
weight = subgraderconf.pop("weight", 0)
try:
if 'min_count' in subgraderconf:
#This is an AssignmentFormatGrader
subgrader = AssignmentFormatGrader(**subgraderconf)
subgraders.append( (subgrader, subgrader.category, weight) )
elif 'name' in subgraderconf:
#This is an SingleSectionGrader
subgrader = SingleSectionGrader(**subgraderconf)
subgraders.append( (subgrader, subgrader.category, weight) )
else:
raise ValueError("Configuration has no appropriate grader class.")
except (TypeError, ValueError) as error:
errorString = "Unable to parse grader configuration:\n " + str(subgraderconf) + "\n Error was:\n " + str(error)
log.critical(errorString)
raise ValueError(errorString)
return WeightedSubsectionsGrader( subgraders )
class CourseGrader(object):
"""
A course grader takes the totaled scores for each graded section (that a student has
started) in the course. From these scores, the grader calculates an overall percentage
grade. The grader should also generate information about how that score was calculated,
to be displayed in graphs or charts.
A grader has one required method, grade(), which is passed a grade_sheet. The grade_sheet
contains scores for all graded section that the student has started. If a student has
a score of 0 for that section, it may be missing from the grade_sheet. The grade_sheet
is keyed by section format. Each value is a list of Score namedtuples for each section
that has the matching section format.
The grader outputs a dictionary with the following keys:
- percent: Contains a float value, which is the final percentage score for the student.
- section_breakdown: This is a list of dictionaries which provide details on sections
that were graded. These are used for display in a graph or chart. The format for a
section_breakdown dictionary is explained below.
- grade_breakdown: This is a list of dictionaries which provide details on the contributions
of the final percentage grade. This is a higher level breakdown, for when the grade is constructed
of a few very large sections (such as Homeworks, Labs, a Midterm, and a Final). The format for
a grade_breakdown is explained below. This section is optional.
A dictionary in the section_breakdown list has the following keys:
percent: A float percentage for the section.
label: A short string identifying the section. Preferably fixed-length. E.g. "HW 3".
detail: A string explanation of the score. E.g. "Homework 1 - Ohms Law - 83% (5/6)"
category: A string identifying the category. Items with the same category are grouped together
in the display (for example, by color).
prominent: A boolean value indicating that this section should be displayed as more prominent
than other items.
A dictionary in the grade_breakdown list has the following keys:
percent: A float percentage in the breakdown. All percents should add up to the final percentage.
detail: A string explanation of this breakdown. E.g. "Homework - 10% of a possible 15%"
category: A string identifying the category. Items with the same category are grouped together
in the display (for example, by color).
"""
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def grade(self, grade_sheet):
raise NotImplementedError
class WeightedSubsectionsGrader(CourseGrader):
"""
This grader takes a list of tuples containing (grader, category_name, weight) and computes
a final grade by totalling the contribution of each sub grader and multiplying it by the
given weight. For example, the sections may be
[ (homeworkGrader, "Homework", 0.15), (labGrader, "Labs", 0.15), (midtermGrader, "Midterm", 0.30), (finalGrader, "Final", 0.40) ]
All items in section_breakdown for each subgrader will be combined. A grade_breakdown will be
composed using the score from each grader.
Note that the sum of the weights is not take into consideration. If the weights add up to
a value > 1, the student may end up with a percent > 100%. This allows for sections that
are extra credit.
"""
def __init__(self, sections):
self.sections = sections
def grade(self, grade_sheet):
total_percent = 0.0
section_breakdown = []
grade_breakdown = []
for subgrader, category, weight in self.sections:
subgrade_result = subgrader.grade(grade_sheet)
weightedPercent = subgrade_result['percent'] * weight
section_detail = "{0} = {1:.1%} of a possible {2:.0%}".format(category, weightedPercent, weight)
total_percent += weightedPercent
section_breakdown += subgrade_result['section_breakdown']
grade_breakdown.append( {'percent' : weightedPercent, 'detail' : section_detail, 'category' : category} )
return {'percent' : total_percent,
'section_breakdown' : section_breakdown,
'grade_breakdown' : grade_breakdown}
class SingleSectionGrader(CourseGrader):
"""
This grades a single section with the format 'type' and the name 'name'.
If the name is not appropriate for the short short_label or category, they each may
be specified individually.
"""
def __init__(self, type, name, short_label = None, category = None):
self.type = type
self.name = name
self.short_label = short_label or name
self.category = category or name
def grade(self, grade_sheet):
foundScore = None
if self.type in grade_sheet:
for score in grade_sheet[self.type]:
if score.section == self.name:
foundScore = score
break
if foundScore:
percent = foundScore.earned / float(foundScore.possible)
detail = "{name} - {percent:.0%} ({earned:.3n}/{possible:.3n})".format( name = self.name,
percent = percent,
earned = float(foundScore.earned),
possible = float(foundScore.possible))
else:
percent = 0.0
detail = "{name} - 0% (?/?)".format(name = self.name)
if settings.GENERATE_PROFILE_SCORES:
points_possible = random.randrange(50, 100)
points_earned = random.randrange(40, points_possible)
percent = points_earned / float(points_possible)
detail = "{name} - {percent:.0%} ({earned:.3n}/{possible:.3n})".format( name = self.name,
percent = percent,
earned = float(points_earned),
possible = float(points_possible))
breakdown = [{'percent': percent, 'label': self.short_label, 'detail': detail, 'category': self.category, 'prominent': True}]
return {'percent' : percent,
'section_breakdown' : breakdown,
#No grade_breakdown here
}
class AssignmentFormatGrader(CourseGrader):
"""
Grades all sections matching the format 'type' with an equal weight. A specified
number of lowest scores can be dropped from the calculation. The minimum number of
sections in this format must be specified (even if those sections haven't been
written yet).
min_count defines how many assignments are expected throughout the course. Placeholder
scores (of 0) will be inserted if the number of matching sections in the course is < min_count.
If there number of matching sections in the course is > min_count, min_count will be ignored.
category should be presentable to the user, but may not appear. When the grade breakdown is
displayed, scores from the same category will be similar (for example, by color).
section_type is a string that is the type of a singular section. For example, for Labs it
would be "Lab". This defaults to be the same as category.
short_label is similar to section_type, but shorter. For example, for Homework it would be
"HW".
"""
def __init__(self, type, min_count, drop_count, category = None, section_type = None, short_label = None):
self.type = type
self.min_count = min_count
self.drop_count = drop_count
self.category = category or self.type
self.section_type = section_type or self.type
self.short_label = short_label or self.type
def grade(self, grade_sheet):
def totalWithDrops(breakdown, drop_count):
#create an array of tuples with (index, mark), sorted by mark['percent'] descending
sorted_breakdown = sorted( enumerate(breakdown), key=lambda x: -x[1]['percent'] )
# A list of the indices of the dropped scores
dropped_indices = []
if drop_count > 0:
dropped_indices = [x[0] for x in sorted_breakdown[-drop_count:]]
aggregate_score = 0
for index, mark in enumerate(breakdown):
if index not in dropped_indices:
aggregate_score += mark['percent']
if (len(breakdown) - drop_count > 0):
aggregate_score /= len(breakdown) - drop_count
return aggregate_score, dropped_indices
#Figure the homework scores
scores = grade_sheet.get(self.type, [])
breakdown = []
for i in range( max(self.min_count, len(scores)) ):
if i < len(scores):
percentage = scores[i].earned / float(scores[i].possible)
summary = "{section_type} {index} - {name} - {percent:.0%} ({earned:.3n}/{possible:.3n})".format(index = i+1,
section_type = self.section_type,
name = scores[i].section,
percent = percentage,
earned = float(scores[i].earned),
possible = float(scores[i].possible) )
else:
percentage = 0
summary = "{section_type} {index} Unreleased - 0% (?/?)".format(index = i+1, section_type = self.section_type)
if settings.GENERATE_PROFILE_SCORES:
points_possible = random.randrange(10, 50)
points_earned = random.randrange(5, points_possible)
percentage = points_earned / float(points_possible)
summary = "{section_type} {index} - {name} - {percent:.0%} ({earned:.3n}/{possible:.3n})".format(index = i+1,
section_type = self.section_type,
name = "Randomly Generated",
percent = percentage,
earned = float(points_earned),
possible = float(points_possible) )
short_label = "{short_label} {index:02d}".format(index = i+1, short_label = self.short_label)
breakdown.append( {'percent': percentage, 'label': short_label, 'detail': summary, 'category': self.category} )
total_percent, dropped_indices = totalWithDrops(breakdown, self.drop_count)
for dropped_index in dropped_indices:
breakdown[dropped_index]['mark'] = {'detail': "The lowest {drop_count} {section_type} scores are dropped.".format(drop_count = self.drop_count, section_type=self.section_type) }
total_detail = "{section_type} Average = {percent:.0%}".format(percent = total_percent, section_type = self.section_type)
total_label = "{short_label} Avg".format(short_label = self.short_label)
breakdown.append( {'percent': total_percent, 'label': total_label, 'detail': total_detail, 'category': self.category, 'prominent': True} )
return {'percent' : total_percent,
'section_breakdown' : breakdown,
#No grade_breakdown here
}
import courseware.content_parser as content_parser
import courseware.modules
import logging
from lxml import etree
import random
import urllib
from collections import namedtuple
from django.conf import settings
from lxml import etree
from models import StudentModule
from student.models import UserProfile
log = logging.getLogger("mitx.courseware")
Score = namedtuple("Score", "earned possible weight graded section")
def get_grade(user, problem, cache):
## HACK: assumes max score is fixed per problem
id = problem.get('id')
correct = 0
# If the ID is not in the cache, add the item
if id not in cache:
module = StudentModule(module_type = 'problem', # TODO: Move into StudentModule.__init__?
module_id = id,
student = user,
state = None,
grade = 0,
max_grade = None,
done = 'i')
cache[id] = module
# Grab the # correct from cache
if id in cache:
response = cache[id]
if response.grade!=None:
correct=response.grade
# Grab max grade from cache, or if it doesn't exist, compute and save to DB
if id in cache and response.max_grade != None:
total = response.max_grade
else:
total=courseware.modules.capa_module.Module(etree.tostring(problem), "id").max_score()
response.max_grade = total
response.save()
return (correct, total)
from courseware import course_settings
import courseware.content_parser as content_parser
from courseware.graders import Score
import courseware.modules
from models import StudentModule
def grade_sheet(student):
"""
......@@ -54,9 +17,9 @@ def grade_sheet(student):
each containing an array of sections, each containing an array of scores. This contains information for graded and ungraded
problems, and is good for displaying a course summary with due dates, etc.
- grade_summary is a summary of how the final grade breaks down. It is an array of "sections". Each section can either be
a conglomerate of scores (like labs or homeworks) which has subscores and a totalscore, or a section can be all from one assignment
(such as a midterm or final) and only has a totalscore. Each section has a weight that shows how it contributes to the total grade.
- grade_summary is the output from the course grader. More information on the format is in the docstring for CourseGrader.
- grade is a letter grade, either 'A', 'B', 'C', or None
"""
dom=content_parser.course_file(student)
course = dom.xpath('//course/@name')[0]
......@@ -68,7 +31,6 @@ def grade_sheet(student):
response_by_id[response.module_id] = response
totaled_scores = {}
chapters=[]
for c in xmlChapters:
......@@ -85,33 +47,29 @@ def grade_sheet(student):
scores=[]
if len(problems)>0:
for p in problems:
(correct,total) = get_grade(student, p, response_by_id)
# id = p.get('id')
# correct = 0
# if id in response_by_id:
# response = response_by_id[id]
# if response.grade!=None:
# correct=response.grade
# total=courseware.modules.capa_module.Module(etree.tostring(p), "id").max_score() # TODO: Add state. Not useful now, but maybe someday problems will have randomized max scores?
# print correct, total
(correct,total) = get_score(student, p, response_by_id)
if settings.GENERATE_PROFILE_SCORES:
if total > 1:
correct = random.randrange( max(total-2, 1) , total + 1 )
else:
correct = total
scores.append( Score(int(correct),total, float(p.get("weight", total)), graded, p.get("name")) )
if not total > 0:
#We simply cannot grade a problem that is 12/0, because we might need it as a percentage
graded = False
scores.append( Score(correct,total, graded, p.get("name")) )
section_total, graded_total = aggregate_scores(scores)
section_total, graded_total = aggregate_scores(scores, s.get("name"))
#Add the graded total to totaled_scores
format = s.get('format') if s.get('format') else ""
subtitle = s.get('subtitle') if s.get('subtitle') else format
format = s.get('format', "")
subtitle = s.get('subtitle', format)
if format and graded_total[1] > 0:
format_scores = totaled_scores.get(format, [])
format_scores.append( graded_total )
totaled_scores[ format ] = format_scores
score={'section':s.get("name"),
section_score={'section':s.get("name"),
'scores':scores,
'section_total' : section_total,
'format' : format,
......@@ -119,154 +77,92 @@ def grade_sheet(student):
'due' : s.get("due") or "",
'graded' : graded,
}
sections.append(score)
sections.append(section_score)
chapters.append({'course':course,
'chapter' : c.get("name"),
'sections' : sections,})
grade_summary = grade_summary_6002x(totaled_scores)
return {'courseware_summary' : chapters, #all assessments as they appear in the course definition
'grade_summary' : grade_summary, #graded assessments only
}
grader = course_settings.GRADER
grade_summary = grader.grade(totaled_scores)
# We round the grade here, to make sure that the grade is an whole percentage and
# doesn't get displayed differently than it gets grades
grade_summary['percent'] = round(grade_summary['percent'] * 100 + 0.05) / 100
letter_grade = grade_for_percentage(grade_summary['percent'])
return {'courseware_summary' : chapters,
'grade_summary' : grade_summary,
'grade' : letter_grade}
def aggregate_scores(scores):
scores = filter( lambda score: score.possible > 0, scores )
def grade_for_percentage(percentage):
letter_grade = None
for possible_grade in ['A', 'B', 'C']:
if percentage >= course_settings.GRADE_CUTOFFS[possible_grade]:
letter_grade = possible_grade
break
total_correct_graded = sum((score.earned*1.0/score.possible)*score.weight for score in scores if score.graded)
total_possible_graded = sum(score.weight for score in scores if score.graded)
total_correct = sum((score.earned*1.0/score.possible)*score.weight for score in scores)
total_possible = sum(score.weight for score in scores)
return letter_grade
def aggregate_scores(scores, section_name = "summary"):
total_correct_graded = sum(score.earned for score in scores if score.graded)
total_possible_graded = sum(score.possible for score in scores if score.graded)
total_correct = sum(score.earned for score in scores)
total_possible = sum(score.possible for score in scores)
#regardless of whether or not it is graded
all_total = Score(total_correct,
total_possible,
1,
False,
"summary")
section_name)
#selecting only graded things
graded_total = Score(total_correct_graded,
total_possible_graded,
1,
True,
"summary")
section_name)
return all_total, graded_total
def grade_summary_6002x(totaled_scores):
"""
This function takes the a dictionary of (graded) section scores, and applies the course grading rules to create
the grade_summary. For 6.002x this means homeworks and labs all have equal weight, with the lowest 2 of each
being dropped. There is one midterm and one final.
"""
def totalWithDrops(scores, drop_count):
#Note that this key will sort the list descending
sorted_scores = sorted( enumerate(scores), key=lambda x: -x[1]['percentage'] )
# A list of the indices of the dropped scores
dropped_indices = [score[0] for score in sorted_scores[-drop_count:]]
aggregate_score = 0
for index, score in enumerate(scores):
if index not in dropped_indices:
aggregate_score += score['percentage']
aggregate_score /= len(scores) - drop_count
return aggregate_score, dropped_indices
#Figure the homework scores
homework_scores = totaled_scores['Homework'] if 'Homework' in totaled_scores else []
homework_percentages = []
for i in range(12):
if i < len(homework_scores):
percentage = homework_scores[i].earned / float(homework_scores[i].possible)
summary = "Homework {0} - {1} - {2:.0%} ({3:g}/{4:g})".format( i + 1, homework_scores[i].section , percentage, homework_scores[i].earned, homework_scores[i].possible )
else:
percentage = 0
summary = "Unreleased Homework {0} - 0% (?/?)".format(i + 1)
if settings.GENERATE_PROFILE_SCORES:
points_possible = random.randrange(10, 50)
points_earned = random.randrange(5, points_possible)
percentage = points_earned / float(points_possible)
summary = "Random Homework - {0:.0%} ({1:g}/{2:g})".format( percentage, points_earned, points_possible )
label = "HW {0:02d}".format(i + 1)
homework_percentages.append( {'percentage': percentage, 'summary': summary, 'label' : label} )
homework_total, homework_dropped_indices = totalWithDrops(homework_percentages, 2)
#Figure the lab scores
lab_scores = totaled_scores['Lab'] if 'Lab' in totaled_scores else []
lab_percentages = []
for i in range(12):
if i < len(lab_scores):
percentage = lab_scores[i].earned / float(lab_scores[i].possible)
summary = "Lab {0} - {1} - {2:.0%} ({3:g}/{4:g})".format( i + 1, lab_scores[i].section , percentage, lab_scores[i].earned, lab_scores[i].possible )
else:
percentage = 0
summary = "Unreleased Lab {0} - 0% (?/?)".format(i + 1)
if settings.GENERATE_PROFILE_SCORES:
points_possible = random.randrange(10, 50)
points_earned = random.randrange(5, points_possible)
percentage = points_earned / float(points_possible)
summary = "Random Lab - {0:.0%} ({1:g}/{2:g})".format( percentage, points_earned, points_possible )
label = "Lab {0:02d}".format(i + 1)
lab_percentages.append( {'percentage': percentage, 'summary': summary, 'label' : label} )
lab_total, lab_dropped_indices = totalWithDrops(lab_percentages, 2)
#TODO: Pull this data about the midterm and final from the databse. It should be exactly similar to above, but we aren't sure how exams will be done yet.
#This is a hack, but I have no intention of having this function be useful for anything but 6.002x anyway, so I don't want to make it pretty.
midterm_score = totaled_scores['Midterm'][0] if 'Midterm' in totaled_scores else Score('?', '?', '?', True, "?")
midterm_percentage = midterm_score.earned * 1.0 / midterm_score.possible if 'Midterm' in totaled_scores else 0
final_score = totaled_scores['Final'][0] if 'Final' in totaled_scores else Score('?', '?', '?', True, "?")
final_percentage = final_score.earned * 1.0 / final_score.possible if 'Final' in totaled_scores else 0
def get_score(user, problem, cache):
## HACK: assumes max score is fixed per problem
id = problem.get('id')
correct = 0.0
if settings.GENERATE_PROFILE_SCORES:
midterm_score = Score(random.randrange(50, 150), 150, 150, True, "?")
midterm_percentage = midterm_score.earned / float(midterm_score.possible)
# If the ID is not in the cache, add the item
if id not in cache:
module = StudentModule(module_type = 'problem', # TODO: Move into StudentModule.__init__?
module_id = id,
student = user,
state = None,
grade = 0,
max_grade = None,
done = 'i')
cache[id] = module
# Grab the # correct from cache
if id in cache:
response = cache[id]
if response.grade!=None:
correct=float(response.grade)
final_score = Score(random.randrange(100, 300), 300, 300, True, "?")
final_percentage = final_score.earned / float(final_score.possible)
# Grab max grade from cache, or if it doesn't exist, compute and save to DB
if id in cache and response.max_grade != None:
total = response.max_grade
else:
total=float(courseware.modules.capa_module.Module(etree.tostring(problem), "id").max_score())
response.max_grade = total
response.save()
grade_summary = [
{
'category': 'Homework',
'subscores' : homework_percentages,
'dropped_indices' : homework_dropped_indices,
'totalscore' : homework_total,
'totalscore_summary' : "Homework Average - {0:.0%}".format(homework_total),
'totallabel' : 'HW Avg',
'weight' : 0.15,
},
{
'category': 'Labs',
'subscores' : lab_percentages,
'dropped_indices' : lab_dropped_indices,
'totalscore' : lab_total,
'totalscore_summary' : "Lab Average - {0:.0%}".format(lab_total),
'totallabel' : 'Lab Avg',
'weight' : 0.15,
},
{
'category': 'Midterm',
'totalscore' : midterm_percentage,
'totalscore_summary' : "Midterm - {0:.0%} ({1}/{2})".format(midterm_percentage, midterm_score.earned, midterm_score.possible),
'totallabel' : 'Midterm',
'weight' : 0.30,
},
{
'category': 'Final',
'totalscore' : final_percentage,
'totalscore_summary' : "Final - {0:.0%} ({1}/{2})".format(final_percentage, final_score.earned, final_score.possible),
'totallabel' : 'Final',
'weight' : 0.40,
}
]
return grade_summary
#Now we re-weight the problem, if specified
weight = problem.get("weight", None)
if weight:
weight = float(weight)
correct = correct * weight / total
total = weight
return (correct, total)
......@@ -4,7 +4,9 @@ import numpy
import courseware.modules
import courseware.capa.calc as calc
from grades import Score, aggregate_scores
import courseware.graders as graders
from courseware.graders import Score, CourseGrader, WeightedSubsectionsGrader, SingleSectionGrader, AssignmentFormatGrader
from courseware.grades import aggregate_scores
class ModelsTest(unittest.TestCase):
def setUp(self):
......@@ -59,42 +61,218 @@ class ModelsTest(unittest.TestCase):
exception_happened = True
self.assertTrue(exception_happened)
class GraderTest(unittest.TestCase):
class GradesheetTest(unittest.TestCase):
def test_weighted_grading(self):
scores = []
Score.__sub__=lambda me, other: (me.earned - other.earned) + (me.possible - other.possible)
all, graded = aggregate_scores(scores)
self.assertEqual(all, Score(earned=0, possible=0, weight=1, graded=False, section="summary"))
self.assertEqual(graded, Score(earned=0, possible=0, weight=1, graded=True, section="summary"))
self.assertEqual(all, Score(earned=0, possible=0, graded=False, section="summary"))
self.assertEqual(graded, Score(earned=0, possible=0, graded=True, section="summary"))
scores.append(Score(earned=0, possible=5, weight=1, graded=False, section="summary"))
scores.append(Score(earned=0, possible=5, graded=False, section="summary"))
all, graded = aggregate_scores(scores)
self.assertEqual(all, Score(earned=0, possible=1, weight=1, graded=False, section="summary"))
self.assertEqual(graded, Score(earned=0, possible=0, weight=1, graded=True, section="summary"))
self.assertEqual(all, Score(earned=0, possible=5, graded=False, section="summary"))
self.assertEqual(graded, Score(earned=0, possible=0, graded=True, section="summary"))
scores.append(Score(earned=3, possible=5, weight=1, graded=True, section="summary"))
scores.append(Score(earned=3, possible=5, graded=True, section="summary"))
all, graded = aggregate_scores(scores)
self.assertAlmostEqual(all, Score(earned=3.0/5, possible=2, weight=1, graded=False, section="summary"))
self.assertAlmostEqual(graded, Score(earned=3.0/5, possible=1, weight=1, graded=True, section="summary"))
self.assertAlmostEqual(all, Score(earned=3, possible=10, graded=False, section="summary"))
self.assertAlmostEqual(graded, Score(earned=3, possible=5, graded=True, section="summary"))
scores.append(Score(earned=2, possible=5, weight=2, graded=True, section="summary"))
scores.append(Score(earned=2, possible=5, graded=True, section="summary"))
all, graded = aggregate_scores(scores)
self.assertAlmostEqual(all, Score(earned=7.0/5, possible=4, weight=1, graded=False, section="summary"))
self.assertAlmostEqual(graded, Score(earned=7.0/5, possible=3, weight=1, graded=True, section="summary"))
self.assertAlmostEqual(all, Score(earned=5, possible=15, graded=False, section="summary"))
self.assertAlmostEqual(graded, Score(earned=5, possible=10, graded=True, section="summary"))
class GraderTest(unittest.TestCase):
scores.append(Score(earned=2, possible=5, weight=0, graded=True, section="summary"))
all, graded = aggregate_scores(scores)
self.assertAlmostEqual(all, Score(earned=7.0/5, possible=4, weight=1, graded=False, section="summary"))
self.assertAlmostEqual(graded, Score(earned=7.0/5, possible=3, weight=1, graded=True, section="summary"))
empty_gradesheet = {
}
incomplete_gradesheet = {
'Homework': [],
'Lab': [],
'Midterm' : [],
}
test_gradesheet = {
'Homework': [Score(earned=2, possible=20.0, graded=True, section='hw1'),
Score(earned=16, possible=16.0, graded=True, section='hw2')],
#The dropped scores should be from the assignments that don't exist yet
'Lab': [Score(earned=1, possible=2.0, graded=True, section='lab1'), #Dropped
Score(earned=1, possible=1.0, graded=True, section='lab2'),
Score(earned=1, possible=1.0, graded=True, section='lab3'),
Score(earned=5, possible=25.0, graded=True, section='lab4'), #Dropped
Score(earned=3, possible=4.0, graded=True, section='lab5'), #Dropped
Score(earned=6, possible=7.0, graded=True, section='lab6'),
Score(earned=5, possible=6.0, graded=True, section='lab7')],
'Midterm' : [Score(earned=50.5, possible=100, graded=True, section="Midterm Exam"),],
}
def test_SingleSectionGrader(self):
midtermGrader = graders.SingleSectionGrader("Midterm", "Midterm Exam")
lab4Grader = graders.SingleSectionGrader("Lab", "lab4")
badLabGrader = graders.SingleSectionGrader("Lab", "lab42")
for graded in [midtermGrader.grade(self.empty_gradesheet),
midtermGrader.grade(self.incomplete_gradesheet),
badLabGrader.grade(self.test_gradesheet)]:
self.assertEqual( len(graded['section_breakdown']), 1 )
self.assertEqual( graded['percent'], 0.0 )
graded = midtermGrader.grade(self.test_gradesheet)
self.assertAlmostEqual( graded['percent'], 0.505 )
self.assertEqual( len(graded['section_breakdown']), 1 )
graded = lab4Grader.grade(self.test_gradesheet)
self.assertAlmostEqual( graded['percent'], 0.2 )
self.assertEqual( len(graded['section_breakdown']), 1 )
def test_AssignmentFormatGrader(self):
homeworkGrader = graders.AssignmentFormatGrader("Homework", 12, 2)
noDropGrader = graders.AssignmentFormatGrader("Homework", 12, 0)
#Even though the minimum number is 3, this should grade correctly when 7 assignments are found
overflowGrader = graders.AssignmentFormatGrader("Lab", 3, 2)
labGrader = graders.AssignmentFormatGrader("Lab", 7, 3)
#Test the grading of an empty gradesheet
for graded in [ homeworkGrader.grade(self.empty_gradesheet),
noDropGrader.grade(self.empty_gradesheet),
homeworkGrader.grade(self.incomplete_gradesheet),
noDropGrader.grade(self.incomplete_gradesheet) ]:
self.assertAlmostEqual( graded['percent'], 0.0 )
#Make sure the breakdown includes 12 sections, plus one summary
self.assertEqual( len(graded['section_breakdown']), 12 + 1 )
graded = homeworkGrader.grade(self.test_gradesheet)
self.assertAlmostEqual( graded['percent'], 0.11 ) # 100% + 10% / 10 assignments
self.assertEqual( len(graded['section_breakdown']), 12 + 1 )
graded = noDropGrader.grade(self.test_gradesheet)
self.assertAlmostEqual( graded['percent'], 0.0916666666666666 ) # 100% + 10% / 12 assignments
self.assertEqual( len(graded['section_breakdown']), 12 + 1 )
graded = overflowGrader.grade(self.test_gradesheet)
self.assertAlmostEqual( graded['percent'], 0.8880952380952382 ) # 100% + 10% / 5 assignments
self.assertEqual( len(graded['section_breakdown']), 7 + 1 )
graded = labGrader.grade(self.test_gradesheet)
self.assertAlmostEqual( graded['percent'], 0.9226190476190477 )
self.assertEqual( len(graded['section_breakdown']), 7 + 1 )
def test_WeightedSubsectionsGrader(self):
#First, a few sub graders
homeworkGrader = graders.AssignmentFormatGrader("Homework", 12, 2)
labGrader = graders.AssignmentFormatGrader("Lab", 7, 3)
midtermGrader = graders.SingleSectionGrader("Midterm", "Midterm Exam")
weightedGrader = graders.WeightedSubsectionsGrader( [(homeworkGrader, homeworkGrader.category, 0.25), (labGrader, labGrader.category, 0.25),
(midtermGrader, midtermGrader.category, 0.5)] )
overOneWeightsGrader = graders.WeightedSubsectionsGrader( [(homeworkGrader, homeworkGrader.category, 0.5), (labGrader, labGrader.category, 0.5),
(midtermGrader, midtermGrader.category, 0.5)] )
#The midterm should have all weight on this one
zeroWeightsGrader = graders.WeightedSubsectionsGrader( [(homeworkGrader, homeworkGrader.category, 0.0), (labGrader, labGrader.category, 0.0),
(midtermGrader, midtermGrader.category, 0.5)] )
#This should always have a final percent of zero
allZeroWeightsGrader = graders.WeightedSubsectionsGrader( [(homeworkGrader, homeworkGrader.category, 0.0), (labGrader, labGrader.category, 0.0),
(midtermGrader, midtermGrader.category, 0.0)] )
emptyGrader = graders.WeightedSubsectionsGrader( [] )
graded = weightedGrader.grade(self.test_gradesheet)
self.assertAlmostEqual( graded['percent'], 0.5106547619047619 )
self.assertEqual( len(graded['section_breakdown']), (12 + 1) + (7+1) + 1 )
self.assertEqual( len(graded['grade_breakdown']), 3 )
graded = overOneWeightsGrader.grade(self.test_gradesheet)
self.assertAlmostEqual( graded['percent'], 0.7688095238095238 )
self.assertEqual( len(graded['section_breakdown']), (12 + 1) + (7+1) + 1 )
self.assertEqual( len(graded['grade_breakdown']), 3 )
graded = zeroWeightsGrader.grade(self.test_gradesheet)
self.assertAlmostEqual( graded['percent'], 0.2525 )
self.assertEqual( len(graded['section_breakdown']), (12 + 1) + (7+1) + 1 )
self.assertEqual( len(graded['grade_breakdown']), 3 )
graded = allZeroWeightsGrader.grade(self.test_gradesheet)
self.assertAlmostEqual( graded['percent'], 0.0 )
self.assertEqual( len(graded['section_breakdown']), (12 + 1) + (7+1) + 1 )
self.assertEqual( len(graded['grade_breakdown']), 3 )
for graded in [ weightedGrader.grade(self.empty_gradesheet),
weightedGrader.grade(self.incomplete_gradesheet),
zeroWeightsGrader.grade(self.empty_gradesheet),
allZeroWeightsGrader.grade(self.empty_gradesheet)]:
self.assertAlmostEqual( graded['percent'], 0.0 )
self.assertEqual( len(graded['section_breakdown']), (12 + 1) + (7+1) + 1 )
self.assertEqual( len(graded['grade_breakdown']), 3 )
graded = emptyGrader.grade(self.test_gradesheet)
self.assertAlmostEqual( graded['percent'], 0.0 )
self.assertEqual( len(graded['section_breakdown']), 0 )
self.assertEqual( len(graded['grade_breakdown']), 0 )
scores.append(Score(earned=2, possible=5, weight=3, graded=False, section="summary"))
all, graded = aggregate_scores(scores)
self.assertAlmostEqual(all, Score(earned=13.0/5, possible=7, weight=1, graded=False, section="summary"))
self.assertAlmostEqual(graded, Score(earned=7.0/5, possible=3, weight=1, graded=True, section="summary"))
def test_graderFromConf(self):
#Confs always produce a graders.WeightedSubsectionsGrader, so we test this by repeating the test
#in test_graders.WeightedSubsectionsGrader, but generate the graders with confs.
weightedGrader = graders.grader_from_conf([
{
'type' : "Homework",
'min_count' : 12,
'drop_count' : 2,
'short_label' : "HW",
'weight' : 0.25,
},
{
'type' : "Lab",
'min_count' : 7,
'drop_count' : 3,
'category' : "Labs",
'weight' : 0.25
},
{
'type' : "Midterm",
'name' : "Midterm Exam",
'short_label' : "Midterm",
'weight' : 0.5,
},
])
emptyGrader = graders.grader_from_conf([])
graded = weightedGrader.grade(self.test_gradesheet)
self.assertAlmostEqual( graded['percent'], 0.5106547619047619 )
self.assertEqual( len(graded['section_breakdown']), (12 + 1) + (7+1) + 1 )
self.assertEqual( len(graded['grade_breakdown']), 3 )
graded = emptyGrader.grade(self.test_gradesheet)
self.assertAlmostEqual( graded['percent'], 0.0 )
self.assertEqual( len(graded['section_breakdown']), 0 )
self.assertEqual( len(graded['grade_breakdown']), 0 )
#Test that graders can also be used instead of lists of dictionaries
homeworkGrader = graders.AssignmentFormatGrader("Homework", 12, 2)
homeworkGrader2 = graders.grader_from_conf(homeworkGrader)
graded = homeworkGrader2.grade(self.test_gradesheet)
self.assertAlmostEqual( graded['percent'], 0.11 )
self.assertEqual( len(graded['section_breakdown']), 12 + 1 )
#TODO: How do we test failure cases? The parser only logs an error when it can't parse something. Maybe it should throw exceptions?
scores.append(Score(earned=2, possible=5, weight=.5, graded=True, section="summary"))
all, graded = aggregate_scores(scores)
self.assertAlmostEqual(all, Score(earned=14.0/5, possible=7.5, weight=1, graded=False, section="summary"))
self.assertAlmostEqual(graded, Score(earned=8.0/5, possible=3.5, weight=1, graded=True, section="summary"))
import json
import logging
import os
import random
......@@ -17,12 +16,16 @@ from mitxmako.shortcuts import render_to_response, render_to_string
#from django.views.decorators.csrf import ensure_csrf_cookie
from django.db import connection
from django.views.decorators.cache import cache_control
from django_future.csrf import ensure_csrf_cookie
from lxml import etree
from courseware import course_settings
from module_render import render_module, modx_dispatch
from certificates.models import GeneratedCertificate, certificate_state_for_student
from models import StudentModule
from student.models import UserProfile
from student.views import student_took_survey
import courseware.content_parser as content_parser
import courseware.modules.capa_module
......@@ -45,10 +48,13 @@ def gradebook(request):
'id' : s.id,
'email': s.email,
'grade_info' : grades.grade_sheet(s),
'realname' : UserProfile.objects.get(user = s).name
'realname' : UserProfile.objects.get(user = s).name,
} for s in student_objects]
return render_to_response('gradebook.html',{'students':student_info})
return render_to_response('gradebook.html',
{'students':student_info,
'grade_cutoffs' : course_settings.GRADE_CUTOFFS,}
)
@cache_control(no_cache=True, no_store=True, must_revalidate=True)
def profile(request, student_id = None):
......@@ -66,16 +72,30 @@ def profile(request, student_id = None):
student = User.objects.get( id = int(student_id))
user_info = UserProfile.objects.get(user=student) # request.user.profile_cache #
grade_sheet = grades.grade_sheet(student)
context={'name':user_info.name,
'username':student.username,
'location':user_info.location,
'language':user_info.language,
'email':student.email,
'format_url_params' : content_parser.format_url_params,
'csrf':csrf(request)['csrf_token']
'csrf':csrf(request)['csrf_token'],
'grade_cutoffs' : course_settings.GRADE_CUTOFFS,
'grade_sheet' : grade_sheet,
}
context.update(grades.grade_sheet(student))
if settings.END_COURSE_ENABLED:
took_survey = student_took_survey(user_info)
if settings.DEBUG_SURVEY:
took_survey = False
certificate_state = certificate_state_for_student(student, grade_sheet['grade'])
context.update({'certificate_state' : certificate_state,
'took_survey' : took_survey})
return render_to_response('profile.html', context)
......
from numpy import exp, log
import random
import settings
def exit_survey_list_for_student(student):
# Right now, we just randomly pick some questions from random_questions
common_questions = exit_survey_questions['common_questions']
randomized_questions = exit_survey_questions['random_questions']
#If we use random.sample on randomized_questions directly, it will re-arrange the questions
random_question_total = len(randomized_questions)
if not settings.DEBUG_SURVEY:
# Here we randomize how many questions the student gets. Half get 5, some get all, and the
# rest is a log distribution between 1 and all.
num_random = loguniform_with_bins(1, random_question_total, ((0.5, 5), (0.1, random_question_total)))
num_random = int(num_random)
chosen_indices = random.sample( range( random_question_total ), num_random)
else:
#In debug mode, we show all surveys
chosen_indices = range( random_question_total )
chosen_questions = [ randomized_questions[i] for i in sorted(chosen_indices)]
survey_list = common_questions + chosen_questions
return survey_list
import random
def loguniform(minimum, maximum):
''' Give a random number between minimum and maximum with an
exponential distribution.
'''
return round(exp(random.uniform(log(minimum-0.5), log(maximum+0.5))))
def loguniform_with_bins(minimum, maximum, bins):
''' Log random, but with additional high-probability bins. E.g.
loguniform(1, 30, ((0.5, 5), (0.1, 30)))
Is:
* The same as loguniform 40% of the time,
* The 5 50% of the time
* 30 10% of the time
Note that 5 and 30 are also present in loguniform, so will in fact
appear more often than 50%/10%
'''
for (prob, value) in bins:
if random.random()<prob:
return value
return loguniform(minimum, maximum)
exit_survey_questions = {
'common_questions' : [
{'type' : 'checkbox',
'question_name' : 'future_classes',
'label' : 'Please inform me of future classes offered by edX.'},
{'type' : 'checkbox',
'question_name' : 'future_offerings',
'label' : 'Please inform me of opportunities to help with future offerings of this course, such as staffing discussiong forums or developing content.'},
{'type' : 'checkbox',
'question_name' : 'future_updates',
'label' : 'Please subscribe me to periodic updates about additional topics, refreshers, and follow-ups for topics in this course.'},
{'type' : 'medium_field',
'question_name' : 'favorite_parts',
'label' : 'What were your favorite parts of this course? We would love to hear your comments on the course or the platform.'},
{'type' : 'radio',
'question_name' : 'rating',
'label' : 'How would you rate this course?',
'choices' : [
'1 - I hated it. I didn\'t learn anything.',
'2',
'3',
'4 - It was pretty good, but could use some improvement.',
'5',
'6',
'7 - Absolutely amazing. I learned a great deal.',
]},
],
'random_questions' : [
# New, needs review
{'type' : 'radio',
'question_name' : 'university_comparison',
'label' : 'How would you compare this course to an equivalent university course, if you have taken one?',
'choices' : [
'This course was <strong>much worse</strong> than the university class.',
'This course was <strong>on the same level</strong> as the university class.',
'This course was <strong>much better</strong> than the university class.',
'I have not taken an equivalent university class.',
]},
{'type' : 'select_many',
'question_name' : 'smartphone_usage',
'label' : 'Are you interested in taking edX courses from a mobile device, such as a smartphone? (Chech all that apply.)',
'choices' : [
'I would like to use a mobile device my <strong>primary</strong> way of taking edX courses.',
'I would like to use a mobile device to <strong>sometimes</strong> access edX courses.',
'I would <strong>not</strong> like to use a mobile device with edX courses.',
'I use an Android device.',
'I use an iPhone or iPod Touch.',
'I use an iPad.',
'I use a different internet-capable mobile device.',
'I do not use an internet-capable mobile device.',
]},
{'type' : 'medium_field',
'question_name' : 'improvement_ideas',
'label' : 'Do you have any ideas on how to improve this course or the edX platform?'},
# Level of bandwidth
# Speed of computer/RAM/etc.
# Size of monitor
# Own a tablet?
{'type' : 'radio',
'question_name' : 'teach_ee',
'label' : 'Do you teach electrical engineering (EE)?',
'choices' : [
'I teach EE in college/university.',
'I teach EE in high school/secondary school.',
'I teach EE elsewhere.',
'I do not teach EE.',
]},
{'type' : 'radio',
'question_name' : 'highest_degree',
'label' : 'What is the highest degree you have completed?',
'choices' : [
'PhD in a science or engineering field.',
'PhD in another field.',
'Master\'s or professional degree.',
'Bachelor\'s degree.',
'Secondary/high school.',
'Junior secondary/high school.',
'Elementary/primary school.',
]},
{'type' : 'short_field',
'question_name' : 'age',
'label' : 'What is your age?',
},
{'type' : 'radio',
'question_name' : 'gender',
'label' : 'What is your gender?',
'choices' : [
'Female',
'Male',
'Other',
]},
{'type' : 'radio',
'question_name' : 'ee_level',
'label' : 'How much electrical engineering have you studied? ',
'choices' : [
'More than one year of EE in college/university',
'One year or less of EE in college/university',
'More than one year of EE in high school/secondary school',
'One year or less of EE in high school/secondary school',
'Self-taught in EE',
'None of the above',
]},
{'type' : 'radio',
'question_name' : 'math_level',
'label' : 'What was your calculus background prior to this course?',
'choices' : [
'Vector calculus or differential equations',
'Single variable calculus',
'No calculus',
]},
{'type' : 'radio',
'question_name' : 'why_course',
'label' : 'What is your <b>primary</b> motivation for taking 6.002x?',
'choices' : [
'The entertainment value of the course',
'The personal challenge',
'The knowledge and skills gained as a result from taking the course',
'Employment/job advancement opportunities',
'Social understanding and friends gained as a result of taking the course',
'Preparation for advanced standing exam',
'Other',
]},
{'type' : 'short_field',
'question_name' : 'weekly_hours',
'label' : 'How many hours per week on average did you work on this course?',
},
{'type' : 'radio',
'question_name' : 'internet_access',
'label' : 'Where did you access the MITx website most frequently?',
'choices' : [
'At home',
'At the home of a friend or family member outside your home',
'At school',
'Internet cafe or other public space',
'Other',
]},
{'type' : 'radio',
'question_name' : 'work_offline',
'label' : 'Have you worked <b>offline</b> with anyone on the MITx material?',
'choices' : [
'I worked with another person who is also completing the course.',
'I worked with someone who teaches or has expertise in this area.',
'I worked completely on my own.',
'Other',
]},
{'type' : 'radio',
'question_name' : 'online_course_count',
'label' : 'Including 6.002x, how many online courses have you taken?',
'choices' : [
'1',
'2',
'3',
'4',
'5 or more',
]},
{'type' : 'short_field',
'question_name' : 'race',
'label' : 'With what race/ethnic group do you most strongly identify?',
},
{'type' : 'radio',
'question_name' : 'book_count',
'label' : 'How many books are there in your home? <br/><em>(There are usually about 40 books per meter of shelving. Do not include magazines, newspapers, or schoolbooks in your estimate.)</em>',
'choices' : [
'0-10 books',
'11-25 books',
'26-100 books',
'101-200 books',
'201-500 books',
'More than 500 books',
]},
{'type' : 'radio',
'question_name' : 'computer_in_home',
'label' : 'Did you have a computer in your home?',
'choices' : [
'Yes',
'No',
]},
{'type' : 'radio',
'question_name' : 'parents_engineering',
'label' : 'Do either of your parents have any training or experience in engineering?',
'choices' : [
'Yes',
'No',
'I don\'t know',
]},
#We used to have two of these questions, one for their mom and one for their dad. That might not make sense for some students.
{'type' : 'radio',
'question_name' : 'engineering',
'label' : 'What is the highest level of schooling completed by one of your parents? (Please choose the answer you think fits best.)',
'choices' : [
'PhD degree',
'Post-graduate, professional degree, or master\'s degree',
'Bachelor\'s degree',
'Vocational/technical training',
'High school or secondary school',
'Primary school',
'Did not complete primary school',
]},
]
}
......@@ -6,11 +6,28 @@ Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from survey_questions import exit_survey_questions
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)
class ExitSurveyTest(TestCase):
def test_unique_names(self):
question_names = set()
for question in exit_survey_questions['common_questions'] + exit_survey_questions['random_questions']:
name = question['question_name']
self.assertFalse( name in question_names, "There is a duplicate of name " + name )
question_names.add(name)
def test_question_format(self):
for question in exit_survey_questions['common_questions'] + exit_survey_questions['random_questions']:
self.assertTrue( 'question_name' in question, "All questions need a question_name. Failed on: " + str(question) )
self.assertTrue( 'label' in question, "All questions need a label. Failed on: " + str(question) )
question_type = question['type']
if question_type == 'checkbox' or question_type == 'short_field' or question_type == 'medium_field':
# No other required fields
pass
elif question_type == 'radio' or question_type == 'select_many':
self.assertTrue( 'choices' in question, "All radio/select_many questions need choices. Failed on: " + str(question) )
else:
self.assertTrue(False, "Found illegal question type. Failed on: " + str(question) )
......@@ -8,6 +8,7 @@ import uuid
from django.conf import settings
from django.contrib.auth import logout, authenticate, login
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import PasswordResetForm
from django.contrib.auth.models import User
from django.core.context_processors import csrf
......@@ -21,6 +22,7 @@ from mako import exceptions
from django_future.csrf import ensure_csrf_cookie
from student.survey_questions import exit_survey_list_for_student
from models import Registration, UserProfile, PendingNameChange, PendingEmailChange
log = logging.getLogger("mitx.student")
......@@ -456,3 +458,67 @@ def accept_name_change(request):
pnc.delete()
return HttpResponse(json.dumps({'success':True}))
@login_required
def record_exit_survey(request, internal_request = False):
if not settings.END_COURSE_ENABLED:
raise Http404
if request.method == "POST":
# If internal_request = True, this is a survey that was submitted with another form
# We will record it and return the results as a dictionary, instead of a json HttpResponse
def returnResults(return_data):
if internal_request:
return return_data
else:
return HttpResponse(json.dumps(return_data))
if 'survey_results' not in request.POST:
if internal_request:
return returnResults({'success':True})
else:
return returnResults({'success':False, 'error':'There was a problem receiving your survey response.'})
response = json.loads(request.POST['survey_results'])
up = UserProfile.objects.get(user=request.user)
meta = up.get_meta()
if '6002x_exit_response' in meta:
# Once we got a response, we don't show them the survey form again, so this is a really odd case anyway
log.warning("Received an extra survey response. " + request.POST['survey_results'])
return returnResults({'success':True})
else:
if internal_request and all( value == None or value == [''] for value in response.values() ):
# If all values are empty, then the student didn't answer any questions.
# In the case of this being an internal request, we don't mark the survey as taken
return returnResults({'success':True})
meta['6002x_exit_response'] = response
up.set_meta(meta)
up.save()
return returnResults({'success':True})
else:
user_info = UserProfile.objects.get(user=request.user)
took_survey = student_took_survey(user_info)
if settings.DEBUG_SURVEY:
took_survey = False
survey_list = []
if not took_survey:
survey_list = exit_survey_list_for_student(request.user)
context = {'took_survey' : took_survey,
'survey_list' : survey_list}
return render_to_response('exit_survey.html', context)
def student_took_survey(userprofile):
meta = userprofile.get_meta()
return '6002x_exit_response' in meta
......@@ -27,13 +27,15 @@ def render_to_string(template_name, dictionary, context=None, namespace='main'):
# collapse context_instance to a single dictionary for mako
context_dictionary = {}
context_instance['settings'] = settings
for d in mitxmako.middleware.requestcontext:
context_dictionary.update(d)
if mitxmako.middleware.requestcontext:
for d in mitxmako.middleware.requestcontext:
context_dictionary.update(d)
for d in context_instance:
context_dictionary.update(d)
if context:
context_dictionary.update(context)
# fetch and render template
print namespace, template_name
template = middleware.lookup[namespace].get_template(template_name)
return template.render(**context_dictionary)
......
......@@ -5,6 +5,12 @@ import tempfile
import djcelery
# Enables certificate requests and the exit survey
END_COURSE_ENABLED = False
# If enabled, always shows all survey questions. Has no effect without END_COURSE_ENABLED
DEBUG_SURVEY = False
# from settings2.askbotsettings import LIVESETTINGS_OPTIONS
DEFAULT_GROUPS = []
......@@ -144,6 +150,7 @@ INSTALLED_APPS = (
'simplewiki',
'track',
'circuit',
'certificates',
'perfstats',
'util',
# Uncomment the next line to enable the admin:
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/* line 1, sass/marketing-ie.scss */
body {
margin: 0;
padding: 0; }
/* line 6, sass/marketing-ie.scss */
.wrapper, .subpage, section.copyright, section.tos, section.privacy-policy, section.honor-code, header.announcement div, section.index-content, footer {
margin: 0;
overflow: hidden; }
/* line 12, sass/marketing-ie.scss */
div#enroll form {
display: none; }
body{margin:0;padding:0}.wrapper,.subpage,section.copyright,section.tos,section.privacy-policy,section.honor-code,header.announcement div,section.index-content,footer{margin:0;overflow:hidden}div#enroll form{display:none}
......@@ -5,18 +5,7 @@ Last Updated: 2010-09-17
Author: Richard Clark - http://richclarkdesign.com
Twitter: @rich_clark
*/
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, var,
b, i,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video {
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
......@@ -28,8 +17,7 @@ time, mark, audio, video {
body {
line-height: 1; }
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
display: block; }
nav ul {
......@@ -38,8 +26,7 @@ nav ul {
blockquote, q {
quotes: none; }
blockquote:before, blockquote:after,
q:before, q:after {
blockquote:before, blockquote:after, q:before, q:after {
content: '';
content: none; }
......@@ -140,27 +127,27 @@ input, select {
.subpage > div, section.copyright > div, section.tos > div, section.privacy-policy > div, section.honor-code > div {
padding-left: 34.171%; }
@media screen and (max-width: 940px) {
.subpage > div, section.copyright > div, section.tos > div, section.privacy-policy > div, section.honor-code > div {
padding-left: 0; } }
.subpage > div p, section.copyright > div p, section.tos > div p, section.privacy-policy > div p, section.honor-code > div p {
margin-bottom: 25.888px;
line-height: 25.888px; }
.subpage > div h1, section.copyright > div h1, section.tos > div h1, section.privacy-policy > div h1, section.honor-code > div h1 {
margin-bottom: 12.944px; }
.subpage > div h2, section.copyright > div h2, section.tos > div h2, section.privacy-policy > div h2, section.honor-code > div h2 {
font: 18px "Open Sans", Helvetica, Arial, sans-serif;
color: #000;
margin-bottom: 12.944px; }
.subpage > div ul, section.copyright > div ul, section.tos > div ul, section.privacy-policy > div ul, section.honor-code > div ul {
list-style: disc outside none; }
.subpage > div ul li, section.copyright > div ul li, section.tos > div ul li, section.privacy-policy > div ul li, section.honor-code > div ul li {
list-style: disc outside none;
line-height: 25.888px; }
.subpage > div dl, section.copyright > div dl, section.tos > div dl, section.privacy-policy > div dl, section.honor-code > div dl {
margin-bottom: 25.888px; }
.subpage > div dl dd, section.copyright > div dl dd, section.tos > div dl dd, section.privacy-policy > div dl dd, section.honor-code > div dl dd {
margin-bottom: 12.944px; }
@media screen and (max-width: 940px) {
.subpage > div, section.copyright > div, section.tos > div, section.privacy-policy > div, section.honor-code > div {
padding-left: 0; } }
.subpage > div p, section.copyright > div p, section.tos > div p, section.privacy-policy > div p, section.honor-code > div p {
margin-bottom: 25.888px;
line-height: 25.888px; }
.subpage > div h1, section.copyright > div h1, section.tos > div h1, section.privacy-policy > div h1, section.honor-code > div h1 {
margin-bottom: 12.944px; }
.subpage > div h2, section.copyright > div h2, section.tos > div h2, section.privacy-policy > div h2, section.honor-code > div h2 {
font: 18px "Open Sans", Helvetica, Arial, sans-serif;
color: #000;
margin-bottom: 12.944px; }
.subpage > div ul, section.copyright > div ul, section.tos > div ul, section.privacy-policy > div ul, section.honor-code > div ul {
list-style: disc outside none; }
.subpage > div ul li, section.copyright > div ul li, section.tos > div ul li, section.privacy-policy > div ul li, section.honor-code > div ul li {
list-style: disc outside none;
line-height: 25.888px; }
.subpage > div dl, section.copyright > div dl, section.tos > div dl, section.privacy-policy > div dl, section.honor-code > div dl {
margin-bottom: 25.888px; }
.subpage > div dl dd, section.copyright > div dl dd, section.tos > div dl dd, section.privacy-policy > div dl dd, section.honor-code > div dl dd {
margin-bottom: 12.944px; }
.clearfix:after, .subpage:after, section.copyright:after, section.tos:after, section.privacy-policy:after, section.honor-code:after, header.announcement div section:after, footer:after, section.index-content:after, section.index-content section:after, section.index-content section.about section:after, div.leanModal_box#enroll ol:after {
content: ".";
......@@ -213,12 +200,12 @@ input, select {
-moz-box-shadow: inset 0 1px 0 #b83d3d;
box-shadow: inset 0 1px 0 #b83d3d;
-webkit-font-smoothing: antialiased; }
.button:hover, header.announcement div section.course section a:hover, section.index-content section.course a:hover, section.index-content section.staff a:hover, section.index-content section.about-course section.cta a.enroll:hover {
background-color: #732626;
border-color: #4d1919; }
.button span, header.announcement div section.course section a span, section.index-content section.course a span, section.index-content section.staff a span, section.index-content section.about-course section.cta a.enroll span {
font-family: Garamond, Baskerville, "Baskerville Old Face", "Hoefler Text", "Times New Roman", serif;
font-style: italic; }
.button:hover, header.announcement div section.course section a:hover, section.index-content section.course a:hover, section.index-content section.staff a:hover, section.index-content section.about-course section.cta a.enroll:hover {
background-color: #732626;
border-color: #4d1919; }
.button span, header.announcement div section.course section a span, section.index-content section.course a span, section.index-content section.staff a span, section.index-content section.about-course section.cta a.enroll span {
font-family: Garamond, Baskerville, "Baskerville Old Face", "Hoefler Text", "Times New Roman", serif;
font-style: italic; }
p.ie-warning {
display: block !important;
......@@ -231,37 +218,37 @@ body {
background-color: #fff;
color: #444;
font: 16px Georgia, serif; }
body :focus {
outline-color: #ccc; }
body h1 {
font: 800 24px "Open Sans", Helvetica, Arial, sans-serif; }
body li {
margin-bottom: 25.888px; }
body em {
font-style: italic; }
body a {
color: #993333;
font-style: italic;
text-decoration: none; }
body a:hover, body a:focus {
color: #732626; }
body input[type="email"], body input[type="number"], body input[type="password"], body input[type="search"], body input[type="tel"], body input[type="text"], body input[type="url"], body input[type="color"], body input[type="date"], body input[type="datetime"], body input[type="datetime-local"], body input[type="month"], body input[type="time"], body input[type="week"], body textarea {
-webkit-box-shadow: 0 -1px 0 white;
-moz-box-shadow: 0 -1px 0 white;
box-shadow: 0 -1px 0 white;
background-color: #eeeeee;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #eeeeee), color-stop(100%, white));
background-image: -webkit-linear-gradient(top, #eeeeee, white);
background-image: -moz-linear-gradient(top, #eeeeee, white);
background-image: -ms-linear-gradient(top, #eeeeee, white);
background-image: -o-linear-gradient(top, #eeeeee, white);
background-image: linear-gradient(top, #eeeeee, white);
border: 1px solid #999;
font: 16px Georgia, serif;
padding: 4px;
width: 100%; }
body input[type="email"]:focus, body input[type="number"]:focus, body input[type="password"]:focus, body input[type="search"]:focus, body input[type="tel"]:focus, body input[type="text"]:focus, body input[type="url"]:focus, body input[type="color"]:focus, body input[type="date"]:focus, body input[type="datetime"]:focus, body input[type="datetime-local"]:focus, body input[type="month"]:focus, body input[type="time"]:focus, body input[type="week"]:focus, body textarea:focus {
border-color: #993333; }
body :focus {
outline-color: #ccc; }
body h1 {
font: 800 24px "Open Sans", Helvetica, Arial, sans-serif; }
body li {
margin-bottom: 25.888px; }
body em {
font-style: italic; }
body a {
color: #993333;
font-style: italic;
text-decoration: none; }
body a:hover, body a:focus {
color: #732626; }
body input[type="email"], body input[type="number"], body input[type="password"], body input[type="search"], body input[type="tel"], body input[type="text"], body input[type="url"], body input[type="color"], body input[type="date"], body input[type="datetime"], body input[type="datetime-local"], body input[type="month"], body input[type="time"], body input[type="week"], body textarea {
-webkit-box-shadow: 0 -1px 0 white;
-moz-box-shadow: 0 -1px 0 white;
box-shadow: 0 -1px 0 white;
background-color: #eeeeee;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #eeeeee), color-stop(100%, white));
background-image: -webkit-linear-gradient(top, #eeeeee, white);
background-image: -moz-linear-gradient(top, #eeeeee, white);
background-image: -ms-linear-gradient(top, #eeeeee, white);
background-image: -o-linear-gradient(top, #eeeeee, white);
background-image: linear-gradient(top, #eeeeee, white);
border: 1px solid #999;
font: 16px Georgia, serif;
padding: 4px;
width: 100%; }
body input[type="email"]:focus, body input[type="number"]:focus, body input[type="password"]:focus, body input[type="search"]:focus, body input[type="tel"]:focus, body input[type="text"]:focus, body input[type="url"]:focus, body input[type="color"]:focus, body input[type="date"]:focus, body input[type="datetime"]:focus, body input[type="datetime-local"]:focus, body input[type="month"]:focus, body input[type="time"]:focus, body input[type="week"]:focus, body textarea:focus {
border-color: #993333; }
header.announcement {
-webkit-background-size: cover;
......@@ -273,479 +260,479 @@ header.announcement {
border-bottom: 1px solid #000;
color: #fff;
-webkit-font-smoothing: antialiased; }
header.announcement.home {
background: #e3e3e3 url("/static/images/marketing/shot-5-medium.jpg"); }
@media screen and (min-width: 1200px) {
header.announcement.home {
background: #e3e3e3 url("/static/images/marketing/shot-5-medium.jpg"); }
@media screen and (min-width: 1200px) {
header.announcement.home {
background: #e3e3e3 url("/static/images/marketing/shot-5-large.jpg"); } }
header.announcement.home div {
padding: 258.88px 25.888px 77.664px; }
@media screen and (max-width:780px) {
header.announcement.home div {
padding: 64.72px 25.888px 51.776px; } }
header.announcement.home div nav h1 {
margin-right: 0; }
header.announcement.home div nav a.login {
display: none; }
background: #e3e3e3 url("/static/images/marketing/shot-5-large.jpg"); } }
header.announcement.home div {
padding: 258.88px 25.888px 77.664px; }
@media screen and (max-width:780px) {
header.announcement.home div {
padding: 64.72px 25.888px 51.776px; } }
header.announcement.home div nav h1 {
margin-right: 0; }
header.announcement.home div nav a.login {
display: none; }
header.announcement.course {
background: #e3e3e3 url("/static/images/marketing/course-bg-small.jpg"); }
@media screen and (min-width: 1200px) {
header.announcement.course {
background: #e3e3e3 url("/static/images/marketing/course-bg-small.jpg"); }
@media screen and (min-width: 1200px) {
header.announcement.course {
background: #e3e3e3 url("/static/images/marketing/course-bg-large.jpg"); } }
@media screen and (max-width: 1199px) and (min-width: 700px) {
header.announcement.course {
background: #e3e3e3 url("/static/images/marketing/course-bg-medium.jpg"); } }
header.announcement.course div {
padding: 103.552px 25.888px 51.776px; }
@media screen and (max-width:780px) {
header.announcement.course div {
padding: 64.72px 25.888px 51.776px; } }
header.announcement div {
position: relative; }
header.announcement div nav {
position: absolute;
top: 0;
right: 25.888px;
-webkit-border-radius: 0 0 3px 3px;
-moz-border-radius: 0 0 3px 3px;
-ms-border-radius: 0 0 3px 3px;
-o-border-radius: 0 0 3px 3px;
border-radius: 0 0 3px 3px;
background: #333;
background: rgba(0, 0, 0, 0.7);
padding: 12.944px 25.888px; }
header.announcement div nav h1 {
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: baseline;
zoom: 1;
*display: inline;
*vertical-align: auto;
margin-right: 12.944px; }
header.announcement div nav h1 a {
font: italic 800 18px "Open Sans", Helvetica, Arial, sans-serif;
color: #fff;
text-decoration: none; }
header.announcement div nav h1 a:hover, header.announcement div nav h1 a:focus {
color: #999; }
header.announcement div nav a.login {
text-decoration: none;
color: #fff;
font-size: 12px;
font-style: normal;
font-family: "Open Sans", Helvetica, Arial, sans-serif; }
header.announcement div nav a.login:hover, header.announcement div nav a.login:focus {
color: #999; }
header.announcement div section {
background: #993333;
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: baseline;
zoom: 1;
*display: inline;
*vertical-align: auto;
margin-left: 34.171%;
padding: 25.888px 38.832px; }
@media screen and (max-width: 780px) {
header.announcement div section {
margin-left: 0; } }
header.announcement div section h1 {
font-family: "Open Sans";
font-size: 30px;
font-weight: 800;
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: baseline;
zoom: 1;
*display: inline;
*vertical-align: auto;
line-height: 1.2em;
margin: 0 25.888px 0 0; }
header.announcement div section h2 {
font-family: "Open Sans";
font-size: 24px;
font-weight: 400;
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: baseline;
zoom: 1;
*display: inline;
*vertical-align: auto;
line-height: 1.2em; }
header.announcement div section.course section {
float: left;
margin-left: 0;
margin-right: 3.817%;
padding: 0;
width: 48.092%; }
@media screen and (max-width: 780px) {
header.announcement div section.course section {
float: none;
width: 100%;
margin-right: 0; } }
header.announcement div section.course section a {
background-color: #4d1919;
border-color: #260d0d;
-webkit-box-shadow: inset 0 1px 0 #732626, 0 1px 0 #ac3939;
-moz-box-shadow: inset 0 1px 0 #732626, 0 1px 0 #ac3939;
box-shadow: inset 0 1px 0 #732626, 0 1px 0 #ac3939;
display: block;
padding: 12.944px 25.888px;
text-align: center; }
header.announcement div section.course section a:hover {
background-color: #732626;
border-color: #4d1919; }
header.announcement div section.course p {
width: 48.092%;
line-height: 25.888px;
float: left; }
@media screen and (max-width: 780px) {
header.announcement div section.course p {
float: none;
width: 100%; } }
background: #e3e3e3 url("/static/images/marketing/course-bg-large.jpg"); } }
@media screen and (max-width: 1199px) and (min-width: 700px) {
header.announcement.course {
background: #e3e3e3 url("/static/images/marketing/course-bg-medium.jpg"); } }
header.announcement.course div {
padding: 103.552px 25.888px 51.776px; }
@media screen and (max-width:780px) {
header.announcement.course div {
padding: 64.72px 25.888px 51.776px; } }
header.announcement div {
position: relative; }
header.announcement div nav {
position: absolute;
top: 0;
right: 25.888px;
-webkit-border-radius: 0 0 3px 3px;
-moz-border-radius: 0 0 3px 3px;
-ms-border-radius: 0 0 3px 3px;
-o-border-radius: 0 0 3px 3px;
border-radius: 0 0 3px 3px;
background: #333;
background: rgba(0, 0, 0, 0.7);
padding: 12.944px 25.888px; }
header.announcement div nav h1 {
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: baseline;
zoom: 1;
*display: inline;
*vertical-align: auto;
margin-right: 12.944px; }
header.announcement div nav h1 a {
font: italic 800 18px "Open Sans", Helvetica, Arial, sans-serif;
color: #fff;
text-decoration: none; }
header.announcement div nav h1 a:hover, header.announcement div nav h1 a:focus {
color: #999; }
header.announcement div nav a.login {
text-decoration: none;
color: #fff;
font-size: 12px;
font-style: normal;
font-family: "Open Sans", Helvetica, Arial, sans-serif; }
header.announcement div nav a.login:hover, header.announcement div nav a.login:focus {
color: #999; }
header.announcement div section {
background: #993333;
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: baseline;
zoom: 1;
*display: inline;
*vertical-align: auto;
margin-left: 34.171%;
padding: 25.888px 38.832px; }
@media screen and (max-width: 780px) {
header.announcement div section {
margin-left: 0; } }
header.announcement div section h1 {
font-family: "Open Sans";
font-size: 30px;
font-weight: 800;
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: baseline;
zoom: 1;
*display: inline;
*vertical-align: auto;
line-height: 1.2em;
margin: 0 25.888px 0 0; }
header.announcement div section h2 {
font-family: "Open Sans";
font-size: 24px;
font-weight: 400;
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: baseline;
zoom: 1;
*display: inline;
*vertical-align: auto;
line-height: 1.2em; }
header.announcement div section.course section {
float: left;
margin-left: 0;
margin-right: 3.817%;
padding: 0;
width: 48.092%; }
@media screen and (max-width: 780px) {
header.announcement div section.course section {
float: none;
width: 100%;
margin-right: 0; } }
header.announcement div section.course section a {
background-color: #4d1919;
border-color: #260d0d;
-webkit-box-shadow: inset 0 1px 0 #732626, 0 1px 0 #ac3939;
-moz-box-shadow: inset 0 1px 0 #732626, 0 1px 0 #ac3939;
box-shadow: inset 0 1px 0 #732626, 0 1px 0 #ac3939;
display: block;
padding: 12.944px 25.888px;
text-align: center; }
header.announcement div section.course section a:hover {
background-color: #732626;
border-color: #4d1919; }
header.announcement div section.course p {
width: 48.092%;
line-height: 25.888px;
float: left; }
@media screen and (max-width: 780px) {
header.announcement div section.course p {
float: none;
width: 100%; } }
footer {
padding-top: 0; }
footer div.footer-wrapper {
border-top: 1px solid #e5e5e5;
padding: 25.888px 0;
background: url("/static/images/marketing/mit-logo.png") right center no-repeat; }
@media screen and (max-width: 780px) {
footer div.footer-wrapper {
border-top: 1px solid #e5e5e5;
padding: 25.888px 0;
background: url("/static/images/marketing/mit-logo.png") right center no-repeat; }
@media screen and (max-width: 780px) {
footer div.footer-wrapper {
background-position: left bottom;
padding-bottom: 77.664px; } }
footer div.footer-wrapper a {
color: #888;
text-decoration: none;
-webkit-transition-property: all;
-moz-transition-property: all;
-ms-transition-property: all;
-o-transition-property: all;
transition-property: all;
-webkit-transition-duration: 0.15s;
-moz-transition-duration: 0.15s;
-ms-transition-duration: 0.15s;
-o-transition-duration: 0.15s;
transition-duration: 0.15s;
-webkit-transition-timing-function: ease-out;
-moz-transition-timing-function: ease-out;
-ms-transition-timing-function: ease-out;
-o-transition-timing-function: ease-out;
transition-timing-function: ease-out;
-webkit-transition-delay: 0;
-moz-transition-delay: 0;
-ms-transition-delay: 0;
-o-transition-delay: 0;
transition-delay: 0; }
footer div.footer-wrapper a:hover, footer div.footer-wrapper a:focus {
color: #666; }
footer div.footer-wrapper p {
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: baseline;
zoom: 1;
*display: inline;
*vertical-align: auto;
margin-right: 25.888px; }
footer div.footer-wrapper ul {
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: baseline;
zoom: 1;
*display: inline;
*vertical-align: auto; }
@media screen and (max-width: 780px) {
footer div.footer-wrapper ul {
margin-top: 25.888px; } }
footer div.footer-wrapper ul li {
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: baseline;
zoom: 1;
*display: inline;
*vertical-align: auto;
margin-bottom: 0; }
footer div.footer-wrapper ul li:after {
content: ' |';
display: inline;
color: #ccc; }
footer div.footer-wrapper ul li:last-child:after {
content: none; }
footer div.footer-wrapper ul.social {
float: right;
margin-right: 60px;
position: relative;
top: -5px; }
@media screen and (max-width: 780px) {
footer div.footer-wrapper ul.social {
float: none; } }
footer div.footer-wrapper ul.social li {
float: left;
margin-right: 12.944px; }
footer div.footer-wrapper ul.social li:after {
content: none;
display: none; }
footer div.footer-wrapper ul.social li a {
display: block;
height: 29px;
width: 28px;
text-indent: -9999px; }
footer div.footer-wrapper ul.social li a:hover {
opacity: .8; }
footer div.footer-wrapper ul.social li.twitter a {
background: url("/static/images/marketing/twitter.png") 0 0 no-repeat; }
footer div.footer-wrapper ul.social li.facebook a {
background: url("/static/images/marketing/facebook.png") 0 0 no-repeat; }
footer div.footer-wrapper ul.social li.linkedin a {
background: url("/static/images/marketing/linkedin.png") 0 0 no-repeat; }
background-position: left bottom;
padding-bottom: 77.664px; } }
footer div.footer-wrapper a {
color: #888;
text-decoration: none;
-webkit-transition-property: all;
-moz-transition-property: all;
-ms-transition-property: all;
-o-transition-property: all;
transition-property: all;
-webkit-transition-duration: 0.15s;
-moz-transition-duration: 0.15s;
-ms-transition-duration: 0.15s;
-o-transition-duration: 0.15s;
transition-duration: 0.15s;
-webkit-transition-timing-function: ease-out;
-moz-transition-timing-function: ease-out;
-ms-transition-timing-function: ease-out;
-o-transition-timing-function: ease-out;
transition-timing-function: ease-out;
-webkit-transition-delay: 0;
-moz-transition-delay: 0;
-ms-transition-delay: 0;
-o-transition-delay: 0;
transition-delay: 0; }
footer div.footer-wrapper a:hover, footer div.footer-wrapper a:focus {
color: #666; }
footer div.footer-wrapper p {
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: baseline;
zoom: 1;
*display: inline;
*vertical-align: auto;
margin-right: 25.888px; }
footer div.footer-wrapper ul {
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: baseline;
zoom: 1;
*display: inline;
*vertical-align: auto; }
@media screen and (max-width: 780px) {
footer div.footer-wrapper ul {
margin-top: 25.888px; } }
footer div.footer-wrapper ul li {
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: baseline;
zoom: 1;
*display: inline;
*vertical-align: auto;
margin-bottom: 0; }
footer div.footer-wrapper ul li:after {
content: ' |';
display: inline;
color: #ccc; }
footer div.footer-wrapper ul li:last-child:after {
content: none; }
footer div.footer-wrapper ul.social {
float: right;
margin-right: 60px;
position: relative;
top: -5px; }
@media screen and (max-width: 780px) {
footer div.footer-wrapper ul.social {
float: none; } }
footer div.footer-wrapper ul.social li {
float: left;
margin-right: 12.944px; }
footer div.footer-wrapper ul.social li:after {
content: none;
display: none; }
footer div.footer-wrapper ul.social li a {
display: block;
height: 29px;
width: 28px;
text-indent: -9999px; }
footer div.footer-wrapper ul.social li a:hover {
opacity: .8; }
footer div.footer-wrapper ul.social li.twitter a {
background: url("/static/images/marketing/twitter.png") 0 0 no-repeat; }
footer div.footer-wrapper ul.social li.facebook a {
background: url("/static/images/marketing/facebook.png") 0 0 no-repeat; }
footer div.footer-wrapper ul.social li.linkedin a {
background: url("/static/images/marketing/linkedin.png") 0 0 no-repeat; }
section.index-content section {
float: left; }
@media screen and (max-width: 780px) {
section.index-content section {
float: none;
width: auto;
margin-right: 0; } }
section.index-content section h1 {
font-size: 800 24px "Open Sans";
margin-bottom: 25.888px; }
section.index-content section p {
line-height: 25.888px;
margin-bottom: 25.888px; }
section.index-content section ul {
margin: 0; }
@media screen and (max-width: 780px) {
section.index-content section {
float: none;
width: auto;
margin-right: 0; } }
section.index-content section h1 {
font-size: 800 24px "Open Sans";
margin-bottom: 25.888px; }
section.index-content section p {
line-height: 25.888px;
margin-bottom: 25.888px; }
section.index-content section ul {
margin: 0; }
section.index-content section.about {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border-right: 1px solid #e5e5e5;
margin-right: 2.513%;
padding-right: 1.256%;
width: 65.829%; }
@media screen and (max-width: 780px) {
section.index-content section.about {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border-right: 1px solid #e5e5e5;
margin-right: 2.513%;
padding-right: 1.256%;
width: 65.829%; }
@media screen and (max-width: 780px) {
section.index-content section.about {
width: 100%;
border-right: 0;
margin-right: 0;
padding-right: 0; } }
section.index-content section.about section {
margin-bottom: 25.888px; }
section.index-content section.about section p {
width: 48.092%;
float: left; }
@media screen and (max-width: 780px) {
section.index-content section.about section p {
float: none;
width: auto; } }
section.index-content section.about section p:nth-child(odd) {
margin-right: 3.817%; }
@media screen and (max-width: 780px) {
section.index-content section.about section p:nth-child(odd) {
margin-right: 0; } }
section.index-content section.about section.intro section {
margin-bottom: 0; }
section.index-content section.about section.intro section.intro-text {
margin-right: 3.817%;
width: 48.092%; }
@media screen and (max-width: 780px) {
section.index-content section.about section.intro section.intro-text {
margin-right: 0;
width: auto; } }
section.index-content section.about section.intro section.intro-text p {
margin-right: 0;
width: auto;
float: none; }
section.index-content section.about section.intro section.intro-video {
width: 48.092%; }
@media screen and (max-width: 780px) {
section.index-content section.about section.intro section.intro-video {
width: auto; } }
section.index-content section.about section.intro section.intro-video a {
display: block;
width: 100%; }
section.index-content section.about section.intro section.intro-video a img {
width: 100%; }
section.index-content section.about section.intro section.intro-video a span {
display: none; }
section.index-content section.about section.features {
border-top: 1px solid #E5E5E5;
padding-top: 25.888px;
margin-bottom: 0; }
section.index-content section.about section.features h2 {
text-transform: uppercase;
letter-spacing: 1px;
color: #888;
margin-bottom: 25.888px;
font-weight: normal;
font-size: 14px; }
section.index-content section.about section.features h2 span {
text-transform: none; }
section.index-content section.about section.features p {
width: auto;
clear: both; }
section.index-content section.about section.features p strong {
font-family: "Open sans";
font-weight: 800; }
section.index-content section.about section.features p a {
color: #993333;
text-decoration: none;
-webkit-transition-property: all;
-moz-transition-property: all;
-ms-transition-property: all;
-o-transition-property: all;
transition-property: all;
-webkit-transition-duration: 0.15s;
-moz-transition-duration: 0.15s;
-ms-transition-duration: 0.15s;
-o-transition-duration: 0.15s;
transition-duration: 0.15s;
-webkit-transition-timing-function: ease-out;
-moz-transition-timing-function: ease-out;
-ms-transition-timing-function: ease-out;
-o-transition-timing-function: ease-out;
transition-timing-function: ease-out;
-webkit-transition-delay: 0;
-moz-transition-delay: 0;
-ms-transition-delay: 0;
-o-transition-delay: 0;
transition-delay: 0; }
section.index-content section.about section.features p a:hover, section.index-content section.about section.features p a:focus {
color: #602020; }
section.index-content section.about section.features ul {
margin-bottom: 0; }
section.index-content section.about section.features ul li {
line-height: 25.888px;
width: 48.092%;
float: left;
margin-bottom: 12.944px; }
@media screen and (max-width: 780px) {
section.index-content section.about section.features ul li {
width: auto;
float: none; } }
section.index-content section.about section.features ul li:nth-child(odd) {
margin-right: 3.817%; }
@media screen and (max-width: 780px) {
section.index-content section.about section.features ul li:nth-child(odd) {
margin-right: 0; } }
width: 100%;
border-right: 0;
margin-right: 0;
padding-right: 0; } }
section.index-content section.about section {
margin-bottom: 25.888px; }
section.index-content section.about section p {
width: 48.092%;
float: left; }
@media screen and (max-width: 780px) {
section.index-content section.about section p {
float: none;
width: auto; } }
section.index-content section.about section p:nth-child(odd) {
margin-right: 3.817%; }
@media screen and (max-width: 780px) {
section.index-content section.about section p:nth-child(odd) {
margin-right: 0; } }
section.index-content section.about section.intro section {
margin-bottom: 0; }
section.index-content section.about section.intro section.intro-text {
margin-right: 3.817%;
width: 48.092%; }
@media screen and (max-width: 780px) {
section.index-content section.about section.intro section.intro-text {
margin-right: 0;
width: auto; } }
section.index-content section.about section.intro section.intro-text p {
margin-right: 0;
width: auto;
float: none; }
section.index-content section.about section.intro section.intro-video {
width: 48.092%; }
@media screen and (max-width: 780px) {
section.index-content section.about section.intro section.intro-video {
width: auto; } }
section.index-content section.about section.intro section.intro-video a {
display: block;
width: 100%; }
section.index-content section.about section.intro section.intro-video a img {
width: 100%; }
section.index-content section.about section.intro section.intro-video a span {
display: none; }
section.index-content section.about section.features {
border-top: 1px solid #E5E5E5;
padding-top: 25.888px;
margin-bottom: 0; }
section.index-content section.about section.features h2 {
text-transform: uppercase;
letter-spacing: 1px;
color: #888;
margin-bottom: 25.888px;
font-weight: normal;
font-size: 14px; }
section.index-content section.about section.features h2 span {
text-transform: none; }
section.index-content section.about section.features p {
width: auto;
clear: both; }
section.index-content section.about section.features p strong {
font-family: "Open sans";
font-weight: 800; }
section.index-content section.about section.features p a {
color: #993333;
text-decoration: none;
-webkit-transition-property: all;
-moz-transition-property: all;
-ms-transition-property: all;
-o-transition-property: all;
transition-property: all;
-webkit-transition-duration: 0.15s;
-moz-transition-duration: 0.15s;
-ms-transition-duration: 0.15s;
-o-transition-duration: 0.15s;
transition-duration: 0.15s;
-webkit-transition-timing-function: ease-out;
-moz-transition-timing-function: ease-out;
-ms-transition-timing-function: ease-out;
-o-transition-timing-function: ease-out;
transition-timing-function: ease-out;
-webkit-transition-delay: 0;
-moz-transition-delay: 0;
-ms-transition-delay: 0;
-o-transition-delay: 0;
transition-delay: 0; }
section.index-content section.about section.features p a:hover, section.index-content section.about section.features p a:focus {
color: #602020; }
section.index-content section.about section.features ul {
margin-bottom: 0; }
section.index-content section.about section.features ul li {
line-height: 25.888px;
width: 48.092%;
float: left;
margin-bottom: 12.944px; }
@media screen and (max-width: 780px) {
section.index-content section.about section.features ul li {
width: auto;
float: none; } }
section.index-content section.about section.features ul li:nth-child(odd) {
margin-right: 3.817%; }
@media screen and (max-width: 780px) {
section.index-content section.about section.features ul li:nth-child(odd) {
margin-right: 0; } }
section.index-content section.course, section.index-content section.staff {
width: 31.658%; }
@media screen and (max-width: 780px) {
section.index-content section.course, section.index-content section.staff {
width: 31.658%; }
@media screen and (max-width: 780px) {
section.index-content section.course, section.index-content section.staff {
width: auto; } }
section.index-content section.course h1, section.index-content section.staff h1 {
color: #888;
font: normal 16px Georgia, serif;
font-size: 14px;
letter-spacing: 1px;
margin-bottom: 25.888px;
text-transform: uppercase; }
section.index-content section.course h2, section.index-content section.staff h2 {
font: 800 24px "Open Sans", Helvetica, Arial, sans-serif; }
section.index-content section.course h3, section.index-content section.staff h3 {
font: 400 18px "Open Sans", Helvetica, Arial, sans-serif; }
section.index-content section.course a span.arrow, section.index-content section.staff a span.arrow {
color: rgba(255, 255, 255, 0.6);
font-style: normal;
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: baseline;
zoom: 1;
*display: inline;
*vertical-align: auto;
padding-left: 10px; }
section.index-content section.course ul, section.index-content section.staff ul {
list-style: none; }
section.index-content section.course ul li img, section.index-content section.staff ul li img {
float: left;
margin-right: 12.944px; }
width: auto; } }
section.index-content section.course h1, section.index-content section.staff h1 {
color: #888;
font: normal 16px Georgia, serif;
font-size: 14px;
letter-spacing: 1px;
margin-bottom: 25.888px;
text-transform: uppercase; }
section.index-content section.course h2, section.index-content section.staff h2 {
font: 800 24px "Open Sans", Helvetica, Arial, sans-serif; }
section.index-content section.course h3, section.index-content section.staff h3 {
font: 400 18px "Open Sans", Helvetica, Arial, sans-serif; }
section.index-content section.course a span.arrow, section.index-content section.staff a span.arrow {
color: rgba(255, 255, 255, 0.6);
font-style: normal;
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: baseline;
zoom: 1;
*display: inline;
*vertical-align: auto;
padding-left: 10px; }
section.index-content section.course ul, section.index-content section.staff ul {
list-style: none; }
section.index-content section.course ul li img, section.index-content section.staff ul li img {
float: left;
margin-right: 12.944px; }
section.index-content section.course h2 {
padding-top: 129.44px;
background: url("/static/images/marketing/circuits-bg.jpg") 0 0 no-repeat;
-webkit-background-size: contain;
-moz-background-size: contain;
-ms-background-size: contain;
-o-background-size: contain;
background-size: contain; }
@media screen and (max-width: 998px) and (min-width: 781px) {
section.index-content section.course h2 {
background: url("/static/images/marketing/circuits-medium-bg.jpg") 0 0 no-repeat; } }
@media screen and (max-width: 780px) {
section.index-content section.course h2 {
padding-top: 129.44px;
background: url("/static/images/marketing/circuits-bg.jpg") 0 0 no-repeat;
-webkit-background-size: contain;
-moz-background-size: contain;
-ms-background-size: contain;
-o-background-size: contain;
background-size: contain; }
@media screen and (max-width: 998px) and (min-width: 781px) {
section.index-content section.course h2 {
background: url("/static/images/marketing/circuits-medium-bg.jpg") 0 0 no-repeat; } }
@media screen and (max-width: 780px) {
section.index-content section.course h2 {
padding-top: 129.44px;
background: url("/static/images/marketing/circuits-bg.jpg") 0 0 no-repeat; } }
@media screen and (min-width: 500px) and (max-width: 781px) {
section.index-content section.course h2 {
padding-top: 207.104px; } }
section.index-content section.course div.announcement p.announcement-button a {
margin-top: 0; }
section.index-content section.course div.announcement img {
max-width: 100%;
margin-bottom: 25.888px; }
background: url("/static/images/marketing/circuits-bg.jpg") 0 0 no-repeat; } }
@media screen and (min-width: 500px) and (max-width: 781px) {
section.index-content section.course h2 {
padding-top: 207.104px; } }
section.index-content section.course div.announcement p.announcement-button a {
margin-top: 0; }
section.index-content section.course div.announcement img {
max-width: 100%;
margin-bottom: 25.888px; }
section.index-content section.about-course {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border-right: 1px solid #e5e5e5;
margin-right: 2.513%;
padding-right: 1.256%;
width: 65.829%; }
@media screen and (max-width: 780px) {
section.index-content section.about-course {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border-right: 1px solid #e5e5e5;
margin-right: 2.513%;
padding-right: 1.256%;
width: 65.829%; }
@media screen and (max-width: 780px) {
section.index-content section.about-course {
width: auto;
border-right: 0;
margin-right: 0;
padding-right: 0; } }
section.index-content section.about-course section {
width: 48.092%; }
@media screen and (max-width: 780px) {
section.index-content section.about-course section {
width: auto; } }
section.index-content section.about-course section.about-info {
margin-right: 3.817%; }
@media screen and (max-width: 780px) {
section.index-content section.about-course section.about-info {
margin-right: 0; } }
section.index-content section.about-course section.requirements {
clear: both;
width: 100%;
border-top: 1px solid #E5E5E5;
padding-top: 25.888px;
margin-bottom: 0; }
section.index-content section.about-course section.requirements p {
float: left;
width: 48.092%;
margin-right: 3.817%; }
@media screen and (max-width: 780px) {
section.index-content section.about-course section.requirements p {
margin-right: 0;
float: none;
width: auto; } }
section.index-content section.about-course section.requirements p:nth-child(odd) {
margin-right: 0; }
section.index-content section.about-course section.cta {
width: 100%;
text-align: center; }
section.index-content section.about-course section.cta a.enroll {
padding: 12.944px 51.776px;
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: baseline;
zoom: 1;
*display: inline;
*vertical-align: auto;
text-align: center;
font: 800 18px "Open Sans", Helvetica, Arial, sans-serif; }
section.index-content section.staff h1 {
margin-top: 25.888px; }
width: auto;
border-right: 0;
margin-right: 0;
padding-right: 0; } }
section.index-content section.about-course section {
width: 48.092%; }
@media screen and (max-width: 780px) {
section.index-content section.about-course section {
width: auto; } }
section.index-content section.about-course section.about-info {
margin-right: 3.817%; }
@media screen and (max-width: 780px) {
section.index-content section.about-course section.about-info {
margin-right: 0; } }
section.index-content section.about-course section.requirements {
clear: both;
width: 100%;
border-top: 1px solid #E5E5E5;
padding-top: 25.888px;
margin-bottom: 0; }
section.index-content section.about-course section.requirements p {
float: left;
width: 48.092%;
margin-right: 3.817%; }
@media screen and (max-width: 780px) {
section.index-content section.about-course section.requirements p {
margin-right: 0;
float: none;
width: auto; } }
section.index-content section.about-course section.requirements p:nth-child(odd) {
margin-right: 0; }
section.index-content section.about-course section.cta {
width: 100%;
text-align: center; }
section.index-content section.about-course section.cta a.enroll {
padding: 12.944px 51.776px;
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: baseline;
zoom: 1;
*display: inline;
*vertical-align: auto;
text-align: center;
font: 800 18px "Open Sans", Helvetica, Arial, sans-serif; }
section.index-content section.staff h1 {
margin-top: 25.888px; }
#lean_overlay {
position: fixed;
......@@ -774,244 +761,207 @@ div.leanModal_box {
display: none;
padding: 51.776px;
text-align: left; }
div.leanModal_box a.modal_close {
color: #aaa;
display: block;
font-style: normal;
height: 14px;
position: absolute;
right: 12px;
top: 12px;
width: 14px;
z-index: 2; }
div.leanModal_box a.modal_close:hover {
text-decoration: none;
color: #993333; }
div.leanModal_box h1 {
border-bottom: 1px solid #eee;
font-size: 24px;
margin-bottom: 25.888px;
margin-top: 0;
padding-bottom: 25.888px;
text-align: left; }
div.leanModal_box#enroll {
max-width: 600px; }
div.leanModal_box#enroll ol {
padding-top: 25.888px; }
div.leanModal_box#enroll ol li.terms, div.leanModal_box#enroll ol li.honor-code {
width: auto;
float: none; }
div.leanModal_box#enroll ol li div.tip {
display: none; }
div.leanModal_box#enroll ol li:hover div.tip {
background: #333;
color: #fff;
display: block;
font-size: 16px;
line-height: 25.888px;
margin: 0 0 0 -10px;
padding: 10px;
position: absolute;
-webkit-font-smoothing: antialiased;
width: 500px; }
div.leanModal_box form {
text-align: left; }
div.leanModal_box form div#enroll_error, div.leanModal_box form div#login_error, div.leanModal_box form div#pwd_error {
background-color: #333333;
border: black;
color: #fff;
font-family: "Open sans";
font-weight: bold;
letter-spacing: 1px;
margin: -25.888px -25.888px 25.888px;
padding: 12.944px;
text-shadow: 0 1px 0 #1a1a1a;
-webkit-font-smoothing: antialiased; }
div.leanModal_box form div#enroll_error:empty, div.leanModal_box form div#login_error:empty, div.leanModal_box form div#pwd_error:empty {
padding: 0; }
div.leanModal_box form ol {
list-style: none;
margin-bottom: 25.888px; }
div.leanModal_box form ol li {
margin-bottom: 12.944px; }
div.leanModal_box form ol li.terms, div.leanModal_box form ol li.remember {
border-top: 1px solid #eee;
clear: both;
float: none;
padding-top: 25.888px;
width: auto; }
div.leanModal_box form ol li.honor-code {
width: auto;
float: none; }
div.leanModal_box form ol li label {
display: block;
font-weight: bold; }
div.leanModal_box form ol li input[type="email"], div.leanModal_box form ol li input[type="number"], div.leanModal_box form ol li input[type="password"], div.leanModal_box form ol li input[type="search"], div.leanModal_box form ol li input[type="tel"], div.leanModal_box form ol li input[type="text"], div.leanModal_box form ol li input[type="url"], div.leanModal_box form ol li input[type="color"], div.leanModal_box form ol li input[type="date"], div.leanModal_box form ol li input[type="datetime"], div.leanModal_box form ol li input[type="datetime-local"], div.leanModal_box form ol li input[type="month"], div.leanModal_box form ol li input[type="time"], div.leanModal_box form ol li input[type="week"], div.leanModal_box form ol li textarea {
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box; }
div.leanModal_box form ol li input[type="checkbox"] {
margin-right: 10px; }
div.leanModal_box form ol li ul {
list-style: disc outside none;
margin: 12.944px 0 25.888px 25.888px; }
div.leanModal_box form ol li ul li {
color: #666;
float: none;
font-size: 14px;
list-style: disc outside none;
margin-bottom: 12.944px; }
div.leanModal_box form input[type="button"], div.leanModal_box form input[type="submit"] {
border: 1px solid #691b1b;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
-ms-border-radius: 3px;
-o-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: inset 0 1px 0 0 #bc5c5c;
-moz-box-shadow: inset 0 1px 0 0 #bc5c5c;
box-shadow: inset 0 1px 0 0 #bc5c5c;
color: white;
display: inline;
font-size: 11px;
font-weight: bold;
background-color: #993333;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #993333), color-stop(100%, #761e1e));
background-image: -webkit-linear-gradient(top, #993333, #761e1e);
background-image: -moz-linear-gradient(top, #993333, #761e1e);
background-image: -ms-linear-gradient(top, #993333, #761e1e);
background-image: -o-linear-gradient(top, #993333, #761e1e);
background-image: linear-gradient(top, #993333, #761e1e);
padding: 6px 18px 7px;
text-shadow: 0 1px 0 #5d1414;
-webkit-background-clip: padding-box;
font-size: 18px;
padding: 12.944px; }
div.leanModal_box form input[type="button"]:hover, div.leanModal_box form input[type="submit"]:hover {
-webkit-box-shadow: inset 0 1px 0 0 #a44141;
-moz-box-shadow: inset 0 1px 0 0 #a44141;
box-shadow: inset 0 1px 0 0 #a44141;
cursor: pointer;
background-color: #823030;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #823030), color-stop(100%, #691c1c));
background-image: -webkit-linear-gradient(top, #823030, #691c1c);
background-image: -moz-linear-gradient(top, #823030, #691c1c);
background-image: -ms-linear-gradient(top, #823030, #691c1c);
background-image: -o-linear-gradient(top, #823030, #691c1c);
background-image: linear-gradient(top, #823030, #691c1c); }
div.leanModal_box form input[type="button"]:active, div.leanModal_box form input[type="submit"]:active {
border: 1px solid #691b1b;
-webkit-box-shadow: inset 0 0 8px 4px #5c1919, inset 0 0 8px 4px #5c1919, 0 1px 1px 0 #eeeeee;
-moz-box-shadow: inset 0 0 8px 4px #5c1919, inset 0 0 8px 4px #5c1919, 0 1px 1px 0 #eeeeee;
box-shadow: inset 0 0 8px 4px #5c1919, inset 0 0 8px 4px #5c1919, 0 1px 1px 0 #eeeeee; }
div.leanModal_box a.modal_close {
color: #aaa;
display: block;
font-style: normal;
height: 14px;
position: absolute;
right: 12px;
top: 12px;
width: 14px;
z-index: 2; }
div.leanModal_box a.modal_close:hover {
text-decoration: none;
color: #993333; }
div.leanModal_box h1 {
border-bottom: 1px solid #eee;
font-size: 24px;
margin-bottom: 25.888px;
margin-top: 0;
padding-bottom: 25.888px;
text-align: left; }
div.leanModal_box#enroll {
max-width: 600px; }
div.leanModal_box#enroll ol {
padding-top: 25.888px; }
div.leanModal_box#enroll ol li.terms, div.leanModal_box#enroll ol li.honor-code {
width: auto;
float: none; }
div.leanModal_box#enroll ol li div.tip {
display: none; }
div.leanModal_box#enroll ol li:hover div.tip {
background: #333;
color: #fff;
display: block;
font-size: 16px;
line-height: 25.888px;
margin: 0 0 0 -10px;
padding: 10px;
position: absolute;
-webkit-font-smoothing: antialiased;
width: 500px; }
div.leanModal_box form {
text-align: left; }
div.leanModal_box form div#enroll_error, div.leanModal_box form div#login_error, div.leanModal_box form div#pwd_error {
background-color: #333333;
border: black;
color: #fff;
font-family: "Open sans";
font-weight: bold;
letter-spacing: 1px;
margin: -25.888px -25.888px 25.888px;
padding: 12.944px;
text-shadow: 0 1px 0 #1a1a1a;
-webkit-font-smoothing: antialiased; }
div.leanModal_box form div#enroll_error:empty, div.leanModal_box form div#login_error:empty, div.leanModal_box form div#pwd_error:empty {
padding: 0; }
div.leanModal_box form ol {
list-style: none;
margin-bottom: 25.888px; }
div.leanModal_box form ol li {
margin-bottom: 12.944px; }
div.leanModal_box form ol li.terms, div.leanModal_box form ol li.remember {
border-top: 1px solid #eee;
clear: both;
float: none;
padding-top: 25.888px;
width: auto; }
div.leanModal_box form ol li.honor-code {
width: auto;
float: none; }
div.leanModal_box form ol li label {
display: block;
font-weight: bold; }
div.leanModal_box form ol li input[type="email"], div.leanModal_box form ol li input[type="number"], div.leanModal_box form ol li input[type="password"], div.leanModal_box form ol li input[type="search"], div.leanModal_box form ol li input[type="tel"], div.leanModal_box form ol li input[type="text"], div.leanModal_box form ol li input[type="url"], div.leanModal_box form ol li input[type="color"], div.leanModal_box form ol li input[type="date"], div.leanModal_box form ol li input[type="datetime"], div.leanModal_box form ol li input[type="datetime-local"], div.leanModal_box form ol li input[type="month"], div.leanModal_box form ol li input[type="time"], div.leanModal_box form ol li input[type="week"], div.leanModal_box form ol li textarea {
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box; }
div.leanModal_box form ol li input[type="checkbox"] {
margin-right: 10px; }
div.leanModal_box form ol li ul {
list-style: disc outside none;
margin: 12.944px 0 25.888px 25.888px; }
div.leanModal_box form ol li ul li {
color: #666;
float: none;
font-size: 14px;
list-style: disc outside none;
margin-bottom: 12.944px; }
div.leanModal_box form input[type="button"], div.leanModal_box form input[type="submit"] {
border: 1px solid #691b1b;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
-ms-border-radius: 3px;
-o-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: inset 0 1px 0 0 #bc5c5c;
-moz-box-shadow: inset 0 1px 0 0 #bc5c5c;
box-shadow: inset 0 1px 0 0 #bc5c5c;
color: white;
display: inline;
font-size: 11px;
font-weight: bold;
background-color: #993333;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #993333), color-stop(100%, #761e1e));
background-image: -webkit-linear-gradient(top, #993333, #761e1e);
background-image: -moz-linear-gradient(top, #993333, #761e1e);
background-image: -ms-linear-gradient(top, #993333, #761e1e);
background-image: -o-linear-gradient(top, #993333, #761e1e);
background-image: linear-gradient(top, #993333, #761e1e);
padding: 6px 18px 7px;
text-shadow: 0 1px 0 #5d1414;
-webkit-background-clip: padding-box;
font-size: 18px;
padding: 12.944px; }
div.leanModal_box form input[type="button"]:hover, div.leanModal_box form input[type="submit"]:hover {
-webkit-box-shadow: inset 0 1px 0 0 #a44141;
-moz-box-shadow: inset 0 1px 0 0 #a44141;
box-shadow: inset 0 1px 0 0 #a44141;
cursor: pointer;
background-color: #823030;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #823030), color-stop(100%, #691c1c));
background-image: -webkit-linear-gradient(top, #823030, #691c1c);
background-image: -moz-linear-gradient(top, #823030, #691c1c);
background-image: -ms-linear-gradient(top, #823030, #691c1c);
background-image: -o-linear-gradient(top, #823030, #691c1c);
background-image: linear-gradient(top, #823030, #691c1c); }
div.leanModal_box form input[type="button"]:active, div.leanModal_box form input[type="submit"]:active {
border: 1px solid #691b1b;
-webkit-box-shadow: inset 0 0 8px 4px #5c1919, inset 0 0 8px 4px #5c1919, 0 1px 1px 0 #eeeeee;
-moz-box-shadow: inset 0 0 8px 4px #5c1919, inset 0 0 8px 4px #5c1919, 0 1px 1px 0 #eeeeee;
box-shadow: inset 0 0 8px 4px #5c1919, inset 0 0 8px 4px #5c1919, 0 1px 1px 0 #eeeeee; }
div#login {
min-width: 400px; }
div#login header {
border-bottom: 1px solid #ddd;
margin-bottom: 25.888px;
padding-bottom: 25.888px; }
div#login header h1 {
border-bottom: 0;
padding-bottom: 0;
margin-bottom: 6.472px; }
div#login ol li {
width: auto;
float: none; }
div#login header {
border-bottom: 1px solid #ddd;
margin-bottom: 25.888px;
padding-bottom: 25.888px; }
div#login header h1 {
border-bottom: 0;
padding-bottom: 0;
margin-bottom: 6.472px; }
div#login ol li {
width: auto;
float: none; }
div.lost-password {
text-align: left;
margin-top: 25.888px; }
div.lost-password a {
color: #999; }
div.lost-password a:hover {
color: #444; }
div.lost-password a {
color: #999; }
div.lost-password a:hover {
color: #444; }
div#pwd_reset p {
margin-bottom: 25.888px; }
div#pwd_reset input[type="email"] {
margin-bottom: 25.888px; }
div#apply_name_change,
div#change_email,
div#unenroll,
div#deactivate-account {
div#survey, div#cert_request, div#apply_name_change, div#change_email, div#unenroll, div#deactivate-account {
max-width: 700px; }
div#apply_name_change ul,
div#change_email ul,
div#unenroll ul,
div#deactivate-account ul {
list-style: none; }
div#apply_name_change ul li,
div#change_email ul li,
div#unenroll ul li,
div#deactivate-account ul li {
margin-bottom: 12.944px; }
div#apply_name_change ul li textarea, div#apply_name_change ul li input[type="email"], div#apply_name_change ul li input[type="number"], div#apply_name_change ul li input[type="password"], div#apply_name_change ul li input[type="search"], div#apply_name_change ul li input[type="tel"], div#apply_name_change ul li input[type="text"], div#apply_name_change ul li input[type="url"], div#apply_name_change ul li input[type="color"], div#apply_name_change ul li input[type="date"], div#apply_name_change ul li input[type="datetime"], div#apply_name_change ul li input[type="datetime-local"], div#apply_name_change ul li input[type="month"], div#apply_name_change ul li input[type="time"], div#apply_name_change ul li input[type="week"],
div#change_email ul li textarea,
div#change_email ul li input[type="email"],
div#change_email ul li input[type="number"],
div#change_email ul li input[type="password"],
div#change_email ul li input[type="search"],
div#change_email ul li input[type="tel"],
div#change_email ul li input[type="text"],
div#change_email ul li input[type="url"],
div#change_email ul li input[type="color"],
div#change_email ul li input[type="date"],
div#change_email ul li input[type="datetime"],
div#change_email ul li input[type="datetime-local"],
div#change_email ul li input[type="month"],
div#change_email ul li input[type="time"],
div#change_email ul li input[type="week"],
div#unenroll ul li textarea,
div#unenroll ul li input[type="email"],
div#unenroll ul li input[type="number"],
div#unenroll ul li input[type="password"],
div#unenroll ul li input[type="search"],
div#unenroll ul li input[type="tel"],
div#unenroll ul li input[type="text"],
div#unenroll ul li input[type="url"],
div#unenroll ul li input[type="color"],
div#unenroll ul li input[type="date"],
div#unenroll ul li input[type="datetime"],
div#unenroll ul li input[type="datetime-local"],
div#unenroll ul li input[type="month"],
div#unenroll ul li input[type="time"],
div#unenroll ul li input[type="week"],
div#deactivate-account ul li textarea,
div#deactivate-account ul li input[type="email"],
div#deactivate-account ul li input[type="number"],
div#deactivate-account ul li input[type="password"],
div#deactivate-account ul li input[type="search"],
div#deactivate-account ul li input[type="tel"],
div#deactivate-account ul li input[type="text"],
div#deactivate-account ul li input[type="url"],
div#deactivate-account ul li input[type="color"],
div#deactivate-account ul li input[type="date"],
div#deactivate-account ul li input[type="datetime"],
div#deactivate-account ul li input[type="datetime-local"],
div#deactivate-account ul li input[type="month"],
div#deactivate-account ul li input[type="time"],
div#deactivate-account ul li input[type="week"] {
display: block;
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box; }
div#apply_name_change ul li textarea,
div#change_email ul li textarea,
div#unenroll ul li textarea,
div#deactivate-account ul li textarea {
height: 60px; }
div#apply_name_change ul li input[type="submit"],
div#change_email ul li input[type="submit"],
div#unenroll ul li input[type="submit"],
div#deactivate-account ul li input[type="submit"] {
white-space: normal; }
div#survey ul, div#cert_request ul, div#apply_name_change ul, div#change_email ul, div#unenroll ul, div#deactivate-account ul {
list-style: none; }
div#survey ul li, div#cert_request ul li, div#apply_name_change ul li, div#change_email ul li, div#unenroll ul li, div#deactivate-account ul li {
margin-bottom: 12.944px; }
div#survey ul li textarea, div#survey ul li input[type="email"], div#survey ul li input[type="number"], div#survey ul li input[type="password"], div#survey ul li input[type="search"], div#survey ul li input[type="tel"], div#survey ul li input[type="text"], div#survey ul li input[type="url"], div#survey ul li input[type="color"], div#survey ul li input[type="date"], div#survey ul li input[type="datetime"], div#survey ul li input[type="datetime-local"], div#survey ul li input[type="month"], div#survey ul li input[type="time"], div#survey ul li input[type="week"], div#cert_request ul li textarea, div#cert_request ul li input[type="email"], div#cert_request ul li input[type="number"], div#cert_request ul li input[type="password"], div#cert_request ul li input[type="search"], div#cert_request ul li input[type="tel"], div#cert_request ul li input[type="text"], div#cert_request ul li input[type="url"], div#cert_request ul li input[type="color"], div#cert_request ul li input[type="date"], div#cert_request ul li input[type="datetime"], div#cert_request ul li input[type="datetime-local"], div#cert_request ul li input[type="month"], div#cert_request ul li input[type="time"], div#cert_request ul li input[type="week"], div#apply_name_change ul li textarea, div#apply_name_change ul li input[type="email"], div#apply_name_change ul li input[type="number"], div#apply_name_change ul li input[type="password"], div#apply_name_change ul li input[type="search"], div#apply_name_change ul li input[type="tel"], div#apply_name_change ul li input[type="text"], div#apply_name_change ul li input[type="url"], div#apply_name_change ul li input[type="color"], div#apply_name_change ul li input[type="date"], div#apply_name_change ul li input[type="datetime"], div#apply_name_change ul li input[type="datetime-local"], div#apply_name_change ul li input[type="month"], div#apply_name_change ul li input[type="time"], div#apply_name_change ul li input[type="week"], div#change_email ul li textarea, div#change_email ul li input[type="email"], div#change_email ul li input[type="number"], div#change_email ul li input[type="password"], div#change_email ul li input[type="search"], div#change_email ul li input[type="tel"], div#change_email ul li input[type="text"], div#change_email ul li input[type="url"], div#change_email ul li input[type="color"], div#change_email ul li input[type="date"], div#change_email ul li input[type="datetime"], div#change_email ul li input[type="datetime-local"], div#change_email ul li input[type="month"], div#change_email ul li input[type="time"], div#change_email ul li input[type="week"], div#unenroll ul li textarea, div#unenroll ul li input[type="email"], div#unenroll ul li input[type="number"], div#unenroll ul li input[type="password"], div#unenroll ul li input[type="search"], div#unenroll ul li input[type="tel"], div#unenroll ul li input[type="text"], div#unenroll ul li input[type="url"], div#unenroll ul li input[type="color"], div#unenroll ul li input[type="date"], div#unenroll ul li input[type="datetime"], div#unenroll ul li input[type="datetime-local"], div#unenroll ul li input[type="month"], div#unenroll ul li input[type="time"], div#unenroll ul li input[type="week"], div#deactivate-account ul li textarea, div#deactivate-account ul li input[type="email"], div#deactivate-account ul li input[type="number"], div#deactivate-account ul li input[type="password"], div#deactivate-account ul li input[type="search"], div#deactivate-account ul li input[type="tel"], div#deactivate-account ul li input[type="text"], div#deactivate-account ul li input[type="url"], div#deactivate-account ul li input[type="color"], div#deactivate-account ul li input[type="date"], div#deactivate-account ul li input[type="datetime"], div#deactivate-account ul li input[type="datetime-local"], div#deactivate-account ul li input[type="month"], div#deactivate-account ul li input[type="time"], div#deactivate-account ul li input[type="week"] {
display: block;
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box; }
div#survey ul li textarea, div#cert_request ul li textarea, div#apply_name_change ul li textarea, div#change_email ul li textarea, div#unenroll ul li textarea, div#deactivate-account ul li textarea {
height: 60px; }
div#survey ul li input[type="submit"], div#cert_request ul li input[type="submit"], div#apply_name_change ul li input[type="submit"], div#change_email ul li input[type="submit"], div#unenroll ul li input[type="submit"], div#deactivate-account ul li input[type="submit"] {
white-space: normal; }
div#feedback_div form ol li {
float: none;
width: 100%; }
div#feedback_div form ol li textarea#feedback_message {
height: 100px; }
div#feedback_div form ol li textarea#feedback_message {
height: 100px; }
div#cert_request fieldset#cert_request_fieldset label {
font-weight: bold;
margin-bottom: 6px;
display: block; }
div#cert_request fieldset#cert_request_fieldset li.verify {
zoom: 1; }
div#cert_request fieldset#cert_request_fieldset li.verify:before, div#cert_request fieldset#cert_request_fieldset li.verify:after {
content: "";
display: table; }
div#cert_request fieldset#cert_request_fieldset li.verify:after {
clear: both; }
div#cert_request fieldset#cert_request_fieldset li.verify input {
float: left; }
div#cert_request fieldset#cert_request_fieldset li.verify label {
margin-left: 25px; }
div#cert_request fieldset#survey_fieldset {
margin-top: 25.888px; }
div#cert_request div#cert_request_error {
display: block;
color: #993333;
font-weight: bold;
margin-bottom: 6px; }
$(function() {
//This is used to scroll error divs to the user's attention. It can be removed when we switch to the branch with jQuery.ScrollTo
jQuery.fn.scrollMinimal = function(smooth) {
var cTop = this.offset().top;
var cHeight = this.outerHeight(true);
var windowTop = $(window).scrollTop();
var visibleHeight = $(window).height();
if (cTop < windowTop) {
$('body').animate({
'scrollTop': cTop
}, 'slow', 'swing');
} else if (cTop + cHeight > windowTop + visibleHeight) {
$('body').animate({
'scrollTop': cTop - visibleHeight + cHeight
}, 'slow', 'swing');
}
};
var get_survey_data = function() {
var values = {};
//First we set the value of every input to null. This assures that even
//if a checkbox isn't checked or a question isn't answered, its name is
//still in the dictionary so we know the question was on the form.
var inputs = $("#survey_fieldset :input");
inputs.each(function(index, element) {
values[element.getAttribute("name")] = null;
});
//Grab the values from the survey_fieldset
var serializedArray = inputs.serializeArray();
for (var i = 0; i < serializedArray.length; i++) {
var key = serializedArray[i]['name'];
var value = serializedArray[i]['value'];
if (key in values && values[key] != null) {
values[key].push(value);
} else {
values[key] = [value];
}
}
return JSON.stringify(values);
};
$("#cert_request_form").submit(function() {
var values = {
'cert_request_honor_code_verify': $("#cert_request_honor_code_verify").is(':checked'),
'cert_request_name_verify': $("#cert_request_name_verify").is(':checked'),
'cert_request_id_verify': $("#cert_request_id_verify").is(':checked'),
//Notice that if the survey is present, it's data is in here! That is important
'survey_results': get_survey_data(),
};
postJSON('/certificate_request', values, function(data) {
if (data.success) {
$("#cert_request").html("<h1>Certificate Request Received</h1><p>Thank you! We will let you know when the certificate is ready to download from the <a href='/profile'>Profile page</a>.</p>");
} else {
$("#cert_request_error").html(data.error).scrollMinimal();
}
});
log_event("certificate_request", values);
return false;
});
$("#survey_form").submit(function() {
var values = { 'survey_results': get_survey_data() };
postJSON('/exit_survey', values, function(data) {
if (data.success) {
$("#survey").html("<h1>Survey Response Recorded</h1><p>Thank you for filling out the survey! You can now return to the <a href='/profile'>Profile page</a>.</p>");
} else {
$("#survey_error").html(data.error).scrollMinimal();
}
});
log_event("exit_survey_submission", values);
return false;
});
});
<%inherit file="main.html" />
<%namespace name="survey_fields" file="survey_fields.html"/>
<%block name="title"><title>Certificate Request - MITx 6.002x</title></%block>
<%block name="headextra">
<script type="text/javascript" src="${ settings.LIB_URL }certificate_survey.js"></script>
</%block>
<%include file="navigation.html" args="active_page=''" />
<%block name="bodyclass">cert-req</%block>
<section class="main-content">
<div id="cert_request">
<h1>You can request a certificate which verifies that you passed this course. When the certificate has been generated, you will receive an email notification that it can be downloaded from your Profile page.</h1>
<p>The certificate will indicate that <strong>${name}</strong> has successfully completed the Fall 2012 offering of <strong>Circuits and Electronics 6.002x</strong>. Please ensure that this information is correct.</p>
<form id="cert_request_form">
<fieldset id="cert_request_fieldset">
<div id="cert_request_error"> </div>
<ul>
<li class="verify">
<input type="checkbox" id="cert_request_honor_code_verify"/>
<label> I certify that I have not violated the Honor Code for this course. </label>
</li>
<li class="verify">
<input type="checkbox" id="cert_request_name_verify"/>
<label> The name shown above is correct. </label>
</li>
<li class="verify">
<input type="checkbox" id="cert_request_id_verify"/>
<label> I understand that my certificate contains my name a unique ID which will be visible on the certificate. I will give this ID only to those who I wish to visit the verification page on www.edXOnline.org to confirm that I passed Circuits and Electronics 6.002x. </label>
</li>
</ul>
</fieldset>
%if not took_survey:
<fieldset id="survey_fieldset">
<h1>Thank you for taking 6.002x! You could help us a lot by filling out this (optional) survey.</h1>
<p>This survey is collected only for research purposes. It is completely optional and will not affect your grade.</p>
${survey_fields.body(survey_list)}
</fieldset>
%endif
<input type="submit" id="" value="Generate Certificate" />
</form>
</div>
</section>
Congratulations on completing 6.002x! We have received your request
for a certifcate, and it is ready to download. Please visit your
<a href="http://6002x.mitx.mit.edu/Profile">Profile</a> to download your certificate.
\ No newline at end of file
6.002x Certificate Ready to Download
\ No newline at end of file
<%inherit file="main.html" />
<%namespace name="survey_fields" file="survey_fields.html"/>
<%block name="title"><title>Survey - MITx 6.002x</title></%block>
<%block name="headextra">
<script type="text/javascript" src="${ settings.LIB_URL }certificate_survey.js"></script>
</%block>
<%block name="bodyclass">exit-survey</%block>
<%include file="navigation.html" args="active_page=''" />
<section id="survey" class="main-content">
<form id="survey_form">
%if not took_survey:
<fieldset id="survey_fieldset">
<h1>Thank you for taking 6.002x! You could help us a lot by filling out this (optional) survey.</h1>
<p>This survey is collected only for research purposes. It is completely optional and will not affect your grade.</p>
${survey_fields.body(survey_list)}
</fieldset>
%else:
<h1>You have already taken the survey.</h1>
<p>Thank you for your help! You can only take the survey once, and we already have your submission.</p>
%endif
<input type="submit" id="" value="Submit Survey" />
</form>
</section>
......@@ -6,10 +6,11 @@
<script type="text/javascript" src="/static/js/flot/jquery.flot.symbol.js"></script>
<style type="text/css">
.grade_a {color:green;}
.grade_b {color:Chocolate;}
.grade_c {color:DimGray;}
.grade_none {color:LightGray;}
.grade_A {color:green;}
.grade_B {color:Chocolate;}
.grade_C {color:DarkSlateGray;}
.grade_F {color:DimGray;}
.grade_None {color:LightGray;}
</style>
</%block>
......@@ -29,27 +30,23 @@
<tr> <!-- Header Row -->
<th>Student</th>
%for section in templateSummary:
%if 'subscores' in section:
%for subsection in section['subscores']:
<th>${subsection['label']}</th>
%endfor
<th>${section['totallabel']}</th>
%else:
<th>${section['category']}</th>
%endif
%for section in templateSummary['section_breakdown']:
<th>${section['label']}</th>
%endfor
<th>Total</th>
</tr>
<%def name="percent_data(percentage)">
<%
data_class = "grade_none"
if percentage > .87:
data_class = "grade_a"
elif percentage > .70:
data_class = "grade_b"
elif percentage > .6:
data_class = "grade_c"
letter_grade = 'None'
if percentage > 0:
letter_grade = 'F'
for grade in ['A', 'B', 'C']:
if percentage >= grade_cutoffs[grade]:
letter_grade = grade
break
data_class = "grade_" + letter_grade
%>
<td class="${data_class}">${ "{0:.0%}".format( percentage ) }</td>
</%def>
......@@ -57,16 +54,10 @@
%for student in students:
<tr>
<td><a href="/profile/${student['id']}/">${student['username']}</a></td>
%for section in student['grade_info']['grade_summary']:
%if 'subscores' in section:
%for subsection in section['subscores']:
${percent_data( subsection['percentage'] )}
%endfor
${percent_data( section['totalscore'] )}
%else:
${percent_data( section['totalscore'] )}
%endif
%for section in student['grade_info']['grade_summary']['section_breakdown']:
${percent_data( section['percent'])}
%endfor
<th>${percent_data( student['grade_info']['grade_summary']['percent'])}</th>
</tr>
%endfor
</table>
......
<%inherit file="main.html" />
<%namespace name="profile_graphs" file="profile_graphs.js"/>
<%namespace name="survey_fields" file="survey_fields.html"/>
<%block name="title"><title>Profile - MITx 6.002x</title></%block>
<%!
from django.core.urlresolvers import reverse
from django.conf import settings
%>
<%block name="headextra">
......@@ -12,7 +14,7 @@
<script type="text/javascript" src="/static/js/flot/jquery.flot.stack.js"></script>
<script type="text/javascript" src="/static/js/flot/jquery.flot.symbol.js"></script>
<script>
${profile_graphs.body(grade_summary, "grade-detail-graph")}
${profile_graphs.body(grade_sheet['grade_summary'], grade_cutoffs, "grade-detail-graph")}
</script>
<script>
......@@ -100,6 +102,7 @@ $(function() {
"new_email":new_email});
return false;
});
$("#change_name_form").submit(function(){
var new_name = $('#new_name_field').val();
......@@ -119,7 +122,6 @@ $(function() {
"rationale":rationale});
return false;
});
});
</script>
</%block>
......@@ -135,10 +137,42 @@ $(function() {
<h1>Course Progress</h1>
</header>
%if settings.END_COURSE_ENABLED:
<div id="grade">
%if grade_sheet['grade']:
<p>Final Grade: <strong>${grade_sheet['grade']}</strong></p>
%if certificate_state['state'] == "requestable":
<a class="cert_request_link" href="/certificate_request">Request Certificate</a>
%elif certificate_state['state'] == "downloadable":
%if certificate_state['download_url']:
<a href="${certificate_state['download_url']}" target="_blank">Download Certificate</a>
%endif
%if certificate_state['graded_download_url']:
<a href="${certificate_state['graded_download_url']}" target="_blank">Download Certificate (with Grade)</a>
%endif
%elif certificate_state['state'] == "generating":
<a href="#">Certificate is being generated...</a>
%else:
<a href="#">No certificate available</a>
%endif
%else:
<p> No letter grade has been earned for this course </p>
%endif
%if not took_survey:
<a class="survey_link" href="/exit_survey">Take the survey</a>
%endif
</div>
%endif
<div id="grade-detail-graph"></div>
<ol class="chapters">
%for chapter in courseware_summary:
%for chapter in grade_sheet['courseware_summary']:
%if not chapter['chapter'] == "hidden":
<li>
<h2><a href="${reverse('courseware_chapter', args=format_url_params([chapter['course'], chapter['chapter']])) }">
......@@ -150,11 +184,11 @@ $(function() {
<%
earned = section['section_total'].earned
total = section['section_total'].possible
percentageString = "{0:.0%}".format( float(earned)/total) if earned > 0 else ""
percentageString = "{0:.0%}".format( float(earned)/total) if earned > 0 and total > 0 else ""
%>
<h3><a href="${reverse('courseware_section', args=format_url_params([chapter['course'], chapter['chapter'], section['section']])) }">
${ section['section'] }</a> ${"({0:g}/{1:g}) {2}".format( earned, total, percentageString )}</h3>
${ section['section'] }</a> ${"({0:.3n}/{1:.3n}) {2}".format( float(earned), float(total), percentageString )}</h3>
${section['subtitle']}
%if 'due' in section and section['due']!="":
due ${section['due']}
......@@ -164,7 +198,7 @@ $(function() {
<ol class="scores">
${ "Problem Scores: " if section['graded'] else "Practice Scores: "}
%for score in section['scores']:
<li class="score">${"{0:g}/{1:g}".format(score.earned,score.possible)}</li>
<li class="score">${"{0:.3n}/{1:.3n}".format(float(score.earned),float(score.possible))}</li>
%endfor
</ol>
%endif
......
<%page args="grade_summary, graph_div_id, **kwargs"/>
<%page args="grade_summary, grade_cutoffs, graph_div_id, **kwargs"/>
<%!
import json
import math
%>
$(function () {
......@@ -9,7 +10,7 @@ $(function () {
position: 'absolute',
display: 'none',
top: y + 5,
left: x + 5,
left: x + 15,
border: '1px solid #000',
padding: '4px 6px',
color: '#fff',
......@@ -19,100 +20,94 @@ $(function () {
}
/* -------------------------------- Grade detail bars -------------------------------- */
<%
colors = ["#b72121", "#600101", "#666666", "#333333"]
categories = {}
tickIndex = 1
sectionSpacer = 0.5
sectionSpacer = 0.25
sectionIndex = 0
series = []
ticks = [] #These are the indices and x-axis labels for the data
bottomTicks = [] #Labels on the bottom
detail_tooltips = {} #This an dictionary mapping from 'section' -> array of detail_tooltips
droppedScores = [] #These are the datapoints to indicate assignments which aren't factored into the total score
droppedScores = [] #These are the datapoints to indicate assignments which are not factored into the total score
dropped_score_tooltips = []
for section in grade_summary:
if 'subscores' in section: ##This is for sections like labs or homeworks, with several smaller components and a total
series.append({
'label' : section['category'],
'data' : [[i + tickIndex, score['percentage']] for i,score in enumerate(section['subscores'])],
'color' : colors[sectionIndex]
})
ticks += [[i + tickIndex, score['label'] ] for i,score in enumerate(section['subscores'])]
bottomTicks.append( [tickIndex + len(section['subscores'])/2, section['category']] )
detail_tooltips[ section['category'] ] = [score['summary'] for score in section['subscores']]
droppedScores += [[tickIndex + index, 0.05] for index in section['dropped_indices']]
dropExplanation = "The lowest {0} {1} scores are dropped".format( len(section['dropped_indices']), section['category'] )
dropped_score_tooltips += [dropExplanation] * len(section['dropped_indices'])
tickIndex += len(section['subscores']) + sectionSpacer
category_total_label = section['category'] + " Total"
series.append({
'label' : category_total_label,
'data' : [ [tickIndex, section['totalscore']] ],
'color' : colors[sectionIndex]
})
ticks.append( [tickIndex, section['totallabel']] )
detail_tooltips[category_total_label] = [section['totalscore_summary']]
else:
series.append({
'label' : section['category'],
'data' : [ [tickIndex, section['totalscore']] ],
'color' : colors[sectionIndex]
})
ticks.append( [tickIndex, section['totallabel']] )
detail_tooltips[section['category']] = [section['totalscore_summary']]
for section in grade_summary['section_breakdown']:
if section.get('prominent', False):
tickIndex += sectionSpacer
if section['category'] not in categories:
colorIndex = len(categories) % len(colors)
categories[ section['category'] ] = {'label' : section['category'],
'data' : [],
'color' : colors[colorIndex]}
categoryData = categories[ section['category'] ]
categoryData['data'].append( [tickIndex, section['percent']] )
ticks.append( [tickIndex, section['label'] ] )
if section['category'] in detail_tooltips:
detail_tooltips[ section['category'] ].append( section['detail'] )
else:
detail_tooltips[ section['category'] ] = [ section['detail'], ]
if 'mark' in section:
droppedScores.append( [tickIndex, 0.05] )
dropped_score_tooltips.append( section['mark']['detail'] )
tickIndex += 1 + sectionSpacer
sectionIndex += 1
detail_tooltips['Dropped Scores'] = dropped_score_tooltips
tickIndex += 1
if section.get('prominent', False):
tickIndex += sectionSpacer
## ----------------------------- Grade overviewew bar ------------------------- ##
totalWeight = 0.0
sectionIndex = 0
totalScore = 0.0
tickIndex += sectionSpacer
series = categories.values()
overviewBarX = tickIndex
for section in grade_summary:
weighted_score = section['totalscore'] * section['weight']
summary_text = "{0} - {1:.1%} of a possible {2:.0%}".format(section['category'], weighted_score, section['weight'])
weighted_category_label = section['category'] + " - Weighted"
if section['totalscore'] > 0:
extraColorIndex = len(categories) #Keeping track of the next color to use for categories not in categories[]
for section in grade_summary['grade_breakdown']:
if section['percent'] > 0:
if section['category'] in categories:
color = categories[ section['category'] ]['color']
else:
color = colors[ extraColorIndex % len(colors) ]
extraColorIndex += 1
series.append({
'label' : weighted_category_label,
'data' : [ [overviewBarX, weighted_score] ],
'color' : colors[sectionIndex]
'label' : section['category'] + "-grade_breakdown",
'data' : [ [overviewBarX, section['percent']] ],
'color' : color
})
detail_tooltips[weighted_category_label] = [ summary_text ]
sectionIndex += 1
totalWeight += section['weight']
totalScore += section['totalscore'] * section['weight']
detail_tooltips[section['category'] + "-grade_breakdown"] = [ section['detail'] ]
ticks += [ [overviewBarX, "Total"] ]
tickIndex += 1 + sectionSpacer
totalScore = math.floor(grade_summary['percent'] * 100) / 100 #We floor it to the nearest percent, 80.9 won't show up like a 90 (an A)
detail_tooltips['Dropped Scores'] = dropped_score_tooltips
## ----------------------------- Grade cutoffs ------------------------- ##
grade_cutoff_ticks = [ [1, "100%"], [0, "0%"] ]
for grade in ['A', 'B', 'C']:
percent = grade_cutoffs[grade]
grade_cutoff_ticks.append( [ percent, "{0} {1:.0%}".format(grade, percent) ] )
%>
var series = ${ json.dumps(series) };
var series = ${ json.dumps( series ) };
var ticks = ${ json.dumps(ticks) };
var bottomTicks = ${ json.dumps(bottomTicks) };
var detail_tooltips = ${ json.dumps(detail_tooltips) };
var droppedScores = ${ json.dumps(droppedScores) };
var grade_cutoff_ticks = ${ json.dumps(grade_cutoff_ticks) }
//Alwasy be sure that one series has the xaxis set to 2, or the second xaxis labels won't show up
series.push( {label: 'Dropped Scores', data: droppedScores, points: {symbol: "cross", show: true, radius: 3}, bars: {show: false}, color: "#333"} );
......@@ -122,17 +117,17 @@ $(function () {
lines: {show: false, steps: false },
bars: {show: true, barWidth: 0.8, align: 'center', lineWidth: 0, fill: .8 },},
xaxis: {tickLength: 0, min: 0.0, max: ${tickIndex - sectionSpacer}, ticks: ticks, labelAngle: 90},
yaxis: {ticks: [[1, "100%"], [0.87, "A 87%"], [0.7, "B 70%"], [0.6, "C 60%"], [0, "0%"]], min: 0.0, max: 1.0, labelWidth: 50},
yaxis: {ticks: grade_cutoff_ticks, min: 0.0, max: 1.0, labelWidth: 50},
grid: { hoverable: true, clickable: true, borderWidth: 1,
markings: [ {yaxis: {from: 0.87, to: 1 }, color: "#ddd"}, {yaxis: {from: 0.7, to: 0.87 }, color: "#e9e9e9"},
{yaxis: {from: 0.6, to: 0.7 }, color: "#f3f3f3"}, ] },
markings: [ {yaxis: {from: ${grade_cutoffs['A']}, to: 1 }, color: "#ddd"}, {yaxis: {from: ${grade_cutoffs['B']}, to: ${grade_cutoffs['A']} }, color: "#e9e9e9"},
{yaxis: {from: ${grade_cutoffs['C']}, to: ${grade_cutoffs['B']} }, color: "#f3f3f3"}, ] },
legend: {show: false},
};
var $grade_detail_graph = $("#${graph_div_id}");
if ($grade_detail_graph.length > 0) {
var plot = $.plot($grade_detail_graph, series, options);
//We need to put back the plotting of the percent here
var o = plot.pointOffset({x: ${overviewBarX} , y: ${totalScore}});
$grade_detail_graph.append('<div style="position:absolute;left:' + (o.left - 12) + 'px;top:' + (o.top - 20) + 'px">${"{totalscore:.0%}".format(totalscore=totalScore)}</div>');
}
......
......@@ -153,6 +153,43 @@ div.profile-wrapper {
}
}
div#grade {
@include clearfix;
@extend .topbar;
padding-left: lh();
padding-right: lh();
p {
color: darken($cream, 80%);
float: left;
margin-bottom: 0;
font-size: 14px;
font-weight: bold;
text-transform: uppercase;
strong {
font-size: 18px;
position: relative;
top: 1px;
}
}
a {
background-color: darken($cream, 10%);
border: 1px solid darken($cream, 30%);
@include border-radius(3px);
@include box-shadow(inset 0 1px 0 lighten($cream, 5%));
display: block;
float: right;
font-weight: bold;
line-height: 1em;
margin-left: 10px;
margin-top: 9px;
padding: 8px;
text-shadow: 0 1px 0 lighten($cream, 5%);
}
}
div#grade-detail-graph {
width: 100%;
min-height: 300px;
......
......@@ -3,7 +3,7 @@
// Base layout
@import "base/reset", "base/font-face";
@import "base/variables", "base/functions", "base/extends", "base/base";
@import "layout/layout", "layout/header", "layout/footer", "layout/calculator", "layout/leanmodal";
@import "layout/layout", "layout/header", "layout/footer", "layout/calculator", "layout/leanmodal", "layout/survey";
@import "plugins/jquery-ui-1.8.16.custom", "plugins/jquery.qtip.min";
// pages
......
......@@ -205,6 +205,8 @@ div#pwd_reset {
}
}
div#survey,
div#cert_request,
div#apply_name_change,
div#change_email,
div#unenroll,
......@@ -249,3 +251,35 @@ div#feedback_div{
}
}
div#cert_request {
fieldset#cert_request_fieldset {
label {
font-weight: bold;
margin-bottom: 6px;
display: block;
}
li.verify{
@include clearfix;
input {
float: left;
}
label {
margin-left: 25px;
}
}
}
fieldset#survey_fieldset {
margin-top: lh();
}
div#cert_request_error {
display: block;
color: $mit-red;
font-weight: bold;
margin-bottom: 6px;
}
}
body.exit-survey, body.cert-req {
div.header-wrapper {
height: 47px;
header {
max-width: 600px;
nav {
display: none;
}
}
}
section.main-content {
max-width: 600px;
padding: lh();
h1 {
margin-top: 0;
}
fieldset#survey_fieldset {
> ul {
list-style: none;
> li {
border-top: 1px solid #eee;
padding: lh() 0;
margin-bottom: 0;
ul {
list-style: none;
li {
margin-bottom: 6px;
label {
display: block;
input {
margin-top: -1px;
margin-right: 6px;
}
}
}
}
textarea {
display: block;
width: 100%;
margin-top: lh(.5);
}
h2 {
margin-top: 0;
}
&.survey_short_field, &.survey_medium_field {
label {
font-weight: bold;
text-transform: uppercase;
letter-spacing: 1px;
margin-bottom: 6px;
}
}
}
}
}
}
}
body.cert-req {
fieldset#survey_fieldset {
border-top: 2px solid #ccc;
padding-top: lh();
}
}
<%page args="survey_list, **kwargs"/>
<%def name="survey_radio(question_name, label, choices)">
<li class="survey_radio">
<h2>${label}</h2>
<ul>
%for choice in choices:
<li>
<label>
<input type="radio" name="${question_name}" value="${choice}" align="BASELINE"/>${choice}
</label>
</li>
%endfor
</ul>
</li>
</%def>
<%def name="survey_select_many(question_name, label, choices)">
<li class="survey_select_many">
<h2>${label}</h2>
<ul>
%for choice in choices:
<li>
<label>
<input type="checkbox" name="${question_name}" value="${choice}" align="BASELINE"/>${choice}
</label>
</li>
%endfor
</ul>
</li>
</%def>
<%def name="survey_checkbox(question_name, label)">
<li class="survey_checkbox">
<label><input type="checkbox" name="${question_name}" value="true"/> ${label}</label>
</li>
</%def>
<%def name="survey_short_field(question_name, label)">
<li class="survey_short_field">
<label>${label}</label>
<input type="text" name="${question_name}"/>
</li>
</%def>
<%def name="survey_medium_field(question_name, label)">
<li class="survey_medium_field">
<label>${label}</label>
<textarea name="${question_name}"></textarea>
</li>
</%def>
<ul>
%for survey_question in survey_list:
%if survey_question['type'] == 'radio':
${survey_radio(survey_question['question_name'], survey_question['label'], survey_question['choices']) }
%elif survey_question['type'] == 'select_many':
${survey_select_many(survey_question['question_name'], survey_question['label'], survey_question['choices']) }
%elif survey_question['type'] == 'checkbox':
${survey_checkbox(survey_question['question_name'], survey_question['label']) }
%elif survey_question['type'] == 'short_field':
${survey_short_field(survey_question['question_name'], survey_question['label']) }
%elif survey_question['type'] == 'medium_field':
${survey_medium_field(survey_question['question_name'], survey_question['label']) }
%endif
%endfor
</ul>
......@@ -41,6 +41,12 @@ urlpatterns = ('',
url(r'^send_feedback$', 'util.views.send_feedback'),
)
if settings.END_COURSE_ENABLED:
urlpatterns += (
url(r'^certificate_request$', 'certificates.views.certificate_request'),
url(r'^exit_survey$','student.views.record_exit_survey'),
)
if settings.PERFSTATS:
urlpatterns += (url(r'^reprofile$','perfstats.views.end_profile'),)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment