Skip to content

Commit

Permalink
Anti-plagiarism — post-activity survey link injection JS; CSS [iet:88…
Browse files Browse the repository at this point in the history
…26775]
  • Loading branch information
nfreear committed Apr 26, 2017
1 parent e9a6ed9 commit d3fda3d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
13 changes: 13 additions & 0 deletions style/ouop-styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,19 @@ div[ data-region = drawer ] {
.col-tesla-status-vr {
display: none;
}

// TeSLA consent page.
&#page-local-tesla-views-agreement form .required {
display: none;
}

// Assignment page.
&#page-mod-assign-view.ouop-submitted {
#region-main h2,
#intro {
display: none;
}
}
}


Expand Down
12 changes: 10 additions & 2 deletions user/ouop-local-fixes.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,18 @@
};

OUOP.inject_post_activity_survey_link = function ($, resp) {
var $container = $('#page-mod-quiz-review #user-notifications');
var $container_quiz = $('#page-mod-quiz-review #user-notifications');
var $container_assign = $('#page-mod-assign-view');
var survey_url = resp.config.post_survey_url.replace('{OUCU}', resp.profile.ouop_oucu);

$container.append(OUOP.alert(OUOP.str('post_survey_msg', survey_url)));
$container_quiz.append(OUOP.alert(OUOP.str('post_survey_msg', survey_url)));

if ($container_assign.find('.submissionstatussubmitted').length) {
$container_assign.find('#user-notifications').append(OUOP.alert(OUOP.str('post_survey_msg', survey_url)));
$container_assign.addClass('ouop-submitted');

C.warn('post-activity-survey-link: assign');
}
};

OUOP.toggle_hidden_ui_button = function ($) {
Expand Down
3 changes: 3 additions & 0 deletions user/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,12 @@
function ouop_less_test ($) {
var $less_error = $('style[ id = "less:error-message" ]');
var $less = $('style[ id ^= less ]');
var $css = $('link[ href *= "ouop-styles.css" ]');

if ($less_error.length) {
C.error('ouopenid LESS error:', $less.attr('id'), $('.less-error-message').text());
} else if ($css.length) {
C.debug('ouopenid: ', $css.attr('href'));
} else if ($less.length) {
C.debug('ouopenid: ', $less.attr('id'));
} else {
Expand Down

0 comments on commit d3fda3d

Please sign in to comment.