Bug fix and data persistence
This commit is contained in:
		@@ -44,12 +44,14 @@
 | 
			
		||||
                            {{ entry.user_code }}
 | 
			
		||||
                        </li>
 | 
			
		||||
                    {% endif %}
 | 
			
		||||
                    <li class="list-group-item list-group-item-action">
 | 
			
		||||
                        <div class="d-flex w-100 justify-content-between">
 | 
			
		||||
                            <h5 class="mb-1">Start Time</h5>
 | 
			
		||||
                        </div>
 | 
			
		||||
                        {{ entry.start_time.strftime('%d %b %Y %H:%M:%S') }}
 | 
			
		||||
                    </li>
 | 
			
		||||
                    {% if 'start_time' in entry %}
 | 
			
		||||
                        <li class="list-group-item list-group-item-action">
 | 
			
		||||
                            <div class="d-flex w-100 justify-content-between">
 | 
			
		||||
                                <h5 class="mb-1">Start Time</h5>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            {{ entry.start_time.strftime('%d %b %Y %H:%M:%S') }}
 | 
			
		||||
                        </li>
 | 
			
		||||
                    {% endif %}
 | 
			
		||||
                    <li class="list-group-item list-group-item-action">
 | 
			
		||||
                        <div class="d-flex w-100 justify-content-between">
 | 
			
		||||
                            <h5 class="mb-1">Submission Time</h5>
 | 
			
		||||
 
 | 
			
		||||
@@ -143,9 +143,10 @@ def submit_quiz():
 | 
			
		||||
    if not entry:
 | 
			
		||||
        return jsonify('Unrecognised ID', 'error'), 400
 | 
			
		||||
    status = 'submitted'
 | 
			
		||||
    if entry['end_time']:
 | 
			
		||||
        if datetime.utcnow() > entry['end_time'] + timedelta(minutes=2):
 | 
			
		||||
            status = 'late'
 | 
			
		||||
    if 'end_time' in entry:
 | 
			
		||||
        if entry['end_time']:
 | 
			
		||||
            if datetime.utcnow() > entry['end_time'] + timedelta(minutes=2):
 | 
			
		||||
                status = 'late'
 | 
			
		||||
    test_code = entry['test_code']
 | 
			
		||||
    test = db.tests.find_one({'test_code' : test_code})
 | 
			
		||||
    dataset = test['dataset']
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user