Rock Identification Guide
Follow the Guide
Answer the questions to identify your rock.
Rock Identification Wizard
Click "Start" to begin the identification process.
Identification Result
Please complete the guide on the "Identification Guide" tab to see your result.
Data Configuration
Manage the guide's questions and final rock identifications.
Manage Rocks (Final Results)
| ID | Name | Actions |
|---|
Manage Questions (Wizard Logic)
| ID | Question Text | Actions |
|---|
Please complete the guide on the "Identification Guide" tab to see your result.
'; } /** * Displays a node (question or result) based on its ID. */ function rig_showNode(nodeId) { // 1. Is it a question? const question = rig_questions.find(q => q.id === nodeId); if (question) { if (!rig_questionText || !rig_optionsContainer) return; rig_questionText.textContent = question.text; rig_optionsContainer.innerHTML = ''; // Clear old options question.answers.forEach(answer => { const button = document.createElement('button'); button.type = 'button'; button.className = 'rig-btn rig-option-btn'; button.textContent = answer.text; button.onclick = () => rig_showNode(answer.next); rig_optionsContainer.appendChild(button); }); return; } // 2. Is it a rock (result)? const rock = rig_rocks.find(t => t.id === nodeId); if (rock) { rig_showResult(rock); return; } // 3. Not found console.error(`RIG Tool: Node ID "${nodeId}" not found in rocks or questions.`); alert(`Error: Logic path broken. Could not find node "${nodeId}".`); rig_resetGuide(); } // --- TAB 2 (RESULT) FUNCTIONS --- /** * Populates the result tab with rock data and switches to it. */ function rig_showResult(rock) { if (!rig_resultContent) return; let featuresHtml = '- ';
if (Array.isArray(rock.features)) {
featuresHtml += rock.features.map(f => `
- ${f} `).join(''); } featuresHtml += '
${rock.name}
${rock.desc}
