ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilTestArchiveService Class Reference
+ Collaboration diagram for ilTestArchiveService:

Public Member Functions

 __construct (protected ilObjTest $test_obj, protected ilLanguage $lng, protected ilObjectDataCache $obj_cache, protected ilTestHTMLGenerator $html_generator)
 
 getParticipantData ()
 
 setParticipantData (ilTestParticipantData $participantData)
 
 archivePassesByActives ($passesByActives)
 
 archiveActivesPass (int $active_id, int $pass)
 

Protected Attributes

ilTestParticipantData $participantData = null
 

Private Member Functions

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

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilTestArchiveService::__construct ( protected ilObjTest  $test_obj,
protected ilLanguage  $lng,
protected ilObjectDataCache  $obj_cache,
protected ilTestHTMLGenerator  $html_generator 
)

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

36  {
37  $this->participantData = null;
38  }

Member Function Documentation

◆ archiveActivesPass()

ilTestArchiveService::archiveActivesPass ( int  $active_id,
int  $pass 
)

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

References $filename, buildOverviewFilename(), getParticipantData(), renderOverviewContent(), and ilTestArchiver\setParticipantData().

Referenced by archivePassesByActives().

59  : void
60  {
61  $content = $this->renderOverviewContent($active_id, $pass);
62  $filename = $this->buildOverviewFilename($active_id, $pass);
63  $this->html_generator->generateHTML($content, $filename);
64  $archiver = new ilTestArchiver($this->test_obj->getId());
65  $archiver->setParticipantData($this->getParticipantData());
66  $archiver->handInTestResult($active_id, $pass, $filename);
67  $archiver->handInParticipantUploadedResults($active_id, $pass, $this->test_obj);
68  unlink($filename);
69  }
renderOverviewContent($activeId, $pass)
$filename
Definition: buildRTE.php:78
Class ilTestArchiver.
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 50 of file class.ilTestArchiveService.php.

References archiveActivesPass().

50  : void
51  {
52  foreach ($passesByActives as $activeId => $passes) {
53  foreach ($passes as $pass) {
54  $this->archiveActivesPass($activeId, $pass);
55  }
56  }
57  }
archiveActivesPass(int $active_id, int $pass)
+ Here is the call graph for this function:

◆ buildOverviewFilename()

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

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

References ilFileUtils\ilTempnam().

Referenced by archiveActivesPass().

106  : string
107  {
108  $tmpFileName = ilFileUtils::ilTempnam();
109  return dirname($tmpFileName) . '/scores-' . $this->test_obj->getId() . '-' . $activeId . '-' . $pass . '.html';
110  }
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getParticipantData()

ilTestArchiveService::getParticipantData ( )

Definition at line 40 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 $results, and ILIAS\Repository\lng().

Referenced by archiveActivesPass().

76  : string
77  {
78  $results = $this->test_obj->getTestResult(
79  $activeId,
80  $pass,
81  false
82  );
83 
84  $gui = new ilTestServiceGUI($this->test_obj);
85  $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $this->obj_cache);
86 
87  return $gui->getPassListOfAnswers(
88  $results,
89  $activeId,
90  $pass,
91  true,
92  false,
93  false,
94  true,
95  false,
96  null,
97  $testResultHeaderLabelBuilder
98  );
99  }
$results
Service GUI class for tests.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setParticipantData()

ilTestArchiveService::setParticipantData ( ilTestParticipantData  $participantData)

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

References $participantData.

45  : void
46  {
47  $this->participantData = $participantData;
48  }
ilTestParticipantData $participantData

Field Documentation

◆ $participantData

ilTestParticipantData ilTestArchiveService::$participantData = null
protected

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

Referenced by getParticipantData(), and setParticipantData().


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