family: Randomise levels for family_find_relatives

Authored by rudranilbasu on Jul 23 2017, 7:29 AM.

Description

family: Randomise levels for family_find_relatives

The levels for the family_find_relatives activity is shuffled to
increase the randomness of the levels in the activity. Initially, the
shuffledLevelIndex[] contains values from 0 to numberOfLevels - 1, which
is later shuffled using the shuffle() function. Everytime the activity
starts, the levels are arranged in a new order

Since the levels are shuffled, the question label cannot be obtained
using dataset.levelElements[bar.level - 1].answer[0] anymore, which is
now obtained via the js

Signed-off-by: Rudra Nil Basu <rudra.nil.basu.1996@gmail.com>

Details

Committed
rudranilbasuJul 23 2017, 7:29 AM
Parents
R2:4a1b75809b36: family: Delete unnecessary variables and files
Branches
Unknown
Tags
Unknown
Restricted Application added a subscriber: jjazeix. ยท View Herald TranscriptJul 23 2017, 7:45 AM
jjazeix added inline comments.Jul 30 2017, 1:27 PM
/src/activities/family/family.js
115

I would put this condition outside the call to not call the function in normal mode

124

There is a Core.shuffle(array)

rudranilbasu marked 2 inline comments as done.Jul 30 2017, 8:41 PM