support for Postgres in Review Assignment / New assignment

support for Postgres in Review Assignment / New assignment

Mark Pearson
Vastuste arv 8
I'm using Moodle 1.5.1 on Mac OS server 10.4.2 with Postgres 8.1
This is a test server for our main one which also uses Postgres.

Newassignment gives an error on running:
....../module/newassignment/db/postgres.php not found

For ReviewAssignment:

I have set up a test assignment called 'test', for want of something more creative, as assignment type 'upload & review'. Logging in as a student (or guest) I can upload a file in response to this assignment. I then go back in as the course teacher, open the assignment and I can see a link to View 1 submitted assignments. But when I click on this it says 'nothing to display'.

Now I think that this has something to do with the fact that we are running postgres because we came across exactly the same problem in the main assignment module in v1.5. Rowan (the system manager) told me that it was because some part of the SQL code was MySql specific and did not work with postgres. Anyhow, this was fixed in v1.5.1.

What is the latest with these modules? I have a prof who is desperate to upload corrected papers but we are hamstrung because of the above bugs. It seems to me that Postgres is rather a second class citizen in terms of module compatibility.

Mark
Keskmine hinnang: -
Vastuses Mark Pearson

Re: support for Postgres in Review Assignment / New assignment

Jaroslav Šeděnka
Newassignment sure hasn't support for PostgreSQL now and I'm unable to add it }no Postgre experience. However, if you have some programming experience it shouldn't be so difficult to add the support.
Vastuses Mark Pearson

Re: support for Postgres in Review Assignment / New assignment

Oksana Delgado
Mark,
this is little hack to make Upload&Review assignment work with Postgres.

Script:
/mod/assignment/type/assignment.class.php

Function display_submissions()

Query:
$select = 'SELECT '.$db->Concat('u.id', ''#'', $db->IfNull('s.userid',
'0')).' AS uvs, u.id, u.firstname, u.lastname, u.picture, s.id AS
submissionid, s.grade, s.comment, s.timemodified, s.timemarked,
((s.timemarked > 0) AND (s.timemarked >= s.timemodified)) AS status ';
/* && replaced by AND */
// $group = 'GROUP BY uvs ';
/*removed GROUP BY because SELECT and GROUP BY lists do not agree here*/
Function display_submissions()

Hope it helps

Vastuses Oksana Delgado

Re: support for Postgres in Review Assignment / New assignment

Oksana Delgado
I just installed echo-Assignment on Moodle 1.5 + Postgres7.4.7
I had to do some modifications though.

1) File lib.php function newassignment_get_users_submissions() should be:
function newassignment_get_users_submissions($newassignment, $user) {
        global $CFG;
        return get_records_sql("SELECT * FROM {$CFG->prefix}newassignment_submissions
                                                WHERE userid =  '$user->id'
                                                AND newassignment = '$newassignment->id'
                                                ORDER BY timemodified DESC");
}

2) I had to create file postgres7.sql at newassignment/db (see attachment)

I didn't do very extended testing, but from the first look everything seems working fine.
Vastuses Oksana Delgado

Re: support for Postgres in Review Assignment / New assignment

Martín Langhoff
Oksana, what module is this that you are working on? Is this a patch to fix Postgres support on the new mod/assignment that shipped with 1.5?

Vastuses Martín Langhoff

Re: support for Postgres in Review Assignment / New assignment

Michael Penney
It was for a plug-in we wrote, to allow review assignment as a type in the new assignment (1.5) module. Writng and installing was easy as pie (for Michael Avelar), but we go stuck on the horribly OO new grading interfact (which seems like it was code only for online text assignment with not thoughts to other types as if they would just switchkurvastab.

Anyway, we're sticking with the 1.4 module until someone can make a grading interface 1.5 that makes sense.
Vastuses Michael Penney

Re: support for Postgres in Review Assignment / New assignment

Martin Dougiamas
Core developers pilt Documentation writers pilt Moodle HQ pilt Particularly helpful Moodlers pilt Plugin developers pilt Testers pilt
New interface for online assignment grading is still coming (holding up 1.5.3 in fact!  kurvastab), but it's still just for the online assignment ... if you need something really different then it should be possible to override everything in the class to do so ...
Vastuses Mark Pearson

Re: support for Postgres in Review Assignment / New assignment

Martín Langhoff
Hi Mark,

Postgres support was somewhat shaky in 1.5.0/1.5.1. Recent 1.5.2+ should work well with Postgres. If they don't, let us know!

cheers!

martín