Unggul
This commit is contained in:
parent
ac04cae997
commit
a80aaab631
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin Name: WAX MVP
|
||||
* Description: WAX AI-native learning MVP: premium landing styles, profile/course UI helpers, and AI Career Coach submissions.
|
||||
* Plugin Name: Unggul MVP
|
||||
* Description: Unggul AI-native learning MVP: premium landing styles, profile/course UI helpers, and AI Career Coach submissions.
|
||||
* Version: 0.2.0
|
||||
*/
|
||||
|
||||
@ -30,7 +30,7 @@ add_action('init', function () {
|
||||
'labels' => [
|
||||
'name' => 'Onboarding Profiles',
|
||||
'singular_name' => 'Onboarding Profile',
|
||||
'menu_name' => 'WAX Onboarding',
|
||||
'menu_name' => 'Unggul Onboarding',
|
||||
'add_new_item' => 'Add Onboarding Profile',
|
||||
'edit_item' => 'Review Onboarding Profile',
|
||||
],
|
||||
@ -55,7 +55,7 @@ add_action('wp_enqueue_scripts', function () {
|
||||
|
||||
|
||||
add_action('wp_head', function () {
|
||||
$_SERVER['PROJECT_DESCRIPTION'] = 'WAX helps non-technical professionals become fluent in AI-powered work through guided lessons, practical workflows, and shareable credentials.';
|
||||
$_SERVER['PROJECT_DESCRIPTION'] = 'Unggul helps non-technical professionals become fluent in AI-powered work through guided lessons, practical workflows, and shareable credentials.';
|
||||
}, 0);
|
||||
|
||||
add_action('template_redirect', 'matthew_lms_mvp_maybe_handle_login_submission');
|
||||
@ -139,7 +139,7 @@ function matthew_lms_mvp_render_header(): string {
|
||||
$lessons_url = matthew_lms_mvp_public_url('platform/course/');
|
||||
$public_links = [
|
||||
'Home' => matthew_lms_mvp_public_url(),
|
||||
'WAX Coach' => matthew_lms_mvp_public_url('career-coach/'),
|
||||
'Unggul Coach' => matthew_lms_mvp_public_url('career-coach/'),
|
||||
];
|
||||
$access_links = [
|
||||
'Profile' => $profile_url,
|
||||
@ -153,8 +153,8 @@ function matthew_lms_mvp_render_header(): string {
|
||||
?>
|
||||
<header class="mlms-site-header" role="banner">
|
||||
<div class="mlms-shell mlms-site-header-inner">
|
||||
<a class="mlms-header-brand" href="<?php echo esc_url(matthew_lms_mvp_public_url()); ?>" aria-label="WAX home">WAX</a>
|
||||
<nav class="mlms-header-nav" aria-label="WAX main navigation">
|
||||
<a class="mlms-header-brand" href="<?php echo esc_url(matthew_lms_mvp_public_url()); ?>" aria-label="Unggul home">Unggul</a>
|
||||
<nav class="mlms-header-nav" aria-label="Unggul main navigation">
|
||||
<?php foreach ($links as $label => $url): ?>
|
||||
<a href="<?php echo esc_url($url); ?>"><?php echo esc_html($label); ?></a>
|
||||
<?php endforeach; ?>
|
||||
@ -193,10 +193,10 @@ function matthew_lms_mvp_render_footer(): string {
|
||||
<footer class="mlms-site-footer" role="contentinfo">
|
||||
<div class="mlms-shell mlms-site-footer-inner">
|
||||
<div>
|
||||
<a class="mlms-footer-brand" href="<?php echo esc_url(matthew_lms_mvp_public_url()); ?>">WAX</a>
|
||||
<a class="mlms-footer-brand" href="<?php echo esc_url(matthew_lms_mvp_public_url()); ?>">Unggul</a>
|
||||
<p>AI-native work training for modern teams.</p>
|
||||
</div>
|
||||
<nav class="mlms-footer-links" aria-label="WAX footer navigation">
|
||||
<nav class="mlms-footer-links" aria-label="Unggul footer navigation">
|
||||
<?php foreach ($links as $label => $url): ?>
|
||||
<a href="<?php echo esc_url($url); ?>"><?php echo esc_html($label); ?></a>
|
||||
<?php endforeach; ?>
|
||||
@ -331,11 +331,11 @@ body.page-id-49 #wp--skip-link--target{margin-block-start:0!important}body.page-
|
||||
.mlms-proof-modal{position:fixed;inset:0;z-index:9999;display:none;align-items:center;justify-content:center;padding:24px}.mlms-proof-modal.open{display:flex}.mlms-proof-backdrop{position:absolute;inset:0;background:rgba(7,24,45,.62);backdrop-filter:blur(8px)}.mlms-proof-dialog{position:relative;z-index:1;width:min(640px,100%);max-height:92vh;overflow:auto;background:#fff;border:1px solid rgba(10,37,64,.10);border-radius:30px;box-shadow:0 28px 80px rgba(7,24,45,.28);padding:26px}.mlms-proof-dialog:before{content:"";position:absolute;inset:0 0 auto 0;height:5px;background:linear-gradient(90deg,var(--mlms-primary),var(--mlms-green));border-radius:30px 30px 0 0}.mlms-proof-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:20px}.mlms-proof-head h3{margin:0;color:var(--mlms-ink);font-size:28px;letter-spacing:-.04em;line-height:1.08}.mlms-proof-head p{margin:7px 0 0;color:var(--mlms-muted);line-height:1.45}.mlms-proof-close{width:42px;height:42px;border:0;border-radius:15px;background:#F2F6FA;color:var(--mlms-ink);font-size:24px;line-height:1;cursor:pointer}.mlms-proof-close:hover{background:#E7EDF5}.mlms-proof-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.mlms-proof-dialog .mlms-field.full{grid-column:1/-1}.mlms-proof-file{border:1px dashed #C9D6E5;border-radius:18px;background:#F8FAFD;padding:14px}.mlms-proof-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:18px}.mlms-proof-status{margin:0;color:#08785B;font-weight:850}.mlms-portfolio-card.proof-attached{border-color:rgba(33,197,142,.36);box-shadow:0 18px 42px rgba(33,197,142,.12)}.mlms-portfolio-card.proof-attached:after{content:"Proof attached";position:absolute;top:14px;right:14px;border-radius:999px;background:#ECFBF6;color:#08785B;border:1px solid rgba(33,197,142,.26);padding:7px 10px;font-size:12px;font-weight:950}.mlms-portfolio-link.is-attached{color:#08785B}@media (max-width:640px){.mlms-proof-dialog{padding:22px;border-radius:24px}.mlms-proof-grid{grid-template-columns:1fr}.mlms-proof-actions{display:grid}.mlms-proof-actions .mlms-btn{width:100%;justify-content:center}.mlms-proof-head h3{font-size:24px}}
|
||||
|
||||
|
||||
/* WAX Coach consultation wizard */
|
||||
/* Unggul Coach consultation wizard */
|
||||
.mlms-coach-progress{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:4px 0 22px}.mlms-coach-progress button{position:relative;text-align:left;border:1px solid #DDE6F0;background:#fff;border-radius:18px;padding:13px 13px 12px 52px;min-height:72px;color:var(--mlms-muted);box-shadow:0 8px 20px rgba(50,50,93,.05);cursor:pointer;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease,background .18s ease}.mlms-coach-progress button:hover{transform:translateY(-2px);box-shadow:0 14px 30px rgba(50,50,93,.10);border-color:rgba(99,91,255,.30)}.mlms-coach-progress span{position:absolute;left:13px;top:15px;width:30px;height:30px;border-radius:12px;display:grid;place-items:center;background:#F2F6FA;color:#5E6E82;font-weight:950}.mlms-coach-progress strong{display:block;color:var(--mlms-ink);font-size:14px;line-height:1.1}.mlms-coach-progress small{display:block;color:var(--mlms-soft);font-size:12px;font-weight:750;margin-top:4px}.mlms-coach-progress button.active,.mlms-coach-progress button.complete{border-color:rgba(99,91,255,.34);background:linear-gradient(135deg,#fff,#F8F7FF)}.mlms-coach-progress button.active span{background:var(--mlms-primary);color:#fff;box-shadow:0 0 0 7px rgba(99,91,255,.11)}.mlms-coach-progress button.complete span{background:#ECFBF6;color:#08785B}.mlms-coach-panel{display:none;animation:mlmsFadeUp .24s ease both}.mlms-coach-panel.active{display:block}.mlms-coach-panel h2{font-size:clamp(28px,3vw,38px);line-height:1.06;letter-spacing:-.04em;margin:0 0 10px;color:var(--mlms-ink)}.mlms-coach-panel>p:not(.mlms-onboarding-step-label){color:var(--mlms-muted);margin:0 0 22px}.mlms-coach-tip{border-radius:18px;padding:14px 16px;background:linear-gradient(135deg,#F6F4FF,#F8FAFD);border:1px solid rgba(99,91,255,.16);color:#3C4770;margin:16px 0 0;font-size:15px;line-height:1.45}.mlms-coach-tip strong{color:var(--mlms-primary)}.mlms-coach-review{border-radius:22px;border:1px solid #DDE6F0;background:#F8FAFD;padding:18px;margin:18px 0 0}.mlms-coach-review>strong{display:block;color:var(--mlms-ink);font-size:18px;margin-bottom:10px}.mlms-coach-review ul{margin:0;padding:0;list-style:none;display:grid;gap:9px}.mlms-coach-review li{display:flex;justify-content:space-between;gap:14px;border-top:1px solid #E5ECF4;padding-top:9px;color:var(--mlms-muted)}.mlms-coach-review li:first-child{border-top:0;padding-top:0}.mlms-coach-review span{font-weight:850}.mlms-coach-review b{color:var(--mlms-ink);text-align:right}.mlms-coach-loading{width:100%}@media (max-width:900px){.mlms-coach-progress{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width:560px){.mlms-coach-progress{grid-template-columns:1fr}.mlms-coach-progress button{min-height:auto}.mlms-coach-review li{display:grid;gap:2px}.mlms-coach-review b{text-align:left}}
|
||||
|
||||
|
||||
/* WAX black & white theme overrides */
|
||||
/* Unggul black & white theme overrides */
|
||||
:root{
|
||||
--mlms-ink:#FFFFFF;
|
||||
--mlms-navy:#FFFFFF;
|
||||
@ -984,8 +984,8 @@ function matthew_lms_mvp_handle_google_oauth_callback(): array {
|
||||
|
||||
matthew_lms_mvp_login_user((int) $user_id);
|
||||
$message = $flow === 'login'
|
||||
? ($created_user ? 'Google account created. Finish two onboarding questions to personalize WAX.' : 'Signed in with Google.')
|
||||
: 'Google connected. Two quick questions and WAX will build your starter profile.';
|
||||
? ($created_user ? 'Google account created. Finish two onboarding questions to personalize Unggul.' : 'Signed in with Google.')
|
||||
: 'Google connected. Two quick questions and Unggul will build your starter profile.';
|
||||
return ['success' => true, 'flow' => $flow, 'redirect' => $redirect, 'new_user' => $created_user, 'message' => $message, 'email' => $email];
|
||||
}
|
||||
|
||||
@ -998,7 +998,7 @@ function matthew_lms_mvp_handle_signup_onboarding_submission(): array {
|
||||
return ['success' => false, 'message' => 'Choose the role that best matches how you work.'];
|
||||
}
|
||||
if ($goal === '') {
|
||||
return ['success' => false, 'message' => 'Tell WAX what you want to learn first.'];
|
||||
return ['success' => false, 'message' => 'Tell Unggul what you want to learn first.'];
|
||||
}
|
||||
if (is_user_logged_in()) {
|
||||
$user_id = get_current_user_id();
|
||||
@ -1051,16 +1051,16 @@ function matthew_lms_mvp_handle_signup_onboarding_submission(): array {
|
||||
}
|
||||
|
||||
function matthew_lms_mvp_generate_profile_bootstrap(string $email, string $role, string $goal, string $link): string {
|
||||
$fallback = "Starter WAX profile\n\nLearning path: Start with AI workflow fluency, then map one real weekly task into a repeatable prompt-and-review system.\n\nFirst wins:\n1. Pick one high-friction task connected to your goal.\n2. Build a simple AI-assisted draft, review, and handoff loop.\n3. Save the result as your first portfolio artifact.";
|
||||
$fallback = "Starter Unggul profile\n\nLearning path: Start with AI workflow fluency, then map one real weekly task into a repeatable prompt-and-review system.\n\nFirst wins:\n1. Pick one high-friction task connected to your goal.\n2. Build a simple AI-assisted draft, review, and handoff loop.\n3. Save the result as your first portfolio artifact.";
|
||||
$api = dirname(__DIR__, 3) . '/ai/LocalAIApi.php';
|
||||
if (!file_exists($api)) { return $fallback; }
|
||||
require_once $api;
|
||||
if (!class_exists('LocalAIApi')) { return $fallback; }
|
||||
$link_context = $link ? "Linked account/profile URL supplied by user: $link." : 'No linked account was supplied.';
|
||||
$prompt = "Create a concise starter profile for a new WAX learner. Email: $email. Functional role: $role. Learning goals: $goal. $link_context Include: 1) one-line professional headline, 2) a recommended first learning path, 3) three practical starter actions. Sound friendly, premium, and specific. Keep under 180 words.";
|
||||
$prompt = "Create a concise starter profile for a new Unggul learner. Email: $email. Functional role: $role. Learning goals: $goal. $link_context Include: 1) one-line professional headline, 2) a recommended first learning path, 3) three practical starter actions. Sound friendly, premium, and specific. Keep under 180 words.";
|
||||
$resp = LocalAIApi::createResponse([
|
||||
'input' => [
|
||||
['role' => 'system', 'content' => 'You are WAX, an AI onboarding assistant that turns short sign-up answers into useful AI-native learning profiles.'],
|
||||
['role' => 'system', 'content' => 'You are Unggul, an AI onboarding assistant that turns short sign-up answers into useful AI-native learning profiles.'],
|
||||
['role' => 'user', 'content' => $prompt],
|
||||
],
|
||||
], ['poll_interval' => 2, 'poll_timeout' => 30, 'timeout' => 20]);
|
||||
@ -1078,8 +1078,8 @@ function matthew_lms_mvp_render_signup_success(array $result): string {
|
||||
<div class="mlms-onboarding-success">
|
||||
<div class="mlms-profile-summary-card">
|
||||
<p class="mlms-kicker" style="color:#C9C4FF">Profile bootstrap complete</p>
|
||||
<h2>Your WAX profile is ready.</h2>
|
||||
<p>WAX used your sign-up answers<?php echo !empty($result['link']) ? ' and linked profile URL' : ''; ?> to create a starter learning profile you can refine over time.</p>
|
||||
<h2>Your Unggul profile is ready.</h2>
|
||||
<p>Unggul used your sign-up answers<?php echo !empty($result['link']) ? ' and linked profile URL' : ''; ?> to create a starter learning profile you can refine over time.</p>
|
||||
<div class="mlms-profile-meta">
|
||||
<span><b>Email</b> <?php echo esc_html($result['email']); ?></span>
|
||||
<span><b>Role</b> <?php echo esc_html($result['role']); ?></span>
|
||||
@ -1096,7 +1096,7 @@ function matthew_lms_mvp_render_signup_success(array $result): string {
|
||||
<div class="mlms-ai-profile-head">
|
||||
<span class="mlms-ai-profile-badge">AI draft</span>
|
||||
<h3>AI-generated starter profile</h3>
|
||||
<p>Your first WAX operating map — shaped into a path, quick wins, and a portfolio-ready proof point.</p>
|
||||
<p>Your first Unggul operating map — shaped into a path, quick wins, and a portfolio-ready proof point.</p>
|
||||
</div>
|
||||
<div class="mlms-ai-profile-chips" aria-label="Profile ingredients">
|
||||
<span><b>01</b> Path</span>
|
||||
@ -1185,7 +1185,7 @@ function matthew_lms_mvp_js(): string {
|
||||
.then(function(resp){return resp.json();})
|
||||
.then(function(json){
|
||||
if(json && json.success && json.data){return json.data;}
|
||||
var message=(json && json.data && json.data.message) ? json.data.message : 'The WAX tutor could not respond. Try again with a shorter question.';
|
||||
var message=(json && json.data && json.data.message) ? json.data.message : 'The Unggul tutor could not respond. Try again with a shorter question.';
|
||||
throw new Error(message);
|
||||
});
|
||||
}
|
||||
@ -1356,7 +1356,7 @@ function matthew_lms_mvp_js(): string {
|
||||
question.classList.add(isCorrect?'is-correct':'is-wrong');
|
||||
});
|
||||
if(unanswered){
|
||||
if(quizResult){quizResult.className='mlms-quiz-result active error';quizResult.innerHTML='<strong>Almost there.</strong>Answer every question before WAX calculates your result.';}
|
||||
if(quizResult){quizResult.className='mlms-quiz-result active error';quizResult.innerHTML='<strong>Almost there.</strong>Answer every question before Unggul calculates your result.';}
|
||||
if(quizStatus){quizStatus.textContent=unanswered+' question'+(unanswered===1?'':'s')+' still need an answer.';}
|
||||
return;
|
||||
}
|
||||
@ -1399,7 +1399,7 @@ function matthew_lms_mvp_js(): string {
|
||||
data.append('action','mlms_ai_tutor');
|
||||
data.append('mode','build_validation');
|
||||
data.append('nonce',dashboard.getAttribute('data-tutor-nonce')||'');
|
||||
data.append('lesson_context',dashboard.getAttribute('data-lesson-context')||'WAX lesson');
|
||||
data.append('lesson_context',dashboard.getAttribute('data-lesson-context')||'Unggul lesson');
|
||||
function markComplete(message){
|
||||
if(feedback){feedback.textContent=message || 'Validated: your build task is clear enough to earn this lesson skill point.';}
|
||||
if(completion){completion.classList.add('active');}
|
||||
@ -1449,10 +1449,10 @@ function matthew_lms_mvp_js(): string {
|
||||
return;
|
||||
}
|
||||
mlmsAppendTutorMessage(messages, question || 'Uploaded a screenshot for roadblock help.', 'user');
|
||||
var pending=mlmsAppendTutorMessage(messages, 'WAX Tutor is thinking…', 'bot');
|
||||
var pending=mlmsAppendTutorMessage(messages, 'Unggul Tutor is thinking…', 'bot');
|
||||
var data=new FormData(form);
|
||||
data.append('action','mlms_ai_tutor');
|
||||
data.append('lesson_context',root.getAttribute('data-lesson-context')||'WAX course lesson');
|
||||
data.append('lesson_context',root.getAttribute('data-lesson-context')||'Unggul course lesson');
|
||||
mlmsPostTutor(data, root.getAttribute('data-ajax-url')||'')
|
||||
.then(function(payload){
|
||||
if(pending){pending.textContent=payload.message || 'I could not produce guidance. Try asking again with more detail.';}
|
||||
@ -1698,7 +1698,7 @@ function matthew_lms_mvp_profile_context(): array {
|
||||
}
|
||||
$role = $role ?: 'Marketing Director';
|
||||
$goal = $goal ?: 'campaign automation, better briefs, and faster experimentation';
|
||||
$bio = $profile ? wp_trim_words(wp_strip_all_tags($profile), 34, '…') : 'AI-native growth operator building practical workflows with WAX. Focus: ' . $goal . '.';
|
||||
$bio = $profile ? wp_trim_words(wp_strip_all_tags($profile), 34, '…') : 'AI-native growth operator building practical workflows with Unggul. Focus: ' . $goal . '.';
|
||||
return [
|
||||
'logged_in' => $logged_in,
|
||||
'name' => $display_name,
|
||||
@ -1903,7 +1903,7 @@ function matthew_lms_mvp_course_continue_url(array $progress): string {
|
||||
function matthew_lms_mvp_course_runtime(array $profile): array {
|
||||
$context = matthew_lms_mvp_role_lesson_context((string) ($profile['role'] ?? ''));
|
||||
$lesson_context = sprintf(
|
||||
'WAX Phase 1 lesson: AI Workflow Fluency for %s. Goal: %s. Build task artifact: %s.',
|
||||
'Unggul Phase 1 lesson: AI Workflow Fluency for %s. Goal: %s. Build task artifact: %s.',
|
||||
$context['role_label'],
|
||||
(string) ($profile['goal'] ?? 'practical AI workflow fluency'),
|
||||
$context['artifact']
|
||||
@ -1971,11 +1971,11 @@ function matthew_lms_mvp_render_course_route_page(string $view): string {
|
||||
$progress = $runtime['progress'];
|
||||
$is_quiz = $view === 'quiz';
|
||||
$is_lesson = $view === 'lesson';
|
||||
$title = 'WAX Course Dashboard · AI Workflow Fluency';
|
||||
$title = 'Unggul Course Dashboard · AI Workflow Fluency';
|
||||
if ($is_quiz) {
|
||||
$title = 'WAX Quiz · AI Workflow Fluency';
|
||||
$title = 'Unggul Quiz · AI Workflow Fluency';
|
||||
} elseif ($is_lesson) {
|
||||
$title = 'WAX Lesson · AI Workflow Fluency';
|
||||
$title = 'Unggul Lesson · AI Workflow Fluency';
|
||||
}
|
||||
ob_start();
|
||||
?><!doctype html>
|
||||
@ -2108,7 +2108,7 @@ function matthew_lms_mvp_render_course_lesson_component(array $context, array $p
|
||||
</div>
|
||||
<div class="mlms-lesson-table" aria-label="Lesson comparison table">
|
||||
<div class="mlms-lesson-row"><strong>Weak workflow</strong><span>One prompt, no review rubric, unclear owner.</span></div>
|
||||
<div class="mlms-lesson-row"><strong>WAX workflow</strong><span>Prompt + example + review checklist + clear deliverable.</span></div>
|
||||
<div class="mlms-lesson-row"><strong>Unggul workflow</strong><span>Prompt + example + review checklist + clear deliverable.</span></div>
|
||||
</div>
|
||||
<div class="mlms-lesson-checkpoint">
|
||||
<h3>Next checkpoint: quiz page</h3>
|
||||
@ -2237,7 +2237,7 @@ function matthew_lms_mvp_render_course_quiz_component(): string {
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset class="mlms-quiz-question" data-quiz-question>
|
||||
<legend>2. Which prompt pattern best fits WAX workflow fluency?</legend>
|
||||
<legend>2. Which prompt pattern best fits Unggul workflow fluency?</legend>
|
||||
<div class="mlms-quiz-options">
|
||||
<label class="mlms-quiz-option"><input type="radio" name="mlms_quiz_q2" value="short"> “Make this better.”</label>
|
||||
<label class="mlms-quiz-option"><input type="radio" name="mlms_quiz_q2" value="copy"> “Write the final version and skip review.”</label>
|
||||
@ -2278,7 +2278,7 @@ function matthew_lms_mvp_render_course_build_component(array $context): string {
|
||||
<p>Submit a concise <?php echo esc_html($context['artifact']); ?>. AI validation gives feedback, confirms completion, and lights up the Phase 1 skill node when earned.</p>
|
||||
</div>
|
||||
<form data-mlms-build-form>
|
||||
<input type="hidden" name="question" value="Validate my WAX lesson build task and decide whether it earns the skill point.">
|
||||
<input type="hidden" name="question" value="Validate my Unggul lesson build task and decide whether it earns the skill point.">
|
||||
<div class="mlms-build-checklist">
|
||||
<label><input type="checkbox" name="deliverable_checklist[]" value="source" required> I named the source inputs.</label>
|
||||
<label><input type="checkbox" name="deliverable_checklist[]" value="prompt" required> I included the AI prompt and review rubric.</label>
|
||||
@ -2301,9 +2301,9 @@ function matthew_lms_mvp_render_ai_tutor_component(string $ajax_url, string $non
|
||||
ob_start();
|
||||
?>
|
||||
<div class="mlms-ai-tutor" data-mlms-tutor-root data-ajax-url="<?php echo esc_url($ajax_url); ?>" data-lesson-context="<?php echo esc_attr($lesson_context); ?>">
|
||||
<button class="mlms-tutor-launcher" type="button" aria-label="Open WAX AI Tutor"><span>AI</span><span>Ask Tutor</span></button>
|
||||
<section class="mlms-tutor-panel" aria-hidden="true" aria-label="WAX AI Tutor panel">
|
||||
<div class="mlms-tutor-head"><div><h3>WAX AI Tutor</h3><p>Glossary help, roadblock screenshots, and step-by-step guidance.</p></div><button class="mlms-tutor-close" type="button" aria-label="Close tutor">×</button></div>
|
||||
<button class="mlms-tutor-launcher" type="button" aria-label="Open Unggul AI Tutor"><span>AI</span><span>Ask Tutor</span></button>
|
||||
<section class="mlms-tutor-panel" aria-hidden="true" aria-label="Unggul AI Tutor panel">
|
||||
<div class="mlms-tutor-head"><div><h3>Unggul AI Tutor</h3><p>Glossary help, roadblock screenshots, and step-by-step guidance.</p></div><button class="mlms-tutor-close" type="button" aria-label="Close tutor">×</button></div>
|
||||
<div class="mlms-tutor-messages" aria-live="polite"><div class="mlms-tutor-msg bot">I’m here beside the lesson. Ask “What is CLI?”, request a concise explanation, or upload an error screenshot with Fix My Error.</div></div>
|
||||
<form class="mlms-tutor-form" data-mlms-tutor-form enctype="multipart/form-data">
|
||||
<input type="hidden" name="nonce" value="<?php echo esc_attr($nonce); ?>">
|
||||
@ -2336,7 +2336,7 @@ function matthew_lms_mvp_handle_ai_tutor_ajax(): void {
|
||||
$mode = 'tutor';
|
||||
}
|
||||
$question = sanitize_textarea_field(wp_unslash($_POST['question'] ?? ''));
|
||||
$lesson_context = sanitize_textarea_field(wp_unslash($_POST['lesson_context'] ?? 'WAX course lesson'));
|
||||
$lesson_context = sanitize_textarea_field(wp_unslash($_POST['lesson_context'] ?? 'Unggul course lesson'));
|
||||
$deliverable = sanitize_textarea_field(wp_unslash($_POST['deliverable_notes'] ?? ''));
|
||||
if ($mode === 'build_validation') {
|
||||
$checklist = isset($_POST['deliverable_checklist']) && is_array($_POST['deliverable_checklist'])
|
||||
@ -2410,7 +2410,7 @@ function matthew_lms_mvp_generate_ai_tutor_response(string $mode, string $questi
|
||||
default => 'Answer as a non-intrusive in-course tutor. Coach the learner through the concept without doing the whole deliverable for them.',
|
||||
};
|
||||
$prompt = "Lesson context:\n{$lesson_context}\n\nTutor mode: {$mode}\nInstruction: {$mode_instruction}\n\nLearner message:\n{$question}\n\nUse calm, premium language. Prefer 3-5 numbered steps or bullets. If information is missing, ask for the exact detail needed. Keep under 180 words.";
|
||||
$system = 'You are WAX AI Tutor, an in-course assistant for non-technical professionals learning AI-powered work. Be practical, clear, encouraging, and role-specific. Do not cover the entire course content, do not complete assignments for the learner, and avoid fluff.';
|
||||
$system = 'You are Unggul AI Tutor, an in-course assistant for non-technical professionals learning AI-powered work. Be practical, clear, encouraging, and role-specific. Do not cover the entire course content, do not complete assignments for the learner, and avoid fluff.';
|
||||
|
||||
$user_content = $prompt;
|
||||
if (!empty($image['data_url'])) {
|
||||
@ -2479,8 +2479,8 @@ add_shortcode('matthew_user_profile', function () {
|
||||
$quiz_label = !empty($course_progress['quiz_completed']) ? ($course_progress['quiz_score'] . '/' . $course_progress['quiz_total']) : 'Not taken';
|
||||
$course_continue_url = matthew_lms_mvp_course_continue_url($course_progress);
|
||||
$share_url = matthew_lms_mvp_public_url('platform/');
|
||||
$share_title = sprintf("View %s's WAX AI profile", $profile['name']);
|
||||
$share_text = sprintf('%s is building AI-native proof on WAX: %s', $profile['name'], $profile['role']);
|
||||
$share_title = sprintf("View %s's Unggul AI profile", $profile['name']);
|
||||
$share_text = sprintf('%s is building AI-native proof on Unggul: %s', $profile['name'], $profile['role']);
|
||||
$share_links = [
|
||||
[
|
||||
'label' => 'LinkedIn',
|
||||
@ -2530,17 +2530,17 @@ body.mlms-wax-page .mlms-tutor-launcher span{
|
||||
<div class="mlms-profile-intro">
|
||||
<div>
|
||||
<p class="mlms-kicker">Profile</p>
|
||||
<h1 class="mlms-h2">Your WAX profile and skill proof.</h1>
|
||||
<h1 class="mlms-h2">Your Unggul profile and skill proof.</h1>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo matthew_lms_mvp_profile_notice(); ?>
|
||||
<div class="mlms-profile-dashboard">
|
||||
<article class="mlms-credential-card" aria-label="WAX profile header credential card">
|
||||
<article class="mlms-credential-card" aria-label="Unggul profile header credential card">
|
||||
<div class="mlms-credential-top">
|
||||
<div class="mlms-profile-photo" aria-hidden="true">
|
||||
<?php if (!empty($profile['photo'])): ?><img src="<?php echo esc_url($profile['photo']); ?>" alt=""><?php else: ?><?php echo esc_html($profile['initials']); ?><?php endif; ?>
|
||||
</div>
|
||||
<div class="mlms-credential-badge">WAX AI Credential</div>
|
||||
<div class="mlms-credential-badge">Unggul AI Credential</div>
|
||||
</div>
|
||||
<h2><?php echo esc_html($profile['name']); ?></h2>
|
||||
<p class="mlms-profile-title"><?php echo esc_html($profile['role']); ?> · AI-native operator</p>
|
||||
@ -2558,7 +2558,7 @@ body.mlms-wax-page .mlms-tutor-launcher span{
|
||||
<div class="mlms-social-share" data-mlms-social-share data-share-url="<?php echo esc_url($share_url); ?>" data-share-title="<?php echo esc_attr($share_title); ?>" data-share-text="<?php echo esc_attr($share_text); ?>">
|
||||
<div class="mlms-social-share-head">
|
||||
<span class="mlms-social-share-badge" aria-hidden="true">↗</span>
|
||||
<div><strong>Share your WAX profile</strong><span>Publish your verified WAX profile proof on your social channels, or copy the profile link to send anywhere.</span></div>
|
||||
<div><strong>Share your Unggul profile</strong><span>Publish your verified Unggul profile proof on your social channels, or copy the profile link to send anywhere.</span></div>
|
||||
</div>
|
||||
<div class="mlms-social-share-actions">
|
||||
<div class="mlms-social-share-links" aria-label="Share profile on social media">
|
||||
@ -2578,7 +2578,7 @@ body.mlms-wax-page .mlms-tutor-launcher span{
|
||||
<div class="mlms-profile-main">
|
||||
<article class="mlms-profile-module mlms-skill-indicator-card" aria-labelledby="skill-indicator-heading">
|
||||
<div class="mlms-module-head">
|
||||
<div><h3 id="skill-indicator-heading">Skill indicator</h3><p>Each badge is a proof signal. Hover or tab into a badge to see what unlocks it and why it matters on your public WAX profile.</p></div>
|
||||
<div><h3 id="skill-indicator-heading">Skill indicator</h3><p>Each badge is a proof signal. Hover or tab into a badge to see what unlocks it and why it matters on your public Unggul profile.</p></div>
|
||||
<span class="mlms-pill">5 proof badges</span>
|
||||
</div>
|
||||
<div class="mlms-skill-network" role="list" aria-label="Five skill proof badges">
|
||||
@ -2691,7 +2691,7 @@ body.mlms-wax-page .mlms-tutor-launcher span{
|
||||
</div>
|
||||
<form class="mlms-source-form" method="post">
|
||||
<h4>Connect an external source manually</h4>
|
||||
<p>Paste a public GitHub, Reddit, LinkedIn, or AI-platform URL. WAX will show it as a source in the credential feed.</p>
|
||||
<p>Paste a public GitHub, Reddit, LinkedIn, or AI-platform URL. Unggul will show it as a source in the credential feed.</p>
|
||||
<?php wp_nonce_field('mlms_profile_source_submit', 'mlms_profile_source_nonce'); ?>
|
||||
<div class="mlms-field"><label for="mlms_profile_source_type">Source type</label><select id="mlms_profile_source_type" name="mlms_profile_source_type"><option value="github">GitHub</option><option value="reddit">Reddit</option><option value="ai-platform">AI platform</option><option value="linkedin">LinkedIn</option><option value="profile">Other profile</option></select></div>
|
||||
<div class="mlms-field"><label for="mlms_profile_source_url">Public profile or artifact URL</label><input id="mlms_profile_source_url" name="mlms_profile_source_url" type="url" value="<?php echo esc_attr($profile['profile_link']); ?>" placeholder="https://github.com/yourname/project" required></div>
|
||||
@ -2745,7 +2745,7 @@ add_shortcode('matthew_login', function () {
|
||||
<div class="mlms-page"><section class="mlms-onboarding-hero"><div class="mlms-shell">
|
||||
<div class="mlms-login-grid">
|
||||
<div class="mlms-onboarding-copy">
|
||||
<div class="mlms-eyebrow mlms-pill">WAX account access</div>
|
||||
<div class="mlms-eyebrow mlms-pill">Unggul account access</div>
|
||||
<h1 class="mlms-h1">Welcome back to <span class="mlms-gradient-text">AI-powered work</span>.</h1>
|
||||
</div>
|
||||
<div class="mlms-form-card mlms-login-card" id="mlms-login-card">
|
||||
@ -2753,7 +2753,7 @@ add_shortcode('matthew_login', function () {
|
||||
<div class="mlms-inline-note"><strong>You’re already signed in.</strong> Continue as <?php echo esc_html($current_user->user_email ?: $current_user->display_name); ?>.</div>
|
||||
<div class="mlms-actions"><a class="mlms-btn mlms-btn-primary" href="<?php echo esc_url(matthew_lms_mvp_public_url('platform/')); ?>">Profile →</a><a class="mlms-btn mlms-btn-secondary" href="<?php echo esc_url(matthew_lms_mvp_public_url('platform/course/')); ?>">Lessons Dashboard</a><a class="mlms-btn mlms-btn-secondary" href="<?php echo esc_url(wp_logout_url(matthew_lms_mvp_public_url('log-in/'))); ?>">Log out</a></div>
|
||||
<?php else: ?>
|
||||
<h2>Log in to WAX.</h2>
|
||||
<h2>Log in to Unggul.</h2>
|
||||
<p>Use Google for one-click access, or log in with your email/username and password.</p>
|
||||
<?php if (isset($_GET['mlms_google_notice'])): ?>
|
||||
<div class="mlms-inline-note"><strong>Google login is ready to connect.</strong> Add Google OAuth client credentials to enable real Gmail authentication. You can still log in with your password now.</div>
|
||||
@ -2777,7 +2777,7 @@ add_shortcode('matthew_login', function () {
|
||||
</div>
|
||||
<button class="mlms-btn mlms-btn-primary mlms-login-submit" type="submit">Log in →</button>
|
||||
</form>
|
||||
<p class="mlms-login-footnote">Need a WAX account? <a href="<?php echo esc_url(add_query_arg('redirect_to', rawurlencode($redirect_url), matthew_lms_mvp_public_url('sign-up/'))); ?>">Start onboarding</a>.</p>
|
||||
<p class="mlms-login-footnote">Need a Unggul account? <a href="<?php echo esc_url(add_query_arg('redirect_to', rawurlencode($redirect_url), matthew_lms_mvp_public_url('sign-up/'))); ?>">Start onboarding</a>.</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -2802,17 +2802,17 @@ add_shortcode('matthew_signup_onboarding', function () {
|
||||
<div class="mlms-signup-grid" id="mlms-signup-flow" data-start-step="<?php echo esc_attr((string) $start_step); ?>">
|
||||
<div class="mlms-onboarding-copy">
|
||||
<p class="mlms-kicker">Sign Up & Onboarding</p>
|
||||
<h1 class="mlms-h1">Create your WAX profile <span style="color:var(--mlms-primary);">in under a minute.</span></h1>
|
||||
<h1 class="mlms-h1">Create your Unggul profile <span style="color:var(--mlms-primary);">in under a minute.</span></h1>
|
||||
</div>
|
||||
<div class="mlms-form-card mlms-onboarding-card">
|
||||
<?php if (isset($_GET['mlms_gate'])): ?>
|
||||
<div class="mlms-inline-note"><strong>Create an account or log in to continue.</strong> Your WAX profile and lessons dashboard are available after registration or login.</div>
|
||||
<div class="mlms-inline-note"><strong>Create an account or log in to continue.</strong> Your Unggul profile and lessons dashboard are available after registration or login.</div>
|
||||
<?php endif; ?>
|
||||
<?php if (isset($_GET['mlms_google_notice'])): ?>
|
||||
<div class="mlms-inline-note"><strong>Google sign-in is ready to connect.</strong> Add Google OAuth client credentials to enable real Gmail authentication. You can still sign up with email now.</div>
|
||||
<?php endif; ?>
|
||||
<?php if (isset($_GET['mlms_google_connected'])): ?>
|
||||
<div class="mlms-inline-note"><strong>Google connected.</strong> Two quick questions and WAX will build your starter profile.</div>
|
||||
<div class="mlms-inline-note"><strong>Google connected.</strong> Two quick questions and Unggul will build your starter profile.</div>
|
||||
<?php endif; ?>
|
||||
<?php if (is_array($google_message)): ?>
|
||||
<div class="<?php echo !empty($google_message['success']) ? 'mlms-inline-note' : 'mlms-error-note'; ?>"><strong><?php echo !empty($google_message['success']) ? 'Google connected.' : 'Google sign-in needs attention.'; ?></strong> <?php echo esc_html($google_message['message'] ?? ''); ?></div>
|
||||
@ -2844,7 +2844,7 @@ add_shortcode('matthew_signup_onboarding', function () {
|
||||
<div class="mlms-onboarding-panel <?php echo $start_step === 2 ? 'active' : ''; ?>" data-step="2">
|
||||
<p class="mlms-onboarding-step-label">Step 2 of 3</p>
|
||||
<h2>What kind of work do you do?</h2>
|
||||
<p>Pick the closest role. WAX will personalize examples and first projects around it.</p>
|
||||
<p>Pick the closest role. Unggul will personalize examples and first projects around it.</p>
|
||||
<div class="mlms-role-picker" role="radiogroup" aria-label="Functional role">
|
||||
<?php foreach ($role_options as $label => $meta): ?>
|
||||
<label class="mlms-role-card"><input type="radio" name="mlms_signup_role" value="<?php echo esc_attr($label); ?>" required><span class="mlms-role-icon"><?php echo esc_html($meta[0]); ?></span><span><strong><?php echo esc_html($label); ?></strong><small><?php echo esc_html($meta[1]); ?></small></span></label>
|
||||
@ -2854,12 +2854,12 @@ add_shortcode('matthew_signup_onboarding', function () {
|
||||
</div>
|
||||
<div class="mlms-onboarding-panel <?php echo $start_step === 3 ? 'active' : ''; ?>" data-step="3">
|
||||
<p class="mlms-onboarding-step-label">Step 3 of 3</p>
|
||||
<h2>What should WAX help you learn first?</h2>
|
||||
<p>Use normal language. Add LinkedIn or GitHub only if it helps WAX understand your background.</p>
|
||||
<h2>What should Unggul help you learn first?</h2>
|
||||
<p>Use normal language. Add LinkedIn or GitHub only if it helps Unggul understand your background.</p>
|
||||
<div class="mlms-field"><label for="mlms_signup_goal">Learning goal</label><textarea id="mlms_signup_goal" name="mlms_signup_goal" required placeholder="Example: I want to use AI to speed up campaign planning, reporting, and team handoffs."><?php echo esc_textarea(wp_unslash($_POST['mlms_signup_goal'] ?? '')); ?></textarea></div>
|
||||
<div class="mlms-field"><label for="mlms_profile_link">LinkedIn or GitHub URL <span style="font-weight:650;color:var(--mlms-soft)">(optional)</span></label><input id="mlms_profile_link" name="mlms_profile_link" type="url" value="<?php echo esc_attr(esc_url_raw(wp_unslash($_POST['mlms_profile_link'] ?? ''))); ?>" placeholder="https://linkedin.com/in/yourname"></div>
|
||||
<div class="mlms-onboarding-actions"><button class="mlms-btn mlms-btn-secondary" type="button" data-mlms-prev>Back</button><button class="mlms-btn mlms-btn-primary" type="submit">Build my WAX profile →</button></div>
|
||||
<div class="mlms-building-profile" aria-live="polite"><strong>Building your profile…</strong><p>WAX is turning your role, goals, and optional linked profile into a starter learning path.</p><div class="mlms-loading-dots"><i></i><i></i><i></i></div></div>
|
||||
<div class="mlms-onboarding-actions"><button class="mlms-btn mlms-btn-secondary" type="button" data-mlms-prev>Back</button><button class="mlms-btn mlms-btn-primary" type="submit">Build my Unggul profile →</button></div>
|
||||
<div class="mlms-building-profile" aria-live="polite"><strong>Building your profile…</strong><p>Unggul is turning your role, goals, and optional linked profile into a starter learning path.</p><div class="mlms-loading-dots"><i></i><i></i><i></i></div></div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -2877,7 +2877,7 @@ add_shortcode('matthew_career_coach', function () {
|
||||
ob_start();
|
||||
?>
|
||||
<div class="mlms-page"><section class="mlms-section"><div class="mlms-shell">
|
||||
<div class="mlms-section-head"><div><p class="mlms-kicker">Free AI Career Coach</p><h1 class="mlms-h2">Get a calm, practical path into AI-native work.</h1><p class="mlms-section-copy">Upload a resume or describe your current role. The coach identifies skill gaps, recommends next steps, and shows how WAX can turn progress into a visible credential.</p></div><span class="mlms-pill">FREE • no course purchase needed</span></div>
|
||||
<div class="mlms-section-head"><div><p class="mlms-kicker">Free AI Career Coach</p><h1 class="mlms-h2">Get a calm, practical path into AI-native work.</h1><p class="mlms-section-copy">Upload a resume or describe your current role. The coach identifies skill gaps, recommends next steps, and shows how Unggul can turn progress into a visible credential.</p></div><span class="mlms-pill">FREE • no course purchase needed</span></div>
|
||||
<div class="mlms-form-card mlms-coach-card">
|
||||
<?php if (is_array($result) && !empty($result['success'])): ?>
|
||||
<div class="mlms-notice"><strong>Your career coach plan is ready.</strong> Your request was saved for follow-up and the AI-generated guidance is below.</div>
|
||||
@ -2898,7 +2898,7 @@ add_shortcode('matthew_career_coach', function () {
|
||||
<div class="mlms-coach-panel active" data-mlms-coach-panel>
|
||||
<p class="mlms-onboarding-step-label">Step 1 of 4 · Your consultation basics</p>
|
||||
<h2>Start with your contact details.</h2>
|
||||
<p>WAX uses this to label your consultation profile and make the follow-up feel personal.</p>
|
||||
<p>Unggul uses this to label your consultation profile and make the follow-up feel personal.</p>
|
||||
<div class="mlms-form-grid">
|
||||
<div class="mlms-field"><label for="mlms_name">Name</label><input id="mlms_name" name="mlms_name" required placeholder="Alex Morgan" value="<?php echo esc_attr(sanitize_text_field(wp_unslash($_POST['mlms_name'] ?? ''))); ?>"></div>
|
||||
<div class="mlms-field"><label for="mlms_email">Email</label><input id="mlms_email" name="mlms_email" type="email" required placeholder="alex@example.com" value="<?php echo esc_attr(sanitize_email(wp_unslash($_POST['mlms_email'] ?? ''))); ?>"></div>
|
||||
@ -2909,7 +2909,7 @@ add_shortcode('matthew_career_coach', function () {
|
||||
|
||||
<div class="mlms-coach-panel" data-mlms-coach-panel>
|
||||
<p class="mlms-onboarding-step-label">Step 2 of 4 · Where you are now</p>
|
||||
<h2>Tell WAX your current and target role.</h2>
|
||||
<h2>Tell Unggul your current and target role.</h2>
|
||||
<p>This gives the coach enough context to compare today’s responsibilities with the AI-native role you want.</p>
|
||||
<div class="mlms-form-grid">
|
||||
<div class="mlms-field"><label for="mlms_current_role">Current role</label><input id="mlms_current_role" name="mlms_current_role" required placeholder="Marketing Director" value="<?php echo esc_attr(sanitize_text_field(wp_unslash($_POST['mlms_current_role'] ?? ''))); ?>"></div>
|
||||
@ -2943,7 +2943,7 @@ add_shortcode('matthew_career_coach', function () {
|
||||
</ul>
|
||||
</div>
|
||||
<div class="mlms-onboarding-actions"><button class="mlms-btn mlms-btn-secondary" type="button" data-mlms-coach-prev>Back</button><button class="mlms-btn mlms-btn-primary" type="submit">Generate my AI career path →</button></div>
|
||||
<div class="mlms-building-profile mlms-coach-loading" aria-live="polite"><strong>Preparing your consultation profile…</strong><p>WAX is reading your answers and building a practical AI career path.</p><div class="mlms-loading-dots"><i></i><i></i><i></i></div></div>
|
||||
<div class="mlms-building-profile mlms-coach-loading" aria-live="polite"><strong>Preparing your consultation profile…</strong><p>Unggul is reading your answers and building a practical AI career path.</p><div class="mlms-loading-dots"><i></i><i></i><i></i></div></div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -2994,7 +2994,7 @@ function matthew_lms_mvp_generate_ai_advice(string $name, string $current, strin
|
||||
$prompt = "Create a concise, encouraging AI career coaching plan for a non-technical professional. Name: $name. Current role: $current. Target role: $target. Goal/context: $goal. Include: personalized career path, top 3 skill gaps, 3 next steps, and how an AI-native operator certification helps. Keep under 220 words, calm and premium.";
|
||||
$resp = LocalAIApi::createResponse([
|
||||
'input' => [
|
||||
['role' => 'system', 'content' => 'You are WAX, a calm expert AI career coach for non-technical professionals. Be practical, specific, reassuring, and concise.'],
|
||||
['role' => 'system', 'content' => 'You are Unggul, a calm expert AI career coach for non-technical professionals. Be practical, specific, reassuring, and concise.'],
|
||||
['role' => 'user', 'content' => $prompt],
|
||||
],
|
||||
], ['poll_interval' => 2, 'poll_timeout' => 30, 'timeout' => 20]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user