...
Code Block |
---|
"questionSet": { "timeLimits": "{\"maxTime\":\"3600\"}", "questionSetToken": "", //#Question Set Digesttoken to be generated at hierarchy read API with combination of "Question Set ID + userID" "evaluable": true //#true for Server Side Valuation Default:#false for client side validation } |
...
Code Block |
---|
{ "request": { "userId": "843a9940-720f-43ed-a415-26bbfd3da9ef", "questionSetDigestquestionSetToken": "", "assessments":[ { "assessmentTs": 1681284869464, "batchId": "0132677340746629120", "collectionId": "do_213267731619962880127", "userId": "843a9940-720f-43ed-a415-26bbfd3da9ef", "attemptId": "5486724f41afb4997118e6d97695684f", "contentId": "do_2129959063404544001107" }, "events":[], responses:[{ "identifier":"<question-id>", "questionType": "", "userResponse":[""], "responseDeclaration": {}, "responseKey":["<response-key>"] }] }], "contents": [ { "contentId": "do_2132671468826214401203", "batchId": "0132677340746629120", "status": 2, "courseId": "do_213267731619962880127", "lastAccessTime": "2023-04-12 12:56:45:687+0530" }, ] } } |
...
In order to check for validity of Question inside a QuestionSet. Design proposes the value to be encrypted based on QuestionID List in hierarchy and persist this information against QuestionSetDigest QuestionSetToken in Redis.
Code Block | ||||
---|---|---|---|---|
| ||||
console.time("dbsave"); var crypto = require('crypto'); var encryptList = []; var string = "sdgxsoksgdaodjqwdhuwdh"; var count = 0; var salt = "salty"; for(var i=0;i<1000000;i++) { var encrypt = crypto.pbkdf2('secret'+i, salt, 10, 64, 'sha512', (err, derivedKey) => { if (err) throw err; }); encryptList.push(encrypt); if(string === encrypt) { count++; } } console.log(count); console.log(encryptList.length); console.timeEnd("dbsave"); |
...