Lecture Feedback Module Released

Re: Lecture Feedback Module Released

by Timothy Takemoto -
Number of replies: 0

I tried to make it work with 1.5 because my test site is 1.5 but failed.

All that seemed to be necessary to upgrade another module to 1.5 was to add
<INPUT type="hidden" name=sesskey       value="<?php  p($USER->sesskey) ?>">

To the list of other hidden variables in mod.html. Doing that stopped 1.5 from complaining about the lack of sesskey. I think that later version of 1.4.x (1.4.4?) require sesskey as well, so I enclose the mod.html with the above line added. Perhaps it will work on 1.4.4.

On 1.5 for some reason it lets me input incorrect passwords and I still get to the journal. Unless I made a mistake, I guess that there must be other things to be done to make this 1.5 compatible.

A minor discovery was that, rather than adding the database fields,  I think that it should be possible to create all the extra database fields at once using the following code pasted into an "SQL" field. This should also give a hint on how to get the module to create its own database rows.

ALTER TABLE `mdl_journal` ADD `kinds` TEXT AFTER `assessed` ;
ALTER TABLE `mdl_journal` ADD `passwords` TEXT AFTER `kinds` ;
ALTER TABLE `mdl_journal` ADD `notice` INT( 2 ) DEFAULT '1' NOT NULL AFTER `passwords` ;
ALTER TABLE `mdl_journal` ADD `showfeedback` INT( 2 ) DEFAULT '1' NOT NULL AFTER `notice` ;
ALTER TABLE `mdl_journal_entries` ADD `kind` TINYINT( 2 ) DEFAULT '0' NOT NULL AFTER `comment` ;
ALTER TABLE `mdl_journal_entries` ADD `password` TEXT AFTER `kind` ;

Yes...looking at mod/lecturefeedback/db/mysql.php, it seems that something like this...

    if ($oldversion < 2004011400) {
        execute_sql(" ALTER TABLE `mdl_journal` ADD `kinds` TEXT AFTER `assessed` ;
                           ALTER TABLE `mdl_journal` ADD `passwords` TEXT AFTER `kinds` ;
                           ALTER TABLE `mdl_journal` ADD `notice` INT( 2 ) DEFAULT '1' NOT NULL AFTER `passwords` ;
                           ALTER TABLE `mdl_journal` ADD `showfeedback` INT( 2 ) DEFAULT '1' NOT NULL AFTER `notice` ;
                           ALTER TABLE `mdl_journal_entries` ADD `kind` TINYINT( 2 ) DEFAULT '0' NOT NULL AFTER `comment` ;
                          ALTER TABLE `mdl_journal_entries` ADD `password` TEXT AFTER `kind` ");
    }

Should make the module upgrade the table itself. I am not sure what the version number should be 2004011400 or a much larger number such as next year, 2006011400 . Or just skip the if statement.

Speaking of which, looking inside the file lecturefeedback/db/mysql.sql of the Prof Kariya version, it seems that it should add the database table itself anyway, at least if there is no Journal Module already installed. It is creating tables called "mdl_lecturefeedback" so there is no point in adding to the mdl_journal table!

All the same, it seems to let me use incorrect passwords in 1.5.

I have nother site which is 1.4.2! And I could not get it to work their either. I was shown the edit lecture feedback button even when logged in as a student.

Timothy