ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 57 of file class.ilTestArchiveService.php.

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

Referenced by archivePassesByActives().

58  {
59  $content = $this->renderOverviewContent($activeId, $pass);
60  $filename = $this->buildOverviewFilename($activeId, $pass);
61 
63 
64  $archiver = new ilTestArchiver($this->testOBJ->getId());
65  $archiver->setParticipantData($this->getParticipantData());
66  $archiver->handInTestResult($activeId, $pass, $filename);
67 
68  unlink($filename);
69  }
renderOverviewContent($activeId, $pass)
const PDF_USER_RESULT
PDF Purposes.
Class ilTestArchiver.
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=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  foreach ($passes as $pass) {
52  $this->archiveActivesPass($activeId, $pass);
53  }
54  }
55  }
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 108 of file class.ilTestArchiveService.php.

References $pass, and ilUtil\ilTempnam().

Referenced by archiveActivesPass().

109  {
110  $tmpFileName = ilUtil::ilTempnam();
111  return dirname($tmpFileName) . '/scores-' . $this->testOBJ->getId() . '-' . $activeId . '-' . $pass . '.pdf';
112  }
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 76 of file class.ilTestArchiveService.php.

References $GLOBALS, $pass, and $results.

Referenced by archiveActivesPass().

77  {
78  $results = $this->testOBJ->getTestResult(
79  $activeId,
80  $pass,
81  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,
91  $activeId,
92  $pass,
93  true,
94  false,
95  false,
96  true,
97  false,
98  null,
99  $testResultHeaderLabelBuilder
100  );
101  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$results
Definition: svg-scanner.php:47
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: