Is it possible to make course formats browser dependant?

Is it possible to make course formats browser dependant?

by John Detlefs -
Number of replies: 9

I currently use the grid format for our http://student-portal.cfgt.com.au site (Moodle 2.2 soon to be 2.3). This is great but we have a couple of clients (Australian Govt, so impossible to get them to upgrade) who still use IE6 & 7, and the grid format crashes the browser.

Now I know that Moodle 2+ doesn't support ie6 but that isn't my question. smile

Is it possible to change course format on the fly depending on which browser is being used? Basically the "Topic" course format works just fine in IE6, so i'd like that to appear anytime IE6 is being used, and just continue with the default "Grid" for any other browser.

Is that possible? If so, do you have any pointers as to what I should do?

Cheers, and thanks in advance!

John Detlefs

Average of ratings: -
In reply to John Detlefs

Re: Is it possible to make course formats browser dependant?

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear John,

It is currently not possible to change on the fly without additional code changes.

I think it is possible with browser detection.  But the code is server side so some thought needs to be placed on how client info gets to the server before rendering.

Or, what is the problem with the Grid format?  I did the port for the format from Moodle 2.2 to 2.3.

Cheers,

Gareth

Average of ratings: Useful (1)
In reply to Gareth J Barnard

Re: Is it possible to make course formats browser dependant?

by John Detlefs -

Hey Gareth, and thanks for the quick reply. Good to know that it's possible, I'll get our developer to have a look at it.

As far as grid goes, it looks great and works perfectly except in Ie6 where it crashes the browser. When I get back to a computer (sending this from my phone) I'll get you some screenshots if you're interested?

Cheers,

John Detlefs

 

In reply to John Detlefs

Re: Is it possible to make course formats browser dependant?

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear John,

No worries.  Please don't worry about the screen shots, I was able in the mean time to setup a Virtual XP with IE6 to see what was going on.  This will 'bug' me now that it does not work, however, I do wish that everybody would move away from IE 6 etc. as MS no longer supports it.  It also causes so much headaches in supporting it.  It's like, here is this brand new car and then being asked if stone wheels will work with it ;)

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Is it possible to make course formats browser dependant?

by John Detlefs -

Apologies Gareth, the intent of this thread wasn't to get you to fix it!

I couldn't agree more about ie6 (and 7-9) to be honest, but sadly the Australian Goverment doesn't seem to agree. In their defense they have a lot of legacy systems that they built around ie6 and I guess they don't see a benefit to upgrading. 

Sucks for service providers though, as you say, stone wheels give crap performance and don't look so good!

Cheers,

John Detlefs

 

In reply to John Detlefs

Re: Is it possible to make course formats browser dependant?

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

No apology required John, this is a challenge from the Grid formats point of view!

I'm sure they would change their tune if they got hacked / data loss because of a security flaw / bug in an out of date browser.  Then they would have egg on their face and the papers would have a field day.  Not that I'm condoning hacking, it's just something that happens.  Plus I'm sure newer systems would be more productive for the workforce and hence save them money in person hours.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Is it possible to make course formats browser dependant?

by John Detlefs -

Hey Gareth, just for my own knowledge, is this something that you're actively looking at, or something that will happen by back burner?

Knowing will just help me in my decision to get my developer to do a php workaround (if ie6 is detected the course format reverts to "topic") or whether I hold off on that.

I'm also not sure how to help from a funding point of view, if that helps? I'm treading carefully here, as I haven't really worked with the Moodle community before and don't want to offend, so if my questions are out of sync with the community just let me know!

Cheers,

John Detlefs

In reply to John Detlefs

Re: Is it possible to make course formats browser dependant?

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear John,

To be honest, it's on the back burner as I consider implementing code for IE6 like making a modern ejector seat work with a Biplane.  Also I'm just getting to grips with the funding model where I believe that things can be added faster if a developer has a 'sponsor' to fund them to make the change for them but the code becomes Open Source and available to anybody.  Sort of I think philantropic in nature that the client gets what they want by paying for it and then the whole community benefits, thereby driving Moodle forward for the benefit of others - because it's free.  Also I believe that Moodle HQ have a percentage of the fee so that everything is supported and developed further, totally understandable to keep the flasgship afloat.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Is it possible to make course formats browser dependant?

by John Detlefs -

No worries, i'll look further into the way funding works. As far as making the format browser dependent, our developer (Mark van Hoek) has come up with the following, which has worked on all testing that we've done.

Default course format is a setting in /admin/settings.php?section=coursesettings

/**

* Updated by Markv 2012Sep19 to prevent display of the grid course format in IE6

*/

if($course->format == 'grid' && check_browser_version('MSIE') && !check_browser_version('MSIE', 7) /* i.e. not IE7 or better */) {

$course->format = 'topics';

}

Hope that helps anyone who has the same issue!

 

In reply to John Detlefs

Re: Is it possible to make course formats browser dependant?

by omar berdeja -

Dear Jhon,

I'm trying to solve the same problem.

In wich segment of the code in the file /admin/settings.php do I must insert that code?

I tried inserting it in the last section but I didn't notice any change in Iexplore, it still display me the merge window "Internet explorer cannot open the....."

I'm running Moodle 2.3

Thank you