Skip to content

Commit

Permalink
added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wing-puah committed Feb 15, 2019
1 parent 219db7f commit 18629a9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
20 changes: 10 additions & 10 deletions server/routes/routes.js
Expand Up @@ -50,23 +50,27 @@ module.exports = function (app, passport) {
});

app.get('/exams', function(req, res) {
// Populate with the course exam data
/***
Recommended exam data structure: [{
title: string,
price: int,
writeup/copy: string
}]
***/
readJSONFile(path.join( process.cwd(), '/dist/data/courses.json'), (err, json) => {
if(err){ throw err; }
res.render('examList', json)
});
})

// Need logic on on click, redirection with course id

app.get('/exam', function(req, res){
let examQns;

readJSONFile(path.join( process.cwd(), '/server/protected/exams.json'), (err, json) => {
if(err){ throw err; }
// examQns = json
// let examArr = [];
// examArr.push(json)
// examArr.push({scripts: '<script src="/js/exam.js"></script>'})
// console.log(examArr)
// examQns.push({scrips: '<script src="/js/exam.js"></script>'})
console.log('test quetions:', json);
res.render('examList', json)
})
Expand All @@ -86,8 +90,4 @@ module.exports = function (app, passport) {
res.send({ status: user, message: info })
})(req, res, next);
});

app.get('/tt', isLoggedIn, (req, res) => {
console.log('auth tt: ' + req.isAuthenticated())
});
};
9 changes: 6 additions & 3 deletions src/partials/layouts/examList.hbs
Expand Up @@ -9,12 +9,13 @@
<div class="card-body row align-items-end mx-0">
<div>
<h3 class="card-title d-inline-block" style="width: 85%;">{{this.title}}</h3>
<span class="small float-right">$</span> <!--- Replace with price data --->
<span class="small float-right">$</span> <!--- Replace with price data {{ this.price }}--->
</div>
<p class="card-text">
Here is some example text <!--- Replace with text data --->
Here is some example text <!--- Replace with text data {{this.text}}--->
</p>
<a href="#" class="btn btn-gradient width--full" > <!--- Replace with a href data --->
<!--- Replace with a href data or write post function, depending on logic --->
<a href="#" class="btn btn-gradient width--full" >
Enroll
</a>
</div>
Expand All @@ -24,3 +25,5 @@

</div>
</div>

<script src="/js/"

0 comments on commit 18629a9

Please sign in to comment.