Describes Moodle tables and table relationships to Drupal Views, so that Moodle data can be displayed in a Drupal site using Views.

Works with the existing Moodle Connector module to access the Moodle database. Drupal user to Moodle user can be linked by username, or by UID if using something like https://github.com/cannod/moodle-drupalservices/ to link the databases and provide single-sign-on.

Example Site

Site using the module: http://www.eziggurat.co.uk

Courses and Sample Courses are Views of Moodle data, which can include details of the "teacher" or "author" of a course as well as many of the course fields:

(the "steps" are Moodle course sections, from "step 1" to "step 5", with the course in "topics" format).

Views for "My Courses" and "My Grades" on user account pages:

(the certificate generation link is not defined by this module, nor is the PDF generation code).


Project page: https://drupal.org/sandbox/Fonant/2030051

Checkout: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/Fonant/2030051.git moodle_views

I've tidied the code as well as I can, to keep Pareview happy: http://pareview.sh/pareview/httpgitdrupalorgsandboxfonant2030051git. Most of the errors are down to non-CamelCase class names and methods.

Members fund testing for the Drupal project. Drupal Association Learn more


PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

bneil’s picture

Status: Needs review » Needs work

Hello fonant,

I've done a manual code review of your module, but don't have access to a Moodle instance for testing. I just found one minor change.

hook_views_api: Path should be optional since your views inc files are all in the root of your module. See: https://api.drupal.org/api/views/views.api.php/function/hook_views_api/7

bneil’s picture

Status: Needs work » Needs review

Thinking about this some more, I don't think my minor change should warrant "needs work".

fonant’s picture

I've removed the redundant path specification anyway - well spotted!

kentoro’s picture

Status: Needs review » Needs work

I see many errors in pareview they should be fixed before proceeding
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

EDIT: removed copied pareview.sh report.

klausi’s picture

Status: Needs work » Needs review

Those errors are related to Views coding standards violations and can't really be changed by implementors. Please do a real manual review.

kentoro’s picture

So you won't do these either?
Excuse me if I did it wrong, i was using the tools the community used on me.
didn't know i could choose what to fix and what not.

I think these errors are as simple as to put a . or ! or ? at the end of the inline comment,
and could be changed by an implementor, but I'm probably wrong again aren't I?.

FILE: /var/www/drupal-7-pareview/pareview_temp/moodle_views.views.inc
518 | ERROR | Inline comments must end in full-stops, exclamation marks, or
| | question marks
526 | ERROR | Inline comments must end in full-stops, exclamation marks, or
| | question marks

fonant’s picture

Thank you for your review, kentoro.

The things PAreview is complaining about are:

1) CamelCase not used for classes and methods: Drupal 7 coding standards don't use CamelCase here, and nor does the Views API.
2) A couple of comments not ending in punctuation: these comments are to show the SQL generated by the joins, and can't easily end with punctuation.

kentoro’s picture

Ok, thank you sir for explaining the situation.
Best of luck.

AjitS’s picture

Priority: Normal » Major
Issue summary: View changes

Two weeks no review. Changing the priority of the status to Major. I'd suggest you to get the apply for the Review Bonus so that this issue gets more attention.

candotri’s picture

I find this code to be nicely readable. I can't contribute to the validity of the views code, though. Everything seems to be complying with standards.

kscheirer’s picture

Priority: Major » Normal
Status: Needs review » Reviewed & tested by the community
  • Avoid using hook_init() - this will be executed on every Drupal page request, regardless of any moodle-related content.
  • You can remove the .gitignore file.
  • Nice job on the multi_join subclasses - could that go in as a patch to views itself?

Those are not blocking issues, so RTBC from me.

Top Shelf Modules - Crafted, Curated, Contributed.

caspervoogt’s picture

A much-needed module for those of us using Moodle. I agree the PAReview errors are false positives in this case. RTBC as far as I can see.

kscheirer’s picture

Status: Reviewed & tested by the community » Fixed

It's been a month without any problems reported, so I'm promoting this myself as per https://drupal.org/node/1125818.

Thanks for your contribution, fonant!

I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

Top Shelf Modules - Crafted, Curated, Contributed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.