Skip to content
This repository has been archived by the owner on May 3, 2023. It is now read-only.

Commit

Permalink
Support numeric sequence w/o predefined graph pane
Browse files Browse the repository at this point in the history
[#53396591]
  • Loading branch information
rklancer committed Jul 15, 2013
1 parent ec13537 commit fdee532
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 11 deletions.
15 changes: 11 additions & 4 deletions browser/js/converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,9 @@ require.define("/author/sequences.js", function (require, module, exports, __dir
this.tablePane = pane;
}
}
if (this.dataSetName) this.graphPane.activeDatasetName = this.dataSetName;
if ((this.dataSetName != null) && (this.graphPane != null)) {
this.graphPane.activeDatasetName = this.dataSetName;
}
}

CorrectableSequenceWithFeedback.prototype.getRequiresGraphOrTable = function() {
Expand Down Expand Up @@ -1312,10 +1314,15 @@ require.define("/author/author-panes.js", function (require, module, exports, __
});
};

PredictionGraphPane.prototype.addToStep = function(step, _arg) {
PredictionGraphPane.prototype.addToStep = function(step, args) {
var isActiveInputPane, previousAnnotation, uiBehavior;
isActiveInputPane = _arg.isActiveInputPane, previousAnnotation = _arg.previousAnnotation;
PredictionGraphPane.__super__.addToStep.apply(this, arguments);
if (args != null) {
isActiveInputPane = args.isActiveInputPane, previousAnnotation = args.previousAnnotation;
} else {
isActiveInputPane = true;
previousAnnotation = false;
}
if (isActiveInputPane) {
uiBehavior = this.predictionType === "continuous_curves" ? "freehand" : "extend";
step.addPredictionTool({
Expand All @@ -1329,7 +1336,7 @@ require.define("/author/author-panes.js", function (require, module, exports, __
annotation: this.annotation
});
}
if (previousAnnotation) {
if (previousAnnotation != null) {
return step.addAnnotationToPane({
index: this.index,
annotation: previousAnnotation
Expand Down
11 changes: 8 additions & 3 deletions lib/author/author-panes.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion lib/author/sequences.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions src/author/author-panes.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,19 @@ AuthorPane.classFor['PredictionGraphPane'] = class PredictionGraphPane extends G
super
@annotation = runtimeActivity.createAndAppendAnnotation {type: 'FreehandSketch'}

addToStep: (step, {isActiveInputPane, previousAnnotation}) ->
addToStep: (step, args) ->
super
if args?
{ isActiveInputPane, previousAnnotation } = args
else
isActiveInputPane = true
previousAnnotation = false

if isActiveInputPane
uiBehavior = if @predictionType is "continuous_curves" then "freehand" else "extend"
step.addPredictionTool { @index, @datadefRef, @annotation, uiBehavior }
step.addAnnotationToPane { @index, @annotation }
if previousAnnotation
if previousAnnotation?
step.addAnnotationToPane { @index, annotation: previousAnnotation }


Expand Down
2 changes: 1 addition & 1 deletion src/author/sequences.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class CorrectableSequenceWithFeedback
@graphPane = pane if pane instanceof AuthorPane.classFor['PredefinedGraphPane']
@tablePane = pane if pane instanceof AuthorPane.classFor['TablePane']

if @dataSetName then @graphPane.activeDatasetName = @dataSetName
if @dataSetName? and @graphPane? then @graphPane.activeDatasetName = @dataSetName

getRequiresGraphOrTable: ->
@getHasVisualPrompts() || @getNeedsGraphData()
Expand Down

0 comments on commit fdee532

Please sign in to comment.