unfinished courseCreation
This commit is contained in:
1 parent
b29d1c6260
commit
7c48e66677
1 file changed
+42
-4
+42
-4
@@ -54,9 +54,27 @@ setUserData(couchDB);
|
|||||||
</div>
|
</div>
|
||||||
-->
|
-->
|
||||||
<div id="course-list"></div>
|
<div id="course-list"></div>
|
||||||
|
<button class="new" id="newButton" onclick="showCourseCreation()">+</button>
|
||||||
</content>
|
</content>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
button.new {
|
||||||
|
display: block;
|
||||||
|
margin: 20px auto;
|
||||||
|
font-size: 30px;
|
||||||
|
font-weight: bold;
|
||||||
|
border: none;
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: var(--accent_color_bg);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
button.new:hover {
|
||||||
|
background-color: var(--accent_color_bg_o);
|
||||||
|
}
|
||||||
|
|
||||||
button.auswertung {
|
button.auswertung {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
@@ -181,15 +199,35 @@ button.auswertung:hover {
|
|||||||
|
|
||||||
<button class="action edit" onclick="showEditCourse('${courseId}')">
|
<button class="action edit" onclick="showEditCourse('${courseId}')">
|
||||||
✎
|
✎
|
||||||
</button>
|
</button>
|
||||||
`;
|
`;
|
||||||
courseList.appendChild(card);
|
courseList.appendChild(card);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
async function showCourseCreation() {
|
||||||
function editCourse(courseId) {
|
await couchDB.set("course:NewCourse", {
|
||||||
showEditCourse(courseId);
|
"title": "NewCourse",
|
||||||
|
"description": "",
|
||||||
|
"owner": userData,
|
||||||
|
"questions": [
|
||||||
|
],
|
||||||
|
"result": [
|
||||||
|
],
|
||||||
|
"result_history": [
|
||||||
|
{
|
||||||
|
"date": "2025-12-27",
|
||||||
|
"questions": [
|
||||||
|
],
|
||||||
|
"result": [
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"start_date": "",
|
||||||
|
"expire_date": ""
|
||||||
|
});
|
||||||
|
userData.courses.push("NewCourse")
|
||||||
|
showEditCourse("NewCourse")
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in new issue
Block a user