Lingara Lingara ドキュメント 学習ガイド API ライブラリ アプリ 作成 ウェブ版
言語: 日本語

チューターへのメモ

このページは英語から翻訳されています。内容に相違がある場合は、英語のページが正しい内容です。 英語のページを読む

アプリは、応答に tutor_note を追加することで、学習者が今練習した単語など、1 行のコンテキストを Lingara のチューターに提供できます。メモがチューターに届くのは、マニフェストでそれを宣言しており、かつ学習者がアプリのインストール時にそれをオンにした場合だけです。その選択を変更するには、学習者はアプリをアンインストールしてから再度インストールします。

Lingara が行う処理

  • 改行はスペースになります。
  • 制御文字と方向オーバーライドは削除されます。
  • 280 文字を超えるメモは 280 文字に切り詰められ、末尾が … になります。文字数はバイト数や画面上のグリフ数ではなく、Unicode スカラー値として数えます。
  • マニフェストで宣言していないメモ、または学習者が許可していないメモは破棄されます。

チューターによる読み方

チューターは、メモを第三者からの引用テキストとして読み、指示として扱うことはありません。Lingara の安全性チェックで拒否されたメモは破棄され、学習者のターンはメモなしで続行されます。学習者がメモを目にすることはありません。

良いメモ

良いメモとは、「学習者は日本語のプランから 5 つの単語を復習したところです。」のような、チューターが利用できる 1 つの単純な事実です。チューターが何をすべきかではなく、学習者が何をしているかを述べます。指示、学習者に対する評価、そして学習者がカード上で見ていないものは含めないでください。

コード例の言語

TypeScript

function withNote(request: AppRenderRequest) {
  const note = planLine(request);
  // Plain text, at most 280 characters; the tutor reads it, the learner does not.
  return note === "" ? todayCard(0) : reply(todayCard(0)).tutorNote(note);
}

Rust

async fn render(seen: Seen, request: AppRenderRequest) -> Result<Reply, BoxError> {
    let (lang, progress) = shared_plan(&request);
    let count = seen.lock().map_err(|_| "poisoned")?.get(&request.subject).copied().unwrap_or(0);
    let card = today_card("Today's five", &lang)?;
    // Plain text the learner's tutor can read: at most 280 characters.
    let note = match progress {
        Some((done, total)) => format!("The learner has reviewed {count} words with this app today; {done} of {total} sets done."),
        None => format!("The learner has reviewed {count} words with this app today."),
    };
    Ok(reply(card).tutor_note(note)?)
}

Go

card, err := lingaraapps.NewCard().Heading("Daily five", 1).Text("雨 · 雪 · 风 · 云 · 雷").Build()
if err != nil {
	return nil, err
}
// Plain text, at most 280 characters, for Lingara's tutor to use.
return lingaraapps.Reply(card).
	TutorNote("The learner is reviewing weather words today."), nil

Java

import com.getlingara.apps.Card;
import com.getlingara.apps.Reply;

Card card = Card.card().heading("Today's five", 1).term("雨", "yǔ", "rain", "zh").build();
// Plain text, at most 280 characters; the tutor reads it beside the card.
return Reply.reply(card).tutorNote("The learner is reviewing weather words today.");

Kotlin

import com.getlingara.apps.kotlin.Reply
import com.getlingara.apps.kotlin.card
import com.getlingara.apps.kotlin.reply

val c =
    card {
        heading("Today's five", 1)
        term("雨", reading = "yǔ", gloss = "rain", lang = "zh")
    }
// Plain text, at most 280 characters; the tutor reads it beside the card.
return reply(c).tutorNote("The learner is reviewing weather words today.")

Ruby

note = plan_line(request)
# Plain text, at most 280 characters; the tutor reads it, the learner does not.
note.empty? ? today_card(0) : Lingara::Apps.reply(today_card(0)).tutor_note(note)

PHP

use Lingara\Apps\Reply;

function withNote(AppRenderRequest $request): CardModel|Reply
{
    $note = planLine($request);
    // Plain text, at most 280 characters; the tutor reads it, the learner does not.
    return $note === '' ? todayCard(0) : Reply::of(todayCard(0))->tutorNote($note);
}