-
Notifications
You must be signed in to change notification settings - Fork 0
Add USSD quiz functionality #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add USSD quiz functionality #3
Conversation
…of random quizzes/questions
…ly updating untaken quizzes
@imsickofmaps please review |
}); | ||
}, | ||
|
||
get_quiz: function(im) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please can we make the quiz uuid what is passed through here as it's more explicit
.get_quiz(self.im, quiz_id) | ||
.then(function(quiz) { | ||
// creates a random line-up of questions | ||
var random_questions = go.utils_project.to_randomize_questions(self.im) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we simplify this to just check im.config.randomize_questions
directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could. I assume this should be done for im.config.randomize_quizzes then too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might been cleaner to keep it in a utils function as I realized that we're assuming the config variables randomize_quizzes and randomize_questions actually exist... with this in mind should I go ahead doing the check directly or keep them in utils? (the check in utils will look like this; a bit different if extracted:
if (im.config.randomize_quizzes !== null) {
return im.config.randomize_quizzes;
} else {
return true; // default behaviour is to randomize
}
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assuming they exist is fine. Having Required Configuration is a justifiable expectation. Reminds me, please add example one to a config
folder same as other projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@imsickofmaps please review the changes made. get_quiz_question function hasn't been adapted |
"api_token": "uuid", | ||
"url": "http://identity-store.example.org/api/v1/" | ||
}, | ||
"registrations": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make this hub
@NicolaasDieBaas pass complete. One more round, then we'll land and continue to evolve in next issues. |
@imsickofmaps one more please |
api_token: 'test_token_identities', | ||
url: "http://localhost:8001/api/v1/" | ||
}, | ||
registrations: { | ||
"registrations": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last little one. Make this hub
and the places that it affects (from previous issues).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i'll do it. it does mean that i can't call utils.create_registration as it is. I could adapt to pass in service name or add a similar function to utils_project. Think I'll go for latter
Last tweak then land 👍 |
No description provided.