Overview
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).
Details
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.
| Comment | File | Size | Author |
|---|
Comments
Comment #1
PA robot commentedWe 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.
Comment #2
bneil commentedHello 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
Comment #3
bneil commentedThinking about this some more, I don't think my minor change should warrant "needs work".
Comment #4
fonant commentedI've removed the redundant path specification anyway - well spotted!
Comment #5
Anonymous (not verified) commentedI see many errors in pareview they should be fixed before proceeding
http://pareview.sh/pareview/httpgitdrupalorgsandboxfonant2030051git
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.
Comment #6
klausiThose errors are related to Views coding standards violations and can't really be changed by implementors. Please do a real manual review.
Comment #7
Anonymous (not verified) commentedSo 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
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
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
----------------------
Comment #8
fonant commentedThank 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.
Comment #9
Anonymous (not verified) commentedOk, thank you sir for explaining the situation.
Best of luck.
Comment #10
ajitsTwo 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.
Comment #11
candotri commentedI 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.
Comment #12
kscheirerThose are not blocking issues, so RTBC from me.
----
Top Shelf Modules - Crafted, Curated, Contributed.
Comment #13
caspervoogt commentedA 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.
Comment #14
kscheirerIt'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.