Skip to content

Add an html attributes option to essay boxes#1414

Open
dlglin wants to merge 1 commit into
openwebwork:PG-2.21from
dlglin:essay-box-options
Open

Add an html attributes option to essay boxes#1414
dlglin wants to merge 1 commit into
openwebwork:PG-2.21from
dlglin:essay-box-options

Conversation

@dlglin
Copy link
Copy Markdown
Member

@dlglin dlglin commented May 22, 2026

This allows a problem author to set html attributes when creating an essay answer box.

The motivation for this was a request from an instructor to limit the length of student essay answers, which can now be accomplished by setting the maxlength attribute.

The attributes hash is inserted before any hard-coded attributes so that the problem author can't override any of these.

Copy link
Copy Markdown
Member

@drgrice1 drgrice1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me.

size of the essay box by specifying the number of rows and columns. Any additional
arguments will be passed as html attributes of the text area. For example

essay_box(8, 60, maxlength=>250)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor code tidying quibble. Please change this to

Suggested change
essay_box(8, 60, maxlength=>250)
essay_box(8, 60, maxlength => 250)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants