Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-ora2
Commits
133199b5
Commit
133199b5
authored
Mar 12, 2014
by
David Ormsbee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to using migrations.
parent
269a465a
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
342 additions
and
0 deletions
+342
-0
README.rst
+5
-0
apps/openassessment/assessment/migrations/0001_initial.py
+181
-0
apps/openassessment/assessment/migrations/__init__.py
+0
-0
apps/openassessment/assessment/models.py
+6
-0
apps/openassessment/workflow/migrations/0001_initial.py
+43
-0
apps/openassessment/workflow/migrations/__init__.py
+0
-0
apps/openassessment/workflow/models.py
+6
-0
apps/submissions/migrations/0001_initial.py
+93
-0
apps/submissions/migrations/__init__.py
+0
-0
apps/submissions/models.py
+6
-0
requirements/base.txt
+1
-0
settings/base.py
+1
-0
No files found.
README.rst
View file @
133199b5
...
@@ -24,6 +24,11 @@ for development purposes, run::
...
@@ -24,6 +24,11 @@ for development purposes, run::
The second line is necessary to register edx-tim's XBlock so that it will show
The second line is necessary to register edx-tim's XBlock so that it will show
up in the XBlock workbench.
up in the XBlock workbench.
To setup the database, run::
python manage.py syncdb --migrate
Running Tests
Running Tests
=============
=============
...
...
apps/openassessment/assessment/migrations/0001_initial.py
0 → 100644
View file @
133199b5
# -*- 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 'Rubric'
db
.
create_table
(
'assessment_rubric'
,
(
(
'id'
,
self
.
gf
(
'django.db.models.fields.AutoField'
)(
primary_key
=
True
)),
(
'content_hash'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
unique
=
True
,
max_length
=
40
,
db_index
=
True
)),
))
db
.
send_create_signal
(
'assessment'
,
[
'Rubric'
])
# Adding model 'Criterion'
db
.
create_table
(
'assessment_criterion'
,
(
(
'id'
,
self
.
gf
(
'django.db.models.fields.AutoField'
)(
primary_key
=
True
)),
(
'rubric'
,
self
.
gf
(
'django.db.models.fields.related.ForeignKey'
)(
related_name
=
'criteria'
,
to
=
orm
[
'assessment.Rubric'
])),
(
'name'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
100
)),
(
'order_num'
,
self
.
gf
(
'django.db.models.fields.PositiveIntegerField'
)()),
(
'prompt'
,
self
.
gf
(
'django.db.models.fields.TextField'
)(
max_length
=
10000
)),
))
db
.
send_create_signal
(
'assessment'
,
[
'Criterion'
])
# Adding model 'CriterionOption'
db
.
create_table
(
'assessment_criterionoption'
,
(
(
'id'
,
self
.
gf
(
'django.db.models.fields.AutoField'
)(
primary_key
=
True
)),
(
'criterion'
,
self
.
gf
(
'django.db.models.fields.related.ForeignKey'
)(
related_name
=
'options'
,
to
=
orm
[
'assessment.Criterion'
])),
(
'order_num'
,
self
.
gf
(
'django.db.models.fields.PositiveIntegerField'
)()),
(
'points'
,
self
.
gf
(
'django.db.models.fields.PositiveIntegerField'
)()),
(
'name'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
100
)),
(
'explanation'
,
self
.
gf
(
'django.db.models.fields.TextField'
)(
max_length
=
10000
,
blank
=
True
)),
))
db
.
send_create_signal
(
'assessment'
,
[
'CriterionOption'
])
# Adding model 'Assessment'
db
.
create_table
(
'assessment_assessment'
,
(
(
'id'
,
self
.
gf
(
'django.db.models.fields.AutoField'
)(
primary_key
=
True
)),
(
'submission'
,
self
.
gf
(
'django.db.models.fields.related.ForeignKey'
)(
to
=
orm
[
'submissions.Submission'
])),
(
'rubric'
,
self
.
gf
(
'django.db.models.fields.related.ForeignKey'
)(
to
=
orm
[
'assessment.Rubric'
])),
(
'scored_at'
,
self
.
gf
(
'django.db.models.fields.DateTimeField'
)(
default
=
datetime
.
datetime
.
now
,
db_index
=
True
)),
(
'scorer_id'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
40
,
db_index
=
True
)),
(
'score_type'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
2
)),
(
'feedback'
,
self
.
gf
(
'django.db.models.fields.TextField'
)(
default
=
''
,
max_length
=
10000
,
blank
=
True
)),
))
db
.
send_create_signal
(
'assessment'
,
[
'Assessment'
])
# Adding model 'AssessmentPart'
db
.
create_table
(
'assessment_assessmentpart'
,
(
(
'id'
,
self
.
gf
(
'django.db.models.fields.AutoField'
)(
primary_key
=
True
)),
(
'assessment'
,
self
.
gf
(
'django.db.models.fields.related.ForeignKey'
)(
related_name
=
'parts'
,
to
=
orm
[
'assessment.Assessment'
])),
(
'option'
,
self
.
gf
(
'django.db.models.fields.related.ForeignKey'
)(
to
=
orm
[
'assessment.CriterionOption'
])),
))
db
.
send_create_signal
(
'assessment'
,
[
'AssessmentPart'
])
# Adding model 'PeerWorkflow'
db
.
create_table
(
'assessment_peerworkflow'
,
(
(
'id'
,
self
.
gf
(
'django.db.models.fields.AutoField'
)(
primary_key
=
True
)),
(
'student_id'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
40
,
db_index
=
True
)),
(
'item_id'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
128
,
db_index
=
True
)),
(
'course_id'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
40
,
db_index
=
True
)),
(
'submission_uuid'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
unique
=
True
,
max_length
=
128
,
db_index
=
True
)),
(
'created_at'
,
self
.
gf
(
'django.db.models.fields.DateTimeField'
)(
default
=
datetime
.
datetime
.
now
,
db_index
=
True
)),
))
db
.
send_create_signal
(
'assessment'
,
[
'PeerWorkflow'
])
# Adding model 'PeerWorkflowItem'
db
.
create_table
(
'assessment_peerworkflowitem'
,
(
(
'id'
,
self
.
gf
(
'django.db.models.fields.AutoField'
)(
primary_key
=
True
)),
(
'scorer_id'
,
self
.
gf
(
'django.db.models.fields.related.ForeignKey'
)(
related_name
=
'items'
,
to
=
orm
[
'assessment.PeerWorkflow'
])),
(
'submission_uuid'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
128
,
db_index
=
True
)),
(
'started_at'
,
self
.
gf
(
'django.db.models.fields.DateTimeField'
)(
default
=
datetime
.
datetime
.
now
,
db_index
=
True
)),
(
'assessment'
,
self
.
gf
(
'django.db.models.fields.IntegerField'
)(
default
=-
1
)),
))
db
.
send_create_signal
(
'assessment'
,
[
'PeerWorkflowItem'
])
def
backwards
(
self
,
orm
):
# Deleting model 'Rubric'
db
.
delete_table
(
'assessment_rubric'
)
# Deleting model 'Criterion'
db
.
delete_table
(
'assessment_criterion'
)
# Deleting model 'CriterionOption'
db
.
delete_table
(
'assessment_criterionoption'
)
# Deleting model 'Assessment'
db
.
delete_table
(
'assessment_assessment'
)
# Deleting model 'AssessmentPart'
db
.
delete_table
(
'assessment_assessmentpart'
)
# Deleting model 'PeerWorkflow'
db
.
delete_table
(
'assessment_peerworkflow'
)
# Deleting model 'PeerWorkflowItem'
db
.
delete_table
(
'assessment_peerworkflowitem'
)
models
=
{
'assessment.assessment'
:
{
'Meta'
:
{
'ordering'
:
"['-scored_at', '-id']"
,
'object_name'
:
'Assessment'
},
'feedback'
:
(
'django.db.models.fields.TextField'
,
[],
{
'default'
:
"''"
,
'max_length'
:
'10000'
,
'blank'
:
'True'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'rubric'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'to'
:
"orm['assessment.Rubric']"
}),
'score_type'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'2'
}),
'scored_at'
:
(
'django.db.models.fields.DateTimeField'
,
[],
{
'default'
:
'datetime.datetime.now'
,
'db_index'
:
'True'
}),
'scorer_id'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'40'
,
'db_index'
:
'True'
}),
'submission'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'to'
:
"orm['submissions.Submission']"
})
},
'assessment.assessmentpart'
:
{
'Meta'
:
{
'object_name'
:
'AssessmentPart'
},
'assessment'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'related_name'
:
"'parts'"
,
'to'
:
"orm['assessment.Assessment']"
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'option'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'to'
:
"orm['assessment.CriterionOption']"
})
},
'assessment.criterion'
:
{
'Meta'
:
{
'ordering'
:
"['rubric', 'order_num']"
,
'object_name'
:
'Criterion'
},
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
}),
'order_num'
:
(
'django.db.models.fields.PositiveIntegerField'
,
[],
{}),
'prompt'
:
(
'django.db.models.fields.TextField'
,
[],
{
'max_length'
:
'10000'
}),
'rubric'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'related_name'
:
"'criteria'"
,
'to'
:
"orm['assessment.Rubric']"
})
},
'assessment.criterionoption'
:
{
'Meta'
:
{
'ordering'
:
"['criterion', 'order_num']"
,
'object_name'
:
'CriterionOption'
},
'criterion'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'related_name'
:
"'options'"
,
'to'
:
"orm['assessment.Criterion']"
}),
'explanation'
:
(
'django.db.models.fields.TextField'
,
[],
{
'max_length'
:
'10000'
,
'blank'
:
'True'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
}),
'order_num'
:
(
'django.db.models.fields.PositiveIntegerField'
,
[],
{}),
'points'
:
(
'django.db.models.fields.PositiveIntegerField'
,
[],
{})
},
'assessment.peerworkflow'
:
{
'Meta'
:
{
'ordering'
:
"['created_at', 'id']"
,
'object_name'
:
'PeerWorkflow'
},
'course_id'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'40'
,
'db_index'
:
'True'
}),
'created_at'
:
(
'django.db.models.fields.DateTimeField'
,
[],
{
'default'
:
'datetime.datetime.now'
,
'db_index'
:
'True'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'item_id'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'128'
,
'db_index'
:
'True'
}),
'student_id'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'40'
,
'db_index'
:
'True'
}),
'submission_uuid'
:
(
'django.db.models.fields.CharField'
,
[],
{
'unique'
:
'True'
,
'max_length'
:
'128'
,
'db_index'
:
'True'
})
},
'assessment.peerworkflowitem'
:
{
'Meta'
:
{
'ordering'
:
"['started_at', 'id']"
,
'object_name'
:
'PeerWorkflowItem'
},
'assessment'
:
(
'django.db.models.fields.IntegerField'
,
[],
{
'default'
:
'-1'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'scorer_id'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'related_name'
:
"'items'"
,
'to'
:
"orm['assessment.PeerWorkflow']"
}),
'started_at'
:
(
'django.db.models.fields.DateTimeField'
,
[],
{
'default'
:
'datetime.datetime.now'
,
'db_index'
:
'True'
}),
'submission_uuid'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'128'
,
'db_index'
:
'True'
})
},
'assessment.rubric'
:
{
'Meta'
:
{
'object_name'
:
'Rubric'
},
'content_hash'
:
(
'django.db.models.fields.CharField'
,
[],
{
'unique'
:
'True'
,
'max_length'
:
'40'
,
'db_index'
:
'True'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'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
=
[
'assessment'
]
\ No newline at end of file
apps/openassessment/assessment/migrations/__init__.py
0 → 100644
View file @
133199b5
apps/openassessment/assessment/models.py
View file @
133199b5
...
@@ -3,6 +3,12 @@
...
@@ -3,6 +3,12 @@
These models have to capture not only the state of assessments made for certain
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
submissions, but also the state of the rubrics at the time those assessments
were made.
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
collections
import
defaultdict
from
copy
import
deepcopy
from
copy
import
deepcopy
...
...
apps/openassessment/workflow/migrations/0001_initial.py
0 → 100644
View file @
133199b5
# -*- 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
apps/openassessment/workflow/migrations/__init__.py
0 → 100644
View file @
133199b5
apps/openassessment/workflow/models.py
View file @
133199b5
...
@@ -2,6 +2,12 @@
...
@@ -2,6 +2,12 @@
Workflow models are intended to track which step the student is in during the
Workflow models are intended to track which step the student is in during the
assessment process. The submission state is not explicitly tracked because
assessment process. The submission state is not explicitly tracked because
the assessment workflow only begins after a submission has been created.
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.db
import
models
from
django_extensions.db.fields
import
UUIDField
from
django_extensions.db.fields
import
UUIDField
...
...
apps/submissions/migrations/0001_initial.py
0 → 100644
View file @
133199b5
# -*- 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
apps/submissions/migrations/__init__.py
0 → 100644
View file @
133199b5
apps/submissions/models.py
View file @
133199b5
...
@@ -2,6 +2,12 @@
...
@@ -2,6 +2,12 @@
Submission models hold student responses to problems, scores, and a history of
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
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.
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.db
import
models
from
django.utils.timezone
import
now
from
django.utils.timezone
import
now
...
...
requirements/base.txt
View file @
133199b5
...
@@ -11,3 +11,4 @@ djangorestframework==2.3.5
...
@@ -11,3 +11,4 @@ djangorestframework==2.3.5
Mako==0.9.1
Mako==0.9.1
python-dateutil==2.1
python-dateutil==2.1
pytz==2012h
pytz==2012h
South==0.7.6
settings/base.py
View file @
133199b5
...
@@ -132,6 +132,7 @@ INSTALLED_APPS = (
...
@@ -132,6 +132,7 @@ INSTALLED_APPS = (
# Third party
# Third party
'django_extensions'
,
'django_extensions'
,
'south'
,
# XBlock
# XBlock
'workbench'
,
'workbench'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment