content conditional on if problem in quiz/test or homework

オープン
#2,059 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 4 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
15/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
perl
領域
backend

調査の方向性

The workaround lives in a macro file loaded through pgCourse.pl and reads $showHint, $numOfAttempts and $displayHintsQ, and the issue notes that $showHint is being removed in 2.18. Start by checking how the problem context (homework versus quiz, test or gateway) is exposed to PG macros in the current release. Done means the maintainers agree on a supported way to vary problem text by context, which the thread does not yet settle.

索引モデルが issue の本文から書いたものです。

説明

This is a continuation of an idea posed in #1156, where @esternin discussed content being conditional on whether a problem is being presented in a regular homework set, or in a gateway/quiz/test.

I'm trying to have text conditionally appear for problems depending on the presentation context -- whether in a homework set or a quiz/test/gateway. here's my current solution, which relies on $showHint.

# I put this in a macro file, included via pgCourse.pl
sub theresahint {
 my $hintafter = $showHint+1;

my $hintReminder = '';
if ($numOfAttempts<$hintafter && $displayHintsQ == 1){
    $hintReminder = '(This problem has a hint that shows after ' . $hintafter . ' attempts.)';}

$hintReminder;
};

And then I include this in the problem text via

\{ theresahint \}

or if in PGML, I use

[@ theresahint @]*

is there a better way? so far I have failed to find, and now I learn that, per @drgrice1, $showHint is being removed in 2.18...

主要言語
Perl
スター
164
フォーク
167
平均マージ
6日 7時間
マージ済み PR(30日)
27

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

openwebwork/webwork2 のほかの issue

openwebwork/webwork2 の issue をすべて見る

似ている issue

Perl の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。