Best practice forum (Archived)

This forum discussion has been removed

 
This forum post has been removed
Tuesday, 22 November 2011, 6:51 AM
The content of this forum post has been removed and can no longer be accessed.
Simon Coggins
Re: Building a report on a specific SCORM
by Simon Coggins - Tuesday, 22 November 2011, 1:01 PM
Group Totara

Hi Amir,

Yes it is doable but you would need to write a custom content restriction. Have a look at the file local/reportbuilder/classes/rb_base_content.php for the base class and examples of existing content restrictions that are available. These can then be made available to a particular source using  contentoptions in the source.

At some point I'd like to create a new dynamic content restriction that lets you apply a content restriction using any of the filters available to that source, but I haven't had any time to work on it I'm afraid.

There is one other option available to you - you could use an embedded report and parameter restrictions to restrict to a single activity - for an example look at how the my/bookings.php embedded report restricts the data to only show records for the current user.

Simon

This forum post has been removed
Sunday, 8 January 2012, 4:27 AM
The content of this forum post has been removed and can no longer be accessed.
? ?
Re: Building a report on a specific SCORM
by ? ? - Sunday, 8 January 2012, 12:58 PM
 

Just a quick note to let you know reporting in 2.2 for SCORM has improved a lot - we now have an interactions report and a couple of others in development thanks to some work from a GSOC project this year. You can now write your own pluggable "reports" just for SCORM.

Theres a small screenshot that shows the interactions report here:
http://docs.moodle.org/22/en/Using_SCORM#SCORM_interactions_report

(but the docs probably need a bit more improvement/updating at some point)

Simon Coggins
Re: Building a report on a specific SCORM
by Simon Coggins - Sunday, 8 January 2012, 4:49 PM
Group Totara

This is something we were planning on implementing but haven't got to yet. What I was intending to do was to modify the content tab to dynamically include one content restriction for each filter in the report's source.

The filtering code already provides methods for adding the form element to a moodle form, the sql query and a human readable representation of the filter so it should be pretty straightforward.

To avoid the page becoming huge, I was going to change the UI slightly so instead of including all content restrictions the page would start with none then options would be added by the user (and would be enabled as soon as they were added). This could be done via a pulldown to allow the user to select their preferred restriction.

Simon

? ?
Re: Building a report on a specific SCORM
by ? ? - Thursday, 12 January 2012, 6:51 AM
 

Hi Simon 

I written a new content restriction rb_text_content .
using this class you can easily restrict the given field by the text content actualy it's behave like text filter

see the  attached file

In the scorm case just add those lines to the rb_source_scorm source on the define_contentoptions() function

new rb_content_option(
'text',
get_string('scormtitle', 'rb_source_scorm'),
'scorm.name',
'scorm'
),

Rafi

Simon Coggins
Re: Building a report on a specific SCORM
by Simon Coggins - Thursday, 12 January 2012, 2:08 PM
Group Totara

Hi Rafi,

That's fantastic, thank you so much for the contribution. We'll definitely include the new content restriction, and will look at which report sources could include a text filter by default.

I did find a few small issues while testing it out:

1. When the "Show records based on SCORM Title" checkbox is disabled the rest of that part of the form should be greyed out (to indicate it isn't used). That can be done using disabledIf in the moodle form definition.

2. In sql_restriction you use the $ilike variable but don't define it. That breaks the filtering options (other than contains and doesn't contain). Fix is to add:

$ilike = sql_ilike(); before the switch statement.

3. Quotes in the text field are escaped but not unescaped when the text is redisplayed, so get prepended with a backslash every time the content form is reloaded.

4. The string passed to the content option is designed to work in the context of the phase "Filter base on ...", so instead of passing in "SCORM title" it would be better to pass in "the SCORM title". This would also fix the fact that the first character is being lowercased (so it displays as "sCORM title").

5. Some whitespace and formatting issues with the code itself (whitespace at the end of lines, tabs instead of spaces, alignment).

Simon

? ?
Re: Building a report on a specific SCORM
by ? ? - Tuesday, 17 January 2012, 1:42 PM
 

Hi Simon ,

attached a new version that fix 1,2,5

The lang issue(4) is not a problem in Hebrew but I see the important

As for 3 the infrastructure at the clients is MS (IIS,MSSQL).I don't know why yet but the behavior that you mentioned doesn't hapen with MSSQL,but when I use mysql I see the problem do you have any idea?

I'll update a new version that handle this issue soon

Thanks

Rafi

Simon Coggins
Re: Building a report on a specific SCORM
by Simon Coggins - Tuesday, 17 January 2012, 2:10 PM
Group Totara

Quotes are escaped differently in MSSQL (with a single quote instead of a backslash). Could be related to that although I'm not sure exactly why.

Thanks for the updated version, I wait for the rest of the fixes then submit a patch to core.

Simon