mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 00:14:50 +00:00
committed by
GitHub
parent
08fa7590ef
commit
12bc43e495
@@ -4,5 +4,18 @@
|
|||||||
frappe.ui.form.on('Quiz', {
|
frappe.ui.form.on('Quiz', {
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
|
|
||||||
|
},
|
||||||
|
validate: function(frm){
|
||||||
|
frm.events.check_duplicate_question(frm.doc.question);
|
||||||
|
},
|
||||||
|
check_duplicate_question: function(questions_data){
|
||||||
|
var questions = [];
|
||||||
|
questions_data.forEach(function(q){
|
||||||
|
questions.push(q.question_link);
|
||||||
|
});
|
||||||
|
var questions_set = new Set(questions);
|
||||||
|
if (questions.length != questions_set.size) {
|
||||||
|
frappe.throw(__("The question cannot be duplicate"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user