Skip to content

Commit

Permalink
Merge pull request #1197 from frappe/develop
Browse files Browse the repository at this point in the history
chore: merge 'develop' into 'main'
  • Loading branch information
pateljannat authored Dec 18, 2024
2 parents 44a63d9 + b48e007 commit 94d17b8
Show file tree
Hide file tree
Showing 21 changed files with 666 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .github/helper/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ echo "Setting Up System Dependencies..."

sudo apt update
sudo apt remove mysql-server mysql-client
sudo apt install libcups2-dev redis-server mariadb-client-10.6
sudo apt-get install libcups2-dev redis-server mariadb-client

install_wkhtmltopdf() {
wget -q https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

services:
mariadb:
image: mariadb:10.6
image: mariadb:10.8
env:
MARIADB_ROOT_PASSWORD: 123
ports:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
## Frappe Learning
Frappe Learning is an easy-to-use learning system that helps you bring structure to your content.

## Motivation
### Motivation
In 2021, we were looking for a Learning Management System to launch [Mon.School](https://mon.school) for FOSS United. We checked out Moodle, but it didn’t feel right. The forms were unnecessarily lengthy and the UI was confusing. It shouldn't be this hard to create a course right? So I started making a learning system for Mon.School which soon became a product in itself. The aim is to have a simple platform that anyone can use to launch a course of their own and make knowledge sharing easier.

## Key Features
### Key Features

- **Structured Learning**: Design a course with a 3-level hierarchy, where your courses have chapters and you can group your lessons within these chapters. This ensures that the context of the lesson is set by the chapter.

Expand Down Expand Up @@ -67,7 +67,7 @@ In 2021, we were looking for a Learning Management System to launch [Mon.School]
</details>


## Under the Hood
### Under the Hood

- [**Frappe Framework**](https://github.com/frappe/frappe): A full-stack web application framework.

Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.7"
name: lms
services:
mariadb:
image: mariadb:10.6
image: mariadb:10.8
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
Expand Down
31 changes: 16 additions & 15 deletions frontend/src/components/BatchStudents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
{{ row[column.key] }}
</div>
<div v-else-if="column.icon == 'book-open'">
{{ Math.ceil(row.courses[column.key]) }}%
{{ Math.ceil(row.courses[column.key]) }}
</div>
<div v-else-if="column.icon == 'help-circle'">
<Badge
Expand All @@ -62,7 +62,7 @@
>
{{ row.assessments[column.key] }}
</Badge>
<div v-else>{{ parseInt(row.assessments[column.key]) }}%</div>
<div v-else>{{ parseInt(row.assessments[column.key]) }}</div>
</div>
</ListRowItem>
</template>
Expand Down Expand Up @@ -134,22 +134,10 @@ const getStudentColumns = () => {
{
label: 'Full Name',
key: 'full_name',
width: '10rem',
width: '15rem',
},
]
if (students.data?.[0].courses) {
Object.keys(students.data?.[0].courses).forEach((course) => {
columns.push({
label: course,
key: course,
width: '10rem',
icon: 'book-open',
align: 'center',
})
})
}
if (students.data?.[0].assessments) {
Object.keys(students.data?.[0].assessments).forEach((assessment) => {
columns.push({
Expand All @@ -163,6 +151,19 @@ const getStudentColumns = () => {
})
})
}
if (students.data?.[0].courses) {
Object.keys(students.data?.[0].courses).forEach((course) => {
columns.push({
label: course,
key: course,
width: '10rem',
icon: 'book-open',
align: 'center',
})
})
}
return columns
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/CourseCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

<div v-if="course.status != 'Approved'">
<Badge
variant="solid"
variant="subtle"
:theme="course.status === 'Under Review' ? 'orange' : 'blue'"
size="sm"
>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Modals/ExplanationVideos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const props = defineProps({
required: true,
},
title: {
type: String,
type: [String, null],
required: true,
},
})
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/pages/CourseForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@
</div>
<FormControl
v-model="newTag"
:placeholder="__('Keywords for the course')"
class="w-52"
:placeholder="__('Add a keyword and then press enter')"
class="w-72"
@keyup.enter="updateTags()"
id="tags"
/>
Expand Down Expand Up @@ -288,6 +288,7 @@ const course = reactive({
video_link: '',
course_image: null,
tags: '',
category: '',
published: false,
published_on: '',
featured: false,
Expand Down
1 change: 1 addition & 0 deletions frontend/src/pages/LessonForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ const renderEditor = (holder) => {
holder: holder,
tools: getEditorTools(true),
autofocus: true,
defaultBlock: 'markdown',
})
}
Expand Down
16 changes: 10 additions & 6 deletions frontend/src/pages/QuizSubmissionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<Breadcrumbs :items="breadcrumbs" />
</header>
<div v-if="submissions.data?.length" class="md:w-3/4 md:mx-auto py-5 mx-5">
<div class="text-xl font-semibold mb-5">
{{ submissions.data[0].quiz_title }}
</div>
<ListView
:columns="quizColumns"
:rows="submissions.data"
Expand All @@ -31,12 +34,18 @@
</router-link>
</ListRows>
</ListView>
<div class="flex justify-center my-5">
<Button v-if="submissions.hasNextPage" @click="submissions.next()">
{{ __('Load More') }}
</Button>
</div>
</div>
</template>
<script setup>
import {
createListResource,
Breadcrumbs,
Button,
ListView,
ListRow,
ListRows,
Expand Down Expand Up @@ -76,12 +85,7 @@ const quizColumns = computed(() => {
{
label: __('Member'),
key: 'member_name',
width: 2,
},
{
label: __('Quiz'),
key: 'quiz_title',
width: 2,
width: 1,
},
{
label: __('Score'),
Expand Down
10 changes: 6 additions & 4 deletions frontend/src/pages/Quizzes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
</router-link>
</ListRows>
</ListView>
<div class="flex justify-center my-5">
<Button v-if="quizzes.hasNextPage" @click="quizzes.next()">
{{ __('Load More') }}
</Button>
</div>
</div>
<div
v-else
Expand All @@ -67,13 +72,13 @@
<script setup>
import {
Breadcrumbs,
Button,
createListResource,
ListView,
ListRows,
ListRow,
ListHeader,
ListHeaderItem,
Button,
} from 'frappe-ui'
import { useRouter } from 'vue-router'
import { computed, inject, onMounted } from 'vue'
Expand Down Expand Up @@ -103,9 +108,6 @@ const quizzes = createListResource({
auto: true,
cache: ['quizzes', user.data?.name],
orderBy: 'modified desc',
onSuccess(data) {
data.forEach((row) => {})
},
})
const quizColumns = computed(() => {
Expand Down
9 changes: 8 additions & 1 deletion frontend/src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { toast } from 'frappe-ui'
import { useTimeAgo } from '@vueuse/core'
import { Quiz } from '@/utils/quiz'
import { Upload } from '@/utils/upload'
import { Markdown } from '@/utils/markdownParser'
import Header from '@editorjs/header'
import Paragraph from '@editorjs/paragraph'
import { CodeBox } from '@/utils/code'
Expand Down Expand Up @@ -147,9 +148,15 @@ export function htmlToText(html) {

export function getEditorTools() {
return {
header: Header,
header: {
class: Header,
config: {
placeholder: 'Header',
},
},
quiz: Quiz,
upload: Upload,
markdown: Markdown,
image: SimpleImage,
table: Table,
paragraph: {
Expand Down
Loading

0 comments on commit 94d17b8

Please sign in to comment.