Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-35418 fixed up whitespaces

  • Loading branch information...
commit dd55ec309b7ae3c4ac205aa85e1636c267102675 1 parent 43d333c
Aparup Banerjee nebgor authored

Showing 2 changed files with 71 additions and 71 deletions. Show diff stats Hide diff stats

  1. +16 16 mod/scorm/locallib.php
  2. +55 55 mod/scorm/module.js
32 mod/scorm/locallib.php
@@ -419,13 +419,13 @@ function scorm_insert_track($userid, $scormid, $scoid, $attempt, $element, $valu
419 419 }
420 420 if (($element == 'cmi.success_status') && ($value == 'passed' || $value == 'failed')) {
421 421 if ($DB->get_record('scorm_scoes_data', array('scoid' => $scoid, 'name' => 'objectivesetbycontent'))) {
422   - $objectiveprogressstatus = true;
423   - $objectivesatisfiedstatus = false;
424   - if ($value == 'passed') {
425   - $objectivesatisfiedstatus = true;
  422 + $objectiveprogressstatus = true;
  423 + $objectivesatisfiedstatus = false;
  424 + if ($value == 'passed') {
  425 + $objectivesatisfiedstatus = true;
426 426 }
427 427
428   - if ($track = $DB->get_record('scorm_scoes_track', array('userid' => $userid,
  428 + if ($track = $DB->get_record('scorm_scoes_track', array('userid' => $userid,
429 429 'scormid' => $scormid,
430 430 'scoid' => $scoid,
431 431 'attempt' => $attempt,
@@ -434,8 +434,8 @@ function scorm_insert_track($userid, $scormid, $scoid, $attempt, $element, $valu
434 434 $track->timemodified = time();
435 435 $DB->update_record('scorm_scoes_track', $track);
436 436 $id = $track->id;
437   - } else {
438   - $track = new stdClass();
  437 + } else {
  438 + $track = new stdClass();
439 439 $track->userid = $userid;
440 440 $track->scormid = $scormid;
441 441 $track->scoid = $scoid;
@@ -444,8 +444,8 @@ function scorm_insert_track($userid, $scormid, $scoid, $attempt, $element, $valu
444 444 $track->value = $objectiveprogressstatus;
445 445 $track->timemodified = time();
446 446 $id = $DB->insert_record('scorm_scoes_track', $track);
447   - }
448   - if ($objectivesatisfiedstatus) {
  447 + }
  448 + if ($objectivesatisfiedstatus) {
449 449 if ($track = $DB->get_record('scorm_scoes_track', array('userid' => $userid,
450 450 'scormid' => $scormid,
451 451 'scoid' => $scoid,
@@ -466,12 +466,12 @@ function scorm_insert_track($userid, $scormid, $scoid, $attempt, $element, $valu
466 466 $track->timemodified = time();
467 467 $id = $DB->insert_record('scorm_scoes_track', $track);
468 468 ob_start();
469   - $filepath = $CFG->dataroot."\\temp\\tempfile.txt";
470   - $fh = fopen($filepath, "a+");
471   - var_dump($track);
472   - $string = ob_get_clean();
473   - fwrite($fh, $string);
474   - fclose($fh);
  469 + $filepath = $CFG->dataroot."\\temp\\tempfile.txt";
  470 + $fh = fopen($filepath, "a+");
  471 + var_dump($track);
  472 + $string = ob_get_clean();
  473 + fwrite($fh, $string);
  474 + fclose($fh);
475 475 }
476 476 }
477 477 }
@@ -1789,7 +1789,7 @@ function scorm_get_toc($user, $scorm, $cmid, $toclink=TOCJSLINK, $currentorg='',
1789 1789 }
1790 1790
1791 1791 $url = new moodle_url('/mod/scorm/player.php?a='.$scorm->id.'&currentorg='.$currentorg.$modestr);
1792   - $result->tocmenu = $OUTPUT->single_select($url, 'scoid', $tocmenu, $result->sco->id, null, "tocmenu");
  1792 + $result->tocmenu = $OUTPUT->single_select($url, 'scoid', $tocmenu, $result->sco->id, null, "tocmenu");
1793 1793 }
1794 1794
1795 1795 $result->prerequisites = $treeview->prerequisites;
110 mod/scorm/module.js
@@ -168,14 +168,14 @@ M.mod_scorm.init = function(Y, hide_nav, hide_toc, toc_title, window_name, launc
168 168 */
169 169 var scorm_fixnav = function() {
170 170 scorm_buttons[0].set('disabled', (scorm_skipprev(scorm_current_node) == null || scorm_skipprev(scorm_current_node).title == null ||
171   - scoes_nav[launch_sco].hideprevious == 1));
172   - scorm_buttons[1].set('disabled', (scorm_prev(scorm_current_node) == null || scorm_prev(scorm_current_node).title == null ||
173   - scoes_nav[launch_sco].hideprevious == 1));
  171 + scoes_nav[launch_sco].hideprevious == 1));
  172 + scorm_buttons[1].set('disabled', (scorm_prev(scorm_current_node) == null || scorm_prev(scorm_current_node).title == null ||
  173 + scoes_nav[launch_sco].hideprevious == 1));
174 174 scorm_buttons[2].set('disabled', (scorm_up(scorm_current_node) == null) || scorm_up(scorm_current_node).title == null);
175   - scorm_buttons[3].set('disabled', (((scorm_next(scorm_current_node) == null || scorm_next(scorm_current_node).title == null) &&
176   - (scoes_nav[launch_sco].flow != 1)) || (scoes_nav[launch_sco].hidecontinue == 1)));
  175 + scorm_buttons[3].set('disabled', (((scorm_next(scorm_current_node) == null || scorm_next(scorm_current_node).title == null) &&
  176 + (scoes_nav[launch_sco].flow != 1)) || (scoes_nav[launch_sco].hidecontinue == 1)));
177 177 scorm_buttons[4].set('disabled', (scorm_skipnext(scorm_current_node) == null || scorm_skipnext(scorm_current_node).title == null ||
178   - scoes_nav[launch_sco].hidecontinue == 1));
  178 + scoes_nav[launch_sco].hidecontinue == 1));
179 179 };
180 180
181 181 var scorm_resize_parent = function() {
@@ -260,7 +260,7 @@ M.mod_scorm.init = function(Y, hide_nav, hide_toc, toc_title, window_name, launc
260 260
261 261 // Handle AJAX Request
262 262 var scorm_ajax_request = function(url, datastring) {
263   - var myRequest = NewHttpReq();
  263 + var myRequest = NewHttpReq();
264 264 var result = DoRequest(myRequest, url + datastring);
265 265 return result;
266 266 };
@@ -271,7 +271,7 @@ M.mod_scorm.init = function(Y, hide_nav, hide_toc, toc_title, window_name, launc
271 271 var parentscoid = scoes_nav[launch_sco].parentscoid;
272 272 node.parent.title = scoes_nav[parentscoid].url;
273 273 if (update_launch_sco) {
274   - launch_sco = parentscoid;
  274 + launch_sco = parentscoid;
275 275 }
276 276 return node.parent;
277 277 }
@@ -291,10 +291,10 @@ M.mod_scorm.init = function(Y, hide_nav, hide_toc, toc_title, window_name, launc
291 291 typeof scoes_nav[launch_sco].prevscoid != 'undefined') {
292 292 var node = scorm_lastchild(node.previousSibling);
293 293 if (node) {
294   - var prevscoid = scoes_nav[launch_sco].prevscoid;
  294 + var prevscoid = scoes_nav[launch_sco].prevscoid;
295 295 node.title = scoes_nav[prevscoid].url;
296 296 if (update_launch_sco) {
297   - launch_sco = prevscoid;
  297 + launch_sco = prevscoid;
298 298 }
299 299 return node;
300 300 } else {
@@ -306,17 +306,17 @@ M.mod_scorm.init = function(Y, hide_nav, hide_toc, toc_title, window_name, launc
306 306
307 307 var scorm_skipprev = function(node, update_launch_sco) {
308 308 if (node.previousSibling && typeof scoes_nav[launch_sco].prevsibling != 'undefined') {
309   - var prevsibling = scoes_nav[launch_sco].prevsibling;
  309 + var prevsibling = scoes_nav[launch_sco].prevsibling;
310 310 node.previousSibling.title = scoes_nav[prevsibling].url;
311 311 if (update_launch_sco) {
312   - launch_sco = prevsibling;
  312 + launch_sco = prevsibling;
313 313 }
314 314 return node.previousSibling;
315 315 } else if (node.depth > 0 && typeof scoes_nav[launch_sco].parentscoid != 'undefined') {
316   - var parentscoid = scoes_nav[launch_sco].parentscoid;
  316 + var parentscoid = scoes_nav[launch_sco].parentscoid;
317 317 node.parent.title = scoes_nav[parentscoid].url;
318 318 if (update_launch_sco) {
319   - launch_sco = parentscoid;
  319 + launch_sco = parentscoid;
320 320 }
321 321 return node.parent;
322 322 }
@@ -328,11 +328,11 @@ M.mod_scorm.init = function(Y, hide_nav, hide_toc, toc_title, window_name, launc
328 328 return scorm_tree_node.getRoot().children[0];
329 329 }
330 330 if (node.children.length && typeof scoes_nav[launch_sco].nextscoid != 'undefined') {
331   - var node = node.children[0];
  331 + var node = node.children[0];
332 332 var nextscoid = scoes_nav[launch_sco].nextscoid;
333 333 node.title = scoes_nav[nextscoid].url;
334 334 if (update_launch_sco) {
335   - launch_sco = nextscoid;
  335 + launch_sco = nextscoid;
336 336 }
337 337 return node;
338 338 }
@@ -341,74 +341,74 @@ M.mod_scorm.init = function(Y, hide_nav, hide_toc, toc_title, window_name, launc
341 341
342 342 var scorm_skipnext = function(node, update_launch_sco) {
343 343 if (node.nextSibling && typeof scoes_nav[launch_sco].nextsibling != 'undefined') {
344   - var nextsibling = scoes_nav[launch_sco].nextsibling;
  344 + var nextsibling = scoes_nav[launch_sco].nextsibling;
345 345 node.nextSibling.title = scoes_nav[nextsibling].url;
346 346 if (update_launch_sco) {
347   - launch_sco = nextsibling;
  347 + launch_sco = nextsibling;
348 348 }
349 349 return node.nextSibling;
350 350 } else if (node.depth > 0 && typeof scoes_nav[launch_sco].parentscoid != 'undefined') {
351   - var parentscoid = scoes_nav[launch_sco].parentscoid;
352   - if (update_launch_sco) {
353   - launch_sco = parentscoid;
354   - }
  351 + var parentscoid = scoes_nav[launch_sco].parentscoid;
  352 + if (update_launch_sco) {
  353 + launch_sco = parentscoid;
  354 + }
355 355 return scorm_skipnext(node.parent, update_launch_sco);
356 356 }
357 357 return null;
358 358 };
359 359
360   - // Launch prev sco
  360 + // Launch prev sco
361 361 var scorm_launch_prev_sco = function() {
362   - var result = null;
363   - if (scoes_nav[launch_sco].flow == 1) {
364   - var datastring = scoes_nav[launch_sco].url + '&function=scorm_seq_flow&request=backward';
  362 + var result = null;
  363 + if (scoes_nav[launch_sco].flow == 1) {
  364 + var datastring = scoes_nav[launch_sco].url + '&function=scorm_seq_flow&request=backward';
365 365 result = scorm_ajax_request(M.cfg.wwwroot + '/mod/scorm/datamodels/sequencinghandler.php?', datastring);
366 366 mod_scorm_seq = encodeURIComponent(result);
367 367 result = JSON.parse (result);
368 368 if (typeof result.nextactivity.id != undefined) {
369   - var node = scorm_prev(scorm_tree_node.getHighlightedNode())
370   - if (node == null) {
371   - // Avoid use of TreeView for Navigation
372   - node = scorm_tree_node.getHighlightedNode();
373   - }
374   - node.title = scoes_nav[result.nextactivity.id].url;
375   - launch_sco = result.nextactivity.id;
376   - scorm_activate_item(node);
377   - scorm_fixnav();
  369 + var node = scorm_prev(scorm_tree_node.getHighlightedNode())
  370 + if (node == null) {
  371 + // Avoid use of TreeView for Navigation
  372 + node = scorm_tree_node.getHighlightedNode();
  373 + }
  374 + node.title = scoes_nav[result.nextactivity.id].url;
  375 + launch_sco = result.nextactivity.id;
  376 + scorm_activate_item(node);
  377 + scorm_fixnav();
378 378 } else {
379   - scorm_activate_item(scorm_prev(scorm_tree_node.getHighlightedNode(), true));
  379 + scorm_activate_item(scorm_prev(scorm_tree_node.getHighlightedNode(), true));
380 380 }
381 381 } else {
382   - scorm_activate_item(scorm_prev(scorm_tree_node.getHighlightedNode(), true));
  382 + scorm_activate_item(scorm_prev(scorm_tree_node.getHighlightedNode(), true));
383 383 }
384 384 };
385   -
  385 +
386 386 // Launch next sco
387 387 var scorm_launch_next_sco = function () {
388   - var result = null;
389   - if (scoes_nav[launch_sco].flow == 1) {
390   - var datastring = scoes_nav[launch_sco].url + '&function=scorm_seq_flow&request=forward';
  388 + var result = null;
  389 + if (scoes_nav[launch_sco].flow == 1) {
  390 + var datastring = scoes_nav[launch_sco].url + '&function=scorm_seq_flow&request=forward';
391 391 result = scorm_ajax_request(M.cfg.wwwroot + '/mod/scorm/datamodels/sequencinghandler.php?', datastring);
392 392 mod_scorm_seq = encodeURIComponent(result);
393 393 result = JSON.parse (result);
394 394 if (typeof result.nextactivity.id != undefined) {
395   - var node = scorm_next(scorm_tree_node.getHighlightedNode())
396   - if (node == null) {
397   - // Avoid use of TreeView for Navigation
398   - node = scorm_tree_node.getHighlightedNode();
399   - }
400   - node.title = scoes_nav[result.nextactivity.id].url;
401   - launch_sco = result.nextactivity.id;
402   - scorm_activate_item(node);
403   - scorm_fixnav();
  395 + var node = scorm_next(scorm_tree_node.getHighlightedNode())
  396 + if (node == null) {
  397 + // Avoid use of TreeView for Navigation
  398 + node = scorm_tree_node.getHighlightedNode();
  399 + }
  400 + node.title = scoes_nav[result.nextactivity.id].url;
  401 + launch_sco = result.nextactivity.id;
  402 + scorm_activate_item(node);
  403 + scorm_fixnav();
404 404 } else {
405   - scorm_activate_item(scorm_next(scorm_tree_node.getHighlightedNode(), true));
  405 + scorm_activate_item(scorm_next(scorm_tree_node.getHighlightedNode(), true));
406 406 }
407 407 } else {
408   - scorm_activate_item(scorm_next(scorm_tree_node.getHighlightedNode(), true));
  408 + scorm_activate_item(scorm_next(scorm_tree_node.getHighlightedNode(), true));
409 409 }
410 410 };
411   -
  411 +
412 412 mod_scorm_launch_prev_sco = scorm_launch_prev_sco;
413 413 mod_scorm_launch_next_sco = scorm_launch_next_sco;
414 414
@@ -511,7 +511,7 @@ M.mod_scorm.init = function(Y, hide_nav, hide_toc, toc_title, window_name, launc
511 511 scorm_activate_item(scorm_skipprev(scorm_tree_node.getHighlightedNode(), true));
512 512 });
513 513 scorm_buttons[1].on('click', function(ev) {
514   - scorm_launch_prev_sco();
  514 + scorm_launch_prev_sco();
515 515 });
516 516 scorm_buttons[2].on('click', function(ev) {
517 517 scorm_activate_item(scorm_up(scorm_tree_node.getHighlightedNode(), true));
@@ -526,7 +526,7 @@ M.mod_scorm.init = function(Y, hide_nav, hide_toc, toc_title, window_name, launc
526 526 }
527 527
528 528 // finally activate the chosen item
529   - var scorm_first_url = tree.getRoot().children[0];
  529 + var scorm_first_url = tree.getRoot().children[0];
530 530 scorm_first_url.title = scoes_nav[launch_sco].url;
531 531 scorm_activate_item(scorm_first_url);
532 532

0 comments on commit dd55ec3

Please sign in to comment.
Something went wrong with that request. Please try again.