ILIAS  release_8 Revision v8.24
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 25 of file class.ilTestArchiveService.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestArchiveService::__construct ( ilObjTest  $testOBJ)

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

38 {
39 $this->testOBJ = $testOBJ;
40 $this->participantData = null;
41 }

References $testOBJ.

Member Function Documentation

◆ archiveActivesPass()

ilTestArchiveService::archiveActivesPass (   $activeId,
  $pass 
)

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

69 {
70 $content = $this->renderOverviewContent($activeId, $pass);
71 $filename = $this->buildOverviewFilename($activeId, $pass);
73 $archiver = new ilTestArchiver($this->testOBJ->getId());
74 $archiver->setParticipantData($this->getParticipantData());
75 $archiver->handInTestResult($activeId, $pass, $filename);
76 $archiver->handInParticipantUploadedResults($activeId, $pass, $this->testOBJ);
77 unlink($filename);
78 }
$filename
Definition: buildRTE.php:78
renderOverviewContent($activeId, $pass)
buildOverviewFilename($activeId, $pass)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
const PDF_USER_RESULT
PDF Purposes.

References $filename, buildOverviewFilename(), ilTestPDFGenerator\generatePDF(), getParticipantData(), ilTestPDFGenerator\PDF_OUTPUT_FILE, PDF_USER_RESULT, 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 59 of file class.ilTestArchiveService.php.

60 {
61 foreach ($passesByActives as $activeId => $passes) {
62 foreach ($passes as $pass) {
63 $this->archiveActivesPass($activeId, $pass);
64 }
65 }
66 }
archiveActivesPass($activeId, $pass)

References archiveActivesPass().

+ Here is the call graph for this function:

◆ buildOverviewFilename()

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

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

117 : string
118 {
119 $tmpFileName = ilFileUtils::ilTempnam();
120 return dirname($tmpFileName) . '/scores-' . $this->testOBJ->getId() . '-' . $activeId . '-' . $pass . '.pdf';
121 }
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.

References ilFileUtils\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 46 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 85 of file class.ilTestArchiveService.php.

85 : string
86 {
87 $results = $this->testOBJ->getTestResult(
88 $activeId,
89 $pass,
90 false
91 );
92
93 $gui = new ilTestServiceGUI($this->testOBJ);
94
95 require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
96 $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($GLOBALS['DIC']->language(), $GLOBALS['DIC']['ilObjDataCache']);
97
98 return $gui->getPassListOfAnswers(
100 $activeId,
101 $pass,
102 true,
103 false,
104 false,
105 true,
106 false,
107 null,
108 $testResultHeaderLabelBuilder
109 );
110 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
Service GUI class for tests.
$results

References $GLOBALS, $results, and ILIAS\UI\examples\Symbol\Glyph\Language\language().

Referenced by archiveActivesPass().

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

◆ setParticipantData()

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

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

55 {
56 $this->participantData = $participantData;
57 }

References $participantData.

Field Documentation

◆ $participantData

ilTestArchiveService::$participantData
protected

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

Referenced by getParticipantData(), and setParticipantData().

◆ $testOBJ

ilTestArchiveService::$testOBJ
protected

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

Referenced by __construct().


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