ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 57 of file class.ilTestArchiveService.php.

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 }
$filename
Definition: buildRTE.php:89
renderOverviewContent($activeId, $pass)
buildOverviewFilename($activeId, $pass)
Class ilTestArchiver.
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
const PDF_USER_RESULT
PDF Purposes.

References $filename, $pass, 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 48 of file class.ilTestArchiveService.php.

49 {
50 foreach ($passesByActives as $activeId => $passes) {
51 foreach ($passes as $pass) {
52 $this->archiveActivesPass($activeId, $pass);
53 }
54 }
55 }
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 108 of file class.ilTestArchiveService.php.

109 {
110 $tmpFileName = ilUtil::ilTempnam();
111 return dirname($tmpFileName) . '/scores-' . $this->testOBJ->getId() . '-' . $activeId . '-' . $pass . '.pdf';
112 }
static ilTempnam($a_temp_path=null)
Returns a unique and non existing Path for e temporary file or 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 76 of file class.ilTestArchiveService.php.

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(
91 $activeId,
92 $pass,
93 true,
94 false,
95 false,
96 true,
97 false,
98 null,
99 $testResultHeaderLabelBuilder
100 );
101 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
Service GUI class for tests.
language()
Definition: language.php:2
$results

References $GLOBALS, $pass, $results, and 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 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: