Questionnaire Report - problem with timestamp

Questionnaire Report - problem with timestamp

by Barbara Braun -
Number of replies: 6

Hi there -

I'm struggling finding an answer to this - when I download a questionnaire report in text-format I do get the right submission date if my user is using English as preferred language:

english

Same questionnaire report if i switch to German

german

So somehow the linux timestamp of the db is converted diffently. But where? Any help or ideas welcome! (Moodle 2.5.3  - Questionnaire Module 2.5.7)

Thanks you

Barbara

Average of ratings: -
In reply to Barbara Braun

Re: Questionnaire Report - problem with timestamp

by Jenny Gray -

I don't know the answer immediately.  Date format usually comes from the language pack. 

What software are you opening the downloaded report in?  Do the submission dates in German look correct when you view the report in Moodle?  Do you see the same problem if you download reports from other activities (forum or activity logs perhaps) in the same way?

In reply to Jenny Gray

Re: Questionnaire Report - problem with timestamp

by Barbara Braun -

Thanks for answering so quickly.

I opended the download in a plain editor (as well as in MS Excel to get the screenshots). We want to process the files in SPSS. In Moodle itself the submission dates are correctly displayed - it's the report. Other downloads (I tested quiz and activity log files) don't seem to be affected.

 

In reply to Barbara Braun

Re: Questionnaire Report - problem with timestamp

by Jenny Gray -

I think the culprit is

            $submitted = date(get_string('strfdateformatcsv', 'questionnaire'), $record->submitted);

I don't have the german language pack but I would guess that the format specified by strfdateformatcsv is different than date formats specified elsewhere.

I have a vague memory that there was a problem with date formats and that we had to change something?  Joseph may remember.

In the English language pack, onscreen dates use the format specified by strfdate as %d/%m/%Y and the download format is d/m/Y H:i:s.

If you need a quick fix, try changing your german language strings to match these and see if the problem goes away.  I'm not sure who the german language pack maintainer is, but we'll need their help to resolve this completely.

Average of ratings: Useful (1)
In reply to Barbara Braun

Re: Questionnaire Report - problem with timestamp

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Barbara,

The problem arises from a very outdated translation of the 'strfdateformatcsv' string in questionnaire German lang file.

It was translated as $string['strfdateformatcsv'] = 't.m.j h:m:s'; but it should be $string['strfdateformatcsv'] = 'd/m/Y H:i:s';

I have now fixed this in the AMOS translation and, once it is approved by the German language pack maintainer, it will be available if you update your Moodle German language pack.

However, if you want to do it urgently yourself, all you have to do is edit your moodledata/lang/de/questionnaire.php file and make the change yourself. Don't forget to empty all your moodle caches after that.

Joseph

PS.- Barbara, if you (or any German speaker using Questionnaire) want to contribute to the German translation of Questionnaire, there are currently 79 missing strings in version for Moodle 2.5!

In reply to Joseph Rézeau

Re: Questionnaire Report - problem with timestamp

by Barbara Braun -

Thank you - it works. And I will contribute via AMOS to the German Translation. Just registered.