+ Start a Discussion
charan@appcharan@app 

Developing Online Exam

I am trying to develop an online exam.

 

I was successful in keeping all the questions and writing class for them.

It works fine, but I need some questions which should be randomly picked from object.

Every time these questions should be different.

How can we achieve randomly ques from db?

 

Help me out at earliest.

NaishadhNaishadh

You can use math.random for fetching questions.

WesNolte__cWesNolte__c

Hey,

 

List<Question__c> questions = [SELECT id, name, body FROM Question__c];

LIst<Question__c> chosenQuestions = new List<Question__c>();

Integer listSize = questions.size();

 

for(Integer i = 0; i< 10; i++){

  Integer index = Math.random * listSize;

  chosenQuestions.add(questions[index]);

}

 

This isn't perfect, you could add the same question more than once for example, but it will get you started.

 

Wes

chowdary marellachowdary marella

iam using the following but getting repeated,can you please suggest?

 

Integer rand = Math.floor(Math.random()*14).intValue();


quess = new list<Questions__c>();
if(!i.contains(rand)){
quess = [SELECT Name FROM Questions__c limit 1 OFFSET :rand];
}
i.add(rand);
System.debug('@@@@Account@@@@@'+quess);

venkateshyadav1243venkateshyadav1243

Hi Charn am also developing the online exam using apex,visualforce.

 

can please tel me design and if u code can u please send me

 

 

Thanks,

venkatesh.

rajesh mummadirajesh mummadi

hello i also had a task for developing the online exam using apex,visualforce...please can any one send the source code for this.

 

 

thank you

rajesh(tcs)

Jeniffer CullenJeniffer Cullen
Prepare for Salesforce Certification  from website : https://www.ebsose.com. Available 24*7 Support . Immediate Delivery. 
Project support and Salesforce training is also provided for Admin , Development , Integration , CPQ and QA at www.ebsose.com . 
For all latest salesforce certification SU20 materials mail us at ebsosedotcom@gmail.com
If you need help on any superbadge or salesforce certification mail us at ebsosedotcom@gmail.com
Summer 20 Dumps all Available
We have Following latest certification of 
0. B2B Commerce Admin
1. Admin 201
2. App Builder
3. Platform developer 1
4. Platform Developer 2
5. Sales Cloud
6. Service Cloud
7. Community Cloud
8. Marketing cloud Email Specialist
9. Marketing cloud Cloud Consultant
10. CPQ
11. FSL
12. Data Management Architecture
13. Integration architecture
14. Identity Access management
15. Development Lifecycle
16. Pardot Specialist
17. Advance Admin
18. Sharing Visibilty Designer 
19. Einstein Analytics
20. Non- Profit Cloud
21. Marketing cloud developer 1
 
Luther waltonLuther walton
Now Salesforce All latest Updated every week dumps available at https://www.allrecentdumps.com
For all latest salesforce certification dumps mail us at allrecentdumps@gmail.com
If you need help on any superbadge or salesforce certification mail us at allrecentdumps@gmail.com
24*7 AND IMMEDIATE DELIVERY OF DUMPS.
All Summer 20 Dumps are available. We have Following latest certification of 
•    Copado Admin
•    Copado Developer
•    Vlocity Platform Essential
•    B2B Commerce Admin    
•    Javascript Developer 1 Dumps
•    Admin 201
•    App Builder
•    Platform developer 1
•    Platform Developer 2
•    Sales Cloud
•    Service Cloud
•    Community Cloud
•    Marketing cloud Email Specialist
•    Marketing cloud Cloud Consultant
•    Marketing Cloud Admin
•    Marketing Cloud Developer
•    CPQ Specialist
•    Field Service Lightning
•    Data Management Architecture
•    Integration architecture
•    Identity Access management
•    Development Lifecycle
•    Pardot Specialist
•    Advance Admin
•    Sharing Visibilty Designer 
•    Einstein Analytics
 
Thomas JohThomas Joh
You can contact me for any help and exact questions and answers for ALL the latest Winter 21 certifications at salesforcecertguide2018[at]gmail.com. 100% pass rate. All exact screenshots and 100% accuracy. Trusted by ALL for passing all their exams. We offer one to one guidance as well.
Sundar Kanna 7Sundar Kanna 7
Please contact me for  Latest dumps SU'21 passed by lots users. The dumps updated by just a week before. And, It's very accurate questions with verified answes. I have Admin 201, Platform Developer 1 and App Builder SU'21 edition with exact screenshot dumps. You can mail me at anytime - sundar.kanna119@gmail.com
Sundar Kanna 7Sundar Kanna 7
I have the accurate dumps for SFDC Salesforce Admin (ADM201), Adv.Admin (ADM211), Platform Developer I (CRT450), Sales Cloud Consultant (CRT251), Service Cloud Consultant (CRT261), Platform App Builder (CRT403) for WI'22. It's contains exact questions and verified answers. If anyone looking for the same WINTER'2022, pls mail me at - sundar.kanna119@gmail.com
Sundar Kanna 7Sundar Kanna 7
I have the SFDC latest and verified dumps for Salesforce Administrator (ADM 201), Advanced Administrator (ADM 211), Platform Developer 1 (CRT 450), Platform App Builder (403), SalesCloud Consultant (CRT-251) and ServiceCloud Consultant (CRT-261) SU'22. Many of them cleared their first shot. 200% assured & accuracy. If anyone interested, mail me at - sundar.kanna119@gmail.com