diff --git a/Project 2/config/project-scratch-def.json b/Project 2/config/project-scratch-def.json index bd41a5b..330ea8e 100644 --- a/Project 2/config/project-scratch-def.json +++ b/Project 2/config/project-scratch-def.json @@ -1,5 +1,5 @@ { - "orgName": "Demo Company", + "orgName": "mayingjunlang Company", "edition": "Developer", "features": [], "settings": { diff --git a/Project 2/force-app/main/default/aura/testComponent/testComponent.auradoc b/Project 2/force-app/main/default/aura/testComponent/testComponent.auradoc new file mode 100644 index 0000000..d0d6eb5 --- /dev/null +++ b/Project 2/force-app/main/default/aura/testComponent/testComponent.auradoc @@ -0,0 +1,6 @@ + + Documentation + + Example Description + + \ No newline at end of file diff --git a/Project 2/force-app/main/default/aura/testComponent/testComponent.cmp b/Project 2/force-app/main/default/aura/testComponent/testComponent.cmp new file mode 100644 index 0000000..dda103f --- /dev/null +++ b/Project 2/force-app/main/default/aura/testComponent/testComponent.cmp @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Project 2/force-app/main/default/aura/testComponent/testComponent.cmp-meta.xml b/Project 2/force-app/main/default/aura/testComponent/testComponent.cmp-meta.xml new file mode 100644 index 0000000..7348b5f --- /dev/null +++ b/Project 2/force-app/main/default/aura/testComponent/testComponent.cmp-meta.xml @@ -0,0 +1,5 @@ + + + 46.0 + A Lightning Component Bundle + diff --git a/Project 2/force-app/main/default/aura/testComponent/testComponent.css b/Project 2/force-app/main/default/aura/testComponent/testComponent.css new file mode 100644 index 0000000..a5839d4 --- /dev/null +++ b/Project 2/force-app/main/default/aura/testComponent/testComponent.css @@ -0,0 +1,2 @@ +.THIS { +} \ No newline at end of file diff --git a/Project 2/force-app/main/default/aura/testComponent/testComponent.design b/Project 2/force-app/main/default/aura/testComponent/testComponent.design new file mode 100644 index 0000000..d247163 --- /dev/null +++ b/Project 2/force-app/main/default/aura/testComponent/testComponent.design @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Project 2/force-app/main/default/aura/testComponent/testComponent.svg b/Project 2/force-app/main/default/aura/testComponent/testComponent.svg new file mode 100644 index 0000000..791b3c7 --- /dev/null +++ b/Project 2/force-app/main/default/aura/testComponent/testComponent.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Project 2/force-app/main/default/aura/testComponent/testComponentController.js b/Project 2/force-app/main/default/aura/testComponent/testComponentController.js new file mode 100644 index 0000000..77e406b --- /dev/null +++ b/Project 2/force-app/main/default/aura/testComponent/testComponentController.js @@ -0,0 +1,5 @@ +({ + myAction : function(component, event, helper) { + + } +}) \ No newline at end of file diff --git a/Project 2/force-app/main/default/aura/testComponent/testComponentHelper.js b/Project 2/force-app/main/default/aura/testComponent/testComponentHelper.js new file mode 100644 index 0000000..ba7f386 --- /dev/null +++ b/Project 2/force-app/main/default/aura/testComponent/testComponentHelper.js @@ -0,0 +1,5 @@ +({ + helperMethod : function() { + + } +}) \ No newline at end of file diff --git a/Project 2/force-app/main/default/aura/testComponent/testComponentRenderer.js b/Project 2/force-app/main/default/aura/testComponent/testComponentRenderer.js new file mode 100644 index 0000000..f1f0c75 --- /dev/null +++ b/Project 2/force-app/main/default/aura/testComponent/testComponentRenderer.js @@ -0,0 +1,5 @@ +({ + +// Your renderer method overrides go here + +}) \ No newline at end of file diff --git a/Project 2/force-app/main/default/classes/QuestionClass.cls b/Project 2/force-app/main/default/classes/QuestionClass.cls new file mode 100644 index 0000000..96bd0e9 --- /dev/null +++ b/Project 2/force-app/main/default/classes/QuestionClass.cls @@ -0,0 +1,3 @@ +public class QuestionClass { + +} \ No newline at end of file diff --git a/Project 2/force-app/main/default/classes/QuestionClass.cls-meta.xml b/Project 2/force-app/main/default/classes/QuestionClass.cls-meta.xml new file mode 100644 index 0000000..91b23b8 --- /dev/null +++ b/Project 2/force-app/main/default/classes/QuestionClass.cls-meta.xml @@ -0,0 +1,5 @@ + + + 46.0 + Active + diff --git a/Project 2/force-app/main/default/classes/QuizPageController.cls b/Project 2/force-app/main/default/classes/QuizPageController.cls index 1874d63..1db398f 100644 --- a/Project 2/force-app/main/default/classes/QuizPageController.cls +++ b/Project 2/force-app/main/default/classes/QuizPageController.cls @@ -1,32 +1,106 @@ + public class QuizPageController { - - public list QuesList {get;set;} + +public string choice {get;set;} + integer count=0; integer limitSize=10; - - public void getQues(){ - quesList=[SELECT name FROM Questions__c LIMIT:limitSize OFFSET:count]; + integer score=0; + integer totalRecs=0; + + list newAcc=[SELECT Id FROM account WHERE OwnerId = :UserInfo.getUserID() LIMIT 1]; + + public QuizPageController() { + q = [SELECT id, Name FROM Quiz__c LIMIT 1]; + ques = [SELECT Name ,A__c,B__c,C__c,D__c,CorrectAnswer__c FROM Questions__c WHERE Quiz__c IN :q LIMIT :limitSize OFFSET :count ]; + totalrecs=ques.size(); + + + } + + public list q; + public list ques; + + + + + + public Quiz__c getQuiz() { + return q[0]; } - public PageReference Q1(){ - count=0; - return null; + public Questions__c getQuestions(){ + return ques[count]; + + } - public List getAnswers() { List options = new List(); - options.add(new SelectOption('A1','Answer 1')); - options.add(new SelectOption('A2','Answer 2')); - options.add(new SelectOption('A3','Answer 3')); - options.add(new SelectOption('A4','Answer 4')); + options.add(new SelectOption('A',Ques[count].a__c)); + options.add(new SelectOption('B',Ques[count].b__c)); + options.add(new SelectOption('C',Ques[count].c__c)); + options.add(new SelectOption('D',Ques[count].d__c)); return options; } + + public PageReference Q1(){ + count=0; + return null; + } + + public PageReference next(){ + if(choice == ques[count].CorrectAnswer__c){ + score++; + + System.debug('score:'+score); + } + + count++; + choice=null; + return null; + } + + public Boolean getNxt() { + if(count> totalRecs-2) + return true; + else + return false; + } + + public Boolean getLst(){ + if(count==TotalRecs-1){ + return false; + }else{ + return true; + } + } + + public PageReference previous(){ + count--; + return null; + } + public void submit(){ + if(choice == ques[count].CorrectAnswer__c){ + score++; + } + System.debug('score:'+score); + System.debug('final'+ques.size()); + AccountQuiz__c newAccQuiz = new AccountQuiz__c(name='test', Account__c=newAcc[0].Id, Quiz__c=q[0].id,Score__c=((score*100/ques.size()))); + insert newAccQuiz; + } + + + + + + + } \ No newline at end of file diff --git a/Project 2/force-app/main/default/classes/indiLeadController.cls b/Project 2/force-app/main/default/classes/indiLeadController.cls new file mode 100644 index 0000000..392d094 --- /dev/null +++ b/Project 2/force-app/main/default/classes/indiLeadController.cls @@ -0,0 +1,36 @@ +public with sharing class indiLeadController { + + public indiLeadController(){ + + } + + + +public static list getAccount(){ + list accList =[SELECT name, points__c FROM account ORDER BY points__c DESC LIMIT 5]; + list newaccList = new list(); + for(account a :accList){ + a.ranking__c=accList.indexOf(a)+1; + newaccList.add(a); + } + + return newaccList; +} + +public static list getmyAccount(){ + list myaccList = [SELECT name, points__c FROM account ORDER BY points__c DESC]; + list myownaccList =[SELECT name, points__c FROM account WHERE OwnerId = :UserInfo.getUserID()]; + account myacc=[SELECT name, points__c FROM account WHERE OwnerId = :UserInfo.getUserID()][0]; + integer rank = myaccList.IndexOf(myacc)+1; + system.debug('rank:'+rank); + + list mynewaccList = new list(); + for(account a : myownaccList){ + a.ranking__c=rank; + mynewaccList.add(a); + } + + return mynewaccList; +} + +} diff --git a/Project 2/force-app/main/default/classes/indiLeadController.cls-meta.xml b/Project 2/force-app/main/default/classes/indiLeadController.cls-meta.xml new file mode 100644 index 0000000..bd3d60f --- /dev/null +++ b/Project 2/force-app/main/default/classes/indiLeadController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 46.0 + Active + diff --git a/Project 2/force-app/main/default/classes/sad.cls b/Project 2/force-app/main/default/classes/sad.cls new file mode 100644 index 0000000..4e6bdff --- /dev/null +++ b/Project 2/force-app/main/default/classes/sad.cls @@ -0,0 +1,3 @@ +public class sad { + +} \ No newline at end of file diff --git a/Project 2/force-app/main/default/classes/sad.cls-meta.xml b/Project 2/force-app/main/default/classes/sad.cls-meta.xml new file mode 100644 index 0000000..91b23b8 --- /dev/null +++ b/Project 2/force-app/main/default/classes/sad.cls-meta.xml @@ -0,0 +1,5 @@ + + + 46.0 + Active + diff --git a/Project 2/force-app/main/default/components/IndiLeadComp.component b/Project 2/force-app/main/default/components/IndiLeadComp.component new file mode 100644 index 0000000..e4e25cc --- /dev/null +++ b/Project 2/force-app/main/default/components/IndiLeadComp.component @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Project 2/force-app/main/default/components/IndiLeadComp.component-meta.xml b/Project 2/force-app/main/default/components/IndiLeadComp.component-meta.xml new file mode 100644 index 0000000..447ff48 --- /dev/null +++ b/Project 2/force-app/main/default/components/IndiLeadComp.component-meta.xml @@ -0,0 +1,5 @@ + + + 46.0 + + diff --git a/Project 2/force-app/main/default/flows/Update_Average_Quiz_Score.flow-meta.xml b/Project 2/force-app/main/default/flows/Update_Average_Quiz_Score.flow-meta.xml index 69433e8..941c25f 100644 --- a/Project 2/force-app/main/default/flows/Update_Average_Quiz_Score.flow-meta.xml +++ b/Project 2/force-app/main/default/flows/Update_Average_Quiz_Score.flow-meta.xml @@ -19,10 +19,40 @@ myRule_1 and - formula_myRule_1 - EqualTo + + inputDataType + + ID + + + + leftHandSideReferenceTo + + Account + + + + leftHandSideType + + ID + + + + operatorDataType + + String + + + + rightHandSideType + + ID + + + myVariable_current.Account__c + NotEqualTo - true + null @@ -47,10 +77,40 @@ myRule_4 and - formula_myRule_4 - EqualTo + + inputDataType + + ID + + + + leftHandSideReferenceTo + + Account + + + + leftHandSideType + + ID + + + + operatorDataType + + String + + + + rightHandSideType + + ID + + + myVariable_current.Account__c + NotEqualTo - true + null @@ -67,7 +127,7 @@ [Quiz__c].Account__c.QuizNum__c +1 - formula_2_myRule_1_A1_5572609372 + formula_2_myRule_1_A1_0571309320 Number {!myVariable_current.Account__r.QuizNum__c} +1 18 @@ -79,22 +139,12 @@ ([Quiz__c].Account__c.Quiz_Average__c *([Quiz__c].Account__c.QuizNum__c -1)+[Quiz__c].Score__c )/[Quiz__c].Account__c.QuizNum__c - formula_5_myRule_4_A1_8099192370 + formula_5_myRule_4_A1_8679715097 Number ({!myVariable_current.Account__r.Quiz_Average__c} *({!myVariable_current.Account__r.QuizNum__c} -1)+{!myVariable_current.Score__c} )/{!myVariable_current.Account__r.QuizNum__c} 18 - - formula_myRule_1 - Boolean - true - - - formula_myRule_4 - Boolean - true - - Update_Average_Quiz_Score-1_InterviewLabel + Update_Average_Quiz_Score-3_InterviewLabel ObjectType @@ -199,7 +249,7 @@ QuizNum__c - formula_2_myRule_1_A1_5572609372 + formula_2_myRule_1_A1_0571309320 Account @@ -279,13 +329,13 @@ Quiz_Average__c - formula_5_myRule_4_A1_8099192370 + formula_5_myRule_4_A1_8679715097 Account myDecision - Active + Draft myVariable_current SObject diff --git a/Project 2/force-app/main/default/layouts/Account-Account %28Marketing%29 Layout.layout-meta.xml b/Project 2/force-app/main/default/layouts/Account-Account %28Marketing%29 Layout.layout-meta.xml index 1d98f7b..0a5a12b 100644 --- a/Project 2/force-app/main/default/layouts/Account-Account %28Marketing%29 Layout.layout-meta.xml +++ b/Project 2/force-app/main/default/layouts/Account-Account %28Marketing%29 Layout.layout-meta.xml @@ -37,6 +37,14 @@ Edit QuizNum__c + + Readonly + Points__c + + + Edit + ranking__c + @@ -185,9 +193,6 @@ NewEvent - - FeedItem.RypplePost - FeedItem.LinkPost diff --git a/Project 2/force-app/main/default/layouts/Account-Account %28Sales%29 Layout.layout-meta.xml b/Project 2/force-app/main/default/layouts/Account-Account %28Sales%29 Layout.layout-meta.xml index a527c4c..d15e0f5 100644 --- a/Project 2/force-app/main/default/layouts/Account-Account %28Sales%29 Layout.layout-meta.xml +++ b/Project 2/force-app/main/default/layouts/Account-Account %28Sales%29 Layout.layout-meta.xml @@ -53,6 +53,14 @@ Edit QuizNum__c + + Readonly + Points__c + + + Edit + ranking__c + @@ -183,9 +191,6 @@ NewEvent - - FeedItem.RypplePost - FeedItem.LinkPost diff --git a/Project 2/force-app/main/default/layouts/Account-Account %28Support%29 Layout.layout-meta.xml b/Project 2/force-app/main/default/layouts/Account-Account %28Support%29 Layout.layout-meta.xml index 03502d3..7294096 100644 --- a/Project 2/force-app/main/default/layouts/Account-Account %28Support%29 Layout.layout-meta.xml +++ b/Project 2/force-app/main/default/layouts/Account-Account %28Support%29 Layout.layout-meta.xml @@ -49,6 +49,14 @@ Edit QuizNum__c + + Readonly + Points__c + + + Edit + ranking__c + @@ -185,9 +193,6 @@ NewEvent - - FeedItem.RypplePost - FeedItem.LinkPost diff --git a/Project 2/force-app/main/default/layouts/Account-Account Layout.layout-meta.xml b/Project 2/force-app/main/default/layouts/Account-Account Layout.layout-meta.xml index f139e38..918eac0 100644 --- a/Project 2/force-app/main/default/layouts/Account-Account Layout.layout-meta.xml +++ b/Project 2/force-app/main/default/layouts/Account-Account Layout.layout-meta.xml @@ -49,6 +49,14 @@ Edit QuizNum__c + + Readonly + Points__c + + + Edit + ranking__c + @@ -183,9 +191,6 @@ NewEvent - - FeedItem.RypplePost - FeedItem.LinkPost diff --git a/Project 2/force-app/main/default/layouts/Questions__c-Questions Layout.layout-meta.xml b/Project 2/force-app/main/default/layouts/Questions__c-Questions Layout.layout-meta.xml new file mode 100644 index 0000000..8d61794 --- /dev/null +++ b/Project 2/force-app/main/default/layouts/Questions__c-Questions Layout.layout-meta.xml @@ -0,0 +1,119 @@ + + + + false + false + true + + + + Required + Quiz__c + + + Required + Name + + + Edit + CorrectAnswer__c + + + Edit + A__c + + + Edit + B__c + + + Edit + C__c + + + Edit + D__c + + + Required + Right_Answer__c + + + Required + Wrong_Answer_1__c + + + Edit + Wrong_Answer_2__c + + + Edit + Wrong_Answer_3__c + + + + + + + false + false + true + + + + Readonly + CreatedById + + + + + Readonly + LastModifiedById + + + + + + true + false + true + + + + + + + + Quiz__c + + + TASK.SUBJECT + TASK.WHO_NAME + ACTIVITY.TASK + TASK.DUE_DATE + TASK.STATUS + TASK.PRIORITY + CORE.USERS.FULL_NAME + RelatedActivityList + + + TASK.SUBJECT + TASK.WHO_NAME + ACTIVITY.TASK + TASK.DUE_DATE + CORE.USERS.FULL_NAME + TASK.LAST_UPDATE + RelatedHistoryList + + false + false + false + false + false + + 00h17000003eFhb + 4 + 0 + Default + + diff --git a/Project 2/force-app/main/default/layouts/Quiz__c-Quiz Layout.layout-meta.xml b/Project 2/force-app/main/default/layouts/Quiz__c-Quiz Layout.layout-meta.xml index 1d8fb41..4ce051e 100644 --- a/Project 2/force-app/main/default/layouts/Quiz__c-Quiz Layout.layout-meta.xml +++ b/Project 2/force-app/main/default/layouts/Quiz__c-Quiz Layout.layout-meta.xml @@ -1,5 +1,6 @@ + Submit false false @@ -20,6 +21,10 @@ Edit OwnerId + + Edit + Score__c + @@ -43,9 +48,10 @@ - false + true false true + @@ -75,4 +81,10 @@ false false false + + 00h17000003eFhc + 4 + 0 + Default + diff --git a/Project 2/force-app/main/default/objects/Account/fields/Points__c.field-meta.xml b/Project 2/force-app/main/default/objects/Account/fields/Points__c.field-meta.xml new file mode 100644 index 0000000..fa26d86 --- /dev/null +++ b/Project 2/force-app/main/default/objects/Account/fields/Points__c.field-meta.xml @@ -0,0 +1,10 @@ + + + Points__c + false + + AccountQuiz__c.Score__c + AccountQuiz__c.Account__c + sum + Summary + diff --git a/Project 2/force-app/main/default/objects/Account/fields/Quiz_Average__c.field-meta.xml b/Project 2/force-app/main/default/objects/Account/fields/Quiz_Average__c.field-meta.xml index 32a6de6..b4da841 100644 --- a/Project 2/force-app/main/default/objects/Account/fields/Quiz_Average__c.field-meta.xml +++ b/Project 2/force-app/main/default/objects/Account/fields/Quiz_Average__c.field-meta.xml @@ -1,6 +1,7 @@ Quiz_Average__c + 0 false 18 diff --git a/Project 2/force-app/main/default/objects/Account/fields/ranking__c.field-meta.xml b/Project 2/force-app/main/default/objects/Account/fields/ranking__c.field-meta.xml new file mode 100644 index 0000000..67f6df7 --- /dev/null +++ b/Project 2/force-app/main/default/objects/Account/fields/ranking__c.field-meta.xml @@ -0,0 +1,12 @@ + + + ranking__c + false + + 18 + false + 0 + false + Number + false + diff --git a/Project 2/force-app/main/default/objects/AccountQuiz__c/AccountQuiz__c.object-meta.xml b/Project 2/force-app/main/default/objects/AccountQuiz__c/AccountQuiz__c.object-meta.xml new file mode 100644 index 0000000..e967130 --- /dev/null +++ b/Project 2/force-app/main/default/objects/AccountQuiz__c/AccountQuiz__c.object-meta.xml @@ -0,0 +1,165 @@ + + + + Accept + Default + + + Accept + Large + Default + + + Accept + Small + Default + + + CancelEdit + Default + + + CancelEdit + Large + Default + + + CancelEdit + Small + Default + + + Clone + Default + + + Clone + Large + Default + + + Clone + Small + Default + + + Delete + Default + + + Delete + Large + Default + + + Delete + Small + Default + + + Edit + Default + + + Edit + Large + Default + + + Edit + Small + Default + + + List + Default + + + List + Large + Default + + + List + Small + Default + + + New + Default + + + New + Large + Default + + + New + Small + Default + + + SaveEdit + Default + + + SaveEdit + Large + Default + + + SaveEdit + Small + Default + + + Tab + Default + + + Tab + Large + Default + + + Tab + Small + Default + + + View + Default + + + View + Large + Default + + + View + Small + Default + + true + SYSTEM + Deployed + true + true + false + false + false + true + true + true + true + + + + Text + + AccountQuizzes + + ControlledByParent + Vowel + Public + diff --git a/Project 2/force-app/main/default/objects/AccountQuiz__c/fields/Account__c.field-meta.xml b/Project 2/force-app/main/default/objects/AccountQuiz__c/fields/Account__c.field-meta.xml new file mode 100644 index 0000000..a5902a5 --- /dev/null +++ b/Project 2/force-app/main/default/objects/AccountQuiz__c/fields/Account__c.field-meta.xml @@ -0,0 +1,14 @@ + + + Account__c + false + + Account + AccountQuizzes + AccountQuizzes + 0 + false + false + MasterDetail + false + diff --git a/Project 2/force-app/main/default/objects/AccountQuiz__c/fields/Quiz__c.field-meta.xml b/Project 2/force-app/main/default/objects/AccountQuiz__c/fields/Quiz__c.field-meta.xml new file mode 100644 index 0000000..94b8658 --- /dev/null +++ b/Project 2/force-app/main/default/objects/AccountQuiz__c/fields/Quiz__c.field-meta.xml @@ -0,0 +1,14 @@ + + + Quiz__c + false + + Quiz__c + AccountQuizzes + AccountQuizzes + 1 + false + false + MasterDetail + false + diff --git a/Project 2/force-app/main/default/objects/AccountQuiz__c/fields/Score__c.field-meta.xml b/Project 2/force-app/main/default/objects/AccountQuiz__c/fields/Score__c.field-meta.xml new file mode 100644 index 0000000..eba1859 --- /dev/null +++ b/Project 2/force-app/main/default/objects/AccountQuiz__c/fields/Score__c.field-meta.xml @@ -0,0 +1,12 @@ + + + Score__c + 0 + false + + 18 + true + 2 + false + Percent + diff --git a/Project 2/force-app/main/default/objects/AccountQuiz__c/listViews/All.listView-meta.xml b/Project 2/force-app/main/default/objects/AccountQuiz__c/listViews/All.listView-meta.xml new file mode 100644 index 0000000..d505851 --- /dev/null +++ b/Project 2/force-app/main/default/objects/AccountQuiz__c/listViews/All.listView-meta.xml @@ -0,0 +1,6 @@ + + + All + Everything + + diff --git a/Project 2/force-app/main/default/objects/Questions__c/fields/A__c.field-meta.xml b/Project 2/force-app/main/default/objects/Questions__c/fields/A__c.field-meta.xml new file mode 100644 index 0000000..ad19acd --- /dev/null +++ b/Project 2/force-app/main/default/objects/Questions__c/fields/A__c.field-meta.xml @@ -0,0 +1,12 @@ + + + A__c + false + + 100 + false + false + false + Text + false + diff --git a/Project 2/force-app/main/default/objects/Questions__c/fields/B__c.field-meta.xml b/Project 2/force-app/main/default/objects/Questions__c/fields/B__c.field-meta.xml new file mode 100644 index 0000000..5cea954 --- /dev/null +++ b/Project 2/force-app/main/default/objects/Questions__c/fields/B__c.field-meta.xml @@ -0,0 +1,12 @@ + + + B__c + false + + 100 + false + false + false + Text + false + diff --git a/Project 2/force-app/main/default/objects/Questions__c/fields/C__c.field-meta.xml b/Project 2/force-app/main/default/objects/Questions__c/fields/C__c.field-meta.xml new file mode 100644 index 0000000..38a57ab --- /dev/null +++ b/Project 2/force-app/main/default/objects/Questions__c/fields/C__c.field-meta.xml @@ -0,0 +1,12 @@ + + + C__c + false + + 100 + false + false + false + Text + false + diff --git a/Project 2/force-app/main/default/objects/Questions__c/fields/CorrectAnswer__c.field-meta.xml b/Project 2/force-app/main/default/objects/Questions__c/fields/CorrectAnswer__c.field-meta.xml new file mode 100644 index 0000000..b376153 --- /dev/null +++ b/Project 2/force-app/main/default/objects/Questions__c/fields/CorrectAnswer__c.field-meta.xml @@ -0,0 +1,35 @@ + + + CorrectAnswer__c + false + + false + false + false + Picklist + + + false + + A + false + + + + B + false + + + + C + false + + + + D + false + + + + + diff --git a/Project 2/force-app/main/default/objects/Questions__c/fields/D__c.field-meta.xml b/Project 2/force-app/main/default/objects/Questions__c/fields/D__c.field-meta.xml new file mode 100644 index 0000000..4db7f16 --- /dev/null +++ b/Project 2/force-app/main/default/objects/Questions__c/fields/D__c.field-meta.xml @@ -0,0 +1,12 @@ + + + D__c + false + + 100 + false + false + false + Text + false + diff --git a/Project 2/force-app/main/default/objects/Questions__c/fields/Right_Answer__c.field-meta.xml b/Project 2/force-app/main/default/objects/Questions__c/fields/Right_Answer__c.field-meta.xml new file mode 100644 index 0000000..13a2069 --- /dev/null +++ b/Project 2/force-app/main/default/objects/Questions__c/fields/Right_Answer__c.field-meta.xml @@ -0,0 +1,12 @@ + + + Right_Answer__c + false + + 255 + true + false + false + Text + false + diff --git a/Project 2/force-app/main/default/objects/Questions__c/fields/Wrong_Answer_1__c.field-meta.xml b/Project 2/force-app/main/default/objects/Questions__c/fields/Wrong_Answer_1__c.field-meta.xml new file mode 100644 index 0000000..be43cbb --- /dev/null +++ b/Project 2/force-app/main/default/objects/Questions__c/fields/Wrong_Answer_1__c.field-meta.xml @@ -0,0 +1,12 @@ + + + Wrong_Answer_1__c + false + + 255 + false + false + false + Text + false + diff --git a/Project 2/force-app/main/default/objects/Questions__c/fields/Wrong_Answer_2__c.field-meta.xml b/Project 2/force-app/main/default/objects/Questions__c/fields/Wrong_Answer_2__c.field-meta.xml new file mode 100644 index 0000000..a333823 --- /dev/null +++ b/Project 2/force-app/main/default/objects/Questions__c/fields/Wrong_Answer_2__c.field-meta.xml @@ -0,0 +1,12 @@ + + + Wrong_Answer_2__c + false + + 255 + false + false + false + Text + false + diff --git a/Project 2/force-app/main/default/objects/Questions__c/fields/Wrong_Answer_3__c.field-meta.xml b/Project 2/force-app/main/default/objects/Questions__c/fields/Wrong_Answer_3__c.field-meta.xml new file mode 100644 index 0000000..624cbe3 --- /dev/null +++ b/Project 2/force-app/main/default/objects/Questions__c/fields/Wrong_Answer_3__c.field-meta.xml @@ -0,0 +1,12 @@ + + + Wrong_Answer_3__c + false + + 255 + false + false + false + Text + false + diff --git a/Project 2/force-app/main/default/objects/Questions__c/validationRules/Capital_first.validationRule-meta.xml b/Project 2/force-app/main/default/objects/Questions__c/validationRules/Capital_first.validationRule-meta.xml new file mode 100644 index 0000000..dbe7ed3 --- /dev/null +++ b/Project 2/force-app/main/default/objects/Questions__c/validationRules/Capital_first.validationRule-meta.xml @@ -0,0 +1,7 @@ + + + Capital_first + true + LEFT(UPPER( Name ),1) <> LEFT( Name ,1) + First letter not capitalized + diff --git a/Project 2/force-app/main/default/objects/Questions__c/validationRules/Question_Name_Validation.validationRule-meta.xml b/Project 2/force-app/main/default/objects/Questions__c/validationRules/Question_Name_Validation.validationRule-meta.xml index 44b7d1b..0e3503f 100644 --- a/Project 2/force-app/main/default/objects/Questions__c/validationRules/Question_Name_Validation.validationRule-meta.xml +++ b/Project 2/force-app/main/default/objects/Questions__c/validationRules/Question_Name_Validation.validationRule-meta.xml @@ -1,7 +1,7 @@ Question_Name_Validation - true + false NOT(REGEX(Name, "[A-Z]{1}[a-z]{4,200}")) Name The question must begin with a capital letter and also must be between 5 characters and 200 characters. diff --git a/Project 2/force-app/main/default/objects/Quiz__c/fields/Attempts_Made__c.field-meta.xml b/Project 2/force-app/main/default/objects/Quiz__c/fields/Attempts_Made__c.field-meta.xml new file mode 100644 index 0000000..d74b6f8 --- /dev/null +++ b/Project 2/force-app/main/default/objects/Quiz__c/fields/Attempts_Made__c.field-meta.xml @@ -0,0 +1,16 @@ + + + Attempts_Made__c + false + + + AccountQuiz__c.Score__c + greaterThan + 0 + + AccountQuiz__c.Quiz__c + count + false + false + Summary + diff --git a/Project 2/force-app/main/default/objects/Quiz__c/fields/Avg_Score__c.field-meta.xml b/Project 2/force-app/main/default/objects/Quiz__c/fields/Avg_Score__c.field-meta.xml new file mode 100644 index 0000000..0989828 --- /dev/null +++ b/Project 2/force-app/main/default/objects/Quiz__c/fields/Avg_Score__c.field-meta.xml @@ -0,0 +1,15 @@ + + + Avg_Score__c + false + IF( Attempts_Made__c >0, TotalScore__c / Attempts_Made__c, 0) + BlankAsZero + + 18 + false + 2 + false + false + Number + false + diff --git a/Project 2/force-app/main/default/objects/Quiz__c/fields/TotalScore__c.field-meta.xml b/Project 2/force-app/main/default/objects/Quiz__c/fields/TotalScore__c.field-meta.xml new file mode 100644 index 0000000..454a143 --- /dev/null +++ b/Project 2/force-app/main/default/objects/Quiz__c/fields/TotalScore__c.field-meta.xml @@ -0,0 +1,12 @@ + + + TotalScore__c + false + + AccountQuiz__c.Score__c + AccountQuiz__c.Quiz__c + sum + false + false + Summary + diff --git a/Project 2/force-app/main/default/objects/Quiz__c/validationRules/First_Capital.validationRule-meta.xml b/Project 2/force-app/main/default/objects/Quiz__c/validationRules/First_Capital.validationRule-meta.xml new file mode 100644 index 0000000..6bc2e0b --- /dev/null +++ b/Project 2/force-app/main/default/objects/Quiz__c/validationRules/First_Capital.validationRule-meta.xml @@ -0,0 +1,7 @@ + + + First_Capital + true + LEFT(UPPER( Name ),1) <> LEFT( Name ,1) + First letter not capitalized. + diff --git a/Project 2/force-app/main/default/objects/Quiz__c/validationRules/Quiz_Name_Validation.validationRule-meta.xml b/Project 2/force-app/main/default/objects/Quiz__c/validationRules/Quiz_Name_Validation.validationRule-meta.xml index e46aa1b..304f478 100644 --- a/Project 2/force-app/main/default/objects/Quiz__c/validationRules/Quiz_Name_Validation.validationRule-meta.xml +++ b/Project 2/force-app/main/default/objects/Quiz__c/validationRules/Quiz_Name_Validation.validationRule-meta.xml @@ -1,7 +1,7 @@ Quiz_Name_Validation - true + false NOT(REGEX(Name, "[A-Z]{1}[a-z]{4,50}")) Name The name of the quiz must start with a capital letter and also must have 5 to 50 characters.; diff --git a/Project 2/force-app/main/default/pages/Leaderboard.page b/Project 2/force-app/main/default/pages/Leaderboard.page index 5edd7c4..ac763a7 100644 --- a/Project 2/force-app/main/default/pages/Leaderboard.page +++ b/Project 2/force-app/main/default/pages/Leaderboard.page @@ -16,6 +16,9 @@

Leaderboard

+ + + diff --git a/Project 2/force-app/main/default/pages/QuizPage.page b/Project 2/force-app/main/default/pages/QuizPage.page index 182a855..82328e4 100644 --- a/Project 2/force-app/main/default/pages/QuizPage.page +++ b/Project 2/force-app/main/default/pages/QuizPage.page @@ -11,11 +11,19 @@ +

Quiz Time

- + + + + + + + + - + - + - + + - - -
- -
+
+ + + +
diff --git a/Project 2/force-app/main/default/profiles/Admin.profile-meta.xml b/Project 2/force-app/main/default/profiles/Admin.profile-meta.xml index cf6fcd6..2607d04 100644 --- a/Project 2/force-app/main/default/profiles/Admin.profile-meta.xml +++ b/Project 2/force-app/main/default/profiles/Admin.profile-meta.xml @@ -4,6 +4,10 @@ LeaderboardController true + + QuestionClass + true + QuizClass true @@ -12,11 +16,24 @@ QuizPageController true + + indiLeadController + true + + + sad + true + sampleCon true false + + false + Account.Points__c + true + true Account.QuizNum__c @@ -27,6 +44,36 @@ Account.Quiz_Average__c true + + true + Account.ranking__c + true + + + true + Questions__c.A__c + true + + + true + Questions__c.B__c + true + + + true + Questions__c.C__c + true + + + true + Questions__c.CorrectAnswer__c + true + + + true + Questions__c.D__c + true + false Questions__c.Private_Answers__c @@ -37,11 +84,36 @@ Questions__c.Success_Rate__c false + + true + Questions__c.Wrong_Answer_1__c + true + + + true + Questions__c.Wrong_Answer_2__c + true + + + true + Questions__c.Wrong_Answer_3__c + true + true Quiz__c.Account__c true + + false + Quiz__c.Attempts_Made__c + false + + + false + Quiz__c.Avg_Score__c + false + false Quiz__c.Questions__c @@ -52,12 +124,29 @@ Quiz__c.Score__c true + + false + Quiz__c.TotalScore__c + false + Account-Account Layout + + Questions__c-Questions Layout + Quiz__c-Quiz Layout + + true + true + true + true + true + AccountQuiz__c + true + true true @@ -92,6 +181,18 @@ testPage true + + AccountQuiz__c + DefaultOn + + + Questions__c + DefaultOn + + + Quiz__c + DefaultOn + Salesforce true @@ -229,10 +330,6 @@ true CreateTopics - - true - CreateWorkBadgeDefinition - true CreateWorkspaces @@ -341,10 +438,6 @@ true ExportReport - - true - FieldServiceAccess - true GiveRecognitionBadge @@ -609,10 +702,6 @@ true SelectFilesFromSalesforce - - true - SendExternalEmailAvailable - true SendSitRequests diff --git a/Project 2/force-app/main/default/profiles/Custom%3A Marketing Profile.profile-meta.xml b/Project 2/force-app/main/default/profiles/Custom%3A Marketing Profile.profile-meta.xml index 93ceb98..ce3318a 100644 --- a/Project 2/force-app/main/default/profiles/Custom%3A Marketing Profile.profile-meta.xml +++ b/Project 2/force-app/main/default/profiles/Custom%3A Marketing Profile.profile-meta.xml @@ -4,6 +4,10 @@ LeaderboardController false + + QuestionClass + false + QuizClass false @@ -12,11 +16,24 @@ QuizPageController false + + indiLeadController + false + + + sad + false + sampleCon false true + + false + Account.Points__c + true + true Account.QuizNum__c @@ -27,6 +44,36 @@ Account.Quiz_Average__c true + + true + Account.ranking__c + true + + + true + Questions__c.A__c + true + + + true + Questions__c.B__c + true + + + true + Questions__c.C__c + true + + + true + Questions__c.CorrectAnswer__c + true + + + true + Questions__c.D__c + true + false Questions__c.Private_Answers__c @@ -37,11 +84,36 @@ Questions__c.Success_Rate__c false + + true + Questions__c.Wrong_Answer_1__c + true + + + true + Questions__c.Wrong_Answer_2__c + true + + + true + Questions__c.Wrong_Answer_3__c + true + true Quiz__c.Account__c true + + false + Quiz__c.Attempts_Made__c + false + + + false + Quiz__c.Avg_Score__c + false + false Quiz__c.Questions__c @@ -52,9 +124,17 @@ Quiz__c.Score__c true + + false + Quiz__c.TotalScore__c + false + Account-Account %28Marketing%29 Layout + + Questions__c-Questions Layout + Quiz__c-Quiz Layout @@ -74,6 +154,18 @@ testPage false + + AccountQuiz__c + DefaultOn + + + Questions__c + DefaultOn + + + Quiz__c + DefaultOn + Salesforce true diff --git a/Project 2/force-app/main/default/profiles/Custom%3A Sales Profile.profile-meta.xml b/Project 2/force-app/main/default/profiles/Custom%3A Sales Profile.profile-meta.xml index 148029a..b55efa4 100644 --- a/Project 2/force-app/main/default/profiles/Custom%3A Sales Profile.profile-meta.xml +++ b/Project 2/force-app/main/default/profiles/Custom%3A Sales Profile.profile-meta.xml @@ -4,6 +4,10 @@ LeaderboardController false + + QuestionClass + false + QuizClass false @@ -12,11 +16,24 @@ QuizPageController false + + indiLeadController + false + + + sad + false + sampleCon false true + + false + Account.Points__c + true + true Account.QuizNum__c @@ -27,6 +44,36 @@ Account.Quiz_Average__c true + + true + Account.ranking__c + true + + + true + Questions__c.A__c + true + + + true + Questions__c.B__c + true + + + true + Questions__c.C__c + true + + + true + Questions__c.CorrectAnswer__c + true + + + true + Questions__c.D__c + true + false Questions__c.Private_Answers__c @@ -37,11 +84,36 @@ Questions__c.Success_Rate__c false + + true + Questions__c.Wrong_Answer_1__c + true + + + true + Questions__c.Wrong_Answer_2__c + true + + + true + Questions__c.Wrong_Answer_3__c + true + true Quiz__c.Account__c true + + false + Quiz__c.Attempts_Made__c + false + + + false + Quiz__c.Avg_Score__c + false + false Quiz__c.Questions__c @@ -52,9 +124,17 @@ Quiz__c.Score__c true + + false + Quiz__c.TotalScore__c + false + Account-Account %28Sales%29 Layout + + Questions__c-Questions Layout + Quiz__c-Quiz Layout @@ -74,6 +154,18 @@ testPage false + + AccountQuiz__c + DefaultOn + + + Questions__c + DefaultOn + + + Quiz__c + DefaultOn + Salesforce true diff --git a/Project 2/force-app/main/default/profiles/Custom%3A Support Profile.profile-meta.xml b/Project 2/force-app/main/default/profiles/Custom%3A Support Profile.profile-meta.xml index d44c922..e3a1410 100644 --- a/Project 2/force-app/main/default/profiles/Custom%3A Support Profile.profile-meta.xml +++ b/Project 2/force-app/main/default/profiles/Custom%3A Support Profile.profile-meta.xml @@ -4,6 +4,10 @@ LeaderboardController false + + QuestionClass + false + QuizClass false @@ -12,11 +16,24 @@ QuizPageController false + + indiLeadController + false + + + sad + false + sampleCon false true + + false + Account.Points__c + true + true Account.QuizNum__c @@ -27,6 +44,36 @@ Account.Quiz_Average__c true + + true + Account.ranking__c + true + + + true + Questions__c.A__c + true + + + true + Questions__c.B__c + true + + + true + Questions__c.C__c + true + + + true + Questions__c.CorrectAnswer__c + true + + + true + Questions__c.D__c + true + false Questions__c.Private_Answers__c @@ -37,11 +84,36 @@ Questions__c.Success_Rate__c false + + true + Questions__c.Wrong_Answer_1__c + true + + + true + Questions__c.Wrong_Answer_2__c + true + + + true + Questions__c.Wrong_Answer_3__c + true + true Quiz__c.Account__c true + + false + Quiz__c.Attempts_Made__c + false + + + false + Quiz__c.Avg_Score__c + false + false Quiz__c.Questions__c @@ -52,9 +124,17 @@ Quiz__c.Score__c true + + false + Quiz__c.TotalScore__c + false + Account-Account %28Support%29 Layout + + Questions__c-Questions Layout + Quiz__c-Quiz Layout @@ -74,6 +154,18 @@ testPage false + + AccountQuiz__c + DefaultOn + + + Questions__c + DefaultOn + + + Quiz__c + DefaultOn + Salesforce true diff --git a/Project 2/force-app/main/default/tabs/AccountQuiz__c.tab-meta.xml b/Project 2/force-app/main/default/tabs/AccountQuiz__c.tab-meta.xml new file mode 100644 index 0000000..90a3436 --- /dev/null +++ b/Project 2/force-app/main/default/tabs/AccountQuiz__c.tab-meta.xml @@ -0,0 +1,5 @@ + + + true + Custom73: Highway Sign + diff --git a/Project 2/force-app/main/default/tabs/Questions__c.tab-meta.xml b/Project 2/force-app/main/default/tabs/Questions__c.tab-meta.xml new file mode 100644 index 0000000..3178e15 --- /dev/null +++ b/Project 2/force-app/main/default/tabs/Questions__c.tab-meta.xml @@ -0,0 +1,5 @@ + + + true + Custom43: Jewel + diff --git a/Project 2/force-app/main/default/tabs/Quiz__c.tab-meta.xml b/Project 2/force-app/main/default/tabs/Quiz__c.tab-meta.xml new file mode 100644 index 0000000..9cd9fba --- /dev/null +++ b/Project 2/force-app/main/default/tabs/Quiz__c.tab-meta.xml @@ -0,0 +1,5 @@ + + + true + Custom70: Handsaw + diff --git a/Project 2/manifest/package.xml b/Project 2/manifest/package.xml index d8fbcbb..f0fe203 100644 --- a/Project 2/manifest/package.xml +++ b/Project 2/manifest/package.xml @@ -1,3 +1,4 @@ + @@ -36,9 +37,28 @@ * CustomObject - + + Account.AvgScore__c + Account.TotalScore__c + Account.Ranking__c + Account.NumQuizzes__c + CustomField + + + * + StaticResource + + + * + Layout + + * - Flow - + CustomTab + + + * + Profile + 46.0 \ No newline at end of file