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) 2016 (original work) Open Assessment Technologies SA;
19 *
20 */
21
22namespace oat\taoProctoring\model;
23
24use oat\taoDelivery\model\execution\DeliveryExecution;
25use oat\taoDelivery\model\execution\StateServiceInterface;
26
27/**
28 * Interface DeliveryExecutionStateService
29 * @package oat\taoProctoring\model
30 * @author Aleh Hutnikau <hutnikau@1pt.com>
31 */
32interface DeliveryExecutionStateService extends StateServiceInterface
33{
34    /**
35     * Sets a delivery execution in the awaiting state
36     *
37     * @param DeliveryExecution $deliveryExecution
38     * @return bool
39     */
40    public function waitExecution(DeliveryExecution $deliveryExecution);
41
42    /**
43     * Sets a delivery execution in the inprogress state
44     *
45     * @param DeliveryExecution $deliveryExecution
46     * @return bool
47     */
48    public function resumeExecution(DeliveryExecution $deliveryExecution);
49
50    /**
51     * Authorises a delivery execution
52     *
53     * @param DeliveryExecution $deliveryExecution
54     * @param array $reason
55     * @param string $testCenter test center uri
56     * @return bool
57     */
58    public function authoriseExecution(DeliveryExecution $deliveryExecution, $reason = null, $testCenter = null);
59
60    /**
61     * Pauses a delivery execution
62     *
63     * @param DeliveryExecution $deliveryExecution
64     * @param array $reason
65     * @return bool
66     * @throws \Exception
67     */
68    public function pauseExecution(DeliveryExecution $deliveryExecution, $reason = null);
69
70    /**
71     * Cancel a delivery execution
72     *
73     * @param DeliveryExecution $deliveryExecution
74     * @param array $reason
75     * @return bool
76     */
77    public function cancelExecution(DeliveryExecution $deliveryExecution, $reason = null);
78
79    /**
80     * Whether delivery execution can be canceled or not
81     *
82     * @param DeliveryExecution $deliveryExecution
83     * @return bool
84     */
85    public function isCancelable(DeliveryExecution $deliveryExecution);
86
87    /**
88     * Report irregularity to a delivery execution
89     *
90     * @todo remove this method to separate service
91     * @param DeliveryExecution $deliveryExecution
92     * @param array $reason
93     * @return bool
94     */
95    public function reportExecution(DeliveryExecution $deliveryExecution, $reason);
96}