[FIXED] Docebo Test Time Left (Time Format Change)

Third party modules, patches, bugfixes
Post Reply
User avatar
murat
FormaLms Expert
Posts: 104
Joined: Fri Oct 12, 2012 6:28 pm
Version: forma.lms 1.4

[FIXED] Docebo Test Time Left (Time Format Change)

Post by murat » Thu Oct 24, 2013 6:21 pm

Hi,

I want to docebo 4.05 test time left format change.
Example:
Language English when test question time is 1h 34m 34s

But language is Turkish or other when test question time is 1h 34m 34 s

normally turkish time format must be 1s 34dk 34s

How to change time format for test

Solution:

You must found do.test.php file (/doceboLms/modules/test/do.test.php)

After change ,
# 568 rows (this file)

Code: Select all

 .elem.innerHTML = minute + ' m ' + second  + '  s';  
Write what you want instead (m and s)
Example,
Turkish version:

Code: Select all

 .elem.innerHTML = minute + ' dk ' + second  + '  saniye '; // Change on the language 
Attachments
test_time_left_format.jpg
Test time life format change
test_time_left_format.jpg (21.47 KiB) Viewed 62 times

User avatar
max
FormaLms Guru
Posts: 1783
Joined: Thu Mar 01, 2012 10:41 am

Re: [FIXED] Docebo Test Time Left (Time Format Change)

Post by max » Fri Oct 25, 2013 6:06 pm

Thank you Murat for looking into this issue, I think it will be very useful for all the users with the same language needs as you have.
---------------------
Massimiliano Ferrari
Elearnit - Elearning e Knowledge Management
http://www.elearnit.net
http://www.linkedin.com/in/massimilianoferrari
m.ferrari[at]elearnit.net
http://elearnit.wordpress.com
Skype: m_ferrari_it

User avatar
murat
FormaLms Expert
Posts: 104
Joined: Fri Oct 12, 2012 6:28 pm
Version: forma.lms 1.4

Re: [FIXED] Docebo Test Time Left (Time Format Change)

Post by murat » Fri Oct 25, 2013 8:42 pm

The new update for code :)

Change the old code with this new code

Code: Select all

.elem.innerHTML = minute + ' ".$lang->def('_MINUTE')." ' + second  + ' ".$lang->def('_SECOND')."'; 

After, save to your own language. (_MINUTE' and _SECOND)

With this change, the "time left (for test)" was translated into all languages​​.

nangi
Newbie
Posts: 12
Joined: Wed Jul 03, 2013 1:06 pm

Re: [FIXED] Docebo Test Time Left (Time Format Change)

Post by nangi » Fri Nov 22, 2013 1:10 am

well how can we modfy/change the total time to other languages it shown as 2h 20m and want this shown as 2 sa. 20 dk.
I've attached the screenshot of the total time on the left collobration section.
Attachments
collabration.png
collabration.png (12.88 KiB) Viewed 49 times

User avatar
murat
FormaLms Expert
Posts: 104
Joined: Fri Oct 12, 2012 6:28 pm
Version: forma.lms 1.4

Re: [FIXED] Docebo Test Time Left (Time Format Change)

Post by murat » Wed Nov 27, 2013 1:46 am

nangi wrote:well how can we modfy/change the total time to other languages it shown as 2h 20m and want this shown as 2 sa. 20 dk.
I've attached the screenshot of the total time on the left collobration section.

Hi,

You must open "doceboLms/menu/menu_lat.php' file.

After change this codes:

(line 150)

Code: Select all

	$partial_time = ( $hours != 0 ? $hours.'h ' : '' ).$minutes.'m ';//.$seconds.'s '; 
(line 157)

Code: Select all

	$tot_time = ( $hours != 0 ? $hours.'h ' : '' ).$minutes.'m ';//.$seconds.'s '; 
with codes;

For one language

(line 150)

Code: Select all

	$partial_time = ( $hours != 0 ? $hours.'s ' : '' ).$minutes.'dk ';//.$seconds.'sn '; 
(line 157)

Code: Select all

	$tot_time = ( $hours != 0 ? $hours.'s ' : '' ).$minutes.'dk ';//.$seconds.'sn '; 
or

You can want to multi languages;

(line 150)

Code: Select all

	$partial_time = ( $hours != 0 ? $hours.''.Lang::t('_HOURS', 'time').'' : '' ).$minutes.''.Lang::t('_MINUTE', 'time').' ';//.$seconds.''.Lang::t('_SECOND', 'time').' '; 
(line 157)

Code: Select all

	$tot_time = ( $hours != 0 ? $hours.''.Lang::t('_HOURS', 'time').' ' : '' ).$minutes.''.Lang::t('_MINUTE', 'time').' ';//.$seconds.''.Lang::t('_SECOND', 'time').' '; 
Do not forget to add it to the language settings

Code: Select all

example add , language setting.
Modul: time 
LANG_KEY: _MINUTE
DESCRIPTION: dk
if you want to "second" time
You delete this code

Code: Select all

;//
example;

Code: Select all

(line 157)	[code]	$tot_time = ( $hours != 0 ? $hours.'s ' : '' ).$minutes.'dk '.$seconds.'sn '; 
Attachments
collabration.png
finally , time setting :)
collabration.png (15.01 KiB) Viewed 36 times

Post Reply