Behaviour is wrong?

Behaviour is wrong?

Alan Thompson - દ્વારા
Number of replies: 11
I have been asked to look at possible bugs in the operation of the module here at the OU, so have two questions, because the Moodle docs dont make the operations clear.

1.  When adding an entry, the default category 'Not categorised' does not show up on the 'Browse by category' tab under 'All Categories'. But if selected from the drop down, all 'Not categorised' entries are displayed.
Is this a bug or is there a reason which explains this behaviour.
If its a bug I need to fix it here at the OU.

2. If a Student should not be able to Add New Entries, then the tab shouldn't be displayed. This appears to be a bug which has been introduced since 1.6, as the moodle demo site does not display this behaviour.
This doesn't look like its been reported as a bug in tracker, so is it being dealt with?
In reply to Alan Thompson

Re: Behaviour is wrong?

Petr Skoda - દ્વારા
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
Could you please file it as bug reports and assign it to me? thanks
In reply to Alan Thompson

Re: Behaviour is wrong?

Joseph Rézeau - દ્વારા
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Alan > 1.  When adding an entry, the default category 'Not categorised' does not show up on the 'Browse by category' tab under 'All Categories'. But if selected from the drop down, all 'Not categorised' entries are displayed. Is this a bug or is there a reason which explains this behaviour.

Not sure I understand what you mean by "when adding an entry etc." This is what happens to me, using Moodle 1.6.3.

1-Browsing a Glossary (containing a certain number of categories)
  1. Go to Glossary. By default the Browse by alphabet display mode is on.
  2. Click on Browse by category.
  3. All categories is displayed by default, the drop-down list shows: All categories.
  4. Clicking on the dropdown list opens it, with Not categorized at the top, followed by the list of the glossary categories.
2-Adding an entry
  1. Click the Add a new entry button.
  2. Screen shows (blank) fields: Concept, Keywords and the HTML editor for entering a Definition.
  3. Screen also shows Categories list, with again Not categorised at the top of the list of categories.
Could you tell us a) which of these two procedures poses you a problem and b) where exactly in the procedure you see something different from what I see?

Joseph

Attachment image00.jpg
In reply to Joseph Rézeau

Re: Behaviour is wrong?

Alan Thompson - દ્વારા
If you create a new entry but dont assign it to a category, at demo.moodle.org which uses moodle 1.6.2,  then the entry does not appear on the Browse Categories tab, until you select Non categorised.
The behaviour is the same in 1.7.
The testers here did not create any Categories to add the new entries to, so they should be assigned to 'Not categorised' but that category dont show up.

When creating an entry is it necessary to select Not categorised?,
this is not explained in the Moodle Docs.
In reply to Alan Thompson

Re: Behaviour is wrong?

Joseph Rézeau - દ્વારા
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Now I understand better what you meant in your first message.wink

Alan > If you create a new entry but dont assign it to a category, at demo.moodle.org which uses moodle 1.6.2,  then the entry does not appear on the Browse Categories tab, until you select Not categorised.

The logic of the glossary categories is as follows:

  • All categories = words belonging to Category A, words belonging to Category B, words belonging to Category Z...
  • Category A = words belonging to Category A
  • Not categorised = words not belonging to any category.
Alan > The testers here did not create any Categories to add the new entries to, so they should be assigned to 'Not categorised' but that category dont show up.

If there are no categories in one glossary, then new entries are assigned to the default Not categorized "category". But this means it is useless to click on the Browse by category button. If you do, the Glossary display defaults to All categories, which is of course empty, and says so "No entries found in this section". To view your uncategorized words you have to select Not categorized from the drop-down list.

This is not a bug, just expected, logical behavior.

The only improvement which could be made to the Glossary display mechanism would be to hide the Browse by category button when no categories have been created in the Glossary. And to display that Browse by category button upon creation of at least one category and containing at least one entry...

Joseph

In reply to Joseph Rézeau

Re: Behaviour is wrong?

Alan Thompson - દ્વારા
I think this is the point which our testers were making here at the OU.
They do not see this as logical behaviour

Shouldnt this default "category" be included and visible as it actually means -
Not categorised = words not belonging to any other category.

Because new entries do not need to be created in a "category" so are not visible

Joseph > The only improvement which could be made to the Glossary display mechanism would be to hide the Browse by category button when no categories have been created in the Glossary. And to display that Browse by category button upon creation of at least one category and containing at least one entry.

The Edit Categories Button is only available after clicking to display Browse by category so would need to be provided some other way.
That would change your suggested improvement to be change the Browse by Category tab to be Create Category while no category exists.


In reply to Alan Thompson

Re: Behaviour is wrong?

Joseph Rézeau - દ્વારા
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Alan > The Edit Categories Button is only available after clicking to display Browse by category some other way.

so would need to be providedThat would change your suggested improvement to be change the Browse by Category tab to be Create Category while no category exists.

You're right, there must be a way to display the Edit categories button (to teacher). How about this:

1-change the Browse by Category tab to be Create Category while no category exists and user is teacher with editing rights...

2- If user has student status and no category exists or categories exist but are all empty, then do not display the Browse by Category

Joseph

In reply to Alan Thompson

Re: Behaviour is wrong?

Joseph Rézeau - દ્વારા
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Alan > 2. If a Student should not be able to Add New Entries, then the tab shouldn't be displayed.

That is the case for me. No bug in sight.wink

Joseph

Attachment image00.jpg
In reply to Joseph Rézeau

Re: Behaviour is wrong?

Alan Thompson - દ્વારા
I have made some further investigations and talked to another developer here at the OU.
This appears to be a problem with roles and permissions as applied Moodle beyond 1.6.2 ie 1.7 Stable.
In 1.6.2 the behaviour is correct but the check uses the old
    if (!isguest()) {
        if ( isteacher($course->id) or $glossary->studentcanpost  ) {

where as the new code just uses
   if (has_capability('mod/glossary:write', $context))

This doesn't take account of the case where Students are not allowed to Add to a Glossary.
In reply to Alan Thompson

Re: Behaviour is wrong?

Joseph Rézeau - દ્વારા
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Alan, you never mentioned in your first post in this thread that you were testing Moodle 1.7 version! How could we guess?
Joseph