Lingara Lingara 說明文件 學習指南 API 函式庫 App 建立 網頁版
語言: 客家話

導師備註

這頁係對英文翻譯過來个。若係兩片無共樣,以英文頁為準。 看英文頁

你个 App 做得在回應肚項加一隻 tutor_note,提供一行情境資料分 Lingara 个導師,像學習者頭先練習過哪兜詞。淨在你个清單有宣告佢,還有學習者在安裝你个 App 个時節有打開佢,備註正會到導師該位。若愛改這隻選擇,學習者愛解除安裝你个 App 再重新安裝。

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