Require network address field

Require network address field

by Mario Gharib -
Number of replies: 3

To whom it may concern,

I am sending this message in order to see if it is possible to change the type of the field Require network address in order to increase its size.

The reason behind that is I want to insert all current and future exam-rooms' Subnet as the default value when creating new quizzes. However, I am receiving the below error since the list is long, and could be longer for future exam-rooms

Debug info: ERROR: value too long for type character varying(255).

I there a way to solve this issue?

Thanks.

Average of ratings: -
In reply to Mario Gharib

Re: Require network address field

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers

Hello Mario,

The error is caused because of the way that the quiz settings database is set up by default. The subnet field is declared to have a maximum length of 255 characters. The limit is arbitrary and can be changed using an ALTER TABLE command if you have a database admin capable of doing that, but it is a little dangerous to do on a production system.

However normally 255 should be more than sufficient on a reasonable network configuration. You should not be listing individual ip numbers, but one would expect that you would have a range of numbers allocated to the testing rooms that should be able to be described concisely with one of the options in the Quiz settings documentation.

Average of ratings: Useful (1)
In reply to Daniel Thies

Re: Require network address field

by Mario Gharib -

Hello Daniel,

Thanks a lot for your reply and I totally agree with you,

We, at USJ, are a huge university having dozens of classrooms and I did add the Subnet of all these classrooms yet we reached the limit. So as you are saying it is not possible to increase the maximum length of 255 characters other than the ALTER TABLE methods which is a little dangerous ?

In reply to Mario Gharib

Re: Require network address field

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers

Changing the table may not be completely unreasonable, but does require caution: understanding database, making full backups, time offline during break and testing. If you have those abilities, then why not?

However, IP address list quiz access rule may be a better way to centrally administer the lists for you. It looks like it has the same restriction, but if you edit the file db/install.php before you install it to change the subnet LENGTH attribute to something larger, it will use that value when it creates its table. Actually you may not need to do that as you can break your list into several different named sublists and include multiple names on a quiz.

Average of ratings: Useful (1)