Moodle

Make it possible to have the ##user## (=author) a sortable and searchable field

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8, 1.9
  • Fix Version/s: 1.9.1
  • Labels:
    None
  • Affected Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

At present, in the Database activity module it is possible to add ##user## to entries, and this indicates who authored the entry, but it is not possible to search or sort with this ##user## information.

Although, it is possible to create a field called 'name' and ask users to type in their name to make the database sortable and searchable by author, this 'workaround' is prone to error due to users not being consistent in how they type their names. It is also annoying for users to have to keep on typing their names - although this could be solved with a save as new button

So, an improvement to the Database activity module to make ##user## (author) a sortable & searchable field would be much appreciated.

see
http://moodle.org/mod/forum/discuss.php?d=71742

  1. data_name_search.patch
    16/Apr/08 5:40 PM
    16 kB
    Petr Škoda (skodak)
  2. MDL-9907-Valid_HTML.patch
    18/Apr/08 5:27 AM
    1 kB
    Robert Allerstorfer

Issue Links

Activity

Hide
Helen Foster added a comment -

Increasing the priority of this issue and setting a fix version, as it's a really important feature for teachers.

Show
Helen Foster added a comment - Increasing the priority of this issue and setting a fix version, as it's a really important feature for teachers.
Hide
Peter Ruthven-Stuart added a comment -

Thank you Helen.

Very much looking forward to this feature.

Show
Peter Ruthven-Stuart added a comment - Thank you Helen. Very much looking forward to this feature.
Hide
Thomas Robb added a comment -

In order for the data module to be used for applications such as the submission of book reports (where we require database functionality rather than the submission of a simple document) it would be very useful to have a setting in the permissions that says "view only own submissions" to that students do not rely on the information of other students when submitting their own report. Should I submit a separate feature request for this? Does it sound reasonable?

Show
Thomas Robb added a comment - In order for the data module to be used for applications such as the submission of book reports (where we require database functionality rather than the submission of a simple document) it would be very useful to have a setting in the permissions that says "view only own submissions" to that students do not rely on the information of other students when submitting their own report. Should I submit a separate feature request for this? Does it sound reasonable?
Hide
Helen Foster added a comment -

Hi Thomas,

Is the "Require approval" setting, which hides entries from other students until the teacher has approved them, a possible solution for students to view only their own entries?

Perhaps we could use the database module forum http://moodle.org/mod/forum/view.php?id=3505 for discussing this?

Show
Helen Foster added a comment - Hi Thomas, Is the "Require approval" setting, which hides entries from other students until the teacher has approved them, a possible solution for students to view only their own entries? Perhaps we could use the database module forum http://moodle.org/mod/forum/view.php?id=3505 for discussing this?
Hide
Jay Melton added a comment -

I would very much like this feature as well. MDL-6391 is a similar request, I believe: http://tracker.moodle.org/browse/MDL-6391

Show
Jay Melton added a comment - I would very much like this feature as well. MDL-6391 is a similar request, I believe: http://tracker.moodle.org/browse/MDL-6391
Hide
Petr Škoda (skodak) added a comment -

please test the attached patch (for latest 1.9+), thanks

Show
Petr Škoda (skodak) added a comment - please test the attached patch (for latest 1.9+), thanks
Hide
Robert Allerstorfer added a comment -

Thanks for the patch, Petr. I have applied it and what I saw is:

The two new tags "##firstname##" and "##lastname##" now appear on the "Advanced search template" sub page of the "Templates" tab. However, since the Advanced search template functionality is currently broken, I can't use them (see the last two posts at http://moodle.org/mod/forum/discuss.php?d=73655).

When I click the "Reset template" button, the new user fields don't appear within the template box.

Show
Robert Allerstorfer added a comment - Thanks for the patch, Petr. I have applied it and what I saw is: The two new tags "##firstname##" and "##lastname##" now appear on the "Advanced search template" sub page of the "Templates" tab. However, since the Advanced search template functionality is currently broken, I can't use them (see the last two posts at http://moodle.org/mod/forum/discuss.php?d=73655). When I click the "Reset template" button, the new user fields don't appear within the template box.
Hide
Petr Škoda (skodak) added a comment -

Well, it works for me. The fields are not there after template reset, but you can add them maunaly.

Show
Petr Škoda (skodak) added a comment - Well, it works for me. The fields are not there after template reset, but you can add them maunaly.
Hide
Petr Škoda (skodak) added a comment -

I guess you are talking about MDL-14018, right?

