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