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