-
Notifications
You must be signed in to change notification settings - Fork 15
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
[Share] Added possibility to share projects to S3 #77
base: master
Are you sure you want to change the base?
Conversation
Quickpi scrollbar fix
… available in 1280x720 resolution
…registered the onlick only when not in fullscreen
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.
A few comments already ; I haven't tested the full process yet so there will probably be other comments to come.
var answerType = that.blocklyHelper.isBlockly ? "blockly" : "python"; | ||
|
||
// TODO: change with "prod" url | ||
var url = "file:///home/nicolas/stage/test/v01/QuickPi/dynamicTestbed/testbed/index.html"; |
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's not very generic to have an URL, specific to quick-pi, in interface-mobileFirst. As this system could be used with multiple tasks, there should be a mechanism for the task to give the URL for sharing.
|
||
// We retrieve the saved answer of the user. | ||
// with this method, we can get the updated answer (after save) for all the levels. | ||
answer: that.subtask.getAnswerObject() |
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.
If we're going to share the answer, the user should be asked whether they want to share their answer or not. If I create my own task for others to try solving it, I don't want them to get my answer as well, or it would miss the point. On the other side, indeed, there are cases in which we'd want to share the program as well. Hence it's better to ask the user about their intent.
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.
For now on, it is just sharing of testbed subjects to S3.
Later on, this feature will evolve in something that can share exercise. But in case of a project, the code should allways be shared.
mainTask.loadLevel(state.level, null, views); | ||
if(levels) { | ||
displayHelper.setupLevels(defaultLevel, reloadWithCallbacks, levels); | ||
} | ||
if (answer) { | ||
mainTask.reloadAnswerObject(answer) |
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.
These modifications don't have anything to do in a common file used by lots of tasks, many which aren't using quickAlgo. It's really best to avoid modifying files which are outside the scope of your project, when you don't know whether it could break completely unrelated tasks.
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.
Unfortunately, I didn't found any better place to do this, maybe you know where it could be put? And normally nothing should happens if answer is null which is the case in 99% of cases.
The only case it could break is if mainTask is null I don't know if it happens in a weird subject.
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 should be put after loading the data from the remote task. Where are you setting mainTask.answer ? You should reload the answer from there instead.
nothing should happens if answer is null which is the case in 99% of cases
Are you sure of that? I'm pretty sure you haven't checked all the Bebras tasks :)
This pull request's aim is to be able to click on a share button in order to share your project to S3, then we get an url and we can post this URL anywhere we want.
How to use?
You need to download the node server at Task Store
Once you have it, download requirements, you need to specify the S3 identifiers in .aws/credentials then run:
node app.js
Once you have done it, you need to find two folders from the SVN:
v01/QuickPi/nicolas/testbed_share for share the exercise
v01/QuickPi/nicolas/testbed_load for load the exercise
Once you found these files, you need to open the index.html from testbed_load. Copy the url of the file and paste it in the file
interface-mobileFirst (around lign 373), to change the url.
Once you have finish setting up everything, run the index.html of testbed_share, and in the menu you can click on the share button, it will give you the share url that you can copy in order to open your exercise but from S3.
In production:
Once in production, there are some things that we must setup: