Package 'brainwritR'

Title: Resilient Classroom Brainwriting with Shiny
Description: Run a self-hosted classroom adaptation of 6-3-5 brainwriting. Rotating topics, persistent drafts, participant reconnection, and a database-authoritative round clock support small groups using smartphones. Includes a multilingual Shiny application, pure rotation helpers, three device modes, portable session settings, descriptive text analysis, plenum weighting of contributions, session administration, and tabular and PDF report exports for facilitated debriefing.
Authors: R. Heller [aut, cre, cph] (ORCID: <https://orcid.org/0000-0001-8006-9742>)
Maintainer: R. Heller <[email protected]>
License: MIT + file LICENSE
Version: 0.6.0
Built: 2026-11-03 18:07:04 UTC
Source: https://github.com/CTTIR/brainwritR

Help Index


brainwritR: resilient classroom brainwriting

Description

A single-process, SQLite-backed multilingual Shiny application for facilitated topic rotation. See run_app() and the classroom guide.

Author(s)

Maintainer: R. Heller [email protected] (ORCID) [copyright holder]

Authors:

See Also

Useful links:


Run the classroom brainwriting application

Description

Starts one multilingual Shiny application backed by SQLite. Open base_url for participants and append ⁠/?mod=1⁠ for the moderator. Configuration is resolved at invocation, never at package load time.

Usage

run_app(
  db_path = Sys.getenv("DB_PATH", "data/brainwriting.sqlite"),
  mod_pin = Sys.getenv("MOD_PIN", "635"),
  base_url = Sys.getenv("BASE_URL", "http://localhost:3838"),
  port = Sys.getenv("PORT", "3838"),
  host = "127.0.0.1",
  poll_ms = 2500
)

Arguments

db_path

Main SQLite file path. Defaults to DB_PATH, then "data/brainwriting.sqlite".

mod_pin

Moderator PIN. Defaults to MOD_PIN, then "635". The demonstration PIN is accepted only with a loopback host and URL.

base_url

Public participant URL used in the QR code. Defaults to BASE_URL, then "http://localhost:3838". Must not contain credentials, a fragment, or the reserved query parameters s, mod, and view.

port

Listening port. Defaults to PORT, then 3838.

host

Listening address, default "127.0.0.1". Set "0.0.0.0" explicitly to accept network connections, with a private moderator PIN.

poll_ms

Database polling interval in milliseconds, default 2500.

Details

The main database holds the standard session behind base_url and the catalog of all further sessions. Each further session is a separate SQLite file in a sessions folder next to the main database, with its own address (⁠?s=<code>⁠) and QR code. Moderators create, open, restart, archive and delete sessions in the overview at ?mod=1&view=sessions.

Use exactly one R process per data folder. No replicas or horizontal scaling are supported. A round advances on the next connected client's poll; with no clients connected it advances when someone reconnects. Moderator logins are kept in server memory, so a restart asks for the PIN again.

Value

Invisibly, the value returned by shiny::runApp() when the app stops.

Examples

if (interactive()) {
  run_app()
}

Sheet assigned to a participant within a group

Description

Sheet counts are frozen at session start. Modulo mapping permits several participants to contribute to the same sheet in one round without replacing one another's entries. A smaller arriving group can leave sheets untouched.

Usage

sheet_for(idx, n_sheets)

Arguments

idx

Positive integer within-group index.

n_sheets

Positive integer number of sheets for the topic.

Value

A numeric vector of one-based sheet indices.

Examples

sheet_for(1:6, 5)

Topic assigned to a group in a round

Description

Over n_groups consecutive rounds, each group visits every topic exactly once. In each round the groups cover all topics. Arguments recycle using ordinary R arithmetic; group and round indices are one-based.

Usage

topic_for(grp, round, n_groups)

Arguments

grp

Positive integer group index, at most n_groups.

round

Positive integer round index.

n_groups

Integer number of groups (2 to 6).

Value

A numeric vector of one-based topic indices.

Examples

topic_for(1:3, 2, 3)
topic_for(1, 1:3, 3)