Exporting SCORM reports into Excel

Exporting SCORM reports into Excel

by Chris Shott -
Number of replies: 23

Hello,

This is my first post, so apologies if I am in the wrong forum or this topic has already been raised, I have searched extensively and cannot find an existing problem similar to my own.

My system specifications are: Moodle version 1.9.3, server operating system - Windows Server 2003 64-bit, Web server - IIS 6, PHP 5.2.8, MS SQL 2005.

I am fairly new to Moodle and have been getting to grips with it over the past 2 weeks.  I am trying to develop it as an LMS for a client.  The only problem I am having is when trying to export the SCORM reports after a student has completed an activity.

The SCORM reports generate fine and I can view these by selecting the students profile/Activity report/Complete Report.  My query is, is there a way to export these reports into excel format?  The final product will have around 100 - 200 students completing activities and I would like it setup so that the admin can pull information out of Moodle showing what activities a student has attempted, results, times, individual selections and more, on a question by question basis.  As far as I can tell all this information is available in a SCORM report, but there is no easy way to view/export this information in the current Moodle core.

Ideally I would like to be able to export this information for a select group of users/students, not just on a user by user basis, as this could be quite time consuming for the admin.

Is this possible in the current Moodle version?  If not is there a plug-in that anyone knows of that could resolve this issue or has a request been logged on the Moodle Tracker?

Again apologies if this issue has already been raised, any help that you could offer would be greatly appreciated.

Cheers

Average of ratings: -
In reply to Chris Shott

Re: Exporting SCORM reports into Excel

by Ron Meske -
Picture of Particularly helpful Moodlers
The current SCORM reports do need a lot of work. There has been quite a few discussions about the need to improve them, including by myself. Each time we think we will have some time to take a look at how reports are created in Moodle to build a SCORM specific report for the Gradebook, we get busy again.

The reality is, unless someone steps forward to fund this type of project I don't think the developers will have it as a priority.
In reply to Ron Meske

Re: Exporting SCORM reports into Excel

by Piers Harding -
Hi Ron - one thing that I have been experimenting with in the last few weeks is Pentaho and Mondrian BI reporting.

This allows flexible multi-dimensional reporting, that can be presented in pivot tables.

As a strategy, I think this actually suits Moodle SCORM reporting quite well as SCORM reporting requirements are quite hard to predict.

What I would like from experienced users, is a description of the most useful, common information that is required (and not currently available), in terms of user/scorm/sco attributes, and tracking data. Also, some thought on what kinds of views would be required such as reporting by time, or attempts, summaries etc.

I'd like to create a package of sample reports, to release, and get feedback on the usefulness of this as a strategy.

This is in some ways aligned with a existing suggestion for Moodle reporting using Jasper Reports - which is one of the rendering engines that Pentaho uses.

Cheers,
Piers Harding.
Average of ratings: Useful (1)
In reply to Piers Harding

Re: Exporting SCORM reports into Excel

by Ron Meske -
Picture of Particularly helpful Moodlers
Here are the scenarios that our clients most often want:

  1. For a given course(s), list all learners that have not started, completed, or passed it
  2. For a given course(s), list all learners that have completed or passed it
  3. For a given course(s), list all learners with a score above or below a given score
  4. For a given course(s), list all learners over a given number of attempts
  5. For a given learner(s), list all courses that have not been started, completed, or passed
  6. For a given learner(s), list all courses that have been completed or passed
  7. For a given learner(s), list all courses showing current status, attempts, score and time

The above reports will be typically need to be filtered on a date range. This will also allow for checking on annual recertification, answering the question who has/has not completed the required course(s). This is one of the reasons it is so critical to have an accurate start date for course.

When it comes to more detailed reporting, most typically our clients want to see:

  1. For a given course(s), list by learner the individual SCO's that make up a course, showing status, attempts, score, and time
  2. For a given learner(s), list by course the individual SCO's that make up a course, showing status, attempts, score, and time
  3. For a given course(s), list by SCO then learner, the objectives with status and score

In retail, there is a need to track training time and to produce reports showing by learner how much time was spent in each course and a total training time. The reason, they can get a tax credit based off of the amount of training time compared to payroll hours. This may also be used in other industries, we just haven't encountered it anywhere but in retail.

All above reports would contain some basic data:

  • Course Name
  • Course ID
  • Learner Name
  • Learner ID
  • Start date
  • Completion date
  • Last access date

In the corporate environment, there is typically a need to group the learners into departments and job categories and generate reports based on those either by filtering the data or grouping the data. So those fields would need also be included in the basic data.

Occasionally, our clients have wanted to see reports that showed a learners response to every question along with the correct response. In commercial LMS's the way that this is usually handled as a report is from a generic export that contains the basic data plus status, time, score, attempts, and then allow the addition of custom fields allowing the selection/entry of any SCORM defined data field.

We typically find that it is better to have a few standard reports and then give the user the ability to create their own custom report instead of anticipating every scenario.

I look forward to seeing your sample reports.

Ron
Average of ratings: Useful (1)
In reply to Ron Meske

Re: Exporting SCORM reports into Excel

by Chris Shott -

Hi Ron,

What you have described is exactly what I am looking for too.  I think if this level of reporting can be achieved and implemented into the core Moodle environment it would really help corporate/commercial users get the most out of Moodle.  I will also look forward to your sample reports Piers.

Thanks for your replies,

Chris

In reply to Chris Shott

Re: Exporting SCORM reports into Excel

by Piers Harding -
Ron/Chris - thanks for your responses.

I'll have to do this in stages I think. I will post back here as I get some results.

Cheers,
Piers Harding.
In reply to Piers Harding

Re: Exporting SCORM reports into Excel

by Marco Loche -
Hi guys,

the Ron's post is quite complete and meets our needs too.

As posted in previous discussion on same topics, I'm always available for developing, testing or helping...

read you soon

Ciao

Marco

In reply to Piers Harding

Re: Exporting SCORM reports into Excel

by Ron Meske -
Picture of Particularly helpful Moodlers

Hi Piers,

Have you been able to get back to this?  At a minimum we need to get the SCO last access date and status into the Export report. 

Perhaps just point us to the query's that create the current Export report and they can be modified to include additional columns of data?

Thanks,

Ron

In reply to Ron Meske

Re: Exporting SCORM reports into Excel

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Hi Ron,

There's some improved Reporting that is currently being tested in 2.0 - thanks to Valerian for the work! - it provides a much improved report interface and export to excel.

There's also a SCORM Report plugin that Kineo developed in the tracker here that you might find useful: CONTRIB-1394
In reply to Dan Marsden

Re: Exporting SCORM reports into Excel

by Ron Meske -
Picture of Particularly helpful Moodlers

Hi Dan,

Thank you for pointing out the report Kineo developed. It is close to what our clients have been looking for.  However, a major missing element is completion date.  Will this be in the 2.0 reports?

In reply to Ron Meske

Re: Exporting SCORM reports into Excel

by Darin Sharp -
This is what I am trying to do as well, any luck so far? Also people talk about financing being needed to move things along, what kind of money would it take to get this done?
In reply to Ron Meske

Re: Exporting SCORM reports into Excel

by Darin Sharp -
I only need this posted to the screen if anyone could point me in a good direction to start from it would be great.
In reply to Darin Sharp

Re: Exporting SCORM reports into Exc

by Dorel Manolescu -
Picture of Plugin developers

Hi,

I have the same issue. I need to export scorm reports as Excel files. So I tried to modify a little the scorm module code in order to obtain this functionality. So if someone can take a look at my code and work together maybe we can obtain a good result.

So I started adding an extra option in the drop down menu of the scorm report ( export excel) :

>>> Picture

For that I modified this line (+ / - 215 ) :

$options = array('delete' => get_string('delete'), 'exportexcel' => get_string('exportexcel','scorm'));

and the scorm language file.

Then under the piece of code:

if ($action == 'delete' && has_capability('mod/scorm:deleteresponses',$contextmodule)) {

if (scorm_delete_responses($attemptids, $scorm->id)) { //delete responses.

notify(get_string('scormresponsedeleted', 'scorm'), 'notifysuccess');

}

}

I added:

if ($action == ' exportexcel ' && has_capability('mod/scorm:….',$contextmodule)) {

scorm_download_score($scorm,$scorm->name, $scorm->id,$scorm->course);

exit();

}

So we have this new function scorm_download_score() which I placed in the scorm/lib.php file . I tried to implement this function like the developers did in the facetoface module where there is also an excel exporting feature.

function scorm_download_score($scormul,$scormname,$scormid,$scormcourse) {

global $CFG;

$timenow = time();

$timeformat = str_replace(' ', '_', get_string('strftimedate'));

$downloadfilename = clean_filename($scormname.'_'.userdate($timenow, $timeformat));

require_once $CFG->dirroot.'/grade/lib.php';

$userfields = array();

if (function_exists('grade_export_user_fields')) {

$userfields = grade_export_user_fields();

// echo ("exista grade_export_user_fields");

}

else {

// echo ("NUUUUUUUUUUUUUU exista grade_export_user_fields");

// Set default fields if the grade export patch is not

// detected (see MDL-17346)

$fieldnames = array('firstname', 'lastname', 'email', 'city',

'idnumber', 'institution', 'department', 'address');

foreach ($fieldnames as $shortname) {

$field = new object();

$field->shortname = $shortname;

$field->fullname = get_string($shortname);

// echo $field->fullname;

$userfields[] = $field;

//print_r($field);

// print_r($userfields[0]);

}

}

require_once($CFG->dirroot.'/lib/excellib.class.php');

echo " s a efectuat cererea de xcel";

$downloadfilename .= '.xls';

$workbook = new MoodleExcelWorkbook('-');

echo " s a creat xcelul";

$workbook->send($downloadfilename);

echo " s a trimis xcelul";

$worksheet =& $workbook->add_worksheet('score');

$pos=0;

$worksheet->write_string(0,$pos++,get_string('scormid', 'scorm'));

$worksheet->write_string(0,$pos++,get_string('scormname', 'scorm'));

$worksheet->write_string(0,$pos++,get_string('scormcourse', 'scorm'));

$worksheet->write_string(0,$pos++,get_string('started', 'scorm'));

$worksheet->write_string(0,$pos++,get_string('last', 'scorm'));

foreach ($userfields as $field) {

$worksheet->write_string(0,$pos++,$field->fullname);

}

$worksheet->write_string(0,$pos++,get_string('score', 'scorm'));

if (!empty($CFG->enablegroupings) && !empty($cm->groupingid)) {

//echo "intra pe gruping" ;

$sql = "SELECT st.userid, st.scormid

FROM {$CFG->prefix}scorm_scoes_track st

INNER JOIN {$CFG->prefix}groups_members gm ON st.userid = gm.userid

INNER JOIN {$CFG->prefix}groupings_groups gg ON gm.groupid = gg.groupid

WHERE st.scormid = {$scorm->id} AND gg.groupingid = {$cm->groupingid}

GROUP BY st.userid,st.scormid

";

} else {

// echo "NUUUUUUUUUUUUUUUUUUUUUUU intra pe gruping" ;

$sql = "SELECT st.userid, st.scormid

FROM {$CFG->prefix}scorm_scoes_track st

WHERE st.scormid = $scormid

GROUP BY st.userid,st.scormid

";

//print_r($sql);

}

$scousers=get_records_sql($sql);

//print_r($scousers);

$i = 0;

if (!empty($scousers)) {

foreach ($scousers as $scouser) {

$attempt = scorm_get_last_attempt($scormid,$scouser->userid);

// $selectsc = 'scormid = '.$scormid.' and userid = '.$scouser->userid.' and attempt = '.$a;

$selectsc = 'scormid = '.$scormid.' and userid = '.$scouser->userid.' and attempt = '.'1';

$timetracks = get_record_select('scorm_scoes_track', $selectsc,'min(timemodified) as started, max(timemodified) as last');

$userdata = scorm_get_user_data($scouser->userid);

$studentsc = get_complete_user_data('id',$scouser->userid);

//print_r($userdata);

// print_r($studentsc);

if (!empty($studentsc)) {

$i++; $j=0;

$worksheet->write_string($i,$j++,$scormid);

$worksheet->write_string($i,$j++,$scormname);

$worksheet->write_string($i,$j++,$scormcourse);

$worksheet->write_string($i,$j++,userdate($timetracks->started, get_string('strftimedaydatetime')));

$worksheet->write_string($i,$j++,userdate($timetracks->last, get_string('strftimedaydatetime')));

foreach ($userfields as $field) {

$worksheet->write_string($i,$j++,$studentsc->{$field->shortname});

}

$worksheet->write_string($i,$j++,scorm_grade_user_attempt($scormul, $scouser->userid, 1));

// $scoruldinsange= scorm_grade_user_attempt($scormul, $scouser->userid, 1);

// echo $scoruldinsange;

// echo "scorul din sange" ;

}

}

}

else {

// no one has accessed the scorm, so let's just print the basic info

$i++; $j=0;

$worksheet->write_string($i,$j++,$scormid);

$worksheet->write_string($i,$j++,$scormname);

$worksheet->write_string($i,$j++,$scormcourse);

$worksheet->write_string($i,$j++,userdate($timetracks->started, get_string('strftimedaydatetime')));

$worksheet->write_string($i,$j++,userdate($timetracks->last, get_string('strftimedaydatetime')));

$worksheet->write_string($i,$j++,$scormid);

foreach ($userfields as $field) {

$worksheet->write_string($i,$j++,'-');

}

$worksheet->write_string($i,$j++,'-');

}

$workbook->close();

exit;

}

