Command and shortcut restrictions

This article describes the what is restricted to test takers when keyboard shortcuts are disabled for a session.

Disabling keyboard shortcuts is used to prevent actions which can move candidate outside of test, open browser/system UI, copy content, paste outside content, or use browser navigation shortcuts.

This plugin does not block normal typing. It blocks only configured events and shortcut combinations.

Important: Some OS-level or browser-reserved shortcuts will still be available, because the browser or OS handles them before JavaScript receives event. In this case disableCommands cannot prevent it.

When keyboard shortcuts are restricted

When configuring a session, there is an option to prevent keyboard shortcuts:

  • Session configuration on the Portal: This option is enabled by checking Prevent right-click menu in Security options. For more information, see Creating a session.

  • CSV import: This option is enabled by the following fields. For more information, see Importing sessions using a CSV file.

    • session_securitySettings_preventRightClickAndKeyboardShortcuts: Add 1 to this field to disable keyboard shortcuts.

    • session_securitySettings_disableCommandsConfig: Add 1 to the fields with this prefix to disable certain keyboard shortcuts. For shortcutWhitelist_shortcut and shortcutWhitelist_platform, add which platform specific short cuts should be disabled, and which platform they apply to. Add text to both of these fields, with a line | separating each shortcut/platform (no spaces).

  • LTI launch: This option is enabled by the following plugins. For more information, see Custom Parameters (delivery launch).

    • taoQtiNuiTest/runner/plugins/security/disableRightClick/plugin

    • taoQtiNuiTest/runner/plugins/security/disableCommands/plugin

Events prevented by the plugin

Event

Default behavior

Copy

Allowed only from valid editable/allowed target. Otherwise prevented.

Cut

Allowed only from valid editable/allowed target. Otherwise prevented.

Paste

Allowed only when pasted text is same as last valid copied text. Otherwise prevented.

Dragstart

Used to remember if drag started from valid target.

Drop

Allowed only if drag started from valid target. Otherwise prevented.

Keyboard shortcut

Prevented when shortcut is listed for current platform/browser.

Keyboard shortcuts remain available when the cursor is in:

  • Text response fields (including essay or extended text responses)

  • Text input fields (such as short answer or fill-in-the-blank questions)

  • Editable text areas, such as rich text editors

  • Any field that explicitly allows copy and paste

  • Buttons, menus, or other controls within the areas listed above

Copy, cut and paste logic

By default, copying or cutting content from the test page is blocked. However, you can still copy or cut text from supported editable fields, such as text response areas, short answer fields, rich text editors, and other permitted input fields.

You can only paste text that was copied from one of these supported fields during the current test session. Pasting content copied from outside the test, or from areas where copying is not allowed, is blocked.

When entering mathematical expressions, the math editor also accepts pasted content in $$...$$ format if the original copied content came from a supported editable field.

If copy/cut/paste is prevented, the plugin triggers any prohibited-action and sends a message to the security log:

Action

Security log reason

blocked copy

copy-attempt

blocked cut

cut-attempt

blocked paste

paste-attempt

Drag and drop logic

Drop is accepted only when drag started from valid target. If not, the plugin triggers the prohibited-action when the user tries to drop.

Configuration

This section describes the default values for different shortcuts in Ignite. These options can be adjusted which using CSV import or LTI launch to configure a a session - these specifications cannot be made from session creation on the Portal.

Option

Meaning

Default Value

canCopy

Copy and cut are allowed.

true

canCopy

Copy and cut are always prevented.

false

canPaste

Paste is allowed.

true

canPaste

Paste is always prevented.

false

canDragAndDrop

Drag and drop is allowed.

true

canDragAndDrop

Drop is prevented.

false

shortcutWhitelist

Selected shortcuts are not prevented.

 

Whitelist example:

{
  "shortcutWhitelist": [
    {
      "shortcut": "Meta+F",
      "platform": "mac",
      "browser": "chrome"
    }
  ]
}

If platform is not set, whitelist works for all platforms. If browser is not set, whitelist works for all browsers on matching platform.

Shortcuts allowed inside inputs

These shortcuts are not blocked on keydown when target is valid editable/allowed place:

backspace, Meta+C, Meta+V, Meta+Alt+V, Meta+Shift+Alt+V, Meta+X, Ctrl+c, Ctrl+v, Ctrl+x

When any non-special-character-input shortcut is pressed then it is prevented with no effect, such as losing window focus or menu popping up.

Important: Even when keydown is not blocked, later clipboard event can still be blocked by copy/paste rules.

Prevented shortcuts

macOS - common for Safari, Chrome and Firefox

Shortcut

Prevented behavior

Meta+C

Copy to clipboard

Meta+V

Paste from clipboard

Meta+Alt+V

Paste style

Meta+Shift+Alt+V

Paste and match style

Meta+X

Cut to clipboard

Meta+:

Show / hide spelling and grammar

Meta+Alt+W

Close application

Meta+Shift+W

Close current window

Meta+M

Minimize window

Safari has only shortcuts from this common macOS list.

macOS - common for Chrome and Firefox

Shortcut

Prevented behavior

Meta+[, Meta+]

Browser back / forward navigation

Meta+1 ... Meta+8

Switch to tab by number

Meta+9

Switch to last tab

Meta+D

Add bookmark

Meta+F

Find in page

Meta+G

Find next

Meta+L

Select address/location bar

Meta+O

Open file

Meta+P

Print page

Meta+R

Reload page

