Customise the "Track Details" SCORM Report

Customise the "Track Details" SCORM Report

بواسطة - John Griffiths
عدد الردود: 5

Hello Everybody,

I was looking for some help changing the layout of the Track Details SCORM Report to match the attached screenshot design. To clarify, these are the tasks I need to achieve:

  1. Add cmi.interactions.n.timestamp to interactions table, column 1
  2. Change value in Question identifier to cmi.interactions.n.description
  3. Add cmi.interactions.n.correct_responses.n.patern to interactions table, column 4
  4. Remove all the “other tracks” rubbish 

Does anyone have any experience of creating a customised Track Details report, or have any hints as to which file within the Moodle Core relates to this page? 

Many thanks,

John 

المرفق pic1.png
متوسط التقييمات: -
رداً على John Griffiths

Re: Customise the "Track Details" SCORM Report

بواسطة - Dan Marsden
صورة Core developers صورة Particularly helpful Moodlers صورة Peer reviewers صورة Plugin developers صورة Plugins guardians صورة Testers صورة Translators

FYI That user tracks page has changed a lot in 2.6 - it now shows tracks data in a single table  and allows export to excel etc(it doesn't show the interactions data separately on that page anymore) - ideally you should upgrade to 2.6 before you make any changes to the code as your changes will be difficult to port when you upgrade.

To display interactions data you should be looking at the interactions reports but these reports have only been designed for SCORM 1.2 data as we don't support the use of SCORM 2004 in Moodle and development on SCORM 2004 features/improvements has stopped.

If someone else does some work that meets Moodle coding guidelines to add better SCORM 2004 support to the interactions reports in Moodle 2.6 then I could review it for inclusion. Alternatively if you have funding to cover a developers time to do this work drop me an e-mail and I can provide a quote.

رداً على Dan Marsden

Re: Customise the "Track Details" SCORM Report

بواسطة - John Griffiths

Hi Dan,

Thank you for your help - I have now completed the upgrade to Moodle 2.6 and you are right- the Interactions report is 100% better and almost exactly what I am after.

However, as you alluded too, this report only works with Scorm 1.2 packages which dont carry the cmi.interactions.N.description field through to Moodle, and there fore I am back to my original problem that only the cmi.interactions.N.id is visable which means nothing to noone.

Do you know how I can make this report work on a SCORM 2004 package?

Out of interest, why has moodle decided to stop development on the SCORM 2004 standard?

رداً على John Griffiths

Re: Customise the "Track Details" SCORM Report

بواسطة - Dan Marsden
صورة Core developers صورة Particularly helpful Moodlers صورة Peer reviewers صورة Plugin developers صورة Plugins guardians صورة Testers صورة Translators

Great to hear you like the new report - see my blog post for info on why we stopped development on SCORM 2004:
http://danmarsden.com/blog/2013/05/06/stopping-work-on-scorm-2004/

I'd be open to receiving a patch that checks if the package is SCORM 2004 and adds a column to the report with the descriptions field but that's not something I'd be able to spend any volunteer time on (but always happy to review a patch!)

رداً على Dan Marsden

Re: Customise the "Track Details" SCORM Report

بواسطة - John Griffiths

Hi Dan, Thanks as ever for your constructive feedback. You raise some interesting points in your Blog, I didn't realise how much of Moodles relationship with SCORM is down to yourself and your team.

I have made some inroads into creating a Patch and am happy to keep working on it myself but I just have a final question, if I may??

I've found the report that I want to edit is in mod/scorm/report/userreporttracks.php and this is pulling information from the mdl_scorm_scoes_track table in the moodle database. What I cant figure out though is how to edit/remove some of the fields displayed on the report to cut away the "rubbish" leaving just the core information I want in my report:

1) what was the question text (cmi.interactions.n.description)

2) what was the students response (cmi.interactions.n.learner_response)

3) what was the correct answer (cmi.interactions.n.correct_responses.n.pattern)

4) is the answer given correct (cmi.interactions.n.result)

Around Line100 seems to be where the action is, with some very promising script that looks like this:

foreach ($trackdata as $element => $value) {
    if (substr($element, 0, 3) == 'cmi') {
        $existelements = true;
        $row = array();
        $string = false;
        if (stristr($element, '.id') !== false) {
            $string = "trackid";
        } else if (stristr($element, '.result') !== false) {
            $string = "trackresult";
        } else if (stristr($element, '.student_response') !== false or // SCORM 1.2 value.
            stristr($element, '.learner_response') !== false) { // SCORM 2004 value.
            $string = "trackresponse";
        } else if (stristr($element, '.type') !== false) {
            $string = "tracktype";
        } else if (stristr($element, '.weighting') !== false) {
            $string = "trackweight";
        } else if (stristr($element, '.time') !== false) {
            $string = "tracktime";
        } else if (stristr($element, '.correct_responses._count') !== false) {
            $string = "trackcorrectcount";
        } else if (stristr($element, '.score.min') !== false) {
            $string = "trackscoremin";
        } else if (stristr($element, '.score.max') !== false) {
            $string = "trackscoremax";
        } else if (stristr($element, '.score.raw') !== false) {
            $string = "trackscoreraw";
        } else if (stristr($element, '.latency') !== false) {
            $string = "tracklatency";
        } else if (stristr($element, '.pattern') !== false) {
            $string = "trackpattern";
        } else if (stristr($element, '.suspend_data') !== false) {
            $string = "tracksuspenddata";
        }

However whenever I try to delete any of those entries it does not affect the report one jot (unless I delete this:

if (stristr($element, '.id') !== false) {
            $string = "trackid";
        }

which breaks the report entirely. Can you figure out where I am going wrong???

Thanks again for your help, hopefully I will have something very useful to contribute back to the community shortly.

John

رداً على John Griffiths

Re: Customise the "Track Details" SCORM Report

بواسطة - Dan Marsden
صورة Core developers صورة Particularly helpful Moodlers صورة Peer reviewers صورة Plugin developers صورة Plugins guardians صورة Testers صورة Translators

that report is designed to display all tracks from a user - if you want to only show certain ones then you should comment out line 134:
$row[] = $element;

Then in the block above make sure you set a $string value for every value you want to appear in the report.

Unfortunately this change isn't something we'd be able to include in Moodle core as the report is supposed to show all values from the users own tracks - but you can easily maintain your own version of the report