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.

References $testOBJ.

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

Member Function Documentation

◆ archiveActivesPass()

ilTestArchiveService::archiveActivesPass (   $activeId,
  $pass 
)

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

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

Referenced by archivePassesByActives().

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)
Class ilTestArchiver.
static generatePDF($pdf_output, $output_mode, $filename=null)
buildOverviewFilename($activeId, $pass)
setParticipantData($participantData)
+ 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.

References $pass, and archiveActivesPass().

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)
+ 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.

References $pass, and ilUtil\ilTempnam().

Referenced by archiveActivesPass().

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.
+ 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.

References $GLOBALS, $pass, and $results.

Referenced by archiveActivesPass().

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  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$results
Service GUI class for tests.
+ 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.

References $participantData.

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

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: