# \hhu\z\questtypesSubmitQuesttypeModel

Model of the SubmitQuesttypeAgent for a submit task.

## Summary

Methods
Properties
Constants
load()
factory()
checkClass()
setCharacterSubmission()
addCommentForCharacterAnswer()
getCharacterSubmissions()
getAllowedMimetypes()
getCharacterSubmissionComments()
$models
No constants found
__construct()
$db
N/A
getClassName()
loadClass()
loadDriver()
connect()
loadModels()
No private properties found
N/A

File
  questtypes/submit/SubmitQuesttypeModel.inc
Package
  Default
Class hierarchy
  \nre\core\Model
  \nre\models\DatabaseModel
  \hhu\z\Model
  \hhu\z\models\QuesttypeModel
  \hhu\z\questtypes\SubmitQuesttypeModel

## Tags

author | Oliver Hanraths oliver.hanraths@uni-duesseldorf.de

## Properties

### $models

    $models : array

Required models

#### Type

array

#

## Tags

None found

### $db

    $db : \nre\models\DatabaseDriver

Database connection

#### Type

\nre\models\DatabaseDriver

#

Inherited from
  \nre\models\DatabaseModel

## Tags

static |

## Methods

### load()

    load(string  $modelName)

Load the class of a Model.

#### Parameters

string | $modelName | Name of the Model to load

#### Throws

\nre\exceptions\ModelNotFoundException
\nre\exceptions\ModelNotValidException

#

static

Inherited from
  \nre\core\Model

## Tags

None found

### factory()

    factory(string  $modelName)

Instantiate a Model (Factory Pattern).

#### Parameters

string | $modelName | Name of the Model to instantiate

#

static

Inherited from
  \nre\core\Model

## Tags

None found

### checkClass()

    checkClass(string  $className, string  $parentClassName)

Check inheritance of the QuesttypeModel-class.

#### Parameters

string | $className | Name of the class to check
string | $parentClassName | Name of the parent class

#### Throws

\nre\exceptions\ClassNotValidException

#

static

Inherited from
  \hhu\z\models\QuesttypeModel

## Tags

static |

### setCharacterSubmission()

    setCharacterSubmission(integer  $seminaryId, integer  $questId, integer  $userId, integer  $characterId, array  $file, string  $filename)

Save Character’s submitted upload.

#### Parameters

integer | $seminaryId | ID of Seminary
integer | $questId | ID of Quest
integer | $userId | ID of user
integer | $characterId | ID of Character
array | $file | Submitted upload
string | $filename | Name of submitted file

#

## Tags

None found

### addCommentForCharacterAnswer()

    addCommentForCharacterAnswer(integer  $userId, integer  $submissionId, string  $comment)

Add a comment for the answer of a Character.

#### Parameters

integer | $userId | ID of user that comments
integer | $submissionId | ID of Character answer to comment
string | $comment | Comment text

#

## Tags

None found

### getCharacterSubmissions()

    getCharacterSubmissions(integer  $questId, integer  $characterId) : array

Get all uploads submitted by Character.

#### Parameters

integer | $questId | ID of Quest
integer | $characterId | ID of Character

#### Returns

array —

Text submitted by Character or NULL

#

## Tags

None found

### getAllowedMimetypes()

    getAllowedMimetypes(integer  $seminaryId) : array

Get allowed mimetypes for uploading a file.

#### Parameters

integer | $seminaryId | ID of Seminary

#### Returns

array —

Allowed mimetypes

#

## Tags

None found

### getCharacterSubmissionComments()

    getCharacterSubmissionComments(integer  $characterSubmissionId) : array

Get all comments for a Character submission.

#### Parameters

integer | $characterSubmissionId | ID of Character submission

#### Returns

array —

Comments for this submission

#

## Tags

None found

### __construct()

    __construct()

Construct a new Model.

TODO Catch exception

#### Throws

\nre\exceptions\DatamodelException
\nre\exceptions\DriverNotFoundException
\nre\exceptions\DriverNotValidException
\nre\exceptions\ModelNotValidException
\nre\exceptions\ModelNotFoundException

#

Inherited from
  \nre\core\Model

## Tags

None found

### getClassName()

    getClassName(string  $modelName) : string

Determine the classname for the given Model name.

#### Parameters

string | $modelName | Model name to get classname of

#### Returns

string —

Classname fore the Model name

#

static

Inherited from
  \nre\core\Model

## Tags

None found

### loadClass()

    loadClass(string  $questtypeName, string  $fullClassName)

Load the class of a QuesttypeModel.

#### Parameters

string | $questtypeName | Name of the QuesttypeModel to load
string | $fullClassName | Name of the class to load

#### Throws

\nre\exceptions\ClassNotFoundException

#

static

Inherited from
  \hhu\z\models\QuesttypeModel

## Tags

static |

### loadDriver()

    loadDriver(string  $driverName)

Load the database driver.

#### Parameters

string | $driverName | Name of the database driver

#### Throws

\nre\exceptions\DriverNotFoundException
\nre\exceptions\DriverNotValidException

#

Inherited from
  \nre\models\DatabaseModel

## Tags

None found

### connect()

    connect(string  $driverName, array  $config)

Establish a connection to the database.

#### Parameters

string | $driverName | Name of the database driver
array | $config | Connection settings

#### Throws

\nre\exceptions\DatamodelException

#

Inherited from
  \nre\models\DatabaseModel

## Tags

None found

### loadModels()

    loadModels()

Load the Models of this Model.

#### Throws

\nre\exceptions\DatamodelException
\nre\exceptions\DriverNotFoundException
\nre\exceptions\DriverNotValidException
\nre\exceptions\ModelNotValidException
\nre\exceptions\ModelNotFoundException

#

Inherited from
  \nre\core\Model

## Tags

None found

### SubmitQuesttypeModel.inc