Commit 133199b5 by David Ormsbee

Switch to using migrations.

parent 269a465a
......@@ -24,6 +24,11 @@ for development purposes, run::
The second line is necessary to register edx-tim's XBlock so that it will show
up in the XBlock workbench.
To setup the database, run::
python manage.py syncdb --migrate
Running Tests
=============
......
......@@ -3,6 +3,12 @@
These models have to capture not only the state of assessments made for certain
submissions, but also the state of the rubrics at the time those assessments
were made.
NOTE: We've switched to migrations, so if you make any edits to this file, you
need to then generate a matching migration for it using:
./manage.py schemamigration openassessment.assessment --auto
"""
from collections import defaultdict
from copy import deepcopy
......
# -*- 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 'AssessmentWorkflow'
db.create_table('workflow_assessmentworkflow', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime.now)),
('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime.now)),
('status', self.gf('model_utils.fields.StatusField')(default='peer', max_length=100, no_check_for_status=True)),
('status_changed', self.gf('model_utils.fields.MonitorField')(default=datetime.datetime.now, monitor=u'status')),
('submission_uuid', self.gf('django.db.models.fields.CharField')(unique=True, max_length=36, db_index=True)),
('uuid', self.gf('django.db.models.fields.CharField')(db_index=True, unique=True, max_length=36, blank=True)),
))
db.send_create_signal('workflow', ['AssessmentWorkflow'])
def backwards(self, orm):
# Deleting model 'AssessmentWorkflow'
db.delete_table('workflow_assessmentworkflow')
models = {
'workflow.assessmentworkflow': {
'Meta': {'ordering': "['-created']", 'object_name': 'AssessmentWorkflow'},
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'status': ('model_utils.fields.StatusField', [], {'default': "'peer'", 'max_length': '100', u'no_check_for_status': 'True'}),
'status_changed': ('model_utils.fields.MonitorField', [], {'default': 'datetime.datetime.now', u'monitor': "u'status'"}),
'submission_uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '36', 'db_index': 'True'}),
'uuid': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'unique': 'True', 'max_length': '36', 'blank': 'True'})
}
}
complete_apps = ['workflow']
\ No newline at end of file
......@@ -2,6 +2,12 @@
Workflow models are intended to track which step the student is in during the
assessment process. The submission state is not explicitly tracked because
the assessment workflow only begins after a submission has been created.
NOTE: We've switched to migrations, so if you make any edits to this file, you
need to then generate a matching migration for it using:
./manage.py schemamigration openassessment.workflow --auto
"""
from django.db import models
from django_extensions.db.fields import UUIDField
......
# -*- 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 'StudentItem'
db.create_table('submissions_studentitem', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('student_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)),
('course_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)),
('item_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)),
('item_type', self.gf('django.db.models.fields.CharField')(max_length=100)),
))
db.send_create_signal('submissions', ['StudentItem'])
# Adding unique constraint on 'StudentItem', fields ['course_id', 'student_id', 'item_id']
db.create_unique('submissions_studentitem', ['course_id', 'student_id', 'item_id'])
# Adding model 'Submission'
db.create_table('submissions_submission', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('uuid', self.gf('django.db.models.fields.CharField')(db_index=True, max_length=36, blank=True)),
('student_item', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['submissions.StudentItem'])),
('attempt_number', self.gf('django.db.models.fields.PositiveIntegerField')()),
('submitted_at', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now, db_index=True)),
('created_at', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now, db_index=True)),
('answer', self.gf('django.db.models.fields.TextField')(blank=True)),
))
db.send_create_signal('submissions', ['Submission'])
# Adding model 'Score'
db.create_table('submissions_score', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('student_item', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['submissions.StudentItem'])),
('submission', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['submissions.Submission'], null=True)),
('points_earned', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)),
('points_possible', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)),
('created_at', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now, db_index=True)),
))
db.send_create_signal('submissions', ['Score'])
def backwards(self, orm):
# Removing unique constraint on 'StudentItem', fields ['course_id', 'student_id', 'item_id']
db.delete_unique('submissions_studentitem', ['course_id', 'student_id', 'item_id'])
# Deleting model 'StudentItem'
db.delete_table('submissions_studentitem')
# Deleting model 'Submission'
db.delete_table('submissions_submission')
# Deleting model 'Score'
db.delete_table('submissions_score')
models = {
'submissions.score': {
'Meta': {'object_name': 'Score'},
'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'points_earned': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
'points_possible': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
'student_item': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['submissions.StudentItem']"}),
'submission': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['submissions.Submission']", 'null': 'True'})
},
'submissions.studentitem': {
'Meta': {'unique_together': "(('course_id', 'student_id', 'item_id'),)", 'object_name': 'StudentItem'},
'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'item_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
'item_type': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'student_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'})
},
'submissions.submission': {
'Meta': {'ordering': "['-submitted_at', '-id']", 'object_name': 'Submission'},
'answer': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'attempt_number': ('django.db.models.fields.PositiveIntegerField', [], {}),
'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'student_item': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['submissions.StudentItem']"}),
'submitted_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}),
'uuid': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '36', 'blank': 'True'})
}
}
complete_apps = ['submissions']
\ No newline at end of file
......@@ -2,6 +2,12 @@
Submission models hold student responses to problems, scores, and a history of
those scores. It is intended to be a general purpose store that is usable by
different problem types, and is therefore ignorant of ORA workflow.
NOTE: We've switched to migrations, so if you make any edits to this file, you
need to then generate a matching migration for it using:
./manage.py schemamigration submissions --auto
"""
from django.db import models
from django.utils.timezone import now
......
......@@ -11,3 +11,4 @@ djangorestframework==2.3.5
Mako==0.9.1
python-dateutil==2.1
pytz==2012h
South==0.7.6
......@@ -132,6 +132,7 @@ INSTALLED_APPS = (
# Third party
'django_extensions',
'south',
# XBlock
'workbench',
......
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