Show
Petr Škoda (skodak) added a comment - I guess you are talking about MDL-14018, right?
Hide
Petr Škoda (skodak) added a comment -

should be fixed now, thanks for the report
going to fix some more bugs I found while testing this now

Show
Petr Škoda (skodak) added a comment - should be fixed now, thanks for the report going to fix some more bugs I found while testing this now
Hide
Robert Allerstorfer added a comment -

I recognized that the problem I came across a week ago has been fixed in the meantime (after pressing the "Save template" button, the content disappeared instead of being saved). So the advanced search template functionality is no more broken - sorry about not mentioning that correctly above.

So I was now able to test your new ##firstname## ##lastname## fields successfully - they are working fine, thanks a lot!

Show
Robert Allerstorfer added a comment - I recognized that the problem I came across a week ago has been fixed in the meantime (after pressing the "Save template" button, the content disappeared instead of being saved). So the advanced search template functionality is no more broken - sorry about not mentioning that correctly above. So I was now able to test your new ##firstname## ##lastname## fields successfully - they are working fine, thanks a lot!
Hide
Robert Allerstorfer added a comment -

Petr, after seeing your implementation in action, I want to suggest an improvement: since the new ##firstname## and ##lastname## tags can only be used within the asearchtemplate, I think it should behave like the other search fields within that template. This means that it should be possible to have a multi-select field offering all names (in the form firstname lastname) of users owning records of that database. Currently both the new tags create a single input text field, but a list off the available names is still impossible. The requested feature was to be able to choose the user(s) whose records should be shown in the search results.

Show
Robert Allerstorfer added a comment - Petr, after seeing your implementation in action, I want to suggest an improvement: since the new ##firstname## and ##lastname## tags can only be used within the asearchtemplate, I think it should behave like the other search fields within that template. This means that it should be possible to have a multi-select field offering all names (in the form firstname lastname) of users owning records of that database. Currently both the new tags create a single input text field, but a list off the available names is still impossible. The requested feature was to be able to choose the user(s) whose records should be shown in the search results.
Hide
Robert Allerstorfer added a comment -

I would propose to add two more tags for a selection menu list of users, ##usersmenu## and ##usersmultimenu##.

Show
Robert Allerstorfer added a comment - I would propose to add two more tags for a selection menu list of users, ##usersmenu## and ##usersmultimenu##.
Hide
Robert Allerstorfer added a comment -

Petr, currently, using ##lastname## creates the following HTML code:
<input type="text" size="16" name="u_ln" value="">
which is invalid HTML. It should be

<input type="text" size="16" name="u_ln" value="" />

Show
Robert Allerstorfer added a comment - Petr, currently, using ##lastname## creates the following HTML code: <input type="text" size="16" name="u_ln" value=""> which is invalid HTML. It should be <input type="text" size="16" name="u_ln" value="" />
Hide
Robert Allerstorfer added a comment -

The attached patch makes your HTML valid.

Show
Robert Allerstorfer added a comment - The attached patch makes your HTML valid.
Hide
Peter Ruthven-Stuart added a comment -

Petr,

The Database module in my moodle system no longer works since the update mentioned above.

I updated my moodle system via cvs on Thursday, the 17th. Now, when I try to access a database the browser hangs and I'm locked out of moodle. This still happens with today's cvs download.

This is the error I get in Firefox:

> Server Error
> The following error occurred:

> [code=SERVER_RESPONSE_CLOSE] The server closed the connection while reading the response. Contact your system administrator.

I am able to create a new database, but when I try to access it, the browser hangs.

However, I am able to get in through a 'back door' by using the following url:

http://vle.c.fun.ac.jp/moodle/mod/data/templates.php?d=34&mode=listtemplate

in other words, I can access the template 'tab' and other tabs, BUT when clicking on the 'View List' or 'Single view' tab the browser hangs.

Here's pat of my MySQL log that may be relevant:

> 080419 16:36:15 mysqld started
> 080419 16:36:16 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
> 080419 16:36:16 InnoDB: Started; log sequence number 0 43655
> 080419 16:36:16 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
> Version: '5.0.37' socket: '/tmp/mysql.sock' port: 3306 MySQL Community Server (GPL)

Any suggestions will be most welcome.

system details:
moodle 1.9 (build 20080419)
php 5.2.1
MySQL 5.0.37

