Skip to content

Commit

Permalink
Merge pull request #1450 from mumuki/feature-userless-mode
Browse files Browse the repository at this point in the history
Feature incognito mode
  • Loading branch information
flbulgarelli authored Aug 14, 2020
2 parents 727f0cb + ae9716e commit c2d54b0
Show file tree
Hide file tree
Showing 39 changed files with 1,253 additions and 417 deletions.
21 changes: 21 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "eslint:recommended",
"env": {
"browser": true,
"es6": true,
"mocha": true
},
"globals": {
"$": "readonly",
"CodeMirror": "readonly",
"expect": "readonly",
"ga": "readonly",
"moment": "readonly",
"mumuki": "writable",
"muvment": "readonly",
"NProgress": "readonly"
},
"rules": {
"no-unused-vars": [2, {"argsIgnorePattern": "^_"}]
}
}
277 changes: 0 additions & 277 deletions .eslintrc.yml

This file was deleted.

2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ group :development, :test do
gem 'teaspoon-jasmine'
gem "selenium-webdriver"
end

gem 'mumuki-domain', github: 'mumuki/mumuki-domain', branch: 'master'
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ bundle exec rspec
MOZ_HEADLESS=1 bundle exec rake teaspoon
```

## Running `eslint`

```bash
yarn run lint
```

## JavaScript API Docs

In order to be customized by runners, Laboratory exposes the following selectors and methods
Expand Down Expand Up @@ -208,6 +214,8 @@ which are granted to be safe and stable.
* `SpeechBubbleRenderer`
* `renderSpeechBubbleResultItem`
* `mumuki.locale`
* `mumuki.currentExerciseId`: the `id` of the currently loaded exercise, if any
* `mumuki.incognitoUser`: whether the current user is an incognito user
* `mumuki.MultipleScenarios`
* `scenarios`
* `currentScenarioIndex`
Expand Down Expand Up @@ -369,14 +377,14 @@ contents. There are two different approaches:

```javascript
// simplest method - you can register just one
mumuki.submission.registerContentSyncer(() => {
mumuki.editors.registerContentSyncer(() => {
// ... write here your custom component content...
$('#mu-custom-editor-value').val(/* ... */);
});

// alternate method
// you can register many sources
mumuki.CustomEditor.addSource({
mumuki.editors.addCustomSource({
getContent() {
return { name: "solution[content]", value: /* ... */ } ;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ mumuki.bridge = (() => {
* @returns {JQuery.Promise<SubmissionResult>}
*/
_submitSolution(submission) {
const lastSubmission = mumuki.SubmissionsStore.getCachedResultFor(mumuki.currentExerciseId, submission);
const lastSubmission = mumuki.SubmissionsStore.getSubmissionResultFor(mumuki.currentExerciseId, submission);
if (lastSubmission) {
return $.Deferred().resolve(lastSubmission);
} else {
return this._sendNewSolution(submission).done((result) => {
mumuki.SubmissionsStore.setLastSubmission(mumuki.currentExerciseId, {submission, result});
mumuki.SubmissionsStore.setSubmissionResultFor(mumuki.currentExerciseId, {submission, result});
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
createEditor(customOptions) {
return CodeMirror.fromTextArea(this.textarea, Object.assign({}, codeMirrorDefaults, customOptions));
}
};
}

mumuki.editor = mumuki.editor || {};
mumuki.editor.CodeMirrorBuilder = CodeMirrorBuilder;
Expand Down
Loading

0 comments on commit c2d54b0

Please sign in to comment.