You are viewing this question as it will appear in the manual grading interface. Return to the normal view when you are done.

Element pl-string-input: Input of short strings

For the following python code snippet, enter below the resulting string:

1
a = "love"*3
a =

For the following python code snippet, what is d = b + c?

1
2
b = "hello "
c = "it is a beautiful day!"
b + c =

Enter the string below, however include trailing and leading blanks. When using the attribute remove-leading-trailing="true", the answer will still be evaluated as correct. We also set show-score="false" to hide the score badge.

1
"10101001"

Enter the string below, however include blank spaces between some of the numbers. When using the attribute remove-spaces="true", the answer will still be evaluated as correct. This example also uses the attribute placeholder="string", to add a placeholder indicating the expected input is of type "string".

1
"10101001"

The attribute allow-blank="true" allows users to submit blank answers, without receiving the Invalid error. Leave the box below empty, and notice that you will not receive the Invalid feedback (and hence the question is graded).

blank input box =

To allow for case insensitivity, use ignore-case="true". This will autoconvert both the student answer and the correct answer to lower case. Changing the case of any letter in the string below will yield the correct answer as a result. The attribute initial-value fills the textbox with the attribute's value when the question is first rendered. This attribute may save students time by not requiring them to copy-paste text into the box.

1
"cAsE iNsEnSiTiVe"
Input box is case insensitive =

The size of the input box can be set with the attribute size, and the attribute show-help-text="false" removes the button for the help popup. This box below has size=5 instead of the default size=35.

1
"small"
Small box =

For students using non-latin keyboards, it is possible that non-English characters may be introduced into the box. This can cause confusion if these characters resemble a latin character (e.g., the cyrillic character а looks a lot like the latin character a). Similarly, students may copy from text editors and paste into the answer box, causing characters like fancy quotes to be introduced. The attribute normalize-to-ascii="true" converts many Unicode characters to the ASCII character that mostly resembles it.

The box below contains an input using a Greek Epsilon, a Cyrillic ie, and fancy quotes. Copying this text into the answer box below should result in the appropriate text ("Ee") being accepted.

1
“Εе”
Weird text = ?

The input box can also allow for multiline input, done by setting multiline="true". For example, this is useful for cases where students are asked for the output of a program. Note that the multiline input converts each newline character to a single \n, so keep this in mind when setting the correct answer. To avoid issues with newlines, they can be ignored completely by setting remove-spaces="true".

Run the Python code below and submit the output into the answer box.

1
print("I'm\nsorry\nDave.")
Don't worry about trailing newlines.

Setting correct-answer-format="regex" interprets the correct answer as a Python regular expression, so a single input can accept many equivalent responses. The pattern below uses verbose mode ((?x)) so it can span multiple lines and include comments, and ignore-case="true" makes the match case-insensitive. Because a raw pattern is not a friendly answer to show students, the input is wrapped in pl-hide-in-panel and a pl-answer-panel gives a readable description instead.

Name one of the three most-limiting plant nutrients in agriculture, by full name or chemical symbol.

Correct answer

a = lovelovelove
b + c = hello it is a beautiful day!
10101001
10101001
blank input box = blank
Input box is case insensitive = cAsE iNsEnSiTiVe
Small box = small
Weird text = "Ee" ?
Don't worry about trailing newlines.

Any of nitrogen, phosphorus, or potassium, written either as the full word or as the chemical symbol (N, P, K), in any combination of upper- and lowercase.

Student view placeholder

In student views this area is used for assessment and score info.
Tools

Staff information

Question

Title:
Element pl-string-input: Input of short strings

Variant

Started at:
2026-08-04 22:49:49 (CDT)
Duration:
0s
Show/Hide answer
{
  "ans1": "lovelovelove",
  "ans2": "hello it is a beautiful day!",
  "ans3": "10101001",
  "ans4": "10101001",
  "ans5": "blank",
  "ans6": "cAsE iNsEnSiTiVe",
  "ans7": "small",
  "ans8": "\"Ee\"",
  "ans9": "I'm\nsorry\nDave.",
  "ans10": "(?x) N(itrogen)? | P(hosphorus)? | K | potassium # (?x) verbose regex"
}
History
dec frac
rad deg