Skip to content

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

Merged
merged 29 commits into from
Apr 19, 2016

Conversation

NicolaasDieBaas
Copy link
Contributor

No description provided.

@NicolaasDieBaas NicolaasDieBaas self-assigned this Apr 18, 2016
@NicolaasDieBaas
Copy link
Contributor Author

@imsickofmaps please review

});
},

get_quiz: function(im) {
Copy link
Member

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)
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please

Copy link
Contributor Author

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
}
)

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@NicolaasDieBaas
Copy link
Contributor Author

@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": {
Copy link
Member

@imsickofmaps imsickofmaps Apr 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this hub

@imsickofmaps
Copy link
Member

@NicolaasDieBaas pass complete. One more round, then we'll land and continue to evolve in next issues.

@NicolaasDieBaas
Copy link
Contributor Author

@imsickofmaps one more please

api_token: 'test_token_identities',
url: "http://localhost:8001/api/v1/"
},
registrations: {
"registrations": {
Copy link
Member

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).

Copy link
Contributor Author

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

@imsickofmaps
Copy link
Member

imsickofmaps commented Apr 19, 2016

Last tweak then land 👍

@NicolaasDieBaas NicolaasDieBaas merged commit e035312 into develop Apr 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants