Documentation

CreateQuizSubmissionDTO extends AbstractBaseDto implements DTOInterface

DTO for creating quiz submissions in Canvas LMS

This DTO handles the data structure for starting a new quiz submission. It provides access code and preview mode configuration.

Usage Example:

$createDto = new CreateQuizSubmissionDTO([
    'access_code' => 'secret123',
    'preview' => false
]);

$submission = QuizSubmission::create($createDto);

Table of Contents

Interfaces

DTOInterface

Properties

$accessCode  : string|null
Access code for the quiz (if required)
$preview  : bool|null
Whether this is a preview submission (for instructors)
$apiPropertyName  : string
The API property name for quiz submissions

Methods

__construct()  : mixed
BaseDto constructor.
getAccessCode()  : string|null
Get access code
getPreview()  : bool|null
Get preview mode
setAccessCode()  : void
Set access code
setPreview()  : void
Set preview mode
toApiArray()  : array<string|int, mixed>
Convert the DTO to an array for API requests
toArray()  : array<string|int, mixed>
Convert the DTO to an array

Properties

$apiPropertyName

The API property name for quiz submissions

protected string $apiPropertyName = 'quiz_submission'

Methods

__construct()

BaseDto constructor.

public __construct(array<string|int, mixed> $data) : mixed
Parameters
$data : array<string|int, mixed>
Tags
throws
Exception

setAccessCode()

Set access code

public setAccessCode(string|null $accessCode) : void
Parameters
$accessCode : string|null

Quiz access code

setPreview()

Set preview mode

public setPreview(bool|null $preview) : void
Parameters
$preview : bool|null

Whether this is a preview submission

toApiArray()

Convert the DTO to an array for API requests

public toApiArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

toArray()

Convert the DTO to an array

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results