Commit e5f6bb75 authored by mathieso's avatar mathieso

Bug fixes, new set of installation files.

parent 81b6e8aa
......@@ -192,56 +192,6 @@ display:
row:
type: fields
fields:
counter:
id: counter
table: views
field: counter
relationship: none
group_type: group
admin_label: ''
label: Row
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
counter_start: 1
plugin_id: counter
field_internal_name:
id: field_internal_name
table: node__field_internal_name
......@@ -985,15 +935,6 @@ display:
admin_label: 'Where the exercise is referenced from'
required: false
plugin_id: standard
field_rubric_items:
id: field_rubric_items
table: node__field_rubric_items
field: field_rubric_items
relationship: none
group_type: group
admin_label: 'field_rubric_items: Content'
required: false
plugin_id: standard
arguments: { }
display_extenders: { }
filter_groups:
......
......@@ -320,7 +320,7 @@ display:
admin_label: ''
empty: true
tokenize: false
content: "<p>Here are all of the lessons in the course. Click on a heading to sort.</p>\r\n\r\n<p>\r\n<a href=\"[site:url]/node/add/lesson\" class=\"button button-action button--primary button--small\" data-drupal-link-system-path=\"node/add/lesson\">Add a lesson</a>\r\n</p>"
content: "<p>Here are all of the lessons in the course. Click on a heading to sort.</p>\r\n"
plugin_id: text_custom
footer: { }
empty: { }
......
......@@ -5,7 +5,7 @@
(function($, Drupal) {
"use strict";
Drupal.skillingSettings.adjustListLinksInitialized = false;
Drupal.behaviors.bookNav = {
Drupal.behaviors.adjustListLinks = {
attach: function(context, settings) {
if (Drupal.skillingSettings.adjustListLinksInitialized) {
return;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
/*!
* Fancytree "Lion" skin.
*
* DON'T EDIT THE CSS FILE DIRECTLY, since it is automatically generated from
* the LESS templates.
*/
/*
Lion colors:
gray highlight bar: #D4D4D4
blue highlight-bar and -border #3875D7
*/
// Import common styles
@import "../skin-common.less";
/*******************************************************************************
* Styles specific to this skin.
*
* This section is automatically generated from the `ui-fancytree.less` template.
******************************************************************************/
// Override the variable after the import.
// NOTE: Variables are always resolved as the last definition, even if it is
// after where it is used.
@fancy-use-sprites: true; // false: suppress all background images (i.e. icons)
@fancy-icon-width: 16px;
@fancy-icon-height: 16px;
@fancy-line-height: 16px;
@fancy-icon-spacing: 3px;
// We need to define this variable here (not in skin-common.less) to make it
// work with grunt and webpack:
@fancy-image-prefix: "./skin-lion/";
// Use 'data-uri(...)' to embed the image into CSS instead of linking to 'loading.gif':
// @fancy-loading-url: data-uri("@{fancy-image-prefix}loading.gif");
// Set to `true` to use `data-uri(...)` which will embed icons.gif into CSS
// instead of linking to that file:
// @fancy-inline-sprites: true;
/*******************************************************************************
* Node titles
*/
span.fancytree-title {
border: 1px solid transparent; // reserve some space for status borders
border-radius: 0;
}
span.fancytree-focused span.fancytree-title {
outline: 1px dotted black;
}
span.fancytree-selected span.fancytree-title,
span.fancytree-active span.fancytree-title {
background-color: #D4D4D4; // gray
}
span.fancytree-selected span.fancytree-title {
font-style: italic;
}
.fancytree-treefocus span.fancytree-selected span.fancytree-title,
.fancytree-treefocus span.fancytree-active span.fancytree-title {
color: white;
background-color: #3875D7; // blue
}
/*******************************************************************************
* 'table' extension
*/
table.fancytree-ext-table {
border-collapse: collapse;
tbody {
tr.fancytree-focused {
background-color: #99DEFD;
}
tr.fancytree-active {
background-color: royalblue;
}
tr.fancytree-selected {
background-color: #99DEFD;
}
}
}
/*******************************************************************************
* 'columnview' extension
*/
table.fancytree-ext-columnview tbody tr td {
border: 1px solid gray;
}
table.fancytree-ext-columnview span.fancytree-node.fancytree-expanded {
background-color: #ccc;
}
table.fancytree-ext-columnview span.fancytree-node.fancytree-active {
background-color: royalblue;
}
......@@ -47,6 +47,7 @@
let answer = answerControl.val().trim();
// Stop if MT.
if (answer === "") {
Drupal.skillingSettings.savingFibResponse = false;
swal(Drupal.t("Sorry, please type an answer."));
$(answerControl).focus().select();
return;
......
......@@ -200,6 +200,10 @@
*/
hideRightSidebar: function(sidebarStuff) {
$("#right-sidebar").hide(Drupal.skillingSettings.sidebarHider.speed);
// Set the arrow direction.
$("#skilling-toggle-right-sidebar-arrow")
.text(Drupal.skillingSettings.sidebarHider.leftArrowCharacter)
.attr("title", Drupal.skillingSettings.sidebarHider.showSidebarTitle);
// sidebarStuff.sidebarStopPos = sidebarStuff.sidebarWidth;
// Drupal.behaviors.sidebarHider.hideRightSidebarStep(sidebarStuff);
},
......@@ -228,6 +232,9 @@
*/
showRightSidebar: function(sidebarStuff) {
$("#right-sidebar").show(Drupal.skillingSettings.sidebarHider.speed);
// Set the arrow direction.
$("#skilling-toggle-right-sidebar-arrow").text(Drupal.skillingSettings.sidebarHider.rightArrowCharacter)
.attr("title", Drupal.skillingSettings.sidebarHider.hideSidebarTitle);
// sidebarStuff.sidebarStopPos = 0;
// // Show the sidebar.
// sidebarStuff.sidebar.removeClass(drupalSettings.hidingClass);
......@@ -262,6 +269,9 @@
*/
hideLeftSidebar: function(sidebarStuff) {
$("#left-sidebar").hide(Drupal.skillingSettings.sidebarHider.speed);
// Set the arrow direction.
$("#skilling-toggle-left-sidebar-arrow").text(Drupal.skillingSettings.sidebarHider.rightArrowCharacter)
.attr("title", Drupal.skillingSettings.sidebarHider.showSidebarTitle);
// sidebarStuff.sidebarStopPos = -sidebarStuff.sidebarWidth;
// Drupal.behaviors.sidebarHider.hideLeftSidebarStep(sidebarStuff);
},
......@@ -293,6 +303,9 @@
*/
showLeftSidebar: function(sidebarStuff) {
$("#left-sidebar").show(Drupal.skillingSettings.sidebarHider.speed);
// Set the arrow direction.
$("#skilling-toggle-left-sidebar-arrow").text(Drupal.skillingSettings.sidebarHider.leftArrowCharacter)
.attr("title", Drupal.skillingSettings.sidebarHider.hideSidebarTitle);
// sidebarStuff.sidebarStopPos = 0;
// // Show the sidebar. It will be off-screen.
// sidebarStuff.sidebar.removeClass(drupalSettings.hidingClass);
......
......@@ -2,13 +2,28 @@
Installation
Still need completion score page?
X - add new fields
- test on shared host
X - initial valuies of new config flags and shit.
? Trimmed date format
# user editing
? Students can't see/edit their first/last name.
# Exercises
Max days after no submission possible.
# Starter content
- can't create paragraphs when adding exercises due to class.
- class - start date MT
......
No preview for this file type
......@@ -626,6 +626,9 @@ views.view.submissions_administration.yml so
views.view.suggestions_administration.yml so
views.view.user_details_header_contextual_filter_.yml so
# CUSTOM TIME
core.date_format.trimmed_date.yml co
# INPUT FORMAT AND FILTER
filter.format.skilling.yml co
editor.editor.skilling.yml co
......
......@@ -1628,31 +1628,45 @@ function skilling_node_view_alter(array &$build, Drupal\Core\Entity\EntityInterf
}
// Need to add exercise submission links?
if ($node->bundle() === SkillingConstants::EXERCISE_CONTENT_TYPE) {
/** @var \Drupal\skilling\Submissions $submissionsService */
$submissionsService = Drupal::service('skilling.submissions');
$renderableSubmissionLinks = $submissionsService->createSubmissionLinks($node);
$showExerciseLink = $currentUser->isAdministrator()
|| $currentUser->isAuthor()
|| $currentUser->isReviewer()
|| $currentUser->isInstructor()
|| $currentUser->isGrader();
$build['submission_status'] = [
'#theme' => 'exercise_submission_links',
'#exercise_nid' => $node->id(),
'#internal_name' => $node->field_internal_name->value,
'#submission_links' => $renderableSubmissionLinks,
'#show_exercise_link' => $showExerciseLink ? 'yes' : 'no',
'#weight' => 10,
// '#cache' => [
// 'max-age' => 0,
// ],
$tagOptions = [
'internal_name' => $node->field_internal_name->value
];
$exerciseTagProcessor = new ExerciseTag([], 'out-of-plugin-context', NULL);
$build['exercise'] = [
'#markup' => $exerciseTagProcessor->processTag('', $tagOptions),
'#weight' => 5,
'#attached' => [
'library' => 'skilling/exercise-links',
'drupalSettings' => [
'skillingFloatQueryParam' => SkillingConstants::FLOATER_QUERY_STRING,
],
],
]
];
// /** @var \Drupal\skilling\Submissions $submissionsService */
// $submissionsService = Drupal::service('skilling.submissions');
// $renderableSubmissionLinks = $submissionsService->createSubmissionLinks($node);
// $showExerciseLink = $currentUser->isAdministrator()
// || $currentUser->isAuthor()
// || $currentUser->isReviewer()
// || $currentUser->isInstructor()
// || $currentUser->isGrader();
// $build['submission_status'] = [
// '#theme' => 'exercise_submission_links',
// '#exercise_nid' => $node->id(),
// '#internal_name' => $node->field_internal_name->value,
// '#submission_links' => $renderableSubmissionLinks,
// '#show_exercise_link' => $showExerciseLink ? 'yes' : 'no',
// '#weight' => 10,
// // '#cache' => [
// // 'max-age' => 0,
// // ],
// '#attached' => [
// 'library' => 'skilling/exercise-links',
// 'drupalSettings' => [
// 'skillingFloatQueryParam' => SkillingConstants::FLOATER_QUERY_STRING,
// ],
// ],
// ];
if ($currentUser->isAdministrator() || $currentUser->isAuthor()) {
// Add a link to add a new exercise.
$addExerciseLink = [
......@@ -2812,6 +2826,7 @@ function skilling_theme($existing, $type, $theme, $path) {
'insert_exercise' => [
'variables' => [
'exercise_nid' => NULL,
'out_of_plugin_context' => NULL,
'title' => NULL,
'summary' => NULL,
'task' => NULL,
......
langcode: en
status: true
dependencies: { }
id: trimmed_date
label: 'Trimmed date'
locked: false
pattern: 'M j, Y'
......@@ -65,8 +65,8 @@ content:
region: content
label: inline
settings:
format_type: medium
timezone_override: ''
format_type: trimmed_date
third_party_settings: { }
links:
weight: 0
......
langcode: en
status: true
dependencies: { }
machineName: custom
name: Custom
description: 'User created tokens types using the Custom Tokens module.'
......@@ -1070,7 +1070,9 @@ class SkillingAccessChecker {
// even though will never use them all. This will help instructors
// and authors keep the entire feedback cycle in mind, and help
// reviewers understand the system.
$allow = TRUE;
if ($fieldName != SkillingConstants::FIELD_SHOW_PORTFOLIO) {
$allow = TRUE;
}
}
elseif ($grader) {
switch ($fieldName) {
......@@ -1084,13 +1086,16 @@ class SkillingAccessChecker {
case SkillingConstants::FIELD_FEEDBACK_SUMMARY_GOOD:
case SkillingConstants::FIELD_FEEDBACK_SUMMARY_NEEDS_WORK:
case SkillingConstants::FIELD_FEEDBACK_SUMMARY_POOR:
case SkillingConstants::FIELD_SHOW_PORTFOLIO:
// case SkillingConstants::FIELD_SHOW_PORTFOLIO:
$allow = TRUE;
break;
}
}
elseif ($student) {
if ($editOperation && $fieldName === SkillingConstants::FIELD_BADGES_AWARDED) {
if ($fieldName == SkillingConstants::FIELD_SHOW_PORTFOLIO) {
$allow = FALSE;
}
elseif ($editOperation && $fieldName === SkillingConstants::FIELD_BADGES_AWARDED) {
$allow = FALSE;
}
else {
......
......@@ -386,8 +386,8 @@ class MakeNodes {
'field_internal_name' => $internalName,
'field_notes' => t('Notes for @title', ['@title' => $title]),
'body' => [
'summary' => t('Description of @title', ['@title' => $title]),
'value' => t('Summary of @title', ['@title' => $title]),
'summary' => t('Summary of @title', ['@title' => $title]),
'value' => t('Deets for @title', ['@title' => $title]),
],
'field_rubric_items' => $rubricItems,
]
......
......@@ -97,6 +97,14 @@ class ExerciseTag extends SkillingCustomTagBase {
*/
protected $dateFormatter;
/**
* Whether the markup is rendered out of the context of the normal
* plugin. The code is used by skilling.module as well.
*
* @var bool
*/
protected $isOutOfContext = FALSE;
/**
* ExerciseTag constructor.
*
......@@ -112,7 +120,13 @@ class ExerciseTag extends SkillingCustomTagBase {
$pluginId,
$pluginDefinition
) {
parent::__construct($configuration, $pluginId, $pluginDefinition);
// Class can be used by skilling.module, not in plugin context.
if ($pluginId === 'out-of-plugin-context') {
$this->isOutOfContext = TRUE;
}
else {
parent::__construct($configuration, $pluginId, $pluginDefinition);
}
$this->entityTypeManager = \Drupal::service('entity_type.manager');
$this->skillingUtilities = \Drupal::service('skilling.utilities');
$this->nidBag = \Drupal::service('skilling.nid_bag');
......@@ -205,6 +219,10 @@ class ExerciseTag extends SkillingCustomTagBase {
$summary = $exercise->body->summary;
// Get the full body.
$task = $exercise->body->value;
// Check that the parser exists.
if (!$this->parser) {
$this->parser = \Drupal::service('skilling.skillingparser');
}
$task = $this->parser->parse($task);
$renderableSubmissionLinks = $this->submissionsService->createSubmissionLinks($exercise);
$showExerciseLink = $this->currentUser->isAdministrator()
......@@ -269,6 +287,7 @@ class ExerciseTag extends SkillingCustomTagBase {
/* @noinspection PhpUndefinedFieldInspection */
$renderable = [
'#theme' => 'insert_exercise',
'#out_of_plugin_context' => $this->isOutOfContext,
'#title' => $exercise->getTitle(),
'#summary' => $summary,
'#task' => $task,
......
This diff is collapsed.
{# Insert an exercise into content. #}
{# Internal name is used as a destination for some links. #}
{# Template used when inserting exercise by parser, or when showing exercise stand-alone. #}
{# The var out_of_plugin_context identifies the latter. #}
{{ attach_library('skilling/insert-exercise-styling') }}
<h4>Thing: {{ out_of_plugin_context }}</h4>
{% if not out_of_plugin_context %}
<h3>using not</h3>
{% endif %}
{% if out_of_plugin_context %}
<h3>using nothing</h3>
{% endif %}
<div class="skilling-insert-exercise" id="{{ internal_name }}">
<div class="skilling-insert-exercise-legend">{{ 'Exercise'|t }}</div>
<p class="skilling-insert-exercise-title">{{ title }}
{% if not out_of_plugin_context %}
<div class="skilling-insert-exercise-legend">{{ 'Exercise'|t }}</div>
{% endif %}
<p class="skilling-insert-exercise-title">
{% if not out_of_plugin_context %}
{{ title }}
{% endif %}
{% if challenge %}
<img src="{{ challenge_image_url }}"
title="Challenge exercise"
......@@ -47,7 +63,9 @@
{% endif %}
</p>
{% endif %}
<div class="skilling-insert-exercise-task">{{ task|raw }}</div>
{% if not out_of_plugin_context %}
<div class="skilling-insert-exercise-task">{{ task|raw }}</div>
{% endif %}
{% include '@skilling/exercise-submission-links.html.twig' with
{
'exercise_nid': exercise_nid,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment