However, to the functional issue!
I am, I guess, surprised that an upgrade from Moodle 1.x to Moodle 2 where the Moodle has courses with journals will run smoothly. I had expected that it would result in making quite a mess of the coursees assignments and gradebook, but assuming that is not the case, it seems to me that it makes sense to ensure that the Moodle 2 setup checks the db to determine if there are journals and then offers the option to convert or cancel, as there are quite a few people who continue to use journals (whether they are romatics like me or just uninformed of the obsolescence) and this could be a worse experience than that of upgrading to 1.9 and discovering that all your gradebooks now resemble badly scrambled eggs while grades are due in 48 hrs......
I guess here again I am trying to look at the situation from the perspective of the gazillion users who are not obsessive about forum postings or implementing the latest stable (there are lots of folks still using Moodle 1.4 because it provides them what they need....) What will Joe User, with a moodle with dozens of existing courses which have contained journals for some years, have to deal with when he decides to go ahead and upgrade to Moodle 2 and then get calls from teachers saying that none of their journals work? If one is going to claim that Moodle is so easy to use that even a "teacher" can manage it, then we had better make sure we trap all issues before they create some meltdown for Joe.....
The name of the Assignment module has been a bugbear for a lot of people, I know. I guess you can always name it something else in the Language pack.
If you think the upgrade should be in core, you should raise a tracker report that can be voted on. It would be easy enough to make part of the upgrade (it was developed from the original 1.5 code after all).
Re: Script to convert Journals to Assignments - Tracker item to include in core 2.0 setup
Re: Script to convert Journals to Assignments - Tracker item to include in core 2.0 setup
Re: Script to convert Journals to Assignments - Tracker item to include in core 2.0 setup
The error message only appear when we try to run the journal php.
I recently upgraded from 1.9 to 2.0. I didn't realize journal was not going to be supported anymore. Is it too late to run the journal2assignment script? I put the php file in the root of my moodle and then put it in the address of my browser.
I get an error: get_records() not available anymore
Any ideas?
I appreciate your help.
I still have a lot of Journal activities on my server, last year we migrated from Moodle 1.9 and are now at 2.2 with plans to upgrade to 2.4 or possibly newer. I must have elected not to convert the Journal activities to Assignments at some point during previous upgrades. As Moodle 2.5 has now been released and the Journal add-on module is not yet available beyond Moodle 2.4, I am looking towards the future and hope to not leave any Journal data behind.
I found the following:
https://github.com/jamesballard/moodle-misc_journal2assignment
Can anybody vouch that the convert script works with Moodle 2.2?
I tried the script on my Moodle 2.2.10 installation with the following result (debugging turned on):
Converting Journal 'Are you ergonomically correct??' (433)
INSERT INTO mdl_assignment (course,name,intro,introformat,assignmenttype,resubmit,preventlate,emailteachers,var1,var2,var3,var4,var5,maxbytes,timedue,timeavailable,grade,timemodified) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
[array (
0 => '95',
1 => 'Are you ergonomically correct??',
2 => 'Many people have a hard time working at the computer in an ergonomically correct way. People have a habit of sitting at the ccomputer in a certain way that may not be ergonomically correct. For me, I have a difficult time keeping my feet flat on the floor. In a short paragraph, tell me what are the most difficult things for <em>you</em> to be ergonomically correct and how you are going to try and correct it. Name at least 2 things. In the long run, it will be good for you. This will be counted in your \\"Real life Applicatiom\\" mark. ',
3 => '1',
4 => 'online',
5 => 1,
6 => 0,
7 => 0,
8 => 1,
9 => 0,
10 => 0,
11 => 0,
12 => 0,
13 => 0,
14 => 0,
15 => '1251180000',
16 => NULL,
17 => '1251579874',
)]
- line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
- line 973 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
- line 1015 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
- line 99 of /journal2assignment.php: call to mysqli_native_moodle_database->insert_record()
Any experts here that can help me resolve this?
The error is caused by the line of code $assignment->grade = $journal->assessed; The word "assessed" needs to be changed to "grade" instead. It is in line 97 of journal2assignment.php located at https://github.com/jamesballard/moodle-misc_journal2assignment.
Further discussion about this is at https://moodle.org/mod/forum/discuss.php?d=229770#p999415
I have tested this on Moodle 2.2 and 2.6dev and it works on both. Just be aware that the converted assignments are the old style and you will need to run Assignment upgrade helper to fix them. In Moodle 2.6 the converted journal will not even be visible until you run Assignment upgrade helper.
HTH,
AL
I have committed this change. I am not specifically working with Moodle at the moment so have not had a chance to test.
Hope this works for you
Yours
James
The journal2assignment.php script worked successfully on my Moodle 2.2.10 installation.
Thanks for your help!
You're welcome Greg. Also thanks to James for the commit.
AL