Lingara Lingara 說明文件 學習指南 API 函式庫 應用程式 起造 網頁版
語言: 閩南語

導師註記

這頁是對英文翻譯過來的。若兩篇無仝,以英文頁為準。 看英文頁

你的應用程式會當佇回應內底加一个 tutor_note,提供一逝情境資料予 Lingara 的導師,親像學習者拄才練習過佗寡詞。干焦佇你的清單有宣告伊,閣學習者佇安裝你的應用程式的時有共伊拍開,註記才會到導師遐。若欲改這个選擇,學習者愛解除安裝你的應用程式才閣重新安裝。

Lingara 會按怎處理伊

  • 換逝會變做空格。
  • 控制字元佮方向覆寫字元會予人提掉。
  • 超過 280 字的註記會予人剪短做 280 字,閣用 … 收尾。字是用 Unicode 純量值來算,毋是用位元組抑是螢幕頂懸的字形。
  • 你的清單無宣告、抑是學習者無允准的註記,會予人擲掉。

導師按怎讀伊

導師會共你的註記當做第三方的引用文字來讀,永遠袂當做指示。若 Lingara 的安全檢查拒絕一个註記,伊就會予人擲掉,學習者彼輪對話會無伊照常繼續。學習者永遠袂看著這个註記。

好的註記

好的註記是一項導師用會著的單純事實,親像「學習者拄才複習伊日語計畫內底的 5 个詞。」伊講學習者咧做啥物,毋是導師應該做啥物。莫寫指示、莫評斷學習者,嘛莫寫任何學習者佇你的卡片頂懸無看著的物件。

程式碼範例的語言

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);
}