Skip to content

Commit

Permalink
try to match moodle's template block format
Browse files Browse the repository at this point in the history
  • Loading branch information
Glutamat42 committed May 6, 2024
1 parent 5d083ba commit 1a1074b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 34 deletions.
39 changes: 21 additions & 18 deletions templates/index_page.mustache
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
{{! This is the Mustache template for the index page }}
{{!
@template mod_adleradaptivities/index_page
{{! @template
{
"module_name_plural": "Adler Activities",
"course_format_uses_sections": true,
"column_title_section": "Section",
"column_title_activity_name": "Activity Name",
"adleradaptivities": [
{
"section": "Section 1",
"coursemodule_url": "http://example.com/coursemodule1",
"coursemodule_name": "Course Module 1"
},
This is the Mustache template for the index page.
Example context (json):
{
"section": "Section 2",
"coursemodule_url": "http://example.com/coursemodule2",
"coursemodule_name": "Course Module 2"
"module_name_plural": "Adler Activities",
"course_format_uses_sections": true,
"column_title_section": "Section",
"column_title_activity_name": "Activity Name",
"adleradaptivities": [
{
"section": "Section 1",
"coursemodule_url": "http://example.com/coursemodule1",
"coursemodule_name": "Course Module 1"
},
{
"section": "Section 2",
"coursemodule_url": "http://example.com/coursemodule2",
"coursemodule_name": "Course Module 2"
}
]
}
]
}
}}


Expand Down
37 changes: 21 additions & 16 deletions templates/questions.mustache
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
{{! @template
{
"module_completed": false,
"is_behat_mode": false,
"tasks": [
{{!
@template mod_adleradaptivity/questions
This template is used to display the questions and tasks of the Adler Adaptivity module.
Example context (json):
{
"title": "Task 1",
"optional": false,
"difficulty": "Medium",
"status_success": false,
"status_behat_class": "behat_status-failure",
"status_message": "Task not completed",
"questions": [
"module_completed": false,
"is_behat_mode": false,
"tasks": [
{
"status_best_try": false,
"content": "Question 1 content"
"title": "Task 1",
"optional": false,
"difficulty": "Medium",
"status_success": false,
"status_behat_class": "behat_status-failure",
"status_message": "Task not completed",
"questions": [
{
"status_best_try": false,
"content": "Question 1 content"
}
]
}
]
}
]
}
}}

<div class="mod_adleradaptivity_questions">
Expand Down

0 comments on commit 1a1074b

Please sign in to comment.