From 9c8caba0644b7c84b25fab7206a5855241727fb9 Mon Sep 17 00:00:00 2001 From: sachingrover211 Date: Sat, 28 Sep 2019 16:26:19 -0700 Subject: [PATCH 1/7] null check added for one row of message missing value in the logs. --- log/createDashboard_js.php | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/log/createDashboard_js.php b/log/createDashboard_js.php index 5e44847..36394d1 100644 --- a/log/createDashboard_js.php +++ b/log/createDashboard_js.php @@ -1,22 +1,22 @@ . + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with Dragoon. If not, see . */ include "logAnalysis.php"; include "logProblemObject.php"; @@ -84,7 +84,7 @@ function getQuery($section, $mode, $activity, $user, $problem, $fromDate, $toDat (!empty($mode)?$modeString:""). (!empty($activity)?$activityString:""). "ORDER BY user asc, problem asc, time asc, id asc;"; - // $queryString = "SELECT tid, mode, session.session_id, user, problem, time, method, message, `group` from session JOIN step ON session.session_id = step.session_id where method != 'client-message' AND mode != 'AUTHOR' AND user = 'cdluna' AND problem LIKE '%ps3-0%' ORDER BY user asc, problem asc, tid asc;"; + //$queryString = "SELECT tid, session.session_id, mode, user, problem, time, method, message, folder from session JOIN step ON session.session_id = step.session_id where section = 'lms-CPI_Fall_2017' AND method != 'runtime-error' AND mode NOT LIKE '%AUTHOR' AND user = 'jarell13' ORDER BY user asc, problem asc, time asc, id asc;"; //echo $queryString; return $queryString; @@ -535,7 +535,7 @@ function parseMessages($result){ //when some other property came and is not for the current node. this is primarily because some log messages just didnt reach the database if($currentNode!=null && strpos($currentNode->id, $newMessage['nodeID']) === false){ $pushNodeBack = true; - $newNode = $upObject->getNodeFromName($newMessage['node']); + $newNode = (array_key_exists("node", $newMessage)?$upObject->getNodeFromName($newMessage['node']):null); if($newNode != null && !($newNode->nodeExist)){ //the node was deleted and without the description for re creation did not reach. so just start from the value that you have. $newNode->id = $newNode->id."|".$newMessage['nodeID']; @@ -543,7 +543,7 @@ function parseMessages($result){ } else if($newNode == null) { $newNode = new Node(); $newNode->id = $newMessage['nodeID']; - $newNode->name = $newMessage['node']; //has come after description so the node name will always be there. + $newNode->name = array_key_exists("node", $newMessage)?$newMessage['node']:""; $newNode->openTimes = 1; $newNode->nodeExist = true; } From a6c8cb9e2d3bf1939763c861d6bc716a7a6fe6e0 Mon Sep 17 00:00:00 2001 From: sachingrover211 Date: Tue, 1 Oct 2019 06:08:19 -0700 Subject: [PATCH 2/7] changes for out of order messages due to network issue --- log/createDashboard_js.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/log/createDashboard_js.php b/log/createDashboard_js.php index 36394d1..2efd1c8 100644 --- a/log/createDashboard_js.php +++ b/log/createDashboard_js.php @@ -516,7 +516,7 @@ function parseMessages($result){ } else if($newNode == null && $currentNode != null && strpos($currentNode->id, $newMessage['nodeID']) === false){ // case when no node exists and an out of order message. this issue has been fixed but still for fall 14 analysis it is needed $newNode = new Node(); - $newNode->name = $newMessage['node']; + $newNode->name = array_key_exists("node", $newMessage)?$newMessage['node']:""; $newNode->id = $nodeID; $newNode->openTimes = 0; $newNode->nodeExist = true; @@ -547,7 +547,7 @@ function parseMessages($result){ $newNode->openTimes = 1; $newNode->nodeExist = true; } - } else if($currentNode == null && count($upObject->nodes) == 0){ + } else if($currentNode == null /*&& count($upObject->nodes) == 0*/){ //first message is out of order $currentNode = new Node(); $currentNode->id = $newMessage['nodeID']; From 3d8d15ab68b9eb4bdecc113bd01b34b4546bfb64 Mon Sep 17 00:00:00 2001 From: riteshsamala Date: Fri, 28 Feb 2020 16:04:21 -0700 Subject: [PATCH 3/7] Inconsistent state with multiple yellow nodes #576 --- www/js/model.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/www/js/model.js b/www/js/model.js index 6bbb11f..83e3f22 100644 --- a/www/js/model.js +++ b/www/js/model.js @@ -1403,6 +1403,11 @@ define([ update("schemas"); update("entity"); update("equation"); + //in case slots are not yet corrected, return incorrect even if the equation status is demo, refer to topomath issue "Inconsistent state with multiple yellow nodes #576" + var slotsCorrected = this.areSlotsDemo(studentID); + if(bestStatus == "demo" && this.getStatus(studentID,"equation").status == "demo" && !slotsCorrected){ + bestStatus = "incorrect"; + } } if(bestStatus == "partial"){ bestStatus = "incorrect"; @@ -1484,6 +1489,20 @@ define([ var entityValid = entityStatusObj.status == "correct" || entityStatusObj.status == "demo"; return schemaValid && entityValid; }, + areSlotsDemo: function(nodeID){ + var ret = false; + var statusObj = this.getNode(nodeID).status; + Object.keys(statusObj).some(function(key){ + if(key!= "schemas" && key!= "entity" && key!= "description" && key!= "equation"){ + console.log(key); + if(statusObj[key] == "demo"){ + ret = true; + return true; + } + } + }); + return ret; + }, getGreenScore: function(problemConditions){ //returns the percentage of the greens or stars from all the user solved nodes so far //nodeDen is the denominator the score being computed. It comprises of all the nodes student attempted so far (which exludes given nodes) From 6d5891c88d0439cddb5752c4d5d0e8220b4e961c Mon Sep 17 00:00:00 2001 From: riteshsamala Date: Tue, 3 Mar 2020 13:55:26 -0700 Subject: [PATCH 4/7] radios moved into label to see if touch screen bug is fixed: just a test --- www/index.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/www/index.php b/www/index.php index 1f79326..a9b91a3 100644 --- a/www/index.php +++ b/www/index.php @@ -319,10 +319,15 @@
- - - - + + + - - - + +
diff --git a/www/js/con-student.js b/www/js/con-student.js index c56a45f..c4a90e9 100644 --- a/www/js/con-student.js +++ b/www/js/con-student.js @@ -198,7 +198,7 @@ define([ // A list of control map specific to students resettableControls: ["equation"], - variableNodeControls: ["variable","value","units"], + variableNodeControls: ["variable","value","units","variableType"], equationNodeControls: ["equation","schemas","entity"], commonNodeControls: ["modelType","description"], qtyElements: ["qtyDescriptionInputboxContainerStudent","variableTypeContainer","variableInputboxContainer", "unitsSelectorContainerStudent"], @@ -239,9 +239,8 @@ define([ units: "unitsSelectorStudent", modelType: "modelSelector", value: "valueInputbox", - unknown: "unknownType", - parameter: "parameterType", - dynamic: "dynamicType", + variableType: "variableType", + //dynamic: "dynamicType", schemas: "schemaSelector", entity: "entitySelectorStudent", schemaDisplay: "schemaDescriptionQuestionMark", @@ -310,12 +309,12 @@ define([ // Log Error //} }, - handleVariableType: function(e){ + handleVariableType: function(varType){ // Summary : Sets variableType to Unknown/Parameter/Dynamic // Value is not allowed when variableType is Unknown // Value is handled when variableType is parameter or dynamic. console.log("********************* in handleVariableType"); - var _variableType = e.target.value; + var _variableType = varType; this._model.student.setVariableType(this.currentID, _variableType); this.variableTypeControls(this.currentID, _variableType); this.applyDirectives(this._PM.processAnswer(this.currentID, 'variableType', _variableType)); @@ -505,6 +504,7 @@ define([ console.log("element",elem); style.set(elem,"display","block"); }); + //initially disable the type value and units which will be later handled in control settings based on state this.disableTypeValueUnits(true); @@ -717,13 +717,24 @@ define([ style.set("unitsSelectorContainerStudent","display","none"); } + /* var prevSelected = query("input[name='variableType']:checked")[0] ? query("input[name='variableType']:checked")[0].value : undefined; if(prevSelected) - registry.byId(prevSelected+"Type").set('checked', false); + registry.byId(prevSelected+"Type").set('checked', false); */ + var varTypeSel = registry.byId(this.controlMap.variableType); + varTypeSel.removeOption(varTypeSel.getOptions()); + var varTypes = ["unknown","parameter","dynamic"]; + //var curVarType = this._model.student.getVariableType(nodeid); + if(!varType){ + varTypeSel.addOption({label: "---Select---", value: "defaultValue"}); + } + array.forEach(varTypes, function(unit){ + varTypeSel.addOption({label: unit, value: unit}); + }); if(varType){ - registry.byId(varType+"Type").set('checked', true); - this.variableTypeControls(this.currentID, varType); - } + varTypeSel.set('value', varType); + } + this.variableTypeControls(this.currentID, varType); this.applyDirectives(nodeDirectives); registry.byId(this.controlMap.variable).set("disabled",false); } @@ -1015,18 +1026,18 @@ define([ updateVariableTypeValue: function(value){ if(value == "unknown") this._model.student.setValue(this.currentID, ""); - registry.byId(value+"Type").set("checked", "checked"); + registry.byId(this.controlMap.variableType).set('value', value); this._model.student.setVariableType(this.currentID, value); }, updateVariableTypeStatus: function(attribute, value){ if(attribute === "disabled" && value === true){ - array.forEach(this._variableTypes, function(type){ - registry.byId(type+"Type").set("disabled", true); - }); + //array.forEach(this._variableTypes, function(type){ + registry.byId(this.controlMap.variableType).set("disabled", true); + //}); } else if(attribute === "status"){ - var selectedVariableType = query("input[name='variableType']:checked")[0].value; - registry.byId(selectedVariableType+"Type").set(attribute, value); + //var selectedVariableType = query("input[name='variableType']:checked")[0].value; + registry.byId(this.controlMap.variableType).set(attribute, value); } }, handleEquationDescription: function(description){ @@ -1073,9 +1084,11 @@ define([ disableTypeValueUnits: function(disable){ registry.byId(this.controlMap.value).set("disabled", disable); registry.byId(this.controlMap.units).set("disabled", disable); + registry.byId(this.controlMap.variableType).set("disabled", disable); + /* registry.byId(this.controlMap.unknown).set("disabled", disable); registry.byId(this.controlMap.parameter).set("disabled", disable); - registry.byId(this.controlMap.dynamic).set("disabled", disable); + registry.byId(this.controlMap.dynamic).set("disabled", disable); */ }, getSlotVariablesList: function(){ return this._model.student.getAllVariables(); diff --git a/www/js/controller.js b/www/js/controller.js index 6d8b8a0..0df67dc 100755 --- a/www/js/controller.js +++ b/www/js/controller.js @@ -90,7 +90,7 @@ define([ // Controls that are select menus // note that topomath author design has been updated, so updating selects and equationButtons array //selects: ['description', 'units', 'inputs'], - selects: ['description', 'units'], + selects: ['description', 'units', 'variableType'], //equationButtons: ["plus", "minus", "times", "divide", "equals", "undo", "equationDone"], equationButtons: [], @@ -205,6 +205,7 @@ define([ Previously, just set domNode.bgcolor but this approach didn't work for text boxes. */ // console.log(">>>>>>>>>>>>> setting color ", this.domNode.id, " to ", value); + /* if(this.domNode && this.domNode.firstChild && (this.domNode.firstChild.name == "variableType" || this.domNode.name == "variableType")){ @@ -213,9 +214,8 @@ define([ updateColor(registry.byId(type+"Type").domNode.firstChild.labels[0], ""); }); updateColor(this.domNode.firstChild.labels[0], colorMap[value]); - } else { - updateColor(this.domNode, colorMap[value]); - } + } else { */ + updateColor(this.domNode, colorMap[value]); }, hideCloseNodeEditor: function(/* originical hide method*/ doHide){ @@ -503,16 +503,22 @@ define([ return this.disableHandlers || this.handleEquationDescription.apply(this, arguments); })); + //event handler for new variable type select field + var varTypeSel = registry.byId(this.controlMap.variableType); + varTypeSel.on('Change', lang.hitch(this, function(){ + return this.disableHandlers || this.handleVariableType.apply(this, arguments); + })); /* * event handler for 'value' field * 'handleValue' will be called in either Student or Author mode * */ - var variableTypeToggle = dojo.query(".handleVariable"); + /* + var variableTypeToggle = dojo.query(".handleVariable"); variableTypeToggle.forEach(function(toggleNode){ registry.byNode(toggleNode).on('click', lang.hitch(this, function(event){ return this.disableHandlers || this.handleVariableType(event); })); - }, this); + }, this); */ var valueWidget = registry.byId(this.controlMap.value); // This event gets fired if student hits TAB or input box @@ -718,11 +724,12 @@ define([ // reset the variablte type radio button labels if(this.nodeType == "quantity"){ + /* array.forEach(this._variableTypes, function(type){ var w = registry.byId(type+"Type") w.set("status", ""); w.set("disabled", false); - }); + });*/ } for(control in this.genericDivMap) @@ -800,6 +807,9 @@ define([ // Initial input in Units box registry.byId(this.controlMap.units).set('value', unit || ''); + var varType = model.getVariableType(nodeid); + registry.byId(this.controlMap.variableType).set('value', varType || ''); + } else if(this.nodeType == "equation"){ //populate nodeEditor fields for an equation node From 107494299aa94f347cc4874cd24cee661e30bd86 Mon Sep 17 00:00:00 2001 From: riteshsamala Date: Fri, 6 Mar 2020 14:00:31 -0700 Subject: [PATCH 6/7] from and to date feature added and bugs removed --- log/createDashboard_js.php | 5 ++--- log/js/dashboard.js | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/log/createDashboard_js.php b/log/createDashboard_js.php index 2efd1c8..6a08a58 100644 --- a/log/createDashboard_js.php +++ b/log/createDashboard_js.php @@ -31,7 +31,6 @@ function __construct($con){ function createDashboard($section, $mode, $activity, $user, $problem, $fromTime, $fromDate, $toTime, $toDate){ $query = $this->getQuery($section, $mode, $activity, $user, $problem, $fromTime, $fromDate, $toTime, $toDate); - //echo $query; $result = $this->al->getResults($query); $objects = null; if($result->num_rows != 0) @@ -43,7 +42,7 @@ function createDashboard($section, $mode, $activity, $user, $problem, $fromTime, function getQuery($section, $mode, $activity, $user, $problem, $fromDate, $toDate, $fromTime, $toTime){ $userString = "AND user = '".$user."' "; $fromTimeString = "AND time >= '".$fromDate.(!empty($fromTime)?(" ".$fromTime):"")."' "; - $toTimeString = "AND time <= '".(!empty($toDate)?$toDate:$fromDate).(!empty($toTime)?(" ".$toTime):"")."' "; + $toTimeString = "AND time <= '".$toDate.(!empty($toTime)?(" ".$toTime):"")."' "; $modeConnector = "="; if(substr($mode, 0, 1) == "!"){ @@ -80,7 +79,7 @@ function getQuery($section, $mode, $activity, $user, $problem, $fromDate, $toDat " AND method != 'runtime-error' ". (!empty($user)?$userString:""). (!empty($problem) ?$problemString:""). - (!empty($fromDate)?$toTimeString:""). + (!empty($toDate)?$toTimeString:""). (!empty($mode)?$modeString:""). (!empty($activity)?$activityString:""). "ORDER BY user asc, problem asc, time asc, id asc;"; diff --git a/log/js/dashboard.js b/log/js/dashboard.js index 4a34c3c..da0e52f 100644 --- a/log/js/dashboard.js +++ b/log/js/dashboard.js @@ -86,6 +86,10 @@ define([ this.query = this.modules.qObject; if(params.t.indexOf("lms") >= 0){ this.query.s = params.s; + if(params.td) + this.query.td=params.td; + if(params.fd) + this.query.fd=params.fd; } }else this.query = params; From 8f5263921bdd098dbcd23b9042e5a7e8ed698749 Mon Sep 17 00:00:00 2001 From: riteshsamala Date: Wed, 18 Mar 2020 02:09:07 -0700 Subject: [PATCH 7/7] Missed edge case in gifted node design #577 --- www/js/model.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/www/js/model.js b/www/js/model.js index 83e3f22..e359e0c 100644 --- a/www/js/model.js +++ b/www/js/model.js @@ -1078,7 +1078,13 @@ define([ if( (nodeStatus === "correct" && score === 0 && completeness) || (nodeStatus === "correct" && score === 1 && tweaked && completeness)) nodeStatus = "perfect"; if(gifted){ - nodeStatus = "gifted-"+nodeStatus; + //if a gifted node turns out to be not a perfect node, ungift it and let user solve it and regular badges follow + if(nodeStatus == "perfect"){ + nodeStatus = "gifted-"+nodeStatus; + } + else{ + this.unGiftNode(id); + } } return nodeStatus; }, @@ -1326,6 +1332,9 @@ define([ isGifted: function(id){ return this.getNode(id).gifted ? true : false; }, + unGiftNode: function(id){ + this.getNode(id).gifted = false; + }, getCorrectAnswer : function(/*string*/ studentID, /*string*/ part){ var id = this.getAuthoredID(studentID); var node = obj.authored.getNode(id);