ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilTestArchiveService Class Reference
+ Collaboration diagram for ilTestArchiveService:

Public Member Functions

 __construct (ilObjTest $testOBJ)
 
 getParticipantData ()
 
 setParticipantData (ilTestParticipantData $participantData)
 
 archivePassesByActives ($passesByActives)
 
 archiveActivesPass ($activeId, $pass)
 

Protected Attributes

 $testOBJ
 
 $participantData
 

Private Member Functions

 renderOverviewContent ($activeId, $pass)
 
 buildOverviewFilename ($activeId, $pass)
 

Detailed Description

Definition at line 14 of file class.ilTestArchiveService.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestArchiveService::__construct ( ilObjTest  $testOBJ)

Definition at line 26 of file class.ilTestArchiveService.php.

27 {
28 $this->testOBJ = $testOBJ;
29 $this->participantData = null;
30 }

References $testOBJ.

Member Function Documentation

◆ archiveActivesPass()

ilTestArchiveService::archiveActivesPass (   $activeId,
  $pass 
)

Definition at line 59 of file class.ilTestArchiveService.php.

60 {
61 $content = $this->renderOverviewContent($activeId, $pass);
62 $filename = $this->buildOverviewFilename($activeId, $pass);
63
65
66 $archiver = new ilTestArchiver($this->testOBJ->getId());
67 $archiver->setParticipantData($this->getParticipantData());
68 $archiver->handInTestResult($activeId, $pass, $filename);
69
70 unlink($filename);
71 }
renderOverviewContent($activeId, $pass)
buildOverviewFilename($activeId, $pass)
Class ilTestArchiver.
static generatePDF($pdf_output, $output_mode, $filename=null)

References $filename, $pass, buildOverviewFilename(), ilTestPDFGenerator\generatePDF(), getParticipantData(), ilTestPDFGenerator\PDF_OUTPUT_FILE, and renderOverviewContent().

Referenced by archivePassesByActives().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ archivePassesByActives()

ilTestArchiveService::archivePassesByActives (   $passesByActives)

Definition at line 48 of file class.ilTestArchiveService.php.

49 {
50 foreach($passesByActives as $activeId => $passes)
51 {
52 foreach($passes as $pass)
53 {
54 $this->archiveActivesPass($activeId, $pass);
55 }
56 }
57 }
archiveActivesPass($activeId, $pass)

References $pass, and archiveActivesPass().

+ Here is the call graph for this function:

◆ buildOverviewFilename()

ilTestArchiveService::buildOverviewFilename (   $activeId,
  $pass 
)
private
Parameters
$activeId
$pass
Returns
string

Definition at line 99 of file class.ilTestArchiveService.php.

100 {
101 $tmpFileName = ilUtil::ilTempnam();
102 return dirname($tmpFileName).'/scores-'.$this->testOBJ->getId().'-'.$activeId.'-'.$pass.'.pdf';
103 }
static ilTempnam($a_temp_path=null)
Create a temporary file in an ILIAS writable directory.

References $pass, and ilUtil\ilTempnam().

Referenced by archiveActivesPass().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getParticipantData()

ilTestArchiveService::getParticipantData ( )
Returns
ilTestParticipantData

Definition at line 35 of file class.ilTestArchiveService.php.

References $participantData.

Referenced by archiveActivesPass().

+ Here is the caller graph for this function:

◆ renderOverviewContent()

ilTestArchiveService::renderOverviewContent (   $activeId,
  $pass 
)
private
Parameters
$activeId
$pass
Returns
string

Definition at line 78 of file class.ilTestArchiveService.php.

79 {
80 $results = $this->testOBJ->getTestResult(
81 $activeId, $pass, false
82 );
83
84 $gui = new ilTestServiceGUI($this->testOBJ);
85
86 require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
87 $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($GLOBALS['DIC']->language(), $GLOBALS['DIC']['ilObjDataCache']);
88
89 return $gui->getPassListOfAnswers(
90 $results, $activeId, $pass, true, false, false, true, false, null, $testResultHeaderLabelBuilder
91 );
92 }
Service GUI class for tests.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$results

References $GLOBALS, $pass, and $results.

Referenced by archiveActivesPass().

+ Here is the caller graph for this function:

◆ setParticipantData()

ilTestArchiveService::setParticipantData ( ilTestParticipantData  $participantData)
Parameters
ilTestParticipantData$participantData

Definition at line 43 of file class.ilTestArchiveService.php.

44 {
45 $this->participantData = $participantData;
46 }

References $participantData.

Field Documentation

◆ $participantData

ilTestArchiveService::$participantData
protected

Definition at line 24 of file class.ilTestArchiveService.php.

Referenced by getParticipantData(), and setParticipantData().

◆ $testOBJ

ilTestArchiveService::$testOBJ
protected

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

Referenced by __construct().


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