1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
5/**
6 * @author		Björn Heyser <bheyser@databay.de>
7 * @version		$Id$
8 *
9 * @package     Modules/Test
10 */
11class ilTestSkillPointAccount
12{
13    private $totalMaxSkillPoints;
14
15    private $totalReachedSkillPoints;
16
17    private $numBookings;
18
19    public function __construct()
20    {
21        $this->totalMaxSkillPoints = 0;
22        $this->totalReachedSkillPoints = 0;
23
24        $this->numBookings = 0;
25    }
26
27    public function addBooking($maxSkillPoints, $reachedSkillPoints)
28    {
29        $this->totalMaxSkillPoints += $maxSkillPoints;
30        $this->totalReachedSkillPoints += $reachedSkillPoints;
31
32        $this->numBookings++;
33    }
34
35    public function getTotalMaxSkillPoints()
36    {
37        return $this->totalMaxSkillPoints;
38    }
39
40    public function getTotalReachedSkillPoints()
41    {
42        return $this->totalReachedSkillPoints;
43    }
44
45    public function getNumBookings()
46    {
47        return $this->numBookings;
48    }
49
50    public function getTotalReachedSkillPercent()
51    {
52        return (
53            ($this->getTotalReachedSkillPoints() * 100) / $this->getTotalMaxSkillPoints()
54        );
55    }
56}
57