In the end I should retrieve the excel but I receive some strange characters like in this post of the forum:

http://moodle.org/mod/forum/discuss.php?d=128565

http://moodle.org/mod/forum/discuss.php?d=114972

From debugging I see that I have an : “ headers already sent error “ probably from the : $workbook->send($downloadfilename); line .

If anyone can help me or give me an advice I am waiting for your advices.

Thank you!

Attachment scormexcel.jpg
Average of ratings: Useful (3)
In reply to Dorel Manolescu

Re: Exporting SCORM reports into Exc

by Zachary Johnson -
This looks very promising. Any update on this? I'd like to utilize something just like this for our reporting as well.

-Zach
In reply to Dorel Manolescu

Re: Exporting SCORM reports into Exc

by Arien Hilhorst -

I am very curious how this is evolving... Please keep me posted, for I am in great need of an excel solution to calculate and manage 1000 + course treads and grades.

Greetings!

Arien.

In reply to Arien Hilhorst

Re: Exporting SCORM reports into Exc

by Jason Hollowell -
Picture of Particularly helpful Moodlers
Just stumbled onto this thread and got really excited but see that it's been dormant for almost two months sad

Any progress here?

I'm just finishing up development of an enrollment plugin with Moodlerooms and might have a little money in my research budget left over that could be thrown in the direction of this project if needed....not much money I'm afraid but it might be helpful?

Jason
In reply to Jason Hollowell

Re: Exporting SCORM track details into Excel

by skanda pm -
Hi,

I am using Moodle 1.9.7

I would like to know if there is any admin interface to make the settings in order to download the scorm quiz track details into an excel file. Please help me out on this.

