You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
need to create models relating to Quiz
follow the DBML below to create relating models about quiz
Other Information
Table Quiz{
note: '''
The settings for each quiz
'''
id int [pk]
name varchar[255] [note:"Quiz name.", not null]
intro longtext [default: null, note:'Quiz introduction text.']
timeopen timestamp [default: 0]
timeclose timestamp [default: 0]
timelimit timestamp [default: 0]
grade decimal
is_comp bool [note: "check if this quiz is a competition", default: False]
visible bool [default: false]
}
table Quiz_slots{
id int [pk]
quiz int [ref: > Quiz.id]
slot int [increment, note:'can set as `index`']
status enum [note: 'PROCESSING, SUBMITTED']
questionid int [ref: > Question.id]
block int
display_number varchar [default: null, note:'''Stores customised question number such as 1.2, A1, B12. If this is null, the default number is used.''']
require_previous bool [default: False]
}
Table Quiz_attempts {
id bigint [pk] // Primary Key
quiz bigint [ref: > Quiz.id]
attempt mediumint [note : "Sequentially numbers this student's attempts at this quiz."]
question_attempts bigint
currentpage bigint
state varchar(16)
timestart timestamp
timefinish timestamp
time_modified timestamp
time_modified_offline timestamp
// timecheckstate bigint
sum_grades decimal(10,5) [note:'Total marks for this attempt.']
// gradednotificationsenttime bigint
}
Table Quiz_attempt_user {
id BIGINT [note: 'Primary key, unique identifier for each grade entry.']
quiz_attempt BIGINT [not null, default: 0, note: 'Foreign key references quiz.id. Represents the quiz associated with this grade.']
student BIGINT [not null, default: 0, note: 'Foreign key references user.id. Represents the user associated with this grade.']
grade DECIMAL(10,5) [not null, default: 0.0, note: 'The overall grade from the quiz. Not affected by overrides in the gradebook.']
time_modified BIGINT [not null, default: 0, note: 'The last time this grade was modified.']
}
Ref: Quiz_attempts.id < Quiz_attempt_user.quiz_attempt [note: 'Defines the foreign key relationship between quiz_grades.quiz and quiz.id.']
Ref: Student.user_id < Quiz_attempt_user.student [note: 'Defines the foreign key relationship between quiz_grades.userid and user.id.']
The text was updated successfully, but these errors were encountered:
Basic Information
need to create models relating to Quiz
follow the DBML below to create relating models about quiz
Other Information
The text was updated successfully, but these errors were encountered: