Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Public Attributes | List of all members
eZQuizAnswer Class Reference

## Public Member Functions
| __construct ( $id=-1, $fetch=true)
| store ()
| delete ( $catID=-1)
| get ( $id=-1)
| fill (&$answerArray)
| getAll ( $offset=0, $limit=20)
| count ()
| hasAnswered ()
| id ()
| alternative ()
| user ()
| setUser (&$user)
| setAlternative (&$alternative)

## Public Attributes
| $ID
| $User
| $Alternative

## Detailed Description

! eZQuiz eZQuizAnswer documentation.

Example code:

Definition at line 42 of file ezquizanswer.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZQuizAnswer::__construct | ( |  | $id = `-1`,
|  |  | $fetch = `true`
| ) |  |

Constructs a new eZQuizAnswer object.

If $id is set the object's values are fetched from the database.

Definition at line 51 of file ezquizanswer.php.

References $id, $ID, and fill().

## Member Function Documentation

## ◆ alternative()

eZQuizAnswer::alternative | ( |  | ) |

Returns the alternative of the answer.

Definition at line 229 of file ezquizanswer.php.

References $Alternative.

## ◆ count()

eZQuizAnswer::count | ( |  | ) |

Returns the total count.

Definition at line 177 of file ezquizanswer.php.

References $db, $result, $ret, and eZDB\globalDatabase().

Referenced by get(), getAll(), and hasAnswered().

## ◆ delete()

eZQuizAnswer::delete | ( |  | $catID = `-1` | ) |

Deletes a eZQuizAnswer object from the database.

Definition at line 103 of file ezquizanswer.php.

References $db, $ID, $res, eZDB\finish(), and eZDB\globalDatabase().

## ◆ fill()

eZQuizAnswer::fill | ( | & | $answerArray | ) |

Fills in information to the object taken from the array.

Definition at line 145 of file ezquizanswer.php.

References $db.

Referenced by __construct(), and get().

## ◆ get()

eZQuizAnswer::get | ( |  | $id = `-1` | ) |

Fetches the object information from the database.

True is retuned if successful, false (0) if not.

Definition at line 119 of file ezquizanswer.php.

References $db, $id, $ret, count(), fill(), and eZDB\globalDatabase().

## ◆ getAll()

eZQuizAnswer::getAll | ( |  | $offset = `0`,
|  |  | $limit = `20`
| ) |  |

Returns all the categories found in the database.

The categories are returned as an array of eZQuizAnswer objects.

Definition at line 157 of file ezquizanswer.php.

References $db, $i, count(), and eZDB\globalDatabase().

## ◆ hasAnswered()

eZQuizAnswer::hasAnswered | ( |  | ) |

This function returns true if the user has answered the same question earlier.

Definition at line 190 of file ezquizanswer.php.

References $db, $QuestionID, $result, $UserID, count(), and eZDB\globalDatabase().

## ◆ id()

eZQuizAnswer::id | ( |  | ) |

Returns the object ID to the answer. This is the unique ID stored in the database.

Definition at line 221 of file ezquizanswer.php.

References $ID.

## ◆ setAlternative()

eZQuizAnswer::setAlternative | ( | & | $alternative | ) |

Sets the alternative

Definition at line 254 of file ezquizanswer.php.

## ◆ setUser()

eZQuizAnswer::setUser | ( | & | $user | ) |

Sets the user

Definition at line 245 of file ezquizanswer.php.

References $user.

## ◆ store()

eZQuizAnswer::store | ( |  | ) |

Stores a eZQuizAnswer object to the database.

Definition at line 70 of file ezquizanswer.php.

References $db, $name, $res, $userID, eZDB\finish(), eZDB\globalDatabase(), and Name.

## ◆ user()

eZQuizAnswer::user | ( |  | ) |

Returns the user of the answer.

Definition at line 237 of file ezquizanswer.php.

References $User.

## Member Data Documentation

## ◆ $Alternative

eZQuizAnswer::$Alternative

Definition at line 263 of file ezquizanswer.php.

Referenced by alternative().

## ◆ $ID

eZQuizAnswer::$ID

Definition at line 261 of file ezquizanswer.php.

Referenced by __construct(), delete(), and id().

## ◆ $User

eZQuizAnswer::$User

Definition at line 262 of file ezquizanswer.php.

Referenced by user().

The documentation for this class was generated from the following file:

- ezquizanswer.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.