Page tree
Skip to end of metadata
Go to start of metadata

All Time Spent Learning data in your Moodle and Totara databases is stored as seconds. In order to create reader-friendly reports, it will likely be essential to create a calculated field that converts raw seconds to the “HH:MM:SS” (hours-minutes-seconds) format that we are used to reading. 

Using the New Calculated Measure window in the Ad Hoc Editor, you can create a calculated measure to convert field data stored in raw seconds to regular time. For the purposes of this case study, we will convert the mdl_local_id_course.totaldedication field to a regular time format.
 

This walkthrough assumes that you have opened a new Ad Hoc View in the Ad Hoc Editor from the Course Dedication Domain.

  1.   In the Measures panel of the Ad Hoc Editor , hover over the title bar menu 
     


  2.   Select Create Calculated Measure. The New Calculated Measure window opens: 



     

  3. In the Measure Name field, enter a name for your new calculated measure. We will call our new measure “Total Time Spent.”  

  4.   From the Functions list, double-click the FormatTime function. “FormatTime("NumberFieldName")” appears in the Formula box. 

  5.   In the Formula box, highlight the text “NumberFieldName” as shown: 



     

  6. From the  Fields and Measures list, find and double-click the measure  Course Total Dedication. The name of this measure will replace the highlighted text in the formula box."Course Total Dedication" is the defined display label for mdl_local_id_course.totaldedication in the Course Dedication Domain.  

  7. When creating calculated measures, you should always click the  Validate button to ensure your field is logical and operative. If no errors are discovered, the following success message will appear next to the button of the  New Calculated Measure window: 

  8. Click the  Create Measure button to add the new calculated measure to the  Measures panel in the  Ad Hoc Editor. "Total Time Spent" now appears in the  Measures list, and can be added to the Ad Hoc View in the same manner as any other measure or field: 

  • No labels