Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

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

## Public Member Functions
| __construct ( $id=-1, $fetch=true)
| store ()
| delete ( $catID=-1)
| get ( $id=-1)
| fill (&$questionArray)
| getAll ( $offset=0, $limit=20)
| count ()
| id ()
| name ()
| score ()
| game ()
| setName (&$value)
| setScore (&$value)
| setGame (&$game)
| isAlternative (&$alternative)
| alternatives ()
| countAlternatives ()
| countCorrectAlternatives ()

## Public Attributes
| $ID
| $Name
| $Description
| $Score
| $Game

## Detailed Description

! eZQuiz eZQuizQuestion documentation.

Example code:

Definition at line 43 of file ezquizquestion.php.

## Constructor & Destructor Documentation

## ◆ __construct()

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

Constructs a new eZQuizQuestion object.

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

Definition at line 52 of file ezquizquestion.php.

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

## Member Function Documentation

## ◆ alternatives()

eZQuizQuestion::alternatives | ( |  | ) |

Returns every alternative to this quiz question The alternatives is returned as an array of eZQuizAlternative objects.

Definition at line 300 of file ezquizquestion.php.

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

Referenced by delete().

## ◆ count()

eZQuizQuestion::count | ( |  | ) |

Returns the total count.

Definition at line 204 of file ezquizquestion.php.

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

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

## ◆ countAlternatives()

eZQuizQuestion::countAlternatives | ( |  | ) |

This function returns the count of all the alternatives for a question. Returns the number of alternatives of false if there are none.

Definition at line 317 of file ezquizquestion.php.

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

## ◆ countCorrectAlternatives()

eZQuizQuestion::countCorrectAlternatives | ( |  | ) |

This function returns the count of all the alternatives for a question which are correct. It returns false if there are no correct alternatives.

Definition at line 337 of file ezquizquestion.php.

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

## ◆ delete()

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

Deletes a eZQuizQuestion object from the database.

Definition at line 116 of file ezquizquestion.php.

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

## ◆ fill()

eZQuizQuestion::fill | ( | & | $questionArray | ) |

Fills in information to the object taken from the array.

Definition at line 168 of file ezquizquestion.php.

References $db, eZDB\globalDatabase(), and Name.

Referenced by __construct(), and get().

## ◆ game()

eZQuizQuestion::game | ( |  | ) |

Returns the name of the game.

Definition at line 242 of file ezquizquestion.php.

References $Game.

## ◆ get()

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

Fetches the object information from the database.

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

Definition at line 143 of file ezquizquestion.php.

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

## ◆ getAll()

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

Returns all the categories found in the database.

The categories are returned as an array of eZQuizQuestion objects.

Definition at line 182 of file ezquizquestion.php.

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

## ◆ id()

eZQuizQuestion::id | ( |  | ) |

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

Definition at line 218 of file ezquizquestion.php.

References $ID.

## ◆ isAlternative()

eZQuizQuestion::isAlternative | ( | & | $alternative | ) |

Returns true if the submitted alternative is part of the questions alternatives

Definition at line 275 of file ezquizquestion.php.

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

## ◆ name()

eZQuizQuestion::name | ( |  | ) |

Returns the name of the game.

Definition at line 226 of file ezquizquestion.php.

References Name.

## ◆ score()

eZQuizQuestion::score | ( |  | ) |

Returns the score of the game.

Definition at line 234 of file ezquizquestion.php.

References $Score.

## ◆ setGame()

eZQuizQuestion::setGame | ( | & | $game | ) |

Returns the name of the game.

Definition at line 266 of file ezquizquestion.php.

References $game.

## ◆ setName()

eZQuizQuestion::setName | ( | & | $value | ) |

Sets the login.

Definition at line 250 of file ezquizquestion.php.

References Name.

## ◆ setScore()

eZQuizQuestion::setScore | ( | & | $value | ) |

Sets the score.

Definition at line 258 of file ezquizquestion.php.

## ◆ store()

eZQuizQuestion::store | ( |  | ) |

Stores a eZQuizQuestion object to the database.

Definition at line 72 of file ezquizquestion.php.

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

## Member Data Documentation

## ◆ $Description

eZQuizQuestion::$Description

Definition at line 355 of file ezquizquestion.php.

## ◆ $Game

eZQuizQuestion::$Game

Definition at line 357 of file ezquizquestion.php.

Referenced by game().

## ◆ $ID

eZQuizQuestion::$ID

Definition at line 353 of file ezquizquestion.php.

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

## ◆ $Name

eZQuizQuestion::$Name

Definition at line 354 of file ezquizquestion.php.

## ◆ $Score

eZQuizQuestion::$Score

Definition at line 356 of file ezquizquestion.php.

Referenced by score().

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

- ezquizquestion.php

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