Course Progress through API

  • Simon Ball
  • Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 2 months ago - 12 years 2 months ago #1 by Simon Ball
Course Progress through API was created by Simon Ball
Hi there,

Firstly, thank you for creating such a wonderful project, it is quite simply great. The company I work for uses Joomdle in conjunction with Community Builder and Akeeba Subscriptions.

When it comes to making some modifications to the way things are viewed, I'm currently trying to get progress according to the completion_info field from course_mods however, it seems to always return nothing. Below is a var_dump expressing an example.
Code:
[section] => 1 [name] => Module 1: Search Industry and Search Process Overview [summary] => [mods] => Array ( [0] => Array ( [id] => 92 [name] => Defining Your Niche [mod] => page [type] => [available] => 1 [completion_info] => ) [1] => Array ( [id] => 331 [name] => Quiz 1 [mod] => quiz [type] => [available] => 1 [completion_info] => )

After digging through the the documentation and code, I can't see a method to return this property; please can you point me in the right direction if it exists? The code surrounding this process would pose no problem if progress were available; I aim to produce a page which resembles the images below



Thank you for your time.
Last edit: 12 years 2 months ago by Simon Ball. Reason: Extra info

Please Log in or Create an account to join the conversation.

More
12 years 2 months ago #2 by Antonio Durán
Replied by Antonio Durán on topic Course Progress through API
Hi.

I am glad Joomdle is helping your company.

I had to look into the code, as I worked on this some time ago. It turns out the field should not be called completion info, but something like "restriction info" instead, as it is not used for completion information: it is used to hold activity restriction info. For example: "Available from 14 February 2014." when an activity is not yet available.

You may want to look at get_course_completion ().
It checks completion info for each section, not for each individual task.

Please Log in or Create an account to join the conversation.

  • Simon Ball
  • Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 2 months ago #3 by Simon Ball
Replied by Simon Ball on topic Course Progress through API
Thank you for getting back to me so promptly, I'll give it a go and let you know how it goes. Maybe you would like to incorporate it as an alternative layout to the "My courses" page?

Please Log in or Create an account to join the conversation.

More
12 years 2 months ago #4 by Antonio Durán
Replied by Antonio Durán on topic Course Progress through API
Sure, we are always open to include more options.

Please Log in or Create an account to join the conversation.

  • Simon Ball
  • Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 2 months ago - 12 years 2 months ago #5 by Simon Ball
Replied by Simon Ball on topic Course Progress through API
I'm still attuning myself to Joomdle but, I can only seem to get a 404 response:
Code:
XML-RPC Error (404): Unknown error

The system is all green light and I have checked that the Joomdle web service has the correct permissions from Moodle using the following code:
Code:
echo '<p>Course ID: '.$curso['id'].'</p>'; <-- Valid course ID '16' echo '<p>Username : '.$username.'</p>'; <-- Valid user who is enrolled on course 'symbal' $aryCompletionStatus = JoomdleHelperContent::call_method( 'my_course_completion', $curso['id'], $username );

I've made sure the course has some completion conditions and fulfilled one of them just to make sure there is actually a status to use.
Last edit: 12 years 2 months ago by Simon Ball.

Please Log in or Create an account to join the conversation.

More
12 years 2 months ago #6 by Antonio Durán
Replied by Antonio Durán on topic Course Progress through API
Enable debuggin in moodle to get more info about the error.

Maybe add (int) before $curso[id'] ?

Please Log in or Create an account to join the conversation.

  • Simon Ball
  • Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 2 months ago #7 by Simon Ball
Replied by Simon Ball on topic Course Progress through API
That's a gem of an option, if anything comes from this thread, discovering that little option is worth a lot; thank you again.

A response message as opposed to the 404 now shows:
Code:
XML-RPC Error (28194976): Method "joomdle_my_course_completion" does not exist | ERRORCODE:

I can however see the method listed in the API and my "connect" user has the correct roles and every single function available in the external services API

Please Log in or Create an account to join the conversation.

More
12 years 2 months ago #8 by Antonio Durán
Replied by Antonio Durán on topic Course Progress through API
Real function name is: get_course_completion

Please Log in or Create an account to join the conversation.

  • Simon Ball
  • Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 2 months ago #9 by Simon Ball
Replied by Simon Ball on topic Course Progress through API
Oh my! That's beautiful and at the same time "Arrrrrrgh, that one word" :lol: Gotta love computers, one wrong character means the difference between life and fatal error.

Thank you for sticking with it Antonio, really thank you. It means I can now crack on with development and to explore some of the other slicker functions.

+1

Please Log in or Create an account to join the conversation.