/
index.php
256 lines (241 loc) · 10.9 KB
/
index.php
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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<?php
//common environment attributes including search paths. not specific to Learnosity
include_once '../../env_config.php';
//site scaffolding
include_once 'includes/header.php';
//common Learnosity config elements including API version control vars
include_once '../../lrn_config.php';
use LearnositySdk\Request\Init;
use LearnositySdk\Utils\Uuid;
$security = array(
'consumer_key' => $consumer_key,
'domain' => $domain
);
$session_id = Uuid::generate();
$request = array(
'user_id' => 'demo_student',
'rendering_type' => 'assess',
'name' => 'Learnosity Spanish Demo',
'state' => 'initial',
'activity_id' => 'spanish-demo',
'session_id' => $session_id,
'type' => 'submit_practice',
'assess_inline' => true,
'items' => [
[
'id' => Uuid::generate(),
'reference' => 'LEAR_222416777787000072'
],
[
'id' => Uuid::generate(),
'reference' => 'LEAR_222416777787000078'
],
[
'id' => Uuid::generate(),
'reference' => 'LEAR_222416777787000080'
],
[
'id' => Uuid::generate(),
'reference' => 'LEAR_222416777787000079'
],
[
'id' => Uuid::generate(),
'reference' => 'LEAR_222416777787000074'
],
[
'id' => Uuid::generate(),
'reference' => 'LEAR_222416777787000081'
],
[
'id' => Uuid::generate(),
'reference' => 'LEAR_222416777787000082'
],
[
'id' => Uuid::generate(),
'reference' => 'LEAR_222416777787000085'
],
[
'id' => Uuid::generate(),
'reference' => 'LEAR_99455450458884454545539'
]
],
'config' => array(
'navigation' => array(
'show_accessibility' => array(
'show_colourscheme' => true,
'show_fontsize' => true,
'show_zoom' => true
),
'scroll_to_top' => false,
'scroll_to_test' => false,
'show_configuration' => false,
'show_fullscreencontrol' => true,
'show_progress' => true,
'show_submit' => true,
'show_calculator' => false,
'show_itemcount' => true,
'skip_submit_confirmation' => true,
'warning_on_change' => false,
'scrolling_indicator' => false,
'show_answermasking' => true,
'show_acknowledgements' => true
),
'ui_style' => 'main',
'configuration' => array(
'lazyload' => false,
'onsubmit_redirect_url' => 'report.php?session_id=' . $session_id
),
'time' => array(
'show_time' => true,
'show_pause' => true,
'max_time' => 1500,
'warning_time' => 10,
'limit_type' => 'soft'
),
'title' => 'Learnosity demo en Español',
'subtitle' => 'Juan Perez',
'labelBundle' => array(
'actionsave' => 'guardar',
'actionsubmit' => 'enviar',
'allQuestionsAttempted' => 'Todas las preguntas fueron contestadas.',
'calculator' => 'Calculadora',
'close' => 'Cerrar',
'configuration' => 'Configuración',
'confirm' => 'Aceptar',
'continue' => 'Continuar',
'decline' => 'Cancelar',
'elapsedTime' => 'Tiempo transcurrido',
'error' => 'Error',
'fullScreen' => 'Pantalla completa',
'idleCancelButton' => 'Sí, quiero continuar!',
'idleHeadingMsg' => '¿Sigues ahí?',
'idleQuitButton' => 'Salir',
'introItemMessage' => 'Por favor presione <b>Comenzar</b> cuando este listo para empezar la actividad.',
'item' => 'Pregunta',
'itemCountOf' => 'de',
'loading' => 'Cargando',
'nextButtonLabel' => 'Siguiente',
'pause' => 'Pausa',
'previousButtonLabel' => 'Anterior',
'questionHeader' => 'Pregunta',
'quit' => 'Salir',
'retry' => 'Reintentar',
'save' => 'Guardar',
'saveButtonLabel' => 'Guardar',
'saveError' => 'Error al guardar.',
'saveInProgress' => 'Guardando...',
'saving' => 'guardando',
'startTest' => 'Comenzar',
'submit' => 'Enviar',
'submitButtonLabel' => 'Finalizar',
'submitComplete' => 'Enviado',
'submittingInProgress' => 'Enviando...',
'submitting' => 'enviando',
'test' => 'actividad',
'testPaused' => 'Actividad detenida',
'tryAgain' => 'Vuelva a intentar',
'idleSaveError' => 'Se produjo un error al guardar la actividad.',
'errorOccurredWhile' => 'Se ha producido un error',
'submitFailed' => 'Su actividad no pudo ser guardada, posiblemente debido a un error de red.',
'submitWarningMsg' => 'Su actividad ha sido guardada y enviada por un administrador y finalizará en ',
'submitFailedWithOnlyAccessRawDataOption' => 'Tiene la opción de intentar de nuevo o acceder a una copia de su actividad y enviársela a un administrador.',
'submitFailedWithOtherOptions' => 'Tiene la opción de intentar de nuevo o acceder a una copia de su actividad y enviársela a un administrador.',
'actionDownloadAsFile' => 'Descargar como un archivo.',
'actionSendEmail' => 'Enviar un email',
'actionAccessRawData' => 'Acceder a los datos de la actividad.',
'warningOnChangeCancelButton' => 'Cancelar',
'warningOnChangeContinueButton' => 'Continar',
'answerMasking' => 'Enmascarar respuestas',
'accessibility' => 'Accesibilidad',
// ACCESSIBILITY PANEL
'accessibilityPanel' => 'Opciones de Accesibilidad',
'colorScheme' => 'Esquema de color',
'fontSize' => 'Tamaño de fuente',
'zoom' => 'Zoom',
'paletteInstructions' => 'Haga Click en el esquema de color siguiente para cambiar el color',
'blackOnWhite' => 'Negro sobre blanco (predeterminado)',
'purpleOnGreen' => 'Purpura sobre verde claro',
'yellowOnBlue' => 'Amarillo sobre azul',
'blackOnRose' => 'Negro sobre rosa',
'greyOnGrey' => 'Gris medio sobre gris claro',
'whiteOnBlack' => 'Blanco sobre negro',
'customColorPalette' => 'Personalizar esquema',
'fontSizeInstructions' => 'Para ajustar el tamaño de fuente seleccione una opción de la siguiente lista.',
'small' => 'Chica',
'normal' => 'Normal',
'large' => 'Grande',
'xlarge' => 'X Grande',
'xxlarge' => 'XX Grande',
'zoomInstructions' => 'Puede acercarse o alejarse usando los siguientes atajos en el teclado =>',
'command' => 'cmd',
'control' => 'ctrl',
'zoomIn' => 'Acercarse',
'zoomOut' => 'Alejarse',
'returnZoom' => 'Volver al zoom original',
'toZoomIn' => 'Para acercarse presione',
'toZoomOut' => 'Para alejarse presione',
'toReturnZoom' => 'La forma mas rápida de volver el navegador al zoom oringinal es presionando',
'plus' => '+',
'minus' => '-',
'zero' => '0',
'zoomInResult' => 'El navegador aumentará el zoom cuando presione la tecla de suma (+).',
'zoomOutResult' => 'El navegador disminuirá el zoom cuando presione la tecla de restar (-).',
'collapseMenu' => 'Menú desplegable',
'submitActionConfirmation' => 'Está seguro que desea finalizar la actividad?',
'submitWithUnattemptedQuestion' => '{{unattemptedResponsesCount}} pregunta no tiene respuestas. Está seguro que desea finalizar la actividad?',
'submitWithUnattemptedQuestions' => '{{unattemptedResponsesCount}} preguntas no tienen respuestas. Está seguro que desea finalizar la actividad?',
'isAllResponsesAttempted' => '{{allQuestionsAttempted}}. Está seguro que desea finalizar la actividad?',
'existingResponsesTitle' => 'Se encontraron respuestas existentes.',
'existingResponsesMessage' => 'Esta actividad ya fue resuelta.',
'existingResponsesDetail' => 'Por favor refresque la pagina para iniciar una nueva actividad.',
'questionsApiLabelBundle' => array(
'word' => 'Palabra',
'wordLength' => 'Límite de palabras',
'editorBoldIcon' => 'N',
'editorBoldTitle' => 'Negrita',
'editorItalicsIcon' => 'K',
'editorItalicsTitle' => 'Cursiva',
'editorUnderlineIcon' => 'S',
'editorUnderlineTitle' => 'Subrayado',
'graphingTools' => [
'parabola' => 'Parábola'
],
'reset' => 'Reiniciar',
'undo' => 'Deshacer',
'redo' => 'Rehacer'
)
),
'questions_api_init_options' => [
'beta_flags' => [
'reactive_views' => true
]
]
)
);
$Init = new Init('items', $security, $consumer_secret, $request);
$signedRequest = $Init->generate();
?>
<div class="jumbotron section">
<div class="toolbar">
<ul class="list-inline">
<li data-toggle="tooltip" data-original-title="Preview API Initialisation Object"><a href="#" data-toggle="modal" data-target="#initialisation-preview" aria-label="Preview API Initialisation Object"><span class="glyphicon glyphicon-search"></span></a></li>
<li data-toggle="tooltip" data-original-title="Visit the documentation"><a href="https://support.learnosity.com/hc/en-us/articles/360000758697-Internationalizing-and-Localizing-the-Assessment-Experience" title="Documentation"><span class="glyphicon glyphicon-book"></span></a></li>
</ul>
</div>
<div class="overview">
<h1>Spanish Demo</h1>
<p>This demostrates the Learnosity approach to internationalisation of labels and text rendered by the API UI.</p>
<p>The demo starts with an assessment rendered through Items API (assess) and then the responses review using Reports API. Everything is localised to the Spanish language using label bundles.</p>
</div>
</div>
<div class="section">
<!-- Container for the items api to load into -->
<div id="learnosity_assess"></div>
</div>
<script src="<?php echo $url_items; ?>"></script>
<script>
var itemsApp = LearnosityItems.init(<?php echo $signedRequest; ?>);
</script>
<?php
include_once 'views/modals/initialisation-preview.php';
include_once 'includes/footer.php';