-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrenderable.php
More file actions
executable file
·233 lines (221 loc) · 8.92 KB
/
renderable.php
File metadata and controls
executable file
·233 lines (221 loc) · 8.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains renderables for the digitala class.
*
* @package mod_digitala
* @author Alanen, Tuomas; Erkkilä, Joona; Harjunpää, Topi; Heijala, Maikki.
* @copyright 2022 Helsingin Yliopisto
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once(__DIR__.'/answerrecording_form.php');
/**
* A custom renderable class that implements the renderable and is used by the digitala module with the progress bar.
*
* @package mod_digitala
* @author Alanen, Tuomas; Erkkilä, Joona; Harjunpää, Topi; Heijala, Maikki.
* @copyright 2022 Helsingin Yliopisto
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class digitala_progress_bar implements renderable {
/**
* Constructor
* @param int $currpage - Current page number
*/
public function __construct($currpage = 0) {
$this->currpage = $currpage;
}
}
/**
* Implements a renderable info panel used on the first page of the activity.
*
* @package mod_digitala
* @author Alanen, Tuomas; Erkkilä, Joona; Harjunpää, Topi; Heijala, Maikki.
* @copyright 2022 Helsingin Yliopisto
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class digitala_info implements renderable {
/**
* Constructor
*/
public function __construct() {
}
}
/**
* Implements a renderable assignment panel used on the second page of the activity.
*
* @package mod_digitala
* @author Alanen, Tuomas; Erkkilä, Joona; Harjunpää, Topi; Heijala, Maikki.
* @copyright 2022 Helsingin Yliopisto
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class digitala_assignment implements renderable {
/**
* Constructor
* @param int $instanceid - Instance id of the activity
* @param int $contextid - Context id of the activity
* @param int $userid - Id of the current active user
* @param int $id - Id of the activity
* @param string $assignmenttext - Assignment text for the assignment
* @param string $resourcetext - Resource text for the assignment
* @param string $attempttype - Choice if the assignment is a readaloud or freeform type
* @param string $attemptlang - Choice if the assignment is for fi (Finnish) or sv (Swedish) performance
* @param int $maxlength - Maximum length of the recording in seconds, 0 = no limit
* @param int $attemptlimit - Number of attempts that a person can submit
*/
public function __construct($instanceid, $contextid, $userid, $id, $assignmenttext = '', $resourcetext = '',
$attempttype = '', $attemptlang = '', $maxlength = 0, $attemptlimit = 1) {
$this->instanceid = $instanceid;
$this->contextid = $contextid;
$this->id = $id;
$this->userid = $userid;
$this->assignmenttext = $assignmenttext;
$this->resourcetext = $resourcetext;
$this->attempttype = $attempttype;
$this->attemptlang = $attemptlang;
$this->maxlength = $maxlength;
$this->attemptlimit = $attemptlimit;
$this->form = new answerrecording_form();
if ($attempttype == 'readaloud') {
$this->servertext = format_string($resourcetext);
} else {
$this->servertext = format_string($assignmenttext);
}
}
}
/**
* Implements a renderable report panel used on the last page of the activity.
*
* @package mod_digitala
* @author Alanen, Tuomas; Erkkilä, Joona; Harjunpää, Topi; Heijala, Maikki.
* @copyright 2022 Helsingin Yliopisto
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class digitala_report implements renderable {
/**
* Constructor
* @param int $instanceid - Instance id of the activity
* @param int $contextid - Context id of the activity
* @param int $id - Id of the activity
* @param string $attempttype - Choice if the assignment is a readaloud or freeform type
* @param string $attemptlang - Choice if the assignment is for fi (Finnish) or sv (Swedish) performance
* @param int $attemptlimit - Number of attempts that a person can submit
* @param string $informationtext - More information text for the assignment
* @param int $student - User id of student
*/
public function __construct($instanceid, $contextid, $id, $attempttype = '', $attemptlang = '',
$attemptlimit = 1, $informationtext = '', $student = null) {
$this->instanceid = $instanceid;
$this->contextid = $contextid;
$this->id = $id;
$this->attempttype = $attempttype;
$this->attemptlang = $attemptlang;
$this->attemptlimit = $attemptlimit;
$this->informationtext = $informationtext;
$this->student = $student;
}
}
/**
* Implements a renderable short version of assignment panel used on the teacher detail report page.
*
* @package mod_digitala
* @author Alanen, Tuomas; Erkkilä, Joona; Harjunpää, Topi; Heijala, Maikki.
* @copyright 2022 Helsingin Yliopisto
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class digitala_short_assignment implements renderable {
/**
* Constructor
* @param int $contextid - Context id of the activity
* @param string $assignmenttext - Assignment text for the assignment
* @param string $resourcetext - Resource text for the assignment
* @param string $attempttype - Choice if the assignment is a readaloud or freeform type
* @param string $attemptlang - Choice if the assignment is for fi (Finnish) or sv (Swedish) performance
*/
public function __construct($contextid = 0, $assignmenttext = '', $resourcetext = '', $attempttype = '', $attemptlang = '') {
$this->contextid = $contextid;
$this->assignmenttext = $assignmenttext;
$this->resourcetext = $resourcetext;
$this->attempttype = $attempttype;
$this->attemptlang = $attemptlang;
}
}
/**
* Implements a renderable report editor for changing grading manually.
*
* @package mod_digitala
* @author Alanen, Tuomas; Erkkilä, Joona; Harjunpää, Topi; Heijala, Maikki.
* @copyright 2022 Helsingin Yliopisto
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class digitala_report_editor implements renderable {
/**
* Constructor
* @param int $instanceid - Instance id of the activity
* @param int $id - Id of the activity
* @param string $attempttype - Choice if the assignment is a readaloud or freeform type
* @param int $student - User id of student
*/
public function __construct($instanceid, $id, $attempttype = '', $student = null) {
$this->instanceid = $instanceid;
$this->id = $id;
$this->attempttype = $attempttype;
$this->student = $student;
}
}
/**
* Implements a renderable results view for the teacher.
*
* @package mod_digitala
* @author Alanen, Tuomas; Erkkilä, Joona; Harjunpää, Topi; Heijala, Maikki.
* @copyright 2022 Helsingin Yliopisto
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class digitala_results implements renderable {
/**
* Constructor
* @param int $instanceid - Instance id of the activity
* @param int $id - Id of the activity
*/
public function __construct($instanceid, $id) {
$this->instanceid = $instanceid;
$this->id = $id;
}
}
/**
* Implements a renderable delete view for deleting submission data.
*
* @package mod_digitala
* @author Alanen, Tuomas; Erkkilä, Joona; Harjunpää, Topi; Heijala, Maikki.
* @copyright 2022 Helsingin Yliopisto
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class digitala_delete implements renderable {
/**
* Constructor
* @param int $instanceid - Instance id of the activity
* @param int $contextid - Context id of the activity
* @param int $id - Id of the activity
* @param int $studentid - id of student
*/
public function __construct($instanceid, $contextid, $id, $studentid) {
$this->instanceid = $instanceid;
$this->contextid = $contextid;
$this->id = $id;
$this->studentid = $studentid;
}
}