drill2 icon indicating copy to clipboard operation
drill2 copied to clipboard

Integrate questions with a route

Open dimidd opened this issue 9 years ago • 1 comments

Hi,

Is it possible to preload the questions file in a certain route, so the user won't have to bother with selecting the questions manually? e.g. example.com/spanish-quiz would display the first question of spanish-quiz.txt

dimidd avatar May 31 '15 07:05 dimidd

Hi.

As for now, question files have to be selected by user because they are always loaded from his computer. Security policies of browsers don't allow reading arbitrary files from the filesystem, they have to be selected manually. You could circumvent that by serving question files along with the app or by using HTML5 localStorage, but none of these is currently implemented and I don't think I will be adding such feature anytime soon.

If you need it, I believe you could add it relatively easily. $scope.loadQuestions() will load questions from $scope.dataString. You could choose appropriate question bank based on URL hash which you can get with the $location service.

gronostajo avatar May 31 '15 22:05 gronostajo