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

[#39] Updating web client for teacher (0.7.4) #71

Closed
wants to merge 82 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
ec15591
[#39] Birth of a web app for teachers (session values page)
chrqls Apr 17, 2014
ef11ae4
Merge commit '43e7ac9' into dev
chrqls Apr 17, 2014
414b089
Merge pull request #54 from chrqls/dev
chrqls Apr 17, 2014
ad66305
[#39] home page displays different content if a session is already ru…
chrqls Apr 18, 2014
2d1f0c2
[#39] choose activity flow step...
chrqls Apr 18, 2014
769dffa
Merge commit '414b089' into dev
chrqls Apr 18, 2014
cd36430
Merge pull request #55 from chrqls/dev
chrqls Apr 18, 2014
3ccb8c4
When saving a new iqset, the server always overrided the session valu…
chrqls Apr 19, 2014
5a43eff
[#39] Use prepared questions step is coming: IQSets listed
chrqls Apr 19, 2014
60ff228
Merge commit 'cd36430' into dev
chrqls Apr 19, 2014
314ebec
[#39] Better list for 'use prepared questions' step
chrqls Apr 21, 2014
bc81fd2
Merge pull request #56 from chrqls/dev
chrqls Apr 21, 2014
584c2fb
[#39] Loading an IQSet
chrqls Apr 22, 2014
bf385e8
Merge pull request #57 from chrqls/dev
chrqls Apr 22, 2014
dd8ee43
[#39] Adding the number of questions for each IQSet
chrqls Apr 23, 2014
632fab7
Merge commit 'bf385e8' into dev
chrqls Apr 23, 2014
20b9116
[#39] Trying to implement the preview IQSet feature but still not wor…
chrqls Apr 25, 2014
0a96f6a
Merge pull request #58 from chrqls/dev
chrqls Apr 25, 2014
3e310ff
[#39] Preview IQSet is working
chrqls Apr 29, 2014
4d17255
[#39] Cleaning code
chrqls Apr 29, 2014
28148d6
[#39] Insert list of iqsets in a table, adding different values in 'p…
chrqls Apr 29, 2014
66da742
Merge commit '0a96f6a' into dev
chrqls Apr 29, 2014
af1f233
Merge pull request #59 from chrqls/dev
chrqls Apr 29, 2014
51a4c59
[#39] Adding the session values in /smile/all
chrqls May 4, 2014
7b6b8a9
[#39] Synchronizing session values with android app, upgrading the qu…
chrqls May 4, 2014
90bdc9d
[#39] Major update on the ability of the webapp to adapt the page dep…
chrqls May 4, 2014
84c93ae
[#39] Removing recovering button
chrqls May 4, 2014
6ce31b0
[#39] Adding detail of a question
chrqls May 4, 2014
e11d668
[#39] Back button synchronize with server
chrqls May 4, 2014
8372fa3
[#39] Cleaning and commenting code
chrqls May 4, 2014
9f2d669
Merge commit 'af1f233' into dev
chrqls May 4, 2014
f4c9394
Merge pull request #60 from chrqls/dev
chrqls May 4, 2014
1fba44d
[#39] Connecting url to display the image in the detail of a question
chrqls May 5, 2014
05e3646
[#39] Trying to delete a question in a session from web client
chrqls May 6, 2014
4ceda74
Merge commit 'f4c9394' into dev
chrqls May 6, 2014
caa2751
Merge pull request #61 from chrqls/dev
chrqls May 6, 2014
8fec955
[#39] Need to post this code for tests
chrqls May 6, 2014
aa8d792
Merge pull request #62 from chrqls/dev
chrqls May 6, 2014
151525c
[#39] The app could not switch to the list of questions when loading …
chrqls May 10, 2014
218f1a2
Merge commit 'aa8d792' into dev
chrqls May 10, 2014
41943fb
Merge pull request #63 from chrqls/dev
chrqls May 10, 2014
9d2e401
[#39] 'Quit' button appears
chrqls May 11, 2014
8234e50
[#39] Fixing bug about dupplicate questions
chrqls May 12, 2014
8ccd683
[#39] Sections managed by the 'smile' attribute
chrqls May 13, 2014
a7888c9
Merge commit '41943fb' into dev
chrqls May 13, 2014
739af98
[#39] Upgrading design(in progress), reseting questions when leaving,…
chrqls May 14, 2014
1050d9b
[#39] Adding tabs for the board, designing list of iqsets
chrqls May 14, 2014
75df7e5
[#39] Previewing an IQSet instead of a list of questions. And so? we …
chrqls May 14, 2014
15b48ca
[#39] design: harmonizing buttons and lists
chrqls May 14, 2014
f37bf8b
Merge pull request #65 from chrqls/dev
chrqls May 14, 2014
bf8e2d0
refs #66 Merge branch 'dev' of github.com:RazortoothRTC/node-smile-se…
truedat101 May 17, 2014
0f2da25
[#39] Cool, the ajax refresh in general activity is working for quest…
chrqls May 18, 2014
ffbb3c0
[#39] Student list appears
chrqls May 18, 2014
a51cd70
[#39] Adding the new logo smile teacher
chrqls May 19, 2014
151ca84
[#39] New interface, still in process for details
chrqls May 19, 2014
9d3388e
[#39] v0.6.1: Updating session values during start make
chrqls May 19, 2014
6407c63
Merge commit 'bf8e2d0' into dev
chrqls May 19, 2014
6d2c67b
Merge pull request #67 from chrqls/dev
chrqls May 20, 2014
51c720d
[#39] Interactive buttons, status in auto-update, updating view
chrqls May 21, 2014
94d0f98
Merge commit '6d2c67b' into dev
chrqls May 21, 2014
d854705
[#39] Cool, START_SOLVE and START_SHOW appearsgs
chrqls May 21, 2014
cc65545
[#39] Refresh page when starting a session
chrqls May 22, 2014
e983383
[#39] Only delete questions during START_MAKE phase
chrqls May 22, 2014
c8aff66
[#39] Start solving button only appearing if students>0 and cleaning …
chrqls May 22, 2014
9b928dd
Removing from versionning static/js/.DS_Store
chrqls May 22, 2014
b08b68d
[#39] Yeeeees, I finally found a way to increase smileAlert for a bet…
chrqls May 23, 2014
3610c14
[#39] smileAlert v2 operational
chrqls May 23, 2014
93c4a8b
[#39] Size of students and questions appearing
chrqls May 23, 2014
a24d6f5
[#39] Checkbox selection in process but working good for now
chrqls May 23, 2014
96601a5
[#39] I finally found a way to fix tr selection when switching section
chrqls May 23, 2014
0edec6f
[#39] Yeeeees, we can save new iqset with web teacher app
chrqls May 24, 2014
18b1824
[#39] Fixing 2 bugs: multiple selection listener called in UpdateGVM(…
chrqls May 24, 2014
10d973c
[#39] Making global variables in capital to manage time interval (for…
chrqls May 24, 2014
fe0a3ea
[#39] Replacing double by single quote in most of the JS. Opacity for…
chrqls May 24, 2014
bc81bd3
Merge pull request #68 from chrqls/dev
chrqls May 26, 2014
1d4c879
[#39] Scrolling within the table in the list of iqsets
chrqls May 28, 2014
0d04672
[#39] New interface: this interface limits useless scrolling, less em…
chrqls May 29, 2014
b12a44b
Merge commit 'bc81bd3' into dev
chrqls May 29, 2014
8366d2a
[#39] Ajusting absolute alerts to new design and forcing 2 rows for '…
chrqls May 30, 2014
435e086
[#39] First part (the get part) of the finger selection for iqsets
chrqls May 30, 2014
4dd8296
[#39] Second part (the post part) of the finger selection for iqsets
chrqls Jun 3, 2014
37ceeb3
[#39] Upgrading smileAlert (cross or not), removing old way, removing…
chrqls Jun 3, 2014
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
43 changes: 19 additions & 24 deletions routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ exports.handleDeleteIQSet = function(req, res) {
exports.handlePostNewIQSet = function(req, res) {

console.log("\n\n[BODY of json request]");
console.log("\t>> %j\n", req.body);
console.log("[HEADERS of json request]");
console.log("\t>> %j\n\n", req.headers);
console.log("%j\n", req.body);

var headers = req.headers;
var iqset;
Expand All @@ -136,21 +134,9 @@ exports.handlePostNewIQSet = function(req, res) {
iqset = req.body;
}

if (!iqset.title) {
// iqset.title = iqdoc.date + "-IQSet";
}

if (!iqset.teachername) {
// iqset.teachername = "Teacher";
}

if (!iqset.groupname) {
// iqset.groupname = "General";
}

if (!iqset.iqdata) {
isValid = false;
}
// Adding values of the current session before saving the IQSet
iqset.teachername = game.teacherName;
iqset.groupname = game.groupName;

if (isValid === true) {
//
Expand All @@ -165,7 +151,6 @@ exports.handlePostNewIQSet = function(req, res) {
// 1. Get the original index of the image
// 2. Change the PICURL to match the new index
//

if (iqset.iqdata[i].PICURL) {
// /smile/questionview/1.jpg
var tmpidx = parseInt(iqset.iqdata[i].PICURL.split('/')[3].split('.')[0], 10);
Expand Down Expand Up @@ -279,6 +264,7 @@ exports.handleSmileRootGet = function(req, res) {
};

exports.handleStartMakeQuestionPut = function(req, res) {

game.setCurrentMessage(MESSAGE_START_MAKE_QUESTION);

//
Expand Down Expand Up @@ -384,9 +370,9 @@ exports.handleStudentResultsGet = function(req, res) {

exports.handleStartSolveQuestionPut = function(req, res) {
var timeLimit = 10; // The same time limit of old implementation.
if (req.body.TIME_LIMIT) {
timeLimit = req.body.TIME_LIMIT;
}
//if (req.body.TIME_LIMIT !== undefined && req.body.TIME_LIMIT) {
// timeLimit = req.body.TIME_LIMIT;
//}
var numberOfQuestions = game.questions.getNumberOfQuestions();
var rightAnswers = game.questions.getRightAnswers();
var message = {};
Expand Down Expand Up @@ -502,11 +488,15 @@ exports.handleAllMessagesGet = function(req, res) {
reset = function() {
oldGame = game;
game = new Game(); // XXX Point to ponder, do we need to save before we destroy the server?
game.setCurrentMessage({ TYPE: 'RESET' , TIMESTAMP: (new Date()).toUTCString(), EXPIRY: 1500});
//game.setCurrentMessage({});
//game.setCurrentMessage({ TYPE: 'RESET' , TIMESTAMP: (new Date()).toUTCString(), EXPIRY: 1500});

/*
setTimeout(function() {
// Remove RESET
game.setCurrentMessage({});
}, 2000);
*/
};

exports.handleResetGet = function(req, res) {
Expand Down Expand Up @@ -624,6 +614,9 @@ exports.createSessionFromTeacherApp = function(req, res) {
if (req.body.groupName) {
game.groupName = req.body.groupName;
}

game.setCurrentMessage({"TYPE":"SESSION_VALUES","teacherName":game.teacherName,"groupName":game.groupName,"sessionName":game.sessionName});

} catch (e) {
res.handleError("Can't parse Incoming JSON in createSessionFromTeacherApp method");
}
Expand Down Expand Up @@ -829,6 +822,7 @@ exports.handleQuestionJSONDelete = function(req, res) {
};

exports.handleQuestionImageGet = function(req, res) {

var questionNumber = parseInt(req.id, 10);
var question = game.questions.getList()[questionNumber];
if (!question) {
Expand All @@ -837,9 +831,10 @@ exports.handleQuestionImageGet = function(req, res) {
if (question.TYPE != "QUESTION_PIC") {
return res.handleError(js.JumboError.notFound('Question does not have picture: ' + questionNumber));
}
console.log('CRASH AT THIS MOMENT>>'+game.questions.getQuestionPicture(questionNumber));
var dataBuffer = new Buffer(game.questions.getQuestionPicture(questionNumber), 'base64');
res.writeHead(200, {
'Content-Type' : 'image/jpeg',
'Content-Type' : 'image/jpeg'
});
res.write(dataBuffer);
res.end();
Expand Down
6 changes: 4 additions & 2 deletions smileplug.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,16 @@ js.get('/smile/currentmessage', routes.handleCurrentMessageGet);
js.put('/smile/startmakequestion', routes.handleStartMakeQuestionPut);
js.post('/smile/startmakequestion', routes.handleStartMakeQuestionPut);

js.get('/smile/startsolvequestion', routes.handleStartSolveQuestionPut);
js.put('/smile/startsolvequestion', routes.handleStartSolveQuestionPut);
js.post('/smile/startsolvequestion', routes.handleStartSolveQuestionPut);
//js.post('/smile/startsolvequestion', routes.handleStartSolveQuestionPut);

js.put('/smile/sendinitmessage', routes.handleSendInitMessagePut);
js.post('/smile/sendinitmessage', routes.handleSendInitMessagePut);

js.get('/smile/sendshowresults', routes.handleSendShowResultsPut);
js.put('/smile/sendshowresults', routes.handleSendShowResultsPut);
js.post('/smile/sendshowresults', routes.handleSendShowResultsPut);
//js.post('/smile/sendshowresults', routes.handleSendShowResultsPut);

js.put('/smile/metadata/rating', routes.handleRatingMetadataPut);
js.post('/smile/metadata/rating', routes.handleRatingMetadataPut);
Expand Down
Binary file added static/images/smile_grey_teacher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ <h3>Plugmin Apps</h3>
<h3>SMILE Web Apps</h3>

<p><a class="success button" href="/smile-student.html">SMILE Student Web App 1.0.5 - Click to Join!</a></p>

<p><a class="success button" href="/smile-teacher.html">SMILE Teacher Web App</a></p>
</div>
</div>
</div>
Expand Down
Binary file removed static/js/.DS_Store
Binary file not shown.
10 changes: 5 additions & 5 deletions static/js/smilestudent.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ GlobalViewModel.doLogin = function() {
}
if (!self.hasSubmitted()) {
console.log('doLogin');
smileAlert('#globalstatus', 'Logging in ' + self.username(), 'green', 5000);
//smileAlert('#globalstatus', 'Logging as ' + self.username(), 'green', 5000);
doSmileLogin(self.clientip(), self.username(), self.realname());
}
self.hasSubmitted(true);
Expand Down Expand Up @@ -238,7 +238,7 @@ GlobalViewModel.doInquiryReset = function() {

GlobalViewModel.doSubmitQ = function() {
var self = this;
console.log(">>>> >>> >> > doSubmitQ");
//console.log(">>>> >>> >> > doSubmitQ");
if (self.validateInquirySubmission()) {

$('#submit-inquiry-area').hide();
Expand Down Expand Up @@ -292,14 +292,14 @@ GlobalViewModel.doSubmitQandDone = function() {

GlobalViewModel.doSaveAnswerState = function() {
var self = this;
console.log(">>>>>>>>>>doSaveAnswerState");
//console.log(">>>>>>>>>>doSaveAnswerState");
self.answersarray()[self.qidx()] = self.answer()[1]; // Drop the leading 'a' from the answer label
self.ratingsarray()[self.qidx()] = self.rating();
}

GlobalViewModel.doAnswerPrevQ = function() {
var self = this;
console.log(">>>>>>>>>>doAnswerPrevQ");
//console.log(">>>>>>>>>>doAnswerPrevQ");
self.doSaveAnswerState();

// Check if there are more questions
Expand All @@ -322,7 +322,7 @@ GlobalViewModel.doAnswerPrevQ = function() {

GlobalViewModel.doAnswerNextQ = function() {
var self = this;
console.log(">>>>>>>>>>doAnswerNextQ");
//console.log(">>>>>>>>>>doAnswerNextQ");

self.doSaveAnswerState();

Expand Down
Loading