Skip to content
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

Feature incognito mode #1450

Merged
merged 20 commits into from
Aug 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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