Meta+S

Save page

Meta+W

Close tab or popup

Meta+Shift+G

Find previous

Meta+Shift+T

Reopen/undo closed tab

Meta+Shift+H

Open home/history depending browser

Alt+F4

Close window

Ctrl+pagedown

Switch to next tab

Ctrl+pageup

Switch to previous tab

Alt+home

Open home page

macOS - Chrome only

Shortcut

Prevented behavior

Ctrl+enter

Show contextual menu

Meta+Alt+M

Minimize all

backspace

Go to previous page

Meta+Shift+?

Browser help

Meta+Ctrl+F

Enter or exit fullscreen

Meta+Y

Open history page

Meta+Shift+J

Open downloads page

Meta+Alt+U

Open page source

Meta+Shift+B

Toggle bookmarks bar

Meta+Alt+C

Inspect element mode

Meta+Shift+D

Bookmark all open pages

Meta+Alt+I

Open developer tools

Meta+Alt+J

Open developer console

Meta+Shift+M

Switch browser user

Meta+Shift+N

Open incognito window

Meta+Alt+B

Open bookmark manager

Meta+H

Hide Chrome

Meta+Alt+H

Hide other windows

Meta+Shift+I

Email current page

Meta+Shift+P

Open page setup

Meta+,

Open settings

Meta+E

Use selection for find

Meta+Shift+Delete

Open clear browsing data

Meta+Alt+Right

Switch to next tab

Meta+Alt+Left

Switch to previous tab

macOS - Firefox only

Shortcut

Prevented behavior

F5

Reload page

Meta+B

Toggle bookmarks sidebar

Meta+J

Open download history

Meta+K

Select search bar

Meta+U

Open page source

Meta+Shift+R

Force reload page

Alt+enter

Save link target as

Meta+Left

Back one page

Meta+Right

Forward one page

Meta+enter

Open link in background tab

Meta+F4

Close tab or popup

Meta+F5

Force reload page

Shift+F3

Find previous

Shift+enter

Open link in new window

Windows - common for Chrome and Firefox

Shortcut

Prevented behavior

Ctrl+c

Copy to clipboard

Ctrl+v

Paste from clipboard

Ctrl+x

Cut to clipboard

Ctrl+esc

Open Windows menu

Ctrl+F4

Close tab or popup

Shift+F6

Move focus to browser pane

Alt+esc, Alt+tab

Switch applications

Alt+space

Open active window menu

Alt+F4

Close window

PrintScreen

Take screenshot of whole screen

Alt+PrintScreen

Take screenshot of active window

Meta+D

Minimize all

backspace

Back one page

F1

Browser help

F3

Find next / find again

F5

Reload page

F11

Enter or exit fullscreen

Ctrl+1 ... Ctrl+8

Switch to tab by number

Ctrl+9

Switch to last tab

Ctrl+d

Add bookmark

Ctrl+f

Find in page

Ctrl+g

Find next / find again

Ctrl+h

Open history

Ctrl+j

Open downloads

Ctrl+k

Select search/address bar

Ctrl+l, Alt+d

Select address/location bar

Ctrl+n

Open new window

Ctrl+o

Open file

Ctrl+p

Print page

Ctrl+r

Reload page

Ctrl+s

Save page

Ctrl+t

Open new tab

Ctrl+u

Open page source

Ctrl+w

Close tab/window

Ctrl+Shift+G

Find previous

Ctrl+Shift+T

Reopen/undo closed tab

Ctrl+Shift+W

Close window

Ctrl+Shift+Delete

Clear browsing data/private data

Ctrl+tab, Ctrl+pagedown

Switch to next tab

Ctrl+pageup

Switch to previous tab

Ctrl+F5

Reload ignoring cache / force reload

Shift+backspace

Forward one page

Shift+F3

Find previous

Alt+left

Back one page

Alt+right

Forward one page

Alt+home

Open home page

Windows - Chrome only

Shortcut

Prevented behavior

F6

Move focus to browser pane

F10

Open Chrome menu

F12

Open developer tools

Ctrl+e

Focus address/search bar

Ctrl+q

Quit Chrome

Ctrl+Shift+B

Toggle bookmarks bar

Ctrl+Shift+C

Inspect element mode

Ctrl+Shift+D

Bookmark all open pages

Ctrl+Shift+I

Open developer tools

Ctrl+Shift+J

Open developer console

Ctrl+Shift+M

Switch browser user

Ctrl+Shift+N

Open incognito window

Ctrl+Shift+O

Open bookmark manager

Ctrl+Shift+Q

Quit Chrome

Alt+e, Alt+f

Open Chrome menu

Ctrl+shift+tab

Switch to previous tab

Shift+esc

Open Chrome task manager

Shift+F5

Reload ignoring cache

Windows - Firefox only

Shortcut

Prevented behavior

Ctrl+b, Ctrl+i

Toggle bookmarks sidebar

Ctrl+Shift+R

Force reload page

Alt+enter

Save link target as

Ctrl+[

Back one page

Ctrl+]

Forward one page

Ctrl+enter

Open link in background tab

Shift+enter

Open link in new window

Shift+MouseScrollDown

Back one page

Shift+MouseScrollUp

Forward one page

Screenshots note

On Windows, PrintScreen and Alt+PrintScreen are part of disableCommands. On macOS, screenshot shortcuts like Meta+Shift+3, Meta+Shift+4, Meta+Shift+5 are not part of disableCommands. They are handled by preventScreenshot.