Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3/**
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; under version 2
7 * of the License (non-upgradable).
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 *
18 * Copyright (c) 2015 (original work) Open Assessment Technologies SA;
19 *
20 *
21 */
22
23namespace oat\taoProctoring\model\monitorCache;
24
25use oat\taoDelivery\model\execution\DeliveryExecutionInterface;
26use oat\taoDelivery\model\execution\Delete\DeliveryExecutionDelete;
27
28/**
29 * Interface DeliveryMonitoringService
30 *
31 * @package oat\taoProctoring\model
32 * @author Aleh Hutnikau <hutnikau@1pt.com>
33 */
34interface DeliveryMonitoringService extends DeliveryExecutionDelete
35{
36    /**
37     * @deprecated
38     */
39    public const CONFIG_ID = 'taoProctoring/DeliveryMonitoring';
40
41    /**
42     * Service Id of the main Monitoring Cache Service
43     * @var string
44     */
45    public const SERVICE_ID = 'taoProctoring/DeliveryMonitoring';
46
47    public const ID = 'id';
48    public const DELIVERY_EXECUTION_ID = 'delivery_execution_id';
49    public const STATUS = 'status';
50    public const CURRENT_ASSESSMENT_ITEM = 'current_assessment_item';
51    public const TEST_TAKER = 'test_taker';
52    public const AUTHORIZED_BY = 'authorized_by';
53    public const START_TIME = 'start_time';
54    public const END_TIME = 'end_time';
55    public const REMAINING_TIME = 'remaining_time';
56    public const EXTRA_TIME = 'extra_time';
57    public const EXTENDED_TIME = 'extended_time';
58    public const CONSUMED_EXTRA_TIME = 'consumed_extra_time';
59    public const ALLOW_EXTRA_TIME = 'allow_extra_time';
60
61    public const LAST_TEST_TAKER_ACTIVITY = 'last_test_taker_activity';
62    public const LAST_TEST_STATE_CHANGE = 'last_test_state_change';
63    public const LAST_PAUSE_TIMESTAMP = 'last_pause_timestamp';
64
65    public const DIFF_TIMESTAMP = 'diff_timestamp';
66    public const ITEM_DURATION = 'item_duration';
67    public const STORED_ITEM_DURATION = 'stored_item_duration';
68
69    public const TEST_TAKER_FIRST_NAME = 'test_taker_first_name';
70    public const TEST_TAKER_LAST_NAME = 'test_taker_last_name';
71    public const DELIVERY_ID = 'delivery_id';
72    public const DELIVERY_NAME = 'delivery_name';
73    public const CONNECTIVITY = 'last_connect';
74
75    public const REACTIVATE_AUTHORIZED_BY = 'reactivate_authorized_by';
76
77    /**
78     * @param DeliveryExecutionInterface $deliveryExecution
79     * @param $data
80     * @return DeliveryMonitoringData
81     */
82    public function createMonitoringData(DeliveryExecutionInterface $deliveryExecution, $data);
83
84    /**
85     * Retrieve the currently cached delivery data
86     *
87     * @param DeliveryExecutionInterface $deliveryExecution
88     * @return DeliveryMonitoringData
89     */
90    public function getData(DeliveryExecutionInterface $deliveryExecution);
91
92    /**
93     * @return DeliveryMonitoringData[]
94     */
95    public function find();
96
97    /**
98     * @param DeliveryMonitoringData $deliveryMonitoring
99     * @return mixed
100     */
101    public function save(DeliveryMonitoringData $deliveryMonitoring);
102
103    /**
104     * @param DeliveryMonitoringData $deliveryMonitoring
105     * @return mixed
106     */
107    public function partialSave(DeliveryMonitoringData $deliveryMonitoring);
108
109    /**
110     * @param DeliveryMonitoringData $deliveryMonitoring
111     * @return mixed
112     */
113    public function delete(DeliveryMonitoringData $deliveryMonitoring);
114
115    /**
116     * @return integer
117     */
118    public function count();
119
120    /**
121     * Get statistic by statuses grouped by deliveries.
122     * Result is an array of deliveries with amount of delivery executions in each status
123     */
124    public function getStatusesStatistic($limit = 0, $offset = 0, $orderby = 'delivery_name', $orderdir = 'asc');
125
126    /**
127     * Count statistic by statuses grouped by deliveries.
128     */
129    public function getCountOfStatistics();
130}