ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTestPDFGenerator Class Reference

Class ilTestPDFGenerator. More...

+ Collaboration diagram for ilTestPDFGenerator:

Static Public Member Functions

static generatePDF ($pdf_output, $output_mode, $filename=null)
static preprocessHTML ($html)

Data Fields

const PDF_OUTPUT_DOWNLOAD = 'D'
const PDF_OUTPUT_INLINE = 'I'
const PDF_OUTPUT_FILE = 'F'

Static Protected Member Functions

static getTemplatePath ($a_filename)

Detailed Description

Class ilTestPDFGenerator.

Class that handles PDF generation for test and assessment.

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 13 of file class.ilTestPDFGenerator.php.

Member Function Documentation

static ilTestPDFGenerator::generatePDF (   $pdf_output,
  $output_mode,
  $filename = null 
)
static

Definition at line 19 of file class.ilTestPDFGenerator.php.

References $filename, ilPDFGeneration\doJob(), and preprocessHTML().

Referenced by ilTestPlayerAbstractGUI\archiveParticipantSubmission(), ilTestServiceGUI\getQuestionResultForTestUsers(), ilTestEvaluationGUI\outParticipantsPassDetails(), ilTestEvaluationGUI\outParticipantsResultsOverview(), ilTestEvaluationGUI\outUserResultsOverview(), ilObjTestGUI\printobject(), ilTestScoring\recalculatePasses(), ilTestSubmissionReviewGUI\show(), and ilTestArchiver\updateTestArchive().

{
$pdf_output = self::preprocessHTML($pdf_output);
if (substr($filename, strlen($filename) - 4, 4) != '.pdf')
{
$filename .= '.pdf';
}
require_once './Services/PDFGeneration/classes/class.ilPDFGeneration.php';
$job = new ilPDFGenerationJob();
$job->setAutoPageBreak(true)
->setCreator('ILIAS Test')
->setFilename($filename)
->setMarginLeft('20')
->setMarginRight('20')
->setMarginTop('20')
->setMarginBottom('20')
->setOutputMode($output_mode)
->addPage($pdf_output);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilTestPDFGenerator::getTemplatePath (   $a_filename)
staticprotected

Definition at line 50 of file class.ilTestPDFGenerator.php.

References ilStyleDefinition\getCurrentSkin().

Referenced by preprocessHTML().

{
$module_path = "Modules/Test/";
// use ilStyleDefinition instead of account to get the current skin
include_once "Services/Style/classes/class.ilStyleDefinition.php";
{
$fname = "./Customizing/global/skin/".
ilStyleDefinition::getCurrentSkin()."/".$module_path.basename($a_filename);
}
if($fname == "" || !file_exists($fname))
{
$fname = "./".$module_path."templates/default/".basename($a_filename);
}
return $fname;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilTestPDFGenerator::preprocessHTML (   $html)
static

Definition at line 44 of file class.ilTestPDFGenerator.php.

References getTemplatePath().

Referenced by generatePDF().

{
$pdf_css_path = self::getTemplatePath('test_pdf.css');
return '<style>' . file_get_contents($pdf_css_path) . '</style>' . $html;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

const ilTestPDFGenerator::PDF_OUTPUT_INLINE = 'I'

Definition at line 16 of file class.ilTestPDFGenerator.php.


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