Non-core contributed modules

Hooray nothing to mark, even though several students have submitted work

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.4
  • Fix Version/s: 1.9.5
  • Component/s: Block: AJAX Marking
  • Labels:
    None
  • Environment:
    clean install 1.9.4 of moodle and the feb 2009 version of ajax marking
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

i have assigned a teacher role to the course, (teacher) added a student to the course, and added assignments to course.. got student to submitt assignment, one single file and advanced uploads.. logged in as teacher, tells me recent activity, student submitted work, ajax marking says hooray n othing to mark, when there is at least 4 assignments that require marking..

Activity

Hide
James Rudd added a comment - - edited

If this is a clean install you are likely experiencing the same problem I did. It did not create the config entries so it does not know which activities to check for work.

After you copy the directory to block and run notification it creates the block_ajax_marking table. However, it does not run the second half of the update script (detailed in db/upgrade.php) to populate the config entry.

After installing I had to manually increment the version number to make it run the upgrade script and re-detect the modules to add an entry to config_plugin table. After this it worked fine.
To increment the version just open block_ajax_marking.php and change $this->version = 2009051802;
Then go to the notification page and it will create the config entries.

You can check if this is the problem by enabling Debug mode and Display Debug. If you then go to a screen with the plugin it gives a warning about the foreach statement having an invalid argument (i.e. an empty array)

Show
James Rudd added a comment - - edited If this is a clean install you are likely experiencing the same problem I did. It did not create the config entries so it does not know which activities to check for work. After you copy the directory to block and run notification it creates the block_ajax_marking table. However, it does not run the second half of the update script (detailed in db/upgrade.php) to populate the config entry. After installing I had to manually increment the version number to make it run the upgrade script and re-detect the modules to add an entry to config_plugin table. After this it worked fine. To increment the version just open block_ajax_marking.php and change $this->version = 2009051802; Then go to the notification page and it will create the config entries. You can check if this is the problem by enabling Debug mode and Display Debug. If you then go to a screen with the plugin it gives a warning about the foreach statement having an invalid argument (i.e. an empty array)
Hide
Matt Gibson added a comment -

I just put code into CVS which fixes the problem James described where the config entries were not created on install. New version = 2009061101

Thanks for the report and let me know if that doesn't fix it.

Show
Matt Gibson added a comment - I just put code into CVS which fixes the problem James described where the config entries were not created on install. New version = 2009061101 Thanks for the report and let me know if that doesn't fix it.
Hide
James Rudd added a comment -

Hi Matt,
Thanks for the quick fix.
I may be reading wrong, but do the changes to upgrade.php mean that the code to update config entry will only run on initial install and not on updates? Would it have been better to move the config generation code to a function that is called by both the initial install and the upgrade process?

Also I've just been looking through the CVS commit, and there seem to be several changes not related to this bug. (e.g. javascript.js changes).

Show
James Rudd added a comment - Hi Matt, Thanks for the quick fix. I may be reading wrong, but do the changes to upgrade.php mean that the code to update config entry will only run on initial install and not on updates? Would it have been better to move the config generation code to a function that is called by both the initial install and the upgrade process? Also I've just been looking through the CVS commit, and there seem to be several changes not related to this bug. (e.g. javascript.js changes).
Hide
Matt Gibson added a comment -

Hi James,

The upgrade.php script is called any time the version number in he main block file differs from the one in the database. I've removed the check for he old version to be lower than a particular number around the config code, so it will run every time. The new function after_install() in block_ajax_marking.php does the job on first install and does result in code duplication. I just didnt have time to make it any more elegant Similarly, the code in javascript.js etc is for something else (can't remember what) and got comitted accidentally because I was in a rush.

I'll tidy it up over the weekend. At least it works for now

Show
Matt Gibson added a comment - Hi James, The upgrade.php script is called any time the version number in he main block file differs from the one in the database. I've removed the check for he old version to be lower than a particular number around the config code, so it will run every time. The new function after_install() in block_ajax_marking.php does the job on first install and does result in code duplication. I just didnt have time to make it any more elegant Similarly, the code in javascript.js etc is for something else (can't remember what) and got comitted accidentally because I was in a rush. I'll tidy it up over the weekend. At least it works for now
Hide
sean added a comment -

Thanks James It worked for me, all issues were resolved, all assignments are now visible...

Show
sean added a comment - Thanks James It worked for me, all issues were resolved, all assignments are now visible...
Hide
Matt Gibson added a comment -

Code duplication fixed in CVS.

Show
Matt Gibson added a comment - Code duplication fixed in CVS.
Hide
Matt Gibson added a comment -

All sorted in CVS, so closing.

Show
Matt Gibson added a comment - All sorted in CVS, so closing.

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: