Skip to content

Commit

Permalink
Concept Map Component: We now show the auto feedback in a modal dialog.
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffreykwan committed Sep 17, 2016
1 parent d54fc2a commit 9970204
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ class ConceptMapController {
}
];

// the auto feedback string
this.autoFeedbackString = '';

if (this.componentContent != null) {

// get the component id
Expand Down Expand Up @@ -3819,15 +3822,47 @@ class ConceptMapController {
if (thisResult.feedback != null) {
if (resultString != "") {
// add a new line if the result string is not empty
resultString += "\n";
resultString += "<br/>";
}

// display the feedback
resultString += "Feedback: " + thisResult.feedback;
}

// show the result to the student
alert(resultString);
//alert(resultString);

// remember the feedback string
this.autoFeedbackString = resultString;

// show the auto feedback in a modal dialog
this.$mdDialog.show(
this.$mdDialog.alert()
.parent(angular.element(document.querySelector('#feedbackDiv')))
.clickOutsideToClose(true)
.title('Feedback')
.htmlContent(resultString)
.ariaLabel('Feedback')
.ok('Close')
);
}

/**
* Show the auto feedback that was generated when the student previously
* clicked "Check Answer".
*/
showAutoFeedback() {

// show the auto feedback in a modal dialog
this.$mdDialog.show(
this.$mdDialog.alert()
.parent(angular.element(document.querySelector('#feedbackDiv')))
.clickOutsideToClose(true)
.title('Feedback')
.htmlContent(this.autoFeedbackString)
.ariaLabel('Feedback')
.ok('Close')
);
}
};

Expand Down

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

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/main/webapp/wise5/components/conceptMap/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@
</div>
<button ng-click="conceptMapController.resetConceptMap()">Reset</button>
<button ng-click="conceptMapController.checkAnswer()">Check Answer</button>
<button ng-click="conceptMapController.showAutoFeedback()"
ng-show="conceptMapController.autoFeedbackString != null && conceptMapController.autoFeedbackString != ''">
Show Feedback
</button>
<div id="conceptMapContainer" style="display: flex">
<div id="selectNodeBar" style="flex: 10; border: 1px solid black">
<div ng-repeat="availableNode in conceptMapController.availableNodes"
Expand Down Expand Up @@ -251,7 +255,7 @@
</div>
</div>
</div>

<div id="feedbackDiv"></div>
<md-button class="input--textarea__action input--textarea__action--revision md-icon-button"
ng-click='nodeController.showRevisions($event, component.id, conceptMapController.isDisabled)'
ng-if="nodeController.getRevisions(component.id).length > 1">
Expand Down

0 comments on commit 9970204

Please sign in to comment.