Showing Quiz open times too on the quiz index page

Showing Quiz open times too on the quiz index page

by Timothy Takemoto -
Number of replies: 8

At it stands, quiz open times are not shown on mod/quiz/index.php (the page you see when you click on the quiz link in the left hand activity block) that shows a list of the quizes in a course. Only the quiz close times are displayed

This means that it is easy to check that the close times are right. But there is no standard page that shows all the open times, so it is easy to get those wrong. My guess is that teachers would like to see a list of the open times too.

I am not sure why one would want to hide the quiz open times from the student .

It was quite easy to alter mod/quiz/index.php to have an extra column showing the open time for each quiz.

Please see attached, which is for moodle 1.5.2 and alter your moodle with care, backing up first.

Tim

PS. Brian Koontz's super Course Date Manager block does show all the open and close times, but it does not show them in section order (rather in date order) and this also can be confusing. If it were me, this quiz index page would include the functionality of Brian's block, in the section order.

Average of ratings: -
In reply to Timothy Takemoto

Re: Showing Quiz open times too on the quiz index page

by Gustav W Delius -
Timothy, I think that is a sensible suggestion and very easy to implement. Can you please put it in the bug tracker as a feature request? Moodle 1.6 is now frozen, but it could go into 1.7.
In reply to Gustav W Delius

Re: Showing Quiz open times too on the quiz index page

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Gustav,

You say that Moodle 1.6 is now "frozen". I was really hoping that my new regular expression question type would be part of the 1.6 distribution. As my university only upgrades once a year, if I can't make this go into 1.6, it means I'll have to wait another full year to be able to use it.sad

Joseph

PS Have you seen my latest development in the bug tracker?

In reply to Joseph Rézeau

Re: Showing Quiz open times too on the quiz index page

by Jeff Forssell -
I've been trying to help with testing of this module, because I also thought (=hoped?) it would be in 1.6. sad   
In reply to Joseph Rézeau

Question types

by Gustav W Delius -
Joseph, new question types do not require changes of the core Moodle code. So they can be added by any Moodle administrator at any time.
In reply to Gustav W Delius

Re: Question types

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Gustav,

Yes, I know you have worked quite hard at making the question type independent from core code.approve However, as you can see in my bug report, it is not quite so simple.

1- Any new question type will work without any change to core question & quiz code. However, there remain a few alterations to be made to other core code files for it to work fully.

Let's first the example of a new question type called MYQUESTIONTYPE.

a) If you want questions created with MYQUESTIONTYPE to be exported/imported (e.g. in the Moodle XML format) you have to modify \question\format\xml\format.php.

b) If you want to follow the same conventions as for the other question types, you'll need to make this addition to lib\questionlib.php: define("MYQUESTIONTYPE", "myquestiontype");

c) There is a little formatting problem, since MYQUESTIONTYPE is not known to \mod\quiz\styles.php e.g. here:

mod-quiz-attempt .que.shortanswer .feedback,
#mod-quiz-attempt .truefalse .feedback {

(would need to add #mod-quiz-attempt .myquestiontype .feedback).

d) There is another problem because the <title> tag for the new regexp question type is created through \lib\questionlib.php:

function print_question_icon($question, $editlink=true, $return = false) {
// returns a question icon
global $QTYPES, $CFG;
$namestr = get_string($question->qtype, 'quiz');

One has to add to \lang\...\quiz.php this line:

$string['myquestiontype'] = 'My brand-new question type';

2- I also need my new question type (regular expression short answer) to be available to the existing Close (Embedded) question type. So I've had to modify \question\type\multianswer\questiontype.php file for it to accomodate my new question type.

Of course, if all the points mentioned above (1a through 1d) could be solved in the core files so that any new question type would really work by only dropping it into \question\type, it would be an ideal situation. In the meantime, I really have to insist that the regexp question type be made part of 1.6, for the reasons mentioned in my previous post.wink

Thanks in advance,

Joseph

PS I've uploaded my new type and proposed modified core files for version 1.6 beta 3 to the bug tracker.

In reply to Joseph Rézeau

Re: Question types

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Just to chip in on the first point about import/export formats...

The short answer is yes - you are quite correct. We have thought quite hard about a logical/clever way to unravel this but we have not really found anything. One idea was to split up the import export formats into a discrete file/class for every questiontype for every format. It doesn't work though - xml is the easy one really, but if you consider GIFT format you would have to (a) think of a way of extensing the actual format to accomodate the new question type and then (b) extend the code to handle it. The big difficulty is that with most of these formats, nearly all the work is done parsing the questions before you know what type of question it is.

I am very much open to suggestions here. I have a vague notion that as the import/output formats are built on classes there may be a way to override the standard functionality to provide new questiontypes but as different developers have written these classes in different ways it is still far from straightforward.
In reply to Timothy Takemoto

Re: Showing Quiz open times too on the quiz index page

by Timothy Takemoto -

I have added one more column to show the start date of the section in weekly format courses, using code from the format.php of the weekly course.

This enables the teacher to check that the quiz is set to open on the same date as the weekly section starts.

This is what it looks like (sorry it is in Japanese but you get the idea)
quiz

Please see attached file.

And now if only Brian's course date manager code could be added to this!

Tim