Details
-
Type:
Sub-task
-
Status:
Resolved
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 1.9.1
-
Fix Version/s: 1.9.8
-
Component/s: Block: AJAX Marking
-
Labels:None
-
Environment:Windows server 2003, webapp server, also reproduced on clean OS X package 1.9.2
-
Database:MySQL
-
Affected Branches:MOODLE_19_STABLE
-
Fixed Branches:MOODLE_19_STABLE
Description
When I try to configure the block as an admin, it shows me the following message: "This block has not been implemented correctly and thus cannot provide a configuration interface.". I have followed all normal procedures.
The block is actually working (apart from essay questions) but I just cannot configure it.
Cheers, Fred
Attachments
-
$i18n.getText("admin.common.words.hide")
- ajax_marking_2008100802.zip
- 09/Oct/08 1:25 AM
- 102 kB
- Matt Gibson
-
- ajax_marking/ajax.php 110 kB
- ajax_marking/block_ajax_marking.php 8 kB
- ajax_marking/CVS/Entries 0.3 kB
- ajax_marking/CVS/Entries.Extra 0.2 kB
- ajax_marking/CVS/Entries.Extra.Old 0.2 kB
- ajax_marking/CVS/Entries.Old 0.3 kB
- ajax_marking/CVS/Repository 0.0 kB
- ajax_marking/CVS/.../ajax.php#1.4 110 kB
- ajax_marking/.../block_ajax_marking.php#1.5 8 kB
- ajax_marking/CVS/.../javascript.js#1.4 69 kB
- ajax_marking/CVS/.../styles.php#1.3 7 kB
- ajax_marking/CVS/Root 0.0 kB
- ajax_marking/db/CVS/Entries 0.1 kB
- ajax_marking/db/CVS/Entries.Extra 0.0 kB
- ajax_marking/db/CVS/Entries.Extra.Old 0.0 kB
- ajax_marking/db/CVS/Entries.Old 0.1 kB
- ajax_marking/db/CVS/Repository 0.0 kB
- ajax_marking/db/CVS/Root 0.0 kB
- ajax_marking/db/install.xml 2 kB
- ajax_marking/db/upgrade.php 2 kB
- ajax_marking/images/ajax-loader.gif 0.8 kB
- ajax_marking/images/close.png 0.9 kB
- ajax_marking/images/CVS/Entries 0.0 kB
- ajax_marking/images/CVS/Entries.Extra 0.0 kB
- ajax_marking/images/.../Entries.Extra.Old 0.0 kB
- ajax_marking/images/CVS/Entries.Old 0.0 kB
- ajax_marking/images/CVS/Repository 0.0 kB
- ajax_marking/images/CVS/Root 0.0 kB
- ajax_marking/images/resize.png 2 kB
- ajax_marking/images/Thumbs.db 6 kB
$i18n.getText("admin.common.words.show")- ajax_marking_2008100802.zip
- 09/Oct/08 1:25 AM
- 102 kB
- Matt Gibson
-
$i18n.getText("admin.common.words.hide")
- ajax_marking_2008100901.zip
- 09/Oct/08 7:00 PM
- 103 kB
- Matt Gibson
-
- ajax_marking/ajax.php 110 kB
- ajax_marking/block_ajax_marking.php 8 kB
- ajax_marking/CVS/Entries 0.3 kB
- ajax_marking/CVS/Entries.Extra 0.2 kB
- ajax_marking/CVS/Entries.Extra.Old 0.2 kB
- ajax_marking/CVS/Entries.Old 0.3 kB
- ajax_marking/CVS/Repository 0.0 kB
- ajax_marking/CVS/.../ajax.php#1.4 110 kB
- ajax_marking/.../block_ajax_marking.php#1.5 8 kB
- ajax_marking/CVS/.../javascript.js#1.4 69 kB
- ajax_marking/CVS/.../styles.php#1.3 7 kB
- ajax_marking/CVS/Root 0.0 kB
- ajax_marking/db/CVS/Entries 0.1 kB
- ajax_marking/db/CVS/Entries.Extra 0.0 kB
- ajax_marking/db/CVS/Entries.Extra.Old 0.0 kB
- ajax_marking/db/CVS/Entries.Old 0.1 kB
- ajax_marking/db/CVS/Repository 0.0 kB
- ajax_marking/db/CVS/Root 0.0 kB
- ajax_marking/db/install.xml 2 kB
- ajax_marking/db/upgrade.php 2 kB
- ajax_marking/images/ajax-loader.gif 0.8 kB
- ajax_marking/images/close.png 0.9 kB
- ajax_marking/images/CVS/Entries 0.0 kB
- ajax_marking/images/CVS/Entries.Extra 0.0 kB
- ajax_marking/images/.../Entries.Extra.Old 0.0 kB
- ajax_marking/images/CVS/Entries.Old 0.0 kB
- ajax_marking/images/CVS/Repository 0.0 kB
- ajax_marking/images/CVS/Root 0.0 kB
- ajax_marking/images/resize.png 2 kB
- ajax_marking/images/Thumbs.db 6 kB
$i18n.getText("admin.common.words.show")- ajax_marking_2008100901.zip
- 09/Oct/08 7:00 PM
- 103 kB
- Matt Gibson
Issue Links
| This issue will be resolved by: | ||||
| CONTRIB-1844 | Ajax marking block invalid module ID |
|
|
|
Activity
- All
- Comments
- History
- Activity
- Source
- Test Sessions
Hi Matt,
thanks for a very speedy reply
. You are right, I do get this message when I click on the "edit" button at the top of the block. All is good.
I have been having problems with the "essay" questions displaying. Is there any chance to disable the support for "essay questions" altogether? Is it as easy as commenting out a few lines in a php file? If so, which ones do I need to comment out
?
I don't particularly have any great ideas when it comes to configuration features, but would it be time consuming for you to allow admins to decide which assignment types are taken care of on a site-wide basis? For example, being able to disable forum support altogether, across the whole site.
Thanks a lot for a great block.
Cheers,
Fred
Hi Fred,
thanks for your comments. Commenting php code should work fine - in ajax.php comment the following:
90, 104, 336-371, 419-421 (haven't tried it yet as I have no test data at the moment)
What problems with essay questions did you encounter exactly? I've not used essay questions a lot since I rewrote the code, so I may have missed a bug or two. I'll certainly work on adding site wide admin settings for which types to display, and perhaps course by course ones too.
Hi Matt,
thanks for the line numbers, I'll try this tomorrow as I cannot access my server right now. I'll let you know how it went.
Basically, the problem with the essay questions is the following:
when there are essay questions to be marked, the name of the question appears in the tree, with the correct number of questions to be marked in brackets, but as soon as I click on it to get more details, I get the un-ending spinning wheel and cannot access the questions at all. Do you have any idea what the problem might be?
The course by course admin settings sounds nice, especially for courses which are taught by more than 1 teacher ![]()
Cheers,
Fred
Hi Fred,
I've checked on my install and can't reproduce the problem. I'm using a quiz with two essay questions only and they show up fine. Can you give me more details about the way you have set things up?
It would be useful to see what the information is thats coming back from the sever, so if you have the time you could alter line 129 of block_ajax_marking.php so that
$CFG->wwwroot.'/blocks/ajax_marking/javascript-min.js
becomes
$CFG->wwwroot.'/blocks/ajax_marking/javascript.js
and then uncomment lines 122-124 of javascript.js, you should get the response text added to the top of the block as it comes in. Paste it in here when the thing keeps spinning and it should be possible to see whats going wrong.
Hi Matt,
thanks for the speedy reply. Sorry I couldn't get back to you sooner but my ADSL was broken down over the weekend ![]()
I did not change anything specific when I installed your block. I set up some essay questions as a teacher and then got a couple of test students to take it. I then tried to retrieve the data as a teacher again but could not get the essay questions to display. I tried doing what you told me, emptied the cache and here are the messages that I got (they appeared in a popup):
Message at login
[{"type":"main"},{"id":"8","type":"course","name":"INSETT","count":"2","cid":"c8"}]
Message when clicked on the course name
[{"type":"course"},{"name":"Example test","id":"2","assid":"q2","cmid":"122","type":"quiz","summary":"","count":"2"}]
Message when I clicked on the name of the assignment (essay type): empty popup box :=(
So, I turned on debugging for developers and I got this:
<br />
<b>Notice</b>: Undefined index: journal in <b>C:\AppServ\www\moodle\blocks\ajax_marking\ajax.php</b> on line <b>382</b><br />
<br />
<b>Notice</b>: Trying to get property of non-object in <b>C:\AppServ\www\moodle\blocks\ajax_marking\ajax.php</b> on line <b>382</b><br />
<div class="notifytiny" style="text-align:center">You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND c.visible = 1
AND j.assessed 0
AND je.mod' at line 8<br /><br />
SELECT je.id as entryid, je.userid, j.course, j.id, c.id as cmid
FROM mdl_journal_entries je
INNER JOIN mdl_journal j
ON je.journal = j.id
INNER JOIN mdl_course_modules c
ON j.id = c.instance
WHERE c.module =
AND c.visible = 1
AND j.assessed <> 0
AND je.modified > je.timemarked
<ul style="text-align:left"><li>line 686 of lib\dmllib.php: call to debugging()</li><li>line 966 of lib\dmllib.php: call to get_recordset_sql()</li><li>line 389 of blocks\ajax_marking\ajax.php: call to get_records_sql()</li><li>line 77 of blocks\ajax_marking\ajax.php: call to ajax_marking_functions->courses()</li><li>line 2356 of blocks\ajax_marking\ajax.php: call to ajax_marking_functions->ajax_marking_functions()</li></ul></div>
<br />
<b>Notice</b>: Object of class stdClass could not be converted to int in <b>C:\AppServ\www\moodle\blocks\ajax_marking\ajax.php</b> on line <b>2244</b><br />
<br />
<b>Notice</b>: Object of class stdClass could not be converted to int in <b>C:\AppServ\www\moodle\blocks\ajax_marking\ajax.php</b> on line <b>2244</b><br />
<br />
<b>Notice</b>: Object of class stdClass could not be converted to int in <b>C:\AppServ\www\moodle\blocks\ajax_marking\ajax.php</b> on line <b>2244</b><br />
<br />
<b>Notice</b>: Object of class stdClass could not be converted to int in <b>C:\AppServ\www\moodle\blocks\ajax_marking\ajax.php</b> on line <b>2244</b><br />
<br />
<b>Notice</b>: Object of class stdClass could not be converted to int in <b>C:\AppServ\www\moodle\blocks\ajax_marking\ajax.php</b> on line <b>2244</b><br />
<br />
<b>Notice</b>: Object of class stdClass could not be converted to int in <b>C:\AppServ\www\moodle\blocks\ajax_marking\ajax.php</b> on line <b>2244</b><br />
[{"type":"main"},{"id":"8","type":"course","name":"INSETT","count":"2","cid":"c8"}]
I'm very sorry about the stupidly long message, please feel free to delete it if it's useless. I could not find a way to attach a text file to this comment.
I hope this is going to be of use to you.
Cheers,
Fred
Thanks Fred,
thats just what I need. I'll get on to debugging/testing that, but it may take a few days - lots on at the moment.
Matt
Hi Fred, soory for the dealy - exams to deal with.
Am I right in assuming that you don't have the journal module installed? It seems as though you might not, in which case, have a look at line 382 or thereabouts in ajax.php and add the first and last lines as you can see beolw around the journals code ("if ..." and the single curly bracket)
if (array_key_exists("journal", $this->modules)) {
$sql = "
SELECT je.id as entryid, je.userid, j.course, j.id, c.id as cmid
FROM {$CFG->prefix}journal_entries je
INNER JOIN {$CFG->prefix}journal j
ON je.journal = j.id
INNER JOIN {$CFG->prefix}course_modules c
ON j.id = c.instance
WHERE c.module = {$this->modules['journal']->id}
AND c.visible = 1
AND j.assessed <> 0
AND je.modified > je.timemarked
";
$journal_submissions = get_records_sql($sql);
}
That should remove that error, but I'm not sure why that would affect the essay questions showing up. Let me know if it works.
Hi Matt,
thanks a lot for looking into this issue, especially in this busy time of the year for you.
I have made the changes that you have provided me with but unfortunately it has not removed the error. The block shows the right data (number of assignments to be marked) but I still get the spinning wheel.
I have reset the cache to no avail. Would you recommend me to download and install the journal module?
Cheers,
Fred
No, don't worry about the module - it should work without it. Do you still get the error about the missing index and the SQL stuff that you posted above (if you uncomment those debugging lines again, that is).
I've confirmed that the essay questions load fine for me, so I just need to be able to reproduce.
I do not get the error any longer. I have tried it on another clean install (just to make sure) and I also get the spinning wheel.
Thanks again for looking into this. Would you like any more information on my settings/install?
Cheers,
Fred
Just to confirm - is that no error when you uncomment lines 115-118 of javascript.js and change line 129 of block_ajax_marking.php to
</div>".require_js(array('yui_yahoo', 'yui_event', 'yui_dom', 'yui_treeview', 'yui_connection', 'yui_dom-event', 'yui_container', $CFG->wwwroot.'/blocks/ajax_marking/javascript.js'))."";
(javascript-min.js becomes javascript.js)?
I've just rewritten the click event code to fix another issue, so try updating to this one (you might need to update moodle to the latest build as well to get it working). Let me know if it helps.
Hi Matt,
thanks for rewritting the block. I have tried both upgrades and I cannot get the second one to work at all. I cannot upgrade to 1.9.2 at the moment as I have many files that I have modified and I have not made a list of those (yet).
The first upgrade "works" but I still get the spinning wheel for the "essay" questions.
I'll let you know whether the second upgrade works when I update to 1.9.2.
Cheers,
Fred
No problem. Its not impossible that one of your customisation could be clashing with something about the block, but perhaps unlikely, given how it works. If it still happens after upgrade send me a copy of your course (minus student data, of course) and I'll see if I can reproduce the issue.
Hi Fred,
fixing another issue, it has turned out that the database table had not been set up properly. Could you have a look and see if block_ajax_marking is there? You may need to use the mysqladmin module from the modules and plugins database if you don't have direct database access.
Another fixed issue found a small error in the quiz questions SQL. Its fairly likely that the latest version from the modules and plugins download page will fix this now.
I think I may have finally found the culprit! The latest code ought to solve an issue that would only affect a small number of sites with certain other modules installed, so please let me know if you have any success with it.
Marking this as fixed, seeing as I've not heard any more about it since the code change. Add comments if otherwise and I'll reopen it.
Hi Fred,
I assume you mean that this error pops up when you click on the edit icon at the top of the block. I get the same, but this is deliberate - I didn't design an editing interface for the whole block as the configuration is done on a per-user basis. To be honest, I'd assumed that the edit icon would not show up as I did specify in the code that there is no config screen, so maybe there is a wider bug in the Moodle blocks code. To alter the visibility of assessment items, use the 'configuration' link at the bottom right of the block. To do it for other users, log in as that user and do the same.
Are there any other configuration feature that you had in mind and think would be useful?
Matt