Show
Peter Ruthven-Stuart added a comment - Petr, The Database module in my moodle system no longer works since the update mentioned above. I updated my moodle system via cvs on Thursday, the 17th. Now, when I try to access a database the browser hangs and I'm locked out of moodle. This still happens with today's cvs download. This is the error I get in Firefox: > Server Error > The following error occurred: > [code=SERVER_RESPONSE_CLOSE] The server closed the connection while reading the response. Contact your system administrator. I am able to create a new database, but when I try to access it, the browser hangs. However, I am able to get in through a 'back door' by using the following url: http://vle.c.fun.ac.jp/moodle/mod/data/templates.php?d=34&mode=listtemplate in other words, I can access the template 'tab' and other tabs, BUT when clicking on the 'View List' or 'Single view' tab the browser hangs. Here's pat of my MySQL log that may be relevant: > 080419 16:36:15 mysqld started > 080419 16:36:16 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive > 080419 16:36:16 InnoDB: Started; log sequence number 0 43655 > 080419 16:36:16 [Note] /usr/local/mysql/bin/mysqld: ready for connections. > Version: '5.0.37' socket: '/tmp/mysql.sock' port: 3306 MySQL Community Server (GPL) Any suggestions will be most welcome. system details: moodle 1.9 (build 20080419) php 5.2.1 MySQL 5.0.37
Hide
Petr Škoda (skodak) added a comment -

Strange, this works for me fine on several servers. I am going to work more mssql and oracle compatibility this weekend, I hope I will spot something, sorry for the trouble.

Show
Petr Škoda (skodak) added a comment - Strange, this works for me fine on several servers. I am going to work more mssql and oracle compatibility this weekend, I hope I will spot something, sorry for the trouble.
Hide
Robert Allerstorfer added a comment -

Peter,

did you try to first go to "Site Administration -> Server -> Debugging", set "Debug messages" to DEVELOPER and check the "Display debug messages" box?

Maybe you see some interesting messages when you re-try to view to the affected pages afterwards. Once you are finished with debugging, you should of course uncheck the "Display debug messages" box.

Robert

Show
Robert Allerstorfer added a comment - Peter, did you try to first go to "Site Administration -> Server -> Debugging", set "Debug messages" to DEVELOPER and check the "Display debug messages" box? Maybe you see some interesting messages when you re-try to view to the affected pages afterwards. Once you are finished with debugging, you should of course uncheck the "Display debug messages" box. Robert
Hide
Peter Ruthven-Stuart added a comment -

Robert,

Thank you for the advice re turning on Debugging.

I have done this, but the "The server closed the connection" error appears after about 300 seconds, as described above. Changing the timeout settings in php.ini, httpd.php, and even Firefox settings (about:config), does not change this. So, I have been unable to see any debugging errors.

This is strange, since I have another moodle system on a server, which is basically the same setup as the problem server, but the database module works fine.

Any ideas?

Show
Peter Ruthven-Stuart added a comment - Robert, Thank you for the advice re turning on Debugging. I have done this, but the "The server closed the connection" error appears after about 300 seconds, as described above. Changing the timeout settings in php.ini, httpd.php, and even Firefox settings (about:config), does not change this. So, I have been unable to see any debugging errors. This is strange, since I have another moodle system on a server, which is basically the same setup as the problem server, but the database module works fine. Any ideas?
Hide
Petr Škoda (skodak) added a comment -

hmm, it could be caused by some infinite loop in code, but I did not find anything like that yet

Show
Petr Škoda (skodak) added a comment - hmm, it could be caused by some infinite loop in code, but I did not find anything like that yet
Hide
Mathieu Petit-Clair added a comment -

Works well, excellent.

Show
Mathieu Petit-Clair added a comment - Works well, excellent.
Hide
Robert Allerstorfer added a comment -

Petr,

could you please comment what you think about my suggestion having a new tag (something like ##authornames##) which resolves into a multimenu allowing to select one or more author names (each name in the form "firstname lastname")?

I think this would be the most useful feature for finding particular author's entries.
Thanks.

Show
Robert Allerstorfer added a comment - Petr, could you please comment what you think about my suggestion having a new tag (something like ##authornames##) which resolves into a multimenu allowing to select one or more author names (each name in the form "firstname lastname")? I think this would be the most useful feature for finding particular author's entries. Thanks.
Hide
Petr Škoda (skodak) added a comment -

This could be a nice new feature for 2.0. Please file a new tracker issue for it and link it to this bug please.

Show
Petr Škoda (skodak) added a comment - This could be a nice new feature for 2.0. Please file a new tracker issue for it and link it to this bug please.

Dates

  • Created:
    Updated:
    Resolved: