Class for handling exam generation.
- Author
- Jaeyoon Kim
- Version
- 0.0.1
- Since
- 2016-03-18
__construct |
( |
|
$data, |
|
|
|
$name = "" |
|
) |
| |
The constuctor. The constructor takes 2 arguments, $path and the optional $name. The constructor will then setup a new pdf object based on the given arguments. This constructor will be changed to use database parameters instead at a later time.
- Parameters
-
str | $path | The path to the exam file. |
str | $name,="" | Optional name of the exam. |
generate_exam |
( |
|
$exam_count, |
|
|
|
$extra_pages = 0 |
|
) |
| |
Public method. This method takes 2 integer arguments. $exam_count and $extra_pages This method will generate a exam each with a unique QRcode placed on the top left corner.
- Parameters
-
int | $exam_count | Number of exams to be generated. |
int | $extra_pages | Number of extra "emergency" pages to generate for each exam. |
- Returns
- void
get_QRcode_string |
( |
|
$page_number, |
|
|
|
$exam_number |
|
) |
| |
Public method. The method takes 2 integer arguments for the current page and exam number. The method will return a string that will be displayed under the QRcode.
- Parameters
-
int | $page_number | Current page number |
int | $exam_number | Current exam booklet number |
- Returns
- str String that will be displayed under the QRcode.
output_exam |
( |
|
$name = "output" | ) |
|
Public method. This method will output the generated .pdf file. Thus should only be called after generate_exam() method has been called. The PDF output will fail if there are any non PDF output made beforehand. An optional filename can be specified as the $name which will be used for the name in the download prompt.
- Parameters
-
str | $name,="output" | Optional filename. |
- Returns
- void
The documentation for this class was generated from the following file: