Skip to content

QuizModel Model ​

A quiz attempt and its result, sharing fcom_post_comments under type = quiz. score is an alias for the reactions_count column.

Table ​

  • Table: fcom_post_comments

  • Primary key: id

  • Extends: Model

Attributes ​

ColumnTypeNullableDefaultDescription
idBIGINT UNSIGNEDNo—Primary key for the row.
user_idBIGINT UNSIGNEDYes—WordPress user ID associated with the row.
post_idBIGINT UNSIGNEDYes—Associated feed post ID.
parent_idBIGINT UNSIGNEDYes—Parent row ID used for threading or hierarchy.
reactions_countBIGINT UNSIGNEDYes0Cached number of reactions attached to the record.
messageLONGTEXTYes—Raw message or body content.
message_renderedLONGTEXTYes—Rendered HTML representation of the message.
metaLONGTEXTYes—Serialized meta payload used by FluentCommunity.
typeVARCHAR(100)Yes'comment'Subtype discriminator for the row.
content_typeVARCHAR(100)Yes'text'Content subtype such as text, document, or survey.
statusVARCHAR(100)Yes'published'Lifecycle or moderation status.
is_stickyTINYINT(1)Yes0Boolean-like flag used for pinned or sticky records.
created_atTIMESTAMPYes—Creation timestamp maintained by the ORM.
updated_atTIMESTAMPYes—Update timestamp maintained by the ORM.

Relationships ​

MethodTypeTargetNotes
user()belongsToUserSignature: —
xprofile()belongsToXProfileSignature: —
lesson()belongsToCourseLessonSignature: —

Scopes ​

ScopeParametersPurpose
——No custom scopes are declared on this model.

Key Methods ​

MethodDescription
hideCorrectAnswers()hide Correct Answers implemented on the model.
isCorrectAnswer()is Correct Answer implemented on the model.
normalizeAnswer()normalize Answer implemented on the model.

Usage Examples ​

php
use FluentCommunityPro\App\Modules\Quiz\QuizModel;

$records = QuizModel::query()
    
    ->limit(10)
    ->get();

$first = QuizModel::query()->first();

FluentCommunity developer documentation