Generating PDF with Google Drive

Generating PDF with Google Drive

by Andy Hastie -
Number of replies: 6

Moodle 3.6.3 (Build: 20190311)

So I have followed the various OAUTH/DRIVE API setups and have had positive confirmation that the credentials are fine and even seen the test work in the Document Converter... but when I upload an assignement DOCX or RTF or even a PDF  the grading screen just sits there saying "Generating the PDF..." and nothing happens... does anyone else have this problem? I don't know where to begin debugging this.


Attachment Screenshot 2019-03-23 at 20.42.42.png
Average of ratings: -
In reply to Andy Hastie

Re: Generating PDF with Google Drive

by Ken Task -
Picture of Particularly helpful Moodlers

So having debugging turned on shows nothing at all?   Does it 'hang' forever and ever?

How about things like checking true server logs ... assuming apache ... apache error logs ... which, depending upon how one is hosted and config of PHP might be error_log in directories of moodle code.

https://docs.moodle.org/36/en/OAuth_2_services

App verification

NOTE: If you are just using this for document conversion you will not need to verify (as it only uses one account). You will, however, need to verify your ownership of your domain (see, [1])
The Google Drive repository and Google Drive converter also require the app to be verified by completing the OAuth Developer Verification Form. The list of scopes that Moodle requires are:

openid profile email https://www.googleapis.com/auth/drive

Where one gets the Oauth credentials ... in IAM ... there are 3 tabs.   Did you complete 'bolded' above as well as the other tab?

'spirit of sharing', Ken


In reply to Ken Task

Re: Generating PDF with Google Drive

by Andy Hastie -

Thanks Ken

Found that I need to add the scope for the drive auth in the developer console too... 

It works now, but only for new submissions, for some weird reason the first course i did never works ...

Cheers
Andy

In reply to Andy Hastie

Re: Generating PDF with Google Drive

by David Morrow -

I have a similar situation, I think. Would be very interested to know how to "reset" things so that that the submissions made before we fixed our document conversion process would also be converted. Seems to be working fine for anything submitted after we got it running.

Thanks!

David

In reply to David Morrow

Re: Generating PDF with Google Drive

by Ken Task -
Picture of Particularly helpful Moodlers

Just thinking out loud ... not sure there is any way via Moodle UI.   And suggestion below is not to be done on production server without first testing in a sandbox!!!!

Do an explain on table  mdl_assign_submission.   Maybe ... Maybe ... tweaking a varible will trigger Google ...

Explain which will show:

id     bigint(10)     No     Primary     NULL     auto_increment
assignment     bigint(10)     No     Indexed     0    
userid     bigint(10)     No     Indexed     0    
timecreated     bigint(10)     No     None     0    
timemodified     bigint(10)     No     None     0    
status     varchar(10)     Yes     None     NULL    
groupid     bigint(10)     No     None     0    
attemptnumber     bigint(10)     No     Indexed     0    
latest     tinyint(2)     No     None     0

Using a student account that had submitted before switching to Google, see what's contained in that table.   Compare with student account that did submit after.

Good luck! smile

'spirit of sharing', Ken


In reply to Ken Task

Re: Re: Generating PDF with Google Drive

by David Morrow -
Ken, Sorry for my delay in responding - and thank you! Man, I was hoping for a button ("click here" to ...)! David
In reply to Andy Hastie

Re: Generating PDF with Google Drive

by Ken Task -
Picture of Particularly helpful Moodlers

@Andy ... what if you made a user backup of that course of only assignments in the course, then restored to a hidden category?

One might also get off into deep end by extracting the backup and looking at xml files to see if there are some 'tweakie' things one could do to an xml, rebuild the backup, then restore to see.   That will probably take a lot of time.

'spirit of sharing', Ken