Skanda
In reply to Ron Meske

Re: Exporting SCORM reports into Excel

by Richard Trout -
+1 to Ron Meske's list of reports.

I couldn't have written the list better myself.
In reply to Ron Meske

Re: Exporting SCORM reports into Excel

by Paul Walsh -

Hi all,

Has there been any progress on reporting? I would like to get a report on all users who complete a SCORM module. I would like the time they started the module, the time they last accessed the module and the status of the module, i.e. "Complete/Incomplete".  The SQL for this would be fine. Thanks in advance for any help.

P

In reply to Ron Meske

Re: Exporting SCORM reports into Excel

by sam ensogna -

I was able to create a SQL query to get a list of all users who have completed my SCORM course.  hope this helps someone!  this is way better than clicking through each user. 

SELECT u.lastname as 'last name', u.firstname as 'first name', u.email,  s.name as course, from_unixtime(st.timemodified) as 'end time'
FROM prefix_user u
INNER JOIN prefix_scorm_scoes_track st
ON st.userid = u.id
INNER JOIN prefix_scorm s
ON s.id = st.scormid
WHERE st.element = 'cmi.core.lesson_status' AND st.value = 'completed' AND u.deleted = 0
ORDER BY s.id, st.timemodified

In reply to sam ensogna

Re: Exporting SCORM reports into Excel

by Baljé Weber -

Hi, all i am using the custom reports block from the extensions. It is a good extension and has a default publish to excel option. I am having trouble thinking up a way to get multiple values from the tracker table in to the report.

My SQL

SELECT
prefix_user.id,
prefix_user.firstname,
prefix_user.lastname,
prefix_user.username,
prefix_grade_items.itemname,
ROUND(prefix_grade_grades.finalgrade, 0) AS 'Score in %',
prefix_scorm_scoes_track.value AS 'Tijd bezig'

FROM
prefix_grade_grades
INNER JOIN prefix_user ON prefix_grade_grades.userid = prefix_user.id
INNER JOIN prefix_scorm_scoes_track ON prefix_scorm_scoes_track.userid = prefix_user.id
INNER JOIN prefix_grade_items ON prefix_grade_grades.itemid = prefix_grade_items.id

WHERE
(prefix_grade_items.itemname IS NOT NULL)
AND (prefix_grade_items.itemtype = 'mod' OR prefix_grade_items.itemtype = 'manual')
AND (prefix_grade_items.itemmodule = 'scorm' OR prefix_grade_items.itemmodule IS NULL)
AND (prefix_grade_grades.timemodified IS NOT NULL)
AND (prefix_grade_grades.finalgrade >= 0)
AND (prefix_user.deleted = 0)
AND (prefix_scorm_scoes_track.element = 'cmi.core.total_time')

Note that the prefix is a automatic way of getting the correct table prefix. This works but i want to add a column with the status. Unfortunatly it is in the same column my last WHERE statement is in. Any help.

Hope this can inspire others to get the reports they need until funding is found.

In reply to sam ensogna

Re: Exporting SCORM reports into Excel

by Abdul-Khaliq Nathekar -

Hi Sam,

Thanks for your SQL code.  It's working well for me.  I also need to order completed SCORM activities by groups per course.

Can you point me in the right direction please?

In essence, I need to view:

Username, Course, Group, Count per group per course

I have two courses that have participants in two unique groups per course and want to seperate them accordingly.  Other courses have participants in only one group, which I need to view also.

Is there a way to have a count on the number completed in each SCORM activity?  I'm currrently counting the results within Excel...  Maybe there is a better way?

TIA.

Abdul-Khaliq

In reply to Chris Shott

Re: Exporting SCORM reports into Excel

by skanda pm -
Hello,

I am working on Moodle 1.9.7. As reported by Chris above, I am trying to export the scorm track details into an excel spreadsheet by moodle. I couldn't find it to do in moodle. Please help me out on this.

Skanda