forked from openedx-unsupported/edx-certificates
-
Notifications
You must be signed in to change notification settings - Fork 2
/
cert-data.yml
439 lines (430 loc) · 17 KB
/
cert-data.yml
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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
---
# The 4_programmatic certificate renderer uses a special markup language
#
# Flags:
# Font flags need four associated '.ttf' files in template_data/fonts in your templates directory.
# The ttf font family files need specific names. One file named
# font_name+'-'+$BASE+'.ttf',
# where $BASE can be 'Light' or 'Regular'. And three files named
# font_name+'-'+$TYPOGRAPHY+'.ttf',
# where $TYPOGRAPHY must be 'Bold', 'BoldItalic', and 'Italic'.
# A total of four are needed; All three typography files are needed.
# Default Font Flags
# font_name='OpenSans'
# font_type='Light'
# Font family files are
# OpenSans-Light.ttf
# OpenSans-Bold.ttf
# OpenSans-BoldItalic.ttf
# OpenSans-Italic.ttf
# Other typographys are allowed but gen_cert.py renderer would need to be updated.
#
# Currently Supported Elements:
# - rectangle:
# x <-- position of rectangle from left side of page (required)
# y <-- position of rectangle from bottom of page (required)
# width <-- width of rectangle (required)
# height <-- height of rectangle (required)
# stroke_width <-- thickness of rectangle border (optional, defaults to 1 if stroke_color set)
# stroke_color <-- color of rectangle border, as a hex value (optional, defaults to #000000 if stroke_width set)
# fill_color <-- color of rectangle fill, as a hex value (optional)
# - line:
# x_start <-- start point of line from left side of page (required)
# y_start <-- start point of line from bottom of page (required)
# x_end <-- end point of line from left side of page (required)
# y_end <-- end point of line from bottom of page (required)
# stroke_width <-- thickness of rectangle border (optional, default to 1 if stroke_color set)
# stroke_color <-- color of rectangle border, as a hex value (optional, defaults to #000000 if stroke_width set)
# - image:
# x <-- position of image from left side of page (required)
# y <-- position of image from bottom of page (required)
# width <-- width of rectangle (required)
# height <-- height of rectangle (required)
# file <-- path of file, relative to template_data directory (required)
# - text:
# x <-- position of text box from left side of page (required)
# y <-- position of text box from bottom of page (required)
# width <-- width of text box (required)
# height <-- height of text box (required)
# string <-- text to print on page (required)
# text_color <-- color of text (optional, defaults to #000000)
# font_size <-- size of text (optional, defaults to 12)
# leading <-- height of line spacing of text [ie. 2x font_size double space] (optional, defaults to 12)
# alignment <-- alignment of text [current options: left, right & center] (optional, defaults to left)
#
# Instructor Signature Block have some special logic:
# elements are placed relatively to the block itself and the previous element
#
# Currently Supported Elements with logic differences explained (anything not listed follows normal behavior):
# template:
# - line:
# x_start <-- required, relative to instructor block x
# y_start <-- required, relative to instructor block y
# x_end <-- required, relative to instructor block x
# y_end <-- required, relative to instructor block y
# - image:
# x <-- optional, relative to instructor block x
# y <-- optional, relative to instructor block y
# width <-- optional, defaults to physical image width
# height <-- not used, gets defined by width * aspect ratio of image
# file <-- optional, if set this overrides any key set
# key <-- key to use to get image file path from instructor attributes (required if file not set)
# - text:
# x <-- optional, relative to instructor block x
# y <-- optional, relative to instructor block y
# string <-- optional, if set this overrides any key set
# key <-- key to use to get string from instructor attributes (required if string not set)
# signature_y_offset <-- special y offset for image elements that use the 'signature_file' key
#
# All sizes (height, width, x/y coordinates, etc.) are in Points
#
# Subtemplates allow courses to have multiple certs based on user designation
# Add a 'subtemplates' dictionary to the desired course. The key value
# pairs in the dictionary should be 'designation': 'your subtemplate course id'
# Then setup 'your subtemplate course id' as a normal cert inheriting from
# the same default, adding in elements to override. The parent course is
# updated with the subtemplates changes.
### 4_programmatic Default course
Default/OpenEdX/Certificate: &certificate_defaults
VERSION: 4_programmatic
TEMPLATEFILE: False
font:
name: OpenSans
type: Light
certificate_theme:
# Ordered list of steps to render the certificate theme, back to front
# Typically these are instance wide and don't change from course to course
# (This usually include: Borders, Logos, Watermarks, Decorative Graphics, etc)
- rectangle:
# Outside border
x: 81
y: 54
width: 680
height: 488
stroke_width: 2
stroke_color: '#822638'
fill_color: '#DED9E0'
- rectangle:
# Inside border
x: 85
y: 58
width: 672
height: 480
stroke_width: 2
stroke_color: '#B5A3B8'
fill_color: '#FFFFFF'
- image:
# Institutional logo
x: 120
y: 485
width: 150
height: 30
file: 'images/openedx.png'
- text:
# Logo subheader
string: "<b>CERTIFICATE OF ACHIEVEMENT</b>"
font_size: 11
leading: 11
text_color: '#822638'
alignment: left
x: 121
y: 472
width: 150
height: 13
instructors:
# The default instructor signature block template
- instructor: &default_instructor
x: 475
y: 140
signature_file: 'images/test_signature.png'
template:
# Ordered list of steps to render an instructor signature block, bottom to top
# (each element is located relative to the previous one)
- text: &default_instructor_school
key: 'school_string'
font_size: 10
leading: 10
text_color: '#2E2E2E'
alignment: right
width: 250
height: 12
- text: &default_instructor_supplemental_title
key: 'supplemental_title_string'
font_size: 10
leading: 10
text_color: '#2E2E2E'
alignment: right
width: 250
height: 11
- text: &default_instructor_title
key: 'title_string'
font_size: 10
leading: 10
text_color: '#2E2E2E'
alignment: right
width: 250
height: 11
- text: &default_instructor_name
key: 'name_string'
font_size: 12
leading: 12
text_color: '#2E2E2E'
alignment: right
width: 250
height: 12
- line: &default_instructor_signature_line
x_start: 100
y_start: 0
x_end: 250
y_end: 0
stroke_color: '#2E2E2E'
stroke_width: .5
- image: &default_instructor_signature_image
key: 'signature_file'
width: 250
# Convenient instructor signature block positions
# ----------------------------------------------------
# | |
# | |
# | |
# | |
# | |
# | position_4 |
# | |
# | position_3 |
# | |
# | position_2 |
# | |
# | position_6 position_5 position_1 |
# | |
# | |
# | |
# ----------------------------------------------------
- instructor: &default_instructor_position_1
<<: *default_instructor
x: 475
y: 140
- instructor: &default_instructor_position_2
<<: *default_instructor
x: 475
y: 220
- instructor: &default_instructor_position_3
<<: *default_instructor
x: 475
y: 300
- instructor: &default_instructor_position_4
<<: *default_instructor
x: 475
y: 380
- instructor: &default_instructor_position_5
<<: *default_instructor
x: 275
y: 140
- instructor: &default_instructor_position_6
<<: *default_instructor
x: 75
y: 140
course_information:
# ordered list of steps to render the course information, top to bottom
#
# You can pass variables from the context into the stringslike this:
# string: "{VARIABLE_TO_PASS}"
#
# Variables that are currently available:
# date_string <-- Date to print on certificate
# student_name <-- Name of Student
# successfully_completed <-- Short 'has completed' text
# course_title <-- Title of Course
# achievements_string <-- Extra achievement string, i.e. 'Distinction'
# achievements_description_string <-- Description attached to extra achievement
# disclaimer_text <-- Legal Disclaimer
# verify_text <-- Verification link to GPG verification page on platform
#
- text:
string: "{date_string}"
font_size: 12
leading: 14
text_color: '#212438'
alignment: right
x: 120
y: 488
width: 600
height: 14
- text:
string: "<b>{student_name}</b>"
font_size: 42
leading: 51
text_color: '#212438'
alignment: left
x: 120
y: 409
width: 421
height: 51
auto_scale: True
- text:
string: "{successfully_completed}"
font_size: 14
leading: 18
text_color: '#212438'
alignment: left
x: 120
y: 390
width: 421
height: 18
- text:
string: "<b>{course_title}</b>"
font_size: 36
leading: 40
text_color: '#822638'
alignment: left
x: 120
y: 304
width: 421
height: 72
auto_scale: True
- text:
string: "{achievements_string}{achievements_description_string}"
font_size: 14
leading: 18
text_color: '#212438'
alignment: left
x: 120
y: 135
width: 421
height: 162
- text:
string: "{disclaimer_text}"
font_size: 7.5
leading: 10
text_color: '#212438'
alignment: left
x: 120
y: 89
width: 600
height: 30
- text:
string: "{verify_text}"
font_size: 7.5
leading: 10
text_color: '#212438'
alignment: left
x: 120
y: 70
width: 600
height: 10
edX/DemoX_v4/Demo_Course_v4:
<<: *certificate_defaults
instructors:
- instructor:
<<: *default_instructor_position_1
name_string: '<b>M. Guillaume Hébert</b>'
title_string: 'Head Concierge'
supplemental_title_string: 'Lifestyle Manager'
school_string: '<b>Great Bratislava Hotel</b>'
signature_file: 'images/test_signature.png'
signature_y_offset: -10
interstitial:
Pass: 'This student has passed this course. To pass, the student had to complete 10 assignments and one final exam, scoring at least 60% throughout.'
Distinction: 'This person is a complete overachiever! They passed the course with Distinction. To do so, they had to complete 10 assignments and one final exam, scoring at least 90% throughout.'
course-v1:edX+DemoX_v4+Custom_Instructor_Block_v4:
<<: *certificate_defaults
instructors:
- instructor:
<<: *default_instructor_position_5
x: 300
template:
- text:
<<: *default_instructor_name
font_size: 18
height: 18
leading: 18
alignment: center
text_color: '#822638'
- text:
<<: *default_instructor_supplemental_title
alignment: center
- text:
<<: *default_instructor_title
alignment: center
- text:
<<: *default_instructor_school
alignment: center
- line:
<<: *default_instructor_signature_line
x_start: 50
x_end: 200
- image:
<<: *default_instructor_signature_image
- invalid_element_type:
this: should be silently ignored
name_string: '<b>M. Guillaume Hébert</b>'
title_string: 'Head Concierge'
supplemental_title_string: 'Lifestyle Manager'
school_string: '<b>Great Bratislava Hotel</b>'
signature_file: 'images/test_signature_center.png'
signature_y_offset: -10
interstitial:
Pass: 'This student has passed this course. To pass, the student had to complete 10 assignments and one final exam, scoring at least 60% throughout.'
Distinction: 'This person is a complete overachiever! They passed the course with Distinction. To do so, they had to complete 10 assignments and one final exam, scoring at least 90% throughout.'
edX/DemoX_v4/Certificate_Flair_v4:
<<: *certificate_defaults
flair:
- image: &default_flair
x: 575
y: 325
width: 125
height: 125
file: 'images/test_flair.png'
Test/Designation/Titles:
<<: *certificate_defaults
designations:
'Title':
titles:
- MD
credits: 'The activity was designated for '
CREDITS: "23.50 <i>AMA PRA Category 1 Credits<super><font size=13>TM</font></super></i>."
translation/test/course:
<<: *certificate_defaults
interstitial:
Pass: 'Para recibir una declaración de cumplimiento, los participantes deberán obtener 70 o más, de los 100 puntos posibles, en los exámenes en línea.'
Distinctión: 'Para recibir una declaración de cumplimiento con distinctión, los participantes deberán obtener 90 o más, de los 100 puntos posibles, en los exámenes en línea.'
locale: 'es_419'
translations:
es_419:
success_text: 'ha completado exitosamente el curso gratuito en línea '
grade_interstitial: "con {grade}."
disclaimer_text: '<b>ATENCIÓN:</b> ALGUNOS DE LOS CURSOS EN LÍNEA PODRÍAN USAR CONTENIDO DE LOS CURSOS REGULARES DE STANFORD UNIVERSITY PERO ESTO NO INDICA QUE SON EQUIVALENTES. ESTA DECLARACIÓN NO AFIRMA DE NINGUNA MANERA QUE EL PARTICIPANTE HA SIDO MATRICULADO COMO ESTUDIANTE REGULAR DE STANFORD UNIVERSITY. TAMPOCO CONFIERE NINGUNA CALIFICACIÓN, CRÉDITO DEL CURSO, O GRADO ACADÉMICO DE STANFORD UNIVERSITY, NI CONFIRMA LA IDENTIDAD DEL PARTICIPANTE.'
verify_text: 'La autenticidad se puede confirmar en {verify_link}'
Test/Subtemplates/ByDesignations:
<<: *certificate_defaults
subtemplates:
FACULTY: Test/Subtemplates/ByDesignations_FACULTY
STAFF: Test/Subtemplates/ByDesignations_STAFF
Test/Subtemplates/ByDesignations_FACULTY:
<<: *certificate_defaults
interstitial:
Pass: 'Faculty Pass Text'
Distinction: 'Faculty Distinction Text'
instructors:
- instructor:
<<: *default_instructor_position_1
name_string: '<b>M. Guillaume Hébert</b>'
title_string: 'Head Concierge'
supplemental_title_string: 'Lifestyle Manager'
school_string: '<b>Great Bratislava Hotel</b>'
signature_file: 'images/test_signature.png'
signature_y_offset: -10
Test/Subtemplates/ByDesignations_STAFF:
<<: *certificate_defaults
interstitial:
Pass: 'Staff Pass Text'
Distinction: 'Staff Distinction Text'
instructors:
- instructor:
<<: *default_instructor_position_1
name_string: '<b>M. Guillaume Hébert II</b>'
title_string: 'Asst. Concierge'
supplemental_title_string: 'Lifestyle Manager in training'
school_string: '<b>Great Bratislava Hotel</b>'
signature_file: 'images/test_signature.png'
signature_y_offset: -10