PaferaPy Async 0.1
ASGI framework focused on simplicity and efficiency
Loading...
Searching...
No Matches
challengeresult.py
Go to the documentation of this file.
1#!/usr/bin/python
2# -*- coding: utf-8 -*-
3
4import pafera.db
6
7# Result flags
8CHALLENGERESULT_UNFINISHED = 0x01
9CHALLENGERESULT_FINISHED = 0x02
10CHALLENGERESULT_PASSED = 0x04
11
12# *********************************************************************
14 """This class represents an attempt by a student to finish a
15 challenge. It contains their scores, individual results for each
16 problem, and any answers or files submitted.
17 """
18
19 _dbfields = {
20 'rid': ('INTEGER', 'PRIMARY KEY NOT NULL',),
21 'userid': ('INT', 'NOT NULL',),
22 'classid': ('INT', 'NOT NULL',),
23 'challengetype': ('INT16', 'NOT NULL',),
24 'timeused': ('INT16', 'NOT NULL'),
25 'starttime': ('DATETIME', 'NOT NULL',),
26 'endtime': ('DATETIME', 'NOT NULL',),
27 'challenge': ('TEXT', 'NOT NULL',),
28 'challengeid': ('INT', 'NOT NULL',),
29 'problemresults': ('LIST', "NOT NULL DEFAULT ''",),
30 'answer': ('TEXT', "NOT NULL DEFAULT ''",),
31 'lessonids': ('NEWLINELIST', "NOT NULL DEFAULT ''",),
32 'problemids': ('NEWLINELIST', "NOT NULL DEFAULT ''",),
33 'files': ('NEWLINELIST', "NOT NULL DEFAULT ''",),
34 'score': ('INT16', 'NOT NULL DEFAULT 0',),
35 'maximumscore': ('INT16', 'NOT NULL DEFAULT 0',),
36 'percentright': ('INT16', 'NOT NULL DEFAULT 0',),
37 'scoreadded': ('INT16', 'NOT NULL DEFAULT 0',),
38 'flags': ('INT', 'NOT NULL DEFAULT 0',),
39 }
40 _dbindexes = ()
41 _dblinks = [
42 ]
43 _dbdisplay = ['challenge', 'challengeid', 'lessonids', 'score', 'percentright']
44 _dbflags = 0
45
46 # -------------------------------------------------------------------
47 def __init__(self):
48 super().__init__()
49
This class represents an attempt by a student to finish a challenge.
def __init__(self)
Initialize all fields at creation like a good programmer should.
Base class for all database models.
Definition: modelbase.py:20
Definition: db.py:1