Blocks can now be added to quiz pages!

Blocks can now be added to quiz pages!

by John Papaioannou -
Number of replies: 7
Everyone who uses quiz with the latest development version is in for a pleasant surprise today! cool

We can now add blocks to the quiz view pages (mod/quiz/view.php) as we would to any course. There is only one column for blocks (on the left), but the interface has not changed at all. A new "Add/Edit Blocks" button allows turning editing on/off, as in courses.

Right now most of the blocks can be added to a quiz page, and many of them may not work correctly because in the past they assumed they were being displayed in a course. Therefore the list of available blocks will be trimmed down as these incompatibilities are assessed in the near future.

It will sure be nice to see what fresh ideas this new feature brings! smile

Jon
Average of ratings: -
In reply to John Papaioannou

Re: Blocks can now be added to quiz pages!

by Gustav W Delius -

Jon, your blocks code looks quite powerful. cool

The surprise would have been even more pleasant if there were fewer PHP notices generated by the modified page. Apparently $this->modulerecord is undefined.

In reply to Gustav W Delius

Re: Blocks can now be added to quiz pages!

by John Papaioannou -
Err... I don't get any notices at all. And I really did poke around that thing to make sure everything was fine. thoughtful

File name/line/version?
In reply to John Papaioannou

Re: Blocks can now be added to quiz pages!

by daniel ginerman -
any possibility of adding the same feature to every category page?
i'd like to convert every category page (that is, the one which has the list and summaries of all it's courses) in something powerful, a kind of virtual entrance for specific users. to do that, I need to have more features on them.... to add blocks, some html in fact, etc
wait 4answer, thanx from now,

daniEl
In reply to daniel ginerman

Re: Blocks can now be added to quiz pages!

by John Papaioannou -
It might be possible, but unfortunately there are no current plans to do that in the near future. Right now blocks support is being added to activity modules, and after the 1.5 release the major focus for the kind of "virtual entrance" that you describe will be "My Moodle". Conversely, that's where development will focus.

However, if you have programming skills (or access to someone else who does) then Moodle 1.5 will allow you to experiment with what you suggest. It offers a standardized way for developers to use blocks in any kind of page (the Holy Grail of Blocks smile) and should make things a lot easier.

Jon
In reply to John Papaioannou

Re: Blocks can now be added to quiz pages!

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers
Jon...Gustav...anyone! smile

Is there an easy way to make the Quiz Results block viewable only by teachers/admins and NOT students?? I had a quick look, but cant see anyting about if ($isteacheredit).

Any help would be much appreciated.
In reply to Jon Bolton

Re: Blocks can now be added to quiz pages!

by John Papaioannou -
Before:

if($this->instance->pagetype == 'course-view') {

Add:

if(!isteacher()) {
    return $this->content;
}

smile