Commit bc473987 by Chris Dodge

touch up html and add a new field to model

parent d5ade68d
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'ProctoredExamStudentAttempt.taking_as_proctored'
db.add_column('proctoring_proctoredexamstudentattempt', 'taking_as_proctored',
self.gf('django.db.models.fields.BooleanField')(default=False),
keep_default=False)
def backwards(self, orm):
# Deleting field 'ProctoredExamStudentAttempt.taking_as_proctored'
db.delete_column('proctoring_proctoredexamstudentattempt', 'taking_as_proctored')
models = {
'edx_proctoring.proctoredexam': {
'Meta': {'unique_together': "(('course_id', 'content_id'),)", 'object_name': 'ProctoredExam', 'db_table': "'proctoring_proctoredexam'"},
'content_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'exam_name': ('django.db.models.fields.TextField', [], {}),
'external_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_index': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_proctored': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'time_limit_mins': ('django.db.models.fields.IntegerField', [], {})
},
'edx_proctoring.proctoredexamstudentallowance': {
'Meta': {'unique_together': "(('user_id', 'proctored_exam', 'key'),)", 'object_name': 'ProctoredExamStudentAllowance', 'db_table': "'proctoring_proctoredexamstudentallowance'"},
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'key': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'proctored_exam': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['edx_proctoring.ProctoredExam']"}),
'user_id': ('django.db.models.fields.IntegerField', [], {}),
'value': ('django.db.models.fields.CharField', [], {'max_length': '255'})
},
'edx_proctoring.proctoredexamstudentallowancehistory': {
'Meta': {'object_name': 'ProctoredExamStudentAllowanceHistory', 'db_table': "'proctoring_proctoredexamstudentallowancehistory'"},
'allowance_id': ('django.db.models.fields.IntegerField', [], {}),
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'key': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'proctored_exam': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['edx_proctoring.ProctoredExam']"}),
'user_id': ('django.db.models.fields.IntegerField', [], {}),
'value': ('django.db.models.fields.CharField', [], {'max_length': '255'})
},
'edx_proctoring.proctoredexamstudentattempt': {
'Meta': {'object_name': 'ProctoredExamStudentAttempt', 'db_table': "'proctoring_proctoredexamstudentattempt'"},
'completed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'external_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_index': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'proctored_exam': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['edx_proctoring.ProctoredExam']"}),
'started_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
'status': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
'taking_as_proctored': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'user_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True'})
}
}
complete_apps = ['edx_proctoring']
\ No newline at end of file
...@@ -85,6 +85,10 @@ class ProctoredExamStudentAttempt(TimeStampedModel): ...@@ -85,6 +85,10 @@ class ProctoredExamStudentAttempt(TimeStampedModel):
# what is the status of this attempt # what is the status of this attempt
status = models.CharField(max_length=64) status = models.CharField(max_length=64)
# if the user is attempting this as a proctored exam
# in case there is an option to opt-out
taking_as_proctored = models.BooleanField()
class Meta: class Meta:
""" Meta class for this Django model """ """ Meta class for this Django model """
db_table = 'proctoring_proctoredexamstudentattempt' db_table = 'proctoring_proctoredexamstudentattempt'
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</p> </p>
<div class="gated-sequence"> <div class="gated-sequence">
<span><i class="fa fa-lock"></i></span> <span><i class="fa fa-lock"></i></span>
<a class="start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}"> <a class="start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-choice="proctored">
{% trans "Yes, take this exam as a proctored exam (and be eligible for credit)" %} {% trans "Yes, take this exam as a proctored exam (and be eligible for credit)" %}
</a> </a>
<p> <p>
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
of your exam. After successful installation, you will be <strong>guided through setting up your of your exam. After successful installation, you will be <strong>guided through setting up your
proctored session and begin the exam immediately </strong>afterwards.</p> proctored session and begin the exam immediately </strong>afterwards.</p>
{% endblocktrans %} {% endblocktrans %}
<i class="fa fa-arrow-circle-right"></i> <i class="fa fa-arrow-circle-right start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-choice="proctored"></i>
</div> </div>
<div class="gated-sequence"> <div class="gated-sequence">
<span><i class="fa fa-unlock"></i></span> <span><i class="fa fa-unlock"></i></span>
<a class="start-timed-exam"> <a class="start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-choice="unproctored">
{% trans "No, take this exam as an open exam (and not be eligible for credit)" %} {% trans "No, take this exam as an open exam (and not be eligible for credit)" %}
</a> </a>
<p> <p>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
credit </strong>upon completing the exam or this course in general. credit </strong>upon completing the exam or this course in general.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
<i class="fa fa-arrow-circle-right"></i> <i class="fa fa-arrow-circle-right start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-choice="unproctored"></i>
</div> </div>
</div> </div>
{% include 'proctoring/seq_proctored_exam_footer.html' %} {% include 'proctoring/seq_proctored_exam_footer.html' %}
...@@ -47,13 +47,15 @@ ...@@ -47,13 +47,15 @@
function(event) { function(event) {
var action_url = $(this).data('ajax-url'); var action_url = $(this).data('ajax-url');
var exam_id = $(this).data('exam-id'); var exam_id = $(this).data('exam-id');
var choice = $(this).data('choice');
if (typeof action_url === "undefined" ) { if (typeof action_url === "undefined" ) {
return false; return false;
} }
$.post( $.post(
action_url, action_url,
{ {
"exam_id": exam_id "exam_id": exam_id,
"choice": choice
}, },
function(data) { function(data) {
// reload the page, because we've unlocked it // reload the page, because we've unlocked it
...@@ -62,4 +64,4 @@ ...@@ -62,4 +64,4 @@
); );
} }
); );
</script> </script>
\ No newline at end of file
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