Skip to content

Offline evaluation support#1434

Draft
flbulgarelli wants to merge 20 commits into
masterfrom
cumparsita
Draft

Offline evaluation support#1434
flbulgarelli wants to merge 20 commits into
masterfrom
cumparsita

Conversation

@flbulgarelli

@flbulgarelli flbulgarelli commented Jul 23, 2020

Copy link
Copy Markdown
Member

This draft is just a notebook, based on an old unmerged feature of offline suppport.

It contains comments and references to the actual PRs that merge this behaviour:

See:

Comment thread Gemfile
gem 'puma'

gem 'mumuki-domain', github: 'mumuki/mumuki-domain'
gem 'mumuki-domain', github: 'mumuki/mumuki-domain', branch: 'feature-cumparsita'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This line only adds offline tests. We should merge them instead

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Local evaluation

Comment thread Gemfile

gem 'mumuki-domain', github: 'mumuki/mumuki-domain'
gem 'mumuki-domain', github: 'mumuki/mumuki-domain', branch: 'feature-cumparsita'
gem 'mulangjs', path: '../mulang/ghcjslib/gem'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not necessary in the first iteration

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Local evaluation

Comment thread README.md
* `setUpDeleteFile`
* `updateButtonsVisibility`
* `mumuki.registerLocalTestRunner`
* `mumuki.registerLocalExpectationsRunner`

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

OK. Perhaps could be namespaced into mumuki.local

This steps may not always be necessary for local evaluation. They should be documented

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Local evaluation

Comment thread README.md
"status": "failed",
"guide_finished_by_solution": false,
"class_for_progress_list_item":"progress-list-item text-center danger active",
"html":"...",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Although this is not strictly necessary for a first iteration, it has a lot of sense

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Pre rendering

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done here: #1435

//= require webcomponents-lite
//= require mulang
//= require rails-ujs
//= require turbolinks

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Rollback

data: solution
});
return $.ajax(request);
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Local evaluation + local progress + local sync

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done in #1443

result.html = result.html || mumuki.renderCorollaryHtml(status, exercise);
} catch (e) {
console.log(`[Mumuki::Laboratory::Bridge] pre-rendering failed ${e}`);
throw e;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Pre rendering

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done in #1435

editor.getDoc().setValue(content);
});
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

???

xhrFields: {withCredentials: true},
success: function(data){
mumuki.updateProgressBarAndShowModal(data);
mumuki.updateCurrentExerciseProgressBarAndShowModal(data);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Rollback. Heavily backward incompatible

Comment thread app/assets/javascripts/mumuki_laboratory/application/connection.js
Laboratory.prototype = {

(() => {
class Laboratory {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done #1443

mumuki.load(() => {
// Set global currentExerciseId
const $muExerciseId = $('#mu-exercise-id')[0];
const $muExerciseResource = $('#mu-exercise-resource')[0];

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Partially done in #1443

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.

1 participant