show lesson solution

This commit is contained in:
lawson89@gmail.com
2014-08-27 21:59:29 -04:00
parent ff76644664
commit 5cf9b4752a
12 changed files with 238 additions and 129 deletions

View File

@ -117,7 +117,55 @@
</div>
</div>
</div>
</div>
<div class="row" id="lesson_cookies_row">
<div class="col-md-12">
<h4>Lesson Parameters and Cookies</h4>
<div class="panel" >
<div class="panel-body" id="lesson_cookies">
</div>
</div>
</div>
</div>
<div class="row" id="lesson_hint_row">
<div class="col-md-12">
<h4>Lesson Hints</h4>
<div class="panel" >
<div class="panel-body" id="lesson_hint">
</div>
</div>
</div>
</div>
<div class="row" id="lesson_plan_row">
<div class="col-md-12">
<h4>Lesson Plan</h4>
<div class="panel" >
<div class="panel-body" id="lesson_plan">
</div>
</div>
</div>
</div>
<div class="row" id="lesson_solution_row">
<div class="col-md-12">
<h4>Lesson Solution</h4>
<div class="panel" >
<div class="panel-body" id="lesson_solution">
</div>
</div>
</div>
</div>
<div class="row" id="lesson_source_row">
<div class="col-md-12">
<h4>Lesson Source Code</h4>
<div class="panel" >
<div class="panel-body" id="lesson_source">
</div>
</div>
</div>
</div>
</section>
</section>
@ -140,6 +188,7 @@
event.preventDefault();
$.get(this.href, {}, function(reply) {
$("#lesson_content").html(reply);
goat.utils.showLessonSource();
}, "html");
});
app.init();
@ -196,40 +245,13 @@
alert('status: ' + statusText + '\n\nresponseText: \n' + responseText +
'\n\nThe output div should have already been updated with the responseText.');
}
// JASON - SEE THIS HOOK
// update lesson cookies and params
// make any embedded forms ajaxy
goat.utils.showLessonCookiesAndParams();
goat.utils.makeFormsAjax();
}
</script>
</body>
<!-- Modals -->
<script type="text/ng-template" id="showSource.html">
<div class="modal-header">
<button class="btn btn-primary pull-right" ng-click="ok()">Close</button>
<h3 class="modal-title">Lesson Source</h3>
</div>
<div class="modal-body">
<pre>{{lessonSource}}</pre>
</div>
<div class="modal-footer">
<button class="btn btn-primary" ng-click="ok()">Close</button>
</div>
</script>
<script type="text/ng-template" id="showSolution.html">
<div class="modal-header">
<button class="btn btn-primary pull-right" ng-click="ok()">Close</button>
<h3 class="modal-title">Lesson Solution</h3>
</div>
<div class="modal-body" ng-include="lessonSolutionUrl">
</div>
<div class="modal-footer">
<button class="btn btn-primary" ng-click="ok()">Close</button>
</div>
</script>
</html>

View File

@ -0,0 +1,39 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%--
Document : hints
Created on : Aug 27, 2014, 3:41:46 PM
Author : rlawson
--%>
<%@page contentType="text/html" pageEncoding="windows-1252"%>
<div class="col-md-6">
<table class="table table-condensed table-striped">
<caption><span class="label label-default">Parameters</span></caption>
<thead>
<tr><th>Name</th><th>Value</th></tr>
</thead>
<tbody>
<c:forEach var="wgparam" items="${wgparams}" varStatus="status">
<tr><td><span class="label label-info">${wgparam.name}</span></td><td>${wgparam.value}</td></tr>
</c:forEach>
</tbody>
</table>
</div>
<div class="col-md-6">
<table class="table table-condensed table-striped">
<caption><span class="label label-default">Cookies</span></caption>
<thead>
<tr><th>Name</th><th>Value</th></tr>
</thead>
<tbody>
<c:forEach var="wgcookie" items="${wgcookies}" varStatus="status">
<tr><td><span class="label label-info">${wgcookie.name}</span></td><td>${wgcookie.value}</td></tr>
</c:forEach>
</tbody>
</table>
</div>

View File

@ -0,0 +1,27 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%--
Document : hints
Created on : Aug 27, 2014, 3:41:46 PM
Author : rlawson
--%>
<%@page contentType="text/html" pageEncoding="windows-1252"%>
<div class="panel-group" id="accordion">
<c:forEach var="hint" items="${hints}" varStatus="status">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse_${hint.number}">
Hint-${hint.number}
</a>
</h3>
</div>
<div id="collapse_${hint.number}" class="panel-collapse collapse">
<div class="panel-body">
${hint.hint}
</div>
</div>
</div>
</c:forEach>
</div>