+
diff --git a/frontend/src/pages/QuizForm.vue b/frontend/src/pages/QuizForm.vue
index 7ba3bceb..c143d2aa 100644
--- a/frontend/src/pages/QuizForm.vue
+++ b/frontend/src/pages/QuizForm.vue
@@ -211,7 +211,6 @@ import { Plus, Trash2 } from 'lucide-vue-next'
import Question from '@/components/Modals/Question.vue'
import { showToast, updateDocumentTitle } from '@/utils'
import { useRouter } from 'vue-router'
-import { useOnboarding } from 'frappe-ui/frappe'
const showQuestionModal = ref(false)
const currentQuestion = reactive({
@@ -221,7 +220,6 @@ const currentQuestion = reactive({
})
const user = inject('$user')
const router = useRouter()
-const { updateOnboardingStep } = useOnboarding('learning')
const props = defineProps({
quizID: {
@@ -339,7 +337,6 @@ const createQuiz = () => {
{
onSuccess(data) {
showToast(__('Success'), __('Quiz created successfully'), 'check')
- updateOnboardingStep('create_first_quiz')
router.push({
name: 'QuizForm',
params: { quizID: data.name },
diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js
index 0f6fe469..20b6bd73 100644
--- a/frontend/tailwind.config.js
+++ b/frontend/tailwind.config.js
@@ -3,8 +3,10 @@ module.exports = {
content: [
'./index.html',
'./src/**/*.{vue,js,ts,jsx,tsx}',
- './node_modules/frappe-ui/src/components/**/*.{vue,js,ts,jsx,tsx}',
- '../node_modules/frappe-ui/src/components/**/*.{vue,js,ts,jsx,tsx}',
+ './node_modules/frappe-ui/src/**/*.{vue,js,ts,jsx,tsx}',
+ '../node_modules/frappe-ui/src/**/*.{vue,js,ts,jsx,tsx}',
+ './node_modules/frappe-ui/frappe/**/*.{vue,js,ts,jsx,tsx}',
+ '../node_modules/frappe-ui/frappe/**/*.{vue,js,ts,jsx,tsx}',
],
theme: {
extend: {
diff --git a/frontend/vite.config.js b/frontend/vite.config.js
index 626a9a7b..a62def39 100644
--- a/frontend/vite.config.js
+++ b/frontend/vite.config.js
@@ -25,7 +25,7 @@ export default defineConfig({
}),
],
server: {
- allowedHosts: ['fs', 'onb'],
+ allowedHosts: ['fs', 'onb1'],
},
resolve: {
alias: {
diff --git a/lms/lms/api.py b/lms/lms/api.py
index 38f59622..4358e80d 100644
--- a/lms/lms/api.py
+++ b/lms/lms/api.py
@@ -1339,3 +1339,24 @@ def save_role(user, role, value):
else:
frappe.db.delete("Has Role", {"parent": user, "role": role})
return True
+
+
+@frappe.whitelist()
+def add_an_evaluator(email):
+ if not frappe.db.exists("User", email):
+ user = frappe.new_doc("User")
+ user.update(
+ {
+ "email": email,
+ "first_name": email.split("@")[0].capitalize(),
+ "enabled": 1,
+ }
+ )
+ user.insert()
+ user.add_roles("Batch Evaluator")
+
+ evaluator = frappe.new_doc("Course Evaluator")
+ evaluator.evaluator = email
+ evaluator.insert()
+
+ return evaluator
diff --git a/lms/lms/doctype/course_evaluator/course_evaluator.json b/lms/lms/doctype/course_evaluator/course_evaluator.json
index 2c3c31a5..702aabc8 100644
--- a/lms/lms/doctype/course_evaluator/course_evaluator.json
+++ b/lms/lms/doctype/course_evaluator/course_evaluator.json
@@ -8,6 +8,11 @@
"engine": "InnoDB",
"field_order": [
"evaluator",
+ "full_name",
+ "column_break_casg",
+ "user_image",
+ "username",
+ "section_break_ljse",
"schedule",
"unavailability_section",
"unavailable_from",
@@ -18,8 +23,10 @@
{
"fieldname": "evaluator",
"fieldtype": "Link",
+ "in_list_view": 1,
"label": "Evaluator",
"options": "User",
+ "reqd": 1,
"unique": 1
},
{
@@ -46,11 +53,40 @@
"fieldname": "unavailable_to",
"fieldtype": "Date",
"label": "To"
+ },
+ {
+ "fetch_from": "evaluator.full_name",
+ "fieldname": "full_name",
+ "fieldtype": "Data",
+ "label": "Full Name",
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break_casg",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "section_break_ljse",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fetch_from": "evaluator.user_image",
+ "fieldname": "user_image",
+ "fieldtype": "Attach Image",
+ "label": "User Image",
+ "read_only": 1
+ },
+ {
+ "fetch_from": "evaluator.username",
+ "fieldname": "username",
+ "fieldtype": "Data",
+ "label": "Username",
+ "read_only": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
- "modified": "2025-02-24 12:17:08.436659",
+ "modified": "2025-03-26 14:02:46.588721",
"modified_by": "Administrator",
"module": "LMS",
"name": "Course Evaluator",
@@ -94,7 +130,8 @@
"write": 1
}
],
+ "row_format": "Dynamic",
"sort_field": "modified",
"sort_order": "DESC",
"states": []
-}
\ No newline at end of file
+}
diff --git a/lms/lms/doctype/course_evaluator/course_evaluator.py b/lms/lms/doctype/course_evaluator/course_evaluator.py
index 93be1b08..f7e1573b 100644
--- a/lms/lms/doctype/course_evaluator/course_evaluator.py
+++ b/lms/lms/doctype/course_evaluator/course_evaluator.py
@@ -11,9 +11,15 @@ from frappe.utils import get_time, getdate
class CourseEvaluator(Document):
def validate(self):
+ self.validate_evaluator_role()
self.validate_time_slots()
self.validate_unavailability()
+ def validate_evaluator_role(self):
+ roles = frappe.get_roles(self.evaluator)
+ if "Batch Evaluator" not in roles:
+ frappe.get_doc("User", self.evaluator).add_roles("Batch Evaluator")
+
def validate_unavailability(self):
if (
self.unavailable_from
diff --git a/lms/lms/onboarding.py b/lms/lms/onboarding.py
index 5aef0d12..4585891c 100644
--- a/lms/lms/onboarding.py
+++ b/lms/lms/onboarding.py
@@ -1,5 +1,6 @@
import frappe
+
def get_first_course():
course = frappe.get_all(
"LMS Course",
@@ -9,6 +10,7 @@ def get_first_course():
)
return course[0].name if course else None
+
def get_first_batch():
batch = frappe.get_all(
"LMS Batch",
@@ -16,4 +18,4 @@ def get_first_batch():
order_by="creation",
limit=1,
)
- return batch[0].name if batch else None
\ No newline at end of file
+ return batch[0].name if batch else None
diff --git a/yarn.lock b/yarn.lock
index 8e12bb2b..2e51d28e 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -103,9 +103,9 @@
style-mod "^4.0.0"
"@codemirror/lint@^6.4.2":
- version "6.8.4"
- resolved "https://registry.yarnpkg.com/@codemirror/lint/-/lint-6.8.4.tgz#7d8aa5d1a6dec89ffcc23ad45ddca2e12e90982d"
- integrity sha512-u4q7PnZlJUojeRe8FJa/njJcMctISGgPQ4PnWsd9268R4ZTtU+tfFYmwkBvgcrK2+QQ8tYFVALVb5fVJykKc5A==
+ version "6.8.5"
+ resolved "https://registry.yarnpkg.com/@codemirror/lint/-/lint-6.8.5.tgz#9edaa808e764e28e07665b015951934c8ec3a418"
+ integrity sha512-s3n3KisH7dx3vsoeGMxsbRAgKe4O1vbrnKBClm99PU0fWxmxsx5rR2PfqQgIt+2MMJBHbiJ5rfIdLYfB9NNvsA==
dependencies:
"@codemirror/state" "^6.0.0"
"@codemirror/view" "^6.35.0"
@@ -2314,9 +2314,9 @@ ee-first@1.1.1:
integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==
electron-to-chromium@^1.5.73:
- version "1.5.123"
- resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.123.tgz#fae5bdba0ba27045895176327aa79831aba0790c"
- integrity sha512-refir3NlutEZqlKaBLK0tzlVLe5P2wDKS7UQt/3SpibizgsRAPOsqQC3ffw1nlv3ze5gjRQZYHoPymgVZkplFA==
+ version "1.5.124"
+ resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.124.tgz#34b1d6baf8f21d9dbcbae6e67fa276e54554ce81"
+ integrity sha512-riELkpDUqBi00gqreV3RIGoowxGrfueEKBd6zPdOk/I8lvuFpBGNkYoHof3zUHbiTBsIU8oxdIIL/WNrAG1/7A==
emoji-regex@^10.3.0:
version "10.4.0"
@@ -2664,9 +2664,9 @@ finalhandler@1.1.2:
unpipe "~1.0.0"
flexsearch@*:
- version "0.8.132"
- resolved "https://registry.yarnpkg.com/flexsearch/-/flexsearch-0.8.132.tgz#6ec63d37fe8ea59d9d5a0dcdfdd64ec6b2e5b95c"
- integrity sha512-eK5MrXL2qgt+mHpFueW2PNdQNSx3rkpn/6QyiqNFr0Zyy8YffmiG+L52AM/H9kAHx5OcMdYhUtCy/z1xmI3VKg==
+ version "0.8.140"
+ resolved "https://registry.yarnpkg.com/flexsearch/-/flexsearch-0.8.140.tgz#f9ab78c2560c182e047abb578ff0ad307a61154d"
+ integrity sha512-G6aEypMdVsvpEmSbu74wJu1cDHz9JxL0asmBhK4Yk3a3LG89EdM+tWFbJwELdLgwJsAjcZBGR7wczvOOKjpO+w==
flexsearch@0.7.21:
version "0.7.21"
@@ -3250,6 +3250,11 @@ lazy-ass@^1.6.0:
resolved "https://registry.yarnpkg.com/lazy-ass/-/lazy-ass-1.6.0.tgz#7999655e8646c17f089fdd187d150d3324d54513"
integrity sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==
+lilconfig@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52"
+ integrity sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==
+
lilconfig@^3.0.0, lilconfig@^3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-3.1.3.tgz#a1bcfd6257f9585bf5ae14ceeebb7b559025e4c4"
@@ -4836,7 +4841,35 @@ symbol-tree@^3.2.4:
resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2"
integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==
-tailwindcss@^3.2.7, tailwindcss@^3.3.3:
+tailwindcss@3.4.15:
+ version "3.4.15"
+ resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.4.15.tgz#04808bf4bf1424b105047d19e7d4bfab368044a9"
+ integrity sha512-r4MeXnfBmSOuKUWmXe6h2CcyfzJCEk4F0pptO5jlnYSIViUkVmsawj80N5h2lO3gwcmSb4n3PuN+e+GC1Guylw==
+ dependencies:
+ "@alloc/quick-lru" "^5.2.0"
+ arg "^5.0.2"
+ chokidar "^3.6.0"
+ didyoumean "^1.2.2"
+ dlv "^1.1.3"
+ fast-glob "^3.3.2"
+ glob-parent "^6.0.2"
+ is-glob "^4.0.3"
+ jiti "^1.21.6"
+ lilconfig "^2.1.0"
+ micromatch "^4.0.8"
+ normalize-path "^3.0.0"
+ object-hash "^3.0.0"
+ picocolors "^1.1.1"
+ postcss "^8.4.47"
+ postcss-import "^15.1.0"
+ postcss-js "^4.0.1"
+ postcss-load-config "^4.0.2"
+ postcss-nested "^6.2.0"
+ postcss-selector-parser "^6.1.2"
+ resolve "^1.22.8"
+ sucrase "^3.35.0"
+
+tailwindcss@^3.2.7:
version "3.4.17"
resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.4.17.tgz#ae8406c0f96696a631c790768ff319d46d5e5a63"
integrity sha512-w33E2aCvSDP0tW9RZuNXadXlkHXqFzSkQew/aIa2i/Sj8fThxwovwlXHSPXTbAHwEIhBFXAedUhP2tueAKP8Og==