Moodle for mobile

My Courses in MM

 
 
Picture of y h
My Courses in MM
 

Hi,

I want to make some modifications to the Moodle mobile app. My idea is to have a link to "my courses" that lists all the courses with the scroll to contents and participants as it is in the main page. This would avoid to have a long main page when the number of courses enrolled in is big. I'm wondering if anyone tried to do it before and how it's done.

PS: I tried the same idea on the "upload" and it works but "mycourses" isn't working.

Any help is appreciated.

 
Average of ratings: -
Picture of Juan Leyva
Re: My Courses in MM
Group DevelopersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

You should create a new plugin type "general" and there display the courses

 
Average of ratings: -
Picture of y h
Re: My Courses in MM
 

I created a folder in plugins. In this one, I created main.js in which i put all the functions of the plugins "contents" and "participants". Also i copied to this folder all html files of both plugins. When I add this plugin in config.json, I got this error: Uncaught SyntaxError: Unexpected token < in this line in main.js: 

templates: {
"participant": {
model: "participant",
html: participantTpl },
"participants": {
html: participantsTpl },
"folder": {
html: folderTpl },
"contents": {
html: contentsTpl },
"sections": {
html: sectionsTpl },
"mimetypes": JSON.parse(mimeTypes)}}

Honestly, I need your help to know if my method is wrong and i shouldn't put the functions of the plugins "contents" and "participants" and i should put another functions but my idea was that when I click on mycourses another page will open and there all the courses will be listed in the same way of the main page in the original moodle mobile app with contents and participants.

Thank you for your helpsmile

 
Average of ratings: -
Picture of Juan Leyva
Re: My Courses in MM
Group DevelopersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Please, can you share the full code of your plugin so I can check what is happening?

 
Average of ratings: -
Picture of y h
Re: My Courses in MM
 

Kindly find attached the plugin's folder.

 
Average of ratings: -
Picture of Juan Leyva
Re: My Courses in MM
Group DevelopersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hi,

I've found two erros:

lang: {
component: "moodle"
}

is invalid it should be:

lang: {
component: "core"
}

And also, define(templates, function (sectionsTpl, contentsTpl, folderTpl, mimeTypes, participantsTpl, participantTpl) { should match with the templates set you define before, so it should be:

define(templates, function (participantsTpl, participantTpl, sectionsTpl, contentsTpl, folderTpl, mimeTypes, mycoursesTpl) {

 

Find attached the correct file

 
Average of ratings: -
Picture of y h
Re: My Courses in MM
 

Hi, I modified the code and no more errors but actually the result is not what I wanted because it gives me mycourses followed by contents and participants and I can't click on any of them what I wanted is like this (I want to have the list of courses (second picture) when I click on mycourses with content and  participants for each of them the same way it's displayed in the main page in your moodle mobile):

 

Do you have any suggestions or anyone else at least about my way to develop the plugin because what I did and already mentioned and attached is not giving me the result I want.

Thanks in advancesmile

 
Average of ratings: -